From: Andrea Bianco Date: Sat, 16 May 2020 10:13:34 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.4.16 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22card-image.png//%27?a=commitdiff_plain;h=a5f1e5c4e91a950afd55d32d309d322e38c731e5;p=motion2.git Built motion from commit (unavailable).|2.4.16 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 7f9010e..4770ed6 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-05-15T17:45:35.720Z", + "time": "2020-05-16T10:03:28.721Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 32a6354..f8fe8dc 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-05-15T17:45:35.720Z", + "time": "2020-05-16T10:03:28.721Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/public/app/main/apps/chat/i18n/ar.json b/public/app/main/apps/chat/i18n/ar.json index 59596a9..2c09aaa 100644 --- a/public/app/main/apps/chat/i18n/ar.json +++ b/public/app/main/apps/chat/i18n/ar.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "تمكين زر الإرسال", "FEEDBACKTITLE": "عنوان التعليق", "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", - "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "تحميل بدون مرفقات", + "DOWNLOAD_WITH_ATTACHMENTS": "تنزيل بالمرفقات", + "LASTMESSAGE": "اخر رسالة" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/da.json b/public/app/main/apps/chat/i18n/da.json index f25e897..970bb4e 100644 --- a/public/app/main/apps/chat/i18n/da.json +++ b/public/app/main/apps/chat/i18n/da.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Aktivér Send-knap", "FEEDBACKTITLE": "Feedbacktitel", "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", - "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download uden vedhæftede filer", + "DOWNLOAD_WITH_ATTACHMENTS": "Download med vedhæftede filer", + "LASTMESSAGE": "Sidste besked" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/de.json b/public/app/main/apps/chat/i18n/de.json index 767f445..af33775 100644 --- a/public/app/main/apps/chat/i18n/de.json +++ b/public/app/main/apps/chat/i18n/de.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Schaltfläche \"Senden\" aktivieren", "FEEDBACKTITLE": "Feedback-Titel", "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", + "LASTMESSAGE": "Letzte Nachricht" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/es.json b/public/app/main/apps/chat/i18n/es.json index b0e008e..76fe7fc 100644 --- a/public/app/main/apps/chat/i18n/es.json +++ b/public/app/main/apps/chat/i18n/es.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Habilitar botón Enviar", "FEEDBACKTITLE": "Título de comentarios", "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", - "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Descargar sin archivos adjuntos", + "DOWNLOAD_WITH_ATTACHMENTS": "Descargar con archivos adjuntos", + "LASTMESSAGE": "Ultimo mensaje" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/fa.json b/public/app/main/apps/chat/i18n/fa.json index 8d78e63..2fdd92e 100644 --- a/public/app/main/apps/chat/i18n/fa.json +++ b/public/app/main/apps/chat/i18n/fa.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "دکمه ارسال را فعال کنید", "FEEDBACKTITLE": "عنوان بازخورد", "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", - "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "بارگیری بدون پیوست", + "DOWNLOAD_WITH_ATTACHMENTS": "با پیوست ها بارگیری کنید", + "LASTMESSAGE": "آخرین پیام" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/fi.json b/public/app/main/apps/chat/i18n/fi.json index f36cc2c..0ca5536 100644 --- a/public/app/main/apps/chat/i18n/fi.json +++ b/public/app/main/apps/chat/i18n/fi.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Ota Lähetä-painike käyttöön", "FEEDBACKTITLE": "Palautteen otsikko", "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", - "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Lataa ilman liitteitä", + "DOWNLOAD_WITH_ATTACHMENTS": "Lataa liitteineen", + "LASTMESSAGE": "Viimeinen viesti" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/fr.json b/public/app/main/apps/chat/i18n/fr.json index 6956a5c..797122f 100644 --- a/public/app/main/apps/chat/i18n/fr.json +++ b/public/app/main/apps/chat/i18n/fr.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Activer le bouton d'envoi", "FEEDBACKTITLE": "Titre de la rétroaction", "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", - "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Télécharger sans pièces jointes", + "DOWNLOAD_WITH_ATTACHMENTS": "Télécharger avec pièces jointes", + "LASTMESSAGE": "Dernier message" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/he.json b/public/app/main/apps/chat/i18n/he.json index f900e97..36a616f 100644 --- a/public/app/main/apps/chat/i18n/he.json +++ b/public/app/main/apps/chat/i18n/he.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "אפשר לחצן שלח", "FEEDBACKTITLE": "כותרת משוב", "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", - "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "הורד ללא קבצים מצורפים", + "DOWNLOAD_WITH_ATTACHMENTS": "הורד עם קבצים מצורפים", + "LASTMESSAGE": "הודעה אחרונה" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/hi.json b/public/app/main/apps/chat/i18n/hi.json index ce5403f..fb7200a 100644 --- a/public/app/main/apps/chat/i18n/hi.json +++ b/public/app/main/apps/chat/i18n/hi.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "सक्षम करें बटन भेजें", "FEEDBACKTITLE": "प्रतिक्रिया शीर्षक", "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", - "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "संलग्नक के बिना डाउनलोड करें", + "DOWNLOAD_WITH_ATTACHMENTS": "अनुलग्नकों के साथ डाउनलोड करें", + "LASTMESSAGE": "अंतिम संदेश" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/id.json b/public/app/main/apps/chat/i18n/id.json index 2adcfab..58f47f7 100644 --- a/public/app/main/apps/chat/i18n/id.json +++ b/public/app/main/apps/chat/i18n/id.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Aktifkan Tombol Kirim", "FEEDBACKTITLE": "Judul Umpan Balik", "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", - "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Unduh tanpa lampiran", + "DOWNLOAD_WITH_ATTACHMENTS": "Unduh dengan lampiran", + "LASTMESSAGE": "Pesan Terakhir" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/it.json b/public/app/main/apps/chat/i18n/it.json index f6cd612..a1c91fe 100644 --- a/public/app/main/apps/chat/i18n/it.json +++ b/public/app/main/apps/chat/i18n/it.json @@ -442,6 +442,8 @@ "MANDATORYDISPOSITIONPAUSEID": "Pausa da utilizzare se è abilitata la disposizione obbligatoria", "ENABLESENDBUTTON": "Abilita pulsante Invia", "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", - "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Scarica senza allegati", + "DOWNLOAD_WITH_ATTACHMENTS": "Scarica con allegati" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/ja.json b/public/app/main/apps/chat/i18n/ja.json index cd09e2c..9c4dc8c 100644 --- a/public/app/main/apps/chat/i18n/ja.json +++ b/public/app/main/apps/chat/i18n/ja.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "送信ボタンを有効にする", "FEEDBACKTITLE": "フィードバックのタイトル", "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", - "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "添付ファイルなしでダウンロード", + "DOWNLOAD_WITH_ATTACHMENTS": "添付ファイル付きでダウンロード", + "LASTMESSAGE": "最後のメッセージ" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/ko.json b/public/app/main/apps/chat/i18n/ko.json index 6b1e5e1..d21e551 100644 --- a/public/app/main/apps/chat/i18n/ko.json +++ b/public/app/main/apps/chat/i18n/ko.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "보내기 버튼 사용", "FEEDBACKTITLE": "피드백 제목", "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", - "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "첨부 파일없이 다운로드", + "DOWNLOAD_WITH_ATTACHMENTS": "첨부 파일로 다운로드", + "LASTMESSAGE": "마지막 메시지" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/lv.json b/public/app/main/apps/chat/i18n/lv.json index 15b4097..2d0006a 100644 --- a/public/app/main/apps/chat/i18n/lv.json +++ b/public/app/main/apps/chat/i18n/lv.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Iespējot pogu Sūtīt", "FEEDBACKTITLE": "Atsauksmju nosaukums", "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", - "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Lejupielādējiet bez pielikumiem", + "DOWNLOAD_WITH_ATTACHMENTS": "Lejupielādējiet ar pielikumiem", + "LASTMESSAGE": "Pēdējā ziņa" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/nl.json b/public/app/main/apps/chat/i18n/nl.json index e413b96..8bbe48d 100644 --- a/public/app/main/apps/chat/i18n/nl.json +++ b/public/app/main/apps/chat/i18n/nl.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Schakel de verzendknop in", "FEEDBACKTITLE": "Feedbacktitel", "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", - "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download zonder bijlagen", + "DOWNLOAD_WITH_ATTACHMENTS": "Download met bijlagen", + "LASTMESSAGE": "Laatste bericht" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/no.json b/public/app/main/apps/chat/i18n/no.json index eac1809..0a5efed 100644 --- a/public/app/main/apps/chat/i18n/no.json +++ b/public/app/main/apps/chat/i18n/no.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Aktiver sendeknapp", "FEEDBACKTITLE": "Tilbakemeldingstittel", "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", - "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Last ned uten vedlegg", + "DOWNLOAD_WITH_ATTACHMENTS": "Last ned med vedlegg", + "LASTMESSAGE": "Siste melding" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/pl.json b/public/app/main/apps/chat/i18n/pl.json index 7c2b602..8d9ea04 100644 --- a/public/app/main/apps/chat/i18n/pl.json +++ b/public/app/main/apps/chat/i18n/pl.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Włącz przycisk wysyłania", "FEEDBACKTITLE": "Tytuł opinii", "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", - "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Pobierz bez załączników", + "DOWNLOAD_WITH_ATTACHMENTS": "Pobierz z załącznikami", + "LASTMESSAGE": "Ostatnia wiadomość" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/pt-BR.json b/public/app/main/apps/chat/i18n/pt-BR.json index 9c1e267..f064a68 100644 --- a/public/app/main/apps/chat/i18n/pt-BR.json +++ b/public/app/main/apps/chat/i18n/pt-BR.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Ativar botão Enviar", "FEEDBACKTITLE": "Título do Feedback", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", + "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/pt-PT.json b/public/app/main/apps/chat/i18n/pt-PT.json index 6d3de90..cb4def8 100644 --- a/public/app/main/apps/chat/i18n/pt-PT.json +++ b/public/app/main/apps/chat/i18n/pt-PT.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Ativar botão Enviar", "FEEDBACKTITLE": "Título do Feedback", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", + "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/ru.json b/public/app/main/apps/chat/i18n/ru.json index 812a8ef..2b34f28 100644 --- a/public/app/main/apps/chat/i18n/ru.json +++ b/public/app/main/apps/chat/i18n/ru.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Включить кнопку отправки", "FEEDBACKTITLE": "Название отзыва", "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", - "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Скачать без вложений", + "DOWNLOAD_WITH_ATTACHMENTS": "Скачать с вложениями", + "LASTMESSAGE": "Последнее сообщение" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/sv.json b/public/app/main/apps/chat/i18n/sv.json index 47d84e8..463d109 100644 --- a/public/app/main/apps/chat/i18n/sv.json +++ b/public/app/main/apps/chat/i18n/sv.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Aktivera skicka-knappen", "FEEDBACKTITLE": "Feedbacktitel", "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", - "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ladda ner utan bilagor", + "DOWNLOAD_WITH_ATTACHMENTS": "Ladda ner med bilagor", + "LASTMESSAGE": "Senaste meddelandet" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/tr.json b/public/app/main/apps/chat/i18n/tr.json index 3fb4781..e880867 100644 --- a/public/app/main/apps/chat/i18n/tr.json +++ b/public/app/main/apps/chat/i18n/tr.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "Gönder Düğmesini Etkinleştir", "FEEDBACKTITLE": "Geribildirim Başlığı", "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", - "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ekler olmadan indir", + "DOWNLOAD_WITH_ATTACHMENTS": "Eklerle indir", + "LASTMESSAGE": "Son Mesaj" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/zh-CN.json b/public/app/main/apps/chat/i18n/zh-CN.json index d2b33c9..17992c5 100644 --- a/public/app/main/apps/chat/i18n/zh-CN.json +++ b/public/app/main/apps/chat/i18n/zh-CN.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "启用发送按钮", "FEEDBACKTITLE": "反馈标题", "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "下载无附件", + "DOWNLOAD_WITH_ATTACHMENTS": "附件下载", + "LASTMESSAGE": "最后留言" } } \ No newline at end of file diff --git a/public/app/main/apps/chat/i18n/zh-TW.json b/public/app/main/apps/chat/i18n/zh-TW.json index 766a025..dd2a362 100644 --- a/public/app/main/apps/chat/i18n/zh-TW.json +++ b/public/app/main/apps/chat/i18n/zh-TW.json @@ -441,6 +441,9 @@ "ENABLESENDBUTTON": "啟用發送按鈕", "FEEDBACKTITLE": "反饋標題", "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "下載無附件", + "DOWNLOAD_WITH_ATTACHMENTS": "附件下載", + "LASTMESSAGE": "最後留言" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/ar.json b/public/app/main/apps/dashboards/i18n/ar.json index e0dfdb7..64a1de8 100644 --- a/public/app/main/apps/dashboards/i18n/ar.json +++ b/public/app/main/apps/dashboards/i18n/ar.json @@ -540,6 +540,7 @@ "STARTS_WITH": "ابدا ب", "VALUE": "القيمة", "VALUES": "القيم", - "VALUE_RANGE_CHECK": "يجب أن تكون القيمة أكبر من" + "VALUE_RANGE_CHECK": "يجب أن تكون القيمة أكبر من", + "CHOOSE": "أختر" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/da.json b/public/app/main/apps/dashboards/i18n/da.json index 0a1293d..77513a5 100644 --- a/public/app/main/apps/dashboards/i18n/da.json +++ b/public/app/main/apps/dashboards/i18n/da.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Begynder med", "VALUE": "Værdi", "VALUES": "Værdier", - "VALUE_RANGE_CHECK": "Værdien skal være større end" + "VALUE_RANGE_CHECK": "Værdien skal være større end", + "CHOOSE": "Vælge" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/de.json b/public/app/main/apps/dashboards/i18n/de.json index 774253c..cfdefff 100644 --- a/public/app/main/apps/dashboards/i18n/de.json +++ b/public/app/main/apps/dashboards/i18n/de.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Beginnt mit", "VALUE": "Wert", "VALUES": "Werte", - "VALUE_RANGE_CHECK": "Wert muss größer sein als" + "VALUE_RANGE_CHECK": "Wert muss größer sein als", + "CHOOSE": "Wählen" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/en.json b/public/app/main/apps/dashboards/i18n/en.json index 7163503..f695a6a 100644 --- a/public/app/main/apps/dashboards/i18n/en.json +++ b/public/app/main/apps/dashboards/i18n/en.json @@ -543,4 +543,4 @@ "ENABLED": "Enabled", "DISABLED": "Disabled" } -} +} \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/es.json b/public/app/main/apps/dashboards/i18n/es.json index e17120c..24a9aaa 100644 --- a/public/app/main/apps/dashboards/i18n/es.json +++ b/public/app/main/apps/dashboards/i18n/es.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Comienza con", "VALUE": "Valor", "VALUES": "Valores", - "VALUE_RANGE_CHECK": "El valor debe ser mayor que" + "VALUE_RANGE_CHECK": "El valor debe ser mayor que", + "CHOOSE": "Escoger" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/fa.json b/public/app/main/apps/dashboards/i18n/fa.json index fcf157c..b27dc2b 100644 --- a/public/app/main/apps/dashboards/i18n/fa.json +++ b/public/app/main/apps/dashboards/i18n/fa.json @@ -540,6 +540,7 @@ "STARTS_WITH": "شروع می شود با", "VALUE": "مقدار", "VALUES": "ارزش های", - "VALUE_RANGE_CHECK": "ارزش باید بیشتر از" + "VALUE_RANGE_CHECK": "ارزش باید بیشتر از", + "CHOOSE": "انتخاب کنید" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/fi.json b/public/app/main/apps/dashboards/i18n/fi.json index 590b640..f5c74e6 100644 --- a/public/app/main/apps/dashboards/i18n/fi.json +++ b/public/app/main/apps/dashboards/i18n/fi.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Alkaa", "VALUE": "Arvo", "VALUES": "arvot", - "VALUE_RANGE_CHECK": "Arvon on oltava suurempi kuin" + "VALUE_RANGE_CHECK": "Arvon on oltava suurempi kuin", + "CHOOSE": "Valita" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/fr.json b/public/app/main/apps/dashboards/i18n/fr.json index 96edf1e..c8c6ff7 100644 --- a/public/app/main/apps/dashboards/i18n/fr.json +++ b/public/app/main/apps/dashboards/i18n/fr.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Commence avec", "VALUE": "Valeur", "VALUES": "Valeurs", - "VALUE_RANGE_CHECK": "La valeur doit être supérieure à" + "VALUE_RANGE_CHECK": "La valeur doit être supérieure à", + "CHOOSE": "Choisir" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/he.json b/public/app/main/apps/dashboards/i18n/he.json index 146ba2f..86c86ca 100644 --- a/public/app/main/apps/dashboards/i18n/he.json +++ b/public/app/main/apps/dashboards/i18n/he.json @@ -540,6 +540,7 @@ "STARTS_WITH": "מתחיל עם", "VALUE": "ערך", "VALUES": "ערכים", - "VALUE_RANGE_CHECK": "הערך חייב להיות גדול מ-" + "VALUE_RANGE_CHECK": "הערך חייב להיות גדול מ-", + "CHOOSE": "בחר" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/hi.json b/public/app/main/apps/dashboards/i18n/hi.json index 0d807f8..a0adb36 100644 --- a/public/app/main/apps/dashboards/i18n/hi.json +++ b/public/app/main/apps/dashboards/i18n/hi.json @@ -540,6 +540,7 @@ "STARTS_WITH": "इसके साथ आरंभ होता है", "VALUE": "मूल्य", "VALUES": "मान", - "VALUE_RANGE_CHECK": "मान से अधिक होना चाहिए" + "VALUE_RANGE_CHECK": "मान से अधिक होना चाहिए", + "CHOOSE": "चुनें" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/id.json b/public/app/main/apps/dashboards/i18n/id.json index bd80a1b..6bbe666 100644 --- a/public/app/main/apps/dashboards/i18n/id.json +++ b/public/app/main/apps/dashboards/i18n/id.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Dimulai dengan", "VALUE": "Nilai", "VALUES": "Nilai-nilai", - "VALUE_RANGE_CHECK": "Nilai harus lebih besar dari" + "VALUE_RANGE_CHECK": "Nilai harus lebih besar dari", + "CHOOSE": "Memilih" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/ja.json b/public/app/main/apps/dashboards/i18n/ja.json index 6c792fd..7fae0ee 100644 --- a/public/app/main/apps/dashboards/i18n/ja.json +++ b/public/app/main/apps/dashboards/i18n/ja.json @@ -540,6 +540,7 @@ "STARTS_WITH": "で始まる", "VALUE": "値", "VALUES": "価値観", - "VALUE_RANGE_CHECK": "値はより大きい必要があります" + "VALUE_RANGE_CHECK": "値はより大きい必要があります", + "CHOOSE": "選ぶ" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/ko.json b/public/app/main/apps/dashboards/i18n/ko.json index 8694e18..d69ce53 100644 --- a/public/app/main/apps/dashboards/i18n/ko.json +++ b/public/app/main/apps/dashboards/i18n/ko.json @@ -540,6 +540,7 @@ "STARTS_WITH": "로 시작", "VALUE": "값", "VALUES": "가치", - "VALUE_RANGE_CHECK": "값은보다 커야합니다" + "VALUE_RANGE_CHECK": "값은보다 커야합니다", + "CHOOSE": "고르다" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/lv.json b/public/app/main/apps/dashboards/i18n/lv.json index 43feb61..dc092ac 100644 --- a/public/app/main/apps/dashboards/i18n/lv.json +++ b/public/app/main/apps/dashboards/i18n/lv.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Sāk ar", "VALUE": "Vērtība", "VALUES": "Vērtības", - "VALUE_RANGE_CHECK": "Vērtībai jābūt lielākai par" + "VALUE_RANGE_CHECK": "Vērtībai jābūt lielākai par", + "CHOOSE": "Izvēlieties" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/nl.json b/public/app/main/apps/dashboards/i18n/nl.json index 03a140a..e95b8dd 100644 --- a/public/app/main/apps/dashboards/i18n/nl.json +++ b/public/app/main/apps/dashboards/i18n/nl.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Begint met", "VALUE": "Waarde", "VALUES": "Waarden", - "VALUE_RANGE_CHECK": "Waarde moet groter zijn dan" + "VALUE_RANGE_CHECK": "Waarde moet groter zijn dan", + "CHOOSE": "Kiezen" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/no.json b/public/app/main/apps/dashboards/i18n/no.json index 8504361..7f8813a 100644 --- a/public/app/main/apps/dashboards/i18n/no.json +++ b/public/app/main/apps/dashboards/i18n/no.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Begynner med", "VALUE": "Verdi", "VALUES": "verdier", - "VALUE_RANGE_CHECK": "Verdien må være større enn" + "VALUE_RANGE_CHECK": "Verdien må være større enn", + "CHOOSE": "Velge" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/pl.json b/public/app/main/apps/dashboards/i18n/pl.json index 88998dd..59a0b37 100644 --- a/public/app/main/apps/dashboards/i18n/pl.json +++ b/public/app/main/apps/dashboards/i18n/pl.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Zaczynać z", "VALUE": "Wartość", "VALUES": "Wartości", - "VALUE_RANGE_CHECK": "Wartość musi być większa niż" + "VALUE_RANGE_CHECK": "Wartość musi być większa niż", + "CHOOSE": "Wybierać" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/pt-BR.json b/public/app/main/apps/dashboards/i18n/pt-BR.json index 6546017..7591117 100644 --- a/public/app/main/apps/dashboards/i18n/pt-BR.json +++ b/public/app/main/apps/dashboards/i18n/pt-BR.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Começa com", "VALUE": "Valor", "VALUES": "Valores", - "VALUE_RANGE_CHECK": "O valor deve ser maior que" + "VALUE_RANGE_CHECK": "O valor deve ser maior que", + "CHOOSE": "Escolher" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/pt-PT.json b/public/app/main/apps/dashboards/i18n/pt-PT.json index 8163485..e94035f 100644 --- a/public/app/main/apps/dashboards/i18n/pt-PT.json +++ b/public/app/main/apps/dashboards/i18n/pt-PT.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Começa com", "VALUE": "Valor", "VALUES": "Valores", - "VALUE_RANGE_CHECK": "O valor deve ser maior que" + "VALUE_RANGE_CHECK": "O valor deve ser maior que", + "CHOOSE": "Escolher" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/ru.json b/public/app/main/apps/dashboards/i18n/ru.json index b0a32a7..c9410b1 100644 --- a/public/app/main/apps/dashboards/i18n/ru.json +++ b/public/app/main/apps/dashboards/i18n/ru.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Начинается с", "VALUE": "Значение", "VALUES": "Ценности", - "VALUE_RANGE_CHECK": "Значение должно быть больше чем" + "VALUE_RANGE_CHECK": "Значение должно быть больше чем", + "CHOOSE": "выбирать" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/sv.json b/public/app/main/apps/dashboards/i18n/sv.json index 13d5e77..78a0095 100644 --- a/public/app/main/apps/dashboards/i18n/sv.json +++ b/public/app/main/apps/dashboards/i18n/sv.json @@ -540,6 +540,7 @@ "STARTS_WITH": "Börjar med", "VALUE": "Värde", "VALUES": "värden", - "VALUE_RANGE_CHECK": "Värdet måste vara större än" + "VALUE_RANGE_CHECK": "Värdet måste vara större än", + "CHOOSE": "Välja" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/tr.json b/public/app/main/apps/dashboards/i18n/tr.json index 8b4ed3a..c64914a 100644 --- a/public/app/main/apps/dashboards/i18n/tr.json +++ b/public/app/main/apps/dashboards/i18n/tr.json @@ -540,6 +540,7 @@ "STARTS_WITH": "İle başlar", "VALUE": "değer", "VALUES": "Değerler", - "VALUE_RANGE_CHECK": "Değer şundan büyük olmalıdır:" + "VALUE_RANGE_CHECK": "Değer şundan büyük olmalıdır:", + "CHOOSE": "Seç" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/zh-CN.json b/public/app/main/apps/dashboards/i18n/zh-CN.json index 1cbd58f..dfcf76c 100644 --- a/public/app/main/apps/dashboards/i18n/zh-CN.json +++ b/public/app/main/apps/dashboards/i18n/zh-CN.json @@ -540,6 +540,7 @@ "STARTS_WITH": "以。。开始", "VALUE": "值", "VALUES": "价值观", - "VALUE_RANGE_CHECK": "值必须大于" + "VALUE_RANGE_CHECK": "值必须大于", + "CHOOSE": "选择" } } \ No newline at end of file diff --git a/public/app/main/apps/dashboards/i18n/zh-TW.json b/public/app/main/apps/dashboards/i18n/zh-TW.json index c3a1b15..53e533b 100644 --- a/public/app/main/apps/dashboards/i18n/zh-TW.json +++ b/public/app/main/apps/dashboards/i18n/zh-TW.json @@ -540,6 +540,7 @@ "STARTS_WITH": "以。。開始", "VALUE": "值", "VALUES": "價值觀", - "VALUE_RANGE_CHECK": "值必須大於" + "VALUE_RANGE_CHECK": "值必須大於", + "CHOOSE": "選擇" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ar.json b/public/app/main/apps/fax/i18n/ar.json index 80be4d9..e85a7de 100644 --- a/public/app/main/apps/fax/i18n/ar.json +++ b/public/app/main/apps/fax/i18n/ar.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "التصرف الإلزامي", "MANDATORYDISPOSITIONPAUSEID": "وقفة الوضع عندما تكون في تصرف إلزامي", "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", - "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "تحميل بدون مرفقات", + "DOWNLOAD_WITH_ATTACHMENTS": "تنزيل بالمرفقات", + "LASTMESSAGE": "اخر رسالة" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/da.json b/public/app/main/apps/fax/i18n/da.json index fa865f4..bae7134 100644 --- a/public/app/main/apps/fax/i18n/da.json +++ b/public/app/main/apps/fax/i18n/da.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Obligatorisk disposition", "MANDATORYDISPOSITIONPAUSEID": "Stop status, når du er i obligatorisk disposition", "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", - "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download uden vedhæftede filer", + "DOWNLOAD_WITH_ATTACHMENTS": "Download med vedhæftede filer", + "LASTMESSAGE": "Sidste besked" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/de.json b/public/app/main/apps/fax/i18n/de.json index d582aaf..8b55d8c 100644 --- a/public/app/main/apps/fax/i18n/de.json +++ b/public/app/main/apps/fax/i18n/de.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Zwingende Disposition", "MANDATORYDISPOSITIONPAUSEID": "Status pausieren, wenn die Disposition obligatorisch ist", "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", + "LASTMESSAGE": "Letzte Nachricht" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/es.json b/public/app/main/apps/fax/i18n/es.json index a0b4988..ef29911 100644 --- a/public/app/main/apps/fax/i18n/es.json +++ b/public/app/main/apps/fax/i18n/es.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Cierre obligatorio", "MANDATORYDISPOSITIONPAUSEID": "Estado de pausa cuando está un cierre obligatorio", "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", - "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Descargar sin archivos adjuntos", + "DOWNLOAD_WITH_ATTACHMENTS": "Descargar con archivos adjuntos", + "LASTMESSAGE": "Ultimo mensaje" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/fa.json b/public/app/main/apps/fax/i18n/fa.json index ecfc98d..e3b62a6 100644 --- a/public/app/main/apps/fax/i18n/fa.json +++ b/public/app/main/apps/fax/i18n/fa.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "وضع اجباری", "MANDATORYDISPOSITIONPAUSEID": "وضعیت مکث در حالت اجباری", "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", - "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "بارگیری بدون پیوست", + "DOWNLOAD_WITH_ATTACHMENTS": "با پیوست ها بارگیری کنید", + "LASTMESSAGE": "آخرین پیام" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/fi.json b/public/app/main/apps/fax/i18n/fi.json index 7726adc..f2a0667 100644 --- a/public/app/main/apps/fax/i18n/fi.json +++ b/public/app/main/apps/fax/i18n/fi.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Pakollinen sijoittaminen", "MANDATORYDISPOSITIONPAUSEID": "Keskeytä tila pakollisessa asennuksessa", "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", - "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Lataa ilman liitteitä", + "DOWNLOAD_WITH_ATTACHMENTS": "Lataa liitteineen", + "LASTMESSAGE": "Viimeinen viesti" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/fr.json b/public/app/main/apps/fax/i18n/fr.json index d0ee194..42b5889 100644 --- a/public/app/main/apps/fax/i18n/fr.json +++ b/public/app/main/apps/fax/i18n/fr.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Disposition obligatoire", "MANDATORYDISPOSITIONPAUSEID": "Statut de pause en cas de disposition obligatoire", "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", - "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Télécharger sans pièces jointes", + "DOWNLOAD_WITH_ATTACHMENTS": "Télécharger avec pièces jointes", + "LASTMESSAGE": "Dernier message" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/he.json b/public/app/main/apps/fax/i18n/he.json index 00999bd..6f9e2e4 100644 --- a/public/app/main/apps/fax/i18n/he.json +++ b/public/app/main/apps/fax/i18n/he.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "סיכום", "MANDATORYDISPOSITIONPAUSEID": "השהה סטטוס לסיכום", "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", - "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "הורד ללא קבצים מצורפים", + "DOWNLOAD_WITH_ATTACHMENTS": "הורד עם קבצים מצורפים", + "LASTMESSAGE": "הודעה אחרונה" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/hi.json b/public/app/main/apps/fax/i18n/hi.json index cb5adbf..4772c4b 100644 --- a/public/app/main/apps/fax/i18n/hi.json +++ b/public/app/main/apps/fax/i18n/hi.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "अनिवार्य स्वभाव", "MANDATORYDISPOSITIONPAUSEID": "अनिवार्य स्थिति में स्थिति को रोकें", "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", - "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "संलग्नक के बिना डाउनलोड करें", + "DOWNLOAD_WITH_ATTACHMENTS": "अनुलग्नकों के साथ डाउनलोड करें", + "LASTMESSAGE": "अंतिम संदेश" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/id.json b/public/app/main/apps/fax/i18n/id.json index 3b30df8..73eaa47 100644 --- a/public/app/main/apps/fax/i18n/id.json +++ b/public/app/main/apps/fax/i18n/id.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Disposisi wajib", "MANDATORYDISPOSITIONPAUSEID": "Jeda status saat dalam disposisi wajib", "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", - "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Unduh tanpa lampiran", + "DOWNLOAD_WITH_ATTACHMENTS": "Unduh dengan lampiran", + "LASTMESSAGE": "Pesan Terakhir" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/it.json b/public/app/main/apps/fax/i18n/it.json index f8b1055..947884a 100644 --- a/public/app/main/apps/fax/i18n/it.json +++ b/public/app/main/apps/fax/i18n/it.json @@ -254,6 +254,8 @@ "MANDATORYDISPOSITION": "Disposizione obbligatoria", "MANDATORYDISPOSITIONPAUSEID": "Metti in pausa lo stato quando è nella disposizione obbligatoria", "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", - "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Scarica senza allegati", + "DOWNLOAD_WITH_ATTACHMENTS": "Scarica con allegati" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ja.json b/public/app/main/apps/fax/i18n/ja.json index 95d1ace..883719c 100644 --- a/public/app/main/apps/fax/i18n/ja.json +++ b/public/app/main/apps/fax/i18n/ja.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "強制処分", "MANDATORYDISPOSITIONPAUSEID": "強制処分の場合の一時停止ステータス", "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", - "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "添付ファイルなしでダウンロード", + "DOWNLOAD_WITH_ATTACHMENTS": "添付ファイル付きでダウンロード", + "LASTMESSAGE": "最後のメッセージ" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ko.json b/public/app/main/apps/fax/i18n/ko.json index bd72ac5..6c01d46 100644 --- a/public/app/main/apps/fax/i18n/ko.json +++ b/public/app/main/apps/fax/i18n/ko.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "의무 처분", "MANDATORYDISPOSITIONPAUSEID": "강제 처분시 일시 중지 상태", "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", - "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "첨부 파일없이 다운로드", + "DOWNLOAD_WITH_ATTACHMENTS": "첨부 파일로 다운로드", + "LASTMESSAGE": "마지막 메시지" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/lv.json b/public/app/main/apps/fax/i18n/lv.json index 6c42c1c..9ace9f9 100644 --- a/public/app/main/apps/fax/i18n/lv.json +++ b/public/app/main/apps/fax/i18n/lv.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Obligāta rīcība", "MANDATORYDISPOSITIONPAUSEID": "Pauzēt statusu, kad ir obligāta rīcība", "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", - "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Lejupielādējiet bez pielikumiem", + "DOWNLOAD_WITH_ATTACHMENTS": "Lejupielādējiet ar pielikumiem", + "LASTMESSAGE": "Pēdējā ziņa" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/nl.json b/public/app/main/apps/fax/i18n/nl.json index 25a0392..4798381 100644 --- a/public/app/main/apps/fax/i18n/nl.json +++ b/public/app/main/apps/fax/i18n/nl.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Verplichte regeling", "MANDATORYDISPOSITIONPAUSEID": "Pauzestatus wanneer in verplichte opstelling", "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", - "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download zonder bijlagen", + "DOWNLOAD_WITH_ATTACHMENTS": "Download met bijlagen", + "LASTMESSAGE": "Laatste bericht" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/no.json b/public/app/main/apps/fax/i18n/no.json index 586d6ae..dffac2f 100644 --- a/public/app/main/apps/fax/i18n/no.json +++ b/public/app/main/apps/fax/i18n/no.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Obligatorisk disposisjon", "MANDATORYDISPOSITIONPAUSEID": "Pausestatus når du er i obligatorisk disposisjon", "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", - "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Last ned uten vedlegg", + "DOWNLOAD_WITH_ATTACHMENTS": "Last ned med vedlegg", + "LASTMESSAGE": "Siste melding" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/pl.json b/public/app/main/apps/fax/i18n/pl.json index 8a3d1c8..30f8441 100644 --- a/public/app/main/apps/fax/i18n/pl.json +++ b/public/app/main/apps/fax/i18n/pl.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Dyspozycja obowiązkowa", "MANDATORYDISPOSITIONPAUSEID": "Zatrzymaj status, gdy jesteś w obowiązkowej dyspozycji", "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", - "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Pobierz bez załączników", + "DOWNLOAD_WITH_ATTACHMENTS": "Pobierz z załącznikami", + "LASTMESSAGE": "Ostatnia wiadomość" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/pt-BR.json b/public/app/main/apps/fax/i18n/pt-BR.json index 5cb002c..75ea785 100644 --- a/public/app/main/apps/fax/i18n/pt-BR.json +++ b/public/app/main/apps/fax/i18n/pt-BR.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Status de pausa quando em disposição obrigatória", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", + "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/pt-PT.json b/public/app/main/apps/fax/i18n/pt-PT.json index 524865a..b2f955f 100644 --- a/public/app/main/apps/fax/i18n/pt-PT.json +++ b/public/app/main/apps/fax/i18n/pt-PT.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Disposição obrigatória", "MANDATORYDISPOSITIONPAUSEID": "Status de pausa quando em disposição obrigatória", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", + "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/ru.json b/public/app/main/apps/fax/i18n/ru.json index 687f844..5750f27 100644 --- a/public/app/main/apps/fax/i18n/ru.json +++ b/public/app/main/apps/fax/i18n/ru.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Обязательное распоряжение", "MANDATORYDISPOSITIONPAUSEID": "Состояние паузы, когда в обязательном порядке", "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", - "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Скачать без вложений", + "DOWNLOAD_WITH_ATTACHMENTS": "Скачать с вложениями", + "LASTMESSAGE": "Последнее сообщение" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/sv.json b/public/app/main/apps/fax/i18n/sv.json index 52f2d92..de26a6d 100644 --- a/public/app/main/apps/fax/i18n/sv.json +++ b/public/app/main/apps/fax/i18n/sv.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Obligatorisk kategorisering", "MANDATORYDISPOSITIONPAUSEID": "Pausstatus när du är i obligatorisk kategorisering", "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", - "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ladda ner utan bilagor", + "DOWNLOAD_WITH_ATTACHMENTS": "Ladda ner med bilagor", + "LASTMESSAGE": "Senaste meddelandet" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/tr.json b/public/app/main/apps/fax/i18n/tr.json index aa14efd..1f1ccc2 100644 --- a/public/app/main/apps/fax/i18n/tr.json +++ b/public/app/main/apps/fax/i18n/tr.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "Zorunlu düzenleme", "MANDATORYDISPOSITIONPAUSEID": "Zorunlu görevde iken durumu duraklat", "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", - "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ekler olmadan indir", + "DOWNLOAD_WITH_ATTACHMENTS": "Eklerle indir", + "LASTMESSAGE": "Son Mesaj" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/zh-CN.json b/public/app/main/apps/fax/i18n/zh-CN.json index 9b3333b..e183e2d 100644 --- a/public/app/main/apps/fax/i18n/zh-CN.json +++ b/public/app/main/apps/fax/i18n/zh-CN.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "强制性处分", "MANDATORYDISPOSITIONPAUSEID": "在强制处置时暂停状态", "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "下载无附件", + "DOWNLOAD_WITH_ATTACHMENTS": "附件下载", + "LASTMESSAGE": "最后留言" } } \ No newline at end of file diff --git a/public/app/main/apps/fax/i18n/zh-TW.json b/public/app/main/apps/fax/i18n/zh-TW.json index b334f29..0af842a 100644 --- a/public/app/main/apps/fax/i18n/zh-TW.json +++ b/public/app/main/apps/fax/i18n/zh-TW.json @@ -253,6 +253,9 @@ "MANDATORYDISPOSITION": "強制性處分", "MANDATORYDISPOSITIONPAUSEID": "在強制處置時暫停狀態", "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "下載無附件", + "DOWNLOAD_WITH_ATTACHMENTS": "附件下載", + "LASTMESSAGE": "最後留言" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ar.json b/public/app/main/apps/mail/i18n/ar.json index eb90abd..75ecef9 100644 --- a/public/app/main/apps/mail/i18n/ar.json +++ b/public/app/main/apps/mail/i18n/ar.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "توقف مؤقتًا للاستخدام إذا تم تمكين التخلص الإلزامي", "ADVANCED": "المتقدمة", "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", - "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم", + "DOWNLOAD_WITHOUT_ATTACHMENT": "تحميل بدون مرفق", + "DOWNLOAD_WITH_ATTACHMENT": "تنزيل بالمرفق", + "LASTMESSAGE": "اخر رسالة" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/da.json b/public/app/main/apps/mail/i18n/da.json index b7706b6..b2cea3c 100644 --- a/public/app/main/apps/mail/i18n/da.json +++ b/public/app/main/apps/mail/i18n/da.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Brug pause, hvis obligatorisk disposition er aktiveret", "ADVANCED": "Fremskreden", "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", - "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download uden vedhæftet fil", + "DOWNLOAD_WITH_ATTACHMENT": "Download med vedhæftet fil", + "LASTMESSAGE": "Sidste besked" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/de.json b/public/app/main/apps/mail/i18n/de.json index 9fc23a5..cfb4897 100644 --- a/public/app/main/apps/mail/i18n/de.json +++ b/public/app/main/apps/mail/i18n/de.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Pause zur Verwendung, wenn die obligatorische Disposition aktiviert ist", "ADVANCED": "Fortgeschritten", "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Ohne Anhang herunterladen", + "DOWNLOAD_WITH_ATTACHMENT": "Download mit Anhang", + "LASTMESSAGE": "Letzte Nachricht" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/en.json b/public/app/main/apps/mail/i18n/en.json index c157f0c..417df2f 100644 --- a/public/app/main/apps/mail/i18n/en.json +++ b/public/app/main/apps/mail/i18n/en.json @@ -294,7 +294,7 @@ "IMAP_PORT": "IMAP Port", "CONFIRM_PASSWORD": "Confirm Password", "SELECT_STATUS": "Select Status", - "OPENED": "Opened", + "OPENED": "Open", "CLOSED": "Closed", "ALL": "All", "SELECT_ACCOUNT": "Select Account", diff --git a/public/app/main/apps/mail/i18n/es.json b/public/app/main/apps/mail/i18n/es.json index 14ab061..85d667a 100644 --- a/public/app/main/apps/mail/i18n/es.json +++ b/public/app/main/apps/mail/i18n/es.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Pausa a usar si el cierre obligatorio está habilitado", "ADVANCED": "Avanzado", "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", - "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Descargar sin adjuntar", + "DOWNLOAD_WITH_ATTACHMENT": "Descargar con archivo adjunto", + "LASTMESSAGE": "Ultimo mensaje" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/fa.json b/public/app/main/apps/mail/i18n/fa.json index 2bb8280..82c6b42 100644 --- a/public/app/main/apps/mail/i18n/fa.json +++ b/public/app/main/apps/mail/i18n/fa.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "در صورت فعال بودن وضع اجباری ، مکث کنید", "ADVANCED": "پیشرفته", "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", - "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است", + "DOWNLOAD_WITHOUT_ATTACHMENT": "بارگیری بدون پیوست", + "DOWNLOAD_WITH_ATTACHMENT": "با پیوست بارگیری کنید", + "LASTMESSAGE": "آخرین پیام" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/fi.json b/public/app/main/apps/mail/i18n/fi.json index c6cb245..5194993 100644 --- a/public/app/main/apps/mail/i18n/fi.json +++ b/public/app/main/apps/mail/i18n/fi.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Tauko käyttöön, jos pakollinen sijoittaminen on käytössä", "ADVANCED": "Pitkälle kehittynyt", "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", - "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Lataa ilman liitetiedostoja", + "DOWNLOAD_WITH_ATTACHMENT": "Lataa liitteenä", + "LASTMESSAGE": "Viimeinen viesti" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/fr.json b/public/app/main/apps/mail/i18n/fr.json index d14fd82..8253d31 100644 --- a/public/app/main/apps/mail/i18n/fr.json +++ b/public/app/main/apps/mail/i18n/fr.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Pause à utiliser si la disposition obligatoire est activée", "ADVANCED": "Avancée", "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", - "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Télécharger sans pièce jointe", + "DOWNLOAD_WITH_ATTACHMENT": "Télécharger avec pièce jointe", + "LASTMESSAGE": "Dernier message" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/he.json b/public/app/main/apps/mail/i18n/he.json index a183cd5..af943ff 100644 --- a/public/app/main/apps/mail/i18n/he.json +++ b/public/app/main/apps/mail/i18n/he.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "השהה שימוש כשהסיכום מופעל", "ADVANCED": "מתקדם", "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", - "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת", + "DOWNLOAD_WITHOUT_ATTACHMENT": "הורד ללא קובץ מצורף", + "DOWNLOAD_WITH_ATTACHMENT": "הורד עם קובץ מצורף", + "LASTMESSAGE": "הודעה אחרונה" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/hi.json b/public/app/main/apps/mail/i18n/hi.json index 7f74189..fac3da6 100644 --- a/public/app/main/apps/mail/i18n/hi.json +++ b/public/app/main/apps/mail/i18n/hi.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "यदि अनिवार्य स्वभाव सक्षम है, तो उपयोग करने के लिए रुकें", "ADVANCED": "उन्नत", "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", - "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है", + "DOWNLOAD_WITHOUT_ATTACHMENT": "अनुलग्नक के बिना डाउनलोड करें", + "DOWNLOAD_WITH_ATTACHMENT": "अनुलग्नक के साथ डाउनलोड करें", + "LASTMESSAGE": "अंतिम संदेश" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/id.json b/public/app/main/apps/mail/i18n/id.json index c582c43..052853d 100644 --- a/public/app/main/apps/mail/i18n/id.json +++ b/public/app/main/apps/mail/i18n/id.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Jeda untuk digunakan jika disposisi wajib diaktifkan", "ADVANCED": "Maju", "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", - "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Unduh tanpa lampiran", + "DOWNLOAD_WITH_ATTACHMENT": "Unduh dengan lampiran", + "LASTMESSAGE": "Pesan Terakhir" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/it.json b/public/app/main/apps/mail/i18n/it.json index a8e90f8..4184e59 100644 --- a/public/app/main/apps/mail/i18n/it.json +++ b/public/app/main/apps/mail/i18n/it.json @@ -317,6 +317,8 @@ "MANDATORYDISPOSITION": "Disposizione obbligatoria", "MANDATORYDISPOSITIONPAUSEID": "Pausa da utilizzare se è abilitata la disposizione obbligatoria", "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", - "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Scarica senza allegato", + "DOWNLOAD_WITH_ATTACHMENT": "Scarica con allegato" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ja.json b/public/app/main/apps/mail/i18n/ja.json index 0c87adc..4ac5dc9 100644 --- a/public/app/main/apps/mail/i18n/ja.json +++ b/public/app/main/apps/mail/i18n/ja.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "強制処分が有効になっている場合に使用する一時停止", "ADVANCED": "高度な", "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", - "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中", + "DOWNLOAD_WITHOUT_ATTACHMENT": "添付せずにダウンロード", + "DOWNLOAD_WITH_ATTACHMENT": "添付してダウンロード", + "LASTMESSAGE": "最後のメッセージ" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ko.json b/public/app/main/apps/mail/i18n/ko.json index 50da433..583a0fe 100644 --- a/public/app/main/apps/mail/i18n/ko.json +++ b/public/app/main/apps/mail/i18n/ko.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "강제 처분이 활성화 된 경우 사용 중지", "ADVANCED": "많은", "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", - "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중", + "DOWNLOAD_WITHOUT_ATTACHMENT": "첨부 파일없이 다운로드", + "DOWNLOAD_WITH_ATTACHMENT": "첨부 파일로 다운로드", + "LASTMESSAGE": "마지막 메시지" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/lv.json b/public/app/main/apps/mail/i18n/lv.json index 5a49482..4ec8ea4 100644 --- a/public/app/main/apps/mail/i18n/lv.json +++ b/public/app/main/apps/mail/i18n/lv.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Lietošanas pārtraukšana, ja ir iespējota obligātā izvietošana", "ADVANCED": "Advanced", "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", - "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Lejupielādējiet bez pielikuma", + "DOWNLOAD_WITH_ATTACHMENT": "Lejupielādējiet ar pielikumu", + "LASTMESSAGE": "Pēdējā ziņa" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/nl.json b/public/app/main/apps/mail/i18n/nl.json index 3b7c29f..1500dd5 100644 --- a/public/app/main/apps/mail/i18n/nl.json +++ b/public/app/main/apps/mail/i18n/nl.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Pauze om te gebruiken als verplichte dispositie is ingeschakeld", "ADVANCED": "gevorderd", "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", - "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download zonder bijlage", + "DOWNLOAD_WITH_ATTACHMENT": "Download met bijlage", + "LASTMESSAGE": "Laatste bericht" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/no.json b/public/app/main/apps/mail/i18n/no.json index 174d1dc..67bcd72 100644 --- a/public/app/main/apps/mail/i18n/no.json +++ b/public/app/main/apps/mail/i18n/no.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Bruk pause hvis obligatorisk disposisjon er aktivert", "ADVANCED": "Avansert", "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", - "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Last ned uten vedlegg", + "DOWNLOAD_WITH_ATTACHMENT": "Last ned med vedlegg", + "LASTMESSAGE": "Siste melding" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/pl.json b/public/app/main/apps/mail/i18n/pl.json index 349c154..aca2ad1 100644 --- a/public/app/main/apps/mail/i18n/pl.json +++ b/public/app/main/apps/mail/i18n/pl.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Wstrzymaj korzystanie, jeśli włączona jest obowiązkowa dyspozycja", "ADVANCED": "zaawansowane", "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", - "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Pobierz bez załącznika", + "DOWNLOAD_WITH_ATTACHMENT": "Pobierz z załącznikiem", + "LASTMESSAGE": "Ostatnia wiadomość" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/pt-BR.json b/public/app/main/apps/mail/i18n/pt-BR.json index ddb9e61..63d5079 100644 --- a/public/app/main/apps/mail/i18n/pt-BR.json +++ b/public/app/main/apps/mail/i18n/pt-BR.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", "ADVANCED": "Avançado", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download sem anexo", + "DOWNLOAD_WITH_ATTACHMENT": "Download com anexo", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/pt-PT.json b/public/app/main/apps/mail/i18n/pt-PT.json index c75be4c..60c8805 100644 --- a/public/app/main/apps/mail/i18n/pt-PT.json +++ b/public/app/main/apps/mail/i18n/pt-PT.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", "ADVANCED": "Avançado", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download sem anexo", + "DOWNLOAD_WITH_ATTACHMENT": "Download com anexo", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/ru.json b/public/app/main/apps/mail/i18n/ru.json index 926f49a..fecdb27 100644 --- a/public/app/main/apps/mail/i18n/ru.json +++ b/public/app/main/apps/mail/i18n/ru.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Пауза для использования, если включена обязательная утилизация", "ADVANCED": "продвинутый", "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", - "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Скачать без вложения", + "DOWNLOAD_WITH_ATTACHMENT": "Скачать с приложением", + "LASTMESSAGE": "Последнее сообщение" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/sv.json b/public/app/main/apps/mail/i18n/sv.json index 4f1baaf..a8b08ce 100644 --- a/public/app/main/apps/mail/i18n/sv.json +++ b/public/app/main/apps/mail/i18n/sv.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Pausa för att använda om obligatorisk disposition är aktiverad", "ADVANCED": "Avancerad", "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", - "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Ladda ner utan bilaga", + "DOWNLOAD_WITH_ATTACHMENT": "Ladda ner med bilaga", + "LASTMESSAGE": "Senaste meddelandet" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/tr.json b/public/app/main/apps/mail/i18n/tr.json index 8411104..986da43 100644 --- a/public/app/main/apps/mail/i18n/tr.json +++ b/public/app/main/apps/mail/i18n/tr.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "Zorunlu bırakma etkinse, kullanımı duraklat", "ADVANCED": "ileri", "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", - "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Ek olmadan indir", + "DOWNLOAD_WITH_ATTACHMENT": "Ekli olarak indir", + "LASTMESSAGE": "Son Mesaj" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/zh-CN.json b/public/app/main/apps/mail/i18n/zh-CN.json index 325f5c3..777dddf 100644 --- a/public/app/main/apps/mail/i18n/zh-CN.json +++ b/public/app/main/apps/mail/i18n/zh-CN.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "如果启用了强制性处置,则暂停使用", "ADVANCED": "高级", "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中", + "DOWNLOAD_WITHOUT_ATTACHMENT": "不带附件下载", + "DOWNLOAD_WITH_ATTACHMENT": "附件下载", + "LASTMESSAGE": "最后留言" } } \ No newline at end of file diff --git a/public/app/main/apps/mail/i18n/zh-TW.json b/public/app/main/apps/mail/i18n/zh-TW.json index aa75bc3..8c09f92 100644 --- a/public/app/main/apps/mail/i18n/zh-TW.json +++ b/public/app/main/apps/mail/i18n/zh-TW.json @@ -316,6 +316,9 @@ "MANDATORYDISPOSITIONPAUSEID": "如果啟用了強制性處置,則暫停使用", "ADVANCED": "高級", "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中", + "DOWNLOAD_WITHOUT_ATTACHMENT": "不帶附件下載", + "DOWNLOAD_WITH_ATTACHMENT": "附件下載", + "LASTMESSAGE": "最後留言" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ar.json b/public/app/main/apps/openchannel/i18n/ar.json index 7909b32..5cd40cf 100644 --- a/public/app/main/apps/openchannel/i18n/ar.json +++ b/public/app/main/apps/openchannel/i18n/ar.json @@ -253,6 +253,9 @@ "LEXREGION": "منطقة", "SECRETACCESSKEY": "سر مفتاح الوصول", "TOOLTIP_SCREENRECORDING_OFF": "تسجيل الشاشة المتاحة", - "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم" + "TOOLTIP_SCREENRECORDING_ON": "تسجيل الشاشة في التقدم", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "تحميل بدون مرفقات", + "DOWNLOAD_WITH_ATTACHMENTS": "تنزيل بالمرفقات", + "LASTMESSAGE": "اخر رسالة" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/da.json b/public/app/main/apps/openchannel/i18n/da.json index cf5d6ec..32ad811 100644 --- a/public/app/main/apps/openchannel/i18n/da.json +++ b/public/app/main/apps/openchannel/i18n/da.json @@ -253,6 +253,9 @@ "LEXREGION": "Område", "SECRETACCESSKEY": "Adgangsnøglehemmelighed", "TOOLTIP_SCREENRECORDING_OFF": "Screen optagelse tilgængelig", - "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skærmoptagelse pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download uden vedhæftede filer", + "DOWNLOAD_WITH_ATTACHMENTS": "Download med vedhæftede filer", + "LASTMESSAGE": "Sidste besked" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/de.json b/public/app/main/apps/openchannel/i18n/de.json index 58eeb2d..bb8924c 100644 --- a/public/app/main/apps/openchannel/i18n/de.json +++ b/public/app/main/apps/openchannel/i18n/de.json @@ -253,6 +253,9 @@ "LEXREGION": "Region", "SECRETACCESSKEY": "Zugangsschlüssel geheim", "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft" + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", + "LASTMESSAGE": "Letzte Nachricht" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/es.json b/public/app/main/apps/openchannel/i18n/es.json index 176012c..e3c916d 100644 --- a/public/app/main/apps/openchannel/i18n/es.json +++ b/public/app/main/apps/openchannel/i18n/es.json @@ -253,6 +253,9 @@ "LEXREGION": "Región", "SECRETACCESSKEY": "Clave de acceso secreto", "TOOLTIP_SCREENRECORDING_OFF": "Grabación de pantalla disponible", - "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso" + "TOOLTIP_SCREENRECORDING_ON": "Grabación de pantalla en progreso", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Descargar sin archivos adjuntos", + "DOWNLOAD_WITH_ATTACHMENTS": "Descargar con archivos adjuntos", + "LASTMESSAGE": "Ultimo mensaje" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/fa.json b/public/app/main/apps/openchannel/i18n/fa.json index 9de6d76..fd9187a 100644 --- a/public/app/main/apps/openchannel/i18n/fa.json +++ b/public/app/main/apps/openchannel/i18n/fa.json @@ -253,6 +253,9 @@ "LEXREGION": "منطقه", "SECRETACCESSKEY": "راز دسترسی به کلید", "TOOLTIP_SCREENRECORDING_OFF": "ضبط صفحه در دسترس است", - "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است" + "TOOLTIP_SCREENRECORDING_ON": "ضبط صفحه در حال انجام است", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "بارگیری بدون پیوست", + "DOWNLOAD_WITH_ATTACHMENTS": "با پیوست ها بارگیری کنید", + "LASTMESSAGE": "آخرین پیام" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/fi.json b/public/app/main/apps/openchannel/i18n/fi.json index 8afc35a..d694334 100644 --- a/public/app/main/apps/openchannel/i18n/fi.json +++ b/public/app/main/apps/openchannel/i18n/fi.json @@ -253,6 +253,9 @@ "LEXREGION": "alue", "SECRETACCESSKEY": "Pääsysalaisuus", "TOOLTIP_SCREENRECORDING_OFF": "Näytön tallennus saatavilla", - "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä" + "TOOLTIP_SCREENRECORDING_ON": "Näytön nauhoitus käynnissä", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Lataa ilman liitteitä", + "DOWNLOAD_WITH_ATTACHMENTS": "Lataa liitteineen", + "LASTMESSAGE": "Viimeinen viesti" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/fr.json b/public/app/main/apps/openchannel/i18n/fr.json index 88fb123..8842a2e 100644 --- a/public/app/main/apps/openchannel/i18n/fr.json +++ b/public/app/main/apps/openchannel/i18n/fr.json @@ -253,6 +253,9 @@ "LEXREGION": "Région", "SECRETACCESSKEY": "Clé d'accès secret", "TOOLTIP_SCREENRECORDING_OFF": "Enregistrement d'écran disponible", - "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours" + "TOOLTIP_SCREENRECORDING_ON": "Enregistrement d'écran en cours", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Télécharger sans pièces jointes", + "DOWNLOAD_WITH_ATTACHMENTS": "Télécharger avec pièces jointes", + "LASTMESSAGE": "Dernier message" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/he.json b/public/app/main/apps/openchannel/i18n/he.json index 7363ca1..0c4ed95 100644 --- a/public/app/main/apps/openchannel/i18n/he.json +++ b/public/app/main/apps/openchannel/i18n/he.json @@ -253,6 +253,9 @@ "LEXREGION": "אזור", "SECRETACCESSKEY": "גישה לסוד מפתח", "TOOLTIP_SCREENRECORDING_OFF": "הקלטת מסך זמינה", - "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת" + "TOOLTIP_SCREENRECORDING_ON": "הקלטת מסך מתבצעת", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "הורד ללא קבצים מצורפים", + "DOWNLOAD_WITH_ATTACHMENTS": "הורד עם קבצים מצורפים", + "LASTMESSAGE": "הודעה אחרונה" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/hi.json b/public/app/main/apps/openchannel/i18n/hi.json index 308b8e0..c725772 100644 --- a/public/app/main/apps/openchannel/i18n/hi.json +++ b/public/app/main/apps/openchannel/i18n/hi.json @@ -253,6 +253,9 @@ "LEXREGION": "क्षेत्र", "SECRETACCESSKEY": "पहुंच कुंजी रहस्य", "TOOLTIP_SCREENRECORDING_OFF": "स्क्रीन रिकॉर्डिंग उपलब्ध है", - "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है" + "TOOLTIP_SCREENRECORDING_ON": "स्क्रीन रिकॉर्डिंग प्रगति पर है", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "संलग्नक के बिना डाउनलोड करें", + "DOWNLOAD_WITH_ATTACHMENTS": "अनुलग्नकों के साथ डाउनलोड करें", + "LASTMESSAGE": "अंतिम संदेश" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/id.json b/public/app/main/apps/openchannel/i18n/id.json index 48765c5..ab6792a 100644 --- a/public/app/main/apps/openchannel/i18n/id.json +++ b/public/app/main/apps/openchannel/i18n/id.json @@ -253,6 +253,9 @@ "LEXREGION": "Wilayah", "SECRETACCESSKEY": "Rahasia kunci akses", "TOOLTIP_SCREENRECORDING_OFF": "Rekaman Layar tersedia", - "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung" + "TOOLTIP_SCREENRECORDING_ON": "Perekaman Layar sedang berlangsung", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Unduh tanpa lampiran", + "DOWNLOAD_WITH_ATTACHMENTS": "Unduh dengan lampiran", + "LASTMESSAGE": "Pesan Terakhir" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/it.json b/public/app/main/apps/openchannel/i18n/it.json index 8c1ffc8..b6369f4 100644 --- a/public/app/main/apps/openchannel/i18n/it.json +++ b/public/app/main/apps/openchannel/i18n/it.json @@ -254,6 +254,8 @@ "LEXREGION": "Regione", "SECRETACCESSKEY": "Accesso chiave segreta", "TOOLTIP_SCREENRECORDING_OFF": "Registrazione dello schermo disponibile", - "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso" + "TOOLTIP_SCREENRECORDING_ON": "Registrazione dello schermo in corso", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Scarica senza allegati", + "DOWNLOAD_WITH_ATTACHMENTS": "Scarica con allegati" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ja.json b/public/app/main/apps/openchannel/i18n/ja.json index c73fd04..67a588b 100644 --- a/public/app/main/apps/openchannel/i18n/ja.json +++ b/public/app/main/apps/openchannel/i18n/ja.json @@ -253,6 +253,9 @@ "LEXREGION": "領域", "SECRETACCESSKEY": "アクセスキーシークレット", "TOOLTIP_SCREENRECORDING_OFF": "利用可能なスクリーン録画", - "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中" + "TOOLTIP_SCREENRECORDING_ON": "スクリーン録画中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "添付ファイルなしでダウンロード", + "DOWNLOAD_WITH_ATTACHMENTS": "添付ファイル付きでダウンロード", + "LASTMESSAGE": "最後のメッセージ" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ko.json b/public/app/main/apps/openchannel/i18n/ko.json index 5a38c80..812831c 100644 --- a/public/app/main/apps/openchannel/i18n/ko.json +++ b/public/app/main/apps/openchannel/i18n/ko.json @@ -253,6 +253,9 @@ "LEXREGION": "부위", "SECRETACCESSKEY": "액세스 키 비밀", "TOOLTIP_SCREENRECORDING_OFF": "스크린 녹화 가능", - "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중" + "TOOLTIP_SCREENRECORDING_ON": "화면 녹화 중", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "첨부 파일없이 다운로드", + "DOWNLOAD_WITH_ATTACHMENTS": "첨부 파일로 다운로드", + "LASTMESSAGE": "마지막 메시지" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/lv.json b/public/app/main/apps/openchannel/i18n/lv.json index 9da22ce..597bb59 100644 --- a/public/app/main/apps/openchannel/i18n/lv.json +++ b/public/app/main/apps/openchannel/i18n/lv.json @@ -253,6 +253,9 @@ "LEXREGION": "Novads", "SECRETACCESSKEY": "Piekļuves atslēgas noslēpums", "TOOLTIP_SCREENRECORDING_OFF": "Ekrāna ieraksts ir pieejams", - "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana" + "TOOLTIP_SCREENRECORDING_ON": "Notiek ekrāna ierakstīšana", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Lejupielādējiet bez pielikumiem", + "DOWNLOAD_WITH_ATTACHMENTS": "Lejupielādējiet ar pielikumiem", + "LASTMESSAGE": "Pēdējā ziņa" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/nl.json b/public/app/main/apps/openchannel/i18n/nl.json index 1c5ee4b..325c98b 100644 --- a/public/app/main/apps/openchannel/i18n/nl.json +++ b/public/app/main/apps/openchannel/i18n/nl.json @@ -253,6 +253,9 @@ "LEXREGION": "Regio", "SECRETACCESSKEY": "Toegangssleutel geheim", "TOOLTIP_SCREENRECORDING_OFF": "Schermopname beschikbaar", - "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig" + "TOOLTIP_SCREENRECORDING_ON": "Schermopname bezig", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download zonder bijlagen", + "DOWNLOAD_WITH_ATTACHMENTS": "Download met bijlagen", + "LASTMESSAGE": "Laatste bericht" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/no.json b/public/app/main/apps/openchannel/i18n/no.json index 0a6e382..b8da112 100644 --- a/public/app/main/apps/openchannel/i18n/no.json +++ b/public/app/main/apps/openchannel/i18n/no.json @@ -253,6 +253,9 @@ "LEXREGION": "Region", "SECRETACCESSKEY": "Tilgang nøkkelhemmelighet", "TOOLTIP_SCREENRECORDING_OFF": "Skjermopptak tilgjengelig", - "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skjermopptak pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Last ned uten vedlegg", + "DOWNLOAD_WITH_ATTACHMENTS": "Last ned med vedlegg", + "LASTMESSAGE": "Siste melding" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/pl.json b/public/app/main/apps/openchannel/i18n/pl.json index d30837b..1221a09 100644 --- a/public/app/main/apps/openchannel/i18n/pl.json +++ b/public/app/main/apps/openchannel/i18n/pl.json @@ -253,6 +253,9 @@ "LEXREGION": "Region", "SECRETACCESSKEY": "Tajny klucz dostępu", "TOOLTIP_SCREENRECORDING_OFF": "Dostępne nagrywanie ekranu", - "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu" + "TOOLTIP_SCREENRECORDING_ON": "Trwa nagrywanie ekranu", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Pobierz bez załączników", + "DOWNLOAD_WITH_ATTACHMENTS": "Pobierz z załącznikami", + "LASTMESSAGE": "Ostatnia wiadomość" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/pt-BR.json b/public/app/main/apps/openchannel/i18n/pt-BR.json index 1c2bf75..dd5b212 100644 --- a/public/app/main/apps/openchannel/i18n/pt-BR.json +++ b/public/app/main/apps/openchannel/i18n/pt-BR.json @@ -253,6 +253,9 @@ "LEXREGION": "Região", "SECRETACCESSKEY": "Segredo da chave de acesso", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", + "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/pt-PT.json b/public/app/main/apps/openchannel/i18n/pt-PT.json index 31f5ce5..d1a2a7e 100644 --- a/public/app/main/apps/openchannel/i18n/pt-PT.json +++ b/public/app/main/apps/openchannel/i18n/pt-PT.json @@ -253,6 +253,9 @@ "LEXREGION": "Região", "SECRETACCESSKEY": "Segredo da chave de acesso", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento" + "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", + "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/ru.json b/public/app/main/apps/openchannel/i18n/ru.json index aacbfc1..7a7cab2 100644 --- a/public/app/main/apps/openchannel/i18n/ru.json +++ b/public/app/main/apps/openchannel/i18n/ru.json @@ -253,6 +253,9 @@ "LEXREGION": "Область", "SECRETACCESSKEY": "Секрет ключа доступа", "TOOLTIP_SCREENRECORDING_OFF": "Запись экрана доступна", - "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана" + "TOOLTIP_SCREENRECORDING_ON": "Идет запись экрана", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Скачать без вложений", + "DOWNLOAD_WITH_ATTACHMENTS": "Скачать с вложениями", + "LASTMESSAGE": "Последнее сообщение" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/sv.json b/public/app/main/apps/openchannel/i18n/sv.json index da373c3..72e954a 100644 --- a/public/app/main/apps/openchannel/i18n/sv.json +++ b/public/app/main/apps/openchannel/i18n/sv.json @@ -253,6 +253,9 @@ "LEXREGION": "Område", "SECRETACCESSKEY": "Åtkomstnyckelhemlighet", "TOOLTIP_SCREENRECORDING_OFF": "Skärminspelning tillgänglig", - "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår" + "TOOLTIP_SCREENRECORDING_ON": "Skärminspelning pågår", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ladda ner utan bilagor", + "DOWNLOAD_WITH_ATTACHMENTS": "Ladda ner med bilagor", + "LASTMESSAGE": "Senaste meddelandet" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/tr.json b/public/app/main/apps/openchannel/i18n/tr.json index f09dd59..01df0c4 100644 --- a/public/app/main/apps/openchannel/i18n/tr.json +++ b/public/app/main/apps/openchannel/i18n/tr.json @@ -253,6 +253,9 @@ "LEXREGION": "bölge", "SECRETACCESSKEY": "Erişim anahtarı sırrı", "TOOLTIP_SCREENRECORDING_OFF": "Ekran Kaydı mevcut", - "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor" + "TOOLTIP_SCREENRECORDING_ON": "Ekran Kaydı devam ediyor", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ekler olmadan indir", + "DOWNLOAD_WITH_ATTACHMENTS": "Eklerle indir", + "LASTMESSAGE": "Son Mesaj" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/zh-CN.json b/public/app/main/apps/openchannel/i18n/zh-CN.json index 1a40e84..bd0298e 100644 --- a/public/app/main/apps/openchannel/i18n/zh-CN.json +++ b/public/app/main/apps/openchannel/i18n/zh-CN.json @@ -253,6 +253,9 @@ "LEXREGION": "区域", "SECRETACCESSKEY": "访问密钥机密", "TOOLTIP_SCREENRECORDING_OFF": "屏幕录像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕录制正在进行中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "下载无附件", + "DOWNLOAD_WITH_ATTACHMENTS": "附件下载", + "LASTMESSAGE": "最后留言" } } \ No newline at end of file diff --git a/public/app/main/apps/openchannel/i18n/zh-TW.json b/public/app/main/apps/openchannel/i18n/zh-TW.json index 42378f0..11cfb6f 100644 --- a/public/app/main/apps/openchannel/i18n/zh-TW.json +++ b/public/app/main/apps/openchannel/i18n/zh-TW.json @@ -253,6 +253,9 @@ "LEXREGION": "區域", "SECRETACCESSKEY": "訪問密鑰機密", "TOOLTIP_SCREENRECORDING_OFF": "屏幕錄像可用", - "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中" + "TOOLTIP_SCREENRECORDING_ON": "屏幕錄製正在進行中", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "下載無附件", + "DOWNLOAD_WITH_ATTACHMENTS": "附件下載", + "LASTMESSAGE": "最後留言" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/ar.json b/public/app/main/apps/sms/i18n/ar.json index dda3f57..86cef3b 100644 --- a/public/app/main/apps/sms/i18n/ar.json +++ b/public/app/main/apps/sms/i18n/ar.json @@ -277,6 +277,9 @@ "LANGUAGE": "لغة", "LEXREGION": "منطقة", "SECRETACCESSKEY": "سر مفتاح الوصول", - "WELCOMEMESSAGE": "رسالة ترحيب" + "WELCOMEMESSAGE": "رسالة ترحيب", + "DOWNLOAD_WITHOUT_ATTACHMENT": "تحميل بدون مرفق", + "DOWNLOAD_WITH_ATTACHMENT": "تنزيل بالمرفق", + "LASTMESSAGE": "اخر رسالة" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/da.json b/public/app/main/apps/sms/i18n/da.json index 42b5017..93a3d36 100644 --- a/public/app/main/apps/sms/i18n/da.json +++ b/public/app/main/apps/sms/i18n/da.json @@ -277,6 +277,9 @@ "LANGUAGE": "Sprog", "LEXREGION": "Område", "SECRETACCESSKEY": "Adgangsnøglehemmelighed", - "WELCOMEMESSAGE": "Velkomstbesked" + "WELCOMEMESSAGE": "Velkomstbesked", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download uden vedhæftet fil", + "DOWNLOAD_WITH_ATTACHMENT": "Download med vedhæftet fil", + "LASTMESSAGE": "Sidste besked" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/de.json b/public/app/main/apps/sms/i18n/de.json index 9685aa7..251f4be 100644 --- a/public/app/main/apps/sms/i18n/de.json +++ b/public/app/main/apps/sms/i18n/de.json @@ -277,6 +277,9 @@ "LANGUAGE": "Sprache", "LEXREGION": "Region", "SECRETACCESSKEY": "Zugriffsschlüsselgeheimnis", - "WELCOMEMESSAGE": "Willkommensnachricht" + "WELCOMEMESSAGE": "Willkommensnachricht", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Ohne Anhang herunterladen", + "DOWNLOAD_WITH_ATTACHMENT": "Download mit Anhang", + "LASTMESSAGE": "Letzte Nachricht" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/es.json b/public/app/main/apps/sms/i18n/es.json index 84ce55e..15c2302 100644 --- a/public/app/main/apps/sms/i18n/es.json +++ b/public/app/main/apps/sms/i18n/es.json @@ -277,6 +277,9 @@ "LANGUAGE": "Idioma", "LEXREGION": "Región", "SECRETACCESSKEY": "Clave de acceso secreto", - "WELCOMEMESSAGE": "Mensaje de bienvenida" + "WELCOMEMESSAGE": "Mensaje de bienvenida", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Descargar sin adjuntar", + "DOWNLOAD_WITH_ATTACHMENT": "Descargar con archivo adjunto", + "LASTMESSAGE": "Ultimo mensaje" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/fa.json b/public/app/main/apps/sms/i18n/fa.json index 4b2507d..39ad437 100644 --- a/public/app/main/apps/sms/i18n/fa.json +++ b/public/app/main/apps/sms/i18n/fa.json @@ -277,6 +277,9 @@ "LANGUAGE": "زبان", "LEXREGION": "منطقه", "SECRETACCESSKEY": "راز دسترسی به کلید", - "WELCOMEMESSAGE": "پیام خوش آمد" + "WELCOMEMESSAGE": "پیام خوش آمد", + "DOWNLOAD_WITHOUT_ATTACHMENT": "بارگیری بدون پیوست", + "DOWNLOAD_WITH_ATTACHMENT": "با پیوست بارگیری کنید", + "LASTMESSAGE": "آخرین پیام" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/fi.json b/public/app/main/apps/sms/i18n/fi.json index 1479160..13dd5eb 100644 --- a/public/app/main/apps/sms/i18n/fi.json +++ b/public/app/main/apps/sms/i18n/fi.json @@ -277,6 +277,9 @@ "LANGUAGE": "Kieli", "LEXREGION": "alue", "SECRETACCESSKEY": "Pääsysalaisuus", - "WELCOMEMESSAGE": "Tervetuloviesti" + "WELCOMEMESSAGE": "Tervetuloviesti", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Lataa ilman liitetiedostoja", + "DOWNLOAD_WITH_ATTACHMENT": "Lataa liitteenä", + "LASTMESSAGE": "Viimeinen viesti" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/fr.json b/public/app/main/apps/sms/i18n/fr.json index a7a3298..43a3620 100644 --- a/public/app/main/apps/sms/i18n/fr.json +++ b/public/app/main/apps/sms/i18n/fr.json @@ -277,6 +277,9 @@ "LANGUAGE": "Langue", "LEXREGION": "Région", "SECRETACCESSKEY": "Clé d'accès secrète", - "WELCOMEMESSAGE": "Message de bienvenue" + "WELCOMEMESSAGE": "Message de bienvenue", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Télécharger sans pièce jointe", + "DOWNLOAD_WITH_ATTACHMENT": "Télécharger avec pièce jointe", + "LASTMESSAGE": "Dernier message" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/he.json b/public/app/main/apps/sms/i18n/he.json index 99e1300..674927a 100644 --- a/public/app/main/apps/sms/i18n/he.json +++ b/public/app/main/apps/sms/i18n/he.json @@ -277,6 +277,9 @@ "LANGUAGE": "שפה", "LEXREGION": "אזור", "SECRETACCESSKEY": "גישה לסוד מפתח", - "WELCOMEMESSAGE": "הודעת ברכה" + "WELCOMEMESSAGE": "הודעת ברכה", + "DOWNLOAD_WITHOUT_ATTACHMENT": "הורד ללא קובץ מצורף", + "DOWNLOAD_WITH_ATTACHMENT": "הורד עם קובץ מצורף", + "LASTMESSAGE": "הודעה אחרונה" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/hi.json b/public/app/main/apps/sms/i18n/hi.json index d1935c7..4ca1899 100644 --- a/public/app/main/apps/sms/i18n/hi.json +++ b/public/app/main/apps/sms/i18n/hi.json @@ -277,6 +277,9 @@ "LANGUAGE": "भाषा: हिन्दी", "LEXREGION": "क्षेत्र", "SECRETACCESSKEY": "पहुंच कुंजी रहस्य", - "WELCOMEMESSAGE": "स्वागत संदेश" + "WELCOMEMESSAGE": "स्वागत संदेश", + "DOWNLOAD_WITHOUT_ATTACHMENT": "अनुलग्नक के बिना डाउनलोड करें", + "DOWNLOAD_WITH_ATTACHMENT": "अनुलग्नक के साथ डाउनलोड करें", + "LASTMESSAGE": "अंतिम संदेश" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/id.json b/public/app/main/apps/sms/i18n/id.json index 18774b3..5675bad 100644 --- a/public/app/main/apps/sms/i18n/id.json +++ b/public/app/main/apps/sms/i18n/id.json @@ -277,6 +277,9 @@ "LANGUAGE": "Bahasa", "LEXREGION": "Wilayah", "SECRETACCESSKEY": "Rahasia kunci akses", - "WELCOMEMESSAGE": "Pesan selamat datang" + "WELCOMEMESSAGE": "Pesan selamat datang", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Unduh tanpa lampiran", + "DOWNLOAD_WITH_ATTACHMENT": "Unduh dengan lampiran", + "LASTMESSAGE": "Pesan Terakhir" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/it.json b/public/app/main/apps/sms/i18n/it.json index fad3504..a06972f 100644 --- a/public/app/main/apps/sms/i18n/it.json +++ b/public/app/main/apps/sms/i18n/it.json @@ -278,6 +278,8 @@ "AGENTADD_SMSACCOUNT": "Aggiungi Agente ad account SMS", "TEAMS_ASSOCIATION": "Associazione Teams", "MANDATORYDISPOSITION": "Disposizione obbligatoria", - "MANDATORYDISPOSITIONPAUSEID": "Pausa da utilizzare quando è abilitata la disposizione obbligatoria" + "MANDATORYDISPOSITIONPAUSEID": "Pausa da utilizzare quando è abilitata la disposizione obbligatoria", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Scarica senza allegato", + "DOWNLOAD_WITH_ATTACHMENT": "Scarica con allegato" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/ja.json b/public/app/main/apps/sms/i18n/ja.json index 80a0be0..47baca9 100644 --- a/public/app/main/apps/sms/i18n/ja.json +++ b/public/app/main/apps/sms/i18n/ja.json @@ -277,6 +277,9 @@ "LANGUAGE": "言語", "LEXREGION": "領域", "SECRETACCESSKEY": "アクセスキーシークレット", - "WELCOMEMESSAGE": "ウェルカムメッセージ" + "WELCOMEMESSAGE": "ウェルカムメッセージ", + "DOWNLOAD_WITHOUT_ATTACHMENT": "添付せずにダウンロード", + "DOWNLOAD_WITH_ATTACHMENT": "添付してダウンロード", + "LASTMESSAGE": "最後のメッセージ" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/ko.json b/public/app/main/apps/sms/i18n/ko.json index 659f14b..81ee286 100644 --- a/public/app/main/apps/sms/i18n/ko.json +++ b/public/app/main/apps/sms/i18n/ko.json @@ -277,6 +277,9 @@ "LANGUAGE": "언어", "LEXREGION": "부위", "SECRETACCESSKEY": "액세스 키 비밀", - "WELCOMEMESSAGE": "환영 메시지" + "WELCOMEMESSAGE": "환영 메시지", + "DOWNLOAD_WITHOUT_ATTACHMENT": "첨부 파일없이 다운로드", + "DOWNLOAD_WITH_ATTACHMENT": "첨부 파일로 다운로드", + "LASTMESSAGE": "마지막 메시지" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/lv.json b/public/app/main/apps/sms/i18n/lv.json index 0c39648..8ee1a7a 100644 --- a/public/app/main/apps/sms/i18n/lv.json +++ b/public/app/main/apps/sms/i18n/lv.json @@ -277,6 +277,9 @@ "LANGUAGE": "Valoda", "LEXREGION": "Novads", "SECRETACCESSKEY": "Piekļuves atslēgas noslēpums", - "WELCOMEMESSAGE": "Sveiciena ziņa" + "WELCOMEMESSAGE": "Sveiciena ziņa", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Lejupielādējiet bez pielikuma", + "DOWNLOAD_WITH_ATTACHMENT": "Lejupielādējiet ar pielikumu", + "LASTMESSAGE": "Pēdējā ziņa" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/nl.json b/public/app/main/apps/sms/i18n/nl.json index a3ceebd..6cd5eee 100644 --- a/public/app/main/apps/sms/i18n/nl.json +++ b/public/app/main/apps/sms/i18n/nl.json @@ -277,6 +277,9 @@ "LANGUAGE": "Taal", "LEXREGION": "Regio", "SECRETACCESSKEY": "Toegangssleutel geheim", - "WELCOMEMESSAGE": "Welkoms bericht" + "WELCOMEMESSAGE": "Welkoms bericht", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download zonder bijlage", + "DOWNLOAD_WITH_ATTACHMENT": "Download met bijlage", + "LASTMESSAGE": "Laatste bericht" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/no.json b/public/app/main/apps/sms/i18n/no.json index 16aef97..d0c3d0a 100644 --- a/public/app/main/apps/sms/i18n/no.json +++ b/public/app/main/apps/sms/i18n/no.json @@ -277,6 +277,9 @@ "LANGUAGE": "Språk", "LEXREGION": "Region", "SECRETACCESSKEY": "Tilgang nøkkelhemmelighet", - "WELCOMEMESSAGE": "Velkomstmelding" + "WELCOMEMESSAGE": "Velkomstmelding", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Last ned uten vedlegg", + "DOWNLOAD_WITH_ATTACHMENT": "Last ned med vedlegg", + "LASTMESSAGE": "Siste melding" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/pl.json b/public/app/main/apps/sms/i18n/pl.json index bac7077..5f83eca 100644 --- a/public/app/main/apps/sms/i18n/pl.json +++ b/public/app/main/apps/sms/i18n/pl.json @@ -277,6 +277,9 @@ "LANGUAGE": "Język", "LEXREGION": "Region", "SECRETACCESSKEY": "Tajny klucz dostępu", - "WELCOMEMESSAGE": "Wiadomość powitalna" + "WELCOMEMESSAGE": "Wiadomość powitalna", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Pobierz bez załącznika", + "DOWNLOAD_WITH_ATTACHMENT": "Pobierz z załącznikiem", + "LASTMESSAGE": "Ostatnia wiadomość" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/pt-BR.json b/public/app/main/apps/sms/i18n/pt-BR.json index 7173b60..e340b74 100644 --- a/public/app/main/apps/sms/i18n/pt-BR.json +++ b/public/app/main/apps/sms/i18n/pt-BR.json @@ -277,6 +277,9 @@ "LANGUAGE": "Língua", "LEXREGION": "Região", "SECRETACCESSKEY": "Segredo da chave de acesso", - "WELCOMEMESSAGE": "Mensagem de boas-vindas" + "WELCOMEMESSAGE": "Mensagem de boas-vindas", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download sem anexo", + "DOWNLOAD_WITH_ATTACHMENT": "Download com anexo", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/pt-PT.json b/public/app/main/apps/sms/i18n/pt-PT.json index 87bf1b3..3ff772f 100644 --- a/public/app/main/apps/sms/i18n/pt-PT.json +++ b/public/app/main/apps/sms/i18n/pt-PT.json @@ -277,6 +277,9 @@ "LANGUAGE": "Língua", "LEXREGION": "Região", "SECRETACCESSKEY": "Segredo da chave de acesso", - "WELCOMEMESSAGE": "Mensagem de boas-vindas" + "WELCOMEMESSAGE": "Mensagem de boas-vindas", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Download sem anexo", + "DOWNLOAD_WITH_ATTACHMENT": "Download com anexo", + "LASTMESSAGE": "Última mensagem" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/ru.json b/public/app/main/apps/sms/i18n/ru.json index a2bd800..ad092be 100644 --- a/public/app/main/apps/sms/i18n/ru.json +++ b/public/app/main/apps/sms/i18n/ru.json @@ -277,6 +277,9 @@ "LANGUAGE": "язык", "LEXREGION": "Область", "SECRETACCESSKEY": "Секрет ключа доступа", - "WELCOMEMESSAGE": "Приветствие" + "WELCOMEMESSAGE": "Приветствие", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Скачать без вложения", + "DOWNLOAD_WITH_ATTACHMENT": "Скачать с приложением", + "LASTMESSAGE": "Последнее сообщение" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/sv.json b/public/app/main/apps/sms/i18n/sv.json index c17c119..1150e3d 100644 --- a/public/app/main/apps/sms/i18n/sv.json +++ b/public/app/main/apps/sms/i18n/sv.json @@ -277,6 +277,9 @@ "LANGUAGE": "Språk", "LEXREGION": "Område", "SECRETACCESSKEY": "Åtkomstnyckelhemlighet", - "WELCOMEMESSAGE": "Välkomstmeddelande" + "WELCOMEMESSAGE": "Välkomstmeddelande", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Ladda ner utan bilaga", + "DOWNLOAD_WITH_ATTACHMENT": "Ladda ner med bilaga", + "LASTMESSAGE": "Senaste meddelandet" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/tr.json b/public/app/main/apps/sms/i18n/tr.json index 53070e1..d7dd26f 100644 --- a/public/app/main/apps/sms/i18n/tr.json +++ b/public/app/main/apps/sms/i18n/tr.json @@ -277,6 +277,9 @@ "LANGUAGE": "Dil", "LEXREGION": "bölge", "SECRETACCESSKEY": "Erişim anahtarı sırrı", - "WELCOMEMESSAGE": "Karşılama mesajı" + "WELCOMEMESSAGE": "Karşılama mesajı", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Ek olmadan indir", + "DOWNLOAD_WITH_ATTACHMENT": "Ekli olarak indir", + "LASTMESSAGE": "Son Mesaj" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/zh-CN.json b/public/app/main/apps/sms/i18n/zh-CN.json index de74502..5d9294c 100644 --- a/public/app/main/apps/sms/i18n/zh-CN.json +++ b/public/app/main/apps/sms/i18n/zh-CN.json @@ -277,6 +277,9 @@ "LANGUAGE": "语言", "LEXREGION": "区域", "SECRETACCESSKEY": "访问密钥机密", - "WELCOMEMESSAGE": "欢迎留言" + "WELCOMEMESSAGE": "欢迎留言", + "DOWNLOAD_WITHOUT_ATTACHMENT": "不带附件下载", + "DOWNLOAD_WITH_ATTACHMENT": "附件下载", + "LASTMESSAGE": "最后留言" } } \ No newline at end of file diff --git a/public/app/main/apps/sms/i18n/zh-TW.json b/public/app/main/apps/sms/i18n/zh-TW.json index 1571692..ce1969b 100644 --- a/public/app/main/apps/sms/i18n/zh-TW.json +++ b/public/app/main/apps/sms/i18n/zh-TW.json @@ -277,6 +277,9 @@ "LANGUAGE": "語言", "LEXREGION": "區域", "SECRETACCESSKEY": "訪問密鑰機密", - "WELCOMEMESSAGE": "歡迎留言" + "WELCOMEMESSAGE": "歡迎留言", + "DOWNLOAD_WITHOUT_ATTACHMENT": "不帶附件下載", + "DOWNLOAD_WITH_ATTACHMENT": "附件下載", + "LASTMESSAGE": "最後留言" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/ar.json b/public/app/toolbar/i18n/ar.json index 3b4f527..6acb0a6 100644 --- a/public/app/toolbar/i18n/ar.json +++ b/public/app/toolbar/i18n/ar.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "غير اللغة", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "لا توجد أجهزة صوتية متاحة", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "لا يتوفر ميكروفون", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "لا يوجد مكبر صوت متاح" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "لا يوجد مكبر صوت متاح", + "NO_AVAILABLE_INFO": "لا توجد معلومات متاحة" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/da.json b/public/app/toolbar/i18n/da.json index d7ed62c..689b3fb 100644 --- a/public/app/toolbar/i18n/da.json +++ b/public/app/toolbar/i18n/da.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Skift sprog", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Ingen lydenheder tilgængelige", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Ingen mikrofon tilgængelig", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Ingen højttaler tilgængelig" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Ingen højttaler tilgængelig", + "NO_AVAILABLE_INFO": "Ingen tilgængelige oplysninger" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/de.json b/public/app/toolbar/i18n/de.json index 66314f8..932cdd0 100644 --- a/public/app/toolbar/i18n/de.json +++ b/public/app/toolbar/i18n/de.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Sprache ändern", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Keine Audiogeräte verfügbar", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Kein Mikrofon vorhanden", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Kein Lautsprecher verfügbar" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Kein Lautsprecher verfügbar", + "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/es.json b/public/app/toolbar/i18n/es.json index c3e5d63..e3253dc 100644 --- a/public/app/toolbar/i18n/es.json +++ b/public/app/toolbar/i18n/es.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Cambiar idioma", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "No hay dispositivos de audio disponibles", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "No hay micrófono disponible", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "No hay altavoces disponibles" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "No hay altavoces disponibles", + "NO_AVAILABLE_INFO": "No hay información disponible." } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/fa.json b/public/app/toolbar/i18n/fa.json index 4569781..a04d85f 100644 --- a/public/app/toolbar/i18n/fa.json +++ b/public/app/toolbar/i18n/fa.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "تغییر زبان", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "دستگاه صوتی موجود نیست", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "هیچ میکروفون در دسترس نیست", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "هیچ بلندگو در دسترس نیست" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "هیچ بلندگو در دسترس نیست", + "NO_AVAILABLE_INFO": "هیچ اطلاعات در دسترس نیست" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/fi.json b/public/app/toolbar/i18n/fi.json index 8443636..6fce60c 100644 --- a/public/app/toolbar/i18n/fi.json +++ b/public/app/toolbar/i18n/fi.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Vaihda kieltä", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Audiolaitteita ei ole saatavana", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Mikrofonia ei ole saatavana", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Kaiutinta ei ole saatavilla" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Kaiutinta ei ole saatavilla", + "NO_AVAILABLE_INFO": "Ei tietoa" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/fr.json b/public/app/toolbar/i18n/fr.json index c3f9d9d..c6278e0 100644 --- a/public/app/toolbar/i18n/fr.json +++ b/public/app/toolbar/i18n/fr.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Changer de langue", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Aucun périphérique audio disponible", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Pas de microphone disponible", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Aucun haut-parleur disponible" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Aucun haut-parleur disponible", + "NO_AVAILABLE_INFO": "Aucune information disponible" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/he.json b/public/app/toolbar/i18n/he.json index 384c0d7..58da1f5 100644 --- a/public/app/toolbar/i18n/he.json +++ b/public/app/toolbar/i18n/he.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "שנה שפה", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "אין מכשירי שמע זמינים", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "אין מיקרופון זמין", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "אין רמקול זמין" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "אין רמקול זמין", + "NO_AVAILABLE_INFO": "אין מידע זמין" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/hi.json b/public/app/toolbar/i18n/hi.json index 0eec8c1..0a3f42c 100644 --- a/public/app/toolbar/i18n/hi.json +++ b/public/app/toolbar/i18n/hi.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "भाषा बदलो", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "कोई ऑडियो डिवाइस उपलब्ध नहीं है", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "कोई माइक्रोफोन उपलब्ध नहीं है", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "कोई स्पीकर उपलब्ध नहीं है" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "कोई स्पीकर उपलब्ध नहीं है", + "NO_AVAILABLE_INFO": "कोई उपलब्ध जानकारी नहीं" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/id.json b/public/app/toolbar/i18n/id.json index ca3b7dd..037e09f 100644 --- a/public/app/toolbar/i18n/id.json +++ b/public/app/toolbar/i18n/id.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Ganti BAHASA", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Tidak ada perangkat audio yang tersedia", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Mikrofon tidak tersedia", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Tidak ada pembicara yang tersedia" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Tidak ada pembicara yang tersedia", + "NO_AVAILABLE_INFO": "Tidak ada info yang tersedia" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/ja.json b/public/app/toolbar/i18n/ja.json index 6ef5d9c..4152a26 100644 --- a/public/app/toolbar/i18n/ja.json +++ b/public/app/toolbar/i18n/ja.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "言語を変えてください", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "利用可能なオーディオデバイスがありません", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "マイクがありません", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "利用できるスピーカーはありません" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "利用できるスピーカーはありません", + "NO_AVAILABLE_INFO": "利用可能な情報はありません" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/ko.json b/public/app/toolbar/i18n/ko.json index 16e489d..ac15cba 100644 --- a/public/app/toolbar/i18n/ko.json +++ b/public/app/toolbar/i18n/ko.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "언어 변경", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "사용 가능한 오디오 장치가 없습니다", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "사용 가능한 마이크가 없습니다", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "사용 가능한 스피커가 없습니다" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "사용 가능한 스피커가 없습니다", + "NO_AVAILABLE_INFO": "사용 가능한 정보가 없습니다" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/lv.json b/public/app/toolbar/i18n/lv.json index 83e6dd5..b6514e0 100644 --- a/public/app/toolbar/i18n/lv.json +++ b/public/app/toolbar/i18n/lv.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Mainīt VALODU", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Neviena audio ierīce nav pieejama", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Nav pieejams mikrofons", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Nav pieejams neviens runātājs" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Nav pieejams neviens runātājs", + "NO_AVAILABLE_INFO": "Nav pieejama informācija" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/nl.json b/public/app/toolbar/i18n/nl.json index a4fc788..068ad16 100644 --- a/public/app/toolbar/i18n/nl.json +++ b/public/app/toolbar/i18n/nl.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Verander de taal", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Geen audio-apparaten beschikbaar", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Geen microfoon beschikbaar", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Geen speaker beschikbaar" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Geen speaker beschikbaar", + "NO_AVAILABLE_INFO": "Geen beschikbare info" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/no.json b/public/app/toolbar/i18n/no.json index 2b9432c..155133b 100644 --- a/public/app/toolbar/i18n/no.json +++ b/public/app/toolbar/i18n/no.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Skifte språk", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Ingen lydenheter tilgjengelig", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Ingen mikrofon tilgjengelig", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Ingen høyttaler tilgjengelig" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Ingen høyttaler tilgjengelig", + "NO_AVAILABLE_INFO": "Ingen tilgjengelige info" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/pl.json b/public/app/toolbar/i18n/pl.json index c382f88..9f67ec2 100644 --- a/public/app/toolbar/i18n/pl.json +++ b/public/app/toolbar/i18n/pl.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Zmień język", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Brak dostępnych urządzeń audio", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Brak dostępnego mikrofonu", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Brak dostępnych głośników" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Brak dostępnych głośników", + "NO_AVAILABLE_INFO": "Brak dostępnych informacji" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/pt-BR.json b/public/app/toolbar/i18n/pt-BR.json index 1b01474..e8f729c 100644 --- a/public/app/toolbar/i18n/pt-BR.json +++ b/public/app/toolbar/i18n/pt-BR.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Mudar idioma", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Nenhum dispositivo de áudio disponível", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Nenhum microfone disponível", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Nenhum alto-falante disponível" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Nenhum alto-falante disponível", + "NO_AVAILABLE_INFO": "Nenhuma informação disponível" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/pt-PT.json b/public/app/toolbar/i18n/pt-PT.json index 349a438..e8c12c7 100644 --- a/public/app/toolbar/i18n/pt-PT.json +++ b/public/app/toolbar/i18n/pt-PT.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Mudar idioma", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Nenhum dispositivo de áudio disponível", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Nenhum microfone disponível", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Nenhum alto-falante disponível" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Nenhum alto-falante disponível", + "NO_AVAILABLE_INFO": "Nenhuma informação disponível" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/ru.json b/public/app/toolbar/i18n/ru.json index 01bc9b1..0f5cd3e 100644 --- a/public/app/toolbar/i18n/ru.json +++ b/public/app/toolbar/i18n/ru.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "изменение языка", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Нет доступных аудиоустройств", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Микрофон недоступен", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Нет доступных динамиков" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Нет доступных динамиков", + "NO_AVAILABLE_INFO": "Нет доступной информации" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/sv.json b/public/app/toolbar/i18n/sv.json index ee51f2f..7a26b74 100644 --- a/public/app/toolbar/i18n/sv.json +++ b/public/app/toolbar/i18n/sv.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Ändra språk", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Inga ljudenheter tillgängliga", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Ingen mikrofon tillgänglig", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Ingen högtalare tillgänglig" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Ingen högtalare tillgänglig", + "NO_AVAILABLE_INFO": "Ingen tillgänglig information" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/tr.json b/public/app/toolbar/i18n/tr.json index 2eaebfa..118e960 100644 --- a/public/app/toolbar/i18n/tr.json +++ b/public/app/toolbar/i18n/tr.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "Dili değiştir", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Ses cihazı yok", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Mikrofon yok", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "Hoparlör yok" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "Hoparlör yok", + "NO_AVAILABLE_INFO": "Kullanılabilir bilgi yok" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/zh-CN.json b/public/app/toolbar/i18n/zh-CN.json index be2664a..295d324 100644 --- a/public/app/toolbar/i18n/zh-CN.json +++ b/public/app/toolbar/i18n/zh-CN.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "改变语言", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "没有可用的音频设备", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "没有可用的麦克风", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "没有扬声器" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "没有扬声器", + "NO_AVAILABLE_INFO": "无可用信息" } } \ No newline at end of file diff --git a/public/app/toolbar/i18n/zh-TW.json b/public/app/toolbar/i18n/zh-TW.json index 9356b45..0344eff 100644 --- a/public/app/toolbar/i18n/zh-TW.json +++ b/public/app/toolbar/i18n/zh-TW.json @@ -97,6 +97,7 @@ "CHANGE_LANGUAGE_TITLE": "改變語言", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "沒有可用的音頻設備", "WEBRTC_MICROPHONE_NOT_AVAILABLE": "沒有可用的麥克風", - "WEBRTC_SPEAKER_NOT_AVAILABLE": "沒有揚聲器" + "WEBRTC_SPEAKER_NOT_AVAILABLE": "沒有揚聲器", + "NO_AVAILABLE_INFO": "無可用信息" } } \ No newline at end of file diff --git a/public/assets/images/business/voiceRecordings.jpg b/public/assets/images/business/voiceRecordings.jpg deleted file mode 100644 index 065f758..0000000 Binary files a/public/assets/images/business/voiceRecordings.jpg and /dev/null differ diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 62b88cb..d6e043b 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 _0x6f6d=['exports','getDataValue','action','STRING','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x30115a,_0x5a0ed0){var _0x52cff4=function(_0x41f1a0){while(--_0x41f1a0){_0x30115a['push'](_0x30115a['shift']());}};_0x52cff4(++_0x5a0ed0);}(_0x6f6d,0x1db));var _0xd6f6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6f6d[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xd6f6('0x0'));module[_0xd6f6('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5caaf1){return this[_0xd6f6('0x2')](_0xd6f6('0x3'));}},'action':{'type':Sequelize[_0xd6f6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xd6f6('0x5'),_0xd6f6('0x6'),_0xd6f6('0x7'),'urlForward','browser',_0xd6f6('0x8'),_0xd6f6('0x9')]],'msg':_0xd6f6('0xa')}},'comment':_0xd6f6('0xa')},'data1':{'type':Sequelize[_0xd6f6('0x4')](0x1000),'comment':_0xd6f6('0xb')},'data2':{'type':Sequelize[_0xd6f6('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xd6f6('0x4')](0x1000),'comment':_0xd6f6('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xd6f6('0x4')](0x1000)},'data6':{'type':Sequelize[_0xd6f6('0x4')]},'data7':{'type':Sequelize[_0xd6f6('0xd')]}}; \ No newline at end of file +var _0xd68d=['TEXT','exports','action','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]'];(function(_0x5b8c28,_0x219f5f){var _0x4a36ec=function(_0x297c4e){while(--_0x297c4e){_0x5b8c28['push'](_0x5b8c28['shift']());}};_0x4a36ec(++_0x219f5f);}(_0xd68d,0x153));var _0xdd68=function(_0x2ccaa3,_0x382907){_0x2ccaa3=_0x2ccaa3-0x0;var _0x4599d6=_0xd68d[_0x2ccaa3];return _0x4599d6;};'use strict';var Sequelize=require('sequelize');module[_0xdd68('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4028bd){return this['getDataValue'](_0xdd68('0x1'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager','integration',_0xdd68('0x2'),_0xdd68('0x3'),_0xdd68('0x4'),_0xdd68('0x5'),_0xdd68('0x6'),'script']],'msg':_0xdd68('0x7')}},'comment':_0xdd68('0x7')},'data1':{'type':Sequelize[_0xdd68('0x8')](0x1000),'comment':_0xdd68('0x9')},'data2':{'type':Sequelize[_0xdd68('0x8')](0x1000),'comment':_0xdd68('0xa')},'data3':{'type':Sequelize[_0xdd68('0x8')](0x1000),'comment':_0xdd68('0xb')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0xdd68('0xc')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 2e0837e..60fb18c 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 _0x4eae=['body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0x4eae,0x9b));var _0xe4ea=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x4eae[_0x5e6ea3];return _0x4048b5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe4ea('0x0'));var rimraf=require(_0xe4ea('0x1'));var zipdir=require(_0xe4ea('0x2'));var jsonpatch=require(_0xe4ea('0x3'));var rp=require(_0xe4ea('0x4'));var moment=require('moment');var BPromise=require(_0xe4ea('0x5'));var Mustache=require(_0xe4ea('0x6'));var util=require(_0xe4ea('0x7'));var path=require(_0xe4ea('0x8'));var sox=require(_0xe4ea('0x9'));var csv=require('to-csv');var ejs=require(_0xe4ea('0xa'));var fs=require('fs');var _=require(_0xe4ea('0xb'));var squel=require(_0xe4ea('0xc'));var crypto=require(_0xe4ea('0xd'));var jsforce=require(_0xe4ea('0xe'));var deskjs=require(_0xe4ea('0xf'));var toCsv=require(_0xe4ea('0x10'));var querystring=require(_0xe4ea('0x11'));var Papa=require(_0xe4ea('0x12'));var Redis=require('ioredis');var authService=require(_0xe4ea('0x13'));var qs=require(_0xe4ea('0x14'));var as=require(_0xe4ea('0x15'));var hardwareService=require(_0xe4ea('0x16'));var logger=require(_0xe4ea('0x17'))(_0xe4ea('0x18'));var utils=require(_0xe4ea('0x19'));var config=require(_0xe4ea('0x1a'));var db=require(_0xe4ea('0x1b'))['db'];function respondWithStatusCode(_0x486cb0,_0x18107e){_0x18107e=_0x18107e||0xcc;return function(_0x52232b){if(_0x52232b){return _0x486cb0[_0xe4ea('0x1c')](_0x18107e);}return _0x486cb0[_0xe4ea('0x1d')](_0x18107e)['end']();};}function respondWithResult(_0x759de4,_0x1961ec){_0x1961ec=_0x1961ec||0xc8;return function(_0x444ec7){if(_0x444ec7){return _0x759de4[_0xe4ea('0x1d')](_0x1961ec)[_0xe4ea('0x1e')](_0x444ec7);}};}function respondWithFilteredResult(_0x4e1510,_0x370c1a){return function(_0x2e4485){if(_0x2e4485){var _0x31be86=_0x2e4485[_0xe4ea('0x1f')],_0xebd4ce=_0x370c1a[_0xe4ea('0x20')],_0x1007ac=_0x370c1a[_0xe4ea('0x20')]+_0x370c1a[_0xe4ea('0x21')],_0x1aa2f4;if(_0x1007ac>=_0x31be86){_0x1007ac=_0x31be86;_0x1aa2f4=0xc8;}else{_0x1aa2f4=0xce;}_0x4e1510[_0xe4ea('0x1d')](_0x1aa2f4);return _0x4e1510[_0xe4ea('0x22')](_0xe4ea('0x23'),_0xebd4ce+'-'+_0x1007ac+'/'+_0x31be86)[_0xe4ea('0x1e')](_0x2e4485);}return null;};}function patchUpdates(_0x2ef484){return function(_0x156c6d){try{jsonpatch[_0xe4ea('0x24')](_0x156c6d,_0x2ef484,!![]);}catch(_0x3681ab){return BPromise[_0xe4ea('0x25')](_0x3681ab);}return _0x156c6d['save']();};}function saveUpdates(_0xadb225,_0x304d7f){return function(_0xd0f821){if(_0xd0f821){return _0xd0f821['update'](_0xadb225)[_0xe4ea('0x26')](function(_0x42f656){return _0x42f656;});}return null;};}function removeEntity(_0x5f4302,_0x57915e){return function(_0x12300a){if(_0x12300a){return _0x12300a[_0xe4ea('0x27')]()[_0xe4ea('0x26')](function(){_0x5f4302['status'](0xcc)[_0xe4ea('0x28')]();});}};}function handleEntityNotFound(_0x26d3f6,_0x2861da){return function(_0x87450c){if(!_0x87450c){_0x26d3f6[_0xe4ea('0x1c')](0x194);}return _0x87450c;};}function handleError(_0x46272f,_0x32a543){_0x32a543=_0x32a543||0x1f4;return function(_0x2963de){logger[_0xe4ea('0x29')](_0x2963de[_0xe4ea('0x2a')]);if(_0x2963de[_0xe4ea('0x2b')]){delete _0x2963de[_0xe4ea('0x2b')];}_0x46272f['status'](_0x32a543)[_0xe4ea('0x2c')](_0x2963de);};}exports['update']=function(_0x206837,_0x23ef93){if(_0x206837[_0xe4ea('0x2d')]['id']){delete _0x206837['body']['id'];}return db[_0xe4ea('0x2e')][_0xe4ea('0x2f')]({'where':{'id':_0x206837[_0xe4ea('0x30')]['id']}})[_0xe4ea('0x26')](handleEntityNotFound(_0x23ef93,null))[_0xe4ea('0x26')](saveUpdates(_0x206837['body'],null))[_0xe4ea('0x26')](respondWithResult(_0x23ef93,null))[_0xe4ea('0x31')](handleError(_0x23ef93,null));};exports['destroy']=function(_0x184bb5,_0x5d0e2f){return db[_0xe4ea('0x2e')]['find']({'where':{'id':_0x184bb5[_0xe4ea('0x30')]['id']}})[_0xe4ea('0x26')](handleEntityNotFound(_0x5d0e2f,null))[_0xe4ea('0x26')](removeEntity(_0x5d0e2f,null))[_0xe4ea('0x31')](handleError(_0x5d0e2f,null));}; \ No newline at end of file +var _0x989e=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','Content-Range','save','update','then','error','stack','name','send','body','Action','find','params','catch','destroy','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis'];(function(_0x4232d8,_0x13fd09){var _0x324de2=function(_0x167ad5){while(--_0x167ad5){_0x4232d8['push'](_0x4232d8['shift']());}};_0x324de2(++_0x13fd09);}(_0x989e,0x1f2));var _0xe989=function(_0x15fc3c,_0x35665b){_0x15fc3c=_0x15fc3c-0x0;var _0x94c5c8=_0x989e[_0x15fc3c];return _0x94c5c8;};'use strict';var pdf=require(_0xe989('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe989('0x1'));var zipdir=require(_0xe989('0x2'));var jsonpatch=require(_0xe989('0x3'));var rp=require('request-promise');var moment=require(_0xe989('0x4'));var BPromise=require(_0xe989('0x5'));var Mustache=require(_0xe989('0x6'));var util=require(_0xe989('0x7'));var path=require(_0xe989('0x8'));var sox=require(_0xe989('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe989('0xa'));var squel=require(_0xe989('0xb'));var crypto=require(_0xe989('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe989('0xd'));var toCsv=require(_0xe989('0xe'));var querystring=require(_0xe989('0xf'));var Papa=require(_0xe989('0x10'));var Redis=require(_0xe989('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe989('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe989('0x13'));var utils=require(_0xe989('0x14'));var config=require(_0xe989('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4de8bb,_0x39c593){_0x39c593=_0x39c593||0xcc;return function(_0x1e2289){if(_0x1e2289){return _0x4de8bb[_0xe989('0x16')](_0x39c593);}return _0x4de8bb[_0xe989('0x17')](_0x39c593)[_0xe989('0x18')]();};}function respondWithResult(_0x864cfd,_0x90a3fc){_0x90a3fc=_0x90a3fc||0xc8;return function(_0x1b6a7d){if(_0x1b6a7d){return _0x864cfd['status'](_0x90a3fc)[_0xe989('0x19')](_0x1b6a7d);}};}function respondWithFilteredResult(_0x59f831,_0x5432b2){return function(_0x14c44c){if(_0x14c44c){var _0x5d0ff5=_0x14c44c[_0xe989('0x1a')],_0x3f23f0=_0x5432b2[_0xe989('0x1b')],_0x1838ff=_0x5432b2[_0xe989('0x1b')]+_0x5432b2['limit'],_0x201975;if(_0x1838ff>=_0x5d0ff5){_0x1838ff=_0x5d0ff5;_0x201975=0xc8;}else{_0x201975=0xce;}_0x59f831[_0xe989('0x17')](_0x201975);return _0x59f831[_0xe989('0x1c')](_0xe989('0x1d'),_0x3f23f0+'-'+_0x1838ff+'/'+_0x5d0ff5)[_0xe989('0x19')](_0x14c44c);}return null;};}function patchUpdates(_0x536fb1){return function(_0x403e5e){try{jsonpatch['apply'](_0x403e5e,_0x536fb1,!![]);}catch(_0x5d391d){return BPromise['reject'](_0x5d391d);}return _0x403e5e[_0xe989('0x1e')]();};}function saveUpdates(_0x589ff7,_0x55e9bc){return function(_0x2fcb0e){if(_0x2fcb0e){return _0x2fcb0e[_0xe989('0x1f')](_0x589ff7)[_0xe989('0x20')](function(_0x7087c){return _0x7087c;});}return null;};}function removeEntity(_0x333497,_0x2604d1){return function(_0x45317a){if(_0x45317a){return _0x45317a['destroy']()[_0xe989('0x20')](function(){_0x333497[_0xe989('0x17')](0xcc)[_0xe989('0x18')]();});}};}function handleEntityNotFound(_0x133ba4,_0x11b25a){return function(_0x57e8a6){if(!_0x57e8a6){_0x133ba4[_0xe989('0x16')](0x194);}return _0x57e8a6;};}function handleError(_0x157980,_0x3f2d71){_0x3f2d71=_0x3f2d71||0x1f4;return function(_0x14584c){logger[_0xe989('0x21')](_0x14584c[_0xe989('0x22')]);if(_0x14584c[_0xe989('0x23')]){delete _0x14584c[_0xe989('0x23')];}_0x157980['status'](_0x3f2d71)[_0xe989('0x24')](_0x14584c);};}exports['update']=function(_0x2578e4,_0x340911){if(_0x2578e4[_0xe989('0x25')]['id']){delete _0x2578e4[_0xe989('0x25')]['id'];}return db[_0xe989('0x26')][_0xe989('0x27')]({'where':{'id':_0x2578e4[_0xe989('0x28')]['id']}})['then'](handleEntityNotFound(_0x340911,null))['then'](saveUpdates(_0x2578e4[_0xe989('0x25')],null))['then'](respondWithResult(_0x340911,null))[_0xe989('0x29')](handleError(_0x340911,null));};exports[_0xe989('0x2a')]=function(_0x538650,_0x55bfde){return db[_0xe989('0x26')][_0xe989('0x27')]({'where':{'id':_0x538650[_0xe989('0x28')]['id']}})['then'](handleEntityNotFound(_0x55bfde,null))[_0xe989('0x20')](removeEntity(_0x55bfde,null))['catch'](handleError(_0x55bfde,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index e3fb911..c965e8d 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 _0xd03c=['bluebird','request-promise','rimraf','./action.attributes','exports','Action','util','../../config/logger','api','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd03c,0x114));var _0xcd03=function(_0x5a8d22,_0xc3ae0c){_0x5a8d22=_0x5a8d22-0x0;var _0x5220c4=_0xd03c[_0x5a8d22];return _0x5220c4;};'use strict';var _=require('lodash');var util=require(_0xcd03('0x0'));var logger=require(_0xcd03('0x1'))(_0xcd03('0x2'));var moment=require(_0xcd03('0x3'));var BPromise=require(_0xcd03('0x4'));var rp=require(_0xcd03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd03('0x6'));var config=require('../../config/environment');var attributes=require(_0xcd03('0x7'));module[_0xcd03('0x8')]=function(_0x129427,_0x97caa4){return _0x129427['define'](_0xcd03('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb354=['exports','define','Action','lodash','../../config/logger','moment','request-promise','path','../../config/environment','./action.attributes'];(function(_0x8ff761,_0x25c272){var _0x37e4e0=function(_0x5187d4){while(--_0x5187d4){_0x8ff761['push'](_0x8ff761['shift']());}};_0x37e4e0(++_0x25c272);}(_0xb354,0x11b));var _0x4b35=function(_0x233f8a,_0x2b684a){_0x233f8a=_0x233f8a-0x0;var _0x1aaebb=_0xb354[_0x233f8a];return _0x1aaebb;};'use strict';var _=require(_0x4b35('0x0'));var util=require('util');var logger=require(_0x4b35('0x1'))('api');var moment=require(_0x4b35('0x2'));var BPromise=require('bluebird');var rp=require(_0x4b35('0x3'));var fs=require('fs');var path=require(_0x4b35('0x4'));var rimraf=require('rimraf');var config=require(_0x4b35('0x5'));var attributes=require(_0x4b35('0x6'));module[_0x4b35('0x7')]=function(_0x352e89,_0x2767c6){return _0x352e89[_0x4b35('0x8')](_0x4b35('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index b28c8ce..8951216 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 _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1d8833,_0x4b9cf7){var _0x3b1232=function(_0x1c8bbe){while(--_0x1c8bbe){_0x1d8833['push'](_0x1d8833['shift']());}};_0x3b1232(++_0x4b9cf7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x561320,_0x142ed9){var _0x1b7c07=function(_0x5e8d9d){while(--_0x5e8d9d){_0x561320['push'](_0x561320['shift']());}};_0x1b7c07(++_0x142ed9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb7e7[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 6015819..bec85f2 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 _0xa5ad=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','multer','util','path','connect-timeout'];(function(_0x566558,_0xe8c049){var _0x26430e=function(_0x52b2c8){while(--_0x52b2c8){_0x566558['push'](_0x566558['shift']());}};_0x26430e(++_0xe8c049);}(_0xa5ad,0x191));var _0xda5a=function(_0x419f6a,_0x34be35){_0x419f6a=_0x419f6a-0x0;var _0x1bdcd0=_0xa5ad[_0x419f6a];return _0x1bdcd0;};'use strict';var multer=require(_0xda5a('0x0'));var util=require(_0xda5a('0x1'));var path=require(_0xda5a('0x2'));var timeout=require(_0xda5a('0x3'));var express=require(_0xda5a('0x4'));var router=express[_0xda5a('0x5')]();var auth=require(_0xda5a('0x6'));var interaction=require(_0xda5a('0x7'));var config=require(_0xda5a('0x8'));var controller=require(_0xda5a('0x9'));router['put'](_0xda5a('0xa'),auth['isAuthenticated'](),controller[_0xda5a('0xb')]);router[_0xda5a('0xc')](_0xda5a('0xa'),auth[_0xda5a('0xd')](),controller[_0xda5a('0xe')]);module['exports']=router; \ No newline at end of file +var _0x14a0=['../../components/interaction/service','../../config/environment','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service'];(function(_0xc1375,_0x5da520){var _0x3a0ff2=function(_0x776919){while(--_0x776919){_0xc1375['push'](_0xc1375['shift']());}};_0x3a0ff2(++_0x5da520);}(_0x14a0,0x1ab));var _0x014a=function(_0x79a609,_0x4565f1){_0x79a609=_0x79a609-0x0;var _0x3b6943=_0x14a0[_0x79a609];return _0x3b6943;};'use strict';var multer=require(_0x014a('0x0'));var util=require(_0x014a('0x1'));var path=require('path');var timeout=require(_0x014a('0x2'));var express=require('express');var router=express[_0x014a('0x3')]();var auth=require(_0x014a('0x4'));var interaction=require(_0x014a('0x5'));var config=require(_0x014a('0x6'));var controller=require('./action.controller');router['put']('/:id',auth[_0x014a('0x7')](),controller[_0x014a('0x8')]);router[_0x014a('0x9')]('/:id',auth[_0x014a('0x7')](),controller[_0x014a('0xa')]);module[_0x014a('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index c96a680..b6a52f7 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 _0x2959=['TEXT','sequelize','exports','STRING'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x2959,0x11d));var _0x9295=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2959[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x9295('0x0'));module[_0x9295('0x1')]={'name':{'type':Sequelize[_0x9295('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9295('0x2')]},'table':{'type':Sequelize[_0x9295('0x2')]},'conditions':{'type':Sequelize[_0x9295('0x3')]},'joins':{'type':Sequelize[_0x9295('0x3')]}}; \ No newline at end of file +var _0x4e86=['TEXT','sequelize','exports','STRING'];(function(_0x5ab726,_0x44e515){var _0x235b82=function(_0x30db34){while(--_0x30db34){_0x5ab726['push'](_0x5ab726['shift']());}};_0x235b82(++_0x44e515);}(_0x4e86,0x1b5));var _0x64e8=function(_0x390f7e,_0x49be98){_0x390f7e=_0x390f7e-0x0;var _0x53a8c6=_0x4e86[_0x390f7e];return _0x53a8c6;};'use strict';var Sequelize=require(_0x64e8('0x0'));module[_0x64e8('0x1')]={'name':{'type':Sequelize[_0x64e8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x64e8('0x2')]},'parent':{'type':Sequelize[_0x64e8('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x64e8('0x3')]},'joins':{'type':Sequelize[_0x64e8('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index e0f5a3b..c14bd8d 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 _0xaf6c=['../../files/reports','savename','COUNT(*)','run','runReport','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','CustomReports','UserProfileResource','end','error','stack','name','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','AnalyticCustomReport','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','order','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','MAX(%s)','MIN(%s)','HOUR(%s)','IS\x20NOT\x20NULL','from','No\x20available\x20data','output','web','fullPath','%s-%s.%s','csv','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/'];(function(_0x34a595,_0x29589c){var _0x24821d=function(_0x53aeef){while(--_0x53aeef){_0x34a595['push'](_0x34a595['shift']());}};_0x24821d(++_0x29589c);}(_0xaf6c,0x13d));var _0xcaf6=function(_0xd4f745,_0x897ceb){_0xd4f745=_0xd4f745-0x0;var _0x491252=_0xaf6c[_0xd4f745];return _0x491252;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcaf6('0x0'));var rimraf=require(_0xcaf6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaf6('0x2'));var rp=require(_0xcaf6('0x3'));var moment=require(_0xcaf6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcaf6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcaf6('0x6'));var ejs=require(_0xcaf6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcaf6('0x8'));var crypto=require(_0xcaf6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xcaf6('0xa'));var toCsv=require(_0xcaf6('0x6'));var querystring=require(_0xcaf6('0xb'));var Papa=require(_0xcaf6('0xc'));var Redis=require(_0xcaf6('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcaf6('0xe'));var hardwareService=require(_0xcaf6('0xf'));var logger=require(_0xcaf6('0x10'))('api');var utils=require(_0xcaf6('0x11'));var config=require(_0xcaf6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x469beb,_0x13895d){_0x13895d=_0x13895d||0xcc;return function(_0x18c798){if(_0x18c798){return _0x469beb[_0xcaf6('0x13')](_0x13895d);}return _0x469beb[_0xcaf6('0x14')](_0x13895d)['end']();};}function respondWithResult(_0x5df73d,_0xc9cf77){_0xc9cf77=_0xc9cf77||0xc8;return function(_0x1b1ccc){if(_0x1b1ccc){return _0x5df73d[_0xcaf6('0x14')](_0xc9cf77)[_0xcaf6('0x15')](_0x1b1ccc);}};}function respondWithFilteredResult(_0x1c777a,_0x2d08d1){return function(_0x3e5d5f){if(_0x3e5d5f){var _0x308073=_0x3e5d5f[_0xcaf6('0x16')],_0x33d07a=_0x2d08d1[_0xcaf6('0x17')],_0x442fd5=_0x2d08d1[_0xcaf6('0x17')]+_0x2d08d1[_0xcaf6('0x18')],_0x37a1ae;if(_0x442fd5>=_0x308073){_0x442fd5=_0x308073;_0x37a1ae=0xc8;}else{_0x37a1ae=0xce;}_0x1c777a[_0xcaf6('0x14')](_0x37a1ae);return _0x1c777a[_0xcaf6('0x19')](_0xcaf6('0x1a'),_0x33d07a+'-'+_0x442fd5+'/'+_0x308073)[_0xcaf6('0x15')](_0x3e5d5f);}return null;};}function patchUpdates(_0x21c04f){return function(_0xe8cd9){try{jsonpatch['apply'](_0xe8cd9,_0x21c04f,!![]);}catch(_0x5e2cf2){return BPromise[_0xcaf6('0x1b')](_0x5e2cf2);}return _0xe8cd9[_0xcaf6('0x1c')]();};}function saveUpdates(_0x3a8935,_0x37a4a8){return function(_0x543db1){if(_0x543db1){return _0x543db1[_0xcaf6('0x1d')](_0x3a8935)[_0xcaf6('0x1e')](function(_0x5004c4){return _0x5004c4;});}return null;};}function removeEntity(_0x373fdd,_0x2a9a3b){return function(_0x10c683){if(_0x10c683){return _0x10c683[_0xcaf6('0x1f')]()[_0xcaf6('0x1e')](function(){var _0x3b4d1d=_0x10c683['get']({'plain':!![]});var _0x3fab97=_0xcaf6('0x20');return db[_0xcaf6('0x21')][_0xcaf6('0x1f')]({'where':{'type':_0x3fab97,'resourceId':_0x3b4d1d['id']}})[_0xcaf6('0x1e')](function(){return _0x10c683;});})[_0xcaf6('0x1e')](function(){_0x373fdd['status'](0xcc)[_0xcaf6('0x22')]();});}};}function handleEntityNotFound(_0x11c300,_0x387acc){return function(_0x5c52dd){if(!_0x5c52dd){_0x11c300[_0xcaf6('0x13')](0x194);}return _0x5c52dd;};}function handleError(_0x5177f4,_0xc24d9d){_0xc24d9d=_0xc24d9d||0x1f4;return function(_0xe3c08){logger[_0xcaf6('0x23')](_0xe3c08[_0xcaf6('0x24')]);if(_0xe3c08[_0xcaf6('0x25')]){delete _0xe3c08[_0xcaf6('0x25')];}_0x5177f4[_0xcaf6('0x14')](_0xc24d9d)['send'](_0xe3c08);};}exports['index']=function(_0x11fef7,_0x5b04a5){var _0x3ef390={},_0x4cead9={},_0x1e0072={'count':0x0,'rows':[]};var _0x2223a9=_[_0xcaf6('0x26')](db['AnalyticCustomReport'][_0xcaf6('0x27')],function(_0x328c80){return{'name':_0x328c80['fieldName'],'type':_0x328c80[_0xcaf6('0x28')][_0xcaf6('0x29')]};});_0x4cead9[_0xcaf6('0x2a')]=_['map'](_0x2223a9,_0xcaf6('0x25'));_0x4cead9[_0xcaf6('0x2b')]=_['keys'](_0x11fef7[_0xcaf6('0x2b')]);_0x4cead9[_0xcaf6('0x2c')]=_[_0xcaf6('0x2d')](_0x4cead9[_0xcaf6('0x2a')],_0x4cead9[_0xcaf6('0x2b')]);_0x3ef390['attributes']=_[_0xcaf6('0x2d')](_0x4cead9[_0xcaf6('0x2a')],qs[_0xcaf6('0x2e')](_0x11fef7['query'][_0xcaf6('0x2e')]));_0x3ef390[_0xcaf6('0x2f')]=_0x3ef390[_0xcaf6('0x2f')][_0xcaf6('0x30')]?_0x3ef390[_0xcaf6('0x2f')]:_0x4cead9[_0xcaf6('0x2a')];if(!_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x31')](_0xcaf6('0x32'))){_0x3ef390['limit']=qs[_0xcaf6('0x18')](_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x18')]);_0x3ef390[_0xcaf6('0x17')]=qs[_0xcaf6('0x17')](_0x11fef7[_0xcaf6('0x2b')]['offset']);}_0x3ef390['order']=qs['sort'](_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x33')]);_0x3ef390['where']=qs[_0xcaf6('0x2c')](_['pick'](_0x11fef7[_0xcaf6('0x2b')],_0x4cead9[_0xcaf6('0x2c')]));if(_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x34')]){_0x3ef390[_0xcaf6('0x35')]=_[_0xcaf6('0x36')](_0x3ef390[_0xcaf6('0x35')],{'$or':_[_0xcaf6('0x26')](_0x2223a9,function(_0x4b21a2){if(_0x4b21a2[_0xcaf6('0x28')]!==_0xcaf6('0x37')){var _0x406627={};_0x406627[_0x4b21a2['name']]={'$like':'%'+_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x34')]+'%'};return _0x406627;}})});}_0x3ef390=_[_0xcaf6('0x36')]({},_0x3ef390,_0x11fef7['options']);var _0x11faa7={'where':_0x3ef390[_0xcaf6('0x35')]};return db[_0xcaf6('0x38')][_0xcaf6('0x16')](_0x11faa7)['then'](function(_0x42cc1d){_0x1e0072[_0xcaf6('0x16')]=_0x42cc1d;if(_0x11fef7[_0xcaf6('0x2b')]['includeAll']){_0x3ef390[_0xcaf6('0x39')]=[{'all':!![]}];}return db[_0xcaf6('0x38')][_0xcaf6('0x3a')](_0x3ef390);})[_0xcaf6('0x1e')](function(_0x450119){_0x1e0072[_0xcaf6('0x3b')]=_0x450119;return _0x1e0072;})['then'](respondWithFilteredResult(_0x5b04a5,_0x3ef390))[_0xcaf6('0x3c')](handleError(_0x5b04a5,null));};exports[_0xcaf6('0x3d')]=function(_0x24dcb5,_0x827630){var _0x202946={'raw':![],'where':{'id':_0x24dcb5[_0xcaf6('0x3e')]['id']}},_0x430925={};_0x430925[_0xcaf6('0x2a')]=_['keys'](db[_0xcaf6('0x38')][_0xcaf6('0x27')]);_0x430925[_0xcaf6('0x2b')]=_[_0xcaf6('0x3f')](_0x24dcb5[_0xcaf6('0x2b')]);_0x430925[_0xcaf6('0x2c')]=_[_0xcaf6('0x2d')](_0x430925[_0xcaf6('0x2a')],_0x430925[_0xcaf6('0x2b')]);_0x202946[_0xcaf6('0x2f')]=_[_0xcaf6('0x2d')](_0x430925[_0xcaf6('0x2a')],qs[_0xcaf6('0x2e')](_0x24dcb5[_0xcaf6('0x2b')][_0xcaf6('0x2e')]));_0x202946['attributes']=_0x202946[_0xcaf6('0x2f')][_0xcaf6('0x30')]?_0x202946[_0xcaf6('0x2f')]:_0x430925[_0xcaf6('0x2a')];if(_0x24dcb5[_0xcaf6('0x2b')][_0xcaf6('0x40')]){_0x202946['include']=[{'all':!![]}];}_0x202946=_['merge']({},_0x202946,_0x24dcb5[_0xcaf6('0x41')]);return db[_0xcaf6('0x38')]['find'](_0x202946)[_0xcaf6('0x1e')](handleEntityNotFound(_0x827630,null))[_0xcaf6('0x1e')](respondWithResult(_0x827630,null))[_0xcaf6('0x3c')](handleError(_0x827630,null));};exports[_0xcaf6('0x42')]=function(_0xa7459a,_0x3c373d){return db[_0xcaf6('0x38')][_0xcaf6('0x42')](_0xa7459a[_0xcaf6('0x43')],{})[_0xcaf6('0x1e')](function(_0x16cac2){var _0x35e432=_0xa7459a[_0xcaf6('0x44')][_0xcaf6('0x45')]({'plain':!![]});if(!_0x35e432)throw new Error(_0xcaf6('0x46'));if(_0x35e432['role']===_0xcaf6('0x44')){var _0x38d4d4=_0x16cac2[_0xcaf6('0x45')]({'plain':!![]});var _0x1f679a='Reports';return db[_0xcaf6('0x47')][_0xcaf6('0x48')]({'where':{'name':_0x1f679a,'userProfileId':_0x35e432[_0xcaf6('0x49')]},'raw':!![]})[_0xcaf6('0x1e')](function(_0x169a55){if(_0x169a55&&_0x169a55[_0xcaf6('0x4a')]===0x0){return db['UserProfileResource'][_0xcaf6('0x42')]({'name':_0x38d4d4['name'],'resourceId':_0x38d4d4['id'],'type':_0xcaf6('0x20'),'sectionId':_0x169a55['id']},{})[_0xcaf6('0x1e')](function(){return _0x16cac2;});}else{return _0x16cac2;}})[_0xcaf6('0x3c')](function(_0x3ce2a2){logger[_0xcaf6('0x23')](_0xcaf6('0x4b'),_0x3ce2a2);throw _0x3ce2a2;});}return _0x16cac2;})[_0xcaf6('0x1e')](respondWithResult(_0x3c373d,0xc9))[_0xcaf6('0x3c')](handleError(_0x3c373d,null));};exports[_0xcaf6('0x1d')]=function(_0x578f18,_0x4c4ebb){if(_0x578f18[_0xcaf6('0x43')]['id']){delete _0x578f18[_0xcaf6('0x43')]['id'];}return db[_0xcaf6('0x38')][_0xcaf6('0x48')]({'where':{'id':_0x578f18[_0xcaf6('0x3e')]['id']}})[_0xcaf6('0x1e')](handleEntityNotFound(_0x4c4ebb,null))[_0xcaf6('0x1e')](saveUpdates(_0x578f18['body'],null))[_0xcaf6('0x1e')](respondWithResult(_0x4c4ebb,null))['catch'](handleError(_0x4c4ebb,null));};exports[_0xcaf6('0x1f')]=function(_0xfa5fc0,_0x325f11){return db[_0xcaf6('0x38')]['find']({'where':{'id':_0xfa5fc0[_0xcaf6('0x3e')]['id']}})[_0xcaf6('0x1e')](handleEntityNotFound(_0x325f11,null))['then'](removeEntity(_0x325f11,null))[_0xcaf6('0x3c')](handleError(_0x325f11,null));};exports['preview']=function(_0x4d1bdc,_0x491a35){var _0x6e2292=0xa;var _0x599d89=['join',_0xcaf6('0x4c'),_0xcaf6('0x4d'),_0xcaf6('0x4e')];var _0x4ef50a={'SUM':_0xcaf6('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcaf6('0x50'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcaf6('0x51'),'GROUP_CONCAT':_0xcaf6('0x52'),'GROUP_CONCAT ASC':_0xcaf6('0x53'),'GROUP_CONCAT DESC':_0xcaf6('0x54')};var _0x5d5acf={'SEC_TO_TIME':_0xcaf6('0x55'),'DATE':_0xcaf6('0x56'),'HOUR':'HOUR(%s)','ROUND':_0xcaf6('0x57'),'UNIX_TIMESTAMP':_0xcaf6('0x58')};var _0x2d0626=function(_0x561821){return!_[_0xcaf6('0x59')]([_0xcaf6('0x5a'),'IS\x20NOT\x20NULL',_0xcaf6('0x5b'),_0xcaf6('0x5c')],_0x561821);};var _0x5eb912=function(_0x6af028){if(!_0x6af028||!_0x6af028[_0xcaf6('0x5d')][_0xcaf6('0x30')]){return'';}for(var _0x126360='(',_0x3ce604=0x0;_0x3ce604<_0x6af028['rules']['length'];_0x3ce604+=0x1){_0x3ce604>0x0&&(_0x126360+='\x20'+_0x6af028['operator']+'\x20');_0x126360+=_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x5e')]?_0x5eb912(_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x5e')]):_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x5f')]+'\x20'+_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x60')]+(_0x2d0626(_0x6af028[_0xcaf6('0x5d')][_0x3ce604]['condition'])?'\x20'+_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x61')]:'');}return _0x126360+')';};var _0x202994={'where':{'id':_0x4d1bdc[_0xcaf6('0x3e')]['id']}},_0x1aa619,_0x2261fd,_0x3f67b8,_0xf40b1e,_0x4e541c;_0x202994=_[_0xcaf6('0x36')]({},_0x202994,_0x4d1bdc[_0xcaf6('0x41')]);return db[_0xcaf6('0x38')][_0xcaf6('0x48')](_0x202994)['then'](function(_0x4cffe0){if(_0x4cffe0){_0x1aa619=_0x4cffe0;return _0x4cffe0[_0xcaf6('0x62')]();}return null;})['then'](function(_0x42fd23){if(_0x42fd23){if(!_0x42fd23[_0xcaf6('0x30')]){throw new db[(_0xcaf6('0x63'))][(_0xcaf6('0x64'))](_0xcaf6('0x65'),0x193);}_0x2261fd=_0x42fd23;return db[_0xcaf6('0x66')][_0xcaf6('0x3a')]({'raw':!![]});}return null;})[_0xcaf6('0x1e')](function(_0x56bda0){if(_0x56bda0){_0x3f67b8=_[_0xcaf6('0x67')](_0x56bda0,'id');var _0x23594c;var _0x579f09=squel[_0xcaf6('0x68')]();_0x579f09['from'](_0x1aa619[_0xcaf6('0x69')]);for(var _0xad2b9a=0x0;_0xad2b9a<_0x2261fd[_0xcaf6('0x30')];_0xad2b9a+=0x1){_0x23594c=_0x2261fd[_0xad2b9a][_0xcaf6('0x6a')]?_0x3f67b8[_0x2261fd[_0xad2b9a][_0xcaf6('0x6a')]][_0xcaf6('0x6b')]:_0x2261fd[_0xad2b9a][_0xcaf6('0x5f')];_0x23594c=_0x2261fd[_0xad2b9a][_0xcaf6('0x6c')]?_['replace'](_0x4ef50a[_0x2261fd[_0xad2b9a][_0xcaf6('0x6c')]],'%s',_0x23594c):_0x23594c;_0x23594c=_0x2261fd[_0xad2b9a][_0xcaf6('0x6d')]?_[_0xcaf6('0x6e')](_0x5d5acf[_0x2261fd[_0xad2b9a][_0xcaf6('0x6d')]],'%s',_0x23594c):_0x23594c;if(_0x2261fd[_0xad2b9a][_0xcaf6('0x6f')]){_0x579f09['group'](_0x23594c);}_0x2261fd[_0xad2b9a]['orderBy']&&_0x579f09[_0xcaf6('0x70')](_0x23594c,_0x2261fd[_0xad2b9a][_0xcaf6('0x71')]===_0xcaf6('0x72')?![]:!![]);_0x579f09[_0xcaf6('0x5f')](_0x23594c,_0x2261fd[_0xad2b9a][_0xcaf6('0x73')]||_0x23594c);}if(_0x1aa619[_0xcaf6('0x74')]){_0x1aa619[_0xcaf6('0x74')]=JSON[_0xcaf6('0x75')](_0x1aa619[_0xcaf6('0x74')]);for(var _0x29c0b8=0x0;_0x29c0b8<_0x1aa619[_0xcaf6('0x74')][_0xcaf6('0x30')];_0x29c0b8+=0x1){if(_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x28')]&&_['includes'](_0x599d89,_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x28')])&&_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x76')]&&_0x1aa619['joins'][_0x29c0b8]['foreignTable']&&_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x77')]){_0x579f09[_0x1aa619[_0xcaf6('0x74')][_0x29c0b8]['type']](_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x78')],null,util[_0xcaf6('0x6d')](_0xcaf6('0x79'),_0x1aa619[_0xcaf6('0x69')],_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x76')],_0x1aa619[_0xcaf6('0x74')][_0x29c0b8]['foreignTable'],_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x77')]));}}}if(_0x1aa619[_0xcaf6('0x7a')]){_0x1aa619['conditions']=JSON[_0xcaf6('0x75')](_0x1aa619[_0xcaf6('0x7a')]);_0x579f09['where'](_0x5eb912(_0x1aa619[_0xcaf6('0x7a')]['group']));}_0x4e541c=_0x579f09[_0xcaf6('0x7b')]();_0x579f09[_0xcaf6('0x18')](_0x6e2292);_0x579f09[_0xcaf6('0x17')](0x0);logger[_0xcaf6('0x7c')](_0xcaf6('0x7d'),_0x579f09['toString']());return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x579f09[_0xcaf6('0x7f')](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')][_0xcaf6('0x81')]});}})['then'](respondWithResult(_0x491a35,null))[_0xcaf6('0x3c')](handleError(_0x491a35,null));};function runReport(_0x4b4cfb,_0x1aa646,_0x469533){var _0x61c944=_0x1aa646[_0xcaf6('0x25')];var _0x269f0e=0xa;var _0x4c1725=[_0xcaf6('0x82'),_0xcaf6('0x4c'),'right_join',_0xcaf6('0x4e')];var _0x5c9d87={'SUM':_0xcaf6('0x4f'),'COUNT':_0xcaf6('0x83'),'COUNT DISTINCT':_0xcaf6('0x50'),'MAX':_0xcaf6('0x84'),'MIN':_0xcaf6('0x85'),'AVG':_0xcaf6('0x51'),'GROUP_CONCAT':_0xcaf6('0x52'),'GROUP_CONCAT ASC':_0xcaf6('0x53'),'GROUP_CONCAT DESC':_0xcaf6('0x54')};var _0x2fe5a7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcaf6('0x56'),'HOUR':_0xcaf6('0x86'),'ROUND':_0xcaf6('0x57'),'UNIX_TIMESTAMP':_0xcaf6('0x58')};var _0x1c2c4c=function(_0x397df3){return!_[_0xcaf6('0x59')](['IS\x20NULL',_0xcaf6('0x87'),'IS\x20EMPTY',_0xcaf6('0x5c')],_0x397df3);};var _0x2f89ea=function(_0x1e9f46){if(!_0x1e9f46||!_0x1e9f46[_0xcaf6('0x5d')][_0xcaf6('0x30')]){return'';}for(var _0x1e53cc='(',_0x5ecda5=0x0;_0x5ecda5<_0x1e9f46[_0xcaf6('0x5d')]['length'];_0x5ecda5+=0x1){_0x5ecda5>0x0&&(_0x1e53cc+='\x20'+_0x1e9f46['operator']+'\x20');_0x1e53cc+=_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5]['group']?_0x2f89ea(_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x5e')]):_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x5f')]+'\x20'+_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x60')]+(_0x1c2c4c(_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x60')])?'\x20'+_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5]['value']:'');}return _0x1e53cc+')';};var _0xcfc56c={'where':{'id':_0x4b4cfb['id']}},_0x3c21da,_0x566831,_0x4db7c0,_0x5171d1,_0x71cc9c;_0xcfc56c=_[_0xcaf6('0x36')]({},_0xcfc56c,_0x469533);return db[_0xcaf6('0x38')][_0xcaf6('0x48')](_0xcfc56c)[_0xcaf6('0x1e')](function(_0x24f12c){if(_0x24f12c){_0x3c21da=_0x24f12c;return _0x24f12c[_0xcaf6('0x62')]();}return null;})['then'](function(_0x2c4ec2){if(_0x2c4ec2){if(!_0x2c4ec2['length']){throw new db[(_0xcaf6('0x63'))]['ValidationErrorItem'](_0xcaf6('0x65'),0x193);}_0x566831=_0x2c4ec2;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xcaf6('0x1e')](function(_0x2816c9){if(_0x2816c9){_0x4db7c0=_[_0xcaf6('0x67')](_0x2816c9,'id');var _0x24bad0;var _0x1d7694=squel[_0xcaf6('0x68')]();_0x1d7694[_0xcaf6('0x88')](_0x3c21da[_0xcaf6('0x69')]);for(var _0x328843=0x0;_0x328843<_0x566831[_0xcaf6('0x30')];_0x328843+=0x1){_0x24bad0=_0x566831[_0x328843]['MetricId']?_0x4db7c0[_0x566831[_0x328843][_0xcaf6('0x6a')]][_0xcaf6('0x6b')]:_0x566831[_0x328843][_0xcaf6('0x5f')];_0x24bad0=_0x566831[_0x328843][_0xcaf6('0x6c')]?_['replace'](_0x5c9d87[_0x566831[_0x328843][_0xcaf6('0x6c')]],'%s',_0x24bad0):_0x24bad0;_0x24bad0=_0x566831[_0x328843][_0xcaf6('0x6d')]?_[_0xcaf6('0x6e')](_0x2fe5a7[_0x566831[_0x328843][_0xcaf6('0x6d')]],'%s',_0x24bad0):_0x24bad0;if(_0x566831[_0x328843][_0xcaf6('0x6f')]){_0x1d7694['group'](_0x24bad0);}_0x566831[_0x328843]['orderBy']&&_0x1d7694[_0xcaf6('0x70')](_0x24bad0,_0x566831[_0x328843]['orderBy']===_0xcaf6('0x72')?![]:!![]);_0x1d7694[_0xcaf6('0x5f')](_0x24bad0,_0x566831[_0x328843][_0xcaf6('0x73')]||_0x24bad0);}if(_0x3c21da[_0xcaf6('0x74')]){_0x3c21da[_0xcaf6('0x74')]=JSON[_0xcaf6('0x75')](_0x3c21da[_0xcaf6('0x74')]);for(var _0x654e2d=0x0;_0x654e2d<_0x3c21da[_0xcaf6('0x74')][_0xcaf6('0x30')];_0x654e2d+=0x1){if(_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x28')]&&_['includes'](_0x4c1725,_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x28')])&&_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x76')]&&_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x78')]&&_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x77')]){_0x1d7694[_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x28')]](_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x78')],null,util[_0xcaf6('0x6d')](_0xcaf6('0x79'),_0x3c21da['table'],_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x76')],_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x78')],_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x77')]));}}}if(_0x3c21da[_0xcaf6('0x7a')]){_0x3c21da[_0xcaf6('0x7a')]=JSON[_0xcaf6('0x75')](_0x3c21da['conditions']);_0x1d7694['where'](_0x2f89ea(_0x3c21da[_0xcaf6('0x7a')]['group']));}_0x71cc9c=_0x1d7694[_0xcaf6('0x7b')]();_0x1d7694['limit'](_0x269f0e);_0x1d7694[_0xcaf6('0x17')](0x0);logger[_0xcaf6('0x7c')](_0xcaf6('0x7d'),_0x1d7694['toString']());return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x1d7694[_0xcaf6('0x7f')](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')]['SELECT']});}})[_0xcaf6('0x1e')](function(_0x469109){if(!_0x469109['length']){throw new db['Sequelize'][(_0xcaf6('0x64'))](_0xcaf6('0x89'),0xcc);}if(_0x1aa646[_0xcaf6('0x8a')]===_0xcaf6('0x8b')){return null;}var _0x62e848=_[_0xcaf6('0x36')](_0x1aa646,{'name':_0x1aa646[_0xcaf6('0x8c')]||_0x1aa646[_0xcaf6('0x25')]||_0x3c21da[_0xcaf6('0x25')],'basename':_0x61c944,'savename':util[_0xcaf6('0x6d')](_0xcaf6('0x8d'),_0x1aa646[_0xcaf6('0x25')]||_0x3c21da[_0xcaf6('0x25')],require('randomstring')['generate'](0x4),_0x1aa646[_0xcaf6('0x8a')]||_0xcaf6('0x8e')),'reportId':_0x3c21da['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xcaf6('0x42')](_0x62e848,{'raw':!![]});})[_0xcaf6('0x1e')](function(_0x32fcc8){if(_0x3c21da[_0xcaf6('0x69')]===_0xcaf6('0x8f')){_0x71cc9c[_0xcaf6('0x35')](_0x3c21da[_0xcaf6('0x69')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1aa646[_0xcaf6('0x90')],_0x1aa646[_0xcaf6('0x91')]);}else{_0x71cc9c['where'](_0x3c21da[_0xcaf6('0x69')]+_0xcaf6('0x92'),_0x1aa646['startDate'],_0x1aa646['endDate']);}if(_0x32fcc8){logger[_0xcaf6('0x93')]('Run\x20Query:',_0x71cc9c[_0xcaf6('0x7f')]());require(_0xcaf6('0x94'))[_0xcaf6('0x95')](path['join'](__dirname,_0xcaf6('0x96'),_0x32fcc8[_0xcaf6('0x8a')]),[_0x32fcc8['id'],_0x71cc9c[_0xcaf6('0x7f')](),path[_0xcaf6('0x82')](__dirname,_0xcaf6('0x97'),_0x32fcc8[_0xcaf6('0x98')]),_0x61c944]);return _0x32fcc8;}else{var _0x3043e4=squel[_0xcaf6('0x68')]();_0x3043e4['from']('('+_0x71cc9c['toString']()+')','countTable');_0x3043e4[_0xcaf6('0x5f')](_0xcaf6('0x99'),_0xcaf6('0x16'));_0x71cc9c['limit'](_0x1aa646[_0xcaf6('0x18')]||_0x269f0e);_0x71cc9c[_0xcaf6('0x17')](_0x1aa646['offset']||0x0);return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x3043e4[_0xcaf6('0x7f')](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')][_0xcaf6('0x81')]})[_0xcaf6('0x1e')](function(_0x173c78){if(!_0x173c78[_0xcaf6('0x30')]){_0x5171d1=0x0;}else{_0x5171d1=_0x173c78[0x0][_0xcaf6('0x16')]||0x0;}return db['sequelize']['query'](_0x71cc9c['toString'](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')]['SELECT']});})[_0xcaf6('0x1e')](function(_0x3f594e){return{'rows':_0x3f594e||[],'count':_0x5171d1};});}});}exports[_0xcaf6('0x9a')]=function(_0x3f111f,_0x402049){return runReport(_0x3f111f[_0xcaf6('0x3e')],_0x3f111f[_0xcaf6('0x2b')],_0x3f111f[_0xcaf6('0x41')])[_0xcaf6('0x1e')](respondWithResult(_0x402049,null))[_0xcaf6('0x3c')](handleError(_0x402049,null));};exports[_0xcaf6('0x9b')]=runReport;exports[_0xcaf6('0x2b')]=function(_0x1a4d8d,_0x541b95){var _0x38918d=0xa;var _0x1fc822=[_0xcaf6('0x82'),_0xcaf6('0x4c'),'right_join',_0xcaf6('0x4e')];var _0x47e0f7={'SUM':'SUM(%s)','COUNT':_0xcaf6('0x83'),'COUNT DISTINCT':_0xcaf6('0x50'),'MAX':_0xcaf6('0x84'),'MIN':'MIN(%s)','AVG':_0xcaf6('0x51'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcaf6('0x54')};var _0x485f75={'SEC_TO_TIME':_0xcaf6('0x55'),'DATE':_0xcaf6('0x56'),'HOUR':_0xcaf6('0x86'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2adc6f=function(_0x4dc7aa){return!_['includes'](['IS\x20NULL',_0xcaf6('0x87'),_0xcaf6('0x5b'),_0xcaf6('0x5c')],_0x4dc7aa);};var _0x4e4f73=function(_0xc0628f){if(!_0xc0628f||!_0xc0628f[_0xcaf6('0x5d')][_0xcaf6('0x30')]){return'';}for(var _0x7f73f2='(',_0x187635=0x0;_0x187635<_0xc0628f[_0xcaf6('0x5d')][_0xcaf6('0x30')];_0x187635+=0x1){_0x187635>0x0&&(_0x7f73f2+='\x20'+_0xc0628f['operator']+'\x20');_0x7f73f2+=_0xc0628f[_0xcaf6('0x5d')][_0x187635][_0xcaf6('0x5e')]?_0x4e4f73(_0xc0628f[_0xcaf6('0x5d')][_0x187635]['group']):_0xc0628f['rules'][_0x187635][_0xcaf6('0x5f')]+'\x20'+_0xc0628f[_0xcaf6('0x5d')][_0x187635][_0xcaf6('0x60')]+(_0x2adc6f(_0xc0628f['rules'][_0x187635][_0xcaf6('0x60')])?'\x20'+_0xc0628f[_0xcaf6('0x5d')][_0x187635][_0xcaf6('0x61')]:'');}return _0x7f73f2+')';};var _0x3d4da7={'where':{'id':_0x1a4d8d[_0xcaf6('0x3e')]['id']}},_0x101fb2,_0x4a7777,_0x3ec370,_0x39b108,_0x1415dc;_0x3d4da7=_[_0xcaf6('0x36')]({},_0x3d4da7,_0x1a4d8d[_0xcaf6('0x41')]);return db[_0xcaf6('0x38')][_0xcaf6('0x48')](_0x3d4da7)[_0xcaf6('0x1e')](function(_0x51fd64){if(_0x51fd64){_0x101fb2=_0x51fd64;return _0x51fd64[_0xcaf6('0x62')]();}return null;})[_0xcaf6('0x1e')](function(_0x5954ff){if(_0x5954ff){if(!_0x5954ff[_0xcaf6('0x30')]){throw new db['Sequelize'][(_0xcaf6('0x64'))](_0xcaf6('0x65'),0x193);}_0x4a7777=_0x5954ff;return db[_0xcaf6('0x66')][_0xcaf6('0x3a')]({'raw':!![]});}return null;})[_0xcaf6('0x1e')](function(_0x109ac5){if(_0x109ac5){_0x3ec370=_[_0xcaf6('0x67')](_0x109ac5,'id');var _0x89847d;var _0x346a31=squel['select']();_0x346a31['from'](_0x101fb2[_0xcaf6('0x69')]);for(var _0xb8470d=0x0;_0xb8470d<_0x4a7777[_0xcaf6('0x30')];_0xb8470d+=0x1){_0x89847d=_0x4a7777[_0xb8470d][_0xcaf6('0x6a')]?_0x3ec370[_0x4a7777[_0xb8470d][_0xcaf6('0x6a')]][_0xcaf6('0x6b')]:_0x4a7777[_0xb8470d][_0xcaf6('0x5f')];_0x89847d=_0x4a7777[_0xb8470d][_0xcaf6('0x6c')]?_['replace'](_0x47e0f7[_0x4a7777[_0xb8470d][_0xcaf6('0x6c')]],'%s',_0x89847d):_0x89847d;_0x89847d=_0x4a7777[_0xb8470d][_0xcaf6('0x6d')]?_[_0xcaf6('0x6e')](_0x485f75[_0x4a7777[_0xb8470d][_0xcaf6('0x6d')]],'%s',_0x89847d):_0x89847d;if(_0x4a7777[_0xb8470d][_0xcaf6('0x6f')]){_0x346a31[_0xcaf6('0x5e')](_0x89847d);}_0x4a7777[_0xb8470d]['orderBy']&&_0x346a31[_0xcaf6('0x70')](_0x89847d,_0x4a7777[_0xb8470d][_0xcaf6('0x71')]==='DESC'?![]:!![]);_0x346a31[_0xcaf6('0x5f')](_0x89847d,_0x4a7777[_0xb8470d][_0xcaf6('0x73')]||_0x89847d);}if(_0x101fb2[_0xcaf6('0x74')]){_0x101fb2['joins']=JSON[_0xcaf6('0x75')](_0x101fb2['joins']);for(var _0x26c5bf=0x0;_0x26c5bf<_0x101fb2[_0xcaf6('0x74')]['length'];_0x26c5bf+=0x1){if(_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x28')]&&_['includes'](_0x1fc822,_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x28')])&&_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x76')]&&_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x78')]&&_0x101fb2['joins'][_0x26c5bf]['foreignKey']){_0x346a31[_0x101fb2['joins'][_0x26c5bf][_0xcaf6('0x28')]](_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x101fb2[_0xcaf6('0x69')],_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x76')],_0x101fb2['joins'][_0x26c5bf][_0xcaf6('0x78')],_0x101fb2['joins'][_0x26c5bf]['foreignKey']));}}}if(_0x101fb2['conditions']){_0x101fb2[_0xcaf6('0x7a')]=JSON[_0xcaf6('0x75')](_0x101fb2[_0xcaf6('0x7a')]);_0x346a31[_0xcaf6('0x35')](_0x4e4f73(_0x101fb2[_0xcaf6('0x7a')][_0xcaf6('0x5e')]));}_0x1415dc=_0x346a31[_0xcaf6('0x7b')]();_0x346a31[_0xcaf6('0x18')](_0x38918d);_0x346a31[_0xcaf6('0x17')](0x0);logger[_0xcaf6('0x7c')](_0xcaf6('0x7d'),_0x346a31[_0xcaf6('0x7f')]());return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x346a31['toString'](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')][_0xcaf6('0x81')]});}})[_0xcaf6('0x1e')](function(){return{'sql':_0x1415dc[_0xcaf6('0x7f')]()};})[_0xcaf6('0x1e')](respondWithResult(_0x541b95,null))[_0xcaf6('0x3c')](handleError(_0x541b95,null));}; \ No newline at end of file +var _0xc8ed=['get','then','end','stack','name','send','index','map','AnalyticCustomReport','type','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','keys','length','include','find','catch','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','table','conditions','debug','toString','join','left_join','SUM(%s)','COUNT(%s)','DATE(%s)','IS\x20NULL','getFields','function','%s.%s\x20=\x20%s.%s','sequelize','QueryTypes','SELECT','fullPath','%s-%s.%s','randomstring','output','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','runReport','right_join','UNIX_TIMESTAMP(%s)','value','clone','Limited\x20Query:','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy'];(function(_0x37796d,_0xb401f4){var _0x9a110d=function(_0x2c00b1){while(--_0x2c00b1){_0x37796d['push'](_0x37796d['shift']());}};_0x9a110d(++_0xb401f4);}(_0xc8ed,0x1c4));var _0xdc8e=function(_0x14f8d8,_0x4ef9fc){_0x14f8d8=_0x14f8d8-0x0;var _0x3477d5=_0xc8ed[_0x14f8d8];return _0x3477d5;};'use strict';var pdf=require(_0xdc8e('0x0'));var emlformat=require(_0xdc8e('0x1'));var rimraf=require(_0xdc8e('0x2'));var zipdir=require(_0xdc8e('0x3'));var jsonpatch=require(_0xdc8e('0x4'));var rp=require(_0xdc8e('0x5'));var moment=require('moment');var BPromise=require(_0xdc8e('0x6'));var Mustache=require(_0xdc8e('0x7'));var util=require('util');var path=require(_0xdc8e('0x8'));var sox=require(_0xdc8e('0x9'));var csv=require('to-csv');var ejs=require(_0xdc8e('0xa'));var fs=require('fs');var _=require(_0xdc8e('0xb'));var squel=require(_0xdc8e('0xc'));var crypto=require(_0xdc8e('0xd'));var jsforce=require(_0xdc8e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdc8e('0xf'));var querystring=require('querystring');var Papa=require(_0xdc8e('0x10'));var Redis=require(_0xdc8e('0x11'));var authService=require(_0xdc8e('0x12'));var qs=require(_0xdc8e('0x13'));var as=require(_0xdc8e('0x14'));var hardwareService=require(_0xdc8e('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xdc8e('0x16'));var db=require(_0xdc8e('0x17'))['db'];function respondWithStatusCode(_0x35e3b9,_0x457d8d){_0x457d8d=_0x457d8d||0xcc;return function(_0x2cd331){if(_0x2cd331){return _0x35e3b9[_0xdc8e('0x18')](_0x457d8d);}return _0x35e3b9[_0xdc8e('0x19')](_0x457d8d)['end']();};}function respondWithResult(_0x3e1d1e,_0x21511b){_0x21511b=_0x21511b||0xc8;return function(_0x36fcd5){if(_0x36fcd5){return _0x3e1d1e[_0xdc8e('0x19')](_0x21511b)[_0xdc8e('0x1a')](_0x36fcd5);}};}function respondWithFilteredResult(_0x238a35,_0x31f839){return function(_0x26983a){if(_0x26983a){var _0x552c01=_0x26983a[_0xdc8e('0x1b')],_0x3bf8fe=_0x31f839[_0xdc8e('0x1c')],_0x572be8=_0x31f839[_0xdc8e('0x1c')]+_0x31f839[_0xdc8e('0x1d')],_0x1eeec4;if(_0x572be8>=_0x552c01){_0x572be8=_0x552c01;_0x1eeec4=0xc8;}else{_0x1eeec4=0xce;}_0x238a35[_0xdc8e('0x19')](_0x1eeec4);return _0x238a35[_0xdc8e('0x1e')](_0xdc8e('0x1f'),_0x3bf8fe+'-'+_0x572be8+'/'+_0x552c01)[_0xdc8e('0x1a')](_0x26983a);}return null;};}function patchUpdates(_0x5b0984){return function(_0x2f601d){try{jsonpatch[_0xdc8e('0x20')](_0x2f601d,_0x5b0984,!![]);}catch(_0x4b27de){return BPromise[_0xdc8e('0x21')](_0x4b27de);}return _0x2f601d[_0xdc8e('0x22')]();};}function saveUpdates(_0x3b5563,_0x4537ba){return function(_0x13bce4){if(_0x13bce4){return _0x13bce4[_0xdc8e('0x23')](_0x3b5563)['then'](function(_0x3e3ea0){return _0x3e3ea0;});}return null;};}function removeEntity(_0x384dbf,_0x4af85c){return function(_0x1da3c4){if(_0x1da3c4){return _0x1da3c4[_0xdc8e('0x24')]()['then'](function(){var _0x3f585a=_0x1da3c4[_0xdc8e('0x25')]({'plain':!![]});var _0x2b6521='CustomReports';return db['UserProfileResource'][_0xdc8e('0x24')]({'where':{'type':_0x2b6521,'resourceId':_0x3f585a['id']}})['then'](function(){return _0x1da3c4;});})[_0xdc8e('0x26')](function(){_0x384dbf[_0xdc8e('0x19')](0xcc)[_0xdc8e('0x27')]();});}};}function handleEntityNotFound(_0x17c7d9,_0x370b94){return function(_0x45334f){if(!_0x45334f){_0x17c7d9['sendStatus'](0x194);}return _0x45334f;};}function handleError(_0x2aa547,_0x431cd5){_0x431cd5=_0x431cd5||0x1f4;return function(_0x515ef3){logger['error'](_0x515ef3[_0xdc8e('0x28')]);if(_0x515ef3[_0xdc8e('0x29')]){delete _0x515ef3[_0xdc8e('0x29')];}_0x2aa547['status'](_0x431cd5)[_0xdc8e('0x2a')](_0x515ef3);};}exports[_0xdc8e('0x2b')]=function(_0x1d31fb,_0x524d4d){var _0x5da683={},_0x14f5e1={},_0x1b9e1b={'count':0x0,'rows':[]};var _0x3c4e1a=_[_0xdc8e('0x2c')](db[_0xdc8e('0x2d')]['rawAttributes'],function(_0xa1e01c){return{'name':_0xa1e01c['fieldName'],'type':_0xa1e01c[_0xdc8e('0x2e')]['key']};});_0x14f5e1[_0xdc8e('0x2f')]=_[_0xdc8e('0x2c')](_0x3c4e1a,_0xdc8e('0x29'));_0x14f5e1['query']=_['keys'](_0x1d31fb[_0xdc8e('0x30')]);_0x14f5e1['filters']=_[_0xdc8e('0x31')](_0x14f5e1['model'],_0x14f5e1[_0xdc8e('0x30')]);_0x5da683[_0xdc8e('0x32')]=_['intersection'](_0x14f5e1[_0xdc8e('0x2f')],qs[_0xdc8e('0x33')](_0x1d31fb[_0xdc8e('0x30')][_0xdc8e('0x33')]));_0x5da683[_0xdc8e('0x32')]=_0x5da683[_0xdc8e('0x32')]['length']?_0x5da683['attributes']:_0x14f5e1[_0xdc8e('0x2f')];if(!_0x1d31fb['query']['hasOwnProperty'](_0xdc8e('0x34'))){_0x5da683['limit']=qs['limit'](_0x1d31fb[_0xdc8e('0x30')][_0xdc8e('0x1d')]);_0x5da683['offset']=qs[_0xdc8e('0x1c')](_0x1d31fb['query']['offset']);}_0x5da683[_0xdc8e('0x35')]=qs[_0xdc8e('0x36')](_0x1d31fb['query'][_0xdc8e('0x36')]);_0x5da683[_0xdc8e('0x37')]=qs[_0xdc8e('0x38')](_[_0xdc8e('0x39')](_0x1d31fb[_0xdc8e('0x30')],_0x14f5e1[_0xdc8e('0x38')]));if(_0x1d31fb[_0xdc8e('0x30')]['filter']){_0x5da683[_0xdc8e('0x37')]=_[_0xdc8e('0x3a')](_0x5da683['where'],{'$or':_[_0xdc8e('0x2c')](_0x3c4e1a,function(_0x5c5096){if(_0x5c5096[_0xdc8e('0x2e')]!==_0xdc8e('0x3b')){var _0x10a584={};_0x10a584[_0x5c5096[_0xdc8e('0x29')]]={'$like':'%'+_0x1d31fb['query']['filter']+'%'};return _0x10a584;}})});}_0x5da683=_[_0xdc8e('0x3a')]({},_0x5da683,_0x1d31fb[_0xdc8e('0x3c')]);var _0x34ccdb={'where':_0x5da683['where']};return db[_0xdc8e('0x2d')]['count'](_0x34ccdb)['then'](function(_0x195102){_0x1b9e1b[_0xdc8e('0x1b')]=_0x195102;if(_0x1d31fb['query'][_0xdc8e('0x3d')]){_0x5da683['include']=[{'all':!![]}];}return db[_0xdc8e('0x2d')]['findAll'](_0x5da683);})['then'](function(_0x530c45){_0x1b9e1b[_0xdc8e('0x3e')]=_0x530c45;return _0x1b9e1b;})['then'](respondWithFilteredResult(_0x524d4d,_0x5da683))['catch'](handleError(_0x524d4d,null));};exports[_0xdc8e('0x3f')]=function(_0x4010d5,_0x124725){var _0x15f11c={'raw':![],'where':{'id':_0x4010d5[_0xdc8e('0x40')]['id']}},_0x1fab75={};_0x1fab75['model']=_['keys'](db[_0xdc8e('0x2d')][_0xdc8e('0x41')]);_0x1fab75[_0xdc8e('0x30')]=_[_0xdc8e('0x42')](_0x4010d5[_0xdc8e('0x30')]);_0x1fab75['filters']=_[_0xdc8e('0x31')](_0x1fab75['model'],_0x1fab75[_0xdc8e('0x30')]);_0x15f11c[_0xdc8e('0x32')]=_[_0xdc8e('0x31')](_0x1fab75[_0xdc8e('0x2f')],qs[_0xdc8e('0x33')](_0x4010d5[_0xdc8e('0x30')]['fields']));_0x15f11c['attributes']=_0x15f11c[_0xdc8e('0x32')][_0xdc8e('0x43')]?_0x15f11c[_0xdc8e('0x32')]:_0x1fab75[_0xdc8e('0x2f')];if(_0x4010d5[_0xdc8e('0x30')][_0xdc8e('0x3d')]){_0x15f11c[_0xdc8e('0x44')]=[{'all':!![]}];}_0x15f11c=_['merge']({},_0x15f11c,_0x4010d5['options']);return db[_0xdc8e('0x2d')][_0xdc8e('0x45')](_0x15f11c)[_0xdc8e('0x26')](handleEntityNotFound(_0x124725,null))[_0xdc8e('0x26')](respondWithResult(_0x124725,null))[_0xdc8e('0x46')](handleError(_0x124725,null));};exports['create']=function(_0x14c52a,_0x1f22ff){return db[_0xdc8e('0x2d')]['create'](_0x14c52a['body'],{})[_0xdc8e('0x26')](function(_0x2d5654){var _0x524f5b=_0x14c52a['user'][_0xdc8e('0x25')]({'plain':!![]});if(!_0x524f5b)throw new Error(_0xdc8e('0x47'));if(_0x524f5b[_0xdc8e('0x48')]===_0xdc8e('0x49')){var _0x5c44f0=_0x2d5654[_0xdc8e('0x25')]({'plain':!![]});var _0x50db3f='Reports';return db[_0xdc8e('0x4a')][_0xdc8e('0x45')]({'where':{'name':_0x50db3f,'userProfileId':_0x524f5b[_0xdc8e('0x4b')]},'raw':!![]})['then'](function(_0x2396c8){if(_0x2396c8&&_0x2396c8[_0xdc8e('0x4c')]===0x0){return db[_0xdc8e('0x4d')][_0xdc8e('0x4e')]({'name':_0x5c44f0['name'],'resourceId':_0x5c44f0['id'],'type':_0xdc8e('0x4f'),'sectionId':_0x2396c8['id']},{})[_0xdc8e('0x26')](function(){return _0x2d5654;});}else{return _0x2d5654;}})[_0xdc8e('0x46')](function(_0x492bb8){logger[_0xdc8e('0x50')](_0xdc8e('0x51'),_0x492bb8);throw _0x492bb8;});}return _0x2d5654;})[_0xdc8e('0x26')](respondWithResult(_0x1f22ff,0xc9))['catch'](handleError(_0x1f22ff,null));};exports[_0xdc8e('0x23')]=function(_0x351aee,_0x53e534){if(_0x351aee[_0xdc8e('0x52')]['id']){delete _0x351aee[_0xdc8e('0x52')]['id'];}return db[_0xdc8e('0x2d')][_0xdc8e('0x45')]({'where':{'id':_0x351aee[_0xdc8e('0x40')]['id']}})[_0xdc8e('0x26')](handleEntityNotFound(_0x53e534,null))['then'](saveUpdates(_0x351aee[_0xdc8e('0x52')],null))[_0xdc8e('0x26')](respondWithResult(_0x53e534,null))[_0xdc8e('0x46')](handleError(_0x53e534,null));};exports['destroy']=function(_0x4e29af,_0x365244){return db[_0xdc8e('0x2d')]['find']({'where':{'id':_0x4e29af[_0xdc8e('0x40')]['id']}})[_0xdc8e('0x26')](handleEntityNotFound(_0x365244,null))['then'](removeEntity(_0x365244,null))[_0xdc8e('0x46')](handleError(_0x365244,null));};exports['preview']=function(_0x1a9492,_0x5ae676){var _0x384530=0xa;var _0x10da50=['join','left_join','right_join',_0xdc8e('0x53')];var _0x66d4a4={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xdc8e('0x54'),'MAX':_0xdc8e('0x55'),'MIN':_0xdc8e('0x56'),'AVG':_0xdc8e('0x57'),'GROUP_CONCAT':_0xdc8e('0x58'),'GROUP_CONCAT ASC':_0xdc8e('0x59'),'GROUP_CONCAT DESC':_0xdc8e('0x5a')};var _0x1c3b4d={'SEC_TO_TIME':_0xdc8e('0x5b'),'DATE':'DATE(%s)','HOUR':_0xdc8e('0x5c'),'ROUND':_0xdc8e('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ccc8e=function(_0x206800){return!_[_0xdc8e('0x5e')](['IS\x20NULL',_0xdc8e('0x5f'),_0xdc8e('0x60'),_0xdc8e('0x61')],_0x206800);};var _0x423d50=function(_0x54166c){if(!_0x54166c||!_0x54166c[_0xdc8e('0x62')][_0xdc8e('0x43')]){return'';}for(var _0x55488c='(',_0x3a10ee=0x0;_0x3a10ee<_0x54166c[_0xdc8e('0x62')][_0xdc8e('0x43')];_0x3a10ee+=0x1){_0x3a10ee>0x0&&(_0x55488c+='\x20'+_0x54166c[_0xdc8e('0x63')]+'\x20');_0x55488c+=_0x54166c[_0xdc8e('0x62')][_0x3a10ee][_0xdc8e('0x64')]?_0x423d50(_0x54166c[_0xdc8e('0x62')][_0x3a10ee][_0xdc8e('0x64')]):_0x54166c['rules'][_0x3a10ee]['field']+'\x20'+_0x54166c['rules'][_0x3a10ee][_0xdc8e('0x65')]+(_0x2ccc8e(_0x54166c[_0xdc8e('0x62')][_0x3a10ee][_0xdc8e('0x65')])?'\x20'+_0x54166c[_0xdc8e('0x62')][_0x3a10ee]['value']:'');}return _0x55488c+')';};var _0x55f85f={'where':{'id':_0x1a9492[_0xdc8e('0x40')]['id']}},_0x16a13f,_0x133162,_0x2d889f,_0x9219a1,_0x400723;_0x55f85f=_[_0xdc8e('0x3a')]({},_0x55f85f,_0x1a9492[_0xdc8e('0x3c')]);return db[_0xdc8e('0x2d')][_0xdc8e('0x45')](_0x55f85f)[_0xdc8e('0x26')](function(_0x2743f5){if(_0x2743f5){_0x16a13f=_0x2743f5;return _0x2743f5['getFields']();}return null;})[_0xdc8e('0x26')](function(_0x72b988){if(_0x72b988){if(!_0x72b988['length']){throw new db[(_0xdc8e('0x66'))][(_0xdc8e('0x67'))](_0xdc8e('0x68'),0x193);}_0x133162=_0x72b988;return db[_0xdc8e('0x69')][_0xdc8e('0x6a')]({'raw':!![]});}return null;})[_0xdc8e('0x26')](function(_0x2efecf){if(_0x2efecf){_0x2d889f=_[_0xdc8e('0x6b')](_0x2efecf,'id');var _0x59060c;var _0x54a20f=squel[_0xdc8e('0x6c')]();_0x54a20f[_0xdc8e('0x6d')](_0x16a13f['table']);for(var _0x455eb4=0x0;_0x455eb4<_0x133162[_0xdc8e('0x43')];_0x455eb4+=0x1){_0x59060c=_0x133162[_0x455eb4][_0xdc8e('0x6e')]?_0x2d889f[_0x133162[_0x455eb4][_0xdc8e('0x6e')]][_0xdc8e('0x6f')]:_0x133162[_0x455eb4][_0xdc8e('0x70')];_0x59060c=_0x133162[_0x455eb4]['function']?_[_0xdc8e('0x71')](_0x66d4a4[_0x133162[_0x455eb4]['function']],'%s',_0x59060c):_0x59060c;_0x59060c=_0x133162[_0x455eb4][_0xdc8e('0x72')]?_[_0xdc8e('0x71')](_0x1c3b4d[_0x133162[_0x455eb4][_0xdc8e('0x72')]],'%s',_0x59060c):_0x59060c;if(_0x133162[_0x455eb4][_0xdc8e('0x73')]){_0x54a20f['group'](_0x59060c);}_0x133162[_0x455eb4][_0xdc8e('0x74')]&&_0x54a20f[_0xdc8e('0x35')](_0x59060c,_0x133162[_0x455eb4][_0xdc8e('0x74')]===_0xdc8e('0x75')?![]:!![]);_0x54a20f[_0xdc8e('0x70')](_0x59060c,_0x133162[_0x455eb4][_0xdc8e('0x76')]||_0x59060c);}if(_0x16a13f[_0xdc8e('0x77')]){_0x16a13f[_0xdc8e('0x77')]=JSON[_0xdc8e('0x78')](_0x16a13f[_0xdc8e('0x77')]);for(var _0x2e2c52=0x0;_0x2e2c52<_0x16a13f['joins'][_0xdc8e('0x43')];_0x2e2c52+=0x1){if(_0x16a13f[_0xdc8e('0x77')][_0x2e2c52][_0xdc8e('0x2e')]&&_['includes'](_0x10da50,_0x16a13f[_0xdc8e('0x77')][_0x2e2c52][_0xdc8e('0x2e')])&&_0x16a13f[_0xdc8e('0x77')][_0x2e2c52][_0xdc8e('0x79')]&&_0x16a13f[_0xdc8e('0x77')][_0x2e2c52][_0xdc8e('0x7a')]&&_0x16a13f['joins'][_0x2e2c52][_0xdc8e('0x7b')]){_0x54a20f[_0x16a13f['joins'][_0x2e2c52][_0xdc8e('0x2e')]](_0x16a13f[_0xdc8e('0x77')][_0x2e2c52][_0xdc8e('0x7a')],null,util[_0xdc8e('0x72')]('%s.%s\x20=\x20%s.%s',_0x16a13f[_0xdc8e('0x7c')],_0x16a13f[_0xdc8e('0x77')][_0x2e2c52][_0xdc8e('0x79')],_0x16a13f['joins'][_0x2e2c52][_0xdc8e('0x7a')],_0x16a13f[_0xdc8e('0x77')][_0x2e2c52]['foreignKey']));}}}if(_0x16a13f['conditions']){_0x16a13f[_0xdc8e('0x7d')]=JSON[_0xdc8e('0x78')](_0x16a13f['conditions']);_0x54a20f[_0xdc8e('0x37')](_0x423d50(_0x16a13f['conditions'][_0xdc8e('0x64')]));}_0x400723=_0x54a20f['clone']();_0x54a20f[_0xdc8e('0x1d')](_0x384530);_0x54a20f[_0xdc8e('0x1c')](0x0);logger[_0xdc8e('0x7e')]('Limited\x20Query:',_0x54a20f[_0xdc8e('0x7f')]());return db['sequelize'][_0xdc8e('0x30')](_0x54a20f['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0xdc8e('0x26')](respondWithResult(_0x5ae676,null))[_0xdc8e('0x46')](handleError(_0x5ae676,null));};function runReport(_0x5b82a5,_0x388cb0,_0x571c79){var _0x46ce93=_0x388cb0['name'];var _0x244894=0xa;var _0x524433=[_0xdc8e('0x80'),_0xdc8e('0x81'),'right_join',_0xdc8e('0x53')];var _0x12845d={'SUM':_0xdc8e('0x82'),'COUNT':_0xdc8e('0x83'),'COUNT DISTINCT':_0xdc8e('0x54'),'MAX':_0xdc8e('0x55'),'MIN':_0xdc8e('0x56'),'AVG':_0xdc8e('0x57'),'GROUP_CONCAT':_0xdc8e('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdc8e('0x5a')};var _0x3b3523={'SEC_TO_TIME':_0xdc8e('0x5b'),'DATE':_0xdc8e('0x84'),'HOUR':_0xdc8e('0x5c'),'ROUND':_0xdc8e('0x5d'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x466499=function(_0x16913a){return!_['includes']([_0xdc8e('0x85'),_0xdc8e('0x5f'),'IS\x20EMPTY',_0xdc8e('0x61')],_0x16913a);};var _0x25433f=function(_0x5dcba6){if(!_0x5dcba6||!_0x5dcba6[_0xdc8e('0x62')][_0xdc8e('0x43')]){return'';}for(var _0x3790d1='(',_0x3b8a63=0x0;_0x3b8a63<_0x5dcba6[_0xdc8e('0x62')]['length'];_0x3b8a63+=0x1){_0x3b8a63>0x0&&(_0x3790d1+='\x20'+_0x5dcba6[_0xdc8e('0x63')]+'\x20');_0x3790d1+=_0x5dcba6[_0xdc8e('0x62')][_0x3b8a63][_0xdc8e('0x64')]?_0x25433f(_0x5dcba6[_0xdc8e('0x62')][_0x3b8a63][_0xdc8e('0x64')]):_0x5dcba6[_0xdc8e('0x62')][_0x3b8a63]['field']+'\x20'+_0x5dcba6[_0xdc8e('0x62')][_0x3b8a63][_0xdc8e('0x65')]+(_0x466499(_0x5dcba6[_0xdc8e('0x62')][_0x3b8a63][_0xdc8e('0x65')])?'\x20'+_0x5dcba6['rules'][_0x3b8a63]['value']:'');}return _0x3790d1+')';};var _0x439485={'where':{'id':_0x5b82a5['id']}},_0x2fef7b,_0x3fcf22,_0x26d18c,_0x1959a9,_0x43615b;_0x439485=_[_0xdc8e('0x3a')]({},_0x439485,_0x571c79);return db[_0xdc8e('0x2d')][_0xdc8e('0x45')](_0x439485)[_0xdc8e('0x26')](function(_0x2049f3){if(_0x2049f3){_0x2fef7b=_0x2049f3;return _0x2049f3[_0xdc8e('0x86')]();}return null;})[_0xdc8e('0x26')](function(_0x2106e7){if(_0x2106e7){if(!_0x2106e7[_0xdc8e('0x43')]){throw new db[(_0xdc8e('0x66'))][(_0xdc8e('0x67'))](_0xdc8e('0x68'),0x193);}_0x3fcf22=_0x2106e7;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xdc8e('0x26')](function(_0x2f4ee1){if(_0x2f4ee1){_0x26d18c=_[_0xdc8e('0x6b')](_0x2f4ee1,'id');var _0x469512;var _0x3c6714=squel[_0xdc8e('0x6c')]();_0x3c6714[_0xdc8e('0x6d')](_0x2fef7b[_0xdc8e('0x7c')]);for(var _0x279f22=0x0;_0x279f22<_0x3fcf22[_0xdc8e('0x43')];_0x279f22+=0x1){_0x469512=_0x3fcf22[_0x279f22][_0xdc8e('0x6e')]?_0x26d18c[_0x3fcf22[_0x279f22]['MetricId']][_0xdc8e('0x6f')]:_0x3fcf22[_0x279f22][_0xdc8e('0x70')];_0x469512=_0x3fcf22[_0x279f22][_0xdc8e('0x87')]?_[_0xdc8e('0x71')](_0x12845d[_0x3fcf22[_0x279f22][_0xdc8e('0x87')]],'%s',_0x469512):_0x469512;_0x469512=_0x3fcf22[_0x279f22][_0xdc8e('0x72')]?_['replace'](_0x3b3523[_0x3fcf22[_0x279f22]['format']],'%s',_0x469512):_0x469512;if(_0x3fcf22[_0x279f22][_0xdc8e('0x73')]){_0x3c6714[_0xdc8e('0x64')](_0x469512);}_0x3fcf22[_0x279f22][_0xdc8e('0x74')]&&_0x3c6714[_0xdc8e('0x35')](_0x469512,_0x3fcf22[_0x279f22][_0xdc8e('0x74')]===_0xdc8e('0x75')?![]:!![]);_0x3c6714[_0xdc8e('0x70')](_0x469512,_0x3fcf22[_0x279f22][_0xdc8e('0x76')]||_0x469512);}if(_0x2fef7b['joins']){_0x2fef7b['joins']=JSON[_0xdc8e('0x78')](_0x2fef7b[_0xdc8e('0x77')]);for(var _0x316367=0x0;_0x316367<_0x2fef7b[_0xdc8e('0x77')]['length'];_0x316367+=0x1){if(_0x2fef7b['joins'][_0x316367][_0xdc8e('0x2e')]&&_['includes'](_0x524433,_0x2fef7b[_0xdc8e('0x77')][_0x316367]['type'])&&_0x2fef7b[_0xdc8e('0x77')][_0x316367]['parentKey']&&_0x2fef7b[_0xdc8e('0x77')][_0x316367]['foreignTable']&&_0x2fef7b[_0xdc8e('0x77')][_0x316367][_0xdc8e('0x7b')]){_0x3c6714[_0x2fef7b[_0xdc8e('0x77')][_0x316367][_0xdc8e('0x2e')]](_0x2fef7b['joins'][_0x316367][_0xdc8e('0x7a')],null,util['format'](_0xdc8e('0x88'),_0x2fef7b[_0xdc8e('0x7c')],_0x2fef7b[_0xdc8e('0x77')][_0x316367][_0xdc8e('0x79')],_0x2fef7b[_0xdc8e('0x77')][_0x316367][_0xdc8e('0x7a')],_0x2fef7b[_0xdc8e('0x77')][_0x316367][_0xdc8e('0x7b')]));}}}if(_0x2fef7b['conditions']){_0x2fef7b['conditions']=JSON[_0xdc8e('0x78')](_0x2fef7b[_0xdc8e('0x7d')]);_0x3c6714[_0xdc8e('0x37')](_0x25433f(_0x2fef7b[_0xdc8e('0x7d')][_0xdc8e('0x64')]));}_0x43615b=_0x3c6714['clone']();_0x3c6714[_0xdc8e('0x1d')](_0x244894);_0x3c6714[_0xdc8e('0x1c')](0x0);logger[_0xdc8e('0x7e')]('Limited\x20Query:',_0x3c6714[_0xdc8e('0x7f')]());return db[_0xdc8e('0x89')][_0xdc8e('0x30')](_0x3c6714[_0xdc8e('0x7f')](),{'type':db['sequelize'][_0xdc8e('0x8a')][_0xdc8e('0x8b')]});}})[_0xdc8e('0x26')](function(_0x5ab451){if(!_0x5ab451[_0xdc8e('0x43')]){throw new db['Sequelize'][(_0xdc8e('0x67'))]('No\x20available\x20data',0xcc);}if(_0x388cb0['output']==='web'){return null;}var _0x14748a=_[_0xdc8e('0x3a')](_0x388cb0,{'name':_0x388cb0[_0xdc8e('0x8c')]||_0x388cb0[_0xdc8e('0x29')]||_0x2fef7b[_0xdc8e('0x29')],'basename':_0x46ce93,'savename':util[_0xdc8e('0x72')](_0xdc8e('0x8d'),_0x388cb0['name']||_0x2fef7b[_0xdc8e('0x29')],require(_0xdc8e('0x8e'))['generate'](0x4),_0x388cb0[_0xdc8e('0x8f')]||'csv'),'reportId':_0x2fef7b['id'],'reportType':_0xdc8e('0x90')});return db['AnalyticExtractedReport'][_0xdc8e('0x4e')](_0x14748a,{'raw':!![]});})['then'](function(_0x23371e){if(_0x2fef7b[_0xdc8e('0x7c')]===_0xdc8e('0x91')){_0x43615b[_0xdc8e('0x37')](_0x2fef7b[_0xdc8e('0x7c')]+_0xdc8e('0x92'),_0x388cb0[_0xdc8e('0x93')],_0x388cb0[_0xdc8e('0x94')]);}else{_0x43615b['where'](_0x2fef7b[_0xdc8e('0x7c')]+_0xdc8e('0x95'),_0x388cb0[_0xdc8e('0x93')],_0x388cb0[_0xdc8e('0x94')]);}if(_0x23371e){logger[_0xdc8e('0x96')](_0xdc8e('0x97'),_0x43615b[_0xdc8e('0x7f')]());require('child_process')[_0xdc8e('0x98')](path[_0xdc8e('0x80')](__dirname,_0xdc8e('0x99'),_0x23371e[_0xdc8e('0x8f')]),[_0x23371e['id'],_0x43615b[_0xdc8e('0x7f')](),path[_0xdc8e('0x80')](__dirname,_0xdc8e('0x9a'),_0x23371e['savename']),_0x46ce93]);return _0x23371e;}else{var _0x38b840=squel[_0xdc8e('0x6c')]();_0x38b840[_0xdc8e('0x6d')]('('+_0x43615b[_0xdc8e('0x7f')]()+')',_0xdc8e('0x9b'));_0x38b840[_0xdc8e('0x70')](_0xdc8e('0x9c'),_0xdc8e('0x1b'));_0x43615b[_0xdc8e('0x1d')](_0x388cb0[_0xdc8e('0x1d')]||_0x244894);_0x43615b[_0xdc8e('0x1c')](_0x388cb0[_0xdc8e('0x1c')]||0x0);return db[_0xdc8e('0x89')]['query'](_0x38b840[_0xdc8e('0x7f')](),{'type':db[_0xdc8e('0x89')]['QueryTypes']['SELECT']})[_0xdc8e('0x26')](function(_0x2e2a6f){if(!_0x2e2a6f[_0xdc8e('0x43')]){_0x1959a9=0x0;}else{_0x1959a9=_0x2e2a6f[0x0][_0xdc8e('0x1b')]||0x0;}return db[_0xdc8e('0x89')][_0xdc8e('0x30')](_0x43615b[_0xdc8e('0x7f')](),{'type':db[_0xdc8e('0x89')][_0xdc8e('0x8a')][_0xdc8e('0x8b')]});})[_0xdc8e('0x26')](function(_0xa79548){return{'rows':_0xa79548||[],'count':_0x1959a9};});}});}exports['run']=function(_0x3acd33,_0x442948){return runReport(_0x3acd33[_0xdc8e('0x40')],_0x3acd33['query'],_0x3acd33['options'])[_0xdc8e('0x26')](respondWithResult(_0x442948,null))[_0xdc8e('0x46')](handleError(_0x442948,null));};exports[_0xdc8e('0x9d')]=runReport;exports[_0xdc8e('0x30')]=function(_0x35ed58,_0x5a599b){var _0x3b76bb=0xa;var _0x529b6f=[_0xdc8e('0x80'),_0xdc8e('0x81'),_0xdc8e('0x9e'),_0xdc8e('0x53')];var _0x2e6643={'SUM':_0xdc8e('0x82'),'COUNT':_0xdc8e('0x83'),'COUNT DISTINCT':_0xdc8e('0x54'),'MAX':_0xdc8e('0x55'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xdc8e('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xdc8e('0x5a')};var _0x11db02={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xdc8e('0x84'),'HOUR':_0xdc8e('0x5c'),'ROUND':_0xdc8e('0x5d'),'UNIX_TIMESTAMP':_0xdc8e('0x9f')};var _0x13ff4a=function(_0x3f2ed5){return!_[_0xdc8e('0x5e')](['IS\x20NULL',_0xdc8e('0x5f'),_0xdc8e('0x60'),'IS\x20NOT\x20EMPTY'],_0x3f2ed5);};var _0x1820e2=function(_0x519d03){if(!_0x519d03||!_0x519d03[_0xdc8e('0x62')]['length']){return'';}for(var _0x234809='(',_0x3090ff=0x0;_0x3090ff<_0x519d03[_0xdc8e('0x62')][_0xdc8e('0x43')];_0x3090ff+=0x1){_0x3090ff>0x0&&(_0x234809+='\x20'+_0x519d03['operator']+'\x20');_0x234809+=_0x519d03[_0xdc8e('0x62')][_0x3090ff][_0xdc8e('0x64')]?_0x1820e2(_0x519d03[_0xdc8e('0x62')][_0x3090ff][_0xdc8e('0x64')]):_0x519d03[_0xdc8e('0x62')][_0x3090ff][_0xdc8e('0x70')]+'\x20'+_0x519d03[_0xdc8e('0x62')][_0x3090ff]['condition']+(_0x13ff4a(_0x519d03['rules'][_0x3090ff]['condition'])?'\x20'+_0x519d03['rules'][_0x3090ff][_0xdc8e('0xa0')]:'');}return _0x234809+')';};var _0x466788={'where':{'id':_0x35ed58[_0xdc8e('0x40')]['id']}},_0x35e4e7,_0x577232,_0x2449e9,_0x573dfd,_0x4fd26e;_0x466788=_['merge']({},_0x466788,_0x35ed58[_0xdc8e('0x3c')]);return db[_0xdc8e('0x2d')]['find'](_0x466788)[_0xdc8e('0x26')](function(_0x2c1b32){if(_0x2c1b32){_0x35e4e7=_0x2c1b32;return _0x2c1b32[_0xdc8e('0x86')]();}return null;})[_0xdc8e('0x26')](function(_0x5bd51f){if(_0x5bd51f){if(!_0x5bd51f[_0xdc8e('0x43')]){throw new db[(_0xdc8e('0x66'))][(_0xdc8e('0x67'))](_0xdc8e('0x68'),0x193);}_0x577232=_0x5bd51f;return db[_0xdc8e('0x69')]['findAll']({'raw':!![]});}return null;})[_0xdc8e('0x26')](function(_0x3713da){if(_0x3713da){_0x2449e9=_[_0xdc8e('0x6b')](_0x3713da,'id');var _0x47b9d7;var _0x58168b=squel['select']();_0x58168b['from'](_0x35e4e7[_0xdc8e('0x7c')]);for(var _0x3ec072=0x0;_0x3ec072<_0x577232[_0xdc8e('0x43')];_0x3ec072+=0x1){_0x47b9d7=_0x577232[_0x3ec072][_0xdc8e('0x6e')]?_0x2449e9[_0x577232[_0x3ec072][_0xdc8e('0x6e')]][_0xdc8e('0x6f')]:_0x577232[_0x3ec072][_0xdc8e('0x70')];_0x47b9d7=_0x577232[_0x3ec072]['function']?_[_0xdc8e('0x71')](_0x2e6643[_0x577232[_0x3ec072]['function']],'%s',_0x47b9d7):_0x47b9d7;_0x47b9d7=_0x577232[_0x3ec072]['format']?_[_0xdc8e('0x71')](_0x11db02[_0x577232[_0x3ec072][_0xdc8e('0x72')]],'%s',_0x47b9d7):_0x47b9d7;if(_0x577232[_0x3ec072][_0xdc8e('0x73')]){_0x58168b[_0xdc8e('0x64')](_0x47b9d7);}_0x577232[_0x3ec072][_0xdc8e('0x74')]&&_0x58168b[_0xdc8e('0x35')](_0x47b9d7,_0x577232[_0x3ec072][_0xdc8e('0x74')]==='DESC'?![]:!![]);_0x58168b[_0xdc8e('0x70')](_0x47b9d7,_0x577232[_0x3ec072][_0xdc8e('0x76')]||_0x47b9d7);}if(_0x35e4e7['joins']){_0x35e4e7['joins']=JSON[_0xdc8e('0x78')](_0x35e4e7['joins']);for(var _0x130985=0x0;_0x130985<_0x35e4e7[_0xdc8e('0x77')][_0xdc8e('0x43')];_0x130985+=0x1){if(_0x35e4e7[_0xdc8e('0x77')][_0x130985][_0xdc8e('0x2e')]&&_['includes'](_0x529b6f,_0x35e4e7[_0xdc8e('0x77')][_0x130985][_0xdc8e('0x2e')])&&_0x35e4e7['joins'][_0x130985][_0xdc8e('0x79')]&&_0x35e4e7['joins'][_0x130985][_0xdc8e('0x7a')]&&_0x35e4e7['joins'][_0x130985][_0xdc8e('0x7b')]){_0x58168b[_0x35e4e7[_0xdc8e('0x77')][_0x130985][_0xdc8e('0x2e')]](_0x35e4e7[_0xdc8e('0x77')][_0x130985][_0xdc8e('0x7a')],null,util['format'](_0xdc8e('0x88'),_0x35e4e7[_0xdc8e('0x7c')],_0x35e4e7[_0xdc8e('0x77')][_0x130985][_0xdc8e('0x79')],_0x35e4e7['joins'][_0x130985]['foreignTable'],_0x35e4e7['joins'][_0x130985][_0xdc8e('0x7b')]));}}}if(_0x35e4e7['conditions']){_0x35e4e7[_0xdc8e('0x7d')]=JSON[_0xdc8e('0x78')](_0x35e4e7[_0xdc8e('0x7d')]);_0x58168b[_0xdc8e('0x37')](_0x1820e2(_0x35e4e7[_0xdc8e('0x7d')]['group']));}_0x4fd26e=_0x58168b[_0xdc8e('0xa1')]();_0x58168b[_0xdc8e('0x1d')](_0x3b76bb);_0x58168b[_0xdc8e('0x1c')](0x0);logger['debug'](_0xdc8e('0xa2'),_0x58168b['toString']());return db[_0xdc8e('0x89')][_0xdc8e('0x30')](_0x58168b[_0xdc8e('0x7f')](),{'type':db[_0xdc8e('0x89')][_0xdc8e('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x4fd26e[_0xdc8e('0x7f')]()};})[_0xdc8e('0x26')](respondWithResult(_0x5a599b,null))[_0xdc8e('0x46')](handleError(_0x5a599b,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index c2df373..e470e64 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 _0x930b=['define','analytics_custom_reports','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x5dca82,_0x136a46){var _0x403d5e=function(_0x111b29){while(--_0x111b29){_0x5dca82['push'](_0x5dca82['shift']());}};_0x403d5e(++_0x136a46);}(_0x930b,0x106));var _0xb930=function(_0xf43ada,_0x4b7ef5){_0xf43ada=_0xf43ada-0x0;var _0x4fcb27=_0x930b[_0xf43ada];return _0x4fcb27;};'use strict';var _=require(_0xb930('0x0'));var util=require(_0xb930('0x1'));var logger=require('../../config/logger')(_0xb930('0x2'));var moment=require(_0xb930('0x3'));var BPromise=require(_0xb930('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb930('0x5'));var config=require(_0xb930('0x6'));var attributes=require(_0xb930('0x7'));module['exports']=function(_0x438633,_0x2ba50a){return _0x438633[_0xb930('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xb930('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb81a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','lodash'];(function(_0xbc14ff,_0x4f5f43){var _0x49f13d=function(_0x5bd08c){while(--_0x5bd08c){_0xbc14ff['push'](_0xbc14ff['shift']());}};_0x49f13d(++_0x4f5f43);}(_0xb81a,0x16a));var _0xab81=function(_0x502a5c,_0x1e5506){_0x502a5c=_0x502a5c-0x0;var _0x119398=_0xb81a[_0x502a5c];return _0x119398;};'use strict';var _=require(_0xab81('0x0'));var util=require(_0xab81('0x1'));var logger=require(_0xab81('0x2'))(_0xab81('0x3'));var moment=require(_0xab81('0x4'));var BPromise=require('bluebird');var rp=require(_0xab81('0x5'));var fs=require('fs');var path=require(_0xab81('0x6'));var rimraf=require(_0xab81('0x7'));var config=require(_0xab81('0x8'));var attributes=require('./analyticCustomReport.attributes');module[_0xab81('0x9')]=function(_0x1090e7,_0x5b51f2){return _0x1090e7[_0xab81('0xa')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 9d11c0e..973417e 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 _0x7d57=['client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x368e37,_0x1758c4){var _0x3a8438=function(_0x178085){while(--_0x178085){_0x368e37['push'](_0x368e37['shift']());}};_0x3a8438(++_0x1758c4);}(_0x7d57,0xdf));var _0x77d5=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x7d57[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x77d5('0x0'));var util=require(_0x77d5('0x1'));var moment=require('moment');var BPromise=require(_0x77d5('0x2'));var rs=require(_0x77d5('0x3'));var fs=require('fs');var Redis=require(_0x77d5('0x4'));var db=require(_0x77d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77d5('0x6'))(_0x77d5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77d5('0x8')][_0x77d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x229da8,_0xce27df,_0x5480e9){return new BPromise(function(_0x231d6c,_0x42e68d){return client['request'](_0x229da8,_0x5480e9)[_0x77d5('0xa')](function(_0x2b5bef){logger[_0x77d5('0xb')](_0x77d5('0xc'),_0xce27df,_0x77d5('0xd'));logger[_0x77d5('0xe')](_0x77d5('0xf'),_0xce27df,_0x77d5('0xd'),JSON['stringify'](_0x2b5bef));if(_0x2b5bef[_0x77d5('0x10')]){if(_0x2b5bef[_0x77d5('0x10')][_0x77d5('0x11')]===0x1f4){logger['error'](_0x77d5('0xc'),_0xce27df,_0x2b5bef[_0x77d5('0x10')]['message']);return _0x42e68d(_0x2b5bef[_0x77d5('0x10')][_0x77d5('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xce27df,_0x2b5bef[_0x77d5('0x10')][_0x77d5('0x12')]);return _0x231d6c(_0x2b5bef[_0x77d5('0x10')]['message']);}else{logger[_0x77d5('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0xce27df,_0x77d5('0xd'));_0x231d6c(_0x2b5bef[_0x77d5('0x13')]['message']);}})[_0x77d5('0x14')](function(_0x35a2b0){logger[_0x77d5('0x10')](_0x77d5('0xc'),_0xce27df,_0x35a2b0);_0x42e68d(_0x35a2b0);});});} \ No newline at end of file +var _0x6c13=['client','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x9260f5,_0x33597f){var _0x17ae93=function(_0x3dbe61){while(--_0x3dbe61){_0x9260f5['push'](_0x9260f5['shift']());}};_0x17ae93(++_0x33597f);}(_0x6c13,0xb4));var _0x36c1=function(_0x514c5e,_0x8c0875){_0x514c5e=_0x514c5e-0x0;var _0x34c3e6=_0x6c13[_0x514c5e];return _0x34c3e6;};'use strict';var _=require(_0x36c1('0x0'));var util=require(_0x36c1('0x1'));var moment=require('moment');var BPromise=require(_0x36c1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x36c1('0x3'));var db=require(_0x36c1('0x4'))['db'];var utils=require(_0x36c1('0x5'));var logger=require(_0x36c1('0x6'))(_0x36c1('0x7'));var config=require(_0x36c1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x36c1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4378fd,_0x561dac,_0x391596){return new BPromise(function(_0x386e31,_0x3561bd){return client['request'](_0x4378fd,_0x391596)[_0x36c1('0xa')](function(_0x1fc276){logger[_0x36c1('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x561dac,'request\x20sent');logger[_0x36c1('0xc')](_0x36c1('0xd'),_0x561dac,'request\x20sent',JSON[_0x36c1('0xe')](_0x1fc276));if(_0x1fc276[_0x36c1('0xf')]){if(_0x1fc276['error'][_0x36c1('0x10')]===0x1f4){logger[_0x36c1('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x561dac,_0x1fc276[_0x36c1('0xf')]['message']);return _0x3561bd(_0x1fc276[_0x36c1('0xf')][_0x36c1('0x11')]);}logger[_0x36c1('0xf')](_0x36c1('0x12'),_0x561dac,_0x1fc276[_0x36c1('0xf')][_0x36c1('0x11')]);return _0x386e31(_0x1fc276[_0x36c1('0xf')][_0x36c1('0x11')]);}else{logger[_0x36c1('0xb')](_0x36c1('0x12'),_0x561dac,_0x36c1('0x13'));_0x386e31(_0x1fc276[_0x36c1('0x14')]['message']);}})['catch'](function(_0x1cc443){logger['error'](_0x36c1('0x12'),_0x561dac,_0x1cc443);_0x3561bd(_0x1cc443);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 29419af..a997d16 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 _0x70bb=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','post','create','put','update','delete','destroy','exports'];(function(_0x54ed58,_0xa2ee82){var _0x59df49=function(_0x31c6c6){while(--_0x31c6c6){_0x54ed58['push'](_0x54ed58['shift']());}};_0x59df49(++_0xa2ee82);}(_0x70bb,0x176));var _0xb70b=function(_0x9f6f64,_0x4cd6df){_0x9f6f64=_0x9f6f64-0x0;var _0x3b9f5c=_0x70bb[_0x9f6f64];return _0x3b9f5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb70b('0x0'));var timeout=require('connect-timeout');var express=require(_0xb70b('0x1'));var router=express[_0xb70b('0x2')]();var auth=require(_0xb70b('0x3'));var interaction=require(_0xb70b('0x4'));var config=require(_0xb70b('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xb70b('0x6')]('/',auth[_0xb70b('0x7')](),controller[_0xb70b('0x8')]);router[_0xb70b('0x6')](_0xb70b('0x9'),auth[_0xb70b('0x7')](),controller[_0xb70b('0xa')]);router[_0xb70b('0x6')](_0xb70b('0xb'),auth['isAuthenticated'](),controller[_0xb70b('0xc')]);router['get'](_0xb70b('0xd'),auth[_0xb70b('0x7')](),controller[_0xb70b('0xe')]);router[_0xb70b('0x6')]('/:id/query',auth[_0xb70b('0x7')](),controller['query']);router[_0xb70b('0xf')]('/',auth['isAuthenticated'](),controller[_0xb70b('0x10')]);router[_0xb70b('0x11')](_0xb70b('0x9'),auth['isAuthenticated'](),controller[_0xb70b('0x12')]);router[_0xb70b('0x13')](_0xb70b('0x9'),auth[_0xb70b('0x7')](),controller[_0xb70b('0x14')]);module[_0xb70b('0x15')]=router; \ No newline at end of file +var _0x102f=['/:id/preview','/:id/query','query','create','put','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show'];(function(_0x3e4add,_0x34cc79){var _0x57e78e=function(_0x38fb47){while(--_0x38fb47){_0x3e4add['push'](_0x3e4add['shift']());}};_0x57e78e(++_0x34cc79);}(_0x102f,0xcd));var _0xf102=function(_0x4da7da,_0x17974b){_0x4da7da=_0x4da7da-0x0;var _0x30485d=_0x102f[_0x4da7da];return _0x30485d;};'use strict';var multer=require('multer');var util=require(_0xf102('0x0'));var path=require(_0xf102('0x1'));var timeout=require(_0xf102('0x2'));var express=require('express');var router=express[_0xf102('0x3')]();var auth=require(_0xf102('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf102('0x5'));router[_0xf102('0x6')]('/',auth[_0xf102('0x7')](),controller[_0xf102('0x8')]);router[_0xf102('0x6')](_0xf102('0x9'),auth['isAuthenticated'](),controller[_0xf102('0xa')]);router[_0xf102('0x6')](_0xf102('0xb'),auth[_0xf102('0x7')](),controller['preview']);router['get']('/:id/run',auth[_0xf102('0x7')](),controller['run']);router[_0xf102('0x6')](_0xf102('0xc'),auth[_0xf102('0x7')](),controller[_0xf102('0xd')]);router['post']('/',auth[_0xf102('0x7')](),controller[_0xf102('0xe')]);router[_0xf102('0xf')](_0xf102('0x9'),auth[_0xf102('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xf102('0x10')]);module[_0xf102('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 7dfdd16..fc14e29 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 _0x3dee=['exports','STRING','sequelize'];(function(_0x1ea1e8,_0x5aa4ad){var _0xd2c012=function(_0x42f8c8){while(--_0x42f8c8){_0x1ea1e8['push'](_0x1ea1e8['shift']());}};_0xd2c012(++_0x5aa4ad);}(_0x3dee,0x9b));var _0xe3de=function(_0x4f0fc7,_0x2cfce8){_0x4f0fc7=_0x4f0fc7-0x0;var _0x2a4bd6=_0x3dee[_0x4f0fc7];return _0x2a4bd6;};'use strict';var Sequelize=require(_0xe3de('0x0'));module[_0xe3de('0x1')]={'name':{'type':Sequelize[_0xe3de('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xe3de('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4de6=['STRING','TEXT','exports'];(function(_0x4180b4,_0xc23d46){var _0x14e688=function(_0xeca499){while(--_0xeca499){_0x4180b4['push'](_0x4180b4['shift']());}};_0x14e688(++_0xc23d46);}(_0x4de6,0x1b8));var _0x64de=function(_0x52c0d0,_0x20b184){_0x52c0d0=_0x52c0d0-0x0;var _0x38946d=_0x4de6[_0x52c0d0];return _0x38946d;};'use strict';var Sequelize=require('sequelize');module[_0x64de('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x64de('0x1')]},'parent':{'type':Sequelize[_0x64de('0x1')]},'table':{'type':Sequelize[_0x64de('0x1')]},'conditions':{'type':Sequelize[_0x64de('0x2')]},'joins':{'type':Sequelize[_0x64de('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index d6df152..f5de3ca 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 _0x7953=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','Sequelize','ValidationErrorItem','alias','clone','debug','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','output','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','UNIX_TIMESTAMP(%s)','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','get','DefaultReports','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x5b54c7,_0x423c32){var _0x43f07b=function(_0x208bd8){while(--_0x208bd8){_0x5b54c7['push'](_0x5b54c7['shift']());}};_0x43f07b(++_0x423c32);}(_0x7953,0x66));var _0x3795=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x7953[_0x289e64];return _0x30246c;};'use strict';var pdf=require(_0x3795('0x0'));var emlformat=require(_0x3795('0x1'));var rimraf=require(_0x3795('0x2'));var zipdir=require(_0x3795('0x3'));var jsonpatch=require(_0x3795('0x4'));var rp=require(_0x3795('0x5'));var moment=require(_0x3795('0x6'));var BPromise=require(_0x3795('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3795('0x8'));var sox=require(_0x3795('0x9'));var csv=require(_0x3795('0xa'));var ejs=require(_0x3795('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3795('0xc'));var crypto=require('crypto');var jsforce=require(_0x3795('0xd'));var deskjs=require(_0x3795('0xe'));var toCsv=require(_0x3795('0xa'));var querystring=require(_0x3795('0xf'));var Papa=require(_0x3795('0x10'));var Redis=require(_0x3795('0x11'));var authService=require(_0x3795('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3795('0x13'));var hardwareService=require(_0x3795('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3795('0x15'))['db'];function respondWithStatusCode(_0x2368f4,_0x324d32){_0x324d32=_0x324d32||0xcc;return function(_0x154327){if(_0x154327){return _0x2368f4[_0x3795('0x16')](_0x324d32);}return _0x2368f4[_0x3795('0x17')](_0x324d32)[_0x3795('0x18')]();};}function respondWithResult(_0x2dce50,_0x233d57){_0x233d57=_0x233d57||0xc8;return function(_0x3d8f3c){if(_0x3d8f3c){return _0x2dce50[_0x3795('0x17')](_0x233d57)['json'](_0x3d8f3c);}};}function respondWithFilteredResult(_0x15a662,_0x45975d){return function(_0x2cf2a3){if(_0x2cf2a3){var _0x3f8974=_0x2cf2a3[_0x3795('0x19')],_0x596380=_0x45975d[_0x3795('0x1a')],_0x1a4d7d=_0x45975d[_0x3795('0x1a')]+_0x45975d[_0x3795('0x1b')],_0x587874;if(_0x1a4d7d>=_0x3f8974){_0x1a4d7d=_0x3f8974;_0x587874=0xc8;}else{_0x587874=0xce;}_0x15a662[_0x3795('0x17')](_0x587874);return _0x15a662['set'](_0x3795('0x1c'),_0x596380+'-'+_0x1a4d7d+'/'+_0x3f8974)[_0x3795('0x1d')](_0x2cf2a3);}return null;};}function patchUpdates(_0x31c9fb){return function(_0x3ad8da){try{jsonpatch[_0x3795('0x1e')](_0x3ad8da,_0x31c9fb,!![]);}catch(_0xd71e1f){return BPromise['reject'](_0xd71e1f);}return _0x3ad8da[_0x3795('0x1f')]();};}function saveUpdates(_0x2d507b,_0x5cb8ba){return function(_0x360391){if(_0x360391){return _0x360391[_0x3795('0x20')](_0x2d507b)[_0x3795('0x21')](function(_0x13ee38){return _0x13ee38;});}return null;};}function removeEntity(_0x2c9445,_0x3145e2){return function(_0xd72898){if(_0xd72898){return _0xd72898[_0x3795('0x22')]()[_0x3795('0x21')](function(){var _0x115bd6=_0xd72898[_0x3795('0x23')]({'plain':!![]});var _0x3924c1=_0x3795('0x24');return db['UserProfileResource'][_0x3795('0x22')]({'where':{'type':_0x3924c1,'resourceId':_0x115bd6['id']}})[_0x3795('0x21')](function(){return _0xd72898;});})['then'](function(){_0x2c9445[_0x3795('0x17')](0xcc)[_0x3795('0x18')]();});}};}function handleEntityNotFound(_0x22bb58,_0x389b01){return function(_0x596170){if(!_0x596170){_0x22bb58[_0x3795('0x16')](0x194);}return _0x596170;};}function handleError(_0x9fe5c0,_0x311a05){_0x311a05=_0x311a05||0x1f4;return function(_0x53ed2c){logger['error'](_0x53ed2c[_0x3795('0x25')]);if(_0x53ed2c[_0x3795('0x26')]){delete _0x53ed2c[_0x3795('0x26')];}_0x9fe5c0['status'](_0x311a05)[_0x3795('0x27')](_0x53ed2c);};}exports['index']=function(_0x14dece,_0x9e86cc){var _0x436d54={},_0x8b8a00={},_0x13b64b={'count':0x0,'rows':[]};var _0x16f170=_[_0x3795('0x28')](db[_0x3795('0x29')][_0x3795('0x2a')],function(_0x4cdacd){return{'name':_0x4cdacd[_0x3795('0x2b')],'type':_0x4cdacd[_0x3795('0x2c')]['key']};});_0x8b8a00['model']=_['map'](_0x16f170,_0x3795('0x26'));_0x8b8a00['query']=_[_0x3795('0x2d')](_0x14dece[_0x3795('0x2e')]);_0x8b8a00[_0x3795('0x2f')]=_[_0x3795('0x30')](_0x8b8a00[_0x3795('0x31')],_0x8b8a00[_0x3795('0x2e')]);_0x436d54[_0x3795('0x32')]=_[_0x3795('0x30')](_0x8b8a00[_0x3795('0x31')],qs[_0x3795('0x33')](_0x14dece[_0x3795('0x2e')][_0x3795('0x33')]));_0x436d54[_0x3795('0x32')]=_0x436d54[_0x3795('0x32')][_0x3795('0x34')]?_0x436d54['attributes']:_0x8b8a00[_0x3795('0x31')];if(!_0x14dece['query'][_0x3795('0x35')](_0x3795('0x36'))){_0x436d54[_0x3795('0x1b')]=qs[_0x3795('0x1b')](_0x14dece[_0x3795('0x2e')][_0x3795('0x1b')]);_0x436d54[_0x3795('0x1a')]=qs[_0x3795('0x1a')](_0x14dece[_0x3795('0x2e')][_0x3795('0x1a')]);}_0x436d54[_0x3795('0x37')]=qs['sort'](_0x14dece[_0x3795('0x2e')][_0x3795('0x38')]);_0x436d54[_0x3795('0x39')]=qs[_0x3795('0x2f')](_[_0x3795('0x3a')](_0x14dece[_0x3795('0x2e')],_0x8b8a00[_0x3795('0x2f')]));if(_0x14dece[_0x3795('0x2e')][_0x3795('0x3b')]){_0x436d54[_0x3795('0x39')]=_[_0x3795('0x3c')](_0x436d54[_0x3795('0x39')],{'$or':_[_0x3795('0x28')](_0x16f170,function(_0x2c2923){if(_0x2c2923[_0x3795('0x2c')]!==_0x3795('0x3d')){var _0xcb5a5={};_0xcb5a5[_0x2c2923[_0x3795('0x26')]]={'$like':'%'+_0x14dece[_0x3795('0x2e')][_0x3795('0x3b')]+'%'};return _0xcb5a5;}})});}_0x436d54=_[_0x3795('0x3c')]({},_0x436d54,_0x14dece[_0x3795('0x3e')]);var _0x5cbe39={'where':_0x436d54[_0x3795('0x39')]};return db[_0x3795('0x29')]['count'](_0x5cbe39)[_0x3795('0x21')](function(_0x1d380f){_0x13b64b[_0x3795('0x19')]=_0x1d380f;if(_0x14dece[_0x3795('0x2e')][_0x3795('0x3f')]){_0x436d54[_0x3795('0x40')]=[{'all':!![]}];}return db[_0x3795('0x29')][_0x3795('0x41')](_0x436d54);})[_0x3795('0x21')](function(_0x2061a5){_0x13b64b[_0x3795('0x42')]=_0x2061a5;return _0x13b64b;})[_0x3795('0x21')](respondWithFilteredResult(_0x9e86cc,_0x436d54))[_0x3795('0x43')](handleError(_0x9e86cc,null));};exports['show']=function(_0x13a264,_0x304755){var _0xde7b99={'raw':!![],'where':{'id':_0x13a264[_0x3795('0x44')]['id']}},_0xcf0420={};_0xcf0420[_0x3795('0x31')]=_['keys'](db[_0x3795('0x29')]['rawAttributes']);_0xcf0420[_0x3795('0x2e')]=_[_0x3795('0x2d')](_0x13a264[_0x3795('0x2e')]);_0xcf0420[_0x3795('0x2f')]=_[_0x3795('0x30')](_0xcf0420['model'],_0xcf0420['query']);_0xde7b99[_0x3795('0x32')]=_[_0x3795('0x30')](_0xcf0420[_0x3795('0x31')],qs[_0x3795('0x33')](_0x13a264[_0x3795('0x2e')]['fields']));_0xde7b99[_0x3795('0x32')]=_0xde7b99[_0x3795('0x32')]['length']?_0xde7b99['attributes']:_0xcf0420['model'];if(_0x13a264[_0x3795('0x2e')][_0x3795('0x3f')]){_0xde7b99[_0x3795('0x40')]=[{'all':!![]}];}_0xde7b99=_[_0x3795('0x3c')]({},_0xde7b99,_0x13a264['options']);return db[_0x3795('0x29')][_0x3795('0x45')](_0xde7b99)['then'](handleEntityNotFound(_0x304755,null))[_0x3795('0x21')](respondWithResult(_0x304755,null))['catch'](handleError(_0x304755,null));};exports[_0x3795('0x46')]=function(_0x1768ba,_0x4a6cb8){return db['AnalyticDefaultReport'][_0x3795('0x46')](_0x1768ba[_0x3795('0x47')],{})[_0x3795('0x21')](function(_0x3fdfea){var _0x1e9433=_0x1768ba[_0x3795('0x48')]['get']({'plain':!![]});if(!_0x1e9433)throw new Error(_0x3795('0x49'));if(_0x1e9433[_0x3795('0x4a')]===_0x3795('0x48')){var _0x16c49a=_0x3fdfea[_0x3795('0x23')]({'plain':!![]});var _0x42103c='Reports';return db[_0x3795('0x4b')][_0x3795('0x45')]({'where':{'name':_0x42103c,'userProfileId':_0x1e9433[_0x3795('0x4c')]},'raw':!![]})[_0x3795('0x21')](function(_0x436006){if(_0x436006&&_0x436006[_0x3795('0x4d')]===0x0){return db['UserProfileResource'][_0x3795('0x46')]({'name':_0x16c49a[_0x3795('0x26')],'resourceId':_0x16c49a['id'],'type':_0x3795('0x24'),'sectionId':_0x436006['id']},{})[_0x3795('0x21')](function(){return _0x3fdfea;});}else{return _0x3fdfea;}})[_0x3795('0x43')](function(_0xee31e1){logger[_0x3795('0x4e')](_0x3795('0x4f'),_0xee31e1);throw _0xee31e1;});}return _0x3fdfea;})[_0x3795('0x21')](respondWithResult(_0x4a6cb8,0xc9))[_0x3795('0x43')](handleError(_0x4a6cb8,null));};exports[_0x3795('0x20')]=function(_0x1e2a4b,_0x3cb30a){if(_0x1e2a4b['body']['id']){delete _0x1e2a4b[_0x3795('0x47')]['id'];}return db[_0x3795('0x29')][_0x3795('0x45')]({'where':{'id':_0x1e2a4b[_0x3795('0x44')]['id']}})[_0x3795('0x21')](handleEntityNotFound(_0x3cb30a,null))[_0x3795('0x21')](saveUpdates(_0x1e2a4b[_0x3795('0x47')],null))[_0x3795('0x21')](respondWithResult(_0x3cb30a,null))[_0x3795('0x43')](handleError(_0x3cb30a,null));};exports[_0x3795('0x22')]=function(_0x5080b6,_0x579c69){return db[_0x3795('0x29')][_0x3795('0x45')]({'where':{'id':_0x5080b6['params']['id']}})[_0x3795('0x21')](handleEntityNotFound(_0x579c69,null))[_0x3795('0x21')](removeEntity(_0x579c69,null))[_0x3795('0x43')](handleError(_0x579c69,null));};exports[_0x3795('0x50')]=function(_0x19f8af,_0x5626d2){var _0xcaf614=0xa;var _0x487ebf=[_0x3795('0x51'),_0x3795('0x52'),'right_join','cross_join'];var _0x12970f={'SUM':_0x3795('0x53'),'COUNT':_0x3795('0x54'),'COUNT DISTINCT':_0x3795('0x55'),'MAX':_0x3795('0x56'),'MIN':_0x3795('0x57'),'AVG':_0x3795('0x58'),'GROUP_CONCAT':_0x3795('0x59'),'GROUP_CONCAT ASC':_0x3795('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x451372={'SEC_TO_TIME':_0x3795('0x5b'),'DATE':_0x3795('0x5c'),'HOUR':_0x3795('0x5d'),'ROUND':_0x3795('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x16f5de=function(_0x27ca09){return!_[_0x3795('0x5f')]([_0x3795('0x60'),_0x3795('0x61'),'IS\x20EMPTY',_0x3795('0x62')],_0x27ca09);};var _0x8ea3b4=function(_0x3ce914){if(!_0x3ce914||!_0x3ce914['rules'][_0x3795('0x34')]){return'';}for(var _0x1e8c72='(',_0x1c0c3c=0x0;_0x1c0c3c<_0x3ce914['rules'][_0x3795('0x34')];_0x1c0c3c+=0x1){_0x1c0c3c>0x0&&(_0x1e8c72+='\x20'+_0x3ce914['operator']+'\x20');_0x1e8c72+=_0x3ce914[_0x3795('0x63')][_0x1c0c3c][_0x3795('0x64')]?_0x8ea3b4(_0x3ce914['rules'][_0x1c0c3c][_0x3795('0x64')]):_0x3ce914['rules'][_0x1c0c3c]['field']+'\x20'+_0x3ce914[_0x3795('0x63')][_0x1c0c3c][_0x3795('0x65')]+(_0x16f5de(_0x3ce914[_0x3795('0x63')][_0x1c0c3c][_0x3795('0x65')])?'\x20'+_0x3ce914['rules'][_0x1c0c3c]['value']:'');}return _0x1e8c72+')';};var _0x1a5d17={'where':{'id':_0x19f8af[_0x3795('0x44')]['id']}},_0x35e089,_0x55a2a8,_0x4d79c2,_0x1b83fc,_0x4aba4d;_0x1a5d17=_[_0x3795('0x3c')]({},_0x1a5d17,_0x19f8af[_0x3795('0x3e')]);return db['AnalyticDefaultReport'][_0x3795('0x45')](_0x1a5d17)['then'](function(_0x40a9e8){if(_0x40a9e8){_0x35e089=_0x40a9e8;return _0x40a9e8[_0x3795('0x66')]();}return null;})[_0x3795('0x21')](function(_0x38aa9c){if(_0x38aa9c){if(!_0x38aa9c['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x3795('0x67'),0x193);}_0x55a2a8=_0x38aa9c;return db[_0x3795('0x68')][_0x3795('0x41')]({'raw':!![]});}return null;})['then'](function(_0x3dbb1f){if(_0x3dbb1f){_0x4d79c2=_[_0x3795('0x69')](_0x3dbb1f,'id');var _0x28b4df;var _0x322b98=squel['select']();_0x322b98[_0x3795('0x6a')](_0x35e089[_0x3795('0x6b')]);for(var _0x1bc954=0x0;_0x1bc954<_0x55a2a8[_0x3795('0x34')];_0x1bc954+=0x1){_0x28b4df=_0x55a2a8[_0x1bc954][_0x3795('0x6c')]?_0x4d79c2[_0x55a2a8[_0x1bc954][_0x3795('0x6c')]][_0x3795('0x6d')]:_0x55a2a8[_0x1bc954]['field'];_0x28b4df=_0x55a2a8[_0x1bc954][_0x3795('0x6e')]?_[_0x3795('0x6f')](_0x12970f[_0x55a2a8[_0x1bc954]['function']],'%s',_0x28b4df):_0x28b4df;_0x28b4df=_0x55a2a8[_0x1bc954][_0x3795('0x70')]?_[_0x3795('0x6f')](_0x451372[_0x55a2a8[_0x1bc954][_0x3795('0x70')]],'%s',_0x28b4df):_0x28b4df;if(_0x55a2a8[_0x1bc954][_0x3795('0x71')]){_0x322b98[_0x3795('0x64')](_0x28b4df);}_0x55a2a8[_0x1bc954][_0x3795('0x72')]&&_0x322b98[_0x3795('0x37')](_0x28b4df,_0x55a2a8[_0x1bc954][_0x3795('0x72')]===_0x3795('0x73')?![]:!![]);_0x322b98[_0x3795('0x74')](_0x28b4df,_0x55a2a8[_0x1bc954]['alias']||_0x28b4df);}if(_0x35e089[_0x3795('0x75')]){_0x35e089[_0x3795('0x75')]=JSON[_0x3795('0x76')](_0x35e089[_0x3795('0x75')]);for(var _0x1513f8=0x0;_0x1513f8<_0x35e089[_0x3795('0x75')][_0x3795('0x34')];_0x1513f8+=0x1){if(_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x2c')]&&_['includes'](_0x487ebf,_0x35e089['joins'][_0x1513f8][_0x3795('0x2c')])&&_0x35e089['joins'][_0x1513f8][_0x3795('0x77')]&&_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x78')]&&_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x79')]){_0x322b98[_0x35e089['joins'][_0x1513f8]['type']](_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x78')],null,util[_0x3795('0x70')](_0x3795('0x7a'),_0x35e089[_0x3795('0x6b')],_0x35e089['joins'][_0x1513f8][_0x3795('0x77')],_0x35e089[_0x3795('0x75')][_0x1513f8]['foreignTable'],_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x79')]));}}}if(_0x35e089[_0x3795('0x7b')]){_0x35e089[_0x3795('0x7b')]=JSON['parse'](_0x35e089[_0x3795('0x7b')]);_0x322b98[_0x3795('0x39')](_0x8ea3b4(_0x35e089[_0x3795('0x7b')][_0x3795('0x64')]));}_0x4aba4d=_0x322b98['clone']();_0x322b98[_0x3795('0x1b')](_0xcaf614);_0x322b98['offset'](0x0);logger['debug'](_0x3795('0x7c'),_0x322b98[_0x3795('0x7d')]());return db['sequelize']['query'](_0x322b98[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')]['SELECT']});}})[_0x3795('0x21')](respondWithResult(_0x5626d2,null))[_0x3795('0x43')](handleError(_0x5626d2,null));};function runReport(_0x31826,_0x4247dd,_0x19f93e){var _0x591ad9=_0x4247dd[_0x3795('0x26')];var _0xeaa5b=0xa;var _0x117ef0=['join',_0x3795('0x52'),_0x3795('0x80'),_0x3795('0x81')];var _0x533c36={'SUM':_0x3795('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3795('0x55'),'MAX':'MAX(%s)','MIN':_0x3795('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3795('0x59'),'GROUP_CONCAT ASC':_0x3795('0x5a'),'GROUP_CONCAT DESC':_0x3795('0x82')};var _0x5d2d46={'SEC_TO_TIME':_0x3795('0x5b'),'DATE':_0x3795('0x5c'),'HOUR':_0x3795('0x5d'),'ROUND':_0x3795('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x390a32=function(_0x5a3f05){return!_[_0x3795('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x3795('0x83'),'IS\x20NOT\x20EMPTY'],_0x5a3f05);};var _0x379ebc=function(_0xf23d30){if(!_0xf23d30||!_0xf23d30['rules'][_0x3795('0x34')]){return'';}for(var _0x1464bb='(',_0x50cad4=0x0;_0x50cad4<_0xf23d30[_0x3795('0x63')][_0x3795('0x34')];_0x50cad4+=0x1){_0x50cad4>0x0&&(_0x1464bb+='\x20'+_0xf23d30[_0x3795('0x84')]+'\x20');_0x1464bb+=_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x64')]?_0x379ebc(_0xf23d30[_0x3795('0x63')][_0x50cad4]['group']):_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x74')]+'\x20'+_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x65')]+(_0x390a32(_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x65')])?'\x20'+_0xf23d30['rules'][_0x50cad4]['value']:'');}return _0x1464bb+')';};var _0x1df5b6={'where':{'id':_0x31826['id']}},_0x40d38f,_0x38e4cb,_0xfc55ca,_0x5e35c8,_0x41bc49;_0x1df5b6=_['merge']({},_0x1df5b6,_0x19f93e);return db[_0x3795('0x29')][_0x3795('0x45')](_0x1df5b6)[_0x3795('0x21')](function(_0xb58bb3){if(_0xb58bb3){_0x40d38f=_0xb58bb3;return _0xb58bb3[_0x3795('0x66')]();}return null;})[_0x3795('0x21')](function(_0x21e0f7){if(_0x21e0f7){if(!_0x21e0f7[_0x3795('0x34')]){throw new db[(_0x3795('0x85'))][(_0x3795('0x86'))](_0x3795('0x67'),0x193);}_0x38e4cb=_0x21e0f7;return db[_0x3795('0x68')][_0x3795('0x41')]({'raw':!![]});}return null;})[_0x3795('0x21')](function(_0x43c6f6){if(_0x43c6f6){_0xfc55ca=_['keyBy'](_0x43c6f6,'id');var _0x4fe8eb;var _0x2dffac=squel['select']();_0x2dffac[_0x3795('0x6a')](_0x40d38f[_0x3795('0x6b')]);for(var _0x5d8f1c=0x0;_0x5d8f1c<_0x38e4cb[_0x3795('0x34')];_0x5d8f1c+=0x1){_0x4fe8eb=_0x38e4cb[_0x5d8f1c][_0x3795('0x6c')]?_0xfc55ca[_0x38e4cb[_0x5d8f1c][_0x3795('0x6c')]][_0x3795('0x6d')]:_0x38e4cb[_0x5d8f1c][_0x3795('0x74')];_0x4fe8eb=_0x38e4cb[_0x5d8f1c][_0x3795('0x6e')]?_[_0x3795('0x6f')](_0x533c36[_0x38e4cb[_0x5d8f1c][_0x3795('0x6e')]],'%s',_0x4fe8eb):_0x4fe8eb;_0x4fe8eb=_0x38e4cb[_0x5d8f1c]['format']?_[_0x3795('0x6f')](_0x5d2d46[_0x38e4cb[_0x5d8f1c][_0x3795('0x70')]],'%s',_0x4fe8eb):_0x4fe8eb;if(_0x38e4cb[_0x5d8f1c][_0x3795('0x71')]){_0x2dffac[_0x3795('0x64')](_0x4fe8eb);}_0x38e4cb[_0x5d8f1c][_0x3795('0x72')]&&_0x2dffac[_0x3795('0x37')](_0x4fe8eb,_0x38e4cb[_0x5d8f1c][_0x3795('0x72')]==='DESC'?![]:!![]);_0x2dffac['field'](_0x4fe8eb,_0x38e4cb[_0x5d8f1c][_0x3795('0x87')]||_0x4fe8eb);}if(_0x40d38f[_0x3795('0x75')]){_0x40d38f[_0x3795('0x75')]=JSON['parse'](_0x40d38f[_0x3795('0x75')]);for(var _0x4a0e8d=0x0;_0x4a0e8d<_0x40d38f['joins'][_0x3795('0x34')];_0x4a0e8d+=0x1){if(_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x2c')]&&_[_0x3795('0x5f')](_0x117ef0,_0x40d38f[_0x3795('0x75')][_0x4a0e8d]['type'])&&_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x77')]&&_0x40d38f[_0x3795('0x75')][_0x4a0e8d]['foreignTable']&&_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x79')]){_0x2dffac[_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x2c')]](_0x40d38f['joins'][_0x4a0e8d][_0x3795('0x78')],null,util[_0x3795('0x70')](_0x3795('0x7a'),_0x40d38f[_0x3795('0x6b')],_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x77')],_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x78')],_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x79')]));}}}if(_0x40d38f[_0x3795('0x7b')]){_0x40d38f[_0x3795('0x7b')]=JSON[_0x3795('0x76')](_0x40d38f[_0x3795('0x7b')]);_0x2dffac[_0x3795('0x39')](_0x379ebc(_0x40d38f['conditions']['group']));}_0x41bc49=_0x2dffac[_0x3795('0x88')]();_0x2dffac['limit'](_0xeaa5b);_0x2dffac[_0x3795('0x1a')](0x0);logger[_0x3795('0x89')](_0x3795('0x7c'),_0x2dffac[_0x3795('0x7d')]());return db['sequelize']['query'](_0x2dffac[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')]['SELECT']});}})[_0x3795('0x21')](function(_0x4c8acf){if(!_0x4c8acf[_0x3795('0x34')]){throw new db['Sequelize'][(_0x3795('0x86'))]('No\x20available\x20data',0xcc);}if(_0x4247dd['output']===_0x3795('0x8a')){return null;}var _0x1facac=_[_0x3795('0x3c')](_0x4247dd,{'name':_0x4247dd[_0x3795('0x8b')]||_0x4247dd['name']||_0x40d38f[_0x3795('0x26')],'basename':_0x591ad9,'savename':util[_0x3795('0x70')](_0x3795('0x8c'),_0x4247dd[_0x3795('0x26')]||_0x40d38f['name'],require(_0x3795('0x8d'))[_0x3795('0x8e')](0x4),_0x4247dd['output']||_0x3795('0x8f')),'reportId':_0x40d38f['id'],'reportType':_0x3795('0x90')});return db[_0x3795('0x91')]['create'](_0x1facac,{'raw':!![]});})[_0x3795('0x21')](function(_0x5f4166){if(_0x40d38f[_0x3795('0x6b')]===_0x3795('0x92')){_0x41bc49[_0x3795('0x39')](_0x40d38f['table']+_0x3795('0x93'),_0x4247dd[_0x3795('0x94')],_0x4247dd[_0x3795('0x95')]);}else{_0x41bc49[_0x3795('0x39')](_0x40d38f[_0x3795('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4247dd['startDate'],_0x4247dd[_0x3795('0x95')]);}if(_0x5f4166){logger[_0x3795('0x96')](_0x3795('0x97'),_0x41bc49[_0x3795('0x7d')]());require(_0x3795('0x98'))['fork'](path[_0x3795('0x51')](__dirname,_0x3795('0x99'),_0x5f4166[_0x3795('0x9a')]),[_0x5f4166['id'],_0x41bc49[_0x3795('0x7d')](),path[_0x3795('0x51')](__dirname,_0x3795('0x9b'),_0x5f4166[_0x3795('0x9c')]),_0x591ad9]);return _0x5f4166;}else{var _0x29d33e=squel['select']();_0x29d33e[_0x3795('0x6a')]('('+_0x41bc49[_0x3795('0x7d')]()+')',_0x3795('0x9d'));_0x29d33e['field'](_0x3795('0x9e'),_0x3795('0x19'));_0x41bc49[_0x3795('0x1b')](_0x4247dd[_0x3795('0x1b')]||_0xeaa5b);_0x41bc49[_0x3795('0x1a')](_0x4247dd['offset']||0x0);return db[_0x3795('0x7e')][_0x3795('0x2e')](_0x29d33e[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')][_0x3795('0x9f')]})['then'](function(_0x252742){if(!_0x252742[_0x3795('0x34')]){_0x5e35c8=0x0;}else{_0x5e35c8=_0x252742[0x0]['count']||0x0;}return db[_0x3795('0x7e')]['query'](_0x41bc49[_0x3795('0x7d')](),{'type':db['sequelize'][_0x3795('0x7f')][_0x3795('0x9f')]});})[_0x3795('0x21')](function(_0x362c7b){return{'rows':_0x362c7b||[],'count':_0x5e35c8};});}});}exports['run']=function(_0x247558,_0x48dc7c){return runReport(_0x247558[_0x3795('0x44')],_0x247558[_0x3795('0x2e')],_0x247558[_0x3795('0x3e')])['then'](respondWithResult(_0x48dc7c,null))[_0x3795('0x43')](handleError(_0x48dc7c,null));};exports[_0x3795('0xa0')]=runReport;exports[_0x3795('0x2e')]=function(_0x186965,_0x4a5548){var _0x32c48b=0xa;var _0x478537=[_0x3795('0x51'),_0x3795('0x52'),_0x3795('0x80'),_0x3795('0x81')];var _0x2526cb={'SUM':_0x3795('0x53'),'COUNT':_0x3795('0x54'),'COUNT DISTINCT':_0x3795('0x55'),'MAX':_0x3795('0x56'),'MIN':_0x3795('0x57'),'AVG':_0x3795('0x58'),'GROUP_CONCAT':_0x3795('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3795('0x82')};var _0x373f4e={'SEC_TO_TIME':_0x3795('0x5b'),'DATE':_0x3795('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x3795('0x5e'),'UNIX_TIMESTAMP':_0x3795('0xa1')};var _0x3b9141=function(_0x2c09ac){return!_[_0x3795('0x5f')]([_0x3795('0x60'),_0x3795('0x61'),_0x3795('0x83'),_0x3795('0x62')],_0x2c09ac);};var _0x1fc76b=function(_0xe6bef8){if(!_0xe6bef8||!_0xe6bef8['rules'][_0x3795('0x34')]){return'';}for(var _0x1e8e79='(',_0x1fea09=0x0;_0x1fea09<_0xe6bef8[_0x3795('0x63')][_0x3795('0x34')];_0x1fea09+=0x1){_0x1fea09>0x0&&(_0x1e8e79+='\x20'+_0xe6bef8['operator']+'\x20');_0x1e8e79+=_0xe6bef8[_0x3795('0x63')][_0x1fea09]['group']?_0x1fc76b(_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x64')]):_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x74')]+'\x20'+_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x65')]+(_0x3b9141(_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x65')])?'\x20'+_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0xa2')]:'');}return _0x1e8e79+')';};var _0x2d9c13={'where':{'id':_0x186965[_0x3795('0x44')]['id']}},_0x538785,_0x3916cf,_0x3d60a5,_0x4f30a2,_0x4f9b2f;_0x2d9c13=_[_0x3795('0x3c')]({},_0x2d9c13,_0x186965[_0x3795('0x3e')]);return db[_0x3795('0x29')][_0x3795('0x45')](_0x2d9c13)[_0x3795('0x21')](function(_0x35e799){if(_0x35e799){_0x538785=_0x35e799;return _0x35e799['getFields']();}return null;})[_0x3795('0x21')](function(_0x1d737c){if(_0x1d737c){if(!_0x1d737c[_0x3795('0x34')]){throw new db[(_0x3795('0x85'))][(_0x3795('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3916cf=_0x1d737c;return db[_0x3795('0x68')][_0x3795('0x41')]({'raw':!![]});}return null;})[_0x3795('0x21')](function(_0x54b661){if(_0x54b661){_0x3d60a5=_['keyBy'](_0x54b661,'id');var _0x5d6802;var _0x3ba2e8=squel['select']();_0x3ba2e8[_0x3795('0x6a')](_0x538785['table']);for(var _0x452ea3=0x0;_0x452ea3<_0x3916cf[_0x3795('0x34')];_0x452ea3+=0x1){_0x5d6802=_0x3916cf[_0x452ea3][_0x3795('0x6c')]?_0x3d60a5[_0x3916cf[_0x452ea3][_0x3795('0x6c')]][_0x3795('0x6d')]:_0x3916cf[_0x452ea3][_0x3795('0x74')];_0x5d6802=_0x3916cf[_0x452ea3][_0x3795('0x6e')]?_['replace'](_0x2526cb[_0x3916cf[_0x452ea3][_0x3795('0x6e')]],'%s',_0x5d6802):_0x5d6802;_0x5d6802=_0x3916cf[_0x452ea3][_0x3795('0x70')]?_[_0x3795('0x6f')](_0x373f4e[_0x3916cf[_0x452ea3][_0x3795('0x70')]],'%s',_0x5d6802):_0x5d6802;if(_0x3916cf[_0x452ea3]['groupBy']){_0x3ba2e8[_0x3795('0x64')](_0x5d6802);}_0x3916cf[_0x452ea3][_0x3795('0x72')]&&_0x3ba2e8['order'](_0x5d6802,_0x3916cf[_0x452ea3][_0x3795('0x72')]===_0x3795('0x73')?![]:!![]);_0x3ba2e8[_0x3795('0x74')](_0x5d6802,_0x3916cf[_0x452ea3][_0x3795('0x87')]||_0x5d6802);}if(_0x538785[_0x3795('0x75')]){_0x538785['joins']=JSON[_0x3795('0x76')](_0x538785['joins']);for(var _0x375aab=0x0;_0x375aab<_0x538785[_0x3795('0x75')][_0x3795('0x34')];_0x375aab+=0x1){if(_0x538785[_0x3795('0x75')][_0x375aab][_0x3795('0x2c')]&&_[_0x3795('0x5f')](_0x478537,_0x538785[_0x3795('0x75')][_0x375aab]['type'])&&_0x538785['joins'][_0x375aab][_0x3795('0x77')]&&_0x538785['joins'][_0x375aab][_0x3795('0x78')]&&_0x538785['joins'][_0x375aab][_0x3795('0x79')]){_0x3ba2e8[_0x538785[_0x3795('0x75')][_0x375aab]['type']](_0x538785[_0x3795('0x75')][_0x375aab][_0x3795('0x78')],null,util[_0x3795('0x70')]('%s.%s\x20=\x20%s.%s',_0x538785[_0x3795('0x6b')],_0x538785['joins'][_0x375aab][_0x3795('0x77')],_0x538785['joins'][_0x375aab][_0x3795('0x78')],_0x538785[_0x3795('0x75')][_0x375aab][_0x3795('0x79')]));}}}if(_0x538785['conditions']){_0x538785[_0x3795('0x7b')]=JSON[_0x3795('0x76')](_0x538785[_0x3795('0x7b')]);_0x3ba2e8[_0x3795('0x39')](_0x1fc76b(_0x538785[_0x3795('0x7b')][_0x3795('0x64')]));}_0x4f9b2f=_0x3ba2e8[_0x3795('0x88')]();_0x3ba2e8[_0x3795('0x1b')](_0x32c48b);_0x3ba2e8[_0x3795('0x1a')](0x0);logger[_0x3795('0x89')](_0x3795('0x7c'),_0x3ba2e8[_0x3795('0x7d')]());return db[_0x3795('0x7e')]['query'](_0x3ba2e8[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')][_0x3795('0x9f')]});}})['then'](function(){return{'sql':_0x4f9b2f[_0x3795('0x7d')]()};})[_0x3795('0x21')](respondWithResult(_0x4a5548,null))['catch'](handleError(_0x4a5548,null));}; \ No newline at end of file +var _0x989c=['metric','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','index','AnalyticDefaultReport','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','rawAttributes','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','keyBy','select','from','MetricId','function','format','replace','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','sequelize','toString','QueryTypes','SELECT','join','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','DESC','table','Limited\x20Query:','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','MIN(%s)','getFields'];(function(_0x1bb6aa,_0x40fe82){var _0x2ef28e=function(_0x32b4eb){while(--_0x32b4eb){_0x1bb6aa['push'](_0x1bb6aa['shift']());}};_0x2ef28e(++_0x40fe82);}(_0x989c,0x14d));var _0xc989=function(_0x2d53f8,_0x1a634b){_0x2d53f8=_0x2d53f8-0x0;var _0x529cdc=_0x989c[_0x2d53f8];return _0x529cdc;};'use strict';var pdf=require(_0xc989('0x0'));var emlformat=require(_0xc989('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc989('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc989('0x3'));var moment=require(_0xc989('0x4'));var BPromise=require(_0xc989('0x5'));var Mustache=require(_0xc989('0x6'));var util=require(_0xc989('0x7'));var path=require(_0xc989('0x8'));var sox=require(_0xc989('0x9'));var csv=require(_0xc989('0xa'));var ejs=require(_0xc989('0xb'));var fs=require('fs');var _=require(_0xc989('0xc'));var squel=require(_0xc989('0xd'));var crypto=require('crypto');var jsforce=require(_0xc989('0xe'));var deskjs=require(_0xc989('0xf'));var toCsv=require(_0xc989('0xa'));var querystring=require(_0xc989('0x10'));var Papa=require(_0xc989('0x11'));var Redis=require(_0xc989('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xc989('0x13'));var as=require(_0xc989('0x14'));var hardwareService=require(_0xc989('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xc989('0x16'));var config=require(_0xc989('0x17'));var db=require(_0xc989('0x18'))['db'];function respondWithStatusCode(_0x35a34a,_0x90e646){_0x90e646=_0x90e646||0xcc;return function(_0x4095fb){if(_0x4095fb){return _0x35a34a[_0xc989('0x19')](_0x90e646);}return _0x35a34a[_0xc989('0x1a')](_0x90e646)['end']();};}function respondWithResult(_0x11725f,_0x3a6859){_0x3a6859=_0x3a6859||0xc8;return function(_0x5379e3){if(_0x5379e3){return _0x11725f[_0xc989('0x1a')](_0x3a6859)[_0xc989('0x1b')](_0x5379e3);}};}function respondWithFilteredResult(_0x43094c,_0x65ba8b){return function(_0x45c2d3){if(_0x45c2d3){var _0x2b0f9f=_0x45c2d3[_0xc989('0x1c')],_0x450e0a=_0x65ba8b[_0xc989('0x1d')],_0x53c748=_0x65ba8b[_0xc989('0x1d')]+_0x65ba8b[_0xc989('0x1e')],_0x4a1cbe;if(_0x53c748>=_0x2b0f9f){_0x53c748=_0x2b0f9f;_0x4a1cbe=0xc8;}else{_0x4a1cbe=0xce;}_0x43094c[_0xc989('0x1a')](_0x4a1cbe);return _0x43094c[_0xc989('0x1f')](_0xc989('0x20'),_0x450e0a+'-'+_0x53c748+'/'+_0x2b0f9f)[_0xc989('0x1b')](_0x45c2d3);}return null;};}function patchUpdates(_0x396ca2){return function(_0x30baab){try{jsonpatch[_0xc989('0x21')](_0x30baab,_0x396ca2,!![]);}catch(_0x45abee){return BPromise[_0xc989('0x22')](_0x45abee);}return _0x30baab[_0xc989('0x23')]();};}function saveUpdates(_0x441606,_0x422eec){return function(_0x4bae09){if(_0x4bae09){return _0x4bae09[_0xc989('0x24')](_0x441606)[_0xc989('0x25')](function(_0x549213){return _0x549213;});}return null;};}function removeEntity(_0xe42e7f,_0xbeeafa){return function(_0x1251b9){if(_0x1251b9){return _0x1251b9[_0xc989('0x26')]()[_0xc989('0x25')](function(){var _0x555894=_0x1251b9[_0xc989('0x27')]({'plain':!![]});var _0x3657e3=_0xc989('0x28');return db[_0xc989('0x29')][_0xc989('0x26')]({'where':{'type':_0x3657e3,'resourceId':_0x555894['id']}})['then'](function(){return _0x1251b9;});})[_0xc989('0x25')](function(){_0xe42e7f['status'](0xcc)[_0xc989('0x2a')]();});}};}function handleEntityNotFound(_0x59eaa1,_0x359a2d){return function(_0x35e6f5){if(!_0x35e6f5){_0x59eaa1[_0xc989('0x19')](0x194);}return _0x35e6f5;};}function handleError(_0x587ef6,_0x44d310){_0x44d310=_0x44d310||0x1f4;return function(_0x1a4aff){logger[_0xc989('0x2b')](_0x1a4aff[_0xc989('0x2c')]);if(_0x1a4aff[_0xc989('0x2d')]){delete _0x1a4aff['name'];}_0x587ef6['status'](_0x44d310)['send'](_0x1a4aff);};}exports[_0xc989('0x2e')]=function(_0x5b06ca,_0x1476ec){var _0x559606={},_0x4e4442={},_0x36d6dd={'count':0x0,'rows':[]};var _0x3c2079=_['map'](db[_0xc989('0x2f')]['rawAttributes'],function(_0x2014aa){return{'name':_0x2014aa['fieldName'],'type':_0x2014aa[_0xc989('0x30')][_0xc989('0x31')]};});_0x4e4442[_0xc989('0x32')]=_[_0xc989('0x33')](_0x3c2079,_0xc989('0x2d'));_0x4e4442[_0xc989('0x34')]=_[_0xc989('0x35')](_0x5b06ca[_0xc989('0x34')]);_0x4e4442[_0xc989('0x36')]=_['intersection'](_0x4e4442[_0xc989('0x32')],_0x4e4442[_0xc989('0x34')]);_0x559606[_0xc989('0x37')]=_['intersection'](_0x4e4442[_0xc989('0x32')],qs[_0xc989('0x38')](_0x5b06ca[_0xc989('0x34')]['fields']));_0x559606[_0xc989('0x37')]=_0x559606[_0xc989('0x37')][_0xc989('0x39')]?_0x559606[_0xc989('0x37')]:_0x4e4442['model'];if(!_0x5b06ca[_0xc989('0x34')]['hasOwnProperty'](_0xc989('0x3a'))){_0x559606[_0xc989('0x1e')]=qs[_0xc989('0x1e')](_0x5b06ca[_0xc989('0x34')]['limit']);_0x559606[_0xc989('0x1d')]=qs[_0xc989('0x1d')](_0x5b06ca[_0xc989('0x34')][_0xc989('0x1d')]);}_0x559606[_0xc989('0x3b')]=qs[_0xc989('0x3c')](_0x5b06ca[_0xc989('0x34')][_0xc989('0x3c')]);_0x559606['where']=qs['filters'](_[_0xc989('0x3d')](_0x5b06ca[_0xc989('0x34')],_0x4e4442[_0xc989('0x36')]));if(_0x5b06ca[_0xc989('0x34')][_0xc989('0x3e')]){_0x559606[_0xc989('0x3f')]=_[_0xc989('0x40')](_0x559606[_0xc989('0x3f')],{'$or':_[_0xc989('0x33')](_0x3c2079,function(_0x5eaf3f){if(_0x5eaf3f[_0xc989('0x30')]!==_0xc989('0x41')){var _0x2db955={};_0x2db955[_0x5eaf3f[_0xc989('0x2d')]]={'$like':'%'+_0x5b06ca[_0xc989('0x34')][_0xc989('0x3e')]+'%'};return _0x2db955;}})});}_0x559606=_[_0xc989('0x40')]({},_0x559606,_0x5b06ca[_0xc989('0x42')]);var _0x4412e8={'where':_0x559606[_0xc989('0x3f')]};return db[_0xc989('0x2f')][_0xc989('0x1c')](_0x4412e8)[_0xc989('0x25')](function(_0x268d8e){_0x36d6dd[_0xc989('0x1c')]=_0x268d8e;if(_0x5b06ca[_0xc989('0x34')]['includeAll']){_0x559606[_0xc989('0x43')]=[{'all':!![]}];}return db[_0xc989('0x2f')][_0xc989('0x44')](_0x559606);})['then'](function(_0x2d6d0f){_0x36d6dd[_0xc989('0x45')]=_0x2d6d0f;return _0x36d6dd;})[_0xc989('0x25')](respondWithFilteredResult(_0x1476ec,_0x559606))['catch'](handleError(_0x1476ec,null));};exports[_0xc989('0x46')]=function(_0x3e2e0f,_0x1c6c35){var _0x37fedb={'raw':!![],'where':{'id':_0x3e2e0f['params']['id']}},_0x227cba={};_0x227cba[_0xc989('0x32')]=_[_0xc989('0x35')](db[_0xc989('0x2f')][_0xc989('0x47')]);_0x227cba[_0xc989('0x34')]=_['keys'](_0x3e2e0f[_0xc989('0x34')]);_0x227cba[_0xc989('0x36')]=_[_0xc989('0x48')](_0x227cba[_0xc989('0x32')],_0x227cba['query']);_0x37fedb[_0xc989('0x37')]=_[_0xc989('0x48')](_0x227cba[_0xc989('0x32')],qs[_0xc989('0x38')](_0x3e2e0f['query']['fields']));_0x37fedb[_0xc989('0x37')]=_0x37fedb['attributes'][_0xc989('0x39')]?_0x37fedb[_0xc989('0x37')]:_0x227cba[_0xc989('0x32')];if(_0x3e2e0f['query'][_0xc989('0x49')]){_0x37fedb['include']=[{'all':!![]}];}_0x37fedb=_[_0xc989('0x40')]({},_0x37fedb,_0x3e2e0f[_0xc989('0x42')]);return db[_0xc989('0x2f')][_0xc989('0x4a')](_0x37fedb)[_0xc989('0x25')](handleEntityNotFound(_0x1c6c35,null))[_0xc989('0x25')](respondWithResult(_0x1c6c35,null))['catch'](handleError(_0x1c6c35,null));};exports['create']=function(_0x3a967a,_0x15c3b5){return db[_0xc989('0x2f')][_0xc989('0x4b')](_0x3a967a[_0xc989('0x4c')],{})['then'](function(_0x397dcf){var _0xe4096e=_0x3a967a[_0xc989('0x4d')][_0xc989('0x27')]({'plain':!![]});if(!_0xe4096e)throw new Error(_0xc989('0x4e'));if(_0xe4096e[_0xc989('0x4f')]==='user'){var _0x362661=_0x397dcf[_0xc989('0x27')]({'plain':!![]});var _0x4258a4='Reports';return db[_0xc989('0x50')][_0xc989('0x4a')]({'where':{'name':_0x4258a4,'userProfileId':_0xe4096e['userProfileId']},'raw':!![]})['then'](function(_0x2f9bb1){if(_0x2f9bb1&&_0x2f9bb1[_0xc989('0x51')]===0x0){return db[_0xc989('0x29')][_0xc989('0x4b')]({'name':_0x362661[_0xc989('0x2d')],'resourceId':_0x362661['id'],'type':_0xc989('0x28'),'sectionId':_0x2f9bb1['id']},{})[_0xc989('0x25')](function(){return _0x397dcf;});}else{return _0x397dcf;}})[_0xc989('0x52')](function(_0x2358df){logger['error'](_0xc989('0x53'),_0x2358df);throw _0x2358df;});}return _0x397dcf;})[_0xc989('0x25')](respondWithResult(_0x15c3b5,0xc9))[_0xc989('0x52')](handleError(_0x15c3b5,null));};exports['update']=function(_0x307392,_0x20f296){if(_0x307392[_0xc989('0x4c')]['id']){delete _0x307392['body']['id'];}return db[_0xc989('0x2f')][_0xc989('0x4a')]({'where':{'id':_0x307392[_0xc989('0x54')]['id']}})['then'](handleEntityNotFound(_0x20f296,null))['then'](saveUpdates(_0x307392['body'],null))[_0xc989('0x25')](respondWithResult(_0x20f296,null))[_0xc989('0x52')](handleError(_0x20f296,null));};exports[_0xc989('0x26')]=function(_0x5d655f,_0x4464bc){return db[_0xc989('0x2f')][_0xc989('0x4a')]({'where':{'id':_0x5d655f[_0xc989('0x54')]['id']}})[_0xc989('0x25')](handleEntityNotFound(_0x4464bc,null))['then'](removeEntity(_0x4464bc,null))[_0xc989('0x52')](handleError(_0x4464bc,null));};exports[_0xc989('0x55')]=function(_0x13aeb6,_0x14adfd){var _0x410eee=0xa;var _0x5f3dd7=['join',_0xc989('0x56'),_0xc989('0x57'),_0xc989('0x58')];var _0x53a29c={'SUM':'SUM(%s)','COUNT':_0xc989('0x59'),'COUNT DISTINCT':_0xc989('0x5a'),'MAX':_0xc989('0x5b'),'MIN':'MIN(%s)','AVG':_0xc989('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc989('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4001ca={'SEC_TO_TIME':_0xc989('0x5e'),'DATE':_0xc989('0x5f'),'HOUR':_0xc989('0x60'),'ROUND':_0xc989('0x61'),'UNIX_TIMESTAMP':_0xc989('0x62')};var _0x5b0f63=function(_0x183cca){return!_[_0xc989('0x63')]([_0xc989('0x64'),_0xc989('0x65'),_0xc989('0x66'),_0xc989('0x67')],_0x183cca);};var _0x5d59b4=function(_0x5b35de){if(!_0x5b35de||!_0x5b35de[_0xc989('0x68')][_0xc989('0x39')]){return'';}for(var _0xff9b8a='(',_0x3d11f8=0x0;_0x3d11f8<_0x5b35de[_0xc989('0x68')][_0xc989('0x39')];_0x3d11f8+=0x1){_0x3d11f8>0x0&&(_0xff9b8a+='\x20'+_0x5b35de[_0xc989('0x69')]+'\x20');_0xff9b8a+=_0x5b35de[_0xc989('0x68')][_0x3d11f8][_0xc989('0x6a')]?_0x5d59b4(_0x5b35de[_0xc989('0x68')][_0x3d11f8][_0xc989('0x6a')]):_0x5b35de[_0xc989('0x68')][_0x3d11f8][_0xc989('0x6b')]+'\x20'+_0x5b35de['rules'][_0x3d11f8]['condition']+(_0x5b0f63(_0x5b35de[_0xc989('0x68')][_0x3d11f8][_0xc989('0x6c')])?'\x20'+_0x5b35de[_0xc989('0x68')][_0x3d11f8]['value']:'');}return _0xff9b8a+')';};var _0x356700={'where':{'id':_0x13aeb6['params']['id']}},_0x51b38b,_0x425d1b,_0x591bc8,_0x5d2af7,_0x3679fd;_0x356700=_[_0xc989('0x40')]({},_0x356700,_0x13aeb6[_0xc989('0x42')]);return db[_0xc989('0x2f')]['find'](_0x356700)[_0xc989('0x25')](function(_0x4738d9){if(_0x4738d9){_0x51b38b=_0x4738d9;return _0x4738d9['getFields']();}return null;})[_0xc989('0x25')](function(_0x383793){if(_0x383793){if(!_0x383793[_0xc989('0x39')]){throw new db[(_0xc989('0x6d'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x425d1b=_0x383793;return db['AnalyticMetric'][_0xc989('0x44')]({'raw':!![]});}return null;})['then'](function(_0x20034e){if(_0x20034e){_0x591bc8=_[_0xc989('0x6e')](_0x20034e,'id');var _0xcfee13;var _0x36bf8f=squel[_0xc989('0x6f')]();_0x36bf8f[_0xc989('0x70')](_0x51b38b['table']);for(var _0x97e735=0x0;_0x97e735<_0x425d1b[_0xc989('0x39')];_0x97e735+=0x1){_0xcfee13=_0x425d1b[_0x97e735]['MetricId']?_0x591bc8[_0x425d1b[_0x97e735][_0xc989('0x71')]]['metric']:_0x425d1b[_0x97e735]['field'];_0xcfee13=_0x425d1b[_0x97e735]['function']?_['replace'](_0x53a29c[_0x425d1b[_0x97e735][_0xc989('0x72')]],'%s',_0xcfee13):_0xcfee13;_0xcfee13=_0x425d1b[_0x97e735][_0xc989('0x73')]?_[_0xc989('0x74')](_0x4001ca[_0x425d1b[_0x97e735][_0xc989('0x73')]],'%s',_0xcfee13):_0xcfee13;if(_0x425d1b[_0x97e735][_0xc989('0x75')]){_0x36bf8f[_0xc989('0x6a')](_0xcfee13);}_0x425d1b[_0x97e735][_0xc989('0x76')]&&_0x36bf8f[_0xc989('0x3b')](_0xcfee13,_0x425d1b[_0x97e735][_0xc989('0x76')]==='DESC'?![]:!![]);_0x36bf8f[_0xc989('0x6b')](_0xcfee13,_0x425d1b[_0x97e735][_0xc989('0x77')]||_0xcfee13);}if(_0x51b38b[_0xc989('0x78')]){_0x51b38b[_0xc989('0x78')]=JSON[_0xc989('0x79')](_0x51b38b[_0xc989('0x78')]);for(var _0x5d4bb9=0x0;_0x5d4bb9<_0x51b38b['joins'][_0xc989('0x39')];_0x5d4bb9+=0x1){if(_0x51b38b['joins'][_0x5d4bb9]['type']&&_['includes'](_0x5f3dd7,_0x51b38b['joins'][_0x5d4bb9][_0xc989('0x30')])&&_0x51b38b[_0xc989('0x78')][_0x5d4bb9][_0xc989('0x7a')]&&_0x51b38b[_0xc989('0x78')][_0x5d4bb9][_0xc989('0x7b')]&&_0x51b38b[_0xc989('0x78')][_0x5d4bb9][_0xc989('0x7c')]){_0x36bf8f[_0x51b38b[_0xc989('0x78')][_0x5d4bb9]['type']](_0x51b38b['joins'][_0x5d4bb9][_0xc989('0x7b')],null,util[_0xc989('0x73')](_0xc989('0x7d'),_0x51b38b['table'],_0x51b38b[_0xc989('0x78')][_0x5d4bb9]['parentKey'],_0x51b38b['joins'][_0x5d4bb9][_0xc989('0x7b')],_0x51b38b['joins'][_0x5d4bb9][_0xc989('0x7c')]));}}}if(_0x51b38b['conditions']){_0x51b38b[_0xc989('0x7e')]=JSON[_0xc989('0x79')](_0x51b38b[_0xc989('0x7e')]);_0x36bf8f[_0xc989('0x3f')](_0x5d59b4(_0x51b38b[_0xc989('0x7e')][_0xc989('0x6a')]));}_0x3679fd=_0x36bf8f[_0xc989('0x7f')]();_0x36bf8f['limit'](_0x410eee);_0x36bf8f[_0xc989('0x1d')](0x0);logger[_0xc989('0x80')]('Limited\x20Query:',_0x36bf8f['toString']());return db[_0xc989('0x81')][_0xc989('0x34')](_0x36bf8f[_0xc989('0x82')](),{'type':db['sequelize'][_0xc989('0x83')][_0xc989('0x84')]});}})['then'](respondWithResult(_0x14adfd,null))['catch'](handleError(_0x14adfd,null));};function runReport(_0x278539,_0x5e2505,_0x2b07ae){var _0x3e5254=_0x5e2505[_0xc989('0x2d')];var _0x561c49=0xa;var _0x4e9062=[_0xc989('0x85'),_0xc989('0x56'),'right_join',_0xc989('0x58')];var _0x3955a5={'SUM':_0xc989('0x86'),'COUNT':_0xc989('0x59'),'COUNT DISTINCT':_0xc989('0x5a'),'MAX':_0xc989('0x5b'),'MIN':'MIN(%s)','AVG':_0xc989('0x5c'),'GROUP_CONCAT':_0xc989('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc989('0x88')};var _0x5b101c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc989('0x5f'),'HOUR':_0xc989('0x60'),'ROUND':_0xc989('0x61'),'UNIX_TIMESTAMP':_0xc989('0x62')};var _0x360f38=function(_0x410577){return!_[_0xc989('0x63')](['IS\x20NULL',_0xc989('0x65'),_0xc989('0x66'),_0xc989('0x67')],_0x410577);};var _0x3c6d5a=function(_0x521ea8){if(!_0x521ea8||!_0x521ea8[_0xc989('0x68')][_0xc989('0x39')]){return'';}for(var _0x347685='(',_0x1f99c2=0x0;_0x1f99c2<_0x521ea8[_0xc989('0x68')][_0xc989('0x39')];_0x1f99c2+=0x1){_0x1f99c2>0x0&&(_0x347685+='\x20'+_0x521ea8['operator']+'\x20');_0x347685+=_0x521ea8[_0xc989('0x68')][_0x1f99c2][_0xc989('0x6a')]?_0x3c6d5a(_0x521ea8[_0xc989('0x68')][_0x1f99c2][_0xc989('0x6a')]):_0x521ea8[_0xc989('0x68')][_0x1f99c2][_0xc989('0x6b')]+'\x20'+_0x521ea8[_0xc989('0x68')][_0x1f99c2]['condition']+(_0x360f38(_0x521ea8['rules'][_0x1f99c2][_0xc989('0x6c')])?'\x20'+_0x521ea8['rules'][_0x1f99c2][_0xc989('0x89')]:'');}return _0x347685+')';};var _0x4e64da={'where':{'id':_0x278539['id']}},_0xdf452a,_0xedd7d4,_0x25d959,_0x309b44,_0x165a04;_0x4e64da=_[_0xc989('0x40')]({},_0x4e64da,_0x2b07ae);return db[_0xc989('0x2f')]['find'](_0x4e64da)['then'](function(_0xa8cbf9){if(_0xa8cbf9){_0xdf452a=_0xa8cbf9;return _0xa8cbf9['getFields']();}return null;})['then'](function(_0x2ee229){if(_0x2ee229){if(!_0x2ee229[_0xc989('0x39')]){throw new db[(_0xc989('0x6d'))][(_0xc989('0x8a'))](_0xc989('0x8b'),0x193);}_0xedd7d4=_0x2ee229;return db[_0xc989('0x8c')][_0xc989('0x44')]({'raw':!![]});}return null;})[_0xc989('0x25')](function(_0x7a2da6){if(_0x7a2da6){_0x25d959=_[_0xc989('0x6e')](_0x7a2da6,'id');var _0x21d147;var _0x29280c=squel[_0xc989('0x6f')]();_0x29280c[_0xc989('0x70')](_0xdf452a['table']);for(var _0x538317=0x0;_0x538317<_0xedd7d4['length'];_0x538317+=0x1){_0x21d147=_0xedd7d4[_0x538317]['MetricId']?_0x25d959[_0xedd7d4[_0x538317]['MetricId']]['metric']:_0xedd7d4[_0x538317][_0xc989('0x6b')];_0x21d147=_0xedd7d4[_0x538317]['function']?_['replace'](_0x3955a5[_0xedd7d4[_0x538317]['function']],'%s',_0x21d147):_0x21d147;_0x21d147=_0xedd7d4[_0x538317][_0xc989('0x73')]?_[_0xc989('0x74')](_0x5b101c[_0xedd7d4[_0x538317][_0xc989('0x73')]],'%s',_0x21d147):_0x21d147;if(_0xedd7d4[_0x538317]['groupBy']){_0x29280c[_0xc989('0x6a')](_0x21d147);}_0xedd7d4[_0x538317][_0xc989('0x76')]&&_0x29280c[_0xc989('0x3b')](_0x21d147,_0xedd7d4[_0x538317][_0xc989('0x76')]===_0xc989('0x8d')?![]:!![]);_0x29280c['field'](_0x21d147,_0xedd7d4[_0x538317]['alias']||_0x21d147);}if(_0xdf452a[_0xc989('0x78')]){_0xdf452a[_0xc989('0x78')]=JSON[_0xc989('0x79')](_0xdf452a['joins']);for(var _0x43f07e=0x0;_0x43f07e<_0xdf452a[_0xc989('0x78')][_0xc989('0x39')];_0x43f07e+=0x1){if(_0xdf452a[_0xc989('0x78')][_0x43f07e]['type']&&_[_0xc989('0x63')](_0x4e9062,_0xdf452a['joins'][_0x43f07e][_0xc989('0x30')])&&_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x7a')]&&_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x7b')]&&_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x7c')]){_0x29280c[_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x30')]](_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x7b')],null,util[_0xc989('0x73')](_0xc989('0x7d'),_0xdf452a[_0xc989('0x8e')],_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x7a')],_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x7b')],_0xdf452a[_0xc989('0x78')][_0x43f07e][_0xc989('0x7c')]));}}}if(_0xdf452a[_0xc989('0x7e')]){_0xdf452a[_0xc989('0x7e')]=JSON[_0xc989('0x79')](_0xdf452a[_0xc989('0x7e')]);_0x29280c['where'](_0x3c6d5a(_0xdf452a[_0xc989('0x7e')]['group']));}_0x165a04=_0x29280c['clone']();_0x29280c[_0xc989('0x1e')](_0x561c49);_0x29280c[_0xc989('0x1d')](0x0);logger[_0xc989('0x80')](_0xc989('0x8f'),_0x29280c[_0xc989('0x82')]());return db[_0xc989('0x81')][_0xc989('0x34')](_0x29280c['toString'](),{'type':db['sequelize'][_0xc989('0x83')][_0xc989('0x84')]});}})[_0xc989('0x25')](function(_0x56be65){if(!_0x56be65['length']){throw new db['Sequelize']['ValidationErrorItem'](_0xc989('0x90'),0xcc);}if(_0x5e2505[_0xc989('0x91')]===_0xc989('0x92')){return null;}var _0x2aa37f=_[_0xc989('0x40')](_0x5e2505,{'name':_0x5e2505[_0xc989('0x93')]||_0x5e2505[_0xc989('0x2d')]||_0xdf452a[_0xc989('0x2d')],'basename':_0x3e5254,'savename':util['format'](_0xc989('0x94'),_0x5e2505['name']||_0xdf452a[_0xc989('0x2d')],require(_0xc989('0x95'))['generate'](0x4),_0x5e2505['output']||_0xc989('0x96')),'reportId':_0xdf452a['id'],'reportType':_0xc989('0x97')});return db[_0xc989('0x98')]['create'](_0x2aa37f,{'raw':!![]});})['then'](function(_0x1c8184){if(_0xdf452a[_0xc989('0x8e')]==='cdr'){_0x165a04[_0xc989('0x3f')](_0xdf452a[_0xc989('0x8e')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5e2505[_0xc989('0x99')],_0x5e2505['endDate']);}else{_0x165a04['where'](_0xdf452a[_0xc989('0x8e')]+_0xc989('0x9a'),_0x5e2505[_0xc989('0x99')],_0x5e2505[_0xc989('0x9b')]);}if(_0x1c8184){logger[_0xc989('0x9c')](_0xc989('0x9d'),_0x165a04[_0xc989('0x82')]());require(_0xc989('0x9e'))['fork'](path[_0xc989('0x85')](__dirname,_0xc989('0x9f'),_0x1c8184['output']),[_0x1c8184['id'],_0x165a04[_0xc989('0x82')](),path['join'](__dirname,_0xc989('0xa0'),_0x1c8184['savename']),_0x3e5254]);return _0x1c8184;}else{var _0x385a6d=squel[_0xc989('0x6f')]();_0x385a6d[_0xc989('0x70')]('('+_0x165a04[_0xc989('0x82')]()+')',_0xc989('0xa1'));_0x385a6d[_0xc989('0x6b')](_0xc989('0xa2'),_0xc989('0x1c'));_0x165a04['limit'](_0x5e2505[_0xc989('0x1e')]||_0x561c49);_0x165a04[_0xc989('0x1d')](_0x5e2505['offset']||0x0);return db[_0xc989('0x81')]['query'](_0x385a6d['toString'](),{'type':db[_0xc989('0x81')][_0xc989('0x83')][_0xc989('0x84')]})[_0xc989('0x25')](function(_0xc7009f){if(!_0xc7009f['length']){_0x309b44=0x0;}else{_0x309b44=_0xc7009f[0x0][_0xc989('0x1c')]||0x0;}return db[_0xc989('0x81')][_0xc989('0x34')](_0x165a04['toString'](),{'type':db['sequelize'][_0xc989('0x83')][_0xc989('0x84')]});})['then'](function(_0x5e5fe4){return{'rows':_0x5e5fe4||[],'count':_0x309b44};});}});}exports['run']=function(_0x3f13ec,_0x556c5c){return runReport(_0x3f13ec[_0xc989('0x54')],_0x3f13ec[_0xc989('0x34')],_0x3f13ec['options'])['then'](respondWithResult(_0x556c5c,null))[_0xc989('0x52')](handleError(_0x556c5c,null));};exports['runReport']=runReport;exports[_0xc989('0x34')]=function(_0x5bfc0d,_0x32e54d){var _0x4b2cc3=0xa;var _0xf4a930=[_0xc989('0x85'),_0xc989('0x56'),_0xc989('0x57'),_0xc989('0x58')];var _0x3ef17d={'SUM':_0xc989('0x86'),'COUNT':_0xc989('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xc989('0x5b'),'MIN':_0xc989('0xa3'),'AVG':_0xc989('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc989('0x5d'),'GROUP_CONCAT DESC':_0xc989('0x88')};var _0x3e1f88={'SEC_TO_TIME':_0xc989('0x5e'),'DATE':'DATE(%s)','HOUR':_0xc989('0x60'),'ROUND':_0xc989('0x61'),'UNIX_TIMESTAMP':_0xc989('0x62')};var _0x1e0267=function(_0x3222b8){return!_[_0xc989('0x63')]([_0xc989('0x64'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x3222b8);};var _0xe9a8d2=function(_0x50ff3f){if(!_0x50ff3f||!_0x50ff3f[_0xc989('0x68')][_0xc989('0x39')]){return'';}for(var _0x7f0a0='(',_0x399010=0x0;_0x399010<_0x50ff3f[_0xc989('0x68')]['length'];_0x399010+=0x1){_0x399010>0x0&&(_0x7f0a0+='\x20'+_0x50ff3f['operator']+'\x20');_0x7f0a0+=_0x50ff3f[_0xc989('0x68')][_0x399010][_0xc989('0x6a')]?_0xe9a8d2(_0x50ff3f[_0xc989('0x68')][_0x399010][_0xc989('0x6a')]):_0x50ff3f[_0xc989('0x68')][_0x399010]['field']+'\x20'+_0x50ff3f['rules'][_0x399010][_0xc989('0x6c')]+(_0x1e0267(_0x50ff3f[_0xc989('0x68')][_0x399010][_0xc989('0x6c')])?'\x20'+_0x50ff3f[_0xc989('0x68')][_0x399010][_0xc989('0x89')]:'');}return _0x7f0a0+')';};var _0x46ebe2={'where':{'id':_0x5bfc0d[_0xc989('0x54')]['id']}},_0x45905f,_0x154537,_0x57db62,_0x17f6e0,_0x5dd11b;_0x46ebe2=_[_0xc989('0x40')]({},_0x46ebe2,_0x5bfc0d[_0xc989('0x42')]);return db[_0xc989('0x2f')]['find'](_0x46ebe2)[_0xc989('0x25')](function(_0x26fb00){if(_0x26fb00){_0x45905f=_0x26fb00;return _0x26fb00[_0xc989('0xa4')]();}return null;})['then'](function(_0x3c7266){if(_0x3c7266){if(!_0x3c7266[_0xc989('0x39')]){throw new db[(_0xc989('0x6d'))][(_0xc989('0x8a'))](_0xc989('0x8b'),0x193);}_0x154537=_0x3c7266;return db[_0xc989('0x8c')][_0xc989('0x44')]({'raw':!![]});}return null;})[_0xc989('0x25')](function(_0x4dda72){if(_0x4dda72){_0x57db62=_[_0xc989('0x6e')](_0x4dda72,'id');var _0xc70039;var _0x25ec15=squel[_0xc989('0x6f')]();_0x25ec15[_0xc989('0x70')](_0x45905f[_0xc989('0x8e')]);for(var _0x52455e=0x0;_0x52455e<_0x154537['length'];_0x52455e+=0x1){_0xc70039=_0x154537[_0x52455e][_0xc989('0x71')]?_0x57db62[_0x154537[_0x52455e][_0xc989('0x71')]][_0xc989('0xa5')]:_0x154537[_0x52455e]['field'];_0xc70039=_0x154537[_0x52455e]['function']?_[_0xc989('0x74')](_0x3ef17d[_0x154537[_0x52455e][_0xc989('0x72')]],'%s',_0xc70039):_0xc70039;_0xc70039=_0x154537[_0x52455e][_0xc989('0x73')]?_['replace'](_0x3e1f88[_0x154537[_0x52455e][_0xc989('0x73')]],'%s',_0xc70039):_0xc70039;if(_0x154537[_0x52455e]['groupBy']){_0x25ec15['group'](_0xc70039);}_0x154537[_0x52455e][_0xc989('0x76')]&&_0x25ec15[_0xc989('0x3b')](_0xc70039,_0x154537[_0x52455e][_0xc989('0x76')]===_0xc989('0x8d')?![]:!![]);_0x25ec15[_0xc989('0x6b')](_0xc70039,_0x154537[_0x52455e][_0xc989('0x77')]||_0xc70039);}if(_0x45905f[_0xc989('0x78')]){_0x45905f[_0xc989('0x78')]=JSON['parse'](_0x45905f[_0xc989('0x78')]);for(var _0x297a86=0x0;_0x297a86<_0x45905f[_0xc989('0x78')][_0xc989('0x39')];_0x297a86+=0x1){if(_0x45905f[_0xc989('0x78')][_0x297a86][_0xc989('0x30')]&&_['includes'](_0xf4a930,_0x45905f[_0xc989('0x78')][_0x297a86][_0xc989('0x30')])&&_0x45905f[_0xc989('0x78')][_0x297a86][_0xc989('0x7a')]&&_0x45905f[_0xc989('0x78')][_0x297a86][_0xc989('0x7b')]&&_0x45905f['joins'][_0x297a86]['foreignKey']){_0x25ec15[_0x45905f[_0xc989('0x78')][_0x297a86][_0xc989('0x30')]](_0x45905f[_0xc989('0x78')][_0x297a86]['foreignTable'],null,util['format'](_0xc989('0x7d'),_0x45905f[_0xc989('0x8e')],_0x45905f[_0xc989('0x78')][_0x297a86]['parentKey'],_0x45905f[_0xc989('0x78')][_0x297a86][_0xc989('0x7b')],_0x45905f[_0xc989('0x78')][_0x297a86][_0xc989('0x7c')]));}}}if(_0x45905f[_0xc989('0x7e')]){_0x45905f[_0xc989('0x7e')]=JSON[_0xc989('0x79')](_0x45905f[_0xc989('0x7e')]);_0x25ec15[_0xc989('0x3f')](_0xe9a8d2(_0x45905f[_0xc989('0x7e')][_0xc989('0x6a')]));}_0x5dd11b=_0x25ec15[_0xc989('0x7f')]();_0x25ec15[_0xc989('0x1e')](_0x4b2cc3);_0x25ec15[_0xc989('0x1d')](0x0);logger[_0xc989('0x80')](_0xc989('0x8f'),_0x25ec15[_0xc989('0x82')]());return db[_0xc989('0x81')][_0xc989('0x34')](_0x25ec15[_0xc989('0x82')](),{'type':db[_0xc989('0x81')]['QueryTypes'][_0xc989('0x84')]});}})[_0xc989('0x25')](function(){return{'sql':_0x5dd11b[_0xc989('0x82')]()};})['then'](respondWithResult(_0x32e54d,null))[_0xc989('0x52')](handleError(_0x32e54d,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 619b3d9..a3d4fe8 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 _0x038d=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x482b06,_0x475ea9){var _0x404a0a=function(_0x20c047){while(--_0x20c047){_0x482b06['push'](_0x482b06['shift']());}};_0x404a0a(++_0x475ea9);}(_0x038d,0xae));var _0xd038=function(_0x2f446e,_0x87369d){_0x2f446e=_0x2f446e-0x0;var _0x1a1e5f=_0x038d[_0x2f446e];return _0x1a1e5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd038('0x0'))(_0xd038('0x1'));var moment=require(_0xd038('0x2'));var BPromise=require(_0xd038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd038('0x4'));var config=require(_0xd038('0x5'));var attributes=require(_0xd038('0x6'));module['exports']=function(_0x5b709c,_0x5d549e){return _0x5b709c[_0xd038('0x7')](_0xd038('0x8'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2152=['request-promise','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','lodash','../../config/logger','api'];(function(_0x40822a,_0x582b60){var _0x357420=function(_0x6cee0b){while(--_0x6cee0b){_0x40822a['push'](_0x40822a['shift']());}};_0x357420(++_0x582b60);}(_0x2152,0x9e));var _0x2215=function(_0x22d60d,_0x4b2b29){_0x22d60d=_0x22d60d-0x0;var _0x3f26d5=_0x2152[_0x22d60d];return _0x3f26d5;};'use strict';var _=require(_0x2215('0x0'));var util=require('util');var logger=require(_0x2215('0x1'))(_0x2215('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2215('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2215('0x4'));module['exports']=function(_0x3570d4,_0x26c2d0){return _0x3570d4[_0x2215('0x5')](_0x2215('0x6'),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 ae88c54..aa8a232 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 _0x2bb0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x27888d,_0x5ea940){var _0x5c4975=function(_0xc9d8e2){while(--_0xc9d8e2){_0x27888d['push'](_0x27888d['shift']());}};_0x5c4975(++_0x5ea940);}(_0x2bb0,0xf3));var _0x02bb=function(_0x5e1ab4,_0x424a14){_0x5e1ab4=_0x5e1ab4-0x0;var _0x1edc59=_0x2bb0[_0x5e1ab4];return _0x1edc59;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb7c,_0x440f9c,_0x47d7ae){return new BPromise(function(_0x6d064a,_0x15e425){return client[_0x02bb('0xa')](_0x16bb7c,_0x47d7ae)['then'](function(_0x3d28d5){logger['info'](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));logger['debug'](_0x02bb('0xd'),_0x440f9c,_0x02bb('0xc'),JSON[_0x02bb('0xe')](_0x3d28d5));if(_0x3d28d5['error']){if(_0x3d28d5[_0x02bb('0xf')]['code']===0x1f4){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x15e425(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}logger[_0x02bb('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x6d064a(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}else{logger[_0x02bb('0x11')](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));_0x6d064a(_0x3d28d5[_0x02bb('0x12')]['message']);}})['catch'](function(_0x4711fb){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x4711fb);_0x15e425(_0x4711fb);});});} \ No newline at end of file +var _0xcbe1=['then','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request'];(function(_0x28c72a,_0x2bb385){var _0x3c14e3=function(_0x460792){while(--_0x460792){_0x28c72a['push'](_0x28c72a['shift']());}};_0x3c14e3(++_0x2bb385);}(_0xcbe1,0x1a2));var _0x1cbe=function(_0x5936c8,_0x5731e9){_0x5936c8=_0x5936c8-0x0;var _0x1dff51=_0xcbe1[_0x5936c8];return _0x1dff51;};'use strict';var _=require('lodash');var util=require(_0x1cbe('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1cbe('0x1'))['db'];var utils=require(_0x1cbe('0x2'));var logger=require('../../config/logger')(_0x1cbe('0x3'));var config=require('../../config/environment');var jayson=require(_0x1cbe('0x4'));var client=jayson[_0x1cbe('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a02c7,_0x21342a,_0x3882e1){return new BPromise(function(_0x18e76b,_0x21b2a5){return client[_0x1cbe('0x6')](_0x1a02c7,_0x3882e1)[_0x1cbe('0x7')](function(_0x42232d){logger['info'](_0x1cbe('0x8'),_0x21342a,'request\x20sent');logger[_0x1cbe('0x9')](_0x1cbe('0xa'),_0x21342a,_0x1cbe('0xb'),JSON[_0x1cbe('0xc')](_0x42232d));if(_0x42232d['error']){if(_0x42232d[_0x1cbe('0xd')]['code']===0x1f4){logger[_0x1cbe('0xd')](_0x1cbe('0x8'),_0x21342a,_0x42232d['error'][_0x1cbe('0xe')]);return _0x21b2a5(_0x42232d[_0x1cbe('0xd')][_0x1cbe('0xe')]);}logger['error'](_0x1cbe('0x8'),_0x21342a,_0x42232d[_0x1cbe('0xd')][_0x1cbe('0xe')]);return _0x18e76b(_0x42232d[_0x1cbe('0xd')][_0x1cbe('0xe')]);}else{logger[_0x1cbe('0xf')](_0x1cbe('0x8'),_0x21342a,_0x1cbe('0xb'));_0x18e76b(_0x42232d[_0x1cbe('0x10')][_0x1cbe('0xe')]);}})['catch'](function(_0x228488){logger[_0x1cbe('0xd')](_0x1cbe('0x8'),_0x21342a,_0x228488);_0x21b2a5(_0x228488);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b23a9eb..0f0ebd8 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 _0x3a14=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x5e99c7,_0x1abe64){var _0xd2e721=function(_0x41f2fc){while(--_0x41f2fc){_0x5e99c7['push'](_0x5e99c7['shift']());}};_0xd2e721(++_0x1abe64);}(_0x3a14,0xdf));var _0x43a1=function(_0x1c625a,_0x1b0d84){_0x1c625a=_0x1c625a-0x0;var _0x354170=_0x3a14[_0x1c625a];return _0x354170;};'use strict';var multer=require(_0x43a1('0x0'));var util=require(_0x43a1('0x1'));var path=require(_0x43a1('0x2'));var timeout=require(_0x43a1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x43a1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43a1('0x5'));var controller=require(_0x43a1('0x6'));router[_0x43a1('0x7')]('/',auth[_0x43a1('0x8')](),controller[_0x43a1('0x9')]);router[_0x43a1('0x7')](_0x43a1('0xa'),auth[_0x43a1('0x8')](),controller[_0x43a1('0xb')]);router[_0x43a1('0x7')](_0x43a1('0xc'),auth[_0x43a1('0x8')](),controller[_0x43a1('0xd')]);router['get'](_0x43a1('0xe'),auth[_0x43a1('0x8')](),controller[_0x43a1('0xf')]);router['get'](_0x43a1('0x10'),auth['isAuthenticated'](),controller['query']);router[_0x43a1('0x11')]('/',auth[_0x43a1('0x8')](),controller[_0x43a1('0x12')]);router[_0x43a1('0x13')](_0x43a1('0xa'),auth[_0x43a1('0x8')](),controller[_0x43a1('0x14')]);router[_0x43a1('0x15')](_0x43a1('0xa'),auth[_0x43a1('0x8')](),controller[_0x43a1('0x16')]);module['exports']=router; \ No newline at end of file +var _0x5e16=['update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/preview','preview','/:id/run','run','query','post','create','put'];(function(_0x552434,_0x27faf4){var _0x4d4d56=function(_0x4cd35e){while(--_0x4cd35e){_0x552434['push'](_0x552434['shift']());}};_0x4d4d56(++_0x27faf4);}(_0x5e16,0x8d));var _0x65e1=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0x5e16[_0x11f5ff];return _0x46eefb;};'use strict';var multer=require(_0x65e1('0x0'));var util=require(_0x65e1('0x1'));var path=require(_0x65e1('0x2'));var timeout=require(_0x65e1('0x3'));var express=require('express');var router=express[_0x65e1('0x4')]();var auth=require(_0x65e1('0x5'));var interaction=require(_0x65e1('0x6'));var config=require(_0x65e1('0x7'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x65e1('0x8')](),controller['index']);router[_0x65e1('0x9')](_0x65e1('0xa'),auth[_0x65e1('0x8')](),controller[_0x65e1('0xb')]);router[_0x65e1('0x9')](_0x65e1('0xc'),auth[_0x65e1('0x8')](),controller[_0x65e1('0xd')]);router[_0x65e1('0x9')](_0x65e1('0xe'),auth['isAuthenticated'](),controller[_0x65e1('0xf')]);router[_0x65e1('0x9')]('/:id/query',auth[_0x65e1('0x8')](),controller[_0x65e1('0x10')]);router[_0x65e1('0x11')]('/',auth[_0x65e1('0x8')](),controller[_0x65e1('0x12')]);router[_0x65e1('0x13')](_0x65e1('0xa'),auth[_0x65e1('0x8')](),controller[_0x65e1('0x14')]);router[_0x65e1('0x15')](_0x65e1('0xa'),auth['isAuthenticated'](),controller[_0x65e1('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index b428239..9f22f18 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 _0x0722=['pdf','xlsx','DATE','Loading','manual','INTEGER','sequelize','moment','exports','STRING','ENUM'];(function(_0x587f44,_0x1a9b10){var _0x531a29=function(_0x365c99){while(--_0x365c99){_0x587f44['push'](_0x587f44['shift']());}};_0x531a29(++_0x1a9b10);}(_0x0722,0x13a));var _0x2072=function(_0x1094c7,_0x35a488){_0x1094c7=_0x1094c7-0x0;var _0x391162=_0x0722[_0x1094c7];return _0x391162;};'use strict';var Sequelize=require(_0x2072('0x0'));var moment=require(_0x2072('0x1'));module[_0x2072('0x2')]={'name':{'type':Sequelize[_0x2072('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2072('0x4')]('csv',_0x2072('0x5'),_0x2072('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2072('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2072('0x7')]},'endDate':{'type':Sequelize[_0x2072('0x7')]},'status':{'type':Sequelize[_0x2072('0x3')],'defaultValue':_0x2072('0x8')},'type':{'type':Sequelize[_0x2072('0x4')](_0x2072('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x2072('0x9')},'reportId':{'type':Sequelize[_0x2072('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2072('0x3')]}}; \ No newline at end of file +var _0xcedd=['Loading','scheduled','manual','INTEGER','UNSIGNED','sequelize','exports','STRING','ENUM','csv','DATE'];(function(_0x2765e1,_0xb416f7){var _0x3f6fb1=function(_0x36f7ab){while(--_0x36f7ab){_0x2765e1['push'](_0x2765e1['shift']());}};_0x3f6fb1(++_0xb416f7);}(_0xcedd,0x17b));var _0xdced=function(_0x1d9fa4,_0x15b61d){_0x1d9fa4=_0x1d9fa4-0x0;var _0x26b93b=_0xcedd[_0x1d9fa4];return _0x26b93b;};'use strict';var Sequelize=require(_0xdced('0x0'));var moment=require('moment');module[_0xdced('0x1')]={'name':{'type':Sequelize[_0xdced('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xdced('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xdced('0x3')](_0xdced('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xdced('0x4')},'savename':{'type':Sequelize[_0xdced('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xdced('0x5')]},'endDate':{'type':Sequelize[_0xdced('0x5')]},'status':{'type':Sequelize[_0xdced('0x2')],'defaultValue':_0xdced('0x6')},'type':{'type':Sequelize[_0xdced('0x3')]('manual',_0xdced('0x7')),'allowNull':![],'defaultValue':_0xdced('0x8')},'reportId':{'type':Sequelize[_0xdced('0x9')](0xb)[_0xdced('0xa')]},'reportType':{'type':Sequelize[_0xdced('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index bdb0859..13f60ae 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 _0xc657=['length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','format','%s.%s','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes'];(function(_0x9a7dd3,_0x315993){var _0x3101d=function(_0x59ba1f){while(--_0x59ba1f){_0x9a7dd3['push'](_0x9a7dd3['shift']());}};_0x3101d(++_0x315993);}(_0xc657,0xda));var _0x7c65=function(_0x129681,_0x2f91b4){_0x129681=_0x129681-0x0;var _0x2c1b12=_0xc657[_0x129681];return _0x2c1b12;};'use strict';var pdf=require(_0x7c65('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c65('0x1'));var jsonpatch=require(_0x7c65('0x2'));var rp=require(_0x7c65('0x3'));var moment=require(_0x7c65('0x4'));var BPromise=require(_0x7c65('0x5'));var Mustache=require(_0x7c65('0x6'));var util=require('util');var path=require(_0x7c65('0x7'));var sox=require(_0x7c65('0x8'));var csv=require(_0x7c65('0x9'));var ejs=require(_0x7c65('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7c65('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c65('0xc'));var toCsv=require(_0x7c65('0x9'));var querystring=require(_0x7c65('0xd'));var Papa=require(_0x7c65('0xe'));var Redis=require(_0x7c65('0xf'));var authService=require(_0x7c65('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7c65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c65('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7c65('0x13'))['db'];function respondWithStatusCode(_0x143f77,_0x715be4){_0x715be4=_0x715be4||0xcc;return function(_0x9fad46){if(_0x9fad46){return _0x143f77[_0x7c65('0x14')](_0x715be4);}return _0x143f77[_0x7c65('0x15')](_0x715be4)['end']();};}function respondWithResult(_0x3ed69b,_0x44323d){_0x44323d=_0x44323d||0xc8;return function(_0x176e8a){if(_0x176e8a){return _0x3ed69b[_0x7c65('0x15')](_0x44323d)['json'](_0x176e8a);}};}function respondWithFilteredResult(_0x26c6ba,_0xf90f5b){return function(_0x501ee2){if(_0x501ee2){var _0x4194a4=_0x501ee2[_0x7c65('0x16')],_0xff887a=_0xf90f5b['offset'],_0x460110=_0xf90f5b[_0x7c65('0x17')]+_0xf90f5b[_0x7c65('0x18')],_0x3daad5;if(_0x460110>=_0x4194a4){_0x460110=_0x4194a4;_0x3daad5=0xc8;}else{_0x3daad5=0xce;}_0x26c6ba[_0x7c65('0x15')](_0x3daad5);return _0x26c6ba[_0x7c65('0x19')](_0x7c65('0x1a'),_0xff887a+'-'+_0x460110+'/'+_0x4194a4)[_0x7c65('0x1b')](_0x501ee2);}return null;};}function patchUpdates(_0x2cd04e){return function(_0xf35eed){try{jsonpatch[_0x7c65('0x1c')](_0xf35eed,_0x2cd04e,!![]);}catch(_0x214ab2){return BPromise[_0x7c65('0x1d')](_0x214ab2);}return _0xf35eed[_0x7c65('0x1e')]();};}function saveUpdates(_0x597e6e,_0x4f660e){return function(_0x384a0a){if(_0x384a0a){return _0x384a0a[_0x7c65('0x1f')](_0x597e6e)['then'](function(_0x586be9){return _0x586be9;});}return null;};}function removeEntity(_0xf8ea95,_0x3166b0){return function(_0x292340){if(_0x292340){return _0x292340[_0x7c65('0x20')]()[_0x7c65('0x21')](function(){var _0x272cfc=_0x292340[_0x7c65('0x22')]({'plain':!![]});var _0xb41dd9='ExtractedReports';return db[_0x7c65('0x23')][_0x7c65('0x20')]({'where':{'type':_0xb41dd9,'resourceId':_0x272cfc['id']}})['then'](function(){return _0x292340;});})[_0x7c65('0x21')](function(){_0xf8ea95[_0x7c65('0x15')](0xcc)[_0x7c65('0x24')]();});}};}function handleEntityNotFound(_0x4aa9ce,_0x5584fc){return function(_0x2d9715){if(!_0x2d9715){_0x4aa9ce[_0x7c65('0x14')](0x194);}return _0x2d9715;};}function handleError(_0x1844b0,_0xa9988c){_0xa9988c=_0xa9988c||0x1f4;return function(_0x12b673){logger[_0x7c65('0x25')](_0x12b673[_0x7c65('0x26')]);if(_0x12b673[_0x7c65('0x27')]){delete _0x12b673[_0x7c65('0x27')];}_0x1844b0[_0x7c65('0x15')](_0xa9988c)[_0x7c65('0x28')](_0x12b673);};}exports['index']=function(_0x847880,_0x47172c){var _0x51f782={},_0x44666b={},_0x3a1616={'count':0x0,'rows':[]};var _0x1033f5=_[_0x7c65('0x29')](db[_0x7c65('0x2a')][_0x7c65('0x2b')],function(_0x431397){return{'name':_0x431397[_0x7c65('0x2c')],'type':_0x431397['type'][_0x7c65('0x2d')]};});_0x44666b[_0x7c65('0x2e')]=_[_0x7c65('0x29')](_0x1033f5,_0x7c65('0x27'));_0x44666b['query']=_[_0x7c65('0x2f')](_0x847880[_0x7c65('0x30')]);_0x44666b['filters']=_[_0x7c65('0x31')](_0x44666b[_0x7c65('0x2e')],_0x44666b[_0x7c65('0x30')]);_0x51f782['attributes']=_[_0x7c65('0x31')](_0x44666b['model'],qs['fields'](_0x847880['query'][_0x7c65('0x32')]));_0x51f782[_0x7c65('0x33')]=_0x51f782['attributes'][_0x7c65('0x34')]?_0x51f782[_0x7c65('0x33')]:_0x44666b[_0x7c65('0x2e')];if(!_0x847880[_0x7c65('0x30')]['hasOwnProperty'](_0x7c65('0x35'))){_0x51f782[_0x7c65('0x18')]=qs[_0x7c65('0x18')](_0x847880[_0x7c65('0x30')][_0x7c65('0x18')]);_0x51f782[_0x7c65('0x17')]=qs[_0x7c65('0x17')](_0x847880[_0x7c65('0x30')]['offset']);}_0x51f782[_0x7c65('0x36')]=qs[_0x7c65('0x37')](_0x847880['query'][_0x7c65('0x37')]);_0x51f782['where']=qs[_0x7c65('0x38')](_[_0x7c65('0x39')](_0x847880[_0x7c65('0x30')],_0x44666b['filters']));if(_0x847880['query'][_0x7c65('0x3a')]){_0x51f782[_0x7c65('0x3b')]=_[_0x7c65('0x3c')](_0x51f782['where'],{'$or':_[_0x7c65('0x29')](_0x1033f5,function(_0x5f6f56){if(_0x5f6f56['type']!=='VIRTUAL'){var _0x3904ed={};_0x3904ed[_0x5f6f56[_0x7c65('0x27')]]={'$like':'%'+_0x847880['query'][_0x7c65('0x3a')]+'%'};return _0x3904ed;}})});}_0x51f782=_[_0x7c65('0x3c')]({},_0x51f782,_0x847880[_0x7c65('0x3d')]);var _0x47e025={'where':_0x51f782['where']};return db[_0x7c65('0x2a')][_0x7c65('0x16')](_0x47e025)[_0x7c65('0x21')](function(_0x118acb){_0x3a1616[_0x7c65('0x16')]=_0x118acb;if(_0x847880[_0x7c65('0x30')][_0x7c65('0x3e')]){_0x51f782['include']=[{'all':!![]}];}return db[_0x7c65('0x2a')][_0x7c65('0x3f')](_0x51f782);})[_0x7c65('0x21')](function(_0x370377){_0x3a1616['rows']=_0x370377;return _0x3a1616;})['then'](respondWithFilteredResult(_0x47172c,_0x51f782))[_0x7c65('0x40')](handleError(_0x47172c,null));};exports[_0x7c65('0x41')]=function(_0x58ed5d,_0x1e09f9){var _0x2867b7={'raw':!![],'where':{'id':_0x58ed5d[_0x7c65('0x42')]['id']}},_0xd7a2a5={};_0xd7a2a5['model']=_[_0x7c65('0x2f')](db[_0x7c65('0x2a')][_0x7c65('0x2b')]);_0xd7a2a5['query']=_[_0x7c65('0x2f')](_0x58ed5d['query']);_0xd7a2a5[_0x7c65('0x38')]=_[_0x7c65('0x31')](_0xd7a2a5[_0x7c65('0x2e')],_0xd7a2a5['query']);_0x2867b7[_0x7c65('0x33')]=_[_0x7c65('0x31')](_0xd7a2a5[_0x7c65('0x2e')],qs[_0x7c65('0x32')](_0x58ed5d[_0x7c65('0x30')]['fields']));_0x2867b7[_0x7c65('0x33')]=_0x2867b7[_0x7c65('0x33')][_0x7c65('0x34')]?_0x2867b7['attributes']:_0xd7a2a5[_0x7c65('0x2e')];if(_0x58ed5d[_0x7c65('0x30')]['includeAll']){_0x2867b7[_0x7c65('0x43')]=[{'all':!![]}];}_0x2867b7=_[_0x7c65('0x3c')]({},_0x2867b7,_0x58ed5d[_0x7c65('0x3d')]);return db['AnalyticExtractedReport']['find'](_0x2867b7)[_0x7c65('0x21')](handleEntityNotFound(_0x1e09f9,null))[_0x7c65('0x21')](respondWithResult(_0x1e09f9,null))[_0x7c65('0x40')](handleError(_0x1e09f9,null));};exports[_0x7c65('0x44')]=function(_0xcc092b,_0x5dfff7){return db['AnalyticExtractedReport']['create'](_0xcc092b[_0x7c65('0x45')],{})[_0x7c65('0x21')](function(_0x22e75b){var _0x5d9e15=_0xcc092b[_0x7c65('0x46')][_0x7c65('0x22')]({'plain':!![]});if(!_0x5d9e15)throw new Error(_0x7c65('0x47'));if(_0x5d9e15[_0x7c65('0x48')]===_0x7c65('0x46')){var _0x24aeba=_0x22e75b['get']({'plain':!![]});var _0x3affc8=_0x7c65('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x3affc8,'userProfileId':_0x5d9e15[_0x7c65('0x4a')]},'raw':!![]})['then'](function(_0x5ba2bf){if(_0x5ba2bf&&_0x5ba2bf[_0x7c65('0x4b')]===0x0){return db[_0x7c65('0x23')][_0x7c65('0x44')]({'name':_0x24aeba['name'],'resourceId':_0x24aeba['id'],'type':_0x5ba2bf[_0x7c65('0x27')],'sectionId':_0x5ba2bf['id']},{})[_0x7c65('0x21')](function(){return _0x22e75b;});}else{return _0x22e75b;}})[_0x7c65('0x40')](function(_0xed0630){logger['error'](_0x7c65('0x4c'),_0xed0630);throw _0xed0630;});}return _0x22e75b;})[_0x7c65('0x21')](respondWithResult(_0x5dfff7,0xc9))[_0x7c65('0x40')](handleError(_0x5dfff7,null));};exports[_0x7c65('0x1f')]=function(_0x57cdfb,_0xef9670){if(_0x57cdfb['body']['id']){delete _0x57cdfb[_0x7c65('0x45')]['id'];}return db[_0x7c65('0x2a')][_0x7c65('0x4d')]({'where':{'id':_0x57cdfb[_0x7c65('0x42')]['id']}})[_0x7c65('0x21')](handleEntityNotFound(_0xef9670,null))['then'](saveUpdates(_0x57cdfb[_0x7c65('0x45')],null))[_0x7c65('0x21')](respondWithResult(_0xef9670,null))[_0x7c65('0x40')](handleError(_0xef9670,null));};exports[_0x7c65('0x20')]=function(_0x39e0bb,_0x4b3e94){return db['AnalyticExtractedReport'][_0x7c65('0x4d')]({'where':{'id':_0x39e0bb[_0x7c65('0x42')]['id']}})[_0x7c65('0x21')](handleEntityNotFound(_0x4b3e94,null))[_0x7c65('0x21')](removeEntity(_0x4b3e94,null))[_0x7c65('0x40')](handleError(_0x4b3e94,null));};exports[_0x7c65('0x4e')]=function(_0x25a0fc,_0x12e8f6,_0x2a7894){return db[_0x7c65('0x2a')][_0x7c65('0x4d')]({'where':{'id':_0x25a0fc[_0x7c65('0x42')]['id']},'attributes':[_0x7c65('0x27'),_0x7c65('0x4f'),_0x7c65('0x50'),_0x7c65('0x51')],'raw':!![]})[_0x7c65('0x21')](handleEntityNotFound(_0x12e8f6,null))[_0x7c65('0x21')](function(_0x331a6d){if(_0x331a6d){if(!fs[_0x7c65('0x52')](path[_0x7c65('0x53')](config[_0x7c65('0x54')],_0x7c65('0x55'),_0x331a6d[_0x7c65('0x50')]))){throw new db[(_0x7c65('0x56'))][(_0x7c65('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x25a0fc[_0x7c65('0x30')]['exists']){return _0x12e8f6['sendStatus'](0xc8);}return _0x12e8f6[_0x7c65('0x4e')](path[_0x7c65('0x53')](config[_0x7c65('0x54')],_0x7c65('0x55'),_0x331a6d['savename']),util[_0x7c65('0x58')](_0x7c65('0x59'),_0x331a6d[_0x7c65('0x4f')]||_0x331a6d[_0x7c65('0x27')],_0x331a6d[_0x7c65('0x51')]['toLowerCase']()));}})[_0x7c65('0x40')](handleError(_0x12e8f6,null));}; \ No newline at end of file +var _0x2079=['apply','reject','save','update','then','destroy','ExtractedReports','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','params','catch','create','body','user','role','get','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','basename','savename','output','join','root','ValidationError','exists','format','%s.%s','toLowerCase','eml-format','zip-dir','request-promise','mustache','util','path','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x283474,_0x51afe2){var _0x5ba74b=function(_0x3978be){while(--_0x3978be){_0x283474['push'](_0x283474['shift']());}};_0x5ba74b(++_0x51afe2);}(_0x2079,0x148));var _0x9207=function(_0x4cddcb,_0x5d5f30){_0x4cddcb=_0x4cddcb-0x0;var _0x23b5d6=_0x2079[_0x4cddcb];return _0x23b5d6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9207('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9207('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9207('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9207('0x3'));var util=require(_0x9207('0x4'));var path=require(_0x9207('0x5'));var sox=require(_0x9207('0x6'));var csv=require(_0x9207('0x7'));var ejs=require(_0x9207('0x8'));var fs=require('fs');var _=require(_0x9207('0x9'));var squel=require(_0x9207('0xa'));var crypto=require(_0x9207('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9207('0xc'));var toCsv=require(_0x9207('0x7'));var querystring=require(_0x9207('0xd'));var Papa=require(_0x9207('0xe'));var Redis=require('ioredis');var authService=require(_0x9207('0xf'));var qs=require(_0x9207('0x10'));var as=require(_0x9207('0x11'));var hardwareService=require(_0x9207('0x12'));var logger=require(_0x9207('0x13'))(_0x9207('0x14'));var utils=require(_0x9207('0x15'));var config=require(_0x9207('0x16'));var db=require(_0x9207('0x17'))['db'];function respondWithStatusCode(_0x4abba8,_0x2d8027){_0x2d8027=_0x2d8027||0xcc;return function(_0x28851f){if(_0x28851f){return _0x4abba8[_0x9207('0x18')](_0x2d8027);}return _0x4abba8[_0x9207('0x19')](_0x2d8027)[_0x9207('0x1a')]();};}function respondWithResult(_0x11219d,_0x52c3ec){_0x52c3ec=_0x52c3ec||0xc8;return function(_0x78c5cc){if(_0x78c5cc){return _0x11219d[_0x9207('0x19')](_0x52c3ec)[_0x9207('0x1b')](_0x78c5cc);}};}function respondWithFilteredResult(_0x4ee100,_0x56417c){return function(_0x1e9433){if(_0x1e9433){var _0x3ec903=_0x1e9433[_0x9207('0x1c')],_0x1a4843=_0x56417c[_0x9207('0x1d')],_0x1730b4=_0x56417c['offset']+_0x56417c[_0x9207('0x1e')],_0x586343;if(_0x1730b4>=_0x3ec903){_0x1730b4=_0x3ec903;_0x586343=0xc8;}else{_0x586343=0xce;}_0x4ee100[_0x9207('0x19')](_0x586343);return _0x4ee100[_0x9207('0x1f')]('Content-Range',_0x1a4843+'-'+_0x1730b4+'/'+_0x3ec903)['json'](_0x1e9433);}return null;};}function patchUpdates(_0x1ab874){return function(_0x55bc3d){try{jsonpatch[_0x9207('0x20')](_0x55bc3d,_0x1ab874,!![]);}catch(_0x1d206d){return BPromise[_0x9207('0x21')](_0x1d206d);}return _0x55bc3d[_0x9207('0x22')]();};}function saveUpdates(_0x37630f,_0x5b8a3d){return function(_0x31ad45){if(_0x31ad45){return _0x31ad45[_0x9207('0x23')](_0x37630f)[_0x9207('0x24')](function(_0x4e0a6e){return _0x4e0a6e;});}return null;};}function removeEntity(_0x4ea086,_0x109f55){return function(_0x4b2c52){if(_0x4b2c52){return _0x4b2c52[_0x9207('0x25')]()['then'](function(){var _0x1a5835=_0x4b2c52['get']({'plain':!![]});var _0x3d6f94=_0x9207('0x26');return db['UserProfileResource'][_0x9207('0x25')]({'where':{'type':_0x3d6f94,'resourceId':_0x1a5835['id']}})[_0x9207('0x24')](function(){return _0x4b2c52;});})[_0x9207('0x24')](function(){_0x4ea086[_0x9207('0x19')](0xcc)[_0x9207('0x1a')]();});}};}function handleEntityNotFound(_0x358091,_0x59626f){return function(_0x9edfcc){if(!_0x9edfcc){_0x358091[_0x9207('0x18')](0x194);}return _0x9edfcc;};}function handleError(_0x3d5c09,_0x34c63a){_0x34c63a=_0x34c63a||0x1f4;return function(_0xda9bdf){logger[_0x9207('0x27')](_0xda9bdf[_0x9207('0x28')]);if(_0xda9bdf['name']){delete _0xda9bdf[_0x9207('0x29')];}_0x3d5c09[_0x9207('0x19')](_0x34c63a)[_0x9207('0x2a')](_0xda9bdf);};}exports[_0x9207('0x2b')]=function(_0x50007c,_0x3360be){var _0x9b1a1e={},_0x42530f={},_0x225d40={'count':0x0,'rows':[]};var _0x3ffa11=_[_0x9207('0x2c')](db[_0x9207('0x2d')][_0x9207('0x2e')],function(_0x1d84d3){return{'name':_0x1d84d3['fieldName'],'type':_0x1d84d3[_0x9207('0x2f')][_0x9207('0x30')]};});_0x42530f['model']=_[_0x9207('0x2c')](_0x3ffa11,'name');_0x42530f[_0x9207('0x31')]=_[_0x9207('0x32')](_0x50007c[_0x9207('0x31')]);_0x42530f[_0x9207('0x33')]=_[_0x9207('0x34')](_0x42530f[_0x9207('0x35')],_0x42530f[_0x9207('0x31')]);_0x9b1a1e[_0x9207('0x36')]=_[_0x9207('0x34')](_0x42530f[_0x9207('0x35')],qs['fields'](_0x50007c[_0x9207('0x31')]['fields']));_0x9b1a1e[_0x9207('0x36')]=_0x9b1a1e[_0x9207('0x36')][_0x9207('0x37')]?_0x9b1a1e['attributes']:_0x42530f['model'];if(!_0x50007c['query'][_0x9207('0x38')](_0x9207('0x39'))){_0x9b1a1e[_0x9207('0x1e')]=qs[_0x9207('0x1e')](_0x50007c[_0x9207('0x31')]['limit']);_0x9b1a1e[_0x9207('0x1d')]=qs[_0x9207('0x1d')](_0x50007c[_0x9207('0x31')][_0x9207('0x1d')]);}_0x9b1a1e['order']=qs[_0x9207('0x3a')](_0x50007c[_0x9207('0x31')]['sort']);_0x9b1a1e['where']=qs[_0x9207('0x33')](_[_0x9207('0x3b')](_0x50007c[_0x9207('0x31')],_0x42530f['filters']));if(_0x50007c['query'][_0x9207('0x3c')]){_0x9b1a1e['where']=_[_0x9207('0x3d')](_0x9b1a1e[_0x9207('0x3e')],{'$or':_[_0x9207('0x2c')](_0x3ffa11,function(_0x51ec74){if(_0x51ec74[_0x9207('0x2f')]!==_0x9207('0x3f')){var _0x463ccf={};_0x463ccf[_0x51ec74[_0x9207('0x29')]]={'$like':'%'+_0x50007c[_0x9207('0x31')]['filter']+'%'};return _0x463ccf;}})});}_0x9b1a1e=_[_0x9207('0x3d')]({},_0x9b1a1e,_0x50007c[_0x9207('0x40')]);var _0x4631f4={'where':_0x9b1a1e[_0x9207('0x3e')]};return db[_0x9207('0x2d')]['count'](_0x4631f4)[_0x9207('0x24')](function(_0x502afb){_0x225d40[_0x9207('0x1c')]=_0x502afb;if(_0x50007c[_0x9207('0x31')][_0x9207('0x41')]){_0x9b1a1e[_0x9207('0x42')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x9207('0x43')](_0x9b1a1e);})[_0x9207('0x24')](function(_0x4a12a1){_0x225d40[_0x9207('0x44')]=_0x4a12a1;return _0x225d40;})[_0x9207('0x24')](respondWithFilteredResult(_0x3360be,_0x9b1a1e))['catch'](handleError(_0x3360be,null));};exports['show']=function(_0xe30604,_0x422c55){var _0x39e1a0={'raw':!![],'where':{'id':_0xe30604[_0x9207('0x45')]['id']}},_0xb02419={};_0xb02419[_0x9207('0x35')]=_['keys'](db[_0x9207('0x2d')]['rawAttributes']);_0xb02419[_0x9207('0x31')]=_[_0x9207('0x32')](_0xe30604[_0x9207('0x31')]);_0xb02419[_0x9207('0x33')]=_['intersection'](_0xb02419[_0x9207('0x35')],_0xb02419[_0x9207('0x31')]);_0x39e1a0[_0x9207('0x36')]=_[_0x9207('0x34')](_0xb02419['model'],qs['fields'](_0xe30604[_0x9207('0x31')]['fields']));_0x39e1a0[_0x9207('0x36')]=_0x39e1a0[_0x9207('0x36')][_0x9207('0x37')]?_0x39e1a0[_0x9207('0x36')]:_0xb02419['model'];if(_0xe30604[_0x9207('0x31')][_0x9207('0x41')]){_0x39e1a0[_0x9207('0x42')]=[{'all':!![]}];}_0x39e1a0=_['merge']({},_0x39e1a0,_0xe30604[_0x9207('0x40')]);return db[_0x9207('0x2d')]['find'](_0x39e1a0)[_0x9207('0x24')](handleEntityNotFound(_0x422c55,null))[_0x9207('0x24')](respondWithResult(_0x422c55,null))[_0x9207('0x46')](handleError(_0x422c55,null));};exports[_0x9207('0x47')]=function(_0x40589b,_0x498a18){return db[_0x9207('0x2d')][_0x9207('0x47')](_0x40589b[_0x9207('0x48')],{})['then'](function(_0x2cd7ec){var _0x490ffa=_0x40589b[_0x9207('0x49')]['get']({'plain':!![]});if(!_0x490ffa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x490ffa[_0x9207('0x4a')]===_0x9207('0x49')){var _0x247e11=_0x2cd7ec[_0x9207('0x4b')]({'plain':!![]});var _0x5323ec='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x5323ec,'userProfileId':_0x490ffa['userProfileId']},'raw':!![]})[_0x9207('0x24')](function(_0x423b23){if(_0x423b23&&_0x423b23['autoAssociation']===0x0){return db[_0x9207('0x4c')][_0x9207('0x47')]({'name':_0x247e11[_0x9207('0x29')],'resourceId':_0x247e11['id'],'type':_0x423b23['name'],'sectionId':_0x423b23['id']},{})[_0x9207('0x24')](function(){return _0x2cd7ec;});}else{return _0x2cd7ec;}})[_0x9207('0x46')](function(_0x530178){logger[_0x9207('0x27')](_0x9207('0x4d'),_0x530178);throw _0x530178;});}return _0x2cd7ec;})[_0x9207('0x24')](respondWithResult(_0x498a18,0xc9))[_0x9207('0x46')](handleError(_0x498a18,null));};exports['update']=function(_0x3556db,_0x173c93){if(_0x3556db['body']['id']){delete _0x3556db[_0x9207('0x48')]['id'];}return db['AnalyticExtractedReport'][_0x9207('0x4e')]({'where':{'id':_0x3556db[_0x9207('0x45')]['id']}})['then'](handleEntityNotFound(_0x173c93,null))['then'](saveUpdates(_0x3556db[_0x9207('0x48')],null))[_0x9207('0x24')](respondWithResult(_0x173c93,null))[_0x9207('0x46')](handleError(_0x173c93,null));};exports[_0x9207('0x25')]=function(_0x1a067d,_0x291056){return db[_0x9207('0x2d')][_0x9207('0x4e')]({'where':{'id':_0x1a067d[_0x9207('0x45')]['id']}})[_0x9207('0x24')](handleEntityNotFound(_0x291056,null))[_0x9207('0x24')](removeEntity(_0x291056,null))[_0x9207('0x46')](handleError(_0x291056,null));};exports[_0x9207('0x4f')]=function(_0x60ca12,_0x168e74,_0x3b7c9c){return db[_0x9207('0x2d')][_0x9207('0x4e')]({'where':{'id':_0x60ca12['params']['id']},'attributes':['name',_0x9207('0x50'),_0x9207('0x51'),_0x9207('0x52')],'raw':!![]})[_0x9207('0x24')](handleEntityNotFound(_0x168e74,null))[_0x9207('0x24')](function(_0x53eca6){if(_0x53eca6){if(!fs['existsSync'](path[_0x9207('0x53')](config[_0x9207('0x54')],'server/files/reports',_0x53eca6[_0x9207('0x51')]))){throw new db['Sequelize'][(_0x9207('0x55'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x60ca12[_0x9207('0x31')][_0x9207('0x56')]){return _0x168e74[_0x9207('0x18')](0xc8);}return _0x168e74['download'](path[_0x9207('0x53')](config[_0x9207('0x54')],'server/files/reports',_0x53eca6[_0x9207('0x51')]),util[_0x9207('0x57')](_0x9207('0x58'),_0x53eca6['basename']||_0x53eca6['name'],_0x53eca6[_0x9207('0x52')][_0x9207('0x59')]()));}})[_0x9207('0x46')](handleError(_0x168e74,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index aff4d74..a8bd78b 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 _0x0d9f=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0d9f,0x17a));var _0xf0d9=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x0d9f[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0xf0d9('0x0'));var util=require(_0xf0d9('0x1'));var logger=require(_0xf0d9('0x2'))(_0xf0d9('0x3'));var moment=require(_0xf0d9('0x4'));var BPromise=require(_0xf0d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0d9('0x6'));var rimraf=require('rimraf');var config=require(_0xf0d9('0x7'));var attributes=require(_0xf0d9('0x8'));module[_0xf0d9('0x9')]=function(_0x376f50,_0x1136dc){return _0x376f50[_0xf0d9('0xa')](_0xf0d9('0xb'),attributes,{'tableName':_0xf0d9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6eb=['api','bluebird','request-promise','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','util'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0xf6eb,0xe7));var _0xbf6e=function(_0x5dab08,_0x29444a){_0x5dab08=_0x5dab08-0x0;var _0x4334d7=_0xf6eb[_0x5dab08];return _0x4334d7;};'use strict';var _=require('lodash');var util=require(_0xbf6e('0x0'));var logger=require('../../config/logger')(_0xbf6e('0x1'));var moment=require('moment');var BPromise=require(_0xbf6e('0x2'));var rp=require(_0xbf6e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbf6e('0x4'));module[_0xbf6e('0x5')]=function(_0x11d493,_0x22fc45){return _0x11d493['define'](_0xbf6e('0x6'),attributes,{'tableName':_0xbf6e('0x7'),'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 6ae4ede..fe1166d 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 _0x9b70=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3cb1fc,_0x308874){var _0x8ca185=function(_0x2e49fc){while(--_0x2e49fc){_0x3cb1fc['push'](_0x3cb1fc['shift']());}};_0x8ca185(++_0x308874);}(_0x9b70,0x94));var _0x09b7=function(_0x4d1cc6,_0x26bebe){_0x4d1cc6=_0x4d1cc6-0x0;var _0x1a6fee=_0x9b70[_0x4d1cc6];return _0x1a6fee;};'use strict';var _=require(_0x09b7('0x0'));var util=require(_0x09b7('0x1'));var moment=require(_0x09b7('0x2'));var BPromise=require(_0x09b7('0x3'));var rs=require(_0x09b7('0x4'));var fs=require('fs');var Redis=require(_0x09b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x09b7('0x6'));var logger=require(_0x09b7('0x7'))(_0x09b7('0x8'));var config=require(_0x09b7('0x9'));var jayson=require(_0x09b7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3741b9,_0x327edd,_0x204f71){return new BPromise(function(_0x4118fe,_0x48f912){return client[_0x09b7('0xb')](_0x3741b9,_0x204f71)[_0x09b7('0xc')](function(_0x4c34ec){logger[_0x09b7('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x327edd,_0x09b7('0xe'));logger[_0x09b7('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x327edd,_0x09b7('0xe'),JSON['stringify'](_0x4c34ec));if(_0x4c34ec[_0x09b7('0x10')]){if(_0x4c34ec['error'][_0x09b7('0x11')]===0x1f4){logger[_0x09b7('0x10')](_0x09b7('0x12'),_0x327edd,_0x4c34ec[_0x09b7('0x10')][_0x09b7('0x13')]);return _0x48f912(_0x4c34ec[_0x09b7('0x10')][_0x09b7('0x13')]);}logger[_0x09b7('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x327edd,_0x4c34ec[_0x09b7('0x10')]['message']);return _0x4118fe(_0x4c34ec['error'][_0x09b7('0x13')]);}else{logger[_0x09b7('0xd')](_0x09b7('0x12'),_0x327edd,_0x09b7('0xe'));_0x4118fe(_0x4c34ec[_0x09b7('0x14')]['message']);}})[_0x09b7('0x15')](function(_0xbb6a82){logger[_0x09b7('0x10')](_0x09b7('0x12'),_0x327edd,_0xbb6a82);_0x48f912(_0xbb6a82);});});} \ No newline at end of file +var _0xde62=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x3af63c,_0x580adb){var _0x4fbf4a=function(_0x1d1893){while(--_0x1d1893){_0x3af63c['push'](_0x3af63c['shift']());}};_0x4fbf4a(++_0x580adb);}(_0xde62,0x16e));var _0x2de6=function(_0x27fcd3,_0x32849d){_0x27fcd3=_0x27fcd3-0x0;var _0x244e50=_0xde62[_0x27fcd3];return _0x244e50;};'use strict';var _=require(_0x2de6('0x0'));var util=require(_0x2de6('0x1'));var moment=require('moment');var BPromise=require(_0x2de6('0x2'));var rs=require(_0x2de6('0x3'));var fs=require('fs');var Redis=require(_0x2de6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2de6('0x5'));var logger=require('../../config/logger')(_0x2de6('0x6'));var config=require(_0x2de6('0x7'));var jayson=require(_0x2de6('0x8'));var client=jayson[_0x2de6('0x9')][_0x2de6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46ac55,_0x2a0e6d,_0xee6a52){return new BPromise(function(_0x24b47f,_0x5d9e22){return client[_0x2de6('0xb')](_0x46ac55,_0xee6a52)[_0x2de6('0xc')](function(_0x214b48){logger[_0x2de6('0xd')](_0x2de6('0xe'),_0x2a0e6d,_0x2de6('0xf'));logger[_0x2de6('0x10')](_0x2de6('0x11'),_0x2a0e6d,_0x2de6('0xf'),JSON[_0x2de6('0x12')](_0x214b48));if(_0x214b48[_0x2de6('0x13')]){if(_0x214b48[_0x2de6('0x13')][_0x2de6('0x14')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x2a0e6d,_0x214b48[_0x2de6('0x13')]['message']);return _0x5d9e22(_0x214b48[_0x2de6('0x13')][_0x2de6('0x15')]);}logger[_0x2de6('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x2a0e6d,_0x214b48[_0x2de6('0x13')][_0x2de6('0x15')]);return _0x24b47f(_0x214b48['error'][_0x2de6('0x15')]);}else{logger[_0x2de6('0xd')](_0x2de6('0xe'),_0x2a0e6d,_0x2de6('0xf'));_0x24b47f(_0x214b48[_0x2de6('0x16')][_0x2de6('0x15')]);}})[_0x2de6('0x17')](function(_0x26b49c){logger[_0x2de6('0x13')](_0x2de6('0xe'),_0x2a0e6d,_0x26b49c);_0x5d9e22(_0x26b49c);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 643c7fd..cdb5713 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 _0xf67d=['delete','exports','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','create','put','/:id','update'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xf67d,0x182));var _0xdf67=function(_0x496291,_0x46bbd2){_0x496291=_0x496291-0x0;var _0x365abb=_0xf67d[_0x496291];return _0x365abb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdf67('0x0')]();var auth=require(_0xdf67('0x1'));var interaction=require(_0xdf67('0x2'));var config=require(_0xdf67('0x3'));var controller=require(_0xdf67('0x4'));router[_0xdf67('0x5')]('/',auth[_0xdf67('0x6')](),controller[_0xdf67('0x7')]);router['get']('/:id',auth[_0xdf67('0x6')](),controller[_0xdf67('0x8')]);router[_0xdf67('0x5')](_0xdf67('0x9'),auth[_0xdf67('0x6')](),controller['download']);router['post']('/',auth[_0xdf67('0x6')](),controller[_0xdf67('0xa')]);router[_0xdf67('0xb')](_0xdf67('0xc'),auth[_0xdf67('0x6')](),controller[_0xdf67('0xd')]);router[_0xdf67('0xe')](_0xdf67('0xc'),auth[_0xdf67('0x6')](),controller['destroy']);module[_0xdf67('0xf')]=router; \ No newline at end of file +var _0x4323=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','create','delete','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x1ce3e0,_0x247252){var _0x575610=function(_0x5eb25b){while(--_0x5eb25b){_0x1ce3e0['push'](_0x1ce3e0['shift']());}};_0x575610(++_0x247252);}(_0x4323,0x1cc));var _0x3432=function(_0x3045f9,_0x25f1b){_0x3045f9=_0x3045f9-0x0;var _0x2e2335=_0x4323[_0x3045f9];return _0x2e2335;};'use strict';var multer=require('multer');var util=require(_0x3432('0x0'));var path=require('path');var timeout=require(_0x3432('0x1'));var express=require('express');var router=express[_0x3432('0x2')]();var auth=require(_0x3432('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3432('0x4'));var controller=require(_0x3432('0x5'));router[_0x3432('0x6')]('/',auth[_0x3432('0x7')](),controller[_0x3432('0x8')]);router[_0x3432('0x6')](_0x3432('0x9'),auth[_0x3432('0x7')](),controller[_0x3432('0xa')]);router['get'](_0x3432('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x3432('0xc')]('/',auth['isAuthenticated'](),controller[_0x3432('0xd')]);router['put']('/:id',auth[_0x3432('0x7')](),controller['update']);router[_0x3432('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x3432('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 72c3826..945bfb3 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 _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x2c0d27,_0xbf25ba){var _0x219007=function(_0x225735){while(--_0x225735){_0x2c0d27['push'](_0x2c0d27['shift']());}};_0x219007(++_0xbf25ba);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xc4aa[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1261=['exports','TEXT','STRING','BOOLEAN'];(function(_0x5c6058,_0x373c61){var _0xb3b090=function(_0x1fb1fc){while(--_0x1fb1fc){_0x5c6058['push'](_0x5c6058['shift']());}};_0xb3b090(++_0x373c61);}(_0x1261,0x144));var _0x1126=function(_0xd6640b,_0x475e47){_0xd6640b=_0xd6640b-0x0;var _0x4c843e=_0x1261[_0xd6640b];return _0x4c843e;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'field':{'type':Sequelize[_0x1126('0x1')]},'alias':{'type':Sequelize[_0x1126('0x2')]},'function':{'type':Sequelize[_0x1126('0x2')]},'format':{'type':Sequelize[_0x1126('0x2')]},'groupBy':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1126('0x2')]},'custom':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 43451f1..5223ca1 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 _0x7c1a=['save','update','then','destroy','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','reject'];(function(_0x238f37,_0x1bde42){var _0x420fe8=function(_0x219ec4){while(--_0x219ec4){_0x238f37['push'](_0x238f37['shift']());}};_0x420fe8(++_0x1bde42);}(_0x7c1a,0x159));var _0xa7c1=function(_0x355243,_0x3ed2b8){_0x355243=_0x355243-0x0;var _0xe02a50=_0x7c1a[_0x355243];return _0xe02a50;};'use strict';var pdf=require(_0xa7c1('0x0'));var emlformat=require(_0xa7c1('0x1'));var rimraf=require(_0xa7c1('0x2'));var zipdir=require(_0xa7c1('0x3'));var jsonpatch=require(_0xa7c1('0x4'));var rp=require(_0xa7c1('0x5'));var moment=require('moment');var BPromise=require(_0xa7c1('0x6'));var Mustache=require(_0xa7c1('0x7'));var util=require('util');var path=require(_0xa7c1('0x8'));var sox=require('sox');var csv=require(_0xa7c1('0x9'));var ejs=require(_0xa7c1('0xa'));var fs=require('fs');var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0x9'));var querystring=require(_0xa7c1('0xe'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0xf'));var authService=require(_0xa7c1('0x10'));var qs=require(_0xa7c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x12'));var logger=require(_0xa7c1('0x13'))('api');var utils=require(_0xa7c1('0x14'));var config=require(_0xa7c1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ee4af,_0x1d7d67){_0x1d7d67=_0x1d7d67||0xcc;return function(_0x26d63a){if(_0x26d63a){return _0x4ee4af[_0xa7c1('0x16')](_0x1d7d67);}return _0x4ee4af[_0xa7c1('0x17')](_0x1d7d67)[_0xa7c1('0x18')]();};}function respondWithResult(_0x2dd7f8,_0xb74ba2){_0xb74ba2=_0xb74ba2||0xc8;return function(_0x3fc9e6){if(_0x3fc9e6){return _0x2dd7f8[_0xa7c1('0x17')](_0xb74ba2)[_0xa7c1('0x19')](_0x3fc9e6);}};}function respondWithFilteredResult(_0x30b538,_0xe28779){return function(_0x5a0c8e){if(_0x5a0c8e){var _0xba02b=_0x5a0c8e[_0xa7c1('0x1a')],_0x3a6f47=_0xe28779['offset'],_0x1790c3=_0xe28779[_0xa7c1('0x1b')]+_0xe28779['limit'],_0x1ca843;if(_0x1790c3>=_0xba02b){_0x1790c3=_0xba02b;_0x1ca843=0xc8;}else{_0x1ca843=0xce;}_0x30b538[_0xa7c1('0x17')](_0x1ca843);return _0x30b538[_0xa7c1('0x1c')]('Content-Range',_0x3a6f47+'-'+_0x1790c3+'/'+_0xba02b)[_0xa7c1('0x19')](_0x5a0c8e);}return null;};}function patchUpdates(_0x19198b){return function(_0x3f193f){try{jsonpatch['apply'](_0x3f193f,_0x19198b,!![]);}catch(_0x19c9b2){return BPromise[_0xa7c1('0x1d')](_0x19c9b2);}return _0x3f193f[_0xa7c1('0x1e')]();};}function saveUpdates(_0x422447,_0x3b131e){return function(_0x31c16a){if(_0x31c16a){return _0x31c16a[_0xa7c1('0x1f')](_0x422447)[_0xa7c1('0x20')](function(_0x2e3f7c){return _0x2e3f7c;});}return null;};}function removeEntity(_0x5451ef,_0x42ad46){return function(_0x1c9b7c){if(_0x1c9b7c){return _0x1c9b7c[_0xa7c1('0x21')]()['then'](function(){_0x5451ef[_0xa7c1('0x17')](0xcc)[_0xa7c1('0x18')]();});}};}function handleEntityNotFound(_0x43d61f,_0x2dc42b){return function(_0x30cb15){if(!_0x30cb15){_0x43d61f[_0xa7c1('0x16')](0x194);}return _0x30cb15;};}function handleError(_0x3c9866,_0x53e490){_0x53e490=_0x53e490||0x1f4;return function(_0x525de5){logger['error'](_0x525de5[_0xa7c1('0x22')]);if(_0x525de5[_0xa7c1('0x23')]){delete _0x525de5[_0xa7c1('0x23')];}_0x3c9866[_0xa7c1('0x17')](_0x53e490)[_0xa7c1('0x24')](_0x525de5);};}exports['index']=function(_0x586b17,_0x465dd1){var _0x2726e9={},_0xc60f7c={},_0x59b3f5={'count':0x0,'rows':[]};var _0x2c42b4=_[_0xa7c1('0x25')](db[_0xa7c1('0x26')][_0xa7c1('0x27')],function(_0x635792){return{'name':_0x635792[_0xa7c1('0x28')],'type':_0x635792[_0xa7c1('0x29')][_0xa7c1('0x2a')]};});_0xc60f7c[_0xa7c1('0x2b')]=_[_0xa7c1('0x25')](_0x2c42b4,'name');_0xc60f7c[_0xa7c1('0x2c')]=_[_0xa7c1('0x2d')](_0x586b17[_0xa7c1('0x2c')]);_0xc60f7c[_0xa7c1('0x2e')]=_[_0xa7c1('0x2f')](_0xc60f7c[_0xa7c1('0x2b')],_0xc60f7c[_0xa7c1('0x2c')]);_0x2726e9[_0xa7c1('0x30')]=_[_0xa7c1('0x2f')](_0xc60f7c['model'],qs[_0xa7c1('0x31')](_0x586b17[_0xa7c1('0x2c')][_0xa7c1('0x31')]));_0x2726e9[_0xa7c1('0x30')]=_0x2726e9['attributes']['length']?_0x2726e9[_0xa7c1('0x30')]:_0xc60f7c[_0xa7c1('0x2b')];if(!_0x586b17[_0xa7c1('0x2c')]['hasOwnProperty']('nolimit')){_0x2726e9[_0xa7c1('0x32')]=qs[_0xa7c1('0x32')](_0x586b17['query'][_0xa7c1('0x32')]);_0x2726e9['offset']=qs[_0xa7c1('0x1b')](_0x586b17['query'][_0xa7c1('0x1b')]);}_0x2726e9[_0xa7c1('0x33')]=qs['sort'](_0x586b17['query'][_0xa7c1('0x34')]);_0x2726e9[_0xa7c1('0x35')]=qs[_0xa7c1('0x2e')](_[_0xa7c1('0x36')](_0x586b17[_0xa7c1('0x2c')],_0xc60f7c[_0xa7c1('0x2e')]));if(_0x586b17[_0xa7c1('0x2c')]['filter']){_0x2726e9[_0xa7c1('0x35')]=_[_0xa7c1('0x37')](_0x2726e9[_0xa7c1('0x35')],{'$or':_[_0xa7c1('0x25')](_0x2c42b4,function(_0x4158d8){if(_0x4158d8[_0xa7c1('0x29')]!=='VIRTUAL'){var _0x3e1a41={};_0x3e1a41[_0x4158d8[_0xa7c1('0x23')]]={'$like':'%'+_0x586b17[_0xa7c1('0x2c')][_0xa7c1('0x38')]+'%'};return _0x3e1a41;}})});}_0x2726e9=_[_0xa7c1('0x37')]({},_0x2726e9,_0x586b17[_0xa7c1('0x39')]);var _0x3b6f7f={'where':_0x2726e9[_0xa7c1('0x35')]};return db['AnalyticFieldReport'][_0xa7c1('0x1a')](_0x3b6f7f)[_0xa7c1('0x20')](function(_0x11521d){_0x59b3f5[_0xa7c1('0x1a')]=_0x11521d;if(_0x586b17[_0xa7c1('0x2c')][_0xa7c1('0x3a')]){_0x2726e9[_0xa7c1('0x3b')]=[{'all':!![]}];}return db[_0xa7c1('0x26')][_0xa7c1('0x3c')](_0x2726e9);})[_0xa7c1('0x20')](function(_0x438aaf){_0x59b3f5[_0xa7c1('0x3d')]=_0x438aaf;return _0x59b3f5;})[_0xa7c1('0x20')](respondWithFilteredResult(_0x465dd1,_0x2726e9))[_0xa7c1('0x3e')](handleError(_0x465dd1,null));};exports[_0xa7c1('0x3f')]=function(_0x3a51a5,_0x1c5f29){var _0x4c0ef7={'raw':![],'where':{'id':_0x3a51a5[_0xa7c1('0x40')]['id']}},_0x2631af={};_0x2631af['model']=_[_0xa7c1('0x2d')](db[_0xa7c1('0x26')][_0xa7c1('0x27')]);_0x2631af[_0xa7c1('0x2c')]=_['keys'](_0x3a51a5[_0xa7c1('0x2c')]);_0x2631af['filters']=_['intersection'](_0x2631af[_0xa7c1('0x2b')],_0x2631af[_0xa7c1('0x2c')]);_0x4c0ef7[_0xa7c1('0x30')]=_[_0xa7c1('0x2f')](_0x2631af[_0xa7c1('0x2b')],qs['fields'](_0x3a51a5[_0xa7c1('0x2c')][_0xa7c1('0x31')]));_0x4c0ef7[_0xa7c1('0x30')]=_0x4c0ef7['attributes']['length']?_0x4c0ef7[_0xa7c1('0x30')]:_0x2631af[_0xa7c1('0x2b')];if(_0x3a51a5['query'][_0xa7c1('0x3a')]){_0x4c0ef7[_0xa7c1('0x3b')]=[{'all':!![]}];}_0x4c0ef7=_[_0xa7c1('0x37')]({},_0x4c0ef7,_0x3a51a5[_0xa7c1('0x39')]);return db[_0xa7c1('0x26')]['find'](_0x4c0ef7)[_0xa7c1('0x20')](handleEntityNotFound(_0x1c5f29,null))[_0xa7c1('0x20')](respondWithResult(_0x1c5f29,null))[_0xa7c1('0x3e')](handleError(_0x1c5f29,null));};exports[_0xa7c1('0x41')]=function(_0x4277b4,_0x4c3c0a){return db[_0xa7c1('0x26')][_0xa7c1('0x41')](_0x4277b4[_0xa7c1('0x42')],{})[_0xa7c1('0x20')](respondWithResult(_0x4c3c0a,0xc9))[_0xa7c1('0x3e')](handleError(_0x4c3c0a,null));};exports[_0xa7c1('0x43')]=function(_0x5180af,_0x306ca9){return db[_0xa7c1('0x26')][_0xa7c1('0x43')](_0x5180af[_0xa7c1('0x42')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x306ca9,0xc9))['catch'](handleError(_0x306ca9,null));};exports[_0xa7c1('0x1f')]=function(_0x4b8da7,_0x7cfa68){if(_0x4b8da7[_0xa7c1('0x42')]['id']){delete _0x4b8da7[_0xa7c1('0x42')]['id'];}return db['AnalyticFieldReport'][_0xa7c1('0x44')]({'where':{'id':_0x4b8da7[_0xa7c1('0x40')]['id']}})['then'](handleEntityNotFound(_0x7cfa68,null))['then'](saveUpdates(_0x4b8da7[_0xa7c1('0x42')],null))[_0xa7c1('0x20')](respondWithResult(_0x7cfa68,null))[_0xa7c1('0x3e')](handleError(_0x7cfa68,null));};exports['destroy']=function(_0x12d60c,_0x3c4819){return db[_0xa7c1('0x26')][_0xa7c1('0x44')]({'where':{'id':_0x12d60c[_0xa7c1('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c4819,null))['then'](removeEntity(_0x3c4819,null))[_0xa7c1('0x3e')](handleError(_0x3c4819,null));};exports[_0xa7c1('0x45')]=function(_0x518200,_0x4b8aaf){return db[_0xa7c1('0x26')][_0xa7c1('0x21')]({'where':{'id':_0x518200['query'][_0xa7c1('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4b8aaf,0xcc))['catch'](handleError(_0x4b8aaf,null));};exports[_0xa7c1('0x47')]=function(_0x2f3485,_0x362616,_0x568643){return db[_0xa7c1('0x48')]['findOne']({'where':{'id':_0x2f3485[_0xa7c1('0x40')]['id']}})[_0xa7c1('0x20')](handleEntityNotFound(_0x362616,null))['then'](function(_0x2bce1b){if(_0x2bce1b){return db['sequelize'][_0xa7c1('0x49')](function(_0x2734d5){return db['AnalyticFieldReport'][_0xa7c1('0x21')]({'where':{'CustomReportId':_0x2f3485['params']['id']},'transaction':_0x2734d5})[_0xa7c1('0x20')](function(_0x154305){var _0x2da015=_[_0xa7c1('0x25')](_0x2f3485['body'],function(_0x808531){delete _0x808531['id'];_0x808531[_0xa7c1('0x4a')]=_0x2f3485['params']['id'];return _0x808531;});return db['AnalyticFieldReport'][_0xa7c1('0x43')](_0x2da015,{'transaction':_0x2734d5});});})[_0xa7c1('0x20')](function(){return db[_0xa7c1('0x26')][_0xa7c1('0x3c')]({'where':{'CustomReportId':_0x2f3485[_0xa7c1('0x40')]['id']}});});}})[_0xa7c1('0x20')](respondWithResult(_0x362616,null))[_0xa7c1('0x3e')](handleError(_0x362616,null));}; \ No newline at end of file +var _0x68b3=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','pick','filter','merge','type','count','includeAll','include','findAll','rows','show','params','options','find','catch','create','bulkCreate','body','bulkDestroy','ids','AnalyticCustomReport','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0x68b3,0x1d8));var _0x368b=function(_0x247aaa,_0x696a9d){_0x247aaa=_0x247aaa-0x0;var _0x175812=_0x68b3[_0x247aaa];return _0x175812;};'use strict';var pdf=require(_0x368b('0x0'));var emlformat=require(_0x368b('0x1'));var rimraf=require(_0x368b('0x2'));var zipdir=require(_0x368b('0x3'));var jsonpatch=require(_0x368b('0x4'));var rp=require('request-promise');var moment=require(_0x368b('0x5'));var BPromise=require(_0x368b('0x6'));var Mustache=require(_0x368b('0x7'));var util=require(_0x368b('0x8'));var path=require('path');var sox=require(_0x368b('0x9'));var csv=require(_0x368b('0xa'));var ejs=require(_0x368b('0xb'));var fs=require('fs');var _=require(_0x368b('0xc'));var squel=require(_0x368b('0xd'));var crypto=require(_0x368b('0xe'));var jsforce=require(_0x368b('0xf'));var deskjs=require(_0x368b('0x10'));var toCsv=require(_0x368b('0xa'));var querystring=require(_0x368b('0x11'));var Papa=require(_0x368b('0x12'));var Redis=require('ioredis');var authService=require(_0x368b('0x13'));var qs=require(_0x368b('0x14'));var as=require(_0x368b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x368b('0x16'))(_0x368b('0x17'));var utils=require(_0x368b('0x18'));var config=require('../../config/environment');var db=require(_0x368b('0x19'))['db'];function respondWithStatusCode(_0x847dcb,_0x514dc7){_0x514dc7=_0x514dc7||0xcc;return function(_0x109a90){if(_0x109a90){return _0x847dcb[_0x368b('0x1a')](_0x514dc7);}return _0x847dcb[_0x368b('0x1b')](_0x514dc7)[_0x368b('0x1c')]();};}function respondWithResult(_0xdd5d13,_0x4fffe5){_0x4fffe5=_0x4fffe5||0xc8;return function(_0x2b326c){if(_0x2b326c){return _0xdd5d13[_0x368b('0x1b')](_0x4fffe5)['json'](_0x2b326c);}};}function respondWithFilteredResult(_0x1c5e5b,_0x2aabb9){return function(_0x30c245){if(_0x30c245){var _0x515350=_0x30c245['count'],_0x220cd5=_0x2aabb9[_0x368b('0x1d')],_0x392376=_0x2aabb9[_0x368b('0x1d')]+_0x2aabb9[_0x368b('0x1e')],_0x1f1029;if(_0x392376>=_0x515350){_0x392376=_0x515350;_0x1f1029=0xc8;}else{_0x1f1029=0xce;}_0x1c5e5b['status'](_0x1f1029);return _0x1c5e5b['set'](_0x368b('0x1f'),_0x220cd5+'-'+_0x392376+'/'+_0x515350)[_0x368b('0x20')](_0x30c245);}return null;};}function patchUpdates(_0x2c3cec){return function(_0x1e632a){try{jsonpatch[_0x368b('0x21')](_0x1e632a,_0x2c3cec,!![]);}catch(_0x4b8fb7){return BPromise[_0x368b('0x22')](_0x4b8fb7);}return _0x1e632a[_0x368b('0x23')]();};}function saveUpdates(_0x2e74ca,_0x1c927f){return function(_0x23da8f){if(_0x23da8f){return _0x23da8f[_0x368b('0x24')](_0x2e74ca)[_0x368b('0x25')](function(_0x1d8066){return _0x1d8066;});}return null;};}function removeEntity(_0x508e48,_0x13e750){return function(_0x2f08d9){if(_0x2f08d9){return _0x2f08d9[_0x368b('0x26')]()[_0x368b('0x25')](function(){_0x508e48[_0x368b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x286641,_0x1ca429){return function(_0x3a22bd){if(!_0x3a22bd){_0x286641[_0x368b('0x1a')](0x194);}return _0x3a22bd;};}function handleError(_0x77a269,_0x85515f){_0x85515f=_0x85515f||0x1f4;return function(_0x430e16){logger[_0x368b('0x27')](_0x430e16[_0x368b('0x28')]);if(_0x430e16[_0x368b('0x29')]){delete _0x430e16[_0x368b('0x29')];}_0x77a269[_0x368b('0x1b')](_0x85515f)[_0x368b('0x2a')](_0x430e16);};}exports[_0x368b('0x2b')]=function(_0x4636f4,_0x23a83a){var _0x5dc5fa={},_0x9f192e={},_0x39ef94={'count':0x0,'rows':[]};var _0x1e0e46=_[_0x368b('0x2c')](db[_0x368b('0x2d')][_0x368b('0x2e')],function(_0x3c80b5){return{'name':_0x3c80b5['fieldName'],'type':_0x3c80b5['type'][_0x368b('0x2f')]};});_0x9f192e[_0x368b('0x30')]=_[_0x368b('0x2c')](_0x1e0e46,_0x368b('0x29'));_0x9f192e['query']=_[_0x368b('0x31')](_0x4636f4[_0x368b('0x32')]);_0x9f192e[_0x368b('0x33')]=_[_0x368b('0x34')](_0x9f192e[_0x368b('0x30')],_0x9f192e['query']);_0x5dc5fa[_0x368b('0x35')]=_[_0x368b('0x34')](_0x9f192e[_0x368b('0x30')],qs[_0x368b('0x36')](_0x4636f4['query']['fields']));_0x5dc5fa['attributes']=_0x5dc5fa[_0x368b('0x35')][_0x368b('0x37')]?_0x5dc5fa[_0x368b('0x35')]:_0x9f192e[_0x368b('0x30')];if(!_0x4636f4[_0x368b('0x32')]['hasOwnProperty'](_0x368b('0x38'))){_0x5dc5fa[_0x368b('0x1e')]=qs['limit'](_0x4636f4[_0x368b('0x32')][_0x368b('0x1e')]);_0x5dc5fa['offset']=qs[_0x368b('0x1d')](_0x4636f4[_0x368b('0x32')]['offset']);}_0x5dc5fa[_0x368b('0x39')]=qs['sort'](_0x4636f4['query']['sort']);_0x5dc5fa[_0x368b('0x3a')]=qs[_0x368b('0x33')](_[_0x368b('0x3b')](_0x4636f4[_0x368b('0x32')],_0x9f192e[_0x368b('0x33')]));if(_0x4636f4[_0x368b('0x32')][_0x368b('0x3c')]){_0x5dc5fa[_0x368b('0x3a')]=_[_0x368b('0x3d')](_0x5dc5fa[_0x368b('0x3a')],{'$or':_['map'](_0x1e0e46,function(_0x204c52){if(_0x204c52[_0x368b('0x3e')]!=='VIRTUAL'){var _0x221210={};_0x221210[_0x204c52[_0x368b('0x29')]]={'$like':'%'+_0x4636f4[_0x368b('0x32')][_0x368b('0x3c')]+'%'};return _0x221210;}})});}_0x5dc5fa=_[_0x368b('0x3d')]({},_0x5dc5fa,_0x4636f4['options']);var _0x24b993={'where':_0x5dc5fa[_0x368b('0x3a')]};return db[_0x368b('0x2d')][_0x368b('0x3f')](_0x24b993)['then'](function(_0x579cb3){_0x39ef94[_0x368b('0x3f')]=_0x579cb3;if(_0x4636f4[_0x368b('0x32')][_0x368b('0x40')]){_0x5dc5fa[_0x368b('0x41')]=[{'all':!![]}];}return db[_0x368b('0x2d')][_0x368b('0x42')](_0x5dc5fa);})[_0x368b('0x25')](function(_0xaa348d){_0x39ef94[_0x368b('0x43')]=_0xaa348d;return _0x39ef94;})[_0x368b('0x25')](respondWithFilteredResult(_0x23a83a,_0x5dc5fa))['catch'](handleError(_0x23a83a,null));};exports[_0x368b('0x44')]=function(_0x179e46,_0x5a3ff1){var _0x25e713={'raw':![],'where':{'id':_0x179e46[_0x368b('0x45')]['id']}},_0x1ea901={};_0x1ea901[_0x368b('0x30')]=_['keys'](db[_0x368b('0x2d')][_0x368b('0x2e')]);_0x1ea901['query']=_[_0x368b('0x31')](_0x179e46[_0x368b('0x32')]);_0x1ea901[_0x368b('0x33')]=_['intersection'](_0x1ea901[_0x368b('0x30')],_0x1ea901[_0x368b('0x32')]);_0x25e713[_0x368b('0x35')]=_['intersection'](_0x1ea901['model'],qs[_0x368b('0x36')](_0x179e46[_0x368b('0x32')]['fields']));_0x25e713[_0x368b('0x35')]=_0x25e713[_0x368b('0x35')][_0x368b('0x37')]?_0x25e713[_0x368b('0x35')]:_0x1ea901[_0x368b('0x30')];if(_0x179e46[_0x368b('0x32')][_0x368b('0x40')]){_0x25e713[_0x368b('0x41')]=[{'all':!![]}];}_0x25e713=_[_0x368b('0x3d')]({},_0x25e713,_0x179e46[_0x368b('0x46')]);return db[_0x368b('0x2d')][_0x368b('0x47')](_0x25e713)[_0x368b('0x25')](handleEntityNotFound(_0x5a3ff1,null))['then'](respondWithResult(_0x5a3ff1,null))[_0x368b('0x48')](handleError(_0x5a3ff1,null));};exports[_0x368b('0x49')]=function(_0xe79f4c,_0xf95817){return db[_0x368b('0x2d')]['create'](_0xe79f4c['body'],{})[_0x368b('0x25')](respondWithResult(_0xf95817,0xc9))[_0x368b('0x48')](handleError(_0xf95817,null));};exports[_0x368b('0x4a')]=function(_0x5a9d70,_0x378510){return db[_0x368b('0x2d')][_0x368b('0x4a')](_0x5a9d70[_0x368b('0x4b')],{'raw':![],'individualHooks':!![]})[_0x368b('0x25')](respondWithResult(_0x378510,0xc9))[_0x368b('0x48')](handleError(_0x378510,null));};exports[_0x368b('0x24')]=function(_0x1174fa,_0x40a28f){if(_0x1174fa[_0x368b('0x4b')]['id']){delete _0x1174fa['body']['id'];}return db[_0x368b('0x2d')]['find']({'where':{'id':_0x1174fa[_0x368b('0x45')]['id']}})['then'](handleEntityNotFound(_0x40a28f,null))[_0x368b('0x25')](saveUpdates(_0x1174fa['body'],null))[_0x368b('0x25')](respondWithResult(_0x40a28f,null))[_0x368b('0x48')](handleError(_0x40a28f,null));};exports[_0x368b('0x26')]=function(_0x458d9a,_0x49b78c){return db[_0x368b('0x2d')][_0x368b('0x47')]({'where':{'id':_0x458d9a[_0x368b('0x45')]['id']}})[_0x368b('0x25')](handleEntityNotFound(_0x49b78c,null))[_0x368b('0x25')](removeEntity(_0x49b78c,null))[_0x368b('0x48')](handleError(_0x49b78c,null));};exports[_0x368b('0x4c')]=function(_0x15078b,_0x1a3ff4){return db['AnalyticFieldReport'][_0x368b('0x26')]({'where':{'id':_0x15078b[_0x368b('0x32')][_0x368b('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x368b('0x25')](respondWithResult(_0x1a3ff4,0xcc))[_0x368b('0x48')](handleError(_0x1a3ff4,null));};exports['addFields']=function(_0x16492f,_0x1ddb6e,_0x8bee0d){return db[_0x368b('0x4e')][_0x368b('0x4f')]({'where':{'id':_0x16492f[_0x368b('0x45')]['id']}})[_0x368b('0x25')](handleEntityNotFound(_0x1ddb6e,null))['then'](function(_0x50b9da){if(_0x50b9da){return db['sequelize']['transaction'](function(_0x1978a9){return db['AnalyticFieldReport'][_0x368b('0x26')]({'where':{'CustomReportId':_0x16492f[_0x368b('0x45')]['id']},'transaction':_0x1978a9})['then'](function(_0x5711ee){var _0x374742=_['map'](_0x16492f[_0x368b('0x4b')],function(_0x17446c){delete _0x17446c['id'];_0x17446c['CustomReportId']=_0x16492f[_0x368b('0x45')]['id'];return _0x17446c;});return db[_0x368b('0x2d')]['bulkCreate'](_0x374742,{'transaction':_0x1978a9});});})[_0x368b('0x25')](function(){return db['AnalyticFieldReport'][_0x368b('0x42')]({'where':{'CustomReportId':_0x16492f[_0x368b('0x45')]['id']}});});}})[_0x368b('0x25')](respondWithResult(_0x1ddb6e,null))[_0x368b('0x48')](handleError(_0x1ddb6e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 418d0b0..69ca298 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 _0x3577=['request-promise','path','rimraf','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2cc244,_0x28b022){var _0x4e9a69=function(_0x366003){while(--_0x366003){_0x2cc244['push'](_0x2cc244['shift']());}};_0x4e9a69(++_0x28b022);}(_0x3577,0x1f2));var _0x7357=function(_0x2d1e5a,_0xd12406){_0x2d1e5a=_0x2d1e5a-0x0;var _0x343aeb=_0x3577[_0x2d1e5a];return _0x343aeb;};'use strict';var _=require(_0x7357('0x0'));var util=require(_0x7357('0x1'));var logger=require(_0x7357('0x2'))(_0x7357('0x3'));var moment=require(_0x7357('0x4'));var BPromise=require(_0x7357('0x5'));var rp=require(_0x7357('0x6'));var fs=require('fs');var path=require(_0x7357('0x7'));var rimraf=require(_0x7357('0x8'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x7357('0x9')]=function(_0x598179,_0x414957){return _0x598179['define'](_0x7357('0xa'),attributes,{'tableName':_0x7357('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x797c=['define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports'];(function(_0x20a6b8,_0x2dc8bb){var _0x55600e=function(_0x5ed8a9){while(--_0x5ed8a9){_0x20a6b8['push'](_0x20a6b8['shift']());}};_0x55600e(++_0x2dc8bb);}(_0x797c,0xb9));var _0xc797=function(_0x125ff8,_0x41925f){_0x125ff8=_0x125ff8-0x0;var _0x2d9ef=_0x797c[_0x125ff8];return _0x2d9ef;};'use strict';var _=require(_0xc797('0x0'));var util=require('util');var logger=require(_0xc797('0x1'))('api');var moment=require(_0xc797('0x2'));var BPromise=require(_0xc797('0x3'));var rp=require(_0xc797('0x4'));var fs=require('fs');var path=require(_0xc797('0x5'));var rimraf=require(_0xc797('0x6'));var config=require(_0xc797('0x7'));var attributes=require(_0xc797('0x8'));module[_0xc797('0x9')]=function(_0x429c18,_0x19f8ba){return _0x429c18[_0xc797('0xa')](_0xc797('0xb'),attributes,{'tableName':_0xc797('0xc'),'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 fc9b090..09fbd9d 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 _0x07d2=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4654f,_0x582972){var _0x20864d=function(_0x374b4d){while(--_0x374b4d){_0x4654f['push'](_0x4654f['shift']());}};_0x20864d(++_0x582972);}(_0x07d2,0x135));var _0x207d=function(_0x2d08e3,_0x5661ec){_0x2d08e3=_0x2d08e3-0x0;var _0x2e8094=_0x07d2[_0x2d08e3];return _0x2e8094;};'use strict';var _=require(_0x207d('0x0'));var util=require(_0x207d('0x1'));var moment=require(_0x207d('0x2'));var BPromise=require('bluebird');var rs=require(_0x207d('0x3'));var fs=require('fs');var Redis=require(_0x207d('0x4'));var db=require(_0x207d('0x5'))['db'];var utils=require(_0x207d('0x6'));var logger=require(_0x207d('0x7'))(_0x207d('0x8'));var config=require('../../config/environment');var jayson=require(_0x207d('0x9'));var client=jayson[_0x207d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b090,_0x4c5608,_0x1293cf){return new BPromise(function(_0x31e416,_0x338831){return client[_0x207d('0xb')](_0x27b090,_0x1293cf)['then'](function(_0xb2bdc5){logger[_0x207d('0xc')](_0x207d('0xd'),_0x4c5608,_0x207d('0xe'));logger['debug'](_0x207d('0xf'),_0x4c5608,_0x207d('0xe'),JSON[_0x207d('0x10')](_0xb2bdc5));if(_0xb2bdc5[_0x207d('0x11')]){if(_0xb2bdc5[_0x207d('0x11')]['code']===0x1f4){logger[_0x207d('0x11')](_0x207d('0xd'),_0x4c5608,_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);return _0x338831(_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);}logger[_0x207d('0x11')](_0x207d('0xd'),_0x4c5608,_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);return _0x31e416(_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);}else{logger[_0x207d('0xc')](_0x207d('0xd'),_0x4c5608,_0x207d('0xe'));_0x31e416(_0xb2bdc5[_0x207d('0x13')][_0x207d('0x12')]);}})[_0x207d('0x14')](function(_0x2597c8){logger[_0x207d('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c5608,_0x2597c8);_0x338831(_0x2597c8);});});} \ No newline at end of file +var _0xc1d5=['error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x5cbace,_0x33943c){var _0x6de5b8=function(_0x5aae38){while(--_0x5aae38){_0x5cbace['push'](_0x5cbace['shift']());}};_0x6de5b8(++_0x33943c);}(_0xc1d5,0x94));var _0x5c1d=function(_0x139a4f,_0x5c6d66){_0x139a4f=_0x139a4f-0x0;var _0x46ed1c=_0xc1d5[_0x139a4f];return _0x46ed1c;};'use strict';var _=require(_0x5c1d('0x0'));var util=require(_0x5c1d('0x1'));var moment=require(_0x5c1d('0x2'));var BPromise=require(_0x5c1d('0x3'));var rs=require(_0x5c1d('0x4'));var fs=require('fs');var Redis=require(_0x5c1d('0x5'));var db=require(_0x5c1d('0x6'))['db'];var utils=require(_0x5c1d('0x7'));var logger=require(_0x5c1d('0x8'))('rpc');var config=require(_0x5c1d('0x9'));var jayson=require(_0x5c1d('0xa'));var client=jayson[_0x5c1d('0xb')][_0x5c1d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xcb63c8,_0x473c0b,_0x2727d3){return new BPromise(function(_0x3ca4fc,_0x2aa898){return client[_0x5c1d('0xd')](_0xcb63c8,_0x2727d3)['then'](function(_0x1c0f85){logger[_0x5c1d('0xe')](_0x5c1d('0xf'),_0x473c0b,'request\x20sent');logger[_0x5c1d('0x10')](_0x5c1d('0x11'),_0x473c0b,_0x5c1d('0x12'),JSON[_0x5c1d('0x13')](_0x1c0f85));if(_0x1c0f85['error']){if(_0x1c0f85[_0x5c1d('0x14')][_0x5c1d('0x15')]===0x1f4){logger[_0x5c1d('0x14')](_0x5c1d('0xf'),_0x473c0b,_0x1c0f85[_0x5c1d('0x14')]['message']);return _0x2aa898(_0x1c0f85[_0x5c1d('0x14')][_0x5c1d('0x16')]);}logger[_0x5c1d('0x14')](_0x5c1d('0xf'),_0x473c0b,_0x1c0f85[_0x5c1d('0x14')][_0x5c1d('0x16')]);return _0x3ca4fc(_0x1c0f85[_0x5c1d('0x14')][_0x5c1d('0x16')]);}else{logger[_0x5c1d('0xe')](_0x5c1d('0xf'),_0x473c0b,_0x5c1d('0x12'));_0x3ca4fc(_0x1c0f85[_0x5c1d('0x17')][_0x5c1d('0x16')]);}})['catch'](function(_0x2dcae1){logger['error'](_0x5c1d('0xf'),_0x473c0b,_0x2dcae1);_0x2aa898(_0x2dcae1);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1ee4057..7e00e37 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 _0x7217=['put','update','delete','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields'];(function(_0xdc9b83,_0x446c70){var _0x52cd13=function(_0xe46c9d){while(--_0xe46c9d){_0xdc9b83['push'](_0xdc9b83['shift']());}};_0x52cd13(++_0x446c70);}(_0x7217,0x19e));var _0x7721=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x7217[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xc')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0x10'),auth[_0x7721('0x8')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x13')]);router[_0x7721('0x14')]('/destroy_many',auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file +var _0x55ca=['/:id/create_many','addFields','put','update','delete','bulkDestroy','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','bulkCreate'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x55ca,0x126));var _0xa55c=function(_0x154192,_0x2d360f){_0x154192=_0x154192-0x0;var _0x3c2792=_0x55ca[_0x154192];return _0x3c2792;};'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 auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0xb')]('/',auth['isAuthenticated'](),controller[_0xa55c('0xc')]);router[_0xa55c('0xb')]('/create_many',auth['isAuthenticated'](),controller[_0xa55c('0xd')]);router[_0xa55c('0xb')](_0xa55c('0xe'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x10')](_0xa55c('0x9'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')]('/destroy_many',auth['isAuthenticated'](),controller[_0xa55c('0x13')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa55c('0x14')]);module[_0xa55c('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 fefe755..6266d93 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 _0x98dc=['STRING','name','sequelize','exports'];(function(_0x17c21e,_0x2abc24){var _0x4518a6=function(_0x50baff){while(--_0x50baff){_0x17c21e['push'](_0x17c21e['shift']());}};_0x4518a6(++_0x2abc24);}(_0x98dc,0x18a));var _0xc98d=function(_0x4048f4,_0x58f575){_0x4048f4=_0x4048f4-0x0;var _0x4f0706=_0x98dc[_0x4048f4];return _0x4f0706;};'use strict';var Sequelize=require(_0xc98d('0x0'));module[_0xc98d('0x1')]={'name':{'type':Sequelize[_0xc98d('0x2')],'allowNull':![],'unique':_0xc98d('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xc98d('0x2')]}}; \ No newline at end of file +var _0x2f68=['STRING','name','TEXT','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f68,0x12b));var _0x82f6=function(_0x446ca0,_0x10bf91){_0x446ca0=_0x446ca0-0x0;var _0x2035b6=_0x2f68[_0x446ca0];return _0x2035b6;};'use strict';var Sequelize=require('sequelize');module[_0x82f6('0x0')]={'name':{'type':Sequelize[_0x82f6('0x1')],'allowNull':![],'unique':_0x82f6('0x2')},'table':{'type':Sequelize[_0x82f6('0x1')]},'metric':{'type':Sequelize[_0x82f6('0x3')]},'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 0dda05e..999f13d 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 _0xbbe3=['options','findAll','rows','catch','show','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','pick','where','merge','filter'];(function(_0x2a5a5a,_0x139734){var _0x475fec=function(_0x2ac94f){while(--_0x2ac94f){_0x2a5a5a['push'](_0x2a5a5a['shift']());}};_0x475fec(++_0x139734);}(_0xbbe3,0x64));var _0x3bbe=function(_0x464ba0,_0x697f65){_0x464ba0=_0x464ba0-0x0;var _0xd022e8=_0xbbe3[_0x464ba0];return _0xd022e8;};'use strict';var pdf=require(_0x3bbe('0x0'));var emlformat=require(_0x3bbe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3bbe('0x2'));var jsonpatch=require(_0x3bbe('0x3'));var rp=require(_0x3bbe('0x4'));var moment=require('moment');var BPromise=require(_0x3bbe('0x5'));var Mustache=require(_0x3bbe('0x6'));var util=require(_0x3bbe('0x7'));var path=require(_0x3bbe('0x8'));var sox=require(_0x3bbe('0x9'));var csv=require(_0x3bbe('0xa'));var ejs=require(_0x3bbe('0xb'));var fs=require('fs');var _=require(_0x3bbe('0xc'));var squel=require(_0x3bbe('0xd'));var crypto=require(_0x3bbe('0xe'));var jsforce=require(_0x3bbe('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3bbe('0xa'));var querystring=require(_0x3bbe('0x10'));var Papa=require(_0x3bbe('0x11'));var Redis=require(_0x3bbe('0x12'));var authService=require(_0x3bbe('0x13'));var qs=require(_0x3bbe('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bbe('0x15'));var logger=require(_0x3bbe('0x16'))(_0x3bbe('0x17'));var utils=require(_0x3bbe('0x18'));var config=require('../../config/environment');var db=require(_0x3bbe('0x19'))['db'];function respondWithStatusCode(_0x35b7b4,_0x11390f){_0x11390f=_0x11390f||0xcc;return function(_0x8fcb3e){if(_0x8fcb3e){return _0x35b7b4[_0x3bbe('0x1a')](_0x11390f);}return _0x35b7b4[_0x3bbe('0x1b')](_0x11390f)[_0x3bbe('0x1c')]();};}function respondWithResult(_0x348031,_0x2a6b4e){_0x2a6b4e=_0x2a6b4e||0xc8;return function(_0x343ddf){if(_0x343ddf){return _0x348031['status'](_0x2a6b4e)[_0x3bbe('0x1d')](_0x343ddf);}};}function respondWithFilteredResult(_0x22d5ba,_0x512257){return function(_0x298d98){if(_0x298d98){var _0x510fe0=_0x298d98[_0x3bbe('0x1e')],_0x8a2b3=_0x512257[_0x3bbe('0x1f')],_0x1bdcb1=_0x512257[_0x3bbe('0x1f')]+_0x512257[_0x3bbe('0x20')],_0x4e54eb;if(_0x1bdcb1>=_0x510fe0){_0x1bdcb1=_0x510fe0;_0x4e54eb=0xc8;}else{_0x4e54eb=0xce;}_0x22d5ba[_0x3bbe('0x1b')](_0x4e54eb);return _0x22d5ba[_0x3bbe('0x21')](_0x3bbe('0x22'),_0x8a2b3+'-'+_0x1bdcb1+'/'+_0x510fe0)[_0x3bbe('0x1d')](_0x298d98);}return null;};}function patchUpdates(_0x5610af){return function(_0x44ec81){try{jsonpatch[_0x3bbe('0x23')](_0x44ec81,_0x5610af,!![]);}catch(_0x55964d){return BPromise['reject'](_0x55964d);}return _0x44ec81['save']();};}function saveUpdates(_0x23c4d0,_0x6e8c93){return function(_0x3c7ca0){if(_0x3c7ca0){return _0x3c7ca0[_0x3bbe('0x24')](_0x23c4d0)[_0x3bbe('0x25')](function(_0x3cef98){return _0x3cef98;});}return null;};}function removeEntity(_0x312d31,_0x414ab9){return function(_0x4b26dc){if(_0x4b26dc){return _0x4b26dc[_0x3bbe('0x26')]()[_0x3bbe('0x25')](function(){var _0x5d26bb=_0x4b26dc[_0x3bbe('0x27')]({'plain':!![]});var _0x3e746f=_0x3bbe('0x28');return db[_0x3bbe('0x29')][_0x3bbe('0x26')]({'where':{'type':_0x3e746f,'resourceId':_0x5d26bb['id']}})[_0x3bbe('0x25')](function(){return _0x4b26dc;});})[_0x3bbe('0x25')](function(){_0x312d31[_0x3bbe('0x1b')](0xcc)[_0x3bbe('0x1c')]();});}};}function handleEntityNotFound(_0x2b3784,_0x502236){return function(_0x1afeea){if(!_0x1afeea){_0x2b3784['sendStatus'](0x194);}return _0x1afeea;};}function handleError(_0x1582dd,_0x4f21b9){_0x4f21b9=_0x4f21b9||0x1f4;return function(_0xc6edfd){logger[_0x3bbe('0x2a')](_0xc6edfd[_0x3bbe('0x2b')]);if(_0xc6edfd[_0x3bbe('0x2c')]){delete _0xc6edfd[_0x3bbe('0x2c')];}_0x1582dd[_0x3bbe('0x1b')](_0x4f21b9)[_0x3bbe('0x2d')](_0xc6edfd);};}exports['index']=function(_0x55f8fc,_0x416050){var _0x4f1406={},_0x38c353={},_0x33b00b={'count':0x0,'rows':[]};var _0x505ff9=_[_0x3bbe('0x2e')](db[_0x3bbe('0x2f')][_0x3bbe('0x30')],function(_0x30cb72){return{'name':_0x30cb72[_0x3bbe('0x31')],'type':_0x30cb72[_0x3bbe('0x32')][_0x3bbe('0x33')]};});_0x38c353[_0x3bbe('0x34')]=_[_0x3bbe('0x2e')](_0x505ff9,_0x3bbe('0x2c'));_0x38c353['query']=_['keys'](_0x55f8fc[_0x3bbe('0x35')]);_0x38c353[_0x3bbe('0x36')]=_[_0x3bbe('0x37')](_0x38c353['model'],_0x38c353['query']);_0x4f1406[_0x3bbe('0x38')]=_[_0x3bbe('0x37')](_0x38c353['model'],qs['fields'](_0x55f8fc[_0x3bbe('0x35')]['fields']));_0x4f1406[_0x3bbe('0x38')]=_0x4f1406[_0x3bbe('0x38')][_0x3bbe('0x39')]?_0x4f1406[_0x3bbe('0x38')]:_0x38c353['model'];if(!_0x55f8fc[_0x3bbe('0x35')][_0x3bbe('0x3a')]('nolimit')){_0x4f1406['limit']=qs['limit'](_0x55f8fc[_0x3bbe('0x35')]['limit']);_0x4f1406['offset']=qs['offset'](_0x55f8fc[_0x3bbe('0x35')][_0x3bbe('0x1f')]);}_0x4f1406[_0x3bbe('0x3b')]=qs['sort'](_0x55f8fc[_0x3bbe('0x35')]['sort']);_0x4f1406['where']=qs[_0x3bbe('0x36')](_[_0x3bbe('0x3c')](_0x55f8fc[_0x3bbe('0x35')],_0x38c353['filters']));if(_0x55f8fc[_0x3bbe('0x35')]['filter']){_0x4f1406[_0x3bbe('0x3d')]=_[_0x3bbe('0x3e')](_0x4f1406[_0x3bbe('0x3d')],{'$or':_[_0x3bbe('0x2e')](_0x505ff9,function(_0x43c24a){if(_0x43c24a[_0x3bbe('0x32')]!=='VIRTUAL'){var _0x403e94={};_0x403e94[_0x43c24a['name']]={'$like':'%'+_0x55f8fc[_0x3bbe('0x35')][_0x3bbe('0x3f')]+'%'};return _0x403e94;}})});}_0x4f1406=_[_0x3bbe('0x3e')]({},_0x4f1406,_0x55f8fc[_0x3bbe('0x40')]);var _0x3143f1={'where':_0x4f1406[_0x3bbe('0x3d')]};return db[_0x3bbe('0x2f')][_0x3bbe('0x1e')](_0x3143f1)[_0x3bbe('0x25')](function(_0x4afe6a){_0x33b00b['count']=_0x4afe6a;if(_0x55f8fc['query']['includeAll']){_0x4f1406['include']=[{'all':!![]}];}return db[_0x3bbe('0x2f')][_0x3bbe('0x41')](_0x4f1406);})[_0x3bbe('0x25')](function(_0x5df2fc){_0x33b00b[_0x3bbe('0x42')]=_0x5df2fc;return _0x33b00b;})[_0x3bbe('0x25')](respondWithFilteredResult(_0x416050,_0x4f1406))[_0x3bbe('0x43')](handleError(_0x416050,null));};exports[_0x3bbe('0x44')]=function(_0x55987e,_0xfc6d33){var _0x472c52={'raw':!![],'where':{'id':_0x55987e['params']['id']}},_0x2a1a7b={};_0x2a1a7b[_0x3bbe('0x34')]=_[_0x3bbe('0x45')](db[_0x3bbe('0x2f')]['rawAttributes']);_0x2a1a7b[_0x3bbe('0x35')]=_['keys'](_0x55987e[_0x3bbe('0x35')]);_0x2a1a7b[_0x3bbe('0x36')]=_[_0x3bbe('0x37')](_0x2a1a7b[_0x3bbe('0x34')],_0x2a1a7b[_0x3bbe('0x35')]);_0x472c52[_0x3bbe('0x38')]=_['intersection'](_0x2a1a7b[_0x3bbe('0x34')],qs['fields'](_0x55987e['query'][_0x3bbe('0x46')]));_0x472c52['attributes']=_0x472c52[_0x3bbe('0x38')][_0x3bbe('0x39')]?_0x472c52[_0x3bbe('0x38')]:_0x2a1a7b[_0x3bbe('0x34')];if(_0x55987e[_0x3bbe('0x35')]['includeAll']){_0x472c52['include']=[{'all':!![]}];}_0x472c52=_[_0x3bbe('0x3e')]({},_0x472c52,_0x55987e[_0x3bbe('0x40')]);return db[_0x3bbe('0x2f')][_0x3bbe('0x47')](_0x472c52)[_0x3bbe('0x25')](handleEntityNotFound(_0xfc6d33,null))[_0x3bbe('0x25')](respondWithResult(_0xfc6d33,null))['catch'](handleError(_0xfc6d33,null));};exports[_0x3bbe('0x48')]=function(_0x30610e,_0x4f0a50){return db[_0x3bbe('0x2f')][_0x3bbe('0x48')](_0x30610e[_0x3bbe('0x49')],{})[_0x3bbe('0x25')](function(_0x489192){var _0x393fbf=_0x30610e[_0x3bbe('0x4a')]['get']({'plain':!![]});if(!_0x393fbf)throw new Error(_0x3bbe('0x4b'));if(_0x393fbf[_0x3bbe('0x4c')]===_0x3bbe('0x4a')){var _0x438d9b=_0x489192[_0x3bbe('0x27')]({'plain':!![]});var _0x1f51b3=_0x3bbe('0x28');return db[_0x3bbe('0x4d')][_0x3bbe('0x47')]({'where':{'name':_0x1f51b3,'userProfileId':_0x393fbf[_0x3bbe('0x4e')]},'raw':!![]})[_0x3bbe('0x25')](function(_0x46e8c8){if(_0x46e8c8&&_0x46e8c8[_0x3bbe('0x4f')]===0x0){return db[_0x3bbe('0x29')]['create']({'name':_0x438d9b[_0x3bbe('0x2c')],'resourceId':_0x438d9b['id'],'type':_0x46e8c8[_0x3bbe('0x2c')],'sectionId':_0x46e8c8['id']},{})[_0x3bbe('0x25')](function(){return _0x489192;});}else{return _0x489192;}})[_0x3bbe('0x43')](function(_0x40f722){logger[_0x3bbe('0x2a')](_0x3bbe('0x50'),_0x40f722);throw _0x40f722;});}return _0x489192;})[_0x3bbe('0x25')](respondWithResult(_0x4f0a50,0xc9))['catch'](handleError(_0x4f0a50,null));};exports['update']=function(_0x25c861,_0x57c747){if(_0x25c861[_0x3bbe('0x49')]['id']){delete _0x25c861[_0x3bbe('0x49')]['id'];}return db[_0x3bbe('0x2f')][_0x3bbe('0x47')]({'where':{'id':_0x25c861[_0x3bbe('0x51')]['id']}})[_0x3bbe('0x25')](handleEntityNotFound(_0x57c747,null))[_0x3bbe('0x25')](saveUpdates(_0x25c861['body'],null))[_0x3bbe('0x25')](respondWithResult(_0x57c747,null))[_0x3bbe('0x43')](handleError(_0x57c747,null));};exports['destroy']=function(_0x2dda53,_0x186e86){return db[_0x3bbe('0x2f')][_0x3bbe('0x47')]({'where':{'id':_0x2dda53['params']['id']}})[_0x3bbe('0x25')](handleEntityNotFound(_0x186e86,null))[_0x3bbe('0x25')](removeEntity(_0x186e86,null))[_0x3bbe('0x43')](handleError(_0x186e86,null));}; \ No newline at end of file +var _0xd2c7=['options','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','index','map','AnalyticMetric','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge'];(function(_0x409d2b,_0x147a84){var _0x37a5c6=function(_0x584995){while(--_0x584995){_0x409d2b['push'](_0x409d2b['shift']());}};_0x37a5c6(++_0x147a84);}(_0xd2c7,0x1af));var _0x7d2c=function(_0x64fb03,_0x2efe40){_0x64fb03=_0x64fb03-0x0;var _0x55d008=_0xd2c7[_0x64fb03];return _0x55d008;};'use strict';var pdf=require(_0x7d2c('0x0'));var emlformat=require(_0x7d2c('0x1'));var rimraf=require(_0x7d2c('0x2'));var zipdir=require(_0x7d2c('0x3'));var jsonpatch=require(_0x7d2c('0x4'));var rp=require(_0x7d2c('0x5'));var moment=require(_0x7d2c('0x6'));var BPromise=require(_0x7d2c('0x7'));var Mustache=require(_0x7d2c('0x8'));var util=require(_0x7d2c('0x9'));var path=require(_0x7d2c('0xa'));var sox=require(_0x7d2c('0xb'));var csv=require(_0x7d2c('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7d2c('0xd'));var jsforce=require(_0x7d2c('0xe'));var deskjs=require(_0x7d2c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7d2c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7d2c('0x11'));var hardwareService=require(_0x7d2c('0x12'));var logger=require(_0x7d2c('0x13'))(_0x7d2c('0x14'));var utils=require('../../config/utils');var config=require(_0x7d2c('0x15'));var db=require(_0x7d2c('0x16'))['db'];function respondWithStatusCode(_0x5c3571,_0x506b9a){_0x506b9a=_0x506b9a||0xcc;return function(_0x4bb5da){if(_0x4bb5da){return _0x5c3571[_0x7d2c('0x17')](_0x506b9a);}return _0x5c3571[_0x7d2c('0x18')](_0x506b9a)[_0x7d2c('0x19')]();};}function respondWithResult(_0x381525,_0x4325e8){_0x4325e8=_0x4325e8||0xc8;return function(_0x142ff9){if(_0x142ff9){return _0x381525['status'](_0x4325e8)['json'](_0x142ff9);}};}function respondWithFilteredResult(_0x1679fd,_0x19a246){return function(_0x49e3d3){if(_0x49e3d3){var _0x458a9b=_0x49e3d3[_0x7d2c('0x1a')],_0x2b578f=_0x19a246[_0x7d2c('0x1b')],_0x4f91a3=_0x19a246[_0x7d2c('0x1b')]+_0x19a246[_0x7d2c('0x1c')],_0x55f4aa;if(_0x4f91a3>=_0x458a9b){_0x4f91a3=_0x458a9b;_0x55f4aa=0xc8;}else{_0x55f4aa=0xce;}_0x1679fd['status'](_0x55f4aa);return _0x1679fd['set'](_0x7d2c('0x1d'),_0x2b578f+'-'+_0x4f91a3+'/'+_0x458a9b)['json'](_0x49e3d3);}return null;};}function patchUpdates(_0x856ab4){return function(_0xb18d54){try{jsonpatch[_0x7d2c('0x1e')](_0xb18d54,_0x856ab4,!![]);}catch(_0x53dae9){return BPromise[_0x7d2c('0x1f')](_0x53dae9);}return _0xb18d54[_0x7d2c('0x20')]();};}function saveUpdates(_0x44138c,_0x5d6ab9){return function(_0x42a2bf){if(_0x42a2bf){return _0x42a2bf[_0x7d2c('0x21')](_0x44138c)[_0x7d2c('0x22')](function(_0x250659){return _0x250659;});}return null;};}function removeEntity(_0x85484b,_0x41ce79){return function(_0x5816bc){if(_0x5816bc){return _0x5816bc[_0x7d2c('0x23')]()[_0x7d2c('0x22')](function(){var _0x49f275=_0x5816bc[_0x7d2c('0x24')]({'plain':!![]});var _0x9a7226='Metrics';return db[_0x7d2c('0x25')]['destroy']({'where':{'type':_0x9a7226,'resourceId':_0x49f275['id']}})[_0x7d2c('0x22')](function(){return _0x5816bc;});})['then'](function(){_0x85484b[_0x7d2c('0x18')](0xcc)[_0x7d2c('0x19')]();});}};}function handleEntityNotFound(_0x434314,_0x212a4f){return function(_0x1d4277){if(!_0x1d4277){_0x434314[_0x7d2c('0x17')](0x194);}return _0x1d4277;};}function handleError(_0x497af2,_0x1f5292){_0x1f5292=_0x1f5292||0x1f4;return function(_0x572c82){logger[_0x7d2c('0x26')](_0x572c82[_0x7d2c('0x27')]);if(_0x572c82['name']){delete _0x572c82['name'];}_0x497af2[_0x7d2c('0x18')](_0x1f5292)['send'](_0x572c82);};}exports[_0x7d2c('0x28')]=function(_0x3fe062,_0x1c4fc8){var _0x135257={},_0x53a064={},_0xf293b2={'count':0x0,'rows':[]};var _0x82f7c6=_[_0x7d2c('0x29')](db[_0x7d2c('0x2a')]['rawAttributes'],function(_0x9ab396){return{'name':_0x9ab396['fieldName'],'type':_0x9ab396[_0x7d2c('0x2b')][_0x7d2c('0x2c')]};});_0x53a064[_0x7d2c('0x2d')]=_[_0x7d2c('0x29')](_0x82f7c6,'name');_0x53a064[_0x7d2c('0x2e')]=_[_0x7d2c('0x2f')](_0x3fe062[_0x7d2c('0x2e')]);_0x53a064[_0x7d2c('0x30')]=_[_0x7d2c('0x31')](_0x53a064[_0x7d2c('0x2d')],_0x53a064[_0x7d2c('0x2e')]);_0x135257[_0x7d2c('0x32')]=_[_0x7d2c('0x31')](_0x53a064[_0x7d2c('0x2d')],qs['fields'](_0x3fe062[_0x7d2c('0x2e')]['fields']));_0x135257[_0x7d2c('0x32')]=_0x135257['attributes'][_0x7d2c('0x33')]?_0x135257[_0x7d2c('0x32')]:_0x53a064['model'];if(!_0x3fe062['query'][_0x7d2c('0x34')](_0x7d2c('0x35'))){_0x135257['limit']=qs[_0x7d2c('0x1c')](_0x3fe062['query'][_0x7d2c('0x1c')]);_0x135257[_0x7d2c('0x1b')]=qs[_0x7d2c('0x1b')](_0x3fe062[_0x7d2c('0x2e')][_0x7d2c('0x1b')]);}_0x135257[_0x7d2c('0x36')]=qs[_0x7d2c('0x37')](_0x3fe062[_0x7d2c('0x2e')][_0x7d2c('0x37')]);_0x135257[_0x7d2c('0x38')]=qs[_0x7d2c('0x30')](_[_0x7d2c('0x39')](_0x3fe062[_0x7d2c('0x2e')],_0x53a064[_0x7d2c('0x30')]));if(_0x3fe062[_0x7d2c('0x2e')][_0x7d2c('0x3a')]){_0x135257['where']=_['merge'](_0x135257[_0x7d2c('0x38')],{'$or':_[_0x7d2c('0x29')](_0x82f7c6,function(_0x4c3222){if(_0x4c3222['type']!==_0x7d2c('0x3b')){var _0x4eda91={};_0x4eda91[_0x4c3222['name']]={'$like':'%'+_0x3fe062[_0x7d2c('0x2e')][_0x7d2c('0x3a')]+'%'};return _0x4eda91;}})});}_0x135257=_[_0x7d2c('0x3c')]({},_0x135257,_0x3fe062[_0x7d2c('0x3d')]);var _0xa6cbda={'where':_0x135257[_0x7d2c('0x38')]};return db['AnalyticMetric'][_0x7d2c('0x1a')](_0xa6cbda)['then'](function(_0x3f94c2){_0xf293b2['count']=_0x3f94c2;if(_0x3fe062[_0x7d2c('0x2e')]['includeAll']){_0x135257['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0x7d2c('0x3e')](_0x135257);})['then'](function(_0x5c4b9f){_0xf293b2[_0x7d2c('0x3f')]=_0x5c4b9f;return _0xf293b2;})[_0x7d2c('0x22')](respondWithFilteredResult(_0x1c4fc8,_0x135257))[_0x7d2c('0x40')](handleError(_0x1c4fc8,null));};exports[_0x7d2c('0x41')]=function(_0x32f937,_0x4e0a77){var _0x4882d9={'raw':!![],'where':{'id':_0x32f937[_0x7d2c('0x42')]['id']}},_0x39b67b={};_0x39b67b['model']=_[_0x7d2c('0x2f')](db[_0x7d2c('0x2a')][_0x7d2c('0x43')]);_0x39b67b[_0x7d2c('0x2e')]=_[_0x7d2c('0x2f')](_0x32f937[_0x7d2c('0x2e')]);_0x39b67b[_0x7d2c('0x30')]=_['intersection'](_0x39b67b['model'],_0x39b67b[_0x7d2c('0x2e')]);_0x4882d9[_0x7d2c('0x32')]=_[_0x7d2c('0x31')](_0x39b67b[_0x7d2c('0x2d')],qs[_0x7d2c('0x44')](_0x32f937[_0x7d2c('0x2e')][_0x7d2c('0x44')]));_0x4882d9[_0x7d2c('0x32')]=_0x4882d9['attributes'][_0x7d2c('0x33')]?_0x4882d9[_0x7d2c('0x32')]:_0x39b67b[_0x7d2c('0x2d')];if(_0x32f937[_0x7d2c('0x2e')][_0x7d2c('0x45')]){_0x4882d9[_0x7d2c('0x46')]=[{'all':!![]}];}_0x4882d9=_[_0x7d2c('0x3c')]({},_0x4882d9,_0x32f937[_0x7d2c('0x3d')]);return db[_0x7d2c('0x2a')]['find'](_0x4882d9)[_0x7d2c('0x22')](handleEntityNotFound(_0x4e0a77,null))['then'](respondWithResult(_0x4e0a77,null))[_0x7d2c('0x40')](handleError(_0x4e0a77,null));};exports[_0x7d2c('0x47')]=function(_0x5d11cb,_0x45a7c9){return db[_0x7d2c('0x2a')][_0x7d2c('0x47')](_0x5d11cb[_0x7d2c('0x48')],{})['then'](function(_0x813ec4){var _0x8bb111=_0x5d11cb[_0x7d2c('0x49')][_0x7d2c('0x24')]({'plain':!![]});if(!_0x8bb111)throw new Error(_0x7d2c('0x4a'));if(_0x8bb111[_0x7d2c('0x4b')]===_0x7d2c('0x49')){var _0x4fff32=_0x813ec4[_0x7d2c('0x24')]({'plain':!![]});var _0x4d8f48=_0x7d2c('0x4c');return db[_0x7d2c('0x4d')]['find']({'where':{'name':_0x4d8f48,'userProfileId':_0x8bb111['userProfileId']},'raw':!![]})['then'](function(_0x211e7c){if(_0x211e7c&&_0x211e7c[_0x7d2c('0x4e')]===0x0){return db[_0x7d2c('0x25')][_0x7d2c('0x47')]({'name':_0x4fff32[_0x7d2c('0x4f')],'resourceId':_0x4fff32['id'],'type':_0x211e7c[_0x7d2c('0x4f')],'sectionId':_0x211e7c['id']},{})[_0x7d2c('0x22')](function(){return _0x813ec4;});}else{return _0x813ec4;}})['catch'](function(_0x143462){logger[_0x7d2c('0x26')](_0x7d2c('0x50'),_0x143462);throw _0x143462;});}return _0x813ec4;})[_0x7d2c('0x22')](respondWithResult(_0x45a7c9,0xc9))[_0x7d2c('0x40')](handleError(_0x45a7c9,null));};exports[_0x7d2c('0x21')]=function(_0x233ded,_0xe4db1f){if(_0x233ded['body']['id']){delete _0x233ded[_0x7d2c('0x48')]['id'];}return db[_0x7d2c('0x2a')][_0x7d2c('0x51')]({'where':{'id':_0x233ded[_0x7d2c('0x42')]['id']}})[_0x7d2c('0x22')](handleEntityNotFound(_0xe4db1f,null))[_0x7d2c('0x22')](saveUpdates(_0x233ded[_0x7d2c('0x48')],null))['then'](respondWithResult(_0xe4db1f,null))[_0x7d2c('0x40')](handleError(_0xe4db1f,null));};exports[_0x7d2c('0x23')]=function(_0x1fd29a,_0x2de04b){return db[_0x7d2c('0x2a')]['find']({'where':{'id':_0x1fd29a['params']['id']}})[_0x7d2c('0x22')](handleEntityNotFound(_0x2de04b,null))[_0x7d2c('0x22')](removeEntity(_0x2de04b,null))[_0x7d2c('0x40')](handleError(_0x2de04b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 1b0396a..b924be5 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 _0xe84e=['../../config/logger','api','moment','bluebird','path','rimraf','define','lodash','util'];(function(_0xc554a1,_0x3a43c5){var _0x336c82=function(_0x1bbe03){while(--_0x1bbe03){_0xc554a1['push'](_0xc554a1['shift']());}};_0x336c82(++_0x3a43c5);}(_0xe84e,0x73));var _0xee84=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0xe84e[_0xab0515];return _0x443d59;};'use strict';var _=require(_0xee84('0x0'));var util=require(_0xee84('0x1'));var logger=require(_0xee84('0x2'))(_0xee84('0x3'));var moment=require(_0xee84('0x4'));var BPromise=require(_0xee84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee84('0x6'));var rimraf=require(_0xee84('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x458e86,_0x308bff){return _0x458e86[_0xee84('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc65=['./analyticMetric.attributes','exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3a485b,_0x1a1b38){var _0x379adc=function(_0x182efd){while(--_0x182efd){_0x3a485b['push'](_0x3a485b['shift']());}};_0x379adc(++_0x1a1b38);}(_0xcc65,0xf4));var _0x5cc6=function(_0x22490e,_0x4935bd){_0x22490e=_0x22490e-0x0;var _0x5b6459=_0xcc65[_0x22490e];return _0x5b6459;};'use strict';var _=require(_0x5cc6('0x0'));var util=require(_0x5cc6('0x1'));var logger=require(_0x5cc6('0x2'))(_0x5cc6('0x3'));var moment=require(_0x5cc6('0x4'));var BPromise=require(_0x5cc6('0x5'));var rp=require(_0x5cc6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5cc6('0x7'));var config=require('../../config/environment');var attributes=require(_0x5cc6('0x8'));module[_0x5cc6('0x9')]=function(_0x2a9853,_0x38859e){return _0x2a9853['define'](_0x5cc6('0xa'),attributes,{'tableName':_0x5cc6('0xb'),'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 5e693e5..87a9fc1 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 _0x68b3=['info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x231e67,_0x291499){var _0x35066f=function(_0x3a7775){while(--_0x3a7775){_0x231e67['push'](_0x231e67['shift']());}};_0x35066f(++_0x291499);}(_0x68b3,0x112));var _0x368b=function(_0x32101d,_0x24d9ad){_0x32101d=_0x32101d-0x0;var _0x263ede=_0x68b3[_0x32101d];return _0x263ede;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x368b('0x4'));var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require(_0x368b('0x9'));var jayson=require(_0x368b('0xa'));var client=jayson[_0x368b('0xb')][_0x368b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44f882,_0xdec1b,_0x115a9c){return new BPromise(function(_0x291096,_0xf4e1b){return client[_0x368b('0xd')](_0x44f882,_0x115a9c)['then'](function(_0x55b4d7){logger[_0x368b('0xe')](_0x368b('0xf'),_0xdec1b,'request\x20sent');logger[_0x368b('0x10')](_0x368b('0x11'),_0xdec1b,_0x368b('0x12'),JSON['stringify'](_0x55b4d7));if(_0x55b4d7[_0x368b('0x13')]){if(_0x55b4d7[_0x368b('0x13')][_0x368b('0x14')]===0x1f4){logger[_0x368b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0xdec1b,_0x55b4d7[_0x368b('0x13')]['message']);return _0xf4e1b(_0x55b4d7[_0x368b('0x13')][_0x368b('0x15')]);}logger[_0x368b('0x13')](_0x368b('0xf'),_0xdec1b,_0x55b4d7['error'][_0x368b('0x15')]);return _0x291096(_0x55b4d7[_0x368b('0x13')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0xdec1b,_0x368b('0x12'));_0x291096(_0x55b4d7[_0x368b('0x16')]['message']);}})[_0x368b('0x17')](function(_0x2b214c){logger[_0x368b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0xdec1b,_0x2b214c);_0xf4e1b(_0x2b214c);});});} \ No newline at end of file +var _0xa666=['AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa666,0xce));var _0x6a66=function(_0x4dd2d0,_0x21a9d0){_0x4dd2d0=_0x4dd2d0-0x0;var _0x36f7d1=_0xa666[_0x4dd2d0];return _0x36f7d1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6a66('0x0'));var BPromise=require(_0x6a66('0x1'));var rs=require(_0x6a66('0x2'));var fs=require('fs');var Redis=require(_0x6a66('0x3'));var db=require(_0x6a66('0x4'))['db'];var utils=require(_0x6a66('0x5'));var logger=require(_0x6a66('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6a66('0x7'));var client=jayson['client'][_0x6a66('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5c9343,_0x28184a,_0x3d93ed){return new BPromise(function(_0x51b4c0,_0x44747a){return client[_0x6a66('0x9')](_0x5c9343,_0x3d93ed)[_0x6a66('0xa')](function(_0x4e6b99){logger[_0x6a66('0xb')](_0x6a66('0xc'),_0x28184a,_0x6a66('0xd'));logger['debug'](_0x6a66('0xe'),_0x28184a,_0x6a66('0xd'),JSON[_0x6a66('0xf')](_0x4e6b99));if(_0x4e6b99[_0x6a66('0x10')]){if(_0x4e6b99['error']['code']===0x1f4){logger[_0x6a66('0x10')](_0x6a66('0xc'),_0x28184a,_0x4e6b99[_0x6a66('0x10')]['message']);return _0x44747a(_0x4e6b99['error'][_0x6a66('0x11')]);}logger[_0x6a66('0x10')](_0x6a66('0xc'),_0x28184a,_0x4e6b99[_0x6a66('0x10')][_0x6a66('0x11')]);return _0x51b4c0(_0x4e6b99[_0x6a66('0x10')][_0x6a66('0x11')]);}else{logger['info'](_0x6a66('0xc'),_0x28184a,'request\x20sent');_0x51b4c0(_0x4e6b99[_0x6a66('0x12')][_0x6a66('0x11')]);}})[_0x6a66('0x13')](function(_0xd1105a){logger[_0x6a66('0x10')](_0x6a66('0xc'),_0x28184a,_0xd1105a);_0x44747a(_0xd1105a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 15e1051..c58de0f 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 _0x2675=['post','put','update','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x392695,_0x12403e){var _0x1d612a=function(_0x1f5587){while(--_0x1f5587){_0x392695['push'](_0x392695['shift']());}};_0x1d612a(++_0x12403e);}(_0x2675,0x75));var _0x5267=function(_0x253929,_0x255d8e){_0x253929=_0x253929-0x0;var _0x582fe2=_0x2675[_0x253929];return _0x582fe2;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5267('0x3'));var config=require(_0x5267('0x4'));var controller=require('./analyticMetric.controller');router[_0x5267('0x5')]('/',auth[_0x5267('0x6')](),controller[_0x5267('0x7')]);router[_0x5267('0x5')](_0x5267('0x8'),auth[_0x5267('0x6')](),controller['show']);router[_0x5267('0x9')]('/',auth[_0x5267('0x6')](),controller['create']);router[_0x5267('0xa')]('/:id',auth[_0x5267('0x6')](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x6')](),controller['destroy']);module[_0x5267('0xd')]=router; \ No newline at end of file +var _0x53ec=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x53ec,0x192));var _0xc53e=function(_0x51276e,_0x28b616){_0x51276e=_0x51276e-0x0;var _0x1f5f30=_0x53ec[_0x51276e];return _0x1f5f30;};'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 auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc53e('0x9')]);router['get'](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller['show']);router[_0xc53e('0xc')]('/',auth[_0xc53e('0xb')](),controller[_0xc53e('0xd')]);router[_0xc53e('0xe')](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xc53e('0x11')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 9302f74..e8e698d 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 _0x1fb9=['sequelize','exports'];(function(_0x2fe2ea,_0x4a9040){var _0x49121a=function(_0x224665){while(--_0x224665){_0x2fe2ea['push'](_0x2fe2ea['shift']());}};_0x49121a(++_0x4a9040);}(_0x1fb9,0x94));var _0x91fb=function(_0x2f7e15,_0x6e0949){_0x2f7e15=_0x2f7e15-0x0;var _0xbf1bf1=_0x1fb9[_0x2f7e15];return _0xbf1bf1;};'use strict';var Sequelize=require(_0x91fb('0x0'));module[_0x91fb('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x2097=['TEXT','exports'];(function(_0x430229,_0x5f88d2){var _0x4ac616=function(_0x980bc5){while(--_0x980bc5){_0x430229['push'](_0x430229['shift']());}};_0x4ac616(++_0x5f88d2);}(_0x2097,0x69));var _0x7209=function(_0x149af8,_0x1922e6){_0x149af8=_0x149af8-0x0;var _0x43e7a2=_0x2097[_0x149af8];return _0x43e7a2;};'use strict';var Sequelize=require('sequelize');module[_0x7209('0x0')]={'tree':{'type':Sequelize[_0x7209('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 8cc7b86..096d7f2 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 _0x0bb5=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','then','rows','show','params','options','find','catch','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x0bb5,0x148));var _0x50bb=function(_0x10ef2b,_0x2cccde){_0x10ef2b=_0x10ef2b-0x0;var _0x1b98c5=_0x0bb5[_0x10ef2b];return _0x1b98c5;};'use strict';var pdf=require(_0x50bb('0x0'));var emlformat=require(_0x50bb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50bb('0x2'));var rp=require(_0x50bb('0x3'));var moment=require(_0x50bb('0x4'));var BPromise=require(_0x50bb('0x5'));var Mustache=require(_0x50bb('0x6'));var util=require(_0x50bb('0x7'));var path=require(_0x50bb('0x8'));var sox=require(_0x50bb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var db=require(_0x50bb('0x18'))['db'];function respondWithStatusCode(_0x4d7e3d,_0x226370){_0x226370=_0x226370||0xcc;return function(_0x58837d){if(_0x58837d){return _0x4d7e3d[_0x50bb('0x19')](_0x226370);}return _0x4d7e3d[_0x50bb('0x1a')](_0x226370)[_0x50bb('0x1b')]();};}function respondWithResult(_0x502250,_0x17007f){_0x17007f=_0x17007f||0xc8;return function(_0x309986){if(_0x309986){return _0x502250[_0x50bb('0x1a')](_0x17007f)['json'](_0x309986);}};}function respondWithFilteredResult(_0xbbc6a0,_0x5e8478){return function(_0x21befa){if(_0x21befa){var _0x3e1a51=_0x21befa['count'],_0x253073=_0x5e8478[_0x50bb('0x1c')],_0x42ffab=_0x5e8478[_0x50bb('0x1c')]+_0x5e8478['limit'],_0x908950;if(_0x42ffab>=_0x3e1a51){_0x42ffab=_0x3e1a51;_0x908950=0xc8;}else{_0x908950=0xce;}_0xbbc6a0[_0x50bb('0x1a')](_0x908950);return _0xbbc6a0['set'](_0x50bb('0x1d'),_0x253073+'-'+_0x42ffab+'/'+_0x3e1a51)[_0x50bb('0x1e')](_0x21befa);}return null;};}function patchUpdates(_0x4b06f5){return function(_0x4f1c0a){try{jsonpatch[_0x50bb('0x1f')](_0x4f1c0a,_0x4b06f5,!![]);}catch(_0x1499dc){return BPromise[_0x50bb('0x20')](_0x1499dc);}return _0x4f1c0a[_0x50bb('0x21')]();};}function saveUpdates(_0x56b25a,_0x19dc5d){return function(_0x32bfc3){if(_0x32bfc3){return _0x32bfc3[_0x50bb('0x22')](_0x56b25a)['then'](function(_0x3104c8){return _0x3104c8;});}return null;};}function removeEntity(_0x879fea,_0x1344ec){return function(_0x4825f8){if(_0x4825f8){return _0x4825f8[_0x50bb('0x23')]()['then'](function(){_0x879fea[_0x50bb('0x1a')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(!_0x846311){_0x1a2a0b[_0x50bb('0x19')](0x194);}return _0x846311;};}function handleError(_0x4f7f73,_0xad17ac){_0xad17ac=_0xad17ac||0x1f4;return function(_0xee0af0){logger[_0x50bb('0x24')](_0xee0af0[_0x50bb('0x25')]);if(_0xee0af0['name']){delete _0xee0af0[_0x50bb('0x26')];}_0x4f7f73['status'](_0xad17ac)['send'](_0xee0af0);};}exports[_0x50bb('0x27')]=function(_0x491632,_0x5cfe4b){var _0x41fd89={},_0x12ee2c={},_0x3004a3={'count':0x0,'rows':[]};var _0x1b74f9=_[_0x50bb('0x28')](db[_0x50bb('0x29')][_0x50bb('0x2a')],function(_0x41d479){return{'name':_0x41d479['fieldName'],'type':_0x41d479[_0x50bb('0x2b')][_0x50bb('0x2c')]};});_0x12ee2c[_0x50bb('0x2d')]=_[_0x50bb('0x28')](_0x1b74f9,'name');_0x12ee2c[_0x50bb('0x2e')]=_[_0x50bb('0x2f')](_0x491632[_0x50bb('0x2e')]);_0x12ee2c[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x12ee2c[_0x50bb('0x2d')],_0x12ee2c[_0x50bb('0x2e')]);_0x41fd89[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x12ee2c[_0x50bb('0x2d')],qs[_0x50bb('0x33')](_0x491632[_0x50bb('0x2e')]['fields']));_0x41fd89[_0x50bb('0x32')]=_0x41fd89[_0x50bb('0x32')][_0x50bb('0x34')]?_0x41fd89[_0x50bb('0x32')]:_0x12ee2c[_0x50bb('0x2d')];if(!_0x491632[_0x50bb('0x2e')][_0x50bb('0x35')](_0x50bb('0x36'))){_0x41fd89[_0x50bb('0x37')]=qs[_0x50bb('0x37')](_0x491632[_0x50bb('0x2e')]['limit']);_0x41fd89[_0x50bb('0x1c')]=qs[_0x50bb('0x1c')](_0x491632[_0x50bb('0x2e')][_0x50bb('0x1c')]);}_0x41fd89[_0x50bb('0x38')]=qs[_0x50bb('0x39')](_0x491632['query']['sort']);_0x41fd89[_0x50bb('0x3a')]=qs['filters'](_[_0x50bb('0x3b')](_0x491632[_0x50bb('0x2e')],_0x12ee2c[_0x50bb('0x30')]));if(_0x491632[_0x50bb('0x2e')][_0x50bb('0x3c')]){_0x41fd89['where']=_[_0x50bb('0x3d')](_0x41fd89['where'],{'$or':_[_0x50bb('0x28')](_0x1b74f9,function(_0xc78d23){if(_0xc78d23[_0x50bb('0x2b')]!=='VIRTUAL'){var _0x55d29c={};_0x55d29c[_0xc78d23[_0x50bb('0x26')]]={'$like':'%'+_0x491632[_0x50bb('0x2e')][_0x50bb('0x3c')]+'%'};return _0x55d29c;}})});}_0x41fd89=_[_0x50bb('0x3d')]({},_0x41fd89,_0x491632['options']);var _0x3c273b={'where':_0x41fd89['where']};return db['AnalyticTreeReport'][_0x50bb('0x3e')](_0x3c273b)['then'](function(_0x33ad32){_0x3004a3[_0x50bb('0x3e')]=_0x33ad32;if(_0x491632[_0x50bb('0x2e')][_0x50bb('0x3f')]){_0x41fd89[_0x50bb('0x40')]=[{'all':!![]}];}return db[_0x50bb('0x29')][_0x50bb('0x41')](_0x41fd89);})[_0x50bb('0x42')](function(_0x46039a){_0x3004a3[_0x50bb('0x43')]=_0x46039a;return _0x3004a3;})['then'](respondWithFilteredResult(_0x5cfe4b,_0x41fd89))['catch'](handleError(_0x5cfe4b,null));};exports[_0x50bb('0x44')]=function(_0x13076f,_0x1cf062){var _0x1d929d={'raw':!![],'where':{'id':_0x13076f[_0x50bb('0x45')]['id']}},_0x5e8085={};_0x5e8085['model']=_[_0x50bb('0x2f')](db[_0x50bb('0x29')][_0x50bb('0x2a')]);_0x5e8085[_0x50bb('0x2e')]=_[_0x50bb('0x2f')](_0x13076f[_0x50bb('0x2e')]);_0x5e8085[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x5e8085[_0x50bb('0x2d')],_0x5e8085[_0x50bb('0x2e')]);_0x1d929d[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x5e8085[_0x50bb('0x2d')],qs[_0x50bb('0x33')](_0x13076f[_0x50bb('0x2e')][_0x50bb('0x33')]));_0x1d929d['attributes']=_0x1d929d[_0x50bb('0x32')]['length']?_0x1d929d[_0x50bb('0x32')]:_0x5e8085[_0x50bb('0x2d')];if(_0x13076f[_0x50bb('0x2e')][_0x50bb('0x3f')]){_0x1d929d[_0x50bb('0x40')]=[{'all':!![]}];}_0x1d929d=_[_0x50bb('0x3d')]({},_0x1d929d,_0x13076f[_0x50bb('0x46')]);return db[_0x50bb('0x29')][_0x50bb('0x47')](_0x1d929d)[_0x50bb('0x42')](handleEntityNotFound(_0x1cf062,null))[_0x50bb('0x42')](respondWithResult(_0x1cf062,null))[_0x50bb('0x48')](handleError(_0x1cf062,null));};exports[_0x50bb('0x49')]=function(_0x457bb4,_0x5880df){return db[_0x50bb('0x29')]['create'](_0x457bb4[_0x50bb('0x4a')],{})[_0x50bb('0x42')](respondWithResult(_0x5880df,0xc9))[_0x50bb('0x48')](handleError(_0x5880df,null));};exports[_0x50bb('0x22')]=function(_0x650e91,_0x39ac1a){if(_0x650e91[_0x50bb('0x4a')]['id']){delete _0x650e91[_0x50bb('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x50bb('0x47')]({'where':{'id':_0x650e91[_0x50bb('0x45')]['id']}})[_0x50bb('0x42')](handleEntityNotFound(_0x39ac1a,null))[_0x50bb('0x42')](saveUpdates(_0x650e91[_0x50bb('0x4a')],null))['then'](respondWithResult(_0x39ac1a,null))[_0x50bb('0x48')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x23')]=function(_0x2a411d,_0x154ff8){return db[_0x50bb('0x29')]['find']({'where':{'id':_0x2a411d['params']['id']}})[_0x50bb('0x42')](handleEntityNotFound(_0x154ff8,null))['then'](removeEntity(_0x154ff8,null))[_0x50bb('0x48')](handleError(_0x154ff8,null));}; \ No newline at end of file +var _0x4483=['key','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type'];(function(_0x323978,_0x531896){var _0x5e5a9b=function(_0x115dac){while(--_0x115dac){_0x323978['push'](_0x323978['shift']());}};_0x5e5a9b(++_0x531896);}(_0x4483,0x1a3));var _0x3448=function(_0x10b727,_0x11255e){_0x10b727=_0x10b727-0x0;var _0x3da247=_0x4483[_0x10b727];return _0x3da247;};'use strict';var pdf=require(_0x3448('0x0'));var emlformat=require(_0x3448('0x1'));var rimraf=require(_0x3448('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3448('0x3'));var rp=require(_0x3448('0x4'));var moment=require(_0x3448('0x5'));var BPromise=require(_0x3448('0x6'));var Mustache=require(_0x3448('0x7'));var util=require('util');var path=require(_0x3448('0x8'));var sox=require(_0x3448('0x9'));var csv=require(_0x3448('0xa'));var ejs=require(_0x3448('0xb'));var fs=require('fs');var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5bf09e,_0x298ae6){_0x298ae6=_0x298ae6||0xcc;return function(_0x38fbb1){if(_0x38fbb1){return _0x5bf09e['sendStatus'](_0x298ae6);}return _0x5bf09e[_0x3448('0x1b')](_0x298ae6)[_0x3448('0x1c')]();};}function respondWithResult(_0x587db9,_0x549306){_0x549306=_0x549306||0xc8;return function(_0x14104c){if(_0x14104c){return _0x587db9[_0x3448('0x1b')](_0x549306)['json'](_0x14104c);}};}function respondWithFilteredResult(_0x2387a3,_0x2c2da6){return function(_0x46784f){if(_0x46784f){var _0x4fc70f=_0x46784f[_0x3448('0x1d')],_0x472518=_0x2c2da6[_0x3448('0x1e')],_0x28f5b9=_0x2c2da6[_0x3448('0x1e')]+_0x2c2da6[_0x3448('0x1f')],_0x13610a;if(_0x28f5b9>=_0x4fc70f){_0x28f5b9=_0x4fc70f;_0x13610a=0xc8;}else{_0x13610a=0xce;}_0x2387a3[_0x3448('0x1b')](_0x13610a);return _0x2387a3['set'](_0x3448('0x20'),_0x472518+'-'+_0x28f5b9+'/'+_0x4fc70f)['json'](_0x46784f);}return null;};}function patchUpdates(_0x48f94a){return function(_0x53f8e7){try{jsonpatch[_0x3448('0x21')](_0x53f8e7,_0x48f94a,!![]);}catch(_0x278736){return BPromise[_0x3448('0x22')](_0x278736);}return _0x53f8e7['save']();};}function saveUpdates(_0x3df082,_0x392c8d){return function(_0x317de6){if(_0x317de6){return _0x317de6[_0x3448('0x23')](_0x3df082)[_0x3448('0x24')](function(_0x715c3){return _0x715c3;});}return null;};}function removeEntity(_0x5db78f,_0x54c7ee){return function(_0x4e6716){if(_0x4e6716){return _0x4e6716[_0x3448('0x25')]()[_0x3448('0x24')](function(){_0x5db78f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(!_0x22ad5c){_0x2dcd40[_0x3448('0x26')](0x194);}return _0x22ad5c;};}function handleError(_0xbf2237,_0x566ff5){_0x566ff5=_0x566ff5||0x1f4;return function(_0x229ce7){logger[_0x3448('0x27')](_0x229ce7[_0x3448('0x28')]);if(_0x229ce7[_0x3448('0x29')]){delete _0x229ce7[_0x3448('0x29')];}_0xbf2237['status'](_0x566ff5)[_0x3448('0x2a')](_0x229ce7);};}exports[_0x3448('0x2b')]=function(_0x52c163,_0x19a479){var _0x12c22d={},_0x310912={},_0x1bd34c={'count':0x0,'rows':[]};var _0x38fab2=_[_0x3448('0x2c')](db[_0x3448('0x2d')][_0x3448('0x2e')],function(_0x5911b8){return{'name':_0x5911b8[_0x3448('0x2f')],'type':_0x5911b8[_0x3448('0x30')][_0x3448('0x31')]};});_0x310912['model']=_[_0x3448('0x2c')](_0x38fab2,'name');_0x310912['query']=_['keys'](_0x52c163[_0x3448('0x32')]);_0x310912[_0x3448('0x33')]=_['intersection'](_0x310912['model'],_0x310912[_0x3448('0x32')]);_0x12c22d[_0x3448('0x34')]=_[_0x3448('0x35')](_0x310912[_0x3448('0x36')],qs['fields'](_0x52c163[_0x3448('0x32')][_0x3448('0x37')]));_0x12c22d[_0x3448('0x34')]=_0x12c22d['attributes'][_0x3448('0x38')]?_0x12c22d[_0x3448('0x34')]:_0x310912['model'];if(!_0x52c163['query'][_0x3448('0x39')](_0x3448('0x3a'))){_0x12c22d[_0x3448('0x1f')]=qs[_0x3448('0x1f')](_0x52c163['query'][_0x3448('0x1f')]);_0x12c22d[_0x3448('0x1e')]=qs[_0x3448('0x1e')](_0x52c163[_0x3448('0x32')]['offset']);}_0x12c22d[_0x3448('0x3b')]=qs[_0x3448('0x3c')](_0x52c163['query'][_0x3448('0x3c')]);_0x12c22d[_0x3448('0x3d')]=qs[_0x3448('0x33')](_[_0x3448('0x3e')](_0x52c163[_0x3448('0x32')],_0x310912[_0x3448('0x33')]));if(_0x52c163[_0x3448('0x32')][_0x3448('0x3f')]){_0x12c22d[_0x3448('0x3d')]=_['merge'](_0x12c22d['where'],{'$or':_[_0x3448('0x2c')](_0x38fab2,function(_0x579eac){if(_0x579eac[_0x3448('0x30')]!==_0x3448('0x40')){var _0x12f678={};_0x12f678[_0x579eac[_0x3448('0x29')]]={'$like':'%'+_0x52c163['query'][_0x3448('0x3f')]+'%'};return _0x12f678;}})});}_0x12c22d=_[_0x3448('0x41')]({},_0x12c22d,_0x52c163[_0x3448('0x42')]);var _0x201979={'where':_0x12c22d[_0x3448('0x3d')]};return db[_0x3448('0x2d')][_0x3448('0x1d')](_0x201979)[_0x3448('0x24')](function(_0x124296){_0x1bd34c['count']=_0x124296;if(_0x52c163[_0x3448('0x32')][_0x3448('0x43')]){_0x12c22d[_0x3448('0x44')]=[{'all':!![]}];}return db[_0x3448('0x2d')][_0x3448('0x45')](_0x12c22d);})['then'](function(_0x18b297){_0x1bd34c[_0x3448('0x46')]=_0x18b297;return _0x1bd34c;})[_0x3448('0x24')](respondWithFilteredResult(_0x19a479,_0x12c22d))[_0x3448('0x47')](handleError(_0x19a479,null));};exports[_0x3448('0x48')]=function(_0x2077c1,_0x415985){var _0x3db5f1={'raw':!![],'where':{'id':_0x2077c1[_0x3448('0x49')]['id']}},_0x4a8f80={};_0x4a8f80[_0x3448('0x36')]=_[_0x3448('0x4a')](db['AnalyticTreeReport'][_0x3448('0x2e')]);_0x4a8f80[_0x3448('0x32')]=_[_0x3448('0x4a')](_0x2077c1[_0x3448('0x32')]);_0x4a8f80[_0x3448('0x33')]=_[_0x3448('0x35')](_0x4a8f80[_0x3448('0x36')],_0x4a8f80['query']);_0x3db5f1[_0x3448('0x34')]=_[_0x3448('0x35')](_0x4a8f80[_0x3448('0x36')],qs[_0x3448('0x37')](_0x2077c1[_0x3448('0x32')][_0x3448('0x37')]));_0x3db5f1['attributes']=_0x3db5f1[_0x3448('0x34')]['length']?_0x3db5f1['attributes']:_0x4a8f80[_0x3448('0x36')];if(_0x2077c1[_0x3448('0x32')]['includeAll']){_0x3db5f1[_0x3448('0x44')]=[{'all':!![]}];}_0x3db5f1=_[_0x3448('0x41')]({},_0x3db5f1,_0x2077c1['options']);return db[_0x3448('0x2d')][_0x3448('0x4b')](_0x3db5f1)['then'](handleEntityNotFound(_0x415985,null))[_0x3448('0x24')](respondWithResult(_0x415985,null))[_0x3448('0x47')](handleError(_0x415985,null));};exports[_0x3448('0x4c')]=function(_0x2be597,_0x34d19e){return db[_0x3448('0x2d')][_0x3448('0x4c')](_0x2be597['body'],{})['then'](respondWithResult(_0x34d19e,0xc9))[_0x3448('0x47')](handleError(_0x34d19e,null));};exports[_0x3448('0x23')]=function(_0x1b82e7,_0x3f48e3){if(_0x1b82e7['body']['id']){delete _0x1b82e7[_0x3448('0x4d')]['id'];}return db[_0x3448('0x2d')][_0x3448('0x4b')]({'where':{'id':_0x1b82e7[_0x3448('0x49')]['id']}})[_0x3448('0x24')](handleEntityNotFound(_0x3f48e3,null))['then'](saveUpdates(_0x1b82e7[_0x3448('0x4d')],null))['then'](respondWithResult(_0x3f48e3,null))[_0x3448('0x47')](handleError(_0x3f48e3,null));};exports[_0x3448('0x25')]=function(_0x5c8e42,_0x479b79){return db[_0x3448('0x2d')][_0x3448('0x4b')]({'where':{'id':_0x5c8e42[_0x3448('0x49')]['id']}})[_0x3448('0x24')](handleEntityNotFound(_0x479b79,null))[_0x3448('0x24')](removeEntity(_0x479b79,null))[_0x3448('0x47')](handleError(_0x479b79,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index ecc34a7..28b5d72 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 _0x7f59=['AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3572b3,_0x593ffe){var _0x55e4aa=function(_0x5a6b53){while(--_0x5a6b53){_0x3572b3['push'](_0x3572b3['shift']());}};_0x55e4aa(++_0x593ffe);}(_0x7f59,0x12e));var _0x97f5=function(_0x8d4f36,_0x759816){_0x8d4f36=_0x8d4f36-0x0;var _0x13f1fd=_0x7f59[_0x8d4f36];return _0x13f1fd;};'use strict';var _=require(_0x97f5('0x0'));var util=require(_0x97f5('0x1'));var logger=require('../../config/logger')(_0x97f5('0x2'));var moment=require(_0x97f5('0x3'));var BPromise=require(_0x97f5('0x4'));var rp=require(_0x97f5('0x5'));var fs=require('fs');var path=require(_0x97f5('0x6'));var rimraf=require(_0x97f5('0x7'));var config=require(_0x97f5('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x498110,_0x5d7027){return _0x498110[_0x97f5('0x9')](_0x97f5('0xa'),attributes,{'tableName':_0x97f5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa701=['AnalyticTreeReport','analytics_report_trees','util','../../config/logger','bluebird','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa701,0xd4));var _0x1a70=function(_0x9fe67b,_0x5583be){_0x9fe67b=_0x9fe67b-0x0;var _0x5423e2=_0xa701[_0x9fe67b];return _0x5423e2;};'use strict';var _=require('lodash');var util=require(_0x1a70('0x0'));var logger=require(_0x1a70('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1a70('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1a70('0x3'));var config=require(_0x1a70('0x4'));var attributes=require(_0x1a70('0x5'));module[_0x1a70('0x6')]=function(_0x48532f,_0x5ec401){return _0x48532f[_0x1a70('0x7')](_0x1a70('0x8'),attributes,{'tableName':_0x1a70('0x9'),'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 e70e3f2..73f1077 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 _0x63e3=['request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s'];(function(_0x4f6ea8,_0x191395){var _0x39f538=function(_0x8aa4c9){while(--_0x8aa4c9){_0x4f6ea8['push'](_0x4f6ea8['shift']());}};_0x39f538(++_0x191395);}(_0x63e3,0x170));var _0x363e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x63e3[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x363e('0x0'));var util=require(_0x363e('0x1'));var moment=require(_0x363e('0x2'));var BPromise=require('bluebird');var rs=require(_0x363e('0x3'));var fs=require('fs');var Redis=require(_0x363e('0x4'));var db=require(_0x363e('0x5'))['db'];var utils=require(_0x363e('0x6'));var logger=require(_0x363e('0x7'))(_0x363e('0x8'));var config=require(_0x363e('0x9'));var jayson=require(_0x363e('0xa'));var client=jayson[_0x363e('0xb')][_0x363e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x150207,_0x5a1acc,_0x5bdb73){return new BPromise(function(_0x89cbae,_0x24f99c){return client['request'](_0x150207,_0x5bdb73)[_0x363e('0xd')](function(_0x2b9113){logger[_0x363e('0xe')](_0x363e('0xf'),_0x5a1acc,_0x363e('0x10'));logger['debug'](_0x363e('0x11'),_0x5a1acc,'request\x20sent',JSON[_0x363e('0x12')](_0x2b9113));if(_0x2b9113[_0x363e('0x13')]){if(_0x2b9113['error'][_0x363e('0x14')]===0x1f4){logger['error'](_0x363e('0xf'),_0x5a1acc,_0x2b9113['error'][_0x363e('0x15')]);return _0x24f99c(_0x2b9113[_0x363e('0x13')][_0x363e('0x15')]);}logger[_0x363e('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5a1acc,_0x2b9113[_0x363e('0x13')][_0x363e('0x15')]);return _0x89cbae(_0x2b9113[_0x363e('0x13')]['message']);}else{logger[_0x363e('0xe')](_0x363e('0xf'),_0x5a1acc,_0x363e('0x10'));_0x89cbae(_0x2b9113[_0x363e('0x16')]['message']);}})[_0x363e('0x17')](function(_0x84e8d0){logger['error'](_0x363e('0xf'),_0x5a1acc,_0x84e8d0);_0x24f99c(_0x84e8d0);});});} \ No newline at end of file +var _0xa48a=['message','result','catch','util','moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x381005,_0x2b3564){var _0x7fb157=function(_0x1e1ae0){while(--_0x1e1ae0){_0x381005['push'](_0x381005['shift']());}};_0x7fb157(++_0x2b3564);}(_0xa48a,0x75));var _0xaa48=function(_0x4f936d,_0x45eb2b){_0x4f936d=_0x4f936d-0x0;var _0x2f8376=_0xa48a[_0x4f936d];return _0x2f8376;};'use strict';var _=require('lodash');var util=require(_0xaa48('0x0'));var moment=require(_0xaa48('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa48('0x2'));var db=require(_0xaa48('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa48('0x4'))('rpc');var config=require(_0xaa48('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xaa48('0x6')][_0xaa48('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4aca99,_0x4e3243,_0x499f94){return new BPromise(function(_0x45f188,_0x11dea7){return client[_0xaa48('0x8')](_0x4aca99,_0x499f94)['then'](function(_0xd4596c){logger['info'](_0xaa48('0x9'),_0x4e3243,_0xaa48('0xa'));logger[_0xaa48('0xb')](_0xaa48('0xc'),_0x4e3243,_0xaa48('0xa'),JSON[_0xaa48('0xd')](_0xd4596c));if(_0xd4596c['error']){if(_0xd4596c[_0xaa48('0xe')][_0xaa48('0xf')]===0x1f4){logger['error'](_0xaa48('0x9'),_0x4e3243,_0xd4596c[_0xaa48('0xe')][_0xaa48('0x10')]);return _0x11dea7(_0xd4596c[_0xaa48('0xe')][_0xaa48('0x10')]);}logger[_0xaa48('0xe')](_0xaa48('0x9'),_0x4e3243,_0xd4596c[_0xaa48('0xe')][_0xaa48('0x10')]);return _0x45f188(_0xd4596c[_0xaa48('0xe')]['message']);}else{logger['info'](_0xaa48('0x9'),_0x4e3243,_0xaa48('0xa'));_0x45f188(_0xd4596c[_0xaa48('0x11')][_0xaa48('0x10')]);}})[_0xaa48('0x12')](function(_0x4fbb66){logger[_0xaa48('0xe')](_0xaa48('0x9'),_0x4e3243,_0x4fbb66);_0x11dea7(_0x4fbb66);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 3887de4..72032a9 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 _0x1e39=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x1eae2b,_0x4b7074){var _0xc44e68=function(_0x21f211){while(--_0x21f211){_0x1eae2b['push'](_0x1eae2b['shift']());}};_0xc44e68(++_0x4b7074);}(_0x1e39,0x188));var _0x91e3=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x1e39[_0x413b4d];return _0x8b810a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x91e3('0x0'));var timeout=require(_0x91e3('0x1'));var express=require(_0x91e3('0x2'));var router=express['Router']();var auth=require(_0x91e3('0x3'));var interaction=require(_0x91e3('0x4'));var config=require(_0x91e3('0x5'));var controller=require(_0x91e3('0x6'));router[_0x91e3('0x7')]('/',auth[_0x91e3('0x8')](),controller['index']);router[_0x91e3('0x7')](_0x91e3('0x9'),auth[_0x91e3('0x8')](),controller[_0x91e3('0xa')]);router[_0x91e3('0xb')]('/',auth['isAuthenticated'](),controller[_0x91e3('0xc')]);router[_0x91e3('0xd')]('/:id',auth[_0x91e3('0x8')](),controller[_0x91e3('0xe')]);router[_0x91e3('0xf')](_0x91e3('0x9'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x10')]);module[_0x91e3('0x11')]=router; \ No newline at end of file +var _0x1ebd=['Router','../../config/environment','isAuthenticated','get','/:id','show','post','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x209769,_0x2d3af0){var _0x19952f=function(_0x2bfd8b){while(--_0x2bfd8b){_0x209769['push'](_0x209769['shift']());}};_0x19952f(++_0x2d3af0);}(_0x1ebd,0x64));var _0xd1eb=function(_0x1a0c8e,_0x37ba30){_0x1a0c8e=_0x1a0c8e-0x0;var _0x1ef848=_0x1ebd[_0x1a0c8e];return _0x1ef848;};'use strict';var multer=require(_0xd1eb('0x0'));var util=require(_0xd1eb('0x1'));var path=require(_0xd1eb('0x2'));var timeout=require(_0xd1eb('0x3'));var express=require(_0xd1eb('0x4'));var router=express[_0xd1eb('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1eb('0x6'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0xd1eb('0x7')](),controller['index']);router[_0xd1eb('0x8')](_0xd1eb('0x9'),auth['isAuthenticated'](),controller[_0xd1eb('0xa')]);router[_0xd1eb('0xb')]('/',auth[_0xd1eb('0x7')](),controller['create']);router['put'](_0xd1eb('0x9'),auth[_0xd1eb('0x7')](),controller[_0xd1eb('0xc')]);router[_0xd1eb('0xd')](_0xd1eb('0x9'),auth[_0xd1eb('0x7')](),controller[_0xd1eb('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 9c00af6..9791d16 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 _0x2ae5=['sequelize','exports','STRING'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x2ae5,0x7e));var _0x52ae=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x2ae5[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x52ae('0x0'));module[_0x52ae('0x1')]={'name':{'type':Sequelize[_0x52ae('0x2')]},'basename':{'type':Sequelize[_0x52ae('0x2')]},'type':{'type':Sequelize[_0x52ae('0x2')]}}; \ No newline at end of file +var _0x123d=['exports','STRING'];(function(_0xb012e3,_0x33b165){var _0x195c7e=function(_0x282420){while(--_0x282420){_0xb012e3['push'](_0xb012e3['shift']());}};_0x195c7e(++_0x33b165);}(_0x123d,0xf4));var _0xd123=function(_0x21d636,_0x4f6e0f){_0x21d636=_0x21d636-0x0;var _0x38d608=_0x123d[_0x21d636];return _0x38d608;};'use strict';var Sequelize=require('sequelize');module[_0xd123('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xd123('0x1')]},'type':{'type':Sequelize[_0xd123('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 84ff244..2ca4e67 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 _0xf421=['offset','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','Attachment','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','rows','catch','show','params','keys','includeAll','find','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count'];(function(_0x4771a0,_0x45be9d){var _0x440d29=function(_0x56a3c0){while(--_0x56a3c0){_0x4771a0['push'](_0x4771a0['shift']());}};_0x440d29(++_0x45be9d);}(_0xf421,0xe4));var _0x1f42=function(_0x349b5c,_0x55e5fa){_0x349b5c=_0x349b5c-0x0;var _0x3efcac=_0xf421[_0x349b5c];return _0x3efcac;};'use strict';var pdf=require(_0x1f42('0x0'));var emlformat=require(_0x1f42('0x1'));var rimraf=require(_0x1f42('0x2'));var zipdir=require(_0x1f42('0x3'));var jsonpatch=require(_0x1f42('0x4'));var rp=require('request-promise');var moment=require(_0x1f42('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1f42('0x6'));var path=require(_0x1f42('0x7'));var sox=require(_0x1f42('0x8'));var csv=require(_0x1f42('0x9'));var ejs=require(_0x1f42('0xa'));var fs=require('fs');var _=require(_0x1f42('0xb'));var squel=require(_0x1f42('0xc'));var crypto=require(_0x1f42('0xd'));var jsforce=require(_0x1f42('0xe'));var deskjs=require(_0x1f42('0xf'));var toCsv=require(_0x1f42('0x9'));var querystring=require(_0x1f42('0x10'));var Papa=require(_0x1f42('0x11'));var Redis=require(_0x1f42('0x12'));var authService=require(_0x1f42('0x13'));var qs=require(_0x1f42('0x14'));var as=require(_0x1f42('0x15'));var hardwareService=require(_0x1f42('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1f42('0x17'));var config=require(_0x1f42('0x18'));var db=require(_0x1f42('0x19'))['db'];function respondWithStatusCode(_0x3808e2,_0x124eaa){_0x124eaa=_0x124eaa||0xcc;return function(_0x2b667a){if(_0x2b667a){return _0x3808e2[_0x1f42('0x1a')](_0x124eaa);}return _0x3808e2[_0x1f42('0x1b')](_0x124eaa)[_0x1f42('0x1c')]();};}function respondWithResult(_0x405bdc,_0xd2d6a8){_0xd2d6a8=_0xd2d6a8||0xc8;return function(_0x4c2004){if(_0x4c2004){return _0x405bdc['status'](_0xd2d6a8)['json'](_0x4c2004);}};}function respondWithFilteredResult(_0x2fba5f,_0x551d6e){return function(_0x5e402c){if(_0x5e402c){var _0x3ecc35=_0x5e402c[_0x1f42('0x1d')],_0x5d9f9c=_0x551d6e[_0x1f42('0x1e')],_0x1ecee9=_0x551d6e[_0x1f42('0x1e')]+_0x551d6e[_0x1f42('0x1f')],_0x2358fb;if(_0x1ecee9>=_0x3ecc35){_0x1ecee9=_0x3ecc35;_0x2358fb=0xc8;}else{_0x2358fb=0xce;}_0x2fba5f[_0x1f42('0x1b')](_0x2358fb);return _0x2fba5f[_0x1f42('0x20')](_0x1f42('0x21'),_0x5d9f9c+'-'+_0x1ecee9+'/'+_0x3ecc35)[_0x1f42('0x22')](_0x5e402c);}return null;};}function patchUpdates(_0x3c0d0c){return function(_0x1bcfec){try{jsonpatch[_0x1f42('0x23')](_0x1bcfec,_0x3c0d0c,!![]);}catch(_0x37d3cd){return BPromise['reject'](_0x37d3cd);}return _0x1bcfec[_0x1f42('0x24')]();};}function saveUpdates(_0x4b22c2,_0x479870){return function(_0x1419e0){if(_0x1419e0){return _0x1419e0[_0x1f42('0x25')](_0x4b22c2)[_0x1f42('0x26')](function(_0x305f99){return _0x305f99;});}return null;};}function removeEntity(_0x1bdfe8,_0x1633a6){return function(_0x29be24){if(_0x29be24){return _0x29be24['destroy']()[_0x1f42('0x26')](function(){_0x1bdfe8[_0x1f42('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x110989,_0x581151){return function(_0x48a01c){if(!_0x48a01c){_0x110989[_0x1f42('0x1a')](0x194);}return _0x48a01c;};}function handleError(_0x54b1e7,_0x395b92){_0x395b92=_0x395b92||0x1f4;return function(_0x5a595f){logger[_0x1f42('0x27')](_0x5a595f[_0x1f42('0x28')]);if(_0x5a595f[_0x1f42('0x29')]){delete _0x5a595f[_0x1f42('0x29')];}_0x54b1e7[_0x1f42('0x1b')](_0x395b92)[_0x1f42('0x2a')](_0x5a595f);};}exports[_0x1f42('0x2b')]=function(_0x4a2b8e,_0x4cc4cd){var _0x4c6fa5={},_0x48d59c={},_0x4f9858={'count':0x0,'rows':[]};var _0xfd9972=_['map'](db[_0x1f42('0x2c')][_0x1f42('0x2d')],function(_0x49b097){return{'name':_0x49b097['fieldName'],'type':_0x49b097[_0x1f42('0x2e')]['key']};});_0x48d59c[_0x1f42('0x2f')]=_[_0x1f42('0x30')](_0xfd9972,'name');_0x48d59c[_0x1f42('0x31')]=_['keys'](_0x4a2b8e['query']);_0x48d59c[_0x1f42('0x32')]=_[_0x1f42('0x33')](_0x48d59c[_0x1f42('0x2f')],_0x48d59c[_0x1f42('0x31')]);_0x4c6fa5[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x48d59c[_0x1f42('0x2f')],qs[_0x1f42('0x35')](_0x4a2b8e[_0x1f42('0x31')][_0x1f42('0x35')]));_0x4c6fa5['attributes']=_0x4c6fa5[_0x1f42('0x34')][_0x1f42('0x36')]?_0x4c6fa5[_0x1f42('0x34')]:_0x48d59c[_0x1f42('0x2f')];if(!_0x4a2b8e[_0x1f42('0x31')][_0x1f42('0x37')](_0x1f42('0x38'))){_0x4c6fa5[_0x1f42('0x1f')]=qs[_0x1f42('0x1f')](_0x4a2b8e[_0x1f42('0x31')][_0x1f42('0x1f')]);_0x4c6fa5['offset']=qs['offset'](_0x4a2b8e['query'][_0x1f42('0x1e')]);}_0x4c6fa5[_0x1f42('0x39')]=qs[_0x1f42('0x3a')](_0x4a2b8e[_0x1f42('0x31')]['sort']);_0x4c6fa5[_0x1f42('0x3b')]=qs[_0x1f42('0x32')](_['pick'](_0x4a2b8e[_0x1f42('0x31')],_0x48d59c['filters']));if(_0x4a2b8e['query'][_0x1f42('0x3c')]){_0x4c6fa5['where']=_[_0x1f42('0x3d')](_0x4c6fa5[_0x1f42('0x3b')],{'$or':_[_0x1f42('0x30')](_0xfd9972,function(_0x5c60f8){if(_0x5c60f8['type']!=='VIRTUAL'){var _0x11ef27={};_0x11ef27[_0x5c60f8['name']]={'$like':'%'+_0x4a2b8e['query'][_0x1f42('0x3c')]+'%'};return _0x11ef27;}})});}_0x4c6fa5=_[_0x1f42('0x3d')]({},_0x4c6fa5,_0x4a2b8e[_0x1f42('0x3e')]);var _0x317ea8={'where':_0x4c6fa5[_0x1f42('0x3b')]};return db[_0x1f42('0x2c')][_0x1f42('0x1d')](_0x317ea8)[_0x1f42('0x26')](function(_0x285ad3){_0x4f9858['count']=_0x285ad3;if(_0x4a2b8e[_0x1f42('0x31')]['includeAll']){_0x4c6fa5[_0x1f42('0x3f')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x4c6fa5);})[_0x1f42('0x26')](function(_0x3b56d1){_0x4f9858[_0x1f42('0x40')]=_0x3b56d1;return _0x4f9858;})[_0x1f42('0x26')](respondWithFilteredResult(_0x4cc4cd,_0x4c6fa5))[_0x1f42('0x41')](handleError(_0x4cc4cd,null));};exports[_0x1f42('0x42')]=function(_0x3c7e66,_0xde6f8a){var _0x2b7754={'raw':!![],'where':{'id':_0x3c7e66[_0x1f42('0x43')]['id']}},_0x3664ac={};_0x3664ac[_0x1f42('0x2f')]=_[_0x1f42('0x44')](db['Attachment'][_0x1f42('0x2d')]);_0x3664ac['query']=_['keys'](_0x3c7e66[_0x1f42('0x31')]);_0x3664ac['filters']=_[_0x1f42('0x33')](_0x3664ac['model'],_0x3664ac[_0x1f42('0x31')]);_0x2b7754[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x3664ac[_0x1f42('0x2f')],qs['fields'](_0x3c7e66['query'][_0x1f42('0x35')]));_0x2b7754[_0x1f42('0x34')]=_0x2b7754[_0x1f42('0x34')]['length']?_0x2b7754['attributes']:_0x3664ac[_0x1f42('0x2f')];if(_0x3c7e66[_0x1f42('0x31')][_0x1f42('0x45')]){_0x2b7754[_0x1f42('0x3f')]=[{'all':!![]}];}_0x2b7754=_['merge']({},_0x2b7754,_0x3c7e66['options']);return db[_0x1f42('0x2c')][_0x1f42('0x46')](_0x2b7754)[_0x1f42('0x26')](handleEntityNotFound(_0xde6f8a,null))[_0x1f42('0x26')](respondWithResult(_0xde6f8a,null))[_0x1f42('0x41')](handleError(_0xde6f8a,null));};exports['clone']=function(_0x14d9cf,_0x4da862){var _0x4b2738={'where':{'id':_0x14d9cf[_0x1f42('0x43')]['id']}},_0x283a55={};_0x283a55['model']=_['keys'](db[_0x1f42('0x2c')][_0x1f42('0x2d')]);_0x4b2738[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x283a55[_0x1f42('0x2f')],qs[_0x1f42('0x35')](_0x14d9cf[_0x1f42('0x31')][_0x1f42('0x35')]));_0x4b2738[_0x1f42('0x34')]=_0x4b2738[_0x1f42('0x34')][_0x1f42('0x36')]?_0x4b2738[_0x1f42('0x34')]:_0x283a55[_0x1f42('0x2f')];if(_0x14d9cf[_0x1f42('0x31')][_0x1f42('0x45')]){_0x4b2738[_0x1f42('0x3f')]=[{'all':!![]}];}_0x4b2738=_[_0x1f42('0x3d')]({},_0x4b2738,_0x14d9cf[_0x1f42('0x3e')]);return db['Attachment'][_0x1f42('0x46')](_0x4b2738)[_0x1f42('0x26')](handleEntityNotFound(_0x4da862,null))['then'](function(_0x175d8d){if(_0x175d8d){var _0x549c0a=_0x175d8d[_0x1f42('0x47')]({'plain':!![]});_0x549c0a=qs[_0x1f42('0x48')](_0x549c0a,['id',_0x1f42('0x49'),_0x1f42('0x4a')]);_0x14d9cf[_0x1f42('0x4b')]=_[_0x1f42('0x48')](_0x14d9cf[_0x1f42('0x4b')],['id','createdAt',_0x1f42('0x4a')]);return db[_0x1f42('0x2c')][_0x1f42('0x4c')](_['merge'](_0x549c0a,_0x14d9cf['body']),{'include':_0x14d9cf['query'][_0x1f42('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4da862,0xc9))[_0x1f42('0x41')](handleError(_0x4da862,null));};exports[_0x1f42('0x25')]=function(_0x26e168,_0x48f609){if(_0x26e168[_0x1f42('0x4b')]['id']){delete _0x26e168[_0x1f42('0x4b')]['id'];}return db[_0x1f42('0x2c')][_0x1f42('0x46')]({'where':{'id':_0x26e168['params']['id']}})['then'](handleEntityNotFound(_0x48f609,null))[_0x1f42('0x26')](saveUpdates(_0x26e168[_0x1f42('0x4b')],null))['then'](respondWithResult(_0x48f609,null))[_0x1f42('0x41')](handleError(_0x48f609,null));};exports['destroy']=function(_0x113c41,_0x481aec){return db['Attachment']['find']({'where':{'id':_0x113c41[_0x1f42('0x43')]['id']}})[_0x1f42('0x26')](handleEntityNotFound(_0x481aec,null))[_0x1f42('0x26')](removeEntity(_0x481aec,null))[_0x1f42('0x41')](handleError(_0x481aec,null));};exports[_0x1f42('0x4c')]=function(_0x5746c0,_0x3e5911,_0xb1447a){_0x5746c0[_0x1f42('0x4b')][_0x1f42('0x29')]=_0x5746c0[_0x1f42('0x4d')]['originalname'];_0x5746c0[_0x1f42('0x4b')][_0x1f42('0x4e')]=_0x5746c0['file'][_0x1f42('0x4f')];_0x5746c0[_0x1f42('0x4b')][_0x1f42('0x2e')]=_0x5746c0[_0x1f42('0x4d')][_0x1f42('0x50')];return db[_0x1f42('0x2c')][_0x1f42('0x4c')](_0x5746c0[_0x1f42('0x4b')])[_0x1f42('0x26')](respondWithResult(_0x3e5911,0xc9))[_0x1f42('0x41')](handleError(_0x3e5911,null));};exports[_0x1f42('0x51')]=function(_0x41cae7,_0x12302c,_0x208c79){return db[_0x1f42('0x2c')][_0x1f42('0x52')]({'where':{'id':_0x41cae7[_0x1f42('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x12302c,null))[_0x1f42('0x26')](function(_0x103bbe){if(_0x103bbe){return _0x12302c[_0x1f42('0x51')](path[_0x1f42('0x53')](config[_0x1f42('0x54')],_0x1f42('0x55'),_0x103bbe[_0x1f42('0x4e')]));}})['catch'](handleError(_0x12302c,null));}; \ No newline at end of file +var _0xf0ee=['status','end','json','count','offset','set','Content-Range','reject','save','then','error','stack','name','index','map','Attachment','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','show','params','find','include','get','omit','updatedAt','body','create','destroy','file','mimetype','download','findOne','root','server/files/attachments/','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus'];(function(_0x4e9226,_0x2dfa54){var _0x8acf77=function(_0x487d95){while(--_0x487d95){_0x4e9226['push'](_0x4e9226['shift']());}};_0x8acf77(++_0x2dfa54);}(_0xf0ee,0x18a));var _0xef0e=function(_0x10e924,_0x8ba26d){_0x10e924=_0x10e924-0x0;var _0x1fb1e7=_0xf0ee[_0x10e924];return _0x1fb1e7;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xef0e('0x0'));var zipdir=require(_0xef0e('0x1'));var jsonpatch=require(_0xef0e('0x2'));var rp=require(_0xef0e('0x3'));var moment=require(_0xef0e('0x4'));var BPromise=require(_0xef0e('0x5'));var Mustache=require(_0xef0e('0x6'));var util=require(_0xef0e('0x7'));var path=require(_0xef0e('0x8'));var sox=require(_0xef0e('0x9'));var csv=require('to-csv');var ejs=require(_0xef0e('0xa'));var fs=require('fs');var _=require(_0xef0e('0xb'));var squel=require(_0xef0e('0xc'));var crypto=require(_0xef0e('0xd'));var jsforce=require(_0xef0e('0xe'));var deskjs=require(_0xef0e('0xf'));var toCsv=require(_0xef0e('0x10'));var querystring=require('querystring');var Papa=require(_0xef0e('0x11'));var Redis=require(_0xef0e('0x12'));var authService=require(_0xef0e('0x13'));var qs=require(_0xef0e('0x14'));var as=require(_0xef0e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef0e('0x16'))('api');var utils=require(_0xef0e('0x17'));var config=require('../../config/environment');var db=require(_0xef0e('0x18'))['db'];function respondWithStatusCode(_0x5a4662,_0xcfd15e){_0xcfd15e=_0xcfd15e||0xcc;return function(_0x1baab5){if(_0x1baab5){return _0x5a4662[_0xef0e('0x19')](_0xcfd15e);}return _0x5a4662[_0xef0e('0x1a')](_0xcfd15e)[_0xef0e('0x1b')]();};}function respondWithResult(_0x1b901a,_0xd5a9c1){_0xd5a9c1=_0xd5a9c1||0xc8;return function(_0x20b6d9){if(_0x20b6d9){return _0x1b901a[_0xef0e('0x1a')](_0xd5a9c1)[_0xef0e('0x1c')](_0x20b6d9);}};}function respondWithFilteredResult(_0x1034cb,_0x30c5c9){return function(_0xe0a914){if(_0xe0a914){var _0x4e551f=_0xe0a914[_0xef0e('0x1d')],_0x4f67ba=_0x30c5c9['offset'],_0x17d3a2=_0x30c5c9[_0xef0e('0x1e')]+_0x30c5c9['limit'],_0x43ac9f;if(_0x17d3a2>=_0x4e551f){_0x17d3a2=_0x4e551f;_0x43ac9f=0xc8;}else{_0x43ac9f=0xce;}_0x1034cb[_0xef0e('0x1a')](_0x43ac9f);return _0x1034cb[_0xef0e('0x1f')](_0xef0e('0x20'),_0x4f67ba+'-'+_0x17d3a2+'/'+_0x4e551f)[_0xef0e('0x1c')](_0xe0a914);}return null;};}function patchUpdates(_0x3995b8){return function(_0x37c0fc){try{jsonpatch['apply'](_0x37c0fc,_0x3995b8,!![]);}catch(_0x15db60){return BPromise[_0xef0e('0x21')](_0x15db60);}return _0x37c0fc[_0xef0e('0x22')]();};}function saveUpdates(_0xe6002,_0x5b7ea2){return function(_0x38463a){if(_0x38463a){return _0x38463a['update'](_0xe6002)[_0xef0e('0x23')](function(_0x2d92f7){return _0x2d92f7;});}return null;};}function removeEntity(_0x15f9e9,_0x1c3968){return function(_0x44ac4a){if(_0x44ac4a){return _0x44ac4a['destroy']()[_0xef0e('0x23')](function(){_0x15f9e9[_0xef0e('0x1a')](0xcc)[_0xef0e('0x1b')]();});}};}function handleEntityNotFound(_0x122537,_0x5acc01){return function(_0x19f02b){if(!_0x19f02b){_0x122537[_0xef0e('0x19')](0x194);}return _0x19f02b;};}function handleError(_0x382f30,_0x1795ae){_0x1795ae=_0x1795ae||0x1f4;return function(_0x2986bd){logger[_0xef0e('0x24')](_0x2986bd[_0xef0e('0x25')]);if(_0x2986bd['name']){delete _0x2986bd[_0xef0e('0x26')];}_0x382f30[_0xef0e('0x1a')](_0x1795ae)['send'](_0x2986bd);};}exports[_0xef0e('0x27')]=function(_0xd6d2a7,_0xd80d1f){var _0x334f87={},_0x27f327={},_0x244822={'count':0x0,'rows':[]};var _0x1e551=_[_0xef0e('0x28')](db[_0xef0e('0x29')][_0xef0e('0x2a')],function(_0x5aa719){return{'name':_0x5aa719[_0xef0e('0x2b')],'type':_0x5aa719['type'][_0xef0e('0x2c')]};});_0x27f327[_0xef0e('0x2d')]=_['map'](_0x1e551,_0xef0e('0x26'));_0x27f327[_0xef0e('0x2e')]=_[_0xef0e('0x2f')](_0xd6d2a7['query']);_0x27f327[_0xef0e('0x30')]=_[_0xef0e('0x31')](_0x27f327[_0xef0e('0x2d')],_0x27f327[_0xef0e('0x2e')]);_0x334f87['attributes']=_[_0xef0e('0x31')](_0x27f327[_0xef0e('0x2d')],qs[_0xef0e('0x32')](_0xd6d2a7[_0xef0e('0x2e')][_0xef0e('0x32')]));_0x334f87['attributes']=_0x334f87[_0xef0e('0x33')][_0xef0e('0x34')]?_0x334f87['attributes']:_0x27f327['model'];if(!_0xd6d2a7['query'][_0xef0e('0x35')](_0xef0e('0x36'))){_0x334f87['limit']=qs[_0xef0e('0x37')](_0xd6d2a7[_0xef0e('0x2e')]['limit']);_0x334f87[_0xef0e('0x1e')]=qs['offset'](_0xd6d2a7[_0xef0e('0x2e')][_0xef0e('0x1e')]);}_0x334f87['order']=qs[_0xef0e('0x38')](_0xd6d2a7[_0xef0e('0x2e')]['sort']);_0x334f87[_0xef0e('0x39')]=qs[_0xef0e('0x30')](_[_0xef0e('0x3a')](_0xd6d2a7[_0xef0e('0x2e')],_0x27f327[_0xef0e('0x30')]));if(_0xd6d2a7[_0xef0e('0x2e')][_0xef0e('0x3b')]){_0x334f87[_0xef0e('0x39')]=_['merge'](_0x334f87['where'],{'$or':_[_0xef0e('0x28')](_0x1e551,function(_0x564928){if(_0x564928[_0xef0e('0x3c')]!==_0xef0e('0x3d')){var _0x5a3c65={};_0x5a3c65[_0x564928[_0xef0e('0x26')]]={'$like':'%'+_0xd6d2a7[_0xef0e('0x2e')][_0xef0e('0x3b')]+'%'};return _0x5a3c65;}})});}_0x334f87=_[_0xef0e('0x3e')]({},_0x334f87,_0xd6d2a7[_0xef0e('0x3f')]);var _0x579a4a={'where':_0x334f87[_0xef0e('0x39')]};return db[_0xef0e('0x29')][_0xef0e('0x1d')](_0x579a4a)[_0xef0e('0x23')](function(_0x18287e){_0x244822[_0xef0e('0x1d')]=_0x18287e;if(_0xd6d2a7['query'][_0xef0e('0x40')]){_0x334f87['include']=[{'all':!![]}];}return db[_0xef0e('0x29')][_0xef0e('0x41')](_0x334f87);})[_0xef0e('0x23')](function(_0x367a1b){_0x244822['rows']=_0x367a1b;return _0x244822;})[_0xef0e('0x23')](respondWithFilteredResult(_0xd80d1f,_0x334f87))[_0xef0e('0x42')](handleError(_0xd80d1f,null));};exports[_0xef0e('0x43')]=function(_0x3b21b6,_0x4d8aa2){var _0x530724={'raw':!![],'where':{'id':_0x3b21b6[_0xef0e('0x44')]['id']}},_0x26457c={};_0x26457c[_0xef0e('0x2d')]=_['keys'](db[_0xef0e('0x29')][_0xef0e('0x2a')]);_0x26457c[_0xef0e('0x2e')]=_[_0xef0e('0x2f')](_0x3b21b6[_0xef0e('0x2e')]);_0x26457c[_0xef0e('0x30')]=_[_0xef0e('0x31')](_0x26457c[_0xef0e('0x2d')],_0x26457c[_0xef0e('0x2e')]);_0x530724[_0xef0e('0x33')]=_['intersection'](_0x26457c['model'],qs[_0xef0e('0x32')](_0x3b21b6[_0xef0e('0x2e')][_0xef0e('0x32')]));_0x530724[_0xef0e('0x33')]=_0x530724[_0xef0e('0x33')][_0xef0e('0x34')]?_0x530724[_0xef0e('0x33')]:_0x26457c['model'];if(_0x3b21b6[_0xef0e('0x2e')]['includeAll']){_0x530724['include']=[{'all':!![]}];}_0x530724=_[_0xef0e('0x3e')]({},_0x530724,_0x3b21b6[_0xef0e('0x3f')]);return db[_0xef0e('0x29')][_0xef0e('0x45')](_0x530724)[_0xef0e('0x23')](handleEntityNotFound(_0x4d8aa2,null))['then'](respondWithResult(_0x4d8aa2,null))[_0xef0e('0x42')](handleError(_0x4d8aa2,null));};exports['clone']=function(_0x574445,_0x2adf24){var _0x5db3fd={'where':{'id':_0x574445[_0xef0e('0x44')]['id']}},_0x93c53b={};_0x93c53b[_0xef0e('0x2d')]=_[_0xef0e('0x2f')](db[_0xef0e('0x29')][_0xef0e('0x2a')]);_0x5db3fd[_0xef0e('0x33')]=_['intersection'](_0x93c53b[_0xef0e('0x2d')],qs[_0xef0e('0x32')](_0x574445[_0xef0e('0x2e')][_0xef0e('0x32')]));_0x5db3fd[_0xef0e('0x33')]=_0x5db3fd['attributes']['length']?_0x5db3fd[_0xef0e('0x33')]:_0x93c53b['model'];if(_0x574445[_0xef0e('0x2e')]['includeAll']){_0x5db3fd[_0xef0e('0x46')]=[{'all':!![]}];}_0x5db3fd=_[_0xef0e('0x3e')]({},_0x5db3fd,_0x574445[_0xef0e('0x3f')]);return db[_0xef0e('0x29')]['find'](_0x5db3fd)['then'](handleEntityNotFound(_0x2adf24,null))[_0xef0e('0x23')](function(_0x5bb283){if(_0x5bb283){var _0x4b0a3e=_0x5bb283[_0xef0e('0x47')]({'plain':!![]});_0x4b0a3e=qs[_0xef0e('0x48')](_0x4b0a3e,['id','createdAt',_0xef0e('0x49')]);_0x574445[_0xef0e('0x4a')]=_['omit'](_0x574445[_0xef0e('0x4a')],['id','createdAt','updatedAt']);return db['Attachment'][_0xef0e('0x4b')](_[_0xef0e('0x3e')](_0x4b0a3e,_0x574445[_0xef0e('0x4a')]),{'include':_0x574445[_0xef0e('0x2e')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xef0e('0x23')](respondWithResult(_0x2adf24,0xc9))[_0xef0e('0x42')](handleError(_0x2adf24,null));};exports['update']=function(_0xcb5961,_0x4e6bc9){if(_0xcb5961[_0xef0e('0x4a')]['id']){delete _0xcb5961['body']['id'];}return db[_0xef0e('0x29')][_0xef0e('0x45')]({'where':{'id':_0xcb5961[_0xef0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x4e6bc9,null))['then'](saveUpdates(_0xcb5961[_0xef0e('0x4a')],null))[_0xef0e('0x23')](respondWithResult(_0x4e6bc9,null))[_0xef0e('0x42')](handleError(_0x4e6bc9,null));};exports[_0xef0e('0x4c')]=function(_0x1f4d29,_0x2a0876){return db['Attachment'][_0xef0e('0x45')]({'where':{'id':_0x1f4d29[_0xef0e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a0876,null))[_0xef0e('0x23')](removeEntity(_0x2a0876,null))[_0xef0e('0x42')](handleError(_0x2a0876,null));};exports[_0xef0e('0x4b')]=function(_0x336c59,_0x45efc6,_0x335a1b){_0x336c59['body'][_0xef0e('0x26')]=_0x336c59[_0xef0e('0x4d')]['originalname'];_0x336c59['body']['basename']=_0x336c59['file']['filename'];_0x336c59[_0xef0e('0x4a')][_0xef0e('0x3c')]=_0x336c59[_0xef0e('0x4d')][_0xef0e('0x4e')];return db['Attachment'][_0xef0e('0x4b')](_0x336c59[_0xef0e('0x4a')])[_0xef0e('0x23')](respondWithResult(_0x45efc6,0xc9))[_0xef0e('0x42')](handleError(_0x45efc6,null));};exports[_0xef0e('0x4f')]=function(_0x452b75,_0x495ef4,_0x3e9e91){return db[_0xef0e('0x29')][_0xef0e('0x50')]({'where':{'id':_0x452b75[_0xef0e('0x44')]['id']},'raw':!![]})[_0xef0e('0x23')](handleEntityNotFound(_0x495ef4,null))[_0xef0e('0x23')](function(_0x27463b){if(_0x27463b){return _0x495ef4[_0xef0e('0x4f')](path['join'](config[_0xef0e('0x51')],_0xef0e('0x52'),_0x27463b[_0xef0e('0x53')]));}})['catch'](handleError(_0x495ef4,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 6d6249c..9cdddfe 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 _0x9af1=['../../config/environment','exports','define','Attachment','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x7f8c,_0x48fd8d){var _0x4d5454=function(_0x2e06a1){while(--_0x2e06a1){_0x7f8c['push'](_0x7f8c['shift']());}};_0x4d5454(++_0x48fd8d);}(_0x9af1,0x68));var _0x19af=function(_0x46f01c,_0x3833de){_0x46f01c=_0x46f01c-0x0;var _0x2a9593=_0x9af1[_0x46f01c];return _0x2a9593;};'use strict';var _=require(_0x19af('0x0'));var util=require(_0x19af('0x1'));var logger=require(_0x19af('0x2'))('api');var moment=require(_0x19af('0x3'));var BPromise=require(_0x19af('0x4'));var rp=require(_0x19af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19af('0x6'));var attributes=require('./attachment.attributes');module[_0x19af('0x7')]=function(_0x157fc9,_0x41a50f){return _0x157fc9[_0x19af('0x8')](_0x19af('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x881e=['Attachment','attachments','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./attachment.attributes'];(function(_0x2f643c,_0x5897ab){var _0x1f2685=function(_0x2d3afd){while(--_0x2d3afd){_0x2f643c['push'](_0x2f643c['shift']());}};_0x1f2685(++_0x5897ab);}(_0x881e,0x146));var _0xe881=function(_0x120c05,_0xb8bc8){_0x120c05=_0x120c05-0x0;var _0x524077=_0x881e[_0x120c05];return _0x524077;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe881('0x0'))(_0xe881('0x1'));var moment=require('moment');var BPromise=require(_0xe881('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe881('0x3'));var rimraf=require(_0xe881('0x4'));var config=require(_0xe881('0x5'));var attributes=require(_0xe881('0x6'));module['exports']=function(_0x1d9bc0,_0xa4fe06){return _0x1d9bc0['define'](_0xe881('0x7'),attributes,{'tableName':_0xe881('0x8'),'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 1c86faa..12db8ba 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 _0xc924=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xc924,0x1c1));var _0x4c92=function(_0x377e7e,_0x39d77c){_0x377e7e=_0x377e7e-0x0;var _0x3683a4=_0xc924[_0x377e7e];return _0x3683a4;};'use strict';var _=require(_0x4c92('0x0'));var util=require(_0x4c92('0x1'));var moment=require(_0x4c92('0x2'));var BPromise=require(_0x4c92('0x3'));var rs=require(_0x4c92('0x4'));var fs=require('fs');var Redis=require(_0x4c92('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c92('0x6'));var logger=require(_0x4c92('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4c92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d32ca,_0x826a29,_0x1874c3){return new BPromise(function(_0x1b1ffc,_0x5805f7){return client[_0x4c92('0x9')](_0x1d32ca,_0x1874c3)['then'](function(_0x4e547d){logger['info'](_0x4c92('0xa'),_0x826a29,_0x4c92('0xb'));logger[_0x4c92('0xc')](_0x4c92('0xd'),_0x826a29,'request\x20sent',JSON[_0x4c92('0xe')](_0x4e547d));if(_0x4e547d['error']){if(_0x4e547d[_0x4c92('0xf')][_0x4c92('0x10')]===0x1f4){logger['error'](_0x4c92('0xa'),_0x826a29,_0x4e547d[_0x4c92('0xf')][_0x4c92('0x11')]);return _0x5805f7(_0x4e547d['error'][_0x4c92('0x11')]);}logger[_0x4c92('0xf')](_0x4c92('0xa'),_0x826a29,_0x4e547d['error'][_0x4c92('0x11')]);return _0x1b1ffc(_0x4e547d['error'][_0x4c92('0x11')]);}else{logger[_0x4c92('0x12')]('Attachment,\x20%s,\x20%s',_0x826a29,_0x4c92('0xb'));_0x1b1ffc(_0x4e547d[_0x4c92('0x13')][_0x4c92('0x11')]);}})[_0x4c92('0x14')](function(_0x1acd08){logger[_0x4c92('0xf')](_0x4c92('0xa'),_0x826a29,_0x1acd08);_0x5805f7(_0x1acd08);});});}exports[_0x4c92('0x15')]=function(_0x220d6f){var _0x1b1ca1=this;return new Promise(function(_0x22892f,_0x1e0995){return db[_0x4c92('0x16')][_0x4c92('0x17')](_0x220d6f[_0x4c92('0x18')],{'raw':_0x220d6f['options']?_0x220d6f['options'][_0x4c92('0x19')]===undefined?!![]:![]:!![]})[_0x4c92('0x1a')](function(_0x98dc96){logger['info']('CreateAttachment',_0x220d6f);logger[_0x4c92('0xc')]('CreateAttachment',_0x220d6f,JSON[_0x4c92('0xe')](_0x98dc96));_0x22892f(_0x98dc96);})[_0x4c92('0x14')](function(_0x3400da){logger[_0x4c92('0xf')](_0x4c92('0x15'),_0x3400da[_0x4c92('0x11')],_0x220d6f);_0x1e0995(_0x1b1ca1[_0x4c92('0xf')](0x1f4,_0x3400da[_0x4c92('0x11')]));});});}; \ No newline at end of file +var _0x31c2=['message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','body','options','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0x31c2,0x175));var _0x231c=function(_0x5e259c,_0x497d32){_0x5e259c=_0x5e259c-0x0;var _0x183d49=_0x31c2[_0x5e259c];return _0x183d49;};'use strict';var _=require('lodash');var util=require(_0x231c('0x0'));var moment=require(_0x231c('0x1'));var BPromise=require(_0x231c('0x2'));var rs=require(_0x231c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x231c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x231c('0x5'))(_0x231c('0x6'));var config=require(_0x231c('0x7'));var jayson=require(_0x231c('0x8'));var client=jayson[_0x231c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa6bcba,_0x471c12,_0x15ce1a){return new BPromise(function(_0x34504c,_0x156485){return client[_0x231c('0xa')](_0xa6bcba,_0x15ce1a)['then'](function(_0x16bb8c){logger[_0x231c('0xb')]('Attachment,\x20%s,\x20%s',_0x471c12,_0x231c('0xc'));logger[_0x231c('0xd')](_0x231c('0xe'),_0x471c12,'request\x20sent',JSON[_0x231c('0xf')](_0x16bb8c));if(_0x16bb8c['error']){if(_0x16bb8c[_0x231c('0x10')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x471c12,_0x16bb8c[_0x231c('0x10')][_0x231c('0x11')]);return _0x156485(_0x16bb8c['error']['message']);}logger[_0x231c('0x10')](_0x231c('0x12'),_0x471c12,_0x16bb8c[_0x231c('0x10')][_0x231c('0x11')]);return _0x34504c(_0x16bb8c[_0x231c('0x10')][_0x231c('0x11')]);}else{logger[_0x231c('0xb')](_0x231c('0x12'),_0x471c12,_0x231c('0xc'));_0x34504c(_0x16bb8c[_0x231c('0x13')]['message']);}})[_0x231c('0x14')](function(_0x466957){logger[_0x231c('0x10')](_0x231c('0x12'),_0x471c12,_0x466957);_0x156485(_0x466957);});});}exports[_0x231c('0x15')]=function(_0x2f94af){var _0x43f994=this;return new Promise(function(_0x26f6c6,_0x31209a){return db[_0x231c('0x16')][_0x231c('0x17')](_0x2f94af[_0x231c('0x18')],{'raw':_0x2f94af[_0x231c('0x19')]?_0x2f94af[_0x231c('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xf38123){logger[_0x231c('0xb')](_0x231c('0x15'),_0x2f94af);logger['debug'](_0x231c('0x15'),_0x2f94af,JSON[_0x231c('0xf')](_0xf38123));_0x26f6c6(_0xf38123);})[_0x231c('0x14')](function(_0x480bfe){logger[_0x231c('0x10')](_0x231c('0x15'),_0x480bfe[_0x231c('0x11')],_0x2f94af);_0x31209a(_0x43f994[_0x231c('0x10')](0x1f4,_0x480bfe[_0x231c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index ea789de..332038c 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 _0x9962=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./attachment.controller','isAuthenticated','index','/:id','show','get','/:id/download','download','/:id/clone','clone','diskStorage','join','root','format','now','replace','post','file','create','put'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x9962,0xb8));var _0x2996=function(_0x98e959,_0x56c61a){_0x98e959=_0x98e959-0x0;var _0x25a705=_0x9962[_0x98e959];return _0x25a705;};'use strict';var multer=require(_0x2996('0x0'));var util=require('util');var path=require(_0x2996('0x1'));var timeout=require(_0x2996('0x2'));var express=require(_0x2996('0x3'));var router=express['Router']();var auth=require(_0x2996('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2996('0x5'));var controller=require(_0x2996('0x6'));router['get']('/',auth[_0x2996('0x7')](),controller[_0x2996('0x8')]);router['get'](_0x2996('0x9'),auth[_0x2996('0x7')](),controller[_0x2996('0xa')]);router[_0x2996('0xb')](_0x2996('0xc'),auth['isAuthenticated'](),controller[_0x2996('0xd')]);router['post'](_0x2996('0xe'),auth[_0x2996('0x7')](),controller[_0x2996('0xf')]);var upload=multer({'storage':multer[_0x2996('0x10')]({'destination':function(_0x4f3716,_0x304bd9,_0x37f772){_0x37f772(null,path[_0x2996('0x11')](config[_0x2996('0x12')],'server/files/attachments/'));},'filename':function(_0x2ffb75,_0x21f096,_0x10a958){_0x10a958(null,util[_0x2996('0x13')]('%s-%s',Date[_0x2996('0x14')](),_0x21f096['originalname'][_0x2996('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2996('0x16')]('/',upload['single'](_0x2996('0x17')),controller[_0x2996('0x18')]);router[_0x2996('0x19')](_0x2996('0x9'),auth[_0x2996('0x7')](),controller[_0x2996('0x1a')]);router[_0x2996('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x2996('0x1c')]);module[_0x2996('0x1d')]=router; \ No newline at end of file +var _0x29a6=['originalname','replace','single','file','create','update','delete','destroy','exports','multer','path','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','download','post','/:id/clone','clone','diskStorage','server/files/attachments/','%s-%s','now'];(function(_0x468171,_0x29cf34){var _0x189ac7=function(_0x154b20){while(--_0x154b20){_0x468171['push'](_0x468171['shift']());}};_0x189ac7(++_0x29cf34);}(_0x29a6,0xd9));var _0x629a=function(_0x3d5cc0,_0x2b998f){_0x3d5cc0=_0x3d5cc0-0x0;var _0x15966d=_0x29a6[_0x3d5cc0];return _0x15966d;};'use strict';var multer=require(_0x629a('0x0'));var util=require('util');var path=require(_0x629a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x629a('0x2')]();var auth=require(_0x629a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./attachment.controller');router[_0x629a('0x4')]('/',auth[_0x629a('0x5')](),controller[_0x629a('0x6')]);router[_0x629a('0x4')](_0x629a('0x7'),auth['isAuthenticated'](),controller[_0x629a('0x8')]);router[_0x629a('0x4')]('/:id/download',auth[_0x629a('0x5')](),controller[_0x629a('0x9')]);router[_0x629a('0xa')](_0x629a('0xb'),auth[_0x629a('0x5')](),controller[_0x629a('0xc')]);var upload=multer({'storage':multer[_0x629a('0xd')]({'destination':function(_0x3ca857,_0x3108ab,_0x40c7be){_0x40c7be(null,path['join'](config['root'],_0x629a('0xe')));},'filename':function(_0x3e4dfc,_0x1549bd,_0x2165dd){_0x2165dd(null,util['format'](_0x629a('0xf'),Date[_0x629a('0x10')](),_0x1549bd[_0x629a('0x11')][_0x629a('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x629a('0xa')]('/',upload[_0x629a('0x13')](_0x629a('0x14')),controller[_0x629a('0x15')]);router['put'](_0x629a('0x7'),auth[_0x629a('0x5')](),controller[_0x629a('0x16')]);router[_0x629a('0x17')](_0x629a('0x7'),auth[_0x629a('0x5')](),controller[_0x629a('0x18')]);module[_0x629a('0x19')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 7a68464..4f65211 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 _0xcb82=['../../config/environment','../../config/utils','login','authenticate','google','/login','email','callback','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../mysqldb'];(function(_0x432bd3,_0x173894){var _0x4586d1=function(_0x49fe54){while(--_0x49fe54){_0x432bd3['push'](_0x432bd3['shift']());}};_0x4586d1(++_0x173894);}(_0xcb82,0x140));var _0x2cb8=function(_0x4c0795,_0x461c17){_0x4c0795=_0x4c0795-0x0;var _0x597e79=_0xcb82[_0x4c0795];return _0x597e79;};'use strict';var _=require('lodash');var passport=require(_0x2cb8('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x2cb8('0x1')];var moment=require(_0x2cb8('0x2'));var db=require(_0x2cb8('0x3'))['db'];var config=require(_0x2cb8('0x4'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x2cb8('0x5'));exports[_0x2cb8('0x6')]=passport[_0x2cb8('0x7')](_0x2cb8('0x8'),{'failureRedirect':_0x2cb8('0x9'),'scope':['profile',_0x2cb8('0xa')],'session':![]});exports[_0x2cb8('0xb')]=passport['authenticate'](_0x2cb8('0x8'),{'failureRedirect':_0x2cb8('0x9'),'session':![]});passport[_0x2cb8('0xc')](new GoogleStrategy({'clientID':config[_0x2cb8('0x8')]?config[_0x2cb8('0x8')][_0x2cb8('0xd')]:'id','clientSecret':config[_0x2cb8('0x8')]?config['google']['clientSecret']:_0x2cb8('0xe'),'callbackURL':config[_0x2cb8('0x8')]?config[_0x2cb8('0x8')][_0x2cb8('0xf')]:''},function(_0x37f92e,_0x53808b,_0x2da272,_0x727c57){var _0x544156,_0x11a32a;return db[_0x2cb8('0x10')][_0x2cb8('0x11')]({'where':{'id':0x1},'attributes':[_0x2cb8('0x12'),_0x2cb8('0x13')],'raw':!![]})[_0x2cb8('0x14')](function(_0x4a0a3f){_0x544156=_0x4a0a3f;return db[_0x2cb8('0x15')][_0x2cb8('0x16')]({'where':{'email':_['map'](_0x2da272[_0x2cb8('0x17')],_0x2cb8('0x18')),'role':{'$or':['admin',_0x2cb8('0x19'),_0x2cb8('0x1a')]}}});})[_0x2cb8('0x14')](function(_0x47d9cf){_0x11a32a=_0x47d9cf;if(_0x11a32a){if(_0x11a32a[_0x2cb8('0x1b')]){return _0x727c57(_0x2cb8('0x1c'));}else if(_0x544156['blockDuration']>0x0){if(_0x11a32a[_0x2cb8('0x1d')]){if(moment(_0x11a32a[_0x2cb8('0x1e')])[_0x2cb8('0x1f')](_0x544156[_0x2cb8('0x13')],_0x2cb8('0x20'))>moment()){return _0x727c57(_0x2cb8('0x1c'));}else{return utils[_0x2cb8('0x21')](_0x11a32a,0x0,![],null)[_0x2cb8('0x14')](function(){return utils[_0x2cb8('0x22')](_0x11a32a);})[_0x2cb8('0x14')](function(){return _0x727c57(null,_0x11a32a);});}}else{return utils['getLicense'](_0x11a32a)[_0x2cb8('0x14')](function(){return _0x727c57(null,_0x11a32a);});}}else{return utils[_0x2cb8('0x22')](_0x11a32a)[_0x2cb8('0x14')](function(){return _0x727c57(null,_0x11a32a);});}}return _0x727c57('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x2cb8('0x23')](function(_0x25673d){_0x727c57(_0x25673d);});})); \ No newline at end of file +var _0x1758=['google','/login','profile','email','callback','use','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','map','emails','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login'];(function(_0x17c2d1,_0x157af2){var _0x5c812f=function(_0x561500){while(--_0x561500){_0x17c2d1['push'](_0x17c2d1['shift']());}};_0x5c812f(++_0x157af2);}(_0x1758,0xab));var _0x8175=function(_0x40d79f,_0x3f7c81){_0x40d79f=_0x40d79f-0x0;var _0x5bd7d7=_0x1758[_0x40d79f];return _0x5bd7d7;};'use strict';var _=require('lodash');var passport=require(_0x8175('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x8175('0x1')];var moment=require(_0x8175('0x2'));var db=require(_0x8175('0x3'))['db'];var config=require(_0x8175('0x4'));var signToken=require(_0x8175('0x5'))[_0x8175('0x6')];var utils=require(_0x8175('0x7'));exports[_0x8175('0x8')]=passport['authenticate'](_0x8175('0x9'),{'failureRedirect':_0x8175('0xa'),'scope':[_0x8175('0xb'),_0x8175('0xc')],'session':![]});exports[_0x8175('0xd')]=passport['authenticate'](_0x8175('0x9'),{'failureRedirect':'/login','session':![]});passport[_0x8175('0xe')](new GoogleStrategy({'clientID':config[_0x8175('0x9')]?config['google']['clientID']:'id','clientSecret':config[_0x8175('0x9')]?config[_0x8175('0x9')]['clientSecret']:_0x8175('0xf'),'callbackURL':config[_0x8175('0x9')]?config[_0x8175('0x9')][_0x8175('0x10')]:''},function(_0x557f5c,_0xc8b6b1,_0x41dd63,_0x4e4702){var _0x427064,_0x586879;return db[_0x8175('0x11')][_0x8175('0x12')]({'where':{'id':0x1},'attributes':[_0x8175('0x13'),_0x8175('0x14')],'raw':!![]})[_0x8175('0x15')](function(_0x3acb49){_0x427064=_0x3acb49;return db['User']['find']({'where':{'email':_[_0x8175('0x16')](_0x41dd63[_0x8175('0x17')],_0x8175('0x18')),'role':{'$or':[_0x8175('0x19'),_0x8175('0x1a'),_0x8175('0x1b')]}}});})[_0x8175('0x15')](function(_0xf51d06){_0x586879=_0xf51d06;if(_0x586879){if(_0x586879[_0x8175('0x1c')]){return _0x4e4702(_0x8175('0x1d'));}else if(_0x427064[_0x8175('0x14')]>0x0){if(_0x586879[_0x8175('0x1e')]){if(moment(_0x586879[_0x8175('0x1f')])[_0x8175('0x20')](_0x427064[_0x8175('0x14')],'minutes')>moment()){return _0x4e4702(_0x8175('0x1d'));}else{return utils[_0x8175('0x21')](_0x586879,0x0,![],null)['then'](function(){return utils['getLicense'](_0x586879);})[_0x8175('0x15')](function(){return _0x4e4702(null,_0x586879);});}}else{return utils[_0x8175('0x22')](_0x586879)[_0x8175('0x15')](function(){return _0x4e4702(null,_0x586879);});}}else{return utils[_0x8175('0x22')](_0x586879)[_0x8175('0x15')](function(){return _0x4e4702(null,_0x586879);});}}return _0x4e4702(_0x8175('0x1d'));})[_0x8175('0x23')](function(_0xecf8b7){_0x4e4702(_0xecf8b7);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index f3970ae..2bd7d77 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 _0x1152=['../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','express','passport','Router','./authGoogle.controller'];(function(_0x3cb9eb,_0x3fd4b9){var _0x4d5970=function(_0x4bfaa5){while(--_0x4bfaa5){_0x3cb9eb['push'](_0x3cb9eb['shift']());}};_0x4d5970(++_0x3fd4b9);}(_0x1152,0x182));var _0x2115=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x1152[_0x34f701];return _0x3e2429;};'use strict';var express=require(_0x2115('0x0'));var passport=require(_0x2115('0x1'));var router=express[_0x2115('0x2')]();var controller=require(_0x2115('0x3'));var userController=require(_0x2115('0x4'));var authService=require(_0x2115('0x5'));router[_0x2115('0x6')]('/',controller[_0x2115('0x7')]);router['get'](_0x2115('0x8'),controller['callback'],authService[_0x2115('0x9')],userController[_0x2115('0x7')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file +var _0x342e=['login','setTokenCookie','express','passport','Router','../../components/auth/service','get','/callback','callback','isMiddleware'];(function(_0x34ae1f,_0x131931){var _0x12da74=function(_0x33a5ae){while(--_0x33a5ae){_0x34ae1f['push'](_0x34ae1f['shift']());}};_0x12da74(++_0x131931);}(_0x342e,0xde));var _0xe342=function(_0x377a6e,_0x59b99d){_0x377a6e=_0x377a6e-0x0;var _0x37f751=_0x342e[_0x377a6e];return _0x37f751;};'use strict';var express=require(_0xe342('0x0'));var passport=require(_0xe342('0x1'));var router=express[_0xe342('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0xe342('0x3'));router[_0xe342('0x4')]('/',controller['login']);router['get'](_0xe342('0x5'),controller[_0xe342('0x6')],authService[_0xe342('0x7')],userController[_0xe342('0x8')],authService[_0xe342('0x9')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 7aab71a..9b9f434 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 _0xef6c=['test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','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','headers','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','use','util','passport','passport-local','lodash','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send'];(function(_0x622b4f,_0x41b809){var _0x46295f=function(_0x340cc6){while(--_0x340cc6){_0x622b4f['push'](_0x622b4f['shift']());}};_0x46295f(++_0x41b809);}(_0xef6c,0x10e));var _0xcef6=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xef6c[_0x19d350];return _0x3bfc8d;};'use strict';var util=require(_0xcef6('0x0'));var passport=require(_0xcef6('0x1'));var LocalStrategy=require(_0xcef6('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xcef6('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xcef6('0x4'))['db'];var authService=require(_0xcef6('0x5'));var utils=require('../../config/utils');var client=jayson[_0xcef6('0x6')][_0xcef6('0x7')]({'port':0x232b});function localAuthenticate(_0x52ab47,_0x238d3d,_0x315b7a,_0x40258f){var _0x556d49,_0x2582dd;return db[_0xcef6('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xcef6('0x9'),_0xcef6('0xa')],'raw':!![]})[_0xcef6('0xb')](function(_0xebc1a3){_0x556d49=_0xebc1a3;return _0x52ab47[_0xcef6('0xc')]({'attributes':['id',_0xcef6('0xd'),_0xcef6('0xe'),_0xcef6('0xf'),_0xcef6('0x10'),'disabled',_0xcef6('0x11'),_0xcef6('0x12'),_0xcef6('0x13')],'where':{'name':_0x238d3d,'role':{'$or':[_0xcef6('0x14'),_0xcef6('0x15'),'agent']}}});})[_0xcef6('0xb')](function(_0x1a38a1){if(!_0x1a38a1||_0x1a38a1&&_0x1a38a1['name']!==_0x238d3d){throw new Error(_0xcef6('0x16'));}else{_0x2582dd=_0x1a38a1;return _0x2582dd;}})[_0xcef6('0xb')](function(){_0x2582dd['authenticate'](_0x315b7a,function(_0x3e0af5,_0x3d32dd){var _0x5103f2=_0x2582dd['loginAttempts']+0x1;if(_0x3e0af5){return _0x40258f(_0x3e0af5);}else if(!_0x3d32dd){if(_0x2582dd['disabled']){return _0x40258f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x556d49['allowedLoginAttempts']>0x0){if(_0x2582dd[_0xcef6('0x11')]){if(_0x556d49[_0xcef6('0xa')]>0x0){if(moment(_0x2582dd[_0xcef6('0x12')])[_0xcef6('0x17')](_0x556d49[_0xcef6('0xa')],_0xcef6('0x18'))>moment()){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else{return utils['clearBlockUser'](_0x2582dd,_0x5103f2,![],null)[_0xcef6('0xb')](function(){return _0x40258f(null,![],{'message':_0xcef6('0x16')});});}}else{return _0x40258f(null,![],{'message':_0xcef6('0x16')});}}else{if(_0x5103f2>=_0x556d49['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2582dd,0x0,!![],moment())[_0xcef6('0xb')](function(){return _0x40258f(null,![],{'message':_0xcef6('0x16')});});}else{return utils[_0xcef6('0x19')](_0x2582dd,_0x5103f2,![],null)[_0xcef6('0xb')](function(){return _0x40258f(null,![],{'message':_0xcef6('0x16')});});}}}else{return _0x40258f(null,![],{'message':_0xcef6('0x16')});}}else{if(_0x2582dd[_0xcef6('0x1a')]){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else if(_0x556d49[_0xcef6('0x9')]>0x0){if(_0x2582dd[_0xcef6('0x11')]){if(_0x556d49[_0xcef6('0xa')]>0x0){if(moment(_0x2582dd[_0xcef6('0x12')])['add'](_0x556d49['blockDuration'],_0xcef6('0x18'))>moment()){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else{return utils[_0xcef6('0x19')](_0x2582dd,0x0,![],null)[_0xcef6('0xb')](function(){return utils[_0xcef6('0x1b')](_0x2582dd);})[_0xcef6('0xb')](function(){return _0x40258f(null,_0x2582dd);});}}else{return _0x40258f(null,![],{'message':_0xcef6('0x16')});}}else{return utils['clearBlockUser'](_0x2582dd,0x0,![],null)[_0xcef6('0xb')](function(){return utils[_0xcef6('0x1b')](_0x2582dd);})['then'](function(){return _0x40258f(null,_0x2582dd);})[_0xcef6('0x1c')](function(_0x143abd){return _0x40258f(null,![],_0x143abd);});}}else{if(_0x2582dd[_0xcef6('0x11')]){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else{return utils[_0xcef6('0x1b')](_0x2582dd)['then'](function(){return _0x40258f(null,_0x2582dd);});}}}});})[_0xcef6('0x1c')](function(_0x290722){return _0x40258f(null,![],_0x290722);});}function sendServiceMail(_0x3f898d){return db[_0xcef6('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0xcef6('0xd'),_0xcef6('0x1e')],'include':[{'model':db[_0xcef6('0x1f')],'as':_0xcef6('0x20')}]})[_0xcef6('0xb')](function(_0x235658){if(!_0x235658){throw new Error(_0xcef6('0x21'));}var _0x611249={'tls':{'rejectUnauthorized':![]}};if(_0x235658['Smtp'][_0xcef6('0x22')]){_0x611249[_0xcef6('0x22')]=_0x235658[_0xcef6('0x20')][_0xcef6('0x22')];}else{_0x611249[_0xcef6('0x23')]=_0x235658['Smtp']['host'];_0x611249[_0xcef6('0x24')]=_0x235658[_0xcef6('0x20')][_0xcef6('0x24')];_0x611249[_0xcef6('0x25')]=_0x235658[_0xcef6('0x20')][_0xcef6('0x25')];}if(_0x235658['Smtp'][_0xcef6('0x26')]){_0x611249[_0xcef6('0x27')]={'user':_0x235658[_0xcef6('0x20')][_0xcef6('0x15')],'pass':_0x235658[_0xcef6('0x20')][_0xcef6('0x28')]};}var _0x295928={'account':_0x611249,'message':_[_0xcef6('0x29')]({'from':util[_0xcef6('0x2a')]('\x22%s\x22\x20<%s>',_0x235658[_0xcef6('0xd')],_0x235658['email']||_0x235658[_0xcef6('0x20')][_0xcef6('0x15')])},_0x3f898d)};return client['request'](_0xcef6('0x2b'),_0x295928);})[_0xcef6('0xb')](function(_0x4659a4){if(_0x4659a4['error']){throw new Error(util[_0xcef6('0x2a')](_0xcef6('0x2c'),_0x4659a4[_0xcef6('0x2d')][_0xcef6('0x2e')]||JSON[_0xcef6('0x2f')](_0x4659a4[_0xcef6('0x2d')])));}return!![];});}function handleError(_0x3b99c1,_0x5e7b4e,_0x3c1005){return _0x3b99c1[_0xcef6('0x30')](_0x5e7b4e||0x1f4)[_0xcef6('0x31')]({'message':_0x3c1005?_0x3c1005[_0xcef6('0x2e')]||_0x3c1005:''});}function checkPasswordPattern(_0x41bd70,_0xa9fe40,_0x216936){if(_0x216936){var _0x4f1fe7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f1fe7[_0xcef6('0x32')](_0xa9fe40)){return _0x41bd70;}else{throw new Error(_0xcef6('0x33'));}}else{return _0x41bd70;}}exports[_0xcef6('0x34')]=function(_0x53018b,_0x2ff2a1,_0x15e3d9){passport[_0xcef6('0x35')]('local',function(_0x274e03,_0x86b120,_0x236bbd){var _0x6ed73b=_0x274e03||_0x236bbd;if(_0x6ed73b){return handleError(_0x2ff2a1,0x191,_0x6ed73b);}if(!_0x86b120){return handleError(_0x2ff2a1,0x194,{'message':_0xcef6('0x36')});}else{var _0x429fc0={'payload':{'id':_0x86b120['id'],'role':_0x86b120[_0xcef6('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xcef6('0x37')](_0x429fc0)[_0xcef6('0xb')](function(_0x10d7ed){_0x2ff2a1[_0xcef6('0x38')]({'id':_0x86b120['id'],'token':_0x10d7ed,'statusCall':'','isAlreadyLogged':_0x86b120['online']});});}})(_0x53018b,_0x2ff2a1,_0x15e3d9);};exports[_0xcef6('0x39')]=function(_0x5ab496,_0x704cb6,_0x441c66){if(!_0x5ab496['body']['email']){return handleError(_0x704cb6,0x1f4,{'message':_0xcef6('0x3a')});}var _0x296aad=rs[_0xcef6('0x3b')]();_0x5ab496[_0xcef6('0x3c')][_0xcef6('0x1e')]=_0x5ab496[_0xcef6('0x3c')][_0xcef6('0x1e')]['trim']()[_0xcef6('0x3d')]();var _0x110358;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xcef6('0x9'),_0xcef6('0xa')],'raw':!![]})[_0xcef6('0xb')](function(_0x4bfa47){_0x110358=_0x4bfa47;return db[_0xcef6('0x3e')][_0xcef6('0x3f')]({'where':{'email':_0x5ab496['body'][_0xcef6('0x1e')]}});})['then'](function(_0x48f4b7){if(!_0x48f4b7){throw new Error(_0xcef6('0x40'));}if(_0x48f4b7[_0xcef6('0x1a')]){throw new Error(_0xcef6('0x41'));}if(_0x48f4b7[_0xcef6('0x11')]){if(moment(_0x48f4b7[_0xcef6('0x12')])[_0xcef6('0x17')](_0x110358['blockDuration'],_0xcef6('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x48f4b7[_0xcef6('0x11')]=![];_0x48f4b7[_0xcef6('0x12')]=null;}}_0x48f4b7['resetPasswordToken']=_0x296aad;_0x48f4b7[_0xcef6('0x42')]=Date['now']()+0x36ee80;return _0x48f4b7[_0xcef6('0x43')]();})[_0xcef6('0xb')](function(){return sendServiceMail({'to':_0x5ab496[_0xcef6('0x3c')][_0xcef6('0x1e')],'subject':_0xcef6('0x44'),'text':_0xcef6('0x45')+_0xcef6('0x46')+'http://'+_0x5ab496[_0xcef6('0x47')][_0xcef6('0x23')]+'/reset/'+_0x296aad+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xcef6('0xb')](function(){_0x704cb6[_0xcef6('0x30')](0xc8)[_0xcef6('0x31')]({'message':_0xcef6('0x48')});})[_0xcef6('0x1c')](function(_0x1be04b){return handleError(_0x704cb6,0x1f4,_0x1be04b);});};exports[_0xcef6('0x49')]=function(_0x28ec17,_0x32ab85,_0x5b388b){var _0x103bef;return db['User'][_0xcef6('0x3f')]({'where':{'resetPasswordToken':_0x28ec17[_0xcef6('0x4a')][_0xcef6('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xcef6('0x4c')]()}}})[_0xcef6('0xb')](function(_0x4bb53c){_0x103bef=_0x4bb53c;if(!_0x103bef){throw new Error(_0xcef6('0x4d'));}return db[_0xcef6('0x8')][_0xcef6('0xc')]({'attributes':['id',_0xcef6('0x4e')]});})[_0xcef6('0xb')](function(_0x365670){return checkPasswordPattern(_0x365670,_0x28ec17[_0xcef6('0x3c')]['password'],_0x365670[_0xcef6('0x4e')]);})[_0xcef6('0xb')](function(){_0x103bef['password']=_0x28ec17['body']['password'];_0x103bef['resetPasswordToken']=null;_0x103bef[_0xcef6('0x42')]=null;return _0x103bef['save']();})[_0xcef6('0xb')](function(){_0x32ab85[_0xcef6('0x30')](0xc8)[_0xcef6('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x5cce33){return handleError(_0x32ab85,0x1f4,_0x5cce33);});};passport[_0xcef6('0x4f')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x544a65,_0x5cce9f,_0x15e398){return localAuthenticate(db[_0xcef6('0x3e')],_0x544a65,_0x5cce9f,_0x15e398);})); \ No newline at end of file +var _0x739c=['../../components/auth/service','../../config/utils','client','http','allowedLoginAttempts','blockDuration','then','findOne','name','salt','disabled','blockedAt','admin','user','agent','authenticate','loginAttempts','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','port','secure','authentication','auth','pass','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','status','send','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','generate','toLowerCase','Setting','User','This\x20email\x20is\x20not\x20registered.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','host','/reset/','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','password','Password\x20reset!','use','passport','lodash','randomstring','../../mysqldb'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x739c,0xf5));var _0xc739=function(_0x144735,_0x1a9353){_0x144735=_0x144735-0x0;var _0x5b72bc=_0x739c[_0x144735];return _0x5b72bc;};'use strict';var util=require('util');var passport=require(_0xc739('0x0'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require(_0xc739('0x1'));var rs=require(_0xc739('0x2'));var moment=require('moment');var db=require(_0xc739('0x3'))['db'];var authService=require(_0xc739('0x4'));var utils=require(_0xc739('0x5'));var client=jayson[_0xc739('0x6')][_0xc739('0x7')]({'port':0x232b});function localAuthenticate(_0x57a4f4,_0x4cd985,_0x4a7942,_0x5b7ae8){var _0x271bbc,_0x2633f6;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc739('0x8'),_0xc739('0x9')],'raw':!![]})[_0xc739('0xa')](function(_0x4b9085){_0x271bbc=_0x4b9085;return _0x57a4f4[_0xc739('0xb')]({'attributes':['id',_0xc739('0xc'),'password',_0xc739('0xd'),'role',_0xc739('0xe'),'blocked',_0xc739('0xf'),'loginAttempts'],'where':{'name':_0x4cd985,'role':{'$or':[_0xc739('0x10'),_0xc739('0x11'),_0xc739('0x12')]}}});})[_0xc739('0xa')](function(_0x431cf8){if(!_0x431cf8||_0x431cf8&&_0x431cf8['name']!==_0x4cd985){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x2633f6=_0x431cf8;return _0x2633f6;}})[_0xc739('0xa')](function(){_0x2633f6[_0xc739('0x13')](_0x4a7942,function(_0x45e69b,_0xc8002){var _0x3b6940=_0x2633f6[_0xc739('0x14')]+0x1;if(_0x45e69b){return _0x5b7ae8(_0x45e69b);}else if(!_0xc8002){if(_0x2633f6[_0xc739('0xe')]){return _0x5b7ae8(null,![],{'message':_0xc739('0x15')});}else if(_0x271bbc[_0xc739('0x8')]>0x0){if(_0x2633f6[_0xc739('0x16')]){if(_0x271bbc[_0xc739('0x9')]>0x0){if(moment(_0x2633f6[_0xc739('0xf')])[_0xc739('0x17')](_0x271bbc[_0xc739('0x9')],'minutes')>moment()){return _0x5b7ae8(null,![],{'message':_0xc739('0x15')});}else{return utils[_0xc739('0x18')](_0x2633f6,_0x3b6940,![],null)[_0xc739('0xa')](function(){return _0x5b7ae8(null,![],{'message':_0xc739('0x15')});});}}else{return _0x5b7ae8(null,![],{'message':_0xc739('0x15')});}}else{if(_0x3b6940>=_0x271bbc[_0xc739('0x8')]){return utils[_0xc739('0x18')](_0x2633f6,0x0,!![],moment())['then'](function(){return _0x5b7ae8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xc739('0x18')](_0x2633f6,_0x3b6940,![],null)[_0xc739('0xa')](function(){return _0x5b7ae8(null,![],{'message':_0xc739('0x15')});});}}}else{return _0x5b7ae8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2633f6[_0xc739('0xe')]){return _0x5b7ae8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x271bbc[_0xc739('0x8')]>0x0){if(_0x2633f6[_0xc739('0x16')]){if(_0x271bbc['blockDuration']>0x0){if(moment(_0x2633f6[_0xc739('0xf')])[_0xc739('0x17')](_0x271bbc[_0xc739('0x9')],'minutes')>moment()){return _0x5b7ae8(null,![],{'message':_0xc739('0x15')});}else{return utils['clearBlockUser'](_0x2633f6,0x0,![],null)['then'](function(){return utils[_0xc739('0x19')](_0x2633f6);})[_0xc739('0xa')](function(){return _0x5b7ae8(null,_0x2633f6);});}}else{return _0x5b7ae8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc739('0x18')](_0x2633f6,0x0,![],null)['then'](function(){return utils['getLicense'](_0x2633f6);})[_0xc739('0xa')](function(){return _0x5b7ae8(null,_0x2633f6);})['catch'](function(_0x5e124f){return _0x5b7ae8(null,![],_0x5e124f);});}}else{if(_0x2633f6['blocked']){return _0x5b7ae8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x2633f6)[_0xc739('0xa')](function(){return _0x5b7ae8(null,_0x2633f6);});}}}});})[_0xc739('0x1a')](function(_0x392945){return _0x5b7ae8(null,![],_0x392945);});}function sendServiceMail(_0x1f78fc){return db[_0xc739('0x1b')][_0xc739('0x1c')]({'where':{'service':!![]},'attributes':['id',_0xc739('0xc'),_0xc739('0x1d')],'include':[{'model':db[_0xc739('0x1e')],'as':_0xc739('0x1f')}]})['then'](function(_0xfab8e3){if(!_0xfab8e3){throw new Error(_0xc739('0x20'));}var _0x3176ed={'tls':{'rejectUnauthorized':![]}};if(_0xfab8e3[_0xc739('0x1f')][_0xc739('0x21')]){_0x3176ed[_0xc739('0x21')]=_0xfab8e3[_0xc739('0x1f')]['service'];}else{_0x3176ed['host']=_0xfab8e3[_0xc739('0x1f')]['host'];_0x3176ed['port']=_0xfab8e3['Smtp'][_0xc739('0x22')];_0x3176ed[_0xc739('0x23')]=_0xfab8e3[_0xc739('0x1f')][_0xc739('0x23')];}if(_0xfab8e3['Smtp'][_0xc739('0x24')]){_0x3176ed[_0xc739('0x25')]={'user':_0xfab8e3[_0xc739('0x1f')][_0xc739('0x11')],'pass':_0xfab8e3[_0xc739('0x1f')][_0xc739('0x26')]};}var _0x28812d={'account':_0x3176ed,'message':_['merge']({'from':util[_0xc739('0x27')](_0xc739('0x28'),_0xfab8e3['name'],_0xfab8e3[_0xc739('0x1d')]||_0xfab8e3[_0xc739('0x1f')][_0xc739('0x11')])},_0x1f78fc)};return client[_0xc739('0x29')](_0xc739('0x2a'),_0x28812d);})['then'](function(_0xf36c){if(_0xf36c['error']){throw new Error(util[_0xc739('0x27')](_0xc739('0x2b'),_0xf36c[_0xc739('0x2c')][_0xc739('0x2d')]||JSON['stringify'](_0xf36c[_0xc739('0x2c')])));}return!![];});}function handleError(_0x40f6c2,_0x309d27,_0xaac4e0){return _0x40f6c2[_0xc739('0x2e')](_0x309d27||0x1f4)[_0xc739('0x2f')]({'message':_0xaac4e0?_0xaac4e0['message']||_0xaac4e0:''});}function checkPasswordPattern(_0x2f56ee,_0x633b8b,_0x183ae8){if(_0x183ae8){var _0x5d429c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d429c[_0xc739('0x30')](_0x633b8b)){return _0x2f56ee;}else{throw new Error(_0xc739('0x31'));}}else{return _0x2f56ee;}}exports[_0xc739('0x32')]=function(_0x3c3fda,_0x4e8144,_0x1f1a47){passport[_0xc739('0x13')](_0xc739('0x33'),function(_0x8b2183,_0x3101da,_0x3820a6){var _0x6f9b3a=_0x8b2183||_0x3820a6;if(_0x6f9b3a){return handleError(_0x4e8144,0x191,_0x6f9b3a);}if(!_0x3101da){return handleError(_0x4e8144,0x194,{'message':_0xc739('0x34')});}else{var _0x2af856={'payload':{'id':_0x3101da['id'],'role':_0x3101da[_0xc739('0x35')]},'options':{'expiresIn':0x15180}};return authService[_0xc739('0x36')](_0x2af856)[_0xc739('0xa')](function(_0xd48d26){_0x4e8144[_0xc739('0x37')]({'id':_0x3101da['id'],'token':_0xd48d26,'statusCall':'','isAlreadyLogged':_0x3101da[_0xc739('0x38')]});});}})(_0x3c3fda,_0x4e8144,_0x1f1a47);};exports[_0xc739('0x39')]=function(_0xcb6400,_0x3f12c7,_0x1cf17a){if(!_0xcb6400[_0xc739('0x3a')][_0xc739('0x1d')]){return handleError(_0x3f12c7,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x155a27=rs[_0xc739('0x3b')]();_0xcb6400[_0xc739('0x3a')][_0xc739('0x1d')]=_0xcb6400[_0xc739('0x3a')][_0xc739('0x1d')]['trim']()[_0xc739('0x3c')]();var _0x6dfed4;return db[_0xc739('0x3d')][_0xc739('0xb')]({'where':{'id':0x1},'attributes':[_0xc739('0x8'),_0xc739('0x9')],'raw':!![]})[_0xc739('0xa')](function(_0x27dae3){_0x6dfed4=_0x27dae3;return db[_0xc739('0x3e')][_0xc739('0x1c')]({'where':{'email':_0xcb6400[_0xc739('0x3a')]['email']}});})[_0xc739('0xa')](function(_0x9f78a0){if(!_0x9f78a0){throw new Error(_0xc739('0x3f'));}if(_0x9f78a0[_0xc739('0xe')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x9f78a0[_0xc739('0x16')]){if(moment(_0x9f78a0[_0xc739('0xf')])[_0xc739('0x17')](_0x6dfed4[_0xc739('0x9')],_0xc739('0x40'))>moment()){throw new Error(_0xc739('0x41'));}else{_0x9f78a0[_0xc739('0x16')]=![];_0x9f78a0[_0xc739('0xf')]=null;}}_0x9f78a0[_0xc739('0x42')]=_0x155a27;_0x9f78a0[_0xc739('0x43')]=Date[_0xc739('0x44')]()+0x36ee80;return _0x9f78a0['save']();})[_0xc739('0xa')](function(){return sendServiceMail({'to':_0xcb6400[_0xc739('0x3a')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0xc739('0x45')+_0xc739('0x46')+_0xcb6400[_0xc739('0x47')][_0xc739('0x48')]+_0xc739('0x49')+_0x155a27+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xc739('0xa')](function(){_0x3f12c7[_0xc739('0x2e')](0xc8)[_0xc739('0x2f')]({'message':_0xc739('0x4a')});})[_0xc739('0x1a')](function(_0x106229){return handleError(_0x3f12c7,0x1f4,_0x106229);});};exports[_0xc739('0x4b')]=function(_0x41f5e7,_0x25842b,_0x5655ff){var _0x396872;return db['User']['find']({'where':{'resetPasswordToken':_0x41f5e7[_0xc739('0x4c')][_0xc739('0x4d')],'resetPasswordExpires':{'$gt':Date[_0xc739('0x44')]()}}})[_0xc739('0xa')](function(_0x15968f){_0x396872=_0x15968f;if(!_0x396872){throw new Error(_0xc739('0x4e'));}return db[_0xc739('0x3d')][_0xc739('0xb')]({'attributes':['id',_0xc739('0x4f')]});})[_0xc739('0xa')](function(_0x270afc){return checkPasswordPattern(_0x270afc,_0x41f5e7[_0xc739('0x3a')]['password'],_0x270afc['securePassword']);})[_0xc739('0xa')](function(){_0x396872[_0xc739('0x50')]=_0x41f5e7[_0xc739('0x3a')]['password'];_0x396872[_0xc739('0x42')]=null;_0x396872[_0xc739('0x43')]=null;return _0x396872['save']();})['then'](function(){_0x25842b[_0xc739('0x2e')](0xc8)[_0xc739('0x2f')]({'message':_0xc739('0x51')});})[_0xc739('0x1a')](function(_0x1a1220){return handleError(_0x25842b,0x1f4,_0x1a1220);});};passport[_0xc739('0x52')](new LocalStrategy({'usernameField':_0xc739('0xc'),'passwordField':_0xc739('0x50')},function(_0x5715af,_0x3035c6,_0xf7ade0){return localAuthenticate(db[_0xc739('0x3e')],_0x5715af,_0x3035c6,_0xf7ade0);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index bde094b..f3259ea 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 _0x1145=['Router','./authLocal.controller','forgot','post','/reset/:token','reset','exports','express'];(function(_0x3c7e64,_0x29d8a7){var _0x3c6730=function(_0x3e13bd){while(--_0x3e13bd){_0x3c7e64['push'](_0x3c7e64['shift']());}};_0x3c6730(++_0x29d8a7);}(_0x1145,0xc7));var _0x5114=function(_0x4f53c1,_0x4d5033){_0x4f53c1=_0x4f53c1-0x0;var _0xc2c9af=_0x1145[_0x4f53c1];return _0xc2c9af;};'use strict';var express=require(_0x5114('0x0'));var router=express[_0x5114('0x1')]();var controller=require(_0x5114('0x2'));router['post']('/',controller['login']);router['post']('/forgot',controller[_0x5114('0x3')]);router[_0x5114('0x4')](_0x5114('0x5'),controller[_0x5114('0x6')]);module[_0x5114('0x7')]=router; \ No newline at end of file +var _0xffc4=['/forgot','/reset/:token','reset','express','Router','./authLocal.controller','post','login'];(function(_0x3ad7ad,_0x291a8d){var _0x225a60=function(_0xca7354){while(--_0xca7354){_0x3ad7ad['push'](_0x3ad7ad['shift']());}};_0x225a60(++_0x291a8d);}(_0xffc4,0xeb));var _0x4ffc=function(_0xac56ce,_0xb73e4){_0xac56ce=_0xac56ce-0x0;var _0x5105e1=_0xffc4[_0xac56ce];return _0x5105e1;};'use strict';var express=require(_0x4ffc('0x0'));var router=express[_0x4ffc('0x1')]();var controller=require(_0x4ffc('0x2'));router[_0x4ffc('0x3')]('/',controller[_0x4ffc('0x4')]);router[_0x4ffc('0x3')](_0x4ffc('0x5'),controller['forgot']);router[_0x4ffc('0x3')](_0x4ffc('0x6'),controller[_0x4ffc('0x7')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index a08bc51..bff2130 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 _0x16ae=['BOOLEAN','sequelize','STRING'];(function(_0x107d0,_0x2c5573){var _0x5d3287=function(_0x4cff81){while(--_0x4cff81){_0x107d0['push'](_0x107d0['shift']());}};_0x5d3287(++_0x2c5573);}(_0x16ae,0xdf));var _0xe16a=function(_0x38c020,_0x19e223){_0x38c020=_0x38c020-0x0;var _0x2d6873=_0x16ae[_0x38c020];return _0x2d6873;};'use strict';var Sequelize=require(_0xe16a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe16a('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe16a('0x1')]},'description':{'type':Sequelize[_0xe16a('0x1')]},'status':{'type':Sequelize[_0xe16a('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x900f=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x900f,0x10c));var _0xf900=function(_0xb9fe33,_0x47a545){_0xb9fe33=_0xb9fe33-0x0;var _0x15f7c2=_0x900f[_0xb9fe33];return _0x15f7c2;};'use strict';var Sequelize=require(_0xf900('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0xf900('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xf900('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xf900('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index dc55b7e..ecd8b60 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 _0x0f2d=['attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','addConditions','Condition','ids','omit','findOne','length','getConditions','addActions','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','update','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x344293,_0x1424ef){var _0x2ea516=function(_0x17b49d){while(--_0x17b49d){_0x344293['push'](_0x344293['shift']());}};_0x2ea516(++_0x1424ef);}(_0x0f2d,0x15a));var _0xd0f2=function(_0x2e1401,_0x3f1989){_0x2e1401=_0x2e1401-0x0;var _0x162b8d=_0x0f2d[_0x2e1401];return _0x162b8d;};'use strict';var pdf=require(_0xd0f2('0x0'));var emlformat=require(_0xd0f2('0x1'));var rimraf=require(_0xd0f2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0f2('0x3'));var rp=require(_0xd0f2('0x4'));var moment=require(_0xd0f2('0x5'));var BPromise=require(_0xd0f2('0x6'));var Mustache=require('mustache');var util=require(_0xd0f2('0x7'));var path=require(_0xd0f2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd0f2('0x9'));var crypto=require('crypto');var jsforce=require(_0xd0f2('0xa'));var deskjs=require(_0xd0f2('0xb'));var toCsv=require(_0xd0f2('0xc'));var querystring=require(_0xd0f2('0xd'));var Papa=require(_0xd0f2('0xe'));var Redis=require(_0xd0f2('0xf'));var authService=require(_0xd0f2('0x10'));var qs=require(_0xd0f2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0f2('0x12'));var logger=require(_0xd0f2('0x13'))(_0xd0f2('0x14'));var utils=require(_0xd0f2('0x15'));var config=require(_0xd0f2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28321d,_0x2980b0){_0x2980b0=_0x2980b0||0xcc;return function(_0x80e664){if(_0x80e664){return _0x28321d[_0xd0f2('0x17')](_0x2980b0);}return _0x28321d[_0xd0f2('0x18')](_0x2980b0)[_0xd0f2('0x19')]();};}function respondWithResult(_0x1e4359,_0x286f9f){_0x286f9f=_0x286f9f||0xc8;return function(_0x37776f){if(_0x37776f){return _0x1e4359[_0xd0f2('0x18')](_0x286f9f)[_0xd0f2('0x1a')](_0x37776f);}};}function respondWithFilteredResult(_0x196f96,_0x4aeff7){return function(_0x41027c){if(_0x41027c){var _0x6f21cf=_0x41027c[_0xd0f2('0x1b')],_0x2343c0=_0x4aeff7[_0xd0f2('0x1c')],_0x452e46=_0x4aeff7[_0xd0f2('0x1c')]+_0x4aeff7[_0xd0f2('0x1d')],_0x55cc50;if(_0x452e46>=_0x6f21cf){_0x452e46=_0x6f21cf;_0x55cc50=0xc8;}else{_0x55cc50=0xce;}_0x196f96[_0xd0f2('0x18')](_0x55cc50);return _0x196f96[_0xd0f2('0x1e')]('Content-Range',_0x2343c0+'-'+_0x452e46+'/'+_0x6f21cf)[_0xd0f2('0x1a')](_0x41027c);}return null;};}function patchUpdates(_0x1f0930){return function(_0x1be4d8){try{jsonpatch['apply'](_0x1be4d8,_0x1f0930,!![]);}catch(_0x2e2197){return BPromise['reject'](_0x2e2197);}return _0x1be4d8['save']();};}function saveUpdates(_0x172b01,_0x40e0fa){return function(_0x45cc0d){if(_0x45cc0d){return _0x45cc0d[_0xd0f2('0x1f')](_0x172b01)[_0xd0f2('0x20')](function(_0x626426){return _0x626426;});}return null;};}function removeEntity(_0x40233d,_0x5c0cda){return function(_0x145661){if(_0x145661){return _0x145661[_0xd0f2('0x21')]()[_0xd0f2('0x20')](function(){_0x40233d[_0xd0f2('0x18')](0xcc)[_0xd0f2('0x19')]();});}};}function handleEntityNotFound(_0x27ba35,_0x92dca5){return function(_0x21d492){if(!_0x21d492){_0x27ba35['sendStatus'](0x194);}return _0x21d492;};}function handleError(_0x808595,_0x4e4d46){_0x4e4d46=_0x4e4d46||0x1f4;return function(_0x411f60){logger[_0xd0f2('0x22')](_0x411f60[_0xd0f2('0x23')]);if(_0x411f60['name']){delete _0x411f60[_0xd0f2('0x24')];}_0x808595['status'](_0x4e4d46)['send'](_0x411f60);};}exports[_0xd0f2('0x25')]=function(_0x4afafc,_0x22c50d){var _0x5b9e90={},_0x2a8c3f={},_0x3445c7={'count':0x0,'rows':[]};var _0x85e214=_[_0xd0f2('0x26')](db[_0xd0f2('0x27')][_0xd0f2('0x28')],function(_0x1cfa18){return{'name':_0x1cfa18[_0xd0f2('0x29')],'type':_0x1cfa18[_0xd0f2('0x2a')]['key']};});_0x2a8c3f[_0xd0f2('0x2b')]=_[_0xd0f2('0x26')](_0x85e214,'name');_0x2a8c3f[_0xd0f2('0x2c')]=_[_0xd0f2('0x2d')](_0x4afafc['query']);_0x2a8c3f[_0xd0f2('0x2e')]=_[_0xd0f2('0x2f')](_0x2a8c3f[_0xd0f2('0x2b')],_0x2a8c3f[_0xd0f2('0x2c')]);_0x5b9e90['attributes']=_[_0xd0f2('0x2f')](_0x2a8c3f[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x30')]));_0x5b9e90[_0xd0f2('0x31')]=_0x5b9e90[_0xd0f2('0x31')]['length']?_0x5b9e90[_0xd0f2('0x31')]:_0x2a8c3f[_0xd0f2('0x2b')];if(!_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x32')](_0xd0f2('0x33'))){_0x5b9e90[_0xd0f2('0x1d')]=qs['limit'](_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x1d')]);_0x5b9e90[_0xd0f2('0x1c')]=qs[_0xd0f2('0x1c')](_0x4afafc['query']['offset']);}_0x5b9e90[_0xd0f2('0x34')]=qs[_0xd0f2('0x35')](_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x35')]);_0x5b9e90['where']=qs[_0xd0f2('0x2e')](_[_0xd0f2('0x36')](_0x4afafc['query'],_0x2a8c3f['filters']));if(_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x37')]){_0x5b9e90[_0xd0f2('0x38')]=_[_0xd0f2('0x39')](_0x5b9e90[_0xd0f2('0x38')],{'$or':_[_0xd0f2('0x26')](_0x85e214,function(_0x4e3b79){if(_0x4e3b79[_0xd0f2('0x2a')]!==_0xd0f2('0x3a')){var _0x25033e={};_0x25033e[_0x4e3b79[_0xd0f2('0x24')]]={'$like':'%'+_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x37')]+'%'};return _0x25033e;}})});}_0x5b9e90=_[_0xd0f2('0x39')]({},_0x5b9e90,_0x4afafc['options']);var _0x4b9062={'where':_0x5b9e90[_0xd0f2('0x38')]};return db[_0xd0f2('0x27')]['count'](_0x4b9062)['then'](function(_0x2d6ffb){_0x3445c7[_0xd0f2('0x1b')]=_0x2d6ffb;if(_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x3b')]){_0x5b9e90['include']=[{'all':!![]}];}return db['Automation'][_0xd0f2('0x3c')](_0x5b9e90);})['then'](function(_0x32b1af){_0x3445c7[_0xd0f2('0x3d')]=_0x32b1af;return _0x3445c7;})[_0xd0f2('0x20')](respondWithFilteredResult(_0x22c50d,_0x5b9e90))[_0xd0f2('0x3e')](handleError(_0x22c50d,null));};exports[_0xd0f2('0x3f')]=function(_0x2c99c9,_0xf81934){var _0x2dc98f={'raw':![],'where':{'id':_0x2c99c9[_0xd0f2('0x40')]['id']}},_0x46d7b9={};_0x46d7b9[_0xd0f2('0x2b')]=_[_0xd0f2('0x2d')](db['Automation']['rawAttributes']);_0x46d7b9[_0xd0f2('0x2c')]=_[_0xd0f2('0x2d')](_0x2c99c9['query']);_0x46d7b9['filters']=_[_0xd0f2('0x2f')](_0x46d7b9['model'],_0x46d7b9[_0xd0f2('0x2c')]);_0x2dc98f['attributes']=_['intersection'](_0x46d7b9[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x2c99c9[_0xd0f2('0x2c')][_0xd0f2('0x30')]));_0x2dc98f['attributes']=_0x2dc98f['attributes']['length']?_0x2dc98f[_0xd0f2('0x31')]:_0x46d7b9['model'];if(_0x2c99c9[_0xd0f2('0x2c')][_0xd0f2('0x3b')]){_0x2dc98f['include']=[{'all':!![]}];}_0x2dc98f=_['merge']({},_0x2dc98f,_0x2c99c9[_0xd0f2('0x41')]);return db['Automation'][_0xd0f2('0x42')](_0x2dc98f)[_0xd0f2('0x20')](handleEntityNotFound(_0xf81934,null))['then'](respondWithResult(_0xf81934,null))[_0xd0f2('0x3e')](handleError(_0xf81934,null));};exports[_0xd0f2('0x43')]=function(_0x178d74,_0xc08953){return db[_0xd0f2('0x27')][_0xd0f2('0x43')](_0x178d74[_0xd0f2('0x44')],{})['then'](respondWithResult(_0xc08953,0xc9))['catch'](handleError(_0xc08953,null));};exports[_0xd0f2('0x1f')]=function(_0x3a8245,_0x105d91){if(_0x3a8245[_0xd0f2('0x44')]['id']){delete _0x3a8245[_0xd0f2('0x44')]['id'];}return db[_0xd0f2('0x27')][_0xd0f2('0x42')]({'where':{'id':_0x3a8245[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x105d91,null))[_0xd0f2('0x20')](saveUpdates(_0x3a8245[_0xd0f2('0x44')],null))[_0xd0f2('0x20')](respondWithResult(_0x105d91,null))[_0xd0f2('0x3e')](handleError(_0x105d91,null));};exports[_0xd0f2('0x21')]=function(_0x7425f4,_0x204745){return db[_0xd0f2('0x27')][_0xd0f2('0x42')]({'where':{'id':_0x7425f4[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x204745,null))['then'](removeEntity(_0x204745,null))[_0xd0f2('0x3e')](handleError(_0x204745,null));};exports[_0xd0f2('0x45')]=function(_0x3ca668,_0x3c0d0e,_0x25ac11){return db[_0xd0f2('0x46')][_0xd0f2('0x42')]({'where':{'id':_0x3ca668[_0xd0f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c0d0e,null))[_0xd0f2('0x20')](function(_0x13613a){if(_0x13613a){return _0x13613a[_0xd0f2('0x45')](_0x3ca668[_0xd0f2('0x44')][_0xd0f2('0x47')],_[_0xd0f2('0x48')](_0x3ca668[_0xd0f2('0x44')],[_0xd0f2('0x47'),'id'])||{});}})['then'](respondWithResult(_0x3c0d0e,null))[_0xd0f2('0x3e')](handleError(_0x3c0d0e,null));};exports['getConditions']=function(_0x5746b1,_0x443a2b,_0x10a9fb){var _0x44e2cb={};var _0x303986={};var _0x42fba8;var _0x76c003;return db[_0xd0f2('0x27')][_0xd0f2('0x49')]({'where':{'id':_0x5746b1[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x443a2b,null))[_0xd0f2('0x20')](function(_0x4a3b6c){if(_0x4a3b6c){_0x42fba8=_0x4a3b6c;_0x303986[_0xd0f2('0x2b')]=_[_0xd0f2('0x2d')](db[_0xd0f2('0x46')][_0xd0f2('0x28')]);_0x303986[_0xd0f2('0x2c')]=_['keys'](_0x5746b1['query']);_0x303986['filters']=_['intersection'](_0x303986[_0xd0f2('0x2b')],_0x303986[_0xd0f2('0x2c')]);_0x44e2cb['attributes']=_[_0xd0f2('0x2f')](_0x303986[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x5746b1[_0xd0f2('0x2c')]['fields']));_0x44e2cb[_0xd0f2('0x31')]=_0x44e2cb['attributes'][_0xd0f2('0x4a')]?_0x44e2cb['attributes']:_0x303986['model'];_0x44e2cb[_0xd0f2('0x34')]=qs['sort'](_0x5746b1['query'][_0xd0f2('0x35')]);_0x44e2cb[_0xd0f2('0x38')]=qs[_0xd0f2('0x2e')](_['pick'](_0x5746b1[_0xd0f2('0x2c')],_0x303986[_0xd0f2('0x2e')]));if(_0x5746b1[_0xd0f2('0x2c')]['filter']){_0x44e2cb[_0xd0f2('0x38')]=_[_0xd0f2('0x39')](_0x44e2cb[_0xd0f2('0x38')],{'$or':_['map'](_0x44e2cb[_0xd0f2('0x31')],function(_0x1506b7){var _0x439bf9={};_0x439bf9[_0x1506b7]={'$like':'%'+_0x5746b1['query']['filter']+'%'};return _0x439bf9;})});}_0x44e2cb=_['merge']({},_0x44e2cb,_0x5746b1[_0xd0f2('0x41')]);return _0x42fba8['getConditions'](_0x44e2cb);}})[_0xd0f2('0x20')](function(_0x1ccdf3){if(_0x1ccdf3){_0x76c003=_0x1ccdf3['length'];if(!_0x5746b1[_0xd0f2('0x2c')]['hasOwnProperty']('nolimit')){_0x44e2cb[_0xd0f2('0x1d')]=qs['limit'](_0x5746b1['query'][_0xd0f2('0x1d')]);_0x44e2cb['offset']=qs[_0xd0f2('0x1c')](_0x5746b1[_0xd0f2('0x2c')]['offset']);}return _0x42fba8[_0xd0f2('0x4b')](_0x44e2cb);}})['then'](function(_0x1942fb){if(_0x1942fb){return _0x1942fb?{'count':_0x76c003,'rows':_0x1942fb}:null;}})['then'](respondWithResult(_0x443a2b,null))['catch'](handleError(_0x443a2b,null));};exports[_0xd0f2('0x4c')]=function(_0xed4531,_0x4b49b6,_0x3a34ae){return db[_0xd0f2('0x4d')][_0xd0f2('0x42')]({'where':{'id':_0xed4531[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x4b49b6,null))[_0xd0f2('0x20')](function(_0x3c0ae7){if(_0x3c0ae7){return _0x3c0ae7[_0xd0f2('0x4c')](_0xed4531[_0xd0f2('0x44')][_0xd0f2('0x47')],_[_0xd0f2('0x48')](_0xed4531['body'],[_0xd0f2('0x47'),'id'])||{});}})['then'](respondWithResult(_0x4b49b6,null))[_0xd0f2('0x3e')](handleError(_0x4b49b6,null));};exports[_0xd0f2('0x4e')]=function(_0x5adaad,_0x9afcb2,_0x529fcf){var _0x206d59={};var _0x5aa3c5={};var _0x9e7fd8;var _0x536d32;return db[_0xd0f2('0x27')][_0xd0f2('0x49')]({'where':{'id':_0x5adaad['params']['id']}})['then'](handleEntityNotFound(_0x9afcb2,null))['then'](function(_0x1a156e){if(_0x1a156e){_0x9e7fd8=_0x1a156e;_0x5aa3c5['model']=_[_0xd0f2('0x2d')](db[_0xd0f2('0x4d')][_0xd0f2('0x28')]);_0x5aa3c5[_0xd0f2('0x2c')]=_[_0xd0f2('0x2d')](_0x5adaad[_0xd0f2('0x2c')]);_0x5aa3c5[_0xd0f2('0x2e')]=_[_0xd0f2('0x2f')](_0x5aa3c5[_0xd0f2('0x2b')],_0x5aa3c5[_0xd0f2('0x2c')]);_0x206d59[_0xd0f2('0x31')]=_[_0xd0f2('0x2f')](_0x5aa3c5[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x5adaad['query']['fields']));_0x206d59['attributes']=_0x206d59[_0xd0f2('0x31')][_0xd0f2('0x4a')]?_0x206d59[_0xd0f2('0x31')]:_0x5aa3c5[_0xd0f2('0x2b')];_0x206d59[_0xd0f2('0x34')]=qs[_0xd0f2('0x35')](_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x35')]);_0x206d59[_0xd0f2('0x38')]=qs[_0xd0f2('0x2e')](_['pick'](_0x5adaad[_0xd0f2('0x2c')],_0x5aa3c5[_0xd0f2('0x2e')]));if(_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x37')]){_0x206d59[_0xd0f2('0x38')]=_[_0xd0f2('0x39')](_0x206d59[_0xd0f2('0x38')],{'$or':_['map'](_0x206d59['attributes'],function(_0x7435d5){var _0xe40342={};_0xe40342[_0x7435d5]={'$like':'%'+_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x37')]+'%'};return _0xe40342;})});}_0x206d59=_[_0xd0f2('0x39')]({},_0x206d59,_0x5adaad[_0xd0f2('0x41')]);return _0x9e7fd8[_0xd0f2('0x4e')](_0x206d59);}})[_0xd0f2('0x20')](function(_0x5baae6){if(_0x5baae6){_0x536d32=_0x5baae6[_0xd0f2('0x4a')];if(!_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x32')](_0xd0f2('0x33'))){_0x206d59[_0xd0f2('0x1d')]=qs[_0xd0f2('0x1d')](_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x1d')]);_0x206d59[_0xd0f2('0x1c')]=qs[_0xd0f2('0x1c')](_0x5adaad[_0xd0f2('0x2c')]['offset']);}return _0x9e7fd8[_0xd0f2('0x4e')](_0x206d59);}})[_0xd0f2('0x20')](function(_0x5060c4){if(_0x5060c4){return _0x5060c4?{'count':_0x536d32,'rows':_0x5060c4}:null;}})['then'](respondWithResult(_0x9afcb2,null))[_0xd0f2('0x3e')](handleError(_0x9afcb2,null));}; \ No newline at end of file +var _0x25af=['key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','type','Automation','includeAll','include','findAll','catch','params','merge','find','create','body','addConditions','Condition','ids','omit','findOne','order','options','getConditions','addActions','Action','getActions','html-pdf','request-promise','moment','bluebird','util','sox','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','apply','reject','update','then','destroy','error','stack','name','send','map','rawAttributes'];(function(_0x3f5a92,_0x490c41){var _0x44000a=function(_0x265ae3){while(--_0x265ae3){_0x3f5a92['push'](_0x3f5a92['shift']());}};_0x44000a(++_0x490c41);}(_0x25af,0x70));var _0xf25a=function(_0x6ebeac,_0x370272){_0x6ebeac=_0x6ebeac-0x0;var _0x3ef91f=_0x25af[_0x6ebeac];return _0x3ef91f;};'use strict';var pdf=require(_0xf25a('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xf25a('0x1'));var moment=require(_0xf25a('0x2'));var BPromise=require(_0xf25a('0x3'));var Mustache=require('mustache');var util=require(_0xf25a('0x4'));var path=require('path');var sox=require(_0xf25a('0x5'));var csv=require('to-csv');var ejs=require(_0xf25a('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf25a('0x7'));var crypto=require('crypto');var jsforce=require(_0xf25a('0x8'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf25a('0x9'));var Papa=require(_0xf25a('0xa'));var Redis=require(_0xf25a('0xb'));var authService=require(_0xf25a('0xc'));var qs=require(_0xf25a('0xd'));var as=require(_0xf25a('0xe'));var hardwareService=require(_0xf25a('0xf'));var logger=require(_0xf25a('0x10'))(_0xf25a('0x11'));var utils=require(_0xf25a('0x12'));var config=require('../../config/environment');var db=require(_0xf25a('0x13'))['db'];function respondWithStatusCode(_0x42369c,_0x1e1787){_0x1e1787=_0x1e1787||0xcc;return function(_0xb72f2d){if(_0xb72f2d){return _0x42369c['sendStatus'](_0x1e1787);}return _0x42369c[_0xf25a('0x14')](_0x1e1787)[_0xf25a('0x15')]();};}function respondWithResult(_0x32864f,_0x43a5e8){_0x43a5e8=_0x43a5e8||0xc8;return function(_0xe70c3f){if(_0xe70c3f){return _0x32864f[_0xf25a('0x14')](_0x43a5e8)[_0xf25a('0x16')](_0xe70c3f);}};}function respondWithFilteredResult(_0x5d3f97,_0x58b2c1){return function(_0x5c6cfc){if(_0x5c6cfc){var _0x15bdd2=_0x5c6cfc[_0xf25a('0x17')],_0x5cf947=_0x58b2c1['offset'],_0x22f340=_0x58b2c1[_0xf25a('0x18')]+_0x58b2c1['limit'],_0x506614;if(_0x22f340>=_0x15bdd2){_0x22f340=_0x15bdd2;_0x506614=0xc8;}else{_0x506614=0xce;}_0x5d3f97[_0xf25a('0x14')](_0x506614);return _0x5d3f97['set']('Content-Range',_0x5cf947+'-'+_0x22f340+'/'+_0x15bdd2)[_0xf25a('0x16')](_0x5c6cfc);}return null;};}function patchUpdates(_0x2df009){return function(_0x49c703){try{jsonpatch[_0xf25a('0x19')](_0x49c703,_0x2df009,!![]);}catch(_0x48382e){return BPromise[_0xf25a('0x1a')](_0x48382e);}return _0x49c703['save']();};}function saveUpdates(_0x467d5d,_0x3cbaa6){return function(_0x1602f2){if(_0x1602f2){return _0x1602f2[_0xf25a('0x1b')](_0x467d5d)[_0xf25a('0x1c')](function(_0x141180){return _0x141180;});}return null;};}function removeEntity(_0x1dd1ab,_0x1228e9){return function(_0x45d084){if(_0x45d084){return _0x45d084[_0xf25a('0x1d')]()[_0xf25a('0x1c')](function(){_0x1dd1ab[_0xf25a('0x14')](0xcc)[_0xf25a('0x15')]();});}};}function handleEntityNotFound(_0x2b3483,_0x34ad8e){return function(_0x3c1a3f){if(!_0x3c1a3f){_0x2b3483['sendStatus'](0x194);}return _0x3c1a3f;};}function handleError(_0x41a8f7,_0x18e45b){_0x18e45b=_0x18e45b||0x1f4;return function(_0x5d25a8){logger[_0xf25a('0x1e')](_0x5d25a8[_0xf25a('0x1f')]);if(_0x5d25a8[_0xf25a('0x20')]){delete _0x5d25a8[_0xf25a('0x20')];}_0x41a8f7[_0xf25a('0x14')](_0x18e45b)[_0xf25a('0x21')](_0x5d25a8);};}exports['index']=function(_0x38afa0,_0x464acc){var _0x36a1f6={},_0x16f87e={},_0x1b5a72={'count':0x0,'rows':[]};var _0x14231e=_[_0xf25a('0x22')](db['Automation'][_0xf25a('0x23')],function(_0x5dcd53){return{'name':_0x5dcd53['fieldName'],'type':_0x5dcd53['type'][_0xf25a('0x24')]};});_0x16f87e[_0xf25a('0x25')]=_[_0xf25a('0x22')](_0x14231e,_0xf25a('0x20'));_0x16f87e[_0xf25a('0x26')]=_[_0xf25a('0x27')](_0x38afa0[_0xf25a('0x26')]);_0x16f87e[_0xf25a('0x28')]=_[_0xf25a('0x29')](_0x16f87e[_0xf25a('0x25')],_0x16f87e[_0xf25a('0x26')]);_0x36a1f6[_0xf25a('0x2a')]=_[_0xf25a('0x29')](_0x16f87e[_0xf25a('0x25')],qs[_0xf25a('0x2b')](_0x38afa0[_0xf25a('0x26')]['fields']));_0x36a1f6[_0xf25a('0x2a')]=_0x36a1f6[_0xf25a('0x2a')][_0xf25a('0x2c')]?_0x36a1f6[_0xf25a('0x2a')]:_0x16f87e[_0xf25a('0x25')];if(!_0x38afa0[_0xf25a('0x26')][_0xf25a('0x2d')](_0xf25a('0x2e'))){_0x36a1f6[_0xf25a('0x2f')]=qs[_0xf25a('0x2f')](_0x38afa0[_0xf25a('0x26')][_0xf25a('0x2f')]);_0x36a1f6[_0xf25a('0x18')]=qs[_0xf25a('0x18')](_0x38afa0['query']['offset']);}_0x36a1f6['order']=qs['sort'](_0x38afa0[_0xf25a('0x26')][_0xf25a('0x30')]);_0x36a1f6[_0xf25a('0x31')]=qs[_0xf25a('0x28')](_[_0xf25a('0x32')](_0x38afa0['query'],_0x16f87e[_0xf25a('0x28')]));if(_0x38afa0['query'][_0xf25a('0x33')]){_0x36a1f6[_0xf25a('0x31')]=_['merge'](_0x36a1f6['where'],{'$or':_[_0xf25a('0x22')](_0x14231e,function(_0x375992){if(_0x375992[_0xf25a('0x34')]!=='VIRTUAL'){var _0x8dad0d={};_0x8dad0d[_0x375992['name']]={'$like':'%'+_0x38afa0[_0xf25a('0x26')][_0xf25a('0x33')]+'%'};return _0x8dad0d;}})});}_0x36a1f6=_['merge']({},_0x36a1f6,_0x38afa0['options']);var _0x5732a5={'where':_0x36a1f6[_0xf25a('0x31')]};return db[_0xf25a('0x35')][_0xf25a('0x17')](_0x5732a5)[_0xf25a('0x1c')](function(_0x25349d){_0x1b5a72['count']=_0x25349d;if(_0x38afa0[_0xf25a('0x26')][_0xf25a('0x36')]){_0x36a1f6[_0xf25a('0x37')]=[{'all':!![]}];}return db[_0xf25a('0x35')][_0xf25a('0x38')](_0x36a1f6);})[_0xf25a('0x1c')](function(_0x18a021){_0x1b5a72['rows']=_0x18a021;return _0x1b5a72;})[_0xf25a('0x1c')](respondWithFilteredResult(_0x464acc,_0x36a1f6))[_0xf25a('0x39')](handleError(_0x464acc,null));};exports['show']=function(_0x2edd55,_0x395e65){var _0x5768cb={'raw':![],'where':{'id':_0x2edd55[_0xf25a('0x3a')]['id']}},_0x1aa034={};_0x1aa034[_0xf25a('0x25')]=_[_0xf25a('0x27')](db[_0xf25a('0x35')][_0xf25a('0x23')]);_0x1aa034[_0xf25a('0x26')]=_[_0xf25a('0x27')](_0x2edd55[_0xf25a('0x26')]);_0x1aa034[_0xf25a('0x28')]=_['intersection'](_0x1aa034[_0xf25a('0x25')],_0x1aa034[_0xf25a('0x26')]);_0x5768cb[_0xf25a('0x2a')]=_[_0xf25a('0x29')](_0x1aa034[_0xf25a('0x25')],qs['fields'](_0x2edd55[_0xf25a('0x26')][_0xf25a('0x2b')]));_0x5768cb['attributes']=_0x5768cb[_0xf25a('0x2a')][_0xf25a('0x2c')]?_0x5768cb[_0xf25a('0x2a')]:_0x1aa034[_0xf25a('0x25')];if(_0x2edd55['query']['includeAll']){_0x5768cb[_0xf25a('0x37')]=[{'all':!![]}];}_0x5768cb=_[_0xf25a('0x3b')]({},_0x5768cb,_0x2edd55['options']);return db[_0xf25a('0x35')][_0xf25a('0x3c')](_0x5768cb)['then'](handleEntityNotFound(_0x395e65,null))[_0xf25a('0x1c')](respondWithResult(_0x395e65,null))[_0xf25a('0x39')](handleError(_0x395e65,null));};exports['create']=function(_0x43aef1,_0x15cfda){return db[_0xf25a('0x35')][_0xf25a('0x3d')](_0x43aef1[_0xf25a('0x3e')],{})[_0xf25a('0x1c')](respondWithResult(_0x15cfda,0xc9))[_0xf25a('0x39')](handleError(_0x15cfda,null));};exports[_0xf25a('0x1b')]=function(_0x5d7c5d,_0x3f71dd){if(_0x5d7c5d[_0xf25a('0x3e')]['id']){delete _0x5d7c5d['body']['id'];}return db[_0xf25a('0x35')][_0xf25a('0x3c')]({'where':{'id':_0x5d7c5d['params']['id']}})[_0xf25a('0x1c')](handleEntityNotFound(_0x3f71dd,null))[_0xf25a('0x1c')](saveUpdates(_0x5d7c5d[_0xf25a('0x3e')],null))[_0xf25a('0x1c')](respondWithResult(_0x3f71dd,null))[_0xf25a('0x39')](handleError(_0x3f71dd,null));};exports[_0xf25a('0x1d')]=function(_0x1e41de,_0x9411fe){return db['Automation'][_0xf25a('0x3c')]({'where':{'id':_0x1e41de[_0xf25a('0x3a')]['id']}})[_0xf25a('0x1c')](handleEntityNotFound(_0x9411fe,null))[_0xf25a('0x1c')](removeEntity(_0x9411fe,null))[_0xf25a('0x39')](handleError(_0x9411fe,null));};exports[_0xf25a('0x3f')]=function(_0x220d19,_0xb6a6ae,_0x35fd00){return db[_0xf25a('0x40')][_0xf25a('0x3c')]({'where':{'id':_0x220d19[_0xf25a('0x3a')]['id']}})[_0xf25a('0x1c')](handleEntityNotFound(_0xb6a6ae,null))[_0xf25a('0x1c')](function(_0x3e69a2){if(_0x3e69a2){return _0x3e69a2[_0xf25a('0x3f')](_0x220d19[_0xf25a('0x3e')][_0xf25a('0x41')],_[_0xf25a('0x42')](_0x220d19['body'],[_0xf25a('0x41'),'id'])||{});}})['then'](respondWithResult(_0xb6a6ae,null))[_0xf25a('0x39')](handleError(_0xb6a6ae,null));};exports['getConditions']=function(_0x12f833,_0x24855d,_0x5249b1){var _0x2ab579={};var _0x2a9711={};var _0x2db471;var _0x38702e;return db[_0xf25a('0x35')][_0xf25a('0x43')]({'where':{'id':_0x12f833['params']['id']}})['then'](handleEntityNotFound(_0x24855d,null))[_0xf25a('0x1c')](function(_0x151a08){if(_0x151a08){_0x2db471=_0x151a08;_0x2a9711['model']=_[_0xf25a('0x27')](db[_0xf25a('0x40')][_0xf25a('0x23')]);_0x2a9711['query']=_['keys'](_0x12f833[_0xf25a('0x26')]);_0x2a9711['filters']=_['intersection'](_0x2a9711[_0xf25a('0x25')],_0x2a9711[_0xf25a('0x26')]);_0x2ab579[_0xf25a('0x2a')]=_[_0xf25a('0x29')](_0x2a9711[_0xf25a('0x25')],qs[_0xf25a('0x2b')](_0x12f833[_0xf25a('0x26')]['fields']));_0x2ab579['attributes']=_0x2ab579['attributes'][_0xf25a('0x2c')]?_0x2ab579[_0xf25a('0x2a')]:_0x2a9711['model'];_0x2ab579[_0xf25a('0x44')]=qs['sort'](_0x12f833['query'][_0xf25a('0x30')]);_0x2ab579['where']=qs[_0xf25a('0x28')](_[_0xf25a('0x32')](_0x12f833[_0xf25a('0x26')],_0x2a9711[_0xf25a('0x28')]));if(_0x12f833[_0xf25a('0x26')][_0xf25a('0x33')]){_0x2ab579['where']=_[_0xf25a('0x3b')](_0x2ab579[_0xf25a('0x31')],{'$or':_[_0xf25a('0x22')](_0x2ab579['attributes'],function(_0x45f31d){var _0xe89160={};_0xe89160[_0x45f31d]={'$like':'%'+_0x12f833[_0xf25a('0x26')][_0xf25a('0x33')]+'%'};return _0xe89160;})});}_0x2ab579=_[_0xf25a('0x3b')]({},_0x2ab579,_0x12f833[_0xf25a('0x45')]);return _0x2db471[_0xf25a('0x46')](_0x2ab579);}})['then'](function(_0x3d80da){if(_0x3d80da){_0x38702e=_0x3d80da[_0xf25a('0x2c')];if(!_0x12f833[_0xf25a('0x26')][_0xf25a('0x2d')](_0xf25a('0x2e'))){_0x2ab579[_0xf25a('0x2f')]=qs[_0xf25a('0x2f')](_0x12f833[_0xf25a('0x26')][_0xf25a('0x2f')]);_0x2ab579[_0xf25a('0x18')]=qs[_0xf25a('0x18')](_0x12f833[_0xf25a('0x26')]['offset']);}return _0x2db471[_0xf25a('0x46')](_0x2ab579);}})[_0xf25a('0x1c')](function(_0x26274b){if(_0x26274b){return _0x26274b?{'count':_0x38702e,'rows':_0x26274b}:null;}})[_0xf25a('0x1c')](respondWithResult(_0x24855d,null))[_0xf25a('0x39')](handleError(_0x24855d,null));};exports[_0xf25a('0x47')]=function(_0x30d454,_0x4e4a76,_0x4970a0){return db[_0xf25a('0x48')][_0xf25a('0x3c')]({'where':{'id':_0x30d454['params']['id']}})['then'](handleEntityNotFound(_0x4e4a76,null))[_0xf25a('0x1c')](function(_0x53038d){if(_0x53038d){return _0x53038d[_0xf25a('0x47')](_0x30d454['body'][_0xf25a('0x41')],_[_0xf25a('0x42')](_0x30d454[_0xf25a('0x3e')],[_0xf25a('0x41'),'id'])||{});}})['then'](respondWithResult(_0x4e4a76,null))[_0xf25a('0x39')](handleError(_0x4e4a76,null));};exports['getActions']=function(_0x15140c,_0x6e8afa,_0x3bb3b7){var _0x476f4b={};var _0x1607cc={};var _0x422d32;var _0x15e71c;return db[_0xf25a('0x35')][_0xf25a('0x43')]({'where':{'id':_0x15140c[_0xf25a('0x3a')]['id']}})[_0xf25a('0x1c')](handleEntityNotFound(_0x6e8afa,null))[_0xf25a('0x1c')](function(_0x182b13){if(_0x182b13){_0x422d32=_0x182b13;_0x1607cc[_0xf25a('0x25')]=_[_0xf25a('0x27')](db[_0xf25a('0x48')][_0xf25a('0x23')]);_0x1607cc['query']=_[_0xf25a('0x27')](_0x15140c[_0xf25a('0x26')]);_0x1607cc[_0xf25a('0x28')]=_[_0xf25a('0x29')](_0x1607cc[_0xf25a('0x25')],_0x1607cc[_0xf25a('0x26')]);_0x476f4b[_0xf25a('0x2a')]=_[_0xf25a('0x29')](_0x1607cc[_0xf25a('0x25')],qs[_0xf25a('0x2b')](_0x15140c['query'][_0xf25a('0x2b')]));_0x476f4b[_0xf25a('0x2a')]=_0x476f4b[_0xf25a('0x2a')][_0xf25a('0x2c')]?_0x476f4b[_0xf25a('0x2a')]:_0x1607cc[_0xf25a('0x25')];_0x476f4b[_0xf25a('0x44')]=qs[_0xf25a('0x30')](_0x15140c[_0xf25a('0x26')][_0xf25a('0x30')]);_0x476f4b[_0xf25a('0x31')]=qs[_0xf25a('0x28')](_['pick'](_0x15140c['query'],_0x1607cc[_0xf25a('0x28')]));if(_0x15140c[_0xf25a('0x26')][_0xf25a('0x33')]){_0x476f4b['where']=_[_0xf25a('0x3b')](_0x476f4b[_0xf25a('0x31')],{'$or':_[_0xf25a('0x22')](_0x476f4b[_0xf25a('0x2a')],function(_0xc1437f){var _0x2a4727={};_0x2a4727[_0xc1437f]={'$like':'%'+_0x15140c[_0xf25a('0x26')][_0xf25a('0x33')]+'%'};return _0x2a4727;})});}_0x476f4b=_[_0xf25a('0x3b')]({},_0x476f4b,_0x15140c[_0xf25a('0x45')]);return _0x422d32[_0xf25a('0x49')](_0x476f4b);}})[_0xf25a('0x1c')](function(_0x5c7386){if(_0x5c7386){_0x15e71c=_0x5c7386[_0xf25a('0x2c')];if(!_0x15140c['query']['hasOwnProperty']('nolimit')){_0x476f4b[_0xf25a('0x2f')]=qs['limit'](_0x15140c[_0xf25a('0x26')][_0xf25a('0x2f')]);_0x476f4b['offset']=qs[_0xf25a('0x18')](_0x15140c[_0xf25a('0x26')]['offset']);}return _0x422d32[_0xf25a('0x49')](_0x476f4b);}})['then'](function(_0x294421){if(_0x294421){return _0x294421?{'count':_0x15e71c,'rows':_0x294421}:null;}})['then'](respondWithResult(_0x6e8afa,null))[_0xf25a('0x39')](handleError(_0x6e8afa,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 4371a7b..4552fcd 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 _0x1660=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util'];(function(_0x2dea58,_0x59d6f0){var _0x2b23c2=function(_0x3e5c44){while(--_0x3e5c44){_0x2dea58['push'](_0x2dea58['shift']());}};_0x2b23c2(++_0x59d6f0);}(_0x1660,0x1c5));var _0x0166=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x1660[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x0166('0x0'));var util=require(_0x0166('0x1'));var logger=require(_0x0166('0x2'))(_0x0166('0x3'));var moment=require(_0x0166('0x4'));var BPromise=require(_0x0166('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0166('0x6'));var rimraf=require(_0x0166('0x7'));var config=require(_0x0166('0x8'));var attributes=require(_0x0166('0x9'));module[_0x0166('0xa')]=function(_0x11fb58,_0x3b5632){return _0x11fb58[_0x0166('0xb')]('Automation',attributes,{'tableName':_0x0166('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b96=['./automation.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1ff48a,_0x763dda){var _0x3e6616=function(_0x542d78){while(--_0x542d78){_0x1ff48a['push'](_0x1ff48a['shift']());}};_0x3e6616(++_0x763dda);}(_0x7b96,0x92));var _0x67b9=function(_0x1aca34,_0x21a2cc){_0x1aca34=_0x1aca34-0x0;var _0x3762f3=_0x7b96[_0x1aca34];return _0x3762f3;};'use strict';var _=require(_0x67b9('0x0'));var util=require(_0x67b9('0x1'));var logger=require(_0x67b9('0x2'))(_0x67b9('0x3'));var moment=require(_0x67b9('0x4'));var BPromise=require(_0x67b9('0x5'));var rp=require(_0x67b9('0x6'));var fs=require('fs');var path=require(_0x67b9('0x7'));var rimraf=require(_0x67b9('0x8'));var config=require(_0x67b9('0x9'));var attributes=require(_0x67b9('0xa'));module[_0x67b9('0xb')]=function(_0x2f0609,_0x8cce65){return _0x2f0609[_0x67b9('0xc')]('Automation',attributes,{'tableName':'tools_automations','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 8d96ffa..34d39e0 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 _0xc850=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1e5cc1,_0x1e76fc){var _0x320ddc=function(_0x3016ce){while(--_0x3016ce){_0x1e5cc1['push'](_0x1e5cc1['shift']());}};_0x320ddc(++_0x1e76fc);}(_0xc850,0x1e7));var _0x0c85=function(_0x399029,_0x2c9603){_0x399029=_0x399029-0x0;var _0x29855f=_0xc850[_0x399029];return _0x29855f;};'use strict';var _=require(_0x0c85('0x0'));var util=require(_0x0c85('0x1'));var moment=require(_0x0c85('0x2'));var BPromise=require(_0x0c85('0x3'));var rs=require(_0x0c85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c85('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c85('0x6'))(_0x0c85('0x7'));var config=require(_0x0c85('0x8'));var jayson=require(_0x0c85('0x9'));var client=jayson[_0x0c85('0xa')][_0x0c85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19b878,_0x495d93,_0x281516){return new BPromise(function(_0x4c22ae,_0xcbeb21){return client[_0x0c85('0xc')](_0x19b878,_0x281516)[_0x0c85('0xd')](function(_0x1d5eb){logger[_0x0c85('0xe')](_0x0c85('0xf'),_0x495d93,'request\x20sent');logger['debug'](_0x0c85('0x10'),_0x495d93,_0x0c85('0x11'),JSON['stringify'](_0x1d5eb));if(_0x1d5eb[_0x0c85('0x12')]){if(_0x1d5eb[_0x0c85('0x12')][_0x0c85('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x495d93,_0x1d5eb[_0x0c85('0x12')][_0x0c85('0x14')]);return _0xcbeb21(_0x1d5eb[_0x0c85('0x12')]['message']);}logger[_0x0c85('0x12')](_0x0c85('0xf'),_0x495d93,_0x1d5eb['error'][_0x0c85('0x14')]);return _0x4c22ae(_0x1d5eb[_0x0c85('0x12')]['message']);}else{logger[_0x0c85('0xe')](_0x0c85('0xf'),_0x495d93,_0x0c85('0x11'));_0x4c22ae(_0x1d5eb[_0x0c85('0x15')][_0x0c85('0x14')]);}})[_0x0c85('0x16')](function(_0x23c96e){logger[_0x0c85('0x12')](_0x0c85('0xf'),_0x495d93,_0x23c96e);_0xcbeb21(_0x23c96e);});});} \ No newline at end of file +var _0xbb33=['error','message','result','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3825a8,_0x2ce1a2){var _0xabc9bc=function(_0x101073){while(--_0x101073){_0x3825a8['push'](_0x3825a8['shift']());}};_0xabc9bc(++_0x2ce1a2);}(_0xbb33,0x8f));var _0x3bb3=function(_0x461a30,_0x4366bc){_0x461a30=_0x461a30-0x0;var _0x2e4a01=_0xbb33[_0x461a30];return _0x2e4a01;};'use strict';var _=require(_0x3bb3('0x0'));var util=require('util');var moment=require(_0x3bb3('0x1'));var BPromise=require(_0x3bb3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3bb3('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3bb3('0x4'))(_0x3bb3('0x5'));var config=require(_0x3bb3('0x6'));var jayson=require(_0x3bb3('0x7'));var client=jayson['client'][_0x3bb3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e2923,_0x840d50,_0x195b55){return new BPromise(function(_0x1744f6,_0x4e833d){return client[_0x3bb3('0x9')](_0x1e2923,_0x195b55)[_0x3bb3('0xa')](function(_0x5f0a79){logger[_0x3bb3('0xb')](_0x3bb3('0xc'),_0x840d50,'request\x20sent');logger[_0x3bb3('0xd')](_0x3bb3('0xe'),_0x840d50,_0x3bb3('0xf'),JSON[_0x3bb3('0x10')](_0x5f0a79));if(_0x5f0a79[_0x3bb3('0x11')]){if(_0x5f0a79[_0x3bb3('0x11')]['code']===0x1f4){logger['error'](_0x3bb3('0xc'),_0x840d50,_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);return _0x4e833d(_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);}logger[_0x3bb3('0x11')](_0x3bb3('0xc'),_0x840d50,_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);return _0x1744f6(_0x5f0a79[_0x3bb3('0x11')][_0x3bb3('0x12')]);}else{logger[_0x3bb3('0xb')]('Automation,\x20%s,\x20%s',_0x840d50,_0x3bb3('0xf'));_0x1744f6(_0x5f0a79[_0x3bb3('0x13')][_0x3bb3('0x12')]);}})['catch'](function(_0x2274cb){logger[_0x3bb3('0x11')](_0x3bb3('0xc'),_0x840d50,_0x2274cb);_0x4e833d(_0x2274cb);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 3f12f58..0253d98 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 _0x5333=['getConditions','/:id/actions','post','/:id/conditions','addConditions','addActions','put','/:id','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x344fd9,_0x33cc0a){var _0x2312dd=function(_0x1d2a7f){while(--_0x1d2a7f){_0x344fd9['push'](_0x344fd9['shift']());}};_0x2312dd(++_0x33cc0a);}(_0x5333,0x1ef));var _0x3533=function(_0x26693b,_0x1209d0){_0x26693b=_0x26693b-0x0;var _0x2d3c39=_0x5333[_0x26693b];return _0x2d3c39;};'use strict';var multer=require('multer');var util=require(_0x3533('0x0'));var path=require('path');var timeout=require(_0x3533('0x1'));var express=require(_0x3533('0x2'));var router=express[_0x3533('0x3')]();var auth=require(_0x3533('0x4'));var interaction=require(_0x3533('0x5'));var config=require(_0x3533('0x6'));var controller=require('./automation.controller');router[_0x3533('0x7')]('/',auth['isAuthenticated'](),controller[_0x3533('0x8')]);router['get']('/:id',auth[_0x3533('0x9')](),controller[_0x3533('0xa')]);router[_0x3533('0x7')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x3533('0xb')]);router[_0x3533('0x7')](_0x3533('0xc'),auth['isAuthenticated'](),controller['getActions']);router[_0x3533('0xd')]('/',auth[_0x3533('0x9')](),controller['create']);router['post'](_0x3533('0xe'),auth['isAuthenticated'](),controller[_0x3533('0xf')]);router['post'](_0x3533('0xc'),auth[_0x3533('0x9')](),controller[_0x3533('0x10')]);router[_0x3533('0x11')](_0x3533('0x12'),auth['isAuthenticated'](),controller[_0x3533('0x13')]);router[_0x3533('0x14')](_0x3533('0x12'),auth[_0x3533('0x9')](),controller['destroy']);module[_0x3533('0x15')]=router; \ No newline at end of file +var _0x567a=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','delete'];(function(_0x49e913,_0x14dbe3){var _0x3f9f12=function(_0x4ae45d){while(--_0x4ae45d){_0x49e913['push'](_0x49e913['shift']());}};_0x3f9f12(++_0x14dbe3);}(_0x567a,0x8d));var _0xa567=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x567a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa567('0x0'));var util=require(_0xa567('0x1'));var path=require(_0xa567('0x2'));var timeout=require(_0xa567('0x3'));var express=require(_0xa567('0x4'));var router=express[_0xa567('0x5')]();var auth=require(_0xa567('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa567('0x7'));var controller=require('./automation.controller');router[_0xa567('0x8')]('/',auth[_0xa567('0x9')](),controller[_0xa567('0xa')]);router[_0xa567('0x8')](_0xa567('0xb'),auth[_0xa567('0x9')](),controller[_0xa567('0xc')]);router[_0xa567('0x8')]('/:id/conditions',auth['isAuthenticated'](),controller[_0xa567('0xd')]);router['get'](_0xa567('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0xa567('0xf')]('/',auth['isAuthenticated'](),controller[_0xa567('0x10')]);router[_0xa567('0xf')](_0xa567('0x11'),auth[_0xa567('0x9')](),controller['addConditions']);router[_0xa567('0xf')](_0xa567('0xe'),auth[_0xa567('0x9')](),controller['addActions']);router['put'](_0xa567('0xb'),auth[_0xa567('0x9')](),controller['update']);router[_0xa567('0x12')](_0xa567('0xb'),auth['isAuthenticated'](),controller[_0xa567('0x13')]);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 19a044c..ac2fe6f 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 _0xde45=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','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)'];(function(_0x2387e0,_0x24df19){var _0xc3c730=function(_0x1f5455){while(--_0x1f5455){_0x2387e0['push'](_0x2387e0['shift']());}};_0xc3c730(++_0x24df19);}(_0xde45,0x10c));var _0x5de4=function(_0x5df1fb,_0x1e974b){_0x5df1fb=_0x5df1fb-0x0;var _0x32bb36=_0xde45[_0x5df1fb];return _0x32bb36;};'use strict';var Sequelize=require(_0x5de4('0x0'));module[_0x5de4('0x1')]={'name':{'type':Sequelize[_0x5de4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5de4('0x3')](_0x5de4('0x4')),'allowNull':![],'defaultValue':_0x5de4('0x4')},'description':{'type':Sequelize[_0x5de4('0x2')]},'active':{'type':Sequelize[_0x5de4('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x5de4('0x6')](0x4)[_0x5de4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5de4('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5de4('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5de4('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5de4('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5de4('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5de4('0x6')](0x5)[_0x5de4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5de4('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x5de4('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5de4('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'defaultValue':0x3,'comment':_0x5de4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5de4('0x6')](0x5)[_0x5de4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5de4('0xe')},'dialTimezone':{'type':Sequelize[_0x5de4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x5de4('0x3')](_0x5de4('0xf'),_0x5de4('0x10'),'onlyIfOpen'),'defaultValue':_0x5de4('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5de4('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5de4('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5de4('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5de4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5de4('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5de4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5de4('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5de4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5de4('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5de4('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5de4('0x6')](0x5)[_0x5de4('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5de4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5de4('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5de4('0x3')](_0x5de4('0x19'),_0x5de4('0x1a')),'defaultValue':_0x5de4('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5de4('0x1b')},'dialCutDigit':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file +var _0xbcd2=['always','never','Active/Disactive\x20AMD','#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','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*'];(function(_0x455f19,_0x4f8f3a){var _0x422f21=function(_0x4537cd){while(--_0x4537cd){_0x455f19['push'](_0x455f19['shift']());}};_0x422f21(++_0x4f8f3a);}(_0xbcd2,0xf4));var _0x2bcd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcd2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2bcd('0x0'));module['exports']={'name':{'type':Sequelize[_0x2bcd('0x1')],'unique':_0x2bcd('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2bcd('0x3')](_0x2bcd('0x4')),'allowNull':![],'defaultValue':_0x2bcd('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x2bcd('0x5')],'defaultValue':0x0,'comment':_0x2bcd('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x2bcd('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2bcd('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2bcd('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2bcd('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2bcd('0x9')](0x3)[_0x2bcd('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x2bcd('0x9')](0x3)[_0x2bcd('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bcd('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2bcd('0x9')](0x5)[_0x2bcd('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bcd('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x2bcd('0x9')](0x3)[_0x2bcd('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bcd('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2bcd('0x9')](0x5)[_0x2bcd('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bcd('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2bcd('0x9')](0x3)[_0x2bcd('0x7')],'defaultValue':0x3,'comment':_0x2bcd('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2bcd('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bcd('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2bcd('0x9')](0x3)[_0x2bcd('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x2bcd('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x2bcd('0x10')},'dialCheckDuplicateType':{'type':Sequelize[_0x2bcd('0x3')](_0x2bcd('0x11'),_0x2bcd('0x12'),'onlyIfOpen'),'defaultValue':_0x2bcd('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2bcd('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0x2bcd('0x9')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2bcd('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2bcd('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2bcd('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2bcd('0x9')](0x9)[_0x2bcd('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2bcd('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x2bcd('0x9')](0x9)[_0x2bcd('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2bcd('0x9')](0x9)[_0x2bcd('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2bcd('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2bcd('0x9')](0x9)[_0x2bcd('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2bcd('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x2bcd('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2bcd('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2bcd('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2bcd('0x3')](_0x2bcd('0x1b'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x2bcd('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2bcd('0x9')](0x3)[_0x2bcd('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2bcd('0x1c')},'dialCutDigit':{'type':Sequelize[_0x2bcd('0x9')](0x3)[_0x2bcd('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4c16617..115e8e3 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 _0x04cd=['Campaign','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','toString','ListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','destroy','IvrCampaigns','UserProfileResource','then','stack','name','send','index'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x04cd,0x1e9));var _0xd04c=function(_0x1d1536,_0x3484b8){_0x1d1536=_0x1d1536-0x0;var _0x4b5b84=_0x04cd[_0x1d1536];return _0x4b5b84;};'use strict';var pdf=require(_0xd04c('0x0'));var emlformat=require(_0xd04c('0x1'));var rimraf=require(_0xd04c('0x2'));var zipdir=require(_0xd04c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd04c('0x4'));var moment=require(_0xd04c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd04c('0x6'));var util=require(_0xd04c('0x7'));var path=require('path');var sox=require(_0xd04c('0x8'));var csv=require(_0xd04c('0x9'));var ejs=require(_0xd04c('0xa'));var fs=require('fs');var _=require(_0xd04c('0xb'));var squel=require(_0xd04c('0xc'));var crypto=require(_0xd04c('0xd'));var jsforce=require(_0xd04c('0xe'));var deskjs=require(_0xd04c('0xf'));var toCsv=require(_0xd04c('0x9'));var querystring=require(_0xd04c('0x10'));var Papa=require(_0xd04c('0x11'));var Redis=require(_0xd04c('0x12'));var authService=require(_0xd04c('0x13'));var qs=require(_0xd04c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd04c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd04c('0x16'))['db'];function respondWithStatusCode(_0x4688f0,_0x232b0e){_0x232b0e=_0x232b0e||0xcc;return function(_0x4403d1){if(_0x4403d1){return _0x4688f0[_0xd04c('0x17')](_0x232b0e);}return _0x4688f0['status'](_0x232b0e)[_0xd04c('0x18')]();};}function respondWithResult(_0x2c800b,_0x19da96){_0x19da96=_0x19da96||0xc8;return function(_0x1389e4){if(_0x1389e4){return _0x2c800b['status'](_0x19da96)[_0xd04c('0x19')](_0x1389e4);}};}function respondWithFilteredResult(_0x69bae6,_0x33ab0e){return function(_0x394b0c){if(_0x394b0c){var _0x55dd69=_0x394b0c[_0xd04c('0x1a')],_0x3d1f32=_0x33ab0e[_0xd04c('0x1b')],_0x88ab28=_0x33ab0e[_0xd04c('0x1b')]+_0x33ab0e[_0xd04c('0x1c')],_0x43b243;if(_0x88ab28>=_0x55dd69){_0x88ab28=_0x55dd69;_0x43b243=0xc8;}else{_0x43b243=0xce;}_0x69bae6[_0xd04c('0x1d')](_0x43b243);return _0x69bae6[_0xd04c('0x1e')](_0xd04c('0x1f'),_0x3d1f32+'-'+_0x88ab28+'/'+_0x55dd69)['json'](_0x394b0c);}return null;};}function patchUpdates(_0x3f5b26){return function(_0x2cbc62){try{jsonpatch[_0xd04c('0x20')](_0x2cbc62,_0x3f5b26,!![]);}catch(_0x6c44da){return BPromise['reject'](_0x6c44da);}return _0x2cbc62[_0xd04c('0x21')]();};}function saveUpdates(_0x47814c,_0x480ad2){return function(_0x2bd7c1){if(_0x2bd7c1){return _0x2bd7c1[_0xd04c('0x22')](_0x47814c)['then'](function(_0x4f7402){return _0x4f7402;});}return null;};}function removeEntity(_0x3f2b5d,_0x29e8ae){return function(_0x2a1949){if(_0x2a1949){return _0x2a1949[_0xd04c('0x23')]()['then'](function(){var _0x572ce5=_0x2a1949['get']({'plain':!![]});var _0x2a174e=_0xd04c('0x24');return db[_0xd04c('0x25')][_0xd04c('0x23')]({'where':{'type':_0x2a174e,'resourceId':_0x572ce5['id']}})[_0xd04c('0x26')](function(){return _0x2a1949;});})[_0xd04c('0x26')](function(){_0x3f2b5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x361a9c,_0x25eec8){return function(_0x13bc4e){if(!_0x13bc4e){_0x361a9c[_0xd04c('0x17')](0x194);}return _0x13bc4e;};}function handleError(_0x5a2786,_0x18332f){_0x18332f=_0x18332f||0x1f4;return function(_0x7bed75){logger['error'](_0x7bed75[_0xd04c('0x27')]);if(_0x7bed75[_0xd04c('0x28')]){delete _0x7bed75[_0xd04c('0x28')];}_0x5a2786[_0xd04c('0x1d')](_0x18332f)[_0xd04c('0x29')](_0x7bed75);};}exports[_0xd04c('0x2a')]=function(_0x13a0f9,_0x30bea2){var _0x33184a={},_0xbb660e={},_0x38a8a7={'count':0x0,'rows':[]};var _0x234d90=_['map'](db[_0xd04c('0x2b')][_0xd04c('0x2c')],function(_0x54be51){return{'name':_0x54be51[_0xd04c('0x2d')],'type':_0x54be51[_0xd04c('0x2e')]['key']};});_0xbb660e['model']=_[_0xd04c('0x2f')](_0x234d90,'name');_0xbb660e[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x13a0f9[_0xd04c('0x30')]);_0xbb660e[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0xbb660e[_0xd04c('0x34')],_0xbb660e[_0xd04c('0x30')]);_0x33184a[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0xbb660e['model'],qs[_0xd04c('0x36')](_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x36')]));_0x33184a['attributes']=_0x33184a[_0xd04c('0x35')][_0xd04c('0x37')]?_0x33184a['attributes']:_0xbb660e[_0xd04c('0x34')];if(!_0x13a0f9[_0xd04c('0x30')]['hasOwnProperty'](_0xd04c('0x38'))){_0x33184a['limit']=qs[_0xd04c('0x1c')](_0x13a0f9[_0xd04c('0x30')]['limit']);_0x33184a[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x1b')]);}_0x33184a[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x33184a[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x13a0f9['query'],_0xbb660e[_0xd04c('0x32')]));if(_0x13a0f9['query']['filter']){_0x33184a[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x33184a[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x234d90,function(_0x182d3a){if(_0x182d3a['type']!=='VIRTUAL'){var _0x1889e1={};_0x1889e1[_0x182d3a['name']]={'$like':'%'+_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x1889e1;}})});}_0x33184a=_['merge']({},_0x33184a,_0x13a0f9[_0xd04c('0x3f')]);var _0x6f1ee7={'where':_0x33184a[_0xd04c('0x3b')]};return db['Campaign'][_0xd04c('0x1a')](_0x6f1ee7)[_0xd04c('0x26')](function(_0x1691da){_0x38a8a7['count']=_0x1691da;if(_0x13a0f9['query'][_0xd04c('0x40')]){_0x33184a[_0xd04c('0x41')]=[{'all':!![]}];}return db[_0xd04c('0x2b')]['findAll'](_0x33184a);})[_0xd04c('0x26')](function(_0x20c4ee){_0x38a8a7[_0xd04c('0x42')]=_0x20c4ee;return _0x38a8a7;})['then'](respondWithFilteredResult(_0x30bea2,_0x33184a))[_0xd04c('0x43')](handleError(_0x30bea2,null));};exports[_0xd04c('0x44')]=function(_0x24d2f0,_0x31df3b){var _0x4681fd={'raw':![],'where':{'id':_0x24d2f0[_0xd04c('0x45')]['id']}},_0xbc2634={};_0xbc2634[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x2b')]['rawAttributes']);_0xbc2634[_0xd04c('0x30')]=_['keys'](_0x24d2f0[_0xd04c('0x30')]);_0xbc2634['filters']=_[_0xd04c('0x33')](_0xbc2634['model'],_0xbc2634[_0xd04c('0x30')]);_0x4681fd['attributes']=_[_0xd04c('0x33')](_0xbc2634[_0xd04c('0x34')],qs['fields'](_0x24d2f0[_0xd04c('0x30')][_0xd04c('0x36')]));_0x4681fd['attributes']=_0x4681fd[_0xd04c('0x35')]['length']?_0x4681fd['attributes']:_0xbc2634[_0xd04c('0x34')];if(_0x24d2f0[_0xd04c('0x30')]['includeAll']){_0x4681fd[_0xd04c('0x41')]=[{'all':!![]}];}_0x4681fd=_[_0xd04c('0x3d')]({},_0x4681fd,_0x24d2f0[_0xd04c('0x3f')]);return db[_0xd04c('0x2b')][_0xd04c('0x46')](_0x4681fd)[_0xd04c('0x26')](handleEntityNotFound(_0x31df3b,null))['then'](respondWithResult(_0x31df3b,null))['catch'](handleError(_0x31df3b,null));};exports['create']=function(_0x773c11,_0x202b21){return db[_0xd04c('0x2b')][_0xd04c('0x47')](_0x773c11['body'],{})[_0xd04c('0x26')](function(_0x583bf1){var _0x31b384=_0x773c11[_0xd04c('0x48')][_0xd04c('0x49')]({'plain':!![]});if(!_0x31b384)throw new Error(_0xd04c('0x4a'));if(_0x31b384[_0xd04c('0x4b')]===_0xd04c('0x48')){var _0x4e410a=_0x583bf1[_0xd04c('0x49')]({'plain':!![]});var _0x3fc058=_0xd04c('0x24');return db[_0xd04c('0x4c')][_0xd04c('0x46')]({'where':{'name':_0x3fc058,'userProfileId':_0x31b384['userProfileId']},'raw':!![]})[_0xd04c('0x26')](function(_0x59eac6){if(_0x59eac6&&_0x59eac6[_0xd04c('0x4d')]===0x0){return db[_0xd04c('0x25')][_0xd04c('0x47')]({'name':_0x4e410a['name'],'resourceId':_0x4e410a['id'],'type':_0x59eac6[_0xd04c('0x28')],'sectionId':_0x59eac6['id']},{})[_0xd04c('0x26')](function(){return _0x583bf1;});}else{return _0x583bf1;}})[_0xd04c('0x43')](function(_0x121d54){logger[_0xd04c('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x121d54);throw _0x121d54;});}return _0x583bf1;})['then'](respondWithResult(_0x202b21,0xc9))['catch'](handleError(_0x202b21,null));};exports['clone']=function(_0x46f67e,_0x3f1407){var _0x42e79c={'where':{'id':_0x46f67e['params']['id']}},_0x4996f7={};_0x4996f7[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x2b')][_0xd04c('0x2c')]);_0x42e79c[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x4996f7[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x46f67e[_0xd04c('0x30')][_0xd04c('0x36')]));_0x42e79c[_0xd04c('0x35')]=_0x42e79c[_0xd04c('0x35')]['length']?_0x42e79c[_0xd04c('0x35')]:_0x4996f7['model'];if(_0x46f67e['query']['includeAll']){_0x42e79c['include']=[{'all':!![]}];}_0x42e79c=_[_0xd04c('0x3d')]({},_0x42e79c,_0x46f67e['options']);return db[_0xd04c('0x2b')][_0xd04c('0x46')](_0x42e79c)[_0xd04c('0x26')](handleEntityNotFound(_0x3f1407,null))[_0xd04c('0x26')](function(_0x4e5453){if(_0x4e5453){var _0x13862f=_0x4e5453[_0xd04c('0x49')]({'plain':!![]});_0x13862f=qs[_0xd04c('0x4f')](_0x13862f,['id',_0xd04c('0x50'),_0xd04c('0x51')]);_0x46f67e[_0xd04c('0x52')]=_[_0xd04c('0x4f')](_0x46f67e[_0xd04c('0x52')],['id',_0xd04c('0x50'),'updatedAt']);return db[_0xd04c('0x2b')][_0xd04c('0x47')](_[_0xd04c('0x3d')](_0x13862f,_0x46f67e[_0xd04c('0x52')]),{'include':_0x46f67e['query'][_0xd04c('0x40')]?[{'all':!![]}]:undefined})[_0xd04c('0x26')](function(_0x50a781){var _0x56c35b=_0x46f67e[_0xd04c('0x48')][_0xd04c('0x49')]({'plain':!![]});if(!_0x56c35b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56c35b[_0xd04c('0x4b')]==='user'){var _0x105228=_0x50a781[_0xd04c('0x49')]({'plain':!![]});var _0x2f511b=_0xd04c('0x24');return db[_0xd04c('0x4c')][_0xd04c('0x46')]({'where':{'name':_0x2f511b,'userProfileId':_0x56c35b['userProfileId']},'raw':!![]})[_0xd04c('0x26')](function(_0x3630d2){if(_0x3630d2&&_0x3630d2[_0xd04c('0x4d')]===0x0){return db[_0xd04c('0x25')][_0xd04c('0x47')]({'name':_0x105228[_0xd04c('0x28')],'resourceId':_0x105228['id'],'type':_0x3630d2[_0xd04c('0x28')],'sectionId':_0x3630d2['id']},{})[_0xd04c('0x26')](function(){return _0x50a781;});}else{return _0x50a781;}})[_0xd04c('0x43')](function(_0x4ff5a9){logger[_0xd04c('0x4e')](_0xd04c('0x53'),_0x4ff5a9);throw _0x4ff5a9;});}return _0x50a781;});}})[_0xd04c('0x26')](respondWithResult(_0x3f1407,0xc9))[_0xd04c('0x43')](handleError(_0x3f1407,null));};exports['update']=function(_0xe276b5,_0x2d4771){if(_0xe276b5[_0xd04c('0x52')]['id']){delete _0xe276b5[_0xd04c('0x52')]['id'];}return db[_0xd04c('0x2b')][_0xd04c('0x46')]({'where':{'id':_0xe276b5[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x2d4771,null))['then'](saveUpdates(_0xe276b5[_0xd04c('0x52')],null))[_0xd04c('0x26')](respondWithResult(_0x2d4771,null))[_0xd04c('0x43')](handleError(_0x2d4771,null));};exports[_0xd04c('0x23')]=function(_0x719872,_0x1e6aca){return db['Campaign'][_0xd04c('0x46')]({'where':{'id':_0x719872[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x1e6aca,null))['then'](removeEntity(_0x1e6aca,null))[_0xd04c('0x43')](handleError(_0x1e6aca,null));};exports[_0xd04c('0x54')]=function(_0x185a6e,_0x9ffa2b,_0x4419f7){var _0x1ca676={'raw':!![],'where':{}};var _0x222e9e={};var _0x2d4a4c={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x185a6e[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x9ffa2b,null))[_0xd04c('0x26')](function(_0x2203e5){if(_0x2203e5){_0x222e9e[_0xd04c('0x34')]=_[_0xd04c('0x31')](db['CmHopper']['rawAttributes']);_0x222e9e['query']=_[_0xd04c('0x31')](_0x185a6e[_0xd04c('0x30')]);_0x222e9e[_0xd04c('0x32')]=_['intersection'](_0x222e9e['model'],_0x222e9e[_0xd04c('0x30')]);_0x1ca676[_0xd04c('0x35')]=_['intersection'](_0x222e9e[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x185a6e[_0xd04c('0x30')][_0xd04c('0x36')]));_0x1ca676[_0xd04c('0x35')]=_0x1ca676[_0xd04c('0x35')]['length']?_0x1ca676[_0xd04c('0x35')]:_0x222e9e['model'];if(!_0x185a6e[_0xd04c('0x30')][_0xd04c('0x56')]('nolimit')){_0x1ca676[_0xd04c('0x1c')]=qs[_0xd04c('0x1c')](_0x185a6e[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x1ca676[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x185a6e[_0xd04c('0x30')][_0xd04c('0x1b')]);}_0x1ca676['order']=qs['sort'](_0x185a6e['query']['sort']);_0x1ca676['where']=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x185a6e['query'],_0x222e9e[_0xd04c('0x32')]));_0x1ca676['where'][_0xd04c('0x57')]=_0x2203e5['id'];if(_0x185a6e['query'][_0xd04c('0x3e')]){_0x1ca676['where']=_['merge'](_0x1ca676['where'],{'$or':_['map'](_0x1ca676[_0xd04c('0x35')],function(_0x2ffb92){var _0x29aeca={};_0x29aeca[_0x2ffb92]={'$like':'%'+_0x185a6e[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x29aeca;})});}_0x1ca676=_[_0xd04c('0x3d')]({},_0x1ca676,_0x185a6e[_0xd04c('0x3f')]);return db[_0xd04c('0x58')][_0xd04c('0x1a')]({'where':_0x1ca676[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x23d402){_0x2d4a4c['count']=_0x23d402;if(_0x185a6e[_0xd04c('0x30')][_0xd04c('0x40')]){_0x1ca676[_0xd04c('0x41')]=[{'all':!![]}];}return db[_0xd04c('0x58')][_0xd04c('0x59')](_0x1ca676);})[_0xd04c('0x26')](function(_0x4c2b0a){_0x2d4a4c['rows']=_0x4c2b0a;return _0x2d4a4c;});}})['then'](respondWithFilteredResult(_0x9ffa2b,_0x1ca676))[_0xd04c('0x43')](handleError(_0x9ffa2b,null));};exports[_0xd04c('0x5a')]=function(_0x5cd5fd,_0x22b090,_0x593667){var _0x5aaca2={'raw':!![],'where':{}};var _0x397212={};var _0x1aa112={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x5cd5fd[_0xd04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x22b090,null))[_0xd04c('0x26')](function(_0x59b971){if(_0x59b971){_0x397212['model']=_[_0xd04c('0x31')](db[_0xd04c('0x5b')][_0xd04c('0x2c')]);_0x397212[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x5cd5fd[_0xd04c('0x30')]);_0x397212[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x397212[_0xd04c('0x34')],_0x397212['query']);_0x5aaca2[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x397212['model'],qs['fields'](_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x36')]));_0x5aaca2[_0xd04c('0x35')]=_0x5aaca2['attributes'][_0xd04c('0x37')]?_0x5aaca2[_0xd04c('0x35')]:_0x397212['model'];if(!_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x5aaca2[_0xd04c('0x1c')]=qs[_0xd04c('0x1c')](_0x5cd5fd['query'][_0xd04c('0x1c')]);_0x5aaca2[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x5cd5fd[_0xd04c('0x30')]['offset']);}_0x5aaca2[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x5aaca2[_0xd04c('0x3b')]=qs['filters'](_[_0xd04c('0x3c')](_0x5cd5fd['query'],_0x397212[_0xd04c('0x32')]));_0x5aaca2[_0xd04c('0x3b')][_0xd04c('0x57')]=_0x59b971['id'];if(_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x5aaca2[_0xd04c('0x3b')]=_['merge'](_0x5aaca2['where'],{'$or':_[_0xd04c('0x2f')](_0x5aaca2[_0xd04c('0x35')],function(_0x42bc2a){var _0x42e097={};_0x42e097[_0x42bc2a]={'$like':'%'+_0x5cd5fd[_0xd04c('0x30')]['filter']+'%'};return _0x42e097;})});}_0x5aaca2=_[_0xd04c('0x3d')]({},_0x5aaca2,_0x5cd5fd[_0xd04c('0x3f')]);return db[_0xd04c('0x5b')][_0xd04c('0x1a')]({'where':_0x5aaca2[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x6620e5){_0x1aa112[_0xd04c('0x1a')]=_0x6620e5;if(_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x40')]){_0x5aaca2[_0xd04c('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x5aaca2);})[_0xd04c('0x26')](function(_0x3090e0){_0x1aa112[_0xd04c('0x42')]=_0x3090e0;return _0x1aa112;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x22b090,_0x5aaca2))[_0xd04c('0x43')](handleError(_0x22b090,null));};exports['getHopperFinals']=function(_0xe708cb,_0x5ba46e,_0x59e5ee){var _0x4e1d86={'raw':!![],'where':{}};var _0x50d725={};var _0x1b9b88={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0xe708cb[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x5ba46e,null))[_0xd04c('0x26')](function(_0x33cf62){if(_0x33cf62){_0x50d725[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x5c')][_0xd04c('0x2c')]);_0x50d725[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0xe708cb[_0xd04c('0x30')]);_0x50d725[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x50d725[_0xd04c('0x34')],_0x50d725[_0xd04c('0x30')]);_0x4e1d86[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x50d725[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0xe708cb[_0xd04c('0x30')][_0xd04c('0x36')]));_0x4e1d86[_0xd04c('0x35')]=_0x4e1d86['attributes'][_0xd04c('0x37')]?_0x4e1d86['attributes']:_0x50d725[_0xd04c('0x34')];if(!_0xe708cb[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x4e1d86['limit']=qs[_0xd04c('0x1c')](_0xe708cb[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x4e1d86[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0xe708cb[_0xd04c('0x30')]['offset']);}_0x4e1d86[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0xe708cb['query'][_0xd04c('0x3a')]);_0x4e1d86[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_['pick'](_0xe708cb[_0xd04c('0x30')],_0x50d725[_0xd04c('0x32')]));_0x4e1d86[_0xd04c('0x3b')]['CampaignId']=_0x33cf62['id'];if(_0xe708cb['query'][_0xd04c('0x3e')]){_0x4e1d86[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x4e1d86[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x4e1d86[_0xd04c('0x35')],function(_0x5f2b51){var _0x555da4={};_0x555da4[_0x5f2b51]={'$like':'%'+_0xe708cb[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x555da4;})});}_0x4e1d86=_[_0xd04c('0x3d')]({},_0x4e1d86,_0xe708cb['options']);return db[_0xd04c('0x5c')][_0xd04c('0x1a')]({'where':_0x4e1d86[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x30634c){_0x1b9b88[_0xd04c('0x1a')]=_0x30634c;if(_0xe708cb[_0xd04c('0x30')]['includeAll']){_0x4e1d86[_0xd04c('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd04c('0x59')](_0x4e1d86);})[_0xd04c('0x26')](function(_0x32a7bb){_0x1b9b88[_0xd04c('0x42')]=_0x32a7bb;return _0x1b9b88;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x5ba46e,_0x4e1d86))[_0xd04c('0x43')](handleError(_0x5ba46e,null));};exports[_0xd04c('0x5d')]=function(_0x38b979,_0x1be380,_0x1af750){var _0x3e090f={'raw':!![],'where':{}};var _0x2bb91b={};var _0x48b825={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')]['findOne']({'where':{'id':_0x38b979[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x1be380,null))[_0xd04c('0x26')](function(_0x6bfbb0){if(_0x6bfbb0){_0x2bb91b['model']=_[_0xd04c('0x31')](db['CmHopperBlack'][_0xd04c('0x2c')]);_0x2bb91b[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x38b979['query']);_0x2bb91b[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x2bb91b[_0xd04c('0x34')],_0x2bb91b[_0xd04c('0x30')]);_0x3e090f[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x2bb91b[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x38b979[_0xd04c('0x30')][_0xd04c('0x36')]));_0x3e090f[_0xd04c('0x35')]=_0x3e090f[_0xd04c('0x35')]['length']?_0x3e090f[_0xd04c('0x35')]:_0x2bb91b[_0xd04c('0x34')];if(!_0x38b979[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x3e090f['limit']=qs[_0xd04c('0x1c')](_0x38b979[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x3e090f[_0xd04c('0x1b')]=qs['offset'](_0x38b979['query'][_0xd04c('0x1b')]);}_0x3e090f[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x38b979['query'][_0xd04c('0x3a')]);_0x3e090f[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x38b979[_0xd04c('0x30')],_0x2bb91b[_0xd04c('0x32')]));_0x3e090f['where'][_0xd04c('0x57')]=_0x6bfbb0['id'];if(_0x38b979[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x3e090f[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x3e090f[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x3e090f[_0xd04c('0x35')],function(_0x5a86c5){var _0x303a75={};_0x303a75[_0x5a86c5]={'$like':'%'+_0x38b979[_0xd04c('0x30')]['filter']+'%'};return _0x303a75;})});}_0x3e090f=_['merge']({},_0x3e090f,_0x38b979[_0xd04c('0x3f')]);return db['CmHopperBlack'][_0xd04c('0x1a')]({'where':_0x3e090f[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x53167b){_0x48b825[_0xd04c('0x1a')]=_0x53167b;if(_0x38b979['query'][_0xd04c('0x40')]){_0x3e090f['include']=[{'all':!![]}];}return db[_0xd04c('0x5e')][_0xd04c('0x59')](_0x3e090f);})[_0xd04c('0x26')](function(_0x3de4b7){_0x48b825[_0xd04c('0x42')]=_0x3de4b7;return _0x48b825;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x1be380,_0x3e090f))['catch'](handleError(_0x1be380,null));};exports[_0xd04c('0x5f')]=function(_0x3aabf9,_0x328b53,_0x315c04){var _0x32e0c9={};var _0x3876bc={};var _0x25f090;var _0x5f4635;return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x3aabf9[_0xd04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x328b53,null))[_0xd04c('0x26')](function(_0x5c4829){if(_0x5c4829){_0x25f090=_0x5c4829;_0x3876bc[_0xd04c('0x34')]=_['keys'](db[_0xd04c('0x60')][_0xd04c('0x2c')]);_0x3876bc['query']=_['keys'](_0x3aabf9[_0xd04c('0x30')]);_0x3876bc[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x3876bc[_0xd04c('0x34')],_0x3876bc[_0xd04c('0x30')]);_0x32e0c9['attributes']=_[_0xd04c('0x33')](_0x3876bc[_0xd04c('0x34')],qs['fields'](_0x3aabf9['query']['fields']));_0x32e0c9[_0xd04c('0x35')]=_0x32e0c9['attributes'][_0xd04c('0x37')]?_0x32e0c9[_0xd04c('0x35')]:_0x3876bc[_0xd04c('0x34')];_0x32e0c9[_0xd04c('0x39')]=qs['sort'](_0x3aabf9[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x32e0c9['where']=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x3aabf9[_0xd04c('0x30')],_0x3876bc[_0xd04c('0x32')]));if(_0x3aabf9[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x32e0c9[_0xd04c('0x3b')]=_['merge'](_0x32e0c9[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x32e0c9['attributes'],function(_0x2a14e9){var _0x578733={};_0x578733[_0x2a14e9]={'$like':'%'+_0x3aabf9[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x578733;})});}_0x32e0c9=_[_0xd04c('0x3d')]({},_0x32e0c9,_0x3aabf9[_0xd04c('0x3f')]);return _0x25f090['getLists'](_0x32e0c9);}})[_0xd04c('0x26')](function(_0x1f1f72){if(_0x1f1f72){_0x5f4635=_0x1f1f72[_0xd04c('0x37')];if(!_0x3aabf9['query'][_0xd04c('0x56')](_0xd04c('0x38'))){_0x32e0c9[_0xd04c('0x1c')]=qs[_0xd04c('0x1c')](_0x3aabf9['query']['limit']);_0x32e0c9[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x3aabf9[_0xd04c('0x30')]['offset']);}return _0x25f090[_0xd04c('0x5f')](_0x32e0c9);}})['then'](function(_0x3a6918){if(_0x3a6918){return _0x3a6918?{'count':_0x5f4635,'rows':_0x3a6918}:null;}})[_0xd04c('0x26')](respondWithResult(_0x328b53,null))[_0xd04c('0x43')](handleError(_0x328b53,null));};exports['addLists']=function(_0x272155,_0x3e832a,_0x241906){var _0x210c22,_0x24907b;return db[_0xd04c('0x2b')]['find']({'where':{'id':_0x272155[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x3e832a,null))['then'](function(_0x3c9f05){if(_0x3c9f05){_0x24907b=_0x3c9f05;return _0x3c9f05[_0xd04c('0x61')](_0x272155['body'][_0xd04c('0x62')],_['omit'](_0x272155['body'],[_0xd04c('0x62'),'id'])||{});}return null;})['spread'](function(_0x45fee7){var _0x499d1c;_0x210c22=_0x45fee7||[];var _0x101c99=[];if(_0x45fee7){for(var _0x4d516b=0x0;_0x4d516b<_0x45fee7[_0xd04c('0x37')];_0x4d516b+=0x1){var _0x398f96=_0x45fee7[_0x4d516b][_0xd04c('0x49')]({'plain':!![]});_0x24907b[_0xd04c('0x63')]=_0x272155[_0xd04c('0x52')][_0xd04c('0x63')]?_0x272155[_0xd04c('0x52')][_0xd04c('0x63')]:_0x24907b['dialCheckDuplicateType'];switch(_0x24907b[_0xd04c('0x63')]){case _0xd04c('0x64'):_0x499d1c=squel[_0xd04c('0x65')]()[_0xd04c('0x66')](_0xd04c('0x67'))[_0xd04c('0x68')]([_0xd04c('0x69'),_0xd04c('0x6a'),_0xd04c('0x6b'),'ListId',_0xd04c('0x57'),'createdAt',_0xd04c('0x51')],squel[_0xd04c('0x6c')]()[_0xd04c('0x6d')](_0xd04c('0x69'),'phone')[_0xd04c('0x6d')]('NOW()',_0xd04c('0x6a'))[_0xd04c('0x6d')]('id',_0xd04c('0x6b'))[_0xd04c('0x6d')](_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')](),_0xd04c('0x57'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x50'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x51'))[_0xd04c('0x72')](_0xd04c('0x73'))[_0xd04c('0x3b')](_0xd04c('0x74'))[_0xd04c('0x3b')](_0xd04c('0x75'),_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xd04c('0x76'),squel[_0xd04c('0x6c')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xd04c('0x72')](_0xd04c('0x77'))[_0xd04c('0x3b')]('CampaignId\x20=\x20?',_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')]()))[_0xd04c('0x3b')](_0xd04c('0x76'),squel[_0xd04c('0x6c')]()[_0xd04c('0x6d')]('COALESCE(phone,\x27\x27)')[_0xd04c('0x72')](_0xd04c('0x67'))[_0xd04c('0x3b')]('CampaignId\x20=\x20?',_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')]())))['toString']();break;case _0xd04c('0x78'):_0x499d1c=squel[_0xd04c('0x65')]()['into'](_0xd04c('0x67'))[_0xd04c('0x68')]([_0xd04c('0x69'),'scheduledAt',_0xd04c('0x6b'),_0xd04c('0x70'),_0xd04c('0x57'),'createdAt','updatedAt'],squel[_0xd04c('0x6c')]()['field'](_0xd04c('0x69'),'phone')['field'](_0xd04c('0x71'),'scheduledAt')['field']('id',_0xd04c('0x6b'))[_0xd04c('0x6d')](_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0x272155['params']['id']['toString'](),_0xd04c('0x57'))['field'](_0xd04c('0x71'),'createdAt')[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x51'))[_0xd04c('0x72')](_0xd04c('0x73'))['where'](_0xd04c('0x74'))[_0xd04c('0x3b')]('ListId\x20=\x20?',_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')]())[_0xd04c('0x3b')](_0xd04c('0x79'))[_0xd04c('0x3b')](_0xd04c('0x76'),squel[_0xd04c('0x6c')]()['field'](_0xd04c('0x7a'))[_0xd04c('0x72')](_0xd04c('0x67'))[_0xd04c('0x3b')](_0xd04c('0x7b'),_0x272155[_0xd04c('0x45')]['id']['toString']())))[_0xd04c('0x6f')]();break;default:_0x499d1c=squel[_0xd04c('0x65')]()['into'](_0xd04c('0x67'))[_0xd04c('0x68')]([_0xd04c('0x69'),'scheduledAt',_0xd04c('0x6b'),_0xd04c('0x70'),'CampaignId',_0xd04c('0x50'),_0xd04c('0x51')],squel['select']()[_0xd04c('0x6d')]('phone',_0xd04c('0x69'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x6a'))[_0xd04c('0x6d')]('id','ContactId')['field'](_0x398f96['CmListId'][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')](),_0xd04c('0x57'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x50'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x51'))[_0xd04c('0x72')](_0xd04c('0x73'))[_0xd04c('0x3b')]('deletedAt\x20IS\x20NULL')[_0xd04c('0x3b')](_0xd04c('0x75'),_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')]())[_0xd04c('0x3b')](_0xd04c('0x79')))[_0xd04c('0x6f')]();}_0x101c99[_0xd04c('0x7c')](db[_0xd04c('0x7d')][_0xd04c('0x30')](_0x499d1c));}return BPromise[_0xd04c('0x7e')](_0x101c99);}})[_0xd04c('0x26')](function(){return _0x210c22;})[_0xd04c('0x26')](respondWithResult(_0x3e832a,null))['catch'](handleError(_0x3e832a,null));};exports[_0xd04c('0x7f')]=function(_0x3584a5,_0x11b55f,_0x3abf23){return db[_0xd04c('0x2b')][_0xd04c('0x46')]({'where':{'id':_0x3584a5[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x11b55f,null))[_0xd04c('0x26')](function(_0x765608){if(_0x765608){return _0x765608[_0xd04c('0x7f')](_0x3584a5[_0xd04c('0x30')][_0xd04c('0x62')]);}})[_0xd04c('0x26')](function(_0x57485d){if(_0x57485d){return db[_0xd04c('0x58')][_0xd04c('0x23')]({'where':{'ListId':_0x3584a5['query'][_0xd04c('0x62')],'CampaignId':_0x3584a5['params']['id']}})[_0xd04c('0x26')](function(){return _0x57485d;});}})[_0xd04c('0x26')](respondWithStatusCode(_0x11b55f,null))['catch'](handleError(_0x11b55f,null));};exports[_0xd04c('0x80')]=function(_0x4fbcc3,_0x18f6db,_0x563fb1){var _0x62bf02={'raw':!![],'where':{}};var _0x16257e={};var _0x59c76a={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x4fbcc3['params']['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x18f6db,null))[_0xd04c('0x26')](function(_0x3ed072){if(_0x3ed072){_0x16257e[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x60')][_0xd04c('0x2c')]);_0x16257e[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x4fbcc3[_0xd04c('0x30')]);_0x16257e[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x16257e['model'],_0x16257e[_0xd04c('0x30')]);_0x62bf02[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x16257e[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x36')]));_0x62bf02['attributes']=_0x62bf02[_0xd04c('0x35')]['length']?_0x62bf02[_0xd04c('0x35')]:_0x16257e[_0xd04c('0x34')];if(!_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x62bf02[_0xd04c('0x1c')]=qs['limit'](_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x62bf02[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x4fbcc3[_0xd04c('0x30')]['offset']);}_0x62bf02[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x62bf02[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x4fbcc3['query'],_0x16257e['filters']));_0x62bf02['where'][_0xd04c('0x57')]=_0x3ed072['id'];if(_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x62bf02[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x62bf02[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x62bf02[_0xd04c('0x35')],function(_0x300017){var _0x2688bd={};_0x2688bd[_0x300017]={'$like':'%'+_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x2688bd;})});}_0x62bf02=_[_0xd04c('0x3d')]({},_0x62bf02,_0x4fbcc3[_0xd04c('0x3f')]);return db[_0xd04c('0x60')]['count']({'where':_0x62bf02[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x3a2961){_0x59c76a[_0xd04c('0x1a')]=_0x3a2961;if(_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x40')]){_0x62bf02[_0xd04c('0x41')]=[{'all':!![]}];}return db[_0xd04c('0x60')][_0xd04c('0x59')](_0x62bf02);})[_0xd04c('0x26')](function(_0x3c4827){_0x59c76a[_0xd04c('0x42')]=_0x3c4827;return _0x59c76a;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x18f6db,_0x62bf02))[_0xd04c('0x43')](handleError(_0x18f6db,null));};exports[_0xd04c('0x81')]=function(_0xadfdb4,_0x4e653b,_0x3a3192){var _0x5a22d9,_0x30a38b;return db[_0xd04c('0x2b')]['find']({'where':{'id':_0xadfdb4[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x4e653b,null))[_0xd04c('0x26')](function(_0x24cd42){if(_0x24cd42){_0x30a38b=_0x24cd42;return _0x24cd42[_0xd04c('0x81')](_0xadfdb4[_0xd04c('0x52')][_0xd04c('0x62')],_['omit'](_0xadfdb4[_0xd04c('0x52')],['ids','id'])||{});}return null;})[_0xd04c('0x82')](function(_0x6a07a8){var _0x5aaee3;_0x5a22d9=_0x6a07a8||[];var _0x4476fa=[];if(_0x6a07a8){for(var _0x297492=0x0;_0x297492<_0x6a07a8[_0xd04c('0x37')];_0x297492+=0x1){var _0x157920=_0x6a07a8[_0x297492][_0xd04c('0x49')]({'plain':!![]});_0x5aaee3=squel[_0xd04c('0x65')]()[_0xd04c('0x66')](_0xd04c('0x83'))[_0xd04c('0x68')]([_0xd04c('0x69'),'ContactId',_0xd04c('0x70'),_0xd04c('0x57'),'createdAt','updatedAt'],squel[_0xd04c('0x6c')]()[_0xd04c('0x6d')](_0xd04c('0x69'),_0xd04c('0x69'))[_0xd04c('0x6d')]('id',_0xd04c('0x6b'))[_0xd04c('0x6d')](_0x157920['CmListId'][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0xadfdb4['params']['id'][_0xd04c('0x6f')](),_0xd04c('0x57'))[_0xd04c('0x6d')]('NOW()',_0xd04c('0x50'))[_0xd04c('0x6d')](_0xd04c('0x71'),'updatedAt')[_0xd04c('0x72')]('cm_contacts')[_0xd04c('0x3b')](_0xd04c('0x74'))[_0xd04c('0x3b')](_0xd04c('0x75'),_0x157920[_0xd04c('0x6e')][_0xd04c('0x6f')]())[_0xd04c('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0xd04c('0x6f')]();_0x4476fa[_0xd04c('0x7c')](db[_0xd04c('0x7d')]['query'](_0x5aaee3));}return BPromise['all'](_0x4476fa);}})[_0xd04c('0x26')](function(){return _0x5a22d9;})[_0xd04c('0x26')](respondWithResult(_0x4e653b,null))[_0xd04c('0x43')](handleError(_0x4e653b,null));};exports[_0xd04c('0x84')]=function(_0xd421ed,_0x234074,_0x41b8cb){return db[_0xd04c('0x2b')][_0xd04c('0x46')]({'where':{'id':_0xd421ed[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x234074,null))[_0xd04c('0x26')](function(_0x4330f9){if(_0x4330f9){return _0x4330f9[_0xd04c('0x84')](_0xd421ed[_0xd04c('0x30')][_0xd04c('0x62')]);}})[_0xd04c('0x26')](function(_0x21eb4b){if(_0x21eb4b){return db['CmHopperBlack'][_0xd04c('0x23')]({'where':{'ListId':_0xd421ed[_0xd04c('0x30')][_0xd04c('0x62')],'CampaignId':_0xd421ed[_0xd04c('0x45')]['id']}})['then'](function(){return _0x21eb4b;});}})['then'](respondWithStatusCode(_0x234074,null))[_0xd04c('0x43')](handleError(_0x234074,null));}; \ No newline at end of file +var _0xe098=['keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','options','include','rows','catch','show','intersection','includeAll','merge','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','user','find','update','destroy','findOne','CmHopper','hasOwnProperty','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','IvrCampaigns','UserProfileResource','error','stack','name','index','Campaign','rawAttributes','fieldName','type','model','map','query'];(function(_0x36888d,_0x22988e){var _0x14f524=function(_0x5cdbfe){while(--_0x5cdbfe){_0x36888d['push'](_0x36888d['shift']());}};_0x14f524(++_0x22988e);}(_0xe098,0xdc));var _0x8e09=function(_0x4133db,_0x5ee998){_0x4133db=_0x4133db-0x0;var _0x3bf831=_0xe098[_0x4133db];return _0x3bf831;};'use strict';var pdf=require(_0x8e09('0x0'));var emlformat=require(_0x8e09('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8e09('0x2'));var jsonpatch=require(_0x8e09('0x3'));var rp=require('request-promise');var moment=require(_0x8e09('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8e09('0x5'));var util=require(_0x8e09('0x6'));var path=require(_0x8e09('0x7'));var sox=require(_0x8e09('0x8'));var csv=require('to-csv');var ejs=require(_0x8e09('0x9'));var fs=require('fs');var _=require(_0x8e09('0xa'));var squel=require('squel');var crypto=require(_0x8e09('0xb'));var jsforce=require(_0x8e09('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8e09('0xd'));var querystring=require(_0x8e09('0xe'));var Papa=require(_0x8e09('0xf'));var Redis=require(_0x8e09('0x10'));var authService=require(_0x8e09('0x11'));var qs=require(_0x8e09('0x12'));var as=require(_0x8e09('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e09('0x14'))('api');var utils=require(_0x8e09('0x15'));var config=require(_0x8e09('0x16'));var db=require(_0x8e09('0x17'))['db'];function respondWithStatusCode(_0x4d0da5,_0x3358a7){_0x3358a7=_0x3358a7||0xcc;return function(_0x4a8a20){if(_0x4a8a20){return _0x4d0da5[_0x8e09('0x18')](_0x3358a7);}return _0x4d0da5[_0x8e09('0x19')](_0x3358a7)[_0x8e09('0x1a')]();};}function respondWithResult(_0x1e053b,_0x5ab42c){_0x5ab42c=_0x5ab42c||0xc8;return function(_0x59a737){if(_0x59a737){return _0x1e053b['status'](_0x5ab42c)[_0x8e09('0x1b')](_0x59a737);}};}function respondWithFilteredResult(_0x472647,_0x56ef00){return function(_0x2d3c3c){if(_0x2d3c3c){var _0x12f4d0=_0x2d3c3c[_0x8e09('0x1c')],_0x4152ab=_0x56ef00[_0x8e09('0x1d')],_0x59cb22=_0x56ef00[_0x8e09('0x1d')]+_0x56ef00[_0x8e09('0x1e')],_0x3d9836;if(_0x59cb22>=_0x12f4d0){_0x59cb22=_0x12f4d0;_0x3d9836=0xc8;}else{_0x3d9836=0xce;}_0x472647['status'](_0x3d9836);return _0x472647['set']('Content-Range',_0x4152ab+'-'+_0x59cb22+'/'+_0x12f4d0)[_0x8e09('0x1b')](_0x2d3c3c);}return null;};}function patchUpdates(_0x27893){return function(_0x42f00b){try{jsonpatch[_0x8e09('0x1f')](_0x42f00b,_0x27893,!![]);}catch(_0x47fc17){return BPromise[_0x8e09('0x20')](_0x47fc17);}return _0x42f00b[_0x8e09('0x21')]();};}function saveUpdates(_0x4cdfe4,_0x1387e6){return function(_0x241c81){if(_0x241c81){return _0x241c81['update'](_0x4cdfe4)[_0x8e09('0x22')](function(_0x1c4b30){return _0x1c4b30;});}return null;};}function removeEntity(_0x39ada0,_0x12958a){return function(_0x490801){if(_0x490801){return _0x490801['destroy']()[_0x8e09('0x22')](function(){var _0x797ea=_0x490801['get']({'plain':!![]});var _0xd5f646=_0x8e09('0x23');return db[_0x8e09('0x24')]['destroy']({'where':{'type':_0xd5f646,'resourceId':_0x797ea['id']}})[_0x8e09('0x22')](function(){return _0x490801;});})[_0x8e09('0x22')](function(){_0x39ada0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x569267,_0x1cd7eb){return function(_0x24cfcb){if(!_0x24cfcb){_0x569267['sendStatus'](0x194);}return _0x24cfcb;};}function handleError(_0x12dc21,_0x56f19a){_0x56f19a=_0x56f19a||0x1f4;return function(_0x2c4e52){logger[_0x8e09('0x25')](_0x2c4e52[_0x8e09('0x26')]);if(_0x2c4e52[_0x8e09('0x27')]){delete _0x2c4e52['name'];}_0x12dc21[_0x8e09('0x19')](_0x56f19a)['send'](_0x2c4e52);};}exports[_0x8e09('0x28')]=function(_0xee51b7,_0xa31fb8){var _0x5e99fd={},_0x213727={},_0x3d4107={'count':0x0,'rows':[]};var _0x3e3518=_['map'](db[_0x8e09('0x29')][_0x8e09('0x2a')],function(_0x15abc3){return{'name':_0x15abc3[_0x8e09('0x2b')],'type':_0x15abc3[_0x8e09('0x2c')]['key']};});_0x213727[_0x8e09('0x2d')]=_[_0x8e09('0x2e')](_0x3e3518,_0x8e09('0x27'));_0x213727[_0x8e09('0x2f')]=_[_0x8e09('0x30')](_0xee51b7['query']);_0x213727[_0x8e09('0x31')]=_['intersection'](_0x213727[_0x8e09('0x2d')],_0x213727[_0x8e09('0x2f')]);_0x5e99fd[_0x8e09('0x32')]=_['intersection'](_0x213727['model'],qs['fields'](_0xee51b7[_0x8e09('0x2f')][_0x8e09('0x33')]));_0x5e99fd[_0x8e09('0x32')]=_0x5e99fd[_0x8e09('0x32')][_0x8e09('0x34')]?_0x5e99fd[_0x8e09('0x32')]:_0x213727[_0x8e09('0x2d')];if(!_0xee51b7[_0x8e09('0x2f')]['hasOwnProperty'](_0x8e09('0x35'))){_0x5e99fd[_0x8e09('0x1e')]=qs[_0x8e09('0x1e')](_0xee51b7[_0x8e09('0x2f')][_0x8e09('0x1e')]);_0x5e99fd[_0x8e09('0x1d')]=qs[_0x8e09('0x1d')](_0xee51b7[_0x8e09('0x2f')][_0x8e09('0x1d')]);}_0x5e99fd[_0x8e09('0x36')]=qs[_0x8e09('0x37')](_0xee51b7[_0x8e09('0x2f')][_0x8e09('0x37')]);_0x5e99fd[_0x8e09('0x38')]=qs[_0x8e09('0x31')](_[_0x8e09('0x39')](_0xee51b7[_0x8e09('0x2f')],_0x213727['filters']));if(_0xee51b7[_0x8e09('0x2f')][_0x8e09('0x3a')]){_0x5e99fd[_0x8e09('0x38')]=_['merge'](_0x5e99fd['where'],{'$or':_[_0x8e09('0x2e')](_0x3e3518,function(_0x45c6fe){if(_0x45c6fe[_0x8e09('0x2c')]!=='VIRTUAL'){var _0x2f88b8={};_0x2f88b8[_0x45c6fe[_0x8e09('0x27')]]={'$like':'%'+_0xee51b7['query']['filter']+'%'};return _0x2f88b8;}})});}_0x5e99fd=_['merge']({},_0x5e99fd,_0xee51b7[_0x8e09('0x3b')]);var _0x44253e={'where':_0x5e99fd[_0x8e09('0x38')]};return db[_0x8e09('0x29')][_0x8e09('0x1c')](_0x44253e)[_0x8e09('0x22')](function(_0x5e32fd){_0x3d4107['count']=_0x5e32fd;if(_0xee51b7[_0x8e09('0x2f')]['includeAll']){_0x5e99fd[_0x8e09('0x3c')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x5e99fd);})['then'](function(_0x9b875b){_0x3d4107[_0x8e09('0x3d')]=_0x9b875b;return _0x3d4107;})[_0x8e09('0x22')](respondWithFilteredResult(_0xa31fb8,_0x5e99fd))[_0x8e09('0x3e')](handleError(_0xa31fb8,null));};exports[_0x8e09('0x3f')]=function(_0x120062,_0x41a821){var _0x37676c={'raw':![],'where':{'id':_0x120062['params']['id']}},_0x286d68={};_0x286d68[_0x8e09('0x2d')]=_['keys'](db['Campaign'][_0x8e09('0x2a')]);_0x286d68[_0x8e09('0x2f')]=_['keys'](_0x120062['query']);_0x286d68[_0x8e09('0x31')]=_[_0x8e09('0x40')](_0x286d68['model'],_0x286d68[_0x8e09('0x2f')]);_0x37676c[_0x8e09('0x32')]=_[_0x8e09('0x40')](_0x286d68['model'],qs[_0x8e09('0x33')](_0x120062['query']['fields']));_0x37676c[_0x8e09('0x32')]=_0x37676c[_0x8e09('0x32')][_0x8e09('0x34')]?_0x37676c['attributes']:_0x286d68[_0x8e09('0x2d')];if(_0x120062[_0x8e09('0x2f')][_0x8e09('0x41')]){_0x37676c[_0x8e09('0x3c')]=[{'all':!![]}];}_0x37676c=_[_0x8e09('0x42')]({},_0x37676c,_0x120062['options']);return db[_0x8e09('0x29')]['find'](_0x37676c)[_0x8e09('0x22')](handleEntityNotFound(_0x41a821,null))[_0x8e09('0x22')](respondWithResult(_0x41a821,null))[_0x8e09('0x3e')](handleError(_0x41a821,null));};exports['create']=function(_0x18589c,_0x17299c){return db[_0x8e09('0x29')][_0x8e09('0x43')](_0x18589c[_0x8e09('0x44')],{})[_0x8e09('0x22')](function(_0x1a7ee0){var _0x112f52=_0x18589c['user'][_0x8e09('0x45')]({'plain':!![]});if(!_0x112f52)throw new Error(_0x8e09('0x46'));if(_0x112f52[_0x8e09('0x47')]==='user'){var _0x207fa5=_0x1a7ee0[_0x8e09('0x45')]({'plain':!![]});var _0x1ef16f=_0x8e09('0x23');return db[_0x8e09('0x48')]['find']({'where':{'name':_0x1ef16f,'userProfileId':_0x112f52[_0x8e09('0x49')]},'raw':!![]})['then'](function(_0x5f1d1c){if(_0x5f1d1c&&_0x5f1d1c[_0x8e09('0x4a')]===0x0){return db['UserProfileResource'][_0x8e09('0x43')]({'name':_0x207fa5[_0x8e09('0x27')],'resourceId':_0x207fa5['id'],'type':_0x5f1d1c[_0x8e09('0x27')],'sectionId':_0x5f1d1c['id']},{})['then'](function(){return _0x1a7ee0;});}else{return _0x1a7ee0;}})[_0x8e09('0x3e')](function(_0x1a2e99){logger[_0x8e09('0x25')](_0x8e09('0x4b'),_0x1a2e99);throw _0x1a2e99;});}return _0x1a7ee0;})[_0x8e09('0x22')](respondWithResult(_0x17299c,0xc9))[_0x8e09('0x3e')](handleError(_0x17299c,null));};exports[_0x8e09('0x4c')]=function(_0xe93446,_0x215c94){var _0x50997f={'where':{'id':_0xe93446[_0x8e09('0x4d')]['id']}},_0x2019a1={};_0x2019a1[_0x8e09('0x2d')]=_['keys'](db[_0x8e09('0x29')][_0x8e09('0x2a')]);_0x50997f[_0x8e09('0x32')]=_['intersection'](_0x2019a1[_0x8e09('0x2d')],qs['fields'](_0xe93446[_0x8e09('0x2f')][_0x8e09('0x33')]));_0x50997f[_0x8e09('0x32')]=_0x50997f[_0x8e09('0x32')][_0x8e09('0x34')]?_0x50997f['attributes']:_0x2019a1[_0x8e09('0x2d')];if(_0xe93446[_0x8e09('0x2f')]['includeAll']){_0x50997f[_0x8e09('0x3c')]=[{'all':!![]}];}_0x50997f=_[_0x8e09('0x42')]({},_0x50997f,_0xe93446['options']);return db[_0x8e09('0x29')]['find'](_0x50997f)[_0x8e09('0x22')](handleEntityNotFound(_0x215c94,null))[_0x8e09('0x22')](function(_0x4c2db7){if(_0x4c2db7){var _0x3344e8=_0x4c2db7['get']({'plain':!![]});_0x3344e8=qs[_0x8e09('0x4e')](_0x3344e8,['id','createdAt',_0x8e09('0x4f')]);_0xe93446['body']=_[_0x8e09('0x4e')](_0xe93446[_0x8e09('0x44')],['id',_0x8e09('0x50'),_0x8e09('0x4f')]);return db[_0x8e09('0x29')][_0x8e09('0x43')](_[_0x8e09('0x42')](_0x3344e8,_0xe93446['body']),{'include':_0xe93446[_0x8e09('0x2f')]['includeAll']?[{'all':!![]}]:undefined})[_0x8e09('0x22')](function(_0x567dc4){var _0x2bfe47=_0xe93446[_0x8e09('0x51')][_0x8e09('0x45')]({'plain':!![]});if(!_0x2bfe47)throw new Error(_0x8e09('0x46'));if(_0x2bfe47[_0x8e09('0x47')]==='user'){var _0x5a85b4=_0x567dc4['get']({'plain':!![]});var _0x52ce34=_0x8e09('0x23');return db[_0x8e09('0x48')][_0x8e09('0x52')]({'where':{'name':_0x52ce34,'userProfileId':_0x2bfe47[_0x8e09('0x49')]},'raw':!![]})[_0x8e09('0x22')](function(_0x2de15d){if(_0x2de15d&&_0x2de15d['autoAssociation']===0x0){return db[_0x8e09('0x24')][_0x8e09('0x43')]({'name':_0x5a85b4[_0x8e09('0x27')],'resourceId':_0x5a85b4['id'],'type':_0x2de15d[_0x8e09('0x27')],'sectionId':_0x2de15d['id']},{})['then'](function(){return _0x567dc4;});}else{return _0x567dc4;}})[_0x8e09('0x3e')](function(_0x35b9f3){logger['error'](_0x8e09('0x4b'),_0x35b9f3);throw _0x35b9f3;});}return _0x567dc4;});}})[_0x8e09('0x22')](respondWithResult(_0x215c94,0xc9))[_0x8e09('0x3e')](handleError(_0x215c94,null));};exports[_0x8e09('0x53')]=function(_0x2b0fbb,_0x4b1301){if(_0x2b0fbb[_0x8e09('0x44')]['id']){delete _0x2b0fbb[_0x8e09('0x44')]['id'];}return db[_0x8e09('0x29')]['find']({'where':{'id':_0x2b0fbb[_0x8e09('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4b1301,null))[_0x8e09('0x22')](saveUpdates(_0x2b0fbb['body'],null))[_0x8e09('0x22')](respondWithResult(_0x4b1301,null))[_0x8e09('0x3e')](handleError(_0x4b1301,null));};exports[_0x8e09('0x54')]=function(_0x24c2af,_0x3a8753){return db[_0x8e09('0x29')]['find']({'where':{'id':_0x24c2af[_0x8e09('0x4d')]['id']}})[_0x8e09('0x22')](handleEntityNotFound(_0x3a8753,null))[_0x8e09('0x22')](removeEntity(_0x3a8753,null))['catch'](handleError(_0x3a8753,null));};exports['getHoppers']=function(_0x5a69dd,_0x5bc38c,_0x5cf0be){var _0x24930f={'raw':!![],'where':{}};var _0x20fca2={};var _0x9c2f5d={'count':0x0,'rows':[]};return db['Campaign'][_0x8e09('0x55')]({'where':{'id':_0x5a69dd[_0x8e09('0x4d')]['id']}})[_0x8e09('0x22')](handleEntityNotFound(_0x5bc38c,null))['then'](function(_0x5c7031){if(_0x5c7031){_0x20fca2[_0x8e09('0x2d')]=_[_0x8e09('0x30')](db[_0x8e09('0x56')][_0x8e09('0x2a')]);_0x20fca2[_0x8e09('0x2f')]=_[_0x8e09('0x30')](_0x5a69dd[_0x8e09('0x2f')]);_0x20fca2[_0x8e09('0x31')]=_['intersection'](_0x20fca2[_0x8e09('0x2d')],_0x20fca2['query']);_0x24930f['attributes']=_[_0x8e09('0x40')](_0x20fca2[_0x8e09('0x2d')],qs[_0x8e09('0x33')](_0x5a69dd[_0x8e09('0x2f')][_0x8e09('0x33')]));_0x24930f[_0x8e09('0x32')]=_0x24930f['attributes']['length']?_0x24930f[_0x8e09('0x32')]:_0x20fca2['model'];if(!_0x5a69dd[_0x8e09('0x2f')][_0x8e09('0x57')](_0x8e09('0x35'))){_0x24930f[_0x8e09('0x1e')]=qs[_0x8e09('0x1e')](_0x5a69dd['query'][_0x8e09('0x1e')]);_0x24930f[_0x8e09('0x1d')]=qs[_0x8e09('0x1d')](_0x5a69dd[_0x8e09('0x2f')][_0x8e09('0x1d')]);}_0x24930f[_0x8e09('0x36')]=qs[_0x8e09('0x37')](_0x5a69dd[_0x8e09('0x2f')]['sort']);_0x24930f[_0x8e09('0x38')]=qs[_0x8e09('0x31')](_[_0x8e09('0x39')](_0x5a69dd['query'],_0x20fca2[_0x8e09('0x31')]));_0x24930f[_0x8e09('0x38')][_0x8e09('0x58')]=_0x5c7031['id'];if(_0x5a69dd[_0x8e09('0x2f')]['filter']){_0x24930f[_0x8e09('0x38')]=_[_0x8e09('0x42')](_0x24930f[_0x8e09('0x38')],{'$or':_[_0x8e09('0x2e')](_0x24930f[_0x8e09('0x32')],function(_0x133eeb){var _0x56e358={};_0x56e358[_0x133eeb]={'$like':'%'+_0x5a69dd[_0x8e09('0x2f')]['filter']+'%'};return _0x56e358;})});}_0x24930f=_[_0x8e09('0x42')]({},_0x24930f,_0x5a69dd['options']);return db[_0x8e09('0x56')][_0x8e09('0x1c')]({'where':_0x24930f[_0x8e09('0x38')]})['then'](function(_0xc7e1a4){_0x9c2f5d['count']=_0xc7e1a4;if(_0x5a69dd[_0x8e09('0x2f')][_0x8e09('0x41')]){_0x24930f[_0x8e09('0x3c')]=[{'all':!![]}];}return db['CmHopper'][_0x8e09('0x59')](_0x24930f);})[_0x8e09('0x22')](function(_0x3763df){_0x9c2f5d[_0x8e09('0x3d')]=_0x3763df;return _0x9c2f5d;});}})['then'](respondWithFilteredResult(_0x5bc38c,_0x24930f))[_0x8e09('0x3e')](handleError(_0x5bc38c,null));};exports[_0x8e09('0x5a')]=function(_0x4819dd,_0x2b4e12,_0x268055){var _0x1a79c1={'raw':!![],'where':{}};var _0x11fc89={};var _0xf7e3f3={'count':0x0,'rows':[]};return db['Campaign'][_0x8e09('0x55')]({'where':{'id':_0x4819dd[_0x8e09('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2b4e12,null))[_0x8e09('0x22')](function(_0x538340){if(_0x538340){_0x11fc89[_0x8e09('0x2d')]=_[_0x8e09('0x30')](db[_0x8e09('0x5b')]['rawAttributes']);_0x11fc89[_0x8e09('0x2f')]=_['keys'](_0x4819dd[_0x8e09('0x2f')]);_0x11fc89['filters']=_[_0x8e09('0x40')](_0x11fc89[_0x8e09('0x2d')],_0x11fc89[_0x8e09('0x2f')]);_0x1a79c1['attributes']=_[_0x8e09('0x40')](_0x11fc89[_0x8e09('0x2d')],qs[_0x8e09('0x33')](_0x4819dd['query'][_0x8e09('0x33')]));_0x1a79c1[_0x8e09('0x32')]=_0x1a79c1[_0x8e09('0x32')][_0x8e09('0x34')]?_0x1a79c1[_0x8e09('0x32')]:_0x11fc89[_0x8e09('0x2d')];if(!_0x4819dd[_0x8e09('0x2f')][_0x8e09('0x57')](_0x8e09('0x35'))){_0x1a79c1[_0x8e09('0x1e')]=qs['limit'](_0x4819dd[_0x8e09('0x2f')]['limit']);_0x1a79c1[_0x8e09('0x1d')]=qs[_0x8e09('0x1d')](_0x4819dd[_0x8e09('0x2f')][_0x8e09('0x1d')]);}_0x1a79c1[_0x8e09('0x36')]=qs[_0x8e09('0x37')](_0x4819dd['query']['sort']);_0x1a79c1[_0x8e09('0x38')]=qs[_0x8e09('0x31')](_[_0x8e09('0x39')](_0x4819dd[_0x8e09('0x2f')],_0x11fc89[_0x8e09('0x31')]));_0x1a79c1['where'][_0x8e09('0x58')]=_0x538340['id'];if(_0x4819dd[_0x8e09('0x2f')][_0x8e09('0x3a')]){_0x1a79c1['where']=_['merge'](_0x1a79c1['where'],{'$or':_[_0x8e09('0x2e')](_0x1a79c1[_0x8e09('0x32')],function(_0x11a6e2){var _0x3f4101={};_0x3f4101[_0x11a6e2]={'$like':'%'+_0x4819dd[_0x8e09('0x2f')][_0x8e09('0x3a')]+'%'};return _0x3f4101;})});}_0x1a79c1=_[_0x8e09('0x42')]({},_0x1a79c1,_0x4819dd['options']);return db['CmHopperHistory'][_0x8e09('0x1c')]({'where':_0x1a79c1[_0x8e09('0x38')]})[_0x8e09('0x22')](function(_0x5dec67){_0xf7e3f3['count']=_0x5dec67;if(_0x4819dd[_0x8e09('0x2f')][_0x8e09('0x41')]){_0x1a79c1[_0x8e09('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1a79c1);})[_0x8e09('0x22')](function(_0x2e3d36){_0xf7e3f3['rows']=_0x2e3d36;return _0xf7e3f3;});}})[_0x8e09('0x22')](respondWithFilteredResult(_0x2b4e12,_0x1a79c1))[_0x8e09('0x3e')](handleError(_0x2b4e12,null));};exports[_0x8e09('0x5c')]=function(_0x4f9ece,_0x14033d,_0x111ce2){var _0x4a4010={'raw':!![],'where':{}};var _0x521b7b={};var _0x1c1ddc={'count':0x0,'rows':[]};return db[_0x8e09('0x29')][_0x8e09('0x55')]({'where':{'id':_0x4f9ece[_0x8e09('0x4d')]['id']}})[_0x8e09('0x22')](handleEntityNotFound(_0x14033d,null))[_0x8e09('0x22')](function(_0xf960d5){if(_0xf960d5){_0x521b7b[_0x8e09('0x2d')]=_[_0x8e09('0x30')](db[_0x8e09('0x5d')]['rawAttributes']);_0x521b7b['query']=_[_0x8e09('0x30')](_0x4f9ece[_0x8e09('0x2f')]);_0x521b7b[_0x8e09('0x31')]=_[_0x8e09('0x40')](_0x521b7b['model'],_0x521b7b[_0x8e09('0x2f')]);_0x4a4010[_0x8e09('0x32')]=_[_0x8e09('0x40')](_0x521b7b[_0x8e09('0x2d')],qs[_0x8e09('0x33')](_0x4f9ece[_0x8e09('0x2f')][_0x8e09('0x33')]));_0x4a4010[_0x8e09('0x32')]=_0x4a4010['attributes'][_0x8e09('0x34')]?_0x4a4010[_0x8e09('0x32')]:_0x521b7b['model'];if(!_0x4f9ece['query'][_0x8e09('0x57')]('nolimit')){_0x4a4010[_0x8e09('0x1e')]=qs[_0x8e09('0x1e')](_0x4f9ece['query'][_0x8e09('0x1e')]);_0x4a4010[_0x8e09('0x1d')]=qs[_0x8e09('0x1d')](_0x4f9ece[_0x8e09('0x2f')][_0x8e09('0x1d')]);}_0x4a4010[_0x8e09('0x36')]=qs[_0x8e09('0x37')](_0x4f9ece[_0x8e09('0x2f')][_0x8e09('0x37')]);_0x4a4010[_0x8e09('0x38')]=qs[_0x8e09('0x31')](_[_0x8e09('0x39')](_0x4f9ece[_0x8e09('0x2f')],_0x521b7b[_0x8e09('0x31')]));_0x4a4010[_0x8e09('0x38')]['CampaignId']=_0xf960d5['id'];if(_0x4f9ece[_0x8e09('0x2f')]['filter']){_0x4a4010[_0x8e09('0x38')]=_['merge'](_0x4a4010[_0x8e09('0x38')],{'$or':_['map'](_0x4a4010['attributes'],function(_0x120164){var _0x4d7203={};_0x4d7203[_0x120164]={'$like':'%'+_0x4f9ece[_0x8e09('0x2f')][_0x8e09('0x3a')]+'%'};return _0x4d7203;})});}_0x4a4010=_['merge']({},_0x4a4010,_0x4f9ece[_0x8e09('0x3b')]);return db[_0x8e09('0x5d')]['count']({'where':_0x4a4010[_0x8e09('0x38')]})[_0x8e09('0x22')](function(_0x13971a){_0x1c1ddc[_0x8e09('0x1c')]=_0x13971a;if(_0x4f9ece['query'][_0x8e09('0x41')]){_0x4a4010['include']=[{'all':!![]}];}return db[_0x8e09('0x5d')][_0x8e09('0x59')](_0x4a4010);})[_0x8e09('0x22')](function(_0x293f72){_0x1c1ddc['rows']=_0x293f72;return _0x1c1ddc;});}})[_0x8e09('0x22')](respondWithFilteredResult(_0x14033d,_0x4a4010))[_0x8e09('0x3e')](handleError(_0x14033d,null));};exports[_0x8e09('0x5e')]=function(_0x539f22,_0x4a6806,_0x3d6384){var _0x11f1ed={'raw':!![],'where':{}};var _0x212c78={};var _0x420f57={'count':0x0,'rows':[]};return db[_0x8e09('0x29')][_0x8e09('0x55')]({'where':{'id':_0x539f22['params']['id']}})['then'](handleEntityNotFound(_0x4a6806,null))[_0x8e09('0x22')](function(_0x281ed){if(_0x281ed){_0x212c78[_0x8e09('0x2d')]=_[_0x8e09('0x30')](db[_0x8e09('0x5f')][_0x8e09('0x2a')]);_0x212c78['query']=_[_0x8e09('0x30')](_0x539f22[_0x8e09('0x2f')]);_0x212c78[_0x8e09('0x31')]=_[_0x8e09('0x40')](_0x212c78[_0x8e09('0x2d')],_0x212c78[_0x8e09('0x2f')]);_0x11f1ed[_0x8e09('0x32')]=_[_0x8e09('0x40')](_0x212c78[_0x8e09('0x2d')],qs[_0x8e09('0x33')](_0x539f22[_0x8e09('0x2f')]['fields']));_0x11f1ed[_0x8e09('0x32')]=_0x11f1ed[_0x8e09('0x32')][_0x8e09('0x34')]?_0x11f1ed[_0x8e09('0x32')]:_0x212c78['model'];if(!_0x539f22[_0x8e09('0x2f')][_0x8e09('0x57')](_0x8e09('0x35'))){_0x11f1ed['limit']=qs['limit'](_0x539f22[_0x8e09('0x2f')]['limit']);_0x11f1ed[_0x8e09('0x1d')]=qs[_0x8e09('0x1d')](_0x539f22[_0x8e09('0x2f')][_0x8e09('0x1d')]);}_0x11f1ed['order']=qs[_0x8e09('0x37')](_0x539f22[_0x8e09('0x2f')][_0x8e09('0x37')]);_0x11f1ed[_0x8e09('0x38')]=qs[_0x8e09('0x31')](_[_0x8e09('0x39')](_0x539f22[_0x8e09('0x2f')],_0x212c78[_0x8e09('0x31')]));_0x11f1ed[_0x8e09('0x38')][_0x8e09('0x58')]=_0x281ed['id'];if(_0x539f22['query'][_0x8e09('0x3a')]){_0x11f1ed[_0x8e09('0x38')]=_[_0x8e09('0x42')](_0x11f1ed['where'],{'$or':_[_0x8e09('0x2e')](_0x11f1ed[_0x8e09('0x32')],function(_0x519e93){var _0x521692={};_0x521692[_0x519e93]={'$like':'%'+_0x539f22['query'][_0x8e09('0x3a')]+'%'};return _0x521692;})});}_0x11f1ed=_[_0x8e09('0x42')]({},_0x11f1ed,_0x539f22[_0x8e09('0x3b')]);return db[_0x8e09('0x5f')]['count']({'where':_0x11f1ed[_0x8e09('0x38')]})[_0x8e09('0x22')](function(_0x5d4e42){_0x420f57['count']=_0x5d4e42;if(_0x539f22[_0x8e09('0x2f')][_0x8e09('0x41')]){_0x11f1ed[_0x8e09('0x3c')]=[{'all':!![]}];}return db[_0x8e09('0x5f')][_0x8e09('0x59')](_0x11f1ed);})['then'](function(_0x30d5ff){_0x420f57[_0x8e09('0x3d')]=_0x30d5ff;return _0x420f57;});}})[_0x8e09('0x22')](respondWithFilteredResult(_0x4a6806,_0x11f1ed))[_0x8e09('0x3e')](handleError(_0x4a6806,null));};exports['getLists']=function(_0x26d635,_0x2922cb,_0x5c9c26){var _0x58feb0={};var _0x11bda9={};var _0x3e3f36;var _0x6174d6;return db[_0x8e09('0x29')][_0x8e09('0x55')]({'where':{'id':_0x26d635[_0x8e09('0x4d')]['id']}})[_0x8e09('0x22')](handleEntityNotFound(_0x2922cb,null))['then'](function(_0x14c8ff){if(_0x14c8ff){_0x3e3f36=_0x14c8ff;_0x11bda9[_0x8e09('0x2d')]=_[_0x8e09('0x30')](db[_0x8e09('0x60')][_0x8e09('0x2a')]);_0x11bda9[_0x8e09('0x2f')]=_['keys'](_0x26d635[_0x8e09('0x2f')]);_0x11bda9[_0x8e09('0x31')]=_[_0x8e09('0x40')](_0x11bda9[_0x8e09('0x2d')],_0x11bda9['query']);_0x58feb0[_0x8e09('0x32')]=_[_0x8e09('0x40')](_0x11bda9[_0x8e09('0x2d')],qs['fields'](_0x26d635['query'][_0x8e09('0x33')]));_0x58feb0[_0x8e09('0x32')]=_0x58feb0[_0x8e09('0x32')][_0x8e09('0x34')]?_0x58feb0[_0x8e09('0x32')]:_0x11bda9['model'];_0x58feb0[_0x8e09('0x36')]=qs[_0x8e09('0x37')](_0x26d635[_0x8e09('0x2f')][_0x8e09('0x37')]);_0x58feb0[_0x8e09('0x38')]=qs['filters'](_['pick'](_0x26d635['query'],_0x11bda9['filters']));if(_0x26d635[_0x8e09('0x2f')][_0x8e09('0x3a')]){_0x58feb0[_0x8e09('0x38')]=_[_0x8e09('0x42')](_0x58feb0[_0x8e09('0x38')],{'$or':_[_0x8e09('0x2e')](_0x58feb0[_0x8e09('0x32')],function(_0x248670){var _0x3c7179={};_0x3c7179[_0x248670]={'$like':'%'+_0x26d635[_0x8e09('0x2f')]['filter']+'%'};return _0x3c7179;})});}_0x58feb0=_[_0x8e09('0x42')]({},_0x58feb0,_0x26d635[_0x8e09('0x3b')]);return _0x3e3f36[_0x8e09('0x61')](_0x58feb0);}})[_0x8e09('0x22')](function(_0x5a3633){if(_0x5a3633){_0x6174d6=_0x5a3633['length'];if(!_0x26d635[_0x8e09('0x2f')][_0x8e09('0x57')](_0x8e09('0x35'))){_0x58feb0[_0x8e09('0x1e')]=qs[_0x8e09('0x1e')](_0x26d635[_0x8e09('0x2f')][_0x8e09('0x1e')]);_0x58feb0[_0x8e09('0x1d')]=qs[_0x8e09('0x1d')](_0x26d635['query'][_0x8e09('0x1d')]);}return _0x3e3f36[_0x8e09('0x61')](_0x58feb0);}})['then'](function(_0x9e8443){if(_0x9e8443){return _0x9e8443?{'count':_0x6174d6,'rows':_0x9e8443}:null;}})['then'](respondWithResult(_0x2922cb,null))[_0x8e09('0x3e')](handleError(_0x2922cb,null));};exports[_0x8e09('0x62')]=function(_0x19bd8c,_0xf9cd5b,_0x5d34ec){var _0x2c8d41,_0x210fbb;return db[_0x8e09('0x29')][_0x8e09('0x52')]({'where':{'id':_0x19bd8c[_0x8e09('0x4d')]['id']}})['then'](handleEntityNotFound(_0xf9cd5b,null))[_0x8e09('0x22')](function(_0x5dd584){if(_0x5dd584){_0x210fbb=_0x5dd584;return _0x5dd584[_0x8e09('0x62')](_0x19bd8c[_0x8e09('0x44')][_0x8e09('0x63')],_[_0x8e09('0x4e')](_0x19bd8c[_0x8e09('0x44')],[_0x8e09('0x63'),'id'])||{});}return null;})['spread'](function(_0x40c8a2){var _0x191308;_0x2c8d41=_0x40c8a2||[];var _0x160d0e=[];if(_0x40c8a2){for(var _0x18b50c=0x0;_0x18b50c<_0x40c8a2['length'];_0x18b50c+=0x1){var _0x42f14c=_0x40c8a2[_0x18b50c]['get']({'plain':!![]});_0x210fbb[_0x8e09('0x64')]=_0x19bd8c[_0x8e09('0x44')]['dialCheckDuplicateType']?_0x19bd8c['body'][_0x8e09('0x64')]:_0x210fbb[_0x8e09('0x64')];switch(_0x210fbb[_0x8e09('0x64')]){case _0x8e09('0x65'):_0x191308=squel[_0x8e09('0x66')]()[_0x8e09('0x67')](_0x8e09('0x68'))[_0x8e09('0x69')]([_0x8e09('0x6a'),_0x8e09('0x6b'),_0x8e09('0x6c'),_0x8e09('0x6d'),_0x8e09('0x58'),_0x8e09('0x50'),_0x8e09('0x4f')],squel[_0x8e09('0x6e')]()[_0x8e09('0x6f')](_0x8e09('0x6a'),_0x8e09('0x6a'))['field'](_0x8e09('0x70'),_0x8e09('0x6b'))[_0x8e09('0x6f')]('id',_0x8e09('0x6c'))['field'](_0x42f14c[_0x8e09('0x71')][_0x8e09('0x72')](),_0x8e09('0x6d'))[_0x8e09('0x6f')](_0x19bd8c[_0x8e09('0x4d')]['id'][_0x8e09('0x72')](),_0x8e09('0x58'))['field'](_0x8e09('0x70'),_0x8e09('0x50'))[_0x8e09('0x6f')](_0x8e09('0x70'),_0x8e09('0x4f'))['from']('cm_contacts')[_0x8e09('0x38')](_0x8e09('0x73'))[_0x8e09('0x38')](_0x8e09('0x74'),_0x42f14c[_0x8e09('0x71')][_0x8e09('0x72')]())[_0x8e09('0x38')](_0x8e09('0x75'))[_0x8e09('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8e09('0x6e')]()[_0x8e09('0x6f')]('COALESCE(calleridnum,\x27\x27)')[_0x8e09('0x76')](_0x8e09('0x77'))[_0x8e09('0x38')](_0x8e09('0x78'),_0x19bd8c[_0x8e09('0x4d')]['id'][_0x8e09('0x72')]()))[_0x8e09('0x38')](_0x8e09('0x79'),squel[_0x8e09('0x6e')]()[_0x8e09('0x6f')](_0x8e09('0x7a'))[_0x8e09('0x76')](_0x8e09('0x68'))[_0x8e09('0x38')](_0x8e09('0x78'),_0x19bd8c[_0x8e09('0x4d')]['id'][_0x8e09('0x72')]())))['toString']();break;case _0x8e09('0x7b'):_0x191308=squel['insert']()[_0x8e09('0x67')]('cm_hopper')['fromQuery']([_0x8e09('0x6a'),_0x8e09('0x6b'),_0x8e09('0x6c'),_0x8e09('0x6d'),_0x8e09('0x58'),_0x8e09('0x50'),'updatedAt'],squel['select']()[_0x8e09('0x6f')](_0x8e09('0x6a'),_0x8e09('0x6a'))[_0x8e09('0x6f')](_0x8e09('0x70'),_0x8e09('0x6b'))[_0x8e09('0x6f')]('id',_0x8e09('0x6c'))[_0x8e09('0x6f')](_0x42f14c[_0x8e09('0x71')][_0x8e09('0x72')](),_0x8e09('0x6d'))[_0x8e09('0x6f')](_0x19bd8c['params']['id'][_0x8e09('0x72')](),_0x8e09('0x58'))[_0x8e09('0x6f')](_0x8e09('0x70'),'createdAt')[_0x8e09('0x6f')](_0x8e09('0x70'),_0x8e09('0x4f'))[_0x8e09('0x76')](_0x8e09('0x7c'))[_0x8e09('0x38')]('deletedAt\x20IS\x20NULL')[_0x8e09('0x38')](_0x8e09('0x74'),_0x42f14c[_0x8e09('0x71')]['toString']())[_0x8e09('0x38')](_0x8e09('0x75'))[_0x8e09('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x8e09('0x6e')]()[_0x8e09('0x6f')](_0x8e09('0x7a'))[_0x8e09('0x76')](_0x8e09('0x68'))[_0x8e09('0x38')](_0x8e09('0x78'),_0x19bd8c[_0x8e09('0x4d')]['id']['toString']())))[_0x8e09('0x72')]();break;default:_0x191308=squel[_0x8e09('0x66')]()[_0x8e09('0x67')](_0x8e09('0x68'))['fromQuery']([_0x8e09('0x6a'),_0x8e09('0x6b'),_0x8e09('0x6c'),_0x8e09('0x6d'),_0x8e09('0x58'),_0x8e09('0x50'),'updatedAt'],squel['select']()[_0x8e09('0x6f')]('phone','phone')[_0x8e09('0x6f')](_0x8e09('0x70'),'scheduledAt')[_0x8e09('0x6f')]('id',_0x8e09('0x6c'))['field'](_0x42f14c['CmListId'][_0x8e09('0x72')](),'ListId')['field'](_0x19bd8c[_0x8e09('0x4d')]['id'][_0x8e09('0x72')](),'CampaignId')[_0x8e09('0x6f')]('NOW()',_0x8e09('0x50'))[_0x8e09('0x6f')](_0x8e09('0x70'),_0x8e09('0x4f'))[_0x8e09('0x76')](_0x8e09('0x7c'))[_0x8e09('0x38')]('deletedAt\x20IS\x20NULL')[_0x8e09('0x38')](_0x8e09('0x74'),_0x42f14c[_0x8e09('0x71')][_0x8e09('0x72')]())[_0x8e09('0x38')](_0x8e09('0x75')))[_0x8e09('0x72')]();}_0x160d0e[_0x8e09('0x7d')](db[_0x8e09('0x7e')][_0x8e09('0x2f')](_0x191308));}return BPromise[_0x8e09('0x7f')](_0x160d0e);}})[_0x8e09('0x22')](function(){return _0x2c8d41;})[_0x8e09('0x22')](respondWithResult(_0xf9cd5b,null))['catch'](handleError(_0xf9cd5b,null));};exports['removeLists']=function(_0x2d2be3,_0x27ad1a,_0x15422a){return db[_0x8e09('0x29')][_0x8e09('0x52')]({'where':{'id':_0x2d2be3[_0x8e09('0x4d')]['id']}})[_0x8e09('0x22')](handleEntityNotFound(_0x27ad1a,null))['then'](function(_0x1f8b5e){if(_0x1f8b5e){return _0x1f8b5e[_0x8e09('0x80')](_0x2d2be3['query'][_0x8e09('0x63')]);}})[_0x8e09('0x22')](function(_0x2099cb){if(_0x2099cb){return db[_0x8e09('0x56')][_0x8e09('0x54')]({'where':{'ListId':_0x2d2be3[_0x8e09('0x2f')][_0x8e09('0x63')],'CampaignId':_0x2d2be3['params']['id']}})[_0x8e09('0x22')](function(){return _0x2099cb;});}})['then'](respondWithStatusCode(_0x27ad1a,null))[_0x8e09('0x3e')](handleError(_0x27ad1a,null));};exports[_0x8e09('0x81')]=function(_0x4d5eeb,_0x23bc29,_0x3222ee){var _0x206983={'raw':!![],'where':{}};var _0xd649d2={};var _0x58c223={'count':0x0,'rows':[]};return db['Campaign'][_0x8e09('0x55')]({'where':{'id':_0x4d5eeb[_0x8e09('0x4d')]['id']}})[_0x8e09('0x22')](handleEntityNotFound(_0x23bc29,null))['then'](function(_0xf2a5df){if(_0xf2a5df){_0xd649d2[_0x8e09('0x2d')]=_[_0x8e09('0x30')](db[_0x8e09('0x60')][_0x8e09('0x2a')]);_0xd649d2[_0x8e09('0x2f')]=_['keys'](_0x4d5eeb[_0x8e09('0x2f')]);_0xd649d2[_0x8e09('0x31')]=_[_0x8e09('0x40')](_0xd649d2[_0x8e09('0x2d')],_0xd649d2[_0x8e09('0x2f')]);_0x206983[_0x8e09('0x32')]=_['intersection'](_0xd649d2[_0x8e09('0x2d')],qs[_0x8e09('0x33')](_0x4d5eeb[_0x8e09('0x2f')][_0x8e09('0x33')]));_0x206983['attributes']=_0x206983[_0x8e09('0x32')][_0x8e09('0x34')]?_0x206983['attributes']:_0xd649d2['model'];if(!_0x4d5eeb[_0x8e09('0x2f')][_0x8e09('0x57')]('nolimit')){_0x206983['limit']=qs['limit'](_0x4d5eeb['query']['limit']);_0x206983[_0x8e09('0x1d')]=qs['offset'](_0x4d5eeb[_0x8e09('0x2f')][_0x8e09('0x1d')]);}_0x206983[_0x8e09('0x36')]=qs['sort'](_0x4d5eeb[_0x8e09('0x2f')][_0x8e09('0x37')]);_0x206983[_0x8e09('0x38')]=qs[_0x8e09('0x31')](_[_0x8e09('0x39')](_0x4d5eeb[_0x8e09('0x2f')],_0xd649d2['filters']));_0x206983['where'][_0x8e09('0x58')]=_0xf2a5df['id'];if(_0x4d5eeb[_0x8e09('0x2f')][_0x8e09('0x3a')]){_0x206983[_0x8e09('0x38')]=_[_0x8e09('0x42')](_0x206983[_0x8e09('0x38')],{'$or':_['map'](_0x206983['attributes'],function(_0x17f7b8){var _0x595a94={};_0x595a94[_0x17f7b8]={'$like':'%'+_0x4d5eeb[_0x8e09('0x2f')][_0x8e09('0x3a')]+'%'};return _0x595a94;})});}_0x206983=_[_0x8e09('0x42')]({},_0x206983,_0x4d5eeb['options']);return db[_0x8e09('0x60')][_0x8e09('0x1c')]({'where':_0x206983[_0x8e09('0x38')]})['then'](function(_0x1325d7){_0x58c223['count']=_0x1325d7;if(_0x4d5eeb[_0x8e09('0x2f')]['includeAll']){_0x206983[_0x8e09('0x3c')]=[{'all':!![]}];}return db[_0x8e09('0x60')]['findAll'](_0x206983);})[_0x8e09('0x22')](function(_0x45e391){_0x58c223['rows']=_0x45e391;return _0x58c223;});}})[_0x8e09('0x22')](respondWithFilteredResult(_0x23bc29,_0x206983))[_0x8e09('0x3e')](handleError(_0x23bc29,null));};exports[_0x8e09('0x82')]=function(_0x2f78c7,_0x401cb2,_0x529a3){var _0x41f058,_0x3bfbbe;return db[_0x8e09('0x29')][_0x8e09('0x52')]({'where':{'id':_0x2f78c7[_0x8e09('0x4d')]['id']}})['then'](handleEntityNotFound(_0x401cb2,null))[_0x8e09('0x22')](function(_0xb3544d){if(_0xb3544d){_0x3bfbbe=_0xb3544d;return _0xb3544d[_0x8e09('0x82')](_0x2f78c7[_0x8e09('0x44')][_0x8e09('0x63')],_[_0x8e09('0x4e')](_0x2f78c7[_0x8e09('0x44')],[_0x8e09('0x63'),'id'])||{});}return null;})[_0x8e09('0x83')](function(_0x380fa0){var _0x225475;_0x41f058=_0x380fa0||[];var _0x44c1ca=[];if(_0x380fa0){for(var _0xfe4136=0x0;_0xfe4136<_0x380fa0[_0x8e09('0x34')];_0xfe4136+=0x1){var _0x3c17e9=_0x380fa0[_0xfe4136][_0x8e09('0x45')]({'plain':!![]});_0x225475=squel[_0x8e09('0x66')]()[_0x8e09('0x67')](_0x8e09('0x84'))['fromQuery']([_0x8e09('0x6a'),_0x8e09('0x6c'),_0x8e09('0x6d'),_0x8e09('0x58'),_0x8e09('0x50'),_0x8e09('0x4f')],squel['select']()[_0x8e09('0x6f')]('phone',_0x8e09('0x6a'))[_0x8e09('0x6f')]('id','ContactId')[_0x8e09('0x6f')](_0x3c17e9[_0x8e09('0x71')]['toString'](),_0x8e09('0x6d'))[_0x8e09('0x6f')](_0x2f78c7[_0x8e09('0x4d')]['id'][_0x8e09('0x72')](),_0x8e09('0x58'))['field'](_0x8e09('0x70'),'createdAt')[_0x8e09('0x6f')](_0x8e09('0x70'),_0x8e09('0x4f'))[_0x8e09('0x76')]('cm_contacts')[_0x8e09('0x38')]('deletedAt\x20IS\x20NULL')[_0x8e09('0x38')](_0x8e09('0x74'),_0x3c17e9[_0x8e09('0x71')][_0x8e09('0x72')]())[_0x8e09('0x38')](_0x8e09('0x75')))['toString']();_0x44c1ca[_0x8e09('0x7d')](db['sequelize']['query'](_0x225475));}return BPromise['all'](_0x44c1ca);}})['then'](function(){return _0x41f058;})[_0x8e09('0x22')](respondWithResult(_0x401cb2,null))[_0x8e09('0x3e')](handleError(_0x401cb2,null));};exports[_0x8e09('0x85')]=function(_0x4315f7,_0x5091be,_0x1615cc){return db[_0x8e09('0x29')][_0x8e09('0x52')]({'where':{'id':_0x4315f7[_0x8e09('0x4d')]['id']}})[_0x8e09('0x22')](handleEntityNotFound(_0x5091be,null))['then'](function(_0x5d9d5e){if(_0x5d9d5e){return _0x5d9d5e[_0x8e09('0x85')](_0x4315f7[_0x8e09('0x2f')][_0x8e09('0x63')]);}})[_0x8e09('0x22')](function(_0x39d344){if(_0x39d344){return db[_0x8e09('0x5f')][_0x8e09('0x54')]({'where':{'ListId':_0x4315f7[_0x8e09('0x2f')][_0x8e09('0x63')],'CampaignId':_0x4315f7[_0x8e09('0x4d')]['id']}})['then'](function(){return _0x39d344;});}})[_0x8e09('0x22')](respondWithStatusCode(_0x5091be,null))['catch'](handleError(_0x5091be,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 776d7a9..75b2743 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 _0x4d78=['moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','../../config/logger','api'];(function(_0x31833d,_0x256a13){var _0x48b2be=function(_0x1e7f16){while(--_0x1e7f16){_0x31833d['push'](_0x31833d['shift']());}};_0x48b2be(++_0x256a13);}(_0x4d78,0x1ad));var _0x84d7=function(_0x386b6c,_0xdf75d1){_0x386b6c=_0x386b6c-0x0;var _0x39a2ff=_0x4d78[_0x386b6c];return _0x39a2ff;};'use strict';var _=require(_0x84d7('0x0'));var util=require('util');var logger=require(_0x84d7('0x1'))(_0x84d7('0x2'));var moment=require(_0x84d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x84d7('0x4'));var fs=require('fs');var path=require(_0x84d7('0x5'));var rimraf=require(_0x84d7('0x6'));var config=require(_0x84d7('0x7'));var attributes=require(_0x84d7('0x8'));module[_0x84d7('0x9')]=function(_0x4c3979,_0xfdab8){return _0x4c3979[_0x84d7('0xa')](_0x84d7('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80ea=['moment','bluebird','request-promise','rimraf','../../config/environment','./campaign.attributes','exports','define','campaigns','lodash','util','../../config/logger','api'];(function(_0xcf8e79,_0x34bd33){var _0x76e1b=function(_0x351f77){while(--_0x351f77){_0xcf8e79['push'](_0xcf8e79['shift']());}};_0x76e1b(++_0x34bd33);}(_0x80ea,0x1c3));var _0xa80e=function(_0x325bb8,_0x52a2d8){_0x325bb8=_0x325bb8-0x0;var _0x15fcb9=_0x80ea[_0x325bb8];return _0x15fcb9;};'use strict';var _=require(_0xa80e('0x0'));var util=require(_0xa80e('0x1'));var logger=require(_0xa80e('0x2'))(_0xa80e('0x3'));var moment=require(_0xa80e('0x4'));var BPromise=require(_0xa80e('0x5'));var rp=require(_0xa80e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa80e('0x7'));var config=require(_0xa80e('0x8'));var attributes=require(_0xa80e('0x9'));module[_0xa80e('0xa')]=function(_0x1e3206,_0xa30295){return _0x1e3206[_0xa80e('0xb')]('Campaign',attributes,{'tableName':_0xa80e('0xc'),'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 86f0e03..b057857 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 _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x2c545b,_0x538b5b){var _0x101a1a=function(_0x5796ad){while(--_0x5796ad){_0x2c545b['push'](_0x2c545b['shift']());}};_0x101a1a(++_0x538b5b);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetCampaign']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x34b709,_0x5dc8af){var _0x20dda4=function(_0x33eaef){while(--_0x33eaef){_0x34b709['push'](_0x34b709['shift']());}};_0x20dda4(++_0x5dc8af);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 32ef7a2..156c16b 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 _0xcc97=['../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addLists','addBlackLists','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router'];(function(_0x4fac21,_0x263e36){var _0x55c6df=function(_0x50ecce){while(--_0x50ecce){_0x4fac21['push'](_0x4fac21['shift']());}};_0x55c6df(++_0x263e36);}(_0xcc97,0x1a8));var _0x7cc9=function(_0x1ce23a,_0x5d5cad){_0x1ce23a=_0x1ce23a-0x0;var _0x3e7645=_0xcc97[_0x1ce23a];return _0x3e7645;};'use strict';var multer=require(_0x7cc9('0x0'));var util=require(_0x7cc9('0x1'));var path=require('path');var timeout=require(_0x7cc9('0x2'));var express=require(_0x7cc9('0x3'));var router=express[_0x7cc9('0x4')]();var auth=require(_0x7cc9('0x5'));var interaction=require(_0x7cc9('0x6'));var config=require(_0x7cc9('0x7'));var controller=require(_0x7cc9('0x8'));router[_0x7cc9('0x9')]('/',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0xb')]);router[_0x7cc9('0x9')]('/:id',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0xc')]);router[_0x7cc9('0x9')](_0x7cc9('0xd'),auth[_0x7cc9('0xa')](),controller['getHoppers']);router[_0x7cc9('0x9')]('/:id/hopper_histories',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0xe')]);router[_0x7cc9('0x9')](_0x7cc9('0xf'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x10')]);router[_0x7cc9('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x7cc9('0x11')]);router['get'](_0x7cc9('0x12'),auth['isAuthenticated'](),controller[_0x7cc9('0x13')]);router[_0x7cc9('0x9')](_0x7cc9('0x14'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cc9('0x16')]);router[_0x7cc9('0x17')](_0x7cc9('0x18'),auth[_0x7cc9('0xa')](),controller['clone']);router[_0x7cc9('0x17')]('/:id/lists',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x19')]);router[_0x7cc9('0x17')](_0x7cc9('0x14'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1a')]);router['put'](_0x7cc9('0x1b'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1c')]);router[_0x7cc9('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7cc9('0x1d')]('/:id/lists',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1e')]);router['delete'](_0x7cc9('0x14'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1f')]);module[_0x7cc9('0x20')]=router; \ No newline at end of file +var _0x434b=['/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/hopper_black','/:id/lists','/:id/blacklists','getBlackLists','post','create','clone','addLists','update','destroy','delete','removeLists','removeBlackLists','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index'];(function(_0x401121,_0x181adb){var _0x3aef8f=function(_0x3a05cb){while(--_0x3a05cb){_0x401121['push'](_0x401121['shift']());}};_0x3aef8f(++_0x181adb);}(_0x434b,0x17f));var _0xb434=function(_0x4c1ec2,_0x4f42b7){_0x4c1ec2=_0x4c1ec2-0x0;var _0x3f6f1c=_0x434b[_0x4c1ec2];return _0x3f6f1c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb434('0x0'));var timeout=require(_0xb434('0x1'));var express=require('express');var router=express[_0xb434('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb434('0x3'));var config=require(_0xb434('0x4'));var controller=require(_0xb434('0x5'));router[_0xb434('0x6')]('/',auth[_0xb434('0x7')](),controller[_0xb434('0x8')]);router[_0xb434('0x6')](_0xb434('0x9'),auth[_0xb434('0x7')](),controller['show']);router[_0xb434('0x6')](_0xb434('0xa'),auth[_0xb434('0x7')](),controller[_0xb434('0xb')]);router[_0xb434('0x6')](_0xb434('0xc'),auth[_0xb434('0x7')](),controller['getHopperHistories']);router['get'](_0xb434('0xd'),auth[_0xb434('0x7')](),controller['getHopperFinals']);router['get'](_0xb434('0xe'),auth[_0xb434('0x7')](),controller['getHopperBlacks']);router['get'](_0xb434('0xf'),auth[_0xb434('0x7')](),controller['getLists']);router[_0xb434('0x6')](_0xb434('0x10'),auth[_0xb434('0x7')](),controller[_0xb434('0x11')]);router[_0xb434('0x12')]('/',auth[_0xb434('0x7')](),controller[_0xb434('0x13')]);router[_0xb434('0x12')]('/:id/clone',auth[_0xb434('0x7')](),controller[_0xb434('0x14')]);router[_0xb434('0x12')](_0xb434('0xf'),auth[_0xb434('0x7')](),controller[_0xb434('0x15')]);router[_0xb434('0x12')](_0xb434('0x10'),auth['isAuthenticated'](),controller['addBlackLists']);router['put']('/:id',auth[_0xb434('0x7')](),controller[_0xb434('0x16')]);router['delete'](_0xb434('0x9'),auth['isAuthenticated'](),controller[_0xb434('0x17')]);router[_0xb434('0x18')](_0xb434('0xf'),auth[_0xb434('0x7')](),controller[_0xb434('0x19')]);router[_0xb434('0x18')](_0xb434('0x10'),auth[_0xb434('0x7')](),controller[_0xb434('0x1a')]);module[_0xb434('0x1b')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index dac89e3..2438421 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 _0xc903=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0xc7c964,_0xd0392a){var _0x2f65c6=function(_0x162919){while(--_0x162919){_0xc7c964['push'](_0xc7c964['shift']());}};_0x2f65c6(++_0xd0392a);}(_0xc903,0x178));var _0x3c90=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0xc903[_0x1d1219];return _0x5b5b89;};'use strict';var Sequelize=require(_0x3c90('0x0'));module[_0x3c90('0x1')]={'key':{'type':Sequelize[_0x3c90('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x3c90('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x3c90('0x4')],'get':function(){return this[_0x3c90('0x5')](_0x3c90('0x6'));}}}; \ No newline at end of file +var _0x3eb5=['getDataValue','exports','STRING','TEXT'];(function(_0x7a8ae3,_0x272a77){var _0x351557=function(_0x242295){while(--_0x242295){_0x7a8ae3['push'](_0x7a8ae3['shift']());}};_0x351557(++_0x272a77);}(_0x3eb5,0x161));var _0x53eb=function(_0x57d740,_0x50be99){_0x57d740=_0x57d740-0x0;var _0x6607ef=_0x3eb5[_0x57d740];return _0x6607ef;};'use strict';var Sequelize=require('sequelize');module[_0x53eb('0x0')]={'key':{'type':Sequelize[_0x53eb('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x53eb('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x53eb('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 62c5016..da135a1 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 _0x9957=['limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CannedAnswer','count','include','catch','show','params','keys','length','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x281567,_0x96a91e){var _0x1df161=function(_0x5dd671){while(--_0x5dd671){_0x281567['push'](_0x281567['shift']());}};_0x1df161(++_0x96a91e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['CannedAnswer'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]));if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x4a')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3f')]['find']({'where':{'id':_0xddf537[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x4b')]=function(_0x1fe77e,_0x12d4b8){var _0x47d1d8={'key':_0x1fe77e['body']['key']};if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')]){_0x47d1d8['MailAccountId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')];}else if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4d')]){_0x47d1d8[_0x7995('0x4d')]=_0x1fe77e['body'][_0x7995('0x4d')];}else if(_0x1fe77e['body'][_0x7995('0x4e')]){_0x47d1d8[_0x7995('0x4e')]=_0x1fe77e[_0x7995('0x4a')]['OpenchannelAccountId'];}else if(_0x1fe77e['body']['ChatWebsiteId']){_0x47d1d8['ChatWebsiteId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4f')];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':_0x47d1d8})[_0x7995('0x24')](function(_0x357e60){if(_0x357e60){throw new db[(_0x7995('0x50'))][(_0x7995('0x51'))](_0x7995('0x52'));}return db[_0x7995('0x3f')][_0x7995('0x4b')](_0x1fe77e[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x35bea3){var _0x1ea1dc=_0x1fe77e[_0x7995('0x53')][_0x7995('0x26')]({'plain':!![]});if(!_0x1ea1dc)throw new Error(_0x7995('0x54'));if(_0x1ea1dc[_0x7995('0x55')]==='user'){var _0x56a374=_0x35bea3[_0x7995('0x26')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ea1dc['userProfileId']},'raw':!![]})[_0x7995('0x24')](function(_0x197b52){if(_0x197b52&&_0x197b52[_0x7995('0x57')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0x56a374[_0x7995('0x2a')],'resourceId':_0x56a374['id'],'type':_0x197b52[_0x7995('0x2a')],'sectionId':_0x197b52['id']},{})[_0x7995('0x24')](function(){return _0x35bea3;});}else{return _0x35bea3;}})[_0x7995('0x42')](function(_0x502d43){logger['error'](_0x7995('0x58'),_0x502d43);throw _0x502d43;});}return _0x35bea3;})[_0x7995('0x24')](respondWithResult(_0x12d4b8,0xc9))[_0x7995('0x42')](handleError(_0x12d4b8,null));}; \ No newline at end of file +var _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index bcf685f..6cb19bc 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 _0xfaa4=['../../config/environment','./cannedAnswer.attributes','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x23cc71,_0x2c5958){var _0x383011=function(_0x3d33ee){while(--_0x3d33ee){_0x23cc71['push'](_0x23cc71['shift']());}};_0x383011(++_0x2c5958);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x247265,_0x269561){_0x247265=_0x247265-0x0;var _0x3174d9=_0xfaa4[_0x247265];return _0x3174d9;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var logger=require(_0x4faa('0x2'))(_0x4faa('0x3'));var moment=require(_0x4faa('0x4'));var BPromise=require(_0x4faa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4faa('0x6'));var rimraf=require(_0x4faa('0x7'));var config=require(_0x4faa('0x8'));var attributes=require(_0x4faa('0x9'));module['exports']=function(_0x8117c3,_0x6df371){return _0x8117c3[_0x4faa('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4faa('0xb')});}; \ No newline at end of file +var _0xf3dc=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci'];(function(_0x44904d,_0x2bedfb){var _0xfbccba=function(_0x5ed335){while(--_0x5ed335){_0x44904d['push'](_0x44904d['shift']());}};_0xfbccba(++_0x2bedfb);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0xf3dc[_0x2300f2];return _0x6bd508;};'use strict';var _=require(_0xcf3d('0x0'));var util=require(_0xcf3d('0x1'));var logger=require(_0xcf3d('0x2'))('api');var moment=require(_0xcf3d('0x3'));var BPromise=require(_0xcf3d('0x4'));var rp=require(_0xcf3d('0x5'));var fs=require('fs');var path=require(_0xcf3d('0x6'));var rimraf=require(_0xcf3d('0x7'));var config=require(_0xcf3d('0x8'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x55074b,_0x5b1441){return _0x55074b['define']('CannedAnswer',attributes,{'tableName':_0xcf3d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcf3d('0xa'),'collate':_0xcf3d('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 7c672e8..79df1b0 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 _0x44a6=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x125997,_0x2c055c){var _0x3fea79=function(_0x4f57a9){while(--_0x4f57a9){_0x125997['push'](_0x125997['shift']());}};_0x3fea79(++_0x2c055c);}(_0x44a6,0xc4));var _0x644a=function(_0x4d933a,_0x40c7f7){_0x4d933a=_0x4d933a-0x0;var _0x493aff=_0x44a6[_0x4d933a];return _0x493aff;};'use strict';var _=require(_0x644a('0x0'));var util=require(_0x644a('0x1'));var moment=require(_0x644a('0x2'));var BPromise=require(_0x644a('0x3'));var rs=require(_0x644a('0x4'));var fs=require('fs');var Redis=require(_0x644a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x644a('0x6'));var logger=require(_0x644a('0x7'))(_0x644a('0x8'));var config=require(_0x644a('0x9'));var jayson=require(_0x644a('0xa'));var client=jayson[_0x644a('0xb')][_0x644a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe6d94,_0x248479,_0x233359){return new BPromise(function(_0x142b88,_0x5367ad){return client['request'](_0xe6d94,_0x233359)[_0x644a('0xd')](function(_0x5b00c5){logger[_0x644a('0xe')](_0x644a('0xf'),_0x248479,_0x644a('0x10'));logger[_0x644a('0x11')](_0x644a('0x12'),_0x248479,'request\x20sent',JSON[_0x644a('0x13')](_0x5b00c5));if(_0x5b00c5[_0x644a('0x14')]){if(_0x5b00c5[_0x644a('0x14')][_0x644a('0x15')]===0x1f4){logger[_0x644a('0x14')](_0x644a('0xf'),_0x248479,_0x5b00c5['error'][_0x644a('0x16')]);return _0x5367ad(_0x5b00c5[_0x644a('0x14')]['message']);}logger[_0x644a('0x14')](_0x644a('0xf'),_0x248479,_0x5b00c5[_0x644a('0x14')]['message']);return _0x142b88(_0x5b00c5['error'][_0x644a('0x16')]);}else{logger[_0x644a('0xe')](_0x644a('0xf'),_0x248479,_0x644a('0x10'));_0x142b88(_0x5b00c5[_0x644a('0x17')][_0x644a('0x16')]);}})[_0x644a('0x18')](function(_0x403b41){logger[_0x644a('0x14')](_0x644a('0xf'),_0x248479,_0x403b41);_0x5367ad(_0x403b41);});});} \ No newline at end of file +var _0x3670=['lodash','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x3670,0x140));var _0x0367=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3670[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x0367('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0367('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0367('0x2'))['db'];var utils=require(_0x0367('0x3'));var logger=require('../../config/logger')(_0x0367('0x4'));var config=require(_0x0367('0x5'));var jayson=require(_0x0367('0x6'));var client=jayson[_0x0367('0x7')][_0x0367('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x345f02,_0x3014dc,_0xc5357b){return new BPromise(function(_0x116c6f,_0x40f548){return client[_0x0367('0x9')](_0x345f02,_0xc5357b)[_0x0367('0xa')](function(_0x26b48f){logger['info'](_0x0367('0xb'),_0x3014dc,_0x0367('0xc'));logger[_0x0367('0xd')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x3014dc,_0x0367('0xc'),JSON[_0x0367('0xe')](_0x26b48f));if(_0x26b48f[_0x0367('0xf')]){if(_0x26b48f[_0x0367('0xf')][_0x0367('0x10')]===0x1f4){logger[_0x0367('0xf')](_0x0367('0xb'),_0x3014dc,_0x26b48f[_0x0367('0xf')][_0x0367('0x11')]);return _0x40f548(_0x26b48f['error'][_0x0367('0x11')]);}logger[_0x0367('0xf')](_0x0367('0xb'),_0x3014dc,_0x26b48f[_0x0367('0xf')][_0x0367('0x11')]);return _0x116c6f(_0x26b48f[_0x0367('0xf')][_0x0367('0x11')]);}else{logger[_0x0367('0x12')](_0x0367('0xb'),_0x3014dc,_0x0367('0xc'));_0x116c6f(_0x26b48f['result'][_0x0367('0x11')]);}})[_0x0367('0x13')](function(_0x4e3e60){logger['error'](_0x0367('0xb'),_0x3014dc,_0x4e3e60);_0x40f548(_0x4e3e60);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index f6bd8a2..4744bf2 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 _0xb877=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x212482,_0x35096e){var _0x3c0b27=function(_0x5205b3){while(--_0x5205b3){_0x212482['push'](_0x212482['shift']());}};_0x3c0b27(++_0x35096e);}(_0xb877,0x1cb));var _0x7b87=function(_0x4df36f,_0x2817ba){_0x4df36f=_0x4df36f-0x0;var _0x5f2062=_0xb877[_0x4df36f];return _0x5f2062;};'use strict';var multer=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var path=require(_0x7b87('0x2'));var timeout=require(_0x7b87('0x3'));var express=require(_0x7b87('0x4'));var router=express[_0x7b87('0x5')]();var auth=require(_0x7b87('0x6'));var interaction=require(_0x7b87('0x7'));var config=require(_0x7b87('0x8'));var controller=require(_0x7b87('0x9'));router[_0x7b87('0xa')]('/',auth[_0x7b87('0xb')](),controller[_0x7b87('0xc')]);router[_0x7b87('0xa')](_0x7b87('0xd'),auth[_0x7b87('0xb')](),controller[_0x7b87('0xe')]);router[_0x7b87('0xf')]('/',auth[_0x7b87('0xb')](),controller[_0x7b87('0x10')]);router[_0x7b87('0x11')](_0x7b87('0xd'),auth['isAuthenticated'](),controller[_0x7b87('0x12')]);router[_0x7b87('0x13')](_0x7b87('0xd'),auth[_0x7b87('0xb')](),controller[_0x7b87('0x14')]);module[_0x7b87('0x15')]=router; \ No newline at end of file +var _0x317b=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/:id','show'];(function(_0x114d31,_0x21c195){var _0x2f108a=function(_0x34d54e){while(--_0x34d54e){_0x114d31['push'](_0x114d31['shift']());}};_0x2f108a(++_0x21c195);}(_0x317b,0x65));var _0xb317=function(_0x31bd61,_0x4c3cc4){_0x31bd61=_0x31bd61-0x0;var _0x242879=_0x317b[_0x31bd61];return _0x242879;};'use strict';var multer=require(_0xb317('0x0'));var util=require('util');var path=require(_0xb317('0x1'));var timeout=require(_0xb317('0x2'));var express=require(_0xb317('0x3'));var router=express[_0xb317('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xb317('0x5'));var config=require('../../config/environment');var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0xb317('0x6')](),controller[_0xb317('0x7')]);router[_0xb317('0x8')](_0xb317('0x9'),auth['isAuthenticated'](),controller[_0xb317('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb317('0xb')](_0xb317('0x9'),auth[_0xb317('0x6')](),controller[_0xb317('0xc')]);router[_0xb317('0xd')](_0xb317('0x9'),auth[_0xb317('0x6')](),controller[_0xb317('0xe')]);module[_0xb317('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index b2a4d30..c1ba362 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 _0x21b2=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x21b2,0xea));var _0x221b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x21b2[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x221b('0x0'));module[_0x221b('0x1')]={'calldate':{'type':Sequelize[_0x221b('0x2')],'allowNull':![],'defaultValue':_0x221b('0x3')},'clid':{'type':Sequelize[_0x221b('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x221b('0x4')]},'channel':{'type':Sequelize[_0x221b('0x4')]},'dstchannel':{'type':Sequelize[_0x221b('0x4')]},'lastapp':{'type':Sequelize[_0x221b('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x221b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x221b('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x221b('0x4')]},'userfield':{'type':Sequelize[_0x221b('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x221b('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x221b('0x4')]}}; \ No newline at end of file +var _0x167e=['sequelize','DATE','STRING','INTEGER'];(function(_0x481169,_0x46b29d){var _0x3f128a=function(_0x4b39b9){while(--_0x4b39b9){_0x481169['push'](_0x481169['shift']());}};_0x3f128a(++_0x46b29d);}(_0x167e,0x1bc));var _0xe167=function(_0x447a4f,_0xc80366){_0x447a4f=_0x447a4f-0x0;var _0x3bcd6e=_0x167e[_0x447a4f];return _0x3bcd6e;};'use strict';var Sequelize=require(_0xe167('0x0'));module['exports']={'calldate':{'type':Sequelize[_0xe167('0x1')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xe167('0x2')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xe167('0x2')]},'dcontext':{'type':Sequelize[_0xe167('0x2')]},'channel':{'type':Sequelize[_0xe167('0x2')]},'dstchannel':{'type':Sequelize[_0xe167('0x2')]},'lastapp':{'type':Sequelize[_0xe167('0x2')]},'lastdata':{'type':Sequelize[_0xe167('0x2')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xe167('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe167('0x2')]},'amaflags':{'type':Sequelize[_0xe167('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe167('0x2')]},'userfield':{'type':Sequelize[_0xe167('0x2')]},'uniqueid':{'type':Sequelize[_0xe167('0x2')]},'linkedid':{'type':Sequelize[_0xe167('0x2')]},'sequence':{'type':Sequelize[_0xe167('0x2')]},'peeraccount':{'type':Sequelize[_0xe167('0x2')]},'type':{'type':Sequelize[_0xe167('0x2')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 08a62fd..10ee396 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 _0x4124=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','catch','create','body','destroy','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','end','sendStatus','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x44e827,_0x145ed8){var _0xa19d97=function(_0x3a1176){while(--_0x3a1176){_0x44e827['push'](_0x44e827['shift']());}};_0xa19d97(++_0x145ed8);}(_0x4124,0x140));var _0x4412=function(_0x5e7d23,_0x312ba7){_0x5e7d23=_0x5e7d23-0x0;var _0x43f376=_0x4124[_0x5e7d23];return _0x43f376;};'use strict';var pdf=require(_0x4412('0x0'));var emlformat=require(_0x4412('0x1'));var rimraf=require(_0x4412('0x2'));var zipdir=require(_0x4412('0x3'));var jsonpatch=require(_0x4412('0x4'));var rp=require(_0x4412('0x5'));var moment=require('moment');var BPromise=require(_0x4412('0x6'));var Mustache=require(_0x4412('0x7'));var util=require(_0x4412('0x8'));var path=require(_0x4412('0x9'));var sox=require('sox');var csv=require(_0x4412('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4412('0xb'));var squel=require(_0x4412('0xc'));var crypto=require('crypto');var jsforce=require(_0x4412('0xd'));var deskjs=require(_0x4412('0xe'));var toCsv=require(_0x4412('0xa'));var querystring=require(_0x4412('0xf'));var Papa=require(_0x4412('0x10'));var Redis=require(_0x4412('0x11'));var authService=require(_0x4412('0x12'));var qs=require(_0x4412('0x13'));var as=require(_0x4412('0x14'));var hardwareService=require(_0x4412('0x15'));var logger=require(_0x4412('0x16'))('api');var utils=require(_0x4412('0x17'));var config=require('../../config/environment');var db=require(_0x4412('0x18'))['db'];function respondWithStatusCode(_0x19a87b,_0x3aede3){_0x3aede3=_0x3aede3||0xcc;return function(_0x24ad1c){if(_0x24ad1c){return _0x19a87b['sendStatus'](_0x3aede3);}return _0x19a87b['status'](_0x3aede3)['end']();};}function respondWithResult(_0xc3c8f1,_0x1f14c4){_0x1f14c4=_0x1f14c4||0xc8;return function(_0xd73cd9){if(_0xd73cd9){return _0xc3c8f1[_0x4412('0x19')](_0x1f14c4)[_0x4412('0x1a')](_0xd73cd9);}};}function respondWithFilteredResult(_0x5da303,_0x3b6076){return function(_0x28e977){if(_0x28e977){var _0x333049=_0x28e977[_0x4412('0x1b')],_0x4105dc=_0x3b6076[_0x4412('0x1c')],_0x54280e=_0x3b6076[_0x4412('0x1c')]+_0x3b6076[_0x4412('0x1d')],_0x57d213;if(_0x54280e>=_0x333049){_0x54280e=_0x333049;_0x57d213=0xc8;}else{_0x57d213=0xce;}_0x5da303[_0x4412('0x19')](_0x57d213);return _0x5da303[_0x4412('0x1e')](_0x4412('0x1f'),_0x4105dc+'-'+_0x54280e+'/'+_0x333049)[_0x4412('0x1a')](_0x28e977);}return null;};}function patchUpdates(_0x5876ef){return function(_0x59c565){try{jsonpatch[_0x4412('0x20')](_0x59c565,_0x5876ef,!![]);}catch(_0x3de20e){return BPromise[_0x4412('0x21')](_0x3de20e);}return _0x59c565['save']();};}function saveUpdates(_0x48e29a,_0x3e4049){return function(_0x55ef30){if(_0x55ef30){return _0x55ef30[_0x4412('0x22')](_0x48e29a)[_0x4412('0x23')](function(_0x19b301){return _0x19b301;});}return null;};}function removeEntity(_0x54aa64,_0x3af537){return function(_0x207742){if(_0x207742){return _0x207742['destroy']()[_0x4412('0x23')](function(){_0x54aa64[_0x4412('0x19')](0xcc)[_0x4412('0x24')]();});}};}function handleEntityNotFound(_0x2fe4dd,_0x126b71){return function(_0x3846e2){if(!_0x3846e2){_0x2fe4dd[_0x4412('0x25')](0x194);}return _0x3846e2;};}function handleError(_0x281e2a,_0x508483){_0x508483=_0x508483||0x1f4;return function(_0x374c10){logger['error'](_0x374c10[_0x4412('0x26')]);if(_0x374c10[_0x4412('0x27')]){delete _0x374c10[_0x4412('0x27')];}_0x281e2a[_0x4412('0x19')](_0x508483)[_0x4412('0x28')](_0x374c10);};}exports['index']=function(_0x13afb1,_0x421589){var _0x1a216e={},_0x115360={},_0x1b6d1b={'count':0x0,'rows':[]};var _0xaed20=_[_0x4412('0x29')](db[_0x4412('0x2a')][_0x4412('0x2b')],function(_0x4777a4){return{'name':_0x4777a4[_0x4412('0x2c')],'type':_0x4777a4[_0x4412('0x2d')][_0x4412('0x2e')]};});_0x115360[_0x4412('0x2f')]=_[_0x4412('0x29')](_0xaed20,'name');_0x115360['query']=_[_0x4412('0x30')](_0x13afb1[_0x4412('0x31')]);_0x115360[_0x4412('0x32')]=_['intersection'](_0x115360[_0x4412('0x2f')],_0x115360['query']);_0x1a216e[_0x4412('0x33')]=_[_0x4412('0x34')](_0x115360[_0x4412('0x2f')],qs[_0x4412('0x35')](_0x13afb1[_0x4412('0x31')][_0x4412('0x35')]));_0x1a216e[_0x4412('0x33')]=_0x1a216e[_0x4412('0x33')][_0x4412('0x36')]?_0x1a216e[_0x4412('0x33')]:_0x115360[_0x4412('0x2f')];if(!_0x13afb1['query'][_0x4412('0x37')](_0x4412('0x38'))){_0x1a216e[_0x4412('0x1d')]=qs[_0x4412('0x1d')](_0x13afb1[_0x4412('0x31')][_0x4412('0x1d')]);_0x1a216e[_0x4412('0x1c')]=qs[_0x4412('0x1c')](_0x13afb1[_0x4412('0x31')][_0x4412('0x1c')]);}_0x1a216e[_0x4412('0x39')]=qs['sort'](_0x13afb1[_0x4412('0x31')][_0x4412('0x3a')]);_0x1a216e[_0x4412('0x3b')]=qs[_0x4412('0x32')](_[_0x4412('0x3c')](_0x13afb1[_0x4412('0x31')],_0x115360[_0x4412('0x32')]));if(_0x13afb1['query']['filter']){_0x1a216e[_0x4412('0x3b')]=_[_0x4412('0x3d')](_0x1a216e['where'],{'$or':_['map'](_0xaed20,function(_0x4298a9){if(_0x4298a9[_0x4412('0x2d')]!==_0x4412('0x3e')){var _0x338bdf={};_0x338bdf[_0x4298a9[_0x4412('0x27')]]={'$like':'%'+_0x13afb1[_0x4412('0x31')][_0x4412('0x3f')]+'%'};return _0x338bdf;}})});}_0x1a216e=_[_0x4412('0x3d')]({},_0x1a216e,_0x13afb1[_0x4412('0x40')]);var _0x2e1d4a={'where':_0x1a216e[_0x4412('0x3b')]};return db['Cdr'][_0x4412('0x1b')](_0x2e1d4a)[_0x4412('0x23')](function(_0x279edd){_0x1b6d1b[_0x4412('0x1b')]=_0x279edd;if(_0x13afb1[_0x4412('0x31')][_0x4412('0x41')]){_0x1a216e[_0x4412('0x42')]=[{'all':!![]}];}return db[_0x4412('0x2a')][_0x4412('0x43')](_0x1a216e);})[_0x4412('0x23')](function(_0x33f905){_0x1b6d1b['rows']=_0x33f905;return _0x1b6d1b;})['then'](respondWithFilteredResult(_0x421589,_0x1a216e))['catch'](handleError(_0x421589,null));};exports[_0x4412('0x44')]=function(_0x129b35,_0x1e3730){var _0x40d2d1={'raw':!![],'where':{'id':_0x129b35['params']['id']}},_0x20f24d={};_0x20f24d['model']=_['keys'](db['Cdr'][_0x4412('0x2b')]);_0x20f24d[_0x4412('0x31')]=_[_0x4412('0x30')](_0x129b35['query']);_0x20f24d['filters']=_[_0x4412('0x34')](_0x20f24d[_0x4412('0x2f')],_0x20f24d[_0x4412('0x31')]);_0x40d2d1[_0x4412('0x33')]=_['intersection'](_0x20f24d[_0x4412('0x2f')],qs[_0x4412('0x35')](_0x129b35[_0x4412('0x31')][_0x4412('0x35')]));_0x40d2d1['attributes']=_0x40d2d1[_0x4412('0x33')]['length']?_0x40d2d1[_0x4412('0x33')]:_0x20f24d['model'];if(_0x129b35[_0x4412('0x31')][_0x4412('0x41')]){_0x40d2d1[_0x4412('0x42')]=[{'all':!![]}];}_0x40d2d1=_[_0x4412('0x3d')]({},_0x40d2d1,_0x129b35[_0x4412('0x40')]);return db['Cdr'][_0x4412('0x45')](_0x40d2d1)[_0x4412('0x23')](handleEntityNotFound(_0x1e3730,null))[_0x4412('0x23')](respondWithResult(_0x1e3730,null))[_0x4412('0x46')](handleError(_0x1e3730,null));};exports[_0x4412('0x47')]=function(_0x2ce93a,_0x48ff28){return db[_0x4412('0x2a')][_0x4412('0x47')](_0x2ce93a[_0x4412('0x48')],{})[_0x4412('0x23')](respondWithResult(_0x48ff28,0xc9))[_0x4412('0x46')](handleError(_0x48ff28,null));};exports[_0x4412('0x22')]=function(_0x2e0f53,_0x187bdb){if(_0x2e0f53[_0x4412('0x48')]['id']){delete _0x2e0f53[_0x4412('0x48')]['id'];}return db['Cdr'][_0x4412('0x45')]({'where':{'id':_0x2e0f53['params']['id']}})[_0x4412('0x23')](handleEntityNotFound(_0x187bdb,null))[_0x4412('0x23')](saveUpdates(_0x2e0f53[_0x4412('0x48')],null))['then'](respondWithResult(_0x187bdb,null))[_0x4412('0x46')](handleError(_0x187bdb,null));};exports[_0x4412('0x49')]=function(_0x2ccf4f,_0x22ccfa){return db['Cdr'][_0x4412('0x45')]({'where':{'id':_0x2ccf4f[_0x4412('0x4a')]['id']}})[_0x4412('0x23')](handleEntityNotFound(_0x22ccfa,null))[_0x4412('0x23')](removeEntity(_0x22ccfa,null))[_0x4412('0x46')](handleError(_0x22ccfa,null));};exports[_0x4412('0x4b')]=function(_0x29486c,_0x4ae6fc){return db[_0x4412('0x2a')][_0x4412('0x4b')]()[_0x4412('0x23')](respondWithResult(_0x4ae6fc,null))[_0x4412('0x46')](handleError(_0x4ae6fc,null));}; \ No newline at end of file +var _0x4872=['stack','name','send','index','map','Cdr','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','type','options','then','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','destroy','error'];(function(_0x59836f,_0x2b029f){var _0x307228=function(_0x1586e9){while(--_0x1586e9){_0x59836f['push'](_0x59836f['shift']());}};_0x307228(++_0x2b029f);}(_0x4872,0x70));var _0x2487=function(_0x1883c3,_0x3487c0){_0x1883c3=_0x1883c3-0x0;var _0x340c3b=_0x4872[_0x1883c3];return _0x340c3b;};'use strict';var pdf=require(_0x2487('0x0'));var emlformat=require(_0x2487('0x1'));var rimraf=require(_0x2487('0x2'));var zipdir=require(_0x2487('0x3'));var jsonpatch=require(_0x2487('0x4'));var rp=require(_0x2487('0x5'));var moment=require(_0x2487('0x6'));var BPromise=require(_0x2487('0x7'));var Mustache=require(_0x2487('0x8'));var util=require(_0x2487('0x9'));var path=require(_0x2487('0xa'));var sox=require(_0x2487('0xb'));var csv=require('to-csv');var ejs=require(_0x2487('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2487('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2487('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2487('0xf'));var Papa=require(_0x2487('0x10'));var Redis=require(_0x2487('0x11'));var authService=require(_0x2487('0x12'));var qs=require(_0x2487('0x13'));var as=require(_0x2487('0x14'));var hardwareService=require(_0x2487('0x15'));var logger=require(_0x2487('0x16'))('api');var utils=require(_0x2487('0x17'));var config=require(_0x2487('0x18'));var db=require(_0x2487('0x19'))['db'];function respondWithStatusCode(_0x4daaeb,_0x5458e1){_0x5458e1=_0x5458e1||0xcc;return function(_0x491be7){if(_0x491be7){return _0x4daaeb[_0x2487('0x1a')](_0x5458e1);}return _0x4daaeb[_0x2487('0x1b')](_0x5458e1)[_0x2487('0x1c')]();};}function respondWithResult(_0x44fba7,_0x1b10e4){_0x1b10e4=_0x1b10e4||0xc8;return function(_0x39d215){if(_0x39d215){return _0x44fba7[_0x2487('0x1b')](_0x1b10e4)[_0x2487('0x1d')](_0x39d215);}};}function respondWithFilteredResult(_0x5bf3f4,_0x148f98){return function(_0x2036f0){if(_0x2036f0){var _0x13bbbc=_0x2036f0[_0x2487('0x1e')],_0x27b134=_0x148f98[_0x2487('0x1f')],_0x46a474=_0x148f98[_0x2487('0x1f')]+_0x148f98['limit'],_0xe79715;if(_0x46a474>=_0x13bbbc){_0x46a474=_0x13bbbc;_0xe79715=0xc8;}else{_0xe79715=0xce;}_0x5bf3f4[_0x2487('0x1b')](_0xe79715);return _0x5bf3f4[_0x2487('0x20')](_0x2487('0x21'),_0x27b134+'-'+_0x46a474+'/'+_0x13bbbc)[_0x2487('0x1d')](_0x2036f0);}return null;};}function patchUpdates(_0x435867){return function(_0x5e8a70){try{jsonpatch[_0x2487('0x22')](_0x5e8a70,_0x435867,!![]);}catch(_0x20eebc){return BPromise['reject'](_0x20eebc);}return _0x5e8a70['save']();};}function saveUpdates(_0x4458e7,_0x1d8ffd){return function(_0x238859){if(_0x238859){return _0x238859[_0x2487('0x23')](_0x4458e7)['then'](function(_0x34f7f7){return _0x34f7f7;});}return null;};}function removeEntity(_0x70da72,_0x238d67){return function(_0x2c1a4d){if(_0x2c1a4d){return _0x2c1a4d[_0x2487('0x24')]()['then'](function(){_0x70da72['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2572f6,_0x56bb04){return function(_0x5e6c9c){if(!_0x5e6c9c){_0x2572f6[_0x2487('0x1a')](0x194);}return _0x5e6c9c;};}function handleError(_0xfd4cea,_0x585fe){_0x585fe=_0x585fe||0x1f4;return function(_0x233070){logger[_0x2487('0x25')](_0x233070[_0x2487('0x26')]);if(_0x233070[_0x2487('0x27')]){delete _0x233070[_0x2487('0x27')];}_0xfd4cea[_0x2487('0x1b')](_0x585fe)[_0x2487('0x28')](_0x233070);};}exports[_0x2487('0x29')]=function(_0x467339,_0x1a2ecf){var _0x1effde={},_0x3c05c7={},_0x13fa55={'count':0x0,'rows':[]};var _0xc118df=_[_0x2487('0x2a')](db[_0x2487('0x2b')]['rawAttributes'],function(_0x18b3c2){return{'name':_0x18b3c2['fieldName'],'type':_0x18b3c2['type']['key']};});_0x3c05c7[_0x2487('0x2c')]=_[_0x2487('0x2a')](_0xc118df,_0x2487('0x27'));_0x3c05c7[_0x2487('0x2d')]=_[_0x2487('0x2e')](_0x467339[_0x2487('0x2d')]);_0x3c05c7[_0x2487('0x2f')]=_['intersection'](_0x3c05c7[_0x2487('0x2c')],_0x3c05c7[_0x2487('0x2d')]);_0x1effde[_0x2487('0x30')]=_[_0x2487('0x31')](_0x3c05c7[_0x2487('0x2c')],qs[_0x2487('0x32')](_0x467339[_0x2487('0x2d')]['fields']));_0x1effde['attributes']=_0x1effde[_0x2487('0x30')][_0x2487('0x33')]?_0x1effde['attributes']:_0x3c05c7['model'];if(!_0x467339[_0x2487('0x2d')][_0x2487('0x34')](_0x2487('0x35'))){_0x1effde[_0x2487('0x36')]=qs[_0x2487('0x36')](_0x467339[_0x2487('0x2d')][_0x2487('0x36')]);_0x1effde[_0x2487('0x1f')]=qs[_0x2487('0x1f')](_0x467339[_0x2487('0x2d')][_0x2487('0x1f')]);}_0x1effde[_0x2487('0x37')]=qs['sort'](_0x467339[_0x2487('0x2d')]['sort']);_0x1effde[_0x2487('0x38')]=qs[_0x2487('0x2f')](_[_0x2487('0x39')](_0x467339[_0x2487('0x2d')],_0x3c05c7[_0x2487('0x2f')]));if(_0x467339[_0x2487('0x2d')][_0x2487('0x3a')]){_0x1effde['where']=_[_0x2487('0x3b')](_0x1effde[_0x2487('0x38')],{'$or':_[_0x2487('0x2a')](_0xc118df,function(_0x5bfdf8){if(_0x5bfdf8[_0x2487('0x3c')]!=='VIRTUAL'){var _0x48a3a6={};_0x48a3a6[_0x5bfdf8[_0x2487('0x27')]]={'$like':'%'+_0x467339['query'][_0x2487('0x3a')]+'%'};return _0x48a3a6;}})});}_0x1effde=_['merge']({},_0x1effde,_0x467339[_0x2487('0x3d')]);var _0x1e1f42={'where':_0x1effde[_0x2487('0x38')]};return db[_0x2487('0x2b')][_0x2487('0x1e')](_0x1e1f42)[_0x2487('0x3e')](function(_0x2ee5bc){_0x13fa55[_0x2487('0x1e')]=_0x2ee5bc;if(_0x467339[_0x2487('0x2d')][_0x2487('0x3f')]){_0x1effde[_0x2487('0x40')]=[{'all':!![]}];}return db[_0x2487('0x2b')][_0x2487('0x41')](_0x1effde);})[_0x2487('0x3e')](function(_0x59b7f4){_0x13fa55[_0x2487('0x42')]=_0x59b7f4;return _0x13fa55;})[_0x2487('0x3e')](respondWithFilteredResult(_0x1a2ecf,_0x1effde))[_0x2487('0x43')](handleError(_0x1a2ecf,null));};exports[_0x2487('0x44')]=function(_0x31cc32,_0x1a20f4){var _0x22bc97={'raw':!![],'where':{'id':_0x31cc32['params']['id']}},_0x523bdf={};_0x523bdf['model']=_['keys'](db[_0x2487('0x2b')][_0x2487('0x45')]);_0x523bdf['query']=_[_0x2487('0x2e')](_0x31cc32[_0x2487('0x2d')]);_0x523bdf['filters']=_[_0x2487('0x31')](_0x523bdf['model'],_0x523bdf[_0x2487('0x2d')]);_0x22bc97[_0x2487('0x30')]=_[_0x2487('0x31')](_0x523bdf['model'],qs[_0x2487('0x32')](_0x31cc32[_0x2487('0x2d')]['fields']));_0x22bc97['attributes']=_0x22bc97['attributes'][_0x2487('0x33')]?_0x22bc97[_0x2487('0x30')]:_0x523bdf['model'];if(_0x31cc32[_0x2487('0x2d')][_0x2487('0x3f')]){_0x22bc97[_0x2487('0x40')]=[{'all':!![]}];}_0x22bc97=_[_0x2487('0x3b')]({},_0x22bc97,_0x31cc32[_0x2487('0x3d')]);return db['Cdr'][_0x2487('0x46')](_0x22bc97)[_0x2487('0x3e')](handleEntityNotFound(_0x1a20f4,null))[_0x2487('0x3e')](respondWithResult(_0x1a20f4,null))[_0x2487('0x43')](handleError(_0x1a20f4,null));};exports[_0x2487('0x47')]=function(_0x35347d,_0x264beb){return db[_0x2487('0x2b')]['create'](_0x35347d[_0x2487('0x48')],{})['then'](respondWithResult(_0x264beb,0xc9))[_0x2487('0x43')](handleError(_0x264beb,null));};exports[_0x2487('0x23')]=function(_0x1f7e80,_0xc3fec2){if(_0x1f7e80[_0x2487('0x48')]['id']){delete _0x1f7e80['body']['id'];}return db[_0x2487('0x2b')][_0x2487('0x46')]({'where':{'id':_0x1f7e80[_0x2487('0x49')]['id']}})[_0x2487('0x3e')](handleEntityNotFound(_0xc3fec2,null))['then'](saveUpdates(_0x1f7e80['body'],null))['then'](respondWithResult(_0xc3fec2,null))['catch'](handleError(_0xc3fec2,null));};exports['destroy']=function(_0x385d29,_0x229c05){return db['Cdr'][_0x2487('0x46')]({'where':{'id':_0x385d29[_0x2487('0x49')]['id']}})[_0x2487('0x3e')](handleEntityNotFound(_0x229c05,null))[_0x2487('0x3e')](removeEntity(_0x229c05,null))[_0x2487('0x43')](handleError(_0x229c05,null));};exports[_0x2487('0x4a')]=function(_0x338e54,_0x9858d6){return db['Cdr']['describe']()[_0x2487('0x3e')](respondWithResult(_0x9858d6,null))['catch'](handleError(_0x9858d6,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 6ad67e1..e6977de 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 _0x0295=['uniqueid','lodash','api','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','accountcode','calldate','disposition','dst','src'];(function(_0x5c341c,_0x5c0a00){var _0x5c5946=function(_0x1d8884){while(--_0x1d8884){_0x5c341c['push'](_0x5c341c['shift']());}};_0x5c5946(++_0x5c0a00);}(_0x0295,0x1f0));var _0x5029=function(_0x3537e1,_0xbc7714){_0x3537e1=_0x3537e1-0x0;var _0x164a50=_0x0295[_0x3537e1];return _0x164a50;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x5029('0x9')]},{'name':'calldate','fields':[_0x5029('0xa')]},{'name':'disposition','fields':[_0x5029('0xb')]},{'name':'dst','fields':[_0x5029('0xc')]},{'name':_0x5029('0xd'),'fields':[_0x5029('0xd')]},{'name':'uniqueid','fields':[_0x5029('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cdr.attributes','accountcode','calldate','disposition','dst','src','uniqueid'];(function(_0x4d54b3,_0x352948){var _0x5698ed=function(_0x1fa573){while(--_0x1fa573){_0x4d54b3['push'](_0x4d54b3['shift']());}};_0x5698ed(++_0x352948);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0xfdbd[_0x590b61];return _0x1a14dc;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0xdfdb('0xa'),'fields':[_0xdfdb('0xa')]},{'name':'calldate','fields':[_0xdfdb('0xb')]},{'name':_0xdfdb('0xc'),'fields':[_0xdfdb('0xc')]},{'name':_0xdfdb('0xd'),'fields':[_0xdfdb('0xd')]},{'name':_0xdfdb('0xe'),'fields':[_0xdfdb('0xe')]},{'name':'uniqueid','fields':[_0xdfdb('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index c90851f..8311cd2 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 _0x2dd3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x430e25,_0x372bdf){var _0x4c2738=function(_0x212255){while(--_0x212255){_0x430e25['push'](_0x430e25['shift']());}};_0x4c2738(++_0x372bdf);}(_0x2dd3,0x99));var _0x32dd=function(_0x36337e,_0x19459e){_0x36337e=_0x36337e-0x0;var _0x372071=_0x2dd3[_0x36337e];return _0x372071;};'use strict';var _=require(_0x32dd('0x0'));var util=require(_0x32dd('0x1'));var moment=require(_0x32dd('0x2'));var BPromise=require(_0x32dd('0x3'));var rs=require(_0x32dd('0x4'));var fs=require('fs');var Redis=require(_0x32dd('0x5'));var db=require(_0x32dd('0x6'))['db'];var utils=require(_0x32dd('0x7'));var logger=require(_0x32dd('0x8'))(_0x32dd('0x9'));var config=require(_0x32dd('0xa'));var jayson=require(_0x32dd('0xb'));var client=jayson['client'][_0x32dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37edb0,_0x3a2d54,_0x4e95ee){return new BPromise(function(_0x5d7793,_0x2f1311){return client[_0x32dd('0xd')](_0x37edb0,_0x4e95ee)[_0x32dd('0xe')](function(_0x12f8eb){logger[_0x32dd('0xf')](_0x32dd('0x10'),_0x3a2d54,_0x32dd('0x11'));logger[_0x32dd('0x12')](_0x32dd('0x13'),_0x3a2d54,_0x32dd('0x11'),JSON[_0x32dd('0x14')](_0x12f8eb));if(_0x12f8eb[_0x32dd('0x15')]){if(_0x12f8eb[_0x32dd('0x15')][_0x32dd('0x16')]===0x1f4){logger[_0x32dd('0x15')](_0x32dd('0x10'),_0x3a2d54,_0x12f8eb['error']['message']);return _0x2f1311(_0x12f8eb[_0x32dd('0x15')][_0x32dd('0x17')]);}logger[_0x32dd('0x15')](_0x32dd('0x10'),_0x3a2d54,_0x12f8eb[_0x32dd('0x15')][_0x32dd('0x17')]);return _0x5d7793(_0x12f8eb[_0x32dd('0x15')]['message']);}else{logger[_0x32dd('0xf')](_0x32dd('0x10'),_0x3a2d54,'request\x20sent');_0x5d7793(_0x12f8eb[_0x32dd('0x18')][_0x32dd('0x17')]);}})[_0x32dd('0x19')](function(_0x54244d){logger[_0x32dd('0x15')]('Cdr,\x20%s,\x20%s',_0x3a2d54,_0x54244d);_0x2f1311(_0x54244d);});});} \ No newline at end of file +var _0xbdf9=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s'];(function(_0x1a5324,_0x34a600){var _0x1abd34=function(_0x465791){while(--_0x465791){_0x1a5324['push'](_0x1a5324['shift']());}};_0x1abd34(++_0x34a600);}(_0xbdf9,0x131));var _0x9bdf=function(_0x2307fa,_0x266e5e){_0x2307fa=_0x2307fa-0x0;var _0x496486=_0xbdf9[_0x2307fa];return _0x496486;};'use strict';var _=require(_0x9bdf('0x0'));var util=require(_0x9bdf('0x1'));var moment=require(_0x9bdf('0x2'));var BPromise=require(_0x9bdf('0x3'));var rs=require(_0x9bdf('0x4'));var fs=require('fs');var Redis=require(_0x9bdf('0x5'));var db=require(_0x9bdf('0x6'))['db'];var utils=require(_0x9bdf('0x7'));var logger=require(_0x9bdf('0x8'))(_0x9bdf('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x9bdf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x359c7c,_0x202147,_0x5b98f0){return new BPromise(function(_0x33368e,_0x5e5c11){return client[_0x9bdf('0xb')](_0x359c7c,_0x5b98f0)[_0x9bdf('0xc')](function(_0x31cb87){logger['info'](_0x9bdf('0xd'),_0x202147,_0x9bdf('0xe'));logger[_0x9bdf('0xf')](_0x9bdf('0x10'),_0x202147,_0x9bdf('0xe'),JSON[_0x9bdf('0x11')](_0x31cb87));if(_0x31cb87[_0x9bdf('0x12')]){if(_0x31cb87[_0x9bdf('0x12')][_0x9bdf('0x13')]===0x1f4){logger['error'](_0x9bdf('0xd'),_0x202147,_0x31cb87[_0x9bdf('0x12')][_0x9bdf('0x14')]);return _0x5e5c11(_0x31cb87['error']['message']);}logger[_0x9bdf('0x12')](_0x9bdf('0xd'),_0x202147,_0x31cb87[_0x9bdf('0x12')][_0x9bdf('0x14')]);return _0x33368e(_0x31cb87[_0x9bdf('0x12')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x202147,'request\x20sent');_0x33368e(_0x31cb87[_0x9bdf('0x15')][_0x9bdf('0x14')]);}})[_0x9bdf('0x16')](function(_0x1fc9df){logger[_0x9bdf('0x12')](_0x9bdf('0xd'),_0x202147,_0x1fc9df);_0x5e5c11(_0x1fc9df);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index d93713b..6db92e6 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 _0xc4ca=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xc4ca,0x1c6));var _0xac4c=function(_0x1de2bd,_0x953fb){_0x1de2bd=_0x1de2bd-0x0;var _0x595960=_0xc4ca[_0x1de2bd];return _0x595960;};'use strict';var multer=require('multer');var util=require(_0xac4c('0x0'));var path=require(_0xac4c('0x1'));var timeout=require('connect-timeout');var express=require(_0xac4c('0x2'));var router=express['Router']();var auth=require(_0xac4c('0x3'));var interaction=require(_0xac4c('0x4'));var config=require(_0xac4c('0x5'));var controller=require(_0xac4c('0x6'));router[_0xac4c('0x7')]('/',auth[_0xac4c('0x8')](),controller[_0xac4c('0x9')]);router['get'](_0xac4c('0xa'),auth[_0xac4c('0x8')](),controller[_0xac4c('0xb')]);router[_0xac4c('0x7')](_0xac4c('0xc'),auth['isAuthenticated'](),controller[_0xac4c('0xd')]);router[_0xac4c('0xe')]('/',auth[_0xac4c('0x8')](),controller[_0xac4c('0xf')]);router[_0xac4c('0x10')](_0xac4c('0xc'),auth[_0xac4c('0x8')](),controller[_0xac4c('0x11')]);router[_0xac4c('0x12')](_0xac4c('0xc'),auth[_0xac4c('0x8')](),controller[_0xac4c('0x13')]);module[_0xac4c('0x14')]=router; \ No newline at end of file +var _0xcbb7=['path','connect-timeout','../../components/interaction/service','../../config/environment','./cdr.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','destroy','exports','multer','util'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xcbb7,0x1e4));var _0x7cbb=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xcbb7[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x7cbb('0x0'));var util=require(_0x7cbb('0x1'));var path=require(_0x7cbb('0x2'));var timeout=require(_0x7cbb('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7cbb('0x4'));var config=require(_0x7cbb('0x5'));var controller=require(_0x7cbb('0x6'));router[_0x7cbb('0x7')]('/',auth[_0x7cbb('0x8')](),controller[_0x7cbb('0x9')]);router[_0x7cbb('0x7')](_0x7cbb('0xa'),auth[_0x7cbb('0x8')](),controller[_0x7cbb('0xb')]);router[_0x7cbb('0x7')]('/:id',auth[_0x7cbb('0x8')](),controller[_0x7cbb('0xc')]);router[_0x7cbb('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7cbb('0xe')](_0x7cbb('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x7cbb('0xf'),auth[_0x7cbb('0x8')](),controller[_0x7cbb('0x10')]);module[_0x7cbb('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index ed47a60..9e5449b 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 _0x5938=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x5938,0x8a));var _0x8593=function(_0x14ba7c,_0x3d6924){_0x14ba7c=_0x14ba7c-0x0;var _0x11ad50=_0x5938[_0x14ba7c];return _0x11ad50;};'use strict';var Sequelize=require(_0x8593('0x0'));module[_0x8593('0x1')]={'priority':{'type':Sequelize[_0x8593('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8593('0x3')],'allowNull':![],'defaultValue':_0x8593('0x4')},'appdata':{'type':Sequelize[_0x8593('0x5')]()},'description':{'type':Sequelize[_0x8593('0x3')]},'interval':{'type':Sequelize[_0x8593('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x2d0a=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2d0a,0x188));var _0xa2d0=function(_0x27bab8,_0x1be40b){_0x27bab8=_0x27bab8-0x0;var _0x372112=_0x2d0a[_0x27bab8];return _0x372112;};'use strict';var Sequelize=require(_0xa2d0('0x0'));module[_0xa2d0('0x1')]={'priority':{'type':Sequelize[_0xa2d0('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa2d0('0x3')]()},'description':{'type':Sequelize[_0xa2d0('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa2d0('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index a96a468..a8d259c 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 _0x103c=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','filters','attributes','intersection','length','includeAll','include','options','ChatApplication','body','find','catch','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x5c2b71,_0x3d0ce2){var _0x3ddd11=function(_0x43d951){while(--_0x43d951){_0x5c2b71['push'](_0x5c2b71['shift']());}};_0x3ddd11(++_0x3d0ce2);}(_0x103c,0xe7));var _0xc103=function(_0x15f32c,_0xd1257b){_0x15f32c=_0x15f32c-0x0;var _0x25fd47=_0x103c[_0x15f32c];return _0x25fd47;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc103('0x0'));var rimraf=require(_0xc103('0x1'));var zipdir=require(_0xc103('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc103('0x3'));var moment=require(_0xc103('0x4'));var BPromise=require(_0xc103('0x5'));var Mustache=require(_0xc103('0x6'));var util=require(_0xc103('0x7'));var path=require(_0xc103('0x8'));var sox=require(_0xc103('0x9'));var csv=require(_0xc103('0xa'));var ejs=require(_0xc103('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc103('0xc'));var crypto=require(_0xc103('0xd'));var jsforce=require(_0xc103('0xe'));var deskjs=require(_0xc103('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc103('0x10'));var Papa=require(_0xc103('0x11'));var Redis=require(_0xc103('0x12'));var authService=require(_0xc103('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc103('0x14'));var logger=require(_0xc103('0x15'))('api');var utils=require(_0xc103('0x16'));var config=require(_0xc103('0x17'));var db=require(_0xc103('0x18'))['db'];function respondWithStatusCode(_0x1a4903,_0x4377be){_0x4377be=_0x4377be||0xcc;return function(_0x1a33d1){if(_0x1a33d1){return _0x1a4903[_0xc103('0x19')](_0x4377be);}return _0x1a4903[_0xc103('0x1a')](_0x4377be)[_0xc103('0x1b')]();};}function respondWithResult(_0x1b707e,_0x542f70){_0x542f70=_0x542f70||0xc8;return function(_0x237346){if(_0x237346){return _0x1b707e['status'](_0x542f70)[_0xc103('0x1c')](_0x237346);}};}function respondWithFilteredResult(_0x2f5881,_0x1d35e6){return function(_0x4a656f){if(_0x4a656f){var _0x2f08c6=_0x4a656f[_0xc103('0x1d')],_0x1b78ad=_0x1d35e6[_0xc103('0x1e')],_0x3563f6=_0x1d35e6[_0xc103('0x1e')]+_0x1d35e6[_0xc103('0x1f')],_0x2575dd;if(_0x3563f6>=_0x2f08c6){_0x3563f6=_0x2f08c6;_0x2575dd=0xc8;}else{_0x2575dd=0xce;}_0x2f5881['status'](_0x2575dd);return _0x2f5881['set'](_0xc103('0x20'),_0x1b78ad+'-'+_0x3563f6+'/'+_0x2f08c6)[_0xc103('0x1c')](_0x4a656f);}return null;};}function patchUpdates(_0x47e66e){return function(_0x23efb1){try{jsonpatch[_0xc103('0x21')](_0x23efb1,_0x47e66e,!![]);}catch(_0x4b86fc){return BPromise[_0xc103('0x22')](_0x4b86fc);}return _0x23efb1[_0xc103('0x23')]();};}function saveUpdates(_0xdbaa24,_0x1e0138){return function(_0x30e82a){if(_0x30e82a){return _0x30e82a[_0xc103('0x24')](_0xdbaa24)[_0xc103('0x25')](function(_0xad5704){return _0xad5704;});}return null;};}function removeEntity(_0x20d1e9,_0x50bccb){return function(_0x1fa491){if(_0x1fa491){return _0x1fa491[_0xc103('0x26')]()[_0xc103('0x25')](function(){_0x20d1e9[_0xc103('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c94d3,_0x2df88b){return function(_0x1a4990){if(!_0x1a4990){_0x1c94d3['sendStatus'](0x194);}return _0x1a4990;};}function handleError(_0x14202c,_0x29931f){_0x29931f=_0x29931f||0x1f4;return function(_0x336f1d){logger['error'](_0x336f1d[_0xc103('0x27')]);if(_0x336f1d[_0xc103('0x28')]){delete _0x336f1d['name'];}_0x14202c[_0xc103('0x1a')](_0x29931f)[_0xc103('0x29')](_0x336f1d);};}exports[_0xc103('0x2a')]=function(_0x259d3e,_0x41f008){var _0x44d897={'raw':!![],'where':{'id':_0x259d3e[_0xc103('0x2b')]['id']}},_0x3b37e9={};_0x3b37e9[_0xc103('0x2c')]=_['keys'](db['ChatApplication'][_0xc103('0x2d')]);_0x3b37e9[_0xc103('0x2e')]=_[_0xc103('0x2f')](_0x259d3e['query']);_0x3b37e9[_0xc103('0x30')]=_['intersection'](_0x3b37e9['model'],_0x3b37e9['query']);_0x44d897[_0xc103('0x31')]=_[_0xc103('0x32')](_0x3b37e9[_0xc103('0x2c')],qs['fields'](_0x259d3e['query']['fields']));_0x44d897['attributes']=_0x44d897[_0xc103('0x31')][_0xc103('0x33')]?_0x44d897[_0xc103('0x31')]:_0x3b37e9[_0xc103('0x2c')];if(_0x259d3e[_0xc103('0x2e')][_0xc103('0x34')]){_0x44d897[_0xc103('0x35')]=[{'all':!![]}];}_0x44d897=_['merge']({},_0x44d897,_0x259d3e[_0xc103('0x36')]);return db[_0xc103('0x37')]['find'](_0x44d897)['then'](handleEntityNotFound(_0x41f008,null))[_0xc103('0x25')](respondWithResult(_0x41f008,null))['catch'](handleError(_0x41f008,null));};exports[_0xc103('0x24')]=function(_0x38460c,_0xed668f){if(_0x38460c[_0xc103('0x38')]['id']){delete _0x38460c['body']['id'];}return db['ChatApplication'][_0xc103('0x39')]({'where':{'id':_0x38460c[_0xc103('0x2b')]['id']}})['then'](handleEntityNotFound(_0xed668f,null))[_0xc103('0x25')](saveUpdates(_0x38460c['body'],null))[_0xc103('0x25')](respondWithResult(_0xed668f,null))[_0xc103('0x3a')](handleError(_0xed668f,null));};exports[_0xc103('0x26')]=function(_0x3b548b,_0x47f2d9){return db[_0xc103('0x37')][_0xc103('0x39')]({'where':{'id':_0x3b548b[_0xc103('0x2b')]['id']}})[_0xc103('0x25')](handleEntityNotFound(_0x47f2d9,null))['then'](removeEntity(_0x47f2d9,null))[_0xc103('0x3a')](handleError(_0x47f2d9,null));}; \ No newline at end of file +var _0x1175=['mustache','path','sox','to-csv','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','body','find','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2d3bc0,_0x2b5a57){var _0x1a1b60=function(_0x46637f){while(--_0x46637f){_0x2d3bc0['push'](_0x2d3bc0['shift']());}};_0x1a1b60(++_0x2b5a57);}(_0x1175,0x149));var _0x5117=function(_0xb86cd0,_0x3eb43c){_0xb86cd0=_0xb86cd0-0x0;var _0x398dba=_0x1175[_0xb86cd0];return _0x398dba;};'use strict';var pdf=require(_0x5117('0x0'));var emlformat=require(_0x5117('0x1'));var rimraf=require(_0x5117('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5117('0x3'));var rp=require(_0x5117('0x4'));var moment=require(_0x5117('0x5'));var BPromise=require(_0x5117('0x6'));var Mustache=require(_0x5117('0x7'));var util=require('util');var path=require(_0x5117('0x8'));var sox=require(_0x5117('0x9'));var csv=require(_0x5117('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5117('0xb'));var jsforce=require(_0x5117('0xc'));var deskjs=require(_0x5117('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5117('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5117('0xf'));var qs=require(_0x5117('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5117('0x11'));var logger=require(_0x5117('0x12'))(_0x5117('0x13'));var utils=require('../../config/utils');var config=require(_0x5117('0x14'));var db=require(_0x5117('0x15'))['db'];function respondWithStatusCode(_0x4620b6,_0x29c2dd){_0x29c2dd=_0x29c2dd||0xcc;return function(_0x16e79a){if(_0x16e79a){return _0x4620b6[_0x5117('0x16')](_0x29c2dd);}return _0x4620b6[_0x5117('0x17')](_0x29c2dd)['end']();};}function respondWithResult(_0x9d0f3e,_0x34c9b1){_0x34c9b1=_0x34c9b1||0xc8;return function(_0x3f2973){if(_0x3f2973){return _0x9d0f3e[_0x5117('0x17')](_0x34c9b1)[_0x5117('0x18')](_0x3f2973);}};}function respondWithFilteredResult(_0x4319b6,_0x456699){return function(_0x517b68){if(_0x517b68){var _0x1a379f=_0x517b68[_0x5117('0x19')],_0x2666c1=_0x456699[_0x5117('0x1a')],_0x42bffe=_0x456699[_0x5117('0x1a')]+_0x456699[_0x5117('0x1b')],_0x4c58c5;if(_0x42bffe>=_0x1a379f){_0x42bffe=_0x1a379f;_0x4c58c5=0xc8;}else{_0x4c58c5=0xce;}_0x4319b6[_0x5117('0x17')](_0x4c58c5);return _0x4319b6[_0x5117('0x1c')](_0x5117('0x1d'),_0x2666c1+'-'+_0x42bffe+'/'+_0x1a379f)[_0x5117('0x18')](_0x517b68);}return null;};}function patchUpdates(_0x419f74){return function(_0x338d1c){try{jsonpatch[_0x5117('0x1e')](_0x338d1c,_0x419f74,!![]);}catch(_0x3a29ed){return BPromise[_0x5117('0x1f')](_0x3a29ed);}return _0x338d1c['save']();};}function saveUpdates(_0x11f891,_0x2cab7d){return function(_0x594d34){if(_0x594d34){return _0x594d34[_0x5117('0x20')](_0x11f891)[_0x5117('0x21')](function(_0x13b0ac){return _0x13b0ac;});}return null;};}function removeEntity(_0x58deb2,_0x480e96){return function(_0x2ee52e){if(_0x2ee52e){return _0x2ee52e[_0x5117('0x22')]()[_0x5117('0x21')](function(){_0x58deb2['status'](0xcc)[_0x5117('0x23')]();});}};}function handleEntityNotFound(_0x41a451,_0x1842ac){return function(_0x289a45){if(!_0x289a45){_0x41a451['sendStatus'](0x194);}return _0x289a45;};}function handleError(_0xb0d1f3,_0x2622fb){_0x2622fb=_0x2622fb||0x1f4;return function(_0x1a6690){logger[_0x5117('0x24')](_0x1a6690[_0x5117('0x25')]);if(_0x1a6690['name']){delete _0x1a6690[_0x5117('0x26')];}_0xb0d1f3['status'](_0x2622fb)['send'](_0x1a6690);};}exports[_0x5117('0x27')]=function(_0x5d3017,_0x11e6b3){var _0x29716e={'raw':!![],'where':{'id':_0x5d3017[_0x5117('0x28')]['id']}},_0x28a2f7={};_0x28a2f7[_0x5117('0x29')]=_[_0x5117('0x2a')](db[_0x5117('0x2b')][_0x5117('0x2c')]);_0x28a2f7[_0x5117('0x2d')]=_[_0x5117('0x2a')](_0x5d3017[_0x5117('0x2d')]);_0x28a2f7[_0x5117('0x2e')]=_[_0x5117('0x2f')](_0x28a2f7[_0x5117('0x29')],_0x28a2f7[_0x5117('0x2d')]);_0x29716e[_0x5117('0x30')]=_['intersection'](_0x28a2f7[_0x5117('0x29')],qs[_0x5117('0x31')](_0x5d3017[_0x5117('0x2d')]['fields']));_0x29716e[_0x5117('0x30')]=_0x29716e[_0x5117('0x30')]['length']?_0x29716e[_0x5117('0x30')]:_0x28a2f7['model'];if(_0x5d3017[_0x5117('0x2d')][_0x5117('0x32')]){_0x29716e[_0x5117('0x33')]=[{'all':!![]}];}_0x29716e=_[_0x5117('0x34')]({},_0x29716e,_0x5d3017['options']);return db['ChatApplication']['find'](_0x29716e)[_0x5117('0x21')](handleEntityNotFound(_0x11e6b3,null))[_0x5117('0x21')](respondWithResult(_0x11e6b3,null))['catch'](handleError(_0x11e6b3,null));};exports['update']=function(_0x3256c2,_0x5b5c27){if(_0x3256c2[_0x5117('0x35')]['id']){delete _0x3256c2[_0x5117('0x35')]['id'];}return db[_0x5117('0x2b')][_0x5117('0x36')]({'where':{'id':_0x3256c2[_0x5117('0x28')]['id']}})[_0x5117('0x21')](handleEntityNotFound(_0x5b5c27,null))[_0x5117('0x21')](saveUpdates(_0x3256c2['body'],null))[_0x5117('0x21')](respondWithResult(_0x5b5c27,null))[_0x5117('0x37')](handleError(_0x5b5c27,null));};exports['destroy']=function(_0x5238a4,_0x5baee4){return db['ChatApplication'][_0x5117('0x36')]({'where':{'id':_0x5238a4[_0x5117('0x28')]['id']}})[_0x5117('0x21')](handleEntityNotFound(_0x5baee4,null))[_0x5117('0x21')](removeEntity(_0x5baee4,null))[_0x5117('0x37')](handleError(_0x5baee4,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 9f502f0..697308a 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 75fc718..251839d 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 _0xed34=['client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2dcca8,_0x3e9a74){var _0x5af2f3=function(_0x524375){while(--_0x524375){_0x2dcca8['push'](_0x2dcca8['shift']());}};_0x5af2f3(++_0x3e9a74);}(_0xed34,0x1e9));var _0x4ed3=function(_0x50cb9,_0x13cc1d){_0x50cb9=_0x50cb9-0x0;var _0xdcd78d=_0xed34[_0x50cb9];return _0xdcd78d;};'use strict';var _=require(_0x4ed3('0x0'));var util=require(_0x4ed3('0x1'));var moment=require(_0x4ed3('0x2'));var BPromise=require(_0x4ed3('0x3'));var rs=require(_0x4ed3('0x4'));var fs=require('fs');var Redis=require(_0x4ed3('0x5'));var db=require(_0x4ed3('0x6'))['db'];var utils=require(_0x4ed3('0x7'));var logger=require(_0x4ed3('0x8'))('rpc');var config=require(_0x4ed3('0x9'));var jayson=require(_0x4ed3('0xa'));var client=jayson[_0x4ed3('0xb')][_0x4ed3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57a24a,_0x5274a7,_0x4bfd82){return new BPromise(function(_0x4ae5b0,_0x265416){return client[_0x4ed3('0xd')](_0x57a24a,_0x4bfd82)[_0x4ed3('0xe')](function(_0x652266){logger['info'](_0x4ed3('0xf'),_0x5274a7,_0x4ed3('0x10'));logger[_0x4ed3('0x11')](_0x4ed3('0x12'),_0x5274a7,_0x4ed3('0x10'),JSON[_0x4ed3('0x13')](_0x652266));if(_0x652266[_0x4ed3('0x14')]){if(_0x652266[_0x4ed3('0x14')][_0x4ed3('0x15')]===0x1f4){logger[_0x4ed3('0x14')](_0x4ed3('0xf'),_0x5274a7,_0x652266[_0x4ed3('0x14')][_0x4ed3('0x16')]);return _0x265416(_0x652266[_0x4ed3('0x14')][_0x4ed3('0x16')]);}logger[_0x4ed3('0x14')](_0x4ed3('0xf'),_0x5274a7,_0x652266['error'][_0x4ed3('0x16')]);return _0x4ae5b0(_0x652266['error'][_0x4ed3('0x16')]);}else{logger[_0x4ed3('0x17')](_0x4ed3('0xf'),_0x5274a7,_0x4ed3('0x10'));_0x4ae5b0(_0x652266[_0x4ed3('0x18')][_0x4ed3('0x16')]);}})['catch'](function(_0x48fb0b){logger['error'](_0x4ed3('0xf'),_0x5274a7,_0x48fb0b);_0x265416(_0x48fb0b);});});} \ No newline at end of file +var _0xcff8=['info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcff8,0x182));var _0x8cff=function(_0x4d65d1,_0x57c106){_0x4d65d1=_0x4d65d1-0x0;var _0x2e2c14=_0xcff8[_0x4d65d1];return _0x2e2c14;};'use strict';var _=require(_0x8cff('0x0'));var util=require(_0x8cff('0x1'));var moment=require(_0x8cff('0x2'));var BPromise=require(_0x8cff('0x3'));var rs=require(_0x8cff('0x4'));var fs=require('fs');var Redis=require(_0x8cff('0x5'));var db=require(_0x8cff('0x6'))['db'];var utils=require(_0x8cff('0x7'));var logger=require(_0x8cff('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8cff('0x9'));var client=jayson[_0x8cff('0xa')][_0x8cff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1fc440,_0x317163,_0x3538fe){return new BPromise(function(_0x22f419,_0x26d41a){return client[_0x8cff('0xc')](_0x1fc440,_0x3538fe)['then'](function(_0x38e5f3){logger[_0x8cff('0xd')](_0x8cff('0xe'),_0x317163,_0x8cff('0xf'));logger[_0x8cff('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x317163,_0x8cff('0xf'),JSON[_0x8cff('0x11')](_0x38e5f3));if(_0x38e5f3[_0x8cff('0x12')]){if(_0x38e5f3[_0x8cff('0x12')]['code']===0x1f4){logger[_0x8cff('0x12')](_0x8cff('0xe'),_0x317163,_0x38e5f3['error'][_0x8cff('0x13')]);return _0x26d41a(_0x38e5f3[_0x8cff('0x12')][_0x8cff('0x13')]);}logger[_0x8cff('0x12')](_0x8cff('0xe'),_0x317163,_0x38e5f3['error']['message']);return _0x22f419(_0x38e5f3[_0x8cff('0x12')][_0x8cff('0x13')]);}else{logger['info'](_0x8cff('0xe'),_0x317163,'request\x20sent');_0x22f419(_0x38e5f3[_0x8cff('0x14')][_0x8cff('0x13')]);}})['catch'](function(_0x2bc014){logger[_0x8cff('0x12')]('ChatApplication,\x20%s,\x20%s',_0x317163,_0x2bc014);_0x26d41a(_0x2bc014);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 5d12651..46ed28d 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 _0xbf53=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x1b6d25,_0x1b18c2){var _0x10d084=function(_0xecb037){while(--_0xecb037){_0x1b6d25['push'](_0x1b6d25['shift']());}};_0x10d084(++_0x1b18c2);}(_0xbf53,0xf6));var _0x3bf5=function(_0x126eaf,_0x525848){_0x126eaf=_0x126eaf-0x0;var _0x58fc38=_0xbf53[_0x126eaf];return _0x58fc38;};'use strict';var multer=require(_0x3bf5('0x0'));var util=require(_0x3bf5('0x1'));var path=require(_0x3bf5('0x2'));var timeout=require(_0x3bf5('0x3'));var express=require('express');var router=express[_0x3bf5('0x4')]();var auth=require(_0x3bf5('0x5'));var interaction=require(_0x3bf5('0x6'));var config=require(_0x3bf5('0x7'));var controller=require(_0x3bf5('0x8'));router['get'](_0x3bf5('0x9'),auth[_0x3bf5('0xa')](),controller[_0x3bf5('0xb')]);router[_0x3bf5('0xc')]('/:id',auth[_0x3bf5('0xa')](),controller[_0x3bf5('0xd')]);router[_0x3bf5('0xe')](_0x3bf5('0x9'),auth[_0x3bf5('0xa')](),controller[_0x3bf5('0xf')]);module[_0x3bf5('0x10')]=router; \ No newline at end of file +var _0x92d6=['../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router'];(function(_0x71bc43,_0x4216c1){var _0x4e1ec4=function(_0x544b32){while(--_0x544b32){_0x71bc43['push'](_0x71bc43['shift']());}};_0x4e1ec4(++_0x4216c1);}(_0x92d6,0x82));var _0x692d=function(_0x1a1639,_0xa100f1){_0x1a1639=_0x1a1639-0x0;var _0x12e31f=_0x92d6[_0x1a1639];return _0x12e31f;};'use strict';var multer=require('multer');var util=require(_0x692d('0x0'));var path=require(_0x692d('0x1'));var timeout=require(_0x692d('0x2'));var express=require(_0x692d('0x3'));var router=express[_0x692d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x692d('0x5'));var config=require(_0x692d('0x6'));var controller=require(_0x692d('0x7'));router[_0x692d('0x8')]('/:id',auth[_0x692d('0x9')](),controller['show']);router[_0x692d('0xa')](_0x692d('0xb'),auth[_0x692d('0x9')](),controller[_0x692d('0xc')]);router[_0x692d('0xd')](_0x692d('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x692d('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 720569e..020f3f4 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 _0x9e1a=['exports','STRING','sequelize'];(function(_0x25bea6,_0x10233d){var _0x41f17e=function(_0x2f5f01){while(--_0x2f5f01){_0x25bea6['push'](_0x25bea6['shift']());}};_0x41f17e(++_0x10233d);}(_0x9e1a,0x83));var _0xa9e1=function(_0x16dd42,_0x19fd33){_0x16dd42=_0x16dd42-0x0;var _0x5bc0c2=_0x9e1a[_0x16dd42];return _0x5bc0c2;};'use strict';var Sequelize=require(_0xa9e1('0x0'));module[_0xa9e1('0x1')]={'name':{'type':Sequelize[_0xa9e1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa9e1('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x1d8b=['sequelize','exports','STRING','BOOLEAN'];(function(_0xf0ec33,_0xd5b937){var _0x409006=function(_0x159164){while(--_0x159164){_0xf0ec33['push'](_0xf0ec33['shift']());}};_0x409006(++_0xd5b937);}(_0x1d8b,0xe4));var _0xb1d8=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x1d8b[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0xb1d8('0x0'));module[_0xb1d8('0x1')]={'name':{'type':Sequelize[_0xb1d8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xb1d8('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 5012280..a5ff924 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 _0x79fa=['end','json','count','offset','limit','set','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','merge','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','sort','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status'];(function(_0x42f954,_0x1f20b7){var _0x3e6d8c=function(_0x465193){while(--_0x465193){_0x42f954['push'](_0x42f954['shift']());}};_0x3e6d8c(++_0x1f20b7);}(_0x79fa,0xab));var _0xa79f=function(_0x16e4b7,_0x22232b){_0x16e4b7=_0x16e4b7-0x0;var _0x313374=_0x79fa[_0x16e4b7];return _0x313374;};'use strict';var pdf=require(_0xa79f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa79f('0x1'));var zipdir=require(_0xa79f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa79f('0x3'));var Mustache=require(_0xa79f('0x4'));var util=require(_0xa79f('0x5'));var path=require(_0xa79f('0x6'));var sox=require(_0xa79f('0x7'));var csv=require(_0xa79f('0x8'));var ejs=require(_0xa79f('0x9'));var fs=require('fs');var _=require(_0xa79f('0xa'));var squel=require(_0xa79f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa79f('0xc'));var Papa=require(_0xa79f('0xd'));var Redis=require(_0xa79f('0xe'));var authService=require(_0xa79f('0xf'));var qs=require(_0xa79f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa79f('0x11'));var logger=require(_0xa79f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa79f('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa79f('0x14')](config[_0xa79f('0x15')],{'host':_0xa79f('0x16'),'port':0x18eb});var socket=require(_0xa79f('0x17'))(new Redis(config[_0xa79f('0x15')]));require(_0xa79f('0x18'))[_0xa79f('0x19')](socket);var jayson=require(_0xa79f('0x1a'));var client=jayson[_0xa79f('0x1b')][_0xa79f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x32bee5,_0x99ee37,_0x5af4f1){if(_0x5af4f1){var _0x401da4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x401da4[_0xa79f('0x1d')](_0x99ee37)){return _0x32bee5;}else{throw new db[(_0xa79f('0x1e'))][(_0xa79f('0x1f'))](_0xa79f('0x20'));}}else{return _0x32bee5;}}function respondWithRpcPromise(_0x5a381f,_0xa604d0,_0xe26227,_0x3c423e){return new BPromise(function(_0x1ebbee,_0x51a2d9){var _0x5a6efe=_0x3c423e||client;return _0x5a6efe[_0xa79f('0x21')](_0x5a381f,_0xe26227)['then'](function(_0x592e66){logger[_0xa79f('0x22')](_0xa79f('0x23'),_0xa604d0,'request\x20sent');logger[_0xa79f('0x24')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xa604d0,_0xa79f('0x25'),JSON[_0xa79f('0x26')](_0x592e66));if(_0x592e66[_0xa79f('0x27')]){if(_0x592e66['error']['code']===0x1f4){logger[_0xa79f('0x27')](_0xa79f('0x23'),_0xa604d0,_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);return _0x51a2d9(_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);}logger[_0xa79f('0x27')](_0xa79f('0x23'),_0xa604d0,_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);return _0x1ebbee(_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0xa604d0,'request\x20sent');_0x1ebbee(_0x592e66[_0xa79f('0x29')]['message']);}})[_0xa79f('0x2a')](function(_0x15985a){logger['error'](_0xa79f('0x23'),_0xa604d0,_0x15985a);_0x51a2d9(_0x15985a);});});}function respondWithStatusCode(_0x40ede3,_0x35a93f){_0x35a93f=_0x35a93f||0xcc;return function(_0x88258d){if(_0x88258d){return _0x40ede3[_0xa79f('0x2b')](_0x35a93f);}return _0x40ede3[_0xa79f('0x2c')](_0x35a93f)[_0xa79f('0x2d')]();};}function respondWithResult(_0x3dacee,_0x25d889){_0x25d889=_0x25d889||0xc8;return function(_0x1931d7){if(_0x1931d7){return _0x3dacee['status'](_0x25d889)[_0xa79f('0x2e')](_0x1931d7);}};}function respondWithFilteredResult(_0x3ac6e3,_0x19ca82){return function(_0x4f1b49){if(_0x4f1b49){var _0x565873=_0x4f1b49[_0xa79f('0x2f')],_0x1d5c3a=_0x19ca82[_0xa79f('0x30')],_0x84544f=_0x19ca82[_0xa79f('0x30')]+_0x19ca82[_0xa79f('0x31')],_0x1c30a1;if(_0x84544f>=_0x565873){_0x84544f=_0x565873;_0x1c30a1=0xc8;}else{_0x1c30a1=0xce;}_0x3ac6e3['status'](_0x1c30a1);return _0x3ac6e3[_0xa79f('0x32')]('Content-Range',_0x1d5c3a+'-'+_0x84544f+'/'+_0x565873)['json'](_0x4f1b49);}return null;};}function patchUpdates(_0x33156){return function(_0x3a727a){try{jsonpatch['apply'](_0x3a727a,_0x33156,!![]);}catch(_0x50fca2){return BPromise[_0xa79f('0x33')](_0x50fca2);}return _0x3a727a[_0xa79f('0x34')]();};}function saveUpdates(_0x2ff57b,_0x2111c4){return function(_0x52446f){if(_0x52446f){return _0x52446f[_0xa79f('0x35')](_0x2ff57b)[_0xa79f('0x36')](function(_0xdce777){return _0xdce777;});}return null;};}function removeEntity(_0x397b5a,_0x1051c9){return function(_0x506f67){if(_0x506f67){return _0x506f67[_0xa79f('0x37')]()[_0xa79f('0x36')](function(){_0x397b5a[_0xa79f('0x2c')](0xcc)[_0xa79f('0x2d')]();});}};}function handleEntityNotFound(_0x2a80ed,_0x10d655){return function(_0x290855){if(!_0x290855){_0x2a80ed[_0xa79f('0x2b')](0x194);}return _0x290855;};}function handleError(_0x5f2557,_0x5c0cfd){_0x5c0cfd=_0x5c0cfd||0x1f4;return function(_0x48efbb){logger[_0xa79f('0x27')](_0x48efbb[_0xa79f('0x38')]);if(_0x48efbb[_0xa79f('0x39')]){delete _0x48efbb[_0xa79f('0x39')];}_0x5f2557[_0xa79f('0x2c')](_0x5c0cfd)[_0xa79f('0x3a')](_0x48efbb);};}exports[_0xa79f('0x3b')]=function(_0x49ec46,_0x25ba00){var _0x2cfb04={},_0x17d7d0={},_0x54e9da={'count':0x0,'rows':[]};var _0x1317f2=_[_0xa79f('0x3c')](db[_0xa79f('0x3d')]['rawAttributes'],function(_0x26edae){return{'name':_0x26edae['fieldName'],'type':_0x26edae[_0xa79f('0x3e')][_0xa79f('0x3f')]};});_0x17d7d0[_0xa79f('0x40')]=_[_0xa79f('0x3c')](_0x1317f2,_0xa79f('0x39'));_0x17d7d0[_0xa79f('0x41')]=_[_0xa79f('0x42')](_0x49ec46[_0xa79f('0x41')]);_0x17d7d0[_0xa79f('0x43')]=_[_0xa79f('0x44')](_0x17d7d0[_0xa79f('0x40')],_0x17d7d0[_0xa79f('0x41')]);_0x2cfb04[_0xa79f('0x45')]=_[_0xa79f('0x44')](_0x17d7d0[_0xa79f('0x40')],qs[_0xa79f('0x46')](_0x49ec46[_0xa79f('0x41')][_0xa79f('0x46')]));_0x2cfb04[_0xa79f('0x45')]=_0x2cfb04[_0xa79f('0x45')][_0xa79f('0x47')]?_0x2cfb04['attributes']:_0x17d7d0['model'];if(!_0x49ec46[_0xa79f('0x41')][_0xa79f('0x48')]('nolimit')){_0x2cfb04[_0xa79f('0x31')]=qs['limit'](_0x49ec46[_0xa79f('0x41')][_0xa79f('0x31')]);_0x2cfb04[_0xa79f('0x30')]=qs[_0xa79f('0x30')](_0x49ec46[_0xa79f('0x41')][_0xa79f('0x30')]);}_0x2cfb04[_0xa79f('0x49')]=qs['sort'](_0x49ec46[_0xa79f('0x41')]['sort']);_0x2cfb04[_0xa79f('0x4a')]=qs[_0xa79f('0x43')](_[_0xa79f('0x4b')](_0x49ec46[_0xa79f('0x41')],_0x17d7d0['filters']));if(_0x49ec46[_0xa79f('0x41')][_0xa79f('0x4c')]){_0x2cfb04[_0xa79f('0x4a')]=_['merge'](_0x2cfb04['where'],{'$or':_[_0xa79f('0x3c')](_0x1317f2,function(_0x40dfb8){if(_0x40dfb8[_0xa79f('0x3e')]!==_0xa79f('0x4d')){var _0x5835b5={};_0x5835b5[_0x40dfb8[_0xa79f('0x39')]]={'$like':'%'+_0x49ec46['query']['filter']+'%'};return _0x5835b5;}})});}_0x2cfb04=_['merge']({},_0x2cfb04,_0x49ec46[_0xa79f('0x4e')]);var _0xb8ab05={'where':_0x2cfb04[_0xa79f('0x4a')]};return db['ChatGroup']['count'](_0xb8ab05)[_0xa79f('0x36')](function(_0x12f37c){_0x54e9da['count']=_0x12f37c;if(_0x49ec46['query'][_0xa79f('0x4f')]){_0x2cfb04['include']=[{'all':!![]}];}return db[_0xa79f('0x3d')][_0xa79f('0x50')](_0x2cfb04);})['then'](function(_0x1dfc01){_0x54e9da[_0xa79f('0x51')]=_0x1dfc01;return _0x54e9da;})[_0xa79f('0x36')](respondWithFilteredResult(_0x25ba00,_0x2cfb04))[_0xa79f('0x2a')](handleError(_0x25ba00,null));};exports['show']=function(_0x2e177f,_0x4a8a30){var _0x56011d={'raw':!![],'where':{'id':_0x2e177f[_0xa79f('0x52')]['id']}},_0xa3cc07={};_0xa3cc07[_0xa79f('0x40')]=_[_0xa79f('0x42')](db[_0xa79f('0x3d')][_0xa79f('0x53')]);_0xa3cc07[_0xa79f('0x41')]=_['keys'](_0x2e177f[_0xa79f('0x41')]);_0xa3cc07[_0xa79f('0x43')]=_['intersection'](_0xa3cc07['model'],_0xa3cc07[_0xa79f('0x41')]);_0x56011d[_0xa79f('0x45')]=_[_0xa79f('0x44')](_0xa3cc07[_0xa79f('0x40')],qs[_0xa79f('0x46')](_0x2e177f['query']['fields']));_0x56011d[_0xa79f('0x45')]=_0x56011d[_0xa79f('0x45')][_0xa79f('0x47')]?_0x56011d[_0xa79f('0x45')]:_0xa3cc07['model'];if(_0x2e177f[_0xa79f('0x41')][_0xa79f('0x4f')]){_0x56011d['include']=[{'all':!![]}];}_0x56011d=_[_0xa79f('0x54')]({},_0x56011d,_0x2e177f['options']);return db[_0xa79f('0x3d')][_0xa79f('0x55')](_0x56011d)[_0xa79f('0x36')](handleEntityNotFound(_0x4a8a30,null))[_0xa79f('0x36')](respondWithResult(_0x4a8a30,null))[_0xa79f('0x2a')](handleError(_0x4a8a30,null));};exports[_0xa79f('0x56')]=function(_0x3696fc,_0x450146){return db[_0xa79f('0x3d')][_0xa79f('0x56')](_0x3696fc[_0xa79f('0x57')],{})['then'](respondWithResult(_0x450146,0xc9))[_0xa79f('0x2a')](handleError(_0x450146,null));};exports[_0xa79f('0x35')]=function(_0x511a62,_0x99d69f){if(_0x511a62['body']['id']){delete _0x511a62[_0xa79f('0x57')]['id'];}return db[_0xa79f('0x3d')]['find']({'where':{'id':_0x511a62['params']['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x99d69f,null))[_0xa79f('0x36')](saveUpdates(_0x511a62[_0xa79f('0x57')],null))['then'](respondWithResult(_0x99d69f,null))[_0xa79f('0x2a')](handleError(_0x99d69f,null));};exports[_0xa79f('0x37')]=function(_0x3ffec2,_0x84aa9b){return db[_0xa79f('0x3d')]['find']({'where':{'id':_0x3ffec2['params']['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x84aa9b,null))[_0xa79f('0x36')](removeEntity(_0x84aa9b,null))[_0xa79f('0x2a')](handleError(_0x84aa9b,null));};exports[_0xa79f('0x58')]=function(_0x4b149d,_0x400723){return db['ChatGroup'][_0xa79f('0x58')]()[_0xa79f('0x36')](respondWithResult(_0x400723,null))[_0xa79f('0x2a')](handleError(_0x400723,null));};exports[_0xa79f('0x59')]=function(_0xbfee0f,_0xfade93,_0x4f4123){return db['ChatInternalMessage'][_0xa79f('0x2f')]({'where':{'ChatGroupId':_0xbfee0f['params']['id'],'ToId':_0xbfee0f[_0xa79f('0x5a')]['id'],'read':![]}})['then'](function(_0x295f68){return{'id':_[_0xa79f('0x5b')](_0xbfee0f[_0xa79f('0x52')]['id']),'count':_0x295f68};})[_0xa79f('0x36')](respondWithResult(_0xfade93,null))[_0xa79f('0x2a')](handleError(_0xfade93,null));};exports[_0xa79f('0x5c')]=function(_0x424816,_0x12b745,_0x1e81d2){return db[_0xa79f('0x3d')][_0xa79f('0x55')]({'where':{'id':_0x424816[_0xa79f('0x52')]['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x12b745,null))[_0xa79f('0x36')](function(_0x45633b){if(_0x45633b){return _0x45633b[_0xa79f('0x5c')](_0x424816['body'][_0xa79f('0x5d')],_[_0xa79f('0x5e')](_0x424816[_0xa79f('0x57')],[_0xa79f('0x5d'),'id'])||{});}})[_0xa79f('0x36')](respondWithResult(_0x12b745,null))[_0xa79f('0x2a')](handleError(_0x12b745,null));};exports[_0xa79f('0x5f')]=function(_0x4a960a,_0x3cc6af,_0x56083b){var _0xe4baf1={};var _0x644e63={};var _0x46d2e6;var _0x2a2b3f;return db[_0xa79f('0x3d')][_0xa79f('0x60')]({'where':{'id':_0x4a960a['params']['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x3cc6af,null))[_0xa79f('0x36')](function(_0x1b51eb){if(_0x1b51eb){_0x46d2e6=_0x1b51eb;_0x644e63[_0xa79f('0x40')]=_[_0xa79f('0x42')](db[_0xa79f('0x61')][_0xa79f('0x53')]);_0x644e63[_0xa79f('0x41')]=_[_0xa79f('0x42')](_0x4a960a['query']);_0x644e63['filters']=_['intersection'](_0x644e63[_0xa79f('0x40')],_0x644e63[_0xa79f('0x41')]);_0xe4baf1[_0xa79f('0x45')]=_[_0xa79f('0x44')](_0x644e63['model'],qs['fields'](_0x4a960a[_0xa79f('0x41')][_0xa79f('0x46')]));_0xe4baf1['attributes']=_0xe4baf1[_0xa79f('0x45')][_0xa79f('0x47')]?_0xe4baf1[_0xa79f('0x45')]:_0x644e63[_0xa79f('0x40')];_0xe4baf1[_0xa79f('0x49')]=qs[_0xa79f('0x62')](_0x4a960a[_0xa79f('0x41')]['sort']);_0xe4baf1[_0xa79f('0x4a')]=qs['filters'](_[_0xa79f('0x4b')](_0x4a960a[_0xa79f('0x41')],_0x644e63['filters']));if(_0x4a960a[_0xa79f('0x41')]['filter']){_0xe4baf1[_0xa79f('0x4a')]=_[_0xa79f('0x54')](_0xe4baf1[_0xa79f('0x4a')],{'$or':_['map'](_0xe4baf1[_0xa79f('0x45')],function(_0x10df41){var _0xae528b={};_0xae528b[_0x10df41]={'$like':'%'+_0x4a960a['query'][_0xa79f('0x4c')]+'%'};return _0xae528b;})});}_0xe4baf1=_[_0xa79f('0x54')]({},_0xe4baf1,_0x4a960a['options']);return _0x46d2e6['getMembers'](_0xe4baf1);}})[_0xa79f('0x36')](function(_0x295135){if(_0x295135){_0x2a2b3f=_0x295135[_0xa79f('0x47')];if(!_0x4a960a['query']['hasOwnProperty'](_0xa79f('0x63'))){_0xe4baf1[_0xa79f('0x31')]=qs[_0xa79f('0x31')](_0x4a960a[_0xa79f('0x41')][_0xa79f('0x31')]);_0xe4baf1[_0xa79f('0x30')]=qs[_0xa79f('0x30')](_0x4a960a[_0xa79f('0x41')][_0xa79f('0x30')]);}return _0x46d2e6[_0xa79f('0x5f')](_0xe4baf1);}})[_0xa79f('0x36')](function(_0x59e5b3){if(_0x59e5b3){return _0x59e5b3?{'count':_0x2a2b3f,'rows':_0x59e5b3}:null;}})[_0xa79f('0x36')](respondWithResult(_0x3cc6af,null))['catch'](handleError(_0x3cc6af,null));};exports[_0xa79f('0x64')]=function(_0x562e7b,_0x589b8f,_0x27e885){return db['ChatGroup'][_0xa79f('0x55')]({'where':{'id':_0x562e7b[_0xa79f('0x52')]['id']}})['then'](handleEntityNotFound(_0x589b8f,null))[_0xa79f('0x36')](function(_0x6f572){if(_0x6f572){return _0x6f572['removeMembers'](_0x562e7b[_0xa79f('0x41')][_0xa79f('0x5d')]);}})[_0xa79f('0x36')](respondWithStatusCode(_0x589b8f,null))['catch'](handleError(_0x589b8f,null));};exports[_0xa79f('0x65')]=function(_0x505869,_0x3fa19c,_0x5aedcd){if(_0x505869[_0xa79f('0x57')]['id']){delete _0x505869[_0xa79f('0x57')]['id'];}return db[_0xa79f('0x3d')][_0xa79f('0x55')]({'where':{'id':_0x505869[_0xa79f('0x52')]['id']}})['then'](handleEntityNotFound(_0x3fa19c,null))[_0xa79f('0x36')](function(_0x4a229f){if(_0x4a229f){_0x505869[_0xa79f('0x57')][_0xa79f('0x66')]=_0x4a229f['id'];return db[_0xa79f('0x67')]['create'](_0x505869['body']);}})[_0xa79f('0x36')](respondWithResult(_0x3fa19c,null))[_0xa79f('0x2a')](handleError(_0x3fa19c,null));};exports[_0xa79f('0x68')]=function(_0x503c7d,_0x4d27d9,_0x368927){var _0x47fced={};var _0x59eb3c={};var _0x3b90e6;var _0xfcbb49;return db[_0xa79f('0x3d')][_0xa79f('0x60')]({'where':{'id':_0x503c7d[_0xa79f('0x52')]['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x4d27d9,null))[_0xa79f('0x36')](function(_0x21202b){if(_0x21202b){_0x3b90e6=_0x21202b;_0x59eb3c[_0xa79f('0x40')]=_[_0xa79f('0x42')](db[_0xa79f('0x67')][_0xa79f('0x53')]);_0x59eb3c[_0xa79f('0x41')]=_[_0xa79f('0x42')](_0x503c7d['query']);_0x59eb3c[_0xa79f('0x43')]=_[_0xa79f('0x44')](_0x59eb3c[_0xa79f('0x40')],_0x59eb3c[_0xa79f('0x41')]);_0x47fced[_0xa79f('0x45')]=_['intersection'](_0x59eb3c['model'],qs['fields'](_0x503c7d[_0xa79f('0x41')][_0xa79f('0x46')]));_0x47fced[_0xa79f('0x45')]=_0x47fced[_0xa79f('0x45')]['length']?_0x47fced['attributes']:_0x59eb3c['model'];_0x47fced[_0xa79f('0x49')]=qs[_0xa79f('0x62')](_0x503c7d['query']['sort']);_0x47fced[_0xa79f('0x4a')]=qs[_0xa79f('0x43')](_[_0xa79f('0x4b')](_0x503c7d[_0xa79f('0x41')],_0x59eb3c['filters']));if(_0x503c7d[_0xa79f('0x41')][_0xa79f('0x4c')]){_0x47fced[_0xa79f('0x4a')]=_[_0xa79f('0x54')](_0x47fced[_0xa79f('0x4a')],{'$or':_['map'](_0x47fced['attributes'],function(_0x2531e2){var _0x251217={};_0x251217[_0x2531e2]={'$like':'%'+_0x503c7d[_0xa79f('0x41')][_0xa79f('0x4c')]+'%'};return _0x251217;})});}if(_0x503c7d[_0xa79f('0x41')][_0xa79f('0x69')]){var _0x472310=_0x503c7d[_0xa79f('0x41')][_0xa79f('0x69')]['split'](',');var _0x40c0e6={};_0x40c0e6[_0x472310[0x0]]={'$gte':moment(_0x472310[0x1])[_0xa79f('0x6a')](_0xa79f('0x6b'))};_0x47fced[_0xa79f('0x4a')]=_[_0xa79f('0x54')](_0x47fced[_0xa79f('0x4a')],_0x40c0e6);}_0x47fced=_['merge']({},_0x47fced,_0x503c7d[_0xa79f('0x4e')]);return _0x3b90e6[_0xa79f('0x68')](_0x47fced);}})['then'](function(_0x547026){if(_0x547026){_0xfcbb49=_0x547026[_0xa79f('0x47')];if(!_0x503c7d['query'][_0xa79f('0x48')](_0xa79f('0x63'))){_0x47fced[_0xa79f('0x31')]=qs[_0xa79f('0x31')](_0x503c7d[_0xa79f('0x41')][_0xa79f('0x31')]);_0x47fced['offset']=qs[_0xa79f('0x30')](_0x503c7d[_0xa79f('0x41')][_0xa79f('0x30')]);}return _0x3b90e6[_0xa79f('0x68')](_0x47fced);}})[_0xa79f('0x36')](function(_0x12c49e){if(_0x12c49e){return _0x12c49e?{'count':_0xfcbb49,'rows':_0x12c49e}:null;}})['then'](respondWithResult(_0x4d27d9,null))['catch'](handleError(_0x4d27d9,null));}; \ No newline at end of file +var _0xaa2d=['where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','length','includeAll','find','create','body','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','keys','sort','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','client','http','Sequelize','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x27f402,_0x343e5b){var _0x234c98=function(_0x162d24){while(--_0x162d24){_0x27f402['push'](_0x27f402['shift']());}};_0x234c98(++_0x343e5b);}(_0xaa2d,0x1df));var _0xdaa2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xaa2d[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdaa2('0x0'));var rimraf=require(_0xdaa2('0x1'));var zipdir=require(_0xdaa2('0x2'));var jsonpatch=require(_0xdaa2('0x3'));var rp=require(_0xdaa2('0x4'));var moment=require(_0xdaa2('0x5'));var BPromise=require(_0xdaa2('0x6'));var Mustache=require(_0xdaa2('0x7'));var util=require(_0xdaa2('0x8'));var path=require(_0xdaa2('0x9'));var sox=require(_0xdaa2('0xa'));var csv=require(_0xdaa2('0xb'));var ejs=require(_0xdaa2('0xc'));var fs=require('fs');var _=require(_0xdaa2('0xd'));var squel=require(_0xdaa2('0xe'));var crypto=require(_0xdaa2('0xf'));var jsforce=require(_0xdaa2('0x10'));var deskjs=require(_0xdaa2('0x11'));var toCsv=require('to-csv');var querystring=require(_0xdaa2('0x12'));var Papa=require(_0xdaa2('0x13'));var Redis=require(_0xdaa2('0x14'));var authService=require(_0xdaa2('0x15'));var qs=require(_0xdaa2('0x16'));var as=require(_0xdaa2('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdaa2('0x18'));var config=require(_0xdaa2('0x19'));var db=require('../../mysqldb')['db'];config[_0xdaa2('0x1a')]=_[_0xdaa2('0x1b')](config[_0xdaa2('0x1a')],{'host':_0xdaa2('0x1c'),'port':0x18eb});var socket=require(_0xdaa2('0x1d'))(new Redis(config[_0xdaa2('0x1a')]));require('./chatGroup.socket')[_0xdaa2('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0xdaa2('0x1f')][_0xdaa2('0x20')]({'port':0x232a});function checkPasswordPattern(_0x21169f,_0x8115d9,_0x250f04){if(_0x250f04){var _0x195e54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x195e54['test'](_0x8115d9)){return _0x21169f;}else{throw new db[(_0xdaa2('0x21'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x21169f;}}function respondWithRpcPromise(_0x451113,_0xb03878,_0x37b5f9,_0x4f9782){return new BPromise(function(_0x288c2d,_0x24f31e){var _0x3919f9=_0x4f9782||client;return _0x3919f9[_0xdaa2('0x22')](_0x451113,_0x37b5f9)[_0xdaa2('0x23')](function(_0x21c968){logger[_0xdaa2('0x24')](_0xdaa2('0x25'),_0xb03878,_0xdaa2('0x26'));logger[_0xdaa2('0x27')](_0xdaa2('0x28'),_0xb03878,_0xdaa2('0x26'),JSON[_0xdaa2('0x29')](_0x21c968));if(_0x21c968[_0xdaa2('0x2a')]){if(_0x21c968[_0xdaa2('0x2a')][_0xdaa2('0x2b')]===0x1f4){logger[_0xdaa2('0x2a')]('ChatGroup,\x20%s,\x20%s',_0xb03878,_0x21c968['error'][_0xdaa2('0x2c')]);return _0x24f31e(_0x21c968[_0xdaa2('0x2a')][_0xdaa2('0x2c')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0xb03878,_0x21c968[_0xdaa2('0x2a')][_0xdaa2('0x2c')]);return _0x288c2d(_0x21c968[_0xdaa2('0x2a')]['message']);}else{logger[_0xdaa2('0x24')]('ChatGroup,\x20%s,\x20%s',_0xb03878,_0xdaa2('0x26'));_0x288c2d(_0x21c968[_0xdaa2('0x2d')][_0xdaa2('0x2c')]);}})[_0xdaa2('0x2e')](function(_0xc6664b){logger[_0xdaa2('0x2a')](_0xdaa2('0x25'),_0xb03878,_0xc6664b);_0x24f31e(_0xc6664b);});});}function respondWithStatusCode(_0x3da7ca,_0x20687f){_0x20687f=_0x20687f||0xcc;return function(_0x1d8e2f){if(_0x1d8e2f){return _0x3da7ca[_0xdaa2('0x2f')](_0x20687f);}return _0x3da7ca[_0xdaa2('0x30')](_0x20687f)['end']();};}function respondWithResult(_0xb8167,_0x5de1a9){_0x5de1a9=_0x5de1a9||0xc8;return function(_0x573edc){if(_0x573edc){return _0xb8167[_0xdaa2('0x30')](_0x5de1a9)[_0xdaa2('0x31')](_0x573edc);}};}function respondWithFilteredResult(_0xfb8d2e,_0x318f94){return function(_0x513bb5){if(_0x513bb5){var _0xfa59d3=_0x513bb5[_0xdaa2('0x32')],_0x5e5abc=_0x318f94[_0xdaa2('0x33')],_0x468912=_0x318f94[_0xdaa2('0x33')]+_0x318f94[_0xdaa2('0x34')],_0x2c9344;if(_0x468912>=_0xfa59d3){_0x468912=_0xfa59d3;_0x2c9344=0xc8;}else{_0x2c9344=0xce;}_0xfb8d2e['status'](_0x2c9344);return _0xfb8d2e[_0xdaa2('0x35')](_0xdaa2('0x36'),_0x5e5abc+'-'+_0x468912+'/'+_0xfa59d3)['json'](_0x513bb5);}return null;};}function patchUpdates(_0x56a1e6){return function(_0x5462e6){try{jsonpatch[_0xdaa2('0x37')](_0x5462e6,_0x56a1e6,!![]);}catch(_0x4a3791){return BPromise[_0xdaa2('0x38')](_0x4a3791);}return _0x5462e6['save']();};}function saveUpdates(_0x54e681,_0x5ee8e3){return function(_0x41bdb7){if(_0x41bdb7){return _0x41bdb7[_0xdaa2('0x39')](_0x54e681)[_0xdaa2('0x23')](function(_0x4d58d5){return _0x4d58d5;});}return null;};}function removeEntity(_0x573d5d,_0x41d387){return function(_0x2b4a82){if(_0x2b4a82){return _0x2b4a82[_0xdaa2('0x3a')]()[_0xdaa2('0x23')](function(){_0x573d5d[_0xdaa2('0x30')](0xcc)[_0xdaa2('0x3b')]();});}};}function handleEntityNotFound(_0x2715a8,_0x476bb5){return function(_0x436a81){if(!_0x436a81){_0x2715a8['sendStatus'](0x194);}return _0x436a81;};}function handleError(_0x3b36b8,_0xdc1de7){_0xdc1de7=_0xdc1de7||0x1f4;return function(_0x24928d){logger[_0xdaa2('0x2a')](_0x24928d['stack']);if(_0x24928d[_0xdaa2('0x3c')]){delete _0x24928d[_0xdaa2('0x3c')];}_0x3b36b8['status'](_0xdc1de7)[_0xdaa2('0x3d')](_0x24928d);};}exports[_0xdaa2('0x3e')]=function(_0x4d8d73,_0x2cca44){var _0x35c57e={},_0x143d84={},_0x574bed={'count':0x0,'rows':[]};var _0x56ff65=_[_0xdaa2('0x3f')](db[_0xdaa2('0x40')][_0xdaa2('0x41')],function(_0x40378c){return{'name':_0x40378c[_0xdaa2('0x42')],'type':_0x40378c['type'][_0xdaa2('0x43')]};});_0x143d84['model']=_[_0xdaa2('0x3f')](_0x56ff65,_0xdaa2('0x3c'));_0x143d84[_0xdaa2('0x44')]=_['keys'](_0x4d8d73[_0xdaa2('0x44')]);_0x143d84['filters']=_[_0xdaa2('0x45')](_0x143d84[_0xdaa2('0x46')],_0x143d84['query']);_0x35c57e[_0xdaa2('0x47')]=_[_0xdaa2('0x45')](_0x143d84['model'],qs[_0xdaa2('0x48')](_0x4d8d73[_0xdaa2('0x44')][_0xdaa2('0x48')]));_0x35c57e['attributes']=_0x35c57e[_0xdaa2('0x47')]['length']?_0x35c57e['attributes']:_0x143d84['model'];if(!_0x4d8d73[_0xdaa2('0x44')][_0xdaa2('0x49')](_0xdaa2('0x4a'))){_0x35c57e[_0xdaa2('0x34')]=qs['limit'](_0x4d8d73[_0xdaa2('0x44')][_0xdaa2('0x34')]);_0x35c57e[_0xdaa2('0x33')]=qs[_0xdaa2('0x33')](_0x4d8d73['query']['offset']);}_0x35c57e[_0xdaa2('0x4b')]=qs['sort'](_0x4d8d73[_0xdaa2('0x44')]['sort']);_0x35c57e[_0xdaa2('0x4c')]=qs[_0xdaa2('0x4d')](_[_0xdaa2('0x4e')](_0x4d8d73[_0xdaa2('0x44')],_0x143d84[_0xdaa2('0x4d')]));if(_0x4d8d73[_0xdaa2('0x44')][_0xdaa2('0x4f')]){_0x35c57e[_0xdaa2('0x4c')]=_[_0xdaa2('0x50')](_0x35c57e[_0xdaa2('0x4c')],{'$or':_[_0xdaa2('0x3f')](_0x56ff65,function(_0x613937){if(_0x613937['type']!==_0xdaa2('0x51')){var _0x5dc7d5={};_0x5dc7d5[_0x613937[_0xdaa2('0x3c')]]={'$like':'%'+_0x4d8d73[_0xdaa2('0x44')]['filter']+'%'};return _0x5dc7d5;}})});}_0x35c57e=_[_0xdaa2('0x50')]({},_0x35c57e,_0x4d8d73[_0xdaa2('0x52')]);var _0x22cc51={'where':_0x35c57e[_0xdaa2('0x4c')]};return db['ChatGroup']['count'](_0x22cc51)[_0xdaa2('0x23')](function(_0x3f0577){_0x574bed[_0xdaa2('0x32')]=_0x3f0577;if(_0x4d8d73['query']['includeAll']){_0x35c57e[_0xdaa2('0x53')]=[{'all':!![]}];}return db[_0xdaa2('0x40')][_0xdaa2('0x54')](_0x35c57e);})[_0xdaa2('0x23')](function(_0x42b1ba){_0x574bed['rows']=_0x42b1ba;return _0x574bed;})[_0xdaa2('0x23')](respondWithFilteredResult(_0x2cca44,_0x35c57e))[_0xdaa2('0x2e')](handleError(_0x2cca44,null));};exports[_0xdaa2('0x55')]=function(_0x34a9f,_0x30ab40){var _0xb858c0={'raw':!![],'where':{'id':_0x34a9f[_0xdaa2('0x56')]['id']}},_0x48bd6b={};_0x48bd6b[_0xdaa2('0x46')]=_['keys'](db[_0xdaa2('0x40')][_0xdaa2('0x41')]);_0x48bd6b['query']=_['keys'](_0x34a9f['query']);_0x48bd6b[_0xdaa2('0x4d')]=_[_0xdaa2('0x45')](_0x48bd6b[_0xdaa2('0x46')],_0x48bd6b[_0xdaa2('0x44')]);_0xb858c0[_0xdaa2('0x47')]=_[_0xdaa2('0x45')](_0x48bd6b[_0xdaa2('0x46')],qs[_0xdaa2('0x48')](_0x34a9f['query'][_0xdaa2('0x48')]));_0xb858c0[_0xdaa2('0x47')]=_0xb858c0[_0xdaa2('0x47')][_0xdaa2('0x57')]?_0xb858c0[_0xdaa2('0x47')]:_0x48bd6b[_0xdaa2('0x46')];if(_0x34a9f[_0xdaa2('0x44')][_0xdaa2('0x58')]){_0xb858c0[_0xdaa2('0x53')]=[{'all':!![]}];}_0xb858c0=_[_0xdaa2('0x50')]({},_0xb858c0,_0x34a9f[_0xdaa2('0x52')]);return db['ChatGroup'][_0xdaa2('0x59')](_0xb858c0)['then'](handleEntityNotFound(_0x30ab40,null))['then'](respondWithResult(_0x30ab40,null))[_0xdaa2('0x2e')](handleError(_0x30ab40,null));};exports[_0xdaa2('0x5a')]=function(_0x32d206,_0x31225e){return db['ChatGroup'][_0xdaa2('0x5a')](_0x32d206['body'],{})[_0xdaa2('0x23')](respondWithResult(_0x31225e,0xc9))[_0xdaa2('0x2e')](handleError(_0x31225e,null));};exports[_0xdaa2('0x39')]=function(_0x49eb55,_0x15d117){if(_0x49eb55[_0xdaa2('0x5b')]['id']){delete _0x49eb55[_0xdaa2('0x5b')]['id'];}return db[_0xdaa2('0x40')][_0xdaa2('0x59')]({'where':{'id':_0x49eb55[_0xdaa2('0x56')]['id']}})[_0xdaa2('0x23')](handleEntityNotFound(_0x15d117,null))['then'](saveUpdates(_0x49eb55['body'],null))[_0xdaa2('0x23')](respondWithResult(_0x15d117,null))['catch'](handleError(_0x15d117,null));};exports['destroy']=function(_0x391f73,_0x9b60f6){return db[_0xdaa2('0x40')][_0xdaa2('0x59')]({'where':{'id':_0x391f73[_0xdaa2('0x56')]['id']}})['then'](handleEntityNotFound(_0x9b60f6,null))[_0xdaa2('0x23')](removeEntity(_0x9b60f6,null))['catch'](handleError(_0x9b60f6,null));};exports[_0xdaa2('0x5c')]=function(_0x2b4e87,_0x358da5){return db[_0xdaa2('0x40')]['describe']()[_0xdaa2('0x23')](respondWithResult(_0x358da5,null))[_0xdaa2('0x2e')](handleError(_0x358da5,null));};exports['getUnread']=function(_0x2569a4,_0x2ccd9e,_0x2f43a4){return db['ChatInternalMessage'][_0xdaa2('0x32')]({'where':{'ChatGroupId':_0x2569a4['params']['id'],'ToId':_0x2569a4[_0xdaa2('0x5d')]['id'],'read':![]}})[_0xdaa2('0x23')](function(_0x10bd54){return{'id':_[_0xdaa2('0x5e')](_0x2569a4[_0xdaa2('0x56')]['id']),'count':_0x10bd54};})['then'](respondWithResult(_0x2ccd9e,null))[_0xdaa2('0x2e')](handleError(_0x2ccd9e,null));};exports[_0xdaa2('0x5f')]=function(_0x2f6a45,_0x28d71a,_0x2d5497){return db[_0xdaa2('0x40')]['find']({'where':{'id':_0x2f6a45[_0xdaa2('0x56')]['id']}})[_0xdaa2('0x23')](handleEntityNotFound(_0x28d71a,null))[_0xdaa2('0x23')](function(_0x35b6ff){if(_0x35b6ff){return _0x35b6ff['addMembers'](_0x2f6a45[_0xdaa2('0x5b')][_0xdaa2('0x60')],_[_0xdaa2('0x61')](_0x2f6a45['body'],[_0xdaa2('0x60'),'id'])||{});}})['then'](respondWithResult(_0x28d71a,null))['catch'](handleError(_0x28d71a,null));};exports[_0xdaa2('0x62')]=function(_0x3963ab,_0x293fd9,_0x25e25d){var _0x3fa79a={};var _0x78a285={};var _0x29e414;var _0x53e269;return db[_0xdaa2('0x40')][_0xdaa2('0x63')]({'where':{'id':_0x3963ab[_0xdaa2('0x56')]['id']}})[_0xdaa2('0x23')](handleEntityNotFound(_0x293fd9,null))['then'](function(_0x35430d){if(_0x35430d){_0x29e414=_0x35430d;_0x78a285[_0xdaa2('0x46')]=_['keys'](db[_0xdaa2('0x64')][_0xdaa2('0x41')]);_0x78a285[_0xdaa2('0x44')]=_[_0xdaa2('0x65')](_0x3963ab[_0xdaa2('0x44')]);_0x78a285[_0xdaa2('0x4d')]=_[_0xdaa2('0x45')](_0x78a285['model'],_0x78a285[_0xdaa2('0x44')]);_0x3fa79a['attributes']=_[_0xdaa2('0x45')](_0x78a285[_0xdaa2('0x46')],qs[_0xdaa2('0x48')](_0x3963ab[_0xdaa2('0x44')]['fields']));_0x3fa79a['attributes']=_0x3fa79a['attributes'][_0xdaa2('0x57')]?_0x3fa79a[_0xdaa2('0x47')]:_0x78a285[_0xdaa2('0x46')];_0x3fa79a[_0xdaa2('0x4b')]=qs[_0xdaa2('0x66')](_0x3963ab[_0xdaa2('0x44')][_0xdaa2('0x66')]);_0x3fa79a[_0xdaa2('0x4c')]=qs[_0xdaa2('0x4d')](_[_0xdaa2('0x4e')](_0x3963ab['query'],_0x78a285[_0xdaa2('0x4d')]));if(_0x3963ab[_0xdaa2('0x44')]['filter']){_0x3fa79a[_0xdaa2('0x4c')]=_['merge'](_0x3fa79a['where'],{'$or':_[_0xdaa2('0x3f')](_0x3fa79a['attributes'],function(_0xecd726){var _0xeb29ea={};_0xeb29ea[_0xecd726]={'$like':'%'+_0x3963ab[_0xdaa2('0x44')][_0xdaa2('0x4f')]+'%'};return _0xeb29ea;})});}_0x3fa79a=_[_0xdaa2('0x50')]({},_0x3fa79a,_0x3963ab['options']);return _0x29e414[_0xdaa2('0x62')](_0x3fa79a);}})[_0xdaa2('0x23')](function(_0x28a1e5){if(_0x28a1e5){_0x53e269=_0x28a1e5['length'];if(!_0x3963ab['query'][_0xdaa2('0x49')](_0xdaa2('0x4a'))){_0x3fa79a['limit']=qs[_0xdaa2('0x34')](_0x3963ab[_0xdaa2('0x44')][_0xdaa2('0x34')]);_0x3fa79a[_0xdaa2('0x33')]=qs[_0xdaa2('0x33')](_0x3963ab[_0xdaa2('0x44')][_0xdaa2('0x33')]);}return _0x29e414[_0xdaa2('0x62')](_0x3fa79a);}})['then'](function(_0x572c90){if(_0x572c90){return _0x572c90?{'count':_0x53e269,'rows':_0x572c90}:null;}})[_0xdaa2('0x23')](respondWithResult(_0x293fd9,null))[_0xdaa2('0x2e')](handleError(_0x293fd9,null));};exports[_0xdaa2('0x67')]=function(_0x4a156b,_0x10cc1e,_0x5b748c){return db[_0xdaa2('0x40')][_0xdaa2('0x59')]({'where':{'id':_0x4a156b[_0xdaa2('0x56')]['id']}})[_0xdaa2('0x23')](handleEntityNotFound(_0x10cc1e,null))[_0xdaa2('0x23')](function(_0x4a178b){if(_0x4a178b){return _0x4a178b[_0xdaa2('0x67')](_0x4a156b[_0xdaa2('0x44')][_0xdaa2('0x60')]);}})[_0xdaa2('0x23')](respondWithStatusCode(_0x10cc1e,null))[_0xdaa2('0x2e')](handleError(_0x10cc1e,null));};exports[_0xdaa2('0x68')]=function(_0x4ce975,_0x5ce670,_0x46f00a){if(_0x4ce975[_0xdaa2('0x5b')]['id']){delete _0x4ce975['body']['id'];}return db[_0xdaa2('0x40')][_0xdaa2('0x59')]({'where':{'id':_0x4ce975['params']['id']}})[_0xdaa2('0x23')](handleEntityNotFound(_0x5ce670,null))[_0xdaa2('0x23')](function(_0x4d5f81){if(_0x4d5f81){_0x4ce975['body'][_0xdaa2('0x69')]=_0x4d5f81['id'];return db[_0xdaa2('0x6a')][_0xdaa2('0x5a')](_0x4ce975[_0xdaa2('0x5b')]);}})['then'](respondWithResult(_0x5ce670,null))[_0xdaa2('0x2e')](handleError(_0x5ce670,null));};exports[_0xdaa2('0x6b')]=function(_0x3fbe8d,_0x3e84b1,_0x3ea270){var _0x5b6a1f={};var _0x3faf19={};var _0x1a7d1a;var _0x2a7b05;return db['ChatGroup'][_0xdaa2('0x63')]({'where':{'id':_0x3fbe8d[_0xdaa2('0x56')]['id']}})[_0xdaa2('0x23')](handleEntityNotFound(_0x3e84b1,null))['then'](function(_0x52d1c7){if(_0x52d1c7){_0x1a7d1a=_0x52d1c7;_0x3faf19['model']=_[_0xdaa2('0x65')](db['ChatInternalMessage']['rawAttributes']);_0x3faf19[_0xdaa2('0x44')]=_['keys'](_0x3fbe8d[_0xdaa2('0x44')]);_0x3faf19[_0xdaa2('0x4d')]=_['intersection'](_0x3faf19[_0xdaa2('0x46')],_0x3faf19[_0xdaa2('0x44')]);_0x5b6a1f[_0xdaa2('0x47')]=_[_0xdaa2('0x45')](_0x3faf19[_0xdaa2('0x46')],qs[_0xdaa2('0x48')](_0x3fbe8d[_0xdaa2('0x44')][_0xdaa2('0x48')]));_0x5b6a1f[_0xdaa2('0x47')]=_0x5b6a1f[_0xdaa2('0x47')]['length']?_0x5b6a1f[_0xdaa2('0x47')]:_0x3faf19[_0xdaa2('0x46')];_0x5b6a1f['order']=qs['sort'](_0x3fbe8d[_0xdaa2('0x44')][_0xdaa2('0x66')]);_0x5b6a1f[_0xdaa2('0x4c')]=qs[_0xdaa2('0x4d')](_[_0xdaa2('0x4e')](_0x3fbe8d[_0xdaa2('0x44')],_0x3faf19[_0xdaa2('0x4d')]));if(_0x3fbe8d['query'][_0xdaa2('0x4f')]){_0x5b6a1f[_0xdaa2('0x4c')]=_['merge'](_0x5b6a1f[_0xdaa2('0x4c')],{'$or':_[_0xdaa2('0x3f')](_0x5b6a1f[_0xdaa2('0x47')],function(_0x53ad30){var _0x58336c={};_0x58336c[_0x53ad30]={'$like':'%'+_0x3fbe8d['query'][_0xdaa2('0x4f')]+'%'};return _0x58336c;})});}if(_0x3fbe8d[_0xdaa2('0x44')]['$gte']){var _0x409544=_0x3fbe8d[_0xdaa2('0x44')][_0xdaa2('0x6c')]['split'](',');var _0x1c88ee={};_0x1c88ee[_0x409544[0x0]]={'$gte':moment(_0x409544[0x1])[_0xdaa2('0x6d')](_0xdaa2('0x6e'))};_0x5b6a1f[_0xdaa2('0x4c')]=_[_0xdaa2('0x50')](_0x5b6a1f['where'],_0x1c88ee);}_0x5b6a1f=_['merge']({},_0x5b6a1f,_0x3fbe8d[_0xdaa2('0x52')]);return _0x1a7d1a[_0xdaa2('0x6b')](_0x5b6a1f);}})[_0xdaa2('0x23')](function(_0x3df114){if(_0x3df114){_0x2a7b05=_0x3df114[_0xdaa2('0x57')];if(!_0x3fbe8d[_0xdaa2('0x44')][_0xdaa2('0x49')](_0xdaa2('0x4a'))){_0x5b6a1f[_0xdaa2('0x34')]=qs['limit'](_0x3fbe8d[_0xdaa2('0x44')][_0xdaa2('0x34')]);_0x5b6a1f[_0xdaa2('0x33')]=qs[_0xdaa2('0x33')](_0x3fbe8d[_0xdaa2('0x44')][_0xdaa2('0x33')]);}return _0x1a7d1a['getMessages'](_0x5b6a1f);}})[_0xdaa2('0x23')](function(_0x3ac8f5){if(_0x3ac8f5){return _0x3ac8f5?{'count':_0x2a7b05,'rows':_0x3ac8f5}:null;}})[_0xdaa2('0x23')](respondWithResult(_0x3e84b1,null))[_0xdaa2('0x2e')](handleError(_0x3e84b1,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index c393b07..01e17be 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 _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x357a27,_0x19244b){var _0x2fc70a=function(_0x3f787e){while(--_0x3f787e){_0x357a27['push'](_0x357a27['shift']());}};_0x2fc70a(++_0x19244b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e4c55,_0x1415eb){_0x1e4c55=_0x1e4c55-0x0;var _0x511ab5=_0xb10b[_0x1e4c55];return _0x511ab5;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +var _0x2032=['exports','../../mysqldb','ChatGroup','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x256b72,_0x340985){var _0x2183e3=function(_0xf7fd37){while(--_0xf7fd37){_0x256b72['push'](_0x256b72['shift']());}};_0x2183e3(++_0x340985);}(_0x2032,0xd9));var _0x2203=function(_0x3d3232,_0x221f17){_0x3d3232=_0x3d3232-0x0;var _0x1b6fc7=_0x2032[_0x3d3232];return _0x1b6fc7;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x2203('0x0'))['db'][_0x2203('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2203('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2203('0x3'),'afterDestroy':_0x2203('0x4')};function emitEvent(_0x4b4c7f){return function(_0x46c49a,_0x880dcd,_0x44ccfd){ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f+':'+_0x46c49a['id'],_0x46c49a);ChatGroupEvents[_0x2203('0x5')](_0x4b4c7f,_0x46c49a);_0x44ccfd(null);};}for(var e in events){if(events[_0x2203('0x6')](e)){var event=events[e];ChatGroup[_0x2203('0x7')](e,emitEvent(event));}}module[_0x2203('0x8')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 9adb3df..9da9c9d 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 _0x0309=['rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x0309,0x165));var _0x9030=function(_0x554915,_0x5ea123){_0x554915=_0x554915-0x0;var _0x2fbdaf=_0x0309[_0x554915];return _0x2fbdaf;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var logger=require(_0x9030('0x1'))('api');var moment=require(_0x9030('0x2'));var BPromise=require(_0x9030('0x3'));var rp=require(_0x9030('0x4'));var fs=require('fs');var path=require(_0x9030('0x5'));var rimraf=require(_0x9030('0x6'));var config=require(_0x9030('0x7'));var attributes=require(_0x9030('0x8'));module['exports']=function(_0x5a3334,_0x1c9c7b){return _0x5a3334[_0x9030('0x9')]('ChatGroup',attributes,{'tableName':_0x9030('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabe8=['lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./chatGroup.attributes','exports','chat_groups'];(function(_0x243217,_0x522951){var _0x478029=function(_0x18d053){while(--_0x18d053){_0x243217['push'](_0x243217['shift']());}};_0x478029(++_0x522951);}(_0xabe8,0x8c));var _0x8abe=function(_0x2705ee,_0x2a16bf){_0x2705ee=_0x2705ee-0x0;var _0x1402e8=_0xabe8[_0x2705ee];return _0x1402e8;};'use strict';var _=require(_0x8abe('0x0'));var util=require(_0x8abe('0x1'));var logger=require(_0x8abe('0x2'))('api');var moment=require(_0x8abe('0x3'));var BPromise=require(_0x8abe('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8abe('0x5'));var rimraf=require('rimraf');var config=require(_0x8abe('0x6'));var attributes=require(_0x8abe('0x7'));module[_0x8abe('0x8')]=function(_0x3a24e6,_0x7619bb){return _0x3a24e6['define']('ChatGroup',attributes,{'tableName':_0x8abe('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 b8a4b37..54e9427 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 _0xaa2e=['error','code','message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaa2e,0x13b));var _0xeaa2=function(_0x28cb01,_0x36ee62){_0x28cb01=_0x28cb01-0x0;var _0x3a92c5=_0xaa2e[_0x28cb01];return _0x3a92c5;};'use strict';var _=require(_0xeaa2('0x0'));var util=require(_0xeaa2('0x1'));var moment=require(_0xeaa2('0x2'));var BPromise=require('bluebird');var rs=require(_0xeaa2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaa2('0x4'))['db'];var utils=require(_0xeaa2('0x5'));var logger=require(_0xeaa2('0x6'))(_0xeaa2('0x7'));var config=require(_0xeaa2('0x8'));var jayson=require(_0xeaa2('0x9'));var client=jayson[_0xeaa2('0xa')][_0xeaa2('0xb')]({'port':0x232a});config[_0xeaa2('0xc')]=_['defaults'](config['redis'],{'host':_0xeaa2('0xd'),'port':0x18eb});var socket=require(_0xeaa2('0xe'))(new Redis(config['redis']));require(_0xeaa2('0xf'))[_0xeaa2('0x10')](socket);function respondWithRpcPromise(_0x283b3b,_0x160ae5,_0x171ec1){return new BPromise(function(_0x5cd601,_0x35c4b6){return client['request'](_0x283b3b,_0x171ec1)[_0xeaa2('0x11')](function(_0xe73dfd){logger[_0xeaa2('0x12')](_0xeaa2('0x13'),_0x160ae5,_0xeaa2('0x14'));logger[_0xeaa2('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x160ae5,_0xeaa2('0x14'),JSON[_0xeaa2('0x16')](_0xe73dfd));if(_0xe73dfd['error']){if(_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x18')]===0x1f4){logger[_0xeaa2('0x17')](_0xeaa2('0x13'),_0x160ae5,_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);return _0x35c4b6(_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);}logger[_0xeaa2('0x17')](_0xeaa2('0x13'),_0x160ae5,_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);return _0x5cd601(_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);}else{logger[_0xeaa2('0x12')]('ChatGroup,\x20%s,\x20%s',_0x160ae5,_0xeaa2('0x14'));_0x5cd601(_0xe73dfd['result'][_0xeaa2('0x19')]);}})['catch'](function(_0x52c7e6){logger[_0xeaa2('0x17')]('ChatGroup,\x20%s,\x20%s',_0x160ae5,_0x52c7e6);_0x35c4b6(_0x52c7e6);});});} \ No newline at end of file +var _0x8faf=['../../config/utils','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x8faf,0x111));var _0xf8fa=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x8faf[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xf8fa('0x0'));var util=require(_0xf8fa('0x1'));var moment=require(_0xf8fa('0x2'));var BPromise=require(_0xf8fa('0x3'));var rs=require(_0xf8fa('0x4'));var fs=require('fs');var Redis=require(_0xf8fa('0x5'));var db=require(_0xf8fa('0x6'))['db'];var utils=require(_0xf8fa('0x7'));var logger=require(_0xf8fa('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf8fa('0x9'));var client=jayson[_0xf8fa('0xa')][_0xf8fa('0xb')]({'port':0x232a});config[_0xf8fa('0xc')]=_[_0xf8fa('0xd')](config['redis'],{'host':_0xf8fa('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf8fa('0xc')]));require(_0xf8fa('0xf'))[_0xf8fa('0x10')](socket);function respondWithRpcPromise(_0x1f4100,_0x2346cf,_0x581248){return new BPromise(function(_0x36a5ba,_0x18acb1){return client[_0xf8fa('0x11')](_0x1f4100,_0x581248)[_0xf8fa('0x12')](function(_0xd07dc9){logger[_0xf8fa('0x13')](_0xf8fa('0x14'),_0x2346cf,_0xf8fa('0x15'));logger['debug'](_0xf8fa('0x16'),_0x2346cf,'request\x20sent',JSON[_0xf8fa('0x17')](_0xd07dc9));if(_0xd07dc9[_0xf8fa('0x18')]){if(_0xd07dc9[_0xf8fa('0x18')]['code']===0x1f4){logger['error'](_0xf8fa('0x14'),_0x2346cf,_0xd07dc9[_0xf8fa('0x18')][_0xf8fa('0x19')]);return _0x18acb1(_0xd07dc9[_0xf8fa('0x18')][_0xf8fa('0x19')]);}logger[_0xf8fa('0x18')](_0xf8fa('0x14'),_0x2346cf,_0xd07dc9[_0xf8fa('0x18')][_0xf8fa('0x19')]);return _0x36a5ba(_0xd07dc9['error']['message']);}else{logger[_0xf8fa('0x13')](_0xf8fa('0x14'),_0x2346cf,_0xf8fa('0x15'));_0x36a5ba(_0xd07dc9[_0xf8fa('0x1a')]['message']);}})[_0xf8fa('0x1b')](function(_0x1dffb7){logger['error']('ChatGroup,\x20%s,\x20%s',_0x2346cf,_0x1dffb7);_0x18acb1(_0x1dffb7);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index da5b0f0..bcfaec6 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 _0xcd2d=['chatGroup:','./chatGroup.events','remove','emit','removeListener'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0xcd2d,0x1c8));var _0xdcd2=function(_0x279fda,_0x365773){_0x279fda=_0x279fda-0x0;var _0x17a5e8=_0xcd2d[_0x279fda];return _0x17a5e8;};'use strict';var ChatGroupEvents=require(_0xdcd2('0x0'));var events=['save',_0xdcd2('0x1'),'update'];function createListener(_0x55f457,_0x288081){return function(_0x17be9e){_0x288081[_0xdcd2('0x2')](_0x55f457,_0x17be9e);};}function removeListener(_0x541627,_0x2ad842){return function(){ChatGroupEvents[_0xdcd2('0x3')](_0x541627,_0x2ad842);};}exports['register']=function(_0x580377){for(var _0x35163e=0x0,_0x791241=events['length'];_0x35163e<_0x791241;_0x35163e++){var _0x566647=events[_0x35163e];var _0x5dcbf4=createListener(_0xdcd2('0x4')+_0x566647,_0x580377);ChatGroupEvents['on'](_0x566647,_0x5dcbf4);}}; \ No newline at end of file +var _0x390e=['remove','update','emit','register','chatGroup:','./chatGroup.events','save'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x390e,0x155));var _0xe390=function(_0x44df0c,_0x2a861b){_0x44df0c=_0x44df0c-0x0;var _0x2aa15c=_0x390e[_0x44df0c];return _0x2aa15c;};'use strict';var ChatGroupEvents=require(_0xe390('0x0'));var events=[_0xe390('0x1'),_0xe390('0x2'),_0xe390('0x3')];function createListener(_0x5e5e04,_0x32a447){return function(_0x1b09e7){_0x32a447[_0xe390('0x4')](_0x5e5e04,_0x1b09e7);};}function removeListener(_0x19f544,_0x314b7f){return function(){ChatGroupEvents['removeListener'](_0x19f544,_0x314b7f);};}exports[_0xe390('0x5')]=function(_0x3606fa){for(var _0x533a1f=0x0,_0x204dc0=events['length'];_0x533a1f<_0x204dc0;_0x533a1f++){var _0xac0d3f=events[_0x533a1f];var _0x2b08df=createListener(_0xe390('0x6')+_0xac0d3f,_0x3606fa);ChatGroupEvents['on'](_0xac0d3f,_0x2b08df);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e8363e1..7cdffa2 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 _0x1037=['/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMembers'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x1037,0xf4));var _0x7103=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0x1037[_0x1f83a5];return _0x45edf0;};'use strict';var multer=require('multer');var util=require(_0x7103('0x0'));var path=require(_0x7103('0x1'));var timeout=require(_0x7103('0x2'));var express=require(_0x7103('0x3'));var router=express[_0x7103('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7103('0x5'));var config=require(_0x7103('0x6'));var controller=require(_0x7103('0x7'));router[_0x7103('0x8')]('/',auth[_0x7103('0x9')](),controller[_0x7103('0xa')]);router['get'](_0x7103('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7103('0x8')](_0x7103('0xc'),auth[_0x7103('0x9')](),controller[_0x7103('0xd')]);router[_0x7103('0x8')](_0x7103('0xe'),auth[_0x7103('0x9')](),controller[_0x7103('0xf')]);router[_0x7103('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x7103('0x10')]);router[_0x7103('0x8')](_0x7103('0x11'),auth['isAuthenticated'](),controller[_0x7103('0x12')]);router[_0x7103('0x13')]('/',auth[_0x7103('0x9')](),controller[_0x7103('0x14')]);router[_0x7103('0x13')](_0x7103('0x15'),auth[_0x7103('0x9')](),controller[_0x7103('0x16')]);router[_0x7103('0x13')](_0x7103('0x11'),auth[_0x7103('0x9')](),controller[_0x7103('0x17')]);router['put'](_0x7103('0xc'),auth[_0x7103('0x9')](),controller[_0x7103('0x18')]);router[_0x7103('0x19')]('/:id',auth[_0x7103('0x9')](),controller[_0x7103('0x1a')]);router[_0x7103('0x19')](_0x7103('0x15'),auth[_0x7103('0x9')](),controller[_0x7103('0x1b')]);module[_0x7103('0x1c')]=router; \ No newline at end of file +var _0x2c5a=['../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/:id','show','getMembers','getMessages','post','create','/:id/members','addMembers','/:id/messages','addMessage','update','delete','destroy','removeMembers','multer','util','path','express','Router','../../components/auth/service'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0x2c5a,0xa9));var _0xa2c5=function(_0x350b46,_0x54944e){_0x350b46=_0x350b46-0x0;var _0x32f7c6=_0x2c5a[_0x350b46];return _0x32f7c6;};'use strict';var multer=require(_0xa2c5('0x0'));var util=require(_0xa2c5('0x1'));var path=require(_0xa2c5('0x2'));var timeout=require('connect-timeout');var express=require(_0xa2c5('0x3'));var router=express[_0xa2c5('0x4')]();var auth=require(_0xa2c5('0x5'));var interaction=require(_0xa2c5('0x6'));var config=require(_0xa2c5('0x7'));var controller=require(_0xa2c5('0x8'));router[_0xa2c5('0x9')]('/',auth[_0xa2c5('0xa')](),controller['index']);router[_0xa2c5('0x9')]('/describe',auth[_0xa2c5('0xa')](),controller['describe']);router['get'](_0xa2c5('0xb'),auth[_0xa2c5('0xa')](),controller[_0xa2c5('0xc')]);router[_0xa2c5('0x9')]('/:id/unread',auth['isAuthenticated'](),controller['getUnread']);router[_0xa2c5('0x9')]('/:id/members',auth['isAuthenticated'](),controller[_0xa2c5('0xd')]);router['get']('/:id/messages',auth[_0xa2c5('0xa')](),controller[_0xa2c5('0xe')]);router[_0xa2c5('0xf')]('/',auth[_0xa2c5('0xa')](),controller[_0xa2c5('0x10')]);router[_0xa2c5('0xf')](_0xa2c5('0x11'),auth[_0xa2c5('0xa')](),controller[_0xa2c5('0x12')]);router[_0xa2c5('0xf')](_0xa2c5('0x13'),auth[_0xa2c5('0xa')](),controller[_0xa2c5('0x14')]);router['put'](_0xa2c5('0xb'),auth[_0xa2c5('0xa')](),controller[_0xa2c5('0x15')]);router[_0xa2c5('0x16')](_0xa2c5('0xb'),auth['isAuthenticated'](),controller[_0xa2c5('0x17')]);router[_0xa2c5('0x16')](_0xa2c5('0x11'),auth[_0xa2c5('0xa')](),controller[_0xa2c5('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 0fe5e00..cd518d2 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 _0x3902=['DATE','long','out','sequelize','ENUM','star','thumb','TEXT','STRING'];(function(_0x35e31e,_0x2a70a7){var _0x281b37=function(_0x194b8f){while(--_0x194b8f){_0x35e31e['push'](_0x35e31e['shift']());}};_0x281b37(++_0x2a70a7);}(_0x3902,0xe4));var _0x2390=function(_0xddf7f,_0x51f6a4){_0xddf7f=_0xddf7f-0x0;var _0x3bdfb8=_0x3902[_0xddf7f];return _0x3bdfb8;};'use strict';var Sequelize=require(_0x2390('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x2390('0x1')](_0x2390('0x2'),_0x2390('0x3')),'defaultValue':_0x2390('0x2')},'ratingMessage':{'type':Sequelize[_0x2390('0x4')]},'pathTranscript':{'type':Sequelize[_0x2390('0x4')]},'mailTranscript':{'type':Sequelize[_0x2390('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2390('0x6')]},'disposition':{'type':Sequelize[_0x2390('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2390('0x5')]},'browserVersion':{'type':Sequelize[_0x2390('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2390('0x5')]},'deviceModel':{'type':Sequelize[_0x2390('0x5')]},'deviceVendor':{'type':Sequelize[_0x2390('0x5')]},'deviceType':{'type':Sequelize[_0x2390('0x5')]},'referer':{'type':Sequelize[_0x2390('0x4')]},'customerIp':{'type':Sequelize[_0x2390('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x2390('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2390('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2390('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2390('0x5')]},'customerPort':{'type':Sequelize[_0x2390('0x5')]}}; \ No newline at end of file +var _0x363f=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x144f3f,_0x16fef4){var _0x10f97c=function(_0x5a0f0d){while(--_0x5a0f0d){_0x144f3f['push'](_0x144f3f['shift']());}};_0x10f97c(++_0x16fef4);}(_0x363f,0x1cb));var _0xf363=function(_0x4cb9d1,_0x583456){_0x4cb9d1=_0x4cb9d1-0x0;var _0x4f0c02=_0x363f[_0x4cb9d1];return _0x4f0c02;};'use strict';var Sequelize=require(_0xf363('0x0'));module[_0xf363('0x1')]={'closed':{'type':Sequelize[_0xf363('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xf363('0x3')]},'ratingType':{'type':Sequelize[_0xf363('0x4')](_0xf363('0x5'),_0xf363('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xf363('0x7')]},'mailTranscript':{'type':Sequelize[_0xf363('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf363('0x9')]},'disposition':{'type':Sequelize[_0xf363('0x8')]},'note':{'type':Sequelize[_0xf363('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xf363('0x8')]},'osName':{'type':Sequelize[_0xf363('0x8')]},'osVersion':{'type':Sequelize[_0xf363('0x8')]},'deviceModel':{'type':Sequelize[_0xf363('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xf363('0x8')]},'referer':{'type':Sequelize[_0xf363('0x7')]},'customerIp':{'type':Sequelize[_0xf363('0x8')]},'formData':{'type':Sequelize[_0xf363('0x7')]('long')},'read1stAt':{'type':Sequelize[_0xf363('0x9')]},'lastMsgAt':{'type':Sequelize[_0xf363('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xf363('0x4')]('in',_0xf363('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xf363('0x8')]},'customerPort':{'type':Sequelize[_0xf363('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index af91c19..9b9531b 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 _0x0662=['ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','rows','params','includeAll','create','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','findOne','attachId','download','join','root','server/files/attachments/','close','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ChatWebsite','%s%d','agentAlias','System','agentIdentifier','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','getMessages','pick','options','include','findAll','getMyMessages','includeAgent','addTags','setTags','omit','spread','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Account','Owner','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','stack','name','Users','map','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','select','field','color','from','u.id','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','keys','some','isEmpty'];(function(_0x38c003,_0x230c7f){var _0x3289da=function(_0x1e4575){while(--_0x1e4575){_0x38c003['push'](_0x38c003['shift']());}};_0x3289da(++_0x230c7f);}(_0x0662,0xad));var _0x2066=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x0662[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0x2066('0x0'));var emlformat=require(_0x2066('0x1'));var rimraf=require(_0x2066('0x2'));var zipdir=require(_0x2066('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2066('0x4'));var moment=require(_0x2066('0x5'));var BPromise=require(_0x2066('0x6'));var Mustache=require(_0x2066('0x7'));var util=require(_0x2066('0x8'));var path=require(_0x2066('0x9'));var sox=require(_0x2066('0xa'));var csv=require(_0x2066('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2066('0xc'));var squel=require('squel');var crypto=require(_0x2066('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2066('0xe'));var toCsv=require(_0x2066('0xb'));var querystring=require(_0x2066('0xf'));var Papa=require(_0x2066('0x10'));var Redis=require(_0x2066('0x11'));var authService=require(_0x2066('0x12'));var qs=require(_0x2066('0x13'));var as=require(_0x2066('0x14'));var hardwareService=require(_0x2066('0x15'));var logger=require(_0x2066('0x16'))('api');var utils=require(_0x2066('0x17'));var config=require('../../config/environment');var db=require(_0x2066('0x18'))['db'];config[_0x2066('0x19')]=_['defaults'](config[_0x2066('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2066('0x1a'))(new Redis(config['redis']));require(_0x2066('0x1b'))[_0x2066('0x1c')](socket);var jayson=require(_0x2066('0x1d'));var client=jayson[_0x2066('0x1e')]['http']({'port':0x232b});var client9004=jayson[_0x2066('0x1e')][_0x2066('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x4e20f3,_0x4e3394,_0x121244){if(_0x121244){var _0x5e3676=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e3676['test'](_0x4e3394)){return _0x4e20f3;}else{throw new db[(_0x2066('0x20'))][(_0x2066('0x21'))](_0x2066('0x22'));}}else{return _0x4e20f3;}}function respondWithRpcPromise(_0x452e6a,_0x205efb,_0x44b01d,_0x41e596){return new BPromise(function(_0x147d44,_0x2ac00f){var _0x2b6c1c=_0x41e596||client;return _0x2b6c1c['request'](_0x452e6a,_0x44b01d)[_0x2066('0x23')](function(_0x1b61b9){logger[_0x2066('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x205efb,_0x2066('0x25'));logger[_0x2066('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x205efb,_0x2066('0x25'),JSON[_0x2066('0x27')](_0x1b61b9));if(_0x1b61b9['error']){if(_0x1b61b9[_0x2066('0x28')][_0x2066('0x29')]===0x1f4){logger[_0x2066('0x28')](_0x2066('0x2a'),_0x205efb,_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);return _0x2ac00f(_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);}logger[_0x2066('0x28')](_0x2066('0x2a'),_0x205efb,_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);return _0x147d44(_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);}else{logger[_0x2066('0x24')](_0x2066('0x2a'),_0x205efb,'request\x20sent');_0x147d44(_0x1b61b9['result']['message']);}})[_0x2066('0x2c')](function(_0xfd7c12){logger[_0x2066('0x28')](_0x2066('0x2a'),_0x205efb,_0xfd7c12);_0x2ac00f(_0xfd7c12);});});}function respondWithStatusCode(_0x45ff2f,_0x1276e0){_0x1276e0=_0x1276e0||0xcc;return function(_0x3d3a63){if(_0x3d3a63){return _0x45ff2f['sendStatus'](_0x1276e0);}return _0x45ff2f['status'](_0x1276e0)[_0x2066('0x2d')]();};}function respondWithResult(_0x54ea2d,_0x120d0f){_0x120d0f=_0x120d0f||0xc8;return function(_0x2b8f40){if(_0x2b8f40){return _0x54ea2d['status'](_0x120d0f)[_0x2066('0x2e')](_0x2b8f40);}};}function respondWithFilteredResult(_0x1837ee,_0x48283e){return function(_0x47261b){if(_0x47261b){var _0x1bf155=_0x47261b[_0x2066('0x2f')],_0x3a4232=_0x48283e[_0x2066('0x30')],_0x4c17ff=_0x48283e[_0x2066('0x30')]+_0x48283e[_0x2066('0x31')],_0x56ea09;if(_0x4c17ff>=_0x1bf155){_0x4c17ff=_0x1bf155;_0x56ea09=0xc8;}else{_0x56ea09=0xce;}_0x1837ee[_0x2066('0x32')](_0x56ea09);return _0x1837ee[_0x2066('0x33')](_0x2066('0x34'),_0x3a4232+'-'+_0x4c17ff+'/'+_0x1bf155)['json'](_0x47261b);}return null;};}function patchUpdates(_0x546c12){return function(_0x35a201){try{jsonpatch[_0x2066('0x35')](_0x35a201,_0x546c12,!![]);}catch(_0x27fef3){return BPromise[_0x2066('0x36')](_0x27fef3);}return _0x35a201[_0x2066('0x37')]();};}function saveUpdates(_0x3fbfaf,_0x10cb1b){return function(_0x50c6a){if(_0x50c6a){return _0x50c6a[_0x2066('0x38')](_0x3fbfaf)[_0x2066('0x23')](function(_0x480c02){return _0x480c02;});}return null;};}function removeEntity(_0x3bc714,_0x3b988b){return function(_0x3ecb64){if(_0x3ecb64){return _0x3ecb64['destroy']()[_0x2066('0x23')](function(){_0x3bc714[_0x2066('0x32')](0xcc)[_0x2066('0x2d')]();});}};}function handleEntityNotFound(_0x17da60,_0x1cdf36){return function(_0x1d923a){if(!_0x1d923a){_0x17da60['sendStatus'](0x194);}return _0x1d923a;};}function handleError(_0x14eb8f,_0x3ced66){_0x3ced66=_0x3ced66||0x1f4;return function(_0x1f78db){logger[_0x2066('0x28')](_0x1f78db[_0x2066('0x39')]);if(_0x1f78db[_0x2066('0x3a')]){delete _0x1f78db[_0x2066('0x3a')];}_0x14eb8f[_0x2066('0x32')](_0x3ced66)['send'](_0x1f78db);};}function getInteractionUsers(_0x3ded39,_0x1802de){return new BPromise(function(_0x24564f,_0x142548){try{if(_0x1802de[_0x3ded39['id']]){_0x3ded39[_0x2066('0x3b')]=_[_0x2066('0x3c')](_0x1802de[_0x3ded39['id']],function(_0x5eff7f){return{'id':_0x5eff7f['id'],'fullname':_0x5eff7f['fullname']};});}}catch(_0x5ce5d5){_0x142548(_0x5ce5d5);}_0x24564f(_0x3ded39);});}function getInteractionTags(_0x28e74f,_0xfa4822){return new BPromise(function(_0x81909e,_0x5108cf){try{if(_0x28e74f[_0x2066('0x3d')]){_0x28e74f[_0x2066('0x3e')]=[];_0x28e74f[_0x2066('0x3d')]['split'](',')[_0x2066('0x3f')](function(_0x397c8b){_0x28e74f[_0x2066('0x3e')][_0x2066('0x40')](_0xfa4822[_0x397c8b]);});}delete _0x28e74f[_0x2066('0x3d')];}catch(_0x47a250){_0x5108cf(_0x47a250);}_0x81909e(_0x28e74f);});}function updateChatInteraction(_0x201f8c,_0x3814cb,_0x3d3ca0){return new BPromise(function(_0x4b3191,_0x1d713b){return getInteractionUsers(_0x201f8c,_0x3d3ca0)[_0x2066('0x23')](function(_0x5a611f){return getInteractionTags(_0x5a611f,_0x3814cb);})['then'](function(_0x512fee){_0x4b3191(_0x512fee);})[_0x2066('0x2c')](function(_0x2aa852){_0x1d713b(_0x2aa852);});});}exports[_0x2066('0x41')]=function(_0x13c49b,_0x5ac4a9){var _0x2a9c11={},_0x5528cc={},_0x24b540={'count':0x0,'rows':[]};var _0x345ffe=_['map'](db[_0x2066('0x42')][_0x2066('0x43')],function(_0x2dd4e7){return{'name':_0x2dd4e7[_0x2066('0x44')],'type':_0x2dd4e7[_0x2066('0x45')]['key']};});_0x5528cc[_0x2066('0x46')]=_[_0x2066('0x3c')](_0x345ffe,_0x2066('0x3a'));_0x5528cc[_0x2066('0x47')]=_['keys'](_0x13c49b[_0x2066('0x47')]);_0x5528cc[_0x2066('0x48')]=_['intersection'](_0x5528cc['model'],_0x5528cc[_0x2066('0x47')]);_0x2a9c11['attributes']=_[_0x2066('0x49')](_0x5528cc[_0x2066('0x46')],qs[_0x2066('0x4a')](_0x13c49b[_0x2066('0x47')]['fields']));_0x2a9c11[_0x2066('0x4b')]=_0x2a9c11['attributes'][_0x2066('0x4c')]?_0x2a9c11[_0x2066('0x4b')]:_0x5528cc[_0x2066('0x46')];if(!_0x13c49b[_0x2066('0x47')][_0x2066('0x4d')](_0x2066('0x4e'))){_0x2a9c11[_0x2066('0x31')]=qs[_0x2066('0x31')](_0x13c49b[_0x2066('0x47')][_0x2066('0x31')]);_0x2a9c11[_0x2066('0x30')]=qs[_0x2066('0x30')](_0x13c49b[_0x2066('0x47')][_0x2066('0x30')]);}_0x2a9c11['order']=qs[_0x2066('0x4f')](_0x13c49b[_0x2066('0x47')][_0x2066('0x4f')]);_0x2a9c11['where']=qs[_0x2066('0x48')](_['pick'](_0x13c49b[_0x2066('0x47')],_0x5528cc['filters']));var _0x41e98d=[];var _0x3831e8=squel[_0x2066('0x50')]()[_0x2066('0x51')]('id')[_0x2066('0x51')](_0x2066('0x3a'))[_0x2066('0x51')](_0x2066('0x52'))[_0x2066('0x53')]('tools_tags');var _0x16030e=squel[_0x2066('0x50')]()['field'](_0x2066('0x54'))['field']('u.fullname')['field']('ui.ChatInteractionId')['from'](_0x2066('0x55'),'ui')['left_join'](_0x2066('0x56'),'u',_0x2066('0x57'));var _0x3a895f=squel['select']()['from'](_0x2066('0x58'),'i')[_0x2066('0x59')](_0x2066('0x5a'),'c',_0x2066('0x5b'))[_0x2066('0x59')](_0x2066('0x56'),'o',_0x2066('0x5c'))['left_join'](_0x2066('0x5d'),'a',_0x2066('0x5e'))[_0x2066('0x59')](_0x2066('0x5f'),'me',_0x2066('0x60'))[_0x2066('0x59')](_0x2066('0x61'),'it',_0x2066('0x62'))[_0x2066('0x59')](_0x2066('0x63'),'t',_0x2066('0x64'));var _0x19cdad=squel[_0x2066('0x65')]();var _0x5d8c2c=[];var _0x2acf7e=squel[_0x2066('0x65')]();var _0x1d4f58;if(_0x13c49b[_0x2066('0x47')][_0x2066('0x66')]){_0x1d4f58=as['parseSearch'](_0x13c49b[_0x2066('0x47')][_0x2066('0x66')]);var _0x539c45=_0x1d4f58[_0x2066('0x67')];for(var _0x4494bd=0x0;_0x4494bd<_0x1d4f58[_0x2066('0x68')][_0x2066('0x4c')];_0x4494bd++){var _0x53f194=_0x1d4f58[_0x2066('0x68')][_0x4494bd];var _0x24f099='i';var _0x416197=_[_0x2066('0x69')](_0x345ffe,[_0x2066('0x3a'),_0x53f194['field']]);if(!_0x416197){switch(_0x53f194['field']){case _0x2066('0x6a'):if(_0x53f194[_0x2066('0x6b')]==0x1){_0x3a895f['having']('`'+_0x53f194[_0x2066('0x51')]+_0x2066('0x6c'));}else{_0x3a895f['having']('`'+_0x53f194[_0x2066('0x51')]+_0x2066('0x6d'));}break;case _0x2066('0x6e'):if(_0x53f194['operator']===_0x2066('0x6f')){if(_0x53f194[_0x2066('0x6b')]['split']('\x20')[_0x2066('0x4c')]>0x1){_0x19cdad[_0x539c45](_0x2066('0x70'),qs['getFullTextValue'](_0x53f194[_0x2066('0x6b')]),null);}else{var _0x162f6e='%'+_0x53f194['value']+'%';_0x19cdad[_0x539c45](_0x2066('0x71'),_0x162f6e,_0x162f6e,_0x162f6e);}}else{_0x416197=_[_0x2066('0x69')](_0x345ffe,[_0x2066('0x3a'),_0x2066('0x72')]);_0x53f194[_0x2066('0x51')]=_0x2066('0x72');_0x364adf=as[_0x2066('0x73')](_0x24f099,_0x416197['type'],_0x53f194);_0x19cdad[_0x539c45](_0x364adf[_0x2066('0x74')],_0x364adf[_0x2066('0x6b')]['start'],_0x364adf[_0x2066('0x6b')][_0x2066('0x2d')]);}break;case _0x2066('0x75'):var _0x2055b6=_0x53f194['value'][_0x2066('0x76')](',')[_0x2066('0x3c')](function(_0x254a6c){return Number(_0x254a6c);});_0x2055b6['forEach'](function(_0x1f94c7){_0x2acf7e['or'](_0x2066('0x77'),'%,'+_0x1f94c7+',%');});_0x5d8c2c=_[_0x2066('0x78')](_0x5d8c2c,_0x2055b6);break;case _0x2066('0x79'):if(_0x53f194[_0x2066('0x7a')]===_0x2066('0x6f')){_0x19cdad[_0x539c45](_0x2066('0x7b'),'%'+_0x53f194['value']+'%',null);}else{_0x416197=_[_0x2066('0x69')](_0x345ffe,[_0x2066('0x3a'),_0x2066('0x7c')]);_0x53f194[_0x2066('0x51')]=_0x2066('0x7c');_0x364adf=as[_0x2066('0x73')](_0x24f099,_0x416197[_0x2066('0x45')],_0x53f194);_0x19cdad[_0x539c45](_0x364adf[_0x2066('0x74')],_0x364adf['value'][_0x2066('0x7d')],_0x364adf['value'][_0x2066('0x2d')]);}break;case _0x2066('0x7e'):_0x364adf=as['buildExpression']('me',null,_0x53f194);_0x19cdad[_0x539c45](_0x364adf['text'],_0x364adf[_0x2066('0x6b')][_0x2066('0x7d')],_0x364adf[_0x2066('0x6b')]['end']);break;}}else{var _0x364adf=as['buildExpression'](_0x24f099,_0x416197[_0x2066('0x45')],_0x53f194);_0x19cdad[_0x539c45](_0x364adf['text'],_0x364adf[_0x2066('0x6b')][_0x2066('0x7d')],_0x364adf[_0x2066('0x6b')]['end']);}}}else{var _0x29bf1d=_(_0x13c49b[_0x2066('0x47')])[_0x2066('0x7f')]()['map'](function(_0x49d5b9){return _[_0x2066('0x80')](_0x345ffe,['name',_0x49d5b9])?_0x49d5b9:undefined;})['compact']()[_0x2066('0x6b')]();if(!_[_0x2066('0x81')](_0x29bf1d)){_0x29bf1d[_0x2066('0x3f')](function(_0x2a9f6b){if(_0x2a9f6b===_0x2066('0x82')){_0x3a895f[_0x2066('0x83')](_0x2066('0x84'),[][_0x2066('0x85')](_0x13c49b[_0x2066('0x47')][_0x2a9f6b]));}else if(_0x2a9f6b==='createdAt'){var _0x25d315=JSON[_0x2066('0x86')](_0x13c49b[_0x2066('0x47')][_0x2a9f6b])[_0x2066('0x87')];var _0x14d610=JSON[_0x2066('0x86')](_0x13c49b['query'][_0x2a9f6b])['$lte'];_0x3a895f[_0x2066('0x83')](_0x2066('0x88'),_0x25d315,_0x14d610);}else{if(_0x13c49b[_0x2066('0x47')][_0x2a9f6b]===_0x2066('0x89')){_0x3a895f[_0x2066('0x83')]('i.'+_0x2a9f6b+_0x2066('0x8a'));}else{_0x3a895f[_0x2066('0x83')]('i.'+_0x2a9f6b+_0x2066('0x8b'),_0x13c49b[_0x2066('0x47')][_0x2a9f6b]);}}});}if(_0x13c49b[_0x2066('0x47')][_0x2066('0x8c')]){if(_0x13c49b[_0x2066('0x47')][_0x2066('0x8c')]==0x1){_0x3a895f[_0x2066('0x8d')](_0x2066('0x8e'));}else{_0x3a895f['having'](_0x2066('0x8f'));}}if(_0x13c49b[_0x2066('0x47')][_0x2066('0x90')]){_0x5d8c2c=_[_0x2066('0x91')](_0x13c49b[_0x2066('0x47')]['tag'])?_0x13c49b[_0x2066('0x47')]['tag']:new Array(_0x13c49b[_0x2066('0x47')][_0x2066('0x90')]);_0x5d8c2c[_0x2066('0x3f')](function(_0x33396c){_0x2acf7e['or'](_0x2066('0x77'),'%,'+_0x33396c+',%');});}if(_0x13c49b['query'][_0x2066('0x92')]){var _0x9655ed=_0x13c49b[_0x2066('0x47')][_0x2066('0x92')]['replace']('\x5c','\x5c\x5c')[_0x2066('0x93')]('\x27\x27',_0x2066('0x94'));if(qs['isNumeric'](_0x9655ed)){_0x19cdad['or'](_0x2066('0x95'),_0x9655ed+'%');}else{_0x19cdad['or'](_0x2066('0x96'),qs[_0x2066('0x97')](_0x9655ed))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9655ed+'%');}}}_0x3a895f[_0x2066('0x83')](_0x19cdad);_0x3a895f[_0x2066('0x98')](_0x2066('0x99'));var _0x146e93={'type':db['Sequelize'][_0x2066('0x9a')][_0x2066('0x9b')],'raw':!![]};var _0x83e515=_0x3a895f[_0x2066('0x9c')]();_0x83e515['field']('i.id');_0x83e515[_0x2066('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2066('0x6a'));if(_0x2a9c11[_0x2066('0x9d')]){_0x2a9c11[_0x2066('0x9d')][_0x2066('0x3f')](function(_0x87ccf8){_0x3a895f[_0x2066('0x9d')]('i.'+_0x87ccf8[0x0],_0x87ccf8[0x1]===_0x2066('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x5d8c2c)){_0x3a895f[_0x2066('0x8d')](_0x2acf7e);_0x83e515[_0x2066('0x83')](_0x2066('0x9f'),_0x5d8c2c);}BPromise[_0x2066('0xa0')]()[_0x2066('0x23')](function(){if(!_0x1d4f58&&_0x13c49b['query'][_0x2066('0x82')])return;return _0x13c49b[_0x2066('0xa1')][_0x2066('0xa2')]({'attributes':['id'],'raw':!![]})[_0x2066('0x23')](function(_0x104503){if(_[_0x2066('0x81')](_0x104503)){_0x83e515['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3a895f[_0x2066('0x83')](_0x2066('0xa3'));}else{_0x83e515[_0x2066('0x83')](_0x2066('0x84'),_[_0x2066('0x3c')](_0x104503,'id'));_0x3a895f[_0x2066('0x83')](_0x2066('0x84'),_[_0x2066('0x3c')](_0x104503,'id'));}});})[_0x2066('0x23')](function(){db[_0x2066('0xa4')][_0x2066('0x47')](_0x83e515[_0x2066('0xa5')](),_0x146e93)[_0x2066('0x23')](function(_0x411a78){_0x24b540[_0x2066('0x2f')]=_0x411a78[_0x2066('0x4c')];if(_0x24b540['count']===0x0)return[];return db[_0x2066('0xa4')][_0x2066('0x47')](_0x3831e8[_0x2066('0xa5')](),_0x146e93)[_0x2066('0x23')](function(_0x31b5ad){_0x41e98d=_[_0x2066('0xa6')](_0x31b5ad,'id');_0x146e93=_[_0x2066('0xa7')](_0x146e93,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13c49b[_0x2066('0x47')][_0x2066('0x4a')]){_0x2a9c11[_0x2066('0x4b')]['forEach'](function(_0xbf82c3){_0x3a895f['field']('i.'+_0xbf82c3);});}else{_0x3a895f['field'](_0x2066('0xa8'),'unreadMessages');_0x3a895f[_0x2066('0x51')]('a.key',_0x2066('0xa9'));_0x3a895f[_0x2066('0x51')](_0x2066('0xaa'),_0x2066('0xab'));_0x3a895f[_0x2066('0x51')](_0x2066('0xac'));_0x3a895f[_0x2066('0x51')](_0x2066('0xad'),'Contact.firstName');_0x3a895f['field'](_0x2066('0xae'),_0x2066('0xaf'));_0x3a895f[_0x2066('0x51')](_0x2066('0xb0'),_0x2066('0xb1'));_0x3a895f[_0x2066('0x51')]('c.phone',_0x2066('0xb2'));_0x3a895f[_0x2066('0x51')](_0x2066('0xb3'),_0x2066('0xb4'));_0x3a895f[_0x2066('0x51')](_0x2066('0xb5'),'Contact.fax');_0x3a895f['field']('o.fullname',_0x2066('0xb6'));_0x3a895f['field'](_0x2066('0xb7'),_0x2066('0xb8'));_0x3a895f['field'](_0x2066('0xb9'),_0x2066('0x3d'));}_0x3a895f['limit'](_0x2a9c11[_0x2066('0x31')]);_0x3a895f[_0x2066('0x30')](_0x2a9c11['offset']);return db[_0x2066('0xa4')][_0x2066('0x47')](_0x3a895f[_0x2066('0xa5')](),_0x146e93);})[_0x2066('0x23')](function(_0xcb620){_0x16030e['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x2066('0x3c')](_0xcb620,'id'));return db['sequelize']['query'](_0x16030e[_0x2066('0xa5')](),_0x146e93)[_0x2066('0x23')](function(_0x452431){var _0x559b37=_[_0x2066('0xba')](_0x452431,_0x2066('0xbb'));var _0x46913e=[];_0xcb620[_0x2066('0x3f')](function(_0x421a55){_0x46913e[_0x2066('0x40')](updateChatInteraction(_0x421a55,_0x41e98d,_0x559b37));});return BPromise['all'](_0x46913e);});});})[_0x2066('0x23')](function(_0x58c4a7){_0x24b540[_0x2066('0xbc')]=_0x58c4a7;return _0x24b540;})[_0x2066('0x23')](respondWithFilteredResult(_0x5ac4a9,_0x2a9c11));})['catch'](handleError(_0x5ac4a9,null));};exports['show']=function(_0x3e445b,_0x2ff736){var _0x35676f={'raw':![],'where':{'id':_0x3e445b[_0x2066('0xbd')]['id']}},_0x573b65={};_0x573b65[_0x2066('0x46')]=_['keys'](db[_0x2066('0x42')][_0x2066('0x43')]);_0x573b65['query']=_[_0x2066('0x7f')](_0x3e445b[_0x2066('0x47')]);_0x573b65[_0x2066('0x48')]=_[_0x2066('0x49')](_0x573b65[_0x2066('0x46')],_0x573b65[_0x2066('0x47')]);_0x35676f[_0x2066('0x4b')]=_['intersection'](_0x573b65[_0x2066('0x46')],qs['fields'](_0x3e445b[_0x2066('0x47')][_0x2066('0x4a')]));_0x35676f[_0x2066('0x4b')]=_0x35676f['attributes'][_0x2066('0x4c')]?_0x35676f[_0x2066('0x4b')]:_0x573b65['model'];if(_0x3e445b['query'][_0x2066('0xbe')]){_0x35676f['include']=[{'all':!![]}];}_0x35676f=_[_0x2066('0xa7')]({},_0x35676f,_0x3e445b['options']);return db['ChatInteraction'][_0x2066('0x69')](_0x35676f)[_0x2066('0x23')](handleEntityNotFound(_0x2ff736,null))[_0x2066('0x23')](respondWithResult(_0x2ff736,null))['catch'](handleError(_0x2ff736,null));};exports[_0x2066('0xbf')]=function(_0x210f82,_0x1063ed){return db[_0x2066('0x42')][_0x2066('0xbf')](_0x210f82[_0x2066('0x7e')],{})[_0x2066('0x23')](respondWithResult(_0x1063ed,0xc9))[_0x2066('0x2c')](handleError(_0x1063ed,null));};exports[_0x2066('0x38')]=function(_0x54d08b,_0x44f84d){if(_0x54d08b[_0x2066('0x7e')]['id']){delete _0x54d08b[_0x2066('0x7e')]['id'];}return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x54d08b[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x44f84d,null))[_0x2066('0x23')](saveUpdates(_0x54d08b['body'],null))[_0x2066('0x23')](respondWithResult(_0x44f84d,null))[_0x2066('0x2c')](handleError(_0x44f84d,null));};exports['destroy']=function(_0x80f184,_0x1855c2){return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x80f184[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x1855c2,null))[_0x2066('0x23')](removeEntity(_0x1855c2,null))[_0x2066('0x2c')](handleError(_0x1855c2,null));};exports[_0x2066('0xc0')]=function(_0x838e0f,_0x5bfc83){return db['ChatInteraction'][_0x2066('0xc0')]()[_0x2066('0x23')](respondWithResult(_0x5bfc83,null))[_0x2066('0x2c')](handleError(_0x5bfc83,null));};exports[_0x2066('0xc1')]=function(_0x2590e3,_0x173fae){if(_0x2590e3['body']['id']){delete _0x2590e3['body']['id'];}return db[_0x2066('0x42')]['find']({'where':{'id':_0x2590e3[_0x2066('0xbd')]['id']}})['then'](handleEntityNotFound(_0x173fae,null))[_0x2066('0x23')](saveUpdates(_0x2590e3[_0x2066('0x7e')],null))['then'](respondWithResult(_0x173fae,null))[_0x2066('0x2c')](handleError(_0x173fae,null));};exports[_0x2066('0xc2')]=function(_0x510403,_0x4c12db,_0x55f644){if(_0x510403[_0x2066('0x7e')]['id']){delete _0x510403[_0x2066('0x7e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x510403[_0x2066('0xbd')]['id']}})['then'](function(_0x187ca7){if(!_0x187ca7){logger[_0x2066('0x28')](_0x2066('0xc3'),_0x2066('0xc2'),0x194,_0x2066('0xc4'));_0x4c12db[_0x2066('0xc5')](0x194);}else{if(_0x187ca7[_0x2066('0x7c')]){throw new db[(_0x2066('0x20'))][(_0x2066('0x21'))](_0x2066('0xc6'));}}return _0x187ca7;})[_0x2066('0x23')](function(_0x21c735){if(_0x21c735){return _0x21c735[_0x2066('0x38')]({'closed':_0x510403[_0x2066('0x7e')][_0x2066('0xc7')],'disposition':_0x510403[_0x2066('0x7e')][_0x2066('0xc8')]})['then'](function(_0x5938f8){return _0x5938f8;});}})[_0x2066('0x23')](function(_0xec627c){return respondWithRpcPromise(_0x2066('0xc9'),_0x2066('0xc2'),_0x510403[_0x2066('0x7e')],client9004);})[_0x2066('0x23')](respondWithResult(_0x4c12db,null))[_0x2066('0x2c')](handleError(_0x4c12db,null));};exports[_0x2066('0xca')]=function(_0x18bdd4,_0x455338,_0x29bb91){_0x18bdd4[_0x2066('0x7e')]['name']=_0x18bdd4[_0x2066('0xcb')][_0x2066('0xcc')];_0x18bdd4['body'][_0x2066('0xcd')]=_0x18bdd4[_0x2066('0xcb')][_0x2066('0xce')];_0x18bdd4['body'][_0x2066('0x45')]=_0x18bdd4[_0x2066('0xcb')][_0x2066('0xcf')];return db[_0x2066('0xd0')][_0x2066('0xbf')](_0x18bdd4[_0x2066('0x7e')])['then'](respondWithResult(_0x455338,0xc9))['catch'](handleError(_0x455338,null));};exports['attachmentDownload']=function(_0x56f212,_0x5dab9a,_0x5eedac){return db[_0x2066('0x42')]['findOne']({'where':{'id':_0x56f212['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5dab9a,null))[_0x2066('0x23')](function(_0x397b59){if(_0x397b59){if(_0x397b59['closed']){return _0x5dab9a[_0x2066('0x32')](0x193)[_0x2066('0x2e')]({'status':0x193,'message':_0x2066('0xd1')});}return db[_0x2066('0xd0')][_0x2066('0xd2')]({'where':{'id':_0x56f212[_0x2066('0x47')][_0x2066('0xd3')]},'raw':!![]})[_0x2066('0x23')](handleEntityNotFound(_0x5dab9a,null));}})['then'](function(_0x3ee13e){if(_0x3ee13e){return _0x5dab9a[_0x2066('0xd4')](path[_0x2066('0xd5')](config[_0x2066('0xd6')],_0x2066('0xd7'),_0x3ee13e[_0x2066('0xcd')]));}})[_0x2066('0x2c')](handleError(_0x5dab9a,null));};exports[_0x2066('0xd8')]=function(_0x467f85,_0x50055c){var _0x1db2a1=null;var _0x42034a=null;var _0x4b64fb=null;var _0x22d293=null;if(_0x467f85['body']['id']){delete _0x467f85[_0x2066('0x7e')]['id'];}if(_0x467f85[_0x2066('0x7e')]['mailTranscript']){_0x22d293=path[_0x2066('0xd5')](config[_0x2066('0xd6')],_0x2066('0xd9'),util[_0x2066('0xda')](_0x2066('0xdb'),Date['now']()));_0x467f85[_0x2066('0x7e')][_0x2066('0xdc')]=_0x22d293;}return db['ChatInteraction'][_0x2066('0x69')]({'where':{'id':_0x467f85[_0x2066('0xbd')]['id']},'include':[{'model':db[_0x2066('0xdd')],'as':_0x2066('0xde'),'include':[{'model':db[_0x2066('0x79')],'as':_0x2066('0x79')}]}]})[_0x2066('0x23')](handleEntityNotFound(_0x50055c,null))[_0x2066('0x23')](saveUpdates(_0x467f85[_0x2066('0x7e')],null))[_0x2066('0x23')](function(_0x32e712){if(_0x32e712){_0x1db2a1=_0x32e712;return db[_0x2066('0xdf')][_0x2066('0x69')]({'where':{'id':_0x1db2a1[_0x2066('0x82')]}});}})[_0x2066('0x23')](function(_0x7bec06){if(_0x7bec06){_0x4b64fb=_0x7bec06;return db['CmContact'][_0x2066('0x69')]({'where':{'id':_0x1db2a1[_0x2066('0x72')]}});}})['then'](function(_0x1d0194){if(_0x1d0194){_0x42034a=_0x1d0194;if(_0x22d293){var _0x5d36eb=null;for(var _0x33ce24=0x1;_0x33ce24<_0x1db2a1[_0x2066('0xde')][_0x2066('0x4c')];++_0x33ce24){_0x5d36eb=_0x1db2a1[_0x2066('0xde')][_0x33ce24];var _0x120dc1=_0x5d36eb['UserId']?util[_0x2066('0xda')](_0x2066('0xe0'),_0x4b64fb[_0x2066('0xe1')],_0x5d36eb['UserId']):_0x2066('0xe2');var _0x48838b=_0x467f85[_0x2066('0x7e')]['customer']||util[_0x2066('0xda')]('%s%d','Visitor',_0x5d36eb[_0x2066('0x72')]);switch(_0x4b64fb[_0x2066('0xe3')]){case _0x2066('0xe4'):_0x120dc1=_0x5d36eb['UserId']?util[_0x2066('0xda')](_0x2066('0xe0'),_0x4b64fb[_0x2066('0xe1')],_0x5d36eb[_0x2066('0x7c')]):_0x2066('0xe2');break;case _0x2066('0xe5'):_0x120dc1=_0x5d36eb[_0x2066('0x7c')]?_0x5d36eb[_0x2066('0x79')][_0x2066('0xe6')]||_0x5d36eb[_0x2066('0x79')][_0x2066('0xe7')]:_0x2066('0xe2');break;case'agent_fullname':_0x120dc1=_0x5d36eb[_0x2066('0x7c')]?_0x5d36eb[_0x2066('0x79')][_0x2066('0xe7')]:'System';break;default:_0x120dc1=_0x5d36eb['UserId']?util[_0x2066('0xda')](_0x2066('0xe0'),_0x4b64fb[_0x2066('0xe1')],_0x5d36eb['UserId']):'System';}var _0x55b882=util[_0x2066('0xda')](_0x2066('0xe8'),moment(_0x5d36eb[_0x2066('0xe9')])[_0x2066('0xda')](_0x2066('0xea')),_0x5d36eb[_0x2066('0xeb')]==='in'?_0x48838b:_0x120dc1,_0x5d36eb[_0x2066('0x7e')]);if(!_0x5d36eb[_0x2066('0xec')]){fs[_0x2066('0xed')](_0x22d293,_0x55b882);}}return db[_0x2066('0xee')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2066('0xef')],'as':_0x2066('0xf0'),'raw':!![]}]});}}})[_0x2066('0x23')](function(_0x2a4bb0){if(_0x2a4bb0&&_0x2a4bb0[_0x2066('0xf0')]&&_0x467f85[_0x2066('0x7e')]){var _0x27b334={'tls':{'rejectUnauthorized':![]}};if(_0x2a4bb0[_0x2066('0xf0')]['service']){_0x27b334[_0x2066('0xf1')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf1')];}else{_0x27b334[_0x2066('0xf2')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf2')];_0x27b334[_0x2066('0xf3')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf3')];_0x27b334[_0x2066('0xf4')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf4')];}if(_0x2a4bb0[_0x2066('0xf0')]['authentication']){_0x27b334['auth']={'user':_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xa1')],'pass':_0x2a4bb0[_0x2066('0xf0')]['pass']};}return respondWithRpcPromise(_0x2066('0xf5'),_0x2066('0xf6'),{'account':_0x27b334,'message':{'from':util['format'](_0x2066('0xf7'),_0x2a4bb0['name'],_0x2a4bb0[_0x2066('0xf8')]||_0x2a4bb0['Smtp'][_0x2066('0xa1')]),'to':_0x467f85['body'][_0x2066('0xf9')],'subject':'Mail\x20Transcript','text':util[_0x2066('0xda')](_0x2066('0xfa'),_0x467f85['body'][_0x2066('0xf9')]),'attachments':[{'path':_0x22d293}]}})[_0x2066('0x23')](function(){return _0x1db2a1;})[_0x2066('0x2c')](function(_0x995e5){console[_0x2066('0x28')](_0x995e5);});}else{return _0x1db2a1;}})[_0x2066('0x23')](respondWithStatusCode(_0x50055c,0xc8))[_0x2066('0x2c')](handleError(_0x50055c,null));};exports['addMessage']=function(_0x890f78,_0x44ebdc,_0x1deeee){return db[_0x2066('0xdd')]['find']({'where':{'id':_0x890f78[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x44ebdc,null))[_0x2066('0x23')](function(_0x5612b7){if(_0x5612b7){return _0x5612b7['addMessage'](_0x890f78[_0x2066('0x7e')]['ids'],_['omit'](_0x890f78[_0x2066('0x7e')],[_0x2066('0xfb'),'id'])||{});}})[_0x2066('0x23')](respondWithResult(_0x44ebdc,null))['catch'](handleError(_0x44ebdc,null));};exports[_0x2066('0xfc')]=function(_0x45c214,_0x1344cb,_0x2c7fad){var _0x284143={'raw':![],'where':{}};var _0x29db5a={};var _0x2e732b={'count':0x0,'rows':[]};return db[_0x2066('0x42')]['findOne']({'where':{'id':_0x45c214['params']['id']}})['then'](handleEntityNotFound(_0x1344cb,null))[_0x2066('0x23')](function(_0x6f1708){if(_0x6f1708){_0x29db5a[_0x2066('0x46')]=_[_0x2066('0x7f')](db[_0x2066('0xdd')][_0x2066('0x43')]);_0x29db5a['query']=_[_0x2066('0x7f')](_0x45c214[_0x2066('0x47')]);_0x29db5a[_0x2066('0x48')]=_[_0x2066('0x49')](_0x29db5a['model'],_0x29db5a[_0x2066('0x47')]);_0x284143[_0x2066('0x4b')]=_[_0x2066('0x49')](_0x29db5a[_0x2066('0x46')],qs[_0x2066('0x4a')](_0x45c214['query'][_0x2066('0x4a')]));_0x284143[_0x2066('0x4b')]=_0x284143[_0x2066('0x4b')][_0x2066('0x4c')]?_0x284143[_0x2066('0x4b')]:_0x29db5a[_0x2066('0x46')];if(!_0x45c214[_0x2066('0x47')]['hasOwnProperty'](_0x2066('0x4e'))){_0x284143[_0x2066('0x31')]=qs[_0x2066('0x31')](_0x45c214['query'][_0x2066('0x31')]);_0x284143[_0x2066('0x30')]=qs[_0x2066('0x30')](_0x45c214[_0x2066('0x47')][_0x2066('0x30')]);}_0x284143[_0x2066('0x9d')]=qs[_0x2066('0x4f')](_0x45c214[_0x2066('0x47')][_0x2066('0x4f')]);_0x284143[_0x2066('0x83')]=qs[_0x2066('0x48')](_[_0x2066('0xfd')](_0x45c214[_0x2066('0x47')],_0x29db5a[_0x2066('0x48')]));_0x284143[_0x2066('0x83')]['ChatInteractionId']=_0x6f1708['id'];if(_0x45c214['query'][_0x2066('0x92')]){_0x284143[_0x2066('0x83')]=_[_0x2066('0xa7')](_0x284143[_0x2066('0x83')],{'$or':_[_0x2066('0x3c')](_0x284143[_0x2066('0x4b')],function(_0x70404){var _0x599d3e={};_0x599d3e[_0x70404]={'$like':'%'+_0x45c214[_0x2066('0x47')][_0x2066('0x92')]+'%'};return _0x599d3e;})});}if(_0x45c214[_0x2066('0x47')][_0x2066('0x87')]){var _0x1bdc6f=_0x45c214[_0x2066('0x47')][_0x2066('0x87')][_0x2066('0x76')](',');var _0x4f2f67={};_0x4f2f67[_0x1bdc6f[0x0]]={'$gte':moment(_0x1bdc6f[0x1])[_0x2066('0xda')]('YYYY-MM-DD\x20HH:mm:ss')};_0x284143[_0x2066('0x83')]=_[_0x2066('0xa7')](_0x284143[_0x2066('0x83')],_0x4f2f67);}_0x284143=_[_0x2066('0xa7')]({},_0x284143,_0x45c214[_0x2066('0xfe')]);return db[_0x2066('0xdd')][_0x2066('0x2f')]({'where':_0x284143[_0x2066('0x83')]})[_0x2066('0x23')](function(_0x136281){_0x2e732b[_0x2066('0x2f')]=_0x136281;if(_0x45c214[_0x2066('0x47')]['includeAll']){_0x284143[_0x2066('0xff')]=[{'all':!![]}];}return db['ChatMessage'][_0x2066('0x100')](_0x284143);})['then'](function(_0x12c762){_0x2e732b['rows']=_0x12c762;return _0x2e732b;});}})[_0x2066('0x23')](respondWithFilteredResult(_0x1344cb,_0x284143))[_0x2066('0x2c')](handleError(_0x1344cb,null));};exports[_0x2066('0x101')]=function(_0xddd060,_0x29b1d6,_0xcc1717){var _0x42f448={'where':{}},_0x3197e5={},_0x3014a6={'count':0x0,'rows':[]};return db[_0x2066('0x42')]['findOne']({'where':{'id':_0xddd060['params']['id']}})['then'](handleEntityNotFound(_0x29b1d6,null))[_0x2066('0x23')](function(_0x4c2de3){if(_0x4c2de3){_0x3197e5['model']=_[_0x2066('0x7f')](db[_0x2066('0xdd')][_0x2066('0x43')]);_0x3197e5['query']=_[_0x2066('0x7f')](_0xddd060[_0x2066('0x47')]);_0x3197e5[_0x2066('0x48')]=_[_0x2066('0x49')](_0x3197e5[_0x2066('0x46')],_0x3197e5[_0x2066('0x47')]);_0x42f448['attributes']=_[_0x2066('0x49')](_0x3197e5[_0x2066('0x46')],qs['fields'](_0xddd060['query']['fields']));_0x42f448[_0x2066('0x4b')]=_0x42f448[_0x2066('0x4b')][_0x2066('0x4c')]?_0x42f448[_0x2066('0x4b')]:_0x3197e5[_0x2066('0x46')];if(!_0xddd060['query'][_0x2066('0x4d')](_0x2066('0x4e'))){_0x42f448[_0x2066('0x31')]=qs['limit'](_0xddd060[_0x2066('0x47')][_0x2066('0x31')]);_0x42f448[_0x2066('0x30')]=qs['offset'](_0xddd060[_0x2066('0x47')][_0x2066('0x30')]);}_0x42f448['order']=qs[_0x2066('0x4f')](_0xddd060[_0x2066('0x47')][_0x2066('0x4f')]);_0x42f448[_0x2066('0x83')]=qs['filters'](_['pick'](_0xddd060[_0x2066('0x47')],_0x3197e5['filters']));_0x42f448['where'][_0x2066('0xbb')]=_0x4c2de3['id'];if(_0xddd060[_0x2066('0x47')][_0x2066('0x92')]){_0x42f448[_0x2066('0x83')]=_['merge'](_0x42f448[_0x2066('0x83')],{'$or':_['map'](_0x42f448[_0x2066('0x4b')],function(_0x4474e2){var _0x168baa={};_0x168baa[_0x4474e2]={'$like':'%'+_0xddd060['query'][_0x2066('0x92')]+'%'};return _0x168baa;})});}_0x42f448[_0x2066('0x83')][_0x2066('0xec')]=![];if(_0xddd060[_0x2066('0x47')]['id']){_0x42f448[_0x2066('0x83')]['id']={'$gt':_0xddd060['query']['id']};}_0x42f448=_[_0x2066('0xa7')]({},_0x42f448,_0xddd060[_0x2066('0xfe')]);return db[_0x2066('0xdd')][_0x2066('0x2f')]({'where':_0x42f448[_0x2066('0x83')]})['then'](function(_0x262888){_0x3014a6[_0x2066('0x2f')]=_0x262888;_0x42f448[_0x2066('0xff')]=[];if(_0xddd060[_0x2066('0x47')][_0x2066('0x102')]){_0x42f448[_0x2066('0xff')][_0x2066('0x40')]({'model':db[_0x2066('0x79')],'as':'User','attributes':['id',_0x2066('0xe7'),_0x2066('0xe6')]});}if(_0xddd060[_0x2066('0x47')][_0x2066('0xbe')]){_0x42f448[_0x2066('0xff')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x42f448);})[_0x2066('0x23')](function(_0x482acc){_0x3014a6['rows']=_0x482acc;return _0x3014a6;});}})['then'](respondWithFilteredResult(_0x29b1d6,_0x42f448))['catch'](handleError(_0x29b1d6,null));};exports[_0x2066('0x103')]=function(_0x11f2ea,_0x20cfe2,_0x2690de){return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x11f2ea[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x20cfe2,null))[_0x2066('0x23')](function(_0x5bccb0){if(_0x5bccb0){return _0x5bccb0[_0x2066('0x104')](_0x11f2ea[_0x2066('0x7e')][_0x2066('0xfb')],_[_0x2066('0x105')](_0x11f2ea[_0x2066('0x7e')],[_0x2066('0xfb'),'id'])||{})[_0x2066('0x106')](function(){return db[_0x2066('0x75')][_0x2066('0x100')]({'attributes':['id',_0x2066('0x3a'),_0x2066('0x52')],'where':{'id':_0x11f2ea[_0x2066('0x7e')][_0x2066('0xfb')]}});})[_0x2066('0x23')](function(_0x3ef1c1){socket['emit'](_0x2066('0x107'),{'id':Number(_0x11f2ea[_0x2066('0xbd')]['id']),'tags':_0x3ef1c1||[]});return{'id':Number(_0x11f2ea[_0x2066('0xbd')]['id']),'tags':_0x3ef1c1||[]};});}})[_0x2066('0x23')](respondWithResult(_0x20cfe2,null))['catch'](handleError(_0x20cfe2,null));};exports[_0x2066('0x108')]=function(_0x44178e,_0x21d557,_0x59d2b4){return db[_0x2066('0x42')]['find']({'where':{'id':_0x44178e[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x21d557,null))[_0x2066('0x23')](function(_0x381ec9){if(_0x381ec9){return _0x381ec9['removeTags'](_0x44178e[_0x2066('0x47')][_0x2066('0xfb')]);}})['then'](respondWithStatusCode(_0x21d557,null))['catch'](handleError(_0x21d557,null));};exports[_0x2066('0xd4')]=function(_0x9a7a3,_0x2bb60b){var _0x5b5f3f=moment()[_0x2066('0x109')]()['toString']();var _0x32abbe=path[_0x2066('0xd5')](config[_0x2066('0xd6')],_0x2066('0x10a'),'files',_0x2066('0x10b'));var _0x1ce72d=path[_0x2066('0xd5')](config['root'],_0x2066('0x10a'),_0x2066('0x10c'),_0x2066('0x10d'));var _0x465027=path[_0x2066('0xd5')](_0x32abbe,_0x5b5f3f);var _0x2af567=util[_0x2066('0xda')](_0x2066('0x10e'),_0x9a7a3[_0x2066('0xbd')]['id'],_0x5b5f3f);var _0x8fca96=path['join'](_0x32abbe,_0x2af567);var _0x9aea61=[];_0x9aea61[_0x2066('0x40')]({'model':db['User'],'as':'User','attributes':['id',_0x2066('0xe7')],'raw':!![]});_0x9aea61[_0x2066('0x40')]({'model':db[_0x2066('0x10f')],'as':_0x2066('0x6e'),'attributes':['id',_0x2066('0x110'),_0x2066('0x111')],'raw':!![]});if(_0x9a7a3[_0x2066('0x47')][_0x2066('0x10d')]){_0x9aea61['push']({'model':db[_0x2066('0xd0')],'as':_0x2066('0xd0'),'raw':!![]});}var _0x5534ef=[{'model':db[_0x2066('0xdd')],'as':_0x2066('0xde'),'attributes':['id','body','createdAt',_0x2066('0xeb'),_0x2066('0xec'),_0x2066('0x8c')],'include':_0x9aea61}];_0x5534ef[_0x2066('0x40')]({'model':db[_0x2066('0xdf')],'as':_0x2066('0x112'),'attributes':['id',_0x2066('0x3a')]});_0x5534ef['push']({'model':db[_0x2066('0x79')],'as':_0x2066('0x113'),'attributes':['id',_0x2066('0xe7')]});return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x9a7a3['params']['id']},'include':_0x5534ef})[_0x2066('0x23')](handleEntityNotFound(_0x2bb60b,null))[_0x2066('0x23')](function(_0x112def){if(_0x112def){var _0x3a3a20=_0x112def[_0x2066('0x114')]({'plain':!![]});fs['mkdirSync'](_0x465027);var _0x50f70e={'format':'A4','border':_0x2066('0x115'),'header':{'height':'40px','contents':{'first':_0x2066('0x116')}},'footer':{'height':_0x2066('0x117'),'contents':{'default':util['format'](_0x2066('0x118'),util[_0x2066('0xda')](_0x2066('0x119'),_0x2066('0x11a'),_0x3a3a20['id']),moment()[_0x2066('0xda')](_0x2066('0x11b'))[_0x2066('0xa5')]())}}};var _0x28d343={'channel':_0x2066('0x11a'),'account':_0x3a3a20[_0x2066('0x112')][_0x2066('0x3a')],'agent':_0x3a3a20[_0x2066('0x113')]?_0x3a3a20[_0x2066('0x113')][_0x2066('0xe7')]:'N.A.','createdAt':moment(_0x3a3a20[_0x2066('0xe9')])[_0x2066('0xda')](_0x2066('0x11c'))[_0x2066('0xa5')](),'closedAt':_0x3a3a20[_0x2066('0xc7')]?moment(_0x3a3a20['closedAt'])[_0x2066('0xda')](_0x2066('0x11c'))[_0x2066('0xa5')]():'','disposition':_0x3a3a20['disposition'],'chatInfo':{'browser':_0x3a3a20[_0x2066('0x11d')],'os':_0x3a3a20['osName'],'referer':_0x3a3a20['referer'],'customerIp':_0x3a3a20[_0x2066('0x11e')],'customerPort':_0x3a3a20['customerPort']?_0x3a3a20[_0x2066('0x11f')]:_0x2066('0x120')},'messages':_(_0x3a3a20[_0x2066('0xde')])[_0x2066('0x121')]()[_0x2066('0x92')]({'secret':![]})[_0x2066('0x3c')](function(_0x24fce6){if(_0x24fce6[_0x2066('0xd0')]){var _0x3ca71d=path[_0x2066('0xd5')](_0x1ce72d,_0x24fce6[_0x2066('0xd0')]['basename']);if(fs[_0x2066('0x122')](_0x3ca71d)){fs[_0x2066('0x123')](_0x3ca71d)['pipe'](fs[_0x2066('0x124')](path[_0x2066('0xd5')](_0x465027,_0x24fce6[_0x2066('0xd0')][_0x2066('0xcd')])));}}return{'date':moment(_0x24fce6[_0x2066('0xe9')])[_0x2066('0xda')](_0x2066('0x11c'))['toString'](),'sender':_0x24fce6[_0x2066('0xeb')]==='out'?_0x24fce6['User']?_0x24fce6[_0x2066('0x79')][_0x2066('0xe7')]:_0x2066('0xe2'):_0x24fce6[_0x2066('0x6e')]['firstName']+(_0x24fce6['Contact'][_0x2066('0x111')]?'\x20'+_0x24fce6[_0x2066('0x6e')][_0x2066('0x111')]:''),'body':_0x24fce6[_0x2066('0xd0')]?_0x24fce6[_0x2066('0xd0')][_0x2066('0xcd')]:_0x24fce6[_0x2066('0x7e')],'direction':_0x24fce6['direction']===_0x2066('0x125')?'A':'C','secret':_0x24fce6[_0x2066('0xec')],'read':_0x24fce6['read'],'attachment':_0x24fce6[_0x2066('0xd0')]};})[_0x2066('0x6b')]()};return ejs[_0x2066('0x126')](path[_0x2066('0xd5')](config['root'],_0x2066('0x10a'),_0x2066('0x127'),_0x2066('0x128')),{'interaction':_0x28d343})[_0x2066('0x23')](function(_0x125721){return new BPromise(function(_0x257263,_0xb2d7ed){pdf[_0x2066('0xbf')](_0x125721,_0x50f70e)[_0x2066('0x129')](path['join'](_0x465027,_0x2066('0x12a')+_0x3a3a20['id']+'-'+_0x5b5f3f+_0x2066('0x12b')),function(_0x39212b,_0x1c8a08){if(_0x39212b)return _0xb2d7ed(_0x39212b);_0x257263(_0x1c8a08);});});})[_0x2066('0x23')](function(){return new BPromise(function(_0x4c7675,_0x58d700){zipdir(_0x465027,{'saveTo':_0x8fca96},function(_0x32b316,_0x10541b){if(_0x32b316)return _0x58d700(_0x32b316);return _0x4c7675(_0x10541b);});})['then'](function(){return new BPromise(function(_0x2e81b4,_0x1a8b1e){rimraf(_0x465027,function(_0x4f4075){if(_0x4f4075)_0x1a8b1e(_0x4f4075);return _0x2e81b4();});});})[_0x2066('0x23')](function(){return _0x2bb60b[_0x2066('0xd4')](_0x8fca96,_0x2af567,function(_0x59f9e3){if(_0x59f9e3){console[_0x2066('0x12c')](_0x2066('0x12d'),_0x59f9e3);}else{fs[_0x2066('0x12e')](_0x8fca96);}});});});}else{return _0x2bb60b['sendStatus'](0xc8);}})[_0x2066('0x2c')](handleError(_0x2bb60b,null));}; \ No newline at end of file +var _0x08a8=['to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','fullname','TagIds','split','forEach','push','catch','index','map','ChatInteraction','rawAttributes','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','field','color','from','select','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','UserId','body','some','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','i.ChatWebsiteId\x20IS\x20NULL','count','sequelize','toString','keyBy','merge','a.key','Account.key','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','params','includeAll','include','options','create','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','attachmentUpload','file','basename','filename','mimetype','Attachment','findOne','Unauthorized','attachId','close','mailTranscript','join','root','server/files/chat/upload/','transcript-%s.txt','ChatMessage','Messages','CmContact','format','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','YYYY-MM-DD\x20HH:mm:ss','getMyMessages','findAll','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','Contact','lastName','createdAt','Account','Owner','get','mkdirSync','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closedAt','disposition','referer','customerIp','customerPort','existsSync','createReadStream','pipe','out','firstName','renderFile','views','transcript-','download','log','err','unlinkSync','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util'];(function(_0x35cf8d,_0x3907c8){var _0xd6cb8b=function(_0x43a7e2){while(--_0x43a7e2){_0x35cf8d['push'](_0x35cf8d['shift']());}};_0xd6cb8b(++_0x3907c8);}(_0x08a8,0x112));var _0x808a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a8[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x808a('0x0'));var emlformat=require(_0x808a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x808a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x808a('0x3'));var moment=require('moment');var BPromise=require(_0x808a('0x4'));var Mustache=require(_0x808a('0x5'));var util=require(_0x808a('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x808a('0x7'));var ejs=require(_0x808a('0x8'));var fs=require('fs');var _=require(_0x808a('0x9'));var squel=require('squel');var crypto=require(_0x808a('0xa'));var jsforce=require(_0x808a('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x808a('0xc'));var authService=require(_0x808a('0xd'));var qs=require(_0x808a('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x808a('0xf'))(_0x808a('0x10'));var utils=require(_0x808a('0x11'));var config=require(_0x808a('0x12'));var db=require(_0x808a('0x13'))['db'];config[_0x808a('0x14')]=_[_0x808a('0x15')](config[_0x808a('0x14')],{'host':_0x808a('0x16'),'port':0x18eb});var socket=require(_0x808a('0x17'))(new Redis(config[_0x808a('0x14')]));require(_0x808a('0x18'))[_0x808a('0x19')](socket);var jayson=require(_0x808a('0x1a'));var client=jayson[_0x808a('0x1b')]['http']({'port':0x232b});var client9004=jayson[_0x808a('0x1b')][_0x808a('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x22a383,_0x4a35f2,_0x4dbf3e){if(_0x4dbf3e){var _0x1c302f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c302f[_0x808a('0x1d')](_0x4a35f2)){return _0x22a383;}else{throw new db[(_0x808a('0x1e'))][(_0x808a('0x1f'))](_0x808a('0x20'));}}else{return _0x22a383;}}function respondWithRpcPromise(_0x1441a6,_0x120b75,_0x237972,_0x3c00aa){return new BPromise(function(_0x24dc98,_0x131f55){var _0x13c864=_0x3c00aa||client;return _0x13c864[_0x808a('0x21')](_0x1441a6,_0x237972)[_0x808a('0x22')](function(_0x5e5c50){logger[_0x808a('0x23')](_0x808a('0x24'),_0x120b75,_0x808a('0x25'));logger[_0x808a('0x26')](_0x808a('0x27'),_0x120b75,_0x808a('0x25'),JSON[_0x808a('0x28')](_0x5e5c50));if(_0x5e5c50[_0x808a('0x29')]){if(_0x5e5c50['error'][_0x808a('0x2a')]===0x1f4){logger[_0x808a('0x29')](_0x808a('0x24'),_0x120b75,_0x5e5c50[_0x808a('0x29')][_0x808a('0x2b')]);return _0x131f55(_0x5e5c50[_0x808a('0x29')][_0x808a('0x2b')]);}logger['error'](_0x808a('0x24'),_0x120b75,_0x5e5c50[_0x808a('0x29')][_0x808a('0x2b')]);return _0x24dc98(_0x5e5c50[_0x808a('0x29')][_0x808a('0x2b')]);}else{logger[_0x808a('0x23')](_0x808a('0x24'),_0x120b75,_0x808a('0x25'));_0x24dc98(_0x5e5c50['result']['message']);}})['catch'](function(_0x40ae77){logger[_0x808a('0x29')]('ChatInteraction,\x20%s,\x20%s',_0x120b75,_0x40ae77);_0x131f55(_0x40ae77);});});}function respondWithStatusCode(_0x1097bc,_0x50b46a){_0x50b46a=_0x50b46a||0xcc;return function(_0x15636f){if(_0x15636f){return _0x1097bc[_0x808a('0x2c')](_0x50b46a);}return _0x1097bc[_0x808a('0x2d')](_0x50b46a)[_0x808a('0x2e')]();};}function respondWithResult(_0x53da56,_0x4767b3){_0x4767b3=_0x4767b3||0xc8;return function(_0x35dd2c){if(_0x35dd2c){return _0x53da56['status'](_0x4767b3)['json'](_0x35dd2c);}};}function respondWithFilteredResult(_0x392834,_0x181021){return function(_0x4b7216){if(_0x4b7216){var _0x1c92b8=_0x4b7216['count'],_0x3aae30=_0x181021[_0x808a('0x2f')],_0x1feaea=_0x181021[_0x808a('0x2f')]+_0x181021[_0x808a('0x30')],_0x51b2c8;if(_0x1feaea>=_0x1c92b8){_0x1feaea=_0x1c92b8;_0x51b2c8=0xc8;}else{_0x51b2c8=0xce;}_0x392834['status'](_0x51b2c8);return _0x392834[_0x808a('0x31')](_0x808a('0x32'),_0x3aae30+'-'+_0x1feaea+'/'+_0x1c92b8)[_0x808a('0x33')](_0x4b7216);}return null;};}function patchUpdates(_0xcd2998){return function(_0x23439a){try{jsonpatch[_0x808a('0x34')](_0x23439a,_0xcd2998,!![]);}catch(_0x536030){return BPromise[_0x808a('0x35')](_0x536030);}return _0x23439a[_0x808a('0x36')]();};}function saveUpdates(_0x3d6671,_0x3eeece){return function(_0x347bfb){if(_0x347bfb){return _0x347bfb[_0x808a('0x37')](_0x3d6671)['then'](function(_0x581136){return _0x581136;});}return null;};}function removeEntity(_0x34a9c2,_0x54a9d9){return function(_0x476c95){if(_0x476c95){return _0x476c95[_0x808a('0x38')]()[_0x808a('0x22')](function(){_0x34a9c2[_0x808a('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22f9c6,_0x1dcbc2){return function(_0x352651){if(!_0x352651){_0x22f9c6[_0x808a('0x2c')](0x194);}return _0x352651;};}function handleError(_0x1a2468,_0x4d9497){_0x4d9497=_0x4d9497||0x1f4;return function(_0x3fd948){logger[_0x808a('0x29')](_0x3fd948[_0x808a('0x39')]);if(_0x3fd948[_0x808a('0x3a')]){delete _0x3fd948[_0x808a('0x3a')];}_0x1a2468[_0x808a('0x2d')](_0x4d9497)[_0x808a('0x3b')](_0x3fd948);};}function getInteractionUsers(_0x49306a,_0x5eaa27){return new BPromise(function(_0x4a6079,_0x5207a1){try{if(_0x5eaa27[_0x49306a['id']]){_0x49306a['Users']=_['map'](_0x5eaa27[_0x49306a['id']],function(_0x173d02){return{'id':_0x173d02['id'],'fullname':_0x173d02[_0x808a('0x3c')]};});}}catch(_0x1ca9e3){_0x5207a1(_0x1ca9e3);}_0x4a6079(_0x49306a);});}function getInteractionTags(_0x222649,_0x3273b4){return new BPromise(function(_0x292e54,_0x30a49b){try{if(_0x222649[_0x808a('0x3d')]){_0x222649['Tags']=[];_0x222649[_0x808a('0x3d')][_0x808a('0x3e')](',')[_0x808a('0x3f')](function(_0x5dbebf){_0x222649['Tags'][_0x808a('0x40')](_0x3273b4[_0x5dbebf]);});}delete _0x222649['TagIds'];}catch(_0x15d932){_0x30a49b(_0x15d932);}_0x292e54(_0x222649);});}function updateChatInteraction(_0x388bc4,_0x768e3,_0x4d184d){return new BPromise(function(_0x2240f9,_0x1b7782){return getInteractionUsers(_0x388bc4,_0x4d184d)['then'](function(_0x5b16d3){return getInteractionTags(_0x5b16d3,_0x768e3);})[_0x808a('0x22')](function(_0x3f0707){_0x2240f9(_0x3f0707);})[_0x808a('0x41')](function(_0x183a6d){_0x1b7782(_0x183a6d);});});}exports[_0x808a('0x42')]=function(_0x45c243,_0x4c624a){var _0x54b232={},_0x4d5f2e={},_0x22c430={'count':0x0,'rows':[]};var _0xf2d42=_[_0x808a('0x43')](db[_0x808a('0x44')][_0x808a('0x45')],function(_0x2a0fe1){return{'name':_0x2a0fe1['fieldName'],'type':_0x2a0fe1[_0x808a('0x46')][_0x808a('0x47')]};});_0x4d5f2e[_0x808a('0x48')]=_[_0x808a('0x43')](_0xf2d42,_0x808a('0x3a'));_0x4d5f2e['query']=_[_0x808a('0x49')](_0x45c243[_0x808a('0x4a')]);_0x4d5f2e['filters']=_[_0x808a('0x4b')](_0x4d5f2e['model'],_0x4d5f2e[_0x808a('0x4a')]);_0x54b232['attributes']=_['intersection'](_0x4d5f2e[_0x808a('0x48')],qs[_0x808a('0x4c')](_0x45c243[_0x808a('0x4a')]['fields']));_0x54b232[_0x808a('0x4d')]=_0x54b232['attributes'][_0x808a('0x4e')]?_0x54b232[_0x808a('0x4d')]:_0x4d5f2e[_0x808a('0x48')];if(!_0x45c243[_0x808a('0x4a')][_0x808a('0x4f')](_0x808a('0x50'))){_0x54b232['limit']=qs[_0x808a('0x30')](_0x45c243[_0x808a('0x4a')]['limit']);_0x54b232[_0x808a('0x2f')]=qs[_0x808a('0x2f')](_0x45c243[_0x808a('0x4a')][_0x808a('0x2f')]);}_0x54b232[_0x808a('0x51')]=qs[_0x808a('0x52')](_0x45c243[_0x808a('0x4a')][_0x808a('0x52')]);_0x54b232[_0x808a('0x53')]=qs[_0x808a('0x54')](_['pick'](_0x45c243[_0x808a('0x4a')],_0x4d5f2e['filters']));var _0x2f33e9=[];var _0x21b521=squel['select']()[_0x808a('0x55')]('id')[_0x808a('0x55')](_0x808a('0x3a'))[_0x808a('0x55')](_0x808a('0x56'))[_0x808a('0x57')]('tools_tags');var _0x473467=squel[_0x808a('0x58')]()[_0x808a('0x55')](_0x808a('0x59'))[_0x808a('0x55')](_0x808a('0x5a'))['field'](_0x808a('0x5b'))['from'](_0x808a('0x5c'),'ui')[_0x808a('0x5d')](_0x808a('0x5e'),'u','u.id\x20=\x20ui.UserId');var _0xb64dc8=squel['select']()[_0x808a('0x57')]('chat_interactions','i')[_0x808a('0x5d')](_0x808a('0x5f'),'c',_0x808a('0x60'))[_0x808a('0x5d')]('users','o',_0x808a('0x61'))[_0x808a('0x5d')](_0x808a('0x62'),'a',_0x808a('0x63'))[_0x808a('0x5d')](_0x808a('0x64'),'me',_0x808a('0x65'))[_0x808a('0x5d')](_0x808a('0x66'),'it',_0x808a('0x67'))[_0x808a('0x5d')](_0x808a('0x68'),'t',_0x808a('0x69'));var _0x36836e=squel[_0x808a('0x6a')]();var _0x2acf12=[];var _0x385aa0=squel['expr']();var _0x6220a4;if(_0x45c243[_0x808a('0x4a')][_0x808a('0x6b')]){_0x6220a4=as['parseSearch'](_0x45c243[_0x808a('0x4a')][_0x808a('0x6b')]);var _0x54324d=_0x6220a4['sqlOperator'];for(var _0x11f26c=0x0;_0x11f26c<_0x6220a4['conditions'][_0x808a('0x4e')];_0x11f26c++){var _0x1eff8e=_0x6220a4[_0x808a('0x6c')][_0x11f26c];var _0x3f275='i';var _0x393486=_[_0x808a('0x6d')](_0xf2d42,[_0x808a('0x3a'),_0x1eff8e['field']]);if(!_0x393486){switch(_0x1eff8e[_0x808a('0x55')]){case _0x808a('0x6e'):if(_0x1eff8e[_0x808a('0x6f')]==0x1){_0xb64dc8[_0x808a('0x70')]('`'+_0x1eff8e['field']+_0x808a('0x71'));}else{_0xb64dc8[_0x808a('0x70')]('`'+_0x1eff8e[_0x808a('0x55')]+_0x808a('0x72'));}break;case'Contact':if(_0x1eff8e['operator']===_0x808a('0x73')){if(_0x1eff8e[_0x808a('0x6f')][_0x808a('0x3e')]('\x20')[_0x808a('0x4e')]>0x1){_0x36836e[_0x54324d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x808a('0x74')](_0x1eff8e[_0x808a('0x6f')]),null);}else{var _0x44a5b1='%'+_0x1eff8e[_0x808a('0x6f')]+'%';_0x36836e[_0x54324d](_0x808a('0x75'),_0x44a5b1,_0x44a5b1,_0x44a5b1);}}else{_0x393486=_[_0x808a('0x6d')](_0xf2d42,[_0x808a('0x3a'),'ContactId']);_0x1eff8e[_0x808a('0x55')]=_0x808a('0x76');_0x2fb16d=as[_0x808a('0x77')](_0x3f275,_0x393486['type'],_0x1eff8e);_0x36836e[_0x54324d](_0x2fb16d[_0x808a('0x78')],_0x2fb16d[_0x808a('0x6f')][_0x808a('0x79')],_0x2fb16d[_0x808a('0x6f')][_0x808a('0x2e')]);}break;case'Tag':var _0x269972=_0x1eff8e[_0x808a('0x6f')][_0x808a('0x3e')](',')[_0x808a('0x43')](function(_0x393a44){return Number(_0x393a44);});_0x269972['forEach'](function(_0x3f1467){_0x385aa0['or'](_0x808a('0x7a'),'%,'+_0x3f1467+',%');});_0x2acf12=_['union'](_0x2acf12,_0x269972);break;case _0x808a('0x7b'):if(_0x1eff8e[_0x808a('0x7c')]==='$substring'){_0x36836e[_0x54324d]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1eff8e[_0x808a('0x6f')]+'%',null);}else{_0x393486=_[_0x808a('0x6d')](_0xf2d42,[_0x808a('0x3a'),_0x808a('0x7d')]);_0x1eff8e['field']=_0x808a('0x7d');_0x2fb16d=as[_0x808a('0x77')](_0x3f275,_0x393486['type'],_0x1eff8e);_0x36836e[_0x54324d](_0x2fb16d[_0x808a('0x78')],_0x2fb16d[_0x808a('0x6f')][_0x808a('0x79')],_0x2fb16d[_0x808a('0x6f')][_0x808a('0x2e')]);}break;case _0x808a('0x7e'):_0x2fb16d=as['buildExpression']('me',null,_0x1eff8e);_0x36836e[_0x54324d](_0x2fb16d[_0x808a('0x78')],_0x2fb16d[_0x808a('0x6f')]['start'],_0x2fb16d[_0x808a('0x6f')][_0x808a('0x2e')]);break;}}else{var _0x2fb16d=as[_0x808a('0x77')](_0x3f275,_0x393486['type'],_0x1eff8e);_0x36836e[_0x54324d](_0x2fb16d[_0x808a('0x78')],_0x2fb16d[_0x808a('0x6f')]['start'],_0x2fb16d[_0x808a('0x6f')][_0x808a('0x2e')]);}}}else{var _0x90891e=_(_0x45c243[_0x808a('0x4a')])[_0x808a('0x49')]()[_0x808a('0x43')](function(_0x5dc084){return _[_0x808a('0x7f')](_0xf2d42,['name',_0x5dc084])?_0x5dc084:undefined;})['compact']()[_0x808a('0x6f')]();if(!_[_0x808a('0x80')](_0x90891e)){_0x90891e['forEach'](function(_0x37d84e){if(_0x37d84e==='ChatWebsiteId'){_0xb64dc8[_0x808a('0x53')](_0x808a('0x81'),[][_0x808a('0x82')](_0x45c243[_0x808a('0x4a')][_0x37d84e]));}else if(_0x37d84e==='createdAt'){var _0x27ac0d=JSON[_0x808a('0x83')](_0x45c243[_0x808a('0x4a')][_0x37d84e])[_0x808a('0x84')];var _0x3cb1c5=JSON[_0x808a('0x83')](_0x45c243[_0x808a('0x4a')][_0x37d84e])[_0x808a('0x85')];_0xb64dc8[_0x808a('0x53')](_0x808a('0x86'),_0x27ac0d,_0x3cb1c5);}else{if(_0x45c243[_0x808a('0x4a')][_0x37d84e]===_0x808a('0x87')){_0xb64dc8[_0x808a('0x53')]('i.'+_0x37d84e+'\x20IS\x20NULL');}else{_0xb64dc8[_0x808a('0x53')]('i.'+_0x37d84e+_0x808a('0x88'),_0x45c243['query'][_0x37d84e]);}}});}if(_0x45c243[_0x808a('0x4a')][_0x808a('0x89')]){if(_0x45c243[_0x808a('0x4a')][_0x808a('0x89')]==0x1){_0xb64dc8[_0x808a('0x70')]('`unreadMessages`\x20=\x200');}else{_0xb64dc8['having']('`unreadMessages`\x20>\x200');}}if(_0x45c243['query']['tag']){_0x2acf12=_['isArray'](_0x45c243[_0x808a('0x4a')]['tag'])?_0x45c243['query'][_0x808a('0x8a')]:new Array(_0x45c243[_0x808a('0x4a')]['tag']);_0x2acf12[_0x808a('0x3f')](function(_0x43edc){_0x385aa0['or'](_0x808a('0x7a'),'%,'+_0x43edc+',%');});}if(_0x45c243[_0x808a('0x4a')][_0x808a('0x8b')]){var _0x360031=_0x45c243[_0x808a('0x4a')][_0x808a('0x8b')]['replace']('\x5c','\x5c\x5c')[_0x808a('0x8c')]('\x27\x27',_0x808a('0x8d'));if(qs['isNumeric'](_0x360031)){_0x36836e['or'](_0x808a('0x8e'),_0x360031+'%');}else{_0x36836e['or'](_0x808a('0x8f'),qs['getFullTextValue'](_0x360031))['or'](_0x808a('0x90'),_0x360031+'%');}}}_0xb64dc8['where'](_0x36836e);_0xb64dc8['group'](_0x808a('0x91'));var _0x2ea7a5={'type':db[_0x808a('0x1e')][_0x808a('0x92')][_0x808a('0x93')],'raw':!![]};var _0x26fe77=_0xb64dc8[_0x808a('0x94')]();_0x26fe77[_0x808a('0x55')](_0x808a('0x91'));_0x26fe77[_0x808a('0x55')](_0x808a('0x95'),'unreadMessages');if(_0x54b232[_0x808a('0x51')]){_0x54b232['order']['forEach'](function(_0x59723f){_0xb64dc8['order']('i.'+_0x59723f[0x0],_0x59723f[0x1]==='DESC'?![]:!![]);});}if(!_[_0x808a('0x80')](_0x2acf12)){_0xb64dc8[_0x808a('0x70')](_0x385aa0);_0x26fe77[_0x808a('0x53')](_0x808a('0x96'),_0x2acf12);}BPromise[_0x808a('0x97')]()[_0x808a('0x22')](function(){if(!_0x6220a4&&_0x45c243[_0x808a('0x4a')][_0x808a('0x98')])return;return _0x45c243[_0x808a('0x99')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0x808a('0x22')](function(_0xd81d1d){if(_[_0x808a('0x80')](_0xd81d1d)){_0x26fe77[_0x808a('0x53')](_0x808a('0x9a'));_0xb64dc8['where'](_0x808a('0x9a'));}else{_0x26fe77['where']('i.ChatWebsiteId\x20IN\x20?',_['map'](_0xd81d1d,'id'));_0xb64dc8['where'](_0x808a('0x81'),_['map'](_0xd81d1d,'id'));}});})[_0x808a('0x22')](function(){db['sequelize'][_0x808a('0x4a')](_0x26fe77['toString'](),_0x2ea7a5)[_0x808a('0x22')](function(_0x33d2b8){_0x22c430[_0x808a('0x9b')]=_0x33d2b8['length'];if(_0x22c430['count']===0x0)return[];return db[_0x808a('0x9c')][_0x808a('0x4a')](_0x21b521[_0x808a('0x9d')](),_0x2ea7a5)[_0x808a('0x22')](function(_0x1a6f7b){_0x2f33e9=_[_0x808a('0x9e')](_0x1a6f7b,'id');_0x2ea7a5=_[_0x808a('0x9f')](_0x2ea7a5,{'model':db[_0x808a('0x44')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x45c243['query'][_0x808a('0x4c')]){_0x54b232[_0x808a('0x4d')]['forEach'](function(_0x5255c8){_0xb64dc8[_0x808a('0x55')]('i.'+_0x5255c8);});}else{_0xb64dc8['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x808a('0x6e'));_0xb64dc8[_0x808a('0x55')](_0x808a('0xa0'),_0x808a('0xa1'));_0xb64dc8[_0x808a('0x55')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0xb64dc8[_0x808a('0x55')](_0x808a('0xa2'));_0xb64dc8[_0x808a('0x55')](_0x808a('0xa3'),_0x808a('0xa4'));_0xb64dc8[_0x808a('0x55')]('c.lastName',_0x808a('0xa5'));_0xb64dc8[_0x808a('0x55')](_0x808a('0xa6'),'Contact.email');_0xb64dc8[_0x808a('0x55')]('c.phone','Contact.phone');_0xb64dc8['field'](_0x808a('0xa7'),'Contact.mobile');_0xb64dc8[_0x808a('0x55')](_0x808a('0xa8'),_0x808a('0xa9'));_0xb64dc8[_0x808a('0x55')](_0x808a('0xaa'),'Owner.fullname');_0xb64dc8['field'](_0x808a('0xab'),_0x808a('0xac'));_0xb64dc8[_0x808a('0x55')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x808a('0x3d'));}_0xb64dc8[_0x808a('0x30')](_0x54b232['limit']);_0xb64dc8[_0x808a('0x2f')](_0x54b232['offset']);return db[_0x808a('0x9c')]['query'](_0xb64dc8[_0x808a('0x9d')](),_0x2ea7a5);})['then'](function(_0x2fcd83){_0x473467[_0x808a('0x53')](_0x808a('0xad'),_[_0x808a('0x43')](_0x2fcd83,'id'));return db[_0x808a('0x9c')][_0x808a('0x4a')](_0x473467['toString'](),_0x2ea7a5)['then'](function(_0x161738){var _0x376e74=_[_0x808a('0xae')](_0x161738,_0x808a('0xaf'));var _0x249a90=[];_0x2fcd83[_0x808a('0x3f')](function(_0x4d9c51){_0x249a90[_0x808a('0x40')](updateChatInteraction(_0x4d9c51,_0x2f33e9,_0x376e74));});return BPromise[_0x808a('0xb0')](_0x249a90);});});})[_0x808a('0x22')](function(_0x4a2b31){_0x22c430[_0x808a('0xb1')]=_0x4a2b31;return _0x22c430;})[_0x808a('0x22')](respondWithFilteredResult(_0x4c624a,_0x54b232));})[_0x808a('0x41')](handleError(_0x4c624a,null));};exports['show']=function(_0x56e95c,_0xf2b2d9){var _0x3fe26c={'raw':![],'where':{'id':_0x56e95c[_0x808a('0xb2')]['id']}},_0x54b769={};_0x54b769[_0x808a('0x48')]=_['keys'](db[_0x808a('0x44')][_0x808a('0x45')]);_0x54b769[_0x808a('0x4a')]=_[_0x808a('0x49')](_0x56e95c[_0x808a('0x4a')]);_0x54b769['filters']=_[_0x808a('0x4b')](_0x54b769[_0x808a('0x48')],_0x54b769['query']);_0x3fe26c[_0x808a('0x4d')]=_['intersection'](_0x54b769[_0x808a('0x48')],qs[_0x808a('0x4c')](_0x56e95c[_0x808a('0x4a')]['fields']));_0x3fe26c[_0x808a('0x4d')]=_0x3fe26c[_0x808a('0x4d')][_0x808a('0x4e')]?_0x3fe26c[_0x808a('0x4d')]:_0x54b769[_0x808a('0x48')];if(_0x56e95c[_0x808a('0x4a')][_0x808a('0xb3')]){_0x3fe26c[_0x808a('0xb4')]=[{'all':!![]}];}_0x3fe26c=_[_0x808a('0x9f')]({},_0x3fe26c,_0x56e95c[_0x808a('0xb5')]);return db['ChatInteraction'][_0x808a('0x6d')](_0x3fe26c)[_0x808a('0x22')](handleEntityNotFound(_0xf2b2d9,null))[_0x808a('0x22')](respondWithResult(_0xf2b2d9,null))[_0x808a('0x41')](handleError(_0xf2b2d9,null));};exports['create']=function(_0x54f4dd,_0x379edf){return db[_0x808a('0x44')][_0x808a('0xb6')](_0x54f4dd[_0x808a('0x7e')],{})[_0x808a('0x22')](respondWithResult(_0x379edf,0xc9))[_0x808a('0x41')](handleError(_0x379edf,null));};exports[_0x808a('0x37')]=function(_0x2a2597,_0x2d3f5a){if(_0x2a2597[_0x808a('0x7e')]['id']){delete _0x2a2597[_0x808a('0x7e')]['id'];}return db['ChatInteraction'][_0x808a('0x6d')]({'where':{'id':_0x2a2597[_0x808a('0xb2')]['id']}})[_0x808a('0x22')](handleEntityNotFound(_0x2d3f5a,null))['then'](saveUpdates(_0x2a2597['body'],null))[_0x808a('0x22')](respondWithResult(_0x2d3f5a,null))[_0x808a('0x41')](handleError(_0x2d3f5a,null));};exports[_0x808a('0x38')]=function(_0x83901,_0x523f7d){return db[_0x808a('0x44')][_0x808a('0x6d')]({'where':{'id':_0x83901[_0x808a('0xb2')]['id']}})[_0x808a('0x22')](handleEntityNotFound(_0x523f7d,null))[_0x808a('0x22')](removeEntity(_0x523f7d,null))[_0x808a('0x41')](handleError(_0x523f7d,null));};exports[_0x808a('0xb7')]=function(_0x4769ff,_0x32dbea){return db[_0x808a('0x44')][_0x808a('0xb7')]()[_0x808a('0x22')](respondWithResult(_0x32dbea,null))[_0x808a('0x41')](handleError(_0x32dbea,null));};exports['customUpdate']=function(_0x1cf157,_0x2893d1){if(_0x1cf157[_0x808a('0x7e')]['id']){delete _0x1cf157[_0x808a('0x7e')]['id'];}return db[_0x808a('0x44')][_0x808a('0x6d')]({'where':{'id':_0x1cf157[_0x808a('0xb2')]['id']}})[_0x808a('0x22')](handleEntityNotFound(_0x2893d1,null))[_0x808a('0x22')](saveUpdates(_0x1cf157[_0x808a('0x7e')],null))[_0x808a('0x22')](respondWithResult(_0x2893d1,null))[_0x808a('0x41')](handleError(_0x2893d1,null));};exports[_0x808a('0xb8')]=function(_0x192c29,_0x3d7d76,_0x6af20f){if(_0x192c29[_0x808a('0x7e')]['id']){delete _0x192c29[_0x808a('0x7e')]['id'];}return db[_0x808a('0x44')][_0x808a('0x6d')]({'where':{'id':_0x192c29[_0x808a('0xb2')]['id']}})[_0x808a('0x22')](function(_0x424a83){if(!_0x424a83){logger[_0x808a('0x29')](_0x808a('0xb9'),_0x808a('0xb8'),0x194,_0x808a('0xba'));_0x3d7d76[_0x808a('0x2c')](0x194);}else{if(_0x424a83[_0x808a('0x7d')]){throw new db[(_0x808a('0x1e'))][(_0x808a('0x1f'))](_0x808a('0xbb'));}}return _0x424a83;})[_0x808a('0x22')](function(_0x8b7b51){if(_0x8b7b51){return _0x8b7b51['update']({'closed':_0x192c29[_0x808a('0x7e')][_0x808a('0xbc')],'disposition':_0x192c29['body']['disposition']})[_0x808a('0x22')](function(_0x36e183){return _0x36e183;});}})[_0x808a('0x22')](function(_0x150df5){return respondWithRpcPromise(_0x808a('0xbd'),_0x808a('0xb8'),_0x192c29[_0x808a('0x7e')],client9004);})[_0x808a('0x22')](respondWithResult(_0x3d7d76,null))['catch'](handleError(_0x3d7d76,null));};exports[_0x808a('0xbe')]=function(_0x3bfb68,_0x2217fd,_0x17853b){_0x3bfb68['body'][_0x808a('0x3a')]=_0x3bfb68[_0x808a('0xbf')]['originalname'];_0x3bfb68[_0x808a('0x7e')][_0x808a('0xc0')]=_0x3bfb68[_0x808a('0xbf')][_0x808a('0xc1')];_0x3bfb68[_0x808a('0x7e')][_0x808a('0x46')]=_0x3bfb68[_0x808a('0xbf')][_0x808a('0xc2')];return db[_0x808a('0xc3')][_0x808a('0xb6')](_0x3bfb68[_0x808a('0x7e')])[_0x808a('0x22')](respondWithResult(_0x2217fd,0xc9))['catch'](handleError(_0x2217fd,null));};exports['attachmentDownload']=function(_0x328c8c,_0x8c3939,_0x14970b){return db[_0x808a('0x44')][_0x808a('0xc4')]({'where':{'id':_0x328c8c[_0x808a('0xb2')]['id']},'raw':!![]})[_0x808a('0x22')](handleEntityNotFound(_0x8c3939,null))[_0x808a('0x22')](function(_0x43982f){if(_0x43982f){if(_0x43982f[_0x808a('0xbc')]){return _0x8c3939['status'](0x193)[_0x808a('0x33')]({'status':0x193,'message':_0x808a('0xc5')});}return db[_0x808a('0xc3')][_0x808a('0xc4')]({'where':{'id':_0x328c8c[_0x808a('0x4a')][_0x808a('0xc6')]},'raw':!![]})[_0x808a('0x22')](handleEntityNotFound(_0x8c3939,null));}})[_0x808a('0x22')](function(_0x922964){if(_0x922964){return _0x8c3939['download'](path['join'](config['root'],'server/files/attachments/',_0x922964[_0x808a('0xc0')]));}})[_0x808a('0x41')](handleError(_0x8c3939,null));};exports[_0x808a('0xc7')]=function(_0x19aab4,_0x7a2bdc){var _0x52749e=null;var _0x3b158f=null;var _0x4c5c5e=null;var _0x1938e7=null;if(_0x19aab4[_0x808a('0x7e')]['id']){delete _0x19aab4[_0x808a('0x7e')]['id'];}if(_0x19aab4[_0x808a('0x7e')][_0x808a('0xc8')]){_0x1938e7=path[_0x808a('0xc9')](config[_0x808a('0xca')],_0x808a('0xcb'),util['format'](_0x808a('0xcc'),Date['now']()));_0x19aab4[_0x808a('0x7e')]['pathTranscript']=_0x1938e7;}return db[_0x808a('0x44')]['find']({'where':{'id':_0x19aab4[_0x808a('0xb2')]['id']},'include':[{'model':db[_0x808a('0xcd')],'as':_0x808a('0xce'),'include':[{'model':db[_0x808a('0x7b')],'as':_0x808a('0x7b')}]}]})[_0x808a('0x22')](handleEntityNotFound(_0x7a2bdc,null))[_0x808a('0x22')](saveUpdates(_0x19aab4[_0x808a('0x7e')],null))[_0x808a('0x22')](function(_0x210f8b){if(_0x210f8b){_0x52749e=_0x210f8b;return db['ChatWebsite'][_0x808a('0x6d')]({'where':{'id':_0x52749e[_0x808a('0x98')]}});}})[_0x808a('0x22')](function(_0x73ca13){if(_0x73ca13){_0x4c5c5e=_0x73ca13;return db[_0x808a('0xcf')][_0x808a('0x6d')]({'where':{'id':_0x52749e[_0x808a('0x76')]}});}})[_0x808a('0x22')](function(_0x347405){if(_0x347405){_0x3b158f=_0x347405;if(_0x1938e7){var _0x25a2df=null;for(var _0x5c3772=0x1;_0x5c3772<_0x52749e[_0x808a('0xce')][_0x808a('0x4e')];++_0x5c3772){_0x25a2df=_0x52749e[_0x808a('0xce')][_0x5c3772];var _0x4e7827=_0x25a2df[_0x808a('0x7d')]?util[_0x808a('0xd0')](_0x808a('0xd1'),_0x4c5c5e[_0x808a('0xd2')],_0x25a2df['UserId']):'System';var _0x294045=_0x19aab4[_0x808a('0x7e')][_0x808a('0xd3')]||util[_0x808a('0xd0')]('%s%d',_0x808a('0xd4'),_0x25a2df[_0x808a('0x76')]);switch(_0x4c5c5e[_0x808a('0xd5')]){case _0x808a('0xd6'):_0x4e7827=_0x25a2df[_0x808a('0x7d')]?util[_0x808a('0xd0')]('%s%d',_0x4c5c5e[_0x808a('0xd2')],_0x25a2df[_0x808a('0x7d')]):_0x808a('0xd7');break;case'agent_alias':_0x4e7827=_0x25a2df[_0x808a('0x7d')]?_0x25a2df['User']['alias']||_0x25a2df[_0x808a('0x7b')][_0x808a('0x3c')]:_0x808a('0xd7');break;case _0x808a('0xd8'):_0x4e7827=_0x25a2df[_0x808a('0x7d')]?_0x25a2df[_0x808a('0x7b')][_0x808a('0x3c')]:_0x808a('0xd7');break;default:_0x4e7827=_0x25a2df[_0x808a('0x7d')]?util[_0x808a('0xd0')](_0x808a('0xd1'),_0x4c5c5e[_0x808a('0xd2')],_0x25a2df[_0x808a('0x7d')]):_0x808a('0xd7');}var _0x3c9ad5=util[_0x808a('0xd0')](_0x808a('0xd9'),moment(_0x25a2df['createdAt'])[_0x808a('0xd0')](_0x808a('0xda')),_0x25a2df[_0x808a('0xdb')]==='in'?_0x294045:_0x4e7827,_0x25a2df[_0x808a('0x7e')]);if(!_0x25a2df[_0x808a('0xdc')]){fs[_0x808a('0xdd')](_0x1938e7,_0x3c9ad5);}}return db['MailAccount'][_0x808a('0xc4')]({'where':{'service':!![]},'include':[{'model':db[_0x808a('0xde')],'as':_0x808a('0xdf'),'raw':!![]}]});}}})[_0x808a('0x22')](function(_0x21df94){if(_0x21df94&&_0x21df94[_0x808a('0xdf')]&&_0x19aab4['body']){var _0x27dff2={'tls':{'rejectUnauthorized':![]}};if(_0x21df94[_0x808a('0xdf')][_0x808a('0xe0')]){_0x27dff2['service']=_0x21df94[_0x808a('0xdf')][_0x808a('0xe0')];}else{_0x27dff2[_0x808a('0xe1')]=_0x21df94[_0x808a('0xdf')][_0x808a('0xe1')];_0x27dff2['port']=_0x21df94[_0x808a('0xdf')][_0x808a('0xe2')];_0x27dff2[_0x808a('0xe3')]=_0x21df94[_0x808a('0xdf')]['secure'];}if(_0x21df94[_0x808a('0xdf')][_0x808a('0xe4')]){_0x27dff2[_0x808a('0xe5')]={'user':_0x21df94[_0x808a('0xdf')][_0x808a('0x99')],'pass':_0x21df94[_0x808a('0xdf')][_0x808a('0xe6')]};}return respondWithRpcPromise(_0x808a('0xe7'),'sendMail',{'account':_0x27dff2,'message':{'from':util[_0x808a('0xd0')]('\x22%s\x22\x20<%s>',_0x21df94[_0x808a('0x3a')],_0x21df94[_0x808a('0xe8')]||_0x21df94['Smtp'][_0x808a('0x99')]),'to':_0x19aab4[_0x808a('0x7e')][_0x808a('0xc8')],'subject':_0x808a('0xe9'),'text':util[_0x808a('0xd0')](_0x808a('0xea'),_0x19aab4['body']['mailTranscript']),'attachments':[{'path':_0x1938e7}]}})[_0x808a('0x22')](function(){return _0x52749e;})['catch'](function(_0x56d270){console['error'](_0x56d270);});}else{return _0x52749e;}})[_0x808a('0x22')](respondWithStatusCode(_0x7a2bdc,0xc8))[_0x808a('0x41')](handleError(_0x7a2bdc,null));};exports[_0x808a('0xeb')]=function(_0x1c78fe,_0x2bcfc0,_0x238f09){return db[_0x808a('0xcd')][_0x808a('0x6d')]({'where':{'id':_0x1c78fe[_0x808a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x2bcfc0,null))['then'](function(_0x3792ed){if(_0x3792ed){return _0x3792ed[_0x808a('0xeb')](_0x1c78fe[_0x808a('0x7e')][_0x808a('0xec')],_[_0x808a('0xed')](_0x1c78fe[_0x808a('0x7e')],[_0x808a('0xec'),'id'])||{});}})[_0x808a('0x22')](respondWithResult(_0x2bcfc0,null))['catch'](handleError(_0x2bcfc0,null));};exports['getMessages']=function(_0x189e17,_0x21b5ac,_0x12cfcb){var _0x292c4a={'raw':![],'where':{}};var _0x2f97db={};var _0x33c54f={'count':0x0,'rows':[]};return db[_0x808a('0x44')][_0x808a('0xc4')]({'where':{'id':_0x189e17['params']['id']}})['then'](handleEntityNotFound(_0x21b5ac,null))[_0x808a('0x22')](function(_0x479631){if(_0x479631){_0x2f97db[_0x808a('0x48')]=_[_0x808a('0x49')](db[_0x808a('0xcd')][_0x808a('0x45')]);_0x2f97db['query']=_[_0x808a('0x49')](_0x189e17['query']);_0x2f97db[_0x808a('0x54')]=_['intersection'](_0x2f97db[_0x808a('0x48')],_0x2f97db[_0x808a('0x4a')]);_0x292c4a['attributes']=_[_0x808a('0x4b')](_0x2f97db[_0x808a('0x48')],qs[_0x808a('0x4c')](_0x189e17[_0x808a('0x4a')][_0x808a('0x4c')]));_0x292c4a[_0x808a('0x4d')]=_0x292c4a[_0x808a('0x4d')]['length']?_0x292c4a[_0x808a('0x4d')]:_0x2f97db['model'];if(!_0x189e17['query'][_0x808a('0x4f')](_0x808a('0x50'))){_0x292c4a['limit']=qs[_0x808a('0x30')](_0x189e17[_0x808a('0x4a')][_0x808a('0x30')]);_0x292c4a[_0x808a('0x2f')]=qs[_0x808a('0x2f')](_0x189e17[_0x808a('0x4a')]['offset']);}_0x292c4a[_0x808a('0x51')]=qs['sort'](_0x189e17[_0x808a('0x4a')]['sort']);_0x292c4a['where']=qs[_0x808a('0x54')](_['pick'](_0x189e17['query'],_0x2f97db[_0x808a('0x54')]));_0x292c4a['where']['ChatInteractionId']=_0x479631['id'];if(_0x189e17[_0x808a('0x4a')]['filter']){_0x292c4a['where']=_[_0x808a('0x9f')](_0x292c4a['where'],{'$or':_[_0x808a('0x43')](_0x292c4a[_0x808a('0x4d')],function(_0x253a86){var _0x498640={};_0x498640[_0x253a86]={'$like':'%'+_0x189e17[_0x808a('0x4a')][_0x808a('0x8b')]+'%'};return _0x498640;})});}if(_0x189e17[_0x808a('0x4a')]['$gte']){var _0x5ea708=_0x189e17[_0x808a('0x4a')][_0x808a('0x84')][_0x808a('0x3e')](',');var _0xaca7cd={};_0xaca7cd[_0x5ea708[0x0]]={'$gte':moment(_0x5ea708[0x1])[_0x808a('0xd0')](_0x808a('0xee'))};_0x292c4a[_0x808a('0x53')]=_[_0x808a('0x9f')](_0x292c4a[_0x808a('0x53')],_0xaca7cd);}_0x292c4a=_[_0x808a('0x9f')]({},_0x292c4a,_0x189e17[_0x808a('0xb5')]);return db[_0x808a('0xcd')][_0x808a('0x9b')]({'where':_0x292c4a[_0x808a('0x53')]})[_0x808a('0x22')](function(_0x325b2b){_0x33c54f[_0x808a('0x9b')]=_0x325b2b;if(_0x189e17['query'][_0x808a('0xb3')]){_0x292c4a[_0x808a('0xb4')]=[{'all':!![]}];}return db[_0x808a('0xcd')]['findAll'](_0x292c4a);})[_0x808a('0x22')](function(_0x29f318){_0x33c54f[_0x808a('0xb1')]=_0x29f318;return _0x33c54f;});}})[_0x808a('0x22')](respondWithFilteredResult(_0x21b5ac,_0x292c4a))[_0x808a('0x41')](handleError(_0x21b5ac,null));};exports[_0x808a('0xef')]=function(_0x2c30aa,_0x4f9611,_0x4baea7){var _0x21b8c2={'where':{}},_0x128daf={},_0x50086f={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x808a('0xc4')]({'where':{'id':_0x2c30aa[_0x808a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x4f9611,null))['then'](function(_0x3fc837){if(_0x3fc837){_0x128daf[_0x808a('0x48')]=_[_0x808a('0x49')](db[_0x808a('0xcd')][_0x808a('0x45')]);_0x128daf['query']=_[_0x808a('0x49')](_0x2c30aa[_0x808a('0x4a')]);_0x128daf[_0x808a('0x54')]=_['intersection'](_0x128daf[_0x808a('0x48')],_0x128daf[_0x808a('0x4a')]);_0x21b8c2[_0x808a('0x4d')]=_['intersection'](_0x128daf[_0x808a('0x48')],qs['fields'](_0x2c30aa[_0x808a('0x4a')][_0x808a('0x4c')]));_0x21b8c2[_0x808a('0x4d')]=_0x21b8c2[_0x808a('0x4d')][_0x808a('0x4e')]?_0x21b8c2[_0x808a('0x4d')]:_0x128daf['model'];if(!_0x2c30aa[_0x808a('0x4a')][_0x808a('0x4f')](_0x808a('0x50'))){_0x21b8c2['limit']=qs[_0x808a('0x30')](_0x2c30aa['query'][_0x808a('0x30')]);_0x21b8c2[_0x808a('0x2f')]=qs[_0x808a('0x2f')](_0x2c30aa[_0x808a('0x4a')][_0x808a('0x2f')]);}_0x21b8c2[_0x808a('0x51')]=qs[_0x808a('0x52')](_0x2c30aa[_0x808a('0x4a')][_0x808a('0x52')]);_0x21b8c2[_0x808a('0x53')]=qs[_0x808a('0x54')](_['pick'](_0x2c30aa['query'],_0x128daf['filters']));_0x21b8c2[_0x808a('0x53')][_0x808a('0xaf')]=_0x3fc837['id'];if(_0x2c30aa[_0x808a('0x4a')][_0x808a('0x8b')]){_0x21b8c2[_0x808a('0x53')]=_[_0x808a('0x9f')](_0x21b8c2[_0x808a('0x53')],{'$or':_[_0x808a('0x43')](_0x21b8c2[_0x808a('0x4d')],function(_0x2b7e8b){var _0x332129={};_0x332129[_0x2b7e8b]={'$like':'%'+_0x2c30aa[_0x808a('0x4a')][_0x808a('0x8b')]+'%'};return _0x332129;})});}_0x21b8c2[_0x808a('0x53')]['secret']=![];if(_0x2c30aa[_0x808a('0x4a')]['id']){_0x21b8c2[_0x808a('0x53')]['id']={'$gt':_0x2c30aa[_0x808a('0x4a')]['id']};}_0x21b8c2=_[_0x808a('0x9f')]({},_0x21b8c2,_0x2c30aa['options']);return db[_0x808a('0xcd')][_0x808a('0x9b')]({'where':_0x21b8c2[_0x808a('0x53')]})[_0x808a('0x22')](function(_0x2653c8){_0x50086f[_0x808a('0x9b')]=_0x2653c8;_0x21b8c2[_0x808a('0xb4')]=[];if(_0x2c30aa[_0x808a('0x4a')]['includeAgent']){_0x21b8c2[_0x808a('0xb4')][_0x808a('0x40')]({'model':db['User'],'as':_0x808a('0x7b'),'attributes':['id',_0x808a('0x3c'),'alias']});}if(_0x2c30aa['query']['includeAll']){_0x21b8c2[_0x808a('0xb4')]=[{'all':!![]}];}return db[_0x808a('0xcd')][_0x808a('0xf0')](_0x21b8c2);})['then'](function(_0x3bc655){_0x50086f[_0x808a('0xb1')]=_0x3bc655;return _0x50086f;});}})[_0x808a('0x22')](respondWithFilteredResult(_0x4f9611,_0x21b8c2))['catch'](handleError(_0x4f9611,null));};exports['addTags']=function(_0x4d6adb,_0x5d5f70,_0x390ddd){return db[_0x808a('0x44')][_0x808a('0x6d')]({'where':{'id':_0x4d6adb[_0x808a('0xb2')]['id']}})['then'](handleEntityNotFound(_0x5d5f70,null))[_0x808a('0x22')](function(_0x157c5b){if(_0x157c5b){return _0x157c5b['setTags'](_0x4d6adb['body'][_0x808a('0xec')],_[_0x808a('0xed')](_0x4d6adb[_0x808a('0x7e')],[_0x808a('0xec'),'id'])||{})[_0x808a('0xf1')](function(){return db[_0x808a('0xf2')][_0x808a('0xf0')]({'attributes':['id',_0x808a('0x3a'),_0x808a('0x56')],'where':{'id':_0x4d6adb['body'][_0x808a('0xec')]}});})['then'](function(_0x2d98f1){socket[_0x808a('0xf3')](_0x808a('0xf4'),{'id':Number(_0x4d6adb[_0x808a('0xb2')]['id']),'tags':_0x2d98f1||[]});return{'id':Number(_0x4d6adb[_0x808a('0xb2')]['id']),'tags':_0x2d98f1||[]};});}})[_0x808a('0x22')](respondWithResult(_0x5d5f70,null))[_0x808a('0x41')](handleError(_0x5d5f70,null));};exports[_0x808a('0xf5')]=function(_0x1d4122,_0x3c55ba,_0x3ca8a9){return db[_0x808a('0x44')][_0x808a('0x6d')]({'where':{'id':_0x1d4122['params']['id']}})['then'](handleEntityNotFound(_0x3c55ba,null))[_0x808a('0x22')](function(_0x59ef00){if(_0x59ef00){return _0x59ef00[_0x808a('0xf5')](_0x1d4122[_0x808a('0x4a')]['ids']);}})[_0x808a('0x22')](respondWithStatusCode(_0x3c55ba,null))[_0x808a('0x41')](handleError(_0x3c55ba,null));};exports['download']=function(_0x4907b5,_0x31496f){var _0x24dafa=moment()[_0x808a('0xf6')]()[_0x808a('0x9d')]();var _0x396987=path[_0x808a('0xc9')](config[_0x808a('0xca')],_0x808a('0xf7'),'files',_0x808a('0xf8'));var _0x1e474f=path[_0x808a('0xc9')](config['root'],_0x808a('0xf7'),_0x808a('0xf9'),_0x808a('0xfa'));var _0x2dd7a5=path[_0x808a('0xc9')](_0x396987,_0x24dafa);var _0x27a3f7=util[_0x808a('0xd0')]('transcript-%d-%s.zip',_0x4907b5[_0x808a('0xb2')]['id'],_0x24dafa);var _0x3ec2f0=path[_0x808a('0xc9')](_0x396987,_0x27a3f7);var _0x5e1783=[];_0x5e1783[_0x808a('0x40')]({'model':db[_0x808a('0x7b')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x5e1783[_0x808a('0x40')]({'model':db['CmContact'],'as':_0x808a('0xfb'),'attributes':['id','firstName',_0x808a('0xfc')],'raw':!![]});if(_0x4907b5['query'][_0x808a('0xfa')]){_0x5e1783['push']({'model':db[_0x808a('0xc3')],'as':_0x808a('0xc3'),'raw':!![]});}var _0x49c8b3=[{'model':db[_0x808a('0xcd')],'as':_0x808a('0xce'),'attributes':['id',_0x808a('0x7e'),_0x808a('0xfd'),_0x808a('0xdb'),'secret',_0x808a('0x89')],'include':_0x5e1783}];_0x49c8b3[_0x808a('0x40')]({'model':db['ChatWebsite'],'as':_0x808a('0xfe'),'attributes':['id','name']});_0x49c8b3['push']({'model':db[_0x808a('0x7b')],'as':_0x808a('0xff'),'attributes':['id',_0x808a('0x3c')]});return db[_0x808a('0x44')][_0x808a('0x6d')]({'where':{'id':_0x4907b5[_0x808a('0xb2')]['id']},'include':_0x49c8b3})[_0x808a('0x22')](handleEntityNotFound(_0x31496f,null))[_0x808a('0x22')](function(_0x4cb7e4){if(_0x4cb7e4){var _0x292669=_0x4cb7e4[_0x808a('0x100')]({'plain':!![]});fs[_0x808a('0x101')](_0x2dd7a5);var _0x4b68fe={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x808a('0x102'),'contents':{'default':util[_0x808a('0xd0')](_0x808a('0x103'),util['format'](_0x808a('0x104'),_0x808a('0x105'),_0x292669['id']),moment()['format'](_0x808a('0x106'))['toString']())}}};var _0xb25f70={'channel':_0x808a('0x105'),'account':_0x292669[_0x808a('0xfe')][_0x808a('0x3a')],'agent':_0x292669[_0x808a('0xff')]?_0x292669[_0x808a('0xff')][_0x808a('0x3c')]:_0x808a('0x107'),'createdAt':moment(_0x292669[_0x808a('0xfd')])[_0x808a('0xd0')](_0x808a('0xee'))[_0x808a('0x9d')](),'closedAt':_0x292669[_0x808a('0xbc')]?moment(_0x292669[_0x808a('0x108')])[_0x808a('0xd0')](_0x808a('0xee'))['toString']():'','disposition':_0x292669[_0x808a('0x109')],'chatInfo':{'browser':_0x292669['browserName'],'os':_0x292669['osName'],'referer':_0x292669[_0x808a('0x10a')],'customerIp':_0x292669[_0x808a('0x10b')],'customerPort':_0x292669[_0x808a('0x10c')]?_0x292669[_0x808a('0x10c')]:_0x808a('0x107')},'messages':_(_0x292669[_0x808a('0xce')])['tail']()[_0x808a('0x8b')]({'secret':![]})['map'](function(_0x1834ee){if(_0x1834ee[_0x808a('0xc3')]){var _0x37a62b=path[_0x808a('0xc9')](_0x1e474f,_0x1834ee['Attachment'][_0x808a('0xc0')]);if(fs[_0x808a('0x10d')](_0x37a62b)){fs[_0x808a('0x10e')](_0x37a62b)[_0x808a('0x10f')](fs['createWriteStream'](path[_0x808a('0xc9')](_0x2dd7a5,_0x1834ee[_0x808a('0xc3')][_0x808a('0xc0')])));}}return{'date':moment(_0x1834ee[_0x808a('0xfd')])[_0x808a('0xd0')](_0x808a('0xee'))['toString'](),'sender':_0x1834ee['direction']===_0x808a('0x110')?_0x1834ee[_0x808a('0x7b')]?_0x1834ee[_0x808a('0x7b')][_0x808a('0x3c')]:'System':_0x1834ee['Contact'][_0x808a('0x111')]+(_0x1834ee[_0x808a('0xfb')][_0x808a('0xfc')]?'\x20'+_0x1834ee[_0x808a('0xfb')]['lastName']:''),'body':_0x1834ee[_0x808a('0xc3')]?_0x1834ee[_0x808a('0xc3')][_0x808a('0xc0')]:_0x1834ee[_0x808a('0x7e')],'direction':_0x1834ee[_0x808a('0xdb')]===_0x808a('0x110')?'A':'C','secret':_0x1834ee[_0x808a('0xdc')],'read':_0x1834ee[_0x808a('0x89')],'attachment':_0x1834ee[_0x808a('0xc3')]};})[_0x808a('0x6f')]()};return ejs[_0x808a('0x112')](path[_0x808a('0xc9')](config[_0x808a('0xca')],_0x808a('0xf7'),_0x808a('0x113'),'downloadInteraction.html'),{'interaction':_0xb25f70})['then'](function(_0x44c55f){return new BPromise(function(_0x1279cb,_0x51f45b){pdf[_0x808a('0xb6')](_0x44c55f,_0x4b68fe)['toFile'](path['join'](_0x2dd7a5,_0x808a('0x114')+_0x292669['id']+'-'+_0x24dafa+'.pdf'),function(_0x2cde91,_0x1a65ff){if(_0x2cde91)return _0x51f45b(_0x2cde91);_0x1279cb(_0x1a65ff);});});})[_0x808a('0x22')](function(){return new BPromise(function(_0x484e78,_0x5f21af){zipdir(_0x2dd7a5,{'saveTo':_0x3ec2f0},function(_0x414506,_0x59eb30){if(_0x414506)return _0x5f21af(_0x414506);return _0x484e78(_0x59eb30);});})[_0x808a('0x22')](function(){return new BPromise(function(_0xf7bef9,_0x9420f4){rimraf(_0x2dd7a5,function(_0x4cf1e6){if(_0x4cf1e6)_0x9420f4(_0x4cf1e6);return _0xf7bef9();});});})[_0x808a('0x22')](function(){return _0x31496f[_0x808a('0x115')](_0x3ec2f0,_0x27a3f7,function(_0x5139b9){if(_0x5139b9){console[_0x808a('0x116')](_0x808a('0x117'),_0x5139b9);}else{fs[_0x808a('0x118')](_0x3ec2f0);}});});});}else{return _0x31496f[_0x808a('0x2c')](0xc8);}})['catch'](handleError(_0x31496f,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 1eda68c..db33696 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 _0xf15d=['hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x4db341,_0xb12794){var _0x193cb0=function(_0x27666e){while(--_0x27666e){_0x4db341['push'](_0x4db341['shift']());}};_0x193cb0(++_0xb12794);}(_0xf15d,0x122));var _0xdf15=function(_0x27ca02,_0x267e01){_0x27ca02=_0x27ca02-0x0;var _0x1a7a55=_0xf15d[_0x27ca02];return _0x1a7a55;};'use strict';var EventEmitter=require(_0xdf15('0x0'));var ChatInteraction=require(_0xdf15('0x1'))['db'][_0xdf15('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xdf15('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdf15('0x4')](0x0);var events={'afterCreate':_0xdf15('0x5'),'afterUpdate':'update','afterDestroy':_0xdf15('0x6')};function emitEvent(_0x48e547){return function(_0x5d514d,_0x44f5ba,_0x26c243){_0x5d514d['getUsers']({'attributes':['id'],'raw':!![]})[_0xdf15('0x7')](function(_0x3ca3e4){_0x5d514d[_0xdf15('0x8')](_0xdf15('0x9'),_0x3ca3e4[_0xdf15('0xa')](function(_0x4abca5){return{'id':_0x4abca5['id']};}));return ChatMessage[_0xdf15('0xb')]({'where':{'ChatInteractionId':_0x5d514d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf15('0x7')](function(_0x5ec990){_0x5d514d['setDataValue'](_0xdf15('0xc'),_0x5ec990['length']);ChatInteractionEvents[_0xdf15('0xd')](_0x48e547+':'+_0x5d514d['id'],_0x5d514d);ChatInteractionEvents[_0xdf15('0xd')](_0x48e547,_0x5d514d);_0x26c243(null);})[_0xdf15('0xe')](_0x26c243(null));};}for(var e in events){if(events[_0xdf15('0xf')](e)){var event=events[e];ChatInteraction[_0xdf15('0x10')](e,emitEvent(event));}}module[_0xdf15('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xc9a3=['save','remove','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xc9a3,0x83));var _0x3c9a=function(_0x4bc57e,_0xf1cd33){_0x4bc57e=_0x4bc57e-0x0;var _0x112d17=_0xc9a3[_0x4bc57e];return _0x112d17;};'use strict';var EventEmitter=require(_0x3c9a('0x0'));var ChatInteraction=require(_0x3c9a('0x1'))['db'][_0x3c9a('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x3c9a('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x3c9a('0x4')](0x0);var events={'afterCreate':_0x3c9a('0x5'),'afterUpdate':'update','afterDestroy':_0x3c9a('0x6')};function emitEvent(_0x2b0997){return function(_0x4da805,_0xa37a92,_0xea1ae9){_0x4da805['getUsers']({'attributes':['id'],'raw':!![]})[_0x3c9a('0x7')](function(_0x44e1dd){_0x4da805[_0x3c9a('0x8')](_0x3c9a('0x9'),_0x44e1dd[_0x3c9a('0xa')](function(_0x5d0942){return{'id':_0x5d0942['id']};}));return ChatMessage[_0x3c9a('0xb')]({'where':{'ChatInteractionId':_0x4da805['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2b4908){_0x4da805[_0x3c9a('0x8')](_0x3c9a('0xc'),_0x2b4908[_0x3c9a('0xd')]);ChatInteractionEvents[_0x3c9a('0xe')](_0x2b0997+':'+_0x4da805['id'],_0x4da805);ChatInteractionEvents[_0x3c9a('0xe')](_0x2b0997,_0x4da805);_0xea1ae9(null);})['catch'](_0xea1ae9(null));};}for(var e in events){if(events[_0x3c9a('0xf')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x3c9a('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 3234691..3538e44 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 _0xcc70=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x462663,_0x55d4ba){var _0x53f165=function(_0x196916){while(--_0x196916){_0x462663['push'](_0x462663['shift']());}};_0x53f165(++_0x55d4ba);}(_0xcc70,0x178));var _0x0cc7=function(_0x2baf40,_0x5ebef2){_0x2baf40=_0x2baf40-0x0;var _0x2bb2cb=_0xcc70[_0x2baf40];return _0x2bb2cb;};'use strict';var _=require(_0x0cc7('0x0'));var util=require(_0x0cc7('0x1'));var logger=require(_0x0cc7('0x2'))(_0x0cc7('0x3'));var moment=require('moment');var BPromise=require(_0x0cc7('0x4'));var rp=require(_0x0cc7('0x5'));var fs=require('fs');var path=require(_0x0cc7('0x6'));var rimraf=require(_0x0cc7('0x7'));var config=require(_0x0cc7('0x8'));var attributes=require(_0x0cc7('0x9'));module[_0x0cc7('0xa')]=function(_0x22a308,_0x59245e){return _0x22a308[_0x0cc7('0xb')](_0x0cc7('0xc'),attributes,{'tableName':_0x0cc7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c57ed,_0x3f0047,_0x3a9e46){if(_0x1c57ed[_0x0cc7('0xe')](_0x0cc7('0xf'))){_0x1c57ed[_0x0cc7('0x10')]=moment()[_0x0cc7('0x11')](_0x0cc7('0x12'));}_0x3a9e46(null,_0x1c57ed);}},'charset':'utf8mb4','collate':_0x0cc7('0x13')});}; \ No newline at end of file +var _0xfad6=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x43053c,_0x336018){var _0x73094c=function(_0x1dd957){while(--_0x1dd957){_0x43053c['push'](_0x43053c['shift']());}};_0x73094c(++_0x336018);}(_0xfad6,0x152));var _0x6fad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfad6[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6fad('0x0'));var util=require('util');var logger=require(_0x6fad('0x1'))('api');var moment=require(_0x6fad('0x2'));var BPromise=require(_0x6fad('0x3'));var rp=require(_0x6fad('0x4'));var fs=require('fs');var path=require(_0x6fad('0x5'));var rimraf=require(_0x6fad('0x6'));var config=require(_0x6fad('0x7'));var attributes=require(_0x6fad('0x8'));module[_0x6fad('0x9')]=function(_0x4c0340,_0x271ec8){return _0x4c0340[_0x6fad('0xa')](_0x6fad('0xb'),attributes,{'tableName':_0x6fad('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x483d5f,_0x21ff5e,_0x5d9211){if(_0x483d5f[_0x6fad('0xd')](_0x6fad('0xe'))){_0x483d5f[_0x6fad('0xf')]=moment()[_0x6fad('0x10')](_0x6fad('0x11'));}_0x5d9211(null,_0x483d5f);}},'charset':_0x6fad('0x12'),'collate':_0x6fad('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6acedc6..97c1dbc 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 _0x7cc8=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','ChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xb922d7,_0x4faba3){var _0x36b4eb=function(_0x1570ae){while(--_0x1570ae){_0xb922d7['push'](_0xb922d7['shift']());}};_0x36b4eb(++_0x4faba3);}(_0x7cc8,0x150));var _0x87cc=function(_0x6c7c05,_0x198723){_0x6c7c05=_0x6c7c05-0x0;var _0x228a2c=_0x7cc8[_0x6c7c05];return _0x228a2c;};'use strict';var _=require(_0x87cc('0x0'));var util=require(_0x87cc('0x1'));var moment=require(_0x87cc('0x2'));var BPromise=require(_0x87cc('0x3'));var rs=require(_0x87cc('0x4'));var fs=require('fs');var Redis=require(_0x87cc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x87cc('0x6'));var logger=require(_0x87cc('0x7'))(_0x87cc('0x8'));var config=require(_0x87cc('0x9'));var jayson=require(_0x87cc('0xa'));var client=jayson[_0x87cc('0xb')][_0x87cc('0xc')]({'port':0x232a});config[_0x87cc('0xd')]=_['defaults'](config['redis'],{'host':_0x87cc('0xe'),'port':0x18eb});var socket=require(_0x87cc('0xf'))(new Redis(config['redis']));require(_0x87cc('0x10'))[_0x87cc('0x11')](socket);function respondWithRpcPromise(_0x2a26fd,_0x56c511,_0x35ab72){return new BPromise(function(_0x115dc6,_0x29962e){return client[_0x87cc('0x12')](_0x2a26fd,_0x35ab72)[_0x87cc('0x13')](function(_0x432cca){logger[_0x87cc('0x14')](_0x87cc('0x15'),_0x56c511,_0x87cc('0x16'));logger[_0x87cc('0x17')](_0x87cc('0x18'),_0x56c511,_0x87cc('0x16'),JSON[_0x87cc('0x19')](_0x432cca));if(_0x432cca[_0x87cc('0x1a')]){if(_0x432cca['error']['code']===0x1f4){logger['error'](_0x87cc('0x15'),_0x56c511,_0x432cca[_0x87cc('0x1a')][_0x87cc('0x1b')]);return _0x29962e(_0x432cca[_0x87cc('0x1a')][_0x87cc('0x1b')]);}logger[_0x87cc('0x1a')](_0x87cc('0x15'),_0x56c511,_0x432cca[_0x87cc('0x1a')][_0x87cc('0x1b')]);return _0x115dc6(_0x432cca['error'][_0x87cc('0x1b')]);}else{logger['info'](_0x87cc('0x15'),_0x56c511,_0x87cc('0x16'));_0x115dc6(_0x432cca[_0x87cc('0x1c')][_0x87cc('0x1b')]);}})['catch'](function(_0x17a8d3){logger[_0x87cc('0x1a')](_0x87cc('0x15'),_0x56c511,_0x17a8d3);_0x29962e(_0x17a8d3);});});}exports[_0x87cc('0x1d')]=function(_0x2f32f4){var _0x46301e=this;return new Promise(function(_0x47137d,_0x2b82c1){return db['ChatInteraction'][_0x87cc('0x1e')](_0x2f32f4[_0x87cc('0x1f')],{'raw':_0x2f32f4['options']?_0x2f32f4['options'][_0x87cc('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f32f4[_0x87cc('0x21')]?_0x2f32f4[_0x87cc('0x21')][_0x87cc('0x22')]||null:null,'attributes':_0x2f32f4[_0x87cc('0x21')]?_0x2f32f4[_0x87cc('0x21')][_0x87cc('0x23')]||null:null,'limit':_0x2f32f4[_0x87cc('0x21')]?_0x2f32f4['options'][_0x87cc('0x24')]||null:null})[_0x87cc('0x13')](function(_0x195375){logger[_0x87cc('0x14')](_0x87cc('0x1d'),_0x2f32f4);logger[_0x87cc('0x17')]('UpdateChatInteraction',_0x2f32f4,JSON['stringify'](_0x195375));_0x47137d(_0x195375);})['catch'](function(_0x3d2ba1){logger[_0x87cc('0x1a')]('UpdateChatInteraction',_0x3d2ba1['message'],_0x2f32f4);_0x2b82c1(_0x46301e[_0x87cc('0x1a')](0x1f4,_0x3d2ba1[_0x87cc('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x3da235){return new Promise(function(_0x32f667,_0xb04043){return db[_0x87cc('0x25')][_0x87cc('0x26')]({'where':_0x3da235[_0x87cc('0x21')]?_0x3da235['options'][_0x87cc('0x22')]||null:null})['then'](function(_0x32c442){if(_0x32c442){return _0x32c442[_0x87cc('0x27')](_0x3da235[_0x87cc('0x1f')][_0x87cc('0x28')],_[_0x87cc('0x29')](_0x3da235[_0x87cc('0x1f')],[_0x87cc('0x28'),'id'])||{});}})['spread'](function(_0x327839){logger[_0x87cc('0x14')](_0x87cc('0x2a'),_0x3da235);logger['debug']('AddTags',_0x3da235,JSON['stringify'](_0x327839));_0x32f667(_0x327839);})['catch'](function(_0x5567ca){logger[_0x87cc('0x1a')]('AddTags',_0x5567ca['message'],_0x3da235);_0xb04043(_this['error'](0x1f4,_0x5567ca[_0x87cc('0x1b')]));});});}; \ No newline at end of file +var _0x9b47=['http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','options','raw','where','attributes','limit','debug','AddTagsToChatInteraction','find','addTags','body','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x523ae0,_0xd46ca7){var _0x47294e=function(_0x168457){while(--_0x168457){_0x523ae0['push'](_0x523ae0['shift']());}};_0x47294e(++_0xd46ca7);}(_0x9b47,0x147));var _0x79b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9b47[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x79b4('0x0'));var util=require(_0x79b4('0x1'));var moment=require('moment');var BPromise=require(_0x79b4('0x2'));var rs=require(_0x79b4('0x3'));var fs=require('fs');var Redis=require(_0x79b4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x79b4('0x5'));var logger=require(_0x79b4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x79b4('0x7'));var client=jayson[_0x79b4('0x8')][_0x79b4('0x9')]({'port':0x232a});config['redis']=_[_0x79b4('0xa')](config[_0x79b4('0xb')],{'host':_0x79b4('0xc'),'port':0x18eb});var socket=require(_0x79b4('0xd'))(new Redis(config[_0x79b4('0xb')]));require('./chatInteraction.socket')[_0x79b4('0xe')](socket);function respondWithRpcPromise(_0x59ea40,_0x32319e,_0x523aab){return new BPromise(function(_0x212458,_0x340cf1){return client[_0x79b4('0xf')](_0x59ea40,_0x523aab)[_0x79b4('0x10')](function(_0x56153b){logger[_0x79b4('0x11')](_0x79b4('0x12'),_0x32319e,_0x79b4('0x13'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x32319e,_0x79b4('0x13'),JSON[_0x79b4('0x14')](_0x56153b));if(_0x56153b['error']){if(_0x56153b[_0x79b4('0x15')][_0x79b4('0x16')]===0x1f4){logger[_0x79b4('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x32319e,_0x56153b[_0x79b4('0x15')][_0x79b4('0x17')]);return _0x340cf1(_0x56153b[_0x79b4('0x15')][_0x79b4('0x17')]);}logger[_0x79b4('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x32319e,_0x56153b[_0x79b4('0x15')][_0x79b4('0x17')]);return _0x212458(_0x56153b[_0x79b4('0x15')][_0x79b4('0x17')]);}else{logger[_0x79b4('0x11')](_0x79b4('0x12'),_0x32319e,'request\x20sent');_0x212458(_0x56153b[_0x79b4('0x18')][_0x79b4('0x17')]);}})[_0x79b4('0x19')](function(_0x241dc5){logger[_0x79b4('0x15')](_0x79b4('0x12'),_0x32319e,_0x241dc5);_0x340cf1(_0x241dc5);});});}exports[_0x79b4('0x1a')]=function(_0x350024){var _0x36c452=this;return new Promise(function(_0x577c9b,_0x162670){return db[_0x79b4('0x1b')]['update'](_0x350024['body'],{'raw':_0x350024[_0x79b4('0x1c')]?_0x350024['options'][_0x79b4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x350024[_0x79b4('0x1c')]?_0x350024[_0x79b4('0x1c')][_0x79b4('0x1e')]||null:null,'attributes':_0x350024[_0x79b4('0x1c')]?_0x350024['options'][_0x79b4('0x1f')]||null:null,'limit':_0x350024[_0x79b4('0x1c')]?_0x350024[_0x79b4('0x1c')][_0x79b4('0x20')]||null:null})[_0x79b4('0x10')](function(_0x4959d8){logger['info']('UpdateChatInteraction',_0x350024);logger[_0x79b4('0x21')](_0x79b4('0x1a'),_0x350024,JSON[_0x79b4('0x14')](_0x4959d8));_0x577c9b(_0x4959d8);})[_0x79b4('0x19')](function(_0x388b1c){logger[_0x79b4('0x15')](_0x79b4('0x1a'),_0x388b1c[_0x79b4('0x17')],_0x350024);_0x162670(_0x36c452[_0x79b4('0x15')](0x1f4,_0x388b1c[_0x79b4('0x17')]));});});};exports[_0x79b4('0x22')]=function(_0x48f00a){return new Promise(function(_0x45b2b3,_0x28ab80){return db[_0x79b4('0x1b')][_0x79b4('0x23')]({'where':_0x48f00a[_0x79b4('0x1c')]?_0x48f00a[_0x79b4('0x1c')][_0x79b4('0x1e')]||null:null})[_0x79b4('0x10')](function(_0x1e400e){if(_0x1e400e){return _0x1e400e[_0x79b4('0x24')](_0x48f00a[_0x79b4('0x25')][_0x79b4('0x26')],_[_0x79b4('0x27')](_0x48f00a[_0x79b4('0x25')],['ids','id'])||{});}})[_0x79b4('0x28')](function(_0x4f4448){logger[_0x79b4('0x11')]('AddTags',_0x48f00a);logger['debug'](_0x79b4('0x29'),_0x48f00a,JSON[_0x79b4('0x14')](_0x4f4448));_0x45b2b3(_0x4f4448);})[_0x79b4('0x19')](function(_0xfd1d35){logger['error'](_0x79b4('0x29'),_0xfd1d35[_0x79b4('0x17')],_0x48f00a);_0x28ab80(_this[_0x79b4('0x15')](0x1f4,_0xfd1d35['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index add1c97..fe3e716 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 _0xc84c=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x241423,_0x1f3697){var _0x497ad7=function(_0x1f449c){while(--_0x1f449c){_0x241423['push'](_0x241423['shift']());}};_0x497ad7(++_0x1f3697);}(_0xc84c,0x89));var _0xcc84=function(_0x1a0967,_0x51bc82){_0x1a0967=_0x1a0967-0x0;var _0x5a169f=_0xc84c[_0x1a0967];return _0x5a169f;};'use strict';var ChatInteractionEvents=require(_0xcc84('0x0'));var events=[_0xcc84('0x1'),_0xcc84('0x2'),_0xcc84('0x3')];function createListener(_0x4272ca,_0x3c7ac5){return function(_0x34158f){_0x3c7ac5[_0xcc84('0x4')](_0x4272ca,_0x34158f);};}function removeListener(_0x37c191,_0x23b188){return function(){ChatInteractionEvents[_0xcc84('0x5')](_0x37c191,_0x23b188);};}exports['register']=function(_0x57e30e){for(var _0x478c5d=0x0,_0x502efa=events[_0xcc84('0x6')];_0x478c5d<_0x502efa;_0x478c5d++){var _0x1af20f=events[_0x478c5d];var _0x145b1a=createListener(_0xcc84('0x7')+_0x1af20f,_0x57e30e);ChatInteractionEvents['on'](_0x1af20f,_0x145b1a);}}; \ No newline at end of file +var _0xb85f=['removeListener','register','length','chatInteraction:','save','remove'];(function(_0x56cc05,_0x3ca36a){var _0x37ea8b=function(_0x1cddc7){while(--_0x1cddc7){_0x56cc05['push'](_0x56cc05['shift']());}};_0x37ea8b(++_0x3ca36a);}(_0xb85f,0x1d2));var _0xfb85=function(_0xfe4914,_0xd57dbc){_0xfe4914=_0xfe4914-0x0;var _0x9cc1f4=_0xb85f[_0xfe4914];return _0x9cc1f4;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xfb85('0x0'),_0xfb85('0x1'),'update'];function createListener(_0x5c6ba3,_0x191a9d){return function(_0xb1ab40){_0x191a9d['emit'](_0x5c6ba3,_0xb1ab40);};}function removeListener(_0xbd9646,_0x52dbee){return function(){ChatInteractionEvents[_0xfb85('0x2')](_0xbd9646,_0x52dbee);};}exports[_0xfb85('0x3')]=function(_0x5e3225){for(var _0x3a70e9=0x0,_0x5502b7=events[_0xfb85('0x4')];_0x3a70e9<_0x5502b7;_0x3a70e9++){var _0x3b643a=events[_0x3a70e9];var _0x1915c2=createListener(_0xfb85('0x5')+_0x3b643a,_0x5e3225);ChatInteractionEvents['on'](_0x3b643a,_0x1915c2);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index eaad963..5886783 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 _0xf102=['attachmentUpload','addMessage','tracked','addTags','put','chat','chatinteraction:update','update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','file'];(function(_0x2d650e,_0x521ccc){var _0x1b9598=function(_0x27748b){while(--_0x27748b){_0x2d650e['push'](_0x2d650e['shift']());}};_0x1b9598(++_0x521ccc);}(_0xf102,0xf7));var _0x2f10=function(_0x1e5068,_0x31e9c4){_0x1e5068=_0x1e5068-0x0;var _0x2230b6=_0xf102[_0x1e5068];return _0x2230b6;};'use strict';var multer=require(_0x2f10('0x0'));var util=require(_0x2f10('0x1'));var path=require('path');var timeout=require(_0x2f10('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2f10('0x3'));var interaction=require(_0x2f10('0x4'));var config=require(_0x2f10('0x5'));var controller=require(_0x2f10('0x6'));router[_0x2f10('0x7')]('/',auth[_0x2f10('0x8')](),controller['index']);router['get'](_0x2f10('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2f10('0xa'),auth[_0x2f10('0xb')](),controller[_0x2f10('0xc')]);router['get'](_0x2f10('0xd'),auth[_0x2f10('0xb')](),controller[_0x2f10('0xe')]);router['get'](_0x2f10('0xf'),auth[_0x2f10('0x8')](),controller[_0x2f10('0x10')]);router[_0x2f10('0x7')](_0x2f10('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x2f10('0x7')](_0x2f10('0x12'),auth[_0x2f10('0x8')](),controller[_0x2f10('0x13')]);router[_0x2f10('0x14')]('/',auth[_0x2f10('0x8')](),controller[_0x2f10('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26897d,_0x18b4b5,_0xb534c7){_0xb534c7(null,path['join'](config[_0x2f10('0x16')],_0x2f10('0x17')));},'filename':function(_0x5ebf61,_0x142507,_0x294ab9){_0x294ab9(null,util[_0x2f10('0x18')]('%s-%s',Date[_0x2f10('0x19')](),_0x142507[_0x2f10('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2f10('0x1b'),upload['single'](_0x2f10('0x1c')),controller[_0x2f10('0x1d')]);router[_0x2f10('0x14')](_0x2f10('0xf'),auth[_0x2f10('0xb')](),controller[_0x2f10('0x1e')]);router[_0x2f10('0x14')]('/:id/tags',auth[_0x2f10('0x8')](),interaction[_0x2f10('0x1f')]('chat','chatinteraction:addtags'),controller[_0x2f10('0x20')]);router[_0x2f10('0x21')](_0x2f10('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x2f10('0x22'),_0x2f10('0x23')),controller[_0x2f10('0x24')]);router[_0x2f10('0x21')]('/:id/custom_update',controller[_0x2f10('0x25')]);router[_0x2f10('0x21')](_0x2f10('0x26'),auth[_0x2f10('0xb')](),controller['abandon']);router[_0x2f10('0x21')](_0x2f10('0x27'),controller[_0x2f10('0x28')]);router[_0x2f10('0x29')](_0x2f10('0xa'),auth[_0x2f10('0x8')](),interaction[_0x2f10('0x1f')]('chat',_0x2f10('0x2a')),controller[_0x2f10('0x2b')]);router['delete']('/:id/tags',auth[_0x2f10('0x8')](),controller[_0x2f10('0x2c')]);module[_0x2f10('0x2d')]=router; \ No newline at end of file +var _0xbe99=['express','../../config/environment','./chatInteraction.controller','index','get','/describe','isChatInteractionAuthorized','show','/:id/messages','isAuthenticated','getMessages','download','post','create','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','put','/:id','chat','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','delete','chatinteraction:destroy','destroy','removeTags','multer','connect-timeout'];(function(_0x2aa0c4,_0x5379cb){var _0x2f9664=function(_0x232f42){while(--_0x232f42){_0x2aa0c4['push'](_0x2aa0c4['shift']());}};_0x2f9664(++_0x5379cb);}(_0xbe99,0x12b));var _0x9be9=function(_0x13366a,_0x160e15){_0x13366a=_0x13366a-0x0;var _0x394bf8=_0xbe99[_0x13366a];return _0x394bf8;};'use strict';var multer=require(_0x9be9('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9be9('0x1'));var express=require(_0x9be9('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9be9('0x3'));var controller=require(_0x9be9('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x9be9('0x5')]);router[_0x9be9('0x6')](_0x9be9('0x7'),auth['isAuthenticated'](),controller['describe']);router[_0x9be9('0x6')]('/:id',auth[_0x9be9('0x8')](),controller[_0x9be9('0x9')]);router[_0x9be9('0x6')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x9be9('0x6')](_0x9be9('0xa'),auth[_0x9be9('0xb')](),controller[_0x9be9('0xc')]);router['get']('/:id/my_messages',auth[_0x9be9('0x8')](),controller['getMyMessages']);router[_0x9be9('0x6')]('/:id/download',auth[_0x9be9('0xb')](),controller[_0x9be9('0xd')]);router[_0x9be9('0xe')]('/',auth[_0x9be9('0xb')](),controller[_0x9be9('0xf')]);var upload=multer({'storage':multer[_0x9be9('0x10')]({'destination':function(_0x3a9385,_0xf1e92d,_0x172a5b){_0x172a5b(null,path[_0x9be9('0x11')](config['root'],_0x9be9('0x12')));},'filename':function(_0x53084a,_0x326072,_0x2c4f70){_0x2c4f70(null,util[_0x9be9('0x13')](_0x9be9('0x14'),Date[_0x9be9('0x15')](),_0x326072[_0x9be9('0x16')][_0x9be9('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9be9('0xe')](_0x9be9('0x18'),upload[_0x9be9('0x19')]('file'),controller[_0x9be9('0x1a')]);router[_0x9be9('0xe')]('/:id/messages',auth[_0x9be9('0x8')](),controller[_0x9be9('0x1b')]);router[_0x9be9('0xe')](_0x9be9('0x1c'),auth['isAuthenticated'](),interaction[_0x9be9('0x1d')]('chat',_0x9be9('0x1e')),controller['addTags']);router[_0x9be9('0x1f')](_0x9be9('0x20'),auth[_0x9be9('0xb')](),interaction[_0x9be9('0x1d')](_0x9be9('0x21'),'chatinteraction:update'),controller[_0x9be9('0x22')]);router[_0x9be9('0x1f')](_0x9be9('0x23'),controller['customUpdate']);router[_0x9be9('0x1f')](_0x9be9('0x24'),auth[_0x9be9('0x8')](),controller[_0x9be9('0x25')]);router[_0x9be9('0x1f')](_0x9be9('0x26'),controller['close']);router[_0x9be9('0x27')](_0x9be9('0x20'),auth[_0x9be9('0xb')](),interaction[_0x9be9('0x1d')](_0x9be9('0x21'),_0x9be9('0x28')),controller[_0x9be9('0x29')]);router[_0x9be9('0x27')](_0x9be9('0x1c'),auth['isAuthenticated'](),controller[_0x9be9('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 934d468..d9210d9 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 _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x2f9cd9,_0x52d2bb){var _0x4b98e9=function(_0x29b1fa){while(--_0x29b1fa){_0x2f9cd9['push'](_0x2f9cd9['shift']());}};_0x4b98e9(++_0x52d2bb);}(_0xdb28,0x106));var _0x8db2=function(_0x37226f,_0x39dc21){_0x37226f=_0x37226f-0x0;var _0x385653=_0xdb28[_0x37226f];return _0x385653;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}}; \ No newline at end of file +var _0x5f66=['exports','medium','BOOLEAN','INTEGER'];(function(_0x1088bb,_0x2d86ca){var _0x1cc45f=function(_0xe1c810){while(--_0xe1c810){_0x1088bb['push'](_0x1088bb['shift']());}};_0x1cc45f(++_0x2d86ca);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x65f6('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x65f6('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 33d6464..65f30a9 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 _0xfa17=['pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','userpic','internal','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','type','user','role','UserProfileSection','Agents','UserProfileResource','isEmpty','length','push','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','stack','name','index','ChatInternalMessage','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x4157cf,_0x3ff907){var _0x3dacbe=function(_0x503dc3){while(--_0x503dc3){_0x4157cf['push'](_0x4157cf['shift']());}};_0x3dacbe(++_0x3ff907);}(_0xfa17,0x97));var _0x7fa1=function(_0x400c79,_0x216b2b){_0x400c79=_0x400c79-0x0;var _0x1a7cf4=_0xfa17[_0x400c79];return _0x1a7cf4;};'use strict';var pdf=require(_0x7fa1('0x0'));var emlformat=require(_0x7fa1('0x1'));var rimraf=require(_0x7fa1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fa1('0x3'));var rp=require(_0x7fa1('0x4'));var moment=require(_0x7fa1('0x5'));var BPromise=require(_0x7fa1('0x6'));var Mustache=require(_0x7fa1('0x7'));var util=require(_0x7fa1('0x8'));var path=require(_0x7fa1('0x9'));var sox=require('sox');var csv=require(_0x7fa1('0xa'));var ejs=require(_0x7fa1('0xb'));var fs=require('fs');var _=require(_0x7fa1('0xc'));var squel=require(_0x7fa1('0xd'));var crypto=require(_0x7fa1('0xe'));var jsforce=require(_0x7fa1('0xf'));var deskjs=require(_0x7fa1('0x10'));var toCsv=require(_0x7fa1('0xa'));var querystring=require(_0x7fa1('0x11'));var Papa=require(_0x7fa1('0x12'));var Redis=require(_0x7fa1('0x13'));var authService=require(_0x7fa1('0x14'));var qs=require(_0x7fa1('0x15'));var as=require(_0x7fa1('0x16'));var hardwareService=require(_0x7fa1('0x17'));var logger=require(_0x7fa1('0x18'))(_0x7fa1('0x19'));var utils=require('../../config/utils');var config=require(_0x7fa1('0x1a'));var db=require(_0x7fa1('0x1b'))['db'];config[_0x7fa1('0x1c')]=_[_0x7fa1('0x1d')](config[_0x7fa1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7fa1('0x1e'))[_0x7fa1('0x1f')](socket);function respondWithStatusCode(_0x2de3cb,_0x4e5c9a){_0x4e5c9a=_0x4e5c9a||0xcc;return function(_0x5143e3){if(_0x5143e3){return _0x2de3cb[_0x7fa1('0x20')](_0x4e5c9a);}return _0x2de3cb[_0x7fa1('0x21')](_0x4e5c9a)[_0x7fa1('0x22')]();};}function respondWithResult(_0x39bc27,_0x4faac0){_0x4faac0=_0x4faac0||0xc8;return function(_0x1f3c71){if(_0x1f3c71){return _0x39bc27['status'](_0x4faac0)[_0x7fa1('0x23')](_0x1f3c71);}};}function respondWithFilteredResult(_0x4778f5,_0x313bae){return function(_0x169742){if(_0x169742){var _0x4d92d2=_0x169742[_0x7fa1('0x24')],_0x126beb=_0x313bae[_0x7fa1('0x25')],_0x90e0b4=_0x313bae['offset']+_0x313bae[_0x7fa1('0x26')],_0x409447;if(_0x90e0b4>=_0x4d92d2){_0x90e0b4=_0x4d92d2;_0x409447=0xc8;}else{_0x409447=0xce;}_0x4778f5[_0x7fa1('0x21')](_0x409447);return _0x4778f5['set'](_0x7fa1('0x27'),_0x126beb+'-'+_0x90e0b4+'/'+_0x4d92d2)[_0x7fa1('0x23')](_0x169742);}return null;};}function patchUpdates(_0x40b7b5){return function(_0xa2637e){try{jsonpatch[_0x7fa1('0x28')](_0xa2637e,_0x40b7b5,!![]);}catch(_0x445b75){return BPromise[_0x7fa1('0x29')](_0x445b75);}return _0xa2637e[_0x7fa1('0x2a')]();};}function saveUpdates(_0x3470a2,_0x10e135){return function(_0x35be57){if(_0x35be57){return _0x35be57['update'](_0x3470a2)[_0x7fa1('0x2b')](function(_0x1378ce){return _0x1378ce;});}return null;};}function removeEntity(_0x35e2ea,_0x564d85){return function(_0x4e875b){if(_0x4e875b){return _0x4e875b['destroy']()[_0x7fa1('0x2b')](function(){_0x35e2ea[_0x7fa1('0x21')](0xcc)[_0x7fa1('0x22')]();});}};}function handleEntityNotFound(_0x3c761a,_0x1ae01a){return function(_0x56e23b){if(!_0x56e23b){_0x3c761a[_0x7fa1('0x20')](0x194);}return _0x56e23b;};}function handleError(_0x1999c3,_0x4d03a8){_0x4d03a8=_0x4d03a8||0x1f4;return function(_0x486f16){logger['error'](_0x486f16[_0x7fa1('0x2c')]);if(_0x486f16[_0x7fa1('0x2d')]){delete _0x486f16['name'];}_0x1999c3[_0x7fa1('0x21')](_0x4d03a8)['send'](_0x486f16);};}exports[_0x7fa1('0x2e')]=function(_0x447865,_0x80a7a4){var _0x3db053={},_0x4ae99c={},_0x2fe05d={'count':0x0,'rows':[]};var _0xf416c8=_['map'](db[_0x7fa1('0x2f')]['rawAttributes'],function(_0x4038ee){return{'name':_0x4038ee['fieldName'],'type':_0x4038ee['type'][_0x7fa1('0x30')]};});_0x4ae99c['model']=_['map'](_0xf416c8,_0x7fa1('0x2d'));_0x4ae99c['query']=_[_0x7fa1('0x31')](_0x447865[_0x7fa1('0x32')]);_0x4ae99c[_0x7fa1('0x33')]=_[_0x7fa1('0x34')](_0x4ae99c[_0x7fa1('0x35')],_0x4ae99c['query']);_0x3db053[_0x7fa1('0x36')]=_['intersection'](_0x4ae99c[_0x7fa1('0x35')],qs[_0x7fa1('0x37')](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x37')]));_0x3db053[_0x7fa1('0x36')]=_0x3db053[_0x7fa1('0x36')]['length']?_0x3db053[_0x7fa1('0x36')]:_0x4ae99c[_0x7fa1('0x35')];if(!_0x447865[_0x7fa1('0x32')][_0x7fa1('0x38')](_0x7fa1('0x39'))){_0x3db053[_0x7fa1('0x26')]=qs[_0x7fa1('0x26')](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x26')]);_0x3db053['offset']=qs[_0x7fa1('0x25')](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x25')]);}_0x3db053['order']=qs['sort'](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x3a')]);_0x3db053['where']=qs['filters'](_[_0x7fa1('0x3b')](_0x447865['query'],_0x4ae99c['filters']));if(_0x447865[_0x7fa1('0x32')][_0x7fa1('0x3c')]){_0x3db053['where']=_['merge'](_0x3db053[_0x7fa1('0x3d')],{'$or':_['map'](_0xf416c8,function(_0x31861a){if(_0x31861a['type']!=='VIRTUAL'){var _0x596458={};_0x596458[_0x31861a[_0x7fa1('0x2d')]]={'$like':'%'+_0x447865[_0x7fa1('0x32')][_0x7fa1('0x3c')]+'%'};return _0x596458;}})});}_0x3db053=_[_0x7fa1('0x3e')]({},_0x3db053,_0x447865[_0x7fa1('0x3f')]);var _0x14806b={'where':_0x3db053[_0x7fa1('0x3d')]};return db[_0x7fa1('0x2f')]['count'](_0x14806b)[_0x7fa1('0x2b')](function(_0x360d80){_0x2fe05d[_0x7fa1('0x24')]=_0x360d80;if(_0x447865[_0x7fa1('0x32')][_0x7fa1('0x40')]){_0x3db053[_0x7fa1('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7fa1('0x42')](_0x3db053);})[_0x7fa1('0x2b')](function(_0x342eeb){_0x2fe05d[_0x7fa1('0x43')]=_0x342eeb;return _0x2fe05d;})[_0x7fa1('0x2b')](respondWithFilteredResult(_0x80a7a4,_0x3db053))[_0x7fa1('0x44')](handleError(_0x80a7a4,null));};exports[_0x7fa1('0x45')]=function(_0x563f47,_0x1cc903){var _0x455b4e={'raw':!![],'where':{'id':_0x563f47[_0x7fa1('0x46')]['id']}},_0x579eff={};_0x579eff['model']=_[_0x7fa1('0x31')](db[_0x7fa1('0x2f')][_0x7fa1('0x47')]);_0x579eff[_0x7fa1('0x32')]=_[_0x7fa1('0x31')](_0x563f47[_0x7fa1('0x32')]);_0x579eff[_0x7fa1('0x33')]=_[_0x7fa1('0x34')](_0x579eff['model'],_0x579eff['query']);_0x455b4e[_0x7fa1('0x36')]=_['intersection'](_0x579eff['model'],qs[_0x7fa1('0x37')](_0x563f47['query'][_0x7fa1('0x37')]));_0x455b4e['attributes']=_0x455b4e[_0x7fa1('0x36')]['length']?_0x455b4e[_0x7fa1('0x36')]:_0x579eff[_0x7fa1('0x35')];if(_0x563f47[_0x7fa1('0x32')][_0x7fa1('0x40')]){_0x455b4e[_0x7fa1('0x41')]=[{'all':!![]}];}_0x455b4e=_[_0x7fa1('0x3e')]({},_0x455b4e,_0x563f47[_0x7fa1('0x3f')]);return db['ChatInternalMessage'][_0x7fa1('0x48')](_0x455b4e)['then'](handleEntityNotFound(_0x1cc903,null))['then'](respondWithResult(_0x1cc903,null))[_0x7fa1('0x44')](handleError(_0x1cc903,null));};exports[_0x7fa1('0x49')]=function(_0x27ff65,_0x5d7769){return db['ChatInternalMessage'][_0x7fa1('0x49')](_0x27ff65[_0x7fa1('0x4a')],{})['then'](respondWithResult(_0x5d7769,0xc9))['catch'](handleError(_0x5d7769,null));};exports['update']=function(_0x283d76,_0x2c5213){if(_0x283d76['body']['id']){delete _0x283d76[_0x7fa1('0x4a')]['id'];}return db[_0x7fa1('0x2f')][_0x7fa1('0x48')]({'where':{'id':_0x283d76[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x2b')](handleEntityNotFound(_0x2c5213,null))[_0x7fa1('0x2b')](saveUpdates(_0x283d76[_0x7fa1('0x4a')],null))[_0x7fa1('0x2b')](respondWithResult(_0x2c5213,null))[_0x7fa1('0x44')](handleError(_0x2c5213,null));};exports['destroy']=function(_0x1d8da3,_0x222777){return db[_0x7fa1('0x2f')][_0x7fa1('0x48')]({'where':{'id':_0x1d8da3[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x2b')](handleEntityNotFound(_0x222777,null))[_0x7fa1('0x2b')](removeEntity(_0x222777,null))[_0x7fa1('0x44')](handleError(_0x222777,null));};exports['describe']=function(_0x597fd5,_0xea659f){return db[_0x7fa1('0x2f')]['describe']()[_0x7fa1('0x2b')](respondWithResult(_0xea659f,null))['catch'](handleError(_0xea659f,null));};function wrapUser(_0x55b9e7){return function(_0x220258){var _0x13095c=_0x55b9e7[_0x7fa1('0x4b')]({'plain':!![]});_0x13095c[_0x7fa1('0x4c')]=[];if(_0x220258){_0x13095c['lastMessageAt']=_0x220258['createdAt'];_0x13095c[_0x7fa1('0x4d')]=_0x220258;}else{_0x13095c[_0x7fa1('0x4e')]=moment(0x0)[_0x7fa1('0x4f')](_0x7fa1('0x50'));_0x13095c['lastMessage']={};}return _0x13095c;};}exports[_0x7fa1('0x51')]=function(_0x32ef8c,_0x4315bd,_0x41e7e8){var _0x149b5a=[];return db[_0x7fa1('0x52')][_0x7fa1('0x42')]({'where':{'role':['agent',_0x7fa1('0x53'),'user']},'attributes':['id',_0x7fa1('0x54'),_0x7fa1('0x2d'),'role',_0x7fa1('0x55'),_0x7fa1('0x56'),'online',_0x7fa1('0x57'),_0x7fa1('0x58'),'showWebBar'],'order':qs[_0x7fa1('0x3a')](_0x7fa1('0x59')),'include':[{'model':db[_0x7fa1('0x5a')],'as':_0x7fa1('0x5b'),'attributes':['id','name',_0x7fa1('0x5c')],'through':{'attributes':[]}}]})[_0x7fa1('0x2b')](function(_0x3a9afc){if(_0x3a9afc){var _0x23d06c=_0x32ef8c[_0x7fa1('0x5d')][_0x7fa1('0x4b')]({'plain':!![]});if(!_0x23d06c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23d06c[_0x7fa1('0x5e')]===_0x7fa1('0x5d')){return db[_0x7fa1('0x5f')][_0x7fa1('0x48')]({'where':{'name':_0x7fa1('0x60'),'userProfileId':_0x23d06c['userProfileId']},'raw':!![]})[_0x7fa1('0x2b')](function(_0x3bfbd4){if(_0x3bfbd4){if(_0x3bfbd4['autoAssociation']===0x0){return db[_0x7fa1('0x61')][_0x7fa1('0x42')]({'where':{'sectionId':_0x3bfbd4['id']},'raw':!![]})[_0x7fa1('0x2b')](function(_0x154316){var _0x5320fc=[];if(_[_0x7fa1('0x62')](_0x154316)){_0x5320fc=_['filter'](_0x3a9afc,function(_0x242f25){if(_0x242f25[_0x7fa1('0x5e')]!=='agent'){return _0x242f25;}});return _0x5320fc;}else{for(var _0x1f3368=0x0;_0x1f3368<_0x3a9afc[_0x7fa1('0x63')];_0x1f3368++){var _0x5444c9=_0x3a9afc[_0x1f3368];if(_0x5444c9[_0x7fa1('0x5e')]==='agent'){var _0x58399a=_[_0x7fa1('0x48')](_0x154316,function(_0x53043e){return _0x53043e['resourceId']===_0x5444c9['id'];});if(_0x58399a)_0x5320fc['push'](_0x5444c9);}else{_0x5320fc[_0x7fa1('0x64')](_0x5444c9);}}return _0x5320fc;}});}else{return _0x3a9afc;}}else{var _0x2ec1d2=_[_0x7fa1('0x3c')](_0x3a9afc,function(_0x326d3a){if(_0x326d3a[_0x7fa1('0x5e')]!=='agent'){return _0x326d3a;}});return _0x2ec1d2;}});}else{return _0x3a9afc;}}})[_0x7fa1('0x2b')](function(_0x171ae8){var _0x4f0ae5=[];if(_0x171ae8){_0x149b5a=_0x171ae8;for(var _0x4db451=0x0;_0x4db451<_0x171ae8[_0x7fa1('0x63')];_0x4db451+=0x1){_0x149b5a[_0x4db451][_0x7fa1('0x4c')]=[];_0x4f0ae5[_0x7fa1('0x64')](db['ChatInternalMessage'][_0x7fa1('0x48')]({'where':{'FromId':[_0x32ef8c[_0x7fa1('0x5d')]['id'],_0x171ae8[_0x4db451]['id']],'ToId':[_0x32ef8c[_0x7fa1('0x5d')]['id'],_0x171ae8[_0x4db451]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x7fa1('0x65'),_0x7fa1('0x66'),_0x7fa1('0x4a')],'order':qs[_0x7fa1('0x3a')](_0x7fa1('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7fa1('0x2b')](wrapUser(_0x171ae8[_0x4db451])));}return BPromise[_0x7fa1('0x68')](_0x4f0ae5);}return[];})['then'](function(_0x4e0a17){return{'rows':_0x4e0a17,'count':_0x4e0a17['length']};})[_0x7fa1('0x2b')](respondWithResult(_0x4315bd,null))['catch'](handleError(_0x4315bd,null));}; \ No newline at end of file +var _0x3301=['api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','status','end','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','catch','create','body','find','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','admin','user','fullname','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3301,0xcd));var _0x1330=function(_0x238e7c,_0x46ee86){_0x238e7c=_0x238e7c-0x0;var _0x128a39=_0x3301[_0x238e7c];return _0x128a39;};'use strict';var pdf=require(_0x1330('0x0'));var emlformat=require(_0x1330('0x1'));var rimraf=require(_0x1330('0x2'));var zipdir=require(_0x1330('0x3'));var jsonpatch=require(_0x1330('0x4'));var rp=require(_0x1330('0x5'));var moment=require(_0x1330('0x6'));var BPromise=require(_0x1330('0x7'));var Mustache=require('mustache');var util=require(_0x1330('0x8'));var path=require(_0x1330('0x9'));var sox=require(_0x1330('0xa'));var csv=require(_0x1330('0xb'));var ejs=require(_0x1330('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1330('0xd'));var crypto=require(_0x1330('0xe'));var jsforce=require(_0x1330('0xf'));var deskjs=require(_0x1330('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1330('0x11'));var Papa=require('papaparse');var Redis=require(_0x1330('0x12'));var authService=require(_0x1330('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x1330('0x14'));var hardwareService=require(_0x1330('0x15'));var logger=require(_0x1330('0x16'))(_0x1330('0x17'));var utils=require(_0x1330('0x18'));var config=require(_0x1330('0x19'));var db=require('../../mysqldb')['db'];config[_0x1330('0x1a')]=_[_0x1330('0x1b')](config[_0x1330('0x1a')],{'host':_0x1330('0x1c'),'port':0x18eb});var socket=require(_0x1330('0x1d'))(new Redis(config[_0x1330('0x1a')]));require('./chatInternalMessage.socket')[_0x1330('0x1e')](socket);function respondWithStatusCode(_0x1d9998,_0x522a3c){_0x522a3c=_0x522a3c||0xcc;return function(_0x31261c){if(_0x31261c){return _0x1d9998['sendStatus'](_0x522a3c);}return _0x1d9998[_0x1330('0x1f')](_0x522a3c)[_0x1330('0x20')]();};}function respondWithResult(_0x5c9b88,_0x4c0563){_0x4c0563=_0x4c0563||0xc8;return function(_0x23a6c7){if(_0x23a6c7){return _0x5c9b88[_0x1330('0x1f')](_0x4c0563)['json'](_0x23a6c7);}};}function respondWithFilteredResult(_0x1fd36c,_0x18a963){return function(_0x1b31c1){if(_0x1b31c1){var _0x5e6608=_0x1b31c1[_0x1330('0x21')],_0x34355f=_0x18a963['offset'],_0x324c7c=_0x18a963[_0x1330('0x22')]+_0x18a963[_0x1330('0x23')],_0x2ee625;if(_0x324c7c>=_0x5e6608){_0x324c7c=_0x5e6608;_0x2ee625=0xc8;}else{_0x2ee625=0xce;}_0x1fd36c[_0x1330('0x1f')](_0x2ee625);return _0x1fd36c[_0x1330('0x24')](_0x1330('0x25'),_0x34355f+'-'+_0x324c7c+'/'+_0x5e6608)['json'](_0x1b31c1);}return null;};}function patchUpdates(_0xade5b0){return function(_0x24a909){try{jsonpatch[_0x1330('0x26')](_0x24a909,_0xade5b0,!![]);}catch(_0x26fd5d){return BPromise['reject'](_0x26fd5d);}return _0x24a909[_0x1330('0x27')]();};}function saveUpdates(_0x28b8ee,_0x5e7298){return function(_0xc4611e){if(_0xc4611e){return _0xc4611e[_0x1330('0x28')](_0x28b8ee)[_0x1330('0x29')](function(_0x3db482){return _0x3db482;});}return null;};}function removeEntity(_0x2984c1,_0xe5605e){return function(_0x4c8aad){if(_0x4c8aad){return _0x4c8aad[_0x1330('0x2a')]()[_0x1330('0x29')](function(){_0x2984c1[_0x1330('0x1f')](0xcc)[_0x1330('0x20')]();});}};}function handleEntityNotFound(_0x288f25,_0x4b49af){return function(_0x4ac05e){if(!_0x4ac05e){_0x288f25['sendStatus'](0x194);}return _0x4ac05e;};}function handleError(_0x1d4ad7,_0x4b0fb4){_0x4b0fb4=_0x4b0fb4||0x1f4;return function(_0x53daaa){logger[_0x1330('0x2b')](_0x53daaa[_0x1330('0x2c')]);if(_0x53daaa['name']){delete _0x53daaa[_0x1330('0x2d')];}_0x1d4ad7[_0x1330('0x1f')](_0x4b0fb4)['send'](_0x53daaa);};}exports[_0x1330('0x2e')]=function(_0x4eebd2,_0x5ba85b){var _0x5b149d={},_0x4ba1a3={},_0x14a9a8={'count':0x0,'rows':[]};var _0x1e61d4=_[_0x1330('0x2f')](db[_0x1330('0x30')][_0x1330('0x31')],function(_0x508414){return{'name':_0x508414[_0x1330('0x32')],'type':_0x508414[_0x1330('0x33')][_0x1330('0x34')]};});_0x4ba1a3[_0x1330('0x35')]=_['map'](_0x1e61d4,_0x1330('0x2d'));_0x4ba1a3[_0x1330('0x36')]=_[_0x1330('0x37')](_0x4eebd2[_0x1330('0x36')]);_0x4ba1a3[_0x1330('0x38')]=_[_0x1330('0x39')](_0x4ba1a3[_0x1330('0x35')],_0x4ba1a3[_0x1330('0x36')]);_0x5b149d[_0x1330('0x3a')]=_[_0x1330('0x39')](_0x4ba1a3[_0x1330('0x35')],qs[_0x1330('0x3b')](_0x4eebd2[_0x1330('0x36')][_0x1330('0x3b')]));_0x5b149d[_0x1330('0x3a')]=_0x5b149d[_0x1330('0x3a')][_0x1330('0x3c')]?_0x5b149d[_0x1330('0x3a')]:_0x4ba1a3[_0x1330('0x35')];if(!_0x4eebd2[_0x1330('0x36')][_0x1330('0x3d')](_0x1330('0x3e'))){_0x5b149d[_0x1330('0x23')]=qs[_0x1330('0x23')](_0x4eebd2[_0x1330('0x36')]['limit']);_0x5b149d[_0x1330('0x22')]=qs[_0x1330('0x22')](_0x4eebd2[_0x1330('0x36')][_0x1330('0x22')]);}_0x5b149d[_0x1330('0x3f')]=qs['sort'](_0x4eebd2[_0x1330('0x36')][_0x1330('0x40')]);_0x5b149d[_0x1330('0x41')]=qs[_0x1330('0x38')](_[_0x1330('0x42')](_0x4eebd2['query'],_0x4ba1a3[_0x1330('0x38')]));if(_0x4eebd2[_0x1330('0x36')]['filter']){_0x5b149d['where']=_['merge'](_0x5b149d[_0x1330('0x41')],{'$or':_[_0x1330('0x2f')](_0x1e61d4,function(_0x341879){if(_0x341879['type']!==_0x1330('0x43')){var _0x105db7={};_0x105db7[_0x341879[_0x1330('0x2d')]]={'$like':'%'+_0x4eebd2[_0x1330('0x36')][_0x1330('0x44')]+'%'};return _0x105db7;}})});}_0x5b149d=_[_0x1330('0x45')]({},_0x5b149d,_0x4eebd2[_0x1330('0x46')]);var _0x21e50a={'where':_0x5b149d[_0x1330('0x41')]};return db[_0x1330('0x30')][_0x1330('0x21')](_0x21e50a)[_0x1330('0x29')](function(_0x26579b){_0x14a9a8['count']=_0x26579b;if(_0x4eebd2['query'][_0x1330('0x47')]){_0x5b149d[_0x1330('0x48')]=[{'all':!![]}];}return db[_0x1330('0x30')][_0x1330('0x49')](_0x5b149d);})[_0x1330('0x29')](function(_0x152b0c){_0x14a9a8['rows']=_0x152b0c;return _0x14a9a8;})['then'](respondWithFilteredResult(_0x5ba85b,_0x5b149d))['catch'](handleError(_0x5ba85b,null));};exports[_0x1330('0x4a')]=function(_0x471e59,_0xdc1530){var _0x1855f5={'raw':!![],'where':{'id':_0x471e59[_0x1330('0x4b')]['id']}},_0x480b88={};_0x480b88[_0x1330('0x35')]=_[_0x1330('0x37')](db[_0x1330('0x30')][_0x1330('0x31')]);_0x480b88[_0x1330('0x36')]=_[_0x1330('0x37')](_0x471e59[_0x1330('0x36')]);_0x480b88[_0x1330('0x38')]=_[_0x1330('0x39')](_0x480b88[_0x1330('0x35')],_0x480b88[_0x1330('0x36')]);_0x1855f5[_0x1330('0x3a')]=_[_0x1330('0x39')](_0x480b88[_0x1330('0x35')],qs['fields'](_0x471e59[_0x1330('0x36')][_0x1330('0x3b')]));_0x1855f5['attributes']=_0x1855f5['attributes'][_0x1330('0x3c')]?_0x1855f5['attributes']:_0x480b88[_0x1330('0x35')];if(_0x471e59[_0x1330('0x36')][_0x1330('0x47')]){_0x1855f5[_0x1330('0x48')]=[{'all':!![]}];}_0x1855f5=_[_0x1330('0x45')]({},_0x1855f5,_0x471e59['options']);return db['ChatInternalMessage']['find'](_0x1855f5)[_0x1330('0x29')](handleEntityNotFound(_0xdc1530,null))[_0x1330('0x29')](respondWithResult(_0xdc1530,null))[_0x1330('0x4c')](handleError(_0xdc1530,null));};exports[_0x1330('0x4d')]=function(_0x5243a4,_0x36a71f){return db[_0x1330('0x30')][_0x1330('0x4d')](_0x5243a4['body'],{})[_0x1330('0x29')](respondWithResult(_0x36a71f,0xc9))[_0x1330('0x4c')](handleError(_0x36a71f,null));};exports[_0x1330('0x28')]=function(_0x631fb3,_0x53410c){if(_0x631fb3[_0x1330('0x4e')]['id']){delete _0x631fb3['body']['id'];}return db[_0x1330('0x30')]['find']({'where':{'id':_0x631fb3[_0x1330('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53410c,null))[_0x1330('0x29')](saveUpdates(_0x631fb3[_0x1330('0x4e')],null))[_0x1330('0x29')](respondWithResult(_0x53410c,null))[_0x1330('0x4c')](handleError(_0x53410c,null));};exports[_0x1330('0x2a')]=function(_0x5e1cd2,_0x15ae13){return db[_0x1330('0x30')][_0x1330('0x4f')]({'where':{'id':_0x5e1cd2[_0x1330('0x4b')]['id']}})[_0x1330('0x29')](handleEntityNotFound(_0x15ae13,null))[_0x1330('0x29')](removeEntity(_0x15ae13,null))['catch'](handleError(_0x15ae13,null));};exports[_0x1330('0x50')]=function(_0x521a5b,_0x1059e6){return db['ChatInternalMessage'][_0x1330('0x50')]()[_0x1330('0x29')](respondWithResult(_0x1059e6,null))[_0x1330('0x4c')](handleError(_0x1059e6,null));};function wrapUser(_0x3a9dab){return function(_0x3fa032){var _0x258499=_0x3a9dab['get']({'plain':!![]});_0x258499[_0x1330('0x51')]=[];if(_0x3fa032){_0x258499[_0x1330('0x52')]=_0x3fa032[_0x1330('0x53')];_0x258499['lastMessage']=_0x3fa032;}else{_0x258499[_0x1330('0x52')]=moment(0x0)[_0x1330('0x54')](_0x1330('0x55'));_0x258499[_0x1330('0x56')]={};}return _0x258499;};}exports['getUsers']=function(_0x2244b6,_0x31ff29,_0x4c6afe){var _0x40ed62=[];return db[_0x1330('0x57')][_0x1330('0x49')]({'where':{'role':[_0x1330('0x58'),_0x1330('0x59'),_0x1330('0x5a')]},'attributes':['id',_0x1330('0x5b'),_0x1330('0x2d'),'role',_0x1330('0x5c'),_0x1330('0x5d'),_0x1330('0x5e'),_0x1330('0x5f'),_0x1330('0x60'),_0x1330('0x61')],'order':qs[_0x1330('0x40')](_0x1330('0x62')),'include':[{'model':db[_0x1330('0x63')],'as':'VoiceQueues','attributes':['id',_0x1330('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x1330('0x29')](function(_0x20ee4b){if(_0x20ee4b){var _0x1da2f9=_0x2244b6[_0x1330('0x5a')]['get']({'plain':!![]});if(!_0x1da2f9)throw new Error(_0x1330('0x64'));if(_0x1da2f9[_0x1330('0x65')]==='user'){return db[_0x1330('0x66')][_0x1330('0x4f')]({'where':{'name':_0x1330('0x67'),'userProfileId':_0x1da2f9[_0x1330('0x68')]},'raw':!![]})['then'](function(_0x2eb4d2){if(_0x2eb4d2){if(_0x2eb4d2['autoAssociation']===0x0){return db[_0x1330('0x69')][_0x1330('0x49')]({'where':{'sectionId':_0x2eb4d2['id']},'raw':!![]})['then'](function(_0x2bc34b){var _0x27194b=[];if(_[_0x1330('0x6a')](_0x2bc34b)){_0x27194b=_[_0x1330('0x44')](_0x20ee4b,function(_0x4597fe){if(_0x4597fe[_0x1330('0x65')]!==_0x1330('0x58')){return _0x4597fe;}});return _0x27194b;}else{for(var _0x29e8f4=0x0;_0x29e8f4<_0x20ee4b[_0x1330('0x3c')];_0x29e8f4++){var _0x33301a=_0x20ee4b[_0x29e8f4];if(_0x33301a['role']===_0x1330('0x58')){var _0x264b82=_[_0x1330('0x4f')](_0x2bc34b,function(_0x3a53ec){return _0x3a53ec[_0x1330('0x6b')]===_0x33301a['id'];});if(_0x264b82)_0x27194b[_0x1330('0x6c')](_0x33301a);}else{_0x27194b['push'](_0x33301a);}}return _0x27194b;}});}else{return _0x20ee4b;}}else{var _0xb57e77=_['filter'](_0x20ee4b,function(_0x23cb0c){if(_0x23cb0c[_0x1330('0x65')]!==_0x1330('0x58')){return _0x23cb0c;}});return _0xb57e77;}});}else{return _0x20ee4b;}}})[_0x1330('0x29')](function(_0x2c8597){var _0x1c776b=[];if(_0x2c8597){_0x40ed62=_0x2c8597;for(var _0x570ff7=0x0;_0x570ff7<_0x2c8597[_0x1330('0x3c')];_0x570ff7+=0x1){_0x40ed62[_0x570ff7][_0x1330('0x51')]=[];_0x1c776b[_0x1330('0x6c')](db['ChatInternalMessage'][_0x1330('0x4f')]({'where':{'FromId':[_0x2244b6[_0x1330('0x5a')]['id'],_0x2c8597[_0x570ff7]['id']],'ToId':[_0x2244b6[_0x1330('0x5a')]['id'],_0x2c8597[_0x570ff7]['id']],'ChatGroupId':null},'attributes':['id',_0x1330('0x53'),_0x1330('0x6d'),_0x1330('0x6e'),_0x1330('0x6f'),_0x1330('0x4e')],'order':qs[_0x1330('0x40')](_0x1330('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x1330('0x29')](wrapUser(_0x2c8597[_0x570ff7])));}return BPromise[_0x1330('0x71')](_0x1c776b);}return[];})['then'](function(_0x592c15){return{'rows':_0x592c15,'count':_0x592c15[_0x1330('0x3c')]};})[_0x1330('0x29')](respondWithResult(_0x31ff29,null))[_0x1330('0x4c')](handleError(_0x31ff29,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d25e268..112bea1 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 _0x67cb=['events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1d4593,_0x1ef24c){var _0x42523d=function(_0x67a0e){while(--_0x67a0e){_0x1d4593['push'](_0x1d4593['shift']());}};_0x42523d(++_0x1ef24c);}(_0x67cb,0x19e));var _0xb67c=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x67cb[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require(_0xb67c('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xb67c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb67c('0x2')](0x0);var events={'afterCreate':_0xb67c('0x3'),'afterUpdate':_0xb67c('0x4'),'afterDestroy':_0xb67c('0x5')};function emitEvent(_0x2c66b2){return function(_0x4dd003,_0x5d6226,_0x23aec8){ChatInternalMessageEvents[_0xb67c('0x6')](_0x2c66b2+':'+_0x4dd003['id'],_0x4dd003);ChatInternalMessageEvents[_0xb67c('0x6')](_0x2c66b2,_0x4dd003);_0x23aec8(null);};}for(var e in events){if(events[_0xb67c('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb67c('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x397c=['exports','events','../../mysqldb','ChatInternalMessage','save','remove','emit','hasOwnProperty'];(function(_0x3e4f41,_0x214d32){var _0x286f08=function(_0x543d44){while(--_0x543d44){_0x3e4f41['push'](_0x3e4f41['shift']());}};_0x286f08(++_0x214d32);}(_0x397c,0xc1));var _0xc397=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x397c[_0x4a747d];return _0x3a5b5c;};'use strict';var EventEmitter=require(_0xc397('0x0'));var ChatInternalMessage=require(_0xc397('0x1'))['db'][_0xc397('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc397('0x3'),'afterUpdate':'update','afterDestroy':_0xc397('0x4')};function emitEvent(_0x4547f9){return function(_0x32c908,_0x194ade,_0x8be32e){ChatInternalMessageEvents['emit'](_0x4547f9+':'+_0x32c908['id'],_0x32c908);ChatInternalMessageEvents[_0xc397('0x5')](_0x4547f9,_0x32c908);_0x8be32e(null);};}for(var e in events){if(events[_0xc397('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xc397('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 5c75b20..124138e 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 _0x4fc2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3cbcd8,_0x57cea2){var _0x58134a=function(_0x52d8f0){while(--_0x52d8f0){_0x3cbcd8['push'](_0x3cbcd8['shift']());}};_0x58134a(++_0x57cea2);}(_0x4fc2,0x111));var _0x24fc=function(_0x4fc756,_0x5969c9){_0x4fc756=_0x4fc756-0x0;var _0x6b1861=_0x4fc2[_0x4fc756];return _0x6b1861;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24fc('0xb'),'collate':_0x24fc('0xc')});}; \ No newline at end of file +var _0xd8b0=['define','chat_internal_messages','utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3ecd0b,_0x3473d7){var _0x24dcfe=function(_0x453545){while(--_0x453545){_0x3ecd0b['push'](_0x3ecd0b['shift']());}};_0x24dcfe(++_0x3473d7);}(_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('./chatInternalMessage.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatInternalMessage',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0d8b('0x9'),'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 f53cc81..2b4e8db 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 _0x35a4=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xa1e030,_0x579969){var _0x1619bb=function(_0x108f53){while(--_0x108f53){_0xa1e030['push'](_0xa1e030['shift']());}};_0x1619bb(++_0x579969);}(_0x35a4,0x150));var _0x435a=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x35a4[_0x225f50];return _0x19d003;};'use strict';var _=require(_0x435a('0x0'));var util=require(_0x435a('0x1'));var moment=require(_0x435a('0x2'));var BPromise=require(_0x435a('0x3'));var rs=require(_0x435a('0x4'));var fs=require('fs');var Redis=require(_0x435a('0x5'));var db=require(_0x435a('0x6'))['db'];var utils=require(_0x435a('0x7'));var logger=require(_0x435a('0x8'))(_0x435a('0x9'));var config=require(_0x435a('0xa'));var jayson=require(_0x435a('0xb'));var client=jayson[_0x435a('0xc')][_0x435a('0xd')]({'port':0x232a});config[_0x435a('0xe')]=_[_0x435a('0xf')](config[_0x435a('0xe')],{'host':_0x435a('0x10'),'port':0x18eb});var socket=require(_0x435a('0x11'))(new Redis(config[_0x435a('0xe')]));require('./chatInternalMessage.socket')[_0x435a('0x12')](socket);function respondWithRpcPromise(_0x49613d,_0x7ab381,_0xfb1867){return new BPromise(function(_0x48712f,_0x1cfff1){return client[_0x435a('0x13')](_0x49613d,_0xfb1867)['then'](function(_0x293033){logger['info'](_0x435a('0x14'),_0x7ab381,_0x435a('0x15'));logger[_0x435a('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x7ab381,_0x435a('0x15'),JSON[_0x435a('0x17')](_0x293033));if(_0x293033[_0x435a('0x18')]){if(_0x293033['error'][_0x435a('0x19')]===0x1f4){logger[_0x435a('0x18')](_0x435a('0x14'),_0x7ab381,_0x293033[_0x435a('0x18')][_0x435a('0x1a')]);return _0x1cfff1(_0x293033[_0x435a('0x18')][_0x435a('0x1a')]);}logger[_0x435a('0x18')](_0x435a('0x14'),_0x7ab381,_0x293033[_0x435a('0x18')]['message']);return _0x48712f(_0x293033['error'][_0x435a('0x1a')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x7ab381,_0x435a('0x15'));_0x48712f(_0x293033[_0x435a('0x1b')][_0x435a('0x1a')]);}})[_0x435a('0x1c')](function(_0xc15e13){logger[_0x435a('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x7ab381,_0xc15e13);_0x1cfff1(_0xc15e13);});});} \ No newline at end of file +var _0xbabb=['defaults','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis'];(function(_0x52be03,_0x5bf5f6){var _0xc64bda=function(_0x4ea1a7){while(--_0x4ea1a7){_0x52be03['push'](_0x52be03['shift']());}};_0xc64bda(++_0x5bf5f6);}(_0xbabb,0xa6));var _0xbbab=function(_0x2bb6d7,_0x47d510){_0x2bb6d7=_0x2bb6d7-0x0;var _0x574d01=_0xbabb[_0x2bb6d7];return _0x574d01;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbbab('0x0'));var BPromise=require('bluebird');var rs=require(_0xbbab('0x1'));var fs=require('fs');var Redis=require(_0xbbab('0x2'));var db=require(_0xbbab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbab('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbbab('0x5'));var client=jayson[_0xbbab('0x6')][_0xbbab('0x7')]({'port':0x232a});config[_0xbbab('0x8')]=_[_0xbbab('0x9')](config[_0xbbab('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xbbab('0xa'))(new Redis(config[_0xbbab('0x8')]));require(_0xbbab('0xb'))[_0xbbab('0xc')](socket);function respondWithRpcPromise(_0x516bd8,_0x360aaf,_0x1da77a){return new BPromise(function(_0x3dec45,_0x4ad9d8){return client['request'](_0x516bd8,_0x1da77a)[_0xbbab('0xd')](function(_0x209807){logger[_0xbbab('0xe')]('ChatInternalMessage,\x20%s,\x20%s',_0x360aaf,_0xbbab('0xf'));logger[_0xbbab('0x10')](_0xbbab('0x11'),_0x360aaf,_0xbbab('0xf'),JSON[_0xbbab('0x12')](_0x209807));if(_0x209807[_0xbbab('0x13')]){if(_0x209807[_0xbbab('0x13')][_0xbbab('0x14')]===0x1f4){logger[_0xbbab('0x13')](_0xbbab('0x15'),_0x360aaf,_0x209807['error'][_0xbbab('0x16')]);return _0x4ad9d8(_0x209807[_0xbbab('0x13')]['message']);}logger[_0xbbab('0x13')](_0xbbab('0x15'),_0x360aaf,_0x209807[_0xbbab('0x13')][_0xbbab('0x16')]);return _0x3dec45(_0x209807[_0xbbab('0x13')][_0xbbab('0x16')]);}else{logger[_0xbbab('0xe')](_0xbbab('0x15'),_0x360aaf,'request\x20sent');_0x3dec45(_0x209807[_0xbbab('0x17')][_0xbbab('0x16')]);}})[_0xbbab('0x18')](function(_0x81fd19){logger[_0xbbab('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x360aaf,_0x81fd19);_0x4ad9d8(_0x81fd19);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 4022f01..3b29450 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 _0x1de4=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x325fde,_0xd628df){var _0xf4a49=function(_0x453ad2){while(--_0x453ad2){_0x325fde['push'](_0x325fde['shift']());}};_0xf4a49(++_0xd628df);}(_0x1de4,0x94));var _0x41de=function(_0x589e5f,_0x40dd49){_0x589e5f=_0x589e5f-0x0;var _0x2c44c5=_0x1de4[_0x589e5f];return _0x2c44c5;};'use strict';var ChatInternalMessageEvents=require(_0x41de('0x0'));var events=[_0x41de('0x1'),_0x41de('0x2'),_0x41de('0x3')];function createListener(_0x4aafae,_0x35b505){return function(_0x43c48c){_0x35b505[_0x41de('0x4')](_0x4aafae,_0x43c48c);};}function removeListener(_0x5dd1cb,_0x378cbe){return function(){ChatInternalMessageEvents[_0x41de('0x5')](_0x5dd1cb,_0x378cbe);};}exports['register']=function(_0x2e7196){for(var _0x122565=0x0,_0x2f1078=events[_0x41de('0x6')];_0x122565<_0x2f1078;_0x122565++){var _0x50f716=events[_0x122565];var _0x4c292c=createListener(_0x41de('0x7')+_0x50f716,_0x2e7196);ChatInternalMessageEvents['on'](_0x50f716,_0x4c292c);}}; \ No newline at end of file +var _0x885e=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0x3d0177,_0x5c98b1){var _0x47e974=function(_0x37b219){while(--_0x37b219){_0x3d0177['push'](_0x3d0177['shift']());}};_0x47e974(++_0x5c98b1);}(_0x885e,0xe4));var _0xe885=function(_0x382c3a,_0x32c41a){_0x382c3a=_0x382c3a-0x0;var _0x473588=_0x885e[_0x382c3a];return _0x473588;};'use strict';var ChatInternalMessageEvents=require(_0xe885('0x0'));var events=[_0xe885('0x1'),'remove',_0xe885('0x2')];function createListener(_0x1cd11a,_0x162982){return function(_0xfea0bc){_0x162982[_0xe885('0x3')](_0x1cd11a,_0xfea0bc);};}function removeListener(_0x4fcd9b,_0x499ab6){return function(){ChatInternalMessageEvents[_0xe885('0x4')](_0x4fcd9b,_0x499ab6);};}exports[_0xe885('0x5')]=function(_0x33286a){for(var _0x1a5fd6=0x0,_0x55d2b2=events[_0xe885('0x6')];_0x1a5fd6<_0x55d2b2;_0x1a5fd6++){var _0x597bdc=events[_0x1a5fd6];var _0x2e8fe0=createListener(_0xe885('0x7')+_0x597bdc,_0x33286a);ChatInternalMessageEvents['on'](_0x597bdc,_0x2e8fe0);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 452aacc..bc38b7e 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 _0xcb91=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x158f58,_0x1b25fa){var _0xf3f9d=function(_0x304d5f){while(--_0x304d5f){_0x158f58['push'](_0x158f58['shift']());}};_0xf3f9d(++_0x1b25fa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xcb91[_0x1d70db];return _0x3060c6;};'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 auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./chatInternalMessage.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/users',auth[_0x1cb9('0x7')](),controller['getUsers']);router['get'](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x7')](),controller['create']);router[_0x1cb9('0xd')](_0x1cb9('0xa'),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')](_0x1cb9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xd8b0=['put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','index','get','/describe','describe','isAuthenticated','getUsers','/:id','show','post'];(function(_0x868e36,_0x2fe59a){var _0x5bc09a=function(_0x3eb258){while(--_0x3eb258){_0x868e36['push'](_0x868e36['shift']());}};_0x5bc09a(++_0x2fe59a);}(_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 auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/users',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')]('/',auth[_0x0d8b('0xb')](),controller['create']);router[_0x0d8b('0x10')]('/:id',controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);module[_0x0d8b('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b0cbcc1..5f9e18f 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 _0xc163=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x1ffed3,_0x3d7bac){var _0x5939b1=function(_0x423488){while(--_0x423488){_0x1ffed3['push'](_0x1ffed3['shift']());}};_0x5939b1(++_0x3d7bac);}(_0xc163,0x1a6));var _0x3c16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc163[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3c16('0x0'));module[_0x3c16('0x1')]={'body':{'type':Sequelize[_0x3c16('0x2')](_0x3c16('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3c16('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3c16('0x5')]('in',_0x3c16('0x6')),'defaultValue':_0x3c16('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3c16('0x7')]}}; \ No newline at end of file +var _0xdee0=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x4f9fa1,_0x67af7d){var _0x1e7f67=function(_0x3194b2){while(--_0x3194b2){_0x4f9fa1['push'](_0x4f9fa1['shift']());}};_0x1e7f67(++_0x67af7d);}(_0xdee0,0xb6));var _0x0dee=function(_0x68df1,_0x3e2a83){_0x68df1=_0x68df1-0x0;var _0x865ddc=_0xdee0[_0x68df1];return _0x865ddc;};'use strict';var Sequelize=require(_0x0dee('0x0'));module[_0x0dee('0x1')]={'body':{'type':Sequelize[_0x0dee('0x2')](_0x0dee('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x0dee('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x0dee('0x5')]('in','out'),'defaultValue':_0x0dee('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x0dee('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 87f1aa4..b75c077 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 _0x47cf=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','params','describe','chat','readAt','UserId','user','CmContact','Contact','get','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','agent','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x47cf,0x136));var _0xf47c=function(_0x871287,_0x38aadb){_0x871287=_0x871287-0x0;var _0x3024e3=_0x47cf[_0x871287];return _0x3024e3;};'use strict';var pdf=require(_0xf47c('0x0'));var emlformat=require(_0xf47c('0x1'));var rimraf=require(_0xf47c('0x2'));var zipdir=require(_0xf47c('0x3'));var jsonpatch=require(_0xf47c('0x4'));var rp=require(_0xf47c('0x5'));var moment=require(_0xf47c('0x6'));var BPromise=require(_0xf47c('0x7'));var Mustache=require(_0xf47c('0x8'));var util=require('util');var path=require(_0xf47c('0x9'));var sox=require('sox');var csv=require(_0xf47c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf47c('0xb'));var jsforce=require(_0xf47c('0xc'));var deskjs=require(_0xf47c('0xd'));var toCsv=require(_0xf47c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf47c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf47c('0xf'));var as=require(_0xf47c('0x10'));var hardwareService=require(_0xf47c('0x11'));var logger=require(_0xf47c('0x12'))(_0xf47c('0x13'));var utils=require(_0xf47c('0x14'));var config=require(_0xf47c('0x15'));var db=require(_0xf47c('0x16'))['db'];config[_0xf47c('0x17')]=_[_0xf47c('0x18')](config['redis'],{'host':_0xf47c('0x19'),'port':0x18eb});var socket=require(_0xf47c('0x1a'))(new Redis(config['redis']));require(_0xf47c('0x1b'))[_0xf47c('0x1c')](socket);var jayson=require(_0xf47c('0x1d'));var client=jayson[_0xf47c('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf47c('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x3a668d,_0x53adc2,_0x42d3d2){if(_0x42d3d2){var _0x484303=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x484303[_0xf47c('0x20')](_0x53adc2)){return _0x3a668d;}else{throw new db[(_0xf47c('0x21'))][(_0xf47c('0x22'))](_0xf47c('0x23'));}}else{return _0x3a668d;}}function respondWithRpcPromise(_0x26d35e,_0x334831,_0x2f1b7f,_0x4998e6){return new BPromise(function(_0x1fdfc6,_0x4fcfd0){var _0x5ee527=_0x4998e6||client;return _0x5ee527[_0xf47c('0x24')](_0x26d35e,_0x2f1b7f)[_0xf47c('0x25')](function(_0x79a8ba){logger[_0xf47c('0x26')](_0xf47c('0x27'),_0x334831,_0xf47c('0x28'));logger[_0xf47c('0x29')](_0xf47c('0x2a'),_0x334831,_0xf47c('0x28'),JSON['stringify'](_0x79a8ba));if(_0x79a8ba['error']){if(_0x79a8ba['error']['code']===0x1f4){logger[_0xf47c('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x334831,_0x79a8ba['error'][_0xf47c('0x2c')]);return _0x4fcfd0(_0x79a8ba[_0xf47c('0x2b')]['message']);}logger[_0xf47c('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x334831,_0x79a8ba[_0xf47c('0x2b')]['message']);return _0x1fdfc6(_0x79a8ba[_0xf47c('0x2b')]['message']);}else{logger['info'](_0xf47c('0x27'),_0x334831,_0xf47c('0x28'));_0x1fdfc6(_0x79a8ba[_0xf47c('0x2d')][_0xf47c('0x2c')]);}})['catch'](function(_0x3f2bdb){logger['error'](_0xf47c('0x27'),_0x334831,_0x3f2bdb);_0x4fcfd0(_0x3f2bdb);});});}function respondWithStatusCode(_0x3b326e,_0x1d600e){_0x1d600e=_0x1d600e||0xcc;return function(_0x476d85){if(_0x476d85){return _0x3b326e[_0xf47c('0x2e')](_0x1d600e);}return _0x3b326e[_0xf47c('0x2f')](_0x1d600e)[_0xf47c('0x30')]();};}function respondWithResult(_0x322e31,_0x519439){_0x519439=_0x519439||0xc8;return function(_0x2ef2b7){if(_0x2ef2b7){return _0x322e31[_0xf47c('0x2f')](_0x519439)['json'](_0x2ef2b7);}};}function respondWithFilteredResult(_0x1fe4da,_0x5733e6){return function(_0x402475){if(_0x402475){var _0x19cd6a=_0x402475[_0xf47c('0x31')],_0x198056=_0x5733e6[_0xf47c('0x32')],_0x2922cc=_0x5733e6[_0xf47c('0x32')]+_0x5733e6[_0xf47c('0x33')],_0x55b011;if(_0x2922cc>=_0x19cd6a){_0x2922cc=_0x19cd6a;_0x55b011=0xc8;}else{_0x55b011=0xce;}_0x1fe4da[_0xf47c('0x2f')](_0x55b011);return _0x1fe4da[_0xf47c('0x34')](_0xf47c('0x35'),_0x198056+'-'+_0x2922cc+'/'+_0x19cd6a)[_0xf47c('0x36')](_0x402475);}return null;};}function patchUpdates(_0x5a1cc1){return function(_0x2099db){try{jsonpatch[_0xf47c('0x37')](_0x2099db,_0x5a1cc1,!![]);}catch(_0x1343c1){return BPromise[_0xf47c('0x38')](_0x1343c1);}return _0x2099db[_0xf47c('0x39')]();};}function saveUpdates(_0x1ee43b,_0x3fc2da){return function(_0x57aedb){if(_0x57aedb){return _0x57aedb[_0xf47c('0x3a')](_0x1ee43b)[_0xf47c('0x25')](function(_0x530446){return _0x530446;});}return null;};}function removeEntity(_0x157dbb,_0x48f037){return function(_0x48c32c){if(_0x48c32c){return _0x48c32c[_0xf47c('0x3b')]()[_0xf47c('0x25')](function(){_0x157dbb[_0xf47c('0x2f')](0xcc)[_0xf47c('0x30')]();});}};}function handleEntityNotFound(_0x22fff0,_0x359515){return function(_0x2f3cc5){if(!_0x2f3cc5){_0x22fff0[_0xf47c('0x2e')](0x194);}return _0x2f3cc5;};}function handleError(_0x5cba9e,_0x40bd7d){_0x40bd7d=_0x40bd7d||0x1f4;return function(_0x197bef){logger[_0xf47c('0x2b')](_0x197bef['stack']);if(_0x197bef['name']){delete _0x197bef[_0xf47c('0x3c')];}_0x5cba9e[_0xf47c('0x2f')](_0x40bd7d)[_0xf47c('0x3d')](_0x197bef);};}exports[_0xf47c('0x3e')]=function(_0x3760eb,_0x18a1b5){var _0x57d7e6={},_0x126c74={},_0x28c266={'count':0x0,'rows':[]};var _0x2e74a7=_[_0xf47c('0x3f')](db[_0xf47c('0x40')]['rawAttributes'],function(_0x50ccfd){return{'name':_0x50ccfd[_0xf47c('0x41')],'type':_0x50ccfd[_0xf47c('0x42')][_0xf47c('0x43')]};});_0x126c74[_0xf47c('0x44')]=_[_0xf47c('0x3f')](_0x2e74a7,'name');_0x126c74[_0xf47c('0x45')]=_[_0xf47c('0x46')](_0x3760eb[_0xf47c('0x45')]);_0x126c74[_0xf47c('0x47')]=_[_0xf47c('0x48')](_0x126c74[_0xf47c('0x44')],_0x126c74['query']);_0x57d7e6[_0xf47c('0x49')]=_['intersection'](_0x126c74[_0xf47c('0x44')],qs['fields'](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x4a')]));_0x57d7e6[_0xf47c('0x49')]=_0x57d7e6['attributes']['length']?_0x57d7e6[_0xf47c('0x49')]:_0x126c74[_0xf47c('0x44')];if(!_0x3760eb[_0xf47c('0x45')][_0xf47c('0x4b')](_0xf47c('0x4c'))){_0x57d7e6[_0xf47c('0x33')]=qs[_0xf47c('0x33')](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x33')]);_0x57d7e6[_0xf47c('0x32')]=qs[_0xf47c('0x32')](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x32')]);}_0x57d7e6[_0xf47c('0x4d')]=qs[_0xf47c('0x4e')](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x4e')]);_0x57d7e6[_0xf47c('0x4f')]=qs[_0xf47c('0x47')](_[_0xf47c('0x50')](_0x3760eb[_0xf47c('0x45')],_0x126c74['filters']));if(_0x3760eb[_0xf47c('0x45')][_0xf47c('0x51')]){_0x57d7e6['where']=_[_0xf47c('0x52')](_0x57d7e6[_0xf47c('0x4f')],{'$or':_[_0xf47c('0x3f')](_0x2e74a7,function(_0xbf630){if(_0xbf630[_0xf47c('0x42')]!=='VIRTUAL'){var _0x3dc96f={};_0x3dc96f[_0xbf630[_0xf47c('0x3c')]]={'$like':'%'+_0x3760eb[_0xf47c('0x45')]['filter']+'%'};return _0x3dc96f;}})});}_0x57d7e6=_[_0xf47c('0x52')]({},_0x57d7e6,_0x3760eb['options']);var _0x14d5bd={'where':_0x57d7e6[_0xf47c('0x4f')]};return db[_0xf47c('0x40')][_0xf47c('0x31')](_0x14d5bd)['then'](function(_0x5bbd77){_0x28c266['count']=_0x5bbd77;if(_0x3760eb[_0xf47c('0x45')][_0xf47c('0x53')]){_0x57d7e6[_0xf47c('0x54')]=[{'all':!![]}];}return db[_0xf47c('0x40')][_0xf47c('0x55')](_0x57d7e6);})[_0xf47c('0x25')](function(_0x32bed9){_0x28c266[_0xf47c('0x56')]=_0x32bed9;return _0x28c266;})['then'](respondWithFilteredResult(_0x18a1b5,_0x57d7e6))[_0xf47c('0x57')](handleError(_0x18a1b5,null));};exports[_0xf47c('0x58')]=function(_0x51927e,_0x3710be){var _0x1968ec={'raw':!![],'where':{'id':_0x51927e['params']['id']}},_0x3f63cd={};_0x3f63cd[_0xf47c('0x44')]=_['keys'](db[_0xf47c('0x40')]['rawAttributes']);_0x3f63cd['query']=_[_0xf47c('0x46')](_0x51927e['query']);_0x3f63cd['filters']=_[_0xf47c('0x48')](_0x3f63cd['model'],_0x3f63cd[_0xf47c('0x45')]);_0x1968ec['attributes']=_['intersection'](_0x3f63cd[_0xf47c('0x44')],qs[_0xf47c('0x4a')](_0x51927e[_0xf47c('0x45')][_0xf47c('0x4a')]));_0x1968ec[_0xf47c('0x49')]=_0x1968ec[_0xf47c('0x49')][_0xf47c('0x59')]?_0x1968ec[_0xf47c('0x49')]:_0x3f63cd['model'];if(_0x51927e[_0xf47c('0x45')][_0xf47c('0x53')]){_0x1968ec['include']=[{'all':!![]}];}_0x1968ec=_[_0xf47c('0x52')]({},_0x1968ec,_0x51927e[_0xf47c('0x5a')]);return db[_0xf47c('0x40')]['find'](_0x1968ec)[_0xf47c('0x25')](handleEntityNotFound(_0x3710be,null))[_0xf47c('0x25')](respondWithResult(_0x3710be,null))[_0xf47c('0x57')](handleError(_0x3710be,null));};exports[_0xf47c('0x5b')]=function(_0x9975a8,_0x4051f2){return db[_0xf47c('0x40')][_0xf47c('0x5b')](_0x9975a8['body'],{})['then'](respondWithResult(_0x4051f2,0xc9))[_0xf47c('0x57')](handleError(_0x4051f2,null));};exports['update']=function(_0x353b95,_0x37df67){if(_0x353b95['body']['id']){delete _0x353b95[_0xf47c('0x5c')]['id'];}return db[_0xf47c('0x40')][_0xf47c('0x5d')]({'where':{'id':_0x353b95[_0xf47c('0x5e')]['id']}})[_0xf47c('0x25')](handleEntityNotFound(_0x37df67,null))[_0xf47c('0x25')](saveUpdates(_0x353b95[_0xf47c('0x5c')],null))[_0xf47c('0x25')](respondWithResult(_0x37df67,null))[_0xf47c('0x57')](handleError(_0x37df67,null));};exports[_0xf47c('0x3b')]=function(_0x5a4891,_0x44fbe2){return db[_0xf47c('0x40')][_0xf47c('0x5d')]({'where':{'id':_0x5a4891[_0xf47c('0x5e')]['id']}})[_0xf47c('0x25')](handleEntityNotFound(_0x44fbe2,null))[_0xf47c('0x25')](removeEntity(_0x44fbe2,null))[_0xf47c('0x57')](handleError(_0x44fbe2,null));};exports['describe']=function(_0x5ecb59,_0x54c062){return db[_0xf47c('0x40')][_0xf47c('0x5f')]()[_0xf47c('0x25')](respondWithResult(_0x54c062,null))[_0xf47c('0x57')](handleError(_0x54c062,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x492a2b,_0x2cb1e8,_0xbf45a0){var _0x2c3c3c={'channel':_0xf47c('0x60')};if(_0x492a2b[_0xf47c('0x5c')]['id']){delete _0x492a2b[_0xf47c('0x5c')]['id'];}_0x492a2b[_0xf47c('0x5c')]['read']=!![];_0x492a2b[_0xf47c('0x5c')][_0xf47c('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x492a2b[_0xf47c('0x5c')][_0xf47c('0x62')]=_0x492a2b[_0xf47c('0x5c')][_0xf47c('0x62')]||_0x492a2b[_0xf47c('0x63')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x492a2b[_0xf47c('0x5e')]['id'],'UserId':null},'include':[{'model':db[_0xf47c('0x64')],'as':_0xf47c('0x65')}]})['then'](handleEntityNotFound(_0x2cb1e8,null))[_0xf47c('0x25')](saveUpdates(_0x492a2b[_0xf47c('0x5c')],null))[_0xf47c('0x25')](function(_0xd7bc9a){if(_0xd7bc9a){_0x2c3c3c[_0xf47c('0x2c')]=_0xd7bc9a[_0xf47c('0x66')]({'plain':!![]});return db['ChatInteraction'][_0xf47c('0x5d')]({'where':{'id':_0xd7bc9a['ChatInteractionId']}});}return null;})[_0xf47c('0x25')](handleEntityNotFound(_0x2cb1e8,null))['then'](function(_0x5b827a){if(_0x5b827a){return _0x5b827a[_0xf47c('0x3a')]({'UserId':_0x492a2b['body'][_0xf47c('0x62')],'read1stAt':_[_0xf47c('0x67')](_0x5b827a[_0xf47c('0x68')])?moment()[_0xf47c('0x69')](_0xf47c('0x6a')):undefined});}return null;})['then'](function(_0x35f64d){if(_0x35f64d){_0x2c3c3c[_0xf47c('0x6b')]=_0x35f64d[_0xf47c('0x66')]({'plain':!![]});interaction_log[_0xf47c('0x26')](_0xf47c('0x6c'),_0x492a2b['user']['id'],_0x492a2b[_0xf47c('0x63')][_0xf47c('0x3c')],_0x492a2b[_0xf47c('0x63')][_0xf47c('0x6d')],_0x2c3c3c[_0xf47c('0x6b')]['id'],_0x492a2b['body']?JSON[_0xf47c('0x6e')](_0x492a2b[_0xf47c('0x5c')]):_0xf47c('0x6f'));return respondWithRpcPromise(_0xf47c('0x70'),_0xf47c('0x71'),_0x2c3c3c);}return null;})[_0xf47c('0x25')](function(_0x5d5d45){if(_0x5d5d45){if(_0x492a2b['body']['manual']){_0x2c3c3c['message']['interface']=util['format'](_0xf47c('0x72'),_0x492a2b[_0xf47c('0x63')][_0xf47c('0x3c')]);_0x2c3c3c[_0xf47c('0x2c')][_0xf47c('0x73')]=_0x2c3c3c[_0xf47c('0x73')];_0x2c3c3c[_0xf47c('0x2c')][_0xf47c('0x74')]=_0xf47c('0x75');return respondWithRpcPromise(_0xf47c('0x76'),_0xf47c('0x76'),{'event':_0xf47c('0x77'),'message':_[_0xf47c('0x52')](_0x2c3c3c[_0xf47c('0x2c')],JSON[_0xf47c('0x78')](_0x2c3c3c['interaction'][_0xf47c('0x79')]))},client9002)[_0xf47c('0x25')](function(){return _0x2c3c3c;});}return _0x2c3c3c;}return null;})[_0xf47c('0x25')](respondWithResult(_0x2cb1e8,null))[_0xf47c('0x57')](handleError(_0x2cb1e8,null));};var interaction_log=require('../../config/logger')(_0xf47c('0x7a'));exports[_0xf47c('0x38')]=function(_0x36317d,_0x3931b3,_0x1a5e51){var _0x3c2c34={'agent':{},'channel':'chat'};if(_0x36317d[_0xf47c('0x5c')]['id']){delete _0x36317d['body']['id'];}_0x36317d[_0xf47c('0x5c')][_0xf47c('0x62')]=_0x36317d[_0xf47c('0x5c')][_0xf47c('0x62')]||_0x36317d['user']['id'];_0x3c2c34[_0xf47c('0x7b')]['id']=_0x36317d[_0xf47c('0x5c')][_0xf47c('0x62')];return db['ChatMessage'][_0xf47c('0x5d')]({'where':{'id':_0x36317d[_0xf47c('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3931b3,null))[_0xf47c('0x25')](function(_0x29cef2){if(_0x29cef2){_0x3c2c34['message']=_0x29cef2[_0xf47c('0x66')]({'plain':!![]});return db[_0xf47c('0x7c')][_0xf47c('0x5d')]({'where':{'id':_0x29cef2['ChatInteractionId']}});}return null;})[_0xf47c('0x25')](handleEntityNotFound(_0x3931b3,null))[_0xf47c('0x25')](function(_0x5d7979){if(_0x5d7979){_0x3c2c34['interaction']=_0x5d7979[_0xf47c('0x66')]({'plain':!![]});interaction_log[_0xf47c('0x26')](_0xf47c('0x7d'),_0x36317d[_0xf47c('0x63')]['id'],_0x36317d[_0xf47c('0x63')][_0xf47c('0x3c')],_0x36317d[_0xf47c('0x63')][_0xf47c('0x6d')],_0x3c2c34['interaction']['id'],_0x36317d[_0xf47c('0x5c')]?JSON['stringify'](_0x36317d[_0xf47c('0x5c')]):_0xf47c('0x6f'));return respondWithRpcPromise(_0xf47c('0x7e'),'rejectMessage',_0x3c2c34);}return null;})[_0xf47c('0x25')](function(_0x2df463){if(_0x2df463){_0x2df463['message']['interface']=util['format'](_0xf47c('0x72'),_0x36317d[_0xf47c('0x63')][_0xf47c('0x3c')]);_0x2df463[_0xf47c('0x2c')][_0xf47c('0x73')]=_0x3c2c34[_0xf47c('0x73')];_0x2df463[_0xf47c('0x2c')][_0xf47c('0x74')]='reject';respondWithRpcPromise(_0xf47c('0x76'),_0xf47c('0x76'),{'event':_0xf47c('0x7f'),'message':_0x2df463['message']},client9002);return _0x3c2c34;}return null;})[_0xf47c('0x25')](respondWithResult(_0x3931b3,null))[_0xf47c('0x57')](handleError(_0x3931b3,null));}; \ No newline at end of file +var _0x0517=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','agent','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','rejectMessage','rejectmessage','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','catch','sendStatus','status','offset','set','Content-Range','apply','reject','update','then','end','stack','name','send','index','ChatMessage','fieldName','type','key','model','map','keys','query','filters','attributes','intersection','fields','length','limit','order','pick','where','VIRTUAL','filter','options','count','includeAll','findAll','rows','params','rawAttributes','merge','find','create','body','destroy','describe','chat-interactions','accept','chat','read','readAt','format','UserId','CmContact','Contact','get','ChatInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction'];(function(_0x304686,_0x3baf7c){var _0x384647=function(_0x4771b2){while(--_0x4771b2){_0x304686['push'](_0x304686['shift']());}};_0x384647(++_0x3baf7c);}(_0x0517,0x18e));var _0x7051=function(_0x3a5372,_0x4264d9){_0x3a5372=_0x3a5372-0x0;var _0x4910a5=_0x0517[_0x3a5372];return _0x4910a5;};'use strict';var pdf=require(_0x7051('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7051('0x1'));var zipdir=require(_0x7051('0x2'));var jsonpatch=require(_0x7051('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7051('0x4'));var Mustache=require('mustache');var util=require(_0x7051('0x5'));var path=require(_0x7051('0x6'));var sox=require(_0x7051('0x7'));var csv=require(_0x7051('0x8'));var ejs=require(_0x7051('0x9'));var fs=require('fs');var _=require(_0x7051('0xa'));var squel=require(_0x7051('0xb'));var crypto=require(_0x7051('0xc'));var jsforce=require(_0x7051('0xd'));var deskjs=require(_0x7051('0xe'));var toCsv=require(_0x7051('0x8'));var querystring=require(_0x7051('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7051('0x10'));var qs=require(_0x7051('0x11'));var as=require(_0x7051('0x12'));var hardwareService=require(_0x7051('0x13'));var logger=require(_0x7051('0x14'))(_0x7051('0x15'));var utils=require(_0x7051('0x16'));var config=require(_0x7051('0x17'));var db=require(_0x7051('0x18'))['db'];config['redis']=_[_0x7051('0x19')](config[_0x7051('0x1a')],{'host':_0x7051('0x1b'),'port':0x18eb});var socket=require(_0x7051('0x1c'))(new Redis(config[_0x7051('0x1a')]));require(_0x7051('0x1d'))[_0x7051('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x7051('0x1f')][_0x7051('0x20')]({'port':0x232c});var client9002=jayson[_0x7051('0x1f')]['http']({'port':0x232a});function checkPasswordPattern(_0x2522e1,_0x6580e0,_0x57851d){if(_0x57851d){var _0x29793d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29793d['test'](_0x6580e0)){return _0x2522e1;}else{throw new db[(_0x7051('0x21'))][(_0x7051('0x22'))](_0x7051('0x23'));}}else{return _0x2522e1;}}function respondWithRpcPromise(_0x33e6d6,_0x330951,_0xfb1ced,_0x6302fe){return new BPromise(function(_0x5558e3,_0x2dd932){var _0x361549=_0x6302fe||client;return _0x361549[_0x7051('0x24')](_0x33e6d6,_0xfb1ced)['then'](function(_0x2988f5){logger['info'](_0x7051('0x25'),_0x330951,_0x7051('0x26'));logger[_0x7051('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x330951,'request\x20sent',JSON['stringify'](_0x2988f5));if(_0x2988f5['error']){if(_0x2988f5[_0x7051('0x28')]['code']===0x1f4){logger[_0x7051('0x28')](_0x7051('0x25'),_0x330951,_0x2988f5[_0x7051('0x28')][_0x7051('0x29')]);return _0x2dd932(_0x2988f5[_0x7051('0x28')][_0x7051('0x29')]);}logger[_0x7051('0x28')]('ChatMessage,\x20%s,\x20%s',_0x330951,_0x2988f5[_0x7051('0x28')][_0x7051('0x29')]);return _0x5558e3(_0x2988f5[_0x7051('0x28')][_0x7051('0x29')]);}else{logger[_0x7051('0x2a')](_0x7051('0x25'),_0x330951,_0x7051('0x26'));_0x5558e3(_0x2988f5[_0x7051('0x2b')][_0x7051('0x29')]);}})[_0x7051('0x2c')](function(_0xaeb78a){logger['error'](_0x7051('0x25'),_0x330951,_0xaeb78a);_0x2dd932(_0xaeb78a);});});}function respondWithStatusCode(_0x2b8468,_0x12ad25){_0x12ad25=_0x12ad25||0xcc;return function(_0x14b1db){if(_0x14b1db){return _0x2b8468[_0x7051('0x2d')](_0x12ad25);}return _0x2b8468[_0x7051('0x2e')](_0x12ad25)['end']();};}function respondWithResult(_0x543d84,_0x3dc1c1){_0x3dc1c1=_0x3dc1c1||0xc8;return function(_0x2ff0aa){if(_0x2ff0aa){return _0x543d84[_0x7051('0x2e')](_0x3dc1c1)['json'](_0x2ff0aa);}};}function respondWithFilteredResult(_0x394f3c,_0x527432){return function(_0xee8068){if(_0xee8068){var _0x1db08f=_0xee8068['count'],_0x5ad581=_0x527432[_0x7051('0x2f')],_0x5396a6=_0x527432[_0x7051('0x2f')]+_0x527432['limit'],_0x1e52bc;if(_0x5396a6>=_0x1db08f){_0x5396a6=_0x1db08f;_0x1e52bc=0xc8;}else{_0x1e52bc=0xce;}_0x394f3c[_0x7051('0x2e')](_0x1e52bc);return _0x394f3c[_0x7051('0x30')](_0x7051('0x31'),_0x5ad581+'-'+_0x5396a6+'/'+_0x1db08f)['json'](_0xee8068);}return null;};}function patchUpdates(_0x3c90d8){return function(_0x43db68){try{jsonpatch[_0x7051('0x32')](_0x43db68,_0x3c90d8,!![]);}catch(_0x3d0050){return BPromise[_0x7051('0x33')](_0x3d0050);}return _0x43db68['save']();};}function saveUpdates(_0x420b45,_0x30ee18){return function(_0x5711ad){if(_0x5711ad){return _0x5711ad[_0x7051('0x34')](_0x420b45)[_0x7051('0x35')](function(_0x117538){return _0x117538;});}return null;};}function removeEntity(_0xa5704d,_0x32ba20){return function(_0x3df15e){if(_0x3df15e){return _0x3df15e['destroy']()[_0x7051('0x35')](function(){_0xa5704d[_0x7051('0x2e')](0xcc)[_0x7051('0x36')]();});}};}function handleEntityNotFound(_0x7c05aa,_0x216f6d){return function(_0x45a125){if(!_0x45a125){_0x7c05aa[_0x7051('0x2d')](0x194);}return _0x45a125;};}function handleError(_0x3b681a,_0x190f4c){_0x190f4c=_0x190f4c||0x1f4;return function(_0x5a4e93){logger['error'](_0x5a4e93[_0x7051('0x37')]);if(_0x5a4e93['name']){delete _0x5a4e93[_0x7051('0x38')];}_0x3b681a[_0x7051('0x2e')](_0x190f4c)[_0x7051('0x39')](_0x5a4e93);};}exports[_0x7051('0x3a')]=function(_0x473b79,_0xd93eb6){var _0x56eacc={},_0x185df1={},_0x28b92b={'count':0x0,'rows':[]};var _0x49296e=_['map'](db[_0x7051('0x3b')]['rawAttributes'],function(_0x30f5e9){return{'name':_0x30f5e9[_0x7051('0x3c')],'type':_0x30f5e9[_0x7051('0x3d')][_0x7051('0x3e')]};});_0x185df1[_0x7051('0x3f')]=_[_0x7051('0x40')](_0x49296e,_0x7051('0x38'));_0x185df1['query']=_[_0x7051('0x41')](_0x473b79[_0x7051('0x42')]);_0x185df1[_0x7051('0x43')]=_['intersection'](_0x185df1['model'],_0x185df1[_0x7051('0x42')]);_0x56eacc[_0x7051('0x44')]=_[_0x7051('0x45')](_0x185df1[_0x7051('0x3f')],qs['fields'](_0x473b79[_0x7051('0x42')][_0x7051('0x46')]));_0x56eacc[_0x7051('0x44')]=_0x56eacc[_0x7051('0x44')][_0x7051('0x47')]?_0x56eacc[_0x7051('0x44')]:_0x185df1[_0x7051('0x3f')];if(!_0x473b79['query']['hasOwnProperty']('nolimit')){_0x56eacc[_0x7051('0x48')]=qs[_0x7051('0x48')](_0x473b79[_0x7051('0x42')][_0x7051('0x48')]);_0x56eacc['offset']=qs[_0x7051('0x2f')](_0x473b79[_0x7051('0x42')][_0x7051('0x2f')]);}_0x56eacc[_0x7051('0x49')]=qs['sort'](_0x473b79[_0x7051('0x42')]['sort']);_0x56eacc['where']=qs['filters'](_[_0x7051('0x4a')](_0x473b79[_0x7051('0x42')],_0x185df1['filters']));if(_0x473b79[_0x7051('0x42')]['filter']){_0x56eacc['where']=_['merge'](_0x56eacc[_0x7051('0x4b')],{'$or':_[_0x7051('0x40')](_0x49296e,function(_0x1341e3){if(_0x1341e3[_0x7051('0x3d')]!==_0x7051('0x4c')){var _0x3a8b85={};_0x3a8b85[_0x1341e3[_0x7051('0x38')]]={'$like':'%'+_0x473b79[_0x7051('0x42')][_0x7051('0x4d')]+'%'};return _0x3a8b85;}})});}_0x56eacc=_['merge']({},_0x56eacc,_0x473b79[_0x7051('0x4e')]);var _0x57043e={'where':_0x56eacc[_0x7051('0x4b')]};return db[_0x7051('0x3b')][_0x7051('0x4f')](_0x57043e)[_0x7051('0x35')](function(_0x309d18){_0x28b92b[_0x7051('0x4f')]=_0x309d18;if(_0x473b79[_0x7051('0x42')][_0x7051('0x50')]){_0x56eacc['include']=[{'all':!![]}];}return db['ChatMessage'][_0x7051('0x51')](_0x56eacc);})[_0x7051('0x35')](function(_0x8401c2){_0x28b92b[_0x7051('0x52')]=_0x8401c2;return _0x28b92b;})['then'](respondWithFilteredResult(_0xd93eb6,_0x56eacc))[_0x7051('0x2c')](handleError(_0xd93eb6,null));};exports['show']=function(_0x308f43,_0x5d74ad){var _0x142e73={'raw':!![],'where':{'id':_0x308f43[_0x7051('0x53')]['id']}},_0x3c508a={};_0x3c508a[_0x7051('0x3f')]=_[_0x7051('0x41')](db[_0x7051('0x3b')][_0x7051('0x54')]);_0x3c508a[_0x7051('0x42')]=_[_0x7051('0x41')](_0x308f43[_0x7051('0x42')]);_0x3c508a[_0x7051('0x43')]=_['intersection'](_0x3c508a[_0x7051('0x3f')],_0x3c508a[_0x7051('0x42')]);_0x142e73[_0x7051('0x44')]=_[_0x7051('0x45')](_0x3c508a[_0x7051('0x3f')],qs['fields'](_0x308f43['query']['fields']));_0x142e73[_0x7051('0x44')]=_0x142e73[_0x7051('0x44')][_0x7051('0x47')]?_0x142e73[_0x7051('0x44')]:_0x3c508a[_0x7051('0x3f')];if(_0x308f43[_0x7051('0x42')][_0x7051('0x50')]){_0x142e73['include']=[{'all':!![]}];}_0x142e73=_[_0x7051('0x55')]({},_0x142e73,_0x308f43[_0x7051('0x4e')]);return db['ChatMessage'][_0x7051('0x56')](_0x142e73)['then'](handleEntityNotFound(_0x5d74ad,null))[_0x7051('0x35')](respondWithResult(_0x5d74ad,null))['catch'](handleError(_0x5d74ad,null));};exports[_0x7051('0x57')]=function(_0x20c826,_0x1fea37){return db[_0x7051('0x3b')][_0x7051('0x57')](_0x20c826[_0x7051('0x58')],{})['then'](respondWithResult(_0x1fea37,0xc9))[_0x7051('0x2c')](handleError(_0x1fea37,null));};exports[_0x7051('0x34')]=function(_0x2c4682,_0x323af3){if(_0x2c4682[_0x7051('0x58')]['id']){delete _0x2c4682[_0x7051('0x58')]['id'];}return db[_0x7051('0x3b')]['find']({'where':{'id':_0x2c4682[_0x7051('0x53')]['id']}})[_0x7051('0x35')](handleEntityNotFound(_0x323af3,null))[_0x7051('0x35')](saveUpdates(_0x2c4682['body'],null))['then'](respondWithResult(_0x323af3,null))[_0x7051('0x2c')](handleError(_0x323af3,null));};exports[_0x7051('0x59')]=function(_0x1ec1f7,_0xa19f7){return db[_0x7051('0x3b')][_0x7051('0x56')]({'where':{'id':_0x1ec1f7['params']['id']}})[_0x7051('0x35')](handleEntityNotFound(_0xa19f7,null))['then'](removeEntity(_0xa19f7,null))['catch'](handleError(_0xa19f7,null));};exports[_0x7051('0x5a')]=function(_0x493802,_0x36370a){return db['ChatMessage'][_0x7051('0x5a')]()[_0x7051('0x35')](respondWithResult(_0x36370a,null))[_0x7051('0x2c')](handleError(_0x36370a,null));};var interaction_log=require('../../config/logger')(_0x7051('0x5b'));exports[_0x7051('0x5c')]=function(_0x1cda36,_0x3b2831,_0x486ff3){var _0x36b75d={'channel':_0x7051('0x5d')};if(_0x1cda36[_0x7051('0x58')]['id']){delete _0x1cda36[_0x7051('0x58')]['id'];}_0x1cda36[_0x7051('0x58')][_0x7051('0x5e')]=!![];_0x1cda36[_0x7051('0x58')][_0x7051('0x5f')]=moment()[_0x7051('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x1cda36['body'][_0x7051('0x61')]=_0x1cda36[_0x7051('0x58')][_0x7051('0x61')]||_0x1cda36['user']['id'];return db[_0x7051('0x3b')][_0x7051('0x56')]({'where':{'id':_0x1cda36[_0x7051('0x53')]['id'],'UserId':null},'include':[{'model':db[_0x7051('0x62')],'as':_0x7051('0x63')}]})[_0x7051('0x35')](handleEntityNotFound(_0x3b2831,null))[_0x7051('0x35')](saveUpdates(_0x1cda36[_0x7051('0x58')],null))[_0x7051('0x35')](function(_0x3b9506){if(_0x3b9506){_0x36b75d['message']=_0x3b9506[_0x7051('0x64')]({'plain':!![]});return db[_0x7051('0x65')]['find']({'where':{'id':_0x3b9506['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3b2831,null))[_0x7051('0x35')](function(_0x3d1ebc){if(_0x3d1ebc){return _0x3d1ebc[_0x7051('0x34')]({'UserId':_0x1cda36[_0x7051('0x58')][_0x7051('0x61')],'read1stAt':_[_0x7051('0x66')](_0x3d1ebc[_0x7051('0x67')])?moment()['format'](_0x7051('0x68')):undefined});}return null;})[_0x7051('0x35')](function(_0x4fd4c2){if(_0x4fd4c2){_0x36b75d[_0x7051('0x69')]=_0x4fd4c2[_0x7051('0x64')]({'plain':!![]});interaction_log[_0x7051('0x2a')](_0x7051('0x6a'),_0x1cda36[_0x7051('0x6b')]['id'],_0x1cda36[_0x7051('0x6b')][_0x7051('0x38')],_0x1cda36['user'][_0x7051('0x6c')],_0x36b75d[_0x7051('0x69')]['id'],_0x1cda36[_0x7051('0x58')]?JSON['stringify'](_0x1cda36[_0x7051('0x58')]):'null');return respondWithRpcPromise(_0x7051('0x6d'),_0x7051('0x6e'),_0x36b75d);}return null;})[_0x7051('0x35')](function(_0x3180ca){if(_0x3180ca){if(_0x1cda36[_0x7051('0x58')][_0x7051('0x6f')]){_0x36b75d[_0x7051('0x29')][_0x7051('0x70')]=util[_0x7051('0x60')](_0x7051('0x71'),_0x1cda36[_0x7051('0x6b')][_0x7051('0x38')]);_0x36b75d[_0x7051('0x29')][_0x7051('0x72')]=_0x36b75d[_0x7051('0x72')];_0x36b75d['message'][_0x7051('0x73')]=_0x7051('0x5c');return respondWithRpcPromise(_0x7051('0x74'),'EventManager',{'event':_0x7051('0x75'),'message':_[_0x7051('0x55')](_0x36b75d[_0x7051('0x29')],JSON[_0x7051('0x76')](_0x36b75d[_0x7051('0x69')]['formData']))},client9002)['then'](function(){return _0x36b75d;});}return _0x36b75d;}return null;})[_0x7051('0x35')](respondWithResult(_0x3b2831,null))[_0x7051('0x2c')](handleError(_0x3b2831,null));};var interaction_log=require(_0x7051('0x14'))(_0x7051('0x5b'));exports[_0x7051('0x33')]=function(_0x6fd2c8,_0x97becc,_0x39d089){var _0x340d01={'agent':{},'channel':_0x7051('0x5d')};if(_0x6fd2c8['body']['id']){delete _0x6fd2c8[_0x7051('0x58')]['id'];}_0x6fd2c8[_0x7051('0x58')][_0x7051('0x61')]=_0x6fd2c8[_0x7051('0x58')][_0x7051('0x61')]||_0x6fd2c8[_0x7051('0x6b')]['id'];_0x340d01[_0x7051('0x77')]['id']=_0x6fd2c8[_0x7051('0x58')]['UserId'];return db[_0x7051('0x3b')][_0x7051('0x56')]({'where':{'id':_0x6fd2c8[_0x7051('0x53')]['id'],'UserId':null}})[_0x7051('0x35')](handleEntityNotFound(_0x97becc,null))[_0x7051('0x35')](function(_0x21e680){if(_0x21e680){_0x340d01[_0x7051('0x29')]=_0x21e680[_0x7051('0x64')]({'plain':!![]});return db[_0x7051('0x65')][_0x7051('0x56')]({'where':{'id':_0x21e680[_0x7051('0x78')]}});}return null;})['then'](handleEntityNotFound(_0x97becc,null))[_0x7051('0x35')](function(_0x53f852){if(_0x53f852){_0x340d01[_0x7051('0x69')]=_0x53f852['get']({'plain':!![]});interaction_log['info'](_0x7051('0x79'),_0x6fd2c8[_0x7051('0x6b')]['id'],_0x6fd2c8[_0x7051('0x6b')][_0x7051('0x38')],_0x6fd2c8[_0x7051('0x6b')][_0x7051('0x6c')],_0x340d01[_0x7051('0x69')]['id'],_0x6fd2c8[_0x7051('0x58')]?JSON[_0x7051('0x7a')](_0x6fd2c8[_0x7051('0x58')]):_0x7051('0x7b'));return respondWithRpcPromise('RejectMessage',_0x7051('0x7c'),_0x340d01);}return null;})[_0x7051('0x35')](function(_0x449973){if(_0x449973){_0x449973[_0x7051('0x29')][_0x7051('0x70')]=util[_0x7051('0x60')](_0x7051('0x71'),_0x6fd2c8[_0x7051('0x6b')][_0x7051('0x38')]);_0x449973['message'][_0x7051('0x72')]=_0x340d01[_0x7051('0x72')];_0x449973[_0x7051('0x29')][_0x7051('0x73')]=_0x7051('0x33');respondWithRpcPromise(_0x7051('0x74'),_0x7051('0x74'),{'event':_0x7051('0x7d'),'message':_0x449973[_0x7051('0x29')]},client9002);return _0x340d01;}return null;})[_0x7051('0x35')](respondWithResult(_0x97becc,null))[_0x7051('0x2c')](handleError(_0x97becc,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 8d3d78a..509ce89 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 _0x4d36=['../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4d36,0xd7));var _0x64d3=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0x4d36[_0x3048ea];return _0x1a13c4;};'use strict';var EventEmitter=require(_0x64d3('0x0'));var ChatMessage=require(_0x64d3('0x1'))['db'][_0x64d3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x64d3('0x3')](0x0);var events={'afterCreate':_0x64d3('0x4'),'afterUpdate':'update','afterDestroy':_0x64d3('0x5')};function emitEvent(_0x13eeec){return function(_0xfcb50,_0x1d9267,_0x5d16f8){ChatMessageEvents['emit'](_0x13eeec+':'+_0xfcb50['id'],_0xfcb50);ChatMessageEvents[_0x64d3('0x6')](_0x13eeec,_0xfcb50);_0x5d16f8(null);};}for(var e in events){if(events[_0x64d3('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x64d3('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0xd62d=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xd62d,0x6a));var _0xdd62=function(_0x5397f4,_0x181608){_0x5397f4=_0x5397f4-0x0;var _0x2e7e8b=_0xd62d[_0x5397f4];return _0x2e7e8b;};'use strict';var EventEmitter=require(_0xdd62('0x0'));var ChatMessage=require(_0xdd62('0x1'))['db'][_0xdd62('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xdd62('0x3')](0x0);var events={'afterCreate':_0xdd62('0x4'),'afterUpdate':_0xdd62('0x5'),'afterDestroy':_0xdd62('0x6')};function emitEvent(_0xb7874b){return function(_0x4a5638,_0x2352f3,_0x19a9ac){ChatMessageEvents['emit'](_0xb7874b+':'+_0x4a5638['id'],_0x4a5638);ChatMessageEvents[_0xdd62('0x7')](_0xb7874b,_0x4a5638);_0x19a9ac(null);};}for(var e in events){if(events[_0xdd62('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 5b7b0fc..edcfd3d 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 _0x3c07=['FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x3c07,0xa1));var _0x73c0=function(_0x251597,_0x3ffa57){_0x251597=_0x251597-0x0;var _0x4c8d25=_0x3c07[_0x251597];return _0x4c8d25;};'use strict';var _=require(_0x73c0('0x0'));var util=require(_0x73c0('0x1'));var logger=require(_0x73c0('0x2'))(_0x73c0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x73c0('0x4'));var fs=require('fs');var path=require(_0x73c0('0x5'));var rimraf=require(_0x73c0('0x6'));var config=require(_0x73c0('0x7'));var attributes=require(_0x73c0('0x8'));module[_0x73c0('0x9')]=function(_0x49f6f4,_0xa0073){return _0x49f6f4['define'](_0x73c0('0xa'),attributes,{'tableName':_0x73c0('0xb'),'paranoid':![],'indexes':[{'name':_0x73c0('0xc'),'fields':['body'],'type':_0x73c0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5581a9,_0x3c5376,_0x92e2aa){var _0x142be2=_0x49f6f4['models'];var _0x56ff95=_0x5581a9[_0x73c0('0xe')]({'plain':!![]});if(_0x56ff95[_0x73c0('0xf')][_0x73c0('0x10')]()==='in'||_0x56ff95[_0x73c0('0xf')]['toLowerCase']()==='out'&&!_0x56ff95[_0x73c0('0x11')]&&!_[_0x73c0('0x12')](_0x56ff95[_0x73c0('0x13')])){_0x142be2[_0x73c0('0x14')][_0x73c0('0x15')]({'where':{'id':_0x56ff95[_0x73c0('0x16')]}})[_0x73c0('0x17')](function(_0x83d8ec){if(_0x83d8ec){_0x83d8ec['update']({'lastMsgAt':_0x56ff95[_0x73c0('0x18')],'lastMsgDirection':_0x56ff95[_0x73c0('0xf')]['toLowerCase']()});}})[_0x73c0('0x19')](function(_0x29172e){console[_0x73c0('0x1a')](_0x29172e);});}_0x92e2aa();}},'charset':_0x73c0('0x1b'),'collate':_0x73c0('0x1c')});}; \ No newline at end of file +var _0xd0a9=['UserId','ChatInteractionId','update','createdAt','catch','error','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','chat_messages','body','models','toLowerCase','direction','secret'];(function(_0x429d9f,_0x259577){var _0x4b542a=function(_0x3fbc2a){while(--_0x3fbc2a){_0x429d9f['push'](_0x429d9f['shift']());}};_0x4b542a(++_0x259577);}(_0xd0a9,0x18d));var _0x9d0a=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xd0a9[_0x20589d];return _0x422de9;};'use strict';var _=require(_0x9d0a('0x0'));var util=require(_0x9d0a('0x1'));var logger=require(_0x9d0a('0x2'))(_0x9d0a('0x3'));var moment=require('moment');var BPromise=require(_0x9d0a('0x4'));var rp=require(_0x9d0a('0x5'));var fs=require('fs');var path=require(_0x9d0a('0x6'));var rimraf=require(_0x9d0a('0x7'));var config=require(_0x9d0a('0x8'));var attributes=require(_0x9d0a('0x9'));module[_0x9d0a('0xa')]=function(_0x1e489f,_0xa37e36){return _0x1e489f['define']('ChatMessage',attributes,{'tableName':_0x9d0a('0xb'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x9d0a('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0xf5bbd8,_0x3dc17a,_0x54a003){var _0x225455=_0x1e489f[_0x9d0a('0xd')];var _0xf6819a=_0xf5bbd8['get']({'plain':!![]});if(_0xf6819a['direction'][_0x9d0a('0xe')]()==='in'||_0xf6819a[_0x9d0a('0xf')][_0x9d0a('0xe')]()==='out'&&!_0xf6819a[_0x9d0a('0x10')]&&!_['isNil'](_0xf6819a[_0x9d0a('0x11')])){_0x225455['ChatInteraction']['findOne']({'where':{'id':_0xf6819a[_0x9d0a('0x12')]}})['then'](function(_0x2dc04d){if(_0x2dc04d){_0x2dc04d[_0x9d0a('0x13')]({'lastMsgAt':_0xf6819a[_0x9d0a('0x14')],'lastMsgDirection':_0xf6819a[_0x9d0a('0xf')][_0x9d0a('0xe')]()});}})[_0x9d0a('0x15')](function(_0x1f85f5){console[_0x9d0a('0x16')](_0x1f85f5);});}_0x54a003();}},'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 8aac0bb..5e2c322 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 _0x1ad4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateChatMessage','ChatMessage','body','options','raw','catch','lodash'];(function(_0x485bbb,_0x4eb1ad){var _0x1d1eb0=function(_0x5e45a9){while(--_0x5e45a9){_0x485bbb['push'](_0x485bbb['shift']());}};_0x1d1eb0(++_0x4eb1ad);}(_0x1ad4,0x13f));var _0x41ad=function(_0x20f9bc,_0x1057f0){_0x20f9bc=_0x20f9bc-0x0;var _0x2060a4=_0x1ad4[_0x20f9bc];return _0x2060a4;};'use strict';var _=require(_0x41ad('0x0'));var util=require('util');var moment=require(_0x41ad('0x1'));var BPromise=require(_0x41ad('0x2'));var rs=require(_0x41ad('0x3'));var fs=require('fs');var Redis=require(_0x41ad('0x4'));var db=require(_0x41ad('0x5'))['db'];var utils=require(_0x41ad('0x6'));var logger=require(_0x41ad('0x7'))(_0x41ad('0x8'));var config=require(_0x41ad('0x9'));var jayson=require(_0x41ad('0xa'));var client=jayson[_0x41ad('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x41ad('0xc')],{'host':_0x41ad('0xd'),'port':0x18eb});var socket=require(_0x41ad('0xe'))(new Redis(config[_0x41ad('0xc')]));require('./chatMessage.socket')[_0x41ad('0xf')](socket);function respondWithRpcPromise(_0x2b2402,_0x5d6893,_0x16e703){return new BPromise(function(_0x58fbc0,_0xb004ef){return client[_0x41ad('0x10')](_0x2b2402,_0x16e703)[_0x41ad('0x11')](function(_0x4dd7f8){logger[_0x41ad('0x12')](_0x41ad('0x13'),_0x5d6893,_0x41ad('0x14'));logger[_0x41ad('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5d6893,'request\x20sent',JSON[_0x41ad('0x16')](_0x4dd7f8));if(_0x4dd7f8['error']){if(_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x18')]===0x1f4){logger['error'](_0x41ad('0x13'),_0x5d6893,_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x19')]);return _0xb004ef(_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x19')]);}logger[_0x41ad('0x17')](_0x41ad('0x13'),_0x5d6893,_0x4dd7f8['error'][_0x41ad('0x19')]);return _0x58fbc0(_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x19')]);}else{logger['info'](_0x41ad('0x13'),_0x5d6893,'request\x20sent');_0x58fbc0(_0x4dd7f8['result'][_0x41ad('0x19')]);}})['catch'](function(_0x1266cb){logger[_0x41ad('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5d6893,_0x1266cb);_0xb004ef(_0x1266cb);});});}exports[_0x41ad('0x1a')]=function(_0xd8df8e){var _0x1711b5=this;return new Promise(function(_0x12f2bb,_0x235c4b){return db[_0x41ad('0x1b')]['create'](_0xd8df8e[_0x41ad('0x1c')],{'raw':_0xd8df8e['options']?_0xd8df8e[_0x41ad('0x1d')][_0x41ad('0x1e')]===undefined?!![]:![]:!![]})[_0x41ad('0x11')](function(_0x124b30){logger[_0x41ad('0x12')]('CreateChatMessage',_0xd8df8e);logger['debug'](_0x41ad('0x1a'),_0xd8df8e,JSON[_0x41ad('0x16')](_0x124b30));_0x12f2bb(_0x124b30);})[_0x41ad('0x1f')](function(_0x5bed01){logger['error'](_0x41ad('0x1a'),_0x5bed01['message'],_0xd8df8e);_0x235c4b(_0x1711b5[_0x41ad('0x17')](0x1f4,_0x5bed01[_0x41ad('0x19')]));});});}; \ No newline at end of file +var _0x09f0=['localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateChatMessage','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults'];(function(_0xd89e41,_0x516cac){var _0x5651cf=function(_0x41a83f){while(--_0x41a83f){_0xd89e41['push'](_0xd89e41['shift']());}};_0x5651cf(++_0x516cac);}(_0x09f0,0x174));var _0x009f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x09f0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x009f('0x0'));var moment=require('moment');var BPromise=require(_0x009f('0x1'));var rs=require(_0x009f('0x2'));var fs=require('fs');var Redis=require(_0x009f('0x3'));var db=require(_0x009f('0x4'))['db'];var utils=require(_0x009f('0x5'));var logger=require('../../config/logger')(_0x009f('0x6'));var config=require('../../config/environment');var jayson=require(_0x009f('0x7'));var client=jayson[_0x009f('0x8')][_0x009f('0x9')]({'port':0x232a});config[_0x009f('0xa')]=_[_0x009f('0xb')](config[_0x009f('0xa')],{'host':_0x009f('0xc'),'port':0x18eb});var socket=require(_0x009f('0xd'))(new Redis(config['redis']));require(_0x009f('0xe'))['register'](socket);function respondWithRpcPromise(_0x2c23cc,_0x3a992f,_0xc15b3e){return new BPromise(function(_0x34e2e4,_0x4be132){return client[_0x009f('0xf')](_0x2c23cc,_0xc15b3e)[_0x009f('0x10')](function(_0xaf6e7d){logger[_0x009f('0x11')](_0x009f('0x12'),_0x3a992f,_0x009f('0x13'));logger[_0x009f('0x14')](_0x009f('0x15'),_0x3a992f,_0x009f('0x13'),JSON[_0x009f('0x16')](_0xaf6e7d));if(_0xaf6e7d[_0x009f('0x17')]){if(_0xaf6e7d[_0x009f('0x17')][_0x009f('0x18')]===0x1f4){logger[_0x009f('0x17')]('ChatMessage,\x20%s,\x20%s',_0x3a992f,_0xaf6e7d[_0x009f('0x17')][_0x009f('0x19')]);return _0x4be132(_0xaf6e7d['error'][_0x009f('0x19')]);}logger['error'](_0x009f('0x12'),_0x3a992f,_0xaf6e7d[_0x009f('0x17')][_0x009f('0x19')]);return _0x34e2e4(_0xaf6e7d['error'][_0x009f('0x19')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x3a992f,_0x009f('0x13'));_0x34e2e4(_0xaf6e7d[_0x009f('0x1a')]['message']);}})[_0x009f('0x1b')](function(_0x434ea6){logger[_0x009f('0x17')](_0x009f('0x12'),_0x3a992f,_0x434ea6);_0x4be132(_0x434ea6);});});}exports['CreateChatMessage']=function(_0x59a231){var _0x332da6=this;return new Promise(function(_0x1151fd,_0x21ad89){return db['ChatMessage'][_0x009f('0x1c')](_0x59a231[_0x009f('0x1d')],{'raw':_0x59a231['options']?_0x59a231[_0x009f('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x009f('0x10')](function(_0x247b14){logger[_0x009f('0x11')](_0x009f('0x1f'),_0x59a231);logger[_0x009f('0x14')]('CreateChatMessage',_0x59a231,JSON[_0x009f('0x16')](_0x247b14));_0x1151fd(_0x247b14);})['catch'](function(_0x1a5844){logger[_0x009f('0x17')](_0x009f('0x1f'),_0x1a5844[_0x009f('0x19')],_0x59a231);_0x21ad89(_0x332da6[_0x009f('0x17')](0x1f4,_0x1a5844[_0x009f('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index ddec058..1da1b8f 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 _0x187d=['./chatMessage.events','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x2c6ae1,_0x317c68){var _0x1cafbf=function(_0xf51602){while(--_0xf51602){_0x2c6ae1['push'](_0x2c6ae1['shift']());}};_0x1cafbf(++_0x317c68);}(_0x187d,0x93));var _0xd187=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x187d[_0x40ac5e];return _0x2839d6;};'use strict';var ChatMessageEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){ChatMessageEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);ChatMessageEvents['on'](_0x28ce2f,_0x2d6992);}}; \ No newline at end of file +var _0x4991=['length','chatMessage:','./chatMessage.events','remove','emit','removeListener','register'];(function(_0x2f6e47,_0x40ba6b){var _0x29c331=function(_0x18d873){while(--_0x18d873){_0x2f6e47['push'](_0x2f6e47['shift']());}};_0x29c331(++_0x40ba6b);}(_0x4991,0xf7));var _0x1499=function(_0x27c217,_0x344246){_0x27c217=_0x27c217-0x0;var _0x2361d5=_0x4991[_0x27c217];return _0x2361d5;};'use strict';var ChatMessageEvents=require(_0x1499('0x0'));var events=['save',_0x1499('0x1'),'update'];function createListener(_0x30d640,_0x256e41){return function(_0x16ac22){_0x256e41[_0x1499('0x2')](_0x30d640,_0x16ac22);};}function removeListener(_0x1b291f,_0x158134){return function(){ChatMessageEvents[_0x1499('0x3')](_0x1b291f,_0x158134);};}exports[_0x1499('0x4')]=function(_0x4b6154){for(var _0x2a8e96=0x0,_0x1c3bd7=events[_0x1499('0x5')];_0x2a8e96<_0x1c3bd7;_0x2a8e96++){var _0x33b261=events[_0x2a8e96];var _0x133bae=createListener(_0x1499('0x6')+_0x33b261,_0x4b6154);ChatMessageEvents['on'](_0x33b261,_0x133bae);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 6f6d1ee..0b85423 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 _0xc1fc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','util','path','express'];(function(_0x569c23,_0x2f541c){var _0x746cd7=function(_0x51e7dd){while(--_0x51e7dd){_0x569c23['push'](_0x569c23['shift']());}};_0x746cd7(++_0x2f541c);}(_0xc1fc,0x93));var _0xcc1f=function(_0xb513a1,_0x247ddd){_0xb513a1=_0xb513a1-0x0;var _0x5e9fbf=_0xc1fc[_0xb513a1];return _0x5e9fbf;};'use strict';var multer=require('multer');var util=require(_0xcc1f('0x0'));var path=require(_0xcc1f('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc1f('0x2'));var router=express[_0xcc1f('0x3')]();var auth=require(_0xcc1f('0x4'));var interaction=require(_0xcc1f('0x5'));var config=require(_0xcc1f('0x6'));var controller=require(_0xcc1f('0x7'));router[_0xcc1f('0x8')]('/',auth[_0xcc1f('0x9')](),controller['index']);router['get'](_0xcc1f('0xa'),auth[_0xcc1f('0x9')](),controller[_0xcc1f('0xb')]);router[_0xcc1f('0x8')](_0xcc1f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcc1f('0x9')](),interaction[_0xcc1f('0xd')](_0xcc1f('0xe'),_0xcc1f('0xf')),controller[_0xcc1f('0x10')]);router[_0xcc1f('0x11')](_0xcc1f('0xc'),controller[_0xcc1f('0x12')]);router[_0xcc1f('0x11')]('/:id/accept',auth[_0xcc1f('0x9')](),controller[_0xcc1f('0x13')]);router[_0xcc1f('0x11')](_0xcc1f('0x14'),auth[_0xcc1f('0x9')](),controller[_0xcc1f('0x15')]);router[_0xcc1f('0x16')]('/:id',auth[_0xcc1f('0x9')](),controller[_0xcc1f('0x17')]);module[_0xcc1f('0x18')]=router; \ No newline at end of file +var _0xbdc8=['./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x283cf6,_0x14e096){var _0x4b40e5=function(_0xd340e5){while(--_0xd340e5){_0x283cf6['push'](_0x283cf6['shift']());}};_0x4b40e5(++_0x14e096);}(_0xbdc8,0x80));var _0x8bdc=function(_0x2ccd3b,_0x27a9a9){_0x2ccd3b=_0x2ccd3b-0x0;var _0x3f58ca=_0xbdc8[_0x2ccd3b];return _0x3f58ca;};'use strict';var multer=require(_0x8bdc('0x0'));var util=require(_0x8bdc('0x1'));var path=require(_0x8bdc('0x2'));var timeout=require(_0x8bdc('0x3'));var express=require(_0x8bdc('0x4'));var router=express['Router']();var auth=require(_0x8bdc('0x5'));var interaction=require(_0x8bdc('0x6'));var config=require('../../config/environment');var controller=require(_0x8bdc('0x7'));router[_0x8bdc('0x8')]('/',auth[_0x8bdc('0x9')](),controller['index']);router[_0x8bdc('0x8')](_0x8bdc('0xa'),auth[_0x8bdc('0x9')](),controller[_0x8bdc('0xb')]);router[_0x8bdc('0x8')](_0x8bdc('0xc'),auth[_0x8bdc('0x9')](),controller[_0x8bdc('0xd')]);router[_0x8bdc('0xe')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x8bdc('0xf'),_0x8bdc('0x10')),controller[_0x8bdc('0x11')]);router[_0x8bdc('0x12')](_0x8bdc('0xc'),controller[_0x8bdc('0x13')]);router['put'](_0x8bdc('0x14'),auth['isAuthenticated'](),controller[_0x8bdc('0x15')]);router[_0x8bdc('0x12')](_0x8bdc('0x16'),auth[_0x8bdc('0x9')](),controller[_0x8bdc('0x17')]);router[_0x8bdc('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x8bdc('0x19')]);module[_0x8bdc('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 0c6b8be..21a0431 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 _0x938f=['TEXT','sequelize','exports'];(function(_0x5d82d9,_0x3d7694){var _0x3dfd86=function(_0x53735e){while(--_0x53735e){_0x5d82d9['push'](_0x5d82d9['shift']());}};_0x3dfd86(++_0x3d7694);}(_0x938f,0x13c));var _0xf938=function(_0x34d6bd,_0x55b744){_0x34d6bd=_0x34d6bd-0x0;var _0x248396=_0x938f[_0x34d6bd];return _0x248396;};'use strict';var Sequelize=require(_0xf938('0x0'));module[_0xf938('0x1')]={'body':{'type':Sequelize[_0xf938('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x9450=['exports','medium','sequelize'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x9450,0x15b));var _0x0945=function(_0x45483d,_0x4742c7){_0x45483d=_0x45483d-0x0;var _0x5148b1=_0x9450[_0x45483d];return _0x5148b1;};'use strict';var Sequelize=require(_0x0945('0x0'));module[_0x0945('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0945('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index b904549..33b5406 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 _0xa794=['find','body','destroy','catch','describe','html-pdf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','count','includeAll','include','rows','show','params'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0xa794,0x168));var _0x4a79=function(_0x413d87,_0x1224cf){_0x413d87=_0x413d87-0x0;var _0x54f2d6=_0xa794[_0x413d87];return _0x54f2d6;};'use strict';var pdf=require(_0x4a79('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4a79('0x1'));var rp=require(_0x4a79('0x2'));var moment=require(_0x4a79('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a79('0x4'));var util=require(_0x4a79('0x5'));var path=require(_0x4a79('0x6'));var sox=require(_0x4a79('0x7'));var csv=require(_0x4a79('0x8'));var ejs=require(_0x4a79('0x9'));var fs=require('fs');var _=require(_0x4a79('0xa'));var squel=require(_0x4a79('0xb'));var crypto=require('crypto');var jsforce=require(_0x4a79('0xc'));var deskjs=require(_0x4a79('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a79('0xe'));var Redis=require('ioredis');var authService=require(_0x4a79('0xf'));var qs=require(_0x4a79('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a79('0x11'));var logger=require('../../config/logger')(_0x4a79('0x12'));var utils=require(_0x4a79('0x13'));var config=require(_0x4a79('0x14'));var db=require(_0x4a79('0x15'))['db'];function respondWithStatusCode(_0x30f56b,_0x2d08ce){_0x2d08ce=_0x2d08ce||0xcc;return function(_0xc5096b){if(_0xc5096b){return _0x30f56b[_0x4a79('0x16')](_0x2d08ce);}return _0x30f56b['status'](_0x2d08ce)['end']();};}function respondWithResult(_0x193d94,_0x4666d7){_0x4666d7=_0x4666d7||0xc8;return function(_0x310d4c){if(_0x310d4c){return _0x193d94[_0x4a79('0x17')](_0x4666d7)[_0x4a79('0x18')](_0x310d4c);}};}function respondWithFilteredResult(_0x152804,_0x588d37){return function(_0x325068){if(_0x325068){var _0x3e453e=_0x325068['count'],_0x48abc5=_0x588d37[_0x4a79('0x19')],_0x5bf0ba=_0x588d37[_0x4a79('0x19')]+_0x588d37[_0x4a79('0x1a')],_0x27e98a;if(_0x5bf0ba>=_0x3e453e){_0x5bf0ba=_0x3e453e;_0x27e98a=0xc8;}else{_0x27e98a=0xce;}_0x152804[_0x4a79('0x17')](_0x27e98a);return _0x152804[_0x4a79('0x1b')](_0x4a79('0x1c'),_0x48abc5+'-'+_0x5bf0ba+'/'+_0x3e453e)[_0x4a79('0x18')](_0x325068);}return null;};}function patchUpdates(_0x55cc21){return function(_0x24faab){try{jsonpatch[_0x4a79('0x1d')](_0x24faab,_0x55cc21,!![]);}catch(_0x444274){return BPromise[_0x4a79('0x1e')](_0x444274);}return _0x24faab['save']();};}function saveUpdates(_0x2aa20b,_0x56dc29){return function(_0xdc59dc){if(_0xdc59dc){return _0xdc59dc[_0x4a79('0x1f')](_0x2aa20b)[_0x4a79('0x20')](function(_0x1f1f5d){return _0x1f1f5d;});}return null;};}function removeEntity(_0x11467b,_0x2ea1a2){return function(_0x51f9d7){if(_0x51f9d7){return _0x51f9d7['destroy']()[_0x4a79('0x20')](function(){_0x11467b[_0x4a79('0x17')](0xcc)[_0x4a79('0x21')]();});}};}function handleEntityNotFound(_0xbb8d25,_0x1eaf4e){return function(_0x3fe20f){if(!_0x3fe20f){_0xbb8d25['sendStatus'](0x194);}return _0x3fe20f;};}function handleError(_0x4d8e17,_0x3cfa1f){_0x3cfa1f=_0x3cfa1f||0x1f4;return function(_0x247c4e){logger[_0x4a79('0x22')](_0x247c4e[_0x4a79('0x23')]);if(_0x247c4e[_0x4a79('0x24')]){delete _0x247c4e[_0x4a79('0x24')];}_0x4d8e17[_0x4a79('0x17')](_0x3cfa1f)[_0x4a79('0x25')](_0x247c4e);};}exports[_0x4a79('0x26')]=function(_0x2822f8,_0xdfd0c8){var _0x5dfb9e={},_0x33cfd2={},_0x5c3c88={'count':0x0,'rows':[]};var _0x2698a6=_[_0x4a79('0x27')](db[_0x4a79('0x28')][_0x4a79('0x29')],function(_0x235f93){return{'name':_0x235f93['fieldName'],'type':_0x235f93[_0x4a79('0x2a')][_0x4a79('0x2b')]};});_0x33cfd2[_0x4a79('0x2c')]=_['map'](_0x2698a6,_0x4a79('0x24'));_0x33cfd2[_0x4a79('0x2d')]=_[_0x4a79('0x2e')](_0x2822f8[_0x4a79('0x2d')]);_0x33cfd2[_0x4a79('0x2f')]=_[_0x4a79('0x30')](_0x33cfd2[_0x4a79('0x2c')],_0x33cfd2[_0x4a79('0x2d')]);_0x5dfb9e[_0x4a79('0x31')]=_['intersection'](_0x33cfd2['model'],qs[_0x4a79('0x32')](_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x32')]));_0x5dfb9e['attributes']=_0x5dfb9e[_0x4a79('0x31')][_0x4a79('0x33')]?_0x5dfb9e['attributes']:_0x33cfd2[_0x4a79('0x2c')];if(!_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x34')]('nolimit')){_0x5dfb9e[_0x4a79('0x1a')]=qs[_0x4a79('0x1a')](_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x1a')]);_0x5dfb9e['offset']=qs[_0x4a79('0x19')](_0x2822f8['query'][_0x4a79('0x19')]);}_0x5dfb9e[_0x4a79('0x35')]=qs[_0x4a79('0x36')](_0x2822f8['query'][_0x4a79('0x36')]);_0x5dfb9e['where']=qs['filters'](_[_0x4a79('0x37')](_0x2822f8[_0x4a79('0x2d')],_0x33cfd2[_0x4a79('0x2f')]));if(_0x2822f8['query'][_0x4a79('0x38')]){_0x5dfb9e['where']=_[_0x4a79('0x39')](_0x5dfb9e[_0x4a79('0x3a')],{'$or':_[_0x4a79('0x27')](_0x2698a6,function(_0x3c37af){if(_0x3c37af[_0x4a79('0x2a')]!==_0x4a79('0x3b')){var _0x4d0b0a={};_0x4d0b0a[_0x3c37af['name']]={'$like':'%'+_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x38')]+'%'};return _0x4d0b0a;}})});}_0x5dfb9e=_[_0x4a79('0x39')]({},_0x5dfb9e,_0x2822f8['options']);var _0x963fcf={'where':_0x5dfb9e[_0x4a79('0x3a')]};return db['ChatOfflineMessage'][_0x4a79('0x3c')](_0x963fcf)[_0x4a79('0x20')](function(_0x104b04){_0x5c3c88['count']=_0x104b04;if(_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x3d')]){_0x5dfb9e[_0x4a79('0x3e')]=[{'all':!![]}];}return db[_0x4a79('0x28')]['findAll'](_0x5dfb9e);})[_0x4a79('0x20')](function(_0x29777a){_0x5c3c88[_0x4a79('0x3f')]=_0x29777a;return _0x5c3c88;})[_0x4a79('0x20')](respondWithFilteredResult(_0xdfd0c8,_0x5dfb9e))['catch'](handleError(_0xdfd0c8,null));};exports[_0x4a79('0x40')]=function(_0x4bd51e,_0x509648){var _0x1d10a1={'raw':!![],'where':{'id':_0x4bd51e[_0x4a79('0x41')]['id']}},_0xbf97f9={};_0xbf97f9[_0x4a79('0x2c')]=_[_0x4a79('0x2e')](db[_0x4a79('0x28')][_0x4a79('0x29')]);_0xbf97f9[_0x4a79('0x2d')]=_['keys'](_0x4bd51e[_0x4a79('0x2d')]);_0xbf97f9[_0x4a79('0x2f')]=_['intersection'](_0xbf97f9['model'],_0xbf97f9['query']);_0x1d10a1['attributes']=_['intersection'](_0xbf97f9[_0x4a79('0x2c')],qs[_0x4a79('0x32')](_0x4bd51e['query'][_0x4a79('0x32')]));_0x1d10a1['attributes']=_0x1d10a1[_0x4a79('0x31')][_0x4a79('0x33')]?_0x1d10a1[_0x4a79('0x31')]:_0xbf97f9[_0x4a79('0x2c')];if(_0x4bd51e['query']['includeAll']){_0x1d10a1[_0x4a79('0x3e')]=[{'all':!![]}];}_0x1d10a1=_[_0x4a79('0x39')]({},_0x1d10a1,_0x4bd51e['options']);return db['ChatOfflineMessage'][_0x4a79('0x42')](_0x1d10a1)[_0x4a79('0x20')](handleEntityNotFound(_0x509648,null))[_0x4a79('0x20')](respondWithResult(_0x509648,null))['catch'](handleError(_0x509648,null));};exports['create']=function(_0x23163a,_0xe81b74){return db[_0x4a79('0x28')]['create'](_0x23163a['body'],{})[_0x4a79('0x20')](respondWithResult(_0xe81b74,0xc9))['catch'](handleError(_0xe81b74,null));};exports[_0x4a79('0x1f')]=function(_0x40415c,_0x5741da){if(_0x40415c[_0x4a79('0x43')]['id']){delete _0x40415c[_0x4a79('0x43')]['id'];}return db[_0x4a79('0x28')][_0x4a79('0x42')]({'where':{'id':_0x40415c[_0x4a79('0x41')]['id']}})[_0x4a79('0x20')](handleEntityNotFound(_0x5741da,null))[_0x4a79('0x20')](saveUpdates(_0x40415c[_0x4a79('0x43')],null))[_0x4a79('0x20')](respondWithResult(_0x5741da,null))['catch'](handleError(_0x5741da,null));};exports[_0x4a79('0x44')]=function(_0x1babe1,_0x292bd5){return db['ChatOfflineMessage'][_0x4a79('0x42')]({'where':{'id':_0x1babe1[_0x4a79('0x41')]['id']}})['then'](handleEntityNotFound(_0x292bd5,null))['then'](removeEntity(_0x292bd5,null))[_0x4a79('0x45')](handleError(_0x292bd5,null));};exports[_0x4a79('0x46')]=function(_0xd609f9,_0x1794d0){return db[_0x4a79('0x28')][_0x4a79('0x46')]()[_0x4a79('0x20')](respondWithResult(_0x1794d0,null))[_0x4a79('0x45')](handleError(_0x1794d0,null));}; \ No newline at end of file +var _0x31ea=['find','create','body','catch','describe','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','map','VIRTUAL','filter','count','then','includeAll','include','findAll','rows','params','intersection','options'];(function(_0x385cac,_0x196617){var _0xc0e067=function(_0x1bd36f){while(--_0x1bd36f){_0x385cac['push'](_0x385cac['shift']());}};_0xc0e067(++_0x196617);}(_0x31ea,0x17c));var _0xa31e=function(_0x511979,_0x3c8984){_0x511979=_0x511979-0x0;var _0x312853=_0x31ea[_0x511979];return _0x312853;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xa31e('0x0'));var zipdir=require(_0xa31e('0x1'));var jsonpatch=require(_0xa31e('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa31e('0x3'));var Mustache=require(_0xa31e('0x4'));var util=require(_0xa31e('0x5'));var path=require(_0xa31e('0x6'));var sox=require(_0xa31e('0x7'));var csv=require(_0xa31e('0x8'));var ejs=require(_0xa31e('0x9'));var fs=require('fs');var _=require(_0xa31e('0xa'));var squel=require(_0xa31e('0xb'));var crypto=require(_0xa31e('0xc'));var jsforce=require(_0xa31e('0xd'));var deskjs=require(_0xa31e('0xe'));var toCsv=require(_0xa31e('0x8'));var querystring=require(_0xa31e('0xf'));var Papa=require('papaparse');var Redis=require(_0xa31e('0x10'));var authService=require(_0xa31e('0x11'));var qs=require(_0xa31e('0x12'));var as=require(_0xa31e('0x13'));var hardwareService=require(_0xa31e('0x14'));var logger=require('../../config/logger')(_0xa31e('0x15'));var utils=require(_0xa31e('0x16'));var config=require(_0xa31e('0x17'));var db=require(_0xa31e('0x18'))['db'];function respondWithStatusCode(_0x10b9de,_0x1ea971){_0x1ea971=_0x1ea971||0xcc;return function(_0x1131cf){if(_0x1131cf){return _0x10b9de[_0xa31e('0x19')](_0x1ea971);}return _0x10b9de['status'](_0x1ea971)[_0xa31e('0x1a')]();};}function respondWithResult(_0x4e1689,_0x5ae539){_0x5ae539=_0x5ae539||0xc8;return function(_0x2c5230){if(_0x2c5230){return _0x4e1689[_0xa31e('0x1b')](_0x5ae539)[_0xa31e('0x1c')](_0x2c5230);}};}function respondWithFilteredResult(_0x5d4a99,_0x5db2a6){return function(_0x4b5294){if(_0x4b5294){var _0x546313=_0x4b5294['count'],_0x61d1fb=_0x5db2a6[_0xa31e('0x1d')],_0x170aaa=_0x5db2a6['offset']+_0x5db2a6[_0xa31e('0x1e')],_0x3cb8f0;if(_0x170aaa>=_0x546313){_0x170aaa=_0x546313;_0x3cb8f0=0xc8;}else{_0x3cb8f0=0xce;}_0x5d4a99[_0xa31e('0x1b')](_0x3cb8f0);return _0x5d4a99[_0xa31e('0x1f')](_0xa31e('0x20'),_0x61d1fb+'-'+_0x170aaa+'/'+_0x546313)['json'](_0x4b5294);}return null;};}function patchUpdates(_0x3b6a81){return function(_0x4421d){try{jsonpatch['apply'](_0x4421d,_0x3b6a81,!![]);}catch(_0x4c72ab){return BPromise[_0xa31e('0x21')](_0x4c72ab);}return _0x4421d[_0xa31e('0x22')]();};}function saveUpdates(_0x504b59,_0x33b216){return function(_0x49266c){if(_0x49266c){return _0x49266c[_0xa31e('0x23')](_0x504b59)['then'](function(_0x1f9e38){return _0x1f9e38;});}return null;};}function removeEntity(_0x446e40,_0x5beb4f){return function(_0x5a6bfc){if(_0x5a6bfc){return _0x5a6bfc[_0xa31e('0x24')]()['then'](function(){_0x446e40[_0xa31e('0x1b')](0xcc)[_0xa31e('0x1a')]();});}};}function handleEntityNotFound(_0xe89ee,_0x24456f){return function(_0x462aff){if(!_0x462aff){_0xe89ee[_0xa31e('0x19')](0x194);}return _0x462aff;};}function handleError(_0xb9dc99,_0x3f0d9c){_0x3f0d9c=_0x3f0d9c||0x1f4;return function(_0xcb4fbf){logger['error'](_0xcb4fbf[_0xa31e('0x25')]);if(_0xcb4fbf[_0xa31e('0x26')]){delete _0xcb4fbf['name'];}_0xb9dc99[_0xa31e('0x1b')](_0x3f0d9c)[_0xa31e('0x27')](_0xcb4fbf);};}exports[_0xa31e('0x28')]=function(_0x4cf18c,_0x2c1d18){var _0x3274b8={},_0x4998a7={},_0x303873={'count':0x0,'rows':[]};var _0x2bb34d=_['map'](db[_0xa31e('0x29')][_0xa31e('0x2a')],function(_0x339e17){return{'name':_0x339e17[_0xa31e('0x2b')],'type':_0x339e17[_0xa31e('0x2c')][_0xa31e('0x2d')]};});_0x4998a7[_0xa31e('0x2e')]=_['map'](_0x2bb34d,_0xa31e('0x26'));_0x4998a7[_0xa31e('0x2f')]=_[_0xa31e('0x30')](_0x4cf18c['query']);_0x4998a7[_0xa31e('0x31')]=_['intersection'](_0x4998a7[_0xa31e('0x2e')],_0x4998a7[_0xa31e('0x2f')]);_0x3274b8[_0xa31e('0x32')]=_['intersection'](_0x4998a7[_0xa31e('0x2e')],qs[_0xa31e('0x33')](_0x4cf18c[_0xa31e('0x2f')][_0xa31e('0x33')]));_0x3274b8[_0xa31e('0x32')]=_0x3274b8[_0xa31e('0x32')][_0xa31e('0x34')]?_0x3274b8[_0xa31e('0x32')]:_0x4998a7[_0xa31e('0x2e')];if(!_0x4cf18c[_0xa31e('0x2f')][_0xa31e('0x35')]('nolimit')){_0x3274b8[_0xa31e('0x1e')]=qs[_0xa31e('0x1e')](_0x4cf18c[_0xa31e('0x2f')][_0xa31e('0x1e')]);_0x3274b8[_0xa31e('0x1d')]=qs[_0xa31e('0x1d')](_0x4cf18c[_0xa31e('0x2f')][_0xa31e('0x1d')]);}_0x3274b8[_0xa31e('0x36')]=qs[_0xa31e('0x37')](_0x4cf18c['query'][_0xa31e('0x37')]);_0x3274b8['where']=qs[_0xa31e('0x31')](_['pick'](_0x4cf18c[_0xa31e('0x2f')],_0x4998a7['filters']));if(_0x4cf18c[_0xa31e('0x2f')]['filter']){_0x3274b8[_0xa31e('0x38')]=_[_0xa31e('0x39')](_0x3274b8[_0xa31e('0x38')],{'$or':_[_0xa31e('0x3a')](_0x2bb34d,function(_0xf12cc2){if(_0xf12cc2[_0xa31e('0x2c')]!==_0xa31e('0x3b')){var _0x30ae7d={};_0x30ae7d[_0xf12cc2['name']]={'$like':'%'+_0x4cf18c['query'][_0xa31e('0x3c')]+'%'};return _0x30ae7d;}})});}_0x3274b8=_[_0xa31e('0x39')]({},_0x3274b8,_0x4cf18c['options']);var _0x1cb5c5={'where':_0x3274b8[_0xa31e('0x38')]};return db[_0xa31e('0x29')][_0xa31e('0x3d')](_0x1cb5c5)[_0xa31e('0x3e')](function(_0x54912a){_0x303873[_0xa31e('0x3d')]=_0x54912a;if(_0x4cf18c[_0xa31e('0x2f')][_0xa31e('0x3f')]){_0x3274b8[_0xa31e('0x40')]=[{'all':!![]}];}return db[_0xa31e('0x29')][_0xa31e('0x41')](_0x3274b8);})['then'](function(_0x2566eb){_0x303873[_0xa31e('0x42')]=_0x2566eb;return _0x303873;})[_0xa31e('0x3e')](respondWithFilteredResult(_0x2c1d18,_0x3274b8))['catch'](handleError(_0x2c1d18,null));};exports['show']=function(_0x20407b,_0x259d35){var _0x54d797={'raw':!![],'where':{'id':_0x20407b[_0xa31e('0x43')]['id']}},_0xdd06c={};_0xdd06c[_0xa31e('0x2e')]=_[_0xa31e('0x30')](db[_0xa31e('0x29')][_0xa31e('0x2a')]);_0xdd06c[_0xa31e('0x2f')]=_[_0xa31e('0x30')](_0x20407b[_0xa31e('0x2f')]);_0xdd06c['filters']=_[_0xa31e('0x44')](_0xdd06c[_0xa31e('0x2e')],_0xdd06c['query']);_0x54d797[_0xa31e('0x32')]=_[_0xa31e('0x44')](_0xdd06c['model'],qs[_0xa31e('0x33')](_0x20407b['query'][_0xa31e('0x33')]));_0x54d797[_0xa31e('0x32')]=_0x54d797[_0xa31e('0x32')][_0xa31e('0x34')]?_0x54d797['attributes']:_0xdd06c[_0xa31e('0x2e')];if(_0x20407b[_0xa31e('0x2f')][_0xa31e('0x3f')]){_0x54d797[_0xa31e('0x40')]=[{'all':!![]}];}_0x54d797=_['merge']({},_0x54d797,_0x20407b[_0xa31e('0x45')]);return db[_0xa31e('0x29')][_0xa31e('0x46')](_0x54d797)[_0xa31e('0x3e')](handleEntityNotFound(_0x259d35,null))[_0xa31e('0x3e')](respondWithResult(_0x259d35,null))['catch'](handleError(_0x259d35,null));};exports[_0xa31e('0x47')]=function(_0x3d85d5,_0x497008){return db[_0xa31e('0x29')][_0xa31e('0x47')](_0x3d85d5[_0xa31e('0x48')],{})['then'](respondWithResult(_0x497008,0xc9))['catch'](handleError(_0x497008,null));};exports[_0xa31e('0x23')]=function(_0x3dcbbc,_0x2d7537){if(_0x3dcbbc[_0xa31e('0x48')]['id']){delete _0x3dcbbc['body']['id'];}return db['ChatOfflineMessage'][_0xa31e('0x46')]({'where':{'id':_0x3dcbbc[_0xa31e('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d7537,null))[_0xa31e('0x3e')](saveUpdates(_0x3dcbbc[_0xa31e('0x48')],null))[_0xa31e('0x3e')](respondWithResult(_0x2d7537,null))[_0xa31e('0x49')](handleError(_0x2d7537,null));};exports[_0xa31e('0x24')]=function(_0x437193,_0xc68a8c){return db[_0xa31e('0x29')]['find']({'where':{'id':_0x437193[_0xa31e('0x43')]['id']}})['then'](handleEntityNotFound(_0xc68a8c,null))[_0xa31e('0x3e')](removeEntity(_0xc68a8c,null))[_0xa31e('0x49')](handleError(_0xc68a8c,null));};exports['describe']=function(_0x2ce843,_0x28680b){return db[_0xa31e('0x29')][_0xa31e('0x4a')]()['then'](respondWithResult(_0x28680b,null))['catch'](handleError(_0x28680b,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 74f3654..d4d354d 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 _0x0b78=['moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b78,0x1ad));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'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':[],'timestamps':!![],'charset':_0x80b7('0xa'),'collate':_0x80b7('0xb')});}; \ No newline at end of file +var _0xb4e6=['bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','utf8mb4','lodash','../../config/logger','api','moment'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0xb4e6[_0x4996d5];return _0x4793f9;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var logger=require(_0x6b4e('0x1'))(_0x6b4e('0x2'));var moment=require(_0x6b4e('0x3'));var BPromise=require(_0x6b4e('0x4'));var rp=require(_0x6b4e('0x5'));var fs=require('fs');var path=require(_0x6b4e('0x6'));var rimraf=require(_0x6b4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b4e('0x8'));module[_0x6b4e('0x9')]=function(_0x1f67a2,_0x49de51){return _0x1f67a2[_0x6b4e('0xa')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b4e('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 48b1608..f27b313 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 _0x8bb5=['catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x49c66b,_0x3f0237){var _0x52f3d5=function(_0x3f090a){while(--_0x3f090a){_0x49c66b['push'](_0x49c66b['shift']());}};_0x52f3d5(++_0x3f0237);}(_0x8bb5,0x17d));var _0x58bb=function(_0x61e46e,_0x502db8){_0x61e46e=_0x61e46e-0x0;var _0x40ee1a=_0x8bb5[_0x61e46e];return _0x40ee1a;};'use strict';var _=require('lodash');var util=require(_0x58bb('0x0'));var moment=require('moment');var BPromise=require(_0x58bb('0x1'));var rs=require(_0x58bb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58bb('0x3'))['db'];var utils=require(_0x58bb('0x4'));var logger=require('../../config/logger')(_0x58bb('0x5'));var config=require('../../config/environment');var jayson=require(_0x58bb('0x6'));var client=jayson[_0x58bb('0x7')][_0x58bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ec72b,_0x520c1f,_0x9b6bde){return new BPromise(function(_0x25ead5,_0x5a648f){return client[_0x58bb('0x9')](_0x3ec72b,_0x9b6bde)[_0x58bb('0xa')](function(_0x51a881){logger['info'](_0x58bb('0xb'),_0x520c1f,_0x58bb('0xc'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x520c1f,_0x58bb('0xc'),JSON[_0x58bb('0xd')](_0x51a881));if(_0x51a881[_0x58bb('0xe')]){if(_0x51a881[_0x58bb('0xe')]['code']===0x1f4){logger[_0x58bb('0xe')](_0x58bb('0xb'),_0x520c1f,_0x51a881[_0x58bb('0xe')][_0x58bb('0xf')]);return _0x5a648f(_0x51a881['error']['message']);}logger[_0x58bb('0xe')](_0x58bb('0xb'),_0x520c1f,_0x51a881[_0x58bb('0xe')][_0x58bb('0xf')]);return _0x25ead5(_0x51a881[_0x58bb('0xe')]['message']);}else{logger[_0x58bb('0x10')](_0x58bb('0xb'),_0x520c1f,_0x58bb('0xc'));_0x25ead5(_0x51a881[_0x58bb('0x11')][_0x58bb('0xf')]);}})[_0x58bb('0x12')](function(_0x30681e){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x520c1f,_0x30681e);_0x5a648f(_0x30681e);});});} \ No newline at end of file +var _0xd0e9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment'];(function(_0x4b5409,_0x472b71){var _0x90b623=function(_0x596445){while(--_0x596445){_0x4b5409['push'](_0x4b5409['shift']());}};_0x90b623(++_0x472b71);}(_0xd0e9,0x19b));var _0x9d0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0e9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9d0e('0x0'));var util=require(_0x9d0e('0x1'));var moment=require(_0x9d0e('0x2'));var BPromise=require(_0x9d0e('0x3'));var rs=require(_0x9d0e('0x4'));var fs=require('fs');var Redis=require(_0x9d0e('0x5'));var db=require(_0x9d0e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d0e('0x7'))(_0x9d0e('0x8'));var config=require('../../config/environment');var jayson=require(_0x9d0e('0x9'));var client=jayson[_0x9d0e('0xa')][_0x9d0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d7ca4,_0x564979,_0xf6f12a){return new BPromise(function(_0x4f6cc5,_0x29c618){return client[_0x9d0e('0xc')](_0x1d7ca4,_0xf6f12a)[_0x9d0e('0xd')](function(_0x11f9d2){logger[_0x9d0e('0xe')](_0x9d0e('0xf'),_0x564979,_0x9d0e('0x10'));logger[_0x9d0e('0x11')](_0x9d0e('0x12'),_0x564979,'request\x20sent',JSON[_0x9d0e('0x13')](_0x11f9d2));if(_0x11f9d2['error']){if(_0x11f9d2[_0x9d0e('0x14')]['code']===0x1f4){logger[_0x9d0e('0x14')](_0x9d0e('0xf'),_0x564979,_0x11f9d2[_0x9d0e('0x14')]['message']);return _0x29c618(_0x11f9d2[_0x9d0e('0x14')]['message']);}logger[_0x9d0e('0x14')](_0x9d0e('0xf'),_0x564979,_0x11f9d2[_0x9d0e('0x14')][_0x9d0e('0x15')]);return _0x4f6cc5(_0x11f9d2[_0x9d0e('0x14')][_0x9d0e('0x15')]);}else{logger[_0x9d0e('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x564979,_0x9d0e('0x10'));_0x4f6cc5(_0x11f9d2['result'][_0x9d0e('0x15')]);}})[_0x9d0e('0x16')](function(_0x4bdb35){logger['error'](_0x9d0e('0xf'),_0x564979,_0x4bdb35);_0x29c618(_0x4bdb35);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index fbd060e..41b5454 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 _0x35b3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x35b3,0x142));var _0x335b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x335b('0x0'));var util=require(_0x335b('0x1'));var path=require(_0x335b('0x2'));var timeout=require(_0x335b('0x3'));var express=require(_0x335b('0x4'));var router=express[_0x335b('0x5')]();var auth=require(_0x335b('0x6'));var interaction=require(_0x335b('0x7'));var config=require(_0x335b('0x8'));var controller=require(_0x335b('0x9'));router[_0x335b('0xa')]('/',auth[_0x335b('0xb')](),controller['index']);router[_0x335b('0xa')](_0x335b('0xc'),auth[_0x335b('0xb')](),controller[_0x335b('0xd')]);router['get']('/:id',auth[_0x335b('0xb')](),controller[_0x335b('0xe')]);router[_0x335b('0xf')]('/',auth['isAuthenticated'](),controller[_0x335b('0x10')]);router[_0x335b('0x11')](_0x335b('0x12'),auth[_0x335b('0xb')](),controller[_0x335b('0x13')]);router[_0x335b('0x14')](_0x335b('0x12'),auth[_0x335b('0xb')](),controller[_0x335b('0x15')]);module[_0x335b('0x16')]=router; \ No newline at end of file +var _0x0123=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','post'];(function(_0x291b93,_0x44b715){var _0x4183c8=function(_0x228c59){while(--_0x228c59){_0x291b93['push'](_0x291b93['shift']());}};_0x4183c8(++_0x44b715);}(_0x0123,0x6a));var _0x3012=function(_0x33b634,_0x402501){_0x33b634=_0x33b634-0x0;var _0x27b7f8=_0x0123[_0x33b634];return _0x27b7f8;};'use strict';var multer=require(_0x3012('0x0'));var util=require(_0x3012('0x1'));var path=require(_0x3012('0x2'));var timeout=require(_0x3012('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x3012('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3012('0x5'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x3012('0x6')](),controller[_0x3012('0x7')]);router['get'](_0x3012('0x8'),auth[_0x3012('0x6')](),controller[_0x3012('0x9')]);router[_0x3012('0xa')](_0x3012('0xb'),auth[_0x3012('0x6')](),controller[_0x3012('0xc')]);router[_0x3012('0xd')]('/',auth[_0x3012('0x6')](),controller[_0x3012('0xe')]);router[_0x3012('0xf')](_0x3012('0xb'),auth[_0x3012('0x6')](),controller[_0x3012('0x10')]);router[_0x3012('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3012('0x12')]);module[_0x3012('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index e129c47..6f1a3e9 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 _0x15f7=['mouseOver','sequelize','STRING','ENUM','timeout'];(function(_0x46638b,_0x4f2598){var _0x6a157b=function(_0x14d213){while(--_0x14d213){_0x46638b['push'](_0x46638b['shift']());}};_0x6a157b(++_0x4f2598);}(_0x15f7,0x65));var _0x715f=function(_0x306646,_0xdc2e1b){_0x306646=_0x306646-0x0;var _0x40bd8d=_0x15f7[_0x306646];return _0x40bd8d;};'use strict';var Sequelize=require(_0x715f('0x0'));module['exports']={'name':{'type':Sequelize[_0x715f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x715f('0x2')]('mouseOver',_0x715f('0x3')),'defaultValue':_0x715f('0x4')},'selector':{'type':Sequelize[_0x715f('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x07ad=['exports','STRING','mouseOver','INTEGER'];(function(_0x19c667,_0x367861){var _0x4542d4=function(_0x3eccea){while(--_0x3eccea){_0x19c667['push'](_0x19c667['shift']());}};_0x4542d4(++_0x367861);}(_0x07ad,0xbc));var _0xd07a=function(_0x55fd5c,_0x7db0da){_0x55fd5c=_0x55fd5c-0x0;var _0x5b21e5=_0x07ad[_0x55fd5c];return _0x5b21e5;};'use strict';var Sequelize=require('sequelize');module[_0xd07a('0x0')]={'name':{'type':Sequelize[_0xd07a('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':_0xd07a('0x2')},'selector':{'type':Sequelize[_0xd07a('0x1')]},'timeout':{'type':Sequelize[_0xd07a('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 5a31131..340095f 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 _0xe706=['../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','ChatProactiveAction','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x49c9a,_0x34313c){var _0x19650e=function(_0x25ce01){while(--_0x25ce01){_0x49c9a['push'](_0x49c9a['shift']());}};_0x19650e(++_0x34313c);}(_0xe706,0xa3));var _0x6e70=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0xe706[_0x211bc3];return _0x34c9a2;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={'raw':!![],'where':{'id':_0x4a67ac[_0x6e70('0x2c')]['id']}},_0x3af17f={};_0x3af17f[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](db['ChatProactiveAction'][_0x6e70('0x2f')]);_0x3af17f[_0x6e70('0x30')]=_[_0x6e70('0x2e')](_0x4a67ac[_0x6e70('0x30')]);_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x32')](_0x3af17f[_0x6e70('0x2d')],_0x3af17f[_0x6e70('0x30')]);_0x2c4d37[_0x6e70('0x33')]=_[_0x6e70('0x32')](_0x3af17f['model'],qs[_0x6e70('0x34')](_0x4a67ac['query'][_0x6e70('0x34')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x33')][_0x6e70('0x35')]?_0x2c4d37[_0x6e70('0x33')]:_0x3af17f['model'];if(_0x4a67ac[_0x6e70('0x30')][_0x6e70('0x36')]){_0x2c4d37['include']=[{'all':!![]}];}_0x2c4d37=_[_0x6e70('0x37')]({},_0x2c4d37,_0x4a67ac[_0x6e70('0x38')]);return db['ChatProactiveAction'][_0x6e70('0x39')](_0x2c4d37)[_0x6e70('0x27')](handleEntityNotFound(_0x54a5fe,null))[_0x6e70('0x27')](respondWithResult(_0x54a5fe,null))[_0x6e70('0x3a')](handleError(_0x54a5fe,null));};exports[_0x6e70('0x3b')]=function(_0x1e3e76,_0x44b19d){return db[_0x6e70('0x3c')][_0x6e70('0x3b')](_0x1e3e76[_0x6e70('0x3d')],{})['then'](respondWithResult(_0x44b19d,0xc9))[_0x6e70('0x3a')](handleError(_0x44b19d,null));};exports['update']=function(_0x23cd1a,_0x3222a2){if(_0x23cd1a[_0x6e70('0x3d')]['id']){delete _0x23cd1a[_0x6e70('0x3d')]['id'];}return db[_0x6e70('0x3c')][_0x6e70('0x39')]({'where':{'id':_0x23cd1a[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x3222a2,null))[_0x6e70('0x27')](saveUpdates(_0x23cd1a[_0x6e70('0x3d')],null))[_0x6e70('0x27')](respondWithResult(_0x3222a2,null))[_0x6e70('0x3a')](handleError(_0x3222a2,null));};exports[_0x6e70('0x3e')]=function(_0x501b53,_0x5446a2){return db['ChatProactiveAction'][_0x6e70('0x39')]({'where':{'id':_0x501b53[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x5446a2,null))[_0x6e70('0x27')](removeEntity(_0x5446a2,null))[_0x6e70('0x3a')](handleError(_0x5446a2,null));}; \ No newline at end of file +var _0x0713=['update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','attributes','intersection','fields','includeAll','include','merge','options','find','catch','create','body'];(function(_0x342667,_0x55b8f3){var _0x40c277=function(_0x32693c){while(--_0x32693c){_0x342667['push'](_0x342667['shift']());}};_0x40c277(++_0x55b8f3);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={'raw':!![],'where':{'id':_0x4d5c4b[_0x3071('0x2d')]['id']}},_0x163604={};_0x163604[_0x3071('0x2e')]=_[_0x3071('0x2f')](db[_0x3071('0x30')][_0x3071('0x31')]);_0x163604[_0x3071('0x32')]=_[_0x3071('0x2f')](_0x4d5c4b[_0x3071('0x32')]);_0x163604['filters']=_['intersection'](_0x163604[_0x3071('0x2e')],_0x163604[_0x3071('0x32')]);_0x28792d[_0x3071('0x33')]=_[_0x3071('0x34')](_0x163604[_0x3071('0x2e')],qs[_0x3071('0x35')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x35')]));_0x28792d['attributes']=_0x28792d['attributes']['length']?_0x28792d[_0x3071('0x33')]:_0x163604[_0x3071('0x2e')];if(_0x4d5c4b['query'][_0x3071('0x36')]){_0x28792d[_0x3071('0x37')]=[{'all':!![]}];}_0x28792d=_[_0x3071('0x38')]({},_0x28792d,_0x4d5c4b[_0x3071('0x39')]);return db['ChatProactiveAction'][_0x3071('0x3a')](_0x28792d)[_0x3071('0x26')](handleEntityNotFound(_0x4fb1ca,null))[_0x3071('0x26')](respondWithResult(_0x4fb1ca,null))[_0x3071('0x3b')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x3c')]=function(_0x2068ce,_0x3c55c){return db[_0x3071('0x30')]['create'](_0x2068ce[_0x3071('0x3d')],{})['then'](respondWithResult(_0x3c55c,0xc9))['catch'](handleError(_0x3c55c,null));};exports[_0x3071('0x3e')]=function(_0xa3a7ae,_0x54d9c3){if(_0xa3a7ae[_0x3071('0x3d')]['id']){delete _0xa3a7ae[_0x3071('0x3d')]['id'];}return db[_0x3071('0x30')][_0x3071('0x3a')]({'where':{'id':_0xa3a7ae[_0x3071('0x2d')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x54d9c3,null))['then'](saveUpdates(_0xa3a7ae[_0x3071('0x3d')],null))[_0x3071('0x26')](respondWithResult(_0x54d9c3,null))['catch'](handleError(_0x54d9c3,null));};exports[_0x3071('0x27')]=function(_0x5b1392,_0x28f855){return db[_0x3071('0x30')]['find']({'where':{'id':_0x5b1392['params']['id']}})[_0x3071('0x26')](handleEntityNotFound(_0x28f855,null))[_0x3071('0x26')](removeEntity(_0x28f855,null))[_0x3071('0x3b')](handleError(_0x28f855,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index fc3a2e7..8f770f1 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 _0x4753=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x50c619,_0x16a7e5){var _0x2aec50=function(_0x38ca82){while(--_0x38ca82){_0x50c619['push'](_0x50c619['shift']());}};_0x2aec50(++_0x16a7e5);}(_0x4753,0x16a));var _0x3475=function(_0x4651f2,_0x1bc574){_0x4651f2=_0x4651f2-0x0;var _0x11d828=_0x4753[_0x4651f2];return _0x11d828;};'use strict';var _=require(_0x3475('0x0'));var util=require('util');var logger=require(_0x3475('0x1'))(_0x3475('0x2'));var moment=require(_0x3475('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3475('0x4'));var rimraf=require(_0x3475('0x5'));var config=require(_0x3475('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x3475('0x7')]=function(_0x4990b4,_0x5ad0a5){return _0x4990b4[_0x3475('0x8')](_0x3475('0x9'),attributes,{'tableName':_0x3475('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf22e=['api','moment','bluebird','request-promise','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','../../config/logger'];(function(_0x449bc2,_0x5d1de9){var _0x27453a=function(_0x1ad6e3){while(--_0x1ad6e3){_0x449bc2['push'](_0x449bc2['shift']());}};_0x27453a(++_0x5d1de9);}(_0xf22e,0x1b7));var _0xef22=function(_0xffa3f5,_0x115c05){_0xffa3f5=_0xffa3f5-0x0;var _0x2b8cfb=_0xf22e[_0xffa3f5];return _0x2b8cfb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xef22('0x0'))(_0xef22('0x1'));var moment=require(_0xef22('0x2'));var BPromise=require(_0xef22('0x3'));var rp=require(_0xef22('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xef22('0x5'));var attributes=require('./chatProactiveAction.attributes');module[_0xef22('0x6')]=function(_0x39f2c0,_0xeee062){return _0x39f2c0[_0xef22('0x7')](_0xef22('0x8'),attributes,{'tableName':_0xef22('0x9'),'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 5a2295a..addd18e 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 _0x75fe=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x75fe,0x11d));var _0xe75f=function(_0x3e98c3,_0x598349){_0x3e98c3=_0x3e98c3-0x0;var _0x5d750c=_0x75fe[_0x3e98c3];return _0x5d750c;};'use strict';var _=require('lodash');var util=require(_0xe75f('0x0'));var moment=require(_0xe75f('0x1'));var BPromise=require(_0xe75f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe75f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe75f('0x4'))(_0xe75f('0x5'));var config=require('../../config/environment');var jayson=require(_0xe75f('0x6'));var client=jayson[_0xe75f('0x7')][_0xe75f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2523cc,_0xc6a839,_0x6549f1){return new BPromise(function(_0x56e349,_0x20ab23){return client['request'](_0x2523cc,_0x6549f1)[_0xe75f('0x9')](function(_0x361934){logger['info'](_0xe75f('0xa'),_0xc6a839,_0xe75f('0xb'));logger[_0xe75f('0xc')](_0xe75f('0xd'),_0xc6a839,_0xe75f('0xb'),JSON[_0xe75f('0xe')](_0x361934));if(_0x361934[_0xe75f('0xf')]){if(_0x361934[_0xe75f('0xf')][_0xe75f('0x10')]===0x1f4){logger['error'](_0xe75f('0xa'),_0xc6a839,_0x361934['error'][_0xe75f('0x11')]);return _0x20ab23(_0x361934[_0xe75f('0xf')]['message']);}logger[_0xe75f('0xf')](_0xe75f('0xa'),_0xc6a839,_0x361934[_0xe75f('0xf')][_0xe75f('0x11')]);return _0x56e349(_0x361934[_0xe75f('0xf')]['message']);}else{logger['info'](_0xe75f('0xa'),_0xc6a839,'request\x20sent');_0x56e349(_0x361934[_0xe75f('0x12')][_0xe75f('0x11')]);}})[_0xe75f('0x13')](function(_0xc22c0b){logger[_0xe75f('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0xc6a839,_0xc22c0b);_0x20ab23(_0xc22c0b);});});} \ No newline at end of file +var _0x5835=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4546f9,_0x2fa4d6){var _0x3510fd=function(_0x31a947){while(--_0x31a947){_0x4546f9['push'](_0x4546f9['shift']());}};_0x3510fd(++_0x2fa4d6);}(_0x5835,0xfb));var _0x5583=function(_0x36102e,_0x43e9ad){_0x36102e=_0x36102e-0x0;var _0x5366b9=_0x5835[_0x36102e];return _0x5366b9;};'use strict';var _=require(_0x5583('0x0'));var util=require(_0x5583('0x1'));var moment=require('moment');var BPromise=require(_0x5583('0x2'));var rs=require(_0x5583('0x3'));var fs=require('fs');var Redis=require(_0x5583('0x4'));var db=require(_0x5583('0x5'))['db'];var utils=require(_0x5583('0x6'));var logger=require('../../config/logger')(_0x5583('0x7'));var config=require(_0x5583('0x8'));var jayson=require(_0x5583('0x9'));var client=jayson[_0x5583('0xa')][_0x5583('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e07bc,_0x8f222d,_0x561308){return new BPromise(function(_0x4223ca,_0x516846){return client[_0x5583('0xc')](_0x4e07bc,_0x561308)[_0x5583('0xd')](function(_0x459e5b){logger[_0x5583('0xe')](_0x5583('0xf'),_0x8f222d,_0x5583('0x10'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x8f222d,_0x5583('0x10'),JSON['stringify'](_0x459e5b));if(_0x459e5b[_0x5583('0x11')]){if(_0x459e5b[_0x5583('0x11')][_0x5583('0x12')]===0x1f4){logger[_0x5583('0x11')](_0x5583('0xf'),_0x8f222d,_0x459e5b[_0x5583('0x11')][_0x5583('0x13')]);return _0x516846(_0x459e5b['error']['message']);}logger['error'](_0x5583('0xf'),_0x8f222d,_0x459e5b[_0x5583('0x11')][_0x5583('0x13')]);return _0x4223ca(_0x459e5b['error'][_0x5583('0x13')]);}else{logger['info'](_0x5583('0xf'),_0x8f222d,_0x5583('0x10'));_0x4223ca(_0x459e5b[_0x5583('0x14')][_0x5583('0x13')]);}})[_0x5583('0x15')](function(_0x40f869){logger[_0x5583('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x8f222d,_0x40f869);_0x516846(_0x40f869);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index e4c4bb5..8428c0c 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 _0xca9a=['../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x48a184,_0x543a72){var _0x1aee29=function(_0x43d1d8){while(--_0x43d1d8){_0x48a184['push'](_0x48a184['shift']());}};_0x1aee29(++_0x543a72);}(_0xca9a,0x181));var _0xaca9=function(_0x2c887f,_0x22b378){_0x2c887f=_0x2c887f-0x0;var _0x4a18c8=_0xca9a[_0x2c887f];return _0x4a18c8;};'use strict';var multer=require(_0xaca9('0x0'));var util=require(_0xaca9('0x1'));var path=require(_0xaca9('0x2'));var timeout=require('connect-timeout');var express=require(_0xaca9('0x3'));var router=express[_0xaca9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xaca9('0x5'));var config=require(_0xaca9('0x6'));var controller=require(_0xaca9('0x7'));router[_0xaca9('0x8')](_0xaca9('0x9'),auth[_0xaca9('0xa')](),controller[_0xaca9('0xb')]);router[_0xaca9('0xc')]('/',auth[_0xaca9('0xa')](),controller['create']);router[_0xaca9('0xd')](_0xaca9('0x9'),auth['isAuthenticated'](),controller[_0xaca9('0xe')]);router[_0xaca9('0xf')](_0xaca9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xaca9('0x10')]=router; \ No newline at end of file +var _0x3954=['/:id','post','isAuthenticated','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0xa60623,_0x2d4e4f){var _0x4a6487=function(_0xba6cbe){while(--_0xba6cbe){_0xa60623['push'](_0xa60623['shift']());}};_0x4a6487(++_0x2d4e4f);}(_0x3954,0x16d));var _0x4395=function(_0x2d7710,_0x153f6f){_0x2d7710=_0x2d7710-0x0;var _0x35d904=_0x3954[_0x2d7710];return _0x35d904;};'use strict';var multer=require(_0x4395('0x0'));var util=require(_0x4395('0x1'));var path=require('path');var timeout=require(_0x4395('0x2'));var express=require('express');var router=express[_0x4395('0x3')]();var auth=require(_0x4395('0x4'));var interaction=require(_0x4395('0x5'));var config=require(_0x4395('0x6'));var controller=require(_0x4395('0x7'));router[_0x4395('0x8')](_0x4395('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4395('0xa')]('/',auth[_0x4395('0xb')](),controller[_0x4395('0xc')]);router['put'](_0x4395('0x9'),auth[_0x4395('0xb')](),controller[_0x4395('0xd')]);router[_0x4395('0xe')](_0x4395('0x9'),auth[_0x4395('0xb')](),controller[_0x4395('0xf')]);module[_0x4395('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index c9c0095..505dea7 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 _0x838e=['sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x838e,0x102));var _0xe838=function(_0x5bb226,_0x25fbc0){_0x5bb226=_0x5bb226-0x0;var _0x161d69=_0x838e[_0x5bb226];return _0x161d69;};'use strict';var Sequelize=require(_0xe838('0x0'));module[_0xe838('0x1')]={'name':{'type':Sequelize[_0xe838('0x2')],'unique':_0xe838('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe838('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe838('0x4')]('rrmemory',_0xe838('0x5'),'roundrobin')}}; \ No newline at end of file +var _0x3951=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports','STRING'];(function(_0x34efa6,_0x343fe2){var _0x469490=function(_0xc1d725){while(--_0xc1d725){_0x34efa6['push'](_0x34efa6['shift']());}};_0x469490(++_0x343fe2);}(_0x3951,0xf6));var _0x1395=function(_0x5eda4e,_0x40e530){_0x5eda4e=_0x5eda4e-0x0;var _0x22e9c6=_0x3951[_0x5eda4e];return _0x22e9c6;};'use strict';var Sequelize=require('sequelize');module[_0x1395('0x0')]={'name':{'type':Sequelize[_0x1395('0x1')],'unique':_0x1395('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1395('0x1')]},'timeout':{'type':Sequelize[_0x1395('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1395('0x4')](_0x1395('0x5'),_0x1395('0x6'),_0x1395('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index d59992f..f459053 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 _0x1561=['emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./chatQueue.socket','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','set','apply','save','update','get','UserProfileResource','destroy','name','send','map','ChatQueue','type','query','keys','filters','model','attributes','intersection','fields','limit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','agent','createdAt','format','%s/%s','chatPause','updatedAt','Team','getTeams','hasOwnProperty','online','interface','Agents','transaction','addTeams','each','findOrCreate','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','sequelize','isEmpty','removeAgents','forEach'];(function(_0x43d0f2,_0x502fab){var _0x258cf2=function(_0x545f57){while(--_0x545f57){_0x43d0f2['push'](_0x43d0f2['shift']());}};_0x258cf2(++_0x502fab);}(_0x1561,0x1bd));var _0x1156=function(_0x4a96d2,_0x2ad5ee){_0x4a96d2=_0x4a96d2-0x0;var _0x354779=_0x1561[_0x4a96d2];return _0x354779;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1156('0x0'));var zipdir=require(_0x1156('0x1'));var jsonpatch=require(_0x1156('0x2'));var rp=require(_0x1156('0x3'));var moment=require(_0x1156('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1156('0x5'));var util=require(_0x1156('0x6'));var path=require(_0x1156('0x7'));var sox=require(_0x1156('0x8'));var csv=require('to-csv');var ejs=require(_0x1156('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1156('0xa'));var crypto=require(_0x1156('0xb'));var jsforce=require(_0x1156('0xc'));var deskjs=require(_0x1156('0xd'));var toCsv=require(_0x1156('0xe'));var querystring=require('querystring');var Papa=require(_0x1156('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1156('0x10'));var as=require(_0x1156('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1156('0x12'))('api');var utils=require(_0x1156('0x13'));var config=require('../../config/environment');var db=require(_0x1156('0x14'))['db'];config[_0x1156('0x15')]=_['defaults'](config['redis'],{'host':_0x1156('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1156('0x15')]));require(_0x1156('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1156('0x18')][_0x1156('0x19')]({'port':0x232a});function checkPasswordPattern(_0x9673ef,_0x546990,_0x54b633){if(_0x54b633){var _0xb1b48b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb1b48b[_0x1156('0x1a')](_0x546990)){return _0x9673ef;}else{throw new db[(_0x1156('0x1b'))][(_0x1156('0x1c'))](_0x1156('0x1d'));}}else{return _0x9673ef;}}function respondWithRpcPromise(_0x230b78,_0x2c1ff5,_0x6dd20,_0x2d820d){return new BPromise(function(_0x211e6b,_0x2582cb){var _0x4ab172=_0x2d820d||client;return _0x4ab172[_0x1156('0x1e')](_0x230b78,_0x6dd20)[_0x1156('0x1f')](function(_0x40eab4){logger['info'](_0x1156('0x20'),_0x2c1ff5,_0x1156('0x21'));logger[_0x1156('0x22')](_0x1156('0x23'),_0x2c1ff5,_0x1156('0x21'),JSON[_0x1156('0x24')](_0x40eab4));if(_0x40eab4[_0x1156('0x25')]){if(_0x40eab4[_0x1156('0x25')]['code']===0x1f4){logger[_0x1156('0x25')]('ChatQueue,\x20%s,\x20%s',_0x2c1ff5,_0x40eab4[_0x1156('0x25')][_0x1156('0x26')]);return _0x2582cb(_0x40eab4[_0x1156('0x25')]['message']);}logger[_0x1156('0x25')](_0x1156('0x20'),_0x2c1ff5,_0x40eab4[_0x1156('0x25')][_0x1156('0x26')]);return _0x211e6b(_0x40eab4[_0x1156('0x25')][_0x1156('0x26')]);}else{logger['info'](_0x1156('0x20'),_0x2c1ff5,_0x1156('0x21'));_0x211e6b(_0x40eab4[_0x1156('0x27')][_0x1156('0x26')]);}})[_0x1156('0x28')](function(_0x215978){logger[_0x1156('0x25')](_0x1156('0x20'),_0x2c1ff5,_0x215978);_0x2582cb(_0x215978);});});}function respondWithStatusCode(_0x195aef,_0x2826e9){_0x2826e9=_0x2826e9||0xcc;return function(_0x225502){if(_0x225502){return _0x195aef[_0x1156('0x29')](_0x2826e9);}return _0x195aef[_0x1156('0x2a')](_0x2826e9)[_0x1156('0x2b')]();};}function respondWithResult(_0x4f5c32,_0x415bb1){_0x415bb1=_0x415bb1||0xc8;return function(_0xca0e08){if(_0xca0e08){return _0x4f5c32['status'](_0x415bb1)[_0x1156('0x2c')](_0xca0e08);}};}function respondWithFilteredResult(_0x332924,_0x5db695){return function(_0x18f912){if(_0x18f912){var _0x3e4cc3=_0x18f912['count'],_0x5299d3=_0x5db695[_0x1156('0x2d')],_0x12a68e=_0x5db695[_0x1156('0x2d')]+_0x5db695['limit'],_0x265406;if(_0x12a68e>=_0x3e4cc3){_0x12a68e=_0x3e4cc3;_0x265406=0xc8;}else{_0x265406=0xce;}_0x332924[_0x1156('0x2a')](_0x265406);return _0x332924[_0x1156('0x2e')]('Content-Range',_0x5299d3+'-'+_0x12a68e+'/'+_0x3e4cc3)[_0x1156('0x2c')](_0x18f912);}return null;};}function patchUpdates(_0x275eb6){return function(_0x1e7558){try{jsonpatch[_0x1156('0x2f')](_0x1e7558,_0x275eb6,!![]);}catch(_0x56269e){return BPromise['reject'](_0x56269e);}return _0x1e7558[_0x1156('0x30')]();};}function saveUpdates(_0x9bbec1,_0x207d78){return function(_0x26a0bf){if(_0x26a0bf){return _0x26a0bf[_0x1156('0x31')](_0x9bbec1)[_0x1156('0x1f')](function(_0x3172f8){return _0x3172f8;});}return null;};}function removeEntity(_0x8a5098,_0x38ab3d){return function(_0x48d52d){if(_0x48d52d){return _0x48d52d['destroy']()[_0x1156('0x1f')](function(){var _0x48a527=_0x48d52d[_0x1156('0x32')]({'plain':!![]});var _0x96f2fd='ChatQueues';return db[_0x1156('0x33')][_0x1156('0x34')]({'where':{'type':_0x96f2fd,'resourceId':_0x48a527['id']}})[_0x1156('0x1f')](function(){return _0x48d52d;});})[_0x1156('0x1f')](function(){_0x8a5098['status'](0xcc)[_0x1156('0x2b')]();});}};}function handleEntityNotFound(_0xa68f3d,_0x493a43){return function(_0x129d43){if(!_0x129d43){_0xa68f3d[_0x1156('0x29')](0x194);}return _0x129d43;};}function handleError(_0x32ded9,_0x35b2f8){_0x35b2f8=_0x35b2f8||0x1f4;return function(_0x5dab6e){logger[_0x1156('0x25')](_0x5dab6e['stack']);if(_0x5dab6e['name']){delete _0x5dab6e[_0x1156('0x35')];}_0x32ded9['status'](_0x35b2f8)[_0x1156('0x36')](_0x5dab6e);};}exports['index']=function(_0x491a85,_0x405afb){var _0x9673d4={},_0x362eb1={},_0x20d50c={'count':0x0,'rows':[]};var _0x3d60f6=_[_0x1156('0x37')](db[_0x1156('0x38')]['rawAttributes'],function(_0x231ad6){return{'name':_0x231ad6['fieldName'],'type':_0x231ad6[_0x1156('0x39')]['key']};});_0x362eb1['model']=_[_0x1156('0x37')](_0x3d60f6,_0x1156('0x35'));_0x362eb1[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x491a85[_0x1156('0x3a')]);_0x362eb1[_0x1156('0x3c')]=_['intersection'](_0x362eb1[_0x1156('0x3d')],_0x362eb1[_0x1156('0x3a')]);_0x9673d4[_0x1156('0x3e')]=_[_0x1156('0x3f')](_0x362eb1[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x491a85[_0x1156('0x3a')]['fields']));_0x9673d4['attributes']=_0x9673d4['attributes']['length']?_0x9673d4[_0x1156('0x3e')]:_0x362eb1[_0x1156('0x3d')];if(!_0x491a85['query']['hasOwnProperty']('nolimit')){_0x9673d4['limit']=qs['limit'](_0x491a85[_0x1156('0x3a')][_0x1156('0x41')]);_0x9673d4[_0x1156('0x2d')]=qs['offset'](_0x491a85[_0x1156('0x3a')]['offset']);}_0x9673d4['order']=qs[_0x1156('0x42')](_0x491a85[_0x1156('0x3a')][_0x1156('0x42')]);_0x9673d4[_0x1156('0x43')]=qs[_0x1156('0x3c')](_[_0x1156('0x44')](_0x491a85[_0x1156('0x3a')],_0x362eb1[_0x1156('0x3c')]));if(_0x491a85['query'][_0x1156('0x45')]){_0x9673d4[_0x1156('0x43')]=_['merge'](_0x9673d4[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x3d60f6,function(_0x58092e){if(_0x58092e[_0x1156('0x39')]!=='VIRTUAL'){var _0x32ef1d={};_0x32ef1d[_0x58092e['name']]={'$like':'%'+_0x491a85['query'][_0x1156('0x45')]+'%'};return _0x32ef1d;}})});}_0x9673d4=_[_0x1156('0x46')]({},_0x9673d4,_0x491a85[_0x1156('0x47')]);var _0x2147e1={'where':_0x9673d4[_0x1156('0x43')]};return db[_0x1156('0x38')]['count'](_0x2147e1)[_0x1156('0x1f')](function(_0x55a5cc){_0x20d50c[_0x1156('0x48')]=_0x55a5cc;if(_0x491a85[_0x1156('0x3a')][_0x1156('0x49')]){_0x9673d4[_0x1156('0x4a')]=[{'all':!![]}];}return db[_0x1156('0x38')][_0x1156('0x4b')](_0x9673d4);})[_0x1156('0x1f')](function(_0x280741){_0x20d50c[_0x1156('0x4c')]=_0x280741;return _0x20d50c;})['then'](respondWithFilteredResult(_0x405afb,_0x9673d4))[_0x1156('0x28')](handleError(_0x405afb,null));};exports[_0x1156('0x4d')]=function(_0x2f4d49,_0x333874){var _0x522740={'raw':!![],'where':{'id':_0x2f4d49[_0x1156('0x4e')]['id']}},_0x1317d2={};_0x1317d2[_0x1156('0x3d')]=_['keys'](db[_0x1156('0x38')][_0x1156('0x4f')]);_0x1317d2[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x2f4d49[_0x1156('0x3a')]);_0x1317d2[_0x1156('0x3c')]=_['intersection'](_0x1317d2[_0x1156('0x3d')],_0x1317d2['query']);_0x522740['attributes']=_[_0x1156('0x3f')](_0x1317d2[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x2f4d49[_0x1156('0x3a')][_0x1156('0x40')]));_0x522740['attributes']=_0x522740['attributes'][_0x1156('0x50')]?_0x522740[_0x1156('0x3e')]:_0x1317d2['model'];if(_0x2f4d49[_0x1156('0x3a')][_0x1156('0x49')]){_0x522740[_0x1156('0x4a')]=[{'all':!![]}];}_0x522740=_[_0x1156('0x46')]({},_0x522740,_0x2f4d49[_0x1156('0x47')]);return db[_0x1156('0x38')]['find'](_0x522740)[_0x1156('0x1f')](handleEntityNotFound(_0x333874,null))[_0x1156('0x1f')](respondWithResult(_0x333874,null))[_0x1156('0x28')](handleError(_0x333874,null));};exports[_0x1156('0x51')]=function(_0x59de0d,_0x2b58cd){return db['ChatQueue']['create'](_0x59de0d['body'],{})[_0x1156('0x1f')](function(_0x1c1ed3){var _0x16ed77=_0x59de0d[_0x1156('0x52')][_0x1156('0x32')]({'plain':!![]});if(!_0x16ed77)throw new Error(_0x1156('0x53'));if(_0x16ed77[_0x1156('0x54')]==='user'){var _0x54f32a=_0x1c1ed3['get']({'plain':!![]});var _0x2b25a2=_0x1156('0x55');return db[_0x1156('0x56')][_0x1156('0x57')]({'where':{'name':_0x2b25a2,'userProfileId':_0x16ed77[_0x1156('0x58')]},'raw':!![]})[_0x1156('0x1f')](function(_0x3f3b60){if(_0x3f3b60&&_0x3f3b60['autoAssociation']===0x0){return db[_0x1156('0x33')][_0x1156('0x51')]({'name':_0x54f32a['name'],'resourceId':_0x54f32a['id'],'type':_0x3f3b60[_0x1156('0x35')],'sectionId':_0x3f3b60['id']},{})['then'](function(){return _0x1c1ed3;});}else{return _0x1c1ed3;}})[_0x1156('0x28')](function(_0x19a4a6){logger[_0x1156('0x25')](_0x1156('0x59'),_0x19a4a6);throw _0x19a4a6;});}return _0x1c1ed3;})['then'](respondWithResult(_0x2b58cd,0xc9))[_0x1156('0x28')](handleError(_0x2b58cd,null));};exports['update']=function(_0x4d049b,_0x56d2ca){if(_0x4d049b['body']['id']){delete _0x4d049b[_0x1156('0x5a')]['id'];}return db['ChatQueue'][_0x1156('0x57')]({'where':{'id':_0x4d049b[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x56d2ca,null))[_0x1156('0x1f')](saveUpdates(_0x4d049b[_0x1156('0x5a')],null))['then'](respondWithResult(_0x56d2ca,null))['catch'](handleError(_0x56d2ca,null));};exports['destroy']=function(_0x5a64a6,_0x160107){return db['ChatQueue'][_0x1156('0x57')]({'where':{'id':_0x5a64a6[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x160107,null))[_0x1156('0x1f')](removeEntity(_0x160107,null))[_0x1156('0x28')](handleError(_0x160107,null));};exports[_0x1156('0x5b')]=function(_0x1f9dd9,_0xc43a13){return db[_0x1156('0x38')]['describe']()[_0x1156('0x1f')](respondWithResult(_0xc43a13,null))[_0x1156('0x28')](handleError(_0xc43a13,null));};exports[_0x1156('0x5c')]=function(_0x1e38b2,_0x204e77,_0x392737){var _0x356b4c={'raw':!![],'where':{}},_0x369ce8={},_0x5d859d;return db['ChatQueue'][_0x1156('0x5d')]({'where':{'id':_0x1e38b2[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x204e77,null))[_0x1156('0x1f')](function(_0x32c7fd){if(_0x32c7fd){_0x5d859d=_0x32c7fd[_0x1156('0x32')]({'plain':!![]});_0x369ce8[_0x1156('0x3d')]=_[_0x1156('0x3b')](db[_0x1156('0x5e')]['rawAttributes']);_0x369ce8[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x1e38b2[_0x1156('0x3a')]);_0x369ce8['filters']=_[_0x1156('0x3f')](_0x369ce8[_0x1156('0x3d')],_0x369ce8[_0x1156('0x3a')]);_0x356b4c[_0x1156('0x3e')]=_[_0x1156('0x3f')](_0x369ce8[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x1e38b2[_0x1156('0x3a')]['fields']));_0x356b4c['attributes']=_0x356b4c['attributes'][_0x1156('0x50')]?_0x356b4c[_0x1156('0x3e')]:_0x369ce8[_0x1156('0x3d')];if(!_0x1e38b2['query']['hasOwnProperty'](_0x1156('0x5f'))){_0x356b4c[_0x1156('0x41')]=qs['limit'](_0x1e38b2[_0x1156('0x3a')][_0x1156('0x41')]);_0x356b4c[_0x1156('0x2d')]=qs['offset'](_0x1e38b2[_0x1156('0x3a')]['offset']);}_0x356b4c[_0x1156('0x60')]=qs[_0x1156('0x42')](_0x1e38b2[_0x1156('0x3a')][_0x1156('0x42')]);_0x356b4c[_0x1156('0x43')]=qs[_0x1156('0x3c')](_[_0x1156('0x44')](_0x1e38b2[_0x1156('0x3a')],_0x369ce8[_0x1156('0x3c')]));_0x356b4c[_0x1156('0x43')][_0x1156('0x61')]=_0x32c7fd['id'];if(_0x1e38b2['query'][_0x1156('0x45')]){_0x356b4c['where']=_[_0x1156('0x46')](_0x356b4c[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x356b4c[_0x1156('0x3e')],function(_0x9c1800){var _0x3e5473={};_0x3e5473[_0x9c1800]={'$like':'%'+_0x1e38b2[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x3e5473;})});}_0x356b4c=_[_0x1156('0x46')]({},_0x356b4c,_0x1e38b2[_0x1156('0x47')]);return db[_0x1156('0x5e')][_0x1156('0x4b')](_0x356b4c);}})[_0x1156('0x1f')](function(_0x56db0d){if(_0x56db0d){return db[_0x1156('0x62')]['findAndCountAll']({'where':{'id':_[_0x1156('0x37')](_0x56db0d,'UserId'),'role':_0x1156('0x63')},'attributes':['id',_0x1156('0x35'),'chatPause','updatedAt',_0x1156('0x64')]});}})[_0x1156('0x1f')](function(_0x645eb){if(_0x645eb){return{'count':_0x645eb[_0x1156('0x48')],'rows':_[_0x1156('0x37')](_0x645eb[_0x1156('0x4c')],function(_0x37c98f){return{'membername':_0x37c98f['name'],'UserId':_0x37c98f['id'],'queue_name':_0x5d859d[_0x1156('0x35')],'ChatQueueId':_0x5d859d['id'],'interface':util[_0x1156('0x65')](_0x1156('0x66'),'SIP',_0x37c98f[_0x1156('0x35')]),'penalty':0x0,'paused':_0x37c98f[_0x1156('0x67')],'createdAt':_0x37c98f[_0x1156('0x64')],'updatedAt':_0x37c98f[_0x1156('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1156('0x1f')](respondWithFilteredResult(_0x204e77,_0x356b4c))[_0x1156('0x28')](handleError(_0x204e77,null));};exports['getTeams']=function(_0x570495,_0x49c142,_0x5afecd){var _0x243750={};var _0x1dbf64={};var _0x167fbf;var _0x140556;return db[_0x1156('0x38')][_0x1156('0x5d')]({'where':{'id':_0x570495['params']['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x49c142,null))['then'](function(_0x2f4924){if(_0x2f4924){_0x167fbf=_0x2f4924;_0x1dbf64[_0x1156('0x3d')]=_[_0x1156('0x3b')](db[_0x1156('0x69')][_0x1156('0x4f')]);_0x1dbf64[_0x1156('0x3a')]=_['keys'](_0x570495['query']);_0x1dbf64[_0x1156('0x3c')]=_[_0x1156('0x3f')](_0x1dbf64[_0x1156('0x3d')],_0x1dbf64[_0x1156('0x3a')]);_0x243750[_0x1156('0x3e')]=_[_0x1156('0x3f')](_0x1dbf64[_0x1156('0x3d')],qs['fields'](_0x570495[_0x1156('0x3a')]['fields']));_0x243750['attributes']=_0x243750[_0x1156('0x3e')][_0x1156('0x50')]?_0x243750[_0x1156('0x3e')]:_0x1dbf64['model'];_0x243750[_0x1156('0x60')]=qs['sort'](_0x570495[_0x1156('0x3a')][_0x1156('0x42')]);_0x243750[_0x1156('0x43')]=qs[_0x1156('0x3c')](_[_0x1156('0x44')](_0x570495['query'],_0x1dbf64[_0x1156('0x3c')]));if(_0x570495[_0x1156('0x3a')][_0x1156('0x45')]){_0x243750['where']=_[_0x1156('0x46')](_0x243750[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x243750[_0x1156('0x3e')],function(_0x171897){var _0x3f57da={};_0x3f57da[_0x171897]={'$like':'%'+_0x570495[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x3f57da;})});}_0x243750=_[_0x1156('0x46')]({},_0x243750,_0x570495[_0x1156('0x47')]);return _0x167fbf[_0x1156('0x6a')](_0x243750);}})[_0x1156('0x1f')](function(_0x44fddb){if(_0x44fddb){_0x140556=_0x44fddb[_0x1156('0x50')];if(!_0x570495[_0x1156('0x3a')][_0x1156('0x6b')]('nolimit')){_0x243750['limit']=qs[_0x1156('0x41')](_0x570495[_0x1156('0x3a')][_0x1156('0x41')]);_0x243750[_0x1156('0x2d')]=qs['offset'](_0x570495['query'][_0x1156('0x2d')]);}return _0x167fbf[_0x1156('0x6a')](_0x243750);}})[_0x1156('0x1f')](function(_0x5530c2){if(_0x5530c2){return _0x5530c2?{'count':_0x140556,'rows':_0x5530c2}:null;}})[_0x1156('0x1f')](respondWithResult(_0x49c142,null))[_0x1156('0x28')](handleError(_0x49c142,null));};exports['addTeams']=function(_0xf6d283,_0x181ad7,_0x4ded65){var _0x589f3c=_0xf6d283[_0x1156('0x5a')]['ids'];return db[_0x1156('0x69')][_0x1156('0x4b')]({'where':{'id':_0x589f3c},'attributes':['id'],'include':[{'model':db[_0x1156('0x62')],'as':'Agents','attributes':['id',_0x1156('0x35'),_0x1156('0x6c'),'voicePause',_0x1156('0x6d')],'raw':!![]}]})['then'](function(_0x2b6471){if(_0x2b6471){var _0x57fd0a=_['flatMap'](_0x2b6471,function(_0x4608a5){var _0x4ab871=_0x4608a5[_0x1156('0x32')]({'plain':!![]});return _0x4ab871[_0x1156('0x6e')];});return db[_0x1156('0x38')]['find']({'where':{'id':_0xf6d283['params']['id']}})[_0x1156('0x1f')](function(_0x1b69f8){return db['sequelize'][_0x1156('0x6f')](function(_0x449d28){return _0x1b69f8[_0x1156('0x70')](_0x589f3c,{'transaction':_0x449d28})['then'](function(){return BPromise[_0x1156('0x71')](_0x57fd0a,function(_0x44cfc5){return db['UserChatQueue'][_0x1156('0x72')]({'where':{'UserId':_0x44cfc5['id'],'ChatQueueId':_0xf6d283[_0x1156('0x4e')]['id']},'transaction':_0x449d28});});})[_0x1156('0x1f')](function(){_0x57fd0a['forEach'](function(_0x5c9531){socket['emit'](_0x1156('0x73'),{'UserId':_0x5c9531['id'],'ChatQueueId':_0x1b69f8['id']});});});});});}})[_0x1156('0x1f')](respondWithStatusCode(_0x181ad7,null))[_0x1156('0x28')](handleError(_0x181ad7,null));};exports[_0x1156('0x74')]=function(_0x3a8c04,_0x287fe7,_0x55f93f){return db[_0x1156('0x69')][_0x1156('0x4b')]({'where':{'id':_0x3a8c04[_0x1156('0x3a')][_0x1156('0x75')]},'attributes':['id'],'include':[{'model':db[_0x1156('0x62')],'as':_0x1156('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x1156('0x1f')](handleEntityNotFound(_0x287fe7,null))[_0x1156('0x1f')](function(_0x506d17){var _0xc4a316=_[_0x1156('0x37')](_0x506d17,'id');var _0x42071d=[];var _0x157fb4=[];var _0x2daebb=squel[_0x1156('0x76')]();_0x2daebb[_0x1156('0x77')](_0x1156('0x78'))['from']('team_has_chat_queues','tq')['join'](_0x1156('0x79'),'ut',_0x1156('0x7a'))[_0x1156('0x43')](_0x1156('0x7b'),_0x3a8c04['params']['id']);for(var _0x942cbd=0x0;_0x942cbd<_0x506d17['length'];_0x942cbd+=0x1){let _0x27a41d=_0x506d17[_0x942cbd];for(var _0x4f74b5=0x0;_0x4f74b5<_0x27a41d[_0x1156('0x6e')][_0x1156('0x50')];_0x4f74b5+=0x1){let _0x1398a8=_0x27a41d['Agents'][_0x4f74b5];var _0x205486=_0x2daebb[_0x1156('0x7c')]();_0x205486['where'](_0x1156('0x7d'),_0x1398a8['id']);_0x157fb4[_0x1156('0x7e')](db['sequelize'][_0x1156('0x3a')](_0x205486['toString'](),{'type':db['sequelize'][_0x1156('0x7f')][_0x1156('0x80')]})[_0x1156('0x1f')](function(_0x3a47a4){if(_0x3a47a4[_0x1156('0x50')]===0x1){return _0x1398a8['id'];}else{var _0x3ec41a=_[_0x1156('0x81')](_[_0x1156('0x37')](_0x3a47a4,_0x1156('0x82')),function(_0x1f94f7){return _['includes'](_0xc4a316,_0x1f94f7);});if(_0x3ec41a){return _0x1398a8['id'];}}}));}}return BPromise[_0x1156('0x83')](_0x157fb4)['then'](function(_0x2c66c7){_0x42071d=_(_0x42071d)[_0x1156('0x84')](_0x2c66c7)[_0x1156('0x85')]()[_0x1156('0x86')]();return db[_0x1156('0x38')][_0x1156('0x57')]({'where':{'id':_0x3a8c04['params']['id']}})[_0x1156('0x1f')](function(_0x682a63){return db[_0x1156('0x87')]['transaction'](function(_0xf9c4da){return _0x682a63['removeTeams'](_0x3a8c04['query']['ids'],{'transaction':_0xf9c4da})[_0x1156('0x1f')](function(){if(!_[_0x1156('0x88')](_0x42071d)){return _0x682a63[_0x1156('0x89')](_0x42071d,{'transaction':_0xf9c4da});}})['then'](function(){_0x42071d[_0x1156('0x8a')](function(_0x5045d2){socket[_0x1156('0x8b')](_0x1156('0x8c'),{'UserId':_0x5045d2,'ChatQueueId':_0x682a63['id']});});});});});});})[_0x1156('0x1f')](respondWithStatusCode(_0x287fe7,null))[_0x1156('0x28')](handleError(_0x287fe7,null));};exports[_0x1156('0x8d')]=function(_0x4a7bca,_0x7d904d,_0x56579e){return db[_0x1156('0x38')][_0x1156('0x57')]({'where':{'id':_0x4a7bca['params']['id']}})['then'](handleEntityNotFound(_0x7d904d,null))[_0x1156('0x1f')](function(_0x5d6452){if(_0x5d6452){return _0x5d6452[_0x1156('0x8d')](_0x4a7bca[_0x1156('0x5a')][_0x1156('0x75')],_[_0x1156('0x8e')](_0x4a7bca[_0x1156('0x5a')],[_0x1156('0x75'),'id'])||{})[_0x1156('0x8f')](function(_0x1215cb){for(var _0x2dd6ab=0x0;_0x2dd6ab<_0x4a7bca['body'][_0x1156('0x75')][_0x1156('0x50')];_0x2dd6ab+=0x1){socket['emit'](_0x1156('0x73'),{'UserId':_0x4a7bca[_0x1156('0x5a')][_0x1156('0x75')][_0x2dd6ab],'ChatQueueId':_0x4a7bca[_0x1156('0x4e')]['id']});}return _0x1215cb;});}})[_0x1156('0x1f')](respondWithResult(_0x7d904d,null))[_0x1156('0x28')](handleError(_0x7d904d,null));};exports[_0x1156('0x89')]=function(_0x5e5789,_0x42439a,_0x32c46f){return db[_0x1156('0x38')][_0x1156('0x57')]({'where':{'id':_0x5e5789[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x42439a,null))[_0x1156('0x1f')](function(_0x2e4d9b){if(_0x2e4d9b){return _0x2e4d9b['removeAgents'](_0x5e5789[_0x1156('0x3a')][_0x1156('0x75')])[_0x1156('0x1f')](function(){if(_[_0x1156('0x90')](_0x5e5789['query'][_0x1156('0x75')])){for(var _0x37400=0x0;_0x37400<_0x5e5789[_0x1156('0x3a')][_0x1156('0x75')][_0x1156('0x50')];_0x37400+=0x1){socket[_0x1156('0x8b')](_0x1156('0x8c'),{'UserId':Number(_0x5e5789[_0x1156('0x3a')]['ids'][_0x37400]),'ChatQueueId':Number(_0x5e5789[_0x1156('0x4e')]['id'])});}}else{socket[_0x1156('0x8b')](_0x1156('0x8c'),{'UserId':Number(_0x5e5789[_0x1156('0x3a')][_0x1156('0x75')]),'ChatQueueId':Number(_0x5e5789['params']['id'])});}});}})[_0x1156('0x1f')](respondWithStatusCode(_0x42439a,null))[_0x1156('0x28')](handleError(_0x42439a,null));};exports[_0x1156('0x91')]=function(_0x2a65dc,_0x5ee072,_0x2552f0){var _0x51ba08={};var _0x219620={};var _0x1ffe96;var _0x5f2e25;return db[_0x1156('0x38')][_0x1156('0x5d')]({'where':{'id':_0x2a65dc[_0x1156('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5ee072,null))['then'](function(_0x1ada43){if(_0x1ada43){_0x1ffe96=_0x1ada43;_0x219620[_0x1156('0x3d')]=_[_0x1156('0x3b')](db['User'][_0x1156('0x4f')]);_0x219620[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x2a65dc[_0x1156('0x3a')]);_0x219620[_0x1156('0x3c')]=_[_0x1156('0x3f')](_0x219620[_0x1156('0x3d')],_0x219620[_0x1156('0x3a')]);_0x51ba08[_0x1156('0x3e')]=_['intersection'](_0x219620[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x2a65dc[_0x1156('0x3a')]['fields']));_0x51ba08[_0x1156('0x3e')]=_0x51ba08[_0x1156('0x3e')]['length']?_0x51ba08[_0x1156('0x3e')]:_0x219620['model'];_0x51ba08[_0x1156('0x60')]=qs[_0x1156('0x42')](_0x2a65dc[_0x1156('0x3a')][_0x1156('0x42')]);_0x51ba08[_0x1156('0x43')]=qs[_0x1156('0x3c')](_['pick'](_0x2a65dc[_0x1156('0x3a')],_0x219620[_0x1156('0x3c')]));if(_0x2a65dc['query'][_0x1156('0x45')]){_0x51ba08[_0x1156('0x43')]=_['merge'](_0x51ba08[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x51ba08[_0x1156('0x3e')],function(_0xc1a9c){var _0x119a25={};_0x119a25[_0xc1a9c]={'$like':'%'+_0x2a65dc['query'][_0x1156('0x45')]+'%'};return _0x119a25;})});}_0x51ba08=_[_0x1156('0x46')]({},_0x51ba08,_0x2a65dc[_0x1156('0x47')]);return _0x1ffe96['getAgents'](_0x51ba08);}})['then'](function(_0x466571){if(_0x466571){_0x5f2e25=_0x466571[_0x1156('0x50')];if(!_0x2a65dc[_0x1156('0x3a')][_0x1156('0x6b')](_0x1156('0x5f'))){_0x51ba08[_0x1156('0x41')]=qs[_0x1156('0x41')](_0x2a65dc['query']['limit']);_0x51ba08[_0x1156('0x2d')]=qs[_0x1156('0x2d')](_0x2a65dc['query'][_0x1156('0x2d')]);}return _0x1ffe96[_0x1156('0x91')](_0x51ba08);}})['then'](function(_0x1aa2fd){if(_0x1aa2fd){return _0x1aa2fd?{'count':_0x5f2e25,'rows':_0x1aa2fd}:null;}})['then'](respondWithResult(_0x5ee072,null))[_0x1156('0x28')](handleError(_0x5ee072,null));}; \ No newline at end of file +var _0xafb9=['apply','reject','save','then','UserProfileResource','destroy','stack','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','findAll','show','params','includeAll','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','userProfileId','autoAssociation','update','body','describe','getMembers','order','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','findOne','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserChatQueue','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','Team','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json'];(function(_0x4b9c42,_0x31b2ec){var _0x41811b=function(_0x54feb2){while(--_0x54feb2){_0x4b9c42['push'](_0x4b9c42['shift']());}};_0x41811b(++_0x31b2ec);}(_0xafb9,0x68));var _0x9afb=function(_0x4f853a,_0x3a8c9f){_0x4f853a=_0x4f853a-0x0;var _0x59589b=_0xafb9[_0x4f853a];return _0x59589b;};'use strict';var pdf=require(_0x9afb('0x0'));var emlformat=require(_0x9afb('0x1'));var rimraf=require(_0x9afb('0x2'));var zipdir=require(_0x9afb('0x3'));var jsonpatch=require(_0x9afb('0x4'));var rp=require(_0x9afb('0x5'));var moment=require(_0x9afb('0x6'));var BPromise=require(_0x9afb('0x7'));var Mustache=require(_0x9afb('0x8'));var util=require('util');var path=require('path');var sox=require(_0x9afb('0x9'));var csv=require('to-csv');var ejs=require(_0x9afb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9afb('0xb'));var jsforce=require(_0x9afb('0xc'));var deskjs=require(_0x9afb('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9afb('0xe'));var Papa=require(_0x9afb('0xf'));var Redis=require(_0x9afb('0x10'));var authService=require(_0x9afb('0x11'));var qs=require(_0x9afb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9afb('0x13'))(_0x9afb('0x14'));var utils=require(_0x9afb('0x15'));var config=require(_0x9afb('0x16'));var db=require(_0x9afb('0x17'))['db'];config[_0x9afb('0x18')]=_[_0x9afb('0x19')](config[_0x9afb('0x18')],{'host':_0x9afb('0x1a'),'port':0x18eb});var socket=require(_0x9afb('0x1b'))(new Redis(config['redis']));require(_0x9afb('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x9afb('0x1d')][_0x9afb('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3c8d2e,_0x2d664d,_0x46b16f){if(_0x46b16f){var _0x39cdf1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39cdf1[_0x9afb('0x1f')](_0x2d664d)){return _0x3c8d2e;}else{throw new db['Sequelize'][(_0x9afb('0x20'))](_0x9afb('0x21'));}}else{return _0x3c8d2e;}}function respondWithRpcPromise(_0x23b906,_0x190cb8,_0x223aef,_0x508433){return new BPromise(function(_0x201ff4,_0x50a7e4){var _0x3fdb34=_0x508433||client;return _0x3fdb34[_0x9afb('0x22')](_0x23b906,_0x223aef)['then'](function(_0x4a1c74){logger[_0x9afb('0x23')](_0x9afb('0x24'),_0x190cb8,_0x9afb('0x25'));logger[_0x9afb('0x26')](_0x9afb('0x27'),_0x190cb8,'request\x20sent',JSON[_0x9afb('0x28')](_0x4a1c74));if(_0x4a1c74['error']){if(_0x4a1c74['error'][_0x9afb('0x29')]===0x1f4){logger[_0x9afb('0x2a')](_0x9afb('0x24'),_0x190cb8,_0x4a1c74[_0x9afb('0x2a')]['message']);return _0x50a7e4(_0x4a1c74[_0x9afb('0x2a')][_0x9afb('0x2b')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x190cb8,_0x4a1c74['error'][_0x9afb('0x2b')]);return _0x201ff4(_0x4a1c74['error'][_0x9afb('0x2b')]);}else{logger[_0x9afb('0x23')]('ChatQueue,\x20%s,\x20%s',_0x190cb8,_0x9afb('0x25'));_0x201ff4(_0x4a1c74[_0x9afb('0x2c')][_0x9afb('0x2b')]);}})[_0x9afb('0x2d')](function(_0x530fbe){logger[_0x9afb('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x190cb8,_0x530fbe);_0x50a7e4(_0x530fbe);});});}function respondWithStatusCode(_0x29e092,_0x4ad975){_0x4ad975=_0x4ad975||0xcc;return function(_0x5692fa){if(_0x5692fa){return _0x29e092[_0x9afb('0x2e')](_0x4ad975);}return _0x29e092[_0x9afb('0x2f')](_0x4ad975)[_0x9afb('0x30')]();};}function respondWithResult(_0x13a33e,_0x119e04){_0x119e04=_0x119e04||0xc8;return function(_0x3e3f57){if(_0x3e3f57){return _0x13a33e[_0x9afb('0x2f')](_0x119e04)['json'](_0x3e3f57);}};}function respondWithFilteredResult(_0x494ef8,_0x1cc791){return function(_0x433fc1){if(_0x433fc1){var _0x503bf7=_0x433fc1[_0x9afb('0x31')],_0x1d0bed=_0x1cc791[_0x9afb('0x32')],_0x2f388c=_0x1cc791[_0x9afb('0x32')]+_0x1cc791[_0x9afb('0x33')],_0x5560bd;if(_0x2f388c>=_0x503bf7){_0x2f388c=_0x503bf7;_0x5560bd=0xc8;}else{_0x5560bd=0xce;}_0x494ef8[_0x9afb('0x2f')](_0x5560bd);return _0x494ef8[_0x9afb('0x34')](_0x9afb('0x35'),_0x1d0bed+'-'+_0x2f388c+'/'+_0x503bf7)[_0x9afb('0x36')](_0x433fc1);}return null;};}function patchUpdates(_0x57fcc5){return function(_0x488a35){try{jsonpatch[_0x9afb('0x37')](_0x488a35,_0x57fcc5,!![]);}catch(_0x1e377c){return BPromise[_0x9afb('0x38')](_0x1e377c);}return _0x488a35[_0x9afb('0x39')]();};}function saveUpdates(_0x1a8d78,_0x313816){return function(_0x2f92e4){if(_0x2f92e4){return _0x2f92e4['update'](_0x1a8d78)['then'](function(_0x67d63a){return _0x67d63a;});}return null;};}function removeEntity(_0x18c03,_0x559a52){return function(_0x290112){if(_0x290112){return _0x290112['destroy']()[_0x9afb('0x3a')](function(){var _0xc59d55=_0x290112['get']({'plain':!![]});var _0x2ea8ff='ChatQueues';return db[_0x9afb('0x3b')][_0x9afb('0x3c')]({'where':{'type':_0x2ea8ff,'resourceId':_0xc59d55['id']}})[_0x9afb('0x3a')](function(){return _0x290112;});})[_0x9afb('0x3a')](function(){_0x18c03[_0x9afb('0x2f')](0xcc)[_0x9afb('0x30')]();});}};}function handleEntityNotFound(_0x19227f,_0x334c2b){return function(_0x5531b7){if(!_0x5531b7){_0x19227f[_0x9afb('0x2e')](0x194);}return _0x5531b7;};}function handleError(_0x52748b,_0x44b2d1){_0x44b2d1=_0x44b2d1||0x1f4;return function(_0x6ac20f){logger[_0x9afb('0x2a')](_0x6ac20f[_0x9afb('0x3d')]);if(_0x6ac20f[_0x9afb('0x3e')]){delete _0x6ac20f[_0x9afb('0x3e')];}_0x52748b[_0x9afb('0x2f')](_0x44b2d1)[_0x9afb('0x3f')](_0x6ac20f);};}exports[_0x9afb('0x40')]=function(_0x4d16ba,_0x26de3e){var _0x56f8d9={},_0x1b5db0={},_0xc95d27={'count':0x0,'rows':[]};var _0x1cce9c=_['map'](db[_0x9afb('0x41')][_0x9afb('0x42')],function(_0x318746){return{'name':_0x318746[_0x9afb('0x43')],'type':_0x318746[_0x9afb('0x44')][_0x9afb('0x45')]};});_0x1b5db0[_0x9afb('0x46')]=_['map'](_0x1cce9c,_0x9afb('0x3e'));_0x1b5db0[_0x9afb('0x47')]=_[_0x9afb('0x48')](_0x4d16ba[_0x9afb('0x47')]);_0x1b5db0[_0x9afb('0x49')]=_[_0x9afb('0x4a')](_0x1b5db0[_0x9afb('0x46')],_0x1b5db0[_0x9afb('0x47')]);_0x56f8d9['attributes']=_[_0x9afb('0x4a')](_0x1b5db0['model'],qs['fields'](_0x4d16ba['query'][_0x9afb('0x4b')]));_0x56f8d9[_0x9afb('0x4c')]=_0x56f8d9['attributes'][_0x9afb('0x4d')]?_0x56f8d9[_0x9afb('0x4c')]:_0x1b5db0[_0x9afb('0x46')];if(!_0x4d16ba[_0x9afb('0x47')][_0x9afb('0x4e')](_0x9afb('0x4f'))){_0x56f8d9[_0x9afb('0x33')]=qs[_0x9afb('0x33')](_0x4d16ba[_0x9afb('0x47')]['limit']);_0x56f8d9[_0x9afb('0x32')]=qs[_0x9afb('0x32')](_0x4d16ba[_0x9afb('0x47')][_0x9afb('0x32')]);}_0x56f8d9['order']=qs[_0x9afb('0x50')](_0x4d16ba[_0x9afb('0x47')][_0x9afb('0x50')]);_0x56f8d9['where']=qs[_0x9afb('0x49')](_[_0x9afb('0x51')](_0x4d16ba[_0x9afb('0x47')],_0x1b5db0[_0x9afb('0x49')]));if(_0x4d16ba[_0x9afb('0x47')][_0x9afb('0x52')]){_0x56f8d9[_0x9afb('0x53')]=_['merge'](_0x56f8d9['where'],{'$or':_['map'](_0x1cce9c,function(_0x414645){if(_0x414645[_0x9afb('0x44')]!=='VIRTUAL'){var _0x20bd33={};_0x20bd33[_0x414645[_0x9afb('0x3e')]]={'$like':'%'+_0x4d16ba[_0x9afb('0x47')][_0x9afb('0x52')]+'%'};return _0x20bd33;}})});}_0x56f8d9=_[_0x9afb('0x54')]({},_0x56f8d9,_0x4d16ba[_0x9afb('0x55')]);var _0xdb82c3={'where':_0x56f8d9[_0x9afb('0x53')]};return db[_0x9afb('0x41')][_0x9afb('0x31')](_0xdb82c3)[_0x9afb('0x3a')](function(_0x47df73){_0xc95d27['count']=_0x47df73;if(_0x4d16ba[_0x9afb('0x47')]['includeAll']){_0x56f8d9[_0x9afb('0x56')]=[{'all':!![]}];}return db[_0x9afb('0x41')][_0x9afb('0x57')](_0x56f8d9);})[_0x9afb('0x3a')](function(_0xaecb0f){_0xc95d27['rows']=_0xaecb0f;return _0xc95d27;})[_0x9afb('0x3a')](respondWithFilteredResult(_0x26de3e,_0x56f8d9))['catch'](handleError(_0x26de3e,null));};exports[_0x9afb('0x58')]=function(_0x222ee0,_0x18ca7a){var _0x16afe1={'raw':!![],'where':{'id':_0x222ee0[_0x9afb('0x59')]['id']}},_0xa391de={};_0xa391de[_0x9afb('0x46')]=_['keys'](db[_0x9afb('0x41')][_0x9afb('0x42')]);_0xa391de[_0x9afb('0x47')]=_['keys'](_0x222ee0[_0x9afb('0x47')]);_0xa391de[_0x9afb('0x49')]=_['intersection'](_0xa391de[_0x9afb('0x46')],_0xa391de[_0x9afb('0x47')]);_0x16afe1[_0x9afb('0x4c')]=_['intersection'](_0xa391de[_0x9afb('0x46')],qs[_0x9afb('0x4b')](_0x222ee0['query']['fields']));_0x16afe1['attributes']=_0x16afe1[_0x9afb('0x4c')]['length']?_0x16afe1[_0x9afb('0x4c')]:_0xa391de['model'];if(_0x222ee0[_0x9afb('0x47')][_0x9afb('0x5a')]){_0x16afe1[_0x9afb('0x56')]=[{'all':!![]}];}_0x16afe1=_['merge']({},_0x16afe1,_0x222ee0[_0x9afb('0x55')]);return db[_0x9afb('0x41')][_0x9afb('0x5b')](_0x16afe1)[_0x9afb('0x3a')](handleEntityNotFound(_0x18ca7a,null))[_0x9afb('0x3a')](respondWithResult(_0x18ca7a,null))[_0x9afb('0x2d')](handleError(_0x18ca7a,null));};exports['create']=function(_0x2f889d,_0x11b098){return db[_0x9afb('0x41')][_0x9afb('0x5c')](_0x2f889d['body'],{})[_0x9afb('0x3a')](function(_0x344164){var _0x555ff0=_0x2f889d[_0x9afb('0x5d')][_0x9afb('0x5e')]({'plain':!![]});if(!_0x555ff0)throw new Error(_0x9afb('0x5f'));if(_0x555ff0['role']===_0x9afb('0x5d')){var _0x12b44e=_0x344164[_0x9afb('0x5e')]({'plain':!![]});var _0x41bb8e=_0x9afb('0x60');return db[_0x9afb('0x61')][_0x9afb('0x5b')]({'where':{'name':_0x41bb8e,'userProfileId':_0x555ff0[_0x9afb('0x62')]},'raw':!![]})[_0x9afb('0x3a')](function(_0xd6ba91){if(_0xd6ba91&&_0xd6ba91[_0x9afb('0x63')]===0x0){return db[_0x9afb('0x3b')][_0x9afb('0x5c')]({'name':_0x12b44e['name'],'resourceId':_0x12b44e['id'],'type':_0xd6ba91[_0x9afb('0x3e')],'sectionId':_0xd6ba91['id']},{})[_0x9afb('0x3a')](function(){return _0x344164;});}else{return _0x344164;}})['catch'](function(_0x2ea749){logger[_0x9afb('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ea749);throw _0x2ea749;});}return _0x344164;})['then'](respondWithResult(_0x11b098,0xc9))[_0x9afb('0x2d')](handleError(_0x11b098,null));};exports[_0x9afb('0x64')]=function(_0x297cb6,_0x1fb0b6){if(_0x297cb6[_0x9afb('0x65')]['id']){delete _0x297cb6['body']['id'];}return db[_0x9afb('0x41')][_0x9afb('0x5b')]({'where':{'id':_0x297cb6[_0x9afb('0x59')]['id']}})[_0x9afb('0x3a')](handleEntityNotFound(_0x1fb0b6,null))[_0x9afb('0x3a')](saveUpdates(_0x297cb6[_0x9afb('0x65')],null))[_0x9afb('0x3a')](respondWithResult(_0x1fb0b6,null))[_0x9afb('0x2d')](handleError(_0x1fb0b6,null));};exports['destroy']=function(_0x16d7f5,_0x5f2d69){return db[_0x9afb('0x41')][_0x9afb('0x5b')]({'where':{'id':_0x16d7f5[_0x9afb('0x59')]['id']}})[_0x9afb('0x3a')](handleEntityNotFound(_0x5f2d69,null))[_0x9afb('0x3a')](removeEntity(_0x5f2d69,null))['catch'](handleError(_0x5f2d69,null));};exports['describe']=function(_0x32ba83,_0x35ea5a){return db[_0x9afb('0x41')][_0x9afb('0x66')]()[_0x9afb('0x3a')](respondWithResult(_0x35ea5a,null))['catch'](handleError(_0x35ea5a,null));};exports[_0x9afb('0x67')]=function(_0x3bdd7c,_0x4da082,_0x368c4b){var _0x4674b5={'raw':!![],'where':{}},_0x480c4a={},_0x35e55f;return db[_0x9afb('0x41')]['findOne']({'where':{'id':_0x3bdd7c[_0x9afb('0x59')]['id']}})['then'](handleEntityNotFound(_0x4da082,null))[_0x9afb('0x3a')](function(_0x112359){if(_0x112359){_0x35e55f=_0x112359[_0x9afb('0x5e')]({'plain':!![]});_0x480c4a[_0x9afb('0x46')]=_[_0x9afb('0x48')](db['UserChatQueue']['rawAttributes']);_0x480c4a[_0x9afb('0x47')]=_[_0x9afb('0x48')](_0x3bdd7c[_0x9afb('0x47')]);_0x480c4a['filters']=_[_0x9afb('0x4a')](_0x480c4a[_0x9afb('0x46')],_0x480c4a[_0x9afb('0x47')]);_0x4674b5[_0x9afb('0x4c')]=_[_0x9afb('0x4a')](_0x480c4a[_0x9afb('0x46')],qs[_0x9afb('0x4b')](_0x3bdd7c[_0x9afb('0x47')][_0x9afb('0x4b')]));_0x4674b5[_0x9afb('0x4c')]=_0x4674b5['attributes'][_0x9afb('0x4d')]?_0x4674b5['attributes']:_0x480c4a[_0x9afb('0x46')];if(!_0x3bdd7c[_0x9afb('0x47')][_0x9afb('0x4e')]('nolimit')){_0x4674b5[_0x9afb('0x33')]=qs['limit'](_0x3bdd7c[_0x9afb('0x47')][_0x9afb('0x33')]);_0x4674b5['offset']=qs[_0x9afb('0x32')](_0x3bdd7c[_0x9afb('0x47')][_0x9afb('0x32')]);}_0x4674b5[_0x9afb('0x68')]=qs['sort'](_0x3bdd7c[_0x9afb('0x47')][_0x9afb('0x50')]);_0x4674b5[_0x9afb('0x53')]=qs[_0x9afb('0x49')](_[_0x9afb('0x51')](_0x3bdd7c['query'],_0x480c4a[_0x9afb('0x49')]));_0x4674b5[_0x9afb('0x53')]['ChatQueueId']=_0x112359['id'];if(_0x3bdd7c[_0x9afb('0x47')][_0x9afb('0x52')]){_0x4674b5[_0x9afb('0x53')]=_[_0x9afb('0x54')](_0x4674b5['where'],{'$or':_[_0x9afb('0x69')](_0x4674b5[_0x9afb('0x4c')],function(_0x23b2a5){var _0x2be34b={};_0x2be34b[_0x23b2a5]={'$like':'%'+_0x3bdd7c[_0x9afb('0x47')][_0x9afb('0x52')]+'%'};return _0x2be34b;})});}_0x4674b5=_['merge']({},_0x4674b5,_0x3bdd7c[_0x9afb('0x55')]);return db['UserChatQueue'][_0x9afb('0x57')](_0x4674b5);}})[_0x9afb('0x3a')](function(_0x1d92e8){if(_0x1d92e8){return db[_0x9afb('0x6a')][_0x9afb('0x6b')]({'where':{'id':_[_0x9afb('0x69')](_0x1d92e8,_0x9afb('0x6c')),'role':_0x9afb('0x6d')},'attributes':['id','name',_0x9afb('0x6e'),_0x9afb('0x6f'),_0x9afb('0x70')]});}})[_0x9afb('0x3a')](function(_0x3745b1){if(_0x3745b1){return{'count':_0x3745b1[_0x9afb('0x31')],'rows':_[_0x9afb('0x69')](_0x3745b1[_0x9afb('0x71')],function(_0x470ecd){return{'membername':_0x470ecd['name'],'UserId':_0x470ecd['id'],'queue_name':_0x35e55f[_0x9afb('0x3e')],'ChatQueueId':_0x35e55f['id'],'interface':util[_0x9afb('0x72')](_0x9afb('0x73'),_0x9afb('0x74'),_0x470ecd[_0x9afb('0x3e')]),'penalty':0x0,'paused':_0x470ecd[_0x9afb('0x6e')],'createdAt':_0x470ecd['createdAt'],'updatedAt':_0x470ecd[_0x9afb('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9afb('0x3a')](respondWithFilteredResult(_0x4da082,_0x4674b5))[_0x9afb('0x2d')](handleError(_0x4da082,null));};exports[_0x9afb('0x75')]=function(_0x500617,_0x372aed,_0x42de38){var _0xcdc629={};var _0x23bdca={};var _0x548350;var _0x24267f;return db['ChatQueue'][_0x9afb('0x76')]({'where':{'id':_0x500617['params']['id']}})[_0x9afb('0x3a')](handleEntityNotFound(_0x372aed,null))[_0x9afb('0x3a')](function(_0x3d16ea){if(_0x3d16ea){_0x548350=_0x3d16ea;_0x23bdca['model']=_[_0x9afb('0x48')](db['Team']['rawAttributes']);_0x23bdca[_0x9afb('0x47')]=_['keys'](_0x500617[_0x9afb('0x47')]);_0x23bdca[_0x9afb('0x49')]=_['intersection'](_0x23bdca['model'],_0x23bdca[_0x9afb('0x47')]);_0xcdc629[_0x9afb('0x4c')]=_['intersection'](_0x23bdca[_0x9afb('0x46')],qs[_0x9afb('0x4b')](_0x500617[_0x9afb('0x47')]['fields']));_0xcdc629['attributes']=_0xcdc629[_0x9afb('0x4c')][_0x9afb('0x4d')]?_0xcdc629[_0x9afb('0x4c')]:_0x23bdca[_0x9afb('0x46')];_0xcdc629[_0x9afb('0x68')]=qs[_0x9afb('0x50')](_0x500617[_0x9afb('0x47')][_0x9afb('0x50')]);_0xcdc629[_0x9afb('0x53')]=qs[_0x9afb('0x49')](_['pick'](_0x500617[_0x9afb('0x47')],_0x23bdca[_0x9afb('0x49')]));if(_0x500617['query'][_0x9afb('0x52')]){_0xcdc629['where']=_[_0x9afb('0x54')](_0xcdc629[_0x9afb('0x53')],{'$or':_[_0x9afb('0x69')](_0xcdc629[_0x9afb('0x4c')],function(_0x538303){var _0x357f57={};_0x357f57[_0x538303]={'$like':'%'+_0x500617['query'][_0x9afb('0x52')]+'%'};return _0x357f57;})});}_0xcdc629=_[_0x9afb('0x54')]({},_0xcdc629,_0x500617[_0x9afb('0x55')]);return _0x548350[_0x9afb('0x75')](_0xcdc629);}})[_0x9afb('0x3a')](function(_0x4e5467){if(_0x4e5467){_0x24267f=_0x4e5467['length'];if(!_0x500617[_0x9afb('0x47')]['hasOwnProperty'](_0x9afb('0x4f'))){_0xcdc629[_0x9afb('0x33')]=qs[_0x9afb('0x33')](_0x500617[_0x9afb('0x47')]['limit']);_0xcdc629[_0x9afb('0x32')]=qs[_0x9afb('0x32')](_0x500617[_0x9afb('0x47')]['offset']);}return _0x548350[_0x9afb('0x75')](_0xcdc629);}})[_0x9afb('0x3a')](function(_0x24d635){if(_0x24d635){return _0x24d635?{'count':_0x24267f,'rows':_0x24d635}:null;}})['then'](respondWithResult(_0x372aed,null))[_0x9afb('0x2d')](handleError(_0x372aed,null));};exports[_0x9afb('0x77')]=function(_0x4d558a,_0x5b2efa,_0x422edb){var _0x2f03cd=_0x4d558a[_0x9afb('0x65')][_0x9afb('0x78')];return db['Team'][_0x9afb('0x57')]({'where':{'id':_0x2f03cd},'attributes':['id'],'include':[{'model':db[_0x9afb('0x6a')],'as':_0x9afb('0x79'),'attributes':['id',_0x9afb('0x3e'),_0x9afb('0x7a'),_0x9afb('0x7b'),_0x9afb('0x7c')],'raw':!![]}]})[_0x9afb('0x3a')](function(_0x59d8bd){if(_0x59d8bd){var _0x788fdf=_[_0x9afb('0x7d')](_0x59d8bd,function(_0xd590b3){var _0x2c7a5b=_0xd590b3[_0x9afb('0x5e')]({'plain':!![]});return _0x2c7a5b[_0x9afb('0x79')];});return db[_0x9afb('0x41')][_0x9afb('0x5b')]({'where':{'id':_0x4d558a['params']['id']}})[_0x9afb('0x3a')](function(_0x5e5325){return db[_0x9afb('0x7e')][_0x9afb('0x7f')](function(_0x3fb617){return _0x5e5325[_0x9afb('0x77')](_0x2f03cd,{'transaction':_0x3fb617})['then'](function(){return BPromise[_0x9afb('0x80')](_0x788fdf,function(_0x57d170){return db[_0x9afb('0x81')][_0x9afb('0x82')]({'where':{'UserId':_0x57d170['id'],'ChatQueueId':_0x4d558a['params']['id']},'transaction':_0x3fb617});});})[_0x9afb('0x3a')](function(){_0x788fdf[_0x9afb('0x83')](function(_0x1c0150){socket[_0x9afb('0x84')](_0x9afb('0x85'),{'UserId':_0x1c0150['id'],'ChatQueueId':_0x5e5325['id']});});});});});}})[_0x9afb('0x3a')](respondWithStatusCode(_0x5b2efa,null))[_0x9afb('0x2d')](handleError(_0x5b2efa,null));};exports[_0x9afb('0x86')]=function(_0x25e978,_0x6d394d,_0x17fc1c){return db[_0x9afb('0x87')][_0x9afb('0x57')]({'where':{'id':_0x25e978[_0x9afb('0x47')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x9afb('0x3a')](handleEntityNotFound(_0x6d394d,null))['then'](function(_0x5a588d){var _0x5e0ae0=_[_0x9afb('0x69')](_0x5a588d,'id');var _0x50b3d1=[];var _0x670756=[];var _0x128d00=squel[_0x9afb('0x88')]();_0x128d00[_0x9afb('0x89')]('tq.TeamId')[_0x9afb('0x8a')](_0x9afb('0x8b'),'tq')[_0x9afb('0x8c')](_0x9afb('0x8d'),'ut',_0x9afb('0x8e'))[_0x9afb('0x53')]('ChatQueueId\x20=\x20?',_0x25e978['params']['id']);for(var _0xcb4d9b=0x0;_0xcb4d9b<_0x5a588d['length'];_0xcb4d9b+=0x1){let _0x51df3c=_0x5a588d[_0xcb4d9b];for(var _0xbe6d1b=0x0;_0xbe6d1b<_0x51df3c['Agents'][_0x9afb('0x4d')];_0xbe6d1b+=0x1){let _0x22cc81=_0x51df3c[_0x9afb('0x79')][_0xbe6d1b];var _0x36d44a=_0x128d00[_0x9afb('0x8f')]();_0x36d44a['where']('ut.UserId\x20=\x20?',_0x22cc81['id']);_0x670756[_0x9afb('0x90')](db['sequelize'][_0x9afb('0x47')](_0x36d44a[_0x9afb('0x91')](),{'type':db[_0x9afb('0x7e')][_0x9afb('0x92')][_0x9afb('0x93')]})[_0x9afb('0x3a')](function(_0x27c6ca){if(_0x27c6ca[_0x9afb('0x4d')]===0x1){return _0x22cc81['id'];}else{var _0x378014=_['every'](_[_0x9afb('0x69')](_0x27c6ca,_0x9afb('0x94')),function(_0x212c16){return _[_0x9afb('0x95')](_0x5e0ae0,_0x212c16);});if(_0x378014){return _0x22cc81['id'];}}}));}}return BPromise['all'](_0x670756)[_0x9afb('0x3a')](function(_0x47b2ca){_0x50b3d1=_(_0x50b3d1)[_0x9afb('0x96')](_0x47b2ca)[_0x9afb('0x97')]()[_0x9afb('0x98')]();return db[_0x9afb('0x41')]['find']({'where':{'id':_0x25e978[_0x9afb('0x59')]['id']}})[_0x9afb('0x3a')](function(_0x4c47a6){return db['sequelize'][_0x9afb('0x7f')](function(_0xbdae26){return _0x4c47a6['removeTeams'](_0x25e978[_0x9afb('0x47')]['ids'],{'transaction':_0xbdae26})[_0x9afb('0x3a')](function(){if(!_['isEmpty'](_0x50b3d1)){return _0x4c47a6[_0x9afb('0x99')](_0x50b3d1,{'transaction':_0xbdae26});}})[_0x9afb('0x3a')](function(){_0x50b3d1[_0x9afb('0x83')](function(_0x368ded){socket['emit'](_0x9afb('0x9a'),{'UserId':_0x368ded,'ChatQueueId':_0x4c47a6['id']});});});});});});})[_0x9afb('0x3a')](respondWithStatusCode(_0x6d394d,null))[_0x9afb('0x2d')](handleError(_0x6d394d,null));};exports[_0x9afb('0x9b')]=function(_0x382727,_0x49eb22,_0x3d1336){return db['ChatQueue'][_0x9afb('0x5b')]({'where':{'id':_0x382727[_0x9afb('0x59')]['id']}})[_0x9afb('0x3a')](handleEntityNotFound(_0x49eb22,null))[_0x9afb('0x3a')](function(_0x5b0046){if(_0x5b0046){return _0x5b0046[_0x9afb('0x9b')](_0x382727[_0x9afb('0x65')][_0x9afb('0x78')],_[_0x9afb('0x9c')](_0x382727[_0x9afb('0x65')],['ids','id'])||{})[_0x9afb('0x9d')](function(_0x45f129){for(var _0x49a8dc=0x0;_0x49a8dc<_0x382727[_0x9afb('0x65')][_0x9afb('0x78')]['length'];_0x49a8dc+=0x1){socket['emit'](_0x9afb('0x85'),{'UserId':_0x382727['body'][_0x9afb('0x78')][_0x49a8dc],'ChatQueueId':_0x382727[_0x9afb('0x59')]['id']});}return _0x45f129;});}})['then'](respondWithResult(_0x49eb22,null))[_0x9afb('0x2d')](handleError(_0x49eb22,null));};exports[_0x9afb('0x99')]=function(_0x3d7139,_0x2599de,_0x58e701){return db[_0x9afb('0x41')][_0x9afb('0x5b')]({'where':{'id':_0x3d7139['params']['id']}})[_0x9afb('0x3a')](handleEntityNotFound(_0x2599de,null))['then'](function(_0x1643a5){if(_0x1643a5){return _0x1643a5['removeAgents'](_0x3d7139[_0x9afb('0x47')][_0x9afb('0x78')])[_0x9afb('0x3a')](function(){if(_['isArray'](_0x3d7139[_0x9afb('0x47')][_0x9afb('0x78')])){for(var _0x475036=0x0;_0x475036<_0x3d7139[_0x9afb('0x47')][_0x9afb('0x78')][_0x9afb('0x4d')];_0x475036+=0x1){socket[_0x9afb('0x84')](_0x9afb('0x9a'),{'UserId':Number(_0x3d7139[_0x9afb('0x47')][_0x9afb('0x78')][_0x475036]),'ChatQueueId':Number(_0x3d7139[_0x9afb('0x59')]['id'])});}}else{socket[_0x9afb('0x84')](_0x9afb('0x9a'),{'UserId':Number(_0x3d7139[_0x9afb('0x47')][_0x9afb('0x78')]),'ChatQueueId':Number(_0x3d7139[_0x9afb('0x59')]['id'])});}});}})['then'](respondWithStatusCode(_0x2599de,null))[_0x9afb('0x2d')](handleError(_0x2599de,null));};exports['getAgents']=function(_0x5cf244,_0x1f631b,_0x135ab2){var _0x132fe4={};var _0xc3d7fc={};var _0x1e509e;var _0x4b56a5;return db[_0x9afb('0x41')][_0x9afb('0x76')]({'where':{'id':_0x5cf244['params']['id']}})[_0x9afb('0x3a')](handleEntityNotFound(_0x1f631b,null))[_0x9afb('0x3a')](function(_0x11a7a8){if(_0x11a7a8){_0x1e509e=_0x11a7a8;_0xc3d7fc[_0x9afb('0x46')]=_[_0x9afb('0x48')](db[_0x9afb('0x6a')]['rawAttributes']);_0xc3d7fc[_0x9afb('0x47')]=_[_0x9afb('0x48')](_0x5cf244[_0x9afb('0x47')]);_0xc3d7fc[_0x9afb('0x49')]=_[_0x9afb('0x4a')](_0xc3d7fc[_0x9afb('0x46')],_0xc3d7fc[_0x9afb('0x47')]);_0x132fe4[_0x9afb('0x4c')]=_[_0x9afb('0x4a')](_0xc3d7fc[_0x9afb('0x46')],qs[_0x9afb('0x4b')](_0x5cf244['query'][_0x9afb('0x4b')]));_0x132fe4[_0x9afb('0x4c')]=_0x132fe4[_0x9afb('0x4c')][_0x9afb('0x4d')]?_0x132fe4[_0x9afb('0x4c')]:_0xc3d7fc[_0x9afb('0x46')];_0x132fe4[_0x9afb('0x68')]=qs['sort'](_0x5cf244[_0x9afb('0x47')][_0x9afb('0x50')]);_0x132fe4[_0x9afb('0x53')]=qs[_0x9afb('0x49')](_[_0x9afb('0x51')](_0x5cf244[_0x9afb('0x47')],_0xc3d7fc[_0x9afb('0x49')]));if(_0x5cf244[_0x9afb('0x47')][_0x9afb('0x52')]){_0x132fe4[_0x9afb('0x53')]=_[_0x9afb('0x54')](_0x132fe4['where'],{'$or':_[_0x9afb('0x69')](_0x132fe4[_0x9afb('0x4c')],function(_0x3befe1){var _0x4d399a={};_0x4d399a[_0x3befe1]={'$like':'%'+_0x5cf244['query'][_0x9afb('0x52')]+'%'};return _0x4d399a;})});}_0x132fe4=_[_0x9afb('0x54')]({},_0x132fe4,_0x5cf244[_0x9afb('0x55')]);return _0x1e509e[_0x9afb('0x9e')](_0x132fe4);}})[_0x9afb('0x3a')](function(_0x3741d9){if(_0x3741d9){_0x4b56a5=_0x3741d9['length'];if(!_0x5cf244[_0x9afb('0x47')][_0x9afb('0x4e')](_0x9afb('0x4f'))){_0x132fe4[_0x9afb('0x33')]=qs[_0x9afb('0x33')](_0x5cf244[_0x9afb('0x47')]['limit']);_0x132fe4[_0x9afb('0x32')]=qs[_0x9afb('0x32')](_0x5cf244[_0x9afb('0x47')]['offset']);}return _0x1e509e[_0x9afb('0x9e')](_0x132fe4);}})['then'](function(_0xec6822){if(_0xec6822){return _0xec6822?{'count':_0x4b56a5,'rows':_0xec6822}:null;}})[_0x9afb('0x3a')](respondWithResult(_0x1f631b,null))[_0x9afb('0x2d')](handleError(_0x1f631b,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index f2cad77..62c981c 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 _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x4bede9,_0x3787e9){var _0x37458d=function(_0x324ef8){while(--_0x324ef8){_0x4bede9['push'](_0x4bede9['shift']());}};_0x37458d(++_0x3787e9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x313d6a,_0x10d4b1){_0x313d6a=_0x313d6a-0x0;var _0x2109c9=_0x5f2f[_0x313d6a];return _0x2109c9;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file +var _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x381a1d,_0x4c3269){var _0x106dee=function(_0x3ea3a1){while(--_0x3ea3a1){_0x381a1d['push'](_0x381a1d['shift']());}};_0x106dee(++_0x4c3269);}(_0x0b0e,0x187));var _0xe0b0=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0x0b0e[_0x15ec4e];return _0xb5e5dd;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 2376bd1..8565aa7 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 _0x5147=['chat_queues','lodash','util','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x5147,0x10f));var _0x7514=function(_0xa2440f,_0x47e3cb){_0xa2440f=_0xa2440f-0x0;var _0x128e62=_0x5147[_0xa2440f];return _0x128e62;};'use strict';var _=require(_0x7514('0x0'));var util=require(_0x7514('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7514('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7514('0x3'));var rimraf=require(_0x7514('0x4'));var config=require(_0x7514('0x5'));var attributes=require(_0x7514('0x6'));module[_0x7514('0x7')]=function(_0x21ba66,_0xc2b0ce){return _0x21ba66[_0x7514('0x8')]('ChatQueue',attributes,{'tableName':_0x7514('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1008=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','chat_queues','../../config/logger'];(function(_0x2707a4,_0x8f0b3b){var _0x27d08e=function(_0x179adc){while(--_0x179adc){_0x2707a4['push'](_0x2707a4['shift']());}};_0x27d08e(++_0x8f0b3b);}(_0x1008,0x11f));var _0x8100=function(_0x199bc4,_0x338105){_0x199bc4=_0x199bc4-0x0;var _0x136ffb=_0x1008[_0x199bc4];return _0x136ffb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8100('0x0'))('api');var moment=require('moment');var BPromise=require(_0x8100('0x1'));var rp=require(_0x8100('0x2'));var fs=require('fs');var path=require(_0x8100('0x3'));var rimraf=require(_0x8100('0x4'));var config=require(_0x8100('0x5'));var attributes=require('./chatQueue.attributes');module[_0x8100('0x6')]=function(_0x3c829c,_0x4f9a0c){return _0x3c829c[_0x8100('0x7')]('ChatQueue',attributes,{'tableName':_0x8100('0x8'),'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 db142c3..d04273a 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 _0x5f2f=['http','redis','defaults','localhost','socket.io-emitter','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0xfafaf3,_0xf331d2){var _0x2ff858=function(_0x2456b1){while(--_0x2456b1){_0xfafaf3['push'](_0xfafaf3['shift']());}};_0x2ff858(++_0xf331d2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40c23c,_0x1adc11){_0x40c23c=_0x40c23c-0x0;var _0x3a1919=_0x5f2f[_0x40c23c];return _0x3a1919;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./chatQueue.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['GetChatQueue']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')]({'raw':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![],'where':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'limit':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x23')]||null:null,'include':_0x34706d['options']?_0x34706d['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x24')],function(_0xf6c58d){return{'model':db[_0xf6c58d[_0xf5f2('0x26')]],'as':_0xf6c58d['as'],'attributes':_0xf6c58d[_0xf5f2('0x22')],'include':_0xf6c58d[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xf6c58d['include'],function(_0xaa2602){return{'model':db[_0xaa2602[_0xf5f2('0x26')]],'as':_0xaa2602['as'],'attributes':_0xaa2602[_0xf5f2('0x22')],'include':_0xaa2602[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xaa2602[_0xf5f2('0x24')],function(_0x5b6672){return{'model':db[_0x5b6672['model']],'as':_0x5b6672['as'],'attributes':_0x5b6672[_0xf5f2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x11c771){logger['info']('GetChatQueue',_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x27'),_0x34706d,JSON[_0xf5f2('0x16')](_0x11c771));_0x49dac2(_0x11c771);})[_0xf5f2('0x1c')](function(_0x1b381e){logger['error']('GetChatQueue',_0x1b381e[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e['error'](0x1f4,_0x1b381e[_0xf5f2('0x19')]));});});};exports['ShowChatQueue']=function(_0x45b643){var _0x31087c=this;return new Promise(function(_0x7b6817,_0x428770){return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'raw':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'include':_0x45b643[_0xf5f2('0x1f')]?_0x45b643['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x45b643['options'][_0xf5f2('0x24')],function(_0x4b8c42){return{'model':db[_0x4b8c42[_0xf5f2('0x26')]],'as':_0x4b8c42['as'],'attributes':_0x4b8c42[_0xf5f2('0x22')],'include':_0x4b8c42[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x4b8c42['include'],function(_0x5a98d7){return{'model':db[_0x5a98d7[_0xf5f2('0x26')]],'as':_0x5a98d7['as'],'attributes':_0x5a98d7[_0xf5f2('0x22')],'include':_0x5a98d7[_0xf5f2('0x24')]?_['map'](_0x5a98d7[_0xf5f2('0x24')],function(_0x4f7f80){return{'model':db[_0x4f7f80[_0xf5f2('0x26')]],'as':_0x4f7f80['as'],'attributes':_0x4f7f80['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x456764){logger['info'](_0xf5f2('0x29'),_0x45b643);logger[_0xf5f2('0x14')](_0xf5f2('0x29'),_0x45b643,JSON[_0xf5f2('0x16')](_0x456764));_0x7b6817(_0x456764);})['catch'](function(_0x5d2d82){logger[_0xf5f2('0x17')](_0xf5f2('0x29'),_0x5d2d82[_0xf5f2('0x19')],_0x45b643);_0x428770(_0x31087c[_0xf5f2('0x17')](0x1f4,_0x5d2d82[_0xf5f2('0x19')]));});});}; \ No newline at end of file +var _0x720f=['map','include','model','then','GetChatQueue','find','raw','catch','ShowChatQueue','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatQueue.socket','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ChatQueue','options','where','attributes','limit'];(function(_0x437e91,_0x33d2cd){var _0x12ca29=function(_0x103ee2){while(--_0x103ee2){_0x437e91['push'](_0x437e91['shift']());}};_0x12ca29(++_0x33d2cd);}(_0x720f,0x185));var _0xf720=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x720f[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xf720('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf720('0x1'));var fs=require('fs');var Redis=require(_0xf720('0x2'));var db=require(_0xf720('0x3'))['db'];var utils=require(_0xf720('0x4'));var logger=require(_0xf720('0x5'))(_0xf720('0x6'));var config=require(_0xf720('0x7'));var jayson=require(_0xf720('0x8'));var client=jayson[_0xf720('0x9')][_0xf720('0xa')]({'port':0x232a});config['redis']=_[_0xf720('0xb')](config[_0xf720('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf720('0xc')]));require(_0xf720('0xd'))['register'](socket);function respondWithRpcPromise(_0x2f01fa,_0x41b251,_0x5cbd9b){return new BPromise(function(_0xddeab4,_0x4c1ccb){return client['request'](_0x2f01fa,_0x5cbd9b)['then'](function(_0x54956e){logger[_0xf720('0xe')](_0xf720('0xf'),_0x41b251,'request\x20sent');logger[_0xf720('0x10')](_0xf720('0x11'),_0x41b251,_0xf720('0x12'),JSON[_0xf720('0x13')](_0x54956e));if(_0x54956e[_0xf720('0x14')]){if(_0x54956e[_0xf720('0x14')][_0xf720('0x15')]===0x1f4){logger['error'](_0xf720('0xf'),_0x41b251,_0x54956e['error'][_0xf720('0x16')]);return _0x4c1ccb(_0x54956e[_0xf720('0x14')][_0xf720('0x16')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x41b251,_0x54956e[_0xf720('0x14')][_0xf720('0x16')]);return _0xddeab4(_0x54956e['error'][_0xf720('0x16')]);}else{logger[_0xf720('0xe')](_0xf720('0xf'),_0x41b251,_0xf720('0x12'));_0xddeab4(_0x54956e[_0xf720('0x17')][_0xf720('0x16')]);}})['catch'](function(_0x132992){logger[_0xf720('0x14')](_0xf720('0xf'),_0x41b251,_0x132992);_0x4c1ccb(_0x132992);});});}exports['GetChatQueue']=function(_0x1430e9){var _0x5cf0b0=this;return new Promise(function(_0x22003c,_0x541b29){return db[_0xf720('0x18')]['findAll']({'raw':_0x1430e9['options']?_0x1430e9[_0xf720('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1430e9[_0xf720('0x19')]?_0x1430e9[_0xf720('0x19')][_0xf720('0x1a')]||null:null,'attributes':_0x1430e9['options']?_0x1430e9[_0xf720('0x19')][_0xf720('0x1b')]||null:null,'limit':_0x1430e9[_0xf720('0x19')]?_0x1430e9[_0xf720('0x19')][_0xf720('0x1c')]||null:null,'include':_0x1430e9[_0xf720('0x19')]?_0x1430e9[_0xf720('0x19')]['include']?_[_0xf720('0x1d')](_0x1430e9['options'][_0xf720('0x1e')],function(_0x45b8c1){return{'model':db[_0x45b8c1['model']],'as':_0x45b8c1['as'],'attributes':_0x45b8c1[_0xf720('0x1b')],'include':_0x45b8c1['include']?_[_0xf720('0x1d')](_0x45b8c1[_0xf720('0x1e')],function(_0x14eb89){return{'model':db[_0x14eb89[_0xf720('0x1f')]],'as':_0x14eb89['as'],'attributes':_0x14eb89[_0xf720('0x1b')],'include':_0x14eb89[_0xf720('0x1e')]?_[_0xf720('0x1d')](_0x14eb89[_0xf720('0x1e')],function(_0x15b739){return{'model':db[_0x15b739[_0xf720('0x1f')]],'as':_0x15b739['as'],'attributes':_0x15b739[_0xf720('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf720('0x20')](function(_0x468ab9){logger['info'](_0xf720('0x21'),_0x1430e9);logger[_0xf720('0x10')](_0xf720('0x21'),_0x1430e9,JSON[_0xf720('0x13')](_0x468ab9));_0x22003c(_0x468ab9);})['catch'](function(_0x49dc37){logger[_0xf720('0x14')](_0xf720('0x21'),_0x49dc37['message'],_0x1430e9);_0x541b29(_0x5cf0b0[_0xf720('0x14')](0x1f4,_0x49dc37[_0xf720('0x16')]));});});};exports['ShowChatQueue']=function(_0x5afa0a){var _0x4c8f5d=this;return new Promise(function(_0x2f6b14,_0x25cb5f){return db[_0xf720('0x18')][_0xf720('0x22')]({'raw':_0x5afa0a[_0xf720('0x19')]?_0x5afa0a[_0xf720('0x19')][_0xf720('0x23')]===undefined?!![]:![]:!![],'where':_0x5afa0a[_0xf720('0x19')]?_0x5afa0a[_0xf720('0x19')]['where']||null:null,'attributes':_0x5afa0a[_0xf720('0x19')]?_0x5afa0a['options'][_0xf720('0x1b')]||null:null,'include':_0x5afa0a[_0xf720('0x19')]?_0x5afa0a['options'][_0xf720('0x1e')]?_['map'](_0x5afa0a[_0xf720('0x19')][_0xf720('0x1e')],function(_0x4bd400){return{'model':db[_0x4bd400['model']],'as':_0x4bd400['as'],'attributes':_0x4bd400[_0xf720('0x1b')],'include':_0x4bd400['include']?_[_0xf720('0x1d')](_0x4bd400[_0xf720('0x1e')],function(_0x3ac404){return{'model':db[_0x3ac404[_0xf720('0x1f')]],'as':_0x3ac404['as'],'attributes':_0x3ac404[_0xf720('0x1b')],'include':_0x3ac404[_0xf720('0x1e')]?_['map'](_0x3ac404[_0xf720('0x1e')],function(_0x1042ef){return{'model':db[_0x1042ef[_0xf720('0x1f')]],'as':_0x1042ef['as'],'attributes':_0x1042ef[_0xf720('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf720('0x20')](function(_0x364926){logger[_0xf720('0xe')]('ShowChatQueue',_0x5afa0a);logger['debug']('ShowChatQueue',_0x5afa0a,JSON[_0xf720('0x13')](_0x364926));_0x2f6b14(_0x364926);})[_0xf720('0x24')](function(_0x218ec1){logger[_0xf720('0x14')](_0xf720('0x25'),_0x218ec1[_0xf720('0x16')],_0x5afa0a);_0x25cb5f(_0x4c8f5d['error'](0x1f4,_0x218ec1[_0xf720('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3bee68e..53586bd 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 _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0x60958a,_0x45d62a){var _0x30f7d3=function(_0x3acb7f){while(--_0x3acb7f){_0x60958a['push'](_0x60958a['shift']());}};_0x30f7d3(++_0x45d62a);}(_0xadb5,0xad));var _0x5adb=function(_0x5f103d,_0x14e6a7){_0x5f103d=_0x5f103d-0x0;var _0x30a033=_0xadb5[_0x5f103d];return _0x30a033;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){ChatQueueEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);ChatQueueEvents['on'](_0x353885,_0x47228a);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x78029b,_0x19ce64){var _0x2c1b66=function(_0x3d1543){while(--_0x3d1543){_0x78029b['push'](_0x78029b['shift']());}};_0x2c1b66(++_0x19ce64);}(_0xb10b,0x12a));var _0xbb10=function(_0x263714,_0x399b37){_0x263714=_0x263714-0x0;var _0x1cd43d=_0xb10b[_0x263714];return _0x1cd43d;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d9e06b4..0d229bd 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 _0x6335=['describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatQueue.controller','get','index','/describe','isAuthenticated'];(function(_0x7fae44,_0x3a61e6){var _0x791fea=function(_0x46da5d){while(--_0x46da5d){_0x7fae44['push'](_0x7fae44['shift']());}};_0x791fea(++_0x3a61e6);}(_0x6335,0x1e2));var _0x5633=function(_0x5d3687,_0x35408b){_0x5d3687=_0x5d3687-0x0;var _0x1f21c9=_0x6335[_0x5d3687];return _0x1f21c9;};'use strict';var multer=require(_0x5633('0x0'));var util=require(_0x5633('0x1'));var path=require(_0x5633('0x2'));var timeout=require(_0x5633('0x3'));var express=require(_0x5633('0x4'));var router=express[_0x5633('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5633('0x6'));var controller=require(_0x5633('0x7'));router[_0x5633('0x8')]('/',auth['isAuthenticated'](),controller[_0x5633('0x9')]);router['get'](_0x5633('0xa'),auth[_0x5633('0xb')](),controller[_0x5633('0xc')]);router[_0x5633('0x8')](_0x5633('0xd'),auth[_0x5633('0xb')](),controller['show']);router['get'](_0x5633('0xe'),auth[_0x5633('0xb')](),controller['getMembers']);router[_0x5633('0x8')](_0x5633('0xf'),auth['isAuthenticated'](),controller[_0x5633('0x10')]);router[_0x5633('0x8')](_0x5633('0x11'),auth['isAuthenticated'](),controller[_0x5633('0x12')]);router['post']('/',auth[_0x5633('0xb')](),controller[_0x5633('0x13')]);router[_0x5633('0x14')]('/:id/teams',auth[_0x5633('0xb')](),controller[_0x5633('0x15')]);router[_0x5633('0x14')](_0x5633('0x11'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x5633('0xd'),auth[_0x5633('0xb')](),controller['update']);router[_0x5633('0x16')](_0x5633('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x5633('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5633('0x17')]);router[_0x5633('0x16')](_0x5633('0x11'),auth[_0x5633('0xb')](),controller[_0x5633('0x18')]);module[_0x5633('0x19')]=router; \ No newline at end of file +var _0xa119=['removeAgents','multer','util','path','connect-timeout','express','../../components/auth/service','./chatQueue.controller','get','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','removeTeams'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xa119,0xd0));var _0x9a11=function(_0x3139d6,_0x3fdfd1){_0x3139d6=_0x3139d6-0x0;var _0x10b61d=_0xa119[_0x3139d6];return _0x10b61d;};'use strict';var multer=require(_0x9a11('0x0'));var util=require(_0x9a11('0x1'));var path=require(_0x9a11('0x2'));var timeout=require(_0x9a11('0x3'));var express=require(_0x9a11('0x4'));var router=express['Router']();var auth=require(_0x9a11('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9a11('0x6'));router[_0x9a11('0x7')]('/',auth[_0x9a11('0x8')](),controller['index']);router[_0x9a11('0x7')]('/describe',auth[_0x9a11('0x8')](),controller[_0x9a11('0x9')]);router[_0x9a11('0x7')](_0x9a11('0xa'),auth[_0x9a11('0x8')](),controller['show']);router[_0x9a11('0x7')](_0x9a11('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0x9a11('0x7')](_0x9a11('0xc'),auth[_0x9a11('0x8')](),controller[_0x9a11('0xd')]);router[_0x9a11('0x7')](_0x9a11('0xe'),auth[_0x9a11('0x8')](),controller['getAgents']);router[_0x9a11('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x9a11('0xc'),auth['isAuthenticated'](),controller[_0x9a11('0x10')]);router['post'](_0x9a11('0xe'),auth['isAuthenticated'](),controller[_0x9a11('0x11')]);router[_0x9a11('0x12')](_0x9a11('0xa'),auth['isAuthenticated'](),controller[_0x9a11('0x13')]);router[_0x9a11('0x14')](_0x9a11('0xa'),auth[_0x9a11('0x8')](),controller['destroy']);router[_0x9a11('0x14')](_0x9a11('0xc'),auth[_0x9a11('0x8')](),controller[_0x9a11('0x15')]);router[_0x9a11('0x14')](_0x9a11('0xe'),auth['isAuthenticated'](),controller[_0x9a11('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index c659ba7..70d9fc3 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 _0xebcf=['DATE','moment','exports','STRING'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xebcf,0x17d));var _0xfebc=function(_0x4ca944,_0x5fe954){_0x4ca944=_0x4ca944-0x0;var _0x507777=_0xebcf[_0x4ca944];return _0x507777;};'use strict';var moment=require(_0xfebc('0x0'));var Sequelize=require('sequelize');module[_0xfebc('0x1')]={'uniqueid':{'type':Sequelize[_0xfebc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfebc('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfebc('0x3')]},'acceptAt':{'type':Sequelize[_0xfebc('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfebc('0x2')]}}; \ No newline at end of file +var _0xe291=['DATE','sequelize','exports','STRING'];(function(_0x1d6914,_0x2f6a85){var _0x511d10=function(_0x470e70){while(--_0x470e70){_0x1d6914['push'](_0x1d6914['shift']());}};_0x511d10(++_0x2f6a85);}(_0xe291,0x16d));var _0x1e29=function(_0x53a3c5,_0x1bca79){_0x53a3c5=_0x53a3c5-0x0;var _0x5260f5=_0xe291[_0x53a3c5];return _0x5260f5;};'use strict';var moment=require('moment');var Sequelize=require(_0x1e29('0x0'));module[_0x1e29('0x1')]={'uniqueid':{'type':Sequelize[_0x1e29('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x1e29('0x2')]},'joinAt':{'type':Sequelize[_0x1e29('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x1e29('0x3')]},'exitAt':{'type':Sequelize[_0x1e29('0x3')]},'reason':{'type':Sequelize[_0x1e29('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 25d172d..961ba69 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 _0xac33=['apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','crypto','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json'];(function(_0x35ad5f,_0x593ee2){var _0x1e3a4d=function(_0x57acd8){while(--_0x57acd8){_0x35ad5f['push'](_0x35ad5f['shift']());}};_0x1e3a4d(++_0x593ee2);}(_0xac33,0x135));var _0x3ac3=function(_0x5172ae,_0x54b802){_0x5172ae=_0x5172ae-0x0;var _0x32fb65=_0xac33[_0x5172ae];return _0x32fb65;};'use strict';var pdf=require(_0x3ac3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3ac3('0x1'));var zipdir=require(_0x3ac3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3ac3('0x3'));var BPromise=require(_0x3ac3('0x4'));var Mustache=require('mustache');var util=require(_0x3ac3('0x5'));var path=require(_0x3ac3('0x6'));var sox=require(_0x3ac3('0x7'));var csv=require(_0x3ac3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3ac3('0x9'));var squel=require('squel');var crypto=require(_0x3ac3('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3ac3('0xb'));var Papa=require('papaparse');var Redis=require(_0x3ac3('0xc'));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(_0x3ac3('0xd'))(_0x3ac3('0xe'));var utils=require(_0x3ac3('0xf'));var config=require(_0x3ac3('0x10'));var db=require(_0x3ac3('0x11'))['db'];function respondWithStatusCode(_0x3a3c7a,_0x523121){_0x523121=_0x523121||0xcc;return function(_0x2ec424){if(_0x2ec424){return _0x3a3c7a[_0x3ac3('0x12')](_0x523121);}return _0x3a3c7a['status'](_0x523121)['end']();};}function respondWithResult(_0x4e3c32,_0x3ff084){_0x3ff084=_0x3ff084||0xc8;return function(_0x1f1009){if(_0x1f1009){return _0x4e3c32[_0x3ac3('0x13')](_0x3ff084)['json'](_0x1f1009);}};}function respondWithFilteredResult(_0x11a96d,_0x2a788f){return function(_0x441f45){if(_0x441f45){var _0x4ee00b=_0x441f45[_0x3ac3('0x14')],_0x501b2c=_0x2a788f[_0x3ac3('0x15')],_0x35ee38=_0x2a788f['offset']+_0x2a788f[_0x3ac3('0x16')],_0x49b599;if(_0x35ee38>=_0x4ee00b){_0x35ee38=_0x4ee00b;_0x49b599=0xc8;}else{_0x49b599=0xce;}_0x11a96d[_0x3ac3('0x13')](_0x49b599);return _0x11a96d[_0x3ac3('0x17')](_0x3ac3('0x18'),_0x501b2c+'-'+_0x35ee38+'/'+_0x4ee00b)[_0x3ac3('0x19')](_0x441f45);}return null;};}function patchUpdates(_0x10a3df){return function(_0x28eaf8){try{jsonpatch[_0x3ac3('0x1a')](_0x28eaf8,_0x10a3df,!![]);}catch(_0x17e0f1){return BPromise[_0x3ac3('0x1b')](_0x17e0f1);}return _0x28eaf8['save']();};}function saveUpdates(_0x119e45,_0x5badea){return function(_0x34a26c){if(_0x34a26c){return _0x34a26c[_0x3ac3('0x1c')](_0x119e45)[_0x3ac3('0x1d')](function(_0xee2941){return _0xee2941;});}return null;};}function removeEntity(_0x5042f3,_0x3dd571){return function(_0x323490){if(_0x323490){return _0x323490[_0x3ac3('0x1e')]()[_0x3ac3('0x1d')](function(){_0x5042f3[_0x3ac3('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e3eb,_0x22fa4f){return function(_0x4e79d1){if(!_0x4e79d1){_0x45e3eb[_0x3ac3('0x12')](0x194);}return _0x4e79d1;};}function handleError(_0x5f3ba0,_0x5b2ce1){_0x5b2ce1=_0x5b2ce1||0x1f4;return function(_0x39cb7d){logger[_0x3ac3('0x1f')](_0x39cb7d[_0x3ac3('0x20')]);if(_0x39cb7d[_0x3ac3('0x21')]){delete _0x39cb7d[_0x3ac3('0x21')];}_0x5f3ba0[_0x3ac3('0x13')](_0x5b2ce1)[_0x3ac3('0x22')](_0x39cb7d);};}exports[_0x3ac3('0x23')]=function(_0x7e0f56,_0x542f88){var _0x4b0596={},_0x267c89={},_0x3584e9={'count':0x0,'rows':[]};var _0x50efcc=_[_0x3ac3('0x24')](db[_0x3ac3('0x25')][_0x3ac3('0x26')],function(_0x5ecd32){return{'name':_0x5ecd32['fieldName'],'type':_0x5ecd32[_0x3ac3('0x27')][_0x3ac3('0x28')]};});_0x267c89[_0x3ac3('0x29')]=_[_0x3ac3('0x24')](_0x50efcc,'name');_0x267c89[_0x3ac3('0x2a')]=_[_0x3ac3('0x2b')](_0x7e0f56[_0x3ac3('0x2a')]);_0x267c89[_0x3ac3('0x2c')]=_['intersection'](_0x267c89[_0x3ac3('0x29')],_0x267c89[_0x3ac3('0x2a')]);_0x4b0596[_0x3ac3('0x2d')]=_[_0x3ac3('0x2e')](_0x267c89[_0x3ac3('0x29')],qs[_0x3ac3('0x2f')](_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x2f')]));_0x4b0596['attributes']=_0x4b0596[_0x3ac3('0x2d')]['length']?_0x4b0596['attributes']:_0x267c89[_0x3ac3('0x29')];if(!_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x30')]('nolimit')){_0x4b0596[_0x3ac3('0x16')]=qs[_0x3ac3('0x16')](_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x16')]);_0x4b0596[_0x3ac3('0x15')]=qs[_0x3ac3('0x15')](_0x7e0f56['query'][_0x3ac3('0x15')]);}_0x4b0596[_0x3ac3('0x31')]=qs[_0x3ac3('0x32')](_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x32')]);_0x4b0596[_0x3ac3('0x33')]=qs['filters'](_[_0x3ac3('0x34')](_0x7e0f56['query'],_0x267c89['filters']));if(_0x7e0f56[_0x3ac3('0x2a')]['filter']){_0x4b0596[_0x3ac3('0x33')]=_[_0x3ac3('0x35')](_0x4b0596[_0x3ac3('0x33')],{'$or':_[_0x3ac3('0x24')](_0x50efcc,function(_0x2e0875){if(_0x2e0875[_0x3ac3('0x27')]!=='VIRTUAL'){var _0x331d68={};_0x331d68[_0x2e0875[_0x3ac3('0x21')]]={'$like':'%'+_0x7e0f56['query'][_0x3ac3('0x36')]+'%'};return _0x331d68;}})});}_0x4b0596=_[_0x3ac3('0x35')]({},_0x4b0596,_0x7e0f56[_0x3ac3('0x37')]);var _0x5dff5d={'where':_0x4b0596[_0x3ac3('0x33')]};return db[_0x3ac3('0x25')][_0x3ac3('0x14')](_0x5dff5d)[_0x3ac3('0x1d')](function(_0x13ec9c){_0x3584e9[_0x3ac3('0x14')]=_0x13ec9c;if(_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x38')]){_0x4b0596[_0x3ac3('0x39')]=[{'all':!![]}];}return db[_0x3ac3('0x25')][_0x3ac3('0x3a')](_0x4b0596);})['then'](function(_0x1f5d97){_0x3584e9[_0x3ac3('0x3b')]=_0x1f5d97;return _0x3584e9;})[_0x3ac3('0x1d')](respondWithFilteredResult(_0x542f88,_0x4b0596))['catch'](handleError(_0x542f88,null));};exports[_0x3ac3('0x3c')]=function(_0x4a9340,_0x2abfd7){var _0x11968d={'raw':!![],'where':{'id':_0x4a9340[_0x3ac3('0x3d')]['id']}},_0xe1e416={};_0xe1e416['model']=_[_0x3ac3('0x2b')](db[_0x3ac3('0x25')][_0x3ac3('0x26')]);_0xe1e416[_0x3ac3('0x2a')]=_['keys'](_0x4a9340[_0x3ac3('0x2a')]);_0xe1e416['filters']=_['intersection'](_0xe1e416['model'],_0xe1e416['query']);_0x11968d['attributes']=_[_0x3ac3('0x2e')](_0xe1e416[_0x3ac3('0x29')],qs['fields'](_0x4a9340[_0x3ac3('0x2a')][_0x3ac3('0x2f')]));_0x11968d[_0x3ac3('0x2d')]=_0x11968d[_0x3ac3('0x2d')]['length']?_0x11968d['attributes']:_0xe1e416[_0x3ac3('0x29')];if(_0x4a9340[_0x3ac3('0x2a')][_0x3ac3('0x38')]){_0x11968d[_0x3ac3('0x39')]=[{'all':!![]}];}_0x11968d=_[_0x3ac3('0x35')]({},_0x11968d,_0x4a9340[_0x3ac3('0x37')]);return db[_0x3ac3('0x25')][_0x3ac3('0x3e')](_0x11968d)[_0x3ac3('0x1d')](handleEntityNotFound(_0x2abfd7,null))['then'](respondWithResult(_0x2abfd7,null))[_0x3ac3('0x3f')](handleError(_0x2abfd7,null));};exports[_0x3ac3('0x40')]=function(_0x5a1e98,_0x2a1c86){return db['ChatQueueReport'][_0x3ac3('0x40')](_0x5a1e98[_0x3ac3('0x41')],{})[_0x3ac3('0x1d')](respondWithResult(_0x2a1c86,0xc9))['catch'](handleError(_0x2a1c86,null));};exports[_0x3ac3('0x1c')]=function(_0xbfc036,_0x4f6a35){if(_0xbfc036['body']['id']){delete _0xbfc036[_0x3ac3('0x41')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0xbfc036['params']['id']}})[_0x3ac3('0x1d')](handleEntityNotFound(_0x4f6a35,null))['then'](saveUpdates(_0xbfc036[_0x3ac3('0x41')],null))[_0x3ac3('0x1d')](respondWithResult(_0x4f6a35,null))[_0x3ac3('0x3f')](handleError(_0x4f6a35,null));};exports['destroy']=function(_0x178875,_0x39ee6b){return db[_0x3ac3('0x25')][_0x3ac3('0x3e')]({'where':{'id':_0x178875[_0x3ac3('0x3d')]['id']}})[_0x3ac3('0x1d')](handleEntityNotFound(_0x39ee6b,null))[_0x3ac3('0x1d')](removeEntity(_0x39ee6b,null))[_0x3ac3('0x3f')](handleError(_0x39ee6b,null));};exports[_0x3ac3('0x42')]=function(_0xec50ce,_0x28b880){return db[_0x3ac3('0x25')][_0x3ac3('0x42')]()['then'](respondWithResult(_0x28b880,null))['catch'](handleError(_0x28b880,null));}; \ No newline at end of file +var _0x26b8=['key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','sox','to-csv','crypto','jsforce','desk.js','papaparse','ioredis','api','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','name','index','ChatQueueReport','rawAttributes','fieldName','type'];(function(_0x3d7f50,_0x31c360){var _0x3d1a06=function(_0x3a2322){while(--_0x3a2322){_0x3d7f50['push'](_0x3d7f50['shift']());}};_0x3d1a06(++_0x31c360);}(_0x26b8,0x1f4));var _0x826b=function(_0x4bfb35,_0x5b75a3){_0x4bfb35=_0x4bfb35-0x0;var _0x1e0e1c=_0x26b8[_0x4bfb35];return _0x1e0e1c;};'use strict';var pdf=require(_0x826b('0x0'));var emlformat=require(_0x826b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x826b('0x2'));var moment=require(_0x826b('0x3'));var BPromise=require(_0x826b('0x4'));var Mustache=require(_0x826b('0x5'));var util=require(_0x826b('0x6'));var path=require('path');var sox=require(_0x826b('0x7'));var csv=require(_0x826b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x826b('0x9'));var jsforce=require(_0x826b('0xa'));var deskjs=require(_0x826b('0xb'));var toCsv=require(_0x826b('0x8'));var querystring=require('querystring');var Papa=require(_0x826b('0xc'));var Redis=require(_0x826b('0xd'));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('../../config/logger')(_0x826b('0xe'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f4902,_0xfa9e09){_0xfa9e09=_0xfa9e09||0xcc;return function(_0x5ecf5e){if(_0x5ecf5e){return _0x2f4902['sendStatus'](_0xfa9e09);}return _0x2f4902['status'](_0xfa9e09)[_0x826b('0xf')]();};}function respondWithResult(_0x36cdec,_0x623c91){_0x623c91=_0x623c91||0xc8;return function(_0x2dda2a){if(_0x2dda2a){return _0x36cdec[_0x826b('0x10')](_0x623c91)[_0x826b('0x11')](_0x2dda2a);}};}function respondWithFilteredResult(_0x4f60be,_0x388538){return function(_0x2aea5c){if(_0x2aea5c){var _0x4a11c0=_0x2aea5c[_0x826b('0x12')],_0x49f8dd=_0x388538['offset'],_0x2f3dc4=_0x388538[_0x826b('0x13')]+_0x388538[_0x826b('0x14')],_0x5e75b5;if(_0x2f3dc4>=_0x4a11c0){_0x2f3dc4=_0x4a11c0;_0x5e75b5=0xc8;}else{_0x5e75b5=0xce;}_0x4f60be[_0x826b('0x10')](_0x5e75b5);return _0x4f60be[_0x826b('0x15')](_0x826b('0x16'),_0x49f8dd+'-'+_0x2f3dc4+'/'+_0x4a11c0)['json'](_0x2aea5c);}return null;};}function patchUpdates(_0x206057){return function(_0x524421){try{jsonpatch[_0x826b('0x17')](_0x524421,_0x206057,!![]);}catch(_0x5bf600){return BPromise[_0x826b('0x18')](_0x5bf600);}return _0x524421[_0x826b('0x19')]();};}function saveUpdates(_0xd406e2,_0x49820d){return function(_0x48842a){if(_0x48842a){return _0x48842a[_0x826b('0x1a')](_0xd406e2)[_0x826b('0x1b')](function(_0x3c371b){return _0x3c371b;});}return null;};}function removeEntity(_0x585a1d,_0x47738b){return function(_0x2ebbad){if(_0x2ebbad){return _0x2ebbad[_0x826b('0x1c')]()[_0x826b('0x1b')](function(){_0x585a1d[_0x826b('0x10')](0xcc)[_0x826b('0xf')]();});}};}function handleEntityNotFound(_0x429fa8,_0x45359c){return function(_0x41b80f){if(!_0x41b80f){_0x429fa8[_0x826b('0x1d')](0x194);}return _0x41b80f;};}function handleError(_0x554516,_0xe67800){_0xe67800=_0xe67800||0x1f4;return function(_0x2d6142){logger['error'](_0x2d6142['stack']);if(_0x2d6142[_0x826b('0x1e')]){delete _0x2d6142['name'];}_0x554516[_0x826b('0x10')](_0xe67800)['send'](_0x2d6142);};}exports[_0x826b('0x1f')]=function(_0x2a3d97,_0xa5a0e6){var _0x11cd98={},_0x5ecfb8={},_0x231ab2={'count':0x0,'rows':[]};var _0x36b064=_['map'](db[_0x826b('0x20')][_0x826b('0x21')],function(_0x1e3e93){return{'name':_0x1e3e93[_0x826b('0x22')],'type':_0x1e3e93[_0x826b('0x23')][_0x826b('0x24')]};});_0x5ecfb8[_0x826b('0x25')]=_[_0x826b('0x26')](_0x36b064,_0x826b('0x1e'));_0x5ecfb8[_0x826b('0x27')]=_[_0x826b('0x28')](_0x2a3d97['query']);_0x5ecfb8[_0x826b('0x29')]=_[_0x826b('0x2a')](_0x5ecfb8[_0x826b('0x25')],_0x5ecfb8[_0x826b('0x27')]);_0x11cd98['attributes']=_[_0x826b('0x2a')](_0x5ecfb8[_0x826b('0x25')],qs[_0x826b('0x2b')](_0x2a3d97['query'][_0x826b('0x2b')]));_0x11cd98[_0x826b('0x2c')]=_0x11cd98[_0x826b('0x2c')]['length']?_0x11cd98[_0x826b('0x2c')]:_0x5ecfb8[_0x826b('0x25')];if(!_0x2a3d97[_0x826b('0x27')][_0x826b('0x2d')](_0x826b('0x2e'))){_0x11cd98[_0x826b('0x14')]=qs[_0x826b('0x14')](_0x2a3d97[_0x826b('0x27')]['limit']);_0x11cd98[_0x826b('0x13')]=qs[_0x826b('0x13')](_0x2a3d97[_0x826b('0x27')][_0x826b('0x13')]);}_0x11cd98[_0x826b('0x2f')]=qs['sort'](_0x2a3d97[_0x826b('0x27')][_0x826b('0x30')]);_0x11cd98['where']=qs[_0x826b('0x29')](_[_0x826b('0x31')](_0x2a3d97[_0x826b('0x27')],_0x5ecfb8[_0x826b('0x29')]));if(_0x2a3d97['query'][_0x826b('0x32')]){_0x11cd98[_0x826b('0x33')]=_[_0x826b('0x34')](_0x11cd98[_0x826b('0x33')],{'$or':_[_0x826b('0x26')](_0x36b064,function(_0x356c65){if(_0x356c65['type']!==_0x826b('0x35')){var _0x47ca94={};_0x47ca94[_0x356c65['name']]={'$like':'%'+_0x2a3d97[_0x826b('0x27')]['filter']+'%'};return _0x47ca94;}})});}_0x11cd98=_['merge']({},_0x11cd98,_0x2a3d97[_0x826b('0x36')]);var _0x152686={'where':_0x11cd98[_0x826b('0x33')]};return db[_0x826b('0x20')]['count'](_0x152686)['then'](function(_0xb4e568){_0x231ab2['count']=_0xb4e568;if(_0x2a3d97['query'][_0x826b('0x37')]){_0x11cd98[_0x826b('0x38')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x826b('0x39')](_0x11cd98);})[_0x826b('0x1b')](function(_0x283b65){_0x231ab2[_0x826b('0x3a')]=_0x283b65;return _0x231ab2;})['then'](respondWithFilteredResult(_0xa5a0e6,_0x11cd98))[_0x826b('0x3b')](handleError(_0xa5a0e6,null));};exports[_0x826b('0x3c')]=function(_0x4da952,_0x3b8e01){var _0x3068b7={'raw':!![],'where':{'id':_0x4da952[_0x826b('0x3d')]['id']}},_0x40be0c={};_0x40be0c[_0x826b('0x25')]=_[_0x826b('0x28')](db['ChatQueueReport'][_0x826b('0x21')]);_0x40be0c['query']=_['keys'](_0x4da952[_0x826b('0x27')]);_0x40be0c[_0x826b('0x29')]=_[_0x826b('0x2a')](_0x40be0c[_0x826b('0x25')],_0x40be0c[_0x826b('0x27')]);_0x3068b7[_0x826b('0x2c')]=_['intersection'](_0x40be0c[_0x826b('0x25')],qs[_0x826b('0x2b')](_0x4da952[_0x826b('0x27')]['fields']));_0x3068b7['attributes']=_0x3068b7[_0x826b('0x2c')][_0x826b('0x3e')]?_0x3068b7['attributes']:_0x40be0c[_0x826b('0x25')];if(_0x4da952[_0x826b('0x27')][_0x826b('0x37')]){_0x3068b7[_0x826b('0x38')]=[{'all':!![]}];}_0x3068b7=_[_0x826b('0x34')]({},_0x3068b7,_0x4da952[_0x826b('0x36')]);return db[_0x826b('0x20')][_0x826b('0x3f')](_0x3068b7)[_0x826b('0x1b')](handleEntityNotFound(_0x3b8e01,null))['then'](respondWithResult(_0x3b8e01,null))[_0x826b('0x3b')](handleError(_0x3b8e01,null));};exports[_0x826b('0x40')]=function(_0x152aaa,_0x26961f){return db[_0x826b('0x20')][_0x826b('0x40')](_0x152aaa[_0x826b('0x41')],{})['then'](respondWithResult(_0x26961f,0xc9))[_0x826b('0x3b')](handleError(_0x26961f,null));};exports[_0x826b('0x1a')]=function(_0x47a5aa,_0x58616a){if(_0x47a5aa[_0x826b('0x41')]['id']){delete _0x47a5aa['body']['id'];}return db['ChatQueueReport'][_0x826b('0x3f')]({'where':{'id':_0x47a5aa[_0x826b('0x3d')]['id']}})[_0x826b('0x1b')](handleEntityNotFound(_0x58616a,null))[_0x826b('0x1b')](saveUpdates(_0x47a5aa['body'],null))[_0x826b('0x1b')](respondWithResult(_0x58616a,null))['catch'](handleError(_0x58616a,null));};exports[_0x826b('0x1c')]=function(_0x37c4b2,_0x3baa41){return db[_0x826b('0x20')]['find']({'where':{'id':_0x37c4b2[_0x826b('0x3d')]['id']}})[_0x826b('0x1b')](handleEntityNotFound(_0x3baa41,null))[_0x826b('0x1b')](removeEntity(_0x3baa41,null))[_0x826b('0x3b')](handleError(_0x3baa41,null));};exports['describe']=function(_0x547f20,_0x1feb2f){return db[_0x826b('0x20')][_0x826b('0x42')]()[_0x826b('0x1b')](respondWithResult(_0x1feb2f,null))[_0x826b('0x3b')](handleError(_0x1feb2f,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 57ce95f..835d1e6 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 _0x4f6f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x90e09e,_0x420226){var _0xd07268=function(_0xda8845){while(--_0xda8845){_0x90e09e['push'](_0x90e09e['shift']());}};_0xd07268(++_0x420226);}(_0x4f6f,0x16a));var _0xf4f6=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x4f6f[_0x484c03];return _0x294127;};'use strict';var _=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf4f6('0x2'));var BPromise=require(_0xf4f6('0x3'));var rp=require(_0xf4f6('0x4'));var fs=require('fs');var path=require(_0xf4f6('0x5'));var rimraf=require(_0xf4f6('0x6'));var config=require(_0xf4f6('0x7'));var attributes=require(_0xf4f6('0x8'));module[_0xf4f6('0x9')]=function(_0x355413,_0x480a44){return _0x355413[_0xf4f6('0xa')](_0xf4f6('0xb'),attributes,{'tableName':_0xf4f6('0xc'),'paranoid':![],'indexes':[{'name':_0xf4f6('0xd'),'fields':[_0xf4f6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe91f=['request-promise','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird'];(function(_0x187279,_0x26d152){var _0x3da59d=function(_0x41c808){while(--_0x41c808){_0x187279['push'](_0x187279['shift']());}};_0x3da59d(++_0x26d152);}(_0xe91f,0x7f));var _0xfe91=function(_0x511212,_0x4ec634){_0x511212=_0x511212-0x0;var _0x519f10=_0xe91f[_0x511212];return _0x519f10;};'use strict';var _=require('lodash');var util=require(_0xfe91('0x0'));var logger=require(_0xfe91('0x1'))(_0xfe91('0x2'));var moment=require(_0xfe91('0x3'));var BPromise=require(_0xfe91('0x4'));var rp=require(_0xfe91('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfe91('0x6'));var attributes=require(_0xfe91('0x7'));module['exports']=function(_0x5c51c8,_0x5e83b3){return _0x5c51c8[_0xfe91('0x8')](_0xfe91('0x9'),attributes,{'tableName':_0xfe91('0xa'),'paranoid':![],'indexes':[{'name':_0xfe91('0xb'),'fields':[_0xfe91('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index b802108..d2b251b 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 _0x2e77=['message','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','debug','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39092c,_0x167f0c){var _0x7e47a=function(_0x17f710){while(--_0x17f710){_0x39092c['push'](_0x39092c['shift']());}};_0x7e47a(++_0x167f0c);}(_0x2e77,0x94));var _0x72e7=function(_0x2053ac,_0x3ee7cc){_0x2053ac=_0x2053ac-0x0;var _0x800333=_0x2e77[_0x2053ac];return _0x800333;};'use strict';var _=require(_0x72e7('0x0'));var util=require('util');var moment=require(_0x72e7('0x1'));var BPromise=require('bluebird');var rs=require(_0x72e7('0x2'));var fs=require('fs');var Redis=require(_0x72e7('0x3'));var db=require(_0x72e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72e7('0x5'));var config=require(_0x72e7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x72e7('0x7')][_0x72e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x590c16,_0x231333,_0x87006d){return new BPromise(function(_0x194dab,_0x318d04){return client[_0x72e7('0x9')](_0x590c16,_0x87006d)['then'](function(_0x5d7c91){logger[_0x72e7('0xa')](_0x72e7('0xb'),_0x231333,_0x72e7('0xc'));logger['debug'](_0x72e7('0xd'),_0x231333,_0x72e7('0xc'),JSON[_0x72e7('0xe')](_0x5d7c91));if(_0x5d7c91[_0x72e7('0xf')]){if(_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x10')]===0x1f4){logger[_0x72e7('0xf')](_0x72e7('0xb'),_0x231333,_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x11')]);return _0x318d04(_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x11')]);}logger[_0x72e7('0xf')](_0x72e7('0xb'),_0x231333,_0x5d7c91['error'][_0x72e7('0x11')]);return _0x194dab(_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x11')]);}else{logger[_0x72e7('0xa')](_0x72e7('0xb'),_0x231333,'request\x20sent');_0x194dab(_0x5d7c91[_0x72e7('0x12')][_0x72e7('0x11')]);}})[_0x72e7('0x13')](function(_0x140a62){logger[_0x72e7('0xf')](_0x72e7('0xb'),_0x231333,_0x140a62);_0x318d04(_0x140a62);});});}exports['CreateChatQueueReport']=function(_0x3f6178){var _0x158426=this;return new Promise(function(_0x11ae27,_0x422dcf){return db[_0x72e7('0x14')][_0x72e7('0x15')](_0x3f6178[_0x72e7('0x16')],{'raw':_0x3f6178[_0x72e7('0x17')]?_0x3f6178['options'][_0x72e7('0x18')]===undefined?!![]:![]:!![]})[_0x72e7('0x19')](function(_0xc07648){logger[_0x72e7('0xa')](_0x72e7('0x1a'),_0x3f6178);logger['debug']('CreateChatQueueReport',_0x3f6178,JSON[_0x72e7('0xe')](_0xc07648));_0x11ae27(_0xc07648);})['catch'](function(_0x385aab){logger[_0x72e7('0xf')](_0x72e7('0x1a'),_0x385aab[_0x72e7('0x11')],_0x3f6178);_0x422dcf(_0x158426[_0x72e7('0xf')](0x1f4,_0x385aab['message']));});});};exports[_0x72e7('0x1b')]=function(_0x252aa1){var _0x152993=this;return new Promise(function(_0xa96bb8,_0x36210a){return db[_0x72e7('0x14')][_0x72e7('0x1c')](_0x252aa1['body'],{'raw':_0x252aa1['options']?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x252aa1[_0x72e7('0x17')]?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x1d')]||null:null,'attributes':_0x252aa1['options']?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x1e')]||null:null,'limit':_0x252aa1[_0x72e7('0x17')]?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x1f')]||null:null})[_0x72e7('0x19')](function(_0x211896){logger['info'](_0x72e7('0x1b'),_0x252aa1);logger[_0x72e7('0x20')](_0x72e7('0x1b'),_0x252aa1,JSON[_0x72e7('0xe')](_0x211896));_0xa96bb8(_0x211896);})['catch'](function(_0x1aeca0){logger[_0x72e7('0xf')](_0x72e7('0x1b'),_0x1aeca0[_0x72e7('0x11')],_0x252aa1);_0x36210a(_0x152993['error'](0x1f4,_0x1aeca0[_0x72e7('0x11')]));});});}; \ No newline at end of file +var _0xbe94=['error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','debug','update','raw','where','limit','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3f13e9,_0x3dc700){var _0xa2b867=function(_0x16ab2c){while(--_0x16ab2c){_0x3f13e9['push'](_0x3f13e9['shift']());}};_0xa2b867(++_0x3dc700);}(_0xbe94,0xaf));var _0x4be9=function(_0x393814,_0x367a00){_0x393814=_0x393814-0x0;var _0x5d7a5a=_0xbe94[_0x393814];return _0x5d7a5a;};'use strict';var _=require(_0x4be9('0x0'));var util=require('util');var moment=require(_0x4be9('0x1'));var BPromise=require(_0x4be9('0x2'));var rs=require(_0x4be9('0x3'));var fs=require('fs');var Redis=require(_0x4be9('0x4'));var db=require(_0x4be9('0x5'))['db'];var utils=require(_0x4be9('0x6'));var logger=require(_0x4be9('0x7'))(_0x4be9('0x8'));var config=require(_0x4be9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4be9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x186876,_0x91884e,_0x453c73){return new BPromise(function(_0xa75c89,_0x151ec4){return client[_0x4be9('0xb')](_0x186876,_0x453c73)[_0x4be9('0xc')](function(_0x21b224){logger[_0x4be9('0xd')](_0x4be9('0xe'),_0x91884e,_0x4be9('0xf'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x91884e,'request\x20sent',JSON[_0x4be9('0x10')](_0x21b224));if(_0x21b224[_0x4be9('0x11')]){if(_0x21b224['error'][_0x4be9('0x12')]===0x1f4){logger[_0x4be9('0x11')](_0x4be9('0xe'),_0x91884e,_0x21b224[_0x4be9('0x11')]['message']);return _0x151ec4(_0x21b224[_0x4be9('0x11')][_0x4be9('0x13')]);}logger['error'](_0x4be9('0xe'),_0x91884e,_0x21b224[_0x4be9('0x11')][_0x4be9('0x13')]);return _0xa75c89(_0x21b224[_0x4be9('0x11')][_0x4be9('0x13')]);}else{logger['info'](_0x4be9('0xe'),_0x91884e,'request\x20sent');_0xa75c89(_0x21b224[_0x4be9('0x14')]['message']);}})[_0x4be9('0x15')](function(_0x256e45){logger[_0x4be9('0x11')](_0x4be9('0xe'),_0x91884e,_0x256e45);_0x151ec4(_0x256e45);});});}exports[_0x4be9('0x16')]=function(_0x52b5b7){var _0x335607=this;return new Promise(function(_0x37e177,_0x112619){return db[_0x4be9('0x17')]['create'](_0x52b5b7[_0x4be9('0x18')],{'raw':_0x52b5b7[_0x4be9('0x19')]?_0x52b5b7['options']['raw']===undefined?!![]:![]:!![]})[_0x4be9('0xc')](function(_0x51b081){logger['info'](_0x4be9('0x16'),_0x52b5b7);logger[_0x4be9('0x1a')](_0x4be9('0x16'),_0x52b5b7,JSON[_0x4be9('0x10')](_0x51b081));_0x37e177(_0x51b081);})[_0x4be9('0x15')](function(_0x16ed47){logger['error'](_0x4be9('0x16'),_0x16ed47['message'],_0x52b5b7);_0x112619(_0x335607[_0x4be9('0x11')](0x1f4,_0x16ed47[_0x4be9('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x13a4e5){var _0x1a42bf=this;return new Promise(function(_0x38c9d2,_0xbf00fb){return db[_0x4be9('0x17')][_0x4be9('0x1b')](_0x13a4e5[_0x4be9('0x18')],{'raw':_0x13a4e5['options']?_0x13a4e5[_0x4be9('0x19')][_0x4be9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13a4e5[_0x4be9('0x19')]?_0x13a4e5['options'][_0x4be9('0x1d')]||null:null,'attributes':_0x13a4e5[_0x4be9('0x19')]?_0x13a4e5[_0x4be9('0x19')]['attributes']||null:null,'limit':_0x13a4e5[_0x4be9('0x19')]?_0x13a4e5[_0x4be9('0x19')][_0x4be9('0x1e')]||null:null})[_0x4be9('0xc')](function(_0x2ffdf4){logger[_0x4be9('0xd')]('UpdateChatQueueReport',_0x13a4e5);logger[_0x4be9('0x1a')](_0x4be9('0x1f'),_0x13a4e5,JSON[_0x4be9('0x10')](_0x2ffdf4));_0x38c9d2(_0x2ffdf4);})[_0x4be9('0x15')](function(_0x3e3922){logger[_0x4be9('0x11')]('UpdateChatQueueReport',_0x3e3922['message'],_0x13a4e5);_0xbf00fb(_0x1a42bf[_0x4be9('0x11')](0x1f4,_0x3e3922[_0x4be9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5213e1b..f542e51 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 _0xf4d6=['./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5a20a9,_0x15f5de){var _0x474d88=function(_0x3e86fe){while(--_0x3e86fe){_0x5a20a9['push'](_0x5a20a9['shift']());}};_0x474d88(++_0x15f5de);}(_0xf4d6,0x150));var _0x6f4d=function(_0x209b1e,_0x48368f){_0x209b1e=_0x209b1e-0x0;var _0x395a5a=_0xf4d6[_0x209b1e];return _0x395a5a;};'use strict';var multer=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f4d('0x2'));var router=express[_0x6f4d('0x3')]();var auth=require(_0x6f4d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f4d('0x5'));var controller=require(_0x6f4d('0x6'));router['get']('/',auth[_0x6f4d('0x7')](),controller[_0x6f4d('0x8')]);router[_0x6f4d('0x9')](_0x6f4d('0xa'),auth['isAuthenticated'](),controller[_0x6f4d('0xb')]);router['get'](_0x6f4d('0xc'),auth[_0x6f4d('0x7')](),controller[_0x6f4d('0xd')]);router[_0x6f4d('0xe')]('/',auth[_0x6f4d('0x7')](),controller[_0x6f4d('0xf')]);router[_0x6f4d('0x10')](_0x6f4d('0xc'),auth[_0x6f4d('0x7')](),controller['update']);router[_0x6f4d('0x11')]('/:id',auth[_0x6f4d('0x7')](),controller['destroy']);module[_0x6f4d('0x12')]=router; \ No newline at end of file +var _0xce1b=['multer','util','path','express','Router','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy'];(function(_0x1c0e60,_0xd8a2b8){var _0x3276d1=function(_0x21041d){while(--_0x21041d){_0x1c0e60['push'](_0x1c0e60['shift']());}};_0x3276d1(++_0xd8a2b8);}(_0xce1b,0x132));var _0xbce1=function(_0x382e21,_0x1a5908){_0x382e21=_0x382e21-0x0;var _0x5f14c5=_0xce1b[_0x382e21];return _0x5f14c5;};'use strict';var multer=require(_0xbce1('0x0'));var util=require(_0xbce1('0x1'));var path=require(_0xbce1('0x2'));var timeout=require('connect-timeout');var express=require(_0xbce1('0x3'));var router=express[_0xbce1('0x4')]();var auth=require(_0xbce1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbce1('0x6'));var controller=require(_0xbce1('0x7'));router['get']('/',auth[_0xbce1('0x8')](),controller[_0xbce1('0x9')]);router[_0xbce1('0xa')]('/describe',auth[_0xbce1('0x8')](),controller['describe']);router[_0xbce1('0xa')]('/:id',auth[_0xbce1('0x8')](),controller[_0xbce1('0xb')]);router[_0xbce1('0xc')]('/',auth[_0xbce1('0x8')](),controller['create']);router[_0xbce1('0xd')](_0xbce1('0xe'),auth[_0xbce1('0x8')](),controller[_0xbce1('0xf')]);router[_0xbce1('0x10')]('/:id',auth[_0xbce1('0x8')](),controller[_0xbce1('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index dd63078..1076b0b 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 _0xbe06=['account','queue','NOW','moment','sequelize','exports','ENUM'];(function(_0x15e812,_0x44748d){var _0x264014=function(_0x565f46){while(--_0x565f46){_0x15e812['push'](_0x15e812['shift']());}};_0x264014(++_0x44748d);}(_0xbe06,0x153));var _0x6be0=function(_0x5f043c,_0x59e85a){_0x5f043c=_0x5f043c-0x0;var _0x184820=_0xbe06[_0x5f043c];return _0x184820;};'use strict';var moment=require(_0x6be0('0x0'));var Sequelize=require(_0x6be0('0x1'));module[_0x6be0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6be0('0x3')](_0x6be0('0x4'),'agent',_0x6be0('0x5')),'allowNull':![],'defaultValue':_0x6be0('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x6be0('0x6')]}}; \ No newline at end of file +var _0x5626=['exports','agent','queue','DATE','NOW','moment','sequelize'];(function(_0x2533ae,_0x2cb66d){var _0x440a09=function(_0x3d3fe1){while(--_0x3d3fe1){_0x2533ae['push'](_0x2533ae['shift']());}};_0x440a09(++_0x2cb66d);}(_0x5626,0x19b));var _0x6562=function(_0x36c4aa,_0x3573b4){_0x36c4aa=_0x36c4aa-0x0;var _0x363818=_0x5626[_0x36c4aa];return _0x363818;};'use strict';var moment=require(_0x6562('0x0'));var Sequelize=require(_0x6562('0x1'));module[_0x6562('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x6562('0x3'),'queue'),'allowNull':![],'defaultValue':_0x6562('0x4')},'transferredAt':{'type':Sequelize[_0x6562('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x6562('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index bc5e2c8..d2ff02b 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 _0x23b6=['fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','map','ChatTransferReport','rawAttributes','type','key','query','filters','intersection','model','attributes'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x23b6,0x9d));var _0x623b=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x23b6[_0xb833b1];return _0x1ab87a;};'use strict';var pdf=require(_0x623b('0x0'));var emlformat=require(_0x623b('0x1'));var rimraf=require(_0x623b('0x2'));var zipdir=require(_0x623b('0x3'));var jsonpatch=require(_0x623b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x623b('0x5'));var util=require(_0x623b('0x6'));var path=require('path');var sox=require(_0x623b('0x7'));var csv=require(_0x623b('0x8'));var ejs=require(_0x623b('0x9'));var fs=require('fs');var _=require(_0x623b('0xa'));var squel=require(_0x623b('0xb'));var crypto=require(_0x623b('0xc'));var jsforce=require(_0x623b('0xd'));var deskjs=require(_0x623b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x623b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x623b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x623b('0x11'));var utils=require(_0x623b('0x12'));var config=require(_0x623b('0x13'));var db=require(_0x623b('0x14'))['db'];function respondWithStatusCode(_0x200b18,_0x42aae2){_0x42aae2=_0x42aae2||0xcc;return function(_0x2b08d2){if(_0x2b08d2){return _0x200b18['sendStatus'](_0x42aae2);}return _0x200b18['status'](_0x42aae2)[_0x623b('0x15')]();};}function respondWithResult(_0x2ca39b,_0x4470b8){_0x4470b8=_0x4470b8||0xc8;return function(_0x38c4dc){if(_0x38c4dc){return _0x2ca39b['status'](_0x4470b8)[_0x623b('0x16')](_0x38c4dc);}};}function respondWithFilteredResult(_0x67d3ff,_0x4e4b78){return function(_0x374247){if(_0x374247){var _0x542532=_0x374247[_0x623b('0x17')],_0x15c8a7=_0x4e4b78['offset'],_0x1d0251=_0x4e4b78[_0x623b('0x18')]+_0x4e4b78[_0x623b('0x19')],_0x2e3410;if(_0x1d0251>=_0x542532){_0x1d0251=_0x542532;_0x2e3410=0xc8;}else{_0x2e3410=0xce;}_0x67d3ff[_0x623b('0x1a')](_0x2e3410);return _0x67d3ff['set'](_0x623b('0x1b'),_0x15c8a7+'-'+_0x1d0251+'/'+_0x542532)[_0x623b('0x16')](_0x374247);}return null;};}function patchUpdates(_0x3f8416){return function(_0x60fa7){try{jsonpatch[_0x623b('0x1c')](_0x60fa7,_0x3f8416,!![]);}catch(_0x281cb5){return BPromise[_0x623b('0x1d')](_0x281cb5);}return _0x60fa7[_0x623b('0x1e')]();};}function saveUpdates(_0x26ad89,_0x5ab37f){return function(_0x500b1c){if(_0x500b1c){return _0x500b1c[_0x623b('0x1f')](_0x26ad89)[_0x623b('0x20')](function(_0x4fa7a0){return _0x4fa7a0;});}return null;};}function removeEntity(_0x1e180b,_0x5cd8d3){return function(_0x260293){if(_0x260293){return _0x260293['destroy']()['then'](function(){_0x1e180b[_0x623b('0x1a')](0xcc)[_0x623b('0x15')]();});}};}function handleEntityNotFound(_0x45d0f0,_0x16ab40){return function(_0x1b84f6){if(!_0x1b84f6){_0x45d0f0[_0x623b('0x21')](0x194);}return _0x1b84f6;};}function handleError(_0x37233e,_0x1d4c4e){_0x1d4c4e=_0x1d4c4e||0x1f4;return function(_0x1a3e75){logger['error'](_0x1a3e75[_0x623b('0x22')]);if(_0x1a3e75[_0x623b('0x23')]){delete _0x1a3e75['name'];}_0x37233e[_0x623b('0x1a')](_0x1d4c4e)[_0x623b('0x24')](_0x1a3e75);};}exports['index']=function(_0x14cbe2,_0x49a53d){var _0x23d020={},_0x33a597={},_0x12fa0f={'count':0x0,'rows':[]};var _0x39290a=_[_0x623b('0x25')](db[_0x623b('0x26')][_0x623b('0x27')],function(_0x2cad78){return{'name':_0x2cad78['fieldName'],'type':_0x2cad78[_0x623b('0x28')][_0x623b('0x29')]};});_0x33a597['model']=_[_0x623b('0x25')](_0x39290a,'name');_0x33a597[_0x623b('0x2a')]=_['keys'](_0x14cbe2[_0x623b('0x2a')]);_0x33a597[_0x623b('0x2b')]=_[_0x623b('0x2c')](_0x33a597[_0x623b('0x2d')],_0x33a597[_0x623b('0x2a')]);_0x23d020[_0x623b('0x2e')]=_['intersection'](_0x33a597[_0x623b('0x2d')],qs[_0x623b('0x2f')](_0x14cbe2[_0x623b('0x2a')][_0x623b('0x2f')]));_0x23d020[_0x623b('0x2e')]=_0x23d020[_0x623b('0x2e')][_0x623b('0x30')]?_0x23d020[_0x623b('0x2e')]:_0x33a597[_0x623b('0x2d')];if(!_0x14cbe2[_0x623b('0x2a')]['hasOwnProperty'](_0x623b('0x31'))){_0x23d020[_0x623b('0x19')]=qs[_0x623b('0x19')](_0x14cbe2[_0x623b('0x2a')][_0x623b('0x19')]);_0x23d020[_0x623b('0x18')]=qs[_0x623b('0x18')](_0x14cbe2[_0x623b('0x2a')]['offset']);}_0x23d020[_0x623b('0x32')]=qs['sort'](_0x14cbe2[_0x623b('0x2a')]['sort']);_0x23d020[_0x623b('0x33')]=qs[_0x623b('0x2b')](_[_0x623b('0x34')](_0x14cbe2['query'],_0x33a597[_0x623b('0x2b')]));if(_0x14cbe2[_0x623b('0x2a')][_0x623b('0x35')]){_0x23d020[_0x623b('0x33')]=_[_0x623b('0x36')](_0x23d020[_0x623b('0x33')],{'$or':_[_0x623b('0x25')](_0x39290a,function(_0x1950b3){if(_0x1950b3[_0x623b('0x28')]!==_0x623b('0x37')){var _0x1a5914={};_0x1a5914[_0x1950b3['name']]={'$like':'%'+_0x14cbe2['query']['filter']+'%'};return _0x1a5914;}})});}_0x23d020=_['merge']({},_0x23d020,_0x14cbe2[_0x623b('0x38')]);var _0x4b04ee={'where':_0x23d020[_0x623b('0x33')]};return db[_0x623b('0x26')][_0x623b('0x17')](_0x4b04ee)[_0x623b('0x20')](function(_0x1c750f){_0x12fa0f['count']=_0x1c750f;if(_0x14cbe2[_0x623b('0x2a')][_0x623b('0x39')]){_0x23d020[_0x623b('0x3a')]=[{'all':!![]}];}return db[_0x623b('0x26')][_0x623b('0x3b')](_0x23d020);})['then'](function(_0x52d741){_0x12fa0f[_0x623b('0x3c')]=_0x52d741;return _0x12fa0f;})[_0x623b('0x20')](respondWithFilteredResult(_0x49a53d,_0x23d020))[_0x623b('0x3d')](handleError(_0x49a53d,null));};exports['show']=function(_0x38125b,_0x591b81){var _0x1dcd75={'raw':!![],'where':{'id':_0x38125b[_0x623b('0x3e')]['id']}},_0x5cb44e={};_0x5cb44e[_0x623b('0x2d')]=_[_0x623b('0x3f')](db[_0x623b('0x26')]['rawAttributes']);_0x5cb44e[_0x623b('0x2a')]=_[_0x623b('0x3f')](_0x38125b[_0x623b('0x2a')]);_0x5cb44e[_0x623b('0x2b')]=_[_0x623b('0x2c')](_0x5cb44e[_0x623b('0x2d')],_0x5cb44e[_0x623b('0x2a')]);_0x1dcd75['attributes']=_[_0x623b('0x2c')](_0x5cb44e['model'],qs[_0x623b('0x2f')](_0x38125b[_0x623b('0x2a')][_0x623b('0x2f')]));_0x1dcd75['attributes']=_0x1dcd75[_0x623b('0x2e')][_0x623b('0x30')]?_0x1dcd75[_0x623b('0x2e')]:_0x5cb44e[_0x623b('0x2d')];if(_0x38125b['query'][_0x623b('0x39')]){_0x1dcd75[_0x623b('0x3a')]=[{'all':!![]}];}_0x1dcd75=_[_0x623b('0x36')]({},_0x1dcd75,_0x38125b[_0x623b('0x38')]);return db['ChatTransferReport']['find'](_0x1dcd75)['then'](handleEntityNotFound(_0x591b81,null))[_0x623b('0x20')](respondWithResult(_0x591b81,null))[_0x623b('0x3d')](handleError(_0x591b81,null));};exports[_0x623b('0x40')]=function(_0x3ecfc4,_0x3ff5a3){return db[_0x623b('0x26')][_0x623b('0x40')](_0x3ecfc4['body'],{})[_0x623b('0x20')](respondWithResult(_0x3ff5a3,0xc9))[_0x623b('0x3d')](handleError(_0x3ff5a3,null));};exports[_0x623b('0x1f')]=function(_0x2b4a5b,_0x4d919e){if(_0x2b4a5b[_0x623b('0x41')]['id']){delete _0x2b4a5b['body']['id'];}return db[_0x623b('0x26')][_0x623b('0x42')]({'where':{'id':_0x2b4a5b['params']['id']}})[_0x623b('0x20')](handleEntityNotFound(_0x4d919e,null))['then'](saveUpdates(_0x2b4a5b[_0x623b('0x41')],null))['then'](respondWithResult(_0x4d919e,null))[_0x623b('0x3d')](handleError(_0x4d919e,null));};exports['destroy']=function(_0x3a8b2f,_0x5d126f){return db[_0x623b('0x26')][_0x623b('0x42')]({'where':{'id':_0x3a8b2f[_0x623b('0x3e')]['id']}})[_0x623b('0x20')](handleEntityNotFound(_0x5d126f,null))[_0x623b('0x20')](removeEntity(_0x5d126f,null))['catch'](handleError(_0x5d126f,null));};exports['describe']=function(_0x5dbd9e,_0x325691){return db[_0x623b('0x26')][_0x623b('0x43')]()['then'](respondWithResult(_0x325691,null))[_0x623b('0x3d')](handleError(_0x325691,null));}; \ No newline at end of file +var _0x2097=['status','json','offset','limit','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','includeAll','findAll','rows','catch','params','include','options','create','body','find','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus'];(function(_0x87724d,_0x4b15b5){var _0x5d7c0d=function(_0x12c697){while(--_0x12c697){_0x87724d['push'](_0x87724d['shift']());}};_0x5d7c0d(++_0x4b15b5);}(_0x2097,0xc4));var _0x7209=function(_0x531203,_0x23040d){_0x531203=_0x531203-0x0;var _0x463027=_0x2097[_0x531203];return _0x463027;};'use strict';var pdf=require(_0x7209('0x0'));var emlformat=require(_0x7209('0x1'));var rimraf=require(_0x7209('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7209('0x3'));var rp=require(_0x7209('0x4'));var moment=require('moment');var BPromise=require(_0x7209('0x5'));var Mustache=require(_0x7209('0x6'));var util=require(_0x7209('0x7'));var path=require(_0x7209('0x8'));var sox=require(_0x7209('0x9'));var csv=require(_0x7209('0xa'));var ejs=require(_0x7209('0xb'));var fs=require('fs');var _=require(_0x7209('0xc'));var squel=require(_0x7209('0xd'));var crypto=require(_0x7209('0xe'));var jsforce=require(_0x7209('0xf'));var deskjs=require(_0x7209('0x10'));var toCsv=require('to-csv');var querystring=require(_0x7209('0x11'));var Papa=require('papaparse');var Redis=require(_0x7209('0x12'));var authService=require(_0x7209('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7209('0x14'));var hardwareService=require(_0x7209('0x15'));var logger=require(_0x7209('0x16'))('api');var utils=require(_0x7209('0x17'));var config=require(_0x7209('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x90015d,_0x21ab6b){_0x21ab6b=_0x21ab6b||0xcc;return function(_0x345c49){if(_0x345c49){return _0x90015d[_0x7209('0x19')](_0x21ab6b);}return _0x90015d[_0x7209('0x1a')](_0x21ab6b)['end']();};}function respondWithResult(_0x2c5509,_0x5cdffc){_0x5cdffc=_0x5cdffc||0xc8;return function(_0x4fa756){if(_0x4fa756){return _0x2c5509[_0x7209('0x1a')](_0x5cdffc)[_0x7209('0x1b')](_0x4fa756);}};}function respondWithFilteredResult(_0x13fd60,_0x4a373c){return function(_0x5929ef){if(_0x5929ef){var _0x523e09=_0x5929ef['count'],_0x23f400=_0x4a373c[_0x7209('0x1c')],_0x4a665a=_0x4a373c['offset']+_0x4a373c[_0x7209('0x1d')],_0x3eecb7;if(_0x4a665a>=_0x523e09){_0x4a665a=_0x523e09;_0x3eecb7=0xc8;}else{_0x3eecb7=0xce;}_0x13fd60[_0x7209('0x1a')](_0x3eecb7);return _0x13fd60['set']('Content-Range',_0x23f400+'-'+_0x4a665a+'/'+_0x523e09)['json'](_0x5929ef);}return null;};}function patchUpdates(_0x3d6726){return function(_0x9ef570){try{jsonpatch[_0x7209('0x1e')](_0x9ef570,_0x3d6726,!![]);}catch(_0x3d9581){return BPromise[_0x7209('0x1f')](_0x3d9581);}return _0x9ef570['save']();};}function saveUpdates(_0x2dc7c6,_0x455224){return function(_0x30ea95){if(_0x30ea95){return _0x30ea95[_0x7209('0x20')](_0x2dc7c6)[_0x7209('0x21')](function(_0x124f7a){return _0x124f7a;});}return null;};}function removeEntity(_0x272377,_0x5e7863){return function(_0x4130ae){if(_0x4130ae){return _0x4130ae[_0x7209('0x22')]()[_0x7209('0x21')](function(){_0x272377[_0x7209('0x1a')](0xcc)[_0x7209('0x23')]();});}};}function handleEntityNotFound(_0x23b073,_0xc8aab1){return function(_0x516106){if(!_0x516106){_0x23b073[_0x7209('0x19')](0x194);}return _0x516106;};}function handleError(_0x542696,_0x2ad9c7){_0x2ad9c7=_0x2ad9c7||0x1f4;return function(_0x230901){logger[_0x7209('0x24')](_0x230901[_0x7209('0x25')]);if(_0x230901['name']){delete _0x230901[_0x7209('0x26')];}_0x542696[_0x7209('0x1a')](_0x2ad9c7)[_0x7209('0x27')](_0x230901);};}exports[_0x7209('0x28')]=function(_0x5f2833,_0x3d1fd1){var _0x487b77={},_0x8843d0={},_0x2a3a5f={'count':0x0,'rows':[]};var _0x23f37a=_[_0x7209('0x29')](db[_0x7209('0x2a')][_0x7209('0x2b')],function(_0x290c5f){return{'name':_0x290c5f['fieldName'],'type':_0x290c5f[_0x7209('0x2c')][_0x7209('0x2d')]};});_0x8843d0[_0x7209('0x2e')]=_[_0x7209('0x29')](_0x23f37a,_0x7209('0x26'));_0x8843d0['query']=_[_0x7209('0x2f')](_0x5f2833[_0x7209('0x30')]);_0x8843d0[_0x7209('0x31')]=_[_0x7209('0x32')](_0x8843d0['model'],_0x8843d0[_0x7209('0x30')]);_0x487b77[_0x7209('0x33')]=_['intersection'](_0x8843d0[_0x7209('0x2e')],qs[_0x7209('0x34')](_0x5f2833[_0x7209('0x30')][_0x7209('0x34')]));_0x487b77[_0x7209('0x33')]=_0x487b77[_0x7209('0x33')][_0x7209('0x35')]?_0x487b77[_0x7209('0x33')]:_0x8843d0['model'];if(!_0x5f2833[_0x7209('0x30')][_0x7209('0x36')](_0x7209('0x37'))){_0x487b77['limit']=qs['limit'](_0x5f2833[_0x7209('0x30')]['limit']);_0x487b77[_0x7209('0x1c')]=qs['offset'](_0x5f2833[_0x7209('0x30')][_0x7209('0x1c')]);}_0x487b77[_0x7209('0x38')]=qs[_0x7209('0x39')](_0x5f2833[_0x7209('0x30')][_0x7209('0x39')]);_0x487b77[_0x7209('0x3a')]=qs['filters'](_[_0x7209('0x3b')](_0x5f2833[_0x7209('0x30')],_0x8843d0[_0x7209('0x31')]));if(_0x5f2833[_0x7209('0x30')][_0x7209('0x3c')]){_0x487b77[_0x7209('0x3a')]=_['merge'](_0x487b77[_0x7209('0x3a')],{'$or':_[_0x7209('0x29')](_0x23f37a,function(_0x4bd8d8){if(_0x4bd8d8[_0x7209('0x2c')]!==_0x7209('0x3d')){var _0x3ceccb={};_0x3ceccb[_0x4bd8d8[_0x7209('0x26')]]={'$like':'%'+_0x5f2833[_0x7209('0x30')][_0x7209('0x3c')]+'%'};return _0x3ceccb;}})});}_0x487b77=_[_0x7209('0x3e')]({},_0x487b77,_0x5f2833['options']);var _0x17b192={'where':_0x487b77[_0x7209('0x3a')]};return db[_0x7209('0x2a')][_0x7209('0x3f')](_0x17b192)[_0x7209('0x21')](function(_0x5aa5f6){_0x2a3a5f[_0x7209('0x3f')]=_0x5aa5f6;if(_0x5f2833[_0x7209('0x30')][_0x7209('0x40')]){_0x487b77['include']=[{'all':!![]}];}return db[_0x7209('0x2a')][_0x7209('0x41')](_0x487b77);})['then'](function(_0x52c55a){_0x2a3a5f[_0x7209('0x42')]=_0x52c55a;return _0x2a3a5f;})[_0x7209('0x21')](respondWithFilteredResult(_0x3d1fd1,_0x487b77))[_0x7209('0x43')](handleError(_0x3d1fd1,null));};exports['show']=function(_0x3a59ba,_0x22f3c1){var _0xbc1aa6={'raw':!![],'where':{'id':_0x3a59ba[_0x7209('0x44')]['id']}},_0x2eef1e={};_0x2eef1e[_0x7209('0x2e')]=_['keys'](db[_0x7209('0x2a')][_0x7209('0x2b')]);_0x2eef1e[_0x7209('0x30')]=_[_0x7209('0x2f')](_0x3a59ba[_0x7209('0x30')]);_0x2eef1e['filters']=_['intersection'](_0x2eef1e[_0x7209('0x2e')],_0x2eef1e[_0x7209('0x30')]);_0xbc1aa6[_0x7209('0x33')]=_[_0x7209('0x32')](_0x2eef1e[_0x7209('0x2e')],qs['fields'](_0x3a59ba[_0x7209('0x30')][_0x7209('0x34')]));_0xbc1aa6[_0x7209('0x33')]=_0xbc1aa6[_0x7209('0x33')][_0x7209('0x35')]?_0xbc1aa6['attributes']:_0x2eef1e['model'];if(_0x3a59ba['query'][_0x7209('0x40')]){_0xbc1aa6[_0x7209('0x45')]=[{'all':!![]}];}_0xbc1aa6=_[_0x7209('0x3e')]({},_0xbc1aa6,_0x3a59ba[_0x7209('0x46')]);return db[_0x7209('0x2a')]['find'](_0xbc1aa6)[_0x7209('0x21')](handleEntityNotFound(_0x22f3c1,null))['then'](respondWithResult(_0x22f3c1,null))[_0x7209('0x43')](handleError(_0x22f3c1,null));};exports[_0x7209('0x47')]=function(_0x309e9f,_0xe23600){return db[_0x7209('0x2a')]['create'](_0x309e9f[_0x7209('0x48')],{})[_0x7209('0x21')](respondWithResult(_0xe23600,0xc9))[_0x7209('0x43')](handleError(_0xe23600,null));};exports[_0x7209('0x20')]=function(_0x1acb83,_0x5a7be6){if(_0x1acb83['body']['id']){delete _0x1acb83[_0x7209('0x48')]['id'];}return db[_0x7209('0x2a')][_0x7209('0x49')]({'where':{'id':_0x1acb83['params']['id']}})[_0x7209('0x21')](handleEntityNotFound(_0x5a7be6,null))['then'](saveUpdates(_0x1acb83[_0x7209('0x48')],null))[_0x7209('0x21')](respondWithResult(_0x5a7be6,null))[_0x7209('0x43')](handleError(_0x5a7be6,null));};exports['destroy']=function(_0x22a726,_0x1af990){return db[_0x7209('0x2a')][_0x7209('0x49')]({'where':{'id':_0x22a726['params']['id']}})[_0x7209('0x21')](handleEntityNotFound(_0x1af990,null))[_0x7209('0x21')](removeEntity(_0x1af990,null))[_0x7209('0x43')](handleError(_0x1af990,null));};exports['describe']=function(_0x137a5c,_0x464b76){return db[_0x7209('0x2a')]['describe']()[_0x7209('0x21')](respondWithResult(_0x464b76,null))[_0x7209('0x43')](handleError(_0x464b76,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 1439f92..af974d5 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 _0x91a7=['uniqueid','util','../../config/logger','api','bluebird','path','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer'];(function(_0x4675ea,_0x8f19c2){var _0x18fa7c=function(_0x19f897){while(--_0x19f897){_0x4675ea['push'](_0x4675ea['shift']());}};_0x18fa7c(++_0x8f19c2);}(_0x91a7,0xe7));var _0x791a=function(_0x5ec688,_0x115f65){_0x5ec688=_0x5ec688-0x0;var _0x557ef0=_0x91a7[_0x5ec688];return _0x557ef0;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x791a('0x5'));module[_0x791a('0x6')]=function(_0x49a9b7,_0x361f53){return _0x49a9b7['define'](_0x791a('0x7'),attributes,{'tableName':_0x791a('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x791a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x42fb=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','report_chat_transfer'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x42fb,0x9d));var _0xb42f=function(_0x4fe3eb,_0x49d94e){_0x4fe3eb=_0x4fe3eb-0x0;var _0x27a8ff=_0x42fb[_0x4fe3eb];return _0x27a8ff;};'use strict';var _=require(_0xb42f('0x0'));var util=require(_0xb42f('0x1'));var logger=require(_0xb42f('0x2'))(_0xb42f('0x3'));var moment=require(_0xb42f('0x4'));var BPromise=require(_0xb42f('0x5'));var rp=require(_0xb42f('0x6'));var fs=require('fs');var path=require(_0xb42f('0x7'));var rimraf=require('rimraf');var config=require(_0xb42f('0x8'));var attributes=require('./chatTransferReport.attributes');module[_0xb42f('0x9')]=function(_0x293444,_0x2caf77){return _0x293444[_0xb42f('0xa')]('ChatTransferReport',attributes,{'tableName':_0xb42f('0xb'),'paranoid':![],'indexes':[{'name':_0xb42f('0xc'),'fields':[_0xb42f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5997032..247928b 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 _0xcb7b=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xcb7b,0x12c));var _0xbcb7=function(_0x360048,_0x4a9e68){_0x360048=_0x360048-0x0;var _0x447c22=_0xcb7b[_0x360048];return _0x447c22;};'use strict';var _=require(_0xbcb7('0x0'));var util=require(_0xbcb7('0x1'));var moment=require(_0xbcb7('0x2'));var BPromise=require(_0xbcb7('0x3'));var rs=require(_0xbcb7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcb7('0x5'))['db'];var utils=require(_0xbcb7('0x6'));var logger=require(_0xbcb7('0x7'))('rpc');var config=require(_0xbcb7('0x8'));var jayson=require(_0xbcb7('0x9'));var client=jayson[_0xbcb7('0xa')][_0xbcb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bc3fa,_0x4f29cc,_0x31b404){return new BPromise(function(_0x37e774,_0x271a61){return client['request'](_0x2bc3fa,_0x31b404)[_0xbcb7('0xc')](function(_0x5110c7){logger[_0xbcb7('0xd')](_0xbcb7('0xe'),_0x4f29cc,_0xbcb7('0xf'));logger['debug'](_0xbcb7('0x10'),_0x4f29cc,_0xbcb7('0xf'),JSON[_0xbcb7('0x11')](_0x5110c7));if(_0x5110c7[_0xbcb7('0x12')]){if(_0x5110c7[_0xbcb7('0x12')]['code']===0x1f4){logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x4f29cc,_0x5110c7['error'][_0xbcb7('0x13')]);return _0x271a61(_0x5110c7[_0xbcb7('0x12')][_0xbcb7('0x13')]);}logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x4f29cc,_0x5110c7['error'][_0xbcb7('0x13')]);return _0x37e774(_0x5110c7[_0xbcb7('0x12')]['message']);}else{logger[_0xbcb7('0xd')](_0xbcb7('0xe'),_0x4f29cc,_0xbcb7('0xf'));_0x37e774(_0x5110c7[_0xbcb7('0x14')]['message']);}})['catch'](function(_0x5ed9d8){logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x4f29cc,_0x5ed9d8);_0x271a61(_0x5ed9d8);});});} \ No newline at end of file +var _0x46e8=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x46e8,0x1f3));var _0x846e=function(_0x4e28e2,_0x19a1dc){_0x4e28e2=_0x4e28e2-0x0;var _0x36cead=_0x46e8[_0x4e28e2];return _0x36cead;};'use strict';var _=require(_0x846e('0x0'));var util=require('util');var moment=require(_0x846e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x846e('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x846e('0x3'));var logger=require(_0x846e('0x4'))(_0x846e('0x5'));var config=require(_0x846e('0x6'));var jayson=require(_0x846e('0x7'));var client=jayson['client'][_0x846e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a6700,_0x455832,_0x11fdcb){return new BPromise(function(_0x1676a5,_0x28b742){return client['request'](_0x5a6700,_0x11fdcb)[_0x846e('0x9')](function(_0x1d1c2e){logger[_0x846e('0xa')](_0x846e('0xb'),_0x455832,_0x846e('0xc'));logger[_0x846e('0xd')](_0x846e('0xe'),_0x455832,_0x846e('0xc'),JSON[_0x846e('0xf')](_0x1d1c2e));if(_0x1d1c2e['error']){if(_0x1d1c2e[_0x846e('0x10')][_0x846e('0x11')]===0x1f4){logger[_0x846e('0x10')](_0x846e('0xb'),_0x455832,_0x1d1c2e['error'][_0x846e('0x12')]);return _0x28b742(_0x1d1c2e[_0x846e('0x10')][_0x846e('0x12')]);}logger[_0x846e('0x10')](_0x846e('0xb'),_0x455832,_0x1d1c2e['error']['message']);return _0x1676a5(_0x1d1c2e['error'][_0x846e('0x12')]);}else{logger[_0x846e('0xa')]('ChatTransferReport,\x20%s,\x20%s',_0x455832,'request\x20sent');_0x1676a5(_0x1d1c2e[_0x846e('0x13')][_0x846e('0x12')]);}})['catch'](function(_0x5d84d4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x455832,_0x5d84d4);_0x28b742(_0x5d84d4);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index ea49f45..98406e3 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 _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x1a9b21,_0x58e570){var _0x1572e9=function(_0x3b39d3){while(--_0x3b39d3){_0x1a9b21['push'](_0x1a9b21['shift']());}};_0x1572e9(++_0x58e570);}(_0x0b0e,0x187));var _0xe0b0=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x0b0e[_0xe1b5f6];return _0x44636e;};'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 auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x1b5ec6,_0x37a396){var _0x253173=function(_0x24dc25){while(--_0x24dc25){_0x1b5ec6['push'](_0x1b5ec6['shift']());}};_0x253173(++_0x37a396);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2b338b,_0x4a06ba){_0x2b338b=_0x2b338b-0x0;var _0x256f66=_0x0b0e[_0x2b338b];return _0x256f66;};'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 auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 9ce873a..75cb580 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 _0x35b9=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Skip','Feedback','star','thumb','input','name','getDataValue','onlineForm','stringify','textarea','Comments','offlineForm','parse','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.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','address','email','#9f946a','INTEGER','BOOLEAN','ENUM'];(function(_0x52f0c1,_0x17e813){var _0x1a6d5c=function(_0x138dc0){while(--_0x138dc0){_0x52f0c1['push'](_0x52f0c1['shift']());}};_0x1a6d5c(++_0x17e813);}(_0x35b9,0x14e));var _0x935b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x35b9[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x935b('0x0'));var rs=require('randomstring');module[_0x935b('0x1')]={'name':{'type':Sequelize[_0x935b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'unique':_0x935b('0x3')},'description':{'type':Sequelize[_0x935b('0x2')]},'mapKey':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x4')},'mapKeyOffline':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x4')},'key':{'type':Sequelize[_0x935b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x935b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':_0x935b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x935b('0x2')]},'animation':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x935b('0x8')](_0x935b('0x9'),_0x935b('0xa')),'defaultValue':_0x935b('0x9')},'header_online':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xb')},'start_chat_button':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xc')},'offline_chat_button':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xd')},'header_offline':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x935b('0x10')]},'closingQuestion':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x935b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x935b('0x14')},'conditionAgreement':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x15')},'ratingType':{'type':Sequelize[_0x935b('0x8')](_0x935b('0x16'),_0x935b('0x17')),'defaultValue':_0x935b('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x935b('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x935b('0x18'),'variable':null,'config':{'placeholder':_0x935b('0x19'),'type':'text','required':!![]},'props':{'title':_0x935b('0x19'),'helpText':''}},{'type':_0x935b('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x935b('0x4'),'type':_0x935b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x935b('0x1a')](_0x935b('0x1b'))?JSON['parse'](this[_0x935b('0x1a')](_0x935b('0x1b'))):{};},'set':function(_0x3ee48e){return this['setDataValue'](_0x935b('0x1b'),JSON[_0x935b('0x1c')](_0x3ee48e));}},'offlineForm':{'type':Sequelize[_0x935b('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x935b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x935b('0x4')},'variable':null},{'type':_0x935b('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':_0x935b('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x935b('0x1a')](_0x935b('0x1f'))?JSON[_0x935b('0x20')](this[_0x935b('0x1a')]('offlineForm')):{};},'set':function(_0x577f06){return this[_0x935b('0x21')]('offlineForm',JSON[_0x935b('0x1c')](_0x577f06));}},'token':{'type':Sequelize[_0x935b('0x2')],'defaultValue':function(){return rs[_0x935b('0x22')]();}},'autoclose':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x935b('0x2')]},'forwardOffline':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x935b('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x935b('0x23')},'waitingMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x25')},'offlineMessageBody':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x935b('0x14')},'sendUnmanaged':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x935b('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x935b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x935b('0x10')],'defaultValue':function(){return _0x935b('0x28');}},'notificationSound':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x935b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x935b('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x2a')},'defaultTitle':{'type':Sequelize[_0x935b('0x2')]},'customerAvatar':{'type':Sequelize[_0x935b('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':_0x935b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x935b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x935b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x2c')},'systemAvatar':{'type':Sequelize[_0x935b('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x935b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![],'comment':_0x935b('0x2e'),'set':function(_0x14fb0c){if(!_0x14fb0c)this[_0x935b('0x21')](_0x935b('0x2f'),null);this['setDataValue'](_0x935b('0x30'),_0x14fb0c);}}}; \ No newline at end of file +var _0x4e36=['New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','address','email','Agent','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Send','BOOLEAN','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'];(function(_0x3b7a0c,_0xf1a4c2){var _0x3bb70f=function(_0x248b52){while(--_0x248b52){_0x3b7a0c['push'](_0x3b7a0c['shift']());}};_0x3bb70f(++_0xf1a4c2);}(_0x4e36,0x132));var _0x64e3=function(_0x49f892,_0x54bea3){_0x49f892=_0x49f892-0x0;var _0x104f9a=_0x4e36[_0x49f892];return _0x104f9a;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x64e3('0x0'));module['exports']={'name':{'type':Sequelize[_0x64e3('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x64e3('0x1')],'allowNull':![],'unique':_0x64e3('0x2')},'description':{'type':Sequelize[_0x64e3('0x1')]},'mapKey':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x64e3('0x3')},'key':{'type':Sequelize[_0x64e3('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x64e3('0x4')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x64e3('0x1')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x64e3('0x1')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x64e3('0x1')],'allowNull':![],'defaultValue':_0x64e3('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x64e3('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x64e3('0x1')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x64e3('0x7')](_0x64e3('0x8'),_0x64e3('0x9')),'defaultValue':_0x64e3('0x8')},'header_online':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0xa')},'start_chat_button':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0xb')},'header_offline':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x64e3('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x64e3('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0xf')},'noteTitle':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x10')},'placeholderMessage':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x11')},'closingMessage':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x12')},'closingMessageButton':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0xb')},'skipMessageButton':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x13')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x64e3('0x14')},'ratingType':{'type':Sequelize[_0x64e3('0x7')](_0x64e3('0x15'),'thumb'),'defaultValue':_0x64e3('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x64e3('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x64e3('0x16')]({'items':[{'type':_0x64e3('0x17'),'variable':null,'config':{'placeholder':_0x64e3('0x18'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x64e3('0x3'),'type':_0x64e3('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x64e3('0x19')](_0x64e3('0x1a'))?JSON[_0x64e3('0x1b')](this['getDataValue'](_0x64e3('0x1a'))):{};},'set':function(_0x9ba7a6){return this[_0x64e3('0x1c')](_0x64e3('0x1a'),JSON[_0x64e3('0x16')](_0x9ba7a6));}},'offlineForm':{'type':Sequelize[_0x64e3('0x1d')],'defaultValue':function(){return JSON[_0x64e3('0x16')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x64e3('0x3')},'variable':null},{'type':_0x64e3('0x1e'),'config':{'placeholder':_0x64e3('0x1f')},'props':{'title':'Comments','helpText':_0x64e3('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x64e3('0x19')](_0x64e3('0x21'))?JSON[_0x64e3('0x1b')](this[_0x64e3('0x19')](_0x64e3('0x21'))):{};},'set':function(_0x50d4d6){return this[_0x64e3('0x1c')]('offlineForm',JSON[_0x64e3('0x16')](_0x50d4d6));}},'token':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':function(){return rs[_0x64e3('0x22')]();}},'autoclose':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x64e3('0x1')]},'waitingTitle':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x23')},'waitingMessage':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x64e3('0x25')},'offlineMessageBody':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x26')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x27')},'skipUnmanaged':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x13')},'sendUnmanaged':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x64e3('0x1d')]},'showAgentAvatar':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x64e3('0x1')]},'notificationTemplate':{'type':Sequelize[_0x64e3('0x1d')],'defaultValue':function(){return _0x64e3('0x28');}},'notificationSound':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x64e3('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x64e3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x64e3('0x2a')},'defaultTitle':{'type':Sequelize[_0x64e3('0x1')]},'customerAvatar':{'type':Sequelize[_0x64e3('0x1d')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x64e3('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x64e3('0x1')],'allowNull':![],'defaultValue':_0x64e3('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x64e3('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x64e3('0x1')],'defaultValue':_0x64e3('0x2c')},'systemAvatar':{'type':Sequelize[_0x64e3('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x64e3('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x64e3('0xc')],'defaultValue':![],'comment':_0x64e3('0x2e'),'set':function(_0x1a8fba){if(!_0x1a8fba)this[_0x64e3('0x1c')](_0x64e3('0x2f'),null);this[_0x64e3('0x1c')](_0x64e3('0x30'),_0x1a8fba);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index f858186..72665a7 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 _0xf663=['createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','Applications','List','account','applications','list','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','rows','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','replace','alignment','verticalAlignment','textColor','sequelize','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','items','fromKey','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','limit','set','Content-Range','json','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','offset','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','nolimit','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','getResult','ValidationError'];(function(_0x41677f,_0x3d5cbc){var _0x3827ce=function(_0x517002){while(--_0x517002){_0x41677f['push'](_0x41677f['shift']());}};_0x3827ce(++_0x3d5cbc);}(_0xf663,0x1aa));var _0x3f66=function(_0x29f574,_0x4e27dd){_0x29f574=_0x29f574-0x0;var _0xbc2316=_0xf663[_0x29f574];return _0xbc2316;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3f66('0x0'));var rimraf=require(_0x3f66('0x1'));var zipdir=require(_0x3f66('0x2'));var jsonpatch=require(_0x3f66('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f66('0x4'));var path=require(_0x3f66('0x5'));var sox=require(_0x3f66('0x6'));var csv=require(_0x3f66('0x7'));var ejs=require(_0x3f66('0x8'));var fs=require('fs');var _=require(_0x3f66('0x9'));var squel=require(_0x3f66('0xa'));var crypto=require(_0x3f66('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3f66('0xc'));var toCsv=require(_0x3f66('0x7'));var querystring=require(_0x3f66('0xd'));var Papa=require(_0x3f66('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f66('0xf'));var as=require(_0x3f66('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f66('0x11'))(_0x3f66('0x12'));var utils=require('../../config/utils');var config=require(_0x3f66('0x13'));var db=require(_0x3f66('0x14'))['db'];config['redis']=_[_0x3f66('0x15')](config[_0x3f66('0x16')],{'host':_0x3f66('0x17'),'port':0x18eb});var socket=require(_0x3f66('0x18'))(new Redis(config['redis']));require(_0x3f66('0x19'))[_0x3f66('0x1a')](socket);var jayson=require(_0x3f66('0x1b'));var client=jayson[_0x3f66('0x1c')][_0x3f66('0x1d')]({'port':0x232c});var client9002=jayson[_0x3f66('0x1c')][_0x3f66('0x1d')]({'port':0x232a});var client9003=jayson[_0x3f66('0x1c')][_0x3f66('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x2b290f,_0x48a9b6,_0x219b85){if(_0x219b85){var _0x4ed9be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ed9be[_0x3f66('0x1e')](_0x48a9b6)){return _0x2b290f;}else{throw new db[(_0x3f66('0x1f'))]['ValidationError'](_0x3f66('0x20'));}}else{return _0x2b290f;}}function respondWithRpcPromise(_0x326d33,_0x5c6806,_0xf32dec,_0x529458){return new BPromise(function(_0x13e478,_0x3a2b32){var _0x5849c4=_0x529458||client;return _0x5849c4[_0x3f66('0x21')](_0x326d33,_0xf32dec)[_0x3f66('0x22')](function(_0x3960a1){logger[_0x3f66('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x5c6806,_0x3f66('0x24'));logger[_0x3f66('0x25')](_0x3f66('0x26'),_0x5c6806,'request\x20sent',JSON[_0x3f66('0x27')](_0x3960a1));if(_0x3960a1[_0x3f66('0x28')]){if(_0x3960a1[_0x3f66('0x28')]['code']===0x1f4){logger['error'](_0x3f66('0x29'),_0x5c6806,_0x3960a1['error'][_0x3f66('0x2a')]);return _0x3a2b32(_0x3960a1[_0x3f66('0x28')]['message']);}logger[_0x3f66('0x28')](_0x3f66('0x29'),_0x5c6806,_0x3960a1['error'][_0x3f66('0x2a')]);return _0x13e478(_0x3960a1[_0x3f66('0x28')]['message']);}else{logger[_0x3f66('0x23')](_0x3f66('0x29'),_0x5c6806,'request\x20sent');_0x13e478(_0x3960a1[_0x3f66('0x2b')]['message']);}})[_0x3f66('0x2c')](function(_0x1b2f40){logger[_0x3f66('0x28')](_0x3f66('0x29'),_0x5c6806,_0x1b2f40);_0x3a2b32(_0x1b2f40);});});}function respondWithStatusCode(_0x434a74,_0x187d0c){_0x187d0c=_0x187d0c||0xcc;return function(_0x484c49){if(_0x484c49){return _0x434a74[_0x3f66('0x2d')](_0x187d0c);}return _0x434a74[_0x3f66('0x2e')](_0x187d0c)[_0x3f66('0x2f')]();};}function respondWithResult(_0x3ebd49,_0x2acecb){_0x2acecb=_0x2acecb||0xc8;return function(_0x524536){if(_0x524536){return _0x3ebd49[_0x3f66('0x2e')](_0x2acecb)['json'](_0x524536);}};}function respondWithFilteredResult(_0x21c034,_0x7aeb84){return function(_0x103623){if(_0x103623){var _0x2e26fc=_0x103623[_0x3f66('0x30')],_0x5c462e=_0x7aeb84['offset'],_0x56119b=_0x7aeb84['offset']+_0x7aeb84[_0x3f66('0x31')],_0x3634bf;if(_0x56119b>=_0x2e26fc){_0x56119b=_0x2e26fc;_0x3634bf=0xc8;}else{_0x3634bf=0xce;}_0x21c034[_0x3f66('0x2e')](_0x3634bf);return _0x21c034[_0x3f66('0x32')](_0x3f66('0x33'),_0x5c462e+'-'+_0x56119b+'/'+_0x2e26fc)[_0x3f66('0x34')](_0x103623);}return null;};}function patchUpdates(_0x4aae){return function(_0x1f21dc){try{jsonpatch[_0x3f66('0x35')](_0x1f21dc,_0x4aae,!![]);}catch(_0x1842e8){return BPromise['reject'](_0x1842e8);}return _0x1f21dc[_0x3f66('0x36')]();};}function saveUpdates(_0x2850cf,_0x47e24d){return function(_0x79587){if(_0x79587){return _0x79587[_0x3f66('0x37')](_0x2850cf)[_0x3f66('0x22')](function(_0x176692){return _0x176692;});}return null;};}function removeEntity(_0x57a8e4,_0x43da46){return function(_0x50b034){if(_0x50b034){return _0x50b034[_0x3f66('0x38')]()[_0x3f66('0x22')](function(){var _0x25290c=_0x50b034[_0x3f66('0x39')]({'plain':!![]});var _0x20a6f0=_0x3f66('0x3a');return db[_0x3f66('0x3b')]['destroy']({'where':{'type':_0x20a6f0,'resourceId':_0x25290c['id']}})['then'](function(){return _0x50b034;});})[_0x3f66('0x22')](function(){_0x57a8e4[_0x3f66('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281908,_0x35b977){return function(_0x197bab){if(!_0x197bab){_0x281908[_0x3f66('0x2d')](0x194);}return _0x197bab;};}function handleError(_0x412419,_0x3bc5a3){_0x3bc5a3=_0x3bc5a3||0x1f4;return function(_0x330a5e){logger[_0x3f66('0x28')](_0x330a5e['stack']);if(_0x330a5e[_0x3f66('0x3c')]){delete _0x330a5e['name'];}_0x412419[_0x3f66('0x2e')](_0x3bc5a3)[_0x3f66('0x3d')](_0x330a5e);};}exports[_0x3f66('0x3e')]=function(_0x4eed16,_0xabd8e3){var _0x168b95={'include':[{'model':db['Pause'],'as':_0x3f66('0x3f')}]},_0x21a626={},_0xe70d33={'count':0x0,'rows':[]};var _0x28e0a=_[_0x3f66('0x40')](db[_0x3f66('0x41')]['rawAttributes'],function(_0x5943d0){return{'name':_0x5943d0[_0x3f66('0x42')],'type':_0x5943d0[_0x3f66('0x43')][_0x3f66('0x44')]};});_0x21a626[_0x3f66('0x45')]=_[_0x3f66('0x40')](_0x28e0a,_0x3f66('0x3c'));_0x21a626[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x4eed16[_0x3f66('0x46')]);_0x21a626[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x21a626[_0x3f66('0x45')],_0x21a626[_0x3f66('0x46')]);_0x168b95[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x21a626['model'],qs[_0x3f66('0x4b')](_0x4eed16[_0x3f66('0x46')][_0x3f66('0x4b')]));_0x168b95['attributes']=_0x168b95['attributes'][_0x3f66('0x4c')]?_0x168b95[_0x3f66('0x4a')]:_0x21a626[_0x3f66('0x45')];if(!_0x4eed16[_0x3f66('0x46')]['hasOwnProperty']('nolimit')){_0x168b95[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x4eed16['query'][_0x3f66('0x31')]);_0x168b95['offset']=qs[_0x3f66('0x4d')](_0x4eed16['query'][_0x3f66('0x4d')]);}_0x168b95['order']=qs[_0x3f66('0x4e')](_0x4eed16[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x168b95[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x4eed16['query'],_0x21a626[_0x3f66('0x48')]));if(_0x4eed16[_0x3f66('0x46')]['filter']){_0x168b95[_0x3f66('0x4f')]=_['merge'](_0x168b95[_0x3f66('0x4f')],{'$or':_['map'](_0x28e0a,function(_0x482984){if(_0x482984[_0x3f66('0x43')]!==_0x3f66('0x51')){var _0x50940e={};_0x50940e[_0x482984['name']]={'$like':'%'+_0x4eed16[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x50940e;}})});}_0x168b95=_[_0x3f66('0x53')]({},_0x168b95,_0x4eed16[_0x3f66('0x54')]);var _0x251245={'where':_0x168b95['where']};return db[_0x3f66('0x41')]['count'](_0x251245)['then'](function(_0x1c3dea){_0xe70d33[_0x3f66('0x30')]=_0x1c3dea;if(_0x4eed16[_0x3f66('0x46')][_0x3f66('0x55')]){_0x168b95[_0x3f66('0x56')]=[{'all':!![]}];}return db[_0x3f66('0x41')][_0x3f66('0x57')](_0x168b95);})['then'](function(_0x1c3bb8){_0xe70d33['rows']=_0x1c3bb8;return _0xe70d33;})['then'](respondWithFilteredResult(_0xabd8e3,_0x168b95))[_0x3f66('0x2c')](handleError(_0xabd8e3,null));};exports[_0x3f66('0x58')]=function(_0xe2e1cf,_0x37e5bf){var _0x1df853={'raw':![],'where':{'id':_0xe2e1cf[_0x3f66('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x3f66('0x3f')}]},_0x1b9fba={};_0x1b9fba[_0x3f66('0x45')]=_[_0x3f66('0x47')](db[_0x3f66('0x41')][_0x3f66('0x5a')]);_0x1b9fba[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0xe2e1cf['query']);_0x1b9fba[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x1b9fba[_0x3f66('0x45')],_0x1b9fba[_0x3f66('0x46')]);_0x1df853[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x1b9fba[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0xe2e1cf[_0x3f66('0x46')]['fields']));_0x1df853['attributes']=_0x1df853['attributes'][_0x3f66('0x4c')]?_0x1df853[_0x3f66('0x4a')]:_0x1b9fba[_0x3f66('0x45')];if(_0xe2e1cf[_0x3f66('0x46')][_0x3f66('0x55')]){_0x1df853['include']=[{'all':!![]}];}_0x1df853=_['merge']({},_0x1df853,_0xe2e1cf[_0x3f66('0x54')]);return db['ChatWebsite'][_0x3f66('0x5b')](_0x1df853)[_0x3f66('0x22')](handleEntityNotFound(_0x37e5bf,null))['then'](respondWithResult(_0x37e5bf,null))[_0x3f66('0x2c')](handleError(_0x37e5bf,null));};exports['create']=function(_0x44db98,_0x113ba4){return db['ChatWebsite'][_0x3f66('0x5c')](_0x44db98[_0x3f66('0x5d')],{})[_0x3f66('0x22')](function(_0x1540ac){var _0x212dbd=_0x44db98[_0x3f66('0x5e')][_0x3f66('0x39')]({'plain':!![]});if(!_0x212dbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x212dbd[_0x3f66('0x5f')]===_0x3f66('0x5e')){var _0x5950f7=_0x1540ac[_0x3f66('0x39')]({'plain':!![]});var _0x41d3ea=_0x3f66('0x3a');return db[_0x3f66('0x60')][_0x3f66('0x5b')]({'where':{'name':_0x41d3ea,'userProfileId':_0x212dbd[_0x3f66('0x61')]},'raw':!![]})[_0x3f66('0x22')](function(_0x46cdbc){if(_0x46cdbc&&_0x46cdbc[_0x3f66('0x62')]===0x0){return db[_0x3f66('0x3b')]['create']({'name':_0x5950f7['name'],'resourceId':_0x5950f7['id'],'type':_0x46cdbc[_0x3f66('0x3c')],'sectionId':_0x46cdbc['id']},{})[_0x3f66('0x22')](function(){return _0x1540ac;});}else{return _0x1540ac;}})[_0x3f66('0x2c')](function(_0x1d14b8){logger[_0x3f66('0x28')](_0x3f66('0x63'),_0x1d14b8);throw _0x1d14b8;});}return _0x1540ac;})['then'](respondWithResult(_0x113ba4,0xc9))[_0x3f66('0x2c')](handleError(_0x113ba4,null));};exports[_0x3f66('0x37')]=function(_0x55fa06,_0x4cd018){if(_0x55fa06['body']['id']){delete _0x55fa06['body']['id'];}return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x55fa06[_0x3f66('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x3f66('0x3f')}]})[_0x3f66('0x22')](handleEntityNotFound(_0x4cd018,null))[_0x3f66('0x22')](saveUpdates(_0x55fa06[_0x3f66('0x5d')],null))['then'](respondWithResult(_0x4cd018,null))[_0x3f66('0x2c')](handleError(_0x4cd018,null));};exports[_0x3f66('0x38')]=function(_0x1b875d,_0x150b7c){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x1b875d[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x150b7c,null))['then'](removeEntity(_0x150b7c,null))['catch'](handleError(_0x150b7c,null));};exports['describe']=function(_0x364042,_0x58aa1f){return db[_0x3f66('0x41')][_0x3f66('0x64')]()['then'](respondWithResult(_0x58aa1f,null))[_0x3f66('0x2c')](handleError(_0x58aa1f,null));};exports['addDisposition']=function(_0x41710c,_0xefd8c1,_0x145004){if(_0x41710c['body']['id']){delete _0x41710c['body']['id'];}return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x41710c[_0x3f66('0x59')]['id']}})['then'](handleEntityNotFound(_0xefd8c1,null))[_0x3f66('0x22')](function(_0x4c8324){if(_0x4c8324){_0x41710c[_0x3f66('0x5d')][_0x3f66('0x65')]=_0x4c8324['id'];return db[_0x3f66('0x66')][_0x3f66('0x5c')](_0x41710c['body']);}})[_0x3f66('0x22')](respondWithResult(_0xefd8c1,null))[_0x3f66('0x2c')](handleError(_0xefd8c1,null));};exports[_0x3f66('0x67')]=function(_0x41e666,_0x31275c,_0x21572c){var _0x1b549f={'raw':![],'where':{}};var _0x58d0e0={};var _0xcfdf97={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x41e666['params']['id']}})['then'](handleEntityNotFound(_0x31275c,null))['then'](function(_0x39d28f){if(_0x39d28f){_0x58d0e0[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0x66')][_0x3f66('0x5a')]);_0x58d0e0[_0x3f66('0x46')]=_['keys'](_0x41e666[_0x3f66('0x46')]);_0x58d0e0[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x58d0e0[_0x3f66('0x45')],_0x58d0e0[_0x3f66('0x46')]);_0x1b549f[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x58d0e0[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x41e666[_0x3f66('0x46')]['fields']));_0x1b549f[_0x3f66('0x4a')]=_0x1b549f[_0x3f66('0x4a')][_0x3f66('0x4c')]?_0x1b549f['attributes']:_0x58d0e0[_0x3f66('0x45')];if(!_0x41e666['query']['hasOwnProperty']('nolimit')){_0x1b549f[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x41e666[_0x3f66('0x46')]['limit']);_0x1b549f[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0x41e666['query'][_0x3f66('0x4d')]);}_0x1b549f[_0x3f66('0x69')]=qs[_0x3f66('0x4e')](_0x41e666[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x1b549f[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x41e666[_0x3f66('0x46')],_0x58d0e0['filters']));_0x1b549f[_0x3f66('0x4f')][_0x3f66('0x65')]=_0x39d28f['id'];if(_0x41e666[_0x3f66('0x46')][_0x3f66('0x52')]){_0x1b549f[_0x3f66('0x4f')]=_[_0x3f66('0x53')](_0x1b549f[_0x3f66('0x4f')],{'$or':_[_0x3f66('0x40')](_0x1b549f[_0x3f66('0x4a')],function(_0x40d428){var _0x4a63d1={};_0x4a63d1[_0x40d428]={'$like':'%'+_0x41e666[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x4a63d1;})});}_0x1b549f=_[_0x3f66('0x53')]({},_0x1b549f,_0x41e666[_0x3f66('0x54')]);return db[_0x3f66('0x66')][_0x3f66('0x30')]({'where':_0x1b549f['where']})[_0x3f66('0x22')](function(_0x2a5b99){_0xcfdf97[_0x3f66('0x30')]=_0x2a5b99;if(_0x41e666['query'][_0x3f66('0x55')]){_0x1b549f['include']=[{'all':!![]}];}return db[_0x3f66('0x66')]['findAll'](_0x1b549f);})[_0x3f66('0x22')](function(_0x27e663){_0xcfdf97['rows']=_0x27e663;return _0xcfdf97;});}})[_0x3f66('0x22')](respondWithFilteredResult(_0x31275c,_0x1b549f))[_0x3f66('0x2c')](handleError(_0x31275c,null));};exports[_0x3f66('0x6a')]=function(_0x459087,_0x2c902d,_0x29748e){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x459087[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2c902d,null))[_0x3f66('0x22')](function(_0x9cdcc9){if(_0x9cdcc9){return _0x9cdcc9['removeDispositions'](_0x459087['query'][_0x3f66('0x6b')]);}})['then'](respondWithStatusCode(_0x2c902d,null))[_0x3f66('0x2c')](handleError(_0x2c902d,null));};exports[_0x3f66('0x6c')]=function(_0x2f0b8b,_0x260b36,_0xd8801c){if(_0x2f0b8b[_0x3f66('0x5d')]['id']){delete _0x2f0b8b['body']['id'];}return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x2f0b8b[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x260b36,null))[_0x3f66('0x22')](function(_0x146567){if(_0x146567){_0x2f0b8b[_0x3f66('0x5d')][_0x3f66('0x65')]=_0x146567['id'];return db[_0x3f66('0x6d')][_0x3f66('0x5c')](_0x2f0b8b[_0x3f66('0x5d')]);}})[_0x3f66('0x22')](respondWithResult(_0x260b36,null))[_0x3f66('0x2c')](handleError(_0x260b36,null));};exports[_0x3f66('0x6e')]=function(_0x1aab82,_0x59a187,_0x35587e){var _0x3043d0={'raw':![],'where':{}};var _0x14b885={};var _0x45fd17={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x1aab82['params']['id']}})['then'](handleEntityNotFound(_0x59a187,null))['then'](function(_0x33c8c6){if(_0x33c8c6){_0x14b885[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0x6d')][_0x3f66('0x5a')]);_0x14b885[_0x3f66('0x46')]=_['keys'](_0x1aab82[_0x3f66('0x46')]);_0x14b885[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x14b885[_0x3f66('0x45')],_0x14b885[_0x3f66('0x46')]);_0x3043d0[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x14b885[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x1aab82[_0x3f66('0x46')]['fields']));_0x3043d0['attributes']=_0x3043d0[_0x3f66('0x4a')][_0x3f66('0x4c')]?_0x3043d0['attributes']:_0x14b885[_0x3f66('0x45')];if(!_0x1aab82[_0x3f66('0x46')][_0x3f66('0x6f')](_0x3f66('0x70'))){_0x3043d0[_0x3f66('0x31')]=qs['limit'](_0x1aab82[_0x3f66('0x46')]['limit']);_0x3043d0[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0x1aab82[_0x3f66('0x46')][_0x3f66('0x4d')]);}_0x3043d0['order']=qs[_0x3f66('0x4e')](_0x1aab82[_0x3f66('0x46')]['sort']);_0x3043d0['where']=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x1aab82[_0x3f66('0x46')],_0x14b885[_0x3f66('0x48')]));_0x3043d0[_0x3f66('0x4f')][_0x3f66('0x65')]=_0x33c8c6['id'];if(_0x1aab82[_0x3f66('0x46')][_0x3f66('0x52')]){_0x3043d0['where']=_[_0x3f66('0x53')](_0x3043d0[_0x3f66('0x4f')],{'$or':_['map'](_0x3043d0[_0x3f66('0x4a')],function(_0x47310f){var _0x48c308={};_0x48c308[_0x47310f]={'$like':'%'+_0x1aab82[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x48c308;})});}_0x3043d0=_[_0x3f66('0x53')]({},_0x3043d0,_0x1aab82[_0x3f66('0x54')]);return db['CannedAnswer'][_0x3f66('0x30')]({'where':_0x3043d0[_0x3f66('0x4f')]})[_0x3f66('0x22')](function(_0x593576){_0x45fd17[_0x3f66('0x30')]=_0x593576;if(_0x1aab82[_0x3f66('0x46')][_0x3f66('0x55')]){_0x3043d0['include']=[{'all':!![]}];}return db[_0x3f66('0x6d')][_0x3f66('0x57')](_0x3043d0);})['then'](function(_0x34b095){_0x45fd17['rows']=_0x34b095;return _0x45fd17;});}})[_0x3f66('0x22')](respondWithFilteredResult(_0x59a187,_0x3043d0))[_0x3f66('0x2c')](handleError(_0x59a187,null));};exports['removeAnswers']=function(_0xabe383,_0x2271f2,_0x5e66c3){return db['ChatWebsite'][_0x3f66('0x5b')]({'where':{'id':_0xabe383['params']['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2271f2,null))[_0x3f66('0x22')](function(_0x39e383){if(_0x39e383){return _0x39e383[_0x3f66('0x71')](_0xabe383[_0x3f66('0x46')][_0x3f66('0x6b')]);}})['then'](respondWithStatusCode(_0x2271f2,null))[_0x3f66('0x2c')](handleError(_0x2271f2,null));};exports[_0x3f66('0x72')]=function(_0x169e16,_0x2d89e1,_0x266c44){_0x169e16[_0x3f66('0x5d')][_0x3f66('0x73')]=_0x169e16[_0x3f66('0x74')][_0x3f66('0x75')];return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x169e16[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2d89e1,null))[_0x3f66('0x22')](saveUpdates(_0x169e16[_0x3f66('0x5d')],null))[_0x3f66('0x22')](respondWithResult(_0x2d89e1,null))[_0x3f66('0x2c')](handleError(_0x2d89e1,null));};exports[_0x3f66('0x76')]=function(_0x106282,_0x5a32be,_0x5d250f){_0x106282['body'][_0x3f66('0x77')]=_0x106282[_0x3f66('0x74')][_0x3f66('0x75')];return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x106282[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x5a32be,null))[_0x3f66('0x22')](saveUpdates(_0x106282[_0x3f66('0x5d')],null))[_0x3f66('0x22')](respondWithResult(_0x5a32be,null))['catch'](handleError(_0x5a32be,null));};exports[_0x3f66('0x78')]=function(_0x2b1a3e,_0x5b08b2,_0xacb639){_0x2b1a3e[_0x3f66('0x5d')][_0x3f66('0x79')]=_0x2b1a3e[_0x3f66('0x74')][_0x3f66('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x2b1a3e[_0x3f66('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b08b2,null))['then'](saveUpdates(_0x2b1a3e[_0x3f66('0x5d')],null))['then'](respondWithResult(_0x5b08b2,null))[_0x3f66('0x2c')](handleError(_0x5b08b2,null));};exports[_0x3f66('0x7a')]=function(_0x3741e4,_0x264a01,_0x5712fa){_0x3741e4[_0x3f66('0x5d')][_0x3f66('0x7b')]=_0x3741e4[_0x3f66('0x74')][_0x3f66('0x75')];return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x3741e4[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x264a01,null))[_0x3f66('0x22')](saveUpdates(_0x3741e4[_0x3f66('0x5d')],null))[_0x3f66('0x22')](respondWithResult(_0x264a01,null))[_0x3f66('0x2c')](handleError(_0x264a01,null));};exports[_0x3f66('0x7c')]=function(_0x53db1e,_0x52379d,_0x247c15){var _0x28ef5a=path['join'](config[_0x3f66('0x7d')],_0x3f66('0x7e'));var _0xdf9d1e={'where':{'id':_0x53db1e[_0x3f66('0x59')]['id']},'attributes':['id',_0x3f66('0x73')],'raw':!![]};var _0x23b539=![];return require('../../config/license/util')[_0x3f66('0x7f')]()[_0x3f66('0x22')](function(_0x30d0ea){if(_0x30d0ea){_0x23b539=_0x30d0ea[_0x3f66('0x80')];}})['then'](function(){return db[_0x3f66('0x41')]['find'](_0xdf9d1e);})[_0x3f66('0x22')](handleEntityNotFound(_0x52379d,null))[_0x3f66('0x22')](function(_0x44b69b){if(_0x44b69b){if(!_[_0x3f66('0x81')](_0x44b69b['sitepic'])){if(fs[_0x3f66('0x82')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x84'),_0x44b69b[_0x3f66('0x73')]))&&_0x23b539){_0x28ef5a=path['join'](config[_0x3f66('0x7d')],'server/files/images/logos/',_0x44b69b[_0x3f66('0x73')]);}}return _0x52379d[_0x3f66('0x85')](_0x28ef5a);}})['catch'](handleError(_0x52379d,null));};exports['getAvatar']=function(_0x40fa01,_0x4a4bf4,_0x344699){var _0x2b18d5=path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x86'));var _0x229902={'where':{'id':_0x40fa01['params']['id']},'attributes':['id',_0x3f66('0x77')],'raw':!![]};return db[_0x3f66('0x41')][_0x3f66('0x5b')](_0x229902)[_0x3f66('0x22')](handleEntityNotFound(_0x4a4bf4,null))['then'](function(_0x370ab2){if(_0x370ab2){if(!_[_0x3f66('0x81')](_0x370ab2[_0x3f66('0x77')])){if(fs[_0x3f66('0x82')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x87'),_0x370ab2[_0x3f66('0x77')]))){_0x2b18d5=path[_0x3f66('0x83')](config['root'],_0x3f66('0x87'),_0x370ab2[_0x3f66('0x77')]);}}return _0x4a4bf4['download'](_0x2b18d5);}})['catch'](handleError(_0x4a4bf4,null));};exports['getCustomerAvatar']=function(_0x4f48c6,_0x9ae983,_0x3a2ce1){var _0x13f17a=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2ef41b={'where':{'id':_0x4f48c6[_0x3f66('0x59')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x3f66('0x41')][_0x3f66('0x5b')](_0x2ef41b)[_0x3f66('0x22')](handleEntityNotFound(_0x9ae983,null))[_0x3f66('0x22')](function(_0x484bd0){if(_0x484bd0){if(!_[_0x3f66('0x81')](_0x484bd0[_0x3f66('0x79')])){if(fs['existsSync'](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],'server/files/images/avatars/',_0x484bd0[_0x3f66('0x79')]))&&_0x484bd0[_0x3f66('0x88')]){_0x13f17a=path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x87'),_0x484bd0[_0x3f66('0x79')]);}}return _0x9ae983[_0x3f66('0x85')](_0x13f17a);}})[_0x3f66('0x2c')](handleError(_0x9ae983,null));};exports[_0x3f66('0x89')]=function(_0x1c9ab9,_0x50abe5,_0x3a4771){var _0x4934da=path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x8a'));var _0x3b1b95={'where':{'id':_0x1c9ab9[_0x3f66('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3f66('0x41')]['find'](_0x3b1b95)['then'](handleEntityNotFound(_0x50abe5,null))['then'](function(_0x1f7b15){if(_0x1f7b15){if(!_[_0x3f66('0x81')](_0x1f7b15[_0x3f66('0x7b')])){if(fs[_0x3f66('0x82')](path['join'](config[_0x3f66('0x7d')],_0x3f66('0x87'),_0x1f7b15[_0x3f66('0x7b')]))){_0x4934da=path[_0x3f66('0x83')](config['root'],_0x3f66('0x87'),_0x1f7b15[_0x3f66('0x7b')]);}}return _0x50abe5[_0x3f66('0x85')](_0x4934da);}})[_0x3f66('0x2c')](handleError(_0x50abe5,null));};exports[_0x3f66('0x8b')]=function(_0x1bb2b4,_0x4ebf44,_0x5443b8){var _0x43c33b=require(_0x3f66('0x8c'));var _0x4d7104=new _0x43c33b();var _0x57f16d=_0x4d7104['setUA'](_0x1bb2b4[_0x3f66('0x8d')]['user-agent'])[_0x3f66('0x8e')]();var _0x139cbc={'body':_0x1bb2b4[_0x3f66('0x5d')],'channel':'chat'};var _0x2f5872=[];var _0x44aee5=[];var _0x243028={};var _0x21669f=![];return db['CmContact']['describe']()[_0x3f66('0x22')](function(_0x5d78d6){if(!_0x5d78d6){throw new db['Sequelize'][(_0x3f66('0x8f'))]('no\x20available\x20attributes');}_0x2f5872=_['difference'](_['keys'](_0x5d78d6),[_0x3f66('0x90'),_0x3f66('0x91')]);_0x44aee5=_[_0x3f66('0x92')](_['keys'](_0x5d78d6),[_0x3f66('0x90'),'updatedAt',_0x3f66('0x93'),_0x3f66('0x94')]);if(_0x1bb2b4[_0x3f66('0x5d')]['id']){delete _0x1bb2b4[_0x3f66('0x5d')]['id'];}if(_[_0x3f66('0x81')](_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x95')])){throw new db['Sequelize'][(_0x3f66('0x8f'))](_0x3f66('0x96'));}if(_[_0x3f66('0x81')](_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x5d')])||_0x1bb2b4[_0x3f66('0x5d')]['body']===''){throw new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0x97'));}if(_[_0x3f66('0x81')](_0x1bb2b4[_0x3f66('0x5d')]['mapKey'])){throw new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44aee5);}if(!_[_0x3f66('0x98')](_0x44aee5,_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x99')])){throw new db[(_0x3f66('0x1f'))]['ValidationError'](_0x3f66('0x9a')+_0x44aee5);}_0x243028[_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x99')]]=_0x1bb2b4['body'][_0x3f66('0x95')];})[_0x3f66('0x22')](function(){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x1bb2b4[_0x3f66('0x59')]['id']},'include':[{'model':db[_0x3f66('0x9b')],'as':'List','include':[{'model':db[_0x3f66('0x9c')],'as':_0x3f66('0x9d'),'where':_0x243028,'limit':0x1,'order':[[_0x3f66('0x91'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x3f66('0x9e')}]});})[_0x3f66('0x22')](handleEntityNotFound(_0x4ebf44,null))[_0x3f66('0x22')](function(_0x9c8da1){if(_0x9c8da1&&_0x9c8da1[_0x3f66('0x9f')]){_0x139cbc[_0x3f66('0xa0')]=_0x9c8da1;_0x139cbc[_0x3f66('0xa1')]=_0x9c8da1['Applications'];_0x139cbc[_0x3f66('0xa2')]=_0x9c8da1[_0x3f66('0x9f')];_0x139cbc[_0x3f66('0xa1')]=_[_0x3f66('0xa3')](_0x139cbc['applications'],[_0x3f66('0xa4')],[_0x3f66('0xa5')]);if(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9e')]){delete _0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9e')];}if(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9f')]&&_0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9f')][_0x3f66('0x9d')][_0x3f66('0x4c')]){return _0x139cbc[_0x3f66('0xa0')]['List'][_0x3f66('0x9d')][0x0];}var _0x5e9783=_['defaults'](_0x1bb2b4['body'],{'firstName':_0x1bb2b4[_0x3f66('0x5d')]['from'],'ListId':_0x9c8da1['ListId']});_0x5e9783[_0x1bb2b4[_0x3f66('0x5d')]['mapKey']]=_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x95')];return db[_0x3f66('0x9c')][_0x3f66('0x5c')](_0x5e9783,{'fields':_0x2f5872,'raw':!![]});}})[_0x3f66('0x22')](handleEntityNotFound(_0x4ebf44,null))[_0x3f66('0x22')](function(_0x4459eb){_0x139cbc[_0x3f66('0xa6')]=_0x4459eb;var _0x17f9b1=_0x1bb2b4['body']['customerIp'];if(_0x1bb2b4['headers'][_0x3f66('0xa7')]){_0x17f9b1=_0x1bb2b4[_0x3f66('0x8d')][_0x3f66('0xa7')];}else if(_0x1bb2b4[_0x3f66('0x8d')]['x-forwarded-for']){_0x17f9b1=_['first'](_0x1bb2b4['headers'][_0x3f66('0xa8')][_0x3f66('0xa9')](','));}if(_0x4459eb){var _0x2bf595={'ContactId':_0x4459eb['id'],'ChatWebsiteId':_0x1bb2b4[_0x3f66('0x59')]['id'],'from':(_0x4459eb['firstName']||'')+'\x20'+(_0x4459eb[_0x3f66('0xaa')]||''),'customerIp':_0x17f9b1,'customerPort':_0x1bb2b4[_0x3f66('0x8d')][_0x3f66('0xab')]?_0x1bb2b4[_0x3f66('0x8d')][_0x3f66('0xab')]:null,'referer':_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xac')],'browserName':_0x57f16d[_0x3f66('0xad')]['name']&&_0x57f16d['browser'][_0x3f66('0xae')]?util[_0x3f66('0xaf')](_0x3f66('0xb0'),_0x57f16d[_0x3f66('0xad')][_0x3f66('0x3c')],_0x57f16d[_0x3f66('0xad')][_0x3f66('0xae')]):_0x3f66('0xb1'),'browserVersion':_0x57f16d[_0x3f66('0xad')][_0x3f66('0xae')]||_0x3f66('0xb1'),'osName':util['format'](_0x3f66('0xb0'),_0x57f16d['os']['name'],_0x57f16d['os'][_0x3f66('0xae')]),'osVersion':_0x57f16d['os'][_0x3f66('0xae')],'deviceModel':_0x57f16d[_0x3f66('0xb2')]['model']&&_0x57f16d[_0x3f66('0xb2')][_0x3f66('0xb3')]?util['format']('%s\x20%s\x20%s',_0x57f16d[_0x3f66('0xb2')][_0x3f66('0x45')],_0x57f16d[_0x3f66('0xb2')][_0x3f66('0xb3')],_0x57f16d['device'][_0x3f66('0x43')]):null,'deviceVendor':_0x57f16d[_0x3f66('0xb2')]['vendor'],'deviceType':_0x57f16d['device']['type'],'formData':JSON[_0x3f66('0x27')](_0x1bb2b4[_0x3f66('0x5d')])};var _0x4dee39={'ChatWebsiteId':_0x1bb2b4[_0x3f66('0x59')]['id'],'closed':![]};if(_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb4')]){_0x4dee39['threadId']=_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb4')];return db[_0x3f66('0xb5')][_0x3f66('0x5b')]({'where':_0x4dee39})['then'](function(_0x257e15){if(_0x257e15){return[_0x257e15,![]];}_0x2bf595['threadId']=_0x1bb2b4['body']['threadId'];_0x2bf595[_0x3f66('0xb6')]=_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb6')];return db['ChatInteraction'][_0x3f66('0x5c')](_0x2bf595)['then'](function(_0xf571b4){return[_0xf571b4,!![]];});});}_0x4dee39[_0x3f66('0xb7')]=_0x4459eb['id'];if(_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb8')]&&_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb8')]['id']){_0x4dee39['id']=_0x1bb2b4['body']['interaction']['id'];return db[_0x3f66('0xb5')]['find']({'where':_0x4dee39})[_0x3f66('0x22')](function(_0x37eaa6){if(_0x37eaa6){return[_0x37eaa6,![]];}return db['ChatInteraction'][_0x3f66('0x5c')](_0x2bf595)[_0x3f66('0x22')](function(_0x50f7){return[_0x50f7,!![]];});});}return db[_0x3f66('0xb5')][_0x3f66('0x5c')](_0x2bf595)['then'](function(_0x2a0f4f){return[_0x2a0f4f,!![]];});}})[_0x3f66('0xb9')](function(_0x5f5b8e,_0x298353){if(_0x5f5b8e){_0x21669f=_0x298353;if(!_0x298353){var _0x5b430d={'from':(_0x139cbc['contact'][_0x3f66('0xba')]||'')+'\x20'+(_0x139cbc[_0x3f66('0xa6')][_0x3f66('0xaa')]||'')};if(_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb4')]&&_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xbb')]&&_0x1bb2b4['body'][_0x3f66('0xb4')]!=_0x1bb2b4['body']['messageId']){_0x5b430d[_0x3f66('0xb4')]=_0x1bb2b4['body']['messageId'];}return _0x5f5b8e[_0x3f66('0x37')](_0x5b430d);}else{return _0x5f5b8e;}}})[_0x3f66('0x22')](function(_0x2ecb2b){_0x139cbc[_0x3f66('0xb8')]=_0x2ecb2b['get']({'plain':!![]});_0x139cbc[_0x3f66('0xb8')][_0x3f66('0xbc')]=_0x21669f;if(_0x139cbc['interaction'][_0x3f66('0xbc')]){if(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0xbd')]){_0x139cbc[_0x3f66('0xa1')][_0x3f66('0xbe')]({'id':0x0,'priority':_0x139cbc[_0x3f66('0xa1')][_0x3f66('0x4c')]+0x1,'app':'close','appdata':_0x3f66('0xbf'),'interval':'*,*,*,*'});}}return db[_0x3f66('0xc0')][_0x3f66('0x5c')]({'body':_0x1bb2b4['body'][_0x3f66('0x5d')],'ChatWebsiteId':_0x1bb2b4['params']['id'],'ChatInteractionId':_0x2ecb2b['id'],'direction':'in','ContactId':_0x139cbc[_0x3f66('0xa6')]['id'],'AttachmentId':_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xc1')]});})[_0x3f66('0x22')](function(_0x1ab802){_0x139cbc[_0x3f66('0x2a')]=_0x1ab802;if(_0x139cbc[_0x3f66('0xb8')]['UserId']){return db[_0x3f66('0xc2')][_0x3f66('0x5b')]({'attributes':['id',_0x3f66('0x3c')],'where':{'id':_0x139cbc[_0x3f66('0xb8')]['UserId']}})[_0x3f66('0x22')](function(_0x471156){if(_0x471156){_0x139cbc[_0x3f66('0xa1')][_0x3f66('0xc3')]({'id':0x0,'priority':0x0,'app':_0x3f66('0xc4'),'appdata':_0x471156['name']+','+(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0xc5')]||0xa),'interval':_0x3f66('0xc6')});_0x139cbc[_0x3f66('0xc7')]=!![];}return respondWithRpcPromise(_0x3f66('0xc8'),'startRouting',_0x139cbc);});}return respondWithRpcPromise(_0x3f66('0xc8'),_0x3f66('0xc9'),_0x139cbc);})['then'](function(_0x419f1c){respondWithRpcPromise(_0x3f66('0xca'),_0x3f66('0xca'),{'event':_0x3f66('0x8b'),'message':_0x419f1c},client9002);return _0x419f1c;})[_0x3f66('0x22')](respondWithResult(_0x4ebf44,null))['catch'](handleError(_0x4ebf44,null));};exports[_0x3f66('0xcb')]=function(_0x43874e,_0x206580,_0x3d5b6f){var _0xc27501,_0x480f56,_0x25307a;var _0x427d59=[];var _0x48fefc=[];var _0x5251a8={};return db[_0x3f66('0x9c')][_0x3f66('0x64')]()[_0x3f66('0x22')](function(_0x49e79b){if(!_0x49e79b){throw new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0xcc'));}_0x48fefc=_[_0x3f66('0x92')](_[_0x3f66('0x47')](_0x49e79b),[_0x3f66('0x90'),_0x3f66('0x91')]);_0x427d59=_['difference'](_[_0x3f66('0x47')](_0x49e79b),['createdAt',_0x3f66('0x91'),_0x3f66('0x93'),_0x3f66('0x94')]);if(_0x43874e[_0x3f66('0x5d')]['id']){delete _0x43874e[_0x3f66('0x5d')]['id'];}if(_['isNil'](_0x43874e[_0x3f66('0x5d')]['from'])){throw _0x206580[_0x3f66('0x2e')](0x1f4)[_0x3f66('0x3d')](new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0x96')));}if(_[_0x3f66('0x81')](_0x43874e[_0x3f66('0x5d')][_0x3f66('0x5d')])||_0x43874e['body']['body']===''){throw _0x206580['status'](0x1f4)['send'](new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0x97')));}if(_[_0x3f66('0x81')](_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')])){throw _0x206580[_0x3f66('0x2e')](0x1f4)['send'](new db['Sequelize'][(_0x3f66('0x8f'))](_0x3f66('0xce')+_0x427d59));}if(!_['includes'](_0x427d59,_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')])){throw _0x206580[_0x3f66('0x2e')](0x1f4)[_0x3f66('0x3d')](new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x427d59));}_0x5251a8[_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')]]=_0x43874e[_0x3f66('0x5d')][_0x3f66('0x95')];})[_0x3f66('0x22')](function(){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x43874e[_0x3f66('0x59')]['id']},'include':[{'model':db[_0x3f66('0x9b')],'as':_0x3f66('0x9f')}]});})[_0x3f66('0x22')](handleEntityNotFound(_0x206580,null))[_0x3f66('0x22')](function(_0x2c157a){if(_0x2c157a&&_0x2c157a[_0x3f66('0x9f')]){_0x480f56=_0x2c157a;var _0x5bfbea=_['defaults'](_0x43874e[_0x3f66('0x5d')],{'firstName':_0x43874e['body'][_0x3f66('0x95')],'phone':_0x43874e[_0x3f66('0x5d')][_0x3f66('0x95')],'ListId':_0x2c157a['ListId']});_0x5bfbea[_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')]]=_0x43874e['body'][_0x3f66('0x95')];return db[_0x3f66('0x9c')]['findOrCreate']({'where':_0x5251a8,'defaults':_0x5bfbea});}})[_0x3f66('0xb9')](function(_0x7188dd){if(_0x7188dd){_0x25307a=_0x7188dd;var _0xbb20e4=fs[_0x3f66('0xcf')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0xd0')),_0x3f66('0xd1'));var _0x44ec2b=ejs[_0x3f66('0xd2')](_0xbb20e4,{'body':_[_0x3f66('0xd3')](_0x43874e[_0x3f66('0x5d')][_0x3f66('0x5d')]),'bodyTitle':_0x480f56[_0x3f66('0xd4')]});return db[_0x3f66('0xd5')][_0x3f66('0x5c')]({'body':_0x44ec2b,'ContactId':_0x7188dd['id'],'ChatWebsiteId':_0x480f56['id']});}})[_0x3f66('0x22')](function(_0x3c314b){if(_0x3c314b){_0xc27501=_0x3c314b;return db[_0x3f66('0xd6')][_0x3f66('0x68')]({'where':{'service':!![]},'include':[{'model':db[_0x3f66('0xd7')],'as':_0x3f66('0xd8'),'raw':!![]}]});}})[_0x3f66('0x22')](function(_0x2103b5){if(_0x2103b5&&_0x2103b5['Smtp']&&_0x480f56['forwardOfflineAddress']){var _0x361083={'tls':{'rejectUnauthorized':![]}};if(_0x2103b5[_0x3f66('0xd8')]['service']){_0x361083[_0x3f66('0xd9')]=_0x2103b5['Smtp'][_0x3f66('0xd9')];}else{_0x361083[_0x3f66('0xda')]=_0x2103b5[_0x3f66('0xd8')][_0x3f66('0xda')];_0x361083[_0x3f66('0xdb')]=_0x2103b5[_0x3f66('0xd8')]['port'];_0x361083[_0x3f66('0xdc')]=_0x2103b5[_0x3f66('0xd8')]['secure'];}if(_0x2103b5[_0x3f66('0xd8')]['authentication']){_0x361083[_0x3f66('0xdd')]={'user':_0x2103b5['Smtp'][_0x3f66('0x5e')],'pass':_0x2103b5[_0x3f66('0xd8')][_0x3f66('0xde')]};}return respondWithRpcPromise(_0x3f66('0xdf'),_0x3f66('0xe0'),{'account':_0x361083,'message':{'from':util[_0x3f66('0xaf')](_0x3f66('0xe1'),_0x2103b5['name'],_0x2103b5[_0x3f66('0xe2')]||_0x2103b5[_0x3f66('0xd8')][_0x3f66('0x5e')]),'to':_0x480f56['forwardOfflineAddress'],'subject':_0x480f56[_0x3f66('0xe3')],'text':_0xc27501[_0x3f66('0x5d')]}},client9003)[_0x3f66('0x22')](function(){return _0xc27501;})['catch'](function(_0x265967){console['error'](_0x265967);});}})[_0x3f66('0x22')](function(){if(_0xc27501){return _0xc27501;}})[_0x3f66('0x22')](respondWithResult(_0x206580,null))[_0x3f66('0x2c')](handleError(_0x206580,null));};exports[_0x3f66('0xe4')]=function(_0x51b842,_0x169853,_0x5a4281){return db[_0x3f66('0xb5')]['find']({'where':{'id':_0x51b842[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x169853,null))['then'](function(_0x18a0a1){if(_0x18a0a1){return _0x18a0a1['addInteraction'](_0x51b842[_0x3f66('0x5d')]['ids'],_[_0x3f66('0xe5')](_0x51b842[_0x3f66('0x5d')],[_0x3f66('0x6b'),'id'])||{});}})[_0x3f66('0x22')](respondWithResult(_0x169853,null))[_0x3f66('0x2c')](handleError(_0x169853,null));};exports[_0x3f66('0xe6')]=function(_0x41f5c6,_0x3b9e6a,_0x12c7fb){var _0x3da3eb={'raw':![],'where':{}};var _0x5676aa={};var _0x4006c3={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x41f5c6[_0x3f66('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b9e6a,null))[_0x3f66('0x22')](function(_0xfa85b7){if(_0xfa85b7){_0x5676aa['model']=_[_0x3f66('0x47')](db[_0x3f66('0xb5')]['rawAttributes']);_0x5676aa[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x41f5c6[_0x3f66('0x46')]);_0x5676aa[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x5676aa['model'],_0x5676aa['query']);_0x3da3eb[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x5676aa[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x4b')]));_0x3da3eb[_0x3f66('0x4a')]=_0x3da3eb[_0x3f66('0x4a')]['length']?_0x3da3eb[_0x3f66('0x4a')]:_0x5676aa[_0x3f66('0x45')];if(!_0x41f5c6['query'][_0x3f66('0x6f')]('nolimit')){_0x3da3eb[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x31')]);_0x3da3eb['offset']=qs['offset'](_0x41f5c6[_0x3f66('0x46')]['offset']);}_0x3da3eb[_0x3f66('0x69')]=qs[_0x3f66('0x4e')](_0x41f5c6[_0x3f66('0x46')]['sort']);_0x3da3eb[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x41f5c6[_0x3f66('0x46')],_0x5676aa[_0x3f66('0x48')]));_0x3da3eb['where'][_0x3f66('0x65')]=_0xfa85b7['id'];if(_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x52')]){_0x3da3eb[_0x3f66('0x4f')]=_['merge'](_0x3da3eb['where'],{'$or':_['map'](_0x3da3eb[_0x3f66('0x4a')],function(_0x32fffc){var _0x1f98dc={};_0x1f98dc[_0x32fffc]={'$like':'%'+_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x1f98dc;})});}_0x3da3eb=_[_0x3f66('0x53')]({},_0x3da3eb,_0x41f5c6[_0x3f66('0x54')]);return db[_0x3f66('0xb5')]['count']({'where':_0x3da3eb[_0x3f66('0x4f')]})['then'](function(_0x4773d5){_0x4006c3['count']=_0x4773d5;if(_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x55')]){_0x3da3eb[_0x3f66('0x56')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3f66('0xc2')],'as':_0x3f66('0xe7'),'attributes':['name',_0x3f66('0xe8'),_0x3f66('0xe9')],'required':![]},{'model':db['Tag'],'as':_0x3f66('0xea'),'attributes':['id',_0x3f66('0x3c'),_0x3f66('0xeb')],'where':_0x41f5c6[_0x3f66('0x46')][_0x3f66('0xec')]?{'id':_0x41f5c6[_0x3f66('0x46')]['tag']}:undefined,'required':_0x41f5c6[_0x3f66('0x46')][_0x3f66('0xec')]?!![]:![]}];}return db[_0x3f66('0xb5')][_0x3f66('0x57')](_0x3da3eb);})[_0x3f66('0x22')](function(_0x3ba1a0){_0x4006c3[_0x3f66('0xed')]=_0x3ba1a0;return _0x4006c3;});}})['then'](respondWithFilteredResult(_0x3b9e6a,_0x3da3eb))[_0x3f66('0x2c')](handleError(_0x3b9e6a,null));};function iftimePromise(_0xe908be,_0x207f8d){return respondWithRpcPromise(_0x3f66('0xee'),_0x3f66('0xef'),{'command':_0x207f8d[_0x3f66('0xf0')]?util[_0x3f66('0xaf')](_0x3f66('0xf1'),_0xe908be[_0x3f66('0xf2')],_0x207f8d[_0x3f66('0xf0')]):util[_0x3f66('0xaf')](_0x3f66('0xf3'),_0xe908be[_0x3f66('0xf2')])},client9002)[_0x3f66('0x22')](function(_0x31c3b0){var _0x29672d=_0x31c3b0&&_0x31c3b0['indexOf'](_0x3f66('0xf4'))>=0x0?!![]:![];logger[_0x3f66('0x23')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x207f8d['id'],_0xe908be['id'],_0xe908be[_0x3f66('0xf2')],_0x29672d?_0x3f66('0xf5'):'OFFLINE',_0x207f8d[_0x3f66('0xf0')]?_0x207f8d[_0x3f66('0xf0')]:'No\x20timezone');return _0x29672d;})[_0x3f66('0x2c')](function(_0x1402d5){logger[_0x3f66('0x28')](_0x3f66('0xf6'),_0x207f8d['id'],_0xe908be['id'],_0xe908be[_0x3f66('0xf2')],util[_0x3f66('0xf7')](_0x1402d5,{'showHidden':![],'depth':null}),_0x207f8d[_0x3f66('0xf0')]?_0x207f8d['timezone']:_0x3f66('0xf8'));return![];});}exports[_0x3f66('0xef')]=function(_0x4985c8,_0x57bead,_0x209db0){var _0xedabab=0x0;var _0x35c5ba=0x0;var _0x2d9920=![];var _0x40718e;var _0x218a8f;return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x4985c8['params']['id']},'include':[{'model':db[_0x3f66('0xf9')],'as':'Interval','include':[{'model':db[_0x3f66('0xf9')],'as':_0x3f66('0xfa'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x3f66('0x22')](handleEntityNotFound(_0x57bead,null))[_0x3f66('0x22')](function(_0x55c444){if(_0x55c444){_0x40718e=_0x55c444;return _0x55c444[_0x3f66('0xfb')]({'raw':!![]});}})[_0x3f66('0x22')](function(_0x572cdb){if(_0x40718e){if(_0x572cdb){_0x218a8f=_0x572cdb;}}return require(_0x3f66('0xfc'))['getLicense']();})[_0x3f66('0x22')](function(_0x190d6c){if(_0x190d6c){_0x35c5ba=_0x190d6c[_0x3f66('0xfd')];_0x2d9920=_0x190d6c['custom'];}})['then'](function(){return db['ChatInteraction'][_0x3f66('0x30')]({'where':{'closed':![]}});})['then'](function(_0x18fd67){_0xedabab=_0x18fd67;if(_0x35c5ba&&_0x18fd67>_0x35c5ba){return db[_0x3f66('0xfe')][_0x3f66('0x68')]({'where':{'id':0x1}})[_0x3f66('0x22')](function(_0x2295d9){if(_0x2295d9){_0x2295d9[_0x3f66('0xff')](_0x3f66('0x100'));}});}})['then'](function(){if(_0x40718e[_0x3f66('0xf9')]&&_0x40718e[_0x3f66('0xf9')][_0x3f66('0xfa')]){var _0x3af062=[];for(var _0x89868b=0x0;_0x89868b<_0x40718e[_0x3f66('0xf9')][_0x3f66('0xfa')][_0x3f66('0x4c')];_0x89868b++){var _0x1d5b71=_0x40718e[_0x3f66('0xf9')][_0x3f66('0xfa')][_0x89868b][_0x3f66('0x39')]({'plain':!![]});_0x3af062[_0x3f66('0xbe')](iftimePromise(_0x1d5b71,_0x40718e));}return BPromise[_0x3f66('0x101')](_0x3af062)[_0x3f66('0x22')](function(_0x2e5a17){return _[_0x3f66('0x102')](_0x2e5a17);});}else{return!![];}})[_0x3f66('0x22')](function(_0x40763e){var _0x1f8e8c=fs[_0x3f66('0xcf')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x103')),'utf8');var _0x13b069={'remote':_0x40718e[_0x3f66('0x104')],'query':querystring['stringify'](_[_0x3f66('0x53')](_0x40718e['get']({'plain':!![]}),{'customerIp':_0x4985c8[_0x3f66('0x8d')][_0x3f66('0xa8')]||_0x4985c8[_0x3f66('0x8d')][_0x3f66('0x105')]||_0x4985c8[_0x3f66('0x106')]['remoteAddress']||_0x4985c8['ip'],'referer':_0x4985c8[_0x3f66('0x8d')]['referer'],'openedInteractions':_0xedabab,'maxInteractions':_0x35c5ba,'virtual':_0x2d9920[_0x3f66('0xfd')],'online':_0x40763e,'custom':_0x2d9920}))[_0x3f66('0x107')](/'/g,'\x5c\x27')};_0x57bead['send'](ejs['render'](Mustache[_0x3f66('0xd2')](_0x1f8e8c,_0x13b069),{'proactiveActions':_0x218a8f,'alignment':_0x40718e[_0x3f66('0x108')],'verticalAlignment':_0x40718e[_0x3f66('0x109')],'div_color':_0x40718e[_0x3f66('0xeb')],'text_color':_0x40718e[_0x3f66('0x10a')]}));})['catch'](handleError(_0x57bead,null));};exports['addApplications']=function(_0x29d067,_0x2d28e1,_0x13db30){return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x29d067[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2d28e1,null))[_0x3f66('0x22')](function(_0x39d444){if(_0x39d444){return db[_0x3f66('0x10b')]['transaction'](function(_0x5cdd4e){return db[_0x3f66('0x10c')]['destroy']({'where':{'ChatWebsiteId':_0x29d067[_0x3f66('0x59')]['id']},'transaction':_0x5cdd4e})['then'](function(_0x30e0a6){var _0x3e8424=_['map'](_0x29d067[_0x3f66('0x5d')],function(_0xdbf01e){_0xdbf01e['ChatWebsiteId']=_0x29d067[_0x3f66('0x59')]['id'];return _0xdbf01e;});return db[_0x3f66('0x10c')][_0x3f66('0x10d')](_0x3e8424,{'transaction':_0x5cdd4e});});})[_0x3f66('0x22')](function(){return db[_0x3f66('0x10c')][_0x3f66('0x10e')]({'where':{'ChatWebsiteId':_0x29d067[_0x3f66('0x59')]['id']},'order':_0x3f66('0xa4')});});}})[_0x3f66('0x22')](respondWithResult(_0x2d28e1,null))[_0x3f66('0x2c')](handleError(_0x2d28e1,null));};exports[_0x3f66('0x10f')]=function(_0x3b7416,_0x586383,_0x5c9d08){var _0x47f768={};var _0x3828c3={};var _0x40d00c;var _0x5cc7cb;return db['ChatWebsite'][_0x3f66('0x68')]({'where':{'id':_0x3b7416[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x586383,null))[_0x3f66('0x22')](function(_0xaf75e8){if(_0xaf75e8){_0x40d00c=_0xaf75e8;_0x3828c3[_0x3f66('0x45')]=_[_0x3f66('0x47')](db[_0x3f66('0x10c')][_0x3f66('0x5a')]);_0x3828c3[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x3b7416[_0x3f66('0x46')]);_0x3828c3[_0x3f66('0x48')]=_['intersection'](_0x3828c3[_0x3f66('0x45')],_0x3828c3[_0x3f66('0x46')]);_0x47f768[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x3828c3[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x3b7416['query'][_0x3f66('0x4b')]));_0x47f768['attributes']=_0x47f768[_0x3f66('0x4a')][_0x3f66('0x4c')]?_0x47f768[_0x3f66('0x4a')]:_0x3828c3[_0x3f66('0x45')];_0x47f768['order']=qs['sort'](_0x3b7416[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x47f768[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x3b7416[_0x3f66('0x46')],_0x3828c3[_0x3f66('0x48')]));if(_0x3b7416['query'][_0x3f66('0x52')]){_0x47f768[_0x3f66('0x4f')]=_[_0x3f66('0x53')](_0x47f768[_0x3f66('0x4f')],{'$or':_['map'](_0x47f768[_0x3f66('0x4a')],function(_0x2ddf3a){var _0x2191cb={};_0x2191cb[_0x2ddf3a]={'$like':'%'+_0x3b7416['query']['filter']+'%'};return _0x2191cb;})});}_0x47f768=_['merge']({},_0x47f768,_0x3b7416[_0x3f66('0x54')]);return _0x40d00c[_0x3f66('0x10f')](_0x47f768);}})['then'](function(_0x592c28){if(_0x592c28){_0x5cc7cb=_0x592c28[_0x3f66('0x4c')];if(!_0x3b7416['query']['hasOwnProperty']('nolimit')){_0x47f768['limit']=qs[_0x3f66('0x31')](_0x3b7416[_0x3f66('0x46')][_0x3f66('0x31')]);_0x47f768['offset']=qs[_0x3f66('0x4d')](_0x3b7416[_0x3f66('0x46')]['offset']);}return _0x40d00c[_0x3f66('0x10f')](_0x47f768);}})[_0x3f66('0x22')](function(_0x19e2c2){if(_0x19e2c2){return _0x19e2c2?{'count':_0x5cc7cb,'rows':_0x19e2c2}:null;}})[_0x3f66('0x22')](respondWithResult(_0x586383,null))[_0x3f66('0x2c')](handleError(_0x586383,null));};exports[_0x3f66('0x110')]=function(_0x3c7dba,_0x62e828,_0x338fef){return db[_0x3f66('0x111')][_0x3f66('0x5b')]({'where':{'id':_0x3c7dba[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x62e828,null))[_0x3f66('0x22')](function(_0x4007bc){if(_0x4007bc){return _0x4007bc[_0x3f66('0x110')](_0x3c7dba[_0x3f66('0x5d')]['ids'],_['omit'](_0x3c7dba['body'],[_0x3f66('0x6b'),'id'])||{});}})[_0x3f66('0x22')](respondWithResult(_0x62e828,null))[_0x3f66('0x2c')](handleError(_0x62e828,null));};exports[_0x3f66('0xfb')]=function(_0x27cedb,_0x564bf3,_0x482df7){var _0x451b9c={};var _0x126504={};var _0x221641;var _0x471cad;return db[_0x3f66('0x41')]['findOne']({'where':{'id':_0x27cedb[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x564bf3,null))[_0x3f66('0x22')](function(_0x71f850){if(_0x71f850){_0x221641=_0x71f850;_0x126504[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0x112')][_0x3f66('0x5a')]);_0x126504[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x27cedb[_0x3f66('0x46')]);_0x126504[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x126504[_0x3f66('0x45')],_0x126504[_0x3f66('0x46')]);_0x451b9c[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x126504[_0x3f66('0x45')],qs['fields'](_0x27cedb[_0x3f66('0x46')][_0x3f66('0x4b')]));_0x451b9c[_0x3f66('0x4a')]=_0x451b9c[_0x3f66('0x4a')]['length']?_0x451b9c[_0x3f66('0x4a')]:_0x126504[_0x3f66('0x45')];_0x451b9c[_0x3f66('0x69')]=qs['sort'](_0x27cedb[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x451b9c[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x27cedb[_0x3f66('0x46')],_0x126504[_0x3f66('0x48')]));if(_0x27cedb[_0x3f66('0x46')]['filter']){_0x451b9c['where']=_[_0x3f66('0x53')](_0x451b9c[_0x3f66('0x4f')],{'$or':_[_0x3f66('0x40')](_0x451b9c[_0x3f66('0x4a')],function(_0x8a8cdf){var _0x32983e={};_0x32983e[_0x8a8cdf]={'$like':'%'+_0x27cedb[_0x3f66('0x46')]['filter']+'%'};return _0x32983e;})});}_0x451b9c=_[_0x3f66('0x53')]({},_0x451b9c,_0x27cedb[_0x3f66('0x54')]);return _0x221641[_0x3f66('0xfb')](_0x451b9c);}})[_0x3f66('0x22')](function(_0x5a7c41){if(_0x5a7c41){_0x471cad=_0x5a7c41[_0x3f66('0x4c')];if(!_0x27cedb[_0x3f66('0x46')][_0x3f66('0x6f')](_0x3f66('0x70'))){_0x451b9c[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x27cedb[_0x3f66('0x46')][_0x3f66('0x31')]);_0x451b9c[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0x27cedb['query'][_0x3f66('0x4d')]);}return _0x221641[_0x3f66('0xfb')](_0x451b9c);}})[_0x3f66('0x22')](function(_0x1dba6e){if(_0x1dba6e){return _0x1dba6e?{'count':_0x471cad,'rows':_0x1dba6e}:null;}})[_0x3f66('0x22')](respondWithResult(_0x564bf3,null))[_0x3f66('0x2c')](handleError(_0x564bf3,null));};exports['getFields']=function(_0x11e618,_0x500777,_0x2a7274){var _0x44be60=_0x11e618[_0x3f66('0x46')]['online']==='false'?_0x3f66('0x113'):'onlineForm';return db['ChatWebsite'][_0x3f66('0x5b')]({'attributes':['id',_0x44be60],'where':{'id':_0x11e618[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x500777,null))[_0x3f66('0x22')](function(_0x4cdd8d){if(_0x4cdd8d){var _0x3319bf=_0x4cdd8d[_0x44be60];var _0x4a329f=_0x3319bf&&_0x3319bf[_0x3f66('0x114')]?_0x3319bf['items']:[];_0x500777[_0x3f66('0x3d')]({'fromKey':_[_0x3f66('0x81')](_0x3319bf[_0x3f66('0x115')])?undefined:_0x3319bf[_0x3f66('0x115')],'count':_0x4a329f['length'],'rows':_0x4a329f});}})[_0x3f66('0x2c')](handleError(_0x500777,null));};exports['getOfflineMessages']=function(_0x1152f7,_0x3c6e4c,_0x17d910){var _0xbcec87={'raw':!![],'where':{}};var _0x3a7a81={};var _0x526201={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x1152f7['params']['id']}})['then'](handleEntityNotFound(_0x3c6e4c,null))[_0x3f66('0x22')](function(_0x720554){if(_0x720554){_0x3a7a81[_0x3f66('0x45')]=_[_0x3f66('0x47')](db[_0x3f66('0xd5')]['rawAttributes']);_0x3a7a81[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x1152f7['query']);_0x3a7a81[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x3a7a81[_0x3f66('0x45')],_0x3a7a81[_0x3f66('0x46')]);_0xbcec87[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x3a7a81[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x1152f7[_0x3f66('0x46')][_0x3f66('0x4b')]));_0xbcec87[_0x3f66('0x4a')]=_0xbcec87['attributes'][_0x3f66('0x4c')]?_0xbcec87[_0x3f66('0x4a')]:_0x3a7a81[_0x3f66('0x45')];if(!_0x1152f7[_0x3f66('0x46')][_0x3f66('0x6f')](_0x3f66('0x70'))){_0xbcec87[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x1152f7[_0x3f66('0x46')][_0x3f66('0x31')]);_0xbcec87[_0x3f66('0x4d')]=qs['offset'](_0x1152f7[_0x3f66('0x46')]['offset']);}_0xbcec87[_0x3f66('0x69')]=qs['sort'](_0x1152f7[_0x3f66('0x46')][_0x3f66('0x4e')]);_0xbcec87['where']=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x1152f7['query'],_0x3a7a81[_0x3f66('0x48')]));_0xbcec87[_0x3f66('0x4f')][_0x3f66('0x65')]=_0x720554['id'];if(_0x1152f7[_0x3f66('0x46')][_0x3f66('0x52')]){_0xbcec87['where']=_[_0x3f66('0x53')](_0xbcec87['where'],{'$or':_[_0x3f66('0x40')](_0xbcec87[_0x3f66('0x4a')],function(_0x14503b){var _0x1efc34={};_0x1efc34[_0x14503b]={'$like':'%'+_0x1152f7[_0x3f66('0x46')]['filter']+'%'};return _0x1efc34;})});}_0xbcec87=_[_0x3f66('0x53')]({},_0xbcec87,_0x1152f7[_0x3f66('0x54')]);return db['ChatOfflineMessage'][_0x3f66('0x30')]({'where':_0xbcec87[_0x3f66('0x4f')]})[_0x3f66('0x22')](function(_0x595d48){_0x526201[_0x3f66('0x30')]=_0x595d48;if(_0x1152f7['query']['includeAll']){_0xbcec87[_0x3f66('0x56')]=[{'all':!![]}];}return db[_0x3f66('0xd5')]['findAll'](_0xbcec87);})['then'](function(_0x9869a6){_0x526201['rows']=_0x9869a6;return _0x526201;});}})['then'](respondWithFilteredResult(_0x3c6e4c,_0xbcec87))[_0x3f66('0x2c')](handleError(_0x3c6e4c,null));};exports[_0x3f66('0x116')]=function(_0xbfc27b,_0x537aef,_0x1cfe15){return db[_0x3f66('0x41')]['find']({'where':{'id':_0xbfc27b[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x537aef,null))[_0x3f66('0x22')](function(_0x544731){if(_0x544731){return _0x544731[_0x3f66('0x116')](_0xbfc27b['body'][_0x3f66('0x6b')],_[_0x3f66('0xe5')](_0xbfc27b[_0x3f66('0x5d')],[_0x3f66('0x6b'),'id'])||{})['spread'](function(_0x499e9f){for(var _0x3b5e34=0x0;_0x3b5e34<_0xbfc27b['body'][_0x3f66('0x6b')]['length'];_0x3b5e34+=0x1){socket['emit'](_0x3f66('0x117'),{'UserId':_0xbfc27b[_0x3f66('0x5d')]['ids'][_0x3b5e34],'ChatWebsiteId':_0xbfc27b[_0x3f66('0x59')]['id']});}return _0x499e9f;});}})[_0x3f66('0x22')](respondWithResult(_0x537aef,null))[_0x3f66('0x2c')](handleError(_0x537aef,null));};exports[_0x3f66('0x118')]=function(_0x578f5f,_0x273672,_0xa68d4f){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x578f5f[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x273672,null))['then'](function(_0x524bed){if(_0x524bed){return _0x524bed[_0x3f66('0x118')](_0x578f5f[_0x3f66('0x46')]['ids'])['then'](function(){if(_[_0x3f66('0x119')](_0x578f5f[_0x3f66('0x46')]['ids'])){for(var _0x1d22cd=0x0;_0x1d22cd<_0x578f5f[_0x3f66('0x46')][_0x3f66('0x6b')][_0x3f66('0x4c')];_0x1d22cd+=0x1){socket['emit'](_0x3f66('0x11a'),{'UserId':Number(_0x578f5f[_0x3f66('0x46')]['ids'][_0x1d22cd]),'ChatWebsiteId':Number(_0x578f5f[_0x3f66('0x59')]['id'])});}}else{socket[_0x3f66('0x11b')](_0x3f66('0x11a'),{'UserId':Number(_0x578f5f[_0x3f66('0x46')][_0x3f66('0x6b')]),'ChatWebsiteId':Number(_0x578f5f['params']['id'])});}});}})[_0x3f66('0x22')](respondWithStatusCode(_0x273672,null))['catch'](handleError(_0x273672,null));};exports[_0x3f66('0x11c')]=function(_0xfc4387,_0x2c5c95,_0x56ddb8){var _0x51e143={};var _0x349d8f={};var _0x243302;var _0x88126e;return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0xfc4387[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2c5c95,null))[_0x3f66('0x22')](function(_0x491668){if(_0x491668){_0x243302=_0x491668;_0x349d8f[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0xc2')][_0x3f66('0x5a')]);_0x349d8f['query']=_[_0x3f66('0x47')](_0xfc4387['query']);_0x349d8f['filters']=_[_0x3f66('0x49')](_0x349d8f[_0x3f66('0x45')],_0x349d8f[_0x3f66('0x46')]);_0x51e143['attributes']=_[_0x3f66('0x49')](_0x349d8f['model'],qs[_0x3f66('0x4b')](_0xfc4387['query'][_0x3f66('0x4b')]));_0x51e143[_0x3f66('0x4a')]=_0x51e143[_0x3f66('0x4a')]['length']?_0x51e143[_0x3f66('0x4a')]:_0x349d8f['model'];_0x51e143[_0x3f66('0x69')]=qs[_0x3f66('0x4e')](_0xfc4387[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x51e143[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0xfc4387[_0x3f66('0x46')],_0x349d8f[_0x3f66('0x48')]));if(_0xfc4387[_0x3f66('0x46')][_0x3f66('0x52')]){_0x51e143[_0x3f66('0x4f')]=_[_0x3f66('0x53')](_0x51e143[_0x3f66('0x4f')],{'$or':_['map'](_0x51e143[_0x3f66('0x4a')],function(_0x113a60){var _0x3edca2={};_0x3edca2[_0x113a60]={'$like':'%'+_0xfc4387[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x3edca2;})});}_0x51e143=_[_0x3f66('0x53')]({},_0x51e143,_0xfc4387['options']);return _0x243302[_0x3f66('0x11c')](_0x51e143);}})[_0x3f66('0x22')](function(_0x402e0c){if(_0x402e0c){_0x88126e=_0x402e0c[_0x3f66('0x4c')];if(!_0xfc4387[_0x3f66('0x46')][_0x3f66('0x6f')]('nolimit')){_0x51e143['limit']=qs[_0x3f66('0x31')](_0xfc4387['query'][_0x3f66('0x31')]);_0x51e143[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0xfc4387[_0x3f66('0x46')][_0x3f66('0x4d')]);}return _0x243302['getAgents'](_0x51e143);}})[_0x3f66('0x22')](function(_0x337dd3){if(_0x337dd3){return _0x337dd3?{'count':_0x88126e,'rows':_0x337dd3}:null;}})[_0x3f66('0x22')](respondWithResult(_0x2c5c95,null))[_0x3f66('0x2c')](handleError(_0x2c5c95,null));}; \ No newline at end of file +var _0x5cb4=['externalUrl','interaction','spread','contact','messageId','created','autoclose','push','close','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','startRouting','Start','EventManager','offline','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','interval','timezone','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','custom','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','remoteAddress','referer','virtual','replace','verticalAlignment','textColor','addApplications','sequelize','bulkCreate','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','omit','getProactiveActions','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','Sequelize','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','end','status','json','count','offset','limit','apply','reject','save','update','destroy','get','UserProfileResource','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','ChatWebsite','includeAll','include','findAll','rows','show','keys','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ChatWebsites','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addDisposition','ChatWebsiteId','getDispositions','order','Disposition','ids','CannedAnswer','getAnswers','findOne','nolimit','removeAnswers','addLogo','addAvatar','agentAvatar','file','filename','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','sitepic','getLicense','isNil','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','setUA','headers','getResult','chat','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','orderBy','defaults','ListId','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','browser','version','format','unknown','%s\x20%s','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction'];(function(_0x3862c6,_0x17a0d2){var _0x5d88bc=function(_0x35c540){while(--_0x35c540){_0x3862c6['push'](_0x3862c6['shift']());}};_0x5d88bc(++_0x17a0d2);}(_0x5cb4,0x188));var _0x45cb=function(_0x4d43ee,_0x55edfe){_0x4d43ee=_0x4d43ee-0x0;var _0x233903=_0x5cb4[_0x4d43ee];return _0x233903;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x45cb('0x0'));var rimraf=require(_0x45cb('0x1'));var zipdir=require(_0x45cb('0x2'));var jsonpatch=require(_0x45cb('0x3'));var rp=require('request-promise');var moment=require(_0x45cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x45cb('0x5'));var util=require(_0x45cb('0x6'));var path=require(_0x45cb('0x7'));var sox=require(_0x45cb('0x8'));var csv=require(_0x45cb('0x9'));var ejs=require(_0x45cb('0xa'));var fs=require('fs');var _=require(_0x45cb('0xb'));var squel=require(_0x45cb('0xc'));var crypto=require(_0x45cb('0xd'));var jsforce=require(_0x45cb('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x45cb('0xf'));var Papa=require(_0x45cb('0x10'));var Redis=require(_0x45cb('0x11'));var authService=require(_0x45cb('0x12'));var qs=require(_0x45cb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x45cb('0x14'))(_0x45cb('0x15'));var utils=require(_0x45cb('0x16'));var config=require(_0x45cb('0x17'));var db=require(_0x45cb('0x18'))['db'];config['redis']=_['defaults'](config[_0x45cb('0x19')],{'host':_0x45cb('0x1a'),'port':0x18eb});var socket=require(_0x45cb('0x1b'))(new Redis(config[_0x45cb('0x19')]));require('./chatWebsite.socket')[_0x45cb('0x1c')](socket);var jayson=require(_0x45cb('0x1d'));var client=jayson['client'][_0x45cb('0x1e')]({'port':0x232c});var client9002=jayson[_0x45cb('0x1f')][_0x45cb('0x1e')]({'port':0x232a});var client9003=jayson['client'][_0x45cb('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x44956a,_0x16c4bc,_0x304284){if(_0x304284){var _0xde0d03=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xde0d03['test'](_0x16c4bc)){return _0x44956a;}else{throw new db[(_0x45cb('0x20'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x44956a;}}function respondWithRpcPromise(_0x5dcc5b,_0x5187e8,_0x41b5c3,_0xf84ec4){return new BPromise(function(_0x4cb5c6,_0x3542b0){var _0x2fcc3c=_0xf84ec4||client;return _0x2fcc3c[_0x45cb('0x21')](_0x5dcc5b,_0x41b5c3)[_0x45cb('0x22')](function(_0x44de40){logger['info'](_0x45cb('0x23'),_0x5187e8,_0x45cb('0x24'));logger[_0x45cb('0x25')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5187e8,'request\x20sent',JSON[_0x45cb('0x26')](_0x44de40));if(_0x44de40[_0x45cb('0x27')]){if(_0x44de40[_0x45cb('0x27')][_0x45cb('0x28')]===0x1f4){logger[_0x45cb('0x27')](_0x45cb('0x23'),_0x5187e8,_0x44de40['error']['message']);return _0x3542b0(_0x44de40[_0x45cb('0x27')][_0x45cb('0x29')]);}logger[_0x45cb('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x5187e8,_0x44de40[_0x45cb('0x27')][_0x45cb('0x29')]);return _0x4cb5c6(_0x44de40[_0x45cb('0x27')][_0x45cb('0x29')]);}else{logger[_0x45cb('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x5187e8,_0x45cb('0x24'));_0x4cb5c6(_0x44de40['result'][_0x45cb('0x29')]);}})[_0x45cb('0x2b')](function(_0xff198c){logger[_0x45cb('0x27')](_0x45cb('0x23'),_0x5187e8,_0xff198c);_0x3542b0(_0xff198c);});});}function respondWithStatusCode(_0x26d17a,_0x29300e){_0x29300e=_0x29300e||0xcc;return function(_0x5a863a){if(_0x5a863a){return _0x26d17a['sendStatus'](_0x29300e);}return _0x26d17a['status'](_0x29300e)[_0x45cb('0x2c')]();};}function respondWithResult(_0x348e21,_0x1afa60){_0x1afa60=_0x1afa60||0xc8;return function(_0x5d21a5){if(_0x5d21a5){return _0x348e21[_0x45cb('0x2d')](_0x1afa60)[_0x45cb('0x2e')](_0x5d21a5);}};}function respondWithFilteredResult(_0x3bd672,_0x2ab58e){return function(_0x469aab){if(_0x469aab){var _0x205170=_0x469aab[_0x45cb('0x2f')],_0x259ffb=_0x2ab58e[_0x45cb('0x30')],_0x427e50=_0x2ab58e[_0x45cb('0x30')]+_0x2ab58e[_0x45cb('0x31')],_0x480855;if(_0x427e50>=_0x205170){_0x427e50=_0x205170;_0x480855=0xc8;}else{_0x480855=0xce;}_0x3bd672[_0x45cb('0x2d')](_0x480855);return _0x3bd672['set']('Content-Range',_0x259ffb+'-'+_0x427e50+'/'+_0x205170)[_0x45cb('0x2e')](_0x469aab);}return null;};}function patchUpdates(_0x4bdf78){return function(_0x28462e){try{jsonpatch[_0x45cb('0x32')](_0x28462e,_0x4bdf78,!![]);}catch(_0x5e9a55){return BPromise[_0x45cb('0x33')](_0x5e9a55);}return _0x28462e[_0x45cb('0x34')]();};}function saveUpdates(_0x55b7b7,_0x3553d4){return function(_0x44fc62){if(_0x44fc62){return _0x44fc62[_0x45cb('0x35')](_0x55b7b7)[_0x45cb('0x22')](function(_0x545cc7){return _0x545cc7;});}return null;};}function removeEntity(_0x11dedc,_0x2c580c){return function(_0xf0d809){if(_0xf0d809){return _0xf0d809[_0x45cb('0x36')]()[_0x45cb('0x22')](function(){var _0x3d4cc0=_0xf0d809[_0x45cb('0x37')]({'plain':!![]});var _0x5a9709='ChatWebsites';return db[_0x45cb('0x38')][_0x45cb('0x36')]({'where':{'type':_0x5a9709,'resourceId':_0x3d4cc0['id']}})[_0x45cb('0x22')](function(){return _0xf0d809;});})[_0x45cb('0x22')](function(){_0x11dedc[_0x45cb('0x2d')](0xcc)[_0x45cb('0x2c')]();});}};}function handleEntityNotFound(_0x4e3153,_0x5b8d9c){return function(_0x36d857){if(!_0x36d857){_0x4e3153[_0x45cb('0x39')](0x194);}return _0x36d857;};}function handleError(_0x39f81c,_0x27242c){_0x27242c=_0x27242c||0x1f4;return function(_0x33fa8a){logger[_0x45cb('0x27')](_0x33fa8a[_0x45cb('0x3a')]);if(_0x33fa8a[_0x45cb('0x3b')]){delete _0x33fa8a[_0x45cb('0x3b')];}_0x39f81c[_0x45cb('0x2d')](_0x27242c)[_0x45cb('0x3c')](_0x33fa8a);};}exports[_0x45cb('0x3d')]=function(_0x348cb7,_0xd43ccd){var _0x3ff144={'include':[{'model':db[_0x45cb('0x3e')],'as':_0x45cb('0x3f')}]},_0xa3191b={},_0x30c1da={'count':0x0,'rows':[]};var _0x22caf4=_['map'](db['ChatWebsite'][_0x45cb('0x40')],function(_0x511389){return{'name':_0x511389[_0x45cb('0x41')],'type':_0x511389[_0x45cb('0x42')]['key']};});_0xa3191b[_0x45cb('0x43')]=_[_0x45cb('0x44')](_0x22caf4,_0x45cb('0x3b'));_0xa3191b[_0x45cb('0x45')]=_['keys'](_0x348cb7['query']);_0xa3191b[_0x45cb('0x46')]=_[_0x45cb('0x47')](_0xa3191b['model'],_0xa3191b['query']);_0x3ff144[_0x45cb('0x48')]=_[_0x45cb('0x47')](_0xa3191b[_0x45cb('0x43')],qs[_0x45cb('0x49')](_0x348cb7[_0x45cb('0x45')][_0x45cb('0x49')]));_0x3ff144['attributes']=_0x3ff144[_0x45cb('0x48')][_0x45cb('0x4a')]?_0x3ff144[_0x45cb('0x48')]:_0xa3191b[_0x45cb('0x43')];if(!_0x348cb7[_0x45cb('0x45')][_0x45cb('0x4b')]('nolimit')){_0x3ff144[_0x45cb('0x31')]=qs[_0x45cb('0x31')](_0x348cb7[_0x45cb('0x45')][_0x45cb('0x31')]);_0x3ff144[_0x45cb('0x30')]=qs[_0x45cb('0x30')](_0x348cb7['query'][_0x45cb('0x30')]);}_0x3ff144['order']=qs[_0x45cb('0x4c')](_0x348cb7[_0x45cb('0x45')]['sort']);_0x3ff144[_0x45cb('0x4d')]=qs[_0x45cb('0x46')](_[_0x45cb('0x4e')](_0x348cb7[_0x45cb('0x45')],_0xa3191b[_0x45cb('0x46')]));if(_0x348cb7[_0x45cb('0x45')]['filter']){_0x3ff144['where']=_['merge'](_0x3ff144[_0x45cb('0x4d')],{'$or':_[_0x45cb('0x44')](_0x22caf4,function(_0x2ef8af){if(_0x2ef8af[_0x45cb('0x42')]!==_0x45cb('0x4f')){var _0x1a2480={};_0x1a2480[_0x2ef8af[_0x45cb('0x3b')]]={'$like':'%'+_0x348cb7[_0x45cb('0x45')][_0x45cb('0x50')]+'%'};return _0x1a2480;}})});}_0x3ff144=_[_0x45cb('0x51')]({},_0x3ff144,_0x348cb7['options']);var _0x42a619={'where':_0x3ff144[_0x45cb('0x4d')]};return db[_0x45cb('0x52')][_0x45cb('0x2f')](_0x42a619)[_0x45cb('0x22')](function(_0x525972){_0x30c1da['count']=_0x525972;if(_0x348cb7[_0x45cb('0x45')][_0x45cb('0x53')]){_0x3ff144[_0x45cb('0x54')]=[{'all':!![]}];}return db[_0x45cb('0x52')][_0x45cb('0x55')](_0x3ff144);})[_0x45cb('0x22')](function(_0x528d91){_0x30c1da[_0x45cb('0x56')]=_0x528d91;return _0x30c1da;})['then'](respondWithFilteredResult(_0xd43ccd,_0x3ff144))[_0x45cb('0x2b')](handleError(_0xd43ccd,null));};exports[_0x45cb('0x57')]=function(_0xac10e1,_0x353fc5){var _0x17c6d2={'raw':![],'where':{'id':_0xac10e1['params']['id']},'include':[{'model':db[_0x45cb('0x3e')],'as':_0x45cb('0x3f')}]},_0x16f7de={};_0x16f7de[_0x45cb('0x43')]=_[_0x45cb('0x58')](db[_0x45cb('0x52')][_0x45cb('0x40')]);_0x16f7de['query']=_[_0x45cb('0x58')](_0xac10e1['query']);_0x16f7de[_0x45cb('0x46')]=_[_0x45cb('0x47')](_0x16f7de[_0x45cb('0x43')],_0x16f7de[_0x45cb('0x45')]);_0x17c6d2[_0x45cb('0x48')]=_[_0x45cb('0x47')](_0x16f7de[_0x45cb('0x43')],qs['fields'](_0xac10e1[_0x45cb('0x45')]['fields']));_0x17c6d2[_0x45cb('0x48')]=_0x17c6d2[_0x45cb('0x48')]['length']?_0x17c6d2[_0x45cb('0x48')]:_0x16f7de[_0x45cb('0x43')];if(_0xac10e1[_0x45cb('0x45')][_0x45cb('0x53')]){_0x17c6d2[_0x45cb('0x54')]=[{'all':!![]}];}_0x17c6d2=_[_0x45cb('0x51')]({},_0x17c6d2,_0xac10e1[_0x45cb('0x59')]);return db[_0x45cb('0x52')][_0x45cb('0x5a')](_0x17c6d2)[_0x45cb('0x22')](handleEntityNotFound(_0x353fc5,null))[_0x45cb('0x22')](respondWithResult(_0x353fc5,null))[_0x45cb('0x2b')](handleError(_0x353fc5,null));};exports[_0x45cb('0x5b')]=function(_0x4f3449,_0x3ff00c){return db[_0x45cb('0x52')]['create'](_0x4f3449[_0x45cb('0x5c')],{})[_0x45cb('0x22')](function(_0x561a2f){var _0x55364d=_0x4f3449['user']['get']({'plain':!![]});if(!_0x55364d)throw new Error(_0x45cb('0x5d'));if(_0x55364d[_0x45cb('0x5e')]===_0x45cb('0x5f')){var _0x141e29=_0x561a2f[_0x45cb('0x37')]({'plain':!![]});var _0x42c0ee=_0x45cb('0x60');return db['UserProfileSection'][_0x45cb('0x5a')]({'where':{'name':_0x42c0ee,'userProfileId':_0x55364d[_0x45cb('0x61')]},'raw':!![]})[_0x45cb('0x22')](function(_0x494613){if(_0x494613&&_0x494613[_0x45cb('0x62')]===0x0){return db[_0x45cb('0x38')][_0x45cb('0x5b')]({'name':_0x141e29['name'],'resourceId':_0x141e29['id'],'type':_0x494613[_0x45cb('0x3b')],'sectionId':_0x494613['id']},{})[_0x45cb('0x22')](function(){return _0x561a2f;});}else{return _0x561a2f;}})[_0x45cb('0x2b')](function(_0x2abc95){logger[_0x45cb('0x27')](_0x45cb('0x63'),_0x2abc95);throw _0x2abc95;});}return _0x561a2f;})['then'](respondWithResult(_0x3ff00c,0xc9))['catch'](handleError(_0x3ff00c,null));};exports[_0x45cb('0x35')]=function(_0x5e752f,_0x29b1e1){if(_0x5e752f[_0x45cb('0x5c')]['id']){delete _0x5e752f['body']['id'];}return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x5e752f[_0x45cb('0x64')]['id']},'include':[{'model':db[_0x45cb('0x3e')],'as':_0x45cb('0x3f')}]})['then'](handleEntityNotFound(_0x29b1e1,null))['then'](saveUpdates(_0x5e752f['body'],null))[_0x45cb('0x22')](respondWithResult(_0x29b1e1,null))[_0x45cb('0x2b')](handleError(_0x29b1e1,null));};exports['destroy']=function(_0x1c39e3,_0x3d7d0f){return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x1c39e3[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x3d7d0f,null))[_0x45cb('0x22')](removeEntity(_0x3d7d0f,null))[_0x45cb('0x2b')](handleError(_0x3d7d0f,null));};exports['describe']=function(_0x45cfe5,_0x5e2328){return db[_0x45cb('0x52')]['describe']()['then'](respondWithResult(_0x5e2328,null))[_0x45cb('0x2b')](handleError(_0x5e2328,null));};exports[_0x45cb('0x65')]=function(_0x164206,_0x236fff,_0x4e73fa){if(_0x164206[_0x45cb('0x5c')]['id']){delete _0x164206[_0x45cb('0x5c')]['id'];}return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x164206[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x236fff,null))[_0x45cb('0x22')](function(_0x32e946){if(_0x32e946){_0x164206[_0x45cb('0x5c')][_0x45cb('0x66')]=_0x32e946['id'];return db['Disposition'][_0x45cb('0x5b')](_0x164206[_0x45cb('0x5c')]);}})[_0x45cb('0x22')](respondWithResult(_0x236fff,null))[_0x45cb('0x2b')](handleError(_0x236fff,null));};exports[_0x45cb('0x67')]=function(_0x3f827d,_0x1ab6b5,_0x14dcd1){var _0x14bd29={'raw':![],'where':{}};var _0x181b70={};var _0x29cfbb={'count':0x0,'rows':[]};return db[_0x45cb('0x52')]['findOne']({'where':{'id':_0x3f827d[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x1ab6b5,null))['then'](function(_0x1685d6){if(_0x1685d6){_0x181b70[_0x45cb('0x43')]=_[_0x45cb('0x58')](db['Disposition'][_0x45cb('0x40')]);_0x181b70['query']=_[_0x45cb('0x58')](_0x3f827d[_0x45cb('0x45')]);_0x181b70[_0x45cb('0x46')]=_[_0x45cb('0x47')](_0x181b70['model'],_0x181b70[_0x45cb('0x45')]);_0x14bd29[_0x45cb('0x48')]=_['intersection'](_0x181b70['model'],qs[_0x45cb('0x49')](_0x3f827d[_0x45cb('0x45')][_0x45cb('0x49')]));_0x14bd29[_0x45cb('0x48')]=_0x14bd29[_0x45cb('0x48')][_0x45cb('0x4a')]?_0x14bd29['attributes']:_0x181b70[_0x45cb('0x43')];if(!_0x3f827d[_0x45cb('0x45')][_0x45cb('0x4b')]('nolimit')){_0x14bd29[_0x45cb('0x31')]=qs[_0x45cb('0x31')](_0x3f827d['query'][_0x45cb('0x31')]);_0x14bd29['offset']=qs[_0x45cb('0x30')](_0x3f827d[_0x45cb('0x45')][_0x45cb('0x30')]);}_0x14bd29[_0x45cb('0x68')]=qs[_0x45cb('0x4c')](_0x3f827d[_0x45cb('0x45')][_0x45cb('0x4c')]);_0x14bd29[_0x45cb('0x4d')]=qs[_0x45cb('0x46')](_[_0x45cb('0x4e')](_0x3f827d['query'],_0x181b70['filters']));_0x14bd29[_0x45cb('0x4d')][_0x45cb('0x66')]=_0x1685d6['id'];if(_0x3f827d[_0x45cb('0x45')][_0x45cb('0x50')]){_0x14bd29['where']=_['merge'](_0x14bd29['where'],{'$or':_[_0x45cb('0x44')](_0x14bd29[_0x45cb('0x48')],function(_0x393c21){var _0x3d5dc2={};_0x3d5dc2[_0x393c21]={'$like':'%'+_0x3f827d[_0x45cb('0x45')]['filter']+'%'};return _0x3d5dc2;})});}_0x14bd29=_[_0x45cb('0x51')]({},_0x14bd29,_0x3f827d['options']);return db[_0x45cb('0x69')][_0x45cb('0x2f')]({'where':_0x14bd29[_0x45cb('0x4d')]})[_0x45cb('0x22')](function(_0x332ddf){_0x29cfbb['count']=_0x332ddf;if(_0x3f827d['query']['includeAll']){_0x14bd29[_0x45cb('0x54')]=[{'all':!![]}];}return db[_0x45cb('0x69')]['findAll'](_0x14bd29);})['then'](function(_0x39639c){_0x29cfbb[_0x45cb('0x56')]=_0x39639c;return _0x29cfbb;});}})['then'](respondWithFilteredResult(_0x1ab6b5,_0x14bd29))['catch'](handleError(_0x1ab6b5,null));};exports['removeDispositions']=function(_0x3b52ca,_0x16ba65,_0x42e297){return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x3b52ca['params']['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x16ba65,null))['then'](function(_0x283ab2){if(_0x283ab2){return _0x283ab2['removeDispositions'](_0x3b52ca[_0x45cb('0x45')][_0x45cb('0x6a')]);}})[_0x45cb('0x22')](respondWithStatusCode(_0x16ba65,null))[_0x45cb('0x2b')](handleError(_0x16ba65,null));};exports['addAnswer']=function(_0x409bb3,_0xe611db,_0x295695){if(_0x409bb3[_0x45cb('0x5c')]['id']){delete _0x409bb3[_0x45cb('0x5c')]['id'];}return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x409bb3[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0xe611db,null))[_0x45cb('0x22')](function(_0x445111){if(_0x445111){_0x409bb3[_0x45cb('0x5c')]['ChatWebsiteId']=_0x445111['id'];return db[_0x45cb('0x6b')]['create'](_0x409bb3[_0x45cb('0x5c')]);}})[_0x45cb('0x22')](respondWithResult(_0xe611db,null))[_0x45cb('0x2b')](handleError(_0xe611db,null));};exports[_0x45cb('0x6c')]=function(_0x52ec54,_0x4a50fa,_0x3a6e08){var _0x2e6532={'raw':![],'where':{}};var _0x396bb4={};var _0x1fb4cd={'count':0x0,'rows':[]};return db[_0x45cb('0x52')][_0x45cb('0x6d')]({'where':{'id':_0x52ec54[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x4a50fa,null))['then'](function(_0x210fcd){if(_0x210fcd){_0x396bb4[_0x45cb('0x43')]=_['keys'](db[_0x45cb('0x6b')][_0x45cb('0x40')]);_0x396bb4[_0x45cb('0x45')]=_[_0x45cb('0x58')](_0x52ec54[_0x45cb('0x45')]);_0x396bb4[_0x45cb('0x46')]=_['intersection'](_0x396bb4[_0x45cb('0x43')],_0x396bb4[_0x45cb('0x45')]);_0x2e6532['attributes']=_[_0x45cb('0x47')](_0x396bb4[_0x45cb('0x43')],qs[_0x45cb('0x49')](_0x52ec54[_0x45cb('0x45')]['fields']));_0x2e6532[_0x45cb('0x48')]=_0x2e6532[_0x45cb('0x48')][_0x45cb('0x4a')]?_0x2e6532[_0x45cb('0x48')]:_0x396bb4[_0x45cb('0x43')];if(!_0x52ec54['query'][_0x45cb('0x4b')](_0x45cb('0x6e'))){_0x2e6532['limit']=qs['limit'](_0x52ec54[_0x45cb('0x45')][_0x45cb('0x31')]);_0x2e6532[_0x45cb('0x30')]=qs[_0x45cb('0x30')](_0x52ec54['query'][_0x45cb('0x30')]);}_0x2e6532[_0x45cb('0x68')]=qs['sort'](_0x52ec54[_0x45cb('0x45')][_0x45cb('0x4c')]);_0x2e6532[_0x45cb('0x4d')]=qs['filters'](_['pick'](_0x52ec54['query'],_0x396bb4[_0x45cb('0x46')]));_0x2e6532['where'][_0x45cb('0x66')]=_0x210fcd['id'];if(_0x52ec54[_0x45cb('0x45')][_0x45cb('0x50')]){_0x2e6532[_0x45cb('0x4d')]=_[_0x45cb('0x51')](_0x2e6532[_0x45cb('0x4d')],{'$or':_[_0x45cb('0x44')](_0x2e6532[_0x45cb('0x48')],function(_0x4db018){var _0x521385={};_0x521385[_0x4db018]={'$like':'%'+_0x52ec54[_0x45cb('0x45')][_0x45cb('0x50')]+'%'};return _0x521385;})});}_0x2e6532=_[_0x45cb('0x51')]({},_0x2e6532,_0x52ec54[_0x45cb('0x59')]);return db[_0x45cb('0x6b')][_0x45cb('0x2f')]({'where':_0x2e6532[_0x45cb('0x4d')]})[_0x45cb('0x22')](function(_0x17fa20){_0x1fb4cd[_0x45cb('0x2f')]=_0x17fa20;if(_0x52ec54['query'][_0x45cb('0x53')]){_0x2e6532[_0x45cb('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x45cb('0x55')](_0x2e6532);})[_0x45cb('0x22')](function(_0x4fb920){_0x1fb4cd['rows']=_0x4fb920;return _0x1fb4cd;});}})['then'](respondWithFilteredResult(_0x4a50fa,_0x2e6532))[_0x45cb('0x2b')](handleError(_0x4a50fa,null));};exports[_0x45cb('0x6f')]=function(_0x10daf1,_0x57efc6,_0x4db44a){return db['ChatWebsite'][_0x45cb('0x5a')]({'where':{'id':_0x10daf1[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x57efc6,null))[_0x45cb('0x22')](function(_0x29a202){if(_0x29a202){return _0x29a202[_0x45cb('0x6f')](_0x10daf1['query'][_0x45cb('0x6a')]);}})['then'](respondWithStatusCode(_0x57efc6,null))[_0x45cb('0x2b')](handleError(_0x57efc6,null));};exports[_0x45cb('0x70')]=function(_0x153ea9,_0x4160a8,_0x39ef73){_0x153ea9['body']['sitepic']=_0x153ea9['file']['filename'];return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x153ea9['params']['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x4160a8,null))[_0x45cb('0x22')](saveUpdates(_0x153ea9[_0x45cb('0x5c')],null))['then'](respondWithResult(_0x4160a8,null))[_0x45cb('0x2b')](handleError(_0x4160a8,null));};exports[_0x45cb('0x71')]=function(_0x2f7cc3,_0x46a95d,_0x38b979){_0x2f7cc3['body'][_0x45cb('0x72')]=_0x2f7cc3[_0x45cb('0x73')][_0x45cb('0x74')];return db['ChatWebsite'][_0x45cb('0x5a')]({'where':{'id':_0x2f7cc3[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x46a95d,null))['then'](saveUpdates(_0x2f7cc3[_0x45cb('0x5c')],null))['then'](respondWithResult(_0x46a95d,null))[_0x45cb('0x2b')](handleError(_0x46a95d,null));};exports['addCustomerAvatar']=function(_0x3acc18,_0x2bd9ab,_0x3511b0){_0x3acc18[_0x45cb('0x5c')]['customerAvatar']=_0x3acc18['file'][_0x45cb('0x74')];return db[_0x45cb('0x52')]['find']({'where':{'id':_0x3acc18[_0x45cb('0x64')]['id']}})['then'](handleEntityNotFound(_0x2bd9ab,null))['then'](saveUpdates(_0x3acc18['body'],null))[_0x45cb('0x22')](respondWithResult(_0x2bd9ab,null))[_0x45cb('0x2b')](handleError(_0x2bd9ab,null));};exports[_0x45cb('0x75')]=function(_0x280c61,_0xf6f89d,_0x512669){_0x280c61[_0x45cb('0x5c')]['systemAvatar']=_0x280c61[_0x45cb('0x73')][_0x45cb('0x74')];return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x280c61['params']['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0xf6f89d,null))[_0x45cb('0x22')](saveUpdates(_0x280c61[_0x45cb('0x5c')],null))[_0x45cb('0x22')](respondWithResult(_0xf6f89d,null))[_0x45cb('0x2b')](handleError(_0xf6f89d,null));};exports[_0x45cb('0x76')]=function(_0x19556e,_0x29764c,_0x465aad){var _0x5eeade=path[_0x45cb('0x77')](config[_0x45cb('0x78')],_0x45cb('0x79'));var _0x59b273={'where':{'id':_0x19556e[_0x45cb('0x64')]['id']},'attributes':['id',_0x45cb('0x7a')],'raw':!![]};var _0x18c906=![];return require('../../config/license/util')[_0x45cb('0x7b')]()[_0x45cb('0x22')](function(_0x2356d9){if(_0x2356d9){_0x18c906=_0x2356d9['custom'];}})[_0x45cb('0x22')](function(){return db[_0x45cb('0x52')]['find'](_0x59b273);})['then'](handleEntityNotFound(_0x29764c,null))[_0x45cb('0x22')](function(_0x291d32){if(_0x291d32){if(!_[_0x45cb('0x7c')](_0x291d32[_0x45cb('0x7a')])){if(fs['existsSync'](path['join'](config[_0x45cb('0x78')],_0x45cb('0x7d'),_0x291d32['sitepic']))&&_0x18c906){_0x5eeade=path[_0x45cb('0x77')](config[_0x45cb('0x78')],_0x45cb('0x7d'),_0x291d32['sitepic']);}}return _0x29764c[_0x45cb('0x7e')](_0x5eeade);}})[_0x45cb('0x2b')](handleError(_0x29764c,null));};exports['getAvatar']=function(_0x468693,_0x1fe85f,_0x463d20){var _0x11abe4=path['join'](config[_0x45cb('0x78')],_0x45cb('0x7f'));var _0x1f3297={'where':{'id':_0x468693[_0x45cb('0x64')]['id']},'attributes':['id',_0x45cb('0x72')],'raw':!![]};return db[_0x45cb('0x52')][_0x45cb('0x5a')](_0x1f3297)['then'](handleEntityNotFound(_0x1fe85f,null))[_0x45cb('0x22')](function(_0xd1775c){if(_0xd1775c){if(!_[_0x45cb('0x7c')](_0xd1775c[_0x45cb('0x72')])){if(fs[_0x45cb('0x80')](path[_0x45cb('0x77')](config[_0x45cb('0x78')],'server/files/images/avatars/',_0xd1775c[_0x45cb('0x72')]))){_0x11abe4=path['join'](config[_0x45cb('0x78')],_0x45cb('0x81'),_0xd1775c['agentAvatar']);}}return _0x1fe85f[_0x45cb('0x7e')](_0x11abe4);}})['catch'](handleError(_0x1fe85f,null));};exports[_0x45cb('0x82')]=function(_0x987df3,_0x4bd191,_0x4ffde7){var _0x495c20=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x4a65c1={'where':{'id':_0x987df3['params']['id']},'attributes':['id',_0x45cb('0x83'),_0x45cb('0x84')],'raw':!![]};return db['ChatWebsite'][_0x45cb('0x5a')](_0x4a65c1)[_0x45cb('0x22')](handleEntityNotFound(_0x4bd191,null))[_0x45cb('0x22')](function(_0x52f7c2){if(_0x52f7c2){if(!_[_0x45cb('0x7c')](_0x52f7c2[_0x45cb('0x83')])){if(fs[_0x45cb('0x80')](path[_0x45cb('0x77')](config['root'],_0x45cb('0x81'),_0x52f7c2[_0x45cb('0x83')]))&&_0x52f7c2[_0x45cb('0x84')]){_0x495c20=path[_0x45cb('0x77')](config[_0x45cb('0x78')],'server/files/images/avatars/',_0x52f7c2[_0x45cb('0x83')]);}}return _0x4bd191[_0x45cb('0x7e')](_0x495c20);}})['catch'](handleError(_0x4bd191,null));};exports['getSystemAvatar']=function(_0x8ec8b4,_0x7a5d12,_0x1de62e){var _0x55abbb=path['join'](config[_0x45cb('0x78')],_0x45cb('0x85'));var _0x391eea={'where':{'id':_0x8ec8b4['params']['id']},'attributes':['id',_0x45cb('0x86')],'raw':!![]};return db[_0x45cb('0x52')][_0x45cb('0x5a')](_0x391eea)[_0x45cb('0x22')](handleEntityNotFound(_0x7a5d12,null))['then'](function(_0x38ef2a){if(_0x38ef2a){if(!_['isNil'](_0x38ef2a[_0x45cb('0x86')])){if(fs['existsSync'](path[_0x45cb('0x77')](config[_0x45cb('0x78')],_0x45cb('0x81'),_0x38ef2a['systemAvatar']))){_0x55abbb=path[_0x45cb('0x77')](config[_0x45cb('0x78')],_0x45cb('0x81'),_0x38ef2a[_0x45cb('0x86')]);}}return _0x7a5d12['download'](_0x55abbb);}})[_0x45cb('0x2b')](handleError(_0x7a5d12,null));};exports[_0x45cb('0x87')]=function(_0x4d125c,_0x552d68,_0x551843){var _0x32baca=require('user-agent-parser');var _0x19c8a3=new _0x32baca();var _0x383671=_0x19c8a3[_0x45cb('0x88')](_0x4d125c[_0x45cb('0x89')]['user-agent'])[_0x45cb('0x8a')]();var _0x301995={'body':_0x4d125c[_0x45cb('0x5c')],'channel':_0x45cb('0x8b')};var _0x15f5ab=[];var _0x557cf9=[];var _0x16c13f={};var _0x37caf5=![];return db[_0x45cb('0x8c')][_0x45cb('0x8d')]()[_0x45cb('0x22')](function(_0x148f21){if(!_0x148f21){throw new db['Sequelize'][(_0x45cb('0x8e'))](_0x45cb('0x8f'));}_0x15f5ab=_[_0x45cb('0x90')](_['keys'](_0x148f21),[_0x45cb('0x91'),_0x45cb('0x92')]);_0x557cf9=_['difference'](_[_0x45cb('0x58')](_0x148f21),['createdAt',_0x45cb('0x92'),_0x45cb('0x93'),'ListId']);if(_0x4d125c[_0x45cb('0x5c')]['id']){delete _0x4d125c['body']['id'];}if(_['isNil'](_0x4d125c[_0x45cb('0x5c')][_0x45cb('0x94')])){throw new db['Sequelize'][(_0x45cb('0x8e'))](_0x45cb('0x95'));}if(_[_0x45cb('0x7c')](_0x4d125c[_0x45cb('0x5c')][_0x45cb('0x5c')])||_0x4d125c[_0x45cb('0x5c')][_0x45cb('0x5c')]===''){throw new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))](_0x45cb('0x96'));}if(_[_0x45cb('0x7c')](_0x4d125c[_0x45cb('0x5c')][_0x45cb('0x97')])){throw new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))](_0x45cb('0x98')+_0x557cf9);}if(!_['includes'](_0x557cf9,_0x4d125c[_0x45cb('0x5c')]['mapKey'])){throw new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))](_0x45cb('0x99')+_0x557cf9);}_0x16c13f[_0x4d125c['body'][_0x45cb('0x97')]]=_0x4d125c[_0x45cb('0x5c')][_0x45cb('0x94')];})[_0x45cb('0x22')](function(){return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x4d125c[_0x45cb('0x64')]['id']},'include':[{'model':db[_0x45cb('0x9a')],'as':_0x45cb('0x9b'),'include':[{'model':db[_0x45cb('0x8c')],'as':_0x45cb('0x9c'),'where':_0x16c13f,'limit':0x1,'order':[[_0x45cb('0x92'),_0x45cb('0x9d')]]}]},{'model':db[_0x45cb('0x9e')],'as':_0x45cb('0x9f')}]});})['then'](handleEntityNotFound(_0x552d68,null))['then'](function(_0x7706c3){if(_0x7706c3&&_0x7706c3[_0x45cb('0x9b')]){_0x301995[_0x45cb('0xa0')]=_0x7706c3;_0x301995[_0x45cb('0xa1')]=_0x7706c3[_0x45cb('0x9f')];_0x301995[_0x45cb('0xa2')]=_0x7706c3[_0x45cb('0x9b')];_0x301995[_0x45cb('0xa1')]=_[_0x45cb('0xa3')](_0x301995[_0x45cb('0xa1')],['priority'],['asc']);if(_0x301995[_0x45cb('0xa0')][_0x45cb('0x9f')]){delete _0x301995[_0x45cb('0xa0')][_0x45cb('0x9f')];}if(_0x301995[_0x45cb('0xa0')][_0x45cb('0x9b')]&&_0x301995['account'][_0x45cb('0x9b')]['Contacts'][_0x45cb('0x4a')]){return _0x301995[_0x45cb('0xa0')][_0x45cb('0x9b')][_0x45cb('0x9c')][0x0];}var _0x406b33=_[_0x45cb('0xa4')](_0x4d125c[_0x45cb('0x5c')],{'firstName':_0x4d125c[_0x45cb('0x5c')][_0x45cb('0x94')],'ListId':_0x7706c3[_0x45cb('0xa5')]});_0x406b33[_0x4d125c['body'][_0x45cb('0x97')]]=_0x4d125c[_0x45cb('0x5c')][_0x45cb('0x94')];return db[_0x45cb('0x8c')]['create'](_0x406b33,{'fields':_0x15f5ab,'raw':!![]});}})['then'](handleEntityNotFound(_0x552d68,null))[_0x45cb('0x22')](function(_0x401598){_0x301995['contact']=_0x401598;var _0x23bbec=_0x4d125c['body']['customerIp'];if(_0x4d125c[_0x45cb('0x89')][_0x45cb('0xa6')]){_0x23bbec=_0x4d125c[_0x45cb('0x89')][_0x45cb('0xa6')];}else if(_0x4d125c['headers'][_0x45cb('0xa7')]){_0x23bbec=_[_0x45cb('0xa8')](_0x4d125c[_0x45cb('0x89')][_0x45cb('0xa7')]['split'](','));}if(_0x401598){var _0x1a2af6={'ContactId':_0x401598['id'],'ChatWebsiteId':_0x4d125c[_0x45cb('0x64')]['id'],'from':(_0x401598[_0x45cb('0xa9')]||'')+'\x20'+(_0x401598[_0x45cb('0xaa')]||''),'customerIp':_0x23bbec,'customerPort':_0x4d125c['headers'][_0x45cb('0xab')]?_0x4d125c[_0x45cb('0x89')]['x-real-port']:null,'referer':_0x4d125c[_0x45cb('0x5c')]['referer'],'browserName':_0x383671[_0x45cb('0xac')][_0x45cb('0x3b')]&&_0x383671[_0x45cb('0xac')][_0x45cb('0xad')]?util[_0x45cb('0xae')]('%s\x20%s',_0x383671[_0x45cb('0xac')][_0x45cb('0x3b')],_0x383671[_0x45cb('0xac')][_0x45cb('0xad')]):_0x45cb('0xaf'),'browserVersion':_0x383671[_0x45cb('0xac')][_0x45cb('0xad')]||_0x45cb('0xaf'),'osName':util[_0x45cb('0xae')](_0x45cb('0xb0'),_0x383671['os'][_0x45cb('0x3b')],_0x383671['os'][_0x45cb('0xad')]),'osVersion':_0x383671['os'][_0x45cb('0xad')],'deviceModel':_0x383671[_0x45cb('0xb1')][_0x45cb('0x43')]&&_0x383671['device']['vendor']?util[_0x45cb('0xae')](_0x45cb('0xb2'),_0x383671['device'][_0x45cb('0x43')],_0x383671['device']['vendor'],_0x383671[_0x45cb('0xb1')][_0x45cb('0x42')]):null,'deviceVendor':_0x383671[_0x45cb('0xb1')][_0x45cb('0xb3')],'deviceType':_0x383671[_0x45cb('0xb1')][_0x45cb('0x42')],'formData':JSON[_0x45cb('0x26')](_0x4d125c[_0x45cb('0x5c')])};var _0x44b0f2={'ChatWebsiteId':_0x4d125c[_0x45cb('0x64')]['id'],'closed':![]};if(_0x4d125c['body']['threadId']){_0x44b0f2[_0x45cb('0xb4')]=_0x4d125c[_0x45cb('0x5c')][_0x45cb('0xb4')];return db[_0x45cb('0xb5')][_0x45cb('0x5a')]({'where':_0x44b0f2})[_0x45cb('0x22')](function(_0x2b83b2){if(_0x2b83b2){return[_0x2b83b2,![]];}_0x1a2af6[_0x45cb('0xb4')]=_0x4d125c[_0x45cb('0x5c')][_0x45cb('0xb4')];_0x1a2af6[_0x45cb('0xb6')]=_0x4d125c[_0x45cb('0x5c')][_0x45cb('0xb6')];return db[_0x45cb('0xb5')][_0x45cb('0x5b')](_0x1a2af6)[_0x45cb('0x22')](function(_0xf88652){return[_0xf88652,!![]];});});}_0x44b0f2['ContactId']=_0x401598['id'];if(_0x4d125c[_0x45cb('0x5c')][_0x45cb('0xb7')]&&_0x4d125c[_0x45cb('0x5c')]['interaction']['id']){_0x44b0f2['id']=_0x4d125c['body']['interaction']['id'];return db[_0x45cb('0xb5')][_0x45cb('0x5a')]({'where':_0x44b0f2})[_0x45cb('0x22')](function(_0x2b8c2d){if(_0x2b8c2d){return[_0x2b8c2d,![]];}return db['ChatInteraction'][_0x45cb('0x5b')](_0x1a2af6)['then'](function(_0x45cbb3){return[_0x45cbb3,!![]];});});}return db[_0x45cb('0xb5')]['create'](_0x1a2af6)[_0x45cb('0x22')](function(_0x59e48c){return[_0x59e48c,!![]];});}})[_0x45cb('0xb8')](function(_0x4791c7,_0x4d99b1){if(_0x4791c7){_0x37caf5=_0x4d99b1;if(!_0x4d99b1){var _0x50ae00={'from':(_0x301995[_0x45cb('0xb9')]['firstName']||'')+'\x20'+(_0x301995[_0x45cb('0xb9')]['lastName']||'')};if(_0x4d125c['body'][_0x45cb('0xb4')]&&_0x4d125c['body'][_0x45cb('0xba')]&&_0x4d125c[_0x45cb('0x5c')][_0x45cb('0xb4')]!=_0x4d125c[_0x45cb('0x5c')]['messageId']){_0x50ae00[_0x45cb('0xb4')]=_0x4d125c[_0x45cb('0x5c')][_0x45cb('0xba')];}return _0x4791c7[_0x45cb('0x35')](_0x50ae00);}else{return _0x4791c7;}}})['then'](function(_0x24492f){_0x301995['interaction']=_0x24492f[_0x45cb('0x37')]({'plain':!![]});_0x301995[_0x45cb('0xb7')][_0x45cb('0xbb')]=_0x37caf5;if(_0x301995[_0x45cb('0xb7')][_0x45cb('0xbb')]){if(_0x301995[_0x45cb('0xa0')][_0x45cb('0xbc')]){_0x301995[_0x45cb('0xa1')][_0x45cb('0xbd')]({'id':0x0,'priority':_0x301995['applications'][_0x45cb('0x4a')]+0x1,'app':_0x45cb('0xbe'),'appdata':_0x45cb('0xbf'),'interval':'*,*,*,*'});}}return db[_0x45cb('0xc0')][_0x45cb('0x5b')]({'body':_0x4d125c[_0x45cb('0x5c')]['body'],'ChatWebsiteId':_0x4d125c[_0x45cb('0x64')]['id'],'ChatInteractionId':_0x24492f['id'],'direction':'in','ContactId':_0x301995['contact']['id'],'AttachmentId':_0x4d125c[_0x45cb('0x5c')][_0x45cb('0xc1')]});})[_0x45cb('0x22')](function(_0x5a8430){_0x301995[_0x45cb('0x29')]=_0x5a8430;if(_0x301995[_0x45cb('0xb7')]['UserId']){return db['User'][_0x45cb('0x5a')]({'attributes':['id',_0x45cb('0x3b')],'where':{'id':_0x301995[_0x45cb('0xb7')][_0x45cb('0xc2')]}})['then'](function(_0x4f0f9e){if(_0x4f0f9e){_0x301995['applications'][_0x45cb('0xc3')]({'id':0x0,'priority':0x0,'app':_0x45cb('0xc4'),'appdata':_0x4f0f9e[_0x45cb('0x3b')]+','+(_0x301995[_0x45cb('0xa0')][_0x45cb('0xc5')]||0xa),'interval':_0x45cb('0xc6')});_0x301995[_0x45cb('0xc7')]=!![];}return respondWithRpcPromise('Start',_0x45cb('0xc8'),_0x301995);});}return respondWithRpcPromise(_0x45cb('0xc9'),_0x45cb('0xc8'),_0x301995);})['then'](function(_0x3095cb){respondWithRpcPromise(_0x45cb('0xca'),_0x45cb('0xca'),{'event':_0x45cb('0x87'),'message':_0x3095cb},client9002);return _0x3095cb;})[_0x45cb('0x22')](respondWithResult(_0x552d68,null))[_0x45cb('0x2b')](handleError(_0x552d68,null));};exports[_0x45cb('0xcb')]=function(_0x394ad9,_0x2190b9,_0x50e735){var _0x31bf09,_0x48b03c,_0x335067;var _0x47d509=[];var _0x39c535=[];var _0x87d19d={};return db[_0x45cb('0x8c')]['describe']()[_0x45cb('0x22')](function(_0x147e7e){if(!_0x147e7e){throw new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))](_0x45cb('0x8f'));}_0x39c535=_['difference'](_[_0x45cb('0x58')](_0x147e7e),['createdAt','updatedAt']);_0x47d509=_[_0x45cb('0x90')](_[_0x45cb('0x58')](_0x147e7e),[_0x45cb('0x91'),_0x45cb('0x92'),_0x45cb('0x93'),_0x45cb('0xa5')]);if(_0x394ad9['body']['id']){delete _0x394ad9['body']['id'];}if(_[_0x45cb('0x7c')](_0x394ad9[_0x45cb('0x5c')][_0x45cb('0x94')])){throw _0x2190b9[_0x45cb('0x2d')](0x1f4)[_0x45cb('0x3c')](new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))](_0x45cb('0x95')));}if(_['isNil'](_0x394ad9[_0x45cb('0x5c')][_0x45cb('0x5c')])||_0x394ad9['body'][_0x45cb('0x5c')]===''){throw _0x2190b9[_0x45cb('0x2d')](0x1f4)[_0x45cb('0x3c')](new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))](_0x45cb('0x96')));}if(_[_0x45cb('0x7c')](_0x394ad9[_0x45cb('0x5c')][_0x45cb('0xcc')])){throw _0x2190b9[_0x45cb('0x2d')](0x1f4)[_0x45cb('0x3c')](new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x47d509));}if(!_[_0x45cb('0xcd')](_0x47d509,_0x394ad9[_0x45cb('0x5c')][_0x45cb('0xcc')])){throw _0x2190b9[_0x45cb('0x2d')](0x1f4)[_0x45cb('0x3c')](new db[(_0x45cb('0x20'))][(_0x45cb('0x8e'))](_0x45cb('0xce')+_0x47d509));}_0x87d19d[_0x394ad9[_0x45cb('0x5c')]['mapKeyOffline']]=_0x394ad9[_0x45cb('0x5c')][_0x45cb('0x94')];})[_0x45cb('0x22')](function(){return db[_0x45cb('0x52')]['find']({'where':{'id':_0x394ad9[_0x45cb('0x64')]['id']},'include':[{'model':db[_0x45cb('0x9a')],'as':_0x45cb('0x9b')}]});})['then'](handleEntityNotFound(_0x2190b9,null))['then'](function(_0x373bb6){if(_0x373bb6&&_0x373bb6[_0x45cb('0x9b')]){_0x48b03c=_0x373bb6;var _0x48eb0e=_[_0x45cb('0xa4')](_0x394ad9[_0x45cb('0x5c')],{'firstName':_0x394ad9[_0x45cb('0x5c')][_0x45cb('0x94')],'phone':_0x394ad9[_0x45cb('0x5c')]['from'],'ListId':_0x373bb6['ListId']});_0x48eb0e[_0x394ad9[_0x45cb('0x5c')][_0x45cb('0xcc')]]=_0x394ad9[_0x45cb('0x5c')]['from'];return db[_0x45cb('0x8c')][_0x45cb('0xcf')]({'where':_0x87d19d,'defaults':_0x48eb0e});}})[_0x45cb('0xb8')](function(_0x41b4e4){if(_0x41b4e4){_0x335067=_0x41b4e4;var _0x498161=fs['readFileSync'](path[_0x45cb('0x77')](config[_0x45cb('0x78')],'server/files/templates/chatOfflineMessage.ejs'),_0x45cb('0xd0'));var _0x3ceefb=ejs[_0x45cb('0xd1')](_0x498161,{'body':_[_0x45cb('0xd2')](_0x394ad9[_0x45cb('0x5c')][_0x45cb('0x5c')]),'bodyTitle':_0x48b03c[_0x45cb('0xd3')]});return db[_0x45cb('0xd4')]['create']({'body':_0x3ceefb,'ContactId':_0x41b4e4['id'],'ChatWebsiteId':_0x48b03c['id']});}})[_0x45cb('0x22')](function(_0x48373d){if(_0x48373d){_0x31bf09=_0x48373d;return db[_0x45cb('0xd5')][_0x45cb('0x6d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x45cb('0xd6'),'raw':!![]}]});}})[_0x45cb('0x22')](function(_0x6b48f2){if(_0x6b48f2&&_0x6b48f2[_0x45cb('0xd6')]&&_0x48b03c[_0x45cb('0xd7')]){var _0x68d400={'tls':{'rejectUnauthorized':![]}};if(_0x6b48f2['Smtp'][_0x45cb('0xd8')]){_0x68d400[_0x45cb('0xd8')]=_0x6b48f2[_0x45cb('0xd6')]['service'];}else{_0x68d400[_0x45cb('0xd9')]=_0x6b48f2[_0x45cb('0xd6')]['host'];_0x68d400['port']=_0x6b48f2[_0x45cb('0xd6')][_0x45cb('0xda')];_0x68d400['secure']=_0x6b48f2[_0x45cb('0xd6')][_0x45cb('0xdb')];}if(_0x6b48f2['Smtp'][_0x45cb('0xdc')]){_0x68d400[_0x45cb('0xdd')]={'user':_0x6b48f2[_0x45cb('0xd6')][_0x45cb('0x5f')],'pass':_0x6b48f2[_0x45cb('0xd6')][_0x45cb('0xde')]};}return respondWithRpcPromise(_0x45cb('0xdf'),'sendMail',{'account':_0x68d400,'message':{'from':util[_0x45cb('0xae')](_0x45cb('0xe0'),_0x6b48f2[_0x45cb('0x3b')],_0x6b48f2[_0x45cb('0xe1')]||_0x6b48f2[_0x45cb('0xd6')][_0x45cb('0x5f')]),'to':_0x48b03c[_0x45cb('0xd7')],'subject':_0x48b03c[_0x45cb('0xe2')],'text':_0x31bf09['body']}},client9003)[_0x45cb('0x22')](function(){return _0x31bf09;})[_0x45cb('0x2b')](function(_0x4e08cc){console['error'](_0x4e08cc);});}})[_0x45cb('0x22')](function(){if(_0x31bf09){return _0x31bf09;}})[_0x45cb('0x22')](respondWithResult(_0x2190b9,null))[_0x45cb('0x2b')](handleError(_0x2190b9,null));};exports[_0x45cb('0xe3')]=function(_0xdf5a94,_0x5b6662,_0x2d5038){return db[_0x45cb('0xb5')][_0x45cb('0x5a')]({'where':{'id':_0xdf5a94[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x5b6662,null))[_0x45cb('0x22')](function(_0x39844d){if(_0x39844d){return _0x39844d[_0x45cb('0xe3')](_0xdf5a94[_0x45cb('0x5c')][_0x45cb('0x6a')],_['omit'](_0xdf5a94[_0x45cb('0x5c')],[_0x45cb('0x6a'),'id'])||{});}})[_0x45cb('0x22')](respondWithResult(_0x5b6662,null))[_0x45cb('0x2b')](handleError(_0x5b6662,null));};exports[_0x45cb('0xe4')]=function(_0x1205db,_0x5b1186,_0x448da3){var _0x3c6fd2={'raw':![],'where':{}};var _0x4095d2={};var _0x279aee={'count':0x0,'rows':[]};return db[_0x45cb('0x52')]['findOne']({'where':{'id':_0x1205db['params']['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x5b1186,null))[_0x45cb('0x22')](function(_0x58e4f4){if(_0x58e4f4){_0x4095d2['model']=_[_0x45cb('0x58')](db['ChatInteraction']['rawAttributes']);_0x4095d2['query']=_['keys'](_0x1205db[_0x45cb('0x45')]);_0x4095d2[_0x45cb('0x46')]=_[_0x45cb('0x47')](_0x4095d2[_0x45cb('0x43')],_0x4095d2[_0x45cb('0x45')]);_0x3c6fd2[_0x45cb('0x48')]=_[_0x45cb('0x47')](_0x4095d2['model'],qs[_0x45cb('0x49')](_0x1205db[_0x45cb('0x45')]['fields']));_0x3c6fd2[_0x45cb('0x48')]=_0x3c6fd2['attributes']['length']?_0x3c6fd2[_0x45cb('0x48')]:_0x4095d2[_0x45cb('0x43')];if(!_0x1205db['query']['hasOwnProperty'](_0x45cb('0x6e'))){_0x3c6fd2[_0x45cb('0x31')]=qs[_0x45cb('0x31')](_0x1205db['query'][_0x45cb('0x31')]);_0x3c6fd2['offset']=qs[_0x45cb('0x30')](_0x1205db[_0x45cb('0x45')][_0x45cb('0x30')]);}_0x3c6fd2[_0x45cb('0x68')]=qs['sort'](_0x1205db[_0x45cb('0x45')]['sort']);_0x3c6fd2[_0x45cb('0x4d')]=qs[_0x45cb('0x46')](_[_0x45cb('0x4e')](_0x1205db[_0x45cb('0x45')],_0x4095d2[_0x45cb('0x46')]));_0x3c6fd2[_0x45cb('0x4d')]['ChatWebsiteId']=_0x58e4f4['id'];if(_0x1205db[_0x45cb('0x45')][_0x45cb('0x50')]){_0x3c6fd2['where']=_[_0x45cb('0x51')](_0x3c6fd2[_0x45cb('0x4d')],{'$or':_[_0x45cb('0x44')](_0x3c6fd2['attributes'],function(_0x277b0b){var _0x38509a={};_0x38509a[_0x277b0b]={'$like':'%'+_0x1205db['query'][_0x45cb('0x50')]+'%'};return _0x38509a;})});}_0x3c6fd2=_[_0x45cb('0x51')]({},_0x3c6fd2,_0x1205db['options']);return db[_0x45cb('0xb5')][_0x45cb('0x2f')]({'where':_0x3c6fd2[_0x45cb('0x4d')]})[_0x45cb('0x22')](function(_0x29e0e8){_0x279aee[_0x45cb('0x2f')]=_0x29e0e8;if(_0x1205db[_0x45cb('0x45')][_0x45cb('0x53')]){_0x3c6fd2[_0x45cb('0x54')]=[{'model':db[_0x45cb('0x8c')],'as':_0x45cb('0xe5'),'required':![]},{'model':db[_0x45cb('0xe6')],'as':_0x45cb('0xe7'),'attributes':['name',_0x45cb('0xe8'),_0x45cb('0xe9')],'required':![]},{'model':db[_0x45cb('0xea')],'as':_0x45cb('0xeb'),'attributes':['id','name',_0x45cb('0xec')],'where':_0x1205db['query'][_0x45cb('0xed')]?{'id':_0x1205db[_0x45cb('0x45')]['tag']}:undefined,'required':_0x1205db[_0x45cb('0x45')][_0x45cb('0xed')]?!![]:![]}];}return db[_0x45cb('0xb5')]['findAll'](_0x3c6fd2);})[_0x45cb('0x22')](function(_0xd0d764){_0x279aee[_0x45cb('0x56')]=_0xd0d764;return _0x279aee;});}})['then'](respondWithFilteredResult(_0x5b1186,_0x3c6fd2))['catch'](handleError(_0x5b1186,null));};function iftimePromise(_0x97cd3d,_0x540e99){return respondWithRpcPromise(_0x45cb('0xee'),_0x45cb('0xef'),{'command':_0x540e99['timezone']?util[_0x45cb('0xae')]('iftime\x20%s,%s',_0x97cd3d[_0x45cb('0xf0')],_0x540e99[_0x45cb('0xf1')]):util['format']('iftime\x20%s',_0x97cd3d[_0x45cb('0xf0')])},client9002)[_0x45cb('0x22')](function(_0x3da053){var _0x33416d=_0x3da053&&_0x3da053[_0x45cb('0xf2')](_0x45cb('0xf3'))>=0x0?!![]:![];logger['info'](_0x45cb('0xf4'),_0x540e99['id'],_0x97cd3d['id'],_0x97cd3d[_0x45cb('0xf0')],_0x33416d?'ONLINE':_0x45cb('0xf5'),_0x540e99['timezone']?_0x540e99[_0x45cb('0xf1')]:_0x45cb('0xf6'));return _0x33416d;})[_0x45cb('0x2b')](function(_0x36112f){logger[_0x45cb('0x27')](_0x45cb('0xf4'),_0x540e99['id'],_0x97cd3d['id'],_0x97cd3d[_0x45cb('0xf0')],util[_0x45cb('0xf7')](_0x36112f,{'showHidden':![],'depth':null}),_0x540e99[_0x45cb('0xf1')]?_0x540e99[_0x45cb('0xf1')]:'No\x20timezone');return![];});}exports[_0x45cb('0xef')]=function(_0x1ed4cc,_0x10a05a,_0x3a93c1){var _0x26bd86=0x0;var _0x264642=0x0;var _0x192cfd=![];var _0x31caa4;var _0x2ab452;return db[_0x45cb('0x52')]['find']({'where':{'id':_0x1ed4cc[_0x45cb('0x64')]['id']},'include':[{'model':db[_0x45cb('0xf8')],'as':_0x45cb('0xf8'),'include':[{'model':db[_0x45cb('0xf8')],'as':_0x45cb('0xf9'),'attributes':['id',_0x45cb('0xf0')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x10a05a,null))[_0x45cb('0x22')](function(_0x20ef36){if(_0x20ef36){_0x31caa4=_0x20ef36;return _0x20ef36['getProactiveActions']({'raw':!![]});}})[_0x45cb('0x22')](function(_0x260611){if(_0x31caa4){if(_0x260611){_0x2ab452=_0x260611;}}return require('../../config/license/util')[_0x45cb('0x7b')]();})[_0x45cb('0x22')](function(_0x53a27d){if(_0x53a27d){_0x264642=_0x53a27d['virtual'];_0x192cfd=_0x53a27d[_0x45cb('0xfa')];}})[_0x45cb('0x22')](function(){return db[_0x45cb('0xb5')][_0x45cb('0x2f')]({'where':{'closed':![]}});})[_0x45cb('0x22')](function(_0x46349f){_0x26bd86=_0x46349f;if(_0x264642&&_0x46349f>_0x264642){return db[_0x45cb('0xfb')]['findOne']({'where':{'id':0x1}})[_0x45cb('0x22')](function(_0x2d7a1e){if(_0x2d7a1e){_0x2d7a1e[_0x45cb('0xfc')](_0x45cb('0xfd'));}});}})['then'](function(){if(_0x31caa4[_0x45cb('0xf8')]&&_0x31caa4[_0x45cb('0xf8')][_0x45cb('0xf9')]){var _0x32dd29=[];for(var _0xa46ada=0x0;_0xa46ada<_0x31caa4[_0x45cb('0xf8')][_0x45cb('0xf9')][_0x45cb('0x4a')];_0xa46ada++){var _0x56c173=_0x31caa4[_0x45cb('0xf8')][_0x45cb('0xf9')][_0xa46ada]['get']({'plain':!![]});_0x32dd29['push'](iftimePromise(_0x56c173,_0x31caa4));}return BPromise[_0x45cb('0xfe')](_0x32dd29)['then'](function(_0x5632bf){return _[_0x45cb('0xff')](_0x5632bf);});}else{return!![];}})[_0x45cb('0x22')](function(_0x1574bf){var _0x37cef3=fs['readFileSync'](path[_0x45cb('0x77')](config[_0x45cb('0x78')],_0x45cb('0x100')),_0x45cb('0xd0'));var _0x213889={'remote':_0x31caa4[_0x45cb('0x101')],'query':querystring['stringify'](_['merge'](_0x31caa4['get']({'plain':!![]}),{'customerIp':_0x1ed4cc['headers']['x-forwarded-for']||_0x1ed4cc[_0x45cb('0x89')][_0x45cb('0x102')]||_0x1ed4cc['connection'][_0x45cb('0x103')]||_0x1ed4cc['ip'],'referer':_0x1ed4cc[_0x45cb('0x89')][_0x45cb('0x104')],'openedInteractions':_0x26bd86,'maxInteractions':_0x264642,'virtual':_0x192cfd[_0x45cb('0x105')],'online':_0x1574bf,'custom':_0x192cfd}))[_0x45cb('0x106')](/'/g,'\x5c\x27')};_0x10a05a[_0x45cb('0x3c')](ejs[_0x45cb('0xd1')](Mustache['render'](_0x37cef3,_0x213889),{'proactiveActions':_0x2ab452,'alignment':_0x31caa4['alignment'],'verticalAlignment':_0x31caa4[_0x45cb('0x107')],'div_color':_0x31caa4[_0x45cb('0xec')],'text_color':_0x31caa4[_0x45cb('0x108')]}));})['catch'](handleError(_0x10a05a,null));};exports[_0x45cb('0x109')]=function(_0x2d2719,_0x5ece9a,_0x30107f){return db[_0x45cb('0x52')]['findOne']({'where':{'id':_0x2d2719['params']['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x5ece9a,null))[_0x45cb('0x22')](function(_0x382dbc){if(_0x382dbc){return db[_0x45cb('0x10a')]['transaction'](function(_0xd7bdf){return db[_0x45cb('0x9e')][_0x45cb('0x36')]({'where':{'ChatWebsiteId':_0x2d2719[_0x45cb('0x64')]['id']},'transaction':_0xd7bdf})[_0x45cb('0x22')](function(_0x3aac77){var _0x26d23b=_[_0x45cb('0x44')](_0x2d2719[_0x45cb('0x5c')],function(_0x1a8eca){_0x1a8eca[_0x45cb('0x66')]=_0x2d2719[_0x45cb('0x64')]['id'];return _0x1a8eca;});return db[_0x45cb('0x9e')][_0x45cb('0x10b')](_0x26d23b,{'transaction':_0xd7bdf});});})[_0x45cb('0x22')](function(){return db[_0x45cb('0x9e')][_0x45cb('0x10c')]({'where':{'ChatWebsiteId':_0x2d2719[_0x45cb('0x64')]['id']},'order':_0x45cb('0x10d')});});}})[_0x45cb('0x22')](respondWithResult(_0x5ece9a,null))['catch'](handleError(_0x5ece9a,null));};exports[_0x45cb('0x10e')]=function(_0x2e87d3,_0x26cf4d,_0x15175d){var _0x5dd4b6={};var _0x555506={};var _0x1bbe9e;var _0xe74cf0;return db[_0x45cb('0x52')][_0x45cb('0x6d')]({'where':{'id':_0x2e87d3[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x26cf4d,null))[_0x45cb('0x22')](function(_0x274ddb){if(_0x274ddb){_0x1bbe9e=_0x274ddb;_0x555506['model']=_[_0x45cb('0x58')](db['ChatApplication'][_0x45cb('0x40')]);_0x555506[_0x45cb('0x45')]=_[_0x45cb('0x58')](_0x2e87d3[_0x45cb('0x45')]);_0x555506[_0x45cb('0x46')]=_[_0x45cb('0x47')](_0x555506[_0x45cb('0x43')],_0x555506[_0x45cb('0x45')]);_0x5dd4b6[_0x45cb('0x48')]=_[_0x45cb('0x47')](_0x555506['model'],qs[_0x45cb('0x49')](_0x2e87d3[_0x45cb('0x45')]['fields']));_0x5dd4b6[_0x45cb('0x48')]=_0x5dd4b6[_0x45cb('0x48')][_0x45cb('0x4a')]?_0x5dd4b6['attributes']:_0x555506[_0x45cb('0x43')];_0x5dd4b6[_0x45cb('0x68')]=qs[_0x45cb('0x4c')](_0x2e87d3['query'][_0x45cb('0x4c')]);_0x5dd4b6[_0x45cb('0x4d')]=qs[_0x45cb('0x46')](_[_0x45cb('0x4e')](_0x2e87d3[_0x45cb('0x45')],_0x555506[_0x45cb('0x46')]));if(_0x2e87d3[_0x45cb('0x45')][_0x45cb('0x50')]){_0x5dd4b6[_0x45cb('0x4d')]=_[_0x45cb('0x51')](_0x5dd4b6[_0x45cb('0x4d')],{'$or':_['map'](_0x5dd4b6[_0x45cb('0x48')],function(_0xac6df4){var _0x51e6dd={};_0x51e6dd[_0xac6df4]={'$like':'%'+_0x2e87d3['query'][_0x45cb('0x50')]+'%'};return _0x51e6dd;})});}_0x5dd4b6=_[_0x45cb('0x51')]({},_0x5dd4b6,_0x2e87d3[_0x45cb('0x59')]);return _0x1bbe9e[_0x45cb('0x10e')](_0x5dd4b6);}})[_0x45cb('0x22')](function(_0xe94723){if(_0xe94723){_0xe74cf0=_0xe94723[_0x45cb('0x4a')];if(!_0x2e87d3[_0x45cb('0x45')][_0x45cb('0x4b')]('nolimit')){_0x5dd4b6[_0x45cb('0x31')]=qs[_0x45cb('0x31')](_0x2e87d3[_0x45cb('0x45')][_0x45cb('0x31')]);_0x5dd4b6['offset']=qs[_0x45cb('0x30')](_0x2e87d3[_0x45cb('0x45')][_0x45cb('0x30')]);}return _0x1bbe9e[_0x45cb('0x10e')](_0x5dd4b6);}})[_0x45cb('0x22')](function(_0x357f85){if(_0x357f85){return _0x357f85?{'count':_0xe74cf0,'rows':_0x357f85}:null;}})[_0x45cb('0x22')](respondWithResult(_0x26cf4d,null))[_0x45cb('0x2b')](handleError(_0x26cf4d,null));};exports['addProactiveActions']=function(_0x1b7043,_0x3eaacb,_0x49a272){return db[_0x45cb('0x10f')][_0x45cb('0x5a')]({'where':{'id':_0x1b7043[_0x45cb('0x64')]['id']}})['then'](handleEntityNotFound(_0x3eaacb,null))[_0x45cb('0x22')](function(_0x29daad){if(_0x29daad){return _0x29daad[_0x45cb('0x110')](_0x1b7043['body'][_0x45cb('0x6a')],_[_0x45cb('0x111')](_0x1b7043[_0x45cb('0x5c')],[_0x45cb('0x6a'),'id'])||{});}})[_0x45cb('0x22')](respondWithResult(_0x3eaacb,null))[_0x45cb('0x2b')](handleError(_0x3eaacb,null));};exports[_0x45cb('0x112')]=function(_0x655d3c,_0x173a81,_0x1d16ee){var _0x222903={};var _0x426c8a={};var _0x22bd2d;var _0x4fd964;return db[_0x45cb('0x52')][_0x45cb('0x6d')]({'where':{'id':_0x655d3c[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x173a81,null))[_0x45cb('0x22')](function(_0x63998a){if(_0x63998a){_0x22bd2d=_0x63998a;_0x426c8a[_0x45cb('0x43')]=_[_0x45cb('0x58')](db[_0x45cb('0x113')][_0x45cb('0x40')]);_0x426c8a[_0x45cb('0x45')]=_[_0x45cb('0x58')](_0x655d3c[_0x45cb('0x45')]);_0x426c8a['filters']=_[_0x45cb('0x47')](_0x426c8a[_0x45cb('0x43')],_0x426c8a[_0x45cb('0x45')]);_0x222903[_0x45cb('0x48')]=_[_0x45cb('0x47')](_0x426c8a[_0x45cb('0x43')],qs['fields'](_0x655d3c[_0x45cb('0x45')][_0x45cb('0x49')]));_0x222903[_0x45cb('0x48')]=_0x222903[_0x45cb('0x48')][_0x45cb('0x4a')]?_0x222903[_0x45cb('0x48')]:_0x426c8a[_0x45cb('0x43')];_0x222903[_0x45cb('0x68')]=qs[_0x45cb('0x4c')](_0x655d3c[_0x45cb('0x45')][_0x45cb('0x4c')]);_0x222903['where']=qs[_0x45cb('0x46')](_[_0x45cb('0x4e')](_0x655d3c[_0x45cb('0x45')],_0x426c8a[_0x45cb('0x46')]));if(_0x655d3c[_0x45cb('0x45')]['filter']){_0x222903[_0x45cb('0x4d')]=_[_0x45cb('0x51')](_0x222903[_0x45cb('0x4d')],{'$or':_[_0x45cb('0x44')](_0x222903[_0x45cb('0x48')],function(_0x39f65a){var _0x114d29={};_0x114d29[_0x39f65a]={'$like':'%'+_0x655d3c[_0x45cb('0x45')][_0x45cb('0x50')]+'%'};return _0x114d29;})});}_0x222903=_[_0x45cb('0x51')]({},_0x222903,_0x655d3c['options']);return _0x22bd2d['getProactiveActions'](_0x222903);}})[_0x45cb('0x22')](function(_0x443d16){if(_0x443d16){_0x4fd964=_0x443d16['length'];if(!_0x655d3c[_0x45cb('0x45')][_0x45cb('0x4b')](_0x45cb('0x6e'))){_0x222903[_0x45cb('0x31')]=qs['limit'](_0x655d3c[_0x45cb('0x45')]['limit']);_0x222903[_0x45cb('0x30')]=qs[_0x45cb('0x30')](_0x655d3c[_0x45cb('0x45')]['offset']);}return _0x22bd2d[_0x45cb('0x112')](_0x222903);}})['then'](function(_0x167a1a){if(_0x167a1a){return _0x167a1a?{'count':_0x4fd964,'rows':_0x167a1a}:null;}})[_0x45cb('0x22')](respondWithResult(_0x173a81,null))['catch'](handleError(_0x173a81,null));};exports[_0x45cb('0x114')]=function(_0x4bbc32,_0x559b0d,_0x3ad979){var _0x27ec34=_0x4bbc32['query'][_0x45cb('0x115')]===_0x45cb('0x116')?'offlineForm':_0x45cb('0x117');return db['ChatWebsite'][_0x45cb('0x5a')]({'attributes':['id',_0x27ec34],'where':{'id':_0x4bbc32[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x559b0d,null))['then'](function(_0x40a0d7){if(_0x40a0d7){var _0x473067=_0x40a0d7[_0x27ec34];var _0x34cac9=_0x473067&&_0x473067[_0x45cb('0x118')]?_0x473067[_0x45cb('0x118')]:[];_0x559b0d[_0x45cb('0x3c')]({'fromKey':_[_0x45cb('0x7c')](_0x473067[_0x45cb('0x119')])?undefined:_0x473067[_0x45cb('0x119')],'count':_0x34cac9[_0x45cb('0x4a')],'rows':_0x34cac9});}})[_0x45cb('0x2b')](handleError(_0x559b0d,null));};exports['getOfflineMessages']=function(_0x20f76e,_0x3bef35,_0x398240){var _0x1fdd43={'raw':!![],'where':{}};var _0x157d36={};var _0x3ee8c0={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x45cb('0x6d')]({'where':{'id':_0x20f76e[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x3bef35,null))[_0x45cb('0x22')](function(_0x5f023f){if(_0x5f023f){_0x157d36[_0x45cb('0x43')]=_[_0x45cb('0x58')](db[_0x45cb('0xd4')][_0x45cb('0x40')]);_0x157d36[_0x45cb('0x45')]=_[_0x45cb('0x58')](_0x20f76e[_0x45cb('0x45')]);_0x157d36['filters']=_[_0x45cb('0x47')](_0x157d36[_0x45cb('0x43')],_0x157d36[_0x45cb('0x45')]);_0x1fdd43[_0x45cb('0x48')]=_[_0x45cb('0x47')](_0x157d36[_0x45cb('0x43')],qs[_0x45cb('0x49')](_0x20f76e['query'][_0x45cb('0x49')]));_0x1fdd43[_0x45cb('0x48')]=_0x1fdd43[_0x45cb('0x48')][_0x45cb('0x4a')]?_0x1fdd43[_0x45cb('0x48')]:_0x157d36[_0x45cb('0x43')];if(!_0x20f76e[_0x45cb('0x45')][_0x45cb('0x4b')]('nolimit')){_0x1fdd43[_0x45cb('0x31')]=qs[_0x45cb('0x31')](_0x20f76e[_0x45cb('0x45')][_0x45cb('0x31')]);_0x1fdd43[_0x45cb('0x30')]=qs[_0x45cb('0x30')](_0x20f76e[_0x45cb('0x45')][_0x45cb('0x30')]);}_0x1fdd43[_0x45cb('0x68')]=qs[_0x45cb('0x4c')](_0x20f76e['query'][_0x45cb('0x4c')]);_0x1fdd43[_0x45cb('0x4d')]=qs[_0x45cb('0x46')](_[_0x45cb('0x4e')](_0x20f76e[_0x45cb('0x45')],_0x157d36['filters']));_0x1fdd43['where']['ChatWebsiteId']=_0x5f023f['id'];if(_0x20f76e[_0x45cb('0x45')][_0x45cb('0x50')]){_0x1fdd43[_0x45cb('0x4d')]=_[_0x45cb('0x51')](_0x1fdd43[_0x45cb('0x4d')],{'$or':_[_0x45cb('0x44')](_0x1fdd43['attributes'],function(_0x4c77f8){var _0x5f3f05={};_0x5f3f05[_0x4c77f8]={'$like':'%'+_0x20f76e[_0x45cb('0x45')][_0x45cb('0x50')]+'%'};return _0x5f3f05;})});}_0x1fdd43=_['merge']({},_0x1fdd43,_0x20f76e['options']);return db['ChatOfflineMessage']['count']({'where':_0x1fdd43[_0x45cb('0x4d')]})['then'](function(_0x35371b){_0x3ee8c0[_0x45cb('0x2f')]=_0x35371b;if(_0x20f76e[_0x45cb('0x45')]['includeAll']){_0x1fdd43[_0x45cb('0x54')]=[{'all':!![]}];}return db[_0x45cb('0xd4')]['findAll'](_0x1fdd43);})[_0x45cb('0x22')](function(_0x476c14){_0x3ee8c0[_0x45cb('0x56')]=_0x476c14;return _0x3ee8c0;});}})['then'](respondWithFilteredResult(_0x3bef35,_0x1fdd43))['catch'](handleError(_0x3bef35,null));};exports['addAgents']=function(_0x4cd2ee,_0x4869e7,_0xbdc82f){return db[_0x45cb('0x52')]['find']({'where':{'id':_0x4cd2ee[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0x4869e7,null))['then'](function(_0x403f1c){if(_0x403f1c){return _0x403f1c['addAgents'](_0x4cd2ee['body'][_0x45cb('0x6a')],_[_0x45cb('0x111')](_0x4cd2ee[_0x45cb('0x5c')],[_0x45cb('0x6a'),'id'])||{})[_0x45cb('0xb8')](function(_0x1ffdbd){for(var _0x453172=0x0;_0x453172<_0x4cd2ee[_0x45cb('0x5c')][_0x45cb('0x6a')][_0x45cb('0x4a')];_0x453172+=0x1){socket[_0x45cb('0x11a')](_0x45cb('0x11b'),{'UserId':_0x4cd2ee[_0x45cb('0x5c')][_0x45cb('0x6a')][_0x453172],'ChatWebsiteId':_0x4cd2ee[_0x45cb('0x64')]['id']});}return _0x1ffdbd;});}})[_0x45cb('0x22')](respondWithResult(_0x4869e7,null))[_0x45cb('0x2b')](handleError(_0x4869e7,null));};exports['removeAgents']=function(_0x509228,_0x6d2cbc,_0x1cf247){return db[_0x45cb('0x52')][_0x45cb('0x5a')]({'where':{'id':_0x509228['params']['id']}})['then'](handleEntityNotFound(_0x6d2cbc,null))[_0x45cb('0x22')](function(_0x429556){if(_0x429556){return _0x429556['removeAgents'](_0x509228[_0x45cb('0x45')][_0x45cb('0x6a')])[_0x45cb('0x22')](function(){if(_[_0x45cb('0x11c')](_0x509228[_0x45cb('0x45')][_0x45cb('0x6a')])){for(var _0x32be5f=0x0;_0x32be5f<_0x509228[_0x45cb('0x45')][_0x45cb('0x6a')][_0x45cb('0x4a')];_0x32be5f+=0x1){socket[_0x45cb('0x11a')](_0x45cb('0x11d'),{'UserId':Number(_0x509228[_0x45cb('0x45')][_0x45cb('0x6a')][_0x32be5f]),'ChatWebsiteId':Number(_0x509228['params']['id'])});}}else{socket[_0x45cb('0x11a')](_0x45cb('0x11d'),{'UserId':Number(_0x509228['query'][_0x45cb('0x6a')]),'ChatWebsiteId':Number(_0x509228[_0x45cb('0x64')]['id'])});}});}})[_0x45cb('0x22')](respondWithStatusCode(_0x6d2cbc,null))['catch'](handleError(_0x6d2cbc,null));};exports[_0x45cb('0x11e')]=function(_0x42a2df,_0xe9dc4,_0x1423df){var _0x365a29={};var _0x4d72ab={};var _0x44bd5d;var _0x1e2339;return db[_0x45cb('0x52')][_0x45cb('0x6d')]({'where':{'id':_0x42a2df[_0x45cb('0x64')]['id']}})[_0x45cb('0x22')](handleEntityNotFound(_0xe9dc4,null))[_0x45cb('0x22')](function(_0x4d262c){if(_0x4d262c){_0x44bd5d=_0x4d262c;_0x4d72ab[_0x45cb('0x43')]=_['keys'](db[_0x45cb('0xe6')][_0x45cb('0x40')]);_0x4d72ab['query']=_[_0x45cb('0x58')](_0x42a2df[_0x45cb('0x45')]);_0x4d72ab[_0x45cb('0x46')]=_[_0x45cb('0x47')](_0x4d72ab['model'],_0x4d72ab[_0x45cb('0x45')]);_0x365a29[_0x45cb('0x48')]=_[_0x45cb('0x47')](_0x4d72ab[_0x45cb('0x43')],qs[_0x45cb('0x49')](_0x42a2df[_0x45cb('0x45')][_0x45cb('0x49')]));_0x365a29['attributes']=_0x365a29[_0x45cb('0x48')][_0x45cb('0x4a')]?_0x365a29['attributes']:_0x4d72ab[_0x45cb('0x43')];_0x365a29[_0x45cb('0x68')]=qs[_0x45cb('0x4c')](_0x42a2df[_0x45cb('0x45')][_0x45cb('0x4c')]);_0x365a29['where']=qs['filters'](_['pick'](_0x42a2df[_0x45cb('0x45')],_0x4d72ab['filters']));if(_0x42a2df[_0x45cb('0x45')][_0x45cb('0x50')]){_0x365a29[_0x45cb('0x4d')]=_[_0x45cb('0x51')](_0x365a29[_0x45cb('0x4d')],{'$or':_[_0x45cb('0x44')](_0x365a29[_0x45cb('0x48')],function(_0xdbafe4){var _0x1ab6fa={};_0x1ab6fa[_0xdbafe4]={'$like':'%'+_0x42a2df['query'][_0x45cb('0x50')]+'%'};return _0x1ab6fa;})});}_0x365a29=_[_0x45cb('0x51')]({},_0x365a29,_0x42a2df['options']);return _0x44bd5d[_0x45cb('0x11e')](_0x365a29);}})[_0x45cb('0x22')](function(_0x349075){if(_0x349075){_0x1e2339=_0x349075[_0x45cb('0x4a')];if(!_0x42a2df[_0x45cb('0x45')][_0x45cb('0x4b')](_0x45cb('0x6e'))){_0x365a29[_0x45cb('0x31')]=qs[_0x45cb('0x31')](_0x42a2df[_0x45cb('0x45')][_0x45cb('0x31')]);_0x365a29[_0x45cb('0x30')]=qs['offset'](_0x42a2df['query']['offset']);}return _0x44bd5d[_0x45cb('0x11e')](_0x365a29);}})[_0x45cb('0x22')](function(_0x175161){if(_0x175161){return _0x175161?{'count':_0x1e2339,'rows':_0x175161}:null;}})['then'](respondWithResult(_0xe9dc4,null))['catch'](handleError(_0xe9dc4,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 2594d1a..6830271 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 _0x3de2=['exports','events','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x3de2,0x79));var _0x23de=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x3de2[_0x3c8e9a];return _0x2d4c57;};'use strict';var EventEmitter=require(_0x23de('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x23de('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x23de('0x2')](0x0);var events={'afterCreate':_0x23de('0x3'),'afterUpdate':_0x23de('0x4'),'afterDestroy':'remove'};function emitEvent(_0x523818){return function(_0x13f461,_0x408e6a,_0x211040){ChatWebsiteEvents[_0x23de('0x5')](_0x523818+':'+_0x13f461['id'],_0x13f461);ChatWebsiteEvents['emit'](_0x523818,_0x13f461);_0x211040(null);};}for(var e in events){if(events[_0x23de('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x23de('0x7')]=ChatWebsiteEvents; \ No newline at end of file +var _0x64f0=['emit','hasOwnProperty','events','setMaxListeners','save','update'];(function(_0xaf8f29,_0x5754cf){var _0x391fed=function(_0x322809){while(--_0x322809){_0xaf8f29['push'](_0xaf8f29['shift']());}};_0x391fed(++_0x5754cf);}(_0x64f0,0x1a0));var _0x064f=function(_0x102ff9,_0x907658){_0x102ff9=_0x102ff9-0x0;var _0x24fa97=_0x64f0[_0x102ff9];return _0x24fa97;};'use strict';var EventEmitter=require(_0x064f('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x064f('0x1')](0x0);var events={'afterCreate':_0x064f('0x2'),'afterUpdate':_0x064f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x304ece){return function(_0x3a730c,_0x5f5391,_0x1e6f40){ChatWebsiteEvents[_0x064f('0x4')](_0x304ece+':'+_0x3a730c['id'],_0x3a730c);ChatWebsiteEvents['emit'](_0x304ece,_0x3a730c);_0x1e6f40(null);};}for(var e in events){if(events[_0x064f('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 7452e44..53ff4d3 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 _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ChatWebsite',attributes,{'tableName':_0xeb62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc03=['./chatWebsite.attributes','exports','define','chat_websites','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x4192ad,_0x488f5c){var _0x415dc3=function(_0x288ed5){while(--_0x288ed5){_0x4192ad['push'](_0x4192ad['shift']());}};_0x415dc3(++_0x488f5c);}(_0xfc03,0x16f));var _0x3fc0=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xfc03[_0x368fb9];return _0x4892fb;};'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')]('ChatWebsite',attributes,{'tableName':_0x3fc0('0xa'),'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 8455d4d..4003e33 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 _0x47c5=['ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x2b636b,_0xe5406d){var _0x23ac77=function(_0x52ddb6){while(--_0x52ddb6){_0x2b636b['push'](_0x2b636b['shift']());}};_0x23ac77(++_0xe5406d);}(_0x47c5,0x165));var _0x547c=function(_0x1657b6,_0x5b8def){_0x1657b6=_0x1657b6-0x0;var _0x2fdb3c=_0x47c5[_0x1657b6];return _0x2fdb3c;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});config[_0x547c('0xb')]=_[_0x547c('0xc')](config[_0x547c('0xb')],{'host':_0x547c('0xd'),'port':0x18eb});var socket=require(_0x547c('0xe'))(new Redis(config[_0x547c('0xb')]));require(_0x547c('0xf'))[_0x547c('0x10')](socket);function respondWithRpcPromise(_0x44a581,_0x72828d,_0x2c54e){return new BPromise(function(_0x111457,_0x2455e9){return client[_0x547c('0x11')](_0x44a581,_0x2c54e)[_0x547c('0x12')](function(_0x44ab17){logger['info'](_0x547c('0x13'),_0x72828d,_0x547c('0x14'));logger['debug'](_0x547c('0x15'),_0x72828d,_0x547c('0x14'),JSON[_0x547c('0x16')](_0x44ab17));if(_0x44ab17[_0x547c('0x17')]){if(_0x44ab17[_0x547c('0x17')][_0x547c('0x18')]===0x1f4){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x2455e9(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x111457(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x72828d,_0x547c('0x14'));_0x111457(_0x44ab17[_0x547c('0x1a')][_0x547c('0x19')]);}})['catch'](function(_0x248aca){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x248aca);_0x2455e9(_0x248aca);});});} \ No newline at end of file +var _0x5f2f=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x331eca,_0x54a7d1){var _0x38beec=function(_0x576633){while(--_0x576633){_0x331eca['push'](_0x331eca['shift']());}};_0x38beec(++_0x54a7d1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4116ae,_0x4a45a4){_0x4116ae=_0x4116ae-0x0;var _0x585db7=_0x5f2f[_0x4116ae];return _0x585db7;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./chatWebsite.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index fcab2d6..3c7e6ad 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5a2436,_0x11375a){var _0x2d8468=function(_0x5b77b9){while(--_0x5b77b9){_0x5a2436['push'](_0x5a2436['shift']());}};_0x2d8468(++_0x11375a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2b98aa,_0x4b893f){_0x2b98aa=_0x2b98aa-0x0;var _0x4a9028=_0x5f2f[_0x2b98aa];return _0x4a9028;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x3767fb,_0x3b917c){var _0x9bd1b9=function(_0x37d2ba){while(--_0x37d2ba){_0x3767fb['push'](_0x3767fb['shift']());}};_0x9bd1b9(++_0x3b917c);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4f0e5b,_0x1a5bce){_0x4f0e5b=_0x4f0e5b-0x0;var _0x4dad9d=_0x5f2f[_0x4f0e5b];return _0x4dad9d;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 32133e0..303fd3a 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 _0x3405=['/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show'];(function(_0x15fcbb,_0x3430de){var _0x7b1037=function(_0x2adff0){while(--_0x2adff0){_0x15fcbb['push'](_0x15fcbb['shift']());}};_0x7b1037(++_0x3430de);}(_0x3405,0x142));var _0x5340=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x3405[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x5340('0x0'));var util=require(_0x5340('0x1'));var path=require(_0x5340('0x2'));var timeout=require(_0x5340('0x3'));var express=require('express');var router=express[_0x5340('0x4')]();var auth=require(_0x5340('0x5'));var interaction=require(_0x5340('0x6'));var config=require(_0x5340('0x7'));var controller=require('./chatWebsite.controller');router[_0x5340('0x8')]('/',auth[_0x5340('0x9')](),controller['index']);router[_0x5340('0x8')](_0x5340('0xa'),auth['isAuthenticated'](),controller[_0x5340('0xb')]);router['get']('/:id',auth[_0x5340('0x9')](),controller[_0x5340('0xc')]);router['get'](_0x5340('0xd'),auth[_0x5340('0x9')](),controller[_0x5340('0xe')]);router[_0x5340('0x8')]('/:id/canned_answers',auth[_0x5340('0x9')](),controller[_0x5340('0xf')]);router[_0x5340('0x8')](_0x5340('0x10'),controller[_0x5340('0x11')]);router['get'](_0x5340('0x12'),controller[_0x5340('0x13')]);router[_0x5340('0x8')](_0x5340('0x14'),controller['getCustomerAvatar']);router[_0x5340('0x8')]('/:id/system_avatar',controller[_0x5340('0x15')]);router[_0x5340('0x8')](_0x5340('0x16'),auth[_0x5340('0x9')](),controller[_0x5340('0x17')]);router['get'](_0x5340('0x18'),controller[_0x5340('0x19')]);router['get'](_0x5340('0x1a'),auth[_0x5340('0x9')](),controller[_0x5340('0x1b')]);router[_0x5340('0x8')](_0x5340('0x1c'),auth[_0x5340('0x9')](),controller[_0x5340('0x1d')]);router[_0x5340('0x8')](_0x5340('0x1e'),controller[_0x5340('0x1f')]);router['get'](_0x5340('0x20'),auth[_0x5340('0x9')](),controller['getOfflineMessages']);router[_0x5340('0x8')](_0x5340('0x21'),auth[_0x5340('0x9')](),controller[_0x5340('0x22')]);router['post']('/',auth[_0x5340('0x9')](),controller[_0x5340('0x23')]);router[_0x5340('0x24')](_0x5340('0xd'),auth[_0x5340('0x9')](),controller[_0x5340('0x25')]);router[_0x5340('0x24')](_0x5340('0x26'),auth['isAuthenticated'](),controller[_0x5340('0x27')]);var upload=multer({'storage':multer[_0x5340('0x28')]({'destination':function(_0x4cc1df,_0x5ac873,_0x5a69bb){_0x5a69bb(null,path[_0x5340('0x29')](config[_0x5340('0x2a')],_0x5340('0x2b')));},'filename':function(_0x3d6a01,_0x220fd6,_0x5a6188){_0x5a6188(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date[_0x5340('0x2e')](),_0x220fd6[_0x5340('0x2f')]));}})});router[_0x5340('0x24')]('/:id/logo',upload[_0x5340('0x30')](_0x5340('0x31')),controller[_0x5340('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5860f9,_0x46d1ee,_0x38f064){_0x38f064(null,path[_0x5340('0x29')](config[_0x5340('0x2a')],_0x5340('0x33')));},'filename':function(_0x546b46,_0x39f3fe,_0x2676a5){_0x2676a5(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date[_0x5340('0x2e')](),_0x39f3fe[_0x5340('0x2f')]));}})});router['post'](_0x5340('0x12'),upload[_0x5340('0x30')](_0x5340('0x31')),controller[_0x5340('0x34')]);var upload=multer({'storage':multer[_0x5340('0x28')]({'destination':function(_0x18a783,_0x31df57,_0x5f546f){_0x5f546f(null,path['join'](config[_0x5340('0x2a')],_0x5340('0x33')));},'filename':function(_0x53af8b,_0x4daa14,_0x593990){_0x593990(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date[_0x5340('0x2e')](),_0x4daa14[_0x5340('0x2f')]));}})});router[_0x5340('0x24')]('/:id/customer_avatar',upload['single'](_0x5340('0x31')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x23d017,_0x66ecf1,_0x5be408){_0x5be408(null,path[_0x5340('0x29')](config[_0x5340('0x2a')],_0x5340('0x33')));},'filename':function(_0x2d7381,_0xab3555,_0x2a0531){_0x2a0531(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date['now'](),_0xab3555[_0x5340('0x2f')]));}})});router[_0x5340('0x24')]('/:id/system_avatar',upload['single'](_0x5340('0x31')),controller[_0x5340('0x35')]);router[_0x5340('0x24')](_0x5340('0x36'),controller[_0x5340('0x37')]);router[_0x5340('0x24')](_0x5340('0x38'),controller['offline']);router[_0x5340('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5340('0x39')]);router[_0x5340('0x24')](_0x5340('0x1a'),auth[_0x5340('0x9')](),controller[_0x5340('0x3a')]);router[_0x5340('0x24')](_0x5340('0x1c'),auth['isAuthenticated'](),controller[_0x5340('0x3b')]);router['post'](_0x5340('0x21'),auth[_0x5340('0x9')](),controller[_0x5340('0x3c')]);router[_0x5340('0x3d')](_0x5340('0x3e'),auth[_0x5340('0x9')](),controller['update']);router[_0x5340('0x3f')](_0x5340('0x3e'),auth[_0x5340('0x9')](),controller[_0x5340('0x40')]);router[_0x5340('0x3f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5340('0x41')]);router['delete'](_0x5340('0x26'),auth[_0x5340('0x9')](),controller[_0x5340('0x42')]);router[_0x5340('0x3f')](_0x5340('0x21'),auth[_0x5340('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0xac18=['post','create','addDisposition','addAnswer','diskStorage','root','server/files/images/logos/','format','originalname','single','file','addLogo','join','server/files/images/avatars/','%s-%s','now','/:id/notify','notify','/:id/offline','offline','addInteraction','addApplications','addAgents','put','update','delete','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','path','connect-timeout','../../config/environment','./chatWebsite.controller','index','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages','/:id/users'];(function(_0x3a55c6,_0x19ace8){var _0x547dd0=function(_0x2b4b9b){while(--_0x2b4b9b){_0x3a55c6['push'](_0x3a55c6['shift']());}};_0x547dd0(++_0x19ace8);}(_0xac18,0x1b4));var _0x8ac1=function(_0x376167,_0x33fa92){_0x376167=_0x376167-0x0;var _0x3e3bd0=_0xac18[_0x376167];return _0x3e3bd0;};'use strict';var multer=require('multer');var util=require(_0x8ac1('0x0'));var path=require(_0x8ac1('0x1'));var timeout=require(_0x8ac1('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8ac1('0x3'));var controller=require(_0x8ac1('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x8ac1('0x5')]);router['get']('/describe',auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x7')]);router[_0x8ac1('0x8')](_0x8ac1('0x9'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0xa')]);router[_0x8ac1('0x8')](_0x8ac1('0xb'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0xc')]);router[_0x8ac1('0x8')]('/:id/canned_answers',auth[_0x8ac1('0x6')](),controller[_0x8ac1('0xd')]);router[_0x8ac1('0x8')](_0x8ac1('0xe'),controller['getLogo']);router[_0x8ac1('0x8')](_0x8ac1('0xf'),controller[_0x8ac1('0x10')]);router[_0x8ac1('0x8')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x8ac1('0x8')](_0x8ac1('0x11'),controller[_0x8ac1('0x12')]);router[_0x8ac1('0x8')](_0x8ac1('0x13'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x14')]);router[_0x8ac1('0x8')]('/:id/snippet',controller[_0x8ac1('0x15')]);router[_0x8ac1('0x8')](_0x8ac1('0x16'),auth['isAuthenticated'](),controller[_0x8ac1('0x17')]);router[_0x8ac1('0x8')](_0x8ac1('0x18'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0x8ac1('0x19')]);router[_0x8ac1('0x8')](_0x8ac1('0x1a'),auth[_0x8ac1('0x6')](),controller['getOfflineMessages']);router[_0x8ac1('0x8')](_0x8ac1('0x1b'),auth[_0x8ac1('0x6')](),controller['getAgents']);router[_0x8ac1('0x1c')]('/',auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x1d')]);router[_0x8ac1('0x1c')](_0x8ac1('0xb'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x1e')]);router[_0x8ac1('0x1c')]('/:id/canned_answers',auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x1f')]);var upload=multer({'storage':multer[_0x8ac1('0x20')]({'destination':function(_0x1e3b9e,_0x25d926,_0xd24c5e){_0xd24c5e(null,path['join'](config[_0x8ac1('0x21')],_0x8ac1('0x22')));},'filename':function(_0x53d7ed,_0x5361e5,_0xecbebc){_0xecbebc(null,util[_0x8ac1('0x23')]('%s-%s',Date['now'](),_0x5361e5[_0x8ac1('0x24')]));}})});router[_0x8ac1('0x1c')](_0x8ac1('0xe'),upload[_0x8ac1('0x25')](_0x8ac1('0x26')),controller[_0x8ac1('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c444a,_0x9b24b0,_0x10790d){_0x10790d(null,path[_0x8ac1('0x28')](config[_0x8ac1('0x21')],_0x8ac1('0x29')));},'filename':function(_0x9927c0,_0x173447,_0x31523c){_0x31523c(null,util['format']('%s-%s',Date['now'](),_0x173447[_0x8ac1('0x24')]));}})});router[_0x8ac1('0x1c')](_0x8ac1('0xf'),upload[_0x8ac1('0x25')](_0x8ac1('0x26')),controller['addAvatar']);var upload=multer({'storage':multer[_0x8ac1('0x20')]({'destination':function(_0x242715,_0x1bcee4,_0x2a7c9c){_0x2a7c9c(null,path[_0x8ac1('0x28')](config[_0x8ac1('0x21')],_0x8ac1('0x29')));},'filename':function(_0x5507a5,_0x1f8b9e,_0x3493de){_0x3493de(null,util[_0x8ac1('0x23')](_0x8ac1('0x2a'),Date[_0x8ac1('0x2b')](),_0x1f8b9e[_0x8ac1('0x24')]));}})});router[_0x8ac1('0x1c')]('/:id/customer_avatar',upload['single'](_0x8ac1('0x26')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x8ac1('0x20')]({'destination':function(_0xc70888,_0x528e9f,_0x4bc1f6){_0x4bc1f6(null,path[_0x8ac1('0x28')](config[_0x8ac1('0x21')],_0x8ac1('0x29')));},'filename':function(_0x4d730f,_0x31594b,_0xa8e2c6){_0xa8e2c6(null,util[_0x8ac1('0x23')](_0x8ac1('0x2a'),Date['now'](),_0x31594b[_0x8ac1('0x24')]));}})});router['post'](_0x8ac1('0x11'),upload[_0x8ac1('0x25')](_0x8ac1('0x26')),controller['addSystemAvatar']);router[_0x8ac1('0x1c')](_0x8ac1('0x2c'),controller[_0x8ac1('0x2d')]);router[_0x8ac1('0x1c')](_0x8ac1('0x2e'),controller[_0x8ac1('0x2f')]);router[_0x8ac1('0x1c')](_0x8ac1('0x13'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x30')]);router['post'](_0x8ac1('0x16'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x31')]);router[_0x8ac1('0x1c')](_0x8ac1('0x18'),auth[_0x8ac1('0x6')](),controller['addProactiveActions']);router[_0x8ac1('0x1c')]('/:id/users',auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x32')]);router[_0x8ac1('0x33')](_0x8ac1('0x9'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x34')]);router['delete'](_0x8ac1('0x9'),auth[_0x8ac1('0x6')](),controller['destroy']);router[_0x8ac1('0x35')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8ac1('0x36')]);router['delete'](_0x8ac1('0x37'),auth['isAuthenticated'](),controller[_0x8ac1('0x38')]);router[_0x8ac1('0x35')](_0x8ac1('0x1b'),auth[_0x8ac1('0x6')](),controller[_0x8ac1('0x39')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index d9495df..9ce28de 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 _0x481a=['exports','name','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x481a,0xf7));var _0xa481=function(_0x2fc5a5,_0x528e48){_0x2fc5a5=_0x2fc5a5-0x0;var _0x5f0cbd=_0x481a[_0x2fc5a5];return _0x5f0cbd;};'use strict';var Sequelize=require(_0xa481('0x0'));module[_0xa481('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa481('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa481('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa481('0x3')]},'street':{'type':Sequelize[_0xa481('0x3')]},'postalCode':{'type':Sequelize[_0xa481('0x3')]},'city':{'type':Sequelize[_0xa481('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa481('0x3')]},'sStreet':{'type':Sequelize[_0xa481('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa481('0x3')]},'sCountry':{'type':Sequelize[_0xa481('0x3')]},'description':{'type':Sequelize[_0xa481('0x3')]}}; \ No newline at end of file +var _0xbbc1=['STRING','name','sequelize'];(function(_0x307f13,_0x27e474){var _0x28eab2=function(_0x427d1d){while(--_0x427d1d){_0x307f13['push'](_0x307f13['shift']());}};_0x28eab2(++_0x27e474);}(_0xbbc1,0x7d));var _0x1bbc=function(_0x2e7698,_0x2d1bb8){_0x2e7698=_0x2e7698-0x0;var _0x438792=_0xbbc1[_0x2e7698];return _0x438792;};'use strict';var Sequelize=require(_0x1bbc('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bbc('0x1')],'unique':_0x1bbc('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x1bbc('0x1')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x1bbc('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1bbc('0x1')]},'street':{'type':Sequelize[_0x1bbc('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x1bbc('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x1bbc('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x1bbc('0x1')]},'sPostalCode':{'type':Sequelize[_0x1bbc('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1bbc('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 40bee01..f9c5127 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 _0x1947=['show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','reject','update','then','get','destroy','sendStatus','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','filter','merge','options','count','includeAll','include','catch'];(function(_0x3f9d1c,_0x1b71a1){var _0x333bb6=function(_0x4ecabc){while(--_0x4ecabc){_0x3f9d1c['push'](_0x3f9d1c['shift']());}};_0x333bb6(++_0x1b71a1);}(_0x1947,0x111));var _0x7194=function(_0x2f1101,_0x2c8de3){_0x2f1101=_0x2f1101-0x0;var _0x2e1ff8=_0x1947[_0x2f1101];return _0x2e1ff8;};'use strict';var pdf=require(_0x7194('0x0'));var emlformat=require(_0x7194('0x1'));var rimraf=require(_0x7194('0x2'));var zipdir=require(_0x7194('0x3'));var jsonpatch=require(_0x7194('0x4'));var rp=require(_0x7194('0x5'));var moment=require(_0x7194('0x6'));var BPromise=require(_0x7194('0x7'));var Mustache=require(_0x7194('0x8'));var util=require(_0x7194('0x9'));var path=require(_0x7194('0xa'));var sox=require(_0x7194('0xb'));var csv=require(_0x7194('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7194('0xd'));var jsforce=require(_0x7194('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7194('0xf'));var Papa=require(_0x7194('0x10'));var Redis=require('ioredis');var authService=require(_0x7194('0x11'));var qs=require(_0x7194('0x12'));var as=require(_0x7194('0x13'));var hardwareService=require(_0x7194('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7194('0x15'));var db=require(_0x7194('0x16'))['db'];function respondWithStatusCode(_0x20f56d,_0x28b384){_0x28b384=_0x28b384||0xcc;return function(_0x908ef0){if(_0x908ef0){return _0x20f56d['sendStatus'](_0x28b384);}return _0x20f56d['status'](_0x28b384)[_0x7194('0x17')]();};}function respondWithResult(_0x59c930,_0x5c1886){_0x5c1886=_0x5c1886||0xc8;return function(_0x5c9ede){if(_0x5c9ede){return _0x59c930[_0x7194('0x18')](_0x5c1886)[_0x7194('0x19')](_0x5c9ede);}};}function respondWithFilteredResult(_0x4f7487,_0x4c0e22){return function(_0x768079){if(_0x768079){var _0x299f1b=_0x768079['count'],_0x84768f=_0x4c0e22['offset'],_0x2cf4df=_0x4c0e22[_0x7194('0x1a')]+_0x4c0e22[_0x7194('0x1b')],_0x519720;if(_0x2cf4df>=_0x299f1b){_0x2cf4df=_0x299f1b;_0x519720=0xc8;}else{_0x519720=0xce;}_0x4f7487['status'](_0x519720);return _0x4f7487[_0x7194('0x1c')](_0x7194('0x1d'),_0x84768f+'-'+_0x2cf4df+'/'+_0x299f1b)[_0x7194('0x19')](_0x768079);}return null;};}function patchUpdates(_0x1ebe83){return function(_0x35fe5f){try{jsonpatch[_0x7194('0x1e')](_0x35fe5f,_0x1ebe83,!![]);}catch(_0x3c5f0a){return BPromise[_0x7194('0x1f')](_0x3c5f0a);}return _0x35fe5f['save']();};}function saveUpdates(_0x2bc232,_0x3669b4){return function(_0x419896){if(_0x419896){return _0x419896[_0x7194('0x20')](_0x2bc232)[_0x7194('0x21')](function(_0x212d98){return _0x212d98;});}return null;};}function removeEntity(_0x2b42c0,_0x520abf){return function(_0x5b75a1){if(_0x5b75a1){return _0x5b75a1['destroy']()[_0x7194('0x21')](function(){var _0x5f28c0=_0x5b75a1[_0x7194('0x22')]({'plain':!![]});var _0x2ddd91='Companies';return db['UserProfileResource'][_0x7194('0x23')]({'where':{'type':_0x2ddd91,'resourceId':_0x5f28c0['id']}})[_0x7194('0x21')](function(){return _0x5b75a1;});})['then'](function(){_0x2b42c0[_0x7194('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27930b,_0x50d977){return function(_0x32a6c5){if(!_0x32a6c5){_0x27930b[_0x7194('0x24')](0x194);}return _0x32a6c5;};}function handleError(_0x5e5458,_0x3498e7){_0x3498e7=_0x3498e7||0x1f4;return function(_0x156e33){logger[_0x7194('0x25')](_0x156e33[_0x7194('0x26')]);if(_0x156e33[_0x7194('0x27')]){delete _0x156e33[_0x7194('0x27')];}_0x5e5458['status'](_0x3498e7)[_0x7194('0x28')](_0x156e33);};}exports[_0x7194('0x29')]=function(_0x1f6fc6,_0x2be936){var _0x27484d={},_0x5a0e4d={},_0x4ef9db={'count':0x0,'rows':[]};return db[_0x7194('0x2a')]['describe']()[_0x7194('0x21')](function(_0x17734d){_0x5a0e4d[_0x7194('0x2b')]=_[_0x7194('0x2c')](_0x17734d);_0x5a0e4d[_0x7194('0x2d')]=_[_0x7194('0x2c')](_0x1f6fc6[_0x7194('0x2d')]);_0x5a0e4d[_0x7194('0x2e')]=_[_0x7194('0x2f')](_0x5a0e4d[_0x7194('0x2b')],_0x5a0e4d[_0x7194('0x2d')]);_0x27484d[_0x7194('0x30')]=_['intersection'](_0x5a0e4d[_0x7194('0x2b')],qs['fields'](_0x1f6fc6['query'][_0x7194('0x31')]));_0x27484d[_0x7194('0x30')]=_0x27484d[_0x7194('0x30')]['length']?_0x27484d['attributes']:_0x5a0e4d[_0x7194('0x2b')];if(!_0x1f6fc6[_0x7194('0x2d')][_0x7194('0x32')](_0x7194('0x33'))){_0x27484d[_0x7194('0x1b')]=qs[_0x7194('0x1b')](_0x1f6fc6['query'][_0x7194('0x1b')]);_0x27484d['offset']=qs[_0x7194('0x1a')](_0x1f6fc6[_0x7194('0x2d')][_0x7194('0x1a')]);}_0x27484d[_0x7194('0x34')]=qs[_0x7194('0x35')](_0x1f6fc6['query'][_0x7194('0x35')]);_0x27484d['where']=qs[_0x7194('0x2e')](_['pick'](_0x1f6fc6['query'],_0x5a0e4d['filters']));if(_0x1f6fc6[_0x7194('0x2d')]['filter']){_0x27484d[_0x7194('0x36')]=_['merge'](_0x27484d[_0x7194('0x36')],{'$or':_[_0x7194('0x37')](_0x27484d[_0x7194('0x30')],function(_0x3c795b){var _0x1684a4={};_0x1684a4[_0x3c795b]={'$like':'%'+_0x1f6fc6[_0x7194('0x2d')][_0x7194('0x38')]+'%'};return _0x1684a4;})});}_0x27484d=_[_0x7194('0x39')]({},_0x27484d,_0x1f6fc6[_0x7194('0x3a')]);var _0x3ebd37={'where':_0x27484d[_0x7194('0x36')]};return db['CmCompany'][_0x7194('0x3b')](_0x3ebd37)['then'](function(_0x4b8cd8){_0x4ef9db[_0x7194('0x3b')]=_0x4b8cd8;if(_0x1f6fc6['query'][_0x7194('0x3c')]){_0x27484d[_0x7194('0x3d')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x27484d);})[_0x7194('0x21')](function(_0x5b0748){_0x4ef9db['rows']=_0x5b0748;return _0x4ef9db;})[_0x7194('0x21')](respondWithFilteredResult(_0x2be936,_0x27484d))[_0x7194('0x3e')](handleError(_0x2be936,null));})['catch'](handleError(_0x2be936,null));};exports[_0x7194('0x3f')]=function(_0x5ee433,_0x20767e){var _0x5f57c0={'raw':![],'where':{'id':_0x5ee433[_0x7194('0x40')]['id']}},_0x3d7152={};_0x3d7152[_0x7194('0x2b')]=_['keys'](db[_0x7194('0x2a')][_0x7194('0x41')]);_0x3d7152['query']=_[_0x7194('0x2c')](_0x5ee433[_0x7194('0x2d')]);_0x3d7152[_0x7194('0x2e')]=_[_0x7194('0x2f')](_0x3d7152[_0x7194('0x2b')],_0x3d7152[_0x7194('0x2d')]);_0x5f57c0[_0x7194('0x30')]=_[_0x7194('0x2f')](_0x3d7152[_0x7194('0x2b')],qs[_0x7194('0x31')](_0x5ee433[_0x7194('0x2d')][_0x7194('0x31')]));_0x5f57c0[_0x7194('0x30')]=_0x5f57c0[_0x7194('0x30')][_0x7194('0x42')]?_0x5f57c0[_0x7194('0x30')]:_0x3d7152[_0x7194('0x2b')];if(_0x5ee433['query']['includeAll']){_0x5f57c0[_0x7194('0x3d')]=[{'all':!![]}];}_0x5f57c0=_[_0x7194('0x39')]({},_0x5f57c0,_0x5ee433[_0x7194('0x3a')]);return db[_0x7194('0x2a')][_0x7194('0x43')](_0x5f57c0)[_0x7194('0x21')](handleEntityNotFound(_0x20767e,null))[_0x7194('0x21')](respondWithResult(_0x20767e,null))['catch'](handleError(_0x20767e,null));};exports[_0x7194('0x44')]=function(_0x3c08eb,_0x341cfa){return db['CmCompany'][_0x7194('0x44')](_0x3c08eb[_0x7194('0x45')],{})[_0x7194('0x21')](function(_0x1c36e2){var _0x524524=_0x3c08eb[_0x7194('0x46')][_0x7194('0x22')]({'plain':!![]});if(!_0x524524)throw new Error(_0x7194('0x47'));if(_0x524524[_0x7194('0x48')]===_0x7194('0x46')){var _0x3093d6=_0x1c36e2[_0x7194('0x22')]({'plain':!![]});var _0x4e48b9=_0x7194('0x49');return db[_0x7194('0x4a')][_0x7194('0x43')]({'where':{'name':_0x4e48b9,'userProfileId':_0x524524[_0x7194('0x4b')]},'raw':!![]})[_0x7194('0x21')](function(_0x39e893){if(_0x39e893&&_0x39e893[_0x7194('0x4c')]===0x0){return db[_0x7194('0x4d')][_0x7194('0x44')]({'name':_0x3093d6[_0x7194('0x27')],'resourceId':_0x3093d6['id'],'type':_0x39e893[_0x7194('0x27')],'sectionId':_0x39e893['id']},{})[_0x7194('0x21')](function(){return _0x1c36e2;});}else{return _0x1c36e2;}})[_0x7194('0x3e')](function(_0x175c9f){logger[_0x7194('0x25')](_0x7194('0x4e'),_0x175c9f);throw _0x175c9f;});}return _0x1c36e2;})[_0x7194('0x21')](respondWithResult(_0x341cfa,0xc9))[_0x7194('0x3e')](handleError(_0x341cfa,null));};exports[_0x7194('0x20')]=function(_0x5d3f05,_0xf921de){if(_0x5d3f05[_0x7194('0x45')]['id']){delete _0x5d3f05['body']['id'];}return db[_0x7194('0x2a')][_0x7194('0x43')]({'where':{'id':_0x5d3f05[_0x7194('0x40')]['id']}})[_0x7194('0x21')](handleEntityNotFound(_0xf921de,null))[_0x7194('0x21')](saveUpdates(_0x5d3f05[_0x7194('0x45')],null))[_0x7194('0x21')](respondWithResult(_0xf921de,null))[_0x7194('0x3e')](handleError(_0xf921de,null));};exports[_0x7194('0x23')]=function(_0x49bda7,_0x3709f9){return db[_0x7194('0x2a')][_0x7194('0x43')]({'where':{'id':_0x49bda7[_0x7194('0x40')]['id']}})[_0x7194('0x21')](handleEntityNotFound(_0x3709f9,null))[_0x7194('0x21')](removeEntity(_0x3709f9,null))[_0x7194('0x3e')](handleError(_0x3709f9,null));};exports[_0x7194('0x4f')]=function(_0x45b02e,_0x11260f){return db[_0x7194('0x2a')]['describe']()[_0x7194('0x21')](respondWithResult(_0x11260f,null))[_0x7194('0x3e')](handleError(_0x11260f,null));};exports[_0x7194('0x50')]=function(_0x25ab19,_0x4b1b7d,_0x35aadc){return db[_0x7194('0x51')]['find']({'where':{'id':_0x25ab19['params']['id']}})[_0x7194('0x21')](handleEntityNotFound(_0x4b1b7d,null))['then'](function(_0xffb9b2){if(_0xffb9b2){return _0xffb9b2[_0x7194('0x50')](_0x25ab19[_0x7194('0x45')][_0x7194('0x52')],_['omit'](_0x25ab19[_0x7194('0x45')],['ids','id'])||{});}})['then'](respondWithResult(_0x4b1b7d,null))[_0x7194('0x3e')](handleError(_0x4b1b7d,null));};exports[_0x7194('0x53')]=function(_0xd6e34c,_0x32f7ad,_0x4894bf){var _0x500ec3={};var _0x101245={};var _0xe2d11f;var _0x539e33;return db[_0x7194('0x2a')]['findOne']({'where':{'id':_0xd6e34c['params']['id']}})['then'](handleEntityNotFound(_0x32f7ad,null))[_0x7194('0x21')](function(_0x43fa68){if(_0x43fa68){_0xe2d11f=_0x43fa68;_0x101245[_0x7194('0x2b')]=_[_0x7194('0x2c')](db[_0x7194('0x51')][_0x7194('0x41')]);_0x101245['query']=_[_0x7194('0x2c')](_0xd6e34c[_0x7194('0x2d')]);_0x101245[_0x7194('0x2e')]=_['intersection'](_0x101245[_0x7194('0x2b')],_0x101245[_0x7194('0x2d')]);_0x500ec3[_0x7194('0x30')]=_[_0x7194('0x2f')](_0x101245[_0x7194('0x2b')],qs[_0x7194('0x31')](_0xd6e34c[_0x7194('0x2d')][_0x7194('0x31')]));_0x500ec3[_0x7194('0x30')]=_0x500ec3['attributes'][_0x7194('0x42')]?_0x500ec3['attributes']:_0x101245[_0x7194('0x2b')];_0x500ec3[_0x7194('0x34')]=qs[_0x7194('0x35')](_0xd6e34c[_0x7194('0x2d')]['sort']);_0x500ec3[_0x7194('0x36')]=qs[_0x7194('0x2e')](_['pick'](_0xd6e34c[_0x7194('0x2d')],_0x101245[_0x7194('0x2e')]));if(_0xd6e34c[_0x7194('0x2d')][_0x7194('0x38')]){_0x500ec3[_0x7194('0x36')]=_[_0x7194('0x39')](_0x500ec3[_0x7194('0x36')],{'$or':_[_0x7194('0x37')](_0x500ec3[_0x7194('0x30')],function(_0x1c1354){var _0x2554a7={};_0x2554a7[_0x1c1354]={'$like':'%'+_0xd6e34c[_0x7194('0x2d')][_0x7194('0x38')]+'%'};return _0x2554a7;})});}_0x500ec3=_[_0x7194('0x39')]({},_0x500ec3,_0xd6e34c[_0x7194('0x3a')]);return _0xe2d11f[_0x7194('0x53')](_0x500ec3);}})[_0x7194('0x21')](function(_0x41e767){if(_0x41e767){_0x539e33=_0x41e767[_0x7194('0x42')];if(!_0xd6e34c[_0x7194('0x2d')][_0x7194('0x32')](_0x7194('0x33'))){_0x500ec3['limit']=qs['limit'](_0xd6e34c[_0x7194('0x2d')][_0x7194('0x1b')]);_0x500ec3[_0x7194('0x1a')]=qs['offset'](_0xd6e34c[_0x7194('0x2d')][_0x7194('0x1a')]);}return _0xe2d11f[_0x7194('0x53')](_0x500ec3);}})[_0x7194('0x21')](function(_0x4577c3){if(_0x4577c3){return _0x4577c3?{'count':_0x539e33,'rows':_0x4577c3}:null;}})['then'](respondWithResult(_0x32f7ad,null))[_0x7194('0x3e')](handleError(_0x32f7ad,null));}; \ No newline at end of file +var _0x681f=['create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','omit','getContacts','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Companies','error','index','CmCompany','describe','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick','filter','where','map','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find'];(function(_0x1fdf47,_0x1da0d0){var _0x2f42d3=function(_0x56f2b3){while(--_0x56f2b3){_0x1fdf47['push'](_0x1fdf47['shift']());}};_0x2f42d3(++_0x1da0d0);}(_0x681f,0x15c));var _0xf681=function(_0x41c104,_0x11ddc4){_0x41c104=_0x41c104-0x0;var _0xf82b41=_0x681f[_0x41c104];return _0xf82b41;};'use strict';var pdf=require(_0xf681('0x0'));var emlformat=require(_0xf681('0x1'));var rimraf=require(_0xf681('0x2'));var zipdir=require(_0xf681('0x3'));var jsonpatch=require(_0xf681('0x4'));var rp=require('request-promise');var moment=require(_0xf681('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf681('0x6'));var util=require(_0xf681('0x7'));var path=require(_0xf681('0x8'));var sox=require(_0xf681('0x9'));var csv=require(_0xf681('0xa'));var ejs=require(_0xf681('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf681('0xc'));var toCsv=require(_0xf681('0xa'));var querystring=require(_0xf681('0xd'));var Papa=require(_0xf681('0xe'));var Redis=require(_0xf681('0xf'));var authService=require(_0xf681('0x10'));var qs=require(_0xf681('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf681('0x12'));var logger=require(_0xf681('0x13'))(_0xf681('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f73e9,_0x418da3){_0x418da3=_0x418da3||0xcc;return function(_0x75209e){if(_0x75209e){return _0x1f73e9[_0xf681('0x15')](_0x418da3);}return _0x1f73e9[_0xf681('0x16')](_0x418da3)[_0xf681('0x17')]();};}function respondWithResult(_0x128799,_0x1c7589){_0x1c7589=_0x1c7589||0xc8;return function(_0x2524aa){if(_0x2524aa){return _0x128799[_0xf681('0x16')](_0x1c7589)[_0xf681('0x18')](_0x2524aa);}};}function respondWithFilteredResult(_0x3d1d4d,_0x48274b){return function(_0x44a380){if(_0x44a380){var _0x357281=_0x44a380[_0xf681('0x19')],_0x3f4f1d=_0x48274b[_0xf681('0x1a')],_0x34bf85=_0x48274b[_0xf681('0x1a')]+_0x48274b[_0xf681('0x1b')],_0x52d2c7;if(_0x34bf85>=_0x357281){_0x34bf85=_0x357281;_0x52d2c7=0xc8;}else{_0x52d2c7=0xce;}_0x3d1d4d[_0xf681('0x16')](_0x52d2c7);return _0x3d1d4d[_0xf681('0x1c')](_0xf681('0x1d'),_0x3f4f1d+'-'+_0x34bf85+'/'+_0x357281)['json'](_0x44a380);}return null;};}function patchUpdates(_0x9910cf){return function(_0x2ecd88){try{jsonpatch[_0xf681('0x1e')](_0x2ecd88,_0x9910cf,!![]);}catch(_0x443393){return BPromise[_0xf681('0x1f')](_0x443393);}return _0x2ecd88[_0xf681('0x20')]();};}function saveUpdates(_0x8cebd9,_0x323b53){return function(_0x1a3af5){if(_0x1a3af5){return _0x1a3af5[_0xf681('0x21')](_0x8cebd9)[_0xf681('0x22')](function(_0x250821){return _0x250821;});}return null;};}function removeEntity(_0x1fb1df,_0x11a25b){return function(_0x396cc5){if(_0x396cc5){return _0x396cc5[_0xf681('0x23')]()[_0xf681('0x22')](function(){var _0x32aa9b=_0x396cc5[_0xf681('0x24')]({'plain':!![]});var _0x464019=_0xf681('0x25');return db['UserProfileResource'][_0xf681('0x23')]({'where':{'type':_0x464019,'resourceId':_0x32aa9b['id']}})[_0xf681('0x22')](function(){return _0x396cc5;});})[_0xf681('0x22')](function(){_0x1fb1df[_0xf681('0x16')](0xcc)[_0xf681('0x17')]();});}};}function handleEntityNotFound(_0x1d41bb,_0x26c426){return function(_0x28e04a){if(!_0x28e04a){_0x1d41bb[_0xf681('0x15')](0x194);}return _0x28e04a;};}function handleError(_0x53ddfd,_0x468aa1){_0x468aa1=_0x468aa1||0x1f4;return function(_0xb3d398){logger[_0xf681('0x26')](_0xb3d398['stack']);if(_0xb3d398['name']){delete _0xb3d398['name'];}_0x53ddfd[_0xf681('0x16')](_0x468aa1)['send'](_0xb3d398);};}exports[_0xf681('0x27')]=function(_0x4f1e08,_0x1abee9){var _0x208f8c={},_0x27ebee={},_0x3c38e1={'count':0x0,'rows':[]};return db[_0xf681('0x28')][_0xf681('0x29')]()[_0xf681('0x22')](function(_0x3c2989){_0x27ebee[_0xf681('0x2a')]=_[_0xf681('0x2b')](_0x3c2989);_0x27ebee[_0xf681('0x2c')]=_[_0xf681('0x2b')](_0x4f1e08[_0xf681('0x2c')]);_0x27ebee[_0xf681('0x2d')]=_[_0xf681('0x2e')](_0x27ebee[_0xf681('0x2a')],_0x27ebee[_0xf681('0x2c')]);_0x208f8c['attributes']=_[_0xf681('0x2e')](_0x27ebee[_0xf681('0x2a')],qs[_0xf681('0x2f')](_0x4f1e08[_0xf681('0x2c')]['fields']));_0x208f8c[_0xf681('0x30')]=_0x208f8c[_0xf681('0x30')][_0xf681('0x31')]?_0x208f8c[_0xf681('0x30')]:_0x27ebee[_0xf681('0x2a')];if(!_0x4f1e08[_0xf681('0x2c')]['hasOwnProperty']('nolimit')){_0x208f8c[_0xf681('0x1b')]=qs[_0xf681('0x1b')](_0x4f1e08[_0xf681('0x2c')]['limit']);_0x208f8c[_0xf681('0x1a')]=qs[_0xf681('0x1a')](_0x4f1e08['query'][_0xf681('0x1a')]);}_0x208f8c[_0xf681('0x32')]=qs[_0xf681('0x33')](_0x4f1e08[_0xf681('0x2c')][_0xf681('0x33')]);_0x208f8c['where']=qs[_0xf681('0x2d')](_[_0xf681('0x34')](_0x4f1e08[_0xf681('0x2c')],_0x27ebee[_0xf681('0x2d')]));if(_0x4f1e08[_0xf681('0x2c')][_0xf681('0x35')]){_0x208f8c['where']=_['merge'](_0x208f8c[_0xf681('0x36')],{'$or':_[_0xf681('0x37')](_0x208f8c['attributes'],function(_0x46b7a1){var _0x4773ef={};_0x4773ef[_0x46b7a1]={'$like':'%'+_0x4f1e08[_0xf681('0x2c')][_0xf681('0x35')]+'%'};return _0x4773ef;})});}_0x208f8c=_[_0xf681('0x38')]({},_0x208f8c,_0x4f1e08[_0xf681('0x39')]);var _0x10a399={'where':_0x208f8c[_0xf681('0x36')]};return db[_0xf681('0x28')][_0xf681('0x19')](_0x10a399)[_0xf681('0x22')](function(_0x2593f4){_0x3c38e1[_0xf681('0x19')]=_0x2593f4;if(_0x4f1e08['query'][_0xf681('0x3a')]){_0x208f8c[_0xf681('0x3b')]=[{'all':!![]}];}return db[_0xf681('0x28')][_0xf681('0x3c')](_0x208f8c);})[_0xf681('0x22')](function(_0x20f605){_0x3c38e1[_0xf681('0x3d')]=_0x20f605;return _0x3c38e1;})['then'](respondWithFilteredResult(_0x1abee9,_0x208f8c))[_0xf681('0x3e')](handleError(_0x1abee9,null));})[_0xf681('0x3e')](handleError(_0x1abee9,null));};exports[_0xf681('0x3f')]=function(_0x48b7c2,_0x5c326d){var _0x42a4b7={'raw':![],'where':{'id':_0x48b7c2[_0xf681('0x40')]['id']}},_0x195fdf={};_0x195fdf[_0xf681('0x2a')]=_[_0xf681('0x2b')](db[_0xf681('0x28')][_0xf681('0x41')]);_0x195fdf[_0xf681('0x2c')]=_[_0xf681('0x2b')](_0x48b7c2['query']);_0x195fdf[_0xf681('0x2d')]=_['intersection'](_0x195fdf[_0xf681('0x2a')],_0x195fdf[_0xf681('0x2c')]);_0x42a4b7[_0xf681('0x30')]=_['intersection'](_0x195fdf['model'],qs[_0xf681('0x2f')](_0x48b7c2[_0xf681('0x2c')][_0xf681('0x2f')]));_0x42a4b7[_0xf681('0x30')]=_0x42a4b7['attributes'][_0xf681('0x31')]?_0x42a4b7['attributes']:_0x195fdf[_0xf681('0x2a')];if(_0x48b7c2[_0xf681('0x2c')][_0xf681('0x3a')]){_0x42a4b7[_0xf681('0x3b')]=[{'all':!![]}];}_0x42a4b7=_[_0xf681('0x38')]({},_0x42a4b7,_0x48b7c2['options']);return db[_0xf681('0x28')][_0xf681('0x42')](_0x42a4b7)['then'](handleEntityNotFound(_0x5c326d,null))[_0xf681('0x22')](respondWithResult(_0x5c326d,null))[_0xf681('0x3e')](handleError(_0x5c326d,null));};exports[_0xf681('0x43')]=function(_0x2cd213,_0x1a48e6){return db[_0xf681('0x28')][_0xf681('0x43')](_0x2cd213['body'],{})['then'](function(_0x200e3c){var _0x134004=_0x2cd213[_0xf681('0x44')][_0xf681('0x24')]({'plain':!![]});if(!_0x134004)throw new Error(_0xf681('0x45'));if(_0x134004[_0xf681('0x46')]==='user'){var _0x65c6b2=_0x200e3c['get']({'plain':!![]});var _0x20dcf3=_0xf681('0x25');return db[_0xf681('0x47')][_0xf681('0x42')]({'where':{'name':_0x20dcf3,'userProfileId':_0x134004['userProfileId']},'raw':!![]})[_0xf681('0x22')](function(_0x127640){if(_0x127640&&_0x127640[_0xf681('0x48')]===0x0){return db[_0xf681('0x49')][_0xf681('0x43')]({'name':_0x65c6b2['name'],'resourceId':_0x65c6b2['id'],'type':_0x127640[_0xf681('0x4a')],'sectionId':_0x127640['id']},{})[_0xf681('0x22')](function(){return _0x200e3c;});}else{return _0x200e3c;}})['catch'](function(_0x4efbbb){logger[_0xf681('0x26')](_0xf681('0x4b'),_0x4efbbb);throw _0x4efbbb;});}return _0x200e3c;})[_0xf681('0x22')](respondWithResult(_0x1a48e6,0xc9))[_0xf681('0x3e')](handleError(_0x1a48e6,null));};exports[_0xf681('0x21')]=function(_0x29a0c5,_0x1bfa97){if(_0x29a0c5[_0xf681('0x4c')]['id']){delete _0x29a0c5[_0xf681('0x4c')]['id'];}return db[_0xf681('0x28')]['find']({'where':{'id':_0x29a0c5['params']['id']}})[_0xf681('0x22')](handleEntityNotFound(_0x1bfa97,null))[_0xf681('0x22')](saveUpdates(_0x29a0c5[_0xf681('0x4c')],null))[_0xf681('0x22')](respondWithResult(_0x1bfa97,null))[_0xf681('0x3e')](handleError(_0x1bfa97,null));};exports['destroy']=function(_0x1f885e,_0x2e899f){return db[_0xf681('0x28')]['find']({'where':{'id':_0x1f885e[_0xf681('0x40')]['id']}})[_0xf681('0x22')](handleEntityNotFound(_0x2e899f,null))[_0xf681('0x22')](removeEntity(_0x2e899f,null))['catch'](handleError(_0x2e899f,null));};exports[_0xf681('0x29')]=function(_0x3446ae,_0x20b5f2){return db[_0xf681('0x28')][_0xf681('0x29')]()[_0xf681('0x22')](respondWithResult(_0x20b5f2,null))[_0xf681('0x3e')](handleError(_0x20b5f2,null));};exports[_0xf681('0x4d')]=function(_0x47ee3e,_0x49b962,_0x593c70){return db[_0xf681('0x4e')][_0xf681('0x42')]({'where':{'id':_0x47ee3e[_0xf681('0x40')]['id']}})[_0xf681('0x22')](handleEntityNotFound(_0x49b962,null))['then'](function(_0x411a04){if(_0x411a04){return _0x411a04[_0xf681('0x4d')](_0x47ee3e[_0xf681('0x4c')][_0xf681('0x4f')],_[_0xf681('0x50')](_0x47ee3e[_0xf681('0x4c')],[_0xf681('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x49b962,null))[_0xf681('0x3e')](handleError(_0x49b962,null));};exports['getContacts']=function(_0x1823f8,_0x45efc7,_0x59e559){var _0x4edaa7={};var _0x16b134={};var _0x1a4653;var _0x1d10a2;return db[_0xf681('0x28')]['findOne']({'where':{'id':_0x1823f8[_0xf681('0x40')]['id']}})[_0xf681('0x22')](handleEntityNotFound(_0x45efc7,null))[_0xf681('0x22')](function(_0x32859c){if(_0x32859c){_0x1a4653=_0x32859c;_0x16b134[_0xf681('0x2a')]=_[_0xf681('0x2b')](db[_0xf681('0x4e')]['rawAttributes']);_0x16b134[_0xf681('0x2c')]=_['keys'](_0x1823f8[_0xf681('0x2c')]);_0x16b134[_0xf681('0x2d')]=_['intersection'](_0x16b134[_0xf681('0x2a')],_0x16b134[_0xf681('0x2c')]);_0x4edaa7['attributes']=_['intersection'](_0x16b134['model'],qs[_0xf681('0x2f')](_0x1823f8[_0xf681('0x2c')]['fields']));_0x4edaa7['attributes']=_0x4edaa7[_0xf681('0x30')][_0xf681('0x31')]?_0x4edaa7[_0xf681('0x30')]:_0x16b134[_0xf681('0x2a')];_0x4edaa7['order']=qs[_0xf681('0x33')](_0x1823f8[_0xf681('0x2c')][_0xf681('0x33')]);_0x4edaa7[_0xf681('0x36')]=qs[_0xf681('0x2d')](_['pick'](_0x1823f8[_0xf681('0x2c')],_0x16b134[_0xf681('0x2d')]));if(_0x1823f8[_0xf681('0x2c')]['filter']){_0x4edaa7['where']=_['merge'](_0x4edaa7[_0xf681('0x36')],{'$or':_['map'](_0x4edaa7[_0xf681('0x30')],function(_0xcc836b){var _0x533fec={};_0x533fec[_0xcc836b]={'$like':'%'+_0x1823f8[_0xf681('0x2c')][_0xf681('0x35')]+'%'};return _0x533fec;})});}_0x4edaa7=_['merge']({},_0x4edaa7,_0x1823f8[_0xf681('0x39')]);return _0x1a4653[_0xf681('0x51')](_0x4edaa7);}})['then'](function(_0x5abdbf){if(_0x5abdbf){_0x1d10a2=_0x5abdbf[_0xf681('0x31')];if(!_0x1823f8[_0xf681('0x2c')]['hasOwnProperty'](_0xf681('0x52'))){_0x4edaa7[_0xf681('0x1b')]=qs['limit'](_0x1823f8[_0xf681('0x2c')][_0xf681('0x1b')]);_0x4edaa7[_0xf681('0x1a')]=qs['offset'](_0x1823f8[_0xf681('0x2c')]['offset']);}return _0x1a4653[_0xf681('0x51')](_0x4edaa7);}})[_0xf681('0x22')](function(_0x240653){if(_0x240653){return _0x240653?{'count':_0x1d10a2,'rows':_0x240653}:null;}})[_0xf681('0x22')](respondWithResult(_0x45efc7,null))[_0xf681('0x3e')](handleError(_0x45efc7,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 99046e6..44ad915 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 _0x6bac=['../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4f3489,_0x196bd8){var _0x524cd3=function(_0x27a36e){while(--_0x27a36e){_0x4f3489['push'](_0x4f3489['shift']());}};_0x524cd3(++_0x196bd8);}(_0x6bac,0xa5));var _0xc6ba=function(_0x4bc43a,_0x2f36cf){_0x4bc43a=_0x4bc43a-0x0;var _0x20fd47=_0x6bac[_0x4bc43a];return _0x20fd47;};'use strict';var _=require(_0xc6ba('0x0'));var util=require('util');var logger=require(_0xc6ba('0x1'))(_0xc6ba('0x2'));var moment=require(_0xc6ba('0x3'));var BPromise=require(_0xc6ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6ba('0x5'));var attributes=require(_0xc6ba('0x6'));module['exports']=function(_0x222f20,_0x2a16af){return _0x222f20[_0xc6ba('0x7')](_0xc6ba('0x8'),attributes,{'tableName':_0xc6ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa7c=['../../config/environment','./cmCompany.attributes','exports','define','lodash','bluebird','request-promise','rimraf'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x4967d0,_0x3347d9){_0x4967d0=_0x4967d0-0x0;var _0x2ecc6b=_0xaa7c[_0x4967d0];return _0x2ecc6b;};'use strict';var _=require(_0xcaa7('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcaa7('0x1'));var rp=require(_0xcaa7('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaa7('0x3'));var config=require(_0xcaa7('0x4'));var attributes=require(_0xcaa7('0x5'));module[_0xcaa7('0x6')]=function(_0x27e610,_0x5a3674){return _0x27e610[_0xcaa7('0x7')]('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 be33534..770d527 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 _0x53c2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x39d643,_0x1c6dec){var _0x248cfe=function(_0x2fae89){while(--_0x2fae89){_0x39d643['push'](_0x39d643['shift']());}};_0x248cfe(++_0x1c6dec);}(_0x53c2,0x181));var _0x253c=function(_0x49259b,_0x3126bf){_0x49259b=_0x49259b-0x0;var _0x1d85fb=_0x53c2[_0x49259b];return _0x1d85fb;};'use strict';var _=require(_0x253c('0x0'));var util=require(_0x253c('0x1'));var moment=require(_0x253c('0x2'));var BPromise=require(_0x253c('0x3'));var rs=require(_0x253c('0x4'));var fs=require('fs');var Redis=require(_0x253c('0x5'));var db=require(_0x253c('0x6'))['db'];var utils=require(_0x253c('0x7'));var logger=require(_0x253c('0x8'))(_0x253c('0x9'));var config=require(_0x253c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x253c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2475ee,_0x23f0ac,_0x1cbbd0){return new BPromise(function(_0x468168,_0x4a0032){return client['request'](_0x2475ee,_0x1cbbd0)[_0x253c('0xc')](function(_0x25a8d9){logger[_0x253c('0xd')](_0x253c('0xe'),_0x23f0ac,_0x253c('0xf'));logger[_0x253c('0x10')](_0x253c('0x11'),_0x23f0ac,'request\x20sent',JSON[_0x253c('0x12')](_0x25a8d9));if(_0x25a8d9[_0x253c('0x13')]){if(_0x25a8d9['error'][_0x253c('0x14')]===0x1f4){logger[_0x253c('0x13')](_0x253c('0xe'),_0x23f0ac,_0x25a8d9[_0x253c('0x13')]['message']);return _0x4a0032(_0x25a8d9[_0x253c('0x13')][_0x253c('0x15')]);}logger[_0x253c('0x13')]('CmCompany,\x20%s,\x20%s',_0x23f0ac,_0x25a8d9['error'][_0x253c('0x15')]);return _0x468168(_0x25a8d9[_0x253c('0x13')][_0x253c('0x15')]);}else{logger[_0x253c('0xd')](_0x253c('0xe'),_0x23f0ac,_0x253c('0xf'));_0x468168(_0x25a8d9['result'][_0x253c('0x15')]);}})[_0x253c('0x16')](function(_0x4f56b0){logger[_0x253c('0x13')](_0x253c('0xe'),_0x23f0ac,_0x4f56b0);_0x4a0032(_0x4f56b0);});});} \ No newline at end of file +var _0xb0ff=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','CmCompany,\x20%s,\x20%s'];(function(_0x5d770a,_0x116144){var _0x1ebaf5=function(_0x7621f6){while(--_0x7621f6){_0x5d770a['push'](_0x5d770a['shift']());}};_0x1ebaf5(++_0x116144);}(_0xb0ff,0xe3));var _0xfb0f=function(_0x361937,_0x29ab30){_0x361937=_0x361937-0x0;var _0x4b77d3=_0xb0ff[_0x361937];return _0x4b77d3;};'use strict';var _=require(_0xfb0f('0x0'));var util=require(_0xfb0f('0x1'));var moment=require(_0xfb0f('0x2'));var BPromise=require(_0xfb0f('0x3'));var rs=require(_0xfb0f('0x4'));var fs=require('fs');var Redis=require(_0xfb0f('0x5'));var db=require(_0xfb0f('0x6'))['db'];var utils=require(_0xfb0f('0x7'));var logger=require(_0xfb0f('0x8'))(_0xfb0f('0x9'));var config=require(_0xfb0f('0xa'));var jayson=require(_0xfb0f('0xb'));var client=jayson[_0xfb0f('0xc')][_0xfb0f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x43d75a,_0x313062,_0x432156){return new BPromise(function(_0x2e8f19,_0x1adc6e){return client[_0xfb0f('0xe')](_0x43d75a,_0x432156)[_0xfb0f('0xf')](function(_0x37e8ad){logger[_0xfb0f('0x10')]('CmCompany,\x20%s,\x20%s',_0x313062,_0xfb0f('0x11'));logger[_0xfb0f('0x12')](_0xfb0f('0x13'),_0x313062,'request\x20sent',JSON['stringify'](_0x37e8ad));if(_0x37e8ad[_0xfb0f('0x14')]){if(_0x37e8ad[_0xfb0f('0x14')][_0xfb0f('0x15')]===0x1f4){logger['error'](_0xfb0f('0x16'),_0x313062,_0x37e8ad['error'][_0xfb0f('0x17')]);return _0x1adc6e(_0x37e8ad[_0xfb0f('0x14')]['message']);}logger[_0xfb0f('0x14')]('CmCompany,\x20%s,\x20%s',_0x313062,_0x37e8ad[_0xfb0f('0x14')][_0xfb0f('0x17')]);return _0x2e8f19(_0x37e8ad[_0xfb0f('0x14')][_0xfb0f('0x17')]);}else{logger[_0xfb0f('0x10')]('CmCompany,\x20%s,\x20%s',_0x313062,'request\x20sent');_0x2e8f19(_0x37e8ad[_0xfb0f('0x18')]['message']);}})['catch'](function(_0x294471){logger['error'](_0xfb0f('0x16'),_0x313062,_0x294471);_0x1adc6e(_0x294471);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 7b47d58..4eac323 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 _0xa456=['update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x2635c0,_0x3086c0){var _0x214668=function(_0x385d36){while(--_0x385d36){_0x2635c0['push'](_0x2635c0['shift']());}};_0x214668(++_0x3086c0);}(_0xa456,0x142));var _0x6a45=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xa456[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var auth=require(_0x6a45('0x5'));var interaction=require(_0x6a45('0x6'));var config=require('../../config/environment');var controller=require(_0x6a45('0x7'));router[_0x6a45('0x8')]('/',auth[_0x6a45('0x9')](),controller[_0x6a45('0xa')]);router['get'](_0x6a45('0xb'),auth[_0x6a45('0x9')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x8')](_0x6a45('0xd'),auth['isAuthenticated'](),controller[_0x6a45('0xe')]);router['get'](_0x6a45('0xf'),auth[_0x6a45('0x9')](),controller[_0x6a45('0x10')]);router[_0x6a45('0x11')]('/',auth[_0x6a45('0x9')](),controller['create']);router['post'](_0x6a45('0xf'),auth[_0x6a45('0x9')](),controller['addContacts']);router['put']('/:id',auth[_0x6a45('0x9')](),controller[_0x6a45('0x12')]);router[_0x6a45('0x13')](_0x6a45('0xd'),auth[_0x6a45('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1a85=['../../config/environment','./cmCompany.controller','isAuthenticated','get','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/interaction/service'];(function(_0x235482,_0x14b833){var _0x5f5bea=function(_0x17a254){while(--_0x17a254){_0x235482['push'](_0x235482['shift']());}};_0x5f5bea(++_0x14b833);}(_0x1a85,0x178));var _0x51a8=function(_0x1619c1,_0x21b9fd){_0x1619c1=_0x1619c1-0x0;var _0x424d3f=_0x1a85[_0x1619c1];return _0x424d3f;};'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 auth=require('../../components/auth/service');var interaction=require(_0x51a8('0x3'));var config=require(_0x51a8('0x4'));var controller=require(_0x51a8('0x5'));router['get']('/',auth[_0x51a8('0x6')](),controller['index']);router[_0x51a8('0x7')]('/describe',auth[_0x51a8('0x6')](),controller[_0x51a8('0x8')]);router['get'](_0x51a8('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x51a8('0x7')](_0x51a8('0xa'),auth[_0x51a8('0x6')](),controller[_0x51a8('0xb')]);router[_0x51a8('0xc')]('/',auth[_0x51a8('0x6')](),controller[_0x51a8('0xd')]);router[_0x51a8('0xc')](_0x51a8('0xa'),auth[_0x51a8('0x6')](),controller[_0x51a8('0xe')]);router[_0x51a8('0xf')](_0x51a8('0x9'),auth[_0x51a8('0x6')](),controller[_0x51a8('0x10')]);router[_0x51a8('0x11')](_0x51a8('0x9'),auth['isAuthenticated'](),controller[_0x51a8('0x12')]);module[_0x51a8('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 7621b56..fd2a1f4 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 _0x3b6d=['DATE','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x15abd9,_0x46b856){var _0x58fd5f=function(_0x1668a3){while(--_0x1668a3){_0x15abd9['push'](_0x15abd9['shift']());}};_0x58fd5f(++_0x46b856);}(_0x3b6d,0x86));var _0xd3b6=function(_0x815947,_0x519bbc){_0x815947=_0x815947-0x0;var _0x4d13b4=_0x3b6d[_0x815947];return _0x4d13b4;};'use strict';var _=require(_0xd3b6('0x0'));var Sequelize=require(_0xd3b6('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xd3b6('0x2')]},'street':{'type':Sequelize[_0xd3b6('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xd3b6('0x2')]},'country':{'type':Sequelize[_0xd3b6('0x2')]},'dateOfBirth':{'type':Sequelize[_0xd3b6('0x2')]},'description':{'type':Sequelize[_0xd3b6('0x3')]},'phone':{'type':Sequelize[_0xd3b6('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xd3b6('0x2')]},'twitter':{'type':Sequelize[_0xd3b6('0x2')]},'skype':{'type':Sequelize[_0xd3b6('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xd3b6('0x2')]},'line':{'type':Sequelize[_0xd3b6('0x2')]},'wechat':{'type':Sequelize[_0xd3b6('0x2')]},'telegram':{'type':Sequelize[_0xd3b6('0x2')]},'UserId':{'type':Sequelize[_0xd3b6('0x4')]},'priority':{'type':Sequelize[_0xd3b6('0x4')](0x2)[_0xd3b6('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd3b6('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x1b39=['DATE','NOW','lodash','exports','STRING','INTEGER'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x1b39,0x188));var _0x91b3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1b39[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x91b3('0x0'));var Sequelize=require('sequelize');module[_0x91b3('0x1')]={'firstName':{'type':Sequelize[_0x91b3('0x2')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x91b3('0x2')]},'postalCode':{'type':Sequelize[_0x91b3('0x2')]},'city':{'type':Sequelize[_0x91b3('0x2')]},'country':{'type':Sequelize[_0x91b3('0x2')]},'dateOfBirth':{'type':Sequelize[_0x91b3('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x91b3('0x2')]},'mobile':{'type':Sequelize[_0x91b3('0x2')]},'fax':{'type':Sequelize[_0x91b3('0x2')]},'email':{'type':Sequelize[_0x91b3('0x2')]},'url':{'type':Sequelize[_0x91b3('0x2')]},'facebook':{'type':Sequelize[_0x91b3('0x2')]},'fb_data':{'type':Sequelize[_0x91b3('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x91b3('0x2')]},'teams':{'type':Sequelize[_0x91b3('0x2')]},'viber':{'type':Sequelize[_0x91b3('0x2')]},'line':{'type':Sequelize[_0x91b3('0x2')]},'wechat':{'type':Sequelize[_0x91b3('0x2')]},'telegram':{'type':Sequelize[_0x91b3('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x91b3('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x91b3('0x4')],'defaultValue':Sequelize[_0x91b3('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 87a0e71..4bdd0ea 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 _0x6a7b=['color','from','tools_tags','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','find','Tag','value','map','union','User','uc.UserId\x20=\x20?','datetime','DATE','buildExpression','text','start','isNil','Contact','forEach','ListId','where','\x20=\x20?','tag','isArray','filter','replace','\x27\x27\x27\x27','split','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.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','isEmpty','having','t.id\x20IN\x20?','resolve','some','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','count','keyBy','merge','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','TagIds','Tags','rows','catch','params','tags','columnName','displayName','CmCustomField','findAll','alias','custom','body','get','mergeWith','info','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','join','bulkCreate','each','duplicates','$or','spread','show','$and','omit','pickBy','format','cf_%d','table','cm_contacts','setFields','toParam','values','phone','CmHopper','getTags','options','setTags','includeAll','getHopperHistories','rawAttributes','ContactId','include','getJscriptySessions','JscriptySessionReport','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','pid','exit','error\x20child\x20process','html-pdf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','sendStatus','end','status','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','findOne','trimStart','all','fieldType','type','query','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','select','field'];(function(_0x5e2d7e,_0x3b172d){var _0x34bef0=function(_0x7fe324){while(--_0x7fe324){_0x5e2d7e['push'](_0x5e2d7e['shift']());}};_0x34bef0(++_0x3b172d);}(_0x6a7b,0x192));var _0xb6a7=function(_0x5d8eb7,_0x2b87c4){_0x5d8eb7=_0x5d8eb7-0x0;var _0x42d426=_0x6a7b[_0x5d8eb7];return _0x42d426;};'use strict';var pdf=require(_0xb6a7('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6a7('0x1'));var rp=require('request-promise');var moment=require(_0xb6a7('0x2'));var BPromise=require(_0xb6a7('0x3'));var Mustache=require('mustache');var util=require(_0xb6a7('0x4'));var path=require(_0xb6a7('0x5'));var sox=require('sox');var csv=require(_0xb6a7('0x6'));var ejs=require(_0xb6a7('0x7'));var fs=require('fs');var _=require(_0xb6a7('0x8'));var squel=require('squel');var crypto=require(_0xb6a7('0x9'));var jsforce=require(_0xb6a7('0xa'));var deskjs=require(_0xb6a7('0xb'));var toCsv=require(_0xb6a7('0x6'));var querystring=require(_0xb6a7('0xc'));var Papa=require(_0xb6a7('0xd'));var Redis=require(_0xb6a7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xb6a7('0xf'));var as=require(_0xb6a7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6a7('0x11'))(_0xb6a7('0x12'));var utils=require(_0xb6a7('0x13'));var config=require(_0xb6a7('0x14'));var db=require('../../mysqldb')['db'];config[_0xb6a7('0x15')]=_[_0xb6a7('0x16')](config[_0xb6a7('0x15')],{'host':_0xb6a7('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')['register'](socket);function respondWithStatusCode(_0x426a66,_0x41a6a9){_0x41a6a9=_0x41a6a9||0xcc;return function(_0x5f1536){if(_0x5f1536){return _0x426a66[_0xb6a7('0x18')](_0x41a6a9);}return _0x426a66['status'](_0x41a6a9)[_0xb6a7('0x19')]();};}function respondWithResult(_0x391a13,_0x5d4ff0){_0x5d4ff0=_0x5d4ff0||0xc8;return function(_0x223f4c){if(_0x223f4c){return _0x391a13[_0xb6a7('0x1a')](_0x5d4ff0)['json'](_0x223f4c);}};}function respondWithFilteredResult(_0x10dca9,_0x2ef459){return function(_0x4ce482){if(_0x4ce482){var _0x87056=_0x4ce482['count'],_0x4e56d7=_0x2ef459[_0xb6a7('0x1b')],_0x2353ce=_0x2ef459[_0xb6a7('0x1b')]+_0x2ef459[_0xb6a7('0x1c')],_0xfbfc9c;if(_0x2353ce>=_0x87056){_0x2353ce=_0x87056;_0xfbfc9c=0xc8;}else{_0xfbfc9c=0xce;}_0x10dca9[_0xb6a7('0x1a')](_0xfbfc9c);return _0x10dca9[_0xb6a7('0x1d')](_0xb6a7('0x1e'),_0x4e56d7+'-'+_0x2353ce+'/'+_0x87056)[_0xb6a7('0x1f')](_0x4ce482);}return null;};}function patchUpdates(_0x390375){return function(_0x533b1b){try{jsonpatch['apply'](_0x533b1b,_0x390375,!![]);}catch(_0x50ca1d){return BPromise[_0xb6a7('0x20')](_0x50ca1d);}return _0x533b1b[_0xb6a7('0x21')]();};}function saveUpdates(_0x5f24d6,_0x5ab215){return function(_0x4e2462){if(_0x4e2462){return _0x4e2462[_0xb6a7('0x22')](_0x5f24d6)[_0xb6a7('0x23')](function(_0x3de9c8){return _0x3de9c8;});}return null;};}function removeEntity(_0x4a9255,_0x66bd8f){return function(_0x4c6b0){if(_0x4c6b0){return _0x4c6b0[_0xb6a7('0x24')]()[_0xb6a7('0x23')](function(){_0x4a9255[_0xb6a7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b813,_0x5a6820){return function(_0x2c26c4){if(!_0x2c26c4){_0x54b813['sendStatus'](0x194);}return _0x2c26c4;};}function handleError(_0x5f4bfb,_0x51a710){_0x51a710=_0x51a710||0x1f4;return function(_0x414f9c){logger['error'](_0x414f9c[_0xb6a7('0x25')]);if(_0x414f9c[_0xb6a7('0x26')]){delete _0x414f9c[_0xb6a7('0x26')];}_0x5f4bfb[_0xb6a7('0x1a')](_0x51a710)[_0xb6a7('0x27')](_0x414f9c);};}exports[_0xb6a7('0x28')]=function(_0x15831e,_0x15bd67){var _0xed208c={},_0x5f0936={},_0xd001d7={'count':0x0,'rows':[]};return db[_0xb6a7('0x29')][_0xb6a7('0x2a')]()[_0xb6a7('0x23')](function(_0x57a9a2){var _0x36c54c=[];for(var _0x1a57f2=0x0;_0x1a57f20x1){_0x1e1419['or'](_0xb6a7('0x67'),qs[_0xb6a7('0x68')](_0x379660),null);}else{if(qs['isNumeric'](_0x379660)){_0x1e1419['or'](_0xb6a7('0x69'),_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6a'),_0x379660+'%');_0x1e1419['or']('c.mobile\x20LIKE\x20?',_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6b'),_0x379660+'%');}else if(qs[_0xb6a7('0x6c')](_0x379660)){_0x1e1419['or']('c.email\x20LIKE\x20?',_0x379660+'%');}else{_0x1e1419['or'](_0xb6a7('0x6d'),'%'+_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6e'),'%'+_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6f'),'%'+_0x379660+'%');}}}}_0xfb5afa[_0xb6a7('0x5f')](_0x1e1419);_0xfb5afa[_0xb6a7('0x70')](_0xb6a7('0x71'));var _0x5eb01f={'type':db[_0xb6a7('0x72')][_0xb6a7('0x73')][_0xb6a7('0x74')],'raw':!![]};var _0xc346b1=_0xfb5afa['clone']()['field'](_0xb6a7('0x71'));if(_0xed208c[_0xb6a7('0x3c')]){_0xed208c[_0xb6a7('0x3c')][_0xb6a7('0x5d')](function(_0x19cc35){_0xfb5afa['order']('c.'+_0x19cc35[0x0],_0x19cc35[0x1]===_0xb6a7('0x75')?![]:!![]);});}if(!_[_0xb6a7('0x76')](_0x869a33)){_0xfb5afa[_0xb6a7('0x77')](_0x465c55);_0xc346b1[_0xb6a7('0x5f')](_0xb6a7('0x78'),_0x869a33);}BPromise[_0xb6a7('0x79')]()[_0xb6a7('0x23')](function(){if(_0x4fdfcb&&!_[_0xb6a7('0x7a')](_0x4fdfcb['conditions'],[_0xb6a7('0x41'),'User'])){return _0x15831e[_0xb6a7('0x7b')][_0xb6a7('0x7c')]({'attributes':['id'],'raw':!![]})[_0xb6a7('0x23')](function(_0x3fef58){if(_['isEmpty'](_0x3fef58)){_0xc346b1[_0xb6a7('0x5f')](_0xb6a7('0x7d'));_0xfb5afa[_0xb6a7('0x5f')]('c.ListId\x20IS\x20NULL');}else{_0xc346b1[_0xb6a7('0x5f')](_0xb6a7('0x7e'),_['map'](_0x3fef58,'id'));_0xfb5afa[_0xb6a7('0x5f')](_0xb6a7('0x7e'),_[_0xb6a7('0x52')](_0x3fef58,'id'));}});}else{return;}})['then'](function(){db[_0xb6a7('0x7f')][_0xb6a7('0x35')](_0xc346b1[_0xb6a7('0x80')](),_0x5eb01f)[_0xb6a7('0x23')](function(_0x1dc9d2){_0xd001d7['count']=_0x1dc9d2['length'];if(_0xd001d7[_0xb6a7('0x81')]===0x0)return[];return db[_0xb6a7('0x7f')][_0xb6a7('0x35')](_0x3b884e[_0xb6a7('0x80')](),_0x5eb01f);})[_0xb6a7('0x23')](function(_0x589110){_0x351cb4=_[_0xb6a7('0x82')](_0x589110,'id');_0x5eb01f=_[_0xb6a7('0x83')](_0x5eb01f,{'model':db[_0xb6a7('0x29')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15831e['query']['fields']){_0xed208c[_0xb6a7('0x39')][_0xb6a7('0x5d')](function(_0x3859da){_0xfb5afa[_0xb6a7('0x41')]('c.'+_0x3859da);});}else{_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x71'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x84'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x85'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x86'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x87'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x88'));_0xfb5afa['field'](_0xb6a7('0x89'));_0xfb5afa[_0xb6a7('0x41')]('c.ListId');_0xfb5afa['field']('c.deletedAt');_0xfb5afa[_0xb6a7('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xed208c[_0xb6a7('0x1c')])_0xfb5afa[_0xb6a7('0x1c')](_0xed208c[_0xb6a7('0x1c')]);if(_0xed208c[_0xb6a7('0x1b')])_0xfb5afa['offset'](_0xed208c[_0xb6a7('0x1b')]);return db[_0xb6a7('0x7f')][_0xb6a7('0x35')](_0xfb5afa['toString'](),_0x5eb01f);})[_0xb6a7('0x23')](function(_0x201daa){_0x201daa[_0xb6a7('0x5d')](function(_0x4f9cfe){if(_0x4f9cfe[_0xb6a7('0x8a')]){_0x4f9cfe['Tags']=[];_0x4f9cfe[_0xb6a7('0x8a')][_0xb6a7('0x66')](',')[_0xb6a7('0x5d')](function(_0x5d3279){_0x4f9cfe[_0xb6a7('0x8b')][_0xb6a7('0x2f')](_0x351cb4[_0x5d3279]);});}delete _0x4f9cfe['TagIds'];});_0xd001d7[_0xb6a7('0x8c')]=_0x201daa;return _0xd001d7;})[_0xb6a7('0x23')](respondWithFilteredResult(_0x15bd67,_0xed208c));});})[_0xb6a7('0x8d')](handleError(_0x15bd67,null));};exports['destroy']=function(_0x526982,_0x7f5488){return db[_0xb6a7('0x29')]['find']({'where':{'id':_0x526982[_0xb6a7('0x8e')]['id']}})[_0xb6a7('0x23')](handleEntityNotFound(_0x7f5488,null))[_0xb6a7('0x23')](removeEntity(_0x7f5488,null))[_0xb6a7('0x8d')](handleError(_0x7f5488,null));};exports[_0xb6a7('0x2a')]=function(_0x4e60c2,_0x1e61fe){return db[_0xb6a7('0x29')][_0xb6a7('0x2a')]()[_0xb6a7('0x23')](function(_0x451d59){delete _0x451d59[_0xb6a7('0x8f')];for(var _0xc1d9da=0x0;_0xc1d9da=_0x51e7f4){_0x11d261=_0x51e7f4;_0x3e6a8d=0xc8;}else{_0x3e6a8d=0xce;}_0x143854['status'](_0x3e6a8d);return _0x143854[_0x3afe('0x22')](_0x3afe('0x23'),_0x2c049a+'-'+_0x11d261+'/'+_0x51e7f4)[_0x3afe('0x1e')](_0x5563be);}return null;};}function patchUpdates(_0x1c86f2){return function(_0x10308f){try{jsonpatch[_0x3afe('0x24')](_0x10308f,_0x1c86f2,!![]);}catch(_0x5912b6){return BPromise[_0x3afe('0x25')](_0x5912b6);}return _0x10308f[_0x3afe('0x26')]();};}function saveUpdates(_0x5185bc,_0xbc7c1b){return function(_0x2ccbf5){if(_0x2ccbf5){return _0x2ccbf5[_0x3afe('0x27')](_0x5185bc)[_0x3afe('0x28')](function(_0x5891ff){return _0x5891ff;});}return null;};}function removeEntity(_0x2ddf02,_0x567e38){return function(_0x2d2f5e){if(_0x2d2f5e){return _0x2d2f5e['destroy']()['then'](function(){_0x2ddf02[_0x3afe('0x1d')](0xcc)[_0x3afe('0x29')]();});}};}function handleEntityNotFound(_0x1b8817,_0x52bb60){return function(_0x59842b){if(!_0x59842b){_0x1b8817[_0x3afe('0x2a')](0x194);}return _0x59842b;};}function handleError(_0xe18232,_0x400025){_0x400025=_0x400025||0x1f4;return function(_0x249611){logger[_0x3afe('0x2b')](_0x249611[_0x3afe('0x2c')]);if(_0x249611[_0x3afe('0x2d')]){delete _0x249611['name'];}_0xe18232[_0x3afe('0x1d')](_0x400025)['send'](_0x249611);};}exports[_0x3afe('0x2e')]=function(_0x23d927,_0xe47f9e){var _0x95d37={},_0x1410dd={},_0x5e3cd1={'count':0x0,'rows':[]};return db['CmContact']['describe']()[_0x3afe('0x28')](function(_0x3f7276){var _0x2659dd=[];for(var _0x596b0e=0x0;_0x596b0e0x1){_0x45291c['or'](_0x3afe('0x69'),qs[_0x3afe('0x6a')](_0x8947a6),null);}else{if(qs['isNumeric'](_0x8947a6)){_0x45291c['or'](_0x3afe('0x6b'),_0x8947a6+'%');_0x45291c['or'](_0x3afe('0x6c'),_0x8947a6+'%');_0x45291c['or'](_0x3afe('0x6d'),_0x8947a6+'%');_0x45291c['or'](_0x3afe('0x6e'),_0x8947a6+'%');}else if(qs[_0x3afe('0x6f')](_0x8947a6)){_0x45291c['or'](_0x3afe('0x70'),_0x8947a6+'%');}else{_0x45291c['or'](_0x3afe('0x71'),'%'+_0x8947a6+'%');_0x45291c['or'](_0x3afe('0x72'),'%'+_0x8947a6+'%');_0x45291c['or'](_0x3afe('0x70'),'%'+_0x8947a6+'%');}}}}_0x272899[_0x3afe('0x3e')](_0x45291c);_0x272899[_0x3afe('0x73')](_0x3afe('0x74'));var _0xa77d26={'type':db['Sequelize'][_0x3afe('0x75')]['SELECT'],'raw':!![]};var _0x125129=_0x272899[_0x3afe('0x76')]()[_0x3afe('0x42')](_0x3afe('0x74'));if(_0x95d37[_0x3afe('0x77')]){_0x95d37['order'][_0x3afe('0x61')](function(_0xcf2965){_0x272899['order']('c.'+_0xcf2965[0x0],_0xcf2965[0x1]===_0x3afe('0x78')?![]:!![]);});}if(!_[_0x3afe('0x79')](_0x37bf7f)){_0x272899[_0x3afe('0x7a')](_0x54f9c9);_0x125129[_0x3afe('0x3e')]('t.id\x20IN\x20?',_0x37bf7f);}BPromise['resolve']()[_0x3afe('0x28')](function(){if(_0x2e9c3b&&!_[_0x3afe('0x7b')](_0x2e9c3b[_0x3afe('0x51')],[_0x3afe('0x42'),_0x3afe('0x57')])){return _0x23d927['user'][_0x3afe('0x7c')]({'attributes':['id'],'raw':!![]})[_0x3afe('0x28')](function(_0x4765ad){if(_[_0x3afe('0x79')](_0x4765ad)){_0x125129[_0x3afe('0x3e')]('c.ListId\x20IS\x20NULL');_0x272899[_0x3afe('0x3e')](_0x3afe('0x7d'));}else{_0x125129[_0x3afe('0x3e')](_0x3afe('0x62'),_['map'](_0x4765ad,'id'));_0x272899['where'](_0x3afe('0x62'),_['map'](_0x4765ad,'id'));}});}else{return;}})[_0x3afe('0x28')](function(){db[_0x3afe('0x7e')][_0x3afe('0x38')](_0x125129['toString'](),_0xa77d26)[_0x3afe('0x28')](function(_0x37f79e){_0x5e3cd1[_0x3afe('0x1f')]=_0x37f79e[_0x3afe('0x30')];if(_0x5e3cd1[_0x3afe('0x1f')]===0x0)return[];return db['sequelize'][_0x3afe('0x38')](_0x83d5b['toString'](),_0xa77d26);})['then'](function(_0x1f0127){_0x39a10f=_[_0x3afe('0x7f')](_0x1f0127,'id');_0xa77d26=_[_0x3afe('0x80')](_0xa77d26,{'model':db[_0x3afe('0x81')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x23d927[_0x3afe('0x38')]['fields']){_0x95d37[_0x3afe('0x3a')][_0x3afe('0x61')](function(_0x2df242){_0x272899[_0x3afe('0x42')]('c.'+_0x2df242);});}else{_0x272899['field'](_0x3afe('0x74'));_0x272899['field'](_0x3afe('0x82'));_0x272899[_0x3afe('0x42')](_0x3afe('0x83'));_0x272899[_0x3afe('0x42')](_0x3afe('0x84'));_0x272899['field'](_0x3afe('0x85'));_0x272899[_0x3afe('0x42')](_0x3afe('0x86'));_0x272899['field'](_0x3afe('0x87'));_0x272899[_0x3afe('0x42')](_0x3afe('0x88'));_0x272899[_0x3afe('0x42')]('c.deletedAt');_0x272899['field'](_0x3afe('0x89'),'TagIds');}if(_0x95d37[_0x3afe('0x21')])_0x272899[_0x3afe('0x21')](_0x95d37['limit']);if(_0x95d37['offset'])_0x272899['offset'](_0x95d37['offset']);return db[_0x3afe('0x7e')]['query'](_0x272899[_0x3afe('0x8a')](),_0xa77d26);})[_0x3afe('0x28')](function(_0x43c41a){_0x43c41a[_0x3afe('0x61')](function(_0x532801){if(_0x532801[_0x3afe('0x8b')]){_0x532801['Tags']=[];_0x532801[_0x3afe('0x8b')][_0x3afe('0x55')](',')[_0x3afe('0x61')](function(_0x534199){_0x532801['Tags'][_0x3afe('0x32')](_0x39a10f[_0x534199]);});}delete _0x532801[_0x3afe('0x8b')];});_0x5e3cd1[_0x3afe('0x8c')]=_0x43c41a;return _0x5e3cd1;})['then'](respondWithFilteredResult(_0xe47f9e,_0x95d37));});})[_0x3afe('0x8d')](handleError(_0xe47f9e,null));};exports[_0x3afe('0x8e')]=function(_0x47d013,_0x212635){return db[_0x3afe('0x81')][_0x3afe('0x52')]({'where':{'id':_0x47d013['params']['id']}})[_0x3afe('0x28')](handleEntityNotFound(_0x212635,null))[_0x3afe('0x28')](removeEntity(_0x212635,null))[_0x3afe('0x8d')](handleError(_0x212635,null));};exports[_0x3afe('0x8f')]=function(_0x403a2b,_0x218bd6){return db[_0x3afe('0x81')][_0x3afe('0x8f')]()[_0x3afe('0x28')](function(_0x50e6d9){delete _0x50e6d9[_0x3afe('0x90')];for(var _0x538442=0x0;_0x538442{}\s\\|]/g,'-');_0x25b6b6(null,util[_0xb814('0x21')](_0xb814('0x22'),path[_0xb814('0x23')](_0x24211d[_0xb814('0x20')],path[_0xb814('0x24')](_0x24211d[_0xb814('0x20')])),Date[_0xb814('0x25')](),path['extname'](_0x24211d[_0xb814('0x20')])));}})});router['post'](_0xb814('0x26'),upload[_0xb814('0x27')](_0xb814('0x28')),controller[_0xb814('0x29')]);var upload=multer({'storage':multer[_0xb814('0x1e')]({'destination':function(_0xb9e57d,_0x3d836c,_0x5755ea){_0x5755ea(null,path[_0xb814('0x1f')](config[_0xb814('0x2a')],_0xb814('0x2b')));},'filename':function(_0x349394,_0x32ed56,_0x1d5965){_0x32ed56[_0xb814('0x20')]=_0x32ed56[_0xb814('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d5965(null,util[_0xb814('0x21')](_0xb814('0x22'),path['basename'](_0x32ed56[_0xb814('0x20')],path[_0xb814('0x24')](_0x32ed56[_0xb814('0x20')])),Date['now'](),path[_0xb814('0x24')](_0x32ed56[_0xb814('0x20')])));}})});router['post'](_0xb814('0x2c'),upload['single'](_0xb814('0x28')),controller['upload']);router['post'](_0xb814('0x2d'),auth['isAuthenticated'](),controller[_0xb814('0x2e')]);router[_0xb814('0x2f')](_0xb814('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb814('0x30')](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x31')]);module[_0xb814('0x32')]=router; \ No newline at end of file +var _0x3e74=['/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','merge','post','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','now','single','file','format','/upload','upload','/upload/:id','import','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','describe','/:id','getTags','/:id/hopper_histories','getHopperHistories'];(function(_0x3a1103,_0x442185){var _0x3aa5cd=function(_0x18b03e){while(--_0x18b03e){_0x3a1103['push'](_0x3a1103['shift']());}};_0x3aa5cd(++_0x442185);}(_0x3e74,0x175));var _0x43e7=function(_0x54ee90,_0x57d3c7){_0x54ee90=_0x54ee90-0x0;var _0x4203f0=_0x3e74[_0x54ee90];return _0x4203f0;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/tags',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/:id/hoppers',auth[_0x43e7('0x7')](),controller['getHoppers']);router[_0x43e7('0x6')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router[_0x43e7('0x6')](_0x43e7('0xe'),auth[_0x43e7('0x7')](),controller['getHopperFinals']);router['get'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['post']('/merge',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x7')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x14')]);router['post']('/:id/tags',auth[_0x43e7('0x7')](),controller[_0x43e7('0x15')]);var upload=multer({'storage':multer[_0x43e7('0x16')]({'destination':function(_0x140657,_0x3776f5,_0x1f24fb){_0x1f24fb(null,path[_0x43e7('0x17')](config[_0x43e7('0x18')],_0x43e7('0x19')));},'filename':function(_0xab63cf,_0x191dd5,_0x177ee1){_0x191dd5['originalname']=_0x191dd5[_0x43e7('0x1a')][_0x43e7('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x177ee1(null,util['format'](_0x43e7('0x1c'),path[_0x43e7('0x1d')](_0x191dd5[_0x43e7('0x1a')],path[_0x43e7('0x1e')](_0x191dd5[_0x43e7('0x1a')])),Date[_0x43e7('0x1f')](),path['extname'](_0x191dd5[_0x43e7('0x1a')])));}})});router['post']('/csv',upload[_0x43e7('0x20')](_0x43e7('0x21')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x43e7('0x16')]({'destination':function(_0x4ca5cf,_0x326dab,_0x5c5e67){_0x5c5e67(null,path[_0x43e7('0x17')](config[_0x43e7('0x18')],_0x43e7('0x19')));},'filename':function(_0x405f85,_0x51f4d7,_0x52b7b3){_0x51f4d7[_0x43e7('0x1a')]=_0x51f4d7['originalname'][_0x43e7('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52b7b3(null,util[_0x43e7('0x22')](_0x43e7('0x1c'),path[_0x43e7('0x1d')](_0x51f4d7['originalname'],path[_0x43e7('0x1e')](_0x51f4d7[_0x43e7('0x1a')])),Date[_0x43e7('0x1f')](),path[_0x43e7('0x1e')](_0x51f4d7[_0x43e7('0x1a')])));}})});router[_0x43e7('0x12')](_0x43e7('0x23'),upload[_0x43e7('0x20')](_0x43e7('0x21')),controller[_0x43e7('0x24')]);router[_0x43e7('0x12')](_0x43e7('0x25'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x26')]);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x27')]);router[_0x43e7('0x28')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0x29')]);module[_0x43e7('0x2a')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index f84da9b..3004bb4 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 _0x21ec=['setDataValue','alias','getDataValue','TEXT','long','type','values','stringify','BOOLEAN','sequelize','exports','VIRTUAL','STRING'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x21ec,0x141));var _0xc21e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x21ec[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0xc21e('0x0'));var _=require('lodash');module[_0xc21e('0x1')]={'name':{'type':Sequelize[_0xc21e('0x2')],'get':function(_0x103d5f){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xc21e('0x3')],'allowNull':![],'set':function(_0xae6222){this[_0xc21e('0x4')](_0xc21e('0x5'),_0xae6222?_0xae6222:this[_0xc21e('0x6')]('name'));}},'type':{'type':Sequelize[_0xc21e('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xc21e('0x7')](_0xc21e('0x8')),'get':function(){if(this[_0xc21e('0x6')](_0xc21e('0x9'))==='select'){return JSON['parse'](this[_0xc21e('0x6')]('values'));}else{return this[_0xc21e('0x6')](_0xc21e('0xa'));}},'set':function(_0x10d4dc){if(Array['isArray'](_0x10d4dc)){this[_0xc21e('0x4')](_0xc21e('0xa'),JSON[_0xc21e('0xb')](_0x10d4dc));}else{this['setDataValue'](_0xc21e('0xa'),_0x10d4dc);}}},'required':{'type':Sequelize[_0xc21e('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0xbd16=['stringify','sequelize','exports','STRING','alias','getDataValue','TEXT','long','type','select','parse','values','isArray','setDataValue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbd16,0x119));var _0x6bd1=function(_0x1e593b,_0xd65bb4){_0x1e593b=_0x1e593b-0x0;var _0x437960=_0xbd16[_0x1e593b];return _0x437960;};'use strict';var Sequelize=require(_0x6bd1('0x0'));var _=require('lodash');module[_0x6bd1('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x21673b){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0x6bd1('0x2')],'allowNull':![],'set':function(_0x20864f){this['setDataValue'](_0x6bd1('0x3'),_0x20864f?_0x20864f:this[_0x6bd1('0x4')]('name'));}},'type':{'type':Sequelize[_0x6bd1('0x2')],'allowNull':![]},'values':{'type':Sequelize[_0x6bd1('0x5')](_0x6bd1('0x6')),'get':function(){if(this[_0x6bd1('0x4')](_0x6bd1('0x7'))===_0x6bd1('0x8')){return JSON[_0x6bd1('0x9')](this[_0x6bd1('0x4')](_0x6bd1('0xa')));}else{return this['getDataValue'](_0x6bd1('0xa'));}},'set':function(_0x9c7089){if(Array[_0x6bd1('0xb')](_0x9c7089)){this[_0x6bd1('0xc')](_0x6bd1('0xa'),JSON[_0x6bd1('0xd')](_0x9c7089));}else{this[_0x6bd1('0xc')]('values',_0x9c7089);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 857b577..a751d6b 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 _0x21d0=['includeAll','include','rows','catch','show','params','keys','fields','find','update','body','destroy','create','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','error','name','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','attributes','length','model','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x21d0,0x1bb));var _0x021d=function(_0x834ab7,_0x2a0429){_0x834ab7=_0x834ab7-0x0;var _0x5eddc5=_0x21d0[_0x834ab7];return _0x5eddc5;};'use strict';var pdf=require(_0x021d('0x0'));var emlformat=require(_0x021d('0x1'));var rimraf=require(_0x021d('0x2'));var zipdir=require(_0x021d('0x3'));var jsonpatch=require(_0x021d('0x4'));var rp=require(_0x021d('0x5'));var moment=require(_0x021d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x021d('0x7'));var util=require(_0x021d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x021d('0x9'));var ejs=require(_0x021d('0xa'));var fs=require('fs');var _=require(_0x021d('0xb'));var squel=require('squel');var crypto=require(_0x021d('0xc'));var jsforce=require(_0x021d('0xd'));var deskjs=require(_0x021d('0xe'));var toCsv=require(_0x021d('0x9'));var querystring=require(_0x021d('0xf'));var Papa=require(_0x021d('0x10'));var Redis=require('ioredis');var authService=require(_0x021d('0x11'));var qs=require(_0x021d('0x12'));var as=require(_0x021d('0x13'));var hardwareService=require(_0x021d('0x14'));var logger=require(_0x021d('0x15'))(_0x021d('0x16'));var utils=require(_0x021d('0x17'));var config=require('../../config/environment');var db=require(_0x021d('0x18'))['db'];function respondWithStatusCode(_0x234c65,_0x4cabbc){_0x4cabbc=_0x4cabbc||0xcc;return function(_0x5d7a75){if(_0x5d7a75){return _0x234c65[_0x021d('0x19')](_0x4cabbc);}return _0x234c65[_0x021d('0x1a')](_0x4cabbc)[_0x021d('0x1b')]();};}function respondWithResult(_0xfa0648,_0x291805){_0x291805=_0x291805||0xc8;return function(_0x3e7b6f){if(_0x3e7b6f){return _0xfa0648[_0x021d('0x1a')](_0x291805)['json'](_0x3e7b6f);}};}function respondWithFilteredResult(_0x1daaba,_0x1fd340){return function(_0x41cefb){if(_0x41cefb){var _0x4ce539=_0x41cefb[_0x021d('0x1c')],_0xd28d30=_0x1fd340['offset'],_0x3bc855=_0x1fd340[_0x021d('0x1d')]+_0x1fd340[_0x021d('0x1e')],_0x5eca3b;if(_0x3bc855>=_0x4ce539){_0x3bc855=_0x4ce539;_0x5eca3b=0xc8;}else{_0x5eca3b=0xce;}_0x1daaba[_0x021d('0x1a')](_0x5eca3b);return _0x1daaba[_0x021d('0x1f')](_0x021d('0x20'),_0xd28d30+'-'+_0x3bc855+'/'+_0x4ce539)[_0x021d('0x21')](_0x41cefb);}return null;};}function patchUpdates(_0x578933){return function(_0x53be86){try{jsonpatch[_0x021d('0x22')](_0x53be86,_0x578933,!![]);}catch(_0xd55e01){return BPromise[_0x021d('0x23')](_0xd55e01);}return _0x53be86[_0x021d('0x24')]();};}function saveUpdates(_0x31d575,_0x12b79d){return function(_0x594385){if(_0x594385){return _0x594385['update'](_0x31d575)[_0x021d('0x25')](function(_0x4ca8dd){return _0x4ca8dd;});}return null;};}function removeEntity(_0x3703f3,_0x56f60d){return function(_0x1038c5){if(_0x1038c5){return _0x1038c5['destroy']()[_0x021d('0x25')](function(){_0x3703f3[_0x021d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22427c,_0x5dfce4){return function(_0x32a48e){if(!_0x32a48e){_0x22427c[_0x021d('0x19')](0x194);}return _0x32a48e;};}function handleError(_0x209ccb,_0x32d1db){_0x32d1db=_0x32d1db||0x1f4;return function(_0x86b3d0){logger[_0x021d('0x26')](_0x86b3d0['stack']);if(_0x86b3d0[_0x021d('0x27')]){delete _0x86b3d0[_0x021d('0x27')];}_0x209ccb[_0x021d('0x1a')](_0x32d1db)['send'](_0x86b3d0);};}exports['index']=function(_0x494d9a,_0x4b6426){var _0x528fe1={},_0x5c54d5={},_0x5e31b4={'count':0x0,'rows':[]};var _0x59b6c1=_[_0x021d('0x28')](db[_0x021d('0x29')][_0x021d('0x2a')],function(_0x2ded4d){return{'name':_0x2ded4d[_0x021d('0x2b')],'type':_0x2ded4d[_0x021d('0x2c')][_0x021d('0x2d')]};});_0x5c54d5['model']=_[_0x021d('0x2e')](_['map'](_0x59b6c1,_0x021d('0x27')),['name']);_0x5c54d5[_0x021d('0x2f')]=_['keys'](_0x494d9a['query']);_0x5c54d5[_0x021d('0x30')]=_[_0x021d('0x31')](_0x5c54d5['model'],_0x5c54d5[_0x021d('0x2f')]);_0x528fe1[_0x021d('0x32')]=_[_0x021d('0x31')](_0x5c54d5['model'],qs['fields'](_0x494d9a[_0x021d('0x2f')]['fields']));_0x528fe1[_0x021d('0x32')]=_0x528fe1['attributes'][_0x021d('0x33')]?_0x528fe1[_0x021d('0x32')]:_0x5c54d5[_0x021d('0x34')];if(!_0x494d9a['query']['hasOwnProperty']('nolimit')){_0x528fe1['limit']=qs['limit'](_0x494d9a[_0x021d('0x2f')]['limit']);_0x528fe1[_0x021d('0x1d')]=qs[_0x021d('0x1d')](_0x494d9a[_0x021d('0x2f')][_0x021d('0x1d')]);}_0x528fe1[_0x021d('0x35')]=qs[_0x021d('0x36')](_0x494d9a[_0x021d('0x2f')][_0x021d('0x36')]);_0x528fe1[_0x021d('0x37')]=qs[_0x021d('0x30')](_[_0x021d('0x38')](_0x494d9a[_0x021d('0x2f')],_0x5c54d5['filters']));if(_0x494d9a[_0x021d('0x2f')][_0x021d('0x39')]){_0x528fe1['where']=_[_0x021d('0x3a')](_0x528fe1[_0x021d('0x37')],{'$or':_[_0x021d('0x28')](_0x59b6c1,function(_0x173b3f){if(_0x173b3f['type']!==_0x021d('0x3b')){var _0x1b4da8={};_0x1b4da8[_0x173b3f['name']]={'$like':'%'+_0x494d9a[_0x021d('0x2f')]['filter']+'%'};return _0x1b4da8;}})});}_0x528fe1=_[_0x021d('0x3a')]({},_0x528fe1,_0x494d9a[_0x021d('0x3c')]);var _0x4f2f18={'where':_0x528fe1[_0x021d('0x37')]};return db[_0x021d('0x29')][_0x021d('0x1c')](_0x4f2f18)[_0x021d('0x25')](function(_0x5b5e95){_0x5e31b4[_0x021d('0x1c')]=_0x5b5e95;if(_0x494d9a[_0x021d('0x2f')][_0x021d('0x3d')]){_0x528fe1[_0x021d('0x3e')]=[{'all':!![]}];}return db[_0x021d('0x29')]['findAll'](_0x528fe1);})[_0x021d('0x25')](function(_0x3f5b86){_0x5e31b4[_0x021d('0x3f')]=_0x3f5b86;return _0x5e31b4;})['then'](respondWithFilteredResult(_0x4b6426,_0x528fe1))[_0x021d('0x40')](handleError(_0x4b6426,null));};exports[_0x021d('0x41')]=function(_0x17418a,_0x44595f){var _0x33f1a8={'raw':!![],'where':{'id':_0x17418a[_0x021d('0x42')]['id']}},_0xa68299={};_0xa68299[_0x021d('0x34')]=_[_0x021d('0x43')](db[_0x021d('0x29')][_0x021d('0x2a')]);_0xa68299['query']=_['keys'](_0x17418a[_0x021d('0x2f')]);_0xa68299['filters']=_['intersection'](_0xa68299['model'],_0xa68299[_0x021d('0x2f')]);_0x33f1a8[_0x021d('0x32')]=_['intersection'](_0xa68299[_0x021d('0x34')],qs[_0x021d('0x44')](_0x17418a[_0x021d('0x2f')][_0x021d('0x44')]));_0x33f1a8[_0x021d('0x32')]=_0x33f1a8['attributes']['length']?_0x33f1a8['attributes']:_0xa68299[_0x021d('0x34')];if(_0x17418a[_0x021d('0x2f')]['includeAll']){_0x33f1a8[_0x021d('0x3e')]=[{'all':!![]}];}_0x33f1a8=_[_0x021d('0x3a')]({},_0x33f1a8,_0x17418a[_0x021d('0x3c')]);return db['CmCustomField'][_0x021d('0x45')](_0x33f1a8)['then'](handleEntityNotFound(_0x44595f,null))[_0x021d('0x25')](respondWithResult(_0x44595f,null))[_0x021d('0x40')](handleError(_0x44595f,null));};exports[_0x021d('0x46')]=function(_0x4285fa,_0xc7824b){if(_0x4285fa[_0x021d('0x47')]['id']){delete _0x4285fa[_0x021d('0x47')]['id'];}return db['CmCustomField'][_0x021d('0x45')]({'where':{'id':_0x4285fa['params']['id']}})[_0x021d('0x25')](handleEntityNotFound(_0xc7824b,null))['then'](saveUpdates(_0x4285fa[_0x021d('0x47')],null))['then'](respondWithResult(_0xc7824b,null))[_0x021d('0x40')](handleError(_0xc7824b,null));};exports[_0x021d('0x48')]=function(_0x2cb002,_0x97ba04){return db[_0x021d('0x29')][_0x021d('0x45')]({'where':{'id':_0x2cb002[_0x021d('0x42')]['id']}})[_0x021d('0x25')](handleEntityNotFound(_0x97ba04,null))['then'](removeEntity(_0x97ba04,null))['catch'](handleError(_0x97ba04,null));};exports[_0x021d('0x49')]=function(_0x2adb4f,_0xdc0a01){var _0x311a5c;return db['sequelize']['transaction'](function(_0x5507e1){return db[_0x021d('0x29')][_0x021d('0x49')](_0x2adb4f['body'],{'transaction':_0x5507e1})[_0x021d('0x25')](function(_0x1f28a7){_0x311a5c=_0x1f28a7;var _0x2d830c={'type':db[_0x021d('0x4a')][_0x021d('0x4b')],'transaction':_0x5507e1};switch(_0x2adb4f[_0x021d('0x47')][_0x021d('0x2c')]){case'text':_0x2d830c[_0x021d('0x2c')]=db[_0x021d('0x4a')][_0x021d('0x4b')];break;case'number':_0x2d830c['type']=db[_0x021d('0x4a')][_0x021d('0x4c')];break;case _0x021d('0x4d'):_0x2d830c['type']=db[_0x021d('0x4a')][_0x021d('0x4e')];_0x2d830c[_0x021d('0x4f')]=![];break;default:}return db[_0x021d('0x50')][_0x021d('0x51')][_0x021d('0x52')]('cm_contacts',util['format'](_0x021d('0x53'),_0x311a5c['id']),_0x2d830c);})[_0x021d('0x25')](function(){return _0x311a5c;});})['then'](respondWithResult(_0xdc0a01,0xc9))[_0x021d('0x40')](handleError(_0xdc0a01,null));}; \ No newline at end of file +var _0x6870=['json','apply','save','then','destroy','end','sendStatus','error','name','send','index','map','CmCustomField','fieldName','key','model','differenceBy','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','include','update','body','find','sequelize','create','Sequelize','text','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x6870,0x198));var _0x0687=function(_0x45b4d9,_0x6228b9){_0x45b4d9=_0x45b4d9-0x0;var _0x54ae0e=_0x6870[_0x45b4d9];return _0x54ae0e;};'use strict';var pdf=require(_0x0687('0x0'));var emlformat=require(_0x0687('0x1'));var rimraf=require(_0x0687('0x2'));var zipdir=require(_0x0687('0x3'));var jsonpatch=require(_0x0687('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0687('0x5'));var Mustache=require(_0x0687('0x6'));var util=require(_0x0687('0x7'));var path=require(_0x0687('0x8'));var sox=require(_0x0687('0x9'));var csv=require(_0x0687('0xa'));var ejs=require(_0x0687('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0687('0xc'));var crypto=require(_0x0687('0xd'));var jsforce=require(_0x0687('0xe'));var deskjs=require(_0x0687('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0687('0x10'));var Papa=require('papaparse');var Redis=require(_0x0687('0x11'));var authService=require(_0x0687('0x12'));var qs=require(_0x0687('0x13'));var as=require(_0x0687('0x14'));var hardwareService=require(_0x0687('0x15'));var logger=require(_0x0687('0x16'))('api');var utils=require(_0x0687('0x17'));var config=require(_0x0687('0x18'));var db=require(_0x0687('0x19'))['db'];function respondWithStatusCode(_0x20496d,_0x1d621d){_0x1d621d=_0x1d621d||0xcc;return function(_0x503a3d){if(_0x503a3d){return _0x20496d['sendStatus'](_0x1d621d);}return _0x20496d[_0x0687('0x1a')](_0x1d621d)['end']();};}function respondWithResult(_0x5edd4e,_0x1f9ae0){_0x1f9ae0=_0x1f9ae0||0xc8;return function(_0xbc7198){if(_0xbc7198){return _0x5edd4e[_0x0687('0x1a')](_0x1f9ae0)['json'](_0xbc7198);}};}function respondWithFilteredResult(_0x22ff16,_0x2c17f0){return function(_0x2e71ce){if(_0x2e71ce){var _0x1bfc43=_0x2e71ce[_0x0687('0x1b')],_0x56c576=_0x2c17f0['offset'],_0x204d36=_0x2c17f0[_0x0687('0x1c')]+_0x2c17f0[_0x0687('0x1d')],_0x5ebb51;if(_0x204d36>=_0x1bfc43){_0x204d36=_0x1bfc43;_0x5ebb51=0xc8;}else{_0x5ebb51=0xce;}_0x22ff16[_0x0687('0x1a')](_0x5ebb51);return _0x22ff16[_0x0687('0x1e')](_0x0687('0x1f'),_0x56c576+'-'+_0x204d36+'/'+_0x1bfc43)[_0x0687('0x20')](_0x2e71ce);}return null;};}function patchUpdates(_0x2dd9a0){return function(_0x25c71d){try{jsonpatch[_0x0687('0x21')](_0x25c71d,_0x2dd9a0,!![]);}catch(_0x6ef94){return BPromise['reject'](_0x6ef94);}return _0x25c71d[_0x0687('0x22')]();};}function saveUpdates(_0xa1d41d,_0x7988c1){return function(_0x10fe06){if(_0x10fe06){return _0x10fe06['update'](_0xa1d41d)[_0x0687('0x23')](function(_0x218116){return _0x218116;});}return null;};}function removeEntity(_0x47b255,_0x1fda04){return function(_0x1deeec){if(_0x1deeec){return _0x1deeec[_0x0687('0x24')]()[_0x0687('0x23')](function(){_0x47b255[_0x0687('0x1a')](0xcc)[_0x0687('0x25')]();});}};}function handleEntityNotFound(_0x14da1c,_0x24cb9f){return function(_0xeb16c5){if(!_0xeb16c5){_0x14da1c[_0x0687('0x26')](0x194);}return _0xeb16c5;};}function handleError(_0x448866,_0x4d8a22){_0x4d8a22=_0x4d8a22||0x1f4;return function(_0x5f563b){logger[_0x0687('0x27')](_0x5f563b['stack']);if(_0x5f563b[_0x0687('0x28')]){delete _0x5f563b[_0x0687('0x28')];}_0x448866[_0x0687('0x1a')](_0x4d8a22)[_0x0687('0x29')](_0x5f563b);};}exports[_0x0687('0x2a')]=function(_0x5ebd4a,_0x16aeba){var _0x2f925a={},_0xaadc3b={},_0x4c7e57={'count':0x0,'rows':[]};var _0x4b1bc6=_[_0x0687('0x2b')](db[_0x0687('0x2c')]['rawAttributes'],function(_0x402486){return{'name':_0x402486[_0x0687('0x2d')],'type':_0x402486['type'][_0x0687('0x2e')]};});_0xaadc3b[_0x0687('0x2f')]=_[_0x0687('0x30')](_[_0x0687('0x2b')](_0x4b1bc6,_0x0687('0x28')),[_0x0687('0x28')]);_0xaadc3b[_0x0687('0x31')]=_[_0x0687('0x32')](_0x5ebd4a[_0x0687('0x31')]);_0xaadc3b[_0x0687('0x33')]=_[_0x0687('0x34')](_0xaadc3b[_0x0687('0x2f')],_0xaadc3b[_0x0687('0x31')]);_0x2f925a['attributes']=_[_0x0687('0x34')](_0xaadc3b[_0x0687('0x2f')],qs['fields'](_0x5ebd4a['query'][_0x0687('0x35')]));_0x2f925a[_0x0687('0x36')]=_0x2f925a[_0x0687('0x36')][_0x0687('0x37')]?_0x2f925a[_0x0687('0x36')]:_0xaadc3b[_0x0687('0x2f')];if(!_0x5ebd4a['query'][_0x0687('0x38')](_0x0687('0x39'))){_0x2f925a['limit']=qs[_0x0687('0x1d')](_0x5ebd4a[_0x0687('0x31')]['limit']);_0x2f925a['offset']=qs[_0x0687('0x1c')](_0x5ebd4a[_0x0687('0x31')]['offset']);}_0x2f925a[_0x0687('0x3a')]=qs[_0x0687('0x3b')](_0x5ebd4a[_0x0687('0x31')][_0x0687('0x3b')]);_0x2f925a[_0x0687('0x3c')]=qs['filters'](_[_0x0687('0x3d')](_0x5ebd4a[_0x0687('0x31')],_0xaadc3b[_0x0687('0x33')]));if(_0x5ebd4a[_0x0687('0x31')][_0x0687('0x3e')]){_0x2f925a[_0x0687('0x3c')]=_[_0x0687('0x3f')](_0x2f925a['where'],{'$or':_['map'](_0x4b1bc6,function(_0x3f4e36){if(_0x3f4e36[_0x0687('0x40')]!==_0x0687('0x41')){var _0x512537={};_0x512537[_0x3f4e36[_0x0687('0x28')]]={'$like':'%'+_0x5ebd4a[_0x0687('0x31')]['filter']+'%'};return _0x512537;}})});}_0x2f925a=_[_0x0687('0x3f')]({},_0x2f925a,_0x5ebd4a[_0x0687('0x42')]);var _0x43f207={'where':_0x2f925a[_0x0687('0x3c')]};return db['CmCustomField'][_0x0687('0x1b')](_0x43f207)[_0x0687('0x23')](function(_0x26a391){_0x4c7e57[_0x0687('0x1b')]=_0x26a391;if(_0x5ebd4a['query'][_0x0687('0x43')]){_0x2f925a['include']=[{'all':!![]}];}return db[_0x0687('0x2c')][_0x0687('0x44')](_0x2f925a);})[_0x0687('0x23')](function(_0x2bf843){_0x4c7e57['rows']=_0x2bf843;return _0x4c7e57;})[_0x0687('0x23')](respondWithFilteredResult(_0x16aeba,_0x2f925a))[_0x0687('0x45')](handleError(_0x16aeba,null));};exports[_0x0687('0x46')]=function(_0x41e574,_0x54fd40){var _0xe916d5={'raw':!![],'where':{'id':_0x41e574[_0x0687('0x47')]['id']}},_0x1c6d1b={};_0x1c6d1b[_0x0687('0x2f')]=_['keys'](db[_0x0687('0x2c')]['rawAttributes']);_0x1c6d1b[_0x0687('0x31')]=_[_0x0687('0x32')](_0x41e574['query']);_0x1c6d1b[_0x0687('0x33')]=_['intersection'](_0x1c6d1b[_0x0687('0x2f')],_0x1c6d1b[_0x0687('0x31')]);_0xe916d5[_0x0687('0x36')]=_[_0x0687('0x34')](_0x1c6d1b[_0x0687('0x2f')],qs[_0x0687('0x35')](_0x41e574[_0x0687('0x31')][_0x0687('0x35')]));_0xe916d5[_0x0687('0x36')]=_0xe916d5[_0x0687('0x36')][_0x0687('0x37')]?_0xe916d5[_0x0687('0x36')]:_0x1c6d1b['model'];if(_0x41e574[_0x0687('0x31')][_0x0687('0x43')]){_0xe916d5[_0x0687('0x48')]=[{'all':!![]}];}_0xe916d5=_[_0x0687('0x3f')]({},_0xe916d5,_0x41e574[_0x0687('0x42')]);return db[_0x0687('0x2c')]['find'](_0xe916d5)['then'](handleEntityNotFound(_0x54fd40,null))[_0x0687('0x23')](respondWithResult(_0x54fd40,null))[_0x0687('0x45')](handleError(_0x54fd40,null));};exports[_0x0687('0x49')]=function(_0xceaf7c,_0x58e2fa){if(_0xceaf7c['body']['id']){delete _0xceaf7c[_0x0687('0x4a')]['id'];}return db[_0x0687('0x2c')][_0x0687('0x4b')]({'where':{'id':_0xceaf7c[_0x0687('0x47')]['id']}})[_0x0687('0x23')](handleEntityNotFound(_0x58e2fa,null))[_0x0687('0x23')](saveUpdates(_0xceaf7c[_0x0687('0x4a')],null))[_0x0687('0x23')](respondWithResult(_0x58e2fa,null))['catch'](handleError(_0x58e2fa,null));};exports[_0x0687('0x24')]=function(_0x181268,_0x30bd0c){return db['CmCustomField']['find']({'where':{'id':_0x181268[_0x0687('0x47')]['id']}})[_0x0687('0x23')](handleEntityNotFound(_0x30bd0c,null))[_0x0687('0x23')](removeEntity(_0x30bd0c,null))['catch'](handleError(_0x30bd0c,null));};exports['create']=function(_0x42a4b8,_0x23a84f){var _0x3e9c61;return db[_0x0687('0x4c')]['transaction'](function(_0x489b7d){return db['CmCustomField'][_0x0687('0x4d')](_0x42a4b8[_0x0687('0x4a')],{'transaction':_0x489b7d})[_0x0687('0x23')](function(_0x561f51){_0x3e9c61=_0x561f51;var _0x198a54={'type':db[_0x0687('0x4e')]['TEXT'],'transaction':_0x489b7d};switch(_0x42a4b8['body']['type']){case _0x0687('0x4f'):_0x198a54['type']=db[_0x0687('0x4e')]['TEXT'];break;case _0x0687('0x50'):_0x198a54['type']=db[_0x0687('0x4e')][_0x0687('0x51')];break;case _0x0687('0x52'):_0x198a54[_0x0687('0x40')]=db[_0x0687('0x4e')][_0x0687('0x53')];_0x198a54[_0x0687('0x54')]=![];break;default:}return db[_0x0687('0x4c')]['queryInterface'][_0x0687('0x55')](_0x0687('0x56'),util['format'](_0x0687('0x57'),_0x3e9c61['id']),_0x198a54);})[_0x0687('0x23')](function(){return _0x3e9c61;});})[_0x0687('0x23')](respondWithResult(_0x23a84f,0xc9))[_0x0687('0x45')](handleError(_0x23a84f,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 0b1405d..b2f2ff3 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 _0x7e87=['bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','util','../../config/logger','api','moment'];(function(_0x399d76,_0xdc4493){var _0x3b19a1=function(_0x262225){while(--_0x262225){_0x399d76['push'](_0x399d76['shift']());}};_0x3b19a1(++_0xdc4493);}(_0x7e87,0x172));var _0x77e8=function(_0x1e673c,_0x2e530a){_0x1e673c=_0x1e673c-0x0;var _0x2da34d=_0x7e87[_0x1e673c];return _0x2da34d;};'use strict';var _=require('lodash');var util=require(_0x77e8('0x0'));var logger=require(_0x77e8('0x1'))(_0x77e8('0x2'));var moment=require(_0x77e8('0x3'));var BPromise=require(_0x77e8('0x4'));var rp=require(_0x77e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77e8('0x6'));var config=require(_0x77e8('0x7'));var attributes=require(_0x77e8('0x8'));module[_0x77e8('0x9')]=function(_0x229510,_0x415a0){return _0x229510['define'](_0x77e8('0xa'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ccd=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api','moment','bluebird'];(function(_0x30f9d1,_0xae025e){var _0x340655=function(_0x538902){while(--_0x538902){_0x30f9d1['push'](_0x30f9d1['shift']());}};_0x340655(++_0xae025e);}(_0x5ccd,0x1d7));var _0xd5cc=function(_0xcdac34,_0x43f665){_0xcdac34=_0xcdac34-0x0;var _0x269d23=_0x5ccd[_0xcdac34];return _0x269d23;};'use strict';var _=require(_0xd5cc('0x0'));var util=require('util');var logger=require(_0xd5cc('0x1'))(_0xd5cc('0x2'));var moment=require(_0xd5cc('0x3'));var BPromise=require(_0xd5cc('0x4'));var rp=require(_0xd5cc('0x5'));var fs=require('fs');var path=require(_0xd5cc('0x6'));var rimraf=require(_0xd5cc('0x7'));var config=require(_0xd5cc('0x8'));var attributes=require(_0xd5cc('0x9'));module[_0xd5cc('0xa')]=function(_0x317552,_0x4ebba3){return _0x317552[_0xd5cc('0xb')](_0xd5cc('0xc'),attributes,{'tableName':_0xd5cc('0xd'),'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 89e0caa..d9de8f1 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 _0xb49a=['info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x28208f,_0x7f5ff2){var _0x16e45f=function(_0x303e15){while(--_0x303e15){_0x28208f['push'](_0x28208f['shift']());}};_0x16e45f(++_0x7f5ff2);}(_0xb49a,0xfb));var _0xab49=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0xb49a[_0x55e839];return _0x39c61a;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require(_0xab49('0x3'));var rs=require(_0xab49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab49('0x5'))['db'];var utils=require(_0xab49('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xab49('0x7'));var jayson=require(_0xab49('0x8'));var client=jayson[_0xab49('0x9')][_0xab49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ea72,_0x26a98a,_0xd86a5){return new BPromise(function(_0x4d4d00,_0x15f259){return client[_0xab49('0xb')](_0x57ea72,_0xd86a5)[_0xab49('0xc')](function(_0x79f764){logger[_0xab49('0xd')]('CmCustomField,\x20%s,\x20%s',_0x26a98a,'request\x20sent');logger[_0xab49('0xe')](_0xab49('0xf'),_0x26a98a,_0xab49('0x10'),JSON[_0xab49('0x11')](_0x79f764));if(_0x79f764[_0xab49('0x12')]){if(_0x79f764['error'][_0xab49('0x13')]===0x1f4){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x15f259(_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);}logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x4d4d00(_0x79f764['error'][_0xab49('0x15')]);}else{logger[_0xab49('0xd')](_0xab49('0x14'),_0x26a98a,_0xab49('0x10'));_0x4d4d00(_0x79f764[_0xab49('0x16')]['message']);}})[_0xab49('0x17')](function(_0x2cbcff){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x2cbcff);_0x15f259(_0x2cbcff);});});} \ No newline at end of file +var _0xc6d8=['debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','CmCustomField,\x20%s,\x20%s','request\x20sent'];(function(_0x3a93cf,_0x3a1dee){var _0xd77a9a=function(_0x285aa7){while(--_0x285aa7){_0x3a93cf['push'](_0x3a93cf['shift']());}};_0xd77a9a(++_0x3a1dee);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x2cbfcc,_0x41c929){_0x2cbfcc=_0x2cbfcc-0x0;var _0x46dd12=_0xc6d8[_0x2cbfcc];return _0x46dd12;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('CmCustomField,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 96fd3be..f780746 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 _0x69db=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x5f4726,_0x1dad7c){var _0x18b4f3=function(_0x5de0a3){while(--_0x5de0a3){_0x5f4726['push'](_0x5f4726['shift']());}};_0x18b4f3(++_0x1dad7c);}(_0x69db,0xb4));var _0xb69d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x69db[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xb69d('0x0'));var util=require(_0xb69d('0x1'));var path=require(_0xb69d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb69d('0x3')]();var auth=require(_0xb69d('0x4'));var interaction=require(_0xb69d('0x5'));var config=require(_0xb69d('0x6'));var controller=require('./cmCustomField.controller');router[_0xb69d('0x7')]('/',auth[_0xb69d('0x8')](),controller[_0xb69d('0x9')]);router[_0xb69d('0x7')](_0xb69d('0xa'),auth[_0xb69d('0x8')](),controller['show']);router[_0xb69d('0xb')]('/',auth[_0xb69d('0x8')](),controller[_0xb69d('0xc')]);router[_0xb69d('0xd')](_0xb69d('0xa'),auth['isAuthenticated'](),controller[_0xb69d('0xe')]);router[_0xb69d('0xf')](_0xb69d('0xa'),auth[_0xb69d('0x8')](),controller[_0xb69d('0x10')]);module[_0xb69d('0x11')]=router; \ No newline at end of file +var _0x091a=['/:id','isAuthenticated','post','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x31b0f1,_0x1d55e1){var _0x2dc9f0=function(_0x991ff7){while(--_0x991ff7){_0x31b0f1['push'](_0x31b0f1['shift']());}};_0x2dc9f0(++_0x1d55e1);}(_0x091a,0xc3));var _0xa091=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x091a[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require(_0xa091('0x0'));var path=require(_0xa091('0x1'));var timeout=require('connect-timeout');var express=require(_0xa091('0x2'));var router=express[_0xa091('0x3')]();var auth=require(_0xa091('0x4'));var interaction=require(_0xa091('0x5'));var config=require(_0xa091('0x6'));var controller=require('./cmCustomField.controller');router[_0xa091('0x7')]('/',auth['isAuthenticated'](),controller[_0xa091('0x8')]);router['get'](_0xa091('0x9'),auth[_0xa091('0xa')](),controller['show']);router[_0xa091('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa091('0xc')](_0xa091('0x9'),auth[_0xa091('0xa')](),controller[_0xa091('0xd')]);router[_0xa091('0xe')](_0xa091('0x9'),auth[_0xa091('0xa')](),controller[_0xa091('0xf')]);module[_0xa091('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index b6cf886..3d402b4 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 _0x5fde=['UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x5fde,0x80));var _0xe5fd=function(_0x2782b5,_0x2f1395){_0x2782b5=_0x2782b5-0x0;var _0xcb276d=_0x5fde[_0x2782b5];return _0xcb276d;};'use strict';var moment=require(_0xe5fd('0x0'));var Sequelize=require(_0xe5fd('0x1'));module['exports']={'phone':{'type':Sequelize[_0xe5fd('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xe5fd('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe5fd('0x4')],'defaultValue':moment()['format'](_0xe5fd('0x5'))},'countbusyretry':{'type':Sequelize[_0xe5fd('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe5fd('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe5fd('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe5fd('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xe5fd('0x6')](0x2)[_0xe5fd('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe5fd('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe5fd('0x6')],'unique':_0xe5fd('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xe5fd('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xe5fd('0x6')],'unique':_0xe5fd('0x8')},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x6c8b=['contactListQueue','moment','sequelize','exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x38b642,_0x5c6bdd){var _0x480472=function(_0x1e7a0b){while(--_0x1e7a0b){_0x38b642['push'](_0x38b642['shift']());}};_0x480472(++_0x5c6bdd);}(_0x6c8b,0xa9));var _0xb6c8=function(_0x55f03b,_0x5ae3eb){_0x55f03b=_0x55f03b-0x0;var _0x5d63eb=_0x6c8b[_0x55f03b];return _0x5d63eb;};'use strict';var moment=require(_0xb6c8('0x0'));var Sequelize=require(_0xb6c8('0x1'));module[_0xb6c8('0x2')]={'phone':{'type':Sequelize[_0xb6c8('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb6c8('0x4')],'defaultValue':moment()['format'](_0xb6c8('0x5'))},'countbusyretry':{'type':Sequelize[_0xb6c8('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb6c8('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb6c8('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb6c8('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb6c8('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xb6c8('0x6')],'unique':_0xb6c8('0x7')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0xb6c8('0x6')],'unique':_0xb6c8('0x7')},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 763527b..7757362 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 _0x7de7=['$ne','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','update','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','ivr','CmContact','firstName','isNil','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','filters','intersection','concat','$gt','$gte','$lt','$lte'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7de7,0xee));var _0x77de=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0x7de7[_0x57b236];return _0x4feb29;};'use strict';var pdf=require(_0x77de('0x0'));var emlformat=require(_0x77de('0x1'));var rimraf=require(_0x77de('0x2'));var zipdir=require(_0x77de('0x3'));var jsonpatch=require(_0x77de('0x4'));var rp=require(_0x77de('0x5'));var moment=require(_0x77de('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x77de('0x7'));var util=require(_0x77de('0x8'));var path=require('path');var sox=require(_0x77de('0x9'));var csv=require('to-csv');var ejs=require(_0x77de('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x77de('0xb'));var deskjs=require(_0x77de('0xc'));var toCsv=require('to-csv');var querystring=require(_0x77de('0xd'));var Papa=require(_0x77de('0xe'));var Redis=require(_0x77de('0xf'));var authService=require(_0x77de('0x10'));var qs=require(_0x77de('0x11'));var as=require(_0x77de('0x12'));var hardwareService=require(_0x77de('0x13'));var logger=require(_0x77de('0x14'))(_0x77de('0x15'));var utils=require(_0x77de('0x16'));var config=require(_0x77de('0x17'));var db=require(_0x77de('0x18'))['db'];function respondWithStatusCode(_0x3544b3,_0x2fe4ea){_0x2fe4ea=_0x2fe4ea||0xcc;return function(_0x40cba8){if(_0x40cba8){return _0x3544b3[_0x77de('0x19')](_0x2fe4ea);}return _0x3544b3[_0x77de('0x1a')](_0x2fe4ea)[_0x77de('0x1b')]();};}function respondWithResult(_0x3b26cf,_0xf53ba7){_0xf53ba7=_0xf53ba7||0xc8;return function(_0x1a5759){if(_0x1a5759){return _0x3b26cf['status'](_0xf53ba7)[_0x77de('0x1c')](_0x1a5759);}};}function respondWithFilteredResult(_0x12d38f,_0x48e074){return function(_0x3d6887){if(_0x3d6887){var _0x5f5797=_0x3d6887[_0x77de('0x1d')],_0x22ee21=_0x48e074['offset'],_0x4ba536=_0x48e074[_0x77de('0x1e')]+_0x48e074[_0x77de('0x1f')],_0x40f797;if(_0x4ba536>=_0x5f5797){_0x4ba536=_0x5f5797;_0x40f797=0xc8;}else{_0x40f797=0xce;}_0x12d38f['status'](_0x40f797);return _0x12d38f['set'](_0x77de('0x20'),_0x22ee21+'-'+_0x4ba536+'/'+_0x5f5797)['json'](_0x3d6887);}return null;};}function patchUpdates(_0x551ddc){return function(_0x7e7cc5){try{jsonpatch['apply'](_0x7e7cc5,_0x551ddc,!![]);}catch(_0x58ef9c){return BPromise[_0x77de('0x21')](_0x58ef9c);}return _0x7e7cc5[_0x77de('0x22')]();};}function saveUpdates(_0x232379,_0xc469d8){return function(_0x1f073a){if(_0x1f073a){return _0x1f073a['update'](_0x232379)[_0x77de('0x23')](function(_0x3ef316){return _0x3ef316;});}return null;};}function removeEntity(_0x270f25,_0x2b23bc){return function(_0x1a72bc){if(_0x1a72bc){return _0x1a72bc[_0x77de('0x24')]()[_0x77de('0x23')](function(){_0x270f25[_0x77de('0x1a')](0xcc)[_0x77de('0x1b')]();});}};}function handleEntityNotFound(_0xd93dee,_0x29e964){return function(_0x2c2a2d){if(!_0x2c2a2d){_0xd93dee[_0x77de('0x19')](0x194);}return _0x2c2a2d;};}function handleError(_0x4de2d6,_0x5e7ac6){_0x5e7ac6=_0x5e7ac6||0x1f4;return function(_0x37866b){logger[_0x77de('0x25')](_0x37866b[_0x77de('0x26')]);if(_0x37866b[_0x77de('0x27')]){delete _0x37866b[_0x77de('0x27')];}_0x4de2d6[_0x77de('0x1a')](_0x5e7ac6)[_0x77de('0x28')](_0x37866b);};}exports[_0x77de('0x29')]=function(_0x5d36a2,_0x58dcfe){var _0x33b678={},_0x4f4f9e={},_0x37acbb={'count':0x0,'rows':[]};var _0x480df0=_[_0x77de('0x2a')](db[_0x77de('0x2b')][_0x77de('0x2c')],function(_0x282e7f){return{'name':_0x282e7f['fieldName'],'type':_0x282e7f[_0x77de('0x2d')][_0x77de('0x2e')]};});_0x4f4f9e[_0x77de('0x2f')]=_[_0x77de('0x2a')](_0x480df0,_0x77de('0x27'));_0x4f4f9e[_0x77de('0x30')]=_['keys'](_0x5d36a2[_0x77de('0x30')]);_0x4f4f9e[_0x77de('0x31')]=_[_0x77de('0x32')](_0x4f4f9e[_0x77de('0x2f')],_0x4f4f9e[_0x77de('0x30')]);_0x4f4f9e[_0x77de('0x31')]=_[_0x77de('0x33')](_0x4f4f9e[_0x77de('0x31')],['$and','$or',_0x77de('0x34'),_0x77de('0x35'),_0x77de('0x36'),_0x77de('0x37'),_0x77de('0x38'),'$eq',_0x77de('0x39'),_0x77de('0x3a'),_0x77de('0x3b'),'$in',_0x77de('0x3c'),_0x77de('0x3d'),_0x77de('0x3e'),_0x77de('0x3f'),_0x77de('0x40'),_0x77de('0x3d'),_0x77de('0x41'),'$contains',_0x77de('0x42'),_0x77de('0x43')]);_0x33b678[_0x77de('0x44')]=_[_0x77de('0x32')](_0x4f4f9e[_0x77de('0x2f')],qs[_0x77de('0x45')](_0x5d36a2['query'][_0x77de('0x45')]));_0x33b678['attributes']=_0x33b678[_0x77de('0x44')][_0x77de('0x46')]?_0x33b678[_0x77de('0x44')]:_0x4f4f9e[_0x77de('0x2f')];if(!_0x5d36a2[_0x77de('0x30')][_0x77de('0x47')]('nolimit')){_0x33b678['limit']=qs[_0x77de('0x1f')](_0x5d36a2[_0x77de('0x30')][_0x77de('0x1f')]);_0x33b678[_0x77de('0x1e')]=qs['offset'](_0x5d36a2[_0x77de('0x30')][_0x77de('0x1e')]);}_0x33b678['order']=qs[_0x77de('0x48')](_0x5d36a2[_0x77de('0x30')][_0x77de('0x48')]);_0x33b678['where']=qs[_0x77de('0x31')](_[_0x77de('0x49')](_0x5d36a2[_0x77de('0x30')],_0x4f4f9e[_0x77de('0x31')]));if(_0x5d36a2[_0x77de('0x30')][_0x77de('0x4a')]){_0x33b678[_0x77de('0x4b')]=_[_0x77de('0x4c')](_0x33b678[_0x77de('0x4b')],{'$or':_['map'](_0x480df0,function(_0x482192){if(_0x482192['type']!==_0x77de('0x4d')){var _0x170b9b={};_0x170b9b[_0x482192[_0x77de('0x27')]]={'$like':'%'+_0x5d36a2[_0x77de('0x30')][_0x77de('0x4a')]+'%'};return _0x170b9b;}})});}_0x33b678=_['merge']({},_0x33b678,_0x5d36a2['options']);var _0x54bcf2={'where':_0x33b678[_0x77de('0x4b')]};return db[_0x77de('0x2b')][_0x77de('0x1d')](_0x54bcf2)[_0x77de('0x23')](function(_0x1e2a21){_0x37acbb[_0x77de('0x1d')]=_0x1e2a21;if(_0x5d36a2[_0x77de('0x30')][_0x77de('0x4e')]){_0x33b678[_0x77de('0x4f')]=[{'all':!![]}];}return db[_0x77de('0x2b')][_0x77de('0x50')](_0x33b678);})[_0x77de('0x23')](function(_0x339494){_0x37acbb[_0x77de('0x51')]=_0x339494;return _0x37acbb;})[_0x77de('0x23')](respondWithFilteredResult(_0x58dcfe,_0x33b678))['catch'](handleError(_0x58dcfe,null));};exports[_0x77de('0x52')]=function(_0x53c888,_0x8c09e8){var _0x13a1a8={'raw':!![],'where':{'id':_0x53c888[_0x77de('0x53')]['id']}},_0x3c0008={};_0x3c0008['model']=_[_0x77de('0x54')](db['CmHopper'][_0x77de('0x2c')]);_0x3c0008[_0x77de('0x30')]=_[_0x77de('0x54')](_0x53c888[_0x77de('0x30')]);_0x3c0008[_0x77de('0x31')]=_[_0x77de('0x32')](_0x3c0008[_0x77de('0x2f')],_0x3c0008[_0x77de('0x30')]);_0x13a1a8[_0x77de('0x44')]=_[_0x77de('0x32')](_0x3c0008[_0x77de('0x2f')],qs['fields'](_0x53c888[_0x77de('0x30')][_0x77de('0x45')]));_0x13a1a8[_0x77de('0x44')]=_0x13a1a8[_0x77de('0x44')][_0x77de('0x46')]?_0x13a1a8[_0x77de('0x44')]:_0x3c0008['model'];if(_0x53c888[_0x77de('0x30')][_0x77de('0x4e')]){_0x13a1a8[_0x77de('0x4f')]=[{'all':!![]}];}_0x13a1a8=_['merge']({},_0x13a1a8,_0x53c888[_0x77de('0x55')]);return db[_0x77de('0x2b')][_0x77de('0x56')](_0x13a1a8)[_0x77de('0x23')](handleEntityNotFound(_0x8c09e8,null))['then'](respondWithResult(_0x8c09e8,null))[_0x77de('0x57')](handleError(_0x8c09e8,null));};exports['create']=function(_0x37290c,_0x257301){return db['CmHopper'][_0x77de('0x58')](_0x37290c['body'],{})['then'](respondWithResult(_0x257301,0xc9))['catch'](handleError(_0x257301,null));};exports[_0x77de('0x59')]=function(_0x4fe5e4,_0x44908a){if(_0x4fe5e4[_0x77de('0x5a')]['id']){delete _0x4fe5e4[_0x77de('0x5a')]['id'];}return db['CmHopper'][_0x77de('0x56')]({'where':{'id':_0x4fe5e4['params']['id']}})[_0x77de('0x23')](handleEntityNotFound(_0x44908a,null))[_0x77de('0x23')](saveUpdates(_0x4fe5e4[_0x77de('0x5a')],null))['then'](respondWithResult(_0x44908a,null))[_0x77de('0x57')](handleError(_0x44908a,null));};exports[_0x77de('0x5b')]=function(_0x214984,_0x635c5e){return db[_0x77de('0x2b')][_0x77de('0x5b')]()['then'](respondWithResult(_0x635c5e,null))[_0x77de('0x57')](handleError(_0x635c5e,null));};exports[_0x77de('0x24')]=function(_0x2ef2ba,_0x436bf1){var _0x5d19a0;return db[_0x77de('0x2b')][_0x77de('0x56')]({'where':{'id':_0x2ef2ba[_0x77de('0x53')]['id']}})[_0x77de('0x23')](handleEntityNotFound(_0x436bf1,null))['then'](function(_0x1876ed){if(_0x1876ed){return _0x1876ed[_0x77de('0x24')]()['then'](function(_0x529e35){return _0x529e35;});}})[_0x77de('0x23')](function(_0x163fcc){_0x5d19a0=_0x163fcc;if(_0x163fcc){if(_0x163fcc[_0x77de('0x5c')]||_0x163fcc[_0x77de('0x5d')]){return db[_0x163fcc[_0x77de('0x5c')]?_0x77de('0x5e'):_0x77de('0x5f')]['find']({'where':{'id':_0x163fcc['VoiceQueueId']?_0x163fcc[_0x77de('0x5c')]:_0x163fcc['CampaignId']},'attributes':['id',_0x77de('0x27')],'raw':!![]});}}})['then'](function(_0x1e12c1){var _0x40884b={};if(_0x1e12c1){_[_0x77de('0x4c')](_0x40884b,_[_0x77de('0x60')](_0x5d19a0[_0x77de('0x61')],[_0x77de('0x62'),'updatedAt','id']));_0x40884b[_0x77de('0x63')]=0x15;_0x40884b[_0x77de('0x64')]=_0x77de('0x65');_0x40884b[_0x77de('0x66')]=_0x1e12c1[_0x77de('0x27')];_0x40884b[_0x77de('0x67')]=_0x2ef2ba[_0x77de('0x68')][_0x77de('0x27')];_0x40884b[_0x77de('0x69')]=_0x2ef2ba['user']['id'];_0x40884b['deleted']=!![];_0x40884b[_0x77de('0x6a')]=moment()[_0x77de('0x6b')](_0x77de('0x6c'));_0x40884b[_0x77de('0x6d')]=_0x5d19a0['phone'];_0x40884b['campaigntype']=_0x5d19a0['VoiceQueueId']?_0x77de('0x6e'):_0x77de('0x6f');return db[_0x77de('0x70')]['find']({'where':{'id':_0x40884b['ContactId']},'attributes':[_0x77de('0x71'),'lastName']})['then'](function(_0x157d73){if(!_[_0x77de('0x72')](_0x436bf1)&&!_[_0x77de('0x72')](_0x157d73[_0x77de('0x71')])){_0x40884b['calleridname']=_0x157d73[_0x77de('0x71')];if(!_[_0x77de('0x72')](_0x157d73['lastName'])){_0x40884b['calleridname']+='\x20'+_0x157d73[_0x77de('0x73')];}}})[_0x77de('0x74')](function(){return db[_0x77de('0x75')]['create'](_0x40884b);});}})['then'](function(){return _0x436bf1['status'](0xcc)[_0x77de('0x1b')]();})[_0x77de('0x57')](handleError(_0x436bf1,null));};exports[_0x77de('0x76')]=function(_0x6b5609,_0x29a557,_0xeb2aa9){var _0x7d1d52=[];return db[_0x77de('0x70')]['describe']()[_0x77de('0x23')](function(_0x5811f7){_0x7d1d52=_[_0x77de('0x54')](_0x5811f7);return _0x6b5609[_0x77de('0x68')][_0x77de('0x77')]({'where':{'type':_0x77de('0x78'),'dialActive':!![],'dialMethod':_0x77de('0x79')},'attributes':['id',_0x77de('0x7a')],'raw':!![]});})[_0x77de('0x23')](function(_0x591c2b){if(_0x591c2b&&_0x591c2b[_0x77de('0x46')]){return db[_0x77de('0x7b')][_0x77de('0x7c')](function(_0x2baf59){var _0x1d2880={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x77de('0x6b')](_0x77de('0x6c'))},'VoiceQueueId':{'$in':_[_0x77de('0x2a')](_0x591c2b,'id')},'$or':[{'UserId':null},{'UserId':_0x6b5609[_0x77de('0x68')]['id']}]};var _0x5868b1=[];if(_0x6b5609[_0x77de('0x5a')][_0x77de('0x7d')]&&_0x6b5609[_0x77de('0x5a')][_0x77de('0x7d')]===_0x77de('0x7e')){if(!_[_0x77de('0x7f')](_0x6b5609['body'][_0x77de('0x80')])){_0x1d2880['id']={'$in':_0x6b5609[_0x77de('0x5a')][_0x77de('0x80')]};}_0x5868b1=[[_0x77de('0x81'),'ASC'],[_0x77de('0x82'),_0x591c2b[0x0][_0x77de('0x7a')]===_0x77de('0x83')?'DESC':_0x77de('0x83')],db[_0x77de('0x7b')][_0x77de('0x84')](_0x77de('0x85')),['id',_0x77de('0x86')]];}else{if(!_[_0x77de('0x7f')](_0x6b5609[_0x77de('0x5a')][_0x77de('0x80')])){_0x1d2880['id']={'$notIn':_0x6b5609[_0x77de('0x5a')][_0x77de('0x80')]};}_0x5868b1=[['priority',_0x77de('0x86')],[_0x77de('0x82'),_0x591c2b[0x0][_0x77de('0x7a')]],db[_0x77de('0x7b')][_0x77de('0x84')](_0x77de('0x87')),['id',_0x77de('0x83')]];}return db[_0x77de('0x2b')][_0x77de('0x88')]({'attributes':['id','scheduledat'],'where':_0x1d2880,'order':_0x5868b1,'transaction':_0x2baf59,'lock':_0x2baf59[_0x77de('0x89')]['UPDATE'],'include':[{'model':db[_0x77de('0x70')],'as':_0x77de('0x8a'),'attributes':_0x7d1d52,'include':[{'model':db[_0x77de('0x8b')],'as':_0x77de('0x8c'),'attributes':['id',_0x77de('0x27')]}]},{'model':db[_0x77de('0x8d')],'as':'List','attributes':['id','name']},{'model':db[_0x77de('0x5e')],'as':_0x77de('0x8e'),'attributes':['id','name',_0x77de('0x8f')]}]})['then'](function(_0x115bca){if(_0x115bca){return _0x115bca[_0x77de('0x59')]({'UserId':_0x6b5609[_0x77de('0x68')]['id']},{'transaction':_0x2baf59});}});});}})[_0x77de('0x23')](handleEntityNotFound(_0x29a557,null))[_0x77de('0x23')](respondWithResult(_0x29a557,null))['catch'](handleError(_0x29a557,null));};exports[_0x77de('0x90')]=function(_0x2614e2,_0x58aec9,_0x5e4212){return _0x2614e2[_0x77de('0x68')][_0x77de('0x77')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x77de('0x23')](function(_0x5c6468){if(_0x5c6468&&_0x5c6468[_0x77de('0x46')]){return db[_0x77de('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x77de('0x6c'))},'VoiceQueueId':{'$in':_[_0x77de('0x2a')](_0x5c6468,'id')},'$or':[{'UserId':null},{'UserId':_0x2614e2['user']['id']}]}});}return 0x0;})['then'](function(_0x1e736d){if(!_[_0x77de('0x72')](_0x1e736d)&&_[_0x77de('0x91')](_0x1e736d)){return _0x58aec9[_0x77de('0x1a')](0xc8)[_0x77de('0x1c')]({'contacts':_0x1e736d});}else{logger['error'](_0x77de('0x92'),_0x77de('0x90'),0x194,'entity\x20not\x20found');_0x58aec9[_0x77de('0x19')](0x194);}})[_0x77de('0x57')](handleError(_0x58aec9,null));}; \ No newline at end of file +var _0xc299=['createdAt','updatedAt','state','deleted','campaign','membername','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','isNil','firstName','calleridname','lastName','finally','CmHopperFinal','preview','dialOrderByScheduledAt','direction','prev','hopperIds','priority','scheduledAt','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','UPDATE','CmCompany','Company','CmList','Queue','getOpenContacts','getVoiceQueues','outbound','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','index','CmHopper','rawAttributes','map','keys','filters','intersection','model','query','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$notBetween','$notIn','$iLike','$notILike','$like','$overlap','$contains','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','CampaignId','VoiceQueueId','VoiceQueue','Campaign','omit','dataValues'];(function(_0x14a4ff,_0x4684c1){var _0x24c613=function(_0xaf03ec){while(--_0xaf03ec){_0x14a4ff['push'](_0x14a4ff['shift']());}};_0x24c613(++_0x4684c1);}(_0xc299,0x150));var _0x9c29=function(_0x117821,_0xaa1933){_0x117821=_0x117821-0x0;var _0x4ae9ff=_0xc299[_0x117821];return _0x4ae9ff;};'use strict';var pdf=require(_0x9c29('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c29('0x1'));var zipdir=require(_0x9c29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9c29('0x3'));var moment=require('moment');var BPromise=require(_0x9c29('0x4'));var Mustache=require(_0x9c29('0x5'));var util=require('util');var path=require(_0x9c29('0x6'));var sox=require(_0x9c29('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9c29('0x8'));var crypto=require(_0x9c29('0x9'));var jsforce=require(_0x9c29('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x9c29('0xb'));var querystring=require(_0x9c29('0xc'));var Papa=require(_0x9c29('0xd'));var Redis=require(_0x9c29('0xe'));var authService=require(_0x9c29('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x9c29('0x10'));var hardwareService=require(_0x9c29('0x11'));var logger=require(_0x9c29('0x12'))('api');var utils=require(_0x9c29('0x13'));var config=require(_0x9c29('0x14'));var db=require(_0x9c29('0x15'))['db'];function respondWithStatusCode(_0x17092d,_0x2a6c90){_0x2a6c90=_0x2a6c90||0xcc;return function(_0x3df44a){if(_0x3df44a){return _0x17092d[_0x9c29('0x16')](_0x2a6c90);}return _0x17092d[_0x9c29('0x17')](_0x2a6c90)[_0x9c29('0x18')]();};}function respondWithResult(_0x263bfc,_0x835405){_0x835405=_0x835405||0xc8;return function(_0x25f8b0){if(_0x25f8b0){return _0x263bfc['status'](_0x835405)['json'](_0x25f8b0);}};}function respondWithFilteredResult(_0x577a6f,_0x59e544){return function(_0xcf9bc2){if(_0xcf9bc2){var _0x3c83ad=_0xcf9bc2['count'],_0x1c3163=_0x59e544[_0x9c29('0x19')],_0x33963c=_0x59e544[_0x9c29('0x19')]+_0x59e544[_0x9c29('0x1a')],_0xe7b21b;if(_0x33963c>=_0x3c83ad){_0x33963c=_0x3c83ad;_0xe7b21b=0xc8;}else{_0xe7b21b=0xce;}_0x577a6f[_0x9c29('0x17')](_0xe7b21b);return _0x577a6f[_0x9c29('0x1b')](_0x9c29('0x1c'),_0x1c3163+'-'+_0x33963c+'/'+_0x3c83ad)[_0x9c29('0x1d')](_0xcf9bc2);}return null;};}function patchUpdates(_0x4aef1a){return function(_0xeaee63){try{jsonpatch[_0x9c29('0x1e')](_0xeaee63,_0x4aef1a,!![]);}catch(_0x10910c){return BPromise[_0x9c29('0x1f')](_0x10910c);}return _0xeaee63[_0x9c29('0x20')]();};}function saveUpdates(_0x3ef657,_0x15e2a9){return function(_0x5427f8){if(_0x5427f8){return _0x5427f8[_0x9c29('0x21')](_0x3ef657)[_0x9c29('0x22')](function(_0x12add4){return _0x12add4;});}return null;};}function removeEntity(_0x30da5e,_0x2bc8a2){return function(_0x38bbf3){if(_0x38bbf3){return _0x38bbf3[_0x9c29('0x23')]()[_0x9c29('0x22')](function(){_0x30da5e[_0x9c29('0x17')](0xcc)[_0x9c29('0x18')]();});}};}function handleEntityNotFound(_0x58c72a,_0x23002e){return function(_0x255956){if(!_0x255956){_0x58c72a['sendStatus'](0x194);}return _0x255956;};}function handleError(_0x4ad449,_0x2b7a4e){_0x2b7a4e=_0x2b7a4e||0x1f4;return function(_0x323ea9){logger['error'](_0x323ea9['stack']);if(_0x323ea9[_0x9c29('0x24')]){delete _0x323ea9[_0x9c29('0x24')];}_0x4ad449[_0x9c29('0x17')](_0x2b7a4e)['send'](_0x323ea9);};}exports[_0x9c29('0x25')]=function(_0x30a016,_0x57c2f9){var _0x2c5aba={},_0xc63d7c={},_0x32a92e={'count':0x0,'rows':[]};var _0x56e355=_['map'](db[_0x9c29('0x26')][_0x9c29('0x27')],function(_0x475526){return{'name':_0x475526['fieldName'],'type':_0x475526['type']['key']};});_0xc63d7c['model']=_[_0x9c29('0x28')](_0x56e355,_0x9c29('0x24'));_0xc63d7c['query']=_[_0x9c29('0x29')](_0x30a016['query']);_0xc63d7c[_0x9c29('0x2a')]=_[_0x9c29('0x2b')](_0xc63d7c[_0x9c29('0x2c')],_0xc63d7c[_0x9c29('0x2d')]);_0xc63d7c[_0x9c29('0x2a')]=_[_0x9c29('0x2e')](_0xc63d7c['filters'],['$and',_0x9c29('0x2f'),_0x9c29('0x30'),_0x9c29('0x31'),_0x9c29('0x32'),_0x9c29('0x33'),_0x9c29('0x34'),_0x9c29('0x35'),_0x9c29('0x36'),'$between',_0x9c29('0x37'),'$in',_0x9c29('0x38'),'$like','$notLike',_0x9c29('0x39'),_0x9c29('0x3a'),_0x9c29('0x3b'),_0x9c29('0x3c'),_0x9c29('0x3d'),'$contained','$any']);_0x2c5aba[_0x9c29('0x3e')]=_[_0x9c29('0x2b')](_0xc63d7c['model'],qs['fields'](_0x30a016['query'][_0x9c29('0x3f')]));_0x2c5aba[_0x9c29('0x3e')]=_0x2c5aba[_0x9c29('0x3e')][_0x9c29('0x40')]?_0x2c5aba[_0x9c29('0x3e')]:_0xc63d7c[_0x9c29('0x2c')];if(!_0x30a016[_0x9c29('0x2d')][_0x9c29('0x41')](_0x9c29('0x42'))){_0x2c5aba[_0x9c29('0x1a')]=qs[_0x9c29('0x1a')](_0x30a016[_0x9c29('0x2d')][_0x9c29('0x1a')]);_0x2c5aba['offset']=qs[_0x9c29('0x19')](_0x30a016[_0x9c29('0x2d')][_0x9c29('0x19')]);}_0x2c5aba[_0x9c29('0x43')]=qs[_0x9c29('0x44')](_0x30a016[_0x9c29('0x2d')]['sort']);_0x2c5aba['where']=qs[_0x9c29('0x2a')](_[_0x9c29('0x45')](_0x30a016[_0x9c29('0x2d')],_0xc63d7c[_0x9c29('0x2a')]));if(_0x30a016[_0x9c29('0x2d')][_0x9c29('0x46')]){_0x2c5aba[_0x9c29('0x47')]=_[_0x9c29('0x48')](_0x2c5aba[_0x9c29('0x47')],{'$or':_[_0x9c29('0x28')](_0x56e355,function(_0x25e323){if(_0x25e323[_0x9c29('0x49')]!=='VIRTUAL'){var _0x26e67d={};_0x26e67d[_0x25e323['name']]={'$like':'%'+_0x30a016['query'][_0x9c29('0x46')]+'%'};return _0x26e67d;}})});}_0x2c5aba=_[_0x9c29('0x48')]({},_0x2c5aba,_0x30a016[_0x9c29('0x4a')]);var _0x3ec0ab={'where':_0x2c5aba[_0x9c29('0x47')]};return db['CmHopper'][_0x9c29('0x4b')](_0x3ec0ab)['then'](function(_0x16e2bb){_0x32a92e[_0x9c29('0x4b')]=_0x16e2bb;if(_0x30a016['query'][_0x9c29('0x4c')]){_0x2c5aba[_0x9c29('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x9c29('0x4e')](_0x2c5aba);})[_0x9c29('0x22')](function(_0x17cd6f){_0x32a92e[_0x9c29('0x4f')]=_0x17cd6f;return _0x32a92e;})[_0x9c29('0x22')](respondWithFilteredResult(_0x57c2f9,_0x2c5aba))['catch'](handleError(_0x57c2f9,null));};exports[_0x9c29('0x50')]=function(_0x39f5dd,_0x22a10){var _0x2cabea={'raw':!![],'where':{'id':_0x39f5dd[_0x9c29('0x51')]['id']}},_0xc6a208={};_0xc6a208['model']=_[_0x9c29('0x29')](db[_0x9c29('0x26')][_0x9c29('0x27')]);_0xc6a208[_0x9c29('0x2d')]=_[_0x9c29('0x29')](_0x39f5dd[_0x9c29('0x2d')]);_0xc6a208[_0x9c29('0x2a')]=_[_0x9c29('0x2b')](_0xc6a208['model'],_0xc6a208[_0x9c29('0x2d')]);_0x2cabea[_0x9c29('0x3e')]=_[_0x9c29('0x2b')](_0xc6a208['model'],qs[_0x9c29('0x3f')](_0x39f5dd[_0x9c29('0x2d')][_0x9c29('0x3f')]));_0x2cabea['attributes']=_0x2cabea[_0x9c29('0x3e')][_0x9c29('0x40')]?_0x2cabea['attributes']:_0xc6a208[_0x9c29('0x2c')];if(_0x39f5dd[_0x9c29('0x2d')][_0x9c29('0x4c')]){_0x2cabea['include']=[{'all':!![]}];}_0x2cabea=_[_0x9c29('0x48')]({},_0x2cabea,_0x39f5dd['options']);return db[_0x9c29('0x26')][_0x9c29('0x52')](_0x2cabea)[_0x9c29('0x22')](handleEntityNotFound(_0x22a10,null))[_0x9c29('0x22')](respondWithResult(_0x22a10,null))[_0x9c29('0x53')](handleError(_0x22a10,null));};exports[_0x9c29('0x54')]=function(_0x16df72,_0x115ba1){return db['CmHopper'][_0x9c29('0x54')](_0x16df72[_0x9c29('0x55')],{})[_0x9c29('0x22')](respondWithResult(_0x115ba1,0xc9))[_0x9c29('0x53')](handleError(_0x115ba1,null));};exports[_0x9c29('0x21')]=function(_0x57e1f7,_0x59f849){if(_0x57e1f7[_0x9c29('0x55')]['id']){delete _0x57e1f7[_0x9c29('0x55')]['id'];}return db[_0x9c29('0x26')][_0x9c29('0x52')]({'where':{'id':_0x57e1f7['params']['id']}})[_0x9c29('0x22')](handleEntityNotFound(_0x59f849,null))['then'](saveUpdates(_0x57e1f7[_0x9c29('0x55')],null))[_0x9c29('0x22')](respondWithResult(_0x59f849,null))['catch'](handleError(_0x59f849,null));};exports[_0x9c29('0x56')]=function(_0x10a609,_0x29b8cf){return db['CmHopper'][_0x9c29('0x56')]()['then'](respondWithResult(_0x29b8cf,null))[_0x9c29('0x53')](handleError(_0x29b8cf,null));};exports[_0x9c29('0x23')]=function(_0x5dbb27,_0x565d6a){var _0x109422;return db[_0x9c29('0x26')][_0x9c29('0x52')]({'where':{'id':_0x5dbb27['params']['id']}})['then'](handleEntityNotFound(_0x565d6a,null))['then'](function(_0x1cb616){if(_0x1cb616){return _0x1cb616[_0x9c29('0x23')]()[_0x9c29('0x22')](function(_0x32b4f9){return _0x32b4f9;});}})['then'](function(_0x458a67){_0x109422=_0x458a67;if(_0x458a67){if(_0x458a67['VoiceQueueId']||_0x458a67[_0x9c29('0x57')]){return db[_0x458a67[_0x9c29('0x58')]?_0x9c29('0x59'):_0x9c29('0x5a')][_0x9c29('0x52')]({'where':{'id':_0x458a67[_0x9c29('0x58')]?_0x458a67[_0x9c29('0x58')]:_0x458a67['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})[_0x9c29('0x22')](function(_0x3251fb){var _0x28d11e={};if(_0x3251fb){_[_0x9c29('0x48')](_0x28d11e,_[_0x9c29('0x5b')](_0x109422[_0x9c29('0x5c')],[_0x9c29('0x5d'),_0x9c29('0x5e'),'id']));_0x28d11e[_0x9c29('0x5f')]=0x15;_0x28d11e['statedesc']=_0x9c29('0x60');_0x28d11e[_0x9c29('0x61')]=_0x3251fb[_0x9c29('0x24')];_0x28d11e[_0x9c29('0x62')]=_0x5dbb27['user'][_0x9c29('0x24')];_0x28d11e[_0x9c29('0x63')]=_0x5dbb27[_0x9c29('0x64')]['id'];_0x28d11e['deleted']=!![];_0x28d11e[_0x9c29('0x65')]=moment()[_0x9c29('0x66')](_0x9c29('0x67'));_0x28d11e['calleridnum']=_0x109422[_0x9c29('0x68')];_0x28d11e[_0x9c29('0x69')]=_0x109422['VoiceQueueId']?'queue':_0x9c29('0x6a');return db[_0x9c29('0x6b')]['find']({'where':{'id':_0x28d11e[_0x9c29('0x6c')]},'attributes':['firstName','lastName']})[_0x9c29('0x22')](function(_0x2eefb0){if(!_[_0x9c29('0x6d')](_0x565d6a)&&!_[_0x9c29('0x6d')](_0x2eefb0[_0x9c29('0x6e')])){_0x28d11e[_0x9c29('0x6f')]=_0x2eefb0[_0x9c29('0x6e')];if(!_[_0x9c29('0x6d')](_0x2eefb0[_0x9c29('0x70')])){_0x28d11e[_0x9c29('0x6f')]+='\x20'+_0x2eefb0[_0x9c29('0x70')];}}})[_0x9c29('0x71')](function(){return db[_0x9c29('0x72')]['create'](_0x28d11e);});}})['then'](function(){return _0x565d6a[_0x9c29('0x17')](0xcc)['end']();})[_0x9c29('0x53')](handleError(_0x565d6a,null));};exports['getPreview']=function(_0x5125e6,_0x6bc5d,_0x1a2247){var _0x279dfb=[];return db[_0x9c29('0x6b')][_0x9c29('0x56')]()[_0x9c29('0x22')](function(_0x38e336){_0x279dfb=_[_0x9c29('0x29')](_0x38e336);return _0x5125e6['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x9c29('0x73')},'attributes':['id',_0x9c29('0x74')],'raw':!![]});})[_0x9c29('0x22')](function(_0x4edfa2){if(_0x4edfa2&&_0x4edfa2[_0x9c29('0x40')]){return db['sequelize']['transaction'](function(_0x7269e5){var _0x4a85a2={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x9c29('0x66')](_0x9c29('0x67'))},'VoiceQueueId':{'$in':_[_0x9c29('0x28')](_0x4edfa2,'id')},'$or':[{'UserId':null},{'UserId':_0x5125e6['user']['id']}]};var _0x221b59=[];if(_0x5125e6[_0x9c29('0x55')][_0x9c29('0x75')]&&_0x5125e6[_0x9c29('0x55')][_0x9c29('0x75')]===_0x9c29('0x76')){if(!_['isEmpty'](_0x5125e6['body'][_0x9c29('0x77')])){_0x4a85a2['id']={'$in':_0x5125e6['body'][_0x9c29('0x77')]};}_0x221b59=[[_0x9c29('0x78'),'ASC'],[_0x9c29('0x79'),_0x4edfa2[0x0][_0x9c29('0x74')]===_0x9c29('0x7a')?_0x9c29('0x7b'):_0x9c29('0x7a')],db[_0x9c29('0x7c')][_0x9c29('0x7d')](_0x9c29('0x7e')),['id',_0x9c29('0x7b')]];}else{if(!_[_0x9c29('0x7f')](_0x5125e6[_0x9c29('0x55')][_0x9c29('0x77')])){_0x4a85a2['id']={'$notIn':_0x5125e6[_0x9c29('0x55')][_0x9c29('0x77')]};}_0x221b59=[[_0x9c29('0x78'),'DESC'],['scheduledAt',_0x4edfa2[0x0][_0x9c29('0x74')]],db[_0x9c29('0x7c')][_0x9c29('0x7d')](_0x9c29('0x80')),['id','ASC']];}return db[_0x9c29('0x26')][_0x9c29('0x81')]({'attributes':['id','scheduledat'],'where':_0x4a85a2,'order':_0x221b59,'transaction':_0x7269e5,'lock':_0x7269e5[_0x9c29('0x82')][_0x9c29('0x83')],'include':[{'model':db[_0x9c29('0x6b')],'as':'Contact','attributes':_0x279dfb,'include':[{'model':db[_0x9c29('0x84')],'as':_0x9c29('0x85'),'attributes':['id',_0x9c29('0x24')]}]},{'model':db[_0x9c29('0x86')],'as':'List','attributes':['id',_0x9c29('0x24')]},{'model':db[_0x9c29('0x59')],'as':_0x9c29('0x87'),'attributes':['id',_0x9c29('0x24'),'dialActive']}]})[_0x9c29('0x22')](function(_0x42733c){if(_0x42733c){return _0x42733c['update']({'UserId':_0x5125e6['user']['id']},{'transaction':_0x7269e5});}});});}})['then'](handleEntityNotFound(_0x6bc5d,null))[_0x9c29('0x22')](respondWithResult(_0x6bc5d,null))[_0x9c29('0x53')](handleError(_0x6bc5d,null));};exports[_0x9c29('0x88')]=function(_0x9e9598,_0x13a90d,_0x2f06b3){return _0x9e9598['user'][_0x9c29('0x89')]({'where':{'type':_0x9c29('0x8a'),'dialActive':!![],'dialMethod':_0x9c29('0x73')},'attributes':['id'],'raw':!![]})[_0x9c29('0x22')](function(_0x293d18){if(_0x293d18&&_0x293d18[_0x9c29('0x40')]){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x9c29('0x67'))},'VoiceQueueId':{'$in':_[_0x9c29('0x28')](_0x293d18,'id')},'$or':[{'UserId':null},{'UserId':_0x9e9598[_0x9c29('0x64')]['id']}]}});}return 0x0;})[_0x9c29('0x22')](function(_0x4c4ed8){if(!_[_0x9c29('0x6d')](_0x4c4ed8)&&_[_0x9c29('0x8b')](_0x4c4ed8)){return _0x13a90d['status'](0xc8)[_0x9c29('0x1d')]({'contacts':_0x4c4ed8});}else{logger[_0x9c29('0x8c')](_0x9c29('0x8d'),_0x9c29('0x88'),0x194,_0x9c29('0x8e'));_0x13a90d[_0x9c29('0x16')](0x194);}})[_0x9c29('0x53')](handleError(_0x13a90d,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 23a8b00..65921a1 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 _0xc9dc=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc9dc,0x11b));var _0xcc9d=function(_0x3b24e0,_0x146a04){_0x3b24e0=_0x3b24e0-0x0;var _0x4e5a76=_0xc9dc[_0x3b24e0];return _0x4e5a76;};'use strict';var _=require(_0xcc9d('0x0'));var util=require(_0xcc9d('0x1'));var logger=require(_0xcc9d('0x2'))(_0xcc9d('0x3'));var moment=require(_0xcc9d('0x4'));var BPromise=require(_0xcc9d('0x5'));var rp=require(_0xcc9d('0x6'));var fs=require('fs');var path=require(_0xcc9d('0x7'));var rimraf=require(_0xcc9d('0x8'));var config=require(_0xcc9d('0x9'));var attributes=require(_0xcc9d('0xa'));module['exports']=function(_0x469131,_0x5ee7eb){return _0x469131[_0xcc9d('0xb')]('CmHopper',attributes,{'tableName':_0xcc9d('0xc'),'paranoid':![],'indexes':[{'name':_0xcc9d('0xd'),'fields':[_0xcc9d('0xd')]},{'name':_0xcc9d('0xe'),'fields':['phone']},{'name':_0xcc9d('0xf'),'fields':[_0xcc9d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfb06=['rimraf','../../config/environment','exports','define','scheduledat','phone','priority','lodash','util','api','request-promise','path'];(function(_0x208de2,_0xd6b418){var _0x5b2e29=function(_0x2ecfe3){while(--_0x2ecfe3){_0x208de2['push'](_0x208de2['shift']());}};_0x5b2e29(++_0xd6b418);}(_0xfb06,0xaf));var _0x6fb0=function(_0x3d4876,_0x366386){_0x3d4876=_0x3d4876-0x0;var _0x58ca9d=_0xfb06[_0x3d4876];return _0x58ca9d;};'use strict';var _=require(_0x6fb0('0x0'));var util=require(_0x6fb0('0x1'));var logger=require('../../config/logger')(_0x6fb0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6fb0('0x3'));var fs=require('fs');var path=require(_0x6fb0('0x4'));var rimraf=require(_0x6fb0('0x5'));var config=require(_0x6fb0('0x6'));var attributes=require('./cmHopper.attributes');module[_0x6fb0('0x7')]=function(_0x186a32,_0x49b9b3){return _0x186a32[_0x6fb0('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x6fb0('0x9'),'fields':[_0x6fb0('0x9')]},{'name':_0x6fb0('0xa'),'fields':[_0x6fb0('0xa')]},{'name':_0x6fb0('0xb'),'fields':[_0x6fb0('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index c62be92..523b8a3 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 _0x3f4e=['create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','COUNT','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','debug','ShowCmHopper','find','raw'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x3f4e,0x9f));var _0xe3f4=function(_0xb98d8d,_0x481423){_0xb98d8d=_0xb98d8d-0x0;var _0x489b15=_0x3f4e[_0xb98d8d];return _0x489b15;};'use strict';var _=require(_0xe3f4('0x0'));var util=require('util');var moment=require(_0xe3f4('0x1'));var BPromise=require(_0xe3f4('0x2'));var rs=require(_0xe3f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3f4('0x4'))['db'];var utils=require(_0xe3f4('0x5'));var logger=require(_0xe3f4('0x6'))('rpc');var config=require(_0xe3f4('0x7'));var jayson=require(_0xe3f4('0x8'));var client=jayson[_0xe3f4('0x9')][_0xe3f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25c548,_0x39f404,_0xc1013d){return new BPromise(function(_0x3d876a,_0x4bf11a){return client['request'](_0x25c548,_0xc1013d)[_0xe3f4('0xb')](function(_0x40a592){logger[_0xe3f4('0xc')]('CmHopper,\x20%s,\x20%s',_0x39f404,_0xe3f4('0xd'));logger['debug'](_0xe3f4('0xe'),_0x39f404,'request\x20sent',JSON[_0xe3f4('0xf')](_0x40a592));if(_0x40a592[_0xe3f4('0x10')]){if(_0x40a592[_0xe3f4('0x10')][_0xe3f4('0x11')]===0x1f4){logger['error'](_0xe3f4('0x12'),_0x39f404,_0x40a592['error'][_0xe3f4('0x13')]);return _0x4bf11a(_0x40a592[_0xe3f4('0x10')]['message']);}logger['error'](_0xe3f4('0x12'),_0x39f404,_0x40a592['error'][_0xe3f4('0x13')]);return _0x3d876a(_0x40a592[_0xe3f4('0x10')][_0xe3f4('0x13')]);}else{logger[_0xe3f4('0xc')](_0xe3f4('0x12'),_0x39f404,_0xe3f4('0xd'));_0x3d876a(_0x40a592[_0xe3f4('0x14')][_0xe3f4('0x13')]);}})[_0xe3f4('0x15')](function(_0x165e47){logger[_0xe3f4('0x10')](_0xe3f4('0x12'),_0x39f404,_0x165e47);_0x4bf11a(_0x165e47);});});}exports[_0xe3f4('0x16')]=function(_0x1bebf2){var _0x22dbb7=this;return new Promise(function(_0x16e786,_0x3ff939){return db[_0xe3f4('0x17')][_0xe3f4('0x18')]({'raw':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bebf2['options']?_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null,'attributes':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1b')]||null:null,'limit':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2['options'][_0xe3f4('0x1c')]||null:null,'include':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1d')],function(_0xa26e81){return{'model':db[_0xa26e81['model']],'as':_0xa26e81['as'],'attributes':_0xa26e81[_0xe3f4('0x1b')],'include':_0xa26e81[_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0xa26e81[_0xe3f4('0x1d')],function(_0x976357){return{'model':db[_0x976357[_0xe3f4('0x1f')]],'as':_0x976357['as'],'attributes':_0x976357['attributes'],'include':_0x976357[_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x976357['include'],function(_0x17028f){return{'model':db[_0x17028f[_0xe3f4('0x1f')]],'as':_0x17028f['as'],'attributes':_0x17028f[_0xe3f4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe3f4('0xb')](function(_0x58c5e7){logger[_0xe3f4('0xc')](_0xe3f4('0x16'),_0x1bebf2);logger[_0xe3f4('0x20')](_0xe3f4('0x16'),_0x1bebf2,JSON[_0xe3f4('0xf')](_0x58c5e7));_0x16e786(_0x58c5e7);})[_0xe3f4('0x15')](function(_0x51a501){logger[_0xe3f4('0x10')](_0xe3f4('0x16'),_0x51a501[_0xe3f4('0x13')],_0x1bebf2);_0x3ff939(_0x22dbb7[_0xe3f4('0x10')](0x1f4,_0x51a501[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x21')]=function(_0x35f342){var _0x454f8f=this;return new Promise(function(_0x58f977,_0x268d8a){return db['CmHopper'][_0xe3f4('0x22')]({'raw':_0x35f342[_0xe3f4('0x19')]?_0x35f342[_0xe3f4('0x19')][_0xe3f4('0x23')]===undefined?!![]:![]:!![],'where':_0x35f342[_0xe3f4('0x19')]?_0x35f342[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null,'attributes':_0x35f342['options']?_0x35f342[_0xe3f4('0x19')]['attributes']||null:null,'include':_0x35f342[_0xe3f4('0x19')]?_0x35f342['options'][_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x35f342['options']['include'],function(_0x44148a){return{'model':db[_0x44148a[_0xe3f4('0x1f')]],'as':_0x44148a['as'],'attributes':_0x44148a[_0xe3f4('0x1b')],'include':_0x44148a[_0xe3f4('0x1d')]?_['map'](_0x44148a['include'],function(_0x26a923){return{'model':db[_0x26a923[_0xe3f4('0x1f')]],'as':_0x26a923['as'],'attributes':_0x26a923['attributes'],'include':_0x26a923[_0xe3f4('0x1d')]?_['map'](_0x26a923['include'],function(_0x29053e){return{'model':db[_0x29053e[_0xe3f4('0x1f')]],'as':_0x29053e['as'],'attributes':_0x29053e[_0xe3f4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe3f4('0xb')](function(_0x30942e){logger[_0xe3f4('0xc')](_0xe3f4('0x21'),_0x35f342);logger['debug'](_0xe3f4('0x21'),_0x35f342,JSON[_0xe3f4('0xf')](_0x30942e));_0x58f977(_0x30942e);})[_0xe3f4('0x15')](function(_0x16a359){logger[_0xe3f4('0x10')]('ShowCmHopper',_0x16a359['message'],_0x35f342);_0x268d8a(_0x454f8f[_0xe3f4('0x10')](0x1f4,_0x16a359[_0xe3f4('0x13')]));});});};exports['CreateCmHopper']=function(_0x14d13e){var _0x4a4722=this;return new Promise(function(_0xcfebac,_0x581ef6){return db['CmHopper'][_0xe3f4('0x24')](_0x14d13e[_0xe3f4('0x25')],{'raw':_0x14d13e[_0xe3f4('0x19')]?_0x14d13e[_0xe3f4('0x19')][_0xe3f4('0x23')]===undefined?!![]:![]:!![]})[_0xe3f4('0xb')](function(_0x2af294){logger[_0xe3f4('0xc')](_0xe3f4('0x26'),_0x14d13e);logger[_0xe3f4('0x20')](_0xe3f4('0x26'),_0x14d13e,JSON['stringify'](_0x2af294));_0xcfebac(_0x2af294);})['catch'](function(_0x2146d4){logger[_0xe3f4('0x10')]('CreateCmHopper',_0x2146d4[_0xe3f4('0x13')],_0x14d13e);_0x581ef6(_0x4a4722['error'](0x1f4,_0x2146d4[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x27')]=function(_0x1bd4f7){var _0x584837=this;return new Promise(function(_0x4cbc0c,_0x11ec20){return db[_0xe3f4('0x17')][_0xe3f4('0x28')](_0x1bd4f7[_0xe3f4('0x25')],{'raw':_0x1bd4f7[_0xe3f4('0x19')]?_0x1bd4f7['options'][_0xe3f4('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bd4f7['options']?_0x1bd4f7[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null,'attributes':_0x1bd4f7[_0xe3f4('0x19')]?_0x1bd4f7['options'][_0xe3f4('0x1b')]||null:null,'limit':_0x1bd4f7['options']?_0x1bd4f7['options']['limit']||null:null})['then'](function(_0x3a9443){logger['info'](_0xe3f4('0x27'),_0x1bd4f7);logger[_0xe3f4('0x20')]('UpdateCmHopper',_0x1bd4f7,JSON[_0xe3f4('0xf')](_0x3a9443));_0x4cbc0c(_0x3a9443);})[_0xe3f4('0x15')](function(_0x228663){logger[_0xe3f4('0x10')](_0xe3f4('0x27'),_0x228663[_0xe3f4('0x13')],_0x1bd4f7);_0x11ec20(_0x584837[_0xe3f4('0x10')](0x1f4,_0x228663['message']));});});};exports[_0xe3f4('0x29')]=function(_0x5783d7){var _0x65ffd3=this;return new Promise(function(_0x1fb595,_0x564b95){return db['CmHopper'][_0xe3f4('0x2a')]({'where':_0x5783d7[_0xe3f4('0x19')]?_0x5783d7[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null})[_0xe3f4('0xb')](function(_0x42d4f6){logger[_0xe3f4('0xc')](_0xe3f4('0x29'),_0x5783d7);logger[_0xe3f4('0x20')](_0xe3f4('0x29'),_0x5783d7,JSON[_0xe3f4('0xf')](_0x42d4f6));_0x1fb595(_0x42d4f6);})[_0xe3f4('0x15')](function(_0x27975c){logger[_0xe3f4('0x10')](_0xe3f4('0x29'),_0x27975c['message'],_0x5783d7);_0x564b95(_0x65ffd3['error'](0x1f4,_0x27975c[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x2b')]=function(_0x2a6635){var _0x5ec00b=this;return new Promise(function(_0x22e619,_0x2bdb85){return db[_0xe3f4('0x2c')][_0xe3f4('0x2d')]()[_0xe3f4('0xb')](function(_0x2931c4){return db[_0xe3f4('0x2e')][_0xe3f4('0x2f')](function(_0x371dee){return db[_0xe3f4('0x17')][_0xe3f4('0x18')]({'where':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635['options'][_0xe3f4('0x1a')]||null:null,'attributes':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635['options'][_0xe3f4('0x1b')]||null:null,'limit':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635[_0xe3f4('0x19')][_0xe3f4('0x1c')]||null:null,'order':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635['options'][_0xe3f4('0x30')]||null:null,'transaction':_0x371dee,'lock':_0x371dee[_0xe3f4('0x31')][_0xe3f4('0x32')],'include':[{'model':db[_0xe3f4('0x2c')],'as':_0xe3f4('0x33'),'attributes':_[_0xe3f4('0x34')](_0x2931c4)}]})[_0xe3f4('0xb')](function(_0x40e38e){var _0x41ea52=[];for(var _0x324b30=0x0;_0x324b30<_0x40e38e[_0xe3f4('0x35')];_0x324b30+=0x1){_0x41ea52[_0xe3f4('0x36')](_0x40e38e[_0x324b30][_0xe3f4('0x28')](_0x2a6635[_0xe3f4('0x25')],{'transaction':_0x371dee}));}return BPromise[_0xe3f4('0x37')](_0x41ea52);});})[_0xe3f4('0xb')](function(_0x30abc2){logger[_0xe3f4('0xc')]('GetContactDialer',_0x2a6635);logger[_0xe3f4('0x20')](_0xe3f4('0x2b'),_0x2a6635,JSON['stringify'](_0x30abc2));_0x22e619(_0x30abc2);})['catch'](function(_0x275c74){logger[_0xe3f4('0x10')](_0xe3f4('0x2b'),_0x275c74[_0xe3f4('0x13')],_0x2a6635);_0x2bdb85(_0x5ec00b['error'](0x1f4,_0x275c74[_0xe3f4('0x13')]));});});});};exports[_0xe3f4('0x38')]=function(_0xa7ef67){var _0x4ce26f=this;return new Promise(function(_0x1da606,_0x280ac3){return db['sequelize'][_0xe3f4('0x2f')](function(_0x10fc06){return db['CmHopperFinal'][_0xe3f4('0x24')](_0xa7ef67[_0xe3f4('0x25')],{'raw':_0xa7ef67[_0xe3f4('0x19')]?_0xa7ef67[_0xe3f4('0x19')][_0xe3f4('0x23')]===undefined?!![]:![]:!![],'transaction':_0x10fc06})[_0xe3f4('0xb')](function(){return db['CmHopper']['destroy']({'where':_0xa7ef67[_0xe3f4('0x19')]?_0xa7ef67[_0xe3f4('0x19')]['where']||null:null,'transaction':_0x10fc06});});})[_0xe3f4('0xb')](function(_0x339d60){logger[_0xe3f4('0xc')](_0xe3f4('0x38'),_0xa7ef67);logger[_0xe3f4('0x20')]('MoveContactManagedDialer',_0xa7ef67,JSON['stringify'](_0x339d60));_0x1da606(_0x339d60);})[_0xe3f4('0x15')](function(_0x16c199){logger[_0xe3f4('0x10')](_0xe3f4('0x38'),_0x16c199[_0xe3f4('0x13')],_0xa7ef67);_0x280ac3(_0x4ce26f[_0xe3f4('0x10')](0x1f4,_0x16c199[_0xe3f4('0x13')]));});});};exports['CountReScheduled']=function(_0x487267){var _0x401af3=this;return new Promise(function(_0x45ad46,_0x86fb5){return db[_0xe3f4('0x17')]['findAll']({'raw':_0x487267[_0xe3f4('0x19')]?_0x487267[_0xe3f4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x487267[_0xe3f4('0x19')]?_0x487267['options'][_0xe3f4('0x1a')]||null:null,'attributes':[[db[_0xe3f4('0x2e')]['fn'](_0xe3f4('0x39'),db[_0xe3f4('0x2e')]['fn']('IF',db[_0xe3f4('0x2e')]['literal'](_0xe3f4('0x3a')+util['format']('\x22%s\x22',moment()[_0xe3f4('0x3b')](_0xe3f4('0x3c')))+'\x20,\x201,\x20null'))),_0xe3f4('0x3d')]]})['then'](function(_0x3c6ed6){logger[_0xe3f4('0xc')](_0xe3f4('0x3e'),_0x487267);logger[_0xe3f4('0x20')]('CountReScheduled',_0x487267,JSON[_0xe3f4('0xf')](_0x3c6ed6));_0x45ad46(_0x3c6ed6);})['catch'](function(_0xd871f5){logger[_0xe3f4('0x10')](_0xe3f4('0x3e'),_0xd871f5[_0xe3f4('0x13')],_0x487267);_0x86fb5(_0x401af3[_0xe3f4('0x10')](0x1f4,_0xd871f5[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x3f')]=function(_0x1350b4){var _0x5dfd4f=this;return new Promise(function(_0x4a3df7,_0x3ab35b){return db[_0xe3f4('0x2c')][_0xe3f4('0x2d')]()[_0xe3f4('0xb')](function(_0x116a61){return db[_0xe3f4('0x2e')]['transaction'](function(_0x4de943){return db[_0xe3f4('0x17')][_0xe3f4('0x18')]({'where':_0x1350b4[_0xe3f4('0x19')]?_0x1350b4[_0xe3f4('0x19')]['where']||null:null,'attributes':_0x1350b4['options']?_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x1b')]||null:null,'limit':0x1,'order':_0x1350b4[_0xe3f4('0x19')]?_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x30')]||null:null,'group':db[_0xe3f4('0x17')][_0xe3f4('0x40')],'transaction':_0x4de943,'lock':_0x4de943[_0xe3f4('0x31')][_0xe3f4('0x32')],'include':_0x1350b4[_0xe3f4('0x19')]?_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x1d')],function(_0x4951c2){return{'model':db[_0x4951c2[_0xe3f4('0x1f')]],'as':_0x4951c2['as'],'attributes':_0x4951c2[_0xe3f4('0x1b')],'include':_0x4951c2['include']?_[_0xe3f4('0x1e')](_0x4951c2[_0xe3f4('0x1d')],function(_0xc47613){return{'model':db[_0xc47613[_0xe3f4('0x1f')]],'as':_0xc47613['as'],'attributes':_0xc47613[_0xe3f4('0x1b')],'include':_0xc47613[_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0xc47613['include'],function(_0x2e0296){return{'model':db[_0x2e0296[_0xe3f4('0x1f')]],'as':_0x2e0296['as'],'attributes':_0x2e0296['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b305){var _0x46b531=[];for(var _0x3e2a8a=0x0;_0x3e2a8a<_0x33b305['length'];_0x3e2a8a+=0x1){_0x46b531[_0xe3f4('0x36')](_0x33b305[_0x3e2a8a]['update'](_0x1350b4[_0xe3f4('0x25')],{'transaction':_0x4de943}));}return BPromise[_0xe3f4('0x37')](_0x46b531);});})[_0xe3f4('0xb')](function(_0x3b5125){logger[_0xe3f4('0xc')](_0xe3f4('0x3f'),_0x1350b4);logger[_0xe3f4('0x20')](_0xe3f4('0x3f'),_0x1350b4,JSON[_0xe3f4('0xf')](_0x3b5125));_0x4a3df7(_0x3b5125);})[_0xe3f4('0x15')](function(_0x3529ce){logger['error']('GetContactRecallMe',_0x3529ce['message'],_0x1350b4);_0x3ab35b(_0x5dfd4f['error'](0x1f4,_0x3529ce[_0xe3f4('0x13')]));});});});}; \ No newline at end of file +var _0x68da=['CreateCmHopper','body','UpdateCmHopper','update','limit','destroy','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','transaction','CmHopperFinal','create','CountReScheduled','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','ShowCmHopper','find'];(function(_0x1882f2,_0x590ccb){var _0x19f2a1=function(_0xbedd1b){while(--_0xbedd1b){_0x1882f2['push'](_0x1882f2['shift']());}};_0x19f2a1(++_0x590ccb);}(_0x68da,0x15d));var _0xa68d=function(_0x531607,_0x73fa88){_0x531607=_0x531607-0x0;var _0x1b1fbb=_0x68da[_0x531607];return _0x1b1fbb;};'use strict';var _=require(_0xa68d('0x0'));var util=require(_0xa68d('0x1'));var moment=require(_0xa68d('0x2'));var BPromise=require(_0xa68d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa68d('0x4'));var db=require(_0xa68d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa68d('0x6'))(_0xa68d('0x7'));var config=require(_0xa68d('0x8'));var jayson=require(_0xa68d('0x9'));var client=jayson['client'][_0xa68d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x399af4,_0x27f3bb,_0x392000){return new BPromise(function(_0x15061f,_0x42f01d){return client[_0xa68d('0xb')](_0x399af4,_0x392000)[_0xa68d('0xc')](function(_0x4164b5){logger['info'](_0xa68d('0xd'),_0x27f3bb,_0xa68d('0xe'));logger[_0xa68d('0xf')](_0xa68d('0x10'),_0x27f3bb,_0xa68d('0xe'),JSON[_0xa68d('0x11')](_0x4164b5));if(_0x4164b5['error']){if(_0x4164b5[_0xa68d('0x12')]['code']===0x1f4){logger[_0xa68d('0x12')]('CmHopper,\x20%s,\x20%s',_0x27f3bb,_0x4164b5[_0xa68d('0x12')][_0xa68d('0x13')]);return _0x42f01d(_0x4164b5[_0xa68d('0x12')][_0xa68d('0x13')]);}logger[_0xa68d('0x12')](_0xa68d('0xd'),_0x27f3bb,_0x4164b5[_0xa68d('0x12')]['message']);return _0x15061f(_0x4164b5[_0xa68d('0x12')]['message']);}else{logger[_0xa68d('0x14')](_0xa68d('0xd'),_0x27f3bb,_0xa68d('0xe'));_0x15061f(_0x4164b5[_0xa68d('0x15')][_0xa68d('0x13')]);}})[_0xa68d('0x16')](function(_0x12ebc9){logger['error'](_0xa68d('0xd'),_0x27f3bb,_0x12ebc9);_0x42f01d(_0x12ebc9);});});}exports[_0xa68d('0x17')]=function(_0x21587f){var _0x4a3260=this;return new Promise(function(_0x54ee27,_0x56f5fc){return db[_0xa68d('0x18')][_0xa68d('0x19')]({'raw':_0x21587f[_0xa68d('0x1a')]?_0x21587f[_0xa68d('0x1a')][_0xa68d('0x1b')]===undefined?!![]:![]:!![],'where':_0x21587f[_0xa68d('0x1a')]?_0x21587f[_0xa68d('0x1a')][_0xa68d('0x1c')]||null:null,'attributes':_0x21587f[_0xa68d('0x1a')]?_0x21587f['options'][_0xa68d('0x1d')]||null:null,'limit':_0x21587f[_0xa68d('0x1a')]?_0x21587f['options']['limit']||null:null,'include':_0x21587f[_0xa68d('0x1a')]?_0x21587f['options'][_0xa68d('0x1e')]?_[_0xa68d('0x1f')](_0x21587f[_0xa68d('0x1a')][_0xa68d('0x1e')],function(_0x4944d4){return{'model':db[_0x4944d4['model']],'as':_0x4944d4['as'],'attributes':_0x4944d4['attributes'],'include':_0x4944d4[_0xa68d('0x1e')]?_['map'](_0x4944d4[_0xa68d('0x1e')],function(_0x4fc347){return{'model':db[_0x4fc347['model']],'as':_0x4fc347['as'],'attributes':_0x4fc347[_0xa68d('0x1d')],'include':_0x4fc347[_0xa68d('0x1e')]?_[_0xa68d('0x1f')](_0x4fc347[_0xa68d('0x1e')],function(_0x3d7423){return{'model':db[_0x3d7423[_0xa68d('0x20')]],'as':_0x3d7423['as'],'attributes':_0x3d7423['attributes']};}):[]};}):[]};}):[]:[]})[_0xa68d('0xc')](function(_0x4d505c){logger[_0xa68d('0x14')]('GetCmHopper',_0x21587f);logger[_0xa68d('0xf')](_0xa68d('0x17'),_0x21587f,JSON[_0xa68d('0x11')](_0x4d505c));_0x54ee27(_0x4d505c);})['catch'](function(_0xbca186){logger['error'](_0xa68d('0x17'),_0xbca186[_0xa68d('0x13')],_0x21587f);_0x56f5fc(_0x4a3260[_0xa68d('0x12')](0x1f4,_0xbca186[_0xa68d('0x13')]));});});};exports[_0xa68d('0x21')]=function(_0x577455){var _0x177452=this;return new Promise(function(_0x266201,_0x2c9466){return db[_0xa68d('0x18')][_0xa68d('0x22')]({'raw':_0x577455[_0xa68d('0x1a')]?_0x577455[_0xa68d('0x1a')][_0xa68d('0x1b')]===undefined?!![]:![]:!![],'where':_0x577455[_0xa68d('0x1a')]?_0x577455[_0xa68d('0x1a')][_0xa68d('0x1c')]||null:null,'attributes':_0x577455[_0xa68d('0x1a')]?_0x577455['options'][_0xa68d('0x1d')]||null:null,'include':_0x577455[_0xa68d('0x1a')]?_0x577455[_0xa68d('0x1a')][_0xa68d('0x1e')]?_[_0xa68d('0x1f')](_0x577455[_0xa68d('0x1a')][_0xa68d('0x1e')],function(_0x5432e9){return{'model':db[_0x5432e9['model']],'as':_0x5432e9['as'],'attributes':_0x5432e9[_0xa68d('0x1d')],'include':_0x5432e9[_0xa68d('0x1e')]?_[_0xa68d('0x1f')](_0x5432e9['include'],function(_0x15db64){return{'model':db[_0x15db64[_0xa68d('0x20')]],'as':_0x15db64['as'],'attributes':_0x15db64['attributes'],'include':_0x15db64[_0xa68d('0x1e')]?_['map'](_0x15db64[_0xa68d('0x1e')],function(_0x662a40){return{'model':db[_0x662a40['model']],'as':_0x662a40['as'],'attributes':_0x662a40[_0xa68d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa68d('0xc')](function(_0xf396ad){logger[_0xa68d('0x14')](_0xa68d('0x21'),_0x577455);logger['debug'](_0xa68d('0x21'),_0x577455,JSON[_0xa68d('0x11')](_0xf396ad));_0x266201(_0xf396ad);})[_0xa68d('0x16')](function(_0x21ac23){logger[_0xa68d('0x12')]('ShowCmHopper',_0x21ac23[_0xa68d('0x13')],_0x577455);_0x2c9466(_0x177452[_0xa68d('0x12')](0x1f4,_0x21ac23[_0xa68d('0x13')]));});});};exports[_0xa68d('0x23')]=function(_0x5bc3fc){var _0x324cd3=this;return new Promise(function(_0x864d94,_0x381a6a){return db[_0xa68d('0x18')]['create'](_0x5bc3fc[_0xa68d('0x24')],{'raw':_0x5bc3fc[_0xa68d('0x1a')]?_0x5bc3fc[_0xa68d('0x1a')][_0xa68d('0x1b')]===undefined?!![]:![]:!![]})[_0xa68d('0xc')](function(_0x334309){logger[_0xa68d('0x14')](_0xa68d('0x23'),_0x5bc3fc);logger[_0xa68d('0xf')](_0xa68d('0x23'),_0x5bc3fc,JSON[_0xa68d('0x11')](_0x334309));_0x864d94(_0x334309);})[_0xa68d('0x16')](function(_0x4d9d7d){logger[_0xa68d('0x12')](_0xa68d('0x23'),_0x4d9d7d[_0xa68d('0x13')],_0x5bc3fc);_0x381a6a(_0x324cd3[_0xa68d('0x12')](0x1f4,_0x4d9d7d[_0xa68d('0x13')]));});});};exports[_0xa68d('0x25')]=function(_0x4dd726){var _0x269adb=this;return new Promise(function(_0x49d203,_0x1329df){return db[_0xa68d('0x18')][_0xa68d('0x26')](_0x4dd726[_0xa68d('0x24')],{'raw':_0x4dd726[_0xa68d('0x1a')]?_0x4dd726['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dd726['options']?_0x4dd726[_0xa68d('0x1a')][_0xa68d('0x1c')]||null:null,'attributes':_0x4dd726[_0xa68d('0x1a')]?_0x4dd726['options'][_0xa68d('0x1d')]||null:null,'limit':_0x4dd726[_0xa68d('0x1a')]?_0x4dd726[_0xa68d('0x1a')][_0xa68d('0x27')]||null:null})[_0xa68d('0xc')](function(_0x3f7388){logger[_0xa68d('0x14')](_0xa68d('0x25'),_0x4dd726);logger[_0xa68d('0xf')](_0xa68d('0x25'),_0x4dd726,JSON[_0xa68d('0x11')](_0x3f7388));_0x49d203(_0x3f7388);})[_0xa68d('0x16')](function(_0x2d8dae){logger[_0xa68d('0x12')]('UpdateCmHopper',_0x2d8dae['message'],_0x4dd726);_0x1329df(_0x269adb[_0xa68d('0x12')](0x1f4,_0x2d8dae[_0xa68d('0x13')]));});});};exports['DestroyCmHopper']=function(_0xfa328d){var _0x14ceec=this;return new Promise(function(_0x369147,_0x23f6f5){return db[_0xa68d('0x18')][_0xa68d('0x28')]({'where':_0xfa328d[_0xa68d('0x1a')]?_0xfa328d[_0xa68d('0x1a')][_0xa68d('0x1c')]||null:null})[_0xa68d('0xc')](function(_0x1fabff){logger[_0xa68d('0x14')](_0xa68d('0x29'),_0xfa328d);logger['debug']('DestroyCmHopper',_0xfa328d,JSON[_0xa68d('0x11')](_0x1fabff));_0x369147(_0x1fabff);})[_0xa68d('0x16')](function(_0x4724e3){logger[_0xa68d('0x12')](_0xa68d('0x29'),_0x4724e3['message'],_0xfa328d);_0x23f6f5(_0x14ceec[_0xa68d('0x12')](0x1f4,_0x4724e3['message']));});});};exports[_0xa68d('0x2a')]=function(_0x4bdf64){var _0xe565fc=this;return new Promise(function(_0x2a10c8,_0x3b353e){return db[_0xa68d('0x2b')][_0xa68d('0x2c')]()['then'](function(_0x152584){return db[_0xa68d('0x2d')]['transaction'](function(_0x35c616){return db['CmHopper']['findAll']({'where':_0x4bdf64['options']?_0x4bdf64[_0xa68d('0x1a')][_0xa68d('0x1c')]||null:null,'attributes':_0x4bdf64['options']?_0x4bdf64[_0xa68d('0x1a')][_0xa68d('0x1d')]||null:null,'limit':_0x4bdf64[_0xa68d('0x1a')]?_0x4bdf64[_0xa68d('0x1a')]['limit']||null:null,'order':_0x4bdf64[_0xa68d('0x1a')]?_0x4bdf64[_0xa68d('0x1a')][_0xa68d('0x2e')]||null:null,'transaction':_0x35c616,'lock':_0x35c616[_0xa68d('0x2f')][_0xa68d('0x30')],'include':[{'model':db[_0xa68d('0x2b')],'as':_0xa68d('0x31'),'attributes':_[_0xa68d('0x32')](_0x152584)}]})['then'](function(_0x925e44){var _0x478ed8=[];for(var _0x235746=0x0;_0x235746<_0x925e44[_0xa68d('0x33')];_0x235746+=0x1){_0x478ed8[_0xa68d('0x34')](_0x925e44[_0x235746][_0xa68d('0x26')](_0x4bdf64[_0xa68d('0x24')],{'transaction':_0x35c616}));}return BPromise[_0xa68d('0x35')](_0x478ed8);});})['then'](function(_0x4c7fed){logger['info'](_0xa68d('0x2a'),_0x4bdf64);logger[_0xa68d('0xf')](_0xa68d('0x2a'),_0x4bdf64,JSON[_0xa68d('0x11')](_0x4c7fed));_0x2a10c8(_0x4c7fed);})['catch'](function(_0xad0f5a){logger[_0xa68d('0x12')](_0xa68d('0x2a'),_0xad0f5a[_0xa68d('0x13')],_0x4bdf64);_0x3b353e(_0xe565fc[_0xa68d('0x12')](0x1f4,_0xad0f5a[_0xa68d('0x13')]));});});});};exports[_0xa68d('0x36')]=function(_0xe5551a){var _0x46df98=this;return new Promise(function(_0x353a80,_0x487423){return db['sequelize'][_0xa68d('0x37')](function(_0x5daac7){return db[_0xa68d('0x38')][_0xa68d('0x39')](_0xe5551a['body'],{'raw':_0xe5551a[_0xa68d('0x1a')]?_0xe5551a[_0xa68d('0x1a')][_0xa68d('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x5daac7})['then'](function(){return db['CmHopper'][_0xa68d('0x28')]({'where':_0xe5551a['options']?_0xe5551a[_0xa68d('0x1a')]['where']||null:null,'transaction':_0x5daac7});});})[_0xa68d('0xc')](function(_0x93f60b){logger[_0xa68d('0x14')](_0xa68d('0x36'),_0xe5551a);logger['debug'](_0xa68d('0x36'),_0xe5551a,JSON[_0xa68d('0x11')](_0x93f60b));_0x353a80(_0x93f60b);})[_0xa68d('0x16')](function(_0x1ea2f9){logger[_0xa68d('0x12')](_0xa68d('0x36'),_0x1ea2f9['message'],_0xe5551a);_0x487423(_0x46df98[_0xa68d('0x12')](0x1f4,_0x1ea2f9[_0xa68d('0x13')]));});});};exports[_0xa68d('0x3a')]=function(_0x378faf){var _0x4dd34b=this;return new Promise(function(_0x12a87c,_0x26b4ad){return db[_0xa68d('0x18')]['findAll']({'raw':_0x378faf['options']?_0x378faf[_0xa68d('0x1a')][_0xa68d('0x1b')]===undefined?!![]:![]:!![],'where':_0x378faf[_0xa68d('0x1a')]?_0x378faf['options']['where']||null:null,'attributes':[[db[_0xa68d('0x2d')]['fn']('COUNT',db[_0xa68d('0x2d')]['fn']('IF',db[_0xa68d('0x2d')]['literal']('`scheduledat`\x20>=\x20'+util[_0xa68d('0x3b')]('\x22%s\x22',moment()[_0xa68d('0x3b')](_0xa68d('0x3c')))+_0xa68d('0x3d')))),_0xa68d('0x3e')]]})[_0xa68d('0xc')](function(_0x15d2e4){logger[_0xa68d('0x14')](_0xa68d('0x3a'),_0x378faf);logger[_0xa68d('0xf')]('CountReScheduled',_0x378faf,JSON[_0xa68d('0x11')](_0x15d2e4));_0x12a87c(_0x15d2e4);})[_0xa68d('0x16')](function(_0xfb4c8b){logger[_0xa68d('0x12')](_0xa68d('0x3a'),_0xfb4c8b[_0xa68d('0x13')],_0x378faf);_0x26b4ad(_0x4dd34b[_0xa68d('0x12')](0x1f4,_0xfb4c8b[_0xa68d('0x13')]));});});};exports[_0xa68d('0x3f')]=function(_0x4e0d91){var _0x1f2b4a=this;return new Promise(function(_0x1a62c6,_0x450745){return db[_0xa68d('0x2b')][_0xa68d('0x2c')]()[_0xa68d('0xc')](function(_0x191178){return db[_0xa68d('0x2d')][_0xa68d('0x37')](function(_0x1572ac){return db[_0xa68d('0x18')][_0xa68d('0x19')]({'where':_0x4e0d91[_0xa68d('0x1a')]?_0x4e0d91[_0xa68d('0x1a')][_0xa68d('0x1c')]||null:null,'attributes':_0x4e0d91[_0xa68d('0x1a')]?_0x4e0d91[_0xa68d('0x1a')][_0xa68d('0x1d')]||null:null,'limit':0x1,'order':_0x4e0d91[_0xa68d('0x1a')]?_0x4e0d91[_0xa68d('0x1a')][_0xa68d('0x2e')]||null:null,'group':db[_0xa68d('0x18')]['UserId'],'transaction':_0x1572ac,'lock':_0x1572ac['LOCK'][_0xa68d('0x30')],'include':_0x4e0d91['options']?_0x4e0d91[_0xa68d('0x1a')][_0xa68d('0x1e')]?_['map'](_0x4e0d91['options'][_0xa68d('0x1e')],function(_0x36a750){return{'model':db[_0x36a750[_0xa68d('0x20')]],'as':_0x36a750['as'],'attributes':_0x36a750[_0xa68d('0x1d')],'include':_0x36a750[_0xa68d('0x1e')]?_[_0xa68d('0x1f')](_0x36a750[_0xa68d('0x1e')],function(_0x1bce4b){return{'model':db[_0x1bce4b[_0xa68d('0x20')]],'as':_0x1bce4b['as'],'attributes':_0x1bce4b[_0xa68d('0x1d')],'include':_0x1bce4b[_0xa68d('0x1e')]?_[_0xa68d('0x1f')](_0x1bce4b[_0xa68d('0x1e')],function(_0x5897d8){return{'model':db[_0x5897d8[_0xa68d('0x20')]],'as':_0x5897d8['as'],'attributes':_0x5897d8[_0xa68d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa68d('0xc')](function(_0xf2465e){var _0x428ea1=[];for(var _0x5c8974=0x0;_0x5c8974<_0xf2465e[_0xa68d('0x33')];_0x5c8974+=0x1){_0x428ea1['push'](_0xf2465e[_0x5c8974][_0xa68d('0x26')](_0x4e0d91['body'],{'transaction':_0x1572ac}));}return BPromise[_0xa68d('0x35')](_0x428ea1);});})[_0xa68d('0xc')](function(_0x2522be){logger[_0xa68d('0x14')](_0xa68d('0x3f'),_0x4e0d91);logger[_0xa68d('0xf')]('GetContactRecallMe',_0x4e0d91,JSON[_0xa68d('0x11')](_0x2522be));_0x1a62c6(_0x2522be);})[_0xa68d('0x16')](function(_0x536fc5){logger[_0xa68d('0x12')]('GetContactRecallMe',_0x536fc5[_0xa68d('0x13')],_0x4e0d91);_0x450745(_0x1f2b4a[_0xa68d('0x12')](0x1f4,_0x536fc5[_0xa68d('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 87681a9..3d06ceb 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 _0xe229=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/opencontacts','getOpenContacts','post','create','/preview','getPreview','put','/:id','delete','destroy','exports','multer'];(function(_0x4a3b99,_0x1c33e7){var _0x42db20=function(_0x30e72b){while(--_0x30e72b){_0x4a3b99['push'](_0x4a3b99['shift']());}};_0x42db20(++_0x1c33e7);}(_0xe229,0x1df));var _0x9e22=function(_0x2d892d,_0xaac53f){_0x2d892d=_0x2d892d-0x0;var _0x1d29e5=_0xe229[_0x2d892d];return _0x1d29e5;};'use strict';var multer=require(_0x9e22('0x0'));var util=require(_0x9e22('0x1'));var path=require(_0x9e22('0x2'));var timeout=require(_0x9e22('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9e22('0x4'));var interaction=require(_0x9e22('0x5'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0x9e22('0x6')]('/',auth[_0x9e22('0x7')](),controller[_0x9e22('0x8')]);router[_0x9e22('0x6')]('/describe',auth[_0x9e22('0x7')](),controller['describe']);router[_0x9e22('0x6')](_0x9e22('0x9'),auth[_0x9e22('0x7')](),controller[_0x9e22('0xa')]);router[_0x9e22('0x6')]('/:id',auth[_0x9e22('0x7')](),controller['show']);router[_0x9e22('0xb')]('/',auth['isAuthenticated'](),controller[_0x9e22('0xc')]);router[_0x9e22('0xb')](_0x9e22('0xd'),auth['isAuthenticated'](),controller[_0x9e22('0xe')]);router[_0x9e22('0xf')](_0x9e22('0x10'),auth[_0x9e22('0x7')](),controller['update']);router[_0x9e22('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9e22('0x12')]);module[_0x9e22('0x13')]=router; \ No newline at end of file +var _0xc9db=['index','/describe','isAuthenticated','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','update','delete','multer','connect-timeout','express','Router','../../components/interaction/service','get'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc9db,0xa5));var _0xbc9d=function(_0x4ecf56,_0x461c09){_0x4ecf56=_0x4ecf56-0x0;var _0x55cf7c=_0xc9db[_0x4ecf56];return _0x55cf7c;};'use strict';var multer=require(_0xbc9d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xbc9d('0x1'));var express=require(_0xbc9d('0x2'));var router=express[_0xbc9d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbc9d('0x4'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0xbc9d('0x5')]('/',auth['isAuthenticated'](),controller[_0xbc9d('0x6')]);router[_0xbc9d('0x5')](_0xbc9d('0x7'),auth[_0xbc9d('0x8')](),controller['describe']);router[_0xbc9d('0x5')]('/opencontacts',auth[_0xbc9d('0x8')](),controller[_0xbc9d('0x9')]);router[_0xbc9d('0x5')](_0xbc9d('0xa'),auth[_0xbc9d('0x8')](),controller[_0xbc9d('0xb')]);router[_0xbc9d('0xc')]('/',auth['isAuthenticated'](),controller[_0xbc9d('0xd')]);router['post'](_0xbc9d('0xe'),auth[_0xbc9d('0x8')](),controller[_0xbc9d('0xf')]);router[_0xbc9d('0x10')](_0xbc9d('0xa'),auth[_0xbc9d('0x8')](),controller[_0xbc9d('0x11')]);router[_0xbc9d('0x12')]('/:id',auth[_0xbc9d('0x8')](),controller['destroy']);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 3aa0f6c..f53d3b2 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 _0x1f15=['STRING','INTEGER','contactListQueue','sequelize'];(function(_0x5db859,_0x52b66b){var _0x153661=function(_0x9ddbb){while(--_0x9ddbb){_0x5db859['push'](_0x5db859['shift']());}};_0x153661(++_0x52b66b);}(_0x1f15,0x10b));var _0x51f1=function(_0x4e1ad0,_0x354c9a){_0x4e1ad0=_0x4e1ad0-0x0;var _0x2a06a3=_0x1f15[_0x4e1ad0];return _0x2a06a3;};'use strict';var moment=require('moment');var Sequelize=require(_0x51f1('0x0'));module['exports']={'phone':{'type':Sequelize[_0x51f1('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x51f1('0x2')],'unique':_0x51f1('0x3')},'ListId':{'type':Sequelize[_0x51f1('0x2')],'unique':_0x51f1('0x3')},'VoiceQueueId':{'type':Sequelize[_0x51f1('0x2')],'unique':_0x51f1('0x3')}}; \ No newline at end of file +var _0xc212=['STRING','INTEGER','contactListQueue','moment','sequelize'];(function(_0x460150,_0x232949){var _0x340677=function(_0x5b7e32){while(--_0x5b7e32){_0x460150['push'](_0x460150['shift']());}};_0x340677(++_0x232949);}(_0xc212,0x111));var _0x2c21=function(_0x3fcc4a,_0x4ae03d){_0x3fcc4a=_0x3fcc4a-0x0;var _0x53b598=_0xc212[_0x3fcc4a];return _0x53b598;};'use strict';var moment=require(_0x2c21('0x0'));var Sequelize=require(_0x2c21('0x1'));module['exports']={'phone':{'type':Sequelize[_0x2c21('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2c21('0x3')],'unique':_0x2c21('0x4')},'ListId':{'type':Sequelize[_0x2c21('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0x2c21('0x3')],'unique':_0x2c21('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 1856365..6899c8f 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 _0x505d=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','intersection','include','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','status','json','count','offset','set','apply','save','then','error','stack','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','name','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0x505d,0x93));var _0xd505=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x505d[_0x37c22c];return _0x119d79;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd505('0x0'));var zipdir=require(_0xd505('0x1'));var jsonpatch=require(_0xd505('0x2'));var rp=require(_0xd505('0x3'));var moment=require(_0xd505('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd505('0x5'));var util=require(_0xd505('0x6'));var path=require(_0xd505('0x7'));var sox=require(_0xd505('0x8'));var csv=require('to-csv');var ejs=require(_0xd505('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd505('0xa'));var crypto=require(_0xd505('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd505('0xc'));var toCsv=require(_0xd505('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd505('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd505('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd505('0x10'));var logger=require('../../config/logger')(_0xd505('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40d201,_0x52eafa){_0x52eafa=_0x52eafa||0xcc;return function(_0x477f1b){if(_0x477f1b){return _0x40d201[_0xd505('0x12')](_0x52eafa);}return _0x40d201['status'](_0x52eafa)['end']();};}function respondWithResult(_0x712b99,_0x39cd89){_0x39cd89=_0x39cd89||0xc8;return function(_0x5d8433){if(_0x5d8433){return _0x712b99[_0xd505('0x13')](_0x39cd89)[_0xd505('0x14')](_0x5d8433);}};}function respondWithFilteredResult(_0xe9bea6,_0x366df6){return function(_0x1052da){if(_0x1052da){var _0x20088a=_0x1052da[_0xd505('0x15')],_0x50e8d2=_0x366df6['offset'],_0x2b8094=_0x366df6[_0xd505('0x16')]+_0x366df6['limit'],_0xf71091;if(_0x2b8094>=_0x20088a){_0x2b8094=_0x20088a;_0xf71091=0xc8;}else{_0xf71091=0xce;}_0xe9bea6[_0xd505('0x13')](_0xf71091);return _0xe9bea6[_0xd505('0x17')]('Content-Range',_0x50e8d2+'-'+_0x2b8094+'/'+_0x20088a)[_0xd505('0x14')](_0x1052da);}return null;};}function patchUpdates(_0xe5341){return function(_0x471797){try{jsonpatch[_0xd505('0x18')](_0x471797,_0xe5341,!![]);}catch(_0x405471){return BPromise['reject'](_0x405471);}return _0x471797[_0xd505('0x19')]();};}function saveUpdates(_0x17e5dc,_0x5229d2){return function(_0x5ccf7e){if(_0x5ccf7e){return _0x5ccf7e['update'](_0x17e5dc)[_0xd505('0x1a')](function(_0x9a9b02){return _0x9a9b02;});}return null;};}function removeEntity(_0x5f1eea,_0x24c9d6){return function(_0x570d6a){if(_0x570d6a){return _0x570d6a['destroy']()[_0xd505('0x1a')](function(){_0x5f1eea[_0xd505('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4118c5,_0x50ebfa){return function(_0x4e885b){if(!_0x4e885b){_0x4118c5[_0xd505('0x12')](0x194);}return _0x4e885b;};}function handleError(_0x2a0465,_0xe42477){_0xe42477=_0xe42477||0x1f4;return function(_0x55b70b){logger[_0xd505('0x1b')](_0x55b70b[_0xd505('0x1c')]);if(_0x55b70b['name']){delete _0x55b70b['name'];}_0x2a0465[_0xd505('0x13')](_0xe42477)[_0xd505('0x1d')](_0x55b70b);};}exports[_0xd505('0x1e')]=function(_0x287912,_0x217a4e){var _0x3ee3ef={},_0x3c01f0={},_0x5a617e={'count':0x0,'rows':[]};var _0x3d360a=_[_0xd505('0x1f')](db[_0xd505('0x20')][_0xd505('0x21')],function(_0x5894b2){return{'name':_0x5894b2[_0xd505('0x22')],'type':_0x5894b2[_0xd505('0x23')]['key']};});_0x3c01f0['model']=_['map'](_0x3d360a,_0xd505('0x24'));_0x3c01f0[_0xd505('0x25')]=_[_0xd505('0x26')](_0x287912['query']);_0x3c01f0[_0xd505('0x27')]=_['intersection'](_0x3c01f0[_0xd505('0x28')],_0x3c01f0[_0xd505('0x25')]);_0x3ee3ef[_0xd505('0x29')]=_['intersection'](_0x3c01f0[_0xd505('0x28')],qs[_0xd505('0x2a')](_0x287912['query'][_0xd505('0x2a')]));_0x3ee3ef[_0xd505('0x29')]=_0x3ee3ef[_0xd505('0x29')][_0xd505('0x2b')]?_0x3ee3ef['attributes']:_0x3c01f0['model'];if(!_0x287912[_0xd505('0x25')][_0xd505('0x2c')](_0xd505('0x2d'))){_0x3ee3ef[_0xd505('0x2e')]=qs[_0xd505('0x2e')](_0x287912[_0xd505('0x25')]['limit']);_0x3ee3ef[_0xd505('0x16')]=qs['offset'](_0x287912[_0xd505('0x25')]['offset']);}_0x3ee3ef[_0xd505('0x2f')]=qs[_0xd505('0x30')](_0x287912[_0xd505('0x25')][_0xd505('0x30')]);_0x3ee3ef[_0xd505('0x31')]=qs[_0xd505('0x27')](_[_0xd505('0x32')](_0x287912[_0xd505('0x25')],_0x3c01f0['filters']));if(_0x287912['query'][_0xd505('0x33')]){_0x3ee3ef[_0xd505('0x31')]=_[_0xd505('0x34')](_0x3ee3ef['where'],{'$or':_[_0xd505('0x1f')](_0x3d360a,function(_0x44e545){if(_0x44e545[_0xd505('0x23')]!==_0xd505('0x35')){var _0x3b6f0c={};_0x3b6f0c[_0x44e545[_0xd505('0x24')]]={'$like':'%'+_0x287912[_0xd505('0x25')][_0xd505('0x33')]+'%'};return _0x3b6f0c;}})});}_0x3ee3ef=_['merge']({},_0x3ee3ef,_0x287912[_0xd505('0x36')]);var _0x1566c2={'where':_0x3ee3ef[_0xd505('0x31')]};return db['CmHopperBlack'][_0xd505('0x15')](_0x1566c2)[_0xd505('0x1a')](function(_0x5b965c){_0x5a617e[_0xd505('0x15')]=_0x5b965c;if(_0x287912[_0xd505('0x25')][_0xd505('0x37')]){_0x3ee3ef['include']=[{'all':!![]}];}return db[_0xd505('0x20')][_0xd505('0x38')](_0x3ee3ef);})[_0xd505('0x1a')](function(_0x42b1a2){_0x5a617e[_0xd505('0x39')]=_0x42b1a2;return _0x5a617e;})[_0xd505('0x1a')](respondWithFilteredResult(_0x217a4e,_0x3ee3ef))[_0xd505('0x3a')](handleError(_0x217a4e,null));};exports['show']=function(_0x39d1e7,_0x9f522a){var _0x58cd22={'raw':!![],'where':{'id':_0x39d1e7[_0xd505('0x3b')]['id']}},_0x3a1532={};_0x3a1532[_0xd505('0x28')]=_[_0xd505('0x26')](db[_0xd505('0x20')][_0xd505('0x21')]);_0x3a1532['query']=_['keys'](_0x39d1e7[_0xd505('0x25')]);_0x3a1532[_0xd505('0x27')]=_['intersection'](_0x3a1532[_0xd505('0x28')],_0x3a1532[_0xd505('0x25')]);_0x58cd22['attributes']=_[_0xd505('0x3c')](_0x3a1532[_0xd505('0x28')],qs[_0xd505('0x2a')](_0x39d1e7[_0xd505('0x25')][_0xd505('0x2a')]));_0x58cd22[_0xd505('0x29')]=_0x58cd22[_0xd505('0x29')][_0xd505('0x2b')]?_0x58cd22['attributes']:_0x3a1532[_0xd505('0x28')];if(_0x39d1e7[_0xd505('0x25')][_0xd505('0x37')]){_0x58cd22[_0xd505('0x3d')]=[{'all':!![]}];}_0x58cd22=_[_0xd505('0x34')]({},_0x58cd22,_0x39d1e7[_0xd505('0x36')]);return db['CmHopperBlack']['find'](_0x58cd22)['then'](handleEntityNotFound(_0x9f522a,null))['then'](respondWithResult(_0x9f522a,null))[_0xd505('0x3a')](handleError(_0x9f522a,null));};exports[_0xd505('0x3e')]=function(_0x502d59,_0x17b316){if(_0x502d59[_0xd505('0x3f')]['id']){delete _0x502d59[_0xd505('0x3f')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x502d59[_0xd505('0x3b')]['id']}})[_0xd505('0x1a')](handleEntityNotFound(_0x17b316,null))['then'](saveUpdates(_0x502d59['body'],null))['then'](respondWithResult(_0x17b316,null))[_0xd505('0x3a')](handleError(_0x17b316,null));};exports['destroy']=function(_0x4f19ac,_0x318ce8){return db[_0xd505('0x20')][_0xd505('0x40')]({'where':{'id':_0x4f19ac[_0xd505('0x3b')]['id']}})[_0xd505('0x1a')](handleEntityNotFound(_0x318ce8,null))[_0xd505('0x1a')](removeEntity(_0x318ce8,null))['catch'](handleError(_0x318ce8,null));};exports[_0xd505('0x41')]=function(_0x1af58e,_0xa362b){return db['CmHopperBlack'][_0xd505('0x41')]()['then'](respondWithResult(_0xa362b,null))[_0xd505('0x3a')](handleError(_0xa362b,null));}; \ No newline at end of file +var _0xf682=['merge','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','options','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','limit','sort','where','pick','filter','VIRTUAL'];(function(_0x1fc975,_0x5123f9){var _0x317221=function(_0x338317){while(--_0x338317){_0x1fc975['push'](_0x1fc975['shift']());}};_0x317221(++_0x5123f9);}(_0xf682,0x12f));var _0x2f68=function(_0x1814e0,_0x13d5bd){_0x1814e0=_0x1814e0-0x0;var _0x3eeff9=_0xf682[_0x1814e0];return _0x3eeff9;};'use strict';var pdf=require(_0x2f68('0x0'));var emlformat=require(_0x2f68('0x1'));var rimraf=require(_0x2f68('0x2'));var zipdir=require(_0x2f68('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2f68('0x4'));var BPromise=require(_0x2f68('0x5'));var Mustache=require(_0x2f68('0x6'));var util=require(_0x2f68('0x7'));var path=require('path');var sox=require(_0x2f68('0x8'));var csv=require(_0x2f68('0x9'));var ejs=require(_0x2f68('0xa'));var fs=require('fs');var _=require(_0x2f68('0xb'));var squel=require('squel');var crypto=require(_0x2f68('0xc'));var jsforce=require(_0x2f68('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2f68('0xe'));var authService=require(_0x2f68('0xf'));var qs=require(_0x2f68('0x10'));var as=require(_0x2f68('0x11'));var hardwareService=require(_0x2f68('0x12'));var logger=require(_0x2f68('0x13'))(_0x2f68('0x14'));var utils=require(_0x2f68('0x15'));var config=require(_0x2f68('0x16'));var db=require(_0x2f68('0x17'))['db'];function respondWithStatusCode(_0x375ac8,_0xe71dbe){_0xe71dbe=_0xe71dbe||0xcc;return function(_0x2d9b69){if(_0x2d9b69){return _0x375ac8[_0x2f68('0x18')](_0xe71dbe);}return _0x375ac8[_0x2f68('0x19')](_0xe71dbe)[_0x2f68('0x1a')]();};}function respondWithResult(_0x596e19,_0xfb1457){_0xfb1457=_0xfb1457||0xc8;return function(_0x348383){if(_0x348383){return _0x596e19[_0x2f68('0x19')](_0xfb1457)[_0x2f68('0x1b')](_0x348383);}};}function respondWithFilteredResult(_0x12fea5,_0x1c2225){return function(_0x421602){if(_0x421602){var _0x3106d2=_0x421602[_0x2f68('0x1c')],_0x4e4a11=_0x1c2225['offset'],_0x38bd00=_0x1c2225[_0x2f68('0x1d')]+_0x1c2225['limit'],_0xf276f4;if(_0x38bd00>=_0x3106d2){_0x38bd00=_0x3106d2;_0xf276f4=0xc8;}else{_0xf276f4=0xce;}_0x12fea5[_0x2f68('0x19')](_0xf276f4);return _0x12fea5['set'](_0x2f68('0x1e'),_0x4e4a11+'-'+_0x38bd00+'/'+_0x3106d2)[_0x2f68('0x1b')](_0x421602);}return null;};}function patchUpdates(_0x1e6118){return function(_0x4f9f98){try{jsonpatch[_0x2f68('0x1f')](_0x4f9f98,_0x1e6118,!![]);}catch(_0x5d06d2){return BPromise[_0x2f68('0x20')](_0x5d06d2);}return _0x4f9f98[_0x2f68('0x21')]();};}function saveUpdates(_0x1b550c,_0x5b7723){return function(_0x47ac88){if(_0x47ac88){return _0x47ac88[_0x2f68('0x22')](_0x1b550c)[_0x2f68('0x23')](function(_0x4c23ee){return _0x4c23ee;});}return null;};}function removeEntity(_0x4feb59,_0x3141b4){return function(_0x5d6ab9){if(_0x5d6ab9){return _0x5d6ab9[_0x2f68('0x24')]()['then'](function(){_0x4feb59[_0x2f68('0x19')](0xcc)[_0x2f68('0x1a')]();});}};}function handleEntityNotFound(_0x2d0738,_0x14ef8e){return function(_0x31992a){if(!_0x31992a){_0x2d0738[_0x2f68('0x18')](0x194);}return _0x31992a;};}function handleError(_0x5a557f,_0x5cc4f2){_0x5cc4f2=_0x5cc4f2||0x1f4;return function(_0x274518){logger[_0x2f68('0x25')](_0x274518['stack']);if(_0x274518['name']){delete _0x274518[_0x2f68('0x26')];}_0x5a557f['status'](_0x5cc4f2)[_0x2f68('0x27')](_0x274518);};}exports['index']=function(_0x3614c6,_0x388ec0){var _0x154750={},_0x3747cf={},_0x545353={'count':0x0,'rows':[]};var _0x4fe0a5=_[_0x2f68('0x28')](db[_0x2f68('0x29')][_0x2f68('0x2a')],function(_0x44ce52){return{'name':_0x44ce52[_0x2f68('0x2b')],'type':_0x44ce52[_0x2f68('0x2c')][_0x2f68('0x2d')]};});_0x3747cf[_0x2f68('0x2e')]=_[_0x2f68('0x28')](_0x4fe0a5,_0x2f68('0x26'));_0x3747cf[_0x2f68('0x2f')]=_['keys'](_0x3614c6['query']);_0x3747cf[_0x2f68('0x30')]=_['intersection'](_0x3747cf[_0x2f68('0x2e')],_0x3747cf[_0x2f68('0x2f')]);_0x154750[_0x2f68('0x31')]=_['intersection'](_0x3747cf['model'],qs['fields'](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x32')]));_0x154750['attributes']=_0x154750[_0x2f68('0x31')]['length']?_0x154750[_0x2f68('0x31')]:_0x3747cf['model'];if(!_0x3614c6[_0x2f68('0x2f')]['hasOwnProperty']('nolimit')){_0x154750[_0x2f68('0x33')]=qs[_0x2f68('0x33')](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x33')]);_0x154750[_0x2f68('0x1d')]=qs[_0x2f68('0x1d')](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x1d')]);}_0x154750['order']=qs[_0x2f68('0x34')](_0x3614c6[_0x2f68('0x2f')]['sort']);_0x154750[_0x2f68('0x35')]=qs['filters'](_[_0x2f68('0x36')](_0x3614c6[_0x2f68('0x2f')],_0x3747cf[_0x2f68('0x30')]));if(_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x37')]){_0x154750[_0x2f68('0x35')]=_['merge'](_0x154750['where'],{'$or':_[_0x2f68('0x28')](_0x4fe0a5,function(_0x4fcdd1){if(_0x4fcdd1[_0x2f68('0x2c')]!==_0x2f68('0x38')){var _0x4f83d9={};_0x4f83d9[_0x4fcdd1[_0x2f68('0x26')]]={'$like':'%'+_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x37')]+'%'};return _0x4f83d9;}})});}_0x154750=_[_0x2f68('0x39')]({},_0x154750,_0x3614c6['options']);var _0x4b56d1={'where':_0x154750[_0x2f68('0x35')]};return db[_0x2f68('0x29')][_0x2f68('0x1c')](_0x4b56d1)[_0x2f68('0x23')](function(_0x8735d9){_0x545353['count']=_0x8735d9;if(_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x3a')]){_0x154750[_0x2f68('0x3b')]=[{'all':!![]}];}return db[_0x2f68('0x29')][_0x2f68('0x3c')](_0x154750);})[_0x2f68('0x23')](function(_0x443cde){_0x545353[_0x2f68('0x3d')]=_0x443cde;return _0x545353;})[_0x2f68('0x23')](respondWithFilteredResult(_0x388ec0,_0x154750))[_0x2f68('0x3e')](handleError(_0x388ec0,null));};exports[_0x2f68('0x3f')]=function(_0x4ea143,_0x58c130){var _0x3c27eb={'raw':!![],'where':{'id':_0x4ea143[_0x2f68('0x40')]['id']}},_0x2ed970={};_0x2ed970[_0x2f68('0x2e')]=_['keys'](db[_0x2f68('0x29')][_0x2f68('0x2a')]);_0x2ed970[_0x2f68('0x2f')]=_[_0x2f68('0x41')](_0x4ea143[_0x2f68('0x2f')]);_0x2ed970[_0x2f68('0x30')]=_['intersection'](_0x2ed970[_0x2f68('0x2e')],_0x2ed970[_0x2f68('0x2f')]);_0x3c27eb['attributes']=_[_0x2f68('0x42')](_0x2ed970[_0x2f68('0x2e')],qs[_0x2f68('0x32')](_0x4ea143['query'][_0x2f68('0x32')]));_0x3c27eb[_0x2f68('0x31')]=_0x3c27eb[_0x2f68('0x31')][_0x2f68('0x43')]?_0x3c27eb['attributes']:_0x2ed970[_0x2f68('0x2e')];if(_0x4ea143['query'][_0x2f68('0x3a')]){_0x3c27eb[_0x2f68('0x3b')]=[{'all':!![]}];}_0x3c27eb=_[_0x2f68('0x39')]({},_0x3c27eb,_0x4ea143[_0x2f68('0x44')]);return db[_0x2f68('0x29')][_0x2f68('0x45')](_0x3c27eb)[_0x2f68('0x23')](handleEntityNotFound(_0x58c130,null))['then'](respondWithResult(_0x58c130,null))[_0x2f68('0x3e')](handleError(_0x58c130,null));};exports[_0x2f68('0x22')]=function(_0x1bfede,_0x191a2a){if(_0x1bfede[_0x2f68('0x46')]['id']){delete _0x1bfede['body']['id'];}return db[_0x2f68('0x29')][_0x2f68('0x45')]({'where':{'id':_0x1bfede[_0x2f68('0x40')]['id']}})['then'](handleEntityNotFound(_0x191a2a,null))[_0x2f68('0x23')](saveUpdates(_0x1bfede[_0x2f68('0x46')],null))[_0x2f68('0x23')](respondWithResult(_0x191a2a,null))['catch'](handleError(_0x191a2a,null));};exports['destroy']=function(_0x4a7247,_0xe1b091){return db['CmHopperBlack'][_0x2f68('0x45')]({'where':{'id':_0x4a7247[_0x2f68('0x40')]['id']}})['then'](handleEntityNotFound(_0xe1b091,null))[_0x2f68('0x23')](removeEntity(_0xe1b091,null))[_0x2f68('0x3e')](handleError(_0xe1b091,null));};exports[_0x2f68('0x47')]=function(_0x155374,_0x29d087){return db[_0x2f68('0x29')][_0x2f68('0x47')]()[_0x2f68('0x23')](respondWithResult(_0x29d087,null))[_0x2f68('0x3e')](handleError(_0x29d087,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 4bafebd..5059545 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 _0x589b=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x269c2,_0x48f1bd){var _0x1fc56d=function(_0xba1f13){while(--_0xba1f13){_0x269c2['push'](_0x269c2['shift']());}};_0x1fc56d(++_0x48f1bd);}(_0x589b,0x198));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb589('0x0'));var util=require(_0xb589('0x1'));var logger=require(_0xb589('0x2'))(_0xb589('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb589('0x4'));var fs=require('fs');var path=require(_0xb589('0x5'));var rimraf=require(_0xb589('0x6'));var config=require(_0xb589('0x7'));var attributes=require(_0xb589('0x8'));module[_0xb589('0x9')]=function(_0x417df9,_0x38a129){return _0x417df9[_0xb589('0xa')](_0xb589('0xb'),attributes,{'tableName':_0xb589('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea48=['./cmHopperBlack.attributes','define','CmHopperBlack','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment'];(function(_0x57c11b,_0x43221f){var _0x435ffc=function(_0x32fe12){while(--_0x32fe12){_0x57c11b['push'](_0x57c11b['shift']());}};_0x435ffc(++_0x43221f);}(_0xea48,0x189));var _0x8ea4=function(_0x6d6dae,_0x4277fe){_0x6d6dae=_0x6d6dae-0x0;var _0x20efc7=_0xea48[_0x6d6dae];return _0x20efc7;};'use strict';var _=require(_0x8ea4('0x0'));var util=require(_0x8ea4('0x1'));var logger=require(_0x8ea4('0x2'))(_0x8ea4('0x3'));var moment=require('moment');var BPromise=require(_0x8ea4('0x4'));var rp=require(_0x8ea4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ea4('0x6'));var attributes=require(_0x8ea4('0x7'));module['exports']=function(_0x419775,_0x115243){return _0x419775[_0x8ea4('0x8')](_0x8ea4('0x9'),attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index defc9b6..05ac770 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 _0x748c=['info','request\x20sent','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','map','model','include','update','body','raw','then','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x3ca5bb,_0x3c40b9){var _0x22a1f1=function(_0x23af87){while(--_0x23af87){_0x3ca5bb['push'](_0x3ca5bb['shift']());}};_0x22a1f1(++_0x3c40b9);}(_0x748c,0x1db));var _0xc748=function(_0x5c5e47,_0x49e7d7){_0x5c5e47=_0x5c5e47-0x0;var _0x173d16=_0x748c[_0x5c5e47];return _0x173d16;};'use strict';var _=require(_0xc748('0x0'));var util=require('util');var moment=require(_0xc748('0x1'));var BPromise=require(_0xc748('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc748('0x3'));var db=require(_0xc748('0x4'))['db'];var utils=require(_0xc748('0x5'));var logger=require(_0xc748('0x6'))('rpc');var config=require(_0xc748('0x7'));var jayson=require(_0xc748('0x8'));var client=jayson[_0xc748('0x9')][_0xc748('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f2d7c,_0x36fbab,_0x39aafb){return new BPromise(function(_0x4281e3,_0x5e253c){return client[_0xc748('0xb')](_0x3f2d7c,_0x39aafb)['then'](function(_0x4061e4){logger['info'](_0xc748('0xc'),_0x36fbab,'request\x20sent');logger[_0xc748('0xd')](_0xc748('0xe'),_0x36fbab,'request\x20sent',JSON[_0xc748('0xf')](_0x4061e4));if(_0x4061e4['error']){if(_0x4061e4['error'][_0xc748('0x10')]===0x1f4){logger[_0xc748('0x11')](_0xc748('0xc'),_0x36fbab,_0x4061e4[_0xc748('0x11')][_0xc748('0x12')]);return _0x5e253c(_0x4061e4['error'][_0xc748('0x12')]);}logger[_0xc748('0x11')](_0xc748('0xc'),_0x36fbab,_0x4061e4['error'][_0xc748('0x12')]);return _0x4281e3(_0x4061e4[_0xc748('0x11')][_0xc748('0x12')]);}else{logger[_0xc748('0x13')](_0xc748('0xc'),_0x36fbab,_0xc748('0x14'));_0x4281e3(_0x4061e4[_0xc748('0x15')][_0xc748('0x12')]);}})[_0xc748('0x16')](function(_0x32fd8e){logger[_0xc748('0x11')](_0xc748('0xc'),_0x36fbab,_0x32fd8e);_0x5e253c(_0x32fd8e);});});}exports[_0xc748('0x17')]=function(_0x17b956){var _0x33fe96=this;return new Promise(function(_0x11a35d,_0x2e242b){return db[_0xc748('0x18')][_0xc748('0x19')]({'raw':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')][_0xc748('0x1b')]||null:null,'attributes':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')][_0xc748('0x1c')]||null:null,'limit':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')]['limit']||null:null,'include':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')]['include']?_[_0xc748('0x1d')](_0x17b956['options']['include'],function(_0xecf663){return{'model':db[_0xecf663[_0xc748('0x1e')]],'as':_0xecf663['as'],'attributes':_0xecf663[_0xc748('0x1c')],'include':_0xecf663[_0xc748('0x1f')]?_[_0xc748('0x1d')](_0xecf663[_0xc748('0x1f')],function(_0x4b6f01){return{'model':db[_0x4b6f01[_0xc748('0x1e')]],'as':_0x4b6f01['as'],'attributes':_0x4b6f01[_0xc748('0x1c')],'include':_0x4b6f01[_0xc748('0x1f')]?_[_0xc748('0x1d')](_0x4b6f01['include'],function(_0xf3812){return{'model':db[_0xf3812['model']],'as':_0xf3812['as'],'attributes':_0xf3812[_0xc748('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44257c){logger[_0xc748('0x13')](_0xc748('0x17'),_0x17b956);logger[_0xc748('0xd')](_0xc748('0x17'),_0x17b956,JSON[_0xc748('0xf')](_0x44257c));_0x11a35d(_0x44257c);})[_0xc748('0x16')](function(_0xa7e714){logger[_0xc748('0x11')](_0xc748('0x17'),_0xa7e714[_0xc748('0x12')],_0x17b956);_0x2e242b(_0x33fe96[_0xc748('0x11')](0x1f4,_0xa7e714[_0xc748('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x1fe69c){var _0x36318b=this;return new Promise(function(_0x10fda4,_0x3d140d){return db[_0xc748('0x18')][_0xc748('0x20')](_0x1fe69c[_0xc748('0x21')],{'raw':_0x1fe69c['options']?_0x1fe69c['options'][_0xc748('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fe69c['options']?_0x1fe69c['options'][_0xc748('0x1b')]||null:null,'attributes':_0x1fe69c[_0xc748('0x1a')]?_0x1fe69c['options'][_0xc748('0x1c')]||null:null,'limit':_0x1fe69c[_0xc748('0x1a')]?_0x1fe69c['options']['limit']||null:null})[_0xc748('0x23')](function(_0x356793){logger[_0xc748('0x13')](_0xc748('0x24'),_0x1fe69c);logger['debug']('UpdateCmHopperBlack',_0x1fe69c,JSON['stringify'](_0x356793));_0x10fda4(_0x356793);})[_0xc748('0x16')](function(_0x4b04cd){logger[_0xc748('0x11')]('UpdateCmHopperBlack',_0x4b04cd[_0xc748('0x12')],_0x1fe69c);_0x3d140d(_0x36318b[_0xc748('0x11')](0x1f4,_0x4b04cd[_0xc748('0x12')]));});});};exports[_0xc748('0x25')]=function(_0x512aa4){var _0x38e280=this;return new Promise(function(_0x531459,_0x23a13c){return db[_0xc748('0x18')]['destroy']({'where':_0x512aa4['options']?_0x512aa4['options']['where']||null:null})[_0xc748('0x23')](function(_0x15e565){logger[_0xc748('0x13')]('DestroyCmHopperBlack',_0x512aa4);logger[_0xc748('0xd')](_0xc748('0x25'),_0x512aa4,JSON[_0xc748('0xf')](_0x15e565));_0x531459(_0x15e565);})[_0xc748('0x16')](function(_0x4aea7d){logger[_0xc748('0x11')](_0xc748('0x25'),_0x4aea7d[_0xc748('0x12')],_0x512aa4);_0x23a13c(_0x38e280[_0xc748('0x11')](0x1f4,_0x4aea7d[_0xc748('0x12')]));});});}; \ No newline at end of file +var _0x13c8=['rpc','../../config/environment','client','request','then','info','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmHopperBlack,\x20%s,\x20%s','message','result','options','raw','where','attributes','limit','include','map','model','GetCmHopperBlack','catch','UpdateCmHopperBlack','CmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1b0315,_0x46cd90){var _0x1867c2=function(_0x272835){while(--_0x272835){_0x1b0315['push'](_0x1b0315['shift']());}};_0x1867c2(++_0x46cd90);}(_0x13c8,0x103));var _0x813c=function(_0x60df74,_0x458e29){_0x60df74=_0x60df74-0x0;var _0x5ee872=_0x13c8[_0x60df74];return _0x5ee872;};'use strict';var _=require(_0x813c('0x0'));var util=require('util');var moment=require(_0x813c('0x1'));var BPromise=require('bluebird');var rs=require(_0x813c('0x2'));var fs=require('fs');var Redis=require(_0x813c('0x3'));var db=require(_0x813c('0x4'))['db'];var utils=require(_0x813c('0x5'));var logger=require(_0x813c('0x6'))(_0x813c('0x7'));var config=require(_0x813c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x813c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46b175,_0x57e024,_0x3d3acf){return new BPromise(function(_0x1b8c21,_0x2a8b00){return client[_0x813c('0xa')](_0x46b175,_0x3d3acf)[_0x813c('0xb')](function(_0xb1dbbf){logger[_0x813c('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x57e024,'request\x20sent');logger[_0x813c('0xd')](_0x813c('0xe'),_0x57e024,_0x813c('0xf'),JSON[_0x813c('0x10')](_0xb1dbbf));if(_0xb1dbbf[_0x813c('0x11')]){if(_0xb1dbbf[_0x813c('0x11')][_0x813c('0x12')]===0x1f4){logger['error'](_0x813c('0x13'),_0x57e024,_0xb1dbbf[_0x813c('0x11')][_0x813c('0x14')]);return _0x2a8b00(_0xb1dbbf[_0x813c('0x11')][_0x813c('0x14')]);}logger[_0x813c('0x11')](_0x813c('0x13'),_0x57e024,_0xb1dbbf[_0x813c('0x11')][_0x813c('0x14')]);return _0x1b8c21(_0xb1dbbf[_0x813c('0x11')][_0x813c('0x14')]);}else{logger['info'](_0x813c('0x13'),_0x57e024,'request\x20sent');_0x1b8c21(_0xb1dbbf[_0x813c('0x15')][_0x813c('0x14')]);}})['catch'](function(_0x4155cf){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x57e024,_0x4155cf);_0x2a8b00(_0x4155cf);});});}exports['GetCmHopperBlack']=function(_0x528153){var _0x47104e=this;return new Promise(function(_0x5a1c20,_0x1d84e6){return db['CmHopperBlack']['findAll']({'raw':_0x528153[_0x813c('0x16')]?_0x528153[_0x813c('0x16')][_0x813c('0x17')]===undefined?!![]:![]:!![],'where':_0x528153[_0x813c('0x16')]?_0x528153[_0x813c('0x16')][_0x813c('0x18')]||null:null,'attributes':_0x528153['options']?_0x528153[_0x813c('0x16')][_0x813c('0x19')]||null:null,'limit':_0x528153[_0x813c('0x16')]?_0x528153[_0x813c('0x16')][_0x813c('0x1a')]||null:null,'include':_0x528153[_0x813c('0x16')]?_0x528153[_0x813c('0x16')][_0x813c('0x1b')]?_[_0x813c('0x1c')](_0x528153[_0x813c('0x16')][_0x813c('0x1b')],function(_0x29f3d4){return{'model':db[_0x29f3d4[_0x813c('0x1d')]],'as':_0x29f3d4['as'],'attributes':_0x29f3d4['attributes'],'include':_0x29f3d4['include']?_[_0x813c('0x1c')](_0x29f3d4[_0x813c('0x1b')],function(_0x3cd3e9){return{'model':db[_0x3cd3e9[_0x813c('0x1d')]],'as':_0x3cd3e9['as'],'attributes':_0x3cd3e9['attributes'],'include':_0x3cd3e9[_0x813c('0x1b')]?_[_0x813c('0x1c')](_0x3cd3e9[_0x813c('0x1b')],function(_0x44c100){return{'model':db[_0x44c100[_0x813c('0x1d')]],'as':_0x44c100['as'],'attributes':_0x44c100[_0x813c('0x19')]};}):[]};}):[]};}):[]:[]})[_0x813c('0xb')](function(_0x7a6e61){logger['info'](_0x813c('0x1e'),_0x528153);logger['debug'](_0x813c('0x1e'),_0x528153,JSON[_0x813c('0x10')](_0x7a6e61));_0x5a1c20(_0x7a6e61);})[_0x813c('0x1f')](function(_0x2b3be7){logger[_0x813c('0x11')](_0x813c('0x1e'),_0x2b3be7[_0x813c('0x14')],_0x528153);_0x1d84e6(_0x47104e[_0x813c('0x11')](0x1f4,_0x2b3be7[_0x813c('0x14')]));});});};exports[_0x813c('0x20')]=function(_0x4d8018){var _0x11c993=this;return new Promise(function(_0x410fe7,_0x596537){return db[_0x813c('0x21')][_0x813c('0x22')](_0x4d8018[_0x813c('0x23')],{'raw':_0x4d8018[_0x813c('0x16')]?_0x4d8018[_0x813c('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d8018[_0x813c('0x16')]?_0x4d8018['options'][_0x813c('0x18')]||null:null,'attributes':_0x4d8018[_0x813c('0x16')]?_0x4d8018[_0x813c('0x16')][_0x813c('0x19')]||null:null,'limit':_0x4d8018['options']?_0x4d8018['options'][_0x813c('0x1a')]||null:null})[_0x813c('0xb')](function(_0x30e920){logger[_0x813c('0xc')](_0x813c('0x20'),_0x4d8018);logger[_0x813c('0xd')](_0x813c('0x20'),_0x4d8018,JSON[_0x813c('0x10')](_0x30e920));_0x410fe7(_0x30e920);})[_0x813c('0x1f')](function(_0x198ddb){logger[_0x813c('0x11')](_0x813c('0x20'),_0x198ddb['message'],_0x4d8018);_0x596537(_0x11c993[_0x813c('0x11')](0x1f4,_0x198ddb[_0x813c('0x14')]));});});};exports[_0x813c('0x24')]=function(_0x111353){var _0x10d8d9=this;return new Promise(function(_0x47ff5f,_0xc9549a){return db[_0x813c('0x21')][_0x813c('0x25')]({'where':_0x111353[_0x813c('0x16')]?_0x111353[_0x813c('0x16')]['where']||null:null})['then'](function(_0x5d3d4c){logger[_0x813c('0xc')]('DestroyCmHopperBlack',_0x111353);logger[_0x813c('0xd')](_0x813c('0x24'),_0x111353,JSON[_0x813c('0x10')](_0x5d3d4c));_0x47ff5f(_0x5d3d4c);})[_0x813c('0x1f')](function(_0xc84429){logger[_0x813c('0x11')](_0x813c('0x24'),_0xc84429[_0x813c('0x14')],_0x111353);_0xc9549a(_0x10d8d9[_0x813c('0x11')](0x1f4,_0xc84429['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 80a36eb..7938914 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 _0x00bb=['/describe','isAuthenticated','describe','/:id','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get'];(function(_0x29300c,_0x503c4c){var _0x5457b9=function(_0x18044c){while(--_0x18044c){_0x29300c['push'](_0x29300c['shift']());}};_0x5457b9(++_0x503c4c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0x7')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller['show']);router['put'](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xc')]);router[_0xb00b('0xd')](_0xb00b('0xb'),auth['isAuthenticated'](),controller[_0xb00b('0xe')]);module['exports']=router; \ No newline at end of file +var _0x17ba=['delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x17ba,0xab));var _0xa17b=function(_0x2367cd,_0xa9960c){_0x2367cd=_0x2367cd-0x0;var _0x1b413e=_0x17ba[_0x2367cd];return _0x1b413e;};'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 auth=require(_0xa17b('0x5'));var interaction=require(_0xa17b('0x6'));var config=require(_0xa17b('0x7'));var controller=require(_0xa17b('0x8'));router[_0xa17b('0x9')]('/',auth[_0xa17b('0xa')](),controller[_0xa17b('0xb')]);router[_0xa17b('0x9')](_0xa17b('0xc'),auth[_0xa17b('0xa')](),controller[_0xa17b('0xd')]);router[_0xa17b('0x9')](_0xa17b('0xe'),auth[_0xa17b('0xa')](),controller[_0xa17b('0xf')]);router[_0xa17b('0x10')]('/:id',auth[_0xa17b('0xa')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xe'),auth[_0xa17b('0xa')](),controller[_0xa17b('0x13')]);module[_0xa17b('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 587e9d7..2e5b8b1 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 _0x7fcf=['exports','INTEGER','DATE','STRING','endtime','setDataValue','followuptime','BOOLEAN','moment'];(function(_0x4b96bd,_0xe341d){var _0x515ad8=function(_0x166deb){while(--_0x166deb){_0x4b96bd['push'](_0x4b96bd['shift']());}};_0x515ad8(++_0xe341d);}(_0x7fcf,0xce));var _0xf7fc=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7fcf[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf7fc('0x0'));module[_0xf7fc('0x1')]={'state':{'type':Sequelize[_0xf7fc('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf7fc('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf7fc('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xf7fc('0x4')]},'originatecalleridname':{'type':Sequelize[_0xf7fc('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf7fc('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf7fc('0x3')]},'answertime':{'type':Sequelize[_0xf7fc('0x3')]},'droptime':{'type':Sequelize[_0xf7fc('0x3')]},'endtime':{'type':Sequelize[_0xf7fc('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xf7fc('0x4')]},'campaigntype':{'type':Sequelize[_0xf7fc('0x4')]},'membername':{'type':Sequelize[_0xf7fc('0x4')]},'reason':{'type':Sequelize[_0xf7fc('0x4')]},'disposition':{'type':Sequelize[_0xf7fc('0x4')]},'dispositionat':{'type':Sequelize[_0xf7fc('0x3')],'set':function(_0x36cb74){var _0x1b6f91=this['getDataValue'](_0xf7fc('0x5'));if(_0x1b6f91&&_0x36cb74){this[_0xf7fc('0x6')](_0xf7fc('0x7'),moment(_0x36cb74)['diff'](moment(_0x1b6f91),'seconds'));}return this[_0xf7fc('0x6')]('dispositionat',_0x36cb74);}},'amd':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf7fc('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf7fc('0x3')]},'recallme':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf7fc('0x3')]}}; \ No newline at end of file +var _0x7715=['sequelize','moment','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','BOOLEAN'];(function(_0x2511b3,_0x1a0e42){var _0x1fc7d7=function(_0x52e19e){while(--_0x52e19e){_0x2511b3['push'](_0x2511b3['shift']());}};_0x1fc7d7(++_0x1a0e42);}(_0x7715,0x19e));var _0x5771=function(_0x58bbdd,_0x2e698e){_0x58bbdd=_0x58bbdd-0x0;var _0x49ceb7=_0x7715[_0x58bbdd];return _0x49ceb7;};'use strict';var Sequelize=require(_0x5771('0x0'));var moment=require(_0x5771('0x1'));module['exports']={'state':{'type':Sequelize[_0x5771('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x5771('0x3')]},'scheduledat':{'type':Sequelize[_0x5771('0x4')]},'countbusyretry':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x5771('0x3')]},'calleridnum':{'type':Sequelize[_0x5771('0x3')]},'calleridname':{'type':Sequelize[_0x5771('0x3')]},'starttime':{'type':Sequelize[_0x5771('0x4')]},'responsetime':{'type':Sequelize[_0x5771('0x4')]},'answertime':{'type':Sequelize[_0x5771('0x4')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x5771('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x5771('0x3')]},'campaign':{'type':Sequelize[_0x5771('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x5771('0x3')]},'dispositionat':{'type':Sequelize[_0x5771('0x4')],'set':function(_0x319705){var _0x2818bb=this['getDataValue'](_0x5771('0x5'));if(_0x2818bb&&_0x319705){this[_0x5771('0x6')](_0x5771('0x7'),moment(_0x319705)['diff'](moment(_0x2818bb),'seconds'));}return this[_0x5771('0x6')]('dispositionat',_0x319705);}},'amd':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x5771('0x4')]},'callback':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5771('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x5771('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x5771('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x5771('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 3d1d5ee..d255aeb 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 _0x68ee=['to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','CmHopperFinal','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','rows','catch','params','rawAttributes','include','find','describe','uniqueid','body','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','reCallContacts','insert','into','cm_hopper','fromQuery','phone','ContactId','VoiceQueueId','createdAt','field','NOW()','scheduledAt','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','select','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','CampaignId','updatedAt','ANY_VALUE(calleridnum)','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x68ee,0x1eb));var _0xe68e=function(_0x5e5627,_0x48dc65){_0x5e5627=_0x5e5627-0x0;var _0x43df10=_0x68ee[_0x5e5627];return _0x43df10;};'use strict';var pdf=require(_0xe68e('0x0'));var emlformat=require(_0xe68e('0x1'));var rimraf=require(_0xe68e('0x2'));var zipdir=require(_0xe68e('0x3'));var jsonpatch=require(_0xe68e('0x4'));var rp=require(_0xe68e('0x5'));var moment=require('moment');var BPromise=require(_0xe68e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe68e('0x7'));var sox=require(_0xe68e('0x8'));var csv=require(_0xe68e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe68e('0xa'));var squel=require(_0xe68e('0xb'));var crypto=require('crypto');var jsforce=require(_0xe68e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe68e('0x9'));var querystring=require(_0xe68e('0xd'));var Papa=require(_0xe68e('0xe'));var Redis=require(_0xe68e('0xf'));var authService=require(_0xe68e('0x10'));var qs=require(_0xe68e('0x11'));var as=require(_0xe68e('0x12'));var hardwareService=require(_0xe68e('0x13'));var logger=require(_0xe68e('0x14'))(_0xe68e('0x15'));var utils=require(_0xe68e('0x16'));var config=require(_0xe68e('0x17'));var db=require(_0xe68e('0x18'))['db'];function respondWithStatusCode(_0x478a45,_0x3698d9){_0x3698d9=_0x3698d9||0xcc;return function(_0x4f3d89){if(_0x4f3d89){return _0x478a45['sendStatus'](_0x3698d9);}return _0x478a45['status'](_0x3698d9)[_0xe68e('0x19')]();};}function respondWithResult(_0x4106e7,_0x29e2f5){_0x29e2f5=_0x29e2f5||0xc8;return function(_0x54e234){if(_0x54e234){return _0x4106e7[_0xe68e('0x1a')](_0x29e2f5)[_0xe68e('0x1b')](_0x54e234);}};}function respondWithFilteredResult(_0x284112,_0x2464c1){return function(_0x32d1af){if(_0x32d1af){var _0x2c844a=_0x32d1af['count'],_0xceab33=_0x2464c1[_0xe68e('0x1c')],_0x30c5b8=_0x2464c1['offset']+_0x2464c1[_0xe68e('0x1d')],_0x45bd14;if(_0x30c5b8>=_0x2c844a){_0x30c5b8=_0x2c844a;_0x45bd14=0xc8;}else{_0x45bd14=0xce;}_0x284112[_0xe68e('0x1a')](_0x45bd14);return _0x284112[_0xe68e('0x1e')](_0xe68e('0x1f'),_0xceab33+'-'+_0x30c5b8+'/'+_0x2c844a)[_0xe68e('0x1b')](_0x32d1af);}return null;};}function patchUpdates(_0x291c56){return function(_0x810d86){try{jsonpatch[_0xe68e('0x20')](_0x810d86,_0x291c56,!![]);}catch(_0x33be85){return BPromise['reject'](_0x33be85);}return _0x810d86[_0xe68e('0x21')]();};}function saveUpdates(_0x3356a7,_0x30f681){return function(_0x3fe0f7){if(_0x3fe0f7){return _0x3fe0f7[_0xe68e('0x22')](_0x3356a7)[_0xe68e('0x23')](function(_0x5026df){return _0x5026df;});}return null;};}function removeEntity(_0x56b4fc,_0x1f4a60){return function(_0x465a79){if(_0x465a79){return _0x465a79[_0xe68e('0x24')]()['then'](function(){_0x56b4fc[_0xe68e('0x1a')](0xcc)[_0xe68e('0x19')]();});}};}function handleEntityNotFound(_0x59830d,_0x37206a){return function(_0x4b868e){if(!_0x4b868e){_0x59830d['sendStatus'](0x194);}return _0x4b868e;};}function handleError(_0x540231,_0x1addbd){_0x1addbd=_0x1addbd||0x1f4;return function(_0x35833a){logger[_0xe68e('0x25')](_0x35833a[_0xe68e('0x26')]);if(_0x35833a['name']){delete _0x35833a[_0xe68e('0x27')];}_0x540231['status'](_0x1addbd)['send'](_0x35833a);};}exports[_0xe68e('0x28')]=function(_0x26a51e,_0x3e7c51){var _0x5efa66={},_0x2ff99c={},_0x5022db={'count':0x0,'rows':[]};var _0x1c5aaf=_[_0xe68e('0x29')](db[_0xe68e('0x2a')]['rawAttributes'],function(_0x5d3048){return{'name':_0x5d3048[_0xe68e('0x2b')],'type':_0x5d3048[_0xe68e('0x2c')][_0xe68e('0x2d')]};});_0x2ff99c['model']=_[_0xe68e('0x29')](_0x1c5aaf,_0xe68e('0x27'));_0x2ff99c[_0xe68e('0x2e')]=_[_0xe68e('0x2f')](_0x26a51e['query']);_0x2ff99c[_0xe68e('0x30')]=_[_0xe68e('0x31')](_0x2ff99c[_0xe68e('0x32')],_0x2ff99c[_0xe68e('0x2e')]);_0x5efa66[_0xe68e('0x33')]=_[_0xe68e('0x31')](_0x2ff99c['model'],qs[_0xe68e('0x34')](_0x26a51e[_0xe68e('0x2e')]['fields']));_0x5efa66[_0xe68e('0x33')]=_0x5efa66[_0xe68e('0x33')][_0xe68e('0x35')]?_0x5efa66[_0xe68e('0x33')]:_0x2ff99c[_0xe68e('0x32')];if(!_0x26a51e[_0xe68e('0x2e')]['hasOwnProperty'](_0xe68e('0x36'))){_0x5efa66[_0xe68e('0x1d')]=qs[_0xe68e('0x1d')](_0x26a51e['query'][_0xe68e('0x1d')]);_0x5efa66[_0xe68e('0x1c')]=qs[_0xe68e('0x1c')](_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x1c')]);}_0x5efa66[_0xe68e('0x37')]=qs['sort'](_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x38')]);_0x5efa66[_0xe68e('0x39')]=qs[_0xe68e('0x30')](_[_0xe68e('0x3a')](_0x26a51e[_0xe68e('0x2e')],_0x2ff99c[_0xe68e('0x30')]));if(_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x3b')]){_0x5efa66[_0xe68e('0x39')]=_[_0xe68e('0x3c')](_0x5efa66[_0xe68e('0x39')],{'$or':_['map'](_0x1c5aaf,function(_0x2d0dcd){if(_0x2d0dcd['type']!==_0xe68e('0x3d')){var _0xb3f02={};_0xb3f02[_0x2d0dcd[_0xe68e('0x27')]]={'$like':'%'+_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x3b')]+'%'};return _0xb3f02;}})});}_0x5efa66=_['merge']({},_0x5efa66,_0x26a51e[_0xe68e('0x3e')]);var _0x38588c={'where':_0x5efa66['where']};return db[_0xe68e('0x2a')][_0xe68e('0x3f')](_0x38588c)[_0xe68e('0x23')](function(_0x14716a){_0x5022db[_0xe68e('0x3f')]=_0x14716a;if(_0x26a51e['query']['includeAll']){_0x5efa66['include']=[{'all':!![]}];}return db[_0xe68e('0x2a')]['findAll'](_0x5efa66);})['then'](function(_0x5d5ebc){_0x5022db[_0xe68e('0x40')]=_0x5d5ebc;return _0x5022db;})[_0xe68e('0x23')](respondWithFilteredResult(_0x3e7c51,_0x5efa66))[_0xe68e('0x41')](handleError(_0x3e7c51,null));};exports['show']=function(_0x353976,_0x33effc){var _0x398aea={'raw':!![],'where':{'id':_0x353976[_0xe68e('0x42')]['id']}},_0x484c10={};_0x484c10[_0xe68e('0x32')]=_[_0xe68e('0x2f')](db[_0xe68e('0x2a')][_0xe68e('0x43')]);_0x484c10['query']=_['keys'](_0x353976[_0xe68e('0x2e')]);_0x484c10[_0xe68e('0x30')]=_[_0xe68e('0x31')](_0x484c10[_0xe68e('0x32')],_0x484c10[_0xe68e('0x2e')]);_0x398aea['attributes']=_['intersection'](_0x484c10[_0xe68e('0x32')],qs[_0xe68e('0x34')](_0x353976[_0xe68e('0x2e')]['fields']));_0x398aea[_0xe68e('0x33')]=_0x398aea[_0xe68e('0x33')][_0xe68e('0x35')]?_0x398aea[_0xe68e('0x33')]:_0x484c10[_0xe68e('0x32')];if(_0x353976[_0xe68e('0x2e')]['includeAll']){_0x398aea[_0xe68e('0x44')]=[{'all':!![]}];}_0x398aea=_[_0xe68e('0x3c')]({},_0x398aea,_0x353976[_0xe68e('0x3e')]);return db['CmHopperFinal'][_0xe68e('0x45')](_0x398aea)[_0xe68e('0x23')](handleEntityNotFound(_0x33effc,null))[_0xe68e('0x23')](respondWithResult(_0x33effc,null))['catch'](handleError(_0x33effc,null));};exports[_0xe68e('0x46')]=function(_0x384450,_0x15efde){return db[_0xe68e('0x2a')][_0xe68e('0x46')]()[_0xe68e('0x23')](respondWithResult(_0x15efde,null))[_0xe68e('0x41')](handleError(_0x15efde,null));};exports[_0xe68e('0x22')]=function(_0x5c95b0,_0x97eea5){if(_0x5c95b0['body'][_0xe68e('0x47')]){delete _0x5c95b0[_0xe68e('0x48')]['uniqueid'];}return db[_0xe68e('0x2a')][_0xe68e('0x45')]({'where':{'uniqueid':_0x5c95b0[_0xe68e('0x42')]['id']}})['then'](handleEntityNotFound(_0x97eea5,null))[_0xe68e('0x23')](saveUpdates(_0x5c95b0[_0xe68e('0x48')],null))[_0xe68e('0x23')](respondWithResult(_0x97eea5,null))[_0xe68e('0x41')](handleError(_0x97eea5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x29a832,_0x387c46,_0x5474bf){return db[_0xe68e('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x29a832['params']['id']},'attributes':[[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db['sequelize']['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4c')))),_0xe68e('0x4d')],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4e')))),_0xe68e('0x4f')],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db['sequelize'][_0xe68e('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xe68e('0x50')],[db['sequelize']['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0xe68e('0x51')],[db[_0xe68e('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x52')))),_0xe68e('0x53')],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x54')))),_0xe68e('0x55')],[db['sequelize']['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')]['literal'](_0xe68e('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0xe68e('0x4a'),db['sequelize']['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x57')))),_0xe68e('0x58')]]})['then'](handleEntityNotFound(_0x387c46,null))[_0xe68e('0x23')](respondWithResult(_0x387c46,null))[_0xe68e('0x41')](handleError(_0x387c46,null));};exports[_0xe68e('0x59')]=function(_0x31124d,_0x27c96e,_0x1b15eb){return db[_0xe68e('0x2a')]['findAll']({'raw':![],'where':{'CampaignId':_0x31124d[_0xe68e('0x42')]['id']},'attributes':[[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4c')))),'noSuchContacts'],[db[_0xe68e('0x49')]['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4e')))),_0xe68e('0x4f')],[db[_0xe68e('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe68e('0x49')]['literal'](_0xe68e('0x5a')))),'busyContacts'],[db['sequelize']['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x5b')))),_0xe68e('0x51')],[db['sequelize']['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x54')))),'abandonedContacts'],[db[_0xe68e('0x49')]['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x56')))),_0xe68e('0x5c')],[db[_0xe68e('0x49')]['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')]['literal'](_0xe68e('0x57')))),_0xe68e('0x58')]]})['then'](handleEntityNotFound(_0x27c96e,null))[_0xe68e('0x23')](respondWithResult(_0x27c96e,null))[_0xe68e('0x41')](handleError(_0x27c96e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x252d77,_0x3f5279,_0xa98975){return db['VoiceQueue'][_0xe68e('0x45')]({'where':{'id':_0x252d77[_0xe68e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f5279,null))['then'](function(_0x1cd4c7){var _0x234e63;if(_0x1cd4c7){_0x234e63=squel[_0xe68e('0x5d')]()[_0xe68e('0x5e')](_0xe68e('0x5f'))[_0xe68e('0x60')]([_0xe68e('0x61'),'scheduledAt',_0xe68e('0x62'),'ListId',_0xe68e('0x63'),_0xe68e('0x64'),'updatedAt'],squel['select']()[_0xe68e('0x65')]('ANY_VALUE(calleridnum)',_0xe68e('0x61'))['field'](_0xe68e('0x66'),_0xe68e('0x67'))[_0xe68e('0x65')]('ANY_VALUE(ContactId)',_0xe68e('0x62'))[_0xe68e('0x65')]('ANY_VALUE(ListId)',_0xe68e('0x68'))['field'](_0xe68e('0x69'),_0xe68e('0x63'))[_0xe68e('0x65')]('NOW()',_0xe68e('0x64'))['field'](_0xe68e('0x66'),'updatedAt')[_0xe68e('0x6a')](_0xe68e('0x6b'))[_0xe68e('0x39')](_0xe68e('0x6c'),_0x252d77['params']['id'][_0xe68e('0x6d')]())['where']('state\x20=\x20?',_0x252d77[_0xe68e('0x48')]['state'][_0xe68e('0x6d')]())['where'](_0xe68e('0x6e'))[_0xe68e('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe68e('0x6f')]()['field'](_0xe68e('0x61'))[_0xe68e('0x6a')](_0xe68e('0x5f'))[_0xe68e('0x39')]('VoiceQueueId\x20=\x20?',_0x252d77[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]()))['where'](_0xe68e('0x70'),squel[_0xe68e('0x6f')]()[_0xe68e('0x65')](_0xe68e('0x71'))[_0xe68e('0x6a')]('cm_hopper_final')['where'](_0xe68e('0x6c'),_0x252d77['params']['id'][_0xe68e('0x6d')]())[_0xe68e('0x39')](_0xe68e('0x72')))[_0xe68e('0x73')](_0xe68e('0x62')))['toString']();return db[_0xe68e('0x49')][_0xe68e('0x2e')](_0x234e63);}return[];})[_0xe68e('0x23')](respondWithResult(_0x3f5279,null))[_0xe68e('0x41')](handleError(_0x3f5279,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2816b8,_0x1ae168,_0x182dc0){return db[_0xe68e('0x74')]['find']({'where':{'id':_0x2816b8[_0xe68e('0x42')]['id']}})[_0xe68e('0x23')](handleEntityNotFound(_0x1ae168,null))[_0xe68e('0x23')](function(_0x4d7e89){var _0x43e19d;if(_0x4d7e89){_0x43e19d=squel[_0xe68e('0x5d')]()[_0xe68e('0x5e')](_0xe68e('0x5f'))['fromQuery']([_0xe68e('0x61'),_0xe68e('0x67'),'ContactId','ListId',_0xe68e('0x75'),_0xe68e('0x64'),_0xe68e('0x76')],squel[_0xe68e('0x6f')]()['field'](_0xe68e('0x77'),_0xe68e('0x61'))[_0xe68e('0x65')](_0xe68e('0x66'),'scheduledAt')['field']('ANY_VALUE(ContactId)','ContactId')['field']('ANY_VALUE(ListId)',_0xe68e('0x68'))[_0xe68e('0x65')]('ANY_VALUE(CampaignId)',_0xe68e('0x75'))[_0xe68e('0x65')](_0xe68e('0x66'),'createdAt')[_0xe68e('0x65')](_0xe68e('0x66'),_0xe68e('0x76'))[_0xe68e('0x6a')](_0xe68e('0x6b'))[_0xe68e('0x39')](_0xe68e('0x78'),_0x2816b8[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]())[_0xe68e('0x39')]('state\x20=\x20?',_0x2816b8[_0xe68e('0x48')][_0xe68e('0x79')][_0xe68e('0x6d')]())[_0xe68e('0x39')](_0xe68e('0x6e'))[_0xe68e('0x39')](_0xe68e('0x70'),squel['select']()[_0xe68e('0x65')](_0xe68e('0x61'))[_0xe68e('0x6a')](_0xe68e('0x5f'))['where'](_0xe68e('0x78'),_0x2816b8[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]()))[_0xe68e('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe68e('0x6f')]()[_0xe68e('0x65')](_0xe68e('0x71'))['from'](_0xe68e('0x6b'))['where']('CampaignId\x20=\x20?',_0x2816b8[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]())[_0xe68e('0x39')](_0xe68e('0x72')))[_0xe68e('0x73')](_0xe68e('0x62')))['toString']();return db['sequelize'][_0xe68e('0x2e')](_0x43e19d);}return[];})[_0xe68e('0x23')](respondWithResult(_0x1ae168,null))['catch'](handleError(_0x1ae168,null));};exports[_0xe68e('0x7a')]=function(_0x32a332,_0x2e8a1d,_0x66894c){return db[_0xe68e('0x7b')][_0xe68e('0x7c')]({'where':{'VoiceQueueId':_0x32a332[_0xe68e('0x48')][_0xe68e('0x63')],'CampaignId':_0x32a332[_0xe68e('0x48')][_0xe68e('0x75')],'ContactId':_0x32a332[_0xe68e('0x48')]['ContactId']}})[_0xe68e('0x23')](handleEntityNotFound(_0x2e8a1d,null))[_0xe68e('0x23')](function(_0x3f8eb5){if(_0x3f8eb5){return _0x3f8eb5;}return null;})[_0xe68e('0x23')](respondWithResult(_0x2e8a1d,null))[_0xe68e('0x41')](handleError(_0x2e8a1d,null));}; \ No newline at end of file +var _0x1fac=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','reject','update','then','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','filter','where','merge','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','busyContacts','dropContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','from','state','toString','cm_hopper','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','group','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','state\x20=\x204','checkContactHopper','CmHopper','findOne','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x3ef64e,_0x279f78){var _0x24cab3=function(_0xa847a7){while(--_0xa847a7){_0x3ef64e['push'](_0x3ef64e['shift']());}};_0x24cab3(++_0x279f78);}(_0x1fac,0xe9));var _0xc1fa=function(_0x2b7f60,_0x25aca8){_0x2b7f60=_0x2b7f60-0x0;var _0x54fb9d=_0x1fac[_0x2b7f60];return _0x54fb9d;};'use strict';var pdf=require(_0xc1fa('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc1fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1fa('0x2'));var rp=require(_0xc1fa('0x3'));var moment=require(_0xc1fa('0x4'));var BPromise=require(_0xc1fa('0x5'));var Mustache=require(_0xc1fa('0x6'));var util=require(_0xc1fa('0x7'));var path=require(_0xc1fa('0x8'));var sox=require(_0xc1fa('0x9'));var csv=require(_0xc1fa('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc1fa('0xb'));var squel=require(_0xc1fa('0xc'));var crypto=require(_0xc1fa('0xd'));var jsforce=require(_0xc1fa('0xe'));var deskjs=require(_0xc1fa('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc1fa('0x10'));var Papa=require(_0xc1fa('0x11'));var Redis=require(_0xc1fa('0x12'));var authService=require(_0xc1fa('0x13'));var qs=require(_0xc1fa('0x14'));var as=require(_0xc1fa('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1fa('0x16'))('api');var utils=require(_0xc1fa('0x17'));var config=require(_0xc1fa('0x18'));var db=require(_0xc1fa('0x19'))['db'];function respondWithStatusCode(_0x16136e,_0x1b0f19){_0x1b0f19=_0x1b0f19||0xcc;return function(_0x4e9c17){if(_0x4e9c17){return _0x16136e[_0xc1fa('0x1a')](_0x1b0f19);}return _0x16136e['status'](_0x1b0f19)[_0xc1fa('0x1b')]();};}function respondWithResult(_0x19c450,_0x16ce9f){_0x16ce9f=_0x16ce9f||0xc8;return function(_0x52d284){if(_0x52d284){return _0x19c450[_0xc1fa('0x1c')](_0x16ce9f)[_0xc1fa('0x1d')](_0x52d284);}};}function respondWithFilteredResult(_0x4522e2,_0x4c2576){return function(_0x159fa6){if(_0x159fa6){var _0x37132c=_0x159fa6[_0xc1fa('0x1e')],_0x437aac=_0x4c2576[_0xc1fa('0x1f')],_0x1b8fbe=_0x4c2576[_0xc1fa('0x1f')]+_0x4c2576[_0xc1fa('0x20')],_0x1cd159;if(_0x1b8fbe>=_0x37132c){_0x1b8fbe=_0x37132c;_0x1cd159=0xc8;}else{_0x1cd159=0xce;}_0x4522e2[_0xc1fa('0x1c')](_0x1cd159);return _0x4522e2[_0xc1fa('0x21')]('Content-Range',_0x437aac+'-'+_0x1b8fbe+'/'+_0x37132c)[_0xc1fa('0x1d')](_0x159fa6);}return null;};}function patchUpdates(_0x5ef86e){return function(_0x277c2e){try{jsonpatch['apply'](_0x277c2e,_0x5ef86e,!![]);}catch(_0x311ab6){return BPromise[_0xc1fa('0x22')](_0x311ab6);}return _0x277c2e['save']();};}function saveUpdates(_0xcb9f94,_0x31b859){return function(_0x54178c){if(_0x54178c){return _0x54178c[_0xc1fa('0x23')](_0xcb9f94)[_0xc1fa('0x24')](function(_0x1a9e40){return _0x1a9e40;});}return null;};}function removeEntity(_0x42d057,_0x1d248b){return function(_0x2f9e89){if(_0x2f9e89){return _0x2f9e89['destroy']()[_0xc1fa('0x24')](function(){_0x42d057[_0xc1fa('0x1c')](0xcc)[_0xc1fa('0x1b')]();});}};}function handleEntityNotFound(_0x56f6d1,_0x4cd7e3){return function(_0x597361){if(!_0x597361){_0x56f6d1[_0xc1fa('0x1a')](0x194);}return _0x597361;};}function handleError(_0x89a2d,_0x454a8f){_0x454a8f=_0x454a8f||0x1f4;return function(_0x76bf82){logger[_0xc1fa('0x25')](_0x76bf82[_0xc1fa('0x26')]);if(_0x76bf82['name']){delete _0x76bf82[_0xc1fa('0x27')];}_0x89a2d['status'](_0x454a8f)[_0xc1fa('0x28')](_0x76bf82);};}exports[_0xc1fa('0x29')]=function(_0x4855bb,_0x4ad8c4){var _0x2ee831={},_0x3607ba={},_0x1e042d={'count':0x0,'rows':[]};var _0x49a290=_[_0xc1fa('0x2a')](db[_0xc1fa('0x2b')][_0xc1fa('0x2c')],function(_0x1df2c4){return{'name':_0x1df2c4['fieldName'],'type':_0x1df2c4[_0xc1fa('0x2d')][_0xc1fa('0x2e')]};});_0x3607ba[_0xc1fa('0x2f')]=_[_0xc1fa('0x2a')](_0x49a290,'name');_0x3607ba[_0xc1fa('0x30')]=_[_0xc1fa('0x31')](_0x4855bb['query']);_0x3607ba[_0xc1fa('0x32')]=_[_0xc1fa('0x33')](_0x3607ba[_0xc1fa('0x2f')],_0x3607ba[_0xc1fa('0x30')]);_0x2ee831[_0xc1fa('0x34')]=_[_0xc1fa('0x33')](_0x3607ba[_0xc1fa('0x2f')],qs['fields'](_0x4855bb[_0xc1fa('0x30')][_0xc1fa('0x35')]));_0x2ee831[_0xc1fa('0x34')]=_0x2ee831['attributes']['length']?_0x2ee831[_0xc1fa('0x34')]:_0x3607ba[_0xc1fa('0x2f')];if(!_0x4855bb['query']['hasOwnProperty'](_0xc1fa('0x36'))){_0x2ee831['limit']=qs[_0xc1fa('0x20')](_0x4855bb[_0xc1fa('0x30')]['limit']);_0x2ee831['offset']=qs['offset'](_0x4855bb[_0xc1fa('0x30')][_0xc1fa('0x1f')]);}_0x2ee831['order']=qs['sort'](_0x4855bb['query']['sort']);_0x2ee831['where']=qs['filters'](_['pick'](_0x4855bb[_0xc1fa('0x30')],_0x3607ba[_0xc1fa('0x32')]));if(_0x4855bb[_0xc1fa('0x30')][_0xc1fa('0x37')]){_0x2ee831[_0xc1fa('0x38')]=_['merge'](_0x2ee831[_0xc1fa('0x38')],{'$or':_[_0xc1fa('0x2a')](_0x49a290,function(_0x3c38be){if(_0x3c38be[_0xc1fa('0x2d')]!=='VIRTUAL'){var _0x374f12={};_0x374f12[_0x3c38be['name']]={'$like':'%'+_0x4855bb[_0xc1fa('0x30')][_0xc1fa('0x37')]+'%'};return _0x374f12;}})});}_0x2ee831=_[_0xc1fa('0x39')]({},_0x2ee831,_0x4855bb['options']);var _0x1e3e7a={'where':_0x2ee831[_0xc1fa('0x38')]};return db['CmHopperFinal'][_0xc1fa('0x1e')](_0x1e3e7a)[_0xc1fa('0x24')](function(_0x4727cf){_0x1e042d[_0xc1fa('0x1e')]=_0x4727cf;if(_0x4855bb['query']['includeAll']){_0x2ee831[_0xc1fa('0x3a')]=[{'all':!![]}];}return db[_0xc1fa('0x2b')][_0xc1fa('0x3b')](_0x2ee831);})['then'](function(_0x280015){_0x1e042d[_0xc1fa('0x3c')]=_0x280015;return _0x1e042d;})[_0xc1fa('0x24')](respondWithFilteredResult(_0x4ad8c4,_0x2ee831))[_0xc1fa('0x3d')](handleError(_0x4ad8c4,null));};exports[_0xc1fa('0x3e')]=function(_0x40a247,_0x5a978d){var _0x4024b0={'raw':!![],'where':{'id':_0x40a247[_0xc1fa('0x3f')]['id']}},_0x23e956={};_0x23e956[_0xc1fa('0x2f')]=_[_0xc1fa('0x31')](db[_0xc1fa('0x2b')][_0xc1fa('0x2c')]);_0x23e956[_0xc1fa('0x30')]=_[_0xc1fa('0x31')](_0x40a247[_0xc1fa('0x30')]);_0x23e956['filters']=_['intersection'](_0x23e956[_0xc1fa('0x2f')],_0x23e956[_0xc1fa('0x30')]);_0x4024b0['attributes']=_[_0xc1fa('0x33')](_0x23e956['model'],qs[_0xc1fa('0x35')](_0x40a247['query'][_0xc1fa('0x35')]));_0x4024b0[_0xc1fa('0x34')]=_0x4024b0[_0xc1fa('0x34')][_0xc1fa('0x40')]?_0x4024b0[_0xc1fa('0x34')]:_0x23e956[_0xc1fa('0x2f')];if(_0x40a247['query'][_0xc1fa('0x41')]){_0x4024b0['include']=[{'all':!![]}];}_0x4024b0=_[_0xc1fa('0x39')]({},_0x4024b0,_0x40a247['options']);return db[_0xc1fa('0x2b')][_0xc1fa('0x42')](_0x4024b0)['then'](handleEntityNotFound(_0x5a978d,null))[_0xc1fa('0x24')](respondWithResult(_0x5a978d,null))[_0xc1fa('0x3d')](handleError(_0x5a978d,null));};exports[_0xc1fa('0x43')]=function(_0x51d326,_0xe218cd){return db[_0xc1fa('0x2b')][_0xc1fa('0x43')]()[_0xc1fa('0x24')](respondWithResult(_0xe218cd,null))[_0xc1fa('0x3d')](handleError(_0xe218cd,null));};exports['update']=function(_0x7896d,_0x14bd97){if(_0x7896d[_0xc1fa('0x44')][_0xc1fa('0x45')]){delete _0x7896d[_0xc1fa('0x44')][_0xc1fa('0x45')];}return db[_0xc1fa('0x2b')]['find']({'where':{'uniqueid':_0x7896d[_0xc1fa('0x3f')]['id']}})['then'](handleEntityNotFound(_0x14bd97,null))[_0xc1fa('0x24')](saveUpdates(_0x7896d[_0xc1fa('0x44')],null))[_0xc1fa('0x24')](respondWithResult(_0x14bd97,null))[_0xc1fa('0x3d')](handleError(_0x14bd97,null));};exports[_0xc1fa('0x46')]=function(_0x8a7871,_0x82ad44,_0x4b0887){return db[_0xc1fa('0x2b')][_0xc1fa('0x3b')]({'raw':![],'where':{'VoiceQueueId':_0x8a7871['params']['id']},'attributes':[[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x4a')))),_0xc1fa('0x4b')],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x4c')))),'noAnswerContacts'],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')]['literal'](_0xc1fa('0x4d')))),'busyContacts'],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x4e')))),_0xc1fa('0x4f')],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db['sequelize']['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x50')))),'dropContacts'],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db['sequelize']['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x51')))),_0xc1fa('0x52')],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x53')))),'reCallContacts'],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x54')))),_0xc1fa('0x55')]]})['then'](handleEntityNotFound(_0x82ad44,null))['then'](respondWithResult(_0x82ad44,null))['catch'](handleError(_0x82ad44,null));};exports[_0xc1fa('0x56')]=function(_0x2e082d,_0x1be09f,_0x3a0608){return db[_0xc1fa('0x2b')][_0xc1fa('0x3b')]({'raw':![],'where':{'CampaignId':_0x2e082d[_0xc1fa('0x3f')]['id']},'attributes':[[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db['sequelize'][_0xc1fa('0x49')](_0xc1fa('0x4a')))),_0xc1fa('0x4b')],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x4c')))),'noAnswerContacts'],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x4d')))),_0xc1fa('0x57')],[db['sequelize']['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')]('`state`\x20=\x208,\x201,\x20null'))),_0xc1fa('0x4f')],[db[_0xc1fa('0x47')]['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db['sequelize'][_0xc1fa('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc1fa('0x58')],[db['sequelize']['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db['sequelize'][_0xc1fa('0x49')](_0xc1fa('0x51')))),_0xc1fa('0x52')],[db['sequelize']['fn'](_0xc1fa('0x48'),db[_0xc1fa('0x47')]['fn']('IF',db['sequelize'][_0xc1fa('0x49')](_0xc1fa('0x53')))),'reCallContacts'],[db[_0xc1fa('0x47')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xc1fa('0x47')][_0xc1fa('0x49')](_0xc1fa('0x54')))),'answeringMachine']]})[_0xc1fa('0x24')](handleEntityNotFound(_0x1be09f,null))[_0xc1fa('0x24')](respondWithResult(_0x1be09f,null))[_0xc1fa('0x3d')](handleError(_0x1be09f,null));};exports[_0xc1fa('0x59')]=function(_0x116d90,_0xe75b82,_0x474fe8){return db[_0xc1fa('0x5a')][_0xc1fa('0x42')]({'where':{'id':_0x116d90['params']['id']}})[_0xc1fa('0x24')](handleEntityNotFound(_0xe75b82,null))[_0xc1fa('0x24')](function(_0x3f2fa4){var _0x22752b;if(_0x3f2fa4){_0x22752b=squel[_0xc1fa('0x5b')]()[_0xc1fa('0x5c')]('cm_hopper')['fromQuery'](['phone',_0xc1fa('0x5d'),'ContactId',_0xc1fa('0x5e'),_0xc1fa('0x5f'),_0xc1fa('0x60'),_0xc1fa('0x61')],squel[_0xc1fa('0x62')]()[_0xc1fa('0x63')](_0xc1fa('0x64'),'phone')[_0xc1fa('0x63')](_0xc1fa('0x65'),_0xc1fa('0x5d'))[_0xc1fa('0x63')](_0xc1fa('0x66'),_0xc1fa('0x67'))[_0xc1fa('0x63')](_0xc1fa('0x68'),_0xc1fa('0x5e'))[_0xc1fa('0x63')]('ANY_VALUE(VoiceQueueId)',_0xc1fa('0x5f'))[_0xc1fa('0x63')](_0xc1fa('0x65'),'createdAt')['field'](_0xc1fa('0x65'),_0xc1fa('0x61'))[_0xc1fa('0x69')]('cm_hopper_final')[_0xc1fa('0x38')]('VoiceQueueId\x20=\x20?',_0x116d90[_0xc1fa('0x3f')]['id']['toString']())['where']('state\x20=\x20?',_0x116d90[_0xc1fa('0x44')][_0xc1fa('0x6a')][_0xc1fa('0x6b')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xc1fa('0x62')]()[_0xc1fa('0x63')]('phone')[_0xc1fa('0x69')](_0xc1fa('0x6c'))[_0xc1fa('0x38')]('VoiceQueueId\x20=\x20?',_0x116d90[_0xc1fa('0x3f')]['id']['toString']()))[_0xc1fa('0x38')](_0xc1fa('0x6d'),squel['select']()[_0xc1fa('0x63')](_0xc1fa('0x6e'))[_0xc1fa('0x69')]('cm_hopper_final')[_0xc1fa('0x38')](_0xc1fa('0x6f'),_0x116d90[_0xc1fa('0x3f')]['id']['toString']())[_0xc1fa('0x38')]('state\x20=\x204'))[_0xc1fa('0x70')](_0xc1fa('0x67')))[_0xc1fa('0x6b')]();return db['sequelize'][_0xc1fa('0x30')](_0x22752b);}return[];})['then'](respondWithResult(_0xe75b82,null))[_0xc1fa('0x3d')](handleError(_0xe75b82,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x4367e2,_0x5492f5,_0x14cccc){return db['Campaign'][_0xc1fa('0x42')]({'where':{'id':_0x4367e2[_0xc1fa('0x3f')]['id']}})[_0xc1fa('0x24')](handleEntityNotFound(_0x5492f5,null))[_0xc1fa('0x24')](function(_0x34f78b){var _0x5aa483;if(_0x34f78b){_0x5aa483=squel[_0xc1fa('0x5b')]()[_0xc1fa('0x5c')]('cm_hopper')['fromQuery']([_0xc1fa('0x71'),_0xc1fa('0x5d'),'ContactId',_0xc1fa('0x5e'),_0xc1fa('0x72'),_0xc1fa('0x60'),_0xc1fa('0x61')],squel[_0xc1fa('0x62')]()[_0xc1fa('0x63')](_0xc1fa('0x64'),_0xc1fa('0x71'))[_0xc1fa('0x63')](_0xc1fa('0x65'),_0xc1fa('0x5d'))[_0xc1fa('0x63')](_0xc1fa('0x66'),_0xc1fa('0x67'))[_0xc1fa('0x63')](_0xc1fa('0x68'),'ListId')[_0xc1fa('0x63')](_0xc1fa('0x73'),_0xc1fa('0x72'))['field'](_0xc1fa('0x65'),_0xc1fa('0x60'))[_0xc1fa('0x63')](_0xc1fa('0x65'),_0xc1fa('0x61'))[_0xc1fa('0x69')](_0xc1fa('0x74'))[_0xc1fa('0x38')](_0xc1fa('0x75'),_0x4367e2[_0xc1fa('0x3f')]['id'][_0xc1fa('0x6b')]())[_0xc1fa('0x38')]('state\x20=\x20?',_0x4367e2[_0xc1fa('0x44')][_0xc1fa('0x6a')][_0xc1fa('0x6b')]())[_0xc1fa('0x38')](_0xc1fa('0x76'))[_0xc1fa('0x38')](_0xc1fa('0x6d'),squel['select']()[_0xc1fa('0x63')](_0xc1fa('0x71'))[_0xc1fa('0x69')](_0xc1fa('0x6c'))[_0xc1fa('0x38')](_0xc1fa('0x75'),_0x4367e2[_0xc1fa('0x3f')]['id']['toString']()))[_0xc1fa('0x38')](_0xc1fa('0x6d'),squel['select']()[_0xc1fa('0x63')]('calleridnum')[_0xc1fa('0x69')]('cm_hopper_final')[_0xc1fa('0x38')](_0xc1fa('0x75'),_0x4367e2[_0xc1fa('0x3f')]['id'][_0xc1fa('0x6b')]())[_0xc1fa('0x38')](_0xc1fa('0x77')))[_0xc1fa('0x70')]('ContactId'))[_0xc1fa('0x6b')]();return db[_0xc1fa('0x47')][_0xc1fa('0x30')](_0x5aa483);}return[];})[_0xc1fa('0x24')](respondWithResult(_0x5492f5,null))[_0xc1fa('0x3d')](handleError(_0x5492f5,null));};exports[_0xc1fa('0x78')]=function(_0xce3adc,_0x4e9907,_0x1175c4){return db[_0xc1fa('0x79')][_0xc1fa('0x7a')]({'where':{'VoiceQueueId':_0xce3adc['body']['VoiceQueueId'],'CampaignId':_0xce3adc[_0xc1fa('0x44')][_0xc1fa('0x72')],'ContactId':_0xce3adc[_0xc1fa('0x44')][_0xc1fa('0x67')]}})[_0xc1fa('0x24')](handleEntityNotFound(_0x4e9907,null))[_0xc1fa('0x24')](function(_0x445733){if(_0x445733){return _0x445733;}return null;})[_0xc1fa('0x24')](respondWithResult(_0x4e9907,null))[_0xc1fa('0x3d')](handleError(_0x4e9907,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index f3965e6..4cd9474 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 _0x78cb=['exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3d784f,_0x100ef1){var _0x32340e=function(_0xfd0c00){while(--_0xfd0c00){_0x3d784f['push'](_0x3d784f['shift']());}};_0x32340e(++_0x100ef1);}(_0x78cb,0x87));var _0xb78c=function(_0x17313d,_0x131cc8){_0x17313d=_0x17313d-0x0;var _0x46bcda=_0x78cb[_0x17313d];return _0x46bcda;};'use strict';var _=require(_0xb78c('0x0'));var util=require(_0xb78c('0x1'));var logger=require('../../config/logger')(_0xb78c('0x2'));var moment=require(_0xb78c('0x3'));var BPromise=require(_0xb78c('0x4'));var rp=require(_0xb78c('0x5'));var fs=require('fs');var path=require(_0xb78c('0x6'));var rimraf=require(_0xb78c('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xb78c('0x8')]=function(_0x5d1b6d,_0x55ff38){return _0x5d1b6d['define'](_0xb78c('0x9'),attributes,{'tableName':_0xb78c('0xa'),'paranoid':![],'indexes':[{'name':_0xb78c('0xb'),'fields':[_0xb78c('0xb')]},{'name':_0xb78c('0xc'),'fields':[_0xb78c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6458=['../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0xfbd9fc,_0x1b2b9d){var _0x11bbad=function(_0x208a7d){while(--_0x208a7d){_0xfbd9fc['push'](_0xfbd9fc['shift']());}};_0x11bbad(++_0x1b2b9d);}(_0x6458,0xd8));var _0x8645=function(_0x2ac71a,_0x1d2a02){_0x2ac71a=_0x2ac71a-0x0;var _0x3ee904=_0x6458[_0x2ac71a];return _0x3ee904;};'use strict';var _=require(_0x8645('0x0'));var util=require(_0x8645('0x1'));var logger=require(_0x8645('0x2'))('api');var moment=require(_0x8645('0x3'));var BPromise=require(_0x8645('0x4'));var rp=require(_0x8645('0x5'));var fs=require('fs');var path=require(_0x8645('0x6'));var rimraf=require(_0x8645('0x7'));var config=require(_0x8645('0x8'));var attributes=require(_0x8645('0x9'));module[_0x8645('0xa')]=function(_0x11def9,_0x11ac3a){return _0x11def9[_0x8645('0xb')](_0x8645('0xc'),attributes,{'tableName':_0x8645('0xd'),'paranoid':![],'indexes':[{'name':_0x8645('0xe'),'fields':[_0x8645('0xe')]},{'name':_0x8645('0xf'),'fields':[_0x8645('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 2347917..8e7b783 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 _0x5c69=['jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','create','body','options','CreateCmHopperFinal','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1f231b,_0x5d48e3){var _0x49b61a=function(_0x550b7c){while(--_0x550b7c){_0x1f231b['push'](_0x1f231b['shift']());}};_0x49b61a(++_0x5d48e3);}(_0x5c69,0x189));var _0x95c6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x5c69[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x95c6('0x0'));var util=require(_0x95c6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95c6('0x2'));var db=require(_0x95c6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x95c6('0x4'))(_0x95c6('0x5'));var config=require(_0x95c6('0x6'));var jayson=require(_0x95c6('0x7'));var client=jayson[_0x95c6('0x8')][_0x95c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53f9ec,_0x84062c,_0x2b55da){return new BPromise(function(_0x3d2811,_0x5ca347){return client[_0x95c6('0xa')](_0x53f9ec,_0x2b55da)['then'](function(_0x2a1e7e){logger[_0x95c6('0xb')](_0x95c6('0xc'),_0x84062c,'request\x20sent');logger[_0x95c6('0xd')](_0x95c6('0xe'),_0x84062c,_0x95c6('0xf'),JSON[_0x95c6('0x10')](_0x2a1e7e));if(_0x2a1e7e[_0x95c6('0x11')]){if(_0x2a1e7e['error']['code']===0x1f4){logger[_0x95c6('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x84062c,_0x2a1e7e[_0x95c6('0x11')][_0x95c6('0x12')]);return _0x5ca347(_0x2a1e7e[_0x95c6('0x11')][_0x95c6('0x12')]);}logger[_0x95c6('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x84062c,_0x2a1e7e[_0x95c6('0x11')][_0x95c6('0x12')]);return _0x3d2811(_0x2a1e7e['error'][_0x95c6('0x12')]);}else{logger[_0x95c6('0xb')](_0x95c6('0xc'),_0x84062c,'request\x20sent');_0x3d2811(_0x2a1e7e[_0x95c6('0x13')][_0x95c6('0x12')]);}})[_0x95c6('0x14')](function(_0xa6461e){logger[_0x95c6('0x11')](_0x95c6('0xc'),_0x84062c,_0xa6461e);_0x5ca347(_0xa6461e);});});}exports['CreateCmHopperFinal']=function(_0x3e9959){var _0x1212a7=this;return new Promise(function(_0x554d42,_0x46dc01){return db['CmHopperFinal'][_0x95c6('0x15')](_0x3e9959[_0x95c6('0x16')],{'raw':_0x3e9959[_0x95c6('0x17')]?_0x3e9959[_0x95c6('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x487d87){logger[_0x95c6('0xb')](_0x95c6('0x18'),_0x3e9959);logger[_0x95c6('0xd')](_0x95c6('0x18'),_0x3e9959,JSON[_0x95c6('0x10')](_0x487d87));_0x554d42(_0x487d87);})[_0x95c6('0x14')](function(_0x30873f){logger[_0x95c6('0x11')](_0x95c6('0x18'),_0x30873f[_0x95c6('0x12')],_0x3e9959);_0x46dc01(_0x1212a7[_0x95c6('0x11')](0x1f4,_0x30873f['message']));});});}; \ No newline at end of file +var _0x1749=['CmHopperFinal','create','body','options','raw','debug','CreateCmHopperFinal','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','request','then','CmHopperFinal,\x20%s,\x20%s','request\x20sent','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x5cef41,_0xa8921){var _0x313fe6=function(_0x33ea59){while(--_0x33ea59){_0x5cef41['push'](_0x5cef41['shift']());}};_0x313fe6(++_0xa8921);}(_0x1749,0xfa));var _0x9174=function(_0x82844e,_0x5c5b0d){_0x82844e=_0x82844e-0x0;var _0xef4adb=_0x1749[_0x82844e];return _0xef4adb;};'use strict';var _=require(_0x9174('0x0'));var util=require(_0x9174('0x1'));var moment=require('moment');var BPromise=require(_0x9174('0x2'));var rs=require(_0x9174('0x3'));var fs=require('fs');var Redis=require(_0x9174('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9174('0x5'));var config=require(_0x9174('0x6'));var jayson=require(_0x9174('0x7'));var client=jayson[_0x9174('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7102,_0x383b98,_0x2eae41){return new BPromise(function(_0x8d5b9b,_0x580c69){return client[_0x9174('0x9')](_0x5d7102,_0x2eae41)[_0x9174('0xa')](function(_0x549741){logger['info'](_0x9174('0xb'),_0x383b98,_0x9174('0xc'));logger['debug'](_0x9174('0xd'),_0x383b98,_0x9174('0xc'),JSON[_0x9174('0xe')](_0x549741));if(_0x549741[_0x9174('0xf')]){if(_0x549741[_0x9174('0xf')][_0x9174('0x10')]===0x1f4){logger[_0x9174('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x383b98,_0x549741[_0x9174('0xf')][_0x9174('0x11')]);return _0x580c69(_0x549741['error']['message']);}logger[_0x9174('0xf')]('CmHopperFinal,\x20%s,\x20%s',_0x383b98,_0x549741[_0x9174('0xf')]['message']);return _0x8d5b9b(_0x549741[_0x9174('0xf')]['message']);}else{logger[_0x9174('0x12')](_0x9174('0xb'),_0x383b98,_0x9174('0xc'));_0x8d5b9b(_0x549741['result']['message']);}})[_0x9174('0x13')](function(_0x2f4658){logger[_0x9174('0xf')](_0x9174('0xb'),_0x383b98,_0x2f4658);_0x580c69(_0x2f4658);});});}exports['CreateCmHopperFinal']=function(_0x450b67){var _0x43ae03=this;return new Promise(function(_0x1fc5f4,_0x3a72a4){return db[_0x9174('0x14')][_0x9174('0x15')](_0x450b67[_0x9174('0x16')],{'raw':_0x450b67[_0x9174('0x17')]?_0x450b67['options'][_0x9174('0x18')]===undefined?!![]:![]:!![]})[_0x9174('0xa')](function(_0x2c5b5c){logger[_0x9174('0x12')]('CreateCmHopperFinal',_0x450b67);logger[_0x9174('0x19')](_0x9174('0x1a'),_0x450b67,JSON['stringify'](_0x2c5b5c));_0x1fc5f4(_0x2c5b5c);})[_0x9174('0x13')](function(_0x1f0262){logger[_0x9174('0xf')](_0x9174('0x1a'),_0x1f0262[_0x9174('0x11')],_0x450b67);_0x3a72a4(_0x43ae03[_0x9174('0xf')](0x1f4,_0x1f0262[_0x9174('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index d3c6a91..cdc3380 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 _0x282c=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','update','exports','util','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x282c,0x16f));var _0xc282=function(_0x5ed9df,_0x186e10){_0x5ed9df=_0x5ed9df-0x0;var _0x56a2c7=_0x282c[_0x5ed9df];return _0x56a2c7;};'use strict';var multer=require('multer');var util=require(_0xc282('0x0'));var path=require('path');var timeout=require(_0xc282('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xc282('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc282('0x3'));var controller=require('./cmHopperFinal.controller');router[_0xc282('0x4')]('/',auth[_0xc282('0x5')](),controller[_0xc282('0x6')]);router['get']('/describe',auth[_0xc282('0x5')](),controller[_0xc282('0x7')]);router[_0xc282('0x4')](_0xc282('0x8'),auth[_0xc282('0x5')](),controller['show']);router[_0xc282('0x4')](_0xc282('0x9'),auth[_0xc282('0x5')](),controller[_0xc282('0xa')]);router['get'](_0xc282('0xb'),auth['isAuthenticated'](),controller[_0xc282('0xc')]);router['post'](_0xc282('0xd'),auth['isAuthenticated'](),controller[_0xc282('0xe')]);router[_0xc282('0xf')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc282('0xf')](_0xc282('0x10'),auth[_0xc282('0x5')](),controller[_0xc282('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc282('0x12')]);module[_0xc282('0x13')]=router; \ No newline at end of file +var _0xa826=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/:id','update'];(function(_0x2b0a86,_0x2ecebd){var _0x955940=function(_0x1988f8){while(--_0x1988f8){_0x2b0a86['push'](_0x2b0a86['shift']());}};_0x955940(++_0x2ecebd);}(_0xa826,0x65));var _0x6a82=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa826[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x6a82('0x0'));var util=require(_0x6a82('0x1'));var path=require(_0x6a82('0x2'));var timeout=require(_0x6a82('0x3'));var express=require('express');var router=express[_0x6a82('0x4')]();var auth=require(_0x6a82('0x5'));var interaction=require(_0x6a82('0x6'));var config=require(_0x6a82('0x7'));var controller=require(_0x6a82('0x8'));router[_0x6a82('0x9')]('/',auth[_0x6a82('0xa')](),controller[_0x6a82('0xb')]);router[_0x6a82('0x9')](_0x6a82('0xc'),auth[_0x6a82('0xa')](),controller[_0x6a82('0xd')]);router[_0x6a82('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x6a82('0xe'),auth['isAuthenticated'](),controller[_0x6a82('0xf')]);router['get'](_0x6a82('0x10'),auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router['post'](_0x6a82('0x11'),auth[_0x6a82('0xa')](),controller[_0x6a82('0x12')]);router[_0x6a82('0x13')](_0x6a82('0x14'),auth[_0x6a82('0xa')](),controller[_0x6a82('0x15')]);router['post']('/checkContactHopper',auth[_0x6a82('0xa')](),controller['checkContactHopper']);router['put'](_0x6a82('0x16'),auth[_0x6a82('0xa')](),controller[_0x6a82('0x17')]);module[_0x6a82('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index dcf8254..5123c9b 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 _0x45a6=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x139a89,_0x74c7d9){var _0x1ffad5=function(_0x44ba70){while(--_0x44ba70){_0x139a89['push'](_0x139a89['shift']());}};_0x1ffad5(++_0x74c7d9);}(_0x45a6,0xec));var _0x645a=function(_0x4f400e,_0x5399d1){_0x4f400e=_0x4f400e-0x0;var _0x2b5c1c=_0x45a6[_0x4f400e];return _0x2b5c1c;};'use strict';var Sequelize=require(_0x645a('0x0'));module['exports']={'state':{'type':Sequelize[_0x645a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x645a('0x2')]},'scheduledat':{'type':Sequelize[_0x645a('0x3')]},'countbusyretry':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x645a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x645a('0x2')]},'originatecalleridname':{'type':Sequelize[_0x645a('0x2')]},'calleridnum':{'type':Sequelize[_0x645a('0x2')]},'calleridname':{'type':Sequelize[_0x645a('0x2')]},'starttime':{'type':Sequelize[_0x645a('0x3')]},'responsetime':{'type':Sequelize[_0x645a('0x3')]},'answertime':{'type':Sequelize[_0x645a('0x3')]},'droptime':{'type':Sequelize[_0x645a('0x3')]},'endtime':{'type':Sequelize[_0x645a('0x3')]},'ringtime':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x645a('0x2')]},'campaign':{'type':Sequelize[_0x645a('0x2')]},'campaigntype':{'type':Sequelize[_0x645a('0x2')]},'membername':{'type':Sequelize[_0x645a('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x645a('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x645a('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x645a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x645a('0x3')]},'recallme':{'type':Sequelize[_0x645a('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x645a('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x8793=['DATE','BOOLEAN','sequelize','INTEGER','STRING'];(function(_0x19129c,_0x1f9e74){var _0x4b5069=function(_0x2f777a){while(--_0x2f777a){_0x19129c['push'](_0x19129c['shift']());}};_0x4b5069(++_0x1f9e74);}(_0x8793,0xb1));var _0x3879=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x8793[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x3879('0x0'));module['exports']={'state':{'type':Sequelize[_0x3879('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3879('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x3879('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3879('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3879('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3879('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3879('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x3879('0x2')]},'originatecalleridname':{'type':Sequelize[_0x3879('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x3879('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3879('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3879('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3879('0x2')]},'campaign':{'type':Sequelize[_0x3879('0x2')]},'campaigntype':{'type':Sequelize[_0x3879('0x2')]},'membername':{'type':Sequelize[_0x3879('0x2')]},'reason':{'type':Sequelize[_0x3879('0x2')]},'amd':{'type':Sequelize[_0x3879('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3879('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3879('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3879('0x3')]},'recallme':{'type':Sequelize[_0x3879('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3879('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index e09f967..4536ff0 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 _0xba57=['../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','set','apply','reject','save','then','destroy','status','error','stack','name','send','map','CmHopperHistory','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','where','options','count','includeAll','rows','catch','show','params','keys','rawAttributes','create','body','describe','update','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0xa81780,_0x47cec8){var _0x177b0d=function(_0x3b4b77){while(--_0x3b4b77){_0xa81780['push'](_0xa81780['shift']());}};_0x177b0d(++_0x47cec8);}(_0xba57,0x1b1));var _0x7ba5=function(_0x18842e,_0x2681a9){_0x18842e=_0x18842e-0x0;var _0x842dd3=_0xba57[_0x18842e];return _0x842dd3;};'use strict';var pdf=require(_0x7ba5('0x0'));var emlformat=require(_0x7ba5('0x1'));var rimraf=require(_0x7ba5('0x2'));var zipdir=require(_0x7ba5('0x3'));var jsonpatch=require(_0x7ba5('0x4'));var rp=require(_0x7ba5('0x5'));var moment=require('moment');var BPromise=require(_0x7ba5('0x6'));var Mustache=require('mustache');var util=require(_0x7ba5('0x7'));var path=require(_0x7ba5('0x8'));var sox=require(_0x7ba5('0x9'));var csv=require(_0x7ba5('0xa'));var ejs=require(_0x7ba5('0xb'));var fs=require('fs');var _=require(_0x7ba5('0xc'));var squel=require(_0x7ba5('0xd'));var crypto=require(_0x7ba5('0xe'));var jsforce=require(_0x7ba5('0xf'));var deskjs=require(_0x7ba5('0x10'));var toCsv=require(_0x7ba5('0xa'));var querystring=require(_0x7ba5('0x11'));var Papa=require(_0x7ba5('0x12'));var Redis=require(_0x7ba5('0x13'));var authService=require(_0x7ba5('0x14'));var qs=require(_0x7ba5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ba5('0x16'));var logger=require(_0x7ba5('0x17'))(_0x7ba5('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7ba5('0x19'))['db'];function respondWithStatusCode(_0x59bde5,_0x5bb46e){_0x5bb46e=_0x5bb46e||0xcc;return function(_0x21fbfc){if(_0x21fbfc){return _0x59bde5[_0x7ba5('0x1a')](_0x5bb46e);}return _0x59bde5['status'](_0x5bb46e)[_0x7ba5('0x1b')]();};}function respondWithResult(_0x47bc7e,_0x64a5d9){_0x64a5d9=_0x64a5d9||0xc8;return function(_0x3530be){if(_0x3530be){return _0x47bc7e['status'](_0x64a5d9)[_0x7ba5('0x1c')](_0x3530be);}};}function respondWithFilteredResult(_0x4915e0,_0x378177){return function(_0x5391f3){if(_0x5391f3){var _0x5ea4a3=_0x5391f3['count'],_0x5743c3=_0x378177['offset'],_0x26e104=_0x378177[_0x7ba5('0x1d')]+_0x378177['limit'],_0x37cda4;if(_0x26e104>=_0x5ea4a3){_0x26e104=_0x5ea4a3;_0x37cda4=0xc8;}else{_0x37cda4=0xce;}_0x4915e0['status'](_0x37cda4);return _0x4915e0[_0x7ba5('0x1e')]('Content-Range',_0x5743c3+'-'+_0x26e104+'/'+_0x5ea4a3)[_0x7ba5('0x1c')](_0x5391f3);}return null;};}function patchUpdates(_0x170226){return function(_0x589a8d){try{jsonpatch[_0x7ba5('0x1f')](_0x589a8d,_0x170226,!![]);}catch(_0x5c8c8a){return BPromise[_0x7ba5('0x20')](_0x5c8c8a);}return _0x589a8d[_0x7ba5('0x21')]();};}function saveUpdates(_0x38af02,_0x4f1744){return function(_0x29fa1f){if(_0x29fa1f){return _0x29fa1f['update'](_0x38af02)[_0x7ba5('0x22')](function(_0x16644c){return _0x16644c;});}return null;};}function removeEntity(_0x5d345a,_0x500d77){return function(_0x1bac65){if(_0x1bac65){return _0x1bac65[_0x7ba5('0x23')]()[_0x7ba5('0x22')](function(){_0x5d345a[_0x7ba5('0x24')](0xcc)[_0x7ba5('0x1b')]();});}};}function handleEntityNotFound(_0x405359,_0x1dd658){return function(_0x15f36d){if(!_0x15f36d){_0x405359[_0x7ba5('0x1a')](0x194);}return _0x15f36d;};}function handleError(_0x3a1e70,_0x1c2f78){_0x1c2f78=_0x1c2f78||0x1f4;return function(_0x31903c){logger[_0x7ba5('0x25')](_0x31903c[_0x7ba5('0x26')]);if(_0x31903c[_0x7ba5('0x27')]){delete _0x31903c[_0x7ba5('0x27')];}_0x3a1e70[_0x7ba5('0x24')](_0x1c2f78)[_0x7ba5('0x28')](_0x31903c);};}exports['index']=function(_0x2d618a,_0x587033){var _0xe89a95={},_0x571fb4={},_0x258d7a={'count':0x0,'rows':[]};var _0x4aecd4=_[_0x7ba5('0x29')](db[_0x7ba5('0x2a')]['rawAttributes'],function(_0x575fc5){return{'name':_0x575fc5[_0x7ba5('0x2b')],'type':_0x575fc5[_0x7ba5('0x2c')][_0x7ba5('0x2d')]};});_0x571fb4[_0x7ba5('0x2e')]=_[_0x7ba5('0x29')](_0x4aecd4,_0x7ba5('0x27'));_0x571fb4[_0x7ba5('0x2f')]=_['keys'](_0x2d618a[_0x7ba5('0x2f')]);_0x571fb4['filters']=_[_0x7ba5('0x30')](_0x571fb4[_0x7ba5('0x2e')],_0x571fb4[_0x7ba5('0x2f')]);_0xe89a95['attributes']=_['intersection'](_0x571fb4[_0x7ba5('0x2e')],qs['fields'](_0x2d618a['query'][_0x7ba5('0x31')]));_0xe89a95[_0x7ba5('0x32')]=_0xe89a95[_0x7ba5('0x32')][_0x7ba5('0x33')]?_0xe89a95[_0x7ba5('0x32')]:_0x571fb4['model'];if(!_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x34')](_0x7ba5('0x35'))){_0xe89a95[_0x7ba5('0x36')]=qs[_0x7ba5('0x36')](_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x36')]);_0xe89a95[_0x7ba5('0x1d')]=qs[_0x7ba5('0x1d')](_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x1d')]);}_0xe89a95[_0x7ba5('0x37')]=qs[_0x7ba5('0x38')](_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x38')]);_0xe89a95['where']=qs[_0x7ba5('0x39')](_[_0x7ba5('0x3a')](_0x2d618a[_0x7ba5('0x2f')],_0x571fb4[_0x7ba5('0x39')]));if(_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x3b')]){_0xe89a95['where']=_[_0x7ba5('0x3c')](_0xe89a95[_0x7ba5('0x3d')],{'$or':_['map'](_0x4aecd4,function(_0x4be58a){if(_0x4be58a[_0x7ba5('0x2c')]!=='VIRTUAL'){var _0x197377={};_0x197377[_0x4be58a[_0x7ba5('0x27')]]={'$like':'%'+_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x3b')]+'%'};return _0x197377;}})});}_0xe89a95=_['merge']({},_0xe89a95,_0x2d618a[_0x7ba5('0x3e')]);var _0x3b1fc6={'where':_0xe89a95[_0x7ba5('0x3d')]};return db[_0x7ba5('0x2a')][_0x7ba5('0x3f')](_0x3b1fc6)[_0x7ba5('0x22')](function(_0x3c8123){_0x258d7a['count']=_0x3c8123;if(_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x40')]){_0xe89a95['include']=[{'all':!![]}];}return db[_0x7ba5('0x2a')]['findAll'](_0xe89a95);})[_0x7ba5('0x22')](function(_0x250492){_0x258d7a[_0x7ba5('0x41')]=_0x250492;return _0x258d7a;})['then'](respondWithFilteredResult(_0x587033,_0xe89a95))[_0x7ba5('0x42')](handleError(_0x587033,null));};exports[_0x7ba5('0x43')]=function(_0x1fc75c,_0x440bc9){var _0x54f5ba={'raw':!![],'where':{'id':_0x1fc75c[_0x7ba5('0x44')]['id']}},_0x5a34b1={};_0x5a34b1[_0x7ba5('0x2e')]=_[_0x7ba5('0x45')](db[_0x7ba5('0x2a')][_0x7ba5('0x46')]);_0x5a34b1[_0x7ba5('0x2f')]=_[_0x7ba5('0x45')](_0x1fc75c[_0x7ba5('0x2f')]);_0x5a34b1[_0x7ba5('0x39')]=_[_0x7ba5('0x30')](_0x5a34b1[_0x7ba5('0x2e')],_0x5a34b1['query']);_0x54f5ba[_0x7ba5('0x32')]=_['intersection'](_0x5a34b1['model'],qs['fields'](_0x1fc75c['query'][_0x7ba5('0x31')]));_0x54f5ba[_0x7ba5('0x32')]=_0x54f5ba[_0x7ba5('0x32')]['length']?_0x54f5ba[_0x7ba5('0x32')]:_0x5a34b1[_0x7ba5('0x2e')];if(_0x1fc75c[_0x7ba5('0x2f')]['includeAll']){_0x54f5ba['include']=[{'all':!![]}];}_0x54f5ba=_[_0x7ba5('0x3c')]({},_0x54f5ba,_0x1fc75c[_0x7ba5('0x3e')]);return db[_0x7ba5('0x2a')]['find'](_0x54f5ba)[_0x7ba5('0x22')](handleEntityNotFound(_0x440bc9,null))[_0x7ba5('0x22')](respondWithResult(_0x440bc9,null))[_0x7ba5('0x42')](handleError(_0x440bc9,null));};exports[_0x7ba5('0x47')]=function(_0x88603e,_0x2b7e55){return db[_0x7ba5('0x2a')][_0x7ba5('0x47')](_0x88603e[_0x7ba5('0x48')],{})[_0x7ba5('0x22')](respondWithResult(_0x2b7e55,0xc9))[_0x7ba5('0x42')](handleError(_0x2b7e55,null));};exports[_0x7ba5('0x49')]=function(_0x45005b,_0xba504){return db[_0x7ba5('0x2a')][_0x7ba5('0x49')]()[_0x7ba5('0x22')](respondWithResult(_0xba504,null))[_0x7ba5('0x42')](handleError(_0xba504,null));};exports[_0x7ba5('0x4a')]=function(_0x4b76dc,_0x209b68){if(_0x4b76dc[_0x7ba5('0x48')]['uniqueid']){delete _0x4b76dc[_0x7ba5('0x48')]['uniqueid'];}return db[_0x7ba5('0x2a')][_0x7ba5('0x4b')]({'where':{'uniqueid':_0x4b76dc['params']['id']}})[_0x7ba5('0x22')](handleEntityNotFound(_0x209b68,null))['then'](saveUpdates(_0x4b76dc[_0x7ba5('0x48')],null))[_0x7ba5('0x22')](respondWithResult(_0x209b68,null))[_0x7ba5('0x42')](handleError(_0x209b68,null));}; \ No newline at end of file +var _0x6cad=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','status','json','count','offset','limit','set','Content-Range','reject','then','destroy','error','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','body','catch','describe','update','uniqueid','find','eml-format','rimraf'];(function(_0x331e81,_0x3dd743){var _0x531234=function(_0x43402e){while(--_0x43402e){_0x331e81['push'](_0x331e81['shift']());}};_0x531234(++_0x3dd743);}(_0x6cad,0x161));var _0xd6ca=function(_0x4341be,_0x4f5b88){_0x4341be=_0x4341be-0x0;var _0x108199=_0x6cad[_0x4341be];return _0x108199;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd6ca('0x0'));var rimraf=require(_0xd6ca('0x1'));var zipdir=require(_0xd6ca('0x2'));var jsonpatch=require(_0xd6ca('0x3'));var rp=require(_0xd6ca('0x4'));var moment=require(_0xd6ca('0x5'));var BPromise=require(_0xd6ca('0x6'));var Mustache=require('mustache');var util=require(_0xd6ca('0x7'));var path=require(_0xd6ca('0x8'));var sox=require('sox');var csv=require(_0xd6ca('0x9'));var ejs=require(_0xd6ca('0xa'));var fs=require('fs');var _=require(_0xd6ca('0xb'));var squel=require(_0xd6ca('0xc'));var crypto=require(_0xd6ca('0xd'));var jsforce=require(_0xd6ca('0xe'));var deskjs=require(_0xd6ca('0xf'));var toCsv=require(_0xd6ca('0x9'));var querystring=require(_0xd6ca('0x10'));var Papa=require('papaparse');var Redis=require(_0xd6ca('0x11'));var authService=require(_0xd6ca('0x12'));var qs=require(_0xd6ca('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd6ca('0x14'))(_0xd6ca('0x15'));var utils=require('../../config/utils');var config=require(_0xd6ca('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5545e4,_0x15f1f4){_0x15f1f4=_0x15f1f4||0xcc;return function(_0x367ec1){if(_0x367ec1){return _0x5545e4['sendStatus'](_0x15f1f4);}return _0x5545e4['status'](_0x15f1f4)['end']();};}function respondWithResult(_0x57ca55,_0x25a7b0){_0x25a7b0=_0x25a7b0||0xc8;return function(_0x13cdfa){if(_0x13cdfa){return _0x57ca55[_0xd6ca('0x17')](_0x25a7b0)[_0xd6ca('0x18')](_0x13cdfa);}};}function respondWithFilteredResult(_0x2a5ab2,_0x1aacfb){return function(_0x4e60b9){if(_0x4e60b9){var _0x46fb96=_0x4e60b9[_0xd6ca('0x19')],_0x19656d=_0x1aacfb[_0xd6ca('0x1a')],_0xf1635=_0x1aacfb[_0xd6ca('0x1a')]+_0x1aacfb[_0xd6ca('0x1b')],_0x34a38b;if(_0xf1635>=_0x46fb96){_0xf1635=_0x46fb96;_0x34a38b=0xc8;}else{_0x34a38b=0xce;}_0x2a5ab2[_0xd6ca('0x17')](_0x34a38b);return _0x2a5ab2[_0xd6ca('0x1c')](_0xd6ca('0x1d'),_0x19656d+'-'+_0xf1635+'/'+_0x46fb96)[_0xd6ca('0x18')](_0x4e60b9);}return null;};}function patchUpdates(_0x4b3906){return function(_0x4875a1){try{jsonpatch['apply'](_0x4875a1,_0x4b3906,!![]);}catch(_0x1d2237){return BPromise[_0xd6ca('0x1e')](_0x1d2237);}return _0x4875a1['save']();};}function saveUpdates(_0x43b9d9,_0x1c648f){return function(_0x413eb1){if(_0x413eb1){return _0x413eb1['update'](_0x43b9d9)[_0xd6ca('0x1f')](function(_0x39b917){return _0x39b917;});}return null;};}function removeEntity(_0xa88bc9,_0x8d50cc){return function(_0x3bf8a3){if(_0x3bf8a3){return _0x3bf8a3[_0xd6ca('0x20')]()['then'](function(){_0xa88bc9[_0xd6ca('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x75817,_0x3c5900){return function(_0x2e9518){if(!_0x2e9518){_0x75817['sendStatus'](0x194);}return _0x2e9518;};}function handleError(_0xcee09a,_0x595d5c){_0x595d5c=_0x595d5c||0x1f4;return function(_0x35b39e){logger[_0xd6ca('0x21')](_0x35b39e[_0xd6ca('0x22')]);if(_0x35b39e[_0xd6ca('0x23')]){delete _0x35b39e[_0xd6ca('0x23')];}_0xcee09a['status'](_0x595d5c)[_0xd6ca('0x24')](_0x35b39e);};}exports['index']=function(_0x108e56,_0x1fd985){var _0x1cc02d={},_0x14d19b={},_0x3264ed={'count':0x0,'rows':[]};var _0x376fd9=_[_0xd6ca('0x25')](db[_0xd6ca('0x26')][_0xd6ca('0x27')],function(_0x4d8f89){return{'name':_0x4d8f89[_0xd6ca('0x28')],'type':_0x4d8f89[_0xd6ca('0x29')]['key']};});_0x14d19b[_0xd6ca('0x2a')]=_[_0xd6ca('0x25')](_0x376fd9,_0xd6ca('0x23'));_0x14d19b[_0xd6ca('0x2b')]=_[_0xd6ca('0x2c')](_0x108e56[_0xd6ca('0x2b')]);_0x14d19b[_0xd6ca('0x2d')]=_[_0xd6ca('0x2e')](_0x14d19b[_0xd6ca('0x2a')],_0x14d19b[_0xd6ca('0x2b')]);_0x1cc02d[_0xd6ca('0x2f')]=_['intersection'](_0x14d19b[_0xd6ca('0x2a')],qs[_0xd6ca('0x30')](_0x108e56[_0xd6ca('0x2b')]['fields']));_0x1cc02d['attributes']=_0x1cc02d[_0xd6ca('0x2f')][_0xd6ca('0x31')]?_0x1cc02d[_0xd6ca('0x2f')]:_0x14d19b[_0xd6ca('0x2a')];if(!_0x108e56[_0xd6ca('0x2b')][_0xd6ca('0x32')](_0xd6ca('0x33'))){_0x1cc02d['limit']=qs[_0xd6ca('0x1b')](_0x108e56['query']['limit']);_0x1cc02d[_0xd6ca('0x1a')]=qs[_0xd6ca('0x1a')](_0x108e56[_0xd6ca('0x2b')][_0xd6ca('0x1a')]);}_0x1cc02d[_0xd6ca('0x34')]=qs['sort'](_0x108e56['query']['sort']);_0x1cc02d[_0xd6ca('0x35')]=qs[_0xd6ca('0x2d')](_[_0xd6ca('0x36')](_0x108e56[_0xd6ca('0x2b')],_0x14d19b[_0xd6ca('0x2d')]));if(_0x108e56[_0xd6ca('0x2b')][_0xd6ca('0x37')]){_0x1cc02d['where']=_[_0xd6ca('0x38')](_0x1cc02d[_0xd6ca('0x35')],{'$or':_[_0xd6ca('0x25')](_0x376fd9,function(_0x55b4e9){if(_0x55b4e9[_0xd6ca('0x29')]!==_0xd6ca('0x39')){var _0x5e41de={};_0x5e41de[_0x55b4e9[_0xd6ca('0x23')]]={'$like':'%'+_0x108e56['query'][_0xd6ca('0x37')]+'%'};return _0x5e41de;}})});}_0x1cc02d=_['merge']({},_0x1cc02d,_0x108e56[_0xd6ca('0x3a')]);var _0x17c1dc={'where':_0x1cc02d[_0xd6ca('0x35')]};return db['CmHopperHistory'][_0xd6ca('0x19')](_0x17c1dc)[_0xd6ca('0x1f')](function(_0x41e37f){_0x3264ed[_0xd6ca('0x19')]=_0x41e37f;if(_0x108e56[_0xd6ca('0x2b')][_0xd6ca('0x3b')]){_0x1cc02d[_0xd6ca('0x3c')]=[{'all':!![]}];}return db[_0xd6ca('0x26')][_0xd6ca('0x3d')](_0x1cc02d);})[_0xd6ca('0x1f')](function(_0x1103c2){_0x3264ed[_0xd6ca('0x3e')]=_0x1103c2;return _0x3264ed;})['then'](respondWithFilteredResult(_0x1fd985,_0x1cc02d))['catch'](handleError(_0x1fd985,null));};exports[_0xd6ca('0x3f')]=function(_0x2e5128,_0x2c2b3d){var _0x3a67b8={'raw':!![],'where':{'id':_0x2e5128[_0xd6ca('0x40')]['id']}},_0x5edbd9={};_0x5edbd9[_0xd6ca('0x2a')]=_[_0xd6ca('0x2c')](db[_0xd6ca('0x26')][_0xd6ca('0x27')]);_0x5edbd9[_0xd6ca('0x2b')]=_[_0xd6ca('0x2c')](_0x2e5128[_0xd6ca('0x2b')]);_0x5edbd9[_0xd6ca('0x2d')]=_[_0xd6ca('0x2e')](_0x5edbd9['model'],_0x5edbd9['query']);_0x3a67b8[_0xd6ca('0x2f')]=_['intersection'](_0x5edbd9[_0xd6ca('0x2a')],qs[_0xd6ca('0x30')](_0x2e5128['query'][_0xd6ca('0x30')]));_0x3a67b8[_0xd6ca('0x2f')]=_0x3a67b8[_0xd6ca('0x2f')][_0xd6ca('0x31')]?_0x3a67b8[_0xd6ca('0x2f')]:_0x5edbd9[_0xd6ca('0x2a')];if(_0x2e5128[_0xd6ca('0x2b')][_0xd6ca('0x3b')]){_0x3a67b8[_0xd6ca('0x3c')]=[{'all':!![]}];}_0x3a67b8=_['merge']({},_0x3a67b8,_0x2e5128['options']);return db['CmHopperHistory']['find'](_0x3a67b8)[_0xd6ca('0x1f')](handleEntityNotFound(_0x2c2b3d,null))['then'](respondWithResult(_0x2c2b3d,null))['catch'](handleError(_0x2c2b3d,null));};exports['create']=function(_0x448f0d,_0x2beb34){return db['CmHopperHistory']['create'](_0x448f0d[_0xd6ca('0x41')],{})[_0xd6ca('0x1f')](respondWithResult(_0x2beb34,0xc9))[_0xd6ca('0x42')](handleError(_0x2beb34,null));};exports[_0xd6ca('0x43')]=function(_0x3ac9f9,_0x1601ad){return db[_0xd6ca('0x26')][_0xd6ca('0x43')]()[_0xd6ca('0x1f')](respondWithResult(_0x1601ad,null))['catch'](handleError(_0x1601ad,null));};exports[_0xd6ca('0x44')]=function(_0x26505b,_0x22519b){if(_0x26505b[_0xd6ca('0x41')][_0xd6ca('0x45')]){delete _0x26505b[_0xd6ca('0x41')][_0xd6ca('0x45')];}return db['CmHopperHistory'][_0xd6ca('0x46')]({'where':{'uniqueid':_0x26505b[_0xd6ca('0x40')]['id']}})[_0xd6ca('0x1f')](handleEntityNotFound(_0x22519b,null))[_0xd6ca('0x1f')](saveUpdates(_0x26505b['body'],null))[_0xd6ca('0x1f')](respondWithResult(_0x22519b,null))['catch'](handleError(_0x22519b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 23ef171..ee01058 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 _0xba3e=['../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba3e,0x80));var _0xeba3=function(_0xa5d8e5,_0x2d87d0){_0xa5d8e5=_0xa5d8e5-0x0;var _0x5dd27b=_0xba3e[_0xa5d8e5];return _0x5dd27b;};'use strict';var _=require(_0xeba3('0x0'));var util=require(_0xeba3('0x1'));var logger=require(_0xeba3('0x2'))(_0xeba3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeba3('0x4'));var fs=require('fs');var path=require(_0xeba3('0x5'));var rimraf=require(_0xeba3('0x6'));var config=require(_0xeba3('0x7'));var attributes=require(_0xeba3('0x8'));module[_0xeba3('0x9')]=function(_0x54e399,_0x4b1f8e){return _0x54e399[_0xeba3('0xa')](_0xeba3('0xb'),attributes,{'tableName':_0xeba3('0xc'),'paranoid':![],'indexes':[{'name':_0xeba3('0xd'),'fields':[_0xeba3('0xd')]},{'name':_0xeba3('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x021e=['cm_hopper_history','uniqueid','lodash','util','api','bluebird','request-promise','../../config/environment','define','CmHopperHistory'];(function(_0x43bd92,_0x2ac38d){var _0xacb14d=function(_0x2d3c34){while(--_0x2d3c34){_0x43bd92['push'](_0x43bd92['shift']());}};_0xacb14d(++_0x2ac38d);}(_0x021e,0x1e2));var _0xe021=function(_0x226e48,_0x19bcf5){_0x226e48=_0x226e48-0x0;var _0x47fac3=_0x021e[_0x226e48];return _0x47fac3;};'use strict';var _=require(_0xe021('0x0'));var util=require(_0xe021('0x1'));var logger=require('../../config/logger')(_0xe021('0x2'));var moment=require('moment');var BPromise=require(_0xe021('0x3'));var rp=require(_0xe021('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe021('0x5'));var attributes=require('./cmHopperHistory.attributes');module['exports']=function(_0x36cb3e,_0x1629ed){return _0x36cb3e[_0xe021('0x6')](_0xe021('0x7'),attributes,{'tableName':_0xe021('0x8'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xe021('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 5512dfc..c61a265 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 _0x087b=['`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','CmHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','create','body','options','CreateCmHopperHistory','catch','AvgHandleTime','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','raw','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay'];(function(_0x390055,_0x1ccd7d){var _0x494aae=function(_0x5cb1fe){while(--_0x5cb1fe){_0x390055['push'](_0x390055['shift']());}};_0x494aae(++_0x1ccd7d);}(_0x087b,0x11a));var _0xb087=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x087b[_0x580647];return _0x5f0792;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xecf080,_0x36ac30,_0x3cebbf){return new BPromise(function(_0x6d83fb,_0x1dbe9f){return client[_0xb087('0xb')](_0xecf080,_0x3cebbf)[_0xb087('0xc')](function(_0x23cdd7){logger[_0xb087('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x36ac30,_0xb087('0xe'));logger[_0xb087('0xf')](_0xb087('0x10'),_0x36ac30,_0xb087('0xe'),JSON[_0xb087('0x11')](_0x23cdd7));if(_0x23cdd7[_0xb087('0x12')]){if(_0x23cdd7[_0xb087('0x12')]['code']===0x1f4){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')]['message']);return _0x1dbe9f(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);return _0x6d83fb(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}else{logger[_0xb087('0xd')](_0xb087('0x13'),_0x36ac30,'request\x20sent');_0x6d83fb(_0x23cdd7[_0xb087('0x15')][_0xb087('0x14')]);}})['catch'](function(_0xcc4426){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0xcc4426);_0x1dbe9f(_0xcc4426);});});}exports['CreateCmHopperHistory']=function(_0x330005){var _0x3c680f=this;return new Promise(function(_0x17200d,_0x45d074){return db['CmHopperHistory'][_0xb087('0x16')](_0x330005[_0xb087('0x17')],{'raw':_0x330005[_0xb087('0x18')]?_0x330005[_0xb087('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ea3dc){logger['info'](_0xb087('0x19'),_0x330005);logger[_0xb087('0xf')](_0xb087('0x19'),_0x330005,JSON[_0xb087('0x11')](_0x5ea3dc));_0x17200d(_0x5ea3dc);})[_0xb087('0x1a')](function(_0x258b4c){logger[_0xb087('0x12')]('CreateCmHopperHistory',_0x258b4c[_0xb087('0x14')],_0x330005);_0x45d074(_0x3c680f[_0xb087('0x12')](0x1f4,_0x258b4c[_0xb087('0x14')]));});});};exports[_0xb087('0x1b')]=function(_0x3ad74e){var _0x4d9028=this;return new Promise(function(_0x183eab,_0xdd4216){return db['CmHopperHistory']['findAll']({'raw':_0x3ad74e['options']?_0x3ad74e['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ad74e[_0xb087('0x18')]?_0x3ad74e[_0xb087('0x18')][_0xb087('0x1c')]||null:null,'attributes':[[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')][_0xb087('0x1f')]('id')),_0xb087('0x20')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x23')))),_0xb087('0x24')],[db[_0xb087('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0xb087('0x25')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x26'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x27')))),_0xb087('0x28')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x26'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')]['literal'](_0xb087('0x29')))),'predictiveIntervalAvgTalktime']]})[_0xb087('0xc')](function(_0x296e9b){logger[_0xb087('0xd')](_0xb087('0x1b'),_0x3ad74e);logger[_0xb087('0xf')](_0xb087('0x1b'),_0x3ad74e,JSON[_0xb087('0x11')](_0x296e9b));_0x183eab(_0x296e9b);})[_0xb087('0x1a')](function(_0x8a4c3c){logger['error']('AvgHandleTime',_0x8a4c3c[_0xb087('0x14')],_0x3ad74e);_0xdd4216(_0x4d9028[_0xb087('0x12')](0x1f4,_0x8a4c3c[_0xb087('0x14')]));});});};exports[_0xb087('0x2a')]=function(_0x1982a8){var _0x5ca9b6=this;return new Promise(function(_0x1f24f4,_0x1fdc19){return db['CmHopperHistory']['findAll']({'raw':_0x1982a8[_0xb087('0x18')]?_0x1982a8[_0xb087('0x18')][_0xb087('0x2b')]===undefined?!![]:![]:!![],'where':_0x1982a8['options']?_0x1982a8[_0xb087('0x18')][_0xb087('0x1c')]||null:null,'attributes':[[_0xb087('0x2c'),_0xb087('0x2d')],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0xb087('0x2e')],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0xb087('0x2f')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x22')))),'outboundAnswerCallsDay'],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')]['literal'](_0xb087('0x30')))),_0xb087('0x31')],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')](_0xb087('0x32')))),'outboundCongestionCallsDay'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db['sequelize']['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb087('0x33')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xb087('0x34')))),_0xb087('0x35')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0xb087('0x36')],[db['sequelize']['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0xb087('0x37')],[db['sequelize']['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db['sequelize']['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x39')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xb087('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xb087('0x21')](_0xb087('0x3a')))),_0xb087('0x3b')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x3c')))),_0xb087('0x3d')]],'group':[_0xb087('0x2c')]})[_0xb087('0xc')](function(_0x55e653){logger[_0xb087('0xd')](_0xb087('0x2a'),_0x1982a8);logger['debug'](_0xb087('0x2a'),_0x1982a8,JSON[_0xb087('0x11')](_0x55e653));_0x1f24f4(_0x55e653);})[_0xb087('0x1a')](function(_0x1c91e8){logger[_0xb087('0x12')](_0xb087('0x2a'),_0x1c91e8[_0xb087('0x14')],_0x1982a8);_0x1fdc19(_0x5ca9b6[_0xb087('0x12')](0x1f4,_0x1c91e8[_0xb087('0x14')]));});});};exports[_0xb087('0x3e')]=function(_0x17c6d0){var _0x4ad1b6=this;return new Promise(function(_0x269eda,_0x56410e){return db[_0xb087('0x3f')]['findAll']({'raw':_0x17c6d0[_0xb087('0x18')]?_0x17c6d0[_0xb087('0x18')][_0xb087('0x2b')]===undefined?!![]:![]:!![],'where':_0x17c6d0[_0xb087('0x18')]?_0x17c6d0[_0xb087('0x18')][_0xb087('0x1c')]||null:null,'attributes':[[_0xb087('0x2c'),_0xb087('0x2d')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')][_0xb087('0x1f')]('id')),_0xb087('0x40')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x22')))),_0xb087('0x41')]],'group':[_0xb087('0x2c')]})[_0xb087('0xc')](function(_0x551274){logger[_0xb087('0xd')](_0xb087('0x3e'),_0x17c6d0);logger[_0xb087('0xf')]('GetCampaignHopperHistory',_0x17c6d0,JSON[_0xb087('0x11')](_0x551274));_0x269eda(_0x551274);})[_0xb087('0x1a')](function(_0x5685b1){logger[_0xb087('0x12')](_0xb087('0x3e'),_0x5685b1[_0xb087('0x14')],_0x17c6d0);_0x56410e(_0x4ad1b6['error'](0x1f4,_0x5685b1[_0xb087('0x14')]));});});}; \ No newline at end of file +var _0x9ffd=['predictiveIntervalAvgTalktime','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','info','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','AvgHandleTime','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','COUNT','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null'];(function(_0x4f5171,_0x21bb5f){var _0x3bc2d1=function(_0x193abf){while(--_0x193abf){_0x4f5171['push'](_0x4f5171['shift']());}};_0x3bc2d1(++_0x21bb5f);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x376a67,_0x493071){_0x376a67=_0x376a67-0x0;var _0x22d3b7=_0x9ffd[_0x376a67];return _0x22d3b7;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('CmHopperHistory,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('CmHopperHistory,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});}exports[_0xd9ff('0x17')]=function(_0x3afd19){var _0x5f45c4=this;return new Promise(function(_0x2d4df1,_0x3ccf15){return db[_0xd9ff('0x18')][_0xd9ff('0x19')](_0x3afd19[_0xd9ff('0x1a')],{'raw':_0x3afd19[_0xd9ff('0x1b')]?_0x3afd19[_0xd9ff('0x1b')][_0xd9ff('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x4cf8ec){logger[_0xd9ff('0x15')](_0xd9ff('0x17'),_0x3afd19);logger['debug']('CreateCmHopperHistory',_0x3afd19,JSON['stringify'](_0x4cf8ec));_0x2d4df1(_0x4cf8ec);})['catch'](function(_0x1f4d9e){logger['error'](_0xd9ff('0x17'),_0x1f4d9e[_0xd9ff('0x13')],_0x3afd19);_0x3ccf15(_0x5f45c4[_0xd9ff('0x11')](0x1f4,_0x1f4d9e[_0xd9ff('0x13')]));});});};exports[_0xd9ff('0x1d')]=function(_0x42a828){var _0x4b058a=this;return new Promise(function(_0x4fada1,_0x1136e9){return db['CmHopperHistory'][_0xd9ff('0x1e')]({'raw':_0x42a828['options']?_0x42a828[_0xd9ff('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x42a828[_0xd9ff('0x1b')]?_0x42a828[_0xd9ff('0x1b')][_0xd9ff('0x1f')]||null:null,'attributes':[[db[_0xd9ff('0x20')]['fn']('COUNT',db[_0xd9ff('0x20')][_0xd9ff('0x21')]('id')),_0xd9ff('0x22')],[db[_0xd9ff('0x20')]['fn']('COUNT',db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')](_0xd9ff('0x24')))),_0xd9ff('0x25')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')]['literal'](_0xd9ff('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db['sequelize'][_0xd9ff('0x23')](_0xd9ff('0x28')))),_0xd9ff('0x29')],[db[_0xd9ff('0x20')]['fn']('AVG',db[_0xd9ff('0x20')]['fn']('IF',db['sequelize'][_0xd9ff('0x23')](_0xd9ff('0x2a')))),_0xd9ff('0x2b')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x2c'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')](_0xd9ff('0x2d')))),_0xd9ff('0x2e')]]})[_0xd9ff('0xc')](function(_0x34e9a9){logger[_0xd9ff('0x15')](_0xd9ff('0x1d'),_0x42a828);logger['debug'](_0xd9ff('0x1d'),_0x42a828,JSON[_0xd9ff('0x10')](_0x34e9a9));_0x4fada1(_0x34e9a9);})[_0xd9ff('0x16')](function(_0x4ab10f){logger[_0xd9ff('0x11')]('AvgHandleTime',_0x4ab10f[_0xd9ff('0x13')],_0x42a828);_0x1136e9(_0x4b058a['error'](0x1f4,_0x4ab10f[_0xd9ff('0x13')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x1a6c4d){var _0x99ea5b=this;return new Promise(function(_0x11566b,_0x5e2391){return db['CmHopperHistory']['findAll']({'raw':_0x1a6c4d[_0xd9ff('0x1b')]?_0x1a6c4d[_0xd9ff('0x1b')][_0xd9ff('0x1c')]===undefined?!![]:![]:!![],'where':_0x1a6c4d[_0xd9ff('0x1b')]?_0x1a6c4d[_0xd9ff('0x1b')][_0xd9ff('0x1f')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')]('`state`\x20=\x200,\x201,\x20null'))),_0xd9ff('0x2f')],[db['sequelize']['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')]('`state`\x20=\x203,\x201,\x20null'))),_0xd9ff('0x30')],[db[_0xd9ff('0x20')]['fn']('COUNT',db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')](_0xd9ff('0x24')))),_0xd9ff('0x31')],[db[_0xd9ff('0x20')]['fn']('COUNT',db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')](_0xd9ff('0x32')))),_0xd9ff('0x33')],[db['sequelize']['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xd9ff('0x34')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd9ff('0x35')],[db[_0xd9ff('0x20')]['fn']('COUNT',db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')](_0xd9ff('0x36')))),_0xd9ff('0x37')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd9ff('0x20')]['literal'](_0xd9ff('0x38')))),_0xd9ff('0x39')],[db[_0xd9ff('0x20')]['fn']('COUNT',db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')]['literal'](_0xd9ff('0x3a')))),_0xd9ff('0x3b')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db['sequelize']['fn']('IF',db[_0xd9ff('0x20')]['literal'](_0xd9ff('0x3c')))),'outboundOriginateFailureCallsDay'],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')]('`state`\x20=\x2018,\x201,\x20null'))),_0xd9ff('0x3d')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xd9ff('0x3e')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db['sequelize']['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')](_0xd9ff('0x3f')))),_0xd9ff('0x3d')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')][_0xd9ff('0x23')](_0xd9ff('0x40')))),_0xd9ff('0x41')]],'group':[_0xd9ff('0x42')]})[_0xd9ff('0xc')](function(_0x487b07){logger[_0xd9ff('0x15')]('GetVoiceQueueHopperHistory',_0x1a6c4d);logger[_0xd9ff('0xd')]('GetVoiceQueueHopperHistory',_0x1a6c4d,JSON[_0xd9ff('0x10')](_0x487b07));_0x11566b(_0x487b07);})['catch'](function(_0xc82610){logger['error'](_0xd9ff('0x43'),_0xc82610['message'],_0x1a6c4d);_0x5e2391(_0x99ea5b[_0xd9ff('0x11')](0x1f4,_0xc82610['message']));});});};exports[_0xd9ff('0x44')]=function(_0x5da1a8){var _0x3eb87b=this;return new Promise(function(_0x103c99,_0x122c9d){return db[_0xd9ff('0x18')]['findAll']({'raw':_0x5da1a8[_0xd9ff('0x1b')]?_0x5da1a8[_0xd9ff('0x1b')][_0xd9ff('0x1c')]===undefined?!![]:![]:!![],'where':_0x5da1a8['options']?_0x5da1a8[_0xd9ff('0x1b')][_0xd9ff('0x1f')]||null:null,'attributes':[[_0xd9ff('0x42'),_0xd9ff('0x45')],[db[_0xd9ff('0x20')]['fn']('COUNT',db[_0xd9ff('0x20')][_0xd9ff('0x21')]('id')),_0xd9ff('0x46')],[db[_0xd9ff('0x20')]['fn'](_0xd9ff('0x26'),db[_0xd9ff('0x20')]['fn']('IF',db[_0xd9ff('0x20')]['literal'](_0xd9ff('0x24')))),_0xd9ff('0x47')]],'group':['campaign']})[_0xd9ff('0xc')](function(_0x17c1b2){logger['info'](_0xd9ff('0x44'),_0x5da1a8);logger[_0xd9ff('0xd')](_0xd9ff('0x44'),_0x5da1a8,JSON['stringify'](_0x17c1b2));_0x103c99(_0x17c1b2);})['catch'](function(_0x39473e){logger['error'](_0xd9ff('0x44'),_0x39473e[_0xd9ff('0x13')],_0x5da1a8);_0x122c9d(_0x3eb87b[_0xd9ff('0x11')](0x1f4,_0x39473e[_0xd9ff('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 7ed5377..77195a4 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 _0x5d38=['update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./cmHopperHistory.controller','index','/describe','isAuthenticated','describe','get','show','post','create','put','/:id'];(function(_0x5bd3eb,_0x4c3ceb){var _0x369715=function(_0x40e5dd){while(--_0x40e5dd){_0x5bd3eb['push'](_0x5bd3eb['shift']());}};_0x369715(++_0x4c3ceb);}(_0x5d38,0xe6));var _0x85d3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5d38[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x85d3('0x0'));var util=require(_0x85d3('0x1'));var path=require(_0x85d3('0x2'));var timeout=require(_0x85d3('0x3'));var express=require(_0x85d3('0x4'));var router=express['Router']();var auth=require(_0x85d3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x85d3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x85d3('0x7')]);router['get'](_0x85d3('0x8'),auth[_0x85d3('0x9')](),controller[_0x85d3('0xa')]);router[_0x85d3('0xb')]('/:id',auth[_0x85d3('0x9')](),controller[_0x85d3('0xc')]);router[_0x85d3('0xd')]('/',auth['isAuthenticated'](),controller[_0x85d3('0xe')]);router[_0x85d3('0xf')](_0x85d3('0x10'),auth[_0x85d3('0x9')](),controller[_0x85d3('0x11')]);module[_0x85d3('0x12')]=router; \ No newline at end of file +var _0x47a9=['multer','util','connect-timeout','express','Router','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','show','post','put','update'];(function(_0x4edd60,_0x48e214){var _0x570167=function(_0x1a24b0){while(--_0x1a24b0){_0x4edd60['push'](_0x4edd60['shift']());}};_0x570167(++_0x48e214);}(_0x47a9,0x90));var _0x947a=function(_0xaa4820,_0x19af35){_0xaa4820=_0xaa4820-0x0;var _0x4da758=_0x47a9[_0xaa4820];return _0x4da758;};'use strict';var multer=require(_0x947a('0x0'));var util=require(_0x947a('0x1'));var path=require('path');var timeout=require(_0x947a('0x2'));var express=require(_0x947a('0x3'));var router=express[_0x947a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x947a('0x5'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0x947a('0x6')]('/',auth['isAuthenticated'](),controller[_0x947a('0x7')]);router['get'](_0x947a('0x8'),auth[_0x947a('0x9')](),controller[_0x947a('0xa')]);router[_0x947a('0x6')](_0x947a('0xb'),auth[_0x947a('0x9')](),controller[_0x947a('0xc')]);router[_0x947a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x947a('0xe')](_0x947a('0xb'),auth[_0x947a('0x9')](),controller[_0x947a('0xf')]);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 78ab6e4..feb25c2 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 _0x52a8=['exports','STRING','name'];(function(_0x5f26b4,_0x5706aa){var _0x47ab28=function(_0x3556c8){while(--_0x3556c8){_0x5f26b4['push'](_0x5f26b4['shift']());}};_0x47ab28(++_0x5706aa);}(_0x52a8,0x6f));var _0x852a=function(_0x38468a,_0x1d5e82){_0x38468a=_0x38468a-0x0;var _0x2ce76f=_0x52a8[_0x38468a];return _0x2ce76f;};'use strict';var Sequelize=require('sequelize');module[_0x852a('0x0')]={'name':{'type':Sequelize[_0x852a('0x1')],'unique':_0x852a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x852a('0x1')]},'dialPrefix':{'type':Sequelize[_0x852a('0x1')]}}; \ No newline at end of file +var _0x739b=['sequelize','name','STRING'];(function(_0x255db3,_0x184d82){var _0x464e40=function(_0x324f90){while(--_0x324f90){_0x255db3['push'](_0x255db3['shift']());}};_0x464e40(++_0x184d82);}(_0x739b,0xc3));var _0xb739=function(_0x5273bd,_0x40f520){_0x5273bd=_0x5273bd-0x0;var _0x428401=_0x739b[_0x5273bd];return _0x428401;};'use strict';var Sequelize=require(_0xb739('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb739('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb739('0x2')]},'dialPrefix':{'type':Sequelize[_0xb739('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 19e2927..2652e21 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 _0x4f0d=['util','path','sox','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','count','offset','limit','status','Content-Range','apply','reject','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','index','map','CmList','fieldName','type','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','CustomFields','concat','cf_%d','getContactsCsv','CmCustomField','format','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x51af09,_0x77d608){var _0x214dea=function(_0x5cae83){while(--_0x5cae83){_0x51af09['push'](_0x51af09['shift']());}};_0x214dea(++_0x77d608);}(_0x4f0d,0x8a));var _0xd4f0=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x4f0d[_0x1db251];return _0x56685a;};'use strict';var pdf=require(_0xd4f0('0x0'));var emlformat=require(_0xd4f0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd4f0('0x2'));var jsonpatch=require(_0xd4f0('0x3'));var rp=require('request-promise');var moment=require(_0xd4f0('0x4'));var BPromise=require(_0xd4f0('0x5'));var Mustache=require(_0xd4f0('0x6'));var util=require(_0xd4f0('0x7'));var path=require(_0xd4f0('0x8'));var sox=require(_0xd4f0('0x9'));var csv=require('to-csv');var ejs=require(_0xd4f0('0xa'));var fs=require('fs');var _=require(_0xd4f0('0xb'));var squel=require('squel');var crypto=require(_0xd4f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd4f0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd4f0('0xe'));var Redis=require(_0xd4f0('0xf'));var authService=require(_0xd4f0('0x10'));var qs=require(_0xd4f0('0x11'));var as=require(_0xd4f0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4f0('0x13'));var config=require(_0xd4f0('0x14'));var db=require(_0xd4f0('0x15'))['db'];config[_0xd4f0('0x16')]=_[_0xd4f0('0x17')](config[_0xd4f0('0x16')],{'host':_0xd4f0('0x18'),'port':0x18eb});var socket=require(_0xd4f0('0x19'))(new Redis(config[_0xd4f0('0x16')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x9a8a10,_0x4625d5){_0x4625d5=_0x4625d5||0xcc;return function(_0x4e809b){if(_0x4e809b){return _0x9a8a10['sendStatus'](_0x4625d5);}return _0x9a8a10['status'](_0x4625d5)['end']();};}function respondWithResult(_0x5ca149,_0x4e1f5d){_0x4e1f5d=_0x4e1f5d||0xc8;return function(_0x39e10b){if(_0x39e10b){return _0x5ca149['status'](_0x4e1f5d)['json'](_0x39e10b);}};}function respondWithFilteredResult(_0x106fd8,_0x423c6f){return function(_0x4967fd){if(_0x4967fd){var _0xa37dd=_0x4967fd[_0xd4f0('0x1a')],_0x3d6c4b=_0x423c6f['offset'],_0x299b89=_0x423c6f[_0xd4f0('0x1b')]+_0x423c6f[_0xd4f0('0x1c')],_0x3ac5e6;if(_0x299b89>=_0xa37dd){_0x299b89=_0xa37dd;_0x3ac5e6=0xc8;}else{_0x3ac5e6=0xce;}_0x106fd8[_0xd4f0('0x1d')](_0x3ac5e6);return _0x106fd8['set'](_0xd4f0('0x1e'),_0x3d6c4b+'-'+_0x299b89+'/'+_0xa37dd)['json'](_0x4967fd);}return null;};}function patchUpdates(_0x3ef29b){return function(_0x4368c8){try{jsonpatch[_0xd4f0('0x1f')](_0x4368c8,_0x3ef29b,!![]);}catch(_0x40af48){return BPromise[_0xd4f0('0x20')](_0x40af48);}return _0x4368c8['save']();};}function saveUpdates(_0x2d77ac,_0x26f3a6){return function(_0x304646){if(_0x304646){return _0x304646['update'](_0x2d77ac)[_0xd4f0('0x21')](function(_0x537d8e){return _0x537d8e;});}return null;};}function removeEntity(_0x4d89cd,_0x3ac9c6){return function(_0x8853c1){if(_0x8853c1){return _0x8853c1[_0xd4f0('0x22')]()[_0xd4f0('0x21')](function(){var _0x5f1ce5=_0x8853c1[_0xd4f0('0x23')]({'plain':!![]});var _0x34cc39=_0xd4f0('0x24');return db[_0xd4f0('0x25')][_0xd4f0('0x22')]({'where':{'type':_0x34cc39,'resourceId':_0x5f1ce5['id']}})[_0xd4f0('0x21')](function(){return _0x8853c1;});})[_0xd4f0('0x21')](function(){_0x4d89cd['status'](0xcc)[_0xd4f0('0x26')]();});}};}function handleEntityNotFound(_0x136710,_0x4577b5){return function(_0x21aa73){if(!_0x21aa73){_0x136710['sendStatus'](0x194);}return _0x21aa73;};}function handleError(_0x451e4f,_0x442b5d){_0x442b5d=_0x442b5d||0x1f4;return function(_0x1a9c5f){logger[_0xd4f0('0x27')](_0x1a9c5f[_0xd4f0('0x28')]);if(_0x1a9c5f[_0xd4f0('0x29')]){delete _0x1a9c5f['name'];}_0x451e4f[_0xd4f0('0x1d')](_0x442b5d)['send'](_0x1a9c5f);};}exports[_0xd4f0('0x2a')]=function(_0x2776bf,_0x1171a6){var _0x1ff180={},_0x5804eb={},_0x21c8dc={'count':0x0,'rows':[]};var _0x393ab7=_[_0xd4f0('0x2b')](db[_0xd4f0('0x2c')]['rawAttributes'],function(_0x36d8fa){return{'name':_0x36d8fa[_0xd4f0('0x2d')],'type':_0x36d8fa[_0xd4f0('0x2e')]['key']};});_0x5804eb[_0xd4f0('0x2f')]=_['map'](_0x393ab7,_0xd4f0('0x29'));_0x5804eb['query']=_[_0xd4f0('0x30')](_0x2776bf['query']);_0x5804eb['filters']=_[_0xd4f0('0x31')](_0x5804eb['model'],_0x5804eb[_0xd4f0('0x32')]);_0x1ff180['attributes']=_[_0xd4f0('0x31')](_0x5804eb[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x1ff180[_0xd4f0('0x34')]=_0x1ff180[_0xd4f0('0x34')]['length']?_0x1ff180[_0xd4f0('0x34')]:_0x5804eb['model'];if(!_0x2776bf['query'][_0xd4f0('0x35')](_0xd4f0('0x36'))){_0x1ff180[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x2776bf[_0xd4f0('0x32')]['limit']);_0x1ff180[_0xd4f0('0x1b')]=qs[_0xd4f0('0x1b')](_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x1b')]);}_0x1ff180[_0xd4f0('0x37')]=qs['sort'](_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x1ff180[_0xd4f0('0x39')]=qs['filters'](_[_0xd4f0('0x3a')](_0x2776bf['query'],_0x5804eb[_0xd4f0('0x3b')]));if(_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x1ff180['where']=_[_0xd4f0('0x3d')](_0x1ff180['where'],{'$or':_[_0xd4f0('0x2b')](_0x393ab7,function(_0x39ffcd){if(_0x39ffcd[_0xd4f0('0x2e')]!==_0xd4f0('0x3e')){var _0x2030a8={};_0x2030a8[_0x39ffcd[_0xd4f0('0x29')]]={'$like':'%'+_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0x2030a8;}})});}_0x1ff180=_[_0xd4f0('0x3d')]({},_0x1ff180,_0x2776bf[_0xd4f0('0x3f')]);var _0x35d54c={'where':_0x1ff180[_0xd4f0('0x39')]};return db[_0xd4f0('0x2c')][_0xd4f0('0x1a')](_0x35d54c)[_0xd4f0('0x21')](function(_0x5aa60f){_0x21c8dc[_0xd4f0('0x1a')]=_0x5aa60f;if(_0x2776bf['query'][_0xd4f0('0x40')]){_0x1ff180[_0xd4f0('0x41')]=[{'all':!![]}];}return db[_0xd4f0('0x2c')]['findAll'](_0x1ff180);})['then'](function(_0x37810a){_0x21c8dc[_0xd4f0('0x42')]=_0x37810a;return _0x21c8dc;})[_0xd4f0('0x21')](respondWithFilteredResult(_0x1171a6,_0x1ff180))[_0xd4f0('0x43')](handleError(_0x1171a6,null));};exports[_0xd4f0('0x44')]=function(_0x3f78f3,_0x1c5573){var _0x573190={'raw':![],'where':{'id':_0x3f78f3[_0xd4f0('0x45')]['id']}},_0x16d2d7={};_0x16d2d7[_0xd4f0('0x2f')]=_[_0xd4f0('0x30')](db[_0xd4f0('0x2c')][_0xd4f0('0x46')]);_0x16d2d7[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x3f78f3[_0xd4f0('0x32')]);_0x16d2d7[_0xd4f0('0x3b')]=_['intersection'](_0x16d2d7['model'],_0x16d2d7[_0xd4f0('0x32')]);_0x573190[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x16d2d7['model'],qs[_0xd4f0('0x33')](_0x3f78f3[_0xd4f0('0x32')]['fields']));_0x573190['attributes']=_0x573190['attributes'][_0xd4f0('0x47')]?_0x573190[_0xd4f0('0x34')]:_0x16d2d7[_0xd4f0('0x2f')];if(_0x3f78f3['query']['includeAll']){_0x573190['include']=[{'all':!![]}];}_0x573190=_[_0xd4f0('0x3d')]({},_0x573190,_0x3f78f3['options']);return db[_0xd4f0('0x2c')]['find'](_0x573190)[_0xd4f0('0x21')](handleEntityNotFound(_0x1c5573,null))['then'](respondWithResult(_0x1c5573,null))[_0xd4f0('0x43')](handleError(_0x1c5573,null));};exports[_0xd4f0('0x48')]=function(_0x3d0a45,_0x2979e9){return db[_0xd4f0('0x2c')]['create'](_0x3d0a45[_0xd4f0('0x49')],{})[_0xd4f0('0x21')](function(_0x75cbb4){var _0x43981f=_0x3d0a45[_0xd4f0('0x4a')][_0xd4f0('0x23')]({'plain':!![]});if(!_0x43981f)throw new Error(_0xd4f0('0x4b'));if(_0x43981f['role']===_0xd4f0('0x4a')){var _0x19f400=_0x75cbb4[_0xd4f0('0x23')]({'plain':!![]});var _0x5ed0f7=_0xd4f0('0x24');return db[_0xd4f0('0x4c')][_0xd4f0('0x4d')]({'where':{'name':_0x5ed0f7,'userProfileId':_0x43981f[_0xd4f0('0x4e')]},'raw':!![]})[_0xd4f0('0x21')](function(_0x240ec9){if(_0x240ec9&&_0x240ec9[_0xd4f0('0x4f')]===0x0){return db[_0xd4f0('0x25')]['create']({'name':_0x19f400[_0xd4f0('0x29')],'resourceId':_0x19f400['id'],'type':_0x240ec9[_0xd4f0('0x29')],'sectionId':_0x240ec9['id']},{})[_0xd4f0('0x21')](function(){return _0x75cbb4;});}else{return _0x75cbb4;}})[_0xd4f0('0x43')](function(_0x285e0e){logger[_0xd4f0('0x27')](_0xd4f0('0x50'),_0x285e0e);throw _0x285e0e;});}return _0x75cbb4;})[_0xd4f0('0x21')](respondWithResult(_0x2979e9,0xc9))[_0xd4f0('0x43')](handleError(_0x2979e9,null));};exports[_0xd4f0('0x51')]=function(_0x22a27f,_0x288200){if(_0x22a27f[_0xd4f0('0x49')]['id']){delete _0x22a27f[_0xd4f0('0x49')]['id'];}return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x22a27f[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x288200,null))[_0xd4f0('0x21')](saveUpdates(_0x22a27f[_0xd4f0('0x49')],null))['then'](respondWithResult(_0x288200,null))[_0xd4f0('0x43')](handleError(_0x288200,null));};exports[_0xd4f0('0x22')]=function(_0x282083,_0x3c333a){return db['CmList'][_0xd4f0('0x4d')]({'where':{'id':_0x282083[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x3c333a,null))[_0xd4f0('0x21')](removeEntity(_0x3c333a,null))[_0xd4f0('0x43')](handleError(_0x3c333a,null));};exports[_0xd4f0('0x52')]=function(_0x28e028,_0x4286b8){return db[_0xd4f0('0x2c')][_0xd4f0('0x52')]()[_0xd4f0('0x21')](respondWithResult(_0x4286b8,null))[_0xd4f0('0x43')](handleError(_0x4286b8,null));};exports[_0xd4f0('0x53')]=function(_0x400b93,_0x41ad20,_0x29ff18){if(_0x400b93[_0xd4f0('0x49')]['id']){delete _0x400b93[_0xd4f0('0x49')]['id'];}return db[_0xd4f0('0x2c')]['find']({'where':{'id':_0x400b93['params']['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x41ad20,null))[_0xd4f0('0x21')](function(_0x42de07){if(_0x42de07){_0x400b93[_0xd4f0('0x49')][_0xd4f0('0x54')]=_0x42de07['id'];return db[_0xd4f0('0x55')][_0xd4f0('0x48')](_0x400b93[_0xd4f0('0x49')]);}})[_0xd4f0('0x21')](respondWithResult(_0x41ad20,null))[_0xd4f0('0x43')](handleError(_0x41ad20,null));};exports[_0xd4f0('0x56')]=function(_0x5920a2,_0x27e265,_0x377646){var _0xb68b50={'raw':![],'where':{}};var _0x346126={};var _0x30c54b={'count':0x0,'rows':[]};return db[_0xd4f0('0x2c')][_0xd4f0('0x57')]({'where':{'id':_0x5920a2[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x27e265,null))[_0xd4f0('0x21')](function(_0x247e50){if(_0x247e50){_0x346126[_0xd4f0('0x2f')]=_['keys'](db[_0xd4f0('0x55')][_0xd4f0('0x46')]);_0x346126[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x5920a2[_0xd4f0('0x32')]);_0x346126[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x346126[_0xd4f0('0x2f')],_0x346126['query']);_0xb68b50[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x346126[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0xb68b50[_0xd4f0('0x34')]=_0xb68b50[_0xd4f0('0x34')]['length']?_0xb68b50[_0xd4f0('0x34')]:_0x346126[_0xd4f0('0x2f')];if(!_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x35')]('nolimit')){_0xb68b50[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x1c')]);_0xb68b50[_0xd4f0('0x1b')]=qs['offset'](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x1b')]);}_0xb68b50[_0xd4f0('0x37')]=qs[_0xd4f0('0x38')](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0xb68b50[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_['pick'](_0x5920a2[_0xd4f0('0x32')],_0x346126[_0xd4f0('0x3b')]));_0xb68b50[_0xd4f0('0x39')][_0xd4f0('0x54')]=_0x247e50['id'];if(_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0xb68b50[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0xb68b50[_0xd4f0('0x39')],{'$or':_['map'](_0xb68b50[_0xd4f0('0x34')],function(_0x2eede6){var _0x1612fd={};_0x1612fd[_0x2eede6]={'$like':'%'+_0x5920a2[_0xd4f0('0x32')]['filter']+'%'};return _0x1612fd;})});}_0xb68b50=_[_0xd4f0('0x3d')]({},_0xb68b50,_0x5920a2[_0xd4f0('0x3f')]);return db['Disposition'][_0xd4f0('0x1a')]({'where':_0xb68b50[_0xd4f0('0x39')]})['then'](function(_0x3fb08f){_0x30c54b[_0xd4f0('0x1a')]=_0x3fb08f;if(_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x40')]){_0xb68b50[_0xd4f0('0x41')]=[{'all':!![]}];}return db[_0xd4f0('0x55')][_0xd4f0('0x58')](_0xb68b50);})[_0xd4f0('0x21')](function(_0x4463e9){_0x30c54b[_0xd4f0('0x42')]=_0x4463e9;return _0x30c54b;});}})[_0xd4f0('0x21')](respondWithFilteredResult(_0x27e265,_0xb68b50))[_0xd4f0('0x43')](handleError(_0x27e265,null));};exports[_0xd4f0('0x59')]=function(_0x22a7cf,_0x31a6fa,_0x5a6b68){return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x22a7cf[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x31a6fa,null))[_0xd4f0('0x21')](function(_0x1b3e71){if(_0x1b3e71){return _0x1b3e71['removeDispositions'](_0x22a7cf[_0xd4f0('0x32')][_0xd4f0('0x5a')]);}})[_0xd4f0('0x21')](respondWithStatusCode(_0x31a6fa,null))[_0xd4f0('0x43')](handleError(_0x31a6fa,null));};exports[_0xd4f0('0x5b')]=function(_0x4aa607,_0x46ddd3,_0x5db024){return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x4aa607[_0xd4f0('0x45')]['id']}})['then'](handleEntityNotFound(_0x46ddd3,null))[_0xd4f0('0x21')](function(_0x1e86f6){if(_0x1e86f6){var _0x1d4ae4=[];var _0x4bcdae={'success':[],'errors':[]};return db[_0xd4f0('0x5c')][_0xd4f0('0x52')]()[_0xd4f0('0x21')](function(_0x53c174){if(_0x4aa607['body'][_0xd4f0('0x5d')]&&_[_0xd4f0('0x5e')](_0x4aa607[_0xd4f0('0x49')]['tags'])){if(_0x4aa607[_0xd4f0('0x49')][_0xd4f0('0x5d')][_0xd4f0('0x47')]){_0x4aa607[_0xd4f0('0x49')][_0xd4f0('0x5d')]=_0x4aa607[_0xd4f0('0x49')]['tags'][_0xd4f0('0x5f')](';')+';';}else{_0x4aa607[_0xd4f0('0x49')]['tags']=null;}}else{_0x4aa607[_0xd4f0('0x49')]['tags']=null;}if(_0x4aa607[_0xd4f0('0x49')]&&_[_0xd4f0('0x5e')](_0x4aa607[_0xd4f0('0x49')])){for(var _0x577d07=0x0;_0x577d07<_0x4aa607[_0xd4f0('0x49')][_0xd4f0('0x47')];_0x577d07+=0x1){_0x4aa607[_0xd4f0('0x49')][_0x577d07]['ListId']=_0x4aa607[_0xd4f0('0x45')]['id'];_0x1d4ae4[_0xd4f0('0x60')](_0x4aa607[_0xd4f0('0x49')][_0x577d07]);}return BPromise[_0xd4f0('0x61')](_0x1d4ae4,function(_0x40b23e){return db[_0xd4f0('0x5c')][_0xd4f0('0x48')](_[_0xd4f0('0x62')](_0x40b23e,[_0xd4f0('0x5a'),'id'])||{},{'fields':_[_0xd4f0('0x30')](_0x53c174),'raw':!![]})[_0xd4f0('0x21')](function(_0x2e8619){_0x4bcdae[_0xd4f0('0x63')]['push'](_0x2e8619[_0xd4f0('0x64')]);})[_0xd4f0('0x43')](function(_0x4e271d){_0x4bcdae[_0xd4f0('0x65')][_0xd4f0('0x60')]({'data':_0x40b23e,'error':_0x4e271d['message']});});})['then'](function(_0x27355){return _0x4bcdae;})[_0xd4f0('0x43')](function(_0x3f55a1){return _0x3f55a1;});}else{_0x46ddd3[_0xd4f0('0x1d')](0x190)['json']({'message':_0xd4f0('0x66')});}});}})[_0xd4f0('0x21')](respondWithResult(_0x46ddd3,null))[_0xd4f0('0x43')](handleError(_0x46ddd3,null));};exports['getContacts']=function(_0x4ecc40,_0x5c7d89,_0x45a1e2){var _0xdda321;return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x4ecc40[_0xd4f0('0x45')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xd4f0('0x67')}]})['then'](handleEntityNotFound(_0x5c7d89,null))[_0xd4f0('0x21')](function(_0x2f0d07){if(_0x2f0d07){_0xdda321=_0x2f0d07;return db[_0xd4f0('0x5c')][_0xd4f0('0x46')];}})['then'](function(_0x465a3c){if(_0x465a3c){var _0x5b40b7={};var _0x236d3a={};_0x236d3a[_0xd4f0('0x2f')]=_[_0xd4f0('0x68')](_['keys'](_0x465a3c),_[_0xd4f0('0x2b')](_0xdda321[_0xd4f0('0x67')],function(_0xa21437){return util['format'](_0xd4f0('0x69'),_0xa21437['id']);}));_0x236d3a[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x4ecc40[_0xd4f0('0x32')]);_0x236d3a[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x236d3a['model'],_0x236d3a['query']);_0x5b40b7['attributes']=_[_0xd4f0('0x31')](_0x236d3a[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x5b40b7['attributes']=_0x5b40b7['attributes']['length']?_0x5b40b7[_0xd4f0('0x34')]:_0x236d3a[_0xd4f0('0x2f')];if(!_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x35')](_0xd4f0('0x36'))){_0x5b40b7[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x4ecc40['query'][_0xd4f0('0x1c')]);_0x5b40b7['offset']=qs['offset'](_0x4ecc40['query'][_0xd4f0('0x1b')]);}_0x5b40b7['order']=qs['sort'](_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x5b40b7[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_[_0xd4f0('0x3a')](_0x4ecc40[_0xd4f0('0x32')],_0x236d3a[_0xd4f0('0x3b')]));_0x5b40b7['raw']=!![];if(_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x5b40b7[_0xd4f0('0x39')]=_['merge'](_0x5b40b7[_0xd4f0('0x39')],{'$or':_[_0xd4f0('0x2b')](_0x5b40b7[_0xd4f0('0x34')],function(_0x260d9e){var _0x31553d={};_0x31553d[_0x260d9e]={'$like':'%'+_0x4ecc40['query'][_0xd4f0('0x3c')]+'%'};return _0x31553d;})});}_0x5b40b7=_['merge']({},_0x5b40b7,_0x4ecc40['options']);return _0xdda321['getContacts'](_0x5b40b7);}})[_0xd4f0('0x21')](respondWithResult(_0x5c7d89,null))[_0xd4f0('0x43')](handleError(_0x5c7d89,null));};exports[_0xd4f0('0x6a')]=function(_0x298904,_0x26615a,_0xa4b52){var _0x2a4036;return db['CmList'][_0xd4f0('0x4d')]({'where':{'id':_0x298904[_0xd4f0('0x45')]['id']},'include':[{'model':db[_0xd4f0('0x6b')],'as':_0xd4f0('0x67')}]})[_0xd4f0('0x21')](handleEntityNotFound(_0x26615a,null))[_0xd4f0('0x21')](function(_0x16b452){if(_0x16b452){_0x2a4036=_0x16b452;return db['CmContact'][_0xd4f0('0x46')];}})[_0xd4f0('0x21')](function(_0x37eaa6){if(_0x37eaa6){var _0x3f86bc={};var _0x28dc29={};_0x28dc29[_0xd4f0('0x2f')]=_[_0xd4f0('0x68')](_[_0xd4f0('0x30')](_0x37eaa6),_[_0xd4f0('0x2b')](_0x2a4036[_0xd4f0('0x67')],function(_0x148f50){return util[_0xd4f0('0x6c')](_0xd4f0('0x69'),_0x148f50['id']);}));_0x28dc29[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x298904[_0xd4f0('0x32')]);_0x28dc29[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x28dc29[_0xd4f0('0x2f')],_0x28dc29[_0xd4f0('0x32')]);_0x3f86bc[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x28dc29[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x298904[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x3f86bc[_0xd4f0('0x34')]=_0x3f86bc[_0xd4f0('0x34')][_0xd4f0('0x47')]?_0x3f86bc[_0xd4f0('0x34')]:_0x28dc29['model'];if(!_0x298904[_0xd4f0('0x32')][_0xd4f0('0x35')](_0xd4f0('0x36'))){_0x3f86bc[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x298904[_0xd4f0('0x32')][_0xd4f0('0x1c')]);_0x3f86bc[_0xd4f0('0x1b')]=qs[_0xd4f0('0x1b')](_0x298904['query']['offset']);}_0x3f86bc[_0xd4f0('0x37')]=qs[_0xd4f0('0x38')](_0x298904[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x3f86bc[_0xd4f0('0x39')]=qs['filters'](_[_0xd4f0('0x3a')](_0x298904[_0xd4f0('0x32')],_0x28dc29[_0xd4f0('0x3b')]));_0x3f86bc[_0xd4f0('0x6d')]=!![];if(_0x298904[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x3f86bc[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0x3f86bc['where'],{'$or':_[_0xd4f0('0x2b')](_0x3f86bc[_0xd4f0('0x34')],function(_0x1f4532){var _0x509a26={};_0x509a26[_0x1f4532]={'$like':'%'+_0x298904[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0x509a26;})});}_0x3f86bc=_[_0xd4f0('0x3d')]({},_0x3f86bc,_0x298904['options']);return _0x2a4036['getContacts'](_0x3f86bc);}})[_0xd4f0('0x21')](function(_0x476388){if(!_[_0xd4f0('0x6e')](_0x476388)){var _0x49c890=toCsv(_0x476388);var _0x92dc23=Date[_0xd4f0('0x6f')]();fs[_0xd4f0('0x70')](util[_0xd4f0('0x6c')](_0xd4f0('0x71'),_0x2a4036['id'],_0x92dc23),_0x49c890);_0x26615a[_0xd4f0('0x72')](_0xd4f0('0x73'),'attachment;\x20filename='+util['format'](_0xd4f0('0x74'),_0x2a4036['id'],_0x92dc23));_0x26615a['setHeader'](_0xd4f0('0x75'),_0xd4f0('0x76'));return _0x26615a[_0xd4f0('0x77')](util[_0xd4f0('0x6c')](_0xd4f0('0x71'),_0x2a4036['id'],_0x92dc23));}else{return _0x26615a[_0xd4f0('0x78')](0xcc);}})[_0xd4f0('0x43')](handleError(_0x26615a,null));};exports[_0xd4f0('0x79')]=function(_0x1b9b6a,_0xad7c61,_0x22aee0){var _0x10f4bc;delete _0x1b9b6a[_0xd4f0('0x49')]['id'];return db[_0xd4f0('0x2c')][_0xd4f0('0x57')]({'where':{'id':_0x1b9b6a['params']['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0xad7c61,null))[_0xd4f0('0x21')](function(_0x1f66ab){if(_0x1f66ab){return db['sequelize']['transaction'](function(_0xc95570){return db[_0xd4f0('0x6b')]['create'](_0x1b9b6a[_0xd4f0('0x49')],{'transaction':_0xc95570})[_0xd4f0('0x21')](function(_0x1a234e){_0x10f4bc=_0x1a234e;return _0x1f66ab[_0xd4f0('0x7a')](_0x1a234e,{'transaction':_0xc95570});})[_0xd4f0('0x21')](function(){var _0x524535={'type':db[_0xd4f0('0x7b')][_0xd4f0('0x7c')],'transaction':_0xc95570};switch(_0x1b9b6a[_0xd4f0('0x49')]['type']){case _0xd4f0('0x7d'):_0x524535[_0xd4f0('0x2e')]=db[_0xd4f0('0x7b')][_0xd4f0('0x7c')];break;case _0xd4f0('0x7e'):_0x524535[_0xd4f0('0x2e')]=db['Sequelize'][_0xd4f0('0x7f')];break;case _0xd4f0('0x80'):_0x524535[_0xd4f0('0x2e')]=db[_0xd4f0('0x7b')][_0xd4f0('0x81')];_0x524535[_0xd4f0('0x82')]=![];break;default:}return db[_0xd4f0('0x83')]['queryInterface'][_0xd4f0('0x84')](_0xd4f0('0x85'),util[_0xd4f0('0x6c')](_0xd4f0('0x86'),_0x10f4bc['id']),_0x524535);})['then'](function(){return _0x10f4bc;});});}})[_0xd4f0('0x21')](respondWithResult(_0xad7c61,null))[_0xd4f0('0x43')](handleError(_0xad7c61,null));};exports[_0xd4f0('0x87')]=function(_0x4ebb87,_0x2764a9,_0x429eae){var _0x5d905b={};var _0x50959f={};var _0x1dcb4e;var _0x440d04;return db['CmList'][_0xd4f0('0x57')]({'where':{'id':_0x4ebb87[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x2764a9,null))[_0xd4f0('0x21')](function(_0x3c20dc){if(_0x3c20dc){_0x1dcb4e=_0x3c20dc;_0x50959f[_0xd4f0('0x2f')]=_[_0xd4f0('0x30')](db[_0xd4f0('0x6b')][_0xd4f0('0x46')]);_0x50959f[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x4ebb87[_0xd4f0('0x32')]);_0x50959f['filters']=_[_0xd4f0('0x31')](_0x50959f[_0xd4f0('0x2f')],_0x50959f['query']);_0x5d905b['attributes']=_['intersection'](_0x50959f[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x4ebb87[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x5d905b['attributes']=_0x5d905b['attributes'][_0xd4f0('0x47')]?_0x5d905b['attributes']:_0x50959f['model'];_0x5d905b['order']=qs[_0xd4f0('0x38')](_0x4ebb87[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x5d905b[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_[_0xd4f0('0x3a')](_0x4ebb87['query'],_0x50959f[_0xd4f0('0x3b')]));_0x5d905b[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0x5d905b[_0xd4f0('0x39')],{'$or':[{'ListId':_0x3c20dc['id']},{'ListId':null}]});if(_0x4ebb87['query'][_0xd4f0('0x3c')]){_0x5d905b['where']=_['merge'](_0x5d905b[_0xd4f0('0x39')],{'$or':_[_0xd4f0('0x2b')](_0x5d905b[_0xd4f0('0x34')],function(_0x3b7e0b){var _0xb9da41={};_0xb9da41[_0x3b7e0b]={'$like':'%'+_0x4ebb87[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0xb9da41;})});}_0x5d905b=_[_0xd4f0('0x3d')]({},_0x5d905b,_0x4ebb87['options']);return db['CmCustomField'][_0xd4f0('0x88')](_0x5d905b);}})[_0xd4f0('0x21')](respondWithResult(_0x2764a9,null))['catch'](handleError(_0x2764a9,null));};exports['addAgents']=function(_0x20b6b7,_0xa5ace3,_0x3bd520){return db['CmList']['find']({'where':{'id':_0x20b6b7[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0xa5ace3,null))[_0xd4f0('0x21')](function(_0x2318db){if(_0x2318db){return _0x2318db[_0xd4f0('0x89')](_0x20b6b7[_0xd4f0('0x49')][_0xd4f0('0x5a')],_['omit'](_0x20b6b7[_0xd4f0('0x49')],['ids','id'])||{})[_0xd4f0('0x8a')](function(_0x170954){for(var _0x35328a=0x0;_0x35328a<_0x20b6b7[_0xd4f0('0x49')][_0xd4f0('0x5a')]['length'];_0x35328a+=0x1){socket[_0xd4f0('0x8b')](_0xd4f0('0x8c'),{'UserId':_0x20b6b7[_0xd4f0('0x49')]['ids'][_0x35328a],'CmListId':_0x20b6b7[_0xd4f0('0x45')]['id']});}return _0x170954;});}})[_0xd4f0('0x21')](respondWithResult(_0xa5ace3,null))[_0xd4f0('0x43')](handleError(_0xa5ace3,null));};exports[_0xd4f0('0x8d')]=function(_0x26c7ad,_0x36fc86,_0x1e8561){return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x26c7ad[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x36fc86,null))['then'](function(_0x4cf01d){if(_0x4cf01d){return _0x4cf01d[_0xd4f0('0x8d')](_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')])[_0xd4f0('0x21')](function(){if(_[_0xd4f0('0x5e')](_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')])){for(var _0x2df3f4=0x0;_0x2df3f4<_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')]['length'];_0x2df3f4+=0x1){socket[_0xd4f0('0x8b')](_0xd4f0('0x8e'),{'UserId':Number(_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')][_0x2df3f4]),'CmListId':Number(_0x26c7ad[_0xd4f0('0x45')]['id'])});}}else{socket[_0xd4f0('0x8b')](_0xd4f0('0x8e'),{'UserId':Number(_0x26c7ad['query'][_0xd4f0('0x5a')]),'CmListId':Number(_0x26c7ad[_0xd4f0('0x45')]['id'])});}});}})[_0xd4f0('0x21')](respondWithStatusCode(_0x36fc86,null))[_0xd4f0('0x43')](handleError(_0x36fc86,null));};exports[_0xd4f0('0x8f')]=function(_0x766c45,_0x5224bd,_0x55d2bd){var _0x5b3bd5={};var _0x5b9539={};var _0x347dfc;var _0x569d7a;return db['CmList'][_0xd4f0('0x57')]({'where':{'id':_0x766c45[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x5224bd,null))[_0xd4f0('0x21')](function(_0x56c7e1){if(_0x56c7e1){_0x347dfc=_0x56c7e1;_0x5b9539[_0xd4f0('0x2f')]=_[_0xd4f0('0x30')](db[_0xd4f0('0x90')][_0xd4f0('0x46')]);_0x5b9539[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x766c45['query']);_0x5b9539[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x5b9539[_0xd4f0('0x2f')],_0x5b9539[_0xd4f0('0x32')]);_0x5b3bd5[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x5b9539['model'],qs[_0xd4f0('0x33')](_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x5b3bd5[_0xd4f0('0x34')]=_0x5b3bd5[_0xd4f0('0x34')][_0xd4f0('0x47')]?_0x5b3bd5[_0xd4f0('0x34')]:_0x5b9539['model'];_0x5b3bd5['order']=qs['sort'](_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x5b3bd5[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_['pick'](_0x766c45[_0xd4f0('0x32')],_0x5b9539[_0xd4f0('0x3b')]));if(_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x5b3bd5[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0x5b3bd5['where'],{'$or':_[_0xd4f0('0x2b')](_0x5b3bd5['attributes'],function(_0x395604){var _0x84063f={};_0x84063f[_0x395604]={'$like':'%'+_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0x84063f;})});}_0x5b3bd5=_[_0xd4f0('0x3d')]({},_0x5b3bd5,_0x766c45['options']);return _0x347dfc['getAgents'](_0x5b3bd5);}})[_0xd4f0('0x21')](function(_0x4c7a25){if(_0x4c7a25){_0x569d7a=_0x4c7a25[_0xd4f0('0x47')];if(!_0x766c45[_0xd4f0('0x32')]['hasOwnProperty'](_0xd4f0('0x36'))){_0x5b3bd5['limit']=qs[_0xd4f0('0x1c')](_0x766c45['query'][_0xd4f0('0x1c')]);_0x5b3bd5[_0xd4f0('0x1b')]=qs['offset'](_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x1b')]);}return _0x347dfc['getAgents'](_0x5b3bd5);}})[_0xd4f0('0x21')](function(_0x5dccdf){if(_0x5dccdf){return _0x5dccdf?{'count':_0x569d7a,'rows':_0x5dccdf}:null;}})[_0xd4f0('0x21')](respondWithResult(_0x5224bd,null))[_0xd4f0('0x43')](handleError(_0x5224bd,null));}; \ No newline at end of file +var _0xd15e=['offset','set','apply','reject','save','update','then','destroy','Lists','UserProfileResource','error','stack','index','map','CmList','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','name','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','getDispositions','findOne','ListId','removeDispositions','tags','each','CmContact','omit','ids','success','dataValues','push','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','cf_%d','raw','getContactsCsv','concat','format','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','addCustomField','transaction','TEXT','text','Sequelize','number','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','spread','emit','removeAgents','isArray','userCmList:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','end','json','count'];(function(_0x13557f,_0x474b96){var _0x5c8d6e=function(_0x1f24ff){while(--_0x1f24ff){_0x13557f['push'](_0x13557f['shift']());}};_0x5c8d6e(++_0x474b96);}(_0xd15e,0xfb));var _0xed15=function(_0x50781b,_0xaee749){_0x50781b=_0x50781b-0x0;var _0x25ffef=_0xd15e[_0x50781b];return _0x25ffef;};'use strict';var pdf=require(_0xed15('0x0'));var emlformat=require(_0xed15('0x1'));var rimraf=require(_0xed15('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed15('0x3'));var rp=require('request-promise');var moment=require(_0xed15('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed15('0x5'));var util=require(_0xed15('0x6'));var path=require(_0xed15('0x7'));var sox=require(_0xed15('0x8'));var csv=require(_0xed15('0x9'));var ejs=require(_0xed15('0xa'));var fs=require('fs');var _=require(_0xed15('0xb'));var squel=require(_0xed15('0xc'));var crypto=require(_0xed15('0xd'));var jsforce=require(_0xed15('0xe'));var deskjs=require(_0xed15('0xf'));var toCsv=require(_0xed15('0x9'));var querystring=require(_0xed15('0x10'));var Papa=require(_0xed15('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xed15('0x12'));var as=require(_0xed15('0x13'));var hardwareService=require(_0xed15('0x14'));var logger=require(_0xed15('0x15'))(_0xed15('0x16'));var utils=require(_0xed15('0x17'));var config=require(_0xed15('0x18'));var db=require(_0xed15('0x19'))['db'];config[_0xed15('0x1a')]=_[_0xed15('0x1b')](config['redis'],{'host':_0xed15('0x1c'),'port':0x18eb});var socket=require(_0xed15('0x1d'))(new Redis(config[_0xed15('0x1a')]));require(_0xed15('0x1e'))[_0xed15('0x1f')](socket);function respondWithStatusCode(_0x40a518,_0x45a8bd){_0x45a8bd=_0x45a8bd||0xcc;return function(_0xa6779b){if(_0xa6779b){return _0x40a518[_0xed15('0x20')](_0x45a8bd);}return _0x40a518[_0xed15('0x21')](_0x45a8bd)[_0xed15('0x22')]();};}function respondWithResult(_0x5b5d56,_0x5ab0f4){_0x5ab0f4=_0x5ab0f4||0xc8;return function(_0x1d28ac){if(_0x1d28ac){return _0x5b5d56['status'](_0x5ab0f4)[_0xed15('0x23')](_0x1d28ac);}};}function respondWithFilteredResult(_0x3cd346,_0x429fdd){return function(_0x5c893f){if(_0x5c893f){var _0x224436=_0x5c893f[_0xed15('0x24')],_0x59bd39=_0x429fdd['offset'],_0x7be6b3=_0x429fdd[_0xed15('0x25')]+_0x429fdd['limit'],_0x241c7e;if(_0x7be6b3>=_0x224436){_0x7be6b3=_0x224436;_0x241c7e=0xc8;}else{_0x241c7e=0xce;}_0x3cd346[_0xed15('0x21')](_0x241c7e);return _0x3cd346[_0xed15('0x26')]('Content-Range',_0x59bd39+'-'+_0x7be6b3+'/'+_0x224436)[_0xed15('0x23')](_0x5c893f);}return null;};}function patchUpdates(_0x2dd79f){return function(_0x35d81c){try{jsonpatch[_0xed15('0x27')](_0x35d81c,_0x2dd79f,!![]);}catch(_0x1bfe27){return BPromise[_0xed15('0x28')](_0x1bfe27);}return _0x35d81c[_0xed15('0x29')]();};}function saveUpdates(_0x4dc3c0,_0x1228c6){return function(_0x16352e){if(_0x16352e){return _0x16352e[_0xed15('0x2a')](_0x4dc3c0)[_0xed15('0x2b')](function(_0x4eafc9){return _0x4eafc9;});}return null;};}function removeEntity(_0x3ed4ef,_0x555281){return function(_0x3f94d2){if(_0x3f94d2){return _0x3f94d2[_0xed15('0x2c')]()[_0xed15('0x2b')](function(){var _0x4e06d6=_0x3f94d2['get']({'plain':!![]});var _0xacd41f=_0xed15('0x2d');return db[_0xed15('0x2e')]['destroy']({'where':{'type':_0xacd41f,'resourceId':_0x4e06d6['id']}})[_0xed15('0x2b')](function(){return _0x3f94d2;});})['then'](function(){_0x3ed4ef[_0xed15('0x21')](0xcc)[_0xed15('0x22')]();});}};}function handleEntityNotFound(_0x3e4d0c,_0x303d39){return function(_0x312211){if(!_0x312211){_0x3e4d0c[_0xed15('0x20')](0x194);}return _0x312211;};}function handleError(_0x4aa9ba,_0x52529b){_0x52529b=_0x52529b||0x1f4;return function(_0x4378ab){logger[_0xed15('0x2f')](_0x4378ab[_0xed15('0x30')]);if(_0x4378ab['name']){delete _0x4378ab['name'];}_0x4aa9ba['status'](_0x52529b)['send'](_0x4378ab);};}exports[_0xed15('0x31')]=function(_0x363c69,_0x2f2290){var _0x40c5d2={},_0x3642f5={},_0x5d6683={'count':0x0,'rows':[]};var _0x47026c=_[_0xed15('0x32')](db[_0xed15('0x33')][_0xed15('0x34')],function(_0x28c0fd){return{'name':_0x28c0fd[_0xed15('0x35')],'type':_0x28c0fd['type'][_0xed15('0x36')]};});_0x3642f5['model']=_[_0xed15('0x32')](_0x47026c,'name');_0x3642f5[_0xed15('0x37')]=_[_0xed15('0x38')](_0x363c69[_0xed15('0x37')]);_0x3642f5[_0xed15('0x39')]=_[_0xed15('0x3a')](_0x3642f5[_0xed15('0x3b')],_0x3642f5['query']);_0x40c5d2[_0xed15('0x3c')]=_['intersection'](_0x3642f5[_0xed15('0x3b')],qs[_0xed15('0x3d')](_0x363c69[_0xed15('0x37')][_0xed15('0x3d')]));_0x40c5d2[_0xed15('0x3c')]=_0x40c5d2[_0xed15('0x3c')]['length']?_0x40c5d2[_0xed15('0x3c')]:_0x3642f5['model'];if(!_0x363c69[_0xed15('0x37')][_0xed15('0x3e')](_0xed15('0x3f'))){_0x40c5d2[_0xed15('0x40')]=qs[_0xed15('0x40')](_0x363c69[_0xed15('0x37')][_0xed15('0x40')]);_0x40c5d2['offset']=qs[_0xed15('0x25')](_0x363c69[_0xed15('0x37')][_0xed15('0x25')]);}_0x40c5d2[_0xed15('0x41')]=qs[_0xed15('0x42')](_0x363c69[_0xed15('0x37')]['sort']);_0x40c5d2[_0xed15('0x43')]=qs[_0xed15('0x39')](_[_0xed15('0x44')](_0x363c69['query'],_0x3642f5[_0xed15('0x39')]));if(_0x363c69['query'][_0xed15('0x45')]){_0x40c5d2['where']=_[_0xed15('0x46')](_0x40c5d2[_0xed15('0x43')],{'$or':_[_0xed15('0x32')](_0x47026c,function(_0x56b69b){if(_0x56b69b[_0xed15('0x47')]!=='VIRTUAL'){var _0x51c250={};_0x51c250[_0x56b69b[_0xed15('0x48')]]={'$like':'%'+_0x363c69[_0xed15('0x37')][_0xed15('0x45')]+'%'};return _0x51c250;}})});}_0x40c5d2=_[_0xed15('0x46')]({},_0x40c5d2,_0x363c69[_0xed15('0x49')]);var _0x4552c4={'where':_0x40c5d2[_0xed15('0x43')]};return db['CmList'][_0xed15('0x24')](_0x4552c4)[_0xed15('0x2b')](function(_0x46a630){_0x5d6683[_0xed15('0x24')]=_0x46a630;if(_0x363c69[_0xed15('0x37')][_0xed15('0x4a')]){_0x40c5d2[_0xed15('0x4b')]=[{'all':!![]}];}return db[_0xed15('0x33')][_0xed15('0x4c')](_0x40c5d2);})[_0xed15('0x2b')](function(_0x37adf8){_0x5d6683[_0xed15('0x4d')]=_0x37adf8;return _0x5d6683;})[_0xed15('0x2b')](respondWithFilteredResult(_0x2f2290,_0x40c5d2))[_0xed15('0x4e')](handleError(_0x2f2290,null));};exports['show']=function(_0x59848a,_0x3af198){var _0x112177={'raw':![],'where':{'id':_0x59848a[_0xed15('0x4f')]['id']}},_0x2c437f={};_0x2c437f[_0xed15('0x3b')]=_[_0xed15('0x38')](db[_0xed15('0x33')][_0xed15('0x34')]);_0x2c437f[_0xed15('0x37')]=_[_0xed15('0x38')](_0x59848a['query']);_0x2c437f[_0xed15('0x39')]=_[_0xed15('0x3a')](_0x2c437f[_0xed15('0x3b')],_0x2c437f[_0xed15('0x37')]);_0x112177['attributes']=_[_0xed15('0x3a')](_0x2c437f[_0xed15('0x3b')],qs['fields'](_0x59848a['query']['fields']));_0x112177['attributes']=_0x112177[_0xed15('0x3c')][_0xed15('0x50')]?_0x112177[_0xed15('0x3c')]:_0x2c437f[_0xed15('0x3b')];if(_0x59848a[_0xed15('0x37')][_0xed15('0x4a')]){_0x112177[_0xed15('0x4b')]=[{'all':!![]}];}_0x112177=_[_0xed15('0x46')]({},_0x112177,_0x59848a[_0xed15('0x49')]);return db['CmList'][_0xed15('0x51')](_0x112177)[_0xed15('0x2b')](handleEntityNotFound(_0x3af198,null))[_0xed15('0x2b')](respondWithResult(_0x3af198,null))[_0xed15('0x4e')](handleError(_0x3af198,null));};exports['create']=function(_0x5a575d,_0x5e5820){return db['CmList'][_0xed15('0x52')](_0x5a575d['body'],{})[_0xed15('0x2b')](function(_0x50dc31){var _0x4c6b2a=_0x5a575d['user']['get']({'plain':!![]});if(!_0x4c6b2a)throw new Error(_0xed15('0x53'));if(_0x4c6b2a[_0xed15('0x54')]===_0xed15('0x55')){var _0x3e5419=_0x50dc31[_0xed15('0x56')]({'plain':!![]});var _0x3e8942=_0xed15('0x2d');return db[_0xed15('0x57')][_0xed15('0x51')]({'where':{'name':_0x3e8942,'userProfileId':_0x4c6b2a[_0xed15('0x58')]},'raw':!![]})['then'](function(_0x4d9d7a){if(_0x4d9d7a&&_0x4d9d7a[_0xed15('0x59')]===0x0){return db['UserProfileResource'][_0xed15('0x52')]({'name':_0x3e5419[_0xed15('0x48')],'resourceId':_0x3e5419['id'],'type':_0x4d9d7a[_0xed15('0x48')],'sectionId':_0x4d9d7a['id']},{})[_0xed15('0x2b')](function(){return _0x50dc31;});}else{return _0x50dc31;}})[_0xed15('0x4e')](function(_0x26a60e){logger[_0xed15('0x2f')](_0xed15('0x5a'),_0x26a60e);throw _0x26a60e;});}return _0x50dc31;})[_0xed15('0x2b')](respondWithResult(_0x5e5820,0xc9))[_0xed15('0x4e')](handleError(_0x5e5820,null));};exports[_0xed15('0x2a')]=function(_0x183c78,_0x195a59){if(_0x183c78[_0xed15('0x5b')]['id']){delete _0x183c78[_0xed15('0x5b')]['id'];}return db['CmList'][_0xed15('0x51')]({'where':{'id':_0x183c78[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x195a59,null))['then'](saveUpdates(_0x183c78['body'],null))[_0xed15('0x2b')](respondWithResult(_0x195a59,null))[_0xed15('0x4e')](handleError(_0x195a59,null));};exports[_0xed15('0x2c')]=function(_0x1cf27e,_0x4a7c78){return db[_0xed15('0x33')][_0xed15('0x51')]({'where':{'id':_0x1cf27e[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x4a7c78,null))[_0xed15('0x2b')](removeEntity(_0x4a7c78,null))['catch'](handleError(_0x4a7c78,null));};exports[_0xed15('0x5c')]=function(_0x315b35,_0x1ab526){return db[_0xed15('0x33')][_0xed15('0x5c')]()[_0xed15('0x2b')](respondWithResult(_0x1ab526,null))[_0xed15('0x4e')](handleError(_0x1ab526,null));};exports[_0xed15('0x5d')]=function(_0xf5d5fa,_0x14c93a,_0x229acc){if(_0xf5d5fa[_0xed15('0x5b')]['id']){delete _0xf5d5fa[_0xed15('0x5b')]['id'];}return db[_0xed15('0x33')][_0xed15('0x51')]({'where':{'id':_0xf5d5fa[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x14c93a,null))[_0xed15('0x2b')](function(_0x7b1447){if(_0x7b1447){_0xf5d5fa['body']['ListId']=_0x7b1447['id'];return db[_0xed15('0x5e')]['create'](_0xf5d5fa[_0xed15('0x5b')]);}})[_0xed15('0x2b')](respondWithResult(_0x14c93a,null))['catch'](handleError(_0x14c93a,null));};exports[_0xed15('0x5f')]=function(_0x125c94,_0x4b0652,_0x428bdf){var _0x1486c9={'raw':![],'where':{}};var _0x1e01ca={};var _0x4efe01={'count':0x0,'rows':[]};return db[_0xed15('0x33')][_0xed15('0x60')]({'where':{'id':_0x125c94[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x4b0652,null))[_0xed15('0x2b')](function(_0x3a4499){if(_0x3a4499){_0x1e01ca['model']=_[_0xed15('0x38')](db[_0xed15('0x5e')][_0xed15('0x34')]);_0x1e01ca[_0xed15('0x37')]=_[_0xed15('0x38')](_0x125c94[_0xed15('0x37')]);_0x1e01ca[_0xed15('0x39')]=_['intersection'](_0x1e01ca['model'],_0x1e01ca[_0xed15('0x37')]);_0x1486c9[_0xed15('0x3c')]=_['intersection'](_0x1e01ca['model'],qs['fields'](_0x125c94['query'][_0xed15('0x3d')]));_0x1486c9[_0xed15('0x3c')]=_0x1486c9[_0xed15('0x3c')]['length']?_0x1486c9['attributes']:_0x1e01ca[_0xed15('0x3b')];if(!_0x125c94['query']['hasOwnProperty'](_0xed15('0x3f'))){_0x1486c9[_0xed15('0x40')]=qs[_0xed15('0x40')](_0x125c94['query'][_0xed15('0x40')]);_0x1486c9['offset']=qs[_0xed15('0x25')](_0x125c94['query'][_0xed15('0x25')]);}_0x1486c9['order']=qs[_0xed15('0x42')](_0x125c94[_0xed15('0x37')][_0xed15('0x42')]);_0x1486c9[_0xed15('0x43')]=qs['filters'](_[_0xed15('0x44')](_0x125c94[_0xed15('0x37')],_0x1e01ca[_0xed15('0x39')]));_0x1486c9[_0xed15('0x43')][_0xed15('0x61')]=_0x3a4499['id'];if(_0x125c94[_0xed15('0x37')][_0xed15('0x45')]){_0x1486c9[_0xed15('0x43')]=_[_0xed15('0x46')](_0x1486c9[_0xed15('0x43')],{'$or':_[_0xed15('0x32')](_0x1486c9[_0xed15('0x3c')],function(_0x506c5e){var _0x110b4e={};_0x110b4e[_0x506c5e]={'$like':'%'+_0x125c94[_0xed15('0x37')][_0xed15('0x45')]+'%'};return _0x110b4e;})});}_0x1486c9=_[_0xed15('0x46')]({},_0x1486c9,_0x125c94[_0xed15('0x49')]);return db[_0xed15('0x5e')][_0xed15('0x24')]({'where':_0x1486c9[_0xed15('0x43')]})[_0xed15('0x2b')](function(_0x4b4d44){_0x4efe01[_0xed15('0x24')]=_0x4b4d44;if(_0x125c94[_0xed15('0x37')][_0xed15('0x4a')]){_0x1486c9[_0xed15('0x4b')]=[{'all':!![]}];}return db[_0xed15('0x5e')][_0xed15('0x4c')](_0x1486c9);})[_0xed15('0x2b')](function(_0x46bbb4){_0x4efe01[_0xed15('0x4d')]=_0x46bbb4;return _0x4efe01;});}})[_0xed15('0x2b')](respondWithFilteredResult(_0x4b0652,_0x1486c9))['catch'](handleError(_0x4b0652,null));};exports[_0xed15('0x62')]=function(_0x314f62,_0x122626,_0x57a77c){return db[_0xed15('0x33')]['find']({'where':{'id':_0x314f62[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x122626,null))['then'](function(_0x4fa260){if(_0x4fa260){return _0x4fa260['removeDispositions'](_0x314f62[_0xed15('0x37')]['ids']);}})[_0xed15('0x2b')](respondWithStatusCode(_0x122626,null))['catch'](handleError(_0x122626,null));};exports['addContacts']=function(_0x584bbe,_0x56977f,_0x4be3fa){return db[_0xed15('0x33')][_0xed15('0x51')]({'where':{'id':_0x584bbe[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x56977f,null))[_0xed15('0x2b')](function(_0x20d3ce){if(_0x20d3ce){var _0x553339=[];var _0x12175a={'success':[],'errors':[]};return db['CmContact']['describe']()[_0xed15('0x2b')](function(_0x2ba113){if(_0x584bbe['body'][_0xed15('0x63')]&&_['isArray'](_0x584bbe['body'][_0xed15('0x63')])){if(_0x584bbe[_0xed15('0x5b')][_0xed15('0x63')][_0xed15('0x50')]){_0x584bbe[_0xed15('0x5b')][_0xed15('0x63')]=_0x584bbe[_0xed15('0x5b')][_0xed15('0x63')]['join'](';')+';';}else{_0x584bbe[_0xed15('0x5b')][_0xed15('0x63')]=null;}}else{_0x584bbe[_0xed15('0x5b')][_0xed15('0x63')]=null;}if(_0x584bbe[_0xed15('0x5b')]&&_['isArray'](_0x584bbe['body'])){for(var _0x59b58a=0x0;_0x59b58a<_0x584bbe[_0xed15('0x5b')][_0xed15('0x50')];_0x59b58a+=0x1){_0x584bbe['body'][_0x59b58a][_0xed15('0x61')]=_0x584bbe[_0xed15('0x4f')]['id'];_0x553339['push'](_0x584bbe[_0xed15('0x5b')][_0x59b58a]);}return BPromise[_0xed15('0x64')](_0x553339,function(_0xf70d3b){return db[_0xed15('0x65')][_0xed15('0x52')](_[_0xed15('0x66')](_0xf70d3b,[_0xed15('0x67'),'id'])||{},{'fields':_[_0xed15('0x38')](_0x2ba113),'raw':!![]})['then'](function(_0x5c21bf){_0x12175a[_0xed15('0x68')]['push'](_0x5c21bf[_0xed15('0x69')]);})[_0xed15('0x4e')](function(_0x5dc609){_0x12175a['errors'][_0xed15('0x6a')]({'data':_0xf70d3b,'error':_0x5dc609['message']});});})['then'](function(_0x44dd49){return _0x12175a;})[_0xed15('0x4e')](function(_0x1caa53){return _0x1caa53;});}else{_0x56977f['status'](0x190)[_0xed15('0x23')]({'message':_0xed15('0x6b')});}});}})[_0xed15('0x2b')](respondWithResult(_0x56977f,null))[_0xed15('0x4e')](handleError(_0x56977f,null));};exports[_0xed15('0x6c')]=function(_0x3cc17d,_0x24380f,_0x5d4487){var _0x5afcd2;return db['CmList'][_0xed15('0x51')]({'where':{'id':_0x3cc17d[_0xed15('0x4f')]['id']},'include':[{'model':db[_0xed15('0x6d')],'as':_0xed15('0x6e')}]})[_0xed15('0x2b')](handleEntityNotFound(_0x24380f,null))[_0xed15('0x2b')](function(_0x341a22){if(_0x341a22){_0x5afcd2=_0x341a22;return db[_0xed15('0x65')]['rawAttributes'];}})[_0xed15('0x2b')](function(_0x4dd92a){if(_0x4dd92a){var _0x313586={};var _0x2e7395={};_0x2e7395['model']=_['concat'](_[_0xed15('0x38')](_0x4dd92a),_[_0xed15('0x32')](_0x5afcd2[_0xed15('0x6e')],function(_0xc149a8){return util['format'](_0xed15('0x6f'),_0xc149a8['id']);}));_0x2e7395[_0xed15('0x37')]=_[_0xed15('0x38')](_0x3cc17d['query']);_0x2e7395['filters']=_['intersection'](_0x2e7395[_0xed15('0x3b')],_0x2e7395[_0xed15('0x37')]);_0x313586[_0xed15('0x3c')]=_[_0xed15('0x3a')](_0x2e7395[_0xed15('0x3b')],qs[_0xed15('0x3d')](_0x3cc17d[_0xed15('0x37')][_0xed15('0x3d')]));_0x313586['attributes']=_0x313586[_0xed15('0x3c')][_0xed15('0x50')]?_0x313586['attributes']:_0x2e7395['model'];if(!_0x3cc17d[_0xed15('0x37')][_0xed15('0x3e')](_0xed15('0x3f'))){_0x313586[_0xed15('0x40')]=qs[_0xed15('0x40')](_0x3cc17d[_0xed15('0x37')]['limit']);_0x313586[_0xed15('0x25')]=qs[_0xed15('0x25')](_0x3cc17d[_0xed15('0x37')][_0xed15('0x25')]);}_0x313586[_0xed15('0x41')]=qs[_0xed15('0x42')](_0x3cc17d[_0xed15('0x37')][_0xed15('0x42')]);_0x313586[_0xed15('0x43')]=qs['filters'](_[_0xed15('0x44')](_0x3cc17d['query'],_0x2e7395[_0xed15('0x39')]));_0x313586[_0xed15('0x70')]=!![];if(_0x3cc17d[_0xed15('0x37')][_0xed15('0x45')]){_0x313586[_0xed15('0x43')]=_['merge'](_0x313586[_0xed15('0x43')],{'$or':_['map'](_0x313586[_0xed15('0x3c')],function(_0x3daf76){var _0x3a45e8={};_0x3a45e8[_0x3daf76]={'$like':'%'+_0x3cc17d[_0xed15('0x37')][_0xed15('0x45')]+'%'};return _0x3a45e8;})});}_0x313586=_['merge']({},_0x313586,_0x3cc17d[_0xed15('0x49')]);return _0x5afcd2[_0xed15('0x6c')](_0x313586);}})[_0xed15('0x2b')](respondWithResult(_0x24380f,null))[_0xed15('0x4e')](handleError(_0x24380f,null));};exports[_0xed15('0x71')]=function(_0xbe55a1,_0x13b17e,_0x406f63){var _0x138e45;return db[_0xed15('0x33')]['find']({'where':{'id':_0xbe55a1['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0xed15('0x6e')}]})[_0xed15('0x2b')](handleEntityNotFound(_0x13b17e,null))[_0xed15('0x2b')](function(_0x4949db){if(_0x4949db){_0x138e45=_0x4949db;return db[_0xed15('0x65')][_0xed15('0x34')];}})['then'](function(_0x6401b){if(_0x6401b){var _0x2ba0c8={};var _0x425dff={};_0x425dff['model']=_[_0xed15('0x72')](_[_0xed15('0x38')](_0x6401b),_[_0xed15('0x32')](_0x138e45[_0xed15('0x6e')],function(_0x4ec551){return util[_0xed15('0x73')]('cf_%d',_0x4ec551['id']);}));_0x425dff[_0xed15('0x37')]=_[_0xed15('0x38')](_0xbe55a1[_0xed15('0x37')]);_0x425dff[_0xed15('0x39')]=_[_0xed15('0x3a')](_0x425dff[_0xed15('0x3b')],_0x425dff['query']);_0x2ba0c8['attributes']=_[_0xed15('0x3a')](_0x425dff[_0xed15('0x3b')],qs[_0xed15('0x3d')](_0xbe55a1[_0xed15('0x37')][_0xed15('0x3d')]));_0x2ba0c8[_0xed15('0x3c')]=_0x2ba0c8[_0xed15('0x3c')][_0xed15('0x50')]?_0x2ba0c8['attributes']:_0x425dff[_0xed15('0x3b')];if(!_0xbe55a1[_0xed15('0x37')]['hasOwnProperty'](_0xed15('0x3f'))){_0x2ba0c8[_0xed15('0x40')]=qs['limit'](_0xbe55a1['query'][_0xed15('0x40')]);_0x2ba0c8[_0xed15('0x25')]=qs['offset'](_0xbe55a1[_0xed15('0x37')][_0xed15('0x25')]);}_0x2ba0c8[_0xed15('0x41')]=qs['sort'](_0xbe55a1[_0xed15('0x37')][_0xed15('0x42')]);_0x2ba0c8[_0xed15('0x43')]=qs[_0xed15('0x39')](_[_0xed15('0x44')](_0xbe55a1[_0xed15('0x37')],_0x425dff[_0xed15('0x39')]));_0x2ba0c8[_0xed15('0x70')]=!![];if(_0xbe55a1[_0xed15('0x37')][_0xed15('0x45')]){_0x2ba0c8[_0xed15('0x43')]=_[_0xed15('0x46')](_0x2ba0c8[_0xed15('0x43')],{'$or':_[_0xed15('0x32')](_0x2ba0c8[_0xed15('0x3c')],function(_0x2d9316){var _0x2dae97={};_0x2dae97[_0x2d9316]={'$like':'%'+_0xbe55a1[_0xed15('0x37')]['filter']+'%'};return _0x2dae97;})});}_0x2ba0c8=_[_0xed15('0x46')]({},_0x2ba0c8,_0xbe55a1[_0xed15('0x49')]);return _0x138e45[_0xed15('0x6c')](_0x2ba0c8);}})[_0xed15('0x2b')](function(_0x2215fa){if(!_['isEmpty'](_0x2215fa)){var _0x23ebeb=toCsv(_0x2215fa);var _0x48fb79=Date[_0xed15('0x74')]();fs[_0xed15('0x75')](util['format'](_0xed15('0x76'),_0x138e45['id'],_0x48fb79),_0x23ebeb);_0x13b17e[_0xed15('0x77')]('Content-disposition',_0xed15('0x78')+util[_0xed15('0x73')](_0xed15('0x79'),_0x138e45['id'],_0x48fb79));_0x13b17e[_0xed15('0x77')](_0xed15('0x7a'),_0xed15('0x7b'));return _0x13b17e['download'](util[_0xed15('0x73')]('/tmp/list_%d_%s.csv',_0x138e45['id'],_0x48fb79));}else{return _0x13b17e[_0xed15('0x20')](0xcc);}})[_0xed15('0x4e')](handleError(_0x13b17e,null));};exports[_0xed15('0x7c')]=function(_0x5a925c,_0x4f0129,_0x594b8c){var _0x3cc93e;delete _0x5a925c[_0xed15('0x5b')]['id'];return db[_0xed15('0x33')]['findOne']({'where':{'id':_0x5a925c[_0xed15('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f0129,null))[_0xed15('0x2b')](function(_0x29d306){if(_0x29d306){return db['sequelize'][_0xed15('0x7d')](function(_0x5409f8){return db['CmCustomField'][_0xed15('0x52')](_0x5a925c[_0xed15('0x5b')],{'transaction':_0x5409f8})[_0xed15('0x2b')](function(_0x1ca5af){_0x3cc93e=_0x1ca5af;return _0x29d306['addCustomFields'](_0x1ca5af,{'transaction':_0x5409f8});})[_0xed15('0x2b')](function(){var _0x215f69={'type':db['Sequelize'][_0xed15('0x7e')],'transaction':_0x5409f8};switch(_0x5a925c[_0xed15('0x5b')]['type']){case _0xed15('0x7f'):_0x215f69[_0xed15('0x47')]=db[_0xed15('0x80')]['TEXT'];break;case _0xed15('0x81'):_0x215f69[_0xed15('0x47')]=db[_0xed15('0x80')]['INTEGER'];break;case'switch':_0x215f69['type']=db[_0xed15('0x80')][_0xed15('0x82')];_0x215f69['defaultValue']=![];break;default:}return db[_0xed15('0x83')][_0xed15('0x84')][_0xed15('0x85')](_0xed15('0x86'),util['format'](_0xed15('0x87'),_0x3cc93e['id']),_0x215f69);})['then'](function(){return _0x3cc93e;});});}})[_0xed15('0x2b')](respondWithResult(_0x4f0129,null))[_0xed15('0x4e')](handleError(_0x4f0129,null));};exports[_0xed15('0x88')]=function(_0x4b13f0,_0x4ae139,_0x1a1100){var _0x167d1b={};var _0x28b27e={};var _0x4883b9;var _0x59e32a;return db[_0xed15('0x33')]['findOne']({'where':{'id':_0x4b13f0[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x4ae139,null))[_0xed15('0x2b')](function(_0x47c9a2){if(_0x47c9a2){_0x4883b9=_0x47c9a2;_0x28b27e[_0xed15('0x3b')]=_['keys'](db[_0xed15('0x6d')][_0xed15('0x34')]);_0x28b27e['query']=_[_0xed15('0x38')](_0x4b13f0[_0xed15('0x37')]);_0x28b27e[_0xed15('0x39')]=_[_0xed15('0x3a')](_0x28b27e[_0xed15('0x3b')],_0x28b27e[_0xed15('0x37')]);_0x167d1b[_0xed15('0x3c')]=_[_0xed15('0x3a')](_0x28b27e['model'],qs['fields'](_0x4b13f0[_0xed15('0x37')][_0xed15('0x3d')]));_0x167d1b[_0xed15('0x3c')]=_0x167d1b[_0xed15('0x3c')]['length']?_0x167d1b[_0xed15('0x3c')]:_0x28b27e[_0xed15('0x3b')];_0x167d1b[_0xed15('0x41')]=qs[_0xed15('0x42')](_0x4b13f0[_0xed15('0x37')][_0xed15('0x42')]);_0x167d1b[_0xed15('0x43')]=qs['filters'](_[_0xed15('0x44')](_0x4b13f0[_0xed15('0x37')],_0x28b27e[_0xed15('0x39')]));_0x167d1b[_0xed15('0x43')]=_[_0xed15('0x46')](_0x167d1b[_0xed15('0x43')],{'$or':[{'ListId':_0x47c9a2['id']},{'ListId':null}]});if(_0x4b13f0[_0xed15('0x37')][_0xed15('0x45')]){_0x167d1b[_0xed15('0x43')]=_[_0xed15('0x46')](_0x167d1b[_0xed15('0x43')],{'$or':_[_0xed15('0x32')](_0x167d1b[_0xed15('0x3c')],function(_0x1e7431){var _0x318f06={};_0x318f06[_0x1e7431]={'$like':'%'+_0x4b13f0['query'][_0xed15('0x45')]+'%'};return _0x318f06;})});}_0x167d1b=_[_0xed15('0x46')]({},_0x167d1b,_0x4b13f0['options']);return db[_0xed15('0x6d')][_0xed15('0x89')](_0x167d1b);}})[_0xed15('0x2b')](respondWithResult(_0x4ae139,null))[_0xed15('0x4e')](handleError(_0x4ae139,null));};exports['addAgents']=function(_0x2e9314,_0x3d3868,_0x58c9cc){return db[_0xed15('0x33')][_0xed15('0x51')]({'where':{'id':_0x2e9314[_0xed15('0x4f')]['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x3d3868,null))['then'](function(_0x449c5c){if(_0x449c5c){return _0x449c5c['addAgents'](_0x2e9314[_0xed15('0x5b')]['ids'],_[_0xed15('0x66')](_0x2e9314['body'],[_0xed15('0x67'),'id'])||{})[_0xed15('0x8a')](function(_0x1c0270){for(var _0x13e00f=0x0;_0x13e00f<_0x2e9314['body'][_0xed15('0x67')][_0xed15('0x50')];_0x13e00f+=0x1){socket[_0xed15('0x8b')]('userCmList:save',{'UserId':_0x2e9314['body']['ids'][_0x13e00f],'CmListId':_0x2e9314['params']['id']});}return _0x1c0270;});}})[_0xed15('0x2b')](respondWithResult(_0x3d3868,null))[_0xed15('0x4e')](handleError(_0x3d3868,null));};exports[_0xed15('0x8c')]=function(_0x400769,_0x1f748d,_0x4898ea){return db[_0xed15('0x33')][_0xed15('0x51')]({'where':{'id':_0x400769['params']['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x1f748d,null))[_0xed15('0x2b')](function(_0x17b119){if(_0x17b119){return _0x17b119[_0xed15('0x8c')](_0x400769[_0xed15('0x37')]['ids'])[_0xed15('0x2b')](function(){if(_[_0xed15('0x8d')](_0x400769[_0xed15('0x37')][_0xed15('0x67')])){for(var _0x27201b=0x0;_0x27201b<_0x400769[_0xed15('0x37')]['ids'][_0xed15('0x50')];_0x27201b+=0x1){socket[_0xed15('0x8b')](_0xed15('0x8e'),{'UserId':Number(_0x400769['query'][_0xed15('0x67')][_0x27201b]),'CmListId':Number(_0x400769[_0xed15('0x4f')]['id'])});}}else{socket[_0xed15('0x8b')]('userCmList:remove',{'UserId':Number(_0x400769['query'][_0xed15('0x67')]),'CmListId':Number(_0x400769[_0xed15('0x4f')]['id'])});}});}})[_0xed15('0x2b')](respondWithStatusCode(_0x1f748d,null))[_0xed15('0x4e')](handleError(_0x1f748d,null));};exports[_0xed15('0x8f')]=function(_0x20f5c5,_0x6690ae,_0x32f7ec){var _0x1ed442={};var _0x306f07={};var _0x281019;var _0x5977fa;return db[_0xed15('0x33')][_0xed15('0x60')]({'where':{'id':_0x20f5c5['params']['id']}})[_0xed15('0x2b')](handleEntityNotFound(_0x6690ae,null))[_0xed15('0x2b')](function(_0x2db413){if(_0x2db413){_0x281019=_0x2db413;_0x306f07[_0xed15('0x3b')]=_['keys'](db['User'][_0xed15('0x34')]);_0x306f07['query']=_[_0xed15('0x38')](_0x20f5c5[_0xed15('0x37')]);_0x306f07[_0xed15('0x39')]=_[_0xed15('0x3a')](_0x306f07[_0xed15('0x3b')],_0x306f07['query']);_0x1ed442['attributes']=_[_0xed15('0x3a')](_0x306f07[_0xed15('0x3b')],qs['fields'](_0x20f5c5['query'][_0xed15('0x3d')]));_0x1ed442[_0xed15('0x3c')]=_0x1ed442[_0xed15('0x3c')][_0xed15('0x50')]?_0x1ed442[_0xed15('0x3c')]:_0x306f07[_0xed15('0x3b')];_0x1ed442[_0xed15('0x41')]=qs[_0xed15('0x42')](_0x20f5c5[_0xed15('0x37')][_0xed15('0x42')]);_0x1ed442[_0xed15('0x43')]=qs[_0xed15('0x39')](_[_0xed15('0x44')](_0x20f5c5[_0xed15('0x37')],_0x306f07[_0xed15('0x39')]));if(_0x20f5c5[_0xed15('0x37')]['filter']){_0x1ed442[_0xed15('0x43')]=_[_0xed15('0x46')](_0x1ed442[_0xed15('0x43')],{'$or':_['map'](_0x1ed442['attributes'],function(_0xe43261){var _0x32e26d={};_0x32e26d[_0xe43261]={'$like':'%'+_0x20f5c5[_0xed15('0x37')][_0xed15('0x45')]+'%'};return _0x32e26d;})});}_0x1ed442=_[_0xed15('0x46')]({},_0x1ed442,_0x20f5c5[_0xed15('0x49')]);return _0x281019['getAgents'](_0x1ed442);}})[_0xed15('0x2b')](function(_0x2f8c55){if(_0x2f8c55){_0x5977fa=_0x2f8c55[_0xed15('0x50')];if(!_0x20f5c5[_0xed15('0x37')][_0xed15('0x3e')](_0xed15('0x3f'))){_0x1ed442[_0xed15('0x40')]=qs[_0xed15('0x40')](_0x20f5c5[_0xed15('0x37')][_0xed15('0x40')]);_0x1ed442['offset']=qs[_0xed15('0x25')](_0x20f5c5['query'][_0xed15('0x25')]);}return _0x281019['getAgents'](_0x1ed442);}})['then'](function(_0x91eb88){if(_0x91eb88){return _0x91eb88?{'count':_0x5977fa,'rows':_0x91eb88}:null;}})[_0xed15('0x2b')](respondWithResult(_0x6690ae,null))[_0xed15('0x4e')](handleError(_0x6690ae,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 09514e5..27a8387 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 _0x3b37=['events','../../mysqldb','CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0x3b37,0x1f4));var _0x73b3=function(_0x358f65,_0x28d565){_0x358f65=_0x358f65-0x0;var _0x49f8b5=_0x3b37[_0x358f65];return _0x49f8b5;};'use strict';var EventEmitter=require(_0x73b3('0x0'));var CmList=require(_0x73b3('0x1'))['db'][_0x73b3('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x73b3('0x3')](0x0);var events={'afterCreate':_0x73b3('0x4'),'afterUpdate':_0x73b3('0x5'),'afterDestroy':_0x73b3('0x6')};function emitEvent(_0x17a4a9){return function(_0x5ba2c5,_0x5c1446,_0x5d288b){CmListEvents[_0x73b3('0x7')](_0x17a4a9+':'+_0x5ba2c5['id'],_0x5ba2c5);CmListEvents[_0x73b3('0x7')](_0x17a4a9,_0x5ba2c5);_0x5d288b(null);};}for(var e in events){if(events[_0x73b3('0x8')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x73b3('0x9')]=CmListEvents; \ No newline at end of file +var _0xce77=['hook','exports','events','../../mysqldb','CmList','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x5e3b50,_0x61b4f1){var _0x317d02=function(_0x4c7f66){while(--_0x4c7f66){_0x5e3b50['push'](_0x5e3b50['shift']());}};_0x317d02(++_0x61b4f1);}(_0xce77,0x1c4));var _0x7ce7=function(_0x4715d4,_0xe84ae3){_0x4715d4=_0x4715d4-0x0;var _0x192671=_0xce77[_0x4715d4];return _0x192671;};'use strict';var EventEmitter=require(_0x7ce7('0x0'));var CmList=require(_0x7ce7('0x1'))['db'][_0x7ce7('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x7ce7('0x3')](0x0);var events={'afterCreate':_0x7ce7('0x4'),'afterUpdate':'update','afterDestroy':_0x7ce7('0x5')};function emitEvent(_0x1fe21f){return function(_0xcee56b,_0x578a74,_0x52e99e){CmListEvents[_0x7ce7('0x6')](_0x1fe21f+':'+_0xcee56b['id'],_0xcee56b);CmListEvents[_0x7ce7('0x6')](_0x1fe21f,_0xcee56b);_0x52e99e(null);};}for(var e in events){if(events[_0x7ce7('0x7')](e)){var event=events[e];CmList[_0x7ce7('0x8')](e,emitEvent(event));}}module[_0x7ce7('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 8ff2a4c..c59c9c3 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 _0xfbf1=['exports','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0xfbf1,0x122));var _0x1fbf=function(_0x4afb85,_0x2e592d){_0x4afb85=_0x4afb85-0x0;var _0xffff5a=_0xfbf1[_0x4afb85];return _0xffff5a;};'use strict';var _=require(_0x1fbf('0x0'));var util=require(_0x1fbf('0x1'));var logger=require(_0x1fbf('0x2'))(_0x1fbf('0x3'));var moment=require(_0x1fbf('0x4'));var BPromise=require(_0x1fbf('0x5'));var rp=require(_0x1fbf('0x6'));var fs=require('fs');var path=require(_0x1fbf('0x7'));var rimraf=require(_0x1fbf('0x8'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0x1fbf('0x9')]=function(_0x12fb17,_0x2e374e){return _0x12fb17[_0x1fbf('0xa')](_0x1fbf('0xb'),attributes,{'tableName':_0x1fbf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0a8=['define','CmList','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x40d834,_0x4c4b93){var _0x2ad5bc=function(_0x634eb3){while(--_0x634eb3){_0x40d834['push'](_0x40d834['shift']());}};_0x2ad5bc(++_0x4c4b93);}(_0xa0a8,0xde));var _0x8a0a=function(_0x105467,_0x5ebc29){_0x105467=_0x105467-0x0;var _0x36847f=_0xa0a8[_0x105467];return _0x36847f;};'use strict';var _=require(_0x8a0a('0x0'));var util=require('util');var logger=require(_0x8a0a('0x1'))('api');var moment=require(_0x8a0a('0x2'));var BPromise=require(_0x8a0a('0x3'));var rp=require(_0x8a0a('0x4'));var fs=require('fs');var path=require(_0x8a0a('0x5'));var rimraf=require(_0x8a0a('0x6'));var config=require('../../config/environment');var attributes=require(_0x8a0a('0x7'));module[_0x8a0a('0x8')]=function(_0x569564,_0x3e726f){return _0x569564[_0x8a0a('0x9')](_0x8a0a('0xa'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index fe1ee2d..e1cb694 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 _0x4f42=['result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x4f42,0x1e8));var _0x24f4=function(_0x1d214b,_0x525c37){_0x1d214b=_0x1d214b-0x0;var _0x1e9434=_0x4f42[_0x1d214b];return _0x1e9434;};'use strict';var _=require('lodash');var util=require(_0x24f4('0x0'));var moment=require(_0x24f4('0x1'));var BPromise=require(_0x24f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x24f4('0x4'))(_0x24f4('0x5'));var config=require(_0x24f4('0x6'));var jayson=require(_0x24f4('0x7'));var client=jayson[_0x24f4('0x8')][_0x24f4('0x9')]({'port':0x232a});config[_0x24f4('0xa')]=_[_0x24f4('0xb')](config['redis'],{'host':_0x24f4('0xc'),'port':0x18eb});var socket=require(_0x24f4('0xd'))(new Redis(config[_0x24f4('0xa')]));require(_0x24f4('0xe'))['register'](socket);function respondWithRpcPromise(_0x3efa61,_0xa2fbc2,_0x5c8e72){return new BPromise(function(_0x1c270c,_0x384a90){return client[_0x24f4('0xf')](_0x3efa61,_0x5c8e72)[_0x24f4('0x10')](function(_0x406138){logger[_0x24f4('0x11')](_0x24f4('0x12'),_0xa2fbc2,_0x24f4('0x13'));logger[_0x24f4('0x14')](_0x24f4('0x15'),_0xa2fbc2,'request\x20sent',JSON[_0x24f4('0x16')](_0x406138));if(_0x406138['error']){if(_0x406138['error']['code']===0x1f4){logger[_0x24f4('0x17')]('CmList,\x20%s,\x20%s',_0xa2fbc2,_0x406138[_0x24f4('0x17')]['message']);return _0x384a90(_0x406138[_0x24f4('0x17')]['message']);}logger[_0x24f4('0x17')](_0x24f4('0x12'),_0xa2fbc2,_0x406138[_0x24f4('0x17')][_0x24f4('0x18')]);return _0x1c270c(_0x406138[_0x24f4('0x17')]['message']);}else{logger[_0x24f4('0x11')](_0x24f4('0x12'),_0xa2fbc2,'request\x20sent');_0x1c270c(_0x406138[_0x24f4('0x19')]['message']);}})[_0x24f4('0x1a')](function(_0x30779e){logger['error'](_0x24f4('0x12'),_0xa2fbc2,_0x30779e);_0x384a90(_0x30779e);});});} \ No newline at end of file +var _0x4456=['../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x37e845,_0x219f9f){var _0x59e55b=function(_0x5dc6c8){while(--_0x5dc6c8){_0x37e845['push'](_0x37e845['shift']());}};_0x59e55b(++_0x219f9f);}(_0x4456,0x1cf));var _0x6445=function(_0x2755d6,_0x109dd2){_0x2755d6=_0x2755d6-0x0;var _0x3d5b34=_0x4456[_0x2755d6];return _0x3d5b34;};'use strict';var _=require(_0x6445('0x0'));var util=require(_0x6445('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6445('0x2'));var fs=require('fs');var Redis=require(_0x6445('0x3'));var db=require(_0x6445('0x4'))['db'];var utils=require(_0x6445('0x5'));var logger=require(_0x6445('0x6'))(_0x6445('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6445('0x8')][_0x6445('0x9')]({'port':0x232a});config[_0x6445('0xa')]=_[_0x6445('0xb')](config[_0x6445('0xa')],{'host':_0x6445('0xc'),'port':0x18eb});var socket=require(_0x6445('0xd'))(new Redis(config['redis']));require(_0x6445('0xe'))['register'](socket);function respondWithRpcPromise(_0x1db2e4,_0x4c5cc4,_0x14c094){return new BPromise(function(_0x21b8f4,_0xa47a85){return client[_0x6445('0xf')](_0x1db2e4,_0x14c094)[_0x6445('0x10')](function(_0xd8f1f1){logger['info']('CmList,\x20%s,\x20%s',_0x4c5cc4,_0x6445('0x11'));logger[_0x6445('0x12')]('CmList,\x20%s,\x20%s,\x20%s',_0x4c5cc4,_0x6445('0x11'),JSON[_0x6445('0x13')](_0xd8f1f1));if(_0xd8f1f1[_0x6445('0x14')]){if(_0xd8f1f1[_0x6445('0x14')][_0x6445('0x15')]===0x1f4){logger['error'](_0x6445('0x16'),_0x4c5cc4,_0xd8f1f1['error'][_0x6445('0x17')]);return _0xa47a85(_0xd8f1f1[_0x6445('0x14')]['message']);}logger[_0x6445('0x14')](_0x6445('0x16'),_0x4c5cc4,_0xd8f1f1[_0x6445('0x14')]['message']);return _0x21b8f4(_0xd8f1f1[_0x6445('0x14')][_0x6445('0x17')]);}else{logger[_0x6445('0x18')](_0x6445('0x16'),_0x4c5cc4,_0x6445('0x11'));_0x21b8f4(_0xd8f1f1['result']['message']);}})[_0x6445('0x19')](function(_0x38a328){logger[_0x6445('0x14')](_0x6445('0x16'),_0x4c5cc4,_0x38a328);_0xa47a85(_0x38a328);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index a2b1f3d..01c4d24 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 _0x7a3e=['remove','removeListener','length','cmList:','./cmList.events','save'];(function(_0x57ee2c,_0x1b25d2){var _0x1ad298=function(_0xc57724){while(--_0xc57724){_0x57ee2c['push'](_0x57ee2c['shift']());}};_0x1ad298(++_0x1b25d2);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x1c5ff7,_0x3145a3){_0x1c5ff7=_0x1c5ff7-0x0;var _0x443d31=_0x7a3e[_0x1c5ff7];return _0x443d31;};'use strict';var CmListEvents=require(_0xe7a3('0x0'));var events=[_0xe7a3('0x1'),_0xe7a3('0x2'),'update'];function createListener(_0xd95a19,_0x37f29c){return function(_0x49157a){_0x37f29c['emit'](_0xd95a19,_0x49157a);};}function removeListener(_0x9d97ac,_0x4053f3){return function(){CmListEvents[_0xe7a3('0x3')](_0x9d97ac,_0x4053f3);};}exports['register']=function(_0x401117){for(var _0x45b019=0x0,_0x46ecf7=events[_0xe7a3('0x4')];_0x45b019<_0x46ecf7;_0x45b019++){var _0x1a7627=events[_0x45b019];var _0x5524ad=createListener(_0xe7a3('0x5')+_0x1a7627,_0x401117);CmListEvents['on'](_0x1a7627,_0x5524ad);}}; \ No newline at end of file +var _0xf006=['register','cmList:','remove','update','emit','removeListener'];(function(_0x534dde,_0x10a29c){var _0x1f214d=function(_0x381d7e){while(--_0x381d7e){_0x534dde['push'](_0x534dde['shift']());}};_0x1f214d(++_0x10a29c);}(_0xf006,0x146));var _0x6f00=function(_0x6e605c,_0x296e18){_0x6e605c=_0x6e605c-0x0;var _0x3bf94a=_0xf006[_0x6e605c];return _0x3bf94a;};'use strict';var CmListEvents=require('./cmList.events');var events=['save',_0x6f00('0x0'),_0x6f00('0x1')];function createListener(_0x5914f3,_0xbab575){return function(_0x4e9dbc){_0xbab575[_0x6f00('0x2')](_0x5914f3,_0x4e9dbc);};}function removeListener(_0x4f4466,_0x5039fb){return function(){CmListEvents[_0x6f00('0x3')](_0x4f4466,_0x5039fb);};}exports[_0x6f00('0x4')]=function(_0x141e71){for(var _0x52c9a2=0x0,_0x3c29ff=events['length'];_0x52c9a2<_0x3c29ff;_0x52c9a2++){var _0x3875fb=events[_0x52c9a2];var _0x3001b1=createListener(_0x6f00('0x5')+_0x3875fb,_0x141e71);CmListEvents['on'](_0x3875fb,_0x3001b1);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index ae4fec5..6ae1b64 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 _0x68b7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','create','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','removeDispositions','exports','multer','connect-timeout','Router'];(function(_0x31b4a9,_0x59f197){var _0x37d2d5=function(_0x1e66dd){while(--_0x1e66dd){_0x31b4a9['push'](_0x31b4a9['shift']());}};_0x37d2d5(++_0x59f197);}(_0x68b7,0x151));var _0x768b=function(_0x1f7c48,_0x47b401){_0x1f7c48=_0x1f7c48-0x0;var _0x158a7a=_0x68b7[_0x1f7c48];return _0x158a7a;};'use strict';var multer=require(_0x768b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x768b('0x1'));var express=require('express');var router=express[_0x768b('0x2')]();var auth=require(_0x768b('0x3'));var interaction=require(_0x768b('0x4'));var config=require(_0x768b('0x5'));var controller=require(_0x768b('0x6'));router[_0x768b('0x7')]('/',auth[_0x768b('0x8')](),controller[_0x768b('0x9')]);router['get'](_0x768b('0xa'),auth['isAuthenticated'](),controller[_0x768b('0xb')]);router['get'](_0x768b('0xc'),auth[_0x768b('0x8')](),controller[_0x768b('0xd')]);router['get'](_0x768b('0xe'),auth[_0x768b('0x8')](),controller[_0x768b('0xf')]);router[_0x768b('0x7')](_0x768b('0x10'),auth[_0x768b('0x8')](),controller[_0x768b('0x11')]);router[_0x768b('0x7')](_0x768b('0x12'),auth[_0x768b('0x8')](),controller[_0x768b('0x13')]);router['get'](_0x768b('0x14'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x768b('0x7')](_0x768b('0x15'),auth['isAuthenticated'](),controller[_0x768b('0x16')]);router['post']('/',auth[_0x768b('0x8')](),controller[_0x768b('0x17')]);router[_0x768b('0x18')](_0x768b('0xe'),auth[_0x768b('0x8')](),controller[_0x768b('0x19')]);router[_0x768b('0x18')](_0x768b('0x10'),auth['isAuthenticated'](),controller[_0x768b('0x1a')]);router[_0x768b('0x18')](_0x768b('0x14'),auth[_0x768b('0x8')](),controller[_0x768b('0x1b')]);router[_0x768b('0x18')](_0x768b('0x15'),auth[_0x768b('0x8')](),controller[_0x768b('0x1c')]);router[_0x768b('0x1d')]('/:id',auth[_0x768b('0x8')](),controller[_0x768b('0x1e')]);router[_0x768b('0x1f')](_0x768b('0xc'),auth[_0x768b('0x8')](),controller['destroy']);router[_0x768b('0x1f')]('/:id/dispositions',auth[_0x768b('0x8')](),controller[_0x768b('0x20')]);router['delete'](_0x768b('0x15'),auth[_0x768b('0x8')](),controller['removeAgents']);module[_0x768b('0x21')]=router; \ No newline at end of file +var _0x5d42=['/:id/users','removeAgents','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','show','/:id/dispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/fields','getCustomFields','post','create','addDisposition','addContacts','addAgents','put','delete','destroy','removeDispositions'];(function(_0x33ed7c,_0x1cec1d){var _0x231b90=function(_0xa1d82e){while(--_0xa1d82e){_0x33ed7c['push'](_0x33ed7c['shift']());}};_0x231b90(++_0x1cec1d);}(_0x5d42,0xb0));var _0x25d4=function(_0x3bb347,_0x5f06a5){_0x3bb347=_0x3bb347-0x0;var _0x387010=_0x5d42[_0x3bb347];return _0x387010;};'use strict';var multer=require(_0x25d4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x25d4('0x1'));var express=require(_0x25d4('0x2'));var router=express[_0x25d4('0x3')]();var auth=require(_0x25d4('0x4'));var interaction=require(_0x25d4('0x5'));var config=require(_0x25d4('0x6'));var controller=require(_0x25d4('0x7'));router[_0x25d4('0x8')]('/',auth[_0x25d4('0x9')](),controller[_0x25d4('0xa')]);router[_0x25d4('0x8')]('/describe',auth[_0x25d4('0x9')](),controller['describe']);router[_0x25d4('0x8')]('/:id',auth[_0x25d4('0x9')](),controller[_0x25d4('0xb')]);router[_0x25d4('0x8')](_0x25d4('0xc'),auth[_0x25d4('0x9')](),controller['getDispositions']);router['get'](_0x25d4('0xd'),auth['isAuthenticated'](),controller[_0x25d4('0xe')]);router[_0x25d4('0x8')](_0x25d4('0xf'),auth[_0x25d4('0x9')](),controller['getContactsCsv']);router[_0x25d4('0x8')](_0x25d4('0x10'),auth[_0x25d4('0x9')](),controller[_0x25d4('0x11')]);router['get']('/:id/users',auth[_0x25d4('0x9')](),controller['getAgents']);router[_0x25d4('0x12')]('/',auth[_0x25d4('0x9')](),controller[_0x25d4('0x13')]);router[_0x25d4('0x12')](_0x25d4('0xc'),auth[_0x25d4('0x9')](),controller[_0x25d4('0x14')]);router[_0x25d4('0x12')](_0x25d4('0xd'),auth[_0x25d4('0x9')](),controller[_0x25d4('0x15')]);router[_0x25d4('0x12')]('/:id/fields',auth[_0x25d4('0x9')](),controller['addCustomField']);router[_0x25d4('0x12')]('/:id/users',auth[_0x25d4('0x9')](),controller[_0x25d4('0x16')]);router[_0x25d4('0x17')]('/:id',auth[_0x25d4('0x9')](),controller['update']);router[_0x25d4('0x18')]('/:id',auth[_0x25d4('0x9')](),controller[_0x25d4('0x19')]);router['delete'](_0x25d4('0xc'),auth[_0x25d4('0x9')](),controller[_0x25d4('0x1a')]);router[_0x25d4('0x18')](_0x25d4('0x1b'),auth['isAuthenticated'](),controller[_0x25d4('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 752a391..095ff90 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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x51225d,_0x3ca890){var _0x25860a=function(_0x434ea6){while(--_0x434ea6){_0x51225d['push'](_0x51225d['shift']());}};_0x25860a(++_0x3ca890);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x47586a,_0x107b0b){var _0x49f800=function(_0x575a53){while(--_0x575a53){_0x47586a['push'](_0x47586a['shift']());}};_0x49f800(++_0x107b0b);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 889600d..f8933b3 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 _0xdf4d=['../../config/utils','../../mysqldb','end','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','Condition','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdf4d,0xcb));var _0xddf4=function(_0x114e1d,_0xeda681){_0x114e1d=_0x114e1d-0x0;var _0x4a2043=_0xdf4d[_0x114e1d];return _0x4a2043;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xddf4('0x0'));var rimraf=require(_0xddf4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xddf4('0x2'));var rp=require(_0xddf4('0x3'));var moment=require(_0xddf4('0x4'));var BPromise=require(_0xddf4('0x5'));var Mustache=require(_0xddf4('0x6'));var util=require(_0xddf4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xddf4('0x8'));var ejs=require(_0xddf4('0x9'));var fs=require('fs');var _=require(_0xddf4('0xa'));var squel=require(_0xddf4('0xb'));var crypto=require(_0xddf4('0xc'));var jsforce=require(_0xddf4('0xd'));var deskjs=require(_0xddf4('0xe'));var toCsv=require(_0xddf4('0x8'));var querystring=require(_0xddf4('0xf'));var Papa=require(_0xddf4('0x10'));var Redis=require(_0xddf4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xddf4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddf4('0x13'));var logger=require(_0xddf4('0x14'))(_0xddf4('0x15'));var utils=require(_0xddf4('0x16'));var config=require('../../config/environment');var db=require(_0xddf4('0x17'))['db'];function respondWithStatusCode(_0x32298b,_0x4dba63){_0x4dba63=_0x4dba63||0xcc;return function(_0x3cd0ec){if(_0x3cd0ec){return _0x32298b['sendStatus'](_0x4dba63);}return _0x32298b['status'](_0x4dba63)[_0xddf4('0x18')]();};}function respondWithResult(_0x4e83b2,_0x1d3773){_0x1d3773=_0x1d3773||0xc8;return function(_0x46316a){if(_0x46316a){return _0x4e83b2[_0xddf4('0x19')](_0x1d3773)[_0xddf4('0x1a')](_0x46316a);}};}function respondWithFilteredResult(_0x3ef3a1,_0x48412e){return function(_0x151b7b){if(_0x151b7b){var _0x5a8cba=_0x151b7b[_0xddf4('0x1b')],_0x13c576=_0x48412e[_0xddf4('0x1c')],_0x464288=_0x48412e[_0xddf4('0x1c')]+_0x48412e[_0xddf4('0x1d')],_0x111e2e;if(_0x464288>=_0x5a8cba){_0x464288=_0x5a8cba;_0x111e2e=0xc8;}else{_0x111e2e=0xce;}_0x3ef3a1['status'](_0x111e2e);return _0x3ef3a1['set'](_0xddf4('0x1e'),_0x13c576+'-'+_0x464288+'/'+_0x5a8cba)[_0xddf4('0x1a')](_0x151b7b);}return null;};}function patchUpdates(_0x545747){return function(_0x55ecd4){try{jsonpatch['apply'](_0x55ecd4,_0x545747,!![]);}catch(_0x361fc6){return BPromise[_0xddf4('0x1f')](_0x361fc6);}return _0x55ecd4[_0xddf4('0x20')]();};}function saveUpdates(_0x254c7a,_0x39e4c4){return function(_0x56ec8f){if(_0x56ec8f){return _0x56ec8f[_0xddf4('0x21')](_0x254c7a)['then'](function(_0x2e5f19){return _0x2e5f19;});}return null;};}function removeEntity(_0x36ce1a,_0x3a2e57){return function(_0x52d533){if(_0x52d533){return _0x52d533[_0xddf4('0x22')]()[_0xddf4('0x23')](function(){_0x36ce1a[_0xddf4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee748,_0x2a195d){return function(_0x149a0e){if(!_0x149a0e){_0x2ee748[_0xddf4('0x24')](0x194);}return _0x149a0e;};}function handleError(_0x321b6c,_0x44e751){_0x44e751=_0x44e751||0x1f4;return function(_0x33894c){logger[_0xddf4('0x25')](_0x33894c[_0xddf4('0x26')]);if(_0x33894c[_0xddf4('0x27')]){delete _0x33894c[_0xddf4('0x27')];}_0x321b6c['status'](_0x44e751)[_0xddf4('0x28')](_0x33894c);};}exports['update']=function(_0x17473c,_0x1d9edd){if(_0x17473c[_0xddf4('0x29')]['id']){delete _0x17473c[_0xddf4('0x29')]['id'];}return db[_0xddf4('0x2a')][_0xddf4('0x2b')]({'where':{'id':_0x17473c[_0xddf4('0x2c')]['id']}})[_0xddf4('0x23')](handleEntityNotFound(_0x1d9edd,null))[_0xddf4('0x23')](saveUpdates(_0x17473c[_0xddf4('0x29')],null))[_0xddf4('0x23')](respondWithResult(_0x1d9edd,null))['catch'](handleError(_0x1d9edd,null));};exports['destroy']=function(_0x5980f7,_0x3c5670){return db['Condition'][_0xddf4('0x2b')]({'where':{'id':_0x5980f7[_0xddf4('0x2c')]['id']}})[_0xddf4('0x23')](handleEntityNotFound(_0x3c5670,null))[_0xddf4('0x23')](removeEntity(_0x3c5670,null))['catch'](handleError(_0x3c5670,null));}; \ No newline at end of file +var _0x84bc=['html-pdf','eml-format','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch'];(function(_0x2b9e79,_0x45b792){var _0x54b4cd=function(_0x500560){while(--_0x500560){_0x2b9e79['push'](_0x2b9e79['shift']());}};_0x54b4cd(++_0x45b792);}(_0x84bc,0x14d));var _0xc84b=function(_0x358224,_0x225ed6){_0x358224=_0x358224-0x0;var _0x17131d=_0x84bc[_0x358224];return _0x17131d;};'use strict';var pdf=require(_0xc84b('0x0'));var emlformat=require(_0xc84b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc84b('0x2'));var rp=require('request-promise');var moment=require(_0xc84b('0x3'));var BPromise=require(_0xc84b('0x4'));var Mustache=require('mustache');var util=require(_0xc84b('0x5'));var path=require(_0xc84b('0x6'));var sox=require(_0xc84b('0x7'));var csv=require(_0xc84b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc84b('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc84b('0xa'));var toCsv=require(_0xc84b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc84b('0xb'));var as=require(_0xc84b('0xc'));var hardwareService=require(_0xc84b('0xd'));var logger=require('../../config/logger')(_0xc84b('0xe'));var utils=require('../../config/utils');var config=require(_0xc84b('0xf'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4334ce,_0x27276d){_0x27276d=_0x27276d||0xcc;return function(_0x11dc98){if(_0x11dc98){return _0x4334ce[_0xc84b('0x10')](_0x27276d);}return _0x4334ce[_0xc84b('0x11')](_0x27276d)['end']();};}function respondWithResult(_0x1ad94e,_0x140e9f){_0x140e9f=_0x140e9f||0xc8;return function(_0x238ee7){if(_0x238ee7){return _0x1ad94e[_0xc84b('0x11')](_0x140e9f)[_0xc84b('0x12')](_0x238ee7);}};}function respondWithFilteredResult(_0x276c66,_0x4b8c9b){return function(_0x19cb95){if(_0x19cb95){var _0x323ac1=_0x19cb95[_0xc84b('0x13')],_0x2b6610=_0x4b8c9b[_0xc84b('0x14')],_0x1ee3aa=_0x4b8c9b['offset']+_0x4b8c9b[_0xc84b('0x15')],_0x5006f2;if(_0x1ee3aa>=_0x323ac1){_0x1ee3aa=_0x323ac1;_0x5006f2=0xc8;}else{_0x5006f2=0xce;}_0x276c66[_0xc84b('0x11')](_0x5006f2);return _0x276c66[_0xc84b('0x16')](_0xc84b('0x17'),_0x2b6610+'-'+_0x1ee3aa+'/'+_0x323ac1)[_0xc84b('0x12')](_0x19cb95);}return null;};}function patchUpdates(_0x6370b){return function(_0x12c2ec){try{jsonpatch[_0xc84b('0x18')](_0x12c2ec,_0x6370b,!![]);}catch(_0x330b13){return BPromise[_0xc84b('0x19')](_0x330b13);}return _0x12c2ec[_0xc84b('0x1a')]();};}function saveUpdates(_0x514fca,_0x424429){return function(_0x324a75){if(_0x324a75){return _0x324a75['update'](_0x514fca)[_0xc84b('0x1b')](function(_0x57f1d1){return _0x57f1d1;});}return null;};}function removeEntity(_0x3152c4,_0x5d3cb2){return function(_0x4c81b0){if(_0x4c81b0){return _0x4c81b0[_0xc84b('0x1c')]()['then'](function(){_0x3152c4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x502f22,_0x3198cf){return function(_0xfe66c4){if(!_0xfe66c4){_0x502f22[_0xc84b('0x10')](0x194);}return _0xfe66c4;};}function handleError(_0x57c85e,_0x438139){_0x438139=_0x438139||0x1f4;return function(_0x26026){logger[_0xc84b('0x1d')](_0x26026['stack']);if(_0x26026[_0xc84b('0x1e')]){delete _0x26026[_0xc84b('0x1e')];}_0x57c85e[_0xc84b('0x11')](_0x438139)[_0xc84b('0x1f')](_0x26026);};}exports[_0xc84b('0x20')]=function(_0x1910fc,_0x3252a8){if(_0x1910fc[_0xc84b('0x21')]['id']){delete _0x1910fc[_0xc84b('0x21')]['id'];}return db[_0xc84b('0x22')][_0xc84b('0x23')]({'where':{'id':_0x1910fc['params']['id']}})[_0xc84b('0x1b')](handleEntityNotFound(_0x3252a8,null))['then'](saveUpdates(_0x1910fc[_0xc84b('0x21')],null))[_0xc84b('0x1b')](respondWithResult(_0x3252a8,null))[_0xc84b('0x24')](handleError(_0x3252a8,null));};exports[_0xc84b('0x1c')]=function(_0x37ab11,_0x19ce7e){return db[_0xc84b('0x22')][_0xc84b('0x23')]({'where':{'id':_0x37ab11['params']['id']}})[_0xc84b('0x1b')](handleEntityNotFound(_0x19ce7e,null))[_0xc84b('0x1b')](removeEntity(_0x19ce7e,null))[_0xc84b('0x24')](handleError(_0x19ce7e,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 266e735..a727c4e 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 _0x182e=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash'];(function(_0x3c0765,_0x28c42f){var _0xd83b55=function(_0x1e6325){while(--_0x1e6325){_0x3c0765['push'](_0x3c0765['shift']());}};_0xd83b55(++_0x28c42f);}(_0x182e,0xf1));var _0xe182=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x182e[_0xd22d95];return _0x15d7a3;};'use strict';var _=require(_0xe182('0x0'));var util=require(_0xe182('0x1'));var logger=require(_0xe182('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe182('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe182('0x4'));var rimraf=require(_0xe182('0x5'));var config=require(_0xe182('0x6'));var attributes=require(_0xe182('0x7'));module[_0xe182('0x8')]=function(_0x1feb05,_0x173ec1){return _0x1feb05['define'](_0xe182('0x9'),attributes,{'tableName':_0xe182('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37a4=['moment','bluebird','request-promise','path','rimraf','./condition.attributes','exports','define','Condition','tools_conditions','lodash','../../config/logger','api'];(function(_0x316515,_0x133d8f){var _0x4fd9e5=function(_0x5e52b8){while(--_0x5e52b8){_0x316515['push'](_0x316515['shift']());}};_0x4fd9e5(++_0x133d8f);}(_0x37a4,0xa6));var _0x437a=function(_0x1ca40e,_0x5078b2){_0x1ca40e=_0x1ca40e-0x0;var _0x71a463=_0x37a4[_0x1ca40e];return _0x71a463;};'use strict';var _=require(_0x437a('0x0'));var util=require('util');var logger=require(_0x437a('0x1'))(_0x437a('0x2'));var moment=require(_0x437a('0x3'));var BPromise=require(_0x437a('0x4'));var rp=require(_0x437a('0x5'));var fs=require('fs');var path=require(_0x437a('0x6'));var rimraf=require(_0x437a('0x7'));var config=require('../../config/environment');var attributes=require(_0x437a('0x8'));module[_0x437a('0x9')]=function(_0x178445,_0x14249d){return _0x178445[_0x437a('0xa')](_0x437a('0xb'),attributes,{'tableName':_0x437a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 7e4b73f..c86e5b2 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 _0x3d70=['result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','code','Condition,\x20%s,\x20%s','error','message'];(function(_0x2958c3,_0x3d51ec){var _0x4b35dc=function(_0x522aec){while(--_0x522aec){_0x2958c3['push'](_0x2958c3['shift']());}};_0x4b35dc(++_0x3d51ec);}(_0x3d70,0x1ba));var _0x03d7=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x3d70[_0x48326a];return _0x466709;};'use strict';var _=require(_0x03d7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x03d7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03d7('0x2'));var db=require(_0x03d7('0x3'))['db'];var utils=require(_0x03d7('0x4'));var logger=require(_0x03d7('0x5'))(_0x03d7('0x6'));var config=require(_0x03d7('0x7'));var jayson=require(_0x03d7('0x8'));var client=jayson[_0x03d7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d5947,_0xb48dfe,_0x18255c){return new BPromise(function(_0x1752c4,_0x2dce1c){return client[_0x03d7('0xa')](_0x1d5947,_0x18255c)[_0x03d7('0xb')](function(_0x4e5049){logger[_0x03d7('0xc')]('Condition,\x20%s,\x20%s',_0xb48dfe,_0x03d7('0xd'));logger['debug'](_0x03d7('0xe'),_0xb48dfe,_0x03d7('0xd'),JSON[_0x03d7('0xf')](_0x4e5049));if(_0x4e5049['error']){if(_0x4e5049['error'][_0x03d7('0x10')]===0x1f4){logger['error'](_0x03d7('0x11'),_0xb48dfe,_0x4e5049[_0x03d7('0x12')][_0x03d7('0x13')]);return _0x2dce1c(_0x4e5049['error'][_0x03d7('0x13')]);}logger[_0x03d7('0x12')](_0x03d7('0x11'),_0xb48dfe,_0x4e5049[_0x03d7('0x12')][_0x03d7('0x13')]);return _0x1752c4(_0x4e5049[_0x03d7('0x12')]['message']);}else{logger[_0x03d7('0xc')](_0x03d7('0x11'),_0xb48dfe,_0x03d7('0xd'));_0x1752c4(_0x4e5049[_0x03d7('0x14')]['message']);}})['catch'](function(_0x47ae68){logger[_0x03d7('0x12')]('Condition,\x20%s,\x20%s',_0xb48dfe,_0x47ae68);_0x2dce1c(_0x47ae68);});});} \ No newline at end of file +var _0x9471=['lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x1cc5e0,_0x315a2f){var _0x5abc73=function(_0xa68dee){while(--_0xa68dee){_0x1cc5e0['push'](_0x1cc5e0['shift']());}};_0x5abc73(++_0x315a2f);}(_0x9471,0x1b5));var _0x1947=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9471[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1947('0x0'));var util=require(_0x1947('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1947('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1947('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1947('0x4'))(_0x1947('0x5'));var config=require(_0x1947('0x6'));var jayson=require(_0x1947('0x7'));var client=jayson[_0x1947('0x8')][_0x1947('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xce2fff,_0x24ce00,_0x51707b){return new BPromise(function(_0x2c94c7,_0x2e627e){return client['request'](_0xce2fff,_0x51707b)[_0x1947('0xa')](function(_0xdb15a6){logger[_0x1947('0xb')](_0x1947('0xc'),_0x24ce00,_0x1947('0xd'));logger['debug'](_0x1947('0xe'),_0x24ce00,_0x1947('0xd'),JSON[_0x1947('0xf')](_0xdb15a6));if(_0xdb15a6[_0x1947('0x10')]){if(_0xdb15a6[_0x1947('0x10')]['code']===0x1f4){logger[_0x1947('0x10')]('Condition,\x20%s,\x20%s',_0x24ce00,_0xdb15a6[_0x1947('0x10')][_0x1947('0x11')]);return _0x2e627e(_0xdb15a6['error'][_0x1947('0x11')]);}logger[_0x1947('0x10')](_0x1947('0xc'),_0x24ce00,_0xdb15a6[_0x1947('0x10')][_0x1947('0x11')]);return _0x2c94c7(_0xdb15a6[_0x1947('0x10')][_0x1947('0x11')]);}else{logger['info']('Condition,\x20%s,\x20%s',_0x24ce00,_0x1947('0xd'));_0x2c94c7(_0xdb15a6[_0x1947('0x12')][_0x1947('0x11')]);}})['catch'](function(_0x4e5041){logger['error'](_0x1947('0xc'),_0x24ce00,_0x4e5041);_0x2e627e(_0x4e5041);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index fdffaa7..9e8d5c1 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 _0xbbc7=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x242beb,_0x1c0af8){var _0x1a6e8f=function(_0x44d480){while(--_0x44d480){_0x242beb['push'](_0x242beb['shift']());}};_0x1a6e8f(++_0x1c0af8);}(_0xbbc7,0x1e2));var _0x7bbc=function(_0x3e9a20,_0x1ed7e9){_0x3e9a20=_0x3e9a20-0x0;var _0x45d1b4=_0xbbc7[_0x3e9a20];return _0x45d1b4;};'use strict';var multer=require('multer');var util=require(_0x7bbc('0x0'));var path=require(_0x7bbc('0x1'));var timeout=require(_0x7bbc('0x2'));var express=require('express');var router=express[_0x7bbc('0x3')]();var auth=require(_0x7bbc('0x4'));var interaction=require(_0x7bbc('0x5'));var config=require(_0x7bbc('0x6'));var controller=require(_0x7bbc('0x7'));router[_0x7bbc('0x8')](_0x7bbc('0x9'),auth[_0x7bbc('0xa')](),controller[_0x7bbc('0xb')]);router['delete'](_0x7bbc('0x9'),auth[_0x7bbc('0xa')](),controller['destroy']);module[_0x7bbc('0xc')]=router; \ No newline at end of file +var _0xaff6=['update','delete','/:id','isAuthenticated','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put'];(function(_0x4101ab,_0x1777e6){var _0x4eaf40=function(_0x494db7){while(--_0x494db7){_0x4101ab['push'](_0x4101ab['shift']());}};_0x4eaf40(++_0x1777e6);}(_0xaff6,0xd8));var _0x6aff=function(_0x1ee7e4,_0x4ba132){_0x1ee7e4=_0x1ee7e4-0x0;var _0x4a99aa=_0xaff6[_0x1ee7e4];return _0x4a99aa;};'use strict';var multer=require(_0x6aff('0x0'));var util=require(_0x6aff('0x1'));var path=require(_0x6aff('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6aff('0x3')]();var auth=require(_0x6aff('0x4'));var interaction=require(_0x6aff('0x5'));var config=require('../../config/environment');var controller=require(_0x6aff('0x6'));router[_0x6aff('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6aff('0x8')]);router[_0x6aff('0x9')](_0x6aff('0xa'),auth[_0x6aff('0xb')](),controller[_0x6aff('0xc')]);module[_0x6aff('0xd')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 17f8ce8..8069620 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 _0x4745=['exports','STRING','name','sequelize'];(function(_0x37f3ad,_0x2216fd){var _0x23e35a=function(_0x31f6a0){while(--_0x31f6a0){_0x37f3ad['push'](_0x37f3ad['shift']());}};_0x23e35a(++_0x2216fd);}(_0x4745,0x1e7));var _0x5474=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4745[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x5474('0x0'));module[_0x5474('0x1')]={'name':{'type':Sequelize[_0x5474('0x2')],'allowNull':![],'unique':_0x5474('0x3')},'description':{'type':Sequelize[_0x5474('0x2')]}}; \ No newline at end of file +var _0x3c94=['name','sequelize','exports','STRING'];(function(_0x55b8c2,_0x2d5624){var _0x2ad5fc=function(_0x112477){while(--_0x112477){_0x55b8c2['push'](_0x55b8c2['shift']());}};_0x2ad5fc(++_0x2d5624);}(_0x3c94,0xcd));var _0x43c9=function(_0x500812,_0x296a3c){_0x500812=_0x500812-0x0;var _0x4add02=_0x3c94[_0x500812];return _0x4add02;};'use strict';var Sequelize=require(_0x43c9('0x0'));module[_0x43c9('0x1')]={'name':{'type':Sequelize[_0x43c9('0x2')],'allowNull':![],'unique':_0x43c9('0x3')},'description':{'type':Sequelize[_0x43c9('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 01c3df3..7a57e68 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 _0x22fb=['options','includeAll','rows','catch','params','fields','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','user','find','userProfileId','autoAssociation','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','pick','getItems','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','localhost','socket.io-emitter','redis','./dashboard.socket','register','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','sendStatus','error','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0x22fb,0x192));var _0xb22f=function(_0x3f7a09,_0x5bd324){_0x3f7a09=_0x3f7a09-0x0;var _0x3477d6=_0x22fb[_0x3f7a09];return _0x3477d6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb22f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb22f('0x1'));var rp=require(_0xb22f('0x2'));var moment=require(_0xb22f('0x3'));var BPromise=require(_0xb22f('0x4'));var Mustache=require(_0xb22f('0x5'));var util=require('util');var path=require(_0xb22f('0x6'));var sox=require(_0xb22f('0x7'));var csv=require(_0xb22f('0x8'));var ejs=require(_0xb22f('0x9'));var fs=require('fs');var _=require(_0xb22f('0xa'));var squel=require(_0xb22f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb22f('0xc'));var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x8'));var querystring=require(_0xb22f('0xe'));var Papa=require(_0xb22f('0xf'));var Redis=require(_0xb22f('0x10'));var authService=require(_0xb22f('0x11'));var qs=require(_0xb22f('0x12'));var as=require(_0xb22f('0x13'));var hardwareService=require(_0xb22f('0x14'));var logger=require(_0xb22f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb22f('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb22f('0x17'),'port':0x18eb});var socket=require(_0xb22f('0x18'))(new Redis(config[_0xb22f('0x19')]));require(_0xb22f('0x1a'))[_0xb22f('0x1b')](socket);function respondWithStatusCode(_0x32d796,_0x5c6ccf){_0x5c6ccf=_0x5c6ccf||0xcc;return function(_0x318a39){if(_0x318a39){return _0x32d796['sendStatus'](_0x5c6ccf);}return _0x32d796[_0xb22f('0x1c')](_0x5c6ccf)['end']();};}function respondWithResult(_0x2187fc,_0x514a8f){_0x514a8f=_0x514a8f||0xc8;return function(_0x160417){if(_0x160417){return _0x2187fc[_0xb22f('0x1c')](_0x514a8f)[_0xb22f('0x1d')](_0x160417);}};}function respondWithFilteredResult(_0x538da0,_0x1530f7){return function(_0x53a59b){if(_0x53a59b){var _0x252742=_0x53a59b[_0xb22f('0x1e')],_0x35caec=_0x1530f7[_0xb22f('0x1f')],_0x2aaec4=_0x1530f7['offset']+_0x1530f7[_0xb22f('0x20')],_0x1f515d;if(_0x2aaec4>=_0x252742){_0x2aaec4=_0x252742;_0x1f515d=0xc8;}else{_0x1f515d=0xce;}_0x538da0['status'](_0x1f515d);return _0x538da0[_0xb22f('0x21')](_0xb22f('0x22'),_0x35caec+'-'+_0x2aaec4+'/'+_0x252742)[_0xb22f('0x1d')](_0x53a59b);}return null;};}function patchUpdates(_0x2239b8){return function(_0x493a63){try{jsonpatch['apply'](_0x493a63,_0x2239b8,!![]);}catch(_0x47d5cf){return BPromise[_0xb22f('0x23')](_0x47d5cf);}return _0x493a63[_0xb22f('0x24')]();};}function saveUpdates(_0xf34e0d,_0x16e465){return function(_0x39c05a){if(_0x39c05a){return _0x39c05a[_0xb22f('0x25')](_0xf34e0d)[_0xb22f('0x26')](function(_0x286465){return _0x286465;});}return null;};}function removeEntity(_0x583fbe,_0x482b3a){return function(_0x3ab1d8){if(_0x3ab1d8){return _0x3ab1d8[_0xb22f('0x27')]()['then'](function(){var _0x3aa0dd=_0x3ab1d8[_0xb22f('0x28')]({'plain':!![]});var _0x4f2986=_0xb22f('0x29');return db[_0xb22f('0x2a')]['destroy']({'where':{'type':_0x4f2986,'resourceId':_0x3aa0dd['id']}})[_0xb22f('0x26')](function(){return _0x3ab1d8;});})[_0xb22f('0x26')](function(){_0x583fbe[_0xb22f('0x1c')](0xcc)[_0xb22f('0x2b')]();});}};}function handleEntityNotFound(_0x3bf205,_0x246a0c){return function(_0x439fc2){if(!_0x439fc2){_0x3bf205[_0xb22f('0x2c')](0x194);}return _0x439fc2;};}function handleError(_0x4ce9af,_0x483cc3){_0x483cc3=_0x483cc3||0x1f4;return function(_0x5d86a1){logger[_0xb22f('0x2d')](_0x5d86a1['stack']);if(_0x5d86a1[_0xb22f('0x2e')]){delete _0x5d86a1[_0xb22f('0x2e')];}_0x4ce9af[_0xb22f('0x1c')](_0x483cc3)[_0xb22f('0x2f')](_0x5d86a1);};}exports[_0xb22f('0x30')]=function(_0x5b2a42,_0x519034){var _0x435690={},_0x12c042={},_0x319e56={'count':0x0,'rows':[]};var _0xe9bb83=_['map'](db[_0xb22f('0x31')][_0xb22f('0x32')],function(_0x58f560){return{'name':_0x58f560[_0xb22f('0x33')],'type':_0x58f560[_0xb22f('0x34')][_0xb22f('0x35')]};});_0x12c042[_0xb22f('0x36')]=_[_0xb22f('0x37')](_0xe9bb83,'name');_0x12c042['query']=_[_0xb22f('0x38')](_0x5b2a42[_0xb22f('0x39')]);_0x12c042[_0xb22f('0x3a')]=_[_0xb22f('0x3b')](_0x12c042[_0xb22f('0x36')],_0x12c042[_0xb22f('0x39')]);_0x435690[_0xb22f('0x3c')]=_[_0xb22f('0x3b')](_0x12c042[_0xb22f('0x36')],qs['fields'](_0x5b2a42[_0xb22f('0x39')]['fields']));_0x435690['attributes']=_0x435690[_0xb22f('0x3c')][_0xb22f('0x3d')]?_0x435690[_0xb22f('0x3c')]:_0x12c042[_0xb22f('0x36')];if(!_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x3e')](_0xb22f('0x3f'))){_0x435690[_0xb22f('0x20')]=qs[_0xb22f('0x20')](_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x20')]);_0x435690[_0xb22f('0x1f')]=qs[_0xb22f('0x1f')](_0x5b2a42['query']['offset']);}_0x435690[_0xb22f('0x40')]=qs[_0xb22f('0x41')](_0x5b2a42[_0xb22f('0x39')]['sort']);_0x435690[_0xb22f('0x42')]=qs[_0xb22f('0x3a')](_['pick'](_0x5b2a42['query'],_0x12c042[_0xb22f('0x3a')]));if(_0x5b2a42['query'][_0xb22f('0x43')]){_0x435690['where']=_[_0xb22f('0x44')](_0x435690[_0xb22f('0x42')],{'$or':_[_0xb22f('0x37')](_0xe9bb83,function(_0x52a3c7){if(_0x52a3c7[_0xb22f('0x34')]!==_0xb22f('0x45')){var _0x2c2a72={};_0x2c2a72[_0x52a3c7['name']]={'$like':'%'+_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x43')]+'%'};return _0x2c2a72;}})});}_0x435690=_[_0xb22f('0x44')]({},_0x435690,_0x5b2a42[_0xb22f('0x46')]);var _0x4133ea={'where':_0x435690[_0xb22f('0x42')]};return db[_0xb22f('0x31')][_0xb22f('0x1e')](_0x4133ea)[_0xb22f('0x26')](function(_0x42e834){_0x319e56['count']=_0x42e834;if(_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x47')]){_0x435690['include']=[{'all':!![]}];}return db[_0xb22f('0x31')]['findAll'](_0x435690);})['then'](function(_0x2ccbba){_0x319e56[_0xb22f('0x48')]=_0x2ccbba;return _0x319e56;})[_0xb22f('0x26')](respondWithFilteredResult(_0x519034,_0x435690))[_0xb22f('0x49')](handleError(_0x519034,null));};exports['show']=function(_0x1475d1,_0x572a0c){var _0xddfda6={'raw':![],'where':{'id':_0x1475d1[_0xb22f('0x4a')]['id']}},_0x3043ed={};_0x3043ed[_0xb22f('0x36')]=_[_0xb22f('0x38')](db[_0xb22f('0x31')]['rawAttributes']);_0x3043ed[_0xb22f('0x39')]=_['keys'](_0x1475d1[_0xb22f('0x39')]);_0x3043ed[_0xb22f('0x3a')]=_['intersection'](_0x3043ed[_0xb22f('0x36')],_0x3043ed[_0xb22f('0x39')]);_0xddfda6['attributes']=_['intersection'](_0x3043ed[_0xb22f('0x36')],qs['fields'](_0x1475d1[_0xb22f('0x39')][_0xb22f('0x4b')]));_0xddfda6[_0xb22f('0x3c')]=_0xddfda6[_0xb22f('0x3c')]['length']?_0xddfda6[_0xb22f('0x3c')]:_0x3043ed[_0xb22f('0x36')];if(_0x1475d1['query'][_0xb22f('0x47')]){_0xddfda6[_0xb22f('0x4c')]=[{'all':!![]}];}_0xddfda6=_[_0xb22f('0x44')]({},_0xddfda6,_0x1475d1[_0xb22f('0x46')]);return db[_0xb22f('0x31')]['find'](_0xddfda6)[_0xb22f('0x26')](handleEntityNotFound(_0x572a0c,null))['then'](respondWithResult(_0x572a0c,null))['catch'](handleError(_0x572a0c,null));};exports[_0xb22f('0x4d')]=function(_0x90eef9,_0x203ff2){return db[_0xb22f('0x31')][_0xb22f('0x4d')](_0x90eef9['body'],{})[_0xb22f('0x26')](function(_0x504511){var _0x2d9683=_0x90eef9['user'][_0xb22f('0x28')]({'plain':!![]});if(!_0x2d9683)throw new Error(_0xb22f('0x4e'));if(_0x2d9683[_0xb22f('0x4f')]==='user'){var _0x299156=_0x504511[_0xb22f('0x28')]({'plain':!![]});var _0x57bca4=_0xb22f('0x29');return db[_0xb22f('0x50')]['find']({'where':{'name':_0x57bca4,'userProfileId':_0x2d9683['userProfileId']},'raw':!![]})[_0xb22f('0x26')](function(_0x1a847d){if(_0x1a847d&&_0x1a847d['autoAssociation']===0x0){return db[_0xb22f('0x2a')][_0xb22f('0x4d')]({'name':_0x299156['name'],'resourceId':_0x299156['id'],'type':_0x1a847d['name'],'sectionId':_0x1a847d['id']},{})[_0xb22f('0x26')](function(){return _0x504511;});}else{return _0x504511;}})[_0xb22f('0x49')](function(_0x4c18d3){logger[_0xb22f('0x2d')](_0xb22f('0x51'),_0x4c18d3);throw _0x4c18d3;});}return _0x504511;})[_0xb22f('0x26')](respondWithResult(_0x203ff2,0xc9))[_0xb22f('0x49')](handleError(_0x203ff2,null));};exports['clone']=function(_0x30039a,_0x2b7922){var _0x49b87d={'where':{'id':_0x30039a[_0xb22f('0x4a')]['id']}},_0x501042={};_0x501042[_0xb22f('0x36')]=_[_0xb22f('0x38')](db[_0xb22f('0x31')]['rawAttributes']);_0x49b87d[_0xb22f('0x3c')]=_[_0xb22f('0x3b')](_0x501042['model'],qs[_0xb22f('0x4b')](_0x30039a[_0xb22f('0x39')][_0xb22f('0x4b')]));_0x49b87d[_0xb22f('0x3c')]=_0x49b87d[_0xb22f('0x3c')][_0xb22f('0x3d')]?_0x49b87d[_0xb22f('0x3c')]:_0x501042['model'];if(_0x30039a[_0xb22f('0x39')][_0xb22f('0x47')]){_0x49b87d[_0xb22f('0x4c')]=[{'all':!![]}];}_0x49b87d=_[_0xb22f('0x44')]({},_0x49b87d,_0x30039a[_0xb22f('0x46')]);return db['Dashboard']['find'](_0x49b87d)[_0xb22f('0x26')](handleEntityNotFound(_0x2b7922,null))[_0xb22f('0x26')](function(_0x14df74){if(_0x14df74){var _0x4fbc63=_0x14df74[_0xb22f('0x28')]({'plain':!![]});_0x4fbc63=qs[_0xb22f('0x52')](_0x4fbc63,['id',_0xb22f('0x53'),_0xb22f('0x54')]);_0x30039a[_0xb22f('0x55')]=_[_0xb22f('0x52')](_0x30039a[_0xb22f('0x55')],['id',_0xb22f('0x53'),'updatedAt']);return db['Dashboard'][_0xb22f('0x4d')](_[_0xb22f('0x44')](_0x4fbc63,_0x30039a['body']),{'include':_0x30039a['query'][_0xb22f('0x47')]?[{'all':!![]}]:undefined})[_0xb22f('0x26')](function(_0x59727a){var _0x5796ea=_0x30039a[_0xb22f('0x56')]['get']({'plain':!![]});if(!_0x5796ea)throw new Error(_0xb22f('0x4e'));if(_0x5796ea[_0xb22f('0x4f')]===_0xb22f('0x56')){var _0x50e874=_0x59727a['get']({'plain':!![]});var _0x14db56='CustomDashboards';return db[_0xb22f('0x50')][_0xb22f('0x57')]({'where':{'name':_0x14db56,'userProfileId':_0x5796ea[_0xb22f('0x58')]},'raw':!![]})['then'](function(_0x55fdf1){if(_0x55fdf1&&_0x55fdf1[_0xb22f('0x59')]===0x0){return db['UserProfileResource'][_0xb22f('0x4d')]({'name':_0x50e874[_0xb22f('0x2e')],'resourceId':_0x50e874['id'],'type':_0x55fdf1[_0xb22f('0x2e')],'sectionId':_0x55fdf1['id']},{})['then'](function(){return _0x59727a;});}else{return _0x59727a;}})[_0xb22f('0x49')](function(_0x497238){logger[_0xb22f('0x2d')](_0xb22f('0x51'),_0x497238);throw _0x497238;});}return _0x59727a;});}})[_0xb22f('0x26')](respondWithResult(_0x2b7922,0xc9))[_0xb22f('0x49')](handleError(_0x2b7922,null));};exports[_0xb22f('0x25')]=function(_0x1558e1,_0x3fe96f){if(_0x1558e1[_0xb22f('0x55')]['id']){delete _0x1558e1[_0xb22f('0x55')]['id'];}return db['Dashboard'][_0xb22f('0x57')]({'where':{'id':_0x1558e1[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x3fe96f,null))['then'](saveUpdates(_0x1558e1[_0xb22f('0x55')],null))[_0xb22f('0x26')](respondWithResult(_0x3fe96f,null))[_0xb22f('0x49')](handleError(_0x3fe96f,null));};exports[_0xb22f('0x27')]=function(_0x492280,_0x4c79d6){return db[_0xb22f('0x31')]['find']({'where':{'id':_0x492280[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x4c79d6,null))[_0xb22f('0x26')](removeEntity(_0x4c79d6,null))[_0xb22f('0x49')](handleError(_0x4c79d6,null));};function widgetAttributes(_0x29c533){try{switch(_0x29c533[_0xb22f('0x34')]){case _0xb22f('0x5a'):return[{'name':_0xb22f('0x5b'),'value':_0x29c533[_0xb22f('0x5b')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||'https://'}];case _0xb22f('0x5e'):return[{'name':_0xb22f('0x5f'),'value':_0x29c533[_0xb22f('0x5f')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||''}];case _0xb22f('0x60'):return[{'name':_0xb22f('0x61'),'value':_0x29c533[_0xb22f('0x61')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xb22f('0x62'),'value':_0x29c533[_0xb22f('0x62')]||(_0x29c533['attrs']&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533[_0xb22f('0x5c')][0x1]['value']:undefined)||_0xb22f('0x63')},{'name':_0xb22f('0x64'),'value':_0x29c533[_0xb22f('0x64')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x2]?_0x29c533['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xb22f('0x65'),'value':_0x29c533[_0xb22f('0x65')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533['attrs'][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||'total'},{'name':_0xb22f('0x66'),'value':_0x29c533[_0xb22f('0x66')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533[_0xb22f('0x5c')][0x1][_0xb22f('0x5d')]:undefined)||[]},{'name':_0xb22f('0x64'),'value':_0x29c533[_0xb22f('0x64')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x2]?_0x29c533['attrs'][0x2][_0xb22f('0x5d')]:undefined)||0x14}];case _0xb22f('0x67'):case _0xb22f('0x68'):return[{'name':_0xb22f('0x69'),'value':_0x29c533[_0xb22f('0x69')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533['attrs'][0x0][_0xb22f('0x5d')]:undefined)||_0xb22f('0x6a')},{'name':_0xb22f('0x6b'),'value':_0x29c533[_0xb22f('0x6b')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533['attrs'][0x1][_0xb22f('0x5d')]:undefined)||null},{'name':_0xb22f('0x6c'),'value':_0x29c533['attrSerie3']||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533['attrs'][0x2]?_0x29c533['attrs'][0x2]['value']:undefined)||null},{'name':_0xb22f('0x66'),'value':_0x29c533['attrVoiceQueues']||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533['attrs'][0x3]?_0x29c533['attrs'][0x3][_0xb22f('0x5d')]:undefined)||[]}];case _0xb22f('0x6d'):return[{'name':'attrReport','type':_0x29c533['reportType']||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533['attrs'][0x0][_0xb22f('0x34')]:undefined)||null,'value':_0x29c533['attrReport']||(_0x29c533['attrs']&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x29c533['attrRefresh']||(_0x29c533['attrs']&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533[_0xb22f('0x5c')][0x1][_0xb22f('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x2e37e8){logger['error'](_0xb22f('0x6e'),JSON[_0xb22f('0x6f')](_0x2e37e8));return[];}}exports[_0xb22f('0x70')]=function(_0x239c12,_0x280815,_0x4f6ad7){if(_0x239c12[_0xb22f('0x55')]['id']){delete _0x239c12['body']['id'];}return db['Dashboard'][_0xb22f('0x57')]({'where':{'id':_0x239c12[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x280815,null))['then'](function(_0x227fde){if(_0x227fde){_0x239c12[_0xb22f('0x55')][_0xb22f('0x71')]=_0x227fde['id'];_0x239c12[_0xb22f('0x55')][_0xb22f('0x5c')]=widgetAttributes(_0x239c12[_0xb22f('0x55')]);return db[_0xb22f('0x72')][_0xb22f('0x4d')](_0x239c12[_0xb22f('0x55')]);}})[_0xb22f('0x26')](respondWithResult(_0x280815,null))[_0xb22f('0x49')](handleError(_0x280815,null));};exports['getItems']=function(_0x4d6edd,_0x3c8b1e,_0x469050){var _0x56f6d6={};var _0x13df47={};var _0x21b8ce;var _0x102f85;return db[_0xb22f('0x31')][_0xb22f('0x73')]({'where':{'id':_0x4d6edd[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x3c8b1e,null))[_0xb22f('0x26')](function(_0x506eba){if(_0x506eba){_0x21b8ce=_0x506eba;_0x13df47[_0xb22f('0x36')]=_[_0xb22f('0x38')](db[_0xb22f('0x72')]['rawAttributes']);_0x13df47[_0xb22f('0x39')]=_[_0xb22f('0x38')](_0x4d6edd[_0xb22f('0x39')]);_0x13df47['filters']=_[_0xb22f('0x3b')](_0x13df47['model'],_0x13df47[_0xb22f('0x39')]);_0x56f6d6[_0xb22f('0x3c')]=_[_0xb22f('0x3b')](_0x13df47[_0xb22f('0x36')],qs[_0xb22f('0x4b')](_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x4b')]));_0x56f6d6[_0xb22f('0x3c')]=_0x56f6d6[_0xb22f('0x3c')]['length']?_0x56f6d6[_0xb22f('0x3c')]:_0x13df47[_0xb22f('0x36')];_0x56f6d6[_0xb22f('0x40')]=qs['sort'](_0x4d6edd[_0xb22f('0x39')]['sort']);_0x56f6d6['where']=qs['filters'](_[_0xb22f('0x74')](_0x4d6edd[_0xb22f('0x39')],_0x13df47[_0xb22f('0x3a')]));if(_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x43')]){_0x56f6d6[_0xb22f('0x42')]=_[_0xb22f('0x44')](_0x56f6d6['where'],{'$or':_[_0xb22f('0x37')](_0x56f6d6[_0xb22f('0x3c')],function(_0x1d9f3e){var _0x1fa410={};_0x1fa410[_0x1d9f3e]={'$like':'%'+_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x43')]+'%'};return _0x1fa410;})});}_0x56f6d6=_[_0xb22f('0x44')]({},_0x56f6d6,_0x4d6edd[_0xb22f('0x46')]);return _0x21b8ce['getItems'](_0x56f6d6);}})[_0xb22f('0x26')](function(_0x21cfef){if(_0x21cfef){_0x102f85=_0x21cfef[_0xb22f('0x3d')];if(!_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x3e')](_0xb22f('0x3f'))){_0x56f6d6[_0xb22f('0x20')]=qs[_0xb22f('0x20')](_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x20')]);_0x56f6d6[_0xb22f('0x1f')]=qs['offset'](_0x4d6edd[_0xb22f('0x39')]['offset']);}return _0x21b8ce[_0xb22f('0x75')](_0x56f6d6);}})[_0xb22f('0x26')](function(_0x5a6bc9){if(_0x5a6bc9){return _0x5a6bc9?{'count':_0x102f85,'rows':_0x5a6bc9}:null;}})['then'](respondWithResult(_0x3c8b1e,null))[_0xb22f('0x49')](handleError(_0x3c8b1e,null));}; \ No newline at end of file +var _0x7a28=['crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','where','options','Dashboard','includeAll','findAll','catch','show','params','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrRefresh','DashboardId','DashboardItem','findOne','pick','getItems','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','squel'];(function(_0x16689b,_0x208463){var _0x3ead5b=function(_0x10a8f5){while(--_0x10a8f5){_0x16689b['push'](_0x16689b['shift']());}};_0x3ead5b(++_0x208463);}(_0x7a28,0x1cd));var _0x87a2=function(_0x382929,_0x2b6f38){_0x382929=_0x382929-0x0;var _0x3463a0=_0x7a28[_0x382929];return _0x3463a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x87a2('0x0'));var rimraf=require(_0x87a2('0x1'));var zipdir=require(_0x87a2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x87a2('0x3'));var moment=require(_0x87a2('0x4'));var BPromise=require(_0x87a2('0x5'));var Mustache=require('mustache');var util=require(_0x87a2('0x6'));var path=require(_0x87a2('0x7'));var sox=require(_0x87a2('0x8'));var csv=require(_0x87a2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x87a2('0xa'));var crypto=require(_0x87a2('0xb'));var jsforce=require(_0x87a2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x87a2('0x9'));var querystring=require(_0x87a2('0xd'));var Papa=require(_0x87a2('0xe'));var Redis=require(_0x87a2('0xf'));var authService=require(_0x87a2('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x87a2('0x11'));var hardwareService=require(_0x87a2('0x12'));var logger=require(_0x87a2('0x13'))('api');var utils=require(_0x87a2('0x14'));var config=require(_0x87a2('0x15'));var db=require(_0x87a2('0x16'))['db'];config[_0x87a2('0x17')]=_['defaults'](config[_0x87a2('0x17')],{'host':_0x87a2('0x18'),'port':0x18eb});var socket=require(_0x87a2('0x19'))(new Redis(config[_0x87a2('0x17')]));require(_0x87a2('0x1a'))[_0x87a2('0x1b')](socket);function respondWithStatusCode(_0x53b229,_0x44d8a3){_0x44d8a3=_0x44d8a3||0xcc;return function(_0x137164){if(_0x137164){return _0x53b229[_0x87a2('0x1c')](_0x44d8a3);}return _0x53b229[_0x87a2('0x1d')](_0x44d8a3)[_0x87a2('0x1e')]();};}function respondWithResult(_0x4b8d3c,_0x256003){_0x256003=_0x256003||0xc8;return function(_0x2c56f8){if(_0x2c56f8){return _0x4b8d3c['status'](_0x256003)['json'](_0x2c56f8);}};}function respondWithFilteredResult(_0x29ba76,_0x3e10bd){return function(_0x5c378f){if(_0x5c378f){var _0x5551a2=_0x5c378f[_0x87a2('0x1f')],_0xade526=_0x3e10bd[_0x87a2('0x20')],_0x1e7bb2=_0x3e10bd[_0x87a2('0x20')]+_0x3e10bd[_0x87a2('0x21')],_0x19b514;if(_0x1e7bb2>=_0x5551a2){_0x1e7bb2=_0x5551a2;_0x19b514=0xc8;}else{_0x19b514=0xce;}_0x29ba76[_0x87a2('0x1d')](_0x19b514);return _0x29ba76[_0x87a2('0x22')](_0x87a2('0x23'),_0xade526+'-'+_0x1e7bb2+'/'+_0x5551a2)[_0x87a2('0x24')](_0x5c378f);}return null;};}function patchUpdates(_0x380b79){return function(_0x43fcbc){try{jsonpatch[_0x87a2('0x25')](_0x43fcbc,_0x380b79,!![]);}catch(_0x5038c4){return BPromise[_0x87a2('0x26')](_0x5038c4);}return _0x43fcbc[_0x87a2('0x27')]();};}function saveUpdates(_0x513cee,_0x56e9a1){return function(_0x49e97a){if(_0x49e97a){return _0x49e97a[_0x87a2('0x28')](_0x513cee)['then'](function(_0x3015c8){return _0x3015c8;});}return null;};}function removeEntity(_0x442e13,_0xecba14){return function(_0x43b991){if(_0x43b991){return _0x43b991['destroy']()[_0x87a2('0x29')](function(){var _0x58acbf=_0x43b991[_0x87a2('0x2a')]({'plain':!![]});var _0x4c63c2=_0x87a2('0x2b');return db[_0x87a2('0x2c')][_0x87a2('0x2d')]({'where':{'type':_0x4c63c2,'resourceId':_0x58acbf['id']}})[_0x87a2('0x29')](function(){return _0x43b991;});})['then'](function(){_0x442e13['status'](0xcc)[_0x87a2('0x1e')]();});}};}function handleEntityNotFound(_0x3aa9e3,_0x502864){return function(_0x4fec8e){if(!_0x4fec8e){_0x3aa9e3['sendStatus'](0x194);}return _0x4fec8e;};}function handleError(_0x562bf0,_0x500813){_0x500813=_0x500813||0x1f4;return function(_0x11ec7c){logger['error'](_0x11ec7c[_0x87a2('0x2e')]);if(_0x11ec7c[_0x87a2('0x2f')]){delete _0x11ec7c[_0x87a2('0x2f')];}_0x562bf0[_0x87a2('0x1d')](_0x500813)['send'](_0x11ec7c);};}exports[_0x87a2('0x30')]=function(_0x19e4f1,_0x3143b6){var _0x364ccc={},_0x17765c={},_0x51e7cc={'count':0x0,'rows':[]};var _0x26de25=_['map'](db['Dashboard'][_0x87a2('0x31')],function(_0x5e3faa){return{'name':_0x5e3faa[_0x87a2('0x32')],'type':_0x5e3faa[_0x87a2('0x33')][_0x87a2('0x34')]};});_0x17765c[_0x87a2('0x35')]=_[_0x87a2('0x36')](_0x26de25,_0x87a2('0x2f'));_0x17765c[_0x87a2('0x37')]=_[_0x87a2('0x38')](_0x19e4f1[_0x87a2('0x37')]);_0x17765c[_0x87a2('0x39')]=_[_0x87a2('0x3a')](_0x17765c[_0x87a2('0x35')],_0x17765c[_0x87a2('0x37')]);_0x364ccc[_0x87a2('0x3b')]=_[_0x87a2('0x3a')](_0x17765c[_0x87a2('0x35')],qs['fields'](_0x19e4f1[_0x87a2('0x37')][_0x87a2('0x3c')]));_0x364ccc[_0x87a2('0x3b')]=_0x364ccc[_0x87a2('0x3b')][_0x87a2('0x3d')]?_0x364ccc[_0x87a2('0x3b')]:_0x17765c[_0x87a2('0x35')];if(!_0x19e4f1[_0x87a2('0x37')][_0x87a2('0x3e')](_0x87a2('0x3f'))){_0x364ccc[_0x87a2('0x21')]=qs['limit'](_0x19e4f1[_0x87a2('0x37')][_0x87a2('0x21')]);_0x364ccc['offset']=qs[_0x87a2('0x20')](_0x19e4f1[_0x87a2('0x37')][_0x87a2('0x20')]);}_0x364ccc[_0x87a2('0x40')]=qs['sort'](_0x19e4f1[_0x87a2('0x37')][_0x87a2('0x41')]);_0x364ccc['where']=qs[_0x87a2('0x39')](_['pick'](_0x19e4f1[_0x87a2('0x37')],_0x17765c[_0x87a2('0x39')]));if(_0x19e4f1[_0x87a2('0x37')][_0x87a2('0x42')]){_0x364ccc['where']=_[_0x87a2('0x43')](_0x364ccc[_0x87a2('0x44')],{'$or':_[_0x87a2('0x36')](_0x26de25,function(_0x3ea8df){if(_0x3ea8df[_0x87a2('0x33')]!=='VIRTUAL'){var _0x406a91={};_0x406a91[_0x3ea8df[_0x87a2('0x2f')]]={'$like':'%'+_0x19e4f1['query'][_0x87a2('0x42')]+'%'};return _0x406a91;}})});}_0x364ccc=_[_0x87a2('0x43')]({},_0x364ccc,_0x19e4f1[_0x87a2('0x45')]);var _0x48f109={'where':_0x364ccc[_0x87a2('0x44')]};return db[_0x87a2('0x46')]['count'](_0x48f109)[_0x87a2('0x29')](function(_0x385c28){_0x51e7cc['count']=_0x385c28;if(_0x19e4f1['query'][_0x87a2('0x47')]){_0x364ccc['include']=[{'all':!![]}];}return db['Dashboard'][_0x87a2('0x48')](_0x364ccc);})[_0x87a2('0x29')](function(_0x436e79){_0x51e7cc['rows']=_0x436e79;return _0x51e7cc;})[_0x87a2('0x29')](respondWithFilteredResult(_0x3143b6,_0x364ccc))[_0x87a2('0x49')](handleError(_0x3143b6,null));};exports[_0x87a2('0x4a')]=function(_0xa82721,_0x1def7a){var _0x321601={'raw':![],'where':{'id':_0xa82721[_0x87a2('0x4b')]['id']}},_0x1b3842={};_0x1b3842[_0x87a2('0x35')]=_['keys'](db[_0x87a2('0x46')][_0x87a2('0x31')]);_0x1b3842['query']=_[_0x87a2('0x38')](_0xa82721[_0x87a2('0x37')]);_0x1b3842['filters']=_[_0x87a2('0x3a')](_0x1b3842[_0x87a2('0x35')],_0x1b3842[_0x87a2('0x37')]);_0x321601[_0x87a2('0x3b')]=_[_0x87a2('0x3a')](_0x1b3842[_0x87a2('0x35')],qs[_0x87a2('0x3c')](_0xa82721['query']['fields']));_0x321601[_0x87a2('0x3b')]=_0x321601[_0x87a2('0x3b')][_0x87a2('0x3d')]?_0x321601[_0x87a2('0x3b')]:_0x1b3842['model'];if(_0xa82721[_0x87a2('0x37')]['includeAll']){_0x321601[_0x87a2('0x4c')]=[{'all':!![]}];}_0x321601=_[_0x87a2('0x43')]({},_0x321601,_0xa82721[_0x87a2('0x45')]);return db[_0x87a2('0x46')][_0x87a2('0x4d')](_0x321601)['then'](handleEntityNotFound(_0x1def7a,null))[_0x87a2('0x29')](respondWithResult(_0x1def7a,null))[_0x87a2('0x49')](handleError(_0x1def7a,null));};exports[_0x87a2('0x4e')]=function(_0x5610e2,_0x51d8fb){return db[_0x87a2('0x46')][_0x87a2('0x4e')](_0x5610e2[_0x87a2('0x4f')],{})[_0x87a2('0x29')](function(_0x484116){var _0x343d46=_0x5610e2['user'][_0x87a2('0x2a')]({'plain':!![]});if(!_0x343d46)throw new Error(_0x87a2('0x50'));if(_0x343d46[_0x87a2('0x51')]===_0x87a2('0x52')){var _0x7abee3=_0x484116['get']({'plain':!![]});var _0x51bdb3=_0x87a2('0x2b');return db[_0x87a2('0x53')][_0x87a2('0x4d')]({'where':{'name':_0x51bdb3,'userProfileId':_0x343d46[_0x87a2('0x54')]},'raw':!![]})[_0x87a2('0x29')](function(_0xeaecae){if(_0xeaecae&&_0xeaecae[_0x87a2('0x55')]===0x0){return db[_0x87a2('0x2c')]['create']({'name':_0x7abee3[_0x87a2('0x2f')],'resourceId':_0x7abee3['id'],'type':_0xeaecae[_0x87a2('0x2f')],'sectionId':_0xeaecae['id']},{})[_0x87a2('0x29')](function(){return _0x484116;});}else{return _0x484116;}})[_0x87a2('0x49')](function(_0x491e9b){logger[_0x87a2('0x56')](_0x87a2('0x57'),_0x491e9b);throw _0x491e9b;});}return _0x484116;})[_0x87a2('0x29')](respondWithResult(_0x51d8fb,0xc9))[_0x87a2('0x49')](handleError(_0x51d8fb,null));};exports[_0x87a2('0x58')]=function(_0x281807,_0x3e5ff1){var _0x2ee824={'where':{'id':_0x281807['params']['id']}},_0x171011={};_0x171011['model']=_['keys'](db['Dashboard'][_0x87a2('0x31')]);_0x2ee824[_0x87a2('0x3b')]=_[_0x87a2('0x3a')](_0x171011[_0x87a2('0x35')],qs[_0x87a2('0x3c')](_0x281807['query'][_0x87a2('0x3c')]));_0x2ee824[_0x87a2('0x3b')]=_0x2ee824[_0x87a2('0x3b')][_0x87a2('0x3d')]?_0x2ee824[_0x87a2('0x3b')]:_0x171011[_0x87a2('0x35')];if(_0x281807[_0x87a2('0x37')][_0x87a2('0x47')]){_0x2ee824[_0x87a2('0x4c')]=[{'all':!![]}];}_0x2ee824=_[_0x87a2('0x43')]({},_0x2ee824,_0x281807['options']);return db['Dashboard']['find'](_0x2ee824)[_0x87a2('0x29')](handleEntityNotFound(_0x3e5ff1,null))['then'](function(_0x12e3b1){if(_0x12e3b1){var _0x339e88=_0x12e3b1['get']({'plain':!![]});_0x339e88=qs[_0x87a2('0x59')](_0x339e88,['id',_0x87a2('0x5a'),_0x87a2('0x5b')]);_0x281807['body']=_[_0x87a2('0x59')](_0x281807['body'],['id',_0x87a2('0x5a'),_0x87a2('0x5b')]);return db[_0x87a2('0x46')][_0x87a2('0x4e')](_[_0x87a2('0x43')](_0x339e88,_0x281807[_0x87a2('0x4f')]),{'include':_0x281807[_0x87a2('0x37')]['includeAll']?[{'all':!![]}]:undefined})[_0x87a2('0x29')](function(_0x273126){var _0x49135e=_0x281807[_0x87a2('0x52')][_0x87a2('0x2a')]({'plain':!![]});if(!_0x49135e)throw new Error(_0x87a2('0x50'));if(_0x49135e['role']==='user'){var _0x3052c1=_0x273126[_0x87a2('0x2a')]({'plain':!![]});var _0x51e6ba=_0x87a2('0x2b');return db[_0x87a2('0x53')][_0x87a2('0x4d')]({'where':{'name':_0x51e6ba,'userProfileId':_0x49135e[_0x87a2('0x54')]},'raw':!![]})[_0x87a2('0x29')](function(_0x1acf4f){if(_0x1acf4f&&_0x1acf4f['autoAssociation']===0x0){return db['UserProfileResource'][_0x87a2('0x4e')]({'name':_0x3052c1[_0x87a2('0x2f')],'resourceId':_0x3052c1['id'],'type':_0x1acf4f[_0x87a2('0x2f')],'sectionId':_0x1acf4f['id']},{})[_0x87a2('0x29')](function(){return _0x273126;});}else{return _0x273126;}})['catch'](function(_0x3829f3){logger[_0x87a2('0x56')](_0x87a2('0x57'),_0x3829f3);throw _0x3829f3;});}return _0x273126;});}})[_0x87a2('0x29')](respondWithResult(_0x3e5ff1,0xc9))['catch'](handleError(_0x3e5ff1,null));};exports[_0x87a2('0x28')]=function(_0x306949,_0x556867){if(_0x306949[_0x87a2('0x4f')]['id']){delete _0x306949[_0x87a2('0x4f')]['id'];}return db[_0x87a2('0x46')]['find']({'where':{'id':_0x306949[_0x87a2('0x4b')]['id']}})[_0x87a2('0x29')](handleEntityNotFound(_0x556867,null))[_0x87a2('0x29')](saveUpdates(_0x306949['body'],null))['then'](respondWithResult(_0x556867,null))[_0x87a2('0x49')](handleError(_0x556867,null));};exports[_0x87a2('0x2d')]=function(_0x43772a,_0x3f6f40){return db[_0x87a2('0x46')][_0x87a2('0x4d')]({'where':{'id':_0x43772a[_0x87a2('0x4b')]['id']}})[_0x87a2('0x29')](handleEntityNotFound(_0x3f6f40,null))['then'](removeEntity(_0x3f6f40,null))[_0x87a2('0x49')](handleError(_0x3f6f40,null));};function widgetAttributes(_0xdac09d){try{switch(_0xdac09d['type']){case _0x87a2('0x5c'):return[{'name':_0x87a2('0x5d'),'value':_0xdac09d['attrUrl']||(_0xdac09d[_0x87a2('0x5e')]&&_0xdac09d['attrs'][0x0]?_0xdac09d[_0x87a2('0x5e')][0x0]['value']:undefined)||_0x87a2('0x5f')}];case _0x87a2('0x60'):return[{'name':_0x87a2('0x61'),'value':_0xdac09d[_0x87a2('0x61')]||(_0xdac09d[_0x87a2('0x5e')]&&_0xdac09d['attrs'][0x0]?_0xdac09d[_0x87a2('0x5e')][0x0][_0x87a2('0x62')]:undefined)||''}];case _0x87a2('0x63'):return[{'name':_0x87a2('0x64'),'value':_0xdac09d[_0x87a2('0x64')]||(_0xdac09d[_0x87a2('0x5e')]&&_0xdac09d['attrs'][0x0]?_0xdac09d[_0x87a2('0x5e')][0x0][_0x87a2('0x62')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0xdac09d['attrTimezone']||(_0xdac09d[_0x87a2('0x5e')]&&_0xdac09d[_0x87a2('0x5e')][0x1]?_0xdac09d[_0x87a2('0x5e')][0x1][_0x87a2('0x62')]:undefined)||'0.00'},{'name':'attrFontSize','value':_0xdac09d['attrFontSize']||(_0xdac09d[_0x87a2('0x5e')]&&_0xdac09d[_0x87a2('0x5e')][0x2]?_0xdac09d[_0x87a2('0x5e')][0x2]['value']:undefined)||0xc}];case _0x87a2('0x65'):return[{'name':_0x87a2('0x66'),'value':_0xdac09d[_0x87a2('0x66')]||(_0xdac09d[_0x87a2('0x5e')]&&_0xdac09d['attrs'][0x0]?_0xdac09d['attrs'][0x0]['value']:undefined)||_0x87a2('0x67')},{'name':_0x87a2('0x68'),'value':_0xdac09d['attrVoiceQueues']||(_0xdac09d['attrs']&&_0xdac09d['attrs'][0x1]?_0xdac09d['attrs'][0x1][_0x87a2('0x62')]:undefined)||[]},{'name':'attrFontSize','value':_0xdac09d[_0x87a2('0x69')]||(_0xdac09d['attrs']&&_0xdac09d[_0x87a2('0x5e')][0x2]?_0xdac09d['attrs'][0x2][_0x87a2('0x62')]:undefined)||0x14}];case _0x87a2('0x6a'):case'pie-chart':return[{'name':_0x87a2('0x6b'),'value':_0xdac09d[_0x87a2('0x6b')]||(_0xdac09d['attrs']&&_0xdac09d['attrs'][0x0]?_0xdac09d[_0x87a2('0x5e')][0x0][_0x87a2('0x62')]:undefined)||_0x87a2('0x67')},{'name':_0x87a2('0x6c'),'value':_0xdac09d[_0x87a2('0x6c')]||(_0xdac09d['attrs']&&_0xdac09d[_0x87a2('0x5e')][0x1]?_0xdac09d[_0x87a2('0x5e')][0x1]['value']:undefined)||null},{'name':_0x87a2('0x6d'),'value':_0xdac09d[_0x87a2('0x6d')]||(_0xdac09d['attrs']&&_0xdac09d[_0x87a2('0x5e')][0x2]?_0xdac09d[_0x87a2('0x5e')][0x2]['value']:undefined)||null},{'name':_0x87a2('0x68'),'value':_0xdac09d['attrVoiceQueues']||(_0xdac09d['attrs']&&_0xdac09d[_0x87a2('0x5e')][0x3]?_0xdac09d[_0x87a2('0x5e')][0x3][_0x87a2('0x62')]:undefined)||[]}];case _0x87a2('0x6e'):return[{'name':'attrReport','type':_0xdac09d[_0x87a2('0x6f')]||(_0xdac09d['attrs']&&_0xdac09d[_0x87a2('0x5e')][0x0]?_0xdac09d[_0x87a2('0x5e')][0x0][_0x87a2('0x33')]:undefined)||null,'value':_0xdac09d['attrReport']||(_0xdac09d['attrs']&&_0xdac09d['attrs'][0x0]?_0xdac09d[_0x87a2('0x5e')][0x0][_0x87a2('0x62')]:undefined)||null},{'name':_0x87a2('0x70'),'value':_0xdac09d[_0x87a2('0x70')]||(_0xdac09d[_0x87a2('0x5e')]&&_0xdac09d[_0x87a2('0x5e')][0x1]?_0xdac09d[_0x87a2('0x5e')][0x1][_0x87a2('0x62')]:undefined)||0x0}];default:return[];}}catch(_0x51c803){logger['error']('widgetAttributes:\x20%s',JSON['stringify'](_0x51c803));return[];}}exports['addItem']=function(_0x319795,_0x4ed2c3,_0x233841){if(_0x319795['body']['id']){delete _0x319795[_0x87a2('0x4f')]['id'];}return db[_0x87a2('0x46')]['find']({'where':{'id':_0x319795[_0x87a2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4ed2c3,null))[_0x87a2('0x29')](function(_0x4b1c6d){if(_0x4b1c6d){_0x319795[_0x87a2('0x4f')][_0x87a2('0x71')]=_0x4b1c6d['id'];_0x319795[_0x87a2('0x4f')][_0x87a2('0x5e')]=widgetAttributes(_0x319795[_0x87a2('0x4f')]);return db[_0x87a2('0x72')][_0x87a2('0x4e')](_0x319795[_0x87a2('0x4f')]);}})[_0x87a2('0x29')](respondWithResult(_0x4ed2c3,null))[_0x87a2('0x49')](handleError(_0x4ed2c3,null));};exports['getItems']=function(_0x31ce7a,_0x26d125,_0x4a7929){var _0x703846={};var _0x9fc7f1={};var _0x523e95;var _0x9ec0d7;return db[_0x87a2('0x46')][_0x87a2('0x73')]({'where':{'id':_0x31ce7a[_0x87a2('0x4b')]['id']}})['then'](handleEntityNotFound(_0x26d125,null))[_0x87a2('0x29')](function(_0x1376f9){if(_0x1376f9){_0x523e95=_0x1376f9;_0x9fc7f1['model']=_['keys'](db['DashboardItem'][_0x87a2('0x31')]);_0x9fc7f1[_0x87a2('0x37')]=_['keys'](_0x31ce7a[_0x87a2('0x37')]);_0x9fc7f1[_0x87a2('0x39')]=_['intersection'](_0x9fc7f1[_0x87a2('0x35')],_0x9fc7f1[_0x87a2('0x37')]);_0x703846[_0x87a2('0x3b')]=_[_0x87a2('0x3a')](_0x9fc7f1[_0x87a2('0x35')],qs[_0x87a2('0x3c')](_0x31ce7a['query'][_0x87a2('0x3c')]));_0x703846['attributes']=_0x703846[_0x87a2('0x3b')][_0x87a2('0x3d')]?_0x703846[_0x87a2('0x3b')]:_0x9fc7f1[_0x87a2('0x35')];_0x703846[_0x87a2('0x40')]=qs[_0x87a2('0x41')](_0x31ce7a[_0x87a2('0x37')][_0x87a2('0x41')]);_0x703846[_0x87a2('0x44')]=qs[_0x87a2('0x39')](_[_0x87a2('0x74')](_0x31ce7a['query'],_0x9fc7f1[_0x87a2('0x39')]));if(_0x31ce7a[_0x87a2('0x37')][_0x87a2('0x42')]){_0x703846['where']=_[_0x87a2('0x43')](_0x703846[_0x87a2('0x44')],{'$or':_[_0x87a2('0x36')](_0x703846['attributes'],function(_0x4201ea){var _0x305ec5={};_0x305ec5[_0x4201ea]={'$like':'%'+_0x31ce7a[_0x87a2('0x37')][_0x87a2('0x42')]+'%'};return _0x305ec5;})});}_0x703846=_[_0x87a2('0x43')]({},_0x703846,_0x31ce7a[_0x87a2('0x45')]);return _0x523e95[_0x87a2('0x75')](_0x703846);}})['then'](function(_0x5b06a9){if(_0x5b06a9){_0x9ec0d7=_0x5b06a9['length'];if(!_0x31ce7a[_0x87a2('0x37')][_0x87a2('0x3e')](_0x87a2('0x3f'))){_0x703846['limit']=qs['limit'](_0x31ce7a[_0x87a2('0x37')][_0x87a2('0x21')]);_0x703846['offset']=qs[_0x87a2('0x20')](_0x31ce7a[_0x87a2('0x37')]['offset']);}return _0x523e95[_0x87a2('0x75')](_0x703846);}})['then'](function(_0x1a2965){if(_0x1a2965){return _0x1a2965?{'count':_0x9ec0d7,'rows':_0x1a2965}:null;}})[_0x87a2('0x29')](respondWithResult(_0x26d125,null))['catch'](handleError(_0x26d125,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 431a60c..3a13de6 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 _0x3c4c=['Dashboard','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x44f4ca,_0x2316c8){var _0x517651=function(_0x4265fc){while(--_0x4265fc){_0x44f4ca['push'](_0x44f4ca['shift']());}};_0x517651(++_0x2316c8);}(_0x3c4c,0x87));var _0xc3c4=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3c4c[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0xc3c4('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xc3c4('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc3c4('0x2')](0x0);var events={'afterCreate':_0xc3c4('0x3'),'afterUpdate':_0xc3c4('0x4'),'afterDestroy':_0xc3c4('0x5')};function emitEvent(_0xda8bcf){return function(_0x36e81c,_0xf5d7a4,_0x3f81bd){DashboardEvents[_0xc3c4('0x6')](_0xda8bcf+':'+_0x36e81c['id'],_0x36e81c);DashboardEvents[_0xc3c4('0x6')](_0xda8bcf,_0x36e81c);_0x3f81bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xc3c4('0x7')]=DashboardEvents; \ No newline at end of file +var _0xc57e=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x475093,_0x228fcb){var _0x5e42a7=function(_0x1bcd9e){while(--_0x1bcd9e){_0x475093['push'](_0x475093['shift']());}};_0x5e42a7(++_0x228fcb);}(_0xc57e,0x66));var _0xec57=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc57e[_0x21a9d9];return _0x46adce;};'use strict';var EventEmitter=require(_0xec57('0x0'));var Dashboard=require(_0xec57('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xec57('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xec57('0x3'),'afterDestroy':_0xec57('0x4')};function emitEvent(_0xf1614){return function(_0x49a9de,_0x14a836,_0x508a4c){DashboardEvents[_0xec57('0x5')](_0xf1614+':'+_0x49a9de['id'],_0x49a9de);DashboardEvents['emit'](_0xf1614,_0x49a9de);_0x508a4c(null);};}for(var e in events){if(events[_0xec57('0x6')](e)){var event=events[e];Dashboard[_0xec57('0x7')](e,emitEvent(event));}}module[_0xec57('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index aecf297..34b87ff 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 _0x0afd=['../../config/logger','bluebird','path','./dashboard.attributes','exports','dashboards','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0afd,0xb6));var _0xd0af=function(_0xaa96b6,_0x3b1cb1){_0xaa96b6=_0xaa96b6-0x0;var _0x27230f=_0x0afd[_0xaa96b6];return _0x27230f;};'use strict';var _=require(_0xd0af('0x0'));var util=require(_0xd0af('0x1'));var logger=require(_0xd0af('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd0af('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0af('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd0af('0x5'));module[_0xd0af('0x6')]=function(_0x20b7cd,_0x1ecc9a){return _0x20b7cd['define']('Dashboard',attributes,{'tableName':_0xd0af('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa7d=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Dashboard','dashboards','util','../../config/logger'];(function(_0x4b775b,_0x2aadc6){var _0xf84d39=function(_0x55ac96){while(--_0x55ac96){_0x4b775b['push'](_0x4b775b['shift']());}};_0xf84d39(++_0x2aadc6);}(_0xfa7d,0x142));var _0xdfa7=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xfa7d[_0x3c4737];return _0x2bb926;};'use strict';var _=require('lodash');var util=require(_0xdfa7('0x0'));var logger=require(_0xdfa7('0x1'))(_0xdfa7('0x2'));var moment=require(_0xdfa7('0x3'));var BPromise=require(_0xdfa7('0x4'));var rp=require(_0xdfa7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdfa7('0x6'));var config=require(_0xdfa7('0x7'));var attributes=require('./dashboard.attributes');module[_0xdfa7('0x8')]=function(_0x170a4a,_0x53110d){return _0x170a4a[_0xdfa7('0x9')](_0xdfa7('0xa'),attributes,{'tableName':_0xdfa7('0xb'),'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 6c25160..8458c10 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 _0xaeaf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x37da75,_0x452bdd){var _0x2d1f23=function(_0x54f56e){while(--_0x54f56e){_0x37da75['push'](_0x37da75['shift']());}};_0x2d1f23(++_0x452bdd);}(_0xaeaf,0x14e));var _0xfaea=function(_0x2673a4,_0x4d0b8d){_0x2673a4=_0x2673a4-0x0;var _0x5e3a6a=_0xaeaf[_0x2673a4];return _0x5e3a6a;};'use strict';var _=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var moment=require(_0xfaea('0x2'));var BPromise=require(_0xfaea('0x3'));var rs=require(_0xfaea('0x4'));var fs=require('fs');var Redis=require(_0xfaea('0x5'));var db=require(_0xfaea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaea('0x7'))(_0xfaea('0x8'));var config=require(_0xfaea('0x9'));var jayson=require(_0xfaea('0xa'));var client=jayson['client'][_0xfaea('0xb')]({'port':0x232a});config[_0xfaea('0xc')]=_[_0xfaea('0xd')](config[_0xfaea('0xc')],{'host':_0xfaea('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaea('0xc')]));require(_0xfaea('0xf'))['register'](socket);function respondWithRpcPromise(_0x191039,_0x3c1f4d,_0x2462f5){return new BPromise(function(_0x5078b6,_0x116379){return client[_0xfaea('0x10')](_0x191039,_0x2462f5)[_0xfaea('0x11')](function(_0x5c4746){logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));logger[_0xfaea('0x15')](_0xfaea('0x16'),_0x3c1f4d,'request\x20sent',JSON[_0xfaea('0x17')](_0x5c4746));if(_0x5c4746['error']){if(_0x5c4746[_0xfaea('0x18')]['code']===0x1f4){logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error'][_0xfaea('0x19')]);return _0x116379(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error']['message']);return _0x5078b6(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}else{logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));_0x5078b6(_0x5c4746[_0xfaea('0x1a')][_0xfaea('0x19')]);}})[_0xfaea('0x1b')](function(_0x328924){logger[_0xfaea('0x18')]('Dashboard,\x20%s,\x20%s',_0x3c1f4d,_0x328924);_0x116379(_0x328924);});});} \ No newline at end of file +var _0xb872=['localhost','./dashboard.socket','register','request','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','info','result','Dashboard,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x448792,_0x2248c3){var _0x31f706=function(_0x430ee8){while(--_0x430ee8){_0x448792['push'](_0x448792['shift']());}};_0x31f706(++_0x2248c3);}(_0xb872,0x74));var _0x2b87=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb872[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2b87('0x0'));var util=require(_0x2b87('0x1'));var moment=require(_0x2b87('0x2'));var BPromise=require('bluebird');var rs=require(_0x2b87('0x3'));var fs=require('fs');var Redis=require(_0x2b87('0x4'));var db=require(_0x2b87('0x5'))['db'];var utils=require(_0x2b87('0x6'));var logger=require(_0x2b87('0x7'))(_0x2b87('0x8'));var config=require('../../config/environment');var jayson=require(_0x2b87('0x9'));var client=jayson[_0x2b87('0xa')][_0x2b87('0xb')]({'port':0x232a});config[_0x2b87('0xc')]=_[_0x2b87('0xd')](config['redis'],{'host':_0x2b87('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2b87('0xf'))[_0x2b87('0x10')](socket);function respondWithRpcPromise(_0x5e344e,_0x1e47b5,_0x379676){return new BPromise(function(_0x49f2c5,_0x5105e4){return client[_0x2b87('0x11')](_0x5e344e,_0x379676)['then'](function(_0x307a22){logger['info']('Dashboard,\x20%s,\x20%s',_0x1e47b5,_0x2b87('0x12'));logger['debug'](_0x2b87('0x13'),_0x1e47b5,'request\x20sent',JSON['stringify'](_0x307a22));if(_0x307a22[_0x2b87('0x14')]){if(_0x307a22[_0x2b87('0x14')][_0x2b87('0x15')]===0x1f4){logger[_0x2b87('0x14')]('Dashboard,\x20%s,\x20%s',_0x1e47b5,_0x307a22['error'][_0x2b87('0x16')]);return _0x5105e4(_0x307a22[_0x2b87('0x14')]['message']);}logger[_0x2b87('0x14')]('Dashboard,\x20%s,\x20%s',_0x1e47b5,_0x307a22[_0x2b87('0x14')][_0x2b87('0x16')]);return _0x49f2c5(_0x307a22[_0x2b87('0x14')][_0x2b87('0x16')]);}else{logger[_0x2b87('0x17')]('Dashboard,\x20%s,\x20%s',_0x1e47b5,_0x2b87('0x12'));_0x49f2c5(_0x307a22[_0x2b87('0x18')]['message']);}})['catch'](function(_0xc00d90){logger[_0x2b87('0x14')](_0x2b87('0x19'),_0x1e47b5,_0xc00d90);_0x5105e4(_0xc00d90);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index fd91f00..69531ff 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 _0x8dc9=['remove','update','emit','register','length','dashboard:','./dashboard.events','save'];(function(_0x2dfffc,_0x3411af){var _0xf9d20d=function(_0x137b78){while(--_0x137b78){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0xf9d20d(++_0x3411af);}(_0x8dc9,0x1be));var _0x98dc=function(_0xf41a8d,_0x481f22){_0xf41a8d=_0xf41a8d-0x0;var _0x5399c1=_0x8dc9[_0xf41a8d];return _0x5399c1;};'use strict';var DashboardEvents=require(_0x98dc('0x0'));var events=[_0x98dc('0x1'),_0x98dc('0x2'),_0x98dc('0x3')];function createListener(_0x4f8d75,_0x4ccd59){return function(_0x1748a1){_0x4ccd59[_0x98dc('0x4')](_0x4f8d75,_0x1748a1);};}function removeListener(_0x49a8a9,_0x2de59d){return function(){DashboardEvents['removeListener'](_0x49a8a9,_0x2de59d);};}exports[_0x98dc('0x5')]=function(_0x24631f){for(var _0x2e2a53=0x0,_0x1f4c44=events[_0x98dc('0x6')];_0x2e2a53<_0x1f4c44;_0x2e2a53++){var _0x17c3a9=events[_0x2e2a53];var _0x5622c5=createListener(_0x98dc('0x7')+_0x17c3a9,_0x24631f);DashboardEvents['on'](_0x17c3a9,_0x5622c5);}}; \ No newline at end of file +var _0xc7df=['dashboard:','./dashboard.events','remove','emit','removeListener','register','length'];(function(_0x3543e7,_0x501fcf){var _0x42df23=function(_0x467049){while(--_0x467049){_0x3543e7['push'](_0x3543e7['shift']());}};_0x42df23(++_0x501fcf);}(_0xc7df,0x94));var _0xfc7d=function(_0xe2a083,_0x46687a){_0xe2a083=_0xe2a083-0x0;var _0x4d7971=_0xc7df[_0xe2a083];return _0x4d7971;};'use strict';var DashboardEvents=require(_0xfc7d('0x0'));var events=['save',_0xfc7d('0x1'),'update'];function createListener(_0xbaed62,_0xd6f4f0){return function(_0x45b093){_0xd6f4f0[_0xfc7d('0x2')](_0xbaed62,_0x45b093);};}function removeListener(_0x556cc4,_0x24affd){return function(){DashboardEvents[_0xfc7d('0x3')](_0x556cc4,_0x24affd);};}exports[_0xfc7d('0x4')]=function(_0x2c7ebf){for(var _0xf306e5=0x0,_0x386ec0=events[_0xfc7d('0x5')];_0xf306e5<_0x386ec0;_0xf306e5++){var _0x571ce3=events[_0xf306e5];var _0x507f10=createListener(_0xfc7d('0x6')+_0x571ce3,_0x2c7ebf);DashboardEvents['on'](_0x571ce3,_0x507f10);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index dccf5c8..a3392c3 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 _0xcb91=['isAuthenticated','/:id','show','create','post','/:id/clone','/:id/items','addItem','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0xcb91[_0x41c381];return _0x427981;};'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 auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./dashboard.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/items',auth[_0x1cb9('0x7')](),controller['getItems']);router['post']('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xa')]);router[_0x1cb9('0xb')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),controller['clone']);router[_0x1cb9('0xb')](_0x1cb9('0xd'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x10')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb7e7=['addItem','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0xcd5a3d,_0x3c5b33){var _0xd43207=function(_0x17d976){while(--_0x17d976){_0xcd5a3d['push'](_0xcd5a3d['shift']());}};_0xd43207(++_0x3c5b33);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['post'](_0x7b7e('0xd'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xe')]);router[_0x7b7e('0xb')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 7f82f6c..0d71ebb 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 _0xa543=['#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa543,0x1ae));var _0x3a54=function(_0x4c8a0e,_0x1b1927){_0x4c8a0e=_0x4c8a0e-0x0;var _0x527466=_0xa543[_0x4c8a0e];return _0x527466;};'use strict';var Sequelize=require(_0x3a54('0x0'));var squel=require(_0x3a54('0x1'));var _=require(_0x3a54('0x2'));module[_0x3a54('0x3')]={'title':{'type':Sequelize[_0x3a54('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3a54('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3a54('0x5')]('long'),'get':function(){try{return JSON[_0x3a54('0x6')](this[_0x3a54('0x7')](_0x3a54('0x8')));}catch(_0x11c716){return[];}},'set':function(_0x569656){try{this[_0x3a54('0x9')](_0x3a54('0x8'),JSON[_0x3a54('0xa')](_0x569656));}catch(_0xba9766){this[_0x3a54('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x3a54('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3a54('0xb')]},'background':{'type':Sequelize[_0x3a54('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3a54('0x4')],'allowNull':![],'defaultValue':_0x3a54('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3a54('0x4')]}}; \ No newline at end of file +var _0x2df5=['exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','lodash'];(function(_0x46d4d6,_0x60315b){var _0x14bc64=function(_0x2bf44a){while(--_0x2bf44a){_0x46d4d6['push'](_0x46d4d6['shift']());}};_0x14bc64(++_0x60315b);}(_0x2df5,0x1cc));var _0x52df=function(_0x1ac8cd,_0x173f97){_0x1ac8cd=_0x1ac8cd-0x0;var _0x489191=_0x2df5[_0x1ac8cd];return _0x489191;};'use strict';var Sequelize=require(_0x52df('0x0'));var squel=require('squel');var _=require(_0x52df('0x1'));module[_0x52df('0x2')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x52df('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x52df('0x4')](_0x52df('0x5')),'get':function(){try{return JSON[_0x52df('0x6')](this[_0x52df('0x7')](_0x52df('0x8')));}catch(_0x21c13a){return[];}},'set':function(_0x4ec4e6){try{this[_0x52df('0x9')](_0x52df('0x8'),JSON['stringify'](_0x4ec4e6));}catch(_0x2a7725){this[_0x52df('0x9')]('attrs',JSON[_0x52df('0xa')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x52df('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x52df('0xb')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x52df('0x3')],'allowNull':![],'defaultValue':_0x52df('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x52df('0x3')],'allowNull':![],'defaultValue':_0x52df('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x52df('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index a7865da..5759e2a 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 _0x0bbd=['find','then','catch','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','sendStatus','error','stack','name','send','show','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options'];(function(_0x4e234d,_0x2d4055){var _0x3492e4=function(_0xfb2a01){while(--_0xfb2a01){_0x4e234d['push'](_0x4e234d['shift']());}};_0x3492e4(++_0x2d4055);}(_0x0bbd,0x134));var _0xd0bb=function(_0x892934,_0x1b5750){_0x892934=_0x892934-0x0;var _0x3fe3ff=_0x0bbd[_0x892934];return _0x3fe3ff;};'use strict';var pdf=require(_0xd0bb('0x0'));var emlformat=require(_0xd0bb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd0bb('0x2'));var jsonpatch=require(_0xd0bb('0x3'));var rp=require('request-promise');var moment=require(_0xd0bb('0x4'));var BPromise=require(_0xd0bb('0x5'));var Mustache=require(_0xd0bb('0x6'));var util=require(_0xd0bb('0x7'));var path=require(_0xd0bb('0x8'));var sox=require(_0xd0bb('0x9'));var csv=require(_0xd0bb('0xa'));var ejs=require(_0xd0bb('0xb'));var fs=require('fs');var _=require(_0xd0bb('0xc'));var squel=require(_0xd0bb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0bb('0xe'));var toCsv=require(_0xd0bb('0xa'));var querystring=require(_0xd0bb('0xf'));var Papa=require(_0xd0bb('0x10'));var Redis=require(_0xd0bb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd0bb('0x12'));var as=require(_0xd0bb('0x13'));var hardwareService=require(_0xd0bb('0x14'));var logger=require(_0xd0bb('0x15'))('api');var utils=require(_0xd0bb('0x16'));var config=require(_0xd0bb('0x17'));var db=require(_0xd0bb('0x18'))['db'];config[_0xd0bb('0x19')]=_[_0xd0bb('0x1a')](config['redis'],{'host':_0xd0bb('0x1b'),'port':0x18eb});var socket=require(_0xd0bb('0x1c'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xd0bb('0x1d')](socket);function respondWithStatusCode(_0x24dac5,_0x2f733a){_0x2f733a=_0x2f733a||0xcc;return function(_0x3a380d){if(_0x3a380d){return _0x24dac5['sendStatus'](_0x2f733a);}return _0x24dac5[_0xd0bb('0x1e')](_0x2f733a)['end']();};}function respondWithResult(_0x12ab2a,_0x8f9189){_0x8f9189=_0x8f9189||0xc8;return function(_0x55b7ae){if(_0x55b7ae){return _0x12ab2a[_0xd0bb('0x1e')](_0x8f9189)[_0xd0bb('0x1f')](_0x55b7ae);}};}function respondWithFilteredResult(_0x3b9fbe,_0x1f0663){return function(_0x1b571f){if(_0x1b571f){var _0x3da963=_0x1b571f[_0xd0bb('0x20')],_0x486ce8=_0x1f0663[_0xd0bb('0x21')],_0x3f0251=_0x1f0663[_0xd0bb('0x21')]+_0x1f0663[_0xd0bb('0x22')],_0x45e9ca;if(_0x3f0251>=_0x3da963){_0x3f0251=_0x3da963;_0x45e9ca=0xc8;}else{_0x45e9ca=0xce;}_0x3b9fbe[_0xd0bb('0x1e')](_0x45e9ca);return _0x3b9fbe[_0xd0bb('0x23')](_0xd0bb('0x24'),_0x486ce8+'-'+_0x3f0251+'/'+_0x3da963)[_0xd0bb('0x1f')](_0x1b571f);}return null;};}function patchUpdates(_0x91c004){return function(_0x2a85c0){try{jsonpatch[_0xd0bb('0x25')](_0x2a85c0,_0x91c004,!![]);}catch(_0x8f0ba3){return BPromise['reject'](_0x8f0ba3);}return _0x2a85c0[_0xd0bb('0x26')]();};}function saveUpdates(_0x1d51f0,_0x480a7e){return function(_0x17e538){if(_0x17e538){return _0x17e538[_0xd0bb('0x27')](_0x1d51f0)['then'](function(_0x34185d){return _0x34185d;});}return null;};}function removeEntity(_0x27cdfd,_0x215107){return function(_0x5d1644){if(_0x5d1644){return _0x5d1644[_0xd0bb('0x28')]()['then'](function(){_0x27cdfd[_0xd0bb('0x1e')](0xcc)[_0xd0bb('0x29')]();});}};}function handleEntityNotFound(_0x40acb1,_0x3120bc){return function(_0x34054c){if(!_0x34054c){_0x40acb1[_0xd0bb('0x2a')](0x194);}return _0x34054c;};}function handleError(_0x182172,_0x164d56){_0x164d56=_0x164d56||0x1f4;return function(_0x29646e){logger[_0xd0bb('0x2b')](_0x29646e[_0xd0bb('0x2c')]);if(_0x29646e['name']){delete _0x29646e[_0xd0bb('0x2d')];}_0x182172[_0xd0bb('0x1e')](_0x164d56)[_0xd0bb('0x2e')](_0x29646e);};}exports[_0xd0bb('0x2f')]=function(_0x18d2dc,_0x436bf7){var _0x37f9f1={'raw':![],'where':{'id':_0x18d2dc['params']['id']}},_0x833138={};_0x833138['model']=_[_0xd0bb('0x30')](db[_0xd0bb('0x31')][_0xd0bb('0x32')]);_0x833138[_0xd0bb('0x33')]=_[_0xd0bb('0x30')](_0x18d2dc['query']);_0x833138['filters']=_[_0xd0bb('0x34')](_0x833138['model'],_0x833138[_0xd0bb('0x33')]);_0x37f9f1[_0xd0bb('0x35')]=_[_0xd0bb('0x34')](_0x833138['model'],qs[_0xd0bb('0x36')](_0x18d2dc[_0xd0bb('0x33')][_0xd0bb('0x36')]));_0x37f9f1['attributes']=_0x37f9f1[_0xd0bb('0x35')][_0xd0bb('0x37')]?_0x37f9f1[_0xd0bb('0x35')]:_0x833138['model'];if(_0x18d2dc['query'][_0xd0bb('0x38')]){_0x37f9f1[_0xd0bb('0x39')]=[{'all':!![]}];}_0x37f9f1=_[_0xd0bb('0x3a')]({},_0x37f9f1,_0x18d2dc[_0xd0bb('0x3b')]);return db[_0xd0bb('0x31')][_0xd0bb('0x3c')](_0x37f9f1)[_0xd0bb('0x3d')](handleEntityNotFound(_0x436bf7,null))[_0xd0bb('0x3d')](respondWithResult(_0x436bf7,null))[_0xd0bb('0x3e')](handleError(_0x436bf7,null));};exports[_0xd0bb('0x28')]=function(_0x32849a,_0xd9f98a){return db[_0xd0bb('0x31')][_0xd0bb('0x3c')]({'where':{'id':_0x32849a[_0xd0bb('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd9f98a,null))[_0xd0bb('0x3d')](removeEntity(_0xd9f98a,null))[_0xd0bb('0x3e')](handleError(_0xd9f98a,null));};function widgetAttributes(_0x5a4964){try{switch(_0x5a4964[_0xd0bb('0x40')]){case _0xd0bb('0x41'):return[{'name':_0xd0bb('0x42'),'value':_0x5a4964[_0xd0bb('0x42')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||_0xd0bb('0x45')}];case _0xd0bb('0x46'):return[{'name':_0xd0bb('0x47'),'value':_0x5a4964[_0xd0bb('0x47')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||''}];case _0xd0bb('0x48'):return[{'name':_0xd0bb('0x49'),'value':_0x5a4964[_0xd0bb('0x49')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964['attrs'][0x0]?_0x5a4964['attrs'][0x0][_0xd0bb('0x44')]:undefined)||_0xd0bb('0x4a')},{'name':'attrTimezone','value':_0x5a4964[_0xd0bb('0x4b')]||(_0x5a4964['attrs']&&_0x5a4964['attrs'][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1]['value']:undefined)||_0xd0bb('0x4c')},{'name':_0xd0bb('0x4d'),'value':_0x5a4964['attrFontSize']||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x2]?_0x5a4964[_0xd0bb('0x43')][0x2][_0xd0bb('0x44')]:undefined)||0xc}];case _0xd0bb('0x4e'):return[{'name':'attrMetric','value':_0x5a4964[_0xd0bb('0x4f')]||(_0x5a4964['attrs']&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964['attrs'][0x0][_0xd0bb('0x44')]:undefined)||_0xd0bb('0x50')},{'name':'attrVoiceQueues','value':_0x5a4964['attrVoiceQueues']||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1][_0xd0bb('0x44')]:undefined)||[]},{'name':_0xd0bb('0x4d'),'value':_0x5a4964[_0xd0bb('0x4d')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964['attrs'][0x2]?_0x5a4964[_0xd0bb('0x43')][0x2]['value']:undefined)||0x14}];case _0xd0bb('0x51'):case'pie-chart':return[{'name':_0xd0bb('0x52'),'value':_0x5a4964[_0xd0bb('0x52')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||'total'},{'name':_0xd0bb('0x53'),'value':_0x5a4964[_0xd0bb('0x53')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1][_0xd0bb('0x44')]:undefined)||null},{'name':_0xd0bb('0x54'),'value':_0x5a4964[_0xd0bb('0x54')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x2]?_0x5a4964['attrs'][0x2]['value']:undefined)||null},{'name':_0xd0bb('0x55'),'value':_0x5a4964[_0xd0bb('0x55')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x3]?_0x5a4964[_0xd0bb('0x43')][0x3][_0xd0bb('0x44')]:undefined)||[]}];case _0xd0bb('0x56'):return[{'name':_0xd0bb('0x57'),'type':_0x5a4964[_0xd0bb('0x58')]||(_0x5a4964['attrs']&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0]['type']:undefined)||null,'value':_0x5a4964[_0xd0bb('0x57')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||null},{'name':_0xd0bb('0x59'),'value':_0x5a4964[_0xd0bb('0x59')]||(_0x5a4964['attrs']&&_0x5a4964['attrs'][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1][_0xd0bb('0x44')]:undefined)||0x0}];default:return[];}}catch(_0xc0d78){logger[_0xd0bb('0x2b')](_0xd0bb('0x5a'),JSON['stringify'](_0xc0d78));return[];}}exports['create']=function(_0x569475,_0x265711){if(_0x569475[_0xd0bb('0x5b')]){_0x569475[_0xd0bb('0x5b')][_0xd0bb('0x43')]=widgetAttributes(_0x569475['body']);}return db[_0xd0bb('0x31')]['create'](_0x569475['body'],{})[_0xd0bb('0x3d')](respondWithResult(_0x265711,0xc9))[_0xd0bb('0x3e')](handleError(_0x265711,null));};exports[_0xd0bb('0x27')]=function(_0x24c2c4,_0x2fa304){if(_0x24c2c4[_0xd0bb('0x5b')]['id']){delete _0x24c2c4[_0xd0bb('0x5b')]['id'];}_0x24c2c4[_0xd0bb('0x5b')]['attrs']=widgetAttributes(_0x24c2c4[_0xd0bb('0x5b')]);return db[_0xd0bb('0x31')][_0xd0bb('0x3c')]({'where':{'id':_0x24c2c4[_0xd0bb('0x3f')]['id']}})[_0xd0bb('0x3d')](handleEntityNotFound(_0x2fa304,null))[_0xd0bb('0x3d')](saveUpdates(_0x24c2c4[_0xd0bb('0x5b')],null))[_0xd0bb('0x3d')](respondWithResult(_0x2fa304,null))['catch'](handleError(_0x2fa304,null));}; \ No newline at end of file +var _0x2ba7=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','status','end','json','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','send','show','params','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','model','includeAll','merge','options','catch','find','iframe','attrUrl','attrs','value','custom','attrPath','attrHourFormat','attrFontSize','counter','attrMetric','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','reportType','type','attrReport','attrRefresh','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce'];(function(_0x2aa22d,_0x375edf){var _0x683fa5=function(_0x4b9643){while(--_0x4b9643){_0x2aa22d['push'](_0x2aa22d['shift']());}};_0x683fa5(++_0x375edf);}(_0x2ba7,0x92));var _0x72ba=function(_0x572619,_0x2bea57){_0x572619=_0x572619-0x0;var _0x5d1b4a=_0x2ba7[_0x572619];return _0x5d1b4a;};'use strict';var pdf=require(_0x72ba('0x0'));var emlformat=require(_0x72ba('0x1'));var rimraf=require(_0x72ba('0x2'));var zipdir=require(_0x72ba('0x3'));var jsonpatch=require(_0x72ba('0x4'));var rp=require(_0x72ba('0x5'));var moment=require(_0x72ba('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x72ba('0x7'));var util=require('util');var path=require(_0x72ba('0x8'));var sox=require(_0x72ba('0x9'));var csv=require(_0x72ba('0xa'));var ejs=require(_0x72ba('0xb'));var fs=require('fs');var _=require(_0x72ba('0xc'));var squel=require(_0x72ba('0xd'));var crypto=require(_0x72ba('0xe'));var jsforce=require(_0x72ba('0xf'));var deskjs=require(_0x72ba('0x10'));var toCsv=require('to-csv');var querystring=require(_0x72ba('0x11'));var Papa=require(_0x72ba('0x12'));var Redis=require(_0x72ba('0x13'));var authService=require(_0x72ba('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x72ba('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x72ba('0x16'));var utils=require(_0x72ba('0x17'));var config=require(_0x72ba('0x18'));var db=require('../../mysqldb')['db'];config[_0x72ba('0x19')]=_[_0x72ba('0x1a')](config[_0x72ba('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72ba('0x19')]));require('./dashboardItem.socket')['register'](socket);function respondWithStatusCode(_0x35cd71,_0x1b05f9){_0x1b05f9=_0x1b05f9||0xcc;return function(_0x49f4d9){if(_0x49f4d9){return _0x35cd71['sendStatus'](_0x1b05f9);}return _0x35cd71[_0x72ba('0x1b')](_0x1b05f9)[_0x72ba('0x1c')]();};}function respondWithResult(_0x126f69,_0x12797a){_0x12797a=_0x12797a||0xc8;return function(_0x2cb8f3){if(_0x2cb8f3){return _0x126f69['status'](_0x12797a)[_0x72ba('0x1d')](_0x2cb8f3);}};}function respondWithFilteredResult(_0x4dceee,_0x22f3cf){return function(_0x56efe6){if(_0x56efe6){var _0x220506=_0x56efe6['count'],_0x36ce8a=_0x22f3cf['offset'],_0x5d0cd9=_0x22f3cf[_0x72ba('0x1e')]+_0x22f3cf[_0x72ba('0x1f')],_0x5bcef5;if(_0x5d0cd9>=_0x220506){_0x5d0cd9=_0x220506;_0x5bcef5=0xc8;}else{_0x5bcef5=0xce;}_0x4dceee[_0x72ba('0x1b')](_0x5bcef5);return _0x4dceee['set'](_0x72ba('0x20'),_0x36ce8a+'-'+_0x5d0cd9+'/'+_0x220506)['json'](_0x56efe6);}return null;};}function patchUpdates(_0x35c68d){return function(_0x441b1a){try{jsonpatch[_0x72ba('0x21')](_0x441b1a,_0x35c68d,!![]);}catch(_0x4410f0){return BPromise[_0x72ba('0x22')](_0x4410f0);}return _0x441b1a['save']();};}function saveUpdates(_0x354c2d,_0x264c8e){return function(_0x5336d0){if(_0x5336d0){return _0x5336d0[_0x72ba('0x23')](_0x354c2d)[_0x72ba('0x24')](function(_0x55ef04){return _0x55ef04;});}return null;};}function removeEntity(_0x448b75,_0x5109c0){return function(_0x3cb627){if(_0x3cb627){return _0x3cb627[_0x72ba('0x25')]()[_0x72ba('0x24')](function(){_0x448b75['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x319f5c,_0x3ab387){return function(_0x37e04e){if(!_0x37e04e){_0x319f5c[_0x72ba('0x26')](0x194);}return _0x37e04e;};}function handleError(_0x19d8e7,_0x486571){_0x486571=_0x486571||0x1f4;return function(_0x90a181){logger[_0x72ba('0x27')](_0x90a181['stack']);if(_0x90a181[_0x72ba('0x28')]){delete _0x90a181[_0x72ba('0x28')];}_0x19d8e7['status'](_0x486571)[_0x72ba('0x29')](_0x90a181);};}exports[_0x72ba('0x2a')]=function(_0x4af07a,_0xc0d36a){var _0x9fb830={'raw':![],'where':{'id':_0x4af07a[_0x72ba('0x2b')]['id']}},_0x1c01b5={};_0x1c01b5['model']=_[_0x72ba('0x2c')](db[_0x72ba('0x2d')][_0x72ba('0x2e')]);_0x1c01b5['query']=_[_0x72ba('0x2c')](_0x4af07a[_0x72ba('0x2f')]);_0x1c01b5[_0x72ba('0x30')]=_[_0x72ba('0x31')](_0x1c01b5['model'],_0x1c01b5[_0x72ba('0x2f')]);_0x9fb830['attributes']=_[_0x72ba('0x31')](_0x1c01b5['model'],qs[_0x72ba('0x32')](_0x4af07a[_0x72ba('0x2f')]['fields']));_0x9fb830[_0x72ba('0x33')]=_0x9fb830[_0x72ba('0x33')]['length']?_0x9fb830['attributes']:_0x1c01b5[_0x72ba('0x34')];if(_0x4af07a[_0x72ba('0x2f')][_0x72ba('0x35')]){_0x9fb830['include']=[{'all':!![]}];}_0x9fb830=_[_0x72ba('0x36')]({},_0x9fb830,_0x4af07a[_0x72ba('0x37')]);return db[_0x72ba('0x2d')]['find'](_0x9fb830)['then'](handleEntityNotFound(_0xc0d36a,null))[_0x72ba('0x24')](respondWithResult(_0xc0d36a,null))[_0x72ba('0x38')](handleError(_0xc0d36a,null));};exports['destroy']=function(_0x190030,_0x3af634){return db[_0x72ba('0x2d')][_0x72ba('0x39')]({'where':{'id':_0x190030[_0x72ba('0x2b')]['id']}})[_0x72ba('0x24')](handleEntityNotFound(_0x3af634,null))[_0x72ba('0x24')](removeEntity(_0x3af634,null))['catch'](handleError(_0x3af634,null));};function widgetAttributes(_0xdd12bb){try{switch(_0xdd12bb['type']){case _0x72ba('0x3a'):return[{'name':_0x72ba('0x3b'),'value':_0xdd12bb[_0x72ba('0x3b')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x0]?_0xdd12bb['attrs'][0x0][_0x72ba('0x3d')]:undefined)||'https://'}];case _0x72ba('0x3e'):return[{'name':_0x72ba('0x3f'),'value':_0xdd12bb[_0x72ba('0x3f')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x0]?_0xdd12bb[_0x72ba('0x3c')][0x0][_0x72ba('0x3d')]:undefined)||''}];case'clock':return[{'name':_0x72ba('0x40'),'value':_0xdd12bb[_0x72ba('0x40')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x0]?_0xdd12bb[_0x72ba('0x3c')][0x0][_0x72ba('0x3d')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0xdd12bb['attrTimezone']||(_0xdd12bb['attrs']&&_0xdd12bb[_0x72ba('0x3c')][0x1]?_0xdd12bb[_0x72ba('0x3c')][0x1]['value']:undefined)||'0.00'},{'name':_0x72ba('0x41'),'value':_0xdd12bb[_0x72ba('0x41')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x2]?_0xdd12bb['attrs'][0x2][_0x72ba('0x3d')]:undefined)||0xc}];case _0x72ba('0x42'):return[{'name':_0x72ba('0x43'),'value':_0xdd12bb['attrMetric']||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x0]?_0xdd12bb[_0x72ba('0x3c')][0x0][_0x72ba('0x3d')]:undefined)||'total'},{'name':'attrVoiceQueues','value':_0xdd12bb['attrVoiceQueues']||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x1]?_0xdd12bb[_0x72ba('0x3c')][0x1][_0x72ba('0x3d')]:undefined)||[]},{'name':'attrFontSize','value':_0xdd12bb['attrFontSize']||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x2]?_0xdd12bb[_0x72ba('0x3c')][0x2][_0x72ba('0x3d')]:undefined)||0x14}];case _0x72ba('0x44'):case'pie-chart':return[{'name':'attrSerie1','value':_0xdd12bb[_0x72ba('0x45')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x0]?_0xdd12bb[_0x72ba('0x3c')][0x0]['value']:undefined)||'total'},{'name':_0x72ba('0x46'),'value':_0xdd12bb[_0x72ba('0x46')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x1]?_0xdd12bb[_0x72ba('0x3c')][0x1]['value']:undefined)||null},{'name':_0x72ba('0x47'),'value':_0xdd12bb[_0x72ba('0x47')]||(_0xdd12bb['attrs']&&_0xdd12bb['attrs'][0x2]?_0xdd12bb[_0x72ba('0x3c')][0x2][_0x72ba('0x3d')]:undefined)||null},{'name':_0x72ba('0x48'),'value':_0xdd12bb['attrVoiceQueues']||(_0xdd12bb['attrs']&&_0xdd12bb[_0x72ba('0x3c')][0x3]?_0xdd12bb[_0x72ba('0x3c')][0x3][_0x72ba('0x3d')]:undefined)||[]}];case _0x72ba('0x49'):return[{'name':'attrReport','type':_0xdd12bb[_0x72ba('0x4a')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x0]?_0xdd12bb['attrs'][0x0][_0x72ba('0x4b')]:undefined)||null,'value':_0xdd12bb[_0x72ba('0x4c')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb['attrs'][0x0]?_0xdd12bb[_0x72ba('0x3c')][0x0]['value']:undefined)||null},{'name':_0x72ba('0x4d'),'value':_0xdd12bb[_0x72ba('0x4d')]||(_0xdd12bb[_0x72ba('0x3c')]&&_0xdd12bb[_0x72ba('0x3c')][0x1]?_0xdd12bb[_0x72ba('0x3c')][0x1][_0x72ba('0x3d')]:undefined)||0x0}];default:return[];}}catch(_0x3750c1){logger[_0x72ba('0x27')]('widgetAttributes:\x20%s',JSON[_0x72ba('0x4e')](_0x3750c1));return[];}}exports[_0x72ba('0x4f')]=function(_0x182385,_0x1527ca){if(_0x182385[_0x72ba('0x50')]){_0x182385['body'][_0x72ba('0x3c')]=widgetAttributes(_0x182385['body']);}return db[_0x72ba('0x2d')][_0x72ba('0x4f')](_0x182385[_0x72ba('0x50')],{})[_0x72ba('0x24')](respondWithResult(_0x1527ca,0xc9))[_0x72ba('0x38')](handleError(_0x1527ca,null));};exports[_0x72ba('0x23')]=function(_0x1045aa,_0x534ff8){if(_0x1045aa[_0x72ba('0x50')]['id']){delete _0x1045aa[_0x72ba('0x50')]['id'];}_0x1045aa[_0x72ba('0x50')][_0x72ba('0x3c')]=widgetAttributes(_0x1045aa['body']);return db[_0x72ba('0x2d')]['find']({'where':{'id':_0x1045aa[_0x72ba('0x2b')]['id']}})[_0x72ba('0x24')](handleEntityNotFound(_0x534ff8,null))[_0x72ba('0x24')](saveUpdates(_0x1045aa[_0x72ba('0x50')],null))[_0x72ba('0x24')](respondWithResult(_0x534ff8,null))[_0x72ba('0x38')](handleError(_0x534ff8,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 7aa4528..e75cf9e 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 _0x95d6=['exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2c790d,_0x1da7ae){var _0x23c4c5=function(_0x3f210d){while(--_0x3f210d){_0x2c790d['push'](_0x2c790d['shift']());}};_0x23c4c5(++_0x1da7ae);}(_0x95d6,0xdf));var _0x695d=function(_0x47d29b,_0x337fa5){_0x47d29b=_0x47d29b-0x0;var _0x45ae15=_0x95d6[_0x47d29b];return _0x45ae15;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x695d('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x695d('0x1')](0x0);var events={'afterCreate':_0x695d('0x2'),'afterUpdate':'update','afterDestroy':_0x695d('0x3')};function emitEvent(_0x267acb){return function(_0xc16ac0,_0x34345b,_0x55d893){DashboardItemEvents[_0x695d('0x4')](_0x267acb+':'+_0xc16ac0['id'],_0xc16ac0);DashboardItemEvents[_0x695d('0x4')](_0x267acb,_0xc16ac0);_0x55d893(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x695d('0x5')]=DashboardItemEvents; \ No newline at end of file +var _0x64ea=['DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x46d88f,_0x3dd947){var _0x5c6272=function(_0x5b190c){while(--_0x5b190c){_0x46d88f['push'](_0x46d88f['shift']());}};_0x5c6272(++_0x3dd947);}(_0x64ea,0x80));var _0xa64e=function(_0x3236be,_0x47eb9b){_0x3236be=_0x3236be-0x0;var _0x40a904=_0x64ea[_0x3236be];return _0x40a904;};'use strict';var EventEmitter=require(_0xa64e('0x0'));var DashboardItem=require(_0xa64e('0x1'))['db'][_0xa64e('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xa64e('0x3')](0x0);var events={'afterCreate':_0xa64e('0x4'),'afterUpdate':_0xa64e('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1ca529){return function(_0x409472,_0x4c6a68,_0x59b389){DashboardItemEvents[_0xa64e('0x6')](_0x1ca529+':'+_0x409472['id'],_0x409472);DashboardItemEvents[_0xa64e('0x6')](_0x1ca529,_0x409472);_0x59b389(null);};}for(var e in events){if(events[_0xa64e('0x7')](e)){var event=events[e];DashboardItem[_0xa64e('0x8')](e,emitEvent(event));}}module[_0xa64e('0x9')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 05af1d2..814140e 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 _0x11b8=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x2958c4,_0x491a67){var _0x290bb9=function(_0x2b6e88){while(--_0x2b6e88){_0x2958c4['push'](_0x2958c4['shift']());}};_0x290bb9(++_0x491a67);}(_0x11b8,0x9b));var _0x811b=function(_0x2c9596,_0x10d04a){_0x2c9596=_0x2c9596-0x0;var _0x41adb6=_0x11b8[_0x2c9596];return _0x41adb6;};'use strict';var _=require(_0x811b('0x0'));var util=require(_0x811b('0x1'));var logger=require(_0x811b('0x2'))('api');var moment=require(_0x811b('0x3'));var BPromise=require(_0x811b('0x4'));var rp=require(_0x811b('0x5'));var fs=require('fs');var path=require(_0x811b('0x6'));var rimraf=require('rimraf');var config=require(_0x811b('0x7'));var attributes=require(_0x811b('0x8'));module[_0x811b('0x9')]=function(_0x30d227,_0x3239b3){return _0x30d227[_0x811b('0xa')](_0x811b('0xb'),attributes,{'tableName':_0x811b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa315=['./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x415382,_0x2ffb0c){var _0x13050d=function(_0x42b283){while(--_0x42b283){_0x415382['push'](_0x415382['shift']());}};_0x13050d(++_0x2ffb0c);}(_0xa315,0xec));var _0x5a31=function(_0x575b72,_0x1a7eb1){_0x575b72=_0x575b72-0x0;var _0x561c57=_0xa315[_0x575b72];return _0x561c57;};'use strict';var _=require(_0x5a31('0x0'));var util=require('util');var logger=require(_0x5a31('0x1'))(_0x5a31('0x2'));var moment=require('moment');var BPromise=require(_0x5a31('0x3'));var rp=require(_0x5a31('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a31('0x5'));var config=require('../../config/environment');var attributes=require(_0x5a31('0x6'));module[_0x5a31('0x7')]=function(_0x3b2cd8,_0x15b7ca){return _0x3b2cd8[_0x5a31('0x8')](_0x5a31('0x9'),attributes,{'tableName':_0x5a31('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 329555e..4ebadbe 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 _0xb1ac=['register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboardItem.socket'];(function(_0x138ab1,_0x31cf42){var _0x35288f=function(_0x378758){while(--_0x378758){_0x138ab1['push'](_0x138ab1['shift']());}};_0x35288f(++_0x31cf42);}(_0xb1ac,0x11c));var _0xcb1a=function(_0x63255e,_0x46ad14){_0x63255e=_0x63255e-0x0;var _0x4bf9d3=_0xb1ac[_0x63255e];return _0x4bf9d3;};'use strict';var _=require(_0xcb1a('0x0'));var util=require(_0xcb1a('0x1'));var moment=require(_0xcb1a('0x2'));var BPromise=require(_0xcb1a('0x3'));var rs=require(_0xcb1a('0x4'));var fs=require('fs');var Redis=require(_0xcb1a('0x5'));var db=require(_0xcb1a('0x6'))['db'];var utils=require(_0xcb1a('0x7'));var logger=require(_0xcb1a('0x8'))('rpc');var config=require(_0xcb1a('0x9'));var jayson=require(_0xcb1a('0xa'));var client=jayson[_0xcb1a('0xb')][_0xcb1a('0xc')]({'port':0x232a});config[_0xcb1a('0xd')]=_['defaults'](config[_0xcb1a('0xd')],{'host':_0xcb1a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb1a('0xd')]));require(_0xcb1a('0xf'))[_0xcb1a('0x10')](socket);function respondWithRpcPromise(_0x297ce4,_0x24726e,_0x3274de){return new BPromise(function(_0x153387,_0x2fa045){return client[_0xcb1a('0x11')](_0x297ce4,_0x3274de)[_0xcb1a('0x12')](function(_0x1bd557){logger[_0xcb1a('0x13')](_0xcb1a('0x14'),_0x24726e,'request\x20sent');logger[_0xcb1a('0x15')](_0xcb1a('0x16'),_0x24726e,_0xcb1a('0x17'),JSON[_0xcb1a('0x18')](_0x1bd557));if(_0x1bd557['error']){if(_0x1bd557['error'][_0xcb1a('0x19')]===0x1f4){logger[_0xcb1a('0x1a')](_0xcb1a('0x14'),_0x24726e,_0x1bd557['error']['message']);return _0x2fa045(_0x1bd557[_0xcb1a('0x1a')][_0xcb1a('0x1b')]);}logger[_0xcb1a('0x1a')](_0xcb1a('0x14'),_0x24726e,_0x1bd557[_0xcb1a('0x1a')]['message']);return _0x153387(_0x1bd557[_0xcb1a('0x1a')][_0xcb1a('0x1b')]);}else{logger[_0xcb1a('0x13')]('DashboardItem,\x20%s,\x20%s',_0x24726e,'request\x20sent');_0x153387(_0x1bd557[_0xcb1a('0x1c')][_0xcb1a('0x1b')]);}})[_0xcb1a('0x1d')](function(_0x9415b1){logger[_0xcb1a('0x1a')](_0xcb1a('0x14'),_0x24726e,_0x9415b1);_0x2fa045(_0x9415b1);});});} \ No newline at end of file +var _0xe4fc=['request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s'];(function(_0x5cfe97,_0x5d1e1c){var _0x721e3b=function(_0x5b7064){while(--_0x5b7064){_0x5cfe97['push'](_0x5cfe97['shift']());}};_0x721e3b(++_0x5d1e1c);}(_0xe4fc,0x75));var _0xce4f=function(_0x25023b,_0x383839){_0x25023b=_0x25023b-0x0;var _0x48b984=_0xe4fc[_0x25023b];return _0x48b984;};'use strict';var _=require(_0xce4f('0x0'));var util=require('util');var moment=require(_0xce4f('0x1'));var BPromise=require(_0xce4f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce4f('0x3'));var db=require(_0xce4f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xce4f('0x5'));var config=require(_0xce4f('0x6'));var jayson=require(_0xce4f('0x7'));var client=jayson[_0xce4f('0x8')][_0xce4f('0x9')]({'port':0x232a});config[_0xce4f('0xa')]=_['defaults'](config[_0xce4f('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xce4f('0xb'))['register'](socket);function respondWithRpcPromise(_0x2fa19b,_0x2f1893,_0x1dcc4c){return new BPromise(function(_0x289f19,_0x56500b){return client[_0xce4f('0xc')](_0x2fa19b,_0x1dcc4c)['then'](function(_0x339d0c){logger[_0xce4f('0xd')](_0xce4f('0xe'),_0x2f1893,_0xce4f('0xf'));logger['debug'](_0xce4f('0x10'),_0x2f1893,'request\x20sent',JSON['stringify'](_0x339d0c));if(_0x339d0c[_0xce4f('0x11')]){if(_0x339d0c['error'][_0xce4f('0x12')]===0x1f4){logger['error']('DashboardItem,\x20%s,\x20%s',_0x2f1893,_0x339d0c['error']['message']);return _0x56500b(_0x339d0c[_0xce4f('0x11')][_0xce4f('0x13')]);}logger[_0xce4f('0x11')](_0xce4f('0xe'),_0x2f1893,_0x339d0c[_0xce4f('0x11')]['message']);return _0x289f19(_0x339d0c['error'][_0xce4f('0x13')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x2f1893,_0xce4f('0xf'));_0x289f19(_0x339d0c[_0xce4f('0x14')][_0xce4f('0x13')]);}})[_0xce4f('0x15')](function(_0x37f6ea){logger[_0xce4f('0x11')]('DashboardItem,\x20%s,\x20%s',_0x2f1893,_0x37f6ea);_0x56500b(_0x37f6ea);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index cc2324b..0aad4c1 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 _0x63b4=['emit','register','length','./dashboardItem.events','save','update'];(function(_0x59cda9,_0x47d4c4){var _0x26c18f=function(_0x4cff5f){while(--_0x4cff5f){_0x59cda9['push'](_0x59cda9['shift']());}};_0x26c18f(++_0x47d4c4);}(_0x63b4,0xf3));var _0x463b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x63b4[_0x20a584];return _0x4b41a8;};'use strict';var DashboardItemEvents=require(_0x463b('0x0'));var events=[_0x463b('0x1'),'remove',_0x463b('0x2')];function createListener(_0x2146bd,_0x4ffd35){return function(_0x212ce6){_0x4ffd35[_0x463b('0x3')](_0x2146bd,_0x212ce6);};}function removeListener(_0x55908f,_0x558bc2){return function(){DashboardItemEvents['removeListener'](_0x55908f,_0x558bc2);};}exports[_0x463b('0x4')]=function(_0x5c8f4a){for(var _0x313c4b=0x0,_0x3f2bc9=events[_0x463b('0x5')];_0x313c4b<_0x3f2bc9;_0x313c4b++){var _0x468d76=events[_0x313c4b];var _0x18ad2a=createListener('dashboardItem:'+_0x468d76,_0x5c8f4a);DashboardItemEvents['on'](_0x468d76,_0x18ad2a);}}; \ No newline at end of file +var _0xb10f=['dashboardItem:','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0x55b461,_0x4f99b3){var _0x4486e7=function(_0x51c9b9){while(--_0x51c9b9){_0x55b461['push'](_0x55b461['shift']());}};_0x4486e7(++_0x4f99b3);}(_0xb10f,0x71));var _0xfb10=function(_0x2cb251,_0x1b9104){_0x2cb251=_0x2cb251-0x0;var _0x62d2ab=_0xb10f[_0x2cb251];return _0x62d2ab;};'use strict';var DashboardItemEvents=require(_0xfb10('0x0'));var events=[_0xfb10('0x1'),_0xfb10('0x2'),_0xfb10('0x3')];function createListener(_0x5207fd,_0x274f1c){return function(_0x369418){_0x274f1c[_0xfb10('0x4')](_0x5207fd,_0x369418);};}function removeListener(_0x36766b,_0x53636a){return function(){DashboardItemEvents[_0xfb10('0x5')](_0x36766b,_0x53636a);};}exports[_0xfb10('0x6')]=function(_0x2ce218){for(var _0x378494=0x0,_0x2bf691=events['length'];_0x378494<_0x2bf691;_0x378494++){var _0x16e99c=events[_0x378494];var _0x4c64ab=createListener(_0xfb10('0x7')+_0x16e99c,_0x2ce218);DashboardItemEvents['on'](_0x16e99c,_0x4c64ab);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 3e99eaa..730b2bc 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 _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x5fab,0x177));var _0xb5fa=function(_0x39fe3f,_0x38b8eb){_0x39fe3f=_0x39fe3f-0x0;var _0x50d483=_0x5fab[_0x39fe3f];return _0x50d483;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')](_0xb5fa('0xa'),auth[_0xb5fa('0xb')](),controller['show']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0xd')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);module[_0xb5fa('0x11')]=router; \ No newline at end of file +var _0xdc97=['../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service'];(function(_0x3ebb04,_0x1a63a6){var _0x535db0=function(_0x651fb4){while(--_0x651fb4){_0x3ebb04['push'](_0x3ebb04['shift']());}};_0x535db0(++_0x1a63a6);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2fd2d0,_0x5c9064){_0x2fd2d0=_0x2fd2d0-0x0;var _0x46555c=_0xdc97[_0x2fd2d0];return _0x46555c;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var auth=require(_0x7dc9('0x4'));var interaction=require(_0x7dc9('0x5'));var config=require('../../config/environment');var controller=require(_0x7dc9('0x6'));router[_0x7dc9('0x7')](_0x7dc9('0x8'),auth[_0x7dc9('0x9')](),controller['show']);router[_0x7dc9('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7dc9('0xb')](_0x7dc9('0x8'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router[_0x7dc9('0xd')]('/:id',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xe')]);module[_0x7dc9('0xf')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index c6d6e4d..5d4da46 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 _0xb41d=['STRING','sequelize','exports'];(function(_0x4129f6,_0x18809c){var _0x5dbc91=function(_0x99bf34){while(--_0x99bf34){_0x4129f6['push'](_0x4129f6['shift']());}};_0x5dbc91(++_0x18809c);}(_0xb41d,0x154));var _0xdb41=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xb41d[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0xdb41('0x0'));module[_0xdb41('0x1')]={'name':{'type':Sequelize[_0xdb41('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x602e=['sequelize','exports'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x602e,0x122));var _0xe602=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x602e[_0x412e27];return _0x53da42;};'use strict';var Sequelize=require(_0xe602('0x0'));module[_0xe602('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 9f2acd5..dc50c3c 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 _0xd6d6=['sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','stack','name','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order'];(function(_0x526b94,_0x5a3fe7){var _0x20e2dd=function(_0x364907){while(--_0x364907){_0x526b94['push'](_0x526b94['shift']());}};_0x20e2dd(++_0x5a3fe7);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xb98170,_0x3aede9){_0xb98170=_0xb98170-0x0;var _0x40b09f=_0xd6d6[_0xb98170];return _0x40b09f;};'use strict';var pdf=require(_0x6d6d('0x0'));var emlformat=require(_0x6d6d('0x1'));var rimraf=require(_0x6d6d('0x2'));var zipdir=require(_0x6d6d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d6d('0x4'));var moment=require(_0x6d6d('0x5'));var BPromise=require(_0x6d6d('0x6'));var Mustache=require(_0x6d6d('0x7'));var util=require(_0x6d6d('0x8'));var path=require(_0x6d6d('0x9'));var sox=require(_0x6d6d('0xa'));var csv=require('to-csv');var ejs=require(_0x6d6d('0xb'));var fs=require('fs');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('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x12'));var authService=require(_0x6d6d('0x13'));var qs=require(_0x6d6d('0x14'));var as=require(_0x6d6d('0x15'));var hardwareService=require(_0x6d6d('0x16'));var logger=require('../../config/logger')(_0x6d6d('0x17'));var utils=require(_0x6d6d('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x176618,_0x32146d){_0x32146d=_0x32146d||0xcc;return function(_0xe61c36){if(_0xe61c36){return _0x176618[_0x6d6d('0x19')](_0x32146d);}return _0x176618[_0x6d6d('0x1a')](_0x32146d)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x19cf50,_0x2cb2dd){_0x2cb2dd=_0x2cb2dd||0xc8;return function(_0x5f4154){if(_0x5f4154){return _0x19cf50[_0x6d6d('0x1a')](_0x2cb2dd)[_0x6d6d('0x1c')](_0x5f4154);}};}function respondWithFilteredResult(_0x1f2aac,_0xa3b05d){return function(_0x29cbd8){if(_0x29cbd8){var _0x5d80c0=_0x29cbd8[_0x6d6d('0x1d')],_0x2e6fdb=_0xa3b05d[_0x6d6d('0x1e')],_0x587338=_0xa3b05d['offset']+_0xa3b05d['limit'],_0x27830d;if(_0x587338>=_0x5d80c0){_0x587338=_0x5d80c0;_0x27830d=0xc8;}else{_0x27830d=0xce;}_0x1f2aac[_0x6d6d('0x1a')](_0x27830d);return _0x1f2aac[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x2e6fdb+'-'+_0x587338+'/'+_0x5d80c0)[_0x6d6d('0x1c')](_0x29cbd8);}return null;};}function patchUpdates(_0x51fff6){return function(_0x554392){try{jsonpatch[_0x6d6d('0x21')](_0x554392,_0x51fff6,!![]);}catch(_0x5a5855){return BPromise[_0x6d6d('0x22')](_0x5a5855);}return _0x554392[_0x6d6d('0x23')]();};}function saveUpdates(_0x30d87d,_0x450352){return function(_0x40d35b){if(_0x40d35b){return _0x40d35b[_0x6d6d('0x24')](_0x30d87d)[_0x6d6d('0x25')](function(_0x230ad7){return _0x230ad7;});}return null;};}function removeEntity(_0x115a3c,_0x6f64e3){return function(_0x24b10d){if(_0x24b10d){return _0x24b10d[_0x6d6d('0x26')]()[_0x6d6d('0x25')](function(){var _0x21b95d=_0x24b10d[_0x6d6d('0x27')]({'plain':!![]});var _0x25a02e=_0x6d6d('0x28');return db['UserProfileResource'][_0x6d6d('0x26')]({'where':{'type':_0x25a02e,'resourceId':_0x21b95d['id']}})[_0x6d6d('0x25')](function(){return _0x24b10d;});})[_0x6d6d('0x25')](function(){_0x115a3c[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x12fab2,_0x554f8e){return function(_0x2851dd){if(!_0x2851dd){_0x12fab2[_0x6d6d('0x19')](0x194);}return _0x2851dd;};}function handleError(_0x235451,_0x126ac8){_0x126ac8=_0x126ac8||0x1f4;return function(_0x25c121){logger[_0x6d6d('0x29')](_0x25c121[_0x6d6d('0x2a')]);if(_0x25c121['name']){delete _0x25c121[_0x6d6d('0x2b')];}_0x235451[_0x6d6d('0x1a')](_0x126ac8)['send'](_0x25c121);};}exports['index']=function(_0x3edcce,_0x5273cd){var _0x8a9a84={},_0x57341f={},_0xde3272={'count':0x0,'rows':[]};var _0x20255e=_[_0x6d6d('0x2c')](db[_0x6d6d('0x2d')][_0x6d6d('0x2e')],function(_0x428c17){return{'name':_0x428c17[_0x6d6d('0x2f')],'type':_0x428c17[_0x6d6d('0x30')][_0x6d6d('0x31')]};});_0x57341f[_0x6d6d('0x32')]=_['map'](_0x20255e,_0x6d6d('0x2b'));_0x57341f['query']=_[_0x6d6d('0x33')](_0x3edcce[_0x6d6d('0x34')]);_0x57341f[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x57341f['model'],_0x57341f[_0x6d6d('0x34')]);_0x8a9a84['attributes']=_[_0x6d6d('0x36')](_0x57341f[_0x6d6d('0x32')],qs['fields'](_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x37')]));_0x8a9a84[_0x6d6d('0x38')]=_0x8a9a84[_0x6d6d('0x38')][_0x6d6d('0x39')]?_0x8a9a84[_0x6d6d('0x38')]:_0x57341f[_0x6d6d('0x32')];if(!_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x8a9a84[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3c')](_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x3c')]);_0x8a9a84['offset']=qs[_0x6d6d('0x1e')](_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x1e')]);}_0x8a9a84[_0x6d6d('0x3d')]=qs['sort'](_0x3edcce['query'][_0x6d6d('0x3e')]);_0x8a9a84[_0x6d6d('0x3f')]=qs[_0x6d6d('0x35')](_['pick'](_0x3edcce[_0x6d6d('0x34')],_0x57341f[_0x6d6d('0x35')]));if(_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x8a9a84['where']=_['merge'](_0x8a9a84['where'],{'$or':_[_0x6d6d('0x2c')](_0x20255e,function(_0x4196f0){if(_0x4196f0[_0x6d6d('0x30')]!==_0x6d6d('0x41')){var _0x4e918b={};_0x4e918b[_0x4196f0[_0x6d6d('0x2b')]]={'$like':'%'+_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x4e918b;}})});}_0x8a9a84=_[_0x6d6d('0x42')]({},_0x8a9a84,_0x3edcce[_0x6d6d('0x43')]);var _0x38ae8c={'where':_0x8a9a84['where']};return db[_0x6d6d('0x2d')][_0x6d6d('0x1d')](_0x38ae8c)[_0x6d6d('0x25')](function(_0x1f4160){_0xde3272[_0x6d6d('0x1d')]=_0x1f4160;if(_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x8a9a84['include']=[{'all':!![]}];}return db[_0x6d6d('0x2d')][_0x6d6d('0x45')](_0x8a9a84);})[_0x6d6d('0x25')](function(_0x2107e0){_0xde3272[_0x6d6d('0x46')]=_0x2107e0;return _0xde3272;})['then'](respondWithFilteredResult(_0x5273cd,_0x8a9a84))[_0x6d6d('0x47')](handleError(_0x5273cd,null));};exports[_0x6d6d('0x48')]=function(_0x55dba8,_0x452de2){var _0x50dc17={'raw':!![],'where':{'id':_0x55dba8[_0x6d6d('0x49')]['id']}},_0x15bf62={};_0x15bf62['model']=_[_0x6d6d('0x33')](db[_0x6d6d('0x2d')][_0x6d6d('0x2e')]);_0x15bf62[_0x6d6d('0x34')]=_[_0x6d6d('0x33')](_0x55dba8['query']);_0x15bf62['filters']=_[_0x6d6d('0x36')](_0x15bf62['model'],_0x15bf62['query']);_0x50dc17[_0x6d6d('0x38')]=_[_0x6d6d('0x36')](_0x15bf62[_0x6d6d('0x32')],qs['fields'](_0x55dba8[_0x6d6d('0x34')]['fields']));_0x50dc17[_0x6d6d('0x38')]=_0x50dc17[_0x6d6d('0x38')][_0x6d6d('0x39')]?_0x50dc17[_0x6d6d('0x38')]:_0x15bf62[_0x6d6d('0x32')];if(_0x55dba8[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x50dc17['include']=[{'all':!![]}];}_0x50dc17=_[_0x6d6d('0x42')]({},_0x50dc17,_0x55dba8[_0x6d6d('0x43')]);return db[_0x6d6d('0x2d')][_0x6d6d('0x4a')](_0x50dc17)[_0x6d6d('0x25')](handleEntityNotFound(_0x452de2,null))[_0x6d6d('0x25')](respondWithResult(_0x452de2,null))[_0x6d6d('0x47')](handleError(_0x452de2,null));};exports[_0x6d6d('0x4b')]=function(_0x24cec2,_0x5e4c04){return db['Disposition'][_0x6d6d('0x4b')](_0x24cec2[_0x6d6d('0x4c')],{})[_0x6d6d('0x25')](function(_0x622c23){var _0xe2a20e=_0x24cec2['user'][_0x6d6d('0x27')]({'plain':!![]});if(!_0xe2a20e)throw new Error(_0x6d6d('0x4d'));if(_0xe2a20e[_0x6d6d('0x4e')]===_0x6d6d('0x4f')){var _0x2ee917=_0x622c23[_0x6d6d('0x27')]({'plain':!![]});var _0x1f7a09=_0x6d6d('0x28');return db[_0x6d6d('0x50')][_0x6d6d('0x4a')]({'where':{'name':_0x1f7a09,'userProfileId':_0xe2a20e[_0x6d6d('0x51')]},'raw':!![]})[_0x6d6d('0x25')](function(_0x4d9811){if(_0x4d9811&&_0x4d9811[_0x6d6d('0x52')]===0x0){return db[_0x6d6d('0x53')][_0x6d6d('0x4b')]({'name':_0x2ee917[_0x6d6d('0x2b')],'resourceId':_0x2ee917['id'],'type':_0x4d9811[_0x6d6d('0x2b')],'sectionId':_0x4d9811['id']},{})['then'](function(){return _0x622c23;});}else{return _0x622c23;}})[_0x6d6d('0x47')](function(_0x36bc5a){logger[_0x6d6d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36bc5a);throw _0x36bc5a;});}return _0x622c23;})['then'](respondWithResult(_0x5e4c04,0xc9))[_0x6d6d('0x47')](handleError(_0x5e4c04,null));};exports['update']=function(_0x3ea57e,_0x995fe2){if(_0x3ea57e[_0x6d6d('0x4c')]['id']){delete _0x3ea57e[_0x6d6d('0x4c')]['id'];}return db[_0x6d6d('0x2d')][_0x6d6d('0x4a')]({'where':{'id':_0x3ea57e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x25')](handleEntityNotFound(_0x995fe2,null))[_0x6d6d('0x25')](saveUpdates(_0x3ea57e[_0x6d6d('0x4c')],null))['then'](respondWithResult(_0x995fe2,null))[_0x6d6d('0x47')](handleError(_0x995fe2,null));};exports[_0x6d6d('0x26')]=function(_0x3b1213,_0x8000b6){return db[_0x6d6d('0x2d')][_0x6d6d('0x4a')]({'where':{'id':_0x3b1213[_0x6d6d('0x49')]['id']}})['then'](handleEntityNotFound(_0x8000b6,null))['then'](removeEntity(_0x8000b6,null))[_0x6d6d('0x47')](handleError(_0x8000b6,null));}; \ No newline at end of file +var _0x3e74=['rows','catch','params','create','body','user','get','Dispositions','UserProfileSection','find','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','order','sort','where','filter','merge','options','includeAll','include','findAll'];(function(_0x4f952b,_0x1706b0){var _0x5923a4=function(_0xd9aff){while(--_0xd9aff){_0x4f952b['push'](_0x4f952b['shift']());}};_0x5923a4(++_0x1706b0);}(_0x3e74,0x175));var _0x43e7=function(_0x2ff2f0,_0x49663c){_0x2ff2f0=_0x2ff2f0-0x0;var _0x5f054c=_0x3e74[_0x2ff2f0];return _0x5f054c;};'use strict';var pdf=require(_0x43e7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x43e7('0x1'));var zipdir=require(_0x43e7('0x2'));var jsonpatch=require(_0x43e7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x43e7('0x4'));var Mustache=require('mustache');var util=require(_0x43e7('0x5'));var path=require(_0x43e7('0x6'));var sox=require(_0x43e7('0x7'));var csv=require(_0x43e7('0x8'));var ejs=require(_0x43e7('0x9'));var fs=require('fs');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('0x8'));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 db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eb206,_0xc960ea){_0xc960ea=_0xc960ea||0xcc;return function(_0x2718d3){if(_0x2718d3){return _0x3eb206[_0x43e7('0x14')](_0xc960ea);}return _0x3eb206['status'](_0xc960ea)['end']();};}function respondWithResult(_0x2fcb36,_0x21fdd3){_0x21fdd3=_0x21fdd3||0xc8;return function(_0x44b0bd){if(_0x44b0bd){return _0x2fcb36['status'](_0x21fdd3)['json'](_0x44b0bd);}};}function respondWithFilteredResult(_0x16849c,_0x14c146){return function(_0x203378){if(_0x203378){var _0x328445=_0x203378[_0x43e7('0x15')],_0x4de324=_0x14c146[_0x43e7('0x16')],_0x5c4eaa=_0x14c146['offset']+_0x14c146['limit'],_0xdf16c;if(_0x5c4eaa>=_0x328445){_0x5c4eaa=_0x328445;_0xdf16c=0xc8;}else{_0xdf16c=0xce;}_0x16849c[_0x43e7('0x17')](_0xdf16c);return _0x16849c[_0x43e7('0x18')](_0x43e7('0x19'),_0x4de324+'-'+_0x5c4eaa+'/'+_0x328445)[_0x43e7('0x1a')](_0x203378);}return null;};}function patchUpdates(_0x3776f5){return function(_0x1f24fb){try{jsonpatch[_0x43e7('0x1b')](_0x1f24fb,_0x3776f5,!![]);}catch(_0x1441ef){return BPromise[_0x43e7('0x1c')](_0x1441ef);}return _0x1f24fb[_0x43e7('0x1d')]();};}function saveUpdates(_0x191dd5,_0x177ee1){return function(_0x4b5d64){if(_0x4b5d64){return _0x4b5d64[_0x43e7('0x1e')](_0x191dd5)[_0x43e7('0x1f')](function(_0x4b386b){return _0x4b386b;});}return null;};}function removeEntity(_0x2898b5,_0x3e281e){return function(_0x3945bb){if(_0x3945bb){return _0x3945bb[_0x43e7('0x20')]()[_0x43e7('0x1f')](function(){var _0x2f4cb4=_0x3945bb['get']({'plain':!![]});var _0x454359='Dispositions';return db['UserProfileResource'][_0x43e7('0x20')]({'where':{'type':_0x454359,'resourceId':_0x2f4cb4['id']}})[_0x43e7('0x1f')](function(){return _0x3945bb;});})['then'](function(){_0x2898b5[_0x43e7('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x326dab,_0x5c5e67){return function(_0x1af208){if(!_0x1af208){_0x326dab[_0x43e7('0x14')](0x194);}return _0x1af208;};}function handleError(_0x20888b,_0x405f85){_0x405f85=_0x405f85||0x1f4;return function(_0x51f4d7){logger['error'](_0x51f4d7[_0x43e7('0x21')]);if(_0x51f4d7['name']){delete _0x51f4d7[_0x43e7('0x22')];}_0x20888b[_0x43e7('0x17')](_0x405f85)[_0x43e7('0x23')](_0x51f4d7);};}exports[_0x43e7('0x24')]=function(_0x5087d7,_0x33a1a5){var _0x4690a6={},_0x45b675={},_0x50f9f5={'count':0x0,'rows':[]};var _0x442c3b=_[_0x43e7('0x25')](db[_0x43e7('0x26')][_0x43e7('0x27')],function(_0x3bf475){return{'name':_0x3bf475[_0x43e7('0x28')],'type':_0x3bf475[_0x43e7('0x29')][_0x43e7('0x2a')]};});_0x45b675[_0x43e7('0x2b')]=_[_0x43e7('0x25')](_0x442c3b,'name');_0x45b675[_0x43e7('0x2c')]=_[_0x43e7('0x2d')](_0x5087d7[_0x43e7('0x2c')]);_0x45b675[_0x43e7('0x2e')]=_[_0x43e7('0x2f')](_0x45b675['model'],_0x45b675[_0x43e7('0x2c')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x2f')](_0x45b675[_0x43e7('0x2b')],qs['fields'](_0x5087d7['query']['fields']));_0x4690a6[_0x43e7('0x30')]=_0x4690a6[_0x43e7('0x30')][_0x43e7('0x31')]?_0x4690a6[_0x43e7('0x30')]:_0x45b675[_0x43e7('0x2b')];if(!_0x5087d7[_0x43e7('0x2c')]['hasOwnProperty']('nolimit')){_0x4690a6['limit']=qs['limit'](_0x5087d7['query']['limit']);_0x4690a6['offset']=qs[_0x43e7('0x16')](_0x5087d7['query'][_0x43e7('0x16')]);}_0x4690a6[_0x43e7('0x32')]=qs[_0x43e7('0x33')](_0x5087d7[_0x43e7('0x2c')][_0x43e7('0x33')]);_0x4690a6[_0x43e7('0x34')]=qs[_0x43e7('0x2e')](_['pick'](_0x5087d7['query'],_0x45b675['filters']));if(_0x5087d7[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x4690a6[_0x43e7('0x34')]=_[_0x43e7('0x36')](_0x4690a6[_0x43e7('0x34')],{'$or':_[_0x43e7('0x25')](_0x442c3b,function(_0x1d4589){if(_0x1d4589[_0x43e7('0x29')]!=='VIRTUAL'){var _0x61ed8e={};_0x61ed8e[_0x1d4589[_0x43e7('0x22')]]={'$like':'%'+_0x5087d7['query'][_0x43e7('0x35')]+'%'};return _0x61ed8e;}})});}_0x4690a6=_['merge']({},_0x4690a6,_0x5087d7[_0x43e7('0x37')]);var _0x2ad008={'where':_0x4690a6[_0x43e7('0x34')]};return db[_0x43e7('0x26')][_0x43e7('0x15')](_0x2ad008)[_0x43e7('0x1f')](function(_0x5e731b){_0x50f9f5['count']=_0x5e731b;if(_0x5087d7[_0x43e7('0x2c')][_0x43e7('0x38')]){_0x4690a6[_0x43e7('0x39')]=[{'all':!![]}];}return db[_0x43e7('0x26')][_0x43e7('0x3a')](_0x4690a6);})['then'](function(_0x32a451){_0x50f9f5[_0x43e7('0x3b')]=_0x32a451;return _0x50f9f5;})['then'](respondWithFilteredResult(_0x33a1a5,_0x4690a6))[_0x43e7('0x3c')](handleError(_0x33a1a5,null));};exports['show']=function(_0x2ad8ef,_0x504101){var _0x3d81ae={'raw':!![],'where':{'id':_0x2ad8ef[_0x43e7('0x3d')]['id']}},_0x3b4235={};_0x3b4235[_0x43e7('0x2b')]=_['keys'](db['Disposition'][_0x43e7('0x27')]);_0x3b4235[_0x43e7('0x2c')]=_[_0x43e7('0x2d')](_0x2ad8ef[_0x43e7('0x2c')]);_0x3b4235['filters']=_['intersection'](_0x3b4235['model'],_0x3b4235[_0x43e7('0x2c')]);_0x3d81ae['attributes']=_[_0x43e7('0x2f')](_0x3b4235['model'],qs['fields'](_0x2ad8ef[_0x43e7('0x2c')]['fields']));_0x3d81ae[_0x43e7('0x30')]=_0x3d81ae[_0x43e7('0x30')][_0x43e7('0x31')]?_0x3d81ae[_0x43e7('0x30')]:_0x3b4235['model'];if(_0x2ad8ef[_0x43e7('0x2c')][_0x43e7('0x38')]){_0x3d81ae[_0x43e7('0x39')]=[{'all':!![]}];}_0x3d81ae=_[_0x43e7('0x36')]({},_0x3d81ae,_0x2ad8ef[_0x43e7('0x37')]);return db[_0x43e7('0x26')]['find'](_0x3d81ae)['then'](handleEntityNotFound(_0x504101,null))[_0x43e7('0x1f')](respondWithResult(_0x504101,null))[_0x43e7('0x3c')](handleError(_0x504101,null));};exports[_0x43e7('0x3e')]=function(_0x4c00a8,_0x5c1c18){return db['Disposition'][_0x43e7('0x3e')](_0x4c00a8[_0x43e7('0x3f')],{})['then'](function(_0x351ca2){var _0x47686e=_0x4c00a8[_0x43e7('0x40')]['get']({'plain':!![]});if(!_0x47686e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47686e['role']==='user'){var _0x214e7e=_0x351ca2[_0x43e7('0x41')]({'plain':!![]});var _0x52fea5=_0x43e7('0x42');return db[_0x43e7('0x43')][_0x43e7('0x44')]({'where':{'name':_0x52fea5,'userProfileId':_0x47686e[_0x43e7('0x45')]},'raw':!![]})['then'](function(_0x2718d5){if(_0x2718d5&&_0x2718d5['autoAssociation']===0x0){return db['UserProfileResource'][_0x43e7('0x3e')]({'name':_0x214e7e[_0x43e7('0x22')],'resourceId':_0x214e7e['id'],'type':_0x2718d5[_0x43e7('0x22')],'sectionId':_0x2718d5['id']},{})[_0x43e7('0x1f')](function(){return _0x351ca2;});}else{return _0x351ca2;}})[_0x43e7('0x3c')](function(_0x2351cf){logger[_0x43e7('0x46')](_0x43e7('0x47'),_0x2351cf);throw _0x2351cf;});}return _0x351ca2;})[_0x43e7('0x1f')](respondWithResult(_0x5c1c18,0xc9))[_0x43e7('0x3c')](handleError(_0x5c1c18,null));};exports['update']=function(_0x119d34,_0x46c910){if(_0x119d34['body']['id']){delete _0x119d34[_0x43e7('0x3f')]['id'];}return db['Disposition'][_0x43e7('0x44')]({'where':{'id':_0x119d34[_0x43e7('0x3d')]['id']}})[_0x43e7('0x1f')](handleEntityNotFound(_0x46c910,null))[_0x43e7('0x1f')](saveUpdates(_0x119d34[_0x43e7('0x3f')],null))['then'](respondWithResult(_0x46c910,null))['catch'](handleError(_0x46c910,null));};exports[_0x43e7('0x20')]=function(_0x2ab7ee,_0x399942){return db[_0x43e7('0x26')][_0x43e7('0x44')]({'where':{'id':_0x2ab7ee[_0x43e7('0x3d')]['id']}})[_0x43e7('0x1f')](handleEntityNotFound(_0x399942,null))[_0x43e7('0x1f')](removeEntity(_0x399942,null))[_0x43e7('0x3c')](handleError(_0x399942,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 8838b70..87d4644 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 _0xa3ca=['Disposition','tools_dispositions','name','name_chat','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./disposition.attributes','exports','define'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xa3ca,0x8f));var _0xaa3c=function(_0x2e48c9,_0x21d729){_0x2e48c9=_0x2e48c9-0x0;var _0x1e657f=_0xa3ca[_0x2e48c9];return _0x1e657f;};'use strict';var _=require(_0xaa3c('0x0'));var util=require(_0xaa3c('0x1'));var logger=require(_0xaa3c('0x2'))(_0xaa3c('0x3'));var moment=require(_0xaa3c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa3c('0x5'));var rimraf=require(_0xaa3c('0x6'));var config=require(_0xaa3c('0x7'));var attributes=require(_0xaa3c('0x8'));module[_0xaa3c('0x9')]=function(_0x3c9bcb,_0x38d3b8){return _0x3c9bcb[_0xaa3c('0xa')](_0xaa3c('0xb'),attributes,{'tableName':_0xaa3c('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xaa3c('0xd'),'ListId']},{'unique':!![],'name':_0xaa3c('0xe'),'fields':[_0xaa3c('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0xaa3c('0xf'),'fields':[_0xaa3c('0xd'),_0xaa3c('0x10')]},{'unique':!![],'name':_0xaa3c('0x11'),'fields':[_0xaa3c('0xd'),'SmsAccountId']},{'unique':!![],'name':_0xaa3c('0x12'),'fields':[_0xaa3c('0xd'),_0xaa3c('0x13')]},{'unique':!![],'name':_0xaa3c('0x14'),'fields':[_0xaa3c('0xd'),_0xaa3c('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa752=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_sms','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId','../../config/logger'];(function(_0x16e73a,_0x146629){var _0x187aa1=function(_0x26eb2f){while(--_0x26eb2f){_0x16e73a['push'](_0x16e73a['shift']());}};_0x187aa1(++_0x146629);}(_0xa752,0x16f));var _0x2a75=function(_0x8ebbc3,_0x22da42){_0x8ebbc3=_0x8ebbc3-0x0;var _0x3ab20b=_0xa752[_0x8ebbc3];return _0x3ab20b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2a75('0x0'))(_0x2a75('0x1'));var moment=require(_0x2a75('0x2'));var BPromise=require(_0x2a75('0x3'));var rp=require(_0x2a75('0x4'));var fs=require('fs');var path=require(_0x2a75('0x5'));var rimraf=require(_0x2a75('0x6'));var config=require(_0x2a75('0x7'));var attributes=require(_0x2a75('0x8'));module[_0x2a75('0x9')]=function(_0x35030f,_0x43be77){return _0x35030f[_0x2a75('0xa')](_0x2a75('0xb'),attributes,{'tableName':_0x2a75('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x2a75('0xd'),'fields':[_0x2a75('0xe'),_0x2a75('0xf')]},{'unique':!![],'name':_0x2a75('0x10'),'fields':['name',_0x2a75('0x11')]},{'unique':!![],'name':'name_mail','fields':['name','MailAccountId']},{'unique':!![],'name':_0x2a75('0x12'),'fields':[_0x2a75('0xe'),_0x2a75('0x13')]},{'unique':!![],'name':_0x2a75('0x14'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x2a75('0x15'),'fields':[_0x2a75('0xe'),_0x2a75('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index b6128b2..774ba23 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 _0x0718=['error','code','message','Disposition,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','request\x20sent'];(function(_0x7df8aa,_0x425b33){var _0x49e41a=function(_0xdc0e76){while(--_0xdc0e76){_0x7df8aa['push'](_0x7df8aa['shift']());}};_0x49e41a(++_0x425b33);}(_0x0718,0x92));var _0x8071=function(_0x5c7f24,_0xadf13){_0x5c7f24=_0x5c7f24-0x0;var _0x2ca339=_0x0718[_0x5c7f24];return _0x2ca339;};'use strict';var _=require('lodash');var util=require(_0x8071('0x0'));var moment=require(_0x8071('0x1'));var BPromise=require(_0x8071('0x2'));var rs=require(_0x8071('0x3'));var fs=require('fs');var Redis=require(_0x8071('0x4'));var db=require(_0x8071('0x5'))['db'];var utils=require(_0x8071('0x6'));var logger=require(_0x8071('0x7'))(_0x8071('0x8'));var config=require(_0x8071('0x9'));var jayson=require(_0x8071('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf94ce,_0x1a614e,_0xb33a86){return new BPromise(function(_0x300723,_0x2e8440){return client['request'](_0xf94ce,_0xb33a86)[_0x8071('0xb')](function(_0xaa6b87){logger[_0x8071('0xc')]('Disposition,\x20%s,\x20%s',_0x1a614e,_0x8071('0xd'));logger['debug']('Disposition,\x20%s,\x20%s,\x20%s',_0x1a614e,_0x8071('0xd'),JSON['stringify'](_0xaa6b87));if(_0xaa6b87[_0x8071('0xe')]){if(_0xaa6b87[_0x8071('0xe')][_0x8071('0xf')]===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x1a614e,_0xaa6b87[_0x8071('0xe')][_0x8071('0x10')]);return _0x2e8440(_0xaa6b87[_0x8071('0xe')]['message']);}logger[_0x8071('0xe')](_0x8071('0x11'),_0x1a614e,_0xaa6b87[_0x8071('0xe')][_0x8071('0x10')]);return _0x300723(_0xaa6b87[_0x8071('0xe')][_0x8071('0x10')]);}else{logger[_0x8071('0xc')](_0x8071('0x11'),_0x1a614e,_0x8071('0xd'));_0x300723(_0xaa6b87[_0x8071('0x12')][_0x8071('0x10')]);}})[_0x8071('0x13')](function(_0x5276bc){logger['error'](_0x8071('0x11'),_0x1a614e,_0x5276bc);_0x2e8440(_0x5276bc);});});} \ No newline at end of file +var _0x352e=['then','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','code','error','message','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request'];(function(_0x17ef88,_0x581af4){var _0x1dc0fc=function(_0x390176){while(--_0x390176){_0x17ef88['push'](_0x17ef88['shift']());}};_0x1dc0fc(++_0x581af4);}(_0x352e,0x106));var _0xe352=function(_0x2dc8f5,_0x4368c9){_0x2dc8f5=_0x2dc8f5-0x0;var _0x477dc4=_0x352e[_0x2dc8f5];return _0x477dc4;};'use strict';var _=require('lodash');var util=require(_0xe352('0x0'));var moment=require(_0xe352('0x1'));var BPromise=require(_0xe352('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe352('0x3'));var db=require(_0xe352('0x4'))['db'];var utils=require(_0xe352('0x5'));var logger=require(_0xe352('0x6'))(_0xe352('0x7'));var config=require('../../config/environment');var jayson=require(_0xe352('0x8'));var client=jayson['client'][_0xe352('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a888c,_0x364ebc,_0x3809cb){return new BPromise(function(_0x5594a6,_0x1470f0){return client[_0xe352('0xa')](_0x3a888c,_0x3809cb)[_0xe352('0xb')](function(_0xdec52e){logger[_0xe352('0xc')](_0xe352('0xd'),_0x364ebc,_0xe352('0xe'));logger[_0xe352('0xf')](_0xe352('0x10'),_0x364ebc,_0xe352('0xe'),JSON[_0xe352('0x11')](_0xdec52e));if(_0xdec52e['error']){if(_0xdec52e['error'][_0xe352('0x12')]===0x1f4){logger[_0xe352('0x13')](_0xe352('0xd'),_0x364ebc,_0xdec52e[_0xe352('0x13')]['message']);return _0x1470f0(_0xdec52e['error'][_0xe352('0x14')]);}logger[_0xe352('0x13')]('Disposition,\x20%s,\x20%s',_0x364ebc,_0xdec52e['error'][_0xe352('0x14')]);return _0x5594a6(_0xdec52e[_0xe352('0x13')]['message']);}else{logger[_0xe352('0xc')](_0xe352('0xd'),_0x364ebc,_0xe352('0xe'));_0x5594a6(_0xdec52e['result'][_0xe352('0x14')]);}})['catch'](function(_0x28a03a){logger[_0xe352('0x13')](_0xe352('0xd'),_0x364ebc,_0x28a03a);_0x1470f0(_0x28a03a);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index fcad359..5da00db 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 _0xa3db=['path','connect-timeout','express','Router','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x3c662f,_0x3c5987){var _0x5123c6=function(_0x1a988d){while(--_0x1a988d){_0x3c662f['push'](_0x3c662f['shift']());}};_0x5123c6(++_0x3c5987);}(_0xa3db,0x10c));var _0xba3d=function(_0x14eb73,_0x33d2a1){_0x14eb73=_0x14eb73-0x0;var _0x686a1c=_0xa3db[_0x14eb73];return _0x686a1c;};'use strict';var multer=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var path=require(_0xba3d('0x2'));var timeout=require(_0xba3d('0x3'));var express=require(_0xba3d('0x4'));var router=express[_0xba3d('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xba3d('0x6'));var controller=require('./disposition.controller');router[_0xba3d('0x7')]('/',auth['isAuthenticated'](),controller[_0xba3d('0x8')]);router[_0xba3d('0x7')](_0xba3d('0x9'),auth[_0xba3d('0xa')](),controller[_0xba3d('0xb')]);router[_0xba3d('0xc')]('/',auth[_0xba3d('0xa')](),controller[_0xba3d('0xd')]);router[_0xba3d('0xe')](_0xba3d('0x9'),auth[_0xba3d('0xa')](),controller['update']);router[_0xba3d('0xf')](_0xba3d('0x9'),auth[_0xba3d('0xa')](),controller[_0xba3d('0x10')]);module[_0xba3d('0x11')]=router; \ No newline at end of file +var _0x2deb=['update','delete','isAuthenticated','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','index','get','/:id','show','post','create','put'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x2deb,0xdb));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xb2de('0x0'));var util=require(_0xb2de('0x1'));var path=require(_0xb2de('0x2'));var timeout=require(_0xb2de('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb2de('0x4'));var interaction=require(_0xb2de('0x5'));var config=require(_0xb2de('0x6'));var controller=require(_0xb2de('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb2de('0x8')]);router[_0xb2de('0x9')](_0xb2de('0xa'),auth['isAuthenticated'](),controller[_0xb2de('0xb')]);router[_0xb2de('0xc')]('/',auth['isAuthenticated'](),controller[_0xb2de('0xd')]);router[_0xb2de('0xe')](_0xb2de('0xa'),auth['isAuthenticated'](),controller[_0xb2de('0xf')]);router[_0xb2de('0x10')](_0xb2de('0xa'),auth[_0xb2de('0x11')](),controller['destroy']);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 617fe1e..8f5a799 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 _0xf447=['ENUM','7200','v17,v27,v29','INTEGER','DADHI','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','yes','localstationid','2400','4800','9600','14400'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xf447,0x161));var _0x7f44=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xf447[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x7f44('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7f44('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x7f44('0x2'),'no'),'defaultValue':_0x7f44('0x2')},'headerinfo':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x7f44('0x1')],'unique':_0x7f44('0x3')},'minrate':{'type':Sequelize['ENUM'](_0x7f44('0x4'),_0x7f44('0x5'),'7200',_0x7f44('0x6'),'12000',_0x7f44('0x7')),'defaultValue':_0x7f44('0x5')},'maxrate':{'type':Sequelize[_0x7f44('0x8')](_0x7f44('0x4'),_0x7f44('0x5'),_0x7f44('0x9'),_0x7f44('0x6'),'12000',_0x7f44('0x7')),'defaultValue':_0x7f44('0x7')},'modem':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':_0x7f44('0xa')},'gateway':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7f44('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7f44('0x8')]('SIP','IAX',_0x7f44('0xc'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x7f44('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f44('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f44('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x7f44('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![],'comment':_0x7f44('0xf'),'set':function(_0x19c5ae){if(!_0x19c5ae)this[_0x7f44('0x10')](_0x7f44('0x11'),null);this[_0x7f44('0x10')](_0x7f44('0x12'),_0x19c5ae);}}}; \ No newline at end of file +var _0x7eeb=['ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','12000','14400','9600','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','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','mandatoryDisposition','sequelize','exports','STRING'];(function(_0xeb9a14,_0x51388f){var _0x5a1687=function(_0x3a219d){while(--_0x3a219d){_0xeb9a14['push'](_0xeb9a14['shift']());}};_0x5a1687(++_0x51388f);}(_0x7eeb,0x93));var _0xb7ee=function(_0x5d1c9d,_0x8bb82d){_0x5d1c9d=_0x5d1c9d-0x0;var _0x8edfe4=_0x7eeb[_0x5d1c9d];return _0x8edfe4;};'use strict';var Sequelize=require(_0xb7ee('0x0'));module[_0xb7ee('0x1')]={'name':{'type':Sequelize[_0xb7ee('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb7ee('0x2')]},'ecm':{'type':Sequelize[_0xb7ee('0x3')](_0xb7ee('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0xb7ee('0x2')],'defaultValue':_0xb7ee('0x5')},'localstationid':{'type':Sequelize[_0xb7ee('0x2')],'unique':_0xb7ee('0x6')},'minrate':{'type':Sequelize[_0xb7ee('0x3')](_0xb7ee('0x7'),_0xb7ee('0x8'),_0xb7ee('0x9'),'9600',_0xb7ee('0xa'),_0xb7ee('0xb')),'defaultValue':_0xb7ee('0x8')},'maxrate':{'type':Sequelize[_0xb7ee('0x3')](_0xb7ee('0x7'),_0xb7ee('0x8'),'7200',_0xb7ee('0xc'),_0xb7ee('0xa'),'14400'),'defaultValue':_0xb7ee('0xb')},'modem':{'type':Sequelize[_0xb7ee('0x2')],'defaultValue':_0xb7ee('0xd')},'gateway':{'type':Sequelize[_0xb7ee('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xb7ee('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xb7ee('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0xb7ee('0xf'),_0xb7ee('0x10'),_0xb7ee('0x11'),_0xb7ee('0x12')),'defaultValue':_0xb7ee('0xf')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb7ee('0x13');}},'notificationSound':{'type':Sequelize[_0xb7ee('0x14')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb7ee('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xb7ee('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb7ee('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb7ee('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb7ee('0x14')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb7ee('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb7ee('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0xb7ee('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xb7ee('0x14')],'defaultValue':![],'comment':_0xb7ee('0x16'),'set':function(_0x15b1f9){if(!_0x15b1f9)this[_0xb7ee('0x17')]('mandatoryDispositionPauseId',null);this[_0xb7ee('0x17')](_0xb7ee('0x18'),_0x15b1f9);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index c138b8e..ddb0a5a 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 _0xadb5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','FaxAccounts','UserProfileResource','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','FaxAccount','includeAll','show','params','mandatoryDispositionPause','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','update','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','filter','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','order','include','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','context','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','faxdetect','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','updateAccountApplications','sequelize','VoiceExtension','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','format','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2abb65,_0x146fc7){var _0x509be2=function(_0xc688e5){while(--_0xc688e5){_0x2abb65['push'](_0x2abb65['shift']());}};_0x509be2(++_0x146fc7);}(_0xadb5,0xad));var _0x5adb=function(_0x1540d1,_0x3612e0){_0x1540d1=_0x1540d1-0x0;var _0x12d5c4=_0xadb5[_0x1540d1];return _0x12d5c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');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('0x8'));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 db=require(_0x5adb('0x17'))['db'];config['redis']=_[_0x5adb('0x18')](config['redis'],{'host':_0x5adb('0x19'),'port':0x18eb});var socket=require(_0x5adb('0x1a'))(new Redis(config[_0x5adb('0x1b')]));require('./faxAccount.socket')[_0x5adb('0x1c')](socket);var jayson=require(_0x5adb('0x1d'));var client=jayson[_0x5adb('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x5adb('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x367d82,_0x42a482,_0x30614e){if(_0x30614e){var _0x304784=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x304784[_0x5adb('0x1f')](_0x42a482)){return _0x367d82;}else{throw new db[(_0x5adb('0x20'))][(_0x5adb('0x21'))](_0x5adb('0x22'));}}else{return _0x367d82;}}function respondWithRpcPromise(_0xb953a6,_0x529b65,_0x3fff62,_0x5de028){return new BPromise(function(_0x1d9e86,_0x558f76){var _0x3ef465=_0x5de028||client;return _0x3ef465['request'](_0xb953a6,_0x3fff62)['then'](function(_0x1fbaa5){logger[_0x5adb('0x23')](_0x5adb('0x24'),_0x529b65,_0x5adb('0x25'));logger[_0x5adb('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x529b65,_0x5adb('0x25'),JSON['stringify'](_0x1fbaa5));if(_0x1fbaa5['error']){if(_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x28')]===0x1f4){logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x29')]);return _0x558f76(_0x1fbaa5[_0x5adb('0x27')]['message']);}logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x29')]);return _0x1d9e86(_0x1fbaa5[_0x5adb('0x27')]['message']);}else{logger[_0x5adb('0x23')](_0x5adb('0x24'),_0x529b65,'request\x20sent');_0x1d9e86(_0x1fbaa5[_0x5adb('0x2a')][_0x5adb('0x29')]);}})[_0x5adb('0x2b')](function(_0x55b40a){logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x55b40a);_0x558f76(_0x55b40a);});});}function respondWithStatusCode(_0x3a4fca,_0x2c64a3){_0x2c64a3=_0x2c64a3||0xcc;return function(_0x36459b){if(_0x36459b){return _0x3a4fca[_0x5adb('0x2c')](_0x2c64a3);}return _0x3a4fca['status'](_0x2c64a3)['end']();};}function respondWithResult(_0x5d457e,_0x39bddd){_0x39bddd=_0x39bddd||0xc8;return function(_0x1eac55){if(_0x1eac55){return _0x5d457e[_0x5adb('0x2d')](_0x39bddd)[_0x5adb('0x2e')](_0x1eac55);}};}function respondWithFilteredResult(_0x137a5c,_0x4de310){return function(_0x11ec2a){if(_0x11ec2a){var _0x34b793=_0x11ec2a[_0x5adb('0x2f')],_0x372da1=_0x4de310[_0x5adb('0x30')],_0x3b1fed=_0x4de310[_0x5adb('0x30')]+_0x4de310[_0x5adb('0x31')],_0x450169;if(_0x3b1fed>=_0x34b793){_0x3b1fed=_0x34b793;_0x450169=0xc8;}else{_0x450169=0xce;}_0x137a5c[_0x5adb('0x2d')](_0x450169);return _0x137a5c['set'](_0x5adb('0x32'),_0x372da1+'-'+_0x3b1fed+'/'+_0x34b793)['json'](_0x11ec2a);}return null;};}function patchUpdates(_0x12424d){return function(_0x20cde6){try{jsonpatch['apply'](_0x20cde6,_0x12424d,!![]);}catch(_0x226390){return BPromise[_0x5adb('0x33')](_0x226390);}return _0x20cde6[_0x5adb('0x34')]();};}function saveUpdates(_0x4a3661,_0x173789){return function(_0x14cf00){if(_0x14cf00){return _0x14cf00['update'](_0x4a3661)['then'](function(_0x1ed9ea){return _0x1ed9ea;});}return null;};}function removeEntity(_0x49dd03,_0x663ea0){return function(_0x222568){if(_0x222568){return _0x222568[_0x5adb('0x35')]()[_0x5adb('0x36')](function(){var _0x9bdece=_0x222568['get']({'plain':!![]});var _0x2f7abe=_0x5adb('0x37');return db[_0x5adb('0x38')]['destroy']({'where':{'type':_0x2f7abe,'resourceId':_0x9bdece['id']}})['then'](function(){return _0x222568;});})[_0x5adb('0x36')](function(){_0x49dd03[_0x5adb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2355bc,_0x4a4260){return function(_0x199d3b){if(!_0x199d3b){_0x2355bc['sendStatus'](0x194);}return _0x199d3b;};}function handleError(_0x11cb37,_0x4d052f){_0x4d052f=_0x4d052f||0x1f4;return function(_0x1d9681){logger[_0x5adb('0x27')](_0x1d9681['stack']);if(_0x1d9681[_0x5adb('0x39')]){delete _0x1d9681['name'];}_0x11cb37[_0x5adb('0x2d')](_0x4d052f)[_0x5adb('0x3a')](_0x1d9681);};}exports[_0x5adb('0x3b')]=function(_0x50edd1,_0x425dc7){var _0x2b3b0b={'include':[{'model':db[_0x5adb('0x3c')],'as':'mandatoryDispositionPause'}]},_0xcdaf8e={},_0x132803={'count':0x0,'rows':[]};var _0x50fe99=_['map'](db['FaxAccount'][_0x5adb('0x3d')],function(_0x2fbe14){return{'name':_0x2fbe14[_0x5adb('0x3e')],'type':_0x2fbe14[_0x5adb('0x3f')][_0x5adb('0x40')]};});_0xcdaf8e[_0x5adb('0x41')]=_[_0x5adb('0x42')](_0x50fe99,_0x5adb('0x39'));_0xcdaf8e['query']=_['keys'](_0x50edd1[_0x5adb('0x43')]);_0xcdaf8e['filters']=_[_0x5adb('0x44')](_0xcdaf8e[_0x5adb('0x41')],_0xcdaf8e[_0x5adb('0x43')]);_0x2b3b0b[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0xcdaf8e['model'],qs[_0x5adb('0x46')](_0x50edd1[_0x5adb('0x43')]['fields']));_0x2b3b0b[_0x5adb('0x45')]=_0x2b3b0b[_0x5adb('0x45')]['length']?_0x2b3b0b[_0x5adb('0x45')]:_0xcdaf8e[_0x5adb('0x41')];if(!_0x50edd1[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x2b3b0b[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x50edd1['query']['limit']);_0x2b3b0b[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x50edd1[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x2b3b0b['order']=qs['sort'](_0x50edd1[_0x5adb('0x43')][_0x5adb('0x49')]);_0x2b3b0b[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x50edd1['query'],_0xcdaf8e[_0x5adb('0x4b')]));if(_0x50edd1[_0x5adb('0x43')]['filter']){_0x2b3b0b[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x2b3b0b[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x50fe99,function(_0x186bd2){if(_0x186bd2[_0x5adb('0x3f')]!==_0x5adb('0x4e')){var _0x54252={};_0x54252[_0x186bd2['name']]={'$like':'%'+_0x50edd1[_0x5adb('0x43')]['filter']+'%'};return _0x54252;}})});}_0x2b3b0b=_['merge']({},_0x2b3b0b,_0x50edd1['options']);var _0x3cd211={'where':_0x2b3b0b[_0x5adb('0x4a')]};return db[_0x5adb('0x4f')]['count'](_0x3cd211)[_0x5adb('0x36')](function(_0x5cbab5){_0x132803[_0x5adb('0x2f')]=_0x5cbab5;if(_0x50edd1[_0x5adb('0x43')][_0x5adb('0x50')]){_0x2b3b0b['include']=[{'all':!![]}];}return db[_0x5adb('0x4f')]['findAll'](_0x2b3b0b);})[_0x5adb('0x36')](function(_0x6dc067){_0x132803['rows']=_0x6dc067;return _0x132803;})[_0x5adb('0x36')](respondWithFilteredResult(_0x425dc7,_0x2b3b0b))[_0x5adb('0x2b')](handleError(_0x425dc7,null));};exports[_0x5adb('0x51')]=function(_0x101008,_0x372734){var _0x4cb36c={'raw':![],'where':{'id':_0x101008[_0x5adb('0x52')]['id']},'include':[{'model':db[_0x5adb('0x3c')],'as':_0x5adb('0x53')}]},_0x36b847={};_0x36b847['model']=_[_0x5adb('0x54')](db[_0x5adb('0x4f')][_0x5adb('0x3d')]);_0x36b847['query']=_[_0x5adb('0x54')](_0x101008[_0x5adb('0x43')]);_0x36b847[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x36b847['model'],_0x36b847[_0x5adb('0x43')]);_0x4cb36c[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x36b847[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x101008['query'][_0x5adb('0x46')]));_0x4cb36c['attributes']=_0x4cb36c[_0x5adb('0x45')]['length']?_0x4cb36c[_0x5adb('0x45')]:_0x36b847[_0x5adb('0x41')];if(_0x101008[_0x5adb('0x43')][_0x5adb('0x50')]){_0x4cb36c['include']=[{'all':!![]}];}_0x4cb36c=_[_0x5adb('0x4d')]({},_0x4cb36c,_0x101008[_0x5adb('0x55')]);return db[_0x5adb('0x4f')]['find'](_0x4cb36c)['then'](handleEntityNotFound(_0x372734,null))['then'](respondWithResult(_0x372734,null))[_0x5adb('0x2b')](handleError(_0x372734,null));};exports[_0x5adb('0x56')]=function(_0xa5ecc0,_0x12a146){return db[_0x5adb('0x4f')][_0x5adb('0x56')](_0xa5ecc0[_0x5adb('0x57')],{})[_0x5adb('0x36')](function(_0xc880af){var _0x380d76=_0xa5ecc0[_0x5adb('0x58')][_0x5adb('0x59')]({'plain':!![]});if(!_0x380d76)throw new Error(_0x5adb('0x5a'));if(_0x380d76['role']==='user'){var _0x3d55c2=_0xc880af[_0x5adb('0x59')]({'plain':!![]});var _0x43cde9=_0x5adb('0x37');return db['UserProfileSection'][_0x5adb('0x5b')]({'where':{'name':_0x43cde9,'userProfileId':_0x380d76[_0x5adb('0x5c')]},'raw':!![]})['then'](function(_0x5cb50e){if(_0x5cb50e&&_0x5cb50e[_0x5adb('0x5d')]===0x0){return db[_0x5adb('0x38')]['create']({'name':_0x3d55c2[_0x5adb('0x39')],'resourceId':_0x3d55c2['id'],'type':_0x5cb50e[_0x5adb('0x39')],'sectionId':_0x5cb50e['id']},{})[_0x5adb('0x36')](function(){return _0xc880af;});}else{return _0xc880af;}})[_0x5adb('0x2b')](function(_0x330290){logger[_0x5adb('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x330290);throw _0x330290;});}return _0xc880af;})[_0x5adb('0x36')](respondWithResult(_0x12a146,0xc9))[_0x5adb('0x2b')](handleError(_0x12a146,null));};exports[_0x5adb('0x5e')]=function(_0x4c8eed,_0xcd71d2){if(_0x4c8eed[_0x5adb('0x57')]['id']){delete _0x4c8eed[_0x5adb('0x57')]['id'];}return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x4c8eed['params']['id']},'include':[{'model':db[_0x5adb('0x3c')],'as':_0x5adb('0x53')}]})[_0x5adb('0x36')](handleEntityNotFound(_0xcd71d2,null))['then'](saveUpdates(_0x4c8eed[_0x5adb('0x57')],null))[_0x5adb('0x36')](respondWithResult(_0xcd71d2,null))['catch'](handleError(_0xcd71d2,null));};exports[_0x5adb('0x35')]=function(_0x432a3e,_0x248739){return db[_0x5adb('0x4f')]['find']({'where':{'id':_0x432a3e[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x248739,null))[_0x5adb('0x36')](removeEntity(_0x248739,null))[_0x5adb('0x2b')](handleError(_0x248739,null));};exports['describe']=function(_0x53a4bc,_0x304512){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x304512,null))[_0x5adb('0x2b')](handleError(_0x304512,null));};exports[_0x5adb('0x5f')]=function(_0x48bb5c,_0x395350,_0x91e023){if(_0x48bb5c[_0x5adb('0x57')]['id']){delete _0x48bb5c[_0x5adb('0x57')]['id'];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x48bb5c[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x395350,null))['then'](function(_0x4b9e80){if(_0x4b9e80){_0x48bb5c['body'][_0x5adb('0x60')]=_0x4b9e80['id'];return db[_0x5adb('0x61')][_0x5adb('0x56')](_0x48bb5c[_0x5adb('0x57')]);}})[_0x5adb('0x36')](respondWithResult(_0x395350,null))[_0x5adb('0x2b')](handleError(_0x395350,null));};exports[_0x5adb('0x62')]=function(_0x25f761,_0x58455b,_0x5e55c2){var _0x1fc73b={'raw':![],'where':{}};var _0x56df90={};var _0x114ee4={'count':0x0,'rows':[]};return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x25f761[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x58455b,null))[_0x5adb('0x36')](function(_0x338aee){if(_0x338aee){_0x56df90[_0x5adb('0x41')]=_['keys'](db[_0x5adb('0x61')][_0x5adb('0x3d')]);_0x56df90[_0x5adb('0x43')]=_['keys'](_0x25f761[_0x5adb('0x43')]);_0x56df90[_0x5adb('0x4b')]=_['intersection'](_0x56df90[_0x5adb('0x41')],_0x56df90['query']);_0x1fc73b[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x56df90['model'],qs[_0x5adb('0x46')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x46')]));_0x1fc73b[_0x5adb('0x45')]=_0x1fc73b[_0x5adb('0x45')][_0x5adb('0x64')]?_0x1fc73b[_0x5adb('0x45')]:_0x56df90[_0x5adb('0x41')];if(!_0x25f761['query'][_0x5adb('0x47')](_0x5adb('0x48'))){_0x1fc73b[_0x5adb('0x31')]=qs['limit'](_0x25f761['query'][_0x5adb('0x31')]);_0x1fc73b['offset']=qs[_0x5adb('0x30')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x1fc73b['order']=qs[_0x5adb('0x49')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x49')]);_0x1fc73b[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_['pick'](_0x25f761[_0x5adb('0x43')],_0x56df90[_0x5adb('0x4b')]));_0x1fc73b[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x338aee['id'];if(_0x25f761['query'][_0x5adb('0x65')]){_0x1fc73b[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x1fc73b[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x1fc73b[_0x5adb('0x45')],function(_0x1aae66){var _0x569644={};_0x569644[_0x1aae66]={'$like':'%'+_0x25f761[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0x569644;})});}_0x1fc73b=_['merge']({},_0x1fc73b,_0x25f761[_0x5adb('0x55')]);return db[_0x5adb('0x61')]['count']({'where':_0x1fc73b[_0x5adb('0x4a')]})['then'](function(_0x372354){_0x114ee4[_0x5adb('0x2f')]=_0x372354;if(_0x25f761['query'][_0x5adb('0x50')]){_0x1fc73b['include']=[{'all':!![]}];}return db[_0x5adb('0x61')][_0x5adb('0x66')](_0x1fc73b);})[_0x5adb('0x36')](function(_0x3a4a28){_0x114ee4[_0x5adb('0x67')]=_0x3a4a28;return _0x114ee4;});}})['then'](respondWithFilteredResult(_0x58455b,_0x1fc73b))[_0x5adb('0x2b')](handleError(_0x58455b,null));};exports[_0x5adb('0x68')]=function(_0x3f33c0,_0x1c8988,_0x47c631){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x3f33c0[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x1c8988,null))[_0x5adb('0x36')](function(_0x277668){if(_0x277668){return _0x277668[_0x5adb('0x68')](_0x3f33c0[_0x5adb('0x43')]['ids']);}})[_0x5adb('0x36')](respondWithStatusCode(_0x1c8988,null))[_0x5adb('0x2b')](handleError(_0x1c8988,null));};exports[_0x5adb('0x69')]=function(_0x43b3a8,_0x55a9e8,_0x450f90){if(_0x43b3a8[_0x5adb('0x57')]['id']){delete _0x43b3a8[_0x5adb('0x57')]['id'];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x43b3a8[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x55a9e8,null))[_0x5adb('0x36')](function(_0x1f753e){if(_0x1f753e){_0x43b3a8['body'][_0x5adb('0x60')]=_0x1f753e['id'];return db[_0x5adb('0x6a')]['create'](_0x43b3a8[_0x5adb('0x57')]);}})[_0x5adb('0x36')](respondWithResult(_0x55a9e8,null))[_0x5adb('0x2b')](handleError(_0x55a9e8,null));};exports[_0x5adb('0x6b')]=function(_0x200221,_0x1bbc2e,_0x450516){var _0x350bb1={'raw':![],'where':{}};var _0x57f557={};var _0x11d9ce={'count':0x0,'rows':[]};return db[_0x5adb('0x4f')]['findOne']({'where':{'id':_0x200221[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x1bbc2e,null))[_0x5adb('0x36')](function(_0x4a0752){if(_0x4a0752){_0x57f557['model']=_[_0x5adb('0x54')](db[_0x5adb('0x6a')][_0x5adb('0x3d')]);_0x57f557['query']=_[_0x5adb('0x54')](_0x200221[_0x5adb('0x43')]);_0x57f557[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x57f557[_0x5adb('0x41')],_0x57f557[_0x5adb('0x43')]);_0x350bb1[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x57f557[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x200221[_0x5adb('0x43')][_0x5adb('0x46')]));_0x350bb1['attributes']=_0x350bb1['attributes'][_0x5adb('0x64')]?_0x350bb1[_0x5adb('0x45')]:_0x57f557['model'];if(!_0x200221[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x350bb1[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x200221[_0x5adb('0x43')][_0x5adb('0x31')]);_0x350bb1[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x200221['query'][_0x5adb('0x30')]);}_0x350bb1[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x200221['query'][_0x5adb('0x49')]);_0x350bb1[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x200221[_0x5adb('0x43')],_0x57f557[_0x5adb('0x4b')]));_0x350bb1['where'][_0x5adb('0x60')]=_0x4a0752['id'];if(_0x200221[_0x5adb('0x43')][_0x5adb('0x65')]){_0x350bb1[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x350bb1[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x350bb1[_0x5adb('0x45')],function(_0x24664c){var _0x388218={};_0x388218[_0x24664c]={'$like':'%'+_0x200221['query'][_0x5adb('0x65')]+'%'};return _0x388218;})});}_0x350bb1=_['merge']({},_0x350bb1,_0x200221[_0x5adb('0x55')]);return db[_0x5adb('0x6a')][_0x5adb('0x2f')]({'where':_0x350bb1[_0x5adb('0x4a')]})[_0x5adb('0x36')](function(_0x5c7b1b){_0x11d9ce['count']=_0x5c7b1b;if(_0x200221[_0x5adb('0x43')][_0x5adb('0x50')]){_0x350bb1[_0x5adb('0x6d')]=[{'all':!![]}];}return db[_0x5adb('0x6a')][_0x5adb('0x66')](_0x350bb1);})[_0x5adb('0x36')](function(_0x55dfac){_0x11d9ce['rows']=_0x55dfac;return _0x11d9ce;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x1bbc2e,_0x350bb1))[_0x5adb('0x2b')](handleError(_0x1bbc2e,null));};exports[_0x5adb('0x6e')]=function(_0x4f5721,_0x542626,_0x227c17){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x4f5721[_0x5adb('0x52')]['id']}})['then'](handleEntityNotFound(_0x542626,null))['then'](function(_0x43b91c){if(_0x43b91c){return _0x43b91c['removeAnswers'](_0x4f5721['query'][_0x5adb('0x6f')]);}})[_0x5adb('0x36')](respondWithStatusCode(_0x542626,null))[_0x5adb('0x2b')](handleError(_0x542626,null));};exports[_0x5adb('0x70')]=function(_0xbfd441,_0x133ea9,_0xa51ffc){return db[_0x5adb('0x71')][_0x5adb('0x5b')]({'where':{'id':_0xbfd441[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x133ea9,null))[_0x5adb('0x36')](function(_0x2808e4){if(_0x2808e4){return _0x2808e4['addInteraction'](_0xbfd441[_0x5adb('0x57')]['ids'],_[_0x5adb('0x72')](_0xbfd441[_0x5adb('0x57')],[_0x5adb('0x6f'),'id'])||{});}})[_0x5adb('0x36')](respondWithResult(_0x133ea9,null))[_0x5adb('0x2b')](handleError(_0x133ea9,null));};exports[_0x5adb('0x73')]=function(_0xfb8035,_0x364bda,_0x2ebfad){var _0x36a8f0={'raw':![],'where':{}};var _0x41fa3c={};var _0x18fc00={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5adb('0x63')]({'where':{'id':_0xfb8035[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x364bda,null))[_0x5adb('0x36')](function(_0x1da6bc){if(_0x1da6bc){_0x41fa3c[_0x5adb('0x41')]=_[_0x5adb('0x54')](db[_0x5adb('0x71')]['rawAttributes']);_0x41fa3c[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0xfb8035[_0x5adb('0x43')]);_0x41fa3c['filters']=_[_0x5adb('0x44')](_0x41fa3c['model'],_0x41fa3c[_0x5adb('0x43')]);_0x36a8f0['attributes']=_['intersection'](_0x41fa3c[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x46')]));_0x36a8f0[_0x5adb('0x45')]=_0x36a8f0[_0x5adb('0x45')][_0x5adb('0x64')]?_0x36a8f0[_0x5adb('0x45')]:_0x41fa3c[_0x5adb('0x41')];if(!_0xfb8035[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x36a8f0['limit']=qs[_0x5adb('0x31')](_0xfb8035['query'][_0x5adb('0x31')]);_0x36a8f0[_0x5adb('0x30')]=qs['offset'](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x36a8f0['order']=qs['sort'](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x49')]);_0x36a8f0[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0xfb8035[_0x5adb('0x43')],_0x41fa3c['filters']));_0x36a8f0[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x1da6bc['id'];if(_0xfb8035[_0x5adb('0x43')][_0x5adb('0x65')]){_0x36a8f0[_0x5adb('0x4a')]=_['merge'](_0x36a8f0['where'],{'$or':_[_0x5adb('0x42')](_0x36a8f0[_0x5adb('0x45')],function(_0x23d3dc){var _0xaf0b4={};_0xaf0b4[_0x23d3dc]={'$like':'%'+_0xfb8035[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0xaf0b4;})});}_0x36a8f0=_[_0x5adb('0x4d')]({},_0x36a8f0,_0xfb8035[_0x5adb('0x55')]);return db[_0x5adb('0x71')]['count']({'where':_0x36a8f0[_0x5adb('0x4a')]})[_0x5adb('0x36')](function(_0x4a3a90){_0x18fc00['count']=_0x4a3a90;if(_0xfb8035['query'][_0x5adb('0x50')]){_0x36a8f0[_0x5adb('0x6d')]=[{'model':db[_0x5adb('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5adb('0x75'),'attributes':[_0x5adb('0x39'),_0x5adb('0x76'),_0x5adb('0x77')],'required':![]},{'model':db[_0x5adb('0x78')],'as':_0x5adb('0x79'),'attributes':['id','name','color'],'where':_0xfb8035[_0x5adb('0x43')]['tag']?{'id':_0xfb8035[_0x5adb('0x43')][_0x5adb('0x7a')]}:undefined,'required':_0xfb8035['query'][_0x5adb('0x7a')]?!![]:![]}];}return db[_0x5adb('0x71')][_0x5adb('0x66')](_0x36a8f0);})[_0x5adb('0x36')](function(_0x57a42f){_0x18fc00[_0x5adb('0x67')]=_0x57a42f;return _0x18fc00;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x364bda,_0x36a8f0))[_0x5adb('0x2b')](handleError(_0x364bda,null));};exports[_0x5adb('0x7b')]=function(_0x4ec5bd,_0xb4a84b,_0x559938){return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x4ec5bd[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0xb4a84b,null))[_0x5adb('0x36')](function(_0x190c08){if(_0x190c08){return db['sequelize'][_0x5adb('0x7c')](function(_0x49e908){return db[_0x5adb('0x7d')][_0x5adb('0x35')]({'where':{'FaxAccountId':_0x4ec5bd['params']['id']},'transaction':_0x49e908})[_0x5adb('0x36')](function(_0x52e44f){var _0x5a517a=_['map'](_0x4ec5bd[_0x5adb('0x57')],function(_0x5b7830){_0x5b7830['FaxAccountId']=_0x4ec5bd[_0x5adb('0x52')]['id'];return _0x5b7830;});return db[_0x5adb('0x7d')][_0x5adb('0x7e')](_0x5a517a,{'transaction':_0x49e908});});})[_0x5adb('0x36')](function(){return db[_0x5adb('0x7d')][_0x5adb('0x7f')]({'where':{'FaxAccountId':_0x4ec5bd[_0x5adb('0x52')]['id']},'order':'priority'});});}})[_0x5adb('0x36')](respondWithResult(_0xb4a84b,null))[_0x5adb('0x2b')](handleError(_0xb4a84b,null));};exports['getApplications']=function(_0x249dcb,_0x350ef9,_0x2c2416){var _0x232a1e={};var _0x39762c={};var _0x18c47f;var _0x3a88ab;return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x249dcb[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x350ef9,null))[_0x5adb('0x36')](function(_0x4871b1){if(_0x4871b1){_0x18c47f=_0x4871b1;_0x39762c['model']=_[_0x5adb('0x54')](db[_0x5adb('0x7d')][_0x5adb('0x3d')]);_0x39762c[_0x5adb('0x43')]=_['keys'](_0x249dcb[_0x5adb('0x43')]);_0x39762c[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x39762c[_0x5adb('0x41')],_0x39762c[_0x5adb('0x43')]);_0x232a1e['attributes']=_['intersection'](_0x39762c[_0x5adb('0x41')],qs['fields'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x46')]));_0x232a1e[_0x5adb('0x45')]=_0x232a1e[_0x5adb('0x45')][_0x5adb('0x64')]?_0x232a1e[_0x5adb('0x45')]:_0x39762c['model'];_0x232a1e[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x49')]);_0x232a1e[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x249dcb['query'],_0x39762c['filters']));if(_0x249dcb['query'][_0x5adb('0x65')]){_0x232a1e['where']=_[_0x5adb('0x4d')](_0x232a1e['where'],{'$or':_['map'](_0x232a1e[_0x5adb('0x45')],function(_0x340434){var _0x5e74dc={};_0x5e74dc[_0x340434]={'$like':'%'+_0x249dcb['query'][_0x5adb('0x65')]+'%'};return _0x5e74dc;})});}_0x232a1e=_[_0x5adb('0x4d')]({},_0x232a1e,_0x249dcb[_0x5adb('0x55')]);return _0x18c47f['getApplications'](_0x232a1e);}})[_0x5adb('0x36')](function(_0x57f0ea){if(_0x57f0ea){_0x3a88ab=_0x57f0ea['length'];if(!_0x249dcb[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x232a1e['limit']=qs['limit'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x31')]);_0x232a1e['offset']=qs['offset'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x30')]);}return _0x18c47f['getApplications'](_0x232a1e);}})[_0x5adb('0x36')](function(_0x550969){if(_0x550969){return _0x550969?{'count':_0x3a88ab,'rows':_0x550969}:null;}})[_0x5adb('0x36')](respondWithResult(_0x350ef9,null))['catch'](handleError(_0x350ef9,null));};function Extension(_0x530690,_0x2b87d3,_0x305176,_0xa4b83f){this[_0x5adb('0x80')]='from-voip-provider';this[_0x5adb('0x81')]=_0x530690[_0x5adb('0x82')];this[_0x5adb('0x83')]=_0xa4b83f;this['type']=_0x5adb('0x84');this[_0x5adb('0x85')]=_0x5adb('0x86');this[_0x5adb('0x60')]=_0x530690['id'];this['priority']=_0x2b87d3;this[_0x5adb('0x87')]=_0x305176;}function createExtensionsReciveFax(_0x1ff2e6){var _0x3bbe7c=0x1;var _0x4e79ff=[];_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,'','Answer'));_0x3bbe7c+=0x1;_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x89'),_0x5adb('0x8a')));_0x3bbe7c+=0x1;for(var _0x6a7622 in _0x1ff2e6){if(_0x1ff2e6[_0x5adb('0x47')](_0x6a7622)&&(_0x6a7622==='ecm'||_0x6a7622==='localstationid'||_0x6a7622==='gateway'||_0x6a7622===_0x5adb('0x8b')||_0x6a7622==='headerinfo'||_0x6a7622==='maxrate'||_0x6a7622===_0x5adb('0x8c')||_0x6a7622===_0x5adb('0x8d')||_0x6a7622===_0x5adb('0x8e'))){_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x8f')+_0x6a7622+')='+_0x1ff2e6[_0x6a7622],_0x5adb('0x8a')));_0x3bbe7c+=0x1;}}_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,'6',_0x5adb('0x90')));_0x3bbe7c+=0x1;_0x4e79ff['push'](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x91'),_0x5adb('0x92')));_0x3bbe7c=0x0;return _0x4e79ff;}exports['addAccountApplications']=function(_0x1946c6,_0x4f198d,_0x5ead13){var _0x19a72c;return db['sequelize'][_0x5adb('0x7c')](function(_0x2accf0){return db[_0x5adb('0x4f')][_0x5adb('0x56')](_0x1946c6[_0x5adb('0x57')],{'transaction':_0x2accf0})[_0x5adb('0x36')](function(_0x7b0fdc){_0x19a72c=_0x7b0fdc[_0x5adb('0x59')]({'plain':!![]});return db['VoiceExtension'][_0x5adb('0x7e')](createExtensionsReciveFax(_0x19a72c),{'transaction':_0x2accf0});});})['then'](function(){return _0x19a72c;})[_0x5adb('0x36')](respondWithResult(_0x4f198d,null))['catch'](handleError(_0x4f198d,null));};exports[_0x5adb('0x93')]=function(_0x50357d,_0x102a27,_0x2eebb1){var _0x123e79;return db[_0x5adb('0x94')][_0x5adb('0x7c')](function(_0x3f21df){return db[_0x5adb('0x4f')][_0x5adb('0x5e')](_0x50357d[_0x5adb('0x57')],{'where':{'id':_0x50357d[_0x5adb('0x57')]['id']},'transaction':_0x3f21df})[_0x5adb('0x36')](function(_0x3bdfda){return db[_0x5adb('0x95')]['destroy']({'where':{'FaxAccountId':_0x50357d[_0x5adb('0x57')]['id']},'transaction':_0x3f21df})['then'](function(_0x1eb7dc){return db[_0x5adb('0x95')][_0x5adb('0x7e')](createExtensionsReciveFax(_['omit'](_0x50357d['body'],['tech','key',_0x5adb('0x96'),_0x5adb('0x97'),_0x5adb('0x98'),_0x5adb('0x99')])),{'transaction':_0x3f21df});});});})[_0x5adb('0x36')](function(){return db[_0x5adb('0x4f')][_0x5adb('0x9a')](_0x50357d[_0x5adb('0x57')]['id']);})[_0x5adb('0x36')](respondWithResult(_0x102a27,null))['catch'](handleError(_0x102a27,null));};exports[_0x5adb('0x9b')]=function(_0x197b7f,_0x171fb9,_0x17801d){var _0x1ba4ba={'raw':!![],'where':{}};var _0x246a15={};var _0x4acbb0={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x197b7f[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x171fb9,null))[_0x5adb('0x36')](function(_0x2b753d){if(_0x2b753d){_0x246a15[_0x5adb('0x41')]=_['keys'](db[_0x5adb('0x9c')][_0x5adb('0x3d')]);_0x246a15[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0x197b7f[_0x5adb('0x43')]);_0x246a15[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x246a15[_0x5adb('0x41')],_0x246a15[_0x5adb('0x43')]);_0x1ba4ba[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x246a15[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x197b7f['query'][_0x5adb('0x46')]));_0x1ba4ba['attributes']=_0x1ba4ba[_0x5adb('0x45')][_0x5adb('0x64')]?_0x1ba4ba[_0x5adb('0x45')]:_0x246a15[_0x5adb('0x41')];if(!_0x197b7f[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x1ba4ba[_0x5adb('0x31')]=qs['limit'](_0x197b7f[_0x5adb('0x43')]['limit']);_0x1ba4ba['offset']=qs[_0x5adb('0x30')](_0x197b7f[_0x5adb('0x43')]['offset']);}_0x1ba4ba[_0x5adb('0x6c')]=qs['sort'](_0x197b7f[_0x5adb('0x43')][_0x5adb('0x49')]);_0x1ba4ba['where']=qs[_0x5adb('0x4b')](_['pick'](_0x197b7f[_0x5adb('0x43')],_0x246a15[_0x5adb('0x4b')]));_0x1ba4ba[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x2b753d['id'];if(_0x197b7f[_0x5adb('0x43')]['filter']){_0x1ba4ba['where']=_[_0x5adb('0x4d')](_0x1ba4ba[_0x5adb('0x4a')],{'$or':_['map'](_0x1ba4ba[_0x5adb('0x45')],function(_0x22437e){var _0x1e8e68={};_0x1e8e68[_0x22437e]={'$like':'%'+_0x197b7f[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0x1e8e68;})});}if(_0x197b7f[_0x5adb('0x43')][_0x5adb('0x9d')]){var _0x80220d=_0x197b7f['query'][_0x5adb('0x9d')][_0x5adb('0x9e')](',');var _0x287a1d={};_0x287a1d[_0x80220d[0x0]]={'$gte':moment(_0x80220d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1ba4ba[_0x5adb('0x4a')]=_['merge'](_0x1ba4ba['where'],_0x287a1d);}_0x1ba4ba=_[_0x5adb('0x4d')]({},_0x1ba4ba,_0x197b7f[_0x5adb('0x55')]);return db[_0x5adb('0x9c')][_0x5adb('0x2f')]({'where':_0x1ba4ba['where']})[_0x5adb('0x36')](function(_0x3ca38d){_0x4acbb0['count']=_0x3ca38d;if(_0x197b7f[_0x5adb('0x43')][_0x5adb('0x50')]){_0x1ba4ba['include']=[{'all':!![]}];}return db[_0x5adb('0x9c')][_0x5adb('0x66')](_0x1ba4ba);})[_0x5adb('0x36')](function(_0x4b0530){_0x4acbb0[_0x5adb('0x67')]=_0x4b0530;return _0x4acbb0;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x171fb9,_0x1ba4ba))['catch'](handleError(_0x171fb9,null));};exports[_0x5adb('0x3a')]=function(_0x1c9bfe,_0x4723aa,_0x36d4c9){var _0x252b37,_0x478f87={},_0x5a8edb;if(_0x1c9bfe[_0x5adb('0x57')]['to']){_0x5a8edb=_0x1c9bfe[_0x5adb('0x57')]['to'][0x0];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x1c9bfe[_0x5adb('0x52')]['id']},'include':[{'model':db[_0x5adb('0x9f')],'as':_0x5adb('0xa0'),'include':[{'model':db['CmContact'],'as':_0x5adb('0xa1'),'where':{'fax':_0x5a8edb},'limit':0x1,'order':[[_0x5adb('0x97'),_0x5adb('0xa2')]]}]}]})[_0x5adb('0x36')](handleEntityNotFound(_0x4723aa,null))[_0x5adb('0x36')](function(_0x5eda03){_0x252b37=_0x5eda03;if(_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')]&&_0x1c9bfe['body']['attachments'][_0x5adb('0x64')]){for(var _0x31a85c=0x0;_0x31a85c<_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][_0x5adb('0x64')];_0x31a85c+=0x1){_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]={'filename':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][_0x31a85c]['name'],'id':_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]['id'],'path':path[_0x5adb('0xa4')](config[_0x5adb('0xa5')],_0x5adb('0xa6'),_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]['basename'])};}}return respondWithRpcPromise(_0x5adb('0xa7'),_0x5adb('0xa7'),{'FaxAccountId':_[_0x5adb('0xa8')](_0x1c9bfe['params']['id'])?undefined:_0x1c9bfe[_0x5adb('0x52')]['id'],'path':_['isNil'](_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')])?undefined:_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')],'fax':_[_0x5adb('0xa8')](_0x1c9bfe['body']['to'][0x0])?undefined:_0x1c9bfe[_0x5adb('0x57')]['to'][0x0]},client9002);})[_0x5adb('0x36')](function(){if(_0x252b37){if(_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')]['from'])){_0x1c9bfe['body']['from']=util[_0x5adb('0xaa')](_0x5adb('0xab'),_0x252b37[_0x5adb('0x39')],_0x252b37['fax']);}if(_0x252b37[_0x5adb('0xa0')]){if(_0x252b37[_0x5adb('0xa0')][_0x5adb('0xa1')][_0x5adb('0x64')]){return _0x252b37[_0x5adb('0xa0')][_0x5adb('0xa1')][0x0];}else{return db['CmContact']['create'](_[_0x5adb('0x18')](_0x1c9bfe['body'],{'firstName':_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'phone':_0x1c9bfe['body']['to'][0x0],'fax':_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'ListId':_0x252b37[_0x5adb('0x99')]}));}}else{throw new Error(_0x5adb('0xac'));}}else{throw new Error(_0x5adb('0xad'));}})[_0x5adb('0x36')](function(_0x2251b4){if(_0x2251b4){return db[_0x5adb('0x71')][_0x5adb('0x5b')]({'where':{'ContactId':_0x2251b4['id'],'closed':![],'FaxAccountId':_0x252b37['id']}})[_0x5adb('0x36')](function(_0x2060d2){if(_0x2060d2){return[_0x2060d2,![]];}return db[_0x5adb('0x71')][_0x5adb('0x56')]({'UserId':_0x1c9bfe[_0x5adb('0x58')]['id'],'ContactId':_0x2251b4['id'],'FaxAccountId':_0x252b37['id'],'fax':_0x1c9bfe['body']['to'][0x0],'firstMsgDirection':_0x5adb('0xae'),'Messages':[_[_0x5adb('0x4d')](_0x1c9bfe[_0x5adb('0x57')],{'read':![],'body':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0][_0x5adb('0xaf')],'FaxAccountId':_0x252b37['id'],'UserId':_0x1c9bfe['user']['id'],'ContactId':_0x2251b4['id'],'AttachmentId':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x5adb('0x9c')],'as':_0x5adb('0xb0')}]})[_0x5adb('0x36')](function(_0x1d3ca0){return[_0x1d3ca0,!![]];});});}else{throw new Error(_0x5adb('0xb1'));}})[_0x5adb('0xb2')](function(_0x49d94e,_0x1ac519){if(_0x1ac519){return _0x49d94e;}return db[_0x5adb('0x9c')]['create']({'direction':_0x5adb('0xae'),'read':![],'body':_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xaf')],'FaxAccountId':_0x252b37['id'],'FaxInteractionId':_0x49d94e['id'],'UserId':_0x1c9bfe[_0x5adb('0x58')]['id'],'ContactId':_0x49d94e[_0x5adb('0xb3')],'AttachmentId':_0x1c9bfe[_0x5adb('0x57')]['attachments'][0x0]['id']})['then'](function(_0x55144f){_0x49d94e[_0x5adb('0xb4')][_0x5adb('0xb0')]=[];_0x49d94e[_0x5adb('0xb4')]['Messages']['push'](_0x55144f[_0x5adb('0xb4')]);return _0x49d94e;});})[_0x5adb('0x36')](function(_0x3ec484){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x52')]['id'])?undefined:_0x1c9bfe[_0x5adb('0x52')]['id'],'path':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0]['path'])?undefined:_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')],'fax':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')]['to'][0x0])?undefined:_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'AttachmentId':_0x1c9bfe['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x326d04){logger[_0x5adb('0x23')](_0x5adb('0xb5'),_0x326d04);})['catch'](function(_0x762500){logger[_0x5adb('0x23')](_0x5adb('0xb5'),_0x762500);});return _0x3ec484;})[_0x5adb('0x36')](respondWithResult(_0x4723aa,null))[_0x5adb('0x2b')](handleError(_0x4723aa,null));};exports[_0x5adb('0xb6')]=function(_0x166372,_0x152dfe,_0x5f5594){return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x166372[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x152dfe,null))[_0x5adb('0x36')](function(_0x3e78e9){if(_0x3e78e9){return _0x3e78e9[_0x5adb('0xb6')](_0x166372[_0x5adb('0x57')]['ids'],_[_0x5adb('0x72')](_0x166372['body'],[_0x5adb('0x6f'),'id'])||{})['spread'](function(_0x5b80ed){for(var _0x5d1cb0=0x0;_0x5d1cb0<_0x166372['body'][_0x5adb('0x6f')][_0x5adb('0x64')];_0x5d1cb0+=0x1){socket[_0x5adb('0xb7')](_0x5adb('0xb8'),{'UserId':_0x166372[_0x5adb('0x57')]['ids'][_0x5d1cb0],'FaxAccountId':_0x166372[_0x5adb('0x52')]['id']});}return _0x5b80ed;});}})[_0x5adb('0x36')](respondWithResult(_0x152dfe,null))[_0x5adb('0x2b')](handleError(_0x152dfe,null));};exports[_0x5adb('0xb9')]=function(_0xa3233c,_0x542329,_0x562cce){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0xa3233c['params']['id']}})['then'](handleEntityNotFound(_0x542329,null))['then'](function(_0x4a1cd2){if(_0x4a1cd2){return _0x4a1cd2[_0x5adb('0xb9')](_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')])[_0x5adb('0x36')](function(){if(_['isArray'](_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')])){for(var _0x3d40a0=0x0;_0x3d40a0<_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')]['length'];_0x3d40a0+=0x1){socket['emit'](_0x5adb('0xba'),{'UserId':Number(_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')][_0x3d40a0]),'FaxAccountId':Number(_0xa3233c[_0x5adb('0x52')]['id'])});}}else{socket[_0x5adb('0xb7')](_0x5adb('0xba'),{'UserId':Number(_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')]),'FaxAccountId':Number(_0xa3233c[_0x5adb('0x52')]['id'])});}});}})[_0x5adb('0x36')](respondWithStatusCode(_0x542329,null))[_0x5adb('0x2b')](handleError(_0x542329,null));};exports['getAgents']=function(_0x3b0d9a,_0x5b194d,_0x26e5fd){var _0x14881a={};var _0x5b93c7={};var _0x4229d3;var _0x32b27b;return db[_0x5adb('0x4f')]['findOne']({'where':{'id':_0x3b0d9a['params']['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x5b194d,null))[_0x5adb('0x36')](function(_0x4dc1d5){if(_0x4dc1d5){_0x4229d3=_0x4dc1d5;_0x5b93c7['model']=_['keys'](db[_0x5adb('0xbb')][_0x5adb('0x3d')]);_0x5b93c7[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0x3b0d9a[_0x5adb('0x43')]);_0x5b93c7[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x5b93c7[_0x5adb('0x41')],_0x5b93c7[_0x5adb('0x43')]);_0x14881a[_0x5adb('0x45')]=_['intersection'](_0x5b93c7['model'],qs[_0x5adb('0x46')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x46')]));_0x14881a[_0x5adb('0x45')]=_0x14881a[_0x5adb('0x45')]['length']?_0x14881a[_0x5adb('0x45')]:_0x5b93c7[_0x5adb('0x41')];_0x14881a[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x3b0d9a['query'][_0x5adb('0x49')]);_0x14881a['where']=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x3b0d9a[_0x5adb('0x43')],_0x5b93c7['filters']));if(_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x65')]){_0x14881a[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x14881a['where'],{'$or':_['map'](_0x14881a[_0x5adb('0x45')],function(_0x477983){var _0x3e793e={};_0x3e793e[_0x477983]={'$like':'%'+_0x3b0d9a[_0x5adb('0x43')]['filter']+'%'};return _0x3e793e;})});}_0x14881a=_[_0x5adb('0x4d')]({},_0x14881a,_0x3b0d9a[_0x5adb('0x55')]);return _0x4229d3[_0x5adb('0xbc')](_0x14881a);}})[_0x5adb('0x36')](function(_0x5b8f5d){if(_0x5b8f5d){_0x32b27b=_0x5b8f5d['length'];if(!_0x3b0d9a['query'][_0x5adb('0x47')](_0x5adb('0x48'))){_0x14881a[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x31')]);_0x14881a[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x30')]);}return _0x4229d3[_0x5adb('0xbc')](_0x14881a);}})[_0x5adb('0x36')](function(_0x1bf854){if(_0x1bf854){return _0x1bf854?{'count':_0x32b27b,'rows':_0x1bf854}:null;}})[_0x5adb('0x36')](respondWithResult(_0x5b194d,null))[_0x5adb('0x2b')](handleError(_0x5b194d,null));}; \ No newline at end of file +var _0x2ef3=['bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','register','client','http','test','Sequelize','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','set','apply','update','get','destroy','sendStatus','stack','name','send','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','omit','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','localstationid','app','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','gateway','minrate','modem','t38timeout','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','Contacts','out','filename','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x231ae1,_0x2c8a13){var _0x2bd0d8=function(_0x26772d){while(--_0x26772d){_0x231ae1['push'](_0x231ae1['shift']());}};_0x2bd0d8(++_0x2c8a13);}(_0x2ef3,0xba));var _0x32ef=function(_0xb08af0,_0x2486cb){_0xb08af0=_0xb08af0-0x0;var _0x3843ce=_0x2ef3[_0xb08af0];return _0x3843ce;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];config['redis']=_[_0x32ef('0x19')](config['redis'],{'host':_0x32ef('0x1a'),'port':0x18eb});var socket=require(_0x32ef('0x1b'))(new Redis(config['redis']));require('./faxAccount.socket')[_0x32ef('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232c});var client9002=jayson[_0x32ef('0x1d')][_0x32ef('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x57aff1,_0x55bf0b,_0x531e30){if(_0x531e30){var _0x13db1a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x13db1a[_0x32ef('0x1f')](_0x55bf0b)){return _0x57aff1;}else{throw new db[(_0x32ef('0x20'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x57aff1;}}function respondWithRpcPromise(_0x1eb468,_0x1a9476,_0x286bfb,_0x57863c){return new BPromise(function(_0xbe37f6,_0x33e230){var _0x4f4c98=_0x57863c||client;return _0x4f4c98[_0x32ef('0x21')](_0x1eb468,_0x286bfb)[_0x32ef('0x22')](function(_0x26aff3){logger[_0x32ef('0x23')](_0x32ef('0x24'),_0x1a9476,_0x32ef('0x25'));logger['debug'](_0x32ef('0x26'),_0x1a9476,'request\x20sent',JSON[_0x32ef('0x27')](_0x26aff3));if(_0x26aff3[_0x32ef('0x28')]){if(_0x26aff3['error'][_0x32ef('0x29')]===0x1f4){logger[_0x32ef('0x28')](_0x32ef('0x24'),_0x1a9476,_0x26aff3['error']['message']);return _0x33e230(_0x26aff3[_0x32ef('0x28')][_0x32ef('0x2a')]);}logger[_0x32ef('0x28')]('FaxAccount,\x20%s,\x20%s',_0x1a9476,_0x26aff3['error'][_0x32ef('0x2a')]);return _0xbe37f6(_0x26aff3['error']['message']);}else{logger[_0x32ef('0x23')](_0x32ef('0x24'),_0x1a9476,_0x32ef('0x25'));_0xbe37f6(_0x26aff3[_0x32ef('0x2b')][_0x32ef('0x2a')]);}})[_0x32ef('0x2c')](function(_0x1874ea){logger[_0x32ef('0x28')](_0x32ef('0x24'),_0x1a9476,_0x1874ea);_0x33e230(_0x1874ea);});});}function respondWithStatusCode(_0x2f52d7,_0x1335e2){_0x1335e2=_0x1335e2||0xcc;return function(_0xba4b3f){if(_0xba4b3f){return _0x2f52d7['sendStatus'](_0x1335e2);}return _0x2f52d7[_0x32ef('0x2d')](_0x1335e2)[_0x32ef('0x2e')]();};}function respondWithResult(_0x5a04cd,_0x12de1a){_0x12de1a=_0x12de1a||0xc8;return function(_0x3c569d){if(_0x3c569d){return _0x5a04cd[_0x32ef('0x2d')](_0x12de1a)[_0x32ef('0x2f')](_0x3c569d);}};}function respondWithFilteredResult(_0x50a95b,_0x10e38c){return function(_0x22bf86){if(_0x22bf86){var _0x31dbc3=_0x22bf86[_0x32ef('0x30')],_0x2ac686=_0x10e38c['offset'],_0x1b668a=_0x10e38c[_0x32ef('0x31')]+_0x10e38c['limit'],_0x1a6ed2;if(_0x1b668a>=_0x31dbc3){_0x1b668a=_0x31dbc3;_0x1a6ed2=0xc8;}else{_0x1a6ed2=0xce;}_0x50a95b[_0x32ef('0x2d')](_0x1a6ed2);return _0x50a95b[_0x32ef('0x32')]('Content-Range',_0x2ac686+'-'+_0x1b668a+'/'+_0x31dbc3)[_0x32ef('0x2f')](_0x22bf86);}return null;};}function patchUpdates(_0x17e4d1){return function(_0x3b00ad){try{jsonpatch[_0x32ef('0x33')](_0x3b00ad,_0x17e4d1,!![]);}catch(_0x120f30){return BPromise['reject'](_0x120f30);}return _0x3b00ad['save']();};}function saveUpdates(_0x2a5eb5,_0x5dadf7){return function(_0x643dc4){if(_0x643dc4){return _0x643dc4[_0x32ef('0x34')](_0x2a5eb5)[_0x32ef('0x22')](function(_0x390670){return _0x390670;});}return null;};}function removeEntity(_0x389583,_0x22fa1a){return function(_0x566b56){if(_0x566b56){return _0x566b56['destroy']()['then'](function(){var _0x2261a6=_0x566b56[_0x32ef('0x35')]({'plain':!![]});var _0x136b02='FaxAccounts';return db['UserProfileResource'][_0x32ef('0x36')]({'where':{'type':_0x136b02,'resourceId':_0x2261a6['id']}})[_0x32ef('0x22')](function(){return _0x566b56;});})[_0x32ef('0x22')](function(){_0x389583['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xcbdec8,_0x21706f){return function(_0x3ed1b0){if(!_0x3ed1b0){_0xcbdec8[_0x32ef('0x37')](0x194);}return _0x3ed1b0;};}function handleError(_0x3a7c49,_0x211c79){_0x211c79=_0x211c79||0x1f4;return function(_0x3223d5){logger[_0x32ef('0x28')](_0x3223d5[_0x32ef('0x38')]);if(_0x3223d5['name']){delete _0x3223d5[_0x32ef('0x39')];}_0x3a7c49[_0x32ef('0x2d')](_0x211c79)[_0x32ef('0x3a')](_0x3223d5);};}exports['index']=function(_0x365125,_0x17e489){var _0x879e33={'include':[{'model':db[_0x32ef('0x3b')],'as':_0x32ef('0x3c')}]},_0x393a89={},_0x1faf72={'count':0x0,'rows':[]};var _0x1cebed=_[_0x32ef('0x3d')](db[_0x32ef('0x3e')][_0x32ef('0x3f')],function(_0x4615b4){return{'name':_0x4615b4['fieldName'],'type':_0x4615b4[_0x32ef('0x40')][_0x32ef('0x41')]};});_0x393a89[_0x32ef('0x42')]=_[_0x32ef('0x3d')](_0x1cebed,_0x32ef('0x39'));_0x393a89[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x365125['query']);_0x393a89['filters']=_[_0x32ef('0x45')](_0x393a89[_0x32ef('0x42')],_0x393a89[_0x32ef('0x43')]);_0x879e33[_0x32ef('0x46')]=_['intersection'](_0x393a89[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x365125['query'][_0x32ef('0x47')]));_0x879e33['attributes']=_0x879e33[_0x32ef('0x46')][_0x32ef('0x48')]?_0x879e33[_0x32ef('0x46')]:_0x393a89[_0x32ef('0x42')];if(!_0x365125[_0x32ef('0x43')][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x879e33[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x365125[_0x32ef('0x43')]['limit']);_0x879e33[_0x32ef('0x31')]=qs['offset'](_0x365125[_0x32ef('0x43')][_0x32ef('0x31')]);}_0x879e33[_0x32ef('0x4c')]=qs['sort'](_0x365125[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x879e33[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x365125[_0x32ef('0x43')],_0x393a89[_0x32ef('0x4f')]));if(_0x365125['query']['filter']){_0x879e33[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x879e33[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x1cebed,function(_0x209361){if(_0x209361[_0x32ef('0x40')]!==_0x32ef('0x52')){var _0x115fa3={};_0x115fa3[_0x209361[_0x32ef('0x39')]]={'$like':'%'+_0x365125[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x115fa3;}})});}_0x879e33=_[_0x32ef('0x51')]({},_0x879e33,_0x365125[_0x32ef('0x54')]);var _0x4c2534={'where':_0x879e33[_0x32ef('0x4e')]};return db[_0x32ef('0x3e')][_0x32ef('0x30')](_0x4c2534)[_0x32ef('0x22')](function(_0x1cc9f3){_0x1faf72[_0x32ef('0x30')]=_0x1cc9f3;if(_0x365125[_0x32ef('0x43')][_0x32ef('0x55')]){_0x879e33[_0x32ef('0x56')]=[{'all':!![]}];}return db[_0x32ef('0x3e')][_0x32ef('0x57')](_0x879e33);})[_0x32ef('0x22')](function(_0x272377){_0x1faf72[_0x32ef('0x58')]=_0x272377;return _0x1faf72;})[_0x32ef('0x22')](respondWithFilteredResult(_0x17e489,_0x879e33))[_0x32ef('0x2c')](handleError(_0x17e489,null));};exports[_0x32ef('0x59')]=function(_0x2c1b44,_0x4e0d6b){var _0x515ac9={'raw':![],'where':{'id':_0x2c1b44[_0x32ef('0x5a')]['id']},'include':[{'model':db[_0x32ef('0x3b')],'as':_0x32ef('0x3c')}]},_0x179c2f={};_0x179c2f[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x3e')][_0x32ef('0x3f')]);_0x179c2f[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x2c1b44[_0x32ef('0x43')]);_0x179c2f['filters']=_[_0x32ef('0x45')](_0x179c2f[_0x32ef('0x42')],_0x179c2f[_0x32ef('0x43')]);_0x515ac9[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x179c2f[_0x32ef('0x42')],qs['fields'](_0x2c1b44[_0x32ef('0x43')][_0x32ef('0x47')]));_0x515ac9[_0x32ef('0x46')]=_0x515ac9['attributes'][_0x32ef('0x48')]?_0x515ac9['attributes']:_0x179c2f[_0x32ef('0x42')];if(_0x2c1b44[_0x32ef('0x43')]['includeAll']){_0x515ac9[_0x32ef('0x56')]=[{'all':!![]}];}_0x515ac9=_['merge']({},_0x515ac9,_0x2c1b44[_0x32ef('0x54')]);return db[_0x32ef('0x3e')][_0x32ef('0x5b')](_0x515ac9)[_0x32ef('0x22')](handleEntityNotFound(_0x4e0d6b,null))[_0x32ef('0x22')](respondWithResult(_0x4e0d6b,null))[_0x32ef('0x2c')](handleError(_0x4e0d6b,null));};exports[_0x32ef('0x5c')]=function(_0x56260f,_0x56cc75){return db[_0x32ef('0x3e')]['create'](_0x56260f['body'],{})[_0x32ef('0x22')](function(_0x89d0b3){var _0x2ef0f8=_0x56260f[_0x32ef('0x5d')][_0x32ef('0x35')]({'plain':!![]});if(!_0x2ef0f8)throw new Error(_0x32ef('0x5e'));if(_0x2ef0f8[_0x32ef('0x5f')]===_0x32ef('0x5d')){var _0x2b2cd4=_0x89d0b3[_0x32ef('0x35')]({'plain':!![]});var _0x4c125c='FaxAccounts';return db[_0x32ef('0x60')][_0x32ef('0x5b')]({'where':{'name':_0x4c125c,'userProfileId':_0x2ef0f8['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x12e1ef){if(_0x12e1ef&&_0x12e1ef[_0x32ef('0x61')]===0x0){return db['UserProfileResource'][_0x32ef('0x5c')]({'name':_0x2b2cd4[_0x32ef('0x39')],'resourceId':_0x2b2cd4['id'],'type':_0x12e1ef[_0x32ef('0x39')],'sectionId':_0x12e1ef['id']},{})['then'](function(){return _0x89d0b3;});}else{return _0x89d0b3;}})['catch'](function(_0x13ea1a){logger['error'](_0x32ef('0x62'),_0x13ea1a);throw _0x13ea1a;});}return _0x89d0b3;})['then'](respondWithResult(_0x56cc75,0xc9))['catch'](handleError(_0x56cc75,null));};exports[_0x32ef('0x34')]=function(_0x208989,_0x10cb37){if(_0x208989['body']['id']){delete _0x208989[_0x32ef('0x63')]['id'];}return db[_0x32ef('0x3e')][_0x32ef('0x5b')]({'where':{'id':_0x208989['params']['id']},'include':[{'model':db[_0x32ef('0x3b')],'as':_0x32ef('0x3c')}]})['then'](handleEntityNotFound(_0x10cb37,null))['then'](saveUpdates(_0x208989[_0x32ef('0x63')],null))[_0x32ef('0x22')](respondWithResult(_0x10cb37,null))[_0x32ef('0x2c')](handleError(_0x10cb37,null));};exports[_0x32ef('0x36')]=function(_0x4c4df8,_0x40700e){return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0x4c4df8[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x40700e,null))[_0x32ef('0x22')](removeEntity(_0x40700e,null))[_0x32ef('0x2c')](handleError(_0x40700e,null));};exports[_0x32ef('0x64')]=function(_0x1dc755,_0x3ff282){return db[_0x32ef('0x3e')]['describe']()[_0x32ef('0x22')](respondWithResult(_0x3ff282,null))[_0x32ef('0x2c')](handleError(_0x3ff282,null));};exports[_0x32ef('0x65')]=function(_0x1c629d,_0x79ae28,_0x5ad75c){if(_0x1c629d['body']['id']){delete _0x1c629d[_0x32ef('0x63')]['id'];}return db[_0x32ef('0x3e')][_0x32ef('0x5b')]({'where':{'id':_0x1c629d[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x79ae28,null))['then'](function(_0x3372d9){if(_0x3372d9){_0x1c629d['body'][_0x32ef('0x66')]=_0x3372d9['id'];return db[_0x32ef('0x67')]['create'](_0x1c629d['body']);}})[_0x32ef('0x22')](respondWithResult(_0x79ae28,null))[_0x32ef('0x2c')](handleError(_0x79ae28,null));};exports[_0x32ef('0x68')]=function(_0x5b378b,_0x52b63b,_0x3b4a8e){var _0x5edd29={'raw':![],'where':{}};var _0x7d2c3a={};var _0x416e62={'count':0x0,'rows':[]};return db['FaxAccount'][_0x32ef('0x69')]({'where':{'id':_0x5b378b[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x52b63b,null))[_0x32ef('0x22')](function(_0x9df27c){if(_0x9df27c){_0x7d2c3a[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x67')][_0x32ef('0x3f')]);_0x7d2c3a[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x5b378b[_0x32ef('0x43')]);_0x7d2c3a['filters']=_['intersection'](_0x7d2c3a[_0x32ef('0x42')],_0x7d2c3a[_0x32ef('0x43')]);_0x5edd29['attributes']=_[_0x32ef('0x45')](_0x7d2c3a['model'],qs[_0x32ef('0x47')](_0x5b378b[_0x32ef('0x43')][_0x32ef('0x47')]));_0x5edd29['attributes']=_0x5edd29[_0x32ef('0x46')]['length']?_0x5edd29[_0x32ef('0x46')]:_0x7d2c3a[_0x32ef('0x42')];if(!_0x5b378b['query']['hasOwnProperty'](_0x32ef('0x4a'))){_0x5edd29['limit']=qs[_0x32ef('0x4b')](_0x5b378b['query'][_0x32ef('0x4b')]);_0x5edd29[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x5b378b['query']['offset']);}_0x5edd29['order']=qs[_0x32ef('0x4d')](_0x5b378b['query'][_0x32ef('0x4d')]);_0x5edd29[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x5b378b[_0x32ef('0x43')],_0x7d2c3a[_0x32ef('0x4f')]));_0x5edd29['where'][_0x32ef('0x66')]=_0x9df27c['id'];if(_0x5b378b['query']['filter']){_0x5edd29[_0x32ef('0x4e')]=_['merge'](_0x5edd29[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x5edd29['attributes'],function(_0x232b40){var _0x282805={};_0x282805[_0x232b40]={'$like':'%'+_0x5b378b[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x282805;})});}_0x5edd29=_[_0x32ef('0x51')]({},_0x5edd29,_0x5b378b[_0x32ef('0x54')]);return db['Disposition']['count']({'where':_0x5edd29[_0x32ef('0x4e')]})['then'](function(_0x41bbe1){_0x416e62[_0x32ef('0x30')]=_0x41bbe1;if(_0x5b378b[_0x32ef('0x43')][_0x32ef('0x55')]){_0x5edd29[_0x32ef('0x56')]=[{'all':!![]}];}return db[_0x32ef('0x67')]['findAll'](_0x5edd29);})[_0x32ef('0x22')](function(_0x146f8c){_0x416e62[_0x32ef('0x58')]=_0x146f8c;return _0x416e62;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x52b63b,_0x5edd29))[_0x32ef('0x2c')](handleError(_0x52b63b,null));};exports['removeDispositions']=function(_0x4b7e72,_0x27e4b4,_0x904a4f){return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0x4b7e72[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x27e4b4,null))[_0x32ef('0x22')](function(_0xc3664d){if(_0xc3664d){return _0xc3664d[_0x32ef('0x6a')](_0x4b7e72[_0x32ef('0x43')][_0x32ef('0x6b')]);}})[_0x32ef('0x22')](respondWithStatusCode(_0x27e4b4,null))['catch'](handleError(_0x27e4b4,null));};exports[_0x32ef('0x6c')]=function(_0xefbbf2,_0x4e5819,_0x35653b){if(_0xefbbf2['body']['id']){delete _0xefbbf2[_0x32ef('0x63')]['id'];}return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0xefbbf2[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x4e5819,null))[_0x32ef('0x22')](function(_0x49dc18){if(_0x49dc18){_0xefbbf2[_0x32ef('0x63')][_0x32ef('0x66')]=_0x49dc18['id'];return db[_0x32ef('0x6d')]['create'](_0xefbbf2['body']);}})['then'](respondWithResult(_0x4e5819,null))[_0x32ef('0x2c')](handleError(_0x4e5819,null));};exports[_0x32ef('0x6e')]=function(_0x1ec12d,_0x34fd2b,_0x3cc90c){var _0x5a1696={'raw':![],'where':{}};var _0x2678e3={};var _0x5b3deb={'count':0x0,'rows':[]};return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x1ec12d[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x34fd2b,null))[_0x32ef('0x22')](function(_0x42d2d4){if(_0x42d2d4){_0x2678e3[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x6d')]['rawAttributes']);_0x2678e3[_0x32ef('0x43')]=_['keys'](_0x1ec12d[_0x32ef('0x43')]);_0x2678e3[_0x32ef('0x4f')]=_['intersection'](_0x2678e3['model'],_0x2678e3[_0x32ef('0x43')]);_0x5a1696[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x2678e3[_0x32ef('0x42')],qs['fields'](_0x1ec12d[_0x32ef('0x43')]['fields']));_0x5a1696['attributes']=_0x5a1696[_0x32ef('0x46')]['length']?_0x5a1696[_0x32ef('0x46')]:_0x2678e3[_0x32ef('0x42')];if(!_0x1ec12d[_0x32ef('0x43')]['hasOwnProperty']('nolimit')){_0x5a1696[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x1ec12d[_0x32ef('0x43')][_0x32ef('0x4b')]);_0x5a1696[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x1ec12d[_0x32ef('0x43')]['offset']);}_0x5a1696[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x1ec12d[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x5a1696['where']=qs['filters'](_[_0x32ef('0x50')](_0x1ec12d['query'],_0x2678e3[_0x32ef('0x4f')]));_0x5a1696[_0x32ef('0x4e')]['FaxAccountId']=_0x42d2d4['id'];if(_0x1ec12d['query']['filter']){_0x5a1696[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x5a1696[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x5a1696['attributes'],function(_0x1f0f95){var _0xe52b7f={};_0xe52b7f[_0x1f0f95]={'$like':'%'+_0x1ec12d[_0x32ef('0x43')]['filter']+'%'};return _0xe52b7f;})});}_0x5a1696=_[_0x32ef('0x51')]({},_0x5a1696,_0x1ec12d['options']);return db[_0x32ef('0x6d')][_0x32ef('0x30')]({'where':_0x5a1696['where']})['then'](function(_0x2d6a9a){_0x5b3deb[_0x32ef('0x30')]=_0x2d6a9a;if(_0x1ec12d[_0x32ef('0x43')][_0x32ef('0x55')]){_0x5a1696[_0x32ef('0x56')]=[{'all':!![]}];}return db[_0x32ef('0x6d')][_0x32ef('0x57')](_0x5a1696);})[_0x32ef('0x22')](function(_0x1fb039){_0x5b3deb['rows']=_0x1fb039;return _0x5b3deb;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x34fd2b,_0x5a1696))['catch'](handleError(_0x34fd2b,null));};exports[_0x32ef('0x6f')]=function(_0x7e47b9,_0x1d9d57,_0x18cf5d){return db[_0x32ef('0x3e')]['find']({'where':{'id':_0x7e47b9[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x1d9d57,null))[_0x32ef('0x22')](function(_0x39d17d){if(_0x39d17d){return _0x39d17d[_0x32ef('0x6f')](_0x7e47b9[_0x32ef('0x43')][_0x32ef('0x6b')]);}})[_0x32ef('0x22')](respondWithStatusCode(_0x1d9d57,null))[_0x32ef('0x2c')](handleError(_0x1d9d57,null));};exports['addInteraction']=function(_0x53dc9b,_0x4fb09e,_0x2e01fa){return db[_0x32ef('0x70')]['find']({'where':{'id':_0x53dc9b[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4fb09e,null))[_0x32ef('0x22')](function(_0x5c0d8d){if(_0x5c0d8d){return _0x5c0d8d['addInteraction'](_0x53dc9b[_0x32ef('0x63')][_0x32ef('0x6b')],_[_0x32ef('0x71')](_0x53dc9b[_0x32ef('0x63')],[_0x32ef('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x4fb09e,null))[_0x32ef('0x2c')](handleError(_0x4fb09e,null));};exports['getInteractions']=function(_0x458239,_0x5e936a,_0x5cded8){var _0x4e9c64={'raw':![],'where':{}};var _0x5ef161={};var _0x512390={'count':0x0,'rows':[]};return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x458239['params']['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x5e936a,null))[_0x32ef('0x22')](function(_0x206bd1){if(_0x206bd1){_0x5ef161[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x70')]['rawAttributes']);_0x5ef161[_0x32ef('0x43')]=_['keys'](_0x458239[_0x32ef('0x43')]);_0x5ef161[_0x32ef('0x4f')]=_['intersection'](_0x5ef161[_0x32ef('0x42')],_0x5ef161['query']);_0x4e9c64[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x5ef161[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x458239['query'][_0x32ef('0x47')]));_0x4e9c64[_0x32ef('0x46')]=_0x4e9c64[_0x32ef('0x46')][_0x32ef('0x48')]?_0x4e9c64['attributes']:_0x5ef161[_0x32ef('0x42')];if(!_0x458239['query'][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x4e9c64[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x458239[_0x32ef('0x43')][_0x32ef('0x4b')]);_0x4e9c64['offset']=qs[_0x32ef('0x31')](_0x458239['query']['offset']);}_0x4e9c64[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x458239[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x4e9c64['where']=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x458239[_0x32ef('0x43')],_0x5ef161[_0x32ef('0x4f')]));_0x4e9c64['where']['FaxAccountId']=_0x206bd1['id'];if(_0x458239['query'][_0x32ef('0x53')]){_0x4e9c64[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x4e9c64[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x4e9c64[_0x32ef('0x46')],function(_0xb612){var _0x42c3dc={};_0x42c3dc[_0xb612]={'$like':'%'+_0x458239[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x42c3dc;})});}_0x4e9c64=_[_0x32ef('0x51')]({},_0x4e9c64,_0x458239['options']);return db[_0x32ef('0x70')][_0x32ef('0x30')]({'where':_0x4e9c64[_0x32ef('0x4e')]})[_0x32ef('0x22')](function(_0x766edf){_0x512390[_0x32ef('0x30')]=_0x766edf;if(_0x458239['query'][_0x32ef('0x55')]){_0x4e9c64[_0x32ef('0x56')]=[{'model':db[_0x32ef('0x72')],'as':_0x32ef('0x73'),'required':![]},{'model':db[_0x32ef('0x74')],'as':_0x32ef('0x75'),'attributes':[_0x32ef('0x39'),_0x32ef('0x76'),_0x32ef('0x77')],'required':![]},{'model':db[_0x32ef('0x78')],'as':_0x32ef('0x79'),'attributes':['id',_0x32ef('0x39'),_0x32ef('0x7a')],'where':_0x458239[_0x32ef('0x43')]['tag']?{'id':_0x458239[_0x32ef('0x43')][_0x32ef('0x7b')]}:undefined,'required':_0x458239[_0x32ef('0x43')]['tag']?!![]:![]}];}return db[_0x32ef('0x70')]['findAll'](_0x4e9c64);})[_0x32ef('0x22')](function(_0x3e0917){_0x512390[_0x32ef('0x58')]=_0x3e0917;return _0x512390;});}})['then'](respondWithFilteredResult(_0x5e936a,_0x4e9c64))[_0x32ef('0x2c')](handleError(_0x5e936a,null));};exports['addApplications']=function(_0x5f0d27,_0x252e86,_0x5b753c){return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x5f0d27[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x252e86,null))[_0x32ef('0x22')](function(_0x264075){if(_0x264075){return db[_0x32ef('0x7c')]['transaction'](function(_0x493ae9){return db[_0x32ef('0x7d')]['destroy']({'where':{'FaxAccountId':_0x5f0d27[_0x32ef('0x5a')]['id']},'transaction':_0x493ae9})[_0x32ef('0x22')](function(_0x515a9f){var _0x447ede=_[_0x32ef('0x3d')](_0x5f0d27['body'],function(_0x1200c9){_0x1200c9[_0x32ef('0x66')]=_0x5f0d27[_0x32ef('0x5a')]['id'];return _0x1200c9;});return db[_0x32ef('0x7d')][_0x32ef('0x7e')](_0x447ede,{'transaction':_0x493ae9});});})['then'](function(){return db[_0x32ef('0x7d')][_0x32ef('0x7f')]({'where':{'FaxAccountId':_0x5f0d27['params']['id']},'order':_0x32ef('0x80')});});}})[_0x32ef('0x22')](respondWithResult(_0x252e86,null))[_0x32ef('0x2c')](handleError(_0x252e86,null));};exports[_0x32ef('0x81')]=function(_0x2971a8,_0x522c22,_0x739633){var _0x39bc0f={};var _0x547c0d={};var _0xb41a01;var _0x20785c;return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x2971a8[_0x32ef('0x5a')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x522c22,null))[_0x32ef('0x22')](function(_0x482c46){if(_0x482c46){_0xb41a01=_0x482c46;_0x547c0d['model']=_[_0x32ef('0x44')](db[_0x32ef('0x7d')][_0x32ef('0x3f')]);_0x547c0d['query']=_[_0x32ef('0x44')](_0x2971a8[_0x32ef('0x43')]);_0x547c0d['filters']=_[_0x32ef('0x45')](_0x547c0d[_0x32ef('0x42')],_0x547c0d['query']);_0x39bc0f['attributes']=_[_0x32ef('0x45')](_0x547c0d[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x2971a8['query']['fields']));_0x39bc0f['attributes']=_0x39bc0f[_0x32ef('0x46')][_0x32ef('0x48')]?_0x39bc0f[_0x32ef('0x46')]:_0x547c0d['model'];_0x39bc0f[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x2971a8[_0x32ef('0x43')]['sort']);_0x39bc0f[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_['pick'](_0x2971a8['query'],_0x547c0d[_0x32ef('0x4f')]));if(_0x2971a8['query'][_0x32ef('0x53')]){_0x39bc0f[_0x32ef('0x4e')]=_['merge'](_0x39bc0f['where'],{'$or':_[_0x32ef('0x3d')](_0x39bc0f['attributes'],function(_0xc0584b){var _0x37aa4e={};_0x37aa4e[_0xc0584b]={'$like':'%'+_0x2971a8[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x37aa4e;})});}_0x39bc0f=_[_0x32ef('0x51')]({},_0x39bc0f,_0x2971a8[_0x32ef('0x54')]);return _0xb41a01[_0x32ef('0x81')](_0x39bc0f);}})[_0x32ef('0x22')](function(_0x1bc4a7){if(_0x1bc4a7){_0x20785c=_0x1bc4a7[_0x32ef('0x48')];if(!_0x2971a8['query']['hasOwnProperty'](_0x32ef('0x4a'))){_0x39bc0f[_0x32ef('0x4b')]=qs[_0x32ef('0x4b')](_0x2971a8[_0x32ef('0x43')][_0x32ef('0x4b')]);_0x39bc0f[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x2971a8[_0x32ef('0x43')][_0x32ef('0x31')]);}return _0xb41a01[_0x32ef('0x81')](_0x39bc0f);}})['then'](function(_0x41ad21){if(_0x41ad21){return _0x41ad21?{'count':_0x20785c,'rows':_0x41ad21}:null;}})[_0x32ef('0x22')](respondWithResult(_0x522c22,null))[_0x32ef('0x2c')](handleError(_0x522c22,null));};function Extension(_0xe3be2f,_0x3307e2,_0x1eca38,_0x439fe1){this[_0x32ef('0x82')]=_0x32ef('0x83');this[_0x32ef('0x84')]=_0xe3be2f[_0x32ef('0x85')];this[_0x32ef('0x86')]=_0x439fe1;this[_0x32ef('0x40')]='system';this[_0x32ef('0x87')]=_0x32ef('0x88');this[_0x32ef('0x66')]=_0xe3be2f['id'];this[_0x32ef('0x80')]=_0x3307e2;this[_0x32ef('0x89')]=_0x1eca38;}function createExtensionsReciveFax(_0xe331ee){var _0x1e4332=0x1;var _0x1b0e4b=[];_0x1b0e4b[_0x32ef('0x8a')](new Extension(_0xe331ee,_0x1e4332,'',_0x32ef('0x8b')));_0x1e4332+=0x1;_0x1b0e4b['push'](new Extension(_0xe331ee,_0x1e4332,_0x32ef('0x8c'),_0x32ef('0x8d')));_0x1e4332+=0x1;for(var _0x176d96 in _0xe331ee){if(_0xe331ee[_0x32ef('0x49')](_0x176d96)&&(_0x176d96==='ecm'||_0x176d96===_0x32ef('0x85')||_0x176d96===_0x32ef('0x8e')||_0x176d96==='faxdetect'||_0x176d96==='headerinfo'||_0x176d96==='maxrate'||_0x176d96===_0x32ef('0x8f')||_0x176d96===_0x32ef('0x90')||_0x176d96===_0x32ef('0x91'))){_0x1b0e4b[_0x32ef('0x8a')](new Extension(_0xe331ee,_0x1e4332,'FAXOPT('+_0x176d96+')='+_0xe331ee[_0x176d96],'Set'));_0x1e4332+=0x1;}}_0x1b0e4b[_0x32ef('0x8a')](new Extension(_0xe331ee,_0x1e4332,'6','Wait'));_0x1e4332+=0x1;_0x1b0e4b['push'](new Extension(_0xe331ee,_0x1e4332,_0x32ef('0x92'),_0x32ef('0x93')));_0x1e4332=0x0;return _0x1b0e4b;}exports[_0x32ef('0x94')]=function(_0x5a352f,_0x5f397c,_0x5216f2){var _0x142a87;return db[_0x32ef('0x7c')][_0x32ef('0x95')](function(_0x248d53){return db[_0x32ef('0x3e')][_0x32ef('0x5c')](_0x5a352f[_0x32ef('0x63')],{'transaction':_0x248d53})[_0x32ef('0x22')](function(_0x228330){_0x142a87=_0x228330['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x142a87),{'transaction':_0x248d53});});})[_0x32ef('0x22')](function(){return _0x142a87;})[_0x32ef('0x22')](respondWithResult(_0x5f397c,null))['catch'](handleError(_0x5f397c,null));};exports['updateAccountApplications']=function(_0x21e1f0,_0x478be3,_0x29c30e){var _0x40e8d7;return db[_0x32ef('0x7c')][_0x32ef('0x95')](function(_0x507b96){return db[_0x32ef('0x3e')][_0x32ef('0x34')](_0x21e1f0[_0x32ef('0x63')],{'where':{'id':_0x21e1f0[_0x32ef('0x63')]['id']},'transaction':_0x507b96})['then'](function(_0x3f32f2){return db[_0x32ef('0x96')]['destroy']({'where':{'FaxAccountId':_0x21e1f0['body']['id']},'transaction':_0x507b96})[_0x32ef('0x22')](function(_0x2207fc){return db[_0x32ef('0x96')][_0x32ef('0x7e')](createExtensionsReciveFax(_[_0x32ef('0x71')](_0x21e1f0[_0x32ef('0x63')],[_0x32ef('0x97'),'key',_0x32ef('0x98'),_0x32ef('0x99'),_0x32ef('0x9a'),_0x32ef('0x9b')])),{'transaction':_0x507b96});});});})['then'](function(){return db['FaxAccount'][_0x32ef('0x9c')](_0x21e1f0['body']['id']);})[_0x32ef('0x22')](respondWithResult(_0x478be3,null))[_0x32ef('0x2c')](handleError(_0x478be3,null));};exports[_0x32ef('0x9d')]=function(_0x183c07,_0x92ce66,_0x1d743f){var _0x1a9ea5={'raw':!![],'where':{}};var _0x37c47b={};var _0x4a4b8b={'count':0x0,'rows':[]};return db[_0x32ef('0x3e')]['findOne']({'where':{'id':_0x183c07[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x92ce66,null))['then'](function(_0x5890aa){if(_0x5890aa){_0x37c47b[_0x32ef('0x42')]=_['keys'](db[_0x32ef('0x9e')]['rawAttributes']);_0x37c47b[_0x32ef('0x43')]=_['keys'](_0x183c07[_0x32ef('0x43')]);_0x37c47b[_0x32ef('0x4f')]=_['intersection'](_0x37c47b[_0x32ef('0x42')],_0x37c47b['query']);_0x1a9ea5[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x37c47b[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x183c07[_0x32ef('0x43')]['fields']));_0x1a9ea5[_0x32ef('0x46')]=_0x1a9ea5[_0x32ef('0x46')][_0x32ef('0x48')]?_0x1a9ea5[_0x32ef('0x46')]:_0x37c47b[_0x32ef('0x42')];if(!_0x183c07[_0x32ef('0x43')][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x1a9ea5['limit']=qs[_0x32ef('0x4b')](_0x183c07['query'][_0x32ef('0x4b')]);_0x1a9ea5[_0x32ef('0x31')]=qs[_0x32ef('0x31')](_0x183c07['query']['offset']);}_0x1a9ea5[_0x32ef('0x4c')]=qs[_0x32ef('0x4d')](_0x183c07[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x1a9ea5[_0x32ef('0x4e')]=qs[_0x32ef('0x4f')](_[_0x32ef('0x50')](_0x183c07[_0x32ef('0x43')],_0x37c47b[_0x32ef('0x4f')]));_0x1a9ea5[_0x32ef('0x4e')][_0x32ef('0x66')]=_0x5890aa['id'];if(_0x183c07['query'][_0x32ef('0x53')]){_0x1a9ea5[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x1a9ea5[_0x32ef('0x4e')],{'$or':_[_0x32ef('0x3d')](_0x1a9ea5[_0x32ef('0x46')],function(_0x2c5417){var _0x14ac0a={};_0x14ac0a[_0x2c5417]={'$like':'%'+_0x183c07[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x14ac0a;})});}if(_0x183c07['query'][_0x32ef('0x9f')]){var _0x1e4a05=_0x183c07[_0x32ef('0x43')][_0x32ef('0x9f')][_0x32ef('0xa0')](',');var _0x4f233c={};_0x4f233c[_0x1e4a05[0x0]]={'$gte':moment(_0x1e4a05[0x1])[_0x32ef('0xa1')](_0x32ef('0xa2'))};_0x1a9ea5[_0x32ef('0x4e')]=_['merge'](_0x1a9ea5['where'],_0x4f233c);}_0x1a9ea5=_[_0x32ef('0x51')]({},_0x1a9ea5,_0x183c07['options']);return db[_0x32ef('0x9e')]['count']({'where':_0x1a9ea5[_0x32ef('0x4e')]})[_0x32ef('0x22')](function(_0x2e5d0b){_0x4a4b8b[_0x32ef('0x30')]=_0x2e5d0b;if(_0x183c07[_0x32ef('0x43')]['includeAll']){_0x1a9ea5[_0x32ef('0x56')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x1a9ea5);})['then'](function(_0x1d4130){_0x4a4b8b[_0x32ef('0x58')]=_0x1d4130;return _0x4a4b8b;});}})[_0x32ef('0x22')](respondWithFilteredResult(_0x92ce66,_0x1a9ea5))[_0x32ef('0x2c')](handleError(_0x92ce66,null));};exports[_0x32ef('0x3a')]=function(_0x5d58bd,_0x43655c,_0x560233){var _0x16da73,_0x2a884f={},_0x1f5ffe;if(_0x5d58bd[_0x32ef('0x63')]['to']){_0x1f5ffe=_0x5d58bd['body']['to'][0x0];}return db['FaxAccount'][_0x32ef('0x5b')]({'where':{'id':_0x5d58bd[_0x32ef('0x5a')]['id']},'include':[{'model':db[_0x32ef('0xa3')],'as':_0x32ef('0xa4'),'include':[{'model':db[_0x32ef('0x72')],'as':'Contacts','where':{'fax':_0x1f5ffe},'limit':0x1,'order':[['updatedAt',_0x32ef('0xa5')]]}]}]})['then'](handleEntityNotFound(_0x43655c,null))['then'](function(_0x9345fe){_0x16da73=_0x9345fe;if(_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')]&&_0x5d58bd[_0x32ef('0x63')]['attachments'][_0x32ef('0x48')]){for(var _0x26c4e6=0x0;_0x26c4e6<_0x5d58bd['body']['attachments']['length'];_0x26c4e6+=0x1){_0x5d58bd[_0x32ef('0x63')]['attachments'][_0x26c4e6]={'filename':_0x5d58bd[_0x32ef('0x63')]['attachments'][_0x26c4e6][_0x32ef('0x39')],'id':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][_0x26c4e6]['id'],'path':path[_0x32ef('0xa7')](config[_0x32ef('0xa8')],_0x32ef('0xa9'),_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][_0x26c4e6]['basename'])};}}return respondWithRpcPromise(_0x32ef('0xaa'),'CheckAfterSend',{'FaxAccountId':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x5a')]['id'])?undefined:_0x5d58bd[_0x32ef('0x5a')]['id'],'path':_['isNil'](_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0][_0x32ef('0x8')])?undefined:_0x5d58bd[_0x32ef('0x63')]['attachments'][0x0][_0x32ef('0x8')],'fax':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x63')]['to'][0x0])?undefined:_0x5d58bd[_0x32ef('0x63')]['to'][0x0]},client9002);})[_0x32ef('0x22')](function(){if(_0x16da73){if(_['isNil'](_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xac')])){_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xac')]=util['format'](_0x32ef('0xad'),_0x16da73['name'],_0x16da73[_0x32ef('0xae')]);}if(_0x16da73[_0x32ef('0xa4')]){if(_0x16da73['List'][_0x32ef('0xaf')][_0x32ef('0x48')]){return _0x16da73[_0x32ef('0xa4')][_0x32ef('0xaf')][0x0];}else{return db[_0x32ef('0x72')][_0x32ef('0x5c')](_[_0x32ef('0x19')](_0x5d58bd['body'],{'firstName':_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'phone':_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'fax':_0x5d58bd['body']['to'][0x0],'ListId':_0x16da73[_0x32ef('0x9b')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0xc7f0af){if(_0xc7f0af){return db[_0x32ef('0x70')][_0x32ef('0x5b')]({'where':{'ContactId':_0xc7f0af['id'],'closed':![],'FaxAccountId':_0x16da73['id']}})[_0x32ef('0x22')](function(_0x3f3526){if(_0x3f3526){return[_0x3f3526,![]];}return db[_0x32ef('0x70')][_0x32ef('0x5c')]({'UserId':_0x5d58bd[_0x32ef('0x5d')]['id'],'ContactId':_0xc7f0af['id'],'FaxAccountId':_0x16da73['id'],'fax':_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'firstMsgDirection':_0x32ef('0xb0'),'Messages':[_['merge'](_0x5d58bd['body'],{'read':![],'body':_0x5d58bd[_0x32ef('0x63')]['attachments'][0x0][_0x32ef('0xb1')],'FaxAccountId':_0x16da73['id'],'UserId':_0x5d58bd[_0x32ef('0x5d')]['id'],'ContactId':_0xc7f0af['id'],'AttachmentId':_0x5d58bd['body']['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x32ef('0x9e')],'as':'Messages'}]})[_0x32ef('0x22')](function(_0x5b8da7){return[_0x5b8da7,!![]];});});}else{throw new Error(_0x32ef('0xb2'));}})[_0x32ef('0xb3')](function(_0x5d1471,_0x3e4b69){if(_0x3e4b69){return _0x5d1471;}return db[_0x32ef('0x9e')][_0x32ef('0x5c')]({'direction':'out','read':![],'body':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0]['filename'],'FaxAccountId':_0x16da73['id'],'FaxInteractionId':_0x5d1471['id'],'UserId':_0x5d58bd[_0x32ef('0x5d')]['id'],'ContactId':_0x5d1471[_0x32ef('0xb4')],'AttachmentId':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0]['id']})['then'](function(_0x5036cf){_0x5d1471[_0x32ef('0xb5')][_0x32ef('0xb6')]=[];_0x5d1471[_0x32ef('0xb5')]['Messages'][_0x32ef('0x8a')](_0x5036cf[_0x32ef('0xb5')]);return _0x5d1471;});})[_0x32ef('0x22')](function(_0x503b79){respondWithRpcPromise(_0x32ef('0xb7'),_0x32ef('0xb7'),{'FaxAccountId':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x5a')]['id'])?undefined:_0x5d58bd['params']['id'],'path':_[_0x32ef('0xab')](_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0][_0x32ef('0x8')])?undefined:_0x5d58bd[_0x32ef('0x63')]['attachments'][0x0][_0x32ef('0x8')],'fax':_[_0x32ef('0xab')](_0x5d58bd['body']['to'][0x0])?undefined:_0x5d58bd[_0x32ef('0x63')]['to'][0x0],'AttachmentId':_0x5d58bd[_0x32ef('0x63')][_0x32ef('0xa6')][0x0]['id']},client9002)[_0x32ef('0x22')](function(_0x19813f){logger[_0x32ef('0x23')](_0x32ef('0xb8'),_0x19813f);})[_0x32ef('0x2c')](function(_0x466890){logger[_0x32ef('0x23')](_0x32ef('0xb8'),_0x466890);});return _0x503b79;})[_0x32ef('0x22')](respondWithResult(_0x43655c,null))[_0x32ef('0x2c')](handleError(_0x43655c,null));};exports[_0x32ef('0xb9')]=function(_0x27e4df,_0xfcb9fd,_0x44eeb5){return db[_0x32ef('0x3e')][_0x32ef('0x5b')]({'where':{'id':_0x27e4df['params']['id']}})['then'](handleEntityNotFound(_0xfcb9fd,null))[_0x32ef('0x22')](function(_0x137bbb){if(_0x137bbb){return _0x137bbb[_0x32ef('0xb9')](_0x27e4df[_0x32ef('0x63')][_0x32ef('0x6b')],_[_0x32ef('0x71')](_0x27e4df['body'],['ids','id'])||{})[_0x32ef('0xb3')](function(_0x504cc2){for(var _0x2f7c05=0x0;_0x2f7c05<_0x27e4df[_0x32ef('0x63')][_0x32ef('0x6b')]['length'];_0x2f7c05+=0x1){socket[_0x32ef('0xba')](_0x32ef('0xbb'),{'UserId':_0x27e4df[_0x32ef('0x63')]['ids'][_0x2f7c05],'FaxAccountId':_0x27e4df[_0x32ef('0x5a')]['id']});}return _0x504cc2;});}})['then'](respondWithResult(_0xfcb9fd,null))[_0x32ef('0x2c')](handleError(_0xfcb9fd,null));};exports[_0x32ef('0xbc')]=function(_0x49e8b6,_0x5f1d3f,_0x3c422a){return db[_0x32ef('0x3e')]['find']({'where':{'id':_0x49e8b6[_0x32ef('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5f1d3f,null))[_0x32ef('0x22')](function(_0x50bba9){if(_0x50bba9){return _0x50bba9[_0x32ef('0xbc')](_0x49e8b6['query'][_0x32ef('0x6b')])[_0x32ef('0x22')](function(){if(_[_0x32ef('0xbd')](_0x49e8b6['query'][_0x32ef('0x6b')])){for(var _0x4b3c9d=0x0;_0x4b3c9d<_0x49e8b6[_0x32ef('0x43')]['ids'][_0x32ef('0x48')];_0x4b3c9d+=0x1){socket['emit'](_0x32ef('0xbe'),{'UserId':Number(_0x49e8b6[_0x32ef('0x43')]['ids'][_0x4b3c9d]),'FaxAccountId':Number(_0x49e8b6[_0x32ef('0x5a')]['id'])});}}else{socket['emit'](_0x32ef('0xbe'),{'UserId':Number(_0x49e8b6[_0x32ef('0x43')][_0x32ef('0x6b')]),'FaxAccountId':Number(_0x49e8b6[_0x32ef('0x5a')]['id'])});}});}})[_0x32ef('0x22')](respondWithStatusCode(_0x5f1d3f,null))[_0x32ef('0x2c')](handleError(_0x5f1d3f,null));};exports[_0x32ef('0xbf')]=function(_0x5de210,_0x42b669,_0x4bfc2a){var _0x47a574={};var _0x4740d7={};var _0x3df194;var _0x2b1d5d;return db[_0x32ef('0x3e')][_0x32ef('0x69')]({'where':{'id':_0x5de210['params']['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x42b669,null))[_0x32ef('0x22')](function(_0x27eedf){if(_0x27eedf){_0x3df194=_0x27eedf;_0x4740d7[_0x32ef('0x42')]=_[_0x32ef('0x44')](db[_0x32ef('0x74')][_0x32ef('0x3f')]);_0x4740d7[_0x32ef('0x43')]=_[_0x32ef('0x44')](_0x5de210[_0x32ef('0x43')]);_0x4740d7[_0x32ef('0x4f')]=_[_0x32ef('0x45')](_0x4740d7[_0x32ef('0x42')],_0x4740d7[_0x32ef('0x43')]);_0x47a574[_0x32ef('0x46')]=_[_0x32ef('0x45')](_0x4740d7[_0x32ef('0x42')],qs[_0x32ef('0x47')](_0x5de210[_0x32ef('0x43')]['fields']));_0x47a574[_0x32ef('0x46')]=_0x47a574[_0x32ef('0x46')][_0x32ef('0x48')]?_0x47a574[_0x32ef('0x46')]:_0x4740d7[_0x32ef('0x42')];_0x47a574['order']=qs['sort'](_0x5de210[_0x32ef('0x43')][_0x32ef('0x4d')]);_0x47a574[_0x32ef('0x4e')]=qs['filters'](_[_0x32ef('0x50')](_0x5de210[_0x32ef('0x43')],_0x4740d7[_0x32ef('0x4f')]));if(_0x5de210[_0x32ef('0x43')][_0x32ef('0x53')]){_0x47a574[_0x32ef('0x4e')]=_[_0x32ef('0x51')](_0x47a574[_0x32ef('0x4e')],{'$or':_['map'](_0x47a574[_0x32ef('0x46')],function(_0x3cc3f3){var _0x53f09b={};_0x53f09b[_0x3cc3f3]={'$like':'%'+_0x5de210[_0x32ef('0x43')][_0x32ef('0x53')]+'%'};return _0x53f09b;})});}_0x47a574=_[_0x32ef('0x51')]({},_0x47a574,_0x5de210['options']);return _0x3df194['getAgents'](_0x47a574);}})[_0x32ef('0x22')](function(_0x3246d8){if(_0x3246d8){_0x2b1d5d=_0x3246d8[_0x32ef('0x48')];if(!_0x5de210[_0x32ef('0x43')][_0x32ef('0x49')](_0x32ef('0x4a'))){_0x47a574['limit']=qs[_0x32ef('0x4b')](_0x5de210[_0x32ef('0x43')]['limit']);_0x47a574[_0x32ef('0x31')]=qs['offset'](_0x5de210[_0x32ef('0x43')][_0x32ef('0x31')]);}return _0x3df194[_0x32ef('0xbf')](_0x47a574);}})[_0x32ef('0x22')](function(_0x527c1f){if(_0x527c1f){return _0x527c1f?{'count':_0x2b1d5d,'rows':_0x527c1f}:null;}})[_0x32ef('0x22')](respondWithResult(_0x42b669,null))[_0x32ef('0x2c')](handleError(_0x42b669,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 76188a1..a7bb767 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 _0x4252=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0x4252,0x89));var _0x2425=function(_0x5a236f,_0x17d58d){_0x5a236f=_0x5a236f-0x0;var _0x132f25=_0x4252[_0x5a236f];return _0x132f25;};'use strict';var EventEmitter=require(_0x2425('0x0'));var FaxAccount=require(_0x2425('0x1'))['db'][_0x2425('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2425('0x3')](0x0);var events={'afterCreate':_0x2425('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x77943){return function(_0x23262e,_0x31bb3d,_0x42a164){FaxAccountEvents[_0x2425('0x5')](_0x77943+':'+_0x23262e['id'],_0x23262e);FaxAccountEvents['emit'](_0x77943,_0x23262e);_0x42a164(null);};}for(var e in events){if(events[_0x2425('0x6')](e)){var event=events[e];FaxAccount[_0x2425('0x7')](e,emitEvent(event));}}module[_0x2425('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x8a13=['FaxAccount','setMaxListeners','save','update','emit','exports','events','../../mysqldb'];(function(_0x2e8fa6,_0x4b53c0){var _0x47d0ea=function(_0x234d4e){while(--_0x234d4e){_0x2e8fa6['push'](_0x2e8fa6['shift']());}};_0x47d0ea(++_0x4b53c0);}(_0x8a13,0xd6));var _0x38a1=function(_0x41eb44,_0x229d85){_0x41eb44=_0x41eb44-0x0;var _0x334ba7=_0x8a13[_0x41eb44];return _0x334ba7;};'use strict';var EventEmitter=require(_0x38a1('0x0'));var FaxAccount=require(_0x38a1('0x1'))['db'][_0x38a1('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x38a1('0x3')](0x0);var events={'afterCreate':_0x38a1('0x4'),'afterUpdate':_0x38a1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3a6920){return function(_0x155c66,_0x397f8d,_0x10b66e){FaxAccountEvents[_0x38a1('0x6')](_0x3a6920+':'+_0x155c66['id'],_0x155c66);FaxAccountEvents[_0x38a1('0x6')](_0x3a6920,_0x155c66);_0x10b66e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0x38a1('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 d4ef607..8909e04 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 _0x457e=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x361ab8,_0x3a084e){var _0x3714fd=function(_0x1b8564){while(--_0x1b8564){_0x361ab8['push'](_0x361ab8['shift']());}};_0x3714fd(++_0x3a084e);}(_0x457e,0x150));var _0xe457=function(_0x1e51ce,_0x2e592a){_0x1e51ce=_0x1e51ce-0x0;var _0x248c19=_0x457e[_0x1e51ce];return _0x248c19;};'use strict';var _=require(_0xe457('0x0'));var util=require(_0xe457('0x1'));var logger=require(_0xe457('0x2'))(_0xe457('0x3'));var moment=require('moment');var BPromise=require(_0xe457('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe457('0x5'));var rimraf=require(_0xe457('0x6'));var config=require(_0xe457('0x7'));var attributes=require(_0xe457('0x8'));module[_0xe457('0x9')]=function(_0x22fbd6,_0x219c08){return _0x22fbd6[_0xe457('0xa')](_0xe457('0xb'),attributes,{'tableName':_0xe457('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa8c=['bluebird','request-promise','path','rimraf','../../config/environment','FaxAccount','fax_accounts','lodash','util','api'];(function(_0x1f1c68,_0xe531ea){var _0x33a52c=function(_0x465247){while(--_0x465247){_0x1f1c68['push'](_0x1f1c68['shift']());}};_0x33a52c(++_0xe531ea);}(_0xfa8c,0xb1));var _0xcfa8=function(_0x39bdb7,_0xbffa5e){_0x39bdb7=_0x39bdb7-0x0;var _0x4ad3af=_0xfa8c[_0x39bdb7];return _0x4ad3af;};'use strict';var _=require(_0xcfa8('0x0'));var util=require(_0xcfa8('0x1'));var logger=require('../../config/logger')(_0xcfa8('0x2'));var moment=require('moment');var BPromise=require(_0xcfa8('0x3'));var rp=require(_0xcfa8('0x4'));var fs=require('fs');var path=require(_0xcfa8('0x5'));var rimraf=require(_0xcfa8('0x6'));var config=require(_0xcfa8('0x7'));var attributes=require('./faxAccount.attributes');module['exports']=function(_0x2c17c1,_0x3fbb57){return _0x2c17c1['define'](_0xcfa8('0x8'),attributes,{'tableName':_0xcfa8('0x9'),'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 e7aa946..f15960b 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 _0xa3e6=['AttachmentId','UserId','agent','name','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','DESC','FaxApplication','get','Applications','list','orderBy','asc','Contacts','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','applications','push','unmanaged','created','interaction','FaxMessage','ContactId'];(function(_0x5b87ce,_0x20b7f6){var _0x597aa7=function(_0x295004){while(--_0x295004){_0x5b87ce['push'](_0x5b87ce['shift']());}};_0x597aa7(++_0x20b7f6);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x2d6d72,_0x3a0d51){_0x2d6d72=_0x2d6d72-0x0;var _0x3b6d07=_0xa3e6[_0x2d6d72];return _0x3b6d07;};'use strict';var _=require(_0x6a3e('0x0'));var util=require('util');var moment=require(_0x6a3e('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a3e('0x2'));var fs=require('fs');var Redis=require(_0x6a3e('0x3'));var db=require(_0x6a3e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a3e('0x5'))('rpc');var config=require(_0x6a3e('0x6'));var jayson=require(_0x6a3e('0x7'));var client=jayson[_0x6a3e('0x8')][_0x6a3e('0x9')]({'port':0x232c});config[_0x6a3e('0xa')]=_['defaults'](config[_0x6a3e('0xa')],{'host':_0x6a3e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6a3e('0xc'))['register'](socket);function respondWithRpcPromise(_0x54a40c,_0xef2185,_0x4f5a4a){return new BPromise(function(_0x39f8ca,_0x55d25d){return client[_0x6a3e('0xd')](_0x54a40c,_0x4f5a4a)[_0x6a3e('0xe')](function(_0x14fc9e){logger[_0x6a3e('0xf')](_0x6a3e('0x10'),_0xef2185,_0x6a3e('0x11'));logger['debug'](_0x6a3e('0x12'),_0xef2185,_0x6a3e('0x11'),JSON[_0x6a3e('0x13')](_0x14fc9e));if(_0x14fc9e[_0x6a3e('0x14')]){if(_0x14fc9e[_0x6a3e('0x14')][_0x6a3e('0x15')]===0x1f4){logger[_0x6a3e('0x14')]('FaxAccount,\x20%s,\x20%s',_0xef2185,_0x14fc9e[_0x6a3e('0x14')][_0x6a3e('0x16')]);return _0x55d25d(_0x14fc9e[_0x6a3e('0x14')][_0x6a3e('0x16')]);}logger['error'](_0x6a3e('0x10'),_0xef2185,_0x14fc9e[_0x6a3e('0x14')]['message']);return _0x39f8ca(_0x14fc9e['error']['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0xef2185,_0x6a3e('0x11'));_0x39f8ca(_0x14fc9e[_0x6a3e('0x17')][_0x6a3e('0x16')]);}})[_0x6a3e('0x18')](function(_0x17fde0){logger[_0x6a3e('0x14')](_0x6a3e('0x10'),_0xef2185,_0x17fde0);_0x55d25d(_0x17fde0);});});}exports[_0x6a3e('0x19')]=function(_0x493454){var _0x3d1e03=this;return new Promise(function(_0x58b7b9,_0xc0452f){return db['FaxAccount'][_0x6a3e('0x1a')]({'raw':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x1c')]===undefined?!![]:![]:!![],'where':_0x493454['options']?_0x493454['options'][_0x6a3e('0x1d')]||null:null,'attributes':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x1e')]||null:null,'limit':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x1f')]||null:null,'include':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x20')]?_[_0x6a3e('0x21')](_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x20')],function(_0x25fc14){return{'model':db[_0x25fc14[_0x6a3e('0x22')]],'as':_0x25fc14['as'],'attributes':_0x25fc14['attributes'],'include':_0x25fc14['include']?_[_0x6a3e('0x21')](_0x25fc14[_0x6a3e('0x20')],function(_0x13bdc3){return{'model':db[_0x13bdc3[_0x6a3e('0x22')]],'as':_0x13bdc3['as'],'attributes':_0x13bdc3[_0x6a3e('0x1e')],'include':_0x13bdc3[_0x6a3e('0x20')]?_[_0x6a3e('0x21')](_0x13bdc3[_0x6a3e('0x20')],function(_0xd87198){return{'model':db[_0xd87198[_0x6a3e('0x22')]],'as':_0xd87198['as'],'attributes':_0xd87198[_0x6a3e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eec67){logger[_0x6a3e('0xf')]('GetFaxAccount',_0x493454);logger[_0x6a3e('0x23')]('GetFaxAccount',_0x493454,JSON['stringify'](_0x4eec67));_0x58b7b9(_0x4eec67);})[_0x6a3e('0x18')](function(_0x3de028){logger['error']('GetFaxAccount',_0x3de028[_0x6a3e('0x16')],_0x493454);_0xc0452f(_0x3d1e03[_0x6a3e('0x14')](0x1f4,_0x3de028[_0x6a3e('0x16')]));});});};exports[_0x6a3e('0x24')]=function(_0x584d44,_0x540146,_0x3eb0d0){var _0x44f9ad=this;return new Promise(function(_0x1a6ae3,_0x1332d2){var _0x576400={'body':_0x584d44[_0x6a3e('0x25')],'channel':_0x6a3e('0x26')};var _0x5022e2=[];var _0x51e98c=[];var _0x5a7aed={};return db[_0x6a3e('0x27')][_0x6a3e('0x28')]()[_0x6a3e('0xe')](function(_0x257513){if(!_0x257513){throw new db[(_0x6a3e('0x29'))][(_0x6a3e('0x2a'))](_0x6a3e('0x2b'));}_0x5022e2=_[_0x6a3e('0x2c')](_[_0x6a3e('0x2d')](_0x257513),[_0x6a3e('0x2e'),_0x6a3e('0x2f')]);_0x51e98c=_[_0x6a3e('0x2c')](_[_0x6a3e('0x2d')](_0x257513),[_0x6a3e('0x2e'),_0x6a3e('0x2f'),'CompanyId',_0x6a3e('0x30')]);if(_0x584d44[_0x6a3e('0x25')]['id']){delete _0x584d44[_0x6a3e('0x25')]['id'];}if(_['isNil'](_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x31')])){throw new db['Sequelize'][(_0x6a3e('0x2a'))](_0x6a3e('0x32'));}if(_[_0x6a3e('0x33')](_0x584d44['body'][_0x6a3e('0x25')])||_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x25')]===''){throw new db[(_0x6a3e('0x29'))][(_0x6a3e('0x2a'))](_0x6a3e('0x34'));}if(_['isNil'](_0x584d44[_0x6a3e('0x25')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x6a3e('0x35')+_0x51e98c);}if(!_['includes'](_0x51e98c,_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x36')])){throw new db[(_0x6a3e('0x29'))][(_0x6a3e('0x2a'))](_0x6a3e('0x37')+_0x51e98c);}_0x5a7aed[_0x584d44[_0x6a3e('0x25')]['mapKey']]=_0x584d44['body'][_0x6a3e('0x31')];})[_0x6a3e('0xe')](function(){return db[_0x6a3e('0x38')][_0x6a3e('0x39')]({'where':{'id':_0x584d44[_0x6a3e('0x3a')]['id']},'include':[{'model':db['CmList'],'as':_0x6a3e('0x3b'),'include':[{'model':db[_0x6a3e('0x27')],'as':'Contacts','where':_0x5a7aed,'limit':0x1,'order':[[_0x6a3e('0x2f'),_0x6a3e('0x3c')]]}]},{'model':db[_0x6a3e('0x3d')],'as':'Applications'}]});})[_0x6a3e('0xe')](function(_0x1413a3){if(_0x1413a3&&_0x1413a3[_0x6a3e('0x3b')]){var _0x2cd46b=_0x1413a3[_0x6a3e('0x3e')]({'plain':!![]});_0x576400[_0x6a3e('0x3a')]=_0x2cd46b;_0x576400['applications']=_0x2cd46b[_0x6a3e('0x3f')];_0x576400[_0x6a3e('0x40')]=_0x2cd46b[_0x6a3e('0x3b')];_0x576400['applications']=_[_0x6a3e('0x41')](_0x576400['applications'],['priority'],[_0x6a3e('0x42')]);if(_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x3f')]){delete _0x576400['account']['Applications'];}if(_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x3b')]&&_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x3b')][_0x6a3e('0x43')][_0x6a3e('0x44')]){return _0x576400['account'][_0x6a3e('0x3b')][_0x6a3e('0x43')][0x0];}var _0x1da6f9=_[_0x6a3e('0x45')](_0x584d44[_0x6a3e('0x25')],{'firstName':_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x31')],'ListId':_0x2cd46b[_0x6a3e('0x30')]});_0x1da6f9[_0x584d44[_0x6a3e('0x25')]['mapKey']]=_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x31')];return db['CmContact'][_0x6a3e('0x46')](_0x1da6f9,{'fields':_0x5022e2,'raw':!![]});}})['then'](function(_0x250db6){_0x576400[_0x6a3e('0x47')]=_0x250db6;if(_0x250db6){var _0x28a3e9={'ContactId':_0x250db6['id'],'FaxAccountId':_0x584d44['account']['id'],'fax':_0x250db6[_0x6a3e('0x26')]};return db[_0x6a3e('0x48')]['find']({'where':{'ContactId':_0x250db6['id'],'closed':![],'FaxAccountId':_0x584d44['account']['id']}})['then'](function(_0x2537b6){if(_0x2537b6){return[_0x2537b6,![]];}return db[_0x6a3e('0x48')][_0x6a3e('0x46')](_0x28a3e9)[_0x6a3e('0xe')](function(_0x1f5ac1){return[_0x1f5ac1,!![]];});});}else{throw new Error(_0x6a3e('0x49'));}})[_0x6a3e('0x4a')](function(_0x1ce964,_0x4615fa){var _0x196470=_0x1ce964[_0x6a3e('0x3e')]({'plain':!![]});if(_0x4615fa){if(_0x576400['account'][_0x6a3e('0x4b')]){_0x576400[_0x6a3e('0x4c')][_0x6a3e('0x4d')]({'id':0x0,'priority':_0x576400[_0x6a3e('0x4c')][_0x6a3e('0x44')]+0x1,'app':'close','appdata':_0x6a3e('0x4e'),'interval':'*,*,*,*'});}_0x196470[_0x6a3e('0x4f')]=!![];}else{_0x196470[_0x6a3e('0x4f')]=![];}_0x576400[_0x6a3e('0x50')]=_0x196470;return db[_0x6a3e('0x51')][_0x6a3e('0x46')]({'body':_0x584d44['body']['body'],'FaxAccountId':_0x584d44['account']['id'],'FaxInteractionId':_0x1ce964['id'],'direction':'in','ContactId':_0x1ce964[_0x6a3e('0x52')],'AttachmentId':_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x53')]});})[_0x6a3e('0xe')](function(_0x13d520){_0x576400[_0x6a3e('0x16')]=_0x13d520;if(_0x576400['interaction'][_0x6a3e('0x54')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x576400[_0x6a3e('0x50')][_0x6a3e('0x54')]}})['then'](function(_0x3046a6){if(_0x3046a6){_0x576400[_0x6a3e('0x4c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6a3e('0x55'),'appdata':_0x3046a6[_0x6a3e('0x56')]+','+(_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x57')]||0xa),'interval':_0x6a3e('0x58')});}return respondWithRpcPromise('Start',_0x6a3e('0x59'),_0x576400);});}return respondWithRpcPromise(_0x6a3e('0x5a'),'startRouting',_0x576400);})[_0x6a3e('0xe')](function(_0x30fe3b){_0x1a6ae3(_0x30fe3b);})[_0x6a3e('0x18')](function(_0x2603e9){_0x1332d2(_0x44f9ad[_0x6a3e('0x14')](0x1f4,_0x2603e9[_0x6a3e('0x16')]));});});}; \ No newline at end of file +var _0x5959=['options','raw','attributes','limit','include','map','model','GetFaxAccount','debug','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','find','account','CmList','Applications','List','get','list','applications','priority','asc','length','Contacts','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','close','*,*,*,*','created','interaction','FaxMessage','AttachmentId','User','UserId','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount'];(function(_0x24679e,_0x22d9d7){var _0x291f21=function(_0x329529){while(--_0x329529){_0x24679e['push'](_0x24679e['shift']());}};_0x291f21(++_0x22d9d7);}(_0x5959,0x95));var _0x9595=function(_0xa96436,_0x656eb1){_0xa96436=_0xa96436-0x0;var _0x310513=_0x5959[_0xa96436];return _0x310513;};'use strict';var _=require(_0x9595('0x0'));var util=require(_0x9595('0x1'));var moment=require(_0x9595('0x2'));var BPromise=require(_0x9595('0x3'));var rs=require(_0x9595('0x4'));var fs=require('fs');var Redis=require(_0x9595('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9595('0x6'));var logger=require(_0x9595('0x7'))(_0x9595('0x8'));var config=require(_0x9595('0x9'));var jayson=require(_0x9595('0xa'));var client=jayson[_0x9595('0xb')][_0x9595('0xc')]({'port':0x232c});config[_0x9595('0xd')]=_[_0x9595('0xe')](config[_0x9595('0xd')],{'host':_0x9595('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9595('0xd')]));require(_0x9595('0x10'))['register'](socket);function respondWithRpcPromise(_0x2a5d9b,_0x45af30,_0x42bdf8){return new BPromise(function(_0xfd5f0f,_0x364b07){return client[_0x9595('0x11')](_0x2a5d9b,_0x42bdf8)[_0x9595('0x12')](function(_0x3614f0){logger[_0x9595('0x13')](_0x9595('0x14'),_0x45af30,'request\x20sent');logger['debug'](_0x9595('0x15'),_0x45af30,'request\x20sent',JSON[_0x9595('0x16')](_0x3614f0));if(_0x3614f0[_0x9595('0x17')]){if(_0x3614f0[_0x9595('0x17')][_0x9595('0x18')]===0x1f4){logger[_0x9595('0x17')](_0x9595('0x14'),_0x45af30,_0x3614f0[_0x9595('0x17')][_0x9595('0x19')]);return _0x364b07(_0x3614f0[_0x9595('0x17')][_0x9595('0x19')]);}logger[_0x9595('0x17')](_0x9595('0x14'),_0x45af30,_0x3614f0[_0x9595('0x17')][_0x9595('0x19')]);return _0xfd5f0f(_0x3614f0['error'][_0x9595('0x19')]);}else{logger[_0x9595('0x13')](_0x9595('0x14'),_0x45af30,'request\x20sent');_0xfd5f0f(_0x3614f0[_0x9595('0x1a')]['message']);}})[_0x9595('0x1b')](function(_0x54841b){logger['error'](_0x9595('0x14'),_0x45af30,_0x54841b);_0x364b07(_0x54841b);});});}exports['GetFaxAccount']=function(_0x14ef70){var _0x1bda78=this;return new Promise(function(_0xe2ea76,_0x548202){return db[_0x9595('0x1c')]['findAll']({'raw':_0x14ef70[_0x9595('0x1d')]?_0x14ef70[_0x9595('0x1d')][_0x9595('0x1e')]===undefined?!![]:![]:!![],'where':_0x14ef70[_0x9595('0x1d')]?_0x14ef70[_0x9595('0x1d')]['where']||null:null,'attributes':_0x14ef70['options']?_0x14ef70['options'][_0x9595('0x1f')]||null:null,'limit':_0x14ef70[_0x9595('0x1d')]?_0x14ef70[_0x9595('0x1d')][_0x9595('0x20')]||null:null,'include':_0x14ef70['options']?_0x14ef70[_0x9595('0x1d')][_0x9595('0x21')]?_[_0x9595('0x22')](_0x14ef70[_0x9595('0x1d')][_0x9595('0x21')],function(_0x318f33){return{'model':db[_0x318f33['model']],'as':_0x318f33['as'],'attributes':_0x318f33[_0x9595('0x1f')],'include':_0x318f33['include']?_['map'](_0x318f33[_0x9595('0x21')],function(_0x19d6b9){return{'model':db[_0x19d6b9[_0x9595('0x23')]],'as':_0x19d6b9['as'],'attributes':_0x19d6b9['attributes'],'include':_0x19d6b9['include']?_[_0x9595('0x22')](_0x19d6b9['include'],function(_0x3c0f99){return{'model':db[_0x3c0f99[_0x9595('0x23')]],'as':_0x3c0f99['as'],'attributes':_0x3c0f99['attributes']};}):[]};}):[]};}):[]:[]})[_0x9595('0x12')](function(_0xb993fb){logger[_0x9595('0x13')](_0x9595('0x24'),_0x14ef70);logger[_0x9595('0x25')]('GetFaxAccount',_0x14ef70,JSON[_0x9595('0x16')](_0xb993fb));_0xe2ea76(_0xb993fb);})[_0x9595('0x1b')](function(_0x3f72cd){logger[_0x9595('0x17')](_0x9595('0x24'),_0x3f72cd['message'],_0x14ef70);_0x548202(_0x1bda78[_0x9595('0x17')](0x1f4,_0x3f72cd[_0x9595('0x19')]));});});};exports[_0x9595('0x26')]=function(_0x42cbb2,_0x4c0e67,_0x5e6b1d){var _0x546979=this;return new Promise(function(_0x1f19da,_0x47eef0){var _0x53bfe4={'body':_0x42cbb2[_0x9595('0x27')],'channel':_0x9595('0x28')};var _0x47f20a=[];var _0x2d43b8=[];var _0x32d8b8={};return db[_0x9595('0x29')][_0x9595('0x2a')]()[_0x9595('0x12')](function(_0x5c0658){if(!_0x5c0658){throw new db[(_0x9595('0x2b'))][(_0x9595('0x2c'))]('no\x20available\x20attributes');}_0x47f20a=_[_0x9595('0x2d')](_[_0x9595('0x2e')](_0x5c0658),[_0x9595('0x2f'),_0x9595('0x30')]);_0x2d43b8=_[_0x9595('0x2d')](_[_0x9595('0x2e')](_0x5c0658),[_0x9595('0x2f'),_0x9595('0x30'),'CompanyId',_0x9595('0x31')]);if(_0x42cbb2[_0x9595('0x27')]['id']){delete _0x42cbb2[_0x9595('0x27')]['id'];}if(_['isNil'](_0x42cbb2['body'][_0x9595('0x32')])){throw new db['Sequelize'][(_0x9595('0x2c'))](_0x9595('0x33'));}if(_['isNil'](_0x42cbb2['body'][_0x9595('0x27')])||_0x42cbb2[_0x9595('0x27')]['body']===''){throw new db[(_0x9595('0x2b'))][(_0x9595('0x2c'))](_0x9595('0x34'));}if(_[_0x9595('0x35')](_0x42cbb2['body']['mapKey'])){throw new db[(_0x9595('0x2b'))]['ValidationError'](_0x9595('0x36')+_0x2d43b8);}if(!_[_0x9595('0x37')](_0x2d43b8,_0x42cbb2[_0x9595('0x27')][_0x9595('0x38')])){throw new db[(_0x9595('0x2b'))][(_0x9595('0x2c'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2d43b8);}_0x32d8b8[_0x42cbb2[_0x9595('0x27')]['mapKey']]=_0x42cbb2['body'][_0x9595('0x32')];})[_0x9595('0x12')](function(){return db[_0x9595('0x1c')][_0x9595('0x39')]({'where':{'id':_0x42cbb2[_0x9595('0x3a')]['id']},'include':[{'model':db[_0x9595('0x3b')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x32d8b8,'limit':0x1,'order':[[_0x9595('0x30'),'DESC']]}]},{'model':db['FaxApplication'],'as':_0x9595('0x3c')}]});})[_0x9595('0x12')](function(_0x511855){if(_0x511855&&_0x511855[_0x9595('0x3d')]){var _0x4e9484=_0x511855[_0x9595('0x3e')]({'plain':!![]});_0x53bfe4[_0x9595('0x3a')]=_0x4e9484;_0x53bfe4['applications']=_0x4e9484[_0x9595('0x3c')];_0x53bfe4[_0x9595('0x3f')]=_0x4e9484[_0x9595('0x3d')];_0x53bfe4[_0x9595('0x40')]=_['orderBy'](_0x53bfe4[_0x9595('0x40')],[_0x9595('0x41')],[_0x9595('0x42')]);if(_0x53bfe4[_0x9595('0x3a')][_0x9595('0x3c')]){delete _0x53bfe4['account'][_0x9595('0x3c')];}if(_0x53bfe4[_0x9595('0x3a')][_0x9595('0x3d')]&&_0x53bfe4[_0x9595('0x3a')][_0x9595('0x3d')]['Contacts'][_0x9595('0x43')]){return _0x53bfe4['account'][_0x9595('0x3d')][_0x9595('0x44')][0x0];}var _0x18bb87=_[_0x9595('0xe')](_0x42cbb2[_0x9595('0x27')],{'firstName':_0x42cbb2[_0x9595('0x27')][_0x9595('0x32')],'ListId':_0x4e9484[_0x9595('0x31')]});_0x18bb87[_0x42cbb2[_0x9595('0x27')][_0x9595('0x38')]]=_0x42cbb2['body'][_0x9595('0x32')];return db[_0x9595('0x29')][_0x9595('0x45')](_0x18bb87,{'fields':_0x47f20a,'raw':!![]});}})['then'](function(_0x4222e2){_0x53bfe4[_0x9595('0x46')]=_0x4222e2;if(_0x4222e2){var _0xc5f838={'ContactId':_0x4222e2['id'],'FaxAccountId':_0x42cbb2[_0x9595('0x3a')]['id'],'fax':_0x4222e2[_0x9595('0x28')]};return db[_0x9595('0x47')][_0x9595('0x39')]({'where':{'ContactId':_0x4222e2['id'],'closed':![],'FaxAccountId':_0x42cbb2[_0x9595('0x3a')]['id']}})[_0x9595('0x12')](function(_0x4ef537){if(_0x4ef537){return[_0x4ef537,![]];}return db[_0x9595('0x47')][_0x9595('0x45')](_0xc5f838)[_0x9595('0x12')](function(_0x1cdfa6){return[_0x1cdfa6,!![]];});});}else{throw new Error(_0x9595('0x48'));}})[_0x9595('0x49')](function(_0x37dda3,_0x25dfa6){var _0x48b59b=_0x37dda3[_0x9595('0x3e')]({'plain':!![]});if(_0x25dfa6){if(_0x53bfe4[_0x9595('0x3a')][_0x9595('0x4a')]){_0x53bfe4[_0x9595('0x40')]['push']({'id':0x0,'priority':_0x53bfe4[_0x9595('0x40')][_0x9595('0x43')]+0x1,'app':_0x9595('0x4b'),'appdata':'unmanaged','interval':_0x9595('0x4c')});}_0x48b59b[_0x9595('0x4d')]=!![];}else{_0x48b59b[_0x9595('0x4d')]=![];}_0x53bfe4[_0x9595('0x4e')]=_0x48b59b;return db[_0x9595('0x4f')][_0x9595('0x45')]({'body':_0x42cbb2[_0x9595('0x27')]['body'],'FaxAccountId':_0x42cbb2[_0x9595('0x3a')]['id'],'FaxInteractionId':_0x37dda3['id'],'direction':'in','ContactId':_0x37dda3['ContactId'],'AttachmentId':_0x42cbb2[_0x9595('0x27')][_0x9595('0x50')]});})['then'](function(_0x5d3754){_0x53bfe4[_0x9595('0x19')]=_0x5d3754;if(_0x53bfe4[_0x9595('0x4e')]['UserId']){return db[_0x9595('0x51')][_0x9595('0x39')]({'attributes':['id','name'],'where':{'id':_0x53bfe4[_0x9595('0x4e')][_0x9595('0x52')]}})[_0x9595('0x12')](function(_0x44e686){if(_0x44e686){_0x53bfe4[_0x9595('0x40')][_0x9595('0x53')]({'id':0x0,'priority':0x0,'app':_0x9595('0x54'),'appdata':_0x44e686[_0x9595('0x55')]+','+(_0x53bfe4[_0x9595('0x3a')][_0x9595('0x56')]||0xa),'interval':_0x9595('0x4c')});}return respondWithRpcPromise(_0x9595('0x57'),_0x9595('0x58'),_0x53bfe4);});}return respondWithRpcPromise('Start',_0x9595('0x58'),_0x53bfe4);})[_0x9595('0x12')](function(_0x4e5722){_0x1f19da(_0x4e5722);})[_0x9595('0x1b')](function(_0x8aac2e){_0x47eef0(_0x546979['error'](0x1f4,_0x8aac2e[_0x9595('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index e63a998..8491873 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 _0x3d04=['remove','update','emit','removeListener','register','faxAccount:','./faxAccount.events','save'];(function(_0x6f7c3c,_0x39227e){var _0x1f40d1=function(_0x5dc1ef){while(--_0x5dc1ef){_0x6f7c3c['push'](_0x6f7c3c['shift']());}};_0x1f40d1(++_0x39227e);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var FaxAccountEvents=require(_0x43d0('0x0'));var events=[_0x43d0('0x1'),_0x43d0('0x2'),_0x43d0('0x3')];function createListener(_0x191de5,_0x143fea){return function(_0x3d6e62){_0x143fea[_0x43d0('0x4')](_0x191de5,_0x3d6e62);};}function removeListener(_0x5a9e1d,_0x2a4d4c){return function(){FaxAccountEvents[_0x43d0('0x5')](_0x5a9e1d,_0x2a4d4c);};}exports[_0x43d0('0x6')]=function(_0x617bf){for(var _0x5e284f=0x0,_0x484271=events['length'];_0x5e284f<_0x484271;_0x5e284f++){var _0x5efb95=events[_0x5e284f];var _0x457550=createListener(_0x43d0('0x7')+_0x5efb95,_0x617bf);FaxAccountEvents['on'](_0x5efb95,_0x457550);}}; \ No newline at end of file +var _0x66fa=['emit','length','faxAccount:','./faxAccount.events','save','update'];(function(_0x3fafeb,_0x193426){var _0x5e03af=function(_0x4ed910){while(--_0x4ed910){_0x3fafeb['push'](_0x3fafeb['shift']());}};_0x5e03af(++_0x193426);}(_0x66fa,0x117));var _0xa66f=function(_0x1d7613,_0x2ba19b){_0x1d7613=_0x1d7613-0x0;var _0x5ec5bf=_0x66fa[_0x1d7613];return _0x5ec5bf;};'use strict';var FaxAccountEvents=require(_0xa66f('0x0'));var events=[_0xa66f('0x1'),'remove',_0xa66f('0x2')];function createListener(_0x2dcf24,_0x234f2d){return function(_0x12a38f){_0x234f2d[_0xa66f('0x3')](_0x2dcf24,_0x12a38f);};}function removeListener(_0x2a2abf,_0x3f4904){return function(){FaxAccountEvents['removeListener'](_0x2a2abf,_0x3f4904);};}exports['register']=function(_0x2239d3){for(var _0x20a150=0x0,_0x2f0b78=events[_0xa66f('0x4')];_0x20a150<_0x2f0b78;_0x20a150++){var _0x38b58b=events[_0x20a150];var _0x5096bf=createListener(_0xa66f('0x5')+_0x38b58b,_0x2239d3);FaxAccountEvents['on'](_0x38b58b,_0x5096bf);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 359c770..917720b 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 _0x9a71=['addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','post','create','addDisposition','addInteraction'];(function(_0x17efa3,_0x39ef4b){var _0x5caced=function(_0x29e599){while(--_0x29e599){_0x17efa3['push'](_0x17efa3['shift']());}};_0x5caced(++_0x39ef4b);}(_0x9a71,0xf8));var _0x19a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a71[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x19a7('0x0'));var util=require(_0x19a7('0x1'));var path=require(_0x19a7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x19a7('0x3')]();var auth=require(_0x19a7('0x4'));var interaction=require(_0x19a7('0x5'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x19a7('0x6')]('/',auth[_0x19a7('0x7')](),controller[_0x19a7('0x8')]);router[_0x19a7('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x19a7('0x9'),auth[_0x19a7('0x7')](),controller[_0x19a7('0xa')]);router['get'](_0x19a7('0xb'),auth[_0x19a7('0x7')](),controller[_0x19a7('0xc')]);router[_0x19a7('0x6')](_0x19a7('0xd'),auth[_0x19a7('0x7')](),controller[_0x19a7('0xe')]);router[_0x19a7('0x6')](_0x19a7('0xf'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x10')]);router['get'](_0x19a7('0x11'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x12')]);router[_0x19a7('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0x19a7('0x13')]);router['get'](_0x19a7('0x14'),auth[_0x19a7('0x7')](),controller['getAgents']);router[_0x19a7('0x15')]('/',auth[_0x19a7('0x7')](),controller[_0x19a7('0x16')]);router[_0x19a7('0x15')](_0x19a7('0xb'),auth['isAuthenticated'](),controller[_0x19a7('0x17')]);router['post']('/:id/canned_answers',auth[_0x19a7('0x7')](),controller['addAnswer']);router['post']('/:id/interactions',auth[_0x19a7('0x7')](),controller[_0x19a7('0x18')]);router['post'](_0x19a7('0x11'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x19')]);router[_0x19a7('0x15')](_0x19a7('0x1a'),auth['isAuthenticated'](),controller[_0x19a7('0x1b')]);router['post'](_0x19a7('0x1c'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x1d')]);router['post'](_0x19a7('0x1e'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x1f')]);router['post'](_0x19a7('0x14'),auth[_0x19a7('0x7')](),controller['addAgents']);router[_0x19a7('0x20')](_0x19a7('0x9'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x21')]);router[_0x19a7('0x22')](_0x19a7('0x9'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x23')]);router[_0x19a7('0x22')](_0x19a7('0xb'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x24')]);router[_0x19a7('0x22')](_0x19a7('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x19a7('0x22')](_0x19a7('0x14'),auth['isAuthenticated'](),controller[_0x19a7('0x25')]);module[_0x19a7('0x26')]=router; \ No newline at end of file +var _0x382c=['/:id/interactions','getInteractions','getApplications','/:id/messages','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addInteraction','/:id/applications','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','send','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','getAnswers'];(function(_0x391588,_0x99d804){var _0x4d872b=function(_0x38ef97){while(--_0x38ef97){_0x391588['push'](_0x391588['shift']());}};_0x4d872b(++_0x99d804);}(_0x382c,0x97));var _0xc382=function(_0x437d7f,_0x1feb46){_0x437d7f=_0x437d7f-0x0;var _0x31058c=_0x382c[_0x437d7f];return _0x31058c;};'use strict';var multer=require(_0xc382('0x0'));var util=require(_0xc382('0x1'));var path=require('path');var timeout=require(_0xc382('0x2'));var express=require(_0xc382('0x3'));var router=express[_0xc382('0x4')]();var auth=require(_0xc382('0x5'));var interaction=require(_0xc382('0x6'));var config=require(_0xc382('0x7'));var controller=require(_0xc382('0x8'));router[_0xc382('0x9')]('/',auth[_0xc382('0xa')](),controller[_0xc382('0xb')]);router[_0xc382('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc382('0x9')](_0xc382('0xc'),auth['isAuthenticated'](),controller[_0xc382('0xd')]);router[_0xc382('0x9')](_0xc382('0xe'),auth[_0xc382('0xa')](),controller[_0xc382('0xf')]);router[_0xc382('0x9')]('/:id/canned_answers',auth[_0xc382('0xa')](),controller[_0xc382('0x10')]);router['get'](_0xc382('0x11'),auth['isAuthenticated'](),controller[_0xc382('0x12')]);router[_0xc382('0x9')]('/:id/applications',auth[_0xc382('0xa')](),controller[_0xc382('0x13')]);router['get'](_0xc382('0x14'),auth[_0xc382('0xa')](),controller['getMessages']);router[_0xc382('0x9')](_0xc382('0x15'),auth[_0xc382('0xa')](),controller[_0xc382('0x16')]);router[_0xc382('0x17')]('/',auth[_0xc382('0xa')](),controller[_0xc382('0x18')]);router[_0xc382('0x17')](_0xc382('0xe'),auth[_0xc382('0xa')](),controller[_0xc382('0x19')]);router[_0xc382('0x17')](_0xc382('0x1a'),auth[_0xc382('0xa')](),controller['addAnswer']);router[_0xc382('0x17')](_0xc382('0x11'),auth[_0xc382('0xa')](),controller[_0xc382('0x1b')]);router['post'](_0xc382('0x1c'),auth[_0xc382('0xa')](),controller[_0xc382('0x1d')]);router['post']('/addaccountapplications',auth[_0xc382('0xa')](),controller[_0xc382('0x1e')]);router[_0xc382('0x17')](_0xc382('0x1f'),auth[_0xc382('0xa')](),controller[_0xc382('0x20')]);router[_0xc382('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xc382('0x21')]);router[_0xc382('0x17')](_0xc382('0x15'),auth['isAuthenticated'](),controller[_0xc382('0x22')]);router[_0xc382('0x23')](_0xc382('0xc'),auth[_0xc382('0xa')](),controller['update']);router[_0xc382('0x24')](_0xc382('0xc'),auth[_0xc382('0xa')](),controller[_0xc382('0x25')]);router[_0xc382('0x24')]('/:id/dispositions',auth[_0xc382('0xa')](),controller[_0xc382('0x26')]);router[_0xc382('0x24')](_0xc382('0x1a'),auth['isAuthenticated'](),controller[_0xc382('0x27')]);router[_0xc382('0x24')](_0xc382('0x15'),auth['isAuthenticated'](),controller[_0xc382('0x28')]);module[_0xc382('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 e77e9fb..6104171 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 _0x002d=['INTEGER','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x249226,_0x5eadf8){var _0x207161=function(_0x5d3c62){while(--_0x5d3c62){_0x249226['push'](_0x249226['shift']());}};_0x207161(++_0x5eadf8);}(_0x002d,0xca));var _0xd002=function(_0x35255d,_0x2dae7f){_0x35255d=_0x35255d-0x0;var _0x1b4c7c=_0x002d[_0x35255d];return _0x1b4c7c;};'use strict';var Sequelize=require(_0xd002('0x0'));module[_0xd002('0x1')]={'priority':{'type':Sequelize[_0xd002('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd002('0x3')]()},'description':{'type':Sequelize[_0xd002('0x4')]},'interval':{'type':Sequelize[_0xd002('0x4')],'defaultValue':_0xd002('0x5')}}; \ No newline at end of file +var _0x6c1a=['exports','STRING','*,*,*,*','sequelize'];(function(_0x8cf2ac,_0x218ff3){var _0x272fd3=function(_0x20b550){while(--_0x20b550){_0x8cf2ac['push'](_0x8cf2ac['shift']());}};_0x272fd3(++_0x218ff3);}(_0x6c1a,0xf3));var _0xa6c1=function(_0x3c5a6e,_0x2d159d){_0x3c5a6e=_0x3c5a6e-0x0;var _0x68b172=_0x6c1a[_0x3c5a6e];return _0x68b172;};'use strict';var Sequelize=require(_0xa6c1('0x0'));module[_0xa6c1('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xa6c1('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa6c1('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa6c1('0x3')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 5d4f900..21dd2e3 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 _0xf4d9=['end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','catch','params','keys','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0xf7f60a,_0x15f736){var _0x2567ad=function(_0x396850){while(--_0x396850){_0xf7f60a['push'](_0xf7f60a['shift']());}};_0x2567ad(++_0x15f736);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x5b0963,_0x325e0b){_0x5b0963=_0x5b0963-0x0;var _0xa0bed4=_0xf4d9[_0x5b0963];return _0xa0bed4;};'use strict';var pdf=require(_0x9f4d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9f4d('0x1'));var zipdir=require(_0x9f4d('0x2'));var jsonpatch=require(_0x9f4d('0x3'));var rp=require(_0x9f4d('0x4'));var moment=require(_0x9f4d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f4d('0x6'));var util=require(_0x9f4d('0x7'));var path=require(_0x9f4d('0x8'));var sox=require('sox');var csv=require(_0x9f4d('0x9'));var ejs=require(_0x9f4d('0xa'));var fs=require('fs');var _=require(_0x9f4d('0xb'));var squel=require('squel');var crypto=require(_0x9f4d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f4d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f4d('0xe'));var Papa=require(_0x9f4d('0xf'));var Redis=require(_0x9f4d('0x10'));var authService=require(_0x9f4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f4d('0x12'));var hardwareService=require(_0x9f4d('0x13'));var logger=require(_0x9f4d('0x14'))(_0x9f4d('0x15'));var utils=require(_0x9f4d('0x16'));var config=require(_0x9f4d('0x17'));var db=require(_0x9f4d('0x18'))['db'];function respondWithStatusCode(_0xa33ff4,_0x13c6fc){_0x13c6fc=_0x13c6fc||0xcc;return function(_0x112a7d){if(_0x112a7d){return _0xa33ff4[_0x9f4d('0x19')](_0x13c6fc);}return _0xa33ff4['status'](_0x13c6fc)[_0x9f4d('0x1a')]();};}function respondWithResult(_0x426157,_0x35e7d4){_0x35e7d4=_0x35e7d4||0xc8;return function(_0x581e17){if(_0x581e17){return _0x426157[_0x9f4d('0x1b')](_0x35e7d4)[_0x9f4d('0x1c')](_0x581e17);}};}function respondWithFilteredResult(_0x192ad3,_0x178d8e){return function(_0x514c01){if(_0x514c01){var _0x4c8197=_0x514c01[_0x9f4d('0x1d')],_0x50534f=_0x178d8e[_0x9f4d('0x1e')],_0x2af958=_0x178d8e[_0x9f4d('0x1e')]+_0x178d8e[_0x9f4d('0x1f')],_0x157af5;if(_0x2af958>=_0x4c8197){_0x2af958=_0x4c8197;_0x157af5=0xc8;}else{_0x157af5=0xce;}_0x192ad3['status'](_0x157af5);return _0x192ad3[_0x9f4d('0x20')](_0x9f4d('0x21'),_0x50534f+'-'+_0x2af958+'/'+_0x4c8197)[_0x9f4d('0x1c')](_0x514c01);}return null;};}function patchUpdates(_0x40fdca){return function(_0x3611e1){try{jsonpatch['apply'](_0x3611e1,_0x40fdca,!![]);}catch(_0x652e0d){return BPromise[_0x9f4d('0x22')](_0x652e0d);}return _0x3611e1[_0x9f4d('0x23')]();};}function saveUpdates(_0x2145b7,_0x30577b){return function(_0x14cd44){if(_0x14cd44){return _0x14cd44[_0x9f4d('0x24')](_0x2145b7)[_0x9f4d('0x25')](function(_0xb6daf4){return _0xb6daf4;});}return null;};}function removeEntity(_0x104867,_0x4f8c11){return function(_0x5bc6ea){if(_0x5bc6ea){return _0x5bc6ea[_0x9f4d('0x26')]()[_0x9f4d('0x25')](function(){_0x104867['status'](0xcc)[_0x9f4d('0x1a')]();});}};}function handleEntityNotFound(_0xa900ce,_0x392f65){return function(_0x3e9818){if(!_0x3e9818){_0xa900ce[_0x9f4d('0x19')](0x194);}return _0x3e9818;};}function handleError(_0x36ca22,_0x233a6f){_0x233a6f=_0x233a6f||0x1f4;return function(_0x366908){logger[_0x9f4d('0x27')](_0x366908[_0x9f4d('0x28')]);if(_0x366908[_0x9f4d('0x29')]){delete _0x366908[_0x9f4d('0x29')];}_0x36ca22[_0x9f4d('0x1b')](_0x233a6f)['send'](_0x366908);};}exports[_0x9f4d('0x2a')]=function(_0xcb0f45,_0x111a87){var _0xa8df5b={},_0x3db96a={},_0x3f27d7={'count':0x0,'rows':[]};var _0x21ab4d=_['map'](db['FaxApplication'][_0x9f4d('0x2b')],function(_0x56b90a){return{'name':_0x56b90a[_0x9f4d('0x2c')],'type':_0x56b90a['type'][_0x9f4d('0x2d')]};});_0x3db96a[_0x9f4d('0x2e')]=_[_0x9f4d('0x2f')](_0x21ab4d,'name');_0x3db96a[_0x9f4d('0x30')]=_['keys'](_0xcb0f45[_0x9f4d('0x30')]);_0x3db96a['filters']=_['intersection'](_0x3db96a[_0x9f4d('0x2e')],_0x3db96a[_0x9f4d('0x30')]);_0xa8df5b[_0x9f4d('0x31')]=_[_0x9f4d('0x32')](_0x3db96a[_0x9f4d('0x2e')],qs[_0x9f4d('0x33')](_0xcb0f45[_0x9f4d('0x30')]['fields']));_0xa8df5b[_0x9f4d('0x31')]=_0xa8df5b[_0x9f4d('0x31')][_0x9f4d('0x34')]?_0xa8df5b[_0x9f4d('0x31')]:_0x3db96a[_0x9f4d('0x2e')];if(!_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x35')]('nolimit')){_0xa8df5b[_0x9f4d('0x1f')]=qs[_0x9f4d('0x1f')](_0xcb0f45[_0x9f4d('0x30')]['limit']);_0xa8df5b[_0x9f4d('0x1e')]=qs[_0x9f4d('0x1e')](_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x1e')]);}_0xa8df5b[_0x9f4d('0x36')]=qs[_0x9f4d('0x37')](_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x37')]);_0xa8df5b[_0x9f4d('0x38')]=qs[_0x9f4d('0x39')](_[_0x9f4d('0x3a')](_0xcb0f45['query'],_0x3db96a[_0x9f4d('0x39')]));if(_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x3b')]){_0xa8df5b[_0x9f4d('0x38')]=_[_0x9f4d('0x3c')](_0xa8df5b[_0x9f4d('0x38')],{'$or':_[_0x9f4d('0x2f')](_0x21ab4d,function(_0x439a3b){if(_0x439a3b[_0x9f4d('0x3d')]!==_0x9f4d('0x3e')){var _0x265306={};_0x265306[_0x439a3b[_0x9f4d('0x29')]]={'$like':'%'+_0xcb0f45['query'][_0x9f4d('0x3b')]+'%'};return _0x265306;}})});}_0xa8df5b=_[_0x9f4d('0x3c')]({},_0xa8df5b,_0xcb0f45[_0x9f4d('0x3f')]);var _0x3d34e1={'where':_0xa8df5b[_0x9f4d('0x38')]};return db[_0x9f4d('0x40')]['count'](_0x3d34e1)[_0x9f4d('0x25')](function(_0x4a2ba0){_0x3f27d7[_0x9f4d('0x1d')]=_0x4a2ba0;if(_0xcb0f45['query'][_0x9f4d('0x41')]){_0xa8df5b[_0x9f4d('0x42')]=[{'all':!![]}];}return db[_0x9f4d('0x40')][_0x9f4d('0x43')](_0xa8df5b);})['then'](function(_0x40fd6b){_0x3f27d7[_0x9f4d('0x44')]=_0x40fd6b;return _0x3f27d7;})[_0x9f4d('0x25')](respondWithFilteredResult(_0x111a87,_0xa8df5b))[_0x9f4d('0x45')](handleError(_0x111a87,null));};exports['show']=function(_0x2ef122,_0x25d630){var _0x1f651e={'raw':!![],'where':{'id':_0x2ef122[_0x9f4d('0x46')]['id']}},_0x48767d={};_0x48767d[_0x9f4d('0x2e')]=_[_0x9f4d('0x47')](db['FaxApplication'][_0x9f4d('0x2b')]);_0x48767d[_0x9f4d('0x30')]=_[_0x9f4d('0x47')](_0x2ef122[_0x9f4d('0x30')]);_0x48767d[_0x9f4d('0x39')]=_[_0x9f4d('0x32')](_0x48767d[_0x9f4d('0x2e')],_0x48767d[_0x9f4d('0x30')]);_0x1f651e[_0x9f4d('0x31')]=_[_0x9f4d('0x32')](_0x48767d['model'],qs[_0x9f4d('0x33')](_0x2ef122[_0x9f4d('0x30')][_0x9f4d('0x33')]));_0x1f651e[_0x9f4d('0x31')]=_0x1f651e[_0x9f4d('0x31')]['length']?_0x1f651e[_0x9f4d('0x31')]:_0x48767d[_0x9f4d('0x2e')];if(_0x2ef122[_0x9f4d('0x30')][_0x9f4d('0x41')]){_0x1f651e[_0x9f4d('0x42')]=[{'all':!![]}];}_0x1f651e=_['merge']({},_0x1f651e,_0x2ef122[_0x9f4d('0x3f')]);return db[_0x9f4d('0x40')][_0x9f4d('0x48')](_0x1f651e)[_0x9f4d('0x25')](handleEntityNotFound(_0x25d630,null))[_0x9f4d('0x25')](respondWithResult(_0x25d630,null))['catch'](handleError(_0x25d630,null));};exports[_0x9f4d('0x49')]=function(_0x242848,_0x212278){return db[_0x9f4d('0x40')]['create'](_0x242848[_0x9f4d('0x4a')],{})['then'](respondWithResult(_0x212278,0xc9))[_0x9f4d('0x45')](handleError(_0x212278,null));};exports[_0x9f4d('0x24')]=function(_0x16641a,_0x516753){if(_0x16641a[_0x9f4d('0x4a')]['id']){delete _0x16641a['body']['id'];}return db['FaxApplication'][_0x9f4d('0x48')]({'where':{'id':_0x16641a[_0x9f4d('0x46')]['id']}})['then'](handleEntityNotFound(_0x516753,null))[_0x9f4d('0x25')](saveUpdates(_0x16641a[_0x9f4d('0x4a')],null))[_0x9f4d('0x25')](respondWithResult(_0x516753,null))['catch'](handleError(_0x516753,null));};exports[_0x9f4d('0x26')]=function(_0x562193,_0x139922){return db[_0x9f4d('0x40')][_0x9f4d('0x48')]({'where':{'id':_0x562193['params']['id']}})['then'](handleEntityNotFound(_0x139922,null))[_0x9f4d('0x25')](removeEntity(_0x139922,null))[_0x9f4d('0x45')](handleError(_0x139922,null));}; \ No newline at end of file +var _0xa7dc=['util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','index','FaxApplication','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x540dcb,_0x4eacb6){var _0x49353c=function(_0x449bb1){while(--_0x449bb1){_0x540dcb['push'](_0x540dcb['shift']());}};_0x49353c(++_0x4eacb6);}(_0xa7dc,0x11d));var _0xca7d=function(_0x1f0fd7,_0x5b7259){_0x1f0fd7=_0x1f0fd7-0x0;var _0x29cb20=_0xa7dc[_0x1f0fd7];return _0x29cb20;};'use strict';var pdf=require(_0xca7d('0x0'));var emlformat=require(_0xca7d('0x1'));var rimraf=require(_0xca7d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca7d('0x3'));var rp=require('request-promise');var moment=require(_0xca7d('0x4'));var BPromise=require(_0xca7d('0x5'));var Mustache=require(_0xca7d('0x6'));var util=require(_0xca7d('0x7'));var path=require(_0xca7d('0x8'));var sox=require(_0xca7d('0x9'));var csv=require(_0xca7d('0xa'));var ejs=require(_0xca7d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca7d('0xc'));var crypto=require(_0xca7d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xca7d('0xe'));var toCsv=require(_0xca7d('0xa'));var querystring=require(_0xca7d('0xf'));var Papa=require('papaparse');var Redis=require(_0xca7d('0x10'));var authService=require(_0xca7d('0x11'));var qs=require(_0xca7d('0x12'));var as=require(_0xca7d('0x13'));var hardwareService=require(_0xca7d('0x14'));var logger=require('../../config/logger')(_0xca7d('0x15'));var utils=require('../../config/utils');var config=require(_0xca7d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15c48f,_0x1d93d7){_0x1d93d7=_0x1d93d7||0xcc;return function(_0x3b8467){if(_0x3b8467){return _0x15c48f[_0xca7d('0x17')](_0x1d93d7);}return _0x15c48f['status'](_0x1d93d7)['end']();};}function respondWithResult(_0x5c045e,_0x3ed8ec){_0x3ed8ec=_0x3ed8ec||0xc8;return function(_0x36f922){if(_0x36f922){return _0x5c045e[_0xca7d('0x18')](_0x3ed8ec)[_0xca7d('0x19')](_0x36f922);}};}function respondWithFilteredResult(_0x43992f,_0x1fc20b){return function(_0x369923){if(_0x369923){var _0x37bae3=_0x369923[_0xca7d('0x1a')],_0x254305=_0x1fc20b['offset'],_0x1a6cb7=_0x1fc20b['offset']+_0x1fc20b[_0xca7d('0x1b')],_0x2f6e8a;if(_0x1a6cb7>=_0x37bae3){_0x1a6cb7=_0x37bae3;_0x2f6e8a=0xc8;}else{_0x2f6e8a=0xce;}_0x43992f[_0xca7d('0x18')](_0x2f6e8a);return _0x43992f[_0xca7d('0x1c')](_0xca7d('0x1d'),_0x254305+'-'+_0x1a6cb7+'/'+_0x37bae3)[_0xca7d('0x19')](_0x369923);}return null;};}function patchUpdates(_0x4d6f22){return function(_0x5431c7){try{jsonpatch[_0xca7d('0x1e')](_0x5431c7,_0x4d6f22,!![]);}catch(_0x4cb0d8){return BPromise[_0xca7d('0x1f')](_0x4cb0d8);}return _0x5431c7[_0xca7d('0x20')]();};}function saveUpdates(_0x5f06c5,_0x3e3e8d){return function(_0x5c106e){if(_0x5c106e){return _0x5c106e['update'](_0x5f06c5)[_0xca7d('0x21')](function(_0x38a488){return _0x38a488;});}return null;};}function removeEntity(_0x1c8723,_0x2fcf0b){return function(_0x5d049b){if(_0x5d049b){return _0x5d049b[_0xca7d('0x22')]()[_0xca7d('0x21')](function(){_0x1c8723[_0xca7d('0x18')](0xcc)[_0xca7d('0x23')]();});}};}function handleEntityNotFound(_0x79fc7d,_0x351c87){return function(_0xf4b873){if(!_0xf4b873){_0x79fc7d[_0xca7d('0x17')](0x194);}return _0xf4b873;};}function handleError(_0x56be0b,_0x1c9a38){_0x1c9a38=_0x1c9a38||0x1f4;return function(_0x59c71a){logger[_0xca7d('0x24')](_0x59c71a[_0xca7d('0x25')]);if(_0x59c71a[_0xca7d('0x26')]){delete _0x59c71a[_0xca7d('0x26')];}_0x56be0b[_0xca7d('0x18')](_0x1c9a38)[_0xca7d('0x27')](_0x59c71a);};}exports[_0xca7d('0x28')]=function(_0x162bf8,_0xb08cfd){var _0x254235={},_0x572423={},_0x445fad={'count':0x0,'rows':[]};var _0x36e725=_['map'](db[_0xca7d('0x29')]['rawAttributes'],function(_0x50c290){return{'name':_0x50c290[_0xca7d('0x2a')],'type':_0x50c290['type'][_0xca7d('0x2b')]};});_0x572423[_0xca7d('0x2c')]=_[_0xca7d('0x2d')](_0x36e725,_0xca7d('0x26'));_0x572423[_0xca7d('0x2e')]=_[_0xca7d('0x2f')](_0x162bf8['query']);_0x572423[_0xca7d('0x30')]=_[_0xca7d('0x31')](_0x572423[_0xca7d('0x2c')],_0x572423['query']);_0x254235[_0xca7d('0x32')]=_[_0xca7d('0x31')](_0x572423[_0xca7d('0x2c')],qs[_0xca7d('0x33')](_0x162bf8[_0xca7d('0x2e')][_0xca7d('0x33')]));_0x254235[_0xca7d('0x32')]=_0x254235[_0xca7d('0x32')]['length']?_0x254235['attributes']:_0x572423[_0xca7d('0x2c')];if(!_0x162bf8[_0xca7d('0x2e')][_0xca7d('0x34')](_0xca7d('0x35'))){_0x254235['limit']=qs['limit'](_0x162bf8[_0xca7d('0x2e')]['limit']);_0x254235['offset']=qs['offset'](_0x162bf8[_0xca7d('0x2e')]['offset']);}_0x254235[_0xca7d('0x36')]=qs[_0xca7d('0x37')](_0x162bf8[_0xca7d('0x2e')]['sort']);_0x254235[_0xca7d('0x38')]=qs[_0xca7d('0x30')](_[_0xca7d('0x39')](_0x162bf8['query'],_0x572423[_0xca7d('0x30')]));if(_0x162bf8[_0xca7d('0x2e')]['filter']){_0x254235[_0xca7d('0x38')]=_['merge'](_0x254235[_0xca7d('0x38')],{'$or':_['map'](_0x36e725,function(_0x4d2d29){if(_0x4d2d29[_0xca7d('0x3a')]!==_0xca7d('0x3b')){var _0x47032f={};_0x47032f[_0x4d2d29['name']]={'$like':'%'+_0x162bf8[_0xca7d('0x2e')][_0xca7d('0x3c')]+'%'};return _0x47032f;}})});}_0x254235=_[_0xca7d('0x3d')]({},_0x254235,_0x162bf8[_0xca7d('0x3e')]);var _0x30916c={'where':_0x254235[_0xca7d('0x38')]};return db[_0xca7d('0x29')]['count'](_0x30916c)['then'](function(_0x4ef772){_0x445fad[_0xca7d('0x1a')]=_0x4ef772;if(_0x162bf8['query'][_0xca7d('0x3f')]){_0x254235['include']=[{'all':!![]}];}return db[_0xca7d('0x29')]['findAll'](_0x254235);})[_0xca7d('0x21')](function(_0x5856eb){_0x445fad[_0xca7d('0x40')]=_0x5856eb;return _0x445fad;})[_0xca7d('0x21')](respondWithFilteredResult(_0xb08cfd,_0x254235))[_0xca7d('0x41')](handleError(_0xb08cfd,null));};exports[_0xca7d('0x42')]=function(_0x52c4c7,_0x4d6d03){var _0x30d97c={'raw':!![],'where':{'id':_0x52c4c7[_0xca7d('0x43')]['id']}},_0x500951={};_0x500951[_0xca7d('0x2c')]=_[_0xca7d('0x2f')](db[_0xca7d('0x29')][_0xca7d('0x44')]);_0x500951[_0xca7d('0x2e')]=_[_0xca7d('0x2f')](_0x52c4c7['query']);_0x500951[_0xca7d('0x30')]=_['intersection'](_0x500951[_0xca7d('0x2c')],_0x500951['query']);_0x30d97c[_0xca7d('0x32')]=_['intersection'](_0x500951[_0xca7d('0x2c')],qs['fields'](_0x52c4c7['query'][_0xca7d('0x33')]));_0x30d97c['attributes']=_0x30d97c[_0xca7d('0x32')]['length']?_0x30d97c[_0xca7d('0x32')]:_0x500951['model'];if(_0x52c4c7['query'][_0xca7d('0x3f')]){_0x30d97c[_0xca7d('0x45')]=[{'all':!![]}];}_0x30d97c=_['merge']({},_0x30d97c,_0x52c4c7['options']);return db[_0xca7d('0x29')][_0xca7d('0x46')](_0x30d97c)['then'](handleEntityNotFound(_0x4d6d03,null))['then'](respondWithResult(_0x4d6d03,null))['catch'](handleError(_0x4d6d03,null));};exports[_0xca7d('0x47')]=function(_0x4c2ec1,_0x1b6315){return db[_0xca7d('0x29')]['create'](_0x4c2ec1[_0xca7d('0x48')],{})[_0xca7d('0x21')](respondWithResult(_0x1b6315,0xc9))[_0xca7d('0x41')](handleError(_0x1b6315,null));};exports['update']=function(_0x420693,_0x8023a7){if(_0x420693[_0xca7d('0x48')]['id']){delete _0x420693[_0xca7d('0x48')]['id'];}return db[_0xca7d('0x29')][_0xca7d('0x46')]({'where':{'id':_0x420693[_0xca7d('0x43')]['id']}})[_0xca7d('0x21')](handleEntityNotFound(_0x8023a7,null))[_0xca7d('0x21')](saveUpdates(_0x420693[_0xca7d('0x48')],null))[_0xca7d('0x21')](respondWithResult(_0x8023a7,null))['catch'](handleError(_0x8023a7,null));};exports['destroy']=function(_0x348a71,_0x243835){return db['FaxApplication'][_0xca7d('0x46')]({'where':{'id':_0x348a71[_0xca7d('0x43')]['id']}})['then'](handleEntityNotFound(_0x243835,null))[_0xca7d('0x21')](removeEntity(_0x243835,null))[_0xca7d('0x41')](handleError(_0x243835,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 05fa92e..6bbc3f5 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 _0xd09d=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1c7ea2,_0x3ba30f){var _0x504b41=function(_0x6b9364){while(--_0x6b9364){_0x1c7ea2['push'](_0x1c7ea2['shift']());}};_0x504b41(++_0x3ba30f);}(_0xd09d,0x1d4));var _0xdd09=function(_0x41db4f,_0x5ad658){_0x41db4f=_0x41db4f-0x0;var _0x98ecba=_0xd09d[_0x41db4f];return _0x98ecba;};'use strict';var _=require(_0xdd09('0x0'));var util=require(_0xdd09('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdd09('0x2'));var BPromise=require(_0xdd09('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd09('0x4'));var rimraf=require(_0xdd09('0x5'));var config=require(_0xdd09('0x6'));var attributes=require(_0xdd09('0x7'));module[_0xdd09('0x8')]=function(_0x5985b4,_0x4fe872){return _0x5985b4[_0xdd09('0x9')]('FaxApplication',attributes,{'tableName':_0xdd09('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd09('0xb'),'collate':_0xdd09('0xc')});}; \ No newline at end of file +var _0xe272=['FaxApplication','fax_applications','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0x5e3415,_0x14a028){var _0x39a0b4=function(_0x598657){while(--_0x598657){_0x5e3415['push'](_0x5e3415['shift']());}};_0x39a0b4(++_0x14a028);}(_0xe272,0x19c));var _0x2e27=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xe272[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x2e27('0x0'));var util=require('util');var logger=require(_0x2e27('0x1'))(_0x2e27('0x2'));var moment=require(_0x2e27('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e27('0x4'));var rimraf=require(_0x2e27('0x5'));var config=require(_0x2e27('0x6'));var attributes=require(_0x2e27('0x7'));module['exports']=function(_0x2a4d9f,_0x1c5b70){return _0x2a4d9f['define'](_0x2e27('0x8'),attributes,{'tableName':_0x2e27('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 74a55b8..849622c 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 _0x4a01=['attributes','limit','then','stringify','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','update','body','options','raw'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4a01,0x16c));var _0x14a0=function(_0xdfa105,_0x5f29ed){_0xdfa105=_0xdfa105-0x0;var _0x3faf0d=_0x4a01[_0xdfa105];return _0x3faf0d;};'use strict';var _=require('lodash');var util=require(_0x14a0('0x0'));var moment=require(_0x14a0('0x1'));var BPromise=require(_0x14a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x14a0('0x4'))(_0x14a0('0x5'));var config=require(_0x14a0('0x6'));var jayson=require(_0x14a0('0x7'));var client=jayson[_0x14a0('0x8')][_0x14a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x918223,_0x518711,_0x146e66){return new BPromise(function(_0x34ce97,_0x272006){return client[_0x14a0('0xa')](_0x918223,_0x146e66)['then'](function(_0xbc0a03){logger[_0x14a0('0xb')]('FaxApplication,\x20%s,\x20%s',_0x518711,_0x14a0('0xc'));logger[_0x14a0('0xd')](_0x14a0('0xe'),_0x518711,_0x14a0('0xc'),JSON['stringify'](_0xbc0a03));if(_0xbc0a03['error']){if(_0xbc0a03[_0x14a0('0xf')][_0x14a0('0x10')]===0x1f4){logger[_0x14a0('0xf')](_0x14a0('0x11'),_0x518711,_0xbc0a03[_0x14a0('0xf')][_0x14a0('0x12')]);return _0x272006(_0xbc0a03[_0x14a0('0xf')][_0x14a0('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x518711,_0xbc0a03['error'][_0x14a0('0x12')]);return _0x34ce97(_0xbc0a03[_0x14a0('0xf')]['message']);}else{logger[_0x14a0('0xb')]('FaxApplication,\x20%s,\x20%s',_0x518711,'request\x20sent');_0x34ce97(_0xbc0a03[_0x14a0('0x13')][_0x14a0('0x12')]);}})[_0x14a0('0x14')](function(_0x3a3b3b){logger['error'](_0x14a0('0x11'),_0x518711,_0x3a3b3b);_0x272006(_0x3a3b3b);});});}exports[_0x14a0('0x15')]=function(_0x380e53){var _0x2f6c8f=this;return new Promise(function(_0x32befb,_0x23ab4d){return db['FaxApplication'][_0x14a0('0x16')](_0x380e53[_0x14a0('0x17')],{'raw':_0x380e53[_0x14a0('0x18')]?_0x380e53[_0x14a0('0x18')][_0x14a0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x380e53[_0x14a0('0x18')]?_0x380e53[_0x14a0('0x18')]['where']||null:null,'attributes':_0x380e53[_0x14a0('0x18')]?_0x380e53['options'][_0x14a0('0x1a')]||null:null,'limit':_0x380e53[_0x14a0('0x18')]?_0x380e53[_0x14a0('0x18')][_0x14a0('0x1b')]||null:null})[_0x14a0('0x1c')](function(_0x5cc989){logger[_0x14a0('0xb')](_0x14a0('0x15'),_0x380e53);logger[_0x14a0('0xd')](_0x14a0('0x15'),_0x380e53,JSON[_0x14a0('0x1d')](_0x5cc989));_0x32befb(_0x5cc989);})['catch'](function(_0x127fa9){logger[_0x14a0('0xf')](_0x14a0('0x15'),_0x127fa9['message'],_0x380e53);_0x23ab4d(_0x2f6c8f['error'](0x1f4,_0x127fa9[_0x14a0('0x12')]));});});}; \ No newline at end of file +var _0xe6b0=['info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','FaxApplication,\x20%s,\x20%s','result','catch','UpdateFaxApplication','update','body','options','raw','where','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe6b0,0xf1));var _0x0e6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6b0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0e6b('0x0'));var moment=require(_0x0e6b('0x1'));var BPromise=require(_0x0e6b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e6b('0x3'));var db=require(_0x0e6b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0e6b('0x5'));var config=require(_0x0e6b('0x6'));var jayson=require(_0x0e6b('0x7'));var client=jayson['client'][_0x0e6b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x18e7b8,_0xd507a9,_0x2d0431){return new BPromise(function(_0x365bbe,_0x2b3ffe){return client[_0x0e6b('0x9')](_0x18e7b8,_0x2d0431)[_0x0e6b('0xa')](function(_0xb3e479){logger[_0x0e6b('0xb')]('FaxApplication,\x20%s,\x20%s',_0xd507a9,'request\x20sent');logger[_0x0e6b('0xc')](_0x0e6b('0xd'),_0xd507a9,_0x0e6b('0xe'),JSON[_0x0e6b('0xf')](_0xb3e479));if(_0xb3e479[_0x0e6b('0x10')]){if(_0xb3e479[_0x0e6b('0x10')][_0x0e6b('0x11')]===0x1f4){logger[_0x0e6b('0x10')]('FaxApplication,\x20%s,\x20%s',_0xd507a9,_0xb3e479[_0x0e6b('0x10')][_0x0e6b('0x12')]);return _0x2b3ffe(_0xb3e479[_0x0e6b('0x10')][_0x0e6b('0x12')]);}logger[_0x0e6b('0x10')](_0x0e6b('0x13'),_0xd507a9,_0xb3e479[_0x0e6b('0x10')]['message']);return _0x365bbe(_0xb3e479['error'][_0x0e6b('0x12')]);}else{logger['info'](_0x0e6b('0x13'),_0xd507a9,_0x0e6b('0xe'));_0x365bbe(_0xb3e479[_0x0e6b('0x14')][_0x0e6b('0x12')]);}})[_0x0e6b('0x15')](function(_0x3df797){logger[_0x0e6b('0x10')](_0x0e6b('0x13'),_0xd507a9,_0x3df797);_0x2b3ffe(_0x3df797);});});}exports[_0x0e6b('0x16')]=function(_0x4f382d){var _0x3a065f=this;return new Promise(function(_0xef3194,_0x16f7da){return db['FaxApplication'][_0x0e6b('0x17')](_0x4f382d[_0x0e6b('0x18')],{'raw':_0x4f382d[_0x0e6b('0x19')]?_0x4f382d[_0x0e6b('0x19')][_0x0e6b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f382d['options']?_0x4f382d[_0x0e6b('0x19')][_0x0e6b('0x1b')]||null:null,'attributes':_0x4f382d['options']?_0x4f382d['options']['attributes']||null:null,'limit':_0x4f382d['options']?_0x4f382d[_0x0e6b('0x19')]['limit']||null:null})[_0x0e6b('0xa')](function(_0x52e5ea){logger[_0x0e6b('0xb')]('UpdateFaxApplication',_0x4f382d);logger['debug'](_0x0e6b('0x16'),_0x4f382d,JSON[_0x0e6b('0xf')](_0x52e5ea));_0xef3194(_0x52e5ea);})[_0x0e6b('0x15')](function(_0x412b12){logger[_0x0e6b('0x10')](_0x0e6b('0x16'),_0x412b12['message'],_0x4f382d);_0x16f7da(_0x3a065f[_0x0e6b('0x10')](0x1f4,_0x412b12[_0x0e6b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 3a4a863..0256715 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 _0x9c5a=['isAuthenticated','get','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x52c729,_0x37df19){_0x52c729=_0x52c729-0x0;var _0x50f4c7=_0x9c5a[_0x52c729];return _0x50f4c7;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0xb')]('/',auth[_0xa9c5('0x8')](),controller['create']);router[_0xa9c5('0xc')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller[_0xa9c5('0xd')]);router[_0xa9c5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0xf')]);module[_0xa9c5('0x10')]=router; \ No newline at end of file +var _0x7fbe=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0x995c5b,_0x5485b3){var _0x2ade0a=function(_0x59bbbf){while(--_0x59bbbf){_0x995c5b['push'](_0x995c5b['shift']());}};_0x2ade0a(++_0x5485b3);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4a705c,_0x5196c3){_0x4a705c=_0x4a705c-0x0;var _0x3e1195=_0x7fbe[_0x4a705c];return _0x3e1195;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7fb('0x0'));var timeout=require(_0xe7fb('0x1'));var express=require(_0xe7fb('0x2'));var router=express[_0xe7fb('0x3')]();var auth=require(_0xe7fb('0x4'));var interaction=require(_0xe7fb('0x5'));var config=require(_0xe7fb('0x6'));var controller=require(_0xe7fb('0x7'));router[_0xe7fb('0x8')]('/',auth[_0xe7fb('0x9')](),controller[_0xe7fb('0xa')]);router[_0xe7fb('0x8')](_0xe7fb('0xb'),auth[_0xe7fb('0x9')](),controller['show']);router[_0xe7fb('0xc')]('/',auth[_0xe7fb('0x9')](),controller[_0xe7fb('0xd')]);router[_0xe7fb('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xb'),auth[_0xe7fb('0x9')](),controller[_0xe7fb('0x11')]);module[_0xe7fb('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 565c92e..bfad619 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 _0xed51=['exports','STRING','DATE','ENUM','out','sequelize'];(function(_0x3dd721,_0x4a6266){var _0x2842d5=function(_0x4267fd){while(--_0x4267fd){_0x3dd721['push'](_0x3dd721['shift']());}};_0x2842d5(++_0x4a6266);}(_0xed51,0x167));var _0x1ed5=function(_0x1bcb84,_0x2d5877){_0x1bcb84=_0x1bcb84-0x0;var _0x5e9844=_0xed51[_0x1bcb84];return _0x5e9844;};'use strict';var Sequelize=require(_0x1ed5('0x0'));module[_0x1ed5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1ed5('0x2')]},'read1stAt':{'type':Sequelize[_0x1ed5('0x3')]},'fax':{'type':Sequelize[_0x1ed5('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1ed5('0x4')]('in',_0x1ed5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1ed5('0x4')]('in',_0x1ed5('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x1b45=['BOOLEAN','STRING','DATE','ENUM','out','exports'];(function(_0x19318e,_0x46c067){var _0x425540=function(_0xb4e055){while(--_0xb4e055){_0x19318e['push'](_0x19318e['shift']());}};_0x425540(++_0x46c067);}(_0x1b45,0x125));var _0x51b4=function(_0x4808d3,_0x3353c6){_0x4808d3=_0x4808d3-0x0;var _0x3057fa=_0x1b45[_0x4808d3];return _0x3057fa;};'use strict';var Sequelize=require('sequelize');module[_0x51b4('0x0')]={'closed':{'type':Sequelize[_0x51b4('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x51b4('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x51b4('0x3')]},'fax':{'type':Sequelize[_0x51b4('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x51b4('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x51b4('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x51b4('0x4')]('in',_0x51b4('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 46f5526..168c582 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 _0x0d2a=['FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','fullname','TagIds','Tags','split','forEach','catch','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','FaxAccountId','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','rows','show','include','options','create','describe','addMessage','FaxMessage','params','ids','omit','getMessages','findOne'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x0d2a,0x1c9));var _0xa0d2=function(_0x2ace98,_0x540458){_0x2ace98=_0x2ace98-0x0;var _0x56a00c=_0x0d2a[_0x2ace98];return _0x56a00c;};'use strict';var pdf=require(_0xa0d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa0d2('0x1'));var zipdir=require(_0xa0d2('0x2'));var jsonpatch=require(_0xa0d2('0x3'));var rp=require(_0xa0d2('0x4'));var moment=require(_0xa0d2('0x5'));var BPromise=require(_0xa0d2('0x6'));var Mustache=require(_0xa0d2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa0d2('0x8'));var csv=require(_0xa0d2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0d2('0xa'));var jsforce=require(_0xa0d2('0xb'));var deskjs=require(_0xa0d2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa0d2('0xd'));var authService=require(_0xa0d2('0xe'));var qs=require(_0xa0d2('0xf'));var as=require(_0xa0d2('0x10'));var hardwareService=require(_0xa0d2('0x11'));var logger=require(_0xa0d2('0x12'))('api');var utils=require(_0xa0d2('0x13'));var config=require(_0xa0d2('0x14'));var db=require(_0xa0d2('0x15'))['db'];config[_0xa0d2('0x16')]=_[_0xa0d2('0x17')](config[_0xa0d2('0x16')],{'host':_0xa0d2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0d2('0x16')]));require(_0xa0d2('0x19'))[_0xa0d2('0x1a')](socket);function respondWithStatusCode(_0x181633,_0x50d8a4){_0x50d8a4=_0x50d8a4||0xcc;return function(_0x291056){if(_0x291056){return _0x181633[_0xa0d2('0x1b')](_0x50d8a4);}return _0x181633[_0xa0d2('0x1c')](_0x50d8a4)[_0xa0d2('0x1d')]();};}function respondWithResult(_0x29a8a9,_0x477b92){_0x477b92=_0x477b92||0xc8;return function(_0x5f18a1){if(_0x5f18a1){return _0x29a8a9['status'](_0x477b92)[_0xa0d2('0x1e')](_0x5f18a1);}};}function respondWithFilteredResult(_0x114dc6,_0x435c76){return function(_0x10eb3e){if(_0x10eb3e){var _0x227932=_0x10eb3e[_0xa0d2('0x1f')],_0x5bdb54=_0x435c76['offset'],_0x5bb3c4=_0x435c76[_0xa0d2('0x20')]+_0x435c76[_0xa0d2('0x21')],_0xef25f9;if(_0x5bb3c4>=_0x227932){_0x5bb3c4=_0x227932;_0xef25f9=0xc8;}else{_0xef25f9=0xce;}_0x114dc6[_0xa0d2('0x1c')](_0xef25f9);return _0x114dc6['set'](_0xa0d2('0x22'),_0x5bdb54+'-'+_0x5bb3c4+'/'+_0x227932)['json'](_0x10eb3e);}return null;};}function patchUpdates(_0x56ad32){return function(_0xaabb9e){try{jsonpatch[_0xa0d2('0x23')](_0xaabb9e,_0x56ad32,!![]);}catch(_0x55fc38){return BPromise[_0xa0d2('0x24')](_0x55fc38);}return _0xaabb9e[_0xa0d2('0x25')]();};}function saveUpdates(_0x538ae6,_0x3e450b){return function(_0x41ad29){if(_0x41ad29){return _0x41ad29[_0xa0d2('0x26')](_0x538ae6)[_0xa0d2('0x27')](function(_0x766cf2){return _0x766cf2;});}return null;};}function removeEntity(_0x22d1d2,_0x465ab4){return function(_0x1d76eb){if(_0x1d76eb){return _0x1d76eb[_0xa0d2('0x28')]()[_0xa0d2('0x27')](function(){_0x22d1d2[_0xa0d2('0x1c')](0xcc)[_0xa0d2('0x1d')]();});}};}function handleEntityNotFound(_0x374b8f,_0x2425bf){return function(_0x428e56){if(!_0x428e56){_0x374b8f[_0xa0d2('0x1b')](0x194);}return _0x428e56;};}function handleError(_0x135f03,_0x28ba6e){_0x28ba6e=_0x28ba6e||0x1f4;return function(_0x3404a5){logger['error'](_0x3404a5[_0xa0d2('0x29')]);if(_0x3404a5['name']){delete _0x3404a5[_0xa0d2('0x2a')];}_0x135f03[_0xa0d2('0x1c')](_0x28ba6e)['send'](_0x3404a5);};}function getInteractionUsers(_0x3a8654,_0x799a02){return new BPromise(function(_0x3db3dc,_0x4339a8){try{if(_0x799a02[_0x3a8654['id']]){_0x3a8654['Users']=_[_0xa0d2('0x2b')](_0x799a02[_0x3a8654['id']],function(_0x4865ec){return{'id':_0x4865ec['id'],'fullname':_0x4865ec[_0xa0d2('0x2c')]};});}}catch(_0x41fa08){_0x4339a8(_0x41fa08);}_0x3db3dc(_0x3a8654);});}function getInteractionTags(_0x1ea6e3,_0x13565a){return new BPromise(function(_0x20901a,_0x264963){try{if(_0x1ea6e3[_0xa0d2('0x2d')]){_0x1ea6e3[_0xa0d2('0x2e')]=[];_0x1ea6e3['TagIds'][_0xa0d2('0x2f')](',')[_0xa0d2('0x30')](function(_0x13eb1){_0x1ea6e3[_0xa0d2('0x2e')]['push'](_0x13565a[_0x13eb1]);});}delete _0x1ea6e3[_0xa0d2('0x2d')];}catch(_0x595314){_0x264963(_0x595314);}_0x20901a(_0x1ea6e3);});}function updateFaxInteraction(_0x544205,_0x25cb74,_0x38fe97){return new BPromise(function(_0x507350,_0x5f088b){return getInteractionUsers(_0x544205,_0x38fe97)[_0xa0d2('0x27')](function(_0xc61470){return getInteractionTags(_0xc61470,_0x25cb74);})[_0xa0d2('0x27')](function(_0x334202){_0x507350(_0x334202);})[_0xa0d2('0x31')](function(_0x2bd9bf){_0x5f088b(_0x2bd9bf);});});}exports['index']=function(_0x35d8d2,_0x3a608f){var _0x118f03={},_0x681947={},_0x4961ea={'count':0x0,'rows':[]};var _0x3ccf57=_[_0xa0d2('0x2b')](db[_0xa0d2('0x32')][_0xa0d2('0x33')],function(_0x4b11bc){return{'name':_0x4b11bc[_0xa0d2('0x34')],'type':_0x4b11bc[_0xa0d2('0x35')][_0xa0d2('0x36')]};});_0x681947[_0xa0d2('0x37')]=_['map'](_0x3ccf57,_0xa0d2('0x2a'));_0x681947[_0xa0d2('0x38')]=_[_0xa0d2('0x39')](_0x35d8d2[_0xa0d2('0x38')]);_0x681947[_0xa0d2('0x3a')]=_[_0xa0d2('0x3b')](_0x681947[_0xa0d2('0x37')],_0x681947[_0xa0d2('0x38')]);_0x118f03['attributes']=_['intersection'](_0x681947[_0xa0d2('0x37')],qs[_0xa0d2('0x3c')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x3c')]));_0x118f03[_0xa0d2('0x3d')]=_0x118f03[_0xa0d2('0x3d')]['length']?_0x118f03[_0xa0d2('0x3d')]:_0x681947[_0xa0d2('0x37')];if(!_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x3e')](_0xa0d2('0x3f'))){_0x118f03['limit']=qs[_0xa0d2('0x21')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x21')]);_0x118f03[_0xa0d2('0x20')]=qs['offset'](_0x35d8d2[_0xa0d2('0x38')]['offset']);}_0x118f03[_0xa0d2('0x40')]=qs[_0xa0d2('0x41')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x41')]);_0x118f03[_0xa0d2('0x42')]=qs[_0xa0d2('0x3a')](_[_0xa0d2('0x43')](_0x35d8d2['query'],_0x681947[_0xa0d2('0x3a')]));var _0x33a1a5=[];var _0x53d44a=squel[_0xa0d2('0x44')]()[_0xa0d2('0x45')]('id')['field']('name')[_0xa0d2('0x45')]('color')[_0xa0d2('0x46')](_0xa0d2('0x47'));var _0x4ce441=squel[_0xa0d2('0x44')]()[_0xa0d2('0x45')]('u.id')[_0xa0d2('0x45')](_0xa0d2('0x48'))[_0xa0d2('0x45')](_0xa0d2('0x49'))['from']('user_has_fax_interactions','ui')[_0xa0d2('0x4a')]('users','u',_0xa0d2('0x4b'));var _0x237d57=squel[_0xa0d2('0x44')]()['from'](_0xa0d2('0x4c'),'i')[_0xa0d2('0x4a')]('cm_contacts','c',_0xa0d2('0x4d'))[_0xa0d2('0x4a')]('users','o',_0xa0d2('0x4e'))[_0xa0d2('0x4a')](_0xa0d2('0x4f'),'a','a.id\x20=\x20i.FaxAccountId')[_0xa0d2('0x4a')](_0xa0d2('0x50'),'me',_0xa0d2('0x51'))[_0xa0d2('0x4a')](_0xa0d2('0x52'),'it',_0xa0d2('0x53'))[_0xa0d2('0x4a')](_0xa0d2('0x47'),'t',_0xa0d2('0x54'));var _0x1a21d3=squel[_0xa0d2('0x55')]();var _0x3d0cb7=[];var _0x3ca2f3=squel[_0xa0d2('0x55')]();var _0x24ddcc;if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x56')]){_0x24ddcc=as[_0xa0d2('0x57')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x56')]);var _0x15ec89=_0x24ddcc[_0xa0d2('0x58')];for(var _0x5cdb4b=0x0;_0x5cdb4b<_0x24ddcc[_0xa0d2('0x59')][_0xa0d2('0x5a')];_0x5cdb4b++){var _0x3362ed=_0x24ddcc[_0xa0d2('0x59')][_0x5cdb4b];var _0x504da8='i';var _0x5ee851=_[_0xa0d2('0x5b')](_0x3ccf57,['name',_0x3362ed[_0xa0d2('0x45')]]);if(!_0x5ee851){switch(_0x3362ed[_0xa0d2('0x45')]){case _0xa0d2('0x5c'):if(_0x3362ed['value']==0x1){_0x237d57['having']('`'+_0x3362ed[_0xa0d2('0x45')]+'`\x20=\x200');}else{_0x237d57[_0xa0d2('0x5d')]('`'+_0x3362ed[_0xa0d2('0x45')]+'`\x20>\x200');}break;case _0xa0d2('0x5e'):if(_0x3362ed[_0xa0d2('0x5f')]===_0xa0d2('0x60')){if(_0x3362ed[_0xa0d2('0x61')][_0xa0d2('0x2f')]('\x20')[_0xa0d2('0x5a')]>0x1){_0x1a21d3[_0x15ec89]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0d2('0x62')](_0x3362ed['value']),null);}else{var _0x4adf82='%'+_0x3362ed[_0xa0d2('0x61')]+'%';_0x1a21d3[_0x15ec89](_0xa0d2('0x63'),_0x4adf82,_0x4adf82,_0x4adf82);}}else{_0x5ee851=_[_0xa0d2('0x5b')](_0x3ccf57,[_0xa0d2('0x2a'),_0xa0d2('0x64')]);_0x3362ed[_0xa0d2('0x45')]=_0xa0d2('0x64');_0x4d0ea3=as[_0xa0d2('0x65')](_0x504da8,_0x5ee851[_0xa0d2('0x35')],_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3[_0xa0d2('0x66')],_0x4d0ea3[_0xa0d2('0x61')]['start'],_0x4d0ea3[_0xa0d2('0x61')][_0xa0d2('0x1d')]);}break;case _0xa0d2('0x67'):var _0xde0d8f=_0x3362ed['value'][_0xa0d2('0x2f')](',')['map'](function(_0x4b06f1){return Number(_0x4b06f1);});_0xde0d8f[_0xa0d2('0x30')](function(_0x477f90){_0x3ca2f3['or'](_0xa0d2('0x68'),'%,'+_0x477f90+',%');});_0x3d0cb7=_[_0xa0d2('0x69')](_0x3d0cb7,_0xde0d8f);break;case'User':if(_0x3362ed[_0xa0d2('0x5f')]===_0xa0d2('0x60')){_0x1a21d3[_0x15ec89](_0xa0d2('0x6a'),'%'+_0x3362ed[_0xa0d2('0x61')]+'%',null);}else{_0x5ee851=_[_0xa0d2('0x5b')](_0x3ccf57,[_0xa0d2('0x2a'),_0xa0d2('0x6b')]);_0x3362ed[_0xa0d2('0x45')]=_0xa0d2('0x6b');_0x4d0ea3=as[_0xa0d2('0x65')](_0x504da8,_0x5ee851[_0xa0d2('0x35')],_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3['text'],_0x4d0ea3[_0xa0d2('0x61')][_0xa0d2('0x6c')],_0x4d0ea3['value']['end']);}break;case _0xa0d2('0x6d'):_0x4d0ea3=as[_0xa0d2('0x65')]('me',null,_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3['text'],_0x4d0ea3[_0xa0d2('0x61')]['start'],_0x4d0ea3['value'][_0xa0d2('0x1d')]);break;}}else{var _0x4d0ea3=as['buildExpression'](_0x504da8,_0x5ee851['type'],_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3[_0xa0d2('0x66')],_0x4d0ea3[_0xa0d2('0x61')]['start'],_0x4d0ea3['value'][_0xa0d2('0x1d')]);}}}else{var _0x1e500b=_(_0x35d8d2[_0xa0d2('0x38')])['keys']()[_0xa0d2('0x2b')](function(_0x51b234){return _[_0xa0d2('0x6e')](_0x3ccf57,[_0xa0d2('0x2a'),_0x51b234])?_0x51b234:undefined;})['compact']()[_0xa0d2('0x61')]();if(!_[_0xa0d2('0x6f')](_0x1e500b)){_0x1e500b[_0xa0d2('0x30')](function(_0x12905a){if(_0x12905a==='FaxAccountId'){_0x237d57[_0xa0d2('0x42')](_0xa0d2('0x70'),[][_0xa0d2('0x71')](_0x35d8d2[_0xa0d2('0x38')][_0x12905a]));}else if(_0x12905a===_0xa0d2('0x72')){var _0x4ecff5=JSON[_0xa0d2('0x73')](_0x35d8d2[_0xa0d2('0x38')][_0x12905a])[_0xa0d2('0x74')];var _0x52f6fd=JSON[_0xa0d2('0x73')](_0x35d8d2[_0xa0d2('0x38')][_0x12905a])['$lte'];_0x237d57[_0xa0d2('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4ecff5,_0x52f6fd);}else{if(_0x35d8d2[_0xa0d2('0x38')][_0x12905a]===_0xa0d2('0x75')){_0x237d57[_0xa0d2('0x42')]('i.'+_0x12905a+'\x20IS\x20NULL');}else{_0x237d57[_0xa0d2('0x42')]('i.'+_0x12905a+'\x20=\x20?',_0x35d8d2[_0xa0d2('0x38')][_0x12905a]);}}});}if(_0x35d8d2[_0xa0d2('0x38')]['read']){if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x76')]==0x1){_0x237d57[_0xa0d2('0x5d')](_0xa0d2('0x77'));}else{_0x237d57[_0xa0d2('0x5d')](_0xa0d2('0x78'));}}if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x79')]){_0x3d0cb7=_[_0xa0d2('0x7a')](_0x35d8d2[_0xa0d2('0x38')]['tag'])?_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x79')]:new Array(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x79')]);_0x3d0cb7[_0xa0d2('0x30')](function(_0x5d733b){_0x3ca2f3['or'](_0xa0d2('0x68'),'%,'+_0x5d733b+',%');});}if(_0x35d8d2[_0xa0d2('0x38')]['filter']){var _0x2c068d=_0x35d8d2['query'][_0xa0d2('0x7b')]['replace']('\x5c','\x5c\x5c')[_0xa0d2('0x7c')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x2c068d)){_0x1a21d3['or'](_0xa0d2('0x7d'),_0x2c068d+'%')['or'](_0xa0d2('0x7e'),_0x2c068d+'%');}_0x1a21d3['or'](_0xa0d2('0x7f'),_0x2c068d+'%');}}_0x237d57[_0xa0d2('0x42')](_0x1a21d3);_0x237d57[_0xa0d2('0x80')](_0xa0d2('0x81'));var _0x32c3ac={'type':db[_0xa0d2('0x82')][_0xa0d2('0x83')][_0xa0d2('0x84')],'raw':!![]};var _0x57e3f7=_0x237d57[_0xa0d2('0x85')]();_0x57e3f7[_0xa0d2('0x45')](_0xa0d2('0x81'));_0x57e3f7['field'](_0xa0d2('0x86'),_0xa0d2('0x5c'));if(_0x118f03[_0xa0d2('0x40')]){_0x118f03[_0xa0d2('0x40')]['forEach'](function(_0x507d03){_0x237d57[_0xa0d2('0x40')]('i.'+_0x507d03[0x0],_0x507d03[0x1]===_0xa0d2('0x87')?![]:!![]);});}if(!_['isEmpty'](_0x3d0cb7)){_0x237d57[_0xa0d2('0x5d')](_0x3ca2f3);_0x57e3f7[_0xa0d2('0x42')](_0xa0d2('0x88'),_0x3d0cb7);}BPromise['resolve']()[_0xa0d2('0x27')](function(){if(!_0x24ddcc&&_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x89')])return;return _0x35d8d2[_0xa0d2('0x8a')][_0xa0d2('0x8b')]({'attributes':['id'],'raw':!![]})[_0xa0d2('0x27')](function(_0x4fe444){if(_[_0xa0d2('0x6f')](_0x4fe444)){_0x57e3f7[_0xa0d2('0x42')](_0xa0d2('0x8c'));_0x237d57['where'](_0xa0d2('0x8c'));}else{_0x57e3f7[_0xa0d2('0x42')](_0xa0d2('0x70'),_[_0xa0d2('0x2b')](_0x4fe444,'id'));_0x237d57['where'](_0xa0d2('0x70'),_[_0xa0d2('0x2b')](_0x4fe444,'id'));}});})['then'](function(){db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x57e3f7['toString'](),_0x32c3ac)[_0xa0d2('0x27')](function(_0x43a414){_0x4961ea[_0xa0d2('0x1f')]=_0x43a414['length'];if(_0x4961ea[_0xa0d2('0x1f')]===0x0)return[];return db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x53d44a[_0xa0d2('0x8e')](),_0x32c3ac)['then'](function(_0x172464){_0x33a1a5=_[_0xa0d2('0x8f')](_0x172464,'id');_0x32c3ac=_[_0xa0d2('0x90')](_0x32c3ac,{'model':db[_0xa0d2('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x3c')]){_0x118f03['attributes']['forEach'](function(_0x5320b8){_0x237d57[_0xa0d2('0x45')]('i.'+_0x5320b8);});}else{_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x86'),'unreadMessages');_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x91'),_0xa0d2('0x92'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x93'),_0xa0d2('0x94'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x95'));_0x237d57['field'](_0xa0d2('0x96'),_0xa0d2('0x97'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x98'),'Contact.lastName');_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x99'),_0xa0d2('0x9a'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x9b'),_0xa0d2('0x9c'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x9d'),_0xa0d2('0x9e'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x9f'),'Contact.fax');_0x237d57[_0xa0d2('0x45')](_0xa0d2('0xa0'),_0xa0d2('0xa1'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0xa2'),_0xa0d2('0xa3'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0xa4'),'TagIds');}_0x237d57[_0xa0d2('0x21')](_0x118f03['limit']);_0x237d57['offset'](_0x118f03['offset']);return db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x237d57[_0xa0d2('0x8e')](),_0x32c3ac);})['then'](function(_0x5b8c2d){_0x4ce441[_0xa0d2('0x42')](_0xa0d2('0xa5'),_[_0xa0d2('0x2b')](_0x5b8c2d,'id'));return db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x4ce441['toString'](),_0x32c3ac)[_0xa0d2('0x27')](function(_0x506df6){var _0x3e92a4=_[_0xa0d2('0xa6')](_0x506df6,'FaxInteractionId');var _0x1fc919=[];_0x5b8c2d[_0xa0d2('0x30')](function(_0x50618b){_0x1fc919[_0xa0d2('0xa7')](updateFaxInteraction(_0x50618b,_0x33a1a5,_0x3e92a4));});return BPromise[_0xa0d2('0xa8')](_0x1fc919);});});})['then'](function(_0x98db73){_0x4961ea[_0xa0d2('0xa9')]=_0x98db73;return _0x4961ea;})[_0xa0d2('0x27')](respondWithFilteredResult(_0x3a608f,_0x118f03));})[_0xa0d2('0x31')](handleError(_0x3a608f,null));};exports[_0xa0d2('0xaa')]=function(_0x565b0e,_0x1af1bf){var _0x381896={'raw':![],'where':{'id':_0x565b0e['params']['id']}},_0x4834e2={};_0x4834e2[_0xa0d2('0x37')]=_[_0xa0d2('0x39')](db['FaxInteraction'][_0xa0d2('0x33')]);_0x4834e2[_0xa0d2('0x38')]=_[_0xa0d2('0x39')](_0x565b0e[_0xa0d2('0x38')]);_0x4834e2['filters']=_['intersection'](_0x4834e2['model'],_0x4834e2[_0xa0d2('0x38')]);_0x381896[_0xa0d2('0x3d')]=_[_0xa0d2('0x3b')](_0x4834e2[_0xa0d2('0x37')],qs[_0xa0d2('0x3c')](_0x565b0e[_0xa0d2('0x38')][_0xa0d2('0x3c')]));_0x381896[_0xa0d2('0x3d')]=_0x381896[_0xa0d2('0x3d')][_0xa0d2('0x5a')]?_0x381896[_0xa0d2('0x3d')]:_0x4834e2[_0xa0d2('0x37')];if(_0x565b0e[_0xa0d2('0x38')]['includeAll']){_0x381896[_0xa0d2('0xab')]=[{'all':!![]}];}_0x381896=_[_0xa0d2('0x90')]({},_0x381896,_0x565b0e[_0xa0d2('0xac')]);return db['FaxInteraction']['find'](_0x381896)[_0xa0d2('0x27')](handleEntityNotFound(_0x1af1bf,null))['then'](respondWithResult(_0x1af1bf,null))[_0xa0d2('0x31')](handleError(_0x1af1bf,null));};exports[_0xa0d2('0xad')]=function(_0x1bf527,_0x1d6ab9){return db[_0xa0d2('0x32')]['create'](_0x1bf527[_0xa0d2('0x6d')],{})[_0xa0d2('0x27')](respondWithResult(_0x1d6ab9,0xc9))[_0xa0d2('0x31')](handleError(_0x1d6ab9,null));};exports[_0xa0d2('0x26')]=function(_0x1b3ef2,_0x47dd63){if(_0x1b3ef2['body']['id']){delete _0x1b3ef2['body']['id'];}return db['FaxInteraction'][_0xa0d2('0x5b')]({'where':{'id':_0x1b3ef2['params']['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x47dd63,null))[_0xa0d2('0x27')](saveUpdates(_0x1b3ef2[_0xa0d2('0x6d')],null))['then'](respondWithResult(_0x47dd63,null))[_0xa0d2('0x31')](handleError(_0x47dd63,null));};exports['destroy']=function(_0x2e6aa2,_0x22f9ff){return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x2e6aa2['params']['id']}})['then'](handleEntityNotFound(_0x22f9ff,null))[_0xa0d2('0x27')](removeEntity(_0x22f9ff,null))[_0xa0d2('0x31')](handleError(_0x22f9ff,null));};exports[_0xa0d2('0xae')]=function(_0x43421f,_0x2e5396){return db[_0xa0d2('0x32')]['describe']()[_0xa0d2('0x27')](respondWithResult(_0x2e5396,null))['catch'](handleError(_0x2e5396,null));};exports[_0xa0d2('0xaf')]=function(_0x5ad58e,_0x3e9fa3,_0x5bb4a3){return db[_0xa0d2('0xb0')]['find']({'where':{'id':_0x5ad58e[_0xa0d2('0xb1')]['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x3e9fa3,null))[_0xa0d2('0x27')](function(_0x384af9){if(_0x384af9){return _0x384af9[_0xa0d2('0xaf')](_0x5ad58e[_0xa0d2('0x6d')][_0xa0d2('0xb2')],_[_0xa0d2('0xb3')](_0x5ad58e[_0xa0d2('0x6d')],['ids','id'])||{});}})[_0xa0d2('0x27')](respondWithResult(_0x3e9fa3,null))[_0xa0d2('0x31')](handleError(_0x3e9fa3,null));};exports[_0xa0d2('0xb4')]=function(_0x59c4d3,_0x22e604,_0x4ecd97){var _0x4e4bf7={'raw':![],'where':{}};var _0x56cfa8={};var _0x5522e5={'count':0x0,'rows':[]};return db[_0xa0d2('0x32')][_0xa0d2('0xb5')]({'where':{'id':_0x59c4d3['params']['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x22e604,null))['then'](function(_0x2a8b37){if(_0x2a8b37){_0x56cfa8['model']=_['keys'](db[_0xa0d2('0xb0')]['rawAttributes']);_0x56cfa8[_0xa0d2('0x38')]=_['keys'](_0x59c4d3[_0xa0d2('0x38')]);_0x56cfa8[_0xa0d2('0x3a')]=_[_0xa0d2('0x3b')](_0x56cfa8[_0xa0d2('0x37')],_0x56cfa8[_0xa0d2('0x38')]);_0x4e4bf7[_0xa0d2('0x3d')]=_[_0xa0d2('0x3b')](_0x56cfa8[_0xa0d2('0x37')],qs[_0xa0d2('0x3c')](_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x3c')]));_0x4e4bf7[_0xa0d2('0x3d')]=_0x4e4bf7[_0xa0d2('0x3d')][_0xa0d2('0x5a')]?_0x4e4bf7[_0xa0d2('0x3d')]:_0x56cfa8[_0xa0d2('0x37')];if(!_0x59c4d3['query']['hasOwnProperty'](_0xa0d2('0x3f'))){_0x4e4bf7[_0xa0d2('0x21')]=qs[_0xa0d2('0x21')](_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x21')]);_0x4e4bf7['offset']=qs[_0xa0d2('0x20')](_0x59c4d3['query']['offset']);}_0x4e4bf7['order']=qs[_0xa0d2('0x41')](_0x59c4d3['query']['sort']);_0x4e4bf7[_0xa0d2('0x42')]=qs['filters'](_['pick'](_0x59c4d3['query'],_0x56cfa8[_0xa0d2('0x3a')]));_0x4e4bf7[_0xa0d2('0x42')][_0xa0d2('0xb6')]=_0x2a8b37['id'];if(_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x7b')]){_0x4e4bf7[_0xa0d2('0x42')]=_[_0xa0d2('0x90')](_0x4e4bf7[_0xa0d2('0x42')],{'$or':_[_0xa0d2('0x2b')](_0x4e4bf7[_0xa0d2('0x3d')],function(_0x1256f5){var _0x5c8977={};_0x5c8977[_0x1256f5]={'$like':'%'+_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x7b')]+'%'};return _0x5c8977;})});}if(_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x74')]){var _0x41f0c9=_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x74')]['split'](',');var _0x16e866={};_0x16e866[_0x41f0c9[0x0]]={'$gte':moment(_0x41f0c9[0x1])['format'](_0xa0d2('0xb7'))};_0x4e4bf7['where']=_['merge'](_0x4e4bf7[_0xa0d2('0x42')],_0x16e866);}_0x4e4bf7=_[_0xa0d2('0x90')]({},_0x4e4bf7,_0x59c4d3[_0xa0d2('0xac')]);return db[_0xa0d2('0xb0')][_0xa0d2('0x1f')]({'where':_0x4e4bf7[_0xa0d2('0x42')]})['then'](function(_0x45f013){_0x5522e5['count']=_0x45f013;if(_0x59c4d3[_0xa0d2('0x38')]['includeAll']){_0x4e4bf7[_0xa0d2('0xab')]=[{'all':!![]}];}return db['FaxMessage'][_0xa0d2('0xb8')](_0x4e4bf7);})[_0xa0d2('0x27')](function(_0x345245){_0x5522e5['rows']=_0x345245;return _0x5522e5;});}})['then'](respondWithFilteredResult(_0x22e604,_0x4e4bf7))[_0xa0d2('0x31')](handleError(_0x22e604,null));};exports[_0xa0d2('0xb9')]=function(_0x306428,_0x15adf7,_0x2187b6){return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x306428[_0xa0d2('0xb1')]['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x15adf7,null))[_0xa0d2('0x27')](function(_0x15f3bb){if(_0x15f3bb){return _0x15f3bb[_0xa0d2('0xba')](_0x306428['body']['ids'],_[_0xa0d2('0xb3')](_0x306428[_0xa0d2('0x6d')],[_0xa0d2('0xb2'),'id'])||{})[_0xa0d2('0xbb')](function(){return db[_0xa0d2('0x67')][_0xa0d2('0xb8')]({'attributes':['id',_0xa0d2('0x2a'),_0xa0d2('0xbc')],'where':{'id':_0x306428['body'][_0xa0d2('0xb2')]}});})[_0xa0d2('0x27')](function(_0x56a9d6){socket[_0xa0d2('0xbd')](_0xa0d2('0xbe'),{'id':Number(_0x306428[_0xa0d2('0xb1')]['id']),'tags':_0x56a9d6||[]});return{'id':Number(_0x306428[_0xa0d2('0xb1')]['id']),'tags':_0x56a9d6||[]};});}})['then'](respondWithResult(_0x15adf7,null))[_0xa0d2('0x31')](handleError(_0x15adf7,null));};exports[_0xa0d2('0xbf')]=function(_0x548670,_0x29c12b,_0x59ccca){return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x548670[_0xa0d2('0xb1')]['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x29c12b,null))[_0xa0d2('0x27')](function(_0x539b47){if(_0x539b47){return _0x539b47[_0xa0d2('0xbf')](_0x548670[_0xa0d2('0x38')]['ids']);}})[_0xa0d2('0x27')](respondWithStatusCode(_0x29c12b,null))[_0xa0d2('0x31')](handleError(_0x29c12b,null));};exports[_0xa0d2('0xc0')]=function(_0x503e51,_0x23b85b){var _0x8078=moment()[_0xa0d2('0xc1')]()[_0xa0d2('0x8e')]();var _0x3e5290=path[_0xa0d2('0xc2')](config['root'],_0xa0d2('0xc3'),_0xa0d2('0xc4'),_0xa0d2('0xc5'));var _0xb7ba78=path['join'](config[_0xa0d2('0xc6')],_0xa0d2('0xc3'),_0xa0d2('0xc4'),_0xa0d2('0xc7'));var _0x10155b=path[_0xa0d2('0xc2')](_0x3e5290,_0x8078);var _0x246c5e=util['format'](_0xa0d2('0xc8'),_0x503e51[_0xa0d2('0xb1')]['id'],_0x8078);var _0x1c80a5=path[_0xa0d2('0xc2')](_0x3e5290,_0x246c5e);var _0x32c711=[];if(_0x503e51[_0xa0d2('0x38')][_0xa0d2('0xc7')]){_0x32c711[_0xa0d2('0xa7')]({'model':db[_0xa0d2('0xc9')],'as':_0xa0d2('0xca'),'raw':!![]});}var _0x5a2945=[{'model':db[_0xa0d2('0xb0')],'as':'Messages','attributes':['id',_0xa0d2('0x6d'),'createdAt'],'include':_0x32c711}];return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x503e51[_0xa0d2('0xb1')]['id']},'include':_0x5a2945})[_0xa0d2('0x27')](handleEntityNotFound(_0x23b85b,null))[_0xa0d2('0x27')](function(_0x45d6b2){if(_0x45d6b2&&_0x45d6b2[_0xa0d2('0xcb')]){var _0x16193a=_0x45d6b2[_0xa0d2('0xcc')]({'plain':!![]});fs[_0xa0d2('0xcd')](_0x10155b);for(var _0x28cbf6=0x0;_0x28cbf6<_0x16193a[_0xa0d2('0xcb')][_0xa0d2('0x5a')];_0x28cbf6++){var _0xd4543a=_0x16193a['Messages'][_0x28cbf6]['Attachment'];if(_0xd4543a){var _0x588c75=path[_0xa0d2('0xc2')](_0xb7ba78,_0xd4543a[_0xa0d2('0xce')]);if(fs[_0xa0d2('0xcf')](_0x588c75)){fs[_0xa0d2('0xd0')](_0x588c75)[_0xa0d2('0xd1')](fs[_0xa0d2('0xd2')](path[_0xa0d2('0xc2')](_0x10155b,_0xd4543a['basename'])));}}}return BPromise[_0xa0d2('0xd3')]()['then'](function(){return new BPromise(function(_0x3015e0,_0x952390){zipdir(_0x10155b,{'saveTo':_0x1c80a5},function(_0x40a73f,_0x2ba654){if(_0x40a73f)return _0x952390(_0x40a73f);return _0x3015e0(_0x2ba654);});})[_0xa0d2('0x27')](function(){return new BPromise(function(_0x1f7cab,_0x3d70b9){rimraf(_0x10155b,function(_0x361d69){if(_0x361d69)_0x3d70b9(_0x361d69);return _0x1f7cab();});});})[_0xa0d2('0x27')](function(){return _0x23b85b[_0xa0d2('0xc0')](_0x1c80a5,_0x246c5e,function(_0xa8c93d){if(_0xa8c93d){console[_0xa0d2('0xd4')]('err',_0xa8c93d);}else{fs['unlinkSync'](_0x1c80a5);}});});});}else{return _0x23b85b[_0xa0d2('0x1b')](0xc8);}})[_0xa0d2('0x31')](handleError(_0x23b85b,null));}; \ No newline at end of file +var _0x54c6=['send','Users','fullname','TagIds','Tags','split','push','catch','map','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','select','field','color','from','u.id','u.fullname','ui.FaxInteractionId','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','expr','search','sqlOperator','conditions','find','unreadMessages','having','`\x20>\x200','Contact','operator','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','compact','isEmpty','FaxAccountId','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','Account.key','Account.mandatoryDisposition','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','rows','show','params','includeAll','include','merge','options','body','FaxMessage','omit','ids','getMessages','findOne','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','server','files','tmp','join','root','attachments','format','transcript-%d-%s.zip','Attachment','Attachments','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./faxInteraction.socket','sendStatus','end','count','offset','status','set','Content-Range','reject','update','destroy','then','error','name'];(function(_0x364ba1,_0x40eca4){var _0x1ce5d6=function(_0x516418){while(--_0x516418){_0x364ba1['push'](_0x364ba1['shift']());}};_0x1ce5d6(++_0x40eca4);}(_0x54c6,0x174));var _0x654c=function(_0x51b66f,_0x23c9b0){_0x51b66f=_0x51b66f-0x0;var _0x545f8f=_0x54c6[_0x51b66f];return _0x545f8f;};'use strict';var pdf=require(_0x654c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x654c('0x1'));var zipdir=require(_0x654c('0x2'));var jsonpatch=require(_0x654c('0x3'));var rp=require(_0x654c('0x4'));var moment=require(_0x654c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x654c('0x6'));var util=require(_0x654c('0x7'));var path=require(_0x654c('0x8'));var sox=require(_0x654c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x654c('0xa'));var squel=require(_0x654c('0xb'));var crypto=require(_0x654c('0xc'));var jsforce=require(_0x654c('0xd'));var deskjs=require(_0x654c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x654c('0xf'));var Papa=require('papaparse');var Redis=require(_0x654c('0x10'));var authService=require(_0x654c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x654c('0x12'));var hardwareService=require(_0x654c('0x13'));var logger=require('../../config/logger')(_0x654c('0x14'));var utils=require(_0x654c('0x15'));var config=require(_0x654c('0x16'));var db=require(_0x654c('0x17'))['db'];config['redis']=_[_0x654c('0x18')](config[_0x654c('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x654c('0x19')]));require(_0x654c('0x1a'))['register'](socket);function respondWithStatusCode(_0x47ef15,_0x30955a){_0x30955a=_0x30955a||0xcc;return function(_0x3ef2f6){if(_0x3ef2f6){return _0x47ef15[_0x654c('0x1b')](_0x30955a);}return _0x47ef15['status'](_0x30955a)[_0x654c('0x1c')]();};}function respondWithResult(_0x1e3336,_0x5d246c){_0x5d246c=_0x5d246c||0xc8;return function(_0x495f32){if(_0x495f32){return _0x1e3336['status'](_0x5d246c)['json'](_0x495f32);}};}function respondWithFilteredResult(_0x848b3b,_0x5aec9b){return function(_0x109074){if(_0x109074){var _0x3355b9=_0x109074[_0x654c('0x1d')],_0x569b7c=_0x5aec9b[_0x654c('0x1e')],_0x59aabf=_0x5aec9b[_0x654c('0x1e')]+_0x5aec9b['limit'],_0x35b7b8;if(_0x59aabf>=_0x3355b9){_0x59aabf=_0x3355b9;_0x35b7b8=0xc8;}else{_0x35b7b8=0xce;}_0x848b3b[_0x654c('0x1f')](_0x35b7b8);return _0x848b3b[_0x654c('0x20')](_0x654c('0x21'),_0x569b7c+'-'+_0x59aabf+'/'+_0x3355b9)['json'](_0x109074);}return null;};}function patchUpdates(_0x94d4ee){return function(_0x5932a6){try{jsonpatch['apply'](_0x5932a6,_0x94d4ee,!![]);}catch(_0x47d1ba){return BPromise[_0x654c('0x22')](_0x47d1ba);}return _0x5932a6['save']();};}function saveUpdates(_0x6d82dd,_0x203959){return function(_0xf739a){if(_0xf739a){return _0xf739a[_0x654c('0x23')](_0x6d82dd)['then'](function(_0x532e25){return _0x532e25;});}return null;};}function removeEntity(_0x30bbf3,_0x5028db){return function(_0x4ac34a){if(_0x4ac34a){return _0x4ac34a[_0x654c('0x24')]()[_0x654c('0x25')](function(){_0x30bbf3[_0x654c('0x1f')](0xcc)[_0x654c('0x1c')]();});}};}function handleEntityNotFound(_0x5cc882,_0x224fb9){return function(_0x3b262a){if(!_0x3b262a){_0x5cc882[_0x654c('0x1b')](0x194);}return _0x3b262a;};}function handleError(_0x220b78,_0x3f1fea){_0x3f1fea=_0x3f1fea||0x1f4;return function(_0x24a2c1){logger[_0x654c('0x26')](_0x24a2c1['stack']);if(_0x24a2c1[_0x654c('0x27')]){delete _0x24a2c1['name'];}_0x220b78[_0x654c('0x1f')](_0x3f1fea)[_0x654c('0x28')](_0x24a2c1);};}function getInteractionUsers(_0xa43a04,_0x5f3937){return new BPromise(function(_0x3f35e,_0x4f7689){try{if(_0x5f3937[_0xa43a04['id']]){_0xa43a04[_0x654c('0x29')]=_['map'](_0x5f3937[_0xa43a04['id']],function(_0x5c9b1a){return{'id':_0x5c9b1a['id'],'fullname':_0x5c9b1a[_0x654c('0x2a')]};});}}catch(_0x143184){_0x4f7689(_0x143184);}_0x3f35e(_0xa43a04);});}function getInteractionTags(_0xc262bd,_0xa4b1c9){return new BPromise(function(_0x706b08,_0x840e34){try{if(_0xc262bd[_0x654c('0x2b')]){_0xc262bd[_0x654c('0x2c')]=[];_0xc262bd['TagIds'][_0x654c('0x2d')](',')['forEach'](function(_0x5c2e73){_0xc262bd[_0x654c('0x2c')][_0x654c('0x2e')](_0xa4b1c9[_0x5c2e73]);});}delete _0xc262bd[_0x654c('0x2b')];}catch(_0x37d60d){_0x840e34(_0x37d60d);}_0x706b08(_0xc262bd);});}function updateFaxInteraction(_0x7951b1,_0x83f0f1,_0x331c37){return new BPromise(function(_0x1a01a3,_0x7c5a50){return getInteractionUsers(_0x7951b1,_0x331c37)[_0x654c('0x25')](function(_0x256901){return getInteractionTags(_0x256901,_0x83f0f1);})[_0x654c('0x25')](function(_0x47989c){_0x1a01a3(_0x47989c);})[_0x654c('0x2f')](function(_0x47ac9b){_0x7c5a50(_0x47ac9b);});});}exports['index']=function(_0x46fa5e,_0x228f21){var _0x52b2eb={},_0x2e6abc={},_0x168319={'count':0x0,'rows':[]};var _0x28fea3=_[_0x654c('0x30')](db[_0x654c('0x31')][_0x654c('0x32')],function(_0xd0d7ee){return{'name':_0xd0d7ee[_0x654c('0x33')],'type':_0xd0d7ee[_0x654c('0x34')][_0x654c('0x35')]};});_0x2e6abc[_0x654c('0x36')]=_['map'](_0x28fea3,'name');_0x2e6abc[_0x654c('0x37')]=_[_0x654c('0x38')](_0x46fa5e[_0x654c('0x37')]);_0x2e6abc[_0x654c('0x39')]=_[_0x654c('0x3a')](_0x2e6abc[_0x654c('0x36')],_0x2e6abc[_0x654c('0x37')]);_0x52b2eb[_0x654c('0x3b')]=_[_0x654c('0x3a')](_0x2e6abc[_0x654c('0x36')],qs[_0x654c('0x3c')](_0x46fa5e[_0x654c('0x37')][_0x654c('0x3c')]));_0x52b2eb[_0x654c('0x3b')]=_0x52b2eb[_0x654c('0x3b')][_0x654c('0x3d')]?_0x52b2eb[_0x654c('0x3b')]:_0x2e6abc[_0x654c('0x36')];if(!_0x46fa5e[_0x654c('0x37')]['hasOwnProperty'](_0x654c('0x3e'))){_0x52b2eb['limit']=qs[_0x654c('0x3f')](_0x46fa5e[_0x654c('0x37')][_0x654c('0x3f')]);_0x52b2eb[_0x654c('0x1e')]=qs['offset'](_0x46fa5e[_0x654c('0x37')][_0x654c('0x1e')]);}_0x52b2eb[_0x654c('0x40')]=qs[_0x654c('0x41')](_0x46fa5e['query'][_0x654c('0x41')]);_0x52b2eb[_0x654c('0x42')]=qs[_0x654c('0x39')](_['pick'](_0x46fa5e['query'],_0x2e6abc[_0x654c('0x39')]));var _0x42a655=[];var _0x964de3=squel[_0x654c('0x43')]()[_0x654c('0x44')]('id')[_0x654c('0x44')](_0x654c('0x27'))[_0x654c('0x44')](_0x654c('0x45'))[_0x654c('0x46')]('tools_tags');var _0x25d324=squel[_0x654c('0x43')]()['field'](_0x654c('0x47'))[_0x654c('0x44')](_0x654c('0x48'))['field'](_0x654c('0x49'))['from']('user_has_fax_interactions','ui')[_0x654c('0x4a')](_0x654c('0x4b'),'u',_0x654c('0x4c'));var _0x56b02c=squel['select']()[_0x654c('0x46')](_0x654c('0x4d'),'i')[_0x654c('0x4a')](_0x654c('0x4e'),'c',_0x654c('0x4f'))[_0x654c('0x4a')](_0x654c('0x4b'),'o',_0x654c('0x50'))['left_join'](_0x654c('0x51'),'a','a.id\x20=\x20i.FaxAccountId')[_0x654c('0x4a')](_0x654c('0x52'),'me',_0x654c('0x53'))[_0x654c('0x4a')](_0x654c('0x54'),'it',_0x654c('0x55'))['left_join'](_0x654c('0x56'),'t','t.id\x20=\x20it.TagId');var _0x326fe7=squel[_0x654c('0x57')]();var _0x4f4ea5=[];var _0x7d032d=squel['expr']();var _0x57f4e3;if(_0x46fa5e[_0x654c('0x37')][_0x654c('0x58')]){_0x57f4e3=as['parseSearch'](_0x46fa5e[_0x654c('0x37')][_0x654c('0x58')]);var _0x3cd1b3=_0x57f4e3[_0x654c('0x59')];for(var _0x6033f1=0x0;_0x6033f1<_0x57f4e3['conditions'][_0x654c('0x3d')];_0x6033f1++){var _0xdeea1a=_0x57f4e3[_0x654c('0x5a')][_0x6033f1];var _0x24fcc5='i';var _0x537bb5=_[_0x654c('0x5b')](_0x28fea3,[_0x654c('0x27'),_0xdeea1a[_0x654c('0x44')]]);if(!_0x537bb5){switch(_0xdeea1a['field']){case _0x654c('0x5c'):if(_0xdeea1a['value']==0x1){_0x56b02c[_0x654c('0x5d')]('`'+_0xdeea1a[_0x654c('0x44')]+'`\x20=\x200');}else{_0x56b02c[_0x654c('0x5d')]('`'+_0xdeea1a[_0x654c('0x44')]+_0x654c('0x5e'));}break;case _0x654c('0x5f'):if(_0xdeea1a[_0x654c('0x60')]==='$substring'){if(_0xdeea1a[_0x654c('0x61')][_0x654c('0x2d')]('\x20')['length']>0x1){_0x326fe7[_0x3cd1b3](_0x654c('0x62'),qs[_0x654c('0x63')](_0xdeea1a[_0x654c('0x61')]),null);}else{var _0x35ff8f='%'+_0xdeea1a[_0x654c('0x61')]+'%';_0x326fe7[_0x3cd1b3](_0x654c('0x64'),_0x35ff8f,_0x35ff8f,_0x35ff8f);}}else{_0x537bb5=_[_0x654c('0x5b')](_0x28fea3,[_0x654c('0x27'),'ContactId']);_0xdeea1a[_0x654c('0x44')]='ContactId';_0x5c4f50=as[_0x654c('0x65')](_0x24fcc5,_0x537bb5[_0x654c('0x34')],_0xdeea1a);_0x326fe7[_0x3cd1b3](_0x5c4f50[_0x654c('0x66')],_0x5c4f50[_0x654c('0x61')][_0x654c('0x67')],_0x5c4f50['value'][_0x654c('0x1c')]);}break;case _0x654c('0x68'):var _0x15645c=_0xdeea1a[_0x654c('0x61')][_0x654c('0x2d')](',')[_0x654c('0x30')](function(_0x58b6d1){return Number(_0x58b6d1);});_0x15645c[_0x654c('0x69')](function(_0xd1163e){_0x7d032d['or'](_0x654c('0x6a'),'%,'+_0xd1163e+',%');});_0x4f4ea5=_[_0x654c('0x6b')](_0x4f4ea5,_0x15645c);break;case'User':if(_0xdeea1a[_0x654c('0x60')]===_0x654c('0x6c')){_0x326fe7[_0x3cd1b3](_0x654c('0x6d'),'%'+_0xdeea1a[_0x654c('0x61')]+'%',null);}else{_0x537bb5=_[_0x654c('0x5b')](_0x28fea3,['name','UserId']);_0xdeea1a[_0x654c('0x44')]=_0x654c('0x6e');_0x5c4f50=as[_0x654c('0x65')](_0x24fcc5,_0x537bb5[_0x654c('0x34')],_0xdeea1a);_0x326fe7[_0x3cd1b3](_0x5c4f50[_0x654c('0x66')],_0x5c4f50[_0x654c('0x61')]['start'],_0x5c4f50[_0x654c('0x61')][_0x654c('0x1c')]);}break;case'body':_0x5c4f50=as['buildExpression']('me',null,_0xdeea1a);_0x326fe7[_0x3cd1b3](_0x5c4f50[_0x654c('0x66')],_0x5c4f50[_0x654c('0x61')][_0x654c('0x67')],_0x5c4f50[_0x654c('0x61')][_0x654c('0x1c')]);break;}}else{var _0x5c4f50=as[_0x654c('0x65')](_0x24fcc5,_0x537bb5[_0x654c('0x34')],_0xdeea1a);_0x326fe7[_0x3cd1b3](_0x5c4f50['text'],_0x5c4f50[_0x654c('0x61')][_0x654c('0x67')],_0x5c4f50[_0x654c('0x61')][_0x654c('0x1c')]);}}}else{var _0x29cac1=_(_0x46fa5e['query'])['keys']()[_0x654c('0x30')](function(_0x20ba40){return _[_0x654c('0x6f')](_0x28fea3,[_0x654c('0x27'),_0x20ba40])?_0x20ba40:undefined;})[_0x654c('0x70')]()['value']();if(!_[_0x654c('0x71')](_0x29cac1)){_0x29cac1['forEach'](function(_0xe786df){if(_0xe786df===_0x654c('0x72')){_0x56b02c[_0x654c('0x42')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x46fa5e[_0x654c('0x37')][_0xe786df]));}else if(_0xe786df===_0x654c('0x73')){var _0x3b450f=JSON[_0x654c('0x74')](_0x46fa5e[_0x654c('0x37')][_0xe786df])[_0x654c('0x75')];var _0x171b1d=JSON[_0x654c('0x74')](_0x46fa5e[_0x654c('0x37')][_0xe786df])['$lte'];_0x56b02c[_0x654c('0x42')](_0x654c('0x76'),_0x3b450f,_0x171b1d);}else{if(_0x46fa5e['query'][_0xe786df]===_0x654c('0x77')){_0x56b02c[_0x654c('0x42')]('i.'+_0xe786df+_0x654c('0x78'));}else{_0x56b02c['where']('i.'+_0xe786df+'\x20=\x20?',_0x46fa5e[_0x654c('0x37')][_0xe786df]);}}});}if(_0x46fa5e['query'][_0x654c('0x79')]){if(_0x46fa5e[_0x654c('0x37')][_0x654c('0x79')]==0x1){_0x56b02c['having'](_0x654c('0x7a'));}else{_0x56b02c[_0x654c('0x5d')](_0x654c('0x7b'));}}if(_0x46fa5e[_0x654c('0x37')]['tag']){_0x4f4ea5=_[_0x654c('0x7c')](_0x46fa5e[_0x654c('0x37')][_0x654c('0x7d')])?_0x46fa5e['query'][_0x654c('0x7d')]:new Array(_0x46fa5e[_0x654c('0x37')]['tag']);_0x4f4ea5[_0x654c('0x69')](function(_0xd19cb1){_0x7d032d['or'](_0x654c('0x6a'),'%,'+_0xd19cb1+',%');});}if(_0x46fa5e[_0x654c('0x37')][_0x654c('0x7e')]){var _0x3d2c41=_0x46fa5e['query'][_0x654c('0x7e')][_0x654c('0x7f')]('\x5c','\x5c\x5c')[_0x654c('0x7f')]('\x27\x27',_0x654c('0x80'));if(qs[_0x654c('0x81')](_0x3d2c41)){_0x326fe7['or'](_0x654c('0x82'),_0x3d2c41+'%')['or'](_0x654c('0x83'),_0x3d2c41+'%');}_0x326fe7['or'](_0x654c('0x84'),_0x3d2c41+'%');}}_0x56b02c[_0x654c('0x42')](_0x326fe7);_0x56b02c[_0x654c('0x85')]('i.id');var _0x19c096={'type':db['Sequelize'][_0x654c('0x86')][_0x654c('0x87')],'raw':!![]};var _0xef20f5=_0x56b02c[_0x654c('0x88')]();_0xef20f5['field']('i.id');_0xef20f5['field'](_0x654c('0x89'),_0x654c('0x5c'));if(_0x52b2eb[_0x654c('0x40')]){_0x52b2eb[_0x654c('0x40')]['forEach'](function(_0x14e20d){_0x56b02c['order']('i.'+_0x14e20d[0x0],_0x14e20d[0x1]===_0x654c('0x8a')?![]:!![]);});}if(!_[_0x654c('0x71')](_0x4f4ea5)){_0x56b02c['having'](_0x7d032d);_0xef20f5[_0x654c('0x42')](_0x654c('0x8b'),_0x4f4ea5);}BPromise['resolve']()['then'](function(){if(!_0x57f4e3&&_0x46fa5e[_0x654c('0x37')]['FaxAccountId'])return;return _0x46fa5e[_0x654c('0x8c')][_0x654c('0x8d')]({'attributes':['id'],'raw':!![]})[_0x654c('0x25')](function(_0x5d8e2a){if(_[_0x654c('0x71')](_0x5d8e2a)){_0xef20f5[_0x654c('0x42')]('i.FaxAccountId\x20IS\x20NULL');_0x56b02c[_0x654c('0x42')](_0x654c('0x8e'));}else{_0xef20f5[_0x654c('0x42')]('i.FaxAccountId\x20IN\x20?',_[_0x654c('0x30')](_0x5d8e2a,'id'));_0x56b02c[_0x654c('0x42')](_0x654c('0x8f'),_[_0x654c('0x30')](_0x5d8e2a,'id'));}});})[_0x654c('0x25')](function(){db[_0x654c('0x90')][_0x654c('0x37')](_0xef20f5[_0x654c('0x91')](),_0x19c096)[_0x654c('0x25')](function(_0x1cdb73){_0x168319[_0x654c('0x1d')]=_0x1cdb73['length'];if(_0x168319['count']===0x0)return[];return db[_0x654c('0x90')][_0x654c('0x37')](_0x964de3[_0x654c('0x91')](),_0x19c096)[_0x654c('0x25')](function(_0x37be8e){_0x42a655=_[_0x654c('0x92')](_0x37be8e,'id');_0x19c096=_['merge'](_0x19c096,{'model':db[_0x654c('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46fa5e[_0x654c('0x37')][_0x654c('0x3c')]){_0x52b2eb[_0x654c('0x3b')][_0x654c('0x69')](function(_0x183b66){_0x56b02c[_0x654c('0x44')]('i.'+_0x183b66);});}else{_0x56b02c[_0x654c('0x44')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x56b02c[_0x654c('0x44')]('a.key',_0x654c('0x93'));_0x56b02c[_0x654c('0x44')]('a.mandatoryDisposition',_0x654c('0x94'));_0x56b02c[_0x654c('0x44')]('i.*');_0x56b02c[_0x654c('0x44')]('c.firstName',_0x654c('0x95'));_0x56b02c[_0x654c('0x44')](_0x654c('0x96'),_0x654c('0x97'));_0x56b02c['field']('c.email',_0x654c('0x98'));_0x56b02c[_0x654c('0x44')]('c.phone',_0x654c('0x99'));_0x56b02c[_0x654c('0x44')](_0x654c('0x9a'),_0x654c('0x9b'));_0x56b02c[_0x654c('0x44')]('c.fax',_0x654c('0x9c'));_0x56b02c[_0x654c('0x44')](_0x654c('0x9d'),_0x654c('0x9e'));_0x56b02c[_0x654c('0x44')](_0x654c('0x9f'),'Owner.internal');_0x56b02c[_0x654c('0x44')](_0x654c('0xa0'),_0x654c('0x2b'));}_0x56b02c[_0x654c('0x3f')](_0x52b2eb[_0x654c('0x3f')]);_0x56b02c[_0x654c('0x1e')](_0x52b2eb[_0x654c('0x1e')]);return db[_0x654c('0x90')]['query'](_0x56b02c[_0x654c('0x91')](),_0x19c096);})[_0x654c('0x25')](function(_0x58c635){_0x25d324[_0x654c('0x42')](_0x654c('0xa1'),_[_0x654c('0x30')](_0x58c635,'id'));return db['sequelize'][_0x654c('0x37')](_0x25d324[_0x654c('0x91')](),_0x19c096)[_0x654c('0x25')](function(_0x1b03a6){var _0x5e1ce8=_[_0x654c('0xa2')](_0x1b03a6,_0x654c('0xa3'));var _0xf61437=[];_0x58c635[_0x654c('0x69')](function(_0x35097e){_0xf61437[_0x654c('0x2e')](updateFaxInteraction(_0x35097e,_0x42a655,_0x5e1ce8));});return BPromise['all'](_0xf61437);});});})['then'](function(_0xae8ccc){_0x168319[_0x654c('0xa4')]=_0xae8ccc;return _0x168319;})[_0x654c('0x25')](respondWithFilteredResult(_0x228f21,_0x52b2eb));})[_0x654c('0x2f')](handleError(_0x228f21,null));};exports[_0x654c('0xa5')]=function(_0x40b9eb,_0x223b63){var _0x156c5a={'raw':![],'where':{'id':_0x40b9eb[_0x654c('0xa6')]['id']}},_0x28779d={};_0x28779d[_0x654c('0x36')]=_[_0x654c('0x38')](db[_0x654c('0x31')][_0x654c('0x32')]);_0x28779d[_0x654c('0x37')]=_[_0x654c('0x38')](_0x40b9eb['query']);_0x28779d[_0x654c('0x39')]=_[_0x654c('0x3a')](_0x28779d['model'],_0x28779d[_0x654c('0x37')]);_0x156c5a[_0x654c('0x3b')]=_[_0x654c('0x3a')](_0x28779d[_0x654c('0x36')],qs['fields'](_0x40b9eb[_0x654c('0x37')][_0x654c('0x3c')]));_0x156c5a[_0x654c('0x3b')]=_0x156c5a[_0x654c('0x3b')][_0x654c('0x3d')]?_0x156c5a['attributes']:_0x28779d[_0x654c('0x36')];if(_0x40b9eb[_0x654c('0x37')][_0x654c('0xa7')]){_0x156c5a[_0x654c('0xa8')]=[{'all':!![]}];}_0x156c5a=_[_0x654c('0xa9')]({},_0x156c5a,_0x40b9eb[_0x654c('0xaa')]);return db[_0x654c('0x31')][_0x654c('0x5b')](_0x156c5a)['then'](handleEntityNotFound(_0x223b63,null))[_0x654c('0x25')](respondWithResult(_0x223b63,null))[_0x654c('0x2f')](handleError(_0x223b63,null));};exports['create']=function(_0x221621,_0x4fc6f0){return db[_0x654c('0x31')]['create'](_0x221621[_0x654c('0xab')],{})[_0x654c('0x25')](respondWithResult(_0x4fc6f0,0xc9))['catch'](handleError(_0x4fc6f0,null));};exports[_0x654c('0x23')]=function(_0x5e869b,_0x2b3efb){if(_0x5e869b[_0x654c('0xab')]['id']){delete _0x5e869b[_0x654c('0xab')]['id'];}return db[_0x654c('0x31')][_0x654c('0x5b')]({'where':{'id':_0x5e869b[_0x654c('0xa6')]['id']}})[_0x654c('0x25')](handleEntityNotFound(_0x2b3efb,null))[_0x654c('0x25')](saveUpdates(_0x5e869b[_0x654c('0xab')],null))[_0x654c('0x25')](respondWithResult(_0x2b3efb,null))[_0x654c('0x2f')](handleError(_0x2b3efb,null));};exports[_0x654c('0x24')]=function(_0x937648,_0x241823){return db['FaxInteraction'][_0x654c('0x5b')]({'where':{'id':_0x937648[_0x654c('0xa6')]['id']}})['then'](handleEntityNotFound(_0x241823,null))['then'](removeEntity(_0x241823,null))[_0x654c('0x2f')](handleError(_0x241823,null));};exports['describe']=function(_0x1498b2,_0x301399){return db[_0x654c('0x31')]['describe']()[_0x654c('0x25')](respondWithResult(_0x301399,null))[_0x654c('0x2f')](handleError(_0x301399,null));};exports['addMessage']=function(_0x1c37d6,_0x5862b2,_0x20f7be){return db[_0x654c('0xac')][_0x654c('0x5b')]({'where':{'id':_0x1c37d6[_0x654c('0xa6')]['id']}})[_0x654c('0x25')](handleEntityNotFound(_0x5862b2,null))[_0x654c('0x25')](function(_0x240fd1){if(_0x240fd1){return _0x240fd1['addMessage'](_0x1c37d6[_0x654c('0xab')]['ids'],_[_0x654c('0xad')](_0x1c37d6['body'],[_0x654c('0xae'),'id'])||{});}})[_0x654c('0x25')](respondWithResult(_0x5862b2,null))['catch'](handleError(_0x5862b2,null));};exports[_0x654c('0xaf')]=function(_0x2c39aa,_0x685aa8,_0x541102){var _0x303b91={'raw':![],'where':{}};var _0x599bd3={};var _0x93b076={'count':0x0,'rows':[]};return db[_0x654c('0x31')][_0x654c('0xb0')]({'where':{'id':_0x2c39aa[_0x654c('0xa6')]['id']}})[_0x654c('0x25')](handleEntityNotFound(_0x685aa8,null))[_0x654c('0x25')](function(_0x443a70){if(_0x443a70){_0x599bd3[_0x654c('0x36')]=_[_0x654c('0x38')](db[_0x654c('0xac')][_0x654c('0x32')]);_0x599bd3[_0x654c('0x37')]=_[_0x654c('0x38')](_0x2c39aa['query']);_0x599bd3[_0x654c('0x39')]=_['intersection'](_0x599bd3[_0x654c('0x36')],_0x599bd3[_0x654c('0x37')]);_0x303b91[_0x654c('0x3b')]=_[_0x654c('0x3a')](_0x599bd3[_0x654c('0x36')],qs['fields'](_0x2c39aa[_0x654c('0x37')][_0x654c('0x3c')]));_0x303b91[_0x654c('0x3b')]=_0x303b91['attributes'][_0x654c('0x3d')]?_0x303b91[_0x654c('0x3b')]:_0x599bd3[_0x654c('0x36')];if(!_0x2c39aa[_0x654c('0x37')]['hasOwnProperty'](_0x654c('0x3e'))){_0x303b91[_0x654c('0x3f')]=qs[_0x654c('0x3f')](_0x2c39aa['query'][_0x654c('0x3f')]);_0x303b91[_0x654c('0x1e')]=qs['offset'](_0x2c39aa[_0x654c('0x37')][_0x654c('0x1e')]);}_0x303b91['order']=qs['sort'](_0x2c39aa[_0x654c('0x37')][_0x654c('0x41')]);_0x303b91[_0x654c('0x42')]=qs[_0x654c('0x39')](_[_0x654c('0xb1')](_0x2c39aa['query'],_0x599bd3[_0x654c('0x39')]));_0x303b91[_0x654c('0x42')][_0x654c('0xa3')]=_0x443a70['id'];if(_0x2c39aa[_0x654c('0x37')][_0x654c('0x7e')]){_0x303b91[_0x654c('0x42')]=_[_0x654c('0xa9')](_0x303b91['where'],{'$or':_[_0x654c('0x30')](_0x303b91[_0x654c('0x3b')],function(_0x443275){var _0x21f89d={};_0x21f89d[_0x443275]={'$like':'%'+_0x2c39aa[_0x654c('0x37')][_0x654c('0x7e')]+'%'};return _0x21f89d;})});}if(_0x2c39aa['query'][_0x654c('0x75')]){var _0x9d04cc=_0x2c39aa['query'][_0x654c('0x75')][_0x654c('0x2d')](',');var _0x904ac7={};_0x904ac7[_0x9d04cc[0x0]]={'$gte':moment(_0x9d04cc[0x1])['format'](_0x654c('0xb2'))};_0x303b91['where']=_[_0x654c('0xa9')](_0x303b91[_0x654c('0x42')],_0x904ac7);}_0x303b91=_['merge']({},_0x303b91,_0x2c39aa[_0x654c('0xaa')]);return db[_0x654c('0xac')]['count']({'where':_0x303b91[_0x654c('0x42')]})[_0x654c('0x25')](function(_0x384a67){_0x93b076['count']=_0x384a67;if(_0x2c39aa[_0x654c('0x37')]['includeAll']){_0x303b91['include']=[{'all':!![]}];}return db[_0x654c('0xac')][_0x654c('0xb3')](_0x303b91);})[_0x654c('0x25')](function(_0x527e1a){_0x93b076[_0x654c('0xa4')]=_0x527e1a;return _0x93b076;});}})[_0x654c('0x25')](respondWithFilteredResult(_0x685aa8,_0x303b91))['catch'](handleError(_0x685aa8,null));};exports[_0x654c('0xb4')]=function(_0x34b46f,_0x57b88b,_0xdf6555){return db[_0x654c('0x31')][_0x654c('0x5b')]({'where':{'id':_0x34b46f['params']['id']}})['then'](handleEntityNotFound(_0x57b88b,null))[_0x654c('0x25')](function(_0x29bca0){if(_0x29bca0){return _0x29bca0['setTags'](_0x34b46f[_0x654c('0xab')][_0x654c('0xae')],_[_0x654c('0xad')](_0x34b46f[_0x654c('0xab')],[_0x654c('0xae'),'id'])||{})[_0x654c('0xb5')](function(){return db[_0x654c('0x68')][_0x654c('0xb3')]({'attributes':['id',_0x654c('0x27'),_0x654c('0x45')],'where':{'id':_0x34b46f[_0x654c('0xab')][_0x654c('0xae')]}});})[_0x654c('0x25')](function(_0x452025){socket[_0x654c('0xb6')](_0x654c('0xb7'),{'id':Number(_0x34b46f[_0x654c('0xa6')]['id']),'tags':_0x452025||[]});return{'id':Number(_0x34b46f[_0x654c('0xa6')]['id']),'tags':_0x452025||[]};});}})['then'](respondWithResult(_0x57b88b,null))[_0x654c('0x2f')](handleError(_0x57b88b,null));};exports[_0x654c('0xb8')]=function(_0x1f3cbd,_0x1274d7,_0x468125){return db[_0x654c('0x31')][_0x654c('0x5b')]({'where':{'id':_0x1f3cbd[_0x654c('0xa6')]['id']}})[_0x654c('0x25')](handleEntityNotFound(_0x1274d7,null))[_0x654c('0x25')](function(_0x4612a8){if(_0x4612a8){return _0x4612a8[_0x654c('0xb8')](_0x1f3cbd['query'][_0x654c('0xae')]);}})[_0x654c('0x25')](respondWithStatusCode(_0x1274d7,null))[_0x654c('0x2f')](handleError(_0x1274d7,null));};exports[_0x654c('0xb9')]=function(_0x176bf0,_0x166c11){var _0x31e242=moment()[_0x654c('0xba')]()[_0x654c('0x91')]();var _0x19ae74=path['join'](config['root'],_0x654c('0xbb'),_0x654c('0xbc'),_0x654c('0xbd'));var _0x357c6a=path[_0x654c('0xbe')](config[_0x654c('0xbf')],_0x654c('0xbb'),_0x654c('0xbc'),_0x654c('0xc0'));var _0x424761=path[_0x654c('0xbe')](_0x19ae74,_0x31e242);var _0x154fb5=util[_0x654c('0xc1')](_0x654c('0xc2'),_0x176bf0[_0x654c('0xa6')]['id'],_0x31e242);var _0x1ea67a=path[_0x654c('0xbe')](_0x19ae74,_0x154fb5);var _0x39a695=[];if(_0x176bf0[_0x654c('0x37')][_0x654c('0xc0')]){_0x39a695[_0x654c('0x2e')]({'model':db[_0x654c('0xc3')],'as':_0x654c('0xc4'),'raw':!![]});}var _0x3f4537=[{'model':db[_0x654c('0xac')],'as':'Messages','attributes':['id',_0x654c('0xab'),'createdAt'],'include':_0x39a695}];return db[_0x654c('0x31')][_0x654c('0x5b')]({'where':{'id':_0x176bf0[_0x654c('0xa6')]['id']},'include':_0x3f4537})['then'](handleEntityNotFound(_0x166c11,null))['then'](function(_0x3cae50){if(_0x3cae50&&_0x3cae50['Messages']){var _0x25344e=_0x3cae50[_0x654c('0xc5')]({'plain':!![]});fs[_0x654c('0xc6')](_0x424761);for(var _0x54fb96=0x0;_0x54fb96<_0x25344e['Messages'][_0x654c('0x3d')];_0x54fb96++){var _0x4f9726=_0x25344e['Messages'][_0x54fb96][_0x654c('0xc3')];if(_0x4f9726){var _0x3dbb6b=path[_0x654c('0xbe')](_0x357c6a,_0x4f9726['basename']);if(fs[_0x654c('0xc7')](_0x3dbb6b)){fs[_0x654c('0xc8')](_0x3dbb6b)[_0x654c('0xc9')](fs[_0x654c('0xca')](path[_0x654c('0xbe')](_0x424761,_0x4f9726['basename'])));}}}return BPromise[_0x654c('0xcb')]()[_0x654c('0x25')](function(){return new BPromise(function(_0x29f04e,_0x22fd4b){zipdir(_0x424761,{'saveTo':_0x1ea67a},function(_0x4477b4,_0x29d8fd){if(_0x4477b4)return _0x22fd4b(_0x4477b4);return _0x29f04e(_0x29d8fd);});})[_0x654c('0x25')](function(){return new BPromise(function(_0x31e2e7,_0x5cf650){rimraf(_0x424761,function(_0x4a286){if(_0x4a286)_0x5cf650(_0x4a286);return _0x31e2e7();});});})['then'](function(){return _0x166c11[_0x654c('0xb9')](_0x1ea67a,_0x154fb5,function(_0x1e0dc3){if(_0x1e0dc3){console[_0x654c('0xcc')]('err',_0x1e0dc3);}else{fs[_0x654c('0xcd')](_0x1ea67a);}});});});}else{return _0x166c11[_0x654c('0x1b')](0xc8);}})[_0x654c('0x2f')](handleError(_0x166c11,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index c93abbc..84b2d0e 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 _0x2ef3=['remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2ef3,0xba));var _0x32ef=function(_0x51b9fd,_0x34aaf1){_0x51b9fd=_0x51b9fd-0x0;var _0x2b1ea6=_0x2ef3[_0x51b9fd];return _0x2b1ea6;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var FaxInteraction=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var FaxMessage=require(_0x32ef('0x1'))['db'][_0x32ef('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ef('0x5'),'afterDestroy':_0x32ef('0x6')};function emitEvent(_0x524ab6){return function(_0x402857,_0x37dd1d,_0x4c8104){_0x402857['getUsers']({'attributes':['id'],'raw':!![]})[_0x32ef('0x7')](function(_0x4bfcf8){_0x402857[_0x32ef('0x8')](_0x32ef('0x9'),_0x4bfcf8[_0x32ef('0xa')](function(_0x298066){return{'id':_0x298066['id']};}));return FaxMessage[_0x32ef('0xb')]({'where':{'FaxInteractionId':_0x402857['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32ef('0x7')](function(_0x28275c){_0x402857[_0x32ef('0x8')]('unreadMessages',_0x28275c['length']);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6+':'+_0x402857['id'],_0x402857);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6,_0x402857);_0x4c8104(null);})[_0x32ef('0xd')](_0x4c8104(null));};}for(var e in events){if(events[_0x32ef('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32ef('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0xeef6df,_0x4d3102){var _0x59c387=function(_0x577ff1){while(--_0x577ff1){_0xeef6df['push'](_0xeef6df['shift']());}};_0x59c387(++_0x4d3102);}(_0xadb5,0xad));var _0x5adb=function(_0x51f470,_0x552331){_0x51f470=_0x51f470-0x0;var _0x18f2b0=_0xadb5[_0x51f470];return _0x18f2b0;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x5adb('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return FaxMessage[_0x5adb('0xa')]({'where':{'FaxInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);FaxInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);FaxInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index df3deab..a91835e 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 _0x5308=['request-promise','path','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird'];(function(_0x575489,_0x50e707){var _0x59a2c9=function(_0xde6e81){while(--_0xde6e81){_0x575489['push'](_0x575489['shift']());}};_0x59a2c9(++_0x50e707);}(_0x5308,0x1ec));var _0x8530=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0x5308[_0xfc0976];return _0x23579f;};'use strict';var _=require(_0x8530('0x0'));var util=require(_0x8530('0x1'));var logger=require('../../config/logger')(_0x8530('0x2'));var moment=require('moment');var BPromise=require(_0x8530('0x3'));var rp=require(_0x8530('0x4'));var fs=require('fs');var path=require(_0x8530('0x5'));var rimraf=require(_0x8530('0x6'));var config=require('../../config/environment');var attributes=require(_0x8530('0x7'));module['exports']=function(_0x274101,_0x30f47c){return _0x274101[_0x8530('0x8')](_0x8530('0x9'),attributes,{'tableName':_0x8530('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53688a,_0x3f2c2a,_0x202e07){if(_0x53688a[_0x8530('0xb')](_0x8530('0xc'))){_0x53688a[_0x8530('0xd')]=moment()[_0x8530('0xe')](_0x8530('0xf'));}_0x202e07(null,_0x53688a);}}});}; \ No newline at end of file +var _0x6b72=['exports','define','FaxInteraction','fax_interactions','closed','closedAt','format','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./faxInteraction.attributes'];(function(_0x45f800,_0x12c84c){var _0x112476=function(_0x31c751){while(--_0x31c751){_0x45f800['push'](_0x45f800['shift']());}};_0x112476(++_0x12c84c);}(_0x6b72,0x19d));var _0x26b7=function(_0x4d1990,_0x5f31c1){_0x4d1990=_0x4d1990-0x0;var _0x39d389=_0x6b72[_0x4d1990];return _0x39d389;};'use strict';var _=require(_0x26b7('0x0'));var util=require('util');var logger=require(_0x26b7('0x1'))(_0x26b7('0x2'));var moment=require('moment');var BPromise=require(_0x26b7('0x3'));var rp=require(_0x26b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x26b7('0x5'));var attributes=require(_0x26b7('0x6'));module[_0x26b7('0x7')]=function(_0x5bf038,_0x26ac11){return _0x5bf038[_0x26b7('0x8')](_0x26b7('0x9'),attributes,{'tableName':_0x26b7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x20eff5,_0x10c2b3,_0xc25a24){if(_0x20eff5['changed'](_0x26b7('0xb'))){_0x20eff5[_0x26b7('0xc')]=moment()[_0x26b7('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xc25a24(null,_0x20eff5);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index d19a2cb..be8a0e3 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 _0x5fab=['request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','update','options','raw','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s'];(function(_0x23cb3e,_0x1afcec){var _0x4977d9=function(_0x4004ba){while(--_0x4004ba){_0x23cb3e['push'](_0x23cb3e['shift']());}};_0x4977d9(++_0x1afcec);}(_0x5fab,0x157));var _0xb5fa=function(_0x2a2137,_0x280212){_0x2a2137=_0x2a2137-0x0;var _0x466f22=_0x5fab[_0x2a2137];return _0x466f22;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require(_0xb5fa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5fa('0x3'));var db=require(_0xb5fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5fa('0x5'));var config=require(_0xb5fa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb5fa('0x7')]['http']({'port':0x232a});config[_0xb5fa('0x8')]=_[_0xb5fa('0x9')](config[_0xb5fa('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5fa('0xa'))(new Redis(config[_0xb5fa('0x8')]));require(_0xb5fa('0xb'))[_0xb5fa('0xc')](socket);function respondWithRpcPromise(_0x253769,_0x440dac,_0x112d02){return new BPromise(function(_0x5ebd68,_0x1cfd2c){return client[_0xb5fa('0xd')](_0x253769,_0x112d02)[_0xb5fa('0xe')](function(_0x2bbd91){logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x440dac,_0xb5fa('0x11'));logger[_0xb5fa('0x12')](_0xb5fa('0x13'),_0x440dac,_0xb5fa('0x11'),JSON['stringify'](_0x2bbd91));if(_0x2bbd91[_0xb5fa('0x14')]){if(_0x2bbd91['error'][_0xb5fa('0x15')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x440dac,_0x2bbd91[_0xb5fa('0x14')]['message']);return _0x1cfd2c(_0x2bbd91[_0xb5fa('0x14')][_0xb5fa('0x16')]);}logger[_0xb5fa('0x14')](_0xb5fa('0x10'),_0x440dac,_0x2bbd91['error'][_0xb5fa('0x16')]);return _0x5ebd68(_0x2bbd91[_0xb5fa('0x14')][_0xb5fa('0x16')]);}else{logger[_0xb5fa('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x440dac,'request\x20sent');_0x5ebd68(_0x2bbd91[_0xb5fa('0x17')][_0xb5fa('0x16')]);}})[_0xb5fa('0x18')](function(_0x42a711){logger[_0xb5fa('0x14')](_0xb5fa('0x10'),_0x440dac,_0x42a711);_0x1cfd2c(_0x42a711);});});}exports[_0xb5fa('0x19')]=function(_0x5e4b2b){var _0x46327e=this;return new Promise(function(_0x1a39dd,_0x65a126){return db['FaxInteraction'][_0xb5fa('0x1a')](_0x5e4b2b['body'],{'raw':_0x5e4b2b['options']?_0x5e4b2b[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e4b2b[_0xb5fa('0x1b')]?_0x5e4b2b[_0xb5fa('0x1b')]['where']||null:null,'attributes':_0x5e4b2b[_0xb5fa('0x1b')]?_0x5e4b2b[_0xb5fa('0x1b')][_0xb5fa('0x1d')]||null:null,'limit':_0x5e4b2b[_0xb5fa('0x1b')]?_0x5e4b2b[_0xb5fa('0x1b')][_0xb5fa('0x1e')]||null:null})['then'](function(_0x48e27f){logger[_0xb5fa('0xf')](_0xb5fa('0x19'),_0x5e4b2b);logger['debug'](_0xb5fa('0x19'),_0x5e4b2b,JSON[_0xb5fa('0x1f')](_0x48e27f));_0x1a39dd(_0x48e27f);})[_0xb5fa('0x18')](function(_0x242a93){logger[_0xb5fa('0x14')](_0xb5fa('0x19'),_0x242a93['message'],_0x5e4b2b);_0x65a126(_0x46327e[_0xb5fa('0x14')](0x1f4,_0x242a93[_0xb5fa('0x16')]));});});};exports[_0xb5fa('0x20')]=function(_0x221a41){return new Promise(function(_0x1bc901,_0x5c6eaf){return db['FaxInteraction'][_0xb5fa('0x21')]({'where':_0x221a41[_0xb5fa('0x1b')]?_0x221a41[_0xb5fa('0x1b')]['where']||null:null})[_0xb5fa('0xe')](function(_0x8dae34){if(_0x8dae34){return _0x8dae34[_0xb5fa('0x22')](_0x221a41['body'][_0xb5fa('0x23')],_[_0xb5fa('0x24')](_0x221a41[_0xb5fa('0x25')],[_0xb5fa('0x23'),'id'])||{});}})[_0xb5fa('0x26')](function(_0x3a607a){logger[_0xb5fa('0xf')]('AddTags',_0x221a41);logger[_0xb5fa('0x12')](_0xb5fa('0x27'),_0x221a41,JSON[_0xb5fa('0x1f')](_0x3a607a));_0x1bc901(_0x3a607a);})[_0xb5fa('0x18')](function(_0x5658b6){logger['error'](_0xb5fa('0x27'),_0x5658b6[_0xb5fa('0x16')],_0x221a41);_0x5c6eaf(_this[_0xb5fa('0x14')](0x1f4,_0x5658b6[_0xb5fa('0x16')]));});});}; \ No newline at end of file +var _0x7829=['ids','AddTags','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','request','then','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','body','options','raw','attributes','limit','debug','AddTagsToFaxInteraction','FaxInteraction','find','where','addTags'];(function(_0x285ca5,_0x1f3401){var _0x2113ee=function(_0x20f3b6){while(--_0x20f3b6){_0x285ca5['push'](_0x285ca5['shift']());}};_0x2113ee(++_0x1f3401);}(_0x7829,0x14a));var _0x9782=function(_0x35fb5f,_0x5167dc){_0x35fb5f=_0x35fb5f-0x0;var _0x202893=_0x7829[_0x35fb5f];return _0x202893;};'use strict';var _=require('lodash');var util=require(_0x9782('0x0'));var moment=require(_0x9782('0x1'));var BPromise=require(_0x9782('0x2'));var rs=require(_0x9782('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9782('0x4'));var logger=require(_0x9782('0x5'))(_0x9782('0x6'));var config=require(_0x9782('0x7'));var jayson=require(_0x9782('0x8'));var client=jayson['client'][_0x9782('0x9')]({'port':0x232a});config['redis']=_[_0x9782('0xa')](config[_0x9782('0xb')],{'host':_0x9782('0xc'),'port':0x18eb});var socket=require(_0x9782('0xd'))(new Redis(config['redis']));require(_0x9782('0xe'))['register'](socket);function respondWithRpcPromise(_0x538a99,_0x3f4f06,_0x10040f){return new BPromise(function(_0xec2e54,_0x5c8c79){return client[_0x9782('0xf')](_0x538a99,_0x10040f)[_0x9782('0x10')](function(_0x1d53aa){logger[_0x9782('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x3f4f06,_0x9782('0x12'));logger['debug'](_0x9782('0x13'),_0x3f4f06,'request\x20sent',JSON[_0x9782('0x14')](_0x1d53aa));if(_0x1d53aa[_0x9782('0x15')]){if(_0x1d53aa[_0x9782('0x15')][_0x9782('0x16')]===0x1f4){logger[_0x9782('0x15')](_0x9782('0x17'),_0x3f4f06,_0x1d53aa[_0x9782('0x15')]['message']);return _0x5c8c79(_0x1d53aa[_0x9782('0x15')]['message']);}logger[_0x9782('0x15')](_0x9782('0x17'),_0x3f4f06,_0x1d53aa['error'][_0x9782('0x18')]);return _0xec2e54(_0x1d53aa['error'][_0x9782('0x18')]);}else{logger[_0x9782('0x11')](_0x9782('0x17'),_0x3f4f06,_0x9782('0x12'));_0xec2e54(_0x1d53aa[_0x9782('0x19')][_0x9782('0x18')]);}})[_0x9782('0x1a')](function(_0x3e2de1){logger['error'](_0x9782('0x17'),_0x3f4f06,_0x3e2de1);_0x5c8c79(_0x3e2de1);});});}exports[_0x9782('0x1b')]=function(_0x3ec342){var _0x475d21=this;return new Promise(function(_0x5228b3,_0x14abe7){return db['FaxInteraction']['update'](_0x3ec342[_0x9782('0x1c')],{'raw':_0x3ec342[_0x9782('0x1d')]?_0x3ec342[_0x9782('0x1d')][_0x9782('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ec342[_0x9782('0x1d')]?_0x3ec342[_0x9782('0x1d')]['where']||null:null,'attributes':_0x3ec342[_0x9782('0x1d')]?_0x3ec342[_0x9782('0x1d')][_0x9782('0x1f')]||null:null,'limit':_0x3ec342[_0x9782('0x1d')]?_0x3ec342[_0x9782('0x1d')][_0x9782('0x20')]||null:null})['then'](function(_0x4d74f7){logger['info'](_0x9782('0x1b'),_0x3ec342);logger[_0x9782('0x21')]('UpdateFaxInteraction',_0x3ec342,JSON[_0x9782('0x14')](_0x4d74f7));_0x5228b3(_0x4d74f7);})[_0x9782('0x1a')](function(_0x23be30){logger[_0x9782('0x15')](_0x9782('0x1b'),_0x23be30[_0x9782('0x18')],_0x3ec342);_0x14abe7(_0x475d21[_0x9782('0x15')](0x1f4,_0x23be30[_0x9782('0x18')]));});});};exports[_0x9782('0x22')]=function(_0x22ffdc){return new Promise(function(_0x5b97c1,_0x543bcf){return db[_0x9782('0x23')][_0x9782('0x24')]({'where':_0x22ffdc[_0x9782('0x1d')]?_0x22ffdc[_0x9782('0x1d')][_0x9782('0x25')]||null:null})[_0x9782('0x10')](function(_0x5c3e4e){if(_0x5c3e4e){return _0x5c3e4e[_0x9782('0x26')](_0x22ffdc[_0x9782('0x1c')][_0x9782('0x27')],_['omit'](_0x22ffdc[_0x9782('0x1c')],[_0x9782('0x27'),'id'])||{});}})['spread'](function(_0x46eaed){logger[_0x9782('0x11')]('AddTags',_0x22ffdc);logger['debug'](_0x9782('0x28'),_0x22ffdc,JSON[_0x9782('0x14')](_0x46eaed));_0x5b97c1(_0x46eaed);})['catch'](function(_0x593466){logger[_0x9782('0x15')](_0x9782('0x28'),_0x593466[_0x9782('0x18')],_0x22ffdc);_0x543bcf(_this[_0x9782('0x15')](0x1f4,_0x593466[_0x9782('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index df3228d..246daff 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 _0x7533=['register','faxInteraction:','./faxInteraction.events','update','emit','removeListener'];(function(_0x14bc4b,_0x5607b3){var _0x206f9a=function(_0x55c798){while(--_0x55c798){_0x14bc4b['push'](_0x14bc4b['shift']());}};_0x206f9a(++_0x5607b3);}(_0x7533,0xd4));var _0x3753=function(_0x281dbb,_0x147d85){_0x281dbb=_0x281dbb-0x0;var _0x3c3690=_0x7533[_0x281dbb];return _0x3c3690;};'use strict';var FaxInteractionEvents=require(_0x3753('0x0'));var events=['save','remove',_0x3753('0x1')];function createListener(_0xcf983f,_0x5742b6){return function(_0x6bbb2d){_0x5742b6[_0x3753('0x2')](_0xcf983f,_0x6bbb2d);};}function removeListener(_0x69e14e,_0x3440fc){return function(){FaxInteractionEvents[_0x3753('0x3')](_0x69e14e,_0x3440fc);};}exports[_0x3753('0x4')]=function(_0x2d2e59){for(var _0x3c055d=0x0,_0x2602b7=events['length'];_0x3c055d<_0x2602b7;_0x3c055d++){var _0x4e2b79=events[_0x3c055d];var _0x43e6c7=createListener(_0x3753('0x5')+_0x4e2b79,_0x2d2e59);FaxInteractionEvents['on'](_0x4e2b79,_0x43e6c7);}}; \ No newline at end of file +var _0xefc3=['removeListener','register','length','faxInteraction:','./faxInteraction.events','remove','update','emit'];(function(_0x270880,_0x2968e6){var _0x50cfe1=function(_0x1e5531){while(--_0x1e5531){_0x270880['push'](_0x270880['shift']());}};_0x50cfe1(++_0x2968e6);}(_0xefc3,0x1a4));var _0x3efc=function(_0x56f222,_0x140eb6){_0x56f222=_0x56f222-0x0;var _0x3d27dc=_0xefc3[_0x56f222];return _0x3d27dc;};'use strict';var FaxInteractionEvents=require(_0x3efc('0x0'));var events=['save',_0x3efc('0x1'),_0x3efc('0x2')];function createListener(_0x53c212,_0x1a3639){return function(_0x221ab0){_0x1a3639[_0x3efc('0x3')](_0x53c212,_0x221ab0);};}function removeListener(_0x5c2afe,_0xff2586){return function(){FaxInteractionEvents[_0x3efc('0x4')](_0x5c2afe,_0xff2586);};}exports[_0x3efc('0x5')]=function(_0x305eff){for(var _0x5db2d1=0x0,_0x12b671=events[_0x3efc('0x6')];_0x5db2d1<_0x12b671;_0x5db2d1++){var _0x2f6c7a=events[_0x5db2d1];var _0x513cef=createListener(_0x3efc('0x7')+_0x2f6c7a,_0x305eff);FaxInteractionEvents['on'](_0x2f6c7a,_0x513cef);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index f97b36a..e19b876 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 _0x7c17=['/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','post','addMessage'];(function(_0x1684de,_0x3fad06){var _0x568dd9=function(_0x2432eb){while(--_0x2432eb){_0x1684de['push'](_0x1684de['shift']());}};_0x568dd9(++_0x3fad06);}(_0x7c17,0x104));var _0x77c1=function(_0x1dd033,_0x1ddaba){_0x1dd033=_0x1dd033-0x0;var _0x1c1f37=_0x7c17[_0x1dd033];return _0x1c1f37;};'use strict';var multer=require(_0x77c1('0x0'));var util=require(_0x77c1('0x1'));var path=require(_0x77c1('0x2'));var timeout=require(_0x77c1('0x3'));var express=require(_0x77c1('0x4'));var router=express[_0x77c1('0x5')]();var auth=require(_0x77c1('0x6'));var interaction=require(_0x77c1('0x7'));var config=require('../../config/environment');var controller=require(_0x77c1('0x8'));router[_0x77c1('0x9')]('/',auth[_0x77c1('0xa')](),controller[_0x77c1('0xb')]);router[_0x77c1('0x9')](_0x77c1('0xc'),auth[_0x77c1('0xa')](),controller[_0x77c1('0xd')]);router[_0x77c1('0x9')](_0x77c1('0xe'),auth[_0x77c1('0xa')](),controller['show']);router[_0x77c1('0x9')](_0x77c1('0xf'),auth[_0x77c1('0xa')](),controller[_0x77c1('0x10')]);router[_0x77c1('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x77c1('0x11')]('/',auth[_0x77c1('0xa')](),controller['create']);router[_0x77c1('0x11')](_0x77c1('0xf'),auth['isAuthenticated'](),controller[_0x77c1('0x12')]);router[_0x77c1('0x11')](_0x77c1('0x13'),auth[_0x77c1('0xa')](),interaction[_0x77c1('0x14')](_0x77c1('0x15'),_0x77c1('0x16')),controller[_0x77c1('0x17')]);router[_0x77c1('0x18')](_0x77c1('0xe'),auth[_0x77c1('0xa')](),interaction['tracked']('fax',_0x77c1('0x19')),controller[_0x77c1('0x1a')]);router[_0x77c1('0x1b')](_0x77c1('0xe'),auth[_0x77c1('0xa')](),interaction[_0x77c1('0x14')](_0x77c1('0x15'),_0x77c1('0x1c')),controller['destroy']);router[_0x77c1('0x1b')](_0x77c1('0x13'),auth[_0x77c1('0xa')](),controller[_0x77c1('0x1d')]);module[_0x77c1('0x1e')]=router; \ No newline at end of file +var _0x2242=['getMessages','/:id/download','download','create','post','/:id/tags','fax','faxinteraction:addtags','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0x2242,0x1a3));var _0x2224=function(_0x45862d,_0x5dd715){_0x45862d=_0x45862d-0x0;var _0x168673=_0x2242[_0x45862d];return _0x168673;};'use strict';var multer=require(_0x2224('0x0'));var util=require(_0x2224('0x1'));var path=require(_0x2224('0x2'));var timeout=require('connect-timeout');var express=require(_0x2224('0x3'));var router=express[_0x2224('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2224('0x5'));var config=require(_0x2224('0x6'));var controller=require('./faxInteraction.controller');router[_0x2224('0x7')]('/',auth[_0x2224('0x8')](),controller[_0x2224('0x9')]);router['get'](_0x2224('0xa'),auth[_0x2224('0x8')](),controller[_0x2224('0xb')]);router[_0x2224('0x7')](_0x2224('0xc'),auth[_0x2224('0x8')](),controller[_0x2224('0xd')]);router[_0x2224('0x7')](_0x2224('0xe'),auth[_0x2224('0x8')](),controller[_0x2224('0xf')]);router[_0x2224('0x7')](_0x2224('0x10'),auth[_0x2224('0x8')](),controller[_0x2224('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2224('0x12')]);router[_0x2224('0x13')](_0x2224('0xe'),auth[_0x2224('0x8')](),controller['addMessage']);router[_0x2224('0x13')](_0x2224('0x14'),auth['isAuthenticated'](),interaction['tracked'](_0x2224('0x15'),_0x2224('0x16')),controller['addTags']);router['put'](_0x2224('0xc'),auth[_0x2224('0x8')](),interaction[_0x2224('0x17')](_0x2224('0x15'),_0x2224('0x18')),controller[_0x2224('0x19')]);router[_0x2224('0x1a')](_0x2224('0xc'),auth['isAuthenticated'](),interaction[_0x2224('0x17')](_0x2224('0x15'),_0x2224('0x1b')),controller[_0x2224('0x1c')]);router[_0x2224('0x1a')](_0x2224('0x14'),auth[_0x2224('0x8')](),controller[_0x2224('0x1d')]);module[_0x2224('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 4057d71..34009f2 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 _0xa14c=['ENUM','out','exports','TEXT','medium','BOOLEAN'];(function(_0x27a900,_0x1cc305){var _0xea9b1f=function(_0xaddd55){while(--_0xaddd55){_0x27a900['push'](_0x27a900['shift']());}};_0xea9b1f(++_0x1cc305);}(_0xa14c,0x188));var _0xca14=function(_0x2a5447,_0x115256){_0x2a5447=_0x2a5447-0x0;var _0x3c097b=_0xa14c[_0x2a5447];return _0x3c097b;};'use strict';var Sequelize=require('sequelize');module[_0xca14('0x0')]={'body':{'type':Sequelize[_0xca14('0x1')](_0xca14('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xca14('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xca14('0x4')]('in',_0xca14('0x5')),'defaultValue':_0xca14('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xca14('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xf258=['DATE','sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x484f3d,_0x34f8a6){var _0x18af14=function(_0x1e7269){while(--_0x1e7269){_0x484f3d['push'](_0x484f3d['shift']());}};_0x18af14(++_0x34f8a6);}(_0xf258,0xe8));var _0x8f25=function(_0x4de665,_0x29f36a){_0x4de665=_0x4de665-0x0;var _0x2dec4a=_0xf258[_0x4de665];return _0x2dec4a;};'use strict';var Sequelize=require(_0x8f25('0x0'));module[_0x8f25('0x1')]={'body':{'type':Sequelize[_0x8f25('0x2')](_0x8f25('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x8f25('0x4')]('in',_0x8f25('0x5')),'defaultValue':_0x8f25('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x8f25('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x8f25('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index e22d9a5..86fc3c9 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 _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x398cbc,_0x3049b3){var _0x4ca554=function(_0x245f47){while(--_0x245f47){_0x398cbc['push'](_0x398cbc['shift']());}};_0x4ca554(++_0x3049b3);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ae06f,_0x5b7a6c){_0x1ae06f=_0x1ae06f-0x0;var _0x429688=_0xb10b[_0x1ae06f];return _0x429688;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e813ccb..26338d9 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x16b962,_0x1e8b75){var _0x5b8877=function(_0x451ea6){while(--_0x451ea6){_0x16b962['push'](_0x16b962['shift']());}};_0x5b8877(++_0x1e8b75);}(_0x7217,0x19e));var _0x7721=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7217[_0x36dfbd];return _0x4ecad9;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x353313,_0x5c3686){var _0x4cb750=function(_0x17ac7e){while(--_0x17ac7e){_0x353313['push'](_0x353313['shift']());}};_0x4cb750(++_0x5c3686);}(_0x7217,0x19e));var _0x7721=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x7217[_0x34bf97];return _0x292719;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 27eff2b..e33c76b 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 _0xa246=['then','update','catch','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x166e1d,_0x2bde2a){var _0x23d5b3=function(_0x2483d5){while(--_0x2483d5){_0x166e1d['push'](_0x166e1d['shift']());}};_0x23d5b3(++_0x2bde2a);}(_0xa246,0xfd));var _0x6a24=function(_0x1eba0d,_0x10c68c){_0x1eba0d=_0x1eba0d-0x0;var _0x3a955e=_0xa246[_0x1eba0d];return _0x3a955e;};'use strict';var _=require(_0x6a24('0x0'));var util=require(_0x6a24('0x1'));var logger=require(_0x6a24('0x2'))('api');var moment=require(_0x6a24('0x3'));var BPromise=require(_0x6a24('0x4'));var rp=require(_0x6a24('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a24('0x6'));var config=require(_0x6a24('0x7'));var attributes=require(_0x6a24('0x8'));module[_0x6a24('0x9')]=function(_0x4ca654,_0x522ed2){return _0x4ca654[_0x6a24('0xa')](_0x6a24('0xb'),attributes,{'tableName':_0x6a24('0xc'),'paranoid':![],'indexes':[{'name':_0x6a24('0xd'),'fields':[_0x6a24('0xe')],'type':_0x6a24('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41a213,_0x31be71,_0x1eb7d4){var _0x52520b=_0x4ca654[_0x6a24('0x10')];var _0x2a464d=_0x41a213['get']({'plain':!![]});if(_0x2a464d[_0x6a24('0x11')][_0x6a24('0x12')]()==='in'||_0x2a464d[_0x6a24('0x11')][_0x6a24('0x12')]()===_0x6a24('0x13')&&!_0x2a464d[_0x6a24('0x14')]&&!_[_0x6a24('0x15')](_0x2a464d[_0x6a24('0x16')])){_0x52520b[_0x6a24('0x17')][_0x6a24('0x18')]({'where':{'id':_0x2a464d[_0x6a24('0x19')]}})[_0x6a24('0x1a')](function(_0x48a6c0){if(_0x48a6c0){_0x48a6c0[_0x6a24('0x1b')]({'lastMsgAt':_0x2a464d['createdAt'],'lastMsgDirection':_0x2a464d[_0x6a24('0x11')][_0x6a24('0x12')]()});}})[_0x6a24('0x1c')](function(_0x1ec437){console[_0x6a24('0x1d')](_0x1ec437);});}_0x1eb7d4();}},'charset':_0x6a24('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9170=['createdAt','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','FaxMessage','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','FaxInteraction','findOne','then','update'];(function(_0x4687a1,_0xef0c9f){var _0x34adba=function(_0x44181e){while(--_0x44181e){_0x4687a1['push'](_0x4687a1['shift']());}};_0x34adba(++_0xef0c9f);}(_0x9170,0x111));var _0x0917=function(_0x32dd5a,_0x28257b){_0x32dd5a=_0x32dd5a-0x0;var _0x4fa42a=_0x9170[_0x32dd5a];return _0x4fa42a;};'use strict';var _=require(_0x0917('0x0'));var util=require(_0x0917('0x1'));var logger=require(_0x0917('0x2'))('api');var moment=require(_0x0917('0x3'));var BPromise=require(_0x0917('0x4'));var rp=require(_0x0917('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0917('0x6'));var config=require(_0x0917('0x7'));var attributes=require('./faxMessage.attributes');module[_0x0917('0x8')]=function(_0x1c5491,_0x580ef0){return _0x1c5491['define'](_0x0917('0x9'),attributes,{'tableName':_0x0917('0xa'),'paranoid':![],'indexes':[{'name':_0x0917('0xb'),'fields':[_0x0917('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5a4c61,_0x21360d,_0x3aefa8){var _0x344375=_0x1c5491[_0x0917('0xd')];var _0x278be5=_0x5a4c61[_0x0917('0xe')]({'plain':!![]});if(_0x278be5['direction'][_0x0917('0xf')]()==='in'||_0x278be5[_0x0917('0x10')][_0x0917('0xf')]()==='out'&&!_0x278be5[_0x0917('0x11')]&&!_[_0x0917('0x12')](_0x278be5[_0x0917('0x13')])){_0x344375[_0x0917('0x14')][_0x0917('0x15')]({'where':{'id':_0x278be5['FaxInteractionId']}})[_0x0917('0x16')](function(_0x132eea){if(_0x132eea){_0x132eea[_0x0917('0x17')]({'lastMsgAt':_0x278be5[_0x0917('0x18')],'lastMsgDirection':_0x278be5[_0x0917('0x10')][_0x0917('0xf')]()});}})['catch'](function(_0x301407){console[_0x0917('0x19')](_0x301407);});}_0x3aefa8();}},'charset':_0x0917('0x1a'),'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 861cf76..531aeb1 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 _0x8c99=['options','raw','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x52d87c,_0x4db9f7){var _0x2f1ae5=function(_0x691877){while(--_0x691877){_0x52d87c['push'](_0x52d87c['shift']());}};_0x2f1ae5(++_0x4db9f7);}(_0x8c99,0x1a8));var _0x98c9=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0x8c99[_0x46ec32];return _0x338f60;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var moment=require(_0x98c9('0x2'));var BPromise=require(_0x98c9('0x3'));var rs=require(_0x98c9('0x4'));var fs=require('fs');var Redis=require(_0x98c9('0x5'));var db=require(_0x98c9('0x6'))['db'];var utils=require(_0x98c9('0x7'));var logger=require(_0x98c9('0x8'))(_0x98c9('0x9'));var config=require(_0x98c9('0xa'));var jayson=require(_0x98c9('0xb'));var client=jayson['client'][_0x98c9('0xc')]({'port':0x232a});config[_0x98c9('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x98c9('0xe'))(new Redis(config[_0x98c9('0xd')]));require(_0x98c9('0xf'))[_0x98c9('0x10')](socket);function respondWithRpcPromise(_0x454c51,_0x598a27,_0x2e5914){return new BPromise(function(_0xa4762,_0x19f0f0){return client[_0x98c9('0x11')](_0x454c51,_0x2e5914)[_0x98c9('0x12')](function(_0x4b05ea){logger[_0x98c9('0x13')](_0x98c9('0x14'),_0x598a27,_0x98c9('0x15'));logger[_0x98c9('0x16')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x598a27,_0x98c9('0x15'),JSON[_0x98c9('0x17')](_0x4b05ea));if(_0x4b05ea[_0x98c9('0x18')]){if(_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x19')]===0x1f4){logger['error'](_0x98c9('0x14'),_0x598a27,_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);return _0x19f0f0(_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);}logger[_0x98c9('0x18')](_0x98c9('0x14'),_0x598a27,_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);return _0xa4762(_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);}else{logger[_0x98c9('0x13')](_0x98c9('0x14'),_0x598a27,_0x98c9('0x15'));_0xa4762(_0x4b05ea['result'][_0x98c9('0x1a')]);}})[_0x98c9('0x1b')](function(_0x51189d){logger[_0x98c9('0x18')]('FaxMessage,\x20%s,\x20%s',_0x598a27,_0x51189d);_0x19f0f0(_0x51189d);});});}exports[_0x98c9('0x1c')]=function(_0x1d398d){var _0xa7c2a4=this;return new Promise(function(_0x208f3f,_0x568774){return db[_0x98c9('0x1d')][_0x98c9('0x1e')](_0x1d398d[_0x98c9('0x1f')],{'raw':_0x1d398d[_0x98c9('0x20')]?_0x1d398d['options'][_0x98c9('0x21')]===undefined?!![]:![]:!![]})[_0x98c9('0x12')](function(_0x18bd33){logger[_0x98c9('0x13')]('CreateFaxMessage',_0x1d398d);logger['debug'](_0x98c9('0x1c'),_0x1d398d,JSON[_0x98c9('0x17')](_0x18bd33));_0x208f3f(_0x18bd33);})[_0x98c9('0x1b')](function(_0x52fe03){logger['error']('CreateFaxMessage',_0x52fe03[_0x98c9('0x1a')],_0x1d398d);_0x568774(_0xa7c2a4[_0x98c9('0x18')](0x1f4,_0x52fe03['message']));});});};exports[_0x98c9('0x22')]=function(_0x2b3562){var _0x3dcc89=this;return new Promise(function(_0x10cde2,_0x3f503a){return db[_0x98c9('0x1d')]['update'](_0x2b3562[_0x98c9('0x1f')],{'raw':_0x2b3562[_0x98c9('0x20')]?_0x2b3562[_0x98c9('0x20')][_0x98c9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b3562[_0x98c9('0x20')]?_0x2b3562['options'][_0x98c9('0x23')]||null:null,'attributes':_0x2b3562[_0x98c9('0x20')]?_0x2b3562['options'][_0x98c9('0x24')]||null:null,'limit':_0x2b3562['options']?_0x2b3562['options'][_0x98c9('0x25')]||null:null})['then'](function(_0x8a9764){logger[_0x98c9('0x13')](_0x98c9('0x22'),_0x2b3562);logger[_0x98c9('0x16')](_0x98c9('0x22'),_0x2b3562,JSON['stringify'](_0x8a9764));_0x10cde2(_0x8a9764);})['catch'](function(_0xd72eb5){logger[_0x98c9('0x18')]('UpdateFaxMessage',_0xd72eb5[_0x98c9('0x1a')],_0x2b3562);_0x3f503a(_0x3dcc89[_0x98c9('0x18')](0x1f4,_0xd72eb5[_0x98c9('0x1a')]));});});}; \ No newline at end of file +var _0x7b63=['then','stringify','UpdateFaxMessage','FaxMessage','where','attributes','limit','lodash','bluebird','randomstring','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateFaxMessage','create','body','options','raw'];(function(_0x2cf27c,_0x270d13){var _0x450e85=function(_0x3b3bde){while(--_0x3b3bde){_0x2cf27c['push'](_0x2cf27c['shift']());}};_0x450e85(++_0x270d13);}(_0x7b63,0xac));var _0x37b6=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x7b63[_0x5ac84c];return _0x3c53d2;};'use strict';var _=require(_0x37b6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x37b6('0x1'));var rs=require(_0x37b6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x37b6('0x3'))(_0x37b6('0x4'));var config=require('../../config/environment');var jayson=require(_0x37b6('0x5'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x37b6('0x6')](config[_0x37b6('0x7')],{'host':_0x37b6('0x8'),'port':0x18eb});var socket=require(_0x37b6('0x9'))(new Redis(config[_0x37b6('0x7')]));require(_0x37b6('0xa'))['register'](socket);function respondWithRpcPromise(_0x3383d8,_0x559194,_0x304efd){return new BPromise(function(_0x25e6b8,_0x20b368){return client['request'](_0x3383d8,_0x304efd)['then'](function(_0x1b3c75){logger[_0x37b6('0xb')](_0x37b6('0xc'),_0x559194,_0x37b6('0xd'));logger[_0x37b6('0xe')](_0x37b6('0xf'),_0x559194,_0x37b6('0xd'),JSON['stringify'](_0x1b3c75));if(_0x1b3c75[_0x37b6('0x10')]){if(_0x1b3c75[_0x37b6('0x10')][_0x37b6('0x11')]===0x1f4){logger['error'](_0x37b6('0xc'),_0x559194,_0x1b3c75['error'][_0x37b6('0x12')]);return _0x20b368(_0x1b3c75[_0x37b6('0x10')][_0x37b6('0x12')]);}logger[_0x37b6('0x10')](_0x37b6('0xc'),_0x559194,_0x1b3c75[_0x37b6('0x10')][_0x37b6('0x12')]);return _0x25e6b8(_0x1b3c75[_0x37b6('0x10')][_0x37b6('0x12')]);}else{logger[_0x37b6('0xb')]('FaxMessage,\x20%s,\x20%s',_0x559194,'request\x20sent');_0x25e6b8(_0x1b3c75[_0x37b6('0x13')][_0x37b6('0x12')]);}})[_0x37b6('0x14')](function(_0x4ba1b0){logger[_0x37b6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x559194,_0x4ba1b0);_0x20b368(_0x4ba1b0);});});}exports[_0x37b6('0x15')]=function(_0x1d6cc5){var _0xa2688d=this;return new Promise(function(_0x2a87c8,_0x14732f){return db['FaxMessage'][_0x37b6('0x16')](_0x1d6cc5[_0x37b6('0x17')],{'raw':_0x1d6cc5['options']?_0x1d6cc5[_0x37b6('0x18')][_0x37b6('0x19')]===undefined?!![]:![]:!![]})[_0x37b6('0x1a')](function(_0x303496){logger[_0x37b6('0xb')](_0x37b6('0x15'),_0x1d6cc5);logger['debug']('CreateFaxMessage',_0x1d6cc5,JSON[_0x37b6('0x1b')](_0x303496));_0x2a87c8(_0x303496);})[_0x37b6('0x14')](function(_0x1d7ac0){logger['error'](_0x37b6('0x15'),_0x1d7ac0[_0x37b6('0x12')],_0x1d6cc5);_0x14732f(_0xa2688d[_0x37b6('0x10')](0x1f4,_0x1d7ac0[_0x37b6('0x12')]));});});};exports[_0x37b6('0x1c')]=function(_0x35f935){var _0x50f051=this;return new Promise(function(_0x924a9c,_0x31e143){return db[_0x37b6('0x1d')]['update'](_0x35f935['body'],{'raw':_0x35f935[_0x37b6('0x18')]?_0x35f935[_0x37b6('0x18')][_0x37b6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35f935[_0x37b6('0x18')]?_0x35f935[_0x37b6('0x18')][_0x37b6('0x1e')]||null:null,'attributes':_0x35f935[_0x37b6('0x18')]?_0x35f935[_0x37b6('0x18')][_0x37b6('0x1f')]||null:null,'limit':_0x35f935['options']?_0x35f935['options'][_0x37b6('0x20')]||null:null})['then'](function(_0xaf81b8){logger[_0x37b6('0xb')](_0x37b6('0x1c'),_0x35f935);logger[_0x37b6('0xe')]('UpdateFaxMessage',_0x35f935,JSON[_0x37b6('0x1b')](_0xaf81b8));_0x924a9c(_0xaf81b8);})[_0x37b6('0x14')](function(_0xab63ee){logger['error'](_0x37b6('0x1c'),_0xab63ee[_0x37b6('0x12')],_0x35f935);_0x31e143(_0x50f051['error'](0x1f4,_0xab63ee[_0x37b6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 607eae6..bb1b582 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 _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x5a1cc9,_0x28f54d){var _0x471761=function(_0xda51c0){while(--_0xda51c0){_0x5a1cc9['push'](_0x5a1cc9['shift']());}};_0x471761(++_0x28f54d);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 3b543fb..d4e4c3a 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 _0xe260=['tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe260,0x6e));var _0x0e26=function(_0x2846bb,_0x5280d1){_0x2846bb=_0x2846bb-0x0;var _0x19f087=_0xe260[_0x2846bb];return _0x19f087;};'use strict';var multer=require('multer');var util=require(_0x0e26('0x0'));var path=require(_0x0e26('0x1'));var timeout=require(_0x0e26('0x2'));var express=require(_0x0e26('0x3'));var router=express[_0x0e26('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0e26('0x5'));var config=require('../../config/environment');var controller=require(_0x0e26('0x6'));router[_0x0e26('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0e26('0x8'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xa')]);router[_0x0e26('0x7')](_0x0e26('0xb'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xc')]);router[_0x0e26('0x7')](_0x0e26('0xd'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xe')]);router['post']('/',auth[_0x0e26('0x9')](),interaction[_0x0e26('0xf')](_0x0e26('0x10'),'faxmessage:create'),controller[_0x0e26('0x11')]);router[_0x0e26('0x12')](_0x0e26('0xb'),auth[_0x0e26('0x9')](),controller[_0x0e26('0x13')]);router[_0x0e26('0x12')](_0x0e26('0x14'),auth[_0x0e26('0x9')](),controller[_0x0e26('0x15')]);router[_0x0e26('0x12')](_0x0e26('0x16'),auth[_0x0e26('0x9')](),controller['reject']);router[_0x0e26('0x17')](_0x0e26('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x0e26('0x18')]=router; \ No newline at end of file +var _0xff83=['/:id','isAuthenticated','show','download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','describe','get'];(function(_0x306734,_0x4cf545){var _0x234cd6=function(_0x4c06bf){while(--_0x4c06bf){_0x306734['push'](_0x306734['shift']());}};_0x234cd6(++_0x4cf545);}(_0xff83,0x98));var _0x3ff8=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xff83[_0x2bf141];return _0x48277b;};'use strict';var multer=require('multer');var util=require(_0x3ff8('0x0'));var path=require(_0x3ff8('0x1'));var timeout=require(_0x3ff8('0x2'));var express=require(_0x3ff8('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x3ff8('0x4'));var config=require(_0x3ff8('0x5'));var controller=require(_0x3ff8('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x3ff8('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3ff8('0x8')]);router[_0x3ff8('0x9')](_0x3ff8('0xa'),auth[_0x3ff8('0xb')](),controller[_0x3ff8('0xc')]);router[_0x3ff8('0x9')]('/:id/download',auth[_0x3ff8('0xb')](),controller[_0x3ff8('0xd')]);router[_0x3ff8('0xe')]('/',auth[_0x3ff8('0xb')](),interaction[_0x3ff8('0xf')](_0x3ff8('0x10'),_0x3ff8('0x11')),controller['create']);router[_0x3ff8('0x12')]('/:id',auth[_0x3ff8('0xb')](),controller[_0x3ff8('0x13')]);router[_0x3ff8('0x12')](_0x3ff8('0x14'),auth[_0x3ff8('0xb')](),controller[_0x3ff8('0x15')]);router[_0x3ff8('0x12')](_0x3ff8('0x16'),auth[_0x3ff8('0xb')](),controller[_0x3ff8('0x17')]);router[_0x3ff8('0x18')](_0x3ff8('0xa'),auth[_0x3ff8('0xb')](),controller[_0x3ff8('0x19')]);module[_0x3ff8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 9607924..70adc13 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 _0xd0f9=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x55882f,_0x1ecff4){var _0x11807d=function(_0x73d2b0){while(--_0x73d2b0){_0x55882f['push'](_0x55882f['shift']());}};_0x11807d(++_0x1ecff4);}(_0xd0f9,0x9b));var _0x9d0f=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xd0f9[_0x9cfe28];return _0x54a1d0;};'use strict';var Sequelize=require(_0x9d0f('0x0'));module[_0x9d0f('0x1')]={'name':{'type':Sequelize[_0x9d0f('0x2')],'unique':_0x9d0f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9d0f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9d0f('0x4')](_0x9d0f('0x5'),_0x9d0f('0x6'),_0x9d0f('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x26ef=['exports','STRING','name','ENUM','rrmemory','beepall'];(function(_0x55f97c,_0x22b142){var _0x5de6fb=function(_0x2b7d59){while(--_0x2b7d59){_0x55f97c['push'](_0x55f97c['shift']());}};_0x5de6fb(++_0x22b142);}(_0x26ef,0x13e));var _0xf26e=function(_0x12cbab,_0x15e8c5){_0x12cbab=_0x12cbab-0x0;var _0x2aacc7=_0x26ef[_0x12cbab];return _0x2aacc7;};'use strict';var Sequelize=require('sequelize');module[_0xf26e('0x0')]={'name':{'type':Sequelize[_0xf26e('0x1')],'unique':_0xf26e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf26e('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf26e('0x3')](_0xf26e('0x4'),_0xf26e('0x5'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 3734510..f95aaad 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 _0x80ed=['isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','findOne','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','FaxQueue','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMembers','UserFaxQueue','nolimit','findAndCountAll','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','value'];(function(_0x4d35df,_0xcc0b08){var _0x37327f=function(_0x54023c){while(--_0x54023c){_0x4d35df['push'](_0x4d35df['shift']());}};_0x37327f(++_0xcc0b08);}(_0x80ed,0x11c));var _0xd80e=function(_0x5ad654,_0x5e22ad){_0x5ad654=_0x5ad654-0x0;var _0x5c2f55=_0x80ed[_0x5ad654];return _0x5c2f55;};'use strict';var pdf=require(_0xd80e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd80e('0x1'));var zipdir=require(_0xd80e('0x2'));var jsonpatch=require(_0xd80e('0x3'));var rp=require('request-promise');var moment=require(_0xd80e('0x4'));var BPromise=require(_0xd80e('0x5'));var Mustache=require(_0xd80e('0x6'));var util=require(_0xd80e('0x7'));var path=require('path');var sox=require(_0xd80e('0x8'));var csv=require(_0xd80e('0x9'));var ejs=require(_0xd80e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x9'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var db=require(_0xd80e('0x19'))['db'];config[_0xd80e('0x1a')]=_[_0xd80e('0x1b')](config[_0xd80e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xd80e('0x1c')](socket);function respondWithStatusCode(_0x3d233b,_0x3096ae){_0x3096ae=_0x3096ae||0xcc;return function(_0x1e8b63){if(_0x1e8b63){return _0x3d233b[_0xd80e('0x1d')](_0x3096ae);}return _0x3d233b['status'](_0x3096ae)[_0xd80e('0x1e')]();};}function respondWithResult(_0x2c8c61,_0x3124e8){_0x3124e8=_0x3124e8||0xc8;return function(_0x3b48ae){if(_0x3b48ae){return _0x2c8c61[_0xd80e('0x1f')](_0x3124e8)[_0xd80e('0x20')](_0x3b48ae);}};}function respondWithFilteredResult(_0x2852cc,_0x22ab67){return function(_0x49e3e5){if(_0x49e3e5){var _0x21ceec=_0x49e3e5['count'],_0x1cc576=_0x22ab67[_0xd80e('0x21')],_0x3b543d=_0x22ab67[_0xd80e('0x21')]+_0x22ab67[_0xd80e('0x22')],_0x34e239;if(_0x3b543d>=_0x21ceec){_0x3b543d=_0x21ceec;_0x34e239=0xc8;}else{_0x34e239=0xce;}_0x2852cc['status'](_0x34e239);return _0x2852cc[_0xd80e('0x23')](_0xd80e('0x24'),_0x1cc576+'-'+_0x3b543d+'/'+_0x21ceec)[_0xd80e('0x20')](_0x49e3e5);}return null;};}function patchUpdates(_0x147134){return function(_0x46b6eb){try{jsonpatch['apply'](_0x46b6eb,_0x147134,!![]);}catch(_0x4b6b8a){return BPromise[_0xd80e('0x25')](_0x4b6b8a);}return _0x46b6eb[_0xd80e('0x26')]();};}function saveUpdates(_0x3b39bf,_0x2d46e7){return function(_0x3eb3ca){if(_0x3eb3ca){return _0x3eb3ca[_0xd80e('0x27')](_0x3b39bf)[_0xd80e('0x28')](function(_0x5430b6){return _0x5430b6;});}return null;};}function removeEntity(_0x1fbf8a,_0x57d70){return function(_0x170109){if(_0x170109){return _0x170109['destroy']()[_0xd80e('0x28')](function(){var _0x19c89c=_0x170109[_0xd80e('0x29')]({'plain':!![]});var _0x482779='FaxQueues';return db['UserProfileResource'][_0xd80e('0x2a')]({'where':{'type':_0x482779,'resourceId':_0x19c89c['id']}})['then'](function(){return _0x170109;});})[_0xd80e('0x28')](function(){_0x1fbf8a[_0xd80e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24bafb,_0xe1c04a){return function(_0x30d6fc){if(!_0x30d6fc){_0x24bafb[_0xd80e('0x1d')](0x194);}return _0x30d6fc;};}function handleError(_0x5376eb,_0x15f317){_0x15f317=_0x15f317||0x1f4;return function(_0x1ad3bc){logger[_0xd80e('0x2b')](_0x1ad3bc[_0xd80e('0x2c')]);if(_0x1ad3bc[_0xd80e('0x2d')]){delete _0x1ad3bc[_0xd80e('0x2d')];}_0x5376eb[_0xd80e('0x1f')](_0x15f317)[_0xd80e('0x2e')](_0x1ad3bc);};}exports['index']=function(_0x54504e,_0x30f9bd){var _0x1303eb={},_0x400220={},_0x32360c={'count':0x0,'rows':[]};var _0x21f437=_[_0xd80e('0x2f')](db['FaxQueue']['rawAttributes'],function(_0x39c124){return{'name':_0x39c124[_0xd80e('0x30')],'type':_0x39c124[_0xd80e('0x31')][_0xd80e('0x32')]};});_0x400220[_0xd80e('0x33')]=_[_0xd80e('0x2f')](_0x21f437,_0xd80e('0x2d'));_0x400220[_0xd80e('0x34')]=_['keys'](_0x54504e['query']);_0x400220[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x400220[_0xd80e('0x33')],_0x400220[_0xd80e('0x34')]);_0x1303eb[_0xd80e('0x37')]=_[_0xd80e('0x36')](_0x400220[_0xd80e('0x33')],qs[_0xd80e('0x38')](_0x54504e[_0xd80e('0x34')][_0xd80e('0x38')]));_0x1303eb['attributes']=_0x1303eb[_0xd80e('0x37')]['length']?_0x1303eb[_0xd80e('0x37')]:_0x400220[_0xd80e('0x33')];if(!_0x54504e[_0xd80e('0x34')][_0xd80e('0x39')]('nolimit')){_0x1303eb[_0xd80e('0x22')]=qs['limit'](_0x54504e[_0xd80e('0x34')]['limit']);_0x1303eb[_0xd80e('0x21')]=qs[_0xd80e('0x21')](_0x54504e['query'][_0xd80e('0x21')]);}_0x1303eb[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0x54504e['query'][_0xd80e('0x3b')]);_0x1303eb[_0xd80e('0x3c')]=qs[_0xd80e('0x35')](_[_0xd80e('0x3d')](_0x54504e[_0xd80e('0x34')],_0x400220[_0xd80e('0x35')]));if(_0x54504e[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x1303eb[_0xd80e('0x3c')]=_['merge'](_0x1303eb['where'],{'$or':_['map'](_0x21f437,function(_0x161455){if(_0x161455[_0xd80e('0x31')]!=='VIRTUAL'){var _0x1138c4={};_0x1138c4[_0x161455['name']]={'$like':'%'+_0x54504e[_0xd80e('0x34')]['filter']+'%'};return _0x1138c4;}})});}_0x1303eb=_[_0xd80e('0x3f')]({},_0x1303eb,_0x54504e[_0xd80e('0x40')]);var _0x493fb2={'where':_0x1303eb['where']};return db[_0xd80e('0x41')][_0xd80e('0x42')](_0x493fb2)[_0xd80e('0x28')](function(_0x3e65a7){_0x32360c[_0xd80e('0x42')]=_0x3e65a7;if(_0x54504e[_0xd80e('0x34')][_0xd80e('0x43')]){_0x1303eb[_0xd80e('0x44')]=[{'all':!![]}];}return db[_0xd80e('0x41')][_0xd80e('0x45')](_0x1303eb);})[_0xd80e('0x28')](function(_0x2e257e){_0x32360c[_0xd80e('0x46')]=_0x2e257e;return _0x32360c;})[_0xd80e('0x28')](respondWithFilteredResult(_0x30f9bd,_0x1303eb))[_0xd80e('0x47')](handleError(_0x30f9bd,null));};exports[_0xd80e('0x48')]=function(_0x558911,_0x52213c){var _0x5bdea5={'raw':!![],'where':{'id':_0x558911['params']['id']}},_0x10dc30={};_0x10dc30[_0xd80e('0x33')]=_[_0xd80e('0x49')](db[_0xd80e('0x41')][_0xd80e('0x4a')]);_0x10dc30[_0xd80e('0x34')]=_[_0xd80e('0x49')](_0x558911['query']);_0x10dc30['filters']=_['intersection'](_0x10dc30[_0xd80e('0x33')],_0x10dc30['query']);_0x5bdea5[_0xd80e('0x37')]=_[_0xd80e('0x36')](_0x10dc30[_0xd80e('0x33')],qs[_0xd80e('0x38')](_0x558911[_0xd80e('0x34')]['fields']));_0x5bdea5[_0xd80e('0x37')]=_0x5bdea5[_0xd80e('0x37')][_0xd80e('0x4b')]?_0x5bdea5['attributes']:_0x10dc30[_0xd80e('0x33')];if(_0x558911[_0xd80e('0x34')][_0xd80e('0x43')]){_0x5bdea5['include']=[{'all':!![]}];}_0x5bdea5=_[_0xd80e('0x3f')]({},_0x5bdea5,_0x558911[_0xd80e('0x40')]);return db[_0xd80e('0x41')][_0xd80e('0x4c')](_0x5bdea5)[_0xd80e('0x28')](handleEntityNotFound(_0x52213c,null))[_0xd80e('0x28')](respondWithResult(_0x52213c,null))['catch'](handleError(_0x52213c,null));};exports['create']=function(_0x275985,_0x27134e){return db[_0xd80e('0x41')]['create'](_0x275985['body'],{})[_0xd80e('0x28')](function(_0xff0980){var _0x183f78=_0x275985[_0xd80e('0x4d')][_0xd80e('0x29')]({'plain':!![]});if(!_0x183f78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x183f78[_0xd80e('0x4e')]==='user'){var _0x46c781=_0xff0980[_0xd80e('0x29')]({'plain':!![]});var _0x565757=_0xd80e('0x4f');return db[_0xd80e('0x50')][_0xd80e('0x4c')]({'where':{'name':_0x565757,'userProfileId':_0x183f78[_0xd80e('0x51')]},'raw':!![]})[_0xd80e('0x28')](function(_0x470319){if(_0x470319&&_0x470319[_0xd80e('0x52')]===0x0){return db['UserProfileResource'][_0xd80e('0x53')]({'name':_0x46c781[_0xd80e('0x2d')],'resourceId':_0x46c781['id'],'type':_0x470319[_0xd80e('0x2d')],'sectionId':_0x470319['id']},{})['then'](function(){return _0xff0980;});}else{return _0xff0980;}})['catch'](function(_0x107493){logger[_0xd80e('0x2b')](_0xd80e('0x54'),_0x107493);throw _0x107493;});}return _0xff0980;})[_0xd80e('0x28')](respondWithResult(_0x27134e,0xc9))[_0xd80e('0x47')](handleError(_0x27134e,null));};exports[_0xd80e('0x27')]=function(_0x53b2b8,_0x3984fe){if(_0x53b2b8['body']['id']){delete _0x53b2b8[_0xd80e('0x55')]['id'];}return db['FaxQueue'][_0xd80e('0x4c')]({'where':{'id':_0x53b2b8[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x3984fe,null))[_0xd80e('0x28')](saveUpdates(_0x53b2b8[_0xd80e('0x55')],null))[_0xd80e('0x28')](respondWithResult(_0x3984fe,null))['catch'](handleError(_0x3984fe,null));};exports[_0xd80e('0x2a')]=function(_0x4e7edd,_0x389413){return db[_0xd80e('0x41')]['find']({'where':{'id':_0x4e7edd['params']['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x389413,null))[_0xd80e('0x28')](removeEntity(_0x389413,null))[_0xd80e('0x47')](handleError(_0x389413,null));};exports['describe']=function(_0x568770,_0x1ba0ed){return db[_0xd80e('0x41')]['describe']()[_0xd80e('0x28')](respondWithResult(_0x1ba0ed,null))[_0xd80e('0x47')](handleError(_0x1ba0ed,null));};exports[_0xd80e('0x57')]=function(_0x539390,_0x41dda0,_0x589c0b){var _0x720eab={'raw':!![],'where':{}},_0x392704={},_0x3d8e46;return db[_0xd80e('0x41')]['findOne']({'where':{'id':_0x539390[_0xd80e('0x56')]['id']}})['then'](handleEntityNotFound(_0x41dda0,null))[_0xd80e('0x28')](function(_0x53a9e8){if(_0x53a9e8){_0x3d8e46=_0x53a9e8[_0xd80e('0x29')]({'plain':!![]});_0x392704[_0xd80e('0x33')]=_[_0xd80e('0x49')](db[_0xd80e('0x58')]['rawAttributes']);_0x392704[_0xd80e('0x34')]=_[_0xd80e('0x49')](_0x539390['query']);_0x392704[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x392704[_0xd80e('0x33')],_0x392704[_0xd80e('0x34')]);_0x720eab['attributes']=_[_0xd80e('0x36')](_0x392704[_0xd80e('0x33')],qs['fields'](_0x539390[_0xd80e('0x34')][_0xd80e('0x38')]));_0x720eab[_0xd80e('0x37')]=_0x720eab['attributes']['length']?_0x720eab['attributes']:_0x392704['model'];if(!_0x539390[_0xd80e('0x34')]['hasOwnProperty'](_0xd80e('0x59'))){_0x720eab[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x539390['query'][_0xd80e('0x22')]);_0x720eab[_0xd80e('0x21')]=qs[_0xd80e('0x21')](_0x539390[_0xd80e('0x34')][_0xd80e('0x21')]);}_0x720eab[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0x539390[_0xd80e('0x34')][_0xd80e('0x3b')]);_0x720eab['where']=qs['filters'](_[_0xd80e('0x3d')](_0x539390[_0xd80e('0x34')],_0x392704[_0xd80e('0x35')]));_0x720eab[_0xd80e('0x3c')]['FaxQueueId']=_0x53a9e8['id'];if(_0x539390[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x720eab[_0xd80e('0x3c')]=_[_0xd80e('0x3f')](_0x720eab[_0xd80e('0x3c')],{'$or':_['map'](_0x720eab[_0xd80e('0x37')],function(_0x1e44f7){var _0x3ff7ba={};_0x3ff7ba[_0x1e44f7]={'$like':'%'+_0x539390[_0xd80e('0x34')]['filter']+'%'};return _0x3ff7ba;})});}_0x720eab=_[_0xd80e('0x3f')]({},_0x720eab,_0x539390[_0xd80e('0x40')]);return db[_0xd80e('0x58')][_0xd80e('0x45')](_0x720eab);}})[_0xd80e('0x28')](function(_0x1edcf4){if(_0x1edcf4){return db['User'][_0xd80e('0x5a')]({'where':{'id':_[_0xd80e('0x2f')](_0x1edcf4,'UserId'),'role':_0xd80e('0x5b')},'attributes':['id',_0xd80e('0x2d'),_0xd80e('0x5c'),_0xd80e('0x5d'),'createdAt']});}})[_0xd80e('0x28')](function(_0x571951){if(_0x571951){return{'count':_0x571951[_0xd80e('0x42')],'rows':_[_0xd80e('0x2f')](_0x571951[_0xd80e('0x46')],function(_0x19eaaa){return{'membername':_0x19eaaa[_0xd80e('0x2d')],'UserId':_0x19eaaa['id'],'queue_name':_0x3d8e46['name'],'FaxQueueId':_0x3d8e46['id'],'interface':util[_0xd80e('0x5e')](_0xd80e('0x5f'),_0xd80e('0x60'),_0x19eaaa[_0xd80e('0x2d')]),'penalty':0x0,'paused':_0x19eaaa['faxPause'],'createdAt':_0x19eaaa[_0xd80e('0x61')],'updatedAt':_0x19eaaa[_0xd80e('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x41dda0,_0x720eab))[_0xd80e('0x47')](handleError(_0x41dda0,null));};exports[_0xd80e('0x62')]=function(_0xd6e3b,_0x40ceba,_0x3feb77){var _0x8b2fc4={};var _0x4a0dea={};var _0x48b8b9;var _0xccb914;return db['FaxQueue']['findOne']({'where':{'id':_0xd6e3b[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x40ceba,null))[_0xd80e('0x28')](function(_0x200c4e){if(_0x200c4e){_0x48b8b9=_0x200c4e;_0x4a0dea[_0xd80e('0x33')]=_[_0xd80e('0x49')](db[_0xd80e('0x63')][_0xd80e('0x4a')]);_0x4a0dea['query']=_[_0xd80e('0x49')](_0xd6e3b[_0xd80e('0x34')]);_0x4a0dea[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x4a0dea['model'],_0x4a0dea[_0xd80e('0x34')]);_0x8b2fc4[_0xd80e('0x37')]=_['intersection'](_0x4a0dea[_0xd80e('0x33')],qs[_0xd80e('0x38')](_0xd6e3b['query'][_0xd80e('0x38')]));_0x8b2fc4[_0xd80e('0x37')]=_0x8b2fc4[_0xd80e('0x37')][_0xd80e('0x4b')]?_0x8b2fc4[_0xd80e('0x37')]:_0x4a0dea[_0xd80e('0x33')];_0x8b2fc4[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x3b')]);_0x8b2fc4['where']=qs[_0xd80e('0x35')](_[_0xd80e('0x3d')](_0xd6e3b['query'],_0x4a0dea[_0xd80e('0x35')]));if(_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x8b2fc4['where']=_[_0xd80e('0x3f')](_0x8b2fc4['where'],{'$or':_[_0xd80e('0x2f')](_0x8b2fc4[_0xd80e('0x37')],function(_0x15fd9c){var _0x7020e6={};_0x7020e6[_0x15fd9c]={'$like':'%'+_0xd6e3b[_0xd80e('0x34')]['filter']+'%'};return _0x7020e6;})});}_0x8b2fc4=_[_0xd80e('0x3f')]({},_0x8b2fc4,_0xd6e3b[_0xd80e('0x40')]);return _0x48b8b9[_0xd80e('0x62')](_0x8b2fc4);}})[_0xd80e('0x28')](function(_0xb0ec86){if(_0xb0ec86){_0xccb914=_0xb0ec86[_0xd80e('0x4b')];if(!_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x39')](_0xd80e('0x59'))){_0x8b2fc4[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x22')]);_0x8b2fc4[_0xd80e('0x21')]=qs['offset'](_0xd6e3b[_0xd80e('0x34')]['offset']);}return _0x48b8b9['getTeams'](_0x8b2fc4);}})['then'](function(_0x1dc8d0){if(_0x1dc8d0){return _0x1dc8d0?{'count':_0xccb914,'rows':_0x1dc8d0}:null;}})[_0xd80e('0x28')](respondWithResult(_0x40ceba,null))[_0xd80e('0x47')](handleError(_0x40ceba,null));};exports[_0xd80e('0x64')]=function(_0x4983c2,_0x1f52bd,_0x36cb0c){var _0x12f485=_0x4983c2['body']['ids'];return db[_0xd80e('0x63')]['findAll']({'where':{'id':_0x12f485},'attributes':['id'],'include':[{'model':db[_0xd80e('0x65')],'as':_0xd80e('0x66'),'attributes':['id',_0xd80e('0x2d'),_0xd80e('0x67'),_0xd80e('0x68'),_0xd80e('0x69')],'raw':!![]}]})[_0xd80e('0x28')](function(_0x48aab5){if(_0x48aab5){var _0x5cc489=_['flatMap'](_0x48aab5,function(_0x1d1561){var _0x94b139=_0x1d1561[_0xd80e('0x29')]({'plain':!![]});return _0x94b139[_0xd80e('0x66')];});return db[_0xd80e('0x41')][_0xd80e('0x4c')]({'where':{'id':_0x4983c2[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](function(_0x1cb572){return db[_0xd80e('0x6a')][_0xd80e('0x6b')](function(_0x201f42){return _0x1cb572[_0xd80e('0x64')](_0x12f485,{'transaction':_0x201f42})['then'](function(){return BPromise[_0xd80e('0x6c')](_0x5cc489,function(_0x40e698){return db[_0xd80e('0x58')][_0xd80e('0x6d')]({'where':{'UserId':_0x40e698['id'],'FaxQueueId':_0x4983c2[_0xd80e('0x56')]['id']},'transaction':_0x201f42});});})[_0xd80e('0x28')](function(){_0x5cc489[_0xd80e('0x6e')](function(_0x4a26b5){socket[_0xd80e('0x6f')](_0xd80e('0x70'),{'UserId':_0x4a26b5['id'],'FaxQueueId':_0x1cb572['id']});});});});});}})['then'](respondWithStatusCode(_0x1f52bd,null))[_0xd80e('0x47')](handleError(_0x1f52bd,null));};exports[_0xd80e('0x71')]=function(_0x3e36e4,_0x7288c0,_0x50e61b){return db['Team']['findAll']({'where':{'id':_0x3e36e4[_0xd80e('0x34')][_0xd80e('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd80e('0x66'),'attributes':['id'],'raw':!![]}]})[_0xd80e('0x28')](handleEntityNotFound(_0x7288c0,null))[_0xd80e('0x28')](function(_0x550890){var _0x3a98aa=_['map'](_0x550890,'id');var _0x145c93=[];var _0x247ebc=[];var _0x5f277a=squel[_0xd80e('0x73')]();_0x5f277a[_0xd80e('0x74')](_0xd80e('0x75'))[_0xd80e('0x76')]('team_has_fax_queues','tq')[_0xd80e('0x77')]('user_has_teams','ut',_0xd80e('0x78'))[_0xd80e('0x3c')](_0xd80e('0x79'),_0x3e36e4[_0xd80e('0x56')]['id']);for(var _0x99ee40=0x0;_0x99ee40<_0x550890[_0xd80e('0x4b')];_0x99ee40+=0x1){let _0x1782d2=_0x550890[_0x99ee40];for(var _0x23514b=0x0;_0x23514b<_0x1782d2[_0xd80e('0x66')][_0xd80e('0x4b')];_0x23514b+=0x1){let _0x47827f=_0x1782d2['Agents'][_0x23514b];var _0x4f02f8=_0x5f277a['clone']();_0x4f02f8[_0xd80e('0x3c')](_0xd80e('0x7a'),_0x47827f['id']);_0x247ebc[_0xd80e('0x7b')](db[_0xd80e('0x6a')][_0xd80e('0x34')](_0x4f02f8[_0xd80e('0x7c')](),{'type':db[_0xd80e('0x6a')][_0xd80e('0x7d')]['SELECT']})[_0xd80e('0x28')](function(_0x510548){if(_0x510548[_0xd80e('0x4b')]===0x1){return _0x47827f['id'];}else{var _0x376d02=_[_0xd80e('0x7e')](_['map'](_0x510548,_0xd80e('0x7f')),function(_0x4ced27){return _[_0xd80e('0x80')](_0x3a98aa,_0x4ced27);});if(_0x376d02){return _0x47827f['id'];}}}));}}return BPromise['all'](_0x247ebc)[_0xd80e('0x28')](function(_0x2538d5){_0x145c93=_(_0x145c93)['union'](_0x2538d5)['compact']()[_0xd80e('0x81')]();return db[_0xd80e('0x41')][_0xd80e('0x4c')]({'where':{'id':_0x3e36e4[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](function(_0x1c2d02){return db[_0xd80e('0x6a')]['transaction'](function(_0xa801c2){return _0x1c2d02['removeTeams'](_0x3e36e4[_0xd80e('0x34')][_0xd80e('0x72')],{'transaction':_0xa801c2})[_0xd80e('0x28')](function(){if(!_[_0xd80e('0x82')](_0x145c93)){return _0x1c2d02[_0xd80e('0x83')](_0x145c93,{'transaction':_0xa801c2});}})['then'](function(){_0x145c93['forEach'](function(_0x42e910){socket[_0xd80e('0x6f')](_0xd80e('0x84'),{'UserId':_0x42e910,'FaxQueueId':_0x1c2d02['id']});});});});});});})[_0xd80e('0x28')](respondWithStatusCode(_0x7288c0,null))[_0xd80e('0x47')](handleError(_0x7288c0,null));};exports[_0xd80e('0x85')]=function(_0xb07c00,_0xcdafdb,_0x14b20c){return db[_0xd80e('0x41')][_0xd80e('0x4c')]({'where':{'id':_0xb07c00[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0xcdafdb,null))['then'](function(_0xcb9acd){if(_0xcb9acd){return _0xcb9acd['addAgents'](_0xb07c00[_0xd80e('0x55')][_0xd80e('0x72')],_[_0xd80e('0x86')](_0xb07c00[_0xd80e('0x55')],[_0xd80e('0x72'),'id'])||{})['spread'](function(_0x5c108f){for(var _0x243f9b=0x0;_0x243f9b<_0xb07c00[_0xd80e('0x55')]['ids'][_0xd80e('0x4b')];_0x243f9b+=0x1){socket[_0xd80e('0x6f')](_0xd80e('0x70'),{'UserId':_0xb07c00[_0xd80e('0x55')]['ids'][_0x243f9b],'FaxQueueId':_0xb07c00[_0xd80e('0x56')]['id']});}return _0x5c108f;});}})[_0xd80e('0x28')](respondWithResult(_0xcdafdb,null))[_0xd80e('0x47')](handleError(_0xcdafdb,null));};exports[_0xd80e('0x83')]=function(_0x16737b,_0xac3eff,_0x1b3a6e){return db[_0xd80e('0x41')]['find']({'where':{'id':_0x16737b['params']['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0xac3eff,null))[_0xd80e('0x28')](function(_0x623f17){if(_0x623f17){return _0x623f17[_0xd80e('0x83')](_0x16737b[_0xd80e('0x34')][_0xd80e('0x72')])[_0xd80e('0x28')](function(){if(_[_0xd80e('0x87')](_0x16737b[_0xd80e('0x34')][_0xd80e('0x72')])){for(var _0x1da7f8=0x0;_0x1da7f8<_0x16737b[_0xd80e('0x34')][_0xd80e('0x72')][_0xd80e('0x4b')];_0x1da7f8+=0x1){socket['emit'](_0xd80e('0x84'),{'UserId':Number(_0x16737b[_0xd80e('0x34')]['ids'][_0x1da7f8]),'FaxQueueId':Number(_0x16737b[_0xd80e('0x56')]['id'])});}}else{socket[_0xd80e('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x16737b[_0xd80e('0x34')]['ids']),'FaxQueueId':Number(_0x16737b[_0xd80e('0x56')]['id'])});}});}})[_0xd80e('0x28')](respondWithStatusCode(_0xac3eff,null))[_0xd80e('0x47')](handleError(_0xac3eff,null));};exports['getAgents']=function(_0x3b4143,_0x36300f,_0x227ca2){var _0x35bc9a={};var _0x598a2e={};var _0x1ba292;var _0xd1ff77;return db[_0xd80e('0x41')][_0xd80e('0x88')]({'where':{'id':_0x3b4143['params']['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x36300f,null))[_0xd80e('0x28')](function(_0x3172b7){if(_0x3172b7){_0x1ba292=_0x3172b7;_0x598a2e[_0xd80e('0x33')]=_[_0xd80e('0x49')](db['User'][_0xd80e('0x4a')]);_0x598a2e[_0xd80e('0x34')]=_[_0xd80e('0x49')](_0x3b4143['query']);_0x598a2e['filters']=_[_0xd80e('0x36')](_0x598a2e[_0xd80e('0x33')],_0x598a2e[_0xd80e('0x34')]);_0x35bc9a[_0xd80e('0x37')]=_[_0xd80e('0x36')](_0x598a2e[_0xd80e('0x33')],qs['fields'](_0x3b4143[_0xd80e('0x34')][_0xd80e('0x38')]));_0x35bc9a[_0xd80e('0x37')]=_0x35bc9a[_0xd80e('0x37')][_0xd80e('0x4b')]?_0x35bc9a[_0xd80e('0x37')]:_0x598a2e['model'];_0x35bc9a[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0x3b4143['query']['sort']);_0x35bc9a[_0xd80e('0x3c')]=qs[_0xd80e('0x35')](_[_0xd80e('0x3d')](_0x3b4143[_0xd80e('0x34')],_0x598a2e[_0xd80e('0x35')]));if(_0x3b4143[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x35bc9a[_0xd80e('0x3c')]=_[_0xd80e('0x3f')](_0x35bc9a['where'],{'$or':_['map'](_0x35bc9a[_0xd80e('0x37')],function(_0x1387b7){var _0xb69b4d={};_0xb69b4d[_0x1387b7]={'$like':'%'+_0x3b4143[_0xd80e('0x34')]['filter']+'%'};return _0xb69b4d;})});}_0x35bc9a=_[_0xd80e('0x3f')]({},_0x35bc9a,_0x3b4143[_0xd80e('0x40')]);return _0x1ba292[_0xd80e('0x89')](_0x35bc9a);}})[_0xd80e('0x28')](function(_0x576edc){if(_0x576edc){_0xd1ff77=_0x576edc['length'];if(!_0x3b4143['query'][_0xd80e('0x39')](_0xd80e('0x59'))){_0x35bc9a[_0xd80e('0x22')]=qs['limit'](_0x3b4143[_0xd80e('0x34')][_0xd80e('0x22')]);_0x35bc9a['offset']=qs['offset'](_0x3b4143[_0xd80e('0x34')][_0xd80e('0x21')]);}return _0x1ba292[_0xd80e('0x89')](_0x35bc9a);}})[_0xd80e('0x28')](function(_0x493353){if(_0x493353){return _0x493353?{'count':_0xd1ff77,'rows':_0x493353}:null;}})[_0xd80e('0x28')](respondWithResult(_0x36300f,null))[_0xd80e('0x47')](handleError(_0x36300f,null));}; \ No newline at end of file +var _0x0caf=['from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','Agents','clone','push','toString','sequelize','QueryTypes','SELECT','every','union','compact','value','removeTeams','removeAgents','userFaxQueue:remove','addAgents','getAgents','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','fields','length','includeAll','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','findAndCountAll','UserId','agent','updatedAt','createdAt','format','%s/%s','faxPause','getTeams','Team','addTeams','ids','User','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId'];(function(_0x37424b,_0xb5a550){var _0x4094e7=function(_0xc0b8c2){while(--_0xc0b8c2){_0x37424b['push'](_0x37424b['shift']());}};_0x4094e7(++_0xb5a550);}(_0x0caf,0x9f));var _0xf0ca=function(_0x229118,_0x24f021){_0x229118=_0x229118-0x0;var _0x5c27ce=_0x0caf[_0x229118];return _0x5c27ce;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf0ca('0x0'));var jsonpatch=require(_0xf0ca('0x1'));var rp=require(_0xf0ca('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf0ca('0x3'));var util=require(_0xf0ca('0x4'));var path=require('path');var sox=require(_0xf0ca('0x5'));var csv=require(_0xf0ca('0x6'));var ejs=require(_0xf0ca('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf0ca('0x8'));var crypto=require(_0xf0ca('0x9'));var jsforce=require(_0xf0ca('0xa'));var deskjs=require(_0xf0ca('0xb'));var toCsv=require(_0xf0ca('0x6'));var querystring=require(_0xf0ca('0xc'));var Papa=require(_0xf0ca('0xd'));var Redis=require('ioredis');var authService=require(_0xf0ca('0xe'));var qs=require(_0xf0ca('0xf'));var as=require(_0xf0ca('0x10'));var hardwareService=require(_0xf0ca('0x11'));var logger=require(_0xf0ca('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf0ca('0x13'));var db=require('../../mysqldb')['db'];config[_0xf0ca('0x14')]=_['defaults'](config[_0xf0ca('0x14')],{'host':_0xf0ca('0x15'),'port':0x18eb});var socket=require(_0xf0ca('0x16'))(new Redis(config[_0xf0ca('0x14')]));require(_0xf0ca('0x17'))[_0xf0ca('0x18')](socket);function respondWithStatusCode(_0x5c5875,_0x6d9157){_0x6d9157=_0x6d9157||0xcc;return function(_0x4afc11){if(_0x4afc11){return _0x5c5875['sendStatus'](_0x6d9157);}return _0x5c5875[_0xf0ca('0x19')](_0x6d9157)[_0xf0ca('0x1a')]();};}function respondWithResult(_0x3b1daa,_0x2b074e){_0x2b074e=_0x2b074e||0xc8;return function(_0xc4ebc2){if(_0xc4ebc2){return _0x3b1daa['status'](_0x2b074e)['json'](_0xc4ebc2);}};}function respondWithFilteredResult(_0x2c15cc,_0x4d08f2){return function(_0x5af77f){if(_0x5af77f){var _0x3245b2=_0x5af77f[_0xf0ca('0x1b')],_0x5eb7e8=_0x4d08f2[_0xf0ca('0x1c')],_0x2473f0=_0x4d08f2['offset']+_0x4d08f2[_0xf0ca('0x1d')],_0x239f38;if(_0x2473f0>=_0x3245b2){_0x2473f0=_0x3245b2;_0x239f38=0xc8;}else{_0x239f38=0xce;}_0x2c15cc['status'](_0x239f38);return _0x2c15cc[_0xf0ca('0x1e')](_0xf0ca('0x1f'),_0x5eb7e8+'-'+_0x2473f0+'/'+_0x3245b2)['json'](_0x5af77f);}return null;};}function patchUpdates(_0x24303d){return function(_0x216b12){try{jsonpatch[_0xf0ca('0x20')](_0x216b12,_0x24303d,!![]);}catch(_0x508d12){return BPromise[_0xf0ca('0x21')](_0x508d12);}return _0x216b12[_0xf0ca('0x22')]();};}function saveUpdates(_0x3414eb,_0x520863){return function(_0x3374ad){if(_0x3374ad){return _0x3374ad[_0xf0ca('0x23')](_0x3414eb)[_0xf0ca('0x24')](function(_0x3d6bad){return _0x3d6bad;});}return null;};}function removeEntity(_0x5f31c6,_0xd8312a){return function(_0x50c892){if(_0x50c892){return _0x50c892['destroy']()[_0xf0ca('0x24')](function(){var _0x5571fb=_0x50c892[_0xf0ca('0x25')]({'plain':!![]});var _0x11916a=_0xf0ca('0x26');return db[_0xf0ca('0x27')][_0xf0ca('0x28')]({'where':{'type':_0x11916a,'resourceId':_0x5571fb['id']}})[_0xf0ca('0x24')](function(){return _0x50c892;});})['then'](function(){_0x5f31c6['status'](0xcc)[_0xf0ca('0x1a')]();});}};}function handleEntityNotFound(_0x15aaa1,_0x57ad7e){return function(_0x23ac2c){if(!_0x23ac2c){_0x15aaa1[_0xf0ca('0x29')](0x194);}return _0x23ac2c;};}function handleError(_0x214d12,_0x2aaae9){_0x2aaae9=_0x2aaae9||0x1f4;return function(_0x48bbf8){logger[_0xf0ca('0x2a')](_0x48bbf8[_0xf0ca('0x2b')]);if(_0x48bbf8[_0xf0ca('0x2c')]){delete _0x48bbf8[_0xf0ca('0x2c')];}_0x214d12[_0xf0ca('0x19')](_0x2aaae9)[_0xf0ca('0x2d')](_0x48bbf8);};}exports[_0xf0ca('0x2e')]=function(_0x56bd3b,_0x6988a){var _0x4ba8ac={},_0x35d887={},_0x5c4625={'count':0x0,'rows':[]};var _0x3e64a3=_[_0xf0ca('0x2f')](db[_0xf0ca('0x30')][_0xf0ca('0x31')],function(_0x35bcd7){return{'name':_0x35bcd7[_0xf0ca('0x32')],'type':_0x35bcd7[_0xf0ca('0x33')][_0xf0ca('0x34')]};});_0x35d887[_0xf0ca('0x35')]=_[_0xf0ca('0x2f')](_0x3e64a3,_0xf0ca('0x2c'));_0x35d887[_0xf0ca('0x36')]=_[_0xf0ca('0x37')](_0x56bd3b[_0xf0ca('0x36')]);_0x35d887['filters']=_[_0xf0ca('0x38')](_0x35d887[_0xf0ca('0x35')],_0x35d887[_0xf0ca('0x36')]);_0x4ba8ac[_0xf0ca('0x39')]=_['intersection'](_0x35d887[_0xf0ca('0x35')],qs['fields'](_0x56bd3b[_0xf0ca('0x36')]['fields']));_0x4ba8ac[_0xf0ca('0x39')]=_0x4ba8ac[_0xf0ca('0x39')]['length']?_0x4ba8ac[_0xf0ca('0x39')]:_0x35d887['model'];if(!_0x56bd3b['query'][_0xf0ca('0x3a')](_0xf0ca('0x3b'))){_0x4ba8ac[_0xf0ca('0x1d')]=qs[_0xf0ca('0x1d')](_0x56bd3b[_0xf0ca('0x36')]['limit']);_0x4ba8ac[_0xf0ca('0x1c')]=qs[_0xf0ca('0x1c')](_0x56bd3b[_0xf0ca('0x36')][_0xf0ca('0x1c')]);}_0x4ba8ac[_0xf0ca('0x3c')]=qs[_0xf0ca('0x3d')](_0x56bd3b['query'][_0xf0ca('0x3d')]);_0x4ba8ac[_0xf0ca('0x3e')]=qs[_0xf0ca('0x3f')](_[_0xf0ca('0x40')](_0x56bd3b['query'],_0x35d887[_0xf0ca('0x3f')]));if(_0x56bd3b['query'][_0xf0ca('0x41')]){_0x4ba8ac[_0xf0ca('0x3e')]=_[_0xf0ca('0x42')](_0x4ba8ac[_0xf0ca('0x3e')],{'$or':_[_0xf0ca('0x2f')](_0x3e64a3,function(_0x593732){if(_0x593732['type']!==_0xf0ca('0x43')){var _0x31b67f={};_0x31b67f[_0x593732[_0xf0ca('0x2c')]]={'$like':'%'+_0x56bd3b[_0xf0ca('0x36')][_0xf0ca('0x41')]+'%'};return _0x31b67f;}})});}_0x4ba8ac=_[_0xf0ca('0x42')]({},_0x4ba8ac,_0x56bd3b[_0xf0ca('0x44')]);var _0x1f8113={'where':_0x4ba8ac[_0xf0ca('0x3e')]};return db[_0xf0ca('0x30')]['count'](_0x1f8113)[_0xf0ca('0x24')](function(_0x19dd2e){_0x5c4625[_0xf0ca('0x1b')]=_0x19dd2e;if(_0x56bd3b[_0xf0ca('0x36')]['includeAll']){_0x4ba8ac['include']=[{'all':!![]}];}return db[_0xf0ca('0x30')][_0xf0ca('0x45')](_0x4ba8ac);})[_0xf0ca('0x24')](function(_0x479c88){_0x5c4625[_0xf0ca('0x46')]=_0x479c88;return _0x5c4625;})[_0xf0ca('0x24')](respondWithFilteredResult(_0x6988a,_0x4ba8ac))[_0xf0ca('0x47')](handleError(_0x6988a,null));};exports[_0xf0ca('0x48')]=function(_0x462c78,_0x577d0c){var _0x2bd7f7={'raw':!![],'where':{'id':_0x462c78[_0xf0ca('0x49')]['id']}},_0x36cc39={};_0x36cc39[_0xf0ca('0x35')]=_[_0xf0ca('0x37')](db[_0xf0ca('0x30')][_0xf0ca('0x31')]);_0x36cc39[_0xf0ca('0x36')]=_[_0xf0ca('0x37')](_0x462c78[_0xf0ca('0x36')]);_0x36cc39[_0xf0ca('0x3f')]=_[_0xf0ca('0x38')](_0x36cc39[_0xf0ca('0x35')],_0x36cc39[_0xf0ca('0x36')]);_0x2bd7f7[_0xf0ca('0x39')]=_[_0xf0ca('0x38')](_0x36cc39[_0xf0ca('0x35')],qs[_0xf0ca('0x4a')](_0x462c78[_0xf0ca('0x36')]['fields']));_0x2bd7f7[_0xf0ca('0x39')]=_0x2bd7f7[_0xf0ca('0x39')][_0xf0ca('0x4b')]?_0x2bd7f7[_0xf0ca('0x39')]:_0x36cc39[_0xf0ca('0x35')];if(_0x462c78['query'][_0xf0ca('0x4c')]){_0x2bd7f7[_0xf0ca('0x4d')]=[{'all':!![]}];}_0x2bd7f7=_['merge']({},_0x2bd7f7,_0x462c78['options']);return db[_0xf0ca('0x30')][_0xf0ca('0x4e')](_0x2bd7f7)[_0xf0ca('0x24')](handleEntityNotFound(_0x577d0c,null))['then'](respondWithResult(_0x577d0c,null))[_0xf0ca('0x47')](handleError(_0x577d0c,null));};exports['create']=function(_0x577f1d,_0x1e0da5){return db['FaxQueue']['create'](_0x577f1d[_0xf0ca('0x4f')],{})['then'](function(_0xf73184){var _0x2bee7d=_0x577f1d[_0xf0ca('0x50')][_0xf0ca('0x25')]({'plain':!![]});if(!_0x2bee7d)throw new Error(_0xf0ca('0x51'));if(_0x2bee7d[_0xf0ca('0x52')]==='user'){var _0x19bc49=_0xf73184[_0xf0ca('0x25')]({'plain':!![]});var _0x4382e0=_0xf0ca('0x26');return db['UserProfileSection'][_0xf0ca('0x4e')]({'where':{'name':_0x4382e0,'userProfileId':_0x2bee7d[_0xf0ca('0x53')]},'raw':!![]})[_0xf0ca('0x24')](function(_0x43007b){if(_0x43007b&&_0x43007b[_0xf0ca('0x54')]===0x0){return db[_0xf0ca('0x27')][_0xf0ca('0x55')]({'name':_0x19bc49[_0xf0ca('0x2c')],'resourceId':_0x19bc49['id'],'type':_0x43007b['name'],'sectionId':_0x43007b['id']},{})['then'](function(){return _0xf73184;});}else{return _0xf73184;}})[_0xf0ca('0x47')](function(_0x2df433){logger[_0xf0ca('0x2a')](_0xf0ca('0x56'),_0x2df433);throw _0x2df433;});}return _0xf73184;})[_0xf0ca('0x24')](respondWithResult(_0x1e0da5,0xc9))[_0xf0ca('0x47')](handleError(_0x1e0da5,null));};exports[_0xf0ca('0x23')]=function(_0x45fdc1,_0x2d4230){if(_0x45fdc1[_0xf0ca('0x4f')]['id']){delete _0x45fdc1[_0xf0ca('0x4f')]['id'];}return db[_0xf0ca('0x30')][_0xf0ca('0x4e')]({'where':{'id':_0x45fdc1[_0xf0ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x2d4230,null))[_0xf0ca('0x24')](saveUpdates(_0x45fdc1[_0xf0ca('0x4f')],null))['then'](respondWithResult(_0x2d4230,null))[_0xf0ca('0x47')](handleError(_0x2d4230,null));};exports[_0xf0ca('0x28')]=function(_0x517a0f,_0x439c08){return db['FaxQueue'][_0xf0ca('0x4e')]({'where':{'id':_0x517a0f['params']['id']}})[_0xf0ca('0x24')](handleEntityNotFound(_0x439c08,null))[_0xf0ca('0x24')](removeEntity(_0x439c08,null))[_0xf0ca('0x47')](handleError(_0x439c08,null));};exports[_0xf0ca('0x57')]=function(_0x35e0cb,_0x3552b8){return db[_0xf0ca('0x30')][_0xf0ca('0x57')]()[_0xf0ca('0x24')](respondWithResult(_0x3552b8,null))[_0xf0ca('0x47')](handleError(_0x3552b8,null));};exports[_0xf0ca('0x58')]=function(_0x428280,_0x89d15d,_0x34cc71){var _0x4b7fc8={'raw':!![],'where':{}},_0x26a764={},_0x3c98fd;return db[_0xf0ca('0x30')][_0xf0ca('0x59')]({'where':{'id':_0x428280[_0xf0ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x89d15d,null))['then'](function(_0x585067){if(_0x585067){_0x3c98fd=_0x585067['get']({'plain':!![]});_0x26a764[_0xf0ca('0x35')]=_[_0xf0ca('0x37')](db[_0xf0ca('0x5a')][_0xf0ca('0x31')]);_0x26a764['query']=_[_0xf0ca('0x37')](_0x428280['query']);_0x26a764[_0xf0ca('0x3f')]=_[_0xf0ca('0x38')](_0x26a764['model'],_0x26a764[_0xf0ca('0x36')]);_0x4b7fc8[_0xf0ca('0x39')]=_[_0xf0ca('0x38')](_0x26a764['model'],qs[_0xf0ca('0x4a')](_0x428280['query'][_0xf0ca('0x4a')]));_0x4b7fc8[_0xf0ca('0x39')]=_0x4b7fc8[_0xf0ca('0x39')][_0xf0ca('0x4b')]?_0x4b7fc8[_0xf0ca('0x39')]:_0x26a764[_0xf0ca('0x35')];if(!_0x428280[_0xf0ca('0x36')][_0xf0ca('0x3a')](_0xf0ca('0x3b'))){_0x4b7fc8['limit']=qs[_0xf0ca('0x1d')](_0x428280['query'][_0xf0ca('0x1d')]);_0x4b7fc8['offset']=qs[_0xf0ca('0x1c')](_0x428280[_0xf0ca('0x36')][_0xf0ca('0x1c')]);}_0x4b7fc8['order']=qs[_0xf0ca('0x3d')](_0x428280[_0xf0ca('0x36')][_0xf0ca('0x3d')]);_0x4b7fc8[_0xf0ca('0x3e')]=qs[_0xf0ca('0x3f')](_[_0xf0ca('0x40')](_0x428280['query'],_0x26a764[_0xf0ca('0x3f')]));_0x4b7fc8['where']['FaxQueueId']=_0x585067['id'];if(_0x428280['query']['filter']){_0x4b7fc8[_0xf0ca('0x3e')]=_[_0xf0ca('0x42')](_0x4b7fc8[_0xf0ca('0x3e')],{'$or':_[_0xf0ca('0x2f')](_0x4b7fc8[_0xf0ca('0x39')],function(_0x3ef290){var _0x2c0a9f={};_0x2c0a9f[_0x3ef290]={'$like':'%'+_0x428280[_0xf0ca('0x36')]['filter']+'%'};return _0x2c0a9f;})});}_0x4b7fc8=_[_0xf0ca('0x42')]({},_0x4b7fc8,_0x428280[_0xf0ca('0x44')]);return db[_0xf0ca('0x5a')][_0xf0ca('0x45')](_0x4b7fc8);}})[_0xf0ca('0x24')](function(_0x1b9995){if(_0x1b9995){return db['User'][_0xf0ca('0x5b')]({'where':{'id':_[_0xf0ca('0x2f')](_0x1b9995,_0xf0ca('0x5c')),'role':_0xf0ca('0x5d')},'attributes':['id','name','faxPause',_0xf0ca('0x5e'),_0xf0ca('0x5f')]});}})[_0xf0ca('0x24')](function(_0x1062eb){if(_0x1062eb){return{'count':_0x1062eb[_0xf0ca('0x1b')],'rows':_[_0xf0ca('0x2f')](_0x1062eb[_0xf0ca('0x46')],function(_0x3660a3){return{'membername':_0x3660a3[_0xf0ca('0x2c')],'UserId':_0x3660a3['id'],'queue_name':_0x3c98fd[_0xf0ca('0x2c')],'FaxQueueId':_0x3c98fd['id'],'interface':util[_0xf0ca('0x60')](_0xf0ca('0x61'),'SIP',_0x3660a3[_0xf0ca('0x2c')]),'penalty':0x0,'paused':_0x3660a3[_0xf0ca('0x62')],'createdAt':_0x3660a3['createdAt'],'updatedAt':_0x3660a3[_0xf0ca('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x89d15d,_0x4b7fc8))[_0xf0ca('0x47')](handleError(_0x89d15d,null));};exports[_0xf0ca('0x63')]=function(_0x22c3ee,_0x54f54a,_0x478262){var _0xe0a8d8={};var _0x384445={};var _0x3a34cc;var _0x5807e6;return db[_0xf0ca('0x30')][_0xf0ca('0x59')]({'where':{'id':_0x22c3ee[_0xf0ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x54f54a,null))['then'](function(_0x137980){if(_0x137980){_0x3a34cc=_0x137980;_0x384445['model']=_['keys'](db[_0xf0ca('0x64')][_0xf0ca('0x31')]);_0x384445[_0xf0ca('0x36')]=_[_0xf0ca('0x37')](_0x22c3ee['query']);_0x384445[_0xf0ca('0x3f')]=_[_0xf0ca('0x38')](_0x384445[_0xf0ca('0x35')],_0x384445[_0xf0ca('0x36')]);_0xe0a8d8[_0xf0ca('0x39')]=_['intersection'](_0x384445[_0xf0ca('0x35')],qs[_0xf0ca('0x4a')](_0x22c3ee[_0xf0ca('0x36')][_0xf0ca('0x4a')]));_0xe0a8d8[_0xf0ca('0x39')]=_0xe0a8d8['attributes'][_0xf0ca('0x4b')]?_0xe0a8d8[_0xf0ca('0x39')]:_0x384445[_0xf0ca('0x35')];_0xe0a8d8[_0xf0ca('0x3c')]=qs[_0xf0ca('0x3d')](_0x22c3ee[_0xf0ca('0x36')][_0xf0ca('0x3d')]);_0xe0a8d8['where']=qs[_0xf0ca('0x3f')](_[_0xf0ca('0x40')](_0x22c3ee['query'],_0x384445[_0xf0ca('0x3f')]));if(_0x22c3ee['query'][_0xf0ca('0x41')]){_0xe0a8d8[_0xf0ca('0x3e')]=_[_0xf0ca('0x42')](_0xe0a8d8[_0xf0ca('0x3e')],{'$or':_[_0xf0ca('0x2f')](_0xe0a8d8[_0xf0ca('0x39')],function(_0x376760){var _0x1e8fd3={};_0x1e8fd3[_0x376760]={'$like':'%'+_0x22c3ee['query']['filter']+'%'};return _0x1e8fd3;})});}_0xe0a8d8=_['merge']({},_0xe0a8d8,_0x22c3ee['options']);return _0x3a34cc[_0xf0ca('0x63')](_0xe0a8d8);}})[_0xf0ca('0x24')](function(_0x38e7a8){if(_0x38e7a8){_0x5807e6=_0x38e7a8[_0xf0ca('0x4b')];if(!_0x22c3ee['query'][_0xf0ca('0x3a')](_0xf0ca('0x3b'))){_0xe0a8d8[_0xf0ca('0x1d')]=qs['limit'](_0x22c3ee[_0xf0ca('0x36')]['limit']);_0xe0a8d8[_0xf0ca('0x1c')]=qs['offset'](_0x22c3ee[_0xf0ca('0x36')]['offset']);}return _0x3a34cc[_0xf0ca('0x63')](_0xe0a8d8);}})[_0xf0ca('0x24')](function(_0x29ac00){if(_0x29ac00){return _0x29ac00?{'count':_0x5807e6,'rows':_0x29ac00}:null;}})['then'](respondWithResult(_0x54f54a,null))[_0xf0ca('0x47')](handleError(_0x54f54a,null));};exports[_0xf0ca('0x65')]=function(_0x42caf1,_0x3f71a5,_0x37c894){var _0x5e26e4=_0x42caf1[_0xf0ca('0x4f')][_0xf0ca('0x66')];return db[_0xf0ca('0x64')][_0xf0ca('0x45')]({'where':{'id':_0x5e26e4},'attributes':['id'],'include':[{'model':db[_0xf0ca('0x67')],'as':'Agents','attributes':['id',_0xf0ca('0x2c'),_0xf0ca('0x68'),_0xf0ca('0x69'),_0xf0ca('0x6a')],'raw':!![]}]})[_0xf0ca('0x24')](function(_0x23313c){if(_0x23313c){var _0x5c7bd3=_[_0xf0ca('0x6b')](_0x23313c,function(_0xdfa18f){var _0x1cfdd6=_0xdfa18f[_0xf0ca('0x25')]({'plain':!![]});return _0x1cfdd6['Agents'];});return db[_0xf0ca('0x30')][_0xf0ca('0x4e')]({'where':{'id':_0x42caf1[_0xf0ca('0x49')]['id']}})[_0xf0ca('0x24')](function(_0x3fb9e4){return db['sequelize'][_0xf0ca('0x6c')](function(_0x1ed9e6){return _0x3fb9e4[_0xf0ca('0x65')](_0x5e26e4,{'transaction':_0x1ed9e6})[_0xf0ca('0x24')](function(){return BPromise[_0xf0ca('0x6d')](_0x5c7bd3,function(_0x598519){return db[_0xf0ca('0x5a')][_0xf0ca('0x6e')]({'where':{'UserId':_0x598519['id'],'FaxQueueId':_0x42caf1[_0xf0ca('0x49')]['id']},'transaction':_0x1ed9e6});});})[_0xf0ca('0x24')](function(){_0x5c7bd3[_0xf0ca('0x6f')](function(_0x3639f5){socket[_0xf0ca('0x70')](_0xf0ca('0x71'),{'UserId':_0x3639f5['id'],'FaxQueueId':_0x3fb9e4['id']});});});});});}})['then'](respondWithStatusCode(_0x3f71a5,null))[_0xf0ca('0x47')](handleError(_0x3f71a5,null));};exports['removeTeams']=function(_0x237c1e,_0x129f75,_0xf65009){return db[_0xf0ca('0x64')][_0xf0ca('0x45')]({'where':{'id':_0x237c1e[_0xf0ca('0x36')][_0xf0ca('0x66')]},'attributes':['id'],'include':[{'model':db[_0xf0ca('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x129f75,null))[_0xf0ca('0x24')](function(_0x15d2eb){var _0x43d43a=_['map'](_0x15d2eb,'id');var _0x430e2e=[];var _0x1c94fd=[];var _0x3d2e34=squel[_0xf0ca('0x72')]();_0x3d2e34[_0xf0ca('0x73')](_0xf0ca('0x74'))[_0xf0ca('0x75')]('team_has_fax_queues','tq')[_0xf0ca('0x76')](_0xf0ca('0x77'),'ut',_0xf0ca('0x78'))[_0xf0ca('0x3e')](_0xf0ca('0x79'),_0x237c1e[_0xf0ca('0x49')]['id']);for(var _0x47fbd3=0x0;_0x47fbd3<_0x15d2eb[_0xf0ca('0x4b')];_0x47fbd3+=0x1){let _0x3d1114=_0x15d2eb[_0x47fbd3];for(var _0x2163af=0x0;_0x2163af<_0x3d1114['Agents'][_0xf0ca('0x4b')];_0x2163af+=0x1){let _0x34e188=_0x3d1114[_0xf0ca('0x7a')][_0x2163af];var _0x31d8b8=_0x3d2e34[_0xf0ca('0x7b')]();_0x31d8b8[_0xf0ca('0x3e')]('ut.UserId\x20=\x20?',_0x34e188['id']);_0x1c94fd[_0xf0ca('0x7c')](db['sequelize'][_0xf0ca('0x36')](_0x31d8b8[_0xf0ca('0x7d')](),{'type':db[_0xf0ca('0x7e')][_0xf0ca('0x7f')][_0xf0ca('0x80')]})['then'](function(_0x501675){if(_0x501675['length']===0x1){return _0x34e188['id'];}else{var _0x3c0062=_[_0xf0ca('0x81')](_[_0xf0ca('0x2f')](_0x501675,'TeamId'),function(_0x17200f){return _['includes'](_0x43d43a,_0x17200f);});if(_0x3c0062){return _0x34e188['id'];}}}));}}return BPromise['all'](_0x1c94fd)[_0xf0ca('0x24')](function(_0x48ed24){_0x430e2e=_(_0x430e2e)[_0xf0ca('0x82')](_0x48ed24)[_0xf0ca('0x83')]()[_0xf0ca('0x84')]();return db[_0xf0ca('0x30')][_0xf0ca('0x4e')]({'where':{'id':_0x237c1e['params']['id']}})[_0xf0ca('0x24')](function(_0x372247){return db[_0xf0ca('0x7e')][_0xf0ca('0x6c')](function(_0x52c685){return _0x372247[_0xf0ca('0x85')](_0x237c1e['query'][_0xf0ca('0x66')],{'transaction':_0x52c685})[_0xf0ca('0x24')](function(){if(!_['isEmpty'](_0x430e2e)){return _0x372247[_0xf0ca('0x86')](_0x430e2e,{'transaction':_0x52c685});}})[_0xf0ca('0x24')](function(){_0x430e2e[_0xf0ca('0x6f')](function(_0x2d3ec8){socket[_0xf0ca('0x70')](_0xf0ca('0x87'),{'UserId':_0x2d3ec8,'FaxQueueId':_0x372247['id']});});});});});});})['then'](respondWithStatusCode(_0x129f75,null))['catch'](handleError(_0x129f75,null));};exports[_0xf0ca('0x88')]=function(_0x3b408c,_0x2760d9,_0xb1a9cb){return db[_0xf0ca('0x30')]['find']({'where':{'id':_0x3b408c['params']['id']}})[_0xf0ca('0x24')](handleEntityNotFound(_0x2760d9,null))[_0xf0ca('0x24')](function(_0x124123){if(_0x124123){return _0x124123[_0xf0ca('0x88')](_0x3b408c['body']['ids'],_['omit'](_0x3b408c[_0xf0ca('0x4f')],['ids','id'])||{})['spread'](function(_0x512d90){for(var _0xda7bae=0x0;_0xda7bae<_0x3b408c[_0xf0ca('0x4f')][_0xf0ca('0x66')][_0xf0ca('0x4b')];_0xda7bae+=0x1){socket[_0xf0ca('0x70')](_0xf0ca('0x71'),{'UserId':_0x3b408c[_0xf0ca('0x4f')][_0xf0ca('0x66')][_0xda7bae],'FaxQueueId':_0x3b408c['params']['id']});}return _0x512d90;});}})[_0xf0ca('0x24')](respondWithResult(_0x2760d9,null))[_0xf0ca('0x47')](handleError(_0x2760d9,null));};exports[_0xf0ca('0x86')]=function(_0x120590,_0x1e2cca,_0x3ce5fc){return db[_0xf0ca('0x30')][_0xf0ca('0x4e')]({'where':{'id':_0x120590[_0xf0ca('0x49')]['id']}})[_0xf0ca('0x24')](handleEntityNotFound(_0x1e2cca,null))[_0xf0ca('0x24')](function(_0x2e1bc2){if(_0x2e1bc2){return _0x2e1bc2[_0xf0ca('0x86')](_0x120590[_0xf0ca('0x36')][_0xf0ca('0x66')])[_0xf0ca('0x24')](function(){if(_['isArray'](_0x120590[_0xf0ca('0x36')][_0xf0ca('0x66')])){for(var _0x3608de=0x0;_0x3608de<_0x120590[_0xf0ca('0x36')][_0xf0ca('0x66')]['length'];_0x3608de+=0x1){socket['emit'](_0xf0ca('0x87'),{'UserId':Number(_0x120590[_0xf0ca('0x36')][_0xf0ca('0x66')][_0x3608de]),'FaxQueueId':Number(_0x120590[_0xf0ca('0x49')]['id'])});}}else{socket[_0xf0ca('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x120590['query'][_0xf0ca('0x66')]),'FaxQueueId':Number(_0x120590['params']['id'])});}});}})[_0xf0ca('0x24')](respondWithStatusCode(_0x1e2cca,null))['catch'](handleError(_0x1e2cca,null));};exports[_0xf0ca('0x89')]=function(_0x383ddd,_0x320a1c,_0x4a94df){var _0x1cb0e1={};var _0x2eb3cb={};var _0x511ae9;var _0x19bfe2;return db['FaxQueue']['findOne']({'where':{'id':_0x383ddd[_0xf0ca('0x49')]['id']}})[_0xf0ca('0x24')](handleEntityNotFound(_0x320a1c,null))[_0xf0ca('0x24')](function(_0x2eacdd){if(_0x2eacdd){_0x511ae9=_0x2eacdd;_0x2eb3cb[_0xf0ca('0x35')]=_[_0xf0ca('0x37')](db[_0xf0ca('0x67')][_0xf0ca('0x31')]);_0x2eb3cb[_0xf0ca('0x36')]=_[_0xf0ca('0x37')](_0x383ddd[_0xf0ca('0x36')]);_0x2eb3cb[_0xf0ca('0x3f')]=_[_0xf0ca('0x38')](_0x2eb3cb[_0xf0ca('0x35')],_0x2eb3cb['query']);_0x1cb0e1[_0xf0ca('0x39')]=_['intersection'](_0x2eb3cb[_0xf0ca('0x35')],qs[_0xf0ca('0x4a')](_0x383ddd['query']['fields']));_0x1cb0e1[_0xf0ca('0x39')]=_0x1cb0e1[_0xf0ca('0x39')]['length']?_0x1cb0e1['attributes']:_0x2eb3cb[_0xf0ca('0x35')];_0x1cb0e1[_0xf0ca('0x3c')]=qs[_0xf0ca('0x3d')](_0x383ddd[_0xf0ca('0x36')]['sort']);_0x1cb0e1[_0xf0ca('0x3e')]=qs[_0xf0ca('0x3f')](_[_0xf0ca('0x40')](_0x383ddd[_0xf0ca('0x36')],_0x2eb3cb[_0xf0ca('0x3f')]));if(_0x383ddd[_0xf0ca('0x36')][_0xf0ca('0x41')]){_0x1cb0e1[_0xf0ca('0x3e')]=_['merge'](_0x1cb0e1['where'],{'$or':_[_0xf0ca('0x2f')](_0x1cb0e1[_0xf0ca('0x39')],function(_0x59c79c){var _0x2a3ed4={};_0x2a3ed4[_0x59c79c]={'$like':'%'+_0x383ddd['query']['filter']+'%'};return _0x2a3ed4;})});}_0x1cb0e1=_['merge']({},_0x1cb0e1,_0x383ddd[_0xf0ca('0x44')]);return _0x511ae9[_0xf0ca('0x89')](_0x1cb0e1);}})[_0xf0ca('0x24')](function(_0x1dfb5e){if(_0x1dfb5e){_0x19bfe2=_0x1dfb5e[_0xf0ca('0x4b')];if(!_0x383ddd[_0xf0ca('0x36')][_0xf0ca('0x3a')]('nolimit')){_0x1cb0e1[_0xf0ca('0x1d')]=qs[_0xf0ca('0x1d')](_0x383ddd[_0xf0ca('0x36')]['limit']);_0x1cb0e1[_0xf0ca('0x1c')]=qs[_0xf0ca('0x1c')](_0x383ddd[_0xf0ca('0x36')][_0xf0ca('0x1c')]);}return _0x511ae9['getAgents'](_0x1cb0e1);}})[_0xf0ca('0x24')](function(_0x527054){if(_0x527054){return _0x527054?{'count':_0x19bfe2,'rows':_0x527054}:null;}})[_0xf0ca('0x24')](respondWithResult(_0x320a1c,null))[_0xf0ca('0x47')](handleError(_0x320a1c,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index adddcdb..51eaf21 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 _0xe27e=['exports','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0xe27e,0x7f));var _0xee27=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xe27e[_0x49052b];return _0x48c045;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xee27('0x0')](0x0);var events={'afterCreate':_0xee27('0x1'),'afterUpdate':'update','afterDestroy':_0xee27('0x2')};function emitEvent(_0x271ca0){return function(_0x5e083b,_0x9c3110,_0xb230b2){FaxQueueEvents[_0xee27('0x3')](_0x271ca0+':'+_0x5e083b['id'],_0x5e083b);FaxQueueEvents[_0xee27('0x3')](_0x271ca0,_0x5e083b);_0xb230b2(null);};}for(var e in events){if(events[_0xee27('0x4')](e)){var event=events[e];FaxQueue[_0xee27('0x5')](e,emitEvent(event));}}module[_0xee27('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x7ffc=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxQueue'];(function(_0x12551a,_0x5af080){var _0x6f8fc0=function(_0xe92756){while(--_0xe92756){_0x12551a['push'](_0x12551a['shift']());}};_0x6f8fc0(++_0x5af080);}(_0x7ffc,0x173));var _0xc7ff=function(_0x1324ec,_0x3c781b){_0x1324ec=_0x1324ec-0x0;var _0x2c76e1=_0x7ffc[_0x1324ec];return _0x2c76e1;};'use strict';var EventEmitter=require(_0xc7ff('0x0'));var FaxQueue=require(_0xc7ff('0x1'))['db'][_0xc7ff('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xc7ff('0x3')](0x0);var events={'afterCreate':_0xc7ff('0x4'),'afterUpdate':_0xc7ff('0x5'),'afterDestroy':_0xc7ff('0x6')};function emitEvent(_0x3c1982){return function(_0x3bcd2d,_0x4a96c4,_0x5763a7){FaxQueueEvents[_0xc7ff('0x7')](_0x3c1982+':'+_0x3bcd2d['id'],_0x3bcd2d);FaxQueueEvents['emit'](_0x3c1982,_0x3bcd2d);_0x5763a7(null);};}for(var e in events){if(events[_0xc7ff('0x8')](e)){var event=events[e];FaxQueue[_0xc7ff('0x9')](e,emitEvent(event));}}module[_0xc7ff('0xa')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 45f2620..0531a41 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 _0xfa50=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxQueue','fax_queues','lodash'];(function(_0x4ab440,_0x36e5a){var _0x1d44ac=function(_0x18563b){while(--_0x18563b){_0x4ab440['push'](_0x4ab440['shift']());}};_0x1d44ac(++_0x36e5a);}(_0xfa50,0x1d8));var _0x0fa5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0fa5('0x0'));var util=require(_0x0fa5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0fa5('0x2'));var BPromise=require(_0x0fa5('0x3'));var rp=require(_0x0fa5('0x4'));var fs=require('fs');var path=require(_0x0fa5('0x5'));var rimraf=require(_0x0fa5('0x6'));var config=require(_0x0fa5('0x7'));var attributes=require('./faxQueue.attributes');module[_0x0fa5('0x8')]=function(_0x57f0a9,_0x441027){return _0x57f0a9['define'](_0x0fa5('0x9'),attributes,{'tableName':_0x0fa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe03f=['fax_queues','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueue.attributes','exports','define','FaxQueue'];(function(_0x564dff,_0x32bdc5){var _0x283988=function(_0x289c8d){while(--_0x289c8d){_0x564dff['push'](_0x564dff['shift']());}};_0x283988(++_0x32bdc5);}(_0xe03f,0xf1));var _0xfe03=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe03f[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xfe03('0x0'));var logger=require(_0xfe03('0x1'))('api');var moment=require(_0xfe03('0x2'));var BPromise=require(_0xfe03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe03('0x4'));var rimraf=require(_0xfe03('0x5'));var config=require(_0xfe03('0x6'));var attributes=require(_0xfe03('0x7'));module[_0xfe03('0x8')]=function(_0x5dcdaa,_0x36cf88){return _0x5dcdaa[_0xfe03('0x9')](_0xfe03('0xa'),attributes,{'tableName':_0xfe03('0xb'),'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 5ffd235..95a57c3 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 _0xe439=['GetFaxQueue','FaxQueue','options','raw','where','limit','map','include','model','attributes','info','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x55f972,_0x438856){var _0x364da8=function(_0x1b8b9b){while(--_0x1b8b9b){_0x55f972['push'](_0x55f972['shift']());}};_0x364da8(++_0x438856);}(_0xe439,0x1ba));var _0x9e43=function(_0x1cd1b1,_0x56069){_0x1cd1b1=_0x1cd1b1-0x0;var _0x53b104=_0xe439[_0x1cd1b1];return _0x53b104;};'use strict';var _=require(_0x9e43('0x0'));var util=require(_0x9e43('0x1'));var moment=require(_0x9e43('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e43('0x3'));var fs=require('fs');var Redis=require(_0x9e43('0x4'));var db=require(_0x9e43('0x5'))['db'];var utils=require(_0x9e43('0x6'));var logger=require(_0x9e43('0x7'))('rpc');var config=require(_0x9e43('0x8'));var jayson=require(_0x9e43('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9e43('0xa')]=_[_0x9e43('0xb')](config[_0x9e43('0xa')],{'host':_0x9e43('0xc'),'port':0x18eb});var socket=require(_0x9e43('0xd'))(new Redis(config[_0x9e43('0xa')]));require(_0x9e43('0xe'))[_0x9e43('0xf')](socket);function respondWithRpcPromise(_0x762029,_0x3403d4,_0x2930a7){return new BPromise(function(_0x59a129,_0x649d42){return client['request'](_0x762029,_0x2930a7)[_0x9e43('0x10')](function(_0x18c635){logger['info'](_0x9e43('0x11'),_0x3403d4,_0x9e43('0x12'));logger[_0x9e43('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3403d4,_0x9e43('0x12'),JSON[_0x9e43('0x14')](_0x18c635));if(_0x18c635[_0x9e43('0x15')]){if(_0x18c635[_0x9e43('0x15')][_0x9e43('0x16')]===0x1f4){logger[_0x9e43('0x15')](_0x9e43('0x11'),_0x3403d4,_0x18c635['error'][_0x9e43('0x17')]);return _0x649d42(_0x18c635[_0x9e43('0x15')][_0x9e43('0x17')]);}logger[_0x9e43('0x15')](_0x9e43('0x11'),_0x3403d4,_0x18c635[_0x9e43('0x15')]['message']);return _0x59a129(_0x18c635['error'][_0x9e43('0x17')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x3403d4,'request\x20sent');_0x59a129(_0x18c635[_0x9e43('0x18')][_0x9e43('0x17')]);}})[_0x9e43('0x19')](function(_0x253492){logger[_0x9e43('0x15')]('FaxQueue,\x20%s,\x20%s',_0x3403d4,_0x253492);_0x649d42(_0x253492);});});}exports[_0x9e43('0x1a')]=function(_0x3768e2){var _0x50b534=this;return new Promise(function(_0x291c0b,_0x4c670c){return db[_0x9e43('0x1b')]['findAll']({'raw':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x1d')]===undefined?!![]:![]:!![],'where':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x1e')]||null:null,'attributes':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')]['attributes']||null:null,'limit':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x1f')]||null:null,'include':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')]['include']?_[_0x9e43('0x20')](_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x21')],function(_0x315060){return{'model':db[_0x315060['model']],'as':_0x315060['as'],'attributes':_0x315060['attributes'],'include':_0x315060[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x315060['include'],function(_0x2e4144){return{'model':db[_0x2e4144[_0x9e43('0x22')]],'as':_0x2e4144['as'],'attributes':_0x2e4144[_0x9e43('0x23')],'include':_0x2e4144[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x2e4144[_0x9e43('0x21')],function(_0x5bcca4){return{'model':db[_0x5bcca4[_0x9e43('0x22')]],'as':_0x5bcca4['as'],'attributes':_0x5bcca4['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e43('0x10')](function(_0x47c16d){logger[_0x9e43('0x24')](_0x9e43('0x1a'),_0x3768e2);logger[_0x9e43('0x13')]('GetFaxQueue',_0x3768e2,JSON[_0x9e43('0x14')](_0x47c16d));_0x291c0b(_0x47c16d);})['catch'](function(_0x42684f){logger[_0x9e43('0x15')](_0x9e43('0x1a'),_0x42684f[_0x9e43('0x17')],_0x3768e2);_0x4c670c(_0x50b534[_0x9e43('0x15')](0x1f4,_0x42684f[_0x9e43('0x17')]));});});};exports[_0x9e43('0x25')]=function(_0x3976c8){var _0x9c0adf=this;return new Promise(function(_0x153767,_0x470363){return db['FaxQueue'][_0x9e43('0x26')]({'raw':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8[_0x9e43('0x1c')][_0x9e43('0x1d')]===undefined?!![]:![]:!![],'where':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8['options']['where']||null:null,'attributes':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8[_0x9e43('0x1c')]['attributes']||null:null,'include':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8[_0x9e43('0x1c')][_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x3976c8[_0x9e43('0x1c')]['include'],function(_0x3d29ab){return{'model':db[_0x3d29ab['model']],'as':_0x3d29ab['as'],'attributes':_0x3d29ab[_0x9e43('0x23')],'include':_0x3d29ab[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x3d29ab[_0x9e43('0x21')],function(_0x1792f5){return{'model':db[_0x1792f5[_0x9e43('0x22')]],'as':_0x1792f5['as'],'attributes':_0x1792f5['attributes'],'include':_0x1792f5[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x1792f5['include'],function(_0x12d3d2){return{'model':db[_0x12d3d2[_0x9e43('0x22')]],'as':_0x12d3d2['as'],'attributes':_0x12d3d2[_0x9e43('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9e43('0x10')](function(_0x22a6a8){logger[_0x9e43('0x24')](_0x9e43('0x25'),_0x3976c8);logger[_0x9e43('0x13')]('ShowFaxQueue',_0x3976c8,JSON['stringify'](_0x22a6a8));_0x153767(_0x22a6a8);})[_0x9e43('0x19')](function(_0x1ee727){logger[_0x9e43('0x15')]('ShowFaxQueue',_0x1ee727[_0x9e43('0x17')],_0x3976c8);_0x470363(_0x9c0adf[_0x9e43('0x15')](0x1f4,_0x1ee727[_0x9e43('0x17')]));});});}; \ No newline at end of file +var _0x224c=['../../config/utils','rpc','jayson/promise','redis','defaults','localhost','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFaxQueue','FaxQueue','findAll','options','attributes','map','include','model','catch','ShowFaxQueue','find','raw','where','util','bluebird','randomstring','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x224c,0x68));var _0xc224=function(_0x288744,_0xd26dd4){_0x288744=_0x288744-0x0;var _0x2b6a73=_0x224c[_0x288744];return _0x2b6a73;};'use strict';var _=require('lodash');var util=require(_0xc224('0x0'));var moment=require('moment');var BPromise=require(_0xc224('0x1'));var rs=require(_0xc224('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc224('0x3'))['db'];var utils=require(_0xc224('0x4'));var logger=require('../../config/logger')(_0xc224('0x5'));var config=require('../../config/environment');var jayson=require(_0xc224('0x6'));var client=jayson['client']['http']({'port':0x232a});config[_0xc224('0x7')]=_[_0xc224('0x8')](config['redis'],{'host':_0xc224('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc224('0xa'))[_0xc224('0xb')](socket);function respondWithRpcPromise(_0x2561b9,_0x2660d2,_0x52d3b8){return new BPromise(function(_0x498cd1,_0x1e349e){return client['request'](_0x2561b9,_0x52d3b8)[_0xc224('0xc')](function(_0x3f5d4d){logger[_0xc224('0xd')](_0xc224('0xe'),_0x2660d2,_0xc224('0xf'));logger[_0xc224('0x10')](_0xc224('0x11'),_0x2660d2,_0xc224('0xf'),JSON[_0xc224('0x12')](_0x3f5d4d));if(_0x3f5d4d['error']){if(_0x3f5d4d[_0xc224('0x13')][_0xc224('0x14')]===0x1f4){logger[_0xc224('0x13')](_0xc224('0xe'),_0x2660d2,_0x3f5d4d[_0xc224('0x13')][_0xc224('0x15')]);return _0x1e349e(_0x3f5d4d['error']['message']);}logger[_0xc224('0x13')](_0xc224('0xe'),_0x2660d2,_0x3f5d4d['error']['message']);return _0x498cd1(_0x3f5d4d[_0xc224('0x13')][_0xc224('0x15')]);}else{logger['info'](_0xc224('0xe'),_0x2660d2,_0xc224('0xf'));_0x498cd1(_0x3f5d4d[_0xc224('0x16')][_0xc224('0x15')]);}})['catch'](function(_0xb48eb){logger['error'](_0xc224('0xe'),_0x2660d2,_0xb48eb);_0x1e349e(_0xb48eb);});});}exports[_0xc224('0x17')]=function(_0x5a9705){var _0x11a4e0=this;return new Promise(function(_0x52e489,_0x20ad28){return db[_0xc224('0x18')][_0xc224('0x19')]({'raw':_0x5a9705[_0xc224('0x1a')]?_0x5a9705[_0xc224('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x5a9705[_0xc224('0x1a')]?_0x5a9705[_0xc224('0x1a')]['where']||null:null,'attributes':_0x5a9705[_0xc224('0x1a')]?_0x5a9705[_0xc224('0x1a')][_0xc224('0x1b')]||null:null,'limit':_0x5a9705['options']?_0x5a9705[_0xc224('0x1a')]['limit']||null:null,'include':_0x5a9705[_0xc224('0x1a')]?_0x5a9705[_0xc224('0x1a')]['include']?_[_0xc224('0x1c')](_0x5a9705[_0xc224('0x1a')][_0xc224('0x1d')],function(_0x2337fe){return{'model':db[_0x2337fe['model']],'as':_0x2337fe['as'],'attributes':_0x2337fe[_0xc224('0x1b')],'include':_0x2337fe['include']?_['map'](_0x2337fe[_0xc224('0x1d')],function(_0x54149d){return{'model':db[_0x54149d[_0xc224('0x1e')]],'as':_0x54149d['as'],'attributes':_0x54149d[_0xc224('0x1b')],'include':_0x54149d[_0xc224('0x1d')]?_['map'](_0x54149d[_0xc224('0x1d')],function(_0x364c7b){return{'model':db[_0x364c7b[_0xc224('0x1e')]],'as':_0x364c7b['as'],'attributes':_0x364c7b['attributes']};}):[]};}):[]};}):[]:[]})[_0xc224('0xc')](function(_0x419293){logger[_0xc224('0xd')]('GetFaxQueue',_0x5a9705);logger[_0xc224('0x10')]('GetFaxQueue',_0x5a9705,JSON[_0xc224('0x12')](_0x419293));_0x52e489(_0x419293);})[_0xc224('0x1f')](function(_0x420282){logger[_0xc224('0x13')](_0xc224('0x17'),_0x420282[_0xc224('0x15')],_0x5a9705);_0x20ad28(_0x11a4e0['error'](0x1f4,_0x420282['message']));});});};exports[_0xc224('0x20')]=function(_0xdfeb7c){var _0x542663=this;return new Promise(function(_0x4d0b8d,_0x1e40dd){return db[_0xc224('0x18')][_0xc224('0x21')]({'raw':_0xdfeb7c[_0xc224('0x1a')]?_0xdfeb7c[_0xc224('0x1a')][_0xc224('0x22')]===undefined?!![]:![]:!![],'where':_0xdfeb7c['options']?_0xdfeb7c[_0xc224('0x1a')][_0xc224('0x23')]||null:null,'attributes':_0xdfeb7c[_0xc224('0x1a')]?_0xdfeb7c['options']['attributes']||null:null,'include':_0xdfeb7c[_0xc224('0x1a')]?_0xdfeb7c[_0xc224('0x1a')][_0xc224('0x1d')]?_['map'](_0xdfeb7c['options'][_0xc224('0x1d')],function(_0x985db8){return{'model':db[_0x985db8[_0xc224('0x1e')]],'as':_0x985db8['as'],'attributes':_0x985db8[_0xc224('0x1b')],'include':_0x985db8['include']?_['map'](_0x985db8[_0xc224('0x1d')],function(_0x26160a){return{'model':db[_0x26160a[_0xc224('0x1e')]],'as':_0x26160a['as'],'attributes':_0x26160a['attributes'],'include':_0x26160a['include']?_['map'](_0x26160a[_0xc224('0x1d')],function(_0x539138){return{'model':db[_0x539138[_0xc224('0x1e')]],'as':_0x539138['as'],'attributes':_0x539138[_0xc224('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xc224('0xc')](function(_0x424fe5){logger[_0xc224('0xd')](_0xc224('0x20'),_0xdfeb7c);logger[_0xc224('0x10')](_0xc224('0x20'),_0xdfeb7c,JSON['stringify'](_0x424fe5));_0x4d0b8d(_0x424fe5);})[_0xc224('0x1f')](function(_0x4255c6){logger[_0xc224('0x13')](_0xc224('0x20'),_0x4255c6[_0xc224('0x15')],_0xdfeb7c);_0x1e40dd(_0x542663[_0xc224('0x13')](0x1f4,_0x4255c6['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 646b0b1..9793e76 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 _0x7844=['update','emit','length','faxQueue:','./faxQueue.events'];(function(_0x46b832,_0x1700ce){var _0x565681=function(_0x5d2e4d){while(--_0x5d2e4d){_0x46b832['push'](_0x46b832['shift']());}};_0x565681(++_0x1700ce);}(_0x7844,0x1e4));var _0x4784=function(_0x179fa4,_0x35944e){_0x179fa4=_0x179fa4-0x0;var _0x3e7db6=_0x7844[_0x179fa4];return _0x3e7db6;};'use strict';var FaxQueueEvents=require(_0x4784('0x0'));var events=['save','remove',_0x4784('0x1')];function createListener(_0x4b9161,_0x52ecab){return function(_0x1fc8d7){_0x52ecab[_0x4784('0x2')](_0x4b9161,_0x1fc8d7);};}function removeListener(_0x8662ab,_0x559dc3){return function(){FaxQueueEvents['removeListener'](_0x8662ab,_0x559dc3);};}exports['register']=function(_0x278fb2){for(var _0x3e50a0=0x0,_0x449ccf=events[_0x4784('0x3')];_0x3e50a0<_0x449ccf;_0x3e50a0++){var _0x55c423=events[_0x3e50a0];var _0x38cb39=createListener(_0x4784('0x4')+_0x55c423,_0x278fb2);FaxQueueEvents['on'](_0x55c423,_0x38cb39);}}; \ No newline at end of file +var _0xbbb6=['removeListener','length','faxQueue:','save','remove','update'];(function(_0x4aae92,_0x28cffd){var _0x211d0a=function(_0x1dff88){while(--_0x1dff88){_0x4aae92['push'](_0x4aae92['shift']());}};_0x211d0a(++_0x28cffd);}(_0xbbb6,0x129));var _0x6bbb=function(_0x52a804,_0x393234){_0x52a804=_0x52a804-0x0;var _0x72b338=_0xbbb6[_0x52a804];return _0x72b338;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0x6bbb('0x0'),_0x6bbb('0x1'),_0x6bbb('0x2')];function createListener(_0x3af011,_0x5da5a3){return function(_0x456ac5){_0x5da5a3['emit'](_0x3af011,_0x456ac5);};}function removeListener(_0xd51bb4,_0x1d2d03){return function(){FaxQueueEvents[_0x6bbb('0x3')](_0xd51bb4,_0x1d2d03);};}exports['register']=function(_0x9047ac){for(var _0x407c34=0x0,_0x23d9bb=events[_0x6bbb('0x4')];_0x407c34<_0x23d9bb;_0x407c34++){var _0xb02959=events[_0x407c34];var _0x2b1c5a=createListener(_0x6bbb('0x5')+_0xb02959,_0x9047ac);FaxQueueEvents['on'](_0xb02959,_0x2b1c5a);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 4df8226..e0a7d67 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 _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x4fb614,_0x3f1326){var _0x14222b=function(_0x5e3873){while(--_0x5e3873){_0x4fb614['push'](_0x4fb614['shift']());}};_0x14222b(++_0x3f1326);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x229f17,_0x2c070f){var _0x502cb4=function(_0x5a35bd){while(--_0x5a35bd){_0x229f17['push'](_0x229f17['shift']());}};_0x502cb4(++_0x2c070f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index fed92d6..f7dd15e 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 _0x6a41=['exports','DATE','STRING','moment','sequelize'];(function(_0x4e83c9,_0x403cec){var _0x5a7112=function(_0x20557a){while(--_0x20557a){_0x4e83c9['push'](_0x4e83c9['shift']());}};_0x5a7112(++_0x403cec);}(_0x6a41,0xc6));var _0x16a4=function(_0x1a8a39,_0x3ab2b5){_0x1a8a39=_0x1a8a39-0x0;var _0x1f7c6c=_0x6a41[_0x1a8a39];return _0x1f7c6c;};'use strict';var moment=require(_0x16a4('0x0'));var Sequelize=require(_0x16a4('0x1'));module[_0x16a4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x16a4('0x3')]},'leaveAt':{'type':Sequelize[_0x16a4('0x3')]},'acceptAt':{'type':Sequelize[_0x16a4('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x16a4('0x4')]}}; \ No newline at end of file +var _0x6ec8=['STRING','DATE','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ec8,0x15e));var _0x86ec=function(_0x23516c,_0x16ea34){_0x23516c=_0x23516c-0x0;var _0x591310=_0x6ec8[_0x23516c];return _0x591310;};'use strict';var moment=require('moment');var Sequelize=require(_0x86ec('0x0'));module[_0x86ec('0x1')]={'uniqueid':{'type':Sequelize[_0x86ec('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x86ec('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x86ec('0x3')]},'reason':{'type':Sequelize[_0x86ec('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index dd342f6..d61bcd2 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 _0xed67=['model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FaxQueueReport','count','includeAll','findAll','rows','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes'];(function(_0x43576f,_0x1356ed){var _0x4d2466=function(_0x865deb){while(--_0x865deb){_0x43576f['push'](_0x43576f['shift']());}};_0x4d2466(++_0x1356ed);}(_0xed67,0x1c1));var _0x7ed6=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xed67[_0x36ed48];return _0x51c63a;};'use strict';var pdf=require(_0x7ed6('0x0'));var emlformat=require(_0x7ed6('0x1'));var rimraf=require(_0x7ed6('0x2'));var zipdir=require(_0x7ed6('0x3'));var jsonpatch=require(_0x7ed6('0x4'));var rp=require(_0x7ed6('0x5'));var moment=require(_0x7ed6('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7ed6('0x7'));var util=require(_0x7ed6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7ed6('0x9'));var ejs=require(_0x7ed6('0xa'));var fs=require('fs');var _=require(_0x7ed6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ed6('0xc'));var deskjs=require(_0x7ed6('0xd'));var toCsv=require(_0x7ed6('0x9'));var querystring=require(_0x7ed6('0xe'));var Papa=require(_0x7ed6('0xf'));var Redis=require(_0x7ed6('0x10'));var authService=require(_0x7ed6('0x11'));var qs=require(_0x7ed6('0x12'));var as=require(_0x7ed6('0x13'));var hardwareService=require(_0x7ed6('0x14'));var logger=require(_0x7ed6('0x15'))(_0x7ed6('0x16'));var utils=require('../../config/utils');var config=require(_0x7ed6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e8e3a,_0x3b12f4){_0x3b12f4=_0x3b12f4||0xcc;return function(_0x5eb474){if(_0x5eb474){return _0x1e8e3a['sendStatus'](_0x3b12f4);}return _0x1e8e3a[_0x7ed6('0x18')](_0x3b12f4)[_0x7ed6('0x19')]();};}function respondWithResult(_0x26d627,_0x383c4d){_0x383c4d=_0x383c4d||0xc8;return function(_0xbd53ce){if(_0xbd53ce){return _0x26d627[_0x7ed6('0x18')](_0x383c4d)['json'](_0xbd53ce);}};}function respondWithFilteredResult(_0xe2afd5,_0x2eca6c){return function(_0x5424c0){if(_0x5424c0){var _0x4acf62=_0x5424c0['count'],_0x468bcd=_0x2eca6c['offset'],_0x360ec7=_0x2eca6c[_0x7ed6('0x1a')]+_0x2eca6c[_0x7ed6('0x1b')],_0x43fb79;if(_0x360ec7>=_0x4acf62){_0x360ec7=_0x4acf62;_0x43fb79=0xc8;}else{_0x43fb79=0xce;}_0xe2afd5[_0x7ed6('0x18')](_0x43fb79);return _0xe2afd5['set'](_0x7ed6('0x1c'),_0x468bcd+'-'+_0x360ec7+'/'+_0x4acf62)['json'](_0x5424c0);}return null;};}function patchUpdates(_0x4798a4){return function(_0x314cca){try{jsonpatch[_0x7ed6('0x1d')](_0x314cca,_0x4798a4,!![]);}catch(_0x36409c){return BPromise[_0x7ed6('0x1e')](_0x36409c);}return _0x314cca['save']();};}function saveUpdates(_0x2375f9,_0xe85baa){return function(_0x323166){if(_0x323166){return _0x323166[_0x7ed6('0x1f')](_0x2375f9)[_0x7ed6('0x20')](function(_0x43bc78){return _0x43bc78;});}return null;};}function removeEntity(_0x1bf285,_0xf723aa){return function(_0x2eb1e6){if(_0x2eb1e6){return _0x2eb1e6[_0x7ed6('0x21')]()[_0x7ed6('0x20')](function(){_0x1bf285[_0x7ed6('0x18')](0xcc)[_0x7ed6('0x19')]();});}};}function handleEntityNotFound(_0x1c0bd6,_0xc8aba6){return function(_0x259769){if(!_0x259769){_0x1c0bd6[_0x7ed6('0x22')](0x194);}return _0x259769;};}function handleError(_0x103a22,_0x314afa){_0x314afa=_0x314afa||0x1f4;return function(_0x2f1363){logger['error'](_0x2f1363[_0x7ed6('0x23')]);if(_0x2f1363[_0x7ed6('0x24')]){delete _0x2f1363[_0x7ed6('0x24')];}_0x103a22[_0x7ed6('0x18')](_0x314afa)[_0x7ed6('0x25')](_0x2f1363);};}exports['index']=function(_0x5c2f7c,_0xc8e232){var _0x46221a={},_0x56a50b={},_0x25e29a={'count':0x0,'rows':[]};var _0x3b3961=_[_0x7ed6('0x26')](db['FaxQueueReport'][_0x7ed6('0x27')],function(_0x2ad1f6){return{'name':_0x2ad1f6[_0x7ed6('0x28')],'type':_0x2ad1f6[_0x7ed6('0x29')][_0x7ed6('0x2a')]};});_0x56a50b['model']=_[_0x7ed6('0x26')](_0x3b3961,_0x7ed6('0x24'));_0x56a50b[_0x7ed6('0x2b')]=_[_0x7ed6('0x2c')](_0x5c2f7c['query']);_0x56a50b[_0x7ed6('0x2d')]=_[_0x7ed6('0x2e')](_0x56a50b['model'],_0x56a50b[_0x7ed6('0x2b')]);_0x46221a[_0x7ed6('0x2f')]=_[_0x7ed6('0x2e')](_0x56a50b[_0x7ed6('0x30')],qs['fields'](_0x5c2f7c['query'][_0x7ed6('0x31')]));_0x46221a[_0x7ed6('0x2f')]=_0x46221a[_0x7ed6('0x2f')][_0x7ed6('0x32')]?_0x46221a['attributes']:_0x56a50b[_0x7ed6('0x30')];if(!_0x5c2f7c[_0x7ed6('0x2b')]['hasOwnProperty'](_0x7ed6('0x33'))){_0x46221a['limit']=qs[_0x7ed6('0x1b')](_0x5c2f7c[_0x7ed6('0x2b')]['limit']);_0x46221a[_0x7ed6('0x1a')]=qs[_0x7ed6('0x1a')](_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x1a')]);}_0x46221a[_0x7ed6('0x34')]=qs[_0x7ed6('0x35')](_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x35')]);_0x46221a['where']=qs['filters'](_[_0x7ed6('0x36')](_0x5c2f7c[_0x7ed6('0x2b')],_0x56a50b[_0x7ed6('0x2d')]));if(_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x37')]){_0x46221a[_0x7ed6('0x38')]=_[_0x7ed6('0x39')](_0x46221a['where'],{'$or':_[_0x7ed6('0x26')](_0x3b3961,function(_0x2b4454){if(_0x2b4454[_0x7ed6('0x29')]!==_0x7ed6('0x3a')){var _0x3ac9c8={};_0x3ac9c8[_0x2b4454[_0x7ed6('0x24')]]={'$like':'%'+_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x37')]+'%'};return _0x3ac9c8;}})});}_0x46221a=_[_0x7ed6('0x39')]({},_0x46221a,_0x5c2f7c[_0x7ed6('0x3b')]);var _0x1ba565={'where':_0x46221a[_0x7ed6('0x38')]};return db[_0x7ed6('0x3c')][_0x7ed6('0x3d')](_0x1ba565)[_0x7ed6('0x20')](function(_0x52699b){_0x25e29a[_0x7ed6('0x3d')]=_0x52699b;if(_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x3e')]){_0x46221a['include']=[{'all':!![]}];}return db[_0x7ed6('0x3c')][_0x7ed6('0x3f')](_0x46221a);})[_0x7ed6('0x20')](function(_0x7de2e9){_0x25e29a[_0x7ed6('0x40')]=_0x7de2e9;return _0x25e29a;})[_0x7ed6('0x20')](respondWithFilteredResult(_0xc8e232,_0x46221a))['catch'](handleError(_0xc8e232,null));};exports['show']=function(_0x15f59b,_0x4825cd){var _0x2c9967={'raw':!![],'where':{'id':_0x15f59b[_0x7ed6('0x41')]['id']}},_0x3f9a17={};_0x3f9a17['model']=_['keys'](db[_0x7ed6('0x3c')][_0x7ed6('0x27')]);_0x3f9a17[_0x7ed6('0x2b')]=_[_0x7ed6('0x2c')](_0x15f59b[_0x7ed6('0x2b')]);_0x3f9a17['filters']=_[_0x7ed6('0x2e')](_0x3f9a17['model'],_0x3f9a17[_0x7ed6('0x2b')]);_0x2c9967[_0x7ed6('0x2f')]=_[_0x7ed6('0x2e')](_0x3f9a17[_0x7ed6('0x30')],qs[_0x7ed6('0x31')](_0x15f59b[_0x7ed6('0x2b')][_0x7ed6('0x31')]));_0x2c9967[_0x7ed6('0x2f')]=_0x2c9967[_0x7ed6('0x2f')]['length']?_0x2c9967['attributes']:_0x3f9a17[_0x7ed6('0x30')];if(_0x15f59b[_0x7ed6('0x2b')]['includeAll']){_0x2c9967['include']=[{'all':!![]}];}_0x2c9967=_[_0x7ed6('0x39')]({},_0x2c9967,_0x15f59b['options']);return db[_0x7ed6('0x3c')][_0x7ed6('0x42')](_0x2c9967)['then'](handleEntityNotFound(_0x4825cd,null))['then'](respondWithResult(_0x4825cd,null))[_0x7ed6('0x43')](handleError(_0x4825cd,null));};exports[_0x7ed6('0x44')]=function(_0x5689cd,_0x2406e6){return db[_0x7ed6('0x3c')][_0x7ed6('0x44')](_0x5689cd[_0x7ed6('0x45')],{})[_0x7ed6('0x20')](respondWithResult(_0x2406e6,0xc9))['catch'](handleError(_0x2406e6,null));};exports[_0x7ed6('0x1f')]=function(_0x46bc09,_0x269f5b){if(_0x46bc09[_0x7ed6('0x45')]['id']){delete _0x46bc09['body']['id'];}return db['FaxQueueReport'][_0x7ed6('0x42')]({'where':{'id':_0x46bc09[_0x7ed6('0x41')]['id']}})[_0x7ed6('0x20')](handleEntityNotFound(_0x269f5b,null))[_0x7ed6('0x20')](saveUpdates(_0x46bc09['body'],null))[_0x7ed6('0x20')](respondWithResult(_0x269f5b,null))[_0x7ed6('0x43')](handleError(_0x269f5b,null));};exports[_0x7ed6('0x21')]=function(_0x27a0ee,_0x3c30a4){return db['FaxQueueReport']['find']({'where':{'id':_0x27a0ee[_0x7ed6('0x41')]['id']}})[_0x7ed6('0x20')](handleEntityNotFound(_0x3c30a4,null))['then'](removeEntity(_0x3c30a4,null))[_0x7ed6('0x43')](handleError(_0x3c30a4,null));};exports[_0x7ed6('0x46')]=function(_0xd10a95,_0xdea67f){return db[_0x7ed6('0x3c')][_0x7ed6('0x46')]()[_0x7ed6('0x20')](respondWithResult(_0xdea67f,null))[_0x7ed6('0x43')](handleError(_0xdea67f,null));}; \ No newline at end of file +var _0xdb99=['../../config/environment','sendStatus','status','json','count','offset','set','apply','reject','update','then','end','error','stack','name','send','index','map','FaxQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils'];(function(_0xa5ad5c,_0x5b8726){var _0x3ac6ba=function(_0x578288){while(--_0x578288){_0xa5ad5c['push'](_0xa5ad5c['shift']());}};_0x3ac6ba(++_0x5b8726);}(_0xdb99,0x1a6));var _0x9db9=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xdb99[_0x2c7618];return _0x5ce3f0;};'use strict';var pdf=require(_0x9db9('0x0'));var emlformat=require(_0x9db9('0x1'));var rimraf=require(_0x9db9('0x2'));var zipdir=require(_0x9db9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9db9('0x4'));var moment=require(_0x9db9('0x5'));var BPromise=require(_0x9db9('0x6'));var Mustache=require(_0x9db9('0x7'));var util=require(_0x9db9('0x8'));var path=require('path');var sox=require(_0x9db9('0x9'));var csv=require(_0x9db9('0xa'));var ejs=require(_0x9db9('0xb'));var fs=require('fs');var _=require(_0x9db9('0xc'));var squel=require(_0x9db9('0xd'));var crypto=require(_0x9db9('0xe'));var jsforce=require(_0x9db9('0xf'));var deskjs=require(_0x9db9('0x10'));var toCsv=require(_0x9db9('0xa'));var querystring=require('querystring');var Papa=require(_0x9db9('0x11'));var Redis=require('ioredis');var authService=require(_0x9db9('0x12'));var qs=require(_0x9db9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9db9('0x14'));var utils=require(_0x9db9('0x15'));var config=require(_0x9db9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22d55f,_0x16d097){_0x16d097=_0x16d097||0xcc;return function(_0x23de9f){if(_0x23de9f){return _0x22d55f[_0x9db9('0x17')](_0x16d097);}return _0x22d55f[_0x9db9('0x18')](_0x16d097)['end']();};}function respondWithResult(_0xf836a0,_0x16b0a6){_0x16b0a6=_0x16b0a6||0xc8;return function(_0x3376d2){if(_0x3376d2){return _0xf836a0[_0x9db9('0x18')](_0x16b0a6)[_0x9db9('0x19')](_0x3376d2);}};}function respondWithFilteredResult(_0x5551ec,_0x227638){return function(_0x594ac5){if(_0x594ac5){var _0x41a153=_0x594ac5[_0x9db9('0x1a')],_0x4ff091=_0x227638[_0x9db9('0x1b')],_0x253c44=_0x227638[_0x9db9('0x1b')]+_0x227638['limit'],_0x261d9d;if(_0x253c44>=_0x41a153){_0x253c44=_0x41a153;_0x261d9d=0xc8;}else{_0x261d9d=0xce;}_0x5551ec[_0x9db9('0x18')](_0x261d9d);return _0x5551ec[_0x9db9('0x1c')]('Content-Range',_0x4ff091+'-'+_0x253c44+'/'+_0x41a153)[_0x9db9('0x19')](_0x594ac5);}return null;};}function patchUpdates(_0xcea12d){return function(_0x518a16){try{jsonpatch[_0x9db9('0x1d')](_0x518a16,_0xcea12d,!![]);}catch(_0x1d4fb8){return BPromise[_0x9db9('0x1e')](_0x1d4fb8);}return _0x518a16['save']();};}function saveUpdates(_0x13af11,_0x485a65){return function(_0x35903e){if(_0x35903e){return _0x35903e[_0x9db9('0x1f')](_0x13af11)[_0x9db9('0x20')](function(_0x235dd7){return _0x235dd7;});}return null;};}function removeEntity(_0x5562c5,_0x4ca359){return function(_0x4b437f){if(_0x4b437f){return _0x4b437f['destroy']()['then'](function(){_0x5562c5[_0x9db9('0x18')](0xcc)[_0x9db9('0x21')]();});}};}function handleEntityNotFound(_0x40f021,_0x3fa496){return function(_0x564059){if(!_0x564059){_0x40f021[_0x9db9('0x17')](0x194);}return _0x564059;};}function handleError(_0x282db4,_0xb89fb){_0xb89fb=_0xb89fb||0x1f4;return function(_0x1c594b){logger[_0x9db9('0x22')](_0x1c594b[_0x9db9('0x23')]);if(_0x1c594b[_0x9db9('0x24')]){delete _0x1c594b['name'];}_0x282db4['status'](_0xb89fb)[_0x9db9('0x25')](_0x1c594b);};}exports[_0x9db9('0x26')]=function(_0xf1b4c1,_0x1be608){var _0xf9faca={},_0x10a2ce={},_0x2a53ef={'count':0x0,'rows':[]};var _0x60fb95=_[_0x9db9('0x27')](db[_0x9db9('0x28')]['rawAttributes'],function(_0x458f84){return{'name':_0x458f84['fieldName'],'type':_0x458f84[_0x9db9('0x29')][_0x9db9('0x2a')]};});_0x10a2ce[_0x9db9('0x2b')]=_[_0x9db9('0x27')](_0x60fb95,_0x9db9('0x24'));_0x10a2ce[_0x9db9('0x2c')]=_[_0x9db9('0x2d')](_0xf1b4c1[_0x9db9('0x2c')]);_0x10a2ce[_0x9db9('0x2e')]=_[_0x9db9('0x2f')](_0x10a2ce['model'],_0x10a2ce[_0x9db9('0x2c')]);_0xf9faca[_0x9db9('0x30')]=_['intersection'](_0x10a2ce[_0x9db9('0x2b')],qs[_0x9db9('0x31')](_0xf1b4c1[_0x9db9('0x2c')][_0x9db9('0x31')]));_0xf9faca[_0x9db9('0x30')]=_0xf9faca[_0x9db9('0x30')][_0x9db9('0x32')]?_0xf9faca[_0x9db9('0x30')]:_0x10a2ce[_0x9db9('0x2b')];if(!_0xf1b4c1[_0x9db9('0x2c')][_0x9db9('0x33')](_0x9db9('0x34'))){_0xf9faca[_0x9db9('0x35')]=qs[_0x9db9('0x35')](_0xf1b4c1['query'][_0x9db9('0x35')]);_0xf9faca['offset']=qs[_0x9db9('0x1b')](_0xf1b4c1['query'][_0x9db9('0x1b')]);}_0xf9faca[_0x9db9('0x36')]=qs['sort'](_0xf1b4c1[_0x9db9('0x2c')][_0x9db9('0x37')]);_0xf9faca[_0x9db9('0x38')]=qs[_0x9db9('0x2e')](_[_0x9db9('0x39')](_0xf1b4c1[_0x9db9('0x2c')],_0x10a2ce[_0x9db9('0x2e')]));if(_0xf1b4c1['query'][_0x9db9('0x3a')]){_0xf9faca['where']=_[_0x9db9('0x3b')](_0xf9faca[_0x9db9('0x38')],{'$or':_[_0x9db9('0x27')](_0x60fb95,function(_0x384d84){if(_0x384d84['type']!=='VIRTUAL'){var _0x565a7d={};_0x565a7d[_0x384d84[_0x9db9('0x24')]]={'$like':'%'+_0xf1b4c1[_0x9db9('0x2c')]['filter']+'%'};return _0x565a7d;}})});}_0xf9faca=_[_0x9db9('0x3b')]({},_0xf9faca,_0xf1b4c1[_0x9db9('0x3c')]);var _0x127123={'where':_0xf9faca[_0x9db9('0x38')]};return db['FaxQueueReport'][_0x9db9('0x1a')](_0x127123)['then'](function(_0x5ca219){_0x2a53ef[_0x9db9('0x1a')]=_0x5ca219;if(_0xf1b4c1[_0x9db9('0x2c')][_0x9db9('0x3d')]){_0xf9faca['include']=[{'all':!![]}];}return db[_0x9db9('0x28')][_0x9db9('0x3e')](_0xf9faca);})[_0x9db9('0x20')](function(_0x2ebf79){_0x2a53ef[_0x9db9('0x3f')]=_0x2ebf79;return _0x2a53ef;})[_0x9db9('0x20')](respondWithFilteredResult(_0x1be608,_0xf9faca))[_0x9db9('0x40')](handleError(_0x1be608,null));};exports[_0x9db9('0x41')]=function(_0x2dd049,_0x4eaab7){var _0x535236={'raw':!![],'where':{'id':_0x2dd049[_0x9db9('0x42')]['id']}},_0x13042a={};_0x13042a[_0x9db9('0x2b')]=_[_0x9db9('0x2d')](db[_0x9db9('0x28')][_0x9db9('0x43')]);_0x13042a[_0x9db9('0x2c')]=_[_0x9db9('0x2d')](_0x2dd049['query']);_0x13042a[_0x9db9('0x2e')]=_[_0x9db9('0x2f')](_0x13042a['model'],_0x13042a[_0x9db9('0x2c')]);_0x535236[_0x9db9('0x30')]=_[_0x9db9('0x2f')](_0x13042a[_0x9db9('0x2b')],qs[_0x9db9('0x31')](_0x2dd049[_0x9db9('0x2c')]['fields']));_0x535236[_0x9db9('0x30')]=_0x535236[_0x9db9('0x30')][_0x9db9('0x32')]?_0x535236['attributes']:_0x13042a['model'];if(_0x2dd049[_0x9db9('0x2c')][_0x9db9('0x3d')]){_0x535236[_0x9db9('0x44')]=[{'all':!![]}];}_0x535236=_['merge']({},_0x535236,_0x2dd049['options']);return db[_0x9db9('0x28')][_0x9db9('0x45')](_0x535236)[_0x9db9('0x20')](handleEntityNotFound(_0x4eaab7,null))[_0x9db9('0x20')](respondWithResult(_0x4eaab7,null))[_0x9db9('0x40')](handleError(_0x4eaab7,null));};exports[_0x9db9('0x46')]=function(_0x28d33b,_0xea8256){return db[_0x9db9('0x28')][_0x9db9('0x46')](_0x28d33b[_0x9db9('0x47')],{})[_0x9db9('0x20')](respondWithResult(_0xea8256,0xc9))['catch'](handleError(_0xea8256,null));};exports['update']=function(_0x134fad,_0x3467e5){if(_0x134fad[_0x9db9('0x47')]['id']){delete _0x134fad[_0x9db9('0x47')]['id'];}return db[_0x9db9('0x28')][_0x9db9('0x45')]({'where':{'id':_0x134fad['params']['id']}})['then'](handleEntityNotFound(_0x3467e5,null))[_0x9db9('0x20')](saveUpdates(_0x134fad[_0x9db9('0x47')],null))[_0x9db9('0x20')](respondWithResult(_0x3467e5,null))[_0x9db9('0x40')](handleError(_0x3467e5,null));};exports[_0x9db9('0x48')]=function(_0x33a542,_0x3c5393){return db[_0x9db9('0x28')]['find']({'where':{'id':_0x33a542[_0x9db9('0x42')]['id']}})[_0x9db9('0x20')](handleEntityNotFound(_0x3c5393,null))['then'](removeEntity(_0x3c5393,null))[_0x9db9('0x40')](handleError(_0x3c5393,null));};exports[_0x9db9('0x49')]=function(_0x2964ca,_0x231ea1){return db[_0x9db9('0x28')][_0x9db9('0x49')]()[_0x9db9('0x20')](respondWithResult(_0x231ea1,null))[_0x9db9('0x40')](handleError(_0x231ea1,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 64116d4..c9e4d41 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 _0xb098=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue'];(function(_0x46c2d5,_0x25c1bc){var _0x4e4c46=function(_0x8b6cb){while(--_0x8b6cb){_0x46c2d5['push'](_0x46c2d5['shift']());}};_0x4e4c46(++_0x25c1bc);}(_0xb098,0x1b3));var _0x8b09=function(_0x568f84,_0x149d76){_0x568f84=_0x568f84-0x0;var _0x1929f8=_0xb098[_0x568f84];return _0x1929f8;};'use strict';var _=require(_0x8b09('0x0'));var util=require(_0x8b09('0x1'));var logger=require(_0x8b09('0x2'))(_0x8b09('0x3'));var moment=require('moment');var BPromise=require(_0x8b09('0x4'));var rp=require(_0x8b09('0x5'));var fs=require('fs');var path=require(_0x8b09('0x6'));var rimraf=require(_0x8b09('0x7'));var config=require(_0x8b09('0x8'));var attributes=require(_0x8b09('0x9'));module[_0x8b09('0xa')]=function(_0x3ba605,_0x382f43){return _0x3ba605['define'](_0x8b09('0xb'),attributes,{'tableName':_0x8b09('0xc'),'paranoid':![],'indexes':[{'name':_0x8b09('0xd'),'fields':[_0x8b09('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3715=['exports','define','uniqueid','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./faxQueueReport.attributes'];(function(_0x3b3566,_0x1fbd4f){var _0x5ec105=function(_0x4621ee){while(--_0x4621ee){_0x3b3566['push'](_0x3b3566['shift']());}};_0x5ec105(++_0x1fbd4f);}(_0x3715,0xe9));var _0x5371=function(_0x46019a,_0x3aa017){_0x46019a=_0x46019a-0x0;var _0x52c165=_0x3715[_0x46019a];return _0x52c165;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5371('0x0'))(_0x5371('0x1'));var moment=require('moment');var BPromise=require(_0x5371('0x2'));var rp=require(_0x5371('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5371('0x4'));var config=require(_0x5371('0x5'));var attributes=require(_0x5371('0x6'));module[_0x5371('0x7')]=function(_0x15a9d9,_0x3b70b9){return _0x15a9d9[_0x5371('0x8')]('FaxQueueReport',attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0x5371('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 7471360..37aaf8f 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 _0xdbbc=['attributes','UpdateFaxQueueReport','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','create','options','raw','CreateFaxQueueReport','debug','body'];(function(_0x3f4e06,_0x539ef5){var _0x58690c=function(_0x3342ed){while(--_0x3342ed){_0x3f4e06['push'](_0x3f4e06['shift']());}};_0x58690c(++_0x539ef5);}(_0xdbbc,0xf2));var _0xcdbb=function(_0x41e9af,_0x32f8aa){_0x41e9af=_0x41e9af-0x0;var _0x1a08f9=_0xdbbc[_0x41e9af];return _0x1a08f9;};'use strict';var _=require('lodash');var util=require(_0xcdbb('0x0'));var moment=require(_0xcdbb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdbb('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdbb('0x3'));var logger=require(_0xcdbb('0x4'))(_0xcdbb('0x5'));var config=require(_0xcdbb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcdbb('0x7')][_0xcdbb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x423118,_0x738bb7,_0xca01f2){return new BPromise(function(_0x14493d,_0xd90f45){return client[_0xcdbb('0x9')](_0x423118,_0xca01f2)[_0xcdbb('0xa')](function(_0x138414){logger[_0xcdbb('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x738bb7,_0xcdbb('0xc'));logger['debug'](_0xcdbb('0xd'),_0x738bb7,_0xcdbb('0xc'),JSON[_0xcdbb('0xe')](_0x138414));if(_0x138414['error']){if(_0x138414[_0xcdbb('0xf')][_0xcdbb('0x10')]===0x1f4){logger[_0xcdbb('0xf')](_0xcdbb('0x11'),_0x738bb7,_0x138414[_0xcdbb('0xf')]['message']);return _0xd90f45(_0x138414[_0xcdbb('0xf')]['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x738bb7,_0x138414[_0xcdbb('0xf')][_0xcdbb('0x12')]);return _0x14493d(_0x138414[_0xcdbb('0xf')][_0xcdbb('0x12')]);}else{logger['info'](_0xcdbb('0x11'),_0x738bb7,_0xcdbb('0xc'));_0x14493d(_0x138414[_0xcdbb('0x13')][_0xcdbb('0x12')]);}})[_0xcdbb('0x14')](function(_0x39b2ae){logger[_0xcdbb('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x738bb7,_0x39b2ae);_0xd90f45(_0x39b2ae);});});}exports['CreateFaxQueueReport']=function(_0x2e7411){var _0x5ab9c9=this;return new Promise(function(_0x11269b,_0xaee221){return db[_0xcdbb('0x15')][_0xcdbb('0x16')](_0x2e7411['body'],{'raw':_0x2e7411[_0xcdbb('0x17')]?_0x2e7411[_0xcdbb('0x17')][_0xcdbb('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x19c0d0){logger['info'](_0xcdbb('0x19'),_0x2e7411);logger[_0xcdbb('0x1a')](_0xcdbb('0x19'),_0x2e7411,JSON[_0xcdbb('0xe')](_0x19c0d0));_0x11269b(_0x19c0d0);})[_0xcdbb('0x14')](function(_0x4f3d1f){logger[_0xcdbb('0xf')](_0xcdbb('0x19'),_0x4f3d1f[_0xcdbb('0x12')],_0x2e7411);_0xaee221(_0x5ab9c9[_0xcdbb('0xf')](0x1f4,_0x4f3d1f[_0xcdbb('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x4e4633){var _0x385057=this;return new Promise(function(_0x50c36f,_0x4b434c){return db[_0xcdbb('0x15')]['update'](_0x4e4633[_0xcdbb('0x1b')],{'raw':_0x4e4633[_0xcdbb('0x17')]?_0x4e4633['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e4633['options']?_0x4e4633[_0xcdbb('0x17')]['where']||null:null,'attributes':_0x4e4633[_0xcdbb('0x17')]?_0x4e4633['options'][_0xcdbb('0x1c')]||null:null,'limit':_0x4e4633[_0xcdbb('0x17')]?_0x4e4633[_0xcdbb('0x17')]['limit']||null:null})[_0xcdbb('0xa')](function(_0x3e58b3){logger['info'](_0xcdbb('0x1d'),_0x4e4633);logger['debug'](_0xcdbb('0x1d'),_0x4e4633,JSON['stringify'](_0x3e58b3));_0x50c36f(_0x3e58b3);})[_0xcdbb('0x14')](function(_0x5ce793){logger['error'](_0xcdbb('0x1d'),_0x5ce793['message'],_0x4e4633);_0x4b434c(_0x385057[_0xcdbb('0xf')](0x1f4,_0x5ce793[_0xcdbb('0x12')]));});});}; \ No newline at end of file +var _0x553e=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','FaxQueueReport','create','body','options','raw','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x553e,0x147));var _0xe553=function(_0x2d23f0,_0x4ea19d){_0x2d23f0=_0x2d23f0-0x0;var _0x4fe496=_0x553e[_0x2d23f0];return _0x4fe496;};'use strict';var _=require(_0xe553('0x0'));var util=require(_0xe553('0x1'));var moment=require(_0xe553('0x2'));var BPromise=require(_0xe553('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe553('0x4'));var db=require(_0xe553('0x5'))['db'];var utils=require(_0xe553('0x6'));var logger=require(_0xe553('0x7'))(_0xe553('0x8'));var config=require(_0xe553('0x9'));var jayson=require(_0xe553('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1adc1e,_0xecca3f,_0x4011bb){return new BPromise(function(_0x527834,_0x3c2415){return client[_0xe553('0xb')](_0x1adc1e,_0x4011bb)[_0xe553('0xc')](function(_0x507de9){logger[_0xe553('0xd')](_0xe553('0xe'),_0xecca3f,_0xe553('0xf'));logger[_0xe553('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0xecca3f,_0xe553('0xf'),JSON['stringify'](_0x507de9));if(_0x507de9['error']){if(_0x507de9[_0xe553('0x11')][_0xe553('0x12')]===0x1f4){logger[_0xe553('0x11')](_0xe553('0xe'),_0xecca3f,_0x507de9[_0xe553('0x11')][_0xe553('0x13')]);return _0x3c2415(_0x507de9[_0xe553('0x11')][_0xe553('0x13')]);}logger['error'](_0xe553('0xe'),_0xecca3f,_0x507de9[_0xe553('0x11')][_0xe553('0x13')]);return _0x527834(_0x507de9[_0xe553('0x11')][_0xe553('0x13')]);}else{logger[_0xe553('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0xecca3f,_0xe553('0xf'));_0x527834(_0x507de9[_0xe553('0x14')][_0xe553('0x13')]);}})[_0xe553('0x15')](function(_0x11b0af){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0xecca3f,_0x11b0af);_0x3c2415(_0x11b0af);});});}exports['CreateFaxQueueReport']=function(_0xf670c8){var _0x3c59b6=this;return new Promise(function(_0x549c30,_0x5f4f91){return db[_0xe553('0x16')][_0xe553('0x17')](_0xf670c8[_0xe553('0x18')],{'raw':_0xf670c8[_0xe553('0x19')]?_0xf670c8[_0xe553('0x19')][_0xe553('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x109d46){logger[_0xe553('0xd')](_0xe553('0x1b'),_0xf670c8);logger[_0xe553('0x10')]('CreateFaxQueueReport',_0xf670c8,JSON[_0xe553('0x1c')](_0x109d46));_0x549c30(_0x109d46);})[_0xe553('0x15')](function(_0x5ad8e4){logger[_0xe553('0x11')](_0xe553('0x1b'),_0x5ad8e4[_0xe553('0x13')],_0xf670c8);_0x5f4f91(_0x3c59b6['error'](0x1f4,_0x5ad8e4[_0xe553('0x13')]));});});};exports[_0xe553('0x1d')]=function(_0x8fa435){var _0x4df67b=this;return new Promise(function(_0x44ab1c,_0x156fa1){return db[_0xe553('0x16')][_0xe553('0x1e')](_0x8fa435[_0xe553('0x18')],{'raw':_0x8fa435[_0xe553('0x19')]?_0x8fa435[_0xe553('0x19')][_0xe553('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8fa435[_0xe553('0x19')]?_0x8fa435['options'][_0xe553('0x1f')]||null:null,'attributes':_0x8fa435[_0xe553('0x19')]?_0x8fa435[_0xe553('0x19')][_0xe553('0x20')]||null:null,'limit':_0x8fa435['options']?_0x8fa435['options'][_0xe553('0x21')]||null:null})[_0xe553('0xc')](function(_0x4ed778){logger[_0xe553('0xd')](_0xe553('0x1d'),_0x8fa435);logger['debug'](_0xe553('0x1d'),_0x8fa435,JSON[_0xe553('0x1c')](_0x4ed778));_0x44ab1c(_0x4ed778);})[_0xe553('0x15')](function(_0x2816ce){logger[_0xe553('0x11')](_0xe553('0x1d'),_0x2816ce[_0xe553('0x13')],_0x8fa435);_0x156fa1(_0x4df67b[_0xe553('0x11')](0x1f4,_0x2816ce['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 89e3de4..b585e09 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 _0x0ee5=['describe','/:id','show','create','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x1aa161,_0x3dfd03){var _0x5365b2=function(_0x512882){while(--_0x512882){_0x1aa161['push'](_0x1aa161['shift']());}};_0x5365b2(++_0x3dfd03);}(_0x0ee5,0x14a));var _0x50ee=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0ee5[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x50ee('0x0'));var path=require(_0x50ee('0x1'));var timeout=require(_0x50ee('0x2'));var express=require(_0x50ee('0x3'));var router=express['Router']();var auth=require(_0x50ee('0x4'));var interaction=require(_0x50ee('0x5'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x50ee('0x6')]('/',auth[_0x50ee('0x7')](),controller[_0x50ee('0x8')]);router[_0x50ee('0x6')](_0x50ee('0x9'),auth['isAuthenticated'](),controller[_0x50ee('0xa')]);router[_0x50ee('0x6')](_0x50ee('0xb'),auth[_0x50ee('0x7')](),controller[_0x50ee('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x50ee('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x50ee('0xe')]);router['delete'](_0x50ee('0xb'),auth[_0x50ee('0x7')](),controller[_0x50ee('0xf')]);module[_0x50ee('0x10')]=router; \ No newline at end of file +var _0x157a=['delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create'];(function(_0x374ada,_0x27b3a5){var _0x449ed8=function(_0x3efc46){while(--_0x3efc46){_0x374ada['push'](_0x374ada['shift']());}};_0x449ed8(++_0x27b3a5);}(_0x157a,0x112));var _0xa157=function(_0x48fd24,_0x13fa0b){_0x48fd24=_0x48fd24-0x0;var _0x2edb3a=_0x157a[_0x48fd24];return _0x2edb3a;};'use strict';var multer=require(_0xa157('0x0'));var util=require(_0xa157('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa157('0x2'));var router=express[_0xa157('0x3')]();var auth=require(_0xa157('0x4'));var interaction=require(_0xa157('0x5'));var config=require('../../config/environment');var controller=require(_0xa157('0x6'));router[_0xa157('0x7')]('/',auth[_0xa157('0x8')](),controller[_0xa157('0x9')]);router['get'](_0xa157('0xa'),auth[_0xa157('0x8')](),controller['describe']);router[_0xa157('0x7')](_0xa157('0xb'),auth['isAuthenticated'](),controller[_0xa157('0xc')]);router[_0xa157('0xd')]('/',auth[_0xa157('0x8')](),controller[_0xa157('0xe')]);router['put'](_0xa157('0xb'),auth[_0xa157('0x8')](),controller['update']);router[_0xa157('0xf')](_0xa157('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xa157('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 5c595ca..023ea8e 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 _0xd7ab=['STRING','ENUM','account','agent','queue','NOW','sequelize','exports'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xd7ab,0xae));var _0xbd7a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd7ab[_0x1facfa];return _0x9ec701;};'use strict';var moment=require('moment');var Sequelize=require(_0xbd7a('0x0'));module[_0xbd7a('0x1')]={'uniqueid':{'type':Sequelize[_0xbd7a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbd7a('0x3')](_0xbd7a('0x4'),_0xbd7a('0x5'),_0xbd7a('0x6')),'allowNull':![],'defaultValue':_0xbd7a('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xbd7a('0x7')]}}; \ No newline at end of file +var _0xd075=['moment','sequelize','STRING','ENUM','agent','queue','DATE','NOW'];(function(_0x4b43c0,_0x3a8091){var _0x574c13=function(_0x39eaf4){while(--_0x39eaf4){_0x4b43c0['push'](_0x4b43c0['shift']());}};_0x574c13(++_0x3a8091);}(_0xd075,0x130));var _0x5d07=function(_0x10c75b,_0x2d4e28){_0x10c75b=_0x10c75b-0x0;var _0x84697d=_0xd075[_0x10c75b];return _0x84697d;};'use strict';var moment=require(_0x5d07('0x0'));var Sequelize=require(_0x5d07('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5d07('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5d07('0x3')]('account',_0x5d07('0x4'),_0x5d07('0x5')),'allowNull':![],'defaultValue':_0x5d07('0x5')},'transferredAt':{'type':Sequelize[_0x5d07('0x6')],'allowNull':![],'defaultValue':Sequelize[_0x5d07('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index e127456..30b369f 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 _0x8ca6=['intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','reject','save','update','then','destroy','error','name','send','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes'];(function(_0xbc0ba4,_0x3a715a){var _0x5df3ae=function(_0x4e3fdc){while(--_0x4e3fdc){_0xbc0ba4['push'](_0xbc0ba4['shift']());}};_0x5df3ae(++_0x3a715a);}(_0x8ca6,0xb0));var _0x68ca=function(_0x2aa679,_0x399887){_0x2aa679=_0x2aa679-0x0;var _0x46e1b9=_0x8ca6[_0x2aa679];return _0x46e1b9;};'use strict';var pdf=require(_0x68ca('0x0'));var emlformat=require(_0x68ca('0x1'));var rimraf=require(_0x68ca('0x2'));var zipdir=require(_0x68ca('0x3'));var jsonpatch=require(_0x68ca('0x4'));var rp=require(_0x68ca('0x5'));var moment=require(_0x68ca('0x6'));var BPromise=require(_0x68ca('0x7'));var Mustache=require(_0x68ca('0x8'));var util=require(_0x68ca('0x9'));var path=require('path');var sox=require(_0x68ca('0xa'));var csv=require(_0x68ca('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x68ca('0xc'));var squel=require(_0x68ca('0xd'));var crypto=require(_0x68ca('0xe'));var jsforce=require(_0x68ca('0xf'));var deskjs=require(_0x68ca('0x10'));var toCsv=require(_0x68ca('0xb'));var querystring=require('querystring');var Papa=require(_0x68ca('0x11'));var Redis=require('ioredis');var authService=require(_0x68ca('0x12'));var qs=require(_0x68ca('0x13'));var as=require(_0x68ca('0x14'));var hardwareService=require(_0x68ca('0x15'));var logger=require(_0x68ca('0x16'))(_0x68ca('0x17'));var utils=require('../../config/utils');var config=require(_0x68ca('0x18'));var db=require(_0x68ca('0x19'))['db'];function respondWithStatusCode(_0x521298,_0x390dee){_0x390dee=_0x390dee||0xcc;return function(_0x59d0fc){if(_0x59d0fc){return _0x521298[_0x68ca('0x1a')](_0x390dee);}return _0x521298['status'](_0x390dee)[_0x68ca('0x1b')]();};}function respondWithResult(_0x444009,_0x48b8cb){_0x48b8cb=_0x48b8cb||0xc8;return function(_0x2d58c7){if(_0x2d58c7){return _0x444009[_0x68ca('0x1c')](_0x48b8cb)[_0x68ca('0x1d')](_0x2d58c7);}};}function respondWithFilteredResult(_0x2de0da,_0x33ca48){return function(_0x4e71f8){if(_0x4e71f8){var _0x2f7081=_0x4e71f8[_0x68ca('0x1e')],_0x372bef=_0x33ca48[_0x68ca('0x1f')],_0x4db7ab=_0x33ca48['offset']+_0x33ca48['limit'],_0x1c7dee;if(_0x4db7ab>=_0x2f7081){_0x4db7ab=_0x2f7081;_0x1c7dee=0xc8;}else{_0x1c7dee=0xce;}_0x2de0da[_0x68ca('0x1c')](_0x1c7dee);return _0x2de0da['set'](_0x68ca('0x20'),_0x372bef+'-'+_0x4db7ab+'/'+_0x2f7081)[_0x68ca('0x1d')](_0x4e71f8);}return null;};}function patchUpdates(_0x548da0){return function(_0x2b2547){try{jsonpatch['apply'](_0x2b2547,_0x548da0,!![]);}catch(_0xe9993){return BPromise[_0x68ca('0x21')](_0xe9993);}return _0x2b2547[_0x68ca('0x22')]();};}function saveUpdates(_0x30ab54,_0x509b45){return function(_0x3b4a79){if(_0x3b4a79){return _0x3b4a79[_0x68ca('0x23')](_0x30ab54)[_0x68ca('0x24')](function(_0x2b7b21){return _0x2b7b21;});}return null;};}function removeEntity(_0x5a483b,_0x57e372){return function(_0x1686d2){if(_0x1686d2){return _0x1686d2[_0x68ca('0x25')]()[_0x68ca('0x24')](function(){_0x5a483b[_0x68ca('0x1c')](0xcc)[_0x68ca('0x1b')]();});}};}function handleEntityNotFound(_0x59282b,_0x394545){return function(_0x345e86){if(!_0x345e86){_0x59282b[_0x68ca('0x1a')](0x194);}return _0x345e86;};}function handleError(_0x474e12,_0x3dbeb5){_0x3dbeb5=_0x3dbeb5||0x1f4;return function(_0x3adb01){logger[_0x68ca('0x26')](_0x3adb01['stack']);if(_0x3adb01[_0x68ca('0x27')]){delete _0x3adb01[_0x68ca('0x27')];}_0x474e12[_0x68ca('0x1c')](_0x3dbeb5)[_0x68ca('0x28')](_0x3adb01);};}exports['index']=function(_0x52e8b1,_0x11cd1e){var _0x3e3937={},_0x545679={},_0xa9bf7a={'count':0x0,'rows':[]};var _0x41aa49=_['map'](db[_0x68ca('0x29')][_0x68ca('0x2a')],function(_0x5e9e60){return{'name':_0x5e9e60[_0x68ca('0x2b')],'type':_0x5e9e60[_0x68ca('0x2c')][_0x68ca('0x2d')]};});_0x545679[_0x68ca('0x2e')]=_[_0x68ca('0x2f')](_0x41aa49,'name');_0x545679[_0x68ca('0x30')]=_[_0x68ca('0x31')](_0x52e8b1['query']);_0x545679[_0x68ca('0x32')]=_['intersection'](_0x545679[_0x68ca('0x2e')],_0x545679['query']);_0x3e3937[_0x68ca('0x33')]=_[_0x68ca('0x34')](_0x545679['model'],qs[_0x68ca('0x35')](_0x52e8b1['query'][_0x68ca('0x35')]));_0x3e3937[_0x68ca('0x33')]=_0x3e3937[_0x68ca('0x33')][_0x68ca('0x36')]?_0x3e3937['attributes']:_0x545679[_0x68ca('0x2e')];if(!_0x52e8b1['query'][_0x68ca('0x37')](_0x68ca('0x38'))){_0x3e3937[_0x68ca('0x39')]=qs[_0x68ca('0x39')](_0x52e8b1[_0x68ca('0x30')][_0x68ca('0x39')]);_0x3e3937[_0x68ca('0x1f')]=qs[_0x68ca('0x1f')](_0x52e8b1[_0x68ca('0x30')]['offset']);}_0x3e3937[_0x68ca('0x3a')]=qs[_0x68ca('0x3b')](_0x52e8b1[_0x68ca('0x30')]['sort']);_0x3e3937[_0x68ca('0x3c')]=qs['filters'](_[_0x68ca('0x3d')](_0x52e8b1[_0x68ca('0x30')],_0x545679[_0x68ca('0x32')]));if(_0x52e8b1[_0x68ca('0x30')][_0x68ca('0x3e')]){_0x3e3937[_0x68ca('0x3c')]=_['merge'](_0x3e3937['where'],{'$or':_[_0x68ca('0x2f')](_0x41aa49,function(_0x120f60){if(_0x120f60[_0x68ca('0x2c')]!==_0x68ca('0x3f')){var _0x2ae7d0={};_0x2ae7d0[_0x120f60[_0x68ca('0x27')]]={'$like':'%'+_0x52e8b1['query'][_0x68ca('0x3e')]+'%'};return _0x2ae7d0;}})});}_0x3e3937=_[_0x68ca('0x40')]({},_0x3e3937,_0x52e8b1['options']);var _0x103b39={'where':_0x3e3937[_0x68ca('0x3c')]};return db[_0x68ca('0x29')]['count'](_0x103b39)[_0x68ca('0x24')](function(_0x3c031a){_0xa9bf7a['count']=_0x3c031a;if(_0x52e8b1[_0x68ca('0x30')][_0x68ca('0x41')]){_0x3e3937[_0x68ca('0x42')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x68ca('0x43')](_0x3e3937);})['then'](function(_0x2f70cf){_0xa9bf7a[_0x68ca('0x44')]=_0x2f70cf;return _0xa9bf7a;})[_0x68ca('0x24')](respondWithFilteredResult(_0x11cd1e,_0x3e3937))[_0x68ca('0x45')](handleError(_0x11cd1e,null));};exports['show']=function(_0x58b87c,_0x4170e0){var _0x3ba5c8={'raw':!![],'where':{'id':_0x58b87c['params']['id']}},_0x53b416={};_0x53b416['model']=_['keys'](db['FaxTransferReport'][_0x68ca('0x2a')]);_0x53b416['query']=_[_0x68ca('0x31')](_0x58b87c[_0x68ca('0x30')]);_0x53b416[_0x68ca('0x32')]=_[_0x68ca('0x34')](_0x53b416['model'],_0x53b416[_0x68ca('0x30')]);_0x3ba5c8['attributes']=_[_0x68ca('0x34')](_0x53b416[_0x68ca('0x2e')],qs[_0x68ca('0x35')](_0x58b87c['query'][_0x68ca('0x35')]));_0x3ba5c8['attributes']=_0x3ba5c8[_0x68ca('0x33')][_0x68ca('0x36')]?_0x3ba5c8[_0x68ca('0x33')]:_0x53b416['model'];if(_0x58b87c['query'][_0x68ca('0x41')]){_0x3ba5c8[_0x68ca('0x42')]=[{'all':!![]}];}_0x3ba5c8=_[_0x68ca('0x40')]({},_0x3ba5c8,_0x58b87c[_0x68ca('0x46')]);return db['FaxTransferReport'][_0x68ca('0x47')](_0x3ba5c8)[_0x68ca('0x24')](handleEntityNotFound(_0x4170e0,null))['then'](respondWithResult(_0x4170e0,null))['catch'](handleError(_0x4170e0,null));};exports['create']=function(_0x18bef6,_0x4dbfdb){return db[_0x68ca('0x29')][_0x68ca('0x48')](_0x18bef6[_0x68ca('0x49')],{})['then'](respondWithResult(_0x4dbfdb,0xc9))[_0x68ca('0x45')](handleError(_0x4dbfdb,null));};exports['update']=function(_0x596c24,_0x26ca77){if(_0x596c24[_0x68ca('0x49')]['id']){delete _0x596c24[_0x68ca('0x49')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x596c24[_0x68ca('0x4a')]['id']}})[_0x68ca('0x24')](handleEntityNotFound(_0x26ca77,null))['then'](saveUpdates(_0x596c24[_0x68ca('0x49')],null))[_0x68ca('0x24')](respondWithResult(_0x26ca77,null))[_0x68ca('0x45')](handleError(_0x26ca77,null));};exports['destroy']=function(_0x3befe4,_0x265a7e){return db[_0x68ca('0x29')][_0x68ca('0x47')]({'where':{'id':_0x3befe4['params']['id']}})[_0x68ca('0x24')](handleEntityNotFound(_0x265a7e,null))[_0x68ca('0x24')](removeEntity(_0x265a7e,null))[_0x68ca('0x45')](handleError(_0x265a7e,null));};exports['describe']=function(_0x3f853a,_0x2645b0){return db['FaxTransferReport'][_0x68ca('0x4b')]()[_0x68ca('0x24')](respondWithResult(_0x2645b0,null))[_0x68ca('0x45')](handleError(_0x2645b0,null));}; \ No newline at end of file +var _0x4345=['../../mysqldb','status','end','json','count','offset','set','Content-Range','save','update','destroy','sendStatus','error','stack','name','FaxTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','map','filter','options','then','includeAll','rows','catch','show','params','include','find','create','body','describe','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment'];(function(_0x48bd9f,_0x4f6c39){var _0x76a1ff=function(_0x5dfa09){while(--_0x5dfa09){_0x48bd9f['push'](_0x48bd9f['shift']());}};_0x76a1ff(++_0x4f6c39);}(_0x4345,0x1c9));var _0x5434=function(_0x13b0c2,_0x1d6979){_0x13b0c2=_0x13b0c2-0x0;var _0x1a0f79=_0x4345[_0x13b0c2];return _0x1a0f79;};'use strict';var pdf=require(_0x5434('0x0'));var emlformat=require(_0x5434('0x1'));var rimraf=require(_0x5434('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5434('0x3'));var moment=require(_0x5434('0x4'));var BPromise=require(_0x5434('0x5'));var Mustache=require(_0x5434('0x6'));var util=require(_0x5434('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5434('0x8'));var ejs=require(_0x5434('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5434('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5434('0xb'));var toCsv=require(_0x5434('0x8'));var querystring=require(_0x5434('0xc'));var Papa=require(_0x5434('0xd'));var Redis=require(_0x5434('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5434('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5434('0x10'))(_0x5434('0x11'));var utils=require('../../config/utils');var config=require(_0x5434('0x12'));var db=require(_0x5434('0x13'))['db'];function respondWithStatusCode(_0x1c55e4,_0x517d9d){_0x517d9d=_0x517d9d||0xcc;return function(_0x14c64c){if(_0x14c64c){return _0x1c55e4['sendStatus'](_0x517d9d);}return _0x1c55e4[_0x5434('0x14')](_0x517d9d)[_0x5434('0x15')]();};}function respondWithResult(_0x13b03f,_0x22a3da){_0x22a3da=_0x22a3da||0xc8;return function(_0x5acc52){if(_0x5acc52){return _0x13b03f[_0x5434('0x14')](_0x22a3da)[_0x5434('0x16')](_0x5acc52);}};}function respondWithFilteredResult(_0x597bf6,_0x5d40ba){return function(_0x3cdeb2){if(_0x3cdeb2){var _0x56ad26=_0x3cdeb2[_0x5434('0x17')],_0x2060bd=_0x5d40ba[_0x5434('0x18')],_0x4dd391=_0x5d40ba[_0x5434('0x18')]+_0x5d40ba['limit'],_0x5b17f8;if(_0x4dd391>=_0x56ad26){_0x4dd391=_0x56ad26;_0x5b17f8=0xc8;}else{_0x5b17f8=0xce;}_0x597bf6['status'](_0x5b17f8);return _0x597bf6[_0x5434('0x19')](_0x5434('0x1a'),_0x2060bd+'-'+_0x4dd391+'/'+_0x56ad26)['json'](_0x3cdeb2);}return null;};}function patchUpdates(_0xc761c9){return function(_0x501ae4){try{jsonpatch['apply'](_0x501ae4,_0xc761c9,!![]);}catch(_0x374b34){return BPromise['reject'](_0x374b34);}return _0x501ae4[_0x5434('0x1b')]();};}function saveUpdates(_0x1ad821,_0x58b232){return function(_0x881688){if(_0x881688){return _0x881688[_0x5434('0x1c')](_0x1ad821)['then'](function(_0x3147ca){return _0x3147ca;});}return null;};}function removeEntity(_0x260047,_0x45978d){return function(_0x43d1fd){if(_0x43d1fd){return _0x43d1fd[_0x5434('0x1d')]()['then'](function(){_0x260047[_0x5434('0x14')](0xcc)[_0x5434('0x15')]();});}};}function handleEntityNotFound(_0x4adf2a,_0x19fad2){return function(_0x522c55){if(!_0x522c55){_0x4adf2a[_0x5434('0x1e')](0x194);}return _0x522c55;};}function handleError(_0x122bfa,_0x377fac){_0x377fac=_0x377fac||0x1f4;return function(_0x3ebfdd){logger[_0x5434('0x1f')](_0x3ebfdd[_0x5434('0x20')]);if(_0x3ebfdd['name']){delete _0x3ebfdd[_0x5434('0x21')];}_0x122bfa['status'](_0x377fac)['send'](_0x3ebfdd);};}exports['index']=function(_0x3133bb,_0x4beaa3){var _0x1c19e5={},_0x1c6a0e={},_0x18f054={'count':0x0,'rows':[]};var _0x201865=_['map'](db[_0x5434('0x22')][_0x5434('0x23')],function(_0x212f1d){return{'name':_0x212f1d[_0x5434('0x24')],'type':_0x212f1d[_0x5434('0x25')][_0x5434('0x26')]};});_0x1c6a0e['model']=_['map'](_0x201865,_0x5434('0x21'));_0x1c6a0e[_0x5434('0x27')]=_[_0x5434('0x28')](_0x3133bb[_0x5434('0x27')]);_0x1c6a0e[_0x5434('0x29')]=_['intersection'](_0x1c6a0e[_0x5434('0x2a')],_0x1c6a0e['query']);_0x1c19e5[_0x5434('0x2b')]=_[_0x5434('0x2c')](_0x1c6a0e[_0x5434('0x2a')],qs[_0x5434('0x2d')](_0x3133bb[_0x5434('0x27')][_0x5434('0x2d')]));_0x1c19e5[_0x5434('0x2b')]=_0x1c19e5[_0x5434('0x2b')][_0x5434('0x2e')]?_0x1c19e5[_0x5434('0x2b')]:_0x1c6a0e[_0x5434('0x2a')];if(!_0x3133bb[_0x5434('0x27')][_0x5434('0x2f')](_0x5434('0x30'))){_0x1c19e5['limit']=qs[_0x5434('0x31')](_0x3133bb[_0x5434('0x27')]['limit']);_0x1c19e5[_0x5434('0x18')]=qs[_0x5434('0x18')](_0x3133bb[_0x5434('0x27')][_0x5434('0x18')]);}_0x1c19e5['order']=qs[_0x5434('0x32')](_0x3133bb[_0x5434('0x27')][_0x5434('0x32')]);_0x1c19e5[_0x5434('0x33')]=qs['filters'](_[_0x5434('0x34')](_0x3133bb[_0x5434('0x27')],_0x1c6a0e['filters']));if(_0x3133bb[_0x5434('0x27')]['filter']){_0x1c19e5['where']=_[_0x5434('0x35')](_0x1c19e5['where'],{'$or':_[_0x5434('0x36')](_0x201865,function(_0x48b088){if(_0x48b088[_0x5434('0x25')]!=='VIRTUAL'){var _0x5678df={};_0x5678df[_0x48b088['name']]={'$like':'%'+_0x3133bb[_0x5434('0x27')][_0x5434('0x37')]+'%'};return _0x5678df;}})});}_0x1c19e5=_[_0x5434('0x35')]({},_0x1c19e5,_0x3133bb[_0x5434('0x38')]);var _0x42747f={'where':_0x1c19e5[_0x5434('0x33')]};return db[_0x5434('0x22')][_0x5434('0x17')](_0x42747f)[_0x5434('0x39')](function(_0x434f7f){_0x18f054[_0x5434('0x17')]=_0x434f7f;if(_0x3133bb[_0x5434('0x27')][_0x5434('0x3a')]){_0x1c19e5['include']=[{'all':!![]}];}return db[_0x5434('0x22')]['findAll'](_0x1c19e5);})[_0x5434('0x39')](function(_0x36b3ec){_0x18f054[_0x5434('0x3b')]=_0x36b3ec;return _0x18f054;})[_0x5434('0x39')](respondWithFilteredResult(_0x4beaa3,_0x1c19e5))[_0x5434('0x3c')](handleError(_0x4beaa3,null));};exports[_0x5434('0x3d')]=function(_0x2b6434,_0x33f17d){var _0x32a399={'raw':!![],'where':{'id':_0x2b6434[_0x5434('0x3e')]['id']}},_0x5a213b={};_0x5a213b['model']=_['keys'](db[_0x5434('0x22')][_0x5434('0x23')]);_0x5a213b[_0x5434('0x27')]=_[_0x5434('0x28')](_0x2b6434[_0x5434('0x27')]);_0x5a213b[_0x5434('0x29')]=_[_0x5434('0x2c')](_0x5a213b['model'],_0x5a213b[_0x5434('0x27')]);_0x32a399[_0x5434('0x2b')]=_['intersection'](_0x5a213b[_0x5434('0x2a')],qs[_0x5434('0x2d')](_0x2b6434[_0x5434('0x27')][_0x5434('0x2d')]));_0x32a399[_0x5434('0x2b')]=_0x32a399['attributes'][_0x5434('0x2e')]?_0x32a399[_0x5434('0x2b')]:_0x5a213b[_0x5434('0x2a')];if(_0x2b6434[_0x5434('0x27')][_0x5434('0x3a')]){_0x32a399[_0x5434('0x3f')]=[{'all':!![]}];}_0x32a399=_[_0x5434('0x35')]({},_0x32a399,_0x2b6434[_0x5434('0x38')]);return db['FaxTransferReport'][_0x5434('0x40')](_0x32a399)[_0x5434('0x39')](handleEntityNotFound(_0x33f17d,null))['then'](respondWithResult(_0x33f17d,null))[_0x5434('0x3c')](handleError(_0x33f17d,null));};exports[_0x5434('0x41')]=function(_0x45f736,_0x51ea06){return db[_0x5434('0x22')][_0x5434('0x41')](_0x45f736['body'],{})[_0x5434('0x39')](respondWithResult(_0x51ea06,0xc9))[_0x5434('0x3c')](handleError(_0x51ea06,null));};exports[_0x5434('0x1c')]=function(_0x5428ca,_0x3a9607){if(_0x5428ca[_0x5434('0x42')]['id']){delete _0x5428ca['body']['id'];}return db[_0x5434('0x22')][_0x5434('0x40')]({'where':{'id':_0x5428ca[_0x5434('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3a9607,null))['then'](saveUpdates(_0x5428ca[_0x5434('0x42')],null))['then'](respondWithResult(_0x3a9607,null))[_0x5434('0x3c')](handleError(_0x3a9607,null));};exports[_0x5434('0x1d')]=function(_0x2be0bb,_0x5210ba){return db[_0x5434('0x22')][_0x5434('0x40')]({'where':{'id':_0x2be0bb[_0x5434('0x3e')]['id']}})[_0x5434('0x39')](handleEntityNotFound(_0x5210ba,null))['then'](removeEntity(_0x5210ba,null))[_0x5434('0x3c')](handleError(_0x5210ba,null));};exports[_0x5434('0x43')]=function(_0x1e25f6,_0x2cd30a){return db[_0x5434('0x22')][_0x5434('0x43')]()[_0x5434('0x39')](respondWithResult(_0x2cd30a,null))[_0x5434('0x3c')](handleError(_0x2cd30a,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 12165e3..c0f69d8 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 _0xeee8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xeee8,0x13e));var _0x8eee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeee8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8eee('0x0'));var util=require(_0x8eee('0x1'));var logger=require(_0x8eee('0x2'))(_0x8eee('0x3'));var moment=require(_0x8eee('0x4'));var BPromise=require(_0x8eee('0x5'));var rp=require(_0x8eee('0x6'));var fs=require('fs');var path=require(_0x8eee('0x7'));var rimraf=require(_0x8eee('0x8'));var config=require(_0x8eee('0x9'));var attributes=require(_0x8eee('0xa'));module[_0x8eee('0xb')]=function(_0x251f41,_0x26fafd){return _0x251f41[_0x8eee('0xc')](_0x8eee('0xd'),attributes,{'tableName':_0x8eee('0xe'),'paranoid':![],'indexes':[{'name':_0x8eee('0xf'),'fields':[_0x8eee('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc18f=['../../config/environment','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x535996,_0x2118d4){var _0x1c6295=function(_0x33096b){while(--_0x33096b){_0x535996['push'](_0x535996['shift']());}};_0x1c6295(++_0x2118d4);}(_0xc18f,0x84));var _0xfc18=function(_0x2596a5,_0x1a5b24){_0x2596a5=_0x2596a5-0x0;var _0x408509=_0xc18f[_0x2596a5];return _0x408509;};'use strict';var _=require(_0xfc18('0x0'));var util=require(_0xfc18('0x1'));var logger=require(_0xfc18('0x2'))('api');var moment=require(_0xfc18('0x3'));var BPromise=require(_0xfc18('0x4'));var rp=require(_0xfc18('0x5'));var fs=require('fs');var path=require(_0xfc18('0x6'));var rimraf=require(_0xfc18('0x7'));var config=require(_0xfc18('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xfc18('0x9')]=function(_0x10568f,_0x6b3838){return _0x10568f[_0xfc18('0xa')](_0xfc18('0xb'),attributes,{'tableName':_0xfc18('0xc'),'paranoid':![],'indexes':[{'name':_0xfc18('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 28c313d..d7a2252 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 _0x0ce7=['debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xc98a2f,_0x2b6e07){var _0x58acdf=function(_0x346cc0){while(--_0x346cc0){_0xc98a2f['push'](_0xc98a2f['shift']());}};_0x58acdf(++_0x2b6e07);}(_0x0ce7,0x96));var _0x70ce=function(_0x351c1c,_0x5b69f3){_0x351c1c=_0x351c1c-0x0;var _0x18b7ce=_0x0ce7[_0x351c1c];return _0x18b7ce;};'use strict';var _=require(_0x70ce('0x0'));var util=require('util');var moment=require(_0x70ce('0x1'));var BPromise=require(_0x70ce('0x2'));var rs=require(_0x70ce('0x3'));var fs=require('fs');var Redis=require(_0x70ce('0x4'));var db=require(_0x70ce('0x5'))['db'];var utils=require(_0x70ce('0x6'));var logger=require(_0x70ce('0x7'))(_0x70ce('0x8'));var config=require(_0x70ce('0x9'));var jayson=require(_0x70ce('0xa'));var client=jayson[_0x70ce('0xb')][_0x70ce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d3125,_0x2eec34,_0x4ec472){return new BPromise(function(_0x2d9312,_0xa44f45){return client[_0x70ce('0xd')](_0x1d3125,_0x4ec472)[_0x70ce('0xe')](function(_0x1c570d){logger[_0x70ce('0xf')](_0x70ce('0x10'),_0x2eec34,_0x70ce('0x11'));logger[_0x70ce('0x12')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2eec34,_0x70ce('0x11'),JSON[_0x70ce('0x13')](_0x1c570d));if(_0x1c570d[_0x70ce('0x14')]){if(_0x1c570d[_0x70ce('0x14')][_0x70ce('0x15')]===0x1f4){logger[_0x70ce('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x2eec34,_0x1c570d[_0x70ce('0x14')][_0x70ce('0x16')]);return _0xa44f45(_0x1c570d['error'][_0x70ce('0x16')]);}logger[_0x70ce('0x14')](_0x70ce('0x10'),_0x2eec34,_0x1c570d[_0x70ce('0x14')][_0x70ce('0x16')]);return _0x2d9312(_0x1c570d[_0x70ce('0x14')]['message']);}else{logger['info'](_0x70ce('0x10'),_0x2eec34,_0x70ce('0x11'));_0x2d9312(_0x1c570d['result'][_0x70ce('0x16')]);}})[_0x70ce('0x17')](function(_0x3b52c5){logger[_0x70ce('0x14')](_0x70ce('0x10'),_0x2eec34,_0x3b52c5);_0xa44f45(_0x3b52c5);});});} \ No newline at end of file +var _0x6426=['result','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2417d7,_0x4dcf5e){var _0x15805d=function(_0x19a582){while(--_0x19a582){_0x2417d7['push'](_0x2417d7['shift']());}};_0x15805d(++_0x4dcf5e);}(_0x6426,0x6b));var _0x6642=function(_0x48cc84,_0x51d15b){_0x48cc84=_0x48cc84-0x0;var _0x5b489c=_0x6426[_0x48cc84];return _0x5b489c;};'use strict';var _=require(_0x6642('0x0'));var util=require(_0x6642('0x1'));var moment=require('moment');var BPromise=require(_0x6642('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6642('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6642('0x4'));var logger=require(_0x6642('0x5'))(_0x6642('0x6'));var config=require('../../config/environment');var jayson=require(_0x6642('0x7'));var client=jayson[_0x6642('0x8')][_0x6642('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37af09,_0x19838f,_0x4bc752){return new BPromise(function(_0x41bac6,_0x250fb2){return client[_0x6642('0xa')](_0x37af09,_0x4bc752)[_0x6642('0xb')](function(_0x12b4a1){logger[_0x6642('0xc')](_0x6642('0xd'),_0x19838f,_0x6642('0xe'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x19838f,'request\x20sent',JSON[_0x6642('0xf')](_0x12b4a1));if(_0x12b4a1[_0x6642('0x10')]){if(_0x12b4a1['error'][_0x6642('0x11')]===0x1f4){logger[_0x6642('0x10')](_0x6642('0xd'),_0x19838f,_0x12b4a1[_0x6642('0x10')][_0x6642('0x12')]);return _0x250fb2(_0x12b4a1[_0x6642('0x10')][_0x6642('0x12')]);}logger[_0x6642('0x10')](_0x6642('0xd'),_0x19838f,_0x12b4a1[_0x6642('0x10')][_0x6642('0x12')]);return _0x41bac6(_0x12b4a1[_0x6642('0x10')][_0x6642('0x12')]);}else{logger[_0x6642('0xc')](_0x6642('0xd'),_0x19838f,_0x6642('0xe'));_0x41bac6(_0x12b4a1[_0x6642('0x13')][_0x6642('0x12')]);}})[_0x6642('0x14')](function(_0xce1352){logger[_0x6642('0x10')](_0x6642('0xd'),_0x19838f,_0xce1352);_0x250fb2(_0xce1352);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0eac636..69bdae5 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 _0x45ca=['./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','destroy','exports','path','express','Router','../../components/interaction/service'];(function(_0x4b3286,_0x1b2248){var _0x97f119=function(_0xdee17f){while(--_0xdee17f){_0x4b3286['push'](_0x4b3286['shift']());}};_0x97f119(++_0x1b2248);}(_0x45ca,0x11c));var _0xa45c=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x45ca[_0x1f9f37];return _0x21c080;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa45c('0x0'));var timeout=require('connect-timeout');var express=require(_0xa45c('0x1'));var router=express[_0xa45c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xa45c('0x3'));var config=require('../../config/environment');var controller=require(_0xa45c('0x4'));router[_0xa45c('0x5')]('/',auth[_0xa45c('0x6')](),controller[_0xa45c('0x7')]);router[_0xa45c('0x5')](_0xa45c('0x8'),auth[_0xa45c('0x6')](),controller['describe']);router['get'](_0xa45c('0x9'),auth[_0xa45c('0x6')](),controller[_0xa45c('0xa')]);router[_0xa45c('0xb')]('/',auth[_0xa45c('0x6')](),controller[_0xa45c('0xc')]);router['put']('/:id',auth[_0xa45c('0x6')](),controller[_0xa45c('0xd')]);router['delete'](_0xa45c('0x9'),auth['isAuthenticated'](),controller[_0xa45c('0xe')]);module[_0xa45c('0xf')]=router; \ No newline at end of file +var _0x6859=['index','/describe','/:id','post','create','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','./faxTransferReport.controller','get','isAuthenticated'];(function(_0x897be,_0x234186){var _0xe51488=function(_0x2a3029){while(--_0x2a3029){_0x897be['push'](_0x897be['shift']());}};_0xe51488(++_0x234186);}(_0x6859,0xd9));var _0x9685=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0x6859[_0x4c445a];return _0x2f611c;};'use strict';var multer=require(_0x9685('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9685('0x1'));var express=require('express');var router=express[_0x9685('0x2')]();var auth=require(_0x9685('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9685('0x4'));router[_0x9685('0x5')]('/',auth[_0x9685('0x6')](),controller[_0x9685('0x7')]);router[_0x9685('0x5')](_0x9685('0x8'),auth[_0x9685('0x6')](),controller['describe']);router[_0x9685('0x5')](_0x9685('0x9'),auth[_0x9685('0x6')](),controller['show']);router[_0x9685('0xa')]('/',auth[_0x9685('0x6')](),controller[_0x9685('0xb')]);router['put'](_0x9685('0x9'),auth[_0x9685('0x6')](),controller[_0x9685('0xc')]);router[_0x9685('0xd')](_0x9685('0x9'),auth[_0x9685('0x6')](),controller[_0x9685('0xe')]);module[_0x9685('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6ccafc3..e239eec 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 _0xe181=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x7dd1ad,_0x591860){var _0x172e5f=function(_0x58e403){while(--_0x58e403){_0x7dd1ad['push'](_0x7dd1ad['shift']());}};_0x172e5f(++_0x591860);}(_0xe181,0x68));var _0x1e18=function(_0x4c496d,_0x16ce2b){_0x4c496d=_0x4c496d-0x0;var _0x2190c9=_0xe181[_0x4c496d];return _0x2190c9;};'use strict';var multer=require(_0x1e18('0x0'));var util=require('util');var path=require(_0x1e18('0x1'));var timeout=require(_0x1e18('0x2'));var express=require(_0x1e18('0x3'));var router=express[_0x1e18('0x4')]();var auth=require(_0x1e18('0x5'));var interaction=require(_0x1e18('0x6'));var config=require(_0x1e18('0x7'));var controller=require('./intDeskAccount.controller');router[_0x1e18('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e18('0x8')](_0x1e18('0x9'),auth[_0x1e18('0xa')](),controller[_0x1e18('0xb')]);router[_0x1e18('0x8')](_0x1e18('0xc'),auth['isAuthenticated'](),controller[_0x1e18('0xd')]);router[_0x1e18('0x8')](_0x1e18('0xe'),auth[_0x1e18('0xa')](),controller[_0x1e18('0xf')]);router[_0x1e18('0x10')]('/',auth['isAuthenticated'](),controller[_0x1e18('0x11')]);router[_0x1e18('0x10')](_0x1e18('0xc'),auth[_0x1e18('0xa')](),controller[_0x1e18('0x12')]);router[_0x1e18('0x13')](_0x1e18('0x9'),auth[_0x1e18('0xa')](),controller['update']);router[_0x1e18('0x14')]('/:id',auth[_0x1e18('0xa')](),controller['destroy']);module[_0x1e18('0x15')]=router; \ No newline at end of file +var _0x8ce1=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put'];(function(_0x4cf765,_0xc7a6bf){var _0x473760=function(_0x2d501d){while(--_0x2d501d){_0x4cf765['push'](_0x4cf765['shift']());}};_0x473760(++_0xc7a6bf);}(_0x8ce1,0x183));var _0x18ce=function(_0x1a74b6,_0x26ae95){_0x1a74b6=_0x1a74b6-0x0;var _0xf6bfef=_0x8ce1[_0x1a74b6];return _0xf6bfef;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var auth=require(_0x18ce('0x6'));var interaction=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var controller=require(_0x18ce('0x9'));router[_0x18ce('0xa')]('/',auth[_0x18ce('0xb')](),controller[_0x18ce('0xc')]);router[_0x18ce('0xa')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['show']);router[_0x18ce('0xa')](_0x18ce('0xe'),auth[_0x18ce('0xb')](),controller[_0x18ce('0xf')]);router['get'](_0x18ce('0x10'),auth[_0x18ce('0xb')](),controller[_0x18ce('0x11')]);router[_0x18ce('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x18ce('0x12')](_0x18ce('0xe'),auth[_0x18ce('0xb')](),controller[_0x18ce('0x13')]);router[_0x18ce('0x14')]('/:id',auth[_0x18ce('0xb')](),controller[_0x18ce('0x15')]);router[_0x18ce('0x16')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['destroy']);module[_0x18ce('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 934c392..cce7a66 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 _0x5421=['newTab','sequelize','exports','STRING','basic','integrationTab'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5421,0x1cf));var _0x1542=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x5421[_0x4ed32d];return _0xf624df;};'use strict';var Sequelize=require(_0x1542('0x0'));module[_0x1542('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1542('0x2')]},'username':{'type':Sequelize[_0x1542('0x2')]},'remoteUri':{'type':Sequelize[_0x1542('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x1542('0x3')),'defaultValue':_0x1542('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x1542('0x2')]},'consumerSecret':{'type':Sequelize[_0x1542('0x2')]},'token':{'type':Sequelize[_0x1542('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1542('0x4'),_0x1542('0x5')),'defaultValue':_0x1542('0x4')}}; \ No newline at end of file +var _0x9f40=['STRING','ENUM','basic','newTab','integrationTab','exports'];(function(_0x5ca655,_0xcef846){var _0x163e1f=function(_0x248d5f){while(--_0x248d5f){_0x5ca655['push'](_0x5ca655['shift']());}};_0x163e1f(++_0xcef846);}(_0x9f40,0xdd));var _0x09f4=function(_0xa681dc,_0x3100aa){_0xa681dc=_0xa681dc-0x0;var _0x422441=_0x9f40[_0xa681dc];return _0x422441;};'use strict';var Sequelize=require('sequelize');module[_0x09f4('0x0')]={'name':{'type':Sequelize[_0x09f4('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x09f4('0x1')]},'remoteUri':{'type':Sequelize[_0x09f4('0x1')]},'authType':{'type':Sequelize[_0x09f4('0x2')](_0x09f4('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x09f4('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x09f4('0x1')]},'serverUrl':{'type':Sequelize[_0x09f4('0x1')]},'type':{'type':Sequelize[_0x09f4('0x2')]('integrationTab',_0x09f4('0x4')),'defaultValue':_0x09f4('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1927e15..52d16b2 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 _0x8786=['path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','find','create','body','params','getConfigurations','DeskConfiguration','length','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','base64','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x8786,0x7a));var _0x6878=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8786[_0x4b055c];return _0x4b62bb;};'use strict';var pdf=require(_0x6878('0x0'));var emlformat=require(_0x6878('0x1'));var rimraf=require(_0x6878('0x2'));var zipdir=require(_0x6878('0x3'));var jsonpatch=require(_0x6878('0x4'));var rp=require(_0x6878('0x5'));var moment=require(_0x6878('0x6'));var BPromise=require(_0x6878('0x7'));var Mustache=require(_0x6878('0x8'));var util=require(_0x6878('0x9'));var path=require(_0x6878('0xa'));var sox=require(_0x6878('0xb'));var csv=require('to-csv');var ejs=require(_0x6878('0xc'));var fs=require('fs');var _=require(_0x6878('0xd'));var squel=require('squel');var crypto=require(_0x6878('0xe'));var jsforce=require(_0x6878('0xf'));var deskjs=require(_0x6878('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6878('0x11'));var Papa=require(_0x6878('0x12'));var Redis=require(_0x6878('0x13'));var authService=require(_0x6878('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6878('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6878('0x16'))(_0x6878('0x17'));var utils=require(_0x6878('0x18'));var config=require(_0x6878('0x19'));var db=require(_0x6878('0x1a'))['db'];var integrations=require(_0x6878('0x1b'));var jayson=require(_0x6878('0x1c'));var client=jayson[_0x6878('0x1d')][_0x6878('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x85bc0,_0x2a141f,_0x1e7076){if(_0x1e7076){var _0xcc6864=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcc6864[_0x6878('0x1f')](_0x2a141f)){return _0x85bc0;}else{throw new db['Sequelize'][(_0x6878('0x20'))](_0x6878('0x21'));}}else{return _0x85bc0;}}function respondWithRpcPromise(_0x24483f,_0x47f270,_0x427035,_0x4adabf){return new BPromise(function(_0x54ee2e,_0x29e314){var _0x188082=_0x4adabf||client;return _0x188082[_0x6878('0x22')](_0x24483f,_0x427035)[_0x6878('0x23')](function(_0x2b664f){logger[_0x6878('0x24')](_0x6878('0x25'),_0x47f270,_0x6878('0x26'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x47f270,_0x6878('0x26'),JSON['stringify'](_0x2b664f));if(_0x2b664f['error']){if(_0x2b664f['error']['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x47f270,_0x2b664f[_0x6878('0x27')]['message']);return _0x29e314(_0x2b664f[_0x6878('0x27')][_0x6878('0x28')]);}logger[_0x6878('0x27')](_0x6878('0x25'),_0x47f270,_0x2b664f[_0x6878('0x27')][_0x6878('0x28')]);return _0x54ee2e(_0x2b664f[_0x6878('0x27')][_0x6878('0x28')]);}else{logger[_0x6878('0x24')](_0x6878('0x25'),_0x47f270,_0x6878('0x26'));_0x54ee2e(_0x2b664f[_0x6878('0x29')][_0x6878('0x28')]);}})[_0x6878('0x2a')](function(_0x32be4d){logger[_0x6878('0x27')]('DeskAccount,\x20%s,\x20%s',_0x47f270,_0x32be4d);_0x29e314(_0x32be4d);});});}function respondWithStatusCode(_0x38a596,_0x19ac1c){_0x19ac1c=_0x19ac1c||0xcc;return function(_0x5d1171){if(_0x5d1171){return _0x38a596[_0x6878('0x2b')](_0x19ac1c);}return _0x38a596['status'](_0x19ac1c)[_0x6878('0x2c')]();};}function respondWithResult(_0x5e3c7c,_0x167f3d){_0x167f3d=_0x167f3d||0xc8;return function(_0x5d19d9){if(_0x5d19d9){return _0x5e3c7c[_0x6878('0x2d')](_0x167f3d)[_0x6878('0x2e')](_0x5d19d9);}};}function respondWithFilteredResult(_0x552d13,_0x4456c0){return function(_0x35968e){if(_0x35968e){var _0x4a6be2=_0x35968e['count'],_0x1dade2=_0x4456c0['offset'],_0x4ade61=_0x4456c0[_0x6878('0x2f')]+_0x4456c0['limit'],_0x2a89cb;if(_0x4ade61>=_0x4a6be2){_0x4ade61=_0x4a6be2;_0x2a89cb=0xc8;}else{_0x2a89cb=0xce;}_0x552d13['status'](_0x2a89cb);return _0x552d13[_0x6878('0x30')](_0x6878('0x31'),_0x1dade2+'-'+_0x4ade61+'/'+_0x4a6be2)[_0x6878('0x2e')](_0x35968e);}return null;};}function patchUpdates(_0x25fdbe){return function(_0x28fe21){try{jsonpatch[_0x6878('0x32')](_0x28fe21,_0x25fdbe,!![]);}catch(_0x32eb3e){return BPromise[_0x6878('0x33')](_0x32eb3e);}return _0x28fe21[_0x6878('0x34')]();};}function saveUpdates(_0x4af0fe,_0x2d2030){return function(_0x260dcc){if(_0x260dcc){return _0x260dcc[_0x6878('0x35')](_0x4af0fe)[_0x6878('0x23')](function(_0x39f13d){return _0x39f13d;});}return null;};}function removeEntity(_0x1749c4,_0x1240ab){return function(_0x1cb57d){if(_0x1cb57d){return _0x1cb57d[_0x6878('0x36')]()[_0x6878('0x23')](function(){_0x1749c4['status'](0xcc)[_0x6878('0x2c')]();});}};}function handleEntityNotFound(_0x4f560d,_0x1f6c4d){return function(_0x478873){if(!_0x478873){_0x4f560d[_0x6878('0x2b')](0x194);}return _0x478873;};}function handleError(_0x259fc3,_0x50893d){_0x50893d=_0x50893d||0x1f4;return function(_0x4c3ac7){logger[_0x6878('0x27')](_0x4c3ac7['stack']);if(_0x4c3ac7['name']){delete _0x4c3ac7[_0x6878('0x37')];}_0x259fc3[_0x6878('0x2d')](_0x50893d)[_0x6878('0x38')](_0x4c3ac7);};}exports[_0x6878('0x39')]=function(_0x3fb8d7,_0xb94ffa){var _0x177f20={},_0xba819f={},_0x3aee95={'count':0x0,'rows':[]};var _0x2822a1=_['map'](db[_0x6878('0x3a')][_0x6878('0x3b')],function(_0x3230da){return{'name':_0x3230da[_0x6878('0x3c')],'type':_0x3230da[_0x6878('0x3d')][_0x6878('0x3e')]};});_0xba819f[_0x6878('0x3f')]=_[_0x6878('0x40')](_0x2822a1,_0x6878('0x37'));_0xba819f['query']=_[_0x6878('0x41')](_0x3fb8d7[_0x6878('0x42')]);_0xba819f[_0x6878('0x43')]=_[_0x6878('0x44')](_0xba819f[_0x6878('0x3f')],_0xba819f[_0x6878('0x42')]);_0x177f20[_0x6878('0x45')]=_[_0x6878('0x44')](_0xba819f['model'],qs[_0x6878('0x46')](_0x3fb8d7[_0x6878('0x42')][_0x6878('0x46')]));_0x177f20[_0x6878('0x45')]=_0x177f20['attributes']['length']?_0x177f20[_0x6878('0x45')]:_0xba819f[_0x6878('0x3f')];if(!_0x3fb8d7[_0x6878('0x42')][_0x6878('0x47')](_0x6878('0x48'))){_0x177f20[_0x6878('0x49')]=qs['limit'](_0x3fb8d7[_0x6878('0x42')]['limit']);_0x177f20['offset']=qs['offset'](_0x3fb8d7[_0x6878('0x42')][_0x6878('0x2f')]);}_0x177f20[_0x6878('0x4a')]=qs[_0x6878('0x4b')](_0x3fb8d7[_0x6878('0x42')][_0x6878('0x4b')]);_0x177f20[_0x6878('0x4c')]=qs[_0x6878('0x43')](_[_0x6878('0x4d')](_0x3fb8d7['query'],_0xba819f[_0x6878('0x43')]));if(_0x3fb8d7[_0x6878('0x42')][_0x6878('0x4e')]){_0x177f20[_0x6878('0x4c')]=_[_0x6878('0x4f')](_0x177f20[_0x6878('0x4c')],{'$or':_[_0x6878('0x40')](_0x2822a1,function(_0x205a85){if(_0x205a85[_0x6878('0x3d')]!==_0x6878('0x50')){var _0x1e700a={};_0x1e700a[_0x205a85['name']]={'$like':'%'+_0x3fb8d7['query'][_0x6878('0x4e')]+'%'};return _0x1e700a;}})});}_0x177f20=_[_0x6878('0x4f')]({},_0x177f20,_0x3fb8d7[_0x6878('0x51')]);var _0x1a8815={'where':_0x177f20[_0x6878('0x4c')]};return db[_0x6878('0x3a')][_0x6878('0x52')](_0x1a8815)[_0x6878('0x23')](function(_0xd91a66){_0x3aee95[_0x6878('0x52')]=_0xd91a66;if(_0x3fb8d7[_0x6878('0x42')][_0x6878('0x53')]){_0x177f20[_0x6878('0x54')]=[{'all':!![]}];}return db[_0x6878('0x3a')][_0x6878('0x55')](_0x177f20);})['then'](function(_0x2d7530){_0x3aee95[_0x6878('0x56')]=_0x2d7530;return _0x3aee95;})['then'](respondWithFilteredResult(_0xb94ffa,_0x177f20))['catch'](handleError(_0xb94ffa,null));};exports[_0x6878('0x57')]=function(_0x298b42,_0x480d5){var _0x1f17aa={'raw':![],'where':{'id':_0x298b42['params']['id']}},_0xcdd578={};_0xcdd578[_0x6878('0x3f')]=_[_0x6878('0x41')](db['DeskAccount'][_0x6878('0x3b')]);_0xcdd578[_0x6878('0x42')]=_[_0x6878('0x41')](_0x298b42[_0x6878('0x42')]);_0xcdd578[_0x6878('0x43')]=_[_0x6878('0x44')](_0xcdd578[_0x6878('0x3f')],_0xcdd578[_0x6878('0x42')]);_0x1f17aa[_0x6878('0x45')]=_[_0x6878('0x44')](_0xcdd578[_0x6878('0x3f')],qs[_0x6878('0x46')](_0x298b42['query'][_0x6878('0x46')]));_0x1f17aa[_0x6878('0x45')]=_0x1f17aa[_0x6878('0x45')]['length']?_0x1f17aa[_0x6878('0x45')]:_0xcdd578['model'];if(_0x298b42[_0x6878('0x42')][_0x6878('0x53')]){_0x1f17aa[_0x6878('0x54')]=[{'all':!![]}];}_0x1f17aa=_[_0x6878('0x4f')]({},_0x1f17aa,_0x298b42['options']);return db[_0x6878('0x3a')][_0x6878('0x58')](_0x1f17aa)['then'](handleEntityNotFound(_0x480d5,null))[_0x6878('0x23')](respondWithResult(_0x480d5,null))[_0x6878('0x2a')](handleError(_0x480d5,null));};exports[_0x6878('0x59')]=function(_0x16d6a8,_0x1268c0){return db[_0x6878('0x3a')][_0x6878('0x59')](_0x16d6a8[_0x6878('0x5a')],{})['then'](respondWithResult(_0x1268c0,0xc9))[_0x6878('0x2a')](handleError(_0x1268c0,null));};exports[_0x6878('0x35')]=function(_0x15e013,_0x3a4c65){if(_0x15e013[_0x6878('0x5a')]['id']){delete _0x15e013['body']['id'];}return db[_0x6878('0x3a')][_0x6878('0x58')]({'where':{'id':_0x15e013[_0x6878('0x5b')]['id']}})[_0x6878('0x23')](handleEntityNotFound(_0x3a4c65,null))[_0x6878('0x23')](saveUpdates(_0x15e013[_0x6878('0x5a')],null))[_0x6878('0x23')](respondWithResult(_0x3a4c65,null))[_0x6878('0x2a')](handleError(_0x3a4c65,null));};exports[_0x6878('0x36')]=function(_0x125a3e,_0x46f0b6){return db['DeskAccount'][_0x6878('0x58')]({'where':{'id':_0x125a3e['params']['id']}})[_0x6878('0x23')](handleEntityNotFound(_0x46f0b6,null))[_0x6878('0x23')](removeEntity(_0x46f0b6,null))['catch'](handleError(_0x46f0b6,null));};exports[_0x6878('0x5c')]=function(_0x53c6a5,_0x4fce1e,_0x256790){var _0x117aeb={};var _0x2e98a4={};var _0x1a53f1;var _0x3ecff2;return db[_0x6878('0x3a')]['findOne']({'where':{'id':_0x53c6a5[_0x6878('0x5b')]['id']}})[_0x6878('0x23')](handleEntityNotFound(_0x4fce1e,null))[_0x6878('0x23')](function(_0x1d3d2c){if(_0x1d3d2c){_0x1a53f1=_0x1d3d2c;_0x2e98a4[_0x6878('0x3f')]=_[_0x6878('0x41')](db[_0x6878('0x5d')][_0x6878('0x3b')]);_0x2e98a4[_0x6878('0x42')]=_[_0x6878('0x41')](_0x53c6a5[_0x6878('0x42')]);_0x2e98a4[_0x6878('0x43')]=_[_0x6878('0x44')](_0x2e98a4['model'],_0x2e98a4[_0x6878('0x42')]);_0x117aeb[_0x6878('0x45')]=_[_0x6878('0x44')](_0x2e98a4[_0x6878('0x3f')],qs[_0x6878('0x46')](_0x53c6a5[_0x6878('0x42')][_0x6878('0x46')]));_0x117aeb['attributes']=_0x117aeb['attributes']['length']?_0x117aeb[_0x6878('0x45')]:_0x2e98a4[_0x6878('0x3f')];_0x117aeb[_0x6878('0x4a')]=qs[_0x6878('0x4b')](_0x53c6a5['query'][_0x6878('0x4b')]);_0x117aeb[_0x6878('0x4c')]=qs['filters'](_['pick'](_0x53c6a5[_0x6878('0x42')],_0x2e98a4[_0x6878('0x43')]));if(_0x53c6a5['query']['filter']){_0x117aeb[_0x6878('0x4c')]=_[_0x6878('0x4f')](_0x117aeb['where'],{'$or':_[_0x6878('0x40')](_0x117aeb['attributes'],function(_0x5be19e){var _0xfc226f={};_0xfc226f[_0x5be19e]={'$like':'%'+_0x53c6a5[_0x6878('0x42')][_0x6878('0x4e')]+'%'};return _0xfc226f;})});}_0x117aeb=_['merge']({},_0x117aeb,_0x53c6a5['options']);return _0x1a53f1[_0x6878('0x5c')](_0x117aeb);}})[_0x6878('0x23')](function(_0x15879d){if(_0x15879d){_0x3ecff2=_0x15879d[_0x6878('0x5e')];if(!_0x53c6a5['query'][_0x6878('0x47')](_0x6878('0x48'))){_0x117aeb[_0x6878('0x49')]=qs[_0x6878('0x49')](_0x53c6a5['query'][_0x6878('0x49')]);_0x117aeb[_0x6878('0x2f')]=qs[_0x6878('0x2f')](_0x53c6a5['query'][_0x6878('0x2f')]);}return _0x1a53f1[_0x6878('0x5c')](_0x117aeb);}})[_0x6878('0x23')](function(_0x5998ba){if(_0x5998ba){return _0x5998ba?{'count':_0x3ecff2,'rows':_0x5998ba}:null;}})[_0x6878('0x23')](respondWithResult(_0x4fce1e,null))[_0x6878('0x2a')](handleError(_0x4fce1e,null));};exports[_0x6878('0x5f')]=function(_0x3da36c,_0x22a690,_0x433d90){if(_0x3da36c[_0x6878('0x5a')]['id']){delete _0x3da36c[_0x6878('0x5a')]['id'];}return db[_0x6878('0x3a')][_0x6878('0x60')]({'where':{'id':_0x3da36c[_0x6878('0x5b')]['id']}})['then'](handleEntityNotFound(_0x22a690,null))[_0x6878('0x23')](function(_0x502e67){if(_0x502e67){_0x3da36c[_0x6878('0x5a')][_0x6878('0x61')]=_0x502e67['id'];_0x3da36c['body'][_0x6878('0x62')]=integrations[_0x6878('0x63')](_0x3da36c['body'][_0x6878('0x64')],_0x3da36c['body'][_0x6878('0x3d')]);_0x3da36c[_0x6878('0x5a')][_0x6878('0x65')]=integrations[_0x6878('0x66')](_0x3da36c[_0x6878('0x5a')]['channel'],_0x3da36c[_0x6878('0x5a')][_0x6878('0x3d')]);return db[_0x6878('0x5d')][_0x6878('0x59')](_0x3da36c[_0x6878('0x5a')],{'include':[{'model':db[_0x6878('0x67')],'as':_0x6878('0x62')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x22a690,null))[_0x6878('0x2a')](handleError(_0x22a690,null));};exports[_0x6878('0x68')]=function(_0xa41667,_0x2578fd,_0x161f55){var _0x48cb32=[{'name':'priority','label':_0x6878('0x69'),'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 _0x581ce6='';return db['DeskAccount']['findOne']({'where':{'id':_0xa41667[_0x6878('0x5b')]['id']},'attributes':['id',_0x6878('0x6a'),_0x6878('0x6b'),_0x6878('0x6c'),_0x6878('0x6d'),_0x6878('0x6e'),_0x6878('0x6f'),_0x6878('0x70'),_0x6878('0x71')]})['then'](handleEntityNotFound(_0x2578fd,null))[_0x6878('0x23')](function(_0x41ece1){if(_0x41ece1){_0x581ce6=_0x41ece1[_0x6878('0x6a')];var _0x5068e0=_0x581ce6[_0x6878('0x72')](-0x1);if(_0x5068e0==='/'){_0x581ce6=_0x581ce6['substring'](0x0,_0x581ce6[_0x6878('0x73')](_0x5068e0));}var _0x29b1da={'method':_0x6878('0x74'),'uri':util[_0x6878('0x75')](_0x6878('0x76'),_0x581ce6),'headers':{'Content-Type':_0x6878('0x77'),'Accept':_0x6878('0x77')},'json':!![]};if(_0x41ece1[_0x6878('0x6b')]===_0x6878('0x78')){_0x29b1da[_0x6878('0x79')][_0x6878('0x7a')]=util['format']('Basic\x20%s',new Buffer(util['format'](_0x6878('0x7b'),_0x41ece1[_0x6878('0x6c')],_0x41ece1[_0x6878('0x6d')]))[_0x6878('0x7c')](_0x6878('0x7d')));}return rp(_0x29b1da)[_0x6878('0x23')](function(_0x110afb){return _0x48cb32['concat'](_[_0x6878('0x40')](_0x110afb[_0x6878('0x7e')][_0x6878('0x7f')],function(_0xd91f86){return{'id':_0xd91f86[_0x6878('0x37')],'name':_0xd91f86['name'],'type':_0xd91f86[_0x6878('0x3d')],'active':_0xd91f86[_0x6878('0x80')],'label':_0xd91f86[_0x6878('0x81')],'custom':!![]};}));});}})[_0x6878('0x23')](function(_0x4c01c7){return{'count':_0x4c01c7[_0x6878('0x5e')],'rows':_0x4c01c7};})['then'](respondWithResult(_0x2578fd,null))[_0x6878('0x2a')](function(_0x2483cb){var _0x2d5868=_0xa41667[_0x6878('0x42')]['test']?0x1f4:_0x2483cb['statusCode']||0x1f4;logger[_0x6878('0x27')](_0x6878('0x82'),_0x6878('0x68'),_0x2d5868,JSON[_0x6878('0x83')](_0x2483cb));delete _0x2483cb['name'];if(_0x2d5868===0x191){_0x2d5868=0x190;}_0x2578fd[_0x6878('0x2d')](_0x2d5868)['send'](_0xa41667[_0x6878('0x42')][_0x6878('0x1f')]?{'message':'Wrong\x20credentials','statusCode':_0x2483cb['statusCode']}:_0x2483cb);});}; \ No newline at end of file +var _0xb3a1=['application/json','basic','headers','format','Basic\x20%s','%s:%s','toString','base64','concat','entries','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','ValidationError','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','DeskAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','options','findAll','rows','includeAll','include','create','body','find','params','getConfigurations','findOne','rawAttributes','pick','addConfiguration','channel','Descriptions','DeskField','Subjects','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','slice','substring','lastIndexOf','GET','%s/custom_fields'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xb3a1,0x91));var _0x1b3a=function(_0x31337b,_0x10a62f){_0x31337b=_0x31337b-0x0;var _0x5ad6f3=_0xb3a1[_0x31337b];return _0x5ad6f3;};'use strict';var pdf=require(_0x1b3a('0x0'));var emlformat=require(_0x1b3a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1b3a('0x2'));var jsonpatch=require(_0x1b3a('0x3'));var rp=require(_0x1b3a('0x4'));var moment=require('moment');var BPromise=require(_0x1b3a('0x5'));var Mustache=require(_0x1b3a('0x6'));var util=require(_0x1b3a('0x7'));var path=require(_0x1b3a('0x8'));var sox=require(_0x1b3a('0x9'));var csv=require(_0x1b3a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1b3a('0xb'));var squel=require(_0x1b3a('0xc'));var crypto=require(_0x1b3a('0xd'));var jsforce=require(_0x1b3a('0xe'));var deskjs=require(_0x1b3a('0xf'));var toCsv=require(_0x1b3a('0xa'));var querystring=require('querystring');var Papa=require(_0x1b3a('0x10'));var Redis=require(_0x1b3a('0x11'));var authService=require(_0x1b3a('0x12'));var qs=require(_0x1b3a('0x13'));var as=require(_0x1b3a('0x14'));var hardwareService=require(_0x1b3a('0x15'));var logger=require(_0x1b3a('0x16'))('api');var utils=require(_0x1b3a('0x17'));var config=require(_0x1b3a('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1b3a('0x19'));var jayson=require(_0x1b3a('0x1a'));var client=jayson[_0x1b3a('0x1b')][_0x1b3a('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x55c290,_0x573ad4,_0x50b786){if(_0x50b786){var _0x495dba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x495dba['test'](_0x573ad4)){return _0x55c290;}else{throw new db['Sequelize'][(_0x1b3a('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x55c290;}}function respondWithRpcPromise(_0x35193a,_0x209cc5,_0x350dae,_0x327d86){return new BPromise(function(_0x363a29,_0x482776){var _0x3adcc9=_0x327d86||client;return _0x3adcc9[_0x1b3a('0x1e')](_0x35193a,_0x350dae)[_0x1b3a('0x1f')](function(_0x3796a4){logger[_0x1b3a('0x20')](_0x1b3a('0x21'),_0x209cc5,_0x1b3a('0x22'));logger[_0x1b3a('0x23')](_0x1b3a('0x24'),_0x209cc5,_0x1b3a('0x22'),JSON['stringify'](_0x3796a4));if(_0x3796a4['error']){if(_0x3796a4['error'][_0x1b3a('0x25')]===0x1f4){logger[_0x1b3a('0x26')](_0x1b3a('0x21'),_0x209cc5,_0x3796a4[_0x1b3a('0x26')][_0x1b3a('0x27')]);return _0x482776(_0x3796a4['error']['message']);}logger[_0x1b3a('0x26')](_0x1b3a('0x21'),_0x209cc5,_0x3796a4[_0x1b3a('0x26')][_0x1b3a('0x27')]);return _0x363a29(_0x3796a4[_0x1b3a('0x26')][_0x1b3a('0x27')]);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x209cc5,_0x1b3a('0x22'));_0x363a29(_0x3796a4[_0x1b3a('0x28')][_0x1b3a('0x27')]);}})[_0x1b3a('0x29')](function(_0x5ec1ac){logger[_0x1b3a('0x26')](_0x1b3a('0x21'),_0x209cc5,_0x5ec1ac);_0x482776(_0x5ec1ac);});});}function respondWithStatusCode(_0x55a727,_0x538771){_0x538771=_0x538771||0xcc;return function(_0x388a1d){if(_0x388a1d){return _0x55a727[_0x1b3a('0x2a')](_0x538771);}return _0x55a727[_0x1b3a('0x2b')](_0x538771)[_0x1b3a('0x2c')]();};}function respondWithResult(_0x475c4f,_0x55711e){_0x55711e=_0x55711e||0xc8;return function(_0x188e2d){if(_0x188e2d){return _0x475c4f[_0x1b3a('0x2b')](_0x55711e)[_0x1b3a('0x2d')](_0x188e2d);}};}function respondWithFilteredResult(_0x275a21,_0x2e403b){return function(_0x81b4eb){if(_0x81b4eb){var _0x3306dc=_0x81b4eb[_0x1b3a('0x2e')],_0x2aab6f=_0x2e403b[_0x1b3a('0x2f')],_0x3e71bc=_0x2e403b[_0x1b3a('0x2f')]+_0x2e403b['limit'],_0xb9591;if(_0x3e71bc>=_0x3306dc){_0x3e71bc=_0x3306dc;_0xb9591=0xc8;}else{_0xb9591=0xce;}_0x275a21[_0x1b3a('0x2b')](_0xb9591);return _0x275a21[_0x1b3a('0x30')](_0x1b3a('0x31'),_0x2aab6f+'-'+_0x3e71bc+'/'+_0x3306dc)[_0x1b3a('0x2d')](_0x81b4eb);}return null;};}function patchUpdates(_0x180d92){return function(_0x5e781e){try{jsonpatch[_0x1b3a('0x32')](_0x5e781e,_0x180d92,!![]);}catch(_0x33764e){return BPromise[_0x1b3a('0x33')](_0x33764e);}return _0x5e781e[_0x1b3a('0x34')]();};}function saveUpdates(_0x49c093,_0x3bf11e){return function(_0x510fce){if(_0x510fce){return _0x510fce[_0x1b3a('0x35')](_0x49c093)[_0x1b3a('0x1f')](function(_0x1ba0d3){return _0x1ba0d3;});}return null;};}function removeEntity(_0x427637,_0x192fb3){return function(_0x229136){if(_0x229136){return _0x229136[_0x1b3a('0x36')]()[_0x1b3a('0x1f')](function(){_0x427637[_0x1b3a('0x2b')](0xcc)[_0x1b3a('0x2c')]();});}};}function handleEntityNotFound(_0x427301,_0x4340a9){return function(_0x5d83e2){if(!_0x5d83e2){_0x427301[_0x1b3a('0x2a')](0x194);}return _0x5d83e2;};}function handleError(_0x2ccb8f,_0xd6e782){_0xd6e782=_0xd6e782||0x1f4;return function(_0x10c41d){logger['error'](_0x10c41d[_0x1b3a('0x37')]);if(_0x10c41d['name']){delete _0x10c41d[_0x1b3a('0x38')];}_0x2ccb8f[_0x1b3a('0x2b')](_0xd6e782)['send'](_0x10c41d);};}exports[_0x1b3a('0x39')]=function(_0x338cfc,_0x3c7a50){var _0xe0940={},_0xa63a39={},_0x1fb6aa={'count':0x0,'rows':[]};var _0x251923=_[_0x1b3a('0x3a')](db[_0x1b3a('0x3b')]['rawAttributes'],function(_0xe707dc){return{'name':_0xe707dc[_0x1b3a('0x3c')],'type':_0xe707dc[_0x1b3a('0x3d')][_0x1b3a('0x3e')]};});_0xa63a39[_0x1b3a('0x3f')]=_[_0x1b3a('0x3a')](_0x251923,_0x1b3a('0x38'));_0xa63a39[_0x1b3a('0x40')]=_[_0x1b3a('0x41')](_0x338cfc[_0x1b3a('0x40')]);_0xa63a39['filters']=_[_0x1b3a('0x42')](_0xa63a39[_0x1b3a('0x3f')],_0xa63a39[_0x1b3a('0x40')]);_0xe0940[_0x1b3a('0x43')]=_[_0x1b3a('0x42')](_0xa63a39[_0x1b3a('0x3f')],qs[_0x1b3a('0x44')](_0x338cfc[_0x1b3a('0x40')][_0x1b3a('0x44')]));_0xe0940['attributes']=_0xe0940['attributes'][_0x1b3a('0x45')]?_0xe0940[_0x1b3a('0x43')]:_0xa63a39[_0x1b3a('0x3f')];if(!_0x338cfc['query'][_0x1b3a('0x46')](_0x1b3a('0x47'))){_0xe0940[_0x1b3a('0x48')]=qs[_0x1b3a('0x48')](_0x338cfc['query'][_0x1b3a('0x48')]);_0xe0940[_0x1b3a('0x2f')]=qs[_0x1b3a('0x2f')](_0x338cfc[_0x1b3a('0x40')][_0x1b3a('0x2f')]);}_0xe0940['order']=qs['sort'](_0x338cfc[_0x1b3a('0x40')][_0x1b3a('0x49')]);_0xe0940[_0x1b3a('0x4a')]=qs[_0x1b3a('0x4b')](_['pick'](_0x338cfc[_0x1b3a('0x40')],_0xa63a39[_0x1b3a('0x4b')]));if(_0x338cfc[_0x1b3a('0x40')][_0x1b3a('0x4c')]){_0xe0940['where']=_[_0x1b3a('0x4d')](_0xe0940['where'],{'$or':_[_0x1b3a('0x3a')](_0x251923,function(_0x3867f4){if(_0x3867f4[_0x1b3a('0x3d')]!=='VIRTUAL'){var _0x4d8aec={};_0x4d8aec[_0x3867f4[_0x1b3a('0x38')]]={'$like':'%'+_0x338cfc[_0x1b3a('0x40')][_0x1b3a('0x4c')]+'%'};return _0x4d8aec;}})});}_0xe0940=_[_0x1b3a('0x4d')]({},_0xe0940,_0x338cfc[_0x1b3a('0x4e')]);var _0x435384={'where':_0xe0940[_0x1b3a('0x4a')]};return db['DeskAccount'][_0x1b3a('0x2e')](_0x435384)['then'](function(_0x4328d7){_0x1fb6aa['count']=_0x4328d7;if(_0x338cfc['query']['includeAll']){_0xe0940['include']=[{'all':!![]}];}return db[_0x1b3a('0x3b')][_0x1b3a('0x4f')](_0xe0940);})[_0x1b3a('0x1f')](function(_0x33b2ba){_0x1fb6aa[_0x1b3a('0x50')]=_0x33b2ba;return _0x1fb6aa;})[_0x1b3a('0x1f')](respondWithFilteredResult(_0x3c7a50,_0xe0940))[_0x1b3a('0x29')](handleError(_0x3c7a50,null));};exports['show']=function(_0x506955,_0x2cfa20){var _0x7eb542={'raw':![],'where':{'id':_0x506955['params']['id']}},_0x4940dc={};_0x4940dc[_0x1b3a('0x3f')]=_[_0x1b3a('0x41')](db[_0x1b3a('0x3b')]['rawAttributes']);_0x4940dc['query']=_['keys'](_0x506955[_0x1b3a('0x40')]);_0x4940dc['filters']=_[_0x1b3a('0x42')](_0x4940dc['model'],_0x4940dc['query']);_0x7eb542['attributes']=_[_0x1b3a('0x42')](_0x4940dc[_0x1b3a('0x3f')],qs[_0x1b3a('0x44')](_0x506955[_0x1b3a('0x40')]['fields']));_0x7eb542[_0x1b3a('0x43')]=_0x7eb542[_0x1b3a('0x43')][_0x1b3a('0x45')]?_0x7eb542[_0x1b3a('0x43')]:_0x4940dc['model'];if(_0x506955[_0x1b3a('0x40')][_0x1b3a('0x51')]){_0x7eb542[_0x1b3a('0x52')]=[{'all':!![]}];}_0x7eb542=_['merge']({},_0x7eb542,_0x506955[_0x1b3a('0x4e')]);return db[_0x1b3a('0x3b')]['find'](_0x7eb542)['then'](handleEntityNotFound(_0x2cfa20,null))[_0x1b3a('0x1f')](respondWithResult(_0x2cfa20,null))['catch'](handleError(_0x2cfa20,null));};exports[_0x1b3a('0x53')]=function(_0x18f03d,_0x16cea2){return db[_0x1b3a('0x3b')][_0x1b3a('0x53')](_0x18f03d['body'],{})['then'](respondWithResult(_0x16cea2,0xc9))['catch'](handleError(_0x16cea2,null));};exports['update']=function(_0x2f3c97,_0x51e538){if(_0x2f3c97[_0x1b3a('0x54')]['id']){delete _0x2f3c97[_0x1b3a('0x54')]['id'];}return db[_0x1b3a('0x3b')][_0x1b3a('0x55')]({'where':{'id':_0x2f3c97[_0x1b3a('0x56')]['id']}})[_0x1b3a('0x1f')](handleEntityNotFound(_0x51e538,null))['then'](saveUpdates(_0x2f3c97['body'],null))['then'](respondWithResult(_0x51e538,null))['catch'](handleError(_0x51e538,null));};exports[_0x1b3a('0x36')]=function(_0x1eb1d5,_0x2fd3ef){return db[_0x1b3a('0x3b')][_0x1b3a('0x55')]({'where':{'id':_0x1eb1d5[_0x1b3a('0x56')]['id']}})['then'](handleEntityNotFound(_0x2fd3ef,null))[_0x1b3a('0x1f')](removeEntity(_0x2fd3ef,null))[_0x1b3a('0x29')](handleError(_0x2fd3ef,null));};exports[_0x1b3a('0x57')]=function(_0x5c218c,_0x36ba17,_0x42fbe5){var _0x583fd0={};var _0x5dd993={};var _0x1f10b6;var _0x5132f3;return db[_0x1b3a('0x3b')][_0x1b3a('0x58')]({'where':{'id':_0x5c218c[_0x1b3a('0x56')]['id']}})['then'](handleEntityNotFound(_0x36ba17,null))[_0x1b3a('0x1f')](function(_0xb1316f){if(_0xb1316f){_0x1f10b6=_0xb1316f;_0x5dd993['model']=_[_0x1b3a('0x41')](db['DeskConfiguration'][_0x1b3a('0x59')]);_0x5dd993[_0x1b3a('0x40')]=_[_0x1b3a('0x41')](_0x5c218c[_0x1b3a('0x40')]);_0x5dd993[_0x1b3a('0x4b')]=_[_0x1b3a('0x42')](_0x5dd993['model'],_0x5dd993[_0x1b3a('0x40')]);_0x583fd0[_0x1b3a('0x43')]=_[_0x1b3a('0x42')](_0x5dd993[_0x1b3a('0x3f')],qs[_0x1b3a('0x44')](_0x5c218c[_0x1b3a('0x40')][_0x1b3a('0x44')]));_0x583fd0[_0x1b3a('0x43')]=_0x583fd0[_0x1b3a('0x43')][_0x1b3a('0x45')]?_0x583fd0['attributes']:_0x5dd993[_0x1b3a('0x3f')];_0x583fd0['order']=qs[_0x1b3a('0x49')](_0x5c218c['query'][_0x1b3a('0x49')]);_0x583fd0[_0x1b3a('0x4a')]=qs[_0x1b3a('0x4b')](_[_0x1b3a('0x5a')](_0x5c218c[_0x1b3a('0x40')],_0x5dd993[_0x1b3a('0x4b')]));if(_0x5c218c[_0x1b3a('0x40')][_0x1b3a('0x4c')]){_0x583fd0[_0x1b3a('0x4a')]=_[_0x1b3a('0x4d')](_0x583fd0[_0x1b3a('0x4a')],{'$or':_[_0x1b3a('0x3a')](_0x583fd0[_0x1b3a('0x43')],function(_0x3a3175){var _0x19130b={};_0x19130b[_0x3a3175]={'$like':'%'+_0x5c218c[_0x1b3a('0x40')][_0x1b3a('0x4c')]+'%'};return _0x19130b;})});}_0x583fd0=_[_0x1b3a('0x4d')]({},_0x583fd0,_0x5c218c[_0x1b3a('0x4e')]);return _0x1f10b6[_0x1b3a('0x57')](_0x583fd0);}})['then'](function(_0x4c7df4){if(_0x4c7df4){_0x5132f3=_0x4c7df4[_0x1b3a('0x45')];if(!_0x5c218c['query'][_0x1b3a('0x46')]('nolimit')){_0x583fd0[_0x1b3a('0x48')]=qs[_0x1b3a('0x48')](_0x5c218c['query']['limit']);_0x583fd0['offset']=qs[_0x1b3a('0x2f')](_0x5c218c[_0x1b3a('0x40')]['offset']);}return _0x1f10b6[_0x1b3a('0x57')](_0x583fd0);}})[_0x1b3a('0x1f')](function(_0x3621e4){if(_0x3621e4){return _0x3621e4?{'count':_0x5132f3,'rows':_0x3621e4}:null;}})[_0x1b3a('0x1f')](respondWithResult(_0x36ba17,null))[_0x1b3a('0x29')](handleError(_0x36ba17,null));};exports[_0x1b3a('0x5b')]=function(_0x27fa58,_0x2cdc35,_0x14c8b8){if(_0x27fa58[_0x1b3a('0x54')]['id']){delete _0x27fa58[_0x1b3a('0x54')]['id'];}return db[_0x1b3a('0x3b')][_0x1b3a('0x58')]({'where':{'id':_0x27fa58[_0x1b3a('0x56')]['id']}})[_0x1b3a('0x1f')](handleEntityNotFound(_0x2cdc35,null))[_0x1b3a('0x1f')](function(_0x1b4291){if(_0x1b4291){_0x27fa58[_0x1b3a('0x54')]['AccountId']=_0x1b4291['id'];_0x27fa58[_0x1b3a('0x54')]['Subjects']=integrations['getSubjects'](_0x27fa58['body'][_0x1b3a('0x5c')],_0x27fa58[_0x1b3a('0x54')][_0x1b3a('0x3d')]);_0x27fa58[_0x1b3a('0x54')][_0x1b3a('0x5d')]=integrations['getDescriptions'](_0x27fa58[_0x1b3a('0x54')][_0x1b3a('0x5c')],_0x27fa58[_0x1b3a('0x54')]['type']);return db['DeskConfiguration']['create'](_0x27fa58[_0x1b3a('0x54')],{'include':[{'model':db[_0x1b3a('0x5e')],'as':_0x1b3a('0x5f')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0x1b3a('0x1f')](respondWithResult(_0x2cdc35,null))[_0x1b3a('0x29')](handleError(_0x2cdc35,null));};exports[_0x1b3a('0x60')]=function(_0x597d54,_0x30e87e,_0x43b362){var _0x565371=[{'name':_0x1b3a('0x61'),'label':_0x1b3a('0x61'),'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 _0xc5c3c1='';return db['DeskAccount'][_0x1b3a('0x58')]({'where':{'id':_0x597d54['params']['id']},'attributes':['id',_0x1b3a('0x62'),_0x1b3a('0x63'),_0x1b3a('0x64'),_0x1b3a('0x65'),'consumerKey',_0x1b3a('0x66'),_0x1b3a('0x67'),'tokenSecret']})[_0x1b3a('0x1f')](handleEntityNotFound(_0x30e87e,null))[_0x1b3a('0x1f')](function(_0x46b5be){if(_0x46b5be){_0xc5c3c1=_0x46b5be[_0x1b3a('0x62')];var _0x3b2262=_0xc5c3c1[_0x1b3a('0x68')](-0x1);if(_0x3b2262==='/'){_0xc5c3c1=_0xc5c3c1[_0x1b3a('0x69')](0x0,_0xc5c3c1[_0x1b3a('0x6a')](_0x3b2262));}var _0x28dcf1={'method':_0x1b3a('0x6b'),'uri':util['format'](_0x1b3a('0x6c'),_0xc5c3c1),'headers':{'Content-Type':_0x1b3a('0x6d'),'Accept':_0x1b3a('0x6d')},'json':!![]};if(_0x46b5be['authType']===_0x1b3a('0x6e')){_0x28dcf1[_0x1b3a('0x6f')]['Authorization']=util[_0x1b3a('0x70')](_0x1b3a('0x71'),new Buffer(util[_0x1b3a('0x70')](_0x1b3a('0x72'),_0x46b5be['username'],_0x46b5be[_0x1b3a('0x65')]))[_0x1b3a('0x73')](_0x1b3a('0x74')));}return rp(_0x28dcf1)[_0x1b3a('0x1f')](function(_0x41499c){return _0x565371[_0x1b3a('0x75')](_[_0x1b3a('0x3a')](_0x41499c['_embedded'][_0x1b3a('0x76')],function(_0xc7ecb2){return{'id':_0xc7ecb2['name'],'name':_0xc7ecb2['name'],'type':_0xc7ecb2[_0x1b3a('0x3d')],'active':_0xc7ecb2[_0x1b3a('0x77')],'label':_0xc7ecb2[_0x1b3a('0x78')],'custom':!![]};}));});}})[_0x1b3a('0x1f')](function(_0x38543f){return{'count':_0x38543f['length'],'rows':_0x38543f};})[_0x1b3a('0x1f')](respondWithResult(_0x30e87e,null))[_0x1b3a('0x29')](function(_0x1dd6b7){var _0x583407=_0x597d54['query'][_0x1b3a('0x79')]?0x1f4:_0x1dd6b7[_0x1b3a('0x7a')]||0x1f4;logger[_0x1b3a('0x26')](_0x1b3a('0x7b'),_0x1b3a('0x60'),_0x583407,JSON[_0x1b3a('0x7c')](_0x1dd6b7));delete _0x1dd6b7[_0x1b3a('0x38')];if(_0x583407===0x191){_0x583407=0x190;}_0x30e87e['status'](_0x583407)[_0x1b3a('0x7d')](_0x597d54['query'][_0x1b3a('0x79')]?{'message':_0x1b3a('0x7e'),'statusCode':_0x1dd6b7['statusCode']}:_0x1dd6b7);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index d69bb6b..b40f31e 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 _0x3ce4=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','api','path'];(function(_0x51b5f7,_0x5eeee6){var _0x1d72c8=function(_0x32941d){while(--_0x32941d){_0x51b5f7['push'](_0x51b5f7['shift']());}};_0x1d72c8(++_0x5eeee6);}(_0x3ce4,0xee));var _0x43ce=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x3ce4[_0x31991b];return _0x307304;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x43ce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43ce('0x1'));var rimraf=require(_0x43ce('0x2'));var config=require(_0x43ce('0x3'));var attributes=require(_0x43ce('0x4'));var integrations=require(_0x43ce('0x5'));module[_0x43ce('0x6')]=function(_0xfac881,_0x2c3d3e){return _0xfac881[_0x43ce('0x7')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a1e=['../../config/logger','moment','bluebird','request-promise','./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','lodash'];(function(_0xf51c06,_0x388e5b){var _0x1d5420=function(_0x5e077b){while(--_0x5e077b){_0xf51c06['push'](_0xf51c06['shift']());}};_0x1d5420(++_0x388e5b);}(_0x0a1e,0x104));var _0xe0a1=function(_0x389e1b,_0x47e9b5){_0x389e1b=_0x389e1b-0x0;var _0x2b2eb2=_0x0a1e[_0x389e1b];return _0x2b2eb2;};'use strict';var _=require(_0xe0a1('0x0'));var util=require('util');var logger=require(_0xe0a1('0x1'))('api');var moment=require(_0xe0a1('0x2'));var BPromise=require(_0xe0a1('0x3'));var rp=require(_0xe0a1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe0a1('0x5'));var integrations=require(_0xe0a1('0x6'));module[_0xe0a1('0x7')]=function(_0x1ab004,_0x536107){return _0x1ab004['define'](_0xe0a1('0x8'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index c16bda8..ac175fc 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 _0x494f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowDeskAccount','where','lodash','util','moment','bluebird','randomstring'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0x494f,0xf7));var _0xf494=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x494f[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xf494('0x0'));var util=require(_0xf494('0x1'));var moment=require(_0xf494('0x2'));var BPromise=require(_0xf494('0x3'));var rs=require(_0xf494('0x4'));var fs=require('fs');var Redis=require(_0xf494('0x5'));var db=require(_0xf494('0x6'))['db'];var utils=require(_0xf494('0x7'));var logger=require(_0xf494('0x8'))('rpc');var config=require(_0xf494('0x9'));var jayson=require(_0xf494('0xa'));var client=jayson[_0xf494('0xb')][_0xf494('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26c51f,_0x282f1b,_0x46dbb8){return new BPromise(function(_0x30181b,_0x1f6f03){return client[_0xf494('0xd')](_0x26c51f,_0x46dbb8)[_0xf494('0xe')](function(_0x51ab73){logger[_0xf494('0xf')]('DeskAccount,\x20%s,\x20%s',_0x282f1b,_0xf494('0x10'));logger[_0xf494('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x282f1b,_0xf494('0x10'),JSON['stringify'](_0x51ab73));if(_0x51ab73[_0xf494('0x12')]){if(_0x51ab73[_0xf494('0x12')]['code']===0x1f4){logger[_0xf494('0x12')](_0xf494('0x13'),_0x282f1b,_0x51ab73[_0xf494('0x12')][_0xf494('0x14')]);return _0x1f6f03(_0x51ab73['error'][_0xf494('0x14')]);}logger[_0xf494('0x12')](_0xf494('0x13'),_0x282f1b,_0x51ab73[_0xf494('0x12')][_0xf494('0x14')]);return _0x30181b(_0x51ab73['error'][_0xf494('0x14')]);}else{logger['info'](_0xf494('0x13'),_0x282f1b,_0xf494('0x10'));_0x30181b(_0x51ab73[_0xf494('0x15')][_0xf494('0x14')]);}})[_0xf494('0x16')](function(_0x192067){logger[_0xf494('0x12')](_0xf494('0x13'),_0x282f1b,_0x192067);_0x1f6f03(_0x192067);});});}exports[_0xf494('0x17')]=function(_0x4f165b){var _0x535860=this;return new Promise(function(_0x202940,_0x47be9c){return db[_0xf494('0x18')][_0xf494('0x19')]({'raw':_0x4f165b[_0xf494('0x1a')]?_0x4f165b[_0xf494('0x1a')][_0xf494('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f165b['options']?_0x4f165b[_0xf494('0x1a')]['where']||null:null,'attributes':_0x4f165b[_0xf494('0x1a')]?_0x4f165b[_0xf494('0x1a')][_0xf494('0x1c')]||null:null,'limit':_0x4f165b[_0xf494('0x1a')]?_0x4f165b[_0xf494('0x1a')][_0xf494('0x1d')]||null:null,'include':_0x4f165b[_0xf494('0x1a')]?_0x4f165b['options'][_0xf494('0x1e')]?_['map'](_0x4f165b[_0xf494('0x1a')][_0xf494('0x1e')],function(_0x5e6605){return{'model':db[_0x5e6605[_0xf494('0x1f')]],'as':_0x5e6605['as'],'attributes':_0x5e6605[_0xf494('0x1c')],'include':_0x5e6605['include']?_[_0xf494('0x20')](_0x5e6605[_0xf494('0x1e')],function(_0x1a6981){return{'model':db[_0x1a6981[_0xf494('0x1f')]],'as':_0x1a6981['as'],'attributes':_0x1a6981[_0xf494('0x1c')],'include':_0x1a6981['include']?_['map'](_0x1a6981[_0xf494('0x1e')],function(_0x41889a){return{'model':db[_0x41889a['model']],'as':_0x41889a['as'],'attributes':_0x41889a[_0xf494('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe9040a){logger[_0xf494('0xf')](_0xf494('0x17'),_0x4f165b);logger[_0xf494('0x11')](_0xf494('0x17'),_0x4f165b,JSON[_0xf494('0x21')](_0xe9040a));_0x202940(_0xe9040a);})['catch'](function(_0x427eeb){logger[_0xf494('0x12')](_0xf494('0x17'),_0x427eeb[_0xf494('0x14')],_0x4f165b);_0x47be9c(_0x535860['error'](0x1f4,_0x427eeb['message']));});});};exports[_0xf494('0x22')]=function(_0x22ec38){var _0x3d9232=this;return new Promise(function(_0x4c7268,_0x4927ba){return db[_0xf494('0x18')]['find']({'raw':_0x22ec38['options']?_0x22ec38[_0xf494('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x22ec38[_0xf494('0x1a')]?_0x22ec38['options'][_0xf494('0x23')]||null:null,'attributes':_0x22ec38[_0xf494('0x1a')]?_0x22ec38['options'][_0xf494('0x1c')]||null:null,'include':_0x22ec38[_0xf494('0x1a')]?_0x22ec38[_0xf494('0x1a')][_0xf494('0x1e')]?_[_0xf494('0x20')](_0x22ec38[_0xf494('0x1a')][_0xf494('0x1e')],function(_0x5c5300){return{'model':db[_0x5c5300[_0xf494('0x1f')]],'as':_0x5c5300['as'],'attributes':_0x5c5300[_0xf494('0x1c')],'include':_0x5c5300['include']?_[_0xf494('0x20')](_0x5c5300[_0xf494('0x1e')],function(_0x1aa7b2){return{'model':db[_0x1aa7b2['model']],'as':_0x1aa7b2['as'],'attributes':_0x1aa7b2[_0xf494('0x1c')],'include':_0x1aa7b2[_0xf494('0x1e')]?_[_0xf494('0x20')](_0x1aa7b2[_0xf494('0x1e')],function(_0x1855f3){return{'model':db[_0x1855f3[_0xf494('0x1f')]],'as':_0x1855f3['as'],'attributes':_0x1855f3[_0xf494('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b91e9){logger['info'](_0xf494('0x22'),_0x22ec38);logger[_0xf494('0x11')](_0xf494('0x22'),_0x22ec38,JSON['stringify'](_0x5b91e9));_0x4c7268(_0x5b91e9);})['catch'](function(_0x500dcf){logger[_0xf494('0x12')](_0xf494('0x22'),_0x500dcf[_0xf494('0x14')],_0x22ec38);_0x4927ba(_0x3d9232[_0xf494('0x12')](0x1f4,_0x500dcf[_0xf494('0x14')]));});});}; \ No newline at end of file +var _0x0f58=['code','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','catch','ShowDeskAccount','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3b0265,_0x54c4b6){var _0x4d6215=function(_0x431a45){while(--_0x431a45){_0x3b0265['push'](_0x3b0265['shift']());}};_0x4d6215(++_0x54c4b6);}(_0x0f58,0x155));var _0x80f5=function(_0x109669,_0x1b4895){_0x109669=_0x109669-0x0;var _0x4dd5a7=_0x0f58[_0x109669];return _0x4dd5a7;};'use strict';var _=require(_0x80f5('0x0'));var util=require(_0x80f5('0x1'));var moment=require(_0x80f5('0x2'));var BPromise=require('bluebird');var rs=require(_0x80f5('0x3'));var fs=require('fs');var Redis=require(_0x80f5('0x4'));var db=require(_0x80f5('0x5'))['db'];var utils=require(_0x80f5('0x6'));var logger=require(_0x80f5('0x7'))('rpc');var config=require(_0x80f5('0x8'));var jayson=require(_0x80f5('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x431f06,_0xbed570,_0x563317){return new BPromise(function(_0xdef5bf,_0xef9104){return client[_0x80f5('0xa')](_0x431f06,_0x563317)[_0x80f5('0xb')](function(_0x3b97f4){logger[_0x80f5('0xc')](_0x80f5('0xd'),_0xbed570,_0x80f5('0xe'));logger[_0x80f5('0xf')](_0x80f5('0x10'),_0xbed570,'request\x20sent',JSON[_0x80f5('0x11')](_0x3b97f4));if(_0x3b97f4[_0x80f5('0x12')]){if(_0x3b97f4[_0x80f5('0x12')][_0x80f5('0x13')]===0x1f4){logger[_0x80f5('0x12')](_0x80f5('0xd'),_0xbed570,_0x3b97f4[_0x80f5('0x12')]['message']);return _0xef9104(_0x3b97f4[_0x80f5('0x12')][_0x80f5('0x14')]);}logger[_0x80f5('0x12')]('DeskAccount,\x20%s,\x20%s',_0xbed570,_0x3b97f4[_0x80f5('0x12')][_0x80f5('0x14')]);return _0xdef5bf(_0x3b97f4[_0x80f5('0x12')][_0x80f5('0x14')]);}else{logger[_0x80f5('0xc')](_0x80f5('0xd'),_0xbed570,'request\x20sent');_0xdef5bf(_0x3b97f4[_0x80f5('0x15')][_0x80f5('0x14')]);}})['catch'](function(_0x7e3c9c){logger[_0x80f5('0x12')](_0x80f5('0xd'),_0xbed570,_0x7e3c9c);_0xef9104(_0x7e3c9c);});});}exports[_0x80f5('0x16')]=function(_0xce4168){var _0xbe9812=this;return new Promise(function(_0x37e5ed,_0x72a184){return db[_0x80f5('0x17')][_0x80f5('0x18')]({'raw':_0xce4168[_0x80f5('0x19')]?_0xce4168[_0x80f5('0x19')][_0x80f5('0x1a')]===undefined?!![]:![]:!![],'where':_0xce4168[_0x80f5('0x19')]?_0xce4168['options'][_0x80f5('0x1b')]||null:null,'attributes':_0xce4168[_0x80f5('0x19')]?_0xce4168[_0x80f5('0x19')][_0x80f5('0x1c')]||null:null,'limit':_0xce4168['options']?_0xce4168[_0x80f5('0x19')][_0x80f5('0x1d')]||null:null,'include':_0xce4168[_0x80f5('0x19')]?_0xce4168[_0x80f5('0x19')][_0x80f5('0x1e')]?_[_0x80f5('0x1f')](_0xce4168[_0x80f5('0x19')]['include'],function(_0x101adc){return{'model':db[_0x101adc['model']],'as':_0x101adc['as'],'attributes':_0x101adc['attributes'],'include':_0x101adc['include']?_[_0x80f5('0x1f')](_0x101adc[_0x80f5('0x1e')],function(_0x5b5ac4){return{'model':db[_0x5b5ac4['model']],'as':_0x5b5ac4['as'],'attributes':_0x5b5ac4['attributes'],'include':_0x5b5ac4[_0x80f5('0x1e')]?_[_0x80f5('0x1f')](_0x5b5ac4['include'],function(_0x444b56){return{'model':db[_0x444b56[_0x80f5('0x20')]],'as':_0x444b56['as'],'attributes':_0x444b56['attributes']};}):[]};}):[]};}):[]:[]})[_0x80f5('0xb')](function(_0x427e9){logger[_0x80f5('0xc')](_0x80f5('0x16'),_0xce4168);logger[_0x80f5('0xf')](_0x80f5('0x16'),_0xce4168,JSON[_0x80f5('0x11')](_0x427e9));_0x37e5ed(_0x427e9);})[_0x80f5('0x21')](function(_0x5525c0){logger[_0x80f5('0x12')]('GetDeskAccount',_0x5525c0[_0x80f5('0x14')],_0xce4168);_0x72a184(_0xbe9812['error'](0x1f4,_0x5525c0[_0x80f5('0x14')]));});});};exports[_0x80f5('0x22')]=function(_0x211629){var _0x165f87=this;return new Promise(function(_0x459672,_0x1c4917){return db[_0x80f5('0x17')][_0x80f5('0x23')]({'raw':_0x211629['options']?_0x211629[_0x80f5('0x19')][_0x80f5('0x1a')]===undefined?!![]:![]:!![],'where':_0x211629['options']?_0x211629['options'][_0x80f5('0x1b')]||null:null,'attributes':_0x211629['options']?_0x211629[_0x80f5('0x19')][_0x80f5('0x1c')]||null:null,'include':_0x211629[_0x80f5('0x19')]?_0x211629['options'][_0x80f5('0x1e')]?_[_0x80f5('0x1f')](_0x211629['options']['include'],function(_0x596711){return{'model':db[_0x596711[_0x80f5('0x20')]],'as':_0x596711['as'],'attributes':_0x596711[_0x80f5('0x1c')],'include':_0x596711[_0x80f5('0x1e')]?_[_0x80f5('0x1f')](_0x596711[_0x80f5('0x1e')],function(_0x321341){return{'model':db[_0x321341[_0x80f5('0x20')]],'as':_0x321341['as'],'attributes':_0x321341[_0x80f5('0x1c')],'include':_0x321341[_0x80f5('0x1e')]?_[_0x80f5('0x1f')](_0x321341['include'],function(_0x463ecf){return{'model':db[_0x463ecf[_0x80f5('0x20')]],'as':_0x463ecf['as'],'attributes':_0x463ecf[_0x80f5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x80f5('0xb')](function(_0x3d2753){logger[_0x80f5('0xc')](_0x80f5('0x22'),_0x211629);logger[_0x80f5('0xf')]('ShowDeskAccount',_0x211629,JSON['stringify'](_0x3d2753));_0x459672(_0x3d2753);})['catch'](function(_0x64589e){logger[_0x80f5('0x12')](_0x80f5('0x22'),_0x64589e[_0x80f5('0x14')],_0x211629);_0x1c4917(_0x165f87[_0x80f5('0x12')](0x1f4,_0x64589e[_0x80f5('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index edb22bf..1ee96a6 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 _0xd046=['Router','../../config/environment','get','/:id','/:id/fields','isAuthenticated','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3877f2,_0x30cfab){var _0x4a8ffb=function(_0x37795){while(--_0x37795){_0x3877f2['push'](_0x3877f2['shift']());}};_0x4a8ffb(++_0x30cfab);}(_0xd046,0x129));var _0x6d04=function(_0x5dc798,_0x184013){_0x5dc798=_0x5dc798-0x0;var _0x1c82d7=_0xd046[_0x5dc798];return _0x1c82d7;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d04('0x4'));var controller=require('./intDeskConfiguration.controller');router[_0x6d04('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d04('0x5')](_0x6d04('0x6'),auth['isAuthenticated'](),controller['show']);router[_0x6d04('0x5')](_0x6d04('0x7'),auth['isAuthenticated'](),controller['getFields']);router[_0x6d04('0x5')]('/:id/subjects',auth[_0x6d04('0x8')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x6d04('0x8')](),controller[_0x6d04('0x9')]);router[_0x6d04('0x5')](_0x6d04('0xa'),auth['isAuthenticated'](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')]('/',auth[_0x6d04('0x8')](),controller[_0x6d04('0xd')]);router[_0x6d04('0xc')](_0x6d04('0xa'),auth[_0x6d04('0x8')](),controller[_0x6d04('0xe')]);router[_0x6d04('0xf')](_0x6d04('0x6'),auth[_0x6d04('0x8')](),controller[_0x6d04('0x10')]);router[_0x6d04('0x11')](_0x6d04('0x6'),auth[_0x6d04('0x8')](),controller[_0x6d04('0x12')]);module[_0x6d04('0x13')]=router; \ No newline at end of file +var _0xee55=['destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','setTags','put','update','delete'];(function(_0x4ba3e7,_0x2aa16d){var _0x3b6a01=function(_0x2df1b3){while(--_0x2df1b3){_0x4ba3e7['push'](_0x4ba3e7['shift']());}};_0x3b6a01(++_0x2aa16d);}(_0xee55,0x1a0));var _0x5ee5=function(_0x5959c9,_0x2ed153){_0x5959c9=_0x5959c9-0x0;var _0x4ffcbc=_0xee55[_0x5959c9];return _0x4ffcbc;};'use strict';var multer=require(_0x5ee5('0x0'));var util=require('util');var path=require(_0x5ee5('0x1'));var timeout=require('connect-timeout');var express=require(_0x5ee5('0x2'));var router=express['Router']();var auth=require(_0x5ee5('0x3'));var interaction=require(_0x5ee5('0x4'));var config=require('../../config/environment');var controller=require(_0x5ee5('0x5'));router[_0x5ee5('0x6')]('/',auth[_0x5ee5('0x7')](),controller[_0x5ee5('0x8')]);router[_0x5ee5('0x6')](_0x5ee5('0x9'),auth[_0x5ee5('0x7')](),controller['show']);router[_0x5ee5('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x5ee5('0xa')]);router['get']('/:id/subjects',auth[_0x5ee5('0x7')](),controller[_0x5ee5('0xb')]);router[_0x5ee5('0x6')](_0x5ee5('0xc'),auth['isAuthenticated'](),controller[_0x5ee5('0xd')]);router[_0x5ee5('0x6')](_0x5ee5('0xe'),auth[_0x5ee5('0x7')](),controller['getTags']);router['post']('/',auth[_0x5ee5('0x7')](),controller[_0x5ee5('0xf')]);router[_0x5ee5('0x10')]('/:id/tags',auth[_0x5ee5('0x7')](),controller[_0x5ee5('0x11')]);router[_0x5ee5('0x12')](_0x5ee5('0x9'),auth[_0x5ee5('0x7')](),controller[_0x5ee5('0x13')]);router[_0x5ee5('0x14')]('/:id',auth[_0x5ee5('0x7')](),controller[_0x5ee5('0x15')]);module[_0x5ee5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 67a1075..4263a60 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 _0xecf5=['exports','STRING','sequelize'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xecf5,0xbc));var _0x5ecf=function(_0x575588,_0x9c411d){_0x575588=_0x575588-0x0;var _0x55101c=_0xecf5[_0x575588];return _0x55101c;};'use strict';var Sequelize=require(_0x5ecf('0x0'));module[_0x5ecf('0x1')]={'name':{'type':Sequelize[_0x5ecf('0x2')]},'description':{'type':Sequelize[_0x5ecf('0x2')]}}; \ No newline at end of file +var _0xaa7d=['sequelize','exports','STRING'];(function(_0x27b2b1,_0x23466d){var _0x44640e=function(_0x4e9adc){while(--_0x4e9adc){_0x27b2b1['push'](_0x27b2b1['shift']());}};_0x44640e(++_0x23466d);}(_0xaa7d,0x162));var _0xdaa7=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xaa7d[_0x485b5a];return _0xd2b34d;};'use strict';var Sequelize=require(_0xdaa7('0x0'));module[_0xdaa7('0x1')]={'name':{'type':Sequelize[_0xdaa7('0x2')]},'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 1395983..9ad7480 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 _0x922d=['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','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','end','status','count','offset','limit','set','json','apply','save','update','stack','name','send','index','DeskConfiguration','fieldName','type','key','model','map','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','length','create','body','find','destroy','DeskField','getFields','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel'];(function(_0x524e1b,_0x39e1dc){var _0x274648=function(_0x919ef6){while(--_0x919ef6){_0x524e1b['push'](_0x524e1b['shift']());}};_0x274648(++_0x39e1dc);}(_0x922d,0xbc));var _0xd922=function(_0x1e98fc,_0x196cda){_0x1e98fc=_0x1e98fc-0x0;var _0x4c8041=_0x922d[_0x1e98fc];return _0x4c8041;};'use strict';var pdf=require(_0xd922('0x0'));var emlformat=require(_0xd922('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd922('0x2'));var moment=require(_0xd922('0x3'));var BPromise=require(_0xd922('0x4'));var Mustache=require(_0xd922('0x5'));var util=require(_0xd922('0x6'));var path=require(_0xd922('0x7'));var sox=require(_0xd922('0x8'));var csv=require('to-csv');var ejs=require(_0xd922('0x9'));var fs=require('fs');var _=require(_0xd922('0xa'));var squel=require(_0xd922('0xb'));var crypto=require(_0xd922('0xc'));var jsforce=require(_0xd922('0xd'));var deskjs=require(_0xd922('0xe'));var toCsv=require(_0xd922('0xf'));var querystring=require(_0xd922('0x10'));var Papa=require(_0xd922('0x11'));var Redis=require(_0xd922('0x12'));var authService=require(_0xd922('0x13'));var qs=require(_0xd922('0x14'));var as=require(_0xd922('0x15'));var hardwareService=require(_0xd922('0x16'));var logger=require(_0xd922('0x17'))(_0xd922('0x18'));var utils=require(_0xd922('0x19'));var config=require('../../config/environment');var db=require(_0xd922('0x1a'))['db'];var jayson=require(_0xd922('0x1b'));var client=jayson[_0xd922('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x12eaa3,_0x4c3501,_0x84a111){if(_0x84a111){var _0x45e929=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45e929['test'](_0x4c3501)){return _0x12eaa3;}else{throw new db[(_0xd922('0x1d'))][(_0xd922('0x1e'))](_0xd922('0x1f'));}}else{return _0x12eaa3;}}function respondWithRpcPromise(_0x41709e,_0x1a9b25,_0x5bffc8,_0x54a94e){return new BPromise(function(_0x11c22b,_0x24ef8e){var _0x4cbb41=_0x54a94e||client;return _0x4cbb41[_0xd922('0x20')](_0x41709e,_0x5bffc8)[_0xd922('0x21')](function(_0x50e1cd){logger[_0xd922('0x22')]('DeskConfiguration,\x20%s,\x20%s',_0x1a9b25,_0xd922('0x23'));logger[_0xd922('0x24')](_0xd922('0x25'),_0x1a9b25,_0xd922('0x23'),JSON[_0xd922('0x26')](_0x50e1cd));if(_0x50e1cd[_0xd922('0x27')]){if(_0x50e1cd[_0xd922('0x27')][_0xd922('0x28')]===0x1f4){logger[_0xd922('0x27')](_0xd922('0x29'),_0x1a9b25,_0x50e1cd[_0xd922('0x27')][_0xd922('0x2a')]);return _0x24ef8e(_0x50e1cd[_0xd922('0x27')]['message']);}logger[_0xd922('0x27')](_0xd922('0x29'),_0x1a9b25,_0x50e1cd[_0xd922('0x27')][_0xd922('0x2a')]);return _0x11c22b(_0x50e1cd['error'][_0xd922('0x2a')]);}else{logger[_0xd922('0x22')](_0xd922('0x29'),_0x1a9b25,'request\x20sent');_0x11c22b(_0x50e1cd[_0xd922('0x2b')][_0xd922('0x2a')]);}})[_0xd922('0x2c')](function(_0x2ddf8a){logger['error'](_0xd922('0x29'),_0x1a9b25,_0x2ddf8a);_0x24ef8e(_0x2ddf8a);});});}function respondWithStatusCode(_0x1d3582,_0x1bc3a2){_0x1bc3a2=_0x1bc3a2||0xcc;return function(_0x342366){if(_0x342366){return _0x1d3582['sendStatus'](_0x1bc3a2);}return _0x1d3582['status'](_0x1bc3a2)[_0xd922('0x2d')]();};}function respondWithResult(_0x3c7f9c,_0x1515b9){_0x1515b9=_0x1515b9||0xc8;return function(_0x7b73af){if(_0x7b73af){return _0x3c7f9c[_0xd922('0x2e')](_0x1515b9)['json'](_0x7b73af);}};}function respondWithFilteredResult(_0x6d8f23,_0x5536e8){return function(_0x4bb35e){if(_0x4bb35e){var _0x1e5740=_0x4bb35e[_0xd922('0x2f')],_0x167511=_0x5536e8['offset'],_0xcfd2d5=_0x5536e8[_0xd922('0x30')]+_0x5536e8[_0xd922('0x31')],_0x6d9940;if(_0xcfd2d5>=_0x1e5740){_0xcfd2d5=_0x1e5740;_0x6d9940=0xc8;}else{_0x6d9940=0xce;}_0x6d8f23[_0xd922('0x2e')](_0x6d9940);return _0x6d8f23[_0xd922('0x32')]('Content-Range',_0x167511+'-'+_0xcfd2d5+'/'+_0x1e5740)[_0xd922('0x33')](_0x4bb35e);}return null;};}function patchUpdates(_0x510113){return function(_0x57ea38){try{jsonpatch[_0xd922('0x34')](_0x57ea38,_0x510113,!![]);}catch(_0x5a1ae7){return BPromise['reject'](_0x5a1ae7);}return _0x57ea38[_0xd922('0x35')]();};}function saveUpdates(_0x43a12a,_0x194d88){return function(_0x2222e6){if(_0x2222e6){return _0x2222e6[_0xd922('0x36')](_0x43a12a)[_0xd922('0x21')](function(_0x3c9e25){return _0x3c9e25;});}return null;};}function removeEntity(_0x2b6202,_0x516827){return function(_0x456aa0){if(_0x456aa0){return _0x456aa0['destroy']()['then'](function(){_0x2b6202['status'](0xcc)[_0xd922('0x2d')]();});}};}function handleEntityNotFound(_0x186933,_0x478eea){return function(_0x3abf84){if(!_0x3abf84){_0x186933['sendStatus'](0x194);}return _0x3abf84;};}function handleError(_0x499d18,_0x575434){_0x575434=_0x575434||0x1f4;return function(_0x4ebd66){logger[_0xd922('0x27')](_0x4ebd66[_0xd922('0x37')]);if(_0x4ebd66[_0xd922('0x38')]){delete _0x4ebd66[_0xd922('0x38')];}_0x499d18['status'](_0x575434)[_0xd922('0x39')](_0x4ebd66);};}exports[_0xd922('0x3a')]=function(_0x205057,_0x569491){var _0x1ad483={},_0x2661af={},_0x221580={'count':0x0,'rows':[]};var _0x41fd99=_['map'](db[_0xd922('0x3b')]['rawAttributes'],function(_0x1c2b2a){return{'name':_0x1c2b2a[_0xd922('0x3c')],'type':_0x1c2b2a[_0xd922('0x3d')][_0xd922('0x3e')]};});_0x2661af[_0xd922('0x3f')]=_[_0xd922('0x40')](_0x41fd99,_0xd922('0x38'));_0x2661af[_0xd922('0x41')]=_[_0xd922('0x42')](_0x205057[_0xd922('0x41')]);_0x2661af[_0xd922('0x43')]=_['intersection'](_0x2661af['model'],_0x2661af[_0xd922('0x41')]);_0x1ad483['attributes']=_['intersection'](_0x2661af[_0xd922('0x3f')],qs[_0xd922('0x44')](_0x205057[_0xd922('0x41')]['fields']));_0x1ad483[_0xd922('0x45')]=_0x1ad483['attributes']['length']?_0x1ad483[_0xd922('0x45')]:_0x2661af[_0xd922('0x3f')];if(!_0x205057[_0xd922('0x41')][_0xd922('0x46')](_0xd922('0x47'))){_0x1ad483[_0xd922('0x31')]=qs[_0xd922('0x31')](_0x205057['query']['limit']);_0x1ad483[_0xd922('0x30')]=qs[_0xd922('0x30')](_0x205057[_0xd922('0x41')][_0xd922('0x30')]);}_0x1ad483[_0xd922('0x48')]=qs[_0xd922('0x49')](_0x205057['query']['sort']);_0x1ad483[_0xd922('0x4a')]=qs[_0xd922('0x43')](_[_0xd922('0x4b')](_0x205057[_0xd922('0x41')],_0x2661af[_0xd922('0x43')]));if(_0x205057[_0xd922('0x41')][_0xd922('0x4c')]){_0x1ad483[_0xd922('0x4a')]=_[_0xd922('0x4d')](_0x1ad483[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x41fd99,function(_0x3555bd){if(_0x3555bd[_0xd922('0x3d')]!==_0xd922('0x4e')){var _0x2e423c={};_0x2e423c[_0x3555bd[_0xd922('0x38')]]={'$like':'%'+_0x205057[_0xd922('0x41')][_0xd922('0x4c')]+'%'};return _0x2e423c;}})});}_0x1ad483=_[_0xd922('0x4d')]({},_0x1ad483,_0x205057[_0xd922('0x4f')]);var _0x56562a={'where':_0x1ad483[_0xd922('0x4a')]};return db[_0xd922('0x3b')][_0xd922('0x2f')](_0x56562a)[_0xd922('0x21')](function(_0x9f1249){_0x221580[_0xd922('0x2f')]=_0x9f1249;if(_0x205057[_0xd922('0x41')][_0xd922('0x50')]){_0x1ad483[_0xd922('0x51')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xd922('0x52')](_0x1ad483);})['then'](function(_0x421b2e){_0x221580[_0xd922('0x53')]=_0x421b2e;return _0x221580;})[_0xd922('0x21')](respondWithFilteredResult(_0x569491,_0x1ad483))[_0xd922('0x2c')](handleError(_0x569491,null));};exports['show']=function(_0x1c0501,_0x5acd72){var _0xae2541={'raw':![],'where':{'id':_0x1c0501[_0xd922('0x54')]['id']}},_0x1bda74={};_0x1bda74['model']=_[_0xd922('0x42')](db['DeskConfiguration'][_0xd922('0x55')]);_0x1bda74[_0xd922('0x41')]=_['keys'](_0x1c0501['query']);_0x1bda74[_0xd922('0x43')]=_['intersection'](_0x1bda74[_0xd922('0x3f')],_0x1bda74[_0xd922('0x41')]);_0xae2541[_0xd922('0x45')]=_[_0xd922('0x56')](_0x1bda74[_0xd922('0x3f')],qs[_0xd922('0x44')](_0x1c0501[_0xd922('0x41')][_0xd922('0x44')]));_0xae2541[_0xd922('0x45')]=_0xae2541[_0xd922('0x45')][_0xd922('0x57')]?_0xae2541['attributes']:_0x1bda74[_0xd922('0x3f')];if(_0x1c0501[_0xd922('0x41')]['includeAll']){_0xae2541['include']=[{'all':!![]}];}_0xae2541=_[_0xd922('0x4d')]({},_0xae2541,_0x1c0501[_0xd922('0x4f')]);return db[_0xd922('0x3b')]['find'](_0xae2541)['then'](handleEntityNotFound(_0x5acd72,null))[_0xd922('0x21')](respondWithResult(_0x5acd72,null))['catch'](handleError(_0x5acd72,null));};exports[_0xd922('0x58')]=function(_0xb9db1,_0x4c37f7){return db[_0xd922('0x3b')][_0xd922('0x58')](_0xb9db1[_0xd922('0x59')],{})[_0xd922('0x21')](respondWithResult(_0x4c37f7,0xc9))[_0xd922('0x2c')](handleError(_0x4c37f7,null));};exports[_0xd922('0x36')]=function(_0x36fee2,_0x20bd9e){if(_0x36fee2['body']['id']){delete _0x36fee2['body']['id'];}return db[_0xd922('0x3b')][_0xd922('0x5a')]({'where':{'id':_0x36fee2[_0xd922('0x54')]['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x20bd9e,null))['then'](saveUpdates(_0x36fee2[_0xd922('0x59')],null))[_0xd922('0x21')](respondWithResult(_0x20bd9e,null))[_0xd922('0x2c')](handleError(_0x20bd9e,null));};exports[_0xd922('0x5b')]=function(_0x18ef36,_0xb0e22){return db[_0xd922('0x3b')][_0xd922('0x5a')]({'where':{'id':_0x18ef36['params']['id']}})[_0xd922('0x21')](handleEntityNotFound(_0xb0e22,null))['then'](removeEntity(_0xb0e22,null))[_0xd922('0x2c')](handleError(_0xb0e22,null));};exports['getFields']=function(_0x4d4932,_0x418ec8,_0x3852b6){var _0x444398={};var _0x173662={};var _0x2b4b66;var _0x11c749;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4d4932['params']['id']}})['then'](handleEntityNotFound(_0x418ec8,null))[_0xd922('0x21')](function(_0x1ca6fe){if(_0x1ca6fe){_0x2b4b66=_0x1ca6fe;_0x173662[_0xd922('0x3f')]=_[_0xd922('0x42')](db[_0xd922('0x5c')][_0xd922('0x55')]);_0x173662[_0xd922('0x41')]=_[_0xd922('0x42')](_0x4d4932[_0xd922('0x41')]);_0x173662[_0xd922('0x43')]=_[_0xd922('0x56')](_0x173662[_0xd922('0x3f')],_0x173662[_0xd922('0x41')]);_0x444398[_0xd922('0x45')]=_[_0xd922('0x56')](_0x173662['model'],qs[_0xd922('0x44')](_0x4d4932[_0xd922('0x41')]['fields']));_0x444398[_0xd922('0x45')]=_0x444398['attributes']['length']?_0x444398[_0xd922('0x45')]:_0x173662[_0xd922('0x3f')];_0x444398['order']=qs[_0xd922('0x49')](_0x4d4932[_0xd922('0x41')]['sort']);_0x444398['where']=qs[_0xd922('0x43')](_['pick'](_0x4d4932[_0xd922('0x41')],_0x173662[_0xd922('0x43')]));if(_0x4d4932[_0xd922('0x41')]['filter']){_0x444398[_0xd922('0x4a')]=_[_0xd922('0x4d')](_0x444398[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x444398[_0xd922('0x45')],function(_0x137ad0){var _0x31e7d8={};_0x31e7d8[_0x137ad0]={'$like':'%'+_0x4d4932['query']['filter']+'%'};return _0x31e7d8;})});}_0x444398=_[_0xd922('0x4d')]({},_0x444398,_0x4d4932[_0xd922('0x4f')]);return _0x2b4b66[_0xd922('0x5d')](_0x444398);}})[_0xd922('0x21')](function(_0x392ac8){if(_0x392ac8){_0x11c749=_0x392ac8[_0xd922('0x57')];if(!_0x4d4932['query'][_0xd922('0x46')]('nolimit')){_0x444398[_0xd922('0x31')]=qs[_0xd922('0x31')](_0x4d4932[_0xd922('0x41')][_0xd922('0x31')]);_0x444398[_0xd922('0x30')]=qs[_0xd922('0x30')](_0x4d4932[_0xd922('0x41')][_0xd922('0x30')]);}return _0x2b4b66[_0xd922('0x5d')](_0x444398);}})[_0xd922('0x21')](function(_0x41df78){if(_0x41df78){return _0x41df78?{'count':_0x11c749,'rows':_0x41df78}:null;}})[_0xd922('0x21')](respondWithResult(_0x418ec8,null))[_0xd922('0x2c')](handleError(_0x418ec8,null));};exports[_0xd922('0x5e')]=function(_0x34093c,_0x354666,_0x55e70d){var _0x2d752f={};var _0x214aed={};var _0x410b11;var _0x4699c0;return db['DeskConfiguration'][_0xd922('0x5f')]({'where':{'id':_0x34093c['params']['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x354666,null))[_0xd922('0x21')](function(_0x1443b6){if(_0x1443b6){_0x410b11=_0x1443b6;_0x214aed[_0xd922('0x3f')]=_[_0xd922('0x42')](db[_0xd922('0x5c')][_0xd922('0x55')]);_0x214aed[_0xd922('0x41')]=_[_0xd922('0x42')](_0x34093c[_0xd922('0x41')]);_0x214aed[_0xd922('0x43')]=_['intersection'](_0x214aed[_0xd922('0x3f')],_0x214aed['query']);_0x2d752f[_0xd922('0x45')]=_['intersection'](_0x214aed[_0xd922('0x3f')],qs[_0xd922('0x44')](_0x34093c['query']['fields']));_0x2d752f[_0xd922('0x45')]=_0x2d752f[_0xd922('0x45')][_0xd922('0x57')]?_0x2d752f['attributes']:_0x214aed[_0xd922('0x3f')];_0x2d752f[_0xd922('0x48')]=qs[_0xd922('0x49')](_0x34093c['query'][_0xd922('0x49')]);_0x2d752f['where']=qs['filters'](_['pick'](_0x34093c[_0xd922('0x41')],_0x214aed['filters']));if(_0x34093c[_0xd922('0x41')][_0xd922('0x4c')]){_0x2d752f['where']=_[_0xd922('0x4d')](_0x2d752f[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x2d752f[_0xd922('0x45')],function(_0x155b12){var _0x1f6a0f={};_0x1f6a0f[_0x155b12]={'$like':'%'+_0x34093c[_0xd922('0x41')][_0xd922('0x4c')]+'%'};return _0x1f6a0f;})});}_0x2d752f=_[_0xd922('0x4d')]({},_0x2d752f,_0x34093c['options']);return _0x410b11[_0xd922('0x5e')](_0x2d752f);}})[_0xd922('0x21')](function(_0xf12a6b){if(_0xf12a6b){_0x4699c0=_0xf12a6b['length'];if(!_0x34093c[_0xd922('0x41')][_0xd922('0x46')](_0xd922('0x47'))){_0x2d752f[_0xd922('0x31')]=qs['limit'](_0x34093c['query'][_0xd922('0x31')]);_0x2d752f['offset']=qs['offset'](_0x34093c[_0xd922('0x41')][_0xd922('0x30')]);}return _0x410b11[_0xd922('0x5e')](_0x2d752f);}})[_0xd922('0x21')](function(_0xf3f6d0){if(_0xf3f6d0){return _0xf3f6d0?{'count':_0x4699c0,'rows':_0xf3f6d0}:null;}})[_0xd922('0x21')](respondWithResult(_0x354666,null))[_0xd922('0x2c')](handleError(_0x354666,null));};exports[_0xd922('0x60')]=function(_0xecb077,_0x320ed4,_0x37cdfa){var _0x43acfe={};var _0x557117={};var _0x2fdb53;var _0x2a03f5;return db[_0xd922('0x3b')][_0xd922('0x5f')]({'where':{'id':_0xecb077[_0xd922('0x54')]['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x320ed4,null))[_0xd922('0x21')](function(_0x134351){if(_0x134351){_0x2fdb53=_0x134351;_0x557117[_0xd922('0x3f')]=_[_0xd922('0x42')](db['DeskField'][_0xd922('0x55')]);_0x557117[_0xd922('0x41')]=_[_0xd922('0x42')](_0xecb077[_0xd922('0x41')]);_0x557117['filters']=_[_0xd922('0x56')](_0x557117[_0xd922('0x3f')],_0x557117[_0xd922('0x41')]);_0x43acfe[_0xd922('0x45')]=_['intersection'](_0x557117[_0xd922('0x3f')],qs['fields'](_0xecb077[_0xd922('0x41')][_0xd922('0x44')]));_0x43acfe[_0xd922('0x45')]=_0x43acfe[_0xd922('0x45')][_0xd922('0x57')]?_0x43acfe['attributes']:_0x557117['model'];_0x43acfe[_0xd922('0x48')]=qs[_0xd922('0x49')](_0xecb077[_0xd922('0x41')][_0xd922('0x49')]);_0x43acfe[_0xd922('0x4a')]=qs[_0xd922('0x43')](_[_0xd922('0x4b')](_0xecb077[_0xd922('0x41')],_0x557117[_0xd922('0x43')]));if(_0xecb077['query'][_0xd922('0x4c')]){_0x43acfe[_0xd922('0x4a')]=_[_0xd922('0x4d')](_0x43acfe[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x43acfe[_0xd922('0x45')],function(_0xee6b11){var _0x1bcf67={};_0x1bcf67[_0xee6b11]={'$like':'%'+_0xecb077[_0xd922('0x41')]['filter']+'%'};return _0x1bcf67;})});}_0x43acfe=_[_0xd922('0x4d')]({},_0x43acfe,_0xecb077[_0xd922('0x4f')]);return _0x2fdb53[_0xd922('0x60')](_0x43acfe);}})[_0xd922('0x21')](function(_0x2e6c6d){if(_0x2e6c6d){_0x2a03f5=_0x2e6c6d[_0xd922('0x57')];if(!_0xecb077[_0xd922('0x41')][_0xd922('0x46')](_0xd922('0x47'))){_0x43acfe[_0xd922('0x31')]=qs[_0xd922('0x31')](_0xecb077['query'][_0xd922('0x31')]);_0x43acfe['offset']=qs[_0xd922('0x30')](_0xecb077['query']['offset']);}return _0x2fdb53[_0xd922('0x60')](_0x43acfe);}})[_0xd922('0x21')](function(_0x15627b){if(_0x15627b){return _0x15627b?{'count':_0x2a03f5,'rows':_0x15627b}:null;}})[_0xd922('0x21')](respondWithResult(_0x320ed4,null))[_0xd922('0x2c')](handleError(_0x320ed4,null));};exports[_0xd922('0x61')]=function(_0x17a9ee,_0x2c4b74,_0x385f87){var _0x5e54d3={};var _0x51cbe5={};var _0x2fd6f7;var _0xb4e0d8;return db[_0xd922('0x3b')][_0xd922('0x5f')]({'where':{'id':_0x17a9ee[_0xd922('0x54')]['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x2c4b74,null))[_0xd922('0x21')](function(_0x51af8d){if(_0x51af8d){_0x2fd6f7=_0x51af8d;_0x51cbe5['model']=_[_0xd922('0x42')](db[_0xd922('0x62')][_0xd922('0x55')]);_0x51cbe5[_0xd922('0x41')]=_[_0xd922('0x42')](_0x17a9ee[_0xd922('0x41')]);_0x51cbe5[_0xd922('0x43')]=_['intersection'](_0x51cbe5['model'],_0x51cbe5[_0xd922('0x41')]);_0x5e54d3[_0xd922('0x45')]=_[_0xd922('0x56')](_0x51cbe5[_0xd922('0x3f')],qs['fields'](_0x17a9ee[_0xd922('0x41')][_0xd922('0x44')]));_0x5e54d3[_0xd922('0x45')]=_0x5e54d3[_0xd922('0x45')][_0xd922('0x57')]?_0x5e54d3['attributes']:_0x51cbe5[_0xd922('0x3f')];_0x5e54d3[_0xd922('0x48')]=qs[_0xd922('0x49')](_0x17a9ee['query'][_0xd922('0x49')]);_0x5e54d3['where']=qs[_0xd922('0x43')](_[_0xd922('0x4b')](_0x17a9ee[_0xd922('0x41')],_0x51cbe5[_0xd922('0x43')]));if(_0x17a9ee[_0xd922('0x41')][_0xd922('0x4c')]){_0x5e54d3[_0xd922('0x4a')]=_['merge'](_0x5e54d3[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x5e54d3[_0xd922('0x45')],function(_0x2f6976){var _0x3187d3={};_0x3187d3[_0x2f6976]={'$like':'%'+_0x17a9ee[_0xd922('0x41')]['filter']+'%'};return _0x3187d3;})});}_0x5e54d3=_[_0xd922('0x4d')]({},_0x5e54d3,_0x17a9ee[_0xd922('0x4f')]);return _0x2fd6f7[_0xd922('0x61')](_0x5e54d3);}})[_0xd922('0x21')](function(_0x5e760b){if(_0x5e760b){_0xb4e0d8=_0x5e760b[_0xd922('0x57')];if(!_0x17a9ee[_0xd922('0x41')]['hasOwnProperty'](_0xd922('0x47'))){_0x5e54d3['limit']=qs[_0xd922('0x31')](_0x17a9ee[_0xd922('0x41')]['limit']);_0x5e54d3[_0xd922('0x30')]=qs[_0xd922('0x30')](_0x17a9ee[_0xd922('0x41')][_0xd922('0x30')]);}return _0x2fd6f7[_0xd922('0x61')](_0x5e54d3);}})[_0xd922('0x21')](function(_0x58f7c4){if(_0x58f7c4){return _0x58f7c4?{'count':_0xb4e0d8,'rows':_0x58f7c4}:null;}})[_0xd922('0x21')](respondWithResult(_0x2c4b74,null))[_0xd922('0x2c')](handleError(_0x2c4b74,null));};exports[_0xd922('0x63')]=function(_0x4e1c18,_0x4420d9,_0x47098e){if(_0x4e1c18[_0xd922('0x59')]['id']){delete _0x4e1c18[_0xd922('0x59')]['id'];}return db[_0xd922('0x3b')][_0xd922('0x5f')]({'where':{'id':_0x4e1c18[_0xd922('0x54')]['id']}})['then'](handleEntityNotFound(_0x4420d9,null))[_0xd922('0x21')](function(_0x95c774){if(_0x95c774){return _0x95c774['setTags'](_0x4e1c18['body']['ids']||[]);}return null;})[_0xd922('0x21')](respondWithResult(_0x4420d9,null))[_0xd922('0x2c')](handleError(_0x4420d9,null));}; \ No newline at end of file +var _0xc0d1=['destroy','findOne','DeskField','order','pick','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','client','http','test','Sequelize','ValidationError','request','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','then','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','DeskConfiguration','includeAll','findAll','rows','params','include','options','find','create','body','update'];(function(_0x4e1c16,_0x10f706){var _0x3879ad=function(_0x300c4f){while(--_0x300c4f){_0x4e1c16['push'](_0x4e1c16['shift']());}};_0x3879ad(++_0x10f706);}(_0xc0d1,0x122));var _0x1c0d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xc0d1[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0x1c0d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c0d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1c0d('0x2'));var rp=require(_0x1c0d('0x3'));var moment=require('moment');var BPromise=require(_0x1c0d('0x4'));var Mustache=require(_0x1c0d('0x5'));var util=require(_0x1c0d('0x6'));var path=require(_0x1c0d('0x7'));var sox=require('sox');var csv=require(_0x1c0d('0x8'));var ejs=require(_0x1c0d('0x9'));var fs=require('fs');var _=require(_0x1c0d('0xa'));var squel=require(_0x1c0d('0xb'));var crypto=require('crypto');var jsforce=require(_0x1c0d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1c0d('0x8'));var querystring=require(_0x1c0d('0xd'));var Papa=require(_0x1c0d('0xe'));var Redis=require('ioredis');var authService=require(_0x1c0d('0xf'));var qs=require(_0x1c0d('0x10'));var as=require(_0x1c0d('0x11'));var hardwareService=require(_0x1c0d('0x12'));var logger=require(_0x1c0d('0x13'))(_0x1c0d('0x14'));var utils=require(_0x1c0d('0x15'));var config=require(_0x1c0d('0x16'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x1c0d('0x17')][_0x1c0d('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3ed1e5,_0x473f00,_0x297819){if(_0x297819){var _0x584fe2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x584fe2[_0x1c0d('0x19')](_0x473f00)){return _0x3ed1e5;}else{throw new db[(_0x1c0d('0x1a'))][(_0x1c0d('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3ed1e5;}}function respondWithRpcPromise(_0x289b37,_0x446d39,_0x5a9b52,_0x54c486){return new BPromise(function(_0x4e6a62,_0x2485ae){var _0x15eeb2=_0x54c486||client;return _0x15eeb2[_0x1c0d('0x1c')](_0x289b37,_0x5a9b52)['then'](function(_0x1fd94d){logger['info'](_0x1c0d('0x1d'),_0x446d39,_0x1c0d('0x1e'));logger['debug'](_0x1c0d('0x1f'),_0x446d39,_0x1c0d('0x1e'),JSON['stringify'](_0x1fd94d));if(_0x1fd94d[_0x1c0d('0x20')]){if(_0x1fd94d[_0x1c0d('0x20')][_0x1c0d('0x21')]===0x1f4){logger[_0x1c0d('0x20')](_0x1c0d('0x1d'),_0x446d39,_0x1fd94d[_0x1c0d('0x20')][_0x1c0d('0x22')]);return _0x2485ae(_0x1fd94d[_0x1c0d('0x20')][_0x1c0d('0x22')]);}logger[_0x1c0d('0x20')](_0x1c0d('0x1d'),_0x446d39,_0x1fd94d[_0x1c0d('0x20')][_0x1c0d('0x22')]);return _0x4e6a62(_0x1fd94d[_0x1c0d('0x20')]['message']);}else{logger[_0x1c0d('0x23')](_0x1c0d('0x1d'),_0x446d39,_0x1c0d('0x1e'));_0x4e6a62(_0x1fd94d[_0x1c0d('0x24')][_0x1c0d('0x22')]);}})[_0x1c0d('0x25')](function(_0x18c33d){logger[_0x1c0d('0x20')]('DeskConfiguration,\x20%s,\x20%s',_0x446d39,_0x18c33d);_0x2485ae(_0x18c33d);});});}function respondWithStatusCode(_0x86144d,_0x20e956){_0x20e956=_0x20e956||0xcc;return function(_0xe23719){if(_0xe23719){return _0x86144d[_0x1c0d('0x26')](_0x20e956);}return _0x86144d['status'](_0x20e956)[_0x1c0d('0x27')]();};}function respondWithResult(_0x27d278,_0x41aa73){_0x41aa73=_0x41aa73||0xc8;return function(_0x5d55d8){if(_0x5d55d8){return _0x27d278[_0x1c0d('0x28')](_0x41aa73)[_0x1c0d('0x29')](_0x5d55d8);}};}function respondWithFilteredResult(_0x10fd3c,_0xc35613){return function(_0x5c71a7){if(_0x5c71a7){var _0x2af244=_0x5c71a7[_0x1c0d('0x2a')],_0x2adca4=_0xc35613[_0x1c0d('0x2b')],_0x43333=_0xc35613[_0x1c0d('0x2b')]+_0xc35613[_0x1c0d('0x2c')],_0x2c0afb;if(_0x43333>=_0x2af244){_0x43333=_0x2af244;_0x2c0afb=0xc8;}else{_0x2c0afb=0xce;}_0x10fd3c['status'](_0x2c0afb);return _0x10fd3c['set'](_0x1c0d('0x2d'),_0x2adca4+'-'+_0x43333+'/'+_0x2af244)[_0x1c0d('0x29')](_0x5c71a7);}return null;};}function patchUpdates(_0x5e3af4){return function(_0x2f0cc1){try{jsonpatch['apply'](_0x2f0cc1,_0x5e3af4,!![]);}catch(_0x27adfb){return BPromise[_0x1c0d('0x2e')](_0x27adfb);}return _0x2f0cc1['save']();};}function saveUpdates(_0x1c40e9,_0x3fde4e){return function(_0x359489){if(_0x359489){return _0x359489['update'](_0x1c40e9)['then'](function(_0x46f76e){return _0x46f76e;});}return null;};}function removeEntity(_0xfa7737,_0x24907d){return function(_0x35fe3b){if(_0x35fe3b){return _0x35fe3b['destroy']()[_0x1c0d('0x2f')](function(){_0xfa7737[_0x1c0d('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8456,_0x532bc7){return function(_0x212761){if(!_0x212761){_0x5c8456[_0x1c0d('0x26')](0x194);}return _0x212761;};}function handleError(_0x133e8a,_0x4cb482){_0x4cb482=_0x4cb482||0x1f4;return function(_0x1044d4){logger['error'](_0x1044d4[_0x1c0d('0x30')]);if(_0x1044d4['name']){delete _0x1044d4[_0x1c0d('0x31')];}_0x133e8a[_0x1c0d('0x28')](_0x4cb482)[_0x1c0d('0x32')](_0x1044d4);};}exports[_0x1c0d('0x33')]=function(_0x3ffede,_0x5d545c){var _0x8d69e1={},_0x2e6102={},_0x2ae187={'count':0x0,'rows':[]};var _0x4459f9=_[_0x1c0d('0x34')](db['DeskConfiguration'][_0x1c0d('0x35')],function(_0x70bfc0){return{'name':_0x70bfc0['fieldName'],'type':_0x70bfc0[_0x1c0d('0x36')][_0x1c0d('0x37')]};});_0x2e6102[_0x1c0d('0x38')]=_[_0x1c0d('0x34')](_0x4459f9,'name');_0x2e6102[_0x1c0d('0x39')]=_[_0x1c0d('0x3a')](_0x3ffede[_0x1c0d('0x39')]);_0x2e6102[_0x1c0d('0x3b')]=_[_0x1c0d('0x3c')](_0x2e6102[_0x1c0d('0x38')],_0x2e6102[_0x1c0d('0x39')]);_0x8d69e1[_0x1c0d('0x3d')]=_['intersection'](_0x2e6102['model'],qs[_0x1c0d('0x3e')](_0x3ffede[_0x1c0d('0x39')][_0x1c0d('0x3e')]));_0x8d69e1['attributes']=_0x8d69e1[_0x1c0d('0x3d')][_0x1c0d('0x3f')]?_0x8d69e1['attributes']:_0x2e6102[_0x1c0d('0x38')];if(!_0x3ffede[_0x1c0d('0x39')][_0x1c0d('0x40')](_0x1c0d('0x41'))){_0x8d69e1[_0x1c0d('0x2c')]=qs[_0x1c0d('0x2c')](_0x3ffede[_0x1c0d('0x39')]['limit']);_0x8d69e1['offset']=qs[_0x1c0d('0x2b')](_0x3ffede[_0x1c0d('0x39')][_0x1c0d('0x2b')]);}_0x8d69e1['order']=qs['sort'](_0x3ffede['query'][_0x1c0d('0x42')]);_0x8d69e1[_0x1c0d('0x43')]=qs[_0x1c0d('0x3b')](_['pick'](_0x3ffede[_0x1c0d('0x39')],_0x2e6102['filters']));if(_0x3ffede[_0x1c0d('0x39')][_0x1c0d('0x44')]){_0x8d69e1[_0x1c0d('0x43')]=_[_0x1c0d('0x45')](_0x8d69e1[_0x1c0d('0x43')],{'$or':_[_0x1c0d('0x34')](_0x4459f9,function(_0x35e210){if(_0x35e210[_0x1c0d('0x36')]!==_0x1c0d('0x46')){var _0x1943bd={};_0x1943bd[_0x35e210[_0x1c0d('0x31')]]={'$like':'%'+_0x3ffede[_0x1c0d('0x39')][_0x1c0d('0x44')]+'%'};return _0x1943bd;}})});}_0x8d69e1=_['merge']({},_0x8d69e1,_0x3ffede['options']);var _0x5c1322={'where':_0x8d69e1[_0x1c0d('0x43')]};return db[_0x1c0d('0x47')][_0x1c0d('0x2a')](_0x5c1322)[_0x1c0d('0x2f')](function(_0x4513e7){_0x2ae187[_0x1c0d('0x2a')]=_0x4513e7;if(_0x3ffede[_0x1c0d('0x39')][_0x1c0d('0x48')]){_0x8d69e1['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x1c0d('0x49')](_0x8d69e1);})[_0x1c0d('0x2f')](function(_0x11898d){_0x2ae187[_0x1c0d('0x4a')]=_0x11898d;return _0x2ae187;})[_0x1c0d('0x2f')](respondWithFilteredResult(_0x5d545c,_0x8d69e1))['catch'](handleError(_0x5d545c,null));};exports['show']=function(_0x433c92,_0x4be6ce){var _0x486115={'raw':![],'where':{'id':_0x433c92[_0x1c0d('0x4b')]['id']}},_0x923945={};_0x923945['model']=_['keys'](db['DeskConfiguration'][_0x1c0d('0x35')]);_0x923945[_0x1c0d('0x39')]=_[_0x1c0d('0x3a')](_0x433c92[_0x1c0d('0x39')]);_0x923945[_0x1c0d('0x3b')]=_[_0x1c0d('0x3c')](_0x923945['model'],_0x923945['query']);_0x486115['attributes']=_[_0x1c0d('0x3c')](_0x923945['model'],qs[_0x1c0d('0x3e')](_0x433c92[_0x1c0d('0x39')][_0x1c0d('0x3e')]));_0x486115['attributes']=_0x486115[_0x1c0d('0x3d')][_0x1c0d('0x3f')]?_0x486115[_0x1c0d('0x3d')]:_0x923945[_0x1c0d('0x38')];if(_0x433c92['query']['includeAll']){_0x486115[_0x1c0d('0x4c')]=[{'all':!![]}];}_0x486115=_[_0x1c0d('0x45')]({},_0x486115,_0x433c92[_0x1c0d('0x4d')]);return db[_0x1c0d('0x47')][_0x1c0d('0x4e')](_0x486115)[_0x1c0d('0x2f')](handleEntityNotFound(_0x4be6ce,null))[_0x1c0d('0x2f')](respondWithResult(_0x4be6ce,null))[_0x1c0d('0x25')](handleError(_0x4be6ce,null));};exports['create']=function(_0x4fc2b7,_0x42d2b0){return db[_0x1c0d('0x47')][_0x1c0d('0x4f')](_0x4fc2b7[_0x1c0d('0x50')],{})[_0x1c0d('0x2f')](respondWithResult(_0x42d2b0,0xc9))[_0x1c0d('0x25')](handleError(_0x42d2b0,null));};exports[_0x1c0d('0x51')]=function(_0x41cac2,_0xd4d96f){if(_0x41cac2['body']['id']){delete _0x41cac2[_0x1c0d('0x50')]['id'];}return db[_0x1c0d('0x47')][_0x1c0d('0x4e')]({'where':{'id':_0x41cac2[_0x1c0d('0x4b')]['id']}})['then'](handleEntityNotFound(_0xd4d96f,null))[_0x1c0d('0x2f')](saveUpdates(_0x41cac2[_0x1c0d('0x50')],null))[_0x1c0d('0x2f')](respondWithResult(_0xd4d96f,null))[_0x1c0d('0x25')](handleError(_0xd4d96f,null));};exports[_0x1c0d('0x52')]=function(_0x2ddf9e,_0x1c72de){return db[_0x1c0d('0x47')]['find']({'where':{'id':_0x2ddf9e[_0x1c0d('0x4b')]['id']}})[_0x1c0d('0x2f')](handleEntityNotFound(_0x1c72de,null))[_0x1c0d('0x2f')](removeEntity(_0x1c72de,null))[_0x1c0d('0x25')](handleError(_0x1c72de,null));};exports['getFields']=function(_0x3b8161,_0x86de26,_0x130a0b){var _0x4defe6={};var _0x3def1b={};var _0x5a020d;var _0x1ad8b4;return db[_0x1c0d('0x47')][_0x1c0d('0x53')]({'where':{'id':_0x3b8161[_0x1c0d('0x4b')]['id']}})[_0x1c0d('0x2f')](handleEntityNotFound(_0x86de26,null))['then'](function(_0x65e80e){if(_0x65e80e){_0x5a020d=_0x65e80e;_0x3def1b[_0x1c0d('0x38')]=_['keys'](db[_0x1c0d('0x54')][_0x1c0d('0x35')]);_0x3def1b[_0x1c0d('0x39')]=_[_0x1c0d('0x3a')](_0x3b8161['query']);_0x3def1b[_0x1c0d('0x3b')]=_[_0x1c0d('0x3c')](_0x3def1b[_0x1c0d('0x38')],_0x3def1b[_0x1c0d('0x39')]);_0x4defe6['attributes']=_[_0x1c0d('0x3c')](_0x3def1b[_0x1c0d('0x38')],qs[_0x1c0d('0x3e')](_0x3b8161[_0x1c0d('0x39')]['fields']));_0x4defe6['attributes']=_0x4defe6[_0x1c0d('0x3d')][_0x1c0d('0x3f')]?_0x4defe6[_0x1c0d('0x3d')]:_0x3def1b['model'];_0x4defe6[_0x1c0d('0x55')]=qs[_0x1c0d('0x42')](_0x3b8161['query'][_0x1c0d('0x42')]);_0x4defe6[_0x1c0d('0x43')]=qs[_0x1c0d('0x3b')](_[_0x1c0d('0x56')](_0x3b8161[_0x1c0d('0x39')],_0x3def1b['filters']));if(_0x3b8161[_0x1c0d('0x39')]['filter']){_0x4defe6['where']=_[_0x1c0d('0x45')](_0x4defe6['where'],{'$or':_[_0x1c0d('0x34')](_0x4defe6['attributes'],function(_0x6b7484){var _0x33bbe2={};_0x33bbe2[_0x6b7484]={'$like':'%'+_0x3b8161[_0x1c0d('0x39')][_0x1c0d('0x44')]+'%'};return _0x33bbe2;})});}_0x4defe6=_[_0x1c0d('0x45')]({},_0x4defe6,_0x3b8161[_0x1c0d('0x4d')]);return _0x5a020d['getFields'](_0x4defe6);}})[_0x1c0d('0x2f')](function(_0x1bdc28){if(_0x1bdc28){_0x1ad8b4=_0x1bdc28['length'];if(!_0x3b8161['query'][_0x1c0d('0x40')](_0x1c0d('0x41'))){_0x4defe6[_0x1c0d('0x2c')]=qs[_0x1c0d('0x2c')](_0x3b8161[_0x1c0d('0x39')][_0x1c0d('0x2c')]);_0x4defe6[_0x1c0d('0x2b')]=qs[_0x1c0d('0x2b')](_0x3b8161[_0x1c0d('0x39')][_0x1c0d('0x2b')]);}return _0x5a020d[_0x1c0d('0x57')](_0x4defe6);}})[_0x1c0d('0x2f')](function(_0xe7f79c){if(_0xe7f79c){return _0xe7f79c?{'count':_0x1ad8b4,'rows':_0xe7f79c}:null;}})[_0x1c0d('0x2f')](respondWithResult(_0x86de26,null))[_0x1c0d('0x25')](handleError(_0x86de26,null));};exports[_0x1c0d('0x58')]=function(_0x250790,_0x2951e3,_0x30a120){var _0x1b86cd={};var _0xa1c8ac={};var _0x245c30;var _0x3392c6;return db[_0x1c0d('0x47')][_0x1c0d('0x53')]({'where':{'id':_0x250790[_0x1c0d('0x4b')]['id']}})[_0x1c0d('0x2f')](handleEntityNotFound(_0x2951e3,null))[_0x1c0d('0x2f')](function(_0x27565e){if(_0x27565e){_0x245c30=_0x27565e;_0xa1c8ac[_0x1c0d('0x38')]=_[_0x1c0d('0x3a')](db[_0x1c0d('0x54')][_0x1c0d('0x35')]);_0xa1c8ac[_0x1c0d('0x39')]=_[_0x1c0d('0x3a')](_0x250790[_0x1c0d('0x39')]);_0xa1c8ac['filters']=_[_0x1c0d('0x3c')](_0xa1c8ac['model'],_0xa1c8ac[_0x1c0d('0x39')]);_0x1b86cd[_0x1c0d('0x3d')]=_[_0x1c0d('0x3c')](_0xa1c8ac[_0x1c0d('0x38')],qs[_0x1c0d('0x3e')](_0x250790[_0x1c0d('0x39')]['fields']));_0x1b86cd[_0x1c0d('0x3d')]=_0x1b86cd[_0x1c0d('0x3d')]['length']?_0x1b86cd[_0x1c0d('0x3d')]:_0xa1c8ac[_0x1c0d('0x38')];_0x1b86cd['order']=qs['sort'](_0x250790[_0x1c0d('0x39')]['sort']);_0x1b86cd['where']=qs[_0x1c0d('0x3b')](_[_0x1c0d('0x56')](_0x250790['query'],_0xa1c8ac['filters']));if(_0x250790[_0x1c0d('0x39')][_0x1c0d('0x44')]){_0x1b86cd[_0x1c0d('0x43')]=_[_0x1c0d('0x45')](_0x1b86cd[_0x1c0d('0x43')],{'$or':_[_0x1c0d('0x34')](_0x1b86cd[_0x1c0d('0x3d')],function(_0x41758b){var _0x2f5e9e={};_0x2f5e9e[_0x41758b]={'$like':'%'+_0x250790[_0x1c0d('0x39')][_0x1c0d('0x44')]+'%'};return _0x2f5e9e;})});}_0x1b86cd=_[_0x1c0d('0x45')]({},_0x1b86cd,_0x250790['options']);return _0x245c30[_0x1c0d('0x58')](_0x1b86cd);}})['then'](function(_0x3fc2cd){if(_0x3fc2cd){_0x3392c6=_0x3fc2cd[_0x1c0d('0x3f')];if(!_0x250790[_0x1c0d('0x39')][_0x1c0d('0x40')](_0x1c0d('0x41'))){_0x1b86cd[_0x1c0d('0x2c')]=qs[_0x1c0d('0x2c')](_0x250790['query'][_0x1c0d('0x2c')]);_0x1b86cd[_0x1c0d('0x2b')]=qs[_0x1c0d('0x2b')](_0x250790['query']['offset']);}return _0x245c30['getSubjects'](_0x1b86cd);}})[_0x1c0d('0x2f')](function(_0x42e498){if(_0x42e498){return _0x42e498?{'count':_0x3392c6,'rows':_0x42e498}:null;}})[_0x1c0d('0x2f')](respondWithResult(_0x2951e3,null))[_0x1c0d('0x25')](handleError(_0x2951e3,null));};exports[_0x1c0d('0x59')]=function(_0x564af3,_0x5c3012,_0x5b61a6){var _0xad52dd={};var _0x15a416={};var _0x550ce5;var _0x467d06;return db[_0x1c0d('0x47')][_0x1c0d('0x53')]({'where':{'id':_0x564af3[_0x1c0d('0x4b')]['id']}})[_0x1c0d('0x2f')](handleEntityNotFound(_0x5c3012,null))[_0x1c0d('0x2f')](function(_0x581c73){if(_0x581c73){_0x550ce5=_0x581c73;_0x15a416[_0x1c0d('0x38')]=_[_0x1c0d('0x3a')](db[_0x1c0d('0x54')][_0x1c0d('0x35')]);_0x15a416[_0x1c0d('0x39')]=_['keys'](_0x564af3['query']);_0x15a416['filters']=_[_0x1c0d('0x3c')](_0x15a416[_0x1c0d('0x38')],_0x15a416[_0x1c0d('0x39')]);_0xad52dd[_0x1c0d('0x3d')]=_[_0x1c0d('0x3c')](_0x15a416[_0x1c0d('0x38')],qs[_0x1c0d('0x3e')](_0x564af3[_0x1c0d('0x39')][_0x1c0d('0x3e')]));_0xad52dd[_0x1c0d('0x3d')]=_0xad52dd['attributes']['length']?_0xad52dd[_0x1c0d('0x3d')]:_0x15a416[_0x1c0d('0x38')];_0xad52dd[_0x1c0d('0x55')]=qs[_0x1c0d('0x42')](_0x564af3[_0x1c0d('0x39')][_0x1c0d('0x42')]);_0xad52dd[_0x1c0d('0x43')]=qs[_0x1c0d('0x3b')](_[_0x1c0d('0x56')](_0x564af3[_0x1c0d('0x39')],_0x15a416['filters']));if(_0x564af3[_0x1c0d('0x39')]['filter']){_0xad52dd[_0x1c0d('0x43')]=_['merge'](_0xad52dd[_0x1c0d('0x43')],{'$or':_['map'](_0xad52dd['attributes'],function(_0x5ced5f){var _0x51c668={};_0x51c668[_0x5ced5f]={'$like':'%'+_0x564af3['query']['filter']+'%'};return _0x51c668;})});}_0xad52dd=_['merge']({},_0xad52dd,_0x564af3[_0x1c0d('0x4d')]);return _0x550ce5['getDescriptions'](_0xad52dd);}})[_0x1c0d('0x2f')](function(_0x57565f){if(_0x57565f){_0x467d06=_0x57565f[_0x1c0d('0x3f')];if(!_0x564af3[_0x1c0d('0x39')][_0x1c0d('0x40')](_0x1c0d('0x41'))){_0xad52dd[_0x1c0d('0x2c')]=qs['limit'](_0x564af3[_0x1c0d('0x39')][_0x1c0d('0x2c')]);_0xad52dd[_0x1c0d('0x2b')]=qs[_0x1c0d('0x2b')](_0x564af3[_0x1c0d('0x39')][_0x1c0d('0x2b')]);}return _0x550ce5[_0x1c0d('0x59')](_0xad52dd);}})[_0x1c0d('0x2f')](function(_0xf5e137){if(_0xf5e137){return _0xf5e137?{'count':_0x467d06,'rows':_0xf5e137}:null;}})['then'](respondWithResult(_0x5c3012,null))['catch'](handleError(_0x5c3012,null));};exports['getTags']=function(_0x47ab4c,_0x307e99,_0x34cd22){var _0x40b6ca={};var _0x5f5e00={};var _0x11e7ff;var _0x9abb9e;return db[_0x1c0d('0x47')][_0x1c0d('0x53')]({'where':{'id':_0x47ab4c[_0x1c0d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x307e99,null))[_0x1c0d('0x2f')](function(_0x5622d3){if(_0x5622d3){_0x11e7ff=_0x5622d3;_0x5f5e00[_0x1c0d('0x38')]=_[_0x1c0d('0x3a')](db[_0x1c0d('0x5a')][_0x1c0d('0x35')]);_0x5f5e00['query']=_['keys'](_0x47ab4c[_0x1c0d('0x39')]);_0x5f5e00['filters']=_[_0x1c0d('0x3c')](_0x5f5e00['model'],_0x5f5e00['query']);_0x40b6ca[_0x1c0d('0x3d')]=_[_0x1c0d('0x3c')](_0x5f5e00[_0x1c0d('0x38')],qs[_0x1c0d('0x3e')](_0x47ab4c[_0x1c0d('0x39')][_0x1c0d('0x3e')]));_0x40b6ca['attributes']=_0x40b6ca[_0x1c0d('0x3d')]['length']?_0x40b6ca[_0x1c0d('0x3d')]:_0x5f5e00[_0x1c0d('0x38')];_0x40b6ca['order']=qs[_0x1c0d('0x42')](_0x47ab4c[_0x1c0d('0x39')]['sort']);_0x40b6ca[_0x1c0d('0x43')]=qs[_0x1c0d('0x3b')](_[_0x1c0d('0x56')](_0x47ab4c[_0x1c0d('0x39')],_0x5f5e00[_0x1c0d('0x3b')]));if(_0x47ab4c[_0x1c0d('0x39')][_0x1c0d('0x44')]){_0x40b6ca[_0x1c0d('0x43')]=_[_0x1c0d('0x45')](_0x40b6ca[_0x1c0d('0x43')],{'$or':_[_0x1c0d('0x34')](_0x40b6ca[_0x1c0d('0x3d')],function(_0x36b73c){var _0x5cb2e5={};_0x5cb2e5[_0x36b73c]={'$like':'%'+_0x47ab4c[_0x1c0d('0x39')][_0x1c0d('0x44')]+'%'};return _0x5cb2e5;})});}_0x40b6ca=_[_0x1c0d('0x45')]({},_0x40b6ca,_0x47ab4c[_0x1c0d('0x4d')]);return _0x11e7ff['getTags'](_0x40b6ca);}})[_0x1c0d('0x2f')](function(_0x243365){if(_0x243365){_0x9abb9e=_0x243365[_0x1c0d('0x3f')];if(!_0x47ab4c[_0x1c0d('0x39')]['hasOwnProperty']('nolimit')){_0x40b6ca['limit']=qs[_0x1c0d('0x2c')](_0x47ab4c[_0x1c0d('0x39')][_0x1c0d('0x2c')]);_0x40b6ca['offset']=qs[_0x1c0d('0x2b')](_0x47ab4c[_0x1c0d('0x39')][_0x1c0d('0x2b')]);}return _0x11e7ff[_0x1c0d('0x5b')](_0x40b6ca);}})[_0x1c0d('0x2f')](function(_0x3db061){if(_0x3db061){return _0x3db061?{'count':_0x9abb9e,'rows':_0x3db061}:null;}})[_0x1c0d('0x2f')](respondWithResult(_0x307e99,null))[_0x1c0d('0x25')](handleError(_0x307e99,null));};exports[_0x1c0d('0x5c')]=function(_0x3df68c,_0x431325,_0x5d7f86){if(_0x3df68c['body']['id']){delete _0x3df68c['body']['id'];}return db['DeskConfiguration'][_0x1c0d('0x53')]({'where':{'id':_0x3df68c['params']['id']}})[_0x1c0d('0x2f')](handleEntityNotFound(_0x431325,null))[_0x1c0d('0x2f')](function(_0x40a759){if(_0x40a759){return _0x40a759['setTags'](_0x3df68c[_0x1c0d('0x50')]['ids']||[]);}return null;})['then'](respondWithResult(_0x431325,null))[_0x1c0d('0x25')](handleError(_0x431325,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 48ff1e1..7e4a9a6 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 _0xec9d=['bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xec9d,0x1a1));var _0xdec9=function(_0x408d97,_0x5dc56d){_0x408d97=_0x408d97-0x0;var _0xf13a9c=_0xec9d[_0x408d97];return _0xf13a9c;};'use strict';var _=require(_0xdec9('0x0'));var util=require(_0xdec9('0x1'));var logger=require(_0xdec9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdec9('0x3'));var rp=require(_0xdec9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdec9('0x5'));var config=require(_0xdec9('0x6'));var attributes=require(_0xdec9('0x7'));module['exports']=function(_0x5085cf,_0x56ae1c){return _0x5085cf['define'](_0xdec9('0x8'),attributes,{'tableName':_0xdec9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a3c=['moment','bluebird','request-promise','path','exports','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api'];(function(_0x384a3a,_0x15b740){var _0xdd707e=function(_0x1d1217){while(--_0x1d1217){_0x384a3a['push'](_0x384a3a['shift']());}};_0xdd707e(++_0x15b740);}(_0x1a3c,0x104));var _0xc1a3=function(_0x461308,_0xd1111d){_0x461308=_0x461308-0x0;var _0x5e5d80=_0x1a3c[_0x461308];return _0x5e5d80;};'use strict';var _=require(_0xc1a3('0x0'));var util=require(_0xc1a3('0x1'));var logger=require(_0xc1a3('0x2'))(_0xc1a3('0x3'));var moment=require(_0xc1a3('0x4'));var BPromise=require(_0xc1a3('0x5'));var rp=require(_0xc1a3('0x6'));var fs=require('fs');var path=require(_0xc1a3('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0xc1a3('0x8')]=function(_0x27a06d,_0x34a717){return _0x27a06d['define'](_0xc1a3('0x9'),attributes,{'tableName':_0xc1a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 5a36c02..2884507 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 _0x6364=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x6364,0x8f));var _0x4636=function(_0x1568eb,_0x30882f){_0x1568eb=_0x1568eb-0x0;var _0x19f1c2=_0x6364[_0x1568eb];return _0x19f1c2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4636('0x0'));var BPromise=require(_0x4636('0x1'));var rs=require(_0x4636('0x2'));var fs=require('fs');var Redis=require(_0x4636('0x3'));var db=require(_0x4636('0x4'))['db'];var utils=require(_0x4636('0x5'));var logger=require(_0x4636('0x6'))(_0x4636('0x7'));var config=require('../../config/environment');var jayson=require(_0x4636('0x8'));var client=jayson[_0x4636('0x9')][_0x4636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x185ea0,_0x17456d,_0x4e662e){return new BPromise(function(_0xd364dc,_0x1be4b5){return client[_0x4636('0xb')](_0x185ea0,_0x4e662e)[_0x4636('0xc')](function(_0x498de6){logger[_0x4636('0xd')](_0x4636('0xe'),_0x17456d,_0x4636('0xf'));logger[_0x4636('0x10')](_0x4636('0x11'),_0x17456d,'request\x20sent',JSON[_0x4636('0x12')](_0x498de6));if(_0x498de6[_0x4636('0x13')]){if(_0x498de6[_0x4636('0x13')][_0x4636('0x14')]===0x1f4){logger['error'](_0x4636('0xe'),_0x17456d,_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);return _0x1be4b5(_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x17456d,_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);return _0xd364dc(_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);}else{logger['info'](_0x4636('0xe'),_0x17456d,_0x4636('0xf'));_0xd364dc(_0x498de6[_0x4636('0x16')][_0x4636('0x15')]);}})[_0x4636('0x17')](function(_0x216748){logger['error'](_0x4636('0xe'),_0x17456d,_0x216748);_0x1be4b5(_0x216748);});});} \ No newline at end of file +var _0xdecb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','ioredis'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xdecb,0xe2));var _0xbdec=function(_0x2846b2,_0x5d8b1a){_0x2846b2=_0x2846b2-0x0;var _0x844c4f=_0xdecb[_0x2846b2];return _0x844c4f;};'use strict';var _=require('lodash');var util=require(_0xbdec('0x0'));var moment=require(_0xbdec('0x1'));var BPromise=require(_0xbdec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbdec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbdec('0x4'));var logger=require(_0xbdec('0x5'))(_0xbdec('0x6'));var config=require(_0xbdec('0x7'));var jayson=require(_0xbdec('0x8'));var client=jayson[_0xbdec('0x9')][_0xbdec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x532f8e,_0x32d039,_0x22f7d4){return new BPromise(function(_0x2e8942,_0x298770){return client[_0xbdec('0xb')](_0x532f8e,_0x22f7d4)[_0xbdec('0xc')](function(_0x2333f6){logger[_0xbdec('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));logger[_0xbdec('0xf')](_0xbdec('0x10'),_0x32d039,_0xbdec('0xe'),JSON['stringify'](_0x2333f6));if(_0x2333f6[_0xbdec('0x11')]){if(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x12')]===0x1f4){logger['error'](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x298770(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);return _0x2e8942(_0x2333f6[_0xbdec('0x11')][_0xbdec('0x14')]);}else{logger[_0xbdec('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x32d039,_0xbdec('0xe'));_0x2e8942(_0x2333f6[_0xbdec('0x15')][_0xbdec('0x14')]);}})[_0xbdec('0x16')](function(_0x324378){logger[_0xbdec('0x11')](_0xbdec('0x13'),_0x32d039,_0x324378);_0x298770(_0x324378);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index c230883..7652b8a 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 _0xef85=['isAuthenticated','/:id','show','create','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intDeskField.controller','get'];(function(_0x4d6075,_0x383a56){var _0x15e44f=function(_0x1adfc6){while(--_0x1adfc6){_0x4d6075['push'](_0x4d6075['shift']());}};_0x15e44f(++_0x383a56);}(_0xef85,0x115));var _0x5ef8=function(_0x1d08fe,_0x10fc8e){_0x1d08fe=_0x1d08fe-0x0;var _0x192d17=_0xef85[_0x1d08fe];return _0x192d17;};'use strict';var multer=require(_0x5ef8('0x0'));var util=require('util');var path=require(_0x5ef8('0x1'));var timeout=require(_0x5ef8('0x2'));var express=require(_0x5ef8('0x3'));var router=express[_0x5ef8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5ef8('0x5'));var config=require('../../config/environment');var controller=require(_0x5ef8('0x6'));router[_0x5ef8('0x7')]('/',auth[_0x5ef8('0x8')](),controller['index']);router[_0x5ef8('0x7')](_0x5ef8('0x9'),auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xa')]);router['post']('/',auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xb')]);router[_0x5ef8('0xc')](_0x5ef8('0x9'),auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xd')]);router['delete'](_0x5ef8('0x9'),auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xe')]);module['exports']=router; \ No newline at end of file +var _0x0c26=['multer','util','path','connect-timeout','express','Router','./intDeskField.controller','isAuthenticated','get','/:id','show','post','create','update','delete','exports'];(function(_0x700d00,_0x368065){var _0x35962a=function(_0x2261ee){while(--_0x2261ee){_0x700d00['push'](_0x700d00['shift']());}};_0x35962a(++_0x368065);}(_0x0c26,0xb0));var _0x60c2=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x0c26[_0x56482c];return _0x5aae7a;};'use strict';var multer=require(_0x60c2('0x0'));var util=require(_0x60c2('0x1'));var path=require(_0x60c2('0x2'));var timeout=require(_0x60c2('0x3'));var express=require(_0x60c2('0x4'));var router=express[_0x60c2('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x60c2('0x6'));router['get']('/',auth[_0x60c2('0x7')](),controller['index']);router[_0x60c2('0x8')](_0x60c2('0x9'),auth['isAuthenticated'](),controller[_0x60c2('0xa')]);router[_0x60c2('0xb')]('/',auth[_0x60c2('0x7')](),controller[_0x60c2('0xc')]);router['put'](_0x60c2('0x9'),auth[_0x60c2('0x7')](),controller[_0x60c2('0xd')]);router[_0x60c2('0xe')](_0x60c2('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x60c2('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index dad5c83..82ed56d 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 _0x3561=['STRING','customVariable','sequelize','exports','ENUM','variable','string'];(function(_0x208d24,_0x14cfe9){var _0x1e2de=function(_0x3581ef){while(--_0x3581ef){_0x208d24['push'](_0x208d24['shift']());}};_0x1e2de(++_0x14cfe9);}(_0x3561,0x11a));var _0x1356=function(_0x511e11,_0x2311a2){_0x511e11=_0x511e11-0x0;var _0x256d8d=_0x3561[_0x511e11];return _0x256d8d;};'use strict';var Sequelize=require(_0x1356('0x0'));module[_0x1356('0x1')]={'type':{'type':Sequelize[_0x1356('0x2')]('string',_0x1356('0x3'),'customVariable','keyValue'),'defaultValue':_0x1356('0x4')},'content':{'type':Sequelize[_0x1356('0x5')]},'key':{'type':Sequelize[_0x1356('0x5')]},'keyType':{'type':Sequelize[_0x1356('0x2')](_0x1356('0x4'),_0x1356('0x3'),_0x1356('0x6'))},'keyContent':{'type':Sequelize[_0x1356('0x5')]},'idField':{'type':Sequelize[_0x1356('0x5')]},'nameField':{'type':Sequelize[_0x1356('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1356('0x5')]}}; \ No newline at end of file +var _0xe4d1=['exports','ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x1cb1a2,_0x3a0a27){var _0xa9aa05=function(_0x1cc324){while(--_0x1cc324){_0x1cb1a2['push'](_0x1cb1a2['shift']());}};_0xa9aa05(++_0x3a0a27);}(_0xe4d1,0x155));var _0x1e4d=function(_0x2ca377,_0x20e88a){_0x2ca377=_0x2ca377-0x0;var _0x5e78ca=_0xe4d1[_0x2ca377];return _0x5e78ca;};'use strict';var Sequelize=require(_0x1e4d('0x0'));module[_0x1e4d('0x1')]={'type':{'type':Sequelize[_0x1e4d('0x2')](_0x1e4d('0x3'),'variable','customVariable',_0x1e4d('0x4')),'defaultValue':_0x1e4d('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1e4d('0x5')]},'keyType':{'type':Sequelize[_0x1e4d('0x2')]('string',_0x1e4d('0x6'),_0x1e4d('0x7'))},'keyContent':{'type':Sequelize[_0x1e4d('0x5')]},'idField':{'type':Sequelize[_0x1e4d('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1e4d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1e4d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 116b8e4..2e9b4b9 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 _0x24cd=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','save','update','then','error','stack','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','name','merge','count','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3d8734,_0x126096){var _0x33c5dd=function(_0x216dcc){while(--_0x216dcc){_0x3d8734['push'](_0x3d8734['shift']());}};_0x33c5dd(++_0x126096);}(_0x24cd,0x83));var _0xd24c=function(_0x39a304,_0x41183d){_0x39a304=_0x39a304-0x0;var _0x1a1fb7=_0x24cd[_0x39a304];return _0x1a1fb7;};'use strict';var pdf=require(_0xd24c('0x0'));var emlformat=require(_0xd24c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd24c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd24c('0x3'));var moment=require(_0xd24c('0x4'));var BPromise=require(_0xd24c('0x5'));var Mustache=require('mustache');var util=require(_0xd24c('0x6'));var path=require(_0xd24c('0x7'));var sox=require('sox');var csv=require(_0xd24c('0x8'));var ejs=require(_0xd24c('0x9'));var fs=require('fs');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('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd24c('0xf'));var authService=require(_0xd24c('0x10'));var qs=require(_0xd24c('0x11'));var as=require(_0xd24c('0x12'));var hardwareService=require(_0xd24c('0x13'));var logger=require(_0xd24c('0x14'))(_0xd24c('0x15'));var utils=require(_0xd24c('0x16'));var config=require('../../config/environment');var db=require(_0xd24c('0x17'))['db'];function respondWithStatusCode(_0x5a7556,_0x55de4d){_0x55de4d=_0x55de4d||0xcc;return function(_0x3296ea){if(_0x3296ea){return _0x5a7556[_0xd24c('0x18')](_0x55de4d);}return _0x5a7556[_0xd24c('0x19')](_0x55de4d)[_0xd24c('0x1a')]();};}function respondWithResult(_0x32d8b0,_0x6a81d9){_0x6a81d9=_0x6a81d9||0xc8;return function(_0x2c29c6){if(_0x2c29c6){return _0x32d8b0[_0xd24c('0x19')](_0x6a81d9)['json'](_0x2c29c6);}};}function respondWithFilteredResult(_0x12814a,_0xe096c){return function(_0x528489){if(_0x528489){var _0x34aa92=_0x528489['count'],_0x3aa193=_0xe096c['offset'],_0x1a1111=_0xe096c[_0xd24c('0x1b')]+_0xe096c[_0xd24c('0x1c')],_0x3221a8;if(_0x1a1111>=_0x34aa92){_0x1a1111=_0x34aa92;_0x3221a8=0xc8;}else{_0x3221a8=0xce;}_0x12814a[_0xd24c('0x19')](_0x3221a8);return _0x12814a['set'](_0xd24c('0x1d'),_0x3aa193+'-'+_0x1a1111+'/'+_0x34aa92)[_0xd24c('0x1e')](_0x528489);}return null;};}function patchUpdates(_0x46e453){return function(_0x62e228){try{jsonpatch['apply'](_0x62e228,_0x46e453,!![]);}catch(_0x35de97){return BPromise['reject'](_0x35de97);}return _0x62e228[_0xd24c('0x1f')]();};}function saveUpdates(_0x3bc150,_0x1b3a2f){return function(_0x38c380){if(_0x38c380){return _0x38c380[_0xd24c('0x20')](_0x3bc150)[_0xd24c('0x21')](function(_0x2f7439){return _0x2f7439;});}return null;};}function removeEntity(_0x298d73,_0x17375b){return function(_0x206ce7){if(_0x206ce7){return _0x206ce7['destroy']()[_0xd24c('0x21')](function(){_0x298d73[_0xd24c('0x19')](0xcc)[_0xd24c('0x1a')]();});}};}function handleEntityNotFound(_0x5c862f,_0x44471f){return function(_0x2c3328){if(!_0x2c3328){_0x5c862f[_0xd24c('0x18')](0x194);}return _0x2c3328;};}function handleError(_0x5dac02,_0x4539e7){_0x4539e7=_0x4539e7||0x1f4;return function(_0x391cd5){logger[_0xd24c('0x22')](_0x391cd5[_0xd24c('0x23')]);if(_0x391cd5['name']){delete _0x391cd5['name'];}_0x5dac02[_0xd24c('0x19')](_0x4539e7)['send'](_0x391cd5);};}exports[_0xd24c('0x24')]=function(_0xaf8b16,_0x325fcc){var _0x4c0d99={},_0x4cb1b3={},_0x26fd85={'count':0x0,'rows':[]};var _0x14d44a=_[_0xd24c('0x25')](db[_0xd24c('0x26')][_0xd24c('0x27')],function(_0x2ecbaa){return{'name':_0x2ecbaa[_0xd24c('0x28')],'type':_0x2ecbaa[_0xd24c('0x29')][_0xd24c('0x2a')]};});_0x4cb1b3[_0xd24c('0x2b')]=_[_0xd24c('0x25')](_0x14d44a,'name');_0x4cb1b3[_0xd24c('0x2c')]=_[_0xd24c('0x2d')](_0xaf8b16[_0xd24c('0x2c')]);_0x4cb1b3[_0xd24c('0x2e')]=_['intersection'](_0x4cb1b3['model'],_0x4cb1b3[_0xd24c('0x2c')]);_0x4c0d99[_0xd24c('0x2f')]=_[_0xd24c('0x30')](_0x4cb1b3[_0xd24c('0x2b')],qs['fields'](_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x31')]));_0x4c0d99[_0xd24c('0x2f')]=_0x4c0d99[_0xd24c('0x2f')][_0xd24c('0x32')]?_0x4c0d99[_0xd24c('0x2f')]:_0x4cb1b3[_0xd24c('0x2b')];if(!_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x33')]('nolimit')){_0x4c0d99[_0xd24c('0x1c')]=qs['limit'](_0xaf8b16['query'][_0xd24c('0x1c')]);_0x4c0d99[_0xd24c('0x1b')]=qs[_0xd24c('0x1b')](_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x1b')]);}_0x4c0d99[_0xd24c('0x34')]=qs[_0xd24c('0x35')](_0xaf8b16['query'][_0xd24c('0x35')]);_0x4c0d99[_0xd24c('0x36')]=qs[_0xd24c('0x2e')](_[_0xd24c('0x37')](_0xaf8b16[_0xd24c('0x2c')],_0x4cb1b3[_0xd24c('0x2e')]));if(_0xaf8b16['query'][_0xd24c('0x38')]){_0x4c0d99[_0xd24c('0x36')]=_['merge'](_0x4c0d99[_0xd24c('0x36')],{'$or':_[_0xd24c('0x25')](_0x14d44a,function(_0x4bf183){if(_0x4bf183[_0xd24c('0x29')]!==_0xd24c('0x39')){var _0x52d4a5={};_0x52d4a5[_0x4bf183[_0xd24c('0x3a')]]={'$like':'%'+_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x38')]+'%'};return _0x52d4a5;}})});}_0x4c0d99=_[_0xd24c('0x3b')]({},_0x4c0d99,_0xaf8b16['options']);var _0x11ab7b={'where':_0x4c0d99['where']};return db[_0xd24c('0x26')]['count'](_0x11ab7b)['then'](function(_0x4b1a7e){_0x26fd85[_0xd24c('0x3c')]=_0x4b1a7e;if(_0xaf8b16['query']['includeAll']){_0x4c0d99[_0xd24c('0x3d')]=[{'all':!![]}];}return db[_0xd24c('0x26')][_0xd24c('0x3e')](_0x4c0d99);})[_0xd24c('0x21')](function(_0x4d4335){_0x26fd85[_0xd24c('0x3f')]=_0x4d4335;return _0x26fd85;})['then'](respondWithFilteredResult(_0x325fcc,_0x4c0d99))[_0xd24c('0x40')](handleError(_0x325fcc,null));};exports[_0xd24c('0x41')]=function(_0x3eb039,_0x181836){var _0x27eefa={'raw':!![],'where':{'id':_0x3eb039[_0xd24c('0x42')]['id']}},_0x5ee293={};_0x5ee293[_0xd24c('0x2b')]=_[_0xd24c('0x2d')](db[_0xd24c('0x26')]['rawAttributes']);_0x5ee293[_0xd24c('0x2c')]=_[_0xd24c('0x2d')](_0x3eb039['query']);_0x5ee293[_0xd24c('0x2e')]=_[_0xd24c('0x30')](_0x5ee293['model'],_0x5ee293[_0xd24c('0x2c')]);_0x27eefa['attributes']=_[_0xd24c('0x30')](_0x5ee293[_0xd24c('0x2b')],qs[_0xd24c('0x31')](_0x3eb039[_0xd24c('0x2c')][_0xd24c('0x31')]));_0x27eefa['attributes']=_0x27eefa[_0xd24c('0x2f')]['length']?_0x27eefa[_0xd24c('0x2f')]:_0x5ee293['model'];if(_0x3eb039[_0xd24c('0x2c')][_0xd24c('0x43')]){_0x27eefa['include']=[{'all':!![]}];}_0x27eefa=_[_0xd24c('0x3b')]({},_0x27eefa,_0x3eb039[_0xd24c('0x44')]);return db['DeskField'][_0xd24c('0x45')](_0x27eefa)['then'](handleEntityNotFound(_0x181836,null))['then'](respondWithResult(_0x181836,null))['catch'](handleError(_0x181836,null));};exports[_0xd24c('0x46')]=function(_0x2055ad,_0x490957){return db['DeskField'][_0xd24c('0x46')](_0x2055ad[_0xd24c('0x47')],{})[_0xd24c('0x21')](respondWithResult(_0x490957,0xc9))[_0xd24c('0x40')](handleError(_0x490957,null));};exports['update']=function(_0x2931b7,_0x186348){if(_0x2931b7['body']['id']){delete _0x2931b7[_0xd24c('0x47')]['id'];}return db[_0xd24c('0x26')][_0xd24c('0x45')]({'where':{'id':_0x2931b7['params']['id']}})[_0xd24c('0x21')](handleEntityNotFound(_0x186348,null))['then'](saveUpdates(_0x2931b7[_0xd24c('0x47')],null))[_0xd24c('0x21')](respondWithResult(_0x186348,null))[_0xd24c('0x40')](handleError(_0x186348,null));};exports[_0xd24c('0x48')]=function(_0x47d5ce,_0x14684c){return db[_0xd24c('0x26')][_0xd24c('0x45')]({'where':{'id':_0x47d5ce[_0xd24c('0x42')]['id']}})[_0xd24c('0x21')](handleEntityNotFound(_0x14684c,null))[_0xd24c('0x21')](removeEntity(_0x14684c,null))[_0xd24c('0x40')](handleError(_0x14684c,null));}; \ No newline at end of file +var _0x80d9=['pick','merge','VIRTUAL','filter','then','rows','catch','show','params','options','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','DeskField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','attributes','length','limit','order','sort','where'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x80d9,0x15c));var _0x980d=function(_0xcefb2d,_0x409fd4){_0xcefb2d=_0xcefb2d-0x0;var _0x3fd8de=_0x80d9[_0xcefb2d];return _0x3fd8de;};'use strict';var pdf=require(_0x980d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x980d('0x1'));var zipdir=require(_0x980d('0x2'));var jsonpatch=require(_0x980d('0x3'));var rp=require('request-promise');var moment=require(_0x980d('0x4'));var BPromise=require(_0x980d('0x5'));var Mustache=require(_0x980d('0x6'));var util=require(_0x980d('0x7'));var path=require(_0x980d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x980d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x980d('0xa'));var jsforce=require(_0x980d('0xb'));var deskjs=require(_0x980d('0xc'));var toCsv=require(_0x980d('0xd'));var querystring=require(_0x980d('0xe'));var Papa=require(_0x980d('0xf'));var Redis=require(_0x980d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x980d('0x11'));var logger=require(_0x980d('0x12'))('api');var utils=require(_0x980d('0x13'));var config=require('../../config/environment');var db=require(_0x980d('0x14'))['db'];function respondWithStatusCode(_0x52cd18,_0xc0168a){_0xc0168a=_0xc0168a||0xcc;return function(_0x19cb9b){if(_0x19cb9b){return _0x52cd18[_0x980d('0x15')](_0xc0168a);}return _0x52cd18[_0x980d('0x16')](_0xc0168a)[_0x980d('0x17')]();};}function respondWithResult(_0x18469c,_0x109ddf){_0x109ddf=_0x109ddf||0xc8;return function(_0x3a317b){if(_0x3a317b){return _0x18469c['status'](_0x109ddf)[_0x980d('0x18')](_0x3a317b);}};}function respondWithFilteredResult(_0x138882,_0x3fc5f7){return function(_0x3846bd){if(_0x3846bd){var _0x2f229b=_0x3846bd[_0x980d('0x19')],_0x169648=_0x3fc5f7['offset'],_0x5824bf=_0x3fc5f7[_0x980d('0x1a')]+_0x3fc5f7['limit'],_0x27dd6a;if(_0x5824bf>=_0x2f229b){_0x5824bf=_0x2f229b;_0x27dd6a=0xc8;}else{_0x27dd6a=0xce;}_0x138882[_0x980d('0x16')](_0x27dd6a);return _0x138882[_0x980d('0x1b')](_0x980d('0x1c'),_0x169648+'-'+_0x5824bf+'/'+_0x2f229b)[_0x980d('0x18')](_0x3846bd);}return null;};}function patchUpdates(_0x2a9ce4){return function(_0xc360c4){try{jsonpatch[_0x980d('0x1d')](_0xc360c4,_0x2a9ce4,!![]);}catch(_0x5a9f5e){return BPromise[_0x980d('0x1e')](_0x5a9f5e);}return _0xc360c4[_0x980d('0x1f')]();};}function saveUpdates(_0x2f234f,_0x550741){return function(_0x58dddf){if(_0x58dddf){return _0x58dddf[_0x980d('0x20')](_0x2f234f)['then'](function(_0x4e37c8){return _0x4e37c8;});}return null;};}function removeEntity(_0x124c3f,_0x1d6286){return function(_0x45d698){if(_0x45d698){return _0x45d698[_0x980d('0x21')]()['then'](function(){_0x124c3f['status'](0xcc)[_0x980d('0x17')]();});}};}function handleEntityNotFound(_0x4fca61,_0x4de252){return function(_0x20cea1){if(!_0x20cea1){_0x4fca61['sendStatus'](0x194);}return _0x20cea1;};}function handleError(_0x23ca08,_0x4798d7){_0x4798d7=_0x4798d7||0x1f4;return function(_0x4e5af6){logger['error'](_0x4e5af6[_0x980d('0x22')]);if(_0x4e5af6[_0x980d('0x23')]){delete _0x4e5af6[_0x980d('0x23')];}_0x23ca08[_0x980d('0x16')](_0x4798d7)['send'](_0x4e5af6);};}exports['index']=function(_0x26d9c6,_0x1d5dad){var _0x97ca70={},_0x1da8ea={},_0x3d5f19={'count':0x0,'rows':[]};var _0x47b11d=_['map'](db[_0x980d('0x24')][_0x980d('0x25')],function(_0x7828f1){return{'name':_0x7828f1[_0x980d('0x26')],'type':_0x7828f1[_0x980d('0x27')][_0x980d('0x28')]};});_0x1da8ea['model']=_[_0x980d('0x29')](_0x47b11d,_0x980d('0x23'));_0x1da8ea[_0x980d('0x2a')]=_[_0x980d('0x2b')](_0x26d9c6[_0x980d('0x2a')]);_0x1da8ea[_0x980d('0x2c')]=_[_0x980d('0x2d')](_0x1da8ea[_0x980d('0x2e')],_0x1da8ea[_0x980d('0x2a')]);_0x97ca70['attributes']=_[_0x980d('0x2d')](_0x1da8ea[_0x980d('0x2e')],qs[_0x980d('0x2f')](_0x26d9c6['query']['fields']));_0x97ca70[_0x980d('0x30')]=_0x97ca70['attributes'][_0x980d('0x31')]?_0x97ca70['attributes']:_0x1da8ea['model'];if(!_0x26d9c6['query']['hasOwnProperty']('nolimit')){_0x97ca70['limit']=qs['limit'](_0x26d9c6[_0x980d('0x2a')][_0x980d('0x32')]);_0x97ca70[_0x980d('0x1a')]=qs['offset'](_0x26d9c6[_0x980d('0x2a')][_0x980d('0x1a')]);}_0x97ca70[_0x980d('0x33')]=qs[_0x980d('0x34')](_0x26d9c6[_0x980d('0x2a')][_0x980d('0x34')]);_0x97ca70[_0x980d('0x35')]=qs['filters'](_[_0x980d('0x36')](_0x26d9c6[_0x980d('0x2a')],_0x1da8ea['filters']));if(_0x26d9c6[_0x980d('0x2a')]['filter']){_0x97ca70[_0x980d('0x35')]=_[_0x980d('0x37')](_0x97ca70[_0x980d('0x35')],{'$or':_['map'](_0x47b11d,function(_0x5d8c31){if(_0x5d8c31['type']!==_0x980d('0x38')){var _0x555964={};_0x555964[_0x5d8c31['name']]={'$like':'%'+_0x26d9c6[_0x980d('0x2a')][_0x980d('0x39')]+'%'};return _0x555964;}})});}_0x97ca70=_[_0x980d('0x37')]({},_0x97ca70,_0x26d9c6['options']);var _0x41174b={'where':_0x97ca70[_0x980d('0x35')]};return db[_0x980d('0x24')][_0x980d('0x19')](_0x41174b)[_0x980d('0x3a')](function(_0x4e2aac){_0x3d5f19['count']=_0x4e2aac;if(_0x26d9c6[_0x980d('0x2a')]['includeAll']){_0x97ca70['include']=[{'all':!![]}];}return db['DeskField']['findAll'](_0x97ca70);})[_0x980d('0x3a')](function(_0x419354){_0x3d5f19[_0x980d('0x3b')]=_0x419354;return _0x3d5f19;})['then'](respondWithFilteredResult(_0x1d5dad,_0x97ca70))[_0x980d('0x3c')](handleError(_0x1d5dad,null));};exports[_0x980d('0x3d')]=function(_0x308466,_0xb585){var _0x20a388={'raw':!![],'where':{'id':_0x308466[_0x980d('0x3e')]['id']}},_0x42bbc9={};_0x42bbc9['model']=_[_0x980d('0x2b')](db[_0x980d('0x24')][_0x980d('0x25')]);_0x42bbc9['query']=_[_0x980d('0x2b')](_0x308466[_0x980d('0x2a')]);_0x42bbc9[_0x980d('0x2c')]=_[_0x980d('0x2d')](_0x42bbc9[_0x980d('0x2e')],_0x42bbc9[_0x980d('0x2a')]);_0x20a388[_0x980d('0x30')]=_['intersection'](_0x42bbc9[_0x980d('0x2e')],qs['fields'](_0x308466[_0x980d('0x2a')][_0x980d('0x2f')]));_0x20a388[_0x980d('0x30')]=_0x20a388[_0x980d('0x30')][_0x980d('0x31')]?_0x20a388[_0x980d('0x30')]:_0x42bbc9[_0x980d('0x2e')];if(_0x308466[_0x980d('0x2a')]['includeAll']){_0x20a388['include']=[{'all':!![]}];}_0x20a388=_[_0x980d('0x37')]({},_0x20a388,_0x308466[_0x980d('0x3f')]);return db[_0x980d('0x24')][_0x980d('0x40')](_0x20a388)[_0x980d('0x3a')](handleEntityNotFound(_0xb585,null))['then'](respondWithResult(_0xb585,null))[_0x980d('0x3c')](handleError(_0xb585,null));};exports[_0x980d('0x41')]=function(_0x4ea430,_0x28dd28){return db[_0x980d('0x24')][_0x980d('0x41')](_0x4ea430[_0x980d('0x42')],{})[_0x980d('0x3a')](respondWithResult(_0x28dd28,0xc9))[_0x980d('0x3c')](handleError(_0x28dd28,null));};exports[_0x980d('0x20')]=function(_0x135c26,_0x7515ac){if(_0x135c26['body']['id']){delete _0x135c26[_0x980d('0x42')]['id'];}return db[_0x980d('0x24')][_0x980d('0x40')]({'where':{'id':_0x135c26[_0x980d('0x3e')]['id']}})[_0x980d('0x3a')](handleEntityNotFound(_0x7515ac,null))[_0x980d('0x3a')](saveUpdates(_0x135c26[_0x980d('0x42')],null))['then'](respondWithResult(_0x7515ac,null))[_0x980d('0x3c')](handleError(_0x7515ac,null));};exports['destroy']=function(_0x33c914,_0x6e16c1){return db[_0x980d('0x24')][_0x980d('0x40')]({'where':{'id':_0x33c914[_0x980d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x6e16c1,null))[_0x980d('0x3a')](removeEntity(_0x6e16c1,null))[_0x980d('0x3c')](handleError(_0x6e16c1,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 2703e51..280c92d 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 _0x51af=['path','rimraf','../../config/environment','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','moment','request-promise'];(function(_0x4e8050,_0x5d7393){var _0x2ba9e9=function(_0x29a65d){while(--_0x29a65d){_0x4e8050['push'](_0x4e8050['shift']());}};_0x2ba9e9(++_0x5d7393);}(_0x51af,0xc9));var _0xf51a=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x51af[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xf51a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf51a('0x1'));var BPromise=require('bluebird');var rp=require(_0xf51a('0x2'));var fs=require('fs');var path=require(_0xf51a('0x3'));var rimraf=require(_0xf51a('0x4'));var config=require(_0xf51a('0x5'));var attributes=require('./intDeskField.attributes');module[_0xf51a('0x6')]=function(_0x6effb8,_0x31ae68){return _0x6effb8[_0xf51a('0x7')]('DeskField',attributes,{'tableName':_0xf51a('0x8'),'paranoid':![],'indexes':[{'name':_0xf51a('0x9'),'fields':[_0xf51a('0xa'),_0xf51a('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x89b8=['exports','define','int_desk_fields','desk_unique_index','FieldId','../../config/logger','api','request-promise','path','../../config/environment','./intDeskField.attributes'];(function(_0x58a750,_0x8d6ee){var _0x2fe6b7=function(_0x354768){while(--_0x354768){_0x58a750['push'](_0x58a750['shift']());}};_0x2fe6b7(++_0x8d6ee);}(_0x89b8,0x1d3));var _0x889b=function(_0x39f8dc,_0x13f34a){_0x39f8dc=_0x39f8dc-0x0;var _0x225953=_0x89b8[_0x39f8dc];return _0x225953;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x889b('0x0'))(_0x889b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x889b('0x2'));var fs=require('fs');var path=require(_0x889b('0x3'));var rimraf=require('rimraf');var config=require(_0x889b('0x4'));var attributes=require(_0x889b('0x5'));module[_0x889b('0x6')]=function(_0x1306a9,_0x52c3b8){return _0x1306a9[_0x889b('0x7')]('DeskField',attributes,{'tableName':_0x889b('0x8'),'paranoid':![],'indexes':[{'name':_0x889b('0x9'),'fields':['idField',_0x889b('0xa')],'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 7ca5f9a..d67767e 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 _0x84cb=['http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x1c63ba,_0x310039){var _0x756061=function(_0x4a76fb){while(--_0x4a76fb){_0x1c63ba['push'](_0x1c63ba['shift']());}};_0x756061(++_0x310039);}(_0x84cb,0xef));var _0xb84c=function(_0x4697f2,_0x1de28e){_0x4697f2=_0x4697f2-0x0;var _0x147729=_0x84cb[_0x4697f2];return _0x147729;};'use strict';var _=require(_0xb84c('0x0'));var util=require(_0xb84c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb84c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb84c('0x4'));var config=require(_0xb84c('0x5'));var jayson=require(_0xb84c('0x6'));var client=jayson[_0xb84c('0x7')][_0xb84c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e4f71,_0x1a536d,_0x442489){return new BPromise(function(_0x4aa55e,_0x2250f4){return client[_0xb84c('0x9')](_0x5e4f71,_0x442489)['then'](function(_0x7ba227){logger[_0xb84c('0xa')](_0xb84c('0xb'),_0x1a536d,_0xb84c('0xc'));logger[_0xb84c('0xd')](_0xb84c('0xe'),_0x1a536d,'request\x20sent',JSON['stringify'](_0x7ba227));if(_0x7ba227['error']){if(_0x7ba227[_0xb84c('0xf')]['code']===0x1f4){logger[_0xb84c('0xf')]('DeskField,\x20%s,\x20%s',_0x1a536d,_0x7ba227[_0xb84c('0xf')]['message']);return _0x2250f4(_0x7ba227[_0xb84c('0xf')]['message']);}logger[_0xb84c('0xf')](_0xb84c('0xb'),_0x1a536d,_0x7ba227[_0xb84c('0xf')][_0xb84c('0x10')]);return _0x4aa55e(_0x7ba227[_0xb84c('0xf')]['message']);}else{logger[_0xb84c('0xa')](_0xb84c('0xb'),_0x1a536d,'request\x20sent');_0x4aa55e(_0x7ba227[_0xb84c('0x11')][_0xb84c('0x10')]);}})[_0xb84c('0x12')](function(_0x3d9bfe){logger['error'](_0xb84c('0xb'),_0x1a536d,_0x3d9bfe);_0x2250f4(_0x3d9bfe);});});} \ No newline at end of file +var _0x101e=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','bluebird','randomstring','ioredis'];(function(_0x297b89,_0x27b2fb){var _0x5a679c=function(_0x5757b3){while(--_0x5757b3){_0x297b89['push'](_0x297b89['shift']());}};_0x5a679c(++_0x27b2fb);}(_0x101e,0x18c));var _0xe101=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x101e[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xe101('0x0'));var rs=require(_0xe101('0x1'));var fs=require('fs');var Redis=require(_0xe101('0x2'));var db=require(_0xe101('0x3'))['db'];var utils=require(_0xe101('0x4'));var logger=require(_0xe101('0x5'))(_0xe101('0x6'));var config=require(_0xe101('0x7'));var jayson=require(_0xe101('0x8'));var client=jayson[_0xe101('0x9')][_0xe101('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3adb55,_0x58bb41,_0x2d48c6){return new BPromise(function(_0x2882f3,_0x155b64){return client[_0xe101('0xb')](_0x3adb55,_0x2d48c6)[_0xe101('0xc')](function(_0x1d5eba){logger['info'](_0xe101('0xd'),_0x58bb41,_0xe101('0xe'));logger['debug'](_0xe101('0xf'),_0x58bb41,_0xe101('0xe'),JSON['stringify'](_0x1d5eba));if(_0x1d5eba[_0xe101('0x10')]){if(_0x1d5eba[_0xe101('0x10')][_0xe101('0x11')]===0x1f4){logger[_0xe101('0x10')]('DeskField,\x20%s,\x20%s',_0x58bb41,_0x1d5eba[_0xe101('0x10')]['message']);return _0x155b64(_0x1d5eba[_0xe101('0x10')][_0xe101('0x12')]);}logger[_0xe101('0x10')](_0xe101('0xd'),_0x58bb41,_0x1d5eba[_0xe101('0x10')][_0xe101('0x12')]);return _0x2882f3(_0x1d5eba[_0xe101('0x10')][_0xe101('0x12')]);}else{logger[_0xe101('0x13')](_0xe101('0xd'),_0x58bb41,'request\x20sent');_0x2882f3(_0x1d5eba['result'][_0xe101('0x12')]);}})[_0xe101('0x14')](function(_0x293540){logger[_0xe101('0x10')]('DeskField,\x20%s,\x20%s',_0x58bb41,_0x293540);_0x155b64(_0x293540);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 11c83b3..ae43fe5 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 _0xd433=['/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get'];(function(_0x1a92c8,_0x34de5e){var _0x46a193=function(_0x2a214e){while(--_0x2a214e){_0x1a92c8['push'](_0x1a92c8['shift']());}};_0x46a193(++_0x34de5e);}(_0xd433,0x1ed));var _0x3d43=function(_0x297d1f,_0x968c){_0x297d1f=_0x297d1f-0x0;var _0x1da5ec=_0xd433[_0x297d1f];return _0x1da5ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3d43('0x0'));var timeout=require(_0x3d43('0x1'));var express=require(_0x3d43('0x2'));var router=express[_0x3d43('0x3')]();var auth=require(_0x3d43('0x4'));var interaction=require(_0x3d43('0x5'));var config=require(_0x3d43('0x6'));var controller=require(_0x3d43('0x7'));router['get']('/',auth[_0x3d43('0x8')](),controller[_0x3d43('0x9')]);router[_0x3d43('0xa')](_0x3d43('0xb'),auth['isAuthenticated'](),controller[_0x3d43('0xc')]);router[_0x3d43('0xa')](_0x3d43('0xd'),auth[_0x3d43('0x8')](),controller['getConfigurations']);router[_0x3d43('0xa')](_0x3d43('0xe'),auth['isAuthenticated'](),controller[_0x3d43('0xf')]);router[_0x3d43('0x10')]('/',auth[_0x3d43('0x8')](),controller[_0x3d43('0x11')]);router['post']('/:id/configurations',auth[_0x3d43('0x8')](),controller[_0x3d43('0x12')]);router[_0x3d43('0x13')](_0x3d43('0xb'),auth[_0x3d43('0x8')](),controller['update']);router['delete'](_0x3d43('0xb'),auth[_0x3d43('0x8')](),controller[_0x3d43('0x14')]);module['exports']=router; \ No newline at end of file +var _0xeacb=['./intDynamics365Account.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','/:id','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeacb,0x6c));var _0xbeac=function(_0x11b4ed,_0x3e4063){_0x11b4ed=_0x11b4ed-0x0;var _0x5bc70e=_0xeacb[_0x11b4ed];return _0x5bc70e;};'use strict';var multer=require(_0xbeac('0x0'));var util=require(_0xbeac('0x1'));var path=require('path');var timeout=require(_0xbeac('0x2'));var express=require(_0xbeac('0x3'));var router=express[_0xbeac('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbeac('0x5'));var config=require('../../config/environment');var controller=require(_0xbeac('0x6'));router[_0xbeac('0x7')]('/',auth[_0xbeac('0x8')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xbeac('0x7')](_0xbeac('0x9'),auth[_0xbeac('0x8')](),controller[_0xbeac('0xa')]);router[_0xbeac('0x7')](_0xbeac('0xb'),auth['isAuthenticated'](),controller[_0xbeac('0xc')]);router[_0xbeac('0xd')]('/',auth[_0xbeac('0x8')](),controller[_0xbeac('0xe')]);router[_0xbeac('0xd')](_0xbeac('0x9'),auth[_0xbeac('0x8')](),controller['addConfiguration']);router[_0xbeac('0xf')](_0xbeac('0x10'),auth['isAuthenticated'](),controller[_0xbeac('0x11')]);router['delete'](_0xbeac('0x10'),auth[_0xbeac('0x8')](),controller[_0xbeac('0x12')]);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 97f75c0..c8f40c3 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 _0x0b29=['sequelize','exports','STRING'];(function(_0x37949c,_0x5cb3d8){var _0x79a1a0=function(_0x4a8efe){while(--_0x4a8efe){_0x37949c['push'](_0x37949c['shift']());}};_0x79a1a0(++_0x5cb3d8);}(_0x0b29,0xb1));var _0x90b2=function(_0x237587,_0x5ca4cb){_0x237587=_0x237587-0x0;var _0x1ae730=_0x0b29[_0x237587];return _0x1ae730;};'use strict';var Sequelize=require(_0x90b2('0x0'));module[_0x90b2('0x1')]={'name':{'type':Sequelize[_0x90b2('0x2')]},'username':{'type':Sequelize[_0x90b2('0x2')]},'password':{'type':Sequelize[_0x90b2('0x2')]},'remoteUri':{'type':Sequelize[_0x90b2('0x2')]},'tenantId':{'type':Sequelize[_0x90b2('0x2')]},'clientId':{'type':Sequelize[_0x90b2('0x2')]},'clientSecret':{'type':Sequelize[_0x90b2('0x2')]},'serverUrl':{'type':Sequelize[_0x90b2('0x2')]},'description':{'type':Sequelize[_0x90b2('0x2')]}}; \ No newline at end of file +var _0x0c09=['exports','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0c09,0x1c4));var _0x90c0=function(_0x588a21,_0x4081a1){_0x588a21=_0x588a21-0x0;var _0x507158=_0x0c09[_0x588a21];return _0x507158;};'use strict';var Sequelize=require('sequelize');module[_0x90c0('0x0')]={'name':{'type':Sequelize[_0x90c0('0x1')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x90c0('0x1')]},'remoteUri':{'type':Sequelize[_0x90c0('0x1')]},'tenantId':{'type':Sequelize[_0x90c0('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x90c0('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f59a963..f429f42 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 _0x5ec6=['pick','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','ticketType','Incident','description','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','username','password','remoteUri','tenantId','clientId','slice','substring','%s/api/data/v9.0/','https://login.microsoftonline.com/','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','forEach','isNil','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Value','DisplayName','Label','GET',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','json','count','offset','limit','status','apply','reject','save','update','destroy','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Account','include','findAll','show','params','rawAttributes','create','body','find','getConfigurations','findOne','Dynamics365Configuration'];(function(_0x4bbe1e,_0x4056f1){var _0x4b5543=function(_0x2d839f){while(--_0x2d839f){_0x4bbe1e['push'](_0x4bbe1e['shift']());}};_0x4b5543(++_0x4056f1);}(_0x5ec6,0x7f));var _0x65ec=function(_0x247a56,_0x1a2273){_0x247a56=_0x247a56-0x0;var _0xbd0efe=_0x5ec6[_0x247a56];return _0xbd0efe;};'use strict';var pdf=require(_0x65ec('0x0'));var emlformat=require(_0x65ec('0x1'));var rimraf=require(_0x65ec('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65ec('0x3'));var rp=require('request-promise');var moment=require(_0x65ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65ec('0x5'));var util=require('util');var path=require(_0x65ec('0x6'));var sox=require('sox');var csv=require(_0x65ec('0x7'));var ejs=require(_0x65ec('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0x7'));var querystring=require(_0x65ec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xe'));var hardwareService=require(_0x65ec('0xf'));var logger=require('../../config/logger')(_0x65ec('0x10'));var utils=require(_0x65ec('0x11'));var config=require('../../config/environment');var db=require(_0x65ec('0x12'))['db'];var integrations=require(_0x65ec('0x13'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x14')][_0x65ec('0x15')]({'port':0x232a});function checkPasswordPattern(_0x411a7b,_0x2b1c1a,_0x2c8314){if(_0x2c8314){var _0x434e20=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x434e20[_0x65ec('0x16')](_0x2b1c1a)){return _0x411a7b;}else{throw new db[(_0x65ec('0x17'))]['ValidationError'](_0x65ec('0x18'));}}else{return _0x411a7b;}}function respondWithRpcPromise(_0x3ed6f7,_0x35d06b,_0x4bbe88,_0x5a0442){return new BPromise(function(_0x25cdd4,_0x461bd3){var _0xa597d4=_0x5a0442||client;return _0xa597d4['request'](_0x3ed6f7,_0x4bbe88)[_0x65ec('0x19')](function(_0x286eac){logger[_0x65ec('0x1a')](_0x65ec('0x1b'),_0x35d06b,_0x65ec('0x1c'));logger[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x35d06b,_0x65ec('0x1c'),JSON[_0x65ec('0x1f')](_0x286eac));if(_0x286eac[_0x65ec('0x20')]){if(_0x286eac[_0x65ec('0x20')][_0x65ec('0x21')]===0x1f4){logger[_0x65ec('0x20')](_0x65ec('0x1b'),_0x35d06b,_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);return _0x461bd3(_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);}logger[_0x65ec('0x20')]('Dynamics365Account,\x20%s,\x20%s',_0x35d06b,_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);return _0x25cdd4(_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);}else{logger[_0x65ec('0x1a')](_0x65ec('0x1b'),_0x35d06b,_0x65ec('0x1c'));_0x25cdd4(_0x286eac['result'][_0x65ec('0x22')]);}})[_0x65ec('0x23')](function(_0x13ac27){logger[_0x65ec('0x20')](_0x65ec('0x1b'),_0x35d06b,_0x13ac27);_0x461bd3(_0x13ac27);});});}function respondWithStatusCode(_0x156793,_0x21426b){_0x21426b=_0x21426b||0xcc;return function(_0xf5adc7){if(_0xf5adc7){return _0x156793[_0x65ec('0x24')](_0x21426b);}return _0x156793['status'](_0x21426b)[_0x65ec('0x25')]();};}function respondWithResult(_0x30f0cf,_0x251831){_0x251831=_0x251831||0xc8;return function(_0x23b1a3){if(_0x23b1a3){return _0x30f0cf['status'](_0x251831)[_0x65ec('0x26')](_0x23b1a3);}};}function respondWithFilteredResult(_0x588fe4,_0x37489f){return function(_0x1ada47){if(_0x1ada47){var _0x1d0b5c=_0x1ada47[_0x65ec('0x27')],_0x30366c=_0x37489f[_0x65ec('0x28')],_0x14431d=_0x37489f[_0x65ec('0x28')]+_0x37489f[_0x65ec('0x29')],_0x46d4c1;if(_0x14431d>=_0x1d0b5c){_0x14431d=_0x1d0b5c;_0x46d4c1=0xc8;}else{_0x46d4c1=0xce;}_0x588fe4[_0x65ec('0x2a')](_0x46d4c1);return _0x588fe4['set']('Content-Range',_0x30366c+'-'+_0x14431d+'/'+_0x1d0b5c)[_0x65ec('0x26')](_0x1ada47);}return null;};}function patchUpdates(_0x5084af){return function(_0x2e13e2){try{jsonpatch[_0x65ec('0x2b')](_0x2e13e2,_0x5084af,!![]);}catch(_0x52dec0){return BPromise[_0x65ec('0x2c')](_0x52dec0);}return _0x2e13e2[_0x65ec('0x2d')]();};}function saveUpdates(_0x3a75e7,_0x3c8dd7){return function(_0x491dc6){if(_0x491dc6){return _0x491dc6[_0x65ec('0x2e')](_0x3a75e7)[_0x65ec('0x19')](function(_0x20099b){return _0x20099b;});}return null;};}function removeEntity(_0x44dda7,_0x3e4f4f){return function(_0x3826fa){if(_0x3826fa){return _0x3826fa[_0x65ec('0x2f')]()[_0x65ec('0x19')](function(){_0x44dda7[_0x65ec('0x2a')](0xcc)[_0x65ec('0x25')]();});}};}function handleEntityNotFound(_0x50db17,_0x6a5861){return function(_0x1e20c4){if(!_0x1e20c4){_0x50db17['sendStatus'](0x194);}return _0x1e20c4;};}function handleError(_0x11f0e8,_0x24a242){_0x24a242=_0x24a242||0x1f4;return function(_0x14bece){logger[_0x65ec('0x20')](_0x14bece[_0x65ec('0x30')]);if(_0x14bece[_0x65ec('0x31')]){delete _0x14bece[_0x65ec('0x31')];}_0x11f0e8['status'](_0x24a242)[_0x65ec('0x32')](_0x14bece);};}exports[_0x65ec('0x33')]=function(_0x40efca,_0x185447){var _0x5028e3={},_0x5d8458={},_0xaa4b9d={'count':0x0,'rows':[]};var _0x398edd=_[_0x65ec('0x34')](db['Dynamics365Account']['rawAttributes'],function(_0x279ca1){return{'name':_0x279ca1['fieldName'],'type':_0x279ca1[_0x65ec('0x35')][_0x65ec('0x36')]};});_0x5d8458['model']=_[_0x65ec('0x34')](_0x398edd,_0x65ec('0x31'));_0x5d8458[_0x65ec('0x37')]=_[_0x65ec('0x38')](_0x40efca[_0x65ec('0x37')]);_0x5d8458[_0x65ec('0x39')]=_[_0x65ec('0x3a')](_0x5d8458[_0x65ec('0x3b')],_0x5d8458[_0x65ec('0x37')]);_0x5028e3[_0x65ec('0x3c')]=_[_0x65ec('0x3a')](_0x5d8458['model'],qs[_0x65ec('0x3d')](_0x40efca['query'][_0x65ec('0x3d')]));_0x5028e3[_0x65ec('0x3c')]=_0x5028e3[_0x65ec('0x3c')][_0x65ec('0x3e')]?_0x5028e3[_0x65ec('0x3c')]:_0x5d8458[_0x65ec('0x3b')];if(!_0x40efca['query'][_0x65ec('0x3f')]('nolimit')){_0x5028e3['limit']=qs[_0x65ec('0x29')](_0x40efca[_0x65ec('0x37')][_0x65ec('0x29')]);_0x5028e3[_0x65ec('0x28')]=qs[_0x65ec('0x28')](_0x40efca['query']['offset']);}_0x5028e3[_0x65ec('0x40')]=qs[_0x65ec('0x41')](_0x40efca[_0x65ec('0x37')][_0x65ec('0x41')]);_0x5028e3[_0x65ec('0x42')]=qs['filters'](_['pick'](_0x40efca[_0x65ec('0x37')],_0x5d8458[_0x65ec('0x39')]));if(_0x40efca[_0x65ec('0x37')][_0x65ec('0x43')]){_0x5028e3[_0x65ec('0x42')]=_[_0x65ec('0x44')](_0x5028e3[_0x65ec('0x42')],{'$or':_['map'](_0x398edd,function(_0x2b38ee){if(_0x2b38ee[_0x65ec('0x35')]!==_0x65ec('0x45')){var _0x4fcfd4={};_0x4fcfd4[_0x2b38ee[_0x65ec('0x31')]]={'$like':'%'+_0x40efca[_0x65ec('0x37')]['filter']+'%'};return _0x4fcfd4;}})});}_0x5028e3=_[_0x65ec('0x44')]({},_0x5028e3,_0x40efca[_0x65ec('0x46')]);var _0x134778={'where':_0x5028e3[_0x65ec('0x42')]};return db[_0x65ec('0x47')]['count'](_0x134778)[_0x65ec('0x19')](function(_0x3a5d81){_0xaa4b9d[_0x65ec('0x27')]=_0x3a5d81;if(_0x40efca[_0x65ec('0x37')]['includeAll']){_0x5028e3[_0x65ec('0x48')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x65ec('0x49')](_0x5028e3);})[_0x65ec('0x19')](function(_0x3095f5){_0xaa4b9d['rows']=_0x3095f5;return _0xaa4b9d;})['then'](respondWithFilteredResult(_0x185447,_0x5028e3))[_0x65ec('0x23')](handleError(_0x185447,null));};exports[_0x65ec('0x4a')]=function(_0xf5419,_0x2111af){var _0x1b3732={'raw':![],'where':{'id':_0xf5419[_0x65ec('0x4b')]['id']}},_0xb5dfa8={};_0xb5dfa8[_0x65ec('0x3b')]=_[_0x65ec('0x38')](db[_0x65ec('0x47')][_0x65ec('0x4c')]);_0xb5dfa8[_0x65ec('0x37')]=_[_0x65ec('0x38')](_0xf5419[_0x65ec('0x37')]);_0xb5dfa8[_0x65ec('0x39')]=_[_0x65ec('0x3a')](_0xb5dfa8[_0x65ec('0x3b')],_0xb5dfa8['query']);_0x1b3732[_0x65ec('0x3c')]=_[_0x65ec('0x3a')](_0xb5dfa8['model'],qs[_0x65ec('0x3d')](_0xf5419[_0x65ec('0x37')][_0x65ec('0x3d')]));_0x1b3732['attributes']=_0x1b3732[_0x65ec('0x3c')][_0x65ec('0x3e')]?_0x1b3732[_0x65ec('0x3c')]:_0xb5dfa8['model'];if(_0xf5419[_0x65ec('0x37')]['includeAll']){_0x1b3732['include']=[{'all':!![]}];}_0x1b3732=_[_0x65ec('0x44')]({},_0x1b3732,_0xf5419[_0x65ec('0x46')]);return db[_0x65ec('0x47')]['find'](_0x1b3732)[_0x65ec('0x19')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x19')](respondWithResult(_0x2111af,null))[_0x65ec('0x23')](handleError(_0x2111af,null));};exports[_0x65ec('0x4d')]=function(_0x44c878,_0x321281){return db[_0x65ec('0x47')][_0x65ec('0x4d')](_0x44c878[_0x65ec('0x4e')],{})['then'](respondWithResult(_0x321281,0xc9))['catch'](handleError(_0x321281,null));};exports[_0x65ec('0x2e')]=function(_0x4e93a5,_0x1cbe11){if(_0x4e93a5['body']['id']){delete _0x4e93a5[_0x65ec('0x4e')]['id'];}return db[_0x65ec('0x47')][_0x65ec('0x4f')]({'where':{'id':_0x4e93a5[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x1cbe11,null))[_0x65ec('0x19')](saveUpdates(_0x4e93a5[_0x65ec('0x4e')],null))['then'](respondWithResult(_0x1cbe11,null))[_0x65ec('0x23')](handleError(_0x1cbe11,null));};exports[_0x65ec('0x2f')]=function(_0x1b5356,_0x2ccc93){return db[_0x65ec('0x47')]['find']({'where':{'id':_0x1b5356[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x2ccc93,null))[_0x65ec('0x19')](removeEntity(_0x2ccc93,null))[_0x65ec('0x23')](handleError(_0x2ccc93,null));};exports[_0x65ec('0x50')]=function(_0x3f2fd3,_0x1482c0,_0x2e81ea){var _0x4b5497={};var _0x311e78={};var _0x2307aa;var _0x12bb9b;return db[_0x65ec('0x47')][_0x65ec('0x51')]({'where':{'id':_0x3f2fd3[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x1482c0,null))['then'](function(_0x50d006){if(_0x50d006){_0x2307aa=_0x50d006;_0x311e78[_0x65ec('0x3b')]=_['keys'](db[_0x65ec('0x52')][_0x65ec('0x4c')]);_0x311e78['query']=_[_0x65ec('0x38')](_0x3f2fd3[_0x65ec('0x37')]);_0x311e78[_0x65ec('0x39')]=_[_0x65ec('0x3a')](_0x311e78[_0x65ec('0x3b')],_0x311e78[_0x65ec('0x37')]);_0x4b5497[_0x65ec('0x3c')]=_['intersection'](_0x311e78['model'],qs[_0x65ec('0x3d')](_0x3f2fd3[_0x65ec('0x37')][_0x65ec('0x3d')]));_0x4b5497['attributes']=_0x4b5497[_0x65ec('0x3c')][_0x65ec('0x3e')]?_0x4b5497[_0x65ec('0x3c')]:_0x311e78[_0x65ec('0x3b')];_0x4b5497[_0x65ec('0x40')]=qs[_0x65ec('0x41')](_0x3f2fd3[_0x65ec('0x37')]['sort']);_0x4b5497[_0x65ec('0x42')]=qs[_0x65ec('0x39')](_[_0x65ec('0x53')](_0x3f2fd3[_0x65ec('0x37')],_0x311e78[_0x65ec('0x39')]));if(_0x3f2fd3[_0x65ec('0x37')][_0x65ec('0x43')]){_0x4b5497[_0x65ec('0x42')]=_[_0x65ec('0x44')](_0x4b5497['where'],{'$or':_['map'](_0x4b5497[_0x65ec('0x3c')],function(_0x484f5a){var _0x4cc054={};_0x4cc054[_0x484f5a]={'$like':'%'+_0x3f2fd3[_0x65ec('0x37')][_0x65ec('0x43')]+'%'};return _0x4cc054;})});}_0x4b5497=_[_0x65ec('0x44')]({},_0x4b5497,_0x3f2fd3['options']);return _0x2307aa['getConfigurations'](_0x4b5497);}})[_0x65ec('0x19')](function(_0x5f0daa){if(_0x5f0daa){_0x12bb9b=_0x5f0daa['length'];if(!_0x3f2fd3['query'][_0x65ec('0x3f')]('nolimit')){_0x4b5497[_0x65ec('0x29')]=qs[_0x65ec('0x29')](_0x3f2fd3[_0x65ec('0x37')]['limit']);_0x4b5497['offset']=qs[_0x65ec('0x28')](_0x3f2fd3['query'][_0x65ec('0x28')]);}return _0x2307aa[_0x65ec('0x50')](_0x4b5497);}})[_0x65ec('0x19')](function(_0x290c68){if(_0x290c68){return _0x290c68?{'count':_0x12bb9b,'rows':_0x290c68}:null;}})[_0x65ec('0x19')](respondWithResult(_0x1482c0,null))[_0x65ec('0x23')](handleError(_0x1482c0,null));};exports[_0x65ec('0x54')]=function(_0x572b15,_0x275a42,_0x2a1212){if(_0x572b15['body']['id']){delete _0x572b15[_0x65ec('0x4e')]['id'];}return db['Dynamics365Account'][_0x65ec('0x51')]({'where':{'id':_0x572b15[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x275a42,null))[_0x65ec('0x19')](function(_0x5ac286){if(_0x5ac286){_0x572b15[_0x65ec('0x4e')]['AccountId']=_0x5ac286['id'];_0x572b15[_0x65ec('0x4e')][_0x65ec('0x55')]=integrations[_0x65ec('0x56')](_0x572b15[_0x65ec('0x4e')]['channel'],_0x572b15['body']['type']);_0x572b15[_0x65ec('0x4e')][_0x65ec('0x57')]=integrations[_0x65ec('0x58')](_0x572b15[_0x65ec('0x4e')][_0x65ec('0x59')],_0x572b15[_0x65ec('0x4e')][_0x65ec('0x35')]);return db[_0x65ec('0x52')][_0x65ec('0x4d')](_0x572b15[_0x65ec('0x4e')],{'include':[{'model':db[_0x65ec('0x5a')],'as':_0x65ec('0x55')},{'model':db[_0x65ec('0x5a')],'as':'Descriptions'}]});}return null;})[_0x65ec('0x19')](respondWithResult(_0x275a42,null))[_0x65ec('0x23')](handleError(_0x275a42,null));};exports[_0x65ec('0x5b')]=function(_0x46906e,_0x7dbd56,_0x12656c){var _0x1541fc=_0x46906e[_0x65ec('0x37')][_0x65ec('0x5c')];var _0x26ac0e=_0x1541fc==='incident'?_0x65ec('0x5d'):'PhoneCall';var _0x5b559b='';var _0x1c7db0='';var _0x1b73d8='';var _0x272432='';var _0x80ff05='';var _0x1641e0='';var _0x24102d='';var _0x1178e0='';var _0x9a2d65=['title',_0x65ec('0x5e'),'customerid',_0x65ec('0x5f'),_0x65ec('0x60'),_0x65ec('0x61'),'phonenumber',_0x65ec('0x62'),_0x65ec('0x63'),_0x65ec('0x64')];var _0x207dcf=[_0x65ec('0x65'),_0x65ec('0x66'),_0x65ec('0x67'),'billedserviceunits',_0x65ec('0x68'),_0x65ec('0x69'),_0x65ec('0x6a'),_0x65ec('0x6b'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x65ec('0x6c'),_0x65ec('0x6d'),_0x65ec('0x6e'),_0x65ec('0x6f'),_0x65ec('0x70'),_0x65ec('0x71'),'customeridtype',_0x65ec('0x72'),_0x65ec('0x73'),_0x65ec('0x74'),_0x65ec('0x75'),_0x65ec('0x76'),_0x65ec('0x77'),_0x65ec('0x78'),_0x65ec('0x79'),'followupby',_0x65ec('0x7a'),_0x65ec('0x7b'),'kbarticleidname',_0x65ec('0x7c'),_0x65ec('0x7d'),_0x65ec('0x7e'),_0x65ec('0x7f'),_0x65ec('0x80'),_0x65ec('0x81'),_0x65ec('0x82'),_0x65ec('0x83'),_0x65ec('0x84'),_0x65ec('0x85'),'msdyn_iotalertname','numberofchildincidents',_0x65ec('0x86'),_0x65ec('0x87'),_0x65ec('0x88'),'owneridtype',_0x65ec('0x89'),_0x65ec('0x8a'),_0x65ec('0x8b'),_0x65ec('0x8c'),_0x65ec('0x8d'),_0x65ec('0x8e'),_0x65ec('0x8f'),_0x65ec('0x90'),_0x65ec('0x91'),'responseby',_0x65ec('0x92'),_0x65ec('0x93'),_0x65ec('0x94'),_0x65ec('0x95'),_0x65ec('0x96'),_0x65ec('0x97'),'statecode',_0x65ec('0x98'),_0x65ec('0x99'),_0x65ec('0x9a'),_0x65ec('0x9b'),_0x65ec('0x9c'),'traversedpath','utcconversiontimezonecode',_0x65ec('0x9d')];var _0x44e353=_0x9a2d65[_0x65ec('0x9e')](_0x207dcf);return db[_0x65ec('0x47')][_0x65ec('0x51')]({'where':{'id':_0x46906e[_0x65ec('0x4b')]['id']},'attributes':['id',_0x65ec('0x9f'),_0x65ec('0xa0'),_0x65ec('0xa1'),_0x65ec('0xa2'),_0x65ec('0xa3'),'clientSecret']})[_0x65ec('0x19')](handleEntityNotFound(_0x7dbd56,null))['then'](function(_0x4eb2b2){if(_0x4eb2b2){_0x1178e0=_0x4eb2b2[_0x65ec('0xa1')];var _0x488ca4=_0x1178e0[_0x65ec('0xa4')](-0x1);if(_0x488ca4==='/'){_0x1178e0=_0x1178e0[_0x65ec('0xa5')](0x0,_0x1178e0['lastIndexOf'](_0x488ca4));}_0x24102d=util['format'](_0x65ec('0xa6'),_0x1178e0);var _0x1ebb2c={'method':'POST','uri':_0x65ec('0xa7')+_0x4eb2b2[_0x65ec('0xa2')]+'/oauth2/token','form':{'client_id':_0x4eb2b2[_0x65ec('0xa3')],'resource':_0x1178e0,'username':_0x4eb2b2[_0x65ec('0x9f')],'password':_0x4eb2b2[_0x65ec('0xa0')],'grant_type':_0x65ec('0xa0'),'client_secret':_0x4eb2b2['clientSecret']},'json':!![]};return rp(_0x1ebb2c);}})[_0x65ec('0x19')](function(_0x1aad46){_0x1641e0=_0x1aad46['access_token'];var _0x17cca0={'method':'GET','uri':encodeURI(_0x24102d+_0x65ec('0xa8')+_0x26ac0e+'\x27'),'headers':{'Authorization':_0x65ec('0xa9')+_0x1641e0,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0x17cca0);})['then'](function(_0x48c1a1){var _0x1538f2=_0x48c1a1[_0x65ec('0xab')][0x0];var _0x460044=_0x1538f2[_0x65ec('0xac')];var _0x2ed8ee={'method':'GET','uri':_0x24102d+_0x65ec('0xad')+_0x460044+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x1641e0,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0x2ed8ee);})['then'](function(_0x102e66){_0x5b559b=_0x102e66;_0x1c7db0=_0x5b559b[_0x65ec('0xae')];_0x1c7db0=_['remove'](_0x1c7db0,function(_0x5a6d14){return!_0x44e353['includes'](_0x5a6d14[_0x65ec('0xaf')]);});var _0x37715a=[];var _0x3e9581=[];_0x1c7db0['forEach'](function(_0x4ba8c9){if(_0x4ba8c9['@odata.type']){var _0x353c7c=_0x4ba8c9[_0x65ec('0xb0')][_0x65ec('0xa5')](_0x4ba8c9[_0x65ec('0xb0')][_0x65ec('0xb1')]('.')+0x1);if(_0x353c7c===_0x65ec('0xb2')){_0x37715a[_0x65ec('0xb3')](getSelectList(_0x24102d,_0x1541fc,_0x3e9581,_0x5b559b[_0x65ec('0xac')],_0x4ba8c9[_0x65ec('0xac')],_0x1641e0));}}});return Promise[_0x65ec('0xb4')](_0x37715a);})[_0x65ec('0x19')](function(_0x53d9f1){_0x1b73d8=_0x53d9f1[0x0];var _0x4c1c20=[];var _0x3e459e=[];_0x1c7db0[_0x65ec('0xb5')](function(_0x77b7b9){if(!_[_0x65ec('0xb6')](_0x77b7b9[_0x65ec('0xb0')])){var _0x5c6a76=_0x77b7b9[_0x65ec('0xb0')][_0x65ec('0xa5')](_0x77b7b9[_0x65ec('0xb0')]['lastIndexOf']('.')+0x1);if(_0x5c6a76==='BooleanAttributeMetadata'){_0x4c1c20[_0x65ec('0xb3')](getBooleanList(_0x24102d,_0x1541fc,_0x3e459e,_0x5b559b[_0x65ec('0xac')],_0x77b7b9[_0x65ec('0xac')],_0x1641e0));}}});return Promise[_0x65ec('0xb4')](_0x4c1c20);})[_0x65ec('0x19')](function(_0xb4eaa0){_0x272432=_0xb4eaa0[0x0];var _0x19b1a9=[];var _0x426631=[];_0x1c7db0['forEach'](function(_0x6c71a){if(_0x6c71a[_0x65ec('0xb0')]){var _0x158561=_0x6c71a[_0x65ec('0xb0')][_0x65ec('0xa5')](_0x6c71a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x158561==='StringAttributeMetadata'||_0x158561===_0x65ec('0xb7')||_0x158561===_0x65ec('0xb8')||_0x158561===_0x65ec('0xb9')||_0x158561===_0x65ec('0xba')||_0x158561===_0x65ec('0xbb')||_0x158561===_0x65ec('0xbc')||_0x158561===_0x65ec('0xbd')||_0x158561===_0x65ec('0xbe')||_0x158561===_0x65ec('0xbf')){_0x19b1a9[_0x65ec('0xb3')](getInputList(_0x24102d,_0x1541fc,_0x158561,_0x426631,_0x5b559b['MetadataId'],_0x6c71a[_0x65ec('0xac')],_0x1641e0));}}});return Promise[_0x65ec('0xb4')](_0x19b1a9);})[_0x65ec('0x19')](function(_0x3b4c80){_0x80ff05=_0x3b4c80[0x0];var _0x4c2b6e=_0x1b73d8[_0x65ec('0x9e')](_0x272432)[_0x65ec('0x9e')](_0x80ff05);var _0x42af46={'count':_0x4c2b6e[_0x65ec('0x3e')],'rows':_0x4c2b6e};return _0x42af46;})[_0x65ec('0x19')](respondWithResult(_0x7dbd56,null))[_0x65ec('0x23')](function(_0x4eb6ae){var _0x25c060=_0x46906e[_0x65ec('0x37')][_0x65ec('0x16')]?0x1f4:_0x4eb6ae[_0x65ec('0xc0')]||0x1f4;logger[_0x65ec('0x20')](_0x4eb6ae[_0x65ec('0x30')]);delete _0x4eb6ae[_0x65ec('0x31')];if(_0x25c060===0x191){_0x25c060=0x190;}_0x7dbd56[_0x65ec('0x2a')](_0x25c060)['send'](_0x46906e['query'][_0x65ec('0x16')]?{'message':_0x65ec('0xc1'),'statusCode':_0x4eb6ae[_0x65ec('0xc0')]}:_0x4eb6ae);});};function getSelectList(_0x5782c8,_0x2a61aa,_0x152af1,_0x41daf9,_0x50953a,_0x437d98){var _0x2e4efe={'method':'GET','uri':_0x5782c8+'EntityDefinitions('+_0x41daf9+_0x65ec('0xc2')+_0x50953a+_0x65ec('0xc3')+_0x65ec('0xc4'),'headers':{'Authorization':_0x65ec('0xa9')+_0x437d98,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0x2e4efe)[_0x65ec('0x19')](function(_0x375a4a){var _0x514d0f=[];var _0x554ef2=_0x375a4a[_0x65ec('0xc5')][_0x65ec('0xc6')];_0x554ef2[_0x65ec('0xb5')](function(_0x20f110){_0x514d0f[_0x65ec('0xb3')]({'name':_0x20f110['Label']['UserLocalizedLabel']['Label'],'value':String(_0x20f110[_0x65ec('0xc7')])});});var _0xdd087b={'id':_0x2a61aa+'_'+_0x375a4a[_0x65ec('0xaf')],'name':_0x375a4a[_0x65ec('0xc8')]['UserLocalizedLabel'][_0x65ec('0xc9')],'custom':![],'options':_0x514d0f};_0x152af1[_0x65ec('0xb3')](_0xdd087b);return _0x152af1;});}function getBooleanList(_0x21e9a3,_0xce7268,_0x39fbef,_0xf3ed40,_0x582a46,_0x449ecc){var _0x13dfa5={'method':_0x65ec('0xca'),'uri':_0x21e9a3+_0x65ec('0xad')+_0xf3ed40+_0x65ec('0xc2')+_0x582a46+_0x65ec('0xcb'),'headers':{'Authorization':_0x65ec('0xa9')+_0x449ecc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x13dfa5)[_0x65ec('0x19')](function(_0x30acc6){var _0x3f6c52=[];_0x3f6c52[_0x65ec('0xb3')]({'name':_0x30acc6[_0x65ec('0xc5')]['TrueOption'][_0x65ec('0xc9')]['UserLocalizedLabel'][_0x65ec('0xc9')],'value':_0x65ec('0xcc')},{'name':_0x30acc6[_0x65ec('0xc5')][_0x65ec('0xcd')][_0x65ec('0xc9')]['UserLocalizedLabel'][_0x65ec('0xc9')],'value':_0x65ec('0xce')});var _0x366b59={'id':_0xce7268+'_'+_0x30acc6[_0x65ec('0xaf')],'name':_0x30acc6[_0x65ec('0xc8')][_0x65ec('0xcf')][_0x65ec('0xc9')],'custom':![],'options':_0x3f6c52};_0x39fbef[_0x65ec('0xb3')](_0x366b59);return _0x39fbef;});}function getInputList(_0x50dc25,_0x1518af,_0xf526af,_0x5ec387,_0x542aa4,_0x42ff1a,_0x54646d){var _0xcfe567={'method':_0x65ec('0xca'),'uri':_0x50dc25+_0x65ec('0xad')+_0x542aa4+')/Attributes('+_0x42ff1a+_0x65ec('0xd0')+_0xf526af+_0x65ec('0xd1'),'headers':{'Authorization':_0x65ec('0xa9')+_0x54646d,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0xcfe567)[_0x65ec('0x19')](function(_0x3be847){var _0x7ad137={'id':_0x1518af+'_'+_0x3be847[_0x65ec('0xaf')],'name':_0x3be847[_0x65ec('0xc8')]['UserLocalizedLabel']?_0x3be847[_0x65ec('0xc8')]['UserLocalizedLabel'][_0x65ec('0xc9')]:_0x3be847[_0x65ec('0xaf')],'custom':![],'options':[]};_0x5ec387[_0x65ec('0xb3')](_0x7ad137);return _0x5ec387;});} \ No newline at end of file +var _0x03be=['Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(','OptionSet','TrueOption','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','count','offset','limit','set','Content-Range','json','reject','save','update','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','options','include','findAll','rows','catch','params','length','includeAll','create','body','find','getConfigurations','findOne','Dynamics365Configuration','pick','addConfiguration','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','billedserviceunits','contractdetailidname','contractidname','createdbyexternalpartyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','primarycontactidname','primarycontactidyominame','productidname','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','versionnumber','concat','password','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','/oauth2/token','access_token','GET','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','Wrong\x20credentials','statusCode',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options'];(function(_0x457fc6,_0x2b07c5){var _0x7c5506=function(_0x21184f){while(--_0x21184f){_0x457fc6['push'](_0x457fc6['shift']());}};_0x7c5506(++_0x2b07c5);}(_0x03be,0xe8));var _0xe03b=function(_0x52b69e,_0x3f3046){_0x52b69e=_0x52b69e-0x0;var _0x53ca7d=_0x03be[_0x52b69e];return _0x53ca7d;};'use strict';var pdf=require(_0xe03b('0x0'));var emlformat=require(_0xe03b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe03b('0x2'));var rp=require(_0xe03b('0x3'));var moment=require(_0xe03b('0x4'));var BPromise=require(_0xe03b('0x5'));var Mustache=require('mustache');var util=require(_0xe03b('0x6'));var path=require(_0xe03b('0x7'));var sox=require(_0xe03b('0x8'));var csv=require(_0xe03b('0x9'));var ejs=require(_0xe03b('0xa'));var fs=require('fs');var _=require(_0xe03b('0xb'));var squel=require(_0xe03b('0xc'));var crypto=require(_0xe03b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe03b('0x9'));var querystring=require(_0xe03b('0xe'));var Papa=require(_0xe03b('0xf'));var Redis=require(_0xe03b('0x10'));var authService=require(_0xe03b('0x11'));var qs=require(_0xe03b('0x12'));var as=require(_0xe03b('0x13'));var hardwareService=require(_0xe03b('0x14'));var logger=require(_0xe03b('0x15'))(_0xe03b('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe03b('0x17'))['db'];var integrations=require(_0xe03b('0x18'));var jayson=require(_0xe03b('0x19'));var client=jayson[_0xe03b('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x58a3f3,_0x332cd1,_0x30c737){if(_0x30c737){var _0x369958=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x369958[_0xe03b('0x1b')](_0x332cd1)){return _0x58a3f3;}else{throw new db[(_0xe03b('0x1c'))][(_0xe03b('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x58a3f3;}}function respondWithRpcPromise(_0x4993c0,_0x1a6b70,_0x2df89e,_0xd3e70d){return new BPromise(function(_0x4b0d3a,_0x56a256){var _0x2aeb21=_0xd3e70d||client;return _0x2aeb21[_0xe03b('0x1e')](_0x4993c0,_0x2df89e)[_0xe03b('0x1f')](function(_0x50b6d5){logger[_0xe03b('0x20')](_0xe03b('0x21'),_0x1a6b70,_0xe03b('0x22'));logger[_0xe03b('0x23')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x1a6b70,'request\x20sent',JSON[_0xe03b('0x24')](_0x50b6d5));if(_0x50b6d5['error']){if(_0x50b6d5['error'][_0xe03b('0x25')]===0x1f4){logger[_0xe03b('0x26')](_0xe03b('0x21'),_0x1a6b70,_0x50b6d5[_0xe03b('0x26')][_0xe03b('0x27')]);return _0x56a256(_0x50b6d5['error'][_0xe03b('0x27')]);}logger[_0xe03b('0x26')](_0xe03b('0x21'),_0x1a6b70,_0x50b6d5[_0xe03b('0x26')]['message']);return _0x4b0d3a(_0x50b6d5[_0xe03b('0x26')][_0xe03b('0x27')]);}else{logger[_0xe03b('0x20')](_0xe03b('0x21'),_0x1a6b70,'request\x20sent');_0x4b0d3a(_0x50b6d5[_0xe03b('0x28')][_0xe03b('0x27')]);}})['catch'](function(_0x42a61e){logger[_0xe03b('0x26')](_0xe03b('0x21'),_0x1a6b70,_0x42a61e);_0x56a256(_0x42a61e);});});}function respondWithStatusCode(_0x3da079,_0x22e515){_0x22e515=_0x22e515||0xcc;return function(_0x3d5967){if(_0x3d5967){return _0x3da079[_0xe03b('0x29')](_0x22e515);}return _0x3da079['status'](_0x22e515)[_0xe03b('0x2a')]();};}function respondWithResult(_0x403bad,_0x5eaeff){_0x5eaeff=_0x5eaeff||0xc8;return function(_0x1ac6ab){if(_0x1ac6ab){return _0x403bad[_0xe03b('0x2b')](_0x5eaeff)['json'](_0x1ac6ab);}};}function respondWithFilteredResult(_0x1107b3,_0x2de6b7){return function(_0x3e8caf){if(_0x3e8caf){var _0x381c8f=_0x3e8caf[_0xe03b('0x2c')],_0x335437=_0x2de6b7[_0xe03b('0x2d')],_0x237739=_0x2de6b7[_0xe03b('0x2d')]+_0x2de6b7[_0xe03b('0x2e')],_0x865650;if(_0x237739>=_0x381c8f){_0x237739=_0x381c8f;_0x865650=0xc8;}else{_0x865650=0xce;}_0x1107b3['status'](_0x865650);return _0x1107b3[_0xe03b('0x2f')](_0xe03b('0x30'),_0x335437+'-'+_0x237739+'/'+_0x381c8f)[_0xe03b('0x31')](_0x3e8caf);}return null;};}function patchUpdates(_0x5df83c){return function(_0xa1db0f){try{jsonpatch['apply'](_0xa1db0f,_0x5df83c,!![]);}catch(_0x25bcbd){return BPromise[_0xe03b('0x32')](_0x25bcbd);}return _0xa1db0f[_0xe03b('0x33')]();};}function saveUpdates(_0x3f0e62,_0x43c79f){return function(_0x2ed8a4){if(_0x2ed8a4){return _0x2ed8a4[_0xe03b('0x34')](_0x3f0e62)[_0xe03b('0x1f')](function(_0x113c57){return _0x113c57;});}return null;};}function removeEntity(_0xdedcd0,_0x70d1f1){return function(_0x49fb7d){if(_0x49fb7d){return _0x49fb7d['destroy']()['then'](function(){_0xdedcd0[_0xe03b('0x2b')](0xcc)[_0xe03b('0x2a')]();});}};}function handleEntityNotFound(_0x5e257a,_0x4a3d57){return function(_0x3a8737){if(!_0x3a8737){_0x5e257a[_0xe03b('0x29')](0x194);}return _0x3a8737;};}function handleError(_0x37bf6c,_0x258e3b){_0x258e3b=_0x258e3b||0x1f4;return function(_0x5b53c4){logger[_0xe03b('0x26')](_0x5b53c4[_0xe03b('0x35')]);if(_0x5b53c4['name']){delete _0x5b53c4[_0xe03b('0x36')];}_0x37bf6c[_0xe03b('0x2b')](_0x258e3b)[_0xe03b('0x37')](_0x5b53c4);};}exports['index']=function(_0x3cbbdc,_0x4b8149){var _0x18c29a={},_0x550e68={},_0xdd26f8={'count':0x0,'rows':[]};var _0x5c3e4e=_[_0xe03b('0x38')](db[_0xe03b('0x39')][_0xe03b('0x3a')],function(_0x564e06){return{'name':_0x564e06[_0xe03b('0x3b')],'type':_0x564e06['type'][_0xe03b('0x3c')]};});_0x550e68[_0xe03b('0x3d')]=_[_0xe03b('0x38')](_0x5c3e4e,'name');_0x550e68[_0xe03b('0x3e')]=_[_0xe03b('0x3f')](_0x3cbbdc['query']);_0x550e68[_0xe03b('0x40')]=_['intersection'](_0x550e68['model'],_0x550e68[_0xe03b('0x3e')]);_0x18c29a[_0xe03b('0x41')]=_[_0xe03b('0x42')](_0x550e68[_0xe03b('0x3d')],qs[_0xe03b('0x43')](_0x3cbbdc[_0xe03b('0x3e')]['fields']));_0x18c29a[_0xe03b('0x41')]=_0x18c29a[_0xe03b('0x41')]['length']?_0x18c29a[_0xe03b('0x41')]:_0x550e68[_0xe03b('0x3d')];if(!_0x3cbbdc['query'][_0xe03b('0x44')](_0xe03b('0x45'))){_0x18c29a[_0xe03b('0x2e')]=qs[_0xe03b('0x2e')](_0x3cbbdc[_0xe03b('0x3e')][_0xe03b('0x2e')]);_0x18c29a[_0xe03b('0x2d')]=qs[_0xe03b('0x2d')](_0x3cbbdc[_0xe03b('0x3e')][_0xe03b('0x2d')]);}_0x18c29a[_0xe03b('0x46')]=qs[_0xe03b('0x47')](_0x3cbbdc['query'][_0xe03b('0x47')]);_0x18c29a['where']=qs[_0xe03b('0x40')](_['pick'](_0x3cbbdc[_0xe03b('0x3e')],_0x550e68[_0xe03b('0x40')]));if(_0x3cbbdc['query'][_0xe03b('0x48')]){_0x18c29a[_0xe03b('0x49')]=_[_0xe03b('0x4a')](_0x18c29a[_0xe03b('0x49')],{'$or':_[_0xe03b('0x38')](_0x5c3e4e,function(_0x3a267e){if(_0x3a267e[_0xe03b('0x4b')]!=='VIRTUAL'){var _0x17c504={};_0x17c504[_0x3a267e[_0xe03b('0x36')]]={'$like':'%'+_0x3cbbdc[_0xe03b('0x3e')][_0xe03b('0x48')]+'%'};return _0x17c504;}})});}_0x18c29a=_[_0xe03b('0x4a')]({},_0x18c29a,_0x3cbbdc[_0xe03b('0x4c')]);var _0x320e6f={'where':_0x18c29a[_0xe03b('0x49')]};return db['Dynamics365Account'][_0xe03b('0x2c')](_0x320e6f)[_0xe03b('0x1f')](function(_0x3e8cae){_0xdd26f8[_0xe03b('0x2c')]=_0x3e8cae;if(_0x3cbbdc['query']['includeAll']){_0x18c29a[_0xe03b('0x4d')]=[{'all':!![]}];}return db[_0xe03b('0x39')][_0xe03b('0x4e')](_0x18c29a);})[_0xe03b('0x1f')](function(_0x11cf04){_0xdd26f8[_0xe03b('0x4f')]=_0x11cf04;return _0xdd26f8;})[_0xe03b('0x1f')](respondWithFilteredResult(_0x4b8149,_0x18c29a))[_0xe03b('0x50')](handleError(_0x4b8149,null));};exports['show']=function(_0x9991e4,_0x2fa44f){var _0x37535d={'raw':![],'where':{'id':_0x9991e4[_0xe03b('0x51')]['id']}},_0xea3d3={};_0xea3d3[_0xe03b('0x3d')]=_[_0xe03b('0x3f')](db[_0xe03b('0x39')]['rawAttributes']);_0xea3d3['query']=_[_0xe03b('0x3f')](_0x9991e4['query']);_0xea3d3[_0xe03b('0x40')]=_[_0xe03b('0x42')](_0xea3d3[_0xe03b('0x3d')],_0xea3d3[_0xe03b('0x3e')]);_0x37535d[_0xe03b('0x41')]=_[_0xe03b('0x42')](_0xea3d3[_0xe03b('0x3d')],qs['fields'](_0x9991e4['query'][_0xe03b('0x43')]));_0x37535d['attributes']=_0x37535d[_0xe03b('0x41')][_0xe03b('0x52')]?_0x37535d['attributes']:_0xea3d3[_0xe03b('0x3d')];if(_0x9991e4[_0xe03b('0x3e')][_0xe03b('0x53')]){_0x37535d['include']=[{'all':!![]}];}_0x37535d=_[_0xe03b('0x4a')]({},_0x37535d,_0x9991e4[_0xe03b('0x4c')]);return db[_0xe03b('0x39')]['find'](_0x37535d)[_0xe03b('0x1f')](handleEntityNotFound(_0x2fa44f,null))[_0xe03b('0x1f')](respondWithResult(_0x2fa44f,null))[_0xe03b('0x50')](handleError(_0x2fa44f,null));};exports[_0xe03b('0x54')]=function(_0x1e7ece,_0xf6dac9){return db[_0xe03b('0x39')][_0xe03b('0x54')](_0x1e7ece[_0xe03b('0x55')],{})[_0xe03b('0x1f')](respondWithResult(_0xf6dac9,0xc9))[_0xe03b('0x50')](handleError(_0xf6dac9,null));};exports['update']=function(_0xc63a6,_0xee3d95){if(_0xc63a6[_0xe03b('0x55')]['id']){delete _0xc63a6[_0xe03b('0x55')]['id'];}return db[_0xe03b('0x39')]['find']({'where':{'id':_0xc63a6[_0xe03b('0x51')]['id']}})[_0xe03b('0x1f')](handleEntityNotFound(_0xee3d95,null))[_0xe03b('0x1f')](saveUpdates(_0xc63a6[_0xe03b('0x55')],null))[_0xe03b('0x1f')](respondWithResult(_0xee3d95,null))[_0xe03b('0x50')](handleError(_0xee3d95,null));};exports['destroy']=function(_0x5e3f15,_0x113b8e){return db['Dynamics365Account'][_0xe03b('0x56')]({'where':{'id':_0x5e3f15['params']['id']}})[_0xe03b('0x1f')](handleEntityNotFound(_0x113b8e,null))[_0xe03b('0x1f')](removeEntity(_0x113b8e,null))['catch'](handleError(_0x113b8e,null));};exports[_0xe03b('0x57')]=function(_0x2060d0,_0x5cd964,_0x5f3654){var _0x4ee40f={};var _0x5ed37d={};var _0x767b2d;var _0x21bc1e;return db['Dynamics365Account'][_0xe03b('0x58')]({'where':{'id':_0x2060d0[_0xe03b('0x51')]['id']}})[_0xe03b('0x1f')](handleEntityNotFound(_0x5cd964,null))[_0xe03b('0x1f')](function(_0x514e57){if(_0x514e57){_0x767b2d=_0x514e57;_0x5ed37d[_0xe03b('0x3d')]=_[_0xe03b('0x3f')](db[_0xe03b('0x59')][_0xe03b('0x3a')]);_0x5ed37d[_0xe03b('0x3e')]=_[_0xe03b('0x3f')](_0x2060d0['query']);_0x5ed37d[_0xe03b('0x40')]=_['intersection'](_0x5ed37d[_0xe03b('0x3d')],_0x5ed37d[_0xe03b('0x3e')]);_0x4ee40f[_0xe03b('0x41')]=_[_0xe03b('0x42')](_0x5ed37d['model'],qs[_0xe03b('0x43')](_0x2060d0[_0xe03b('0x3e')]['fields']));_0x4ee40f[_0xe03b('0x41')]=_0x4ee40f[_0xe03b('0x41')]['length']?_0x4ee40f[_0xe03b('0x41')]:_0x5ed37d[_0xe03b('0x3d')];_0x4ee40f[_0xe03b('0x46')]=qs[_0xe03b('0x47')](_0x2060d0[_0xe03b('0x3e')][_0xe03b('0x47')]);_0x4ee40f[_0xe03b('0x49')]=qs['filters'](_[_0xe03b('0x5a')](_0x2060d0[_0xe03b('0x3e')],_0x5ed37d[_0xe03b('0x40')]));if(_0x2060d0['query'][_0xe03b('0x48')]){_0x4ee40f[_0xe03b('0x49')]=_['merge'](_0x4ee40f[_0xe03b('0x49')],{'$or':_[_0xe03b('0x38')](_0x4ee40f[_0xe03b('0x41')],function(_0x51afbf){var _0x38292f={};_0x38292f[_0x51afbf]={'$like':'%'+_0x2060d0[_0xe03b('0x3e')]['filter']+'%'};return _0x38292f;})});}_0x4ee40f=_[_0xe03b('0x4a')]({},_0x4ee40f,_0x2060d0[_0xe03b('0x4c')]);return _0x767b2d[_0xe03b('0x57')](_0x4ee40f);}})[_0xe03b('0x1f')](function(_0x44269d){if(_0x44269d){_0x21bc1e=_0x44269d[_0xe03b('0x52')];if(!_0x2060d0['query'][_0xe03b('0x44')](_0xe03b('0x45'))){_0x4ee40f[_0xe03b('0x2e')]=qs[_0xe03b('0x2e')](_0x2060d0[_0xe03b('0x3e')][_0xe03b('0x2e')]);_0x4ee40f['offset']=qs[_0xe03b('0x2d')](_0x2060d0['query'][_0xe03b('0x2d')]);}return _0x767b2d[_0xe03b('0x57')](_0x4ee40f);}})[_0xe03b('0x1f')](function(_0x12b91b){if(_0x12b91b){return _0x12b91b?{'count':_0x21bc1e,'rows':_0x12b91b}:null;}})['then'](respondWithResult(_0x5cd964,null))[_0xe03b('0x50')](handleError(_0x5cd964,null));};exports[_0xe03b('0x5b')]=function(_0x139d8c,_0x248836,_0x4eff76){if(_0x139d8c[_0xe03b('0x55')]['id']){delete _0x139d8c[_0xe03b('0x55')]['id'];}return db[_0xe03b('0x39')][_0xe03b('0x58')]({'where':{'id':_0x139d8c[_0xe03b('0x51')]['id']}})[_0xe03b('0x1f')](handleEntityNotFound(_0x248836,null))['then'](function(_0x4d9e9a){if(_0x4d9e9a){_0x139d8c[_0xe03b('0x55')]['AccountId']=_0x4d9e9a['id'];_0x139d8c[_0xe03b('0x55')][_0xe03b('0x5c')]=integrations[_0xe03b('0x5d')](_0x139d8c['body'][_0xe03b('0x5e')],_0x139d8c[_0xe03b('0x55')][_0xe03b('0x4b')]);_0x139d8c[_0xe03b('0x55')]['Descriptions']=integrations[_0xe03b('0x5f')](_0x139d8c[_0xe03b('0x55')][_0xe03b('0x5e')],_0x139d8c['body']['type']);return db['Dynamics365Configuration'][_0xe03b('0x54')](_0x139d8c[_0xe03b('0x55')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0xe03b('0x60')],'as':_0xe03b('0x61')}]});}return null;})[_0xe03b('0x1f')](respondWithResult(_0x248836,null))[_0xe03b('0x50')](handleError(_0x248836,null));};exports[_0xe03b('0x62')]=function(_0x4afbfd,_0x240c15,_0xd9db5f){var _0x575122=_0x4afbfd[_0xe03b('0x3e')][_0xe03b('0x63')];var _0x30248a=_0x575122===_0xe03b('0x64')?_0xe03b('0x65'):_0xe03b('0x66');var _0x3a2972='';var _0x159df6='';var _0x20ea0a='';var _0x56a70c='';var _0x345932='';var _0x43cdc3='';var _0x5a235e='';var _0x1b1c61='';var _0x3e81f4=[_0xe03b('0x67'),'description',_0xe03b('0x68'),'ownerid',_0xe03b('0x69'),_0xe03b('0x6a'),_0xe03b('0x6b'),_0xe03b('0x6c'),_0xe03b('0x6d'),_0xe03b('0x6e')];var _0x57a6bd=['accountidname',_0xe03b('0x6f'),'actualserviceunits',_0xe03b('0x70'),'contactidname','contactidyominame',_0xe03b('0x71'),_0xe03b('0x72'),_0xe03b('0x73'),'createdbyexternalpartyyominame','createdbyname','createdbyyominame',_0xe03b('0x74'),_0xe03b('0x75'),_0xe03b('0x76'),'customeridname',_0xe03b('0x77'),_0xe03b('0x78'),_0xe03b('0x79'),_0xe03b('0x7a'),'entityimage_timestamp',_0xe03b('0x7b'),_0xe03b('0x7c'),_0xe03b('0x7d'),_0xe03b('0x7e'),'followupby',_0xe03b('0x7f'),_0xe03b('0x80'),'kbarticleidname',_0xe03b('0x81'),_0xe03b('0x82'),_0xe03b('0x83'),_0xe03b('0x84'),_0xe03b('0x85'),_0xe03b('0x86'),_0xe03b('0x87'),_0xe03b('0x88'),'modifiedonbehalfbyyominame',_0xe03b('0x89'),_0xe03b('0x8a'),_0xe03b('0x8b'),_0xe03b('0x8c'),_0xe03b('0x8d'),_0xe03b('0x8e'),_0xe03b('0x8f'),_0xe03b('0x90'),'parentcaseidname',_0xe03b('0x91'),_0xe03b('0x92'),'prioritycodename',_0xe03b('0x93'),'productserialnumber',_0xe03b('0x94'),'resolvebykpiidname',_0xe03b('0x95'),_0xe03b('0x96'),_0xe03b('0x97'),_0xe03b('0x98'),_0xe03b('0x99'),_0xe03b('0x9a'),_0xe03b('0x9b'),_0xe03b('0x9c'),_0xe03b('0x9d'),_0xe03b('0x9e'),_0xe03b('0x9f'),_0xe03b('0xa0'),_0xe03b('0xa1'),_0xe03b('0xa2'),'utcconversiontimezonecode',_0xe03b('0xa3')];var _0x13f3ae=_0x3e81f4[_0xe03b('0xa4')](_0x57a6bd);return db[_0xe03b('0x39')][_0xe03b('0x58')]({'where':{'id':_0x4afbfd[_0xe03b('0x51')]['id']},'attributes':['id','username',_0xe03b('0xa5'),'remoteUri',_0xe03b('0xa6'),_0xe03b('0xa7'),_0xe03b('0xa8')]})['then'](handleEntityNotFound(_0x240c15,null))[_0xe03b('0x1f')](function(_0x9044a7){if(_0x9044a7){_0x1b1c61=_0x9044a7[_0xe03b('0xa9')];var _0x36cb15=_0x1b1c61[_0xe03b('0xaa')](-0x1);if(_0x36cb15==='/'){_0x1b1c61=_0x1b1c61[_0xe03b('0xab')](0x0,_0x1b1c61[_0xe03b('0xac')](_0x36cb15));}_0x5a235e=util[_0xe03b('0xad')](_0xe03b('0xae'),_0x1b1c61);var _0x4fca0a={'method':_0xe03b('0xaf'),'uri':'https://login.microsoftonline.com/'+_0x9044a7['tenantId']+_0xe03b('0xb0'),'form':{'client_id':_0x9044a7['clientId'],'resource':_0x1b1c61,'username':_0x9044a7['username'],'password':_0x9044a7[_0xe03b('0xa5')],'grant_type':_0xe03b('0xa5'),'client_secret':_0x9044a7[_0xe03b('0xa8')]},'json':!![]};return rp(_0x4fca0a);}})[_0xe03b('0x1f')](function(_0x204bc3){_0x43cdc3=_0x204bc3[_0xe03b('0xb1')];var _0x5d1369={'method':_0xe03b('0xb2'),'uri':encodeURI(_0x5a235e+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x30248a+'\x27'),'headers':{'Authorization':_0xe03b('0xb3')+_0x43cdc3,'If-None-Match':null,'OData-Version':_0xe03b('0xb4')},'json':!![]};return rp(_0x5d1369);})[_0xe03b('0x1f')](function(_0x1859dc){var _0x7a8e14=_0x1859dc[_0xe03b('0xb5')][0x0];var _0x4523e6=_0x7a8e14[_0xe03b('0xb6')];var _0x145f62={'method':_0xe03b('0xb2'),'uri':_0x5a235e+_0xe03b('0xb7')+_0x4523e6+_0xe03b('0xb8'),'headers':{'Authorization':_0xe03b('0xb3')+_0x43cdc3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x145f62);})[_0xe03b('0x1f')](function(_0x450e08){_0x3a2972=_0x450e08;_0x159df6=_0x3a2972[_0xe03b('0xb9')];_0x159df6=_[_0xe03b('0xba')](_0x159df6,function(_0x4f7492){return!_0x13f3ae[_0xe03b('0xbb')](_0x4f7492[_0xe03b('0xbc')]);});var _0x6c9601=[];var _0xaf38b=[];_0x159df6[_0xe03b('0xbd')](function(_0x369ba1){if(_0x369ba1['@odata.type']){var _0x7aa1bb=_0x369ba1[_0xe03b('0xbe')][_0xe03b('0xab')](_0x369ba1['@odata.type']['lastIndexOf']('.')+0x1);if(_0x7aa1bb===_0xe03b('0xbf')){_0x6c9601[_0xe03b('0xc0')](getSelectList(_0x5a235e,_0x575122,_0xaf38b,_0x3a2972[_0xe03b('0xb6')],_0x369ba1[_0xe03b('0xb6')],_0x43cdc3));}}});return Promise[_0xe03b('0xc1')](_0x6c9601);})[_0xe03b('0x1f')](function(_0x4847fe){_0x20ea0a=_0x4847fe[0x0];var _0x35205f=[];var _0x2a9d62=[];_0x159df6[_0xe03b('0xbd')](function(_0x15a1a4){if(!_[_0xe03b('0xc2')](_0x15a1a4[_0xe03b('0xbe')])){var _0x186eed=_0x15a1a4['@odata.type'][_0xe03b('0xab')](_0x15a1a4[_0xe03b('0xbe')][_0xe03b('0xac')]('.')+0x1);if(_0x186eed===_0xe03b('0xc3')){_0x35205f[_0xe03b('0xc0')](getBooleanList(_0x5a235e,_0x575122,_0x2a9d62,_0x3a2972[_0xe03b('0xb6')],_0x15a1a4['MetadataId'],_0x43cdc3));}}});return Promise['all'](_0x35205f);})[_0xe03b('0x1f')](function(_0x3cf8c9){_0x56a70c=_0x3cf8c9[0x0];var _0x499b46=[];var _0x697297=[];_0x159df6[_0xe03b('0xbd')](function(_0x33837b){if(_0x33837b[_0xe03b('0xbe')]){var _0x1c61d0=_0x33837b['@odata.type'][_0xe03b('0xab')](_0x33837b[_0xe03b('0xbe')][_0xe03b('0xac')]('.')+0x1);if(_0x1c61d0===_0xe03b('0xc4')||_0x1c61d0===_0xe03b('0xc5')||_0x1c61d0===_0xe03b('0xc6')||_0x1c61d0===_0xe03b('0xc7')||_0x1c61d0===_0xe03b('0xc8')||_0x1c61d0===_0xe03b('0xc9')||_0x1c61d0===_0xe03b('0xca')||_0x1c61d0==='EntityNameAttributeMetadata'||_0x1c61d0===_0xe03b('0xcb')||_0x1c61d0===_0xe03b('0xcc')){_0x499b46[_0xe03b('0xc0')](getInputList(_0x5a235e,_0x575122,_0x1c61d0,_0x697297,_0x3a2972['MetadataId'],_0x33837b[_0xe03b('0xb6')],_0x43cdc3));}}});return Promise[_0xe03b('0xc1')](_0x499b46);})[_0xe03b('0x1f')](function(_0x3a9c51){_0x345932=_0x3a9c51[0x0];var _0x31c2df=_0x20ea0a['concat'](_0x56a70c)[_0xe03b('0xa4')](_0x345932);var _0xb1498a={'count':_0x31c2df['length'],'rows':_0x31c2df};return _0xb1498a;})[_0xe03b('0x1f')](respondWithResult(_0x240c15,null))[_0xe03b('0x50')](function(_0x18de73){var _0x40d1e0=_0x4afbfd[_0xe03b('0x3e')][_0xe03b('0x1b')]?0x1f4:_0x18de73['statusCode']||0x1f4;logger[_0xe03b('0x26')](_0x18de73['stack']);delete _0x18de73[_0xe03b('0x36')];if(_0x40d1e0===0x191){_0x40d1e0=0x190;}_0x240c15['status'](_0x40d1e0)[_0xe03b('0x37')](_0x4afbfd[_0xe03b('0x3e')]['test']?{'message':_0xe03b('0xcd'),'statusCode':_0x18de73[_0xe03b('0xce')]}:_0x18de73);});};function getSelectList(_0x5f45bc,_0x2040bd,_0x59c364,_0x41286a,_0x8b73f3,_0x9b00df){var _0x3bbc3b={'method':'GET','uri':_0x5f45bc+_0xe03b('0xb7')+_0x41286a+')/Attributes('+_0x8b73f3+_0xe03b('0xcf')+_0xe03b('0xd0'),'headers':{'Authorization':_0xe03b('0xb3')+_0x9b00df,'If-None-Match':null,'OData-Version':_0xe03b('0xb4')},'json':!![]};return rp(_0x3bbc3b)['then'](function(_0x493362){var _0x3d8045=[];var _0x281757=_0x493362['OptionSet'][_0xe03b('0xd1')];_0x281757[_0xe03b('0xbd')](function(_0x3f35c5){_0x3d8045['push']({'name':_0x3f35c5[_0xe03b('0xd2')][_0xe03b('0xd3')][_0xe03b('0xd2')],'value':String(_0x3f35c5[_0xe03b('0xd4')])});});var _0x4fb558={'id':_0x2040bd+'_'+_0x493362[_0xe03b('0xbc')],'name':_0x493362[_0xe03b('0xd5')][_0xe03b('0xd3')][_0xe03b('0xd2')],'custom':![],'options':_0x3d8045};_0x59c364[_0xe03b('0xc0')](_0x4fb558);return _0x59c364;});}function getBooleanList(_0x51e32c,_0x5d8457,_0xe7ce14,_0x193ab5,_0x4b02b5,_0x429329){var _0x170c01={'method':_0xe03b('0xb2'),'uri':_0x51e32c+_0xe03b('0xb7')+_0x193ab5+_0xe03b('0xd6')+_0x4b02b5+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xe03b('0xb3')+_0x429329,'If-None-Match':null,'OData-Version':_0xe03b('0xb4')},'json':!![]};return rp(_0x170c01)[_0xe03b('0x1f')](function(_0x43284b){var _0xa7144f=[];_0xa7144f['push']({'name':_0x43284b[_0xe03b('0xd7')][_0xe03b('0xd8')][_0xe03b('0xd2')]['UserLocalizedLabel'][_0xe03b('0xd2')],'value':'true'},{'name':_0x43284b[_0xe03b('0xd7')][_0xe03b('0xd9')][_0xe03b('0xd2')][_0xe03b('0xd3')]['Label'],'value':_0xe03b('0xda')});var _0x397471={'id':_0x5d8457+'_'+_0x43284b['LogicalName'],'name':_0x43284b[_0xe03b('0xd5')][_0xe03b('0xd3')][_0xe03b('0xd2')],'custom':![],'options':_0xa7144f};_0xe7ce14[_0xe03b('0xc0')](_0x397471);return _0xe7ce14;});}function getInputList(_0x231eea,_0x562381,_0x210efc,_0x4d6c50,_0x243d9a,_0x5c525f,_0x3a4f07){var _0x4920ec={'method':'GET','uri':_0x231eea+_0xe03b('0xb7')+_0x243d9a+')/Attributes('+_0x5c525f+_0xe03b('0xdb')+_0x210efc+_0xe03b('0xdc'),'headers':{'Authorization':_0xe03b('0xb3')+_0x3a4f07,'If-None-Match':null,'OData-Version':_0xe03b('0xb4')},'json':!![]};return rp(_0x4920ec)[_0xe03b('0x1f')](function(_0x5e7083){var _0x310943={'id':_0x562381+'_'+_0x5e7083[_0xe03b('0xbc')],'name':_0x5e7083[_0xe03b('0xd5')]['UserLocalizedLabel']?_0x5e7083['DisplayName']['UserLocalizedLabel'][_0xe03b('0xd2')]:_0x5e7083[_0xe03b('0xbc')],'custom':![],'options':[]};_0x4d6c50[_0xe03b('0xc0')](_0x310943);return _0x4d6c50;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 9cc82c8..f90750c 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 _0xe2ee=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','int_dynamics365_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2ee,0xfc));var _0xee2e=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xe2ee[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xee2e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2e('0x1'));var moment=require(_0xee2e('0x2'));var BPromise=require(_0xee2e('0x3'));var rp=require(_0xee2e('0x4'));var fs=require('fs');var path=require(_0xee2e('0x5'));var rimraf=require(_0xee2e('0x6'));var config=require(_0xee2e('0x7'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5230d8,_0x4d7982){return _0x5230d8['define']('Dynamics365Account',attributes,{'tableName':_0xee2e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b19=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./intDynamics365Account.attributes','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util'];(function(_0x468698,_0xa38199){var _0x14f69e=function(_0x5ef944){while(--_0x5ef944){_0x468698['push'](_0x468698['shift']());}};_0x14f69e(++_0xa38199);}(_0x1b19,0x172));var _0x91b1=function(_0x2cc7ed,_0x1dc822){_0x2cc7ed=_0x2cc7ed-0x0;var _0x3ba023=_0x1b19[_0x2cc7ed];return _0x3ba023;};'use strict';var _=require(_0x91b1('0x0'));var util=require(_0x91b1('0x1'));var logger=require(_0x91b1('0x2'))('api');var moment=require(_0x91b1('0x3'));var BPromise=require(_0x91b1('0x4'));var rp=require(_0x91b1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x91b1('0x6'));var attributes=require(_0x91b1('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x91b1('0x8')]=function(_0x11c384,_0x3728ac){return _0x11c384[_0x91b1('0x9')](_0x91b1('0xa'),attributes,{'tableName':_0x91b1('0xb'),'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 c69ad8c..a5d80f5 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 _0x1c23=['info','result','catch','GetDynamics365Account','findAll','options','raw','limit','include','map','model','attributes','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5989af,_0x325855){var _0x1dc945=function(_0x4e86e4){while(--_0x4e86e4){_0x5989af['push'](_0x5989af['shift']());}};_0x1dc945(++_0x325855);}(_0x1c23,0x1d5));var _0x31c2=function(_0x3431f1,_0xf12a9){_0x3431f1=_0x3431f1-0x0;var _0x50b1ed=_0x1c23[_0x3431f1];return _0x50b1ed;};'use strict';var _=require(_0x31c2('0x0'));var util=require(_0x31c2('0x1'));var moment=require(_0x31c2('0x2'));var BPromise=require(_0x31c2('0x3'));var rs=require(_0x31c2('0x4'));var fs=require('fs');var Redis=require(_0x31c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x31c2('0x6'));var logger=require(_0x31c2('0x7'))('rpc');var config=require(_0x31c2('0x8'));var jayson=require(_0x31c2('0x9'));var client=jayson[_0x31c2('0xa')][_0x31c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ffcfb,_0x5c3007,_0x3b8308){return new BPromise(function(_0x2f98e5,_0x37d859){return client[_0x31c2('0xc')](_0x2ffcfb,_0x3b8308)[_0x31c2('0xd')](function(_0x55c11e){logger['info'](_0x31c2('0xe'),_0x5c3007,_0x31c2('0xf'));logger[_0x31c2('0x10')](_0x31c2('0x11'),_0x5c3007,_0x31c2('0xf'),JSON[_0x31c2('0x12')](_0x55c11e));if(_0x55c11e['error']){if(_0x55c11e[_0x31c2('0x13')]['code']===0x1f4){logger[_0x31c2('0x13')](_0x31c2('0xe'),_0x5c3007,_0x55c11e[_0x31c2('0x13')]['message']);return _0x37d859(_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);}logger['error'](_0x31c2('0xe'),_0x5c3007,_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);return _0x2f98e5(_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);}else{logger[_0x31c2('0x15')](_0x31c2('0xe'),_0x5c3007,_0x31c2('0xf'));_0x2f98e5(_0x55c11e[_0x31c2('0x16')][_0x31c2('0x14')]);}})[_0x31c2('0x17')](function(_0x5660fb){logger['error'](_0x31c2('0xe'),_0x5c3007,_0x5660fb);_0x37d859(_0x5660fb);});});}exports[_0x31c2('0x18')]=function(_0x1f7f83){var _0x589941=this;return new Promise(function(_0x5055e7,_0x437221){return db['Dynamics365Account'][_0x31c2('0x19')]({'raw':_0x1f7f83[_0x31c2('0x1a')]?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')]['where']||null:null,'attributes':_0x1f7f83[_0x31c2('0x1a')]?_0x1f7f83[_0x31c2('0x1a')]['attributes']||null:null,'limit':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1c')]||null:null,'include':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x1f7f83[_0x31c2('0x1a')]['include'],function(_0x25bdc2){return{'model':db[_0x25bdc2[_0x31c2('0x1f')]],'as':_0x25bdc2['as'],'attributes':_0x25bdc2['attributes'],'include':_0x25bdc2[_0x31c2('0x1d')]?_['map'](_0x25bdc2['include'],function(_0x3af6eb){return{'model':db[_0x3af6eb['model']],'as':_0x3af6eb['as'],'attributes':_0x3af6eb[_0x31c2('0x20')],'include':_0x3af6eb[_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x3af6eb[_0x31c2('0x1d')],function(_0x3ad658){return{'model':db[_0x3ad658['model']],'as':_0x3ad658['as'],'attributes':_0x3ad658[_0x31c2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x31c2('0xd')](function(_0x3ae1b9){logger['info'](_0x31c2('0x18'),_0x1f7f83);logger[_0x31c2('0x10')](_0x31c2('0x18'),_0x1f7f83,JSON[_0x31c2('0x12')](_0x3ae1b9));_0x5055e7(_0x3ae1b9);})[_0x31c2('0x17')](function(_0x2164d8){logger[_0x31c2('0x13')]('GetDynamics365Account',_0x2164d8[_0x31c2('0x14')],_0x1f7f83);_0x437221(_0x589941[_0x31c2('0x13')](0x1f4,_0x2164d8[_0x31c2('0x14')]));});});};exports[_0x31c2('0x21')]=function(_0x276137){var _0x3e2eef=this;return new Promise(function(_0x4739c5,_0x4a4b43){return db['Dynamics365Account'][_0x31c2('0x22')]({'raw':_0x276137['options']?_0x276137[_0x31c2('0x1a')][_0x31c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x276137[_0x31c2('0x1a')]?_0x276137[_0x31c2('0x1a')]['where']||null:null,'attributes':_0x276137[_0x31c2('0x1a')]?_0x276137['options'][_0x31c2('0x20')]||null:null,'include':_0x276137[_0x31c2('0x1a')]?_0x276137[_0x31c2('0x1a')][_0x31c2('0x1d')]?_['map'](_0x276137['options']['include'],function(_0x212661){return{'model':db[_0x212661[_0x31c2('0x1f')]],'as':_0x212661['as'],'attributes':_0x212661[_0x31c2('0x20')],'include':_0x212661[_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x212661[_0x31c2('0x1d')],function(_0x173f1f){return{'model':db[_0x173f1f[_0x31c2('0x1f')]],'as':_0x173f1f['as'],'attributes':_0x173f1f[_0x31c2('0x20')],'include':_0x173f1f[_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x173f1f[_0x31c2('0x1d')],function(_0x20a1f3){return{'model':db[_0x20a1f3[_0x31c2('0x1f')]],'as':_0x20a1f3['as'],'attributes':_0x20a1f3[_0x31c2('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e746c){logger[_0x31c2('0x15')](_0x31c2('0x21'),_0x276137);logger[_0x31c2('0x10')](_0x31c2('0x21'),_0x276137,JSON[_0x31c2('0x12')](_0x4e746c));_0x4739c5(_0x4e746c);})['catch'](function(_0x5429f4){logger[_0x31c2('0x13')](_0x31c2('0x21'),_0x5429f4[_0x31c2('0x14')],_0x276137);_0x4a4b43(_0x3e2eef[_0x31c2('0x13')](0x1f4,_0x5429f4[_0x31c2('0x14')]));});});}; \ No newline at end of file +var _0xacf4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowDynamics365Account'];(function(_0x17c566,_0xac70c4){var _0x1c4db4=function(_0x5c18fa){while(--_0x5c18fa){_0x17c566['push'](_0x17c566['shift']());}};_0x1c4db4(++_0xac70c4);}(_0xacf4,0xe7));var _0x4acf=function(_0x60089,_0x5d79ee){_0x60089=_0x60089-0x0;var _0x214c28=_0xacf4[_0x60089];return _0x214c28;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')]({'raw':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x240c00[_0x4acf('0x16')]?_0x240c00[_0x4acf('0x16')][_0x4acf('0x18')]||null:null,'attributes':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x19')]||null:null,'limit':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1a')]||null:null,'include':_0x240c00[_0x4acf('0x16')]?_0x240c00['options'][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x240c00[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x53885f){return{'model':db[_0x53885f[_0x4acf('0x1d')]],'as':_0x53885f['as'],'attributes':_0x53885f[_0x4acf('0x19')],'include':_0x53885f['include']?_[_0x4acf('0x1c')](_0x53885f[_0x4acf('0x1b')],function(_0x52a84a){return{'model':db[_0x52a84a[_0x4acf('0x1d')]],'as':_0x52a84a['as'],'attributes':_0x52a84a[_0x4acf('0x19')],'include':_0x52a84a[_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x52a84a['include'],function(_0x50236d){return{'model':db[_0x50236d[_0x4acf('0x1d')]],'as':_0x50236d['as'],'attributes':_0x50236d[_0x4acf('0x19')]};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0x42c90c){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1e')](_0x4acf('0x13'),_0x240c00,JSON[_0x4acf('0x1f')](_0x42c90c));_0x2a678b(_0x42c90c);})[_0x4acf('0x12')](function(_0x57989e){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57989e[_0x4acf('0x10')],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57989e[_0x4acf('0x10')]));});});};exports[_0x4acf('0x20')]=function(_0x27384c){var _0x5d862f=this;return new Promise(function(_0x337b3c,_0x1d221b){return db[_0x4acf('0x14')]['find']({'raw':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x17')]===undefined?!![]:![]:!![],'where':_0x27384c[_0x4acf('0x16')]?_0x27384c['options'][_0x4acf('0x18')]||null:null,'attributes':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')]['attributes']||null:null,'include':_0x27384c[_0x4acf('0x16')]?_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')]?_[_0x4acf('0x1c')](_0x27384c[_0x4acf('0x16')][_0x4acf('0x1b')],function(_0x490880){return{'model':db[_0x490880[_0x4acf('0x1d')]],'as':_0x490880['as'],'attributes':_0x490880[_0x4acf('0x19')],'include':_0x490880['include']?_[_0x4acf('0x1c')](_0x490880['include'],function(_0x4cd020){return{'model':db[_0x4cd020['model']],'as':_0x4cd020['as'],'attributes':_0x4cd020['attributes'],'include':_0x4cd020['include']?_['map'](_0x4cd020['include'],function(_0x3364dd){return{'model':db[_0x3364dd[_0x4acf('0x1d')]],'as':_0x3364dd['as'],'attributes':_0x3364dd['attributes']};}):[]};}):[]};}):[]:[]})[_0x4acf('0xa')](function(_0xbd0f92){logger[_0x4acf('0xb')](_0x4acf('0x20'),_0x27384c);logger[_0x4acf('0x1e')](_0x4acf('0x20'),_0x27384c,JSON[_0x4acf('0x1f')](_0xbd0f92));_0x337b3c(_0xbd0f92);})[_0x4acf('0x12')](function(_0x24465b){logger[_0x4acf('0xf')]('ShowDynamics365Account',_0x24465b['message'],_0x27384c);_0x1d221b(_0x5d862f[_0x4acf('0xf')](0x1f4,_0x24465b[_0x4acf('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 5f07cdb..a938977 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 _0x42e3=['index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42e3,0x1bd));var _0x342e=function(_0x1d6d05,_0x2dc9e0){_0x1d6d05=_0x1d6d05-0x0;var _0x5ad01b=_0x42e3[_0x1d6d05];return _0x5ad01b;};'use strict';var multer=require(_0x342e('0x0'));var util=require(_0x342e('0x1'));var path=require(_0x342e('0x2'));var timeout=require(_0x342e('0x3'));var express=require(_0x342e('0x4'));var router=express[_0x342e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x342e('0x6'));var config=require(_0x342e('0x7'));var controller=require(_0x342e('0x8'));router[_0x342e('0x9')]('/',auth[_0x342e('0xa')](),controller[_0x342e('0xb')]);router[_0x342e('0x9')](_0x342e('0xc'),auth[_0x342e('0xa')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x342e('0xd')]);router[_0x342e('0x9')](_0x342e('0xe'),auth[_0x342e('0xa')](),controller[_0x342e('0xf')]);router[_0x342e('0x9')](_0x342e('0x10'),auth[_0x342e('0xa')](),controller[_0x342e('0x11')]);router[_0x342e('0x12')]('/',auth[_0x342e('0xa')](),controller[_0x342e('0x13')]);router[_0x342e('0x14')](_0x342e('0xc'),auth[_0x342e('0xa')](),controller[_0x342e('0x15')]);router['delete'](_0x342e('0xc'),auth[_0x342e('0xa')](),controller[_0x342e('0x16')]);module[_0x342e('0x17')]=router; \ No newline at end of file +var _0x63a5=['put','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./intDynamics365Configuration.controller','index','get','/:id','show','isAuthenticated','/:id/descriptions','getDescriptions','post','create'];(function(_0x77998c,_0x95f2be){var _0xd5f34a=function(_0x5d560a){while(--_0x5d560a){_0x77998c['push'](_0x77998c['shift']());}};_0xd5f34a(++_0x95f2be);}(_0x63a5,0x18e));var _0x563a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x63a5[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0x563a('0x0'));var util=require(_0x563a('0x1'));var path=require('path');var timeout=require(_0x563a('0x2'));var express=require(_0x563a('0x3'));var router=express[_0x563a('0x4')]();var auth=require(_0x563a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x563a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x563a('0x7')]);router[_0x563a('0x8')](_0x563a('0x9'),auth['isAuthenticated'](),controller[_0x563a('0xa')]);router['get']('/:id/fields',auth[_0x563a('0xb')](),controller['getFields']);router[_0x563a('0x8')]('/:id/subjects',auth[_0x563a('0xb')](),controller['getSubjects']);router[_0x563a('0x8')](_0x563a('0xc'),auth[_0x563a('0xb')](),controller[_0x563a('0xd')]);router[_0x563a('0xe')]('/',auth['isAuthenticated'](),controller[_0x563a('0xf')]);router[_0x563a('0x10')](_0x563a('0x9'),auth[_0x563a('0xb')](),controller['update']);router['delete'](_0x563a('0x9'),auth[_0x563a('0xb')](),controller['destroy']);module[_0x563a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 9186c7d..279442c 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 _0xcc14=['sequelize','exports','STRING','incident','phonecall'];(function(_0x4108c8,_0x15236e){var _0x14878a=function(_0x31e4c5){while(--_0x31e4c5){_0x4108c8['push'](_0x4108c8['shift']());}};_0x14878a(++_0x15236e);}(_0xcc14,0x1c7));var _0x4cc1=function(_0x1e1230,_0x45ecce){_0x1e1230=_0x1e1230-0x0;var _0x3b72c0=_0xcc14[_0x1e1230];return _0x3b72c0;};'use strict';var Sequelize=require(_0x4cc1('0x0'));module[_0x4cc1('0x1')]={'name':{'type':Sequelize[_0x4cc1('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x4cc1('0x3'),_0x4cc1('0x4')),'defaultValue':_0x4cc1('0x3')}}; \ No newline at end of file +var _0xe5cc=['STRING','ENUM','incident','phonecall','sequelize','exports'];(function(_0x277749,_0x15a439){var _0x517159=function(_0x53092d){while(--_0x53092d){_0x277749['push'](_0x277749['shift']());}};_0x517159(++_0x15a439);}(_0xe5cc,0x13c));var _0xce5c=function(_0x13c434,_0x443f7a){_0x13c434=_0x13c434-0x0;var _0x2c3eaa=_0xe5cc[_0x13c434];return _0x2c3eaa;};'use strict';var Sequelize=require(_0xce5c('0x0'));module[_0xce5c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xce5c('0x2')]},'ticketType':{'type':Sequelize[_0xce5c('0x3')](_0xce5c('0x4'),_0xce5c('0x5')),'defaultValue':_0xce5c('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index df6c10d..794c9af 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 _0x36e2=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','json','count','offset','limit','status','Content-Range','reject','save','update','destroy','sendStatus','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','getFields','findOne','getSubjects','Dynamics365Field','pick','getDescriptions','eml-format','rimraf','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x4b9b0e,_0x36c02e){var _0x5c356f=function(_0x3331e6){while(--_0x3331e6){_0x4b9b0e['push'](_0x4b9b0e['shift']());}};_0x5c356f(++_0x36c02e);}(_0x36e2,0x1ed));var _0x236e=function(_0x3ad1c8,_0x5ae595){_0x3ad1c8=_0x3ad1c8-0x0;var _0x2b3d05=_0x36e2[_0x3ad1c8];return _0x2b3d05;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x236e('0x0'));var rimraf=require(_0x236e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x236e('0x2'));var moment=require('moment');var BPromise=require(_0x236e('0x3'));var Mustache=require(_0x236e('0x4'));var util=require(_0x236e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x236e('0x6'));var ejs=require(_0x236e('0x7'));var fs=require('fs');var _=require(_0x236e('0x8'));var squel=require(_0x236e('0x9'));var crypto=require(_0x236e('0xa'));var jsforce=require(_0x236e('0xb'));var deskjs=require(_0x236e('0xc'));var toCsv=require(_0x236e('0x6'));var querystring=require('querystring');var Papa=require(_0x236e('0xd'));var Redis=require(_0x236e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x236e('0xf'));var as=require(_0x236e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x236e('0x11'))(_0x236e('0x12'));var utils=require('../../config/utils');var config=require(_0x236e('0x13'));var db=require(_0x236e('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x236e('0x15')][_0x236e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x97c377,_0x579ca2,_0x52ee16){if(_0x52ee16){var _0x9df891=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9df891[_0x236e('0x17')](_0x579ca2)){return _0x97c377;}else{throw new db['Sequelize']['ValidationError'](_0x236e('0x18'));}}else{return _0x97c377;}}function respondWithRpcPromise(_0x6f2329,_0x4fdd82,_0x50e0fb,_0x4435d8){return new BPromise(function(_0x41d223,_0x44674d){var _0x5d4584=_0x4435d8||client;return _0x5d4584['request'](_0x6f2329,_0x50e0fb)[_0x236e('0x19')](function(_0x27c969){logger[_0x236e('0x1a')](_0x236e('0x1b'),_0x4fdd82,_0x236e('0x1c'));logger[_0x236e('0x1d')](_0x236e('0x1e'),_0x4fdd82,_0x236e('0x1c'),JSON['stringify'](_0x27c969));if(_0x27c969['error']){if(_0x27c969[_0x236e('0x1f')][_0x236e('0x20')]===0x1f4){logger[_0x236e('0x1f')](_0x236e('0x1b'),_0x4fdd82,_0x27c969[_0x236e('0x1f')][_0x236e('0x21')]);return _0x44674d(_0x27c969[_0x236e('0x1f')][_0x236e('0x21')]);}logger['error'](_0x236e('0x1b'),_0x4fdd82,_0x27c969[_0x236e('0x1f')]['message']);return _0x41d223(_0x27c969['error'][_0x236e('0x21')]);}else{logger[_0x236e('0x1a')](_0x236e('0x1b'),_0x4fdd82,_0x236e('0x1c'));_0x41d223(_0x27c969[_0x236e('0x22')]['message']);}})[_0x236e('0x23')](function(_0x351307){logger[_0x236e('0x1f')](_0x236e('0x1b'),_0x4fdd82,_0x351307);_0x44674d(_0x351307);});});}function respondWithStatusCode(_0xfa8e6a,_0x2b6e9c){_0x2b6e9c=_0x2b6e9c||0xcc;return function(_0x48ac30){if(_0x48ac30){return _0xfa8e6a['sendStatus'](_0x2b6e9c);}return _0xfa8e6a['status'](_0x2b6e9c)[_0x236e('0x24')]();};}function respondWithResult(_0x5c362a,_0x2d7720){_0x2d7720=_0x2d7720||0xc8;return function(_0x44fc75){if(_0x44fc75){return _0x5c362a['status'](_0x2d7720)[_0x236e('0x25')](_0x44fc75);}};}function respondWithFilteredResult(_0x483575,_0x230bb2){return function(_0x50c995){if(_0x50c995){var _0x55b510=_0x50c995[_0x236e('0x26')],_0x497830=_0x230bb2[_0x236e('0x27')],_0x4a45fa=_0x230bb2[_0x236e('0x27')]+_0x230bb2[_0x236e('0x28')],_0x2f6e53;if(_0x4a45fa>=_0x55b510){_0x4a45fa=_0x55b510;_0x2f6e53=0xc8;}else{_0x2f6e53=0xce;}_0x483575[_0x236e('0x29')](_0x2f6e53);return _0x483575['set'](_0x236e('0x2a'),_0x497830+'-'+_0x4a45fa+'/'+_0x55b510)[_0x236e('0x25')](_0x50c995);}return null;};}function patchUpdates(_0x4688f7){return function(_0x2e3d6c){try{jsonpatch['apply'](_0x2e3d6c,_0x4688f7,!![]);}catch(_0x1dd6bf){return BPromise[_0x236e('0x2b')](_0x1dd6bf);}return _0x2e3d6c[_0x236e('0x2c')]();};}function saveUpdates(_0x2a147e,_0x54e1f3){return function(_0x263b90){if(_0x263b90){return _0x263b90[_0x236e('0x2d')](_0x2a147e)[_0x236e('0x19')](function(_0x303abf){return _0x303abf;});}return null;};}function removeEntity(_0x110335,_0x1b5e36){return function(_0x17e814){if(_0x17e814){return _0x17e814[_0x236e('0x2e')]()['then'](function(){_0x110335[_0x236e('0x29')](0xcc)[_0x236e('0x24')]();});}};}function handleEntityNotFound(_0x2f4fed,_0x8d2147){return function(_0x495c59){if(!_0x495c59){_0x2f4fed[_0x236e('0x2f')](0x194);}return _0x495c59;};}function handleError(_0x34b006,_0x3fe4c1){_0x3fe4c1=_0x3fe4c1||0x1f4;return function(_0x520922){logger[_0x236e('0x1f')](_0x520922['stack']);if(_0x520922[_0x236e('0x30')]){delete _0x520922[_0x236e('0x30')];}_0x34b006['status'](_0x3fe4c1)[_0x236e('0x31')](_0x520922);};}exports[_0x236e('0x32')]=function(_0x58a164,_0x124f0f){var _0x2a6bc5={},_0x367039={},_0x757e0a={'count':0x0,'rows':[]};var _0x3bd28b=_[_0x236e('0x33')](db[_0x236e('0x34')][_0x236e('0x35')],function(_0x345cdc){return{'name':_0x345cdc[_0x236e('0x36')],'type':_0x345cdc[_0x236e('0x37')]['key']};});_0x367039[_0x236e('0x38')]=_[_0x236e('0x33')](_0x3bd28b,_0x236e('0x30'));_0x367039['query']=_[_0x236e('0x39')](_0x58a164[_0x236e('0x3a')]);_0x367039[_0x236e('0x3b')]=_[_0x236e('0x3c')](_0x367039[_0x236e('0x38')],_0x367039[_0x236e('0x3a')]);_0x2a6bc5['attributes']=_[_0x236e('0x3c')](_0x367039[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x58a164[_0x236e('0x3a')][_0x236e('0x3d')]));_0x2a6bc5['attributes']=_0x2a6bc5[_0x236e('0x3e')][_0x236e('0x3f')]?_0x2a6bc5[_0x236e('0x3e')]:_0x367039['model'];if(!_0x58a164['query'][_0x236e('0x40')](_0x236e('0x41'))){_0x2a6bc5[_0x236e('0x28')]=qs[_0x236e('0x28')](_0x58a164[_0x236e('0x3a')][_0x236e('0x28')]);_0x2a6bc5['offset']=qs[_0x236e('0x27')](_0x58a164[_0x236e('0x3a')][_0x236e('0x27')]);}_0x2a6bc5[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x58a164[_0x236e('0x3a')]['sort']);_0x2a6bc5[_0x236e('0x44')]=qs[_0x236e('0x3b')](_['pick'](_0x58a164[_0x236e('0x3a')],_0x367039[_0x236e('0x3b')]));if(_0x58a164[_0x236e('0x3a')][_0x236e('0x45')]){_0x2a6bc5[_0x236e('0x44')]=_[_0x236e('0x46')](_0x2a6bc5[_0x236e('0x44')],{'$or':_[_0x236e('0x33')](_0x3bd28b,function(_0x3c4081){if(_0x3c4081[_0x236e('0x37')]!==_0x236e('0x47')){var _0x3bd55f={};_0x3bd55f[_0x3c4081['name']]={'$like':'%'+_0x58a164[_0x236e('0x3a')][_0x236e('0x45')]+'%'};return _0x3bd55f;}})});}_0x2a6bc5=_[_0x236e('0x46')]({},_0x2a6bc5,_0x58a164[_0x236e('0x48')]);var _0x587eea={'where':_0x2a6bc5['where']};return db['Dynamics365Configuration'][_0x236e('0x26')](_0x587eea)[_0x236e('0x19')](function(_0x1639a9){_0x757e0a[_0x236e('0x26')]=_0x1639a9;if(_0x58a164[_0x236e('0x3a')][_0x236e('0x49')]){_0x2a6bc5[_0x236e('0x4a')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x2a6bc5);})[_0x236e('0x19')](function(_0x32e62b){_0x757e0a[_0x236e('0x4b')]=_0x32e62b;return _0x757e0a;})[_0x236e('0x19')](respondWithFilteredResult(_0x124f0f,_0x2a6bc5))['catch'](handleError(_0x124f0f,null));};exports[_0x236e('0x4c')]=function(_0x32a8c5,_0x29697e){var _0x317493={'raw':![],'where':{'id':_0x32a8c5[_0x236e('0x4d')]['id']}},_0x400a8b={};_0x400a8b['model']=_['keys'](db[_0x236e('0x34')][_0x236e('0x35')]);_0x400a8b[_0x236e('0x3a')]=_[_0x236e('0x39')](_0x32a8c5[_0x236e('0x3a')]);_0x400a8b['filters']=_[_0x236e('0x3c')](_0x400a8b['model'],_0x400a8b[_0x236e('0x3a')]);_0x317493[_0x236e('0x3e')]=_[_0x236e('0x3c')](_0x400a8b[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x32a8c5['query'][_0x236e('0x3d')]));_0x317493[_0x236e('0x3e')]=_0x317493[_0x236e('0x3e')][_0x236e('0x3f')]?_0x317493[_0x236e('0x3e')]:_0x400a8b[_0x236e('0x38')];if(_0x32a8c5[_0x236e('0x3a')]['includeAll']){_0x317493['include']=[{'all':!![]}];}_0x317493=_[_0x236e('0x46')]({},_0x317493,_0x32a8c5[_0x236e('0x48')]);return db[_0x236e('0x34')][_0x236e('0x4e')](_0x317493)[_0x236e('0x19')](handleEntityNotFound(_0x29697e,null))[_0x236e('0x19')](respondWithResult(_0x29697e,null))['catch'](handleError(_0x29697e,null));};exports[_0x236e('0x4f')]=function(_0x57ef05,_0x50b1aa){return db['Dynamics365Configuration'][_0x236e('0x4f')](_0x57ef05[_0x236e('0x50')],{})[_0x236e('0x19')](respondWithResult(_0x50b1aa,0xc9))[_0x236e('0x23')](handleError(_0x50b1aa,null));};exports['update']=function(_0x52f077,_0x436d01){if(_0x52f077[_0x236e('0x50')]['id']){delete _0x52f077[_0x236e('0x50')]['id'];}return db['Dynamics365Configuration'][_0x236e('0x4e')]({'where':{'id':_0x52f077[_0x236e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x436d01,null))['then'](saveUpdates(_0x52f077[_0x236e('0x50')],null))[_0x236e('0x19')](respondWithResult(_0x436d01,null))[_0x236e('0x23')](handleError(_0x436d01,null));};exports[_0x236e('0x2e')]=function(_0x3105c4,_0x46aaf8){return db[_0x236e('0x34')][_0x236e('0x4e')]({'where':{'id':_0x3105c4[_0x236e('0x4d')]['id']}})[_0x236e('0x19')](handleEntityNotFound(_0x46aaf8,null))[_0x236e('0x19')](removeEntity(_0x46aaf8,null))[_0x236e('0x23')](handleError(_0x46aaf8,null));};exports[_0x236e('0x51')]=function(_0x4037fe,_0x1f6448,_0x1e1d40){var _0x38e708={};var _0x1792cb={};var _0x113786;var _0x3e7e27;return db[_0x236e('0x34')][_0x236e('0x52')]({'where':{'id':_0x4037fe['params']['id']}})['then'](handleEntityNotFound(_0x1f6448,null))[_0x236e('0x19')](function(_0x1a09b6){if(_0x1a09b6){_0x113786=_0x1a09b6;_0x1792cb[_0x236e('0x38')]=_[_0x236e('0x39')](db['Dynamics365Field'][_0x236e('0x35')]);_0x1792cb[_0x236e('0x3a')]=_[_0x236e('0x39')](_0x4037fe[_0x236e('0x3a')]);_0x1792cb['filters']=_[_0x236e('0x3c')](_0x1792cb[_0x236e('0x38')],_0x1792cb[_0x236e('0x3a')]);_0x38e708[_0x236e('0x3e')]=_[_0x236e('0x3c')](_0x1792cb[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x4037fe[_0x236e('0x3a')]['fields']));_0x38e708[_0x236e('0x3e')]=_0x38e708[_0x236e('0x3e')]['length']?_0x38e708[_0x236e('0x3e')]:_0x1792cb['model'];_0x38e708[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x4037fe[_0x236e('0x3a')][_0x236e('0x43')]);_0x38e708[_0x236e('0x44')]=qs['filters'](_['pick'](_0x4037fe[_0x236e('0x3a')],_0x1792cb[_0x236e('0x3b')]));if(_0x4037fe['query'][_0x236e('0x45')]){_0x38e708[_0x236e('0x44')]=_['merge'](_0x38e708['where'],{'$or':_[_0x236e('0x33')](_0x38e708[_0x236e('0x3e')],function(_0x158267){var _0x229bda={};_0x229bda[_0x158267]={'$like':'%'+_0x4037fe[_0x236e('0x3a')][_0x236e('0x45')]+'%'};return _0x229bda;})});}_0x38e708=_['merge']({},_0x38e708,_0x4037fe[_0x236e('0x48')]);return _0x113786[_0x236e('0x51')](_0x38e708);}})[_0x236e('0x19')](function(_0x356fad){if(_0x356fad){_0x3e7e27=_0x356fad[_0x236e('0x3f')];if(!_0x4037fe[_0x236e('0x3a')][_0x236e('0x40')](_0x236e('0x41'))){_0x38e708[_0x236e('0x28')]=qs[_0x236e('0x28')](_0x4037fe['query'][_0x236e('0x28')]);_0x38e708[_0x236e('0x27')]=qs[_0x236e('0x27')](_0x4037fe[_0x236e('0x3a')][_0x236e('0x27')]);}return _0x113786[_0x236e('0x51')](_0x38e708);}})[_0x236e('0x19')](function(_0xf0f0eb){if(_0xf0f0eb){return _0xf0f0eb?{'count':_0x3e7e27,'rows':_0xf0f0eb}:null;}})[_0x236e('0x19')](respondWithResult(_0x1f6448,null))[_0x236e('0x23')](handleError(_0x1f6448,null));};exports[_0x236e('0x53')]=function(_0x3aac91,_0x3e1d2e,_0x35ef12){var _0xac9e0a={};var _0x4fb8ee={};var _0x55a6fa;var _0x1ea7d3;return db[_0x236e('0x34')][_0x236e('0x52')]({'where':{'id':_0x3aac91[_0x236e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e1d2e,null))[_0x236e('0x19')](function(_0x48ebaa){if(_0x48ebaa){_0x55a6fa=_0x48ebaa;_0x4fb8ee[_0x236e('0x38')]=_['keys'](db[_0x236e('0x54')][_0x236e('0x35')]);_0x4fb8ee[_0x236e('0x3a')]=_['keys'](_0x3aac91[_0x236e('0x3a')]);_0x4fb8ee[_0x236e('0x3b')]=_[_0x236e('0x3c')](_0x4fb8ee[_0x236e('0x38')],_0x4fb8ee[_0x236e('0x3a')]);_0xac9e0a[_0x236e('0x3e')]=_[_0x236e('0x3c')](_0x4fb8ee[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x3aac91[_0x236e('0x3a')][_0x236e('0x3d')]));_0xac9e0a[_0x236e('0x3e')]=_0xac9e0a[_0x236e('0x3e')][_0x236e('0x3f')]?_0xac9e0a[_0x236e('0x3e')]:_0x4fb8ee[_0x236e('0x38')];_0xac9e0a[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x3aac91[_0x236e('0x3a')]['sort']);_0xac9e0a[_0x236e('0x44')]=qs['filters'](_[_0x236e('0x55')](_0x3aac91[_0x236e('0x3a')],_0x4fb8ee[_0x236e('0x3b')]));if(_0x3aac91[_0x236e('0x3a')]['filter']){_0xac9e0a[_0x236e('0x44')]=_[_0x236e('0x46')](_0xac9e0a['where'],{'$or':_[_0x236e('0x33')](_0xac9e0a[_0x236e('0x3e')],function(_0x153f0c){var _0x67212c={};_0x67212c[_0x153f0c]={'$like':'%'+_0x3aac91[_0x236e('0x3a')][_0x236e('0x45')]+'%'};return _0x67212c;})});}_0xac9e0a=_[_0x236e('0x46')]({},_0xac9e0a,_0x3aac91[_0x236e('0x48')]);return _0x55a6fa[_0x236e('0x53')](_0xac9e0a);}})[_0x236e('0x19')](function(_0x24eaf9){if(_0x24eaf9){_0x1ea7d3=_0x24eaf9['length'];if(!_0x3aac91[_0x236e('0x3a')][_0x236e('0x40')](_0x236e('0x41'))){_0xac9e0a['limit']=qs[_0x236e('0x28')](_0x3aac91['query'][_0x236e('0x28')]);_0xac9e0a[_0x236e('0x27')]=qs[_0x236e('0x27')](_0x3aac91[_0x236e('0x3a')][_0x236e('0x27')]);}return _0x55a6fa[_0x236e('0x53')](_0xac9e0a);}})[_0x236e('0x19')](function(_0x49c5a7){if(_0x49c5a7){return _0x49c5a7?{'count':_0x1ea7d3,'rows':_0x49c5a7}:null;}})[_0x236e('0x19')](respondWithResult(_0x3e1d2e,null))[_0x236e('0x23')](handleError(_0x3e1d2e,null));};exports['getDescriptions']=function(_0x4d2e41,_0xaaa6e8,_0x290797){var _0x58e4af={};var _0x14a4e5={};var _0x4ff3a8;var _0x4d8beb;return db[_0x236e('0x34')][_0x236e('0x52')]({'where':{'id':_0x4d2e41[_0x236e('0x4d')]['id']}})[_0x236e('0x19')](handleEntityNotFound(_0xaaa6e8,null))[_0x236e('0x19')](function(_0x1f2420){if(_0x1f2420){_0x4ff3a8=_0x1f2420;_0x14a4e5[_0x236e('0x38')]=_[_0x236e('0x39')](db[_0x236e('0x54')][_0x236e('0x35')]);_0x14a4e5[_0x236e('0x3a')]=_[_0x236e('0x39')](_0x4d2e41[_0x236e('0x3a')]);_0x14a4e5[_0x236e('0x3b')]=_['intersection'](_0x14a4e5['model'],_0x14a4e5['query']);_0x58e4af['attributes']=_[_0x236e('0x3c')](_0x14a4e5[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x3d')]));_0x58e4af[_0x236e('0x3e')]=_0x58e4af[_0x236e('0x3e')][_0x236e('0x3f')]?_0x58e4af['attributes']:_0x14a4e5[_0x236e('0x38')];_0x58e4af[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x43')]);_0x58e4af[_0x236e('0x44')]=qs[_0x236e('0x3b')](_['pick'](_0x4d2e41[_0x236e('0x3a')],_0x14a4e5[_0x236e('0x3b')]));if(_0x4d2e41['query']['filter']){_0x58e4af[_0x236e('0x44')]=_['merge'](_0x58e4af[_0x236e('0x44')],{'$or':_[_0x236e('0x33')](_0x58e4af[_0x236e('0x3e')],function(_0x348dbd){var _0x3752ef={};_0x3752ef[_0x348dbd]={'$like':'%'+_0x4d2e41[_0x236e('0x3a')]['filter']+'%'};return _0x3752ef;})});}_0x58e4af=_['merge']({},_0x58e4af,_0x4d2e41[_0x236e('0x48')]);return _0x4ff3a8['getDescriptions'](_0x58e4af);}})[_0x236e('0x19')](function(_0x43248c){if(_0x43248c){_0x4d8beb=_0x43248c[_0x236e('0x3f')];if(!_0x4d2e41[_0x236e('0x3a')][_0x236e('0x40')]('nolimit')){_0x58e4af['limit']=qs[_0x236e('0x28')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x28')]);_0x58e4af['offset']=qs[_0x236e('0x27')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x27')]);}return _0x4ff3a8[_0x236e('0x56')](_0x58e4af);}})[_0x236e('0x19')](function(_0x15813c){if(_0x15813c){return _0x15813c?{'count':_0x4d8beb,'rows':_0x15813c}:null;}})[_0x236e('0x19')](respondWithResult(_0xaaa6e8,null))[_0x236e('0x23')](handleError(_0xaaa6e8,null));}; \ No newline at end of file +var _0x97b5=['stack','name','send','index','map','Dynamics365Configuration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','options','where','includeAll','include','findAll','rows','show','params','merge','body','find','destroy','getFields','Dynamics365Field','rawAttributes','pick','hasOwnProperty','getSubjects','findOne','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update'];(function(_0x25f797,_0x449916){var _0x157fdd=function(_0x329fe1){while(--_0x329fe1){_0x25f797['push'](_0x25f797['shift']());}};_0x157fdd(++_0x449916);}(_0x97b5,0xd7));var _0x597b=function(_0xe9e6cf,_0x395f6d){_0xe9e6cf=_0xe9e6cf-0x0;var _0x2b8851=_0x97b5[_0xe9e6cf];return _0x2b8851;};'use strict';var pdf=require(_0x597b('0x0'));var emlformat=require(_0x597b('0x1'));var rimraf=require(_0x597b('0x2'));var zipdir=require(_0x597b('0x3'));var jsonpatch=require(_0x597b('0x4'));var rp=require(_0x597b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x597b('0x6'));var util=require(_0x597b('0x7'));var path=require(_0x597b('0x8'));var sox=require(_0x597b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x597b('0xa'));var squel=require('squel');var crypto=require(_0x597b('0xb'));var jsforce=require(_0x597b('0xc'));var deskjs=require(_0x597b('0xd'));var toCsv=require(_0x597b('0xe'));var querystring=require(_0x597b('0xf'));var Papa=require(_0x597b('0x10'));var Redis=require('ioredis');var authService=require(_0x597b('0x11'));var qs=require(_0x597b('0x12'));var as=require(_0x597b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x597b('0x14'));var config=require(_0x597b('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x229295,_0x3682f6,_0x836c2e){if(_0x836c2e){var _0xa5df67=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa5df67['test'](_0x3682f6)){return _0x229295;}else{throw new db[(_0x597b('0x16'))]['ValidationError'](_0x597b('0x17'));}}else{return _0x229295;}}function respondWithRpcPromise(_0x3958f1,_0x55b1ba,_0x4273a8,_0x48fd9b){return new BPromise(function(_0x6e4e1a,_0x488d8d){var _0x43bd66=_0x48fd9b||client;return _0x43bd66['request'](_0x3958f1,_0x4273a8)[_0x597b('0x18')](function(_0x1f97ef){logger[_0x597b('0x19')]('Dynamics365Configuration,\x20%s,\x20%s',_0x55b1ba,'request\x20sent');logger[_0x597b('0x1a')](_0x597b('0x1b'),_0x55b1ba,_0x597b('0x1c'),JSON[_0x597b('0x1d')](_0x1f97ef));if(_0x1f97ef[_0x597b('0x1e')]){if(_0x1f97ef['error']['code']===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x55b1ba,_0x1f97ef[_0x597b('0x1e')][_0x597b('0x1f')]);return _0x488d8d(_0x1f97ef['error'][_0x597b('0x1f')]);}logger['error'](_0x597b('0x20'),_0x55b1ba,_0x1f97ef[_0x597b('0x1e')][_0x597b('0x1f')]);return _0x6e4e1a(_0x1f97ef['error'][_0x597b('0x1f')]);}else{logger[_0x597b('0x19')]('Dynamics365Configuration,\x20%s,\x20%s',_0x55b1ba,_0x597b('0x1c'));_0x6e4e1a(_0x1f97ef['result'][_0x597b('0x1f')]);}})[_0x597b('0x21')](function(_0x103267){logger[_0x597b('0x1e')](_0x597b('0x20'),_0x55b1ba,_0x103267);_0x488d8d(_0x103267);});});}function respondWithStatusCode(_0x2294d1,_0x2262c7){_0x2262c7=_0x2262c7||0xcc;return function(_0xa270e0){if(_0xa270e0){return _0x2294d1[_0x597b('0x22')](_0x2262c7);}return _0x2294d1[_0x597b('0x23')](_0x2262c7)[_0x597b('0x24')]();};}function respondWithResult(_0x3468e9,_0x469898){_0x469898=_0x469898||0xc8;return function(_0x42b9fe){if(_0x42b9fe){return _0x3468e9[_0x597b('0x23')](_0x469898)[_0x597b('0x25')](_0x42b9fe);}};}function respondWithFilteredResult(_0x103d34,_0x4cd030){return function(_0x23f28a){if(_0x23f28a){var _0x40e29e=_0x23f28a[_0x597b('0x26')],_0x4c00de=_0x4cd030[_0x597b('0x27')],_0x26f54d=_0x4cd030['offset']+_0x4cd030[_0x597b('0x28')],_0xf0d310;if(_0x26f54d>=_0x40e29e){_0x26f54d=_0x40e29e;_0xf0d310=0xc8;}else{_0xf0d310=0xce;}_0x103d34['status'](_0xf0d310);return _0x103d34[_0x597b('0x29')](_0x597b('0x2a'),_0x4c00de+'-'+_0x26f54d+'/'+_0x40e29e)[_0x597b('0x25')](_0x23f28a);}return null;};}function patchUpdates(_0xc4deb5){return function(_0x130dd5){try{jsonpatch[_0x597b('0x2b')](_0x130dd5,_0xc4deb5,!![]);}catch(_0x314f7e){return BPromise['reject'](_0x314f7e);}return _0x130dd5[_0x597b('0x2c')]();};}function saveUpdates(_0x214a84,_0x46920d){return function(_0x119db5){if(_0x119db5){return _0x119db5[_0x597b('0x2d')](_0x214a84)['then'](function(_0x7fde14){return _0x7fde14;});}return null;};}function removeEntity(_0x260ab4,_0x4b39ac){return function(_0x17b5b6){if(_0x17b5b6){return _0x17b5b6['destroy']()[_0x597b('0x18')](function(){_0x260ab4[_0x597b('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36f00f,_0x14dfa5){return function(_0x1838ba){if(!_0x1838ba){_0x36f00f[_0x597b('0x22')](0x194);}return _0x1838ba;};}function handleError(_0x2f1923,_0x4e91a1){_0x4e91a1=_0x4e91a1||0x1f4;return function(_0x16aecb){logger[_0x597b('0x1e')](_0x16aecb[_0x597b('0x2e')]);if(_0x16aecb[_0x597b('0x2f')]){delete _0x16aecb['name'];}_0x2f1923['status'](_0x4e91a1)[_0x597b('0x30')](_0x16aecb);};}exports[_0x597b('0x31')]=function(_0x1b440f,_0x2b08b8){var _0x3e7fbc={},_0x2a8ca8={},_0x1b7974={'count':0x0,'rows':[]};var _0x20024f=_[_0x597b('0x32')](db[_0x597b('0x33')]['rawAttributes'],function(_0x1b11a4){return{'name':_0x1b11a4[_0x597b('0x34')],'type':_0x1b11a4[_0x597b('0x35')][_0x597b('0x36')]};});_0x2a8ca8[_0x597b('0x37')]=_[_0x597b('0x32')](_0x20024f,_0x597b('0x2f'));_0x2a8ca8[_0x597b('0x38')]=_[_0x597b('0x39')](_0x1b440f['query']);_0x2a8ca8[_0x597b('0x3a')]=_[_0x597b('0x3b')](_0x2a8ca8[_0x597b('0x37')],_0x2a8ca8[_0x597b('0x38')]);_0x3e7fbc[_0x597b('0x3c')]=_['intersection'](_0x2a8ca8[_0x597b('0x37')],qs['fields'](_0x1b440f[_0x597b('0x38')][_0x597b('0x3d')]));_0x3e7fbc[_0x597b('0x3c')]=_0x3e7fbc['attributes'][_0x597b('0x3e')]?_0x3e7fbc[_0x597b('0x3c')]:_0x2a8ca8[_0x597b('0x37')];if(!_0x1b440f[_0x597b('0x38')]['hasOwnProperty'](_0x597b('0x3f'))){_0x3e7fbc[_0x597b('0x28')]=qs['limit'](_0x1b440f[_0x597b('0x38')][_0x597b('0x28')]);_0x3e7fbc[_0x597b('0x27')]=qs[_0x597b('0x27')](_0x1b440f[_0x597b('0x38')][_0x597b('0x27')]);}_0x3e7fbc[_0x597b('0x40')]=qs[_0x597b('0x41')](_0x1b440f['query'][_0x597b('0x41')]);_0x3e7fbc['where']=qs[_0x597b('0x3a')](_['pick'](_0x1b440f['query'],_0x2a8ca8[_0x597b('0x3a')]));if(_0x1b440f[_0x597b('0x38')][_0x597b('0x42')]){_0x3e7fbc['where']=_['merge'](_0x3e7fbc['where'],{'$or':_[_0x597b('0x32')](_0x20024f,function(_0x18fdfb){if(_0x18fdfb[_0x597b('0x35')]!=='VIRTUAL'){var _0x339254={};_0x339254[_0x18fdfb[_0x597b('0x2f')]]={'$like':'%'+_0x1b440f[_0x597b('0x38')][_0x597b('0x42')]+'%'};return _0x339254;}})});}_0x3e7fbc=_['merge']({},_0x3e7fbc,_0x1b440f[_0x597b('0x43')]);var _0x4cd723={'where':_0x3e7fbc[_0x597b('0x44')]};return db['Dynamics365Configuration'][_0x597b('0x26')](_0x4cd723)[_0x597b('0x18')](function(_0x311eca){_0x1b7974[_0x597b('0x26')]=_0x311eca;if(_0x1b440f[_0x597b('0x38')][_0x597b('0x45')]){_0x3e7fbc[_0x597b('0x46')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x597b('0x47')](_0x3e7fbc);})['then'](function(_0x189c03){_0x1b7974[_0x597b('0x48')]=_0x189c03;return _0x1b7974;})[_0x597b('0x18')](respondWithFilteredResult(_0x2b08b8,_0x3e7fbc))[_0x597b('0x21')](handleError(_0x2b08b8,null));};exports[_0x597b('0x49')]=function(_0x43d152,_0x24a8c1){var _0x26cc93={'raw':![],'where':{'id':_0x43d152[_0x597b('0x4a')]['id']}},_0x5c27c3={};_0x5c27c3['model']=_[_0x597b('0x39')](db[_0x597b('0x33')]['rawAttributes']);_0x5c27c3['query']=_['keys'](_0x43d152[_0x597b('0x38')]);_0x5c27c3[_0x597b('0x3a')]=_[_0x597b('0x3b')](_0x5c27c3[_0x597b('0x37')],_0x5c27c3['query']);_0x26cc93[_0x597b('0x3c')]=_['intersection'](_0x5c27c3[_0x597b('0x37')],qs[_0x597b('0x3d')](_0x43d152[_0x597b('0x38')]['fields']));_0x26cc93[_0x597b('0x3c')]=_0x26cc93['attributes'][_0x597b('0x3e')]?_0x26cc93[_0x597b('0x3c')]:_0x5c27c3[_0x597b('0x37')];if(_0x43d152['query'][_0x597b('0x45')]){_0x26cc93[_0x597b('0x46')]=[{'all':!![]}];}_0x26cc93=_[_0x597b('0x4b')]({},_0x26cc93,_0x43d152['options']);return db[_0x597b('0x33')]['find'](_0x26cc93)[_0x597b('0x18')](handleEntityNotFound(_0x24a8c1,null))['then'](respondWithResult(_0x24a8c1,null))[_0x597b('0x21')](handleError(_0x24a8c1,null));};exports['create']=function(_0x411462,_0x442fb1){return db[_0x597b('0x33')]['create'](_0x411462[_0x597b('0x4c')],{})[_0x597b('0x18')](respondWithResult(_0x442fb1,0xc9))[_0x597b('0x21')](handleError(_0x442fb1,null));};exports['update']=function(_0x4f630d,_0x24809f){if(_0x4f630d[_0x597b('0x4c')]['id']){delete _0x4f630d['body']['id'];}return db[_0x597b('0x33')][_0x597b('0x4d')]({'where':{'id':_0x4f630d[_0x597b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x24809f,null))['then'](saveUpdates(_0x4f630d['body'],null))[_0x597b('0x18')](respondWithResult(_0x24809f,null))[_0x597b('0x21')](handleError(_0x24809f,null));};exports[_0x597b('0x4e')]=function(_0x31e928,_0x4f4970){return db[_0x597b('0x33')]['find']({'where':{'id':_0x31e928[_0x597b('0x4a')]['id']}})[_0x597b('0x18')](handleEntityNotFound(_0x4f4970,null))['then'](removeEntity(_0x4f4970,null))[_0x597b('0x21')](handleError(_0x4f4970,null));};exports[_0x597b('0x4f')]=function(_0x1aaab7,_0x3d90d4,_0x5072d6){var _0x3c2829={};var _0x395ffc={};var _0x593dfe;var _0x1aa7cd;return db[_0x597b('0x33')]['findOne']({'where':{'id':_0x1aaab7[_0x597b('0x4a')]['id']}})[_0x597b('0x18')](handleEntityNotFound(_0x3d90d4,null))['then'](function(_0x21bb1d){if(_0x21bb1d){_0x593dfe=_0x21bb1d;_0x395ffc[_0x597b('0x37')]=_[_0x597b('0x39')](db[_0x597b('0x50')][_0x597b('0x51')]);_0x395ffc[_0x597b('0x38')]=_['keys'](_0x1aaab7['query']);_0x395ffc[_0x597b('0x3a')]=_['intersection'](_0x395ffc[_0x597b('0x37')],_0x395ffc[_0x597b('0x38')]);_0x3c2829[_0x597b('0x3c')]=_[_0x597b('0x3b')](_0x395ffc[_0x597b('0x37')],qs[_0x597b('0x3d')](_0x1aaab7[_0x597b('0x38')]['fields']));_0x3c2829[_0x597b('0x3c')]=_0x3c2829[_0x597b('0x3c')][_0x597b('0x3e')]?_0x3c2829[_0x597b('0x3c')]:_0x395ffc[_0x597b('0x37')];_0x3c2829[_0x597b('0x40')]=qs[_0x597b('0x41')](_0x1aaab7[_0x597b('0x38')][_0x597b('0x41')]);_0x3c2829[_0x597b('0x44')]=qs[_0x597b('0x3a')](_[_0x597b('0x52')](_0x1aaab7['query'],_0x395ffc[_0x597b('0x3a')]));if(_0x1aaab7[_0x597b('0x38')][_0x597b('0x42')]){_0x3c2829[_0x597b('0x44')]=_['merge'](_0x3c2829[_0x597b('0x44')],{'$or':_['map'](_0x3c2829[_0x597b('0x3c')],function(_0x3088c4){var _0x135e16={};_0x135e16[_0x3088c4]={'$like':'%'+_0x1aaab7[_0x597b('0x38')][_0x597b('0x42')]+'%'};return _0x135e16;})});}_0x3c2829=_[_0x597b('0x4b')]({},_0x3c2829,_0x1aaab7[_0x597b('0x43')]);return _0x593dfe['getFields'](_0x3c2829);}})[_0x597b('0x18')](function(_0x1b1e45){if(_0x1b1e45){_0x1aa7cd=_0x1b1e45[_0x597b('0x3e')];if(!_0x1aaab7[_0x597b('0x38')][_0x597b('0x53')](_0x597b('0x3f'))){_0x3c2829[_0x597b('0x28')]=qs[_0x597b('0x28')](_0x1aaab7[_0x597b('0x38')][_0x597b('0x28')]);_0x3c2829['offset']=qs[_0x597b('0x27')](_0x1aaab7['query'][_0x597b('0x27')]);}return _0x593dfe[_0x597b('0x4f')](_0x3c2829);}})['then'](function(_0x12b1b5){if(_0x12b1b5){return _0x12b1b5?{'count':_0x1aa7cd,'rows':_0x12b1b5}:null;}})[_0x597b('0x18')](respondWithResult(_0x3d90d4,null))[_0x597b('0x21')](handleError(_0x3d90d4,null));};exports[_0x597b('0x54')]=function(_0x273d73,_0x403ab1,_0x43f902){var _0x44b092={};var _0x102ffe={};var _0x22f5e4;var _0x3dfd93;return db[_0x597b('0x33')][_0x597b('0x55')]({'where':{'id':_0x273d73[_0x597b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x403ab1,null))[_0x597b('0x18')](function(_0x595dee){if(_0x595dee){_0x22f5e4=_0x595dee;_0x102ffe[_0x597b('0x37')]=_[_0x597b('0x39')](db[_0x597b('0x50')][_0x597b('0x51')]);_0x102ffe[_0x597b('0x38')]=_[_0x597b('0x39')](_0x273d73[_0x597b('0x38')]);_0x102ffe[_0x597b('0x3a')]=_[_0x597b('0x3b')](_0x102ffe[_0x597b('0x37')],_0x102ffe[_0x597b('0x38')]);_0x44b092[_0x597b('0x3c')]=_['intersection'](_0x102ffe['model'],qs['fields'](_0x273d73[_0x597b('0x38')][_0x597b('0x3d')]));_0x44b092[_0x597b('0x3c')]=_0x44b092[_0x597b('0x3c')][_0x597b('0x3e')]?_0x44b092[_0x597b('0x3c')]:_0x102ffe[_0x597b('0x37')];_0x44b092[_0x597b('0x40')]=qs[_0x597b('0x41')](_0x273d73['query'][_0x597b('0x41')]);_0x44b092[_0x597b('0x44')]=qs[_0x597b('0x3a')](_[_0x597b('0x52')](_0x273d73[_0x597b('0x38')],_0x102ffe[_0x597b('0x3a')]));if(_0x273d73['query']['filter']){_0x44b092[_0x597b('0x44')]=_[_0x597b('0x4b')](_0x44b092[_0x597b('0x44')],{'$or':_[_0x597b('0x32')](_0x44b092[_0x597b('0x3c')],function(_0x5448db){var _0x48f6b1={};_0x48f6b1[_0x5448db]={'$like':'%'+_0x273d73[_0x597b('0x38')][_0x597b('0x42')]+'%'};return _0x48f6b1;})});}_0x44b092=_[_0x597b('0x4b')]({},_0x44b092,_0x273d73[_0x597b('0x43')]);return _0x22f5e4[_0x597b('0x54')](_0x44b092);}})[_0x597b('0x18')](function(_0x48241e){if(_0x48241e){_0x3dfd93=_0x48241e[_0x597b('0x3e')];if(!_0x273d73[_0x597b('0x38')][_0x597b('0x53')]('nolimit')){_0x44b092[_0x597b('0x28')]=qs[_0x597b('0x28')](_0x273d73[_0x597b('0x38')][_0x597b('0x28')]);_0x44b092['offset']=qs['offset'](_0x273d73[_0x597b('0x38')][_0x597b('0x27')]);}return _0x22f5e4[_0x597b('0x54')](_0x44b092);}})[_0x597b('0x18')](function(_0x9f1136){if(_0x9f1136){return _0x9f1136?{'count':_0x3dfd93,'rows':_0x9f1136}:null;}})[_0x597b('0x18')](respondWithResult(_0x403ab1,null))['catch'](handleError(_0x403ab1,null));};exports[_0x597b('0x56')]=function(_0x4e4c35,_0x4e9a83,_0x408b66){var _0x1d3535={};var _0x49b70f={};var _0x5bb96b;var _0x4b5d33;return db['Dynamics365Configuration'][_0x597b('0x55')]({'where':{'id':_0x4e4c35['params']['id']}})[_0x597b('0x18')](handleEntityNotFound(_0x4e9a83,null))['then'](function(_0xe6da64){if(_0xe6da64){_0x5bb96b=_0xe6da64;_0x49b70f[_0x597b('0x37')]=_[_0x597b('0x39')](db['Dynamics365Field']['rawAttributes']);_0x49b70f[_0x597b('0x38')]=_[_0x597b('0x39')](_0x4e4c35[_0x597b('0x38')]);_0x49b70f[_0x597b('0x3a')]=_[_0x597b('0x3b')](_0x49b70f[_0x597b('0x37')],_0x49b70f[_0x597b('0x38')]);_0x1d3535[_0x597b('0x3c')]=_[_0x597b('0x3b')](_0x49b70f['model'],qs[_0x597b('0x3d')](_0x4e4c35[_0x597b('0x38')]['fields']));_0x1d3535[_0x597b('0x3c')]=_0x1d3535['attributes'][_0x597b('0x3e')]?_0x1d3535[_0x597b('0x3c')]:_0x49b70f[_0x597b('0x37')];_0x1d3535[_0x597b('0x40')]=qs[_0x597b('0x41')](_0x4e4c35[_0x597b('0x38')][_0x597b('0x41')]);_0x1d3535['where']=qs['filters'](_[_0x597b('0x52')](_0x4e4c35[_0x597b('0x38')],_0x49b70f['filters']));if(_0x4e4c35['query'][_0x597b('0x42')]){_0x1d3535[_0x597b('0x44')]=_['merge'](_0x1d3535['where'],{'$or':_[_0x597b('0x32')](_0x1d3535[_0x597b('0x3c')],function(_0x37fe10){var _0xb2922c={};_0xb2922c[_0x37fe10]={'$like':'%'+_0x4e4c35[_0x597b('0x38')][_0x597b('0x42')]+'%'};return _0xb2922c;})});}_0x1d3535=_[_0x597b('0x4b')]({},_0x1d3535,_0x4e4c35[_0x597b('0x43')]);return _0x5bb96b[_0x597b('0x56')](_0x1d3535);}})['then'](function(_0x5405c7){if(_0x5405c7){_0x4b5d33=_0x5405c7['length'];if(!_0x4e4c35['query'][_0x597b('0x53')](_0x597b('0x3f'))){_0x1d3535[_0x597b('0x28')]=qs[_0x597b('0x28')](_0x4e4c35[_0x597b('0x38')][_0x597b('0x28')]);_0x1d3535[_0x597b('0x27')]=qs[_0x597b('0x27')](_0x4e4c35[_0x597b('0x38')]['offset']);}return _0x5bb96b[_0x597b('0x56')](_0x1d3535);}})[_0x597b('0x18')](function(_0x25f179){if(_0x25f179){return _0x25f179?{'count':_0x4b5d33,'rows':_0x25f179}:null;}})[_0x597b('0x18')](respondWithResult(_0x4e9a83,null))[_0x597b('0x21')](handleError(_0x4e9a83,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 9ecea64..09f0e72 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 _0x6e97=['Dynamics365Configuration','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0xa6c419,_0x27552f){var _0x4fb13f=function(_0x2edaef){while(--_0x2edaef){_0xa6c419['push'](_0xa6c419['shift']());}};_0x4fb13f(++_0x27552f);}(_0x6e97,0x1bd));var _0x76e9=function(_0x50ba3a,_0x2afbd0){_0x50ba3a=_0x50ba3a-0x0;var _0x5a8554=_0x6e97[_0x50ba3a];return _0x5a8554;};'use strict';var _=require(_0x76e9('0x0'));var util=require(_0x76e9('0x1'));var logger=require(_0x76e9('0x2'))(_0x76e9('0x3'));var moment=require(_0x76e9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e9('0x5'));var rimraf=require(_0x76e9('0x6'));var config=require(_0x76e9('0x7'));var attributes=require(_0x76e9('0x8'));module[_0x76e9('0x9')]=function(_0x254ce3,_0x2653cd){return _0x254ce3[_0x76e9('0xa')](_0x76e9('0xb'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x57ff=['bluebird','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','util','api'];(function(_0x33a8f1,_0x55bb01){var _0x20630b=function(_0x492e35){while(--_0x492e35){_0x33a8f1['push'](_0x33a8f1['shift']());}};_0x20630b(++_0x55bb01);}(_0x57ff,0xa8));var _0xf57f=function(_0x4b0778,_0x1bb04a){_0x4b0778=_0x4b0778-0x0;var _0x21bd32=_0x57ff[_0x4b0778];return _0x21bd32;};'use strict';var _=require('lodash');var util=require(_0xf57f('0x0'));var logger=require('../../config/logger')(_0xf57f('0x1'));var moment=require('moment');var BPromise=require(_0xf57f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf57f('0x3'));var rimraf=require(_0xf57f('0x4'));var config=require(_0xf57f('0x5'));var attributes=require(_0xf57f('0x6'));module['exports']=function(_0x2e3ddc,_0x36a467){return _0x2e3ddc[_0xf57f('0x7')](_0xf57f('0x8'),attributes,{'tableName':_0xf57f('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 e9ac90b..24b504c 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 _0xfb0e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3738b0,_0x594867){var _0x328ab4=function(_0x434cf3){while(--_0x434cf3){_0x3738b0['push'](_0x3738b0['shift']());}};_0x328ab4(++_0x594867);}(_0xfb0e,0xa1));var _0xefb0=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xfb0e[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0xefb0('0x0'));var util=require(_0xefb0('0x1'));var moment=require(_0xefb0('0x2'));var BPromise=require(_0xefb0('0x3'));var rs=require(_0xefb0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefb0('0x5'))['db'];var utils=require(_0xefb0('0x6'));var logger=require(_0xefb0('0x7'))(_0xefb0('0x8'));var config=require(_0xefb0('0x9'));var jayson=require(_0xefb0('0xa'));var client=jayson[_0xefb0('0xb')][_0xefb0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22e97b,_0x17fffd,_0x4e9065){return new BPromise(function(_0x4797fd,_0x482f72){return client['request'](_0x22e97b,_0x4e9065)[_0xefb0('0xd')](function(_0x3a09ca){logger[_0xefb0('0xe')](_0xefb0('0xf'),_0x17fffd,_0xefb0('0x10'));logger[_0xefb0('0x11')](_0xefb0('0x12'),_0x17fffd,_0xefb0('0x10'),JSON['stringify'](_0x3a09ca));if(_0x3a09ca[_0xefb0('0x13')]){if(_0x3a09ca['error'][_0xefb0('0x14')]===0x1f4){logger[_0xefb0('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x17fffd,_0x3a09ca[_0xefb0('0x13')][_0xefb0('0x15')]);return _0x482f72(_0x3a09ca['error'][_0xefb0('0x15')]);}logger[_0xefb0('0x13')](_0xefb0('0xf'),_0x17fffd,_0x3a09ca[_0xefb0('0x13')]['message']);return _0x4797fd(_0x3a09ca[_0xefb0('0x13')]['message']);}else{logger[_0xefb0('0xe')](_0xefb0('0xf'),_0x17fffd,_0xefb0('0x10'));_0x4797fd(_0x3a09ca[_0xefb0('0x16')]['message']);}})[_0xefb0('0x17')](function(_0x48d769){logger[_0xefb0('0x13')](_0xefb0('0xf'),_0x17fffd,_0x48d769);_0x482f72(_0x48d769);});});} \ No newline at end of file +var _0x5947=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x138ad6,_0x4fbe79){var _0x4bfa73=function(_0x211099){while(--_0x211099){_0x138ad6['push'](_0x138ad6['shift']());}};_0x4bfa73(++_0x4fbe79);}(_0x5947,0x91));var _0x7594=function(_0x600d0f,_0xa775e2){_0x600d0f=_0x600d0f-0x0;var _0x237ea3=_0x5947[_0x600d0f];return _0x237ea3;};'use strict';var _=require(_0x7594('0x0'));var util=require(_0x7594('0x1'));var moment=require(_0x7594('0x2'));var BPromise=require(_0x7594('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7594('0x4'));var db=require(_0x7594('0x5'))['db'];var utils=require(_0x7594('0x6'));var logger=require(_0x7594('0x7'))('rpc');var config=require(_0x7594('0x8'));var jayson=require(_0x7594('0x9'));var client=jayson[_0x7594('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bb950,_0x2aa174,_0x3c8ff9){return new BPromise(function(_0xe0469b,_0x2fef87){return client[_0x7594('0xb')](_0x2bb950,_0x3c8ff9)[_0x7594('0xc')](function(_0x216b8e){logger['info'](_0x7594('0xd'),_0x2aa174,_0x7594('0xe'));logger[_0x7594('0xf')](_0x7594('0x10'),_0x2aa174,_0x7594('0xe'),JSON[_0x7594('0x11')](_0x216b8e));if(_0x216b8e[_0x7594('0x12')]){if(_0x216b8e[_0x7594('0x12')][_0x7594('0x13')]===0x1f4){logger[_0x7594('0x12')](_0x7594('0xd'),_0x2aa174,_0x216b8e[_0x7594('0x12')][_0x7594('0x14')]);return _0x2fef87(_0x216b8e[_0x7594('0x12')]['message']);}logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2aa174,_0x216b8e[_0x7594('0x12')][_0x7594('0x14')]);return _0xe0469b(_0x216b8e[_0x7594('0x12')][_0x7594('0x14')]);}else{logger[_0x7594('0x15')](_0x7594('0xd'),_0x2aa174,'request\x20sent');_0xe0469b(_0x216b8e[_0x7594('0x16')][_0x7594('0x14')]);}})['catch'](function(_0x57ef03){logger[_0x7594('0x12')](_0x7594('0xd'),_0x2aa174,_0x57ef03);_0x2fef87(_0x57ef03);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 4000359..b245ca1 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 _0x3e5c=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x106d02,_0x5034fe){_0x106d02=_0x106d02-0x0;var _0x45bad8=_0x3e5c[_0x106d02];return _0x45bad8;};'use strict';var multer=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var path=require(_0xc3e5('0x2'));var timeout=require(_0xc3e5('0x3'));var express=require('express');var router=express[_0xc3e5('0x4')]();var auth=require(_0xc3e5('0x5'));var interaction=require(_0xc3e5('0x6'));var config=require(_0xc3e5('0x7'));var controller=require(_0xc3e5('0x8'));router[_0xc3e5('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3e5('0xa')]);router[_0xc3e5('0x9')](_0xc3e5('0xb'),auth[_0xc3e5('0xc')](),controller[_0xc3e5('0xd')]);router['post']('/',auth[_0xc3e5('0xc')](),controller[_0xc3e5('0xe')]);router[_0xc3e5('0xf')](_0xc3e5('0xb'),auth[_0xc3e5('0xc')](),controller[_0xc3e5('0x10')]);router[_0xc3e5('0x11')]('/:id',auth[_0xc3e5('0xc')](),controller[_0xc3e5('0x12')]);module[_0xc3e5('0x13')]=router; \ No newline at end of file +var _0xbee3=['create','put','update','delete','destroy','util','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','/:id','show','post'];(function(_0x254856,_0x3328f5){var _0x230310=function(_0x1ea7c1){while(--_0x1ea7c1){_0x254856['push'](_0x254856['shift']());}};_0x230310(++_0x3328f5);}(_0xbee3,0xd5));var _0x3bee=function(_0x4ef56d,_0x1bd5a0){_0x4ef56d=_0x4ef56d-0x0;var _0x2cc2be=_0xbee3[_0x4ef56d];return _0x2cc2be;};'use strict';var multer=require('multer');var util=require(_0x3bee('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3bee('0x1'));var router=express[_0x3bee('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x3bee('0x3'));var config=require(_0x3bee('0x4'));var controller=require(_0x3bee('0x5'));router['get']('/',auth[_0x3bee('0x6')](),controller[_0x3bee('0x7')]);router['get'](_0x3bee('0x8'),auth[_0x3bee('0x6')](),controller[_0x3bee('0x9')]);router[_0x3bee('0xa')]('/',auth[_0x3bee('0x6')](),controller[_0x3bee('0xb')]);router[_0x3bee('0xc')]('/:id',auth[_0x3bee('0x6')](),controller[_0x3bee('0xd')]);router[_0x3bee('0xe')](_0x3bee('0x8'),auth[_0x3bee('0x6')](),controller[_0x3bee('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index ffa908a..c598f49 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 _0x4731=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x5cbb32,_0x233ace){var _0x49363c=function(_0x4649d1){while(--_0x4649d1){_0x5cbb32['push'](_0x5cbb32['shift']());}};_0x49363c(++_0x233ace);}(_0x4731,0xce));var _0x1473=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x4731[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x1473('0x0'));module[_0x1473('0x1')]={'type':{'type':Sequelize[_0x1473('0x2')](_0x1473('0x3'),_0x1473('0x4'),'customVariable',_0x1473('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1473('0x6')]},'keyType':{'type':Sequelize[_0x1473('0x2')](_0x1473('0x3'),'variable',_0x1473('0x7'))},'keyContent':{'type':Sequelize[_0x1473('0x6')]},'idField':{'type':Sequelize[_0x1473('0x6')]},'nameField':{'type':Sequelize[_0x1473('0x6')]},'customField':{'type':Sequelize[_0x1473('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x976f=['STRING','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x976f,0x121));var _0xf976=function(_0x579e23,_0x4d36e0){_0x579e23=_0x579e23-0x0;var _0x212c64=_0x976f[_0x579e23];return _0x212c64;};'use strict';var Sequelize=require(_0xf976('0x0'));module[_0xf976('0x1')]={'type':{'type':Sequelize[_0xf976('0x2')](_0xf976('0x3'),'variable',_0xf976('0x4'),'keyValue'),'defaultValue':_0xf976('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xf976('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xf976('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xf976('0x5')]},'idField':{'type':Sequelize[_0xf976('0x5')]},'nameField':{'type':Sequelize[_0xf976('0x5')]},'customField':{'type':Sequelize[_0xf976('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf976('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 0efc315..2f5cd58 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 _0xf446=['apply','reject','then','destroy','error','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','Dynamics365Field','includeAll','findAll','rows','show','include','options','create','catch','update','body','find','params','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json'];(function(_0x345041,_0x58d2f2){var _0x25819d=function(_0x1734dd){while(--_0x1734dd){_0x345041['push'](_0x345041['shift']());}};_0x25819d(++_0x58d2f2);}(_0xf446,0x1c0));var _0x6f44=function(_0x58f8fa,_0xf224c7){_0x58f8fa=_0x58f8fa-0x0;var _0x2b72a4=_0xf446[_0x58f8fa];return _0x2b72a4;};'use strict';var pdf=require(_0x6f44('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6f44('0x1'));var zipdir=require(_0x6f44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f44('0x3'));var moment=require('moment');var BPromise=require(_0x6f44('0x4'));var Mustache=require(_0x6f44('0x5'));var util=require('util');var path=require(_0x6f44('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f44('0x7'));var squel=require('squel');var crypto=require(_0x6f44('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f44('0x9'));var querystring=require('querystring');var Papa=require(_0x6f44('0xa'));var Redis=require(_0x6f44('0xb'));var authService=require(_0x6f44('0xc'));var qs=require(_0x6f44('0xd'));var as=require(_0x6f44('0xe'));var hardwareService=require(_0x6f44('0xf'));var logger=require(_0x6f44('0x10'))(_0x6f44('0x11'));var utils=require('../../config/utils');var config=require(_0x6f44('0x12'));var db=require(_0x6f44('0x13'))['db'];function respondWithStatusCode(_0x28ec05,_0x4bacc0){_0x4bacc0=_0x4bacc0||0xcc;return function(_0x305757){if(_0x305757){return _0x28ec05[_0x6f44('0x14')](_0x4bacc0);}return _0x28ec05[_0x6f44('0x15')](_0x4bacc0)[_0x6f44('0x16')]();};}function respondWithResult(_0x5bd6da,_0x82c009){_0x82c009=_0x82c009||0xc8;return function(_0x4f1b19){if(_0x4f1b19){return _0x5bd6da[_0x6f44('0x15')](_0x82c009)['json'](_0x4f1b19);}};}function respondWithFilteredResult(_0x5ee20e,_0x33e088){return function(_0xe5c968){if(_0xe5c968){var _0x33a130=_0xe5c968[_0x6f44('0x17')],_0x22200e=_0x33e088[_0x6f44('0x18')],_0x43b6cd=_0x33e088[_0x6f44('0x18')]+_0x33e088[_0x6f44('0x19')],_0x34a64d;if(_0x43b6cd>=_0x33a130){_0x43b6cd=_0x33a130;_0x34a64d=0xc8;}else{_0x34a64d=0xce;}_0x5ee20e[_0x6f44('0x15')](_0x34a64d);return _0x5ee20e['set'](_0x6f44('0x1a'),_0x22200e+'-'+_0x43b6cd+'/'+_0x33a130)[_0x6f44('0x1b')](_0xe5c968);}return null;};}function patchUpdates(_0x40f74c){return function(_0x39bc07){try{jsonpatch[_0x6f44('0x1c')](_0x39bc07,_0x40f74c,!![]);}catch(_0x57af2a){return BPromise[_0x6f44('0x1d')](_0x57af2a);}return _0x39bc07['save']();};}function saveUpdates(_0x43ca38,_0x57d6a2){return function(_0x3c1265){if(_0x3c1265){return _0x3c1265['update'](_0x43ca38)[_0x6f44('0x1e')](function(_0x2a1cff){return _0x2a1cff;});}return null;};}function removeEntity(_0x25b798,_0xf1a57c){return function(_0x1137db){if(_0x1137db){return _0x1137db[_0x6f44('0x1f')]()[_0x6f44('0x1e')](function(){_0x25b798[_0x6f44('0x15')](0xcc)[_0x6f44('0x16')]();});}};}function handleEntityNotFound(_0x50bbad,_0x56cbea){return function(_0x3583c7){if(!_0x3583c7){_0x50bbad[_0x6f44('0x14')](0x194);}return _0x3583c7;};}function handleError(_0x43faec,_0x3cdc68){_0x3cdc68=_0x3cdc68||0x1f4;return function(_0x3771d8){logger[_0x6f44('0x20')](_0x3771d8['stack']);if(_0x3771d8[_0x6f44('0x21')]){delete _0x3771d8[_0x6f44('0x21')];}_0x43faec['status'](_0x3cdc68)['send'](_0x3771d8);};}exports[_0x6f44('0x22')]=function(_0x38ebb4,_0x2a8d41){var _0x3773dd={},_0xe22f1e={},_0x16c879={'count':0x0,'rows':[]};var _0x4c994b=_[_0x6f44('0x23')](db['Dynamics365Field'][_0x6f44('0x24')],function(_0x6784ce){return{'name':_0x6784ce[_0x6f44('0x25')],'type':_0x6784ce['type'][_0x6f44('0x26')]};});_0xe22f1e[_0x6f44('0x27')]=_[_0x6f44('0x23')](_0x4c994b,'name');_0xe22f1e['query']=_[_0x6f44('0x28')](_0x38ebb4[_0x6f44('0x29')]);_0xe22f1e[_0x6f44('0x2a')]=_['intersection'](_0xe22f1e[_0x6f44('0x27')],_0xe22f1e[_0x6f44('0x29')]);_0x3773dd[_0x6f44('0x2b')]=_[_0x6f44('0x2c')](_0xe22f1e[_0x6f44('0x27')],qs[_0x6f44('0x2d')](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x2d')]));_0x3773dd[_0x6f44('0x2b')]=_0x3773dd[_0x6f44('0x2b')][_0x6f44('0x2e')]?_0x3773dd[_0x6f44('0x2b')]:_0xe22f1e['model'];if(!_0x38ebb4['query'][_0x6f44('0x2f')](_0x6f44('0x30'))){_0x3773dd[_0x6f44('0x19')]=qs['limit'](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x19')]);_0x3773dd[_0x6f44('0x18')]=qs[_0x6f44('0x18')](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x18')]);}_0x3773dd[_0x6f44('0x31')]=qs[_0x6f44('0x32')](_0x38ebb4[_0x6f44('0x29')]['sort']);_0x3773dd[_0x6f44('0x33')]=qs['filters'](_['pick'](_0x38ebb4['query'],_0xe22f1e[_0x6f44('0x2a')]));if(_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x34')]){_0x3773dd[_0x6f44('0x33')]=_[_0x6f44('0x35')](_0x3773dd['where'],{'$or':_[_0x6f44('0x23')](_0x4c994b,function(_0x30f3a6){if(_0x30f3a6[_0x6f44('0x36')]!=='VIRTUAL'){var _0x38ba8d={};_0x38ba8d[_0x30f3a6[_0x6f44('0x21')]]={'$like':'%'+_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x34')]+'%'};return _0x38ba8d;}})});}_0x3773dd=_[_0x6f44('0x35')]({},_0x3773dd,_0x38ebb4['options']);var _0x179985={'where':_0x3773dd[_0x6f44('0x33')]};return db[_0x6f44('0x37')]['count'](_0x179985)['then'](function(_0x4d8af2){_0x16c879[_0x6f44('0x17')]=_0x4d8af2;if(_0x38ebb4['query'][_0x6f44('0x38')]){_0x3773dd['include']=[{'all':!![]}];}return db[_0x6f44('0x37')][_0x6f44('0x39')](_0x3773dd);})[_0x6f44('0x1e')](function(_0x313f80){_0x16c879[_0x6f44('0x3a')]=_0x313f80;return _0x16c879;})[_0x6f44('0x1e')](respondWithFilteredResult(_0x2a8d41,_0x3773dd))['catch'](handleError(_0x2a8d41,null));};exports[_0x6f44('0x3b')]=function(_0x449096,_0x1536ca){var _0x297999={'raw':!![],'where':{'id':_0x449096['params']['id']}},_0x16b94e={};_0x16b94e[_0x6f44('0x27')]=_[_0x6f44('0x28')](db[_0x6f44('0x37')][_0x6f44('0x24')]);_0x16b94e[_0x6f44('0x29')]=_[_0x6f44('0x28')](_0x449096[_0x6f44('0x29')]);_0x16b94e[_0x6f44('0x2a')]=_[_0x6f44('0x2c')](_0x16b94e['model'],_0x16b94e[_0x6f44('0x29')]);_0x297999['attributes']=_[_0x6f44('0x2c')](_0x16b94e[_0x6f44('0x27')],qs[_0x6f44('0x2d')](_0x449096[_0x6f44('0x29')]['fields']));_0x297999[_0x6f44('0x2b')]=_0x297999[_0x6f44('0x2b')]['length']?_0x297999[_0x6f44('0x2b')]:_0x16b94e[_0x6f44('0x27')];if(_0x449096[_0x6f44('0x29')][_0x6f44('0x38')]){_0x297999[_0x6f44('0x3c')]=[{'all':!![]}];}_0x297999=_[_0x6f44('0x35')]({},_0x297999,_0x449096[_0x6f44('0x3d')]);return db[_0x6f44('0x37')]['find'](_0x297999)[_0x6f44('0x1e')](handleEntityNotFound(_0x1536ca,null))[_0x6f44('0x1e')](respondWithResult(_0x1536ca,null))['catch'](handleError(_0x1536ca,null));};exports[_0x6f44('0x3e')]=function(_0x4e8f9e,_0x4f4c55){return db['Dynamics365Field'][_0x6f44('0x3e')](_0x4e8f9e['body'],{})['then'](respondWithResult(_0x4f4c55,0xc9))[_0x6f44('0x3f')](handleError(_0x4f4c55,null));};exports[_0x6f44('0x40')]=function(_0x3e1a61,_0x416ee2){if(_0x3e1a61[_0x6f44('0x41')]['id']){delete _0x3e1a61['body']['id'];}return db[_0x6f44('0x37')][_0x6f44('0x42')]({'where':{'id':_0x3e1a61[_0x6f44('0x43')]['id']}})[_0x6f44('0x1e')](handleEntityNotFound(_0x416ee2,null))[_0x6f44('0x1e')](saveUpdates(_0x3e1a61['body'],null))[_0x6f44('0x1e')](respondWithResult(_0x416ee2,null))[_0x6f44('0x3f')](handleError(_0x416ee2,null));};exports[_0x6f44('0x1f')]=function(_0x2087f7,_0x45c6df){return db['Dynamics365Field']['find']({'where':{'id':_0x2087f7[_0x6f44('0x43')]['id']}})['then'](handleEntityNotFound(_0x45c6df,null))[_0x6f44('0x1e')](removeEntity(_0x45c6df,null))['catch'](handleError(_0x45c6df,null));}; \ No newline at end of file +var _0xa647=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','save','update','then','error','name','send','index','map','Dynamics365Field','fieldName','type','key','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4864ef,_0x30657d){var _0x3c2a9d=function(_0x4e3e81){while(--_0x4e3e81){_0x4864ef['push'](_0x4864ef['shift']());}};_0x3c2a9d(++_0x30657d);}(_0xa647,0x81));var _0x7a64=function(_0x36a416,_0x516ecf){_0x36a416=_0x36a416-0x0;var _0x917214=_0xa647[_0x36a416];return _0x917214;};'use strict';var pdf=require(_0x7a64('0x0'));var emlformat=require(_0x7a64('0x1'));var rimraf=require(_0x7a64('0x2'));var zipdir=require(_0x7a64('0x3'));var jsonpatch=require(_0x7a64('0x4'));var rp=require(_0x7a64('0x5'));var moment=require(_0x7a64('0x6'));var BPromise=require(_0x7a64('0x7'));var Mustache=require(_0x7a64('0x8'));var util=require(_0x7a64('0x9'));var path=require(_0x7a64('0xa'));var sox=require(_0x7a64('0xb'));var csv=require('to-csv');var ejs=require(_0x7a64('0xc'));var fs=require('fs');var _=require(_0x7a64('0xd'));var squel=require('squel');var crypto=require(_0x7a64('0xe'));var jsforce=require(_0x7a64('0xf'));var deskjs=require(_0x7a64('0x10'));var toCsv=require(_0x7a64('0x11'));var querystring=require(_0x7a64('0x12'));var Papa=require(_0x7a64('0x13'));var Redis=require(_0x7a64('0x14'));var authService=require(_0x7a64('0x15'));var qs=require(_0x7a64('0x16'));var as=require(_0x7a64('0x17'));var hardwareService=require(_0x7a64('0x18'));var logger=require(_0x7a64('0x19'))(_0x7a64('0x1a'));var utils=require('../../config/utils');var config=require(_0x7a64('0x1b'));var db=require(_0x7a64('0x1c'))['db'];function respondWithStatusCode(_0x4bf912,_0x10d549){_0x10d549=_0x10d549||0xcc;return function(_0x5923c){if(_0x5923c){return _0x4bf912[_0x7a64('0x1d')](_0x10d549);}return _0x4bf912['status'](_0x10d549)[_0x7a64('0x1e')]();};}function respondWithResult(_0x2be452,_0x38e79b){_0x38e79b=_0x38e79b||0xc8;return function(_0x293021){if(_0x293021){return _0x2be452[_0x7a64('0x1f')](_0x38e79b)[_0x7a64('0x20')](_0x293021);}};}function respondWithFilteredResult(_0x2ca395,_0x4829f8){return function(_0x136263){if(_0x136263){var _0x5ae1c3=_0x136263[_0x7a64('0x21')],_0x47a13d=_0x4829f8['offset'],_0x3cb4f3=_0x4829f8[_0x7a64('0x22')]+_0x4829f8['limit'],_0x6c2094;if(_0x3cb4f3>=_0x5ae1c3){_0x3cb4f3=_0x5ae1c3;_0x6c2094=0xc8;}else{_0x6c2094=0xce;}_0x2ca395[_0x7a64('0x1f')](_0x6c2094);return _0x2ca395['set'](_0x7a64('0x23'),_0x47a13d+'-'+_0x3cb4f3+'/'+_0x5ae1c3)['json'](_0x136263);}return null;};}function patchUpdates(_0xde1d73){return function(_0x1c062e){try{jsonpatch['apply'](_0x1c062e,_0xde1d73,!![]);}catch(_0x5dfedd){return BPromise['reject'](_0x5dfedd);}return _0x1c062e[_0x7a64('0x24')]();};}function saveUpdates(_0x17096a,_0x4f56ab){return function(_0x57fa06){if(_0x57fa06){return _0x57fa06[_0x7a64('0x25')](_0x17096a)['then'](function(_0x81ccc){return _0x81ccc;});}return null;};}function removeEntity(_0xdabfea,_0x435abe){return function(_0x2e78af){if(_0x2e78af){return _0x2e78af['destroy']()[_0x7a64('0x26')](function(){_0xdabfea[_0x7a64('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2caaa4,_0xdfce54){return function(_0x61efd8){if(!_0x61efd8){_0x2caaa4[_0x7a64('0x1d')](0x194);}return _0x61efd8;};}function handleError(_0x5c18d4,_0x5cb2c7){_0x5cb2c7=_0x5cb2c7||0x1f4;return function(_0x308341){logger[_0x7a64('0x27')](_0x308341['stack']);if(_0x308341[_0x7a64('0x28')]){delete _0x308341['name'];}_0x5c18d4[_0x7a64('0x1f')](_0x5cb2c7)[_0x7a64('0x29')](_0x308341);};}exports[_0x7a64('0x2a')]=function(_0x102a29,_0x2d8f18){var _0x416e30={},_0x441a1f={},_0x7543c3={'count':0x0,'rows':[]};var _0x3c0345=_[_0x7a64('0x2b')](db[_0x7a64('0x2c')]['rawAttributes'],function(_0x1ce700){return{'name':_0x1ce700[_0x7a64('0x2d')],'type':_0x1ce700[_0x7a64('0x2e')][_0x7a64('0x2f')]};});_0x441a1f['model']=_[_0x7a64('0x2b')](_0x3c0345,'name');_0x441a1f[_0x7a64('0x30')]=_['keys'](_0x102a29[_0x7a64('0x30')]);_0x441a1f['filters']=_['intersection'](_0x441a1f[_0x7a64('0x31')],_0x441a1f[_0x7a64('0x30')]);_0x416e30[_0x7a64('0x32')]=_[_0x7a64('0x33')](_0x441a1f['model'],qs[_0x7a64('0x34')](_0x102a29[_0x7a64('0x30')][_0x7a64('0x34')]));_0x416e30[_0x7a64('0x32')]=_0x416e30['attributes'][_0x7a64('0x35')]?_0x416e30[_0x7a64('0x32')]:_0x441a1f['model'];if(!_0x102a29['query'][_0x7a64('0x36')](_0x7a64('0x37'))){_0x416e30[_0x7a64('0x38')]=qs[_0x7a64('0x38')](_0x102a29[_0x7a64('0x30')]['limit']);_0x416e30[_0x7a64('0x22')]=qs[_0x7a64('0x22')](_0x102a29[_0x7a64('0x30')][_0x7a64('0x22')]);}_0x416e30[_0x7a64('0x39')]=qs['sort'](_0x102a29[_0x7a64('0x30')][_0x7a64('0x3a')]);_0x416e30[_0x7a64('0x3b')]=qs[_0x7a64('0x3c')](_['pick'](_0x102a29[_0x7a64('0x30')],_0x441a1f[_0x7a64('0x3c')]));if(_0x102a29[_0x7a64('0x30')]['filter']){_0x416e30[_0x7a64('0x3b')]=_[_0x7a64('0x3d')](_0x416e30[_0x7a64('0x3b')],{'$or':_[_0x7a64('0x2b')](_0x3c0345,function(_0x345474){if(_0x345474['type']!==_0x7a64('0x3e')){var _0x3b6ffc={};_0x3b6ffc[_0x345474[_0x7a64('0x28')]]={'$like':'%'+_0x102a29[_0x7a64('0x30')][_0x7a64('0x3f')]+'%'};return _0x3b6ffc;}})});}_0x416e30=_['merge']({},_0x416e30,_0x102a29[_0x7a64('0x40')]);var _0x4dcfa1={'where':_0x416e30[_0x7a64('0x3b')]};return db[_0x7a64('0x2c')][_0x7a64('0x21')](_0x4dcfa1)[_0x7a64('0x26')](function(_0x1a8c77){_0x7543c3[_0x7a64('0x21')]=_0x1a8c77;if(_0x102a29[_0x7a64('0x30')][_0x7a64('0x41')]){_0x416e30[_0x7a64('0x42')]=[{'all':!![]}];}return db['Dynamics365Field'][_0x7a64('0x43')](_0x416e30);})[_0x7a64('0x26')](function(_0x351fdc){_0x7543c3[_0x7a64('0x44')]=_0x351fdc;return _0x7543c3;})[_0x7a64('0x26')](respondWithFilteredResult(_0x2d8f18,_0x416e30))[_0x7a64('0x45')](handleError(_0x2d8f18,null));};exports['show']=function(_0x4971e9,_0x591a16){var _0x77b1e1={'raw':!![],'where':{'id':_0x4971e9[_0x7a64('0x46')]['id']}},_0x3dc99e={};_0x3dc99e[_0x7a64('0x31')]=_[_0x7a64('0x47')](db[_0x7a64('0x2c')][_0x7a64('0x48')]);_0x3dc99e[_0x7a64('0x30')]=_['keys'](_0x4971e9[_0x7a64('0x30')]);_0x3dc99e[_0x7a64('0x3c')]=_[_0x7a64('0x33')](_0x3dc99e[_0x7a64('0x31')],_0x3dc99e[_0x7a64('0x30')]);_0x77b1e1[_0x7a64('0x32')]=_[_0x7a64('0x33')](_0x3dc99e[_0x7a64('0x31')],qs['fields'](_0x4971e9[_0x7a64('0x30')][_0x7a64('0x34')]));_0x77b1e1[_0x7a64('0x32')]=_0x77b1e1[_0x7a64('0x32')]['length']?_0x77b1e1[_0x7a64('0x32')]:_0x3dc99e[_0x7a64('0x31')];if(_0x4971e9[_0x7a64('0x30')][_0x7a64('0x41')]){_0x77b1e1[_0x7a64('0x42')]=[{'all':!![]}];}_0x77b1e1=_[_0x7a64('0x3d')]({},_0x77b1e1,_0x4971e9[_0x7a64('0x40')]);return db[_0x7a64('0x2c')][_0x7a64('0x49')](_0x77b1e1)['then'](handleEntityNotFound(_0x591a16,null))[_0x7a64('0x26')](respondWithResult(_0x591a16,null))[_0x7a64('0x45')](handleError(_0x591a16,null));};exports[_0x7a64('0x4a')]=function(_0xf7b7cb,_0x2e325b){return db['Dynamics365Field'][_0x7a64('0x4a')](_0xf7b7cb[_0x7a64('0x4b')],{})[_0x7a64('0x26')](respondWithResult(_0x2e325b,0xc9))[_0x7a64('0x45')](handleError(_0x2e325b,null));};exports[_0x7a64('0x25')]=function(_0x2b3148,_0x44dc00){if(_0x2b3148['body']['id']){delete _0x2b3148['body']['id'];}return db[_0x7a64('0x2c')]['find']({'where':{'id':_0x2b3148[_0x7a64('0x46')]['id']}})['then'](handleEntityNotFound(_0x44dc00,null))[_0x7a64('0x26')](saveUpdates(_0x2b3148['body'],null))[_0x7a64('0x26')](respondWithResult(_0x44dc00,null))[_0x7a64('0x45')](handleError(_0x44dc00,null));};exports[_0x7a64('0x4c')]=function(_0x63773e,_0x3f4f61){return db[_0x7a64('0x2c')]['find']({'where':{'id':_0x63773e[_0x7a64('0x46')]['id']}})[_0x7a64('0x26')](handleEntityNotFound(_0x3f4f61,null))[_0x7a64('0x26')](removeEntity(_0x3f4f61,null))[_0x7a64('0x45')](handleError(_0x3f4f61,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 84a3ab4..adfeaa0 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 _0x14fd=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x431e5f,_0x19a8b8){var _0x1ad9b8=function(_0x39714b){while(--_0x39714b){_0x431e5f['push'](_0x431e5f['shift']());}};_0x1ad9b8(++_0x19a8b8);}(_0x14fd,0x12d));var _0xd14f=function(_0x1ccb7b,_0x487c93){_0x1ccb7b=_0x1ccb7b-0x0;var _0x58938c=_0x14fd[_0x1ccb7b];return _0x58938c;};'use strict';var _=require(_0xd14f('0x0'));var util=require(_0xd14f('0x1'));var logger=require(_0xd14f('0x2'))(_0xd14f('0x3'));var moment=require(_0xd14f('0x4'));var BPromise=require('bluebird');var rp=require(_0xd14f('0x5'));var fs=require('fs');var path=require(_0xd14f('0x6'));var rimraf=require(_0xd14f('0x7'));var config=require(_0xd14f('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xd14f('0x9')]=function(_0x373680,_0x49bd47){return _0x373680[_0xd14f('0xa')](_0xd14f('0xb'),attributes,{'tableName':_0xd14f('0xc'),'paranoid':![],'indexes':[{'name':_0xd14f('0xd'),'fields':[_0xd14f('0xe'),_0xd14f('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4637=['dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Field.attributes','exports','Dynamics365Field','int_dynamics365_fields'];(function(_0xedea91,_0x506188){var _0x59be92=function(_0xa4b144){while(--_0xa4b144){_0xedea91['push'](_0xedea91['shift']());}};_0x59be92(++_0x506188);}(_0x4637,0x1c3));var _0x7463=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x4637[_0x3054be];return _0x3df150;};'use strict';var _=require(_0x7463('0x0'));var util=require(_0x7463('0x1'));var logger=require(_0x7463('0x2'))(_0x7463('0x3'));var moment=require(_0x7463('0x4'));var BPromise=require(_0x7463('0x5'));var rp=require(_0x7463('0x6'));var fs=require('fs');var path=require(_0x7463('0x7'));var rimraf=require(_0x7463('0x8'));var config=require('../../config/environment');var attributes=require(_0x7463('0x9'));module[_0x7463('0xa')]=function(_0x58c084,_0x47250b){return _0x58c084['define'](_0x7463('0xb'),attributes,{'tableName':_0x7463('0xc'),'paranoid':![],'indexes':[{'name':_0x7463('0xd'),'fields':[_0x7463('0xe'),_0x7463('0xf')],'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 914a426..10ee3bc 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 _0x0650=['info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0650,0xed));var _0x0065=function(_0x164424,_0x159ae3){_0x164424=_0x164424-0x0;var _0x25af19=_0x0650[_0x164424];return _0x25af19;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var moment=require(_0x0065('0x1'));var BPromise=require(_0x0065('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0065('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0065('0x4'));var logger=require(_0x0065('0x5'))(_0x0065('0x6'));var config=require('../../config/environment');var jayson=require(_0x0065('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59f241,_0x20dd36,_0x415835){return new BPromise(function(_0xefa3cb,_0x3fe697){return client[_0x0065('0x8')](_0x59f241,_0x415835)[_0x0065('0x9')](function(_0x8974f){logger[_0x0065('0xa')](_0x0065('0xb'),_0x20dd36,'request\x20sent');logger[_0x0065('0xc')](_0x0065('0xd'),_0x20dd36,'request\x20sent',JSON['stringify'](_0x8974f));if(_0x8974f['error']){if(_0x8974f[_0x0065('0xe')][_0x0065('0xf')]===0x1f4){logger['error'](_0x0065('0xb'),_0x20dd36,_0x8974f[_0x0065('0xe')]['message']);return _0x3fe697(_0x8974f[_0x0065('0xe')][_0x0065('0x10')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x20dd36,_0x8974f[_0x0065('0xe')]['message']);return _0xefa3cb(_0x8974f['error'][_0x0065('0x10')]);}else{logger['info'](_0x0065('0xb'),_0x20dd36,'request\x20sent');_0xefa3cb(_0x8974f[_0x0065('0x11')][_0x0065('0x10')]);}})[_0x0065('0x12')](function(_0x2b5df9){logger[_0x0065('0xe')](_0x0065('0xb'),_0x20dd36,_0x2b5df9);_0x3fe697(_0x2b5df9);});});} \ No newline at end of file +var _0x66c7=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','randomstring'];(function(_0x411b30,_0x28ed3f){var _0x523454=function(_0xc4ca64){while(--_0xc4ca64){_0x411b30['push'](_0x411b30['shift']());}};_0x523454(++_0x28ed3f);}(_0x66c7,0x15c));var _0x766c=function(_0x5158c1,_0xf866aa){_0x5158c1=_0x5158c1-0x0;var _0x4ca1cb=_0x66c7[_0x5158c1];return _0x4ca1cb;};'use strict';var _=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var moment=require(_0x766c('0x2'));var BPromise=require('bluebird');var rs=require(_0x766c('0x3'));var fs=require('fs');var Redis=require(_0x766c('0x4'));var db=require(_0x766c('0x5'))['db'];var utils=require(_0x766c('0x6'));var logger=require(_0x766c('0x7'))(_0x766c('0x8'));var config=require('../../config/environment');var jayson=require(_0x766c('0x9'));var client=jayson[_0x766c('0xa')][_0x766c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb0b5f7,_0x46d290,_0x3c4683){return new BPromise(function(_0x22a524,_0x4488b8){return client['request'](_0xb0b5f7,_0x3c4683)['then'](function(_0x141744){logger[_0x766c('0xc')](_0x766c('0xd'),_0x46d290,'request\x20sent');logger[_0x766c('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x46d290,_0x766c('0xf'),JSON[_0x766c('0x10')](_0x141744));if(_0x141744[_0x766c('0x11')]){if(_0x141744[_0x766c('0x11')][_0x766c('0x12')]===0x1f4){logger[_0x766c('0x11')](_0x766c('0xd'),_0x46d290,_0x141744[_0x766c('0x11')][_0x766c('0x13')]);return _0x4488b8(_0x141744[_0x766c('0x11')][_0x766c('0x13')]);}logger[_0x766c('0x11')](_0x766c('0xd'),_0x46d290,_0x141744[_0x766c('0x11')][_0x766c('0x13')]);return _0x22a524(_0x141744['error']['message']);}else{logger['info'](_0x766c('0xd'),_0x46d290,_0x766c('0xf'));_0x22a524(_0x141744[_0x766c('0x14')][_0x766c('0x13')]);}})[_0x766c('0x15')](function(_0x357602){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x46d290,_0x357602);_0x4488b8(_0x357602);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1f42137..4685e73 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 _0x31f3=['/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x31f3,0x179));var _0x331f=function(_0x27c1ab,_0x3734be){_0x27c1ab=_0x27c1ab-0x0;var _0x5087a3=_0x31f3[_0x27c1ab];return _0x5087a3;};'use strict';var multer=require('multer');var util=require(_0x331f('0x0'));var path=require(_0x331f('0x1'));var timeout=require(_0x331f('0x2'));var express=require(_0x331f('0x3'));var router=express[_0x331f('0x4')]();var auth=require(_0x331f('0x5'));var interaction=require(_0x331f('0x6'));var config=require('../../config/environment');var controller=require(_0x331f('0x7'));router[_0x331f('0x8')]('/',auth[_0x331f('0x9')](),controller[_0x331f('0xa')]);router[_0x331f('0x8')](_0x331f('0xb'),auth[_0x331f('0x9')](),controller[_0x331f('0xc')]);router[_0x331f('0x8')]('/:id/configurations',auth[_0x331f('0x9')](),controller[_0x331f('0xd')]);router[_0x331f('0x8')](_0x331f('0xe'),auth[_0x331f('0x9')](),controller[_0x331f('0xf')]);router[_0x331f('0x10')]('/',auth[_0x331f('0x9')](),controller[_0x331f('0x11')]);router[_0x331f('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x331f('0x12')]);router[_0x331f('0x13')](_0x331f('0xb'),auth[_0x331f('0x9')](),controller[_0x331f('0x14')]);router['delete'](_0x331f('0xb'),auth[_0x331f('0x9')](),controller[_0x331f('0x15')]);module[_0x331f('0x16')]=router; \ No newline at end of file +var _0x7ef0=['/:id','destroy','multer','util','connect-timeout','Router','../../components/interaction/service','./intFreshdeskAccount.controller','isAuthenticated','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete'];(function(_0x54c67c,_0x37c51a){var _0x3ee092=function(_0x26b6b7){while(--_0x26b6b7){_0x54c67c['push'](_0x54c67c['shift']());}};_0x3ee092(++_0x37c51a);}(_0x7ef0,0x7a));var _0x07ef=function(_0x1e3d6b,_0x4acdf2){_0x1e3d6b=_0x1e3d6b-0x0;var _0x30f63a=_0x7ef0[_0x1e3d6b];return _0x30f63a;};'use strict';var multer=require(_0x07ef('0x0'));var util=require(_0x07ef('0x1'));var path=require('path');var timeout=require(_0x07ef('0x2'));var express=require('express');var router=express[_0x07ef('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x07ef('0x4'));var config=require('../../config/environment');var controller=require(_0x07ef('0x5'));router['get']('/',auth[_0x07ef('0x6')](),controller['index']);router[_0x07ef('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x07ef('0x8'),auth['isAuthenticated'](),controller[_0x07ef('0x9')]);router[_0x07ef('0x7')](_0x07ef('0xa'),auth['isAuthenticated'](),controller[_0x07ef('0xb')]);router[_0x07ef('0xc')]('/',auth[_0x07ef('0x6')](),controller[_0x07ef('0xd')]);router[_0x07ef('0xc')]('/:id/configurations',auth[_0x07ef('0x6')](),controller[_0x07ef('0xe')]);router[_0x07ef('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x07ef('0x10')]);router[_0x07ef('0x11')](_0x07ef('0x12'),auth['isAuthenticated'](),controller[_0x07ef('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 133fa6c..fadbb28 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 _0x5a3c=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5a3c,0x176));var _0xc5a3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5a3c[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xc5a3('0x0'));module[_0xc5a3('0x1')]={'name':{'type':Sequelize[_0xc5a3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc5a3('0x2')],'unique':_0xc5a3('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc5a3('0x2')],'unique':_0xc5a3('0x4')},'serverUrl':{'type':Sequelize[_0xc5a3('0x2')]}}; \ No newline at end of file +var _0x0b7f=['username','sequelize','exports','STRING'];(function(_0x5d6959,_0x26904f){var _0x5cbba8=function(_0x1b0e9e){while(--_0x1b0e9e){_0x5d6959['push'](_0x5d6959['shift']());}};_0x5cbba8(++_0x26904f);}(_0x0b7f,0x115));var _0xf0b7=function(_0x4a0b53,_0x41b5d5){_0x4a0b53=_0x4a0b53-0x0;var _0x45e6be=_0x0b7f[_0x4a0b53];return _0x45e6be;};'use strict';var Sequelize=require(_0xf0b7('0x0'));module[_0xf0b7('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf0b7('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xf0b7('0x3')},'apiKey':{'type':Sequelize[_0xf0b7('0x2')]},'remoteUri':{'type':Sequelize[_0xf0b7('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 49c3cf1..0067d86 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 _0x7563=['getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s:X','toString','requester','agent','priority','ticket_type','group','remove','includes','default','custom_text','label','choices','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','count','offset','limit','Content-Range','reject','then','destroy','sendStatus','name','send','index','FreshdeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','includeAll','include','rows','params','fields','create','body','update','find','getConfigurations','FreshdeskConfiguration','order','addConfiguration','findOne','getSubjects','channel','getDescriptions','Subjects','FreshdeskField'];(function(_0x23077a,_0x33f8e1){var _0x593523=function(_0x49c3ff){while(--_0x49c3ff){_0x23077a['push'](_0x23077a['shift']());}};_0x593523(++_0x33f8e1);}(_0x7563,0x1eb));var _0x3756=function(_0x576856,_0x4e6e3c){_0x576856=_0x576856-0x0;var _0x78de43=_0x7563[_0x576856];return _0x78de43;};'use strict';var pdf=require(_0x3756('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3756('0x1'));var zipdir=require(_0x3756('0x2'));var jsonpatch=require(_0x3756('0x3'));var rp=require(_0x3756('0x4'));var moment=require('moment');var BPromise=require(_0x3756('0x5'));var Mustache=require(_0x3756('0x6'));var util=require(_0x3756('0x7'));var path=require('path');var sox=require(_0x3756('0x8'));var csv=require(_0x3756('0x9'));var ejs=require(_0x3756('0xa'));var fs=require('fs');var _=require(_0x3756('0xb'));var squel=require(_0x3756('0xc'));var crypto=require(_0x3756('0xd'));var jsforce=require(_0x3756('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3756('0x9'));var querystring=require(_0x3756('0xf'));var Papa=require('papaparse');var Redis=require(_0x3756('0x10'));var authService=require(_0x3756('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3756('0x12'));var logger=require('../../config/logger')(_0x3756('0x13'));var utils=require('../../config/utils');var config=require(_0x3756('0x14'));var db=require(_0x3756('0x15'))['db'];var integrations=require(_0x3756('0x16'));var jayson=require(_0x3756('0x17'));var client=jayson[_0x3756('0x18')][_0x3756('0x19')]({'port':0x232a});function checkPasswordPattern(_0x57f775,_0x55f9b8,_0x33467e){if(_0x33467e){var _0x25b8f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25b8f0[_0x3756('0x1a')](_0x55f9b8)){return _0x57f775;}else{throw new db[(_0x3756('0x1b'))][(_0x3756('0x1c'))](_0x3756('0x1d'));}}else{return _0x57f775;}}function respondWithRpcPromise(_0x5578da,_0x1ba34e,_0x121e8f,_0x2d7b71){return new BPromise(function(_0x1597e7,_0x31e181){var _0x3cb6f7=_0x2d7b71||client;return _0x3cb6f7[_0x3756('0x1e')](_0x5578da,_0x121e8f)['then'](function(_0x8318da){logger[_0x3756('0x1f')](_0x3756('0x20'),_0x1ba34e,'request\x20sent');logger[_0x3756('0x21')](_0x3756('0x22'),_0x1ba34e,_0x3756('0x23'),JSON[_0x3756('0x24')](_0x8318da));if(_0x8318da['error']){if(_0x8318da[_0x3756('0x25')][_0x3756('0x26')]===0x1f4){logger['error'](_0x3756('0x20'),_0x1ba34e,_0x8318da[_0x3756('0x25')]['message']);return _0x31e181(_0x8318da[_0x3756('0x25')][_0x3756('0x27')]);}logger[_0x3756('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x1ba34e,_0x8318da['error'][_0x3756('0x27')]);return _0x1597e7(_0x8318da[_0x3756('0x25')][_0x3756('0x27')]);}else{logger[_0x3756('0x1f')](_0x3756('0x20'),_0x1ba34e,_0x3756('0x23'));_0x1597e7(_0x8318da[_0x3756('0x28')][_0x3756('0x27')]);}})[_0x3756('0x29')](function(_0x3de08c){logger[_0x3756('0x25')](_0x3756('0x20'),_0x1ba34e,_0x3de08c);_0x31e181(_0x3de08c);});});}function respondWithStatusCode(_0x3b9133,_0x3b5413){_0x3b5413=_0x3b5413||0xcc;return function(_0x349825){if(_0x349825){return _0x3b9133['sendStatus'](_0x3b5413);}return _0x3b9133[_0x3756('0x2a')](_0x3b5413)[_0x3756('0x2b')]();};}function respondWithResult(_0x4007c9,_0x130df3){_0x130df3=_0x130df3||0xc8;return function(_0x3bc773){if(_0x3bc773){return _0x4007c9[_0x3756('0x2a')](_0x130df3)['json'](_0x3bc773);}};}function respondWithFilteredResult(_0x2a9c44,_0x144280){return function(_0x1e7dd8){if(_0x1e7dd8){var _0x1c9652=_0x1e7dd8[_0x3756('0x2c')],_0x9b7b6e=_0x144280[_0x3756('0x2d')],_0x2d9ed0=_0x144280[_0x3756('0x2d')]+_0x144280[_0x3756('0x2e')],_0x38e8e3;if(_0x2d9ed0>=_0x1c9652){_0x2d9ed0=_0x1c9652;_0x38e8e3=0xc8;}else{_0x38e8e3=0xce;}_0x2a9c44[_0x3756('0x2a')](_0x38e8e3);return _0x2a9c44['set'](_0x3756('0x2f'),_0x9b7b6e+'-'+_0x2d9ed0+'/'+_0x1c9652)['json'](_0x1e7dd8);}return null;};}function patchUpdates(_0x1ae37c){return function(_0x2f554f){try{jsonpatch['apply'](_0x2f554f,_0x1ae37c,!![]);}catch(_0x4e6e18){return BPromise[_0x3756('0x30')](_0x4e6e18);}return _0x2f554f['save']();};}function saveUpdates(_0x58b3ba,_0xcafd39){return function(_0x544d4a){if(_0x544d4a){return _0x544d4a['update'](_0x58b3ba)[_0x3756('0x31')](function(_0x1659e8){return _0x1659e8;});}return null;};}function removeEntity(_0x34d547,_0x430dde){return function(_0x5a5ce3){if(_0x5a5ce3){return _0x5a5ce3[_0x3756('0x32')]()[_0x3756('0x31')](function(){_0x34d547[_0x3756('0x2a')](0xcc)[_0x3756('0x2b')]();});}};}function handleEntityNotFound(_0x2160fa,_0x310218){return function(_0x2df629){if(!_0x2df629){_0x2160fa[_0x3756('0x33')](0x194);}return _0x2df629;};}function handleError(_0x563e88,_0x2914cc){_0x2914cc=_0x2914cc||0x1f4;return function(_0x34f718){logger[_0x3756('0x25')](_0x34f718['stack']);if(_0x34f718[_0x3756('0x34')]){delete _0x34f718[_0x3756('0x34')];}_0x563e88[_0x3756('0x2a')](_0x2914cc)[_0x3756('0x35')](_0x34f718);};}exports[_0x3756('0x36')]=function(_0x1cd998,_0x4c990e){var _0x5ef4ce={},_0x468c3a={},_0x3c7d3d={'count':0x0,'rows':[]};var _0x2e3626=_['map'](db[_0x3756('0x37')][_0x3756('0x38')],function(_0x589a54){return{'name':_0x589a54['fieldName'],'type':_0x589a54[_0x3756('0x39')][_0x3756('0x3a')]};});_0x468c3a[_0x3756('0x3b')]=_[_0x3756('0x3c')](_0x2e3626,_0x3756('0x34'));_0x468c3a[_0x3756('0x3d')]=_[_0x3756('0x3e')](_0x1cd998[_0x3756('0x3d')]);_0x468c3a[_0x3756('0x3f')]=_[_0x3756('0x40')](_0x468c3a[_0x3756('0x3b')],_0x468c3a['query']);_0x5ef4ce['attributes']=_[_0x3756('0x40')](_0x468c3a['model'],qs['fields'](_0x1cd998[_0x3756('0x3d')]['fields']));_0x5ef4ce[_0x3756('0x41')]=_0x5ef4ce['attributes'][_0x3756('0x42')]?_0x5ef4ce[_0x3756('0x41')]:_0x468c3a[_0x3756('0x3b')];if(!_0x1cd998[_0x3756('0x3d')][_0x3756('0x43')](_0x3756('0x44'))){_0x5ef4ce[_0x3756('0x2e')]=qs[_0x3756('0x2e')](_0x1cd998[_0x3756('0x3d')][_0x3756('0x2e')]);_0x5ef4ce['offset']=qs[_0x3756('0x2d')](_0x1cd998[_0x3756('0x3d')][_0x3756('0x2d')]);}_0x5ef4ce['order']=qs[_0x3756('0x45')](_0x1cd998[_0x3756('0x3d')][_0x3756('0x45')]);_0x5ef4ce['where']=qs[_0x3756('0x3f')](_['pick'](_0x1cd998['query'],_0x468c3a[_0x3756('0x3f')]));if(_0x1cd998['query'][_0x3756('0x46')]){_0x5ef4ce['where']=_[_0x3756('0x47')](_0x5ef4ce['where'],{'$or':_['map'](_0x2e3626,function(_0x15fc84){if(_0x15fc84[_0x3756('0x39')]!==_0x3756('0x48')){var _0x585aad={};_0x585aad[_0x15fc84[_0x3756('0x34')]]={'$like':'%'+_0x1cd998[_0x3756('0x3d')]['filter']+'%'};return _0x585aad;}})});}_0x5ef4ce=_[_0x3756('0x47')]({},_0x5ef4ce,_0x1cd998[_0x3756('0x49')]);var _0x567e35={'where':_0x5ef4ce[_0x3756('0x4a')]};return db[_0x3756('0x37')][_0x3756('0x2c')](_0x567e35)[_0x3756('0x31')](function(_0x39f489){_0x3c7d3d[_0x3756('0x2c')]=_0x39f489;if(_0x1cd998[_0x3756('0x3d')][_0x3756('0x4b')]){_0x5ef4ce[_0x3756('0x4c')]=[{'all':!![]}];}return db[_0x3756('0x37')]['findAll'](_0x5ef4ce);})[_0x3756('0x31')](function(_0x1bccb7){_0x3c7d3d[_0x3756('0x4d')]=_0x1bccb7;return _0x3c7d3d;})[_0x3756('0x31')](respondWithFilteredResult(_0x4c990e,_0x5ef4ce))[_0x3756('0x29')](handleError(_0x4c990e,null));};exports['show']=function(_0x3acfef,_0x435054){var _0x5aa539={'raw':![],'where':{'id':_0x3acfef[_0x3756('0x4e')]['id']}},_0x2b981c={};_0x2b981c[_0x3756('0x3b')]=_[_0x3756('0x3e')](db[_0x3756('0x37')][_0x3756('0x38')]);_0x2b981c[_0x3756('0x3d')]=_[_0x3756('0x3e')](_0x3acfef[_0x3756('0x3d')]);_0x2b981c[_0x3756('0x3f')]=_[_0x3756('0x40')](_0x2b981c[_0x3756('0x3b')],_0x2b981c[_0x3756('0x3d')]);_0x5aa539[_0x3756('0x41')]=_[_0x3756('0x40')](_0x2b981c[_0x3756('0x3b')],qs[_0x3756('0x4f')](_0x3acfef['query'][_0x3756('0x4f')]));_0x5aa539['attributes']=_0x5aa539[_0x3756('0x41')]['length']?_0x5aa539[_0x3756('0x41')]:_0x2b981c['model'];if(_0x3acfef[_0x3756('0x3d')][_0x3756('0x4b')]){_0x5aa539[_0x3756('0x4c')]=[{'all':!![]}];}_0x5aa539=_[_0x3756('0x47')]({},_0x5aa539,_0x3acfef[_0x3756('0x49')]);return db[_0x3756('0x37')]['find'](_0x5aa539)[_0x3756('0x31')](handleEntityNotFound(_0x435054,null))[_0x3756('0x31')](respondWithResult(_0x435054,null))[_0x3756('0x29')](handleError(_0x435054,null));};exports[_0x3756('0x50')]=function(_0x2f9a9e,_0x19e174){return db[_0x3756('0x37')]['create'](_0x2f9a9e[_0x3756('0x51')],{})[_0x3756('0x31')](respondWithResult(_0x19e174,0xc9))[_0x3756('0x29')](handleError(_0x19e174,null));};exports[_0x3756('0x52')]=function(_0x12849d,_0x5681f4){if(_0x12849d[_0x3756('0x51')]['id']){delete _0x12849d['body']['id'];}return db[_0x3756('0x37')]['find']({'where':{'id':_0x12849d[_0x3756('0x4e')]['id']}})[_0x3756('0x31')](handleEntityNotFound(_0x5681f4,null))['then'](saveUpdates(_0x12849d[_0x3756('0x51')],null))[_0x3756('0x31')](respondWithResult(_0x5681f4,null))[_0x3756('0x29')](handleError(_0x5681f4,null));};exports['destroy']=function(_0x131a53,_0x4b06ec){return db['FreshdeskAccount'][_0x3756('0x53')]({'where':{'id':_0x131a53[_0x3756('0x4e')]['id']}})[_0x3756('0x31')](handleEntityNotFound(_0x4b06ec,null))[_0x3756('0x31')](removeEntity(_0x4b06ec,null))[_0x3756('0x29')](handleError(_0x4b06ec,null));};exports[_0x3756('0x54')]=function(_0x459c21,_0x196cff,_0x4ba799){var _0x3bb677={};var _0x3788e4={};var _0x1eb8c0;var _0x519728;return db[_0x3756('0x37')]['findOne']({'where':{'id':_0x459c21[_0x3756('0x4e')]['id']}})[_0x3756('0x31')](handleEntityNotFound(_0x196cff,null))[_0x3756('0x31')](function(_0x22862b){if(_0x22862b){_0x1eb8c0=_0x22862b;_0x3788e4['model']=_['keys'](db[_0x3756('0x55')][_0x3756('0x38')]);_0x3788e4[_0x3756('0x3d')]=_['keys'](_0x459c21[_0x3756('0x3d')]);_0x3788e4[_0x3756('0x3f')]=_['intersection'](_0x3788e4[_0x3756('0x3b')],_0x3788e4['query']);_0x3bb677[_0x3756('0x41')]=_[_0x3756('0x40')](_0x3788e4['model'],qs[_0x3756('0x4f')](_0x459c21[_0x3756('0x3d')][_0x3756('0x4f')]));_0x3bb677[_0x3756('0x41')]=_0x3bb677[_0x3756('0x41')]['length']?_0x3bb677[_0x3756('0x41')]:_0x3788e4[_0x3756('0x3b')];_0x3bb677[_0x3756('0x56')]=qs['sort'](_0x459c21[_0x3756('0x3d')][_0x3756('0x45')]);_0x3bb677[_0x3756('0x4a')]=qs[_0x3756('0x3f')](_['pick'](_0x459c21['query'],_0x3788e4['filters']));if(_0x459c21[_0x3756('0x3d')][_0x3756('0x46')]){_0x3bb677[_0x3756('0x4a')]=_['merge'](_0x3bb677[_0x3756('0x4a')],{'$or':_[_0x3756('0x3c')](_0x3bb677['attributes'],function(_0x49a431){var _0x53c751={};_0x53c751[_0x49a431]={'$like':'%'+_0x459c21['query'][_0x3756('0x46')]+'%'};return _0x53c751;})});}_0x3bb677=_[_0x3756('0x47')]({},_0x3bb677,_0x459c21[_0x3756('0x49')]);return _0x1eb8c0['getConfigurations'](_0x3bb677);}})[_0x3756('0x31')](function(_0x43b247){if(_0x43b247){_0x519728=_0x43b247[_0x3756('0x42')];if(!_0x459c21[_0x3756('0x3d')]['hasOwnProperty']('nolimit')){_0x3bb677[_0x3756('0x2e')]=qs['limit'](_0x459c21[_0x3756('0x3d')]['limit']);_0x3bb677[_0x3756('0x2d')]=qs['offset'](_0x459c21[_0x3756('0x3d')][_0x3756('0x2d')]);}return _0x1eb8c0[_0x3756('0x54')](_0x3bb677);}})[_0x3756('0x31')](function(_0x17b276){if(_0x17b276){return _0x17b276?{'count':_0x519728,'rows':_0x17b276}:null;}})[_0x3756('0x31')](respondWithResult(_0x196cff,null))[_0x3756('0x29')](handleError(_0x196cff,null));};exports[_0x3756('0x57')]=function(_0xee4b85,_0x2466a2,_0x29555c){if(_0xee4b85[_0x3756('0x51')]['id']){delete _0xee4b85[_0x3756('0x51')]['id'];}return db[_0x3756('0x37')][_0x3756('0x58')]({'where':{'id':_0xee4b85[_0x3756('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2466a2,null))['then'](function(_0x272125){if(_0x272125){_0xee4b85[_0x3756('0x51')]['AccountId']=_0x272125['id'];_0xee4b85[_0x3756('0x51')]['Subjects']=integrations[_0x3756('0x59')](_0xee4b85[_0x3756('0x51')][_0x3756('0x5a')],_0xee4b85[_0x3756('0x51')][_0x3756('0x39')]);_0xee4b85['body']['Descriptions']=integrations[_0x3756('0x5b')](_0xee4b85[_0x3756('0x51')][_0x3756('0x5a')],_0xee4b85[_0x3756('0x51')][_0x3756('0x39')]);return db[_0x3756('0x55')]['create'](_0xee4b85['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x3756('0x5c')},{'model':db[_0x3756('0x5d')],'as':'Descriptions'}]});}return null;})[_0x3756('0x31')](respondWithResult(_0x2466a2,null))[_0x3756('0x29')](handleError(_0x2466a2,null));};exports[_0x3756('0x5e')]=function(_0x1793ab,_0x368f21,_0x4a0dd6){var _0x3ea0b0='';return db[_0x3756('0x37')][_0x3756('0x58')]({'where':{'id':_0x1793ab[_0x3756('0x4e')]['id']},'attributes':['id',_0x3756('0x5f'),_0x3756('0x60')]})[_0x3756('0x31')](handleEntityNotFound(_0x368f21,null))[_0x3756('0x31')](function(_0x2fc452){if(_0x2fc452){_0x3ea0b0=_0x2fc452[_0x3756('0x5f')];var _0x40a01c=_0x3ea0b0[_0x3756('0x61')](-0x1);if(_0x40a01c==='/'){_0x3ea0b0=_0x3ea0b0[_0x3756('0x62')](0x0,_0x3ea0b0[_0x3756('0x63')](_0x40a01c));}return rp({'method':_0x3756('0x64'),'uri':util[_0x3756('0x65')]('%s/%s',_0x3ea0b0,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x3756('0x65')](_0x3756('0x66'),_0x2fc452[_0x3756('0x60')]))[_0x3756('0x67')]('base64'))},'json':!![]});}})[_0x3756('0x31')](function(_0x51d481){if(_0x51d481){var _0x7ca122=[_0x3756('0x68'),'subject',_0x3756('0x69'),'description',_0x3756('0x2a'),_0x3756('0x6a'),'group','source',_0x3756('0x6b'),_0x3756('0x6c'),'company'];_[_0x3756('0x6d')](_0x51d481,function(_0x1baa91){return _0x7ca122[_0x3756('0x6e')](_0x1baa91['name'])||!_0x1baa91[_0x3756('0x6f')]&&_0x1baa91[_0x3756('0x39')]!==_0x3756('0x70')&&_0x1baa91[_0x3756('0x39')]!=='custom_dropdown';});return{'count':_0x51d481[_0x3756('0x42')],'rows':_['map'](_0x51d481,function(_0x2cd3f8){return{'id':_0x2cd3f8['name'],'name':_0x2cd3f8[_0x3756('0x71')],'custom':!_0x2cd3f8[_0x3756('0x6f')],'options':_0x2cd3f8['choices']?_['map'](_0x2cd3f8[_0x3756('0x72')],function(_0x1db5e2){return{'name':_['capitalize'](_0x1db5e2),'value':_0x1db5e2};}):[]};})};}})['then'](respondWithResult(_0x368f21,null))[_0x3756('0x29')](function(_0x4851ce){var _0x3f9fa9=_0x1793ab[_0x3756('0x3d')][_0x3756('0x1a')]?0x1f4:_0x4851ce['statusCode']||0x1f4;logger[_0x3756('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x3756('0x5e'),_0x3f9fa9,JSON[_0x3756('0x24')](_0x4851ce));delete _0x4851ce[_0x3756('0x34')];if(_0x3f9fa9===0x191){_0x3f9fa9=0x190;}_0x368f21[_0x3756('0x2a')](_0x3f9fa9)[_0x3756('0x35')](_0x1793ab[_0x3756('0x3d')][_0x3756('0x1a')]?{'message':_0x3756('0x73'),'statusCode':_0x4851ce[_0x3756('0x74')]}:_0x4851ce);});}; \ No newline at end of file +var _0x2690=['%s:X','toString','base64','requester','subject','agent','description','priority','group','source','company','remove','includes','custom_text','custom_dropdown','label','default','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','limit','status','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','FreshdeskAccount','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','findAll','rows','show','params','rawAttributes','keys','include','find','create','body','destroy','getConfigurations','findOne','FreshdeskConfiguration','nolimit','addConfiguration','AccountId','channel','Descriptions','getDescriptions','FreshdeskField','Subjects','getFields','remoteUri','apiKey','slice','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s'];(function(_0x54c9dd,_0x233a86){var _0x855156=function(_0x2dd60b){while(--_0x2dd60b){_0x54c9dd['push'](_0x54c9dd['shift']());}};_0x855156(++_0x233a86);}(_0x2690,0x126));var _0x0269=function(_0x2d3c60,_0x4df458){_0x2d3c60=_0x2d3c60-0x0;var _0x560041=_0x2690[_0x2d3c60];return _0x560041;};'use strict';var pdf=require(_0x0269('0x0'));var emlformat=require(_0x0269('0x1'));var rimraf=require(_0x0269('0x2'));var zipdir=require(_0x0269('0x3'));var jsonpatch=require(_0x0269('0x4'));var rp=require('request-promise');var moment=require(_0x0269('0x5'));var BPromise=require(_0x0269('0x6'));var Mustache=require(_0x0269('0x7'));var util=require(_0x0269('0x8'));var path=require(_0x0269('0x9'));var sox=require(_0x0269('0xa'));var csv=require(_0x0269('0xb'));var ejs=require(_0x0269('0xc'));var fs=require('fs');var _=require(_0x0269('0xd'));var squel=require(_0x0269('0xe'));var crypto=require(_0x0269('0xf'));var jsforce=require(_0x0269('0x10'));var deskjs=require(_0x0269('0x11'));var toCsv=require(_0x0269('0xb'));var querystring=require(_0x0269('0x12'));var Papa=require(_0x0269('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0269('0x14'));var as=require(_0x0269('0x15'));var hardwareService=require(_0x0269('0x16'));var logger=require(_0x0269('0x17'))('api');var utils=require(_0x0269('0x18'));var config=require('../../config/environment');var db=require(_0x0269('0x19'))['db'];var integrations=require(_0x0269('0x1a'));var jayson=require(_0x0269('0x1b'));var client=jayson[_0x0269('0x1c')][_0x0269('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x47a2d3,_0x2d4da2,_0x9146f4){if(_0x9146f4){var _0x481b1f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x481b1f[_0x0269('0x1e')](_0x2d4da2)){return _0x47a2d3;}else{throw new db[(_0x0269('0x1f'))]['ValidationError'](_0x0269('0x20'));}}else{return _0x47a2d3;}}function respondWithRpcPromise(_0x55276e,_0x4317a9,_0x2979ce,_0x4fa862){return new BPromise(function(_0x55d4a2,_0x30a215){var _0x3166ae=_0x4fa862||client;return _0x3166ae[_0x0269('0x21')](_0x55276e,_0x2979ce)['then'](function(_0x342dd7){logger[_0x0269('0x22')]('FreshdeskAccount,\x20%s,\x20%s',_0x4317a9,_0x0269('0x23'));logger['debug'](_0x0269('0x24'),_0x4317a9,_0x0269('0x23'),JSON[_0x0269('0x25')](_0x342dd7));if(_0x342dd7['error']){if(_0x342dd7[_0x0269('0x26')]['code']===0x1f4){logger[_0x0269('0x26')](_0x0269('0x27'),_0x4317a9,_0x342dd7['error'][_0x0269('0x28')]);return _0x30a215(_0x342dd7[_0x0269('0x26')][_0x0269('0x28')]);}logger[_0x0269('0x26')]('FreshdeskAccount,\x20%s,\x20%s',_0x4317a9,_0x342dd7[_0x0269('0x26')][_0x0269('0x28')]);return _0x55d4a2(_0x342dd7[_0x0269('0x26')][_0x0269('0x28')]);}else{logger[_0x0269('0x22')](_0x0269('0x27'),_0x4317a9,_0x0269('0x23'));_0x55d4a2(_0x342dd7[_0x0269('0x29')]['message']);}})[_0x0269('0x2a')](function(_0x4a21f6){logger[_0x0269('0x26')](_0x0269('0x27'),_0x4317a9,_0x4a21f6);_0x30a215(_0x4a21f6);});});}function respondWithStatusCode(_0x448a8f,_0x21ddc3){_0x21ddc3=_0x21ddc3||0xcc;return function(_0x331c55){if(_0x331c55){return _0x448a8f[_0x0269('0x2b')](_0x21ddc3);}return _0x448a8f['status'](_0x21ddc3)[_0x0269('0x2c')]();};}function respondWithResult(_0xf5a5d2,_0x283769){_0x283769=_0x283769||0xc8;return function(_0x7d8e53){if(_0x7d8e53){return _0xf5a5d2['status'](_0x283769)[_0x0269('0x2d')](_0x7d8e53);}};}function respondWithFilteredResult(_0x362b16,_0x2e063a){return function(_0x4dc53c){if(_0x4dc53c){var _0x20c8bf=_0x4dc53c['count'],_0xf3cb41=_0x2e063a[_0x0269('0x2e')],_0xe39019=_0x2e063a[_0x0269('0x2e')]+_0x2e063a[_0x0269('0x2f')],_0x106255;if(_0xe39019>=_0x20c8bf){_0xe39019=_0x20c8bf;_0x106255=0xc8;}else{_0x106255=0xce;}_0x362b16[_0x0269('0x30')](_0x106255);return _0x362b16[_0x0269('0x31')](_0x0269('0x32'),_0xf3cb41+'-'+_0xe39019+'/'+_0x20c8bf)[_0x0269('0x2d')](_0x4dc53c);}return null;};}function patchUpdates(_0x262574){return function(_0x137b45){try{jsonpatch[_0x0269('0x33')](_0x137b45,_0x262574,!![]);}catch(_0x3a24fc){return BPromise[_0x0269('0x34')](_0x3a24fc);}return _0x137b45[_0x0269('0x35')]();};}function saveUpdates(_0x76d02e,_0x113d3e){return function(_0x3ee13a){if(_0x3ee13a){return _0x3ee13a[_0x0269('0x36')](_0x76d02e)[_0x0269('0x37')](function(_0x500510){return _0x500510;});}return null;};}function removeEntity(_0x53d596,_0x12a115){return function(_0x3290d9){if(_0x3290d9){return _0x3290d9['destroy']()['then'](function(){_0x53d596['status'](0xcc)[_0x0269('0x2c')]();});}};}function handleEntityNotFound(_0x2414bf,_0x54c804){return function(_0xc68f98){if(!_0xc68f98){_0x2414bf['sendStatus'](0x194);}return _0xc68f98;};}function handleError(_0x2ab2fb,_0x318e4f){_0x318e4f=_0x318e4f||0x1f4;return function(_0x582fcc){logger['error'](_0x582fcc[_0x0269('0x38')]);if(_0x582fcc[_0x0269('0x39')]){delete _0x582fcc[_0x0269('0x39')];}_0x2ab2fb[_0x0269('0x30')](_0x318e4f)[_0x0269('0x3a')](_0x582fcc);};}exports[_0x0269('0x3b')]=function(_0x697b62,_0x4fe441){var _0x37d513={},_0x24b208={},_0x33438a={'count':0x0,'rows':[]};var _0x4c8c4c=_[_0x0269('0x3c')](db[_0x0269('0x3d')]['rawAttributes'],function(_0xd4196e){return{'name':_0xd4196e[_0x0269('0x3e')],'type':_0xd4196e[_0x0269('0x3f')][_0x0269('0x40')]};});_0x24b208['model']=_[_0x0269('0x3c')](_0x4c8c4c,'name');_0x24b208[_0x0269('0x41')]=_['keys'](_0x697b62[_0x0269('0x41')]);_0x24b208[_0x0269('0x42')]=_[_0x0269('0x43')](_0x24b208['model'],_0x24b208['query']);_0x37d513[_0x0269('0x44')]=_['intersection'](_0x24b208[_0x0269('0x45')],qs[_0x0269('0x46')](_0x697b62['query'][_0x0269('0x46')]));_0x37d513[_0x0269('0x44')]=_0x37d513[_0x0269('0x44')][_0x0269('0x47')]?_0x37d513[_0x0269('0x44')]:_0x24b208['model'];if(!_0x697b62[_0x0269('0x41')][_0x0269('0x48')]('nolimit')){_0x37d513[_0x0269('0x2f')]=qs[_0x0269('0x2f')](_0x697b62[_0x0269('0x41')][_0x0269('0x2f')]);_0x37d513['offset']=qs[_0x0269('0x2e')](_0x697b62['query'][_0x0269('0x2e')]);}_0x37d513[_0x0269('0x49')]=qs[_0x0269('0x4a')](_0x697b62[_0x0269('0x41')][_0x0269('0x4a')]);_0x37d513[_0x0269('0x4b')]=qs[_0x0269('0x42')](_[_0x0269('0x4c')](_0x697b62['query'],_0x24b208[_0x0269('0x42')]));if(_0x697b62['query']['filter']){_0x37d513[_0x0269('0x4b')]=_[_0x0269('0x4d')](_0x37d513[_0x0269('0x4b')],{'$or':_[_0x0269('0x3c')](_0x4c8c4c,function(_0x1e5197){if(_0x1e5197[_0x0269('0x3f')]!==_0x0269('0x4e')){var _0x373aa1={};_0x373aa1[_0x1e5197[_0x0269('0x39')]]={'$like':'%'+_0x697b62['query'][_0x0269('0x4f')]+'%'};return _0x373aa1;}})});}_0x37d513=_[_0x0269('0x4d')]({},_0x37d513,_0x697b62[_0x0269('0x50')]);var _0xf062f0={'where':_0x37d513[_0x0269('0x4b')]};return db[_0x0269('0x3d')][_0x0269('0x51')](_0xf062f0)['then'](function(_0x51e321){_0x33438a['count']=_0x51e321;if(_0x697b62[_0x0269('0x41')][_0x0269('0x52')]){_0x37d513['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x0269('0x53')](_0x37d513);})[_0x0269('0x37')](function(_0x2bd525){_0x33438a[_0x0269('0x54')]=_0x2bd525;return _0x33438a;})[_0x0269('0x37')](respondWithFilteredResult(_0x4fe441,_0x37d513))[_0x0269('0x2a')](handleError(_0x4fe441,null));};exports[_0x0269('0x55')]=function(_0x1a084f,_0x3ae0a2){var _0x483964={'raw':![],'where':{'id':_0x1a084f[_0x0269('0x56')]['id']}},_0x20f892={};_0x20f892[_0x0269('0x45')]=_['keys'](db['FreshdeskAccount'][_0x0269('0x57')]);_0x20f892[_0x0269('0x41')]=_[_0x0269('0x58')](_0x1a084f['query']);_0x20f892[_0x0269('0x42')]=_[_0x0269('0x43')](_0x20f892['model'],_0x20f892[_0x0269('0x41')]);_0x483964[_0x0269('0x44')]=_[_0x0269('0x43')](_0x20f892[_0x0269('0x45')],qs[_0x0269('0x46')](_0x1a084f[_0x0269('0x41')][_0x0269('0x46')]));_0x483964[_0x0269('0x44')]=_0x483964[_0x0269('0x44')][_0x0269('0x47')]?_0x483964['attributes']:_0x20f892[_0x0269('0x45')];if(_0x1a084f[_0x0269('0x41')][_0x0269('0x52')]){_0x483964[_0x0269('0x59')]=[{'all':!![]}];}_0x483964=_[_0x0269('0x4d')]({},_0x483964,_0x1a084f[_0x0269('0x50')]);return db[_0x0269('0x3d')][_0x0269('0x5a')](_0x483964)['then'](handleEntityNotFound(_0x3ae0a2,null))['then'](respondWithResult(_0x3ae0a2,null))['catch'](handleError(_0x3ae0a2,null));};exports[_0x0269('0x5b')]=function(_0x33dbf9,_0x18b43a){return db['FreshdeskAccount'][_0x0269('0x5b')](_0x33dbf9['body'],{})[_0x0269('0x37')](respondWithResult(_0x18b43a,0xc9))[_0x0269('0x2a')](handleError(_0x18b43a,null));};exports[_0x0269('0x36')]=function(_0xeededb,_0x3bfa70){if(_0xeededb[_0x0269('0x5c')]['id']){delete _0xeededb[_0x0269('0x5c')]['id'];}return db[_0x0269('0x3d')][_0x0269('0x5a')]({'where':{'id':_0xeededb[_0x0269('0x56')]['id']}})['then'](handleEntityNotFound(_0x3bfa70,null))['then'](saveUpdates(_0xeededb['body'],null))[_0x0269('0x37')](respondWithResult(_0x3bfa70,null))[_0x0269('0x2a')](handleError(_0x3bfa70,null));};exports[_0x0269('0x5d')]=function(_0x1cb224,_0x825bfa){return db[_0x0269('0x3d')][_0x0269('0x5a')]({'where':{'id':_0x1cb224[_0x0269('0x56')]['id']}})[_0x0269('0x37')](handleEntityNotFound(_0x825bfa,null))['then'](removeEntity(_0x825bfa,null))[_0x0269('0x2a')](handleError(_0x825bfa,null));};exports[_0x0269('0x5e')]=function(_0x510749,_0x228cbc,_0x489d61){var _0x15351e={};var _0x366fc4={};var _0x54a9f7;var _0x3ce970;return db[_0x0269('0x3d')][_0x0269('0x5f')]({'where':{'id':_0x510749[_0x0269('0x56')]['id']}})['then'](handleEntityNotFound(_0x228cbc,null))['then'](function(_0x391c24){if(_0x391c24){_0x54a9f7=_0x391c24;_0x366fc4[_0x0269('0x45')]=_['keys'](db[_0x0269('0x60')][_0x0269('0x57')]);_0x366fc4[_0x0269('0x41')]=_[_0x0269('0x58')](_0x510749[_0x0269('0x41')]);_0x366fc4[_0x0269('0x42')]=_[_0x0269('0x43')](_0x366fc4[_0x0269('0x45')],_0x366fc4['query']);_0x15351e[_0x0269('0x44')]=_['intersection'](_0x366fc4[_0x0269('0x45')],qs[_0x0269('0x46')](_0x510749[_0x0269('0x41')][_0x0269('0x46')]));_0x15351e[_0x0269('0x44')]=_0x15351e[_0x0269('0x44')]['length']?_0x15351e[_0x0269('0x44')]:_0x366fc4[_0x0269('0x45')];_0x15351e['order']=qs[_0x0269('0x4a')](_0x510749[_0x0269('0x41')]['sort']);_0x15351e[_0x0269('0x4b')]=qs['filters'](_[_0x0269('0x4c')](_0x510749[_0x0269('0x41')],_0x366fc4['filters']));if(_0x510749[_0x0269('0x41')]['filter']){_0x15351e[_0x0269('0x4b')]=_[_0x0269('0x4d')](_0x15351e[_0x0269('0x4b')],{'$or':_[_0x0269('0x3c')](_0x15351e[_0x0269('0x44')],function(_0x50a669){var _0x136d02={};_0x136d02[_0x50a669]={'$like':'%'+_0x510749[_0x0269('0x41')][_0x0269('0x4f')]+'%'};return _0x136d02;})});}_0x15351e=_[_0x0269('0x4d')]({},_0x15351e,_0x510749[_0x0269('0x50')]);return _0x54a9f7[_0x0269('0x5e')](_0x15351e);}})[_0x0269('0x37')](function(_0x2181de){if(_0x2181de){_0x3ce970=_0x2181de[_0x0269('0x47')];if(!_0x510749[_0x0269('0x41')][_0x0269('0x48')](_0x0269('0x61'))){_0x15351e[_0x0269('0x2f')]=qs['limit'](_0x510749[_0x0269('0x41')][_0x0269('0x2f')]);_0x15351e[_0x0269('0x2e')]=qs[_0x0269('0x2e')](_0x510749[_0x0269('0x41')][_0x0269('0x2e')]);}return _0x54a9f7[_0x0269('0x5e')](_0x15351e);}})[_0x0269('0x37')](function(_0xbf52aa){if(_0xbf52aa){return _0xbf52aa?{'count':_0x3ce970,'rows':_0xbf52aa}:null;}})['then'](respondWithResult(_0x228cbc,null))[_0x0269('0x2a')](handleError(_0x228cbc,null));};exports[_0x0269('0x62')]=function(_0x20e4a5,_0x5db141,_0x1b6366){if(_0x20e4a5[_0x0269('0x5c')]['id']){delete _0x20e4a5[_0x0269('0x5c')]['id'];}return db[_0x0269('0x3d')][_0x0269('0x5f')]({'where':{'id':_0x20e4a5['params']['id']}})[_0x0269('0x37')](handleEntityNotFound(_0x5db141,null))[_0x0269('0x37')](function(_0x4388f2){if(_0x4388f2){_0x20e4a5[_0x0269('0x5c')][_0x0269('0x63')]=_0x4388f2['id'];_0x20e4a5[_0x0269('0x5c')]['Subjects']=integrations['getSubjects'](_0x20e4a5['body'][_0x0269('0x64')],_0x20e4a5[_0x0269('0x5c')][_0x0269('0x3f')]);_0x20e4a5[_0x0269('0x5c')][_0x0269('0x65')]=integrations[_0x0269('0x66')](_0x20e4a5[_0x0269('0x5c')][_0x0269('0x64')],_0x20e4a5[_0x0269('0x5c')][_0x0269('0x3f')]);return db[_0x0269('0x60')][_0x0269('0x5b')](_0x20e4a5[_0x0269('0x5c')],{'include':[{'model':db[_0x0269('0x67')],'as':_0x0269('0x68')},{'model':db[_0x0269('0x67')],'as':_0x0269('0x65')}]});}return null;})[_0x0269('0x37')](respondWithResult(_0x5db141,null))[_0x0269('0x2a')](handleError(_0x5db141,null));};exports[_0x0269('0x69')]=function(_0x17051e,_0x4d68b9,_0x5ce970){var _0xbfa038='';return db[_0x0269('0x3d')]['findOne']({'where':{'id':_0x17051e[_0x0269('0x56')]['id']},'attributes':['id',_0x0269('0x6a'),_0x0269('0x6b')]})[_0x0269('0x37')](handleEntityNotFound(_0x4d68b9,null))[_0x0269('0x37')](function(_0x563d02){if(_0x563d02){_0xbfa038=_0x563d02[_0x0269('0x6a')];var _0x554f77=_0xbfa038[_0x0269('0x6c')](-0x1);if(_0x554f77==='/'){_0xbfa038=_0xbfa038['substring'](0x0,_0xbfa038['lastIndexOf'](_0x554f77));}return rp({'method':_0x0269('0x6d'),'uri':util[_0x0269('0x6e')](_0x0269('0x6f'),_0xbfa038,_0x0269('0x70')),'headers':{'Authorization':util['format'](_0x0269('0x71'),new Buffer(util[_0x0269('0x6e')](_0x0269('0x72'),_0x563d02['apiKey']))[_0x0269('0x73')](_0x0269('0x74')))},'json':!![]});}})[_0x0269('0x37')](function(_0x171878){if(_0x171878){var _0x4a00be=[_0x0269('0x75'),_0x0269('0x76'),_0x0269('0x77'),_0x0269('0x78'),_0x0269('0x30'),_0x0269('0x79'),_0x0269('0x7a'),_0x0269('0x7b'),'ticket_type','group',_0x0269('0x7c')];_[_0x0269('0x7d')](_0x171878,function(_0x1c92a5){return _0x4a00be[_0x0269('0x7e')](_0x1c92a5[_0x0269('0x39')])||!_0x1c92a5['default']&&_0x1c92a5[_0x0269('0x3f')]!==_0x0269('0x7f')&&_0x1c92a5[_0x0269('0x3f')]!==_0x0269('0x80');});return{'count':_0x171878['length'],'rows':_['map'](_0x171878,function(_0x147e6f){return{'id':_0x147e6f[_0x0269('0x39')],'name':_0x147e6f[_0x0269('0x81')],'custom':!_0x147e6f[_0x0269('0x82')],'options':_0x147e6f['choices']?_['map'](_0x147e6f[_0x0269('0x83')],function(_0xdd704f){return{'name':_[_0x0269('0x84')](_0xdd704f),'value':_0xdd704f};}):[]};})};}})[_0x0269('0x37')](respondWithResult(_0x4d68b9,null))['catch'](function(_0x4d6821){var _0x966f6d=_0x17051e[_0x0269('0x41')]['test']?0x1f4:_0x4d6821[_0x0269('0x85')]||0x1f4;logger['error'](_0x0269('0x86'),_0x0269('0x69'),_0x966f6d,JSON['stringify'](_0x4d6821));delete _0x4d6821['name'];if(_0x966f6d===0x191){_0x966f6d=0x190;}_0x4d68b9[_0x0269('0x30')](_0x966f6d)['send'](_0x17051e[_0x0269('0x41')]['test']?{'message':_0x0269('0x87'),'statusCode':_0x4d6821[_0x0269('0x85')]}:_0x4d6821);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 37951c1..80f0eff 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 _0x0be4=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x319373,_0x4540ce){var _0x58555f=function(_0x5eac39){while(--_0x5eac39){_0x319373['push'](_0x319373['shift']());}};_0x58555f(++_0x4540ce);}(_0x0be4,0xd7));var _0x40be=function(_0xbf6cca,_0x294200){_0xbf6cca=_0xbf6cca-0x0;var _0x80f8e4=_0x0be4[_0xbf6cca];return _0x80f8e4;};'use strict';var _=require(_0x40be('0x0'));var util=require(_0x40be('0x1'));var logger=require(_0x40be('0x2'))('api');var moment=require(_0x40be('0x3'));var BPromise=require(_0x40be('0x4'));var rp=require(_0x40be('0x5'));var fs=require('fs');var path=require(_0x40be('0x6'));var rimraf=require('rimraf');var config=require(_0x40be('0x7'));var attributes=require(_0x40be('0x8'));var integrations=require(_0x40be('0x9'));module[_0x40be('0xa')]=function(_0x10fbd3,_0x4c0bcd){return _0x10fbd3[_0x40be('0xb')](_0x40be('0xc'),attributes,{'tableName':_0x40be('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b14=['FreshdeskAccount','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x288ada,_0x37a9b8){var _0x6172ad=function(_0x23e672){while(--_0x23e672){_0x288ada['push'](_0x288ada['shift']());}};_0x6172ad(++_0x37a9b8);}(_0x2b14,0x1bb));var _0x42b1=function(_0x3624a0,_0x2cab67){_0x3624a0=_0x3624a0-0x0;var _0xccce8a=_0x2b14[_0x3624a0];return _0xccce8a;};'use strict';var _=require(_0x42b1('0x0'));var util=require(_0x42b1('0x1'));var logger=require(_0x42b1('0x2'))('api');var moment=require(_0x42b1('0x3'));var BPromise=require(_0x42b1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42b1('0x5'));var rimraf=require(_0x42b1('0x6'));var config=require(_0x42b1('0x7'));var attributes=require(_0x42b1('0x8'));var integrations=require(_0x42b1('0x9'));module[_0x42b1('0xa')]=function(_0x6f5302,_0x44858c){return _0x6f5302[_0x42b1('0xb')](_0x42b1('0xc'),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 de36139..8797a82 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 _0xe075=['FreshdeskAccount','options','raw','where','limit','map','include','model','attributes','ShowFreshdeskAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe075,0x98));var _0x5e07=function(_0x2ec095,_0x52a35d){_0x2ec095=_0x2ec095-0x0;var _0x2fadba=_0xe075[_0x2ec095];return _0x2fadba;};'use strict';var _=require(_0x5e07('0x0'));var util=require(_0x5e07('0x1'));var moment=require(_0x5e07('0x2'));var BPromise=require(_0x5e07('0x3'));var rs=require(_0x5e07('0x4'));var fs=require('fs');var Redis=require(_0x5e07('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e07('0x6'));var logger=require(_0x5e07('0x7'))('rpc');var config=require(_0x5e07('0x8'));var jayson=require(_0x5e07('0x9'));var client=jayson['client'][_0x5e07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ca82d,_0xee50a9,_0x36dbbd){return new BPromise(function(_0x226998,_0x58afbb){return client[_0x5e07('0xb')](_0x4ca82d,_0x36dbbd)[_0x5e07('0xc')](function(_0x1551a5){logger[_0x5e07('0xd')](_0x5e07('0xe'),_0xee50a9,_0x5e07('0xf'));logger[_0x5e07('0x10')](_0x5e07('0x11'),_0xee50a9,_0x5e07('0xf'),JSON[_0x5e07('0x12')](_0x1551a5));if(_0x1551a5[_0x5e07('0x13')]){if(_0x1551a5[_0x5e07('0x13')]['code']===0x1f4){logger[_0x5e07('0x13')](_0x5e07('0xe'),_0xee50a9,_0x1551a5[_0x5e07('0x13')]['message']);return _0x58afbb(_0x1551a5['error'][_0x5e07('0x14')]);}logger['error'](_0x5e07('0xe'),_0xee50a9,_0x1551a5[_0x5e07('0x13')][_0x5e07('0x14')]);return _0x226998(_0x1551a5[_0x5e07('0x13')][_0x5e07('0x14')]);}else{logger[_0x5e07('0xd')](_0x5e07('0xe'),_0xee50a9,_0x5e07('0xf'));_0x226998(_0x1551a5[_0x5e07('0x15')]['message']);}})['catch'](function(_0x4c1458){logger[_0x5e07('0x13')](_0x5e07('0xe'),_0xee50a9,_0x4c1458);_0x58afbb(_0x4c1458);});});}exports[_0x5e07('0x16')]=function(_0x54a4ca){var _0x25904f=this;return new Promise(function(_0x26f7e9,_0x54e467){return db[_0x5e07('0x17')]['findAll']({'raw':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca[_0x5e07('0x18')][_0x5e07('0x19')]===undefined?!![]:![]:!![],'where':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca['options'][_0x5e07('0x1a')]||null:null,'attributes':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca[_0x5e07('0x18')]['attributes']||null:null,'limit':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca['options'][_0x5e07('0x1b')]||null:null,'include':_0x54a4ca['options']?_0x54a4ca[_0x5e07('0x18')]['include']?_[_0x5e07('0x1c')](_0x54a4ca[_0x5e07('0x18')][_0x5e07('0x1d')],function(_0x1822ff){return{'model':db[_0x1822ff[_0x5e07('0x1e')]],'as':_0x1822ff['as'],'attributes':_0x1822ff[_0x5e07('0x1f')],'include':_0x1822ff[_0x5e07('0x1d')]?_[_0x5e07('0x1c')](_0x1822ff[_0x5e07('0x1d')],function(_0x25f1e1){return{'model':db[_0x25f1e1[_0x5e07('0x1e')]],'as':_0x25f1e1['as'],'attributes':_0x25f1e1[_0x5e07('0x1f')],'include':_0x25f1e1[_0x5e07('0x1d')]?_['map'](_0x25f1e1[_0x5e07('0x1d')],function(_0xafb6d2){return{'model':db[_0xafb6d2[_0x5e07('0x1e')]],'as':_0xafb6d2['as'],'attributes':_0xafb6d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e07('0xc')](function(_0x33ccc7){logger['info']('GetFreshdeskAccount',_0x54a4ca);logger[_0x5e07('0x10')](_0x5e07('0x16'),_0x54a4ca,JSON[_0x5e07('0x12')](_0x33ccc7));_0x26f7e9(_0x33ccc7);})['catch'](function(_0x1aa640){logger[_0x5e07('0x13')](_0x5e07('0x16'),_0x1aa640[_0x5e07('0x14')],_0x54a4ca);_0x54e467(_0x25904f[_0x5e07('0x13')](0x1f4,_0x1aa640[_0x5e07('0x14')]));});});};exports[_0x5e07('0x20')]=function(_0x2dc37d){var _0x266bde=this;return new Promise(function(_0x2afd05,_0x25b679){return db[_0x5e07('0x17')][_0x5e07('0x21')]({'raw':_0x2dc37d[_0x5e07('0x18')]?_0x2dc37d[_0x5e07('0x18')][_0x5e07('0x19')]===undefined?!![]:![]:!![],'where':_0x2dc37d[_0x5e07('0x18')]?_0x2dc37d['options']['where']||null:null,'attributes':_0x2dc37d[_0x5e07('0x18')]?_0x2dc37d[_0x5e07('0x18')][_0x5e07('0x1f')]||null:null,'include':_0x2dc37d['options']?_0x2dc37d['options'][_0x5e07('0x1d')]?_['map'](_0x2dc37d[_0x5e07('0x18')][_0x5e07('0x1d')],function(_0x18d37f){return{'model':db[_0x18d37f[_0x5e07('0x1e')]],'as':_0x18d37f['as'],'attributes':_0x18d37f[_0x5e07('0x1f')],'include':_0x18d37f[_0x5e07('0x1d')]?_['map'](_0x18d37f['include'],function(_0x48bd2d){return{'model':db[_0x48bd2d[_0x5e07('0x1e')]],'as':_0x48bd2d['as'],'attributes':_0x48bd2d[_0x5e07('0x1f')],'include':_0x48bd2d[_0x5e07('0x1d')]?_['map'](_0x48bd2d[_0x5e07('0x1d')],function(_0x3ab671){return{'model':db[_0x3ab671[_0x5e07('0x1e')]],'as':_0x3ab671['as'],'attributes':_0x3ab671[_0x5e07('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e07('0xc')](function(_0x3b8a30){logger[_0x5e07('0xd')](_0x5e07('0x20'),_0x2dc37d);logger[_0x5e07('0x10')](_0x5e07('0x20'),_0x2dc37d,JSON['stringify'](_0x3b8a30));_0x2afd05(_0x3b8a30);})[_0x5e07('0x22')](function(_0x59cd6e){logger[_0x5e07('0x13')](_0x5e07('0x20'),_0x59cd6e[_0x5e07('0x14')],_0x2dc37d);_0x25b679(_0x266bde[_0x5e07('0x13')](0x1f4,_0x59cd6e['message']));});});}; \ No newline at end of file +var _0x8a99=['GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','map','model','include','then','ShowFreshdeskAccount','find','debug','lodash','util','moment','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x2dca55,_0x33483c){var _0x5ec2a2=function(_0x339f9d){while(--_0x339f9d){_0x2dca55['push'](_0x2dca55['shift']());}};_0x5ec2a2(++_0x33483c);}(_0x8a99,0x1bb));var _0x98a9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x8a99[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x98a9('0x0'));var util=require(_0x98a9('0x1'));var moment=require(_0x98a9('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(_0x98a9('0x3'));var logger=require(_0x98a9('0x4'))(_0x98a9('0x5'));var config=require(_0x98a9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x98a9('0x7')][_0x98a9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c3fe6,_0x40c748,_0x3d6aeb){return new BPromise(function(_0x1fbe8e,_0x3ad4a7){return client[_0x98a9('0x9')](_0x4c3fe6,_0x3d6aeb)['then'](function(_0x5b158c){logger['info'](_0x98a9('0xa'),_0x40c748,'request\x20sent');logger['debug'](_0x98a9('0xb'),_0x40c748,_0x98a9('0xc'),JSON[_0x98a9('0xd')](_0x5b158c));if(_0x5b158c['error']){if(_0x5b158c[_0x98a9('0xe')]['code']===0x1f4){logger[_0x98a9('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x40c748,_0x5b158c[_0x98a9('0xe')][_0x98a9('0xf')]);return _0x3ad4a7(_0x5b158c['error'][_0x98a9('0xf')]);}logger['error'](_0x98a9('0xa'),_0x40c748,_0x5b158c['error'][_0x98a9('0xf')]);return _0x1fbe8e(_0x5b158c[_0x98a9('0xe')][_0x98a9('0xf')]);}else{logger[_0x98a9('0x10')](_0x98a9('0xa'),_0x40c748,_0x98a9('0xc'));_0x1fbe8e(_0x5b158c[_0x98a9('0x11')]['message']);}})[_0x98a9('0x12')](function(_0x4351e5){logger[_0x98a9('0xe')](_0x98a9('0xa'),_0x40c748,_0x4351e5);_0x3ad4a7(_0x4351e5);});});}exports[_0x98a9('0x13')]=function(_0x110561){var _0x4720fc=this;return new Promise(function(_0x7cb3bb,_0xe750b){return db[_0x98a9('0x14')][_0x98a9('0x15')]({'raw':_0x110561[_0x98a9('0x16')]?_0x110561[_0x98a9('0x16')][_0x98a9('0x17')]===undefined?!![]:![]:!![],'where':_0x110561['options']?_0x110561[_0x98a9('0x16')][_0x98a9('0x18')]||null:null,'attributes':_0x110561[_0x98a9('0x16')]?_0x110561[_0x98a9('0x16')][_0x98a9('0x19')]||null:null,'limit':_0x110561['options']?_0x110561[_0x98a9('0x16')]['limit']||null:null,'include':_0x110561[_0x98a9('0x16')]?_0x110561[_0x98a9('0x16')]['include']?_[_0x98a9('0x1a')](_0x110561[_0x98a9('0x16')]['include'],function(_0x4b4067){return{'model':db[_0x4b4067[_0x98a9('0x1b')]],'as':_0x4b4067['as'],'attributes':_0x4b4067[_0x98a9('0x19')],'include':_0x4b4067[_0x98a9('0x1c')]?_['map'](_0x4b4067[_0x98a9('0x1c')],function(_0x50306c){return{'model':db[_0x50306c[_0x98a9('0x1b')]],'as':_0x50306c['as'],'attributes':_0x50306c[_0x98a9('0x19')],'include':_0x50306c[_0x98a9('0x1c')]?_[_0x98a9('0x1a')](_0x50306c[_0x98a9('0x1c')],function(_0x3db357){return{'model':db[_0x3db357[_0x98a9('0x1b')]],'as':_0x3db357['as'],'attributes':_0x3db357['attributes']};}):[]};}):[]};}):[]:[]})[_0x98a9('0x1d')](function(_0x46c2c1){logger[_0x98a9('0x10')](_0x98a9('0x13'),_0x110561);logger['debug'](_0x98a9('0x13'),_0x110561,JSON[_0x98a9('0xd')](_0x46c2c1));_0x7cb3bb(_0x46c2c1);})['catch'](function(_0xcf0c18){logger[_0x98a9('0xe')]('GetFreshdeskAccount',_0xcf0c18[_0x98a9('0xf')],_0x110561);_0xe750b(_0x4720fc[_0x98a9('0xe')](0x1f4,_0xcf0c18['message']));});});};exports[_0x98a9('0x1e')]=function(_0x4917b7){var _0x407172=this;return new Promise(function(_0x5b35b8,_0x3058e2){return db[_0x98a9('0x14')][_0x98a9('0x1f')]({'raw':_0x4917b7[_0x98a9('0x16')]?_0x4917b7['options'][_0x98a9('0x17')]===undefined?!![]:![]:!![],'where':_0x4917b7['options']?_0x4917b7[_0x98a9('0x16')]['where']||null:null,'attributes':_0x4917b7[_0x98a9('0x16')]?_0x4917b7[_0x98a9('0x16')][_0x98a9('0x19')]||null:null,'include':_0x4917b7[_0x98a9('0x16')]?_0x4917b7['options'][_0x98a9('0x1c')]?_['map'](_0x4917b7[_0x98a9('0x16')][_0x98a9('0x1c')],function(_0x3a1112){return{'model':db[_0x3a1112[_0x98a9('0x1b')]],'as':_0x3a1112['as'],'attributes':_0x3a1112[_0x98a9('0x19')],'include':_0x3a1112[_0x98a9('0x1c')]?_[_0x98a9('0x1a')](_0x3a1112[_0x98a9('0x1c')],function(_0x9f399f){return{'model':db[_0x9f399f[_0x98a9('0x1b')]],'as':_0x9f399f['as'],'attributes':_0x9f399f['attributes'],'include':_0x9f399f[_0x98a9('0x1c')]?_[_0x98a9('0x1a')](_0x9f399f[_0x98a9('0x1c')],function(_0x46c188){return{'model':db[_0x46c188['model']],'as':_0x46c188['as'],'attributes':_0x46c188[_0x98a9('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8ee936){logger[_0x98a9('0x10')](_0x98a9('0x1e'),_0x4917b7);logger[_0x98a9('0x20')](_0x98a9('0x1e'),_0x4917b7,JSON[_0x98a9('0xd')](_0x8ee936));_0x5b35b8(_0x8ee936);})[_0x98a9('0x12')](function(_0x579e11){logger['error']('ShowFreshdeskAccount',_0x579e11[_0x98a9('0xf')],_0x4917b7);_0x3058e2(_0x407172['error'](0x1f4,_0x579e11['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 487b2af..bded56a 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 _0x7efd=['../../config/environment','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getTags','post','/:id/tags','setTags','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xfd0f6b,_0x18a886){var _0x44d542=function(_0x3ebf1f){while(--_0x3ebf1f){_0xfd0f6b['push'](_0xfd0f6b['shift']());}};_0x44d542(++_0x18a886);}(_0x7efd,0xb2));var _0xd7ef=function(_0x15beb8,_0x4a1367){_0x15beb8=_0x15beb8-0x0;var _0x4c2646=_0x7efd[_0x15beb8];return _0x4c2646;};'use strict';var multer=require('multer');var util=require(_0xd7ef('0x0'));var path=require(_0xd7ef('0x1'));var timeout=require(_0xd7ef('0x2'));var express=require('express');var router=express[_0xd7ef('0x3')]();var auth=require(_0xd7ef('0x4'));var interaction=require(_0xd7ef('0x5'));var config=require(_0xd7ef('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0xd7ef('0x7')](),controller['index']);router[_0xd7ef('0x8')](_0xd7ef('0x9'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xa')]);router[_0xd7ef('0x8')](_0xd7ef('0xb'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xc')]);router['get']('/:id/subjects',auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xd')]);router[_0xd7ef('0x8')](_0xd7ef('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd7ef('0x8')]('/:id/tags',auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xf')]);router['post']('/',auth[_0xd7ef('0x7')](),controller['create']);router[_0xd7ef('0x10')](_0xd7ef('0x11'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0x12')]);router[_0xd7ef('0x13')](_0xd7ef('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xd7ef('0x14')](_0xd7ef('0x9'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0x15')]);module[_0xd7ef('0x16')]=router; \ No newline at end of file +var _0xeccd=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields'];(function(_0x440356,_0x4d3fc7){var _0x1df7f2=function(_0x3810e9){while(--_0x3810e9){_0x440356['push'](_0x440356['shift']());}};_0x1df7f2(++_0x4d3fc7);}(_0xeccd,0x171));var _0xdecc=function(_0x1cce0d,_0x2d4bc7){_0x1cce0d=_0x1cce0d-0x0;var _0xd999a0=_0xeccd[_0x1cce0d];return _0xd999a0;};'use strict';var multer=require(_0xdecc('0x0'));var util=require(_0xdecc('0x1'));var path=require(_0xdecc('0x2'));var timeout=require(_0xdecc('0x3'));var express=require(_0xdecc('0x4'));var router=express[_0xdecc('0x5')]();var auth=require(_0xdecc('0x6'));var interaction=require(_0xdecc('0x7'));var config=require('../../config/environment');var controller=require(_0xdecc('0x8'));router[_0xdecc('0x9')]('/',auth[_0xdecc('0xa')](),controller[_0xdecc('0xb')]);router[_0xdecc('0x9')](_0xdecc('0xc'),auth[_0xdecc('0xa')](),controller[_0xdecc('0xd')]);router[_0xdecc('0x9')](_0xdecc('0xe'),auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xdecc('0xf')]);router[_0xdecc('0x9')](_0xdecc('0x10'),auth[_0xdecc('0xa')](),controller[_0xdecc('0x11')]);router[_0xdecc('0x9')](_0xdecc('0x12'),auth[_0xdecc('0xa')](),controller[_0xdecc('0x13')]);router['post']('/',auth[_0xdecc('0xa')](),controller['create']);router[_0xdecc('0x14')]('/:id/tags',auth[_0xdecc('0xa')](),controller['setTags']);router[_0xdecc('0x15')]('/:id',auth[_0xdecc('0xa')](),controller['update']);router['delete'](_0xdecc('0xc'),auth['isAuthenticated'](),controller[_0xdecc('0x16')]);module[_0xdecc('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index b0e3fff..249b3ea 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 _0x3f6c=['sequelize','STRING'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x3f6c,0x12c));var _0xc3f6=function(_0x3512c3,_0x20c23e){_0x3512c3=_0x3512c3-0x0;var _0x2a9f81=_0x3f6c[_0x3512c3];return _0x2a9f81;};'use strict';var Sequelize=require(_0xc3f6('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3f6('0x1')]},'description':{'type':Sequelize[_0xc3f6('0x1')]}}; \ No newline at end of file +var _0x73a5=['STRING','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x73a5,0x195));var _0x573a=function(_0x299e60,_0x114aa7){_0x299e60=_0x299e60-0x0;var _0x4b3842=_0x73a5[_0x299e60];return _0x4b3842;};'use strict';var Sequelize=require('sequelize');module[_0x573a('0x0')]={'name':{'type':Sequelize[_0x573a('0x1')]},'description':{'type':Sequelize[_0x573a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 75f6a55..a20b1a1 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 _0x38d1=['save','update','destroy','end','stack','name','send','index','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','rows','show','params','find','create','body','getFields','FreshdeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x587ea8,_0x2c4f67){var _0x4d3c7d=function(_0x42d452){while(--_0x42d452){_0x587ea8['push'](_0x587ea8['shift']());}};_0x4d3c7d(++_0x2c4f67);}(_0x38d1,0xf2));var _0x138d=function(_0x52bd95,_0x45afc3){_0x52bd95=_0x52bd95-0x0;var _0x189582=_0x38d1[_0x52bd95];return _0x189582;};'use strict';var pdf=require(_0x138d('0x0'));var emlformat=require(_0x138d('0x1'));var rimraf=require(_0x138d('0x2'));var zipdir=require(_0x138d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x138d('0x4'));var moment=require(_0x138d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x138d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x138d('0x7'));var fs=require('fs');var _=require(_0x138d('0x8'));var squel=require(_0x138d('0x9'));var crypto=require(_0x138d('0xa'));var jsforce=require(_0x138d('0xb'));var deskjs=require(_0x138d('0xc'));var toCsv=require(_0x138d('0xd'));var querystring=require('querystring');var Papa=require(_0x138d('0xe'));var Redis=require('ioredis');var authService=require(_0x138d('0xf'));var qs=require(_0x138d('0x10'));var as=require(_0x138d('0x11'));var hardwareService=require(_0x138d('0x12'));var logger=require(_0x138d('0x13'))(_0x138d('0x14'));var utils=require(_0x138d('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x138d('0x16'));var client=jayson[_0x138d('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5af189,_0xd3c77c,_0x362fe5){if(_0x362fe5){var _0x438e22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x438e22[_0x138d('0x18')](_0xd3c77c)){return _0x5af189;}else{throw new db[(_0x138d('0x19'))]['ValidationError'](_0x138d('0x1a'));}}else{return _0x5af189;}}function respondWithRpcPromise(_0x5c2fad,_0x2d6460,_0x5b1218,_0xd398f7){return new BPromise(function(_0x267649,_0x209a1b){var _0x2c1011=_0xd398f7||client;return _0x2c1011[_0x138d('0x1b')](_0x5c2fad,_0x5b1218)[_0x138d('0x1c')](function(_0x16df80){logger[_0x138d('0x1d')](_0x138d('0x1e'),_0x2d6460,_0x138d('0x1f'));logger[_0x138d('0x20')](_0x138d('0x21'),_0x2d6460,_0x138d('0x1f'),JSON[_0x138d('0x22')](_0x16df80));if(_0x16df80[_0x138d('0x23')]){if(_0x16df80['error'][_0x138d('0x24')]===0x1f4){logger[_0x138d('0x23')](_0x138d('0x1e'),_0x2d6460,_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);return _0x209a1b(_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2d6460,_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);return _0x267649(_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2d6460,'request\x20sent');_0x267649(_0x16df80[_0x138d('0x26')][_0x138d('0x25')]);}})[_0x138d('0x27')](function(_0x1f221f){logger['error'](_0x138d('0x1e'),_0x2d6460,_0x1f221f);_0x209a1b(_0x1f221f);});});}function respondWithStatusCode(_0x5b7346,_0x143ba1){_0x143ba1=_0x143ba1||0xcc;return function(_0x1a2db2){if(_0x1a2db2){return _0x5b7346[_0x138d('0x28')](_0x143ba1);}return _0x5b7346['status'](_0x143ba1)['end']();};}function respondWithResult(_0x5714f3,_0x163e99){_0x163e99=_0x163e99||0xc8;return function(_0x11b95e){if(_0x11b95e){return _0x5714f3[_0x138d('0x29')](_0x163e99)[_0x138d('0x2a')](_0x11b95e);}};}function respondWithFilteredResult(_0x3a6fd1,_0x49142f){return function(_0x31207a){if(_0x31207a){var _0x85f7b=_0x31207a[_0x138d('0x2b')],_0x4fcd0c=_0x49142f[_0x138d('0x2c')],_0x2b0c8b=_0x49142f[_0x138d('0x2c')]+_0x49142f['limit'],_0x2668d8;if(_0x2b0c8b>=_0x85f7b){_0x2b0c8b=_0x85f7b;_0x2668d8=0xc8;}else{_0x2668d8=0xce;}_0x3a6fd1[_0x138d('0x29')](_0x2668d8);return _0x3a6fd1[_0x138d('0x2d')](_0x138d('0x2e'),_0x4fcd0c+'-'+_0x2b0c8b+'/'+_0x85f7b)[_0x138d('0x2a')](_0x31207a);}return null;};}function patchUpdates(_0x24a306){return function(_0x1a54ef){try{jsonpatch[_0x138d('0x2f')](_0x1a54ef,_0x24a306,!![]);}catch(_0x59d6da){return BPromise[_0x138d('0x30')](_0x59d6da);}return _0x1a54ef[_0x138d('0x31')]();};}function saveUpdates(_0x69099,_0x458b37){return function(_0x1154ff){if(_0x1154ff){return _0x1154ff[_0x138d('0x32')](_0x69099)[_0x138d('0x1c')](function(_0x4e6fec){return _0x4e6fec;});}return null;};}function removeEntity(_0x54e380,_0x46fd44){return function(_0x2df809){if(_0x2df809){return _0x2df809[_0x138d('0x33')]()[_0x138d('0x1c')](function(){_0x54e380[_0x138d('0x29')](0xcc)[_0x138d('0x34')]();});}};}function handleEntityNotFound(_0x3c79da,_0x21d79d){return function(_0x10608b){if(!_0x10608b){_0x3c79da['sendStatus'](0x194);}return _0x10608b;};}function handleError(_0x128b46,_0x2c56a2){_0x2c56a2=_0x2c56a2||0x1f4;return function(_0x2c520c){logger[_0x138d('0x23')](_0x2c520c[_0x138d('0x35')]);if(_0x2c520c[_0x138d('0x36')]){delete _0x2c520c['name'];}_0x128b46[_0x138d('0x29')](_0x2c56a2)[_0x138d('0x37')](_0x2c520c);};}exports[_0x138d('0x38')]=function(_0x31e0fc,_0x5c95d2){var _0x21623b={},_0xa8b632={},_0x273ff1={'count':0x0,'rows':[]};var _0x1e2b28=_['map'](db['FreshdeskConfiguration'][_0x138d('0x39')],function(_0x48a509){return{'name':_0x48a509['fieldName'],'type':_0x48a509['type'][_0x138d('0x3a')]};});_0xa8b632[_0x138d('0x3b')]=_['map'](_0x1e2b28,_0x138d('0x36'));_0xa8b632['query']=_[_0x138d('0x3c')](_0x31e0fc[_0x138d('0x3d')]);_0xa8b632[_0x138d('0x3e')]=_[_0x138d('0x3f')](_0xa8b632[_0x138d('0x3b')],_0xa8b632[_0x138d('0x3d')]);_0x21623b[_0x138d('0x40')]=_[_0x138d('0x3f')](_0xa8b632[_0x138d('0x3b')],qs['fields'](_0x31e0fc[_0x138d('0x3d')][_0x138d('0x41')]));_0x21623b[_0x138d('0x40')]=_0x21623b[_0x138d('0x40')][_0x138d('0x42')]?_0x21623b[_0x138d('0x40')]:_0xa8b632[_0x138d('0x3b')];if(!_0x31e0fc[_0x138d('0x3d')][_0x138d('0x43')](_0x138d('0x44'))){_0x21623b[_0x138d('0x45')]=qs[_0x138d('0x45')](_0x31e0fc[_0x138d('0x3d')]['limit']);_0x21623b['offset']=qs[_0x138d('0x2c')](_0x31e0fc[_0x138d('0x3d')][_0x138d('0x2c')]);}_0x21623b[_0x138d('0x46')]=qs[_0x138d('0x47')](_0x31e0fc['query'][_0x138d('0x47')]);_0x21623b[_0x138d('0x48')]=qs[_0x138d('0x3e')](_[_0x138d('0x49')](_0x31e0fc[_0x138d('0x3d')],_0xa8b632[_0x138d('0x3e')]));if(_0x31e0fc[_0x138d('0x3d')]['filter']){_0x21623b[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x21623b[_0x138d('0x48')],{'$or':_[_0x138d('0x4b')](_0x1e2b28,function(_0x41aa99){if(_0x41aa99[_0x138d('0x4c')]!==_0x138d('0x4d')){var _0x9261e9={};_0x9261e9[_0x41aa99[_0x138d('0x36')]]={'$like':'%'+_0x31e0fc['query'][_0x138d('0x4e')]+'%'};return _0x9261e9;}})});}_0x21623b=_[_0x138d('0x4a')]({},_0x21623b,_0x31e0fc[_0x138d('0x4f')]);var _0x313a4c={'where':_0x21623b[_0x138d('0x48')]};return db[_0x138d('0x50')]['count'](_0x313a4c)[_0x138d('0x1c')](function(_0x3dc9b1){_0x273ff1[_0x138d('0x2b')]=_0x3dc9b1;if(_0x31e0fc[_0x138d('0x3d')][_0x138d('0x51')]){_0x21623b[_0x138d('0x52')]=[{'all':!![]}];}return db[_0x138d('0x50')]['findAll'](_0x21623b);})['then'](function(_0xa08aea){_0x273ff1[_0x138d('0x53')]=_0xa08aea;return _0x273ff1;})[_0x138d('0x1c')](respondWithFilteredResult(_0x5c95d2,_0x21623b))['catch'](handleError(_0x5c95d2,null));};exports[_0x138d('0x54')]=function(_0x265e38,_0x498cc7){var _0x2d29ea={'raw':![],'where':{'id':_0x265e38[_0x138d('0x55')]['id']}},_0x481e6e={};_0x481e6e[_0x138d('0x3b')]=_[_0x138d('0x3c')](db['FreshdeskConfiguration'][_0x138d('0x39')]);_0x481e6e[_0x138d('0x3d')]=_[_0x138d('0x3c')](_0x265e38[_0x138d('0x3d')]);_0x481e6e[_0x138d('0x3e')]=_['intersection'](_0x481e6e[_0x138d('0x3b')],_0x481e6e[_0x138d('0x3d')]);_0x2d29ea[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x481e6e[_0x138d('0x3b')],qs[_0x138d('0x41')](_0x265e38['query'][_0x138d('0x41')]));_0x2d29ea['attributes']=_0x2d29ea[_0x138d('0x40')][_0x138d('0x42')]?_0x2d29ea[_0x138d('0x40')]:_0x481e6e[_0x138d('0x3b')];if(_0x265e38[_0x138d('0x3d')][_0x138d('0x51')]){_0x2d29ea['include']=[{'all':!![]}];}_0x2d29ea=_[_0x138d('0x4a')]({},_0x2d29ea,_0x265e38[_0x138d('0x4f')]);return db['FreshdeskConfiguration'][_0x138d('0x56')](_0x2d29ea)['then'](handleEntityNotFound(_0x498cc7,null))['then'](respondWithResult(_0x498cc7,null))[_0x138d('0x27')](handleError(_0x498cc7,null));};exports['create']=function(_0x584adf,_0x3313b4){return db[_0x138d('0x50')][_0x138d('0x57')](_0x584adf[_0x138d('0x58')],{})[_0x138d('0x1c')](respondWithResult(_0x3313b4,0xc9))[_0x138d('0x27')](handleError(_0x3313b4,null));};exports[_0x138d('0x32')]=function(_0x3edcd0,_0x5d3462){if(_0x3edcd0[_0x138d('0x58')]['id']){delete _0x3edcd0['body']['id'];}return db['FreshdeskConfiguration'][_0x138d('0x56')]({'where':{'id':_0x3edcd0[_0x138d('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d3462,null))[_0x138d('0x1c')](saveUpdates(_0x3edcd0[_0x138d('0x58')],null))[_0x138d('0x1c')](respondWithResult(_0x5d3462,null))[_0x138d('0x27')](handleError(_0x5d3462,null));};exports[_0x138d('0x33')]=function(_0x2da4d1,_0xcc8ddf){return db[_0x138d('0x50')][_0x138d('0x56')]({'where':{'id':_0x2da4d1['params']['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0xcc8ddf,null))[_0x138d('0x1c')](removeEntity(_0xcc8ddf,null))[_0x138d('0x27')](handleError(_0xcc8ddf,null));};exports[_0x138d('0x59')]=function(_0x4fdf56,_0x700964,_0x1f0b41){var _0x28d2bf={};var _0x11b1cf={};var _0x4c7321;var _0x2b5b1d;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4fdf56[_0x138d('0x55')]['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0x700964,null))['then'](function(_0x30eeaf){if(_0x30eeaf){_0x4c7321=_0x30eeaf;_0x11b1cf['model']=_['keys'](db[_0x138d('0x5a')][_0x138d('0x39')]);_0x11b1cf['query']=_[_0x138d('0x3c')](_0x4fdf56[_0x138d('0x3d')]);_0x11b1cf[_0x138d('0x3e')]=_['intersection'](_0x11b1cf[_0x138d('0x3b')],_0x11b1cf[_0x138d('0x3d')]);_0x28d2bf['attributes']=_[_0x138d('0x3f')](_0x11b1cf[_0x138d('0x3b')],qs[_0x138d('0x41')](_0x4fdf56[_0x138d('0x3d')][_0x138d('0x41')]));_0x28d2bf['attributes']=_0x28d2bf['attributes'][_0x138d('0x42')]?_0x28d2bf[_0x138d('0x40')]:_0x11b1cf[_0x138d('0x3b')];_0x28d2bf['order']=qs[_0x138d('0x47')](_0x4fdf56['query'][_0x138d('0x47')]);_0x28d2bf[_0x138d('0x48')]=qs['filters'](_[_0x138d('0x49')](_0x4fdf56[_0x138d('0x3d')],_0x11b1cf[_0x138d('0x3e')]));if(_0x4fdf56[_0x138d('0x3d')]['filter']){_0x28d2bf[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x28d2bf[_0x138d('0x48')],{'$or':_['map'](_0x28d2bf[_0x138d('0x40')],function(_0x527011){var _0xe520bd={};_0xe520bd[_0x527011]={'$like':'%'+_0x4fdf56[_0x138d('0x3d')][_0x138d('0x4e')]+'%'};return _0xe520bd;})});}_0x28d2bf=_['merge']({},_0x28d2bf,_0x4fdf56['options']);return _0x4c7321[_0x138d('0x59')](_0x28d2bf);}})[_0x138d('0x1c')](function(_0x5f10d7){if(_0x5f10d7){_0x2b5b1d=_0x5f10d7[_0x138d('0x42')];if(!_0x4fdf56[_0x138d('0x3d')][_0x138d('0x43')]('nolimit')){_0x28d2bf[_0x138d('0x45')]=qs['limit'](_0x4fdf56['query'][_0x138d('0x45')]);_0x28d2bf[_0x138d('0x2c')]=qs[_0x138d('0x2c')](_0x4fdf56[_0x138d('0x3d')]['offset']);}return _0x4c7321[_0x138d('0x59')](_0x28d2bf);}})[_0x138d('0x1c')](function(_0xf7cd0d){if(_0xf7cd0d){return _0xf7cd0d?{'count':_0x2b5b1d,'rows':_0xf7cd0d}:null;}})['then'](respondWithResult(_0x700964,null))[_0x138d('0x27')](handleError(_0x700964,null));};exports[_0x138d('0x5b')]=function(_0x5bd983,_0x13335c,_0x523ee4){var _0x507037={};var _0x580d13={};var _0x4e0605;var _0x5b4158;return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0x5bd983[_0x138d('0x55')]['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0x13335c,null))[_0x138d('0x1c')](function(_0x1f3f29){if(_0x1f3f29){_0x4e0605=_0x1f3f29;_0x580d13[_0x138d('0x3b')]=_[_0x138d('0x3c')](db[_0x138d('0x5a')][_0x138d('0x39')]);_0x580d13[_0x138d('0x3d')]=_[_0x138d('0x3c')](_0x5bd983[_0x138d('0x3d')]);_0x580d13[_0x138d('0x3e')]=_[_0x138d('0x3f')](_0x580d13[_0x138d('0x3b')],_0x580d13['query']);_0x507037[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x580d13[_0x138d('0x3b')],qs[_0x138d('0x41')](_0x5bd983['query']['fields']));_0x507037['attributes']=_0x507037[_0x138d('0x40')][_0x138d('0x42')]?_0x507037['attributes']:_0x580d13[_0x138d('0x3b')];_0x507037[_0x138d('0x46')]=qs[_0x138d('0x47')](_0x5bd983['query'][_0x138d('0x47')]);_0x507037[_0x138d('0x48')]=qs['filters'](_['pick'](_0x5bd983[_0x138d('0x3d')],_0x580d13[_0x138d('0x3e')]));if(_0x5bd983[_0x138d('0x3d')][_0x138d('0x4e')]){_0x507037[_0x138d('0x48')]=_['merge'](_0x507037[_0x138d('0x48')],{'$or':_['map'](_0x507037[_0x138d('0x40')],function(_0xac12e8){var _0x148eed={};_0x148eed[_0xac12e8]={'$like':'%'+_0x5bd983[_0x138d('0x3d')][_0x138d('0x4e')]+'%'};return _0x148eed;})});}_0x507037=_[_0x138d('0x4a')]({},_0x507037,_0x5bd983['options']);return _0x4e0605[_0x138d('0x5b')](_0x507037);}})[_0x138d('0x1c')](function(_0x39e8bc){if(_0x39e8bc){_0x5b4158=_0x39e8bc[_0x138d('0x42')];if(!_0x5bd983[_0x138d('0x3d')][_0x138d('0x43')](_0x138d('0x44'))){_0x507037[_0x138d('0x45')]=qs[_0x138d('0x45')](_0x5bd983[_0x138d('0x3d')][_0x138d('0x45')]);_0x507037[_0x138d('0x2c')]=qs['offset'](_0x5bd983[_0x138d('0x3d')]['offset']);}return _0x4e0605['getSubjects'](_0x507037);}})['then'](function(_0x25c197){if(_0x25c197){return _0x25c197?{'count':_0x5b4158,'rows':_0x25c197}:null;}})[_0x138d('0x1c')](respondWithResult(_0x13335c,null))[_0x138d('0x27')](handleError(_0x13335c,null));};exports['getDescriptions']=function(_0xc07229,_0xc5ac67,_0x287416){var _0x50ea09={};var _0x268f2a={};var _0x3a5a21;var _0x39a832;return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0xc07229[_0x138d('0x55')]['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0xc5ac67,null))[_0x138d('0x1c')](function(_0x2cd5ca){if(_0x2cd5ca){_0x3a5a21=_0x2cd5ca;_0x268f2a['model']=_[_0x138d('0x3c')](db['FreshdeskField'][_0x138d('0x39')]);_0x268f2a[_0x138d('0x3d')]=_[_0x138d('0x3c')](_0xc07229[_0x138d('0x3d')]);_0x268f2a['filters']=_['intersection'](_0x268f2a[_0x138d('0x3b')],_0x268f2a[_0x138d('0x3d')]);_0x50ea09[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x268f2a[_0x138d('0x3b')],qs[_0x138d('0x41')](_0xc07229[_0x138d('0x3d')][_0x138d('0x41')]));_0x50ea09['attributes']=_0x50ea09[_0x138d('0x40')][_0x138d('0x42')]?_0x50ea09[_0x138d('0x40')]:_0x268f2a[_0x138d('0x3b')];_0x50ea09[_0x138d('0x46')]=qs[_0x138d('0x47')](_0xc07229[_0x138d('0x3d')][_0x138d('0x47')]);_0x50ea09[_0x138d('0x48')]=qs[_0x138d('0x3e')](_[_0x138d('0x49')](_0xc07229['query'],_0x268f2a['filters']));if(_0xc07229['query'][_0x138d('0x4e')]){_0x50ea09[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x50ea09[_0x138d('0x48')],{'$or':_['map'](_0x50ea09[_0x138d('0x40')],function(_0x5bb0d6){var _0x48b2eb={};_0x48b2eb[_0x5bb0d6]={'$like':'%'+_0xc07229[_0x138d('0x3d')][_0x138d('0x4e')]+'%'};return _0x48b2eb;})});}_0x50ea09=_[_0x138d('0x4a')]({},_0x50ea09,_0xc07229[_0x138d('0x4f')]);return _0x3a5a21['getDescriptions'](_0x50ea09);}})['then'](function(_0x5de1de){if(_0x5de1de){_0x39a832=_0x5de1de[_0x138d('0x42')];if(!_0xc07229[_0x138d('0x3d')][_0x138d('0x43')]('nolimit')){_0x50ea09[_0x138d('0x45')]=qs['limit'](_0xc07229['query'][_0x138d('0x45')]);_0x50ea09[_0x138d('0x2c')]=qs[_0x138d('0x2c')](_0xc07229[_0x138d('0x3d')][_0x138d('0x2c')]);}return _0x3a5a21[_0x138d('0x5d')](_0x50ea09);}})[_0x138d('0x1c')](function(_0x204739){if(_0x204739){return _0x204739?{'count':_0x39a832,'rows':_0x204739}:null;}})[_0x138d('0x1c')](respondWithResult(_0xc5ac67,null))[_0x138d('0x27')](handleError(_0xc5ac67,null));};exports[_0x138d('0x5e')]=function(_0x4b0e91,_0x4f8663,_0x4c271d){var _0x471d68={};var _0x386fbd={};var _0x5a17ef;var _0x152c68;return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0x4b0e91['params']['id']}})['then'](handleEntityNotFound(_0x4f8663,null))[_0x138d('0x1c')](function(_0x32cf5c){if(_0x32cf5c){_0x5a17ef=_0x32cf5c;_0x386fbd[_0x138d('0x3b')]=_['keys'](db[_0x138d('0x5f')][_0x138d('0x39')]);_0x386fbd['query']=_[_0x138d('0x3c')](_0x4b0e91[_0x138d('0x3d')]);_0x386fbd[_0x138d('0x3e')]=_[_0x138d('0x3f')](_0x386fbd[_0x138d('0x3b')],_0x386fbd['query']);_0x471d68[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x386fbd[_0x138d('0x3b')],qs['fields'](_0x4b0e91[_0x138d('0x3d')][_0x138d('0x41')]));_0x471d68[_0x138d('0x40')]=_0x471d68[_0x138d('0x40')][_0x138d('0x42')]?_0x471d68['attributes']:_0x386fbd[_0x138d('0x3b')];_0x471d68[_0x138d('0x46')]=qs[_0x138d('0x47')](_0x4b0e91['query'][_0x138d('0x47')]);_0x471d68[_0x138d('0x48')]=qs[_0x138d('0x3e')](_[_0x138d('0x49')](_0x4b0e91[_0x138d('0x3d')],_0x386fbd[_0x138d('0x3e')]));if(_0x4b0e91['query'][_0x138d('0x4e')]){_0x471d68[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x471d68[_0x138d('0x48')],{'$or':_[_0x138d('0x4b')](_0x471d68['attributes'],function(_0x3ee3bd){var _0x27bd19={};_0x27bd19[_0x3ee3bd]={'$like':'%'+_0x4b0e91[_0x138d('0x3d')]['filter']+'%'};return _0x27bd19;})});}_0x471d68=_[_0x138d('0x4a')]({},_0x471d68,_0x4b0e91[_0x138d('0x4f')]);return _0x5a17ef[_0x138d('0x5e')](_0x471d68);}})['then'](function(_0x33aaa0){if(_0x33aaa0){_0x152c68=_0x33aaa0[_0x138d('0x42')];if(!_0x4b0e91['query'][_0x138d('0x43')](_0x138d('0x44'))){_0x471d68[_0x138d('0x45')]=qs[_0x138d('0x45')](_0x4b0e91[_0x138d('0x3d')]['limit']);_0x471d68['offset']=qs[_0x138d('0x2c')](_0x4b0e91[_0x138d('0x3d')][_0x138d('0x2c')]);}return _0x5a17ef['getTags'](_0x471d68);}})['then'](function(_0x2e0490){if(_0x2e0490){return _0x2e0490?{'count':_0x152c68,'rows':_0x2e0490}:null;}})['then'](respondWithResult(_0x4f8663,null))['catch'](handleError(_0x4f8663,null));};exports[_0x138d('0x60')]=function(_0x82b2c2,_0x1f10eb,_0x5dbdd1){if(_0x82b2c2[_0x138d('0x58')]['id']){delete _0x82b2c2['body']['id'];}return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0x82b2c2['params']['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0x1f10eb,null))[_0x138d('0x1c')](function(_0x329e78){if(_0x329e78){return _0x329e78[_0x138d('0x60')](_0x82b2c2[_0x138d('0x58')]['ids']||[]);}return null;})[_0x138d('0x1c')](respondWithResult(_0x1f10eb,null))[_0x138d('0x27')](handleError(_0x1f10eb,null));}; \ No newline at end of file +var _0xcf7e=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','json','offset','apply','reject','save','destroy','stack','name','send','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','count','rows','catch','show','params','fields','includeAll','include','options','create','body','find','getFields','findOne','FreshdeskField','order','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','squel','desk.js'];(function(_0x209348,_0x332c44){var _0x1e741a=function(_0x37b835){while(--_0x37b835){_0x209348['push'](_0x209348['shift']());}};_0x1e741a(++_0x332c44);}(_0xcf7e,0xaf));var _0xecf7=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xcf7e[_0x3d42d8];return _0x27fc41;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xecf7('0x0'));var zipdir=require(_0xecf7('0x1'));var jsonpatch=require(_0xecf7('0x2'));var rp=require('request-promise');var moment=require(_0xecf7('0x3'));var BPromise=require(_0xecf7('0x4'));var Mustache=require('mustache');var util=require(_0xecf7('0x5'));var path=require(_0xecf7('0x6'));var sox=require('sox');var csv=require(_0xecf7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xecf7('0x8'));var squel=require(_0xecf7('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xecf7('0xa'));var toCsv=require('to-csv');var querystring=require(_0xecf7('0xb'));var Papa=require(_0xecf7('0xc'));var Redis=require(_0xecf7('0xd'));var authService=require(_0xecf7('0xe'));var qs=require(_0xecf7('0xf'));var as=require(_0xecf7('0x10'));var hardwareService=require(_0xecf7('0x11'));var logger=require('../../config/logger')(_0xecf7('0x12'));var utils=require(_0xecf7('0x13'));var config=require(_0xecf7('0x14'));var db=require(_0xecf7('0x15'))['db'];var jayson=require(_0xecf7('0x16'));var client=jayson[_0xecf7('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5cdc0c,_0xa72665,_0x39f439){if(_0x39f439){var _0x18fc4a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18fc4a['test'](_0xa72665)){return _0x5cdc0c;}else{throw new db[(_0xecf7('0x18'))]['ValidationError'](_0xecf7('0x19'));}}else{return _0x5cdc0c;}}function respondWithRpcPromise(_0x26181d,_0x5ca32a,_0x332ec7,_0x580fc2){return new BPromise(function(_0x5d7dbb,_0x2d5413){var _0x2e69c5=_0x580fc2||client;return _0x2e69c5[_0xecf7('0x1a')](_0x26181d,_0x332ec7)[_0xecf7('0x1b')](function(_0x1c27ee){logger['info'](_0xecf7('0x1c'),_0x5ca32a,'request\x20sent');logger[_0xecf7('0x1d')](_0xecf7('0x1e'),_0x5ca32a,_0xecf7('0x1f'),JSON[_0xecf7('0x20')](_0x1c27ee));if(_0x1c27ee[_0xecf7('0x21')]){if(_0x1c27ee[_0xecf7('0x21')][_0xecf7('0x22')]===0x1f4){logger[_0xecf7('0x21')](_0xecf7('0x1c'),_0x5ca32a,_0x1c27ee[_0xecf7('0x21')][_0xecf7('0x23')]);return _0x2d5413(_0x1c27ee[_0xecf7('0x21')][_0xecf7('0x23')]);}logger[_0xecf7('0x21')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5ca32a,_0x1c27ee['error']['message']);return _0x5d7dbb(_0x1c27ee[_0xecf7('0x21')][_0xecf7('0x23')]);}else{logger[_0xecf7('0x24')](_0xecf7('0x1c'),_0x5ca32a,_0xecf7('0x1f'));_0x5d7dbb(_0x1c27ee[_0xecf7('0x25')][_0xecf7('0x23')]);}})['catch'](function(_0x40a8c5){logger[_0xecf7('0x21')](_0xecf7('0x1c'),_0x5ca32a,_0x40a8c5);_0x2d5413(_0x40a8c5);});});}function respondWithStatusCode(_0x3ffc22,_0x544989){_0x544989=_0x544989||0xcc;return function(_0x1db045){if(_0x1db045){return _0x3ffc22[_0xecf7('0x26')](_0x544989);}return _0x3ffc22[_0xecf7('0x27')](_0x544989)[_0xecf7('0x28')]();};}function respondWithResult(_0x96e7d,_0x32f695){_0x32f695=_0x32f695||0xc8;return function(_0x5c6fd7){if(_0x5c6fd7){return _0x96e7d[_0xecf7('0x27')](_0x32f695)[_0xecf7('0x29')](_0x5c6fd7);}};}function respondWithFilteredResult(_0x7d7094,_0x567bf8){return function(_0x54c109){if(_0x54c109){var _0x655285=_0x54c109['count'],_0x241bb0=_0x567bf8[_0xecf7('0x2a')],_0xabf159=_0x567bf8[_0xecf7('0x2a')]+_0x567bf8['limit'],_0x213756;if(_0xabf159>=_0x655285){_0xabf159=_0x655285;_0x213756=0xc8;}else{_0x213756=0xce;}_0x7d7094[_0xecf7('0x27')](_0x213756);return _0x7d7094['set']('Content-Range',_0x241bb0+'-'+_0xabf159+'/'+_0x655285)['json'](_0x54c109);}return null;};}function patchUpdates(_0x4cf7bb){return function(_0x569449){try{jsonpatch[_0xecf7('0x2b')](_0x569449,_0x4cf7bb,!![]);}catch(_0x1b862f){return BPromise[_0xecf7('0x2c')](_0x1b862f);}return _0x569449[_0xecf7('0x2d')]();};}function saveUpdates(_0x45abd8,_0x1f880a){return function(_0x5877a7){if(_0x5877a7){return _0x5877a7['update'](_0x45abd8)['then'](function(_0x4d940d){return _0x4d940d;});}return null;};}function removeEntity(_0x2a4c7b,_0x52d6b6){return function(_0x330be9){if(_0x330be9){return _0x330be9[_0xecf7('0x2e')]()[_0xecf7('0x1b')](function(){_0x2a4c7b[_0xecf7('0x27')](0xcc)[_0xecf7('0x28')]();});}};}function handleEntityNotFound(_0xd2cd9,_0x320ec6){return function(_0x3c360c){if(!_0x3c360c){_0xd2cd9['sendStatus'](0x194);}return _0x3c360c;};}function handleError(_0x54ada1,_0x364eaf){_0x364eaf=_0x364eaf||0x1f4;return function(_0x31845e){logger[_0xecf7('0x21')](_0x31845e[_0xecf7('0x2f')]);if(_0x31845e[_0xecf7('0x30')]){delete _0x31845e[_0xecf7('0x30')];}_0x54ada1[_0xecf7('0x27')](_0x364eaf)[_0xecf7('0x31')](_0x31845e);};}exports['index']=function(_0x3a9366,_0x45e19d){var _0x3f51c8={},_0x2c98e3={},_0x319ff3={'count':0x0,'rows':[]};var _0x3f704e=_[_0xecf7('0x32')](db[_0xecf7('0x33')][_0xecf7('0x34')],function(_0x640026){return{'name':_0x640026[_0xecf7('0x35')],'type':_0x640026[_0xecf7('0x36')][_0xecf7('0x37')]};});_0x2c98e3[_0xecf7('0x38')]=_[_0xecf7('0x32')](_0x3f704e,'name');_0x2c98e3[_0xecf7('0x39')]=_[_0xecf7('0x3a')](_0x3a9366[_0xecf7('0x39')]);_0x2c98e3[_0xecf7('0x3b')]=_[_0xecf7('0x3c')](_0x2c98e3['model'],_0x2c98e3[_0xecf7('0x39')]);_0x3f51c8[_0xecf7('0x3d')]=_[_0xecf7('0x3c')](_0x2c98e3[_0xecf7('0x38')],qs['fields'](_0x3a9366[_0xecf7('0x39')]['fields']));_0x3f51c8[_0xecf7('0x3d')]=_0x3f51c8[_0xecf7('0x3d')][_0xecf7('0x3e')]?_0x3f51c8[_0xecf7('0x3d')]:_0x2c98e3[_0xecf7('0x38')];if(!_0x3a9366[_0xecf7('0x39')][_0xecf7('0x3f')](_0xecf7('0x40'))){_0x3f51c8[_0xecf7('0x41')]=qs[_0xecf7('0x41')](_0x3a9366[_0xecf7('0x39')][_0xecf7('0x41')]);_0x3f51c8['offset']=qs[_0xecf7('0x2a')](_0x3a9366[_0xecf7('0x39')][_0xecf7('0x2a')]);}_0x3f51c8['order']=qs['sort'](_0x3a9366[_0xecf7('0x39')][_0xecf7('0x42')]);_0x3f51c8['where']=qs[_0xecf7('0x3b')](_[_0xecf7('0x43')](_0x3a9366[_0xecf7('0x39')],_0x2c98e3[_0xecf7('0x3b')]));if(_0x3a9366['query']['filter']){_0x3f51c8[_0xecf7('0x44')]=_[_0xecf7('0x45')](_0x3f51c8[_0xecf7('0x44')],{'$or':_[_0xecf7('0x32')](_0x3f704e,function(_0x19442f){if(_0x19442f[_0xecf7('0x36')]!==_0xecf7('0x46')){var _0xac5e77={};_0xac5e77[_0x19442f[_0xecf7('0x30')]]={'$like':'%'+_0x3a9366[_0xecf7('0x39')][_0xecf7('0x47')]+'%'};return _0xac5e77;}})});}_0x3f51c8=_['merge']({},_0x3f51c8,_0x3a9366['options']);var _0x347c09={'where':_0x3f51c8[_0xecf7('0x44')]};return db[_0xecf7('0x33')][_0xecf7('0x48')](_0x347c09)['then'](function(_0x4ca3){_0x319ff3[_0xecf7('0x48')]=_0x4ca3;if(_0x3a9366[_0xecf7('0x39')]['includeAll']){_0x3f51c8['include']=[{'all':!![]}];}return db[_0xecf7('0x33')]['findAll'](_0x3f51c8);})[_0xecf7('0x1b')](function(_0x52b217){_0x319ff3[_0xecf7('0x49')]=_0x52b217;return _0x319ff3;})[_0xecf7('0x1b')](respondWithFilteredResult(_0x45e19d,_0x3f51c8))[_0xecf7('0x4a')](handleError(_0x45e19d,null));};exports[_0xecf7('0x4b')]=function(_0x33eb5f,_0x298bd7){var _0x33af1c={'raw':![],'where':{'id':_0x33eb5f[_0xecf7('0x4c')]['id']}},_0xcebb6b={};_0xcebb6b[_0xecf7('0x38')]=_['keys'](db['FreshdeskConfiguration'][_0xecf7('0x34')]);_0xcebb6b[_0xecf7('0x39')]=_[_0xecf7('0x3a')](_0x33eb5f[_0xecf7('0x39')]);_0xcebb6b[_0xecf7('0x3b')]=_[_0xecf7('0x3c')](_0xcebb6b[_0xecf7('0x38')],_0xcebb6b[_0xecf7('0x39')]);_0x33af1c[_0xecf7('0x3d')]=_[_0xecf7('0x3c')](_0xcebb6b['model'],qs[_0xecf7('0x4d')](_0x33eb5f[_0xecf7('0x39')][_0xecf7('0x4d')]));_0x33af1c['attributes']=_0x33af1c[_0xecf7('0x3d')][_0xecf7('0x3e')]?_0x33af1c[_0xecf7('0x3d')]:_0xcebb6b[_0xecf7('0x38')];if(_0x33eb5f[_0xecf7('0x39')][_0xecf7('0x4e')]){_0x33af1c[_0xecf7('0x4f')]=[{'all':!![]}];}_0x33af1c=_[_0xecf7('0x45')]({},_0x33af1c,_0x33eb5f[_0xecf7('0x50')]);return db[_0xecf7('0x33')]['find'](_0x33af1c)['then'](handleEntityNotFound(_0x298bd7,null))['then'](respondWithResult(_0x298bd7,null))[_0xecf7('0x4a')](handleError(_0x298bd7,null));};exports['create']=function(_0x4c7425,_0x4dab8f){return db[_0xecf7('0x33')][_0xecf7('0x51')](_0x4c7425[_0xecf7('0x52')],{})['then'](respondWithResult(_0x4dab8f,0xc9))[_0xecf7('0x4a')](handleError(_0x4dab8f,null));};exports['update']=function(_0x13a4b1,_0x39ddc7){if(_0x13a4b1['body']['id']){delete _0x13a4b1[_0xecf7('0x52')]['id'];}return db[_0xecf7('0x33')][_0xecf7('0x53')]({'where':{'id':_0x13a4b1[_0xecf7('0x4c')]['id']}})[_0xecf7('0x1b')](handleEntityNotFound(_0x39ddc7,null))[_0xecf7('0x1b')](saveUpdates(_0x13a4b1['body'],null))[_0xecf7('0x1b')](respondWithResult(_0x39ddc7,null))['catch'](handleError(_0x39ddc7,null));};exports[_0xecf7('0x2e')]=function(_0x293403,_0x3640f2){return db['FreshdeskConfiguration'][_0xecf7('0x53')]({'where':{'id':_0x293403['params']['id']}})[_0xecf7('0x1b')](handleEntityNotFound(_0x3640f2,null))[_0xecf7('0x1b')](removeEntity(_0x3640f2,null))[_0xecf7('0x4a')](handleError(_0x3640f2,null));};exports[_0xecf7('0x54')]=function(_0x5e7d9f,_0x162367,_0x4d7e72){var _0x21fff4={};var _0xe0941f={};var _0x12b778;var _0x2c613e;return db[_0xecf7('0x33')][_0xecf7('0x55')]({'where':{'id':_0x5e7d9f[_0xecf7('0x4c')]['id']}})[_0xecf7('0x1b')](handleEntityNotFound(_0x162367,null))['then'](function(_0x360465){if(_0x360465){_0x12b778=_0x360465;_0xe0941f[_0xecf7('0x38')]=_[_0xecf7('0x3a')](db[_0xecf7('0x56')][_0xecf7('0x34')]);_0xe0941f[_0xecf7('0x39')]=_['keys'](_0x5e7d9f[_0xecf7('0x39')]);_0xe0941f[_0xecf7('0x3b')]=_[_0xecf7('0x3c')](_0xe0941f['model'],_0xe0941f[_0xecf7('0x39')]);_0x21fff4[_0xecf7('0x3d')]=_[_0xecf7('0x3c')](_0xe0941f[_0xecf7('0x38')],qs[_0xecf7('0x4d')](_0x5e7d9f[_0xecf7('0x39')][_0xecf7('0x4d')]));_0x21fff4['attributes']=_0x21fff4[_0xecf7('0x3d')]['length']?_0x21fff4[_0xecf7('0x3d')]:_0xe0941f[_0xecf7('0x38')];_0x21fff4[_0xecf7('0x57')]=qs[_0xecf7('0x42')](_0x5e7d9f[_0xecf7('0x39')][_0xecf7('0x42')]);_0x21fff4[_0xecf7('0x44')]=qs[_0xecf7('0x3b')](_[_0xecf7('0x43')](_0x5e7d9f[_0xecf7('0x39')],_0xe0941f['filters']));if(_0x5e7d9f['query']['filter']){_0x21fff4['where']=_[_0xecf7('0x45')](_0x21fff4['where'],{'$or':_[_0xecf7('0x32')](_0x21fff4[_0xecf7('0x3d')],function(_0x18c501){var _0x276b25={};_0x276b25[_0x18c501]={'$like':'%'+_0x5e7d9f[_0xecf7('0x39')][_0xecf7('0x47')]+'%'};return _0x276b25;})});}_0x21fff4=_[_0xecf7('0x45')]({},_0x21fff4,_0x5e7d9f[_0xecf7('0x50')]);return _0x12b778[_0xecf7('0x54')](_0x21fff4);}})['then'](function(_0x1249b6){if(_0x1249b6){_0x2c613e=_0x1249b6['length'];if(!_0x5e7d9f[_0xecf7('0x39')][_0xecf7('0x3f')](_0xecf7('0x40'))){_0x21fff4[_0xecf7('0x41')]=qs[_0xecf7('0x41')](_0x5e7d9f[_0xecf7('0x39')][_0xecf7('0x41')]);_0x21fff4[_0xecf7('0x2a')]=qs['offset'](_0x5e7d9f[_0xecf7('0x39')]['offset']);}return _0x12b778[_0xecf7('0x54')](_0x21fff4);}})[_0xecf7('0x1b')](function(_0xb327e){if(_0xb327e){return _0xb327e?{'count':_0x2c613e,'rows':_0xb327e}:null;}})[_0xecf7('0x1b')](respondWithResult(_0x162367,null))[_0xecf7('0x4a')](handleError(_0x162367,null));};exports['getSubjects']=function(_0x3f4bf6,_0x2c8a0e,_0x102ed7){var _0x4d1a57={};var _0x3428e3={};var _0x1453e6;var _0x27c309;return db[_0xecf7('0x33')]['findOne']({'where':{'id':_0x3f4bf6['params']['id']}})[_0xecf7('0x1b')](handleEntityNotFound(_0x2c8a0e,null))[_0xecf7('0x1b')](function(_0x5524ea){if(_0x5524ea){_0x1453e6=_0x5524ea;_0x3428e3['model']=_['keys'](db[_0xecf7('0x56')][_0xecf7('0x34')]);_0x3428e3[_0xecf7('0x39')]=_['keys'](_0x3f4bf6[_0xecf7('0x39')]);_0x3428e3[_0xecf7('0x3b')]=_['intersection'](_0x3428e3[_0xecf7('0x38')],_0x3428e3['query']);_0x4d1a57[_0xecf7('0x3d')]=_[_0xecf7('0x3c')](_0x3428e3[_0xecf7('0x38')],qs[_0xecf7('0x4d')](_0x3f4bf6[_0xecf7('0x39')][_0xecf7('0x4d')]));_0x4d1a57['attributes']=_0x4d1a57[_0xecf7('0x3d')][_0xecf7('0x3e')]?_0x4d1a57[_0xecf7('0x3d')]:_0x3428e3[_0xecf7('0x38')];_0x4d1a57[_0xecf7('0x57')]=qs[_0xecf7('0x42')](_0x3f4bf6['query'][_0xecf7('0x42')]);_0x4d1a57[_0xecf7('0x44')]=qs[_0xecf7('0x3b')](_[_0xecf7('0x43')](_0x3f4bf6['query'],_0x3428e3['filters']));if(_0x3f4bf6[_0xecf7('0x39')]['filter']){_0x4d1a57['where']=_[_0xecf7('0x45')](_0x4d1a57[_0xecf7('0x44')],{'$or':_['map'](_0x4d1a57['attributes'],function(_0x2edf59){var _0x5e6c02={};_0x5e6c02[_0x2edf59]={'$like':'%'+_0x3f4bf6[_0xecf7('0x39')][_0xecf7('0x47')]+'%'};return _0x5e6c02;})});}_0x4d1a57=_[_0xecf7('0x45')]({},_0x4d1a57,_0x3f4bf6['options']);return _0x1453e6[_0xecf7('0x58')](_0x4d1a57);}})[_0xecf7('0x1b')](function(_0x258812){if(_0x258812){_0x27c309=_0x258812[_0xecf7('0x3e')];if(!_0x3f4bf6[_0xecf7('0x39')][_0xecf7('0x3f')](_0xecf7('0x40'))){_0x4d1a57['limit']=qs[_0xecf7('0x41')](_0x3f4bf6['query'][_0xecf7('0x41')]);_0x4d1a57[_0xecf7('0x2a')]=qs[_0xecf7('0x2a')](_0x3f4bf6[_0xecf7('0x39')][_0xecf7('0x2a')]);}return _0x1453e6[_0xecf7('0x58')](_0x4d1a57);}})['then'](function(_0x52cee4){if(_0x52cee4){return _0x52cee4?{'count':_0x27c309,'rows':_0x52cee4}:null;}})[_0xecf7('0x1b')](respondWithResult(_0x2c8a0e,null))[_0xecf7('0x4a')](handleError(_0x2c8a0e,null));};exports[_0xecf7('0x59')]=function(_0xc588c0,_0x1e8b51,_0xd78efe){var _0x36402e={};var _0x390ad0={};var _0x1e4fe6;var _0x1f3475;return db[_0xecf7('0x33')]['findOne']({'where':{'id':_0xc588c0['params']['id']}})[_0xecf7('0x1b')](handleEntityNotFound(_0x1e8b51,null))[_0xecf7('0x1b')](function(_0x2c1385){if(_0x2c1385){_0x1e4fe6=_0x2c1385;_0x390ad0[_0xecf7('0x38')]=_[_0xecf7('0x3a')](db[_0xecf7('0x56')][_0xecf7('0x34')]);_0x390ad0[_0xecf7('0x39')]=_[_0xecf7('0x3a')](_0xc588c0[_0xecf7('0x39')]);_0x390ad0[_0xecf7('0x3b')]=_[_0xecf7('0x3c')](_0x390ad0[_0xecf7('0x38')],_0x390ad0['query']);_0x36402e[_0xecf7('0x3d')]=_['intersection'](_0x390ad0[_0xecf7('0x38')],qs['fields'](_0xc588c0[_0xecf7('0x39')][_0xecf7('0x4d')]));_0x36402e[_0xecf7('0x3d')]=_0x36402e['attributes'][_0xecf7('0x3e')]?_0x36402e['attributes']:_0x390ad0[_0xecf7('0x38')];_0x36402e[_0xecf7('0x57')]=qs[_0xecf7('0x42')](_0xc588c0[_0xecf7('0x39')][_0xecf7('0x42')]);_0x36402e[_0xecf7('0x44')]=qs[_0xecf7('0x3b')](_[_0xecf7('0x43')](_0xc588c0['query'],_0x390ad0[_0xecf7('0x3b')]));if(_0xc588c0[_0xecf7('0x39')][_0xecf7('0x47')]){_0x36402e[_0xecf7('0x44')]=_[_0xecf7('0x45')](_0x36402e[_0xecf7('0x44')],{'$or':_[_0xecf7('0x32')](_0x36402e['attributes'],function(_0x55d9c5){var _0x4bff01={};_0x4bff01[_0x55d9c5]={'$like':'%'+_0xc588c0['query']['filter']+'%'};return _0x4bff01;})});}_0x36402e=_[_0xecf7('0x45')]({},_0x36402e,_0xc588c0[_0xecf7('0x50')]);return _0x1e4fe6[_0xecf7('0x59')](_0x36402e);}})[_0xecf7('0x1b')](function(_0x5a60ba){if(_0x5a60ba){_0x1f3475=_0x5a60ba[_0xecf7('0x3e')];if(!_0xc588c0[_0xecf7('0x39')]['hasOwnProperty'](_0xecf7('0x40'))){_0x36402e[_0xecf7('0x41')]=qs['limit'](_0xc588c0[_0xecf7('0x39')][_0xecf7('0x41')]);_0x36402e[_0xecf7('0x2a')]=qs['offset'](_0xc588c0[_0xecf7('0x39')]['offset']);}return _0x1e4fe6[_0xecf7('0x59')](_0x36402e);}})[_0xecf7('0x1b')](function(_0xc8f181){if(_0xc8f181){return _0xc8f181?{'count':_0x1f3475,'rows':_0xc8f181}:null;}})['then'](respondWithResult(_0x1e8b51,null))['catch'](handleError(_0x1e8b51,null));};exports[_0xecf7('0x5a')]=function(_0x3d5317,_0x41c87b,_0x24a669){var _0x1c3f86={};var _0x16c1ad={};var _0xfdb2cb;var _0xc5dd2a;return db[_0xecf7('0x33')][_0xecf7('0x55')]({'where':{'id':_0x3d5317['params']['id']}})['then'](handleEntityNotFound(_0x41c87b,null))[_0xecf7('0x1b')](function(_0x4c4c1a){if(_0x4c4c1a){_0xfdb2cb=_0x4c4c1a;_0x16c1ad[_0xecf7('0x38')]=_[_0xecf7('0x3a')](db[_0xecf7('0x5b')][_0xecf7('0x34')]);_0x16c1ad[_0xecf7('0x39')]=_[_0xecf7('0x3a')](_0x3d5317[_0xecf7('0x39')]);_0x16c1ad['filters']=_[_0xecf7('0x3c')](_0x16c1ad['model'],_0x16c1ad[_0xecf7('0x39')]);_0x1c3f86['attributes']=_[_0xecf7('0x3c')](_0x16c1ad['model'],qs[_0xecf7('0x4d')](_0x3d5317['query']['fields']));_0x1c3f86[_0xecf7('0x3d')]=_0x1c3f86[_0xecf7('0x3d')]['length']?_0x1c3f86['attributes']:_0x16c1ad[_0xecf7('0x38')];_0x1c3f86[_0xecf7('0x57')]=qs[_0xecf7('0x42')](_0x3d5317['query'][_0xecf7('0x42')]);_0x1c3f86['where']=qs[_0xecf7('0x3b')](_[_0xecf7('0x43')](_0x3d5317[_0xecf7('0x39')],_0x16c1ad[_0xecf7('0x3b')]));if(_0x3d5317[_0xecf7('0x39')][_0xecf7('0x47')]){_0x1c3f86['where']=_[_0xecf7('0x45')](_0x1c3f86[_0xecf7('0x44')],{'$or':_[_0xecf7('0x32')](_0x1c3f86['attributes'],function(_0x2121a4){var _0x2eac02={};_0x2eac02[_0x2121a4]={'$like':'%'+_0x3d5317['query'][_0xecf7('0x47')]+'%'};return _0x2eac02;})});}_0x1c3f86=_[_0xecf7('0x45')]({},_0x1c3f86,_0x3d5317[_0xecf7('0x50')]);return _0xfdb2cb[_0xecf7('0x5a')](_0x1c3f86);}})[_0xecf7('0x1b')](function(_0x391d6b){if(_0x391d6b){_0xc5dd2a=_0x391d6b[_0xecf7('0x3e')];if(!_0x3d5317[_0xecf7('0x39')][_0xecf7('0x3f')](_0xecf7('0x40'))){_0x1c3f86[_0xecf7('0x41')]=qs[_0xecf7('0x41')](_0x3d5317['query']['limit']);_0x1c3f86[_0xecf7('0x2a')]=qs[_0xecf7('0x2a')](_0x3d5317[_0xecf7('0x39')][_0xecf7('0x2a')]);}return _0xfdb2cb[_0xecf7('0x5a')](_0x1c3f86);}})[_0xecf7('0x1b')](function(_0x2de03f){if(_0x2de03f){return _0x2de03f?{'count':_0xc5dd2a,'rows':_0x2de03f}:null;}})[_0xecf7('0x1b')](respondWithResult(_0x41c87b,null))[_0xecf7('0x4a')](handleError(_0x41c87b,null));};exports[_0xecf7('0x5c')]=function(_0x2e53ea,_0x21caa1,_0x508025){if(_0x2e53ea[_0xecf7('0x52')]['id']){delete _0x2e53ea['body']['id'];}return db[_0xecf7('0x33')][_0xecf7('0x55')]({'where':{'id':_0x2e53ea[_0xecf7('0x4c')]['id']}})[_0xecf7('0x1b')](handleEntityNotFound(_0x21caa1,null))[_0xecf7('0x1b')](function(_0x1d376e){if(_0x1d376e){return _0x1d376e['setTags'](_0x2e53ea[_0xecf7('0x52')]['ids']||[]);}return null;})[_0xecf7('0x1b')](respondWithResult(_0x21caa1,null))[_0xecf7('0x4a')](handleError(_0x21caa1,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 1776e55..58cc19f 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 _0xbd29=['lodash','moment','bluebird','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x151dee,_0x3f620f){var _0x36879b=function(_0x5a7c23){while(--_0x5a7c23){_0x151dee['push'](_0x151dee['shift']());}};_0x36879b(++_0x3f620f);}(_0xbd29,0x1a7));var _0x9bd2=function(_0x515ed9,_0x121929){_0x515ed9=_0x515ed9-0x0;var _0xfb4686=_0xbd29[_0x515ed9];return _0xfb4686;};'use strict';var _=require(_0x9bd2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9bd2('0x1'));var BPromise=require(_0x9bd2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9bd2('0x3'));var config=require(_0x9bd2('0x4'));var attributes=require(_0x9bd2('0x5'));module[_0x9bd2('0x6')]=function(_0x46cdc6,_0x2c634a){return _0x46cdc6[_0x9bd2('0x7')](_0x9bd2('0x8'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5719=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api'];(function(_0x1148d5,_0x311799){var _0x2617f4=function(_0x10b13b){while(--_0x10b13b){_0x1148d5['push'](_0x1148d5['shift']());}};_0x2617f4(++_0x311799);}(_0x5719,0xd9));var _0x9571=function(_0x32e61f,_0x413d17){_0x32e61f=_0x32e61f-0x0;var _0x4c7a83=_0x5719[_0x32e61f];return _0x4c7a83;};'use strict';var _=require(_0x9571('0x0'));var util=require(_0x9571('0x1'));var logger=require(_0x9571('0x2'))(_0x9571('0x3'));var moment=require('moment');var BPromise=require(_0x9571('0x4'));var rp=require(_0x9571('0x5'));var fs=require('fs');var path=require(_0x9571('0x6'));var rimraf=require(_0x9571('0x7'));var config=require(_0x9571('0x8'));var attributes=require(_0x9571('0x9'));module['exports']=function(_0x3950ef,_0x2018cc){return _0x3950ef[_0x9571('0xa')](_0x9571('0xb'),attributes,{'tableName':_0x9571('0xc'),'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 440b30d..7f839d3 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 _0x7fae=['http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3f63be,_0x42a5a1){var _0x574710=function(_0x38cf18){while(--_0x38cf18){_0x3f63be['push'](_0x3f63be['shift']());}};_0x574710(++_0x42a5a1);}(_0x7fae,0x131));var _0xe7fa=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x7fae[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xe7fa('0x0'));var util=require(_0xe7fa('0x1'));var moment=require('moment');var BPromise=require(_0xe7fa('0x2'));var rs=require(_0xe7fa('0x3'));var fs=require('fs');var Redis=require(_0xe7fa('0x4'));var db=require(_0xe7fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fa('0x6'))(_0xe7fa('0x7'));var config=require(_0xe7fa('0x8'));var jayson=require(_0xe7fa('0x9'));var client=jayson['client'][_0xe7fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f7547,_0x31e32e,_0x5585e6){return new BPromise(function(_0x59656a,_0x43d328){return client[_0xe7fa('0xb')](_0x2f7547,_0x5585e6)['then'](function(_0xdc6ee1){logger[_0xe7fa('0xc')](_0xe7fa('0xd'),_0x31e32e,_0xe7fa('0xe'));logger[_0xe7fa('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x31e32e,_0xe7fa('0xe'),JSON[_0xe7fa('0x10')](_0xdc6ee1));if(_0xdc6ee1['error']){if(_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x12')]===0x1f4){logger['error'](_0xe7fa('0xd'),_0x31e32e,_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x13')]);return _0x43d328(_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x13')]);}logger[_0xe7fa('0x11')](_0xe7fa('0xd'),_0x31e32e,_0xdc6ee1['error'][_0xe7fa('0x13')]);return _0x59656a(_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x13')]);}else{logger['info'](_0xe7fa('0xd'),_0x31e32e,_0xe7fa('0xe'));_0x59656a(_0xdc6ee1[_0xe7fa('0x14')][_0xe7fa('0x13')]);}})['catch'](function(_0x491f54){logger[_0xe7fa('0x11')](_0xe7fa('0xd'),_0x31e32e,_0x491f54);_0x43d328(_0x491f54);});});} \ No newline at end of file +var _0xa65a=['jayson/promise','client','http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0xa65a,0x10c));var _0xaa65=function(_0x40992a,_0x25b2d6){_0x40992a=_0x40992a-0x0;var _0x4cf2a8=_0xa65a[_0x40992a];return _0x4cf2a8;};'use strict';var _=require(_0xaa65('0x0'));var util=require(_0xaa65('0x1'));var moment=require(_0xaa65('0x2'));var BPromise=require('bluebird');var rs=require(_0xaa65('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa65('0x4'))['db'];var utils=require(_0xaa65('0x5'));var logger=require(_0xaa65('0x6'))('rpc');var config=require(_0xaa65('0x7'));var jayson=require(_0xaa65('0x8'));var client=jayson[_0xaa65('0x9')][_0xaa65('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xda2f20,_0x31c329,_0x108854){return new BPromise(function(_0x44a010,_0x496eb2){return client[_0xaa65('0xb')](_0xda2f20,_0x108854)['then'](function(_0x5a6350){logger[_0xaa65('0xc')](_0xaa65('0xd'),_0x31c329,_0xaa65('0xe'));logger[_0xaa65('0xf')](_0xaa65('0x10'),_0x31c329,_0xaa65('0xe'),JSON[_0xaa65('0x11')](_0x5a6350));if(_0x5a6350[_0xaa65('0x12')]){if(_0x5a6350[_0xaa65('0x12')][_0xaa65('0x13')]===0x1f4){logger[_0xaa65('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x31c329,_0x5a6350[_0xaa65('0x12')][_0xaa65('0x14')]);return _0x496eb2(_0x5a6350[_0xaa65('0x12')][_0xaa65('0x14')]);}logger['error'](_0xaa65('0xd'),_0x31c329,_0x5a6350[_0xaa65('0x12')][_0xaa65('0x14')]);return _0x44a010(_0x5a6350[_0xaa65('0x12')][_0xaa65('0x14')]);}else{logger[_0xaa65('0xc')](_0xaa65('0xd'),_0x31c329,_0xaa65('0xe'));_0x44a010(_0x5a6350[_0xaa65('0x15')][_0xaa65('0x14')]);}})[_0xaa65('0x16')](function(_0x4ec9f3){logger[_0xaa65('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x31c329,_0x4ec9f3);_0x496eb2(_0x4ec9f3);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index e4ffd58..7741f56 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 _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x28e4cd,_0x11a5b5){var _0x5e209e=function(_0x343389){while(--_0x343389){_0x28e4cd['push'](_0x28e4cd['shift']());}};_0x5e209e(++_0x11a5b5);}(_0x008c,0x188));var _0xc008=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0x008c[_0x33ac75];return _0x34d5f2;};'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 auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3e74=['connect-timeout','express','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','multer','path'];(function(_0x30557f,_0x12cdc2){var _0x19d66f=function(_0x24258d){while(--_0x24258d){_0x30557f['push'](_0x30557f['shift']());}};_0x19d66f(++_0x12cdc2);}(_0x3e74,0x175));var _0x43e7=function(_0x53d05e,_0x5e8866){_0x53d05e=_0x53d05e-0x0;var _0x43e1ad=_0x3e74[_0x53d05e];return _0x43e1ad;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0xa')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0xb')]);router['put'](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0xd')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index ab60c8e..fe920c6 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 _0x6898=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x5d9a3d,_0x144780){var _0xdec164=function(_0x3cb222){while(--_0x3cb222){_0x5d9a3d['push'](_0x5d9a3d['shift']());}};_0xdec164(++_0x144780);}(_0x6898,0x11b));var _0x8689=function(_0x496585,_0x3eeebb){_0x496585=_0x496585-0x0;var _0x160904=_0x6898[_0x496585];return _0x160904;};'use strict';var Sequelize=require(_0x8689('0x0'));module['exports']={'type':{'type':Sequelize[_0x8689('0x1')](_0x8689('0x2'),_0x8689('0x3'),_0x8689('0x4'),_0x8689('0x5')),'defaultValue':_0x8689('0x2')},'content':{'type':Sequelize[_0x8689('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8689('0x1')](_0x8689('0x2'),_0x8689('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8689('0x6')]},'idField':{'type':Sequelize[_0x8689('0x6')]},'nameField':{'type':Sequelize[_0x8689('0x6')]},'customField':{'type':Sequelize[_0x8689('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8689('0x6')]}}; \ No newline at end of file +var _0x5395=['sequelize','ENUM','customVariable','keyValue','string','STRING','variable'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x5395,0x150));var _0x5539=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5395[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x5539('0x0'));module['exports']={'type':{'type':Sequelize[_0x5539('0x1')]('string','variable',_0x5539('0x2'),_0x5539('0x3')),'defaultValue':_0x5539('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5539('0x5')]},'keyType':{'type':Sequelize[_0x5539('0x1')](_0x5539('0x4'),_0x5539('0x6'),_0x5539('0x2'))},'keyContent':{'type':Sequelize[_0x5539('0x5')]},'idField':{'type':Sequelize[_0x5539('0x5')]},'nameField':{'type':Sequelize[_0x5539('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5539('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index fbfc513..e6a0f84 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 _0x2d8d=['rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','findAll','rows','catch','params','length','includeAll','include','find','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskField'];(function(_0x11798e,_0x452c0a){var _0x465d96=function(_0xc50e78){while(--_0xc50e78){_0x11798e['push'](_0x11798e['shift']());}};_0x465d96(++_0x452c0a);}(_0x2d8d,0x1d9));var _0xd2d8=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x2d8d[_0x28014d];return _0x2572cc;};'use strict';var pdf=require(_0xd2d8('0x0'));var emlformat=require(_0xd2d8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd2d8('0x2'));var jsonpatch=require(_0xd2d8('0x3'));var rp=require(_0xd2d8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd2d8('0x5'));var path=require('path');var sox=require(_0xd2d8('0x6'));var csv=require(_0xd2d8('0x7'));var ejs=require(_0xd2d8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd2d8('0x9'));var crypto=require(_0xd2d8('0xa'));var jsforce=require(_0xd2d8('0xb'));var deskjs=require(_0xd2d8('0xc'));var toCsv=require(_0xd2d8('0x7'));var querystring=require(_0xd2d8('0xd'));var Papa=require('papaparse');var Redis=require(_0xd2d8('0xe'));var authService=require(_0xd2d8('0xf'));var qs=require(_0xd2d8('0x10'));var as=require(_0xd2d8('0x11'));var hardwareService=require(_0xd2d8('0x12'));var logger=require(_0xd2d8('0x13'))(_0xd2d8('0x14'));var utils=require(_0xd2d8('0x15'));var config=require(_0xd2d8('0x16'));var db=require(_0xd2d8('0x17'))['db'];function respondWithStatusCode(_0x206b37,_0x1a86b6){_0x1a86b6=_0x1a86b6||0xcc;return function(_0x2c19aa){if(_0x2c19aa){return _0x206b37['sendStatus'](_0x1a86b6);}return _0x206b37[_0xd2d8('0x18')](_0x1a86b6)[_0xd2d8('0x19')]();};}function respondWithResult(_0x2f30ea,_0x312f78){_0x312f78=_0x312f78||0xc8;return function(_0x4f16d8){if(_0x4f16d8){return _0x2f30ea['status'](_0x312f78)[_0xd2d8('0x1a')](_0x4f16d8);}};}function respondWithFilteredResult(_0x132e13,_0x49aa44){return function(_0x1504d9){if(_0x1504d9){var _0x1de1ec=_0x1504d9[_0xd2d8('0x1b')],_0x5ead17=_0x49aa44[_0xd2d8('0x1c')],_0x49aebf=_0x49aa44['offset']+_0x49aa44[_0xd2d8('0x1d')],_0x16144b;if(_0x49aebf>=_0x1de1ec){_0x49aebf=_0x1de1ec;_0x16144b=0xc8;}else{_0x16144b=0xce;}_0x132e13['status'](_0x16144b);return _0x132e13[_0xd2d8('0x1e')]('Content-Range',_0x5ead17+'-'+_0x49aebf+'/'+_0x1de1ec)[_0xd2d8('0x1a')](_0x1504d9);}return null;};}function patchUpdates(_0x274c4a){return function(_0x28e4f0){try{jsonpatch[_0xd2d8('0x1f')](_0x28e4f0,_0x274c4a,!![]);}catch(_0x313804){return BPromise[_0xd2d8('0x20')](_0x313804);}return _0x28e4f0[_0xd2d8('0x21')]();};}function saveUpdates(_0x3e2d76,_0x1c02fe){return function(_0x4670f3){if(_0x4670f3){return _0x4670f3[_0xd2d8('0x22')](_0x3e2d76)[_0xd2d8('0x23')](function(_0x438d4e){return _0x438d4e;});}return null;};}function removeEntity(_0x5c6022,_0x36968d){return function(_0x3d8ec6){if(_0x3d8ec6){return _0x3d8ec6[_0xd2d8('0x24')]()[_0xd2d8('0x23')](function(){_0x5c6022[_0xd2d8('0x18')](0xcc)[_0xd2d8('0x19')]();});}};}function handleEntityNotFound(_0x5d441f,_0x2cb90c){return function(_0x27cc96){if(!_0x27cc96){_0x5d441f[_0xd2d8('0x25')](0x194);}return _0x27cc96;};}function handleError(_0x5d5c4c,_0x48f2ad){_0x48f2ad=_0x48f2ad||0x1f4;return function(_0x3075ef){logger[_0xd2d8('0x26')](_0x3075ef[_0xd2d8('0x27')]);if(_0x3075ef[_0xd2d8('0x28')]){delete _0x3075ef[_0xd2d8('0x28')];}_0x5d5c4c[_0xd2d8('0x18')](_0x48f2ad)[_0xd2d8('0x29')](_0x3075ef);};}exports[_0xd2d8('0x2a')]=function(_0x5ef49a,_0x4eee86){var _0x1803c6={},_0x43115a={},_0x4e12fd={'count':0x0,'rows':[]};var _0x4ba0cd=_[_0xd2d8('0x2b')](db[_0xd2d8('0x2c')][_0xd2d8('0x2d')],function(_0x5aa0ae){return{'name':_0x5aa0ae[_0xd2d8('0x2e')],'type':_0x5aa0ae['type'][_0xd2d8('0x2f')]};});_0x43115a[_0xd2d8('0x30')]=_[_0xd2d8('0x2b')](_0x4ba0cd,_0xd2d8('0x28'));_0x43115a[_0xd2d8('0x31')]=_[_0xd2d8('0x32')](_0x5ef49a[_0xd2d8('0x31')]);_0x43115a['filters']=_['intersection'](_0x43115a[_0xd2d8('0x30')],_0x43115a[_0xd2d8('0x31')]);_0x1803c6[_0xd2d8('0x33')]=_[_0xd2d8('0x34')](_0x43115a[_0xd2d8('0x30')],qs[_0xd2d8('0x35')](_0x5ef49a[_0xd2d8('0x31')]['fields']));_0x1803c6[_0xd2d8('0x33')]=_0x1803c6['attributes']['length']?_0x1803c6[_0xd2d8('0x33')]:_0x43115a['model'];if(!_0x5ef49a[_0xd2d8('0x31')][_0xd2d8('0x36')]('nolimit')){_0x1803c6[_0xd2d8('0x1d')]=qs['limit'](_0x5ef49a[_0xd2d8('0x31')][_0xd2d8('0x1d')]);_0x1803c6[_0xd2d8('0x1c')]=qs['offset'](_0x5ef49a['query'][_0xd2d8('0x1c')]);}_0x1803c6[_0xd2d8('0x37')]=qs[_0xd2d8('0x38')](_0x5ef49a[_0xd2d8('0x31')][_0xd2d8('0x38')]);_0x1803c6['where']=qs[_0xd2d8('0x39')](_[_0xd2d8('0x3a')](_0x5ef49a[_0xd2d8('0x31')],_0x43115a[_0xd2d8('0x39')]));if(_0x5ef49a['query'][_0xd2d8('0x3b')]){_0x1803c6['where']=_[_0xd2d8('0x3c')](_0x1803c6[_0xd2d8('0x3d')],{'$or':_['map'](_0x4ba0cd,function(_0x52ed1b){if(_0x52ed1b[_0xd2d8('0x3e')]!==_0xd2d8('0x3f')){var _0x99fb9={};_0x99fb9[_0x52ed1b[_0xd2d8('0x28')]]={'$like':'%'+_0x5ef49a['query'][_0xd2d8('0x3b')]+'%'};return _0x99fb9;}})});}_0x1803c6=_['merge']({},_0x1803c6,_0x5ef49a[_0xd2d8('0x40')]);var _0x37c9ff={'where':_0x1803c6[_0xd2d8('0x3d')]};return db[_0xd2d8('0x2c')]['count'](_0x37c9ff)[_0xd2d8('0x23')](function(_0x34a19a){_0x4e12fd[_0xd2d8('0x1b')]=_0x34a19a;if(_0x5ef49a[_0xd2d8('0x31')]['includeAll']){_0x1803c6['include']=[{'all':!![]}];}return db[_0xd2d8('0x2c')][_0xd2d8('0x41')](_0x1803c6);})[_0xd2d8('0x23')](function(_0x7bc163){_0x4e12fd[_0xd2d8('0x42')]=_0x7bc163;return _0x4e12fd;})['then'](respondWithFilteredResult(_0x4eee86,_0x1803c6))[_0xd2d8('0x43')](handleError(_0x4eee86,null));};exports['show']=function(_0xc941de,_0x18249a){var _0x123e8c={'raw':!![],'where':{'id':_0xc941de[_0xd2d8('0x44')]['id']}},_0xa7002b={};_0xa7002b['model']=_[_0xd2d8('0x32')](db[_0xd2d8('0x2c')][_0xd2d8('0x2d')]);_0xa7002b[_0xd2d8('0x31')]=_[_0xd2d8('0x32')](_0xc941de[_0xd2d8('0x31')]);_0xa7002b[_0xd2d8('0x39')]=_[_0xd2d8('0x34')](_0xa7002b['model'],_0xa7002b[_0xd2d8('0x31')]);_0x123e8c[_0xd2d8('0x33')]=_[_0xd2d8('0x34')](_0xa7002b[_0xd2d8('0x30')],qs[_0xd2d8('0x35')](_0xc941de[_0xd2d8('0x31')][_0xd2d8('0x35')]));_0x123e8c[_0xd2d8('0x33')]=_0x123e8c[_0xd2d8('0x33')][_0xd2d8('0x45')]?_0x123e8c[_0xd2d8('0x33')]:_0xa7002b[_0xd2d8('0x30')];if(_0xc941de[_0xd2d8('0x31')][_0xd2d8('0x46')]){_0x123e8c[_0xd2d8('0x47')]=[{'all':!![]}];}_0x123e8c=_[_0xd2d8('0x3c')]({},_0x123e8c,_0xc941de[_0xd2d8('0x40')]);return db[_0xd2d8('0x2c')][_0xd2d8('0x48')](_0x123e8c)['then'](handleEntityNotFound(_0x18249a,null))[_0xd2d8('0x23')](respondWithResult(_0x18249a,null))['catch'](handleError(_0x18249a,null));};exports['create']=function(_0x6d59fb,_0x3b41d5){return db[_0xd2d8('0x2c')]['create'](_0x6d59fb['body'],{})[_0xd2d8('0x23')](respondWithResult(_0x3b41d5,0xc9))[_0xd2d8('0x43')](handleError(_0x3b41d5,null));};exports[_0xd2d8('0x22')]=function(_0x33ff27,_0x415fd2){if(_0x33ff27[_0xd2d8('0x49')]['id']){delete _0x33ff27[_0xd2d8('0x49')]['id'];}return db['FreshdeskField'][_0xd2d8('0x48')]({'where':{'id':_0x33ff27['params']['id']}})[_0xd2d8('0x23')](handleEntityNotFound(_0x415fd2,null))['then'](saveUpdates(_0x33ff27[_0xd2d8('0x49')],null))[_0xd2d8('0x23')](respondWithResult(_0x415fd2,null))['catch'](handleError(_0x415fd2,null));};exports[_0xd2d8('0x24')]=function(_0x53fe84,_0x2cdd04){return db[_0xd2d8('0x2c')][_0xd2d8('0x48')]({'where':{'id':_0x53fe84[_0xd2d8('0x44')]['id']}})[_0xd2d8('0x23')](handleEntityNotFound(_0x2cdd04,null))[_0xd2d8('0x23')](removeEntity(_0x2cdd04,null))['catch'](handleError(_0x2cdd04,null));}; \ No newline at end of file +var _0x4c16=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','request-promise','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','index','FreshdeskField','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c16,0x9c));var _0x64c1=function(_0x6287b6,_0x5682e7){_0x6287b6=_0x6287b6-0x0;var _0x5d6be4=_0x4c16[_0x6287b6];return _0x5d6be4;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x64c1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x64c1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x64c1('0x2'));var util=require(_0x64c1('0x3'));var path=require(_0x64c1('0x4'));var sox=require('sox');var csv=require(_0x64c1('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x64c1('0x6'));var squel=require(_0x64c1('0x7'));var crypto=require(_0x64c1('0x8'));var jsforce=require(_0x64c1('0x9'));var deskjs=require(_0x64c1('0xa'));var toCsv=require(_0x64c1('0x5'));var querystring=require('querystring');var Papa=require(_0x64c1('0xb'));var Redis=require(_0x64c1('0xc'));var authService=require(_0x64c1('0xd'));var qs=require(_0x64c1('0xe'));var as=require(_0x64c1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64c1('0x10'))('api');var utils=require(_0x64c1('0x11'));var config=require(_0x64c1('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc0a62f,_0x4b4a00){_0x4b4a00=_0x4b4a00||0xcc;return function(_0x12f9af){if(_0x12f9af){return _0xc0a62f['sendStatus'](_0x4b4a00);}return _0xc0a62f[_0x64c1('0x13')](_0x4b4a00)[_0x64c1('0x14')]();};}function respondWithResult(_0xaa8fe2,_0x29f7ad){_0x29f7ad=_0x29f7ad||0xc8;return function(_0x289bbc){if(_0x289bbc){return _0xaa8fe2[_0x64c1('0x13')](_0x29f7ad)[_0x64c1('0x15')](_0x289bbc);}};}function respondWithFilteredResult(_0x42d063,_0x36c273){return function(_0x5df79b){if(_0x5df79b){var _0x54622a=_0x5df79b[_0x64c1('0x16')],_0x172175=_0x36c273[_0x64c1('0x17')],_0x1f4ce6=_0x36c273[_0x64c1('0x17')]+_0x36c273[_0x64c1('0x18')],_0x3dc115;if(_0x1f4ce6>=_0x54622a){_0x1f4ce6=_0x54622a;_0x3dc115=0xc8;}else{_0x3dc115=0xce;}_0x42d063['status'](_0x3dc115);return _0x42d063[_0x64c1('0x19')](_0x64c1('0x1a'),_0x172175+'-'+_0x1f4ce6+'/'+_0x54622a)['json'](_0x5df79b);}return null;};}function patchUpdates(_0x21c270){return function(_0x3aac08){try{jsonpatch[_0x64c1('0x1b')](_0x3aac08,_0x21c270,!![]);}catch(_0xd24d6d){return BPromise[_0x64c1('0x1c')](_0xd24d6d);}return _0x3aac08['save']();};}function saveUpdates(_0x14ae7,_0x4b6faa){return function(_0x577b54){if(_0x577b54){return _0x577b54[_0x64c1('0x1d')](_0x14ae7)[_0x64c1('0x1e')](function(_0xfbb000){return _0xfbb000;});}return null;};}function removeEntity(_0x414a38,_0x318818){return function(_0x426d2b){if(_0x426d2b){return _0x426d2b[_0x64c1('0x1f')]()[_0x64c1('0x1e')](function(){_0x414a38[_0x64c1('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49a6f7,_0x40cd30){return function(_0x16ae78){if(!_0x16ae78){_0x49a6f7[_0x64c1('0x20')](0x194);}return _0x16ae78;};}function handleError(_0x3fa49c,_0x20344b){_0x20344b=_0x20344b||0x1f4;return function(_0x4d71a4){logger[_0x64c1('0x21')](_0x4d71a4[_0x64c1('0x22')]);if(_0x4d71a4[_0x64c1('0x23')]){delete _0x4d71a4['name'];}_0x3fa49c[_0x64c1('0x13')](_0x20344b)['send'](_0x4d71a4);};}exports[_0x64c1('0x24')]=function(_0x3e3724,_0x5cb568){var _0xce7eb7={},_0x217dff={},_0x555803={'count':0x0,'rows':[]};var _0x21a375=_['map'](db[_0x64c1('0x25')]['rawAttributes'],function(_0x1ecb68){return{'name':_0x1ecb68[_0x64c1('0x26')],'type':_0x1ecb68['type'][_0x64c1('0x27')]};});_0x217dff[_0x64c1('0x28')]=_['map'](_0x21a375,'name');_0x217dff[_0x64c1('0x29')]=_[_0x64c1('0x2a')](_0x3e3724['query']);_0x217dff[_0x64c1('0x2b')]=_['intersection'](_0x217dff['model'],_0x217dff['query']);_0xce7eb7['attributes']=_[_0x64c1('0x2c')](_0x217dff[_0x64c1('0x28')],qs[_0x64c1('0x2d')](_0x3e3724['query'][_0x64c1('0x2d')]));_0xce7eb7[_0x64c1('0x2e')]=_0xce7eb7[_0x64c1('0x2e')][_0x64c1('0x2f')]?_0xce7eb7[_0x64c1('0x2e')]:_0x217dff[_0x64c1('0x28')];if(!_0x3e3724[_0x64c1('0x29')][_0x64c1('0x30')](_0x64c1('0x31'))){_0xce7eb7['limit']=qs['limit'](_0x3e3724[_0x64c1('0x29')][_0x64c1('0x18')]);_0xce7eb7['offset']=qs[_0x64c1('0x17')](_0x3e3724[_0x64c1('0x29')][_0x64c1('0x17')]);}_0xce7eb7['order']=qs[_0x64c1('0x32')](_0x3e3724[_0x64c1('0x29')]['sort']);_0xce7eb7[_0x64c1('0x33')]=qs[_0x64c1('0x2b')](_[_0x64c1('0x34')](_0x3e3724['query'],_0x217dff[_0x64c1('0x2b')]));if(_0x3e3724[_0x64c1('0x29')][_0x64c1('0x35')]){_0xce7eb7[_0x64c1('0x33')]=_[_0x64c1('0x36')](_0xce7eb7['where'],{'$or':_['map'](_0x21a375,function(_0x194d67){if(_0x194d67[_0x64c1('0x37')]!==_0x64c1('0x38')){var _0xfde3b={};_0xfde3b[_0x194d67[_0x64c1('0x23')]]={'$like':'%'+_0x3e3724[_0x64c1('0x29')][_0x64c1('0x35')]+'%'};return _0xfde3b;}})});}_0xce7eb7=_[_0x64c1('0x36')]({},_0xce7eb7,_0x3e3724[_0x64c1('0x39')]);var _0x3ca2e1={'where':_0xce7eb7[_0x64c1('0x33')]};return db['FreshdeskField']['count'](_0x3ca2e1)['then'](function(_0x1aab3b){_0x555803['count']=_0x1aab3b;if(_0x3e3724[_0x64c1('0x29')][_0x64c1('0x3a')]){_0xce7eb7[_0x64c1('0x3b')]=[{'all':!![]}];}return db[_0x64c1('0x25')][_0x64c1('0x3c')](_0xce7eb7);})[_0x64c1('0x1e')](function(_0x3f38b4){_0x555803[_0x64c1('0x3d')]=_0x3f38b4;return _0x555803;})[_0x64c1('0x1e')](respondWithFilteredResult(_0x5cb568,_0xce7eb7))[_0x64c1('0x3e')](handleError(_0x5cb568,null));};exports[_0x64c1('0x3f')]=function(_0x32d578,_0x22b779){var _0x15f57b={'raw':!![],'where':{'id':_0x32d578[_0x64c1('0x40')]['id']}},_0x4456b8={};_0x4456b8[_0x64c1('0x28')]=_[_0x64c1('0x2a')](db[_0x64c1('0x25')]['rawAttributes']);_0x4456b8[_0x64c1('0x29')]=_[_0x64c1('0x2a')](_0x32d578['query']);_0x4456b8[_0x64c1('0x2b')]=_[_0x64c1('0x2c')](_0x4456b8[_0x64c1('0x28')],_0x4456b8['query']);_0x15f57b[_0x64c1('0x2e')]=_[_0x64c1('0x2c')](_0x4456b8[_0x64c1('0x28')],qs[_0x64c1('0x2d')](_0x32d578['query'][_0x64c1('0x2d')]));_0x15f57b['attributes']=_0x15f57b[_0x64c1('0x2e')][_0x64c1('0x2f')]?_0x15f57b['attributes']:_0x4456b8[_0x64c1('0x28')];if(_0x32d578['query']['includeAll']){_0x15f57b[_0x64c1('0x3b')]=[{'all':!![]}];}_0x15f57b=_[_0x64c1('0x36')]({},_0x15f57b,_0x32d578[_0x64c1('0x39')]);return db['FreshdeskField'][_0x64c1('0x41')](_0x15f57b)[_0x64c1('0x1e')](handleEntityNotFound(_0x22b779,null))[_0x64c1('0x1e')](respondWithResult(_0x22b779,null))[_0x64c1('0x3e')](handleError(_0x22b779,null));};exports[_0x64c1('0x42')]=function(_0x37814a,_0x567025){return db[_0x64c1('0x25')]['create'](_0x37814a['body'],{})[_0x64c1('0x1e')](respondWithResult(_0x567025,0xc9))[_0x64c1('0x3e')](handleError(_0x567025,null));};exports[_0x64c1('0x1d')]=function(_0xb2b949,_0x4e2eac){if(_0xb2b949[_0x64c1('0x43')]['id']){delete _0xb2b949[_0x64c1('0x43')]['id'];}return db[_0x64c1('0x25')][_0x64c1('0x41')]({'where':{'id':_0xb2b949['params']['id']}})[_0x64c1('0x1e')](handleEntityNotFound(_0x4e2eac,null))[_0x64c1('0x1e')](saveUpdates(_0xb2b949[_0x64c1('0x43')],null))[_0x64c1('0x1e')](respondWithResult(_0x4e2eac,null))[_0x64c1('0x3e')](handleError(_0x4e2eac,null));};exports[_0x64c1('0x1f')]=function(_0x238044,_0x4b4baa){return db[_0x64c1('0x25')][_0x64c1('0x41')]({'where':{'id':_0x238044[_0x64c1('0x40')]['id']}})[_0x64c1('0x1e')](handleEntityNotFound(_0x4b4baa,null))[_0x64c1('0x1e')](removeEntity(_0x4b4baa,null))[_0x64c1('0x3e')](handleError(_0x4b4baa,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 8e084ac..66eb937 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 _0x7c9e=['moment','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','../../config/logger'];(function(_0x65db39,_0x485fe4){var _0x5bbf0d=function(_0x311ba0){while(--_0x311ba0){_0x65db39['push'](_0x65db39['shift']());}};_0x5bbf0d(++_0x485fe4);}(_0x7c9e,0x11c));var _0xe7c9=function(_0x2174cc,_0x41258e){_0x2174cc=_0x2174cc-0x0;var _0x5ed2ba=_0x7c9e[_0x2174cc];return _0x5ed2ba;};'use strict';var _=require(_0xe7c9('0x0'));var util=require('util');var logger=require(_0xe7c9('0x1'))('api');var moment=require(_0xe7c9('0x2'));var BPromise=require('bluebird');var rp=require(_0xe7c9('0x3'));var fs=require('fs');var path=require(_0xe7c9('0x4'));var rimraf=require(_0xe7c9('0x5'));var config=require(_0xe7c9('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0xe7c9('0x7')]=function(_0x6d38,_0x3bc2c9){return _0x6d38[_0xe7c9('0x8')](_0xe7c9('0x9'),attributes,{'tableName':_0xe7c9('0xa'),'paranoid':![],'indexes':[{'name':_0xe7c9('0xb'),'fields':[_0xe7c9('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c7c=['int_freshdesk_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField'];(function(_0x961453,_0x2e89f2){var _0x5e44d9=function(_0x59e6d0){while(--_0x59e6d0){_0x961453['push'](_0x961453['shift']());}};_0x5e44d9(++_0x2e89f2);}(_0x7c7c,0xda));var _0xc7c7=function(_0x379e34,_0x199e44){_0x379e34=_0x379e34-0x0;var _0x36a674=_0x7c7c[_0x379e34];return _0x36a674;};'use strict';var _=require(_0xc7c7('0x0'));var util=require(_0xc7c7('0x1'));var logger=require(_0xc7c7('0x2'))('api');var moment=require(_0xc7c7('0x3'));var BPromise=require(_0xc7c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7c7('0x5'));var rimraf=require('rimraf');var config=require(_0xc7c7('0x6'));var attributes=require(_0xc7c7('0x7'));module['exports']=function(_0x27d34e,_0x42ef57){return _0x27d34e[_0xc7c7('0x8')](_0xc7c7('0x9'),attributes,{'tableName':_0xc7c7('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0xc7c7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 2410fee..0289a17 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x274b4f,_0x52cc11){var _0x2f056c=function(_0x4ca687){while(--_0x4ca687){_0x274b4f['push'](_0x274b4f['shift']());}};_0x2f056c(++_0x52cc11);}(_0xb10b,0x12a));var _0xbb10=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xb10b[_0x3dfeb9];return _0x412314;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3161d3,_0xcc37a){var _0x1aa4b3=function(_0x59a789){while(--_0x59a789){_0x3161d3['push'](_0x3161d3['shift']());}};_0x1aa4b3(++_0xcc37a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d0098,_0x22ee82){_0x3d0098=_0x3d0098-0x0;var _0x3ef587=_0xb10b[_0x3d0098];return _0x3ef587;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 1ad97ce..adc3989 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 _0x6849=['put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration'];(function(_0x2ddf2d,_0x272b8a){var _0x53dd02=function(_0x5a889c){while(--_0x5a889c){_0x2ddf2d['push'](_0x2ddf2d['shift']());}};_0x53dd02(++_0x272b8a);}(_0x6849,0xf4));var _0x9684=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6849[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x9684('0x0'));var util=require(_0x9684('0x1'));var path=require(_0x9684('0x2'));var timeout=require(_0x9684('0x3'));var express=require(_0x9684('0x4'));var router=express['Router']();var auth=require(_0x9684('0x5'));var interaction=require(_0x9684('0x6'));var config=require(_0x9684('0x7'));var controller=require(_0x9684('0x8'));router['get']('/',auth[_0x9684('0x9')](),controller[_0x9684('0xa')]);router[_0x9684('0xb')](_0x9684('0xc'),auth[_0x9684('0x9')](),controller[_0x9684('0xd')]);router[_0x9684('0xb')](_0x9684('0xe'),auth['isAuthenticated'](),controller[_0x9684('0xf')]);router[_0x9684('0xb')]('/:id/fields',auth[_0x9684('0x9')](),controller[_0x9684('0x10')]);router[_0x9684('0x11')]('/',auth[_0x9684('0x9')](),controller[_0x9684('0x12')]);router[_0x9684('0x11')](_0x9684('0xe'),auth[_0x9684('0x9')](),controller[_0x9684('0x13')]);router[_0x9684('0x14')](_0x9684('0xc'),auth['isAuthenticated'](),controller[_0x9684('0x15')]);router['delete'](_0x9684('0xc'),auth[_0x9684('0x9')](),controller[_0x9684('0x16')]);module[_0x9684('0x17')]=router; \ No newline at end of file +var _0x59ad=['create','post','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields'];(function(_0x41d00a,_0x1eb8df){var _0x72b5d1=function(_0xe3820f){while(--_0xe3820f){_0x41d00a['push'](_0x41d00a['shift']());}};_0x72b5d1(++_0x1eb8df);}(_0x59ad,0x1b8));var _0xd59a=function(_0x2a8208,_0x3dd770){_0x2a8208=_0x2a8208-0x0;var _0x216f32=_0x59ad[_0x2a8208];return _0x216f32;};'use strict';var multer=require(_0xd59a('0x0'));var util=require(_0xd59a('0x1'));var path=require(_0xd59a('0x2'));var timeout=require(_0xd59a('0x3'));var express=require(_0xd59a('0x4'));var router=express['Router']();var auth=require(_0xd59a('0x5'));var interaction=require(_0xd59a('0x6'));var config=require(_0xd59a('0x7'));var controller=require(_0xd59a('0x8'));router[_0xd59a('0x9')]('/',auth[_0xd59a('0xa')](),controller[_0xd59a('0xb')]);router[_0xd59a('0x9')](_0xd59a('0xc'),auth[_0xd59a('0xa')](),controller['show']);router[_0xd59a('0x9')](_0xd59a('0xd'),auth[_0xd59a('0xa')](),controller[_0xd59a('0xe')]);router['get']('/:id/fields',auth[_0xd59a('0xa')](),controller[_0xd59a('0xf')]);router['post']('/',auth[_0xd59a('0xa')](),controller[_0xd59a('0x10')]);router[_0xd59a('0x11')](_0xd59a('0xd'),auth[_0xd59a('0xa')](),controller[_0xd59a('0x12')]);router[_0xd59a('0x13')](_0xd59a('0xc'),auth[_0xd59a('0xa')](),controller[_0xd59a('0x14')]);router[_0xd59a('0x15')]('/:id',auth[_0xd59a('0xa')](),controller[_0xd59a('0x16')]);module[_0xd59a('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index a92d231..56a4048 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 _0xad9f=['STRING','username','sequelize','exports'];(function(_0x5e2e8a,_0x5058cf){var _0x19008a=function(_0x55ae49){while(--_0x55ae49){_0x5e2e8a['push'](_0x5e2e8a['shift']());}};_0x19008a(++_0x5058cf);}(_0xad9f,0x1be));var _0xfad9=function(_0x34183d,_0x5803aa){_0x34183d=_0x34183d-0x0;var _0x142ddf=_0xad9f[_0x34183d];return _0x142ddf;};'use strict';var Sequelize=require(_0xfad9('0x0'));module[_0xfad9('0x1')]={'name':{'type':Sequelize[_0xfad9('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfad9('0x2')],'unique':_0xfad9('0x3')},'apiKey':{'type':Sequelize[_0xfad9('0x2')]},'remoteUri':{'type':Sequelize[_0xfad9('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xfad9('0x2')]}}; \ No newline at end of file +var _0x659c=['sequelize','STRING'];(function(_0x2687fc,_0x160edd){var _0x55c6fe=function(_0x2531b4){while(--_0x2531b4){_0x2687fc['push'](_0x2687fc['shift']());}};_0x55c6fe(++_0x160edd);}(_0x659c,0x1aa));var _0xc659=function(_0x5bf019,_0x375a83){_0x5bf019=_0x5bf019-0x0;var _0x42497e=_0x659c[_0x5bf019];return _0x42497e;};'use strict';var Sequelize=require(_0xc659('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc659('0x1')]},'username':{'type':Sequelize[_0xc659('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xc659('0x1')]},'remoteUri':{'type':Sequelize[_0xc659('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f6a6280..acdbc79 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 _0xc869=['show','options','create','body','find','params','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','update','destroy','end','stack','name','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x30ab8c,_0x4fe73a){var _0x59e58d=function(_0x4eac92){while(--_0x4eac92){_0x30ab8c['push'](_0x30ab8c['shift']());}};_0x59e58d(++_0x4fe73a);}(_0xc869,0x173));var _0x9c86=function(_0x3d638e,_0x4bd002){_0x3d638e=_0x3d638e-0x0;var _0x2d62f2=_0xc869[_0x3d638e];return _0x2d62f2;};'use strict';var pdf=require(_0x9c86('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c86('0x1'));var zipdir=require(_0x9c86('0x2'));var jsonpatch=require(_0x9c86('0x3'));var rp=require('request-promise');var moment=require(_0x9c86('0x4'));var BPromise=require(_0x9c86('0x5'));var Mustache=require(_0x9c86('0x6'));var util=require(_0x9c86('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c86('0x8'));var fs=require('fs');var _=require(_0x9c86('0x9'));var squel=require(_0x9c86('0xa'));var crypto=require('crypto');var jsforce=require(_0x9c86('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9c86('0xc'));var querystring=require(_0x9c86('0xd'));var Papa=require(_0x9c86('0xe'));var Redis=require(_0x9c86('0xf'));var authService=require(_0x9c86('0x10'));var qs=require(_0x9c86('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c86('0x12'));var logger=require(_0x9c86('0x13'))(_0x9c86('0x14'));var utils=require(_0x9c86('0x15'));var config=require(_0x9c86('0x16'));var db=require(_0x9c86('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x9c86('0x18'));var client=jayson[_0x9c86('0x19')][_0x9c86('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xea880e,_0x1365d2,_0x2e806f){if(_0x2e806f){var _0x54dfa2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54dfa2[_0x9c86('0x1b')](_0x1365d2)){return _0xea880e;}else{throw new db[(_0x9c86('0x1c'))]['ValidationError'](_0x9c86('0x1d'));}}else{return _0xea880e;}}function respondWithRpcPromise(_0x536e80,_0x3e923a,_0x22a66c,_0x302599){return new BPromise(function(_0x307d0c,_0x2e2bb7){var _0x1d03dc=_0x302599||client;return _0x1d03dc[_0x9c86('0x1e')](_0x536e80,_0x22a66c)[_0x9c86('0x1f')](function(_0x550284){logger[_0x9c86('0x20')](_0x9c86('0x21'),_0x3e923a,_0x9c86('0x22'));logger['debug'](_0x9c86('0x23'),_0x3e923a,_0x9c86('0x22'),JSON[_0x9c86('0x24')](_0x550284));if(_0x550284[_0x9c86('0x25')]){if(_0x550284['error'][_0x9c86('0x26')]===0x1f4){logger[_0x9c86('0x25')](_0x9c86('0x21'),_0x3e923a,_0x550284[_0x9c86('0x25')][_0x9c86('0x27')]);return _0x2e2bb7(_0x550284['error']['message']);}logger[_0x9c86('0x25')](_0x9c86('0x21'),_0x3e923a,_0x550284[_0x9c86('0x25')][_0x9c86('0x27')]);return _0x307d0c(_0x550284[_0x9c86('0x25')][_0x9c86('0x27')]);}else{logger[_0x9c86('0x20')](_0x9c86('0x21'),_0x3e923a,_0x9c86('0x22'));_0x307d0c(_0x550284[_0x9c86('0x28')][_0x9c86('0x27')]);}})[_0x9c86('0x29')](function(_0x49f05d){logger[_0x9c86('0x25')](_0x9c86('0x21'),_0x3e923a,_0x49f05d);_0x2e2bb7(_0x49f05d);});});}function respondWithStatusCode(_0x4c62e8,_0x7a195e){_0x7a195e=_0x7a195e||0xcc;return function(_0x2c7a42){if(_0x2c7a42){return _0x4c62e8[_0x9c86('0x2a')](_0x7a195e);}return _0x4c62e8[_0x9c86('0x2b')](_0x7a195e)['end']();};}function respondWithResult(_0x4feb7c,_0x1d7cfe){_0x1d7cfe=_0x1d7cfe||0xc8;return function(_0x500632){if(_0x500632){return _0x4feb7c['status'](_0x1d7cfe)[_0x9c86('0x2c')](_0x500632);}};}function respondWithFilteredResult(_0x1d7604,_0x5886e2){return function(_0x24b638){if(_0x24b638){var _0xfec4c6=_0x24b638[_0x9c86('0x2d')],_0x575720=_0x5886e2[_0x9c86('0x2e')],_0x54332b=_0x5886e2[_0x9c86('0x2e')]+_0x5886e2[_0x9c86('0x2f')],_0x5697b7;if(_0x54332b>=_0xfec4c6){_0x54332b=_0xfec4c6;_0x5697b7=0xc8;}else{_0x5697b7=0xce;}_0x1d7604['status'](_0x5697b7);return _0x1d7604[_0x9c86('0x30')]('Content-Range',_0x575720+'-'+_0x54332b+'/'+_0xfec4c6)[_0x9c86('0x2c')](_0x24b638);}return null;};}function patchUpdates(_0x511275){return function(_0x2b9821){try{jsonpatch['apply'](_0x2b9821,_0x511275,!![]);}catch(_0x2974e7){return BPromise['reject'](_0x2974e7);}return _0x2b9821['save']();};}function saveUpdates(_0x5c4a49,_0x27ce00){return function(_0x28ec38){if(_0x28ec38){return _0x28ec38[_0x9c86('0x31')](_0x5c4a49)[_0x9c86('0x1f')](function(_0x15ab9d){return _0x15ab9d;});}return null;};}function removeEntity(_0x4e5962,_0x380c69){return function(_0x5dfefd){if(_0x5dfefd){return _0x5dfefd[_0x9c86('0x32')]()[_0x9c86('0x1f')](function(){_0x4e5962['status'](0xcc)[_0x9c86('0x33')]();});}};}function handleEntityNotFound(_0x442e30,_0x3b4b4c){return function(_0x159d6e){if(!_0x159d6e){_0x442e30['sendStatus'](0x194);}return _0x159d6e;};}function handleError(_0x5ee7fc,_0x2306d6){_0x2306d6=_0x2306d6||0x1f4;return function(_0x51a1fb){logger[_0x9c86('0x25')](_0x51a1fb[_0x9c86('0x34')]);if(_0x51a1fb[_0x9c86('0x35')]){delete _0x51a1fb['name'];}_0x5ee7fc[_0x9c86('0x2b')](_0x2306d6)['send'](_0x51a1fb);};}exports['index']=function(_0x5def43,_0x539ef5){var _0x475f94={},_0x2673f8={},_0x89f8f7={'count':0x0,'rows':[]};var _0x4545d2=_[_0x9c86('0x36')](db[_0x9c86('0x37')][_0x9c86('0x38')],function(_0x52b27c){return{'name':_0x52b27c[_0x9c86('0x39')],'type':_0x52b27c['type'][_0x9c86('0x3a')]};});_0x2673f8[_0x9c86('0x3b')]=_[_0x9c86('0x36')](_0x4545d2,_0x9c86('0x35'));_0x2673f8[_0x9c86('0x3c')]=_[_0x9c86('0x3d')](_0x5def43[_0x9c86('0x3c')]);_0x2673f8[_0x9c86('0x3e')]=_[_0x9c86('0x3f')](_0x2673f8['model'],_0x2673f8[_0x9c86('0x3c')]);_0x475f94[_0x9c86('0x40')]=_[_0x9c86('0x3f')](_0x2673f8[_0x9c86('0x3b')],qs[_0x9c86('0x41')](_0x5def43['query']['fields']));_0x475f94[_0x9c86('0x40')]=_0x475f94[_0x9c86('0x40')][_0x9c86('0x42')]?_0x475f94[_0x9c86('0x40')]:_0x2673f8[_0x9c86('0x3b')];if(!_0x5def43[_0x9c86('0x3c')][_0x9c86('0x43')](_0x9c86('0x44'))){_0x475f94[_0x9c86('0x2f')]=qs['limit'](_0x5def43[_0x9c86('0x3c')][_0x9c86('0x2f')]);_0x475f94['offset']=qs[_0x9c86('0x2e')](_0x5def43['query']['offset']);}_0x475f94[_0x9c86('0x45')]=qs[_0x9c86('0x46')](_0x5def43[_0x9c86('0x3c')][_0x9c86('0x46')]);_0x475f94[_0x9c86('0x47')]=qs[_0x9c86('0x3e')](_[_0x9c86('0x48')](_0x5def43[_0x9c86('0x3c')],_0x2673f8['filters']));if(_0x5def43[_0x9c86('0x3c')][_0x9c86('0x49')]){_0x475f94[_0x9c86('0x47')]=_[_0x9c86('0x4a')](_0x475f94['where'],{'$or':_[_0x9c86('0x36')](_0x4545d2,function(_0x20319a){if(_0x20319a[_0x9c86('0x4b')]!==_0x9c86('0x4c')){var _0x219941={};_0x219941[_0x20319a[_0x9c86('0x35')]]={'$like':'%'+_0x5def43['query'][_0x9c86('0x49')]+'%'};return _0x219941;}})});}_0x475f94=_[_0x9c86('0x4a')]({},_0x475f94,_0x5def43['options']);var _0x28fed8={'where':_0x475f94[_0x9c86('0x47')]};return db['FreshsalesAccount'][_0x9c86('0x2d')](_0x28fed8)[_0x9c86('0x1f')](function(_0x330de9){_0x89f8f7[_0x9c86('0x2d')]=_0x330de9;if(_0x5def43['query'][_0x9c86('0x4d')]){_0x475f94[_0x9c86('0x4e')]=[{'all':!![]}];}return db[_0x9c86('0x37')][_0x9c86('0x4f')](_0x475f94);})['then'](function(_0x2d6d27){_0x89f8f7[_0x9c86('0x50')]=_0x2d6d27;return _0x89f8f7;})[_0x9c86('0x1f')](respondWithFilteredResult(_0x539ef5,_0x475f94))['catch'](handleError(_0x539ef5,null));};exports[_0x9c86('0x51')]=function(_0x46bf6d,_0x590642){var _0x3c529d={'raw':![],'where':{'id':_0x46bf6d['params']['id']}},_0x1feb50={};_0x1feb50[_0x9c86('0x3b')]=_[_0x9c86('0x3d')](db[_0x9c86('0x37')]['rawAttributes']);_0x1feb50[_0x9c86('0x3c')]=_[_0x9c86('0x3d')](_0x46bf6d[_0x9c86('0x3c')]);_0x1feb50[_0x9c86('0x3e')]=_[_0x9c86('0x3f')](_0x1feb50[_0x9c86('0x3b')],_0x1feb50[_0x9c86('0x3c')]);_0x3c529d[_0x9c86('0x40')]=_[_0x9c86('0x3f')](_0x1feb50[_0x9c86('0x3b')],qs[_0x9c86('0x41')](_0x46bf6d[_0x9c86('0x3c')]['fields']));_0x3c529d[_0x9c86('0x40')]=_0x3c529d[_0x9c86('0x40')][_0x9c86('0x42')]?_0x3c529d[_0x9c86('0x40')]:_0x1feb50[_0x9c86('0x3b')];if(_0x46bf6d[_0x9c86('0x3c')][_0x9c86('0x4d')]){_0x3c529d[_0x9c86('0x4e')]=[{'all':!![]}];}_0x3c529d=_[_0x9c86('0x4a')]({},_0x3c529d,_0x46bf6d[_0x9c86('0x52')]);return db[_0x9c86('0x37')]['find'](_0x3c529d)['then'](handleEntityNotFound(_0x590642,null))[_0x9c86('0x1f')](respondWithResult(_0x590642,null))[_0x9c86('0x29')](handleError(_0x590642,null));};exports[_0x9c86('0x53')]=function(_0x27eecb,_0x2bb38c){return db[_0x9c86('0x37')][_0x9c86('0x53')](_0x27eecb[_0x9c86('0x54')],{})[_0x9c86('0x1f')](respondWithResult(_0x2bb38c,0xc9))[_0x9c86('0x29')](handleError(_0x2bb38c,null));};exports['update']=function(_0x4c2b4e,_0x101708){if(_0x4c2b4e[_0x9c86('0x54')]['id']){delete _0x4c2b4e[_0x9c86('0x54')]['id'];}return db[_0x9c86('0x37')][_0x9c86('0x55')]({'where':{'id':_0x4c2b4e[_0x9c86('0x56')]['id']}})[_0x9c86('0x1f')](handleEntityNotFound(_0x101708,null))['then'](saveUpdates(_0x4c2b4e['body'],null))[_0x9c86('0x1f')](respondWithResult(_0x101708,null))[_0x9c86('0x29')](handleError(_0x101708,null));};exports[_0x9c86('0x32')]=function(_0x42e168,_0x5f0636){return db[_0x9c86('0x37')][_0x9c86('0x55')]({'where':{'id':_0x42e168[_0x9c86('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f0636,null))[_0x9c86('0x1f')](removeEntity(_0x5f0636,null))['catch'](handleError(_0x5f0636,null));};exports[_0x9c86('0x57')]=function(_0x107b1f,_0x5ccfb5,_0x149bf7){var _0x333f5f={};var _0x64740d={};var _0x42e3b5;var _0x55d8f2;return db[_0x9c86('0x37')]['findOne']({'where':{'id':_0x107b1f[_0x9c86('0x56')]['id']}})[_0x9c86('0x1f')](handleEntityNotFound(_0x5ccfb5,null))[_0x9c86('0x1f')](function(_0x4d7428){if(_0x4d7428){_0x42e3b5=_0x4d7428;_0x64740d['model']=_[_0x9c86('0x3d')](db[_0x9c86('0x58')]['rawAttributes']);_0x64740d['query']=_[_0x9c86('0x3d')](_0x107b1f[_0x9c86('0x3c')]);_0x64740d[_0x9c86('0x3e')]=_[_0x9c86('0x3f')](_0x64740d[_0x9c86('0x3b')],_0x64740d['query']);_0x333f5f[_0x9c86('0x40')]=_[_0x9c86('0x3f')](_0x64740d['model'],qs[_0x9c86('0x41')](_0x107b1f[_0x9c86('0x3c')]['fields']));_0x333f5f[_0x9c86('0x40')]=_0x333f5f[_0x9c86('0x40')][_0x9c86('0x42')]?_0x333f5f[_0x9c86('0x40')]:_0x64740d['model'];_0x333f5f[_0x9c86('0x45')]=qs[_0x9c86('0x46')](_0x107b1f[_0x9c86('0x3c')][_0x9c86('0x46')]);_0x333f5f[_0x9c86('0x47')]=qs[_0x9c86('0x3e')](_[_0x9c86('0x48')](_0x107b1f['query'],_0x64740d[_0x9c86('0x3e')]));if(_0x107b1f['query']['filter']){_0x333f5f[_0x9c86('0x47')]=_[_0x9c86('0x4a')](_0x333f5f['where'],{'$or':_[_0x9c86('0x36')](_0x333f5f[_0x9c86('0x40')],function(_0x2cc272){var _0xc54666={};_0xc54666[_0x2cc272]={'$like':'%'+_0x107b1f[_0x9c86('0x3c')][_0x9c86('0x49')]+'%'};return _0xc54666;})});}_0x333f5f=_['merge']({},_0x333f5f,_0x107b1f[_0x9c86('0x52')]);return _0x42e3b5[_0x9c86('0x57')](_0x333f5f);}})['then'](function(_0x4ae062){if(_0x4ae062){_0x55d8f2=_0x4ae062[_0x9c86('0x42')];if(!_0x107b1f['query'][_0x9c86('0x43')](_0x9c86('0x44'))){_0x333f5f[_0x9c86('0x2f')]=qs[_0x9c86('0x2f')](_0x107b1f[_0x9c86('0x3c')]['limit']);_0x333f5f['offset']=qs[_0x9c86('0x2e')](_0x107b1f[_0x9c86('0x3c')][_0x9c86('0x2e')]);}return _0x42e3b5[_0x9c86('0x57')](_0x333f5f);}})[_0x9c86('0x1f')](function(_0xa747bd){if(_0xa747bd){return _0xa747bd?{'count':_0x55d8f2,'rows':_0xa747bd}:null;}})['then'](respondWithResult(_0x5ccfb5,null))['catch'](handleError(_0x5ccfb5,null));};exports[_0x9c86('0x59')]=function(_0x4287bf,_0x5bd655,_0xf0b09b){if(_0x4287bf[_0x9c86('0x54')]['id']){delete _0x4287bf['body']['id'];}return db['FreshsalesAccount'][_0x9c86('0x5a')]({'where':{'id':_0x4287bf['params']['id']}})['then'](handleEntityNotFound(_0x5bd655,null))[_0x9c86('0x1f')](function(_0x527d20){if(_0x527d20){_0x4287bf[_0x9c86('0x54')]['AccountId']=_0x527d20['id'];_0x4287bf[_0x9c86('0x54')][_0x9c86('0x5b')]=integrations[_0x9c86('0x5c')](_0x4287bf[_0x9c86('0x54')][_0x9c86('0x5d')],_0x4287bf[_0x9c86('0x54')]['type']);_0x4287bf['body'][_0x9c86('0x5e')]=integrations[_0x9c86('0x5f')](_0x4287bf['body'][_0x9c86('0x5d')],_0x4287bf[_0x9c86('0x54')][_0x9c86('0x4b')]);return db[_0x9c86('0x58')]['create'](_0x4287bf['body'],{'include':[{'model':db[_0x9c86('0x60')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x9c86('0x5e')}]});}return null;})[_0x9c86('0x1f')](respondWithResult(_0x5bd655,null))[_0x9c86('0x29')](handleError(_0x5bd655,null));};exports['getFields']=function(_0x11e819,_0x1a4900,_0x250514){var _0x303fd7='';var _0x2a4357='';return db[_0x9c86('0x37')][_0x9c86('0x5a')]({'where':{'id':_0x11e819[_0x9c86('0x56')]['id']},'attributes':['id',_0x9c86('0x61'),'remoteUri',_0x9c86('0x62')]})[_0x9c86('0x1f')](handleEntityNotFound(_0x1a4900,null))['then'](function(_0x3cb8a7){if(_0x3cb8a7){_0x2a4357=_0x3cb8a7[_0x9c86('0x61')];_0x303fd7=_0x3cb8a7[_0x9c86('0x63')];var _0x54a194=_0x3cb8a7['remoteUri'][_0x9c86('0x64')](-0x1);if(_0x54a194==='/'){_0x303fd7=_0x303fd7[_0x9c86('0x65')](0x0,_0x303fd7[_0x9c86('0x66')](_0x54a194));}return rp({'method':_0x9c86('0x67'),'uri':util['format'](_0x9c86('0x68'),_0x303fd7,_0x9c86('0x69')),'headers':{'Authorization':_0x9c86('0x6a')+_0x3cb8a7[_0x9c86('0x62')]},'json':!![]});}})[_0x9c86('0x1f')](function(_0x1c1170){if(_0x1c1170){var _0x1accde=_0x1c1170['users'];var _0x4a7cfc=![];var _0x4fa22f=null;for(_0x4fa22f=0x0;_0x4fa22f<_0x1accde[_0x9c86('0x42')];_0x4fa22f++){if(_0x1accde[_0x4fa22f][_0x9c86('0x6b')]===_0x2a4357){_0x4a7cfc=!![];}}if(_0x4a7cfc){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9c86('0x6c')});}}})['then'](respondWithResult(_0x1a4900,null))[_0x9c86('0x29')](function(_0x39f1b6){var _0x5753dd=_0x11e819[_0x9c86('0x3c')][_0x9c86('0x1b')]?0x1f4:_0x39f1b6[_0x9c86('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9c86('0x6e'),_0x5753dd,JSON[_0x9c86('0x24')](_0x39f1b6));delete _0x39f1b6['name'];if(_0x5753dd===0x191){_0x5753dd=0x190;}_0x1a4900[_0x9c86('0x2b')](_0x5753dd)[_0x9c86('0x6f')](_0x11e819[_0x9c86('0x3c')][_0x9c86('0x1b')]?{'message':_0x9c86('0x70'),'statusCode':_0x39f1b6[_0x9c86('0x6d')]}:_0x39f1b6);});}; \ No newline at end of file +var _0x2aa9=['pick','filter','merge','VIRTUAL','options','FreshsalesAccount','includeAll','include','findAll','rows','show','params','find','create','body','findOne','FreshsalesConfiguration','rawAttributes','hasOwnProperty','getConfigurations','addConfiguration','Subjects','channel','Descriptions','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','/api/selector/owners','Token\x20token=','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','type','model','query','keys','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters'];(function(_0x2205a2,_0x3eb5c0){var _0x33f708=function(_0x2a1cfa){while(--_0x2a1cfa){_0x2205a2['push'](_0x2205a2['shift']());}};_0x33f708(++_0x3eb5c0);}(_0x2aa9,0xfd));var _0x92aa=function(_0x1d767a,_0x408f1e){_0x1d767a=_0x1d767a-0x0;var _0x14b55d=_0x2aa9[_0x1d767a];return _0x14b55d;};'use strict';var pdf=require(_0x92aa('0x0'));var emlformat=require(_0x92aa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x92aa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x92aa('0x3'));var moment=require(_0x92aa('0x4'));var BPromise=require(_0x92aa('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x92aa('0x6'));var csv=require(_0x92aa('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x92aa('0x8'));var crypto=require(_0x92aa('0x9'));var jsforce=require(_0x92aa('0xa'));var deskjs=require(_0x92aa('0xb'));var toCsv=require('to-csv');var querystring=require(_0x92aa('0xc'));var Papa=require(_0x92aa('0xd'));var Redis=require(_0x92aa('0xe'));var authService=require(_0x92aa('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x92aa('0x10'))(_0x92aa('0x11'));var utils=require('../../config/utils');var config=require(_0x92aa('0x12'));var db=require(_0x92aa('0x13'))['db'];var integrations=require(_0x92aa('0x14'));var jayson=require('jayson/promise');var client=jayson['client'][_0x92aa('0x15')]({'port':0x232a});function checkPasswordPattern(_0x22b693,_0x5a2818,_0x5629f8){if(_0x5629f8){var _0x36fd6f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36fd6f[_0x92aa('0x16')](_0x5a2818)){return _0x22b693;}else{throw new db[(_0x92aa('0x17'))]['ValidationError'](_0x92aa('0x18'));}}else{return _0x22b693;}}function respondWithRpcPromise(_0x1eabbd,_0x2f62df,_0x2ca256,_0x3d9845){return new BPromise(function(_0x2ee944,_0xcff80d){var _0x5d6089=_0x3d9845||client;return _0x5d6089[_0x92aa('0x19')](_0x1eabbd,_0x2ca256)['then'](function(_0x19bc34){logger[_0x92aa('0x1a')](_0x92aa('0x1b'),_0x2f62df,'request\x20sent');logger[_0x92aa('0x1c')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x2f62df,'request\x20sent',JSON[_0x92aa('0x1d')](_0x19bc34));if(_0x19bc34[_0x92aa('0x1e')]){if(_0x19bc34[_0x92aa('0x1e')][_0x92aa('0x1f')]===0x1f4){logger['error'](_0x92aa('0x1b'),_0x2f62df,_0x19bc34[_0x92aa('0x1e')]['message']);return _0xcff80d(_0x19bc34[_0x92aa('0x1e')][_0x92aa('0x20')]);}logger[_0x92aa('0x1e')]('FreshsalesAccount,\x20%s,\x20%s',_0x2f62df,_0x19bc34['error'][_0x92aa('0x20')]);return _0x2ee944(_0x19bc34[_0x92aa('0x1e')][_0x92aa('0x20')]);}else{logger['info'](_0x92aa('0x1b'),_0x2f62df,'request\x20sent');_0x2ee944(_0x19bc34[_0x92aa('0x21')][_0x92aa('0x20')]);}})[_0x92aa('0x22')](function(_0x51f345){logger[_0x92aa('0x1e')]('FreshsalesAccount,\x20%s,\x20%s',_0x2f62df,_0x51f345);_0xcff80d(_0x51f345);});});}function respondWithStatusCode(_0x2fa36b,_0x348d5b){_0x348d5b=_0x348d5b||0xcc;return function(_0xf4d4f1){if(_0xf4d4f1){return _0x2fa36b[_0x92aa('0x23')](_0x348d5b);}return _0x2fa36b['status'](_0x348d5b)[_0x92aa('0x24')]();};}function respondWithResult(_0x54c82c,_0x2fafb3){_0x2fafb3=_0x2fafb3||0xc8;return function(_0x239065){if(_0x239065){return _0x54c82c[_0x92aa('0x25')](_0x2fafb3)['json'](_0x239065);}};}function respondWithFilteredResult(_0x3f506e,_0x16b267){return function(_0x51bf50){if(_0x51bf50){var _0x56643c=_0x51bf50[_0x92aa('0x26')],_0x57eab8=_0x16b267[_0x92aa('0x27')],_0x4b4ef2=_0x16b267[_0x92aa('0x27')]+_0x16b267['limit'],_0x263bd;if(_0x4b4ef2>=_0x56643c){_0x4b4ef2=_0x56643c;_0x263bd=0xc8;}else{_0x263bd=0xce;}_0x3f506e[_0x92aa('0x25')](_0x263bd);return _0x3f506e[_0x92aa('0x28')](_0x92aa('0x29'),_0x57eab8+'-'+_0x4b4ef2+'/'+_0x56643c)[_0x92aa('0x2a')](_0x51bf50);}return null;};}function patchUpdates(_0xb9bf68){return function(_0x6edfe5){try{jsonpatch[_0x92aa('0x2b')](_0x6edfe5,_0xb9bf68,!![]);}catch(_0x373f0a){return BPromise[_0x92aa('0x2c')](_0x373f0a);}return _0x6edfe5[_0x92aa('0x2d')]();};}function saveUpdates(_0x39b87e,_0x1c3635){return function(_0x200ec6){if(_0x200ec6){return _0x200ec6[_0x92aa('0x2e')](_0x39b87e)[_0x92aa('0x2f')](function(_0xe1cbad){return _0xe1cbad;});}return null;};}function removeEntity(_0x9c66c6,_0xab7751){return function(_0x1956d9){if(_0x1956d9){return _0x1956d9[_0x92aa('0x30')]()['then'](function(){_0x9c66c6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2689a0,_0x51bd8a){return function(_0x1dc3f5){if(!_0x1dc3f5){_0x2689a0[_0x92aa('0x23')](0x194);}return _0x1dc3f5;};}function handleError(_0x1b2682,_0x15eba0){_0x15eba0=_0x15eba0||0x1f4;return function(_0x51c1d9){logger['error'](_0x51c1d9[_0x92aa('0x31')]);if(_0x51c1d9['name']){delete _0x51c1d9[_0x92aa('0x32')];}_0x1b2682[_0x92aa('0x25')](_0x15eba0)[_0x92aa('0x33')](_0x51c1d9);};}exports[_0x92aa('0x34')]=function(_0x46df55,_0x394277){var _0x5abfda={},_0x507ec1={},_0x538f69={'count':0x0,'rows':[]};var _0x17951e=_[_0x92aa('0x35')](db['FreshsalesAccount']['rawAttributes'],function(_0x37fa5a){return{'name':_0x37fa5a['fieldName'],'type':_0x37fa5a[_0x92aa('0x36')]['key']};});_0x507ec1[_0x92aa('0x37')]=_[_0x92aa('0x35')](_0x17951e,_0x92aa('0x32'));_0x507ec1[_0x92aa('0x38')]=_[_0x92aa('0x39')](_0x46df55[_0x92aa('0x38')]);_0x507ec1['filters']=_[_0x92aa('0x3a')](_0x507ec1[_0x92aa('0x37')],_0x507ec1[_0x92aa('0x38')]);_0x5abfda[_0x92aa('0x3b')]=_['intersection'](_0x507ec1[_0x92aa('0x37')],qs['fields'](_0x46df55[_0x92aa('0x38')][_0x92aa('0x3c')]));_0x5abfda[_0x92aa('0x3b')]=_0x5abfda[_0x92aa('0x3b')][_0x92aa('0x3d')]?_0x5abfda[_0x92aa('0x3b')]:_0x507ec1[_0x92aa('0x37')];if(!_0x46df55[_0x92aa('0x38')]['hasOwnProperty'](_0x92aa('0x3e'))){_0x5abfda[_0x92aa('0x3f')]=qs['limit'](_0x46df55[_0x92aa('0x38')][_0x92aa('0x3f')]);_0x5abfda[_0x92aa('0x27')]=qs[_0x92aa('0x27')](_0x46df55['query'][_0x92aa('0x27')]);}_0x5abfda[_0x92aa('0x40')]=qs[_0x92aa('0x41')](_0x46df55[_0x92aa('0x38')][_0x92aa('0x41')]);_0x5abfda[_0x92aa('0x42')]=qs[_0x92aa('0x43')](_[_0x92aa('0x44')](_0x46df55[_0x92aa('0x38')],_0x507ec1[_0x92aa('0x43')]));if(_0x46df55[_0x92aa('0x38')][_0x92aa('0x45')]){_0x5abfda[_0x92aa('0x42')]=_[_0x92aa('0x46')](_0x5abfda[_0x92aa('0x42')],{'$or':_[_0x92aa('0x35')](_0x17951e,function(_0x221fb1){if(_0x221fb1['type']!==_0x92aa('0x47')){var _0xc647f3={};_0xc647f3[_0x221fb1[_0x92aa('0x32')]]={'$like':'%'+_0x46df55['query'][_0x92aa('0x45')]+'%'};return _0xc647f3;}})});}_0x5abfda=_[_0x92aa('0x46')]({},_0x5abfda,_0x46df55[_0x92aa('0x48')]);var _0x2a2c8a={'where':_0x5abfda['where']};return db[_0x92aa('0x49')][_0x92aa('0x26')](_0x2a2c8a)['then'](function(_0x23befd){_0x538f69[_0x92aa('0x26')]=_0x23befd;if(_0x46df55[_0x92aa('0x38')][_0x92aa('0x4a')]){_0x5abfda[_0x92aa('0x4b')]=[{'all':!![]}];}return db[_0x92aa('0x49')][_0x92aa('0x4c')](_0x5abfda);})[_0x92aa('0x2f')](function(_0x3dfe8d){_0x538f69[_0x92aa('0x4d')]=_0x3dfe8d;return _0x538f69;})['then'](respondWithFilteredResult(_0x394277,_0x5abfda))['catch'](handleError(_0x394277,null));};exports[_0x92aa('0x4e')]=function(_0x34d919,_0x679c30){var _0x2273f9={'raw':![],'where':{'id':_0x34d919[_0x92aa('0x4f')]['id']}},_0x1b1732={};_0x1b1732[_0x92aa('0x37')]=_[_0x92aa('0x39')](db[_0x92aa('0x49')]['rawAttributes']);_0x1b1732['query']=_[_0x92aa('0x39')](_0x34d919['query']);_0x1b1732['filters']=_[_0x92aa('0x3a')](_0x1b1732[_0x92aa('0x37')],_0x1b1732[_0x92aa('0x38')]);_0x2273f9[_0x92aa('0x3b')]=_['intersection'](_0x1b1732['model'],qs[_0x92aa('0x3c')](_0x34d919[_0x92aa('0x38')][_0x92aa('0x3c')]));_0x2273f9[_0x92aa('0x3b')]=_0x2273f9[_0x92aa('0x3b')]['length']?_0x2273f9[_0x92aa('0x3b')]:_0x1b1732[_0x92aa('0x37')];if(_0x34d919[_0x92aa('0x38')][_0x92aa('0x4a')]){_0x2273f9['include']=[{'all':!![]}];}_0x2273f9=_[_0x92aa('0x46')]({},_0x2273f9,_0x34d919[_0x92aa('0x48')]);return db[_0x92aa('0x49')][_0x92aa('0x50')](_0x2273f9)[_0x92aa('0x2f')](handleEntityNotFound(_0x679c30,null))[_0x92aa('0x2f')](respondWithResult(_0x679c30,null))[_0x92aa('0x22')](handleError(_0x679c30,null));};exports[_0x92aa('0x51')]=function(_0xa389ae,_0x245869){return db[_0x92aa('0x49')][_0x92aa('0x51')](_0xa389ae[_0x92aa('0x52')],{})[_0x92aa('0x2f')](respondWithResult(_0x245869,0xc9))[_0x92aa('0x22')](handleError(_0x245869,null));};exports[_0x92aa('0x2e')]=function(_0x20c9a3,_0x47e031){if(_0x20c9a3[_0x92aa('0x52')]['id']){delete _0x20c9a3[_0x92aa('0x52')]['id'];}return db[_0x92aa('0x49')][_0x92aa('0x50')]({'where':{'id':_0x20c9a3[_0x92aa('0x4f')]['id']}})[_0x92aa('0x2f')](handleEntityNotFound(_0x47e031,null))['then'](saveUpdates(_0x20c9a3[_0x92aa('0x52')],null))[_0x92aa('0x2f')](respondWithResult(_0x47e031,null))[_0x92aa('0x22')](handleError(_0x47e031,null));};exports[_0x92aa('0x30')]=function(_0x4f0616,_0x11e66d){return db[_0x92aa('0x49')][_0x92aa('0x50')]({'where':{'id':_0x4f0616[_0x92aa('0x4f')]['id']}})[_0x92aa('0x2f')](handleEntityNotFound(_0x11e66d,null))[_0x92aa('0x2f')](removeEntity(_0x11e66d,null))[_0x92aa('0x22')](handleError(_0x11e66d,null));};exports['getConfigurations']=function(_0x399641,_0x10e0f6,_0x2b2c52){var _0x435cd7={};var _0x2a10f3={};var _0x4f7654;var _0xc2bdbb;return db[_0x92aa('0x49')][_0x92aa('0x53')]({'where':{'id':_0x399641[_0x92aa('0x4f')]['id']}})[_0x92aa('0x2f')](handleEntityNotFound(_0x10e0f6,null))['then'](function(_0x3175b4){if(_0x3175b4){_0x4f7654=_0x3175b4;_0x2a10f3[_0x92aa('0x37')]=_[_0x92aa('0x39')](db[_0x92aa('0x54')][_0x92aa('0x55')]);_0x2a10f3[_0x92aa('0x38')]=_['keys'](_0x399641[_0x92aa('0x38')]);_0x2a10f3[_0x92aa('0x43')]=_['intersection'](_0x2a10f3['model'],_0x2a10f3[_0x92aa('0x38')]);_0x435cd7['attributes']=_[_0x92aa('0x3a')](_0x2a10f3[_0x92aa('0x37')],qs['fields'](_0x399641[_0x92aa('0x38')][_0x92aa('0x3c')]));_0x435cd7[_0x92aa('0x3b')]=_0x435cd7[_0x92aa('0x3b')][_0x92aa('0x3d')]?_0x435cd7[_0x92aa('0x3b')]:_0x2a10f3[_0x92aa('0x37')];_0x435cd7[_0x92aa('0x40')]=qs[_0x92aa('0x41')](_0x399641[_0x92aa('0x38')][_0x92aa('0x41')]);_0x435cd7[_0x92aa('0x42')]=qs[_0x92aa('0x43')](_[_0x92aa('0x44')](_0x399641['query'],_0x2a10f3[_0x92aa('0x43')]));if(_0x399641[_0x92aa('0x38')][_0x92aa('0x45')]){_0x435cd7[_0x92aa('0x42')]=_[_0x92aa('0x46')](_0x435cd7[_0x92aa('0x42')],{'$or':_[_0x92aa('0x35')](_0x435cd7[_0x92aa('0x3b')],function(_0x55f74d){var _0x1fb703={};_0x1fb703[_0x55f74d]={'$like':'%'+_0x399641[_0x92aa('0x38')][_0x92aa('0x45')]+'%'};return _0x1fb703;})});}_0x435cd7=_[_0x92aa('0x46')]({},_0x435cd7,_0x399641[_0x92aa('0x48')]);return _0x4f7654['getConfigurations'](_0x435cd7);}})[_0x92aa('0x2f')](function(_0xf792cb){if(_0xf792cb){_0xc2bdbb=_0xf792cb[_0x92aa('0x3d')];if(!_0x399641[_0x92aa('0x38')][_0x92aa('0x56')](_0x92aa('0x3e'))){_0x435cd7[_0x92aa('0x3f')]=qs[_0x92aa('0x3f')](_0x399641[_0x92aa('0x38')][_0x92aa('0x3f')]);_0x435cd7[_0x92aa('0x27')]=qs[_0x92aa('0x27')](_0x399641[_0x92aa('0x38')]['offset']);}return _0x4f7654[_0x92aa('0x57')](_0x435cd7);}})[_0x92aa('0x2f')](function(_0x17c738){if(_0x17c738){return _0x17c738?{'count':_0xc2bdbb,'rows':_0x17c738}:null;}})[_0x92aa('0x2f')](respondWithResult(_0x10e0f6,null))[_0x92aa('0x22')](handleError(_0x10e0f6,null));};exports[_0x92aa('0x58')]=function(_0x34df15,_0xb2ce72,_0x38cdd3){if(_0x34df15[_0x92aa('0x52')]['id']){delete _0x34df15[_0x92aa('0x52')]['id'];}return db['FreshsalesAccount'][_0x92aa('0x53')]({'where':{'id':_0x34df15['params']['id']}})[_0x92aa('0x2f')](handleEntityNotFound(_0xb2ce72,null))[_0x92aa('0x2f')](function(_0x48e4a8){if(_0x48e4a8){_0x34df15[_0x92aa('0x52')]['AccountId']=_0x48e4a8['id'];_0x34df15[_0x92aa('0x52')][_0x92aa('0x59')]=integrations['getSubjects'](_0x34df15[_0x92aa('0x52')][_0x92aa('0x5a')],_0x34df15[_0x92aa('0x52')]['type']);_0x34df15[_0x92aa('0x52')][_0x92aa('0x5b')]=integrations['getDescriptions'](_0x34df15[_0x92aa('0x52')][_0x92aa('0x5a')],_0x34df15[_0x92aa('0x52')][_0x92aa('0x36')]);return db[_0x92aa('0x54')][_0x92aa('0x51')](_0x34df15['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x92aa('0x59')},{'model':db['FreshsalesField'],'as':_0x92aa('0x5b')}]});}return null;})['then'](respondWithResult(_0xb2ce72,null))[_0x92aa('0x22')](handleError(_0xb2ce72,null));};exports[_0x92aa('0x5c')]=function(_0x6d4d23,_0x10260d,_0x5be457){var _0x2651a1='';var _0x46d091='';return db['FreshsalesAccount'][_0x92aa('0x53')]({'where':{'id':_0x6d4d23[_0x92aa('0x4f')]['id']},'attributes':['id',_0x92aa('0x5d'),_0x92aa('0x5e'),_0x92aa('0x5f')]})[_0x92aa('0x2f')](handleEntityNotFound(_0x10260d,null))[_0x92aa('0x2f')](function(_0x3e2d44){if(_0x3e2d44){_0x46d091=_0x3e2d44[_0x92aa('0x5d')];_0x2651a1=_0x3e2d44[_0x92aa('0x5e')];var _0x36afbe=_0x3e2d44[_0x92aa('0x5e')][_0x92aa('0x60')](-0x1);if(_0x36afbe==='/'){_0x2651a1=_0x2651a1[_0x92aa('0x61')](0x0,_0x2651a1[_0x92aa('0x62')](_0x36afbe));}return rp({'method':_0x92aa('0x63'),'uri':util[_0x92aa('0x64')](_0x92aa('0x65'),_0x2651a1,_0x92aa('0x66')),'headers':{'Authorization':_0x92aa('0x67')+_0x3e2d44[_0x92aa('0x5f')]},'json':!![]});}})[_0x92aa('0x2f')](function(_0x5e9db3){if(_0x5e9db3){var _0x57781e=_0x5e9db3['users'];var _0x384dc7=![];var _0x149769=null;for(_0x149769=0x0;_0x149769<_0x57781e['length'];_0x149769++){if(_0x57781e[_0x149769]['email']===_0x46d091){_0x384dc7=!![];}}if(_0x384dc7){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x92aa('0x2f')](respondWithResult(_0x10260d,null))[_0x92aa('0x22')](function(_0x3de3ea){var _0x1c225e=_0x6d4d23['query']['test']?0x1f4:_0x3de3ea[_0x92aa('0x68')]||0x1f4;logger['error'](_0x92aa('0x69'),_0x92aa('0x5c'),_0x1c225e,JSON['stringify'](_0x3de3ea));delete _0x3de3ea[_0x92aa('0x32')];if(_0x1c225e===0x191){_0x1c225e=0x190;}_0x10260d[_0x92aa('0x25')](_0x1c225e)['send'](_0x6d4d23[_0x92aa('0x38')][_0x92aa('0x16')]?{'message':_0x92aa('0x6a'),'statusCode':_0x3de3ea['statusCode']}:_0x3de3ea);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index b787d98..e86ecfb 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 _0x3562=['define','int_freshsales_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x3562,0x9e));var _0x2356=function(_0x1e8d09,_0x290b78){_0x1e8d09=_0x1e8d09-0x0;var _0x145fcd=_0x3562[_0x1e8d09];return _0x145fcd;};'use strict';var _=require(_0x2356('0x0'));var util=require(_0x2356('0x1'));var logger=require('../../config/logger')(_0x2356('0x2'));var moment=require(_0x2356('0x3'));var BPromise=require(_0x2356('0x4'));var rp=require(_0x2356('0x5'));var fs=require('fs');var path=require(_0x2356('0x6'));var rimraf=require(_0x2356('0x7'));var config=require(_0x2356('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2356('0x9'));module[_0x2356('0xa')]=function(_0x3dc8bb,_0x3a9ada){return _0x3dc8bb[_0x2356('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x2356('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5ab=['api','moment','request-promise','path','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','../../config/logger'];(function(_0x22b8e7,_0x1beaa8){var _0x2aabe3=function(_0x59ffaf){while(--_0x59ffaf){_0x22b8e7['push'](_0x22b8e7['shift']());}};_0x2aabe3(++_0x1beaa8);}(_0xd5ab,0x14e));var _0xbd5a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd5ab[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xbd5a('0x0'));var util=require('util');var logger=require(_0xbd5a('0x1'))(_0xbd5a('0x2'));var moment=require(_0xbd5a('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd5a('0x4'));var fs=require('fs');var path=require(_0xbd5a('0x5'));var rimraf=require('rimraf');var config=require(_0xbd5a('0x6'));var attributes=require(_0xbd5a('0x7'));var integrations=require(_0xbd5a('0x8'));module[_0xbd5a('0x9')]=function(_0x18fcba,_0x319241){return _0x18fcba[_0xbd5a('0xa')]('FreshsalesAccount',attributes,{'tableName':_0xbd5a('0xb'),'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 f00ee17..e6d96ef 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 _0x23db=['result','catch','findAll','options','raw','where','include','map','model','attributes','GetFreshsalesAccount','stringify','find','then','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x2e77dd,_0x44e1c1){var _0x4d21fe=function(_0x34636d){while(--_0x34636d){_0x2e77dd['push'](_0x2e77dd['shift']());}};_0x4d21fe(++_0x44e1c1);}(_0x23db,0x141));var _0xb23d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x23db[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xb23d('0x0'));var util=require(_0xb23d('0x1'));var moment=require(_0xb23d('0x2'));var BPromise=require(_0xb23d('0x3'));var rs=require(_0xb23d('0x4'));var fs=require('fs');var Redis=require(_0xb23d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb23d('0x6'))(_0xb23d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb23d('0x8'));var client=jayson[_0xb23d('0x9')][_0xb23d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2056b6,_0x39799c,_0x38bed9){return new BPromise(function(_0x460fa0,_0x466785){return client[_0xb23d('0xb')](_0x2056b6,_0x38bed9)['then'](function(_0x2f91f0){logger[_0xb23d('0xc')](_0xb23d('0xd'),_0x39799c,_0xb23d('0xe'));logger[_0xb23d('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x39799c,'request\x20sent',JSON['stringify'](_0x2f91f0));if(_0x2f91f0[_0xb23d('0x10')]){if(_0x2f91f0['error'][_0xb23d('0x11')]===0x1f4){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x466785(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}logger['error'](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x460fa0(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}else{logger[_0xb23d('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x39799c,'request\x20sent');_0x460fa0(_0x2f91f0[_0xb23d('0x13')][_0xb23d('0x12')]);}})[_0xb23d('0x14')](function(_0x9e5eb3){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x9e5eb3);_0x466785(_0x9e5eb3);});});}exports['GetFreshsalesAccount']=function(_0x37bfe2){var _0x3f2c6b=this;return new Promise(function(_0x2b47e0,_0x2673d3){return db['FreshsalesAccount'][_0xb23d('0x15')]({'raw':_0x37bfe2['options']?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x17')]===undefined?!![]:![]:!![],'where':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x18')]||null:null,'attributes':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')]['attributes']||null:null,'limit':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2['options']['limit']||null:null,'include':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x19')],function(_0x921fc){return{'model':db[_0x921fc[_0xb23d('0x1b')]],'as':_0x921fc['as'],'attributes':_0x921fc[_0xb23d('0x1c')],'include':_0x921fc[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x921fc['include'],function(_0x1f0731){return{'model':db[_0x1f0731[_0xb23d('0x1b')]],'as':_0x1f0731['as'],'attributes':_0x1f0731[_0xb23d('0x1c')],'include':_0x1f0731['include']?_['map'](_0x1f0731[_0xb23d('0x19')],function(_0x2e758e){return{'model':db[_0x2e758e[_0xb23d('0x1b')]],'as':_0x2e758e['as'],'attributes':_0x2e758e[_0xb23d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2785f5){logger[_0xb23d('0xc')](_0xb23d('0x1d'),_0x37bfe2);logger[_0xb23d('0xf')](_0xb23d('0x1d'),_0x37bfe2,JSON[_0xb23d('0x1e')](_0x2785f5));_0x2b47e0(_0x2785f5);})[_0xb23d('0x14')](function(_0x867d69){logger[_0xb23d('0x10')](_0xb23d('0x1d'),_0x867d69[_0xb23d('0x12')],_0x37bfe2);_0x2673d3(_0x3f2c6b[_0xb23d('0x10')](0x1f4,_0x867d69[_0xb23d('0x12')]));});});};exports['ShowFreshsalesAccount']=function(_0x56f62a){var _0x536be6=this;return new Promise(function(_0x4722c1,_0x53c6ed){return db['FreshsalesAccount'][_0xb23d('0x1f')]({'raw':_0x56f62a['options']?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x17')]===undefined?!![]:![]:!![],'where':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x18')]||null:null,'attributes':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x1c')]||null:null,'include':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x56f62a[_0xb23d('0x16')][_0xb23d('0x19')],function(_0x220543){return{'model':db[_0x220543[_0xb23d('0x1b')]],'as':_0x220543['as'],'attributes':_0x220543['attributes'],'include':_0x220543[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x220543[_0xb23d('0x19')],function(_0x208b2a){return{'model':db[_0x208b2a[_0xb23d('0x1b')]],'as':_0x208b2a['as'],'attributes':_0x208b2a[_0xb23d('0x1c')],'include':_0x208b2a[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x208b2a['include'],function(_0x1131d3){return{'model':db[_0x1131d3[_0xb23d('0x1b')]],'as':_0x1131d3['as'],'attributes':_0x1131d3[_0xb23d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb23d('0x20')](function(_0x3ca4af){logger[_0xb23d('0xc')](_0xb23d('0x21'),_0x56f62a);logger[_0xb23d('0xf')](_0xb23d('0x21'),_0x56f62a,JSON[_0xb23d('0x1e')](_0x3ca4af));_0x4722c1(_0x3ca4af);})[_0xb23d('0x14')](function(_0x22683a){logger['error'](_0xb23d('0x21'),_0x22683a[_0xb23d('0x12')],_0x56f62a);_0x53c6ed(_0x536be6[_0xb23d('0x10')](0x1f4,_0x22683a['message']));});});}; \ No newline at end of file +var _0x8af6=['attributes','limit','include','model','map','then','GetFreshsalesAccount','ShowFreshsalesAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','FreshsalesAccount','findAll','options','raw'];(function(_0x12cbdd,_0x4ee21b){var _0x3bde34=function(_0x568ae8){while(--_0x568ae8){_0x12cbdd['push'](_0x12cbdd['shift']());}};_0x3bde34(++_0x4ee21b);}(_0x8af6,0x76));var _0x68af=function(_0x47a006,_0x3c02ee){_0x47a006=_0x47a006-0x0;var _0x4285de=_0x8af6[_0x47a006];return _0x4285de;};'use strict';var _=require(_0x68af('0x0'));var util=require(_0x68af('0x1'));var moment=require(_0x68af('0x2'));var BPromise=require(_0x68af('0x3'));var rs=require(_0x68af('0x4'));var fs=require('fs');var Redis=require(_0x68af('0x5'));var db=require(_0x68af('0x6'))['db'];var utils=require(_0x68af('0x7'));var logger=require(_0x68af('0x8'))(_0x68af('0x9'));var config=require('../../config/environment');var jayson=require(_0x68af('0xa'));var client=jayson['client'][_0x68af('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2be0c1,_0x89146f,_0x1e77b0){return new BPromise(function(_0x3c6018,_0x20d61c){return client[_0x68af('0xc')](_0x2be0c1,_0x1e77b0)['then'](function(_0x56bc37){logger[_0x68af('0xd')](_0x68af('0xe'),_0x89146f,'request\x20sent');logger[_0x68af('0xf')](_0x68af('0x10'),_0x89146f,_0x68af('0x11'),JSON[_0x68af('0x12')](_0x56bc37));if(_0x56bc37[_0x68af('0x13')]){if(_0x56bc37[_0x68af('0x13')]['code']===0x1f4){logger['error'](_0x68af('0xe'),_0x89146f,_0x56bc37['error']['message']);return _0x20d61c(_0x56bc37[_0x68af('0x13')][_0x68af('0x14')]);}logger[_0x68af('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x89146f,_0x56bc37[_0x68af('0x13')]['message']);return _0x3c6018(_0x56bc37[_0x68af('0x13')][_0x68af('0x14')]);}else{logger[_0x68af('0xd')](_0x68af('0xe'),_0x89146f,_0x68af('0x11'));_0x3c6018(_0x56bc37['result'][_0x68af('0x14')]);}})[_0x68af('0x15')](function(_0x326b12){logger[_0x68af('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x89146f,_0x326b12);_0x20d61c(_0x326b12);});});}exports['GetFreshsalesAccount']=function(_0x3aa998){var _0x29ddbf=this;return new Promise(function(_0x4e1c41,_0x9ad23){return db[_0x68af('0x16')][_0x68af('0x17')]({'raw':_0x3aa998[_0x68af('0x18')]?_0x3aa998['options'][_0x68af('0x19')]===undefined?!![]:![]:!![],'where':_0x3aa998[_0x68af('0x18')]?_0x3aa998['options']['where']||null:null,'attributes':_0x3aa998[_0x68af('0x18')]?_0x3aa998[_0x68af('0x18')][_0x68af('0x1a')]||null:null,'limit':_0x3aa998[_0x68af('0x18')]?_0x3aa998[_0x68af('0x18')][_0x68af('0x1b')]||null:null,'include':_0x3aa998['options']?_0x3aa998[_0x68af('0x18')][_0x68af('0x1c')]?_['map'](_0x3aa998[_0x68af('0x18')]['include'],function(_0x13af7b){return{'model':db[_0x13af7b[_0x68af('0x1d')]],'as':_0x13af7b['as'],'attributes':_0x13af7b[_0x68af('0x1a')],'include':_0x13af7b[_0x68af('0x1c')]?_[_0x68af('0x1e')](_0x13af7b[_0x68af('0x1c')],function(_0x5851b9){return{'model':db[_0x5851b9[_0x68af('0x1d')]],'as':_0x5851b9['as'],'attributes':_0x5851b9[_0x68af('0x1a')],'include':_0x5851b9[_0x68af('0x1c')]?_[_0x68af('0x1e')](_0x5851b9[_0x68af('0x1c')],function(_0x375d38){return{'model':db[_0x375d38[_0x68af('0x1d')]],'as':_0x375d38['as'],'attributes':_0x375d38[_0x68af('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68af('0x1f')](function(_0x5417e9){logger[_0x68af('0xd')](_0x68af('0x20'),_0x3aa998);logger[_0x68af('0xf')](_0x68af('0x20'),_0x3aa998,JSON['stringify'](_0x5417e9));_0x4e1c41(_0x5417e9);})['catch'](function(_0x128d5d){logger[_0x68af('0x13')](_0x68af('0x20'),_0x128d5d['message'],_0x3aa998);_0x9ad23(_0x29ddbf['error'](0x1f4,_0x128d5d[_0x68af('0x14')]));});});};exports[_0x68af('0x21')]=function(_0x5c0adb){var _0x718b39=this;return new Promise(function(_0x2d5aac,_0x21b677){return db[_0x68af('0x16')][_0x68af('0x22')]({'raw':_0x5c0adb[_0x68af('0x18')]?_0x5c0adb[_0x68af('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5c0adb[_0x68af('0x18')]?_0x5c0adb[_0x68af('0x18')][_0x68af('0x23')]||null:null,'attributes':_0x5c0adb['options']?_0x5c0adb[_0x68af('0x18')][_0x68af('0x1a')]||null:null,'include':_0x5c0adb['options']?_0x5c0adb[_0x68af('0x18')][_0x68af('0x1c')]?_['map'](_0x5c0adb[_0x68af('0x18')]['include'],function(_0x48c8b4){return{'model':db[_0x48c8b4[_0x68af('0x1d')]],'as':_0x48c8b4['as'],'attributes':_0x48c8b4[_0x68af('0x1a')],'include':_0x48c8b4[_0x68af('0x1c')]?_[_0x68af('0x1e')](_0x48c8b4[_0x68af('0x1c')],function(_0x39152a){return{'model':db[_0x39152a['model']],'as':_0x39152a['as'],'attributes':_0x39152a['attributes'],'include':_0x39152a['include']?_[_0x68af('0x1e')](_0x39152a[_0x68af('0x1c')],function(_0x47c527){return{'model':db[_0x47c527[_0x68af('0x1d')]],'as':_0x47c527['as'],'attributes':_0x47c527[_0x68af('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x68af('0x1f')](function(_0x486242){logger[_0x68af('0xd')](_0x68af('0x21'),_0x5c0adb);logger[_0x68af('0xf')](_0x68af('0x21'),_0x5c0adb,JSON[_0x68af('0x12')](_0x486242));_0x2d5aac(_0x486242);})['catch'](function(_0x1a8c0d){logger[_0x68af('0x13')](_0x68af('0x21'),_0x1a8c0d[_0x68af('0x14')],_0x5c0adb);_0x21b677(_0x718b39[_0x68af('0x13')](0x1f4,_0x1a8c0d[_0x68af('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index a4db1a7..2558a4e 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 _0x9896=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','update','delete','destroy','multer','util','path'];(function(_0x9e689c,_0x2600d8){var _0x13ee00=function(_0x60e5e2){while(--_0x60e5e2){_0x9e689c['push'](_0x9e689c['shift']());}};_0x13ee00(++_0x2600d8);}(_0x9896,0x174));var _0x6989=function(_0x1ffac5,_0xb28e02){_0x1ffac5=_0x1ffac5-0x0;var _0x325927=_0x9896[_0x1ffac5];return _0x325927;};'use strict';var multer=require(_0x6989('0x0'));var util=require(_0x6989('0x1'));var path=require(_0x6989('0x2'));var timeout=require(_0x6989('0x3'));var express=require(_0x6989('0x4'));var router=express[_0x6989('0x5')]();var auth=require(_0x6989('0x6'));var interaction=require(_0x6989('0x7'));var config=require(_0x6989('0x8'));var controller=require(_0x6989('0x9'));router[_0x6989('0xa')]('/',auth[_0x6989('0xb')](),controller[_0x6989('0xc')]);router['get'](_0x6989('0xd'),auth['isAuthenticated'](),controller[_0x6989('0xe')]);router['get'](_0x6989('0xf'),auth[_0x6989('0xb')](),controller[_0x6989('0x10')]);router[_0x6989('0xa')](_0x6989('0x11'),auth[_0x6989('0xb')](),controller[_0x6989('0x12')]);router[_0x6989('0xa')](_0x6989('0x13'),auth[_0x6989('0xb')](),controller['getFields']);router[_0x6989('0x14')]('/',auth[_0x6989('0xb')](),controller[_0x6989('0x15')]);router['put'](_0x6989('0xd'),auth[_0x6989('0xb')](),controller[_0x6989('0x16')]);router[_0x6989('0x17')]('/:id',auth[_0x6989('0xb')](),controller[_0x6989('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0431=['/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id/subjects','getSubjects','getDescriptions','getFields','post','create','put','update'];(function(_0x36c0d1,_0x1d9948){var _0x59c859=function(_0x5d4c69){while(--_0x5d4c69){_0x36c0d1['push'](_0x36c0d1['shift']());}};_0x59c859(++_0x1d9948);}(_0x0431,0x76));var _0x1043=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x0431[_0x4d1ee9];return _0x9a5456;};'use strict';var multer=require(_0x1043('0x0'));var util=require(_0x1043('0x1'));var path=require(_0x1043('0x2'));var timeout=require('connect-timeout');var express=require(_0x1043('0x3'));var router=express[_0x1043('0x4')]();var auth=require(_0x1043('0x5'));var interaction=require(_0x1043('0x6'));var config=require(_0x1043('0x7'));var controller=require(_0x1043('0x8'));router['get']('/',auth[_0x1043('0x9')](),controller[_0x1043('0xa')]);router[_0x1043('0xb')]('/:id',auth[_0x1043('0x9')](),controller['show']);router[_0x1043('0xb')](_0x1043('0xc'),auth[_0x1043('0x9')](),controller[_0x1043('0xd')]);router[_0x1043('0xb')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x1043('0xe')]);router[_0x1043('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x1043('0xf')]);router[_0x1043('0x10')]('/',auth['isAuthenticated'](),controller[_0x1043('0x11')]);router[_0x1043('0x12')]('/:id',auth[_0x1043('0x9')](),controller[_0x1043('0x13')]);router['delete'](_0x1043('0x14'),auth['isAuthenticated'](),controller[_0x1043('0x15')]);module[_0x1043('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index c9e4368..0d99d3e 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 _0x46f6=['STRING','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x46f6,0x1b1));var _0x646f=function(_0x54bcc8,_0x31fa76){_0x54bcc8=_0x54bcc8-0x0;var _0x4d3517=_0x46f6[_0x54bcc8];return _0x4d3517;};'use strict';var Sequelize=require('sequelize');module[_0x646f('0x0')]={'name':{'type':Sequelize[_0x646f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x238b=['STRING','sequelize','exports'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0x238b,0xdc));var _0xb238=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x238b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb238('0x0'));module[_0xb238('0x1')]={'name':{'type':Sequelize[_0xb238('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 7f438df..9f2289f 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 _0x1dcc=['merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','keys','length','find','create','body','update','params','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x20e281,_0xc048d7){var _0x386bff=function(_0x3f9ff3){while(--_0x3f9ff3){_0x20e281['push'](_0x20e281['shift']());}};_0x386bff(++_0xc048d7);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x2e016f,_0x57cd83){_0x2e016f=_0x2e016f-0x0;var _0x5b35e1=_0x1dcc[_0x2e016f];return _0x5b35e1;};'use strict';var pdf=require(_0xc1dc('0x0'));var emlformat=require(_0xc1dc('0x1'));var rimraf=require(_0xc1dc('0x2'));var zipdir=require(_0xc1dc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1dc('0x4'));var moment=require('moment');var BPromise=require(_0xc1dc('0x5'));var Mustache=require(_0xc1dc('0x6'));var util=require(_0xc1dc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc1dc('0x8'));var ejs=require(_0xc1dc('0x9'));var fs=require('fs');var _=require(_0xc1dc('0xa'));var squel=require('squel');var crypto=require(_0xc1dc('0xb'));var jsforce=require(_0xc1dc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1dc('0x8'));var querystring=require('querystring');var Papa=require(_0xc1dc('0xd'));var Redis=require('ioredis');var authService=require(_0xc1dc('0xe'));var qs=require(_0xc1dc('0xf'));var as=require(_0xc1dc('0x10'));var hardwareService=require(_0xc1dc('0x11'));var logger=require(_0xc1dc('0x12'))(_0xc1dc('0x13'));var utils=require(_0xc1dc('0x14'));var config=require(_0xc1dc('0x15'));var db=require(_0xc1dc('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc1dc('0x17')][_0xc1dc('0x18')]({'port':0x232a});function checkPasswordPattern(_0xb7e667,_0x58cc30,_0x73b54c){if(_0x73b54c){var _0x7d7257=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7d7257[_0xc1dc('0x19')](_0x58cc30)){return _0xb7e667;}else{throw new db[(_0xc1dc('0x1a'))][(_0xc1dc('0x1b'))](_0xc1dc('0x1c'));}}else{return _0xb7e667;}}function respondWithRpcPromise(_0x188182,_0x21aed1,_0x265929,_0x37b23a){return new BPromise(function(_0x1cbbfe,_0x5885b0){var _0x16ec8b=_0x37b23a||client;return _0x16ec8b[_0xc1dc('0x1d')](_0x188182,_0x265929)[_0xc1dc('0x1e')](function(_0x3d3315){logger['info'](_0xc1dc('0x1f'),_0x21aed1,_0xc1dc('0x20'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x21aed1,_0xc1dc('0x20'),JSON[_0xc1dc('0x21')](_0x3d3315));if(_0x3d3315[_0xc1dc('0x22')]){if(_0x3d3315[_0xc1dc('0x22')][_0xc1dc('0x23')]===0x1f4){logger[_0xc1dc('0x22')](_0xc1dc('0x1f'),_0x21aed1,_0x3d3315[_0xc1dc('0x22')]['message']);return _0x5885b0(_0x3d3315['error']['message']);}logger[_0xc1dc('0x22')](_0xc1dc('0x1f'),_0x21aed1,_0x3d3315['error'][_0xc1dc('0x24')]);return _0x1cbbfe(_0x3d3315[_0xc1dc('0x22')][_0xc1dc('0x24')]);}else{logger[_0xc1dc('0x25')](_0xc1dc('0x1f'),_0x21aed1,_0xc1dc('0x20'));_0x1cbbfe(_0x3d3315[_0xc1dc('0x26')][_0xc1dc('0x24')]);}})[_0xc1dc('0x27')](function(_0x1a6d65){logger['error'](_0xc1dc('0x1f'),_0x21aed1,_0x1a6d65);_0x5885b0(_0x1a6d65);});});}function respondWithStatusCode(_0xfeb0b1,_0x17ce2b){_0x17ce2b=_0x17ce2b||0xcc;return function(_0x52b0b9){if(_0x52b0b9){return _0xfeb0b1['sendStatus'](_0x17ce2b);}return _0xfeb0b1[_0xc1dc('0x28')](_0x17ce2b)[_0xc1dc('0x29')]();};}function respondWithResult(_0xfd3f88,_0x7c0254){_0x7c0254=_0x7c0254||0xc8;return function(_0x354e71){if(_0x354e71){return _0xfd3f88[_0xc1dc('0x28')](_0x7c0254)[_0xc1dc('0x2a')](_0x354e71);}};}function respondWithFilteredResult(_0x411ee0,_0x204b8a){return function(_0x5dbd36){if(_0x5dbd36){var _0x2d5a57=_0x5dbd36[_0xc1dc('0x2b')],_0x25b7bf=_0x204b8a[_0xc1dc('0x2c')],_0xd77537=_0x204b8a[_0xc1dc('0x2c')]+_0x204b8a[_0xc1dc('0x2d')],_0x27e54d;if(_0xd77537>=_0x2d5a57){_0xd77537=_0x2d5a57;_0x27e54d=0xc8;}else{_0x27e54d=0xce;}_0x411ee0[_0xc1dc('0x28')](_0x27e54d);return _0x411ee0[_0xc1dc('0x2e')](_0xc1dc('0x2f'),_0x25b7bf+'-'+_0xd77537+'/'+_0x2d5a57)['json'](_0x5dbd36);}return null;};}function patchUpdates(_0x376e95){return function(_0x317f87){try{jsonpatch[_0xc1dc('0x30')](_0x317f87,_0x376e95,!![]);}catch(_0x18305e){return BPromise[_0xc1dc('0x31')](_0x18305e);}return _0x317f87[_0xc1dc('0x32')]();};}function saveUpdates(_0x202903,_0x9a8ca0){return function(_0xc1e07e){if(_0xc1e07e){return _0xc1e07e['update'](_0x202903)['then'](function(_0x3ae791){return _0x3ae791;});}return null;};}function removeEntity(_0x120e73,_0x1d02ec){return function(_0xcb8634){if(_0xcb8634){return _0xcb8634[_0xc1dc('0x33')]()[_0xc1dc('0x1e')](function(){_0x120e73['status'](0xcc)[_0xc1dc('0x29')]();});}};}function handleEntityNotFound(_0x40f76e,_0x5ab0a4){return function(_0x280050){if(!_0x280050){_0x40f76e[_0xc1dc('0x34')](0x194);}return _0x280050;};}function handleError(_0x55376e,_0x1e279d){_0x1e279d=_0x1e279d||0x1f4;return function(_0x8bf56c){logger[_0xc1dc('0x22')](_0x8bf56c['stack']);if(_0x8bf56c[_0xc1dc('0x35')]){delete _0x8bf56c[_0xc1dc('0x35')];}_0x55376e[_0xc1dc('0x28')](_0x1e279d)[_0xc1dc('0x36')](_0x8bf56c);};}exports[_0xc1dc('0x37')]=function(_0x251bd0,_0x2dcc63){var _0x796d11={},_0x3dbb8c={},_0x4e3051={'count':0x0,'rows':[]};var _0x8b8598=_[_0xc1dc('0x38')](db[_0xc1dc('0x39')]['rawAttributes'],function(_0x19bde9){return{'name':_0x19bde9[_0xc1dc('0x3a')],'type':_0x19bde9[_0xc1dc('0x3b')][_0xc1dc('0x3c')]};});_0x3dbb8c[_0xc1dc('0x3d')]=_[_0xc1dc('0x38')](_0x8b8598,_0xc1dc('0x35'));_0x3dbb8c[_0xc1dc('0x3e')]=_['keys'](_0x251bd0[_0xc1dc('0x3e')]);_0x3dbb8c[_0xc1dc('0x3f')]=_[_0xc1dc('0x40')](_0x3dbb8c[_0xc1dc('0x3d')],_0x3dbb8c[_0xc1dc('0x3e')]);_0x796d11[_0xc1dc('0x41')]=_['intersection'](_0x3dbb8c[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x42')]));_0x796d11[_0xc1dc('0x41')]=_0x796d11['attributes']['length']?_0x796d11[_0xc1dc('0x41')]:_0x3dbb8c[_0xc1dc('0x3d')];if(!_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x43')](_0xc1dc('0x44'))){_0x796d11[_0xc1dc('0x2d')]=qs[_0xc1dc('0x2d')](_0x251bd0['query'][_0xc1dc('0x2d')]);_0x796d11[_0xc1dc('0x2c')]=qs[_0xc1dc('0x2c')](_0x251bd0['query'][_0xc1dc('0x2c')]);}_0x796d11[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x251bd0[_0xc1dc('0x3e')]['sort']);_0x796d11['where']=qs[_0xc1dc('0x3f')](_[_0xc1dc('0x47')](_0x251bd0['query'],_0x3dbb8c[_0xc1dc('0x3f')]));if(_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x48')]){_0x796d11[_0xc1dc('0x49')]=_[_0xc1dc('0x4a')](_0x796d11[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x8b8598,function(_0x54bb1f){if(_0x54bb1f['type']!==_0xc1dc('0x4b')){var _0x4846e2={};_0x4846e2[_0x54bb1f[_0xc1dc('0x35')]]={'$like':'%'+_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x48')]+'%'};return _0x4846e2;}})});}_0x796d11=_[_0xc1dc('0x4a')]({},_0x796d11,_0x251bd0[_0xc1dc('0x4c')]);var _0x40eb12={'where':_0x796d11[_0xc1dc('0x49')]};return db[_0xc1dc('0x39')]['count'](_0x40eb12)[_0xc1dc('0x1e')](function(_0x2dc9d6){_0x4e3051[_0xc1dc('0x2b')]=_0x2dc9d6;if(_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x4d')]){_0x796d11[_0xc1dc('0x4e')]=[{'all':!![]}];}return db[_0xc1dc('0x39')][_0xc1dc('0x4f')](_0x796d11);})[_0xc1dc('0x1e')](function(_0x29417d){_0x4e3051['rows']=_0x29417d;return _0x4e3051;})['then'](respondWithFilteredResult(_0x2dcc63,_0x796d11))['catch'](handleError(_0x2dcc63,null));};exports[_0xc1dc('0x50')]=function(_0x1d975b,_0x57b792){var _0x129e23={'raw':![],'where':{'id':_0x1d975b['params']['id']}},_0x6ab7fc={};_0x6ab7fc[_0xc1dc('0x3d')]=_['keys'](db[_0xc1dc('0x39')][_0xc1dc('0x51')]);_0x6ab7fc[_0xc1dc('0x3e')]=_[_0xc1dc('0x52')](_0x1d975b[_0xc1dc('0x3e')]);_0x6ab7fc[_0xc1dc('0x3f')]=_[_0xc1dc('0x40')](_0x6ab7fc[_0xc1dc('0x3d')],_0x6ab7fc['query']);_0x129e23[_0xc1dc('0x41')]=_[_0xc1dc('0x40')](_0x6ab7fc[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x1d975b['query'][_0xc1dc('0x42')]));_0x129e23[_0xc1dc('0x41')]=_0x129e23[_0xc1dc('0x41')][_0xc1dc('0x53')]?_0x129e23[_0xc1dc('0x41')]:_0x6ab7fc[_0xc1dc('0x3d')];if(_0x1d975b[_0xc1dc('0x3e')][_0xc1dc('0x4d')]){_0x129e23['include']=[{'all':!![]}];}_0x129e23=_[_0xc1dc('0x4a')]({},_0x129e23,_0x1d975b[_0xc1dc('0x4c')]);return db[_0xc1dc('0x39')][_0xc1dc('0x54')](_0x129e23)[_0xc1dc('0x1e')](handleEntityNotFound(_0x57b792,null))[_0xc1dc('0x1e')](respondWithResult(_0x57b792,null))[_0xc1dc('0x27')](handleError(_0x57b792,null));};exports['create']=function(_0x11cc45,_0xfdb531){return db[_0xc1dc('0x39')][_0xc1dc('0x55')](_0x11cc45[_0xc1dc('0x56')],{})[_0xc1dc('0x1e')](respondWithResult(_0xfdb531,0xc9))[_0xc1dc('0x27')](handleError(_0xfdb531,null));};exports[_0xc1dc('0x57')]=function(_0x9bce20,_0x523c3e){if(_0x9bce20[_0xc1dc('0x56')]['id']){delete _0x9bce20['body']['id'];}return db[_0xc1dc('0x39')][_0xc1dc('0x54')]({'where':{'id':_0x9bce20[_0xc1dc('0x58')]['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x523c3e,null))[_0xc1dc('0x1e')](saveUpdates(_0x9bce20[_0xc1dc('0x56')],null))[_0xc1dc('0x1e')](respondWithResult(_0x523c3e,null))['catch'](handleError(_0x523c3e,null));};exports[_0xc1dc('0x33')]=function(_0xac883c,_0x534fb4){return db['FreshsalesConfiguration'][_0xc1dc('0x54')]({'where':{'id':_0xac883c[_0xc1dc('0x58')]['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x534fb4,null))[_0xc1dc('0x1e')](removeEntity(_0x534fb4,null))['catch'](handleError(_0x534fb4,null));};exports['getSubjects']=function(_0x243463,_0x46bb33,_0x32e20f){var _0x509607={};var _0x231907={};var _0x3c5b93;var _0x2947db;return db[_0xc1dc('0x39')][_0xc1dc('0x59')]({'where':{'id':_0x243463['params']['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x46bb33,null))[_0xc1dc('0x1e')](function(_0x1b95d7){if(_0x1b95d7){_0x3c5b93=_0x1b95d7;_0x231907[_0xc1dc('0x3d')]=_[_0xc1dc('0x52')](db[_0xc1dc('0x5a')][_0xc1dc('0x51')]);_0x231907[_0xc1dc('0x3e')]=_[_0xc1dc('0x52')](_0x243463['query']);_0x231907['filters']=_[_0xc1dc('0x40')](_0x231907[_0xc1dc('0x3d')],_0x231907[_0xc1dc('0x3e')]);_0x509607[_0xc1dc('0x41')]=_[_0xc1dc('0x40')](_0x231907[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x243463[_0xc1dc('0x3e')][_0xc1dc('0x42')]));_0x509607[_0xc1dc('0x41')]=_0x509607[_0xc1dc('0x41')][_0xc1dc('0x53')]?_0x509607[_0xc1dc('0x41')]:_0x231907[_0xc1dc('0x3d')];_0x509607[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x243463[_0xc1dc('0x3e')][_0xc1dc('0x46')]);_0x509607[_0xc1dc('0x49')]=qs['filters'](_[_0xc1dc('0x47')](_0x243463[_0xc1dc('0x3e')],_0x231907[_0xc1dc('0x3f')]));if(_0x243463['query']['filter']){_0x509607[_0xc1dc('0x49')]=_['merge'](_0x509607[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x509607[_0xc1dc('0x41')],function(_0x425eda){var _0x4f5c32={};_0x4f5c32[_0x425eda]={'$like':'%'+_0x243463['query'][_0xc1dc('0x48')]+'%'};return _0x4f5c32;})});}_0x509607=_[_0xc1dc('0x4a')]({},_0x509607,_0x243463[_0xc1dc('0x4c')]);return _0x3c5b93[_0xc1dc('0x5b')](_0x509607);}})[_0xc1dc('0x1e')](function(_0x38c10e){if(_0x38c10e){_0x2947db=_0x38c10e[_0xc1dc('0x53')];if(!_0x243463['query'][_0xc1dc('0x43')]('nolimit')){_0x509607[_0xc1dc('0x2d')]=qs[_0xc1dc('0x2d')](_0x243463['query'][_0xc1dc('0x2d')]);_0x509607[_0xc1dc('0x2c')]=qs['offset'](_0x243463[_0xc1dc('0x3e')][_0xc1dc('0x2c')]);}return _0x3c5b93['getSubjects'](_0x509607);}})[_0xc1dc('0x1e')](function(_0x3df636){if(_0x3df636){return _0x3df636?{'count':_0x2947db,'rows':_0x3df636}:null;}})[_0xc1dc('0x1e')](respondWithResult(_0x46bb33,null))[_0xc1dc('0x27')](handleError(_0x46bb33,null));};exports[_0xc1dc('0x5c')]=function(_0x188e1c,_0x8fa4af,_0x162874){var _0x4e51c7={};var _0x28b7e1={};var _0x5c691d;var _0x27c19c;return db['FreshsalesConfiguration'][_0xc1dc('0x59')]({'where':{'id':_0x188e1c[_0xc1dc('0x58')]['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x8fa4af,null))[_0xc1dc('0x1e')](function(_0x3db030){if(_0x3db030){_0x5c691d=_0x3db030;_0x28b7e1['model']=_['keys'](db[_0xc1dc('0x5a')]['rawAttributes']);_0x28b7e1[_0xc1dc('0x3e')]=_[_0xc1dc('0x52')](_0x188e1c[_0xc1dc('0x3e')]);_0x28b7e1['filters']=_[_0xc1dc('0x40')](_0x28b7e1['model'],_0x28b7e1[_0xc1dc('0x3e')]);_0x4e51c7[_0xc1dc('0x41')]=_[_0xc1dc('0x40')](_0x28b7e1['model'],qs[_0xc1dc('0x42')](_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x42')]));_0x4e51c7['attributes']=_0x4e51c7['attributes'][_0xc1dc('0x53')]?_0x4e51c7[_0xc1dc('0x41')]:_0x28b7e1[_0xc1dc('0x3d')];_0x4e51c7[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x46')]);_0x4e51c7['where']=qs[_0xc1dc('0x3f')](_[_0xc1dc('0x47')](_0x188e1c[_0xc1dc('0x3e')],_0x28b7e1[_0xc1dc('0x3f')]));if(_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x48')]){_0x4e51c7[_0xc1dc('0x49')]=_[_0xc1dc('0x4a')](_0x4e51c7[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x4e51c7[_0xc1dc('0x41')],function(_0x3a118f){var _0x4b5d3e={};_0x4b5d3e[_0x3a118f]={'$like':'%'+_0x188e1c['query']['filter']+'%'};return _0x4b5d3e;})});}_0x4e51c7=_['merge']({},_0x4e51c7,_0x188e1c['options']);return _0x5c691d[_0xc1dc('0x5c')](_0x4e51c7);}})['then'](function(_0x3074b4){if(_0x3074b4){_0x27c19c=_0x3074b4[_0xc1dc('0x53')];if(!_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x43')](_0xc1dc('0x44'))){_0x4e51c7['limit']=qs['limit'](_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x2d')]);_0x4e51c7['offset']=qs[_0xc1dc('0x2c')](_0x188e1c['query']['offset']);}return _0x5c691d['getDescriptions'](_0x4e51c7);}})['then'](function(_0x43634f){if(_0x43634f){return _0x43634f?{'count':_0x27c19c,'rows':_0x43634f}:null;}})['then'](respondWithResult(_0x8fa4af,null))[_0xc1dc('0x27')](handleError(_0x8fa4af,null));};exports[_0xc1dc('0x5d')]=function(_0x5df8b0,_0x2efa59,_0x31f9bc){var _0x240c15={};var _0x255314={};var _0x2cb268;var _0x4b0a7d;return db[_0xc1dc('0x39')]['findOne']({'where':{'id':_0x5df8b0['params']['id']}})['then'](handleEntityNotFound(_0x2efa59,null))[_0xc1dc('0x1e')](function(_0x1855dc){if(_0x1855dc){_0x2cb268=_0x1855dc;_0x255314[_0xc1dc('0x3d')]=_[_0xc1dc('0x52')](db[_0xc1dc('0x5a')][_0xc1dc('0x51')]);_0x255314[_0xc1dc('0x3e')]=_['keys'](_0x5df8b0[_0xc1dc('0x3e')]);_0x255314[_0xc1dc('0x3f')]=_[_0xc1dc('0x40')](_0x255314[_0xc1dc('0x3d')],_0x255314[_0xc1dc('0x3e')]);_0x240c15[_0xc1dc('0x41')]=_['intersection'](_0x255314[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x5df8b0['query']['fields']));_0x240c15[_0xc1dc('0x41')]=_0x240c15[_0xc1dc('0x41')][_0xc1dc('0x53')]?_0x240c15[_0xc1dc('0x41')]:_0x255314[_0xc1dc('0x3d')];_0x240c15[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x5df8b0['query']['sort']);_0x240c15[_0xc1dc('0x49')]=qs['filters'](_[_0xc1dc('0x47')](_0x5df8b0[_0xc1dc('0x3e')],_0x255314[_0xc1dc('0x3f')]));if(_0x5df8b0['query'][_0xc1dc('0x48')]){_0x240c15[_0xc1dc('0x49')]=_[_0xc1dc('0x4a')](_0x240c15[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x240c15['attributes'],function(_0x4001dd){var _0x14dc01={};_0x14dc01[_0x4001dd]={'$like':'%'+_0x5df8b0['query'][_0xc1dc('0x48')]+'%'};return _0x14dc01;})});}_0x240c15=_[_0xc1dc('0x4a')]({},_0x240c15,_0x5df8b0[_0xc1dc('0x4c')]);return _0x2cb268['getFields'](_0x240c15);}})['then'](function(_0x507753){if(_0x507753){_0x4b0a7d=_0x507753['length'];if(!_0x5df8b0[_0xc1dc('0x3e')][_0xc1dc('0x43')](_0xc1dc('0x44'))){_0x240c15[_0xc1dc('0x2d')]=qs[_0xc1dc('0x2d')](_0x5df8b0[_0xc1dc('0x3e')]['limit']);_0x240c15[_0xc1dc('0x2c')]=qs[_0xc1dc('0x2c')](_0x5df8b0[_0xc1dc('0x3e')]['offset']);}return _0x2cb268['getFields'](_0x240c15);}})[_0xc1dc('0x1e')](function(_0x2a1d69){if(_0x2a1d69){return _0x2a1d69?{'count':_0x4b0a7d,'rows':_0x2a1d69}:null;}})[_0xc1dc('0x1e')](respondWithResult(_0x2efa59,null))[_0xc1dc('0x27')](handleError(_0x2efa59,null));}; \ No newline at end of file +var _0x9505=['html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','map','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','FreshsalesConfiguration','then','includeAll','rows','show','params','keys','rawAttributes','include','create','body','find','findOne','FreshsalesField','nolimit','getSubjects','getDescriptions','getFields'];(function(_0x19e425,_0x7f53c0){var _0x220e1d=function(_0x824c8){while(--_0x824c8){_0x19e425['push'](_0x19e425['shift']());}};_0x220e1d(++_0x7f53c0);}(_0x9505,0x1e5));var _0x5950=function(_0x4449c4,_0x23eb0e){_0x4449c4=_0x4449c4-0x0;var _0x49033a=_0x9505[_0x4449c4];return _0x49033a;};'use strict';var pdf=require(_0x5950('0x0'));var emlformat=require(_0x5950('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5950('0x2'));var jsonpatch=require(_0x5950('0x3'));var rp=require(_0x5950('0x4'));var moment=require(_0x5950('0x5'));var BPromise=require(_0x5950('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5950('0x7'));var sox=require(_0x5950('0x8'));var csv=require(_0x5950('0x9'));var ejs=require(_0x5950('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5950('0xb'));var jsforce=require(_0x5950('0xc'));var deskjs=require(_0x5950('0xd'));var toCsv=require(_0x5950('0x9'));var querystring=require(_0x5950('0xe'));var Papa=require(_0x5950('0xf'));var Redis=require(_0x5950('0x10'));var authService=require(_0x5950('0x11'));var qs=require(_0x5950('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5950('0x13'));var logger=require(_0x5950('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x5950('0x15'));var db=require(_0x5950('0x16'))['db'];var jayson=require(_0x5950('0x17'));var client=jayson[_0x5950('0x18')][_0x5950('0x19')]({'port':0x232a});function checkPasswordPattern(_0x2bf7ae,_0x17c263,_0x38d757){if(_0x38d757){var _0x409092=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x409092[_0x5950('0x1a')](_0x17c263)){return _0x2bf7ae;}else{throw new db[(_0x5950('0x1b'))][(_0x5950('0x1c'))](_0x5950('0x1d'));}}else{return _0x2bf7ae;}}function respondWithRpcPromise(_0x3f1b9b,_0x5e9dd5,_0xa6c598,_0x4ad4d8){return new BPromise(function(_0x3c469d,_0x26f3c3){var _0x10839e=_0x4ad4d8||client;return _0x10839e[_0x5950('0x1e')](_0x3f1b9b,_0xa6c598)['then'](function(_0x5a99e8){logger[_0x5950('0x1f')](_0x5950('0x20'),_0x5e9dd5,_0x5950('0x21'));logger[_0x5950('0x22')](_0x5950('0x23'),_0x5e9dd5,'request\x20sent',JSON['stringify'](_0x5a99e8));if(_0x5a99e8[_0x5950('0x24')]){if(_0x5a99e8[_0x5950('0x24')][_0x5950('0x25')]===0x1f4){logger['error'](_0x5950('0x20'),_0x5e9dd5,_0x5a99e8[_0x5950('0x24')]['message']);return _0x26f3c3(_0x5a99e8['error']['message']);}logger['error'](_0x5950('0x20'),_0x5e9dd5,_0x5a99e8[_0x5950('0x24')][_0x5950('0x26')]);return _0x3c469d(_0x5a99e8[_0x5950('0x24')]['message']);}else{logger[_0x5950('0x1f')](_0x5950('0x20'),_0x5e9dd5,_0x5950('0x21'));_0x3c469d(_0x5a99e8[_0x5950('0x27')][_0x5950('0x26')]);}})[_0x5950('0x28')](function(_0x4683fc){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x5e9dd5,_0x4683fc);_0x26f3c3(_0x4683fc);});});}function respondWithStatusCode(_0x1b2265,_0x32c197){_0x32c197=_0x32c197||0xcc;return function(_0x545354){if(_0x545354){return _0x1b2265[_0x5950('0x29')](_0x32c197);}return _0x1b2265[_0x5950('0x2a')](_0x32c197)['end']();};}function respondWithResult(_0x4a7b22,_0x4d6368){_0x4d6368=_0x4d6368||0xc8;return function(_0x20679e){if(_0x20679e){return _0x4a7b22[_0x5950('0x2a')](_0x4d6368)[_0x5950('0x2b')](_0x20679e);}};}function respondWithFilteredResult(_0x3b91f6,_0x3923dd){return function(_0x170084){if(_0x170084){var _0x2ff8a3=_0x170084[_0x5950('0x2c')],_0x2dfd08=_0x3923dd[_0x5950('0x2d')],_0x179b24=_0x3923dd[_0x5950('0x2d')]+_0x3923dd[_0x5950('0x2e')],_0x3a3cc0;if(_0x179b24>=_0x2ff8a3){_0x179b24=_0x2ff8a3;_0x3a3cc0=0xc8;}else{_0x3a3cc0=0xce;}_0x3b91f6[_0x5950('0x2a')](_0x3a3cc0);return _0x3b91f6[_0x5950('0x2f')](_0x5950('0x30'),_0x2dfd08+'-'+_0x179b24+'/'+_0x2ff8a3)[_0x5950('0x2b')](_0x170084);}return null;};}function patchUpdates(_0x33aa23){return function(_0x625135){try{jsonpatch[_0x5950('0x31')](_0x625135,_0x33aa23,!![]);}catch(_0x317947){return BPromise[_0x5950('0x32')](_0x317947);}return _0x625135[_0x5950('0x33')]();};}function saveUpdates(_0x26fafc,_0x46ba0c){return function(_0x40d2ad){if(_0x40d2ad){return _0x40d2ad[_0x5950('0x34')](_0x26fafc)['then'](function(_0x9e425f){return _0x9e425f;});}return null;};}function removeEntity(_0x391a41,_0x27aa43){return function(_0x31a4e6){if(_0x31a4e6){return _0x31a4e6[_0x5950('0x35')]()['then'](function(){_0x391a41['status'](0xcc)[_0x5950('0x36')]();});}};}function handleEntityNotFound(_0x3c44fa,_0x55ab95){return function(_0x411728){if(!_0x411728){_0x3c44fa['sendStatus'](0x194);}return _0x411728;};}function handleError(_0x10fbe2,_0x342607){_0x342607=_0x342607||0x1f4;return function(_0x376d9f){logger['error'](_0x376d9f[_0x5950('0x37')]);if(_0x376d9f['name']){delete _0x376d9f[_0x5950('0x38')];}_0x10fbe2[_0x5950('0x2a')](_0x342607)[_0x5950('0x39')](_0x376d9f);};}exports[_0x5950('0x3a')]=function(_0x5f12b6,_0x478108){var _0x2d8766={},_0x264e8f={},_0x4ad1e0={'count':0x0,'rows':[]};var _0x1a75ce=_[_0x5950('0x3b')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x57c990){return{'name':_0x57c990[_0x5950('0x3c')],'type':_0x57c990[_0x5950('0x3d')][_0x5950('0x3e')]};});_0x264e8f[_0x5950('0x3f')]=_[_0x5950('0x3b')](_0x1a75ce,'name');_0x264e8f['query']=_['keys'](_0x5f12b6['query']);_0x264e8f[_0x5950('0x40')]=_[_0x5950('0x41')](_0x264e8f[_0x5950('0x3f')],_0x264e8f[_0x5950('0x42')]);_0x2d8766['attributes']=_[_0x5950('0x41')](_0x264e8f[_0x5950('0x3f')],qs['fields'](_0x5f12b6[_0x5950('0x42')][_0x5950('0x43')]));_0x2d8766[_0x5950('0x44')]=_0x2d8766[_0x5950('0x44')][_0x5950('0x45')]?_0x2d8766[_0x5950('0x44')]:_0x264e8f[_0x5950('0x3f')];if(!_0x5f12b6['query'][_0x5950('0x46')]('nolimit')){_0x2d8766[_0x5950('0x2e')]=qs[_0x5950('0x2e')](_0x5f12b6['query'][_0x5950('0x2e')]);_0x2d8766[_0x5950('0x2d')]=qs[_0x5950('0x2d')](_0x5f12b6[_0x5950('0x42')]['offset']);}_0x2d8766[_0x5950('0x47')]=qs[_0x5950('0x48')](_0x5f12b6[_0x5950('0x42')][_0x5950('0x48')]);_0x2d8766['where']=qs[_0x5950('0x40')](_[_0x5950('0x49')](_0x5f12b6[_0x5950('0x42')],_0x264e8f['filters']));if(_0x5f12b6[_0x5950('0x42')]['filter']){_0x2d8766[_0x5950('0x4a')]=_[_0x5950('0x4b')](_0x2d8766[_0x5950('0x4a')],{'$or':_[_0x5950('0x3b')](_0x1a75ce,function(_0x391a01){if(_0x391a01[_0x5950('0x3d')]!==_0x5950('0x4c')){var _0x599f37={};_0x599f37[_0x391a01[_0x5950('0x38')]]={'$like':'%'+_0x5f12b6[_0x5950('0x42')][_0x5950('0x4d')]+'%'};return _0x599f37;}})});}_0x2d8766=_[_0x5950('0x4b')]({},_0x2d8766,_0x5f12b6[_0x5950('0x4e')]);var _0x52ba16={'where':_0x2d8766['where']};return db[_0x5950('0x4f')][_0x5950('0x2c')](_0x52ba16)[_0x5950('0x50')](function(_0x4e560f){_0x4ad1e0[_0x5950('0x2c')]=_0x4e560f;if(_0x5f12b6[_0x5950('0x42')][_0x5950('0x51')]){_0x2d8766['include']=[{'all':!![]}];}return db['FreshsalesConfiguration']['findAll'](_0x2d8766);})[_0x5950('0x50')](function(_0x459a42){_0x4ad1e0[_0x5950('0x52')]=_0x459a42;return _0x4ad1e0;})[_0x5950('0x50')](respondWithFilteredResult(_0x478108,_0x2d8766))[_0x5950('0x28')](handleError(_0x478108,null));};exports[_0x5950('0x53')]=function(_0x441ad5,_0x18c744){var _0x25d749={'raw':![],'where':{'id':_0x441ad5[_0x5950('0x54')]['id']}},_0x542132={};_0x542132[_0x5950('0x3f')]=_[_0x5950('0x55')](db[_0x5950('0x4f')][_0x5950('0x56')]);_0x542132[_0x5950('0x42')]=_[_0x5950('0x55')](_0x441ad5[_0x5950('0x42')]);_0x542132[_0x5950('0x40')]=_[_0x5950('0x41')](_0x542132['model'],_0x542132[_0x5950('0x42')]);_0x25d749[_0x5950('0x44')]=_[_0x5950('0x41')](_0x542132[_0x5950('0x3f')],qs['fields'](_0x441ad5['query'][_0x5950('0x43')]));_0x25d749[_0x5950('0x44')]=_0x25d749['attributes'][_0x5950('0x45')]?_0x25d749[_0x5950('0x44')]:_0x542132[_0x5950('0x3f')];if(_0x441ad5[_0x5950('0x42')][_0x5950('0x51')]){_0x25d749[_0x5950('0x57')]=[{'all':!![]}];}_0x25d749=_['merge']({},_0x25d749,_0x441ad5[_0x5950('0x4e')]);return db[_0x5950('0x4f')]['find'](_0x25d749)[_0x5950('0x50')](handleEntityNotFound(_0x18c744,null))[_0x5950('0x50')](respondWithResult(_0x18c744,null))[_0x5950('0x28')](handleError(_0x18c744,null));};exports['create']=function(_0x58b98a,_0x1b0c0f){return db[_0x5950('0x4f')][_0x5950('0x58')](_0x58b98a[_0x5950('0x59')],{})[_0x5950('0x50')](respondWithResult(_0x1b0c0f,0xc9))[_0x5950('0x28')](handleError(_0x1b0c0f,null));};exports[_0x5950('0x34')]=function(_0xcad9ef,_0x4e34b4){if(_0xcad9ef[_0x5950('0x59')]['id']){delete _0xcad9ef[_0x5950('0x59')]['id'];}return db[_0x5950('0x4f')][_0x5950('0x5a')]({'where':{'id':_0xcad9ef[_0x5950('0x54')]['id']}})[_0x5950('0x50')](handleEntityNotFound(_0x4e34b4,null))[_0x5950('0x50')](saveUpdates(_0xcad9ef['body'],null))[_0x5950('0x50')](respondWithResult(_0x4e34b4,null))['catch'](handleError(_0x4e34b4,null));};exports[_0x5950('0x35')]=function(_0x489f8c,_0x3632aa){return db[_0x5950('0x4f')]['find']({'where':{'id':_0x489f8c[_0x5950('0x54')]['id']}})['then'](handleEntityNotFound(_0x3632aa,null))[_0x5950('0x50')](removeEntity(_0x3632aa,null))[_0x5950('0x28')](handleError(_0x3632aa,null));};exports['getSubjects']=function(_0x5c743b,_0x34fc6e,_0x13fa9c){var _0x13d10d={};var _0x338edb={};var _0x3468cb;var _0x2ae261;return db[_0x5950('0x4f')][_0x5950('0x5b')]({'where':{'id':_0x5c743b['params']['id']}})['then'](handleEntityNotFound(_0x34fc6e,null))[_0x5950('0x50')](function(_0x5e5026){if(_0x5e5026){_0x3468cb=_0x5e5026;_0x338edb[_0x5950('0x3f')]=_[_0x5950('0x55')](db[_0x5950('0x5c')][_0x5950('0x56')]);_0x338edb[_0x5950('0x42')]=_['keys'](_0x5c743b[_0x5950('0x42')]);_0x338edb[_0x5950('0x40')]=_[_0x5950('0x41')](_0x338edb['model'],_0x338edb['query']);_0x13d10d[_0x5950('0x44')]=_['intersection'](_0x338edb[_0x5950('0x3f')],qs[_0x5950('0x43')](_0x5c743b['query'][_0x5950('0x43')]));_0x13d10d[_0x5950('0x44')]=_0x13d10d[_0x5950('0x44')][_0x5950('0x45')]?_0x13d10d[_0x5950('0x44')]:_0x338edb[_0x5950('0x3f')];_0x13d10d['order']=qs[_0x5950('0x48')](_0x5c743b[_0x5950('0x42')][_0x5950('0x48')]);_0x13d10d['where']=qs['filters'](_[_0x5950('0x49')](_0x5c743b[_0x5950('0x42')],_0x338edb[_0x5950('0x40')]));if(_0x5c743b[_0x5950('0x42')][_0x5950('0x4d')]){_0x13d10d[_0x5950('0x4a')]=_['merge'](_0x13d10d[_0x5950('0x4a')],{'$or':_[_0x5950('0x3b')](_0x13d10d[_0x5950('0x44')],function(_0x2ba557){var _0x5f036e={};_0x5f036e[_0x2ba557]={'$like':'%'+_0x5c743b[_0x5950('0x42')][_0x5950('0x4d')]+'%'};return _0x5f036e;})});}_0x13d10d=_['merge']({},_0x13d10d,_0x5c743b[_0x5950('0x4e')]);return _0x3468cb['getSubjects'](_0x13d10d);}})[_0x5950('0x50')](function(_0x48b780){if(_0x48b780){_0x2ae261=_0x48b780[_0x5950('0x45')];if(!_0x5c743b[_0x5950('0x42')]['hasOwnProperty'](_0x5950('0x5d'))){_0x13d10d[_0x5950('0x2e')]=qs[_0x5950('0x2e')](_0x5c743b['query'][_0x5950('0x2e')]);_0x13d10d[_0x5950('0x2d')]=qs[_0x5950('0x2d')](_0x5c743b[_0x5950('0x42')][_0x5950('0x2d')]);}return _0x3468cb[_0x5950('0x5e')](_0x13d10d);}})[_0x5950('0x50')](function(_0x192dbc){if(_0x192dbc){return _0x192dbc?{'count':_0x2ae261,'rows':_0x192dbc}:null;}})['then'](respondWithResult(_0x34fc6e,null))[_0x5950('0x28')](handleError(_0x34fc6e,null));};exports[_0x5950('0x5f')]=function(_0x44adf3,_0x3e8303,_0x4935c0){var _0x29bd2e={};var _0x3d2c59={};var _0xf3f0b0;var _0x1539a7;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x44adf3[_0x5950('0x54')]['id']}})['then'](handleEntityNotFound(_0x3e8303,null))[_0x5950('0x50')](function(_0x3cb897){if(_0x3cb897){_0xf3f0b0=_0x3cb897;_0x3d2c59[_0x5950('0x3f')]=_[_0x5950('0x55')](db[_0x5950('0x5c')]['rawAttributes']);_0x3d2c59[_0x5950('0x42')]=_[_0x5950('0x55')](_0x44adf3['query']);_0x3d2c59['filters']=_[_0x5950('0x41')](_0x3d2c59[_0x5950('0x3f')],_0x3d2c59[_0x5950('0x42')]);_0x29bd2e[_0x5950('0x44')]=_[_0x5950('0x41')](_0x3d2c59['model'],qs[_0x5950('0x43')](_0x44adf3[_0x5950('0x42')][_0x5950('0x43')]));_0x29bd2e[_0x5950('0x44')]=_0x29bd2e[_0x5950('0x44')][_0x5950('0x45')]?_0x29bd2e[_0x5950('0x44')]:_0x3d2c59[_0x5950('0x3f')];_0x29bd2e['order']=qs['sort'](_0x44adf3[_0x5950('0x42')][_0x5950('0x48')]);_0x29bd2e[_0x5950('0x4a')]=qs[_0x5950('0x40')](_[_0x5950('0x49')](_0x44adf3['query'],_0x3d2c59['filters']));if(_0x44adf3[_0x5950('0x42')][_0x5950('0x4d')]){_0x29bd2e['where']=_[_0x5950('0x4b')](_0x29bd2e[_0x5950('0x4a')],{'$or':_[_0x5950('0x3b')](_0x29bd2e[_0x5950('0x44')],function(_0x2ae77b){var _0x5497ac={};_0x5497ac[_0x2ae77b]={'$like':'%'+_0x44adf3[_0x5950('0x42')]['filter']+'%'};return _0x5497ac;})});}_0x29bd2e=_['merge']({},_0x29bd2e,_0x44adf3[_0x5950('0x4e')]);return _0xf3f0b0[_0x5950('0x5f')](_0x29bd2e);}})[_0x5950('0x50')](function(_0x51c557){if(_0x51c557){_0x1539a7=_0x51c557[_0x5950('0x45')];if(!_0x44adf3[_0x5950('0x42')][_0x5950('0x46')]('nolimit')){_0x29bd2e[_0x5950('0x2e')]=qs[_0x5950('0x2e')](_0x44adf3[_0x5950('0x42')][_0x5950('0x2e')]);_0x29bd2e[_0x5950('0x2d')]=qs[_0x5950('0x2d')](_0x44adf3[_0x5950('0x42')][_0x5950('0x2d')]);}return _0xf3f0b0['getDescriptions'](_0x29bd2e);}})[_0x5950('0x50')](function(_0x5e14ca){if(_0x5e14ca){return _0x5e14ca?{'count':_0x1539a7,'rows':_0x5e14ca}:null;}})[_0x5950('0x50')](respondWithResult(_0x3e8303,null))[_0x5950('0x28')](handleError(_0x3e8303,null));};exports[_0x5950('0x60')]=function(_0x3ed06b,_0x9e05a,_0x24e448){var _0x18e9f3={};var _0x56282a={};var _0x4796bf;var _0x705afc;return db[_0x5950('0x4f')][_0x5950('0x5b')]({'where':{'id':_0x3ed06b['params']['id']}})[_0x5950('0x50')](handleEntityNotFound(_0x9e05a,null))[_0x5950('0x50')](function(_0x516dd6){if(_0x516dd6){_0x4796bf=_0x516dd6;_0x56282a['model']=_[_0x5950('0x55')](db[_0x5950('0x5c')][_0x5950('0x56')]);_0x56282a[_0x5950('0x42')]=_[_0x5950('0x55')](_0x3ed06b['query']);_0x56282a['filters']=_[_0x5950('0x41')](_0x56282a['model'],_0x56282a[_0x5950('0x42')]);_0x18e9f3['attributes']=_['intersection'](_0x56282a[_0x5950('0x3f')],qs['fields'](_0x3ed06b[_0x5950('0x42')]['fields']));_0x18e9f3[_0x5950('0x44')]=_0x18e9f3['attributes'][_0x5950('0x45')]?_0x18e9f3[_0x5950('0x44')]:_0x56282a[_0x5950('0x3f')];_0x18e9f3[_0x5950('0x47')]=qs['sort'](_0x3ed06b[_0x5950('0x42')][_0x5950('0x48')]);_0x18e9f3['where']=qs[_0x5950('0x40')](_['pick'](_0x3ed06b[_0x5950('0x42')],_0x56282a[_0x5950('0x40')]));if(_0x3ed06b['query'][_0x5950('0x4d')]){_0x18e9f3['where']=_['merge'](_0x18e9f3['where'],{'$or':_[_0x5950('0x3b')](_0x18e9f3[_0x5950('0x44')],function(_0x185710){var _0x9e555d={};_0x9e555d[_0x185710]={'$like':'%'+_0x3ed06b[_0x5950('0x42')][_0x5950('0x4d')]+'%'};return _0x9e555d;})});}_0x18e9f3=_['merge']({},_0x18e9f3,_0x3ed06b['options']);return _0x4796bf[_0x5950('0x60')](_0x18e9f3);}})['then'](function(_0x42702d){if(_0x42702d){_0x705afc=_0x42702d['length'];if(!_0x3ed06b[_0x5950('0x42')][_0x5950('0x46')](_0x5950('0x5d'))){_0x18e9f3['limit']=qs[_0x5950('0x2e')](_0x3ed06b[_0x5950('0x42')][_0x5950('0x2e')]);_0x18e9f3['offset']=qs[_0x5950('0x2d')](_0x3ed06b['query'][_0x5950('0x2d')]);}return _0x4796bf[_0x5950('0x60')](_0x18e9f3);}})[_0x5950('0x50')](function(_0x24962e){if(_0x24962e){return _0x24962e?{'count':_0x705afc,'rows':_0x24962e}:null;}})['then'](respondWithResult(_0x9e05a,null))['catch'](handleError(_0x9e05a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 213850e..1ece342 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 _0x4561=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','api'];(function(_0x360dda,_0x29b816){var _0x1e4a98=function(_0x15f620){while(--_0x15f620){_0x360dda['push'](_0x360dda['shift']());}};_0x1e4a98(++_0x29b816);}(_0x4561,0x1a3));var _0x1456=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x4561[_0x3d1244];return _0x5d6372;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1456('0x0'));var moment=require('moment');var BPromise=require(_0x1456('0x1'));var rp=require(_0x1456('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1456('0x3'));var config=require(_0x1456('0x4'));var attributes=require(_0x1456('0x5'));module[_0x1456('0x6')]=function(_0xde8113,_0x4da317){return _0xde8113[_0x1456('0x7')](_0x1456('0x8'),attributes,{'tableName':_0x1456('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x86a8=['FreshsalesConfiguration','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intFreshsalesConfiguration.attributes','exports'];(function(_0x5c61d3,_0x2ffe64){var _0x44d5cc=function(_0xf50ca1){while(--_0xf50ca1){_0x5c61d3['push'](_0x5c61d3['shift']());}};_0x44d5cc(++_0x2ffe64);}(_0x86a8,0x1ae));var _0x886a=function(_0xb29f57,_0x5e4fd3){_0xb29f57=_0xb29f57-0x0;var _0x3b2c0e=_0x86a8[_0xb29f57];return _0x3b2c0e;};'use strict';var _=require(_0x886a('0x0'));var util=require(_0x886a('0x1'));var logger=require(_0x886a('0x2'))(_0x886a('0x3'));var moment=require(_0x886a('0x4'));var BPromise=require(_0x886a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x886a('0x6'));var rimraf=require(_0x886a('0x7'));var config=require('../../config/environment');var attributes=require(_0x886a('0x8'));module[_0x886a('0x9')]=function(_0x4ca54f,_0x223e04){return _0x4ca54f['define'](_0x886a('0xa'),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 104fc6c..e950d06 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 _0x77f1=['result','catch','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4d6e20,_0x4b7a6b){var _0x398ba5=function(_0x4bb6e6){while(--_0x4bb6e6){_0x4d6e20['push'](_0x4d6e20['shift']());}};_0x398ba5(++_0x4b7a6b);}(_0x77f1,0x1dd));var _0x177f=function(_0x50ad4b,_0x254a2d){_0x50ad4b=_0x50ad4b-0x0;var _0x3bdaf2=_0x77f1[_0x50ad4b];return _0x3bdaf2;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var moment=require(_0x177f('0x1'));var BPromise=require(_0x177f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x177f('0x3'));var logger=require(_0x177f('0x4'))('rpc');var config=require(_0x177f('0x5'));var jayson=require(_0x177f('0x6'));var client=jayson[_0x177f('0x7')][_0x177f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bd6b3,_0x58525a,_0x3f43c1){return new BPromise(function(_0xbbdec1,_0x480125){return client[_0x177f('0x9')](_0x1bd6b3,_0x3f43c1)['then'](function(_0x2652b4){logger['info'](_0x177f('0xa'),_0x58525a,_0x177f('0xb'));logger['debug'](_0x177f('0xc'),_0x58525a,_0x177f('0xb'),JSON[_0x177f('0xd')](_0x2652b4));if(_0x2652b4[_0x177f('0xe')]){if(_0x2652b4[_0x177f('0xe')][_0x177f('0xf')]===0x1f4){logger[_0x177f('0xe')](_0x177f('0xa'),_0x58525a,_0x2652b4['error'][_0x177f('0x10')]);return _0x480125(_0x2652b4[_0x177f('0xe')][_0x177f('0x10')]);}logger[_0x177f('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x58525a,_0x2652b4[_0x177f('0xe')][_0x177f('0x10')]);return _0xbbdec1(_0x2652b4[_0x177f('0xe')]['message']);}else{logger['info'](_0x177f('0xa'),_0x58525a,_0x177f('0xb'));_0xbbdec1(_0x2652b4[_0x177f('0x11')][_0x177f('0x10')]);}})[_0x177f('0x12')](function(_0x1c3e06){logger[_0x177f('0xe')](_0x177f('0xa'),_0x58525a,_0x1c3e06);_0x480125(_0x1c3e06);});});} \ No newline at end of file +var _0xd547=['bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','catch','moment'];(function(_0x58b8bf,_0x5a2ef1){var _0x3dd28b=function(_0x4becaa){while(--_0x4becaa){_0x58b8bf['push'](_0x58b8bf['shift']());}};_0x3dd28b(++_0x5a2ef1);}(_0xd547,0x1c1));var _0x7d54=function(_0xa6a23e,_0x8b657a){_0xa6a23e=_0xa6a23e-0x0;var _0x210e65=_0xd547[_0xa6a23e];return _0x210e65;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7d54('0x0'));var BPromise=require(_0x7d54('0x1'));var rs=require(_0x7d54('0x2'));var fs=require('fs');var Redis=require(_0x7d54('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7d54('0x4'))('rpc');var config=require(_0x7d54('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7d54('0x6')][_0x7d54('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1b7fc1,_0x5186ae,_0x5b0b16){return new BPromise(function(_0x478f9b,_0xb224a9){return client[_0x7d54('0x8')](_0x1b7fc1,_0x5b0b16)['then'](function(_0xa5b980){logger['info'](_0x7d54('0x9'),_0x5186ae,'request\x20sent');logger[_0x7d54('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x5186ae,_0x7d54('0xb'),JSON[_0x7d54('0xc')](_0xa5b980));if(_0xa5b980['error']){if(_0xa5b980['error']['code']===0x1f4){logger[_0x7d54('0xd')](_0x7d54('0x9'),_0x5186ae,_0xa5b980[_0x7d54('0xd')]['message']);return _0xb224a9(_0xa5b980[_0x7d54('0xd')]['message']);}logger[_0x7d54('0xd')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x5186ae,_0xa5b980[_0x7d54('0xd')][_0x7d54('0xe')]);return _0x478f9b(_0xa5b980['error'][_0x7d54('0xe')]);}else{logger[_0x7d54('0xf')](_0x7d54('0x9'),_0x5186ae,'request\x20sent');_0x478f9b(_0xa5b980[_0x7d54('0x10')][_0x7d54('0xe')]);}})[_0x7d54('0x11')](function(_0x12c48d){logger[_0x7d54('0xd')](_0x7d54('0x9'),_0x5186ae,_0x12c48d);_0xb224a9(_0x12c48d);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ea3f0a3..fba093e 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 _0x1e58=['express','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x1e58,0x11d));var _0x81e5=function(_0x1c6c43,_0x314b40){_0x1c6c43=_0x1c6c43-0x0;var _0x390b54=_0x1e58[_0x1c6c43];return _0x390b54;};'use strict';var multer=require(_0x81e5('0x0'));var util=require(_0x81e5('0x1'));var path=require('path');var timeout=require(_0x81e5('0x2'));var express=require(_0x81e5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x81e5('0x4'));var config=require(_0x81e5('0x5'));var controller=require(_0x81e5('0x6'));router[_0x81e5('0x7')]('/',auth[_0x81e5('0x8')](),controller[_0x81e5('0x9')]);router[_0x81e5('0x7')]('/:id',auth[_0x81e5('0x8')](),controller[_0x81e5('0xa')]);router[_0x81e5('0xb')]('/',auth['isAuthenticated'](),controller[_0x81e5('0xc')]);router[_0x81e5('0xd')]('/:id',auth[_0x81e5('0x8')](),controller[_0x81e5('0xe')]);router['delete'](_0x81e5('0xf'),auth[_0x81e5('0x8')](),controller[_0x81e5('0x10')]);module[_0x81e5('0x11')]=router; \ No newline at end of file +var _0x7b62=['post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xf5b5ff,_0x503a3f){var _0x4e032a=function(_0x500fbd){while(--_0x500fbd){_0xf5b5ff['push'](_0xf5b5ff['shift']());}};_0x4e032a(++_0x503a3f);}(_0x7b62,0x6a));var _0x27b6=function(_0x28e411,_0x91c58e){_0x28e411=_0x28e411-0x0;var _0x4eedc6=_0x7b62[_0x28e411];return _0x4eedc6;};'use strict';var multer=require(_0x27b6('0x0'));var util=require(_0x27b6('0x1'));var path=require(_0x27b6('0x2'));var timeout=require('connect-timeout');var express=require(_0x27b6('0x3'));var router=express[_0x27b6('0x4')]();var auth=require(_0x27b6('0x5'));var interaction=require(_0x27b6('0x6'));var config=require(_0x27b6('0x7'));var controller=require(_0x27b6('0x8'));router[_0x27b6('0x9')]('/',auth[_0x27b6('0xa')](),controller[_0x27b6('0xb')]);router[_0x27b6('0x9')](_0x27b6('0xc'),auth[_0x27b6('0xa')](),controller[_0x27b6('0xd')]);router[_0x27b6('0xe')]('/',auth[_0x27b6('0xa')](),controller[_0x27b6('0xf')]);router[_0x27b6('0x10')](_0x27b6('0xc'),auth['isAuthenticated'](),controller[_0x27b6('0x11')]);router[_0x27b6('0x12')](_0x27b6('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x27b6('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e18d5f8..edc571d 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 _0x4435=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x274c7f,_0x35af30){var _0x120b90=function(_0x10664e){while(--_0x10664e){_0x274c7f['push'](_0x274c7f['shift']());}};_0x120b90(++_0x35af30);}(_0x4435,0x136));var _0x5443=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4435[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x5443('0x0'));module['exports']={'type':{'type':Sequelize[_0x5443('0x1')](_0x5443('0x2'),_0x5443('0x3'),_0x5443('0x4'),'keyValue'),'defaultValue':_0x5443('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5443('0x1')]('string','variable',_0x5443('0x4'))},'keyContent':{'type':Sequelize[_0x5443('0x5')]},'idField':{'type':Sequelize[_0x5443('0x5')]},'nameField':{'type':Sequelize[_0x5443('0x5')]},'customField':{'type':Sequelize[_0x5443('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5443('0x5')]}}; \ No newline at end of file +var _0x05d9=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x1ec960,_0x5a4e93){var _0x2d0797=function(_0x562bae){while(--_0x562bae){_0x1ec960['push'](_0x1ec960['shift']());}};_0x2d0797(++_0x5a4e93);}(_0x05d9,0x1b3));var _0x905d=function(_0x5b272d,_0x2f6ec8){_0x5b272d=_0x5b272d-0x0;var _0x4750cf=_0x05d9[_0x5b272d];return _0x4750cf;};'use strict';var Sequelize=require(_0x905d('0x0'));module[_0x905d('0x1')]={'type':{'type':Sequelize[_0x905d('0x2')](_0x905d('0x3'),_0x905d('0x4'),_0x905d('0x5'),_0x905d('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x905d('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x905d('0x2')](_0x905d('0x3'),'variable',_0x905d('0x5'))},'keyContent':{'type':Sequelize[_0x905d('0x7')]},'idField':{'type':Sequelize[_0x905d('0x7')]},'nameField':{'type':Sequelize[_0x905d('0x7')]},'customField':{'type':Sequelize[_0x905d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x905d('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 7923bec..7c0fb4b 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 _0xf4eb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','apply','save','update','then','destroy','sendStatus','error','stack','name','FreshsalesField','rawAttributes','type','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse'];(function(_0x35f6db,_0x510770){var _0x3c0474=function(_0x4a93e4){while(--_0x4a93e4){_0x35f6db['push'](_0x35f6db['shift']());}};_0x3c0474(++_0x510770);}(_0xf4eb,0xec));var _0xbf4e=function(_0xa68518,_0xa06fc6){_0xa68518=_0xa68518-0x0;var _0x19d8e8=_0xf4eb[_0xa68518];return _0x19d8e8;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var db=require(_0xbf4e('0x12'))['db'];function respondWithStatusCode(_0x54a96e,_0x17fd01){_0x17fd01=_0x17fd01||0xcc;return function(_0x5a3035){if(_0x5a3035){return _0x54a96e['sendStatus'](_0x17fd01);}return _0x54a96e[_0xbf4e('0x13')](_0x17fd01)[_0xbf4e('0x14')]();};}function respondWithResult(_0x1e029b,_0x302841){_0x302841=_0x302841||0xc8;return function(_0x3b74bd){if(_0x3b74bd){return _0x1e029b[_0xbf4e('0x13')](_0x302841)['json'](_0x3b74bd);}};}function respondWithFilteredResult(_0x59fb15,_0x180432){return function(_0x1735ae){if(_0x1735ae){var _0x28fc6b=_0x1735ae[_0xbf4e('0x15')],_0x542909=_0x180432[_0xbf4e('0x16')],_0x14110b=_0x180432['offset']+_0x180432[_0xbf4e('0x17')],_0x2c292c;if(_0x14110b>=_0x28fc6b){_0x14110b=_0x28fc6b;_0x2c292c=0xc8;}else{_0x2c292c=0xce;}_0x59fb15['status'](_0x2c292c);return _0x59fb15['set']('Content-Range',_0x542909+'-'+_0x14110b+'/'+_0x28fc6b)['json'](_0x1735ae);}return null;};}function patchUpdates(_0x35992b){return function(_0x1ca73c){try{jsonpatch[_0xbf4e('0x18')](_0x1ca73c,_0x35992b,!![]);}catch(_0x4d9c2a){return BPromise['reject'](_0x4d9c2a);}return _0x1ca73c[_0xbf4e('0x19')]();};}function saveUpdates(_0x9a46ee,_0x3be138){return function(_0x3a875b){if(_0x3a875b){return _0x3a875b[_0xbf4e('0x1a')](_0x9a46ee)[_0xbf4e('0x1b')](function(_0x415963){return _0x415963;});}return null;};}function removeEntity(_0x3d642a,_0xd09e12){return function(_0x376832){if(_0x376832){return _0x376832[_0xbf4e('0x1c')]()['then'](function(){_0x3d642a[_0xbf4e('0x13')](0xcc)[_0xbf4e('0x14')]();});}};}function handleEntityNotFound(_0x51648c,_0x31e3f5){return function(_0x30994d){if(!_0x30994d){_0x51648c[_0xbf4e('0x1d')](0x194);}return _0x30994d;};}function handleError(_0x1bda8b,_0x3a5d72){_0x3a5d72=_0x3a5d72||0x1f4;return function(_0x4a0243){logger[_0xbf4e('0x1e')](_0x4a0243[_0xbf4e('0x1f')]);if(_0x4a0243[_0xbf4e('0x20')]){delete _0x4a0243['name'];}_0x1bda8b[_0xbf4e('0x13')](_0x3a5d72)['send'](_0x4a0243);};}exports['index']=function(_0x2bfccf,_0x5a0a9b){var _0x38c923={},_0x315df3={},_0x4021a9={'count':0x0,'rows':[]};var _0x41f918=_['map'](db[_0xbf4e('0x21')][_0xbf4e('0x22')],function(_0x43879d){return{'name':_0x43879d['fieldName'],'type':_0x43879d[_0xbf4e('0x23')]['key']};});_0x315df3[_0xbf4e('0x24')]=_[_0xbf4e('0x25')](_0x41f918,_0xbf4e('0x20'));_0x315df3['query']=_[_0xbf4e('0x26')](_0x2bfccf[_0xbf4e('0x27')]);_0x315df3[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],_0x315df3[_0xbf4e('0x27')]);_0x38c923['attributes']=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],qs['fields'](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2a')]));_0x38c923['attributes']=_0x38c923[_0xbf4e('0x2b')]['length']?_0x38c923[_0xbf4e('0x2b')]:_0x315df3['model'];if(!_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2c')](_0xbf4e('0x2d'))){_0x38c923['limit']=qs[_0xbf4e('0x17')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x17')]);_0x38c923[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0x2bfccf[_0xbf4e('0x27')]['offset']);}_0x38c923[_0xbf4e('0x2e')]=qs[_0xbf4e('0x2f')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2f')]);_0x38c923[_0xbf4e('0x30')]=qs['filters'](_['pick'](_0x2bfccf['query'],_0x315df3['filters']));if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]){_0x38c923[_0xbf4e('0x30')]=_[_0xbf4e('0x32')](_0x38c923[_0xbf4e('0x30')],{'$or':_[_0xbf4e('0x25')](_0x41f918,function(_0x355b42){if(_0x355b42[_0xbf4e('0x23')]!==_0xbf4e('0x33')){var _0x54527d={};_0x54527d[_0x355b42['name']]={'$like':'%'+_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]+'%'};return _0x54527d;}})});}_0x38c923=_[_0xbf4e('0x32')]({},_0x38c923,_0x2bfccf['options']);var _0x3f46f1={'where':_0x38c923['where']};return db[_0xbf4e('0x21')][_0xbf4e('0x15')](_0x3f46f1)[_0xbf4e('0x1b')](function(_0xb30f90){_0x4021a9['count']=_0xb30f90;if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x34')]){_0x38c923[_0xbf4e('0x35')]=[{'all':!![]}];}return db[_0xbf4e('0x21')]['findAll'](_0x38c923);})[_0xbf4e('0x1b')](function(_0x44e96b){_0x4021a9[_0xbf4e('0x36')]=_0x44e96b;return _0x4021a9;})[_0xbf4e('0x1b')](respondWithFilteredResult(_0x5a0a9b,_0x38c923))[_0xbf4e('0x37')](handleError(_0x5a0a9b,null));};exports[_0xbf4e('0x38')]=function(_0xdb3c1,_0x541576){var _0x176166={'raw':!![],'where':{'id':_0xdb3c1['params']['id']}},_0x7b3a94={};_0x7b3a94['model']=_[_0xbf4e('0x26')](db[_0xbf4e('0x21')]['rawAttributes']);_0x7b3a94['query']=_[_0xbf4e('0x26')](_0xdb3c1[_0xbf4e('0x27')]);_0x7b3a94[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x7b3a94[_0xbf4e('0x24')],_0x7b3a94[_0xbf4e('0x27')]);_0x176166['attributes']=_[_0xbf4e('0x29')](_0x7b3a94[_0xbf4e('0x24')],qs['fields'](_0xdb3c1['query']['fields']));_0x176166['attributes']=_0x176166[_0xbf4e('0x2b')]['length']?_0x176166[_0xbf4e('0x2b')]:_0x7b3a94[_0xbf4e('0x24')];if(_0xdb3c1['query']['includeAll']){_0x176166[_0xbf4e('0x35')]=[{'all':!![]}];}_0x176166=_[_0xbf4e('0x32')]({},_0x176166,_0xdb3c1[_0xbf4e('0x39')]);return db[_0xbf4e('0x21')][_0xbf4e('0x3a')](_0x176166)['then'](handleEntityNotFound(_0x541576,null))[_0xbf4e('0x1b')](respondWithResult(_0x541576,null))[_0xbf4e('0x37')](handleError(_0x541576,null));};exports[_0xbf4e('0x3b')]=function(_0x39843e,_0x1be469){return db[_0xbf4e('0x21')][_0xbf4e('0x3b')](_0x39843e[_0xbf4e('0x3c')],{})['then'](respondWithResult(_0x1be469,0xc9))[_0xbf4e('0x37')](handleError(_0x1be469,null));};exports[_0xbf4e('0x1a')]=function(_0x1833c1,_0x32bed6){if(_0x1833c1[_0xbf4e('0x3c')]['id']){delete _0x1833c1[_0xbf4e('0x3c')]['id'];}return db[_0xbf4e('0x21')][_0xbf4e('0x3a')]({'where':{'id':_0x1833c1[_0xbf4e('0x3d')]['id']}})[_0xbf4e('0x1b')](handleEntityNotFound(_0x32bed6,null))[_0xbf4e('0x1b')](saveUpdates(_0x1833c1[_0xbf4e('0x3c')],null))[_0xbf4e('0x1b')](respondWithResult(_0x32bed6,null))[_0xbf4e('0x37')](handleError(_0x32bed6,null));};exports[_0xbf4e('0x1c')]=function(_0x2892ce,_0x10bc23){return db['FreshsalesField'][_0xbf4e('0x3a')]({'where':{'id':_0x2892ce[_0xbf4e('0x3d')]['id']}})[_0xbf4e('0x1b')](handleEntityNotFound(_0x10bc23,null))['then'](removeEntity(_0x10bc23,null))[_0xbf4e('0x37')](handleError(_0x10bc23,null));}; \ No newline at end of file +var _0x5c00=['catch','show','params','rawAttributes','create','body','find','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','FreshsalesField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5c00,0x17e));var _0x05c0=function(_0x4f5dd9,_0x30b8c5){_0x4f5dd9=_0x4f5dd9-0x0;var _0x3c8624=_0x5c00[_0x4f5dd9];return _0x3c8624;};'use strict';var pdf=require(_0x05c0('0x0'));var emlformat=require(_0x05c0('0x1'));var rimraf=require(_0x05c0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05c0('0x3'));var rp=require('request-promise');var moment=require(_0x05c0('0x4'));var BPromise=require(_0x05c0('0x5'));var Mustache=require(_0x05c0('0x6'));var util=require(_0x05c0('0x7'));var path=require('path');var sox=require(_0x05c0('0x8'));var csv=require(_0x05c0('0x9'));var ejs=require(_0x05c0('0xa'));var fs=require('fs');var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05c0('0x15'));var utils=require('../../config/utils');var config=require(_0x05c0('0x16'));var db=require(_0x05c0('0x17'))['db'];function respondWithStatusCode(_0xa50678,_0x5a3e65){_0x5a3e65=_0x5a3e65||0xcc;return function(_0x4e39d4){if(_0x4e39d4){return _0xa50678['sendStatus'](_0x5a3e65);}return _0xa50678[_0x05c0('0x18')](_0x5a3e65)[_0x05c0('0x19')]();};}function respondWithResult(_0x20ff48,_0x12deeb){_0x12deeb=_0x12deeb||0xc8;return function(_0x25764b){if(_0x25764b){return _0x20ff48[_0x05c0('0x18')](_0x12deeb)[_0x05c0('0x1a')](_0x25764b);}};}function respondWithFilteredResult(_0xd7b487,_0x4c3e54){return function(_0x238e25){if(_0x238e25){var _0x161a5f=_0x238e25[_0x05c0('0x1b')],_0x4bb164=_0x4c3e54[_0x05c0('0x1c')],_0x29e6b0=_0x4c3e54[_0x05c0('0x1c')]+_0x4c3e54[_0x05c0('0x1d')],_0x27c7bd;if(_0x29e6b0>=_0x161a5f){_0x29e6b0=_0x161a5f;_0x27c7bd=0xc8;}else{_0x27c7bd=0xce;}_0xd7b487['status'](_0x27c7bd);return _0xd7b487[_0x05c0('0x1e')](_0x05c0('0x1f'),_0x4bb164+'-'+_0x29e6b0+'/'+_0x161a5f)[_0x05c0('0x1a')](_0x238e25);}return null;};}function patchUpdates(_0x54fef0){return function(_0x40d905){try{jsonpatch[_0x05c0('0x20')](_0x40d905,_0x54fef0,!![]);}catch(_0x10685b){return BPromise[_0x05c0('0x21')](_0x10685b);}return _0x40d905[_0x05c0('0x22')]();};}function saveUpdates(_0x5e4742,_0x407c1f){return function(_0x1014ef){if(_0x1014ef){return _0x1014ef['update'](_0x5e4742)['then'](function(_0x5e4b80){return _0x5e4b80;});}return null;};}function removeEntity(_0x1c448b,_0x2055a3){return function(_0x83f29){if(_0x83f29){return _0x83f29[_0x05c0('0x23')]()[_0x05c0('0x24')](function(){_0x1c448b[_0x05c0('0x18')](0xcc)[_0x05c0('0x19')]();});}};}function handleEntityNotFound(_0x5b4eef,_0x9b4930){return function(_0x1abbf3){if(!_0x1abbf3){_0x5b4eef['sendStatus'](0x194);}return _0x1abbf3;};}function handleError(_0x530966,_0x4da6d6){_0x4da6d6=_0x4da6d6||0x1f4;return function(_0x5dc2b7){logger['error'](_0x5dc2b7[_0x05c0('0x25')]);if(_0x5dc2b7[_0x05c0('0x26')]){delete _0x5dc2b7['name'];}_0x530966[_0x05c0('0x18')](_0x4da6d6)[_0x05c0('0x27')](_0x5dc2b7);};}exports[_0x05c0('0x28')]=function(_0x889c75,_0x58769a){var _0x7d5ccd={},_0x1c14b1={},_0x2ceaed={'count':0x0,'rows':[]};var _0x200e80=_[_0x05c0('0x29')](db[_0x05c0('0x2a')]['rawAttributes'],function(_0x56ba64){return{'name':_0x56ba64[_0x05c0('0x2b')],'type':_0x56ba64[_0x05c0('0x2c')][_0x05c0('0x2d')]};});_0x1c14b1[_0x05c0('0x2e')]=_[_0x05c0('0x29')](_0x200e80,_0x05c0('0x26'));_0x1c14b1[_0x05c0('0x2f')]=_[_0x05c0('0x30')](_0x889c75[_0x05c0('0x2f')]);_0x1c14b1[_0x05c0('0x31')]=_[_0x05c0('0x32')](_0x1c14b1[_0x05c0('0x2e')],_0x1c14b1['query']);_0x7d5ccd['attributes']=_[_0x05c0('0x32')](_0x1c14b1[_0x05c0('0x2e')],qs[_0x05c0('0x33')](_0x889c75['query'][_0x05c0('0x33')]));_0x7d5ccd[_0x05c0('0x34')]=_0x7d5ccd['attributes'][_0x05c0('0x35')]?_0x7d5ccd['attributes']:_0x1c14b1[_0x05c0('0x2e')];if(!_0x889c75[_0x05c0('0x2f')][_0x05c0('0x36')](_0x05c0('0x37'))){_0x7d5ccd[_0x05c0('0x1d')]=qs[_0x05c0('0x1d')](_0x889c75[_0x05c0('0x2f')][_0x05c0('0x1d')]);_0x7d5ccd[_0x05c0('0x1c')]=qs[_0x05c0('0x1c')](_0x889c75[_0x05c0('0x2f')][_0x05c0('0x1c')]);}_0x7d5ccd[_0x05c0('0x38')]=qs[_0x05c0('0x39')](_0x889c75[_0x05c0('0x2f')][_0x05c0('0x39')]);_0x7d5ccd[_0x05c0('0x3a')]=qs[_0x05c0('0x31')](_[_0x05c0('0x3b')](_0x889c75[_0x05c0('0x2f')],_0x1c14b1[_0x05c0('0x31')]));if(_0x889c75[_0x05c0('0x2f')][_0x05c0('0x3c')]){_0x7d5ccd[_0x05c0('0x3a')]=_[_0x05c0('0x3d')](_0x7d5ccd[_0x05c0('0x3a')],{'$or':_[_0x05c0('0x29')](_0x200e80,function(_0x3bc6cc){if(_0x3bc6cc[_0x05c0('0x2c')]!==_0x05c0('0x3e')){var _0x1f493c={};_0x1f493c[_0x3bc6cc[_0x05c0('0x26')]]={'$like':'%'+_0x889c75[_0x05c0('0x2f')]['filter']+'%'};return _0x1f493c;}})});}_0x7d5ccd=_[_0x05c0('0x3d')]({},_0x7d5ccd,_0x889c75[_0x05c0('0x3f')]);var _0x41fa50={'where':_0x7d5ccd[_0x05c0('0x3a')]};return db['FreshsalesField']['count'](_0x41fa50)[_0x05c0('0x24')](function(_0x2540db){_0x2ceaed[_0x05c0('0x1b')]=_0x2540db;if(_0x889c75['query'][_0x05c0('0x40')]){_0x7d5ccd[_0x05c0('0x41')]=[{'all':!![]}];}return db[_0x05c0('0x2a')][_0x05c0('0x42')](_0x7d5ccd);})['then'](function(_0x152c6a){_0x2ceaed[_0x05c0('0x43')]=_0x152c6a;return _0x2ceaed;})['then'](respondWithFilteredResult(_0x58769a,_0x7d5ccd))[_0x05c0('0x44')](handleError(_0x58769a,null));};exports[_0x05c0('0x45')]=function(_0x4557db,_0xcbd98){var _0x164e3a={'raw':!![],'where':{'id':_0x4557db[_0x05c0('0x46')]['id']}},_0x398a6e={};_0x398a6e['model']=_['keys'](db[_0x05c0('0x2a')][_0x05c0('0x47')]);_0x398a6e[_0x05c0('0x2f')]=_[_0x05c0('0x30')](_0x4557db[_0x05c0('0x2f')]);_0x398a6e['filters']=_[_0x05c0('0x32')](_0x398a6e[_0x05c0('0x2e')],_0x398a6e[_0x05c0('0x2f')]);_0x164e3a[_0x05c0('0x34')]=_[_0x05c0('0x32')](_0x398a6e[_0x05c0('0x2e')],qs[_0x05c0('0x33')](_0x4557db['query'][_0x05c0('0x33')]));_0x164e3a[_0x05c0('0x34')]=_0x164e3a[_0x05c0('0x34')][_0x05c0('0x35')]?_0x164e3a[_0x05c0('0x34')]:_0x398a6e[_0x05c0('0x2e')];if(_0x4557db[_0x05c0('0x2f')][_0x05c0('0x40')]){_0x164e3a[_0x05c0('0x41')]=[{'all':!![]}];}_0x164e3a=_[_0x05c0('0x3d')]({},_0x164e3a,_0x4557db[_0x05c0('0x3f')]);return db['FreshsalesField']['find'](_0x164e3a)[_0x05c0('0x24')](handleEntityNotFound(_0xcbd98,null))[_0x05c0('0x24')](respondWithResult(_0xcbd98,null))[_0x05c0('0x44')](handleError(_0xcbd98,null));};exports[_0x05c0('0x48')]=function(_0x2a1339,_0x856372){return db['FreshsalesField'][_0x05c0('0x48')](_0x2a1339[_0x05c0('0x49')],{})[_0x05c0('0x24')](respondWithResult(_0x856372,0xc9))[_0x05c0('0x44')](handleError(_0x856372,null));};exports['update']=function(_0x34e94e,_0x2440e8){if(_0x34e94e[_0x05c0('0x49')]['id']){delete _0x34e94e[_0x05c0('0x49')]['id'];}return db['FreshsalesField'][_0x05c0('0x4a')]({'where':{'id':_0x34e94e[_0x05c0('0x46')]['id']}})[_0x05c0('0x24')](handleEntityNotFound(_0x2440e8,null))[_0x05c0('0x24')](saveUpdates(_0x34e94e['body'],null))[_0x05c0('0x24')](respondWithResult(_0x2440e8,null))[_0x05c0('0x44')](handleError(_0x2440e8,null));};exports['destroy']=function(_0x27f69e,_0x57f979){return db['FreshsalesField'][_0x05c0('0x4a')]({'where':{'id':_0x27f69e['params']['id']}})[_0x05c0('0x24')](handleEntityNotFound(_0x57f979,null))[_0x05c0('0x24')](removeEntity(_0x57f979,null))[_0x05c0('0x44')](handleError(_0x57f979,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index af4fc51..8e80c0d 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 _0xb458=['path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0xb458,0xca));var _0x8b45=function(_0x178619,_0x35734e){_0x178619=_0x178619-0x0;var _0x2a71e9=_0xb458[_0x178619];return _0x2a71e9;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))(_0x8b45('0x3'));var moment=require('moment');var BPromise=require(_0x8b45('0x4'));var rp=require(_0x8b45('0x5'));var fs=require('fs');var path=require(_0x8b45('0x6'));var rimraf=require(_0x8b45('0x7'));var config=require(_0x8b45('0x8'));var attributes=require(_0x8b45('0x9'));module[_0x8b45('0xa')]=function(_0x35680c,_0x2a5b3c){return _0x35680c[_0x8b45('0xb')](_0x8b45('0xc'),attributes,{'tableName':_0x8b45('0xd'),'paranoid':![],'indexes':[{'name':_0x8b45('0xe'),'fields':['idField',_0x8b45('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf5eb=['moment','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','api'];(function(_0x23b23b,_0x37e83c){var _0x13837f=function(_0x36b502){while(--_0x36b502){_0x23b23b['push'](_0x23b23b['shift']());}};_0x13837f(++_0x37e83c);}(_0xf5eb,0x1d1));var _0xbf5e=function(_0x27371d,_0x1480b3){_0x27371d=_0x27371d-0x0;var _0xa48cf5=_0xf5eb[_0x27371d];return _0xa48cf5;};'use strict';var _=require(_0xbf5e('0x0'));var util=require(_0xbf5e('0x1'));var logger=require('../../config/logger')(_0xbf5e('0x2'));var moment=require(_0xbf5e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbf5e('0x4'));var rimraf=require(_0xbf5e('0x5'));var config=require('../../config/environment');var attributes=require(_0xbf5e('0x6'));module[_0xbf5e('0x7')]=function(_0x43924f,_0x2b4286){return _0x43924f[_0xbf5e('0x8')](_0xbf5e('0x9'),attributes,{'tableName':_0xbf5e('0xa'),'paranoid':![],'indexes':[{'name':_0xbf5e('0xb'),'fields':[_0xbf5e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 501940a..4726767 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 _0xe33c=['error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xe33c,0x1a4));var _0xce33=function(_0x5ec407,_0x54fefd){_0x5ec407=_0x5ec407-0x0;var _0x27d78b=_0xe33c[_0x5ec407];return _0x27d78b;};'use strict';var _=require('lodash');var util=require(_0xce33('0x0'));var moment=require('moment');var BPromise=require(_0xce33('0x1'));var rs=require(_0xce33('0x2'));var fs=require('fs');var Redis=require(_0xce33('0x3'));var db=require(_0xce33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xce33('0x5'))(_0xce33('0x6'));var config=require(_0xce33('0x7'));var jayson=require(_0xce33('0x8'));var client=jayson[_0xce33('0x9')][_0xce33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32c0de,_0x41f42f,_0x21cd17){return new BPromise(function(_0x18b060,_0x168733){return client[_0xce33('0xb')](_0x32c0de,_0x21cd17)[_0xce33('0xc')](function(_0x3e0217){logger['info'](_0xce33('0xd'),_0x41f42f,_0xce33('0xe'));logger[_0xce33('0xf')](_0xce33('0x10'),_0x41f42f,'request\x20sent',JSON['stringify'](_0x3e0217));if(_0x3e0217[_0xce33('0x11')]){if(_0x3e0217[_0xce33('0x11')][_0xce33('0x12')]===0x1f4){logger[_0xce33('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x41f42f,_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);return _0x168733(_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);}logger[_0xce33('0x11')](_0xce33('0xd'),_0x41f42f,_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);return _0x18b060(_0x3e0217[_0xce33('0x11')]['message']);}else{logger[_0xce33('0x14')](_0xce33('0xd'),_0x41f42f,'request\x20sent');_0x18b060(_0x3e0217[_0xce33('0x15')][_0xce33('0x13')]);}})[_0xce33('0x16')](function(_0x24b026){logger[_0xce33('0x11')](_0xce33('0xd'),_0x41f42f,_0x24b026);_0x168733(_0x24b026);});});} \ No newline at end of file +var _0x23a6=['request','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','FreshsalesField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5be7aa,_0x5de661){var _0x215408=function(_0x353715){while(--_0x353715){_0x5be7aa['push'](_0x5be7aa['shift']());}};_0x215408(++_0x5de661);}(_0x23a6,0x10d));var _0x623a=function(_0x270079,_0x101bef){_0x270079=_0x270079-0x0;var _0x6c63a7=_0x23a6[_0x270079];return _0x6c63a7;};'use strict';var _=require(_0x623a('0x0'));var util=require(_0x623a('0x1'));var moment=require('moment');var BPromise=require(_0x623a('0x2'));var rs=require(_0x623a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x623a('0x4'))['db'];var utils=require(_0x623a('0x5'));var logger=require(_0x623a('0x6'))(_0x623a('0x7'));var config=require(_0x623a('0x8'));var jayson=require(_0x623a('0x9'));var client=jayson['client'][_0x623a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a2386,_0x530c79,_0x315b75){return new BPromise(function(_0x1225cd,_0x1357fc){return client[_0x623a('0xb')](_0x4a2386,_0x315b75)['then'](function(_0x56d71d){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x530c79,_0x623a('0xc'));logger[_0x623a('0xd')](_0x623a('0xe'),_0x530c79,_0x623a('0xc'),JSON[_0x623a('0xf')](_0x56d71d));if(_0x56d71d[_0x623a('0x10')]){if(_0x56d71d['error']['code']===0x1f4){logger[_0x623a('0x10')](_0x623a('0x11'),_0x530c79,_0x56d71d[_0x623a('0x10')][_0x623a('0x12')]);return _0x1357fc(_0x56d71d[_0x623a('0x10')][_0x623a('0x12')]);}logger[_0x623a('0x10')](_0x623a('0x11'),_0x530c79,_0x56d71d[_0x623a('0x10')][_0x623a('0x12')]);return _0x1225cd(_0x56d71d[_0x623a('0x10')][_0x623a('0x12')]);}else{logger['info'](_0x623a('0x11'),_0x530c79,_0x623a('0xc'));_0x1225cd(_0x56d71d['result'][_0x623a('0x12')]);}})[_0x623a('0x13')](function(_0x210091){logger[_0x623a('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x530c79,_0x210091);_0x1357fc(_0x210091);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index fcce735..80a91c5 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 _0xdab5=['/:id/fields','getFields','post','addConfiguration','update','multer','util','express','../../components/auth/service','../../config/environment','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations'];(function(_0x31ed50,_0x2d23a8){var _0x4804c1=function(_0x3f9b1a){while(--_0x3f9b1a){_0x31ed50['push'](_0x31ed50['shift']());}};_0x4804c1(++_0x2d23a8);}(_0xdab5,0x165));var _0x5dab=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xdab5[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x5dab('0x0'));var util=require(_0x5dab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dab('0x2'));var router=express['Router']();var auth=require(_0x5dab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5dab('0x4'));var controller=require('./intSalesforceAccount.controller');router[_0x5dab('0x5')]('/',auth['isAuthenticated'](),controller[_0x5dab('0x6')]);router[_0x5dab('0x5')](_0x5dab('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x5dab('0x5')](_0x5dab('0x8'),auth[_0x5dab('0x9')](),controller[_0x5dab('0xa')]);router[_0x5dab('0x5')](_0x5dab('0xb'),auth['isAuthenticated'](),controller[_0x5dab('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5dab('0xd')](_0x5dab('0x8'),auth[_0x5dab('0x9')](),controller[_0x5dab('0xe')]);router['put'](_0x5dab('0x7'),auth[_0x5dab('0x9')](),controller[_0x5dab('0xf')]);router['delete']('/:id',auth[_0x5dab('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x54c4=['../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','post','/:id/configurations','addConfiguration','put','/:id','update','delete','multer','path','connect-timeout','../../components/interaction/service'];(function(_0x2326ce,_0x12bdf4){var _0x4c4e1e=function(_0x954e02){while(--_0x954e02){_0x2326ce['push'](_0x2326ce['shift']());}};_0x4c4e1e(++_0x12bdf4);}(_0x54c4,0xdd));var _0x454c=function(_0x5c2a28,_0x3a99de){_0x5c2a28=_0x5c2a28-0x0;var _0x1018c5=_0x54c4[_0x5c2a28];return _0x1018c5;};'use strict';var multer=require(_0x454c('0x0'));var util=require('util');var path=require(_0x454c('0x1'));var timeout=require(_0x454c('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x454c('0x3'));var config=require(_0x454c('0x4'));var controller=require(_0x454c('0x5'));router[_0x454c('0x6')]('/',auth[_0x454c('0x7')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x454c('0x6')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x454c('0x6')]('/:id/fields',auth[_0x454c('0x7')](),controller['getFields']);router['post']('/',auth[_0x454c('0x7')](),controller['create']);router[_0x454c('0x8')](_0x454c('0x9'),auth['isAuthenticated'](),controller[_0x454c('0xa')]);router[_0x454c('0xb')](_0x454c('0xc'),auth['isAuthenticated'](),controller[_0x454c('0xd')]);router[_0x454c('0xe')](_0x454c('0xc'),auth[_0x454c('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 4baa65e..12ee7b4 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 _0x814b=['STRING','username','ENUM','newTab','integrationTab','sequelize','exports'];(function(_0x376971,_0x3d9579){var _0x2286ff=function(_0x10c7db){while(--_0x10c7db){_0x376971['push'](_0x376971['shift']());}};_0x2286ff(++_0x3d9579);}(_0x814b,0x1a2));var _0xb814=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x814b[_0xc20f22];return _0x1535d5;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')]},'description':{'type':Sequelize[_0xb814('0x2')]},'username':{'type':Sequelize[_0xb814('0x2')],'unique':_0xb814('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb814('0x2')]},'clientId':{'type':Sequelize[_0xb814('0x2')]},'clientSecret':{'type':Sequelize[_0xb814('0x2')]},'securityToken':{'type':Sequelize[_0xb814('0x2')]},'serverUrl':{'type':Sequelize[_0xb814('0x2')]},'type':{'type':Sequelize[_0xb814('0x4')]('integrationTab',_0xb814('0x5')),'defaultValue':_0xb814('0x6')}}; \ No newline at end of file +var _0x1261=['STRING','username','integrationTab','newTab','exports'];(function(_0x3d0e9f,_0x3a30cd){var _0x500132=function(_0xb38c4a){while(--_0xb38c4a){_0x3d0e9f['push'](_0x3d0e9f['shift']());}};_0x500132(++_0x3a30cd);}(_0x1261,0x144));var _0x1126=function(_0x2a6501,_0x9c5a0e){_0x2a6501=_0x2a6501-0x0;var _0x34d3ae=_0x1261[_0x2a6501];return _0x34d3ae;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')]},'description':{'type':Sequelize[_0x1126('0x1')]},'username':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2')},'remoteUri':{'type':Sequelize[_0x1126('0x1')]},'password':{'type':Sequelize[_0x1126('0x1')]},'clientId':{'type':Sequelize[_0x1126('0x1')]},'clientSecret':{'type':Sequelize[_0x1126('0x1')]},'securityToken':{'type':Sequelize[_0x1126('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1126('0x3'),_0x1126('0x4')),'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 d002633..dd86160 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 _0x5fab=['error','code','message','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','end','name','index','map','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','SalesforceAccount','findAll','rows','catch','show','rawAttributes','options','find','create','body','update','params','destroy','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','SalesforceField','getFields','Task','clientId','username','password','remoteUri','slice','substring','lastIndexOf','clientSecret','login','isNil','ticketType','sobject','CallDisposition','CallObject','IsArchived','Priority','Case','Type','Origin','Reason','Status','IsEscalated','SuppliedName','custom','includes','label','picklistValues','value','boolean','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x136493,_0x1c2dd5){var _0x15b7e7=function(_0x578400){while(--_0x578400){_0x136493['push'](_0x136493['shift']());}};_0x15b7e7(++_0x1c2dd5);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5fab[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var db=require(_0xb5fa('0x18'))['db'];var integrations=require(_0xb5fa('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xb5fa('0x1a')][_0xb5fa('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x56e8b0,_0x116849,_0x577af0){if(_0x577af0){var _0x265992=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x265992[_0xb5fa('0x1c')](_0x116849)){return _0x56e8b0;}else{throw new db[(_0xb5fa('0x1d'))][(_0xb5fa('0x1e'))](_0xb5fa('0x1f'));}}else{return _0x56e8b0;}}function respondWithRpcPromise(_0x5371cf,_0x567f31,_0x38e964,_0x587043){return new BPromise(function(_0x31f252,_0x27c8f7){var _0x56fe10=_0x587043||client;return _0x56fe10['request'](_0x5371cf,_0x38e964)[_0xb5fa('0x20')](function(_0x1f7f05){logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));logger[_0xb5fa('0x24')](_0xb5fa('0x25'),_0x567f31,_0xb5fa('0x23'),JSON[_0xb5fa('0x26')](_0x1f7f05));if(_0x1f7f05[_0xb5fa('0x27')]){if(_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x28')]===0x1f4){logger['error'](_0xb5fa('0x22'),_0x567f31,_0x1f7f05['error'][_0xb5fa('0x29')]);return _0x27c8f7(_0x1f7f05['error'][_0xb5fa('0x29')]);}logger[_0xb5fa('0x27')]('SalesforceAccount,\x20%s,\x20%s',_0x567f31,_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x29')]);return _0x31f252(_0x1f7f05[_0xb5fa('0x27')]['message']);}else{logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));_0x31f252(_0x1f7f05['result'][_0xb5fa('0x29')]);}})['catch'](function(_0x106c4b){logger[_0xb5fa('0x27')](_0xb5fa('0x22'),_0x567f31,_0x106c4b);_0x27c8f7(_0x106c4b);});});}function respondWithStatusCode(_0x543edf,_0x2dbd22){_0x2dbd22=_0x2dbd22||0xcc;return function(_0x3f61cd){if(_0x3f61cd){return _0x543edf[_0xb5fa('0x2a')](_0x2dbd22);}return _0x543edf[_0xb5fa('0x2b')](_0x2dbd22)['end']();};}function respondWithResult(_0x4ec294,_0x5bdf11){_0x5bdf11=_0x5bdf11||0xc8;return function(_0x5a1c39){if(_0x5a1c39){return _0x4ec294[_0xb5fa('0x2b')](_0x5bdf11)[_0xb5fa('0x2c')](_0x5a1c39);}};}function respondWithFilteredResult(_0x12c0d4,_0x2bdf50){return function(_0x534884){if(_0x534884){var _0x3506a4=_0x534884[_0xb5fa('0x2d')],_0x358549=_0x2bdf50[_0xb5fa('0x2e')],_0x353314=_0x2bdf50[_0xb5fa('0x2e')]+_0x2bdf50[_0xb5fa('0x2f')],_0x409af9;if(_0x353314>=_0x3506a4){_0x353314=_0x3506a4;_0x409af9=0xc8;}else{_0x409af9=0xce;}_0x12c0d4[_0xb5fa('0x2b')](_0x409af9);return _0x12c0d4[_0xb5fa('0x30')](_0xb5fa('0x31'),_0x358549+'-'+_0x353314+'/'+_0x3506a4)[_0xb5fa('0x2c')](_0x534884);}return null;};}function patchUpdates(_0x3fd1fb){return function(_0x21fc7e){try{jsonpatch[_0xb5fa('0x32')](_0x21fc7e,_0x3fd1fb,!![]);}catch(_0x291938){return BPromise[_0xb5fa('0x33')](_0x291938);}return _0x21fc7e[_0xb5fa('0x34')]();};}function saveUpdates(_0x25fc7c,_0x4cba5a){return function(_0x2cc6cb){if(_0x2cc6cb){return _0x2cc6cb['update'](_0x25fc7c)['then'](function(_0x558708){return _0x558708;});}return null;};}function removeEntity(_0x1e6ba0,_0x502d57){return function(_0x3bb4de){if(_0x3bb4de){return _0x3bb4de['destroy']()['then'](function(){_0x1e6ba0[_0xb5fa('0x2b')](0xcc)[_0xb5fa('0x35')]();});}};}function handleEntityNotFound(_0x4a4bff,_0x59f41d){return function(_0x3d73c2){if(!_0x3d73c2){_0x4a4bff[_0xb5fa('0x2a')](0x194);}return _0x3d73c2;};}function handleError(_0x252421,_0x560b53){_0x560b53=_0x560b53||0x1f4;return function(_0xc9adee){logger[_0xb5fa('0x27')](_0xc9adee['stack']);if(_0xc9adee[_0xb5fa('0x36')]){delete _0xc9adee[_0xb5fa('0x36')];}_0x252421[_0xb5fa('0x2b')](_0x560b53)['send'](_0xc9adee);};}exports[_0xb5fa('0x37')]=function(_0x2c950e,_0x24ef11){var _0x55bdb7={},_0x117694={},_0x1c818f={'count':0x0,'rows':[]};var _0x1a4697=_[_0xb5fa('0x38')](db['SalesforceAccount']['rawAttributes'],function(_0x4901ad){return{'name':_0x4901ad['fieldName'],'type':_0x4901ad['type']['key']};});_0x117694[_0xb5fa('0x39')]=_['map'](_0x1a4697,_0xb5fa('0x36'));_0x117694[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x2c950e[_0xb5fa('0x3a')]);_0x117694[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x117694['model'],_0x117694['query']);_0x55bdb7['attributes']=_[_0xb5fa('0x3d')](_0x117694['model'],qs[_0xb5fa('0x3e')](_0x2c950e['query']['fields']));_0x55bdb7[_0xb5fa('0x3f')]=_0x55bdb7[_0xb5fa('0x3f')][_0xb5fa('0x40')]?_0x55bdb7[_0xb5fa('0x3f')]:_0x117694[_0xb5fa('0x39')];if(!_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x41')](_0xb5fa('0x42'))){_0x55bdb7[_0xb5fa('0x2f')]=qs[_0xb5fa('0x2f')](_0x2c950e['query'][_0xb5fa('0x2f')]);_0x55bdb7['offset']=qs[_0xb5fa('0x2e')](_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x2e')]);}_0x55bdb7[_0xb5fa('0x43')]=qs[_0xb5fa('0x44')](_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x44')]);_0x55bdb7[_0xb5fa('0x45')]=qs['filters'](_[_0xb5fa('0x46')](_0x2c950e[_0xb5fa('0x3a')],_0x117694['filters']));if(_0x2c950e[_0xb5fa('0x3a')]['filter']){_0x55bdb7[_0xb5fa('0x45')]=_[_0xb5fa('0x47')](_0x55bdb7['where'],{'$or':_['map'](_0x1a4697,function(_0x2db269){if(_0x2db269[_0xb5fa('0x48')]!==_0xb5fa('0x49')){var _0x19e662={};_0x19e662[_0x2db269[_0xb5fa('0x36')]]={'$like':'%'+_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x4a')]+'%'};return _0x19e662;}})});}_0x55bdb7=_[_0xb5fa('0x47')]({},_0x55bdb7,_0x2c950e['options']);var _0x13bf04={'where':_0x55bdb7[_0xb5fa('0x45')]};return db['SalesforceAccount'][_0xb5fa('0x2d')](_0x13bf04)[_0xb5fa('0x20')](function(_0x247999){_0x1c818f[_0xb5fa('0x2d')]=_0x247999;if(_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x4b')]){_0x55bdb7[_0xb5fa('0x4c')]=[{'all':!![]}];}return db[_0xb5fa('0x4d')][_0xb5fa('0x4e')](_0x55bdb7);})[_0xb5fa('0x20')](function(_0xfe091){_0x1c818f[_0xb5fa('0x4f')]=_0xfe091;return _0x1c818f;})[_0xb5fa('0x20')](respondWithFilteredResult(_0x24ef11,_0x55bdb7))[_0xb5fa('0x50')](handleError(_0x24ef11,null));};exports[_0xb5fa('0x51')]=function(_0x3a39f2,_0x52f5d8){var _0x56dceb={'raw':![],'where':{'id':_0x3a39f2['params']['id']}},_0x46194d={};_0x46194d[_0xb5fa('0x39')]=_[_0xb5fa('0x3b')](db['SalesforceAccount'][_0xb5fa('0x52')]);_0x46194d[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x3a39f2[_0xb5fa('0x3a')]);_0x46194d[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x46194d['model'],_0x46194d[_0xb5fa('0x3a')]);_0x56dceb['attributes']=_[_0xb5fa('0x3d')](_0x46194d[_0xb5fa('0x39')],qs[_0xb5fa('0x3e')](_0x3a39f2['query'][_0xb5fa('0x3e')]));_0x56dceb[_0xb5fa('0x3f')]=_0x56dceb['attributes']['length']?_0x56dceb[_0xb5fa('0x3f')]:_0x46194d[_0xb5fa('0x39')];if(_0x3a39f2[_0xb5fa('0x3a')][_0xb5fa('0x4b')]){_0x56dceb[_0xb5fa('0x4c')]=[{'all':!![]}];}_0x56dceb=_[_0xb5fa('0x47')]({},_0x56dceb,_0x3a39f2[_0xb5fa('0x53')]);return db[_0xb5fa('0x4d')][_0xb5fa('0x54')](_0x56dceb)[_0xb5fa('0x20')](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x20')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x50')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x55')]=function(_0x2799e7,_0x23f235){return db[_0xb5fa('0x4d')][_0xb5fa('0x55')](_0x2799e7[_0xb5fa('0x56')],{})['then'](respondWithResult(_0x23f235,0xc9))[_0xb5fa('0x50')](handleError(_0x23f235,null));};exports[_0xb5fa('0x57')]=function(_0x222016,_0xd8d0ab){if(_0x222016[_0xb5fa('0x56')]['id']){delete _0x222016[_0xb5fa('0x56')]['id'];}return db[_0xb5fa('0x4d')][_0xb5fa('0x54')]({'where':{'id':_0x222016[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0xd8d0ab,null))['then'](saveUpdates(_0x222016['body'],null))[_0xb5fa('0x20')](respondWithResult(_0xd8d0ab,null))[_0xb5fa('0x50')](handleError(_0xd8d0ab,null));};exports[_0xb5fa('0x59')]=function(_0x5caf84,_0x441c41){return db[_0xb5fa('0x4d')][_0xb5fa('0x54')]({'where':{'id':_0x5caf84[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x441c41,null))[_0xb5fa('0x20')](removeEntity(_0x441c41,null))[_0xb5fa('0x50')](handleError(_0x441c41,null));};exports['getConfigurations']=function(_0x7bcd09,_0x4611f3,_0x4afc02){var _0x31e602={};var _0x26bc03={};var _0x540295;var _0xd94224;return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x7bcd09[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x4611f3,null))[_0xb5fa('0x20')](function(_0x18cde9){if(_0x18cde9){_0x540295=_0x18cde9;_0x26bc03[_0xb5fa('0x39')]=_[_0xb5fa('0x3b')](db[_0xb5fa('0x5b')][_0xb5fa('0x52')]);_0x26bc03[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x7bcd09[_0xb5fa('0x3a')]);_0x26bc03[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x26bc03[_0xb5fa('0x39')],_0x26bc03[_0xb5fa('0x3a')]);_0x31e602[_0xb5fa('0x3f')]=_[_0xb5fa('0x3d')](_0x26bc03[_0xb5fa('0x39')],qs[_0xb5fa('0x3e')](_0x7bcd09['query'][_0xb5fa('0x3e')]));_0x31e602[_0xb5fa('0x3f')]=_0x31e602[_0xb5fa('0x3f')]['length']?_0x31e602[_0xb5fa('0x3f')]:_0x26bc03[_0xb5fa('0x39')];_0x31e602['order']=qs[_0xb5fa('0x44')](_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x44')]);_0x31e602['where']=qs['filters'](_[_0xb5fa('0x46')](_0x7bcd09[_0xb5fa('0x3a')],_0x26bc03[_0xb5fa('0x3c')]));if(_0x7bcd09['query'][_0xb5fa('0x4a')]){_0x31e602[_0xb5fa('0x45')]=_[_0xb5fa('0x47')](_0x31e602[_0xb5fa('0x45')],{'$or':_['map'](_0x31e602['attributes'],function(_0x5cec07){var _0x2cbaba={};_0x2cbaba[_0x5cec07]={'$like':'%'+_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x4a')]+'%'};return _0x2cbaba;})});}_0x31e602=_['merge']({},_0x31e602,_0x7bcd09[_0xb5fa('0x53')]);return _0x540295[_0xb5fa('0x5c')](_0x31e602);}})[_0xb5fa('0x20')](function(_0x42a763){if(_0x42a763){_0xd94224=_0x42a763[_0xb5fa('0x40')];if(!_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x41')](_0xb5fa('0x42'))){_0x31e602[_0xb5fa('0x2f')]=qs[_0xb5fa('0x2f')](_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x2f')]);_0x31e602[_0xb5fa('0x2e')]=qs[_0xb5fa('0x2e')](_0x7bcd09[_0xb5fa('0x3a')]['offset']);}return _0x540295[_0xb5fa('0x5c')](_0x31e602);}})['then'](function(_0x47193c){if(_0x47193c){return _0x47193c?{'count':_0xd94224,'rows':_0x47193c}:null;}})[_0xb5fa('0x20')](respondWithResult(_0x4611f3,null))[_0xb5fa('0x50')](handleError(_0x4611f3,null));};exports[_0xb5fa('0x5d')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){if(_0x339dfb['body']['id']){delete _0x339dfb[_0xb5fa('0x56')]['id'];}return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x339dfb[_0xb5fa('0x58')]['id']}})['then'](handleEntityNotFound(_0x56e6b0,null))['then'](function(_0x59920c){if(_0x59920c){_0x339dfb[_0xb5fa('0x56')][_0xb5fa('0x5e')]=_0x59920c['id'];_0x339dfb[_0xb5fa('0x56')][_0xb5fa('0x5f')]=integrations[_0xb5fa('0x60')](_0x339dfb[_0xb5fa('0x56')]['channel'],_0x339dfb[_0xb5fa('0x56')]['type']);_0x339dfb['body'][_0xb5fa('0x61')]=integrations['getDescriptions'](_0x339dfb['body']['channel'],_0x339dfb[_0xb5fa('0x56')]['type']);return db[_0xb5fa('0x5b')][_0xb5fa('0x55')](_0x339dfb[_0xb5fa('0x56')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xb5fa('0x62')],'as':_0xb5fa('0x61')}]});}return null;})['then'](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x50')](handleError(_0x56e6b0,null));};exports[_0xb5fa('0x63')]=function(_0x244892,_0x2aaa2c,_0x4e6432){var _0x30c1e8;var _0x32a7a9='';var _0x29273a=_0xb5fa('0x64');return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x244892[_0xb5fa('0x58')]['id']},'attributes':['id','remoteUri',_0xb5fa('0x65'),'clientSecret',_0xb5fa('0x66'),_0xb5fa('0x67'),'securityToken']})[_0xb5fa('0x20')](handleEntityNotFound(_0x2aaa2c,null))[_0xb5fa('0x20')](function(_0xdc4fe4){if(_0xdc4fe4){_0x32a7a9=_0xdc4fe4[_0xb5fa('0x68')];var _0x3034b0=_0x32a7a9[_0xb5fa('0x69')](-0x1);if(_0x3034b0==='/'){_0x32a7a9=_0x32a7a9[_0xb5fa('0x6a')](0x0,_0x32a7a9[_0xb5fa('0x6b')](_0x3034b0));}_0x30c1e8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x32a7a9,'clientId':_0xdc4fe4[_0xb5fa('0x65')],'clientSecret':_0xdc4fe4[_0xb5fa('0x6c')]}});return _0x30c1e8[_0xb5fa('0x6d')](_0xdc4fe4[_0xb5fa('0x66')],_0xdc4fe4['password']['concat'](_0xdc4fe4['securityToken']));}})['then'](function(_0x1c60bd){if(_0x1c60bd){if(!_[_0xb5fa('0x6e')](_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')])){_0x29273a=_0x244892['query']['ticketType'];}return _0x30c1e8[_0xb5fa('0x70')](_0x29273a)['describe']();}})[_0xb5fa('0x20')](function(_0x35df3c){var _0x318001=[_0xb5fa('0x71'),'CallDurationInSeconds',_0xb5fa('0x72'),'CallType',_0xb5fa('0x73'),_0xb5fa('0x74'),'Status','Type'];if(!_[_0xb5fa('0x6e')](_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')])&&_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')]===_0xb5fa('0x75')){_0x318001=[_0xb5fa('0x76'),_0xb5fa('0x77'),_0xb5fa('0x78'),_0xb5fa('0x79'),_0xb5fa('0x74'),_0xb5fa('0x7a'),_0xb5fa('0x7b'),'SuppliedCompany'];}if(_0x35df3c){_['remove'](_0x35df3c[_0xb5fa('0x3e')],function(_0x52384b){return _0x52384b[_0xb5fa('0x7c')]===![]&&!_0x318001[_0xb5fa('0x7d')](_0x52384b['name']);});return{'count':_0x35df3c[_0xb5fa('0x3e')][_0xb5fa('0x40')],'rows':_['map'](_0x35df3c[_0xb5fa('0x3e')],function(_0x3ba1d0){return{'id':_0x3ba1d0['name'],'name':_0x3ba1d0[_0xb5fa('0x7e')],'custom':_0x3ba1d0[_0xb5fa('0x7c')],'options':_0x3ba1d0[_0xb5fa('0x7f')]['length']>0x0?_['map'](_0x3ba1d0[_0xb5fa('0x7f')],function(_0x1a24a2){return{'name':_0x1a24a2[_0xb5fa('0x7e')],'value':_0x1a24a2[_0xb5fa('0x80')]};}):_0x3ba1d0[_0xb5fa('0x48')]==_0xb5fa('0x81')?[{'name':_0xb5fa('0x82'),'value':_0xb5fa('0x83')},{'name':_0xb5fa('0x84'),'value':_0xb5fa('0x85')}]:[]};})};}})['then'](respondWithResult(_0x2aaa2c,null))['catch'](function(_0x3c5563){var _0x414507=_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x1c')]?0x1f4:_0x3c5563['statusCode']||0x1f4;logger[_0xb5fa('0x27')](_0xb5fa('0x86'),_0xb5fa('0x63'),_0x414507,JSON['stringify'](_0x3c5563));delete _0x3c5563[_0xb5fa('0x36')];if(_0x414507===0x191){_0x414507=0x190;}_0x2aaa2c[_0xb5fa('0x2b')](_0x414507)[_0xb5fa('0x87')](_0x244892[_0xb5fa('0x3a')]['test']?{'message':_0xb5fa('0x88'),'statusCode':_0x3c5563[_0xb5fa('0x89')]}:_0x3c5563);});}; \ No newline at end of file +var _0x5fc3=['Task','remoteUri','clientSecret','username','password','securityToken','substring','Connection','clientId','login','concat','isNil','describe','CallDisposition','CallObject','CallType','IsArchived','Priority','Type','ticketType','Case','Origin','Reason','Status','SuppliedName','SuppliedCompany','remove','custom','label','picklistValues','boolean','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','client','test','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','sendStatus','name','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','sort','filters','filter','where','merge','SalesforceAccount','include','findAll','rows','show','params','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','order','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','type','Descriptions','getDescriptions','SalesforceField','getFields'];(function(_0x3ecbdc,_0x3a71fe){var _0xad4dea=function(_0x3275a0){while(--_0x3275a0){_0x3ecbdc['push'](_0x3ecbdc['shift']());}};_0xad4dea(++_0x3a71fe);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0x5fc3[_0x1196bd];return _0x26014f;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');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('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var as=require(_0x35fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x14'))(_0x35fc('0x15'));var utils=require('../../config/utils');var config=require(_0x35fc('0x16'));var db=require(_0x35fc('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x35fc('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x397738,_0x22055e,_0x2a6ad2){if(_0x2a6ad2){var _0x29730f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29730f[_0x35fc('0x19')](_0x22055e)){return _0x397738;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x397738;}}function respondWithRpcPromise(_0x558364,_0x398b67,_0x229d56,_0x53b898){return new BPromise(function(_0x154958,_0x227a49){var _0x1121fa=_0x53b898||client;return _0x1121fa['request'](_0x558364,_0x229d56)[_0x35fc('0x1a')](function(_0x45c8b7){logger['info'](_0x35fc('0x1b'),_0x398b67,_0x35fc('0x1c'));logger[_0x35fc('0x1d')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x398b67,_0x35fc('0x1c'),JSON[_0x35fc('0x1e')](_0x45c8b7));if(_0x45c8b7[_0x35fc('0x1f')]){if(_0x45c8b7['error'][_0x35fc('0x20')]===0x1f4){logger[_0x35fc('0x1f')](_0x35fc('0x1b'),_0x398b67,_0x45c8b7[_0x35fc('0x1f')][_0x35fc('0x21')]);return _0x227a49(_0x45c8b7[_0x35fc('0x1f')][_0x35fc('0x21')]);}logger[_0x35fc('0x1f')](_0x35fc('0x1b'),_0x398b67,_0x45c8b7[_0x35fc('0x1f')]['message']);return _0x154958(_0x45c8b7[_0x35fc('0x1f')][_0x35fc('0x21')]);}else{logger[_0x35fc('0x22')](_0x35fc('0x1b'),_0x398b67,_0x35fc('0x1c'));_0x154958(_0x45c8b7['result'][_0x35fc('0x21')]);}})[_0x35fc('0x23')](function(_0x561bf8){logger[_0x35fc('0x1f')](_0x35fc('0x1b'),_0x398b67,_0x561bf8);_0x227a49(_0x561bf8);});});}function respondWithStatusCode(_0x3d4a98,_0x51cfec){_0x51cfec=_0x51cfec||0xcc;return function(_0x4086e9){if(_0x4086e9){return _0x3d4a98['sendStatus'](_0x51cfec);}return _0x3d4a98[_0x35fc('0x24')](_0x51cfec)[_0x35fc('0x25')]();};}function respondWithResult(_0x5cb986,_0x519264){_0x519264=_0x519264||0xc8;return function(_0x47774c){if(_0x47774c){return _0x5cb986['status'](_0x519264)[_0x35fc('0x26')](_0x47774c);}};}function respondWithFilteredResult(_0x1a5d92,_0x57001c){return function(_0x26b7cb){if(_0x26b7cb){var _0x645eac=_0x26b7cb[_0x35fc('0x27')],_0x383837=_0x57001c[_0x35fc('0x28')],_0x9f3c8a=_0x57001c[_0x35fc('0x28')]+_0x57001c['limit'],_0x3735da;if(_0x9f3c8a>=_0x645eac){_0x9f3c8a=_0x645eac;_0x3735da=0xc8;}else{_0x3735da=0xce;}_0x1a5d92[_0x35fc('0x24')](_0x3735da);return _0x1a5d92[_0x35fc('0x29')](_0x35fc('0x2a'),_0x383837+'-'+_0x9f3c8a+'/'+_0x645eac)['json'](_0x26b7cb);}return null;};}function patchUpdates(_0xe79f52){return function(_0x16f067){try{jsonpatch[_0x35fc('0x2b')](_0x16f067,_0xe79f52,!![]);}catch(_0xe6e4ba){return BPromise[_0x35fc('0x2c')](_0xe6e4ba);}return _0x16f067[_0x35fc('0x2d')]();};}function saveUpdates(_0x222ddb,_0x37b435){return function(_0xf4dfab){if(_0xf4dfab){return _0xf4dfab[_0x35fc('0x2e')](_0x222ddb)['then'](function(_0x5e0313){return _0x5e0313;});}return null;};}function removeEntity(_0x114bc1,_0x4af5fe){return function(_0x37b394){if(_0x37b394){return _0x37b394[_0x35fc('0x2f')]()[_0x35fc('0x1a')](function(){_0x114bc1[_0x35fc('0x24')](0xcc)[_0x35fc('0x25')]();});}};}function handleEntityNotFound(_0x12e78f,_0x4e43b4){return function(_0x3fe193){if(!_0x3fe193){_0x12e78f[_0x35fc('0x30')](0x194);}return _0x3fe193;};}function handleError(_0x46b9ef,_0x4441d8){_0x4441d8=_0x4441d8||0x1f4;return function(_0x2bbd36){logger[_0x35fc('0x1f')](_0x2bbd36['stack']);if(_0x2bbd36[_0x35fc('0x31')]){delete _0x2bbd36[_0x35fc('0x31')];}_0x46b9ef[_0x35fc('0x24')](_0x4441d8)['send'](_0x2bbd36);};}exports[_0x35fc('0x32')]=function(_0x48d223,_0x2ecb2e){var _0x33a377={},_0x266a11={},_0x2e00e3={'count':0x0,'rows':[]};var _0x4de4b7=_['map'](db['SalesforceAccount'][_0x35fc('0x33')],function(_0x56c06c){return{'name':_0x56c06c[_0x35fc('0x34')],'type':_0x56c06c['type'][_0x35fc('0x35')]};});_0x266a11[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0x4de4b7,_0x35fc('0x31'));_0x266a11[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x48d223[_0x35fc('0x38')]);_0x266a11['filters']=_[_0x35fc('0x3a')](_0x266a11[_0x35fc('0x36')],_0x266a11['query']);_0x33a377[_0x35fc('0x3b')]=_[_0x35fc('0x3a')](_0x266a11[_0x35fc('0x36')],qs[_0x35fc('0x3c')](_0x48d223[_0x35fc('0x38')][_0x35fc('0x3c')]));_0x33a377['attributes']=_0x33a377[_0x35fc('0x3b')][_0x35fc('0x3d')]?_0x33a377[_0x35fc('0x3b')]:_0x266a11['model'];if(!_0x48d223[_0x35fc('0x38')][_0x35fc('0x3e')]('nolimit')){_0x33a377[_0x35fc('0x3f')]=qs[_0x35fc('0x3f')](_0x48d223[_0x35fc('0x38')][_0x35fc('0x3f')]);_0x33a377[_0x35fc('0x28')]=qs[_0x35fc('0x28')](_0x48d223[_0x35fc('0x38')][_0x35fc('0x28')]);}_0x33a377['order']=qs['sort'](_0x48d223[_0x35fc('0x38')][_0x35fc('0x40')]);_0x33a377['where']=qs['filters'](_['pick'](_0x48d223[_0x35fc('0x38')],_0x266a11[_0x35fc('0x41')]));if(_0x48d223['query'][_0x35fc('0x42')]){_0x33a377[_0x35fc('0x43')]=_[_0x35fc('0x44')](_0x33a377[_0x35fc('0x43')],{'$or':_['map'](_0x4de4b7,function(_0x57105c){if(_0x57105c['type']!=='VIRTUAL'){var _0x56bdb9={};_0x56bdb9[_0x57105c[_0x35fc('0x31')]]={'$like':'%'+_0x48d223[_0x35fc('0x38')]['filter']+'%'};return _0x56bdb9;}})});}_0x33a377=_[_0x35fc('0x44')]({},_0x33a377,_0x48d223['options']);var _0x13d16c={'where':_0x33a377[_0x35fc('0x43')]};return db[_0x35fc('0x45')][_0x35fc('0x27')](_0x13d16c)[_0x35fc('0x1a')](function(_0x5d3d0f){_0x2e00e3[_0x35fc('0x27')]=_0x5d3d0f;if(_0x48d223[_0x35fc('0x38')]['includeAll']){_0x33a377[_0x35fc('0x46')]=[{'all':!![]}];}return db[_0x35fc('0x45')][_0x35fc('0x47')](_0x33a377);})[_0x35fc('0x1a')](function(_0x5bc8c3){_0x2e00e3[_0x35fc('0x48')]=_0x5bc8c3;return _0x2e00e3;})['then'](respondWithFilteredResult(_0x2ecb2e,_0x33a377))['catch'](handleError(_0x2ecb2e,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){var _0xca8aef={'raw':![],'where':{'id':_0x9db7e8[_0x35fc('0x4a')]['id']}},_0xf2ca20={};_0xf2ca20[_0x35fc('0x36')]=_[_0x35fc('0x39')](db['SalesforceAccount'][_0x35fc('0x33')]);_0xf2ca20[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x9db7e8[_0x35fc('0x38')]);_0xf2ca20[_0x35fc('0x41')]=_[_0x35fc('0x3a')](_0xf2ca20[_0x35fc('0x36')],_0xf2ca20[_0x35fc('0x38')]);_0xca8aef[_0x35fc('0x3b')]=_[_0x35fc('0x3a')](_0xf2ca20[_0x35fc('0x36')],qs[_0x35fc('0x3c')](_0x9db7e8[_0x35fc('0x38')][_0x35fc('0x3c')]));_0xca8aef['attributes']=_0xca8aef['attributes'][_0x35fc('0x3d')]?_0xca8aef[_0x35fc('0x3b')]:_0xf2ca20[_0x35fc('0x36')];if(_0x9db7e8[_0x35fc('0x38')][_0x35fc('0x4b')]){_0xca8aef[_0x35fc('0x46')]=[{'all':!![]}];}_0xca8aef=_['merge']({},_0xca8aef,_0x9db7e8['options']);return db[_0x35fc('0x45')][_0x35fc('0x4c')](_0xca8aef)[_0x35fc('0x1a')](handleEntityNotFound(_0x18dc78,null))[_0x35fc('0x1a')](respondWithResult(_0x18dc78,null))['catch'](handleError(_0x18dc78,null));};exports[_0x35fc('0x4d')]=function(_0x13281f,_0x4965d2){return db[_0x35fc('0x45')][_0x35fc('0x4d')](_0x13281f['body'],{})[_0x35fc('0x1a')](respondWithResult(_0x4965d2,0xc9))[_0x35fc('0x23')](handleError(_0x4965d2,null));};exports[_0x35fc('0x2e')]=function(_0x18f18b,_0x5e4018){if(_0x18f18b['body']['id']){delete _0x18f18b['body']['id'];}return db[_0x35fc('0x45')][_0x35fc('0x4c')]({'where':{'id':_0x18f18b['params']['id']}})[_0x35fc('0x1a')](handleEntityNotFound(_0x5e4018,null))[_0x35fc('0x1a')](saveUpdates(_0x18f18b[_0x35fc('0x4e')],null))[_0x35fc('0x1a')](respondWithResult(_0x5e4018,null))[_0x35fc('0x23')](handleError(_0x5e4018,null));};exports['destroy']=function(_0x2d9d45,_0x757aa6){return db[_0x35fc('0x45')]['find']({'where':{'id':_0x2d9d45[_0x35fc('0x4a')]['id']}})[_0x35fc('0x1a')](handleEntityNotFound(_0x757aa6,null))['then'](removeEntity(_0x757aa6,null))[_0x35fc('0x23')](handleError(_0x757aa6,null));};exports[_0x35fc('0x4f')]=function(_0x1c46b1,_0x1c4c33,_0x314666){var _0x41453b={};var _0x8501d1={};var _0x998fd9;var _0x53a79d;return db[_0x35fc('0x45')][_0x35fc('0x50')]({'where':{'id':_0x1c46b1[_0x35fc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c4c33,null))[_0x35fc('0x1a')](function(_0x559d2b){if(_0x559d2b){_0x998fd9=_0x559d2b;_0x8501d1['model']=_['keys'](db[_0x35fc('0x51')][_0x35fc('0x33')]);_0x8501d1[_0x35fc('0x38')]=_[_0x35fc('0x39')](_0x1c46b1[_0x35fc('0x38')]);_0x8501d1['filters']=_['intersection'](_0x8501d1['model'],_0x8501d1['query']);_0x41453b['attributes']=_[_0x35fc('0x3a')](_0x8501d1[_0x35fc('0x36')],qs[_0x35fc('0x3c')](_0x1c46b1[_0x35fc('0x38')]['fields']));_0x41453b[_0x35fc('0x3b')]=_0x41453b[_0x35fc('0x3b')][_0x35fc('0x3d')]?_0x41453b[_0x35fc('0x3b')]:_0x8501d1[_0x35fc('0x36')];_0x41453b[_0x35fc('0x52')]=qs[_0x35fc('0x40')](_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x40')]);_0x41453b['where']=qs[_0x35fc('0x41')](_['pick'](_0x1c46b1[_0x35fc('0x38')],_0x8501d1[_0x35fc('0x41')]));if(_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x42')]){_0x41453b['where']=_[_0x35fc('0x44')](_0x41453b['where'],{'$or':_['map'](_0x41453b['attributes'],function(_0x10dd1a){var _0x5dfeb7={};_0x5dfeb7[_0x10dd1a]={'$like':'%'+_0x1c46b1[_0x35fc('0x38')]['filter']+'%'};return _0x5dfeb7;})});}_0x41453b=_[_0x35fc('0x44')]({},_0x41453b,_0x1c46b1['options']);return _0x998fd9[_0x35fc('0x4f')](_0x41453b);}})[_0x35fc('0x1a')](function(_0x3400f0){if(_0x3400f0){_0x53a79d=_0x3400f0[_0x35fc('0x3d')];if(!_0x1c46b1['query'][_0x35fc('0x3e')](_0x35fc('0x53'))){_0x41453b[_0x35fc('0x3f')]=qs['limit'](_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x3f')]);_0x41453b[_0x35fc('0x28')]=qs[_0x35fc('0x28')](_0x1c46b1[_0x35fc('0x38')][_0x35fc('0x28')]);}return _0x998fd9[_0x35fc('0x4f')](_0x41453b);}})[_0x35fc('0x1a')](function(_0x5159a0){if(_0x5159a0){return _0x5159a0?{'count':_0x53a79d,'rows':_0x5159a0}:null;}})[_0x35fc('0x1a')](respondWithResult(_0x1c4c33,null))[_0x35fc('0x23')](handleError(_0x1c4c33,null));};exports[_0x35fc('0x54')]=function(_0x4a926d,_0x1c88d8,_0x1b76f0){if(_0x4a926d['body']['id']){delete _0x4a926d['body']['id'];}return db[_0x35fc('0x45')]['findOne']({'where':{'id':_0x4a926d[_0x35fc('0x4a')]['id']}})[_0x35fc('0x1a')](handleEntityNotFound(_0x1c88d8,null))[_0x35fc('0x1a')](function(_0x10952a){if(_0x10952a){_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x55')]=_0x10952a['id'];_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x56')]=integrations[_0x35fc('0x57')](_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x58')],_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x59')]);_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x5a')]=integrations[_0x35fc('0x5b')](_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x58')],_0x4a926d[_0x35fc('0x4e')][_0x35fc('0x59')]);return db['SalesforceConfiguration'][_0x35fc('0x4d')](_0x4a926d['body'],{'include':[{'model':db[_0x35fc('0x5c')],'as':_0x35fc('0x56')},{'model':db[_0x35fc('0x5c')],'as':_0x35fc('0x5a')}]});}return null;})[_0x35fc('0x1a')](respondWithResult(_0x1c88d8,null))[_0x35fc('0x23')](handleError(_0x1c88d8,null));};exports[_0x35fc('0x5d')]=function(_0x32023a,_0x2fed7b,_0x2656e5){var _0x2ee880;var _0x580062='';var _0x446e87=_0x35fc('0x5e');return db[_0x35fc('0x45')][_0x35fc('0x50')]({'where':{'id':_0x32023a[_0x35fc('0x4a')]['id']},'attributes':['id',_0x35fc('0x5f'),'clientId',_0x35fc('0x60'),_0x35fc('0x61'),_0x35fc('0x62'),_0x35fc('0x63')]})[_0x35fc('0x1a')](handleEntityNotFound(_0x2fed7b,null))[_0x35fc('0x1a')](function(_0x2d1cbf){if(_0x2d1cbf){_0x580062=_0x2d1cbf[_0x35fc('0x5f')];var _0xa92234=_0x580062['slice'](-0x1);if(_0xa92234==='/'){_0x580062=_0x580062[_0x35fc('0x64')](0x0,_0x580062['lastIndexOf'](_0xa92234));}_0x2ee880=new jsforce[(_0x35fc('0x65'))]({'oauth2':{'loginUrl':_0x580062,'clientId':_0x2d1cbf[_0x35fc('0x66')],'clientSecret':_0x2d1cbf['clientSecret']}});return _0x2ee880[_0x35fc('0x67')](_0x2d1cbf[_0x35fc('0x61')],_0x2d1cbf[_0x35fc('0x62')][_0x35fc('0x68')](_0x2d1cbf[_0x35fc('0x63')]));}})[_0x35fc('0x1a')](function(_0x42f87e){if(_0x42f87e){if(!_[_0x35fc('0x69')](_0x32023a[_0x35fc('0x38')]['ticketType'])){_0x446e87=_0x32023a['query']['ticketType'];}return _0x2ee880['sobject'](_0x446e87)[_0x35fc('0x6a')]();}})[_0x35fc('0x1a')](function(_0x8fc410){var _0x1f5cbc=[_0x35fc('0x6b'),'CallDurationInSeconds',_0x35fc('0x6c'),_0x35fc('0x6d'),_0x35fc('0x6e'),_0x35fc('0x6f'),'Status',_0x35fc('0x70')];if(!_[_0x35fc('0x69')](_0x32023a[_0x35fc('0x38')]['ticketType'])&&_0x32023a[_0x35fc('0x38')][_0x35fc('0x71')]===_0x35fc('0x72')){_0x1f5cbc=[_0x35fc('0x70'),_0x35fc('0x73'),_0x35fc('0x74'),_0x35fc('0x75'),_0x35fc('0x6f'),'IsEscalated',_0x35fc('0x76'),_0x35fc('0x77')];}if(_0x8fc410){_[_0x35fc('0x78')](_0x8fc410[_0x35fc('0x3c')],function(_0x221c5b){return _0x221c5b[_0x35fc('0x79')]===![]&&!_0x1f5cbc['includes'](_0x221c5b[_0x35fc('0x31')]);});return{'count':_0x8fc410['fields']['length'],'rows':_[_0x35fc('0x37')](_0x8fc410['fields'],function(_0x1246c7){return{'id':_0x1246c7[_0x35fc('0x31')],'name':_0x1246c7[_0x35fc('0x7a')],'custom':_0x1246c7['custom'],'options':_0x1246c7[_0x35fc('0x7b')][_0x35fc('0x3d')]>0x0?_[_0x35fc('0x37')](_0x1246c7[_0x35fc('0x7b')],function(_0x21f7e6){return{'name':_0x21f7e6['label'],'value':_0x21f7e6['value']};}):_0x1246c7['type']==_0x35fc('0x7c')?[{'name':'True','value':_0x35fc('0x7d')},{'name':_0x35fc('0x7e'),'value':_0x35fc('0x7f')}]:[]};})};}})[_0x35fc('0x1a')](respondWithResult(_0x2fed7b,null))['catch'](function(_0x28e80d){var _0x243e4e=_0x32023a[_0x35fc('0x38')]['test']?0x1f4:_0x28e80d[_0x35fc('0x80')]||0x1f4;logger[_0x35fc('0x1f')](_0x35fc('0x81'),'getFields',_0x243e4e,JSON['stringify'](_0x28e80d));delete _0x28e80d['name'];if(_0x243e4e===0x191){_0x243e4e=0x190;}_0x2fed7b[_0x35fc('0x24')](_0x243e4e)[_0x35fc('0x82')](_0x32023a[_0x35fc('0x38')][_0x35fc('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x28e80d[_0x35fc('0x80')]}:_0x28e80d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index e7d8abc..63d9fe5 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 _0x8528=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x4c7d23,_0x307b9b){var _0x3b9247=function(_0x51e051){while(--_0x51e051){_0x4c7d23['push'](_0x4c7d23['shift']());}};_0x3b9247(++_0x307b9b);}(_0x8528,0x1c2));var _0x8852=function(_0x42c20e,_0x411558){_0x42c20e=_0x42c20e-0x0;var _0x3113df=_0x8528[_0x42c20e];return _0x3113df;};'use strict';var _=require('lodash');var util=require(_0x8852('0x0'));var logger=require(_0x8852('0x1'))(_0x8852('0x2'));var moment=require(_0x8852('0x3'));var BPromise=require(_0x8852('0x4'));var rp=require(_0x8852('0x5'));var fs=require('fs');var path=require(_0x8852('0x6'));var rimraf=require(_0x8852('0x7'));var config=require(_0x8852('0x8'));var attributes=require(_0x8852('0x9'));var integrations=require(_0x8852('0xa'));module[_0x8852('0xb')]=function(_0x140a7e,_0x2fb1d4){return _0x140a7e[_0x8852('0xc')](_0x8852('0xd'),attributes,{'tableName':_0x8852('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e9f=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x53d578,_0x4ca37f){var _0x5ce805=function(_0x237705){while(--_0x237705){_0x53d578['push'](_0x53d578['shift']());}};_0x5ce805(++_0x4ca37f);}(_0x1e9f,0xc9));var _0xf1e9=function(_0xeabab7,_0x3c00b5){_0xeabab7=_0xeabab7-0x0;var _0x3f8013=_0x1e9f[_0xeabab7];return _0x3f8013;};'use strict';var _=require(_0xf1e9('0x0'));var util=require('util');var logger=require(_0xf1e9('0x1'))(_0xf1e9('0x2'));var moment=require(_0xf1e9('0x3'));var BPromise=require(_0xf1e9('0x4'));var rp=require(_0xf1e9('0x5'));var fs=require('fs');var path=require(_0xf1e9('0x6'));var rimraf=require(_0xf1e9('0x7'));var config=require(_0xf1e9('0x8'));var attributes=require(_0xf1e9('0x9'));var integrations=require(_0xf1e9('0xa'));module[_0xf1e9('0xb')]=function(_0x1431d3,_0xff1381){return _0x1431d3[_0xf1e9('0xc')](_0xf1e9('0xd'),attributes,{'tableName':_0xf1e9('0xe'),'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 9b9f6c0..74ed0cc 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 _0x3667=['debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','limit','include','map','model','attributes','where','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3e3c83,_0x4efc65){var _0x17da53=function(_0xcc9832){while(--_0xcc9832){_0x3e3c83['push'](_0x3e3c83['shift']());}};_0x17da53(++_0x4efc65);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var moment=require(_0x7366('0x2'));var BPromise=require(_0x7366('0x3'));var rs=require(_0x7366('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7366('0x5'))['db'];var utils=require(_0x7366('0x6'));var logger=require('../../config/logger')(_0x7366('0x7'));var config=require(_0x7366('0x8'));var jayson=require(_0x7366('0x9'));var client=jayson[_0x7366('0xa')][_0x7366('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x589397,_0x28f6c8,_0xa1a3c5){return new BPromise(function(_0x2dd32b,_0x26e9a9){return client[_0x7366('0xc')](_0x589397,_0xa1a3c5)[_0x7366('0xd')](function(_0x1995c7){logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));logger[_0x7366('0x11')](_0x7366('0x12'),_0x28f6c8,_0x7366('0x10'),JSON[_0x7366('0x13')](_0x1995c7));if(_0x1995c7[_0x7366('0x14')]){if(_0x1995c7[_0x7366('0x14')][_0x7366('0x15')]===0x1f4){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x26e9a9(_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);}logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x2dd32b(_0x1995c7[_0x7366('0x14')]['message']);}else{logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));_0x2dd32b(_0x1995c7[_0x7366('0x17')][_0x7366('0x16')]);}})[_0x7366('0x18')](function(_0x2bc2af){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x2bc2af);_0x26e9a9(_0x2bc2af);});});}exports[_0x7366('0x19')]=function(_0x1a71f5){var _0x49e50b=this;return new Promise(function(_0x208ac8,_0x4ffbc7){return db[_0x7366('0x1a')][_0x7366('0x1b')]({'raw':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5['options'][_0x7366('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')]['where']||null:null,'attributes':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')]['attributes']||null:null,'limit':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')][_0x7366('0x1e')]||null:null,'include':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')][_0x7366('0x1f')]?_[_0x7366('0x20')](_0x1a71f5[_0x7366('0x1c')][_0x7366('0x1f')],function(_0x301220){return{'model':db[_0x301220[_0x7366('0x21')]],'as':_0x301220['as'],'attributes':_0x301220[_0x7366('0x22')],'include':_0x301220[_0x7366('0x1f')]?_['map'](_0x301220[_0x7366('0x1f')],function(_0x4fe7cf){return{'model':db[_0x4fe7cf[_0x7366('0x21')]],'as':_0x4fe7cf['as'],'attributes':_0x4fe7cf['attributes'],'include':_0x4fe7cf['include']?_[_0x7366('0x20')](_0x4fe7cf['include'],function(_0x254374){return{'model':db[_0x254374['model']],'as':_0x254374['as'],'attributes':_0x254374[_0x7366('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7366('0xd')](function(_0x5c37e2){logger[_0x7366('0xe')]('GetSalesforceAccount',_0x1a71f5);logger[_0x7366('0x11')](_0x7366('0x19'),_0x1a71f5,JSON['stringify'](_0x5c37e2));_0x208ac8(_0x5c37e2);})[_0x7366('0x18')](function(_0x507baf){logger[_0x7366('0x14')](_0x7366('0x19'),_0x507baf[_0x7366('0x16')],_0x1a71f5);_0x4ffbc7(_0x49e50b[_0x7366('0x14')](0x1f4,_0x507baf[_0x7366('0x16')]));});});};exports['ShowSalesforceAccount']=function(_0x166628){var _0x447807=this;return new Promise(function(_0x538d42,_0x4a0863){return db['SalesforceAccount']['find']({'raw':_0x166628[_0x7366('0x1c')]?_0x166628[_0x7366('0x1c')][_0x7366('0x1d')]===undefined?!![]:![]:!![],'where':_0x166628[_0x7366('0x1c')]?_0x166628['options'][_0x7366('0x23')]||null:null,'attributes':_0x166628[_0x7366('0x1c')]?_0x166628[_0x7366('0x1c')][_0x7366('0x22')]||null:null,'include':_0x166628['options']?_0x166628[_0x7366('0x1c')][_0x7366('0x1f')]?_['map'](_0x166628[_0x7366('0x1c')][_0x7366('0x1f')],function(_0x1de991){return{'model':db[_0x1de991[_0x7366('0x21')]],'as':_0x1de991['as'],'attributes':_0x1de991[_0x7366('0x22')],'include':_0x1de991[_0x7366('0x1f')]?_[_0x7366('0x20')](_0x1de991[_0x7366('0x1f')],function(_0x437713){return{'model':db[_0x437713['model']],'as':_0x437713['as'],'attributes':_0x437713[_0x7366('0x22')],'include':_0x437713[_0x7366('0x1f')]?_['map'](_0x437713[_0x7366('0x1f')],function(_0x2c5642){return{'model':db[_0x2c5642[_0x7366('0x21')]],'as':_0x2c5642['as'],'attributes':_0x2c5642['attributes']};}):[]};}):[]};}):[]:[]})[_0x7366('0xd')](function(_0x4fcf2b){logger[_0x7366('0xe')]('ShowSalesforceAccount',_0x166628);logger['debug'](_0x7366('0x24'),_0x166628,JSON['stringify'](_0x4fcf2b));_0x538d42(_0x4fcf2b);})[_0x7366('0x18')](function(_0x116081){logger['error'](_0x7366('0x24'),_0x116081['message'],_0x166628);_0x4a0863(_0x447807[_0x7366('0x14')](0x1f4,_0x116081[_0x7366('0x16')]));});});}; \ No newline at end of file +var _0x4ded=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','error','code','SalesforceAccount,\x20%s,\x20%s','message','info','result','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','include','map','model','stringify','find','ShowSalesforceAccount','lodash','util'];(function(_0x15ed15,_0x598a4d){var _0x1a05cc=function(_0xa6207b){while(--_0xa6207b){_0x15ed15['push'](_0x15ed15['shift']());}};_0x1a05cc(++_0x598a4d);}(_0x4ded,0x116));var _0xd4de=function(_0x51b35e,_0x263238){_0x51b35e=_0x51b35e-0x0;var _0x2b5627=_0x4ded[_0x51b35e];return _0x2b5627;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2433b8,_0x15eb91,_0x2c56d5){return new BPromise(function(_0x4453c2,_0x1e8c35){return client['request'](_0x2433b8,_0x2c56d5)[_0xd4de('0xd')](function(_0x5ebcf3){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x15eb91,_0xd4de('0xe'));logger[_0xd4de('0xf')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x15eb91,'request\x20sent',JSON['stringify'](_0x5ebcf3));if(_0x5ebcf3[_0xd4de('0x10')]){if(_0x5ebcf3['error'][_0xd4de('0x11')]===0x1f4){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x1e8c35(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x4453c2(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}else{logger[_0xd4de('0x14')](_0xd4de('0x12'),_0x15eb91,_0xd4de('0xe'));_0x4453c2(_0x5ebcf3[_0xd4de('0x15')]['message']);}})['catch'](function(_0x3df820){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x3df820);_0x1e8c35(_0x3df820);});});}exports[_0xd4de('0x16')]=function(_0x5b1d1c){var _0x4d0df6=this;return new Promise(function(_0x1e91d5,_0x54b757){return db[_0xd4de('0x17')][_0xd4de('0x18')]({'raw':_0x5b1d1c['options']?_0x5b1d1c[_0xd4de('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1a')]||null:null,'attributes':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c['options'][_0xd4de('0x1b')]||null:null,'limit':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1c')]||null:null,'include':_0x5b1d1c[_0xd4de('0x19')]?_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x5b1d1c[_0xd4de('0x19')][_0xd4de('0x1d')],function(_0x534b37){return{'model':db[_0x534b37[_0xd4de('0x1f')]],'as':_0x534b37['as'],'attributes':_0x534b37[_0xd4de('0x1b')],'include':_0x534b37[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x534b37[_0xd4de('0x1d')],function(_0x984904){return{'model':db[_0x984904[_0xd4de('0x1f')]],'as':_0x984904['as'],'attributes':_0x984904[_0xd4de('0x1b')],'include':_0x984904[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x984904[_0xd4de('0x1d')],function(_0xb2d8a1){return{'model':db[_0xb2d8a1['model']],'as':_0xb2d8a1['as'],'attributes':_0xb2d8a1[_0xd4de('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd4de('0xd')](function(_0x5005b0){logger[_0xd4de('0x14')]('GetSalesforceAccount',_0x5b1d1c);logger[_0xd4de('0xf')](_0xd4de('0x16'),_0x5b1d1c,JSON[_0xd4de('0x20')](_0x5005b0));_0x1e91d5(_0x5005b0);})['catch'](function(_0xd4de93){logger[_0xd4de('0x10')](_0xd4de('0x16'),_0xd4de93['message'],_0x5b1d1c);_0x54b757(_0x4d0df6[_0xd4de('0x10')](0x1f4,_0xd4de93[_0xd4de('0x13')]));});});};exports['ShowSalesforceAccount']=function(_0x5103b5){var _0x5706fe=this;return new Promise(function(_0x3f6491,_0x496795){return db[_0xd4de('0x17')][_0xd4de('0x21')]({'raw':_0x5103b5[_0xd4de('0x19')]?_0x5103b5[_0xd4de('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5103b5[_0xd4de('0x19')]?_0x5103b5[_0xd4de('0x19')]['where']||null:null,'attributes':_0x5103b5[_0xd4de('0x19')]?_0x5103b5[_0xd4de('0x19')]['attributes']||null:null,'include':_0x5103b5['options']?_0x5103b5[_0xd4de('0x19')][_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x5103b5[_0xd4de('0x19')]['include'],function(_0x2bdc98){return{'model':db[_0x2bdc98[_0xd4de('0x1f')]],'as':_0x2bdc98['as'],'attributes':_0x2bdc98['attributes'],'include':_0x2bdc98[_0xd4de('0x1d')]?_[_0xd4de('0x1e')](_0x2bdc98[_0xd4de('0x1d')],function(_0x34528a){return{'model':db[_0x34528a[_0xd4de('0x1f')]],'as':_0x34528a['as'],'attributes':_0x34528a[_0xd4de('0x1b')],'include':_0x34528a['include']?_['map'](_0x34528a[_0xd4de('0x1d')],function(_0x2d2fda){return{'model':db[_0x2d2fda[_0xd4de('0x1f')]],'as':_0x2d2fda['as'],'attributes':_0x2d2fda['attributes']};}):[]};}):[]};}):[]:[]})[_0xd4de('0xd')](function(_0x44b96c){logger['info'](_0xd4de('0x22'),_0x5103b5);logger[_0xd4de('0xf')](_0xd4de('0x22'),_0x5103b5,JSON[_0xd4de('0x20')](_0x44b96c));_0x3f6491(_0x44b96c);})['catch'](function(_0x53d7dc){logger[_0xd4de('0x10')]('ShowSalesforceAccount',_0x53d7dc[_0xd4de('0x13')],_0x5103b5);_0x496795(_0x5706fe['error'](0x1f4,_0x53d7dc[_0xd4de('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 07e5fd3..216c6a5 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 _0x1a5d=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x1ac4b0,_0x5d15b2){var _0x59caec=function(_0x3b6ecc){while(--_0x3b6ecc){_0x1ac4b0['push'](_0x1ac4b0['shift']());}};_0x59caec(++_0x5d15b2);}(_0x1a5d,0x155));var _0xd1a5=function(_0x2e4ca1,_0x371286){_0x2e4ca1=_0x2e4ca1-0x0;var _0x206c57=_0x1a5d[_0x2e4ca1];return _0x206c57;};'use strict';var multer=require(_0xd1a5('0x0'));var util=require(_0xd1a5('0x1'));var path=require(_0xd1a5('0x2'));var timeout=require(_0xd1a5('0x3'));var express=require(_0xd1a5('0x4'));var router=express['Router']();var auth=require(_0xd1a5('0x5'));var interaction=require(_0xd1a5('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x8')]);router[_0xd1a5('0x9')](_0xd1a5('0xa'),auth[_0xd1a5('0x7')](),controller[_0xd1a5('0xb')]);router[_0xd1a5('0x9')]('/:id/fields',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0xc')]);router[_0xd1a5('0x9')](_0xd1a5('0xd'),auth['isAuthenticated'](),controller[_0xd1a5('0xe')]);router[_0xd1a5('0x9')](_0xd1a5('0xf'),auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x10')]);router[_0xd1a5('0x11')]('/',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x12')]);router[_0xd1a5('0x13')](_0xd1a5('0xa'),auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x14')]);router[_0xd1a5('0x15')]('/:id',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x16')]);module[_0xd1a5('0x17')]=router; \ No newline at end of file +var _0xde93=['util','path','express','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id','update','delete','exports'];(function(_0x5e64ec,_0xe91ac3){var _0x385589=function(_0x7c9b47){while(--_0x7c9b47){_0x5e64ec['push'](_0x5e64ec['shift']());}};_0x385589(++_0xe91ac3);}(_0xde93,0xb4));var _0x3de9=function(_0x427f93,_0x356c09){_0x427f93=_0x427f93-0x0;var _0x31ad0c=_0xde93[_0x427f93];return _0x31ad0c;};'use strict';var multer=require('multer');var util=require(_0x3de9('0x0'));var path=require(_0x3de9('0x1'));var timeout=require('connect-timeout');var express=require(_0x3de9('0x2'));var router=express['Router']();var auth=require(_0x3de9('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x3de9('0x4'));var controller=require(_0x3de9('0x5'));router[_0x3de9('0x6')]('/',auth[_0x3de9('0x7')](),controller[_0x3de9('0x8')]);router[_0x3de9('0x6')]('/:id',auth[_0x3de9('0x7')](),controller[_0x3de9('0x9')]);router['get'](_0x3de9('0xa'),auth[_0x3de9('0x7')](),controller['getFields']);router[_0x3de9('0x6')](_0x3de9('0xb'),auth[_0x3de9('0x7')](),controller['getSubjects']);router[_0x3de9('0x6')](_0x3de9('0xc'),auth[_0x3de9('0x7')](),controller[_0x3de9('0xd')]);router[_0x3de9('0xe')]('/',auth[_0x3de9('0x7')](),controller[_0x3de9('0xf')]);router['put'](_0x3de9('0x10'),auth[_0x3de9('0x7')](),controller[_0x3de9('0x11')]);router[_0x3de9('0x12')](_0x3de9('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x3de9('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 6d6998d..4f6de0a 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 _0x6a41=['nothing','lead','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x1e82c6,_0x95874b){var _0x291f4c=function(_0x53c935){while(--_0x53c935){_0x1e82c6['push'](_0x1e82c6['shift']());}};_0x291f4c(++_0x95874b);}(_0x6a41,0x11a));var _0x16a4=function(_0x32674b,_0x50cba5){_0x32674b=_0x32674b-0x0;var _0x38d463=_0x6a41[_0x32674b];return _0x38d463;};'use strict';var Sequelize=require(_0x16a4('0x0'));module[_0x16a4('0x1')]={'name':{'type':Sequelize[_0x16a4('0x2')]},'description':{'type':Sequelize[_0x16a4('0x2')]},'ticketType':{'type':Sequelize[_0x16a4('0x3')](_0x16a4('0x4'),_0x16a4('0x5')),'defaultValue':_0x16a4('0x4')},'moduleSearch':{'type':Sequelize[_0x16a4('0x3')](_0x16a4('0x6'),_0x16a4('0x7'),'lead'),'defaultValue':_0x16a4('0x6')},'moduleCreate':{'type':Sequelize[_0x16a4('0x3')](_0x16a4('0x8'),'contact',_0x16a4('0x9')),'defaultValue':_0x16a4('0x9')}}; \ No newline at end of file +var _0x2610=['ENUM','Task','contact_lead','lead','nothing','contact','sequelize','exports','STRING'];(function(_0x4328ca,_0x157ab9){var _0x394203=function(_0x46a0d8){while(--_0x46a0d8){_0x4328ca['push'](_0x4328ca['shift']());}};_0x394203(++_0x157ab9);}(_0x2610,0x69));var _0x0261=function(_0x4b8fdb,_0x5d7f38){_0x4b8fdb=_0x4b8fdb-0x0;var _0x4e5601=_0x2610[_0x4b8fdb];return _0x4e5601;};'use strict';var Sequelize=require(_0x0261('0x0'));module[_0x0261('0x1')]={'name':{'type':Sequelize[_0x0261('0x2')]},'description':{'type':Sequelize[_0x0261('0x2')]},'ticketType':{'type':Sequelize[_0x0261('0x3')](_0x0261('0x4'),'Case'),'defaultValue':_0x0261('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x0261('0x5'),'contact',_0x0261('0x6')),'defaultValue':_0x0261('0x5')},'moduleCreate':{'type':Sequelize[_0x0261('0x3')](_0x0261('0x7'),_0x0261('0x8'),_0x0261('0x6')),'defaultValue':_0x0261('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 8f8c4d8..7b1a4ad 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 _0xcbbb=['reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceConfiguration','includeAll','include','rows','show','keys','find','body','params','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0x1895c9,_0x3e2ae3){var _0xb48189=function(_0x52c1f3){while(--_0x52c1f3){_0x1895c9['push'](_0x1895c9['shift']());}};_0xb48189(++_0x3e2ae3);}(_0xcbbb,0x140));var _0xbcbb=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0xcbbb[_0xf84870];return _0x4541a4;};'use strict';var pdf=require(_0xbcbb('0x0'));var emlformat=require(_0xbcbb('0x1'));var rimraf=require(_0xbcbb('0x2'));var zipdir=require(_0xbcbb('0x3'));var jsonpatch=require(_0xbcbb('0x4'));var rp=require(_0xbcbb('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcbb('0x6'));var path=require(_0xbcbb('0x7'));var sox=require('sox');var csv=require(_0xbcbb('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbcbb('0x9'));var squel=require(_0xbcbb('0xa'));var crypto=require(_0xbcbb('0xb'));var jsforce=require(_0xbcbb('0xc'));var deskjs=require(_0xbcbb('0xd'));var toCsv=require(_0xbcbb('0x8'));var querystring=require(_0xbcbb('0xe'));var Papa=require(_0xbcbb('0xf'));var Redis=require(_0xbcbb('0x10'));var authService=require(_0xbcbb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbcbb('0x12'));var hardwareService=require(_0xbcbb('0x13'));var logger=require(_0xbcbb('0x14'))(_0xbcbb('0x15'));var utils=require(_0xbcbb('0x16'));var config=require('../../config/environment');var db=require(_0xbcbb('0x17'))['db'];var jayson=require(_0xbcbb('0x18'));var client=jayson[_0xbcbb('0x19')][_0xbcbb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xb01482,_0x383f73,_0x22b956){if(_0x22b956){var _0x3dfdad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3dfdad['test'](_0x383f73)){return _0xb01482;}else{throw new db[(_0xbcbb('0x1b'))][(_0xbcbb('0x1c'))](_0xbcbb('0x1d'));}}else{return _0xb01482;}}function respondWithRpcPromise(_0x482a4e,_0xc2f039,_0x3457ce,_0x35263d){return new BPromise(function(_0x19692e,_0x416990){var _0x2223b2=_0x35263d||client;return _0x2223b2[_0xbcbb('0x1e')](_0x482a4e,_0x3457ce)['then'](function(_0xecbe6a){logger[_0xbcbb('0x1f')](_0xbcbb('0x20'),_0xc2f039,_0xbcbb('0x21'));logger[_0xbcbb('0x22')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xc2f039,'request\x20sent',JSON[_0xbcbb('0x23')](_0xecbe6a));if(_0xecbe6a[_0xbcbb('0x24')]){if(_0xecbe6a[_0xbcbb('0x24')]['code']===0x1f4){logger[_0xbcbb('0x24')]('SalesforceConfiguration,\x20%s,\x20%s',_0xc2f039,_0xecbe6a[_0xbcbb('0x24')][_0xbcbb('0x25')]);return _0x416990(_0xecbe6a[_0xbcbb('0x24')][_0xbcbb('0x25')]);}logger['error'](_0xbcbb('0x20'),_0xc2f039,_0xecbe6a[_0xbcbb('0x24')]['message']);return _0x19692e(_0xecbe6a[_0xbcbb('0x24')][_0xbcbb('0x25')]);}else{logger[_0xbcbb('0x1f')](_0xbcbb('0x20'),_0xc2f039,'request\x20sent');_0x19692e(_0xecbe6a['result'][_0xbcbb('0x25')]);}})[_0xbcbb('0x26')](function(_0x3af846){logger[_0xbcbb('0x24')](_0xbcbb('0x20'),_0xc2f039,_0x3af846);_0x416990(_0x3af846);});});}function respondWithStatusCode(_0x3f683c,_0xe07165){_0xe07165=_0xe07165||0xcc;return function(_0x822ba2){if(_0x822ba2){return _0x3f683c[_0xbcbb('0x27')](_0xe07165);}return _0x3f683c[_0xbcbb('0x28')](_0xe07165)[_0xbcbb('0x29')]();};}function respondWithResult(_0x39cfd9,_0xb8aedc){_0xb8aedc=_0xb8aedc||0xc8;return function(_0x1d62de){if(_0x1d62de){return _0x39cfd9[_0xbcbb('0x28')](_0xb8aedc)[_0xbcbb('0x2a')](_0x1d62de);}};}function respondWithFilteredResult(_0x428383,_0x47333e){return function(_0x495ae2){if(_0x495ae2){var _0x472d0e=_0x495ae2[_0xbcbb('0x2b')],_0x25e827=_0x47333e[_0xbcbb('0x2c')],_0x18ca68=_0x47333e[_0xbcbb('0x2c')]+_0x47333e[_0xbcbb('0x2d')],_0x56dee4;if(_0x18ca68>=_0x472d0e){_0x18ca68=_0x472d0e;_0x56dee4=0xc8;}else{_0x56dee4=0xce;}_0x428383['status'](_0x56dee4);return _0x428383['set'](_0xbcbb('0x2e'),_0x25e827+'-'+_0x18ca68+'/'+_0x472d0e)['json'](_0x495ae2);}return null;};}function patchUpdates(_0x55b2e8){return function(_0x52cd8e){try{jsonpatch[_0xbcbb('0x2f')](_0x52cd8e,_0x55b2e8,!![]);}catch(_0x22b2d0){return BPromise[_0xbcbb('0x30')](_0x22b2d0);}return _0x52cd8e['save']();};}function saveUpdates(_0x24f97b,_0x4a945c){return function(_0x1b3fdd){if(_0x1b3fdd){return _0x1b3fdd[_0xbcbb('0x31')](_0x24f97b)[_0xbcbb('0x32')](function(_0x3f2602){return _0x3f2602;});}return null;};}function removeEntity(_0xa4ec3,_0x46d499){return function(_0x505fba){if(_0x505fba){return _0x505fba[_0xbcbb('0x33')]()['then'](function(){_0xa4ec3[_0xbcbb('0x28')](0xcc)[_0xbcbb('0x29')]();});}};}function handleEntityNotFound(_0x42e45b,_0x251ca8){return function(_0xdd4f4d){if(!_0xdd4f4d){_0x42e45b['sendStatus'](0x194);}return _0xdd4f4d;};}function handleError(_0x19bbfb,_0x2b835d){_0x2b835d=_0x2b835d||0x1f4;return function(_0x2fbd2f){logger[_0xbcbb('0x24')](_0x2fbd2f[_0xbcbb('0x34')]);if(_0x2fbd2f['name']){delete _0x2fbd2f[_0xbcbb('0x35')];}_0x19bbfb[_0xbcbb('0x28')](_0x2b835d)[_0xbcbb('0x36')](_0x2fbd2f);};}exports[_0xbcbb('0x37')]=function(_0x4f803c,_0x16da76){var _0x404f2f={},_0x47c352={},_0x2a6d45={'count':0x0,'rows':[]};var _0x3770a8=_[_0xbcbb('0x38')](db['SalesforceConfiguration'][_0xbcbb('0x39')],function(_0x45aff0){return{'name':_0x45aff0[_0xbcbb('0x3a')],'type':_0x45aff0[_0xbcbb('0x3b')][_0xbcbb('0x3c')]};});_0x47c352[_0xbcbb('0x3d')]=_[_0xbcbb('0x38')](_0x3770a8,_0xbcbb('0x35'));_0x47c352[_0xbcbb('0x3e')]=_['keys'](_0x4f803c['query']);_0x47c352[_0xbcbb('0x3f')]=_[_0xbcbb('0x40')](_0x47c352[_0xbcbb('0x3d')],_0x47c352[_0xbcbb('0x3e')]);_0x404f2f[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x47c352['model'],qs[_0xbcbb('0x42')](_0x4f803c[_0xbcbb('0x3e')][_0xbcbb('0x42')]));_0x404f2f[_0xbcbb('0x41')]=_0x404f2f[_0xbcbb('0x41')][_0xbcbb('0x43')]?_0x404f2f[_0xbcbb('0x41')]:_0x47c352[_0xbcbb('0x3d')];if(!_0x4f803c[_0xbcbb('0x3e')][_0xbcbb('0x44')](_0xbcbb('0x45'))){_0x404f2f[_0xbcbb('0x2d')]=qs['limit'](_0x4f803c['query'][_0xbcbb('0x2d')]);_0x404f2f[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x4f803c['query'][_0xbcbb('0x2c')]);}_0x404f2f['order']=qs[_0xbcbb('0x46')](_0x4f803c['query'][_0xbcbb('0x46')]);_0x404f2f[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x4f803c[_0xbcbb('0x3e')],_0x47c352[_0xbcbb('0x3f')]));if(_0x4f803c[_0xbcbb('0x3e')][_0xbcbb('0x49')]){_0x404f2f[_0xbcbb('0x47')]=_[_0xbcbb('0x4a')](_0x404f2f[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0x3770a8,function(_0x383450){if(_0x383450[_0xbcbb('0x3b')]!==_0xbcbb('0x4b')){var _0x239660={};_0x239660[_0x383450[_0xbcbb('0x35')]]={'$like':'%'+_0x4f803c[_0xbcbb('0x3e')]['filter']+'%'};return _0x239660;}})});}_0x404f2f=_[_0xbcbb('0x4a')]({},_0x404f2f,_0x4f803c[_0xbcbb('0x4c')]);var _0x4775ee={'where':_0x404f2f[_0xbcbb('0x47')]};return db[_0xbcbb('0x4d')]['count'](_0x4775ee)['then'](function(_0x566c4f){_0x2a6d45['count']=_0x566c4f;if(_0x4f803c['query'][_0xbcbb('0x4e')]){_0x404f2f[_0xbcbb('0x4f')]=[{'all':!![]}];}return db[_0xbcbb('0x4d')]['findAll'](_0x404f2f);})[_0xbcbb('0x32')](function(_0x1d1002){_0x2a6d45[_0xbcbb('0x50')]=_0x1d1002;return _0x2a6d45;})[_0xbcbb('0x32')](respondWithFilteredResult(_0x16da76,_0x404f2f))[_0xbcbb('0x26')](handleError(_0x16da76,null));};exports[_0xbcbb('0x51')]=function(_0x506134,_0x1d3205){var _0x5c25f0={'raw':![],'where':{'id':_0x506134['params']['id']}},_0x471c3f={};_0x471c3f[_0xbcbb('0x3d')]=_[_0xbcbb('0x52')](db[_0xbcbb('0x4d')][_0xbcbb('0x39')]);_0x471c3f['query']=_[_0xbcbb('0x52')](_0x506134[_0xbcbb('0x3e')]);_0x471c3f[_0xbcbb('0x3f')]=_['intersection'](_0x471c3f['model'],_0x471c3f['query']);_0x5c25f0[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x471c3f['model'],qs['fields'](_0x506134['query']['fields']));_0x5c25f0[_0xbcbb('0x41')]=_0x5c25f0[_0xbcbb('0x41')]['length']?_0x5c25f0[_0xbcbb('0x41')]:_0x471c3f['model'];if(_0x506134[_0xbcbb('0x3e')]['includeAll']){_0x5c25f0[_0xbcbb('0x4f')]=[{'all':!![]}];}_0x5c25f0=_[_0xbcbb('0x4a')]({},_0x5c25f0,_0x506134['options']);return db[_0xbcbb('0x4d')][_0xbcbb('0x53')](_0x5c25f0)[_0xbcbb('0x32')](handleEntityNotFound(_0x1d3205,null))[_0xbcbb('0x32')](respondWithResult(_0x1d3205,null))[_0xbcbb('0x26')](handleError(_0x1d3205,null));};exports['create']=function(_0x36b746,_0xdeba5e){return db[_0xbcbb('0x4d')]['create'](_0x36b746['body'],{})[_0xbcbb('0x32')](respondWithResult(_0xdeba5e,0xc9))[_0xbcbb('0x26')](handleError(_0xdeba5e,null));};exports[_0xbcbb('0x31')]=function(_0x4cd59f,_0x530bc6){if(_0x4cd59f[_0xbcbb('0x54')]['id']){delete _0x4cd59f[_0xbcbb('0x54')]['id'];}return db[_0xbcbb('0x4d')]['find']({'where':{'id':_0x4cd59f[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x530bc6,null))['then'](saveUpdates(_0x4cd59f[_0xbcbb('0x54')],null))['then'](respondWithResult(_0x530bc6,null))['catch'](handleError(_0x530bc6,null));};exports['destroy']=function(_0x3a4f83,_0x3827fe){return db[_0xbcbb('0x4d')]['find']({'where':{'id':_0x3a4f83[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x3827fe,null))[_0xbcbb('0x32')](removeEntity(_0x3827fe,null))['catch'](handleError(_0x3827fe,null));};exports[_0xbcbb('0x56')]=function(_0x246e7c,_0x2fae72,_0x4faba2){var _0x82f786={};var _0x43d41d={};var _0x35d09d;var _0x4cf0a4;return db[_0xbcbb('0x4d')][_0xbcbb('0x57')]({'where':{'id':_0x246e7c[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x2fae72,null))['then'](function(_0x23a719){if(_0x23a719){_0x35d09d=_0x23a719;_0x43d41d[_0xbcbb('0x3d')]=_['keys'](db[_0xbcbb('0x58')][_0xbcbb('0x39')]);_0x43d41d[_0xbcbb('0x3e')]=_[_0xbcbb('0x52')](_0x246e7c[_0xbcbb('0x3e')]);_0x43d41d[_0xbcbb('0x3f')]=_[_0xbcbb('0x40')](_0x43d41d[_0xbcbb('0x3d')],_0x43d41d[_0xbcbb('0x3e')]);_0x82f786['attributes']=_[_0xbcbb('0x40')](_0x43d41d[_0xbcbb('0x3d')],qs[_0xbcbb('0x42')](_0x246e7c[_0xbcbb('0x3e')]['fields']));_0x82f786['attributes']=_0x82f786[_0xbcbb('0x41')][_0xbcbb('0x43')]?_0x82f786[_0xbcbb('0x41')]:_0x43d41d[_0xbcbb('0x3d')];_0x82f786[_0xbcbb('0x59')]=qs[_0xbcbb('0x46')](_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x46')]);_0x82f786[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x246e7c[_0xbcbb('0x3e')],_0x43d41d[_0xbcbb('0x3f')]));if(_0x246e7c[_0xbcbb('0x3e')]['filter']){_0x82f786[_0xbcbb('0x47')]=_[_0xbcbb('0x4a')](_0x82f786[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0x82f786[_0xbcbb('0x41')],function(_0xd96bc5){var _0xb9308c={};_0xb9308c[_0xd96bc5]={'$like':'%'+_0x246e7c['query'][_0xbcbb('0x49')]+'%'};return _0xb9308c;})});}_0x82f786=_[_0xbcbb('0x4a')]({},_0x82f786,_0x246e7c[_0xbcbb('0x4c')]);return _0x35d09d[_0xbcbb('0x56')](_0x82f786);}})[_0xbcbb('0x32')](function(_0x1fbfa1){if(_0x1fbfa1){_0x4cf0a4=_0x1fbfa1[_0xbcbb('0x43')];if(!_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x44')](_0xbcbb('0x45'))){_0x82f786[_0xbcbb('0x2d')]=qs[_0xbcbb('0x2d')](_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x2d')]);_0x82f786[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x2c')]);}return _0x35d09d[_0xbcbb('0x56')](_0x82f786);}})[_0xbcbb('0x32')](function(_0x4e75ca){if(_0x4e75ca){return _0x4e75ca?{'count':_0x4cf0a4,'rows':_0x4e75ca}:null;}})[_0xbcbb('0x32')](respondWithResult(_0x2fae72,null))[_0xbcbb('0x26')](handleError(_0x2fae72,null));};exports[_0xbcbb('0x5a')]=function(_0x556a01,_0x4d6478,_0x137f7f){var _0x593d3a={};var _0x2041d8={};var _0x4a0ddb;var _0x2c1120;return db[_0xbcbb('0x4d')][_0xbcbb('0x57')]({'where':{'id':_0x556a01[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x4d6478,null))[_0xbcbb('0x32')](function(_0x491e35){if(_0x491e35){_0x4a0ddb=_0x491e35;_0x2041d8[_0xbcbb('0x3d')]=_[_0xbcbb('0x52')](db[_0xbcbb('0x58')][_0xbcbb('0x39')]);_0x2041d8[_0xbcbb('0x3e')]=_['keys'](_0x556a01[_0xbcbb('0x3e')]);_0x2041d8['filters']=_['intersection'](_0x2041d8[_0xbcbb('0x3d')],_0x2041d8['query']);_0x593d3a[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x2041d8[_0xbcbb('0x3d')],qs[_0xbcbb('0x42')](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x42')]));_0x593d3a['attributes']=_0x593d3a[_0xbcbb('0x41')][_0xbcbb('0x43')]?_0x593d3a['attributes']:_0x2041d8[_0xbcbb('0x3d')];_0x593d3a[_0xbcbb('0x59')]=qs['sort'](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x46')]);_0x593d3a[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x556a01[_0xbcbb('0x3e')],_0x2041d8[_0xbcbb('0x3f')]));if(_0x556a01[_0xbcbb('0x3e')]['filter']){_0x593d3a[_0xbcbb('0x47')]=_['merge'](_0x593d3a[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0x593d3a[_0xbcbb('0x41')],function(_0x427644){var _0x14c702={};_0x14c702[_0x427644]={'$like':'%'+_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x49')]+'%'};return _0x14c702;})});}_0x593d3a=_[_0xbcbb('0x4a')]({},_0x593d3a,_0x556a01['options']);return _0x4a0ddb[_0xbcbb('0x5a')](_0x593d3a);}})[_0xbcbb('0x32')](function(_0x118762){if(_0x118762){_0x2c1120=_0x118762[_0xbcbb('0x43')];if(!_0x556a01[_0xbcbb('0x3e')]['hasOwnProperty']('nolimit')){_0x593d3a['limit']=qs['limit'](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x2d')]);_0x593d3a[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x2c')]);}return _0x4a0ddb[_0xbcbb('0x5a')](_0x593d3a);}})['then'](function(_0x19a345){if(_0x19a345){return _0x19a345?{'count':_0x2c1120,'rows':_0x19a345}:null;}})[_0xbcbb('0x32')](respondWithResult(_0x4d6478,null))['catch'](handleError(_0x4d6478,null));};exports[_0xbcbb('0x5b')]=function(_0x36a665,_0x244b59,_0x326d82){var _0xdef1a7={};var _0x429bc0={};var _0x5cfe69;var _0x3c6a5e;return db[_0xbcbb('0x4d')][_0xbcbb('0x57')]({'where':{'id':_0x36a665[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x244b59,null))[_0xbcbb('0x32')](function(_0x11cb60){if(_0x11cb60){_0x5cfe69=_0x11cb60;_0x429bc0['model']=_[_0xbcbb('0x52')](db['SalesforceField'][_0xbcbb('0x39')]);_0x429bc0[_0xbcbb('0x3e')]=_['keys'](_0x36a665[_0xbcbb('0x3e')]);_0x429bc0[_0xbcbb('0x3f')]=_[_0xbcbb('0x40')](_0x429bc0[_0xbcbb('0x3d')],_0x429bc0[_0xbcbb('0x3e')]);_0xdef1a7[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x429bc0[_0xbcbb('0x3d')],qs[_0xbcbb('0x42')](_0x36a665['query']['fields']));_0xdef1a7['attributes']=_0xdef1a7[_0xbcbb('0x41')]['length']?_0xdef1a7[_0xbcbb('0x41')]:_0x429bc0[_0xbcbb('0x3d')];_0xdef1a7[_0xbcbb('0x59')]=qs[_0xbcbb('0x46')](_0x36a665['query'][_0xbcbb('0x46')]);_0xdef1a7[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x36a665[_0xbcbb('0x3e')],_0x429bc0[_0xbcbb('0x3f')]));if(_0x36a665[_0xbcbb('0x3e')][_0xbcbb('0x49')]){_0xdef1a7['where']=_['merge'](_0xdef1a7[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0xdef1a7[_0xbcbb('0x41')],function(_0x3ccafb){var _0x9a9faf={};_0x9a9faf[_0x3ccafb]={'$like':'%'+_0x36a665['query'][_0xbcbb('0x49')]+'%'};return _0x9a9faf;})});}_0xdef1a7=_[_0xbcbb('0x4a')]({},_0xdef1a7,_0x36a665[_0xbcbb('0x4c')]);return _0x5cfe69[_0xbcbb('0x5b')](_0xdef1a7);}})[_0xbcbb('0x32')](function(_0x31ff30){if(_0x31ff30){_0x3c6a5e=_0x31ff30[_0xbcbb('0x43')];if(!_0x36a665['query']['hasOwnProperty']('nolimit')){_0xdef1a7[_0xbcbb('0x2d')]=qs[_0xbcbb('0x2d')](_0x36a665['query'][_0xbcbb('0x2d')]);_0xdef1a7[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x36a665[_0xbcbb('0x3e')]['offset']);}return _0x5cfe69[_0xbcbb('0x5b')](_0xdef1a7);}})[_0xbcbb('0x32')](function(_0x236a7d){if(_0x236a7d){return _0x236a7d?{'count':_0x3c6a5e,'rows':_0x236a7d}:null;}})[_0xbcbb('0x32')](respondWithResult(_0x244b59,null))[_0xbcbb('0x26')](handleError(_0x244b59,null));}; \ No newline at end of file +var _0xfe11=['show','params','keys','merge','find','catch','create','body','findOne','SalesforceField','pick','getFields','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','sendStatus','stack','name','send','index','map','rawAttributes','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','type','VIRTUAL','options','includeAll','include','SalesforceConfiguration','findAll'];(function(_0x5551b9,_0x2fe38c){var _0x3ee6bb=function(_0x22dcf7){while(--_0x22dcf7){_0x5551b9['push'](_0x5551b9['shift']());}};_0x3ee6bb(++_0x2fe38c);}(_0xfe11,0x11f));var _0x1fe1=function(_0x42af2f,_0x512995){_0x42af2f=_0x42af2f-0x0;var _0x2cbf95=_0xfe11[_0x42af2f];return _0x2cbf95;};'use strict';var pdf=require(_0x1fe1('0x0'));var emlformat=require(_0x1fe1('0x1'));var rimraf=require(_0x1fe1('0x2'));var zipdir=require(_0x1fe1('0x3'));var jsonpatch=require(_0x1fe1('0x4'));var rp=require(_0x1fe1('0x5'));var moment=require(_0x1fe1('0x6'));var BPromise=require(_0x1fe1('0x7'));var Mustache=require(_0x1fe1('0x8'));var util=require(_0x1fe1('0x9'));var path=require(_0x1fe1('0xa'));var sox=require(_0x1fe1('0xb'));var csv=require(_0x1fe1('0xc'));var ejs=require(_0x1fe1('0xd'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x1fe1('0xe'));var jsforce=require(_0x1fe1('0xf'));var deskjs=require(_0x1fe1('0x10'));var toCsv=require(_0x1fe1('0xc'));var querystring=require(_0x1fe1('0x11'));var Papa=require(_0x1fe1('0x12'));var Redis=require(_0x1fe1('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1fe1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1fe1('0x15'));var utils=require(_0x1fe1('0x16'));var config=require(_0x1fe1('0x17'));var db=require(_0x1fe1('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1fe1('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x1ddc15,_0x371aca,_0x17d405){if(_0x17d405){var _0x44cad1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44cad1['test'](_0x371aca)){return _0x1ddc15;}else{throw new db['Sequelize']['ValidationError'](_0x1fe1('0x1a'));}}else{return _0x1ddc15;}}function respondWithRpcPromise(_0xe6cc7b,_0x4139ac,_0x43197f,_0x472c62){return new BPromise(function(_0x238ea8,_0x7c9b93){var _0x5198bc=_0x472c62||client;return _0x5198bc[_0x1fe1('0x1b')](_0xe6cc7b,_0x43197f)[_0x1fe1('0x1c')](function(_0x39bc1b){logger[_0x1fe1('0x1d')](_0x1fe1('0x1e'),_0x4139ac,_0x1fe1('0x1f'));logger['debug'](_0x1fe1('0x20'),_0x4139ac,_0x1fe1('0x1f'),JSON['stringify'](_0x39bc1b));if(_0x39bc1b[_0x1fe1('0x21')]){if(_0x39bc1b['error'][_0x1fe1('0x22')]===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4139ac,_0x39bc1b[_0x1fe1('0x21')][_0x1fe1('0x23')]);return _0x7c9b93(_0x39bc1b['error']['message']);}logger[_0x1fe1('0x21')](_0x1fe1('0x1e'),_0x4139ac,_0x39bc1b['error'][_0x1fe1('0x23')]);return _0x238ea8(_0x39bc1b[_0x1fe1('0x21')][_0x1fe1('0x23')]);}else{logger[_0x1fe1('0x1d')](_0x1fe1('0x1e'),_0x4139ac,_0x1fe1('0x1f'));_0x238ea8(_0x39bc1b[_0x1fe1('0x24')][_0x1fe1('0x23')]);}})['catch'](function(_0x2fed88){logger[_0x1fe1('0x21')](_0x1fe1('0x1e'),_0x4139ac,_0x2fed88);_0x7c9b93(_0x2fed88);});});}function respondWithStatusCode(_0x42c5dd,_0x3a45c){_0x3a45c=_0x3a45c||0xcc;return function(_0x50f3df){if(_0x50f3df){return _0x42c5dd['sendStatus'](_0x3a45c);}return _0x42c5dd[_0x1fe1('0x25')](_0x3a45c)['end']();};}function respondWithResult(_0x5b6886,_0x153f5f){_0x153f5f=_0x153f5f||0xc8;return function(_0x5dd655){if(_0x5dd655){return _0x5b6886['status'](_0x153f5f)[_0x1fe1('0x26')](_0x5dd655);}};}function respondWithFilteredResult(_0x599668,_0xa872d8){return function(_0x30e8ac){if(_0x30e8ac){var _0x24a3f0=_0x30e8ac[_0x1fe1('0x27')],_0x15276f=_0xa872d8[_0x1fe1('0x28')],_0x2faf60=_0xa872d8[_0x1fe1('0x28')]+_0xa872d8[_0x1fe1('0x29')],_0x2270fb;if(_0x2faf60>=_0x24a3f0){_0x2faf60=_0x24a3f0;_0x2270fb=0xc8;}else{_0x2270fb=0xce;}_0x599668[_0x1fe1('0x25')](_0x2270fb);return _0x599668[_0x1fe1('0x2a')](_0x1fe1('0x2b'),_0x15276f+'-'+_0x2faf60+'/'+_0x24a3f0)[_0x1fe1('0x26')](_0x30e8ac);}return null;};}function patchUpdates(_0x5120c1){return function(_0x249ccb){try{jsonpatch[_0x1fe1('0x2c')](_0x249ccb,_0x5120c1,!![]);}catch(_0x3451f4){return BPromise['reject'](_0x3451f4);}return _0x249ccb[_0x1fe1('0x2d')]();};}function saveUpdates(_0x5b63b6,_0x3dbce1){return function(_0x5a0d96){if(_0x5a0d96){return _0x5a0d96[_0x1fe1('0x2e')](_0x5b63b6)[_0x1fe1('0x1c')](function(_0x3f2380){return _0x3f2380;});}return null;};}function removeEntity(_0x293879,_0x80db){return function(_0x20f84f){if(_0x20f84f){return _0x20f84f[_0x1fe1('0x2f')]()['then'](function(){_0x293879[_0x1fe1('0x25')](0xcc)[_0x1fe1('0x30')]();});}};}function handleEntityNotFound(_0x47ef84,_0x4b9452){return function(_0x1f478b){if(!_0x1f478b){_0x47ef84[_0x1fe1('0x31')](0x194);}return _0x1f478b;};}function handleError(_0xfe1e5a,_0x56ac2d){_0x56ac2d=_0x56ac2d||0x1f4;return function(_0x233279){logger[_0x1fe1('0x21')](_0x233279[_0x1fe1('0x32')]);if(_0x233279['name']){delete _0x233279[_0x1fe1('0x33')];}_0xfe1e5a[_0x1fe1('0x25')](_0x56ac2d)[_0x1fe1('0x34')](_0x233279);};}exports[_0x1fe1('0x35')]=function(_0x34677d,_0x1a58e6){var _0x383d26={},_0x4e3a89={},_0x3ae5d2={'count':0x0,'rows':[]};var _0x219cec=_[_0x1fe1('0x36')](db['SalesforceConfiguration'][_0x1fe1('0x37')],function(_0x2d685c){return{'name':_0x2d685c['fieldName'],'type':_0x2d685c['type'][_0x1fe1('0x38')]};});_0x4e3a89[_0x1fe1('0x39')]=_['map'](_0x219cec,'name');_0x4e3a89[_0x1fe1('0x3a')]=_['keys'](_0x34677d[_0x1fe1('0x3a')]);_0x4e3a89['filters']=_[_0x1fe1('0x3b')](_0x4e3a89[_0x1fe1('0x39')],_0x4e3a89[_0x1fe1('0x3a')]);_0x383d26[_0x1fe1('0x3c')]=_[_0x1fe1('0x3b')](_0x4e3a89[_0x1fe1('0x39')],qs[_0x1fe1('0x3d')](_0x34677d[_0x1fe1('0x3a')][_0x1fe1('0x3d')]));_0x383d26[_0x1fe1('0x3c')]=_0x383d26['attributes'][_0x1fe1('0x3e')]?_0x383d26[_0x1fe1('0x3c')]:_0x4e3a89['model'];if(!_0x34677d[_0x1fe1('0x3a')][_0x1fe1('0x3f')](_0x1fe1('0x40'))){_0x383d26[_0x1fe1('0x29')]=qs[_0x1fe1('0x29')](_0x34677d['query'][_0x1fe1('0x29')]);_0x383d26['offset']=qs[_0x1fe1('0x28')](_0x34677d[_0x1fe1('0x3a')][_0x1fe1('0x28')]);}_0x383d26[_0x1fe1('0x41')]=qs[_0x1fe1('0x42')](_0x34677d[_0x1fe1('0x3a')][_0x1fe1('0x42')]);_0x383d26[_0x1fe1('0x43')]=qs['filters'](_['pick'](_0x34677d[_0x1fe1('0x3a')],_0x4e3a89[_0x1fe1('0x44')]));if(_0x34677d[_0x1fe1('0x3a')][_0x1fe1('0x45')]){_0x383d26[_0x1fe1('0x43')]=_['merge'](_0x383d26[_0x1fe1('0x43')],{'$or':_[_0x1fe1('0x36')](_0x219cec,function(_0x53716e){if(_0x53716e[_0x1fe1('0x46')]!==_0x1fe1('0x47')){var _0x19de49={};_0x19de49[_0x53716e[_0x1fe1('0x33')]]={'$like':'%'+_0x34677d[_0x1fe1('0x3a')][_0x1fe1('0x45')]+'%'};return _0x19de49;}})});}_0x383d26=_['merge']({},_0x383d26,_0x34677d[_0x1fe1('0x48')]);var _0x48c633={'where':_0x383d26[_0x1fe1('0x43')]};return db['SalesforceConfiguration'][_0x1fe1('0x27')](_0x48c633)[_0x1fe1('0x1c')](function(_0xf10fd7){_0x3ae5d2[_0x1fe1('0x27')]=_0xf10fd7;if(_0x34677d[_0x1fe1('0x3a')][_0x1fe1('0x49')]){_0x383d26[_0x1fe1('0x4a')]=[{'all':!![]}];}return db[_0x1fe1('0x4b')][_0x1fe1('0x4c')](_0x383d26);})[_0x1fe1('0x1c')](function(_0x576c23){_0x3ae5d2['rows']=_0x576c23;return _0x3ae5d2;})[_0x1fe1('0x1c')](respondWithFilteredResult(_0x1a58e6,_0x383d26))['catch'](handleError(_0x1a58e6,null));};exports[_0x1fe1('0x4d')]=function(_0x29a98b,_0x2654c9){var _0x48b19c={'raw':![],'where':{'id':_0x29a98b[_0x1fe1('0x4e')]['id']}},_0x5f53c5={};_0x5f53c5[_0x1fe1('0x39')]=_[_0x1fe1('0x4f')](db[_0x1fe1('0x4b')][_0x1fe1('0x37')]);_0x5f53c5[_0x1fe1('0x3a')]=_[_0x1fe1('0x4f')](_0x29a98b[_0x1fe1('0x3a')]);_0x5f53c5[_0x1fe1('0x44')]=_[_0x1fe1('0x3b')](_0x5f53c5[_0x1fe1('0x39')],_0x5f53c5[_0x1fe1('0x3a')]);_0x48b19c[_0x1fe1('0x3c')]=_['intersection'](_0x5f53c5[_0x1fe1('0x39')],qs[_0x1fe1('0x3d')](_0x29a98b[_0x1fe1('0x3a')][_0x1fe1('0x3d')]));_0x48b19c[_0x1fe1('0x3c')]=_0x48b19c[_0x1fe1('0x3c')][_0x1fe1('0x3e')]?_0x48b19c[_0x1fe1('0x3c')]:_0x5f53c5['model'];if(_0x29a98b[_0x1fe1('0x3a')]['includeAll']){_0x48b19c[_0x1fe1('0x4a')]=[{'all':!![]}];}_0x48b19c=_[_0x1fe1('0x50')]({},_0x48b19c,_0x29a98b[_0x1fe1('0x48')]);return db[_0x1fe1('0x4b')][_0x1fe1('0x51')](_0x48b19c)[_0x1fe1('0x1c')](handleEntityNotFound(_0x2654c9,null))['then'](respondWithResult(_0x2654c9,null))[_0x1fe1('0x52')](handleError(_0x2654c9,null));};exports['create']=function(_0x52f03b,_0xe81ac6){return db[_0x1fe1('0x4b')][_0x1fe1('0x53')](_0x52f03b['body'],{})[_0x1fe1('0x1c')](respondWithResult(_0xe81ac6,0xc9))[_0x1fe1('0x52')](handleError(_0xe81ac6,null));};exports[_0x1fe1('0x2e')]=function(_0x3ff3ba,_0x77f3ec){if(_0x3ff3ba[_0x1fe1('0x54')]['id']){delete _0x3ff3ba[_0x1fe1('0x54')]['id'];}return db[_0x1fe1('0x4b')][_0x1fe1('0x51')]({'where':{'id':_0x3ff3ba[_0x1fe1('0x4e')]['id']}})[_0x1fe1('0x1c')](handleEntityNotFound(_0x77f3ec,null))[_0x1fe1('0x1c')](saveUpdates(_0x3ff3ba['body'],null))[_0x1fe1('0x1c')](respondWithResult(_0x77f3ec,null))[_0x1fe1('0x52')](handleError(_0x77f3ec,null));};exports[_0x1fe1('0x2f')]=function(_0x3ae158,_0x290d7b){return db[_0x1fe1('0x4b')][_0x1fe1('0x51')]({'where':{'id':_0x3ae158['params']['id']}})['then'](handleEntityNotFound(_0x290d7b,null))[_0x1fe1('0x1c')](removeEntity(_0x290d7b,null))[_0x1fe1('0x52')](handleError(_0x290d7b,null));};exports['getFields']=function(_0x3e2f3c,_0x377f40,_0x2a0d6c){var _0x522291={};var _0x30faa5={};var _0x397559;var _0x4612c3;return db[_0x1fe1('0x4b')][_0x1fe1('0x55')]({'where':{'id':_0x3e2f3c['params']['id']}})[_0x1fe1('0x1c')](handleEntityNotFound(_0x377f40,null))[_0x1fe1('0x1c')](function(_0x956e08){if(_0x956e08){_0x397559=_0x956e08;_0x30faa5[_0x1fe1('0x39')]=_[_0x1fe1('0x4f')](db[_0x1fe1('0x56')][_0x1fe1('0x37')]);_0x30faa5['query']=_[_0x1fe1('0x4f')](_0x3e2f3c[_0x1fe1('0x3a')]);_0x30faa5[_0x1fe1('0x44')]=_[_0x1fe1('0x3b')](_0x30faa5['model'],_0x30faa5[_0x1fe1('0x3a')]);_0x522291[_0x1fe1('0x3c')]=_['intersection'](_0x30faa5[_0x1fe1('0x39')],qs[_0x1fe1('0x3d')](_0x3e2f3c[_0x1fe1('0x3a')][_0x1fe1('0x3d')]));_0x522291[_0x1fe1('0x3c')]=_0x522291[_0x1fe1('0x3c')]['length']?_0x522291[_0x1fe1('0x3c')]:_0x30faa5[_0x1fe1('0x39')];_0x522291[_0x1fe1('0x41')]=qs[_0x1fe1('0x42')](_0x3e2f3c['query']['sort']);_0x522291[_0x1fe1('0x43')]=qs[_0x1fe1('0x44')](_[_0x1fe1('0x57')](_0x3e2f3c['query'],_0x30faa5[_0x1fe1('0x44')]));if(_0x3e2f3c['query'][_0x1fe1('0x45')]){_0x522291[_0x1fe1('0x43')]=_['merge'](_0x522291['where'],{'$or':_[_0x1fe1('0x36')](_0x522291[_0x1fe1('0x3c')],function(_0x5921ff){var _0x15fcad={};_0x15fcad[_0x5921ff]={'$like':'%'+_0x3e2f3c[_0x1fe1('0x3a')]['filter']+'%'};return _0x15fcad;})});}_0x522291=_['merge']({},_0x522291,_0x3e2f3c[_0x1fe1('0x48')]);return _0x397559[_0x1fe1('0x58')](_0x522291);}})[_0x1fe1('0x1c')](function(_0x3481b3){if(_0x3481b3){_0x4612c3=_0x3481b3[_0x1fe1('0x3e')];if(!_0x3e2f3c[_0x1fe1('0x3a')]['hasOwnProperty'](_0x1fe1('0x40'))){_0x522291['limit']=qs['limit'](_0x3e2f3c[_0x1fe1('0x3a')][_0x1fe1('0x29')]);_0x522291[_0x1fe1('0x28')]=qs['offset'](_0x3e2f3c['query'][_0x1fe1('0x28')]);}return _0x397559[_0x1fe1('0x58')](_0x522291);}})[_0x1fe1('0x1c')](function(_0xdcd403){if(_0xdcd403){return _0xdcd403?{'count':_0x4612c3,'rows':_0xdcd403}:null;}})[_0x1fe1('0x1c')](respondWithResult(_0x377f40,null))[_0x1fe1('0x52')](handleError(_0x377f40,null));};exports[_0x1fe1('0x59')]=function(_0x475c55,_0x5d9c6b,_0x1b4ddc){var _0x3ef2a7={};var _0x3abde5={};var _0x405863;var _0x11c41c;return db[_0x1fe1('0x4b')][_0x1fe1('0x55')]({'where':{'id':_0x475c55[_0x1fe1('0x4e')]['id']}})[_0x1fe1('0x1c')](handleEntityNotFound(_0x5d9c6b,null))[_0x1fe1('0x1c')](function(_0x5eecea){if(_0x5eecea){_0x405863=_0x5eecea;_0x3abde5['model']=_['keys'](db['SalesforceField'][_0x1fe1('0x37')]);_0x3abde5[_0x1fe1('0x3a')]=_['keys'](_0x475c55['query']);_0x3abde5[_0x1fe1('0x44')]=_['intersection'](_0x3abde5[_0x1fe1('0x39')],_0x3abde5[_0x1fe1('0x3a')]);_0x3ef2a7[_0x1fe1('0x3c')]=_[_0x1fe1('0x3b')](_0x3abde5[_0x1fe1('0x39')],qs['fields'](_0x475c55[_0x1fe1('0x3a')][_0x1fe1('0x3d')]));_0x3ef2a7[_0x1fe1('0x3c')]=_0x3ef2a7['attributes'][_0x1fe1('0x3e')]?_0x3ef2a7[_0x1fe1('0x3c')]:_0x3abde5[_0x1fe1('0x39')];_0x3ef2a7['order']=qs[_0x1fe1('0x42')](_0x475c55[_0x1fe1('0x3a')][_0x1fe1('0x42')]);_0x3ef2a7[_0x1fe1('0x43')]=qs['filters'](_[_0x1fe1('0x57')](_0x475c55[_0x1fe1('0x3a')],_0x3abde5[_0x1fe1('0x44')]));if(_0x475c55[_0x1fe1('0x3a')][_0x1fe1('0x45')]){_0x3ef2a7[_0x1fe1('0x43')]=_['merge'](_0x3ef2a7[_0x1fe1('0x43')],{'$or':_['map'](_0x3ef2a7[_0x1fe1('0x3c')],function(_0x221458){var _0x5799d6={};_0x5799d6[_0x221458]={'$like':'%'+_0x475c55[_0x1fe1('0x3a')][_0x1fe1('0x45')]+'%'};return _0x5799d6;})});}_0x3ef2a7=_[_0x1fe1('0x50')]({},_0x3ef2a7,_0x475c55[_0x1fe1('0x48')]);return _0x405863[_0x1fe1('0x59')](_0x3ef2a7);}})[_0x1fe1('0x1c')](function(_0x2e2cdc){if(_0x2e2cdc){_0x11c41c=_0x2e2cdc['length'];if(!_0x475c55[_0x1fe1('0x3a')][_0x1fe1('0x3f')](_0x1fe1('0x40'))){_0x3ef2a7[_0x1fe1('0x29')]=qs[_0x1fe1('0x29')](_0x475c55['query'][_0x1fe1('0x29')]);_0x3ef2a7[_0x1fe1('0x28')]=qs[_0x1fe1('0x28')](_0x475c55[_0x1fe1('0x3a')][_0x1fe1('0x28')]);}return _0x405863['getSubjects'](_0x3ef2a7);}})[_0x1fe1('0x1c')](function(_0x58c7a4){if(_0x58c7a4){return _0x58c7a4?{'count':_0x11c41c,'rows':_0x58c7a4}:null;}})['then'](respondWithResult(_0x5d9c6b,null))[_0x1fe1('0x52')](handleError(_0x5d9c6b,null));};exports[_0x1fe1('0x5a')]=function(_0x396397,_0x27aa4c,_0x555f72){var _0x51aabf={};var _0x41de18={};var _0x3c5fff;var _0x30d7dd;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x396397[_0x1fe1('0x4e')]['id']}})[_0x1fe1('0x1c')](handleEntityNotFound(_0x27aa4c,null))[_0x1fe1('0x1c')](function(_0x1bcacb){if(_0x1bcacb){_0x3c5fff=_0x1bcacb;_0x41de18[_0x1fe1('0x39')]=_['keys'](db[_0x1fe1('0x56')][_0x1fe1('0x37')]);_0x41de18['query']=_['keys'](_0x396397[_0x1fe1('0x3a')]);_0x41de18['filters']=_[_0x1fe1('0x3b')](_0x41de18[_0x1fe1('0x39')],_0x41de18[_0x1fe1('0x3a')]);_0x51aabf[_0x1fe1('0x3c')]=_[_0x1fe1('0x3b')](_0x41de18[_0x1fe1('0x39')],qs[_0x1fe1('0x3d')](_0x396397[_0x1fe1('0x3a')]['fields']));_0x51aabf['attributes']=_0x51aabf[_0x1fe1('0x3c')]['length']?_0x51aabf[_0x1fe1('0x3c')]:_0x41de18[_0x1fe1('0x39')];_0x51aabf['order']=qs['sort'](_0x396397['query']['sort']);_0x51aabf[_0x1fe1('0x43')]=qs[_0x1fe1('0x44')](_[_0x1fe1('0x57')](_0x396397[_0x1fe1('0x3a')],_0x41de18[_0x1fe1('0x44')]));if(_0x396397['query'][_0x1fe1('0x45')]){_0x51aabf[_0x1fe1('0x43')]=_[_0x1fe1('0x50')](_0x51aabf['where'],{'$or':_[_0x1fe1('0x36')](_0x51aabf[_0x1fe1('0x3c')],function(_0xc3ef3f){var _0x49943c={};_0x49943c[_0xc3ef3f]={'$like':'%'+_0x396397[_0x1fe1('0x3a')][_0x1fe1('0x45')]+'%'};return _0x49943c;})});}_0x51aabf=_[_0x1fe1('0x50')]({},_0x51aabf,_0x396397['options']);return _0x3c5fff[_0x1fe1('0x5a')](_0x51aabf);}})['then'](function(_0x5c100e){if(_0x5c100e){_0x30d7dd=_0x5c100e[_0x1fe1('0x3e')];if(!_0x396397['query'][_0x1fe1('0x3f')](_0x1fe1('0x40'))){_0x51aabf[_0x1fe1('0x29')]=qs[_0x1fe1('0x29')](_0x396397[_0x1fe1('0x3a')][_0x1fe1('0x29')]);_0x51aabf[_0x1fe1('0x28')]=qs[_0x1fe1('0x28')](_0x396397[_0x1fe1('0x3a')][_0x1fe1('0x28')]);}return _0x3c5fff[_0x1fe1('0x5a')](_0x51aabf);}})[_0x1fe1('0x1c')](function(_0x535698){if(_0x535698){return _0x535698?{'count':_0x30d7dd,'rows':_0x535698}:null;}})[_0x1fe1('0x1c')](respondWithResult(_0x27aa4c,null))[_0x1fe1('0x52')](handleError(_0x27aa4c,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 2324bfd..f1f0b51 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 _0xdd5e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations'];(function(_0xb60ae4,_0x48b458){var _0x53d530=function(_0x5c0743){while(--_0x5c0743){_0xb60ae4['push'](_0xb60ae4['shift']());}};_0x53d530(++_0x48b458);}(_0xdd5e,0x1ce));var _0xedd5=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xdd5e[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0xedd5('0x0'));var util=require(_0xedd5('0x1'));var logger=require(_0xedd5('0x2'))(_0xedd5('0x3'));var moment=require(_0xedd5('0x4'));var BPromise=require(_0xedd5('0x5'));var rp=require(_0xedd5('0x6'));var fs=require('fs');var path=require(_0xedd5('0x7'));var rimraf=require(_0xedd5('0x8'));var config=require(_0xedd5('0x9'));var attributes=require(_0xedd5('0xa'));module[_0xedd5('0xb')]=function(_0x14751a,_0x343f97){return _0x14751a[_0xedd5('0xc')]('SalesforceConfiguration',attributes,{'tableName':_0xedd5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d50=['moment','bluebird','request-promise','path','rimraf','exports','define','int_salesforce_configurations','lodash','../../config/logger','api'];(function(_0x170e82,_0x573cc8){var _0x191697=function(_0x1ee476){while(--_0x1ee476){_0x170e82['push'](_0x170e82['shift']());}};_0x191697(++_0x573cc8);}(_0x9d50,0x110));var _0x09d5=function(_0x2b3a83,_0x400a87){_0x2b3a83=_0x2b3a83-0x0;var _0x1b25ce=_0x9d50[_0x2b3a83];return _0x1b25ce;};'use strict';var _=require(_0x09d5('0x0'));var util=require('util');var logger=require(_0x09d5('0x1'))(_0x09d5('0x2'));var moment=require(_0x09d5('0x3'));var BPromise=require(_0x09d5('0x4'));var rp=require(_0x09d5('0x5'));var fs=require('fs');var path=require(_0x09d5('0x6'));var rimraf=require(_0x09d5('0x7'));var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x09d5('0x8')]=function(_0x308888,_0x4a32ee){return _0x308888[_0x09d5('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0x09d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 6e72f56..b68f265 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 _0xd59c=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x579e76,_0x4fbc6f){var _0x4c38f0=function(_0x17f685){while(--_0x17f685){_0x579e76['push'](_0x579e76['shift']());}};_0x4c38f0(++_0x4fbc6f);}(_0xd59c,0xd7));var _0xcd59=function(_0xdd2e7f,_0x1914e7){_0xdd2e7f=_0xdd2e7f-0x0;var _0x329096=_0xd59c[_0xdd2e7f];return _0x329096;};'use strict';var _=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var moment=require(_0xcd59('0x2'));var BPromise=require(_0xcd59('0x3'));var rs=require(_0xcd59('0x4'));var fs=require('fs');var Redis=require(_0xcd59('0x5'));var db=require(_0xcd59('0x6'))['db'];var utils=require(_0xcd59('0x7'));var logger=require('../../config/logger')(_0xcd59('0x8'));var config=require(_0xcd59('0x9'));var jayson=require(_0xcd59('0xa'));var client=jayson[_0xcd59('0xb')][_0xcd59('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38cbcc,_0x51d8da,_0x2ac5a5){return new BPromise(function(_0x56fe84,_0x2b3fcc){return client[_0xcd59('0xd')](_0x38cbcc,_0x2ac5a5)['then'](function(_0xedb6d8){logger['info'](_0xcd59('0xe'),_0x51d8da,_0xcd59('0xf'));logger[_0xcd59('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x51d8da,_0xcd59('0xf'),JSON['stringify'](_0xedb6d8));if(_0xedb6d8[_0xcd59('0x11')]){if(_0xedb6d8['error'][_0xcd59('0x12')]===0x1f4){logger[_0xcd59('0x11')](_0xcd59('0xe'),_0x51d8da,_0xedb6d8[_0xcd59('0x11')][_0xcd59('0x13')]);return _0x2b3fcc(_0xedb6d8['error']['message']);}logger['error'](_0xcd59('0xe'),_0x51d8da,_0xedb6d8[_0xcd59('0x11')][_0xcd59('0x13')]);return _0x56fe84(_0xedb6d8[_0xcd59('0x11')][_0xcd59('0x13')]);}else{logger[_0xcd59('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x51d8da,_0xcd59('0xf'));_0x56fe84(_0xedb6d8[_0xcd59('0x15')][_0xcd59('0x13')]);}})['catch'](function(_0x38e7f2){logger['error'](_0xcd59('0xe'),_0x51d8da,_0x38e7f2);_0x2b3fcc(_0x38e7f2);});});} \ No newline at end of file +var _0xb1ba=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4602f5,_0x4f6ac9){var _0xb8cbb=function(_0xf9c412){while(--_0xf9c412){_0x4602f5['push'](_0x4602f5['shift']());}};_0xb8cbb(++_0x4f6ac9);}(_0xb1ba,0x17b));var _0xab1b=function(_0x3d586d,_0x4f71f0){_0x3d586d=_0x3d586d-0x0;var _0x56548d=_0xb1ba[_0x3d586d];return _0x56548d;};'use strict';var _=require(_0xab1b('0x0'));var util=require(_0xab1b('0x1'));var moment=require(_0xab1b('0x2'));var BPromise=require(_0xab1b('0x3'));var rs=require(_0xab1b('0x4'));var fs=require('fs');var Redis=require(_0xab1b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xab1b('0x6'));var logger=require(_0xab1b('0x7'))('rpc');var config=require(_0xab1b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xab1b('0x9')][_0xab1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe0a311,_0x5b9ef3,_0x3eaad1){return new BPromise(function(_0x19fd9e,_0xee6c5a){return client[_0xab1b('0xb')](_0xe0a311,_0x3eaad1)['then'](function(_0x1f69ee){logger[_0xab1b('0xc')](_0xab1b('0xd'),_0x5b9ef3,_0xab1b('0xe'));logger[_0xab1b('0xf')](_0xab1b('0x10'),_0x5b9ef3,'request\x20sent',JSON[_0xab1b('0x11')](_0x1f69ee));if(_0x1f69ee[_0xab1b('0x12')]){if(_0x1f69ee['error']['code']===0x1f4){logger['error'](_0xab1b('0xd'),_0x5b9ef3,_0x1f69ee[_0xab1b('0x12')][_0xab1b('0x13')]);return _0xee6c5a(_0x1f69ee[_0xab1b('0x12')][_0xab1b('0x13')]);}logger['error'](_0xab1b('0xd'),_0x5b9ef3,_0x1f69ee['error'][_0xab1b('0x13')]);return _0x19fd9e(_0x1f69ee[_0xab1b('0x12')]['message']);}else{logger[_0xab1b('0xc')](_0xab1b('0xd'),_0x5b9ef3,_0xab1b('0xe'));_0x19fd9e(_0x1f69ee[_0xab1b('0x14')][_0xab1b('0x13')]);}})[_0xab1b('0x15')](function(_0x606ba7){logger['error'](_0xab1b('0xd'),_0x5b9ef3,_0x606ba7);_0xee6c5a(_0x606ba7);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 0aec82a..2622d56 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 _0x33af=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x5a2032,_0x1a97d9){var _0x33feba=function(_0x3e2a6f){while(--_0x3e2a6f){_0x5a2032['push'](_0x5a2032['shift']());}};_0x33feba(++_0x1a97d9);}(_0x33af,0xec));var _0xf33a=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x33af[_0x3ee55a];return _0x581800;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var auth=require(_0xf33a('0x4'));var interaction=require(_0xf33a('0x5'));var config=require(_0xf33a('0x6'));var controller=require('./intSalesforceField.controller');router[_0xf33a('0x7')]('/',auth[_0xf33a('0x8')](),controller['index']);router[_0xf33a('0x7')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xa')]);router[_0xf33a('0xb')]('/',auth[_0xf33a('0x8')](),controller['create']);router[_0xf33a('0xc')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')](_0xf33a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xf33a('0xf')]=router; \ No newline at end of file +var _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x3feb46,_0x9367ec){var _0x435132=function(_0x3206b7){while(--_0x3206b7){_0x3feb46['push'](_0x3feb46['shift']());}};_0x435132(++_0x9367ec);}(_0x814b,0x1a2));var _0xb814=function(_0x435044,_0x36ab8e){_0x435044=_0x435044-0x0;var _0x33d4c6=_0x814b[_0x435044];return _0x33d4c6;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 8868858..b8f13be 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 _0xe9d1=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x47718c,_0x1250d6){var _0xd11359=function(_0xed60a9){while(--_0xed60a9){_0x47718c['push'](_0x47718c['shift']());}};_0xd11359(++_0x1250d6);}(_0xe9d1,0x150));var _0x1e9d=function(_0x1d5a2a,_0x2f0c88){_0x1d5a2a=_0x1d5a2a-0x0;var _0x103b4b=_0xe9d1[_0x1d5a2a];return _0x103b4b;};'use strict';var Sequelize=require(_0x1e9d('0x0'));module[_0x1e9d('0x1')]={'type':{'type':Sequelize[_0x1e9d('0x2')](_0x1e9d('0x3'),_0x1e9d('0x4'),_0x1e9d('0x5'),_0x1e9d('0x6')),'defaultValue':_0x1e9d('0x3')},'content':{'type':Sequelize[_0x1e9d('0x7')]},'key':{'type':Sequelize[_0x1e9d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x1e9d('0x3'),_0x1e9d('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1e9d('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcd02=['string','variable','customVariable','ENUM','STRING'];(function(_0x54c2cc,_0x255969){var _0xdbc3ac=function(_0x3f288a){while(--_0x3f288a){_0x54c2cc['push'](_0x54c2cc['shift']());}};_0xdbc3ac(++_0x255969);}(_0xcd02,0x19a));var _0x2cd0=function(_0x37dd8b,_0x57b8da){_0x37dd8b=_0x37dd8b-0x0;var _0xb1cc6c=_0xcd02[_0x37dd8b];return _0xb1cc6c;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x2cd0('0x0'),_0x2cd0('0x1'),_0x2cd0('0x2'),'keyValue'),'defaultValue':_0x2cd0('0x0')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2cd0('0x3')]('string',_0x2cd0('0x1'),_0x2cd0('0x2'))},'keyContent':{'type':Sequelize[_0x2cd0('0x4')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x2cd0('0x4')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 12d47e7..c79586d 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 _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject'];(function(_0x5483d2,_0x2f842f){var _0x299b52=function(_0x15f114){while(--_0x15f114){_0x5483d2['push'](_0x5483d2['shift']());}};_0x299b52(++_0x2f842f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34a14d,_0xc49d24){_0x34a14d=_0x34a14d-0x0;var _0x2015f2=_0x0b0e[_0x34a14d];return _0x2015f2;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]));if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['SalesforceField'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['SalesforceField'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));}; \ No newline at end of file +var _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject'];(function(_0x7d6bac,_0x5c0821){var _0x16d943=function(_0x429f58){while(--_0x429f58){_0x7d6bac['push'](_0x7d6bac['shift']());}};_0x16d943(++_0x5c0821);}(_0x0b0e,0x187));var _0xe0b0=function(_0x5e13af,_0x5461e0){_0x5e13af=_0x5e13af-0x0;var _0x3dbfa0=_0x0b0e[_0x5e13af];return _0x3dbfa0;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]));if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['SalesforceField'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['SalesforceField'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e355944..51379c7 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 _0x593a=['rimraf','./intSalesforceField.attributes','exports','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x593a,0x180));var _0xa593=function(_0x340a13,_0x49d5c5){_0x340a13=_0x340a13-0x0;var _0x5ed711=_0x593a[_0x340a13];return _0x5ed711;};'use strict';var _=require(_0xa593('0x0'));var util=require(_0xa593('0x1'));var logger=require('../../config/logger')(_0xa593('0x2'));var moment=require(_0xa593('0x3'));var BPromise=require(_0xa593('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa593('0x5'));var rimraf=require(_0xa593('0x6'));var config=require('../../config/environment');var attributes=require(_0xa593('0x7'));module[_0xa593('0x8')]=function(_0x449228,_0x1feb7f){return _0x449228['define']('SalesforceField',attributes,{'tableName':_0xa593('0x9'),'paranoid':![],'indexes':[{'name':_0xa593('0xa'),'fields':[_0xa593('0xb'),_0xa593('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x07d7=['bluebird','request-promise','path','../../config/environment','./intSalesforceField.attributes','exports','define','idField','FieldId','lodash','../../config/logger','moment'];(function(_0x5617e2,_0x1ffcd7){var _0x27b60d=function(_0xf3f7a2){while(--_0xf3f7a2){_0x5617e2['push'](_0x5617e2['shift']());}};_0x27b60d(++_0x1ffcd7);}(_0x07d7,0x141));var _0x707d=function(_0x149a9b,_0x5bb275){_0x149a9b=_0x149a9b-0x0;var _0x2c2bf6=_0x07d7[_0x149a9b];return _0x2c2bf6;};'use strict';var _=require(_0x707d('0x0'));var util=require('util');var logger=require(_0x707d('0x1'))('api');var moment=require(_0x707d('0x2'));var BPromise=require(_0x707d('0x3'));var rp=require(_0x707d('0x4'));var fs=require('fs');var path=require(_0x707d('0x5'));var rimraf=require('rimraf');var config=require(_0x707d('0x6'));var attributes=require(_0x707d('0x7'));module[_0x707d('0x8')]=function(_0x242117,_0x146123){return _0x242117[_0x707d('0x9')]('SalesforceField',attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x707d('0xa'),_0x707d('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 91fcdfb..95b8211 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 _0xdace=['request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xdace,0xc5));var _0xedac=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xdace[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('SalesforceField,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x4c780d,_0x5a90d9){var _0x591c86=function(_0x597cc9){while(--_0x597cc9){_0x4c780d['push'](_0x4c780d['shift']());}};_0x591c86(++_0x5a90d9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2c0ded,_0x3de22c){_0x2c0ded=_0x2c0ded-0x0;var _0x4473e5=_0xcb91[_0x2c0ded];return _0x4473e5;};'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')]('SalesforceField,\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/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 54734ac..e635886 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 _0x194c=['get','isAuthenticated','index','/:id','show','/:id/fields','post','/:id/configurations','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x4a91e4,_0x5969ed){var _0x5207a4=function(_0xb7168e){while(--_0xb7168e){_0x4a91e4['push'](_0x4a91e4['shift']());}};_0x5207a4(++_0x5969ed);}(_0x194c,0x19b));var _0xc194=function(_0x3f8f39,_0x26f2d7){_0x3f8f39=_0x3f8f39-0x0;var _0x1dfadd=_0x194c[_0x3f8f39];return _0x1dfadd;};'use strict';var multer=require(_0xc194('0x0'));var util=require(_0xc194('0x1'));var path=require(_0xc194('0x2'));var timeout=require(_0xc194('0x3'));var express=require(_0xc194('0x4'));var router=express[_0xc194('0x5')]();var auth=require(_0xc194('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc194('0x7'));var controller=require(_0xc194('0x8'));router[_0xc194('0x9')]('/',auth[_0xc194('0xa')](),controller[_0xc194('0xb')]);router[_0xc194('0x9')](_0xc194('0xc'),auth[_0xc194('0xa')](),controller[_0xc194('0xd')]);router[_0xc194('0x9')]('/:id/configurations',auth[_0xc194('0xa')](),controller['getConfigurations']);router[_0xc194('0x9')](_0xc194('0xe'),auth[_0xc194('0xa')](),controller['getFields']);router[_0xc194('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc194('0xf')](_0xc194('0x10'),auth[_0xc194('0xa')](),controller['addConfiguration']);router[_0xc194('0x11')](_0xc194('0xc'),auth[_0xc194('0xa')](),controller[_0xc194('0x12')]);router['delete'](_0xc194('0xc'),auth['isAuthenticated'](),controller[_0xc194('0x13')]);module[_0xc194('0x14')]=router; \ No newline at end of file +var _0xaa19=['delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intServicenowAccount.controller','get','isAuthenticated','/:id','getConfigurations','/:id/fields','post','put','update'];(function(_0x1c33e1,_0x151b64){var _0xeb0ac7=function(_0x4ef6b0){while(--_0x4ef6b0){_0x1c33e1['push'](_0x1c33e1['shift']());}};_0xeb0ac7(++_0x151b64);}(_0xaa19,0x79));var _0x9aa1=function(_0x1971a2,_0x17e74c){_0x1971a2=_0x1971a2-0x0;var _0x4312f8=_0xaa19[_0x1971a2];return _0x4312f8;};'use strict';var multer=require(_0x9aa1('0x0'));var util=require(_0x9aa1('0x1'));var path=require(_0x9aa1('0x2'));var timeout=require(_0x9aa1('0x3'));var express=require('express');var router=express[_0x9aa1('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9aa1('0x5'));var config=require('../../config/environment');var controller=require(_0x9aa1('0x6'));router[_0x9aa1('0x7')]('/',auth[_0x9aa1('0x8')](),controller['index']);router[_0x9aa1('0x7')](_0x9aa1('0x9'),auth[_0x9aa1('0x8')](),controller['show']);router[_0x9aa1('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9aa1('0xa')]);router[_0x9aa1('0x7')](_0x9aa1('0xb'),auth[_0x9aa1('0x8')](),controller['getFields']);router['post']('/',auth[_0x9aa1('0x8')](),controller['create']);router[_0x9aa1('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0x9aa1('0xd')](_0x9aa1('0x9'),auth['isAuthenticated'](),controller[_0x9aa1('0xe')]);router[_0x9aa1('0xf')](_0x9aa1('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9aa1('0x10')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 0cab46f..79aa053 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 _0x6909=['sequelize','exports','STRING','remoteUri'];(function(_0x573f17,_0xbaf790){var _0x2c37b1=function(_0x2b323e){while(--_0x2b323e){_0x573f17['push'](_0x573f17['shift']());}};_0x2c37b1(++_0xbaf790);}(_0x6909,0x168));var _0x9690=function(_0x24935a,_0x52c4dc){_0x24935a=_0x24935a-0x0;var _0x47f4cb=_0x6909[_0x24935a];return _0x47f4cb;};'use strict';var Sequelize=require(_0x9690('0x0'));module[_0x9690('0x1')]={'name':{'type':Sequelize[_0x9690('0x2')]},'description':{'type':Sequelize[_0x9690('0x2')]},'username':{'type':Sequelize[_0x9690('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9690('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9690('0x3')},'serverUrl':{'type':Sequelize[_0x9690('0x2')]}}; \ No newline at end of file +var _0xcdce=['exports','STRING','username','remoteUri','sequelize'];(function(_0x22613a,_0x54faab){var _0x5e2a3d=function(_0x42848e){while(--_0x42848e){_0x22613a['push'](_0x22613a['shift']());}};_0x5e2a3d(++_0x54faab);}(_0xcdce,0x1bc));var _0xecdc=function(_0x503ea0,_0xe5f2f8){_0x503ea0=_0x503ea0-0x0;var _0x220041=_0xcdce[_0x503ea0];return _0x220041;};'use strict';var Sequelize=require(_0xecdc('0x0'));module[_0xecdc('0x1')]={'name':{'type':Sequelize[_0xecdc('0x2')]},'description':{'type':Sequelize[_0xecdc('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xecdc('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xecdc('0x2')]},'remoteUri':{'type':Sequelize[_0xecdc('0x2')],'unique':_0xecdc('0x4')},'serverUrl':{'type':Sequelize[_0xecdc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index bf8d138..9a7d259 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 _0x924b=['getDescriptions','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','rfc','time_worked','expected_start','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','problem_id','company','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','result','assign','includes','forEach','internalType','push','TCL:\x20_object','log','label','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowAccount','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel'];(function(_0x13583c,_0x4f2af7){var _0x2191d5=function(_0x4cf184){while(--_0x4cf184){_0x13583c['push'](_0x13583c['shift']());}};_0x2191d5(++_0x4f2af7);}(_0x924b,0x1e9));var _0xb924=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x924b[_0x1057a3];return _0x131cdb;};'use strict';var pdf=require(_0xb924('0x0'));var emlformat=require(_0xb924('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb924('0x2'));var jsonpatch=require(_0xb924('0x3'));var rp=require('request-promise');var moment=require(_0xb924('0x4'));var BPromise=require(_0xb924('0x5'));var Mustache=require(_0xb924('0x6'));var util=require(_0xb924('0x7'));var path=require(_0xb924('0x8'));var sox=require(_0xb924('0x9'));var csv=require('to-csv');var ejs=require(_0xb924('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb924('0xb'));var crypto=require('crypto');var jsforce=require(_0xb924('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb924('0xd'));var querystring=require(_0xb924('0xe'));var Papa=require(_0xb924('0xf'));var Redis=require('ioredis');var authService=require(_0xb924('0x10'));var qs=require(_0xb924('0x11'));var as=require(_0xb924('0x12'));var hardwareService=require(_0xb924('0x13'));var logger=require(_0xb924('0x14'))(_0xb924('0x15'));var utils=require(_0xb924('0x16'));var config=require('../../config/environment');var db=require(_0xb924('0x17'))['db'];var integrations=require(_0xb924('0x18'));var jayson=require(_0xb924('0x19'));var client=jayson[_0xb924('0x1a')][_0xb924('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3785e8,_0x51b93c,_0x51ed35){if(_0x51ed35){var _0x25466c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25466c['test'](_0x51b93c)){return _0x3785e8;}else{throw new db['Sequelize'][(_0xb924('0x1c'))](_0xb924('0x1d'));}}else{return _0x3785e8;}}function respondWithRpcPromise(_0x4a92d6,_0x346913,_0xbdde78,_0x4c5d2e){return new BPromise(function(_0x490c84,_0x53e4e3){var _0x52916d=_0x4c5d2e||client;return _0x52916d[_0xb924('0x1e')](_0x4a92d6,_0xbdde78)[_0xb924('0x1f')](function(_0x35cff8){logger[_0xb924('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x346913,_0xb924('0x21'));logger[_0xb924('0x22')](_0xb924('0x23'),_0x346913,_0xb924('0x21'),JSON[_0xb924('0x24')](_0x35cff8));if(_0x35cff8['error']){if(_0x35cff8[_0xb924('0x25')][_0xb924('0x26')]===0x1f4){logger[_0xb924('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x346913,_0x35cff8[_0xb924('0x25')]['message']);return _0x53e4e3(_0x35cff8['error'][_0xb924('0x27')]);}logger[_0xb924('0x25')](_0xb924('0x28'),_0x346913,_0x35cff8['error'][_0xb924('0x27')]);return _0x490c84(_0x35cff8[_0xb924('0x25')][_0xb924('0x27')]);}else{logger[_0xb924('0x20')](_0xb924('0x28'),_0x346913,_0xb924('0x21'));_0x490c84(_0x35cff8['result'][_0xb924('0x27')]);}})['catch'](function(_0xf76983){logger[_0xb924('0x25')](_0xb924('0x28'),_0x346913,_0xf76983);_0x53e4e3(_0xf76983);});});}function respondWithStatusCode(_0x1621bc,_0x2922b4){_0x2922b4=_0x2922b4||0xcc;return function(_0x17eb1a){if(_0x17eb1a){return _0x1621bc[_0xb924('0x29')](_0x2922b4);}return _0x1621bc[_0xb924('0x2a')](_0x2922b4)['end']();};}function respondWithResult(_0x1225d8,_0x29ad15){_0x29ad15=_0x29ad15||0xc8;return function(_0x3b0a10){if(_0x3b0a10){return _0x1225d8['status'](_0x29ad15)[_0xb924('0x2b')](_0x3b0a10);}};}function respondWithFilteredResult(_0x3ee6f6,_0x28e864){return function(_0x34da74){if(_0x34da74){var _0x4d44ac=_0x34da74[_0xb924('0x2c')],_0x35228c=_0x28e864[_0xb924('0x2d')],_0x33de49=_0x28e864[_0xb924('0x2d')]+_0x28e864[_0xb924('0x2e')],_0xe18749;if(_0x33de49>=_0x4d44ac){_0x33de49=_0x4d44ac;_0xe18749=0xc8;}else{_0xe18749=0xce;}_0x3ee6f6[_0xb924('0x2a')](_0xe18749);return _0x3ee6f6[_0xb924('0x2f')](_0xb924('0x30'),_0x35228c+'-'+_0x33de49+'/'+_0x4d44ac)[_0xb924('0x2b')](_0x34da74);}return null;};}function patchUpdates(_0x35ac6f){return function(_0x1b43e7){try{jsonpatch[_0xb924('0x31')](_0x1b43e7,_0x35ac6f,!![]);}catch(_0x1d2053){return BPromise[_0xb924('0x32')](_0x1d2053);}return _0x1b43e7['save']();};}function saveUpdates(_0x5e26c8,_0x36f9e3){return function(_0x46d136){if(_0x46d136){return _0x46d136[_0xb924('0x33')](_0x5e26c8)[_0xb924('0x1f')](function(_0x512064){return _0x512064;});}return null;};}function removeEntity(_0x467b3d,_0x51c59a){return function(_0x359f53){if(_0x359f53){return _0x359f53[_0xb924('0x34')]()['then'](function(){_0x467b3d[_0xb924('0x2a')](0xcc)[_0xb924('0x35')]();});}};}function handleEntityNotFound(_0x18a80f,_0x49406f){return function(_0x260113){if(!_0x260113){_0x18a80f[_0xb924('0x29')](0x194);}return _0x260113;};}function handleError(_0x51698c,_0x2bf233){_0x2bf233=_0x2bf233||0x1f4;return function(_0x4faa79){logger[_0xb924('0x25')](_0x4faa79[_0xb924('0x36')]);if(_0x4faa79['name']){delete _0x4faa79[_0xb924('0x37')];}_0x51698c[_0xb924('0x2a')](_0x2bf233)[_0xb924('0x38')](_0x4faa79);};}exports['index']=function(_0x172068,_0x496f10){var _0x1f6b0c={},_0x154652={},_0x85ff05={'count':0x0,'rows':[]};var _0x182acb=_['map'](db['ServicenowAccount'][_0xb924('0x39')],function(_0xd62e2a){return{'name':_0xd62e2a[_0xb924('0x3a')],'type':_0xd62e2a[_0xb924('0x3b')][_0xb924('0x3c')]};});_0x154652['model']=_[_0xb924('0x3d')](_0x182acb,'name');_0x154652[_0xb924('0x3e')]=_[_0xb924('0x3f')](_0x172068['query']);_0x154652[_0xb924('0x40')]=_[_0xb924('0x41')](_0x154652[_0xb924('0x42')],_0x154652[_0xb924('0x3e')]);_0x1f6b0c[_0xb924('0x43')]=_[_0xb924('0x41')](_0x154652['model'],qs[_0xb924('0x44')](_0x172068[_0xb924('0x3e')]['fields']));_0x1f6b0c[_0xb924('0x43')]=_0x1f6b0c[_0xb924('0x43')][_0xb924('0x45')]?_0x1f6b0c['attributes']:_0x154652['model'];if(!_0x172068['query'][_0xb924('0x46')](_0xb924('0x47'))){_0x1f6b0c[_0xb924('0x2e')]=qs[_0xb924('0x2e')](_0x172068[_0xb924('0x3e')][_0xb924('0x2e')]);_0x1f6b0c[_0xb924('0x2d')]=qs[_0xb924('0x2d')](_0x172068[_0xb924('0x3e')][_0xb924('0x2d')]);}_0x1f6b0c[_0xb924('0x48')]=qs[_0xb924('0x49')](_0x172068[_0xb924('0x3e')][_0xb924('0x49')]);_0x1f6b0c[_0xb924('0x4a')]=qs['filters'](_[_0xb924('0x4b')](_0x172068[_0xb924('0x3e')],_0x154652[_0xb924('0x40')]));if(_0x172068['query'][_0xb924('0x4c')]){_0x1f6b0c[_0xb924('0x4a')]=_[_0xb924('0x4d')](_0x1f6b0c[_0xb924('0x4a')],{'$or':_[_0xb924('0x3d')](_0x182acb,function(_0x5e6660){if(_0x5e6660['type']!==_0xb924('0x4e')){var _0x10c78e={};_0x10c78e[_0x5e6660[_0xb924('0x37')]]={'$like':'%'+_0x172068[_0xb924('0x3e')]['filter']+'%'};return _0x10c78e;}})});}_0x1f6b0c=_['merge']({},_0x1f6b0c,_0x172068['options']);var _0x432688={'where':_0x1f6b0c[_0xb924('0x4a')]};return db[_0xb924('0x4f')]['count'](_0x432688)[_0xb924('0x1f')](function(_0x293268){_0x85ff05[_0xb924('0x2c')]=_0x293268;if(_0x172068[_0xb924('0x3e')][_0xb924('0x50')]){_0x1f6b0c['include']=[{'all':!![]}];}return db[_0xb924('0x4f')][_0xb924('0x51')](_0x1f6b0c);})[_0xb924('0x1f')](function(_0x5451c7){_0x85ff05[_0xb924('0x52')]=_0x5451c7;return _0x85ff05;})['then'](respondWithFilteredResult(_0x496f10,_0x1f6b0c))[_0xb924('0x53')](handleError(_0x496f10,null));};exports[_0xb924('0x54')]=function(_0x3f7599,_0x4e5220){var _0x4efda9={'raw':![],'where':{'id':_0x3f7599[_0xb924('0x55')]['id']}},_0x376f7e={};_0x376f7e['model']=_[_0xb924('0x3f')](db[_0xb924('0x4f')]['rawAttributes']);_0x376f7e[_0xb924('0x3e')]=_['keys'](_0x3f7599['query']);_0x376f7e[_0xb924('0x40')]=_[_0xb924('0x41')](_0x376f7e['model'],_0x376f7e[_0xb924('0x3e')]);_0x4efda9[_0xb924('0x43')]=_['intersection'](_0x376f7e[_0xb924('0x42')],qs['fields'](_0x3f7599[_0xb924('0x3e')][_0xb924('0x44')]));_0x4efda9[_0xb924('0x43')]=_0x4efda9[_0xb924('0x43')][_0xb924('0x45')]?_0x4efda9[_0xb924('0x43')]:_0x376f7e[_0xb924('0x42')];if(_0x3f7599['query'][_0xb924('0x50')]){_0x4efda9[_0xb924('0x56')]=[{'all':!![]}];}_0x4efda9=_['merge']({},_0x4efda9,_0x3f7599[_0xb924('0x57')]);return db['ServicenowAccount'][_0xb924('0x58')](_0x4efda9)[_0xb924('0x1f')](handleEntityNotFound(_0x4e5220,null))['then'](respondWithResult(_0x4e5220,null))[_0xb924('0x53')](handleError(_0x4e5220,null));};exports['create']=function(_0xa0c6dc,_0x232c7c){return db[_0xb924('0x4f')][_0xb924('0x59')](_0xa0c6dc[_0xb924('0x5a')],{})[_0xb924('0x1f')](respondWithResult(_0x232c7c,0xc9))['catch'](handleError(_0x232c7c,null));};exports[_0xb924('0x33')]=function(_0x4715dc,_0x6f7314){if(_0x4715dc['body']['id']){delete _0x4715dc['body']['id'];}return db[_0xb924('0x4f')][_0xb924('0x58')]({'where':{'id':_0x4715dc[_0xb924('0x55')]['id']}})['then'](handleEntityNotFound(_0x6f7314,null))[_0xb924('0x1f')](saveUpdates(_0x4715dc['body'],null))[_0xb924('0x1f')](respondWithResult(_0x6f7314,null))[_0xb924('0x53')](handleError(_0x6f7314,null));};exports[_0xb924('0x34')]=function(_0x1a61f9,_0xaf0313){return db[_0xb924('0x4f')][_0xb924('0x58')]({'where':{'id':_0x1a61f9[_0xb924('0x55')]['id']}})[_0xb924('0x1f')](handleEntityNotFound(_0xaf0313,null))['then'](removeEntity(_0xaf0313,null))[_0xb924('0x53')](handleError(_0xaf0313,null));};exports[_0xb924('0x5b')]=function(_0x3b4ad8,_0x1260fb,_0x140fd7){var _0x968b17={};var _0x76928c={};var _0x4be785;var _0x17200f;return db['ServicenowAccount'][_0xb924('0x5c')]({'where':{'id':_0x3b4ad8[_0xb924('0x55')]['id']}})[_0xb924('0x1f')](handleEntityNotFound(_0x1260fb,null))[_0xb924('0x1f')](function(_0x1e9a56){if(_0x1e9a56){_0x4be785=_0x1e9a56;_0x76928c['model']=_['keys'](db[_0xb924('0x5d')][_0xb924('0x39')]);_0x76928c[_0xb924('0x3e')]=_[_0xb924('0x3f')](_0x3b4ad8[_0xb924('0x3e')]);_0x76928c['filters']=_[_0xb924('0x41')](_0x76928c[_0xb924('0x42')],_0x76928c[_0xb924('0x3e')]);_0x968b17[_0xb924('0x43')]=_[_0xb924('0x41')](_0x76928c[_0xb924('0x42')],qs[_0xb924('0x44')](_0x3b4ad8[_0xb924('0x3e')]['fields']));_0x968b17[_0xb924('0x43')]=_0x968b17['attributes'][_0xb924('0x45')]?_0x968b17[_0xb924('0x43')]:_0x76928c[_0xb924('0x42')];_0x968b17[_0xb924('0x48')]=qs[_0xb924('0x49')](_0x3b4ad8[_0xb924('0x3e')]['sort']);_0x968b17['where']=qs[_0xb924('0x40')](_[_0xb924('0x4b')](_0x3b4ad8['query'],_0x76928c[_0xb924('0x40')]));if(_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x4c')]){_0x968b17[_0xb924('0x4a')]=_[_0xb924('0x4d')](_0x968b17[_0xb924('0x4a')],{'$or':_[_0xb924('0x3d')](_0x968b17[_0xb924('0x43')],function(_0x23bfc0){var _0x13ffec={};_0x13ffec[_0x23bfc0]={'$like':'%'+_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x4c')]+'%'};return _0x13ffec;})});}_0x968b17=_[_0xb924('0x4d')]({},_0x968b17,_0x3b4ad8[_0xb924('0x57')]);return _0x4be785['getConfigurations'](_0x968b17);}})[_0xb924('0x1f')](function(_0x589686){if(_0x589686){_0x17200f=_0x589686[_0xb924('0x45')];if(!_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x46')]('nolimit')){_0x968b17[_0xb924('0x2e')]=qs[_0xb924('0x2e')](_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x2e')]);_0x968b17['offset']=qs[_0xb924('0x2d')](_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x2d')]);}return _0x4be785[_0xb924('0x5b')](_0x968b17);}})[_0xb924('0x1f')](function(_0x5bc03d){if(_0x5bc03d){return _0x5bc03d?{'count':_0x17200f,'rows':_0x5bc03d}:null;}})[_0xb924('0x1f')](respondWithResult(_0x1260fb,null))[_0xb924('0x53')](handleError(_0x1260fb,null));};exports[_0xb924('0x5e')]=function(_0x35ee91,_0x11f1a3,_0x304579){if(_0x35ee91[_0xb924('0x5a')]['id']){delete _0x35ee91[_0xb924('0x5a')]['id'];}return db[_0xb924('0x4f')]['findOne']({'where':{'id':_0x35ee91['params']['id']}})['then'](handleEntityNotFound(_0x11f1a3,null))[_0xb924('0x1f')](function(_0x3a36bb){if(_0x3a36bb){_0x35ee91[_0xb924('0x5a')][_0xb924('0x5f')]=_0x3a36bb['id'];_0x35ee91[_0xb924('0x5a')][_0xb924('0x60')]=integrations[_0xb924('0x61')](_0x35ee91[_0xb924('0x5a')][_0xb924('0x62')],_0x35ee91[_0xb924('0x5a')][_0xb924('0x3b')]);_0x35ee91[_0xb924('0x5a')]['Descriptions']=integrations[_0xb924('0x63')](_0x35ee91[_0xb924('0x5a')]['channel'],_0x35ee91[_0xb924('0x5a')]['type']);return db[_0xb924('0x5d')][_0xb924('0x59')](_0x35ee91[_0xb924('0x5a')],{'include':[{'model':db['ServicenowField'],'as':_0xb924('0x60')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0xb924('0x1f')](respondWithResult(_0x11f1a3,null))[_0xb924('0x53')](handleError(_0x11f1a3,null));};exports[_0xb924('0x64')]=function(_0x43e48b,_0x13a180,_0x502357){var _0x41e276=[_0xb924('0x65'),_0xb924('0x66'),_0xb924('0x67'),'subcategory',_0xb924('0x68'),_0xb924('0x69'),_0xb924('0x6a'),_0xb924('0x6b'),_0xb924('0x6c')];var _0x46c218=[_0xb924('0x6d'),_0xb924('0x65'),_0xb924('0x6e'),_0xb924('0x6f'),'upon_reject','sys_updated_on',_0xb924('0x70'),_0xb924('0x66'),_0xb924('0x71'),_0xb924('0x72'),_0xb924('0x73'),_0xb924('0x74'),_0xb924('0x75'),_0xb924('0x76'),'sys_created_on',_0xb924('0x77'),_0xb924('0x78'),_0xb924('0x79'),_0xb924('0x67'),'order',_0xb924('0x7a'),_0xb924('0x7b'),_0xb924('0x7c'),_0xb924('0x7d'),_0xb924('0x7e'),_0xb924('0x7f'),_0xb924('0x80'),'business_service',_0xb924('0x81'),'sys_domain_path',_0xb924('0x82'),_0xb924('0x83'),_0xb924('0x84'),'opened_at','business_duration',_0xb924('0x85'),_0xb924('0x86'),_0xb924('0x87'),_0xb924('0x88'),_0xb924('0x89'),_0xb924('0x8a'),'subcategory',_0xb924('0x8b'),_0xb924('0x8c'),'close_code',_0xb924('0x8d'),_0xb924('0x8e'),_0xb924('0x8f'),_0xb924('0x90'),_0xb924('0x91'),_0xb924('0x92'),'description',_0xb924('0x93'),'notify',_0xb924('0x94'),_0xb924('0x95'),'closed_by',_0xb924('0x96'),_0xb924('0x97'),_0xb924('0x98'),_0xb924('0x99'),'reopened_by',_0xb924('0x6a'),'urgency',_0xb924('0x9a'),_0xb924('0x9b'),'reassignment_count',_0xb924('0x9c'),_0xb924('0x9d'),_0xb924('0x6b'),_0xb924('0x9e'),'sla_due',_0xb924('0x9f'),_0xb924('0xa0'),_0xb924('0xa1'),_0xb924('0xa2'),_0xb924('0xa3'),'sys_tags',_0xb924('0xa4'),_0xb924('0xa5'),_0xb924('0xa6'),'location','category'];var _0x11c82e='';var _0x5c4744='';var _0x5cbf41=[];var _0x2d031e='';var _0x1a3d82='';var _0x5719f0=[];var _0x37945f='';var _0x2f62fc='';var _0x25595e={};var _0x5333d4='';return db[_0xb924('0x4f')][_0xb924('0x5c')]({'where':{'id':_0x43e48b[_0xb924('0x55')]['id']},'attributes':['id',_0xb924('0xa7'),_0xb924('0xa8'),'email',_0xb924('0xa9'),_0xb924('0xaa')]})[_0xb924('0x1f')](handleEntityNotFound(_0x13a180,null))[_0xb924('0x1f')](function(_0x59ce34){if(_0x59ce34){_0x5333d4=_0x59ce34[_0xb924('0xa9')];var _0x5938e=_0x5333d4[_0xb924('0xab')](-0x1);if(_0x5938e==='/'){_0x5333d4=_0x5333d4[_0xb924('0xac')](0x0,_0x5333d4[_0xb924('0xad')](_0x5938e));}_0x2f62fc=util[_0xb924('0xae')]('%s/api/now/doc/table/schema/',_0x5333d4);_0x37945f=util[_0xb924('0xae')](_0xb924('0xaf'),_0x5333d4);_0x25595e={'user':_0x59ce34[_0xb924('0xa7')],'pass':_0x59ce34['password']};var _0x1539ac={'method':_0xb924('0xb0'),'uri':_0x2f62fc+'incident?sysparm_display_value=all','auth':_0x25595e,'json':!![]};return rp(_0x1539ac);}})[_0xb924('0x1f')](function(_0x40afb3){if(_0x40afb3[_0xb924('0xb1')]['length']>0x0){_0x11c82e=_0x40afb3[_0xb924('0xb1')];}console['log']('incident\x20table\x20objects',_0x11c82e);_0x5719f0=[];_0x5c4744=Object[_0xb924('0xb2')]([],_0x11c82e);_['remove'](_0x5c4744,function(_0x25556a){return!_0x41e276[_0xb924('0xb3')](_0x25556a['name']);});_0x5c4744[_0xb924('0xb4')](function(_0x2816e0){var _0x45386c=createFieldObject(_0x37945f,_0x25595e,_0x2816e0[_0xb924('0xb5')],_0x2816e0['name'],_0x2816e0['label'],![]);_0x5719f0[_0xb924('0xb6')](_0x45386c);});return Promise['all'](_0x5719f0);})[_0xb924('0x1f')](function(_0x30eb27){_0x5cbf41=_0x30eb27;_0x2d031e=Object['assign']([],_0x11c82e);console['log'](_0xb924('0xb7'),_0x11c82e);_['remove'](_0x2d031e,function(_0xf6e955){return _0x46c218[_0xb924('0xb3')](_0xf6e955['name']);});console[_0xb924('0xb8')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2d031e);_0x5719f0=[];_0x2d031e[_0xb924('0xb4')](function(_0x1351fa){var _0x494d11=createFieldObject(_0x37945f,_0x25595e,_0x1351fa[_0xb924('0xb5')],_0x1351fa['name'],_0x1351fa[_0xb924('0xb9')],!![]);_0x5719f0[_0xb924('0xb6')](_0x494d11);});return Promise['all'](_0x5719f0);})[_0xb924('0x1f')](function(_0x19dca5){_0x1a3d82=_0x19dca5;var _0x46c812=_0x5cbf41[_0xb924('0xba')](_0x1a3d82);return{'count':_0x46c812[_0xb924('0x45')],'rows':_0x46c812};})['then'](respondWithResult(_0x13a180,null))[_0xb924('0x53')](function(_0x26a952){console['log'](_0xb924('0xbb')+_0x26a952);var _0x5eb19d=_0x43e48b[_0xb924('0x3e')][_0xb924('0xbc')]?0x1f4:_0x26a952[_0xb924('0xbd')]||0x1f4;logger[_0xb924('0x25')](_0x26a952[_0xb924('0x36')]);delete _0x26a952[_0xb924('0x37')];if(_0x5eb19d===0x191){_0x5eb19d=0x190;}_0x13a180[_0xb924('0x2a')](_0x5eb19d)[_0xb924('0x38')](_0x43e48b['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x26a952[_0xb924('0xbd')]}:_0x26a952);});};function createFieldObject(_0x2b8482,_0x155448,_0x4edc84,_0x28d2f1,_0x396b65,_0x5eb588){return new Promise(function(_0x5f42c1,_0x192a1e){var _0x1d99f6={'id':_0x28d2f1,'name':_0x396b65,'custom':_0x5eb588};if(_0x4edc84===_0xb924('0xbe')){_0x1d99f6['options']=[{'name':_0xb924('0xbf'),'value':_0xb924('0xc0')},{'name':_0xb924('0xc1'),'value':_0xb924('0xc2')}];_0x5f42c1(_0x1d99f6);}else{var _0x496389={'method':_0xb924('0xb0'),'uri':_0x2b8482+'sys_choice?sysparm_query=name=incident^element='+_0x28d2f1,'auth':_0x155448,'json':!![]};return rp(_0x496389)[_0xb924('0x1f')](function(_0x4c1f40){var _0x1f21a3=[];if(_0x4c1f40[_0xb924('0xb1')][_0xb924('0x45')]>0x0){_0x4c1f40[_0xb924('0xb1')][_0xb924('0xb4')](function(_0x584683){if(_0x584683['inactive']==='false'){var _0x5552ff={'name':_0x584683['label'],'value':_0x584683[_0xb924('0xc3')]};_0x1f21a3[_0xb924('0xb6')](_0x5552ff);}});}_0x1d99f6['options']=_0x1f21a3;if(_0x1d99f6[_0xb924('0x57')][_0xb924('0x45')]>0x0){_0x5f42c1(_0x1d99f6);}else{if(_0x5eb588==![]){_0x5f42c1();}else{_0x5f42c1(_0x1d99f6);}}});}});} \ No newline at end of file +var _0x59aa=['debug','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','status','end','json','count','offset','limit','set','reject','save','update','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ServicenowAccount','includeAll','findAll','rows','catch','length','find','body','destroy','getConfigurations','params','ServicenowConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','getDescriptions','create','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','caused_by','upon_reject','approval_history','number','sys_updated_by','opened_by','sys_created_on','sys_domain','state','sys_created_by','cmdb_ci','impact','active','business_service','priority','sys_domain_path','expected_start','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','company','reassignment_count','activity_due','sla_due','due_date','reopen_count','escalation','upon_approval','correlation_id','location','findOne','username','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','test','Wrong\x20credentials','statusCode','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent'];(function(_0x400d28,_0x5a4212){var _0x3b47fe=function(_0x20fefa){while(--_0x20fefa){_0x400d28['push'](_0x400d28['shift']());}};_0x3b47fe(++_0x5a4212);}(_0x59aa,0x9b));var _0xa59a=function(_0x2d50b2,_0x67598d){_0x2d50b2=_0x2d50b2-0x0;var _0x5b6027=_0x59aa[_0x2d50b2];return _0x5b6027;};'use strict';var pdf=require(_0xa59a('0x0'));var emlformat=require(_0xa59a('0x1'));var rimraf=require(_0xa59a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa59a('0x3'));var rp=require(_0xa59a('0x4'));var moment=require(_0xa59a('0x5'));var BPromise=require(_0xa59a('0x6'));var Mustache=require(_0xa59a('0x7'));var util=require(_0xa59a('0x8'));var path=require('path');var sox=require(_0xa59a('0x9'));var csv=require(_0xa59a('0xa'));var ejs=require(_0xa59a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa59a('0xc'));var crypto=require(_0xa59a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa59a('0xe'));var toCsv=require(_0xa59a('0xa'));var querystring=require('querystring');var Papa=require(_0xa59a('0xf'));var Redis=require('ioredis');var authService=require(_0xa59a('0x10'));var qs=require(_0xa59a('0x11'));var as=require(_0xa59a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa59a('0x13'))(_0xa59a('0x14'));var utils=require('../../config/utils');var config=require(_0xa59a('0x15'));var db=require(_0xa59a('0x16'))['db'];var integrations=require(_0xa59a('0x17'));var jayson=require(_0xa59a('0x18'));var client=jayson[_0xa59a('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x592a10,_0x87325c,_0x113023){if(_0x113023){var _0x40392f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40392f['test'](_0x87325c)){return _0x592a10;}else{throw new db[(_0xa59a('0x1a'))][(_0xa59a('0x1b'))](_0xa59a('0x1c'));}}else{return _0x592a10;}}function respondWithRpcPromise(_0x44d1c5,_0xdbdd28,_0x1db90f,_0x35a15b){return new BPromise(function(_0x316229,_0x1abed4){var _0x55c546=_0x35a15b||client;return _0x55c546[_0xa59a('0x1d')](_0x44d1c5,_0x1db90f)[_0xa59a('0x1e')](function(_0x2f7cb7){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0xdbdd28,_0xa59a('0x1f'));logger[_0xa59a('0x20')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xdbdd28,'request\x20sent',JSON[_0xa59a('0x21')](_0x2f7cb7));if(_0x2f7cb7[_0xa59a('0x22')]){if(_0x2f7cb7[_0xa59a('0x22')][_0xa59a('0x23')]===0x1f4){logger[_0xa59a('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0xdbdd28,_0x2f7cb7[_0xa59a('0x22')][_0xa59a('0x24')]);return _0x1abed4(_0x2f7cb7[_0xa59a('0x22')][_0xa59a('0x24')]);}logger[_0xa59a('0x22')](_0xa59a('0x25'),_0xdbdd28,_0x2f7cb7['error'][_0xa59a('0x24')]);return _0x316229(_0x2f7cb7['error'][_0xa59a('0x24')]);}else{logger['info'](_0xa59a('0x25'),_0xdbdd28,_0xa59a('0x1f'));_0x316229(_0x2f7cb7['result'][_0xa59a('0x24')]);}})['catch'](function(_0x1fbbd6){logger[_0xa59a('0x22')](_0xa59a('0x25'),_0xdbdd28,_0x1fbbd6);_0x1abed4(_0x1fbbd6);});});}function respondWithStatusCode(_0x2d8b90,_0x1a1e0a){_0x1a1e0a=_0x1a1e0a||0xcc;return function(_0x193f53){if(_0x193f53){return _0x2d8b90['sendStatus'](_0x1a1e0a);}return _0x2d8b90[_0xa59a('0x26')](_0x1a1e0a)[_0xa59a('0x27')]();};}function respondWithResult(_0x2a4453,_0x5a91b9){_0x5a91b9=_0x5a91b9||0xc8;return function(_0x10af0f){if(_0x10af0f){return _0x2a4453[_0xa59a('0x26')](_0x5a91b9)[_0xa59a('0x28')](_0x10af0f);}};}function respondWithFilteredResult(_0x2d410a,_0x2b1531){return function(_0x41eb9b){if(_0x41eb9b){var _0x1c12b4=_0x41eb9b[_0xa59a('0x29')],_0x5e3e2f=_0x2b1531['offset'],_0x3cfd8e=_0x2b1531[_0xa59a('0x2a')]+_0x2b1531[_0xa59a('0x2b')],_0x285251;if(_0x3cfd8e>=_0x1c12b4){_0x3cfd8e=_0x1c12b4;_0x285251=0xc8;}else{_0x285251=0xce;}_0x2d410a['status'](_0x285251);return _0x2d410a[_0xa59a('0x2c')]('Content-Range',_0x5e3e2f+'-'+_0x3cfd8e+'/'+_0x1c12b4)[_0xa59a('0x28')](_0x41eb9b);}return null;};}function patchUpdates(_0x2d031a){return function(_0x3a2372){try{jsonpatch['apply'](_0x3a2372,_0x2d031a,!![]);}catch(_0xbdc04a){return BPromise[_0xa59a('0x2d')](_0xbdc04a);}return _0x3a2372[_0xa59a('0x2e')]();};}function saveUpdates(_0x120346,_0x10028a){return function(_0x165034){if(_0x165034){return _0x165034[_0xa59a('0x2f')](_0x120346)[_0xa59a('0x1e')](function(_0x5d3d50){return _0x5d3d50;});}return null;};}function removeEntity(_0x398ea2,_0x33151f){return function(_0x38eafe){if(_0x38eafe){return _0x38eafe['destroy']()['then'](function(){_0x398ea2[_0xa59a('0x26')](0xcc)[_0xa59a('0x27')]();});}};}function handleEntityNotFound(_0x5a6914,_0x54bbfe){return function(_0x967aaf){if(!_0x967aaf){_0x5a6914[_0xa59a('0x30')](0x194);}return _0x967aaf;};}function handleError(_0x231d4e,_0x2020bd){_0x2020bd=_0x2020bd||0x1f4;return function(_0x5f3482){logger[_0xa59a('0x22')](_0x5f3482[_0xa59a('0x31')]);if(_0x5f3482[_0xa59a('0x32')]){delete _0x5f3482[_0xa59a('0x32')];}_0x231d4e[_0xa59a('0x26')](_0x2020bd)[_0xa59a('0x33')](_0x5f3482);};}exports[_0xa59a('0x34')]=function(_0x2d095a,_0x3edb8b){var _0x2e1ece={},_0x3bfd16={},_0x39fb03={'count':0x0,'rows':[]};var _0x4f5740=_[_0xa59a('0x35')](db['ServicenowAccount'][_0xa59a('0x36')],function(_0x543015){return{'name':_0x543015['fieldName'],'type':_0x543015[_0xa59a('0x37')][_0xa59a('0x38')]};});_0x3bfd16[_0xa59a('0x39')]=_[_0xa59a('0x35')](_0x4f5740,_0xa59a('0x32'));_0x3bfd16[_0xa59a('0x3a')]=_[_0xa59a('0x3b')](_0x2d095a[_0xa59a('0x3a')]);_0x3bfd16[_0xa59a('0x3c')]=_[_0xa59a('0x3d')](_0x3bfd16[_0xa59a('0x39')],_0x3bfd16[_0xa59a('0x3a')]);_0x2e1ece[_0xa59a('0x3e')]=_['intersection'](_0x3bfd16[_0xa59a('0x39')],qs[_0xa59a('0x3f')](_0x2d095a[_0xa59a('0x3a')]['fields']));_0x2e1ece[_0xa59a('0x3e')]=_0x2e1ece[_0xa59a('0x3e')]['length']?_0x2e1ece[_0xa59a('0x3e')]:_0x3bfd16[_0xa59a('0x39')];if(!_0x2d095a['query'][_0xa59a('0x40')](_0xa59a('0x41'))){_0x2e1ece[_0xa59a('0x2b')]=qs[_0xa59a('0x2b')](_0x2d095a[_0xa59a('0x3a')]['limit']);_0x2e1ece[_0xa59a('0x2a')]=qs[_0xa59a('0x2a')](_0x2d095a['query'][_0xa59a('0x2a')]);}_0x2e1ece[_0xa59a('0x42')]=qs['sort'](_0x2d095a[_0xa59a('0x3a')][_0xa59a('0x43')]);_0x2e1ece[_0xa59a('0x44')]=qs[_0xa59a('0x3c')](_['pick'](_0x2d095a[_0xa59a('0x3a')],_0x3bfd16[_0xa59a('0x3c')]));if(_0x2d095a['query'][_0xa59a('0x45')]){_0x2e1ece[_0xa59a('0x44')]=_[_0xa59a('0x46')](_0x2e1ece[_0xa59a('0x44')],{'$or':_['map'](_0x4f5740,function(_0x594e48){if(_0x594e48[_0xa59a('0x37')]!==_0xa59a('0x47')){var _0x2e3eaf={};_0x2e3eaf[_0x594e48['name']]={'$like':'%'+_0x2d095a[_0xa59a('0x3a')][_0xa59a('0x45')]+'%'};return _0x2e3eaf;}})});}_0x2e1ece=_[_0xa59a('0x46')]({},_0x2e1ece,_0x2d095a[_0xa59a('0x48')]);var _0x44631a={'where':_0x2e1ece[_0xa59a('0x44')]};return db[_0xa59a('0x49')][_0xa59a('0x29')](_0x44631a)[_0xa59a('0x1e')](function(_0x489d74){_0x39fb03[_0xa59a('0x29')]=_0x489d74;if(_0x2d095a['query'][_0xa59a('0x4a')]){_0x2e1ece['include']=[{'all':!![]}];}return db[_0xa59a('0x49')][_0xa59a('0x4b')](_0x2e1ece);})[_0xa59a('0x1e')](function(_0xb44068){_0x39fb03[_0xa59a('0x4c')]=_0xb44068;return _0x39fb03;})[_0xa59a('0x1e')](respondWithFilteredResult(_0x3edb8b,_0x2e1ece))[_0xa59a('0x4d')](handleError(_0x3edb8b,null));};exports['show']=function(_0x19fe9b,_0x5f2ed7){var _0x568806={'raw':![],'where':{'id':_0x19fe9b['params']['id']}},_0x410105={};_0x410105['model']=_[_0xa59a('0x3b')](db[_0xa59a('0x49')][_0xa59a('0x36')]);_0x410105[_0xa59a('0x3a')]=_[_0xa59a('0x3b')](_0x19fe9b[_0xa59a('0x3a')]);_0x410105['filters']=_[_0xa59a('0x3d')](_0x410105[_0xa59a('0x39')],_0x410105[_0xa59a('0x3a')]);_0x568806[_0xa59a('0x3e')]=_[_0xa59a('0x3d')](_0x410105[_0xa59a('0x39')],qs[_0xa59a('0x3f')](_0x19fe9b[_0xa59a('0x3a')][_0xa59a('0x3f')]));_0x568806[_0xa59a('0x3e')]=_0x568806['attributes'][_0xa59a('0x4e')]?_0x568806[_0xa59a('0x3e')]:_0x410105[_0xa59a('0x39')];if(_0x19fe9b['query'][_0xa59a('0x4a')]){_0x568806['include']=[{'all':!![]}];}_0x568806=_['merge']({},_0x568806,_0x19fe9b[_0xa59a('0x48')]);return db[_0xa59a('0x49')][_0xa59a('0x4f')](_0x568806)[_0xa59a('0x1e')](handleEntityNotFound(_0x5f2ed7,null))['then'](respondWithResult(_0x5f2ed7,null))[_0xa59a('0x4d')](handleError(_0x5f2ed7,null));};exports['create']=function(_0x3ba600,_0x2170e1){return db[_0xa59a('0x49')]['create'](_0x3ba600['body'],{})['then'](respondWithResult(_0x2170e1,0xc9))[_0xa59a('0x4d')](handleError(_0x2170e1,null));};exports['update']=function(_0x14be2a,_0xcbbb10){if(_0x14be2a[_0xa59a('0x50')]['id']){delete _0x14be2a[_0xa59a('0x50')]['id'];}return db['ServicenowAccount'][_0xa59a('0x4f')]({'where':{'id':_0x14be2a['params']['id']}})[_0xa59a('0x1e')](handleEntityNotFound(_0xcbbb10,null))[_0xa59a('0x1e')](saveUpdates(_0x14be2a[_0xa59a('0x50')],null))[_0xa59a('0x1e')](respondWithResult(_0xcbbb10,null))[_0xa59a('0x4d')](handleError(_0xcbbb10,null));};exports[_0xa59a('0x51')]=function(_0x5780f3,_0x32a92c){return db[_0xa59a('0x49')]['find']({'where':{'id':_0x5780f3['params']['id']}})['then'](handleEntityNotFound(_0x32a92c,null))['then'](removeEntity(_0x32a92c,null))[_0xa59a('0x4d')](handleError(_0x32a92c,null));};exports[_0xa59a('0x52')]=function(_0x23c463,_0x4d749c,_0x230370){var _0x3b6932={};var _0x15fa1c={};var _0xe86434;var _0xa85ba3;return db[_0xa59a('0x49')]['findOne']({'where':{'id':_0x23c463[_0xa59a('0x53')]['id']}})[_0xa59a('0x1e')](handleEntityNotFound(_0x4d749c,null))[_0xa59a('0x1e')](function(_0x520481){if(_0x520481){_0xe86434=_0x520481;_0x15fa1c[_0xa59a('0x39')]=_[_0xa59a('0x3b')](db[_0xa59a('0x54')][_0xa59a('0x36')]);_0x15fa1c[_0xa59a('0x3a')]=_['keys'](_0x23c463[_0xa59a('0x3a')]);_0x15fa1c['filters']=_['intersection'](_0x15fa1c['model'],_0x15fa1c['query']);_0x3b6932['attributes']=_['intersection'](_0x15fa1c[_0xa59a('0x39')],qs[_0xa59a('0x3f')](_0x23c463['query'][_0xa59a('0x3f')]));_0x3b6932[_0xa59a('0x3e')]=_0x3b6932[_0xa59a('0x3e')][_0xa59a('0x4e')]?_0x3b6932[_0xa59a('0x3e')]:_0x15fa1c[_0xa59a('0x39')];_0x3b6932[_0xa59a('0x42')]=qs[_0xa59a('0x43')](_0x23c463[_0xa59a('0x3a')][_0xa59a('0x43')]);_0x3b6932[_0xa59a('0x44')]=qs[_0xa59a('0x3c')](_[_0xa59a('0x55')](_0x23c463[_0xa59a('0x3a')],_0x15fa1c[_0xa59a('0x3c')]));if(_0x23c463['query'][_0xa59a('0x45')]){_0x3b6932[_0xa59a('0x44')]=_['merge'](_0x3b6932['where'],{'$or':_[_0xa59a('0x35')](_0x3b6932['attributes'],function(_0x468889){var _0x22c177={};_0x22c177[_0x468889]={'$like':'%'+_0x23c463['query'][_0xa59a('0x45')]+'%'};return _0x22c177;})});}_0x3b6932=_[_0xa59a('0x46')]({},_0x3b6932,_0x23c463[_0xa59a('0x48')]);return _0xe86434[_0xa59a('0x52')](_0x3b6932);}})[_0xa59a('0x1e')](function(_0xa0652b){if(_0xa0652b){_0xa85ba3=_0xa0652b[_0xa59a('0x4e')];if(!_0x23c463[_0xa59a('0x3a')]['hasOwnProperty']('nolimit')){_0x3b6932[_0xa59a('0x2b')]=qs['limit'](_0x23c463['query'][_0xa59a('0x2b')]);_0x3b6932[_0xa59a('0x2a')]=qs[_0xa59a('0x2a')](_0x23c463['query']['offset']);}return _0xe86434[_0xa59a('0x52')](_0x3b6932);}})[_0xa59a('0x1e')](function(_0xb89e0){if(_0xb89e0){return _0xb89e0?{'count':_0xa85ba3,'rows':_0xb89e0}:null;}})[_0xa59a('0x1e')](respondWithResult(_0x4d749c,null))[_0xa59a('0x4d')](handleError(_0x4d749c,null));};exports[_0xa59a('0x56')]=function(_0x26b4d7,_0x12a4b0,_0x16a6ce){if(_0x26b4d7[_0xa59a('0x50')]['id']){delete _0x26b4d7[_0xa59a('0x50')]['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x26b4d7[_0xa59a('0x53')]['id']}})['then'](handleEntityNotFound(_0x12a4b0,null))['then'](function(_0x18ca85){if(_0x18ca85){_0x26b4d7[_0xa59a('0x50')]['AccountId']=_0x18ca85['id'];_0x26b4d7[_0xa59a('0x50')][_0xa59a('0x57')]=integrations[_0xa59a('0x58')](_0x26b4d7[_0xa59a('0x50')][_0xa59a('0x59')],_0x26b4d7[_0xa59a('0x50')][_0xa59a('0x37')]);_0x26b4d7[_0xa59a('0x50')]['Descriptions']=integrations[_0xa59a('0x5a')](_0x26b4d7['body']['channel'],_0x26b4d7[_0xa59a('0x50')][_0xa59a('0x37')]);return db[_0xa59a('0x54')][_0xa59a('0x5b')](_0x26b4d7[_0xa59a('0x50')],{'include':[{'model':db[_0xa59a('0x5c')],'as':_0xa59a('0x57')},{'model':db[_0xa59a('0x5c')],'as':'Descriptions'}]});}return null;})[_0xa59a('0x1e')](respondWithResult(_0x12a4b0,null))['catch'](handleError(_0x12a4b0,null));};exports[_0xa59a('0x5d')]=function(_0x2e6aa4,_0x44d3be,_0x39975d){var _0x33d91b=[_0xa59a('0x5e'),_0xa59a('0x5f'),_0xa59a('0x60'),_0xa59a('0x61'),_0xa59a('0x62'),_0xa59a('0x63'),_0xa59a('0x64'),_0xa59a('0x65'),_0xa59a('0x66')];var _0x5a3841=['parent','made_sla',_0xa59a('0x67'),'watch_list',_0xa59a('0x68'),'sys_updated_on','child_incidents','hold_reason',_0xa59a('0x69'),_0xa59a('0x6a'),'resolved_by',_0xa59a('0x6b'),_0xa59a('0x6c'),'user_input',_0xa59a('0x6d'),_0xa59a('0x6e'),_0xa59a('0x6f'),_0xa59a('0x70'),_0xa59a('0x60'),_0xa59a('0x42'),'calendar_stc','closed_at',_0xa59a('0x71'),'delivery_plan',_0xa59a('0x72'),_0xa59a('0x73'),'work_notes_list',_0xa59a('0x74'),_0xa59a('0x75'),_0xa59a('0x76'),'rfc','time_worked',_0xa59a('0x77'),'opened_at','business_duration','group_list',_0xa59a('0x78'),_0xa59a('0x79'),_0xa59a('0x7a'),_0xa59a('0x7b'),_0xa59a('0x7c'),_0xa59a('0x61'),_0xa59a('0x7d'),_0xa59a('0x7e'),'close_code',_0xa59a('0x7f'),_0xa59a('0x80'),'work_start',_0xa59a('0x81'),_0xa59a('0x82'),_0xa59a('0x83'),'description','calendar_duration','notify',_0xa59a('0x84'),_0xa59a('0x85'),_0xa59a('0x86'),_0xa59a('0x87'),'parent_incident',_0xa59a('0x88'),_0xa59a('0x89'),_0xa59a('0x8a'),'incident_state','urgency','problem_id',_0xa59a('0x8b'),_0xa59a('0x8c'),_0xa59a('0x8d'),'assigned_to','severity','comments',_0xa59a('0x8e'),'approval','comments_and_work_notes',_0xa59a('0x8f'),'sys_mod_count',_0xa59a('0x90'),'sys_tags',_0xa59a('0x91'),_0xa59a('0x92'),_0xa59a('0x93'),_0xa59a('0x94'),'category'];var _0x17b84d='';var _0x19c520='';var _0x494a95=[];var _0x31adbf='';var _0x15f769='';var _0x3b29a4=[];var _0x2caa79='';var _0x133a72='';var _0x3eec11={};var _0x593b0a='';return db[_0xa59a('0x49')][_0xa59a('0x95')]({'where':{'id':_0x2e6aa4[_0xa59a('0x53')]['id']},'attributes':['id',_0xa59a('0x96'),_0xa59a('0x97'),_0xa59a('0x98'),_0xa59a('0x99'),_0xa59a('0x9a')]})['then'](handleEntityNotFound(_0x44d3be,null))['then'](function(_0x4c8da6){if(_0x4c8da6){_0x593b0a=_0x4c8da6[_0xa59a('0x99')];var _0x18657d=_0x593b0a[_0xa59a('0x9b')](-0x1);if(_0x18657d==='/'){_0x593b0a=_0x593b0a[_0xa59a('0x9c')](0x0,_0x593b0a[_0xa59a('0x9d')](_0x18657d));}_0x133a72=util[_0xa59a('0x9e')](_0xa59a('0x9f'),_0x593b0a);_0x2caa79=util[_0xa59a('0x9e')](_0xa59a('0xa0'),_0x593b0a);_0x3eec11={'user':_0x4c8da6[_0xa59a('0x96')],'pass':_0x4c8da6[_0xa59a('0x97')]};var _0x27b91b={'method':_0xa59a('0xa1'),'uri':_0x133a72+_0xa59a('0xa2'),'auth':_0x3eec11,'json':!![]};return rp(_0x27b91b);}})[_0xa59a('0x1e')](function(_0x3872b1){if(_0x3872b1['result'][_0xa59a('0x4e')]>0x0){_0x17b84d=_0x3872b1[_0xa59a('0xa3')];}console[_0xa59a('0xa4')](_0xa59a('0xa5'),_0x17b84d);_0x3b29a4=[];_0x19c520=Object[_0xa59a('0xa6')]([],_0x17b84d);_[_0xa59a('0xa7')](_0x19c520,function(_0x4cbf3e){return!_0x33d91b[_0xa59a('0xa8')](_0x4cbf3e[_0xa59a('0x32')]);});_0x19c520['forEach'](function(_0x11135d){var _0x125b21=createFieldObject(_0x2caa79,_0x3eec11,_0x11135d[_0xa59a('0xa9')],_0x11135d['name'],_0x11135d[_0xa59a('0xaa')],![]);_0x3b29a4[_0xa59a('0xab')](_0x125b21);});return Promise[_0xa59a('0xac')](_0x3b29a4);})[_0xa59a('0x1e')](function(_0x5d6e51){_0x494a95=_0x5d6e51;_0x31adbf=Object[_0xa59a('0xa6')]([],_0x17b84d);console[_0xa59a('0xa4')](_0xa59a('0xad'),_0x17b84d);_[_0xa59a('0xa7')](_0x31adbf,function(_0x188e4c){return _0x5a3841[_0xa59a('0xa8')](_0x188e4c['name']);});console['log'](_0xa59a('0xae'),_0x31adbf);_0x3b29a4=[];_0x31adbf[_0xa59a('0xaf')](function(_0x1fd0a8){var _0x21eb19=createFieldObject(_0x2caa79,_0x3eec11,_0x1fd0a8[_0xa59a('0xa9')],_0x1fd0a8['name'],_0x1fd0a8['label'],!![]);_0x3b29a4[_0xa59a('0xab')](_0x21eb19);});return Promise[_0xa59a('0xac')](_0x3b29a4);})[_0xa59a('0x1e')](function(_0x439041){_0x15f769=_0x439041;var _0x59ea31=_0x494a95[_0xa59a('0xb0')](_0x15f769);return{'count':_0x59ea31[_0xa59a('0x4e')],'rows':_0x59ea31};})[_0xa59a('0x1e')](respondWithResult(_0x44d3be,null))[_0xa59a('0x4d')](function(_0x2a59c3){console[_0xa59a('0xa4')]('ServiceNow\x20error:\x20'+_0x2a59c3);var _0x36fabd=_0x2e6aa4['query'][_0xa59a('0xb1')]?0x1f4:_0x2a59c3['statusCode']||0x1f4;logger[_0xa59a('0x22')](_0x2a59c3[_0xa59a('0x31')]);delete _0x2a59c3[_0xa59a('0x32')];if(_0x36fabd===0x191){_0x36fabd=0x190;}_0x44d3be[_0xa59a('0x26')](_0x36fabd)['send'](_0x2e6aa4[_0xa59a('0x3a')][_0xa59a('0xb1')]?{'message':_0xa59a('0xb2'),'statusCode':_0x2a59c3[_0xa59a('0xb3')]}:_0x2a59c3);});};function createFieldObject(_0x3b376a,_0xc45a45,_0x4c66cd,_0x436e6f,_0x27342b,_0x4a8dac){return new Promise(function(_0x1a32e2,_0xe12aea){var _0x430365={'id':_0x436e6f,'name':_0x27342b,'custom':_0x4a8dac};if(_0x4c66cd===_0xa59a('0xb4')){_0x430365['options']=[{'name':_0xa59a('0xb5'),'value':_0xa59a('0xb6')},{'name':_0xa59a('0xb7'),'value':_0xa59a('0xb8')}];_0x1a32e2(_0x430365);}else{var _0x38f370={'method':'GET','uri':_0x3b376a+_0xa59a('0xb9')+_0x436e6f,'auth':_0xc45a45,'json':!![]};return rp(_0x38f370)['then'](function(_0x52ac3e){var _0x5df8e9=[];if(_0x52ac3e[_0xa59a('0xa3')][_0xa59a('0x4e')]>0x0){_0x52ac3e[_0xa59a('0xa3')]['forEach'](function(_0x51e228){if(_0x51e228['inactive']==='false'){var _0x5b55f5={'name':_0x51e228[_0xa59a('0xaa')],'value':_0x51e228[_0xa59a('0xba')]};_0x5df8e9[_0xa59a('0xab')](_0x5b55f5);}});}_0x430365['options']=_0x5df8e9;if(_0x430365[_0xa59a('0x48')]['length']>0x0){_0x1a32e2(_0x430365);}else{if(_0x4a8dac==![]){_0x1a32e2();}else{_0x1a32e2(_0x430365);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index b97897e..0df4814 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 _0x84e7=['ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x84e7,0x122));var _0x784e=function(_0x2ea59d,_0x115114){_0x2ea59d=_0x2ea59d-0x0;var _0x127e9f=_0x84e7[_0x2ea59d];return _0x127e9f;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x784e('0x4'));var rimraf=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var attributes=require(_0x784e('0x7'));var integrations=require(_0x784e('0x8'));module[_0x784e('0x9')]=function(_0x48ed22,_0x3cbdd1){return _0x48ed22['define'](_0x784e('0xa'),attributes,{'tableName':_0x784e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7a3=['moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_servicenow_accounts','util','../../config/logger','api'];(function(_0x3002d4,_0x124e4f){var _0xb9e4ec=function(_0x77e353){while(--_0x77e353){_0x3002d4['push'](_0x3002d4['shift']());}};_0xb9e4ec(++_0x124e4f);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x428a5f,_0x56c9cf){_0x428a5f=_0x428a5f-0x0;var _0x1a591b=_0xc7a3[_0x428a5f];return _0x1a591b;};'use strict';var _=require('lodash');var util=require(_0x3c7a('0x0'));var logger=require(_0x3c7a('0x1'))(_0x3c7a('0x2'));var moment=require(_0x3c7a('0x3'));var BPromise=require(_0x3c7a('0x4'));var rp=require(_0x3c7a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var attributes=require('./intServicenowAccount.attributes');var integrations=require(_0x3c7a('0x8'));module[_0x3c7a('0x9')]=function(_0x2736c1,_0x48e820){return _0x2736c1[_0x3c7a('0xa')]('ServicenowAccount',attributes,{'tableName':_0x3c7a('0xb'),'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 656d87b..60b80f0 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 _0x9330=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','limit','include','map','model','attributes','ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x10afad,_0x30da9d){var _0x588d7e=function(_0x25e897){while(--_0x25e897){_0x10afad['push'](_0x10afad['shift']());}};_0x588d7e(++_0x30da9d);}(_0x9330,0x1a6));var _0x0933=function(_0x135a6e,_0x39fb2a){_0x135a6e=_0x135a6e-0x0;var _0x527bcf=_0x9330[_0x135a6e];return _0x527bcf;};'use strict';var _=require(_0x0933('0x0'));var util=require(_0x0933('0x1'));var moment=require('moment');var BPromise=require(_0x0933('0x2'));var rs=require(_0x0933('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0933('0x4'))['db'];var utils=require(_0x0933('0x5'));var logger=require(_0x0933('0x6'))(_0x0933('0x7'));var config=require('../../config/environment');var jayson=require(_0x0933('0x8'));var client=jayson[_0x0933('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x176eec,_0xe1c3a1,_0x43c8ae){return new BPromise(function(_0x2a0f72,_0x45369c){return client[_0x0933('0xa')](_0x176eec,_0x43c8ae)[_0x0933('0xb')](function(_0x12035c){logger[_0x0933('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0xe1c3a1,_0x0933('0xd'));logger[_0x0933('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xe1c3a1,'request\x20sent',JSON[_0x0933('0xf')](_0x12035c));if(_0x12035c[_0x0933('0x10')]){if(_0x12035c[_0x0933('0x10')]['code']===0x1f4){logger[_0x0933('0x10')](_0x0933('0x11'),_0xe1c3a1,_0x12035c[_0x0933('0x10')]['message']);return _0x45369c(_0x12035c['error'][_0x0933('0x12')]);}logger[_0x0933('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xe1c3a1,_0x12035c[_0x0933('0x10')][_0x0933('0x12')]);return _0x2a0f72(_0x12035c['error'][_0x0933('0x12')]);}else{logger[_0x0933('0xc')](_0x0933('0x11'),_0xe1c3a1,_0x0933('0xd'));_0x2a0f72(_0x12035c[_0x0933('0x13')][_0x0933('0x12')]);}})[_0x0933('0x14')](function(_0x4e3ec6){logger['error'](_0x0933('0x11'),_0xe1c3a1,_0x4e3ec6);_0x45369c(_0x4e3ec6);});});}exports[_0x0933('0x15')]=function(_0x11096e){var _0x1e58c9=this;return new Promise(function(_0xe60a67,_0x2ead78){return db[_0x0933('0x16')]['findAll']({'raw':_0x11096e['options']?_0x11096e[_0x0933('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x11096e[_0x0933('0x17')]?_0x11096e[_0x0933('0x17')][_0x0933('0x18')]||null:null,'attributes':_0x11096e['options']?_0x11096e['options']['attributes']||null:null,'limit':_0x11096e['options']?_0x11096e[_0x0933('0x17')][_0x0933('0x19')]||null:null,'include':_0x11096e[_0x0933('0x17')]?_0x11096e[_0x0933('0x17')][_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x11096e['options']['include'],function(_0x32a010){return{'model':db[_0x32a010[_0x0933('0x1c')]],'as':_0x32a010['as'],'attributes':_0x32a010[_0x0933('0x1d')],'include':_0x32a010[_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x32a010[_0x0933('0x1a')],function(_0x1c0025){return{'model':db[_0x1c0025[_0x0933('0x1c')]],'as':_0x1c0025['as'],'attributes':_0x1c0025[_0x0933('0x1d')],'include':_0x1c0025[_0x0933('0x1a')]?_['map'](_0x1c0025[_0x0933('0x1a')],function(_0x4783ab){return{'model':db[_0x4783ab[_0x0933('0x1c')]],'as':_0x4783ab['as'],'attributes':_0x4783ab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e7c70){logger[_0x0933('0xc')]('GetServicenowAccount',_0x11096e);logger[_0x0933('0xe')](_0x0933('0x15'),_0x11096e,JSON[_0x0933('0xf')](_0x2e7c70));_0xe60a67(_0x2e7c70);})[_0x0933('0x14')](function(_0x33acb5){logger[_0x0933('0x10')](_0x0933('0x15'),_0x33acb5[_0x0933('0x12')],_0x11096e);_0x2ead78(_0x1e58c9[_0x0933('0x10')](0x1f4,_0x33acb5[_0x0933('0x12')]));});});};exports[_0x0933('0x1e')]=function(_0x4d40f0){var _0x2226e0=this;return new Promise(function(_0x58f3d6,_0x2218a3){return db[_0x0933('0x16')][_0x0933('0x1f')]({'raw':_0x4d40f0[_0x0933('0x17')]?_0x4d40f0[_0x0933('0x17')][_0x0933('0x20')]===undefined?!![]:![]:!![],'where':_0x4d40f0['options']?_0x4d40f0[_0x0933('0x17')][_0x0933('0x18')]||null:null,'attributes':_0x4d40f0[_0x0933('0x17')]?_0x4d40f0[_0x0933('0x17')][_0x0933('0x1d')]||null:null,'include':_0x4d40f0[_0x0933('0x17')]?_0x4d40f0['options']['include']?_[_0x0933('0x1b')](_0x4d40f0[_0x0933('0x17')][_0x0933('0x1a')],function(_0x270cd1){return{'model':db[_0x270cd1['model']],'as':_0x270cd1['as'],'attributes':_0x270cd1[_0x0933('0x1d')],'include':_0x270cd1[_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x270cd1[_0x0933('0x1a')],function(_0x28903e){return{'model':db[_0x28903e[_0x0933('0x1c')]],'as':_0x28903e['as'],'attributes':_0x28903e[_0x0933('0x1d')],'include':_0x28903e[_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x28903e[_0x0933('0x1a')],function(_0x20e248){return{'model':db[_0x20e248[_0x0933('0x1c')]],'as':_0x20e248['as'],'attributes':_0x20e248[_0x0933('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0933('0xb')](function(_0x125b8c){logger[_0x0933('0xc')]('ShowServicenowAccount',_0x4d40f0);logger[_0x0933('0xe')]('ShowServicenowAccount',_0x4d40f0,JSON[_0x0933('0xf')](_0x125b8c));_0x58f3d6(_0x125b8c);})[_0x0933('0x14')](function(_0x4cc37c){logger[_0x0933('0x10')]('ShowServicenowAccount',_0x4cc37c[_0x0933('0x12')],_0x4d40f0);_0x2218a3(_0x2226e0[_0x0933('0x10')](0x1f4,_0x4cc37c[_0x0933('0x12')]));});});}; \ No newline at end of file +var _0xb7cc=['ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','map','include','model','then','debug'];(function(_0x12a029,_0x186b34){var _0x1b9402=function(_0x550949){while(--_0x550949){_0x12a029['push'](_0x12a029['shift']());}};_0x1b9402(++_0x186b34);}(_0xb7cc,0x6c));var _0xcb7c=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb7cc[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0xcb7c('0x0'));var util=require(_0xcb7c('0x1'));var moment=require('moment');var BPromise=require(_0xcb7c('0x2'));var rs=require(_0xcb7c('0x3'));var fs=require('fs');var Redis=require(_0xcb7c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcb7c('0x5'));var logger=require(_0xcb7c('0x6'))(_0xcb7c('0x7'));var config=require(_0xcb7c('0x8'));var jayson=require(_0xcb7c('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbda6e2,_0xcf2756,_0xe768d6){return new BPromise(function(_0x283c98,_0x1dbc9f){return client[_0xcb7c('0xa')](_0xbda6e2,_0xe768d6)['then'](function(_0x58522e){logger[_0xcb7c('0xb')](_0xcb7c('0xc'),_0xcf2756,'request\x20sent');logger['debug'](_0xcb7c('0xd'),_0xcf2756,_0xcb7c('0xe'),JSON[_0xcb7c('0xf')](_0x58522e));if(_0x58522e[_0xcb7c('0x10')]){if(_0x58522e['error'][_0xcb7c('0x11')]===0x1f4){logger[_0xcb7c('0x10')](_0xcb7c('0xc'),_0xcf2756,_0x58522e[_0xcb7c('0x10')][_0xcb7c('0x12')]);return _0x1dbc9f(_0x58522e[_0xcb7c('0x10')][_0xcb7c('0x12')]);}logger['error'](_0xcb7c('0xc'),_0xcf2756,_0x58522e['error'][_0xcb7c('0x12')]);return _0x283c98(_0x58522e['error']['message']);}else{logger[_0xcb7c('0xb')](_0xcb7c('0xc'),_0xcf2756,'request\x20sent');_0x283c98(_0x58522e['result'][_0xcb7c('0x12')]);}})[_0xcb7c('0x13')](function(_0x225c4a){logger[_0xcb7c('0x10')](_0xcb7c('0xc'),_0xcf2756,_0x225c4a);_0x1dbc9f(_0x225c4a);});});}exports[_0xcb7c('0x14')]=function(_0x2e7697){var _0x47365f=this;return new Promise(function(_0x143010,_0x3034ab){return db[_0xcb7c('0x15')][_0xcb7c('0x16')]({'raw':_0x2e7697[_0xcb7c('0x17')]?_0x2e7697['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e7697['options']?_0x2e7697[_0xcb7c('0x17')][_0xcb7c('0x18')]||null:null,'attributes':_0x2e7697['options']?_0x2e7697['options'][_0xcb7c('0x19')]||null:null,'limit':_0x2e7697['options']?_0x2e7697['options'][_0xcb7c('0x1a')]||null:null,'include':_0x2e7697[_0xcb7c('0x17')]?_0x2e7697[_0xcb7c('0x17')]['include']?_[_0xcb7c('0x1b')](_0x2e7697['options'][_0xcb7c('0x1c')],function(_0x52d53b){return{'model':db[_0x52d53b[_0xcb7c('0x1d')]],'as':_0x52d53b['as'],'attributes':_0x52d53b[_0xcb7c('0x19')],'include':_0x52d53b[_0xcb7c('0x1c')]?_['map'](_0x52d53b['include'],function(_0xfb8396){return{'model':db[_0xfb8396[_0xcb7c('0x1d')]],'as':_0xfb8396['as'],'attributes':_0xfb8396['attributes'],'include':_0xfb8396[_0xcb7c('0x1c')]?_[_0xcb7c('0x1b')](_0xfb8396[_0xcb7c('0x1c')],function(_0x17d500){return{'model':db[_0x17d500[_0xcb7c('0x1d')]],'as':_0x17d500['as'],'attributes':_0x17d500['attributes']};}):[]};}):[]};}):[]:[]})[_0xcb7c('0x1e')](function(_0x3e5bbb){logger[_0xcb7c('0xb')](_0xcb7c('0x14'),_0x2e7697);logger[_0xcb7c('0x1f')](_0xcb7c('0x14'),_0x2e7697,JSON['stringify'](_0x3e5bbb));_0x143010(_0x3e5bbb);})[_0xcb7c('0x13')](function(_0x4f88c0){logger[_0xcb7c('0x10')](_0xcb7c('0x14'),_0x4f88c0[_0xcb7c('0x12')],_0x2e7697);_0x3034ab(_0x47365f['error'](0x1f4,_0x4f88c0[_0xcb7c('0x12')]));});});};exports[_0xcb7c('0x20')]=function(_0x53012a){var _0x2abd30=this;return new Promise(function(_0x53a364,_0x14322a){return db[_0xcb7c('0x15')][_0xcb7c('0x21')]({'raw':_0x53012a[_0xcb7c('0x17')]?_0x53012a['options'][_0xcb7c('0x22')]===undefined?!![]:![]:!![],'where':_0x53012a['options']?_0x53012a[_0xcb7c('0x17')][_0xcb7c('0x18')]||null:null,'attributes':_0x53012a[_0xcb7c('0x17')]?_0x53012a[_0xcb7c('0x17')][_0xcb7c('0x19')]||null:null,'include':_0x53012a['options']?_0x53012a[_0xcb7c('0x17')][_0xcb7c('0x1c')]?_[_0xcb7c('0x1b')](_0x53012a[_0xcb7c('0x17')][_0xcb7c('0x1c')],function(_0x479f97){return{'model':db[_0x479f97['model']],'as':_0x479f97['as'],'attributes':_0x479f97[_0xcb7c('0x19')],'include':_0x479f97[_0xcb7c('0x1c')]?_['map'](_0x479f97[_0xcb7c('0x1c')],function(_0x4af440){return{'model':db[_0x4af440[_0xcb7c('0x1d')]],'as':_0x4af440['as'],'attributes':_0x4af440[_0xcb7c('0x19')],'include':_0x4af440[_0xcb7c('0x1c')]?_[_0xcb7c('0x1b')](_0x4af440[_0xcb7c('0x1c')],function(_0x3c0f6b){return{'model':db[_0x3c0f6b[_0xcb7c('0x1d')]],'as':_0x3c0f6b['as'],'attributes':_0x3c0f6b[_0xcb7c('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcb7c('0x1e')](function(_0xd19551){logger[_0xcb7c('0xb')](_0xcb7c('0x20'),_0x53012a);logger['debug']('ShowServicenowAccount',_0x53012a,JSON[_0xcb7c('0xf')](_0xd19551));_0x53a364(_0xd19551);})[_0xcb7c('0x13')](function(_0x42493d){logger['error'](_0xcb7c('0x20'),_0x42493d['message'],_0x53012a);_0x14322a(_0x2abd30[_0xcb7c('0x10')](0x1f4,_0x42493d[_0xcb7c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b4c7496..3cd7f35 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 _0x84f5=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create','update'];(function(_0x17a504,_0x42b47b){var _0xb6f356=function(_0x429b74){while(--_0x429b74){_0x17a504['push'](_0x17a504['shift']());}};_0xb6f356(++_0x42b47b);}(_0x84f5,0x145));var _0x584f=function(_0x1fdf56,_0x34f85d){_0x1fdf56=_0x1fdf56-0x0;var _0x34b422=_0x84f5[_0x1fdf56];return _0x34b422;};'use strict';var multer=require(_0x584f('0x0'));var util=require('util');var path=require(_0x584f('0x1'));var timeout=require(_0x584f('0x2'));var express=require(_0x584f('0x3'));var router=express[_0x584f('0x4')]();var auth=require(_0x584f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x584f('0x6'));var controller=require(_0x584f('0x7'));router[_0x584f('0x8')]('/',auth[_0x584f('0x9')](),controller['index']);router[_0x584f('0x8')](_0x584f('0xa'),auth[_0x584f('0x9')](),controller['show']);router[_0x584f('0x8')](_0x584f('0xb'),auth[_0x584f('0x9')](),controller['getFields']);router[_0x584f('0x8')](_0x584f('0xc'),auth[_0x584f('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x584f('0x9')](),controller[_0x584f('0xd')]);router[_0x584f('0xe')]('/',auth[_0x584f('0x9')](),controller[_0x584f('0xf')]);router['put'](_0x584f('0xa'),auth[_0x584f('0x9')](),controller[_0x584f('0x10')]);router['delete'](_0x584f('0xa'),auth[_0x584f('0x9')](),controller[_0x584f('0x11')]);module[_0x584f('0x12')]=router; \ No newline at end of file +var _0xf5bd=['create','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x50fbeb,_0x573573){var _0x5d6eba=function(_0x2db3eb){while(--_0x2db3eb){_0x50fbeb['push'](_0x50fbeb['shift']());}};_0x5d6eba(++_0x573573);}(_0xf5bd,0x1a5));var _0xdf5b=function(_0x577519,_0x346daf){_0x577519=_0x577519-0x0;var _0x5b12f7=_0xf5bd[_0x577519];return _0x5b12f7;};'use strict';var multer=require(_0xdf5b('0x0'));var util=require(_0xdf5b('0x1'));var path=require('path');var timeout=require(_0xdf5b('0x2'));var express=require(_0xdf5b('0x3'));var router=express[_0xdf5b('0x4')]();var auth=require(_0xdf5b('0x5'));var interaction=require(_0xdf5b('0x6'));var config=require(_0xdf5b('0x7'));var controller=require(_0xdf5b('0x8'));router[_0xdf5b('0x9')]('/',auth['isAuthenticated'](),controller[_0xdf5b('0xa')]);router[_0xdf5b('0x9')](_0xdf5b('0xb'),auth[_0xdf5b('0xc')](),controller[_0xdf5b('0xd')]);router[_0xdf5b('0x9')]('/:id/fields',auth[_0xdf5b('0xc')](),controller['getFields']);router['get'](_0xdf5b('0xe'),auth[_0xdf5b('0xc')](),controller[_0xdf5b('0xf')]);router[_0xdf5b('0x9')](_0xdf5b('0x10'),auth[_0xdf5b('0xc')](),controller[_0xdf5b('0x11')]);router[_0xdf5b('0x12')]('/',auth[_0xdf5b('0xc')](),controller[_0xdf5b('0x13')]);router['put']('/:id',auth[_0xdf5b('0xc')](),controller[_0xdf5b('0x14')]);router['delete'](_0xdf5b('0xb'),auth[_0xdf5b('0xc')](),controller[_0xdf5b('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 0e5288f..910aedb 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 _0x8cd0=['STRING','sequelize','exports'];(function(_0x43d36e,_0x588fb0){var _0x42a5ef=function(_0x2428f7){while(--_0x2428f7){_0x43d36e['push'](_0x43d36e['shift']());}};_0x42a5ef(++_0x588fb0);}(_0x8cd0,0xa0));var _0x08cd=function(_0x54be87,_0x5149ff){_0x54be87=_0x54be87-0x0;var _0x54d0d8=_0x8cd0[_0x54be87];return _0x54d0d8;};'use strict';var Sequelize=require(_0x08cd('0x0'));module[_0x08cd('0x1')]={'name':{'type':Sequelize[_0x08cd('0x2')]},'description':{'type':Sequelize[_0x08cd('0x2')]}}; \ No newline at end of file +var _0x6d66=['sequelize','STRING'];(function(_0x4eb42a,_0x2a3195){var _0x3c6492=function(_0x4a0676){while(--_0x4a0676){_0x4eb42a['push'](_0x4eb42a['shift']());}};_0x3c6492(++_0x2a3195);}(_0x6d66,0x178));var _0x66d6=function(_0x2fb136,_0x31d182){_0x2fb136=_0x2fb136-0x0;var _0x170aa0=_0x6d66[_0x2fb136];return _0x170aa0;};'use strict';var Sequelize=require(_0x66d6('0x0'));module['exports']={'name':{'type':Sequelize[_0x66d6('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 10a3206..416e426 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 _0x8902=['findAll','rows','show','params','keys','length','options','find','create','body','filter','getFields','ServicenowField','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','count','offset','set','apply','save','update','end','sendStatus','name','index','ServicenowConfiguration','rawAttributes','fieldName','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','includeAll','include'];(function(_0x10d1f0,_0x568dd5){var _0x364c91=function(_0x55671a){while(--_0x55671a){_0x10d1f0['push'](_0x10d1f0['shift']());}};_0x364c91(++_0x568dd5);}(_0x8902,0x1cd));var _0x2890=function(_0x2ddd23,_0x4aaf60){_0x2ddd23=_0x2ddd23-0x0;var _0x2ed115=_0x8902[_0x2ddd23];return _0x2ed115;};'use strict';var pdf=require(_0x2890('0x0'));var emlformat=require(_0x2890('0x1'));var rimraf=require(_0x2890('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2890('0x3'));var moment=require(_0x2890('0x4'));var BPromise=require(_0x2890('0x5'));var Mustache=require(_0x2890('0x6'));var util=require(_0x2890('0x7'));var path=require(_0x2890('0x8'));var sox=require(_0x2890('0x9'));var csv=require(_0x2890('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2890('0xb'));var squel=require(_0x2890('0xc'));var crypto=require(_0x2890('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2890('0xe'));var toCsv=require(_0x2890('0xa'));var querystring=require(_0x2890('0xf'));var Papa=require(_0x2890('0x10'));var Redis=require(_0x2890('0x11'));var authService=require(_0x2890('0x12'));var qs=require(_0x2890('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2890('0x14'));var logger=require(_0x2890('0x15'))(_0x2890('0x16'));var utils=require(_0x2890('0x17'));var config=require(_0x2890('0x18'));var db=require(_0x2890('0x19'))['db'];var jayson=require(_0x2890('0x1a'));var client=jayson[_0x2890('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x23abd2,_0x35d487,_0x366594){if(_0x366594){var _0x717acb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x717acb['test'](_0x35d487)){return _0x23abd2;}else{throw new db['Sequelize'][(_0x2890('0x1c'))](_0x2890('0x1d'));}}else{return _0x23abd2;}}function respondWithRpcPromise(_0x1102be,_0x4dd5b6,_0x4a6bc7,_0x4637c6){return new BPromise(function(_0x228fc7,_0x96cd1){var _0x51a6d6=_0x4637c6||client;return _0x51a6d6['request'](_0x1102be,_0x4a6bc7)[_0x2890('0x1e')](function(_0x1ebd64){logger[_0x2890('0x1f')](_0x2890('0x20'),_0x4dd5b6,_0x2890('0x21'));logger['debug'](_0x2890('0x22'),_0x4dd5b6,_0x2890('0x21'),JSON[_0x2890('0x23')](_0x1ebd64));if(_0x1ebd64['error']){if(_0x1ebd64[_0x2890('0x24')]['code']===0x1f4){logger[_0x2890('0x24')](_0x2890('0x20'),_0x4dd5b6,_0x1ebd64[_0x2890('0x24')]['message']);return _0x96cd1(_0x1ebd64[_0x2890('0x24')][_0x2890('0x25')]);}logger[_0x2890('0x24')](_0x2890('0x20'),_0x4dd5b6,_0x1ebd64[_0x2890('0x24')]['message']);return _0x228fc7(_0x1ebd64[_0x2890('0x24')][_0x2890('0x25')]);}else{logger['info'](_0x2890('0x20'),_0x4dd5b6,_0x2890('0x21'));_0x228fc7(_0x1ebd64['result'][_0x2890('0x25')]);}})[_0x2890('0x26')](function(_0x4cfc4a){logger[_0x2890('0x24')](_0x2890('0x20'),_0x4dd5b6,_0x4cfc4a);_0x96cd1(_0x4cfc4a);});});}function respondWithStatusCode(_0x1494d1,_0x37415c){_0x37415c=_0x37415c||0xcc;return function(_0xede96d){if(_0xede96d){return _0x1494d1['sendStatus'](_0x37415c);}return _0x1494d1[_0x2890('0x27')](_0x37415c)['end']();};}function respondWithResult(_0x1543f2,_0x10b7bc){_0x10b7bc=_0x10b7bc||0xc8;return function(_0x1576c2){if(_0x1576c2){return _0x1543f2[_0x2890('0x27')](_0x10b7bc)[_0x2890('0x28')](_0x1576c2);}};}function respondWithFilteredResult(_0x2395cd,_0xfa084){return function(_0x3d7c33){if(_0x3d7c33){var _0x40a89f=_0x3d7c33[_0x2890('0x29')],_0x1ed4a4=_0xfa084[_0x2890('0x2a')],_0x3f3507=_0xfa084[_0x2890('0x2a')]+_0xfa084['limit'],_0x2df94a;if(_0x3f3507>=_0x40a89f){_0x3f3507=_0x40a89f;_0x2df94a=0xc8;}else{_0x2df94a=0xce;}_0x2395cd['status'](_0x2df94a);return _0x2395cd[_0x2890('0x2b')]('Content-Range',_0x1ed4a4+'-'+_0x3f3507+'/'+_0x40a89f)[_0x2890('0x28')](_0x3d7c33);}return null;};}function patchUpdates(_0xafe12d){return function(_0x4189ec){try{jsonpatch[_0x2890('0x2c')](_0x4189ec,_0xafe12d,!![]);}catch(_0x188e01){return BPromise['reject'](_0x188e01);}return _0x4189ec[_0x2890('0x2d')]();};}function saveUpdates(_0x1548aa,_0x5a9e36){return function(_0x359247){if(_0x359247){return _0x359247[_0x2890('0x2e')](_0x1548aa)[_0x2890('0x1e')](function(_0x4fbd01){return _0x4fbd01;});}return null;};}function removeEntity(_0x47defe,_0x4f19ec){return function(_0x3e37cb){if(_0x3e37cb){return _0x3e37cb['destroy']()[_0x2890('0x1e')](function(){_0x47defe['status'](0xcc)[_0x2890('0x2f')]();});}};}function handleEntityNotFound(_0x3fc94a,_0x3a8bcb){return function(_0x40e23){if(!_0x40e23){_0x3fc94a[_0x2890('0x30')](0x194);}return _0x40e23;};}function handleError(_0x590e86,_0x427f5b){_0x427f5b=_0x427f5b||0x1f4;return function(_0x4b9c62){logger[_0x2890('0x24')](_0x4b9c62['stack']);if(_0x4b9c62[_0x2890('0x31')]){delete _0x4b9c62['name'];}_0x590e86[_0x2890('0x27')](_0x427f5b)['send'](_0x4b9c62);};}exports[_0x2890('0x32')]=function(_0x19cfc4,_0x16306e){var _0x4b18c9={},_0x4d35cb={},_0x427d54={'count':0x0,'rows':[]};var _0x3e4b58=_['map'](db[_0x2890('0x33')][_0x2890('0x34')],function(_0x48de99){return{'name':_0x48de99[_0x2890('0x35')],'type':_0x48de99['type'][_0x2890('0x36')]};});_0x4d35cb['model']=_[_0x2890('0x37')](_0x3e4b58,_0x2890('0x31'));_0x4d35cb[_0x2890('0x38')]=_['keys'](_0x19cfc4['query']);_0x4d35cb[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x4d35cb['model'],_0x4d35cb['query']);_0x4b18c9['attributes']=_[_0x2890('0x3a')](_0x4d35cb[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x19cfc4[_0x2890('0x38')][_0x2890('0x3c')]));_0x4b18c9[_0x2890('0x3d')]=_0x4b18c9[_0x2890('0x3d')]['length']?_0x4b18c9['attributes']:_0x4d35cb[_0x2890('0x3b')];if(!_0x19cfc4[_0x2890('0x38')][_0x2890('0x3e')](_0x2890('0x3f'))){_0x4b18c9[_0x2890('0x40')]=qs['limit'](_0x19cfc4[_0x2890('0x38')]['limit']);_0x4b18c9['offset']=qs[_0x2890('0x2a')](_0x19cfc4[_0x2890('0x38')][_0x2890('0x2a')]);}_0x4b18c9[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x19cfc4[_0x2890('0x38')][_0x2890('0x42')]);_0x4b18c9[_0x2890('0x43')]=qs['filters'](_[_0x2890('0x44')](_0x19cfc4[_0x2890('0x38')],_0x4d35cb['filters']));if(_0x19cfc4[_0x2890('0x38')]['filter']){_0x4b18c9[_0x2890('0x43')]=_[_0x2890('0x45')](_0x4b18c9[_0x2890('0x43')],{'$or':_['map'](_0x3e4b58,function(_0x4a07c3){if(_0x4a07c3['type']!==_0x2890('0x46')){var _0x388018={};_0x388018[_0x4a07c3['name']]={'$like':'%'+_0x19cfc4[_0x2890('0x38')]['filter']+'%'};return _0x388018;}})});}_0x4b18c9=_[_0x2890('0x45')]({},_0x4b18c9,_0x19cfc4['options']);var _0x5d7a0a={'where':_0x4b18c9['where']};return db[_0x2890('0x33')][_0x2890('0x29')](_0x5d7a0a)[_0x2890('0x1e')](function(_0x68832b){_0x427d54[_0x2890('0x29')]=_0x68832b;if(_0x19cfc4[_0x2890('0x38')][_0x2890('0x47')]){_0x4b18c9[_0x2890('0x48')]=[{'all':!![]}];}return db[_0x2890('0x33')][_0x2890('0x49')](_0x4b18c9);})[_0x2890('0x1e')](function(_0x578456){_0x427d54[_0x2890('0x4a')]=_0x578456;return _0x427d54;})[_0x2890('0x1e')](respondWithFilteredResult(_0x16306e,_0x4b18c9))[_0x2890('0x26')](handleError(_0x16306e,null));};exports[_0x2890('0x4b')]=function(_0x630517,_0x347f19){var _0x4a2830={'raw':![],'where':{'id':_0x630517[_0x2890('0x4c')]['id']}},_0x51f639={};_0x51f639['model']=_[_0x2890('0x4d')](db[_0x2890('0x33')][_0x2890('0x34')]);_0x51f639['query']=_[_0x2890('0x4d')](_0x630517[_0x2890('0x38')]);_0x51f639[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x51f639[_0x2890('0x3b')],_0x51f639[_0x2890('0x38')]);_0x4a2830[_0x2890('0x3d')]=_[_0x2890('0x3a')](_0x51f639[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x630517['query'][_0x2890('0x3c')]));_0x4a2830[_0x2890('0x3d')]=_0x4a2830[_0x2890('0x3d')][_0x2890('0x4e')]?_0x4a2830['attributes']:_0x51f639[_0x2890('0x3b')];if(_0x630517[_0x2890('0x38')][_0x2890('0x47')]){_0x4a2830[_0x2890('0x48')]=[{'all':!![]}];}_0x4a2830=_['merge']({},_0x4a2830,_0x630517[_0x2890('0x4f')]);return db[_0x2890('0x33')][_0x2890('0x50')](_0x4a2830)[_0x2890('0x1e')](handleEntityNotFound(_0x347f19,null))[_0x2890('0x1e')](respondWithResult(_0x347f19,null))[_0x2890('0x26')](handleError(_0x347f19,null));};exports[_0x2890('0x51')]=function(_0x32f6b4,_0xc01e04){return db[_0x2890('0x33')][_0x2890('0x51')](_0x32f6b4[_0x2890('0x52')],{})[_0x2890('0x1e')](respondWithResult(_0xc01e04,0xc9))[_0x2890('0x26')](handleError(_0xc01e04,null));};exports[_0x2890('0x2e')]=function(_0x9db230,_0x452deb){if(_0x9db230[_0x2890('0x52')]['id']){delete _0x9db230['body']['id'];}return db[_0x2890('0x33')]['find']({'where':{'id':_0x9db230['params']['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x452deb,null))[_0x2890('0x1e')](saveUpdates(_0x9db230[_0x2890('0x52')],null))[_0x2890('0x1e')](respondWithResult(_0x452deb,null))[_0x2890('0x26')](handleError(_0x452deb,null));};exports['destroy']=function(_0x18eba2,_0x5b8586){return db['ServicenowConfiguration'][_0x2890('0x50')]({'where':{'id':_0x18eba2[_0x2890('0x4c')]['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x5b8586,null))[_0x2890('0x1e')](removeEntity(_0x5b8586,null))[_0x2890('0x26')](handleError(_0x5b8586,null));};exports['getFields']=function(_0x2aabd1,_0x3a5151,_0x8951e8){var _0x3a2d39={};var _0xcd93de={};var _0x485d2f;var _0x12fe80;return db[_0x2890('0x33')]['findOne']({'where':{'id':_0x2aabd1[_0x2890('0x4c')]['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x3a5151,null))['then'](function(_0x2e9c71){if(_0x2e9c71){_0x485d2f=_0x2e9c71;_0xcd93de[_0x2890('0x3b')]=_[_0x2890('0x4d')](db['ServicenowField']['rawAttributes']);_0xcd93de[_0x2890('0x38')]=_[_0x2890('0x4d')](_0x2aabd1['query']);_0xcd93de[_0x2890('0x39')]=_[_0x2890('0x3a')](_0xcd93de[_0x2890('0x3b')],_0xcd93de['query']);_0x3a2d39['attributes']=_[_0x2890('0x3a')](_0xcd93de[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x2aabd1[_0x2890('0x38')][_0x2890('0x3c')]));_0x3a2d39[_0x2890('0x3d')]=_0x3a2d39[_0x2890('0x3d')][_0x2890('0x4e')]?_0x3a2d39[_0x2890('0x3d')]:_0xcd93de[_0x2890('0x3b')];_0x3a2d39[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x2aabd1[_0x2890('0x38')][_0x2890('0x42')]);_0x3a2d39[_0x2890('0x43')]=qs[_0x2890('0x39')](_[_0x2890('0x44')](_0x2aabd1[_0x2890('0x38')],_0xcd93de[_0x2890('0x39')]));if(_0x2aabd1[_0x2890('0x38')][_0x2890('0x53')]){_0x3a2d39[_0x2890('0x43')]=_[_0x2890('0x45')](_0x3a2d39['where'],{'$or':_['map'](_0x3a2d39[_0x2890('0x3d')],function(_0xce05c6){var _0x1867d6={};_0x1867d6[_0xce05c6]={'$like':'%'+_0x2aabd1[_0x2890('0x38')][_0x2890('0x53')]+'%'};return _0x1867d6;})});}_0x3a2d39=_[_0x2890('0x45')]({},_0x3a2d39,_0x2aabd1[_0x2890('0x4f')]);return _0x485d2f['getFields'](_0x3a2d39);}})['then'](function(_0x4eb072){if(_0x4eb072){_0x12fe80=_0x4eb072[_0x2890('0x4e')];if(!_0x2aabd1[_0x2890('0x38')][_0x2890('0x3e')](_0x2890('0x3f'))){_0x3a2d39[_0x2890('0x40')]=qs[_0x2890('0x40')](_0x2aabd1[_0x2890('0x38')]['limit']);_0x3a2d39['offset']=qs[_0x2890('0x2a')](_0x2aabd1[_0x2890('0x38')][_0x2890('0x2a')]);}return _0x485d2f[_0x2890('0x54')](_0x3a2d39);}})[_0x2890('0x1e')](function(_0x3d4f1f){if(_0x3d4f1f){return _0x3d4f1f?{'count':_0x12fe80,'rows':_0x3d4f1f}:null;}})['then'](respondWithResult(_0x3a5151,null))[_0x2890('0x26')](handleError(_0x3a5151,null));};exports['getSubjects']=function(_0x1b7d90,_0x1f16b7,_0x53b133){var _0x29e44a={};var _0x523c82={};var _0x4e72f6;var _0x4ca2b6;return db[_0x2890('0x33')]['findOne']({'where':{'id':_0x1b7d90[_0x2890('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1f16b7,null))[_0x2890('0x1e')](function(_0x143afe){if(_0x143afe){_0x4e72f6=_0x143afe;_0x523c82['model']=_[_0x2890('0x4d')](db[_0x2890('0x55')]['rawAttributes']);_0x523c82[_0x2890('0x38')]=_[_0x2890('0x4d')](_0x1b7d90[_0x2890('0x38')]);_0x523c82[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x523c82[_0x2890('0x3b')],_0x523c82[_0x2890('0x38')]);_0x29e44a['attributes']=_[_0x2890('0x3a')](_0x523c82[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x1b7d90[_0x2890('0x38')][_0x2890('0x3c')]));_0x29e44a[_0x2890('0x3d')]=_0x29e44a[_0x2890('0x3d')][_0x2890('0x4e')]?_0x29e44a['attributes']:_0x523c82[_0x2890('0x3b')];_0x29e44a[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x1b7d90[_0x2890('0x38')][_0x2890('0x42')]);_0x29e44a[_0x2890('0x43')]=qs[_0x2890('0x39')](_[_0x2890('0x44')](_0x1b7d90[_0x2890('0x38')],_0x523c82[_0x2890('0x39')]));if(_0x1b7d90['query'][_0x2890('0x53')]){_0x29e44a[_0x2890('0x43')]=_[_0x2890('0x45')](_0x29e44a[_0x2890('0x43')],{'$or':_[_0x2890('0x37')](_0x29e44a[_0x2890('0x3d')],function(_0x52ea93){var _0x2fe505={};_0x2fe505[_0x52ea93]={'$like':'%'+_0x1b7d90[_0x2890('0x38')][_0x2890('0x53')]+'%'};return _0x2fe505;})});}_0x29e44a=_[_0x2890('0x45')]({},_0x29e44a,_0x1b7d90['options']);return _0x4e72f6[_0x2890('0x56')](_0x29e44a);}})[_0x2890('0x1e')](function(_0x4d4a6e){if(_0x4d4a6e){_0x4ca2b6=_0x4d4a6e['length'];if(!_0x1b7d90[_0x2890('0x38')]['hasOwnProperty'](_0x2890('0x3f'))){_0x29e44a[_0x2890('0x40')]=qs[_0x2890('0x40')](_0x1b7d90[_0x2890('0x38')][_0x2890('0x40')]);_0x29e44a['offset']=qs[_0x2890('0x2a')](_0x1b7d90[_0x2890('0x38')]['offset']);}return _0x4e72f6[_0x2890('0x56')](_0x29e44a);}})['then'](function(_0x4a3967){if(_0x4a3967){return _0x4a3967?{'count':_0x4ca2b6,'rows':_0x4a3967}:null;}})[_0x2890('0x1e')](respondWithResult(_0x1f16b7,null))[_0x2890('0x26')](handleError(_0x1f16b7,null));};exports[_0x2890('0x57')]=function(_0x8df377,_0x2cb8ff,_0x49d267){var _0x23dcee={};var _0x37c00c={};var _0x391eb2;var _0x3ee053;return db[_0x2890('0x33')][_0x2890('0x58')]({'where':{'id':_0x8df377['params']['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x2cb8ff,null))[_0x2890('0x1e')](function(_0x4a7c92){if(_0x4a7c92){_0x391eb2=_0x4a7c92;_0x37c00c[_0x2890('0x3b')]=_[_0x2890('0x4d')](db['ServicenowField'][_0x2890('0x34')]);_0x37c00c[_0x2890('0x38')]=_[_0x2890('0x4d')](_0x8df377[_0x2890('0x38')]);_0x37c00c[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x37c00c[_0x2890('0x3b')],_0x37c00c[_0x2890('0x38')]);_0x23dcee['attributes']=_['intersection'](_0x37c00c[_0x2890('0x3b')],qs['fields'](_0x8df377[_0x2890('0x38')][_0x2890('0x3c')]));_0x23dcee[_0x2890('0x3d')]=_0x23dcee[_0x2890('0x3d')][_0x2890('0x4e')]?_0x23dcee[_0x2890('0x3d')]:_0x37c00c[_0x2890('0x3b')];_0x23dcee[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x8df377[_0x2890('0x38')][_0x2890('0x42')]);_0x23dcee[_0x2890('0x43')]=qs[_0x2890('0x39')](_[_0x2890('0x44')](_0x8df377['query'],_0x37c00c['filters']));if(_0x8df377[_0x2890('0x38')][_0x2890('0x53')]){_0x23dcee['where']=_['merge'](_0x23dcee[_0x2890('0x43')],{'$or':_['map'](_0x23dcee['attributes'],function(_0x44879b){var _0x3f2b1f={};_0x3f2b1f[_0x44879b]={'$like':'%'+_0x8df377[_0x2890('0x38')][_0x2890('0x53')]+'%'};return _0x3f2b1f;})});}_0x23dcee=_[_0x2890('0x45')]({},_0x23dcee,_0x8df377['options']);return _0x391eb2[_0x2890('0x57')](_0x23dcee);}})[_0x2890('0x1e')](function(_0x2529db){if(_0x2529db){_0x3ee053=_0x2529db[_0x2890('0x4e')];if(!_0x8df377[_0x2890('0x38')]['hasOwnProperty'](_0x2890('0x3f'))){_0x23dcee[_0x2890('0x40')]=qs['limit'](_0x8df377[_0x2890('0x38')][_0x2890('0x40')]);_0x23dcee[_0x2890('0x2a')]=qs['offset'](_0x8df377[_0x2890('0x38')]['offset']);}return _0x391eb2['getDescriptions'](_0x23dcee);}})['then'](function(_0x43a8ff){if(_0x43a8ff){return _0x43a8ff?{'count':_0x3ee053,'rows':_0x43a8ff}:null;}})[_0x2890('0x1e')](respondWithResult(_0x2cb8ff,null))['catch'](handleError(_0x2cb8ff,null));}; \ No newline at end of file +var _0xbe15=['util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','count','offset','limit','set','Content-Range','reject','save','update','stack','name','send','index','ServicenowConfiguration','fieldName','key','map','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','params','rawAttributes','find','create','body','destroy','getFields','findOne','ServicenowField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1d432d,_0x401149){var _0x338acb=function(_0x194623){while(--_0x194623){_0x1d432d['push'](_0x1d432d['shift']());}};_0x338acb(++_0x401149);}(_0xbe15,0x1c8));var _0x5be1=function(_0x104ad5,_0x51cace){_0x104ad5=_0x104ad5-0x0;var _0x50bd6f=_0xbe15[_0x104ad5];return _0x50bd6f;};'use strict';var pdf=require(_0x5be1('0x0'));var emlformat=require(_0x5be1('0x1'));var rimraf=require(_0x5be1('0x2'));var zipdir=require(_0x5be1('0x3'));var jsonpatch=require(_0x5be1('0x4'));var rp=require(_0x5be1('0x5'));var moment=require(_0x5be1('0x6'));var BPromise=require(_0x5be1('0x7'));var Mustache=require(_0x5be1('0x8'));var util=require(_0x5be1('0x9'));var path=require(_0x5be1('0xa'));var sox=require('sox');var csv=require(_0x5be1('0xb'));var ejs=require(_0x5be1('0xc'));var fs=require('fs');var _=require(_0x5be1('0xd'));var squel=require(_0x5be1('0xe'));var crypto=require(_0x5be1('0xf'));var jsforce=require(_0x5be1('0x10'));var deskjs=require(_0x5be1('0x11'));var toCsv=require(_0x5be1('0xb'));var querystring=require(_0x5be1('0x12'));var Papa=require(_0x5be1('0x13'));var Redis=require(_0x5be1('0x14'));var authService=require(_0x5be1('0x15'));var qs=require(_0x5be1('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5be1('0x17'));var logger=require('../../config/logger')(_0x5be1('0x18'));var utils=require(_0x5be1('0x19'));var config=require(_0x5be1('0x1a'));var db=require(_0x5be1('0x1b'))['db'];var jayson=require(_0x5be1('0x1c'));var client=jayson[_0x5be1('0x1d')]['http']({'port':0x232a});function checkPasswordPattern(_0x56240d,_0x5a7417,_0xb84969){if(_0xb84969){var _0x34d455=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34d455[_0x5be1('0x1e')](_0x5a7417)){return _0x56240d;}else{throw new db[(_0x5be1('0x1f'))][(_0x5be1('0x20'))](_0x5be1('0x21'));}}else{return _0x56240d;}}function respondWithRpcPromise(_0x1f3d30,_0x42d7b9,_0x49ae61,_0x5b97c9){return new BPromise(function(_0x2b0fbb,_0x2cb1bf){var _0x29e83a=_0x5b97c9||client;return _0x29e83a['request'](_0x1f3d30,_0x49ae61)[_0x5be1('0x22')](function(_0xe52106){logger['info'](_0x5be1('0x23'),_0x42d7b9,_0x5be1('0x24'));logger[_0x5be1('0x25')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x42d7b9,_0x5be1('0x24'),JSON['stringify'](_0xe52106));if(_0xe52106[_0x5be1('0x26')]){if(_0xe52106[_0x5be1('0x26')][_0x5be1('0x27')]===0x1f4){logger['error'](_0x5be1('0x23'),_0x42d7b9,_0xe52106['error'][_0x5be1('0x28')]);return _0x2cb1bf(_0xe52106[_0x5be1('0x26')][_0x5be1('0x28')]);}logger[_0x5be1('0x26')]('ServicenowConfiguration,\x20%s,\x20%s',_0x42d7b9,_0xe52106[_0x5be1('0x26')]['message']);return _0x2b0fbb(_0xe52106[_0x5be1('0x26')][_0x5be1('0x28')]);}else{logger['info'](_0x5be1('0x23'),_0x42d7b9,_0x5be1('0x24'));_0x2b0fbb(_0xe52106[_0x5be1('0x29')]['message']);}})[_0x5be1('0x2a')](function(_0x2b25eb){logger[_0x5be1('0x26')](_0x5be1('0x23'),_0x42d7b9,_0x2b25eb);_0x2cb1bf(_0x2b25eb);});});}function respondWithStatusCode(_0x4eaf5d,_0x501328){_0x501328=_0x501328||0xcc;return function(_0x48265c){if(_0x48265c){return _0x4eaf5d['sendStatus'](_0x501328);}return _0x4eaf5d[_0x5be1('0x2b')](_0x501328)[_0x5be1('0x2c')]();};}function respondWithResult(_0x11034d,_0x519ad4){_0x519ad4=_0x519ad4||0xc8;return function(_0x30951e){if(_0x30951e){return _0x11034d[_0x5be1('0x2b')](_0x519ad4)['json'](_0x30951e);}};}function respondWithFilteredResult(_0x4c2fb5,_0x2e5352){return function(_0x52adea){if(_0x52adea){var _0x46131e=_0x52adea[_0x5be1('0x2d')],_0x4227de=_0x2e5352[_0x5be1('0x2e')],_0x44073f=_0x2e5352[_0x5be1('0x2e')]+_0x2e5352[_0x5be1('0x2f')],_0x4cc48b;if(_0x44073f>=_0x46131e){_0x44073f=_0x46131e;_0x4cc48b=0xc8;}else{_0x4cc48b=0xce;}_0x4c2fb5[_0x5be1('0x2b')](_0x4cc48b);return _0x4c2fb5[_0x5be1('0x30')](_0x5be1('0x31'),_0x4227de+'-'+_0x44073f+'/'+_0x46131e)['json'](_0x52adea);}return null;};}function patchUpdates(_0x4724be){return function(_0x1d2c7a){try{jsonpatch['apply'](_0x1d2c7a,_0x4724be,!![]);}catch(_0x34d8ae){return BPromise[_0x5be1('0x32')](_0x34d8ae);}return _0x1d2c7a[_0x5be1('0x33')]();};}function saveUpdates(_0x1a8f73,_0x53c5a5){return function(_0x1e2708){if(_0x1e2708){return _0x1e2708[_0x5be1('0x34')](_0x1a8f73)[_0x5be1('0x22')](function(_0x31090e){return _0x31090e;});}return null;};}function removeEntity(_0x25e698,_0x491144){return function(_0x380798){if(_0x380798){return _0x380798['destroy']()[_0x5be1('0x22')](function(){_0x25e698[_0x5be1('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33edb0,_0x5ca0b8){return function(_0xdf361d){if(!_0xdf361d){_0x33edb0['sendStatus'](0x194);}return _0xdf361d;};}function handleError(_0x15cd41,_0x1e9a1a){_0x1e9a1a=_0x1e9a1a||0x1f4;return function(_0x2a62bc){logger['error'](_0x2a62bc[_0x5be1('0x35')]);if(_0x2a62bc[_0x5be1('0x36')]){delete _0x2a62bc[_0x5be1('0x36')];}_0x15cd41[_0x5be1('0x2b')](_0x1e9a1a)[_0x5be1('0x37')](_0x2a62bc);};}exports[_0x5be1('0x38')]=function(_0x23d0fa,_0xc8f18b){var _0x46a835={},_0x5e6cfd={},_0xd636c1={'count':0x0,'rows':[]};var _0x2d0e92=_['map'](db[_0x5be1('0x39')]['rawAttributes'],function(_0x1c2502){return{'name':_0x1c2502[_0x5be1('0x3a')],'type':_0x1c2502['type'][_0x5be1('0x3b')]};});_0x5e6cfd['model']=_[_0x5be1('0x3c')](_0x2d0e92,_0x5be1('0x36'));_0x5e6cfd[_0x5be1('0x3d')]=_[_0x5be1('0x3e')](_0x23d0fa[_0x5be1('0x3d')]);_0x5e6cfd[_0x5be1('0x3f')]=_[_0x5be1('0x40')](_0x5e6cfd['model'],_0x5e6cfd['query']);_0x46a835[_0x5be1('0x41')]=_[_0x5be1('0x40')](_0x5e6cfd['model'],qs['fields'](_0x23d0fa[_0x5be1('0x3d')][_0x5be1('0x42')]));_0x46a835[_0x5be1('0x41')]=_0x46a835['attributes'][_0x5be1('0x43')]?_0x46a835[_0x5be1('0x41')]:_0x5e6cfd[_0x5be1('0x44')];if(!_0x23d0fa[_0x5be1('0x3d')][_0x5be1('0x45')](_0x5be1('0x46'))){_0x46a835[_0x5be1('0x2f')]=qs[_0x5be1('0x2f')](_0x23d0fa[_0x5be1('0x3d')][_0x5be1('0x2f')]);_0x46a835[_0x5be1('0x2e')]=qs['offset'](_0x23d0fa[_0x5be1('0x3d')][_0x5be1('0x2e')]);}_0x46a835[_0x5be1('0x47')]=qs[_0x5be1('0x48')](_0x23d0fa['query'][_0x5be1('0x48')]);_0x46a835[_0x5be1('0x49')]=qs[_0x5be1('0x3f')](_[_0x5be1('0x4a')](_0x23d0fa[_0x5be1('0x3d')],_0x5e6cfd['filters']));if(_0x23d0fa[_0x5be1('0x3d')][_0x5be1('0x4b')]){_0x46a835[_0x5be1('0x49')]=_['merge'](_0x46a835[_0x5be1('0x49')],{'$or':_[_0x5be1('0x3c')](_0x2d0e92,function(_0x25fd91){if(_0x25fd91['type']!==_0x5be1('0x4c')){var _0x59d107={};_0x59d107[_0x25fd91[_0x5be1('0x36')]]={'$like':'%'+_0x23d0fa[_0x5be1('0x3d')][_0x5be1('0x4b')]+'%'};return _0x59d107;}})});}_0x46a835=_[_0x5be1('0x4d')]({},_0x46a835,_0x23d0fa[_0x5be1('0x4e')]);var _0x39dc42={'where':_0x46a835[_0x5be1('0x49')]};return db[_0x5be1('0x39')]['count'](_0x39dc42)[_0x5be1('0x22')](function(_0x4d335d){_0xd636c1[_0x5be1('0x2d')]=_0x4d335d;if(_0x23d0fa['query'][_0x5be1('0x4f')]){_0x46a835['include']=[{'all':!![]}];}return db[_0x5be1('0x39')][_0x5be1('0x50')](_0x46a835);})[_0x5be1('0x22')](function(_0x28cf10){_0xd636c1[_0x5be1('0x51')]=_0x28cf10;return _0xd636c1;})[_0x5be1('0x22')](respondWithFilteredResult(_0xc8f18b,_0x46a835))['catch'](handleError(_0xc8f18b,null));};exports['show']=function(_0x37347c,_0x44b8df){var _0x266a29={'raw':![],'where':{'id':_0x37347c[_0x5be1('0x52')]['id']}},_0x14d390={};_0x14d390[_0x5be1('0x44')]=_[_0x5be1('0x3e')](db[_0x5be1('0x39')][_0x5be1('0x53')]);_0x14d390[_0x5be1('0x3d')]=_['keys'](_0x37347c[_0x5be1('0x3d')]);_0x14d390[_0x5be1('0x3f')]=_[_0x5be1('0x40')](_0x14d390['model'],_0x14d390['query']);_0x266a29[_0x5be1('0x41')]=_[_0x5be1('0x40')](_0x14d390[_0x5be1('0x44')],qs[_0x5be1('0x42')](_0x37347c[_0x5be1('0x3d')][_0x5be1('0x42')]));_0x266a29[_0x5be1('0x41')]=_0x266a29[_0x5be1('0x41')][_0x5be1('0x43')]?_0x266a29[_0x5be1('0x41')]:_0x14d390[_0x5be1('0x44')];if(_0x37347c[_0x5be1('0x3d')][_0x5be1('0x4f')]){_0x266a29['include']=[{'all':!![]}];}_0x266a29=_[_0x5be1('0x4d')]({},_0x266a29,_0x37347c[_0x5be1('0x4e')]);return db[_0x5be1('0x39')][_0x5be1('0x54')](_0x266a29)[_0x5be1('0x22')](handleEntityNotFound(_0x44b8df,null))[_0x5be1('0x22')](respondWithResult(_0x44b8df,null))[_0x5be1('0x2a')](handleError(_0x44b8df,null));};exports['create']=function(_0x580df2,_0x8c969a){return db[_0x5be1('0x39')][_0x5be1('0x55')](_0x580df2['body'],{})[_0x5be1('0x22')](respondWithResult(_0x8c969a,0xc9))['catch'](handleError(_0x8c969a,null));};exports[_0x5be1('0x34')]=function(_0x207409,_0x7fdad2){if(_0x207409[_0x5be1('0x56')]['id']){delete _0x207409['body']['id'];}return db[_0x5be1('0x39')][_0x5be1('0x54')]({'where':{'id':_0x207409[_0x5be1('0x52')]['id']}})[_0x5be1('0x22')](handleEntityNotFound(_0x7fdad2,null))[_0x5be1('0x22')](saveUpdates(_0x207409['body'],null))['then'](respondWithResult(_0x7fdad2,null))['catch'](handleError(_0x7fdad2,null));};exports[_0x5be1('0x57')]=function(_0x5e400e,_0x15849e){return db[_0x5be1('0x39')][_0x5be1('0x54')]({'where':{'id':_0x5e400e[_0x5be1('0x52')]['id']}})[_0x5be1('0x22')](handleEntityNotFound(_0x15849e,null))[_0x5be1('0x22')](removeEntity(_0x15849e,null))[_0x5be1('0x2a')](handleError(_0x15849e,null));};exports[_0x5be1('0x58')]=function(_0x36af22,_0x25ea09,_0x222d59){var _0x391238={};var _0x10dc02={};var _0x4be0ee;var _0x25b6a1;return db['ServicenowConfiguration'][_0x5be1('0x59')]({'where':{'id':_0x36af22[_0x5be1('0x52')]['id']}})[_0x5be1('0x22')](handleEntityNotFound(_0x25ea09,null))[_0x5be1('0x22')](function(_0x4721d2){if(_0x4721d2){_0x4be0ee=_0x4721d2;_0x10dc02[_0x5be1('0x44')]=_[_0x5be1('0x3e')](db[_0x5be1('0x5a')]['rawAttributes']);_0x10dc02[_0x5be1('0x3d')]=_[_0x5be1('0x3e')](_0x36af22[_0x5be1('0x3d')]);_0x10dc02[_0x5be1('0x3f')]=_['intersection'](_0x10dc02[_0x5be1('0x44')],_0x10dc02[_0x5be1('0x3d')]);_0x391238['attributes']=_[_0x5be1('0x40')](_0x10dc02[_0x5be1('0x44')],qs[_0x5be1('0x42')](_0x36af22[_0x5be1('0x3d')]['fields']));_0x391238[_0x5be1('0x41')]=_0x391238['attributes'][_0x5be1('0x43')]?_0x391238[_0x5be1('0x41')]:_0x10dc02[_0x5be1('0x44')];_0x391238[_0x5be1('0x47')]=qs['sort'](_0x36af22['query'][_0x5be1('0x48')]);_0x391238[_0x5be1('0x49')]=qs['filters'](_[_0x5be1('0x4a')](_0x36af22['query'],_0x10dc02['filters']));if(_0x36af22['query'][_0x5be1('0x4b')]){_0x391238['where']=_[_0x5be1('0x4d')](_0x391238[_0x5be1('0x49')],{'$or':_[_0x5be1('0x3c')](_0x391238[_0x5be1('0x41')],function(_0x3d14e5){var _0x4bfe7a={};_0x4bfe7a[_0x3d14e5]={'$like':'%'+_0x36af22[_0x5be1('0x3d')][_0x5be1('0x4b')]+'%'};return _0x4bfe7a;})});}_0x391238=_[_0x5be1('0x4d')]({},_0x391238,_0x36af22['options']);return _0x4be0ee['getFields'](_0x391238);}})['then'](function(_0x3bfc1a){if(_0x3bfc1a){_0x25b6a1=_0x3bfc1a[_0x5be1('0x43')];if(!_0x36af22[_0x5be1('0x3d')][_0x5be1('0x45')](_0x5be1('0x46'))){_0x391238['limit']=qs[_0x5be1('0x2f')](_0x36af22['query']['limit']);_0x391238['offset']=qs['offset'](_0x36af22[_0x5be1('0x3d')]['offset']);}return _0x4be0ee['getFields'](_0x391238);}})[_0x5be1('0x22')](function(_0xa994e9){if(_0xa994e9){return _0xa994e9?{'count':_0x25b6a1,'rows':_0xa994e9}:null;}})[_0x5be1('0x22')](respondWithResult(_0x25ea09,null))[_0x5be1('0x2a')](handleError(_0x25ea09,null));};exports[_0x5be1('0x5b')]=function(_0x23f05b,_0x46945e,_0x57a7c2){var _0x1fd3f4={};var _0x3ffc8f={};var _0x2ba430;var _0x1c6380;return db['ServicenowConfiguration'][_0x5be1('0x59')]({'where':{'id':_0x23f05b[_0x5be1('0x52')]['id']}})[_0x5be1('0x22')](handleEntityNotFound(_0x46945e,null))[_0x5be1('0x22')](function(_0x3022fb){if(_0x3022fb){_0x2ba430=_0x3022fb;_0x3ffc8f[_0x5be1('0x44')]=_[_0x5be1('0x3e')](db[_0x5be1('0x5a')][_0x5be1('0x53')]);_0x3ffc8f[_0x5be1('0x3d')]=_[_0x5be1('0x3e')](_0x23f05b[_0x5be1('0x3d')]);_0x3ffc8f[_0x5be1('0x3f')]=_[_0x5be1('0x40')](_0x3ffc8f['model'],_0x3ffc8f[_0x5be1('0x3d')]);_0x1fd3f4[_0x5be1('0x41')]=_[_0x5be1('0x40')](_0x3ffc8f[_0x5be1('0x44')],qs[_0x5be1('0x42')](_0x23f05b[_0x5be1('0x3d')][_0x5be1('0x42')]));_0x1fd3f4['attributes']=_0x1fd3f4[_0x5be1('0x41')]['length']?_0x1fd3f4['attributes']:_0x3ffc8f[_0x5be1('0x44')];_0x1fd3f4[_0x5be1('0x47')]=qs['sort'](_0x23f05b['query'][_0x5be1('0x48')]);_0x1fd3f4['where']=qs[_0x5be1('0x3f')](_[_0x5be1('0x4a')](_0x23f05b[_0x5be1('0x3d')],_0x3ffc8f['filters']));if(_0x23f05b[_0x5be1('0x3d')][_0x5be1('0x4b')]){_0x1fd3f4[_0x5be1('0x49')]=_[_0x5be1('0x4d')](_0x1fd3f4[_0x5be1('0x49')],{'$or':_[_0x5be1('0x3c')](_0x1fd3f4['attributes'],function(_0x4f5c38){var _0x338cfe={};_0x338cfe[_0x4f5c38]={'$like':'%'+_0x23f05b[_0x5be1('0x3d')][_0x5be1('0x4b')]+'%'};return _0x338cfe;})});}_0x1fd3f4=_[_0x5be1('0x4d')]({},_0x1fd3f4,_0x23f05b[_0x5be1('0x4e')]);return _0x2ba430['getSubjects'](_0x1fd3f4);}})[_0x5be1('0x22')](function(_0x18f1c3){if(_0x18f1c3){_0x1c6380=_0x18f1c3[_0x5be1('0x43')];if(!_0x23f05b[_0x5be1('0x3d')]['hasOwnProperty']('nolimit')){_0x1fd3f4[_0x5be1('0x2f')]=qs['limit'](_0x23f05b[_0x5be1('0x3d')][_0x5be1('0x2f')]);_0x1fd3f4[_0x5be1('0x2e')]=qs[_0x5be1('0x2e')](_0x23f05b[_0x5be1('0x3d')][_0x5be1('0x2e')]);}return _0x2ba430['getSubjects'](_0x1fd3f4);}})[_0x5be1('0x22')](function(_0x37048e){if(_0x37048e){return _0x37048e?{'count':_0x1c6380,'rows':_0x37048e}:null;}})[_0x5be1('0x22')](respondWithResult(_0x46945e,null))[_0x5be1('0x2a')](handleError(_0x46945e,null));};exports['getDescriptions']=function(_0x3145b0,_0x55c52b,_0x29d499){var _0x84006d={};var _0x3374c1={};var _0x569223;var _0x44b9b3;return db[_0x5be1('0x39')]['findOne']({'where':{'id':_0x3145b0[_0x5be1('0x52')]['id']}})[_0x5be1('0x22')](handleEntityNotFound(_0x55c52b,null))[_0x5be1('0x22')](function(_0x50a419){if(_0x50a419){_0x569223=_0x50a419;_0x3374c1['model']=_['keys'](db[_0x5be1('0x5a')][_0x5be1('0x53')]);_0x3374c1[_0x5be1('0x3d')]=_['keys'](_0x3145b0[_0x5be1('0x3d')]);_0x3374c1[_0x5be1('0x3f')]=_[_0x5be1('0x40')](_0x3374c1['model'],_0x3374c1['query']);_0x84006d['attributes']=_['intersection'](_0x3374c1[_0x5be1('0x44')],qs['fields'](_0x3145b0[_0x5be1('0x3d')][_0x5be1('0x42')]));_0x84006d[_0x5be1('0x41')]=_0x84006d['attributes'][_0x5be1('0x43')]?_0x84006d[_0x5be1('0x41')]:_0x3374c1[_0x5be1('0x44')];_0x84006d[_0x5be1('0x47')]=qs[_0x5be1('0x48')](_0x3145b0[_0x5be1('0x3d')][_0x5be1('0x48')]);_0x84006d[_0x5be1('0x49')]=qs[_0x5be1('0x3f')](_[_0x5be1('0x4a')](_0x3145b0['query'],_0x3374c1['filters']));if(_0x3145b0[_0x5be1('0x3d')]['filter']){_0x84006d[_0x5be1('0x49')]=_[_0x5be1('0x4d')](_0x84006d['where'],{'$or':_[_0x5be1('0x3c')](_0x84006d[_0x5be1('0x41')],function(_0xf3967c){var _0x31d1a1={};_0x31d1a1[_0xf3967c]={'$like':'%'+_0x3145b0[_0x5be1('0x3d')][_0x5be1('0x4b')]+'%'};return _0x31d1a1;})});}_0x84006d=_['merge']({},_0x84006d,_0x3145b0[_0x5be1('0x4e')]);return _0x569223[_0x5be1('0x5c')](_0x84006d);}})['then'](function(_0x35705d){if(_0x35705d){_0x44b9b3=_0x35705d[_0x5be1('0x43')];if(!_0x3145b0['query'][_0x5be1('0x45')](_0x5be1('0x46'))){_0x84006d[_0x5be1('0x2f')]=qs[_0x5be1('0x2f')](_0x3145b0[_0x5be1('0x3d')][_0x5be1('0x2f')]);_0x84006d[_0x5be1('0x2e')]=qs['offset'](_0x3145b0[_0x5be1('0x3d')]['offset']);}return _0x569223['getDescriptions'](_0x84006d);}})['then'](function(_0xaa0c63){if(_0xaa0c63){return _0xaa0c63?{'count':_0x44b9b3,'rows':_0xaa0c63}:null;}})[_0x5be1('0x22')](respondWithResult(_0x55c52b,null))[_0x5be1('0x2a')](handleError(_0x55c52b,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 45c949e..bae1c44 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 _0xaa3d=['path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23a589,_0x1e6f1e){var _0x2d2325=function(_0x72f77e){while(--_0x72f77e){_0x23a589['push'](_0x23a589['shift']());}};_0x2d2325(++_0x1e6f1e);}(_0xaa3d,0x120));var _0xdaa3=function(_0x2aa6a0,_0xb7d41d){_0x2aa6a0=_0x2aa6a0-0x0;var _0x4f2ae9=_0xaa3d[_0x2aa6a0];return _0x4f2ae9;};'use strict';var _=require(_0xdaa3('0x0'));var util=require('util');var logger=require(_0xdaa3('0x1'))(_0xdaa3('0x2'));var moment=require(_0xdaa3('0x3'));var BPromise=require(_0xdaa3('0x4'));var rp=require(_0xdaa3('0x5'));var fs=require('fs');var path=require(_0xdaa3('0x6'));var rimraf=require(_0xdaa3('0x7'));var config=require(_0xdaa3('0x8'));var attributes=require(_0xdaa3('0x9'));module[_0xdaa3('0xa')]=function(_0x306ece,_0x1fd449){return _0x306ece[_0xdaa3('0xb')](_0xdaa3('0xc'),attributes,{'tableName':_0xdaa3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbfd3=['rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','../../config/logger','path'];(function(_0x4c4683,_0x241657){var _0x78ee7e=function(_0x4c9489){while(--_0x4c9489){_0x4c4683['push'](_0x4c4683['shift']());}};_0x78ee7e(++_0x241657);}(_0xbfd3,0x194));var _0x3bfd=function(_0x2a8456,_0x13a74b){_0x2a8456=_0x2a8456-0x0;var _0x3d5ce8=_0xbfd3[_0x2a8456];return _0x3d5ce8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3bfd('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bfd('0x1'));var rimraf=require(_0x3bfd('0x2'));var config=require(_0x3bfd('0x3'));var attributes=require(_0x3bfd('0x4'));module[_0x3bfd('0x5')]=function(_0x447450,_0x455cc0){return _0x447450[_0x3bfd('0x6')]('ServicenowConfiguration',attributes,{'tableName':'int_servicenow_configurations','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 d9bf831..5413b4f 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 _0x7159=['error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7159,0x108));var _0x9715=function(_0xd0cf92,_0x388002){_0xd0cf92=_0xd0cf92-0x0;var _0x14fe2=_0x7159[_0xd0cf92];return _0x14fe2;};'use strict';var _=require(_0x9715('0x0'));var util=require('util');var moment=require(_0x9715('0x1'));var BPromise=require(_0x9715('0x2'));var rs=require(_0x9715('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9715('0x4'))['db'];var utils=require(_0x9715('0x5'));var logger=require('../../config/logger')(_0x9715('0x6'));var config=require(_0x9715('0x7'));var jayson=require(_0x9715('0x8'));var client=jayson[_0x9715('0x9')][_0x9715('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x370829,_0x14c492,_0x28bdfc){return new BPromise(function(_0x4e4002,_0x44d943){return client[_0x9715('0xb')](_0x370829,_0x28bdfc)[_0x9715('0xc')](function(_0x201665){logger[_0x9715('0xd')](_0x9715('0xe'),_0x14c492,_0x9715('0xf'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x14c492,_0x9715('0xf'),JSON['stringify'](_0x201665));if(_0x201665[_0x9715('0x10')]){if(_0x201665[_0x9715('0x10')]['code']===0x1f4){logger[_0x9715('0x10')](_0x9715('0xe'),_0x14c492,_0x201665['error'][_0x9715('0x11')]);return _0x44d943(_0x201665['error'][_0x9715('0x11')]);}logger[_0x9715('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14c492,_0x201665[_0x9715('0x10')][_0x9715('0x11')]);return _0x4e4002(_0x201665[_0x9715('0x10')]['message']);}else{logger[_0x9715('0xd')](_0x9715('0xe'),_0x14c492,'request\x20sent');_0x4e4002(_0x201665[_0x9715('0x12')]['message']);}})[_0x9715('0x13')](function(_0xb99959){logger[_0x9715('0x10')](_0x9715('0xe'),_0x14c492,_0xb99959);_0x44d943(_0xb99959);});});} \ No newline at end of file +var _0xacec=['rpc','../../config/environment','jayson/promise','client','request','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','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x7c95e9,_0xe82f88){var _0x5c16e0=function(_0x144bdb){while(--_0x144bdb){_0x7c95e9['push'](_0x7c95e9['shift']());}};_0x5c16e0(++_0xe82f88);}(_0xacec,0x119));var _0xcace=function(_0x52ea08,_0x15d935){_0x52ea08=_0x52ea08-0x0;var _0x28d546=_0xacec[_0x52ea08];return _0x28d546;};'use strict';var _=require(_0xcace('0x0'));var util=require(_0xcace('0x1'));var moment=require(_0xcace('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcace('0x3'));var db=require(_0xcace('0x4'))['db'];var utils=require(_0xcace('0x5'));var logger=require(_0xcace('0x6'))(_0xcace('0x7'));var config=require(_0xcace('0x8'));var jayson=require(_0xcace('0x9'));var client=jayson[_0xcace('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x66c8d,_0x519f79,_0x2108fb){return new BPromise(function(_0x4b4ddf,_0x4e3f7f){return client[_0xcace('0xb')](_0x66c8d,_0x2108fb)[_0xcace('0xc')](function(_0x290e79){logger[_0xcace('0xd')](_0xcace('0xe'),_0x519f79,_0xcace('0xf'));logger[_0xcace('0x10')](_0xcace('0x11'),_0x519f79,_0xcace('0xf'),JSON[_0xcace('0x12')](_0x290e79));if(_0x290e79[_0xcace('0x13')]){if(_0x290e79['error'][_0xcace('0x14')]===0x1f4){logger[_0xcace('0x13')](_0xcace('0xe'),_0x519f79,_0x290e79[_0xcace('0x13')][_0xcace('0x15')]);return _0x4e3f7f(_0x290e79[_0xcace('0x13')][_0xcace('0x15')]);}logger[_0xcace('0x13')](_0xcace('0xe'),_0x519f79,_0x290e79[_0xcace('0x13')]['message']);return _0x4b4ddf(_0x290e79[_0xcace('0x13')][_0xcace('0x15')]);}else{logger[_0xcace('0xd')](_0xcace('0xe'),_0x519f79,_0xcace('0xf'));_0x4b4ddf(_0x290e79[_0xcace('0x16')][_0xcace('0x15')]);}})[_0xcace('0x17')](function(_0x426fe6){logger[_0xcace('0x13')](_0xcace('0xe'),_0x519f79,_0x426fe6);_0x4e3f7f(_0x426fe6);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 932dff7..8a3c4e5 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 _0x902b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','path'];(function(_0x4ceac2,_0x59fe4e){var _0x1e9753=function(_0x2550b7){while(--_0x2550b7){_0x4ceac2['push'](_0x4ceac2['shift']());}};_0x1e9753(++_0x59fe4e);}(_0x902b,0x10c));var _0xb902=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x902b[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require('multer');var util=require(_0xb902('0x0'));var path=require(_0xb902('0x1'));var timeout=require('connect-timeout');var express=require(_0xb902('0x2'));var router=express[_0xb902('0x3')]();var auth=require(_0xb902('0x4'));var interaction=require(_0xb902('0x5'));var config=require(_0xb902('0x6'));var controller=require('./intServicenowField.controller');router[_0xb902('0x7')]('/',auth[_0xb902('0x8')](),controller[_0xb902('0x9')]);router[_0xb902('0x7')](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0xb')]);router[_0xb902('0xc')]('/',auth[_0xb902('0x8')](),controller[_0xb902('0xd')]);router[_0xb902('0xe')](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0xf')]);router[_0xb902('0x10')](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe20a=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','post','isAuthenticated','create','put','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xe20a,0x19b));var _0xae20=function(_0x15f1c3,_0x18ec13){_0x15f1c3=_0x15f1c3-0x0;var _0x1f83b1=_0xe20a[_0x15f1c3];return _0x1f83b1;};'use strict';var multer=require(_0xae20('0x0'));var util=require(_0xae20('0x1'));var path=require('path');var timeout=require(_0xae20('0x2'));var express=require(_0xae20('0x3'));var router=express[_0xae20('0x4')]();var auth=require(_0xae20('0x5'));var interaction=require(_0xae20('0x6'));var config=require(_0xae20('0x7'));var controller=require('./intServicenowField.controller');router[_0xae20('0x8')]('/',auth['isAuthenticated'](),controller[_0xae20('0x9')]);router['get'](_0xae20('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xae20('0xb')]('/',auth[_0xae20('0xc')](),controller[_0xae20('0xd')]);router[_0xae20('0xe')]('/:id',auth[_0xae20('0xc')](),controller['update']);router[_0xae20('0xf')](_0xae20('0xa'),auth[_0xae20('0xc')](),controller[_0xae20('0x10')]);module[_0xae20('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 c31f89c..610c466 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 _0x066f=['variable','customVariable','string','STRING','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x066f,0x137));var _0xf066=function(_0x51777a,_0x130f01){_0x51777a=_0x51777a-0x0;var _0x2ad343=_0x066f[_0x51777a];return _0x2ad343;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf066('0x0')]('string',_0xf066('0x1'),_0xf066('0x2'),'keyValue'),'defaultValue':_0xf066('0x3')},'content':{'type':Sequelize[_0xf066('0x4')]},'key':{'type':Sequelize[_0xf066('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xf066('0x3'),_0xf066('0x1'),_0xf066('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf066('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf066('0x4')]}}; \ No newline at end of file +var _0x2a23=['ENUM','BOOLEAN','sequelize','exports','variable','customVariable','keyValue','string','STRING'];(function(_0x4ff7d6,_0x35fad1){var _0x8dd567=function(_0x3cc207){while(--_0x3cc207){_0x4ff7d6['push'](_0x4ff7d6['shift']());}};_0x8dd567(++_0x35fad1);}(_0x2a23,0x65));var _0x32a2=function(_0x2ef900,_0x4e0fc4){_0x2ef900=_0x2ef900-0x0;var _0x5c4fb3=_0x2a23[_0x2ef900];return _0x5c4fb3;};'use strict';var Sequelize=require(_0x32a2('0x0'));module[_0x32a2('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x32a2('0x2'),_0x32a2('0x3'),_0x32a2('0x4')),'defaultValue':_0x32a2('0x5')},'content':{'type':Sequelize[_0x32a2('0x6')]},'key':{'type':Sequelize[_0x32a2('0x6')]},'keyType':{'type':Sequelize[_0x32a2('0x7')]('string',_0x32a2('0x2'),_0x32a2('0x3'))},'keyContent':{'type':Sequelize[_0x32a2('0x6')]},'idField':{'type':Sequelize[_0x32a2('0x6')]},'nameField':{'type':Sequelize[_0x32a2('0x6')]},'customField':{'type':Sequelize[_0x32a2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x32a2('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index d34ca75..af7d5e3 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 _0x5e09=['Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','count','include','findAll','catch','show','params','keys','includeAll','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','offset','limit','set'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x5e09,0x1a0));var _0x95e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5e09[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x95e0('0x0'));var emlformat=require(_0x95e0('0x1'));var rimraf=require(_0x95e0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95e0('0x3'));var rp=require(_0x95e0('0x4'));var moment=require(_0x95e0('0x5'));var BPromise=require(_0x95e0('0x6'));var Mustache=require('mustache');var util=require(_0x95e0('0x7'));var path=require('path');var sox=require(_0x95e0('0x8'));var csv=require(_0x95e0('0x9'));var ejs=require(_0x95e0('0xa'));var fs=require('fs');var _=require(_0x95e0('0xb'));var squel=require(_0x95e0('0xc'));var crypto=require(_0x95e0('0xd'));var jsforce=require(_0x95e0('0xe'));var deskjs=require(_0x95e0('0xf'));var toCsv=require(_0x95e0('0x9'));var querystring=require(_0x95e0('0x10'));var Papa=require(_0x95e0('0x11'));var Redis=require('ioredis');var authService=require(_0x95e0('0x12'));var qs=require(_0x95e0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x95e0('0x14'))(_0x95e0('0x15'));var utils=require(_0x95e0('0x16'));var config=require(_0x95e0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363e8a,_0x205546){_0x205546=_0x205546||0xcc;return function(_0x493e92){if(_0x493e92){return _0x363e8a['sendStatus'](_0x205546);}return _0x363e8a[_0x95e0('0x18')](_0x205546)['end']();};}function respondWithResult(_0xb26edb,_0x56473f){_0x56473f=_0x56473f||0xc8;return function(_0x4256d0){if(_0x4256d0){return _0xb26edb[_0x95e0('0x18')](_0x56473f)['json'](_0x4256d0);}};}function respondWithFilteredResult(_0x5922dc,_0x567cc2){return function(_0x1c4e41){if(_0x1c4e41){var _0x579be2=_0x1c4e41['count'],_0x4406d9=_0x567cc2['offset'],_0xc6ef9b=_0x567cc2[_0x95e0('0x19')]+_0x567cc2[_0x95e0('0x1a')],_0x17da2f;if(_0xc6ef9b>=_0x579be2){_0xc6ef9b=_0x579be2;_0x17da2f=0xc8;}else{_0x17da2f=0xce;}_0x5922dc[_0x95e0('0x18')](_0x17da2f);return _0x5922dc[_0x95e0('0x1b')](_0x95e0('0x1c'),_0x4406d9+'-'+_0xc6ef9b+'/'+_0x579be2)[_0x95e0('0x1d')](_0x1c4e41);}return null;};}function patchUpdates(_0x4cb3ef){return function(_0x162a34){try{jsonpatch[_0x95e0('0x1e')](_0x162a34,_0x4cb3ef,!![]);}catch(_0x49ab22){return BPromise['reject'](_0x49ab22);}return _0x162a34[_0x95e0('0x1f')]();};}function saveUpdates(_0x407272,_0x5df89b){return function(_0x2c0020){if(_0x2c0020){return _0x2c0020[_0x95e0('0x20')](_0x407272)[_0x95e0('0x21')](function(_0x4f57ca){return _0x4f57ca;});}return null;};}function removeEntity(_0x5e3385,_0x2acb83){return function(_0x402ed6){if(_0x402ed6){return _0x402ed6[_0x95e0('0x22')]()[_0x95e0('0x21')](function(){_0x5e3385['status'](0xcc)[_0x95e0('0x23')]();});}};}function handleEntityNotFound(_0x189d0d,_0x269310){return function(_0x1f7947){if(!_0x1f7947){_0x189d0d['sendStatus'](0x194);}return _0x1f7947;};}function handleError(_0xd36598,_0x29946f){_0x29946f=_0x29946f||0x1f4;return function(_0x3b8326){logger[_0x95e0('0x24')](_0x3b8326[_0x95e0('0x25')]);if(_0x3b8326[_0x95e0('0x26')]){delete _0x3b8326[_0x95e0('0x26')];}_0xd36598[_0x95e0('0x18')](_0x29946f)[_0x95e0('0x27')](_0x3b8326);};}exports[_0x95e0('0x28')]=function(_0x23164b,_0x25dc9a){var _0x590806={},_0x5909f9={},_0x5d6c86={'count':0x0,'rows':[]};var _0x877e84=_['map'](db[_0x95e0('0x29')][_0x95e0('0x2a')],function(_0x449472){return{'name':_0x449472[_0x95e0('0x2b')],'type':_0x449472['type'][_0x95e0('0x2c')]};});_0x5909f9['model']=_['map'](_0x877e84,_0x95e0('0x26'));_0x5909f9[_0x95e0('0x2d')]=_['keys'](_0x23164b[_0x95e0('0x2d')]);_0x5909f9[_0x95e0('0x2e')]=_[_0x95e0('0x2f')](_0x5909f9['model'],_0x5909f9[_0x95e0('0x2d')]);_0x590806[_0x95e0('0x30')]=_[_0x95e0('0x2f')](_0x5909f9[_0x95e0('0x31')],qs[_0x95e0('0x32')](_0x23164b[_0x95e0('0x2d')][_0x95e0('0x32')]));_0x590806[_0x95e0('0x30')]=_0x590806['attributes'][_0x95e0('0x33')]?_0x590806[_0x95e0('0x30')]:_0x5909f9[_0x95e0('0x31')];if(!_0x23164b[_0x95e0('0x2d')]['hasOwnProperty'](_0x95e0('0x34'))){_0x590806[_0x95e0('0x1a')]=qs[_0x95e0('0x1a')](_0x23164b[_0x95e0('0x2d')][_0x95e0('0x1a')]);_0x590806[_0x95e0('0x19')]=qs[_0x95e0('0x19')](_0x23164b['query'][_0x95e0('0x19')]);}_0x590806[_0x95e0('0x35')]=qs[_0x95e0('0x36')](_0x23164b['query']['sort']);_0x590806[_0x95e0('0x37')]=qs[_0x95e0('0x2e')](_[_0x95e0('0x38')](_0x23164b['query'],_0x5909f9[_0x95e0('0x2e')]));if(_0x23164b[_0x95e0('0x2d')]['filter']){_0x590806[_0x95e0('0x37')]=_[_0x95e0('0x39')](_0x590806[_0x95e0('0x37')],{'$or':_[_0x95e0('0x3a')](_0x877e84,function(_0x4a7429){if(_0x4a7429[_0x95e0('0x3b')]!==_0x95e0('0x3c')){var _0x1810d6={};_0x1810d6[_0x4a7429[_0x95e0('0x26')]]={'$like':'%'+_0x23164b[_0x95e0('0x2d')][_0x95e0('0x3d')]+'%'};return _0x1810d6;}})});}_0x590806=_[_0x95e0('0x39')]({},_0x590806,_0x23164b[_0x95e0('0x3e')]);var _0x4e978b={'where':_0x590806[_0x95e0('0x37')]};return db[_0x95e0('0x29')][_0x95e0('0x3f')](_0x4e978b)[_0x95e0('0x21')](function(_0x5a52e7){_0x5d6c86[_0x95e0('0x3f')]=_0x5a52e7;if(_0x23164b[_0x95e0('0x2d')]['includeAll']){_0x590806[_0x95e0('0x40')]=[{'all':!![]}];}return db[_0x95e0('0x29')][_0x95e0('0x41')](_0x590806);})[_0x95e0('0x21')](function(_0x549919){_0x5d6c86['rows']=_0x549919;return _0x5d6c86;})[_0x95e0('0x21')](respondWithFilteredResult(_0x25dc9a,_0x590806))[_0x95e0('0x42')](handleError(_0x25dc9a,null));};exports[_0x95e0('0x43')]=function(_0x1be083,_0x56147e){var _0x379a4f={'raw':!![],'where':{'id':_0x1be083[_0x95e0('0x44')]['id']}},_0x16fb18={};_0x16fb18[_0x95e0('0x31')]=_['keys'](db[_0x95e0('0x29')][_0x95e0('0x2a')]);_0x16fb18[_0x95e0('0x2d')]=_[_0x95e0('0x45')](_0x1be083[_0x95e0('0x2d')]);_0x16fb18[_0x95e0('0x2e')]=_[_0x95e0('0x2f')](_0x16fb18['model'],_0x16fb18['query']);_0x379a4f['attributes']=_[_0x95e0('0x2f')](_0x16fb18[_0x95e0('0x31')],qs[_0x95e0('0x32')](_0x1be083['query'][_0x95e0('0x32')]));_0x379a4f[_0x95e0('0x30')]=_0x379a4f[_0x95e0('0x30')][_0x95e0('0x33')]?_0x379a4f[_0x95e0('0x30')]:_0x16fb18[_0x95e0('0x31')];if(_0x1be083['query'][_0x95e0('0x46')]){_0x379a4f[_0x95e0('0x40')]=[{'all':!![]}];}_0x379a4f=_['merge']({},_0x379a4f,_0x1be083[_0x95e0('0x3e')]);return db[_0x95e0('0x29')][_0x95e0('0x47')](_0x379a4f)[_0x95e0('0x21')](handleEntityNotFound(_0x56147e,null))[_0x95e0('0x21')](respondWithResult(_0x56147e,null))[_0x95e0('0x42')](handleError(_0x56147e,null));};exports['create']=function(_0x4380a0,_0x19e1c9){return db[_0x95e0('0x29')][_0x95e0('0x48')](_0x4380a0[_0x95e0('0x49')],{})['then'](respondWithResult(_0x19e1c9,0xc9))[_0x95e0('0x42')](handleError(_0x19e1c9,null));};exports[_0x95e0('0x20')]=function(_0x51052f,_0x16c340){if(_0x51052f[_0x95e0('0x49')]['id']){delete _0x51052f[_0x95e0('0x49')]['id'];}return db[_0x95e0('0x29')][_0x95e0('0x47')]({'where':{'id':_0x51052f[_0x95e0('0x44')]['id']}})['then'](handleEntityNotFound(_0x16c340,null))['then'](saveUpdates(_0x51052f[_0x95e0('0x49')],null))[_0x95e0('0x21')](respondWithResult(_0x16c340,null))[_0x95e0('0x42')](handleError(_0x16c340,null));};exports[_0x95e0('0x22')]=function(_0x5f5030,_0x1b7746){return db['ServicenowField'][_0x95e0('0x47')]({'where':{'id':_0x5f5030[_0x95e0('0x44')]['id']}})[_0x95e0('0x21')](handleEntityNotFound(_0x1b7746,null))[_0x95e0('0x21')](removeEntity(_0x1b7746,null))[_0x95e0('0x42')](handleError(_0x1b7746,null));}; \ No newline at end of file +var _0xf328=['mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','findAll','catch','show','params','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x1760fa,_0x1dd77a){var _0x4b9c15=function(_0x281b53){while(--_0x281b53){_0x1760fa['push'](_0x1760fa['shift']());}};_0x4b9c15(++_0x1dd77a);}(_0xf328,0x175));var _0x8f32=function(_0x3c0a14,_0x456cbc){_0x3c0a14=_0x3c0a14-0x0;var _0x486ce4=_0xf328[_0x3c0a14];return _0x486ce4;};'use strict';var pdf=require(_0x8f32('0x0'));var emlformat=require(_0x8f32('0x1'));var rimraf=require(_0x8f32('0x2'));var zipdir=require(_0x8f32('0x3'));var jsonpatch=require(_0x8f32('0x4'));var rp=require('request-promise');var moment=require(_0x8f32('0x5'));var BPromise=require(_0x8f32('0x6'));var Mustache=require(_0x8f32('0x7'));var util=require(_0x8f32('0x8'));var path=require(_0x8f32('0x9'));var sox=require(_0x8f32('0xa'));var csv=require('to-csv');var ejs=require(_0x8f32('0xb'));var fs=require('fs');var _=require(_0x8f32('0xc'));var squel=require('squel');var crypto=require(_0x8f32('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8f32('0xe'));var toCsv=require(_0x8f32('0xf'));var querystring=require(_0x8f32('0x10'));var Papa=require(_0x8f32('0x11'));var Redis=require(_0x8f32('0x12'));var authService=require(_0x8f32('0x13'));var qs=require(_0x8f32('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f32('0x15'))(_0x8f32('0x16'));var utils=require('../../config/utils');var config=require(_0x8f32('0x17'));var db=require(_0x8f32('0x18'))['db'];function respondWithStatusCode(_0x169cfc,_0x5f3bd5){_0x5f3bd5=_0x5f3bd5||0xcc;return function(_0x199398){if(_0x199398){return _0x169cfc['sendStatus'](_0x5f3bd5);}return _0x169cfc[_0x8f32('0x19')](_0x5f3bd5)[_0x8f32('0x1a')]();};}function respondWithResult(_0x51bd0a,_0x4da70b){_0x4da70b=_0x4da70b||0xc8;return function(_0x1ca7c2){if(_0x1ca7c2){return _0x51bd0a[_0x8f32('0x19')](_0x4da70b)['json'](_0x1ca7c2);}};}function respondWithFilteredResult(_0x5aa291,_0x36257d){return function(_0x569bd5){if(_0x569bd5){var _0x15f1f4=_0x569bd5['count'],_0x311ecb=_0x36257d['offset'],_0x31c6c6=_0x36257d[_0x8f32('0x1b')]+_0x36257d[_0x8f32('0x1c')],_0x2846f6;if(_0x31c6c6>=_0x15f1f4){_0x31c6c6=_0x15f1f4;_0x2846f6=0xc8;}else{_0x2846f6=0xce;}_0x5aa291[_0x8f32('0x19')](_0x2846f6);return _0x5aa291[_0x8f32('0x1d')](_0x8f32('0x1e'),_0x311ecb+'-'+_0x31c6c6+'/'+_0x15f1f4)[_0x8f32('0x1f')](_0x569bd5);}return null;};}function patchUpdates(_0x395887){return function(_0x29f59e){try{jsonpatch[_0x8f32('0x20')](_0x29f59e,_0x395887,!![]);}catch(_0x11e2f5){return BPromise[_0x8f32('0x21')](_0x11e2f5);}return _0x29f59e['save']();};}function saveUpdates(_0xdfffd6,_0x2cd800){return function(_0x315e5d){if(_0x315e5d){return _0x315e5d[_0x8f32('0x22')](_0xdfffd6)['then'](function(_0x439945){return _0x439945;});}return null;};}function removeEntity(_0x252488,_0x3c6430){return function(_0x272ffc){if(_0x272ffc){return _0x272ffc[_0x8f32('0x23')]()[_0x8f32('0x24')](function(){_0x252488[_0x8f32('0x19')](0xcc)[_0x8f32('0x1a')]();});}};}function handleEntityNotFound(_0x4a7299,_0x351a04){return function(_0x21d136){if(!_0x21d136){_0x4a7299[_0x8f32('0x25')](0x194);}return _0x21d136;};}function handleError(_0x299b7f,_0x1f3f4a){_0x1f3f4a=_0x1f3f4a||0x1f4;return function(_0x5f451b){logger[_0x8f32('0x26')](_0x5f451b[_0x8f32('0x27')]);if(_0x5f451b[_0x8f32('0x28')]){delete _0x5f451b[_0x8f32('0x28')];}_0x299b7f['status'](_0x1f3f4a)[_0x8f32('0x29')](_0x5f451b);};}exports[_0x8f32('0x2a')]=function(_0x265b03,_0x1694b7){var _0x1d9576={},_0x2ba55d={},_0x19597f={'count':0x0,'rows':[]};var _0x41dc61=_[_0x8f32('0x2b')](db[_0x8f32('0x2c')][_0x8f32('0x2d')],function(_0x4996b4){return{'name':_0x4996b4[_0x8f32('0x2e')],'type':_0x4996b4['type'][_0x8f32('0x2f')]};});_0x2ba55d[_0x8f32('0x30')]=_[_0x8f32('0x2b')](_0x41dc61,_0x8f32('0x28'));_0x2ba55d[_0x8f32('0x31')]=_[_0x8f32('0x32')](_0x265b03[_0x8f32('0x31')]);_0x2ba55d[_0x8f32('0x33')]=_['intersection'](_0x2ba55d[_0x8f32('0x30')],_0x2ba55d[_0x8f32('0x31')]);_0x1d9576[_0x8f32('0x34')]=_[_0x8f32('0x35')](_0x2ba55d[_0x8f32('0x30')],qs[_0x8f32('0x36')](_0x265b03[_0x8f32('0x31')][_0x8f32('0x36')]));_0x1d9576[_0x8f32('0x34')]=_0x1d9576[_0x8f32('0x34')][_0x8f32('0x37')]?_0x1d9576['attributes']:_0x2ba55d[_0x8f32('0x30')];if(!_0x265b03[_0x8f32('0x31')]['hasOwnProperty'](_0x8f32('0x38'))){_0x1d9576['limit']=qs['limit'](_0x265b03['query'][_0x8f32('0x1c')]);_0x1d9576[_0x8f32('0x1b')]=qs[_0x8f32('0x1b')](_0x265b03[_0x8f32('0x31')][_0x8f32('0x1b')]);}_0x1d9576[_0x8f32('0x39')]=qs[_0x8f32('0x3a')](_0x265b03[_0x8f32('0x31')][_0x8f32('0x3a')]);_0x1d9576[_0x8f32('0x3b')]=qs['filters'](_[_0x8f32('0x3c')](_0x265b03[_0x8f32('0x31')],_0x2ba55d[_0x8f32('0x33')]));if(_0x265b03[_0x8f32('0x31')]['filter']){_0x1d9576['where']=_[_0x8f32('0x3d')](_0x1d9576[_0x8f32('0x3b')],{'$or':_[_0x8f32('0x2b')](_0x41dc61,function(_0x5ba09c){if(_0x5ba09c[_0x8f32('0x3e')]!==_0x8f32('0x3f')){var _0xb9ecac={};_0xb9ecac[_0x5ba09c[_0x8f32('0x28')]]={'$like':'%'+_0x265b03[_0x8f32('0x31')][_0x8f32('0x40')]+'%'};return _0xb9ecac;}})});}_0x1d9576=_['merge']({},_0x1d9576,_0x265b03[_0x8f32('0x41')]);var _0x1fdd96={'where':_0x1d9576['where']};return db[_0x8f32('0x2c')][_0x8f32('0x42')](_0x1fdd96)['then'](function(_0x318e8f){_0x19597f[_0x8f32('0x42')]=_0x318e8f;if(_0x265b03[_0x8f32('0x31')][_0x8f32('0x43')]){_0x1d9576['include']=[{'all':!![]}];}return db[_0x8f32('0x2c')][_0x8f32('0x44')](_0x1d9576);})[_0x8f32('0x24')](function(_0x180bd7){_0x19597f['rows']=_0x180bd7;return _0x19597f;})[_0x8f32('0x24')](respondWithFilteredResult(_0x1694b7,_0x1d9576))[_0x8f32('0x45')](handleError(_0x1694b7,null));};exports[_0x8f32('0x46')]=function(_0x103114,_0x48b077){var _0x8cedde={'raw':!![],'where':{'id':_0x103114[_0x8f32('0x47')]['id']}},_0x1e375a={};_0x1e375a[_0x8f32('0x30')]=_[_0x8f32('0x32')](db['ServicenowField']['rawAttributes']);_0x1e375a[_0x8f32('0x31')]=_[_0x8f32('0x32')](_0x103114['query']);_0x1e375a['filters']=_[_0x8f32('0x35')](_0x1e375a[_0x8f32('0x30')],_0x1e375a[_0x8f32('0x31')]);_0x8cedde[_0x8f32('0x34')]=_[_0x8f32('0x35')](_0x1e375a['model'],qs[_0x8f32('0x36')](_0x103114[_0x8f32('0x31')][_0x8f32('0x36')]));_0x8cedde[_0x8f32('0x34')]=_0x8cedde[_0x8f32('0x34')][_0x8f32('0x37')]?_0x8cedde['attributes']:_0x1e375a['model'];if(_0x103114['query']['includeAll']){_0x8cedde[_0x8f32('0x48')]=[{'all':!![]}];}_0x8cedde=_[_0x8f32('0x3d')]({},_0x8cedde,_0x103114[_0x8f32('0x41')]);return db[_0x8f32('0x2c')][_0x8f32('0x49')](_0x8cedde)[_0x8f32('0x24')](handleEntityNotFound(_0x48b077,null))[_0x8f32('0x24')](respondWithResult(_0x48b077,null))['catch'](handleError(_0x48b077,null));};exports[_0x8f32('0x4a')]=function(_0x32746c,_0x3eb6d9){return db[_0x8f32('0x2c')][_0x8f32('0x4a')](_0x32746c[_0x8f32('0x4b')],{})['then'](respondWithResult(_0x3eb6d9,0xc9))[_0x8f32('0x45')](handleError(_0x3eb6d9,null));};exports[_0x8f32('0x22')]=function(_0x5525be,_0x33c835){if(_0x5525be[_0x8f32('0x4b')]['id']){delete _0x5525be[_0x8f32('0x4b')]['id'];}return db['ServicenowField'][_0x8f32('0x49')]({'where':{'id':_0x5525be[_0x8f32('0x47')]['id']}})[_0x8f32('0x24')](handleEntityNotFound(_0x33c835,null))[_0x8f32('0x24')](saveUpdates(_0x5525be[_0x8f32('0x4b')],null))[_0x8f32('0x24')](respondWithResult(_0x33c835,null))[_0x8f32('0x45')](handleError(_0x33c835,null));};exports[_0x8f32('0x23')]=function(_0x4e3817,_0x1b1c23){return db['ServicenowField']['find']({'where':{'id':_0x4e3817['params']['id']}})[_0x8f32('0x24')](handleEntityNotFound(_0x1b1c23,null))[_0x8f32('0x24')](removeEntity(_0x1b1c23,null))[_0x8f32('0x45')](handleError(_0x1b1c23,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 37545d1..b031b9e 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 _0xc0a2=['FieldId','../../config/logger','moment','bluebird','path','rimraf','exports','ServicenowField','servicenow_unique_index'];(function(_0x5ce53f,_0x266868){var _0x37c9ea=function(_0x54b479){while(--_0x54b479){_0x5ce53f['push'](_0x5ce53f['shift']());}};_0x37c9ea(++_0x266868);}(_0xc0a2,0xbe));var _0x2c0a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc0a2[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c0a('0x0'))('api');var moment=require(_0x2c0a('0x1'));var BPromise=require(_0x2c0a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c0a('0x3'));var rimraf=require(_0x2c0a('0x4'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x2c0a('0x5')]=function(_0x3bf55d,_0x58920f){return _0x3bf55d['define'](_0x2c0a('0x6'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2c0a('0x7'),'fields':['idField',_0x2c0a('0x8')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd147=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','path'];(function(_0x20ae18,_0x562b61){var _0x3d82a6=function(_0x308295){while(--_0x308295){_0x20ae18['push'](_0x20ae18['shift']());}};_0x3d82a6(++_0x562b61);}(_0xd147,0x117));var _0x7d14=function(_0x31ab80,_0x3f6b1c){_0x31ab80=_0x31ab80-0x0;var _0x7f80f2=_0xd147[_0x31ab80];return _0x7f80f2;};'use strict';var _=require(_0x7d14('0x0'));var util=require(_0x7d14('0x1'));var logger=require(_0x7d14('0x2'))(_0x7d14('0x3'));var moment=require(_0x7d14('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d14('0x5'));var rimraf=require(_0x7d14('0x6'));var config=require(_0x7d14('0x7'));var attributes=require(_0x7d14('0x8'));module[_0x7d14('0x9')]=function(_0xcd5b9e,_0x4b9095){return _0xcd5b9e['define'](_0x7d14('0xa'),attributes,{'tableName':_0x7d14('0xb'),'paranoid':![],'indexes':[{'name':_0x7d14('0xc'),'fields':[_0x7d14('0xd'),_0x7d14('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index c1cad11..62fe201 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 _0xb6c4=['then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3a0113,_0x13a058){var _0xab2e92=function(_0x239d27){while(--_0x239d27){_0x3a0113['push'](_0x3a0113['shift']());}};_0xab2e92(++_0x13a058);}(_0xb6c4,0x16a));var _0x4b6c=function(_0x4b53b8,_0x53c6dc){_0x4b53b8=_0x4b53b8-0x0;var _0x531d13=_0xb6c4[_0x4b53b8];return _0x531d13;};'use strict';var _=require(_0x4b6c('0x0'));var util=require(_0x4b6c('0x1'));var moment=require('moment');var BPromise=require(_0x4b6c('0x2'));var rs=require(_0x4b6c('0x3'));var fs=require('fs');var Redis=require(_0x4b6c('0x4'));var db=require(_0x4b6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b6c('0x6'))(_0x4b6c('0x7'));var config=require(_0x4b6c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b6c('0x9')][_0x4b6c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x408229,_0xaf1433,_0x5945fb){return new BPromise(function(_0x46f61f,_0x14a594){return client[_0x4b6c('0xb')](_0x408229,_0x5945fb)[_0x4b6c('0xc')](function(_0x40aa75){logger['info'](_0x4b6c('0xd'),_0xaf1433,_0x4b6c('0xe'));logger[_0x4b6c('0xf')](_0x4b6c('0x10'),_0xaf1433,'request\x20sent',JSON[_0x4b6c('0x11')](_0x40aa75));if(_0x40aa75[_0x4b6c('0x12')]){if(_0x40aa75['error'][_0x4b6c('0x13')]===0x1f4){logger['error'](_0x4b6c('0xd'),_0xaf1433,_0x40aa75[_0x4b6c('0x12')][_0x4b6c('0x14')]);return _0x14a594(_0x40aa75[_0x4b6c('0x12')][_0x4b6c('0x14')]);}logger[_0x4b6c('0x12')]('ServicenowField,\x20%s,\x20%s',_0xaf1433,_0x40aa75[_0x4b6c('0x12')][_0x4b6c('0x14')]);return _0x46f61f(_0x40aa75[_0x4b6c('0x12')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0xaf1433,_0x4b6c('0xe'));_0x46f61f(_0x40aa75['result'][_0x4b6c('0x14')]);}})[_0x4b6c('0x15')](function(_0x59581e){logger[_0x4b6c('0x12')](_0x4b6c('0xd'),_0xaf1433,_0x59581e);_0x14a594(_0x59581e);});});} \ No newline at end of file +var _0xe202=['rpc','client','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xe202,0x162));var _0x2e20=function(_0x5975f1,_0x17fde8){_0x5975f1=_0x5975f1-0x0;var _0x3eed9f=_0xe202[_0x5975f1];return _0x3eed9f;};'use strict';var _=require(_0x2e20('0x0'));var util=require(_0x2e20('0x1'));var moment=require(_0x2e20('0x2'));var BPromise=require(_0x2e20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e20('0x4'));var db=require(_0x2e20('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2e20('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2e20('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8162,_0x5bbcfa,_0x15a6a0){return new BPromise(function(_0x52aa73,_0x2954c6){return client['request'](_0x5a8162,_0x15a6a0)[_0x2e20('0x8')](function(_0x4af762){logger[_0x2e20('0x9')](_0x2e20('0xa'),_0x5bbcfa,_0x2e20('0xb'));logger[_0x2e20('0xc')]('ServicenowField,\x20%s,\x20%s,\x20%s',_0x5bbcfa,_0x2e20('0xb'),JSON[_0x2e20('0xd')](_0x4af762));if(_0x4af762['error']){if(_0x4af762['error'][_0x2e20('0xe')]===0x1f4){logger[_0x2e20('0xf')](_0x2e20('0xa'),_0x5bbcfa,_0x4af762['error'][_0x2e20('0x10')]);return _0x2954c6(_0x4af762[_0x2e20('0xf')][_0x2e20('0x10')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x5bbcfa,_0x4af762['error']['message']);return _0x52aa73(_0x4af762[_0x2e20('0xf')][_0x2e20('0x10')]);}else{logger[_0x2e20('0x9')](_0x2e20('0xa'),_0x5bbcfa,_0x2e20('0xb'));_0x52aa73(_0x4af762[_0x2e20('0x11')][_0x2e20('0x10')]);}})['catch'](function(_0x3d49a7){logger[_0x2e20('0xf')]('ServicenowField,\x20%s,\x20%s',_0x5bbcfa,_0x3d49a7);_0x2954c6(_0x3d49a7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 3b25aff..6b9fee6 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 _0x41ce=['express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xa87963,_0x125c48){var _0x82b017=function(_0x584791){while(--_0x584791){_0xa87963['push'](_0xa87963['shift']());}};_0x82b017(++_0x125c48);}(_0x41ce,0x1c8));var _0xe41c=function(_0x47ab7a,_0xbb63b7){_0x47ab7a=_0x47ab7a-0x0;var _0xa9e225=_0x41ce[_0x47ab7a];return _0xa9e225;};'use strict';var multer=require(_0xe41c('0x0'));var util=require(_0xe41c('0x1'));var path=require(_0xe41c('0x2'));var timeout=require(_0xe41c('0x3'));var express=require(_0xe41c('0x4'));var router=express[_0xe41c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe41c('0x6'));var config=require(_0xe41c('0x7'));var controller=require(_0xe41c('0x8'));router[_0xe41c('0x9')]('/',auth[_0xe41c('0xa')](),controller[_0xe41c('0xb')]);router[_0xe41c('0x9')](_0xe41c('0xc'),auth[_0xe41c('0xa')](),controller[_0xe41c('0xd')]);router[_0xe41c('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe41c('0xe')]);router[_0xe41c('0x9')]('/:id/fields',auth[_0xe41c('0xa')](),controller[_0xe41c('0xf')]);router[_0xe41c('0x10')]('/',auth['isAuthenticated'](),controller[_0xe41c('0x11')]);router[_0xe41c('0x10')](_0xe41c('0x12'),auth[_0xe41c('0xa')](),controller[_0xe41c('0x13')]);router['put'](_0xe41c('0xc'),auth[_0xe41c('0xa')](),controller[_0xe41c('0x14')]);router[_0xe41c('0x15')](_0xe41c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe41c('0x16')]=router; \ No newline at end of file +var _0x68e6=['update','destroy','exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','addConfiguration'];(function(_0x3c1fb7,_0xfb9007){var _0x427bbf=function(_0x3e1fa1){while(--_0x3e1fa1){_0x3c1fb7['push'](_0x3c1fb7['shift']());}};_0x427bbf(++_0xfb9007);}(_0x68e6,0xe0));var _0x668e=function(_0x3a6761,_0x36093){_0x3a6761=_0x3a6761-0x0;var _0x37f75c=_0x68e6[_0x3a6761];return _0x37f75c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x668e('0x0'));var express=require(_0x668e('0x1'));var router=express['Router']();var auth=require(_0x668e('0x2'));var interaction=require(_0x668e('0x3'));var config=require('../../config/environment');var controller=require(_0x668e('0x4'));router[_0x668e('0x5')]('/',auth[_0x668e('0x6')](),controller[_0x668e('0x7')]);router[_0x668e('0x5')](_0x668e('0x8'),auth['isAuthenticated'](),controller[_0x668e('0x9')]);router['get']('/:id/configurations',auth[_0x668e('0x6')](),controller['getConfigurations']);router['get'](_0x668e('0xa'),auth['isAuthenticated'](),controller[_0x668e('0xb')]);router['post']('/',auth[_0x668e('0x6')](),controller['create']);router[_0x668e('0xc')]('/:id/configurations',auth[_0x668e('0x6')](),controller[_0x668e('0xd')]);router['put']('/:id',auth[_0x668e('0x6')](),controller[_0x668e('0xe')]);router['delete'](_0x668e('0x8'),auth[_0x668e('0x6')](),controller[_0x668e('0xf')]);module[_0x668e('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index baee019..7eff891 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 _0x16a7=['sequelize','exports','STRING'];(function(_0x5a793d,_0x1abcf7){var _0x5159ce=function(_0x1c1412){while(--_0x1c1412){_0x5a793d['push'](_0x5a793d['shift']());}};_0x5159ce(++_0x1abcf7);}(_0x16a7,0xa5));var _0x716a=function(_0x503ff6,_0x41fff8){_0x503ff6=_0x503ff6-0x0;var _0x1b0d67=_0x16a7[_0x503ff6];return _0x1b0d67;};'use strict';var Sequelize=require(_0x716a('0x0'));module[_0x716a('0x1')]={'name':{'type':Sequelize[_0x716a('0x2')]},'description':{'type':Sequelize[_0x716a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x716a('0x2')]},'remoteUri':{'type':Sequelize[_0x716a('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x716a('0x2')]}}; \ No newline at end of file +var _0x99a3=['exports','STRING','username','sequelize'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x99a3,0x14b));var _0x399a=function(_0x139df0,_0x3ac378){_0x139df0=_0x139df0-0x0;var _0x5e3f4e=_0x99a3[_0x139df0];return _0x5e3f4e;};'use strict';var Sequelize=require(_0x399a('0x0'));module[_0x399a('0x1')]={'name':{'type':Sequelize[_0x399a('0x2')]},'description':{'type':Sequelize[_0x399a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x399a('0x3')},'password':{'type':Sequelize[_0x399a('0x2')]},'remoteUri':{'type':Sequelize[_0x399a('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x399a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index d904f60..1e565e6 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 _0xda7d=['remoteUri','POST','format','%s%s','login','JSON','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','module_fields','remove','endsWith','values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','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','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','json','count','limit','set','Content-Range','reject','update','then','end','name','status','index','SugarcrmAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','params','intersection','create','body','find','destroy','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','getFields','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password'];(function(_0x131351,_0x38d78e){var _0x54bf76=function(_0x3f683e){while(--_0x3f683e){_0x131351['push'](_0x131351['shift']());}};_0x54bf76(++_0x38d78e);}(_0xda7d,0x10a));var _0xdda7=function(_0x470d59,_0x2d6c72){_0x470d59=_0x470d59-0x0;var _0x48d24b=_0xda7d[_0x470d59];return _0x48d24b;};'use strict';var pdf=require(_0xdda7('0x0'));var emlformat=require(_0xdda7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdda7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdda7('0x3'));var moment=require('moment');var BPromise=require(_0xdda7('0x4'));var Mustache=require(_0xdda7('0x5'));var util=require(_0xdda7('0x6'));var path=require(_0xdda7('0x7'));var sox=require('sox');var csv=require(_0xdda7('0x8'));var ejs=require(_0xdda7('0x9'));var fs=require('fs');var _=require(_0xdda7('0xa'));var squel=require(_0xdda7('0xb'));var crypto=require(_0xdda7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdda7('0xd'));var toCsv=require(_0xdda7('0x8'));var querystring=require(_0xdda7('0xe'));var Papa=require(_0xdda7('0xf'));var Redis=require(_0xdda7('0x10'));var authService=require(_0xdda7('0x11'));var qs=require(_0xdda7('0x12'));var as=require(_0xdda7('0x13'));var hardwareService=require(_0xdda7('0x14'));var logger=require(_0xdda7('0x15'))(_0xdda7('0x16'));var utils=require(_0xdda7('0x17'));var config=require(_0xdda7('0x18'));var db=require(_0xdda7('0x19'))['db'];var integrations=require(_0xdda7('0x1a'));var jayson=require(_0xdda7('0x1b'));var client=jayson[_0xdda7('0x1c')][_0xdda7('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x44075f,_0x2350c8,_0xd40316){if(_0xd40316){var _0x692b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x692b5['test'](_0x2350c8)){return _0x44075f;}else{throw new db[(_0xdda7('0x1e'))][(_0xdda7('0x1f'))](_0xdda7('0x20'));}}else{return _0x44075f;}}function respondWithRpcPromise(_0x272707,_0x5609f7,_0x4136ea,_0x5e0dc2){return new BPromise(function(_0x7661ff,_0x5a722f){var _0x20e1e5=_0x5e0dc2||client;return _0x20e1e5['request'](_0x272707,_0x4136ea)['then'](function(_0x13dfef){logger['info'](_0xdda7('0x21'),_0x5609f7,_0xdda7('0x22'));logger[_0xdda7('0x23')](_0xdda7('0x24'),_0x5609f7,'request\x20sent',JSON[_0xdda7('0x25')](_0x13dfef));if(_0x13dfef[_0xdda7('0x26')]){if(_0x13dfef[_0xdda7('0x26')]['code']===0x1f4){logger[_0xdda7('0x26')](_0xdda7('0x21'),_0x5609f7,_0x13dfef[_0xdda7('0x26')][_0xdda7('0x27')]);return _0x5a722f(_0x13dfef['error']['message']);}logger['error'](_0xdda7('0x21'),_0x5609f7,_0x13dfef[_0xdda7('0x26')]['message']);return _0x7661ff(_0x13dfef[_0xdda7('0x26')][_0xdda7('0x27')]);}else{logger[_0xdda7('0x28')]('SugarcrmAccount,\x20%s,\x20%s',_0x5609f7,'request\x20sent');_0x7661ff(_0x13dfef[_0xdda7('0x29')]['message']);}})[_0xdda7('0x2a')](function(_0x9cb546){logger[_0xdda7('0x26')](_0xdda7('0x21'),_0x5609f7,_0x9cb546);_0x5a722f(_0x9cb546);});});}function respondWithStatusCode(_0x37ad4b,_0x1f968e){_0x1f968e=_0x1f968e||0xcc;return function(_0x14f080){if(_0x14f080){return _0x37ad4b[_0xdda7('0x2b')](_0x1f968e);}return _0x37ad4b['status'](_0x1f968e)['end']();};}function respondWithResult(_0x1f7327,_0x35f7b2){_0x35f7b2=_0x35f7b2||0xc8;return function(_0x272636){if(_0x272636){return _0x1f7327['status'](_0x35f7b2)[_0xdda7('0x2c')](_0x272636);}};}function respondWithFilteredResult(_0x58ab07,_0x5552f0){return function(_0xec35dd){if(_0xec35dd){var _0x2b84e6=_0xec35dd[_0xdda7('0x2d')],_0x5e61f5=_0x5552f0['offset'],_0x409e95=_0x5552f0['offset']+_0x5552f0[_0xdda7('0x2e')],_0x49fb8a;if(_0x409e95>=_0x2b84e6){_0x409e95=_0x2b84e6;_0x49fb8a=0xc8;}else{_0x49fb8a=0xce;}_0x58ab07['status'](_0x49fb8a);return _0x58ab07[_0xdda7('0x2f')](_0xdda7('0x30'),_0x5e61f5+'-'+_0x409e95+'/'+_0x2b84e6)[_0xdda7('0x2c')](_0xec35dd);}return null;};}function patchUpdates(_0xc74761){return function(_0x65b815){try{jsonpatch['apply'](_0x65b815,_0xc74761,!![]);}catch(_0x4c39e9){return BPromise[_0xdda7('0x31')](_0x4c39e9);}return _0x65b815['save']();};}function saveUpdates(_0x39b0c9,_0xdfe53d){return function(_0x103675){if(_0x103675){return _0x103675[_0xdda7('0x32')](_0x39b0c9)['then'](function(_0x5515b4){return _0x5515b4;});}return null;};}function removeEntity(_0xf56284,_0x577304){return function(_0x26450a){if(_0x26450a){return _0x26450a['destroy']()[_0xdda7('0x33')](function(){_0xf56284['status'](0xcc)[_0xdda7('0x34')]();});}};}function handleEntityNotFound(_0x5d6de1,_0x1670aa){return function(_0x5da77f){if(!_0x5da77f){_0x5d6de1[_0xdda7('0x2b')](0x194);}return _0x5da77f;};}function handleError(_0x5c97ad,_0x4faf8b){_0x4faf8b=_0x4faf8b||0x1f4;return function(_0x42f523){logger[_0xdda7('0x26')](_0x42f523['stack']);if(_0x42f523[_0xdda7('0x35')]){delete _0x42f523[_0xdda7('0x35')];}_0x5c97ad[_0xdda7('0x36')](_0x4faf8b)['send'](_0x42f523);};}exports[_0xdda7('0x37')]=function(_0x16cc88,_0x438a85){var _0x368e84={},_0x1581f0={},_0x1111dc={'count':0x0,'rows':[]};var _0x1a89ca=_['map'](db[_0xdda7('0x38')][_0xdda7('0x39')],function(_0x5a9b86){return{'name':_0x5a9b86[_0xdda7('0x3a')],'type':_0x5a9b86[_0xdda7('0x3b')][_0xdda7('0x3c')]};});_0x1581f0['model']=_[_0xdda7('0x3d')](_0x1a89ca,'name');_0x1581f0[_0xdda7('0x3e')]=_[_0xdda7('0x3f')](_0x16cc88[_0xdda7('0x3e')]);_0x1581f0[_0xdda7('0x40')]=_['intersection'](_0x1581f0[_0xdda7('0x41')],_0x1581f0['query']);_0x368e84[_0xdda7('0x42')]=_['intersection'](_0x1581f0[_0xdda7('0x41')],qs[_0xdda7('0x43')](_0x16cc88[_0xdda7('0x3e')][_0xdda7('0x43')]));_0x368e84['attributes']=_0x368e84['attributes'][_0xdda7('0x44')]?_0x368e84[_0xdda7('0x42')]:_0x1581f0[_0xdda7('0x41')];if(!_0x16cc88['query']['hasOwnProperty'](_0xdda7('0x45'))){_0x368e84[_0xdda7('0x2e')]=qs['limit'](_0x16cc88['query']['limit']);_0x368e84[_0xdda7('0x46')]=qs[_0xdda7('0x46')](_0x16cc88[_0xdda7('0x3e')]['offset']);}_0x368e84[_0xdda7('0x47')]=qs[_0xdda7('0x48')](_0x16cc88[_0xdda7('0x3e')][_0xdda7('0x48')]);_0x368e84[_0xdda7('0x49')]=qs['filters'](_[_0xdda7('0x4a')](_0x16cc88[_0xdda7('0x3e')],_0x1581f0['filters']));if(_0x16cc88['query']['filter']){_0x368e84['where']=_[_0xdda7('0x4b')](_0x368e84[_0xdda7('0x49')],{'$or':_[_0xdda7('0x3d')](_0x1a89ca,function(_0x387e22){if(_0x387e22['type']!==_0xdda7('0x4c')){var _0x16aad6={};_0x16aad6[_0x387e22['name']]={'$like':'%'+_0x16cc88[_0xdda7('0x3e')][_0xdda7('0x4d')]+'%'};return _0x16aad6;}})});}_0x368e84=_['merge']({},_0x368e84,_0x16cc88[_0xdda7('0x4e')]);var _0x41676f={'where':_0x368e84[_0xdda7('0x49')]};return db['SugarcrmAccount']['count'](_0x41676f)['then'](function(_0xb7ee3b){_0x1111dc[_0xdda7('0x2d')]=_0xb7ee3b;if(_0x16cc88['query']['includeAll']){_0x368e84[_0xdda7('0x4f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xdda7('0x50')](_0x368e84);})[_0xdda7('0x33')](function(_0x372cf4){_0x1111dc['rows']=_0x372cf4;return _0x1111dc;})[_0xdda7('0x33')](respondWithFilteredResult(_0x438a85,_0x368e84))['catch'](handleError(_0x438a85,null));};exports['show']=function(_0x24b8e4,_0x499417){var _0x1a0bb1={'raw':![],'where':{'id':_0x24b8e4[_0xdda7('0x51')]['id']}},_0x513091={};_0x513091['model']=_[_0xdda7('0x3f')](db[_0xdda7('0x38')][_0xdda7('0x39')]);_0x513091[_0xdda7('0x3e')]=_['keys'](_0x24b8e4[_0xdda7('0x3e')]);_0x513091[_0xdda7('0x40')]=_[_0xdda7('0x52')](_0x513091[_0xdda7('0x41')],_0x513091['query']);_0x1a0bb1['attributes']=_[_0xdda7('0x52')](_0x513091[_0xdda7('0x41')],qs[_0xdda7('0x43')](_0x24b8e4[_0xdda7('0x3e')][_0xdda7('0x43')]));_0x1a0bb1[_0xdda7('0x42')]=_0x1a0bb1[_0xdda7('0x42')][_0xdda7('0x44')]?_0x1a0bb1[_0xdda7('0x42')]:_0x513091[_0xdda7('0x41')];if(_0x24b8e4[_0xdda7('0x3e')]['includeAll']){_0x1a0bb1[_0xdda7('0x4f')]=[{'all':!![]}];}_0x1a0bb1=_['merge']({},_0x1a0bb1,_0x24b8e4['options']);return db['SugarcrmAccount']['find'](_0x1a0bb1)[_0xdda7('0x33')](handleEntityNotFound(_0x499417,null))[_0xdda7('0x33')](respondWithResult(_0x499417,null))[_0xdda7('0x2a')](handleError(_0x499417,null));};exports[_0xdda7('0x53')]=function(_0x2cff5e,_0x318b93){return db[_0xdda7('0x38')]['create'](_0x2cff5e[_0xdda7('0x54')],{})[_0xdda7('0x33')](respondWithResult(_0x318b93,0xc9))[_0xdda7('0x2a')](handleError(_0x318b93,null));};exports[_0xdda7('0x32')]=function(_0x874276,_0x2d9be7){if(_0x874276[_0xdda7('0x54')]['id']){delete _0x874276['body']['id'];}return db[_0xdda7('0x38')][_0xdda7('0x55')]({'where':{'id':_0x874276[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x2d9be7,null))['then'](saveUpdates(_0x874276[_0xdda7('0x54')],null))[_0xdda7('0x33')](respondWithResult(_0x2d9be7,null))[_0xdda7('0x2a')](handleError(_0x2d9be7,null));};exports[_0xdda7('0x56')]=function(_0x4743f9,_0x3c19d3){return db[_0xdda7('0x38')]['find']({'where':{'id':_0x4743f9[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x3c19d3,null))[_0xdda7('0x33')](removeEntity(_0x3c19d3,null))[_0xdda7('0x2a')](handleError(_0x3c19d3,null));};exports[_0xdda7('0x57')]=function(_0x55401a,_0x359176,_0x496b08){var _0x29c2b3={};var _0x53fb5b={};var _0x442292;var _0x5448ff;return db[_0xdda7('0x38')][_0xdda7('0x58')]({'where':{'id':_0x55401a[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x359176,null))[_0xdda7('0x33')](function(_0x6ad44e){if(_0x6ad44e){_0x442292=_0x6ad44e;_0x53fb5b[_0xdda7('0x41')]=_[_0xdda7('0x3f')](db['SugarcrmConfiguration']['rawAttributes']);_0x53fb5b[_0xdda7('0x3e')]=_['keys'](_0x55401a[_0xdda7('0x3e')]);_0x53fb5b[_0xdda7('0x40')]=_[_0xdda7('0x52')](_0x53fb5b['model'],_0x53fb5b['query']);_0x29c2b3[_0xdda7('0x42')]=_['intersection'](_0x53fb5b[_0xdda7('0x41')],qs[_0xdda7('0x43')](_0x55401a[_0xdda7('0x3e')][_0xdda7('0x43')]));_0x29c2b3[_0xdda7('0x42')]=_0x29c2b3[_0xdda7('0x42')]['length']?_0x29c2b3[_0xdda7('0x42')]:_0x53fb5b['model'];_0x29c2b3[_0xdda7('0x47')]=qs[_0xdda7('0x48')](_0x55401a[_0xdda7('0x3e')]['sort']);_0x29c2b3['where']=qs['filters'](_[_0xdda7('0x4a')](_0x55401a[_0xdda7('0x3e')],_0x53fb5b[_0xdda7('0x40')]));if(_0x55401a[_0xdda7('0x3e')][_0xdda7('0x4d')]){_0x29c2b3[_0xdda7('0x49')]=_[_0xdda7('0x4b')](_0x29c2b3['where'],{'$or':_[_0xdda7('0x3d')](_0x29c2b3[_0xdda7('0x42')],function(_0x46cad6){var _0x4bca17={};_0x4bca17[_0x46cad6]={'$like':'%'+_0x55401a[_0xdda7('0x3e')]['filter']+'%'};return _0x4bca17;})});}_0x29c2b3=_[_0xdda7('0x4b')]({},_0x29c2b3,_0x55401a[_0xdda7('0x4e')]);return _0x442292[_0xdda7('0x57')](_0x29c2b3);}})[_0xdda7('0x33')](function(_0x1dc5f9){if(_0x1dc5f9){_0x5448ff=_0x1dc5f9[_0xdda7('0x44')];if(!_0x55401a[_0xdda7('0x3e')]['hasOwnProperty'](_0xdda7('0x45'))){_0x29c2b3[_0xdda7('0x2e')]=qs[_0xdda7('0x2e')](_0x55401a['query'][_0xdda7('0x2e')]);_0x29c2b3[_0xdda7('0x46')]=qs[_0xdda7('0x46')](_0x55401a['query'][_0xdda7('0x46')]);}return _0x442292[_0xdda7('0x57')](_0x29c2b3);}})[_0xdda7('0x33')](function(_0x20a7de){if(_0x20a7de){return _0x20a7de?{'count':_0x5448ff,'rows':_0x20a7de}:null;}})[_0xdda7('0x33')](respondWithResult(_0x359176,null))[_0xdda7('0x2a')](handleError(_0x359176,null));};exports[_0xdda7('0x59')]=function(_0x3658a7,_0x53b2e3,_0x234d50){if(_0x3658a7[_0xdda7('0x54')]['id']){delete _0x3658a7[_0xdda7('0x54')]['id'];}return db[_0xdda7('0x38')][_0xdda7('0x58')]({'where':{'id':_0x3658a7[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x53b2e3,null))['then'](function(_0xc145eb){if(_0xc145eb){_0x3658a7['body'][_0xdda7('0x5a')]=_0xc145eb['id'];_0x3658a7[_0xdda7('0x54')][_0xdda7('0x5b')]=integrations[_0xdda7('0x5c')](_0x3658a7[_0xdda7('0x54')][_0xdda7('0x5d')],_0x3658a7[_0xdda7('0x54')][_0xdda7('0x3b')]);_0x3658a7[_0xdda7('0x54')][_0xdda7('0x5e')]=integrations[_0xdda7('0x5f')](_0x3658a7[_0xdda7('0x54')]['channel'],_0x3658a7['body'][_0xdda7('0x3b')]);return db[_0xdda7('0x60')][_0xdda7('0x53')](_0x3658a7['body'],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xdda7('0x5e')}]});}return null;})[_0xdda7('0x33')](respondWithResult(_0x53b2e3,null))[_0xdda7('0x2a')](handleError(_0x53b2e3,null));};exports[_0xdda7('0x61')]=function(_0x3ae322,_0x2e3d0f,_0x3067a5){var _0x529653='';var _0xbb7a01=['id',_0xdda7('0x35'),'assigned_user_id','created_by','description',_0xdda7('0x62'),_0xdda7('0x63'),'duration_minutes',_0xdda7('0x64'),_0xdda7('0x65'),_0xdda7('0x66'),_0xdda7('0x67')];return db['SugarcrmAccount'][_0xdda7('0x58')]({'where':{'id':_0x3ae322[_0xdda7('0x51')]['id']},'attributes':['id',_0xdda7('0x68'),_0xdda7('0x69'),_0xdda7('0x6a')]})[_0xdda7('0x33')](handleEntityNotFound(_0x2e3d0f,null))['then'](function(_0x3ec689){if(_0x3ec689){_0x529653=_0x3ec689[_0xdda7('0x6a')];var _0x3d7f86=_0x529653['slice'](-0x1);if(_0x3d7f86==='/'){_0x529653=_0x529653['substring'](0x0,_0x529653['lastIndexOf'](_0x3d7f86));}return rp({'method':_0xdda7('0x6b'),'uri':util[_0xdda7('0x6c')](_0xdda7('0x6d'),_0x529653,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xdda7('0x6e'),'input_type':_0xdda7('0x6f'),'response_type':_0xdda7('0x6f'),'rest_data':JSON[_0xdda7('0x25')]({'user_auth':{'user_name':_0x3ec689['username'],'password':_0x3ec689['password'],'encryption':'PLAIN'},'application':_0xdda7('0x70')})}});}})[_0xdda7('0x33')](function(_0x1334b){if(_0x1334b&&_0x1334b[_0xdda7('0x35')]!=='Invalid\x20Login'&&_0x1334b[_0xdda7('0x35')]!==_0xdda7('0x71')){return rp({'method':'POST','uri':util[_0xdda7('0x6c')](_0xdda7('0x6d'),_0x529653,_0xdda7('0x72')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xdda7('0x6f'),'response_type':'JSON','rest_data':JSON[_0xdda7('0x25')]({'session':_0x1334b['id'],'module_name':'Calls'})}})['then'](function(_0x50ba10){if(_0x50ba10){var _0x21c835=_['values'](_0x50ba10[_0xdda7('0x73')]);_[_0xdda7('0x74')](_0x21c835,function(_0x4995b5){return _0xbb7a01['includes'](_0x4995b5['name']);});return{'count':_0x21c835[_0xdda7('0x44')],'rows':_[_0xdda7('0x3d')](_0x21c835,function(_0x44c2e3){return{'id':_0x44c2e3[_0xdda7('0x35')],'name':_0x44c2e3['label'],'custom':_[_0xdda7('0x75')](_0x44c2e3[_0xdda7('0x35')],'_c')?!![]:![],'options':_0x44c2e3[_0xdda7('0x4e')]?_[_0xdda7('0x3d')](_[_0xdda7('0x76')](_0x44c2e3['options']),function(_0x2eb654){return{'name':_0x2eb654['value'],'value':_0x2eb654['name']};}):[]};})};}})[_0xdda7('0x33')](respondWithResult(_0x2e3d0f,null))['catch'](function(_0x128dd1){var _0x20a00a=_0x3ae322[_0xdda7('0x3e')][_0xdda7('0x77')]?0x1f4:_0x128dd1[_0xdda7('0x78')]||0x1f4;logger['error'](_0xdda7('0x79'),_0xdda7('0x61'),_0x20a00a,JSON[_0xdda7('0x25')](_0x128dd1));delete _0x128dd1['name'];if(_0x20a00a===0x191){_0x20a00a=0x190;}_0x2e3d0f[_0xdda7('0x36')](_0x20a00a)[_0xdda7('0x7a')](_0x3ae322['query'][_0xdda7('0x77')]?{'message':_0xdda7('0x7b'),'statusCode':_0x128dd1['statusCode']}:_0x128dd1);});}else{var _0x28d1c6=0x1f4;_0x2e3d0f[_0xdda7('0x36')](_0x28d1c6)['send']({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xf917=['getFields','assigned_user_id','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','params','remoteUri','slice','lastIndexOf','/service/v4_1/rest.php','login','JSON','username','PLAIN','Password\x20Expired','POST','%s%s','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','send','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','SugarcrmAccount','includeAll','include','findAll','rows','show','options','find','create','body','getConfigurations','SugarcrmConfiguration','pick','nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','SugarcrmField'];(function(_0xb5608a,_0xe56010){var _0x277b63=function(_0x515821){while(--_0x515821){_0xb5608a['push'](_0xb5608a['shift']());}};_0x277b63(++_0xe56010);}(_0xf917,0x1ab));var _0x7f91=function(_0x2c3bd9,_0x45f815){_0x2c3bd9=_0x2c3bd9-0x0;var _0x112e55=_0xf917[_0x2c3bd9];return _0x112e55;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7f91('0x0'));var rimraf=require(_0x7f91('0x1'));var zipdir=require(_0x7f91('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7f91('0x3'));var moment=require('moment');var BPromise=require(_0x7f91('0x4'));var Mustache=require(_0x7f91('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7f91('0x6'));var csv=require(_0x7f91('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7f91('0x8'));var squel=require(_0x7f91('0x9'));var crypto=require(_0x7f91('0xa'));var jsforce=require(_0x7f91('0xb'));var deskjs=require(_0x7f91('0xc'));var toCsv=require(_0x7f91('0x7'));var querystring=require('querystring');var Papa=require(_0x7f91('0xd'));var Redis=require(_0x7f91('0xe'));var authService=require(_0x7f91('0xf'));var qs=require(_0x7f91('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f91('0x11'))('api');var utils=require(_0x7f91('0x12'));var config=require(_0x7f91('0x13'));var db=require(_0x7f91('0x14'))['db'];var integrations=require(_0x7f91('0x15'));var jayson=require(_0x7f91('0x16'));var client=jayson[_0x7f91('0x17')][_0x7f91('0x18')]({'port':0x232a});function checkPasswordPattern(_0x74dfc5,_0x48518e,_0x39cfd1){if(_0x39cfd1){var _0x3f43a3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3f43a3['test'](_0x48518e)){return _0x74dfc5;}else{throw new db[(_0x7f91('0x19'))][(_0x7f91('0x1a'))](_0x7f91('0x1b'));}}else{return _0x74dfc5;}}function respondWithRpcPromise(_0x15e196,_0x449cf2,_0x3f5797,_0x3ac34b){return new BPromise(function(_0x27a3aa,_0x5d711c){var _0xa1fdc4=_0x3ac34b||client;return _0xa1fdc4['request'](_0x15e196,_0x3f5797)[_0x7f91('0x1c')](function(_0x5dccef){logger[_0x7f91('0x1d')]('SugarcrmAccount,\x20%s,\x20%s',_0x449cf2,_0x7f91('0x1e'));logger[_0x7f91('0x1f')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x449cf2,_0x7f91('0x1e'),JSON[_0x7f91('0x20')](_0x5dccef));if(_0x5dccef['error']){if(_0x5dccef['error']['code']===0x1f4){logger[_0x7f91('0x21')](_0x7f91('0x22'),_0x449cf2,_0x5dccef[_0x7f91('0x21')][_0x7f91('0x23')]);return _0x5d711c(_0x5dccef[_0x7f91('0x21')][_0x7f91('0x23')]);}logger[_0x7f91('0x21')](_0x7f91('0x22'),_0x449cf2,_0x5dccef[_0x7f91('0x21')][_0x7f91('0x23')]);return _0x27a3aa(_0x5dccef['error'][_0x7f91('0x23')]);}else{logger[_0x7f91('0x1d')](_0x7f91('0x22'),_0x449cf2,'request\x20sent');_0x27a3aa(_0x5dccef[_0x7f91('0x24')][_0x7f91('0x23')]);}})[_0x7f91('0x25')](function(_0x35f31a){logger['error'](_0x7f91('0x22'),_0x449cf2,_0x35f31a);_0x5d711c(_0x35f31a);});});}function respondWithStatusCode(_0x504f20,_0x394038){_0x394038=_0x394038||0xcc;return function(_0x1a0293){if(_0x1a0293){return _0x504f20[_0x7f91('0x26')](_0x394038);}return _0x504f20[_0x7f91('0x27')](_0x394038)[_0x7f91('0x28')]();};}function respondWithResult(_0xbcf9fe,_0x4744ad){_0x4744ad=_0x4744ad||0xc8;return function(_0x264dc3){if(_0x264dc3){return _0xbcf9fe[_0x7f91('0x27')](_0x4744ad)[_0x7f91('0x29')](_0x264dc3);}};}function respondWithFilteredResult(_0x25380e,_0xd155b0){return function(_0x25a0fb){if(_0x25a0fb){var _0x3585cd=_0x25a0fb[_0x7f91('0x2a')],_0x3e5f3f=_0xd155b0[_0x7f91('0x2b')],_0x184510=_0xd155b0[_0x7f91('0x2b')]+_0xd155b0[_0x7f91('0x2c')],_0x24f1c7;if(_0x184510>=_0x3585cd){_0x184510=_0x3585cd;_0x24f1c7=0xc8;}else{_0x24f1c7=0xce;}_0x25380e[_0x7f91('0x27')](_0x24f1c7);return _0x25380e[_0x7f91('0x2d')](_0x7f91('0x2e'),_0x3e5f3f+'-'+_0x184510+'/'+_0x3585cd)['json'](_0x25a0fb);}return null;};}function patchUpdates(_0x52c284){return function(_0xd8b4f2){try{jsonpatch[_0x7f91('0x2f')](_0xd8b4f2,_0x52c284,!![]);}catch(_0x2610d7){return BPromise['reject'](_0x2610d7);}return _0xd8b4f2[_0x7f91('0x30')]();};}function saveUpdates(_0x3d22dd,_0x5635f2){return function(_0xae971b){if(_0xae971b){return _0xae971b[_0x7f91('0x31')](_0x3d22dd)[_0x7f91('0x1c')](function(_0x261cdb){return _0x261cdb;});}return null;};}function removeEntity(_0x547704,_0x2b8b51){return function(_0x757f){if(_0x757f){return _0x757f[_0x7f91('0x32')]()['then'](function(){_0x547704[_0x7f91('0x27')](0xcc)[_0x7f91('0x28')]();});}};}function handleEntityNotFound(_0x121450,_0x394e0f){return function(_0x579596){if(!_0x579596){_0x121450['sendStatus'](0x194);}return _0x579596;};}function handleError(_0x42e059,_0x1b235e){_0x1b235e=_0x1b235e||0x1f4;return function(_0x23e86b){logger[_0x7f91('0x21')](_0x23e86b[_0x7f91('0x33')]);if(_0x23e86b[_0x7f91('0x34')]){delete _0x23e86b[_0x7f91('0x34')];}_0x42e059[_0x7f91('0x27')](_0x1b235e)['send'](_0x23e86b);};}exports[_0x7f91('0x35')]=function(_0x9ae621,_0x239adb){var _0x2f8d10={},_0x551422={},_0x11e6cb={'count':0x0,'rows':[]};var _0x4c1f9f=_[_0x7f91('0x36')](db['SugarcrmAccount'][_0x7f91('0x37')],function(_0x4e48b5){return{'name':_0x4e48b5[_0x7f91('0x38')],'type':_0x4e48b5['type'][_0x7f91('0x39')]};});_0x551422[_0x7f91('0x3a')]=_[_0x7f91('0x36')](_0x4c1f9f,_0x7f91('0x34'));_0x551422[_0x7f91('0x3b')]=_[_0x7f91('0x3c')](_0x9ae621[_0x7f91('0x3b')]);_0x551422[_0x7f91('0x3d')]=_['intersection'](_0x551422[_0x7f91('0x3a')],_0x551422[_0x7f91('0x3b')]);_0x2f8d10[_0x7f91('0x3e')]=_[_0x7f91('0x3f')](_0x551422[_0x7f91('0x3a')],qs[_0x7f91('0x40')](_0x9ae621[_0x7f91('0x3b')]['fields']));_0x2f8d10[_0x7f91('0x3e')]=_0x2f8d10['attributes'][_0x7f91('0x41')]?_0x2f8d10[_0x7f91('0x3e')]:_0x551422['model'];if(!_0x9ae621[_0x7f91('0x3b')][_0x7f91('0x42')]('nolimit')){_0x2f8d10[_0x7f91('0x2c')]=qs[_0x7f91('0x2c')](_0x9ae621[_0x7f91('0x3b')]['limit']);_0x2f8d10['offset']=qs[_0x7f91('0x2b')](_0x9ae621[_0x7f91('0x3b')][_0x7f91('0x2b')]);}_0x2f8d10[_0x7f91('0x43')]=qs[_0x7f91('0x44')](_0x9ae621[_0x7f91('0x3b')][_0x7f91('0x44')]);_0x2f8d10['where']=qs[_0x7f91('0x3d')](_['pick'](_0x9ae621[_0x7f91('0x3b')],_0x551422[_0x7f91('0x3d')]));if(_0x9ae621[_0x7f91('0x3b')][_0x7f91('0x45')]){_0x2f8d10[_0x7f91('0x46')]=_[_0x7f91('0x47')](_0x2f8d10[_0x7f91('0x46')],{'$or':_[_0x7f91('0x36')](_0x4c1f9f,function(_0x3f2799){if(_0x3f2799[_0x7f91('0x48')]!==_0x7f91('0x49')){var _0x1c13c1={};_0x1c13c1[_0x3f2799[_0x7f91('0x34')]]={'$like':'%'+_0x9ae621[_0x7f91('0x3b')][_0x7f91('0x45')]+'%'};return _0x1c13c1;}})});}_0x2f8d10=_['merge']({},_0x2f8d10,_0x9ae621['options']);var _0x12348e={'where':_0x2f8d10[_0x7f91('0x46')]};return db[_0x7f91('0x4a')][_0x7f91('0x2a')](_0x12348e)['then'](function(_0x22f8ce){_0x11e6cb[_0x7f91('0x2a')]=_0x22f8ce;if(_0x9ae621[_0x7f91('0x3b')][_0x7f91('0x4b')]){_0x2f8d10[_0x7f91('0x4c')]=[{'all':!![]}];}return db[_0x7f91('0x4a')][_0x7f91('0x4d')](_0x2f8d10);})[_0x7f91('0x1c')](function(_0x4f6f89){_0x11e6cb[_0x7f91('0x4e')]=_0x4f6f89;return _0x11e6cb;})[_0x7f91('0x1c')](respondWithFilteredResult(_0x239adb,_0x2f8d10))[_0x7f91('0x25')](handleError(_0x239adb,null));};exports[_0x7f91('0x4f')]=function(_0x234482,_0xe1dc5a){var _0x354761={'raw':![],'where':{'id':_0x234482['params']['id']}},_0x3861cd={};_0x3861cd[_0x7f91('0x3a')]=_[_0x7f91('0x3c')](db['SugarcrmAccount'][_0x7f91('0x37')]);_0x3861cd[_0x7f91('0x3b')]=_[_0x7f91('0x3c')](_0x234482[_0x7f91('0x3b')]);_0x3861cd[_0x7f91('0x3d')]=_[_0x7f91('0x3f')](_0x3861cd[_0x7f91('0x3a')],_0x3861cd['query']);_0x354761[_0x7f91('0x3e')]=_[_0x7f91('0x3f')](_0x3861cd[_0x7f91('0x3a')],qs[_0x7f91('0x40')](_0x234482[_0x7f91('0x3b')][_0x7f91('0x40')]));_0x354761[_0x7f91('0x3e')]=_0x354761[_0x7f91('0x3e')][_0x7f91('0x41')]?_0x354761[_0x7f91('0x3e')]:_0x3861cd[_0x7f91('0x3a')];if(_0x234482[_0x7f91('0x3b')][_0x7f91('0x4b')]){_0x354761[_0x7f91('0x4c')]=[{'all':!![]}];}_0x354761=_[_0x7f91('0x47')]({},_0x354761,_0x234482[_0x7f91('0x50')]);return db[_0x7f91('0x4a')][_0x7f91('0x51')](_0x354761)[_0x7f91('0x1c')](handleEntityNotFound(_0xe1dc5a,null))[_0x7f91('0x1c')](respondWithResult(_0xe1dc5a,null))[_0x7f91('0x25')](handleError(_0xe1dc5a,null));};exports['create']=function(_0x5bbe14,_0x4ea108){return db[_0x7f91('0x4a')][_0x7f91('0x52')](_0x5bbe14[_0x7f91('0x53')],{})[_0x7f91('0x1c')](respondWithResult(_0x4ea108,0xc9))[_0x7f91('0x25')](handleError(_0x4ea108,null));};exports[_0x7f91('0x31')]=function(_0x2d2690,_0x5d1160){if(_0x2d2690['body']['id']){delete _0x2d2690[_0x7f91('0x53')]['id'];}return db[_0x7f91('0x4a')][_0x7f91('0x51')]({'where':{'id':_0x2d2690['params']['id']}})[_0x7f91('0x1c')](handleEntityNotFound(_0x5d1160,null))[_0x7f91('0x1c')](saveUpdates(_0x2d2690[_0x7f91('0x53')],null))[_0x7f91('0x1c')](respondWithResult(_0x5d1160,null))['catch'](handleError(_0x5d1160,null));};exports[_0x7f91('0x32')]=function(_0x179b18,_0x206ebb){return db[_0x7f91('0x4a')][_0x7f91('0x51')]({'where':{'id':_0x179b18['params']['id']}})['then'](handleEntityNotFound(_0x206ebb,null))[_0x7f91('0x1c')](removeEntity(_0x206ebb,null))[_0x7f91('0x25')](handleError(_0x206ebb,null));};exports[_0x7f91('0x54')]=function(_0x30e81e,_0x4dc09e,_0xf7e427){var _0x1dd312={};var _0x56790c={};var _0x1e554c;var _0x2f83a0;return db[_0x7f91('0x4a')]['findOne']({'where':{'id':_0x30e81e['params']['id']}})[_0x7f91('0x1c')](handleEntityNotFound(_0x4dc09e,null))[_0x7f91('0x1c')](function(_0x49aa03){if(_0x49aa03){_0x1e554c=_0x49aa03;_0x56790c[_0x7f91('0x3a')]=_[_0x7f91('0x3c')](db[_0x7f91('0x55')]['rawAttributes']);_0x56790c[_0x7f91('0x3b')]=_['keys'](_0x30e81e[_0x7f91('0x3b')]);_0x56790c[_0x7f91('0x3d')]=_[_0x7f91('0x3f')](_0x56790c['model'],_0x56790c['query']);_0x1dd312[_0x7f91('0x3e')]=_[_0x7f91('0x3f')](_0x56790c[_0x7f91('0x3a')],qs[_0x7f91('0x40')](_0x30e81e[_0x7f91('0x3b')][_0x7f91('0x40')]));_0x1dd312['attributes']=_0x1dd312[_0x7f91('0x3e')][_0x7f91('0x41')]?_0x1dd312[_0x7f91('0x3e')]:_0x56790c[_0x7f91('0x3a')];_0x1dd312[_0x7f91('0x43')]=qs[_0x7f91('0x44')](_0x30e81e[_0x7f91('0x3b')][_0x7f91('0x44')]);_0x1dd312[_0x7f91('0x46')]=qs[_0x7f91('0x3d')](_[_0x7f91('0x56')](_0x30e81e['query'],_0x56790c[_0x7f91('0x3d')]));if(_0x30e81e[_0x7f91('0x3b')][_0x7f91('0x45')]){_0x1dd312[_0x7f91('0x46')]=_['merge'](_0x1dd312[_0x7f91('0x46')],{'$or':_[_0x7f91('0x36')](_0x1dd312[_0x7f91('0x3e')],function(_0xec9ce){var _0x1d3286={};_0x1d3286[_0xec9ce]={'$like':'%'+_0x30e81e['query'][_0x7f91('0x45')]+'%'};return _0x1d3286;})});}_0x1dd312=_[_0x7f91('0x47')]({},_0x1dd312,_0x30e81e[_0x7f91('0x50')]);return _0x1e554c[_0x7f91('0x54')](_0x1dd312);}})[_0x7f91('0x1c')](function(_0x396f45){if(_0x396f45){_0x2f83a0=_0x396f45[_0x7f91('0x41')];if(!_0x30e81e['query'][_0x7f91('0x42')](_0x7f91('0x57'))){_0x1dd312[_0x7f91('0x2c')]=qs[_0x7f91('0x2c')](_0x30e81e[_0x7f91('0x3b')][_0x7f91('0x2c')]);_0x1dd312['offset']=qs['offset'](_0x30e81e[_0x7f91('0x3b')][_0x7f91('0x2b')]);}return _0x1e554c[_0x7f91('0x54')](_0x1dd312);}})['then'](function(_0x4e719f){if(_0x4e719f){return _0x4e719f?{'count':_0x2f83a0,'rows':_0x4e719f}:null;}})[_0x7f91('0x1c')](respondWithResult(_0x4dc09e,null))['catch'](handleError(_0x4dc09e,null));};exports[_0x7f91('0x58')]=function(_0x405a3a,_0x46a142,_0x3d3e9f){if(_0x405a3a['body']['id']){delete _0x405a3a[_0x7f91('0x53')]['id'];}return db[_0x7f91('0x4a')][_0x7f91('0x59')]({'where':{'id':_0x405a3a['params']['id']}})[_0x7f91('0x1c')](handleEntityNotFound(_0x46a142,null))[_0x7f91('0x1c')](function(_0x1154d6){if(_0x1154d6){_0x405a3a['body'][_0x7f91('0x5a')]=_0x1154d6['id'];_0x405a3a['body'][_0x7f91('0x5b')]=integrations[_0x7f91('0x5c')](_0x405a3a[_0x7f91('0x53')]['channel'],_0x405a3a[_0x7f91('0x53')][_0x7f91('0x48')]);_0x405a3a[_0x7f91('0x53')][_0x7f91('0x5d')]=integrations[_0x7f91('0x5e')](_0x405a3a[_0x7f91('0x53')][_0x7f91('0x5f')],_0x405a3a[_0x7f91('0x53')]['type']);return db[_0x7f91('0x55')][_0x7f91('0x52')](_0x405a3a['body'],{'include':[{'model':db[_0x7f91('0x60')],'as':_0x7f91('0x5b')},{'model':db['SugarcrmField'],'as':_0x7f91('0x5d')}]});}return null;})['then'](respondWithResult(_0x46a142,null))[_0x7f91('0x25')](handleError(_0x46a142,null));};exports[_0x7f91('0x61')]=function(_0x28bca1,_0x55fae0,_0x29051f){var _0x20a291='';var _0x464e47=['id',_0x7f91('0x34'),_0x7f91('0x62'),'created_by',_0x7f91('0x63'),_0x7f91('0x64'),_0x7f91('0x65'),_0x7f91('0x66'),_0x7f91('0x67'),_0x7f91('0x68'),_0x7f91('0x69'),'direction'];return db['SugarcrmAccount'][_0x7f91('0x59')]({'where':{'id':_0x28bca1[_0x7f91('0x6a')]['id']},'attributes':['id','username','password','remoteUri']})[_0x7f91('0x1c')](handleEntityNotFound(_0x55fae0,null))[_0x7f91('0x1c')](function(_0x5c2754){if(_0x5c2754){_0x20a291=_0x5c2754[_0x7f91('0x6b')];var _0x2cc910=_0x20a291[_0x7f91('0x6c')](-0x1);if(_0x2cc910==='/'){_0x20a291=_0x20a291['substring'](0x0,_0x20a291[_0x7f91('0x6d')](_0x2cc910));}return rp({'method':'POST','uri':util['format']('%s%s',_0x20a291,_0x7f91('0x6e')),'json':!![],'form':{'method':_0x7f91('0x6f'),'input_type':_0x7f91('0x70'),'response_type':_0x7f91('0x70'),'rest_data':JSON[_0x7f91('0x20')]({'user_auth':{'user_name':_0x5c2754[_0x7f91('0x71')],'password':_0x5c2754['password'],'encryption':_0x7f91('0x72')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x7f91('0x1c')](function(_0xc85c61){if(_0xc85c61&&_0xc85c61[_0x7f91('0x34')]!=='Invalid\x20Login'&&_0xc85c61[_0x7f91('0x34')]!==_0x7f91('0x73')){return rp({'method':_0x7f91('0x74'),'uri':util['format'](_0x7f91('0x75'),_0x20a291,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x7f91('0x76'),'input_type':_0x7f91('0x70'),'response_type':'JSON','rest_data':JSON[_0x7f91('0x20')]({'session':_0xc85c61['id'],'module_name':_0x7f91('0x77')})}})['then'](function(_0x13fe7a){if(_0x13fe7a){var _0xff391=_[_0x7f91('0x78')](_0x13fe7a[_0x7f91('0x79')]);_[_0x7f91('0x7a')](_0xff391,function(_0x5cf92c){return _0x464e47['includes'](_0x5cf92c['name']);});return{'count':_0xff391['length'],'rows':_[_0x7f91('0x36')](_0xff391,function(_0x3cf40f){return{'id':_0x3cf40f[_0x7f91('0x34')],'name':_0x3cf40f[_0x7f91('0x7b')],'custom':_[_0x7f91('0x7c')](_0x3cf40f[_0x7f91('0x34')],'_c')?!![]:![],'options':_0x3cf40f[_0x7f91('0x50')]?_[_0x7f91('0x36')](_['values'](_0x3cf40f[_0x7f91('0x50')]),function(_0x7c22d1){return{'name':_0x7c22d1[_0x7f91('0x7d')],'value':_0x7c22d1[_0x7f91('0x34')]};}):[]};})};}})[_0x7f91('0x1c')](respondWithResult(_0x55fae0,null))[_0x7f91('0x25')](function(_0x431c26){var _0x5149e6=_0x28bca1[_0x7f91('0x3b')][_0x7f91('0x7e')]?0x1f4:_0x431c26[_0x7f91('0x7f')]||0x1f4;logger[_0x7f91('0x21')](_0x7f91('0x80'),_0x7f91('0x61'),_0x5149e6,JSON['stringify'](_0x431c26));delete _0x431c26[_0x7f91('0x34')];if(_0x5149e6===0x191){_0x5149e6=0x190;}_0x55fae0[_0x7f91('0x27')](_0x5149e6)['send'](_0x28bca1[_0x7f91('0x3b')][_0x7f91('0x7e')]?{'message':_0x7f91('0x81'),'statusCode':_0x431c26[_0x7f91('0x7f')]}:_0x431c26);});}else{var _0x4b6057=0x1f4;_0x55fae0[_0x7f91('0x27')](_0x4b6057)[_0x7f91('0x82')]({'message':_0x7f91('0x81'),'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 d91f200..84d91af 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 _0x2ce5=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x3c0544,_0x2fdb2b){var _0x22b2ae=function(_0x24f616){while(--_0x24f616){_0x3c0544['push'](_0x3c0544['shift']());}};_0x22b2ae(++_0x2fdb2b);}(_0x2ce5,0x1e5));var _0x52ce=function(_0x569e5f,_0x152fd0){_0x569e5f=_0x569e5f-0x0;var _0x23890d=_0x2ce5[_0x569e5f];return _0x23890d;};'use strict';var _=require(_0x52ce('0x0'));var util=require(_0x52ce('0x1'));var logger=require('../../config/logger')(_0x52ce('0x2'));var moment=require(_0x52ce('0x3'));var BPromise=require(_0x52ce('0x4'));var rp=require(_0x52ce('0x5'));var fs=require('fs');var path=require(_0x52ce('0x6'));var rimraf=require(_0x52ce('0x7'));var config=require(_0x52ce('0x8'));var attributes=require(_0x52ce('0x9'));var integrations=require(_0x52ce('0xa'));module[_0x52ce('0xb')]=function(_0x13b22b,_0x5e1fa3){return _0x13b22b[_0x52ce('0xc')](_0x52ce('0xd'),attributes,{'tableName':_0x52ce('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0034=['int_sugarcrm_accounts','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','SugarcrmAccount'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x0034,0xdd));var _0x4003=function(_0xc72a72,_0xfaaf35){_0xc72a72=_0xc72a72-0x0;var _0x20f9a9=_0x0034[_0xc72a72];return _0x20f9a9;};'use strict';var _=require('lodash');var util=require(_0x4003('0x0'));var logger=require('../../config/logger')(_0x4003('0x1'));var moment=require(_0x4003('0x2'));var BPromise=require(_0x4003('0x3'));var rp=require(_0x4003('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4003('0x5'));var config=require(_0x4003('0x6'));var attributes=require(_0x4003('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x4003('0x8')]=function(_0x34d091,_0x2c2c2){return _0x34d091['define'](_0x4003('0x9'),attributes,{'tableName':_0x4003('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index dd19dff..c4f86f5 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 _0xf262=['request','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','limit','include','map','model','attributes','then','ShowSugarcrmAccount','find','raw','where','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x1b01fc,_0x4ed7d4){var _0x5a2d34=function(_0x5203c3){while(--_0x5203c3){_0x1b01fc['push'](_0x1b01fc['shift']());}};_0x5a2d34(++_0x4ed7d4);}(_0xf262,0xff));var _0x2f26=function(_0x1c5d6f,_0x24252e){_0x1c5d6f=_0x1c5d6f-0x0;var _0x5718ba=_0xf262[_0x1c5d6f];return _0x5718ba;};'use strict';var _=require('lodash');var util=require(_0x2f26('0x0'));var moment=require(_0x2f26('0x1'));var BPromise=require(_0x2f26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f26('0x3'))['db'];var utils=require(_0x2f26('0x4'));var logger=require(_0x2f26('0x5'))('rpc');var config=require(_0x2f26('0x6'));var jayson=require(_0x2f26('0x7'));var client=jayson['client'][_0x2f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b08c,_0x1b99d7,_0x265c64){return new BPromise(function(_0x23b931,_0x13ae5e){return client[_0x2f26('0x9')](_0x29b08c,_0x265c64)['then'](function(_0x573699){logger['info'](_0x2f26('0xa'),_0x1b99d7,'request\x20sent');logger[_0x2f26('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1b99d7,_0x2f26('0xc'),JSON[_0x2f26('0xd')](_0x573699));if(_0x573699['error']){if(_0x573699[_0x2f26('0xe')][_0x2f26('0xf')]===0x1f4){logger['error'](_0x2f26('0xa'),_0x1b99d7,_0x573699['error'][_0x2f26('0x10')]);return _0x13ae5e(_0x573699['error'][_0x2f26('0x10')]);}logger['error'](_0x2f26('0xa'),_0x1b99d7,_0x573699[_0x2f26('0xe')][_0x2f26('0x10')]);return _0x23b931(_0x573699[_0x2f26('0xe')][_0x2f26('0x10')]);}else{logger[_0x2f26('0x11')](_0x2f26('0xa'),_0x1b99d7,_0x2f26('0xc'));_0x23b931(_0x573699[_0x2f26('0x12')][_0x2f26('0x10')]);}})[_0x2f26('0x13')](function(_0x359155){logger[_0x2f26('0xe')](_0x2f26('0xa'),_0x1b99d7,_0x359155);_0x13ae5e(_0x359155);});});}exports[_0x2f26('0x14')]=function(_0xd5bf70){var _0x94bd36=this;return new Promise(function(_0x230d3f,_0x4af05a){return db[_0x2f26('0x15')]['findAll']({'raw':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')]['where']||null:null,'attributes':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')]['attributes']||null:null,'limit':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')][_0x2f26('0x17')]||null:null,'include':_0xd5bf70['options']?_0xd5bf70[_0x2f26('0x16')][_0x2f26('0x18')]?_[_0x2f26('0x19')](_0xd5bf70[_0x2f26('0x16')][_0x2f26('0x18')],function(_0x52d167){return{'model':db[_0x52d167[_0x2f26('0x1a')]],'as':_0x52d167['as'],'attributes':_0x52d167[_0x2f26('0x1b')],'include':_0x52d167[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x52d167[_0x2f26('0x18')],function(_0x77b305){return{'model':db[_0x77b305['model']],'as':_0x77b305['as'],'attributes':_0x77b305[_0x2f26('0x1b')],'include':_0x77b305[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x77b305[_0x2f26('0x18')],function(_0x59e78b){return{'model':db[_0x59e78b['model']],'as':_0x59e78b['as'],'attributes':_0x59e78b[_0x2f26('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2f26('0x1c')](function(_0x3f7636){logger[_0x2f26('0x11')]('GetSugarcrmAccount',_0xd5bf70);logger[_0x2f26('0xb')](_0x2f26('0x14'),_0xd5bf70,JSON[_0x2f26('0xd')](_0x3f7636));_0x230d3f(_0x3f7636);})[_0x2f26('0x13')](function(_0x114193){logger['error'](_0x2f26('0x14'),_0x114193['message'],_0xd5bf70);_0x4af05a(_0x94bd36[_0x2f26('0xe')](0x1f4,_0x114193['message']));});});};exports[_0x2f26('0x1d')]=function(_0x3d33c5){var _0x536e35=this;return new Promise(function(_0x133b86,_0x54c023){return db['SugarcrmAccount'][_0x2f26('0x1e')]({'raw':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5[_0x2f26('0x16')][_0x2f26('0x1f')]===undefined?!![]:![]:!![],'where':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5['options'][_0x2f26('0x20')]||null:null,'attributes':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5[_0x2f26('0x16')]['attributes']||null:null,'include':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5[_0x2f26('0x16')][_0x2f26('0x18')]?_['map'](_0x3d33c5[_0x2f26('0x16')][_0x2f26('0x18')],function(_0x1adfac){return{'model':db[_0x1adfac['model']],'as':_0x1adfac['as'],'attributes':_0x1adfac[_0x2f26('0x1b')],'include':_0x1adfac[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x1adfac[_0x2f26('0x18')],function(_0x4ed54e){return{'model':db[_0x4ed54e[_0x2f26('0x1a')]],'as':_0x4ed54e['as'],'attributes':_0x4ed54e['attributes'],'include':_0x4ed54e[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x4ed54e[_0x2f26('0x18')],function(_0x912453){return{'model':db[_0x912453[_0x2f26('0x1a')]],'as':_0x912453['as'],'attributes':_0x912453['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x182311){logger[_0x2f26('0x11')](_0x2f26('0x1d'),_0x3d33c5);logger[_0x2f26('0xb')](_0x2f26('0x1d'),_0x3d33c5,JSON[_0x2f26('0xd')](_0x182311));_0x133b86(_0x182311);})['catch'](function(_0x36226d){logger['error'](_0x2f26('0x1d'),_0x36226d['message'],_0x3d33c5);_0x54c023(_0x536e35[_0x2f26('0xe')](0x1f4,_0x36226d[_0x2f26('0x10')]));});});}; \ No newline at end of file +var _0x179c=['model','attributes','info','GetSugarcrmAccount','ShowSugarcrmAccount','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','SugarcrmAccount','options','raw','where','limit','map','include'];(function(_0x257984,_0x15e094){var _0x48e7ba=function(_0x45bfd3){while(--_0x45bfd3){_0x257984['push'](_0x257984['shift']());}};_0x48e7ba(++_0x15e094);}(_0x179c,0x1cc));var _0xc179=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x179c[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require('lodash');var util=require(_0xc179('0x0'));var moment=require(_0xc179('0x1'));var BPromise=require(_0xc179('0x2'));var rs=require(_0xc179('0x3'));var fs=require('fs');var Redis=require(_0xc179('0x4'));var db=require(_0xc179('0x5'))['db'];var utils=require(_0xc179('0x6'));var logger=require('../../config/logger')(_0xc179('0x7'));var config=require(_0xc179('0x8'));var jayson=require(_0xc179('0x9'));var client=jayson[_0xc179('0xa')][_0xc179('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x209a7e,_0x4b9ed7,_0x2ada24){return new BPromise(function(_0x43101d,_0x52a4d9){return client[_0xc179('0xc')](_0x209a7e,_0x2ada24)[_0xc179('0xd')](function(_0x2f7be0){logger['info'](_0xc179('0xe'),_0x4b9ed7,'request\x20sent');logger[_0xc179('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x4b9ed7,_0xc179('0x10'),JSON[_0xc179('0x11')](_0x2f7be0));if(_0x2f7be0[_0xc179('0x12')]){if(_0x2f7be0[_0xc179('0x12')][_0xc179('0x13')]===0x1f4){logger[_0xc179('0x12')](_0xc179('0xe'),_0x4b9ed7,_0x2f7be0['error'][_0xc179('0x14')]);return _0x52a4d9(_0x2f7be0['error'][_0xc179('0x14')]);}logger['error'](_0xc179('0xe'),_0x4b9ed7,_0x2f7be0[_0xc179('0x12')][_0xc179('0x14')]);return _0x43101d(_0x2f7be0[_0xc179('0x12')][_0xc179('0x14')]);}else{logger['info'](_0xc179('0xe'),_0x4b9ed7,'request\x20sent');_0x43101d(_0x2f7be0[_0xc179('0x15')][_0xc179('0x14')]);}})[_0xc179('0x16')](function(_0xfb880a){logger[_0xc179('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x4b9ed7,_0xfb880a);_0x52a4d9(_0xfb880a);});});}exports['GetSugarcrmAccount']=function(_0x295189){var _0x374845=this;return new Promise(function(_0x3a44a1,_0x53af6f){return db[_0xc179('0x17')]['findAll']({'raw':_0x295189[_0xc179('0x18')]?_0x295189[_0xc179('0x18')][_0xc179('0x19')]===undefined?!![]:![]:!![],'where':_0x295189['options']?_0x295189[_0xc179('0x18')][_0xc179('0x1a')]||null:null,'attributes':_0x295189[_0xc179('0x18')]?_0x295189['options']['attributes']||null:null,'limit':_0x295189[_0xc179('0x18')]?_0x295189['options'][_0xc179('0x1b')]||null:null,'include':_0x295189[_0xc179('0x18')]?_0x295189[_0xc179('0x18')]['include']?_[_0xc179('0x1c')](_0x295189['options'][_0xc179('0x1d')],function(_0x10727e){return{'model':db[_0x10727e[_0xc179('0x1e')]],'as':_0x10727e['as'],'attributes':_0x10727e[_0xc179('0x1f')],'include':_0x10727e[_0xc179('0x1d')]?_[_0xc179('0x1c')](_0x10727e[_0xc179('0x1d')],function(_0x1d6c9f){return{'model':db[_0x1d6c9f[_0xc179('0x1e')]],'as':_0x1d6c9f['as'],'attributes':_0x1d6c9f[_0xc179('0x1f')],'include':_0x1d6c9f['include']?_[_0xc179('0x1c')](_0x1d6c9f[_0xc179('0x1d')],function(_0x59c6dd){return{'model':db[_0x59c6dd[_0xc179('0x1e')]],'as':_0x59c6dd['as'],'attributes':_0x59c6dd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x42aa1e){logger[_0xc179('0x20')](_0xc179('0x21'),_0x295189);logger[_0xc179('0xf')](_0xc179('0x21'),_0x295189,JSON[_0xc179('0x11')](_0x42aa1e));_0x3a44a1(_0x42aa1e);})['catch'](function(_0x52a5d4){logger[_0xc179('0x12')](_0xc179('0x21'),_0x52a5d4['message'],_0x295189);_0x53af6f(_0x374845[_0xc179('0x12')](0x1f4,_0x52a5d4[_0xc179('0x14')]));});});};exports[_0xc179('0x22')]=function(_0x2d8c26){var _0xc0e3d6=this;return new Promise(function(_0x22bed2,_0x51f0c0){return db['SugarcrmAccount']['find']({'raw':_0x2d8c26[_0xc179('0x18')]?_0x2d8c26['options'][_0xc179('0x19')]===undefined?!![]:![]:!![],'where':_0x2d8c26['options']?_0x2d8c26[_0xc179('0x18')][_0xc179('0x1a')]||null:null,'attributes':_0x2d8c26[_0xc179('0x18')]?_0x2d8c26[_0xc179('0x18')][_0xc179('0x1f')]||null:null,'include':_0x2d8c26[_0xc179('0x18')]?_0x2d8c26[_0xc179('0x18')][_0xc179('0x1d')]?_['map'](_0x2d8c26['options'][_0xc179('0x1d')],function(_0x356a43){return{'model':db[_0x356a43['model']],'as':_0x356a43['as'],'attributes':_0x356a43[_0xc179('0x1f')],'include':_0x356a43[_0xc179('0x1d')]?_['map'](_0x356a43[_0xc179('0x1d')],function(_0xe43f18){return{'model':db[_0xe43f18[_0xc179('0x1e')]],'as':_0xe43f18['as'],'attributes':_0xe43f18[_0xc179('0x1f')],'include':_0xe43f18[_0xc179('0x1d')]?_['map'](_0xe43f18[_0xc179('0x1d')],function(_0x2a00d7){return{'model':db[_0x2a00d7[_0xc179('0x1e')]],'as':_0x2a00d7['as'],'attributes':_0x2a00d7[_0xc179('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc179('0xd')](function(_0x4748fb){logger[_0xc179('0x20')](_0xc179('0x22'),_0x2d8c26);logger[_0xc179('0xf')]('ShowSugarcrmAccount',_0x2d8c26,JSON[_0xc179('0x11')](_0x4748fb));_0x22bed2(_0x4748fb);})['catch'](function(_0x2e08ff){logger[_0xc179('0x12')](_0xc179('0x22'),_0x2e08ff[_0xc179('0x14')],_0x2d8c26);_0x51f0c0(_0xc0e3d6[_0xc179('0x12')](0x1f4,_0x2e08ff[_0xc179('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 922ad40..2c107b7 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 _0x2cd0=['/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','show'];(function(_0x5cdb50,_0x2c32d3){var _0x54930a=function(_0x3e7e99){while(--_0x3e7e99){_0x5cdb50['push'](_0x5cdb50['shift']());}};_0x54930a(++_0x2c32d3);}(_0x2cd0,0xee));var _0x02cd=function(_0x311f85,_0x247dfb){_0x311f85=_0x311f85-0x0;var _0x6ac4e8=_0x2cd0[_0x311f85];return _0x6ac4e8;};'use strict';var multer=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var path=require(_0x02cd('0x2'));var timeout=require(_0x02cd('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x02cd('0x4'));var interaction=require(_0x02cd('0x5'));var config=require(_0x02cd('0x6'));var controller=require(_0x02cd('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x02cd('0x8')]);router[_0x02cd('0x9')](_0x02cd('0xa'),auth['isAuthenticated'](),controller[_0x02cd('0xb')]);router[_0x02cd('0x9')](_0x02cd('0xc'),auth[_0x02cd('0xd')](),controller[_0x02cd('0xe')]);router[_0x02cd('0x9')]('/:id/subjects',auth[_0x02cd('0xd')](),controller[_0x02cd('0xf')]);router['get'](_0x02cd('0x10'),auth[_0x02cd('0xd')](),controller[_0x02cd('0x11')]);router[_0x02cd('0x12')]('/',auth['isAuthenticated'](),controller[_0x02cd('0x13')]);router[_0x02cd('0x14')](_0x02cd('0xa'),auth[_0x02cd('0xd')](),controller[_0x02cd('0x15')]);router[_0x02cd('0x16')](_0x02cd('0xa'),auth[_0x02cd('0xd')](),controller[_0x02cd('0x17')]);module[_0x02cd('0x18')]=router; \ No newline at end of file +var _0x38d8=['/:id','show','getFields','/:id/subjects','isAuthenticated','getSubjects','getDescriptions','create','put','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x38d8,0xb3));var _0x838d=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0x38d8[_0x79a6e8];return _0xeeb993;};'use strict';var multer=require(_0x838d('0x0'));var util=require(_0x838d('0x1'));var path=require('path');var timeout=require(_0x838d('0x2'));var express=require(_0x838d('0x3'));var router=express[_0x838d('0x4')]();var auth=require(_0x838d('0x5'));var interaction=require(_0x838d('0x6'));var config=require(_0x838d('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x838d('0x8')]('/',auth['isAuthenticated'](),controller[_0x838d('0x9')]);router[_0x838d('0x8')](_0x838d('0xa'),auth['isAuthenticated'](),controller[_0x838d('0xb')]);router[_0x838d('0x8')]('/:id/fields',auth['isAuthenticated'](),controller[_0x838d('0xc')]);router[_0x838d('0x8')](_0x838d('0xd'),auth[_0x838d('0xe')](),controller[_0x838d('0xf')]);router[_0x838d('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x838d('0x10')]);router['post']('/',auth[_0x838d('0xe')](),controller[_0x838d('0x11')]);router[_0x838d('0x12')](_0x838d('0xa'),auth['isAuthenticated'](),controller[_0x838d('0x13')]);router['delete'](_0x838d('0xa'),auth[_0x838d('0xe')](),controller['destroy']);module[_0x838d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 4f0dfad..e38aaa6 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 _0x00a6=['sequelize','STRING'];(function(_0x308caf,_0x5911cb){var _0x2b04f4=function(_0x52e47a){while(--_0x52e47a){_0x308caf['push'](_0x308caf['shift']());}};_0x2b04f4(++_0x5911cb);}(_0x00a6,0x120));var _0x600a=function(_0x3f710b,_0x5d04b5){_0x3f710b=_0x3f710b-0x0;var _0x48afb9=_0x00a6[_0x3f710b];return _0x48afb9;};'use strict';var Sequelize=require(_0x600a('0x0'));module['exports']={'name':{'type':Sequelize[_0x600a('0x1')]},'description':{'type':Sequelize[_0x600a('0x1')]}}; \ No newline at end of file +var _0xe767=['sequelize','exports','STRING'];(function(_0xa217b4,_0x428fe8){var _0x24ae42=function(_0x23fa01){while(--_0x23fa01){_0xa217b4['push'](_0xa217b4['shift']());}};_0x24ae42(++_0x428fe8);}(_0xe767,0x1aa));var _0x7e76=function(_0x3b2b3d,_0x465e62){_0x3b2b3d=_0x3b2b3d-0x0;var _0x3c0d59=_0xe767[_0x3b2b3d];return _0x3c0d59;};'use strict';var Sequelize=require(_0x7e76('0x0'));module[_0x7e76('0x1')]={'name':{'type':Sequelize[_0x7e76('0x2')]},'description':{'type':Sequelize[_0x7e76('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index caebc8c..4cabdd8 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 _0x87ce=['stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','params','create','body','destroy','SugarcrmField','filter','hasOwnProperty','getFields','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','apply','reject','save','update'];(function(_0x24545a,_0x229395){var _0x4a393d=function(_0x36f8d0){while(--_0x36f8d0){_0x24545a['push'](_0x24545a['shift']());}};_0x4a393d(++_0x229395);}(_0x87ce,0x84));var _0xe87c=function(_0x2aa841,_0x1417a5){_0x2aa841=_0x2aa841-0x0;var _0x448e8f=_0x87ce[_0x2aa841];return _0x448e8f;};'use strict';var pdf=require(_0xe87c('0x0'));var emlformat=require(_0xe87c('0x1'));var rimraf=require(_0xe87c('0x2'));var zipdir=require(_0xe87c('0x3'));var jsonpatch=require(_0xe87c('0x4'));var rp=require(_0xe87c('0x5'));var moment=require(_0xe87c('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe87c('0x7'));var sox=require(_0xe87c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe87c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe87c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe87c('0xb'));var querystring=require(_0xe87c('0xc'));var Papa=require(_0xe87c('0xd'));var Redis=require(_0xe87c('0xe'));var authService=require(_0xe87c('0xf'));var qs=require(_0xe87c('0x10'));var as=require(_0xe87c('0x11'));var hardwareService=require(_0xe87c('0x12'));var logger=require(_0xe87c('0x13'))(_0xe87c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe87c('0x15'))['db'];var jayson=require(_0xe87c('0x16'));var client=jayson[_0xe87c('0x17')][_0xe87c('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3e6758,_0x3c07b7,_0x187ab5){if(_0x187ab5){var _0x39314c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39314c[_0xe87c('0x19')](_0x3c07b7)){return _0x3e6758;}else{throw new db[(_0xe87c('0x1a'))][(_0xe87c('0x1b'))](_0xe87c('0x1c'));}}else{return _0x3e6758;}}function respondWithRpcPromise(_0x5cc53e,_0x1346ba,_0x3b0d59,_0x47a07d){return new BPromise(function(_0x1947c3,_0x31f7f0){var _0x59aa95=_0x47a07d||client;return _0x59aa95[_0xe87c('0x1d')](_0x5cc53e,_0x3b0d59)[_0xe87c('0x1e')](function(_0x26939f){logger[_0xe87c('0x1f')](_0xe87c('0x20'),_0x1346ba,'request\x20sent');logger['debug'](_0xe87c('0x21'),_0x1346ba,_0xe87c('0x22'),JSON[_0xe87c('0x23')](_0x26939f));if(_0x26939f[_0xe87c('0x24')]){if(_0x26939f[_0xe87c('0x24')][_0xe87c('0x25')]===0x1f4){logger['error'](_0xe87c('0x20'),_0x1346ba,_0x26939f['error'][_0xe87c('0x26')]);return _0x31f7f0(_0x26939f[_0xe87c('0x24')][_0xe87c('0x26')]);}logger[_0xe87c('0x24')](_0xe87c('0x20'),_0x1346ba,_0x26939f[_0xe87c('0x24')][_0xe87c('0x26')]);return _0x1947c3(_0x26939f['error'][_0xe87c('0x26')]);}else{logger[_0xe87c('0x1f')](_0xe87c('0x20'),_0x1346ba,'request\x20sent');_0x1947c3(_0x26939f[_0xe87c('0x27')][_0xe87c('0x26')]);}})[_0xe87c('0x28')](function(_0x540932){logger[_0xe87c('0x24')](_0xe87c('0x20'),_0x1346ba,_0x540932);_0x31f7f0(_0x540932);});});}function respondWithStatusCode(_0x15285b,_0x2fdf64){_0x2fdf64=_0x2fdf64||0xcc;return function(_0x23f2b4){if(_0x23f2b4){return _0x15285b[_0xe87c('0x29')](_0x2fdf64);}return _0x15285b['status'](_0x2fdf64)[_0xe87c('0x2a')]();};}function respondWithResult(_0x19289f,_0x3b2768){_0x3b2768=_0x3b2768||0xc8;return function(_0x5d78ac){if(_0x5d78ac){return _0x19289f[_0xe87c('0x2b')](_0x3b2768)['json'](_0x5d78ac);}};}function respondWithFilteredResult(_0x76223e,_0x419341){return function(_0x33a30f){if(_0x33a30f){var _0x3c245d=_0x33a30f[_0xe87c('0x2c')],_0x70e656=_0x419341[_0xe87c('0x2d')],_0x3a904a=_0x419341[_0xe87c('0x2d')]+_0x419341['limit'],_0x37c43d;if(_0x3a904a>=_0x3c245d){_0x3a904a=_0x3c245d;_0x37c43d=0xc8;}else{_0x37c43d=0xce;}_0x76223e[_0xe87c('0x2b')](_0x37c43d);return _0x76223e['set']('Content-Range',_0x70e656+'-'+_0x3a904a+'/'+_0x3c245d)['json'](_0x33a30f);}return null;};}function patchUpdates(_0x430bb7){return function(_0x1b6bb5){try{jsonpatch[_0xe87c('0x2e')](_0x1b6bb5,_0x430bb7,!![]);}catch(_0x58555e){return BPromise[_0xe87c('0x2f')](_0x58555e);}return _0x1b6bb5[_0xe87c('0x30')]();};}function saveUpdates(_0x2a8a3b,_0x41c903){return function(_0x22bf34){if(_0x22bf34){return _0x22bf34[_0xe87c('0x31')](_0x2a8a3b)[_0xe87c('0x1e')](function(_0x557dd1){return _0x557dd1;});}return null;};}function removeEntity(_0x19036a,_0x140750){return function(_0x35f70b){if(_0x35f70b){return _0x35f70b['destroy']()['then'](function(){_0x19036a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa67a,_0x4a6c62){return function(_0x1344fc){if(!_0x1344fc){_0x3fa67a['sendStatus'](0x194);}return _0x1344fc;};}function handleError(_0x79742f,_0x3188a3){_0x3188a3=_0x3188a3||0x1f4;return function(_0x26010b){logger['error'](_0x26010b[_0xe87c('0x32')]);if(_0x26010b[_0xe87c('0x33')]){delete _0x26010b[_0xe87c('0x33')];}_0x79742f[_0xe87c('0x2b')](_0x3188a3)[_0xe87c('0x34')](_0x26010b);};}exports[_0xe87c('0x35')]=function(_0x1e3c0b,_0x493de3){var _0x1d12aa={},_0x3a4429={},_0x35c7d5={'count':0x0,'rows':[]};var _0x35e3ba=_['map'](db[_0xe87c('0x36')][_0xe87c('0x37')],function(_0x1bddd3){return{'name':_0x1bddd3[_0xe87c('0x38')],'type':_0x1bddd3[_0xe87c('0x39')][_0xe87c('0x3a')]};});_0x3a4429[_0xe87c('0x3b')]=_[_0xe87c('0x3c')](_0x35e3ba,'name');_0x3a4429[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x1e3c0b[_0xe87c('0x3d')]);_0x3a4429[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x3a4429[_0xe87c('0x3b')],_0x3a4429[_0xe87c('0x3d')]);_0x1d12aa[_0xe87c('0x41')]=_['intersection'](_0x3a4429['model'],qs[_0xe87c('0x42')](_0x1e3c0b[_0xe87c('0x3d')][_0xe87c('0x42')]));_0x1d12aa[_0xe87c('0x41')]=_0x1d12aa[_0xe87c('0x41')][_0xe87c('0x43')]?_0x1d12aa['attributes']:_0x3a4429[_0xe87c('0x3b')];if(!_0x1e3c0b[_0xe87c('0x3d')]['hasOwnProperty'](_0xe87c('0x44'))){_0x1d12aa[_0xe87c('0x45')]=qs['limit'](_0x1e3c0b[_0xe87c('0x3d')]['limit']);_0x1d12aa[_0xe87c('0x2d')]=qs[_0xe87c('0x2d')](_0x1e3c0b['query']['offset']);}_0x1d12aa[_0xe87c('0x46')]=qs[_0xe87c('0x47')](_0x1e3c0b[_0xe87c('0x3d')]['sort']);_0x1d12aa[_0xe87c('0x48')]=qs[_0xe87c('0x3f')](_[_0xe87c('0x49')](_0x1e3c0b[_0xe87c('0x3d')],_0x3a4429[_0xe87c('0x3f')]));if(_0x1e3c0b[_0xe87c('0x3d')]['filter']){_0x1d12aa[_0xe87c('0x48')]=_[_0xe87c('0x4a')](_0x1d12aa[_0xe87c('0x48')],{'$or':_[_0xe87c('0x3c')](_0x35e3ba,function(_0x19c775){if(_0x19c775['type']!==_0xe87c('0x4b')){var _0x2a0a4d={};_0x2a0a4d[_0x19c775[_0xe87c('0x33')]]={'$like':'%'+_0x1e3c0b[_0xe87c('0x3d')]['filter']+'%'};return _0x2a0a4d;}})});}_0x1d12aa=_[_0xe87c('0x4a')]({},_0x1d12aa,_0x1e3c0b[_0xe87c('0x4c')]);var _0x28ea78={'where':_0x1d12aa['where']};return db[_0xe87c('0x36')]['count'](_0x28ea78)['then'](function(_0x58c219){_0x35c7d5[_0xe87c('0x2c')]=_0x58c219;if(_0x1e3c0b['query'][_0xe87c('0x4d')]){_0x1d12aa[_0xe87c('0x4e')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xe87c('0x4f')](_0x1d12aa);})[_0xe87c('0x1e')](function(_0x603cbb){_0x35c7d5['rows']=_0x603cbb;return _0x35c7d5;})['then'](respondWithFilteredResult(_0x493de3,_0x1d12aa))[_0xe87c('0x28')](handleError(_0x493de3,null));};exports['show']=function(_0x1a0360,_0x4ba915){var _0x1937a1={'raw':![],'where':{'id':_0x1a0360[_0xe87c('0x50')]['id']}},_0x2dc76b={};_0x2dc76b[_0xe87c('0x3b')]=_[_0xe87c('0x3e')](db[_0xe87c('0x36')][_0xe87c('0x37')]);_0x2dc76b['query']=_['keys'](_0x1a0360[_0xe87c('0x3d')]);_0x2dc76b[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x2dc76b[_0xe87c('0x3b')],_0x2dc76b[_0xe87c('0x3d')]);_0x1937a1['attributes']=_['intersection'](_0x2dc76b[_0xe87c('0x3b')],qs[_0xe87c('0x42')](_0x1a0360[_0xe87c('0x3d')][_0xe87c('0x42')]));_0x1937a1[_0xe87c('0x41')]=_0x1937a1[_0xe87c('0x41')][_0xe87c('0x43')]?_0x1937a1[_0xe87c('0x41')]:_0x2dc76b[_0xe87c('0x3b')];if(_0x1a0360['query'][_0xe87c('0x4d')]){_0x1937a1[_0xe87c('0x4e')]=[{'all':!![]}];}_0x1937a1=_[_0xe87c('0x4a')]({},_0x1937a1,_0x1a0360[_0xe87c('0x4c')]);return db['SugarcrmConfiguration']['find'](_0x1937a1)['then'](handleEntityNotFound(_0x4ba915,null))['then'](respondWithResult(_0x4ba915,null))[_0xe87c('0x28')](handleError(_0x4ba915,null));};exports['create']=function(_0x13ad0d,_0x4c3e99){return db[_0xe87c('0x36')][_0xe87c('0x51')](_0x13ad0d[_0xe87c('0x52')],{})[_0xe87c('0x1e')](respondWithResult(_0x4c3e99,0xc9))['catch'](handleError(_0x4c3e99,null));};exports[_0xe87c('0x31')]=function(_0x123f69,_0x4c7e04){if(_0x123f69['body']['id']){delete _0x123f69[_0xe87c('0x52')]['id'];}return db[_0xe87c('0x36')]['find']({'where':{'id':_0x123f69[_0xe87c('0x50')]['id']}})[_0xe87c('0x1e')](handleEntityNotFound(_0x4c7e04,null))[_0xe87c('0x1e')](saveUpdates(_0x123f69[_0xe87c('0x52')],null))[_0xe87c('0x1e')](respondWithResult(_0x4c7e04,null))[_0xe87c('0x28')](handleError(_0x4c7e04,null));};exports[_0xe87c('0x53')]=function(_0x31aaa1,_0x56c167){return db[_0xe87c('0x36')]['find']({'where':{'id':_0x31aaa1[_0xe87c('0x50')]['id']}})[_0xe87c('0x1e')](handleEntityNotFound(_0x56c167,null))[_0xe87c('0x1e')](removeEntity(_0x56c167,null))['catch'](handleError(_0x56c167,null));};exports['getFields']=function(_0x27e836,_0x31ff3c,_0x1e8f2b){var _0x1e8b0c={};var _0x3670d7={};var _0x5a91cf;var _0x2edbdd;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x27e836['params']['id']}})['then'](handleEntityNotFound(_0x31ff3c,null))['then'](function(_0x5a6bd2){if(_0x5a6bd2){_0x5a91cf=_0x5a6bd2;_0x3670d7['model']=_[_0xe87c('0x3e')](db[_0xe87c('0x54')][_0xe87c('0x37')]);_0x3670d7[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x27e836[_0xe87c('0x3d')]);_0x3670d7[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x3670d7[_0xe87c('0x3b')],_0x3670d7[_0xe87c('0x3d')]);_0x1e8b0c[_0xe87c('0x41')]=_['intersection'](_0x3670d7['model'],qs[_0xe87c('0x42')](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x42')]));_0x1e8b0c[_0xe87c('0x41')]=_0x1e8b0c['attributes'][_0xe87c('0x43')]?_0x1e8b0c[_0xe87c('0x41')]:_0x3670d7[_0xe87c('0x3b')];_0x1e8b0c['order']=qs['sort'](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x47')]);_0x1e8b0c['where']=qs['filters'](_[_0xe87c('0x49')](_0x27e836[_0xe87c('0x3d')],_0x3670d7[_0xe87c('0x3f')]));if(_0x27e836['query'][_0xe87c('0x55')]){_0x1e8b0c[_0xe87c('0x48')]=_[_0xe87c('0x4a')](_0x1e8b0c[_0xe87c('0x48')],{'$or':_[_0xe87c('0x3c')](_0x1e8b0c['attributes'],function(_0x59b78){var _0x491c93={};_0x491c93[_0x59b78]={'$like':'%'+_0x27e836[_0xe87c('0x3d')][_0xe87c('0x55')]+'%'};return _0x491c93;})});}_0x1e8b0c=_[_0xe87c('0x4a')]({},_0x1e8b0c,_0x27e836[_0xe87c('0x4c')]);return _0x5a91cf['getFields'](_0x1e8b0c);}})['then'](function(_0x268c84){if(_0x268c84){_0x2edbdd=_0x268c84['length'];if(!_0x27e836[_0xe87c('0x3d')][_0xe87c('0x56')](_0xe87c('0x44'))){_0x1e8b0c[_0xe87c('0x45')]=qs[_0xe87c('0x45')](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x45')]);_0x1e8b0c['offset']=qs[_0xe87c('0x2d')](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x2d')]);}return _0x5a91cf[_0xe87c('0x57')](_0x1e8b0c);}})[_0xe87c('0x1e')](function(_0x601e76){if(_0x601e76){return _0x601e76?{'count':_0x2edbdd,'rows':_0x601e76}:null;}})[_0xe87c('0x1e')](respondWithResult(_0x31ff3c,null))[_0xe87c('0x28')](handleError(_0x31ff3c,null));};exports['getSubjects']=function(_0x4459dc,_0x5d30b9,_0x3ed044){var _0x30c186={};var _0x43bd08={};var _0x21eaae;var _0x39dffa;return db[_0xe87c('0x36')]['findOne']({'where':{'id':_0x4459dc[_0xe87c('0x50')]['id']}})[_0xe87c('0x1e')](handleEntityNotFound(_0x5d30b9,null))[_0xe87c('0x1e')](function(_0x523f22){if(_0x523f22){_0x21eaae=_0x523f22;_0x43bd08[_0xe87c('0x3b')]=_['keys'](db[_0xe87c('0x54')]['rawAttributes']);_0x43bd08[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x4459dc[_0xe87c('0x3d')]);_0x43bd08[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x43bd08[_0xe87c('0x3b')],_0x43bd08[_0xe87c('0x3d')]);_0x30c186[_0xe87c('0x41')]=_['intersection'](_0x43bd08[_0xe87c('0x3b')],qs[_0xe87c('0x42')](_0x4459dc['query'][_0xe87c('0x42')]));_0x30c186[_0xe87c('0x41')]=_0x30c186['attributes'][_0xe87c('0x43')]?_0x30c186['attributes']:_0x43bd08[_0xe87c('0x3b')];_0x30c186[_0xe87c('0x46')]=qs[_0xe87c('0x47')](_0x4459dc['query'][_0xe87c('0x47')]);_0x30c186[_0xe87c('0x48')]=qs[_0xe87c('0x3f')](_[_0xe87c('0x49')](_0x4459dc[_0xe87c('0x3d')],_0x43bd08[_0xe87c('0x3f')]));if(_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x55')]){_0x30c186[_0xe87c('0x48')]=_[_0xe87c('0x4a')](_0x30c186[_0xe87c('0x48')],{'$or':_['map'](_0x30c186['attributes'],function(_0x1c66f9){var _0x5b7dad={};_0x5b7dad[_0x1c66f9]={'$like':'%'+_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x55')]+'%'};return _0x5b7dad;})});}_0x30c186=_[_0xe87c('0x4a')]({},_0x30c186,_0x4459dc[_0xe87c('0x4c')]);return _0x21eaae[_0xe87c('0x58')](_0x30c186);}})['then'](function(_0x3b3e36){if(_0x3b3e36){_0x39dffa=_0x3b3e36[_0xe87c('0x43')];if(!_0x4459dc[_0xe87c('0x3d')]['hasOwnProperty'](_0xe87c('0x44'))){_0x30c186[_0xe87c('0x45')]=qs['limit'](_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x45')]);_0x30c186[_0xe87c('0x2d')]=qs['offset'](_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x2d')]);}return _0x21eaae[_0xe87c('0x58')](_0x30c186);}})[_0xe87c('0x1e')](function(_0x3ce1ac){if(_0x3ce1ac){return _0x3ce1ac?{'count':_0x39dffa,'rows':_0x3ce1ac}:null;}})[_0xe87c('0x1e')](respondWithResult(_0x5d30b9,null))['catch'](handleError(_0x5d30b9,null));};exports[_0xe87c('0x59')]=function(_0x5006f4,_0x5e73b0,_0x362bd1){var _0x4c9d21={};var _0x41fd40={};var _0x5eecee;var _0x57cdf1;return db['SugarcrmConfiguration'][_0xe87c('0x5a')]({'where':{'id':_0x5006f4[_0xe87c('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e73b0,null))[_0xe87c('0x1e')](function(_0x4a6b0e){if(_0x4a6b0e){_0x5eecee=_0x4a6b0e;_0x41fd40[_0xe87c('0x3b')]=_[_0xe87c('0x3e')](db[_0xe87c('0x54')][_0xe87c('0x37')]);_0x41fd40[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x5006f4[_0xe87c('0x3d')]);_0x41fd40[_0xe87c('0x3f')]=_['intersection'](_0x41fd40[_0xe87c('0x3b')],_0x41fd40[_0xe87c('0x3d')]);_0x4c9d21[_0xe87c('0x41')]=_[_0xe87c('0x40')](_0x41fd40[_0xe87c('0x3b')],qs[_0xe87c('0x42')](_0x5006f4['query']['fields']));_0x4c9d21[_0xe87c('0x41')]=_0x4c9d21['attributes']['length']?_0x4c9d21[_0xe87c('0x41')]:_0x41fd40[_0xe87c('0x3b')];_0x4c9d21[_0xe87c('0x46')]=qs[_0xe87c('0x47')](_0x5006f4[_0xe87c('0x3d')][_0xe87c('0x47')]);_0x4c9d21[_0xe87c('0x48')]=qs[_0xe87c('0x3f')](_[_0xe87c('0x49')](_0x5006f4[_0xe87c('0x3d')],_0x41fd40[_0xe87c('0x3f')]));if(_0x5006f4[_0xe87c('0x3d')]['filter']){_0x4c9d21[_0xe87c('0x48')]=_['merge'](_0x4c9d21['where'],{'$or':_[_0xe87c('0x3c')](_0x4c9d21['attributes'],function(_0x4a2fe8){var _0x83ca36={};_0x83ca36[_0x4a2fe8]={'$like':'%'+_0x5006f4['query'][_0xe87c('0x55')]+'%'};return _0x83ca36;})});}_0x4c9d21=_[_0xe87c('0x4a')]({},_0x4c9d21,_0x5006f4[_0xe87c('0x4c')]);return _0x5eecee['getDescriptions'](_0x4c9d21);}})['then'](function(_0x45bfd0){if(_0x45bfd0){_0x57cdf1=_0x45bfd0[_0xe87c('0x43')];if(!_0x5006f4[_0xe87c('0x3d')]['hasOwnProperty']('nolimit')){_0x4c9d21[_0xe87c('0x45')]=qs[_0xe87c('0x45')](_0x5006f4[_0xe87c('0x3d')][_0xe87c('0x45')]);_0x4c9d21[_0xe87c('0x2d')]=qs[_0xe87c('0x2d')](_0x5006f4[_0xe87c('0x3d')]['offset']);}return _0x5eecee[_0xe87c('0x59')](_0x4c9d21);}})[_0xe87c('0x1e')](function(_0x1922fa){if(_0x1922fa){return _0x1922fa?{'count':_0x57cdf1,'rows':_0x1922fa}:null;}})['then'](respondWithResult(_0x5e73b0,null))[_0xe87c('0x28')](handleError(_0x5e73b0,null));}; \ No newline at end of file +var _0x03d8=['options','find','create','body','update','params','getFields','findOne','pick','nolimit','getSubjects','SugarcrmField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','offset','limit','set','reject','save','destroy','stack','name','send','index','SugarcrmConfiguration','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','includeAll','findAll','rows','catch','show','keys','rawAttributes','length','include'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x03d8,0x189));var _0x803d=function(_0x30d168,_0x4973a8){_0x30d168=_0x30d168-0x0;var _0x12d723=_0x03d8[_0x30d168];return _0x12d723;};'use strict';var pdf=require(_0x803d('0x0'));var emlformat=require(_0x803d('0x1'));var rimraf=require(_0x803d('0x2'));var zipdir=require(_0x803d('0x3'));var jsonpatch=require(_0x803d('0x4'));var rp=require(_0x803d('0x5'));var moment=require(_0x803d('0x6'));var BPromise=require(_0x803d('0x7'));var Mustache=require('mustache');var util=require(_0x803d('0x8'));var path=require('path');var sox=require(_0x803d('0x9'));var csv=require('to-csv');var ejs=require(_0x803d('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x803d('0xb'));var crypto=require(_0x803d('0xc'));var jsforce=require(_0x803d('0xd'));var deskjs=require(_0x803d('0xe'));var toCsv=require(_0x803d('0xf'));var querystring=require(_0x803d('0x10'));var Papa=require(_0x803d('0x11'));var Redis=require(_0x803d('0x12'));var authService=require(_0x803d('0x13'));var qs=require(_0x803d('0x14'));var as=require(_0x803d('0x15'));var hardwareService=require(_0x803d('0x16'));var logger=require(_0x803d('0x17'))(_0x803d('0x18'));var utils=require(_0x803d('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x803d('0x1a'));var client=jayson['client'][_0x803d('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x33534a,_0x12f464,_0x16c82a){if(_0x16c82a){var _0x5a8a13=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a8a13[_0x803d('0x1c')](_0x12f464)){return _0x33534a;}else{throw new db[(_0x803d('0x1d'))][(_0x803d('0x1e'))](_0x803d('0x1f'));}}else{return _0x33534a;}}function respondWithRpcPromise(_0x3ea114,_0x121326,_0x2e955f,_0x54d0d7){return new BPromise(function(_0x5d60f5,_0x492f08){var _0x13cd19=_0x54d0d7||client;return _0x13cd19[_0x803d('0x20')](_0x3ea114,_0x2e955f)[_0x803d('0x21')](function(_0x547393){logger['info'](_0x803d('0x22'),_0x121326,_0x803d('0x23'));logger['debug'](_0x803d('0x24'),_0x121326,'request\x20sent',JSON[_0x803d('0x25')](_0x547393));if(_0x547393['error']){if(_0x547393[_0x803d('0x26')][_0x803d('0x27')]===0x1f4){logger[_0x803d('0x26')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x121326,_0x547393[_0x803d('0x26')][_0x803d('0x28')]);return _0x492f08(_0x547393[_0x803d('0x26')]['message']);}logger[_0x803d('0x26')](_0x803d('0x22'),_0x121326,_0x547393[_0x803d('0x26')][_0x803d('0x28')]);return _0x5d60f5(_0x547393[_0x803d('0x26')][_0x803d('0x28')]);}else{logger['info'](_0x803d('0x22'),_0x121326,'request\x20sent');_0x5d60f5(_0x547393[_0x803d('0x29')][_0x803d('0x28')]);}})['catch'](function(_0x14e4b8){logger[_0x803d('0x26')](_0x803d('0x22'),_0x121326,_0x14e4b8);_0x492f08(_0x14e4b8);});});}function respondWithStatusCode(_0x4e4a01,_0x1ae192){_0x1ae192=_0x1ae192||0xcc;return function(_0x1d8eb0){if(_0x1d8eb0){return _0x4e4a01[_0x803d('0x2a')](_0x1ae192);}return _0x4e4a01['status'](_0x1ae192)[_0x803d('0x2b')]();};}function respondWithResult(_0x399de4,_0x1b1307){_0x1b1307=_0x1b1307||0xc8;return function(_0x321d17){if(_0x321d17){return _0x399de4[_0x803d('0x2c')](_0x1b1307)[_0x803d('0x2d')](_0x321d17);}};}function respondWithFilteredResult(_0x1aadea,_0x23a347){return function(_0x4ace87){if(_0x4ace87){var _0x1d4c75=_0x4ace87[_0x803d('0x2e')],_0x14d7ce=_0x23a347[_0x803d('0x2f')],_0x1da863=_0x23a347[_0x803d('0x2f')]+_0x23a347[_0x803d('0x30')],_0x553d29;if(_0x1da863>=_0x1d4c75){_0x1da863=_0x1d4c75;_0x553d29=0xc8;}else{_0x553d29=0xce;}_0x1aadea[_0x803d('0x2c')](_0x553d29);return _0x1aadea[_0x803d('0x31')]('Content-Range',_0x14d7ce+'-'+_0x1da863+'/'+_0x1d4c75)[_0x803d('0x2d')](_0x4ace87);}return null;};}function patchUpdates(_0x265b06){return function(_0x4a0ee){try{jsonpatch['apply'](_0x4a0ee,_0x265b06,!![]);}catch(_0x13fc2c){return BPromise[_0x803d('0x32')](_0x13fc2c);}return _0x4a0ee[_0x803d('0x33')]();};}function saveUpdates(_0x1c2911,_0x281687){return function(_0x4f6a93){if(_0x4f6a93){return _0x4f6a93['update'](_0x1c2911)[_0x803d('0x21')](function(_0x1db442){return _0x1db442;});}return null;};}function removeEntity(_0x3b28c3,_0x2b1e66){return function(_0x2f8555){if(_0x2f8555){return _0x2f8555[_0x803d('0x34')]()['then'](function(){_0x3b28c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x53deb5,_0x1e9797){return function(_0x5d044e){if(!_0x5d044e){_0x53deb5['sendStatus'](0x194);}return _0x5d044e;};}function handleError(_0xb374a0,_0x4dce7a){_0x4dce7a=_0x4dce7a||0x1f4;return function(_0x3bbc5b){logger[_0x803d('0x26')](_0x3bbc5b[_0x803d('0x35')]);if(_0x3bbc5b[_0x803d('0x36')]){delete _0x3bbc5b[_0x803d('0x36')];}_0xb374a0[_0x803d('0x2c')](_0x4dce7a)[_0x803d('0x37')](_0x3bbc5b);};}exports[_0x803d('0x38')]=function(_0x296d59,_0x3f64d2){var _0x3bcc9c={},_0x43a794={},_0x57fda8={'count':0x0,'rows':[]};var _0x4cea29=_['map'](db[_0x803d('0x39')]['rawAttributes'],function(_0x4e4876){return{'name':_0x4e4876['fieldName'],'type':_0x4e4876[_0x803d('0x3a')][_0x803d('0x3b')]};});_0x43a794[_0x803d('0x3c')]=_[_0x803d('0x3d')](_0x4cea29,_0x803d('0x36'));_0x43a794[_0x803d('0x3e')]=_['keys'](_0x296d59[_0x803d('0x3e')]);_0x43a794['filters']=_[_0x803d('0x3f')](_0x43a794[_0x803d('0x3c')],_0x43a794[_0x803d('0x3e')]);_0x3bcc9c[_0x803d('0x40')]=_[_0x803d('0x3f')](_0x43a794[_0x803d('0x3c')],qs['fields'](_0x296d59[_0x803d('0x3e')][_0x803d('0x41')]));_0x3bcc9c[_0x803d('0x40')]=_0x3bcc9c[_0x803d('0x40')]['length']?_0x3bcc9c[_0x803d('0x40')]:_0x43a794[_0x803d('0x3c')];if(!_0x296d59[_0x803d('0x3e')][_0x803d('0x42')]('nolimit')){_0x3bcc9c['limit']=qs[_0x803d('0x30')](_0x296d59[_0x803d('0x3e')]['limit']);_0x3bcc9c[_0x803d('0x2f')]=qs[_0x803d('0x2f')](_0x296d59[_0x803d('0x3e')]['offset']);}_0x3bcc9c[_0x803d('0x43')]=qs[_0x803d('0x44')](_0x296d59['query'][_0x803d('0x44')]);_0x3bcc9c[_0x803d('0x45')]=qs[_0x803d('0x46')](_['pick'](_0x296d59[_0x803d('0x3e')],_0x43a794[_0x803d('0x46')]));if(_0x296d59['query'][_0x803d('0x47')]){_0x3bcc9c[_0x803d('0x45')]=_[_0x803d('0x48')](_0x3bcc9c[_0x803d('0x45')],{'$or':_['map'](_0x4cea29,function(_0x2bbad8){if(_0x2bbad8['type']!=='VIRTUAL'){var _0x14813a={};_0x14813a[_0x2bbad8[_0x803d('0x36')]]={'$like':'%'+_0x296d59[_0x803d('0x3e')][_0x803d('0x47')]+'%'};return _0x14813a;}})});}_0x3bcc9c=_[_0x803d('0x48')]({},_0x3bcc9c,_0x296d59['options']);var _0x2c4099={'where':_0x3bcc9c[_0x803d('0x45')]};return db[_0x803d('0x39')][_0x803d('0x2e')](_0x2c4099)[_0x803d('0x21')](function(_0x53dd11){_0x57fda8[_0x803d('0x2e')]=_0x53dd11;if(_0x296d59[_0x803d('0x3e')][_0x803d('0x49')]){_0x3bcc9c['include']=[{'all':!![]}];}return db[_0x803d('0x39')][_0x803d('0x4a')](_0x3bcc9c);})[_0x803d('0x21')](function(_0x19fb36){_0x57fda8[_0x803d('0x4b')]=_0x19fb36;return _0x57fda8;})[_0x803d('0x21')](respondWithFilteredResult(_0x3f64d2,_0x3bcc9c))[_0x803d('0x4c')](handleError(_0x3f64d2,null));};exports[_0x803d('0x4d')]=function(_0x48fcfb,_0x3b1cf3){var _0x3aa802={'raw':![],'where':{'id':_0x48fcfb['params']['id']}},_0x1949f6={};_0x1949f6[_0x803d('0x3c')]=_[_0x803d('0x4e')](db[_0x803d('0x39')][_0x803d('0x4f')]);_0x1949f6[_0x803d('0x3e')]=_['keys'](_0x48fcfb[_0x803d('0x3e')]);_0x1949f6['filters']=_[_0x803d('0x3f')](_0x1949f6[_0x803d('0x3c')],_0x1949f6[_0x803d('0x3e')]);_0x3aa802[_0x803d('0x40')]=_[_0x803d('0x3f')](_0x1949f6[_0x803d('0x3c')],qs[_0x803d('0x41')](_0x48fcfb[_0x803d('0x3e')][_0x803d('0x41')]));_0x3aa802[_0x803d('0x40')]=_0x3aa802[_0x803d('0x40')][_0x803d('0x50')]?_0x3aa802['attributes']:_0x1949f6[_0x803d('0x3c')];if(_0x48fcfb['query'][_0x803d('0x49')]){_0x3aa802[_0x803d('0x51')]=[{'all':!![]}];}_0x3aa802=_[_0x803d('0x48')]({},_0x3aa802,_0x48fcfb[_0x803d('0x52')]);return db[_0x803d('0x39')][_0x803d('0x53')](_0x3aa802)['then'](handleEntityNotFound(_0x3b1cf3,null))[_0x803d('0x21')](respondWithResult(_0x3b1cf3,null))[_0x803d('0x4c')](handleError(_0x3b1cf3,null));};exports[_0x803d('0x54')]=function(_0x3d4a4c,_0x3944a8){return db[_0x803d('0x39')][_0x803d('0x54')](_0x3d4a4c[_0x803d('0x55')],{})[_0x803d('0x21')](respondWithResult(_0x3944a8,0xc9))[_0x803d('0x4c')](handleError(_0x3944a8,null));};exports[_0x803d('0x56')]=function(_0x3c7bf2,_0x150917){if(_0x3c7bf2['body']['id']){delete _0x3c7bf2['body']['id'];}return db[_0x803d('0x39')][_0x803d('0x53')]({'where':{'id':_0x3c7bf2[_0x803d('0x57')]['id']}})['then'](handleEntityNotFound(_0x150917,null))[_0x803d('0x21')](saveUpdates(_0x3c7bf2['body'],null))[_0x803d('0x21')](respondWithResult(_0x150917,null))['catch'](handleError(_0x150917,null));};exports['destroy']=function(_0x5710ef,_0x57587a){return db['SugarcrmConfiguration'][_0x803d('0x53')]({'where':{'id':_0x5710ef[_0x803d('0x57')]['id']}})[_0x803d('0x21')](handleEntityNotFound(_0x57587a,null))[_0x803d('0x21')](removeEntity(_0x57587a,null))[_0x803d('0x4c')](handleError(_0x57587a,null));};exports[_0x803d('0x58')]=function(_0x5536e4,_0x198720,_0x329b11){var _0x3b2e8a={};var _0x3c6305={};var _0x42b5e7;var _0x47f117;return db['SugarcrmConfiguration'][_0x803d('0x59')]({'where':{'id':_0x5536e4['params']['id']}})[_0x803d('0x21')](handleEntityNotFound(_0x198720,null))['then'](function(_0x5786dc){if(_0x5786dc){_0x42b5e7=_0x5786dc;_0x3c6305[_0x803d('0x3c')]=_['keys'](db['SugarcrmField'][_0x803d('0x4f')]);_0x3c6305[_0x803d('0x3e')]=_[_0x803d('0x4e')](_0x5536e4[_0x803d('0x3e')]);_0x3c6305[_0x803d('0x46')]=_['intersection'](_0x3c6305[_0x803d('0x3c')],_0x3c6305[_0x803d('0x3e')]);_0x3b2e8a[_0x803d('0x40')]=_[_0x803d('0x3f')](_0x3c6305[_0x803d('0x3c')],qs['fields'](_0x5536e4[_0x803d('0x3e')]['fields']));_0x3b2e8a['attributes']=_0x3b2e8a[_0x803d('0x40')][_0x803d('0x50')]?_0x3b2e8a[_0x803d('0x40')]:_0x3c6305['model'];_0x3b2e8a[_0x803d('0x43')]=qs[_0x803d('0x44')](_0x5536e4[_0x803d('0x3e')]['sort']);_0x3b2e8a['where']=qs['filters'](_[_0x803d('0x5a')](_0x5536e4[_0x803d('0x3e')],_0x3c6305[_0x803d('0x46')]));if(_0x5536e4[_0x803d('0x3e')]['filter']){_0x3b2e8a[_0x803d('0x45')]=_[_0x803d('0x48')](_0x3b2e8a[_0x803d('0x45')],{'$or':_[_0x803d('0x3d')](_0x3b2e8a[_0x803d('0x40')],function(_0x45ac2a){var _0x8ee5b9={};_0x8ee5b9[_0x45ac2a]={'$like':'%'+_0x5536e4[_0x803d('0x3e')][_0x803d('0x47')]+'%'};return _0x8ee5b9;})});}_0x3b2e8a=_[_0x803d('0x48')]({},_0x3b2e8a,_0x5536e4['options']);return _0x42b5e7[_0x803d('0x58')](_0x3b2e8a);}})[_0x803d('0x21')](function(_0x54860a){if(_0x54860a){_0x47f117=_0x54860a['length'];if(!_0x5536e4[_0x803d('0x3e')]['hasOwnProperty'](_0x803d('0x5b'))){_0x3b2e8a[_0x803d('0x30')]=qs[_0x803d('0x30')](_0x5536e4[_0x803d('0x3e')][_0x803d('0x30')]);_0x3b2e8a['offset']=qs[_0x803d('0x2f')](_0x5536e4[_0x803d('0x3e')][_0x803d('0x2f')]);}return _0x42b5e7[_0x803d('0x58')](_0x3b2e8a);}})[_0x803d('0x21')](function(_0x5e813f){if(_0x5e813f){return _0x5e813f?{'count':_0x47f117,'rows':_0x5e813f}:null;}})[_0x803d('0x21')](respondWithResult(_0x198720,null))[_0x803d('0x4c')](handleError(_0x198720,null));};exports[_0x803d('0x5c')]=function(_0x1e3aac,_0x9734f7,_0x5d9efc){var _0x1560e8={};var _0x522d24={};var _0x3ba6a5;var _0x4d15e4;return db[_0x803d('0x39')][_0x803d('0x59')]({'where':{'id':_0x1e3aac[_0x803d('0x57')]['id']}})['then'](handleEntityNotFound(_0x9734f7,null))[_0x803d('0x21')](function(_0x2dbe48){if(_0x2dbe48){_0x3ba6a5=_0x2dbe48;_0x522d24[_0x803d('0x3c')]=_['keys'](db[_0x803d('0x5d')][_0x803d('0x4f')]);_0x522d24['query']=_['keys'](_0x1e3aac[_0x803d('0x3e')]);_0x522d24[_0x803d('0x46')]=_[_0x803d('0x3f')](_0x522d24[_0x803d('0x3c')],_0x522d24[_0x803d('0x3e')]);_0x1560e8[_0x803d('0x40')]=_[_0x803d('0x3f')](_0x522d24[_0x803d('0x3c')],qs[_0x803d('0x41')](_0x1e3aac[_0x803d('0x3e')]['fields']));_0x1560e8[_0x803d('0x40')]=_0x1560e8[_0x803d('0x40')][_0x803d('0x50')]?_0x1560e8[_0x803d('0x40')]:_0x522d24[_0x803d('0x3c')];_0x1560e8[_0x803d('0x43')]=qs[_0x803d('0x44')](_0x1e3aac[_0x803d('0x3e')][_0x803d('0x44')]);_0x1560e8['where']=qs[_0x803d('0x46')](_[_0x803d('0x5a')](_0x1e3aac[_0x803d('0x3e')],_0x522d24[_0x803d('0x46')]));if(_0x1e3aac[_0x803d('0x3e')][_0x803d('0x47')]){_0x1560e8[_0x803d('0x45')]=_[_0x803d('0x48')](_0x1560e8['where'],{'$or':_['map'](_0x1560e8[_0x803d('0x40')],function(_0x36f47c){var _0x4e8b21={};_0x4e8b21[_0x36f47c]={'$like':'%'+_0x1e3aac[_0x803d('0x3e')]['filter']+'%'};return _0x4e8b21;})});}_0x1560e8=_[_0x803d('0x48')]({},_0x1560e8,_0x1e3aac[_0x803d('0x52')]);return _0x3ba6a5[_0x803d('0x5c')](_0x1560e8);}})[_0x803d('0x21')](function(_0x3c7ffd){if(_0x3c7ffd){_0x4d15e4=_0x3c7ffd[_0x803d('0x50')];if(!_0x1e3aac[_0x803d('0x3e')][_0x803d('0x42')]('nolimit')){_0x1560e8[_0x803d('0x30')]=qs[_0x803d('0x30')](_0x1e3aac[_0x803d('0x3e')]['limit']);_0x1560e8[_0x803d('0x2f')]=qs[_0x803d('0x2f')](_0x1e3aac[_0x803d('0x3e')][_0x803d('0x2f')]);}return _0x3ba6a5['getSubjects'](_0x1560e8);}})['then'](function(_0x1c395e){if(_0x1c395e){return _0x1c395e?{'count':_0x4d15e4,'rows':_0x1c395e}:null;}})[_0x803d('0x21')](respondWithResult(_0x9734f7,null))[_0x803d('0x4c')](handleError(_0x9734f7,null));};exports[_0x803d('0x5e')]=function(_0x89a2d9,_0x468671,_0x4adc67){var _0xd6c88a={};var _0x3b4e79={};var _0x194579;var _0x285067;return db[_0x803d('0x39')][_0x803d('0x59')]({'where':{'id':_0x89a2d9[_0x803d('0x57')]['id']}})[_0x803d('0x21')](handleEntityNotFound(_0x468671,null))[_0x803d('0x21')](function(_0x44a42d){if(_0x44a42d){_0x194579=_0x44a42d;_0x3b4e79[_0x803d('0x3c')]=_['keys'](db['SugarcrmField'][_0x803d('0x4f')]);_0x3b4e79[_0x803d('0x3e')]=_['keys'](_0x89a2d9[_0x803d('0x3e')]);_0x3b4e79[_0x803d('0x46')]=_[_0x803d('0x3f')](_0x3b4e79['model'],_0x3b4e79[_0x803d('0x3e')]);_0xd6c88a[_0x803d('0x40')]=_['intersection'](_0x3b4e79[_0x803d('0x3c')],qs[_0x803d('0x41')](_0x89a2d9[_0x803d('0x3e')][_0x803d('0x41')]));_0xd6c88a[_0x803d('0x40')]=_0xd6c88a[_0x803d('0x40')][_0x803d('0x50')]?_0xd6c88a['attributes']:_0x3b4e79['model'];_0xd6c88a[_0x803d('0x43')]=qs[_0x803d('0x44')](_0x89a2d9[_0x803d('0x3e')]['sort']);_0xd6c88a[_0x803d('0x45')]=qs[_0x803d('0x46')](_[_0x803d('0x5a')](_0x89a2d9[_0x803d('0x3e')],_0x3b4e79[_0x803d('0x46')]));if(_0x89a2d9[_0x803d('0x3e')]['filter']){_0xd6c88a['where']=_[_0x803d('0x48')](_0xd6c88a[_0x803d('0x45')],{'$or':_[_0x803d('0x3d')](_0xd6c88a[_0x803d('0x40')],function(_0x2832cc){var _0x203dc2={};_0x203dc2[_0x2832cc]={'$like':'%'+_0x89a2d9[_0x803d('0x3e')][_0x803d('0x47')]+'%'};return _0x203dc2;})});}_0xd6c88a=_[_0x803d('0x48')]({},_0xd6c88a,_0x89a2d9[_0x803d('0x52')]);return _0x194579[_0x803d('0x5e')](_0xd6c88a);}})[_0x803d('0x21')](function(_0x2f5ee9){if(_0x2f5ee9){_0x285067=_0x2f5ee9[_0x803d('0x50')];if(!_0x89a2d9[_0x803d('0x3e')]['hasOwnProperty'](_0x803d('0x5b'))){_0xd6c88a['limit']=qs[_0x803d('0x30')](_0x89a2d9['query'][_0x803d('0x30')]);_0xd6c88a[_0x803d('0x2f')]=qs[_0x803d('0x2f')](_0x89a2d9['query']['offset']);}return _0x194579[_0x803d('0x5e')](_0xd6c88a);}})['then'](function(_0x35eab8){if(_0x35eab8){return _0x35eab8?{'count':_0x285067,'rows':_0x35eab8}:null;}})[_0x803d('0x21')](respondWithResult(_0x468671,null))[_0x803d('0x4c')](handleError(_0x468671,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 4bdef4d..1906179 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 _0x543c=['api','moment','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','../../config/logger'];(function(_0x3fc5c7,_0x486a41){var _0x33fdb3=function(_0x5d7efd){while(--_0x5d7efd){_0x3fc5c7['push'](_0x3fc5c7['shift']());}};_0x33fdb3(++_0x486a41);}(_0x543c,0xbc));var _0xc543=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x543c[_0x27bd2c];return _0x3784ea;};'use strict';var _=require(_0xc543('0x0'));var util=require('util');var logger=require(_0xc543('0x1'))(_0xc543('0x2'));var moment=require(_0xc543('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc543('0x4'));var config=require(_0xc543('0x5'));var attributes=require(_0xc543('0x6'));module[_0xc543('0x7')]=function(_0x1020f9,_0x57447b){return _0x1020f9[_0xc543('0x8')](_0xc543('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0fb=['bluebird','request-promise','path','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','util','api','moment'];(function(_0x503be0,_0x254ab5){var _0x2300f6=function(_0x17c3c4){while(--_0x17c3c4){_0x503be0['push'](_0x503be0['shift']());}};_0x2300f6(++_0x254ab5);}(_0xb0fb,0x17c));var _0xbb0f=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xb0fb[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0xbb0f('0x0'));var util=require(_0xbb0f('0x1'));var logger=require('../../config/logger')(_0xbb0f('0x2'));var moment=require(_0xbb0f('0x3'));var BPromise=require(_0xbb0f('0x4'));var rp=require(_0xbb0f('0x5'));var fs=require('fs');var path=require(_0xbb0f('0x6'));var rimraf=require('rimraf');var config=require(_0xbb0f('0x7'));var attributes=require(_0xbb0f('0x8'));module[_0xbb0f('0x9')]=function(_0x1396e5,_0x15d72c){return _0x1396e5[_0xbb0f('0xa')](_0xbb0f('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','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 d4cb6e1..953f1af 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 _0xb89b=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xb89b,0x110));var _0xbb89=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xb89b[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require(_0xbb89('0x0'));var moment=require(_0xbb89('0x1'));var BPromise=require(_0xbb89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb89('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb89('0x4'));var logger=require(_0xbb89('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28cc96,_0x14d7e9,_0xa3a7a4){return new BPromise(function(_0xa5ab5f,_0x51ad7b){return client[_0xbb89('0x6')](_0x28cc96,_0xa3a7a4)[_0xbb89('0x7')](function(_0x4ff195){logger[_0xbb89('0x8')](_0xbb89('0x9'),_0x14d7e9,_0xbb89('0xa'));logger[_0xbb89('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x14d7e9,_0xbb89('0xa'),JSON[_0xbb89('0xc')](_0x4ff195));if(_0x4ff195['error']){if(_0x4ff195[_0xbb89('0xd')][_0xbb89('0xe')]===0x1f4){logger[_0xbb89('0xd')](_0xbb89('0x9'),_0x14d7e9,_0x4ff195[_0xbb89('0xd')][_0xbb89('0xf')]);return _0x51ad7b(_0x4ff195[_0xbb89('0xd')][_0xbb89('0xf')]);}logger['error'](_0xbb89('0x9'),_0x14d7e9,_0x4ff195[_0xbb89('0xd')]['message']);return _0xa5ab5f(_0x4ff195[_0xbb89('0xd')][_0xbb89('0xf')]);}else{logger[_0xbb89('0x8')](_0xbb89('0x9'),_0x14d7e9,_0xbb89('0xa'));_0xa5ab5f(_0x4ff195['result'][_0xbb89('0xf')]);}})['catch'](function(_0x47c48e){logger['error'](_0xbb89('0x9'),_0x14d7e9,_0x47c48e);_0x51ad7b(_0x47c48e);});});} \ No newline at end of file +var _0xdb21=['rpc','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0xb36843,_0x57c1f4){var _0x227b83=function(_0x3bce6f){while(--_0x3bce6f){_0xb36843['push'](_0xb36843['shift']());}};_0x227b83(++_0x57c1f4);}(_0xdb21,0xad));var _0x1db2=function(_0x1591f7,_0x5aedd6){_0x1591f7=_0x1591f7-0x0;var _0x4e1517=_0xdb21[_0x1591f7];return _0x4e1517;};'use strict';var _=require(_0x1db2('0x0'));var util=require(_0x1db2('0x1'));var moment=require(_0x1db2('0x2'));var BPromise=require(_0x1db2('0x3'));var rs=require(_0x1db2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1db2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1db2('0x6'))(_0x1db2('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1db2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x99f182,_0x262c93,_0x192585){return new BPromise(function(_0x293547,_0x1e979d){return client[_0x1db2('0x9')](_0x99f182,_0x192585)[_0x1db2('0xa')](function(_0x5fe247){logger[_0x1db2('0xb')](_0x1db2('0xc'),_0x262c93,_0x1db2('0xd'));logger[_0x1db2('0xe')](_0x1db2('0xf'),_0x262c93,'request\x20sent',JSON[_0x1db2('0x10')](_0x5fe247));if(_0x5fe247[_0x1db2('0x11')]){if(_0x5fe247[_0x1db2('0x11')][_0x1db2('0x12')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x262c93,_0x5fe247[_0x1db2('0x11')][_0x1db2('0x13')]);return _0x1e979d(_0x5fe247[_0x1db2('0x11')][_0x1db2('0x13')]);}logger[_0x1db2('0x11')](_0x1db2('0xc'),_0x262c93,_0x5fe247[_0x1db2('0x11')][_0x1db2('0x13')]);return _0x293547(_0x5fe247['error'][_0x1db2('0x13')]);}else{logger['info'](_0x1db2('0xc'),_0x262c93,'request\x20sent');_0x293547(_0x5fe247['result']['message']);}})['catch'](function(_0xdf8144){logger[_0x1db2('0x11')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x262c93,_0xdf8144);_0x1e979d(_0xdf8144);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 33834ce..cc13231 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 _0xe599=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x53c26d,_0x4ad64e){var _0x5727d6=function(_0x3be8c5){while(--_0x3be8c5){_0x53c26d['push'](_0x53c26d['shift']());}};_0x5727d6(++_0x4ad64e);}(_0xe599,0x1c7));var _0x9e59=function(_0x2cce0d,_0x5ba415){_0x2cce0d=_0x2cce0d-0x0;var _0x1390eb=_0xe599[_0x2cce0d];return _0x1390eb;};'use strict';var multer=require('multer');var util=require(_0x9e59('0x0'));var path=require(_0x9e59('0x1'));var timeout=require(_0x9e59('0x2'));var express=require(_0x9e59('0x3'));var router=express[_0x9e59('0x4')]();var auth=require(_0x9e59('0x5'));var interaction=require(_0x9e59('0x6'));var config=require(_0x9e59('0x7'));var controller=require(_0x9e59('0x8'));router['get']('/',auth[_0x9e59('0x9')](),controller[_0x9e59('0xa')]);router[_0x9e59('0xb')](_0x9e59('0xc'),auth[_0x9e59('0x9')](),controller[_0x9e59('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9e59('0xe')]);router[_0x9e59('0xf')]('/:id',auth[_0x9e59('0x9')](),controller[_0x9e59('0x10')]);router[_0x9e59('0x11')](_0x9e59('0xc'),auth[_0x9e59('0x9')](),controller[_0x9e59('0x12')]);module[_0x9e59('0x13')]=router; \ No newline at end of file +var _0x1f24=['./intSugarcrmField.controller','get','index','isAuthenticated','show','post','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0x1f24,0xa4));var _0x41f2=function(_0x2e09d1,_0x280e27){_0x2e09d1=_0x2e09d1-0x0;var _0x596010=_0x1f24[_0x2e09d1];return _0x596010;};'use strict';var multer=require(_0x41f2('0x0'));var util=require(_0x41f2('0x1'));var path=require('path');var timeout=require(_0x41f2('0x2'));var express=require(_0x41f2('0x3'));var router=express[_0x41f2('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x41f2('0x5'));var controller=require(_0x41f2('0x6'));router[_0x41f2('0x7')]('/',auth['isAuthenticated'](),controller[_0x41f2('0x8')]);router['get']('/:id',auth[_0x41f2('0x9')](),controller[_0x41f2('0xa')]);router[_0x41f2('0xb')]('/',auth[_0x41f2('0x9')](),controller[_0x41f2('0xc')]);router[_0x41f2('0xd')]('/:id',auth[_0x41f2('0x9')](),controller['update']);router['delete'](_0x41f2('0xe'),auth[_0x41f2('0x9')](),controller[_0x41f2('0xf')]);module[_0x41f2('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 c721e8d..e5fa1d5 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 _0x5089=['keyValue','STRING','sequelize','exports','string','variable','customVariable'];(function(_0x10058a,_0x20e7aa){var _0x39f8b4=function(_0x1762a1){while(--_0x1762a1){_0x10058a['push'](_0x10058a['shift']());}};_0x39f8b4(++_0x20e7aa);}(_0x5089,0x1bb));var _0x9508=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x5089[_0x13594e];return _0x1a4f42;};'use strict';var Sequelize=require(_0x9508('0x0'));module[_0x9508('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9508('0x2'),_0x9508('0x3'),_0x9508('0x4'),_0x9508('0x5')),'defaultValue':_0x9508('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9508('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x9508('0x2'),_0x9508('0x3'),_0x9508('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9508('0x6')]},'nameField':{'type':Sequelize[_0x9508('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9508('0x6')]}}; \ No newline at end of file +var _0x7e63=['customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','variable'];(function(_0x4609c2,_0x1256c9){var _0x559388=function(_0x5d60b3){while(--_0x5d60b3){_0x4609c2['push'](_0x4609c2['shift']());}};_0x559388(++_0x1256c9);}(_0x7e63,0x74));var _0x37e6=function(_0x569e05,_0x35ac90){_0x569e05=_0x569e05-0x0;var _0x54561e=_0x7e63[_0x569e05];return _0x54561e;};'use strict';var Sequelize=require(_0x37e6('0x0'));module[_0x37e6('0x1')]={'type':{'type':Sequelize[_0x37e6('0x2')]('string',_0x37e6('0x3'),_0x37e6('0x4'),_0x37e6('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x37e6('0x6')]},'key':{'type':Sequelize[_0x37e6('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0x37e6('0x3'),_0x37e6('0x4'))},'keyContent':{'type':Sequelize[_0x37e6('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x37e6('0x6')]},'customField':{'type':Sequelize[_0x37e6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 7d6e2f0..2789ace 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 _0x3d46=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmField','type','model','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x3d46,0x1ad));var _0x63d4=function(_0x4844ec,_0x9e079b){_0x4844ec=_0x4844ec-0x0;var _0x1aa0c4=_0x3d46[_0x4844ec];return _0x1aa0c4;};'use strict';var pdf=require(_0x63d4('0x0'));var emlformat=require(_0x63d4('0x1'));var rimraf=require(_0x63d4('0x2'));var zipdir=require(_0x63d4('0x3'));var jsonpatch=require(_0x63d4('0x4'));var rp=require('request-promise');var moment=require(_0x63d4('0x5'));var BPromise=require(_0x63d4('0x6'));var Mustache=require(_0x63d4('0x7'));var util=require('util');var path=require(_0x63d4('0x8'));var sox=require(_0x63d4('0x9'));var csv=require(_0x63d4('0xa'));var ejs=require(_0x63d4('0xb'));var fs=require('fs');var _=require(_0x63d4('0xc'));var squel=require('squel');var crypto=require(_0x63d4('0xd'));var jsforce=require(_0x63d4('0xe'));var deskjs=require(_0x63d4('0xf'));var toCsv=require(_0x63d4('0xa'));var querystring=require(_0x63d4('0x10'));var Papa=require(_0x63d4('0x11'));var Redis=require(_0x63d4('0x12'));var authService=require(_0x63d4('0x13'));var qs=require(_0x63d4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63d4('0x15'));var logger=require(_0x63d4('0x16'))(_0x63d4('0x17'));var utils=require(_0x63d4('0x18'));var config=require(_0x63d4('0x19'));var db=require(_0x63d4('0x1a'))['db'];function respondWithStatusCode(_0x3fea84,_0x3e9e46){_0x3e9e46=_0x3e9e46||0xcc;return function(_0x133989){if(_0x133989){return _0x3fea84['sendStatus'](_0x3e9e46);}return _0x3fea84[_0x63d4('0x1b')](_0x3e9e46)['end']();};}function respondWithResult(_0x156f40,_0x2c0884){_0x2c0884=_0x2c0884||0xc8;return function(_0x9ec620){if(_0x9ec620){return _0x156f40[_0x63d4('0x1b')](_0x2c0884)[_0x63d4('0x1c')](_0x9ec620);}};}function respondWithFilteredResult(_0x3c4cc1,_0x2e6a50){return function(_0x4d1dfc){if(_0x4d1dfc){var _0x30a3f4=_0x4d1dfc[_0x63d4('0x1d')],_0x297b7f=_0x2e6a50[_0x63d4('0x1e')],_0x37ac23=_0x2e6a50[_0x63d4('0x1e')]+_0x2e6a50[_0x63d4('0x1f')],_0x178d43;if(_0x37ac23>=_0x30a3f4){_0x37ac23=_0x30a3f4;_0x178d43=0xc8;}else{_0x178d43=0xce;}_0x3c4cc1['status'](_0x178d43);return _0x3c4cc1[_0x63d4('0x20')](_0x63d4('0x21'),_0x297b7f+'-'+_0x37ac23+'/'+_0x30a3f4)['json'](_0x4d1dfc);}return null;};}function patchUpdates(_0x17edc4){return function(_0x2afa6c){try{jsonpatch[_0x63d4('0x22')](_0x2afa6c,_0x17edc4,!![]);}catch(_0x41d686){return BPromise[_0x63d4('0x23')](_0x41d686);}return _0x2afa6c[_0x63d4('0x24')]();};}function saveUpdates(_0xb7e798,_0x5868ed){return function(_0x4f09c9){if(_0x4f09c9){return _0x4f09c9[_0x63d4('0x25')](_0xb7e798)[_0x63d4('0x26')](function(_0x34cf67){return _0x34cf67;});}return null;};}function removeEntity(_0x2feb3a,_0x2ffade){return function(_0x4eb034){if(_0x4eb034){return _0x4eb034[_0x63d4('0x27')]()['then'](function(){_0x2feb3a[_0x63d4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d64b2,_0x3c3480){return function(_0x46765a){if(!_0x46765a){_0x1d64b2[_0x63d4('0x28')](0x194);}return _0x46765a;};}function handleError(_0x49a672,_0x378845){_0x378845=_0x378845||0x1f4;return function(_0x28950a){logger[_0x63d4('0x29')](_0x28950a[_0x63d4('0x2a')]);if(_0x28950a[_0x63d4('0x2b')]){delete _0x28950a[_0x63d4('0x2b')];}_0x49a672[_0x63d4('0x1b')](_0x378845)[_0x63d4('0x2c')](_0x28950a);};}exports[_0x63d4('0x2d')]=function(_0x25e41c,_0x45e0f4){var _0x2cbcaf={},_0x2fd542={},_0x20e2c4={'count':0x0,'rows':[]};var _0x13bf03=_[_0x63d4('0x2e')](db[_0x63d4('0x2f')]['rawAttributes'],function(_0x3ba772){return{'name':_0x3ba772['fieldName'],'type':_0x3ba772[_0x63d4('0x30')]['key']};});_0x2fd542[_0x63d4('0x31')]=_['map'](_0x13bf03,_0x63d4('0x2b'));_0x2fd542['query']=_[_0x63d4('0x32')](_0x25e41c['query']);_0x2fd542[_0x63d4('0x33')]=_['intersection'](_0x2fd542['model'],_0x2fd542[_0x63d4('0x34')]);_0x2cbcaf['attributes']=_[_0x63d4('0x35')](_0x2fd542[_0x63d4('0x31')],qs[_0x63d4('0x36')](_0x25e41c[_0x63d4('0x34')]['fields']));_0x2cbcaf[_0x63d4('0x37')]=_0x2cbcaf[_0x63d4('0x37')]['length']?_0x2cbcaf[_0x63d4('0x37')]:_0x2fd542[_0x63d4('0x31')];if(!_0x25e41c[_0x63d4('0x34')][_0x63d4('0x38')](_0x63d4('0x39'))){_0x2cbcaf[_0x63d4('0x1f')]=qs[_0x63d4('0x1f')](_0x25e41c['query']['limit']);_0x2cbcaf[_0x63d4('0x1e')]=qs[_0x63d4('0x1e')](_0x25e41c[_0x63d4('0x34')][_0x63d4('0x1e')]);}_0x2cbcaf[_0x63d4('0x3a')]=qs[_0x63d4('0x3b')](_0x25e41c[_0x63d4('0x34')][_0x63d4('0x3b')]);_0x2cbcaf[_0x63d4('0x3c')]=qs[_0x63d4('0x33')](_['pick'](_0x25e41c[_0x63d4('0x34')],_0x2fd542[_0x63d4('0x33')]));if(_0x25e41c[_0x63d4('0x34')][_0x63d4('0x3d')]){_0x2cbcaf['where']=_[_0x63d4('0x3e')](_0x2cbcaf[_0x63d4('0x3c')],{'$or':_[_0x63d4('0x2e')](_0x13bf03,function(_0x4ada03){if(_0x4ada03[_0x63d4('0x30')]!=='VIRTUAL'){var _0x3631f5={};_0x3631f5[_0x4ada03[_0x63d4('0x2b')]]={'$like':'%'+_0x25e41c['query'][_0x63d4('0x3d')]+'%'};return _0x3631f5;}})});}_0x2cbcaf=_['merge']({},_0x2cbcaf,_0x25e41c[_0x63d4('0x3f')]);var _0x4bda32={'where':_0x2cbcaf[_0x63d4('0x3c')]};return db[_0x63d4('0x2f')][_0x63d4('0x1d')](_0x4bda32)['then'](function(_0x102925){_0x20e2c4[_0x63d4('0x1d')]=_0x102925;if(_0x25e41c[_0x63d4('0x34')]['includeAll']){_0x2cbcaf['include']=[{'all':!![]}];}return db[_0x63d4('0x2f')][_0x63d4('0x40')](_0x2cbcaf);})[_0x63d4('0x26')](function(_0x41efb4){_0x20e2c4[_0x63d4('0x41')]=_0x41efb4;return _0x20e2c4;})[_0x63d4('0x26')](respondWithFilteredResult(_0x45e0f4,_0x2cbcaf))[_0x63d4('0x42')](handleError(_0x45e0f4,null));};exports[_0x63d4('0x43')]=function(_0x106def,_0x3cd58d){var _0x455527={'raw':!![],'where':{'id':_0x106def[_0x63d4('0x44')]['id']}},_0x377970={};_0x377970[_0x63d4('0x31')]=_['keys'](db[_0x63d4('0x2f')][_0x63d4('0x45')]);_0x377970[_0x63d4('0x34')]=_[_0x63d4('0x32')](_0x106def['query']);_0x377970['filters']=_[_0x63d4('0x35')](_0x377970[_0x63d4('0x31')],_0x377970[_0x63d4('0x34')]);_0x455527[_0x63d4('0x37')]=_['intersection'](_0x377970['model'],qs[_0x63d4('0x36')](_0x106def[_0x63d4('0x34')][_0x63d4('0x36')]));_0x455527['attributes']=_0x455527[_0x63d4('0x37')][_0x63d4('0x46')]?_0x455527[_0x63d4('0x37')]:_0x377970[_0x63d4('0x31')];if(_0x106def[_0x63d4('0x34')][_0x63d4('0x47')]){_0x455527[_0x63d4('0x48')]=[{'all':!![]}];}_0x455527=_[_0x63d4('0x3e')]({},_0x455527,_0x106def['options']);return db['SugarcrmField'][_0x63d4('0x49')](_0x455527)[_0x63d4('0x26')](handleEntityNotFound(_0x3cd58d,null))[_0x63d4('0x26')](respondWithResult(_0x3cd58d,null))['catch'](handleError(_0x3cd58d,null));};exports[_0x63d4('0x4a')]=function(_0x4ab8e1,_0x40ee96){return db[_0x63d4('0x2f')][_0x63d4('0x4a')](_0x4ab8e1[_0x63d4('0x4b')],{})[_0x63d4('0x26')](respondWithResult(_0x40ee96,0xc9))[_0x63d4('0x42')](handleError(_0x40ee96,null));};exports[_0x63d4('0x25')]=function(_0x50558e,_0x48051c){if(_0x50558e['body']['id']){delete _0x50558e[_0x63d4('0x4b')]['id'];}return db[_0x63d4('0x2f')][_0x63d4('0x49')]({'where':{'id':_0x50558e[_0x63d4('0x44')]['id']}})['then'](handleEntityNotFound(_0x48051c,null))[_0x63d4('0x26')](saveUpdates(_0x50558e[_0x63d4('0x4b')],null))[_0x63d4('0x26')](respondWithResult(_0x48051c,null))['catch'](handleError(_0x48051c,null));};exports[_0x63d4('0x27')]=function(_0x378ba4,_0x5f59e4){return db[_0x63d4('0x2f')][_0x63d4('0x49')]({'where':{'id':_0x378ba4[_0x63d4('0x44')]['id']}})[_0x63d4('0x26')](handleEntityNotFound(_0x5f59e4,null))[_0x63d4('0x26')](removeEntity(_0x5f59e4,null))[_0x63d4('0x42')](handleError(_0x5f59e4,null));}; \ No newline at end of file +var _0xea11=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','index','map','rawAttributes','fieldName','key','model','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','where','type','filter','merge','options','includeAll','SugarcrmField','findAll','rows','catch','params','length','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0x56e9fb,_0x11b179){var _0x3008a4=function(_0xaa7a00){while(--_0xaa7a00){_0x56e9fb['push'](_0x56e9fb['shift']());}};_0x3008a4(++_0x11b179);}(_0xea11,0x116));var _0x1ea1=function(_0x27ecd6,_0xe0c326){_0x27ecd6=_0x27ecd6-0x0;var _0x4ea2f5=_0xea11[_0x27ecd6];return _0x4ea2f5;};'use strict';var pdf=require(_0x1ea1('0x0'));var emlformat=require(_0x1ea1('0x1'));var rimraf=require(_0x1ea1('0x2'));var zipdir=require(_0x1ea1('0x3'));var jsonpatch=require(_0x1ea1('0x4'));var rp=require(_0x1ea1('0x5'));var moment=require('moment');var BPromise=require(_0x1ea1('0x6'));var Mustache=require(_0x1ea1('0x7'));var util=require(_0x1ea1('0x8'));var path=require(_0x1ea1('0x9'));var sox=require('sox');var csv=require(_0x1ea1('0xa'));var ejs=require(_0x1ea1('0xb'));var fs=require('fs');var _=require(_0x1ea1('0xc'));var squel=require(_0x1ea1('0xd'));var crypto=require(_0x1ea1('0xe'));var jsforce=require(_0x1ea1('0xf'));var deskjs=require(_0x1ea1('0x10'));var toCsv=require(_0x1ea1('0xa'));var querystring=require(_0x1ea1('0x11'));var Papa=require(_0x1ea1('0x12'));var Redis=require(_0x1ea1('0x13'));var authService=require(_0x1ea1('0x14'));var qs=require(_0x1ea1('0x15'));var as=require(_0x1ea1('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ea1('0x17'))('api');var utils=require(_0x1ea1('0x18'));var config=require('../../config/environment');var db=require(_0x1ea1('0x19'))['db'];function respondWithStatusCode(_0x1a954e,_0x4b3aa7){_0x4b3aa7=_0x4b3aa7||0xcc;return function(_0x93211b){if(_0x93211b){return _0x1a954e['sendStatus'](_0x4b3aa7);}return _0x1a954e[_0x1ea1('0x1a')](_0x4b3aa7)[_0x1ea1('0x1b')]();};}function respondWithResult(_0x2e979b,_0x4aef7c){_0x4aef7c=_0x4aef7c||0xc8;return function(_0x464488){if(_0x464488){return _0x2e979b[_0x1ea1('0x1a')](_0x4aef7c)[_0x1ea1('0x1c')](_0x464488);}};}function respondWithFilteredResult(_0x574c75,_0x4004c8){return function(_0x2cb557){if(_0x2cb557){var _0x4d8c21=_0x2cb557[_0x1ea1('0x1d')],_0x1ca6ea=_0x4004c8[_0x1ea1('0x1e')],_0x4d2956=_0x4004c8[_0x1ea1('0x1e')]+_0x4004c8[_0x1ea1('0x1f')],_0xeb3aac;if(_0x4d2956>=_0x4d8c21){_0x4d2956=_0x4d8c21;_0xeb3aac=0xc8;}else{_0xeb3aac=0xce;}_0x574c75[_0x1ea1('0x1a')](_0xeb3aac);return _0x574c75[_0x1ea1('0x20')](_0x1ea1('0x21'),_0x1ca6ea+'-'+_0x4d2956+'/'+_0x4d8c21)[_0x1ea1('0x1c')](_0x2cb557);}return null;};}function patchUpdates(_0x3c0052){return function(_0x483211){try{jsonpatch[_0x1ea1('0x22')](_0x483211,_0x3c0052,!![]);}catch(_0x419985){return BPromise[_0x1ea1('0x23')](_0x419985);}return _0x483211[_0x1ea1('0x24')]();};}function saveUpdates(_0x2aa1ab,_0x395a4d){return function(_0x233e5d){if(_0x233e5d){return _0x233e5d['update'](_0x2aa1ab)[_0x1ea1('0x25')](function(_0x80a84d){return _0x80a84d;});}return null;};}function removeEntity(_0x6052d5,_0x1441fc){return function(_0x85c7ab){if(_0x85c7ab){return _0x85c7ab[_0x1ea1('0x26')]()[_0x1ea1('0x25')](function(){_0x6052d5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd655e,_0x5a3477){return function(_0x3f1d7f){if(!_0x3f1d7f){_0xd655e[_0x1ea1('0x27')](0x194);}return _0x3f1d7f;};}function handleError(_0x1656af,_0x4eaf12){_0x4eaf12=_0x4eaf12||0x1f4;return function(_0x3495bf){logger[_0x1ea1('0x28')](_0x3495bf['stack']);if(_0x3495bf['name']){delete _0x3495bf['name'];}_0x1656af[_0x1ea1('0x1a')](_0x4eaf12)['send'](_0x3495bf);};}exports[_0x1ea1('0x29')]=function(_0x269572,_0x4c8f58){var _0x51e0bb={},_0x5693c7={},_0x78949d={'count':0x0,'rows':[]};var _0x23d793=_[_0x1ea1('0x2a')](db['SugarcrmField'][_0x1ea1('0x2b')],function(_0x328ea7){return{'name':_0x328ea7[_0x1ea1('0x2c')],'type':_0x328ea7['type'][_0x1ea1('0x2d')]};});_0x5693c7[_0x1ea1('0x2e')]=_['map'](_0x23d793,_0x1ea1('0x2f'));_0x5693c7[_0x1ea1('0x30')]=_[_0x1ea1('0x31')](_0x269572['query']);_0x5693c7['filters']=_[_0x1ea1('0x32')](_0x5693c7[_0x1ea1('0x2e')],_0x5693c7['query']);_0x51e0bb[_0x1ea1('0x33')]=_[_0x1ea1('0x32')](_0x5693c7['model'],qs[_0x1ea1('0x34')](_0x269572['query'][_0x1ea1('0x34')]));_0x51e0bb['attributes']=_0x51e0bb[_0x1ea1('0x33')]['length']?_0x51e0bb[_0x1ea1('0x33')]:_0x5693c7[_0x1ea1('0x2e')];if(!_0x269572[_0x1ea1('0x30')][_0x1ea1('0x35')](_0x1ea1('0x36'))){_0x51e0bb[_0x1ea1('0x1f')]=qs['limit'](_0x269572[_0x1ea1('0x30')]['limit']);_0x51e0bb[_0x1ea1('0x1e')]=qs[_0x1ea1('0x1e')](_0x269572[_0x1ea1('0x30')][_0x1ea1('0x1e')]);}_0x51e0bb['order']=qs[_0x1ea1('0x37')](_0x269572[_0x1ea1('0x30')][_0x1ea1('0x37')]);_0x51e0bb['where']=qs['filters'](_['pick'](_0x269572[_0x1ea1('0x30')],_0x5693c7[_0x1ea1('0x38')]));if(_0x269572[_0x1ea1('0x30')]['filter']){_0x51e0bb[_0x1ea1('0x39')]=_['merge'](_0x51e0bb['where'],{'$or':_[_0x1ea1('0x2a')](_0x23d793,function(_0x167b86){if(_0x167b86[_0x1ea1('0x3a')]!=='VIRTUAL'){var _0x4595d4={};_0x4595d4[_0x167b86['name']]={'$like':'%'+_0x269572[_0x1ea1('0x30')][_0x1ea1('0x3b')]+'%'};return _0x4595d4;}})});}_0x51e0bb=_[_0x1ea1('0x3c')]({},_0x51e0bb,_0x269572[_0x1ea1('0x3d')]);var _0x1a6fa6={'where':_0x51e0bb['where']};return db['SugarcrmField'][_0x1ea1('0x1d')](_0x1a6fa6)[_0x1ea1('0x25')](function(_0x24f24b){_0x78949d[_0x1ea1('0x1d')]=_0x24f24b;if(_0x269572[_0x1ea1('0x30')][_0x1ea1('0x3e')]){_0x51e0bb['include']=[{'all':!![]}];}return db[_0x1ea1('0x3f')][_0x1ea1('0x40')](_0x51e0bb);})['then'](function(_0x5bb374){_0x78949d[_0x1ea1('0x41')]=_0x5bb374;return _0x78949d;})[_0x1ea1('0x25')](respondWithFilteredResult(_0x4c8f58,_0x51e0bb))[_0x1ea1('0x42')](handleError(_0x4c8f58,null));};exports['show']=function(_0x75e7e6,_0x331e9a){var _0x5cc1ba={'raw':!![],'where':{'id':_0x75e7e6[_0x1ea1('0x43')]['id']}},_0x5c9b94={};_0x5c9b94['model']=_[_0x1ea1('0x31')](db['SugarcrmField'][_0x1ea1('0x2b')]);_0x5c9b94[_0x1ea1('0x30')]=_[_0x1ea1('0x31')](_0x75e7e6[_0x1ea1('0x30')]);_0x5c9b94['filters']=_[_0x1ea1('0x32')](_0x5c9b94['model'],_0x5c9b94[_0x1ea1('0x30')]);_0x5cc1ba[_0x1ea1('0x33')]=_['intersection'](_0x5c9b94['model'],qs[_0x1ea1('0x34')](_0x75e7e6[_0x1ea1('0x30')][_0x1ea1('0x34')]));_0x5cc1ba['attributes']=_0x5cc1ba['attributes'][_0x1ea1('0x44')]?_0x5cc1ba['attributes']:_0x5c9b94[_0x1ea1('0x2e')];if(_0x75e7e6[_0x1ea1('0x30')]['includeAll']){_0x5cc1ba[_0x1ea1('0x45')]=[{'all':!![]}];}_0x5cc1ba=_[_0x1ea1('0x3c')]({},_0x5cc1ba,_0x75e7e6[_0x1ea1('0x3d')]);return db[_0x1ea1('0x3f')][_0x1ea1('0x46')](_0x5cc1ba)[_0x1ea1('0x25')](handleEntityNotFound(_0x331e9a,null))[_0x1ea1('0x25')](respondWithResult(_0x331e9a,null))[_0x1ea1('0x42')](handleError(_0x331e9a,null));};exports[_0x1ea1('0x47')]=function(_0xb95b66,_0x4cf06c){return db[_0x1ea1('0x3f')][_0x1ea1('0x47')](_0xb95b66[_0x1ea1('0x48')],{})[_0x1ea1('0x25')](respondWithResult(_0x4cf06c,0xc9))[_0x1ea1('0x42')](handleError(_0x4cf06c,null));};exports['update']=function(_0x4b3478,_0x24f5e7){if(_0x4b3478[_0x1ea1('0x48')]['id']){delete _0x4b3478[_0x1ea1('0x48')]['id'];}return db[_0x1ea1('0x3f')][_0x1ea1('0x46')]({'where':{'id':_0x4b3478['params']['id']}})[_0x1ea1('0x25')](handleEntityNotFound(_0x24f5e7,null))[_0x1ea1('0x25')](saveUpdates(_0x4b3478[_0x1ea1('0x48')],null))[_0x1ea1('0x25')](respondWithResult(_0x24f5e7,null))[_0x1ea1('0x42')](handleError(_0x24f5e7,null));};exports[_0x1ea1('0x26')]=function(_0x53a247,_0x1783ea){return db['SugarcrmField'][_0x1ea1('0x46')]({'where':{'id':_0x53a247['params']['id']}})['then'](handleEntityNotFound(_0x1783ea,null))[_0x1ea1('0x25')](removeEntity(_0x1783ea,null))[_0x1ea1('0x42')](handleError(_0x1783ea,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4388612..41d3d34 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 _0x2c91=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x2c91,0x1b6));var _0x12c9=function(_0x53d7b5,_0x8b8659){_0x53d7b5=_0x53d7b5-0x0;var _0x100deb=_0x2c91[_0x53d7b5];return _0x100deb;};'use strict';var _=require('lodash');var util=require(_0x12c9('0x0'));var logger=require(_0x12c9('0x1'))(_0x12c9('0x2'));var moment=require(_0x12c9('0x3'));var BPromise=require(_0x12c9('0x4'));var rp=require(_0x12c9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12c9('0x6'));var config=require(_0x12c9('0x7'));var attributes=require(_0x12c9('0x8'));module[_0x12c9('0x9')]=function(_0xdd43f9,_0xfab9ce){return _0xdd43f9[_0x12c9('0xa')](_0x12c9('0xb'),attributes,{'tableName':_0x12c9('0xc'),'paranoid':![],'indexes':[{'name':_0x12c9('0xd'),'fields':[_0x12c9('0xe'),_0x12c9('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb8=['SugarcrmField','sugarcrm_unique_index','FieldId','lodash','util','moment','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2eb8,0x183));var _0x82eb=function(_0x3b6c07,_0x34765f){_0x3b6c07=_0x3b6c07-0x0;var _0x34469b=_0x2eb8[_0x3b6c07];return _0x34469b;};'use strict';var _=require(_0x82eb('0x0'));var util=require(_0x82eb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x82eb('0x2'));var BPromise=require('bluebird');var rp=require(_0x82eb('0x3'));var fs=require('fs');var path=require(_0x82eb('0x4'));var rimraf=require(_0x82eb('0x5'));var config=require(_0x82eb('0x6'));var attributes=require('./intSugarcrmField.attributes');module[_0x82eb('0x7')]=function(_0x49a4bf,_0x2f22c6){return _0x49a4bf[_0x82eb('0x8')](_0x82eb('0x9'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x82eb('0xa'),'fields':['idField',_0x82eb('0xb')],'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 ac82f1f..7f209ca 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 _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x0b0e,0x187));var _0xe0b0=function(_0x30fdf9,_0x89096d){_0x30fdf9=_0x30fdf9-0x0;var _0x3c43bb=_0x0b0e[_0x30fdf9];return _0x3c43bb;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x8cb31b,_0x509016){var _0x2ce32e=function(_0x1e6f4a){while(--_0x1e6f4a){_0x8cb31b['push'](_0x8cb31b['shift']());}};_0x2ce32e(++_0x509016);}(_0xda2d,0x102));var _0xdda2=function(_0x32c35d,_0x12ce91){_0x32c35d=_0x32c35d-0x0;var _0x413eee=_0xda2d[_0x32c35d];return _0x413eee;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index e49505e..37c06fe 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 _0xf4c7=['create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intVtigerAccount.controller','isAuthenticated','index','/:id','show','getFields','post'];(function(_0x566687,_0x507933){var _0x2126b1=function(_0x38a9c6){while(--_0x38a9c6){_0x566687['push'](_0x566687['shift']());}};_0x2126b1(++_0x507933);}(_0xf4c7,0x1f3));var _0x7f4c=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0xf4c7[_0x42d2af];return _0x1d6d63;};'use strict';var multer=require(_0x7f4c('0x0'));var util=require(_0x7f4c('0x1'));var path=require(_0x7f4c('0x2'));var timeout=require(_0x7f4c('0x3'));var express=require(_0x7f4c('0x4'));var router=express[_0x7f4c('0x5')]();var auth=require(_0x7f4c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f4c('0x7'));router['get']('/',auth[_0x7f4c('0x8')](),controller[_0x7f4c('0x9')]);router['get'](_0x7f4c('0xa'),auth[_0x7f4c('0x8')](),controller[_0x7f4c('0xb')]);router['get']('/:id/configurations',auth[_0x7f4c('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x7f4c('0xc')]);router[_0x7f4c('0xd')]('/',auth['isAuthenticated'](),controller[_0x7f4c('0xe')]);router[_0x7f4c('0xd')]('/:id/configurations',auth[_0x7f4c('0x8')](),controller[_0x7f4c('0xf')]);router[_0x7f4c('0x10')]('/:id',auth[_0x7f4c('0x8')](),controller['update']);router[_0x7f4c('0x11')](_0x7f4c('0xa'),auth[_0x7f4c('0x8')](),controller['destroy']);module[_0x7f4c('0x12')]=router; \ No newline at end of file +var _0x2816=['getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id','/:id/configurations','isAuthenticated'];(function(_0x485298,_0x5c3a59){var _0x415893=function(_0x2a732e){while(--_0x2a732e){_0x485298['push'](_0x485298['shift']());}};_0x415893(++_0x5c3a59);}(_0x2816,0x12b));var _0x6281=function(_0x52a722,_0x3e647c){_0x52a722=_0x52a722-0x0;var _0x5772f6=_0x2816[_0x52a722];return _0x5772f6;};'use strict';var multer=require(_0x6281('0x0'));var util=require('util');var path=require(_0x6281('0x1'));var timeout=require('connect-timeout');var express=require(_0x6281('0x2'));var router=express[_0x6281('0x3')]();var auth=require(_0x6281('0x4'));var interaction=require(_0x6281('0x5'));var config=require(_0x6281('0x6'));var controller=require(_0x6281('0x7'));router[_0x6281('0x8')]('/',auth['isAuthenticated'](),controller[_0x6281('0x9')]);router[_0x6281('0x8')](_0x6281('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x6281('0x8')](_0x6281('0xb'),auth[_0x6281('0xc')](),controller[_0x6281('0xd')]);router[_0x6281('0x8')](_0x6281('0xe'),auth[_0x6281('0xc')](),controller[_0x6281('0xf')]);router['post']('/',auth[_0x6281('0xc')](),controller[_0x6281('0x10')]);router[_0x6281('0x11')](_0x6281('0xb'),auth[_0x6281('0xc')](),controller[_0x6281('0x12')]);router[_0x6281('0x13')](_0x6281('0xa'),auth[_0x6281('0xc')](),controller[_0x6281('0x14')]);router[_0x6281('0x15')](_0x6281('0xa'),auth['isAuthenticated'](),controller[_0x6281('0x16')]);module[_0x6281('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 6a38c26..7dc9201 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 _0xab9f=['STRING','sequelize'];(function(_0x4021b3,_0x4ee1c9){var _0x1ffe58=function(_0x2b64de){while(--_0x2b64de){_0x4021b3['push'](_0x4021b3['shift']());}};_0x1ffe58(++_0x4ee1c9);}(_0xab9f,0x6b));var _0xfab9=function(_0x4cd507,_0x230d35){_0x4cd507=_0x4cd507-0x0;var _0xa2a55e=_0xab9f[_0x4cd507];return _0xa2a55e;};'use strict';var Sequelize=require(_0xfab9('0x0'));module['exports']={'name':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfab9('0x1')]},'username':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfab9('0x1')]},'accessKey':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x9140=['exports','STRING','HelpDesk','sequelize'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x9140,0x16b));var _0x0914=function(_0x24020b,_0x12ea0e){_0x24020b=_0x24020b-0x0;var _0x46af9c=_0x9140[_0x24020b];return _0x46af9c;};'use strict';var Sequelize=require(_0x0914('0x0'));module[_0x0914('0x1')]={'name':{'type':Sequelize[_0x0914('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x0914('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x0914('0x2')],'allowNull':![],'defaultValue':_0x0914('0x3')},'remoteUri':{'type':Sequelize[_0x0914('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x0914('0x2')]},'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 1b534cc..e2fe76a 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 _0xa2fa=['reference','owner','remove','includes','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','Content-Range','save','update','then','destroy','end','name','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','find','create','body','params','getConfigurations','findOne','VtigerConfiguration','length','hasOwnProperty','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','autogenerated'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa2fa,0x95));var _0xaa2f=function(_0x49516f,_0x13b9b1){_0x49516f=_0x49516f-0x0;var _0x450152=_0xa2fa[_0x49516f];return _0x450152;};'use strict';var pdf=require(_0xaa2f('0x0'));var emlformat=require(_0xaa2f('0x1'));var rimraf=require(_0xaa2f('0x2'));var zipdir=require(_0xaa2f('0x3'));var jsonpatch=require(_0xaa2f('0x4'));var rp=require('request-promise');var moment=require(_0xaa2f('0x5'));var BPromise=require(_0xaa2f('0x6'));var Mustache=require(_0xaa2f('0x7'));var util=require(_0xaa2f('0x8'));var path=require(_0xaa2f('0x9'));var sox=require(_0xaa2f('0xa'));var csv=require('to-csv');var ejs=require(_0xaa2f('0xb'));var fs=require('fs');var _=require(_0xaa2f('0xc'));var squel=require('squel');var crypto=require(_0xaa2f('0xd'));var jsforce=require(_0xaa2f('0xe'));var deskjs=require(_0xaa2f('0xf'));var toCsv=require(_0xaa2f('0x10'));var querystring=require(_0xaa2f('0x11'));var Papa=require(_0xaa2f('0x12'));var Redis=require(_0xaa2f('0x13'));var authService=require(_0xaa2f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xaa2f('0x15'));var hardwareService=require(_0xaa2f('0x16'));var logger=require(_0xaa2f('0x17'))(_0xaa2f('0x18'));var utils=require(_0xaa2f('0x19'));var config=require(_0xaa2f('0x1a'));var db=require(_0xaa2f('0x1b'))['db'];var integrations=require(_0xaa2f('0x1c'));var jayson=require(_0xaa2f('0x1d'));var client=jayson[_0xaa2f('0x1e')][_0xaa2f('0x1f')]({'port':0x232a});function checkPasswordPattern(_0xbba469,_0x50f481,_0x102de6){if(_0x102de6){var _0x126d37=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x126d37[_0xaa2f('0x20')](_0x50f481)){return _0xbba469;}else{throw new db['Sequelize'][(_0xaa2f('0x21'))](_0xaa2f('0x22'));}}else{return _0xbba469;}}function respondWithRpcPromise(_0x4cb69,_0x405f0e,_0x5cb8e8,_0x18a9c5){return new BPromise(function(_0x3906ab,_0x3432f6){var _0x50bdb2=_0x18a9c5||client;return _0x50bdb2[_0xaa2f('0x23')](_0x4cb69,_0x5cb8e8)['then'](function(_0x35ea10){logger[_0xaa2f('0x24')](_0xaa2f('0x25'),_0x405f0e,_0xaa2f('0x26'));logger[_0xaa2f('0x27')](_0xaa2f('0x28'),_0x405f0e,_0xaa2f('0x26'),JSON[_0xaa2f('0x29')](_0x35ea10));if(_0x35ea10[_0xaa2f('0x2a')]){if(_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2b')]===0x1f4){logger[_0xaa2f('0x2a')]('VtigerAccount,\x20%s,\x20%s',_0x405f0e,_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2c')]);return _0x3432f6(_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2c')]);}logger['error'](_0xaa2f('0x25'),_0x405f0e,_0x35ea10[_0xaa2f('0x2a')]['message']);return _0x3906ab(_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2c')]);}else{logger[_0xaa2f('0x24')](_0xaa2f('0x25'),_0x405f0e,_0xaa2f('0x26'));_0x3906ab(_0x35ea10[_0xaa2f('0x2d')][_0xaa2f('0x2c')]);}})[_0xaa2f('0x2e')](function(_0x2dae7b){logger['error'](_0xaa2f('0x25'),_0x405f0e,_0x2dae7b);_0x3432f6(_0x2dae7b);});});}function respondWithStatusCode(_0x537947,_0x267be6){_0x267be6=_0x267be6||0xcc;return function(_0x4fb47e){if(_0x4fb47e){return _0x537947[_0xaa2f('0x2f')](_0x267be6);}return _0x537947[_0xaa2f('0x30')](_0x267be6)['end']();};}function respondWithResult(_0x44e42c,_0x281502){_0x281502=_0x281502||0xc8;return function(_0x4f2f5f){if(_0x4f2f5f){return _0x44e42c[_0xaa2f('0x30')](_0x281502)['json'](_0x4f2f5f);}};}function respondWithFilteredResult(_0x1f0a33,_0x56189e){return function(_0x2f478d){if(_0x2f478d){var _0x546ff3=_0x2f478d[_0xaa2f('0x31')],_0x47956d=_0x56189e[_0xaa2f('0x32')],_0x25476d=_0x56189e['offset']+_0x56189e[_0xaa2f('0x33')],_0x42cafb;if(_0x25476d>=_0x546ff3){_0x25476d=_0x546ff3;_0x42cafb=0xc8;}else{_0x42cafb=0xce;}_0x1f0a33[_0xaa2f('0x30')](_0x42cafb);return _0x1f0a33['set'](_0xaa2f('0x34'),_0x47956d+'-'+_0x25476d+'/'+_0x546ff3)['json'](_0x2f478d);}return null;};}function patchUpdates(_0x2045ec){return function(_0x281d7e){try{jsonpatch['apply'](_0x281d7e,_0x2045ec,!![]);}catch(_0x1a6b33){return BPromise['reject'](_0x1a6b33);}return _0x281d7e[_0xaa2f('0x35')]();};}function saveUpdates(_0x4bd2c3,_0x58cb3d){return function(_0x1299f6){if(_0x1299f6){return _0x1299f6[_0xaa2f('0x36')](_0x4bd2c3)[_0xaa2f('0x37')](function(_0x11a85f){return _0x11a85f;});}return null;};}function removeEntity(_0x5bfd88,_0x23582a){return function(_0x1c54dd){if(_0x1c54dd){return _0x1c54dd[_0xaa2f('0x38')]()[_0xaa2f('0x37')](function(){_0x5bfd88[_0xaa2f('0x30')](0xcc)[_0xaa2f('0x39')]();});}};}function handleEntityNotFound(_0x3f2ef4,_0x158fe0){return function(_0x121f92){if(!_0x121f92){_0x3f2ef4[_0xaa2f('0x2f')](0x194);}return _0x121f92;};}function handleError(_0x25b718,_0x223326){_0x223326=_0x223326||0x1f4;return function(_0x282469){logger['error'](_0x282469['stack']);if(_0x282469[_0xaa2f('0x3a')]){delete _0x282469[_0xaa2f('0x3a')];}_0x25b718[_0xaa2f('0x30')](_0x223326)['send'](_0x282469);};}exports['index']=function(_0xea2b77,_0xa08090){var _0x43fc65={},_0x2fad2d={},_0x1197c5={'count':0x0,'rows':[]};var _0x10767b=_[_0xaa2f('0x3b')](db[_0xaa2f('0x3c')][_0xaa2f('0x3d')],function(_0x15d7fc){return{'name':_0x15d7fc[_0xaa2f('0x3e')],'type':_0x15d7fc['type'][_0xaa2f('0x3f')]};});_0x2fad2d[_0xaa2f('0x40')]=_[_0xaa2f('0x3b')](_0x10767b,_0xaa2f('0x3a'));_0x2fad2d[_0xaa2f('0x41')]=_[_0xaa2f('0x42')](_0xea2b77[_0xaa2f('0x41')]);_0x2fad2d[_0xaa2f('0x43')]=_[_0xaa2f('0x44')](_0x2fad2d[_0xaa2f('0x40')],_0x2fad2d[_0xaa2f('0x41')]);_0x43fc65['attributes']=_[_0xaa2f('0x44')](_0x2fad2d[_0xaa2f('0x40')],qs[_0xaa2f('0x45')](_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x45')]));_0x43fc65[_0xaa2f('0x46')]=_0x43fc65[_0xaa2f('0x46')]['length']?_0x43fc65[_0xaa2f('0x46')]:_0x2fad2d[_0xaa2f('0x40')];if(!_0xea2b77[_0xaa2f('0x41')]['hasOwnProperty'](_0xaa2f('0x47'))){_0x43fc65['limit']=qs[_0xaa2f('0x33')](_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x33')]);_0x43fc65[_0xaa2f('0x32')]=qs['offset'](_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x32')]);}_0x43fc65[_0xaa2f('0x48')]=qs[_0xaa2f('0x49')](_0xea2b77['query'][_0xaa2f('0x49')]);_0x43fc65['where']=qs[_0xaa2f('0x43')](_[_0xaa2f('0x4a')](_0xea2b77['query'],_0x2fad2d[_0xaa2f('0x43')]));if(_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x4b')]){_0x43fc65['where']=_[_0xaa2f('0x4c')](_0x43fc65[_0xaa2f('0x4d')],{'$or':_['map'](_0x10767b,function(_0x2149ce){if(_0x2149ce[_0xaa2f('0x4e')]!==_0xaa2f('0x4f')){var _0x17c82e={};_0x17c82e[_0x2149ce[_0xaa2f('0x3a')]]={'$like':'%'+_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x4b')]+'%'};return _0x17c82e;}})});}_0x43fc65=_[_0xaa2f('0x4c')]({},_0x43fc65,_0xea2b77[_0xaa2f('0x50')]);var _0x57dcd6={'where':_0x43fc65['where']};return db[_0xaa2f('0x3c')][_0xaa2f('0x31')](_0x57dcd6)[_0xaa2f('0x37')](function(_0x4512bf){_0x1197c5['count']=_0x4512bf;if(_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x51')]){_0x43fc65[_0xaa2f('0x52')]=[{'all':!![]}];}return db[_0xaa2f('0x3c')]['findAll'](_0x43fc65);})['then'](function(_0x5bc457){_0x1197c5[_0xaa2f('0x53')]=_0x5bc457;return _0x1197c5;})[_0xaa2f('0x37')](respondWithFilteredResult(_0xa08090,_0x43fc65))[_0xaa2f('0x2e')](handleError(_0xa08090,null));};exports['show']=function(_0xbe260e,_0x512ccd){var _0x2ad1a0={'raw':![],'where':{'id':_0xbe260e['params']['id']}},_0xbc2a6f={};_0xbc2a6f['model']=_[_0xaa2f('0x42')](db[_0xaa2f('0x3c')]['rawAttributes']);_0xbc2a6f[_0xaa2f('0x41')]=_['keys'](_0xbe260e[_0xaa2f('0x41')]);_0xbc2a6f[_0xaa2f('0x43')]=_['intersection'](_0xbc2a6f[_0xaa2f('0x40')],_0xbc2a6f[_0xaa2f('0x41')]);_0x2ad1a0[_0xaa2f('0x46')]=_['intersection'](_0xbc2a6f[_0xaa2f('0x40')],qs['fields'](_0xbe260e['query'][_0xaa2f('0x45')]));_0x2ad1a0[_0xaa2f('0x46')]=_0x2ad1a0[_0xaa2f('0x46')]['length']?_0x2ad1a0[_0xaa2f('0x46')]:_0xbc2a6f['model'];if(_0xbe260e['query'][_0xaa2f('0x51')]){_0x2ad1a0[_0xaa2f('0x52')]=[{'all':!![]}];}_0x2ad1a0=_[_0xaa2f('0x4c')]({},_0x2ad1a0,_0xbe260e[_0xaa2f('0x50')]);return db[_0xaa2f('0x3c')][_0xaa2f('0x54')](_0x2ad1a0)[_0xaa2f('0x37')](handleEntityNotFound(_0x512ccd,null))['then'](respondWithResult(_0x512ccd,null))[_0xaa2f('0x2e')](handleError(_0x512ccd,null));};exports['create']=function(_0x1b64a3,_0x20bf3b){return db['VtigerAccount'][_0xaa2f('0x55')](_0x1b64a3[_0xaa2f('0x56')],{})['then'](respondWithResult(_0x20bf3b,0xc9))[_0xaa2f('0x2e')](handleError(_0x20bf3b,null));};exports[_0xaa2f('0x36')]=function(_0x41d7e1,_0x585400){if(_0x41d7e1[_0xaa2f('0x56')]['id']){delete _0x41d7e1[_0xaa2f('0x56')]['id'];}return db[_0xaa2f('0x3c')][_0xaa2f('0x54')]({'where':{'id':_0x41d7e1[_0xaa2f('0x57')]['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x585400,null))[_0xaa2f('0x37')](saveUpdates(_0x41d7e1[_0xaa2f('0x56')],null))[_0xaa2f('0x37')](respondWithResult(_0x585400,null))[_0xaa2f('0x2e')](handleError(_0x585400,null));};exports[_0xaa2f('0x38')]=function(_0x47dc06,_0x55cde6){return db['VtigerAccount'][_0xaa2f('0x54')]({'where':{'id':_0x47dc06[_0xaa2f('0x57')]['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x55cde6,null))[_0xaa2f('0x37')](removeEntity(_0x55cde6,null))[_0xaa2f('0x2e')](handleError(_0x55cde6,null));};exports[_0xaa2f('0x58')]=function(_0x2a0b8e,_0x5e8e60,_0x31d971){var _0x130548={};var _0x44f25a={};var _0x41a8e3;var _0x3b6086;return db[_0xaa2f('0x3c')][_0xaa2f('0x59')]({'where':{'id':_0x2a0b8e['params']['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x5e8e60,null))[_0xaa2f('0x37')](function(_0x12717d){if(_0x12717d){_0x41a8e3=_0x12717d;_0x44f25a[_0xaa2f('0x40')]=_[_0xaa2f('0x42')](db[_0xaa2f('0x5a')][_0xaa2f('0x3d')]);_0x44f25a[_0xaa2f('0x41')]=_[_0xaa2f('0x42')](_0x2a0b8e['query']);_0x44f25a['filters']=_['intersection'](_0x44f25a[_0xaa2f('0x40')],_0x44f25a[_0xaa2f('0x41')]);_0x130548[_0xaa2f('0x46')]=_[_0xaa2f('0x44')](_0x44f25a['model'],qs[_0xaa2f('0x45')](_0x2a0b8e['query'][_0xaa2f('0x45')]));_0x130548['attributes']=_0x130548[_0xaa2f('0x46')][_0xaa2f('0x5b')]?_0x130548[_0xaa2f('0x46')]:_0x44f25a[_0xaa2f('0x40')];_0x130548['order']=qs['sort'](_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x49')]);_0x130548[_0xaa2f('0x4d')]=qs[_0xaa2f('0x43')](_[_0xaa2f('0x4a')](_0x2a0b8e[_0xaa2f('0x41')],_0x44f25a['filters']));if(_0x2a0b8e['query']['filter']){_0x130548[_0xaa2f('0x4d')]=_['merge'](_0x130548[_0xaa2f('0x4d')],{'$or':_['map'](_0x130548[_0xaa2f('0x46')],function(_0x31a781){var _0x42316e={};_0x42316e[_0x31a781]={'$like':'%'+_0x2a0b8e['query'][_0xaa2f('0x4b')]+'%'};return _0x42316e;})});}_0x130548=_[_0xaa2f('0x4c')]({},_0x130548,_0x2a0b8e[_0xaa2f('0x50')]);return _0x41a8e3[_0xaa2f('0x58')](_0x130548);}})[_0xaa2f('0x37')](function(_0x4d89a7){if(_0x4d89a7){_0x3b6086=_0x4d89a7[_0xaa2f('0x5b')];if(!_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x5c')]('nolimit')){_0x130548['limit']=qs[_0xaa2f('0x33')](_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x33')]);_0x130548[_0xaa2f('0x32')]=qs[_0xaa2f('0x32')](_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x32')]);}return _0x41a8e3[_0xaa2f('0x58')](_0x130548);}})[_0xaa2f('0x37')](function(_0x15d0a3){if(_0x15d0a3){return _0x15d0a3?{'count':_0x3b6086,'rows':_0x15d0a3}:null;}})[_0xaa2f('0x37')](respondWithResult(_0x5e8e60,null))[_0xaa2f('0x2e')](handleError(_0x5e8e60,null));};exports[_0xaa2f('0x5d')]=function(_0x4f514e,_0x3aa882,_0x36de31){if(_0x4f514e[_0xaa2f('0x56')]['id']){delete _0x4f514e[_0xaa2f('0x56')]['id'];}return db[_0xaa2f('0x3c')][_0xaa2f('0x59')]({'where':{'id':_0x4f514e['params']['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x3aa882,null))['then'](function(_0xa6d5d4){if(_0xa6d5d4){_0x4f514e[_0xaa2f('0x56')]['AccountId']=_0xa6d5d4['id'];_0x4f514e[_0xaa2f('0x56')][_0xaa2f('0x5e')]=integrations[_0xaa2f('0x5f')](_0x4f514e[_0xaa2f('0x56')]['channel'],_0x4f514e['body'][_0xaa2f('0x4e')]);_0x4f514e['body'][_0xaa2f('0x60')]=integrations[_0xaa2f('0x61')](_0x4f514e['body'][_0xaa2f('0x62')],_0x4f514e[_0xaa2f('0x56')][_0xaa2f('0x4e')]);return db[_0xaa2f('0x5a')]['create'](_0x4f514e[_0xaa2f('0x56')],{'include':[{'model':db[_0xaa2f('0x63')],'as':'Subjects'},{'model':db[_0xaa2f('0x63')],'as':'Descriptions'}]});}return null;})[_0xaa2f('0x37')](respondWithResult(_0x3aa882,null))[_0xaa2f('0x2e')](handleError(_0x3aa882,null));};var md5=require(_0xaa2f('0x64'));exports[_0xaa2f('0x65')]=function(_0xbcdaac,_0x3e64b3,_0x4bdf12){var _0x26ad30=null;var _0x4beee7=null;var _0x5998e1=null;var _0x4c6df1=null;var _0x3b9830='';return db[_0xaa2f('0x3c')][_0xaa2f('0x59')]({'where':{'id':_0xbcdaac[_0xaa2f('0x57')]['id']},'attributes':['id',_0xaa2f('0x3a'),_0xaa2f('0x66'),'description',_0xaa2f('0x67'),_0xaa2f('0x68'),'serverUrl',_0xaa2f('0x69')]})[_0xaa2f('0x37')](handleEntityNotFound(_0x3e64b3,null))[_0xaa2f('0x37')](function(_0x1f42a3){if(_0x1f42a3){_0x26ad30=_0x1f42a3[_0xaa2f('0x66')];_0x4beee7=_0x1f42a3[_0xaa2f('0x69')];_0x5998e1=_0x1f42a3['moduleName'];_0x3b9830=_0x1f42a3['remoteUri'];var _0x551e5f=_0x3b9830[_0xaa2f('0x6a')](-0x1);if(_0x551e5f==='/'){_0x3b9830=_0x3b9830[_0xaa2f('0x6b')](0x0,_0x3b9830[_0xaa2f('0x6c')](_0x551e5f));}_0x4c6df1=util[_0xaa2f('0x6d')](_0xaa2f('0x6e'),_0x3b9830);var _0x2c2a95={'method':_0xaa2f('0x6f'),'uri':_0x4c6df1,'qs':{'operation':_0xaa2f('0x70'),'username':_0x1f42a3[_0xaa2f('0x66')]},'json':!![]};return rp(_0x2c2a95);}})[_0xaa2f('0x37')](function(_0x381441){if(_0x381441[_0xaa2f('0x71')]){var _0x1aa9bd={'method':_0xaa2f('0x72'),'uri':_0x4c6df1,'form':{'operation':_0xaa2f('0x73'),'username':_0x26ad30,'accessKey':md5(_0x381441[_0xaa2f('0x2d')][_0xaa2f('0x74')]+_0x4beee7)},'json':!![]};return rp(_0x1aa9bd);}})[_0xaa2f('0x37')](function(_0x3b142f){if(_0x3b142f[_0xaa2f('0x71')]){var _0x5a4117={'method':_0xaa2f('0x6f'),'uri':_0x4c6df1,'qs':{'operation':_0xaa2f('0x75'),'username':_0x26ad30,'sessionName':_0x3b142f[_0xaa2f('0x2d')]['sessionName'],'elementType':_0x5998e1},'json':!![]};return rp(_0x5a4117);}})[_0xaa2f('0x37')](function(_0x11707b){if(_0x11707b[_0xaa2f('0x71')]){var _0x49bd0a=[_0xaa2f('0x76'),_0xaa2f('0x77'),_0xaa2f('0x78')];_[_0xaa2f('0x79')](_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')],function(_0x5a4ba3){return _0x49bd0a[_0xaa2f('0x7a')](_0x5a4ba3[_0xaa2f('0x4e')]['name']);});_[_0xaa2f('0x79')](_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')],function(_0x4aaaba){return _0x4aaaba['editable']==='false';});return{'count':_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')][_0xaa2f('0x5b')],'rows':_['map'](_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')],function(_0x423d8f){return{'id':_0x423d8f[_0xaa2f('0x3a')],'name':_0x423d8f[_0xaa2f('0x7b')],'custom':_[_0xaa2f('0x7c')](_0x423d8f[_0xaa2f('0x3a')],_0xaa2f('0x7d'))?!![]:![],'options':_0x423d8f[_0xaa2f('0x4e')]['name']===_0xaa2f('0x7e')&&_0x423d8f[_0xaa2f('0x4e')][_0xaa2f('0x7f')][_0xaa2f('0x5b')]>0x0?_[_0xaa2f('0x3b')](_0x423d8f['type']['picklistValues'],function(_0x5da026){return{'name':_0x5da026[_0xaa2f('0x7b')],'value':_0x5da026[_0xaa2f('0x80')]};}):[]};})};}})['then'](respondWithResult(_0x3e64b3,null))['catch'](function(_0x206dd6){console['log'](_0xaa2f('0x81')+_0x206dd6);var _0x48607a=_0xbcdaac[_0xaa2f('0x41')]['test']?0x1f4:_0x206dd6[_0xaa2f('0x82')]||0x1f4;logger[_0xaa2f('0x2a')](_0xaa2f('0x83'),_0xaa2f('0x65'),_0x48607a,JSON[_0xaa2f('0x29')](_0x206dd6));delete _0x206dd6['name'];if(_0x48607a===0x191){_0x48607a=0x190;}_0x3e64b3[_0xaa2f('0x30')](_0x48607a)[_0xaa2f('0x84')](_0xbcdaac[_0xaa2f('0x41')][_0xaa2f('0x20')]?{'message':_0xaa2f('0x85'),'statusCode':_0x206dd6['statusCode']}:_0x206dd6);});}; \ No newline at end of file +var _0xdd23=['%s/webservice.php','success','login','token','GET','describe','autogenerated','owner','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','rows','params','keys','length','include','find','create','body','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','channel','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format'];(function(_0x1c0273,_0x326cf0){var _0x450bea=function(_0x1e32e4){while(--_0x1e32e4){_0x1c0273['push'](_0x1c0273['shift']());}};_0x450bea(++_0x326cf0);}(_0xdd23,0x1a3));var _0x3dd2=function(_0x2f5544,_0x134b17){_0x2f5544=_0x2f5544-0x0;var _0x186801=_0xdd23[_0x2f5544];return _0x186801;};'use strict';var pdf=require(_0x3dd2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3dd2('0x1'));var zipdir=require(_0x3dd2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3dd2('0x3'));var BPromise=require(_0x3dd2('0x4'));var Mustache=require('mustache');var util=require(_0x3dd2('0x5'));var path=require(_0x3dd2('0x6'));var sox=require(_0x3dd2('0x7'));var csv=require(_0x3dd2('0x8'));var ejs=require(_0x3dd2('0x9'));var fs=require('fs');var _=require(_0x3dd2('0xa'));var squel=require(_0x3dd2('0xb'));var crypto=require(_0x3dd2('0xc'));var jsforce=require(_0x3dd2('0xd'));var deskjs=require(_0x3dd2('0xe'));var toCsv=require(_0x3dd2('0x8'));var querystring=require('querystring');var Papa=require(_0x3dd2('0xf'));var Redis=require(_0x3dd2('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3dd2('0x11'));var as=require(_0x3dd2('0x12'));var hardwareService=require(_0x3dd2('0x13'));var logger=require(_0x3dd2('0x14'))(_0x3dd2('0x15'));var utils=require(_0x3dd2('0x16'));var config=require(_0x3dd2('0x17'));var db=require(_0x3dd2('0x18'))['db'];var integrations=require(_0x3dd2('0x19'));var jayson=require(_0x3dd2('0x1a'));var client=jayson[_0x3dd2('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x347e8d,_0x573cec,_0x31a82a){if(_0x31a82a){var _0x44003f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44003f[_0x3dd2('0x1c')](_0x573cec)){return _0x347e8d;}else{throw new db[(_0x3dd2('0x1d'))][(_0x3dd2('0x1e'))](_0x3dd2('0x1f'));}}else{return _0x347e8d;}}function respondWithRpcPromise(_0x18cbc7,_0x46ce9e,_0x5f494f,_0x55df26){return new BPromise(function(_0xdb2b0d,_0x5cf876){var _0x1c4f42=_0x55df26||client;return _0x1c4f42[_0x3dd2('0x20')](_0x18cbc7,_0x5f494f)[_0x3dd2('0x21')](function(_0x42b04e){logger[_0x3dd2('0x22')](_0x3dd2('0x23'),_0x46ce9e,_0x3dd2('0x24'));logger[_0x3dd2('0x25')](_0x3dd2('0x26'),_0x46ce9e,_0x3dd2('0x24'),JSON[_0x3dd2('0x27')](_0x42b04e));if(_0x42b04e[_0x3dd2('0x28')]){if(_0x42b04e[_0x3dd2('0x28')][_0x3dd2('0x29')]===0x1f4){logger['error'](_0x3dd2('0x23'),_0x46ce9e,_0x42b04e[_0x3dd2('0x28')][_0x3dd2('0x2a')]);return _0x5cf876(_0x42b04e[_0x3dd2('0x28')][_0x3dd2('0x2a')]);}logger[_0x3dd2('0x28')](_0x3dd2('0x23'),_0x46ce9e,_0x42b04e[_0x3dd2('0x28')][_0x3dd2('0x2a')]);return _0xdb2b0d(_0x42b04e[_0x3dd2('0x28')][_0x3dd2('0x2a')]);}else{logger['info'](_0x3dd2('0x23'),_0x46ce9e,_0x3dd2('0x24'));_0xdb2b0d(_0x42b04e[_0x3dd2('0x2b')][_0x3dd2('0x2a')]);}})[_0x3dd2('0x2c')](function(_0x254c99){logger[_0x3dd2('0x28')](_0x3dd2('0x23'),_0x46ce9e,_0x254c99);_0x5cf876(_0x254c99);});});}function respondWithStatusCode(_0x4aad56,_0x20137b){_0x20137b=_0x20137b||0xcc;return function(_0x4f4ced){if(_0x4f4ced){return _0x4aad56['sendStatus'](_0x20137b);}return _0x4aad56[_0x3dd2('0x2d')](_0x20137b)[_0x3dd2('0x2e')]();};}function respondWithResult(_0x3f8c9b,_0x4b6a99){_0x4b6a99=_0x4b6a99||0xc8;return function(_0x29bf0e){if(_0x29bf0e){return _0x3f8c9b[_0x3dd2('0x2d')](_0x4b6a99)[_0x3dd2('0x2f')](_0x29bf0e);}};}function respondWithFilteredResult(_0x1f0146,_0x3cfb47){return function(_0x243171){if(_0x243171){var _0x3738cf=_0x243171['count'],_0x2e8959=_0x3cfb47[_0x3dd2('0x30')],_0x533d1a=_0x3cfb47[_0x3dd2('0x30')]+_0x3cfb47[_0x3dd2('0x31')],_0x10050d;if(_0x533d1a>=_0x3738cf){_0x533d1a=_0x3738cf;_0x10050d=0xc8;}else{_0x10050d=0xce;}_0x1f0146[_0x3dd2('0x2d')](_0x10050d);return _0x1f0146['set'](_0x3dd2('0x32'),_0x2e8959+'-'+_0x533d1a+'/'+_0x3738cf)[_0x3dd2('0x2f')](_0x243171);}return null;};}function patchUpdates(_0x4d49b7){return function(_0x1f95c5){try{jsonpatch[_0x3dd2('0x33')](_0x1f95c5,_0x4d49b7,!![]);}catch(_0xe53909){return BPromise[_0x3dd2('0x34')](_0xe53909);}return _0x1f95c5[_0x3dd2('0x35')]();};}function saveUpdates(_0x4c5989,_0x229a6f){return function(_0x3bd89f){if(_0x3bd89f){return _0x3bd89f[_0x3dd2('0x36')](_0x4c5989)['then'](function(_0x5f0e55){return _0x5f0e55;});}return null;};}function removeEntity(_0x5dfe02,_0x502ed7){return function(_0x3f15f0){if(_0x3f15f0){return _0x3f15f0[_0x3dd2('0x37')]()[_0x3dd2('0x21')](function(){_0x5dfe02[_0x3dd2('0x2d')](0xcc)[_0x3dd2('0x2e')]();});}};}function handleEntityNotFound(_0x1e3ced,_0x3699fc){return function(_0x47c48c){if(!_0x47c48c){_0x1e3ced['sendStatus'](0x194);}return _0x47c48c;};}function handleError(_0x2b1bc2,_0x120664){_0x120664=_0x120664||0x1f4;return function(_0x29768c){logger[_0x3dd2('0x28')](_0x29768c[_0x3dd2('0x38')]);if(_0x29768c[_0x3dd2('0x39')]){delete _0x29768c[_0x3dd2('0x39')];}_0x2b1bc2[_0x3dd2('0x2d')](_0x120664)[_0x3dd2('0x3a')](_0x29768c);};}exports[_0x3dd2('0x3b')]=function(_0x281776,_0x208951){var _0x1964c8={},_0x5812fa={},_0x31b5b8={'count':0x0,'rows':[]};var _0x3120fe=_[_0x3dd2('0x3c')](db[_0x3dd2('0x3d')][_0x3dd2('0x3e')],function(_0x4ca6ae){return{'name':_0x4ca6ae[_0x3dd2('0x3f')],'type':_0x4ca6ae['type']['key']};});_0x5812fa['model']=_[_0x3dd2('0x3c')](_0x3120fe,_0x3dd2('0x39'));_0x5812fa[_0x3dd2('0x40')]=_['keys'](_0x281776['query']);_0x5812fa[_0x3dd2('0x41')]=_[_0x3dd2('0x42')](_0x5812fa[_0x3dd2('0x43')],_0x5812fa[_0x3dd2('0x40')]);_0x1964c8[_0x3dd2('0x44')]=_[_0x3dd2('0x42')](_0x5812fa[_0x3dd2('0x43')],qs[_0x3dd2('0x45')](_0x281776[_0x3dd2('0x40')][_0x3dd2('0x45')]));_0x1964c8[_0x3dd2('0x44')]=_0x1964c8[_0x3dd2('0x44')]['length']?_0x1964c8[_0x3dd2('0x44')]:_0x5812fa[_0x3dd2('0x43')];if(!_0x281776['query'][_0x3dd2('0x46')](_0x3dd2('0x47'))){_0x1964c8[_0x3dd2('0x31')]=qs['limit'](_0x281776[_0x3dd2('0x40')][_0x3dd2('0x31')]);_0x1964c8[_0x3dd2('0x30')]=qs['offset'](_0x281776['query'][_0x3dd2('0x30')]);}_0x1964c8['order']=qs[_0x3dd2('0x48')](_0x281776['query'][_0x3dd2('0x48')]);_0x1964c8['where']=qs['filters'](_[_0x3dd2('0x49')](_0x281776[_0x3dd2('0x40')],_0x5812fa[_0x3dd2('0x41')]));if(_0x281776['query'][_0x3dd2('0x4a')]){_0x1964c8[_0x3dd2('0x4b')]=_[_0x3dd2('0x4c')](_0x1964c8['where'],{'$or':_[_0x3dd2('0x3c')](_0x3120fe,function(_0x287383){if(_0x287383[_0x3dd2('0x4d')]!==_0x3dd2('0x4e')){var _0x4e41b6={};_0x4e41b6[_0x287383['name']]={'$like':'%'+_0x281776[_0x3dd2('0x40')][_0x3dd2('0x4a')]+'%'};return _0x4e41b6;}})});}_0x1964c8=_[_0x3dd2('0x4c')]({},_0x1964c8,_0x281776[_0x3dd2('0x4f')]);var _0x115946={'where':_0x1964c8[_0x3dd2('0x4b')]};return db['VtigerAccount'][_0x3dd2('0x50')](_0x115946)[_0x3dd2('0x21')](function(_0x5099de){_0x31b5b8[_0x3dd2('0x50')]=_0x5099de;if(_0x281776[_0x3dd2('0x40')][_0x3dd2('0x51')]){_0x1964c8['include']=[{'all':!![]}];}return db[_0x3dd2('0x3d')]['findAll'](_0x1964c8);})['then'](function(_0x41ef83){_0x31b5b8[_0x3dd2('0x52')]=_0x41ef83;return _0x31b5b8;})[_0x3dd2('0x21')](respondWithFilteredResult(_0x208951,_0x1964c8))[_0x3dd2('0x2c')](handleError(_0x208951,null));};exports['show']=function(_0x47fc91,_0x4f1296){var _0x1b86e0={'raw':![],'where':{'id':_0x47fc91[_0x3dd2('0x53')]['id']}},_0x3c1bbe={};_0x3c1bbe[_0x3dd2('0x43')]=_[_0x3dd2('0x54')](db['VtigerAccount'][_0x3dd2('0x3e')]);_0x3c1bbe[_0x3dd2('0x40')]=_[_0x3dd2('0x54')](_0x47fc91[_0x3dd2('0x40')]);_0x3c1bbe[_0x3dd2('0x41')]=_[_0x3dd2('0x42')](_0x3c1bbe['model'],_0x3c1bbe[_0x3dd2('0x40')]);_0x1b86e0[_0x3dd2('0x44')]=_['intersection'](_0x3c1bbe['model'],qs[_0x3dd2('0x45')](_0x47fc91[_0x3dd2('0x40')][_0x3dd2('0x45')]));_0x1b86e0['attributes']=_0x1b86e0[_0x3dd2('0x44')][_0x3dd2('0x55')]?_0x1b86e0['attributes']:_0x3c1bbe['model'];if(_0x47fc91[_0x3dd2('0x40')][_0x3dd2('0x51')]){_0x1b86e0[_0x3dd2('0x56')]=[{'all':!![]}];}_0x1b86e0=_[_0x3dd2('0x4c')]({},_0x1b86e0,_0x47fc91['options']);return db['VtigerAccount'][_0x3dd2('0x57')](_0x1b86e0)[_0x3dd2('0x21')](handleEntityNotFound(_0x4f1296,null))['then'](respondWithResult(_0x4f1296,null))['catch'](handleError(_0x4f1296,null));};exports[_0x3dd2('0x58')]=function(_0x216d67,_0x21454a){return db[_0x3dd2('0x3d')][_0x3dd2('0x58')](_0x216d67['body'],{})[_0x3dd2('0x21')](respondWithResult(_0x21454a,0xc9))[_0x3dd2('0x2c')](handleError(_0x21454a,null));};exports[_0x3dd2('0x36')]=function(_0x42bcbc,_0x11b30b){if(_0x42bcbc['body']['id']){delete _0x42bcbc[_0x3dd2('0x59')]['id'];}return db[_0x3dd2('0x3d')][_0x3dd2('0x57')]({'where':{'id':_0x42bcbc[_0x3dd2('0x53')]['id']}})[_0x3dd2('0x21')](handleEntityNotFound(_0x11b30b,null))[_0x3dd2('0x21')](saveUpdates(_0x42bcbc[_0x3dd2('0x59')],null))[_0x3dd2('0x21')](respondWithResult(_0x11b30b,null))['catch'](handleError(_0x11b30b,null));};exports[_0x3dd2('0x37')]=function(_0x4d1606,_0x1c3a28){return db[_0x3dd2('0x3d')]['find']({'where':{'id':_0x4d1606[_0x3dd2('0x53')]['id']}})[_0x3dd2('0x21')](handleEntityNotFound(_0x1c3a28,null))[_0x3dd2('0x21')](removeEntity(_0x1c3a28,null))[_0x3dd2('0x2c')](handleError(_0x1c3a28,null));};exports[_0x3dd2('0x5a')]=function(_0x23162b,_0x397d3e,_0x345a70){var _0x180152={};var _0x51f7c3={};var _0x49ed68;var _0x5c98b3;return db[_0x3dd2('0x3d')][_0x3dd2('0x5b')]({'where':{'id':_0x23162b['params']['id']}})['then'](handleEntityNotFound(_0x397d3e,null))['then'](function(_0x46da15){if(_0x46da15){_0x49ed68=_0x46da15;_0x51f7c3[_0x3dd2('0x43')]=_[_0x3dd2('0x54')](db[_0x3dd2('0x5c')][_0x3dd2('0x3e')]);_0x51f7c3['query']=_[_0x3dd2('0x54')](_0x23162b[_0x3dd2('0x40')]);_0x51f7c3['filters']=_['intersection'](_0x51f7c3[_0x3dd2('0x43')],_0x51f7c3[_0x3dd2('0x40')]);_0x180152['attributes']=_[_0x3dd2('0x42')](_0x51f7c3[_0x3dd2('0x43')],qs[_0x3dd2('0x45')](_0x23162b[_0x3dd2('0x40')][_0x3dd2('0x45')]));_0x180152['attributes']=_0x180152['attributes'][_0x3dd2('0x55')]?_0x180152[_0x3dd2('0x44')]:_0x51f7c3[_0x3dd2('0x43')];_0x180152[_0x3dd2('0x5d')]=qs[_0x3dd2('0x48')](_0x23162b['query'][_0x3dd2('0x48')]);_0x180152['where']=qs[_0x3dd2('0x41')](_[_0x3dd2('0x49')](_0x23162b[_0x3dd2('0x40')],_0x51f7c3[_0x3dd2('0x41')]));if(_0x23162b['query']['filter']){_0x180152['where']=_[_0x3dd2('0x4c')](_0x180152[_0x3dd2('0x4b')],{'$or':_[_0x3dd2('0x3c')](_0x180152['attributes'],function(_0x4a8e44){var _0x3e373d={};_0x3e373d[_0x4a8e44]={'$like':'%'+_0x23162b['query']['filter']+'%'};return _0x3e373d;})});}_0x180152=_['merge']({},_0x180152,_0x23162b[_0x3dd2('0x4f')]);return _0x49ed68[_0x3dd2('0x5a')](_0x180152);}})[_0x3dd2('0x21')](function(_0x256af2){if(_0x256af2){_0x5c98b3=_0x256af2[_0x3dd2('0x55')];if(!_0x23162b[_0x3dd2('0x40')][_0x3dd2('0x46')](_0x3dd2('0x47'))){_0x180152['limit']=qs['limit'](_0x23162b[_0x3dd2('0x40')][_0x3dd2('0x31')]);_0x180152['offset']=qs[_0x3dd2('0x30')](_0x23162b[_0x3dd2('0x40')][_0x3dd2('0x30')]);}return _0x49ed68[_0x3dd2('0x5a')](_0x180152);}})[_0x3dd2('0x21')](function(_0x386985){if(_0x386985){return _0x386985?{'count':_0x5c98b3,'rows':_0x386985}:null;}})[_0x3dd2('0x21')](respondWithResult(_0x397d3e,null))[_0x3dd2('0x2c')](handleError(_0x397d3e,null));};exports[_0x3dd2('0x5e')]=function(_0x192f8b,_0x4b4c6f,_0x24cbb7){if(_0x192f8b[_0x3dd2('0x59')]['id']){delete _0x192f8b[_0x3dd2('0x59')]['id'];}return db[_0x3dd2('0x3d')][_0x3dd2('0x5b')]({'where':{'id':_0x192f8b['params']['id']}})[_0x3dd2('0x21')](handleEntityNotFound(_0x4b4c6f,null))[_0x3dd2('0x21')](function(_0x425960){if(_0x425960){_0x192f8b[_0x3dd2('0x59')][_0x3dd2('0x5f')]=_0x425960['id'];_0x192f8b['body'][_0x3dd2('0x60')]=integrations[_0x3dd2('0x61')](_0x192f8b['body']['channel'],_0x192f8b[_0x3dd2('0x59')][_0x3dd2('0x4d')]);_0x192f8b[_0x3dd2('0x59')][_0x3dd2('0x62')]=integrations['getDescriptions'](_0x192f8b['body'][_0x3dd2('0x63')],_0x192f8b['body'][_0x3dd2('0x4d')]);return db[_0x3dd2('0x5c')]['create'](_0x192f8b[_0x3dd2('0x59')],{'include':[{'model':db[_0x3dd2('0x64')],'as':'Subjects'},{'model':db['VtigerField'],'as':_0x3dd2('0x62')}]});}return null;})[_0x3dd2('0x21')](respondWithResult(_0x4b4c6f,null))[_0x3dd2('0x2c')](handleError(_0x4b4c6f,null));};var md5=require(_0x3dd2('0x65'));exports[_0x3dd2('0x66')]=function(_0x257811,_0x3968b2,_0x2500da){var _0x3a8ea1=null;var _0x11a57c=null;var _0x39056d=null;var _0x208484=null;var _0x32684d='';return db[_0x3dd2('0x3d')][_0x3dd2('0x5b')]({'where':{'id':_0x257811[_0x3dd2('0x53')]['id']},'attributes':['id',_0x3dd2('0x39'),_0x3dd2('0x67'),_0x3dd2('0x68'),_0x3dd2('0x69'),_0x3dd2('0x6a'),_0x3dd2('0x6b'),_0x3dd2('0x6c')]})[_0x3dd2('0x21')](handleEntityNotFound(_0x3968b2,null))[_0x3dd2('0x21')](function(_0x23740c){if(_0x23740c){_0x3a8ea1=_0x23740c['username'];_0x11a57c=_0x23740c[_0x3dd2('0x6c')];_0x39056d=_0x23740c[_0x3dd2('0x69')];_0x32684d=_0x23740c[_0x3dd2('0x6a')];var _0x49b8cd=_0x32684d[_0x3dd2('0x6d')](-0x1);if(_0x49b8cd==='/'){_0x32684d=_0x32684d[_0x3dd2('0x6e')](0x0,_0x32684d[_0x3dd2('0x6f')](_0x49b8cd));}_0x208484=util[_0x3dd2('0x70')](_0x3dd2('0x71'),_0x32684d);var _0x4ae7b9={'method':'GET','uri':_0x208484,'qs':{'operation':'getchallenge','username':_0x23740c['username']},'json':!![]};return rp(_0x4ae7b9);}})[_0x3dd2('0x21')](function(_0x25dc29){if(_0x25dc29[_0x3dd2('0x72')]){var _0x27fef8={'method':'POST','uri':_0x208484,'form':{'operation':_0x3dd2('0x73'),'username':_0x3a8ea1,'accessKey':md5(_0x25dc29['result'][_0x3dd2('0x74')]+_0x11a57c)},'json':!![]};return rp(_0x27fef8);}})['then'](function(_0x1118dc){if(_0x1118dc[_0x3dd2('0x72')]){var _0x2fb635={'method':_0x3dd2('0x75'),'uri':_0x208484,'qs':{'operation':_0x3dd2('0x76'),'username':_0x3a8ea1,'sessionName':_0x1118dc[_0x3dd2('0x2b')]['sessionName'],'elementType':_0x39056d},'json':!![]};return rp(_0x2fb635);}})[_0x3dd2('0x21')](function(_0x3b3ab0){if(_0x3b3ab0[_0x3dd2('0x72')]){var _0x1e4364=[_0x3dd2('0x77'),'reference',_0x3dd2('0x78')];_['remove'](_0x3b3ab0[_0x3dd2('0x2b')][_0x3dd2('0x45')],function(_0x3c93cc){return _0x1e4364[_0x3dd2('0x79')](_0x3c93cc['type'][_0x3dd2('0x39')]);});_['remove'](_0x3b3ab0['result']['fields'],function(_0x3802df){return _0x3802df['editable']===_0x3dd2('0x7a');});return{'count':_0x3b3ab0[_0x3dd2('0x2b')][_0x3dd2('0x45')][_0x3dd2('0x55')],'rows':_[_0x3dd2('0x3c')](_0x3b3ab0[_0x3dd2('0x2b')][_0x3dd2('0x45')],function(_0x185d19){return{'id':_0x185d19[_0x3dd2('0x39')],'name':_0x185d19[_0x3dd2('0x7b')],'custom':_[_0x3dd2('0x7c')](_0x185d19['name'],_0x3dd2('0x7d'))?!![]:![],'options':_0x185d19[_0x3dd2('0x4d')][_0x3dd2('0x39')]===_0x3dd2('0x7e')&&_0x185d19[_0x3dd2('0x4d')][_0x3dd2('0x7f')][_0x3dd2('0x55')]>0x0?_['map'](_0x185d19[_0x3dd2('0x4d')][_0x3dd2('0x7f')],function(_0x296225){return{'name':_0x296225[_0x3dd2('0x7b')],'value':_0x296225[_0x3dd2('0x80')]};}):[]};})};}})[_0x3dd2('0x21')](respondWithResult(_0x3968b2,null))[_0x3dd2('0x2c')](function(_0x4813f8){console[_0x3dd2('0x81')]('vTiger\x20error:\x20'+_0x4813f8);var _0x3fb9b7=_0x257811[_0x3dd2('0x40')][_0x3dd2('0x1c')]?0x1f4:_0x4813f8[_0x3dd2('0x82')]||0x1f4;logger[_0x3dd2('0x28')](_0x3dd2('0x83'),_0x3dd2('0x66'),_0x3fb9b7,JSON[_0x3dd2('0x27')](_0x4813f8));delete _0x4813f8[_0x3dd2('0x39')];if(_0x3fb9b7===0x191){_0x3fb9b7=0x190;}_0x3968b2[_0x3dd2('0x2d')](_0x3fb9b7)[_0x3dd2('0x3a')](_0x257811[_0x3dd2('0x40')][_0x3dd2('0x1c')]?{'message':_0x3dd2('0x84'),'statusCode':_0x4813f8[_0x3dd2('0x82')]}:_0x4813f8);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index d9a9a61..6b7df37 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 _0x6449=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment','request-promise'];(function(_0x46fc39,_0x417b1a){var _0x41ee76=function(_0x28c4db){while(--_0x28c4db){_0x46fc39['push'](_0x46fc39['shift']());}};_0x41ee76(++_0x417b1a);}(_0x6449,0x19b));var _0x9644=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6449[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x9644('0x0'));var util=require('util');var logger=require(_0x9644('0x1'))(_0x9644('0x2'));var moment=require(_0x9644('0x3'));var BPromise=require('bluebird');var rp=require(_0x9644('0x4'));var fs=require('fs');var path=require(_0x9644('0x5'));var rimraf=require(_0x9644('0x6'));var config=require(_0x9644('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x9644('0x8'));module[_0x9644('0x9')]=function(_0x3fe595,_0x1969e1){return _0x3fe595[_0x9644('0xa')](_0x9644('0xb'),attributes,{'tableName':_0x9644('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30f2=['int_vtiger_accounts','../../config/logger','api','moment','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount'];(function(_0x357d34,_0x56cd6c){var _0x3cd514=function(_0x5e6762){while(--_0x5e6762){_0x357d34['push'](_0x357d34['shift']());}};_0x3cd514(++_0x56cd6c);}(_0x30f2,0x19b));var _0x230f=function(_0x5e852a,_0x22c1b2){_0x5e852a=_0x5e852a-0x0;var _0x443ef6=_0x30f2[_0x5e852a];return _0x443ef6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x230f('0x0'))(_0x230f('0x1'));var moment=require(_0x230f('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x230f('0x3'));var attributes=require(_0x230f('0x4'));var integrations=require(_0x230f('0x5'));module[_0x230f('0x6')]=function(_0x4ed2b6,_0xf06735){return _0x4ed2b6[_0x230f('0x7')](_0x230f('0x8'),attributes,{'tableName':_0x230f('0x9'),'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 754404f..2e376de 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 _0xc035=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','VtigerAccount,\x20%s,\x20%s','message','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetVtigerAccount','ShowVtigerAccount','find','stringify','lodash','util','moment','bluebird','ioredis'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xc035,0x124));var _0x5c03=function(_0x5bb0f8,_0x594a32){_0x5bb0f8=_0x5bb0f8-0x0;var _0x47af9e=_0xc035[_0x5bb0f8];return _0x47af9e;};'use strict';var _=require(_0x5c03('0x0'));var util=require(_0x5c03('0x1'));var moment=require(_0x5c03('0x2'));var BPromise=require(_0x5c03('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c03('0x5'));var logger=require('../../config/logger')(_0x5c03('0x6'));var config=require(_0x5c03('0x7'));var jayson=require(_0x5c03('0x8'));var client=jayson[_0x5c03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46652e,_0x77bc0c,_0x4c0aa0){return new BPromise(function(_0x237bef,_0x23c483){return client[_0x5c03('0xa')](_0x46652e,_0x4c0aa0)[_0x5c03('0xb')](function(_0x4885cc){logger[_0x5c03('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x77bc0c,_0x5c03('0xd'));logger[_0x5c03('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x77bc0c,'request\x20sent',JSON['stringify'](_0x4885cc));if(_0x4885cc[_0x5c03('0xf')]){if(_0x4885cc[_0x5c03('0xf')]['code']===0x1f4){logger[_0x5c03('0xf')](_0x5c03('0x10'),_0x77bc0c,_0x4885cc[_0x5c03('0xf')][_0x5c03('0x11')]);return _0x23c483(_0x4885cc[_0x5c03('0xf')][_0x5c03('0x11')]);}logger[_0x5c03('0xf')](_0x5c03('0x10'),_0x77bc0c,_0x4885cc[_0x5c03('0xf')]['message']);return _0x237bef(_0x4885cc['error'][_0x5c03('0x11')]);}else{logger['info'](_0x5c03('0x10'),_0x77bc0c,_0x5c03('0xd'));_0x237bef(_0x4885cc['result'][_0x5c03('0x11')]);}})[_0x5c03('0x12')](function(_0x2aaf2f){logger[_0x5c03('0xf')](_0x5c03('0x10'),_0x77bc0c,_0x2aaf2f);_0x23c483(_0x2aaf2f);});});}exports['GetVtigerAccount']=function(_0x4b0a00){var _0x593db1=this;return new Promise(function(_0x13b9c9,_0x49ac82){return db[_0x5c03('0x13')][_0x5c03('0x14')]({'raw':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x16')]===undefined?!![]:![]:!![],'where':_0x4b0a00['options']?_0x4b0a00['options'][_0x5c03('0x17')]||null:null,'attributes':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x18')]||null:null,'limit':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x19')]||null:null,'include':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x1a')]?_[_0x5c03('0x1b')](_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x1a')],function(_0x19a116){return{'model':db[_0x19a116[_0x5c03('0x1c')]],'as':_0x19a116['as'],'attributes':_0x19a116[_0x5c03('0x18')],'include':_0x19a116[_0x5c03('0x1a')]?_[_0x5c03('0x1b')](_0x19a116[_0x5c03('0x1a')],function(_0x1d46ff){return{'model':db[_0x1d46ff['model']],'as':_0x1d46ff['as'],'attributes':_0x1d46ff[_0x5c03('0x18')],'include':_0x1d46ff[_0x5c03('0x1a')]?_['map'](_0x1d46ff[_0x5c03('0x1a')],function(_0x4f909b){return{'model':db[_0x4f909b[_0x5c03('0x1c')]],'as':_0x4f909b['as'],'attributes':_0x4f909b[_0x5c03('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x364e50){logger[_0x5c03('0xc')](_0x5c03('0x1d'),_0x4b0a00);logger[_0x5c03('0xe')](_0x5c03('0x1d'),_0x4b0a00,JSON['stringify'](_0x364e50));_0x13b9c9(_0x364e50);})[_0x5c03('0x12')](function(_0x59b738){logger['error'](_0x5c03('0x1d'),_0x59b738[_0x5c03('0x11')],_0x4b0a00);_0x49ac82(_0x593db1[_0x5c03('0xf')](0x1f4,_0x59b738['message']));});});};exports[_0x5c03('0x1e')]=function(_0x18b26e){var _0x17eb12=this;return new Promise(function(_0x16f9e7,_0x7c05c5){return db[_0x5c03('0x13')][_0x5c03('0x1f')]({'raw':_0x18b26e[_0x5c03('0x15')]?_0x18b26e[_0x5c03('0x15')][_0x5c03('0x16')]===undefined?!![]:![]:!![],'where':_0x18b26e[_0x5c03('0x15')]?_0x18b26e[_0x5c03('0x15')][_0x5c03('0x17')]||null:null,'attributes':_0x18b26e[_0x5c03('0x15')]?_0x18b26e['options'][_0x5c03('0x18')]||null:null,'include':_0x18b26e[_0x5c03('0x15')]?_0x18b26e[_0x5c03('0x15')][_0x5c03('0x1a')]?_['map'](_0x18b26e[_0x5c03('0x15')][_0x5c03('0x1a')],function(_0x5360b8){return{'model':db[_0x5360b8['model']],'as':_0x5360b8['as'],'attributes':_0x5360b8[_0x5c03('0x18')],'include':_0x5360b8[_0x5c03('0x1a')]?_[_0x5c03('0x1b')](_0x5360b8[_0x5c03('0x1a')],function(_0x59e61f){return{'model':db[_0x59e61f['model']],'as':_0x59e61f['as'],'attributes':_0x59e61f[_0x5c03('0x18')],'include':_0x59e61f['include']?_[_0x5c03('0x1b')](_0x59e61f[_0x5c03('0x1a')],function(_0x545096){return{'model':db[_0x545096[_0x5c03('0x1c')]],'as':_0x545096['as'],'attributes':_0x545096[_0x5c03('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5c03('0xb')](function(_0x46834d){logger[_0x5c03('0xc')](_0x5c03('0x1e'),_0x18b26e);logger[_0x5c03('0xe')]('ShowVtigerAccount',_0x18b26e,JSON[_0x5c03('0x20')](_0x46834d));_0x16f9e7(_0x46834d);})['catch'](function(_0x15b649){logger['error'](_0x5c03('0x1e'),_0x15b649[_0x5c03('0x11')],_0x18b26e);_0x7c05c5(_0x17eb12['error'](0x1f4,_0x15b649[_0x5c03('0x11')]));});});}; \ No newline at end of file +var _0x6274=['model','ShowVtigerAccount','find','stringify','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','client','http','then','info','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','VtigerAccount,\x20%s,\x20%s','message','request\x20sent','result','GetVtigerAccount','VtigerAccount','options','raw','where','attributes','include','map'];(function(_0x37d2d4,_0x41c1bd){var _0x5dbefe=function(_0x37519f){while(--_0x37519f){_0x37d2d4['push'](_0x37d2d4['shift']());}};_0x5dbefe(++_0x41c1bd);}(_0x6274,0x19a));var _0x4627=function(_0x4f3c4f,_0x14e346){_0x4f3c4f=_0x4f3c4f-0x0;var _0x41ae20=_0x6274[_0x4f3c4f];return _0x41ae20;};'use strict';var _=require('lodash');var util=require(_0x4627('0x0'));var moment=require(_0x4627('0x1'));var BPromise=require(_0x4627('0x2'));var rs=require(_0x4627('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4627('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x4627('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4627('0x6')][_0x4627('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x9b568,_0x3b0634,_0x12c136){return new BPromise(function(_0x384725,_0x2b823a){return client['request'](_0x9b568,_0x12c136)[_0x4627('0x8')](function(_0x5336c6){logger[_0x4627('0x9')]('VtigerAccount,\x20%s,\x20%s',_0x3b0634,'request\x20sent');logger[_0x4627('0xa')](_0x4627('0xb'),_0x3b0634,'request\x20sent',JSON['stringify'](_0x5336c6));if(_0x5336c6[_0x4627('0xc')]){if(_0x5336c6['error']['code']===0x1f4){logger[_0x4627('0xc')](_0x4627('0xd'),_0x3b0634,_0x5336c6[_0x4627('0xc')][_0x4627('0xe')]);return _0x2b823a(_0x5336c6[_0x4627('0xc')]['message']);}logger[_0x4627('0xc')](_0x4627('0xd'),_0x3b0634,_0x5336c6[_0x4627('0xc')][_0x4627('0xe')]);return _0x384725(_0x5336c6[_0x4627('0xc')][_0x4627('0xe')]);}else{logger[_0x4627('0x9')](_0x4627('0xd'),_0x3b0634,_0x4627('0xf'));_0x384725(_0x5336c6[_0x4627('0x10')][_0x4627('0xe')]);}})['catch'](function(_0x16aa6f){logger[_0x4627('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x3b0634,_0x16aa6f);_0x2b823a(_0x16aa6f);});});}exports[_0x4627('0x11')]=function(_0x757de7){var _0x389841=this;return new Promise(function(_0x50ad13,_0x2e0f60){return db[_0x4627('0x12')]['findAll']({'raw':_0x757de7[_0x4627('0x13')]?_0x757de7[_0x4627('0x13')][_0x4627('0x14')]===undefined?!![]:![]:!![],'where':_0x757de7['options']?_0x757de7['options'][_0x4627('0x15')]||null:null,'attributes':_0x757de7['options']?_0x757de7[_0x4627('0x13')][_0x4627('0x16')]||null:null,'limit':_0x757de7[_0x4627('0x13')]?_0x757de7['options']['limit']||null:null,'include':_0x757de7[_0x4627('0x13')]?_0x757de7[_0x4627('0x13')][_0x4627('0x17')]?_[_0x4627('0x18')](_0x757de7['options'][_0x4627('0x17')],function(_0x417cc9){return{'model':db[_0x417cc9[_0x4627('0x19')]],'as':_0x417cc9['as'],'attributes':_0x417cc9[_0x4627('0x16')],'include':_0x417cc9[_0x4627('0x17')]?_[_0x4627('0x18')](_0x417cc9[_0x4627('0x17')],function(_0x23df8a){return{'model':db[_0x23df8a[_0x4627('0x19')]],'as':_0x23df8a['as'],'attributes':_0x23df8a[_0x4627('0x16')],'include':_0x23df8a[_0x4627('0x17')]?_[_0x4627('0x18')](_0x23df8a[_0x4627('0x17')],function(_0x31a416){return{'model':db[_0x31a416[_0x4627('0x19')]],'as':_0x31a416['as'],'attributes':_0x31a416[_0x4627('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32e5a2){logger['info'](_0x4627('0x11'),_0x757de7);logger[_0x4627('0xa')](_0x4627('0x11'),_0x757de7,JSON['stringify'](_0x32e5a2));_0x50ad13(_0x32e5a2);})['catch'](function(_0x35515a){logger[_0x4627('0xc')]('GetVtigerAccount',_0x35515a[_0x4627('0xe')],_0x757de7);_0x2e0f60(_0x389841[_0x4627('0xc')](0x1f4,_0x35515a[_0x4627('0xe')]));});});};exports[_0x4627('0x1a')]=function(_0xf4cc7e){var _0x3460c2=this;return new Promise(function(_0x22274c,_0x4f46f2){return db['VtigerAccount'][_0x4627('0x1b')]({'raw':_0xf4cc7e['options']?_0xf4cc7e[_0x4627('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0xf4cc7e[_0x4627('0x13')]?_0xf4cc7e['options'][_0x4627('0x15')]||null:null,'attributes':_0xf4cc7e[_0x4627('0x13')]?_0xf4cc7e[_0x4627('0x13')][_0x4627('0x16')]||null:null,'include':_0xf4cc7e[_0x4627('0x13')]?_0xf4cc7e[_0x4627('0x13')][_0x4627('0x17')]?_['map'](_0xf4cc7e[_0x4627('0x13')][_0x4627('0x17')],function(_0x4153dd){return{'model':db[_0x4153dd[_0x4627('0x19')]],'as':_0x4153dd['as'],'attributes':_0x4153dd[_0x4627('0x16')],'include':_0x4153dd[_0x4627('0x17')]?_[_0x4627('0x18')](_0x4153dd[_0x4627('0x17')],function(_0x28012d){return{'model':db[_0x28012d[_0x4627('0x19')]],'as':_0x28012d['as'],'attributes':_0x28012d[_0x4627('0x16')],'include':_0x28012d[_0x4627('0x17')]?_[_0x4627('0x18')](_0x28012d[_0x4627('0x17')],function(_0x4f936b){return{'model':db[_0x4f936b[_0x4627('0x19')]],'as':_0x4f936b['as'],'attributes':_0x4f936b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4627('0x8')](function(_0x463c17){logger[_0x4627('0x9')](_0x4627('0x1a'),_0xf4cc7e);logger[_0x4627('0xa')]('ShowVtigerAccount',_0xf4cc7e,JSON[_0x4627('0x1c')](_0x463c17));_0x22274c(_0x463c17);})['catch'](function(_0xc7c82d){logger[_0x4627('0xc')](_0x4627('0x1a'),_0xc7c82d[_0x4627('0xe')],_0xf4cc7e);_0x4f46f2(_0x3460c2[_0x4627('0xc')](0x1f4,_0xc7c82d['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 94068e1..48687c9 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 _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file +var _0xb10b=['/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated'];(function(_0x2b8c9b,_0x1a8105){var _0x496052=function(_0x27ff3c){while(--_0x27ff3c){_0x2b8c9b['push'](_0x2b8c9b['shift']());}};_0x496052(++_0x1a8105);}(_0xb10b,0x12a));var _0xbb10=function(_0x4d5dbc,_0x4f99d3){_0x4d5dbc=_0x4d5dbc-0x0;var _0x3aaa90=_0xb10b[_0x4d5dbc];return _0x3aaa90;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var auth=require(_0xbb10('0x4'));var interaction=require(_0xbb10('0x5'));var config=require(_0xbb10('0x6'));var controller=require(_0xbb10('0x7'));router[_0xbb10('0x8')]('/',auth[_0xbb10('0x9')](),controller['index']);router[_0xbb10('0x8')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0xb')]);router[_0xbb10('0x8')](_0xbb10('0xc'),auth[_0xbb10('0x9')](),controller[_0xbb10('0xd')]);router[_0xbb10('0x8')](_0xbb10('0xe'),auth[_0xbb10('0x9')](),controller['getSubjects']);router['get'](_0xbb10('0xf'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x10')]);router['post']('/',auth[_0xbb10('0x9')](),controller['create']);router[_0xbb10('0x11')](_0xbb10('0xa'),auth[_0xbb10('0x9')](),controller[_0xbb10('0x12')]);router[_0xbb10('0x13')](_0xbb10('0xa'),auth['isAuthenticated'](),controller[_0xbb10('0x14')]);module[_0xbb10('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 0ad369b..cb5a499 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 _0x99da=['exports','STRING'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x99da,0xd4));var _0xa99d=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x99da[_0x333767];return _0x51661b;};'use strict';var Sequelize=require('sequelize');module[_0xa99d('0x0')]={'name':{'type':Sequelize[_0xa99d('0x1')]},'description':{'type':Sequelize[_0xa99d('0x1')]}}; \ No newline at end of file +var _0x9940=['sequelize','exports','STRING'];(function(_0x59a7a6,_0x5ef74d){var _0x587247=function(_0x573bd0){while(--_0x573bd0){_0x59a7a6['push'](_0x59a7a6['shift']());}};_0x587247(++_0x5ef74d);}(_0x9940,0x132));var _0x0994=function(_0x218c4d,_0x139af4){_0x218c4d=_0x218c4d-0x0;var _0x2d4161=_0x9940[_0x218c4d];return _0x2d4161;};'use strict';var Sequelize=require(_0x0994('0x0'));module[_0x0994('0x1')]={'name':{'type':Sequelize[_0x0994('0x2')]},'description':{'type':Sequelize[_0x0994('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index ec9044d..1633934 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 _0xf894=['map','VtigerConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','limit','Content-Range','save','update','destroy','end','stack','name'];(function(_0x4991d6,_0x348deb){var _0x50faf7=function(_0x14c7f8){while(--_0x14c7f8){_0x4991d6['push'](_0x4991d6['shift']());}};_0x50faf7(++_0x348deb);}(_0xf894,0xd4));var _0x4f89=function(_0x1ac685,_0x2faa1f){_0x1ac685=_0x1ac685-0x0;var _0x1f0c24=_0xf894[_0x1ac685];return _0x1f0c24;};'use strict';var pdf=require(_0x4f89('0x0'));var emlformat=require(_0x4f89('0x1'));var rimraf=require(_0x4f89('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f89('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f89('0x4'));var util=require(_0x4f89('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4f89('0x6'));var ejs=require(_0x4f89('0x7'));var fs=require('fs');var _=require(_0x4f89('0x8'));var squel=require(_0x4f89('0x9'));var crypto=require(_0x4f89('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4f89('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4f89('0xc'));var Redis=require('ioredis');var authService=require(_0x4f89('0xd'));var qs=require(_0x4f89('0xe'));var as=require(_0x4f89('0xf'));var hardwareService=require(_0x4f89('0x10'));var logger=require(_0x4f89('0x11'))(_0x4f89('0x12'));var utils=require(_0x4f89('0x13'));var config=require(_0x4f89('0x14'));var db=require(_0x4f89('0x15'))['db'];var jayson=require(_0x4f89('0x16'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x527d9f,_0x5bb413,_0x1d8b58){if(_0x1d8b58){var _0x252826=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x252826[_0x4f89('0x17')](_0x5bb413)){return _0x527d9f;}else{throw new db[(_0x4f89('0x18'))]['ValidationError'](_0x4f89('0x19'));}}else{return _0x527d9f;}}function respondWithRpcPromise(_0x21f636,_0x101b4d,_0x1681cd,_0x27ea86){return new BPromise(function(_0x120576,_0x218192){var _0x1380a9=_0x27ea86||client;return _0x1380a9[_0x4f89('0x1a')](_0x21f636,_0x1681cd)[_0x4f89('0x1b')](function(_0x30d1fb){logger['info'](_0x4f89('0x1c'),_0x101b4d,'request\x20sent');logger['debug'](_0x4f89('0x1d'),_0x101b4d,'request\x20sent',JSON[_0x4f89('0x1e')](_0x30d1fb));if(_0x30d1fb['error']){if(_0x30d1fb[_0x4f89('0x1f')][_0x4f89('0x20')]===0x1f4){logger[_0x4f89('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x101b4d,_0x30d1fb[_0x4f89('0x1f')]['message']);return _0x218192(_0x30d1fb[_0x4f89('0x1f')][_0x4f89('0x21')]);}logger[_0x4f89('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x101b4d,_0x30d1fb['error'][_0x4f89('0x21')]);return _0x120576(_0x30d1fb['error'][_0x4f89('0x21')]);}else{logger['info'](_0x4f89('0x1c'),_0x101b4d,_0x4f89('0x22'));_0x120576(_0x30d1fb[_0x4f89('0x23')]['message']);}})[_0x4f89('0x24')](function(_0x31c6ff){logger[_0x4f89('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x101b4d,_0x31c6ff);_0x218192(_0x31c6ff);});});}function respondWithStatusCode(_0x50fe0f,_0x25c923){_0x25c923=_0x25c923||0xcc;return function(_0x2916bf){if(_0x2916bf){return _0x50fe0f[_0x4f89('0x25')](_0x25c923);}return _0x50fe0f[_0x4f89('0x26')](_0x25c923)['end']();};}function respondWithResult(_0xd5a061,_0x3b4ab7){_0x3b4ab7=_0x3b4ab7||0xc8;return function(_0x42db86){if(_0x42db86){return _0xd5a061[_0x4f89('0x26')](_0x3b4ab7)[_0x4f89('0x27')](_0x42db86);}};}function respondWithFilteredResult(_0x3bb65d,_0x2a71ca){return function(_0x5e60df){if(_0x5e60df){var _0x8b465b=_0x5e60df['count'],_0x262335=_0x2a71ca[_0x4f89('0x28')],_0x48c2c1=_0x2a71ca[_0x4f89('0x28')]+_0x2a71ca[_0x4f89('0x29')],_0x1f5651;if(_0x48c2c1>=_0x8b465b){_0x48c2c1=_0x8b465b;_0x1f5651=0xc8;}else{_0x1f5651=0xce;}_0x3bb65d[_0x4f89('0x26')](_0x1f5651);return _0x3bb65d['set'](_0x4f89('0x2a'),_0x262335+'-'+_0x48c2c1+'/'+_0x8b465b)[_0x4f89('0x27')](_0x5e60df);}return null;};}function patchUpdates(_0x1c7eb2){return function(_0x55b846){try{jsonpatch['apply'](_0x55b846,_0x1c7eb2,!![]);}catch(_0x289355){return BPromise['reject'](_0x289355);}return _0x55b846[_0x4f89('0x2b')]();};}function saveUpdates(_0xd66d50,_0x5b97fd){return function(_0x4e500a){if(_0x4e500a){return _0x4e500a[_0x4f89('0x2c')](_0xd66d50)[_0x4f89('0x1b')](function(_0x2fcebf){return _0x2fcebf;});}return null;};}function removeEntity(_0x29a8ac,_0x880595){return function(_0x5f3c65){if(_0x5f3c65){return _0x5f3c65[_0x4f89('0x2d')]()['then'](function(){_0x29a8ac['status'](0xcc)[_0x4f89('0x2e')]();});}};}function handleEntityNotFound(_0x5bfbd1,_0x533edf){return function(_0x1d1440){if(!_0x1d1440){_0x5bfbd1[_0x4f89('0x25')](0x194);}return _0x1d1440;};}function handleError(_0x52ba2e,_0x52a100){_0x52a100=_0x52a100||0x1f4;return function(_0x4655c2){logger[_0x4f89('0x1f')](_0x4655c2[_0x4f89('0x2f')]);if(_0x4655c2['name']){delete _0x4655c2[_0x4f89('0x30')];}_0x52ba2e[_0x4f89('0x26')](_0x52a100)['send'](_0x4655c2);};}exports['index']=function(_0x4d541c,_0x1460cd){var _0x693d8a={},_0x13a559={},_0x40496b={'count':0x0,'rows':[]};var _0x5bb444=_[_0x4f89('0x31')](db[_0x4f89('0x32')]['rawAttributes'],function(_0x181e7f){return{'name':_0x181e7f[_0x4f89('0x33')],'type':_0x181e7f[_0x4f89('0x34')]['key']};});_0x13a559[_0x4f89('0x35')]=_[_0x4f89('0x31')](_0x5bb444,'name');_0x13a559[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x4d541c['query']);_0x13a559[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0x13a559[_0x4f89('0x35')],_0x13a559[_0x4f89('0x36')]);_0x693d8a[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x13a559[_0x4f89('0x35')],qs[_0x4f89('0x3b')](_0x4d541c[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x693d8a[_0x4f89('0x3a')]=_0x693d8a[_0x4f89('0x3a')][_0x4f89('0x3c')]?_0x693d8a['attributes']:_0x13a559[_0x4f89('0x35')];if(!_0x4d541c['query']['hasOwnProperty'](_0x4f89('0x3d'))){_0x693d8a[_0x4f89('0x29')]=qs[_0x4f89('0x29')](_0x4d541c['query'][_0x4f89('0x29')]);_0x693d8a['offset']=qs[_0x4f89('0x28')](_0x4d541c[_0x4f89('0x36')][_0x4f89('0x28')]);}_0x693d8a[_0x4f89('0x3e')]=qs[_0x4f89('0x3f')](_0x4d541c[_0x4f89('0x36')][_0x4f89('0x3f')]);_0x693d8a[_0x4f89('0x40')]=qs[_0x4f89('0x38')](_[_0x4f89('0x41')](_0x4d541c[_0x4f89('0x36')],_0x13a559[_0x4f89('0x38')]));if(_0x4d541c[_0x4f89('0x36')][_0x4f89('0x42')]){_0x693d8a[_0x4f89('0x40')]=_[_0x4f89('0x43')](_0x693d8a['where'],{'$or':_['map'](_0x5bb444,function(_0x8551d1){if(_0x8551d1[_0x4f89('0x34')]!==_0x4f89('0x44')){var _0x419484={};_0x419484[_0x8551d1[_0x4f89('0x30')]]={'$like':'%'+_0x4d541c['query']['filter']+'%'};return _0x419484;}})});}_0x693d8a=_[_0x4f89('0x43')]({},_0x693d8a,_0x4d541c[_0x4f89('0x45')]);var _0xcbf314={'where':_0x693d8a[_0x4f89('0x40')]};return db[_0x4f89('0x32')]['count'](_0xcbf314)[_0x4f89('0x1b')](function(_0x281d24){_0x40496b[_0x4f89('0x46')]=_0x281d24;if(_0x4d541c['query'][_0x4f89('0x47')]){_0x693d8a[_0x4f89('0x48')]=[{'all':!![]}];}return db[_0x4f89('0x32')][_0x4f89('0x49')](_0x693d8a);})[_0x4f89('0x1b')](function(_0x6a3ee8){_0x40496b[_0x4f89('0x4a')]=_0x6a3ee8;return _0x40496b;})[_0x4f89('0x1b')](respondWithFilteredResult(_0x1460cd,_0x693d8a))['catch'](handleError(_0x1460cd,null));};exports[_0x4f89('0x4b')]=function(_0x41093e,_0x26056b){var _0x3e9912={'raw':![],'where':{'id':_0x41093e['params']['id']}},_0x281dfd={};_0x281dfd[_0x4f89('0x35')]=_['keys'](db['VtigerConfiguration'][_0x4f89('0x4c')]);_0x281dfd[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x41093e[_0x4f89('0x36')]);_0x281dfd[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0x281dfd['model'],_0x281dfd[_0x4f89('0x36')]);_0x3e9912[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x281dfd['model'],qs[_0x4f89('0x3b')](_0x41093e[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x3e9912[_0x4f89('0x3a')]=_0x3e9912[_0x4f89('0x3a')][_0x4f89('0x3c')]?_0x3e9912['attributes']:_0x281dfd[_0x4f89('0x35')];if(_0x41093e[_0x4f89('0x36')]['includeAll']){_0x3e9912[_0x4f89('0x48')]=[{'all':!![]}];}_0x3e9912=_[_0x4f89('0x43')]({},_0x3e9912,_0x41093e[_0x4f89('0x45')]);return db[_0x4f89('0x32')][_0x4f89('0x4d')](_0x3e9912)[_0x4f89('0x1b')](handleEntityNotFound(_0x26056b,null))[_0x4f89('0x1b')](respondWithResult(_0x26056b,null))['catch'](handleError(_0x26056b,null));};exports[_0x4f89('0x4e')]=function(_0x35eb10,_0x48cbe7){return db[_0x4f89('0x32')][_0x4f89('0x4e')](_0x35eb10[_0x4f89('0x4f')],{})['then'](respondWithResult(_0x48cbe7,0xc9))['catch'](handleError(_0x48cbe7,null));};exports['update']=function(_0x16d524,_0x111fb6){if(_0x16d524['body']['id']){delete _0x16d524[_0x4f89('0x4f')]['id'];}return db[_0x4f89('0x32')][_0x4f89('0x4d')]({'where':{'id':_0x16d524[_0x4f89('0x50')]['id']}})['then'](handleEntityNotFound(_0x111fb6,null))[_0x4f89('0x1b')](saveUpdates(_0x16d524['body'],null))['then'](respondWithResult(_0x111fb6,null))[_0x4f89('0x24')](handleError(_0x111fb6,null));};exports[_0x4f89('0x2d')]=function(_0x56b441,_0x42c05b){return db[_0x4f89('0x32')][_0x4f89('0x4d')]({'where':{'id':_0x56b441['params']['id']}})[_0x4f89('0x1b')](handleEntityNotFound(_0x42c05b,null))['then'](removeEntity(_0x42c05b,null))[_0x4f89('0x24')](handleError(_0x42c05b,null));};exports[_0x4f89('0x51')]=function(_0x26864c,_0x1a2777,_0x272e13){var _0x470e3d={};var _0x43401e={};var _0x31d36f;var _0x7fca51;return db[_0x4f89('0x32')][_0x4f89('0x52')]({'where':{'id':_0x26864c[_0x4f89('0x50')]['id']}})[_0x4f89('0x1b')](handleEntityNotFound(_0x1a2777,null))[_0x4f89('0x1b')](function(_0x5ae181){if(_0x5ae181){_0x31d36f=_0x5ae181;_0x43401e[_0x4f89('0x35')]=_[_0x4f89('0x37')](db[_0x4f89('0x53')][_0x4f89('0x4c')]);_0x43401e[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x26864c[_0x4f89('0x36')]);_0x43401e['filters']=_[_0x4f89('0x39')](_0x43401e[_0x4f89('0x35')],_0x43401e[_0x4f89('0x36')]);_0x470e3d[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x43401e[_0x4f89('0x35')],qs['fields'](_0x26864c[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x470e3d[_0x4f89('0x3a')]=_0x470e3d['attributes']['length']?_0x470e3d[_0x4f89('0x3a')]:_0x43401e[_0x4f89('0x35')];_0x470e3d['order']=qs[_0x4f89('0x3f')](_0x26864c[_0x4f89('0x36')][_0x4f89('0x3f')]);_0x470e3d[_0x4f89('0x40')]=qs[_0x4f89('0x38')](_['pick'](_0x26864c['query'],_0x43401e['filters']));if(_0x26864c[_0x4f89('0x36')][_0x4f89('0x42')]){_0x470e3d[_0x4f89('0x40')]=_[_0x4f89('0x43')](_0x470e3d[_0x4f89('0x40')],{'$or':_['map'](_0x470e3d['attributes'],function(_0x15ef3f){var _0xc4d12e={};_0xc4d12e[_0x15ef3f]={'$like':'%'+_0x26864c[_0x4f89('0x36')][_0x4f89('0x42')]+'%'};return _0xc4d12e;})});}_0x470e3d=_[_0x4f89('0x43')]({},_0x470e3d,_0x26864c[_0x4f89('0x45')]);return _0x31d36f['getFields'](_0x470e3d);}})[_0x4f89('0x1b')](function(_0x53cdd4){if(_0x53cdd4){_0x7fca51=_0x53cdd4[_0x4f89('0x3c')];if(!_0x26864c[_0x4f89('0x36')][_0x4f89('0x54')](_0x4f89('0x3d'))){_0x470e3d[_0x4f89('0x29')]=qs[_0x4f89('0x29')](_0x26864c[_0x4f89('0x36')][_0x4f89('0x29')]);_0x470e3d['offset']=qs[_0x4f89('0x28')](_0x26864c[_0x4f89('0x36')][_0x4f89('0x28')]);}return _0x31d36f['getFields'](_0x470e3d);}})[_0x4f89('0x1b')](function(_0x61ea3){if(_0x61ea3){return _0x61ea3?{'count':_0x7fca51,'rows':_0x61ea3}:null;}})[_0x4f89('0x1b')](respondWithResult(_0x1a2777,null))[_0x4f89('0x24')](handleError(_0x1a2777,null));};exports[_0x4f89('0x55')]=function(_0x3f87e9,_0x4139fd,_0x21eef6){var _0x27be33={};var _0xfbc964={};var _0xa9ab51;var _0x3d37df;return db[_0x4f89('0x32')][_0x4f89('0x52')]({'where':{'id':_0x3f87e9[_0x4f89('0x50')]['id']}})[_0x4f89('0x1b')](handleEntityNotFound(_0x4139fd,null))['then'](function(_0x1d907a){if(_0x1d907a){_0xa9ab51=_0x1d907a;_0xfbc964[_0x4f89('0x35')]=_[_0x4f89('0x37')](db[_0x4f89('0x53')][_0x4f89('0x4c')]);_0xfbc964[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x3f87e9['query']);_0xfbc964[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0xfbc964[_0x4f89('0x35')],_0xfbc964['query']);_0x27be33['attributes']=_[_0x4f89('0x39')](_0xfbc964[_0x4f89('0x35')],qs['fields'](_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x27be33['attributes']=_0x27be33['attributes']['length']?_0x27be33[_0x4f89('0x3a')]:_0xfbc964[_0x4f89('0x35')];_0x27be33['order']=qs['sort'](_0x3f87e9[_0x4f89('0x36')]['sort']);_0x27be33[_0x4f89('0x40')]=qs[_0x4f89('0x38')](_[_0x4f89('0x41')](_0x3f87e9[_0x4f89('0x36')],_0xfbc964['filters']));if(_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x42')]){_0x27be33[_0x4f89('0x40')]=_[_0x4f89('0x43')](_0x27be33[_0x4f89('0x40')],{'$or':_[_0x4f89('0x31')](_0x27be33[_0x4f89('0x3a')],function(_0xa05881){var _0x81990={};_0x81990[_0xa05881]={'$like':'%'+_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x42')]+'%'};return _0x81990;})});}_0x27be33=_[_0x4f89('0x43')]({},_0x27be33,_0x3f87e9[_0x4f89('0x45')]);return _0xa9ab51[_0x4f89('0x55')](_0x27be33);}})[_0x4f89('0x1b')](function(_0x2672d9){if(_0x2672d9){_0x3d37df=_0x2672d9['length'];if(!_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x54')](_0x4f89('0x3d'))){_0x27be33[_0x4f89('0x29')]=qs['limit'](_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x29')]);_0x27be33[_0x4f89('0x28')]=qs[_0x4f89('0x28')](_0x3f87e9['query'][_0x4f89('0x28')]);}return _0xa9ab51[_0x4f89('0x55')](_0x27be33);}})[_0x4f89('0x1b')](function(_0x52e6c8){if(_0x52e6c8){return _0x52e6c8?{'count':_0x3d37df,'rows':_0x52e6c8}:null;}})[_0x4f89('0x1b')](respondWithResult(_0x4139fd,null))[_0x4f89('0x24')](handleError(_0x4139fd,null));};exports[_0x4f89('0x56')]=function(_0x32320f,_0xc95631,_0x386180){var _0x50abbb={};var _0x4f0137={};var _0x14758b;var _0x1b460e;return db[_0x4f89('0x32')]['findOne']({'where':{'id':_0x32320f[_0x4f89('0x50')]['id']}})['then'](handleEntityNotFound(_0xc95631,null))['then'](function(_0x29c893){if(_0x29c893){_0x14758b=_0x29c893;_0x4f0137['model']=_[_0x4f89('0x37')](db[_0x4f89('0x53')][_0x4f89('0x4c')]);_0x4f0137['query']=_[_0x4f89('0x37')](_0x32320f[_0x4f89('0x36')]);_0x4f0137[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0x4f0137['model'],_0x4f0137['query']);_0x50abbb[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x4f0137['model'],qs[_0x4f89('0x3b')](_0x32320f['query']['fields']));_0x50abbb[_0x4f89('0x3a')]=_0x50abbb[_0x4f89('0x3a')]['length']?_0x50abbb[_0x4f89('0x3a')]:_0x4f0137['model'];_0x50abbb[_0x4f89('0x3e')]=qs[_0x4f89('0x3f')](_0x32320f[_0x4f89('0x36')]['sort']);_0x50abbb[_0x4f89('0x40')]=qs['filters'](_['pick'](_0x32320f['query'],_0x4f0137['filters']));if(_0x32320f['query']['filter']){_0x50abbb['where']=_[_0x4f89('0x43')](_0x50abbb[_0x4f89('0x40')],{'$or':_[_0x4f89('0x31')](_0x50abbb[_0x4f89('0x3a')],function(_0x511c4e){var _0x50938a={};_0x50938a[_0x511c4e]={'$like':'%'+_0x32320f['query'][_0x4f89('0x42')]+'%'};return _0x50938a;})});}_0x50abbb=_[_0x4f89('0x43')]({},_0x50abbb,_0x32320f['options']);return _0x14758b[_0x4f89('0x56')](_0x50abbb);}})[_0x4f89('0x1b')](function(_0x58f626){if(_0x58f626){_0x1b460e=_0x58f626[_0x4f89('0x3c')];if(!_0x32320f['query'][_0x4f89('0x54')]('nolimit')){_0x50abbb['limit']=qs[_0x4f89('0x29')](_0x32320f[_0x4f89('0x36')][_0x4f89('0x29')]);_0x50abbb[_0x4f89('0x28')]=qs['offset'](_0x32320f['query'][_0x4f89('0x28')]);}return _0x14758b['getDescriptions'](_0x50abbb);}})['then'](function(_0x2b1fb2){if(_0x2b1fb2){return _0x2b1fb2?{'count':_0x1b460e,'rows':_0x2b1fb2}:null;}})[_0x4f89('0x1b')](respondWithResult(_0xc95631,null))[_0x4f89('0x24')](handleError(_0xc95631,null));}; \ No newline at end of file +var _0x9f18=['findAll','params','include','options','find','catch','create','body','getFields','findOne','order','getSubjects','hasOwnProperty','getDescriptions','VtigerField','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','count','includeAll'];(function(_0x5c245d,_0x3be11a){var _0x487e89=function(_0x4d7847){while(--_0x4d7847){_0x5c245d['push'](_0x5c245d['shift']());}};_0x487e89(++_0x3be11a);}(_0x9f18,0x123));var _0x89f1=function(_0x51cc1d,_0xaa88ae){_0x51cc1d=_0x51cc1d-0x0;var _0x2eb9f2=_0x9f18[_0x51cc1d];return _0x2eb9f2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x89f1('0x0'));var rimraf=require(_0x89f1('0x1'));var zipdir=require(_0x89f1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x89f1('0x3'));var moment=require(_0x89f1('0x4'));var BPromise=require(_0x89f1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x89f1('0x6'));var sox=require('sox');var csv=require(_0x89f1('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x89f1('0x8'));var squel=require(_0x89f1('0x9'));var crypto=require(_0x89f1('0xa'));var jsforce=require(_0x89f1('0xb'));var deskjs=require(_0x89f1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x89f1('0xd'));var Papa=require(_0x89f1('0xe'));var Redis=require(_0x89f1('0xf'));var authService=require(_0x89f1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x89f1('0x11'));var hardwareService=require(_0x89f1('0x12'));var logger=require(_0x89f1('0x13'))(_0x89f1('0x14'));var utils=require(_0x89f1('0x15'));var config=require(_0x89f1('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0x89f1('0x17'));var client=jayson[_0x89f1('0x18')][_0x89f1('0x19')]({'port':0x232a});function checkPasswordPattern(_0x49a08e,_0x85273b,_0x458424){if(_0x458424){var _0x20fef1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20fef1['test'](_0x85273b)){return _0x49a08e;}else{throw new db[(_0x89f1('0x1a'))]['ValidationError'](_0x89f1('0x1b'));}}else{return _0x49a08e;}}function respondWithRpcPromise(_0x5f21e0,_0x14c202,_0x2139d6,_0x233526){return new BPromise(function(_0x20b47b,_0x32c375){var _0x374fdd=_0x233526||client;return _0x374fdd[_0x89f1('0x1c')](_0x5f21e0,_0x2139d6)['then'](function(_0x266083){logger[_0x89f1('0x1d')](_0x89f1('0x1e'),_0x14c202,_0x89f1('0x1f'));logger['debug'](_0x89f1('0x20'),_0x14c202,'request\x20sent',JSON[_0x89f1('0x21')](_0x266083));if(_0x266083['error']){if(_0x266083['error'][_0x89f1('0x22')]===0x1f4){logger[_0x89f1('0x23')](_0x89f1('0x1e'),_0x14c202,_0x266083['error'][_0x89f1('0x24')]);return _0x32c375(_0x266083[_0x89f1('0x23')]['message']);}logger[_0x89f1('0x23')](_0x89f1('0x1e'),_0x14c202,_0x266083[_0x89f1('0x23')][_0x89f1('0x24')]);return _0x20b47b(_0x266083[_0x89f1('0x23')][_0x89f1('0x24')]);}else{logger[_0x89f1('0x1d')](_0x89f1('0x1e'),_0x14c202,_0x89f1('0x1f'));_0x20b47b(_0x266083[_0x89f1('0x25')][_0x89f1('0x24')]);}})['catch'](function(_0x1a9f0e){logger[_0x89f1('0x23')](_0x89f1('0x1e'),_0x14c202,_0x1a9f0e);_0x32c375(_0x1a9f0e);});});}function respondWithStatusCode(_0x4c9057,_0xf5a151){_0xf5a151=_0xf5a151||0xcc;return function(_0x31378a){if(_0x31378a){return _0x4c9057[_0x89f1('0x26')](_0xf5a151);}return _0x4c9057[_0x89f1('0x27')](_0xf5a151)[_0x89f1('0x28')]();};}function respondWithResult(_0x45ce6c,_0x5c63f9){_0x5c63f9=_0x5c63f9||0xc8;return function(_0x6b1951){if(_0x6b1951){return _0x45ce6c[_0x89f1('0x27')](_0x5c63f9)[_0x89f1('0x29')](_0x6b1951);}};}function respondWithFilteredResult(_0x4a3cec,_0x1b0b96){return function(_0x30dd6d){if(_0x30dd6d){var _0x303a35=_0x30dd6d['count'],_0x4e7a36=_0x1b0b96[_0x89f1('0x2a')],_0x5d70ea=_0x1b0b96[_0x89f1('0x2a')]+_0x1b0b96[_0x89f1('0x2b')],_0x409326;if(_0x5d70ea>=_0x303a35){_0x5d70ea=_0x303a35;_0x409326=0xc8;}else{_0x409326=0xce;}_0x4a3cec['status'](_0x409326);return _0x4a3cec[_0x89f1('0x2c')](_0x89f1('0x2d'),_0x4e7a36+'-'+_0x5d70ea+'/'+_0x303a35)[_0x89f1('0x29')](_0x30dd6d);}return null;};}function patchUpdates(_0x432434){return function(_0x1f470a){try{jsonpatch[_0x89f1('0x2e')](_0x1f470a,_0x432434,!![]);}catch(_0x1bfe57){return BPromise[_0x89f1('0x2f')](_0x1bfe57);}return _0x1f470a['save']();};}function saveUpdates(_0x46838c,_0x4f6174){return function(_0xe4f1de){if(_0xe4f1de){return _0xe4f1de[_0x89f1('0x30')](_0x46838c)[_0x89f1('0x31')](function(_0x47bf01){return _0x47bf01;});}return null;};}function removeEntity(_0x22b8c8,_0x395039){return function(_0x56cc69){if(_0x56cc69){return _0x56cc69[_0x89f1('0x32')]()['then'](function(){_0x22b8c8[_0x89f1('0x27')](0xcc)[_0x89f1('0x28')]();});}};}function handleEntityNotFound(_0x3f5bf9,_0x4fb080){return function(_0x4eb5a6){if(!_0x4eb5a6){_0x3f5bf9['sendStatus'](0x194);}return _0x4eb5a6;};}function handleError(_0x2bf016,_0x4c9b96){_0x4c9b96=_0x4c9b96||0x1f4;return function(_0xa4998){logger[_0x89f1('0x23')](_0xa4998[_0x89f1('0x33')]);if(_0xa4998[_0x89f1('0x34')]){delete _0xa4998[_0x89f1('0x34')];}_0x2bf016[_0x89f1('0x27')](_0x4c9b96)[_0x89f1('0x35')](_0xa4998);};}exports[_0x89f1('0x36')]=function(_0x2c8dfc,_0x362835){var _0x3f302d={},_0x5801d2={},_0x54ce73={'count':0x0,'rows':[]};var _0x536e25=_[_0x89f1('0x37')](db[_0x89f1('0x38')][_0x89f1('0x39')],function(_0x506abf){return{'name':_0x506abf[_0x89f1('0x3a')],'type':_0x506abf[_0x89f1('0x3b')][_0x89f1('0x3c')]};});_0x5801d2[_0x89f1('0x3d')]=_['map'](_0x536e25,_0x89f1('0x34'));_0x5801d2[_0x89f1('0x3e')]=_[_0x89f1('0x3f')](_0x2c8dfc[_0x89f1('0x3e')]);_0x5801d2[_0x89f1('0x40')]=_['intersection'](_0x5801d2[_0x89f1('0x3d')],_0x5801d2[_0x89f1('0x3e')]);_0x3f302d[_0x89f1('0x41')]=_[_0x89f1('0x42')](_0x5801d2[_0x89f1('0x3d')],qs[_0x89f1('0x43')](_0x2c8dfc[_0x89f1('0x3e')][_0x89f1('0x43')]));_0x3f302d[_0x89f1('0x41')]=_0x3f302d[_0x89f1('0x41')][_0x89f1('0x44')]?_0x3f302d[_0x89f1('0x41')]:_0x5801d2[_0x89f1('0x3d')];if(!_0x2c8dfc[_0x89f1('0x3e')]['hasOwnProperty'](_0x89f1('0x45'))){_0x3f302d[_0x89f1('0x2b')]=qs[_0x89f1('0x2b')](_0x2c8dfc['query']['limit']);_0x3f302d[_0x89f1('0x2a')]=qs[_0x89f1('0x2a')](_0x2c8dfc[_0x89f1('0x3e')]['offset']);}_0x3f302d['order']=qs[_0x89f1('0x46')](_0x2c8dfc[_0x89f1('0x3e')][_0x89f1('0x46')]);_0x3f302d[_0x89f1('0x47')]=qs[_0x89f1('0x40')](_[_0x89f1('0x48')](_0x2c8dfc[_0x89f1('0x3e')],_0x5801d2[_0x89f1('0x40')]));if(_0x2c8dfc[_0x89f1('0x3e')][_0x89f1('0x49')]){_0x3f302d[_0x89f1('0x47')]=_[_0x89f1('0x4a')](_0x3f302d[_0x89f1('0x47')],{'$or':_['map'](_0x536e25,function(_0x2370fc){if(_0x2370fc[_0x89f1('0x3b')]!=='VIRTUAL'){var _0x27c56e={};_0x27c56e[_0x2370fc[_0x89f1('0x34')]]={'$like':'%'+_0x2c8dfc[_0x89f1('0x3e')]['filter']+'%'};return _0x27c56e;}})});}_0x3f302d=_[_0x89f1('0x4a')]({},_0x3f302d,_0x2c8dfc['options']);var _0x144cc2={'where':_0x3f302d[_0x89f1('0x47')]};return db[_0x89f1('0x38')][_0x89f1('0x4b')](_0x144cc2)['then'](function(_0x59f975){_0x54ce73[_0x89f1('0x4b')]=_0x59f975;if(_0x2c8dfc[_0x89f1('0x3e')][_0x89f1('0x4c')]){_0x3f302d['include']=[{'all':!![]}];}return db[_0x89f1('0x38')][_0x89f1('0x4d')](_0x3f302d);})['then'](function(_0xf3cfa4){_0x54ce73['rows']=_0xf3cfa4;return _0x54ce73;})['then'](respondWithFilteredResult(_0x362835,_0x3f302d))['catch'](handleError(_0x362835,null));};exports['show']=function(_0x437177,_0x1af4a5){var _0x5b5bd9={'raw':![],'where':{'id':_0x437177[_0x89f1('0x4e')]['id']}},_0x1965f2={};_0x1965f2['model']=_['keys'](db[_0x89f1('0x38')][_0x89f1('0x39')]);_0x1965f2[_0x89f1('0x3e')]=_[_0x89f1('0x3f')](_0x437177[_0x89f1('0x3e')]);_0x1965f2[_0x89f1('0x40')]=_[_0x89f1('0x42')](_0x1965f2['model'],_0x1965f2[_0x89f1('0x3e')]);_0x5b5bd9[_0x89f1('0x41')]=_[_0x89f1('0x42')](_0x1965f2[_0x89f1('0x3d')],qs[_0x89f1('0x43')](_0x437177['query'][_0x89f1('0x43')]));_0x5b5bd9[_0x89f1('0x41')]=_0x5b5bd9[_0x89f1('0x41')][_0x89f1('0x44')]?_0x5b5bd9[_0x89f1('0x41')]:_0x1965f2[_0x89f1('0x3d')];if(_0x437177[_0x89f1('0x3e')][_0x89f1('0x4c')]){_0x5b5bd9[_0x89f1('0x4f')]=[{'all':!![]}];}_0x5b5bd9=_[_0x89f1('0x4a')]({},_0x5b5bd9,_0x437177[_0x89f1('0x50')]);return db[_0x89f1('0x38')][_0x89f1('0x51')](_0x5b5bd9)['then'](handleEntityNotFound(_0x1af4a5,null))[_0x89f1('0x31')](respondWithResult(_0x1af4a5,null))[_0x89f1('0x52')](handleError(_0x1af4a5,null));};exports[_0x89f1('0x53')]=function(_0x2a3468,_0x3db190){return db[_0x89f1('0x38')][_0x89f1('0x53')](_0x2a3468['body'],{})[_0x89f1('0x31')](respondWithResult(_0x3db190,0xc9))[_0x89f1('0x52')](handleError(_0x3db190,null));};exports['update']=function(_0x5f1cfb,_0x44befd){if(_0x5f1cfb['body']['id']){delete _0x5f1cfb[_0x89f1('0x54')]['id'];}return db[_0x89f1('0x38')][_0x89f1('0x51')]({'where':{'id':_0x5f1cfb[_0x89f1('0x4e')]['id']}})[_0x89f1('0x31')](handleEntityNotFound(_0x44befd,null))[_0x89f1('0x31')](saveUpdates(_0x5f1cfb[_0x89f1('0x54')],null))[_0x89f1('0x31')](respondWithResult(_0x44befd,null))[_0x89f1('0x52')](handleError(_0x44befd,null));};exports[_0x89f1('0x32')]=function(_0x4f0c2a,_0x2bcf37){return db[_0x89f1('0x38')]['find']({'where':{'id':_0x4f0c2a[_0x89f1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2bcf37,null))[_0x89f1('0x31')](removeEntity(_0x2bcf37,null))[_0x89f1('0x52')](handleError(_0x2bcf37,null));};exports[_0x89f1('0x55')]=function(_0x56fcd5,_0x57a413,_0x4e1096){var _0x5881ac={};var _0x1c883a={};var _0x5be4bb;var _0x512da2;return db[_0x89f1('0x38')][_0x89f1('0x56')]({'where':{'id':_0x56fcd5[_0x89f1('0x4e')]['id']}})[_0x89f1('0x31')](handleEntityNotFound(_0x57a413,null))[_0x89f1('0x31')](function(_0x2dfa40){if(_0x2dfa40){_0x5be4bb=_0x2dfa40;_0x1c883a[_0x89f1('0x3d')]=_[_0x89f1('0x3f')](db['VtigerField'][_0x89f1('0x39')]);_0x1c883a['query']=_[_0x89f1('0x3f')](_0x56fcd5[_0x89f1('0x3e')]);_0x1c883a[_0x89f1('0x40')]=_[_0x89f1('0x42')](_0x1c883a['model'],_0x1c883a[_0x89f1('0x3e')]);_0x5881ac['attributes']=_[_0x89f1('0x42')](_0x1c883a[_0x89f1('0x3d')],qs['fields'](_0x56fcd5[_0x89f1('0x3e')]['fields']));_0x5881ac['attributes']=_0x5881ac[_0x89f1('0x41')][_0x89f1('0x44')]?_0x5881ac[_0x89f1('0x41')]:_0x1c883a[_0x89f1('0x3d')];_0x5881ac[_0x89f1('0x57')]=qs[_0x89f1('0x46')](_0x56fcd5['query'][_0x89f1('0x46')]);_0x5881ac['where']=qs[_0x89f1('0x40')](_[_0x89f1('0x48')](_0x56fcd5[_0x89f1('0x3e')],_0x1c883a[_0x89f1('0x40')]));if(_0x56fcd5[_0x89f1('0x3e')][_0x89f1('0x49')]){_0x5881ac['where']=_[_0x89f1('0x4a')](_0x5881ac['where'],{'$or':_['map'](_0x5881ac[_0x89f1('0x41')],function(_0x42cb25){var _0xf4ed5a={};_0xf4ed5a[_0x42cb25]={'$like':'%'+_0x56fcd5['query']['filter']+'%'};return _0xf4ed5a;})});}_0x5881ac=_[_0x89f1('0x4a')]({},_0x5881ac,_0x56fcd5[_0x89f1('0x50')]);return _0x5be4bb['getFields'](_0x5881ac);}})['then'](function(_0x8577e7){if(_0x8577e7){_0x512da2=_0x8577e7[_0x89f1('0x44')];if(!_0x56fcd5[_0x89f1('0x3e')]['hasOwnProperty'](_0x89f1('0x45'))){_0x5881ac['limit']=qs['limit'](_0x56fcd5[_0x89f1('0x3e')]['limit']);_0x5881ac[_0x89f1('0x2a')]=qs['offset'](_0x56fcd5['query'][_0x89f1('0x2a')]);}return _0x5be4bb[_0x89f1('0x55')](_0x5881ac);}})[_0x89f1('0x31')](function(_0x29bd54){if(_0x29bd54){return _0x29bd54?{'count':_0x512da2,'rows':_0x29bd54}:null;}})[_0x89f1('0x31')](respondWithResult(_0x57a413,null))['catch'](handleError(_0x57a413,null));};exports[_0x89f1('0x58')]=function(_0x435d7e,_0x3b1dda,_0x36a182){var _0x2ad95d={};var _0x2d1f01={};var _0x18c1bf;var _0x2ae9b3;return db['VtigerConfiguration'][_0x89f1('0x56')]({'where':{'id':_0x435d7e[_0x89f1('0x4e')]['id']}})[_0x89f1('0x31')](handleEntityNotFound(_0x3b1dda,null))[_0x89f1('0x31')](function(_0x37f22c){if(_0x37f22c){_0x18c1bf=_0x37f22c;_0x2d1f01[_0x89f1('0x3d')]=_['keys'](db['VtigerField'][_0x89f1('0x39')]);_0x2d1f01['query']=_['keys'](_0x435d7e[_0x89f1('0x3e')]);_0x2d1f01[_0x89f1('0x40')]=_['intersection'](_0x2d1f01[_0x89f1('0x3d')],_0x2d1f01[_0x89f1('0x3e')]);_0x2ad95d[_0x89f1('0x41')]=_[_0x89f1('0x42')](_0x2d1f01[_0x89f1('0x3d')],qs[_0x89f1('0x43')](_0x435d7e[_0x89f1('0x3e')]['fields']));_0x2ad95d[_0x89f1('0x41')]=_0x2ad95d[_0x89f1('0x41')]['length']?_0x2ad95d['attributes']:_0x2d1f01[_0x89f1('0x3d')];_0x2ad95d[_0x89f1('0x57')]=qs[_0x89f1('0x46')](_0x435d7e[_0x89f1('0x3e')][_0x89f1('0x46')]);_0x2ad95d[_0x89f1('0x47')]=qs['filters'](_['pick'](_0x435d7e[_0x89f1('0x3e')],_0x2d1f01['filters']));if(_0x435d7e[_0x89f1('0x3e')][_0x89f1('0x49')]){_0x2ad95d[_0x89f1('0x47')]=_[_0x89f1('0x4a')](_0x2ad95d[_0x89f1('0x47')],{'$or':_[_0x89f1('0x37')](_0x2ad95d[_0x89f1('0x41')],function(_0x3abe68){var _0xde8aaa={};_0xde8aaa[_0x3abe68]={'$like':'%'+_0x435d7e['query'][_0x89f1('0x49')]+'%'};return _0xde8aaa;})});}_0x2ad95d=_[_0x89f1('0x4a')]({},_0x2ad95d,_0x435d7e[_0x89f1('0x50')]);return _0x18c1bf['getSubjects'](_0x2ad95d);}})[_0x89f1('0x31')](function(_0x5340e4){if(_0x5340e4){_0x2ae9b3=_0x5340e4[_0x89f1('0x44')];if(!_0x435d7e[_0x89f1('0x3e')][_0x89f1('0x59')](_0x89f1('0x45'))){_0x2ad95d['limit']=qs[_0x89f1('0x2b')](_0x435d7e[_0x89f1('0x3e')][_0x89f1('0x2b')]);_0x2ad95d[_0x89f1('0x2a')]=qs['offset'](_0x435d7e[_0x89f1('0x3e')][_0x89f1('0x2a')]);}return _0x18c1bf[_0x89f1('0x58')](_0x2ad95d);}})[_0x89f1('0x31')](function(_0x190bab){if(_0x190bab){return _0x190bab?{'count':_0x2ae9b3,'rows':_0x190bab}:null;}})[_0x89f1('0x31')](respondWithResult(_0x3b1dda,null))['catch'](handleError(_0x3b1dda,null));};exports[_0x89f1('0x5a')]=function(_0x186da9,_0x40502c,_0x1b8738){var _0x484458={};var _0x57f864={};var _0x90be5b;var _0x56f7a7;return db[_0x89f1('0x38')]['findOne']({'where':{'id':_0x186da9[_0x89f1('0x4e')]['id']}})['then'](handleEntityNotFound(_0x40502c,null))[_0x89f1('0x31')](function(_0x38556c){if(_0x38556c){_0x90be5b=_0x38556c;_0x57f864[_0x89f1('0x3d')]=_[_0x89f1('0x3f')](db[_0x89f1('0x5b')][_0x89f1('0x39')]);_0x57f864[_0x89f1('0x3e')]=_[_0x89f1('0x3f')](_0x186da9[_0x89f1('0x3e')]);_0x57f864['filters']=_['intersection'](_0x57f864['model'],_0x57f864['query']);_0x484458[_0x89f1('0x41')]=_[_0x89f1('0x42')](_0x57f864[_0x89f1('0x3d')],qs[_0x89f1('0x43')](_0x186da9[_0x89f1('0x3e')][_0x89f1('0x43')]));_0x484458[_0x89f1('0x41')]=_0x484458[_0x89f1('0x41')][_0x89f1('0x44')]?_0x484458[_0x89f1('0x41')]:_0x57f864[_0x89f1('0x3d')];_0x484458[_0x89f1('0x57')]=qs['sort'](_0x186da9[_0x89f1('0x3e')][_0x89f1('0x46')]);_0x484458[_0x89f1('0x47')]=qs[_0x89f1('0x40')](_[_0x89f1('0x48')](_0x186da9['query'],_0x57f864['filters']));if(_0x186da9[_0x89f1('0x3e')][_0x89f1('0x49')]){_0x484458['where']=_['merge'](_0x484458['where'],{'$or':_[_0x89f1('0x37')](_0x484458[_0x89f1('0x41')],function(_0x250dea){var _0x51d6ea={};_0x51d6ea[_0x250dea]={'$like':'%'+_0x186da9[_0x89f1('0x3e')][_0x89f1('0x49')]+'%'};return _0x51d6ea;})});}_0x484458=_['merge']({},_0x484458,_0x186da9[_0x89f1('0x50')]);return _0x90be5b['getDescriptions'](_0x484458);}})[_0x89f1('0x31')](function(_0x57da8d){if(_0x57da8d){_0x56f7a7=_0x57da8d[_0x89f1('0x44')];if(!_0x186da9[_0x89f1('0x3e')][_0x89f1('0x59')](_0x89f1('0x45'))){_0x484458[_0x89f1('0x2b')]=qs[_0x89f1('0x2b')](_0x186da9[_0x89f1('0x3e')][_0x89f1('0x2b')]);_0x484458[_0x89f1('0x2a')]=qs[_0x89f1('0x2a')](_0x186da9['query'][_0x89f1('0x2a')]);}return _0x90be5b[_0x89f1('0x5a')](_0x484458);}})[_0x89f1('0x31')](function(_0x2e4d57){if(_0x2e4d57){return _0x2e4d57?{'count':_0x56f7a7,'rows':_0x2e4d57}:null;}})[_0x89f1('0x31')](respondWithResult(_0x40502c,null))[_0x89f1('0x52')](handleError(_0x40502c,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index eadbbba..228fe79 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 _0xabfd=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x59fc7c,_0x1146f2){var _0x2653ff=function(_0x4e4d5f){while(--_0x4e4d5f){_0x59fc7c['push'](_0x59fc7c['shift']());}};_0x2653ff(++_0x1146f2);}(_0xabfd,0x10f));var _0xdabf=function(_0x2f20ee,_0x3e0d4e){_0x2f20ee=_0x2f20ee-0x0;var _0xacbb79=_0xabfd[_0x2f20ee];return _0xacbb79;};'use strict';var _=require(_0xdabf('0x0'));var util=require(_0xdabf('0x1'));var logger=require(_0xdabf('0x2'))(_0xdabf('0x3'));var moment=require(_0xdabf('0x4'));var BPromise=require(_0xdabf('0x5'));var rp=require(_0xdabf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdabf('0x7'));var config=require(_0xdabf('0x8'));var attributes=require(_0xdabf('0x9'));module[_0xdabf('0xa')]=function(_0x9f4b26,_0x595433){return _0x9f4b26[_0xdabf('0xb')](_0xdabf('0xc'),attributes,{'tableName':_0xdabf('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x43a1=['util','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash'];(function(_0x7462b,_0x25571a){var _0x10882c=function(_0x345dc4){while(--_0x345dc4){_0x7462b['push'](_0x7462b['shift']());}};_0x10882c(++_0x25571a);}(_0x43a1,0x1ed));var _0x143a=function(_0x938d88,_0x56ed77){_0x938d88=_0x938d88-0x0;var _0x15b05f=_0x43a1[_0x938d88];return _0x15b05f;};'use strict';var _=require(_0x143a('0x0'));var util=require(_0x143a('0x1'));var logger=require('../../config/logger')(_0x143a('0x2'));var moment=require(_0x143a('0x3'));var BPromise=require('bluebird');var rp=require(_0x143a('0x4'));var fs=require('fs');var path=require(_0x143a('0x5'));var rimraf=require(_0x143a('0x6'));var config=require(_0x143a('0x7'));var attributes=require(_0x143a('0x8'));module[_0x143a('0x9')]=function(_0x11ec55,_0x49c5d6){return _0x11ec55[_0x143a('0xa')](_0x143a('0xb'),attributes,{'tableName':_0x143a('0xc'),'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 5536110..62c44a2 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 _0x700a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','ioredis'];(function(_0x31b350,_0x5be290){var _0x1870dc=function(_0xbae48d){while(--_0xbae48d){_0x31b350['push'](_0x31b350['shift']());}};_0x1870dc(++_0x5be290);}(_0x700a,0x1df));var _0xa700=function(_0x1cb3eb,_0x45b2e3){_0x1cb3eb=_0x1cb3eb-0x0;var _0x4a8fc8=_0x700a[_0x1cb3eb];return _0x4a8fc8;};'use strict';var _=require(_0xa700('0x0'));var util=require(_0xa700('0x1'));var moment=require('moment');var BPromise=require(_0xa700('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa700('0x3'));var db=require(_0xa700('0x4'))['db'];var utils=require(_0xa700('0x5'));var logger=require(_0xa700('0x6'))(_0xa700('0x7'));var config=require(_0xa700('0x8'));var jayson=require(_0xa700('0x9'));var client=jayson['client'][_0xa700('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28533d,_0x34e935,_0x2c05d2){return new BPromise(function(_0x2cc2f5,_0x35a4f9){return client['request'](_0x28533d,_0x2c05d2)[_0xa700('0xb')](function(_0x1f4084){logger[_0xa700('0xc')](_0xa700('0xd'),_0x34e935,'request\x20sent');logger[_0xa700('0xe')](_0xa700('0xf'),_0x34e935,_0xa700('0x10'),JSON[_0xa700('0x11')](_0x1f4084));if(_0x1f4084['error']){if(_0x1f4084[_0xa700('0x12')]['code']===0x1f4){logger[_0xa700('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x34e935,_0x1f4084[_0xa700('0x12')]['message']);return _0x35a4f9(_0x1f4084[_0xa700('0x12')][_0xa700('0x13')]);}logger[_0xa700('0x12')](_0xa700('0xd'),_0x34e935,_0x1f4084[_0xa700('0x12')][_0xa700('0x13')]);return _0x2cc2f5(_0x1f4084[_0xa700('0x12')]['message']);}else{logger[_0xa700('0xc')](_0xa700('0xd'),_0x34e935,_0xa700('0x10'));_0x2cc2f5(_0x1f4084[_0xa700('0x14')][_0xa700('0x13')]);}})['catch'](function(_0x407591){logger[_0xa700('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x34e935,_0x407591);_0x35a4f9(_0x407591);});});} \ No newline at end of file +var _0x69e1=['jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x69e1,0x8b));var _0x169e=function(_0x332d77,_0x2d8142){_0x332d77=_0x332d77-0x0;var _0x1dad08=_0x69e1[_0x332d77];return _0x1dad08;};'use strict';var _=require('lodash');var util=require(_0x169e('0x0'));var moment=require('moment');var BPromise=require(_0x169e('0x1'));var rs=require(_0x169e('0x2'));var fs=require('fs');var Redis=require(_0x169e('0x3'));var db=require(_0x169e('0x4'))['db'];var utils=require(_0x169e('0x5'));var logger=require('../../config/logger')(_0x169e('0x6'));var config=require(_0x169e('0x7'));var jayson=require(_0x169e('0x8'));var client=jayson['client'][_0x169e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x415457,_0x39f5ab,_0x2ce43d){return new BPromise(function(_0x2f3ac9,_0x115d86){return client[_0x169e('0xa')](_0x415457,_0x2ce43d)[_0x169e('0xb')](function(_0x580e51){logger[_0x169e('0xc')](_0x169e('0xd'),_0x39f5ab,_0x169e('0xe'));logger[_0x169e('0xf')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x39f5ab,_0x169e('0xe'),JSON[_0x169e('0x10')](_0x580e51));if(_0x580e51[_0x169e('0x11')]){if(_0x580e51[_0x169e('0x11')][_0x169e('0x12')]===0x1f4){logger[_0x169e('0x11')](_0x169e('0xd'),_0x39f5ab,_0x580e51[_0x169e('0x11')][_0x169e('0x13')]);return _0x115d86(_0x580e51[_0x169e('0x11')][_0x169e('0x13')]);}logger[_0x169e('0x11')](_0x169e('0xd'),_0x39f5ab,_0x580e51[_0x169e('0x11')]['message']);return _0x2f3ac9(_0x580e51[_0x169e('0x11')][_0x169e('0x13')]);}else{logger[_0x169e('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x39f5ab,'request\x20sent');_0x2f3ac9(_0x580e51['result']['message']);}})[_0x169e('0x14')](function(_0x2f3180){logger[_0x169e('0x11')](_0x169e('0xd'),_0x39f5ab,_0x2f3180);_0x115d86(_0x2f3180);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 2a3d120..79e4bf3 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 _0x6a1a=['../../config/environment','isAuthenticated','index','get','show','create','put','update','delete','/:id','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6a1a,0x1d7));var _0xa6a1=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x6a1a[_0x2d61b2];return _0x12df89;};'use strict';var multer=require('multer');var util=require(_0xa6a1('0x0'));var path=require('path');var timeout=require(_0xa6a1('0x1'));var express=require(_0xa6a1('0x2'));var router=express['Router']();var auth=require(_0xa6a1('0x3'));var interaction=require(_0xa6a1('0x4'));var config=require(_0xa6a1('0x5'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0x7')]);router[_0xa6a1('0x8')]('/:id',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0x9')]);router['post']('/',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0xa')]);router[_0xa6a1('0xb')]('/:id',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0xc')]);router[_0xa6a1('0xd')](_0xa6a1('0xe'),auth[_0xa6a1('0x6')](),controller[_0xa6a1('0xf')]);module[_0xa6a1('0x10')]=router; \ No newline at end of file +var _0xaa35=['get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa35,0x11d));var _0x5aa3=function(_0x5cc51f,_0x22c480){_0x5cc51f=_0x5cc51f-0x0;var _0x315a2f=_0xaa35[_0x5cc51f];return _0x315a2f;};'use strict';var multer=require('multer');var util=require(_0x5aa3('0x0'));var path=require(_0x5aa3('0x1'));var timeout=require(_0x5aa3('0x2'));var express=require(_0x5aa3('0x3'));var router=express[_0x5aa3('0x4')]();var auth=require(_0x5aa3('0x5'));var interaction=require(_0x5aa3('0x6'));var config=require(_0x5aa3('0x7'));var controller=require(_0x5aa3('0x8'));router[_0x5aa3('0x9')]('/',auth['isAuthenticated'](),controller[_0x5aa3('0xa')]);router['get'](_0x5aa3('0xb'),auth[_0x5aa3('0xc')](),controller[_0x5aa3('0xd')]);router[_0x5aa3('0xe')]('/',auth['isAuthenticated'](),controller[_0x5aa3('0xf')]);router[_0x5aa3('0x10')](_0x5aa3('0xb'),auth[_0x5aa3('0xc')](),controller[_0x5aa3('0x11')]);router[_0x5aa3('0x12')](_0x5aa3('0xb'),auth[_0x5aa3('0xc')](),controller[_0x5aa3('0x13')]);module[_0x5aa3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 47f837a..e4c353b 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 _0x5c54=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c54,0x71));var _0x45c5=function(_0x506090,_0x44d91c){_0x506090=_0x506090-0x0;var _0x152fc3=_0x5c54[_0x506090];return _0x152fc3;};'use strict';var Sequelize=require(_0x45c5('0x0'));module[_0x45c5('0x1')]={'type':{'type':Sequelize[_0x45c5('0x2')]('string','variable',_0x45c5('0x3'),_0x45c5('0x4')),'defaultValue':_0x45c5('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x45c5('0x6')]},'keyType':{'type':Sequelize[_0x45c5('0x2')]('string',_0x45c5('0x7'),_0x45c5('0x3'))},'keyContent':{'type':Sequelize[_0x45c5('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x45c5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x45c5('0x6')]}}; \ No newline at end of file +var _0x006d=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x2343b0,_0x3b4437){var _0x1e20b1=function(_0x15c8d9){while(--_0x15c8d9){_0x2343b0['push'](_0x2343b0['shift']());}};_0x1e20b1(++_0x3b4437);}(_0x006d,0xea));var _0xd006=function(_0x594a7c,_0x2023d1){_0x594a7c=_0x594a7c-0x0;var _0x13576b=_0x006d[_0x594a7c];return _0x13576b;};'use strict';var Sequelize=require(_0xd006('0x0'));module[_0xd006('0x1')]={'type':{'type':Sequelize[_0xd006('0x2')](_0xd006('0x3'),_0xd006('0x4'),_0xd006('0x5'),_0xd006('0x6')),'defaultValue':_0xd006('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xd006('0x2')](_0xd006('0x3'),'variable',_0xd006('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd006('0x7')]},'nameField':{'type':Sequelize[_0xd006('0x7')]},'customField':{'type':Sequelize[_0xd006('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd006('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 55a603e..77000cb 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 _0x741c=['show','include','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','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','sendStatus','status','end','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','map','VtigerField','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x478bca,_0x232af4){var _0x3cd342=function(_0x5015b3){while(--_0x5015b3){_0x478bca['push'](_0x478bca['shift']());}};_0x3cd342(++_0x232af4);}(_0x741c,0x16e));var _0xc741=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x741c[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xc741('0x0'));var emlformat=require(_0xc741('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc741('0x2'));var jsonpatch=require(_0xc741('0x3'));var rp=require(_0xc741('0x4'));var moment=require('moment');var BPromise=require(_0xc741('0x5'));var Mustache=require('mustache');var util=require(_0xc741('0x6'));var path=require(_0xc741('0x7'));var sox=require(_0xc741('0x8'));var csv=require(_0xc741('0x9'));var ejs=require(_0xc741('0xa'));var fs=require('fs');var _=require(_0xc741('0xb'));var squel=require(_0xc741('0xc'));var crypto=require(_0xc741('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc741('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc741('0xf'));var Papa=require(_0xc741('0x10'));var Redis=require(_0xc741('0x11'));var authService=require(_0xc741('0x12'));var qs=require(_0xc741('0x13'));var as=require(_0xc741('0x14'));var hardwareService=require(_0xc741('0x15'));var logger=require(_0xc741('0x16'))('api');var utils=require(_0xc741('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fb4d3,_0x363d17){_0x363d17=_0x363d17||0xcc;return function(_0x432fc2){if(_0x432fc2){return _0x2fb4d3[_0xc741('0x18')](_0x363d17);}return _0x2fb4d3[_0xc741('0x19')](_0x363d17)[_0xc741('0x1a')]();};}function respondWithResult(_0x11ba2b,_0x53c5d7){_0x53c5d7=_0x53c5d7||0xc8;return function(_0x259e88){if(_0x259e88){return _0x11ba2b[_0xc741('0x19')](_0x53c5d7)['json'](_0x259e88);}};}function respondWithFilteredResult(_0xf85850,_0x5e5483){return function(_0x13bbbe){if(_0x13bbbe){var _0x9afa5d=_0x13bbbe[_0xc741('0x1b')],_0x3bc354=_0x5e5483[_0xc741('0x1c')],_0x393283=_0x5e5483['offset']+_0x5e5483[_0xc741('0x1d')],_0x2a8de5;if(_0x393283>=_0x9afa5d){_0x393283=_0x9afa5d;_0x2a8de5=0xc8;}else{_0x2a8de5=0xce;}_0xf85850[_0xc741('0x19')](_0x2a8de5);return _0xf85850[_0xc741('0x1e')]('Content-Range',_0x3bc354+'-'+_0x393283+'/'+_0x9afa5d)['json'](_0x13bbbe);}return null;};}function patchUpdates(_0x1286ce){return function(_0x52bfe4){try{jsonpatch['apply'](_0x52bfe4,_0x1286ce,!![]);}catch(_0x36a78a){return BPromise[_0xc741('0x1f')](_0x36a78a);}return _0x52bfe4[_0xc741('0x20')]();};}function saveUpdates(_0x5a6dd,_0x5e1a1b){return function(_0x3e4934){if(_0x3e4934){return _0x3e4934[_0xc741('0x21')](_0x5a6dd)[_0xc741('0x22')](function(_0x2a77ba){return _0x2a77ba;});}return null;};}function removeEntity(_0x10cfd3,_0x870add){return function(_0x34bb0b){if(_0x34bb0b){return _0x34bb0b[_0xc741('0x23')]()['then'](function(){_0x10cfd3[_0xc741('0x19')](0xcc)[_0xc741('0x1a')]();});}};}function handleEntityNotFound(_0x151dc8,_0x158736){return function(_0x28a58b){if(!_0x28a58b){_0x151dc8[_0xc741('0x18')](0x194);}return _0x28a58b;};}function handleError(_0x4f57d3,_0x4332a0){_0x4332a0=_0x4332a0||0x1f4;return function(_0x421f29){logger[_0xc741('0x24')](_0x421f29[_0xc741('0x25')]);if(_0x421f29[_0xc741('0x26')]){delete _0x421f29[_0xc741('0x26')];}_0x4f57d3[_0xc741('0x19')](_0x4332a0)[_0xc741('0x27')](_0x421f29);};}exports['index']=function(_0x2e053b,_0x1430e5){var _0xcbb71={},_0x9b0155={},_0x124cb0={'count':0x0,'rows':[]};var _0x499d76=_[_0xc741('0x28')](db[_0xc741('0x29')][_0xc741('0x2a')],function(_0x5c4a6b){return{'name':_0x5c4a6b[_0xc741('0x2b')],'type':_0x5c4a6b['type']['key']};});_0x9b0155[_0xc741('0x2c')]=_[_0xc741('0x28')](_0x499d76,_0xc741('0x26'));_0x9b0155[_0xc741('0x2d')]=_[_0xc741('0x2e')](_0x2e053b['query']);_0x9b0155['filters']=_[_0xc741('0x2f')](_0x9b0155[_0xc741('0x2c')],_0x9b0155[_0xc741('0x2d')]);_0xcbb71['attributes']=_['intersection'](_0x9b0155[_0xc741('0x2c')],qs[_0xc741('0x30')](_0x2e053b['query']['fields']));_0xcbb71[_0xc741('0x31')]=_0xcbb71[_0xc741('0x31')][_0xc741('0x32')]?_0xcbb71['attributes']:_0x9b0155[_0xc741('0x2c')];if(!_0x2e053b[_0xc741('0x2d')][_0xc741('0x33')](_0xc741('0x34'))){_0xcbb71[_0xc741('0x1d')]=qs[_0xc741('0x1d')](_0x2e053b[_0xc741('0x2d')][_0xc741('0x1d')]);_0xcbb71['offset']=qs[_0xc741('0x1c')](_0x2e053b[_0xc741('0x2d')][_0xc741('0x1c')]);}_0xcbb71[_0xc741('0x35')]=qs[_0xc741('0x36')](_0x2e053b[_0xc741('0x2d')][_0xc741('0x36')]);_0xcbb71[_0xc741('0x37')]=qs['filters'](_['pick'](_0x2e053b[_0xc741('0x2d')],_0x9b0155[_0xc741('0x38')]));if(_0x2e053b[_0xc741('0x2d')][_0xc741('0x39')]){_0xcbb71[_0xc741('0x37')]=_[_0xc741('0x3a')](_0xcbb71[_0xc741('0x37')],{'$or':_[_0xc741('0x28')](_0x499d76,function(_0x41db0e){if(_0x41db0e[_0xc741('0x3b')]!==_0xc741('0x3c')){var _0xa7b147={};_0xa7b147[_0x41db0e[_0xc741('0x26')]]={'$like':'%'+_0x2e053b[_0xc741('0x2d')]['filter']+'%'};return _0xa7b147;}})});}_0xcbb71=_[_0xc741('0x3a')]({},_0xcbb71,_0x2e053b[_0xc741('0x3d')]);var _0x1dd8ba={'where':_0xcbb71[_0xc741('0x37')]};return db[_0xc741('0x29')][_0xc741('0x1b')](_0x1dd8ba)[_0xc741('0x22')](function(_0x1f0898){_0x124cb0['count']=_0x1f0898;if(_0x2e053b[_0xc741('0x2d')][_0xc741('0x3e')]){_0xcbb71['include']=[{'all':!![]}];}return db[_0xc741('0x29')][_0xc741('0x3f')](_0xcbb71);})[_0xc741('0x22')](function(_0x58184e){_0x124cb0[_0xc741('0x40')]=_0x58184e;return _0x124cb0;})[_0xc741('0x22')](respondWithFilteredResult(_0x1430e5,_0xcbb71))[_0xc741('0x41')](handleError(_0x1430e5,null));};exports[_0xc741('0x42')]=function(_0x4028dd,_0x43850b){var _0x4b7205={'raw':!![],'where':{'id':_0x4028dd['params']['id']}},_0x61bcd4={};_0x61bcd4[_0xc741('0x2c')]=_[_0xc741('0x2e')](db['VtigerField']['rawAttributes']);_0x61bcd4[_0xc741('0x2d')]=_[_0xc741('0x2e')](_0x4028dd[_0xc741('0x2d')]);_0x61bcd4[_0xc741('0x38')]=_[_0xc741('0x2f')](_0x61bcd4[_0xc741('0x2c')],_0x61bcd4[_0xc741('0x2d')]);_0x4b7205[_0xc741('0x31')]=_[_0xc741('0x2f')](_0x61bcd4[_0xc741('0x2c')],qs['fields'](_0x4028dd['query']['fields']));_0x4b7205['attributes']=_0x4b7205[_0xc741('0x31')][_0xc741('0x32')]?_0x4b7205[_0xc741('0x31')]:_0x61bcd4['model'];if(_0x4028dd[_0xc741('0x2d')]['includeAll']){_0x4b7205[_0xc741('0x43')]=[{'all':!![]}];}_0x4b7205=_['merge']({},_0x4b7205,_0x4028dd[_0xc741('0x3d')]);return db[_0xc741('0x29')][_0xc741('0x44')](_0x4b7205)[_0xc741('0x22')](handleEntityNotFound(_0x43850b,null))[_0xc741('0x22')](respondWithResult(_0x43850b,null))[_0xc741('0x41')](handleError(_0x43850b,null));};exports[_0xc741('0x45')]=function(_0x3b5655,_0x5d5dac){return db[_0xc741('0x29')][_0xc741('0x45')](_0x3b5655[_0xc741('0x46')],{})[_0xc741('0x22')](respondWithResult(_0x5d5dac,0xc9))[_0xc741('0x41')](handleError(_0x5d5dac,null));};exports[_0xc741('0x21')]=function(_0x579f23,_0x251d70){if(_0x579f23[_0xc741('0x46')]['id']){delete _0x579f23['body']['id'];}return db[_0xc741('0x29')]['find']({'where':{'id':_0x579f23[_0xc741('0x47')]['id']}})[_0xc741('0x22')](handleEntityNotFound(_0x251d70,null))[_0xc741('0x22')](saveUpdates(_0x579f23[_0xc741('0x46')],null))[_0xc741('0x22')](respondWithResult(_0x251d70,null))['catch'](handleError(_0x251d70,null));};exports['destroy']=function(_0x3c4e4f,_0x71b1e4){return db[_0xc741('0x29')][_0xc741('0x44')]({'where':{'id':_0x3c4e4f['params']['id']}})[_0xc741('0x22')](handleEntityNotFound(_0x71b1e4,null))[_0xc741('0x22')](removeEntity(_0x71b1e4,null))['catch'](handleError(_0x71b1e4,null));}; \ No newline at end of file +var _0x10ba=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','VtigerField','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','options','count','includeAll','include','findAll','catch','show','create','body','find','params','eml-format'];(function(_0xb897b0,_0x5a707a){var _0x446c6d=function(_0x5690bd){while(--_0x5690bd){_0xb897b0['push'](_0xb897b0['shift']());}};_0x446c6d(++_0x5a707a);}(_0x10ba,0x153));var _0xa10b=function(_0x258b93,_0x188ccc){_0x258b93=_0x258b93-0x0;var _0x35484b=_0x10ba[_0x258b93];return _0x35484b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa10b('0x0'));var rimraf=require(_0xa10b('0x1'));var zipdir=require(_0xa10b('0x2'));var jsonpatch=require(_0xa10b('0x3'));var rp=require(_0xa10b('0x4'));var moment=require(_0xa10b('0x5'));var BPromise=require(_0xa10b('0x6'));var Mustache=require('mustache');var util=require(_0xa10b('0x7'));var path=require('path');var sox=require(_0xa10b('0x8'));var csv=require(_0xa10b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa10b('0xa'));var squel=require(_0xa10b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa10b('0xc'));var Redis=require(_0xa10b('0xd'));var authService=require(_0xa10b('0xe'));var qs=require(_0xa10b('0xf'));var as=require(_0xa10b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa10b('0x11'))(_0xa10b('0x12'));var utils=require(_0xa10b('0x13'));var config=require(_0xa10b('0x14'));var db=require(_0xa10b('0x15'))['db'];function respondWithStatusCode(_0x294a46,_0x333cc4){_0x333cc4=_0x333cc4||0xcc;return function(_0x27f8d6){if(_0x27f8d6){return _0x294a46[_0xa10b('0x16')](_0x333cc4);}return _0x294a46[_0xa10b('0x17')](_0x333cc4)['end']();};}function respondWithResult(_0x3198ee,_0x5c511f){_0x5c511f=_0x5c511f||0xc8;return function(_0x43d194){if(_0x43d194){return _0x3198ee[_0xa10b('0x17')](_0x5c511f)[_0xa10b('0x18')](_0x43d194);}};}function respondWithFilteredResult(_0xcf228b,_0x3c9ad4){return function(_0x33d6dd){if(_0x33d6dd){var _0x2d0ccd=_0x33d6dd['count'],_0x87c409=_0x3c9ad4[_0xa10b('0x19')],_0x53f10f=_0x3c9ad4[_0xa10b('0x19')]+_0x3c9ad4[_0xa10b('0x1a')],_0x53b80e;if(_0x53f10f>=_0x2d0ccd){_0x53f10f=_0x2d0ccd;_0x53b80e=0xc8;}else{_0x53b80e=0xce;}_0xcf228b['status'](_0x53b80e);return _0xcf228b['set'](_0xa10b('0x1b'),_0x87c409+'-'+_0x53f10f+'/'+_0x2d0ccd)['json'](_0x33d6dd);}return null;};}function patchUpdates(_0x33bb55){return function(_0x754c73){try{jsonpatch[_0xa10b('0x1c')](_0x754c73,_0x33bb55,!![]);}catch(_0x83054a){return BPromise[_0xa10b('0x1d')](_0x83054a);}return _0x754c73[_0xa10b('0x1e')]();};}function saveUpdates(_0x3b48f3,_0x484041){return function(_0x590223){if(_0x590223){return _0x590223[_0xa10b('0x1f')](_0x3b48f3)[_0xa10b('0x20')](function(_0x5d8ee0){return _0x5d8ee0;});}return null;};}function removeEntity(_0x509876,_0x9421f8){return function(_0x713cdc){if(_0x713cdc){return _0x713cdc[_0xa10b('0x21')]()['then'](function(){_0x509876['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x460a98,_0x219464){return function(_0x5cce93){if(!_0x5cce93){_0x460a98[_0xa10b('0x16')](0x194);}return _0x5cce93;};}function handleError(_0x4c788a,_0x6f2e4b){_0x6f2e4b=_0x6f2e4b||0x1f4;return function(_0x443823){logger[_0xa10b('0x22')](_0x443823[_0xa10b('0x23')]);if(_0x443823['name']){delete _0x443823['name'];}_0x4c788a[_0xa10b('0x17')](_0x6f2e4b)['send'](_0x443823);};}exports['index']=function(_0x227caf,_0x4ec0e6){var _0x2015b6={},_0x2f0ae5={},_0x4e39da={'count':0x0,'rows':[]};var _0x209c67=_['map'](db[_0xa10b('0x24')][_0xa10b('0x25')],function(_0x2d769d){return{'name':_0x2d769d['fieldName'],'type':_0x2d769d[_0xa10b('0x26')][_0xa10b('0x27')]};});_0x2f0ae5['model']=_['map'](_0x209c67,_0xa10b('0x28'));_0x2f0ae5[_0xa10b('0x29')]=_[_0xa10b('0x2a')](_0x227caf[_0xa10b('0x29')]);_0x2f0ae5[_0xa10b('0x2b')]=_[_0xa10b('0x2c')](_0x2f0ae5[_0xa10b('0x2d')],_0x2f0ae5[_0xa10b('0x29')]);_0x2015b6[_0xa10b('0x2e')]=_['intersection'](_0x2f0ae5[_0xa10b('0x2d')],qs[_0xa10b('0x2f')](_0x227caf[_0xa10b('0x29')][_0xa10b('0x2f')]));_0x2015b6[_0xa10b('0x2e')]=_0x2015b6['attributes'][_0xa10b('0x30')]?_0x2015b6['attributes']:_0x2f0ae5[_0xa10b('0x2d')];if(!_0x227caf['query']['hasOwnProperty'](_0xa10b('0x31'))){_0x2015b6[_0xa10b('0x1a')]=qs['limit'](_0x227caf[_0xa10b('0x29')][_0xa10b('0x1a')]);_0x2015b6[_0xa10b('0x19')]=qs[_0xa10b('0x19')](_0x227caf[_0xa10b('0x29')][_0xa10b('0x19')]);}_0x2015b6[_0xa10b('0x32')]=qs[_0xa10b('0x33')](_0x227caf['query']['sort']);_0x2015b6['where']=qs['filters'](_[_0xa10b('0x34')](_0x227caf[_0xa10b('0x29')],_0x2f0ae5[_0xa10b('0x2b')]));if(_0x227caf[_0xa10b('0x29')][_0xa10b('0x35')]){_0x2015b6[_0xa10b('0x36')]=_[_0xa10b('0x37')](_0x2015b6[_0xa10b('0x36')],{'$or':_[_0xa10b('0x38')](_0x209c67,function(_0x3d2fe7){if(_0x3d2fe7['type']!=='VIRTUAL'){var _0x3416aa={};_0x3416aa[_0x3d2fe7[_0xa10b('0x28')]]={'$like':'%'+_0x227caf['query'][_0xa10b('0x35')]+'%'};return _0x3416aa;}})});}_0x2015b6=_[_0xa10b('0x37')]({},_0x2015b6,_0x227caf[_0xa10b('0x39')]);var _0x30f715={'where':_0x2015b6[_0xa10b('0x36')]};return db['VtigerField']['count'](_0x30f715)[_0xa10b('0x20')](function(_0xa1adc7){_0x4e39da[_0xa10b('0x3a')]=_0xa1adc7;if(_0x227caf[_0xa10b('0x29')][_0xa10b('0x3b')]){_0x2015b6[_0xa10b('0x3c')]=[{'all':!![]}];}return db[_0xa10b('0x24')][_0xa10b('0x3d')](_0x2015b6);})['then'](function(_0x1a0a42){_0x4e39da['rows']=_0x1a0a42;return _0x4e39da;})[_0xa10b('0x20')](respondWithFilteredResult(_0x4ec0e6,_0x2015b6))[_0xa10b('0x3e')](handleError(_0x4ec0e6,null));};exports[_0xa10b('0x3f')]=function(_0x287ed1,_0x181914){var _0x5da063={'raw':!![],'where':{'id':_0x287ed1['params']['id']}},_0x53e7de={};_0x53e7de['model']=_[_0xa10b('0x2a')](db[_0xa10b('0x24')]['rawAttributes']);_0x53e7de[_0xa10b('0x29')]=_[_0xa10b('0x2a')](_0x287ed1['query']);_0x53e7de[_0xa10b('0x2b')]=_['intersection'](_0x53e7de[_0xa10b('0x2d')],_0x53e7de[_0xa10b('0x29')]);_0x5da063[_0xa10b('0x2e')]=_['intersection'](_0x53e7de[_0xa10b('0x2d')],qs[_0xa10b('0x2f')](_0x287ed1[_0xa10b('0x29')][_0xa10b('0x2f')]));_0x5da063['attributes']=_0x5da063[_0xa10b('0x2e')][_0xa10b('0x30')]?_0x5da063[_0xa10b('0x2e')]:_0x53e7de['model'];if(_0x287ed1[_0xa10b('0x29')][_0xa10b('0x3b')]){_0x5da063[_0xa10b('0x3c')]=[{'all':!![]}];}_0x5da063=_[_0xa10b('0x37')]({},_0x5da063,_0x287ed1[_0xa10b('0x39')]);return db[_0xa10b('0x24')]['find'](_0x5da063)[_0xa10b('0x20')](handleEntityNotFound(_0x181914,null))[_0xa10b('0x20')](respondWithResult(_0x181914,null))[_0xa10b('0x3e')](handleError(_0x181914,null));};exports['create']=function(_0x15a602,_0x15c2d4){return db['VtigerField'][_0xa10b('0x40')](_0x15a602[_0xa10b('0x41')],{})[_0xa10b('0x20')](respondWithResult(_0x15c2d4,0xc9))[_0xa10b('0x3e')](handleError(_0x15c2d4,null));};exports[_0xa10b('0x1f')]=function(_0x26fee6,_0x7d0560){if(_0x26fee6[_0xa10b('0x41')]['id']){delete _0x26fee6[_0xa10b('0x41')]['id'];}return db['VtigerField'][_0xa10b('0x42')]({'where':{'id':_0x26fee6[_0xa10b('0x43')]['id']}})['then'](handleEntityNotFound(_0x7d0560,null))[_0xa10b('0x20')](saveUpdates(_0x26fee6[_0xa10b('0x41')],null))[_0xa10b('0x20')](respondWithResult(_0x7d0560,null))[_0xa10b('0x3e')](handleError(_0x7d0560,null));};exports[_0xa10b('0x21')]=function(_0x3ce7bc,_0x1ae3e8){return db[_0xa10b('0x24')][_0xa10b('0x42')]({'where':{'id':_0x3ce7bc['params']['id']}})[_0xa10b('0x20')](handleEntityNotFound(_0x1ae3e8,null))['then'](removeEntity(_0x1ae3e8,null))[_0xa10b('0x3e')](handleError(_0x1ae3e8,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index edda36f..82a0ee3 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 _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x373ff9,_0x1487a8){var _0x1c283c=function(_0x440add){while(--_0x440add){_0x373ff9['push'](_0x373ff9['shift']());}};_0x1c283c(++_0x1487a8);}(_0x7a54,0x106));var _0x47a5=function(_0x3b72d1,_0x2939c0){_0x3b72d1=_0x3b72d1-0x0;var _0x3b83b6=_0x7a54[_0x3b72d1];return _0x3b83b6;};'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':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x10fdd4,_0x5b0853){var _0x361079=function(_0x146144){while(--_0x146144){_0x10fdd4['push'](_0x10fdd4['shift']());}};_0x361079(++_0x5b0853);}(_0x7a54,0x106));var _0x47a5=function(_0x3018bb,_0x432fbd){_0x3018bb=_0x3018bb-0x0;var _0x4f63ab=_0x7a54[_0x3018bb];return _0x4f63ab;};'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':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'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 afb96b9..c8bc771 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 _0xc648=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xc648,0x171));var _0x8c64=function(_0x3a01a7,_0x1416cc){_0x3a01a7=_0x3a01a7-0x0;var _0x58c5b3=_0xc648[_0x3a01a7];return _0x58c5b3;};'use strict';var _=require('lodash');var util=require(_0x8c64('0x0'));var moment=require(_0x8c64('0x1'));var BPromise=require(_0x8c64('0x2'));var rs=require(_0x8c64('0x3'));var fs=require('fs');var Redis=require(_0x8c64('0x4'));var db=require(_0x8c64('0x5'))['db'];var utils=require(_0x8c64('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8c64('0x7'));var client=jayson[_0x8c64('0x8')][_0x8c64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1be93f,_0x507d58,_0x39644b){return new BPromise(function(_0x3a0a91,_0x2483a5){return client[_0x8c64('0xa')](_0x1be93f,_0x39644b)[_0x8c64('0xb')](function(_0x5e78c4){logger[_0x8c64('0xc')](_0x8c64('0xd'),_0x507d58,'request\x20sent');logger[_0x8c64('0xe')](_0x8c64('0xf'),_0x507d58,_0x8c64('0x10'),JSON[_0x8c64('0x11')](_0x5e78c4));if(_0x5e78c4[_0x8c64('0x12')]){if(_0x5e78c4[_0x8c64('0x12')][_0x8c64('0x13')]===0x1f4){logger[_0x8c64('0x12')](_0x8c64('0xd'),_0x507d58,_0x5e78c4[_0x8c64('0x12')]['message']);return _0x2483a5(_0x5e78c4[_0x8c64('0x12')][_0x8c64('0x14')]);}logger[_0x8c64('0x12')](_0x8c64('0xd'),_0x507d58,_0x5e78c4[_0x8c64('0x12')][_0x8c64('0x14')]);return _0x3a0a91(_0x5e78c4[_0x8c64('0x12')]['message']);}else{logger[_0x8c64('0xc')](_0x8c64('0xd'),_0x507d58,'request\x20sent');_0x3a0a91(_0x5e78c4[_0x8c64('0x15')][_0x8c64('0x14')]);}})['catch'](function(_0x2c3739){logger[_0x8c64('0x12')]('VtigerField,\x20%s,\x20%s',_0x507d58,_0x2c3739);_0x2483a5(_0x2c3739);});});} \ No newline at end of file +var _0x135b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x8ba8d5,_0x530fbf){var _0x4b6e91=function(_0x4da624){while(--_0x4da624){_0x8ba8d5['push'](_0x8ba8d5['shift']());}};_0x4b6e91(++_0x530fbf);}(_0x135b,0xaf));var _0xb135=function(_0xe3752c,_0x4e6169){_0xe3752c=_0xe3752c-0x0;var _0x2ce6e2=_0x135b[_0xe3752c];return _0x2ce6e2;};'use strict';var _=require(_0xb135('0x0'));var util=require(_0xb135('0x1'));var moment=require(_0xb135('0x2'));var BPromise=require(_0xb135('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb135('0x4'));var db=require(_0xb135('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb135('0x6'))(_0xb135('0x7'));var config=require(_0xb135('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11780d,_0x2c061e,_0x2b57dd){return new BPromise(function(_0xdc547c,_0x4e0148){return client[_0xb135('0x9')](_0x11780d,_0x2b57dd)[_0xb135('0xa')](function(_0xe5ab67){logger[_0xb135('0xb')](_0xb135('0xc'),_0x2c061e,_0xb135('0xd'));logger[_0xb135('0xe')](_0xb135('0xf'),_0x2c061e,_0xb135('0xd'),JSON[_0xb135('0x10')](_0xe5ab67));if(_0xe5ab67[_0xb135('0x11')]){if(_0xe5ab67[_0xb135('0x11')][_0xb135('0x12')]===0x1f4){logger[_0xb135('0x11')](_0xb135('0xc'),_0x2c061e,_0xe5ab67[_0xb135('0x11')][_0xb135('0x13')]);return _0x4e0148(_0xe5ab67[_0xb135('0x11')][_0xb135('0x13')]);}logger['error'](_0xb135('0xc'),_0x2c061e,_0xe5ab67['error'][_0xb135('0x13')]);return _0xdc547c(_0xe5ab67[_0xb135('0x11')][_0xb135('0x13')]);}else{logger[_0xb135('0xb')](_0xb135('0xc'),_0x2c061e,_0xb135('0xd'));_0xdc547c(_0xe5ab67[_0xb135('0x14')][_0xb135('0x13')]);}})[_0xb135('0x15')](function(_0x4ff564){logger[_0xb135('0x11')](_0xb135('0xc'),_0x2c061e,_0x4ff564);_0x4e0148(_0x4ff564);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 46c2cfe..b2d88a4 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 _0xdd4c=['getFields','post','create','addConfiguration','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields'];(function(_0x49811b,_0x2dd306){var _0x3f2b9a=function(_0x36e1ee){while(--_0x36e1ee){_0x49811b['push'](_0x49811b['shift']());}};_0x3f2b9a(++_0x2dd306);}(_0xdd4c,0x110));var _0xcdd4=function(_0x51beb4,_0x5095bd){_0x51beb4=_0x51beb4-0x0;var _0x231a39=_0xdd4c[_0x51beb4];return _0x231a39;};'use strict';var multer=require(_0xcdd4('0x0'));var util=require(_0xcdd4('0x1'));var path=require(_0xcdd4('0x2'));var timeout=require(_0xcdd4('0x3'));var express=require(_0xcdd4('0x4'));var router=express[_0xcdd4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xcdd4('0x6'));var config=require(_0xcdd4('0x7'));var controller=require(_0xcdd4('0x8'));router[_0xcdd4('0x9')]('/',auth[_0xcdd4('0xa')](),controller[_0xcdd4('0xb')]);router[_0xcdd4('0x9')]('/:id',auth[_0xcdd4('0xa')](),controller['show']);router[_0xcdd4('0x9')](_0xcdd4('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xcdd4('0x9')](_0xcdd4('0xd'),auth['isAuthenticated'](),controller[_0xcdd4('0xe')]);router[_0xcdd4('0xf')]('/',auth['isAuthenticated'](),controller[_0xcdd4('0x10')]);router[_0xcdd4('0xf')](_0xcdd4('0xc'),auth['isAuthenticated'](),controller[_0xcdd4('0x11')]);router['put'](_0xcdd4('0x12'),auth[_0xcdd4('0xa')](),controller[_0xcdd4('0x13')]);router[_0xcdd4('0x14')]('/:id',auth[_0xcdd4('0xa')](),controller[_0xcdd4('0x15')]);module['exports']=router; \ No newline at end of file +var _0x3fb5=['getConfigurations','/:id/fields','getFields','create','post','put','/:id','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations'];(function(_0x2311a7,_0xa58842){var _0x58a5e2=function(_0x353eb1){while(--_0x353eb1){_0x2311a7['push'](_0x2311a7['shift']());}};_0x58a5e2(++_0xa58842);}(_0x3fb5,0x1ab));var _0x53fb=function(_0x230c72,_0xc00229){_0x230c72=_0x230c72-0x0;var _0x5d4756=_0x3fb5[_0x230c72];return _0x5d4756;};'use strict';var multer=require('multer');var util=require(_0x53fb('0x0'));var path=require(_0x53fb('0x1'));var timeout=require(_0x53fb('0x2'));var express=require(_0x53fb('0x3'));var router=express['Router']();var auth=require(_0x53fb('0x4'));var interaction=require(_0x53fb('0x5'));var config=require(_0x53fb('0x6'));var controller=require(_0x53fb('0x7'));router[_0x53fb('0x8')]('/',auth[_0x53fb('0x9')](),controller[_0x53fb('0xa')]);router[_0x53fb('0x8')]('/:id',auth[_0x53fb('0x9')](),controller[_0x53fb('0xb')]);router[_0x53fb('0x8')](_0x53fb('0xc'),auth[_0x53fb('0x9')](),controller[_0x53fb('0xd')]);router[_0x53fb('0x8')](_0x53fb('0xe'),auth['isAuthenticated'](),controller[_0x53fb('0xf')]);router['post']('/',auth[_0x53fb('0x9')](),controller[_0x53fb('0x10')]);router[_0x53fb('0x11')](_0x53fb('0xc'),auth[_0x53fb('0x9')](),controller['addConfiguration']);router[_0x53fb('0x12')](_0x53fb('0x13'),auth[_0x53fb('0x9')](),controller['update']);router[_0x53fb('0x14')](_0x53fb('0x13'),auth[_0x53fb('0x9')](),controller[_0x53fb('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 0298d90..8fcb19b 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 _0x8175=['integrationTab','newTab','sequelize','exports','STRING','ENUM','password','token'];(function(_0x43d368,_0x1295c0){var _0x3845ea=function(_0x409b6e){while(--_0x409b6e){_0x43d368['push'](_0x43d368['shift']());}};_0x3845ea(++_0x1295c0);}(_0x8175,0x182));var _0x5817=function(_0x3bc158,_0x436e3a){_0x3bc158=_0x3bc158-0x0;var _0x977671=_0x8175[_0x3bc158];return _0x977671;};'use strict';var Sequelize=require(_0x5817('0x0'));module[_0x5817('0x1')]={'name':{'type':Sequelize[_0x5817('0x2')]},'description':{'type':Sequelize[_0x5817('0x2')]},'username':{'type':Sequelize[_0x5817('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x5817('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x5817('0x3')](_0x5817('0x4'),_0x5817('0x5')),'defaultValue':_0x5817('0x4')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x5817('0x6'),_0x5817('0x7')),'defaultValue':_0x5817('0x6')}}; \ No newline at end of file +var _0xda89=['STRING','username','remoteUri','ENUM','token','password','integrationTab','newTab','sequelize'];(function(_0xdeac17,_0x19ad66){var _0x33aabd=function(_0x558a9e){while(--_0x558a9e){_0xdeac17['push'](_0xdeac17['shift']());}};_0x33aabd(++_0x19ad66);}(_0xda89,0x179));var _0x9da8=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xda89[_0x3305de];return _0x3b5a84;};'use strict';var Sequelize=require(_0x9da8('0x0'));module['exports']={'name':{'type':Sequelize[_0x9da8('0x1')]},'description':{'type':Sequelize[_0x9da8('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x9da8('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x9da8('0x1')]},'remoteUri':{'type':Sequelize[_0x9da8('0x1')],'unique':_0x9da8('0x3')},'authType':{'type':Sequelize[_0x9da8('0x4')]('password',_0x9da8('0x5')),'defaultValue':_0x9da8('0x6')},'serverUrl':{'type':Sequelize[_0x9da8('0x1')]},'type':{'type':Sequelize[_0x9da8('0x4')](_0x9da8('0x7'),_0x9da8('0x8')),'defaultValue':_0x9da8('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 1a2b188..b9f8480 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 _0xbfc6=['ZendeskField','Subjects','Descriptions','username','password','token','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','position','title','system_field_options','custom_field_options','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','count','offset','limit','set','Content-Range','json','save','update','sendStatus','name','send','index','map','ZendeskAccount','rawAttributes','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','merge','VIRTUAL','options','include','findAll','show','params','length','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','pick','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','type','getDescriptions'];(function(_0x331ab2,_0x21120a){var _0x2a78c6=function(_0x2bec7c){while(--_0x2bec7c){_0x331ab2['push'](_0x331ab2['shift']());}};_0x2a78c6(++_0x21120a);}(_0xbfc6,0x98));var _0x6bfc=function(_0x5be8e9,_0x507947){_0x5be8e9=_0x5be8e9-0x0;var _0x3ff28d=_0xbfc6[_0x5be8e9];return _0x3ff28d;};'use strict';var pdf=require(_0x6bfc('0x0'));var emlformat=require(_0x6bfc('0x1'));var rimraf=require(_0x6bfc('0x2'));var zipdir=require(_0x6bfc('0x3'));var jsonpatch=require(_0x6bfc('0x4'));var rp=require(_0x6bfc('0x5'));var moment=require(_0x6bfc('0x6'));var BPromise=require(_0x6bfc('0x7'));var Mustache=require(_0x6bfc('0x8'));var util=require('util');var path=require(_0x6bfc('0x9'));var sox=require(_0x6bfc('0xa'));var csv=require(_0x6bfc('0xb'));var ejs=require(_0x6bfc('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6bfc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6bfc('0xe'));var toCsv=require(_0x6bfc('0xb'));var querystring=require(_0x6bfc('0xf'));var Papa=require('papaparse');var Redis=require(_0x6bfc('0x10'));var authService=require(_0x6bfc('0x11'));var qs=require(_0x6bfc('0x12'));var as=require(_0x6bfc('0x13'));var hardwareService=require(_0x6bfc('0x14'));var logger=require('../../config/logger')(_0x6bfc('0x15'));var utils=require('../../config/utils');var config=require(_0x6bfc('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6bfc('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x6bfc('0x18')][_0x6bfc('0x19')]({'port':0x232a});function checkPasswordPattern(_0x54558c,_0x53851f,_0x341b32){if(_0x341b32){var _0x58c93e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58c93e[_0x6bfc('0x1a')](_0x53851f)){return _0x54558c;}else{throw new db['Sequelize']['ValidationError'](_0x6bfc('0x1b'));}}else{return _0x54558c;}}function respondWithRpcPromise(_0x584759,_0xd8b5cc,_0x11f8ae,_0x38846d){return new BPromise(function(_0x58cc6c,_0x29f1cd){var _0x46a9bc=_0x38846d||client;return _0x46a9bc[_0x6bfc('0x1c')](_0x584759,_0x11f8ae)[_0x6bfc('0x1d')](function(_0x5bf7c4){logger[_0x6bfc('0x1e')](_0x6bfc('0x1f'),_0xd8b5cc,_0x6bfc('0x20'));logger[_0x6bfc('0x21')](_0x6bfc('0x22'),_0xd8b5cc,'request\x20sent',JSON[_0x6bfc('0x23')](_0x5bf7c4));if(_0x5bf7c4[_0x6bfc('0x24')]){if(_0x5bf7c4[_0x6bfc('0x24')]['code']===0x1f4){logger[_0x6bfc('0x24')](_0x6bfc('0x1f'),_0xd8b5cc,_0x5bf7c4[_0x6bfc('0x24')][_0x6bfc('0x25')]);return _0x29f1cd(_0x5bf7c4[_0x6bfc('0x24')][_0x6bfc('0x25')]);}logger[_0x6bfc('0x24')](_0x6bfc('0x1f'),_0xd8b5cc,_0x5bf7c4['error'][_0x6bfc('0x25')]);return _0x58cc6c(_0x5bf7c4[_0x6bfc('0x24')][_0x6bfc('0x25')]);}else{logger[_0x6bfc('0x1e')]('ZendeskAccount,\x20%s,\x20%s',_0xd8b5cc,'request\x20sent');_0x58cc6c(_0x5bf7c4[_0x6bfc('0x26')]['message']);}})[_0x6bfc('0x27')](function(_0x729f72){logger['error'](_0x6bfc('0x1f'),_0xd8b5cc,_0x729f72);_0x29f1cd(_0x729f72);});});}function respondWithStatusCode(_0x26bced,_0x1755c4){_0x1755c4=_0x1755c4||0xcc;return function(_0x808c2a){if(_0x808c2a){return _0x26bced['sendStatus'](_0x1755c4);}return _0x26bced['status'](_0x1755c4)[_0x6bfc('0x28')]();};}function respondWithResult(_0x38f7e5,_0x53e981){_0x53e981=_0x53e981||0xc8;return function(_0x33bb54){if(_0x33bb54){return _0x38f7e5[_0x6bfc('0x29')](_0x53e981)['json'](_0x33bb54);}};}function respondWithFilteredResult(_0x34b6de,_0x3b0364){return function(_0x5a44c2){if(_0x5a44c2){var _0x333bcd=_0x5a44c2[_0x6bfc('0x2a')],_0x54200f=_0x3b0364[_0x6bfc('0x2b')],_0x53c9e5=_0x3b0364[_0x6bfc('0x2b')]+_0x3b0364[_0x6bfc('0x2c')],_0x12a065;if(_0x53c9e5>=_0x333bcd){_0x53c9e5=_0x333bcd;_0x12a065=0xc8;}else{_0x12a065=0xce;}_0x34b6de['status'](_0x12a065);return _0x34b6de[_0x6bfc('0x2d')](_0x6bfc('0x2e'),_0x54200f+'-'+_0x53c9e5+'/'+_0x333bcd)[_0x6bfc('0x2f')](_0x5a44c2);}return null;};}function patchUpdates(_0x16642e){return function(_0x4e3681){try{jsonpatch['apply'](_0x4e3681,_0x16642e,!![]);}catch(_0x5c26fd){return BPromise['reject'](_0x5c26fd);}return _0x4e3681[_0x6bfc('0x30')]();};}function saveUpdates(_0x4c01b2,_0x4851d6){return function(_0x5c6d48){if(_0x5c6d48){return _0x5c6d48[_0x6bfc('0x31')](_0x4c01b2)[_0x6bfc('0x1d')](function(_0x3ed305){return _0x3ed305;});}return null;};}function removeEntity(_0xc7879a,_0x2abb9d){return function(_0x1e9fa6){if(_0x1e9fa6){return _0x1e9fa6['destroy']()['then'](function(){_0xc7879a[_0x6bfc('0x29')](0xcc)[_0x6bfc('0x28')]();});}};}function handleEntityNotFound(_0x2f86a9,_0x13d282){return function(_0x42a81f){if(!_0x42a81f){_0x2f86a9[_0x6bfc('0x32')](0x194);}return _0x42a81f;};}function handleError(_0x18e368,_0x5b80d7){_0x5b80d7=_0x5b80d7||0x1f4;return function(_0x25fba7){logger[_0x6bfc('0x24')](_0x25fba7['stack']);if(_0x25fba7[_0x6bfc('0x33')]){delete _0x25fba7[_0x6bfc('0x33')];}_0x18e368[_0x6bfc('0x29')](_0x5b80d7)[_0x6bfc('0x34')](_0x25fba7);};}exports[_0x6bfc('0x35')]=function(_0x2b2d39,_0x4e659b){var _0x5283fb={},_0x4429ea={},_0x2e9eff={'count':0x0,'rows':[]};var _0x3e736c=_[_0x6bfc('0x36')](db[_0x6bfc('0x37')][_0x6bfc('0x38')],function(_0x1f3a95){return{'name':_0x1f3a95['fieldName'],'type':_0x1f3a95['type']['key']};});_0x4429ea[_0x6bfc('0x39')]=_[_0x6bfc('0x36')](_0x3e736c,_0x6bfc('0x33'));_0x4429ea[_0x6bfc('0x3a')]=_[_0x6bfc('0x3b')](_0x2b2d39[_0x6bfc('0x3a')]);_0x4429ea['filters']=_[_0x6bfc('0x3c')](_0x4429ea[_0x6bfc('0x39')],_0x4429ea[_0x6bfc('0x3a')]);_0x5283fb['attributes']=_[_0x6bfc('0x3c')](_0x4429ea[_0x6bfc('0x39')],qs[_0x6bfc('0x3d')](_0x2b2d39[_0x6bfc('0x3a')][_0x6bfc('0x3d')]));_0x5283fb[_0x6bfc('0x3e')]=_0x5283fb[_0x6bfc('0x3e')]['length']?_0x5283fb[_0x6bfc('0x3e')]:_0x4429ea[_0x6bfc('0x39')];if(!_0x2b2d39[_0x6bfc('0x3a')]['hasOwnProperty'](_0x6bfc('0x3f'))){_0x5283fb[_0x6bfc('0x2c')]=qs[_0x6bfc('0x2c')](_0x2b2d39[_0x6bfc('0x3a')][_0x6bfc('0x2c')]);_0x5283fb[_0x6bfc('0x2b')]=qs[_0x6bfc('0x2b')](_0x2b2d39[_0x6bfc('0x3a')][_0x6bfc('0x2b')]);}_0x5283fb[_0x6bfc('0x40')]=qs[_0x6bfc('0x41')](_0x2b2d39[_0x6bfc('0x3a')]['sort']);_0x5283fb[_0x6bfc('0x42')]=qs[_0x6bfc('0x43')](_['pick'](_0x2b2d39['query'],_0x4429ea['filters']));if(_0x2b2d39[_0x6bfc('0x3a')]['filter']){_0x5283fb['where']=_[_0x6bfc('0x44')](_0x5283fb['where'],{'$or':_[_0x6bfc('0x36')](_0x3e736c,function(_0x2f5a05){if(_0x2f5a05['type']!==_0x6bfc('0x45')){var _0x5bef13={};_0x5bef13[_0x2f5a05[_0x6bfc('0x33')]]={'$like':'%'+_0x2b2d39[_0x6bfc('0x3a')]['filter']+'%'};return _0x5bef13;}})});}_0x5283fb=_[_0x6bfc('0x44')]({},_0x5283fb,_0x2b2d39[_0x6bfc('0x46')]);var _0x247e4b={'where':_0x5283fb['where']};return db[_0x6bfc('0x37')][_0x6bfc('0x2a')](_0x247e4b)['then'](function(_0x231834){_0x2e9eff[_0x6bfc('0x2a')]=_0x231834;if(_0x2b2d39['query']['includeAll']){_0x5283fb[_0x6bfc('0x47')]=[{'all':!![]}];}return db[_0x6bfc('0x37')][_0x6bfc('0x48')](_0x5283fb);})[_0x6bfc('0x1d')](function(_0x3e2846){_0x2e9eff['rows']=_0x3e2846;return _0x2e9eff;})[_0x6bfc('0x1d')](respondWithFilteredResult(_0x4e659b,_0x5283fb))[_0x6bfc('0x27')](handleError(_0x4e659b,null));};exports[_0x6bfc('0x49')]=function(_0x30323b,_0x10b590){var _0x575740={'raw':![],'where':{'id':_0x30323b[_0x6bfc('0x4a')]['id']}},_0x541028={};_0x541028[_0x6bfc('0x39')]=_[_0x6bfc('0x3b')](db[_0x6bfc('0x37')][_0x6bfc('0x38')]);_0x541028[_0x6bfc('0x3a')]=_[_0x6bfc('0x3b')](_0x30323b[_0x6bfc('0x3a')]);_0x541028[_0x6bfc('0x43')]=_[_0x6bfc('0x3c')](_0x541028[_0x6bfc('0x39')],_0x541028['query']);_0x575740[_0x6bfc('0x3e')]=_[_0x6bfc('0x3c')](_0x541028['model'],qs[_0x6bfc('0x3d')](_0x30323b[_0x6bfc('0x3a')][_0x6bfc('0x3d')]));_0x575740[_0x6bfc('0x3e')]=_0x575740[_0x6bfc('0x3e')][_0x6bfc('0x4b')]?_0x575740[_0x6bfc('0x3e')]:_0x541028['model'];if(_0x30323b[_0x6bfc('0x3a')]['includeAll']){_0x575740[_0x6bfc('0x47')]=[{'all':!![]}];}_0x575740=_[_0x6bfc('0x44')]({},_0x575740,_0x30323b[_0x6bfc('0x46')]);return db['ZendeskAccount'][_0x6bfc('0x4c')](_0x575740)[_0x6bfc('0x1d')](handleEntityNotFound(_0x10b590,null))[_0x6bfc('0x1d')](respondWithResult(_0x10b590,null))['catch'](handleError(_0x10b590,null));};exports[_0x6bfc('0x4d')]=function(_0x595617,_0x54da24){return db[_0x6bfc('0x37')][_0x6bfc('0x4d')](_0x595617[_0x6bfc('0x4e')],{})[_0x6bfc('0x1d')](respondWithResult(_0x54da24,0xc9))['catch'](handleError(_0x54da24,null));};exports[_0x6bfc('0x31')]=function(_0x5afc4f,_0x2b46af){if(_0x5afc4f[_0x6bfc('0x4e')]['id']){delete _0x5afc4f[_0x6bfc('0x4e')]['id'];}return db[_0x6bfc('0x37')][_0x6bfc('0x4c')]({'where':{'id':_0x5afc4f[_0x6bfc('0x4a')]['id']}})[_0x6bfc('0x1d')](handleEntityNotFound(_0x2b46af,null))[_0x6bfc('0x1d')](saveUpdates(_0x5afc4f[_0x6bfc('0x4e')],null))[_0x6bfc('0x1d')](respondWithResult(_0x2b46af,null))[_0x6bfc('0x27')](handleError(_0x2b46af,null));};exports[_0x6bfc('0x4f')]=function(_0x1826e5,_0x5f5602){return db[_0x6bfc('0x37')][_0x6bfc('0x4c')]({'where':{'id':_0x1826e5[_0x6bfc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f5602,null))[_0x6bfc('0x1d')](removeEntity(_0x5f5602,null))['catch'](handleError(_0x5f5602,null));};exports[_0x6bfc('0x50')]=function(_0x4a38e7,_0x553eda,_0x21630b){var _0x12cb82={};var _0x1e9e2a={};var _0x18cb03;var _0x15345c;return db[_0x6bfc('0x37')][_0x6bfc('0x51')]({'where':{'id':_0x4a38e7[_0x6bfc('0x4a')]['id']}})[_0x6bfc('0x1d')](handleEntityNotFound(_0x553eda,null))[_0x6bfc('0x1d')](function(_0x5824f2){if(_0x5824f2){_0x18cb03=_0x5824f2;_0x1e9e2a[_0x6bfc('0x39')]=_[_0x6bfc('0x3b')](db[_0x6bfc('0x52')][_0x6bfc('0x38')]);_0x1e9e2a[_0x6bfc('0x3a')]=_['keys'](_0x4a38e7[_0x6bfc('0x3a')]);_0x1e9e2a[_0x6bfc('0x43')]=_['intersection'](_0x1e9e2a['model'],_0x1e9e2a[_0x6bfc('0x3a')]);_0x12cb82['attributes']=_[_0x6bfc('0x3c')](_0x1e9e2a['model'],qs[_0x6bfc('0x3d')](_0x4a38e7['query'][_0x6bfc('0x3d')]));_0x12cb82['attributes']=_0x12cb82[_0x6bfc('0x3e')][_0x6bfc('0x4b')]?_0x12cb82[_0x6bfc('0x3e')]:_0x1e9e2a[_0x6bfc('0x39')];_0x12cb82[_0x6bfc('0x40')]=qs[_0x6bfc('0x41')](_0x4a38e7[_0x6bfc('0x3a')]['sort']);_0x12cb82[_0x6bfc('0x42')]=qs[_0x6bfc('0x43')](_[_0x6bfc('0x53')](_0x4a38e7[_0x6bfc('0x3a')],_0x1e9e2a[_0x6bfc('0x43')]));if(_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x54')]){_0x12cb82[_0x6bfc('0x42')]=_['merge'](_0x12cb82[_0x6bfc('0x42')],{'$or':_[_0x6bfc('0x36')](_0x12cb82[_0x6bfc('0x3e')],function(_0x450e74){var _0x9800da={};_0x9800da[_0x450e74]={'$like':'%'+_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x54')]+'%'};return _0x9800da;})});}_0x12cb82=_[_0x6bfc('0x44')]({},_0x12cb82,_0x4a38e7['options']);return _0x18cb03['getConfigurations'](_0x12cb82);}})[_0x6bfc('0x1d')](function(_0x458538){if(_0x458538){_0x15345c=_0x458538[_0x6bfc('0x4b')];if(!_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x55')]('nolimit')){_0x12cb82[_0x6bfc('0x2c')]=qs[_0x6bfc('0x2c')](_0x4a38e7['query'][_0x6bfc('0x2c')]);_0x12cb82[_0x6bfc('0x2b')]=qs['offset'](_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x2b')]);}return _0x18cb03['getConfigurations'](_0x12cb82);}})[_0x6bfc('0x1d')](function(_0x1f2eba){if(_0x1f2eba){return _0x1f2eba?{'count':_0x15345c,'rows':_0x1f2eba}:null;}})[_0x6bfc('0x1d')](respondWithResult(_0x553eda,null))['catch'](handleError(_0x553eda,null));};exports[_0x6bfc('0x56')]=function(_0x3ae5d3,_0x2e2fa6,_0x1fdcd5){if(_0x3ae5d3['body']['id']){delete _0x3ae5d3[_0x6bfc('0x4e')]['id'];}return db[_0x6bfc('0x37')][_0x6bfc('0x51')]({'where':{'id':_0x3ae5d3[_0x6bfc('0x4a')]['id']}})[_0x6bfc('0x1d')](handleEntityNotFound(_0x2e2fa6,null))['then'](function(_0x529ad1){if(_0x529ad1){_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x57')]=_0x529ad1['id'];_0x3ae5d3[_0x6bfc('0x4e')]['Subjects']=integrations[_0x6bfc('0x58')](_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x59')],_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x5a')]);_0x3ae5d3[_0x6bfc('0x4e')]['Descriptions']=integrations[_0x6bfc('0x5b')](_0x3ae5d3['body'][_0x6bfc('0x59')],_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x5a')]);return db[_0x6bfc('0x52')][_0x6bfc('0x4d')](_0x3ae5d3[_0x6bfc('0x4e')],{'include':[{'model':db[_0x6bfc('0x5c')],'as':_0x6bfc('0x5d')},{'model':db[_0x6bfc('0x5c')],'as':_0x6bfc('0x5e')}]});}return null;})[_0x6bfc('0x1d')](respondWithResult(_0x2e2fa6,null))['catch'](handleError(_0x2e2fa6,null));};exports['getFields']=function(_0x340f54,_0x58d57c,_0x5b3fce){var _0x25c95c='';return db[_0x6bfc('0x37')][_0x6bfc('0x51')]({'where':{'id':_0x340f54[_0x6bfc('0x4a')]['id']},'attributes':['id',_0x6bfc('0x5f'),_0x6bfc('0x60'),_0x6bfc('0x61'),'authType',_0x6bfc('0x62')]})[_0x6bfc('0x1d')](handleEntityNotFound(_0x58d57c,null))[_0x6bfc('0x1d')](function(_0x1e7fe8){if(_0x1e7fe8){_0x25c95c=_0x1e7fe8[_0x6bfc('0x62')];var _0x44726e=_0x25c95c['slice'](-0x1);if(_0x44726e==='/'){_0x25c95c=_0x25c95c['substring'](0x0,_0x25c95c[_0x6bfc('0x63')](_0x44726e));}var _0x40893a={'method':_0x6bfc('0x64'),'uri':util[_0x6bfc('0x65')](_0x6bfc('0x66'),_0x25c95c,_0x6bfc('0x67')),'json':!![]};switch(_0x1e7fe8[_0x6bfc('0x68')]){case _0x6bfc('0x60'):_0x40893a[_0x6bfc('0x69')]={'Authorization':util[_0x6bfc('0x65')](_0x6bfc('0x6a'),new Buffer(util[_0x6bfc('0x65')](_0x6bfc('0x6b'),_0x1e7fe8[_0x6bfc('0x5f')],_0x1e7fe8[_0x6bfc('0x60')]))[_0x6bfc('0x6c')]('base64'))};break;case _0x6bfc('0x61'):_0x40893a[_0x6bfc('0x69')]={'Authorization':util[_0x6bfc('0x65')]('Basic\x20%s',new Buffer(util[_0x6bfc('0x65')]('%s/token:%s',_0x1e7fe8['username'],_0x1e7fe8[_0x6bfc('0x61')]))[_0x6bfc('0x6c')]('base64'))};break;default:throw new db[(_0x6bfc('0x6d'))][(_0x6bfc('0x6e'))](_0x6bfc('0x6f'));}return rp(_0x40893a);}})[_0x6bfc('0x1d')](function(_0x29f1cf){if(_0x29f1cf){var _0x567950=[_0x6bfc('0x70'),_0x6bfc('0x71'),_0x6bfc('0x72'),'assignee'];_['remove'](_0x29f1cf[_0x6bfc('0x67')],function(_0x422aa3){return _0x567950['includes'](_0x422aa3[_0x6bfc('0x5a')]);});return{'count':_0x29f1cf[_0x6bfc('0x67')]['length'],'rows':_[_0x6bfc('0x36')](_0x29f1cf[_0x6bfc('0x67')],function(_0x5d7dd4){return{'id':_0x5d7dd4['id'],'name':_0x5d7dd4[_0x6bfc('0x73')]>0x7?_0x5d7dd4[_0x6bfc('0x74')]:_0x5d7dd4[_0x6bfc('0x5a')],'custom':_0x5d7dd4[_0x6bfc('0x73')]>0x7?!![]:![],'options':_0x5d7dd4[_0x6bfc('0x75')]?_0x5d7dd4[_0x6bfc('0x75')]:_0x5d7dd4[_0x6bfc('0x76')]?_0x5d7dd4[_0x6bfc('0x76')]:[]};})};}})['then'](respondWithResult(_0x58d57c,null))[_0x6bfc('0x27')](function(_0x5a73ff){var _0x4053ea=_0x340f54[_0x6bfc('0x3a')][_0x6bfc('0x1a')]?0x1f4:_0x5a73ff[_0x6bfc('0x77')]||0x1f4;logger[_0x6bfc('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x6bfc('0x78'),_0x4053ea,JSON[_0x6bfc('0x23')](_0x5a73ff));delete _0x5a73ff[_0x6bfc('0x33')];if(_0x4053ea===0x191){_0x4053ea=0x190;}_0x58d57c[_0x6bfc('0x29')](_0x4053ea)[_0x6bfc('0x34')](_0x340f54[_0x6bfc('0x3a')][_0x6bfc('0x1a')]?{'message':_0x6bfc('0x79'),'statusCode':_0x5a73ff['statusCode']}:_0x5a73ff);});}; \ No newline at end of file +var _0xa15f=['rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','findOne','ZendeskConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','Basic\x20%s','%s:%s','username','base64','%s/token:%s','Unknown\x20authentication\x20type','subject','description','group','remove','includes','position','system_field_options','custom_field_options','statusCode','stringify','send','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','index','map','ZendeskAccount'];(function(_0x193679,_0x2dcbf6){var _0x419b68=function(_0x56d491){while(--_0x56d491){_0x193679['push'](_0x193679['shift']());}};_0x419b68(++_0x2dcbf6);}(_0xa15f,0xd0));var _0xfa15=function(_0xf94876,_0x10eb81){_0xf94876=_0xf94876-0x0;var _0x230aa6=_0xa15f[_0xf94876];return _0x230aa6;};'use strict';var pdf=require(_0xfa15('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfa15('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfa15('0x2'));var rp=require(_0xfa15('0x3'));var moment=require('moment');var BPromise=require(_0xfa15('0x4'));var Mustache=require('mustache');var util=require(_0xfa15('0x5'));var path=require(_0xfa15('0x6'));var sox=require(_0xfa15('0x7'));var csv=require('to-csv');var ejs=require(_0xfa15('0x8'));var fs=require('fs');var _=require(_0xfa15('0x9'));var squel=require(_0xfa15('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfa15('0xb'));var toCsv=require(_0xfa15('0xc'));var querystring=require(_0xfa15('0xd'));var Papa=require(_0xfa15('0xe'));var Redis=require(_0xfa15('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfa15('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa15('0x11'));var logger=require(_0xfa15('0x12'))(_0xfa15('0x13'));var utils=require(_0xfa15('0x14'));var config=require(_0xfa15('0x15'));var db=require(_0xfa15('0x16'))['db'];var integrations=require(_0xfa15('0x17'));var jayson=require(_0xfa15('0x18'));var client=jayson[_0xfa15('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x43d092,_0x2c2cdf,_0x1f07bf){if(_0x1f07bf){var _0x855797=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x855797[_0xfa15('0x1a')](_0x2c2cdf)){return _0x43d092;}else{throw new db[(_0xfa15('0x1b'))][(_0xfa15('0x1c'))](_0xfa15('0x1d'));}}else{return _0x43d092;}}function respondWithRpcPromise(_0x39e527,_0x4a38ae,_0x4fc0a6,_0x1ab359){return new BPromise(function(_0x31297d,_0xc5aa4b){var _0x56870d=_0x1ab359||client;return _0x56870d[_0xfa15('0x1e')](_0x39e527,_0x4fc0a6)['then'](function(_0x10bcc3){logger[_0xfa15('0x1f')]('ZendeskAccount,\x20%s,\x20%s',_0x4a38ae,_0xfa15('0x20'));logger[_0xfa15('0x21')](_0xfa15('0x22'),_0x4a38ae,'request\x20sent',JSON['stringify'](_0x10bcc3));if(_0x10bcc3[_0xfa15('0x23')]){if(_0x10bcc3[_0xfa15('0x23')][_0xfa15('0x24')]===0x1f4){logger[_0xfa15('0x23')](_0xfa15('0x25'),_0x4a38ae,_0x10bcc3['error'][_0xfa15('0x26')]);return _0xc5aa4b(_0x10bcc3['error'][_0xfa15('0x26')]);}logger[_0xfa15('0x23')](_0xfa15('0x25'),_0x4a38ae,_0x10bcc3[_0xfa15('0x23')][_0xfa15('0x26')]);return _0x31297d(_0x10bcc3['error'][_0xfa15('0x26')]);}else{logger['info'](_0xfa15('0x25'),_0x4a38ae,_0xfa15('0x20'));_0x31297d(_0x10bcc3[_0xfa15('0x27')]['message']);}})['catch'](function(_0x8f86b6){logger['error'](_0xfa15('0x25'),_0x4a38ae,_0x8f86b6);_0xc5aa4b(_0x8f86b6);});});}function respondWithStatusCode(_0x26fd5f,_0x5789bf){_0x5789bf=_0x5789bf||0xcc;return function(_0x5775e3){if(_0x5775e3){return _0x26fd5f[_0xfa15('0x28')](_0x5789bf);}return _0x26fd5f[_0xfa15('0x29')](_0x5789bf)['end']();};}function respondWithResult(_0x476d20,_0x4ad207){_0x4ad207=_0x4ad207||0xc8;return function(_0x37ab89){if(_0x37ab89){return _0x476d20[_0xfa15('0x29')](_0x4ad207)[_0xfa15('0x2a')](_0x37ab89);}};}function respondWithFilteredResult(_0x74720a,_0x75aef){return function(_0x209a98){if(_0x209a98){var _0x100d76=_0x209a98[_0xfa15('0x2b')],_0x2d3d69=_0x75aef[_0xfa15('0x2c')],_0x52d839=_0x75aef[_0xfa15('0x2c')]+_0x75aef['limit'],_0x5c1b7e;if(_0x52d839>=_0x100d76){_0x52d839=_0x100d76;_0x5c1b7e=0xc8;}else{_0x5c1b7e=0xce;}_0x74720a[_0xfa15('0x29')](_0x5c1b7e);return _0x74720a[_0xfa15('0x2d')](_0xfa15('0x2e'),_0x2d3d69+'-'+_0x52d839+'/'+_0x100d76)[_0xfa15('0x2a')](_0x209a98);}return null;};}function patchUpdates(_0x4c912e){return function(_0x4fd88e){try{jsonpatch[_0xfa15('0x2f')](_0x4fd88e,_0x4c912e,!![]);}catch(_0x46b243){return BPromise[_0xfa15('0x30')](_0x46b243);}return _0x4fd88e['save']();};}function saveUpdates(_0x325124,_0x5d1871){return function(_0x3047fd){if(_0x3047fd){return _0x3047fd[_0xfa15('0x31')](_0x325124)[_0xfa15('0x32')](function(_0x1cfd55){return _0x1cfd55;});}return null;};}function removeEntity(_0x1ca734,_0x285fdd){return function(_0x2564b0){if(_0x2564b0){return _0x2564b0[_0xfa15('0x33')]()[_0xfa15('0x32')](function(){_0x1ca734[_0xfa15('0x29')](0xcc)[_0xfa15('0x34')]();});}};}function handleEntityNotFound(_0x6f0090,_0x5ac55e){return function(_0x453ea4){if(!_0x453ea4){_0x6f0090[_0xfa15('0x28')](0x194);}return _0x453ea4;};}function handleError(_0x3abe1c,_0x39f24d){_0x39f24d=_0x39f24d||0x1f4;return function(_0x25389f){logger[_0xfa15('0x23')](_0x25389f[_0xfa15('0x35')]);if(_0x25389f[_0xfa15('0x36')]){delete _0x25389f[_0xfa15('0x36')];}_0x3abe1c[_0xfa15('0x29')](_0x39f24d)['send'](_0x25389f);};}exports[_0xfa15('0x37')]=function(_0x476638,_0x2e3a26){var _0x5af3e3={},_0x44a079={},_0x2e3ebc={'count':0x0,'rows':[]};var _0x7a30cb=_[_0xfa15('0x38')](db[_0xfa15('0x39')][_0xfa15('0x3a')],function(_0x4896e0){return{'name':_0x4896e0[_0xfa15('0x3b')],'type':_0x4896e0['type'][_0xfa15('0x3c')]};});_0x44a079[_0xfa15('0x3d')]=_[_0xfa15('0x38')](_0x7a30cb,_0xfa15('0x36'));_0x44a079[_0xfa15('0x3e')]=_[_0xfa15('0x3f')](_0x476638[_0xfa15('0x3e')]);_0x44a079[_0xfa15('0x40')]=_[_0xfa15('0x41')](_0x44a079[_0xfa15('0x3d')],_0x44a079[_0xfa15('0x3e')]);_0x5af3e3[_0xfa15('0x42')]=_['intersection'](_0x44a079[_0xfa15('0x3d')],qs[_0xfa15('0x43')](_0x476638[_0xfa15('0x3e')][_0xfa15('0x43')]));_0x5af3e3[_0xfa15('0x42')]=_0x5af3e3[_0xfa15('0x42')]['length']?_0x5af3e3[_0xfa15('0x42')]:_0x44a079['model'];if(!_0x476638[_0xfa15('0x3e')][_0xfa15('0x44')](_0xfa15('0x45'))){_0x5af3e3[_0xfa15('0x46')]=qs['limit'](_0x476638[_0xfa15('0x3e')][_0xfa15('0x46')]);_0x5af3e3[_0xfa15('0x2c')]=qs['offset'](_0x476638[_0xfa15('0x3e')][_0xfa15('0x2c')]);}_0x5af3e3[_0xfa15('0x47')]=qs[_0xfa15('0x48')](_0x476638[_0xfa15('0x3e')][_0xfa15('0x48')]);_0x5af3e3[_0xfa15('0x49')]=qs[_0xfa15('0x40')](_[_0xfa15('0x4a')](_0x476638[_0xfa15('0x3e')],_0x44a079[_0xfa15('0x40')]));if(_0x476638['query'][_0xfa15('0x4b')]){_0x5af3e3[_0xfa15('0x49')]=_[_0xfa15('0x4c')](_0x5af3e3['where'],{'$or':_[_0xfa15('0x38')](_0x7a30cb,function(_0x393e8c){if(_0x393e8c[_0xfa15('0x4d')]!==_0xfa15('0x4e')){var _0x467f0f={};_0x467f0f[_0x393e8c[_0xfa15('0x36')]]={'$like':'%'+_0x476638[_0xfa15('0x3e')][_0xfa15('0x4b')]+'%'};return _0x467f0f;}})});}_0x5af3e3=_[_0xfa15('0x4c')]({},_0x5af3e3,_0x476638[_0xfa15('0x4f')]);var _0x566926={'where':_0x5af3e3[_0xfa15('0x49')]};return db['ZendeskAccount'][_0xfa15('0x2b')](_0x566926)[_0xfa15('0x32')](function(_0x3aa2c9){_0x2e3ebc[_0xfa15('0x2b')]=_0x3aa2c9;if(_0x476638[_0xfa15('0x3e')][_0xfa15('0x50')]){_0x5af3e3[_0xfa15('0x51')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xfa15('0x52')](_0x5af3e3);})[_0xfa15('0x32')](function(_0x5cbbe6){_0x2e3ebc[_0xfa15('0x53')]=_0x5cbbe6;return _0x2e3ebc;})['then'](respondWithFilteredResult(_0x2e3a26,_0x5af3e3))[_0xfa15('0x54')](handleError(_0x2e3a26,null));};exports[_0xfa15('0x55')]=function(_0x5389f4,_0x3c6282){var _0x3dfa05={'raw':![],'where':{'id':_0x5389f4[_0xfa15('0x56')]['id']}},_0x2303a4={};_0x2303a4['model']=_['keys'](db[_0xfa15('0x39')][_0xfa15('0x3a')]);_0x2303a4[_0xfa15('0x3e')]=_['keys'](_0x5389f4[_0xfa15('0x3e')]);_0x2303a4['filters']=_['intersection'](_0x2303a4[_0xfa15('0x3d')],_0x2303a4['query']);_0x3dfa05[_0xfa15('0x42')]=_[_0xfa15('0x41')](_0x2303a4[_0xfa15('0x3d')],qs[_0xfa15('0x43')](_0x5389f4[_0xfa15('0x3e')][_0xfa15('0x43')]));_0x3dfa05['attributes']=_0x3dfa05['attributes'][_0xfa15('0x57')]?_0x3dfa05['attributes']:_0x2303a4['model'];if(_0x5389f4[_0xfa15('0x3e')][_0xfa15('0x50')]){_0x3dfa05[_0xfa15('0x51')]=[{'all':!![]}];}_0x3dfa05=_[_0xfa15('0x4c')]({},_0x3dfa05,_0x5389f4[_0xfa15('0x4f')]);return db['ZendeskAccount'][_0xfa15('0x58')](_0x3dfa05)['then'](handleEntityNotFound(_0x3c6282,null))['then'](respondWithResult(_0x3c6282,null))['catch'](handleError(_0x3c6282,null));};exports['create']=function(_0x120487,_0x3dbf62){return db['ZendeskAccount'][_0xfa15('0x59')](_0x120487[_0xfa15('0x5a')],{})[_0xfa15('0x32')](respondWithResult(_0x3dbf62,0xc9))['catch'](handleError(_0x3dbf62,null));};exports['update']=function(_0x2fe5bc,_0x17b618){if(_0x2fe5bc[_0xfa15('0x5a')]['id']){delete _0x2fe5bc[_0xfa15('0x5a')]['id'];}return db[_0xfa15('0x39')][_0xfa15('0x58')]({'where':{'id':_0x2fe5bc[_0xfa15('0x56')]['id']}})[_0xfa15('0x32')](handleEntityNotFound(_0x17b618,null))[_0xfa15('0x32')](saveUpdates(_0x2fe5bc[_0xfa15('0x5a')],null))[_0xfa15('0x32')](respondWithResult(_0x17b618,null))[_0xfa15('0x54')](handleError(_0x17b618,null));};exports[_0xfa15('0x33')]=function(_0x3fadf2,_0x4bd7c6){return db[_0xfa15('0x39')]['find']({'where':{'id':_0x3fadf2[_0xfa15('0x56')]['id']}})[_0xfa15('0x32')](handleEntityNotFound(_0x4bd7c6,null))['then'](removeEntity(_0x4bd7c6,null))['catch'](handleError(_0x4bd7c6,null));};exports['getConfigurations']=function(_0x318104,_0x5a871e,_0x2c3060){var _0x2ff97d={};var _0x431cac={};var _0x42db47;var _0x53f301;return db[_0xfa15('0x39')][_0xfa15('0x5b')]({'where':{'id':_0x318104[_0xfa15('0x56')]['id']}})[_0xfa15('0x32')](handleEntityNotFound(_0x5a871e,null))[_0xfa15('0x32')](function(_0x196dc6){if(_0x196dc6){_0x42db47=_0x196dc6;_0x431cac['model']=_[_0xfa15('0x3f')](db[_0xfa15('0x5c')][_0xfa15('0x3a')]);_0x431cac['query']=_[_0xfa15('0x3f')](_0x318104[_0xfa15('0x3e')]);_0x431cac[_0xfa15('0x40')]=_[_0xfa15('0x41')](_0x431cac[_0xfa15('0x3d')],_0x431cac[_0xfa15('0x3e')]);_0x2ff97d[_0xfa15('0x42')]=_[_0xfa15('0x41')](_0x431cac[_0xfa15('0x3d')],qs[_0xfa15('0x43')](_0x318104['query'][_0xfa15('0x43')]));_0x2ff97d['attributes']=_0x2ff97d['attributes']['length']?_0x2ff97d[_0xfa15('0x42')]:_0x431cac['model'];_0x2ff97d[_0xfa15('0x47')]=qs['sort'](_0x318104[_0xfa15('0x3e')][_0xfa15('0x48')]);_0x2ff97d[_0xfa15('0x49')]=qs[_0xfa15('0x40')](_['pick'](_0x318104[_0xfa15('0x3e')],_0x431cac[_0xfa15('0x40')]));if(_0x318104[_0xfa15('0x3e')][_0xfa15('0x4b')]){_0x2ff97d[_0xfa15('0x49')]=_[_0xfa15('0x4c')](_0x2ff97d[_0xfa15('0x49')],{'$or':_['map'](_0x2ff97d[_0xfa15('0x42')],function(_0x4ec26d){var _0x21679a={};_0x21679a[_0x4ec26d]={'$like':'%'+_0x318104[_0xfa15('0x3e')][_0xfa15('0x4b')]+'%'};return _0x21679a;})});}_0x2ff97d=_[_0xfa15('0x4c')]({},_0x2ff97d,_0x318104[_0xfa15('0x4f')]);return _0x42db47[_0xfa15('0x5d')](_0x2ff97d);}})[_0xfa15('0x32')](function(_0x3215ff){if(_0x3215ff){_0x53f301=_0x3215ff[_0xfa15('0x57')];if(!_0x318104[_0xfa15('0x3e')][_0xfa15('0x44')]('nolimit')){_0x2ff97d['limit']=qs[_0xfa15('0x46')](_0x318104[_0xfa15('0x3e')]['limit']);_0x2ff97d['offset']=qs[_0xfa15('0x2c')](_0x318104[_0xfa15('0x3e')][_0xfa15('0x2c')]);}return _0x42db47[_0xfa15('0x5d')](_0x2ff97d);}})[_0xfa15('0x32')](function(_0x51d33c){if(_0x51d33c){return _0x51d33c?{'count':_0x53f301,'rows':_0x51d33c}:null;}})[_0xfa15('0x32')](respondWithResult(_0x5a871e,null))[_0xfa15('0x54')](handleError(_0x5a871e,null));};exports[_0xfa15('0x5e')]=function(_0x4e8ecc,_0x4cd7b1,_0x48cd6e){if(_0x4e8ecc[_0xfa15('0x5a')]['id']){delete _0x4e8ecc[_0xfa15('0x5a')]['id'];}return db[_0xfa15('0x39')]['findOne']({'where':{'id':_0x4e8ecc[_0xfa15('0x56')]['id']}})[_0xfa15('0x32')](handleEntityNotFound(_0x4cd7b1,null))['then'](function(_0x2886ee){if(_0x2886ee){_0x4e8ecc['body'][_0xfa15('0x5f')]=_0x2886ee['id'];_0x4e8ecc[_0xfa15('0x5a')][_0xfa15('0x60')]=integrations[_0xfa15('0x61')](_0x4e8ecc[_0xfa15('0x5a')][_0xfa15('0x62')],_0x4e8ecc[_0xfa15('0x5a')]['type']);_0x4e8ecc[_0xfa15('0x5a')][_0xfa15('0x63')]=integrations[_0xfa15('0x64')](_0x4e8ecc['body']['channel'],_0x4e8ecc[_0xfa15('0x5a')][_0xfa15('0x4d')]);return db['ZendeskConfiguration'][_0xfa15('0x59')](_0x4e8ecc[_0xfa15('0x5a')],{'include':[{'model':db['ZendeskField'],'as':_0xfa15('0x60')},{'model':db[_0xfa15('0x65')],'as':_0xfa15('0x63')}]});}return null;})[_0xfa15('0x32')](respondWithResult(_0x4cd7b1,null))['catch'](handleError(_0x4cd7b1,null));};exports[_0xfa15('0x66')]=function(_0x16fae5,_0x1725f0,_0x2d5ff6){var _0x11f5bc='';return db[_0xfa15('0x39')][_0xfa15('0x5b')]({'where':{'id':_0x16fae5['params']['id']},'attributes':['id','username','password',_0xfa15('0x67'),_0xfa15('0x68'),_0xfa15('0x69')]})[_0xfa15('0x32')](handleEntityNotFound(_0x1725f0,null))[_0xfa15('0x32')](function(_0x202a1b){if(_0x202a1b){_0x11f5bc=_0x202a1b[_0xfa15('0x69')];var _0x1b0eb9=_0x11f5bc[_0xfa15('0x6a')](-0x1);if(_0x1b0eb9==='/'){_0x11f5bc=_0x11f5bc[_0xfa15('0x6b')](0x0,_0x11f5bc[_0xfa15('0x6c')](_0x1b0eb9));}var _0x7b1c4b={'method':_0xfa15('0x6d'),'uri':util[_0xfa15('0x6e')](_0xfa15('0x6f'),_0x11f5bc,_0xfa15('0x70')),'json':!![]};switch(_0x202a1b['authType']){case _0xfa15('0x71'):_0x7b1c4b[_0xfa15('0x72')]={'Authorization':util[_0xfa15('0x6e')](_0xfa15('0x73'),new Buffer(util[_0xfa15('0x6e')](_0xfa15('0x74'),_0x202a1b[_0xfa15('0x75')],_0x202a1b[_0xfa15('0x71')]))['toString'](_0xfa15('0x76')))};break;case _0xfa15('0x67'):_0x7b1c4b['headers']={'Authorization':util['format'](_0xfa15('0x73'),new Buffer(util['format'](_0xfa15('0x77'),_0x202a1b[_0xfa15('0x75')],_0x202a1b[_0xfa15('0x67')]))['toString'](_0xfa15('0x76')))};break;default:throw new db[(_0xfa15('0x1b'))]['ValidationError'](_0xfa15('0x78'));}return rp(_0x7b1c4b);}})[_0xfa15('0x32')](function(_0x98ba77){if(_0x98ba77){var _0x5ba873=[_0xfa15('0x79'),_0xfa15('0x7a'),_0xfa15('0x7b'),'assignee'];_[_0xfa15('0x7c')](_0x98ba77['ticket_fields'],function(_0x2d248e){return _0x5ba873[_0xfa15('0x7d')](_0x2d248e[_0xfa15('0x4d')]);});return{'count':_0x98ba77['ticket_fields'][_0xfa15('0x57')],'rows':_['map'](_0x98ba77['ticket_fields'],function(_0x1714eb){return{'id':_0x1714eb['id'],'name':_0x1714eb[_0xfa15('0x7e')]>0x7?_0x1714eb['title']:_0x1714eb['type'],'custom':_0x1714eb[_0xfa15('0x7e')]>0x7?!![]:![],'options':_0x1714eb[_0xfa15('0x7f')]?_0x1714eb[_0xfa15('0x7f')]:_0x1714eb['custom_field_options']?_0x1714eb[_0xfa15('0x80')]:[]};})};}})[_0xfa15('0x32')](respondWithResult(_0x1725f0,null))[_0xfa15('0x54')](function(_0x5b7ca2){var _0x4f1bfb=_0x16fae5['query'][_0xfa15('0x1a')]?0x1f4:_0x5b7ca2[_0xfa15('0x81')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xfa15('0x66'),_0x4f1bfb,JSON[_0xfa15('0x82')](_0x5b7ca2));delete _0x5b7ca2[_0xfa15('0x36')];if(_0x4f1bfb===0x191){_0x4f1bfb=0x190;}_0x1725f0[_0xfa15('0x29')](_0x4f1bfb)[_0xfa15('0x83')](_0x16fae5[_0xfa15('0x3e')][_0xfa15('0x1a')]?{'message':_0xfa15('0x84'),'statusCode':_0x5b7ca2[_0xfa15('0x81')]}:_0x5b7ca2);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 1d186af..e41f6da 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 _0xbb0b=['define','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xbb0b,0x1c5));var _0xbbb0=function(_0x328e8f,_0x2304e5){_0x328e8f=_0x328e8f-0x0;var _0x114a5d=_0xbb0b[_0x328e8f];return _0x114a5d;};'use strict';var _=require(_0xbbb0('0x0'));var util=require(_0xbbb0('0x1'));var logger=require(_0xbbb0('0x2'))(_0xbbb0('0x3'));var moment=require('moment');var BPromise=require(_0xbbb0('0x4'));var rp=require(_0xbbb0('0x5'));var fs=require('fs');var path=require(_0xbbb0('0x6'));var rimraf=require(_0xbbb0('0x7'));var config=require('../../config/environment');var attributes=require(_0xbbb0('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x7140de,_0x210a53){return _0x7140de[_0xbbb0('0x9')]('ZendeskAccount',attributes,{'tableName':_0xbbb0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x45f9=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','request-promise'];(function(_0x272471,_0x455fb2){var _0x3772cb=function(_0xf87434){while(--_0xf87434){_0x272471['push'](_0x272471['shift']());}};_0x3772cb(++_0x455fb2);}(_0x45f9,0x194));var _0x945f=function(_0x222fb3,_0x18b142){_0x222fb3=_0x222fb3-0x0;var _0xdeda31=_0x45f9[_0x222fb3];return _0xdeda31;};'use strict';var _=require(_0x945f('0x0'));var util=require(_0x945f('0x1'));var logger=require(_0x945f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x945f('0x3'));var fs=require('fs');var path=require(_0x945f('0x4'));var rimraf=require(_0x945f('0x5'));var config=require(_0x945f('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x945f('0x7'));module[_0x945f('0x8')]=function(_0x3aea65,_0x2b1d3c){return _0x3aea65[_0x945f('0x9')](_0x945f('0xa'),attributes,{'tableName':_0x945f('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 e246e26..2680b37 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 _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x3975eb,_0x26b578){var _0x344f2b=function(_0x102b71){while(--_0x102b71){_0x3975eb['push'](_0x3975eb['shift']());}};_0x344f2b(++_0x26b578);}(_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')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\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')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file +var _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x2a7ccd,_0x3f07bb){var _0x4b70be=function(_0xd4ecb0){while(--_0xd4ecb0){_0x2a7ccd['push'](_0x2a7ccd['shift']());}};_0x4b70be(++_0x3f07bb);}(_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')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\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')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index cf113d4..62175a9 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 _0x4a2a=['express','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','post','create','setTags','update','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a2a,0x105));var _0xa4a2=function(_0x2e8374,_0x4ee1cc){_0x2e8374=_0x2e8374-0x0;var _0x2a465a=_0x4a2a[_0x2e8374];return _0x2a465a;};'use strict';var multer=require(_0xa4a2('0x0'));var util=require(_0xa4a2('0x1'));var path=require(_0xa4a2('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4a2('0x3'));var router=express[_0xa4a2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa4a2('0x5'));var config=require(_0xa4a2('0x6'));var controller=require(_0xa4a2('0x7'));router[_0xa4a2('0x8')]('/',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0xa')]);router[_0xa4a2('0x8')](_0xa4a2('0xb'),auth['isAuthenticated'](),controller[_0xa4a2('0xc')]);router[_0xa4a2('0x8')](_0xa4a2('0xd'),auth[_0xa4a2('0x9')](),controller[_0xa4a2('0xe')]);router[_0xa4a2('0x8')]('/:id/subjects',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0xf')]);router[_0xa4a2('0x8')]('/:id/descriptions',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0x10')]);router[_0xa4a2('0x8')](_0xa4a2('0x11'),auth['isAuthenticated'](),controller['getTags']);router[_0xa4a2('0x12')]('/',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0x13')]);router[_0xa4a2('0x12')](_0xa4a2('0x11'),auth[_0xa4a2('0x9')](),controller[_0xa4a2('0x14')]);router['put'](_0xa4a2('0xb'),auth['isAuthenticated'](),controller[_0xa4a2('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa4a2('0x16')]);module[_0xa4a2('0x17')]=router; \ No newline at end of file +var _0x4fb4=['delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','get','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','setTags','update'];(function(_0x50460f,_0x1b7f49){var _0x5b93f3=function(_0x2adb2e){while(--_0x2adb2e){_0x50460f['push'](_0x50460f['shift']());}};_0x5b93f3(++_0x1b7f49);}(_0x4fb4,0x1b8));var _0x44fb=function(_0x3eab91,_0x3bca7d){_0x3eab91=_0x3eab91-0x0;var _0x1ea7e3=_0x4fb4[_0x3eab91];return _0x1ea7e3;};'use strict';var multer=require(_0x44fb('0x0'));var util=require(_0x44fb('0x1'));var path=require(_0x44fb('0x2'));var timeout=require('connect-timeout');var express=require(_0x44fb('0x3'));var router=express['Router']();var auth=require(_0x44fb('0x4'));var interaction=require(_0x44fb('0x5'));var config=require(_0x44fb('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44fb('0x7')]);router['get'](_0x44fb('0x8'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xa')]);router[_0x44fb('0xb')]('/:id/fields',auth[_0x44fb('0x9')](),controller[_0x44fb('0xc')]);router[_0x44fb('0xb')]('/:id/subjects',auth[_0x44fb('0x9')](),controller[_0x44fb('0xd')]);router['get'](_0x44fb('0xe'),auth[_0x44fb('0x9')](),controller[_0x44fb('0xf')]);router[_0x44fb('0xb')]('/:id/tags',auth[_0x44fb('0x9')](),controller['getTags']);router[_0x44fb('0x10')]('/',auth[_0x44fb('0x9')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x10')]('/:id/tags',auth[_0x44fb('0x9')](),controller[_0x44fb('0x12')]);router['put'](_0x44fb('0x8'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x13')]);router[_0x44fb('0x14')](_0x44fb('0x8'),auth[_0x44fb('0x9')](),controller[_0x44fb('0x15')]);module[_0x44fb('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 45b5b93..6697bcf 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 _0x4ef0=['sequelize','STRING'];(function(_0x44cad0,_0x229ce2){var _0x360e6f=function(_0x5a185e){while(--_0x5a185e){_0x44cad0['push'](_0x44cad0['shift']());}};_0x360e6f(++_0x229ce2);}(_0x4ef0,0x1a8));var _0x04ef=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x4ef0[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require(_0x04ef('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x04ef('0x1')]}}; \ No newline at end of file +var _0xe2ba=['exports','STRING','sequelize'];(function(_0x1bbb85,_0x37cb06){var _0x59c3f0=function(_0x1fd4b8){while(--_0x1fd4b8){_0x1bbb85['push'](_0x1bbb85['shift']());}};_0x59c3f0(++_0x37cb06);}(_0xe2ba,0x68));var _0xae2b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xe2ba[_0x4e9628];return _0x27bc8c;};'use strict';var Sequelize=require(_0xae2b('0x0'));module[_0xae2b('0x1')]={'name':{'type':Sequelize[_0xae2b('0x2')]},'description':{'type':Sequelize[_0xae2b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 16d107f..fb28f75 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 _0xc4aa=['ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','stack','send','index','map','ZendeskConfiguration','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','count','includeAll','rows','show','rawAttributes','include','create','body','find','params','getFields','ZendeskField','getSubjects','hasOwnProperty','nolimit','getDescriptions','findOne','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];var jayson=require(_0xac4a('0x16'));var client=jayson[_0xac4a('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x21a79,_0x68424a,_0x247b78){if(_0x247b78){var _0x6e00d4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6e00d4[_0xac4a('0x18')](_0x68424a)){return _0x21a79;}else{throw new db[(_0xac4a('0x19'))][(_0xac4a('0x1a'))](_0xac4a('0x1b'));}}else{return _0x21a79;}}function respondWithRpcPromise(_0x190418,_0x42c7fc,_0x11e101,_0x26dbb8){return new BPromise(function(_0x4a2119,_0x402fff){var _0x34d797=_0x26dbb8||client;return _0x34d797[_0xac4a('0x1c')](_0x190418,_0x11e101)[_0xac4a('0x1d')](function(_0x3e88e3){logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42c7fc,_0xac4a('0x20'),JSON[_0xac4a('0x21')](_0x3e88e3));if(_0x3e88e3[_0xac4a('0x22')]){if(_0x3e88e3['error'][_0xac4a('0x23')]===0x1f4){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x402fff(_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);}logger[_0xac4a('0x22')]('ZendeskConfiguration,\x20%s,\x20%s',_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x4a2119(_0x3e88e3['error'][_0xac4a('0x24')]);}else{logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));_0x4a2119(_0x3e88e3['result'][_0xac4a('0x24')]);}})[_0xac4a('0x25')](function(_0x15435c){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x15435c);_0x402fff(_0x15435c);});});}function respondWithStatusCode(_0x2b0dc2,_0x222507){_0x222507=_0x222507||0xcc;return function(_0x36054a){if(_0x36054a){return _0x2b0dc2[_0xac4a('0x26')](_0x222507);}return _0x2b0dc2[_0xac4a('0x27')](_0x222507)[_0xac4a('0x28')]();};}function respondWithResult(_0x215a31,_0x14832b){_0x14832b=_0x14832b||0xc8;return function(_0x472c57){if(_0x472c57){return _0x215a31[_0xac4a('0x27')](_0x14832b)[_0xac4a('0x29')](_0x472c57);}};}function respondWithFilteredResult(_0x4e17ce,_0x23b061){return function(_0x267a22){if(_0x267a22){var _0x42a33c=_0x267a22['count'],_0x2772fe=_0x23b061[_0xac4a('0x2a')],_0x116700=_0x23b061[_0xac4a('0x2a')]+_0x23b061[_0xac4a('0x2b')],_0x4a5a9e;if(_0x116700>=_0x42a33c){_0x116700=_0x42a33c;_0x4a5a9e=0xc8;}else{_0x4a5a9e=0xce;}_0x4e17ce['status'](_0x4a5a9e);return _0x4e17ce['set'](_0xac4a('0x2c'),_0x2772fe+'-'+_0x116700+'/'+_0x42a33c)[_0xac4a('0x29')](_0x267a22);}return null;};}function patchUpdates(_0x228629){return function(_0x432066){try{jsonpatch[_0xac4a('0x2d')](_0x432066,_0x228629,!![]);}catch(_0x53d3a5){return BPromise[_0xac4a('0x2e')](_0x53d3a5);}return _0x432066['save']();};}function saveUpdates(_0x30364b,_0x57adcf){return function(_0x17e6de){if(_0x17e6de){return _0x17e6de[_0xac4a('0x2f')](_0x30364b)[_0xac4a('0x1d')](function(_0x228aa7){return _0x228aa7;});}return null;};}function removeEntity(_0x34577f,_0x61e552){return function(_0xbd4591){if(_0xbd4591){return _0xbd4591[_0xac4a('0x30')]()[_0xac4a('0x1d')](function(){_0x34577f[_0xac4a('0x27')](0xcc)[_0xac4a('0x28')]();});}};}function handleEntityNotFound(_0x1634df,_0x1a9be2){return function(_0x1a9d4e){if(!_0x1a9d4e){_0x1634df['sendStatus'](0x194);}return _0x1a9d4e;};}function handleError(_0x30442d,_0x1c41fb){_0x1c41fb=_0x1c41fb||0x1f4;return function(_0x5a4e2b){logger[_0xac4a('0x22')](_0x5a4e2b[_0xac4a('0x31')]);if(_0x5a4e2b['name']){delete _0x5a4e2b['name'];}_0x30442d[_0xac4a('0x27')](_0x1c41fb)[_0xac4a('0x32')](_0x5a4e2b);};}exports[_0xac4a('0x33')]=function(_0x3de9e2,_0x4f5986){var _0x453d02={},_0x2e56c6={},_0x4e7630={'count':0x0,'rows':[]};var _0x37f2ee=_[_0xac4a('0x34')](db[_0xac4a('0x35')]['rawAttributes'],function(_0x121328){return{'name':_0x121328[_0xac4a('0x36')],'type':_0x121328[_0xac4a('0x37')]['key']};});_0x2e56c6[_0xac4a('0x38')]=_[_0xac4a('0x34')](_0x37f2ee,'name');_0x2e56c6['query']=_[_0xac4a('0x39')](_0x3de9e2['query']);_0x2e56c6['filters']=_['intersection'](_0x2e56c6['model'],_0x2e56c6[_0xac4a('0x3a')]);_0x453d02[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2e56c6[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x453d02[_0xac4a('0x3b')]=_0x453d02[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x453d02[_0xac4a('0x3b')]:_0x2e56c6[_0xac4a('0x38')];if(!_0x3de9e2['query']['hasOwnProperty']('nolimit')){_0x453d02[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x453d02[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2a')]);}_0x453d02[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x3de9e2['query'][_0xac4a('0x40')]);_0x453d02[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x3de9e2[_0xac4a('0x3a')],_0x2e56c6['filters']));if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x453d02['where']=_[_0xac4a('0x45')](_0x453d02['where'],{'$or':_[_0xac4a('0x34')](_0x37f2ee,function(_0x65494e){if(_0x65494e[_0xac4a('0x37')]!==_0xac4a('0x46')){var _0x520e4a={};_0x520e4a[_0x65494e[_0xac4a('0x47')]]={'$like':'%'+_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x520e4a;}})});}_0x453d02=_[_0xac4a('0x45')]({},_0x453d02,_0x3de9e2[_0xac4a('0x48')]);var _0x4fa9eb={'where':_0x453d02[_0xac4a('0x41')]};return db['ZendeskConfiguration'][_0xac4a('0x49')](_0x4fa9eb)[_0xac4a('0x1d')](function(_0xeca4e9){_0x4e7630['count']=_0xeca4e9;if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x453d02['include']=[{'all':!![]}];}return db[_0xac4a('0x35')]['findAll'](_0x453d02);})[_0xac4a('0x1d')](function(_0xe620f6){_0x4e7630[_0xac4a('0x4b')]=_0xe620f6;return _0x4e7630;})['then'](respondWithFilteredResult(_0x4f5986,_0x453d02))['catch'](handleError(_0x4f5986,null));};exports[_0xac4a('0x4c')]=function(_0x4aaeff,_0x18ae96){var _0x566258={'raw':![],'where':{'id':_0x4aaeff['params']['id']}},_0x3d2aaf={};_0x3d2aaf[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x35')][_0xac4a('0x4d')]);_0x3d2aaf['query']=_[_0xac4a('0x39')](_0x4aaeff[_0xac4a('0x3a')]);_0x3d2aaf[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x3d2aaf[_0xac4a('0x38')],_0x3d2aaf[_0xac4a('0x3a')]);_0x566258[_0xac4a('0x3b')]=_['intersection'](_0x3d2aaf[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x4aaeff['query'][_0xac4a('0x3d')]));_0x566258[_0xac4a('0x3b')]=_0x566258[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x566258['attributes']:_0x3d2aaf[_0xac4a('0x38')];if(_0x4aaeff[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x566258[_0xac4a('0x4e')]=[{'all':!![]}];}_0x566258=_[_0xac4a('0x45')]({},_0x566258,_0x4aaeff['options']);return db[_0xac4a('0x35')]['find'](_0x566258)[_0xac4a('0x1d')](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x1d')](respondWithResult(_0x18ae96,null))['catch'](handleError(_0x18ae96,null));};exports['create']=function(_0x437466,_0x70fdc3){return db['ZendeskConfiguration'][_0xac4a('0x4f')](_0x437466[_0xac4a('0x50')],{})[_0xac4a('0x1d')](respondWithResult(_0x70fdc3,0xc9))[_0xac4a('0x25')](handleError(_0x70fdc3,null));};exports['update']=function(_0x3057d6,_0x108f7c){if(_0x3057d6[_0xac4a('0x50')]['id']){delete _0x3057d6[_0xac4a('0x50')]['id'];}return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x3057d6[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x108f7c,null))[_0xac4a('0x1d')](saveUpdates(_0x3057d6[_0xac4a('0x50')],null))[_0xac4a('0x1d')](respondWithResult(_0x108f7c,null))[_0xac4a('0x25')](handleError(_0x108f7c,null));};exports[_0xac4a('0x30')]=function(_0x2ac1e9,_0x213df2){return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x2ac1e9[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x213df2,null))[_0xac4a('0x1d')](removeEntity(_0x213df2,null))[_0xac4a('0x25')](handleError(_0x213df2,null));};exports[_0xac4a('0x53')]=function(_0x5222f3,_0x11c753,_0x492aae){var _0x13a577={};var _0x479ebc={};var _0x2d598e;var _0x4b7f79;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x5222f3[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x11c753,null))['then'](function(_0x52c957){if(_0x52c957){_0x2d598e=_0x52c957;_0x479ebc[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x54')][_0xac4a('0x4d')]);_0x479ebc[_0xac4a('0x3a')]=_['keys'](_0x5222f3[_0xac4a('0x3a')]);_0x479ebc['filters']=_[_0xac4a('0x3c')](_0x479ebc['model'],_0x479ebc[_0xac4a('0x3a')]);_0x13a577[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x479ebc[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x13a577[_0xac4a('0x3b')]=_0x13a577[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x13a577[_0xac4a('0x3b')]:_0x479ebc[_0xac4a('0x38')];_0x13a577[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x40')]);_0x13a577[_0xac4a('0x41')]=qs['filters'](_[_0xac4a('0x43')](_0x5222f3[_0xac4a('0x3a')],_0x479ebc['filters']));if(_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x13a577[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x13a577[_0xac4a('0x41')],{'$or':_['map'](_0x13a577['attributes'],function(_0x45f3c3){var _0x11bb54={};_0x11bb54[_0x45f3c3]={'$like':'%'+_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x11bb54;})});}_0x13a577=_[_0xac4a('0x45')]({},_0x13a577,_0x5222f3[_0xac4a('0x48')]);return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0x44c60b){if(_0x44c60b){_0x4b7f79=_0x44c60b[_0xac4a('0x3e')];if(!_0x5222f3[_0xac4a('0x3a')]['hasOwnProperty']('nolimit')){_0x13a577[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x13a577[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0xb09b89){if(_0xb09b89){return _0xb09b89?{'count':_0x4b7f79,'rows':_0xb09b89}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x11c753,null))['catch'](handleError(_0x11c753,null));};exports[_0xac4a('0x55')]=function(_0xc74ce8,_0x26bd31,_0x231932){var _0x513976={};var _0xc61e94={};var _0x5a30af;var _0xab4305;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0xc74ce8['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x26bd31,null))[_0xac4a('0x1d')](function(_0x13097f){if(_0x13097f){_0x5a30af=_0x13097f;_0xc61e94['model']=_[_0xac4a('0x39')](db['ZendeskField'][_0xac4a('0x4d')]);_0xc61e94['query']=_['keys'](_0xc74ce8[_0xac4a('0x3a')]);_0xc61e94['filters']=_[_0xac4a('0x3c')](_0xc61e94['model'],_0xc61e94[_0xac4a('0x3a')]);_0x513976[_0xac4a('0x3b')]=_['intersection'](_0xc61e94[_0xac4a('0x38')],qs['fields'](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x513976['attributes']=_0x513976[_0xac4a('0x3b')]['length']?_0x513976['attributes']:_0xc61e94[_0xac4a('0x38')];_0x513976['order']=qs[_0xac4a('0x40')](_0xc74ce8['query']['sort']);_0x513976[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0xc74ce8['query'],_0xc61e94['filters']));if(_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x513976['where']=_['merge'](_0x513976[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x513976[_0xac4a('0x3b')],function(_0x36df3d){var _0x1810f7={};_0x1810f7[_0x36df3d]={'$like':'%'+_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x1810f7;})});}_0x513976=_[_0xac4a('0x45')]({},_0x513976,_0xc74ce8[_0xac4a('0x48')]);return _0x5a30af['getSubjects'](_0x513976);}})[_0xac4a('0x1d')](function(_0x440dc4){if(_0x440dc4){_0xab4305=_0x440dc4[_0xac4a('0x3e')];if(!_0xc74ce8['query'][_0xac4a('0x56')](_0xac4a('0x57'))){_0x513976[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0xc74ce8[_0xac4a('0x3a')]['limit']);_0x513976[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x5a30af[_0xac4a('0x55')](_0x513976);}})[_0xac4a('0x1d')](function(_0xd7bdd6){if(_0xd7bdd6){return _0xd7bdd6?{'count':_0xab4305,'rows':_0xd7bdd6}:null;}})['then'](respondWithResult(_0x26bd31,null))[_0xac4a('0x25')](handleError(_0x26bd31,null));};exports[_0xac4a('0x58')]=function(_0x19bd6f,_0x35a97c,_0x1bb24d){var _0x171c47={};var _0x547eec={};var _0x318bee;var _0x29c772;return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x19bd6f['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x35a97c,null))['then'](function(_0x4447b5){if(_0x4447b5){_0x318bee=_0x4447b5;_0x547eec[_0xac4a('0x38')]=_['keys'](db['ZendeskField'][_0xac4a('0x4d')]);_0x547eec[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x19bd6f['query']);_0x547eec[_0xac4a('0x42')]=_['intersection'](_0x547eec[_0xac4a('0x38')],_0x547eec[_0xac4a('0x3a')]);_0x171c47[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x547eec[_0xac4a('0x38')],qs['fields'](_0x19bd6f['query'][_0xac4a('0x3d')]));_0x171c47[_0xac4a('0x3b')]=_0x171c47[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x171c47[_0xac4a('0x3b')]:_0x547eec[_0xac4a('0x38')];_0x171c47[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x19bd6f['query']['sort']);_0x171c47[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x19bd6f[_0xac4a('0x3a')],_0x547eec[_0xac4a('0x42')]));if(_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x171c47[_0xac4a('0x41')]=_['merge'](_0x171c47['where'],{'$or':_[_0xac4a('0x34')](_0x171c47[_0xac4a('0x3b')],function(_0x22804e){var _0x371e06={};_0x371e06[_0x22804e]={'$like':'%'+_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x371e06;})});}_0x171c47=_[_0xac4a('0x45')]({},_0x171c47,_0x19bd6f['options']);return _0x318bee[_0xac4a('0x58')](_0x171c47);}})[_0xac4a('0x1d')](function(_0x3439f3){if(_0x3439f3){_0x29c772=_0x3439f3['length'];if(!_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x56')](_0xac4a('0x57'))){_0x171c47[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x171c47[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x19bd6f['query'][_0xac4a('0x2a')]);}return _0x318bee['getDescriptions'](_0x171c47);}})[_0xac4a('0x1d')](function(_0x1199f6){if(_0x1199f6){return _0x1199f6?{'count':_0x29c772,'rows':_0x1199f6}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x35a97c,null))[_0xac4a('0x25')](handleError(_0x35a97c,null));};exports[_0xac4a('0x5a')]=function(_0x337da7,_0x19766a,_0x5266d3){var _0x2b883a={};var _0x42b3f7={};var _0x279f9b;var _0x3315e7;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x337da7[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x19766a,null))['then'](function(_0x55af32){if(_0x55af32){_0x279f9b=_0x55af32;_0x42b3f7[_0xac4a('0x38')]=_[_0xac4a('0x39')](db['Tag'][_0xac4a('0x4d')]);_0x42b3f7[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x337da7[_0xac4a('0x3a')]);_0x42b3f7[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],_0x42b3f7[_0xac4a('0x3a')]);_0x2b883a[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],qs[_0xac4a('0x3d')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x2b883a[_0xac4a('0x3b')]=_0x2b883a[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x2b883a['attributes']:_0x42b3f7[_0xac4a('0x38')];_0x2b883a[_0xac4a('0x3f')]=qs['sort'](_0x337da7[_0xac4a('0x3a')]['sort']);_0x2b883a[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_['pick'](_0x337da7[_0xac4a('0x3a')],_0x42b3f7['filters']));if(_0x337da7[_0xac4a('0x3a')]['filter']){_0x2b883a[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x2b883a[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x2b883a[_0xac4a('0x3b')],function(_0x36d8ff){var _0x7e403a={};_0x7e403a[_0x36d8ff]={'$like':'%'+_0x337da7[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x7e403a;})});}_0x2b883a=_[_0xac4a('0x45')]({},_0x2b883a,_0x337da7[_0xac4a('0x48')]);return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x4217df){if(_0x4217df){_0x3315e7=_0x4217df['length'];if(!_0x337da7[_0xac4a('0x3a')][_0xac4a('0x56')]('nolimit')){_0x2b883a[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x2b883a[_0xac4a('0x2a')]=qs['offset'](_0x337da7[_0xac4a('0x3a')]['offset']);}return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x240ff1){if(_0x240ff1){return _0x240ff1?{'count':_0x3315e7,'rows':_0x240ff1}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x19766a,null))['catch'](handleError(_0x19766a,null));};exports[_0xac4a('0x5b')]=function(_0x55866d,_0x277fd1,_0x40d363){if(_0x55866d[_0xac4a('0x50')]['id']){delete _0x55866d['body']['id'];}return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x55866d[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x277fd1,null))[_0xac4a('0x1d')](function(_0x25639a){if(_0x25639a){return _0x25639a[_0xac4a('0x5b')](_0x55866d[_0xac4a('0x50')][_0xac4a('0x5c')]||[]);}return null;})[_0xac4a('0x1d')](respondWithResult(_0x277fd1,null))[_0xac4a('0x25')](handleError(_0x277fd1,null));}; \ No newline at end of file +var _0x7217=['rawAttributes','keys','intersection','include','options','find','create','body','params','getFields','ZendeskField','getSubjects','hasOwnProperty','getDescriptions','findOne','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','stack','name','index','map','type','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ZendeskConfiguration','includeAll','rows','show'];(function(_0x45c9f4,_0x2eec90){var _0x1f9be9=function(_0x1a5cbe){while(--_0x1a5cbe){_0x45c9f4['push'](_0x45c9f4['shift']());}};_0x1f9be9(++_0x2eec90);}(_0x7217,0x19e));var _0x7721=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x7217[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){_0x3e4e56['status'](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(!_0x326c50){_0x5ce026[_0x7721('0x2c')](0x194);}return _0x326c50;};}function handleError(_0x1d894b,_0x1c84c0){_0x1c84c0=_0x1c84c0||0x1f4;return function(_0x13c635){logger[_0x7721('0x26')](_0x13c635[_0x7721('0x39')]);if(_0x13c635[_0x7721('0x3a')]){delete _0x13c635[_0x7721('0x3a')];}_0x1d894b[_0x7721('0x2d')](_0x1c84c0)['send'](_0x13c635);};}exports[_0x7721('0x3b')]=function(_0x5e6663,_0x212384){var _0x35614c={},_0x7942f7={},_0x1d03de={'count':0x0,'rows':[]};var _0x3968f3=_[_0x7721('0x3c')](db['ZendeskConfiguration']['rawAttributes'],function(_0x4cadef){return{'name':_0x4cadef['fieldName'],'type':_0x4cadef[_0x7721('0x3d')][_0x7721('0x3e')]};});_0x7942f7[_0x7721('0x3f')]=_[_0x7721('0x3c')](_0x3968f3,'name');_0x7942f7[_0x7721('0x40')]=_['keys'](_0x5e6663[_0x7721('0x40')]);_0x7942f7[_0x7721('0x41')]=_['intersection'](_0x7942f7[_0x7721('0x3f')],_0x7942f7[_0x7721('0x40')]);_0x35614c['attributes']=_['intersection'](_0x7942f7[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x5e6663[_0x7721('0x40')][_0x7721('0x42')]));_0x35614c['attributes']=_0x35614c[_0x7721('0x43')][_0x7721('0x44')]?_0x35614c[_0x7721('0x43')]:_0x7942f7[_0x7721('0x3f')];if(!_0x5e6663[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x35614c['limit']=qs[_0x7721('0x31')](_0x5e6663['query'][_0x7721('0x31')]);_0x35614c[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e6663['query'][_0x7721('0x30')]);}_0x35614c[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e6663['query'][_0x7721('0x47')]);_0x35614c[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e6663[_0x7721('0x40')],_0x7942f7[_0x7721('0x41')]));if(_0x5e6663[_0x7721('0x40')]['filter']){_0x35614c['where']=_[_0x7721('0x4a')](_0x35614c[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x3968f3,function(_0x39a3ad){if(_0x39a3ad[_0x7721('0x3d')]!==_0x7721('0x4b')){var _0x1d2ea5={};_0x1d2ea5[_0x39a3ad[_0x7721('0x3a')]]={'$like':'%'+_0x5e6663[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1d2ea5;}})});}_0x35614c=_['merge']({},_0x35614c,_0x5e6663['options']);var _0x5ed70d={'where':_0x35614c[_0x7721('0x48')]};return db[_0x7721('0x4d')][_0x7721('0x2f')](_0x5ed70d)['then'](function(_0x30107e){_0x1d03de[_0x7721('0x2f')]=_0x30107e;if(_0x5e6663['query'][_0x7721('0x4e')]){_0x35614c['include']=[{'all':!![]}];}return db[_0x7721('0x4d')]['findAll'](_0x35614c);})[_0x7721('0x38')](function(_0x196be4){_0x1d03de[_0x7721('0x4f')]=_0x196be4;return _0x1d03de;})['then'](respondWithFilteredResult(_0x212384,_0x35614c))[_0x7721('0x2b')](handleError(_0x212384,null));};exports[_0x7721('0x50')]=function(_0x499381,_0x223d93){var _0x1196c2={'raw':![],'where':{'id':_0x499381['params']['id']}},_0xf88e8c={};_0xf88e8c[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x4d')][_0x7721('0x51')]);_0xf88e8c[_0x7721('0x40')]=_[_0x7721('0x52')](_0x499381[_0x7721('0x40')]);_0xf88e8c[_0x7721('0x41')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],_0xf88e8c[_0x7721('0x40')]);_0x1196c2[_0x7721('0x43')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x499381[_0x7721('0x40')][_0x7721('0x42')]));_0x1196c2['attributes']=_0x1196c2[_0x7721('0x43')][_0x7721('0x44')]?_0x1196c2[_0x7721('0x43')]:_0xf88e8c[_0x7721('0x3f')];if(_0x499381[_0x7721('0x40')][_0x7721('0x4e')]){_0x1196c2[_0x7721('0x54')]=[{'all':!![]}];}_0x1196c2=_['merge']({},_0x1196c2,_0x499381[_0x7721('0x55')]);return db[_0x7721('0x4d')][_0x7721('0x56')](_0x1196c2)[_0x7721('0x38')](handleEntityNotFound(_0x223d93,null))[_0x7721('0x38')](respondWithResult(_0x223d93,null))[_0x7721('0x2b')](handleError(_0x223d93,null));};exports[_0x7721('0x57')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x4d')][_0x7721('0x57')](_0x33287d['body'],{})[_0x7721('0x38')](respondWithResult(_0x11b300,0xc9))[_0x7721('0x2b')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x2ee3c0,_0x15ed3b){if(_0x2ee3c0[_0x7721('0x58')]['id']){delete _0x2ee3c0[_0x7721('0x58')]['id'];}return db[_0x7721('0x4d')][_0x7721('0x56')]({'where':{'id':_0x2ee3c0[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x38')](saveUpdates(_0x2ee3c0[_0x7721('0x58')],null))[_0x7721('0x38')](respondWithResult(_0x15ed3b,null))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports['destroy']=function(_0x50e9e9,_0x4e112e){return db[_0x7721('0x4d')]['find']({'where':{'id':_0x50e9e9['params']['id']}})['then'](handleEntityNotFound(_0x4e112e,null))['then'](removeEntity(_0x4e112e,null))[_0x7721('0x2b')](handleError(_0x4e112e,null));};exports[_0x7721('0x5a')]=function(_0x13f254,_0x5343a1,_0x5181d7){var _0x5925b7={};var _0x51a3a2={};var _0x484b8e;var _0x24d1dc;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x13f254['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5343a1,null))[_0x7721('0x38')](function(_0x1ff090){if(_0x1ff090){_0x484b8e=_0x1ff090;_0x51a3a2['model']=_[_0x7721('0x52')](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x51a3a2[_0x7721('0x40')]=_[_0x7721('0x52')](_0x13f254[_0x7721('0x40')]);_0x51a3a2[_0x7721('0x41')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],_0x51a3a2[_0x7721('0x40')]);_0x5925b7[_0x7721('0x43')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x13f254[_0x7721('0x40')]['fields']));_0x5925b7[_0x7721('0x43')]=_0x5925b7[_0x7721('0x43')][_0x7721('0x44')]?_0x5925b7[_0x7721('0x43')]:_0x51a3a2['model'];_0x5925b7[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x13f254['query'][_0x7721('0x47')]);_0x5925b7['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x13f254[_0x7721('0x40')],_0x51a3a2[_0x7721('0x41')]));if(_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]){_0x5925b7[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5925b7[_0x7721('0x48')],{'$or':_['map'](_0x5925b7[_0x7721('0x43')],function(_0x24444f){var _0x112033={};_0x112033[_0x24444f]={'$like':'%'+_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x112033;})});}_0x5925b7=_[_0x7721('0x4a')]({},_0x5925b7,_0x13f254[_0x7721('0x55')]);return _0x484b8e['getFields'](_0x5925b7);}})[_0x7721('0x38')](function(_0xb19b84){if(_0xb19b84){_0x24d1dc=_0xb19b84['length'];if(!_0x13f254[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x5925b7[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x13f254[_0x7721('0x40')][_0x7721('0x31')]);_0x5925b7[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x13f254['query'][_0x7721('0x30')]);}return _0x484b8e[_0x7721('0x5a')](_0x5925b7);}})[_0x7721('0x38')](function(_0x5f08cc){if(_0x5f08cc){return _0x5f08cc?{'count':_0x24d1dc,'rows':_0x5f08cc}:null;}})['then'](respondWithResult(_0x5343a1,null))['catch'](handleError(_0x5343a1,null));};exports['getSubjects']=function(_0x5e966f,_0x1fc5f7,_0x2645dd){var _0x580473={};var _0x2d4b3a={};var _0x42f6e9;var _0xbbc86f;return db[_0x7721('0x4d')]['findOne']({'where':{'id':_0x5e966f[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x1fc5f7,null))[_0x7721('0x38')](function(_0x1bea13){if(_0x1bea13){_0x42f6e9=_0x1bea13;_0x2d4b3a[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x2d4b3a[_0x7721('0x40')]=_['keys'](_0x5e966f['query']);_0x2d4b3a[_0x7721('0x41')]=_[_0x7721('0x53')](_0x2d4b3a[_0x7721('0x3f')],_0x2d4b3a[_0x7721('0x40')]);_0x580473[_0x7721('0x43')]=_['intersection'](_0x2d4b3a['model'],qs[_0x7721('0x42')](_0x5e966f[_0x7721('0x40')][_0x7721('0x42')]));_0x580473[_0x7721('0x43')]=_0x580473[_0x7721('0x43')][_0x7721('0x44')]?_0x580473[_0x7721('0x43')]:_0x2d4b3a['model'];_0x580473[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e966f[_0x7721('0x40')]['sort']);_0x580473[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e966f[_0x7721('0x40')],_0x2d4b3a['filters']));if(_0x5e966f['query'][_0x7721('0x4c')]){_0x580473[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x580473[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x580473[_0x7721('0x43')],function(_0x59e80c){var _0x3855d5={};_0x3855d5[_0x59e80c]={'$like':'%'+_0x5e966f[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x3855d5;})});}_0x580473=_['merge']({},_0x580473,_0x5e966f[_0x7721('0x55')]);return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0xc20188){if(_0xc20188){_0xbbc86f=_0xc20188[_0x7721('0x44')];if(!_0x5e966f['query'][_0x7721('0x5d')]('nolimit')){_0x580473[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x5e966f[_0x7721('0x40')][_0x7721('0x31')]);_0x580473[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e966f[_0x7721('0x40')][_0x7721('0x30')]);}return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0x2c74d8){if(_0x2c74d8){return _0x2c74d8?{'count':_0xbbc86f,'rows':_0x2c74d8}:null;}})['then'](respondWithResult(_0x1fc5f7,null))[_0x7721('0x2b')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x5e')]=function(_0x39194e,_0x5eec29,_0x94af20){var _0x26b2cc={};var _0x139517={};var _0xc9761e;var _0xcd9f0d;return db['ZendeskConfiguration'][_0x7721('0x5f')]({'where':{'id':_0x39194e[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5eec29,null))[_0x7721('0x38')](function(_0x30326d){if(_0x30326d){_0xc9761e=_0x30326d;_0x139517[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x139517['query']=_[_0x7721('0x52')](_0x39194e['query']);_0x139517[_0x7721('0x41')]=_[_0x7721('0x53')](_0x139517['model'],_0x139517[_0x7721('0x40')]);_0x26b2cc['attributes']=_['intersection'](_0x139517['model'],qs[_0x7721('0x42')](_0x39194e[_0x7721('0x40')][_0x7721('0x42')]));_0x26b2cc['attributes']=_0x26b2cc['attributes']['length']?_0x26b2cc[_0x7721('0x43')]:_0x139517[_0x7721('0x3f')];_0x26b2cc[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x39194e[_0x7721('0x40')][_0x7721('0x47')]);_0x26b2cc['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x39194e[_0x7721('0x40')],_0x139517[_0x7721('0x41')]));if(_0x39194e[_0x7721('0x40')][_0x7721('0x4c')]){_0x26b2cc[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x26b2cc[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x26b2cc[_0x7721('0x43')],function(_0x368dbb){var _0x58429d={};_0x58429d[_0x368dbb]={'$like':'%'+_0x39194e['query'][_0x7721('0x4c')]+'%'};return _0x58429d;})});}_0x26b2cc=_[_0x7721('0x4a')]({},_0x26b2cc,_0x39194e['options']);return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x4e3c93){if(_0x4e3c93){_0xcd9f0d=_0x4e3c93[_0x7721('0x44')];if(!_0x39194e['query']['hasOwnProperty'](_0x7721('0x45'))){_0x26b2cc[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x39194e[_0x7721('0x40')][_0x7721('0x31')]);_0x26b2cc['offset']=qs[_0x7721('0x30')](_0x39194e[_0x7721('0x40')][_0x7721('0x30')]);}return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x52fcc1){if(_0x52fcc1){return _0x52fcc1?{'count':_0xcd9f0d,'rows':_0x52fcc1}:null;}})[_0x7721('0x38')](respondWithResult(_0x5eec29,null))[_0x7721('0x2b')](handleError(_0x5eec29,null));};exports['getTags']=function(_0x2005d1,_0x13dc8a,_0x58f7b1){var _0x5b76e3={};var _0x2dbb6d={};var _0x1b68a7;var _0x606b4b;return db[_0x7721('0x4d')][_0x7721('0x5f')]({'where':{'id':_0x2005d1[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x13dc8a,null))[_0x7721('0x38')](function(_0x59de30){if(_0x59de30){_0x1b68a7=_0x59de30;_0x2dbb6d[_0x7721('0x3f')]=_[_0x7721('0x52')](db[_0x7721('0x60')][_0x7721('0x51')]);_0x2dbb6d[_0x7721('0x40')]=_[_0x7721('0x52')](_0x2005d1[_0x7721('0x40')]);_0x2dbb6d['filters']=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],_0x2dbb6d['query']);_0x5b76e3[_0x7721('0x43')]=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x2005d1[_0x7721('0x40')][_0x7721('0x42')]));_0x5b76e3[_0x7721('0x43')]=_0x5b76e3[_0x7721('0x43')][_0x7721('0x44')]?_0x5b76e3[_0x7721('0x43')]:_0x2dbb6d['model'];_0x5b76e3[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x2005d1[_0x7721('0x40')][_0x7721('0x47')]);_0x5b76e3[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x2005d1[_0x7721('0x40')],_0x2dbb6d[_0x7721('0x41')]));if(_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]){_0x5b76e3[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5b76e3[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x5b76e3[_0x7721('0x43')],function(_0xea9824){var _0x1fb651={};_0x1fb651[_0xea9824]={'$like':'%'+_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1fb651;})});}_0x5b76e3=_['merge']({},_0x5b76e3,_0x2005d1[_0x7721('0x55')]);return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x2af5f5){if(_0x2af5f5){_0x606b4b=_0x2af5f5[_0x7721('0x44')];if(!_0x2005d1[_0x7721('0x40')][_0x7721('0x5d')]('nolimit')){_0x5b76e3['limit']=qs['limit'](_0x2005d1['query'][_0x7721('0x31')]);_0x5b76e3[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x2005d1[_0x7721('0x40')][_0x7721('0x30')]);}return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x501a11){if(_0x501a11){return _0x501a11?{'count':_0x606b4b,'rows':_0x501a11}:null;}})[_0x7721('0x38')](respondWithResult(_0x13dc8a,null))[_0x7721('0x2b')](handleError(_0x13dc8a,null));};exports[_0x7721('0x61')]=function(_0x11d5a7,_0xf061eb,_0x2b0c22){if(_0x11d5a7['body']['id']){delete _0x11d5a7[_0x7721('0x58')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x11d5a7[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0xf061eb,null))[_0x7721('0x38')](function(_0x357b78){if(_0x357b78){return _0x357b78[_0x7721('0x61')](_0x11d5a7['body'][_0x7721('0x62')]||[]);}return null;})[_0x7721('0x38')](respondWithResult(_0xf061eb,null))[_0x7721('0x2b')](handleError(_0xf061eb,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index cf75f16..169839c 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 _0x09cf=['request-promise','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3374a5,_0x2031eb){var _0x4c301e=function(_0x224059){while(--_0x224059){_0x3374a5['push'](_0x3374a5['shift']());}};_0x4c301e(++_0x2031eb);}(_0x09cf,0x16e));var _0xf09c=function(_0x2ac1ca,_0x5cc564){_0x2ac1ca=_0x2ac1ca-0x0;var _0x5f26ac=_0x09cf[_0x2ac1ca];return _0x5f26ac;};'use strict';var _=require(_0xf09c('0x0'));var util=require(_0xf09c('0x1'));var logger=require(_0xf09c('0x2'))(_0xf09c('0x3'));var moment=require(_0xf09c('0x4'));var BPromise=require(_0xf09c('0x5'));var rp=require(_0xf09c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf09c('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xf09c('0x8')]=function(_0x5e4242,_0x160884){return _0x5e4242[_0xf09c('0x9')](_0xf09c('0xa'),attributes,{'tableName':_0xf09c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6307=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api'];(function(_0x57a6ef,_0x29e878){var _0x5a449c=function(_0x33ca8a){while(--_0x33ca8a){_0x57a6ef['push'](_0x57a6ef['shift']());}};_0x5a449c(++_0x29e878);}(_0x6307,0x1a0));var _0x7630=function(_0x3e3bee,_0x4f91fe){_0x3e3bee=_0x3e3bee-0x0;var _0x3ae14c=_0x6307[_0x3e3bee];return _0x3ae14c;};'use strict';var _=require(_0x7630('0x0'));var util=require(_0x7630('0x1'));var logger=require(_0x7630('0x2'))(_0x7630('0x3'));var moment=require(_0x7630('0x4'));var BPromise=require(_0x7630('0x5'));var rp=require(_0x7630('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7630('0x7'));var attributes=require(_0x7630('0x8'));module['exports']=function(_0x55214f,_0x186d68){return _0x55214f[_0x7630('0x9')](_0x7630('0xa'),attributes,{'tableName':_0x7630('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index e2bc1d6..c64a939 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 _0xcae8=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0xa97847,_0x6f7581){var _0x919474=function(_0x2e0742){while(--_0x2e0742){_0xa97847['push'](_0xa97847['shift']());}};_0x919474(++_0x6f7581);}(_0xcae8,0x80));var _0x8cae=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xcae8[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x8cae('0x0'));var util=require(_0x8cae('0x1'));var moment=require(_0x8cae('0x2'));var BPromise=require('bluebird');var rs=require(_0x8cae('0x3'));var fs=require('fs');var Redis=require(_0x8cae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cae('0x5'));var logger=require(_0x8cae('0x6'))(_0x8cae('0x7'));var config=require(_0x8cae('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8cae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db816,_0x13bf18,_0x52f3a2){return new BPromise(function(_0x5d0ca6,_0x16266e){return client['request'](_0x3db816,_0x52f3a2)['then'](function(_0xb88d67){logger[_0x8cae('0xa')](_0x8cae('0xb'),_0x13bf18,_0x8cae('0xc'));logger[_0x8cae('0xd')](_0x8cae('0xe'),_0x13bf18,_0x8cae('0xc'),JSON['stringify'](_0xb88d67));if(_0xb88d67['error']){if(_0xb88d67[_0x8cae('0xf')][_0x8cae('0x10')]===0x1f4){logger[_0x8cae('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x13bf18,_0xb88d67[_0x8cae('0xf')][_0x8cae('0x11')]);return _0x16266e(_0xb88d67[_0x8cae('0xf')][_0x8cae('0x11')]);}logger[_0x8cae('0xf')](_0x8cae('0xb'),_0x13bf18,_0xb88d67[_0x8cae('0xf')][_0x8cae('0x11')]);return _0x5d0ca6(_0xb88d67[_0x8cae('0xf')]['message']);}else{logger[_0x8cae('0xa')](_0x8cae('0xb'),_0x13bf18,'request\x20sent');_0x5d0ca6(_0xb88d67[_0x8cae('0x12')][_0x8cae('0x11')]);}})[_0x8cae('0x13')](function(_0x387f57){logger[_0x8cae('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x13bf18,_0x387f57);_0x16266e(_0x387f57);});});} \ No newline at end of file +var _0xf3d7=['ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2da45d,_0x35397b){var _0x1012a0=function(_0x2babc3){while(--_0x2babc3){_0x2da45d['push'](_0x2da45d['shift']());}};_0x1012a0(++_0x35397b);}(_0xf3d7,0x85));var _0x7f3d=function(_0x33c603,_0x6d0ce4){_0x33c603=_0x33c603-0x0;var _0xae96f4=_0xf3d7[_0x33c603];return _0xae96f4;};'use strict';var _=require(_0x7f3d('0x0'));var util=require('util');var moment=require(_0x7f3d('0x1'));var BPromise=require(_0x7f3d('0x2'));var rs=require(_0x7f3d('0x3'));var fs=require('fs');var Redis=require(_0x7f3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f3d('0x5'));var logger=require(_0x7f3d('0x6'))('rpc');var config=require(_0x7f3d('0x7'));var jayson=require(_0x7f3d('0x8'));var client=jayson['client'][_0x7f3d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f4a4d,_0x29e43f,_0x3a2fb1){return new BPromise(function(_0x1884b6,_0x204cde){return client['request'](_0x3f4a4d,_0x3a2fb1)['then'](function(_0x2e027b){logger[_0x7f3d('0xa')](_0x7f3d('0xb'),_0x29e43f,_0x7f3d('0xc'));logger[_0x7f3d('0xd')](_0x7f3d('0xe'),_0x29e43f,_0x7f3d('0xc'),JSON[_0x7f3d('0xf')](_0x2e027b));if(_0x2e027b['error']){if(_0x2e027b[_0x7f3d('0x10')][_0x7f3d('0x11')]===0x1f4){logger[_0x7f3d('0x10')](_0x7f3d('0xb'),_0x29e43f,_0x2e027b[_0x7f3d('0x10')][_0x7f3d('0x12')]);return _0x204cde(_0x2e027b[_0x7f3d('0x10')]['message']);}logger[_0x7f3d('0x10')](_0x7f3d('0xb'),_0x29e43f,_0x2e027b[_0x7f3d('0x10')][_0x7f3d('0x12')]);return _0x1884b6(_0x2e027b[_0x7f3d('0x10')]['message']);}else{logger[_0x7f3d('0xa')](_0x7f3d('0xb'),_0x29e43f,_0x7f3d('0xc'));_0x1884b6(_0x2e027b[_0x7f3d('0x13')][_0x7f3d('0x12')]);}})[_0x7f3d('0x14')](function(_0x224073){logger[_0x7f3d('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x29e43f,_0x224073);_0x204cde(_0x224073);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 62d003c..a7c0be8 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 _0xda33=['/:id','show','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x3be577,_0x33c662){var _0x10bbd8=function(_0x42141f){while(--_0x42141f){_0x3be577['push'](_0x3be577['shift']());}};_0x10bbd8(++_0x33c662);}(_0xda33,0x1b7));var _0x3da3=function(_0x4d986b,_0xda3440){_0x4d986b=_0x4d986b-0x0;var _0x41758e=_0xda33[_0x4d986b];return _0x41758e;};'use strict';var multer=require(_0x3da3('0x0'));var util=require(_0x3da3('0x1'));var path=require(_0x3da3('0x2'));var timeout=require('connect-timeout');var express=require(_0x3da3('0x3'));var router=express[_0x3da3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3da3('0x5'));var config=require(_0x3da3('0x6'));var controller=require(_0x3da3('0x7'));router[_0x3da3('0x8')]('/',auth[_0x3da3('0x9')](),controller[_0x3da3('0xa')]);router['get'](_0x3da3('0xb'),auth[_0x3da3('0x9')](),controller[_0x3da3('0xc')]);router['post']('/',auth[_0x3da3('0x9')](),controller['create']);router[_0x3da3('0xd')](_0x3da3('0xb'),auth['isAuthenticated'](),controller[_0x3da3('0xe')]);router[_0x3da3('0xf')](_0x3da3('0xb'),auth['isAuthenticated'](),controller[_0x3da3('0x10')]);module[_0x3da3('0x11')]=router; \ No newline at end of file +var _0x19be=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','create','update','delete'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0x19be,0x1de));var _0xe19b=function(_0x287d9e,_0x59114d){_0x287d9e=_0x287d9e-0x0;var _0x314092=_0x19be[_0x287d9e];return _0x314092;};'use strict';var multer=require(_0xe19b('0x0'));var util=require(_0xe19b('0x1'));var path=require(_0xe19b('0x2'));var timeout=require(_0xe19b('0x3'));var express=require('express');var router=express[_0xe19b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe19b('0x5'));var config=require(_0xe19b('0x6'));var controller=require('./intZendeskField.controller');router[_0xe19b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe19b('0x8'),auth['isAuthenticated'](),controller[_0xe19b('0x9')]);router[_0xe19b('0xa')]('/',auth[_0xe19b('0xb')](),controller[_0xe19b('0xc')]);router['put']('/:id',auth[_0xe19b('0xb')](),controller[_0xe19b('0xd')]);router[_0xe19b('0xe')](_0xe19b('0x8'),auth[_0xe19b('0xb')](),controller[_0xe19b('0xf')]);module[_0xe19b('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 30400cd..0e1ea14 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 _0xcb70=['ENUM','variable','BOOLEAN','sequelize','exports','keyValue','string','STRING'];(function(_0x1cef53,_0x5d9f89){var _0x3cf893=function(_0xe6e042){while(--_0xe6e042){_0x1cef53['push'](_0x1cef53['shift']());}};_0x3cf893(++_0x5d9f89);}(_0xcb70,0xf3));var _0x0cb7=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xcb70[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0x0cb7('0x0'));module[_0x0cb7('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0x0cb7('0x2')),'defaultValue':_0x0cb7('0x3')},'content':{'type':Sequelize[_0x0cb7('0x4')]},'key':{'type':Sequelize[_0x0cb7('0x4')]},'keyType':{'type':Sequelize[_0x0cb7('0x5')](_0x0cb7('0x3'),_0x0cb7('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x0cb7('0x4')]},'idField':{'type':Sequelize[_0x0cb7('0x4')]},'nameField':{'type':Sequelize[_0x0cb7('0x4')]},'customField':{'type':Sequelize[_0x0cb7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cb7('0x4')]}}; \ No newline at end of file +var _0x16dc=['string','keyValue','STRING','variable','customVariable','exports','ENUM'];(function(_0x3d916f,_0x2eee2f){var _0x25d4c3=function(_0x339bfd){while(--_0x339bfd){_0x3d916f['push'](_0x3d916f['shift']());}};_0x25d4c3(++_0x2eee2f);}(_0x16dc,0x1ef));var _0xc16d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x16dc[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xc16d('0x0')]={'type':{'type':Sequelize[_0xc16d('0x1')](_0xc16d('0x2'),'variable','customVariable',_0xc16d('0x3')),'defaultValue':_0xc16d('0x2')},'content':{'type':Sequelize[_0xc16d('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc16d('0x1')](_0xc16d('0x2'),_0xc16d('0x5'),_0xc16d('0x6'))},'keyContent':{'type':Sequelize[_0xc16d('0x4')]},'idField':{'type':Sequelize[_0xc16d('0x4')]},'nameField':{'type':Sequelize[_0xc16d('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc16d('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 9352ab3..7fefb14 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 _0x2894=['error','stack','name','send','index','ZendeskField','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x2894,0x1a5));var _0x4289=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0x2894[_0x130719];return _0x159865;};'use strict';var pdf=require(_0x4289('0x0'));var emlformat=require(_0x4289('0x1'));var rimraf=require(_0x4289('0x2'));var zipdir=require(_0x4289('0x3'));var jsonpatch=require(_0x4289('0x4'));var rp=require(_0x4289('0x5'));var moment=require(_0x4289('0x6'));var BPromise=require(_0x4289('0x7'));var Mustache=require(_0x4289('0x8'));var util=require(_0x4289('0x9'));var path=require(_0x4289('0xa'));var sox=require(_0x4289('0xb'));var csv=require(_0x4289('0xc'));var ejs=require(_0x4289('0xd'));var fs=require('fs');var _=require(_0x4289('0xe'));var squel=require(_0x4289('0xf'));var crypto=require(_0x4289('0x10'));var jsforce=require(_0x4289('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4289('0x12'));var Papa=require(_0x4289('0x13'));var Redis=require(_0x4289('0x14'));var authService=require(_0x4289('0x15'));var qs=require(_0x4289('0x16'));var as=require(_0x4289('0x17'));var hardwareService=require(_0x4289('0x18'));var logger=require('../../config/logger')(_0x4289('0x19'));var utils=require(_0x4289('0x1a'));var config=require(_0x4289('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa8db,_0x841c8){_0x841c8=_0x841c8||0xcc;return function(_0x592358){if(_0x592358){return _0x3aa8db[_0x4289('0x1c')](_0x841c8);}return _0x3aa8db[_0x4289('0x1d')](_0x841c8)[_0x4289('0x1e')]();};}function respondWithResult(_0x216be,_0xd82a1b){_0xd82a1b=_0xd82a1b||0xc8;return function(_0x12378f){if(_0x12378f){return _0x216be[_0x4289('0x1d')](_0xd82a1b)[_0x4289('0x1f')](_0x12378f);}};}function respondWithFilteredResult(_0x184e2b,_0x22a369){return function(_0x2f788b){if(_0x2f788b){var _0x3af30f=_0x2f788b[_0x4289('0x20')],_0x1ffbcb=_0x22a369[_0x4289('0x21')],_0x44be2e=_0x22a369['offset']+_0x22a369[_0x4289('0x22')],_0x37cee5;if(_0x44be2e>=_0x3af30f){_0x44be2e=_0x3af30f;_0x37cee5=0xc8;}else{_0x37cee5=0xce;}_0x184e2b[_0x4289('0x1d')](_0x37cee5);return _0x184e2b[_0x4289('0x23')](_0x4289('0x24'),_0x1ffbcb+'-'+_0x44be2e+'/'+_0x3af30f)['json'](_0x2f788b);}return null;};}function patchUpdates(_0x6b755c){return function(_0x39111e){try{jsonpatch['apply'](_0x39111e,_0x6b755c,!![]);}catch(_0x3f154d){return BPromise[_0x4289('0x25')](_0x3f154d);}return _0x39111e[_0x4289('0x26')]();};}function saveUpdates(_0x5adf2d,_0x12005c){return function(_0x414e60){if(_0x414e60){return _0x414e60['update'](_0x5adf2d)['then'](function(_0x557e75){return _0x557e75;});}return null;};}function removeEntity(_0x22a260,_0x3a3925){return function(_0x473ea8){if(_0x473ea8){return _0x473ea8[_0x4289('0x27')]()[_0x4289('0x28')](function(){_0x22a260['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x397d89,_0x550114){return function(_0xc943f3){if(!_0xc943f3){_0x397d89[_0x4289('0x1c')](0x194);}return _0xc943f3;};}function handleError(_0x1a0958,_0x296be1){_0x296be1=_0x296be1||0x1f4;return function(_0xb3a5de){logger[_0x4289('0x29')](_0xb3a5de[_0x4289('0x2a')]);if(_0xb3a5de['name']){delete _0xb3a5de[_0x4289('0x2b')];}_0x1a0958[_0x4289('0x1d')](_0x296be1)[_0x4289('0x2c')](_0xb3a5de);};}exports[_0x4289('0x2d')]=function(_0x59caca,_0x2068df){var _0xd25c68={},_0x54a69b={},_0xde93ca={'count':0x0,'rows':[]};var _0x441a01=_['map'](db[_0x4289('0x2e')]['rawAttributes'],function(_0x5b43cb){return{'name':_0x5b43cb[_0x4289('0x2f')],'type':_0x5b43cb[_0x4289('0x30')]['key']};});_0x54a69b[_0x4289('0x31')]=_['map'](_0x441a01,'name');_0x54a69b['query']=_['keys'](_0x59caca[_0x4289('0x32')]);_0x54a69b[_0x4289('0x33')]=_[_0x4289('0x34')](_0x54a69b['model'],_0x54a69b['query']);_0xd25c68[_0x4289('0x35')]=_[_0x4289('0x34')](_0x54a69b[_0x4289('0x31')],qs['fields'](_0x59caca['query'][_0x4289('0x36')]));_0xd25c68['attributes']=_0xd25c68[_0x4289('0x35')][_0x4289('0x37')]?_0xd25c68[_0x4289('0x35')]:_0x54a69b[_0x4289('0x31')];if(!_0x59caca[_0x4289('0x32')]['hasOwnProperty'](_0x4289('0x38'))){_0xd25c68[_0x4289('0x22')]=qs[_0x4289('0x22')](_0x59caca['query'][_0x4289('0x22')]);_0xd25c68['offset']=qs[_0x4289('0x21')](_0x59caca['query']['offset']);}_0xd25c68[_0x4289('0x39')]=qs[_0x4289('0x3a')](_0x59caca[_0x4289('0x32')][_0x4289('0x3a')]);_0xd25c68[_0x4289('0x3b')]=qs['filters'](_[_0x4289('0x3c')](_0x59caca['query'],_0x54a69b[_0x4289('0x33')]));if(_0x59caca[_0x4289('0x32')]['filter']){_0xd25c68[_0x4289('0x3b')]=_[_0x4289('0x3d')](_0xd25c68[_0x4289('0x3b')],{'$or':_[_0x4289('0x3e')](_0x441a01,function(_0x357f5a){if(_0x357f5a[_0x4289('0x30')]!=='VIRTUAL'){var _0x20f007={};_0x20f007[_0x357f5a[_0x4289('0x2b')]]={'$like':'%'+_0x59caca[_0x4289('0x32')][_0x4289('0x3f')]+'%'};return _0x20f007;}})});}_0xd25c68=_['merge']({},_0xd25c68,_0x59caca[_0x4289('0x40')]);var _0x7b930={'where':_0xd25c68[_0x4289('0x3b')]};return db['ZendeskField']['count'](_0x7b930)[_0x4289('0x28')](function(_0x57196d){_0xde93ca[_0x4289('0x20')]=_0x57196d;if(_0x59caca[_0x4289('0x32')][_0x4289('0x41')]){_0xd25c68['include']=[{'all':!![]}];}return db['ZendeskField'][_0x4289('0x42')](_0xd25c68);})['then'](function(_0x41938e){_0xde93ca[_0x4289('0x43')]=_0x41938e;return _0xde93ca;})[_0x4289('0x28')](respondWithFilteredResult(_0x2068df,_0xd25c68))[_0x4289('0x44')](handleError(_0x2068df,null));};exports[_0x4289('0x45')]=function(_0x294718,_0x4f2d9b){var _0x5d0d91={'raw':!![],'where':{'id':_0x294718[_0x4289('0x46')]['id']}},_0x19d9c3={};_0x19d9c3['model']=_[_0x4289('0x47')](db[_0x4289('0x2e')][_0x4289('0x48')]);_0x19d9c3[_0x4289('0x32')]=_['keys'](_0x294718[_0x4289('0x32')]);_0x19d9c3[_0x4289('0x33')]=_[_0x4289('0x34')](_0x19d9c3[_0x4289('0x31')],_0x19d9c3[_0x4289('0x32')]);_0x5d0d91[_0x4289('0x35')]=_[_0x4289('0x34')](_0x19d9c3[_0x4289('0x31')],qs[_0x4289('0x36')](_0x294718[_0x4289('0x32')][_0x4289('0x36')]));_0x5d0d91[_0x4289('0x35')]=_0x5d0d91[_0x4289('0x35')]['length']?_0x5d0d91[_0x4289('0x35')]:_0x19d9c3[_0x4289('0x31')];if(_0x294718[_0x4289('0x32')][_0x4289('0x41')]){_0x5d0d91[_0x4289('0x49')]=[{'all':!![]}];}_0x5d0d91=_[_0x4289('0x3d')]({},_0x5d0d91,_0x294718[_0x4289('0x40')]);return db[_0x4289('0x2e')][_0x4289('0x4a')](_0x5d0d91)[_0x4289('0x28')](handleEntityNotFound(_0x4f2d9b,null))[_0x4289('0x28')](respondWithResult(_0x4f2d9b,null))['catch'](handleError(_0x4f2d9b,null));};exports[_0x4289('0x4b')]=function(_0x2903b1,_0x226cee){return db[_0x4289('0x2e')][_0x4289('0x4b')](_0x2903b1[_0x4289('0x4c')],{})[_0x4289('0x28')](respondWithResult(_0x226cee,0xc9))['catch'](handleError(_0x226cee,null));};exports['update']=function(_0x3b9907,_0xd58fba){if(_0x3b9907[_0x4289('0x4c')]['id']){delete _0x3b9907[_0x4289('0x4c')]['id'];}return db[_0x4289('0x2e')][_0x4289('0x4a')]({'where':{'id':_0x3b9907[_0x4289('0x46')]['id']}})['then'](handleEntityNotFound(_0xd58fba,null))[_0x4289('0x28')](saveUpdates(_0x3b9907['body'],null))[_0x4289('0x28')](respondWithResult(_0xd58fba,null))['catch'](handleError(_0xd58fba,null));};exports[_0x4289('0x27')]=function(_0x1c0456,_0x2c4b6a){return db[_0x4289('0x2e')][_0x4289('0x4a')]({'where':{'id':_0x1c0456[_0x4289('0x46')]['id']}})[_0x4289('0x28')](handleEntityNotFound(_0x2c4b6a,null))['then'](removeEntity(_0x2c4b6a,null))[_0x4289('0x44')](handleError(_0x2c4b6a,null));}; \ No newline at end of file +var _0xe85b=['rows','catch','show','params','includeAll','include','options','find','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','apply','reject','update','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','ZendeskField','count','findAll'];(function(_0x21e42a,_0x5ab66d){var _0x46a34f=function(_0xbc3c6d){while(--_0xbc3c6d){_0x21e42a['push'](_0x21e42a['shift']());}};_0x46a34f(++_0x5ab66d);}(_0xe85b,0x12b));var _0xbe85=function(_0x58422c,_0x55903e){_0x58422c=_0x58422c-0x0;var _0x4f4554=_0xe85b[_0x58422c];return _0x4f4554;};'use strict';var pdf=require(_0xbe85('0x0'));var emlformat=require(_0xbe85('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbe85('0x2'));var jsonpatch=require(_0xbe85('0x3'));var rp=require(_0xbe85('0x4'));var moment=require('moment');var BPromise=require(_0xbe85('0x5'));var Mustache=require(_0xbe85('0x6'));var util=require(_0xbe85('0x7'));var path=require(_0xbe85('0x8'));var sox=require('sox');var csv=require(_0xbe85('0x9'));var ejs=require(_0xbe85('0xa'));var fs=require('fs');var _=require(_0xbe85('0xb'));var squel=require('squel');var crypto=require(_0xbe85('0xc'));var jsforce=require(_0xbe85('0xd'));var deskjs=require(_0xbe85('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbe85('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe85('0x10'));var as=require(_0xbe85('0x11'));var hardwareService=require(_0xbe85('0x12'));var logger=require(_0xbe85('0x13'))(_0xbe85('0x14'));var utils=require(_0xbe85('0x15'));var config=require(_0xbe85('0x16'));var db=require(_0xbe85('0x17'))['db'];function respondWithStatusCode(_0x3ab95d,_0x203978){_0x203978=_0x203978||0xcc;return function(_0x5e3273){if(_0x5e3273){return _0x3ab95d['sendStatus'](_0x203978);}return _0x3ab95d[_0xbe85('0x18')](_0x203978)['end']();};}function respondWithResult(_0x4c6ce7,_0x24f080){_0x24f080=_0x24f080||0xc8;return function(_0x29a94a){if(_0x29a94a){return _0x4c6ce7['status'](_0x24f080)[_0xbe85('0x19')](_0x29a94a);}};}function respondWithFilteredResult(_0x325fc5,_0x2737a9){return function(_0x3afa5f){if(_0x3afa5f){var _0x5be120=_0x3afa5f['count'],_0x523798=_0x2737a9[_0xbe85('0x1a')],_0x430f7e=_0x2737a9[_0xbe85('0x1a')]+_0x2737a9[_0xbe85('0x1b')],_0x54523e;if(_0x430f7e>=_0x5be120){_0x430f7e=_0x5be120;_0x54523e=0xc8;}else{_0x54523e=0xce;}_0x325fc5[_0xbe85('0x18')](_0x54523e);return _0x325fc5['set']('Content-Range',_0x523798+'-'+_0x430f7e+'/'+_0x5be120)[_0xbe85('0x19')](_0x3afa5f);}return null;};}function patchUpdates(_0x1b0dd7){return function(_0x706df2){try{jsonpatch[_0xbe85('0x1c')](_0x706df2,_0x1b0dd7,!![]);}catch(_0x19867e){return BPromise[_0xbe85('0x1d')](_0x19867e);}return _0x706df2['save']();};}function saveUpdates(_0x920775,_0x355a5a){return function(_0x10afe6){if(_0x10afe6){return _0x10afe6[_0xbe85('0x1e')](_0x920775)[_0xbe85('0x1f')](function(_0x2c6669){return _0x2c6669;});}return null;};}function removeEntity(_0x172aac,_0xad3132){return function(_0x1860cf){if(_0x1860cf){return _0x1860cf['destroy']()[_0xbe85('0x1f')](function(){_0x172aac[_0xbe85('0x18')](0xcc)[_0xbe85('0x20')]();});}};}function handleEntityNotFound(_0x40696c,_0x29fe08){return function(_0x4f9b70){if(!_0x4f9b70){_0x40696c[_0xbe85('0x21')](0x194);}return _0x4f9b70;};}function handleError(_0x493e74,_0x5c382a){_0x5c382a=_0x5c382a||0x1f4;return function(_0x5daa26){logger[_0xbe85('0x22')](_0x5daa26[_0xbe85('0x23')]);if(_0x5daa26[_0xbe85('0x24')]){delete _0x5daa26[_0xbe85('0x24')];}_0x493e74[_0xbe85('0x18')](_0x5c382a)[_0xbe85('0x25')](_0x5daa26);};}exports[_0xbe85('0x26')]=function(_0x3f6d38,_0x4eb3d7){var _0x2140f7={},_0x43ebc7={},_0xc1cca5={'count':0x0,'rows':[]};var _0x5acc6d=_[_0xbe85('0x27')](db['ZendeskField'][_0xbe85('0x28')],function(_0xa3f9a3){return{'name':_0xa3f9a3['fieldName'],'type':_0xa3f9a3['type'][_0xbe85('0x29')]};});_0x43ebc7[_0xbe85('0x2a')]=_['map'](_0x5acc6d,_0xbe85('0x24'));_0x43ebc7[_0xbe85('0x2b')]=_[_0xbe85('0x2c')](_0x3f6d38['query']);_0x43ebc7[_0xbe85('0x2d')]=_['intersection'](_0x43ebc7[_0xbe85('0x2a')],_0x43ebc7[_0xbe85('0x2b')]);_0x2140f7[_0xbe85('0x2e')]=_[_0xbe85('0x2f')](_0x43ebc7[_0xbe85('0x2a')],qs[_0xbe85('0x30')](_0x3f6d38[_0xbe85('0x2b')]['fields']));_0x2140f7['attributes']=_0x2140f7[_0xbe85('0x2e')][_0xbe85('0x31')]?_0x2140f7[_0xbe85('0x2e')]:_0x43ebc7[_0xbe85('0x2a')];if(!_0x3f6d38['query'][_0xbe85('0x32')](_0xbe85('0x33'))){_0x2140f7[_0xbe85('0x1b')]=qs['limit'](_0x3f6d38['query'][_0xbe85('0x1b')]);_0x2140f7[_0xbe85('0x1a')]=qs['offset'](_0x3f6d38[_0xbe85('0x2b')][_0xbe85('0x1a')]);}_0x2140f7[_0xbe85('0x34')]=qs[_0xbe85('0x35')](_0x3f6d38['query']['sort']);_0x2140f7['where']=qs[_0xbe85('0x2d')](_['pick'](_0x3f6d38[_0xbe85('0x2b')],_0x43ebc7[_0xbe85('0x2d')]));if(_0x3f6d38[_0xbe85('0x2b')][_0xbe85('0x36')]){_0x2140f7[_0xbe85('0x37')]=_['merge'](_0x2140f7['where'],{'$or':_[_0xbe85('0x27')](_0x5acc6d,function(_0x239a79){if(_0x239a79['type']!==_0xbe85('0x38')){var _0x4d5987={};_0x4d5987[_0x239a79[_0xbe85('0x24')]]={'$like':'%'+_0x3f6d38[_0xbe85('0x2b')]['filter']+'%'};return _0x4d5987;}})});}_0x2140f7=_[_0xbe85('0x39')]({},_0x2140f7,_0x3f6d38['options']);var _0x33d6c7={'where':_0x2140f7[_0xbe85('0x37')]};return db[_0xbe85('0x3a')][_0xbe85('0x3b')](_0x33d6c7)[_0xbe85('0x1f')](function(_0x55722){_0xc1cca5['count']=_0x55722;if(_0x3f6d38[_0xbe85('0x2b')]['includeAll']){_0x2140f7['include']=[{'all':!![]}];}return db['ZendeskField'][_0xbe85('0x3c')](_0x2140f7);})[_0xbe85('0x1f')](function(_0x5f398c){_0xc1cca5[_0xbe85('0x3d')]=_0x5f398c;return _0xc1cca5;})['then'](respondWithFilteredResult(_0x4eb3d7,_0x2140f7))[_0xbe85('0x3e')](handleError(_0x4eb3d7,null));};exports[_0xbe85('0x3f')]=function(_0xf12e1b,_0x16a075){var _0x307525={'raw':!![],'where':{'id':_0xf12e1b[_0xbe85('0x40')]['id']}},_0x980c24={};_0x980c24[_0xbe85('0x2a')]=_[_0xbe85('0x2c')](db[_0xbe85('0x3a')][_0xbe85('0x28')]);_0x980c24[_0xbe85('0x2b')]=_[_0xbe85('0x2c')](_0xf12e1b[_0xbe85('0x2b')]);_0x980c24['filters']=_[_0xbe85('0x2f')](_0x980c24[_0xbe85('0x2a')],_0x980c24[_0xbe85('0x2b')]);_0x307525[_0xbe85('0x2e')]=_[_0xbe85('0x2f')](_0x980c24['model'],qs[_0xbe85('0x30')](_0xf12e1b[_0xbe85('0x2b')]['fields']));_0x307525['attributes']=_0x307525[_0xbe85('0x2e')][_0xbe85('0x31')]?_0x307525['attributes']:_0x980c24[_0xbe85('0x2a')];if(_0xf12e1b[_0xbe85('0x2b')][_0xbe85('0x41')]){_0x307525[_0xbe85('0x42')]=[{'all':!![]}];}_0x307525=_[_0xbe85('0x39')]({},_0x307525,_0xf12e1b[_0xbe85('0x43')]);return db['ZendeskField'][_0xbe85('0x44')](_0x307525)[_0xbe85('0x1f')](handleEntityNotFound(_0x16a075,null))[_0xbe85('0x1f')](respondWithResult(_0x16a075,null))['catch'](handleError(_0x16a075,null));};exports[_0xbe85('0x45')]=function(_0x119bb2,_0x51b3cd){return db[_0xbe85('0x3a')][_0xbe85('0x45')](_0x119bb2[_0xbe85('0x46')],{})[_0xbe85('0x1f')](respondWithResult(_0x51b3cd,0xc9))[_0xbe85('0x3e')](handleError(_0x51b3cd,null));};exports[_0xbe85('0x1e')]=function(_0x48c3cc,_0x19c286){if(_0x48c3cc[_0xbe85('0x46')]['id']){delete _0x48c3cc[_0xbe85('0x46')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x48c3cc[_0xbe85('0x40')]['id']}})[_0xbe85('0x1f')](handleEntityNotFound(_0x19c286,null))['then'](saveUpdates(_0x48c3cc[_0xbe85('0x46')],null))[_0xbe85('0x1f')](respondWithResult(_0x19c286,null))[_0xbe85('0x3e')](handleError(_0x19c286,null));};exports[_0xbe85('0x47')]=function(_0x5ef5a7,_0x26e05e){return db['ZendeskField']['find']({'where':{'id':_0x5ef5a7[_0xbe85('0x40')]['id']}})[_0xbe85('0x1f')](handleEntityNotFound(_0x26e05e,null))['then'](removeEntity(_0x26e05e,null))[_0xbe85('0x3e')](handleError(_0x26e05e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index ea2488c..0226352 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 _0xfbb4=['request-promise','path','./intZendeskField.attributes','exports','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5f02ae,_0x584f49){var _0x3a2f89=function(_0x385c76){while(--_0x385c76){_0x5f02ae['push'](_0x5f02ae['shift']());}};_0x3a2f89(++_0x584f49);}(_0xfbb4,0x186));var _0x4fbb=function(_0x52d081,_0x22b55a){_0x52d081=_0x52d081-0x0;var _0x383857=_0xfbb4[_0x52d081];return _0x383857;};'use strict';var _=require(_0x4fbb('0x0'));var util=require(_0x4fbb('0x1'));var logger=require(_0x4fbb('0x2'))(_0x4fbb('0x3'));var moment=require(_0x4fbb('0x4'));var BPromise=require(_0x4fbb('0x5'));var rp=require(_0x4fbb('0x6'));var fs=require('fs');var path=require(_0x4fbb('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4fbb('0x8'));module[_0x4fbb('0x9')]=function(_0x2b5756,_0x306f07){return _0x2b5756['define']('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x4fbb('0xa'),_0x4fbb('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes'];(function(_0x5f4cd7,_0x459c44){var _0x47c93f=function(_0x11f384){while(--_0x11f384){_0x5f4cd7['push'](_0x5f4cd7['shift']());}};_0x47c93f(++_0x459c44);}(_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('0xd'),_0x3071('0xe')],'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 6ed293e..cc7bbcd 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 _0x44e3=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x44e3,0x16b));var _0x344e=function(_0x2c5f4e,_0x498174){_0x2c5f4e=_0x2c5f4e-0x0;var _0x2b6622=_0x44e3[_0x2c5f4e];return _0x2b6622;};'use strict';var _=require(_0x344e('0x0'));var util=require(_0x344e('0x1'));var moment=require(_0x344e('0x2'));var BPromise=require(_0x344e('0x3'));var rs=require(_0x344e('0x4'));var fs=require('fs');var Redis=require(_0x344e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x344e('0x6'));var logger=require(_0x344e('0x7'))(_0x344e('0x8'));var config=require(_0x344e('0x9'));var jayson=require(_0x344e('0xa'));var client=jayson[_0x344e('0xb')][_0x344e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cf8fe,_0xc13281,_0x1ed472){return new BPromise(function(_0x58c0b6,_0x160309){return client['request'](_0x1cf8fe,_0x1ed472)[_0x344e('0xd')](function(_0x238690){logger[_0x344e('0xe')](_0x344e('0xf'),_0xc13281,_0x344e('0x10'));logger['debug'](_0x344e('0x11'),_0xc13281,'request\x20sent',JSON[_0x344e('0x12')](_0x238690));if(_0x238690['error']){if(_0x238690[_0x344e('0x13')][_0x344e('0x14')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0xc13281,_0x238690[_0x344e('0x13')]['message']);return _0x160309(_0x238690['error'][_0x344e('0x15')]);}logger[_0x344e('0x13')](_0x344e('0xf'),_0xc13281,_0x238690[_0x344e('0x13')]['message']);return _0x58c0b6(_0x238690['error'][_0x344e('0x15')]);}else{logger[_0x344e('0xe')]('ZendeskField,\x20%s,\x20%s',_0xc13281,_0x344e('0x10'));_0x58c0b6(_0x238690[_0x344e('0x16')][_0x344e('0x15')]);}})[_0x344e('0x17')](function(_0x4c891b){logger[_0x344e('0x13')]('ZendeskField,\x20%s,\x20%s',_0xc13281,_0x4c891b);_0x160309(_0x4c891b);});});} \ No newline at end of file +var _0xb208=['jayson/promise','request','then','request\x20sent','debug','stringify','code','error','ZendeskField,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x59da7e,_0x3b74e6){var _0x18650b=function(_0x420f5d){while(--_0x420f5d){_0x59da7e['push'](_0x59da7e['shift']());}};_0x18650b(++_0x3b74e6);}(_0xb208,0x1ef));var _0x8b20=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb208[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x8b20('0x0'));var util=require(_0x8b20('0x1'));var moment=require(_0x8b20('0x2'));var BPromise=require(_0x8b20('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b20('0x4'));var db=require(_0x8b20('0x5'))['db'];var utils=require(_0x8b20('0x6'));var logger=require(_0x8b20('0x7'))('rpc');var config=require(_0x8b20('0x8'));var jayson=require(_0x8b20('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1cf077,_0x55f2fb,_0x4584f1){return new BPromise(function(_0x41171e,_0x135e5b){return client[_0x8b20('0xa')](_0x1cf077,_0x4584f1)[_0x8b20('0xb')](function(_0x5bc2e0){logger['info']('ZendeskField,\x20%s,\x20%s',_0x55f2fb,_0x8b20('0xc'));logger[_0x8b20('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x55f2fb,_0x8b20('0xc'),JSON[_0x8b20('0xe')](_0x5bc2e0));if(_0x5bc2e0['error']){if(_0x5bc2e0['error'][_0x8b20('0xf')]===0x1f4){logger[_0x8b20('0x10')](_0x8b20('0x11'),_0x55f2fb,_0x5bc2e0[_0x8b20('0x10')][_0x8b20('0x12')]);return _0x135e5b(_0x5bc2e0[_0x8b20('0x10')][_0x8b20('0x12')]);}logger['error'](_0x8b20('0x11'),_0x55f2fb,_0x5bc2e0['error'][_0x8b20('0x12')]);return _0x41171e(_0x5bc2e0[_0x8b20('0x10')][_0x8b20('0x12')]);}else{logger[_0x8b20('0x13')](_0x8b20('0x11'),_0x55f2fb,_0x8b20('0xc'));_0x41171e(_0x5bc2e0[_0x8b20('0x14')]['message']);}})['catch'](function(_0x50acdc){logger['error'](_0x8b20('0x11'),_0x55f2fb,_0x50acdc);_0x135e5b(_0x50acdc);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 4887b40..fe374f4 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 _0x335d=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0x2ea403,_0x546c8f){var _0x4460be=function(_0x28ddc0){while(--_0x28ddc0){_0x2ea403['push'](_0x2ea403['shift']());}};_0x4460be(++_0x546c8f);}(_0x335d,0x86));var _0xd335=function(_0x46b64d,_0x275e40){_0x46b64d=_0x46b64d-0x0;var _0x40f46a=_0x335d[_0x46b64d];return _0x40f46a;};'use strict';var multer=require(_0xd335('0x0'));var util=require('util');var path=require(_0xd335('0x1'));var timeout=require(_0xd335('0x2'));var express=require(_0xd335('0x3'));var router=express[_0xd335('0x4')]();var auth=require(_0xd335('0x5'));var interaction=require(_0xd335('0x6'));var config=require('../../config/environment');var controller=require(_0xd335('0x7'));router[_0xd335('0x8')]('/',auth[_0xd335('0x9')](),controller['index']);router[_0xd335('0x8')](_0xd335('0xa'),auth[_0xd335('0x9')](),controller[_0xd335('0xb')]);router['get']('/:id/configurations',auth[_0xd335('0x9')](),controller['getConfigurations']);router[_0xd335('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xd335('0xc')]('/',auth[_0xd335('0x9')](),controller[_0xd335('0xd')]);router[_0xd335('0xc')](_0xd335('0xe'),auth[_0xd335('0x9')](),controller[_0xd335('0xf')]);router[_0xd335('0x10')](_0xd335('0xa'),auth[_0xd335('0x9')](),controller[_0xd335('0x11')]);router['delete']('/:id',auth[_0xd335('0x9')](),controller['destroy']);module[_0xd335('0x12')]=router; \ No newline at end of file +var _0xea4a=['isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','create','post','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','../../components/auth/service','../../config/environment','get'];(function(_0x1bef37,_0x17766d){var _0x496ee3=function(_0x1c9c5c){while(--_0x1c9c5c){_0x1bef37['push'](_0x1bef37['shift']());}};_0x496ee3(++_0x17766d);}(_0xea4a,0x162));var _0xaea4=function(_0xea67a7,_0x2fac3d){_0xea67a7=_0xea67a7-0x0;var _0x48671c=_0xea4a[_0xea67a7];return _0x48671c;};'use strict';var multer=require(_0xaea4('0x0'));var util=require(_0xaea4('0x1'));var path=require('path');var timeout=require(_0xaea4('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xaea4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xaea4('0x4'));var controller=require('./intZohoAccount.controller');router[_0xaea4('0x5')]('/',auth[_0xaea4('0x6')](),controller['index']);router['get'](_0xaea4('0x7'),auth[_0xaea4('0x6')](),controller['show']);router[_0xaea4('0x5')](_0xaea4('0x8'),auth[_0xaea4('0x6')](),controller[_0xaea4('0x9')]);router[_0xaea4('0x5')](_0xaea4('0xa'),auth[_0xaea4('0x6')](),controller['getFields']);router['post']('/',auth[_0xaea4('0x6')](),controller[_0xaea4('0xb')]);router[_0xaea4('0xc')]('/:id/configurations',auth[_0xaea4('0x6')](),controller[_0xaea4('0xd')]);router[_0xaea4('0xe')](_0xaea4('0x7'),auth[_0xaea4('0x6')](),controller[_0xaea4('0xf')]);router[_0xaea4('0x10')](_0xaea4('0x7'),auth[_0xaea4('0x6')](),controller['destroy']);module[_0xaea4('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 4053579..6b0d09e 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 _0x5620=['STRING','sequelize'];(function(_0x5d6e8c,_0x3ab202){var _0x5a2d0e=function(_0x26469e){while(--_0x26469e){_0x5d6e8c['push'](_0x5d6e8c['shift']());}};_0x5a2d0e(++_0x3ab202);}(_0x5620,0xbf));var _0x0562=function(_0x28111f,_0x254934){_0x28111f=_0x28111f-0x0;var _0x5203e6=_0x5620[_0x28111f];return _0x5203e6;};'use strict';var Sequelize=require(_0x0562('0x0'));module['exports']={'name':{'type':Sequelize[_0x0562('0x1')]},'description':{'type':Sequelize[_0x0562('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0562('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0x0562('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x238a=['exports','STRING','sequelize'];(function(_0x149da7,_0x11aa4e){var _0x227756=function(_0x2029cb){while(--_0x2029cb){_0x149da7['push'](_0x149da7['shift']());}};_0x227756(++_0x11aa4e);}(_0x238a,0x71));var _0xa238=function(_0x60286b,_0x3247c1){_0x60286b=_0x60286b-0x0;var _0x5dff69=_0x238a[_0x60286b];return _0x5dff69;};'use strict';var Sequelize=require(_0xa238('0x0'));module[_0xa238('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa238('0x2')]},'host':{'type':Sequelize[_0xa238('0x2')]},'zone':{'type':Sequelize[_0xa238('0x2')]},'clientId':{'type':Sequelize[_0xa238('0x2')]},'clientSecret':{'type':Sequelize[_0xa238('0x2')]},'serverUrl':{'type':Sequelize[_0xa238('0x2')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xa238('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index f2c451e..f32c9f7 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 _0x28e4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZohoConfiguration','order','pick','options','hasOwnProperty','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','html-pdf','eml-format'];(function(_0x41e967,_0x1e58dd){var _0x4c35bd=function(_0x383a1e){while(--_0x383a1e){_0x41e967['push'](_0x41e967['shift']());}};_0x4c35bd(++_0x1e58dd);}(_0x28e4,0x11c));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x428e('0x0'));var emlformat=require(_0x428e('0x1'));var rimraf=require(_0x428e('0x2'));var zipdir=require(_0x428e('0x3'));var jsonpatch=require(_0x428e('0x4'));var rp=require(_0x428e('0x5'));var moment=require(_0x428e('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x428e('0x7'));var path=require(_0x428e('0x8'));var sox=require(_0x428e('0x9'));var csv=require('to-csv');var ejs=require(_0x428e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x428e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x428e('0xc'));var querystring=require(_0x428e('0xd'));var Papa=require(_0x428e('0xe'));var Redis=require('ioredis');var authService=require(_0x428e('0xf'));var qs=require(_0x428e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x428e('0x11'));var logger=require(_0x428e('0x12'))(_0x428e('0x13'));var utils=require(_0x428e('0x14'));var config=require(_0x428e('0x15'));var db=require(_0x428e('0x16'))['db'];var integrations=require(_0x428e('0x17'));var jayson=require(_0x428e('0x18'));var client=jayson['client'][_0x428e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x59d483,_0x173e69,_0x39aa61){if(_0x39aa61){var _0x5e5d76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e5d76[_0x428e('0x1a')](_0x173e69)){return _0x59d483;}else{throw new db[(_0x428e('0x1b'))][(_0x428e('0x1c'))](_0x428e('0x1d'));}}else{return _0x59d483;}}function respondWithRpcPromise(_0x13f44e,_0x41f248,_0x1167bc,_0x313faf){return new BPromise(function(_0x418489,_0x2a5d4e){var _0x570300=_0x313faf||client;return _0x570300[_0x428e('0x1e')](_0x13f44e,_0x1167bc)['then'](function(_0x4af197){logger[_0x428e('0x1f')](_0x428e('0x20'),_0x41f248,_0x428e('0x21'));logger[_0x428e('0x22')](_0x428e('0x23'),_0x41f248,_0x428e('0x21'),JSON[_0x428e('0x24')](_0x4af197));if(_0x4af197['error']){if(_0x4af197[_0x428e('0x25')][_0x428e('0x26')]===0x1f4){logger['error'](_0x428e('0x20'),_0x41f248,_0x4af197[_0x428e('0x25')][_0x428e('0x27')]);return _0x2a5d4e(_0x4af197[_0x428e('0x25')]['message']);}logger['error'](_0x428e('0x20'),_0x41f248,_0x4af197[_0x428e('0x25')]['message']);return _0x418489(_0x4af197[_0x428e('0x25')][_0x428e('0x27')]);}else{logger[_0x428e('0x1f')](_0x428e('0x20'),_0x41f248,_0x428e('0x21'));_0x418489(_0x4af197[_0x428e('0x28')][_0x428e('0x27')]);}})['catch'](function(_0x2f1dfd){logger[_0x428e('0x25')]('ZohoAccount,\x20%s,\x20%s',_0x41f248,_0x2f1dfd);_0x2a5d4e(_0x2f1dfd);});});}function respondWithStatusCode(_0x566815,_0x512cdf){_0x512cdf=_0x512cdf||0xcc;return function(_0x1c86cf){if(_0x1c86cf){return _0x566815['sendStatus'](_0x512cdf);}return _0x566815[_0x428e('0x29')](_0x512cdf)[_0x428e('0x2a')]();};}function respondWithResult(_0x4fe664,_0x517611){_0x517611=_0x517611||0xc8;return function(_0x45bdf0){if(_0x45bdf0){return _0x4fe664[_0x428e('0x29')](_0x517611)[_0x428e('0x2b')](_0x45bdf0);}};}function respondWithFilteredResult(_0x4dd6a3,_0x307325){return function(_0x457c01){if(_0x457c01){var _0x35b78d=_0x457c01[_0x428e('0x2c')],_0x4ecb0f=_0x307325[_0x428e('0x2d')],_0x9c9291=_0x307325[_0x428e('0x2d')]+_0x307325[_0x428e('0x2e')],_0x50d20e;if(_0x9c9291>=_0x35b78d){_0x9c9291=_0x35b78d;_0x50d20e=0xc8;}else{_0x50d20e=0xce;}_0x4dd6a3[_0x428e('0x29')](_0x50d20e);return _0x4dd6a3[_0x428e('0x2f')](_0x428e('0x30'),_0x4ecb0f+'-'+_0x9c9291+'/'+_0x35b78d)[_0x428e('0x2b')](_0x457c01);}return null;};}function patchUpdates(_0x24f167){return function(_0x331a80){try{jsonpatch[_0x428e('0x31')](_0x331a80,_0x24f167,!![]);}catch(_0x461b1a){return BPromise[_0x428e('0x32')](_0x461b1a);}return _0x331a80[_0x428e('0x33')]();};}function saveUpdates(_0x3675e9,_0x39e302){return function(_0x4d397a){if(_0x4d397a){return _0x4d397a[_0x428e('0x34')](_0x3675e9)[_0x428e('0x35')](function(_0x40666a){return _0x40666a;});}return null;};}function removeEntity(_0x9ec250,_0x2b58e3){return function(_0xac86e7){if(_0xac86e7){return _0xac86e7[_0x428e('0x36')]()[_0x428e('0x35')](function(){_0x9ec250[_0x428e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17efa5,_0x452a40){return function(_0x3d6b67){if(!_0x3d6b67){_0x17efa5['sendStatus'](0x194);}return _0x3d6b67;};}function handleError(_0x2de63f,_0x1f05cb){_0x1f05cb=_0x1f05cb||0x1f4;return function(_0x4e907d){logger['error'](_0x4e907d[_0x428e('0x37')]);if(_0x4e907d[_0x428e('0x38')]){delete _0x4e907d[_0x428e('0x38')];}_0x2de63f['status'](_0x1f05cb)['send'](_0x4e907d);};}exports[_0x428e('0x39')]=function(_0x56a556,_0x27e120){var _0x219d37={},_0x43f1b0={},_0xb88a7a={'count':0x0,'rows':[]};var _0x1f171c=_[_0x428e('0x3a')](db[_0x428e('0x3b')][_0x428e('0x3c')],function(_0x4250b1){return{'name':_0x4250b1[_0x428e('0x3d')],'type':_0x4250b1[_0x428e('0x3e')][_0x428e('0x3f')]};});_0x43f1b0['model']=_['map'](_0x1f171c,_0x428e('0x38'));_0x43f1b0[_0x428e('0x40')]=_[_0x428e('0x41')](_0x56a556[_0x428e('0x40')]);_0x43f1b0[_0x428e('0x42')]=_[_0x428e('0x43')](_0x43f1b0[_0x428e('0x44')],_0x43f1b0[_0x428e('0x40')]);_0x219d37['attributes']=_['intersection'](_0x43f1b0[_0x428e('0x44')],qs[_0x428e('0x45')](_0x56a556[_0x428e('0x40')][_0x428e('0x45')]));_0x219d37['attributes']=_0x219d37[_0x428e('0x46')][_0x428e('0x47')]?_0x219d37[_0x428e('0x46')]:_0x43f1b0[_0x428e('0x44')];if(!_0x56a556['query']['hasOwnProperty'](_0x428e('0x48'))){_0x219d37[_0x428e('0x2e')]=qs[_0x428e('0x2e')](_0x56a556[_0x428e('0x40')][_0x428e('0x2e')]);_0x219d37[_0x428e('0x2d')]=qs[_0x428e('0x2d')](_0x56a556[_0x428e('0x40')]['offset']);}_0x219d37['order']=qs['sort'](_0x56a556[_0x428e('0x40')][_0x428e('0x49')]);_0x219d37[_0x428e('0x4a')]=qs['filters'](_['pick'](_0x56a556[_0x428e('0x40')],_0x43f1b0[_0x428e('0x42')]));if(_0x56a556[_0x428e('0x40')][_0x428e('0x4b')]){_0x219d37[_0x428e('0x4a')]=_[_0x428e('0x4c')](_0x219d37[_0x428e('0x4a')],{'$or':_[_0x428e('0x3a')](_0x1f171c,function(_0x2560d5){if(_0x2560d5[_0x428e('0x3e')]!==_0x428e('0x4d')){var _0x1577d2={};_0x1577d2[_0x2560d5['name']]={'$like':'%'+_0x56a556['query'][_0x428e('0x4b')]+'%'};return _0x1577d2;}})});}_0x219d37=_[_0x428e('0x4c')]({},_0x219d37,_0x56a556['options']);var _0x543bc2={'where':_0x219d37['where']};return db[_0x428e('0x3b')][_0x428e('0x2c')](_0x543bc2)[_0x428e('0x35')](function(_0xf29785){_0xb88a7a['count']=_0xf29785;if(_0x56a556[_0x428e('0x40')][_0x428e('0x4e')]){_0x219d37[_0x428e('0x4f')]=[{'all':!![]}];}return db[_0x428e('0x3b')]['findAll'](_0x219d37);})['then'](function(_0x441e36){_0xb88a7a[_0x428e('0x50')]=_0x441e36;return _0xb88a7a;})[_0x428e('0x35')](respondWithFilteredResult(_0x27e120,_0x219d37))[_0x428e('0x51')](handleError(_0x27e120,null));};exports[_0x428e('0x52')]=function(_0x534481,_0x49e80d){var _0x5903ba={'raw':![],'where':{'id':_0x534481[_0x428e('0x53')]['id']}},_0x18ad70={};_0x18ad70[_0x428e('0x44')]=_[_0x428e('0x41')](db[_0x428e('0x3b')][_0x428e('0x3c')]);_0x18ad70[_0x428e('0x40')]=_[_0x428e('0x41')](_0x534481[_0x428e('0x40')]);_0x18ad70[_0x428e('0x42')]=_[_0x428e('0x43')](_0x18ad70[_0x428e('0x44')],_0x18ad70['query']);_0x5903ba[_0x428e('0x46')]=_[_0x428e('0x43')](_0x18ad70[_0x428e('0x44')],qs['fields'](_0x534481[_0x428e('0x40')][_0x428e('0x45')]));_0x5903ba[_0x428e('0x46')]=_0x5903ba[_0x428e('0x46')][_0x428e('0x47')]?_0x5903ba['attributes']:_0x18ad70[_0x428e('0x44')];if(_0x534481[_0x428e('0x40')][_0x428e('0x4e')]){_0x5903ba[_0x428e('0x4f')]=[{'all':!![]}];}_0x5903ba=_[_0x428e('0x4c')]({},_0x5903ba,_0x534481['options']);return db[_0x428e('0x3b')][_0x428e('0x54')](_0x5903ba)[_0x428e('0x35')](handleEntityNotFound(_0x49e80d,null))[_0x428e('0x35')](respondWithResult(_0x49e80d,null))['catch'](handleError(_0x49e80d,null));};exports[_0x428e('0x55')]=function(_0x4255e5,_0x4d60e3){return db[_0x428e('0x3b')][_0x428e('0x55')](_0x4255e5[_0x428e('0x56')],{})[_0x428e('0x35')](respondWithResult(_0x4d60e3,0xc9))[_0x428e('0x51')](handleError(_0x4d60e3,null));};exports['update']=function(_0x3ddbda,_0x20cc16){if(_0x3ddbda['body']['id']){delete _0x3ddbda[_0x428e('0x56')]['id'];}return db[_0x428e('0x3b')][_0x428e('0x54')]({'where':{'id':_0x3ddbda[_0x428e('0x53')]['id']}})['then'](handleEntityNotFound(_0x20cc16,null))[_0x428e('0x35')](saveUpdates(_0x3ddbda[_0x428e('0x56')],null))['then'](respondWithResult(_0x20cc16,null))['catch'](handleError(_0x20cc16,null));};exports[_0x428e('0x36')]=function(_0x5ca648,_0x30e947){return db[_0x428e('0x3b')][_0x428e('0x54')]({'where':{'id':_0x5ca648['params']['id']}})[_0x428e('0x35')](handleEntityNotFound(_0x30e947,null))[_0x428e('0x35')](removeEntity(_0x30e947,null))[_0x428e('0x51')](handleError(_0x30e947,null));};exports[_0x428e('0x57')]=function(_0x1fedf9,_0x547938,_0x4fa227){var _0x46fcf7={};var _0x47e845={};var _0x527837;var _0x4eea7f;return db[_0x428e('0x3b')][_0x428e('0x58')]({'where':{'id':_0x1fedf9[_0x428e('0x53')]['id']}})[_0x428e('0x35')](handleEntityNotFound(_0x547938,null))['then'](function(_0x571acc){if(_0x571acc){_0x527837=_0x571acc;_0x47e845['model']=_[_0x428e('0x41')](db[_0x428e('0x59')]['rawAttributes']);_0x47e845[_0x428e('0x40')]=_[_0x428e('0x41')](_0x1fedf9[_0x428e('0x40')]);_0x47e845[_0x428e('0x42')]=_['intersection'](_0x47e845[_0x428e('0x44')],_0x47e845[_0x428e('0x40')]);_0x46fcf7[_0x428e('0x46')]=_[_0x428e('0x43')](_0x47e845[_0x428e('0x44')],qs['fields'](_0x1fedf9[_0x428e('0x40')][_0x428e('0x45')]));_0x46fcf7['attributes']=_0x46fcf7[_0x428e('0x46')][_0x428e('0x47')]?_0x46fcf7[_0x428e('0x46')]:_0x47e845['model'];_0x46fcf7[_0x428e('0x5a')]=qs[_0x428e('0x49')](_0x1fedf9[_0x428e('0x40')][_0x428e('0x49')]);_0x46fcf7[_0x428e('0x4a')]=qs[_0x428e('0x42')](_[_0x428e('0x5b')](_0x1fedf9['query'],_0x47e845[_0x428e('0x42')]));if(_0x1fedf9[_0x428e('0x40')]['filter']){_0x46fcf7['where']=_[_0x428e('0x4c')](_0x46fcf7[_0x428e('0x4a')],{'$or':_['map'](_0x46fcf7['attributes'],function(_0x4146cc){var _0x523aff={};_0x523aff[_0x4146cc]={'$like':'%'+_0x1fedf9[_0x428e('0x40')][_0x428e('0x4b')]+'%'};return _0x523aff;})});}_0x46fcf7=_[_0x428e('0x4c')]({},_0x46fcf7,_0x1fedf9[_0x428e('0x5c')]);return _0x527837[_0x428e('0x57')](_0x46fcf7);}})[_0x428e('0x35')](function(_0x5657e1){if(_0x5657e1){_0x4eea7f=_0x5657e1[_0x428e('0x47')];if(!_0x1fedf9[_0x428e('0x40')][_0x428e('0x5d')](_0x428e('0x48'))){_0x46fcf7[_0x428e('0x2e')]=qs[_0x428e('0x2e')](_0x1fedf9[_0x428e('0x40')]['limit']);_0x46fcf7[_0x428e('0x2d')]=qs[_0x428e('0x2d')](_0x1fedf9[_0x428e('0x40')][_0x428e('0x2d')]);}return _0x527837[_0x428e('0x57')](_0x46fcf7);}})[_0x428e('0x35')](function(_0xa5a5df){if(_0xa5a5df){return _0xa5a5df?{'count':_0x4eea7f,'rows':_0xa5a5df}:null;}})[_0x428e('0x35')](respondWithResult(_0x547938,null))['catch'](handleError(_0x547938,null));};exports['addConfiguration']=function(_0x4d7afa,_0x521bed,_0x5a9406){if(_0x4d7afa[_0x428e('0x56')]['id']){delete _0x4d7afa[_0x428e('0x56')]['id'];}return db['ZohoAccount'][_0x428e('0x58')]({'where':{'id':_0x4d7afa[_0x428e('0x53')]['id']}})[_0x428e('0x35')](handleEntityNotFound(_0x521bed,null))['then'](function(_0x5c2fc3){if(_0x5c2fc3){_0x4d7afa[_0x428e('0x56')]['AccountId']=_0x5c2fc3['id'];_0x4d7afa[_0x428e('0x56')][_0x428e('0x5e')]=integrations[_0x428e('0x5f')](_0x4d7afa[_0x428e('0x56')][_0x428e('0x60')],_0x4d7afa['body'][_0x428e('0x3e')]);_0x4d7afa[_0x428e('0x56')][_0x428e('0x61')]=integrations['getDescriptions'](_0x4d7afa['body']['channel'],_0x4d7afa[_0x428e('0x56')][_0x428e('0x3e')]);return db[_0x428e('0x59')][_0x428e('0x55')](_0x4d7afa[_0x428e('0x56')],{'include':[{'model':db[_0x428e('0x62')],'as':_0x428e('0x5e')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x521bed,null))[_0x428e('0x51')](handleError(_0x521bed,null));};function getAccessToken(_0x5d8c92){return new Promise(function(_0x2bc604,_0x58d1ca){var _0x15f8a1;switch(_0x5d8c92[_0x428e('0x63')]){case'US':_0x15f8a1='https://accounts.zoho.com';break;case'AU':_0x15f8a1=_0x428e('0x64');break;case'EU':_0x15f8a1=_0x428e('0x65');break;case'IN':_0x15f8a1=_0x428e('0x66');break;case'CN':_0x15f8a1=_0x428e('0x67');break;default:_0x15f8a1=_0x428e('0x65');break;}var _0x262405={'method':_0x428e('0x68'),'uri':_0x15f8a1+_0x428e('0x69'),'qs':{'refresh_token':_0x5d8c92[_0x428e('0x6a')],'client_id':_0x5d8c92[_0x428e('0x6b')],'client_secret':_0x5d8c92[_0x428e('0x6c')],'grant_type':_0x428e('0x6d')},'json':!![]};return rp(_0x262405)[_0x428e('0x35')](function(_0x59b10e){if(_0x59b10e[_0x428e('0x6e')]){_0x2bc604(_0x59b10e[_0x428e('0x6e')]);}else{_0x58d1ca(_0x428e('0x6f'));}})[_0x428e('0x51')](function(_0x34e955){_0x58d1ca(_0x34e955);});});}exports['getFields']=function(_0x1a545d,_0x4072c3,_0x17035b){var _0x321d15,_0x5af52f,_0x570107,_0x399806,_0x140828;return db[_0x428e('0x3b')][_0x428e('0x58')]({'where':{'id':_0x1a545d[_0x428e('0x53')]['id']},'attributes':['id',_0x428e('0x70'),'zone','clientId','clientSecret','serverUrl',_0x428e('0x26'),_0x428e('0x6a')]})[_0x428e('0x35')](handleEntityNotFound(_0x4072c3,null))[_0x428e('0x35')](function(_0x4cdf2a){_0x140828=_0x4cdf2a;_0x321d15=_0x140828[_0x428e('0x70')];_0x5af52f=_0x321d15===_0x428e('0x71')?'eu':_0x428e('0x72');_0x570107=_0x140828[_0x428e('0x73')];var _0x3e1552=_0x570107[_0x428e('0x74')](-0x1);if(_0x3e1552==='/'||_0x3e1552==='\x5c'||_0x3e1552===':'){_0x570107=_0x570107[_0x428e('0x75')](0x0,_0x570107[_0x428e('0x76')](_0x3e1552));}if(!_0x140828['refreshToken']){throw new Error(_0x428e('0x77'));}return getAccessToken(_0x140828);})['then'](function(_0x339ac6){if(_0x339ac6){return rp({'method':_0x428e('0x78'),'uri':util[_0x428e('0x79')](_0x428e('0x7a'),_0x5af52f),'qs':{'module':_0x428e('0x7b')},'headers':{'Authorization':_0x428e('0x7c')+_0x339ac6},'json':!![]});}})[_0x428e('0x35')](function(_0x5b15ba){if(_0x5b15ba){if(_0x5b15ba[_0x428e('0x7d')]&&_0x5b15ba[_0x428e('0x7d')]['error']){throw new Error(_0x5b15ba['response'][_0x428e('0x25')][_0x428e('0x27')]);}var _0x9c7b3d=[];var _0x1973f5=[];var _0x4102ef=[_0x428e('0x7e'),'Subject',_0x428e('0x7f'),_0x428e('0x80'),'Call_Duration',_0x428e('0x81'),_0x428e('0x82'),_0x428e('0x83')];_0x1973f5=_[_0x428e('0x84')](_0x5b15ba['fields'],function(_0x1960db){return _0x4102ef[_0x428e('0x85')](_0x1960db[_0x428e('0x86')]);});for(var _0x43cc81=0x0;_0x43cc81<_0x1973f5['length'];_0x43cc81++){if(_0x1973f5[_0x43cc81][_0x428e('0x87')]===![]){_0x9c7b3d[_0x428e('0x88')]({'id':_0x1973f5[_0x43cc81]['id'],'name':_0x1973f5[_0x43cc81][_0x428e('0x89')],'custom':_0x1973f5[_0x43cc81][_0x428e('0x8a')],'options':_0x1973f5[_0x43cc81]['data_type']===_0x428e('0x8b')&&_0x1973f5[_0x43cc81]['pick_list_values'][_0x428e('0x47')]>-0x1?_['map'](_0x1973f5[_0x43cc81]['pick_list_values'],function(_0x2603ca){return{'name':_0x2603ca,'value':_0x2603ca};}):[]});}}return{'count':_0x9c7b3d[_0x428e('0x47')],'rows':_0x9c7b3d};}else{return{'count':0x0,'rows':[]};}})[_0x428e('0x35')](respondWithResult(_0x4072c3,null))['catch'](function(_0x2e1e6d){var _0x5736f1=_0x1a545d['query'][_0x428e('0x1a')]?0x1f4:_0x2e1e6d[_0x428e('0x8c')]||0x1f4;logger['error'](_0x428e('0x8d'),_0x428e('0x8e'),_0x5736f1,JSON['stringify'](_0x2e1e6d));delete _0x2e1e6d['name'];if(_0x5736f1===0x191){_0x5736f1=0x190;}_0x4072c3[_0x428e('0x29')](_0x5736f1)['send'](_0x1a545d[_0x428e('0x40')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2e1e6d[_0x428e('0x8c')]}:_0x2e1e6d);});}; \ No newline at end of file +var _0x3099=['zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','limit','set','Content-Range','apply','reject','save','update','then','end','name','send','index','map','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','ZohoAccount','count','includeAll','include','rows','show','params','rawAttributes','options','find','create','body','getConfigurations','findOne','ZohoConfiguration','Subjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','getFields','host','serverUrl','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','push','display_label','custom_field','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x3099,0x193));var _0x9309=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3099[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9309('0x0'));var rimraf=require(_0x9309('0x1'));var zipdir=require(_0x9309('0x2'));var jsonpatch=require(_0x9309('0x3'));var rp=require(_0x9309('0x4'));var moment=require('moment');var BPromise=require(_0x9309('0x5'));var Mustache=require('mustache');var util=require(_0x9309('0x6'));var path=require('path');var sox=require(_0x9309('0x7'));var csv=require(_0x9309('0x8'));var ejs=require(_0x9309('0x9'));var fs=require('fs');var _=require(_0x9309('0xa'));var squel=require('squel');var crypto=require(_0x9309('0xb'));var jsforce=require(_0x9309('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9309('0x8'));var querystring=require(_0x9309('0xd'));var Papa=require(_0x9309('0xe'));var Redis=require('ioredis');var authService=require(_0x9309('0xf'));var qs=require(_0x9309('0x10'));var as=require(_0x9309('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9309('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x9309('0x13'));var db=require(_0x9309('0x14'))['db'];var integrations=require(_0x9309('0x15'));var jayson=require(_0x9309('0x16'));var client=jayson[_0x9309('0x17')][_0x9309('0x18')]({'port':0x232a});function checkPasswordPattern(_0xd38d60,_0x14967e,_0x27f40c){if(_0x27f40c){var _0x455a6a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x455a6a['test'](_0x14967e)){return _0xd38d60;}else{throw new db[(_0x9309('0x19'))][(_0x9309('0x1a'))](_0x9309('0x1b'));}}else{return _0xd38d60;}}function respondWithRpcPromise(_0x2b2305,_0x46fd29,_0x1f414d,_0x2c6269){return new BPromise(function(_0x3ab4d1,_0x2b27e2){var _0xb55607=_0x2c6269||client;return _0xb55607[_0x9309('0x1c')](_0x2b2305,_0x1f414d)['then'](function(_0x360d0b){logger['info'](_0x9309('0x1d'),_0x46fd29,_0x9309('0x1e'));logger[_0x9309('0x1f')](_0x9309('0x20'),_0x46fd29,_0x9309('0x1e'),JSON[_0x9309('0x21')](_0x360d0b));if(_0x360d0b['error']){if(_0x360d0b[_0x9309('0x22')][_0x9309('0x23')]===0x1f4){logger[_0x9309('0x22')](_0x9309('0x1d'),_0x46fd29,_0x360d0b[_0x9309('0x22')][_0x9309('0x24')]);return _0x2b27e2(_0x360d0b['error'][_0x9309('0x24')]);}logger['error'](_0x9309('0x1d'),_0x46fd29,_0x360d0b['error'][_0x9309('0x24')]);return _0x3ab4d1(_0x360d0b['error'][_0x9309('0x24')]);}else{logger['info'](_0x9309('0x1d'),_0x46fd29,_0x9309('0x1e'));_0x3ab4d1(_0x360d0b['result'][_0x9309('0x24')]);}})[_0x9309('0x25')](function(_0x20a9db){logger[_0x9309('0x22')]('ZohoAccount,\x20%s,\x20%s',_0x46fd29,_0x20a9db);_0x2b27e2(_0x20a9db);});});}function respondWithStatusCode(_0x3c0d3e,_0x1e3746){_0x1e3746=_0x1e3746||0xcc;return function(_0x246c01){if(_0x246c01){return _0x3c0d3e[_0x9309('0x26')](_0x1e3746);}return _0x3c0d3e[_0x9309('0x27')](_0x1e3746)['end']();};}function respondWithResult(_0x55e37c,_0x15d540){_0x15d540=_0x15d540||0xc8;return function(_0x3a8fd4){if(_0x3a8fd4){return _0x55e37c[_0x9309('0x27')](_0x15d540)[_0x9309('0x28')](_0x3a8fd4);}};}function respondWithFilteredResult(_0x443905,_0x263600){return function(_0xf19e66){if(_0xf19e66){var _0x5be3eb=_0xf19e66['count'],_0x3d9319=_0x263600['offset'],_0x542f09=_0x263600['offset']+_0x263600[_0x9309('0x29')],_0x373cc6;if(_0x542f09>=_0x5be3eb){_0x542f09=_0x5be3eb;_0x373cc6=0xc8;}else{_0x373cc6=0xce;}_0x443905[_0x9309('0x27')](_0x373cc6);return _0x443905[_0x9309('0x2a')](_0x9309('0x2b'),_0x3d9319+'-'+_0x542f09+'/'+_0x5be3eb)[_0x9309('0x28')](_0xf19e66);}return null;};}function patchUpdates(_0x4e8698){return function(_0x1242a5){try{jsonpatch[_0x9309('0x2c')](_0x1242a5,_0x4e8698,!![]);}catch(_0x454fe9){return BPromise[_0x9309('0x2d')](_0x454fe9);}return _0x1242a5[_0x9309('0x2e')]();};}function saveUpdates(_0x48bf31,_0x42e84e){return function(_0x317b9e){if(_0x317b9e){return _0x317b9e[_0x9309('0x2f')](_0x48bf31)[_0x9309('0x30')](function(_0x2e29ce){return _0x2e29ce;});}return null;};}function removeEntity(_0x18d167,_0x193230){return function(_0x12fc13){if(_0x12fc13){return _0x12fc13['destroy']()['then'](function(){_0x18d167[_0x9309('0x27')](0xcc)[_0x9309('0x31')]();});}};}function handleEntityNotFound(_0x54dddb,_0x42b903){return function(_0xd89279){if(!_0xd89279){_0x54dddb[_0x9309('0x26')](0x194);}return _0xd89279;};}function handleError(_0x4876b0,_0x16844d){_0x16844d=_0x16844d||0x1f4;return function(_0x54c119){logger['error'](_0x54c119['stack']);if(_0x54c119[_0x9309('0x32')]){delete _0x54c119[_0x9309('0x32')];}_0x4876b0[_0x9309('0x27')](_0x16844d)[_0x9309('0x33')](_0x54c119);};}exports[_0x9309('0x34')]=function(_0x54431e,_0x11b971){var _0x152872={},_0x18da94={},_0x10c38b={'count':0x0,'rows':[]};var _0x36a701=_[_0x9309('0x35')](db['ZohoAccount']['rawAttributes'],function(_0x3155ce){return{'name':_0x3155ce[_0x9309('0x36')],'type':_0x3155ce[_0x9309('0x37')][_0x9309('0x38')]};});_0x18da94['model']=_[_0x9309('0x35')](_0x36a701,_0x9309('0x32'));_0x18da94['query']=_[_0x9309('0x39')](_0x54431e['query']);_0x18da94[_0x9309('0x3a')]=_[_0x9309('0x3b')](_0x18da94[_0x9309('0x3c')],_0x18da94[_0x9309('0x3d')]);_0x152872[_0x9309('0x3e')]=_['intersection'](_0x18da94[_0x9309('0x3c')],qs[_0x9309('0x3f')](_0x54431e[_0x9309('0x3d')][_0x9309('0x3f')]));_0x152872[_0x9309('0x3e')]=_0x152872['attributes'][_0x9309('0x40')]?_0x152872[_0x9309('0x3e')]:_0x18da94['model'];if(!_0x54431e[_0x9309('0x3d')][_0x9309('0x41')](_0x9309('0x42'))){_0x152872[_0x9309('0x29')]=qs[_0x9309('0x29')](_0x54431e[_0x9309('0x3d')][_0x9309('0x29')]);_0x152872[_0x9309('0x43')]=qs[_0x9309('0x43')](_0x54431e[_0x9309('0x3d')][_0x9309('0x43')]);}_0x152872[_0x9309('0x44')]=qs[_0x9309('0x45')](_0x54431e[_0x9309('0x3d')]['sort']);_0x152872[_0x9309('0x46')]=qs[_0x9309('0x3a')](_[_0x9309('0x47')](_0x54431e['query'],_0x18da94[_0x9309('0x3a')]));if(_0x54431e[_0x9309('0x3d')][_0x9309('0x48')]){_0x152872[_0x9309('0x46')]=_[_0x9309('0x49')](_0x152872[_0x9309('0x46')],{'$or':_['map'](_0x36a701,function(_0x3e8ef2){if(_0x3e8ef2[_0x9309('0x37')]!=='VIRTUAL'){var _0x284625={};_0x284625[_0x3e8ef2[_0x9309('0x32')]]={'$like':'%'+_0x54431e['query'][_0x9309('0x48')]+'%'};return _0x284625;}})});}_0x152872=_[_0x9309('0x49')]({},_0x152872,_0x54431e['options']);var _0xafe92f={'where':_0x152872[_0x9309('0x46')]};return db[_0x9309('0x4a')][_0x9309('0x4b')](_0xafe92f)[_0x9309('0x30')](function(_0x30c700){_0x10c38b[_0x9309('0x4b')]=_0x30c700;if(_0x54431e[_0x9309('0x3d')][_0x9309('0x4c')]){_0x152872[_0x9309('0x4d')]=[{'all':!![]}];}return db[_0x9309('0x4a')]['findAll'](_0x152872);})[_0x9309('0x30')](function(_0x3cca77){_0x10c38b[_0x9309('0x4e')]=_0x3cca77;return _0x10c38b;})[_0x9309('0x30')](respondWithFilteredResult(_0x11b971,_0x152872))[_0x9309('0x25')](handleError(_0x11b971,null));};exports[_0x9309('0x4f')]=function(_0x557bd6,_0x127f8c){var _0x353321={'raw':![],'where':{'id':_0x557bd6[_0x9309('0x50')]['id']}},_0x464445={};_0x464445[_0x9309('0x3c')]=_[_0x9309('0x39')](db[_0x9309('0x4a')][_0x9309('0x51')]);_0x464445[_0x9309('0x3d')]=_['keys'](_0x557bd6['query']);_0x464445[_0x9309('0x3a')]=_[_0x9309('0x3b')](_0x464445[_0x9309('0x3c')],_0x464445[_0x9309('0x3d')]);_0x353321['attributes']=_[_0x9309('0x3b')](_0x464445[_0x9309('0x3c')],qs[_0x9309('0x3f')](_0x557bd6[_0x9309('0x3d')]['fields']));_0x353321[_0x9309('0x3e')]=_0x353321[_0x9309('0x3e')][_0x9309('0x40')]?_0x353321[_0x9309('0x3e')]:_0x464445['model'];if(_0x557bd6[_0x9309('0x3d')][_0x9309('0x4c')]){_0x353321[_0x9309('0x4d')]=[{'all':!![]}];}_0x353321=_[_0x9309('0x49')]({},_0x353321,_0x557bd6[_0x9309('0x52')]);return db[_0x9309('0x4a')][_0x9309('0x53')](_0x353321)['then'](handleEntityNotFound(_0x127f8c,null))[_0x9309('0x30')](respondWithResult(_0x127f8c,null))[_0x9309('0x25')](handleError(_0x127f8c,null));};exports[_0x9309('0x54')]=function(_0x19586e,_0x4fe8b9){return db['ZohoAccount'][_0x9309('0x54')](_0x19586e[_0x9309('0x55')],{})[_0x9309('0x30')](respondWithResult(_0x4fe8b9,0xc9))[_0x9309('0x25')](handleError(_0x4fe8b9,null));};exports[_0x9309('0x2f')]=function(_0x3fdfb6,_0x44a707){if(_0x3fdfb6[_0x9309('0x55')]['id']){delete _0x3fdfb6[_0x9309('0x55')]['id'];}return db[_0x9309('0x4a')][_0x9309('0x53')]({'where':{'id':_0x3fdfb6[_0x9309('0x50')]['id']}})[_0x9309('0x30')](handleEntityNotFound(_0x44a707,null))[_0x9309('0x30')](saveUpdates(_0x3fdfb6[_0x9309('0x55')],null))[_0x9309('0x30')](respondWithResult(_0x44a707,null))['catch'](handleError(_0x44a707,null));};exports['destroy']=function(_0x15c2e5,_0x25b7ae){return db['ZohoAccount'][_0x9309('0x53')]({'where':{'id':_0x15c2e5[_0x9309('0x50')]['id']}})[_0x9309('0x30')](handleEntityNotFound(_0x25b7ae,null))[_0x9309('0x30')](removeEntity(_0x25b7ae,null))[_0x9309('0x25')](handleError(_0x25b7ae,null));};exports[_0x9309('0x56')]=function(_0x58a6b9,_0x341c17,_0x4831f7){var _0x3a170b={};var _0x19d636={};var _0x419aa9;var _0x4ee906;return db[_0x9309('0x4a')][_0x9309('0x57')]({'where':{'id':_0x58a6b9[_0x9309('0x50')]['id']}})[_0x9309('0x30')](handleEntityNotFound(_0x341c17,null))[_0x9309('0x30')](function(_0x385434){if(_0x385434){_0x419aa9=_0x385434;_0x19d636[_0x9309('0x3c')]=_[_0x9309('0x39')](db[_0x9309('0x58')][_0x9309('0x51')]);_0x19d636[_0x9309('0x3d')]=_[_0x9309('0x39')](_0x58a6b9[_0x9309('0x3d')]);_0x19d636[_0x9309('0x3a')]=_[_0x9309('0x3b')](_0x19d636[_0x9309('0x3c')],_0x19d636[_0x9309('0x3d')]);_0x3a170b[_0x9309('0x3e')]=_[_0x9309('0x3b')](_0x19d636[_0x9309('0x3c')],qs[_0x9309('0x3f')](_0x58a6b9['query'][_0x9309('0x3f')]));_0x3a170b[_0x9309('0x3e')]=_0x3a170b[_0x9309('0x3e')][_0x9309('0x40')]?_0x3a170b[_0x9309('0x3e')]:_0x19d636[_0x9309('0x3c')];_0x3a170b[_0x9309('0x44')]=qs['sort'](_0x58a6b9[_0x9309('0x3d')]['sort']);_0x3a170b[_0x9309('0x46')]=qs['filters'](_[_0x9309('0x47')](_0x58a6b9['query'],_0x19d636[_0x9309('0x3a')]));if(_0x58a6b9[_0x9309('0x3d')][_0x9309('0x48')]){_0x3a170b[_0x9309('0x46')]=_[_0x9309('0x49')](_0x3a170b[_0x9309('0x46')],{'$or':_['map'](_0x3a170b['attributes'],function(_0x2bc5a7){var _0x52a453={};_0x52a453[_0x2bc5a7]={'$like':'%'+_0x58a6b9[_0x9309('0x3d')][_0x9309('0x48')]+'%'};return _0x52a453;})});}_0x3a170b=_[_0x9309('0x49')]({},_0x3a170b,_0x58a6b9[_0x9309('0x52')]);return _0x419aa9[_0x9309('0x56')](_0x3a170b);}})[_0x9309('0x30')](function(_0x394eb5){if(_0x394eb5){_0x4ee906=_0x394eb5[_0x9309('0x40')];if(!_0x58a6b9['query'][_0x9309('0x41')](_0x9309('0x42'))){_0x3a170b[_0x9309('0x29')]=qs[_0x9309('0x29')](_0x58a6b9['query'][_0x9309('0x29')]);_0x3a170b[_0x9309('0x43')]=qs[_0x9309('0x43')](_0x58a6b9[_0x9309('0x3d')][_0x9309('0x43')]);}return _0x419aa9[_0x9309('0x56')](_0x3a170b);}})[_0x9309('0x30')](function(_0xe40e1e){if(_0xe40e1e){return _0xe40e1e?{'count':_0x4ee906,'rows':_0xe40e1e}:null;}})[_0x9309('0x30')](respondWithResult(_0x341c17,null))[_0x9309('0x25')](handleError(_0x341c17,null));};exports['addConfiguration']=function(_0x5c7b23,_0x338186,_0x36f2d0){if(_0x5c7b23[_0x9309('0x55')]['id']){delete _0x5c7b23['body']['id'];}return db['ZohoAccount'][_0x9309('0x57')]({'where':{'id':_0x5c7b23[_0x9309('0x50')]['id']}})[_0x9309('0x30')](handleEntityNotFound(_0x338186,null))[_0x9309('0x30')](function(_0x57e265){if(_0x57e265){_0x5c7b23['body']['AccountId']=_0x57e265['id'];_0x5c7b23[_0x9309('0x55')][_0x9309('0x59')]=integrations['getSubjects'](_0x5c7b23['body'][_0x9309('0x5a')],_0x5c7b23[_0x9309('0x55')][_0x9309('0x37')]);_0x5c7b23[_0x9309('0x55')][_0x9309('0x5b')]=integrations['getDescriptions'](_0x5c7b23[_0x9309('0x55')]['channel'],_0x5c7b23[_0x9309('0x55')][_0x9309('0x37')]);return db[_0x9309('0x58')][_0x9309('0x54')](_0x5c7b23['body'],{'include':[{'model':db[_0x9309('0x5c')],'as':_0x9309('0x59')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})[_0x9309('0x30')](respondWithResult(_0x338186,null))[_0x9309('0x25')](handleError(_0x338186,null));};function getAccessToken(_0x459420){return new Promise(function(_0x5036ef,_0x345e9b){var _0x6a6645;switch(_0x459420[_0x9309('0x5d')]){case'US':_0x6a6645='https://accounts.zoho.com';break;case'AU':_0x6a6645='https://accounts.zoho.com.au';break;case'EU':_0x6a6645=_0x9309('0x5e');break;case'IN':_0x6a6645=_0x9309('0x5f');break;case'CN':_0x6a6645=_0x9309('0x60');break;default:_0x6a6645=_0x9309('0x5e');break;}var _0x23ede6={'method':_0x9309('0x61'),'uri':_0x6a6645+_0x9309('0x62'),'qs':{'refresh_token':_0x459420[_0x9309('0x63')],'client_id':_0x459420[_0x9309('0x64')],'client_secret':_0x459420[_0x9309('0x65')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x23ede6)[_0x9309('0x30')](function(_0x16c2ed){if(_0x16c2ed[_0x9309('0x66')]){_0x5036ef(_0x16c2ed[_0x9309('0x66')]);}else{_0x345e9b('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x9309('0x25')](function(_0x503c2a){_0x345e9b(_0x503c2a);});});}exports[_0x9309('0x67')]=function(_0x281041,_0x5e34ab,_0x443088){var _0x2d82ff,_0x3b1261,_0x376bbe,_0x2d2938,_0xe998c6;return db[_0x9309('0x4a')][_0x9309('0x57')]({'where':{'id':_0x281041[_0x9309('0x50')]['id']},'attributes':['id',_0x9309('0x68'),'zone',_0x9309('0x64'),'clientSecret',_0x9309('0x69'),_0x9309('0x23'),_0x9309('0x63')]})[_0x9309('0x30')](handleEntityNotFound(_0x5e34ab,null))[_0x9309('0x30')](function(_0x4f9a70){_0xe998c6=_0x4f9a70;_0x2d82ff=_0xe998c6[_0x9309('0x68')];_0x3b1261=_0x2d82ff==='zoho.eu'?'eu':_0x9309('0x6a');_0x376bbe=_0xe998c6[_0x9309('0x69')];var _0x350409=_0x376bbe[_0x9309('0x6b')](-0x1);if(_0x350409==='/'||_0x350409==='\x5c'||_0x350409===':'){_0x376bbe=_0x376bbe[_0x9309('0x6c')](0x0,_0x376bbe[_0x9309('0x6d')](_0x350409));}if(!_0xe998c6[_0x9309('0x63')]){throw new Error(_0x9309('0x6e'));}return getAccessToken(_0xe998c6);})[_0x9309('0x30')](function(_0x87f8a6){if(_0x87f8a6){return rp({'method':_0x9309('0x6f'),'uri':util[_0x9309('0x70')](_0x9309('0x71'),_0x3b1261),'qs':{'module':_0x9309('0x72')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x87f8a6},'json':!![]});}})[_0x9309('0x30')](function(_0x28ca0a){if(_0x28ca0a){if(_0x28ca0a[_0x9309('0x73')]&&_0x28ca0a[_0x9309('0x73')][_0x9309('0x22')]){throw new Error(_0x28ca0a['response'][_0x9309('0x22')]['message']);}var _0x4492b1=[];var _0x5824c6=[];var _0x5aa069=[_0x9309('0x74'),_0x9309('0x75'),_0x9309('0x76'),_0x9309('0x77'),'Call_Duration',_0x9309('0x78'),_0x9309('0x79'),_0x9309('0x7a')];_0x5824c6=_[_0x9309('0x7b')](_0x28ca0a[_0x9309('0x3f')],function(_0x316149){return _0x5aa069[_0x9309('0x7c')](_0x316149[_0x9309('0x7d')]);});for(var _0x5a71f3=0x0;_0x5a71f3<_0x5824c6[_0x9309('0x40')];_0x5a71f3++){if(_0x5824c6[_0x5a71f3]['system_mandatory']===![]){_0x4492b1[_0x9309('0x7e')]({'id':_0x5824c6[_0x5a71f3]['id'],'name':_0x5824c6[_0x5a71f3][_0x9309('0x7f')],'custom':_0x5824c6[_0x5a71f3][_0x9309('0x80')],'options':_0x5824c6[_0x5a71f3][_0x9309('0x81')]==='picklist'&&_0x5824c6[_0x5a71f3][_0x9309('0x82')][_0x9309('0x40')]>-0x1?_['map'](_0x5824c6[_0x5a71f3][_0x9309('0x82')],function(_0x46ef90){return{'name':_0x46ef90,'value':_0x46ef90};}):[]});}}return{'count':_0x4492b1['length'],'rows':_0x4492b1};}else{return{'count':0x0,'rows':[]};}})[_0x9309('0x30')](respondWithResult(_0x5e34ab,null))[_0x9309('0x25')](function(_0x18ab96){var _0x40136d=_0x281041['query'][_0x9309('0x83')]?0x1f4:_0x18ab96[_0x9309('0x84')]||0x1f4;logger[_0x9309('0x22')](_0x9309('0x85'),_0x9309('0x67'),_0x40136d,JSON[_0x9309('0x21')](_0x18ab96));delete _0x18ab96[_0x9309('0x32')];if(_0x40136d===0x191){_0x40136d=0x190;}_0x5e34ab['status'](_0x40136d)[_0x9309('0x33')](_0x281041[_0x9309('0x3d')]['test']?{'message':_0x9309('0x86'),'statusCode':_0x18ab96[_0x9309('0x84')]}:_0x18ab96);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index b34a720..fe6ccec 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 _0x0a75=['int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','https://accounts.zoho.in','https://accounts.zoho.com.cn','info','catch','lodash','util','../../config/logger','bluebird','request-promise','path','./intZohoAccount.attributes','exports','define'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x0a75,0x72));var _0x50a7=function(_0x33b54a,_0x4932b7){_0x33b54a=_0x33b54a-0x0;var _0x991d39=_0x0a75[_0x33b54a];return _0x991d39;};'use strict';var _=require(_0x50a7('0x0'));var util=require(_0x50a7('0x1'));var logger=require(_0x50a7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x50a7('0x3'));var rp=require(_0x50a7('0x4'));var fs=require('fs');var path=require(_0x50a7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x50a7('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x50a7('0x7')]=function(_0x3188b3,_0xacca54){return _0x3188b3[_0x50a7('0x8')]('ZohoAccount',attributes,{'tableName':_0x50a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5271c0,_0x3d1a0a,_0x36cabd){if(_0x5271c0[_0x50a7('0xa')](_0x50a7('0xb'))||_0x5271c0['changed'](_0x50a7('0xc'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0xd'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0xe'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0xf'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0x10'))){var _0x2a9eb1,_0x51158e;_0x2a9eb1=_0x5271c0['serverUrl'];var _0x3bac36=_0x2a9eb1[_0x50a7('0x11')](-0x1);if(_0x3bac36==='/'||_0x3bac36==='\x5c'||_0x3bac36===':'){_0x2a9eb1=_0x2a9eb1[_0x50a7('0x12')](0x0,_0x2a9eb1[_0x50a7('0x13')](_0x3bac36));}switch(_0x5271c0[_0x50a7('0xb')]){case'US':_0x51158e=_0x50a7('0x14');break;case'AU':_0x51158e=_0x50a7('0x15');break;case'IN':_0x51158e='https://accounts.zoho.in';break;case'CN':_0x51158e='https://accounts.zoho.com.cn';break;default:_0x51158e=_0x50a7('0x16');break;}var _0x3f2b59={'method':_0x50a7('0x17'),'uri':_0x51158e+_0x50a7('0x18'),'form':{'grant_type':_0x50a7('0x19'),'client_id':_0x5271c0[_0x50a7('0xd')],'client_secret':_0x5271c0['clientSecret'],'redirect_uri':_0x5271c0['serverUrl'],'code':_0x5271c0[_0x50a7('0xf')]},'headers':{'Content-Type':_0x50a7('0x1a')}};return rp(_0x3f2b59)[_0x50a7('0x1b')](function(_0x1298d2){var _0x3ad1f1=JSON[_0x50a7('0x1c')](_0x1298d2);if(_0x3ad1f1[_0x50a7('0x1d')]){_0x5271c0[_0x50a7('0x1e')]=_0x3ad1f1[_0x50a7('0x1d')];logger['info'](util[_0x50a7('0x1f')](_0x50a7('0x20'),_0x5271c0[_0x50a7('0x21')],_0x5271c0['id']));}else{logger[_0x50a7('0x22')](util[_0x50a7('0x1f')](_0x50a7('0x23'),_0x5271c0['name'],_0x5271c0['id']),util[_0x50a7('0x24')](_0x3ad1f1,{'showHidden':![],'depth':null}));}return _0x36cabd(null,_0x3d1a0a);})['catch'](function(_0x354aff){logger[_0x50a7('0x22')](util['format'](_0x50a7('0x23'),_0x5271c0[_0x50a7('0x21')],_0x5271c0['id']),util[_0x50a7('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x36cabd(_0x354aff);});}else{return _0x36cabd(null,_0x3d1a0a);}},'beforeUpdate':function(_0x4c4a8b,_0x122dbd,_0x53a4d5){if(_0x4c4a8b[_0x50a7('0xa')]('zone')||_0x4c4a8b[_0x50a7('0xa')](_0x50a7('0xc'))||_0x4c4a8b[_0x50a7('0xa')]('clientId')||_0x4c4a8b[_0x50a7('0xa')](_0x50a7('0xe'))||_0x4c4a8b[_0x50a7('0xa')](_0x50a7('0xf'))||_0x4c4a8b['changed']('host')){var _0x56a234,_0x511282;_0x56a234=_0x4c4a8b[_0x50a7('0xc')];var _0x183eb4=_0x56a234['slice'](-0x1);if(_0x183eb4==='/'||_0x183eb4==='\x5c'||_0x183eb4===':'){_0x56a234=_0x56a234[_0x50a7('0x12')](0x0,_0x56a234[_0x50a7('0x13')](_0x183eb4));}switch(_0x4c4a8b[_0x50a7('0xb')]){case'US':_0x511282=_0x50a7('0x14');break;case'AU':_0x511282='https://accounts.zoho.com.au';break;case'IN':_0x511282=_0x50a7('0x25');break;case'CN':_0x511282=_0x50a7('0x26');break;default:_0x511282=_0x50a7('0x16');break;}var _0x5bd967={'method':_0x50a7('0x17'),'uri':_0x511282+_0x50a7('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x4c4a8b[_0x50a7('0xd')],'client_secret':_0x4c4a8b[_0x50a7('0xe')],'redirect_uri':_0x4c4a8b['serverUrl'],'code':_0x4c4a8b['code']},'headers':{'Content-Type':_0x50a7('0x1a')}};return rp(_0x5bd967)[_0x50a7('0x1b')](function(_0x9ae9e5){var _0x2a5447=JSON[_0x50a7('0x1c')](_0x9ae9e5);if(_0x2a5447[_0x50a7('0x1d')]){_0x4c4a8b[_0x50a7('0x1e')]=_0x2a5447[_0x50a7('0x1d')];logger[_0x50a7('0x27')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4c4a8b[_0x50a7('0x21')],_0x4c4a8b['id']));}else{logger['error'](util[_0x50a7('0x1f')](_0x50a7('0x23'),_0x4c4a8b['name'],_0x4c4a8b['id']),util[_0x50a7('0x24')](_0x2a5447,{'showHidden':![],'depth':null}));}return _0x53a4d5(null,_0x122dbd);})[_0x50a7('0x28')](function(_0x20b5bd){logger[_0x50a7('0x22')](util['format'](_0x50a7('0x23'),_0x4c4a8b['name'],_0x4c4a8b['id']),util[_0x50a7('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x53a4d5(_0x20b5bd);});}else{return _0x53a4d5(null,_0x122dbd);}}}});}; \ No newline at end of file +var _0x7dab=['catch','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','substring','authorization_code','application/x-www-form-urlencoded','refreshToken','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','zone','changed','serverUrl','clientId','code','host','slice','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','parse','refresh_token','info','format','error','inspect'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x7dab,0x1e8));var _0xb7da=function(_0x46e8f8,_0x3865ef){_0x46e8f8=_0x46e8f8-0x0;var _0x192775=_0x7dab[_0x46e8f8];return _0x192775;};'use strict';var _=require(_0xb7da('0x0'));var util=require(_0xb7da('0x1'));var logger=require('../../config/logger')(_0xb7da('0x2'));var moment=require(_0xb7da('0x3'));var BPromise=require(_0xb7da('0x4'));var rp=require(_0xb7da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb7da('0x6'));var config=require(_0xb7da('0x7'));var attributes=require(_0xb7da('0x8'));var integrations=require(_0xb7da('0x9'));module['exports']=function(_0x1f71c4,_0x3981c1){return _0x1f71c4[_0xb7da('0xa')](_0xb7da('0xb'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x213e41,_0x6a6f95,_0xdadb98){if(_0x213e41['changed'](_0xb7da('0xc'))||_0x213e41[_0xb7da('0xd')](_0xb7da('0xe'))||_0x213e41[_0xb7da('0xd')](_0xb7da('0xf'))||_0x213e41[_0xb7da('0xd')]('clientSecret')||_0x213e41[_0xb7da('0xd')](_0xb7da('0x10'))||_0x213e41[_0xb7da('0xd')](_0xb7da('0x11'))){var _0x8397c0,_0x328029;_0x8397c0=_0x213e41[_0xb7da('0xe')];var _0x49cb2c=_0x8397c0[_0xb7da('0x12')](-0x1);if(_0x49cb2c==='/'||_0x49cb2c==='\x5c'||_0x49cb2c===':'){_0x8397c0=_0x8397c0['substring'](0x0,_0x8397c0[_0xb7da('0x13')](_0x49cb2c));}switch(_0x213e41[_0xb7da('0xc')]){case'US':_0x328029='https://accounts.zoho.com';break;case'AU':_0x328029=_0xb7da('0x14');break;case'IN':_0x328029=_0xb7da('0x15');break;case'CN':_0x328029='https://accounts.zoho.com.cn';break;default:_0x328029=_0xb7da('0x16');break;}var _0x29333f={'method':_0xb7da('0x17'),'uri':_0x328029+_0xb7da('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x213e41[_0xb7da('0xf')],'client_secret':_0x213e41[_0xb7da('0x19')],'redirect_uri':_0x213e41[_0xb7da('0xe')],'code':_0x213e41[_0xb7da('0x10')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x29333f)['then'](function(_0x2319d7){var _0x1c0838=JSON[_0xb7da('0x1a')](_0x2319d7);if(_0x1c0838[_0xb7da('0x1b')]){_0x213e41['refreshToken']=_0x1c0838[_0xb7da('0x1b')];logger[_0xb7da('0x1c')](util[_0xb7da('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x213e41['name'],_0x213e41['id']));}else{logger[_0xb7da('0x1e')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x213e41['name'],_0x213e41['id']),util[_0xb7da('0x1f')](_0x1c0838,{'showHidden':![],'depth':null}));}return _0xdadb98(null,_0x6a6f95);})[_0xb7da('0x20')](function(_0x38b269){logger[_0xb7da('0x1e')](util[_0xb7da('0x1d')](_0xb7da('0x21'),_0x213e41[_0xb7da('0x22')],_0x213e41['id']),util[_0xb7da('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0xdadb98(_0x38b269);});}else{return _0xdadb98(null,_0x6a6f95);}},'beforeUpdate':function(_0x326aa0,_0x2bc2fb,_0x10a865){if(_0x326aa0[_0xb7da('0xd')](_0xb7da('0xc'))||_0x326aa0['changed'](_0xb7da('0xe'))||_0x326aa0[_0xb7da('0xd')](_0xb7da('0xf'))||_0x326aa0['changed']('clientSecret')||_0x326aa0[_0xb7da('0xd')](_0xb7da('0x10'))||_0x326aa0[_0xb7da('0xd')](_0xb7da('0x11'))){var _0x9d0bee,_0x277c38;_0x9d0bee=_0x326aa0[_0xb7da('0xe')];var _0x2d0bdf=_0x9d0bee[_0xb7da('0x12')](-0x1);if(_0x2d0bdf==='/'||_0x2d0bdf==='\x5c'||_0x2d0bdf===':'){_0x9d0bee=_0x9d0bee[_0xb7da('0x23')](0x0,_0x9d0bee[_0xb7da('0x13')](_0x2d0bdf));}switch(_0x326aa0[_0xb7da('0xc')]){case'US':_0x277c38='https://accounts.zoho.com';break;case'AU':_0x277c38='https://accounts.zoho.com.au';break;case'IN':_0x277c38='https://accounts.zoho.in';break;case'CN':_0x277c38='https://accounts.zoho.com.cn';break;default:_0x277c38=_0xb7da('0x16');break;}var _0x13d9fe={'method':_0xb7da('0x17'),'uri':_0x277c38+_0xb7da('0x18'),'form':{'grant_type':_0xb7da('0x24'),'client_id':_0x326aa0[_0xb7da('0xf')],'client_secret':_0x326aa0[_0xb7da('0x19')],'redirect_uri':_0x326aa0[_0xb7da('0xe')],'code':_0x326aa0[_0xb7da('0x10')]},'headers':{'Content-Type':_0xb7da('0x25')}};return rp(_0x13d9fe)['then'](function(_0x3e5432){var _0x4d8336=JSON[_0xb7da('0x1a')](_0x3e5432);if(_0x4d8336[_0xb7da('0x1b')]){_0x326aa0[_0xb7da('0x26')]=_0x4d8336['refresh_token'];logger['info'](util[_0xb7da('0x1d')](_0xb7da('0x27'),_0x326aa0['name'],_0x326aa0['id']));}else{logger['error'](util[_0xb7da('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x326aa0[_0xb7da('0x22')],_0x326aa0['id']),util['inspect'](_0x4d8336,{'showHidden':![],'depth':null}));}return _0x10a865(null,_0x2bc2fb);})['catch'](function(_0x1c937d){logger[_0xb7da('0x1e')](util['format'](_0xb7da('0x21'),_0x326aa0[_0xb7da('0x22')],_0x326aa0['id']),util[_0xb7da('0x1f')](parsedResult,{'showHidden':![],'depth':null}));return _0x10a865(_0x1c937d);});}else{return _0x10a865(null,_0x2bc2fb);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 8b69654..297b18c 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 _0x1b8c=['options','raw','where','attributes','map','model','include','debug','stringify','ShowZohoAccount','ZohoAccount','find','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','then','info','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','findAll'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x1b8c,0x18c));var _0xc1b8=function(_0x5ca804,_0x287c3b){_0x5ca804=_0x5ca804-0x0;var _0x54d4d6=_0x1b8c[_0x5ca804];return _0x54d4d6;};'use strict';var _=require('lodash');var util=require(_0xc1b8('0x0'));var moment=require(_0xc1b8('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1b8('0x2'));var fs=require('fs');var Redis=require(_0xc1b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc1b8('0x4'));var config=require(_0xc1b8('0x5'));var jayson=require(_0xc1b8('0x6'));var client=jayson[_0xc1b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30e8ca,_0x1f2fff,_0x257744){return new BPromise(function(_0x1670b2,_0x419f3b){return client['request'](_0x30e8ca,_0x257744)[_0xc1b8('0x8')](function(_0x5e0894){logger[_0xc1b8('0x9')]('ZohoAccount,\x20%s,\x20%s',_0x1f2fff,'request\x20sent');logger['debug'](_0xc1b8('0xa'),_0x1f2fff,_0xc1b8('0xb'),JSON['stringify'](_0x5e0894));if(_0x5e0894['error']){if(_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xd')]===0x1f4){logger[_0xc1b8('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x1f2fff,_0x5e0894['error'][_0xc1b8('0xe')]);return _0x419f3b(_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xe')]);}logger[_0xc1b8('0xc')](_0xc1b8('0xf'),_0x1f2fff,_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xe')]);return _0x1670b2(_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xe')]);}else{logger[_0xc1b8('0x9')](_0xc1b8('0xf'),_0x1f2fff,_0xc1b8('0xb'));_0x1670b2(_0x5e0894[_0xc1b8('0x10')]['message']);}})[_0xc1b8('0x11')](function(_0x8b89c9){logger[_0xc1b8('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x1f2fff,_0x8b89c9);_0x419f3b(_0x8b89c9);});});}exports[_0xc1b8('0x12')]=function(_0x46fdb6){var _0x238888=this;return new Promise(function(_0x14a97e,_0x30b6dd){return db['ZohoAccount'][_0xc1b8('0x13')]({'raw':_0x46fdb6[_0xc1b8('0x14')]?_0x46fdb6[_0xc1b8('0x14')][_0xc1b8('0x15')]===undefined?!![]:![]:!![],'where':_0x46fdb6[_0xc1b8('0x14')]?_0x46fdb6[_0xc1b8('0x14')][_0xc1b8('0x16')]||null:null,'attributes':_0x46fdb6['options']?_0x46fdb6['options'][_0xc1b8('0x17')]||null:null,'limit':_0x46fdb6['options']?_0x46fdb6[_0xc1b8('0x14')]['limit']||null:null,'include':_0x46fdb6['options']?_0x46fdb6[_0xc1b8('0x14')]['include']?_[_0xc1b8('0x18')](_0x46fdb6['options']['include'],function(_0x49550b){return{'model':db[_0x49550b[_0xc1b8('0x19')]],'as':_0x49550b['as'],'attributes':_0x49550b[_0xc1b8('0x17')],'include':_0x49550b[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x49550b[_0xc1b8('0x1a')],function(_0x3860a4){return{'model':db[_0x3860a4['model']],'as':_0x3860a4['as'],'attributes':_0x3860a4[_0xc1b8('0x17')],'include':_0x3860a4[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x3860a4['include'],function(_0x5ebf5c){return{'model':db[_0x5ebf5c['model']],'as':_0x5ebf5c['as'],'attributes':_0x5ebf5c[_0xc1b8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1b8('0x8')](function(_0x5c5df1){logger['info'](_0xc1b8('0x12'),_0x46fdb6);logger[_0xc1b8('0x1b')]('GetZohoAccount',_0x46fdb6,JSON[_0xc1b8('0x1c')](_0x5c5df1));_0x14a97e(_0x5c5df1);})[_0xc1b8('0x11')](function(_0x5c74f7){logger[_0xc1b8('0xc')](_0xc1b8('0x12'),_0x5c74f7[_0xc1b8('0xe')],_0x46fdb6);_0x30b6dd(_0x238888[_0xc1b8('0xc')](0x1f4,_0x5c74f7[_0xc1b8('0xe')]));});});};exports[_0xc1b8('0x1d')]=function(_0x2e47bc){var _0x3e70f4=this;return new Promise(function(_0x12c5ca,_0x2634df){return db[_0xc1b8('0x1e')][_0xc1b8('0x1f')]({'raw':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc['options']['where']||null:null,'attributes':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc[_0xc1b8('0x14')][_0xc1b8('0x17')]||null:null,'include':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc[_0xc1b8('0x14')][_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x2e47bc[_0xc1b8('0x14')]['include'],function(_0x204e4d){return{'model':db[_0x204e4d['model']],'as':_0x204e4d['as'],'attributes':_0x204e4d[_0xc1b8('0x17')],'include':_0x204e4d[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x204e4d[_0xc1b8('0x1a')],function(_0x407fec){return{'model':db[_0x407fec[_0xc1b8('0x19')]],'as':_0x407fec['as'],'attributes':_0x407fec[_0xc1b8('0x17')],'include':_0x407fec[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x407fec[_0xc1b8('0x1a')],function(_0x49ad32){return{'model':db[_0x49ad32[_0xc1b8('0x19')]],'as':_0x49ad32['as'],'attributes':_0x49ad32[_0xc1b8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1b8('0x8')](function(_0x481ca3){logger[_0xc1b8('0x9')](_0xc1b8('0x1d'),_0x2e47bc);logger[_0xc1b8('0x1b')]('ShowZohoAccount',_0x2e47bc,JSON['stringify'](_0x481ca3));_0x12c5ca(_0x481ca3);})['catch'](function(_0xe79600){logger[_0xc1b8('0xc')](_0xc1b8('0x1d'),_0xe79600['message'],_0x2e47bc);_0x2634df(_0x3e70f4['error'](0x1f4,_0xe79600[_0xc1b8('0xe')]));});});}; \ No newline at end of file +var _0xb0eb=['ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','map','include','model','attributes','debug','ShowZohoAccount','find','then','util','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0xb0eb,0x18b));var _0xbb0e=function(_0x138de6,_0x3d7f69){_0x138de6=_0x138de6-0x0;var _0xd2a852=_0xb0eb[_0x138de6];return _0xd2a852;};'use strict';var _=require('lodash');var util=require(_0xbb0e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbb0e('0x1'));var logger=require(_0xbb0e('0x2'))(_0xbb0e('0x3'));var config=require(_0xbb0e('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xbb0e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5759b4,_0xc2e429,_0x1683aa){return new BPromise(function(_0x237d7e,_0x3566f){return client[_0xbb0e('0x6')](_0x5759b4,_0x1683aa)['then'](function(_0x221a8d){logger[_0xbb0e('0x7')]('ZohoAccount,\x20%s,\x20%s',_0xc2e429,'request\x20sent');logger['debug'](_0xbb0e('0x8'),_0xc2e429,_0xbb0e('0x9'),JSON[_0xbb0e('0xa')](_0x221a8d));if(_0x221a8d[_0xbb0e('0xb')]){if(_0x221a8d['error'][_0xbb0e('0xc')]===0x1f4){logger['error'](_0xbb0e('0xd'),_0xc2e429,_0x221a8d['error'][_0xbb0e('0xe')]);return _0x3566f(_0x221a8d[_0xbb0e('0xb')][_0xbb0e('0xe')]);}logger['error'](_0xbb0e('0xd'),_0xc2e429,_0x221a8d[_0xbb0e('0xb')][_0xbb0e('0xe')]);return _0x237d7e(_0x221a8d['error'][_0xbb0e('0xe')]);}else{logger[_0xbb0e('0x7')](_0xbb0e('0xd'),_0xc2e429,_0xbb0e('0x9'));_0x237d7e(_0x221a8d['result']['message']);}})[_0xbb0e('0xf')](function(_0x4a5cab){logger[_0xbb0e('0xb')](_0xbb0e('0xd'),_0xc2e429,_0x4a5cab);_0x3566f(_0x4a5cab);});});}exports[_0xbb0e('0x10')]=function(_0x3981c3){var _0x2a00c1=this;return new Promise(function(_0x5b0c70,_0x1ede52){return db[_0xbb0e('0x11')][_0xbb0e('0x12')]({'raw':_0x3981c3[_0xbb0e('0x13')]?_0x3981c3[_0xbb0e('0x13')][_0xbb0e('0x14')]===undefined?!![]:![]:!![],'where':_0x3981c3[_0xbb0e('0x13')]?_0x3981c3[_0xbb0e('0x13')][_0xbb0e('0x15')]||null:null,'attributes':_0x3981c3[_0xbb0e('0x13')]?_0x3981c3['options']['attributes']||null:null,'limit':_0x3981c3[_0xbb0e('0x13')]?_0x3981c3[_0xbb0e('0x13')][_0xbb0e('0x16')]||null:null,'include':_0x3981c3[_0xbb0e('0x13')]?_0x3981c3[_0xbb0e('0x13')]['include']?_[_0xbb0e('0x17')](_0x3981c3[_0xbb0e('0x13')][_0xbb0e('0x18')],function(_0x2e44d5){return{'model':db[_0x2e44d5[_0xbb0e('0x19')]],'as':_0x2e44d5['as'],'attributes':_0x2e44d5[_0xbb0e('0x1a')],'include':_0x2e44d5['include']?_['map'](_0x2e44d5[_0xbb0e('0x18')],function(_0x4a99f2){return{'model':db[_0x4a99f2[_0xbb0e('0x19')]],'as':_0x4a99f2['as'],'attributes':_0x4a99f2[_0xbb0e('0x1a')],'include':_0x4a99f2['include']?_[_0xbb0e('0x17')](_0x4a99f2[_0xbb0e('0x18')],function(_0x21571f){return{'model':db[_0x21571f[_0xbb0e('0x19')]],'as':_0x21571f['as'],'attributes':_0x21571f[_0xbb0e('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4630b0){logger[_0xbb0e('0x7')]('GetZohoAccount',_0x3981c3);logger[_0xbb0e('0x1b')]('GetZohoAccount',_0x3981c3,JSON[_0xbb0e('0xa')](_0x4630b0));_0x5b0c70(_0x4630b0);})['catch'](function(_0x121f63){logger[_0xbb0e('0xb')](_0xbb0e('0x10'),_0x121f63[_0xbb0e('0xe')],_0x3981c3);_0x1ede52(_0x2a00c1[_0xbb0e('0xb')](0x1f4,_0x121f63[_0xbb0e('0xe')]));});});};exports[_0xbb0e('0x1c')]=function(_0x18eec0){var _0x21ffa3=this;return new Promise(function(_0x211604,_0x133ff3){return db['ZohoAccount'][_0xbb0e('0x1d')]({'raw':_0x18eec0['options']?_0x18eec0['options']['raw']===undefined?!![]:![]:!![],'where':_0x18eec0[_0xbb0e('0x13')]?_0x18eec0[_0xbb0e('0x13')][_0xbb0e('0x15')]||null:null,'attributes':_0x18eec0[_0xbb0e('0x13')]?_0x18eec0[_0xbb0e('0x13')][_0xbb0e('0x1a')]||null:null,'include':_0x18eec0[_0xbb0e('0x13')]?_0x18eec0[_0xbb0e('0x13')][_0xbb0e('0x18')]?_[_0xbb0e('0x17')](_0x18eec0[_0xbb0e('0x13')][_0xbb0e('0x18')],function(_0x54dfc3){return{'model':db[_0x54dfc3[_0xbb0e('0x19')]],'as':_0x54dfc3['as'],'attributes':_0x54dfc3['attributes'],'include':_0x54dfc3['include']?_['map'](_0x54dfc3[_0xbb0e('0x18')],function(_0x315218){return{'model':db[_0x315218[_0xbb0e('0x19')]],'as':_0x315218['as'],'attributes':_0x315218[_0xbb0e('0x1a')],'include':_0x315218['include']?_[_0xbb0e('0x17')](_0x315218['include'],function(_0x150f5a){return{'model':db[_0x150f5a['model']],'as':_0x150f5a['as'],'attributes':_0x150f5a['attributes']};}):[]};}):[]};}):[]:[]})[_0xbb0e('0x1e')](function(_0x4e2618){logger[_0xbb0e('0x7')](_0xbb0e('0x1c'),_0x18eec0);logger[_0xbb0e('0x1b')](_0xbb0e('0x1c'),_0x18eec0,JSON[_0xbb0e('0xa')](_0x4e2618));_0x211604(_0x4e2618);})['catch'](function(_0x456506){logger['error'](_0xbb0e('0x1c'),_0x456506[_0xbb0e('0xe')],_0x18eec0);_0x133ff3(_0x21ffa3[_0xbb0e('0xb')](0x1f4,_0x456506[_0xbb0e('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index cab64f5..63eba36 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 _0x1643=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','exports','multer'];(function(_0x24b1c5,_0x31a49f){var _0x14e66e=function(_0x2f9407){while(--_0x2f9407){_0x24b1c5['push'](_0x24b1c5['shift']());}};_0x14e66e(++_0x31a49f);}(_0x1643,0x107));var _0x3164=function(_0x156a89,_0x25c45a){_0x156a89=_0x156a89-0x0;var _0x21f867=_0x1643[_0x156a89];return _0x21f867;};'use strict';var multer=require(_0x3164('0x0'));var util=require(_0x3164('0x1'));var path=require(_0x3164('0x2'));var timeout=require(_0x3164('0x3'));var express=require('express');var router=express[_0x3164('0x4')]();var auth=require(_0x3164('0x5'));var interaction=require(_0x3164('0x6'));var config=require(_0x3164('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x3164('0x8')]('/',auth[_0x3164('0x9')](),controller['index']);router[_0x3164('0x8')](_0x3164('0xa'),auth[_0x3164('0x9')](),controller[_0x3164('0xb')]);router['get'](_0x3164('0xc'),auth[_0x3164('0x9')](),controller[_0x3164('0xd')]);router[_0x3164('0x8')](_0x3164('0xe'),auth[_0x3164('0x9')](),controller[_0x3164('0xf')]);router[_0x3164('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3164('0x10')]);router[_0x3164('0x11')]('/',auth[_0x3164('0x9')](),controller[_0x3164('0x12')]);router[_0x3164('0x13')](_0x3164('0xa'),auth[_0x3164('0x9')](),controller['update']);router[_0x3164('0x14')]('/:id',auth[_0x3164('0x9')](),controller['destroy']);module[_0x3164('0x15')]=router; \ No newline at end of file +var _0xe8ee=['post','put','update','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x4701f1,_0xfc0665){var _0x1baafd=function(_0x4a3f84){while(--_0x4a3f84){_0x4701f1['push'](_0x4701f1['shift']());}};_0x1baafd(++_0xfc0665);}(_0xe8ee,0x15b));var _0xee8e=function(_0x906f8a,_0x452fbd){_0x906f8a=_0x906f8a-0x0;var _0x2d29ef=_0xe8ee[_0x906f8a];return _0x2d29ef;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xee8e('0x0'));var timeout=require(_0xee8e('0x1'));var express=require(_0xee8e('0x2'));var router=express[_0xee8e('0x3')]();var auth=require(_0xee8e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xee8e('0x5'));router[_0xee8e('0x6')]('/',auth[_0xee8e('0x7')](),controller['index']);router[_0xee8e('0x6')](_0xee8e('0x8'),auth[_0xee8e('0x7')](),controller[_0xee8e('0x9')]);router[_0xee8e('0x6')](_0xee8e('0xa'),auth[_0xee8e('0x7')](),controller[_0xee8e('0xb')]);router[_0xee8e('0x6')](_0xee8e('0xc'),auth['isAuthenticated'](),controller[_0xee8e('0xd')]);router[_0xee8e('0x6')]('/:id/descriptions',auth[_0xee8e('0x7')](),controller['getDescriptions']);router[_0xee8e('0xe')]('/',auth[_0xee8e('0x7')](),controller['create']);router[_0xee8e('0xf')](_0xee8e('0x8'),auth[_0xee8e('0x7')](),controller[_0xee8e('0x10')]);router[_0xee8e('0x11')](_0xee8e('0x8'),auth[_0xee8e('0x7')](),controller['destroy']);module[_0xee8e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 63a8f8f..1fdace8 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 _0x3701=['Contacts','sequelize','exports','STRING','Leads'];(function(_0x2daad8,_0xd1594){var _0x43157d=function(_0x45c695){while(--_0x45c695){_0x2daad8['push'](_0x2daad8['shift']());}};_0x43157d(++_0xd1594);}(_0x3701,0x105));var _0x1370=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3701[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1370('0x0'));module[_0x1370('0x1')]={'name':{'type':Sequelize[_0x1370('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x1370('0x3'),_0x1370('0x4')),'defaultValue':'Leads'},'description':{'type':Sequelize[_0x1370('0x2')]}}; \ No newline at end of file +var _0x17b7=['ENUM','Leads','Contacts','sequelize','exports','STRING'];(function(_0x210718,_0x247b55){var _0x541bfc=function(_0x5dbcad){while(--_0x5dbcad){_0x210718['push'](_0x210718['shift']());}};_0x541bfc(++_0x247b55);}(_0x17b7,0x7b));var _0x717b=function(_0x176fc5,_0x1dc617){_0x176fc5=_0x176fc5-0x0;var _0x699f7d=_0x17b7[_0x176fc5];return _0x699f7d;};'use strict';var Sequelize=require(_0x717b('0x0'));module[_0x717b('0x1')]={'name':{'type':Sequelize[_0x717b('0x2')]},'moduleCreate':{'type':Sequelize[_0x717b('0x3')](_0x717b('0x4'),_0x717b('0x5')),'defaultValue':_0x717b('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 3d3320f..6625e51 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 _0xe14b=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','map','ZohoConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0xe14b,0x93));var _0xbe14=function(_0x131c24,_0xb7c584){_0x131c24=_0x131c24-0x0;var _0x28c053=_0xe14b[_0x131c24];return _0x28c053;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function checkPasswordPattern(_0x23a730,_0x2850cb,_0x16893f){if(_0x16893f){var _0xa2cf72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2cf72[_0xbe14('0x18')](_0x2850cb)){return _0x23a730;}else{throw new db[(_0xbe14('0x19'))][(_0xbe14('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x23a730;}}function respondWithRpcPromise(_0x55b3a7,_0x3f58f5,_0x3dc4a9,_0xf4ac9){return new BPromise(function(_0x37ce4e,_0x4e8f34){var _0x21c789=_0xf4ac9||client;return _0x21c789[_0xbe14('0x1b')](_0x55b3a7,_0x3dc4a9)[_0xbe14('0x1c')](function(_0x123ede){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));logger['debug'](_0xbe14('0x20'),_0x3f58f5,_0xbe14('0x1f'),JSON[_0xbe14('0x21')](_0x123ede));if(_0x123ede[_0xbe14('0x22')]){if(_0x123ede[_0xbe14('0x22')][_0xbe14('0x23')]===0x1f4){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);return _0x4e8f34(_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);}logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede['error'][_0xbe14('0x24')]);return _0x37ce4e(_0x123ede['error'][_0xbe14('0x24')]);}else{logger['info'](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));_0x37ce4e(_0x123ede['result'][_0xbe14('0x24')]);}})['catch'](function(_0x4587a8){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x4587a8);_0x4e8f34(_0x4587a8);});});}function respondWithStatusCode(_0x5fa043,_0x1ee9c1){_0x1ee9c1=_0x1ee9c1||0xcc;return function(_0x39cc81){if(_0x39cc81){return _0x5fa043[_0xbe14('0x25')](_0x1ee9c1);}return _0x5fa043[_0xbe14('0x26')](_0x1ee9c1)['end']();};}function respondWithResult(_0x1822e0,_0x1ba46a){_0x1ba46a=_0x1ba46a||0xc8;return function(_0x391556){if(_0x391556){return _0x1822e0[_0xbe14('0x26')](_0x1ba46a)['json'](_0x391556);}};}function respondWithFilteredResult(_0x16f884,_0x29fc64){return function(_0x59bf34){if(_0x59bf34){var _0x3c3613=_0x59bf34[_0xbe14('0x27')],_0x3b3e84=_0x29fc64[_0xbe14('0x28')],_0x1c7cc7=_0x29fc64[_0xbe14('0x28')]+_0x29fc64[_0xbe14('0x29')],_0x19252f;if(_0x1c7cc7>=_0x3c3613){_0x1c7cc7=_0x3c3613;_0x19252f=0xc8;}else{_0x19252f=0xce;}_0x16f884[_0xbe14('0x26')](_0x19252f);return _0x16f884[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x3b3e84+'-'+_0x1c7cc7+'/'+_0x3c3613)[_0xbe14('0x2c')](_0x59bf34);}return null;};}function patchUpdates(_0x39dc0a){return function(_0x10ae36){try{jsonpatch[_0xbe14('0x2d')](_0x10ae36,_0x39dc0a,!![]);}catch(_0xe6feb2){return BPromise[_0xbe14('0x2e')](_0xe6feb2);}return _0x10ae36[_0xbe14('0x2f')]();};}function saveUpdates(_0x29e76a,_0x14e7c4){return function(_0x581e86){if(_0x581e86){return _0x581e86[_0xbe14('0x30')](_0x29e76a)['then'](function(_0x58f8de){return _0x58f8de;});}return null;};}function removeEntity(_0x46c2d1,_0x4c1e7e){return function(_0x243524){if(_0x243524){return _0x243524[_0xbe14('0x31')]()['then'](function(){_0x46c2d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(!_0x5f27b6){_0x412ad5[_0xbe14('0x25')](0x194);}return _0x5f27b6;};}function handleError(_0x1faf3e,_0x452635){_0x452635=_0x452635||0x1f4;return function(_0x1aa849){logger[_0xbe14('0x22')](_0x1aa849['stack']);if(_0x1aa849['name']){delete _0x1aa849[_0xbe14('0x32')];}_0x1faf3e['status'](_0x452635)['send'](_0x1aa849);};}exports['index']=function(_0x163ef7,_0x393f6b){var _0x2bb45={},_0x3dbacb={},_0x172e79={'count':0x0,'rows':[]};var _0x29356f=_[_0xbe14('0x33')](db[_0xbe14('0x34')][_0xbe14('0x35')],function(_0x2dfd5a){return{'name':_0x2dfd5a[_0xbe14('0x36')],'type':_0x2dfd5a[_0xbe14('0x37')]['key']};});_0x3dbacb['model']=_[_0xbe14('0x33')](_0x29356f,_0xbe14('0x32'));_0x3dbacb[_0xbe14('0x38')]=_['keys'](_0x163ef7[_0xbe14('0x38')]);_0x3dbacb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],_0x3dbacb[_0xbe14('0x38')]);_0x2bb45[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x163ef7['query'][_0xbe14('0x3d')]));_0x2bb45[_0xbe14('0x3c')]=_0x2bb45[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2bb45[_0xbe14('0x3c')]:_0x3dbacb[_0xbe14('0x3b')];if(!_0x163ef7['query'][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x2bb45[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x163ef7['query']['limit']);_0x2bb45[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x163ef7[_0xbe14('0x38')]['offset']);}_0x2bb45['order']=qs[_0xbe14('0x41')](_0x163ef7['query']['sort']);_0x2bb45[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x163ef7['query'],_0x3dbacb['filters']));if(_0x163ef7['query'][_0xbe14('0x44')]){_0x2bb45[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x2bb45['where'],{'$or':_[_0xbe14('0x33')](_0x29356f,function(_0xcb0680){if(_0xcb0680[_0xbe14('0x37')]!==_0xbe14('0x46')){var _0x58351f={};_0x58351f[_0xcb0680['name']]={'$like':'%'+_0x163ef7[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x58351f;}})});}_0x2bb45=_[_0xbe14('0x45')]({},_0x2bb45,_0x163ef7[_0xbe14('0x47')]);var _0x2550dc={'where':_0x2bb45['where']};return db['ZohoConfiguration'][_0xbe14('0x27')](_0x2550dc)[_0xbe14('0x1c')](function(_0x238c60){_0x172e79[_0xbe14('0x27')]=_0x238c60;if(_0x163ef7['query'][_0xbe14('0x48')]){_0x2bb45[_0xbe14('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xbe14('0x4a')](_0x2bb45);})[_0xbe14('0x1c')](function(_0x2d6ee8){_0x172e79[_0xbe14('0x4b')]=_0x2d6ee8;return _0x172e79;})['then'](respondWithFilteredResult(_0x393f6b,_0x2bb45))['catch'](handleError(_0x393f6b,null));};exports[_0xbe14('0x4c')]=function(_0x29564b,_0x4a1a37){var _0x5acf90={'raw':![],'where':{'id':_0x29564b[_0xbe14('0x4d')]['id']}},_0xca8cdb={};_0xca8cdb[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x34')][_0xbe14('0x35')]);_0xca8cdb[_0xbe14('0x38')]=_['keys'](_0x29564b[_0xbe14('0x38')]);_0xca8cdb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],_0xca8cdb[_0xbe14('0x38')]);_0x5acf90['attributes']=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x29564b[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x5acf90[_0xbe14('0x3c')]=_0x5acf90['attributes']['length']?_0x5acf90[_0xbe14('0x3c')]:_0xca8cdb[_0xbe14('0x3b')];if(_0x29564b[_0xbe14('0x38')]['includeAll']){_0x5acf90['include']=[{'all':!![]}];}_0x5acf90=_[_0xbe14('0x45')]({},_0x5acf90,_0x29564b[_0xbe14('0x47')]);return db['ZohoConfiguration'][_0xbe14('0x4f')](_0x5acf90)[_0xbe14('0x1c')](handleEntityNotFound(_0x4a1a37,null))['then'](respondWithResult(_0x4a1a37,null))[_0xbe14('0x50')](handleError(_0x4a1a37,null));};exports['create']=function(_0x41ba58,_0x410c59){return db[_0xbe14('0x34')]['create'](_0x41ba58[_0xbe14('0x51')],{})[_0xbe14('0x1c')](respondWithResult(_0x410c59,0xc9))['catch'](handleError(_0x410c59,null));};exports[_0xbe14('0x30')]=function(_0x42ca15,_0x2210cc){if(_0x42ca15[_0xbe14('0x51')]['id']){delete _0x42ca15[_0xbe14('0x51')]['id'];}return db['ZohoConfiguration'][_0xbe14('0x4f')]({'where':{'id':_0x42ca15[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x1c')](saveUpdates(_0x42ca15[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x2210cc,null))[_0xbe14('0x50')](handleError(_0x2210cc,null));};exports['destroy']=function(_0x72c875,_0x1b47a4){return db[_0xbe14('0x34')][_0xbe14('0x4f')]({'where':{'id':_0x72c875[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x1b47a4,null))[_0xbe14('0x1c')](removeEntity(_0x1b47a4,null))[_0xbe14('0x50')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x52')]=function(_0xc61103,_0x358950,_0x4bccfc){var _0x56bcd3={};var _0x58dd79={};var _0x10c0bc;var _0x1bfcbf;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0xc61103[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x358950,null))[_0xbe14('0x1c')](function(_0x22bf69){if(_0x22bf69){_0x10c0bc=_0x22bf69;_0x58dd79[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x58dd79[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0xc61103[_0xbe14('0x38')]);_0x58dd79[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x58dd79[_0xbe14('0x3b')],_0x58dd79[_0xbe14('0x38')]);_0x56bcd3[_0xbe14('0x3c')]=_['intersection'](_0x58dd79[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x56bcd3[_0xbe14('0x3c')]=_0x56bcd3[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x56bcd3[_0xbe14('0x3c')]:_0x58dd79[_0xbe14('0x3b')];_0x56bcd3[_0xbe14('0x55')]=qs['sort'](_0xc61103[_0xbe14('0x38')][_0xbe14('0x41')]);_0x56bcd3[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0xc61103['query'],_0x58dd79[_0xbe14('0x39')]));if(_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]){_0x56bcd3[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x56bcd3['where'],{'$or':_[_0xbe14('0x33')](_0x56bcd3[_0xbe14('0x3c')],function(_0x7ea146){var _0x29bb26={};_0x29bb26[_0x7ea146]={'$like':'%'+_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x29bb26;})});}_0x56bcd3=_[_0xbe14('0x45')]({},_0x56bcd3,_0xc61103[_0xbe14('0x47')]);return _0x10c0bc['getFields'](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x33c309){if(_0x33c309){_0x1bfcbf=_0x33c309[_0xbe14('0x3e')];if(!_0xc61103[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x56bcd3[_0xbe14('0x29')]=qs['limit'](_0xc61103['query'][_0xbe14('0x29')]);_0x56bcd3[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x10c0bc[_0xbe14('0x52')](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x43511e){if(_0x43511e){return _0x43511e?{'count':_0x1bfcbf,'rows':_0x43511e}:null;}})['then'](respondWithResult(_0x358950,null))['catch'](handleError(_0x358950,null));};exports[_0xbe14('0x56')]=function(_0x1c18b6,_0x29aa52,_0x57729f){var _0x76e91e={};var _0x16bca1={};var _0x105be0;var _0x1797dd;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x1c18b6[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29aa52,null))[_0xbe14('0x1c')](function(_0x3b6ef5){if(_0x3b6ef5){_0x105be0=_0x3b6ef5;_0x16bca1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x16bca1[_0xbe14('0x38')]=_['keys'](_0x1c18b6[_0xbe14('0x38')]);_0x16bca1[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],_0x16bca1[_0xbe14('0x38')]);_0x76e91e[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],qs['fields'](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x76e91e[_0xbe14('0x3c')]=_0x76e91e[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x76e91e[_0xbe14('0x3c')]:_0x16bca1['model'];_0x76e91e[_0xbe14('0x55')]=qs[_0xbe14('0x41')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x41')]);_0x76e91e['where']=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x1c18b6[_0xbe14('0x38')],_0x16bca1[_0xbe14('0x39')]));if(_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]){_0x76e91e[_0xbe14('0x42')]=_['merge'](_0x76e91e[_0xbe14('0x42')],{'$or':_['map'](_0x76e91e[_0xbe14('0x3c')],function(_0x5d85d3){var _0x389822={};_0x389822[_0x5d85d3]={'$like':'%'+_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x389822;})});}_0x76e91e=_['merge']({},_0x76e91e,_0x1c18b6[_0xbe14('0x47')]);return _0x105be0[_0xbe14('0x56')](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x546f22){if(_0x546f22){_0x1797dd=_0x546f22[_0xbe14('0x3e')];if(!_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x76e91e['limit']=qs[_0xbe14('0x29')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x29')]);_0x76e91e[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x105be0['getSubjects'](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x123f4f){if(_0x123f4f){return _0x123f4f?{'count':_0x1797dd,'rows':_0x123f4f}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x29aa52,null))['catch'](handleError(_0x29aa52,null));};exports[_0xbe14('0x57')]=function(_0x420467,_0x1ea305,_0x5bc52b){var _0xa53262={};var _0x1205d1={};var _0x47d7bb;var _0x2be969;return db['ZohoConfiguration'][_0xbe14('0x53')]({'where':{'id':_0x420467[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea305,null))['then'](function(_0x54045e){if(_0x54045e){_0x47d7bb=_0x54045e;_0x1205d1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db['ZohoField'][_0xbe14('0x35')]);_0x1205d1[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0x420467[_0xbe14('0x38')]);_0x1205d1['filters']=_['intersection'](_0x1205d1[_0xbe14('0x3b')],_0x1205d1[_0xbe14('0x38')]);_0xa53262[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x1205d1[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x420467[_0xbe14('0x38')]['fields']));_0xa53262[_0xbe14('0x3c')]=_0xa53262['attributes'][_0xbe14('0x3e')]?_0xa53262[_0xbe14('0x3c')]:_0x1205d1[_0xbe14('0x3b')];_0xa53262[_0xbe14('0x55')]=qs['sort'](_0x420467[_0xbe14('0x38')][_0xbe14('0x41')]);_0xa53262[_0xbe14('0x42')]=qs['filters'](_[_0xbe14('0x43')](_0x420467[_0xbe14('0x38')],_0x1205d1[_0xbe14('0x39')]));if(_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]){_0xa53262[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0xa53262[_0xbe14('0x42')],{'$or':_[_0xbe14('0x33')](_0xa53262[_0xbe14('0x3c')],function(_0x2bf94c){var _0x49497e={};_0x49497e[_0x2bf94c]={'$like':'%'+_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x49497e;})});}_0xa53262=_[_0xbe14('0x45')]({},_0xa53262,_0x420467[_0xbe14('0x47')]);return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x1679bd){if(_0x1679bd){_0x2be969=_0x1679bd[_0xbe14('0x3e')];if(!_0x420467['query'][_0xbe14('0x3f')]('nolimit')){_0xa53262[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x420467[_0xbe14('0x38')][_0xbe14('0x29')]);_0xa53262[_0xbe14('0x28')]=qs['offset'](_0x420467['query'][_0xbe14('0x28')]);}return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x42b849){if(_0x42b849){return _0x42b849?{'count':_0x2be969,'rows':_0x42b849}:null;}})['then'](respondWithResult(_0x1ea305,null))[_0xbe14('0x50')](handleError(_0x1ea305,null));}; \ No newline at end of file +var _0x9957=['result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0xaa42bb,_0x233035){var _0x640bec=function(_0xda9f5c){while(--_0xda9f5c){_0xaa42bb['push'](_0xaa42bb['shift']());}};_0x640bec(++_0x233035);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){_0x510841['status'](0xcc)[_0x7995('0x2d')]();});}};}function handleEntityNotFound(_0x3acfc3,_0x4a176f){return function(_0x3e7020){if(!_0x3e7020){_0x3acfc3['sendStatus'](0x194);}return _0x3e7020;};}function handleError(_0x37917b,_0x1cb058){_0x1cb058=_0x1cb058||0x1f4;return function(_0x177cb4){logger['error'](_0x177cb4['stack']);if(_0x177cb4[_0x7995('0x36')]){delete _0x177cb4['name'];}_0x37917b['status'](_0x1cb058)[_0x7995('0x37')](_0x177cb4);};}exports[_0x7995('0x38')]=function(_0x5212ff,_0x1baa15){var _0x1922b4={},_0x2b772f={},_0x18667c={'count':0x0,'rows':[]};var _0x1e3dbf=_['map'](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0xf612e6){return{'name':_0xf612e6[_0x7995('0x3b')],'type':_0xf612e6['type'][_0x7995('0x3c')]};});_0x2b772f[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x1e3dbf,_0x7995('0x36'));_0x2b772f[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x5212ff['query']);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],_0x2b772f[_0x7995('0x3f')]);_0x1922b4[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],qs[_0x7995('0x44')](_0x5212ff[_0x7995('0x3f')][_0x7995('0x44')]));_0x1922b4[_0x7995('0x43')]=_0x1922b4[_0x7995('0x43')][_0x7995('0x45')]?_0x1922b4['attributes']:_0x2b772f['model'];if(!_0x5212ff[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x1922b4['limit']=qs[_0x7995('0x47')](_0x5212ff['query']['limit']);_0x1922b4[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x5212ff[_0x7995('0x3f')]['offset']);}_0x1922b4[_0x7995('0x48')]=qs['sort'](_0x5212ff[_0x7995('0x3f')]['sort']);_0x1922b4['where']=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x5212ff[_0x7995('0x3f')],_0x2b772f[_0x7995('0x41')]));if(_0x5212ff['query'][_0x7995('0x4a')]){_0x1922b4[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x1922b4[_0x7995('0x4b')],{'$or':_['map'](_0x1e3dbf,function(_0x5f28e7){if(_0x5f28e7[_0x7995('0x4d')]!=='VIRTUAL'){var _0x23c41d={};_0x23c41d[_0x5f28e7['name']]={'$like':'%'+_0x5212ff[_0x7995('0x3f')]['filter']+'%'};return _0x23c41d;}})});}_0x1922b4=_[_0x7995('0x4c')]({},_0x1922b4,_0x5212ff[_0x7995('0x4e')]);var _0x4d9245={'where':_0x1922b4[_0x7995('0x4b')]};return db[_0x7995('0x39')][_0x7995('0x2f')](_0x4d9245)[_0x7995('0x20')](function(_0x4c6837){_0x18667c[_0x7995('0x2f')]=_0x4c6837;if(_0x5212ff[_0x7995('0x3f')][_0x7995('0x4f')]){_0x1922b4['include']=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x1922b4);})[_0x7995('0x20')](function(_0x3d8ae3){_0x18667c[_0x7995('0x51')]=_0x3d8ae3;return _0x18667c;})['then'](respondWithFilteredResult(_0x1baa15,_0x1922b4))[_0x7995('0x2a')](handleError(_0x1baa15,null));};exports[_0x7995('0x52')]=function(_0x5921b9,_0x3d1dbb){var _0x5843ba={'raw':![],'where':{'id':_0x5921b9[_0x7995('0x53')]['id']}},_0x1d87f9={};_0x1d87f9[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x39')][_0x7995('0x3a')]);_0x1d87f9[_0x7995('0x3f')]=_['keys'](_0x5921b9[_0x7995('0x3f')]);_0x1d87f9[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1d87f9['model'],_0x1d87f9[_0x7995('0x3f')]);_0x5843ba[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1d87f9['model'],qs['fields'](_0x5921b9['query'][_0x7995('0x44')]));_0x5843ba[_0x7995('0x43')]=_0x5843ba['attributes'][_0x7995('0x45')]?_0x5843ba[_0x7995('0x43')]:_0x1d87f9[_0x7995('0x3d')];if(_0x5921b9[_0x7995('0x3f')][_0x7995('0x4f')]){_0x5843ba['include']=[{'all':!![]}];}_0x5843ba=_[_0x7995('0x4c')]({},_0x5843ba,_0x5921b9['options']);return db[_0x7995('0x39')][_0x7995('0x54')](_0x5843ba)[_0x7995('0x20')](handleEntityNotFound(_0x3d1dbb,null))['then'](respondWithResult(_0x3d1dbb,null))['catch'](handleError(_0x3d1dbb,null));};exports['create']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x39')][_0x7995('0x55')](_0x563f8e[_0x7995('0x56')],{})[_0x7995('0x20')](respondWithResult(_0x2e13b0,0xc9))[_0x7995('0x2a')](handleError(_0x2e13b0,null));};exports[_0x7995('0x35')]=function(_0xda6ce8,_0x328671){if(_0xda6ce8[_0x7995('0x56')]['id']){delete _0xda6ce8[_0x7995('0x56')]['id'];}return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0xda6ce8[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x328671,null))[_0x7995('0x20')](saveUpdates(_0xda6ce8[_0x7995('0x56')],null))[_0x7995('0x20')](respondWithResult(_0x328671,null))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['destroy']=function(_0x56a374,_0x630737){return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0x56a374['params']['id']}})['then'](handleEntityNotFound(_0x630737,null))[_0x7995('0x20')](removeEntity(_0x630737,null))[_0x7995('0x2a')](handleError(_0x630737,null));};exports[_0x7995('0x57')]=function(_0x332a85,_0x51c50b,_0x13cd7b){var _0x74ff38={};var _0xef5044={};var _0x33c49c;var _0x502d43;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x332a85[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x51c50b,null))[_0x7995('0x20')](function(_0x37072){if(_0x37072){_0x33c49c=_0x37072;_0xef5044[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0xef5044['query']=_[_0x7995('0x40')](_0x332a85[_0x7995('0x3f')]);_0xef5044[_0x7995('0x41')]=_[_0x7995('0x42')](_0xef5044['model'],_0xef5044['query']);_0x74ff38[_0x7995('0x43')]=_[_0x7995('0x42')](_0xef5044['model'],qs[_0x7995('0x44')](_0x332a85[_0x7995('0x3f')][_0x7995('0x44')]));_0x74ff38[_0x7995('0x43')]=_0x74ff38[_0x7995('0x43')]['length']?_0x74ff38[_0x7995('0x43')]:_0xef5044['model'];_0x74ff38[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x332a85[_0x7995('0x3f')][_0x7995('0x5a')]);_0x74ff38[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x332a85[_0x7995('0x3f')],_0xef5044[_0x7995('0x41')]));if(_0x332a85[_0x7995('0x3f')][_0x7995('0x4a')]){_0x74ff38[_0x7995('0x4b')]=_['merge'](_0x74ff38[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x74ff38[_0x7995('0x43')],function(_0xc2b660){var _0x2c6548={};_0x2c6548[_0xc2b660]={'$like':'%'+_0x332a85['query']['filter']+'%'};return _0x2c6548;})});}_0x74ff38=_[_0x7995('0x4c')]({},_0x74ff38,_0x332a85[_0x7995('0x4e')]);return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})[_0x7995('0x20')](function(_0x5aa2ec){if(_0x5aa2ec){_0x502d43=_0x5aa2ec[_0x7995('0x45')];if(!_0x332a85['query']['hasOwnProperty'](_0x7995('0x5b'))){_0x74ff38[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x332a85[_0x7995('0x3f')][_0x7995('0x47')]);_0x74ff38[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x332a85[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})['then'](function(_0x2dc1f7){if(_0x2dc1f7){return _0x2dc1f7?{'count':_0x502d43,'rows':_0x2dc1f7}:null;}})[_0x7995('0x20')](respondWithResult(_0x51c50b,null))[_0x7995('0x2a')](handleError(_0x51c50b,null));};exports['getSubjects']=function(_0x1fe1cb,_0x1d2f9d,_0x705f0){var _0x3a7d9d={};var _0x3b0d30={};var _0x51ab1e;var _0x550a10;return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x1fe1cb[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d2f9d,null))['then'](function(_0x5e8b4c){if(_0x5e8b4c){_0x51ab1e=_0x5e8b4c;_0x3b0d30[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0x3b0d30['query']=_[_0x7995('0x40')](_0x1fe1cb[_0x7995('0x3f')]);_0x3b0d30['filters']=_['intersection'](_0x3b0d30[_0x7995('0x3d')],_0x3b0d30[_0x7995('0x3f')]);_0x3a7d9d['attributes']=_[_0x7995('0x42')](_0x3b0d30['model'],qs[_0x7995('0x44')](_0x1fe1cb[_0x7995('0x3f')]['fields']));_0x3a7d9d['attributes']=_0x3a7d9d[_0x7995('0x43')]['length']?_0x3a7d9d[_0x7995('0x43')]:_0x3b0d30[_0x7995('0x3d')];_0x3a7d9d[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x5a')]);_0x3a7d9d[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x1fe1cb[_0x7995('0x3f')],_0x3b0d30[_0x7995('0x41')]));if(_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]){_0x3a7d9d[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x3a7d9d[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x3a7d9d[_0x7995('0x43')],function(_0x2ff7ba){var _0xa2fc8e={};_0xa2fc8e[_0x2ff7ba]={'$like':'%'+_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]+'%'};return _0xa2fc8e;})});}_0x3a7d9d=_[_0x7995('0x4c')]({},_0x3a7d9d,_0x1fe1cb[_0x7995('0x4e')]);return _0x51ab1e[_0x7995('0x5c')](_0x3a7d9d);}})[_0x7995('0x20')](function(_0x2f7f51){if(_0x2f7f51){_0x550a10=_0x2f7f51[_0x7995('0x45')];if(!_0x1fe1cb['query'][_0x7995('0x46')](_0x7995('0x5b'))){_0x3a7d9d['limit']=qs['limit'](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x47')]);_0x3a7d9d[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x51ab1e['getSubjects'](_0x3a7d9d);}})[_0x7995('0x20')](function(_0xb68962){if(_0xb68962){return _0xb68962?{'count':_0x550a10,'rows':_0xb68962}:null;}})[_0x7995('0x20')](respondWithResult(_0x1d2f9d,null))[_0x7995('0x2a')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x5d')]=function(_0x3f0bff,_0x151d99,_0xc93dcb){var _0x560095={};var _0x1c8e7d={};var _0x2b8217;var _0x5c04c9;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x3f0bff[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x151d99,null))[_0x7995('0x20')](function(_0xe42797){if(_0xe42797){_0x2b8217=_0xe42797;_0x1c8e7d['model']=_[_0x7995('0x40')](db[_0x7995('0x59')]['rawAttributes']);_0x1c8e7d[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x3f0bff['query']);_0x1c8e7d[_0x7995('0x41')]=_['intersection'](_0x1c8e7d[_0x7995('0x3d')],_0x1c8e7d[_0x7995('0x3f')]);_0x560095[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1c8e7d[_0x7995('0x3d')],qs['fields'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x44')]));_0x560095[_0x7995('0x43')]=_0x560095['attributes'][_0x7995('0x45')]?_0x560095[_0x7995('0x43')]:_0x1c8e7d[_0x7995('0x3d')];_0x560095[_0x7995('0x48')]=qs['sort'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x5a')]);_0x560095[_0x7995('0x4b')]=qs['filters'](_['pick'](_0x3f0bff[_0x7995('0x3f')],_0x1c8e7d[_0x7995('0x41')]));if(_0x3f0bff['query']['filter']){_0x560095[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x560095[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x560095[_0x7995('0x43')],function(_0x551b5e){var _0x56003d={};_0x56003d[_0x551b5e]={'$like':'%'+_0x3f0bff[_0x7995('0x3f')]['filter']+'%'};return _0x56003d;})});}_0x560095=_['merge']({},_0x560095,_0x3f0bff[_0x7995('0x4e')]);return _0x2b8217[_0x7995('0x5d')](_0x560095);}})[_0x7995('0x20')](function(_0x5eb360){if(_0x5eb360){_0x5c04c9=_0x5eb360[_0x7995('0x45')];if(!_0x3f0bff[_0x7995('0x3f')][_0x7995('0x46')](_0x7995('0x5b'))){_0x560095[_0x7995('0x47')]=qs['limit'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x47')]);_0x560095[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x3f0bff['query'][_0x7995('0x30')]);}return _0x2b8217[_0x7995('0x5d')](_0x560095);}})['then'](function(_0x310272){if(_0x310272){return _0x310272?{'count':_0x5c04c9,'rows':_0x310272}:null;}})[_0x7995('0x20')](respondWithResult(_0x151d99,null))['catch'](handleError(_0x151d99,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index b1c7fe6..2aaa725 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 _0xbb03=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x347a27,_0x1fafd5){var _0x209d86=function(_0x3fbbb6){while(--_0x3fbbb6){_0x347a27['push'](_0x347a27['shift']());}};_0x209d86(++_0x1fafd5);}(_0xbb03,0x16f));var _0x3bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb03[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3bb0('0x0'));var util=require(_0x3bb0('0x1'));var logger=require(_0x3bb0('0x2'))(_0x3bb0('0x3'));var moment=require('moment');var BPromise=require(_0x3bb0('0x4'));var rp=require(_0x3bb0('0x5'));var fs=require('fs');var path=require(_0x3bb0('0x6'));var rimraf=require(_0x3bb0('0x7'));var config=require(_0x3bb0('0x8'));var attributes=require(_0x3bb0('0x9'));module[_0x3bb0('0xa')]=function(_0x5ed274,_0x5b3ebf){return _0x5ed274[_0x3bb0('0xb')](_0x3bb0('0xc'),attributes,{'tableName':_0x3bb0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbae9=['../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration','int_zoho_configurations','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x1709d0,_0x154964){var _0x453e7d=function(_0x2c508d){while(--_0x2c508d){_0x1709d0['push'](_0x1709d0['shift']());}};_0x453e7d(++_0x154964);}(_0xbae9,0xf7));var _0x9bae=function(_0x4cee4b,_0x1dfff3){_0x4cee4b=_0x4cee4b-0x0;var _0x4d891d=_0xbae9[_0x4cee4b];return _0x4d891d;};'use strict';var _=require('lodash');var util=require(_0x9bae('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9bae('0x1'));var BPromise=require(_0x9bae('0x2'));var rp=require(_0x9bae('0x3'));var fs=require('fs');var path=require(_0x9bae('0x4'));var rimraf=require(_0x9bae('0x5'));var config=require(_0x9bae('0x6'));var attributes=require(_0x9bae('0x7'));module['exports']=function(_0x373a1d,_0x716f79){return _0x373a1d[_0x9bae('0x8')](_0x9bae('0x9'),attributes,{'tableName':_0x9bae('0xa'),'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 8359a92..2040dd2 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 _0xb621=['ZohoConfiguration,\x20%s,\x20%s','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x28c690,_0x2a9d29){var _0x22828f=function(_0xea8bf8){while(--_0xea8bf8){_0x28c690['push'](_0x28c690['shift']());}};_0x22828f(++_0x2a9d29);}(_0xb621,0x15c));var _0x1b62=function(_0x1f63a7,_0x2912c6){_0x1f63a7=_0x1f63a7-0x0;var _0x401ebc=_0xb621[_0x1f63a7];return _0x401ebc;};'use strict';var _=require('lodash');var util=require(_0x1b62('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b62('0x1'));var fs=require('fs');var Redis=require(_0x1b62('0x2'));var db=require(_0x1b62('0x3'))['db'];var utils=require(_0x1b62('0x4'));var logger=require(_0x1b62('0x5'))(_0x1b62('0x6'));var config=require(_0x1b62('0x7'));var jayson=require(_0x1b62('0x8'));var client=jayson[_0x1b62('0x9')][_0x1b62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x374da3,_0x155d00,_0x4bf952){return new BPromise(function(_0x44fa87,_0x37b729){return client[_0x1b62('0xb')](_0x374da3,_0x4bf952)['then'](function(_0x27e55b){logger[_0x1b62('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x155d00,'request\x20sent');logger[_0x1b62('0xd')](_0x1b62('0xe'),_0x155d00,_0x1b62('0xf'),JSON[_0x1b62('0x10')](_0x27e55b));if(_0x27e55b[_0x1b62('0x11')]){if(_0x27e55b[_0x1b62('0x11')][_0x1b62('0x12')]===0x1f4){logger[_0x1b62('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x155d00,_0x27e55b[_0x1b62('0x11')][_0x1b62('0x13')]);return _0x37b729(_0x27e55b[_0x1b62('0x11')][_0x1b62('0x13')]);}logger[_0x1b62('0x11')](_0x1b62('0x14'),_0x155d00,_0x27e55b[_0x1b62('0x11')]['message']);return _0x44fa87(_0x27e55b['error']['message']);}else{logger[_0x1b62('0xc')](_0x1b62('0x14'),_0x155d00,_0x1b62('0xf'));_0x44fa87(_0x27e55b[_0x1b62('0x15')][_0x1b62('0x13')]);}})[_0x1b62('0x16')](function(_0x2108fe){logger[_0x1b62('0x11')](_0x1b62('0x14'),_0x155d00,_0x2108fe);_0x37b729(_0x2108fe);});});} \ No newline at end of file +var _0x5bb4=['ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','moment','ioredis','../../config/logger','rpc','client','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x20c870,_0x31ef03){var _0x2063d6=function(_0xd2dcba){while(--_0xd2dcba){_0x20c870['push'](_0x20c870['shift']());}};_0x2063d6(++_0x31ef03);}(_0x5bb4,0x181));var _0x45bb=function(_0x323f68,_0x1f6939){_0x323f68=_0x323f68-0x0;var _0x1cb912=_0x5bb4[_0x323f68];return _0x1cb912;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x45bb('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45bb('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x45bb('0x2'))(_0x45bb('0x3'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x45bb('0x4')][_0x45bb('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x1f0c67,_0x2d2611,_0xdd0724){return new BPromise(function(_0x1d7a27,_0x190017){return client[_0x45bb('0x6')](_0x1f0c67,_0xdd0724)[_0x45bb('0x7')](function(_0x3d4372){logger['info'](_0x45bb('0x8'),_0x2d2611,_0x45bb('0x9'));logger[_0x45bb('0xa')](_0x45bb('0xb'),_0x2d2611,_0x45bb('0x9'),JSON[_0x45bb('0xc')](_0x3d4372));if(_0x3d4372[_0x45bb('0xd')]){if(_0x3d4372[_0x45bb('0xd')][_0x45bb('0xe')]===0x1f4){logger[_0x45bb('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d2611,_0x3d4372[_0x45bb('0xd')][_0x45bb('0xf')]);return _0x190017(_0x3d4372['error'][_0x45bb('0xf')]);}logger[_0x45bb('0xd')](_0x45bb('0x8'),_0x2d2611,_0x3d4372['error']['message']);return _0x1d7a27(_0x3d4372[_0x45bb('0xd')]['message']);}else{logger[_0x45bb('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x2d2611,_0x45bb('0x9'));_0x1d7a27(_0x3d4372['result'][_0x45bb('0xf')]);}})[_0x45bb('0x11')](function(_0x1eb881){logger[_0x45bb('0xd')](_0x45bb('0x8'),_0x2d2611,_0x1eb881);_0x190017(_0x1eb881);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 698d401..13dc5b4 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 _0x2ef3=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x2155a2,_0xe57216){var _0x3e8f03=function(_0x6f8db4){while(--_0x6f8db4){_0x2155a2['push'](_0x2155a2['shift']());}};_0x3e8f03(++_0xe57216);}(_0x2ef3,0xba));var _0x32ef=function(_0x5239b2,_0x57d618){_0x5239b2=_0x5239b2-0x0;var _0x2d0358=_0x2ef3[_0x5239b2];return _0x2d0358;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./intZohoField.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0xc')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['delete']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router; \ No newline at end of file +var _0x8e3f=['update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZohoField.controller','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x8e3f[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var path=require(_0xf8e3('0x2'));var timeout=require('connect-timeout');var express=require(_0xf8e3('0x3'));var router=express[_0xf8e3('0x4')]();var auth=require(_0xf8e3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf8e3('0x6'));var controller=require(_0xf8e3('0x7'));router['get']('/',auth[_0xf8e3('0x8')](),controller[_0xf8e3('0x9')]);router[_0xf8e3('0xa')](_0xf8e3('0xb'),auth['isAuthenticated'](),controller[_0xf8e3('0xc')]);router[_0xf8e3('0xd')]('/',auth[_0xf8e3('0x8')](),controller[_0xf8e3('0xe')]);router[_0xf8e3('0xf')](_0xf8e3('0xb'),auth[_0xf8e3('0x8')](),controller[_0xf8e3('0x10')]);router[_0xf8e3('0x11')](_0xf8e3('0xb'),auth[_0xf8e3('0x8')](),controller[_0xf8e3('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 21a47a2..2e555f6 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 _0xc765=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x47e915,_0x4afe78){var _0x3f6ccf=function(_0x37cb30){while(--_0x37cb30){_0x47e915['push'](_0x47e915['shift']());}};_0x3f6ccf(++_0x4afe78);}(_0xc765,0xf5));var _0x5c76=function(_0x414367,_0x1bd4ef){_0x414367=_0x414367-0x0;var _0x5f237c=_0xc765[_0x414367];return _0x5f237c;};'use strict';var Sequelize=require(_0x5c76('0x0'));module[_0x5c76('0x1')]={'type':{'type':Sequelize[_0x5c76('0x2')](_0x5c76('0x3'),_0x5c76('0x4'),_0x5c76('0x5'),_0x5c76('0x6')),'defaultValue':_0x5c76('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5c76('0x7')]},'keyType':{'type':Sequelize[_0x5c76('0x2')](_0x5c76('0x3'),_0x5c76('0x4'),_0x5c76('0x5'))},'keyContent':{'type':Sequelize[_0x5c76('0x7')]},'idField':{'type':Sequelize[_0x5c76('0x7')]},'nameField':{'type':Sequelize[_0x5c76('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c76('0x7')]}}; \ No newline at end of file +var _0xa7b4=['customVariable','STRING','BOOLEAN','exports','ENUM','variable'];(function(_0x43f407,_0x4ad0b3){var _0x5eec27=function(_0x2799e0){while(--_0x2799e0){_0x43f407['push'](_0x43f407['shift']());}};_0x5eec27(++_0x4ad0b3);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x1de9ed,_0x4ff7e1){_0x1de9ed=_0x1de9ed-0x0;var _0x31a0c9=_0xa7b4[_0x1de9ed];return _0x31a0c9;};'use strict';var Sequelize=require('sequelize');module[_0x4a7b('0x0')]={'type':{'type':Sequelize[_0x4a7b('0x1')]('string',_0x4a7b('0x2'),_0x4a7b('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4a7b('0x4')]},'keyType':{'type':Sequelize[_0x4a7b('0x1')]('string',_0x4a7b('0x2'),_0x4a7b('0x3'))},'keyContent':{'type':Sequelize[_0x4a7b('0x4')]},'idField':{'type':Sequelize[_0x4a7b('0x4')]},'nameField':{'type':Sequelize[_0x4a7b('0x4')]},'customField':{'type':Sequelize[_0x4a7b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4a7b('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 3605c2e..8cf3a47 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 _0x683d=['find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','destroy','name','send','ZohoField','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','show','params','catch','create','body'];(function(_0xc04537,_0x5c1457){var _0x2271c0=function(_0x1307d4){while(--_0x1307d4){_0xc04537['push'](_0xc04537['shift']());}};_0x2271c0(++_0x5c1457);}(_0x683d,0x169));var _0xd683=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x683d[_0x3e6d5d];return _0x238923;};'use strict';var pdf=require(_0xd683('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd683('0x1'));var zipdir=require(_0xd683('0x2'));var jsonpatch=require(_0xd683('0x3'));var rp=require(_0xd683('0x4'));var moment=require(_0xd683('0x5'));var BPromise=require(_0xd683('0x6'));var Mustache=require(_0xd683('0x7'));var util=require('util');var path=require(_0xd683('0x8'));var sox=require(_0xd683('0x9'));var csv=require('to-csv');var ejs=require(_0xd683('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd683('0xb'));var crypto=require(_0xd683('0xc'));var jsforce=require(_0xd683('0xd'));var deskjs=require(_0xd683('0xe'));var toCsv=require(_0xd683('0xf'));var querystring=require(_0xd683('0x10'));var Papa=require('papaparse');var Redis=require(_0xd683('0x11'));var authService=require(_0xd683('0x12'));var qs=require(_0xd683('0x13'));var as=require(_0xd683('0x14'));var hardwareService=require(_0xd683('0x15'));var logger=require(_0xd683('0x16'))(_0xd683('0x17'));var utils=require('../../config/utils');var config=require(_0xd683('0x18'));var db=require(_0xd683('0x19'))['db'];function respondWithStatusCode(_0x15ac9a,_0x150ffd){_0x150ffd=_0x150ffd||0xcc;return function(_0x3d1d27){if(_0x3d1d27){return _0x15ac9a[_0xd683('0x1a')](_0x150ffd);}return _0x15ac9a[_0xd683('0x1b')](_0x150ffd)['end']();};}function respondWithResult(_0xd8a0c3,_0x11d814){_0x11d814=_0x11d814||0xc8;return function(_0x4fddc7){if(_0x4fddc7){return _0xd8a0c3['status'](_0x11d814)[_0xd683('0x1c')](_0x4fddc7);}};}function respondWithFilteredResult(_0x2af4a6,_0x2977e0){return function(_0x2ae550){if(_0x2ae550){var _0x148fee=_0x2ae550['count'],_0x31fac5=_0x2977e0[_0xd683('0x1d')],_0x21f11c=_0x2977e0[_0xd683('0x1d')]+_0x2977e0[_0xd683('0x1e')],_0x88e380;if(_0x21f11c>=_0x148fee){_0x21f11c=_0x148fee;_0x88e380=0xc8;}else{_0x88e380=0xce;}_0x2af4a6[_0xd683('0x1b')](_0x88e380);return _0x2af4a6['set'](_0xd683('0x1f'),_0x31fac5+'-'+_0x21f11c+'/'+_0x148fee)['json'](_0x2ae550);}return null;};}function patchUpdates(_0x4de56b){return function(_0x34bb6e){try{jsonpatch[_0xd683('0x20')](_0x34bb6e,_0x4de56b,!![]);}catch(_0x2492e7){return BPromise[_0xd683('0x21')](_0x2492e7);}return _0x34bb6e['save']();};}function saveUpdates(_0x51e55f,_0x3be791){return function(_0xa490ef){if(_0xa490ef){return _0xa490ef[_0xd683('0x22')](_0x51e55f)[_0xd683('0x23')](function(_0x37f567){return _0x37f567;});}return null;};}function removeEntity(_0x10f019,_0x3ec3a0){return function(_0x5653a9){if(_0x5653a9){return _0x5653a9[_0xd683('0x24')]()[_0xd683('0x23')](function(){_0x10f019[_0xd683('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x136180,_0x5b5f53){return function(_0x11e5a8){if(!_0x11e5a8){_0x136180[_0xd683('0x1a')](0x194);}return _0x11e5a8;};}function handleError(_0x48af47,_0x4df04f){_0x4df04f=_0x4df04f||0x1f4;return function(_0x3fd482){logger['error'](_0x3fd482['stack']);if(_0x3fd482[_0xd683('0x25')]){delete _0x3fd482['name'];}_0x48af47['status'](_0x4df04f)[_0xd683('0x26')](_0x3fd482);};}exports['index']=function(_0x44bc91,_0x1338b6){var _0x40df30={},_0x132bde={},_0x4789cd={'count':0x0,'rows':[]};var _0x452dad=_['map'](db[_0xd683('0x27')][_0xd683('0x28')],function(_0x23166b){return{'name':_0x23166b[_0xd683('0x29')],'type':_0x23166b[_0xd683('0x2a')][_0xd683('0x2b')]};});_0x132bde['model']=_[_0xd683('0x2c')](_0x452dad,_0xd683('0x25'));_0x132bde[_0xd683('0x2d')]=_[_0xd683('0x2e')](_0x44bc91[_0xd683('0x2d')]);_0x132bde['filters']=_['intersection'](_0x132bde[_0xd683('0x2f')],_0x132bde['query']);_0x40df30[_0xd683('0x30')]=_[_0xd683('0x31')](_0x132bde['model'],qs[_0xd683('0x32')](_0x44bc91['query'][_0xd683('0x32')]));_0x40df30[_0xd683('0x30')]=_0x40df30[_0xd683('0x30')][_0xd683('0x33')]?_0x40df30[_0xd683('0x30')]:_0x132bde[_0xd683('0x2f')];if(!_0x44bc91[_0xd683('0x2d')][_0xd683('0x34')](_0xd683('0x35'))){_0x40df30[_0xd683('0x1e')]=qs['limit'](_0x44bc91['query']['limit']);_0x40df30['offset']=qs[_0xd683('0x1d')](_0x44bc91[_0xd683('0x2d')][_0xd683('0x1d')]);}_0x40df30[_0xd683('0x36')]=qs[_0xd683('0x37')](_0x44bc91[_0xd683('0x2d')][_0xd683('0x37')]);_0x40df30[_0xd683('0x38')]=qs[_0xd683('0x39')](_[_0xd683('0x3a')](_0x44bc91['query'],_0x132bde['filters']));if(_0x44bc91[_0xd683('0x2d')][_0xd683('0x3b')]){_0x40df30[_0xd683('0x38')]=_[_0xd683('0x3c')](_0x40df30['where'],{'$or':_['map'](_0x452dad,function(_0x4c3363){if(_0x4c3363[_0xd683('0x2a')]!=='VIRTUAL'){var _0x5ed02d={};_0x5ed02d[_0x4c3363[_0xd683('0x25')]]={'$like':'%'+_0x44bc91['query'][_0xd683('0x3b')]+'%'};return _0x5ed02d;}})});}_0x40df30=_[_0xd683('0x3c')]({},_0x40df30,_0x44bc91[_0xd683('0x3d')]);var _0x48d466={'where':_0x40df30['where']};return db[_0xd683('0x27')][_0xd683('0x3e')](_0x48d466)['then'](function(_0x2ebedd){_0x4789cd[_0xd683('0x3e')]=_0x2ebedd;if(_0x44bc91['query'][_0xd683('0x3f')]){_0x40df30['include']=[{'all':!![]}];}return db['ZohoField'][_0xd683('0x40')](_0x40df30);})[_0xd683('0x23')](function(_0x57eaed){_0x4789cd[_0xd683('0x41')]=_0x57eaed;return _0x4789cd;})['then'](respondWithFilteredResult(_0x1338b6,_0x40df30))['catch'](handleError(_0x1338b6,null));};exports[_0xd683('0x42')]=function(_0x38217e,_0x354aa9){var _0x3a76ae={'raw':!![],'where':{'id':_0x38217e[_0xd683('0x43')]['id']}},_0x40dc6d={};_0x40dc6d[_0xd683('0x2f')]=_[_0xd683('0x2e')](db['ZohoField'][_0xd683('0x28')]);_0x40dc6d[_0xd683('0x2d')]=_[_0xd683('0x2e')](_0x38217e[_0xd683('0x2d')]);_0x40dc6d[_0xd683('0x39')]=_['intersection'](_0x40dc6d['model'],_0x40dc6d[_0xd683('0x2d')]);_0x3a76ae[_0xd683('0x30')]=_[_0xd683('0x31')](_0x40dc6d[_0xd683('0x2f')],qs[_0xd683('0x32')](_0x38217e[_0xd683('0x2d')][_0xd683('0x32')]));_0x3a76ae[_0xd683('0x30')]=_0x3a76ae[_0xd683('0x30')][_0xd683('0x33')]?_0x3a76ae[_0xd683('0x30')]:_0x40dc6d['model'];if(_0x38217e[_0xd683('0x2d')][_0xd683('0x3f')]){_0x3a76ae['include']=[{'all':!![]}];}_0x3a76ae=_[_0xd683('0x3c')]({},_0x3a76ae,_0x38217e[_0xd683('0x3d')]);return db[_0xd683('0x27')]['find'](_0x3a76ae)['then'](handleEntityNotFound(_0x354aa9,null))[_0xd683('0x23')](respondWithResult(_0x354aa9,null))[_0xd683('0x44')](handleError(_0x354aa9,null));};exports[_0xd683('0x45')]=function(_0x1f7d4c,_0x5bc867){return db[_0xd683('0x27')]['create'](_0x1f7d4c[_0xd683('0x46')],{})[_0xd683('0x23')](respondWithResult(_0x5bc867,0xc9))['catch'](handleError(_0x5bc867,null));};exports[_0xd683('0x22')]=function(_0x42ad7c,_0x1f07ec){if(_0x42ad7c[_0xd683('0x46')]['id']){delete _0x42ad7c[_0xd683('0x46')]['id'];}return db[_0xd683('0x27')]['find']({'where':{'id':_0x42ad7c[_0xd683('0x43')]['id']}})[_0xd683('0x23')](handleEntityNotFound(_0x1f07ec,null))[_0xd683('0x23')](saveUpdates(_0x42ad7c[_0xd683('0x46')],null))[_0xd683('0x23')](respondWithResult(_0x1f07ec,null))[_0xd683('0x44')](handleError(_0x1f07ec,null));};exports[_0xd683('0x24')]=function(_0x4e3ea8,_0x594bf2){return db['ZohoField'][_0xd683('0x47')]({'where':{'id':_0x4e3ea8['params']['id']}})[_0xd683('0x23')](handleEntityNotFound(_0x594bf2,null))[_0xd683('0x23')](removeEntity(_0x594bf2,null))['catch'](handleError(_0x594bf2,null));}; \ No newline at end of file +var _0x4cd3=['json','apply','reject','save','then','destroy','end','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','update','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','limit','Content-Range'];(function(_0x5ac0b4,_0x5d5a90){var _0x14ebf0=function(_0x321430){while(--_0x321430){_0x5ac0b4['push'](_0x5ac0b4['shift']());}};_0x14ebf0(++_0x5d5a90);}(_0x4cd3,0x119));var _0x34cd=function(_0x1b51ea,_0x394fd9){_0x1b51ea=_0x1b51ea-0x0;var _0x18bbdc=_0x4cd3[_0x1b51ea];return _0x18bbdc;};'use strict';var pdf=require(_0x34cd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34cd('0x1'));var zipdir=require(_0x34cd('0x2'));var jsonpatch=require(_0x34cd('0x3'));var rp=require('request-promise');var moment=require(_0x34cd('0x4'));var BPromise=require(_0x34cd('0x5'));var Mustache=require(_0x34cd('0x6'));var util=require(_0x34cd('0x7'));var path=require('path');var sox=require(_0x34cd('0x8'));var csv=require(_0x34cd('0x9'));var ejs=require(_0x34cd('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x34cd('0xb'));var jsforce=require(_0x34cd('0xc'));var deskjs=require(_0x34cd('0xd'));var toCsv=require(_0x34cd('0x9'));var querystring=require(_0x34cd('0xe'));var Papa=require(_0x34cd('0xf'));var Redis=require(_0x34cd('0x10'));var authService=require(_0x34cd('0x11'));var qs=require(_0x34cd('0x12'));var as=require(_0x34cd('0x13'));var hardwareService=require(_0x34cd('0x14'));var logger=require(_0x34cd('0x15'))(_0x34cd('0x16'));var utils=require(_0x34cd('0x17'));var config=require(_0x34cd('0x18'));var db=require(_0x34cd('0x19'))['db'];function respondWithStatusCode(_0x260bd9,_0x51079c){_0x51079c=_0x51079c||0xcc;return function(_0x6d429c){if(_0x6d429c){return _0x260bd9[_0x34cd('0x1a')](_0x51079c);}return _0x260bd9[_0x34cd('0x1b')](_0x51079c)['end']();};}function respondWithResult(_0xbd4815,_0x358359){_0x358359=_0x358359||0xc8;return function(_0x132081){if(_0x132081){return _0xbd4815[_0x34cd('0x1b')](_0x358359)['json'](_0x132081);}};}function respondWithFilteredResult(_0x2caa39,_0x28ceb4){return function(_0x36cc01){if(_0x36cc01){var _0x262551=_0x36cc01[_0x34cd('0x1c')],_0x9e49a0=_0x28ceb4['offset'],_0x1a473f=_0x28ceb4['offset']+_0x28ceb4[_0x34cd('0x1d')],_0x192d4c;if(_0x1a473f>=_0x262551){_0x1a473f=_0x262551;_0x192d4c=0xc8;}else{_0x192d4c=0xce;}_0x2caa39[_0x34cd('0x1b')](_0x192d4c);return _0x2caa39['set'](_0x34cd('0x1e'),_0x9e49a0+'-'+_0x1a473f+'/'+_0x262551)[_0x34cd('0x1f')](_0x36cc01);}return null;};}function patchUpdates(_0x19c38b){return function(_0x476cdf){try{jsonpatch[_0x34cd('0x20')](_0x476cdf,_0x19c38b,!![]);}catch(_0x24d854){return BPromise[_0x34cd('0x21')](_0x24d854);}return _0x476cdf[_0x34cd('0x22')]();};}function saveUpdates(_0x51a214,_0x1f9adc){return function(_0x56f8f7){if(_0x56f8f7){return _0x56f8f7['update'](_0x51a214)[_0x34cd('0x23')](function(_0xbddf66){return _0xbddf66;});}return null;};}function removeEntity(_0x434c87,_0xfb66c6){return function(_0x28ef31){if(_0x28ef31){return _0x28ef31[_0x34cd('0x24')]()[_0x34cd('0x23')](function(){_0x434c87[_0x34cd('0x1b')](0xcc)[_0x34cd('0x25')]();});}};}function handleEntityNotFound(_0x1e3eac,_0x53723b){return function(_0x1e288c){if(!_0x1e288c){_0x1e3eac[_0x34cd('0x1a')](0x194);}return _0x1e288c;};}function handleError(_0x42b81e,_0x5c5703){_0x5c5703=_0x5c5703||0x1f4;return function(_0x227182){logger['error'](_0x227182[_0x34cd('0x26')]);if(_0x227182[_0x34cd('0x27')]){delete _0x227182['name'];}_0x42b81e[_0x34cd('0x1b')](_0x5c5703)[_0x34cd('0x28')](_0x227182);};}exports[_0x34cd('0x29')]=function(_0x4d4db3,_0x5bca7d){var _0x40f04b={},_0x5227cd={},_0x5bbac7={'count':0x0,'rows':[]};var _0x275eae=_[_0x34cd('0x2a')](db[_0x34cd('0x2b')][_0x34cd('0x2c')],function(_0x4140ed){return{'name':_0x4140ed[_0x34cd('0x2d')],'type':_0x4140ed[_0x34cd('0x2e')][_0x34cd('0x2f')]};});_0x5227cd[_0x34cd('0x30')]=_[_0x34cd('0x2a')](_0x275eae,_0x34cd('0x27'));_0x5227cd[_0x34cd('0x31')]=_[_0x34cd('0x32')](_0x4d4db3[_0x34cd('0x31')]);_0x5227cd[_0x34cd('0x33')]=_[_0x34cd('0x34')](_0x5227cd[_0x34cd('0x30')],_0x5227cd[_0x34cd('0x31')]);_0x40f04b[_0x34cd('0x35')]=_[_0x34cd('0x34')](_0x5227cd[_0x34cd('0x30')],qs['fields'](_0x4d4db3[_0x34cd('0x31')][_0x34cd('0x36')]));_0x40f04b['attributes']=_0x40f04b[_0x34cd('0x35')][_0x34cd('0x37')]?_0x40f04b[_0x34cd('0x35')]:_0x5227cd[_0x34cd('0x30')];if(!_0x4d4db3[_0x34cd('0x31')][_0x34cd('0x38')](_0x34cd('0x39'))){_0x40f04b['limit']=qs[_0x34cd('0x1d')](_0x4d4db3['query'][_0x34cd('0x1d')]);_0x40f04b['offset']=qs[_0x34cd('0x3a')](_0x4d4db3[_0x34cd('0x31')][_0x34cd('0x3a')]);}_0x40f04b[_0x34cd('0x3b')]=qs[_0x34cd('0x3c')](_0x4d4db3[_0x34cd('0x31')][_0x34cd('0x3c')]);_0x40f04b[_0x34cd('0x3d')]=qs[_0x34cd('0x33')](_[_0x34cd('0x3e')](_0x4d4db3['query'],_0x5227cd[_0x34cd('0x33')]));if(_0x4d4db3[_0x34cd('0x31')]['filter']){_0x40f04b[_0x34cd('0x3d')]=_[_0x34cd('0x3f')](_0x40f04b['where'],{'$or':_[_0x34cd('0x2a')](_0x275eae,function(_0x41f72d){if(_0x41f72d['type']!==_0x34cd('0x40')){var _0x3446f9={};_0x3446f9[_0x41f72d[_0x34cd('0x27')]]={'$like':'%'+_0x4d4db3[_0x34cd('0x31')][_0x34cd('0x41')]+'%'};return _0x3446f9;}})});}_0x40f04b=_[_0x34cd('0x3f')]({},_0x40f04b,_0x4d4db3[_0x34cd('0x42')]);var _0x51dfe6={'where':_0x40f04b[_0x34cd('0x3d')]};return db['ZohoField'][_0x34cd('0x1c')](_0x51dfe6)[_0x34cd('0x23')](function(_0x4cdc58){_0x5bbac7[_0x34cd('0x1c')]=_0x4cdc58;if(_0x4d4db3[_0x34cd('0x31')]['includeAll']){_0x40f04b['include']=[{'all':!![]}];}return db[_0x34cd('0x2b')][_0x34cd('0x43')](_0x40f04b);})[_0x34cd('0x23')](function(_0x230287){_0x5bbac7[_0x34cd('0x44')]=_0x230287;return _0x5bbac7;})[_0x34cd('0x23')](respondWithFilteredResult(_0x5bca7d,_0x40f04b))[_0x34cd('0x45')](handleError(_0x5bca7d,null));};exports[_0x34cd('0x46')]=function(_0x9e5b86,_0x1bd6ba){var _0x4c7929={'raw':!![],'where':{'id':_0x9e5b86[_0x34cd('0x47')]['id']}},_0x89bfc7={};_0x89bfc7['model']=_[_0x34cd('0x32')](db[_0x34cd('0x2b')][_0x34cd('0x2c')]);_0x89bfc7[_0x34cd('0x31')]=_[_0x34cd('0x32')](_0x9e5b86['query']);_0x89bfc7[_0x34cd('0x33')]=_[_0x34cd('0x34')](_0x89bfc7[_0x34cd('0x30')],_0x89bfc7[_0x34cd('0x31')]);_0x4c7929[_0x34cd('0x35')]=_['intersection'](_0x89bfc7[_0x34cd('0x30')],qs[_0x34cd('0x36')](_0x9e5b86[_0x34cd('0x31')][_0x34cd('0x36')]));_0x4c7929[_0x34cd('0x35')]=_0x4c7929[_0x34cd('0x35')][_0x34cd('0x37')]?_0x4c7929['attributes']:_0x89bfc7[_0x34cd('0x30')];if(_0x9e5b86[_0x34cd('0x31')][_0x34cd('0x48')]){_0x4c7929[_0x34cd('0x49')]=[{'all':!![]}];}_0x4c7929=_[_0x34cd('0x3f')]({},_0x4c7929,_0x9e5b86[_0x34cd('0x42')]);return db[_0x34cd('0x2b')][_0x34cd('0x4a')](_0x4c7929)[_0x34cd('0x23')](handleEntityNotFound(_0x1bd6ba,null))[_0x34cd('0x23')](respondWithResult(_0x1bd6ba,null))['catch'](handleError(_0x1bd6ba,null));};exports[_0x34cd('0x4b')]=function(_0x25f310,_0x942d61){return db[_0x34cd('0x2b')]['create'](_0x25f310[_0x34cd('0x4c')],{})[_0x34cd('0x23')](respondWithResult(_0x942d61,0xc9))[_0x34cd('0x45')](handleError(_0x942d61,null));};exports[_0x34cd('0x4d')]=function(_0x5e19b2,_0xedec53){if(_0x5e19b2[_0x34cd('0x4c')]['id']){delete _0x5e19b2['body']['id'];}return db[_0x34cd('0x2b')]['find']({'where':{'id':_0x5e19b2[_0x34cd('0x47')]['id']}})[_0x34cd('0x23')](handleEntityNotFound(_0xedec53,null))[_0x34cd('0x23')](saveUpdates(_0x5e19b2[_0x34cd('0x4c')],null))[_0x34cd('0x23')](respondWithResult(_0xedec53,null))['catch'](handleError(_0xedec53,null));};exports[_0x34cd('0x24')]=function(_0x5e18d0,_0x5bf722){return db[_0x34cd('0x2b')][_0x34cd('0x4a')]({'where':{'id':_0x5e18d0[_0x34cd('0x47')]['id']}})[_0x34cd('0x23')](handleEntityNotFound(_0x5bf722,null))[_0x34cd('0x23')](removeEntity(_0x5bf722,null))[_0x34cd('0x45')](handleError(_0x5bf722,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 6b7736e..ac9eaf6 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 _0xaf7e=['define','ZohoField','zoho_unique_index','idField','FieldId','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes'];(function(_0x39617c,_0x59b064){var _0x471d30=function(_0x1e49b9){while(--_0x1e49b9){_0x39617c['push'](_0x39617c['shift']());}};_0x471d30(++_0x59b064);}(_0xaf7e,0x16d));var _0xeaf7=function(_0x255d29,_0x9088c7){_0x255d29=_0x255d29-0x0;var _0x44b25b=_0xaf7e[_0x255d29];return _0x44b25b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeaf7('0x0'))(_0xeaf7('0x1'));var moment=require(_0xeaf7('0x2'));var BPromise=require('bluebird');var rp=require(_0xeaf7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeaf7('0x4'));var config=require(_0xeaf7('0x5'));var attributes=require(_0xeaf7('0x6'));module['exports']=function(_0x4eaa02,_0x1b2501){return _0x4eaa02[_0xeaf7('0x7')](_0xeaf7('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xeaf7('0x9'),'fields':[_0xeaf7('0xa'),_0xeaf7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbc31=['../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x50689f,_0x4b6fe1){var _0x201123=function(_0x1e7350){while(--_0x1e7350){_0x50689f['push'](_0x50689f['shift']());}};_0x201123(++_0x4b6fe1);}(_0xbc31,0xbd));var _0x1bc3=function(_0x5cee4f,_0xa03d7c){_0x5cee4f=_0x5cee4f-0x0;var _0x1721be=_0xbc31[_0x5cee4f];return _0x1721be;};'use strict';var _=require(_0x1bc3('0x0'));var util=require(_0x1bc3('0x1'));var logger=require(_0x1bc3('0x2'))(_0x1bc3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1bc3('0x4'));var fs=require('fs');var path=require(_0x1bc3('0x5'));var rimraf=require(_0x1bc3('0x6'));var config=require(_0x1bc3('0x7'));var attributes=require(_0x1bc3('0x8'));module[_0x1bc3('0x9')]=function(_0x1741f2,_0x31f359){return _0x1741f2['define'](_0x1bc3('0xa'),attributes,{'tableName':_0x1bc3('0xb'),'paranoid':![],'indexes':[{'name':_0x1bc3('0xc'),'fields':[_0x1bc3('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index e6c338b..1d39620 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 _0x0a9a=['ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1830ce,_0x305798){var _0x2bce9f=function(_0x9ea7dc){while(--_0x9ea7dc){_0x1830ce['push'](_0x1830ce['shift']());}};_0x2bce9f(++_0x305798);}(_0x0a9a,0x183));var _0xa0a9=function(_0x521ed0,_0x191b80){_0x521ed0=_0x521ed0-0x0;var _0x45430b=_0x0a9a[_0x521ed0];return _0x45430b;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('ZohoField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('ZohoField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file +var _0x5fd1=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash'];(function(_0x2e64e9,_0x107675){var _0x53e2ca=function(_0x14a1a9){while(--_0x14a1a9){_0x2e64e9['push'](_0x2e64e9['shift']());}};_0x53e2ca(++_0x107675);}(_0x5fd1,0x155));var _0x15fd=function(_0x4b7090,_0x4369b0){_0x4b7090=_0x4b7090-0x0;var _0x16fdf6=_0x5fd1[_0x4b7090];return _0x16fdf6;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var moment=require(_0x15fd('0x1'));var BPromise=require(_0x15fd('0x2'));var rs=require(_0x15fd('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x15fd('0x4'));var logger=require(_0x15fd('0x5'))(_0x15fd('0x6'));var config=require('../../config/environment');var jayson=require(_0x15fd('0x7'));var client=jayson[_0x15fd('0x8')][_0x15fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e88bf,_0x225728,_0x534e63){return new BPromise(function(_0x210e90,_0x1ee117){return client[_0x15fd('0xa')](_0x2e88bf,_0x534e63)['then'](function(_0x2d2fbb){logger['info'](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x225728,'request\x20sent',JSON[_0x15fd('0xd')](_0x2d2fbb));if(_0x2d2fbb[_0x15fd('0xe')]){if(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0xf')]===0x1f4){logger[_0x15fd('0xe')](_0x15fd('0xb'),_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x1ee117(_0x2d2fbb[_0x15fd('0xe')]['message']);}logger['error']('ZohoField,\x20%s,\x20%s',_0x225728,_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);return _0x210e90(_0x2d2fbb[_0x15fd('0xe')][_0x15fd('0x10')]);}else{logger[_0x15fd('0x11')](_0x15fd('0xb'),_0x225728,_0x15fd('0xc'));_0x210e90(_0x2d2fbb[_0x15fd('0x12')]['message']);}})['catch'](function(_0x25f139){logger['error'](_0x15fd('0xb'),_0x225728,_0x25f139);_0x1ee117(_0x25f139);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 794c011..1e044e0 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 _0x1863=['multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x1863,0x1b2));var _0x3186=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x1863[_0x10b317];return _0x1e3054;};'use strict';var multer=require(_0x3186('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3186('0x1'));var router=express[_0x3186('0x2')]();var auth=require(_0x3186('0x3'));var interaction=require(_0x3186('0x4'));var config=require(_0x3186('0x5'));module[_0x3186('0x6')]=router; \ No newline at end of file +var _0x6203=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x6203,0x127));var _0x3620=function(_0x5532df,_0x5395e8){_0x5532df=_0x5532df-0x0;var _0x15e9aa=_0x6203[_0x5532df];return _0x15e9aa;};'use strict';var multer=require(_0x3620('0x0'));var util=require(_0x3620('0x1'));var path=require(_0x3620('0x2'));var timeout=require(_0x3620('0x3'));var express=require(_0x3620('0x4'));var router=express['Router']();var auth=require(_0x3620('0x5'));var interaction=require(_0x3620('0x6'));var config=require(_0x3620('0x7'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 231f500..919a523 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 _0x7ddb=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','sequelize'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x7ddb,0x1df));var _0xb7dd=function(_0x4a1571,_0x1ccb86){_0x4a1571=_0x4a1571-0x0;var _0x606fa9=_0x7ddb[_0x4a1571];return _0x606fa9;};'use strict';var Sequelize=require(_0xb7dd('0x0'));module['exports']={'name':{'type':Sequelize[_0xb7dd('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xb7dd('0x1')],'allowNull':![],'unique':_0xb7dd('0x2')},'main':{'type':Sequelize[_0xb7dd('0x1')],'defaultValue':_0xb7dd('0x3')},'filename':{'type':Sequelize[_0xb7dd('0x1')]},'path':{'type':Sequelize[_0xb7dd('0x1')]},'type':{'type':Sequelize[_0xb7dd('0x1')]},'size':{'type':Sequelize[_0xb7dd('0x4')]},'active':{'type':Sequelize[_0xb7dd('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xb7dd('0x1')]},'state':{'type':Sequelize[_0xb7dd('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xb7dd('0x1')]},'remoteUri':{'type':Sequelize[_0xb7dd('0x1')]},'link':{'type':Sequelize[_0xb7dd('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x5dcf=['sequelize','exports','STRING','unique_name_and_version','INTEGER','BOOLEAN','state'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5dcf,0x10a));var _0xf5dc=function(_0x28dd8f,_0x609d57){_0x28dd8f=_0x28dd8f-0x0;var _0x5a0c3e=_0x5dcf[_0x28dd8f];return _0x5a0c3e;};'use strict';var Sequelize=require(_0xf5dc('0x0'));module[_0xf5dc('0x1')]={'name':{'type':Sequelize[_0xf5dc('0x2')],'allowNull':![],'unique':_0xf5dc('0x3')},'version':{'type':Sequelize[_0xf5dc('0x2')],'allowNull':![],'unique':_0xf5dc('0x3')},'main':{'type':Sequelize[_0xf5dc('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xf5dc('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf5dc('0x2')]},'size':{'type':Sequelize[_0xf5dc('0x4')]},'active':{'type':Sequelize[_0xf5dc('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0xf5dc('0x2')]},'logo':{'type':Sequelize[_0xf5dc('0x2')]},'state':{'type':Sequelize[_0xf5dc('0x2')],'unique':_0xf5dc('0x6')},'description':{'type':Sequelize[_0xf5dc('0x2')]},'title':{'type':Sequelize[_0xf5dc('0x2')]},'remoteUri':{'type':Sequelize[_0xf5dc('0x2')]},'link':{'type':Sequelize[_0xf5dc('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 7edbdb7..dc32d3a 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 _0x013f=['update','then','destroy','error','stack','name','send','map','Integration','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','reject','save'];(function(_0x96dd70,_0x4c68e9){var _0x1fcf3b=function(_0x5f1829){while(--_0x5f1829){_0x96dd70['push'](_0x96dd70['shift']());}};_0x1fcf3b(++_0x4c68e9);}(_0x013f,0x1f4));var _0xf013=function(_0x40346c,_0x1a63bc){_0x40346c=_0x40346c-0x0;var _0x4ccae7=_0x013f[_0x40346c];return _0x4ccae7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf013('0x0'));var rimraf=require(_0xf013('0x1'));var zipdir=require(_0xf013('0x2'));var jsonpatch=require(_0xf013('0x3'));var rp=require(_0xf013('0x4'));var moment=require(_0xf013('0x5'));var BPromise=require(_0xf013('0x6'));var Mustache=require(_0xf013('0x7'));var util=require(_0xf013('0x8'));var path=require('path');var sox=require(_0xf013('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf013('0xa'));var squel=require('squel');var crypto=require(_0xf013('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf013('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf013('0xd'));var Redis=require(_0xf013('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf013('0xf'));var as=require(_0xf013('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf013('0x11'));var utils=require(_0xf013('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d985,_0x576d2d){_0x576d2d=_0x576d2d||0xcc;return function(_0x4f29a2){if(_0x4f29a2){return _0x10d985[_0xf013('0x13')](_0x576d2d);}return _0x10d985[_0xf013('0x14')](_0x576d2d)[_0xf013('0x15')]();};}function respondWithResult(_0x34bdd3,_0x21aa02){_0x21aa02=_0x21aa02||0xc8;return function(_0x1b3389){if(_0x1b3389){return _0x34bdd3[_0xf013('0x14')](_0x21aa02)[_0xf013('0x16')](_0x1b3389);}};}function respondWithFilteredResult(_0x935c2d,_0x183677){return function(_0x308ef6){if(_0x308ef6){var _0x58ac84=_0x308ef6['count'],_0x5a756f=_0x183677['offset'],_0x1c17da=_0x183677[_0xf013('0x17')]+_0x183677[_0xf013('0x18')],_0x3c896b;if(_0x1c17da>=_0x58ac84){_0x1c17da=_0x58ac84;_0x3c896b=0xc8;}else{_0x3c896b=0xce;}_0x935c2d[_0xf013('0x14')](_0x3c896b);return _0x935c2d['set'](_0xf013('0x19'),_0x5a756f+'-'+_0x1c17da+'/'+_0x58ac84)['json'](_0x308ef6);}return null;};}function patchUpdates(_0x1ee046){return function(_0x43f846){try{jsonpatch['apply'](_0x43f846,_0x1ee046,!![]);}catch(_0x382c7b){return BPromise[_0xf013('0x1a')](_0x382c7b);}return _0x43f846[_0xf013('0x1b')]();};}function saveUpdates(_0x5b0d32,_0x3a2515){return function(_0x44d0e8){if(_0x44d0e8){return _0x44d0e8[_0xf013('0x1c')](_0x5b0d32)[_0xf013('0x1d')](function(_0x16b814){return _0x16b814;});}return null;};}function removeEntity(_0x58147e,_0x3d66db){return function(_0x15e2c7){if(_0x15e2c7){return _0x15e2c7[_0xf013('0x1e')]()[_0xf013('0x1d')](function(){_0x58147e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e1cb0,_0x5991f7){return function(_0x178641){if(!_0x178641){_0x1e1cb0[_0xf013('0x13')](0x194);}return _0x178641;};}function handleError(_0x17a5ef,_0x321873){_0x321873=_0x321873||0x1f4;return function(_0x43598a){logger[_0xf013('0x1f')](_0x43598a[_0xf013('0x20')]);if(_0x43598a[_0xf013('0x21')]){delete _0x43598a['name'];}_0x17a5ef[_0xf013('0x14')](_0x321873)[_0xf013('0x22')](_0x43598a);};}exports['index']=function(_0x280804,_0xffe1b2){var _0x1a08cf={},_0x47e821={},_0x50304f={'count':0x0,'rows':[]};var _0x2020b4=_[_0xf013('0x23')](db[_0xf013('0x24')][_0xf013('0x25')],function(_0x24192b){return{'name':_0x24192b['fieldName'],'type':_0x24192b[_0xf013('0x26')][_0xf013('0x27')]};});_0x47e821[_0xf013('0x28')]=_['map'](_0x2020b4,_0xf013('0x21'));_0x47e821[_0xf013('0x29')]=_['keys'](_0x280804[_0xf013('0x29')]);_0x47e821[_0xf013('0x2a')]=_[_0xf013('0x2b')](_0x47e821[_0xf013('0x28')],_0x47e821[_0xf013('0x29')]);_0x1a08cf['attributes']=_[_0xf013('0x2b')](_0x47e821[_0xf013('0x28')],qs[_0xf013('0x2c')](_0x280804[_0xf013('0x29')][_0xf013('0x2c')]));_0x1a08cf['attributes']=_0x1a08cf[_0xf013('0x2d')][_0xf013('0x2e')]?_0x1a08cf[_0xf013('0x2d')]:_0x47e821['model'];if(!_0x280804[_0xf013('0x29')][_0xf013('0x2f')](_0xf013('0x30'))){_0x1a08cf[_0xf013('0x18')]=qs[_0xf013('0x18')](_0x280804[_0xf013('0x29')][_0xf013('0x18')]);_0x1a08cf[_0xf013('0x17')]=qs['offset'](_0x280804[_0xf013('0x29')][_0xf013('0x17')]);}_0x1a08cf['order']=qs['sort'](_0x280804[_0xf013('0x29')][_0xf013('0x31')]);_0x1a08cf[_0xf013('0x32')]=qs[_0xf013('0x2a')](_['pick'](_0x280804[_0xf013('0x29')],_0x47e821[_0xf013('0x2a')]));if(_0x280804[_0xf013('0x29')][_0xf013('0x33')]){_0x1a08cf[_0xf013('0x32')]=_['merge'](_0x1a08cf[_0xf013('0x32')],{'$or':_[_0xf013('0x23')](_0x2020b4,function(_0x271b12){if(_0x271b12[_0xf013('0x26')]!==_0xf013('0x34')){var _0x5435e1={};_0x5435e1[_0x271b12['name']]={'$like':'%'+_0x280804[_0xf013('0x29')]['filter']+'%'};return _0x5435e1;}})});}_0x1a08cf=_[_0xf013('0x35')]({},_0x1a08cf,_0x280804[_0xf013('0x36')]);var _0x5b101a={'where':_0x1a08cf['where']};return db['Integration'][_0xf013('0x37')](_0x5b101a)[_0xf013('0x1d')](function(_0x3ee334){_0x50304f[_0xf013('0x37')]=_0x3ee334;if(_0x280804[_0xf013('0x29')][_0xf013('0x38')]){_0x1a08cf[_0xf013('0x39')]=[{'all':!![]}];}return db[_0xf013('0x24')][_0xf013('0x3a')](_0x1a08cf);})[_0xf013('0x1d')](function(_0x494bbb){_0x50304f['rows']=_0x494bbb;return _0x50304f;})['then'](respondWithFilteredResult(_0xffe1b2,_0x1a08cf))[_0xf013('0x3b')](handleError(_0xffe1b2,null));};exports[_0xf013('0x3c')]=function(_0x50f91b,_0x1e4c48){var _0x28afb0={'raw':![],'where':{'id':_0x50f91b[_0xf013('0x3d')]['id']}},_0xea6d1a={};_0xea6d1a[_0xf013('0x28')]=_[_0xf013('0x3e')](db[_0xf013('0x24')]['rawAttributes']);_0xea6d1a[_0xf013('0x29')]=_[_0xf013('0x3e')](_0x50f91b[_0xf013('0x29')]);_0xea6d1a['filters']=_['intersection'](_0xea6d1a[_0xf013('0x28')],_0xea6d1a[_0xf013('0x29')]);_0x28afb0[_0xf013('0x2d')]=_[_0xf013('0x2b')](_0xea6d1a[_0xf013('0x28')],qs[_0xf013('0x2c')](_0x50f91b[_0xf013('0x29')][_0xf013('0x2c')]));_0x28afb0['attributes']=_0x28afb0['attributes'][_0xf013('0x2e')]?_0x28afb0['attributes']:_0xea6d1a['model'];if(_0x50f91b['query'][_0xf013('0x38')]){_0x28afb0['include']=[{'all':!![]}];}_0x28afb0=_[_0xf013('0x35')]({},_0x28afb0,_0x50f91b[_0xf013('0x36')]);return db[_0xf013('0x24')]['find'](_0x28afb0)[_0xf013('0x1d')](handleEntityNotFound(_0x1e4c48,null))[_0xf013('0x1d')](respondWithResult(_0x1e4c48,null))['catch'](handleError(_0x1e4c48,null));};exports[_0xf013('0x3f')]=function(_0x15d157,_0x37c688){return db['Integration'][_0xf013('0x3f')](_0x15d157[_0xf013('0x40')],{})[_0xf013('0x1d')](respondWithResult(_0x37c688,0xc9))[_0xf013('0x3b')](handleError(_0x37c688,null));};exports[_0xf013('0x1c')]=function(_0x2186ad,_0x212378){if(_0x2186ad[_0xf013('0x40')]['id']){delete _0x2186ad[_0xf013('0x40')]['id'];}return db['Integration'][_0xf013('0x41')]({'where':{'id':_0x2186ad[_0xf013('0x3d')]['id']}})[_0xf013('0x1d')](handleEntityNotFound(_0x212378,null))[_0xf013('0x1d')](saveUpdates(_0x2186ad[_0xf013('0x40')],null))[_0xf013('0x1d')](respondWithResult(_0x212378,null))['catch'](handleError(_0x212378,null));};exports[_0xf013('0x1e')]=function(_0x4fdf82,_0x5658e9){return db[_0xf013('0x24')][_0xf013('0x41')]({'where':{'id':_0x4fdf82[_0xf013('0x3d')]['id']}})[_0xf013('0x1d')](handleEntityNotFound(_0x5658e9,null))[_0xf013('0x1d')](removeEntity(_0x5658e9,null))[_0xf013('0x3b')](handleError(_0x5658e9,null));}; \ No newline at end of file +var _0xe2d0=['pick','filter','merge','VIRTUAL','includeAll','include','Integration','findAll','rows','catch','show','options','find','create','body','update','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','apply','reject','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','limit','order','sort','where','filters'];(function(_0x518d69,_0x3c4d7c){var _0x15079d=function(_0x17422c){while(--_0x17422c){_0x518d69['push'](_0x518d69['shift']());}};_0x15079d(++_0x3c4d7c);}(_0xe2d0,0x12d));var _0x0e2d=function(_0x45e5f1,_0x5ac3ee){_0x45e5f1=_0x45e5f1-0x0;var _0x448018=_0xe2d0[_0x45e5f1];return _0x448018;};'use strict';var pdf=require(_0x0e2d('0x0'));var emlformat=require(_0x0e2d('0x1'));var rimraf=require(_0x0e2d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e2d('0x3'));var rp=require(_0x0e2d('0x4'));var moment=require(_0x0e2d('0x5'));var BPromise=require(_0x0e2d('0x6'));var Mustache=require(_0x0e2d('0x7'));var util=require('util');var path=require(_0x0e2d('0x8'));var sox=require(_0x0e2d('0x9'));var csv=require(_0x0e2d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0e2d('0xb'));var squel=require(_0x0e2d('0xc'));var crypto=require(_0x0e2d('0xd'));var jsforce=require(_0x0e2d('0xe'));var deskjs=require(_0x0e2d('0xf'));var toCsv=require(_0x0e2d('0xa'));var querystring=require('querystring');var Papa=require(_0x0e2d('0x10'));var Redis=require(_0x0e2d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0e2d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e2d('0x13'))(_0x0e2d('0x14'));var utils=require('../../config/utils');var config=require(_0x0e2d('0x15'));var db=require(_0x0e2d('0x16'))['db'];function respondWithStatusCode(_0x180657,_0x7e8314){_0x7e8314=_0x7e8314||0xcc;return function(_0x195c67){if(_0x195c67){return _0x180657[_0x0e2d('0x17')](_0x7e8314);}return _0x180657[_0x0e2d('0x18')](_0x7e8314)[_0x0e2d('0x19')]();};}function respondWithResult(_0x136b8d,_0x503c66){_0x503c66=_0x503c66||0xc8;return function(_0x13d484){if(_0x13d484){return _0x136b8d[_0x0e2d('0x18')](_0x503c66)[_0x0e2d('0x1a')](_0x13d484);}};}function respondWithFilteredResult(_0x1ed19b,_0x3de03b){return function(_0x40aef6){if(_0x40aef6){var _0x5a82d7=_0x40aef6[_0x0e2d('0x1b')],_0x56fefb=_0x3de03b[_0x0e2d('0x1c')],_0x3a17f2=_0x3de03b[_0x0e2d('0x1c')]+_0x3de03b['limit'],_0x46f2ad;if(_0x3a17f2>=_0x5a82d7){_0x3a17f2=_0x5a82d7;_0x46f2ad=0xc8;}else{_0x46f2ad=0xce;}_0x1ed19b[_0x0e2d('0x18')](_0x46f2ad);return _0x1ed19b['set']('Content-Range',_0x56fefb+'-'+_0x3a17f2+'/'+_0x5a82d7)['json'](_0x40aef6);}return null;};}function patchUpdates(_0x45a97f){return function(_0x56e78b){try{jsonpatch[_0x0e2d('0x1d')](_0x56e78b,_0x45a97f,!![]);}catch(_0x2c23b9){return BPromise[_0x0e2d('0x1e')](_0x2c23b9);}return _0x56e78b['save']();};}function saveUpdates(_0x480616,_0x3813a0){return function(_0x539d1c){if(_0x539d1c){return _0x539d1c['update'](_0x480616)[_0x0e2d('0x1f')](function(_0x46426c){return _0x46426c;});}return null;};}function removeEntity(_0x2029f5,_0x48d63f){return function(_0xb59f5f){if(_0xb59f5f){return _0xb59f5f[_0x0e2d('0x20')]()[_0x0e2d('0x1f')](function(){_0x2029f5[_0x0e2d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20c1ef,_0x61f11a){return function(_0x37f9ae){if(!_0x37f9ae){_0x20c1ef[_0x0e2d('0x17')](0x194);}return _0x37f9ae;};}function handleError(_0x4151e3,_0x2e3d60){_0x2e3d60=_0x2e3d60||0x1f4;return function(_0x338a56){logger['error'](_0x338a56[_0x0e2d('0x21')]);if(_0x338a56[_0x0e2d('0x22')]){delete _0x338a56[_0x0e2d('0x22')];}_0x4151e3[_0x0e2d('0x18')](_0x2e3d60)[_0x0e2d('0x23')](_0x338a56);};}exports[_0x0e2d('0x24')]=function(_0x69ba25,_0x38a350){var _0x30131b={},_0x339649={},_0x5dd311={'count':0x0,'rows':[]};var _0x47dd77=_[_0x0e2d('0x25')](db['Integration'][_0x0e2d('0x26')],function(_0x2a0abc){return{'name':_0x2a0abc[_0x0e2d('0x27')],'type':_0x2a0abc[_0x0e2d('0x28')][_0x0e2d('0x29')]};});_0x339649[_0x0e2d('0x2a')]=_['map'](_0x47dd77,_0x0e2d('0x22'));_0x339649['query']=_[_0x0e2d('0x2b')](_0x69ba25[_0x0e2d('0x2c')]);_0x339649['filters']=_[_0x0e2d('0x2d')](_0x339649['model'],_0x339649['query']);_0x30131b[_0x0e2d('0x2e')]=_['intersection'](_0x339649[_0x0e2d('0x2a')],qs[_0x0e2d('0x2f')](_0x69ba25['query'][_0x0e2d('0x2f')]));_0x30131b[_0x0e2d('0x2e')]=_0x30131b[_0x0e2d('0x2e')][_0x0e2d('0x30')]?_0x30131b[_0x0e2d('0x2e')]:_0x339649['model'];if(!_0x69ba25[_0x0e2d('0x2c')]['hasOwnProperty']('nolimit')){_0x30131b[_0x0e2d('0x31')]=qs[_0x0e2d('0x31')](_0x69ba25[_0x0e2d('0x2c')][_0x0e2d('0x31')]);_0x30131b['offset']=qs[_0x0e2d('0x1c')](_0x69ba25[_0x0e2d('0x2c')]['offset']);}_0x30131b[_0x0e2d('0x32')]=qs[_0x0e2d('0x33')](_0x69ba25[_0x0e2d('0x2c')]['sort']);_0x30131b[_0x0e2d('0x34')]=qs[_0x0e2d('0x35')](_[_0x0e2d('0x36')](_0x69ba25[_0x0e2d('0x2c')],_0x339649['filters']));if(_0x69ba25[_0x0e2d('0x2c')][_0x0e2d('0x37')]){_0x30131b[_0x0e2d('0x34')]=_[_0x0e2d('0x38')](_0x30131b[_0x0e2d('0x34')],{'$or':_[_0x0e2d('0x25')](_0x47dd77,function(_0x5239d9){if(_0x5239d9[_0x0e2d('0x28')]!==_0x0e2d('0x39')){var _0x3b721a={};_0x3b721a[_0x5239d9[_0x0e2d('0x22')]]={'$like':'%'+_0x69ba25['query']['filter']+'%'};return _0x3b721a;}})});}_0x30131b=_['merge']({},_0x30131b,_0x69ba25['options']);var _0x210180={'where':_0x30131b[_0x0e2d('0x34')]};return db['Integration'][_0x0e2d('0x1b')](_0x210180)[_0x0e2d('0x1f')](function(_0x2ff670){_0x5dd311[_0x0e2d('0x1b')]=_0x2ff670;if(_0x69ba25['query'][_0x0e2d('0x3a')]){_0x30131b[_0x0e2d('0x3b')]=[{'all':!![]}];}return db[_0x0e2d('0x3c')][_0x0e2d('0x3d')](_0x30131b);})[_0x0e2d('0x1f')](function(_0x460460){_0x5dd311[_0x0e2d('0x3e')]=_0x460460;return _0x5dd311;})[_0x0e2d('0x1f')](respondWithFilteredResult(_0x38a350,_0x30131b))[_0x0e2d('0x3f')](handleError(_0x38a350,null));};exports[_0x0e2d('0x40')]=function(_0x288e55,_0xd4ea28){var _0x5c0a0b={'raw':![],'where':{'id':_0x288e55['params']['id']}},_0x25edad={};_0x25edad[_0x0e2d('0x2a')]=_[_0x0e2d('0x2b')](db[_0x0e2d('0x3c')][_0x0e2d('0x26')]);_0x25edad[_0x0e2d('0x2c')]=_['keys'](_0x288e55[_0x0e2d('0x2c')]);_0x25edad[_0x0e2d('0x35')]=_[_0x0e2d('0x2d')](_0x25edad[_0x0e2d('0x2a')],_0x25edad[_0x0e2d('0x2c')]);_0x5c0a0b['attributes']=_['intersection'](_0x25edad['model'],qs['fields'](_0x288e55[_0x0e2d('0x2c')][_0x0e2d('0x2f')]));_0x5c0a0b[_0x0e2d('0x2e')]=_0x5c0a0b[_0x0e2d('0x2e')]['length']?_0x5c0a0b[_0x0e2d('0x2e')]:_0x25edad['model'];if(_0x288e55['query']['includeAll']){_0x5c0a0b['include']=[{'all':!![]}];}_0x5c0a0b=_['merge']({},_0x5c0a0b,_0x288e55[_0x0e2d('0x41')]);return db[_0x0e2d('0x3c')][_0x0e2d('0x42')](_0x5c0a0b)[_0x0e2d('0x1f')](handleEntityNotFound(_0xd4ea28,null))['then'](respondWithResult(_0xd4ea28,null))[_0x0e2d('0x3f')](handleError(_0xd4ea28,null));};exports[_0x0e2d('0x43')]=function(_0x22c8cd,_0x54de0f){return db['Integration']['create'](_0x22c8cd[_0x0e2d('0x44')],{})[_0x0e2d('0x1f')](respondWithResult(_0x54de0f,0xc9))[_0x0e2d('0x3f')](handleError(_0x54de0f,null));};exports[_0x0e2d('0x45')]=function(_0x1929b7,_0x3b738d){if(_0x1929b7[_0x0e2d('0x44')]['id']){delete _0x1929b7[_0x0e2d('0x44')]['id'];}return db[_0x0e2d('0x3c')][_0x0e2d('0x42')]({'where':{'id':_0x1929b7[_0x0e2d('0x46')]['id']}})[_0x0e2d('0x1f')](handleEntityNotFound(_0x3b738d,null))['then'](saveUpdates(_0x1929b7['body'],null))[_0x0e2d('0x1f')](respondWithResult(_0x3b738d,null))[_0x0e2d('0x3f')](handleError(_0x3b738d,null));};exports[_0x0e2d('0x20')]=function(_0x2506a4,_0x33e9bf){return db['Integration']['find']({'where':{'id':_0x2506a4[_0x0e2d('0x46')]['id']}})[_0x0e2d('0x1f')](handleEntityNotFound(_0x33e9bf,null))[_0x0e2d('0x1f')](removeEntity(_0x33e9bf,null))[_0x0e2d('0x3f')](handleError(_0x33e9bf,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index d32c17f..cdae7a4 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 _0x1b62=['../../config/environment','./integration.attributes','define','Integration','integrations','lodash','util','moment','bluebird','request-promise'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x1b62,0xd7));var _0x21b6=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0x1b62[_0x18d5d7];return _0x30a9ea;};'use strict';var _=require(_0x21b6('0x0'));var util=require(_0x21b6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x21b6('0x2'));var BPromise=require(_0x21b6('0x3'));var rp=require(_0x21b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x21b6('0x5'));var attributes=require(_0x21b6('0x6'));module['exports']=function(_0x234a65,_0x324cca){return _0x234a65[_0x21b6('0x7')](_0x21b6('0x8'),attributes,{'tableName':_0x21b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9406=['bluebird','request-promise','path','rimraf','./integration.attributes','exports','define','Integration','lodash','util','moment'];(function(_0x5d1d8d,_0x37e3e5){var _0x503f97=function(_0x31b864){while(--_0x31b864){_0x5d1d8d['push'](_0x5d1d8d['shift']());}};_0x503f97(++_0x37e3e5);}(_0x9406,0x126));var _0x6940=function(_0x1d8015,_0x199629){_0x1d8015=_0x1d8015-0x0;var _0x1a7d3f=_0x9406[_0x1d8015];return _0x1a7d3f;};'use strict';var _=require(_0x6940('0x0'));var util=require(_0x6940('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6940('0x2'));var BPromise=require(_0x6940('0x3'));var rp=require(_0x6940('0x4'));var fs=require('fs');var path=require(_0x6940('0x5'));var rimraf=require(_0x6940('0x6'));var config=require('../../config/environment');var attributes=require(_0x6940('0x7'));module[_0x6940('0x8')]=function(_0x20d120,_0x572547){return _0x20d120[_0x6940('0x9')](_0x6940('0xa'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index 6cc8a3a..d696b8d 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 _0x55e2=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x23e158,_0x16c4a9){var _0x44f62a=function(_0x55a0ce){while(--_0x55a0ce){_0x23e158['push'](_0x23e158['shift']());}};_0x44f62a(++_0x16c4a9);}(_0x55e2,0xd8));var _0x255e=function(_0x3b1011,_0x1b2733){_0x3b1011=_0x3b1011-0x0;var _0x226a2f=_0x55e2[_0x3b1011];return _0x226a2f;};'use strict';var _=require(_0x255e('0x0'));var util=require(_0x255e('0x1'));var moment=require(_0x255e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x255e('0x3'));var db=require(_0x255e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x255e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x255e('0x6'));var client=jayson[_0x255e('0x7')][_0x255e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cef7,_0x465761,_0x169d4e){return new BPromise(function(_0x155199,_0x2a5438){return client[_0x255e('0x9')](_0x51cef7,_0x169d4e)[_0x255e('0xa')](function(_0x13c7d4){logger[_0x255e('0xb')](_0x255e('0xc'),_0x465761,_0x255e('0xd'));logger[_0x255e('0xe')]('Integration,\x20%s,\x20%s,\x20%s',_0x465761,_0x255e('0xd'),JSON[_0x255e('0xf')](_0x13c7d4));if(_0x13c7d4[_0x255e('0x10')]){if(_0x13c7d4[_0x255e('0x10')][_0x255e('0x11')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x465761,_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);return _0x2a5438(_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);}logger[_0x255e('0x10')]('Integration,\x20%s,\x20%s',_0x465761,_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);return _0x155199(_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);}else{logger['info'](_0x255e('0xc'),_0x465761,_0x255e('0xd'));_0x155199(_0x13c7d4[_0x255e('0x13')]['message']);}})['catch'](function(_0x22ab5a){logger[_0x255e('0x10')]('Integration,\x20%s,\x20%s',_0x465761,_0x22ab5a);_0x2a5438(_0x22ab5a);});});} \ No newline at end of file +var _0xbb1a=['info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x325fe1,_0x15f0bc){var _0x5b3eaf=function(_0x517d49){while(--_0x517d49){_0x325fe1['push'](_0x325fe1['shift']());}};_0x5b3eaf(++_0x15f0bc);}(_0xbb1a,0x14c));var _0xabb1=function(_0x2c4757,_0x4c3a32){_0x2c4757=_0x2c4757-0x0;var _0x23215e=_0xbb1a[_0x2c4757];return _0x23215e;};'use strict';var _=require(_0xabb1('0x0'));var util=require(_0xabb1('0x1'));var moment=require(_0xabb1('0x2'));var BPromise=require(_0xabb1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabb1('0x4'));var db=require(_0xabb1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xabb1('0x6'))(_0xabb1('0x7'));var config=require(_0xabb1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xabb1('0x9')][_0xabb1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x278ef2,_0x2aa417,_0x1f2ac6){return new BPromise(function(_0x548135,_0x111299){return client[_0xabb1('0xb')](_0x278ef2,_0x1f2ac6)[_0xabb1('0xc')](function(_0x33def7){logger['info'](_0xabb1('0xd'),_0x2aa417,_0xabb1('0xe'));logger[_0xabb1('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x2aa417,_0xabb1('0xe'),JSON[_0xabb1('0x10')](_0x33def7));if(_0x33def7[_0xabb1('0x11')]){if(_0x33def7[_0xabb1('0x11')][_0xabb1('0x12')]===0x1f4){logger[_0xabb1('0x11')]('Integration,\x20%s,\x20%s',_0x2aa417,_0x33def7[_0xabb1('0x11')][_0xabb1('0x13')]);return _0x111299(_0x33def7[_0xabb1('0x11')][_0xabb1('0x13')]);}logger[_0xabb1('0x11')]('Integration,\x20%s,\x20%s',_0x2aa417,_0x33def7[_0xabb1('0x11')][_0xabb1('0x13')]);return _0x548135(_0x33def7[_0xabb1('0x11')][_0xabb1('0x13')]);}else{logger[_0xabb1('0x14')](_0xabb1('0xd'),_0x2aa417,_0xabb1('0xe'));_0x548135(_0x33def7[_0xabb1('0x15')][_0xabb1('0x13')]);}})['catch'](function(_0x41a207){logger[_0xabb1('0x11')](_0xabb1('0xd'),_0x2aa417,_0x41a207);_0x111299(_0x41a207);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 0ad5136..c1ed064 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 _0x28e1=['path','express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','isAuthenticated','index','describe','get','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x28e1,0xcf));var _0x128e=function(_0x106016,_0x5c0244){_0x106016=_0x106016-0x0;var _0x495fad=_0x28e1[_0x106016];return _0x495fad;};'use strict';var multer=require(_0x128e('0x0'));var util=require(_0x128e('0x1'));var path=require(_0x128e('0x2'));var timeout=require('connect-timeout');var express=require(_0x128e('0x3'));var router=express[_0x128e('0x4')]();var auth=require(_0x128e('0x5'));var interaction=require(_0x128e('0x6'));var config=require('../../config/environment');var controller=require(_0x128e('0x7'));router['get']('/',auth[_0x128e('0x8')](),controller[_0x128e('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x128e('0xa')]);router[_0x128e('0xb')]('/:id',auth[_0x128e('0x8')](),controller['show']);router[_0x128e('0xc')]('/',auth['isAuthenticated'](),controller[_0x128e('0xd')]);router[_0x128e('0xe')](_0x128e('0xf'),auth[_0x128e('0x8')](),controller[_0x128e('0x10')]);router[_0x128e('0x11')](_0x128e('0xf'),auth[_0x128e('0x8')](),controller[_0x128e('0x12')]);module['exports']=router; \ No newline at end of file +var _0x34c8=['delete','destroy','exports','multer','path','express','Router','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x49bf83,_0x3a54dc){var _0x339b39=function(_0x4ed39e){while(--_0x4ed39e){_0x49bf83['push'](_0x49bf83['shift']());}};_0x339b39(++_0x3a54dc);}(_0x34c8,0xa3));var _0x834c=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x34c8[_0x3070dc];return _0x431489;};'use strict';var multer=require(_0x834c('0x0'));var util=require('util');var path=require(_0x834c('0x1'));var timeout=require('connect-timeout');var express=require(_0x834c('0x2'));var router=express[_0x834c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x834c('0x4'));var config=require(_0x834c('0x5'));var controller=require(_0x834c('0x6'));router[_0x834c('0x7')]('/',auth['isAuthenticated'](),controller[_0x834c('0x8')]);router['get'](_0x834c('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x834c('0x7')](_0x834c('0xa'),auth[_0x834c('0xb')](),controller[_0x834c('0xc')]);router[_0x834c('0xd')]('/',auth[_0x834c('0xb')](),controller[_0x834c('0xe')]);router[_0x834c('0xf')]('/:id',auth[_0x834c('0xb')](),controller[_0x834c('0x10')]);router[_0x834c('0x11')](_0x834c('0xa'),auth[_0x834c('0xb')](),controller[_0x834c('0x12')]);module[_0x834c('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 2ecf127..3ee9991 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 _0x5725=['exports','STRING','DATE','BOOLEAN','INTEGER','TEXT','SENT','RECEIVED','FAILED','sequelize'];(function(_0x153c08,_0x2f6c71){var _0x197f79=function(_0xa358c4){while(--_0xa358c4){_0x153c08['push'](_0x153c08['shift']());}};_0x197f79(++_0x2f6c71);}(_0x5725,0x135));var _0x5572=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5725[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x5572('0x0'));module[_0x5572('0x1')]={'integration':{'type':Sequelize[_0x5572('0x2')]},'eventChannel':{'type':Sequelize[_0x5572('0x2')]},'exitStatus':{'type':Sequelize[_0x5572('0x2')]},'ticketId':{'type':Sequelize[_0x5572('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x5572('0x2')]},'uniqueid':{'type':Sequelize[_0x5572('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5572('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5572('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5572('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5572('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5572('0x3')]},'talktime':{'type':Sequelize[_0x5572('0x5')]},'agentacw':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5572('0x5')]},'reason':{'type':Sequelize[_0x5572('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5572('0x3')]},'agentdump':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5572('0x3')]},'lastevent':{'type':Sequelize[_0x5572('0x2')]},'channel':{'type':Sequelize[_0x5572('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5572('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5572('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5572('0x2')]},'destchannel':{'type':Sequelize[_0x5572('0x2')]},'destchannelstate':{'type':Sequelize[_0x5572('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5572('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5572('0x2')]},'destcalleridname':{'type':Sequelize[_0x5572('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5572('0x2')]},'destlanguage':{'type':Sequelize[_0x5572('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x5572('0x2')]},'destpriority':{'type':Sequelize[_0x5572('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x5572('0x2')]},'inReplyTo':{'type':Sequelize[_0x5572('0x2')]},'subject':{'type':Sequelize[_0x5572('0x2')]},'from':{'type':Sequelize[_0x5572('0x2')]},'to':{'type':Sequelize[_0x5572('0x2')]},'cc':{'type':Sequelize[_0x5572('0x2')]},'attachment':{'type':Sequelize[_0x5572('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x5572('0x6')]},'status':{'type':Sequelize['ENUM'](_0x5572('0x7'),'SENDING',_0x5572('0x8'),_0x5572('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5572('0x2')]},'appdata':{'type':Sequelize[_0x5572('0x2')]},'projectId':{'type':Sequelize[_0x5572('0x5')]}}; \ No newline at end of file +var _0x2147=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','RECEIVED','exports'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0x2147,0x14c));var _0x7214=function(_0x1843dd,_0x20d2d0){_0x1843dd=_0x1843dd-0x0;var _0x431cc6=_0x2147[_0x1843dd];return _0x431cc6;};'use strict';var Sequelize=require('sequelize');module[_0x7214('0x0')]={'integration':{'type':Sequelize[_0x7214('0x1')]},'eventChannel':{'type':Sequelize[_0x7214('0x1')]},'exitStatus':{'type':Sequelize[_0x7214('0x1')]},'ticketId':{'type':Sequelize[_0x7214('0x1')]},'integrationId':{'type':Sequelize[_0x7214('0x2')]},'contacts':{'type':Sequelize[_0x7214('0x1')]},'uniqueid':{'type':Sequelize[_0x7214('0x1')]},'calleridnum':{'type':Sequelize[_0x7214('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x7214('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x7214('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x7214('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x7214('0x3')]},'talktime':{'type':Sequelize[_0x7214('0x2')]},'agentacw':{'type':Sequelize[_0x7214('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x7214('0x2')]},'reason':{'type':Sequelize[_0x7214('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x7214('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x7214('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x7214('0x3')]},'lastevent':{'type':Sequelize[_0x7214('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x7214('0x2')]},'channelstatedesc':{'type':Sequelize[_0x7214('0x1')]},'connectedlinenum':{'type':Sequelize[_0x7214('0x1')]},'connectedlinename':{'type':Sequelize[_0x7214('0x1')]},'language':{'type':Sequelize[_0x7214('0x1')]},'accountcode':{'type':Sequelize[_0x7214('0x1')]},'context':{'type':Sequelize[_0x7214('0x1')]},'exten':{'type':Sequelize[_0x7214('0x1')]},'priority':{'type':Sequelize[_0x7214('0x1')]},'destchannel':{'type':Sequelize[_0x7214('0x1')]},'destchannelstate':{'type':Sequelize[_0x7214('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x7214('0x1')]},'destcalleridnum':{'type':Sequelize[_0x7214('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x7214('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x7214('0x1')]},'destaccountcode':{'type':Sequelize[_0x7214('0x1')]},'destcontext':{'type':Sequelize[_0x7214('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x7214('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x7214('0x1')]},'subject':{'type':Sequelize[_0x7214('0x1')]},'from':{'type':Sequelize[_0x7214('0x1')]},'to':{'type':Sequelize[_0x7214('0x1')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x7214('0x5')]},'html':{'type':Sequelize[_0x7214('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x7214('0x6')](_0x7214('0x7'),'SENDING',_0x7214('0x8'),'FAILED')},'url':{'type':Sequelize[_0x7214('0x1')]},'app':{'type':Sequelize[_0x7214('0x1')]},'appdata':{'type':Sequelize[_0x7214('0x1')]},'projectId':{'type':Sequelize[_0x7214('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c1a889f..a44f940 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 _0xb9e7=['update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','IntegrationReport','count','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0xb9e7[_0x36feb2];return _0x292b43;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7b9e('0x0'));var rimraf=require(_0x7b9e('0x1'));var zipdir=require(_0x7b9e('0x2'));var jsonpatch=require(_0x7b9e('0x3'));var rp=require(_0x7b9e('0x4'));var moment=require(_0x7b9e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b9e('0x6'));var util=require(_0x7b9e('0x7'));var path=require('path');var sox=require(_0x7b9e('0x8'));var csv=require('to-csv');var ejs=require(_0x7b9e('0x9'));var fs=require('fs');var _=require(_0x7b9e('0xa'));var squel=require(_0x7b9e('0xb'));var crypto=require(_0x7b9e('0xc'));var jsforce=require(_0x7b9e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7b9e('0xe'));var querystring=require(_0x7b9e('0xf'));var Papa=require(_0x7b9e('0x10'));var Redis=require('ioredis');var authService=require(_0x7b9e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7b9e('0x12'));var hardwareService=require(_0x7b9e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7b9e('0x14'));var config=require('../../config/environment');var db=require(_0x7b9e('0x15'))['db'];function respondWithStatusCode(_0x5f1f9b,_0x51ce58){_0x51ce58=_0x51ce58||0xcc;return function(_0x4eb218){if(_0x4eb218){return _0x5f1f9b[_0x7b9e('0x16')](_0x51ce58);}return _0x5f1f9b[_0x7b9e('0x17')](_0x51ce58)[_0x7b9e('0x18')]();};}function respondWithResult(_0x343a93,_0x5bbb07){_0x5bbb07=_0x5bbb07||0xc8;return function(_0xaf4b8c){if(_0xaf4b8c){return _0x343a93[_0x7b9e('0x17')](_0x5bbb07)[_0x7b9e('0x19')](_0xaf4b8c);}};}function respondWithFilteredResult(_0x13ddc0,_0x7df437){return function(_0x2ed99e){if(_0x2ed99e){var _0x3a11b6=_0x2ed99e['count'],_0x504954=_0x7df437[_0x7b9e('0x1a')],_0x1c573f=_0x7df437['offset']+_0x7df437[_0x7b9e('0x1b')],_0x6f90f8;if(_0x1c573f>=_0x3a11b6){_0x1c573f=_0x3a11b6;_0x6f90f8=0xc8;}else{_0x6f90f8=0xce;}_0x13ddc0[_0x7b9e('0x17')](_0x6f90f8);return _0x13ddc0['set'](_0x7b9e('0x1c'),_0x504954+'-'+_0x1c573f+'/'+_0x3a11b6)[_0x7b9e('0x19')](_0x2ed99e);}return null;};}function patchUpdates(_0x5cbc8b){return function(_0x4a7153){try{jsonpatch[_0x7b9e('0x1d')](_0x4a7153,_0x5cbc8b,!![]);}catch(_0x134c20){return BPromise[_0x7b9e('0x1e')](_0x134c20);}return _0x4a7153[_0x7b9e('0x1f')]();};}function saveUpdates(_0x524d43,_0xa6db8b){return function(_0x1cff6c){if(_0x1cff6c){return _0x1cff6c[_0x7b9e('0x20')](_0x524d43)[_0x7b9e('0x21')](function(_0x167d6f){return _0x167d6f;});}return null;};}function removeEntity(_0x535433,_0x28e574){return function(_0x3811d2){if(_0x3811d2){return _0x3811d2[_0x7b9e('0x22')]()[_0x7b9e('0x21')](function(){_0x535433[_0x7b9e('0x17')](0xcc)[_0x7b9e('0x18')]();});}};}function handleEntityNotFound(_0x40c3c2,_0x39575a){return function(_0x2b4b86){if(!_0x2b4b86){_0x40c3c2[_0x7b9e('0x16')](0x194);}return _0x2b4b86;};}function handleError(_0xf8b578,_0x29b6ff){_0x29b6ff=_0x29b6ff||0x1f4;return function(_0xe3b37d){logger[_0x7b9e('0x23')](_0xe3b37d[_0x7b9e('0x24')]);if(_0xe3b37d[_0x7b9e('0x25')]){delete _0xe3b37d[_0x7b9e('0x25')];}_0xf8b578[_0x7b9e('0x17')](_0x29b6ff)[_0x7b9e('0x26')](_0xe3b37d);};}exports[_0x7b9e('0x27')]=function(_0x5a102b,_0x2fd4c7){var _0x1149cf={},_0x1a541c={},_0x2dbe2a={'count':0x0,'rows':[]};var _0x2ac45e=_[_0x7b9e('0x28')](db['IntegrationReport'][_0x7b9e('0x29')],function(_0x5ca745){return{'name':_0x5ca745[_0x7b9e('0x2a')],'type':_0x5ca745['type'][_0x7b9e('0x2b')]};});_0x1a541c[_0x7b9e('0x2c')]=_[_0x7b9e('0x28')](_0x2ac45e,_0x7b9e('0x25'));_0x1a541c[_0x7b9e('0x2d')]=_[_0x7b9e('0x2e')](_0x5a102b[_0x7b9e('0x2d')]);_0x1a541c[_0x7b9e('0x2f')]=_[_0x7b9e('0x30')](_0x1a541c['model'],_0x1a541c[_0x7b9e('0x2d')]);_0x1149cf[_0x7b9e('0x31')]=_[_0x7b9e('0x30')](_0x1a541c[_0x7b9e('0x2c')],qs[_0x7b9e('0x32')](_0x5a102b['query'][_0x7b9e('0x32')]));_0x1149cf[_0x7b9e('0x31')]=_0x1149cf[_0x7b9e('0x31')][_0x7b9e('0x33')]?_0x1149cf[_0x7b9e('0x31')]:_0x1a541c['model'];if(!_0x5a102b[_0x7b9e('0x2d')][_0x7b9e('0x34')](_0x7b9e('0x35'))){_0x1149cf[_0x7b9e('0x1b')]=qs['limit'](_0x5a102b['query'][_0x7b9e('0x1b')]);_0x1149cf['offset']=qs['offset'](_0x5a102b[_0x7b9e('0x2d')]['offset']);}_0x1149cf[_0x7b9e('0x36')]=qs['sort'](_0x5a102b[_0x7b9e('0x2d')][_0x7b9e('0x37')]);_0x1149cf['where']=qs[_0x7b9e('0x2f')](_[_0x7b9e('0x38')](_0x5a102b[_0x7b9e('0x2d')],_0x1a541c[_0x7b9e('0x2f')]));if(_0x5a102b['query'][_0x7b9e('0x39')]){_0x1149cf[_0x7b9e('0x3a')]=_[_0x7b9e('0x3b')](_0x1149cf[_0x7b9e('0x3a')],{'$or':_[_0x7b9e('0x28')](_0x2ac45e,function(_0x5aa89e){if(_0x5aa89e['type']!=='VIRTUAL'){var _0x2f9551={};_0x2f9551[_0x5aa89e['name']]={'$like':'%'+_0x5a102b[_0x7b9e('0x2d')][_0x7b9e('0x39')]+'%'};return _0x2f9551;}})});}_0x1149cf=_[_0x7b9e('0x3b')]({},_0x1149cf,_0x5a102b['options']);var _0x344b10={'where':_0x1149cf[_0x7b9e('0x3a')]};return db[_0x7b9e('0x3c')][_0x7b9e('0x3d')](_0x344b10)[_0x7b9e('0x21')](function(_0x2e955d){_0x2dbe2a[_0x7b9e('0x3d')]=_0x2e955d;if(_0x5a102b['query'][_0x7b9e('0x3e')]){_0x1149cf[_0x7b9e('0x3f')]=[{'all':!![]}];}return db['IntegrationReport'][_0x7b9e('0x40')](_0x1149cf);})['then'](function(_0x4f3c3c){_0x2dbe2a[_0x7b9e('0x41')]=_0x4f3c3c;return _0x2dbe2a;})[_0x7b9e('0x21')](respondWithFilteredResult(_0x2fd4c7,_0x1149cf))['catch'](handleError(_0x2fd4c7,null));};exports[_0x7b9e('0x42')]=function(_0x421f57,_0x5e2fd0){var _0x3310fe={'raw':![],'where':{'id':_0x421f57['params']['id']}},_0x3fcc0a={};_0x3fcc0a[_0x7b9e('0x2c')]=_[_0x7b9e('0x2e')](db[_0x7b9e('0x3c')][_0x7b9e('0x29')]);_0x3fcc0a['query']=_[_0x7b9e('0x2e')](_0x421f57[_0x7b9e('0x2d')]);_0x3fcc0a[_0x7b9e('0x2f')]=_[_0x7b9e('0x30')](_0x3fcc0a['model'],_0x3fcc0a['query']);_0x3310fe[_0x7b9e('0x31')]=_[_0x7b9e('0x30')](_0x3fcc0a['model'],qs[_0x7b9e('0x32')](_0x421f57['query']['fields']));_0x3310fe[_0x7b9e('0x31')]=_0x3310fe['attributes']['length']?_0x3310fe[_0x7b9e('0x31')]:_0x3fcc0a[_0x7b9e('0x2c')];if(_0x421f57['query'][_0x7b9e('0x3e')]){_0x3310fe[_0x7b9e('0x3f')]=[{'all':!![]}];}_0x3310fe=_[_0x7b9e('0x3b')]({},_0x3310fe,_0x421f57[_0x7b9e('0x43')]);return db[_0x7b9e('0x3c')][_0x7b9e('0x44')](_0x3310fe)[_0x7b9e('0x21')](handleEntityNotFound(_0x5e2fd0,null))[_0x7b9e('0x21')](respondWithResult(_0x5e2fd0,null))[_0x7b9e('0x45')](handleError(_0x5e2fd0,null));};exports[_0x7b9e('0x46')]=function(_0x4fd0b9,_0xf57d65){return db[_0x7b9e('0x3c')][_0x7b9e('0x46')](_0x4fd0b9[_0x7b9e('0x47')],{})[_0x7b9e('0x21')](respondWithResult(_0xf57d65,0xc9))[_0x7b9e('0x45')](handleError(_0xf57d65,null));};exports['update']=function(_0x1dfbb9,_0x4c7c83){if(_0x1dfbb9[_0x7b9e('0x47')]['id']){delete _0x1dfbb9[_0x7b9e('0x47')]['id'];}return db[_0x7b9e('0x3c')]['find']({'where':{'id':_0x1dfbb9[_0x7b9e('0x48')]['id']}})[_0x7b9e('0x21')](handleEntityNotFound(_0x4c7c83,null))[_0x7b9e('0x21')](saveUpdates(_0x1dfbb9[_0x7b9e('0x47')],null))[_0x7b9e('0x21')](respondWithResult(_0x4c7c83,null))[_0x7b9e('0x45')](handleError(_0x4c7c83,null));};exports[_0x7b9e('0x22')]=function(_0x428edd,_0x44a7f8){return db[_0x7b9e('0x3c')][_0x7b9e('0x44')]({'where':{'id':_0x428edd['params']['id']}})[_0x7b9e('0x21')](handleEntityNotFound(_0x44a7f8,null))[_0x7b9e('0x21')](removeEntity(_0x44a7f8,null))[_0x7b9e('0x45')](handleError(_0x44a7f8,null));};exports['describe']=function(_0x34f1ae,_0xcf233d){return db[_0x7b9e('0x3c')]['describe']()[_0x7b9e('0x21')](respondWithResult(_0xcf233d,null))[_0x7b9e('0x45')](handleError(_0xcf233d,null));}; \ No newline at end of file +var _0x117c=['count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','IntegrationReport','include','rows','catch','fields','includeAll','find','create','body','params','describe','zip-dir','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json'];(function(_0x3b6481,_0x16ccb7){var _0x12066f=function(_0x381ce3){while(--_0x381ce3){_0x3b6481['push'](_0x3b6481['shift']());}};_0x12066f(++_0x16ccb7);}(_0x117c,0x71));var _0xc117=function(_0x46c8fb,_0x253501){_0x46c8fb=_0x46c8fb-0x0;var _0x48f9eb=_0x117c[_0x46c8fb];return _0x48f9eb;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc117('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc117('0x1'));var BPromise=require(_0xc117('0x2'));var Mustache=require(_0xc117('0x3'));var util=require(_0xc117('0x4'));var path=require(_0xc117('0x5'));var sox=require(_0xc117('0x6'));var csv=require('to-csv');var ejs=require(_0xc117('0x7'));var fs=require('fs');var _=require(_0xc117('0x8'));var squel=require('squel');var crypto=require(_0xc117('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc117('0xa'));var toCsv=require(_0xc117('0xb'));var querystring=require(_0xc117('0xc'));var Papa=require(_0xc117('0xd'));var Redis=require(_0xc117('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xc117('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc117('0x10'));var logger=require('../../config/logger')(_0xc117('0x11'));var utils=require(_0xc117('0x12'));var config=require('../../config/environment');var db=require(_0xc117('0x13'))['db'];function respondWithStatusCode(_0x4ab6ba,_0x29d939){_0x29d939=_0x29d939||0xcc;return function(_0x1d8601){if(_0x1d8601){return _0x4ab6ba[_0xc117('0x14')](_0x29d939);}return _0x4ab6ba[_0xc117('0x15')](_0x29d939)['end']();};}function respondWithResult(_0x1aebe8,_0x432d27){_0x432d27=_0x432d27||0xc8;return function(_0x102957){if(_0x102957){return _0x1aebe8[_0xc117('0x15')](_0x432d27)[_0xc117('0x16')](_0x102957);}};}function respondWithFilteredResult(_0x375334,_0x44042a){return function(_0x6960b9){if(_0x6960b9){var _0xc14e71=_0x6960b9[_0xc117('0x17')],_0x58bce8=_0x44042a[_0xc117('0x18')],_0x5350e9=_0x44042a[_0xc117('0x18')]+_0x44042a[_0xc117('0x19')],_0x1dfaa6;if(_0x5350e9>=_0xc14e71){_0x5350e9=_0xc14e71;_0x1dfaa6=0xc8;}else{_0x1dfaa6=0xce;}_0x375334[_0xc117('0x15')](_0x1dfaa6);return _0x375334[_0xc117('0x1a')](_0xc117('0x1b'),_0x58bce8+'-'+_0x5350e9+'/'+_0xc14e71)[_0xc117('0x16')](_0x6960b9);}return null;};}function patchUpdates(_0x1eb419){return function(_0x2eddf1){try{jsonpatch[_0xc117('0x1c')](_0x2eddf1,_0x1eb419,!![]);}catch(_0x547deb){return BPromise[_0xc117('0x1d')](_0x547deb);}return _0x2eddf1[_0xc117('0x1e')]();};}function saveUpdates(_0xf5307f,_0x1a5ba0){return function(_0x3946cb){if(_0x3946cb){return _0x3946cb[_0xc117('0x1f')](_0xf5307f)[_0xc117('0x20')](function(_0x48beee){return _0x48beee;});}return null;};}function removeEntity(_0x4f7594,_0x412ec1){return function(_0x24bb40){if(_0x24bb40){return _0x24bb40[_0xc117('0x21')]()[_0xc117('0x20')](function(){_0x4f7594[_0xc117('0x15')](0xcc)[_0xc117('0x22')]();});}};}function handleEntityNotFound(_0x5d5ba1,_0x4bde1b){return function(_0x3d670e){if(!_0x3d670e){_0x5d5ba1['sendStatus'](0x194);}return _0x3d670e;};}function handleError(_0xa0ee6b,_0x7545d){_0x7545d=_0x7545d||0x1f4;return function(_0x216370){logger['error'](_0x216370[_0xc117('0x23')]);if(_0x216370[_0xc117('0x24')]){delete _0x216370[_0xc117('0x24')];}_0xa0ee6b[_0xc117('0x15')](_0x7545d)[_0xc117('0x25')](_0x216370);};}exports[_0xc117('0x26')]=function(_0x5ca655,_0x334041){var _0x5da63f={},_0x4a569e={},_0x202dd4={'count':0x0,'rows':[]};var _0x35efea=_[_0xc117('0x27')](db['IntegrationReport'][_0xc117('0x28')],function(_0x5db129){return{'name':_0x5db129['fieldName'],'type':_0x5db129[_0xc117('0x29')][_0xc117('0x2a')]};});_0x4a569e[_0xc117('0x2b')]=_['map'](_0x35efea,_0xc117('0x24'));_0x4a569e['query']=_[_0xc117('0x2c')](_0x5ca655[_0xc117('0x2d')]);_0x4a569e[_0xc117('0x2e')]=_[_0xc117('0x2f')](_0x4a569e['model'],_0x4a569e[_0xc117('0x2d')]);_0x5da63f[_0xc117('0x30')]=_[_0xc117('0x2f')](_0x4a569e[_0xc117('0x2b')],qs['fields'](_0x5ca655[_0xc117('0x2d')]['fields']));_0x5da63f[_0xc117('0x30')]=_0x5da63f['attributes'][_0xc117('0x31')]?_0x5da63f['attributes']:_0x4a569e[_0xc117('0x2b')];if(!_0x5ca655['query'][_0xc117('0x32')](_0xc117('0x33'))){_0x5da63f[_0xc117('0x19')]=qs['limit'](_0x5ca655[_0xc117('0x2d')][_0xc117('0x19')]);_0x5da63f[_0xc117('0x18')]=qs[_0xc117('0x18')](_0x5ca655[_0xc117('0x2d')][_0xc117('0x18')]);}_0x5da63f[_0xc117('0x34')]=qs[_0xc117('0x35')](_0x5ca655['query'][_0xc117('0x35')]);_0x5da63f[_0xc117('0x36')]=qs[_0xc117('0x2e')](_['pick'](_0x5ca655[_0xc117('0x2d')],_0x4a569e[_0xc117('0x2e')]));if(_0x5ca655[_0xc117('0x2d')][_0xc117('0x37')]){_0x5da63f[_0xc117('0x36')]=_[_0xc117('0x38')](_0x5da63f[_0xc117('0x36')],{'$or':_['map'](_0x35efea,function(_0x1295b8){if(_0x1295b8[_0xc117('0x29')]!=='VIRTUAL'){var _0x1b5027={};_0x1b5027[_0x1295b8[_0xc117('0x24')]]={'$like':'%'+_0x5ca655[_0xc117('0x2d')]['filter']+'%'};return _0x1b5027;}})});}_0x5da63f=_['merge']({},_0x5da63f,_0x5ca655['options']);var _0x124aee={'where':_0x5da63f['where']};return db[_0xc117('0x39')][_0xc117('0x17')](_0x124aee)[_0xc117('0x20')](function(_0x3b44c5){_0x202dd4[_0xc117('0x17')]=_0x3b44c5;if(_0x5ca655[_0xc117('0x2d')]['includeAll']){_0x5da63f[_0xc117('0x3a')]=[{'all':!![]}];}return db[_0xc117('0x39')]['findAll'](_0x5da63f);})[_0xc117('0x20')](function(_0x56e359){_0x202dd4[_0xc117('0x3b')]=_0x56e359;return _0x202dd4;})[_0xc117('0x20')](respondWithFilteredResult(_0x334041,_0x5da63f))[_0xc117('0x3c')](handleError(_0x334041,null));};exports['show']=function(_0x154841,_0xb90f1a){var _0x2e0820={'raw':![],'where':{'id':_0x154841['params']['id']}},_0x407d21={};_0x407d21[_0xc117('0x2b')]=_[_0xc117('0x2c')](db['IntegrationReport'][_0xc117('0x28')]);_0x407d21[_0xc117('0x2d')]=_['keys'](_0x154841[_0xc117('0x2d')]);_0x407d21['filters']=_[_0xc117('0x2f')](_0x407d21[_0xc117('0x2b')],_0x407d21[_0xc117('0x2d')]);_0x2e0820[_0xc117('0x30')]=_['intersection'](_0x407d21['model'],qs['fields'](_0x154841[_0xc117('0x2d')][_0xc117('0x3d')]));_0x2e0820['attributes']=_0x2e0820['attributes']['length']?_0x2e0820[_0xc117('0x30')]:_0x407d21[_0xc117('0x2b')];if(_0x154841[_0xc117('0x2d')][_0xc117('0x3e')]){_0x2e0820[_0xc117('0x3a')]=[{'all':!![]}];}_0x2e0820=_[_0xc117('0x38')]({},_0x2e0820,_0x154841['options']);return db['IntegrationReport'][_0xc117('0x3f')](_0x2e0820)[_0xc117('0x20')](handleEntityNotFound(_0xb90f1a,null))['then'](respondWithResult(_0xb90f1a,null))['catch'](handleError(_0xb90f1a,null));};exports[_0xc117('0x40')]=function(_0x55c7be,_0x339e8f){return db[_0xc117('0x39')][_0xc117('0x40')](_0x55c7be[_0xc117('0x41')],{})['then'](respondWithResult(_0x339e8f,0xc9))[_0xc117('0x3c')](handleError(_0x339e8f,null));};exports[_0xc117('0x1f')]=function(_0x4bca5e,_0x5e72f1){if(_0x4bca5e[_0xc117('0x41')]['id']){delete _0x4bca5e['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x4bca5e[_0xc117('0x42')]['id']}})[_0xc117('0x20')](handleEntityNotFound(_0x5e72f1,null))[_0xc117('0x20')](saveUpdates(_0x4bca5e[_0xc117('0x41')],null))[_0xc117('0x20')](respondWithResult(_0x5e72f1,null))[_0xc117('0x3c')](handleError(_0x5e72f1,null));};exports['destroy']=function(_0x4fc206,_0x8f9eba){return db[_0xc117('0x39')][_0xc117('0x3f')]({'where':{'id':_0x4fc206[_0xc117('0x42')]['id']}})[_0xc117('0x20')](handleEntityNotFound(_0x8f9eba,null))[_0xc117('0x20')](removeEntity(_0x8f9eba,null))['catch'](handleError(_0x8f9eba,null));};exports[_0xc117('0x43')]=function(_0xa44d10,_0x29b5ae){return db[_0xc117('0x39')][_0xc117('0x43')]()[_0xc117('0x20')](respondWithResult(_0x29b5ae,null))[_0xc117('0x3c')](handleError(_0x29b5ae,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 011c603..2d286de 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 _0x0c16=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a92ea,_0xefc15b){var _0x8eb7d1=function(_0x541c8b){while(--_0x541c8b){_0x4a92ea['push'](_0x4a92ea['shift']());}};_0x8eb7d1(++_0xefc15b);}(_0x0c16,0x1c0));var _0x60c1=function(_0x4c29f9,_0x5bddd4){_0x4c29f9=_0x4c29f9-0x0;var _0x4e17b8=_0x0c16[_0x4c29f9];return _0x4e17b8;};'use strict';var _=require(_0x60c1('0x0'));var util=require(_0x60c1('0x1'));var logger=require(_0x60c1('0x2'))(_0x60c1('0x3'));var moment=require(_0x60c1('0x4'));var BPromise=require(_0x60c1('0x5'));var rp=require(_0x60c1('0x6'));var fs=require('fs');var path=require(_0x60c1('0x7'));var rimraf=require(_0x60c1('0x8'));var config=require(_0x60c1('0x9'));var attributes=require(_0x60c1('0xa'));module[_0x60c1('0xb')]=function(_0x1f1a04,_0x2ac2c9){return _0x1f1a04['define'](_0x60c1('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x609c=['lodash','util','../../config/logger','api','moment','request-promise','path','./integrationReport.attributes','exports','define','IntegrationReport'];(function(_0x34e14d,_0x5dea39){var _0x3d8e08=function(_0x134769){while(--_0x134769){_0x34e14d['push'](_0x34e14d['shift']());}};_0x3d8e08(++_0x5dea39);}(_0x609c,0x134));var _0xc609=function(_0x420602,_0x513e19){_0x420602=_0x420602-0x0;var _0x269a9c=_0x609c[_0x420602];return _0x269a9c;};'use strict';var _=require(_0xc609('0x0'));var util=require(_0xc609('0x1'));var logger=require(_0xc609('0x2'))(_0xc609('0x3'));var moment=require(_0xc609('0x4'));var BPromise=require('bluebird');var rp=require(_0xc609('0x5'));var fs=require('fs');var path=require(_0xc609('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc609('0x7'));module[_0xc609('0x8')]=function(_0x211cad,_0x286d3f){return _0x211cad[_0xc609('0x9')](_0xc609('0xa'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index cfc8e32..7b0e7c2 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x557b32,_0x5042f5){var _0x2d11ed=function(_0x4c1865){while(--_0x4c1865){_0x557b32['push'](_0x557b32['shift']());}};_0x2d11ed(++_0x5042f5);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +var _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x4fc2,0x111));var _0x24fc=function(_0x35a329,_0x488fee){_0x35a329=_0x35a329-0x0;var _0x4cbdb1=_0x4fc2[_0x35a329];return _0x4cbdb1;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ad40517..4425543 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 _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x2cfa1c,_0x30dac3){var _0x5c199f=function(_0x158a6e){while(--_0x158a6e){_0x2cfa1c['push'](_0x2cfa1c['shift']());}};_0x5c199f(++_0x30dac3);}(_0x008c,0x188));var _0xc008=function(_0x5e5088,_0x28cd71){_0x5e5088=_0x5e5088-0x0;var _0x3de657=_0x008c[_0x5e5088];return _0x3de657;};'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 auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x15')]=router; \ No newline at end of file +var _0x34e8=['./interval.controller','get','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','/:id','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x317ab1,_0x42dcd6){var _0x7488db=function(_0x4e6d1f){while(--_0x4e6d1f){_0x317ab1['push'](_0x317ab1['shift']());}};_0x7488db(++_0x42dcd6);}(_0x34e8,0x12c));var _0x834e=function(_0x2379d3,_0x684446){_0x2379d3=_0x2379d3-0x0;var _0x46beff=_0x34e8[_0x2379d3];return _0x46beff;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0xe')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0xe')](_0x834e('0x11'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);router['put'](_0x834e('0x13'),auth[_0x834e('0xa')](),controller['update']);router[_0x834e('0x14')](_0x834e('0x13'),auth[_0x834e('0xa')](),controller[_0x834e('0x15')]);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 14910e9..d74c26e 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 _0x257a=['STRING','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x257a,0x9a));var _0xa257=function(_0x234431,_0x1f4210){_0x234431=_0x234431-0x0;var _0x7c5905=_0x257a[_0x234431];return _0x7c5905;};'use strict';var Sequelize=require(_0xa257('0x0'));module[_0xa257('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa257('0x2')]},'interval':{'type':Sequelize[_0xa257('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xc1fa=['STRING'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xc1fa,0xe5));var _0xac1f=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0xc1fa[_0x4b73a2];return _0x383c66;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xac1f('0x0')]},'description':{'type':Sequelize[_0xac1f('0x0')]},'interval':{'type':Sequelize[_0xac1f('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index c8cdd17..d0764b3 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 _0x008c=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model'];(function(_0x272700,_0x525483){var _0x3927a4=function(_0x5a98e0){while(--_0x5a98e0){_0x272700['push'](_0x272700['shift']());}};_0x3927a4(++_0x525483);}(_0x008c,0x188));var _0xc008=function(_0x42f687,_0x558724){_0x42f687=_0x42f687-0x0;var _0x108838=_0x008c[_0x42f687];return _0x108838;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var extensions=require(_0xc008('0x17'));function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Intervals';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['Interval']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']));if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':!![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['Interval'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['Interval']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){if(_0x4b4c6d[_0xc008('0x4f')]['id']){delete _0x4b4c6d['body']['id'];}return db['Interval'][_0xc008('0x45')]({'where':{'id':_0x4b4c6d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))[_0xc008('0x20')](saveUpdates(_0x4b4c6d[_0xc008('0x4f')],null))['then'](respondWithResult(_0x24f775,null))['catch'](handleError(_0x24f775,null));};exports[_0xc008('0x1f')]=function(_0x5d815d,_0x3d7cce){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x5d815d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3d7cce,null))[_0xc008('0x20')](removeEntity(_0x3d7cce,null))['catch'](handleError(_0x3d7cce,null));};exports[_0xc008('0x50')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){if(_0xbd7422[_0xc008('0x4f')]['id']){delete _0xbd7422['body']['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0xbd7422['params']['id']}})['then'](handleEntityNotFound(_0x9a7abc,null))[_0xc008('0x20')](function(_0x1bcbb1){if(_0x1bcbb1){_0xbd7422[_0xc008('0x4f')]['IntervalId']=_0x1bcbb1['id'];return db[_0xc008('0x3d')][_0xc008('0x46')](_0xbd7422[_0xc008('0x4f')]);}})['then'](respondWithResult(_0x9a7abc,null))[_0xc008('0x40')](handleError(_0x9a7abc,null));};exports[_0xc008('0x51')]=function(_0x12ba3f,_0x1b5a22,_0x5baff1){var _0x4022dd={};var _0x4eaa6d={};var _0x23ef33;var _0x422e1f;return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x12ba3f[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b5a22,null))['then'](function(_0x375e71){if(_0x375e71){_0x23ef33=_0x375e71;_0x4eaa6d['model']=_['keys'](db[_0xc008('0x3d')][_0xc008('0x43')]);_0x4eaa6d['query']=_[_0xc008('0x2c')](_0x12ba3f[_0xc008('0x2b')]);_0x4eaa6d[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x4eaa6d[_0xc008('0x2a')],_0x4eaa6d[_0xc008('0x2b')]);_0x4022dd[_0xc008('0x2f')]=_['intersection'](_0x4eaa6d[_0xc008('0x2a')],qs[_0xc008('0x30')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x30')]));_0x4022dd[_0xc008('0x2f')]=_0x4022dd[_0xc008('0x2f')][_0xc008('0x31')]?_0x4022dd[_0xc008('0x2f')]:_0x4eaa6d[_0xc008('0x2a')];_0x4022dd[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x36')]);_0x4022dd[_0xc008('0x38')]=qs['filters'](_[_0xc008('0x37')](_0x12ba3f[_0xc008('0x2b')],_0x4eaa6d[_0xc008('0x2d')]));if(_0x12ba3f['query'][_0xc008('0x3a')]){_0x4022dd[_0xc008('0x38')]=_['merge'](_0x4022dd['where'],{'$or':_[_0xc008('0x26')](_0x4022dd[_0xc008('0x2f')],function(_0x7bad14){var _0x39083c={};_0x39083c[_0x7bad14]={'$like':'%'+_0x12ba3f[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x39083c;})});}_0x4022dd=_[_0xc008('0x3b')]({},_0x4022dd,_0x12ba3f[_0xc008('0x3c')]);return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0x383325){if(_0x383325){_0x422e1f=_0x383325['length'];if(!_0x12ba3f[_0xc008('0x2b')][_0xc008('0x53')](_0xc008('0x32'))){_0x4022dd[_0xc008('0x33')]=qs['limit'](_0x12ba3f[_0xc008('0x2b')]['limit']);_0x4022dd[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x12ba3f[_0xc008('0x2b')]['offset']);}return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0xa80000){if(_0xa80000){return _0xa80000?{'count':_0x422e1f,'rows':_0xa80000}:null;}})['then'](respondWithResult(_0x1b5a22,null))[_0xc008('0x40')](handleError(_0x1b5a22,null));};exports['addIntervals']=function(_0x50ee03,_0xee7a85,_0x23012c){return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x50ee03['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0xee7a85,null))[_0xc008('0x20')](function(_0x49493b){if(_0x49493b){return db[_0xc008('0x54')]['transaction'](function(_0x278cbe){return db['Interval'][_0xc008('0x1f')]({'where':{'IntervalId':_0x50ee03['params']['id']},'transaction':_0x278cbe})[_0xc008('0x20')](function(_0x103d75){var _0x33d8e4=_[_0xc008('0x26')](_0x50ee03['body'],function(_0x57752c){delete _0x57752c['id'];_0x57752c[_0xc008('0x55')]=_0x50ee03[_0xc008('0x42')]['id'];return _0x57752c;});return db[_0xc008('0x3d')][_0xc008('0x56')](_0x33d8e4,{'transaction':_0x278cbe});});})[_0xc008('0x20')](function(){return db[_0xc008('0x3d')][_0xc008('0x3f')]({'where':{'IntervalId':_0x50ee03['params']['id']}});});}})[_0xc008('0x20')](respondWithResult(_0xee7a85,null))['catch'](handleError(_0xee7a85,null));}; \ No newline at end of file +var _0x70e0=['findAll','rows','catch','show','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addInterval','getIntervals','findOne','order','hasOwnProperty','addIntervals','transaction','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','offset','limit','set','apply','update','destroy','then','get','Intervals','sendStatus','stack','name','send','index','rawAttributes','fieldName','key','model','map','intersection','query','attributes','fields','length','sort','pick','filters','filter','merge','where','type','VIRTUAL','options','Interval','count'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x70e0,0x17b));var _0x070e=function(_0x231947,_0x2c8e00){_0x231947=_0x231947-0x0;var _0x38409d=_0x70e0[_0x231947];return _0x38409d;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];var extensions=require(_0x070e('0x16'));function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x17')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x18')](_0x4a33d2)[_0x070e('0x19')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=_0x373d86['count'],_0x180897=_0x5d3a38[_0x070e('0x1a')],_0x19d9da=_0x5d3a38[_0x070e('0x1a')]+_0x5d3a38[_0x070e('0x1b')],_0x5bc71e;if(_0x19d9da>=_0xeae1a5){_0x19d9da=_0xeae1a5;_0x5bc71e=0xc8;}else{_0x5bc71e=0xce;}_0x51d14d[_0x070e('0x18')](_0x5bc71e);return _0x51d14d[_0x070e('0x1c')]('Content-Range',_0x180897+'-'+_0x19d9da+'/'+_0xeae1a5)[_0x070e('0x19')](_0x373d86);}return null;};}function patchUpdates(_0x168dc6){return function(_0x1ad3de){try{jsonpatch[_0x070e('0x1d')](_0x1ad3de,_0x168dc6,!![]);}catch(_0x259893){return BPromise['reject'](_0x259893);}return _0x1ad3de['save']();};}function saveUpdates(_0x4e958f,_0x9907cf){return function(_0x3004f0){if(_0x3004f0){return _0x3004f0[_0x070e('0x1e')](_0x4e958f)['then'](function(_0x5b184){return _0x5b184;});}return null;};}function removeEntity(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x1f')]()[_0x070e('0x20')](function(){var _0x28a1c3=_0x3f6985[_0x070e('0x21')]({'plain':!![]});var _0xe405e=_0x070e('0x22');return db['UserProfileResource'][_0x070e('0x1f')]({'where':{'type':_0xe405e,'resourceId':_0x28a1c3['id']}})[_0x070e('0x20')](function(){return _0x3f6985;});})[_0x070e('0x20')](function(){_0x5dc5d2['status'](0xcc)[_0x070e('0x17')]();});}};}function handleEntityNotFound(_0x5f3e9d,_0x4a2dbd){return function(_0x2ccbd7){if(!_0x2ccbd7){_0x5f3e9d[_0x070e('0x23')](0x194);}return _0x2ccbd7;};}function handleError(_0x41deb1,_0x1743cc){_0x1743cc=_0x1743cc||0x1f4;return function(_0x4763c6){logger['error'](_0x4763c6[_0x070e('0x24')]);if(_0x4763c6[_0x070e('0x25')]){delete _0x4763c6[_0x070e('0x25')];}_0x41deb1[_0x070e('0x18')](_0x1743cc)[_0x070e('0x26')](_0x4763c6);};}exports[_0x070e('0x27')]=function(_0x1a1892,_0x26373b){var _0x5e8326={},_0x282344={},_0x351641={'count':0x0,'rows':[]};var _0x3a16d0=_['map'](db['Interval'][_0x070e('0x28')],function(_0x46065c){return{'name':_0x46065c[_0x070e('0x29')],'type':_0x46065c['type'][_0x070e('0x2a')]};});_0x282344[_0x070e('0x2b')]=_[_0x070e('0x2c')](_0x3a16d0,_0x070e('0x25'));_0x282344['query']=_['keys'](_0x1a1892['query']);_0x282344['filters']=_[_0x070e('0x2d')](_0x282344['model'],_0x282344[_0x070e('0x2e')]);_0x5e8326[_0x070e('0x2f')]=_['intersection'](_0x282344['model'],qs[_0x070e('0x30')](_0x1a1892[_0x070e('0x2e')]['fields']));_0x5e8326['attributes']=_0x5e8326[_0x070e('0x2f')][_0x070e('0x31')]?_0x5e8326[_0x070e('0x2f')]:_0x282344[_0x070e('0x2b')];if(!_0x1a1892[_0x070e('0x2e')]['hasOwnProperty']('nolimit')){_0x5e8326[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1b')]);_0x5e8326[_0x070e('0x1a')]=qs['offset'](_0x1a1892[_0x070e('0x2e')][_0x070e('0x1a')]);}_0x5e8326['order']=qs[_0x070e('0x32')](_0x1a1892[_0x070e('0x2e')]['sort']);_0x5e8326['where']=qs['filters'](_[_0x070e('0x33')](_0x1a1892[_0x070e('0x2e')],_0x282344[_0x070e('0x34')]));if(_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]){_0x5e8326['where']=_[_0x070e('0x36')](_0x5e8326[_0x070e('0x37')],{'$or':_[_0x070e('0x2c')](_0x3a16d0,function(_0x487276){if(_0x487276[_0x070e('0x38')]!==_0x070e('0x39')){var _0x165c16={};_0x165c16[_0x487276['name']]={'$like':'%'+_0x1a1892[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x165c16;}})});}_0x5e8326=_['merge']({},_0x5e8326,_0x1a1892[_0x070e('0x3a')]);var _0x5d689b={'where':_0x5e8326[_0x070e('0x37')]};return db[_0x070e('0x3b')][_0x070e('0x3c')](_0x5d689b)[_0x070e('0x20')](function(_0xd03404){_0x351641['count']=_0xd03404;if(_0x1a1892[_0x070e('0x2e')]['includeAll']){_0x5e8326['include']=[{'all':!![]}];}return db[_0x070e('0x3b')][_0x070e('0x3d')](_0x5e8326);})[_0x070e('0x20')](function(_0x4d52ff){_0x351641[_0x070e('0x3e')]=_0x4d52ff;return _0x351641;})[_0x070e('0x20')](respondWithFilteredResult(_0x26373b,_0x5e8326))[_0x070e('0x3f')](handleError(_0x26373b,null));};exports[_0x070e('0x40')]=function(_0x4a4ee3,_0x13e4e0){var _0x5851ab={'raw':!![],'where':{'id':_0x4a4ee3['params']['id']}},_0x544b53={};_0x544b53[_0x070e('0x2b')]=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x544b53[_0x070e('0x2e')]=_['keys'](_0x4a4ee3[_0x070e('0x2e')]);_0x544b53['filters']=_[_0x070e('0x2d')](_0x544b53[_0x070e('0x2b')],_0x544b53[_0x070e('0x2e')]);_0x5851ab['attributes']=_['intersection'](_0x544b53[_0x070e('0x2b')],qs['fields'](_0x4a4ee3[_0x070e('0x2e')][_0x070e('0x30')]));_0x5851ab[_0x070e('0x2f')]=_0x5851ab['attributes'][_0x070e('0x31')]?_0x5851ab[_0x070e('0x2f')]:_0x544b53['model'];if(_0x4a4ee3['query'][_0x070e('0x42')]){_0x5851ab[_0x070e('0x43')]=[{'all':!![]}];}_0x5851ab=_[_0x070e('0x36')]({},_0x5851ab,_0x4a4ee3[_0x070e('0x3a')]);return db[_0x070e('0x3b')]['find'](_0x5851ab)[_0x070e('0x20')](handleEntityNotFound(_0x13e4e0,null))[_0x070e('0x20')](respondWithResult(_0x13e4e0,null))[_0x070e('0x3f')](handleError(_0x13e4e0,null));};exports[_0x070e('0x44')]=function(_0x79eaa0,_0xcd1c61){return db[_0x070e('0x3b')][_0x070e('0x44')](_0x79eaa0[_0x070e('0x45')],{})[_0x070e('0x20')](function(_0x210c4d){var _0x3be553=_0x79eaa0[_0x070e('0x46')][_0x070e('0x21')]({'plain':!![]});if(!_0x3be553)throw new Error(_0x070e('0x47'));if(_0x3be553['role']===_0x070e('0x46')){var _0xa7a41b=_0x210c4d[_0x070e('0x21')]({'plain':!![]});var _0x249e3f=_0x070e('0x22');return db[_0x070e('0x48')][_0x070e('0x49')]({'where':{'name':_0x249e3f,'userProfileId':_0x3be553[_0x070e('0x4a')]},'raw':!![]})[_0x070e('0x20')](function(_0x5744c5){if(_0x5744c5&&_0x5744c5[_0x070e('0x4b')]===0x0){return db['UserProfileResource'][_0x070e('0x44')]({'name':_0xa7a41b[_0x070e('0x25')],'resourceId':_0xa7a41b['id'],'type':_0x5744c5['name'],'sectionId':_0x5744c5['id']},{})[_0x070e('0x20')](function(){return _0x210c4d;});}else{return _0x210c4d;}})[_0x070e('0x3f')](function(_0x25466f){logger[_0x070e('0x4c')](_0x070e('0x4d'),_0x25466f);throw _0x25466f;});}return _0x210c4d;})[_0x070e('0x20')](respondWithResult(_0xcd1c61,0xc9))[_0x070e('0x3f')](handleError(_0xcd1c61,null));};exports['update']=function(_0x296978,_0x5bacbd){if(_0x296978['body']['id']){delete _0x296978[_0x070e('0x45')]['id'];}return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x296978[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x5bacbd,null))[_0x070e('0x20')](saveUpdates(_0x296978[_0x070e('0x45')],null))[_0x070e('0x20')](respondWithResult(_0x5bacbd,null))['catch'](handleError(_0x5bacbd,null));};exports[_0x070e('0x1f')]=function(_0x51d27d,_0x564d82){return db[_0x070e('0x3b')][_0x070e('0x49')]({'where':{'id':_0x51d27d['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x564d82,null))[_0x070e('0x20')](removeEntity(_0x564d82,null))[_0x070e('0x3f')](handleError(_0x564d82,null));};exports[_0x070e('0x4f')]=function(_0x1aacfc,_0x382ce3,_0x1b36cd){if(_0x1aacfc['body']['id']){delete _0x1aacfc['body']['id'];}return db['Interval'][_0x070e('0x49')]({'where':{'id':_0x1aacfc[_0x070e('0x4e')]['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x382ce3,null))[_0x070e('0x20')](function(_0x5ac0b5){if(_0x5ac0b5){_0x1aacfc[_0x070e('0x45')]['IntervalId']=_0x5ac0b5['id'];return db[_0x070e('0x3b')][_0x070e('0x44')](_0x1aacfc[_0x070e('0x45')]);}})[_0x070e('0x20')](respondWithResult(_0x382ce3,null))[_0x070e('0x3f')](handleError(_0x382ce3,null));};exports[_0x070e('0x50')]=function(_0x5561ed,_0x20ff87,_0x18e8d0){var _0x8aaf00={};var _0x533431={};var _0x1d7873;var _0x1da803;return db['Interval'][_0x070e('0x51')]({'where':{'id':_0x5561ed['params']['id']}})[_0x070e('0x20')](handleEntityNotFound(_0x20ff87,null))['then'](function(_0x4cb86f){if(_0x4cb86f){_0x1d7873=_0x4cb86f;_0x533431['model']=_[_0x070e('0x41')](db[_0x070e('0x3b')][_0x070e('0x28')]);_0x533431[_0x070e('0x2e')]=_[_0x070e('0x41')](_0x5561ed[_0x070e('0x2e')]);_0x533431['filters']=_[_0x070e('0x2d')](_0x533431['model'],_0x533431[_0x070e('0x2e')]);_0x8aaf00['attributes']=_[_0x070e('0x2d')](_0x533431[_0x070e('0x2b')],qs['fields'](_0x5561ed[_0x070e('0x2e')]['fields']));_0x8aaf00[_0x070e('0x2f')]=_0x8aaf00[_0x070e('0x2f')][_0x070e('0x31')]?_0x8aaf00[_0x070e('0x2f')]:_0x533431[_0x070e('0x2b')];_0x8aaf00[_0x070e('0x52')]=qs[_0x070e('0x32')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x32')]);_0x8aaf00[_0x070e('0x37')]=qs[_0x070e('0x34')](_[_0x070e('0x33')](_0x5561ed[_0x070e('0x2e')],_0x533431[_0x070e('0x34')]));if(_0x5561ed['query'][_0x070e('0x35')]){_0x8aaf00[_0x070e('0x37')]=_[_0x070e('0x36')](_0x8aaf00[_0x070e('0x37')],{'$or':_['map'](_0x8aaf00[_0x070e('0x2f')],function(_0x4e8e58){var _0x398f54={};_0x398f54[_0x4e8e58]={'$like':'%'+_0x5561ed[_0x070e('0x2e')][_0x070e('0x35')]+'%'};return _0x398f54;})});}_0x8aaf00=_[_0x070e('0x36')]({},_0x8aaf00,_0x5561ed['options']);return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x240ec9){if(_0x240ec9){_0x1da803=_0x240ec9[_0x070e('0x31')];if(!_0x5561ed['query'][_0x070e('0x53')]('nolimit')){_0x8aaf00[_0x070e('0x1b')]=qs[_0x070e('0x1b')](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1b')]);_0x8aaf00[_0x070e('0x1a')]=qs['offset'](_0x5561ed[_0x070e('0x2e')][_0x070e('0x1a')]);}return _0x1d7873[_0x070e('0x50')](_0x8aaf00);}})[_0x070e('0x20')](function(_0x5591dd){if(_0x5591dd){return _0x5591dd?{'count':_0x1da803,'rows':_0x5591dd}:null;}})[_0x070e('0x20')](respondWithResult(_0x20ff87,null))['catch'](handleError(_0x20ff87,null));};exports[_0x070e('0x54')]=function(_0x44e465,_0x1214d2,_0x57585e){return db[_0x070e('0x3b')]['findOne']({'where':{'id':_0x44e465[_0x070e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1214d2,null))[_0x070e('0x20')](function(_0x17b28c){if(_0x17b28c){return db['sequelize'][_0x070e('0x55')](function(_0x53f9a8){return db[_0x070e('0x3b')][_0x070e('0x1f')]({'where':{'IntervalId':_0x44e465['params']['id']},'transaction':_0x53f9a8})['then'](function(_0x29ee66){var _0x3022cd=_[_0x070e('0x2c')](_0x44e465[_0x070e('0x45')],function(_0x25f1d0){delete _0x25f1d0['id'];_0x25f1d0[_0x070e('0x56')]=_0x44e465[_0x070e('0x4e')]['id'];return _0x25f1d0;});return db[_0x070e('0x3b')][_0x070e('0x57')](_0x3022cd,{'transaction':_0x53f9a8});});})[_0x070e('0x20')](function(){return db[_0x070e('0x3b')][_0x070e('0x3d')]({'where':{'IntervalId':_0x44e465[_0x070e('0x4e')]['id']}});});}})['then'](respondWithResult(_0x1214d2,null))[_0x070e('0x3f')](handleError(_0x1214d2,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 773515b..ee469ac 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 _0xe348=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','api','moment'];(function(_0x2eed63,_0x2ce0ed){var _0x358d8a=function(_0x5babc3){while(--_0x5babc3){_0x2eed63['push'](_0x2eed63['shift']());}};_0x358d8a(++_0x2ce0ed);}(_0xe348,0x137));var _0x8e34=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xe348[_0x20589d];return _0x422de9;};'use strict';var _=require(_0x8e34('0x0'));var util=require(_0x8e34('0x1'));var logger=require('../../config/logger')(_0x8e34('0x2'));var moment=require(_0x8e34('0x3'));var BPromise=require(_0x8e34('0x4'));var rp=require(_0x8e34('0x5'));var fs=require('fs');var path=require(_0x8e34('0x6'));var rimraf=require(_0x8e34('0x7'));var config=require(_0x8e34('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0x8e34('0x9'));module[_0x8e34('0xa')]=function(_0x155a8f,_0x4e8565){return _0x155a8f[_0x8e34('0xb')](_0x8e34('0xc'),attributes,{'tableName':_0x8e34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41e8a8,_0x4bd6af){extensions[_0x8e34('0xe')](_0x155a8f,_0x41e8a8);},'afterBulkCreate':function(_0x3ee4d8,_0xe8162,_0x44f709){_0x44f709();extensions[_0x8e34('0xe')](_0x155a8f,_0x3ee4d8[0x0]);},'afterUpdate':function(_0x278c23,_0x7a31cb){extensions[_0x8e34('0xe')](_0x155a8f,_0x278c23);},'afterDestroy':function(_0x3970dc,_0x400766){extensions['rewrite'](_0x155a8f,_0x3970dc);}}});}; \ No newline at end of file +var _0x32e3=['path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5d8661,_0x3b49e4){var _0x3bd29d=function(_0x3a970c){while(--_0x3a970c){_0x5d8661['push'](_0x5d8661['shift']());}};_0x3bd29d(++_0x3b49e4);}(_0x32e3,0x104));var _0x332e=function(_0x4f89a4,_0x37c5d2){_0x4f89a4=_0x4f89a4-0x0;var _0x19c2b4=_0x32e3[_0x4f89a4];return _0x19c2b4;};'use strict';var _=require('lodash');var util=require(_0x332e('0x0'));var logger=require(_0x332e('0x1'))(_0x332e('0x2'));var moment=require(_0x332e('0x3'));var BPromise=require(_0x332e('0x4'));var rp=require(_0x332e('0x5'));var fs=require('fs');var path=require(_0x332e('0x6'));var rimraf=require('rimraf');var config=require(_0x332e('0x7'));var attributes=require(_0x332e('0x8'));var extensions=require(_0x332e('0x9'));module[_0x332e('0xa')]=function(_0x40eca3,_0x2c1ee8){return _0x40eca3[_0x332e('0xb')]('Interval',attributes,{'tableName':_0x332e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4a134a,_0xd0479a){extensions[_0x332e('0xd')](_0x40eca3,_0x4a134a);},'afterBulkCreate':function(_0x33f3d9,_0x542d8c,_0x5e574d){_0x5e574d();extensions[_0x332e('0xd')](_0x40eca3,_0x33f3d9[0x0]);},'afterUpdate':function(_0xb78639,_0x24ce90){extensions[_0x332e('0xd')](_0x40eca3,_0xb78639);},'afterDestroy':function(_0x24b50f,_0x3493b2){extensions[_0x332e('0xd')](_0x40eca3,_0x24b50f);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 00ee6ce..56e9343 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 _0xb503=['model','map','then','stringify','ShowInterval','find','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','Interval,\x20%s,\x20%s','message','result','catch','GetInterval','Interval','options','where','attributes','include'];(function(_0x1c6315,_0x114ff7){var _0x19074f=function(_0x10b203){while(--_0x10b203){_0x1c6315['push'](_0x1c6315['shift']());}};_0x19074f(++_0x114ff7);}(_0xb503,0xc6));var _0x3b50=function(_0x24773a,_0x57cd40){_0x24773a=_0x24773a-0x0;var _0x62bb6e=_0xb503[_0x24773a];return _0x62bb6e;};'use strict';var _=require(_0x3b50('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b50('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b50('0x2'))['db'];var utils=require(_0x3b50('0x3'));var logger=require(_0x3b50('0x4'))(_0x3b50('0x5'));var config=require(_0x3b50('0x6'));var jayson=require(_0x3b50('0x7'));var client=jayson[_0x3b50('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399d08,_0xfda19b,_0x1f4397){return new BPromise(function(_0x134982,_0xc8211b){return client[_0x3b50('0x9')](_0x399d08,_0x1f4397)['then'](function(_0x4c931f){logger[_0x3b50('0xa')]('Interval,\x20%s,\x20%s',_0xfda19b,_0x3b50('0xb'));logger[_0x3b50('0xc')](_0x3b50('0xd'),_0xfda19b,'request\x20sent',JSON['stringify'](_0x4c931f));if(_0x4c931f['error']){if(_0x4c931f[_0x3b50('0xe')][_0x3b50('0xf')]===0x1f4){logger[_0x3b50('0xe')](_0x3b50('0x10'),_0xfda19b,_0x4c931f[_0x3b50('0xe')][_0x3b50('0x11')]);return _0xc8211b(_0x4c931f['error'][_0x3b50('0x11')]);}logger[_0x3b50('0xe')](_0x3b50('0x10'),_0xfda19b,_0x4c931f[_0x3b50('0xe')][_0x3b50('0x11')]);return _0x134982(_0x4c931f['error'][_0x3b50('0x11')]);}else{logger['info'](_0x3b50('0x10'),_0xfda19b,_0x3b50('0xb'));_0x134982(_0x4c931f[_0x3b50('0x12')][_0x3b50('0x11')]);}})[_0x3b50('0x13')](function(_0x4f0f91){logger[_0x3b50('0xe')](_0x3b50('0x10'),_0xfda19b,_0x4f0f91);_0xc8211b(_0x4f0f91);});});}exports[_0x3b50('0x14')]=function(_0x5dcd05){var _0x49ba37=this;return new Promise(function(_0x1fb365,_0x51cfa0){return db[_0x3b50('0x15')]['findAll']({'raw':_0x5dcd05['options']?_0x5dcd05[_0x3b50('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5dcd05['options']?_0x5dcd05['options'][_0x3b50('0x17')]||null:null,'attributes':_0x5dcd05[_0x3b50('0x16')]?_0x5dcd05[_0x3b50('0x16')][_0x3b50('0x18')]||null:null,'limit':_0x5dcd05[_0x3b50('0x16')]?_0x5dcd05[_0x3b50('0x16')]['limit']||null:null,'include':_0x5dcd05['options']?_0x5dcd05[_0x3b50('0x16')][_0x3b50('0x19')]?_['map'](_0x5dcd05['options'][_0x3b50('0x19')],function(_0x360e08){return{'model':db[_0x360e08[_0x3b50('0x1a')]],'as':_0x360e08['as'],'attributes':_0x360e08[_0x3b50('0x18')],'include':_0x360e08[_0x3b50('0x19')]?_[_0x3b50('0x1b')](_0x360e08[_0x3b50('0x19')],function(_0x8f589c){return{'model':db[_0x8f589c[_0x3b50('0x1a')]],'as':_0x8f589c['as'],'attributes':_0x8f589c['attributes'],'include':_0x8f589c[_0x3b50('0x19')]?_['map'](_0x8f589c[_0x3b50('0x19')],function(_0x106a66){return{'model':db[_0x106a66[_0x3b50('0x1a')]],'as':_0x106a66['as'],'attributes':_0x106a66[_0x3b50('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b50('0x1c')](function(_0x2ff10c){logger[_0x3b50('0xa')](_0x3b50('0x14'),_0x5dcd05);logger[_0x3b50('0xc')](_0x3b50('0x14'),_0x5dcd05,JSON[_0x3b50('0x1d')](_0x2ff10c));_0x1fb365(_0x2ff10c);})[_0x3b50('0x13')](function(_0x12da6c){logger[_0x3b50('0xe')](_0x3b50('0x14'),_0x12da6c[_0x3b50('0x11')],_0x5dcd05);_0x51cfa0(_0x49ba37['error'](0x1f4,_0x12da6c[_0x3b50('0x11')]));});});};exports[_0x3b50('0x1e')]=function(_0x335d64){var _0x1bbe60=this;return new Promise(function(_0x1b997a,_0x3e0abd){return db[_0x3b50('0x15')][_0x3b50('0x1f')]({'raw':_0x335d64['options']?_0x335d64['options']['raw']===undefined?!![]:![]:!![],'where':_0x335d64[_0x3b50('0x16')]?_0x335d64[_0x3b50('0x16')][_0x3b50('0x17')]||null:null,'attributes':_0x335d64[_0x3b50('0x16')]?_0x335d64[_0x3b50('0x16')][_0x3b50('0x18')]||null:null,'include':_0x335d64[_0x3b50('0x16')]?_0x335d64[_0x3b50('0x16')][_0x3b50('0x19')]?_[_0x3b50('0x1b')](_0x335d64[_0x3b50('0x16')][_0x3b50('0x19')],function(_0x233dca){return{'model':db[_0x233dca[_0x3b50('0x1a')]],'as':_0x233dca['as'],'attributes':_0x233dca[_0x3b50('0x18')],'include':_0x233dca[_0x3b50('0x19')]?_[_0x3b50('0x1b')](_0x233dca[_0x3b50('0x19')],function(_0x1355bf){return{'model':db[_0x1355bf[_0x3b50('0x1a')]],'as':_0x1355bf['as'],'attributes':_0x1355bf[_0x3b50('0x18')],'include':_0x1355bf[_0x3b50('0x19')]?_['map'](_0x1355bf[_0x3b50('0x19')],function(_0x4044fc){return{'model':db[_0x4044fc[_0x3b50('0x1a')]],'as':_0x4044fc['as'],'attributes':_0x4044fc[_0x3b50('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b50('0x1c')](function(_0xcc2cae){logger[_0x3b50('0xa')](_0x3b50('0x1e'),_0x335d64);logger[_0x3b50('0xc')]('ShowInterval',_0x335d64,JSON[_0x3b50('0x1d')](_0xcc2cae));_0x1b997a(_0xcc2cae);})[_0x3b50('0x13')](function(_0x32a690){logger['error'](_0x3b50('0x1e'),_0x32a690['message'],_0x335d64);_0x3e0abd(_0x1bbe60[_0x3b50('0xe')](0x1f4,_0x32a690[_0x3b50('0x11')]));});});}; \ No newline at end of file +var _0x90d5=['info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Interval','findAll','options','where','attributes','map','model','include','GetInterval','ShowInterval','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x326539,_0x108886){var _0x2cbb6e=function(_0x47cfa4){while(--_0x47cfa4){_0x326539['push'](_0x326539['shift']());}};_0x2cbb6e(++_0x108886);}(_0x90d5,0xe1));var _0x590d=function(_0x2e5027,_0x3ad8cb){_0x2e5027=_0x2e5027-0x0;var _0x8f0591=_0x90d5[_0x2e5027];return _0x8f0591;};'use strict';var _=require(_0x590d('0x0'));var util=require(_0x590d('0x1'));var moment=require(_0x590d('0x2'));var BPromise=require(_0x590d('0x3'));var rs=require(_0x590d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x590d('0x5'))['db'];var utils=require(_0x590d('0x6'));var logger=require(_0x590d('0x7'))('rpc');var config=require(_0x590d('0x8'));var jayson=require(_0x590d('0x9'));var client=jayson['client'][_0x590d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x596a3f,_0x1af8a3,_0x181bc3){return new BPromise(function(_0x3767e9,_0x38428d){return client[_0x590d('0xb')](_0x596a3f,_0x181bc3)[_0x590d('0xc')](function(_0x1ef9f3){logger[_0x590d('0xd')](_0x590d('0xe'),_0x1af8a3,_0x590d('0xf'));logger[_0x590d('0x10')](_0x590d('0x11'),_0x1af8a3,_0x590d('0xf'),JSON[_0x590d('0x12')](_0x1ef9f3));if(_0x1ef9f3['error']){if(_0x1ef9f3['error']['code']===0x1f4){logger[_0x590d('0x13')](_0x590d('0xe'),_0x1af8a3,_0x1ef9f3[_0x590d('0x13')][_0x590d('0x14')]);return _0x38428d(_0x1ef9f3[_0x590d('0x13')]['message']);}logger[_0x590d('0x13')]('Interval,\x20%s,\x20%s',_0x1af8a3,_0x1ef9f3[_0x590d('0x13')][_0x590d('0x14')]);return _0x3767e9(_0x1ef9f3[_0x590d('0x13')]['message']);}else{logger[_0x590d('0xd')](_0x590d('0xe'),_0x1af8a3,_0x590d('0xf'));_0x3767e9(_0x1ef9f3[_0x590d('0x15')][_0x590d('0x14')]);}})[_0x590d('0x16')](function(_0x2ba308){logger[_0x590d('0x13')]('Interval,\x20%s,\x20%s',_0x1af8a3,_0x2ba308);_0x38428d(_0x2ba308);});});}exports['GetInterval']=function(_0xbef4f3){var _0x50dfce=this;return new Promise(function(_0x2e185b,_0x4b7579){return db[_0x590d('0x17')][_0x590d('0x18')]({'raw':_0xbef4f3[_0x590d('0x19')]?_0xbef4f3[_0x590d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xbef4f3[_0x590d('0x19')]?_0xbef4f3[_0x590d('0x19')][_0x590d('0x1a')]||null:null,'attributes':_0xbef4f3['options']?_0xbef4f3[_0x590d('0x19')][_0x590d('0x1b')]||null:null,'limit':_0xbef4f3['options']?_0xbef4f3[_0x590d('0x19')]['limit']||null:null,'include':_0xbef4f3[_0x590d('0x19')]?_0xbef4f3['options']['include']?_[_0x590d('0x1c')](_0xbef4f3['options']['include'],function(_0x47347c){return{'model':db[_0x47347c[_0x590d('0x1d')]],'as':_0x47347c['as'],'attributes':_0x47347c['attributes'],'include':_0x47347c[_0x590d('0x1e')]?_[_0x590d('0x1c')](_0x47347c[_0x590d('0x1e')],function(_0x45772c){return{'model':db[_0x45772c[_0x590d('0x1d')]],'as':_0x45772c['as'],'attributes':_0x45772c[_0x590d('0x1b')],'include':_0x45772c[_0x590d('0x1e')]?_[_0x590d('0x1c')](_0x45772c[_0x590d('0x1e')],function(_0x148917){return{'model':db[_0x148917[_0x590d('0x1d')]],'as':_0x148917['as'],'attributes':_0x148917[_0x590d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x590d('0xc')](function(_0x32f6b6){logger[_0x590d('0xd')](_0x590d('0x1f'),_0xbef4f3);logger[_0x590d('0x10')](_0x590d('0x1f'),_0xbef4f3,JSON['stringify'](_0x32f6b6));_0x2e185b(_0x32f6b6);})[_0x590d('0x16')](function(_0xba974e){logger[_0x590d('0x13')]('GetInterval',_0xba974e[_0x590d('0x14')],_0xbef4f3);_0x4b7579(_0x50dfce[_0x590d('0x13')](0x1f4,_0xba974e[_0x590d('0x14')]));});});};exports[_0x590d('0x20')]=function(_0x50097e){var _0x47b6f1=this;return new Promise(function(_0x12ca3f,_0x48d8d5){return db[_0x590d('0x17')][_0x590d('0x21')]({'raw':_0x50097e[_0x590d('0x19')]?_0x50097e[_0x590d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x50097e[_0x590d('0x19')]?_0x50097e['options'][_0x590d('0x1a')]||null:null,'attributes':_0x50097e[_0x590d('0x19')]?_0x50097e[_0x590d('0x19')][_0x590d('0x1b')]||null:null,'include':_0x50097e[_0x590d('0x19')]?_0x50097e[_0x590d('0x19')][_0x590d('0x1e')]?_[_0x590d('0x1c')](_0x50097e[_0x590d('0x19')][_0x590d('0x1e')],function(_0x126863){return{'model':db[_0x126863[_0x590d('0x1d')]],'as':_0x126863['as'],'attributes':_0x126863[_0x590d('0x1b')],'include':_0x126863[_0x590d('0x1e')]?_[_0x590d('0x1c')](_0x126863['include'],function(_0x46461a){return{'model':db[_0x46461a['model']],'as':_0x46461a['as'],'attributes':_0x46461a[_0x590d('0x1b')],'include':_0x46461a[_0x590d('0x1e')]?_[_0x590d('0x1c')](_0x46461a[_0x590d('0x1e')],function(_0x29a3cd){return{'model':db[_0x29a3cd['model']],'as':_0x29a3cd['as'],'attributes':_0x29a3cd[_0x590d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xdc3d03){logger[_0x590d('0xd')](_0x590d('0x20'),_0x50097e);logger[_0x590d('0x10')]('ShowInterval',_0x50097e,JSON[_0x590d('0x12')](_0xdc3d03));_0x12ca3f(_0xdc3d03);})['catch'](function(_0x39807a){logger[_0x590d('0x13')](_0x590d('0x20'),_0x39807a[_0x590d('0x14')],_0x50097e);_0x48d8d5(_0x47b6f1[_0x590d('0x13')](0x1f4,_0x39807a[_0x590d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 5a48b2e..1ef65e6 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 _0x8b97=['post','isAuthenticated','send','exports','express','../../components/auth/service','./jira.controller'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8b97,0x1d9));var _0x78b9=function(_0x3dc818,_0x3e902c){_0x3dc818=_0x3dc818-0x0;var _0xaaefed=_0x8b97[_0x3dc818];return _0xaaefed;};'use strict';var express=require(_0x78b9('0x0'));var router=express['Router']();var auth=require(_0x78b9('0x1'));var controller=require(_0x78b9('0x2'));router[_0x78b9('0x3')]('/',auth[_0x78b9('0x4')](),controller[_0x78b9('0x5')]);module[_0x78b9('0x6')]=router; \ No newline at end of file +var _0xdd44=['../../components/auth/service','./jira.controller','isAuthenticated','send','express','Router'];(function(_0x5571c0,_0x1ef78f){var _0x21bfe3=function(_0x4c56c2){while(--_0x4c56c2){_0x5571c0['push'](_0x5571c0['shift']());}};_0x21bfe3(++_0x1ef78f);}(_0xdd44,0x106));var _0x4dd4=function(_0x533528,_0x409d05){_0x533528=_0x533528-0x0;var _0x3189f1=_0xdd44[_0x533528];return _0x3189f1;};'use strict';var express=require(_0x4dd4('0x0'));var router=express[_0x4dd4('0x1')]();var auth=require(_0x4dd4('0x2'));var controller=require(_0x4dd4('0x3'));router['post']('/',auth[_0x4dd4('0x4')](),controller[_0x4dd4('0x5')]);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 5e0babf..7973d47 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 _0x8606=['headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','Report','issuetype','fields','customfield_11500','email','oldToken','newToken','customfield_11503','customfield_11504','reason','POST','application/json','toString','stringify','request','setEncoding','utf8','data','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body'];(function(_0x48a00f,_0x4dfad5){var _0x5f3f67=function(_0x465850){while(--_0x465850){_0x48a00f['push'](_0x48a00f['shift']());}};_0x5f3f67(++_0x4dfad5);}(_0x8606,0x108));var _0x6860=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x8606[_0x572165];return _0x8c8709;};'use strict';var BPromise=require(_0x6860('0x0'));var https=require('https');var logger=require(_0x6860('0x1'))('api');var USERNAME=_0x6860('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5339e0,_0x26d700){var _0xe62ac7={'fields':{'project':{'key':_0x5339e0['key']||'MOTGUI'},'summary':(_0x5339e0['summary']||_0x6860('0x3'))+'\x20from\x20'+_0x5339e0['ip'],'description':_0x5339e0['description']||JSON['stringify'](_0x5339e0),'issuetype':{'name':_0x5339e0[_0x6860('0x4')]||'Bug'}}};_0xe62ac7[_0x6860('0x5')][_0x6860('0x6')]=_0x5339e0[_0x6860('0x7')];_0xe62ac7[_0x6860('0x5')]['customfield_11501']=_0x5339e0[_0x6860('0x8')];_0xe62ac7[_0x6860('0x5')]['customfield_11502']=_0x5339e0[_0x6860('0x9')];_0xe62ac7[_0x6860('0x5')][_0x6860('0xa')]=_0x5339e0['name'];_0xe62ac7[_0x6860('0x5')][_0x6860('0xb')]=_0x5339e0[_0x6860('0xc')];_0xe62ac7[_0x6860('0x5')]['customfield_10102']=_0x5339e0['ip'];var _0x177b9a={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x6860('0xd'),'timeout':0x4e20,'headers':{'Content-Type':_0x6860('0xe'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6860('0xf')]('base64')}};var _0x3e867a=JSON[_0x6860('0x10')](_0xe62ac7);var _0x333253=https[_0x6860('0x11')](_0x177b9a,function(_0x4820cf){_0x4820cf[_0x6860('0x12')](_0x6860('0x13'));var _0x5547c8='';_0x4820cf['on'](_0x6860('0x14'),function(_0x16dda5){_0x5547c8+=_0x16dda5;});_0x4820cf['on'](_0x6860('0x15'),function(){if(_0x26d700){return _0x26d700[_0x6860('0x16')](_0x4820cf[_0x6860('0x17')])['json'](JSON[_0x6860('0x18')](_0x5547c8));}});});_0x333253['on'](_0x6860('0x19'),function(_0x2d34b6){if(_0x26d700){return _0x26d700[_0x6860('0x16')](0x1f4)[_0x6860('0x1a')]({'errors':[{'message':_0x6860('0x1b'),'type':_0x6860('0x1c')}]});}});_0x333253['write'](_0x3e867a);_0x333253[_0x6860('0x15')]();}exports[_0x6860('0x1d')]=openIssue;exports[_0x6860('0x1e')]=function(_0x19222a,_0x2f5010){_0x19222a[_0x6860('0x1f')]['ip']=_0x19222a[_0x6860('0x20')][_0x6860('0x21')]||_0x19222a[_0x6860('0x22')][_0x6860('0x23')]||_0x19222a[_0x6860('0x24')]['remoteAddress']||_0x19222a[_0x6860('0x22')][_0x6860('0x24')][_0x6860('0x23')];return openIssue(_0x19222a[_0x6860('0x1f')],_0x2f5010);}; \ No newline at end of file +var _0x9bb5=['remoteAddress','socket','https','../../config/logger','api','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','customfield_11501','customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','request','utf8','data','end','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','x-forwarded-for','connection'];(function(_0x5599aa,_0x1b9ffe){var _0x4b0f34=function(_0xbd81f0){while(--_0xbd81f0){_0x5599aa['push'](_0x5599aa['shift']());}};_0x4b0f34(++_0x1b9ffe);}(_0x9bb5,0xaa));var _0x59bb=function(_0x3b2c27,_0x271704){_0x3b2c27=_0x3b2c27-0x0;var _0x20f2df=_0x9bb5[_0x3b2c27];return _0x20f2df;};'use strict';var BPromise=require('bluebird');var https=require(_0x59bb('0x0'));var logger=require(_0x59bb('0x1'))(_0x59bb('0x2'));var USERNAME='support';var PASSWORD=_0x59bb('0x3');function openIssue(_0x28eec2,_0x4e9fd4){var _0xc602b6={'fields':{'project':{'key':_0x28eec2[_0x59bb('0x4')]||'MOTGUI'},'summary':(_0x28eec2[_0x59bb('0x5')]||_0x59bb('0x6'))+_0x59bb('0x7')+_0x28eec2['ip'],'description':_0x28eec2[_0x59bb('0x8')]||JSON[_0x59bb('0x9')](_0x28eec2),'issuetype':{'name':_0x28eec2[_0x59bb('0xa')]||'Bug'}}};_0xc602b6[_0x59bb('0xb')][_0x59bb('0xc')]=_0x28eec2['email'];_0xc602b6[_0x59bb('0xb')][_0x59bb('0xd')]=_0x28eec2['oldToken'];_0xc602b6['fields'][_0x59bb('0xe')]=_0x28eec2[_0x59bb('0xf')];_0xc602b6[_0x59bb('0xb')][_0x59bb('0x10')]=_0x28eec2[_0x59bb('0x11')];_0xc602b6[_0x59bb('0xb')][_0x59bb('0x12')]=_0x28eec2['reason'];_0xc602b6[_0x59bb('0xb')][_0x59bb('0x13')]=_0x28eec2['ip'];var _0x1a7fb1={'host':_0x59bb('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x59bb('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x59bb('0x16'),'Authorization':_0x59bb('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x59bb('0x18')]('base64')}};var _0x4a7059=JSON[_0x59bb('0x9')](_0xc602b6);var _0x5e1957=https[_0x59bb('0x19')](_0x1a7fb1,function(_0xbca378){_0xbca378['setEncoding'](_0x59bb('0x1a'));var _0x30c27a='';_0xbca378['on'](_0x59bb('0x1b'),function(_0x4ef9be){_0x30c27a+=_0x4ef9be;});_0xbca378['on'](_0x59bb('0x1c'),function(){if(_0x4e9fd4){return _0x4e9fd4[_0x59bb('0x1d')](_0xbca378['statusCode'])[_0x59bb('0x1e')](JSON[_0x59bb('0x1f')](_0x30c27a));}});});_0x5e1957['on'](_0x59bb('0x20'),function(_0x1dadec){if(_0x4e9fd4){return _0x4e9fd4['status'](0x1f4)['json']({'errors':[{'message':_0x59bb('0x21'),'type':_0x59bb('0x22')}]});}});_0x5e1957['write'](_0x4a7059);_0x5e1957[_0x59bb('0x1c')]();}exports[_0x59bb('0x23')]=openIssue;exports[_0x59bb('0x24')]=function(_0x34cf44,_0x175d13){_0x34cf44[_0x59bb('0x25')]['ip']=_0x34cf44['headers'][_0x59bb('0x26')]||_0x34cf44[_0x59bb('0x27')][_0x59bb('0x28')]||_0x34cf44[_0x59bb('0x29')]['remoteAddress']||_0x34cf44[_0x59bb('0x27')]['socket'][_0x59bb('0x28')];return openIssue(_0x34cf44[_0x59bb('0x25')],_0x175d13);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 809b05b..d7f78c0 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 _0x5e56=['get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','./jscriptyAnswerReport.controller'];(function(_0x1c13c7,_0x4013e7){var _0x1dd084=function(_0xa13ff3){while(--_0xa13ff3){_0x1c13c7['push'](_0x1c13c7['shift']());}};_0x1dd084(++_0x4013e7);}(_0x5e56,0xb4));var _0x65e5=function(_0x36cd68,_0x3c61d5){_0x36cd68=_0x36cd68-0x0;var _0x5eddb1=_0x5e56[_0x36cd68];return _0x5eddb1;};'use strict';var multer=require(_0x65e5('0x0'));var util=require(_0x65e5('0x1'));var path=require('path');var timeout=require(_0x65e5('0x2'));var express=require(_0x65e5('0x3'));var router=express[_0x65e5('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x65e5('0x5'));var controller=require(_0x65e5('0x6'));router[_0x65e5('0x7')]('/',auth[_0x65e5('0x8')](),controller['index']);router[_0x65e5('0x7')](_0x65e5('0x9'),auth[_0x65e5('0x8')](),controller[_0x65e5('0xa')]);router['get'](_0x65e5('0xb'),auth[_0x65e5('0x8')](),controller[_0x65e5('0xc')]);router['post']('/',auth[_0x65e5('0x8')](),controller[_0x65e5('0xd')]);router['put']('/:id',auth[_0x65e5('0x8')](),controller[_0x65e5('0xe')]);router[_0x65e5('0xf')](_0x65e5('0xb'),auth[_0x65e5('0x8')](),controller['destroy']);module[_0x65e5('0x10')]=router; \ No newline at end of file +var _0x50c5=['../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1fa1ca,_0x26fc36){var _0x541486=function(_0x5c0c78){while(--_0x5c0c78){_0x1fa1ca['push'](_0x1fa1ca['shift']());}};_0x541486(++_0x26fc36);}(_0x50c5,0x10b));var _0x550c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x50c5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x550c('0x0'));var util=require('util');var path=require(_0x550c('0x1'));var timeout=require(_0x550c('0x2'));var express=require('express');var router=express[_0x550c('0x3')]();var auth=require(_0x550c('0x4'));var interaction=require(_0x550c('0x5'));var config=require(_0x550c('0x6'));var controller=require(_0x550c('0x7'));router[_0x550c('0x8')]('/',auth[_0x550c('0x9')](),controller[_0x550c('0xa')]);router[_0x550c('0x8')](_0x550c('0xb'),auth[_0x550c('0x9')](),controller[_0x550c('0xc')]);router[_0x550c('0x8')](_0x550c('0xd'),auth[_0x550c('0x9')](),controller[_0x550c('0xe')]);router[_0x550c('0xf')]('/',auth['isAuthenticated'](),controller[_0x550c('0x10')]);router[_0x550c('0x11')](_0x550c('0xd'),auth[_0x550c('0x9')](),controller[_0x550c('0x12')]);router['delete']('/:id',auth[_0x550c('0x9')](),controller[_0x550c('0x13')]);module[_0x550c('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 96b08e4..17f5464 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 _0x8822=['TEXT','long','sequelize','exports','STRING'];(function(_0x382d7e,_0x16798c){var _0x33c721=function(_0x13d857){while(--_0x13d857){_0x382d7e['push'](_0x382d7e['shift']());}};_0x33c721(++_0x16798c);}(_0x8822,0xf2));var _0x2882=function(_0xd259b5,_0x43c27b){_0xd259b5=_0xd259b5-0x0;var _0x2da57f=_0x8822[_0xd259b5];return _0x2da57f;};'use strict';var Sequelize=require(_0x2882('0x0'));module[_0x2882('0x1')]={'question':{'type':Sequelize[_0x2882('0x2')]},'answer':{'type':Sequelize[_0x2882('0x3')](_0x2882('0x4'))},'membername':{'type':Sequelize[_0x2882('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2882('0x2')]},'uniqueid':{'type':Sequelize[_0x2882('0x2')]},'calleridname':{'type':Sequelize[_0x2882('0x2')]},'calleridnum':{'type':Sequelize[_0x2882('0x2')]},'questionId':{'type':Sequelize[_0x2882('0x2')]}}; \ No newline at end of file +var _0x8e17=['TEXT','long','sequelize','exports','STRING'];(function(_0x2fc3fb,_0x2f77e3){var _0x46bdf9=function(_0x41cc83){while(--_0x41cc83){_0x2fc3fb['push'](_0x2fc3fb['shift']());}};_0x46bdf9(++_0x2f77e3);}(_0x8e17,0xd9));var _0x78e1=function(_0x56c566,_0x5acd13){_0x56c566=_0x56c566-0x0;var _0x408cab=_0x8e17[_0x56c566];return _0x408cab;};'use strict';var Sequelize=require(_0x78e1('0x0'));module[_0x78e1('0x1')]={'question':{'type':Sequelize[_0x78e1('0x2')]},'answer':{'type':Sequelize[_0x78e1('0x3')](_0x78e1('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x78e1('0x2')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x78e1('0x2')]},'calleridname':{'type':Sequelize[_0x78e1('0x2')]},'calleridnum':{'type':Sequelize[_0x78e1('0x2')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 42ed7a6..d76bc43 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 _0xeab3=['../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','JscriptyAnswerReport','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x9117ad,_0x386be4){var _0x540f0c=function(_0x4e117a){while(--_0x4e117a){_0x9117ad['push'](_0x9117ad['shift']());}};_0x540f0c(++_0x386be4);}(_0xeab3,0x143));var _0x3eab=function(_0x4a63fc,_0x167a02){_0x4a63fc=_0x4a63fc-0x0;var _0x30d4c3=_0xeab3[_0x4a63fc];return _0x30d4c3;};'use strict';var pdf=require(_0x3eab('0x0'));var emlformat=require(_0x3eab('0x1'));var rimraf=require(_0x3eab('0x2'));var zipdir=require(_0x3eab('0x3'));var jsonpatch=require(_0x3eab('0x4'));var rp=require(_0x3eab('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3eab('0x6'));var util=require(_0x3eab('0x7'));var path=require(_0x3eab('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3eab('0x9'));var crypto=require(_0x3eab('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3eab('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3eab('0xc'));var Papa=require(_0x3eab('0xd'));var Redis=require(_0x3eab('0xe'));var authService=require(_0x3eab('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3eab('0x10'));var logger=require(_0x3eab('0x11'))(_0x3eab('0x12'));var utils=require(_0x3eab('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49796f,_0x61a742){_0x61a742=_0x61a742||0xcc;return function(_0x2a89db){if(_0x2a89db){return _0x49796f[_0x3eab('0x14')](_0x61a742);}return _0x49796f[_0x3eab('0x15')](_0x61a742)[_0x3eab('0x16')]();};}function respondWithResult(_0x3cabc3,_0x23cd7b){_0x23cd7b=_0x23cd7b||0xc8;return function(_0x3549c2){if(_0x3549c2){return _0x3cabc3['status'](_0x23cd7b)['json'](_0x3549c2);}};}function respondWithFilteredResult(_0x24bf35,_0x125e1d){return function(_0x4eb3c0){if(_0x4eb3c0){var _0x539d4a=_0x4eb3c0[_0x3eab('0x17')],_0x4a26f8=_0x125e1d[_0x3eab('0x18')],_0x35f59c=_0x125e1d['offset']+_0x125e1d['limit'],_0x4819a0;if(_0x35f59c>=_0x539d4a){_0x35f59c=_0x539d4a;_0x4819a0=0xc8;}else{_0x4819a0=0xce;}_0x24bf35[_0x3eab('0x15')](_0x4819a0);return _0x24bf35[_0x3eab('0x19')](_0x3eab('0x1a'),_0x4a26f8+'-'+_0x35f59c+'/'+_0x539d4a)[_0x3eab('0x1b')](_0x4eb3c0);}return null;};}function patchUpdates(_0x1c2395){return function(_0x3b2a93){try{jsonpatch['apply'](_0x3b2a93,_0x1c2395,!![]);}catch(_0x55b7ab){return BPromise[_0x3eab('0x1c')](_0x55b7ab);}return _0x3b2a93['save']();};}function saveUpdates(_0x86c82b,_0x35b639){return function(_0x1ed838){if(_0x1ed838){return _0x1ed838[_0x3eab('0x1d')](_0x86c82b)['then'](function(_0x534d14){return _0x534d14;});}return null;};}function removeEntity(_0x37b7e8,_0x92023){return function(_0x4db8d3){if(_0x4db8d3){return _0x4db8d3['destroy']()[_0x3eab('0x1e')](function(){_0x37b7e8['status'](0xcc)[_0x3eab('0x16')]();});}};}function handleEntityNotFound(_0x193f34,_0x4f9d0d){return function(_0x168445){if(!_0x168445){_0x193f34['sendStatus'](0x194);}return _0x168445;};}function handleError(_0x59a2e7,_0x37b870){_0x37b870=_0x37b870||0x1f4;return function(_0x1edf11){logger['error'](_0x1edf11[_0x3eab('0x1f')]);if(_0x1edf11['name']){delete _0x1edf11[_0x3eab('0x20')];}_0x59a2e7[_0x3eab('0x15')](_0x37b870)[_0x3eab('0x21')](_0x1edf11);};}exports[_0x3eab('0x22')]=function(_0x4e692b,_0x367b64){var _0x3ce078={},_0x43c8f5={},_0x4ba15d={'count':0x0,'rows':[]};var _0x1cae59=_[_0x3eab('0x23')](db['JscriptyAnswerReport'][_0x3eab('0x24')],function(_0x58b1e4){return{'name':_0x58b1e4[_0x3eab('0x25')],'type':_0x58b1e4[_0x3eab('0x26')]['key']};});_0x43c8f5['model']=_['map'](_0x1cae59,_0x3eab('0x20'));_0x43c8f5[_0x3eab('0x27')]=_['keys'](_0x4e692b[_0x3eab('0x27')]);_0x43c8f5[_0x3eab('0x28')]=_[_0x3eab('0x29')](_0x43c8f5[_0x3eab('0x2a')],_0x43c8f5['query']);_0x3ce078[_0x3eab('0x2b')]=_[_0x3eab('0x29')](_0x43c8f5[_0x3eab('0x2a')],qs[_0x3eab('0x2c')](_0x4e692b[_0x3eab('0x27')][_0x3eab('0x2c')]));_0x3ce078['attributes']=_0x3ce078['attributes'][_0x3eab('0x2d')]?_0x3ce078[_0x3eab('0x2b')]:_0x43c8f5['model'];if(!_0x4e692b[_0x3eab('0x27')]['hasOwnProperty']('nolimit')){_0x3ce078[_0x3eab('0x2e')]=qs['limit'](_0x4e692b[_0x3eab('0x27')][_0x3eab('0x2e')]);_0x3ce078[_0x3eab('0x18')]=qs['offset'](_0x4e692b[_0x3eab('0x27')]['offset']);}_0x3ce078[_0x3eab('0x2f')]=qs['sort'](_0x4e692b[_0x3eab('0x27')][_0x3eab('0x30')]);_0x3ce078[_0x3eab('0x31')]=qs[_0x3eab('0x28')](_[_0x3eab('0x32')](_0x4e692b['query'],_0x43c8f5[_0x3eab('0x28')]));if(_0x4e692b[_0x3eab('0x27')]['filter']){_0x3ce078['where']=_['merge'](_0x3ce078[_0x3eab('0x31')],{'$or':_[_0x3eab('0x23')](_0x1cae59,function(_0x35f69e){if(_0x35f69e[_0x3eab('0x26')]!==_0x3eab('0x33')){var _0x3aa9e5={};_0x3aa9e5[_0x35f69e[_0x3eab('0x20')]]={'$like':'%'+_0x4e692b[_0x3eab('0x27')][_0x3eab('0x34')]+'%'};return _0x3aa9e5;}})});}_0x3ce078=_[_0x3eab('0x35')]({},_0x3ce078,_0x4e692b[_0x3eab('0x36')]);var _0x57e364={'where':_0x3ce078[_0x3eab('0x31')]};return db[_0x3eab('0x37')][_0x3eab('0x17')](_0x57e364)['then'](function(_0x155d58){_0x4ba15d[_0x3eab('0x17')]=_0x155d58;if(_0x4e692b['query'][_0x3eab('0x38')]){_0x3ce078[_0x3eab('0x39')]=[{'all':!![]}];}return db[_0x3eab('0x37')][_0x3eab('0x3a')](_0x3ce078);})['then'](function(_0x440987){_0x4ba15d['rows']=_0x440987;return _0x4ba15d;})[_0x3eab('0x1e')](respondWithFilteredResult(_0x367b64,_0x3ce078))[_0x3eab('0x3b')](handleError(_0x367b64,null));};exports[_0x3eab('0x3c')]=function(_0x513ffe,_0x4dbcb5){var _0x53d476={'raw':!![],'where':{'id':_0x513ffe[_0x3eab('0x3d')]['id']}},_0xf07754={};_0xf07754[_0x3eab('0x2a')]=_[_0x3eab('0x3e')](db[_0x3eab('0x37')][_0x3eab('0x24')]);_0xf07754[_0x3eab('0x27')]=_[_0x3eab('0x3e')](_0x513ffe[_0x3eab('0x27')]);_0xf07754[_0x3eab('0x28')]=_['intersection'](_0xf07754[_0x3eab('0x2a')],_0xf07754[_0x3eab('0x27')]);_0x53d476[_0x3eab('0x2b')]=_[_0x3eab('0x29')](_0xf07754['model'],qs[_0x3eab('0x2c')](_0x513ffe[_0x3eab('0x27')][_0x3eab('0x2c')]));_0x53d476['attributes']=_0x53d476[_0x3eab('0x2b')][_0x3eab('0x2d')]?_0x53d476[_0x3eab('0x2b')]:_0xf07754['model'];if(_0x513ffe['query']['includeAll']){_0x53d476[_0x3eab('0x39')]=[{'all':!![]}];}_0x53d476=_['merge']({},_0x53d476,_0x513ffe['options']);return db['JscriptyAnswerReport'][_0x3eab('0x3f')](_0x53d476)[_0x3eab('0x1e')](handleEntityNotFound(_0x4dbcb5,null))[_0x3eab('0x1e')](respondWithResult(_0x4dbcb5,null))[_0x3eab('0x3b')](handleError(_0x4dbcb5,null));};exports['create']=function(_0x5a21bd,_0x300e58){return db[_0x3eab('0x37')][_0x3eab('0x40')](_0x5a21bd['body'],{})[_0x3eab('0x1e')](respondWithResult(_0x300e58,0xc9))[_0x3eab('0x3b')](handleError(_0x300e58,null));};exports[_0x3eab('0x1d')]=function(_0x10b220,_0x5d2ec9){if(_0x10b220[_0x3eab('0x41')]['id']){delete _0x10b220[_0x3eab('0x41')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x10b220[_0x3eab('0x3d')]['id']}})[_0x3eab('0x1e')](handleEntityNotFound(_0x5d2ec9,null))[_0x3eab('0x1e')](saveUpdates(_0x10b220[_0x3eab('0x41')],null))[_0x3eab('0x1e')](respondWithResult(_0x5d2ec9,null))[_0x3eab('0x3b')](handleError(_0x5d2ec9,null));};exports[_0x3eab('0x42')]=function(_0x1ccba9,_0x1ac580){return db[_0x3eab('0x37')][_0x3eab('0x3f')]({'where':{'id':_0x1ccba9['params']['id']}})[_0x3eab('0x1e')](handleEntityNotFound(_0x1ac580,null))[_0x3eab('0x1e')](removeEntity(_0x1ac580,null))[_0x3eab('0x3b')](handleError(_0x1ac580,null));};exports[_0x3eab('0x43')]=function(_0x270416,_0x57e9cb){return db[_0x3eab('0x37')][_0x3eab('0x43')]()['then'](respondWithResult(_0x57e9cb,null))[_0x3eab('0x3b')](handleError(_0x57e9cb,null));}; \ No newline at end of file +var _0xcef7=['hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','end','stack','index','map','JscriptyAnswerReport','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length'];(function(_0x5daa84,_0x3a6cf7){var _0x751190=function(_0x30a26e){while(--_0x30a26e){_0x5daa84['push'](_0x5daa84['shift']());}};_0x751190(++_0x3a6cf7);}(_0xcef7,0xe3));var _0x7cef=function(_0x3a66a5,_0x1251ca){_0x3a66a5=_0x3a66a5-0x0;var _0x951ea3=_0xcef7[_0x3a66a5];return _0x951ea3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7cef('0x0'));var rimraf=require(_0x7cef('0x1'));var zipdir=require(_0x7cef('0x2'));var jsonpatch=require(_0x7cef('0x3'));var rp=require(_0x7cef('0x4'));var moment=require('moment');var BPromise=require(_0x7cef('0x5'));var Mustache=require(_0x7cef('0x6'));var util=require('util');var path=require('path');var sox=require(_0x7cef('0x7'));var csv=require(_0x7cef('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7cef('0x9'));var squel=require('squel');var crypto=require(_0x7cef('0xa'));var jsforce=require(_0x7cef('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7cef('0xc'));var Papa=require(_0x7cef('0xd'));var Redis=require(_0x7cef('0xe'));var authService=require(_0x7cef('0xf'));var qs=require(_0x7cef('0x10'));var as=require(_0x7cef('0x11'));var hardwareService=require(_0x7cef('0x12'));var logger=require('../../config/logger')(_0x7cef('0x13'));var utils=require('../../config/utils');var config=require(_0x7cef('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e292a,_0x52338e){_0x52338e=_0x52338e||0xcc;return function(_0x438b94){if(_0x438b94){return _0x2e292a[_0x7cef('0x15')](_0x52338e);}return _0x2e292a[_0x7cef('0x16')](_0x52338e)['end']();};}function respondWithResult(_0x5a2c4f,_0x605ed){_0x605ed=_0x605ed||0xc8;return function(_0x5b1fa9){if(_0x5b1fa9){return _0x5a2c4f[_0x7cef('0x16')](_0x605ed)[_0x7cef('0x17')](_0x5b1fa9);}};}function respondWithFilteredResult(_0x1f5aec,_0x21854f){return function(_0x56ed46){if(_0x56ed46){var _0x13adc5=_0x56ed46[_0x7cef('0x18')],_0x5c7af5=_0x21854f[_0x7cef('0x19')],_0x4adea8=_0x21854f[_0x7cef('0x19')]+_0x21854f[_0x7cef('0x1a')],_0x913c34;if(_0x4adea8>=_0x13adc5){_0x4adea8=_0x13adc5;_0x913c34=0xc8;}else{_0x913c34=0xce;}_0x1f5aec[_0x7cef('0x16')](_0x913c34);return _0x1f5aec['set'](_0x7cef('0x1b'),_0x5c7af5+'-'+_0x4adea8+'/'+_0x13adc5)[_0x7cef('0x17')](_0x56ed46);}return null;};}function patchUpdates(_0x272786){return function(_0x4aa887){try{jsonpatch[_0x7cef('0x1c')](_0x4aa887,_0x272786,!![]);}catch(_0x51ceae){return BPromise[_0x7cef('0x1d')](_0x51ceae);}return _0x4aa887[_0x7cef('0x1e')]();};}function saveUpdates(_0x407800,_0x2ace22){return function(_0x3380c2){if(_0x3380c2){return _0x3380c2[_0x7cef('0x1f')](_0x407800)[_0x7cef('0x20')](function(_0x5c4011){return _0x5c4011;});}return null;};}function removeEntity(_0x4b3e03,_0x374121){return function(_0x441a28){if(_0x441a28){return _0x441a28['destroy']()['then'](function(){_0x4b3e03[_0x7cef('0x16')](0xcc)[_0x7cef('0x21')]();});}};}function handleEntityNotFound(_0x35cc38,_0x2adf75){return function(_0x302557){if(!_0x302557){_0x35cc38[_0x7cef('0x15')](0x194);}return _0x302557;};}function handleError(_0x2d089e,_0xa28215){_0xa28215=_0xa28215||0x1f4;return function(_0x3ea3b6){logger['error'](_0x3ea3b6[_0x7cef('0x22')]);if(_0x3ea3b6['name']){delete _0x3ea3b6['name'];}_0x2d089e[_0x7cef('0x16')](_0xa28215)['send'](_0x3ea3b6);};}exports[_0x7cef('0x23')]=function(_0x53923f,_0x55c2b0){var _0x22c5cc={},_0x3c8519={},_0x4d0b1a={'count':0x0,'rows':[]};var _0x43eacc=_[_0x7cef('0x24')](db[_0x7cef('0x25')]['rawAttributes'],function(_0x307e8b){return{'name':_0x307e8b[_0x7cef('0x26')],'type':_0x307e8b[_0x7cef('0x27')][_0x7cef('0x28')]};});_0x3c8519[_0x7cef('0x29')]=_[_0x7cef('0x24')](_0x43eacc,_0x7cef('0x2a'));_0x3c8519[_0x7cef('0x2b')]=_[_0x7cef('0x2c')](_0x53923f[_0x7cef('0x2b')]);_0x3c8519['filters']=_[_0x7cef('0x2d')](_0x3c8519[_0x7cef('0x29')],_0x3c8519[_0x7cef('0x2b')]);_0x22c5cc[_0x7cef('0x2e')]=_[_0x7cef('0x2d')](_0x3c8519['model'],qs['fields'](_0x53923f['query'][_0x7cef('0x2f')]));_0x22c5cc[_0x7cef('0x2e')]=_0x22c5cc['attributes'][_0x7cef('0x30')]?_0x22c5cc[_0x7cef('0x2e')]:_0x3c8519[_0x7cef('0x29')];if(!_0x53923f[_0x7cef('0x2b')][_0x7cef('0x31')](_0x7cef('0x32'))){_0x22c5cc['limit']=qs[_0x7cef('0x1a')](_0x53923f['query'][_0x7cef('0x1a')]);_0x22c5cc['offset']=qs[_0x7cef('0x19')](_0x53923f[_0x7cef('0x2b')][_0x7cef('0x19')]);}_0x22c5cc['order']=qs[_0x7cef('0x33')](_0x53923f['query'][_0x7cef('0x33')]);_0x22c5cc['where']=qs[_0x7cef('0x34')](_[_0x7cef('0x35')](_0x53923f['query'],_0x3c8519[_0x7cef('0x34')]));if(_0x53923f[_0x7cef('0x2b')][_0x7cef('0x36')]){_0x22c5cc[_0x7cef('0x37')]=_[_0x7cef('0x38')](_0x22c5cc[_0x7cef('0x37')],{'$or':_['map'](_0x43eacc,function(_0x4f5537){if(_0x4f5537['type']!==_0x7cef('0x39')){var _0x6a197a={};_0x6a197a[_0x4f5537[_0x7cef('0x2a')]]={'$like':'%'+_0x53923f[_0x7cef('0x2b')][_0x7cef('0x36')]+'%'};return _0x6a197a;}})});}_0x22c5cc=_['merge']({},_0x22c5cc,_0x53923f[_0x7cef('0x3a')]);var _0x32217b={'where':_0x22c5cc[_0x7cef('0x37')]};return db[_0x7cef('0x25')][_0x7cef('0x18')](_0x32217b)[_0x7cef('0x20')](function(_0x4959eb){_0x4d0b1a[_0x7cef('0x18')]=_0x4959eb;if(_0x53923f['query']['includeAll']){_0x22c5cc[_0x7cef('0x3b')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x7cef('0x3c')](_0x22c5cc);})['then'](function(_0x39d808){_0x4d0b1a['rows']=_0x39d808;return _0x4d0b1a;})[_0x7cef('0x20')](respondWithFilteredResult(_0x55c2b0,_0x22c5cc))[_0x7cef('0x3d')](handleError(_0x55c2b0,null));};exports[_0x7cef('0x3e')]=function(_0x4dd02c,_0x15c10f){var _0x3a50fd={'raw':!![],'where':{'id':_0x4dd02c[_0x7cef('0x3f')]['id']}},_0x4fe402={};_0x4fe402[_0x7cef('0x29')]=_['keys'](db[_0x7cef('0x25')][_0x7cef('0x40')]);_0x4fe402[_0x7cef('0x2b')]=_['keys'](_0x4dd02c[_0x7cef('0x2b')]);_0x4fe402[_0x7cef('0x34')]=_['intersection'](_0x4fe402[_0x7cef('0x29')],_0x4fe402[_0x7cef('0x2b')]);_0x3a50fd[_0x7cef('0x2e')]=_[_0x7cef('0x2d')](_0x4fe402[_0x7cef('0x29')],qs['fields'](_0x4dd02c[_0x7cef('0x2b')][_0x7cef('0x2f')]));_0x3a50fd[_0x7cef('0x2e')]=_0x3a50fd[_0x7cef('0x2e')][_0x7cef('0x30')]?_0x3a50fd[_0x7cef('0x2e')]:_0x4fe402['model'];if(_0x4dd02c[_0x7cef('0x2b')]['includeAll']){_0x3a50fd[_0x7cef('0x3b')]=[{'all':!![]}];}_0x3a50fd=_['merge']({},_0x3a50fd,_0x4dd02c[_0x7cef('0x3a')]);return db[_0x7cef('0x25')]['find'](_0x3a50fd)['then'](handleEntityNotFound(_0x15c10f,null))[_0x7cef('0x20')](respondWithResult(_0x15c10f,null))[_0x7cef('0x3d')](handleError(_0x15c10f,null));};exports[_0x7cef('0x41')]=function(_0x1a44c,_0x81852){return db[_0x7cef('0x25')][_0x7cef('0x41')](_0x1a44c[_0x7cef('0x42')],{})[_0x7cef('0x20')](respondWithResult(_0x81852,0xc9))[_0x7cef('0x3d')](handleError(_0x81852,null));};exports[_0x7cef('0x1f')]=function(_0xb90384,_0x72a7c2){if(_0xb90384[_0x7cef('0x42')]['id']){delete _0xb90384[_0x7cef('0x42')]['id'];}return db['JscriptyAnswerReport'][_0x7cef('0x43')]({'where':{'id':_0xb90384[_0x7cef('0x3f')]['id']}})['then'](handleEntityNotFound(_0x72a7c2,null))[_0x7cef('0x20')](saveUpdates(_0xb90384[_0x7cef('0x42')],null))[_0x7cef('0x20')](respondWithResult(_0x72a7c2,null))['catch'](handleError(_0x72a7c2,null));};exports['destroy']=function(_0x716f6a,_0x9f676a){return db[_0x7cef('0x25')][_0x7cef('0x43')]({'where':{'id':_0x716f6a[_0x7cef('0x3f')]['id']}})[_0x7cef('0x20')](handleEntityNotFound(_0x9f676a,null))[_0x7cef('0x20')](removeEntity(_0x9f676a,null))[_0x7cef('0x3d')](handleError(_0x9f676a,null));};exports[_0x7cef('0x44')]=function(_0x3434c7,_0x53935c){return db[_0x7cef('0x25')][_0x7cef('0x44')]()[_0x7cef('0x20')](respondWithResult(_0x53935c,null))['catch'](handleError(_0x53935c,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index de2d0f4..b180438 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 _0x28fc=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x516668,_0x419358){var _0x3c8c5b=function(_0x314a79){while(--_0x314a79){_0x516668['push'](_0x516668['shift']());}};_0x3c8c5b(++_0x419358);}(_0x28fc,0x1b8));var _0xc28f=function(_0x124817,_0x1888f2){_0x124817=_0x124817-0x0;var _0x1d80a9=_0x28fc[_0x124817];return _0x1d80a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc28f('0x0'))(_0xc28f('0x1'));var moment=require('moment');var BPromise=require(_0xc28f('0x2'));var rp=require(_0xc28f('0x3'));var fs=require('fs');var path=require(_0xc28f('0x4'));var rimraf=require(_0xc28f('0x5'));var config=require(_0xc28f('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xc28f('0x7')]=function(_0xbd87df,_0x3ac649){return _0xbd87df[_0xc28f('0x8')](_0xc28f('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xebb1=['path','../../config/environment','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','request-promise'];(function(_0x4162bd,_0x236552){var _0x37bde6=function(_0x1044c3){while(--_0x1044c3){_0x4162bd['push'](_0x4162bd['shift']());}};_0x37bde6(++_0x236552);}(_0xebb1,0x1d8));var _0x1ebb=function(_0x1ac555,_0x4958f1){_0x1ac555=_0x1ac555-0x0;var _0x19cfc0=_0xebb1[_0x1ac555];return _0x19cfc0;};'use strict';var _=require(_0x1ebb('0x0'));var util=require(_0x1ebb('0x1'));var logger=require(_0x1ebb('0x2'))(_0x1ebb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ebb('0x4'));var fs=require('fs');var path=require(_0x1ebb('0x5'));var rimraf=require('rimraf');var config=require(_0x1ebb('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x3a3b95,_0x18d8b4){return _0x3a3b95[_0x1ebb('0x7')](_0x1ebb('0x8'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 576a110..ea06765 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 _0x7d9e=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x35c617,_0x1369f4){var _0x43684c=function(_0x22590d){while(--_0x22590d){_0x35c617['push'](_0x35c617['shift']());}};_0x43684c(++_0x1369f4);}(_0x7d9e,0xf5));var _0xe7d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe7d9('0x0'));var util=require(_0xe7d9('0x1'));var moment=require(_0xe7d9('0x2'));var BPromise=require(_0xe7d9('0x3'));var rs=require(_0xe7d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7d9('0x5'))['db'];var utils=require(_0xe7d9('0x6'));var logger=require(_0xe7d9('0x7'))('rpc');var config=require(_0xe7d9('0x8'));var jayson=require(_0xe7d9('0x9'));var client=jayson[_0xe7d9('0xa')][_0xe7d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bfa3e,_0x27f68e,_0x101d48){return new BPromise(function(_0x58809f,_0x41c9b4){return client['request'](_0x5bfa3e,_0x101d48)['then'](function(_0x150a25){logger[_0xe7d9('0xc')](_0xe7d9('0xd'),_0x27f68e,_0xe7d9('0xe'));logger[_0xe7d9('0xf')](_0xe7d9('0x10'),_0x27f68e,'request\x20sent',JSON[_0xe7d9('0x11')](_0x150a25));if(_0x150a25[_0xe7d9('0x12')]){if(_0x150a25[_0xe7d9('0x12')]['code']===0x1f4){logger[_0xe7d9('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x27f68e,_0x150a25[_0xe7d9('0x12')]['message']);return _0x41c9b4(_0x150a25[_0xe7d9('0x12')][_0xe7d9('0x13')]);}logger[_0xe7d9('0x12')](_0xe7d9('0xd'),_0x27f68e,_0x150a25[_0xe7d9('0x12')]['message']);return _0x58809f(_0x150a25[_0xe7d9('0x12')][_0xe7d9('0x13')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x27f68e,_0xe7d9('0xe'));_0x58809f(_0x150a25[_0xe7d9('0x14')]['message']);}})[_0xe7d9('0x15')](function(_0x346d15){logger[_0xe7d9('0x12')](_0xe7d9('0xd'),_0x27f68e,_0x346d15);_0x41c9b4(_0x346d15);});});} \ No newline at end of file +var _0xf5fd=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0xf5fd,0x161));var _0xdf5f=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xf5fd[_0x4b7895];return _0x264180;};'use strict';var _=require(_0xdf5f('0x0'));var util=require(_0xdf5f('0x1'));var moment=require(_0xdf5f('0x2'));var BPromise=require(_0xdf5f('0x3'));var rs=require(_0xdf5f('0x4'));var fs=require('fs');var Redis=require(_0xdf5f('0x5'));var db=require(_0xdf5f('0x6'))['db'];var utils=require(_0xdf5f('0x7'));var logger=require(_0xdf5f('0x8'))(_0xdf5f('0x9'));var config=require('../../config/environment');var jayson=require(_0xdf5f('0xa'));var client=jayson[_0xdf5f('0xb')][_0xdf5f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x807c8,_0xacacf3,_0x59c022){return new BPromise(function(_0x41da96,_0x589b5a){return client[_0xdf5f('0xd')](_0x807c8,_0x59c022)[_0xdf5f('0xe')](function(_0x5b4448){logger['info'](_0xdf5f('0xf'),_0xacacf3,_0xdf5f('0x10'));logger[_0xdf5f('0x11')](_0xdf5f('0x12'),_0xacacf3,_0xdf5f('0x10'),JSON[_0xdf5f('0x13')](_0x5b4448));if(_0x5b4448[_0xdf5f('0x14')]){if(_0x5b4448[_0xdf5f('0x14')]['code']===0x1f4){logger[_0xdf5f('0x14')](_0xdf5f('0xf'),_0xacacf3,_0x5b4448[_0xdf5f('0x14')][_0xdf5f('0x15')]);return _0x589b5a(_0x5b4448[_0xdf5f('0x14')]['message']);}logger[_0xdf5f('0x14')](_0xdf5f('0xf'),_0xacacf3,_0x5b4448[_0xdf5f('0x14')][_0xdf5f('0x15')]);return _0x41da96(_0x5b4448[_0xdf5f('0x14')][_0xdf5f('0x15')]);}else{logger[_0xdf5f('0x16')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xacacf3,_0xdf5f('0x10'));_0x41da96(_0x5b4448['result'][_0xdf5f('0x15')]);}})[_0xdf5f('0x17')](function(_0x173fea){logger[_0xdf5f('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xacacf3,_0x173fea);_0x589b5a(_0x173fea);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index b556222..69864d0 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 _0x6309=['getSessions','/:id/answers','post','create','/:id/clone','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions'];(function(_0x3c5ad8,_0x56c405){var _0x5f7967=function(_0x5885d8){while(--_0x5885d8){_0x3c5ad8['push'](_0x3c5ad8['shift']());}};_0x5f7967(++_0x56c405);}(_0x6309,0x86));var _0x9630=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x6309[_0x5c2c7c];return _0xea7ffe;};'use strict';var multer=require(_0x9630('0x0'));var util=require(_0x9630('0x1'));var path=require(_0x9630('0x2'));var timeout=require(_0x9630('0x3'));var express=require(_0x9630('0x4'));var router=express[_0x9630('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9630('0x6'));var controller=require(_0x9630('0x7'));router[_0x9630('0x8')]('/',auth[_0x9630('0x9')](),controller['index']);router['get'](_0x9630('0xa'),auth[_0x9630('0x9')](),controller[_0x9630('0xb')]);router[_0x9630('0x8')](_0x9630('0xc'),auth[_0x9630('0x9')](),controller[_0x9630('0xd')]);router[_0x9630('0x8')](_0x9630('0xe'),auth[_0x9630('0x9')](),controller['getAnswers']);router[_0x9630('0x8')]('/:id/summary',auth[_0x9630('0x9')](),timeout('30s'),controller['getSummary']);router[_0x9630('0xf')]('/',auth['isAuthenticated'](),controller[_0x9630('0x10')]);router[_0x9630('0xf')](_0x9630('0x11'),auth['isAuthenticated'](),controller['clone']);router['put']('/:id',auth[_0x9630('0x9')](),controller[_0x9630('0x12')]);router[_0x9630('0x13')](_0x9630('0xa'),auth[_0x9630('0x9')](),controller[_0x9630('0x14')]);module['exports']=router; \ No newline at end of file +var _0x158e=['update','delete','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','/:id/sessions','getSessions','/:id/answers','/:id/summary','getSummary','post','clone','put'];(function(_0x13342f,_0x3d6303){var _0x2fc1fc=function(_0x2d991f){while(--_0x2d991f){_0x13342f['push'](_0x13342f['shift']());}};_0x2fc1fc(++_0x3d6303);}(_0x158e,0x72));var _0xe158=function(_0x2312d8,_0x585d41){_0x2312d8=_0x2312d8-0x0;var _0x19e73c=_0x158e[_0x2312d8];return _0x19e73c;};'use strict';var multer=require(_0xe158('0x0'));var util=require(_0xe158('0x1'));var path=require(_0xe158('0x2'));var timeout=require('connect-timeout');var express=require(_0xe158('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe158('0x4'));var config=require(_0xe158('0x5'));var controller=require(_0xe158('0x6'));router[_0xe158('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe158('0x8'),auth[_0xe158('0x9')](),controller['show']);router[_0xe158('0x7')](_0xe158('0xa'),auth[_0xe158('0x9')](),controller[_0xe158('0xb')]);router['get'](_0xe158('0xc'),auth[_0xe158('0x9')](),controller['getAnswers']);router['get'](_0xe158('0xd'),auth[_0xe158('0x9')](),timeout('30s'),controller[_0xe158('0xe')]);router[_0xe158('0xf')]('/',auth[_0xe158('0x9')](),controller['create']);router[_0xe158('0xf')]('/:id/clone',auth['isAuthenticated'](),controller[_0xe158('0x10')]);router[_0xe158('0x11')](_0xe158('0x8'),auth[_0xe158('0x9')](),controller[_0xe158('0x12')]);router[_0xe158('0x13')](_0xe158('0x8'),auth[_0xe158('0x9')](),controller[_0xe158('0x14')]);module[_0xe158('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 57e5997..2ed8aa5 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 _0xedb6=['setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','exports','STRING','name','long','isObjectLike'];(function(_0x32cce8,_0x18762f){var _0x4a732b=function(_0x5a3a21){while(--_0x5a3a21){_0x32cce8['push'](_0x32cce8['shift']());}};_0x4a732b(++_0x18762f);}(_0xedb6,0xf9));var _0x6edb=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xedb6[_0x15dbca];return _0x326533;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6edb('0x0'));var util=require('util');module[_0x6edb('0x1')]={'name':{'type':Sequelize[_0x6edb('0x2')],'unique':_0x6edb('0x3')},'description':{'type':Sequelize[_0x6edb('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x6edb('0x4')),'set':function(_0x4b2c28){if(_[_0x6edb('0x5')](_0x4b2c28)){this[_0x6edb('0x6')]('formData',JSON[_0x6edb('0x7')](_0x4b2c28));}else if(_[_0x6edb('0x8')](_0x4b2c28)){this[_0x6edb('0x6')]('formData',_0x4b2c28);}else{this['setDataValue'](_0x6edb('0x9'),util[_0x6edb('0xa')](_0x6edb('0xb'),this[_0x6edb('0xc')](_0x6edb('0x3'))||'',this[_0x6edb('0xc')](_0x6edb('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6edb('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x9bb0=['long','isObjectLike','formData','stringify','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT'];(function(_0x24f567,_0x369682){var _0x528593=function(_0x317ed4){while(--_0x317ed4){_0x24f567['push'](_0x24f567['shift']());}};_0x528593(++_0x369682);}(_0x9bb0,0x77));var _0x09bb=function(_0x5d5d25,_0x3b8c9d){_0x5d5d25=_0x5d5d25-0x0;var _0x4b25ca=_0x9bb0[_0x5d5d25];return _0x4b25ca;};'use strict';var Sequelize=require(_0x09bb('0x0'));var _=require(_0x09bb('0x1'));var util=require(_0x09bb('0x2'));module[_0x09bb('0x3')]={'name':{'type':Sequelize[_0x09bb('0x4')],'unique':_0x09bb('0x5')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x09bb('0x6')](_0x09bb('0x7')),'set':function(_0x557b98){if(_[_0x09bb('0x8')](_0x557b98)){this['setDataValue'](_0x09bb('0x9'),JSON[_0x09bb('0xa')](_0x557b98));}else if(_[_0x09bb('0xb')](_0x557b98)){this[_0x09bb('0xc')](_0x09bb('0x9'),_0x557b98);}else{this[_0x09bb('0xc')]('formData',util[_0x09bb('0xd')](_0x09bb('0xe'),this['getDataValue']('name')||'',this[_0x09bb('0xf')](_0x09bb('0x10'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x09bb('0x11')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 013360e..40fc29a 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 _0xa498=['JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','offset','limit','set','Content-Range','json','apply','reject','then','get','Projects','UserProfileResource','destroy','error','name','send','index','map','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','update','getSessions','JscriptySessionReport','sort','ProjectId','getAnswers','findOne'];(function(_0x34e46d,_0x5df86a){var _0x1cc6aa=function(_0x5a22f7){while(--_0x5a22f7){_0x34e46d['push'](_0x34e46d['shift']());}};_0x1cc6aa(++_0x5df86a);}(_0xa498,0x179));var _0x8a49=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xa498[_0x409682];return _0x1ee901;};'use strict';var pdf=require(_0x8a49('0x0'));var emlformat=require(_0x8a49('0x1'));var rimraf=require(_0x8a49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a49('0x3'));var rp=require(_0x8a49('0x4'));var moment=require('moment');var BPromise=require(_0x8a49('0x5'));var Mustache=require(_0x8a49('0x6'));var util=require(_0x8a49('0x7'));var path=require(_0x8a49('0x8'));var sox=require(_0x8a49('0x9'));var csv=require(_0x8a49('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a49('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a49('0xc'));var deskjs=require(_0x8a49('0xd'));var toCsv=require(_0x8a49('0xa'));var querystring=require(_0x8a49('0xe'));var Papa=require(_0x8a49('0xf'));var Redis=require(_0x8a49('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8a49('0x11'));var as=require(_0x8a49('0x12'));var hardwareService=require(_0x8a49('0x13'));var logger=require(_0x8a49('0x14'))(_0x8a49('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12371d,_0x5b7fe8){_0x5b7fe8=_0x5b7fe8||0xcc;return function(_0x408ca9){if(_0x408ca9){return _0x12371d['sendStatus'](_0x5b7fe8);}return _0x12371d['status'](_0x5b7fe8)[_0x8a49('0x16')]();};}function respondWithResult(_0x3091b5,_0x57bcb3){_0x57bcb3=_0x57bcb3||0xc8;return function(_0x45b414){if(_0x45b414){return _0x3091b5[_0x8a49('0x17')](_0x57bcb3)['json'](_0x45b414);}};}function respondWithFilteredResult(_0x212ae3,_0x424925){return function(_0x4a6aec){if(_0x4a6aec){var _0x1fdaf4=_0x4a6aec['count'],_0x50a72d=_0x424925['offset'],_0x22535d=_0x424925[_0x8a49('0x18')]+_0x424925[_0x8a49('0x19')],_0x53de72;if(_0x22535d>=_0x1fdaf4){_0x22535d=_0x1fdaf4;_0x53de72=0xc8;}else{_0x53de72=0xce;}_0x212ae3['status'](_0x53de72);return _0x212ae3[_0x8a49('0x1a')](_0x8a49('0x1b'),_0x50a72d+'-'+_0x22535d+'/'+_0x1fdaf4)[_0x8a49('0x1c')](_0x4a6aec);}return null;};}function patchUpdates(_0xc4bd0b){return function(_0x2f7001){try{jsonpatch[_0x8a49('0x1d')](_0x2f7001,_0xc4bd0b,!![]);}catch(_0x545725){return BPromise[_0x8a49('0x1e')](_0x545725);}return _0x2f7001['save']();};}function saveUpdates(_0x211b68,_0x254d6e){return function(_0x49526a){if(_0x49526a){return _0x49526a['update'](_0x211b68)[_0x8a49('0x1f')](function(_0x301051){return _0x301051;});}return null;};}function removeEntity(_0x413ee6,_0x3659da){return function(_0xcebf3e){if(_0xcebf3e){return _0xcebf3e['destroy']()[_0x8a49('0x1f')](function(){var _0x139777=_0xcebf3e[_0x8a49('0x20')]({'plain':!![]});var _0x2d47f4=_0x8a49('0x21');return db[_0x8a49('0x22')][_0x8a49('0x23')]({'where':{'type':_0x2d47f4,'resourceId':_0x139777['id']}})[_0x8a49('0x1f')](function(){return _0xcebf3e;});})[_0x8a49('0x1f')](function(){_0x413ee6[_0x8a49('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d177a,_0x4304d4){return function(_0x2ab78a){if(!_0x2ab78a){_0x4d177a['sendStatus'](0x194);}return _0x2ab78a;};}function handleError(_0x385a06,_0x1a8e0b){_0x1a8e0b=_0x1a8e0b||0x1f4;return function(_0x32c2eb){logger[_0x8a49('0x24')](_0x32c2eb['stack']);if(_0x32c2eb[_0x8a49('0x25')]){delete _0x32c2eb[_0x8a49('0x25')];}_0x385a06[_0x8a49('0x17')](_0x1a8e0b)[_0x8a49('0x26')](_0x32c2eb);};}exports[_0x8a49('0x27')]=function(_0x1dc14a,_0x31673a){var _0x3eadad={},_0x1b181b={},_0x477c36={'count':0x0,'rows':[]};var _0x216ca2=_[_0x8a49('0x28')](db['JscriptyProject']['rawAttributes'],function(_0x37df1e){return{'name':_0x37df1e[_0x8a49('0x29')],'type':_0x37df1e[_0x8a49('0x2a')][_0x8a49('0x2b')]};});_0x1b181b['model']=_[_0x8a49('0x28')](_0x216ca2,_0x8a49('0x25'));_0x1b181b[_0x8a49('0x2c')]=_[_0x8a49('0x2d')](_0x1dc14a[_0x8a49('0x2c')]);_0x1b181b['filters']=_[_0x8a49('0x2e')](_0x1b181b['model'],_0x1b181b[_0x8a49('0x2c')]);_0x3eadad[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x1b181b[_0x8a49('0x30')],qs['fields'](_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x3eadad[_0x8a49('0x2f')]=_0x3eadad[_0x8a49('0x2f')][_0x8a49('0x32')]?_0x3eadad['attributes']:_0x1b181b[_0x8a49('0x30')];if(!_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x33')](_0x8a49('0x34'))){_0x3eadad['limit']=qs[_0x8a49('0x19')](_0x1dc14a[_0x8a49('0x2c')]['limit']);_0x3eadad['offset']=qs[_0x8a49('0x18')](_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x18')]);}_0x3eadad[_0x8a49('0x35')]=qs['sort'](_0x1dc14a[_0x8a49('0x2c')]['sort']);_0x3eadad[_0x8a49('0x36')]=qs[_0x8a49('0x37')](_[_0x8a49('0x38')](_0x1dc14a[_0x8a49('0x2c')],_0x1b181b[_0x8a49('0x37')]));if(_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x39')]){_0x3eadad[_0x8a49('0x36')]=_[_0x8a49('0x3a')](_0x3eadad[_0x8a49('0x36')],{'$or':_['map'](_0x216ca2,function(_0x2ec0f6){if(_0x2ec0f6[_0x8a49('0x2a')]!==_0x8a49('0x3b')){var _0x12d3a5={};_0x12d3a5[_0x2ec0f6[_0x8a49('0x25')]]={'$like':'%'+_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x39')]+'%'};return _0x12d3a5;}})});}_0x3eadad=_[_0x8a49('0x3a')]({},_0x3eadad,_0x1dc14a[_0x8a49('0x3c')]);var _0xc0e651={'where':_0x3eadad[_0x8a49('0x36')]};return db['JscriptyProject'][_0x8a49('0x3d')](_0xc0e651)['then'](function(_0x253ad3){_0x477c36[_0x8a49('0x3d')]=_0x253ad3;if(_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x3e')]){_0x3eadad[_0x8a49('0x3f')]=[{'all':!![]}];}return db[_0x8a49('0x40')][_0x8a49('0x41')](_0x3eadad);})[_0x8a49('0x1f')](function(_0x28cf0b){_0x477c36[_0x8a49('0x42')]=_0x28cf0b;return _0x477c36;})[_0x8a49('0x1f')](respondWithFilteredResult(_0x31673a,_0x3eadad))[_0x8a49('0x43')](handleError(_0x31673a,null));};exports[_0x8a49('0x44')]=function(_0xde8f5d,_0x42225f){var _0x5d1d55={'raw':![],'where':{'id':_0xde8f5d[_0x8a49('0x45')]['id']}},_0x4acafe={};_0x4acafe[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db['JscriptyProject'][_0x8a49('0x46')]);_0x4acafe['query']=_[_0x8a49('0x2d')](_0xde8f5d[_0x8a49('0x2c')]);_0x4acafe[_0x8a49('0x37')]=_[_0x8a49('0x2e')](_0x4acafe[_0x8a49('0x30')],_0x4acafe[_0x8a49('0x2c')]);_0x5d1d55[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x4acafe[_0x8a49('0x30')],qs[_0x8a49('0x31')](_0xde8f5d[_0x8a49('0x2c')]['fields']));_0x5d1d55[_0x8a49('0x2f')]=_0x5d1d55[_0x8a49('0x2f')][_0x8a49('0x32')]?_0x5d1d55[_0x8a49('0x2f')]:_0x4acafe[_0x8a49('0x30')];if(_0xde8f5d['query'][_0x8a49('0x3e')]){_0x5d1d55[_0x8a49('0x3f')]=[{'all':!![]}];}_0x5d1d55=_[_0x8a49('0x3a')]({},_0x5d1d55,_0xde8f5d['options']);return db['JscriptyProject'][_0x8a49('0x47')](_0x5d1d55)[_0x8a49('0x1f')](handleEntityNotFound(_0x42225f,null))['then'](respondWithResult(_0x42225f,null))[_0x8a49('0x43')](handleError(_0x42225f,null));};exports[_0x8a49('0x48')]=function(_0x3c7b36,_0x191578){return db[_0x8a49('0x40')][_0x8a49('0x48')](_0x3c7b36[_0x8a49('0x49')],{})[_0x8a49('0x1f')](function(_0x16ade8){var _0x362d8f=_0x3c7b36['user']['get']({'plain':!![]});if(!_0x362d8f)throw new Error(_0x8a49('0x4a'));if(_0x362d8f[_0x8a49('0x4b')]===_0x8a49('0x4c')){var _0x1d7b67=_0x16ade8[_0x8a49('0x20')]({'plain':!![]});var _0x1694bb=_0x8a49('0x21');return db[_0x8a49('0x4d')][_0x8a49('0x47')]({'where':{'name':_0x1694bb,'userProfileId':_0x362d8f[_0x8a49('0x4e')]},'raw':!![]})[_0x8a49('0x1f')](function(_0x1923a5){if(_0x1923a5&&_0x1923a5[_0x8a49('0x4f')]===0x0){return db[_0x8a49('0x22')][_0x8a49('0x48')]({'name':_0x1d7b67['name'],'resourceId':_0x1d7b67['id'],'type':_0x1923a5[_0x8a49('0x25')],'sectionId':_0x1923a5['id']},{})[_0x8a49('0x1f')](function(){return _0x16ade8;});}else{return _0x16ade8;}})[_0x8a49('0x43')](function(_0xa78845){logger[_0x8a49('0x24')](_0x8a49('0x50'),_0xa78845);throw _0xa78845;});}return _0x16ade8;})[_0x8a49('0x1f')](respondWithResult(_0x191578,0xc9))['catch'](handleError(_0x191578,null));};exports['clone']=function(_0x4a7df8,_0x3ed3af){var _0x4bc570={'where':{'id':_0x4a7df8[_0x8a49('0x45')]['id']}},_0x3b19bb={};_0x3b19bb[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db['JscriptyProject']['rawAttributes']);_0x4bc570[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x3b19bb[_0x8a49('0x30')],qs[_0x8a49('0x31')](_0x4a7df8[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x4bc570[_0x8a49('0x2f')]=_0x4bc570['attributes'][_0x8a49('0x32')]?_0x4bc570[_0x8a49('0x2f')]:_0x3b19bb['model'];if(_0x4a7df8[_0x8a49('0x2c')][_0x8a49('0x3e')]){_0x4bc570[_0x8a49('0x3f')]=[{'all':!![]}];}_0x4bc570=_['merge']({},_0x4bc570,_0x4a7df8['options']);return db[_0x8a49('0x40')][_0x8a49('0x47')](_0x4bc570)[_0x8a49('0x1f')](handleEntityNotFound(_0x3ed3af,null))['then'](function(_0x511fea){if(_0x511fea){var _0x411e5c=_0x511fea[_0x8a49('0x20')]({'plain':!![]});_0x411e5c=qs[_0x8a49('0x51')](_0x411e5c,['id',_0x8a49('0x52'),'updatedAt']);_0x4a7df8[_0x8a49('0x49')]=_[_0x8a49('0x51')](_0x4a7df8[_0x8a49('0x49')],['id',_0x8a49('0x52'),_0x8a49('0x53')]);return db[_0x8a49('0x40')][_0x8a49('0x48')](_[_0x8a49('0x3a')](_0x411e5c,_0x4a7df8[_0x8a49('0x49')]),{'include':_0x4a7df8['query'][_0x8a49('0x3e')]?[{'all':!![]}]:undefined})[_0x8a49('0x1f')](function(_0x2daa87){var _0x21bc51=_0x4a7df8[_0x8a49('0x4c')][_0x8a49('0x20')]({'plain':!![]});if(!_0x21bc51)throw new Error(_0x8a49('0x4a'));if(_0x21bc51['role']===_0x8a49('0x4c')){var _0x19fd1d=_0x2daa87['get']({'plain':!![]});var _0x1250d7=_0x8a49('0x21');return db[_0x8a49('0x4d')]['find']({'where':{'name':_0x1250d7,'userProfileId':_0x21bc51[_0x8a49('0x4e')]},'raw':!![]})[_0x8a49('0x1f')](function(_0x167c32){if(_0x167c32&&_0x167c32[_0x8a49('0x4f')]===0x0){return db[_0x8a49('0x22')][_0x8a49('0x48')]({'name':_0x19fd1d[_0x8a49('0x25')],'resourceId':_0x19fd1d['id'],'type':_0x167c32[_0x8a49('0x25')],'sectionId':_0x167c32['id']},{})['then'](function(){return _0x2daa87;});}else{return _0x2daa87;}})['catch'](function(_0x1781b2){logger[_0x8a49('0x24')](_0x8a49('0x50'),_0x1781b2);throw _0x1781b2;});}return _0x2daa87;});}})['then'](respondWithResult(_0x3ed3af,0xc9))['catch'](handleError(_0x3ed3af,null));};exports[_0x8a49('0x54')]=function(_0x4c751f,_0x57f80d){if(_0x4c751f[_0x8a49('0x49')]['id']){delete _0x4c751f[_0x8a49('0x49')]['id'];}return db[_0x8a49('0x40')]['find']({'where':{'id':_0x4c751f[_0x8a49('0x45')]['id']}})['then'](handleEntityNotFound(_0x57f80d,null))[_0x8a49('0x1f')](saveUpdates(_0x4c751f[_0x8a49('0x49')],null))['then'](respondWithResult(_0x57f80d,null))['catch'](handleError(_0x57f80d,null));};exports[_0x8a49('0x23')]=function(_0x5a30c9,_0x2faf4b){return db[_0x8a49('0x40')]['find']({'where':{'id':_0x5a30c9[_0x8a49('0x45')]['id']}})['then'](handleEntityNotFound(_0x2faf4b,null))[_0x8a49('0x1f')](removeEntity(_0x2faf4b,null))[_0x8a49('0x43')](handleError(_0x2faf4b,null));};exports[_0x8a49('0x55')]=function(_0x311de3,_0x52840f,_0x3035d1){var _0x51c153={'raw':!![],'where':{}};var _0xd32f8b={};var _0x40bb06={'count':0x0,'rows':[]};return db[_0x8a49('0x40')]['findOne']({'where':{'id':_0x311de3[_0x8a49('0x45')]['id']}})[_0x8a49('0x1f')](handleEntityNotFound(_0x52840f,null))[_0x8a49('0x1f')](function(_0x5ba1c5){if(_0x5ba1c5){_0xd32f8b[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db[_0x8a49('0x56')]['rawAttributes']);_0xd32f8b[_0x8a49('0x2c')]=_[_0x8a49('0x2d')](_0x311de3[_0x8a49('0x2c')]);_0xd32f8b[_0x8a49('0x37')]=_['intersection'](_0xd32f8b['model'],_0xd32f8b['query']);_0x51c153['attributes']=_[_0x8a49('0x2e')](_0xd32f8b['model'],qs[_0x8a49('0x31')](_0x311de3[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x51c153['attributes']=_0x51c153[_0x8a49('0x2f')][_0x8a49('0x32')]?_0x51c153[_0x8a49('0x2f')]:_0xd32f8b['model'];if(!_0x311de3['query']['hasOwnProperty'](_0x8a49('0x34'))){_0x51c153[_0x8a49('0x19')]=qs[_0x8a49('0x19')](_0x311de3[_0x8a49('0x2c')][_0x8a49('0x19')]);_0x51c153[_0x8a49('0x18')]=qs[_0x8a49('0x18')](_0x311de3['query'][_0x8a49('0x18')]);}_0x51c153[_0x8a49('0x35')]=qs[_0x8a49('0x57')](_0x311de3[_0x8a49('0x2c')]['sort']);_0x51c153[_0x8a49('0x36')]=qs[_0x8a49('0x37')](_['pick'](_0x311de3[_0x8a49('0x2c')],_0xd32f8b[_0x8a49('0x37')]));_0x51c153[_0x8a49('0x36')][_0x8a49('0x58')]=_0x5ba1c5['id'];if(_0x311de3[_0x8a49('0x2c')][_0x8a49('0x39')]){_0x51c153['where']=_[_0x8a49('0x3a')](_0x51c153['where'],{'$or':_[_0x8a49('0x28')](_0x51c153[_0x8a49('0x2f')],function(_0x229077){var _0x15b30b={};_0x15b30b[_0x229077]={'$like':'%'+_0x311de3[_0x8a49('0x2c')]['filter']+'%'};return _0x15b30b;})});}_0x51c153=_[_0x8a49('0x3a')]({},_0x51c153,_0x311de3[_0x8a49('0x3c')]);return db['JscriptySessionReport']['count']({'where':_0x51c153[_0x8a49('0x36')]})[_0x8a49('0x1f')](function(_0x3ce928){_0x40bb06[_0x8a49('0x3d')]=_0x3ce928;if(_0x311de3[_0x8a49('0x2c')][_0x8a49('0x3e')]){_0x51c153[_0x8a49('0x3f')]=[{'all':!![]}];}return db[_0x8a49('0x56')][_0x8a49('0x41')](_0x51c153);})[_0x8a49('0x1f')](function(_0x86d72d){_0x40bb06[_0x8a49('0x42')]=_0x86d72d;return _0x40bb06;});}})[_0x8a49('0x1f')](respondWithFilteredResult(_0x52840f,_0x51c153))[_0x8a49('0x43')](handleError(_0x52840f,null));};exports[_0x8a49('0x59')]=function(_0x3c175b,_0x500a0d,_0x10eeea){var _0x13ec3e={'raw':!![],'where':{}};var _0x11059d={};var _0x2705cd={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x8a49('0x5a')]({'where':{'id':_0x3c175b[_0x8a49('0x45')]['id']}})[_0x8a49('0x1f')](handleEntityNotFound(_0x500a0d,null))[_0x8a49('0x1f')](function(_0x43088b){if(_0x43088b){_0x11059d[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db['JscriptyAnswerReport'][_0x8a49('0x46')]);_0x11059d['query']=_[_0x8a49('0x2d')](_0x3c175b[_0x8a49('0x2c')]);_0x11059d[_0x8a49('0x37')]=_[_0x8a49('0x2e')](_0x11059d[_0x8a49('0x30')],_0x11059d[_0x8a49('0x2c')]);_0x13ec3e[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x11059d[_0x8a49('0x30')],qs[_0x8a49('0x31')](_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x13ec3e[_0x8a49('0x2f')]=_0x13ec3e['attributes'][_0x8a49('0x32')]?_0x13ec3e[_0x8a49('0x2f')]:_0x11059d[_0x8a49('0x30')];if(!_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x33')](_0x8a49('0x34'))){_0x13ec3e[_0x8a49('0x19')]=qs[_0x8a49('0x19')](_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x19')]);_0x13ec3e[_0x8a49('0x18')]=qs['offset'](_0x3c175b['query'][_0x8a49('0x18')]);}_0x13ec3e[_0x8a49('0x35')]=qs[_0x8a49('0x57')](_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x57')]);_0x13ec3e[_0x8a49('0x36')]=qs['filters'](_['pick'](_0x3c175b[_0x8a49('0x2c')],_0x11059d[_0x8a49('0x37')]));_0x13ec3e[_0x8a49('0x36')][_0x8a49('0x58')]=_0x43088b['id'];if(_0x3c175b['query'][_0x8a49('0x39')]){_0x13ec3e[_0x8a49('0x36')]=_[_0x8a49('0x3a')](_0x13ec3e[_0x8a49('0x36')],{'$or':_[_0x8a49('0x28')](_0x13ec3e[_0x8a49('0x2f')],function(_0x407230){var _0x168249={};_0x168249[_0x407230]={'$like':'%'+_0x3c175b[_0x8a49('0x2c')]['filter']+'%'};return _0x168249;})});}_0x13ec3e=_[_0x8a49('0x3a')]({},_0x13ec3e,_0x3c175b[_0x8a49('0x3c')]);return db[_0x8a49('0x5b')][_0x8a49('0x3d')]({'where':_0x13ec3e['where']})['then'](function(_0x3aa242){_0x2705cd[_0x8a49('0x3d')]=_0x3aa242;if(_0x3c175b[_0x8a49('0x2c')]['includeAll']){_0x13ec3e['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x8a49('0x41')](_0x13ec3e);})[_0x8a49('0x1f')](function(_0x56c262){_0x2705cd[_0x8a49('0x42')]=_0x56c262;return _0x2705cd;});}})[_0x8a49('0x1f')](respondWithFilteredResult(_0x500a0d,_0x13ec3e))[_0x8a49('0x43')](handleError(_0x500a0d,null));};function char(_0x151b7e){return _0x8a49('0x5c')===typeof _0x151b7e?String[_0x8a49('0x5d')][_0x8a49('0x1d')](null,arguments):_0x151b7e;}function needsEncapsulation(_0x58bc94){return!!_0x58bc94&&(_0x58bc94['toString']()[_0x8a49('0x5e')](char(0xd))>=0x0||_0x58bc94['toString']()[_0x8a49('0x5e')](char(0xa))>=0x0||_0x58bc94['toString']()['indexOf'](char(0x2c))>=0x0||_0x58bc94[_0x8a49('0x5f')]()[_0x8a49('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x58fb82){var _0x3750ee=char(0x22),_0x28bdb1='\x5c'+char(0x22),_0x454a10=_0x58fb82[_0x8a49('0x5f')]()[_0x8a49('0x60')](new RegExp(_0x3750ee,'g'),_0x28bdb1);return _0x3750ee+_0x454a10+_0x3750ee;}exports[_0x8a49('0x61')]=function(_0x5338ad,_0x34e3e5,_0x1bcce7){var _0x2712c4,_0x291b41;var _0x584830={'where':{'ProjectId':_0x5338ad['params']['id']}};if(_0x5338ad[_0x8a49('0x2c')][_0x8a49('0x62')]){_0x584830[_0x8a49('0x36')]['starttime']=JSON['parse'](_0x5338ad[_0x8a49('0x2c')][_0x8a49('0x62')]);}return db[_0x8a49('0x56')]['findAll'](_0x584830)[_0x8a49('0x1f')](handleEntityNotFound(_0x34e3e5,null))[_0x8a49('0x1f')](function(_0x298c57){if(_0x298c57){_0x2712c4=_0x298c57;return db[_0x8a49('0x63')][_0x8a49('0x41')]({'where':{'SessionId':{'$in':_[_0x8a49('0x28')](_0x2712c4,'id')},'ProjectId':_0x5338ad['params']['id']},'order':_0x8a49('0x64')});}})[_0x8a49('0x1f')](handleEntityNotFound(_0x34e3e5,null))[_0x8a49('0x1f')](function(_0x1c4907){if(_0x1c4907){_0x291b41=_0x1c4907;var _0x3c82f8={};for(var _0x2ad1c8=0x0,_0x1bba4e=_0x291b41[_0x8a49('0x32')];_0x2ad1c8<_0x1bba4e;_0x2ad1c8++){if(!_0x3c82f8[_0x8a49('0x33')](_0x291b41[_0x2ad1c8][_0x8a49('0x65')])){_0x3c82f8[_0x291b41[_0x2ad1c8][_0x8a49('0x65')]]=needsEncapsulation(_0x291b41[_0x2ad1c8][_0x8a49('0x66')])?encapsulate(_0x291b41[_0x2ad1c8]['question']):_0x291b41[_0x2ad1c8][_0x8a49('0x66')];}}var _0x3de826=[],_0x4a35d1={};for(var _0x225e09=0x0,_0x4b5ce8=_0x2712c4['length'];_0x225e09<_0x4b5ce8;_0x225e09++){_0x4a35d1={'ProjectId':_0x5338ad[_0x8a49('0x45')]['id'],'SessionId':_0x2712c4[_0x225e09]['id'],'StartTime':moment(_0x2712c4[_0x225e09]['starttime'])[_0x8a49('0x67')](_0x8a49('0x68'))};for(var _0xb1f2a2=0x0,_0x68deeb=_0x291b41[_0x8a49('0x32')];_0xb1f2a2<_0x68deeb;_0xb1f2a2++){if(_0x291b41[_0xb1f2a2][_0x8a49('0x69')]==_0x2712c4[_0x225e09]['id']&&_0x3c82f8[_0x8a49('0x33')](_0x291b41[_0xb1f2a2][_0x8a49('0x65')])){_0x4a35d1[_0x3c82f8[_0x291b41[_0xb1f2a2][_0x8a49('0x65')]]]=_0x291b41[_0xb1f2a2]['answer'];}}for(var _0x4641b5 in _0x3c82f8){if(!_0x4a35d1['hasOwnProperty'](_0x3c82f8[_0x4641b5])){_0x4a35d1[_0x3c82f8[_0x4641b5]]=null;}}_0x3de826[_0x8a49('0x6a')](_0x4a35d1);}return _0x3de826;}})[_0x8a49('0x1f')](function(_0x54139a){if(!_[_0x8a49('0x6b')](_0x54139a)){var _0x23c189=toCsv(_0x54139a);var _0x8f4264=Date[_0x8a49('0x6c')]();fs[_0x8a49('0x6d')](util[_0x8a49('0x67')](_0x8a49('0x6e'),_0x5338ad[_0x8a49('0x45')]['id'],_0x8f4264),_0x23c189);_0x34e3e5[_0x8a49('0x6f')](_0x8a49('0x70'),_0x8a49('0x71')+util['format'](_0x8a49('0x72'),_0x5338ad[_0x8a49('0x45')]['id'],_0x8f4264));_0x34e3e5['setHeader'](_0x8a49('0x73'),_0x8a49('0x74'));return _0x34e3e5['download'](util[_0x8a49('0x67')](_0x8a49('0x6e'),_0x5338ad[_0x8a49('0x45')]['id'],_0x8f4264));}else{return _0x34e3e5['sendStatus'](0xcc);}})[_0x8a49('0x43')](handleError(_0x34e3e5,null));}; \ No newline at end of file +var _0xd2bb=['findOne','JscriptySessionReport','length','nolimit','sort','rows','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','toString','indexOf','replace','getSummary','starttime','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','Projects','UserProfileResource','error','name','send','map','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','includeAll','omit','createdAt','updatedAt','destroy','getSessions'];(function(_0xc21ed7,_0x48d817){var _0x4aa047=function(_0x251ff4){while(--_0x251ff4){_0xc21ed7['push'](_0xc21ed7['shift']());}};_0x4aa047(++_0x48d817);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x4470bf,_0x35b87a){_0x4470bf=_0x4470bf-0x0;var _0x22caa2=_0xd2bb[_0x4470bf];return _0x22caa2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd2b('0x1'));var jsonpatch=require(_0xbd2b('0x2'));var rp=require(_0xbd2b('0x3'));var moment=require(_0xbd2b('0x4'));var BPromise=require(_0xbd2b('0x5'));var Mustache=require(_0xbd2b('0x6'));var util=require('util');var path=require(_0xbd2b('0x7'));var sox=require(_0xbd2b('0x8'));var csv=require(_0xbd2b('0x9'));var ejs=require(_0xbd2b('0xa'));var fs=require('fs');var _=require(_0xbd2b('0xb'));var squel=require(_0xbd2b('0xc'));var crypto=require(_0xbd2b('0xd'));var jsforce=require(_0xbd2b('0xe'));var deskjs=require(_0xbd2b('0xf'));var toCsv=require(_0xbd2b('0x9'));var querystring=require('querystring');var Papa=require(_0xbd2b('0x10'));var Redis=require('ioredis');var authService=require(_0xbd2b('0x11'));var qs=require(_0xbd2b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd2b('0x13'));var logger=require(_0xbd2b('0x14'))(_0xbd2b('0x15'));var utils=require(_0xbd2b('0x16'));var config=require(_0xbd2b('0x17'));var db=require(_0xbd2b('0x18'))['db'];function respondWithStatusCode(_0x1077b0,_0x275b60){_0x275b60=_0x275b60||0xcc;return function(_0x5722a4){if(_0x5722a4){return _0x1077b0[_0xbd2b('0x19')](_0x275b60);}return _0x1077b0[_0xbd2b('0x1a')](_0x275b60)[_0xbd2b('0x1b')]();};}function respondWithResult(_0x36916c,_0x29f3d1){_0x29f3d1=_0x29f3d1||0xc8;return function(_0x5f246b){if(_0x5f246b){return _0x36916c[_0xbd2b('0x1a')](_0x29f3d1)[_0xbd2b('0x1c')](_0x5f246b);}};}function respondWithFilteredResult(_0x1bc648,_0x1018dc){return function(_0x1815b3){if(_0x1815b3){var _0x2d8352=_0x1815b3['count'],_0x29c6a6=_0x1018dc[_0xbd2b('0x1d')],_0x190648=_0x1018dc[_0xbd2b('0x1d')]+_0x1018dc[_0xbd2b('0x1e')],_0x80463f;if(_0x190648>=_0x2d8352){_0x190648=_0x2d8352;_0x80463f=0xc8;}else{_0x80463f=0xce;}_0x1bc648[_0xbd2b('0x1a')](_0x80463f);return _0x1bc648[_0xbd2b('0x1f')](_0xbd2b('0x20'),_0x29c6a6+'-'+_0x190648+'/'+_0x2d8352)[_0xbd2b('0x1c')](_0x1815b3);}return null;};}function patchUpdates(_0xe4eaa6){return function(_0x21468b){try{jsonpatch[_0xbd2b('0x21')](_0x21468b,_0xe4eaa6,!![]);}catch(_0x5183c1){return BPromise[_0xbd2b('0x22')](_0x5183c1);}return _0x21468b[_0xbd2b('0x23')]();};}function saveUpdates(_0x2b6af4,_0x12d252){return function(_0xc1ce31){if(_0xc1ce31){return _0xc1ce31[_0xbd2b('0x24')](_0x2b6af4)[_0xbd2b('0x25')](function(_0x4cccdd){return _0x4cccdd;});}return null;};}function removeEntity(_0x5e4c99,_0x4a3588){return function(_0x2fb14b){if(_0x2fb14b){return _0x2fb14b['destroy']()[_0xbd2b('0x25')](function(){var _0x3efc8a=_0x2fb14b['get']({'plain':!![]});var _0x5b6b31=_0xbd2b('0x26');return db[_0xbd2b('0x27')]['destroy']({'where':{'type':_0x5b6b31,'resourceId':_0x3efc8a['id']}})['then'](function(){return _0x2fb14b;});})['then'](function(){_0x5e4c99[_0xbd2b('0x1a')](0xcc)[_0xbd2b('0x1b')]();});}};}function handleEntityNotFound(_0x9c5ba7,_0xf22365){return function(_0x17bb23){if(!_0x17bb23){_0x9c5ba7[_0xbd2b('0x19')](0x194);}return _0x17bb23;};}function handleError(_0x5bf25b,_0x51e091){_0x51e091=_0x51e091||0x1f4;return function(_0x5f5643){logger[_0xbd2b('0x28')](_0x5f5643['stack']);if(_0x5f5643[_0xbd2b('0x29')]){delete _0x5f5643[_0xbd2b('0x29')];}_0x5bf25b[_0xbd2b('0x1a')](_0x51e091)[_0xbd2b('0x2a')](_0x5f5643);};}exports['index']=function(_0x21dcd8,_0x5cb9a0){var _0x28ba11={},_0x364755={},_0x32d59c={'count':0x0,'rows':[]};var _0x2e5b0a=_[_0xbd2b('0x2b')](db[_0xbd2b('0x2c')][_0xbd2b('0x2d')],function(_0x4c7a57){return{'name':_0x4c7a57[_0xbd2b('0x2e')],'type':_0x4c7a57['type'][_0xbd2b('0x2f')]};});_0x364755[_0xbd2b('0x30')]=_['map'](_0x2e5b0a,'name');_0x364755[_0xbd2b('0x31')]=_[_0xbd2b('0x32')](_0x21dcd8[_0xbd2b('0x31')]);_0x364755[_0xbd2b('0x33')]=_[_0xbd2b('0x34')](_0x364755['model'],_0x364755[_0xbd2b('0x31')]);_0x28ba11[_0xbd2b('0x35')]=_[_0xbd2b('0x34')](_0x364755[_0xbd2b('0x30')],qs[_0xbd2b('0x36')](_0x21dcd8[_0xbd2b('0x31')][_0xbd2b('0x36')]));_0x28ba11['attributes']=_0x28ba11[_0xbd2b('0x35')]['length']?_0x28ba11['attributes']:_0x364755[_0xbd2b('0x30')];if(!_0x21dcd8[_0xbd2b('0x31')][_0xbd2b('0x37')]('nolimit')){_0x28ba11['limit']=qs[_0xbd2b('0x1e')](_0x21dcd8[_0xbd2b('0x31')][_0xbd2b('0x1e')]);_0x28ba11[_0xbd2b('0x1d')]=qs[_0xbd2b('0x1d')](_0x21dcd8['query'][_0xbd2b('0x1d')]);}_0x28ba11[_0xbd2b('0x38')]=qs['sort'](_0x21dcd8[_0xbd2b('0x31')]['sort']);_0x28ba11[_0xbd2b('0x39')]=qs[_0xbd2b('0x33')](_[_0xbd2b('0x3a')](_0x21dcd8[_0xbd2b('0x31')],_0x364755['filters']));if(_0x21dcd8[_0xbd2b('0x31')][_0xbd2b('0x3b')]){_0x28ba11[_0xbd2b('0x39')]=_[_0xbd2b('0x3c')](_0x28ba11['where'],{'$or':_[_0xbd2b('0x2b')](_0x2e5b0a,function(_0x4b2da7){if(_0x4b2da7[_0xbd2b('0x3d')]!==_0xbd2b('0x3e')){var _0xdd9d32={};_0xdd9d32[_0x4b2da7[_0xbd2b('0x29')]]={'$like':'%'+_0x21dcd8[_0xbd2b('0x31')]['filter']+'%'};return _0xdd9d32;}})});}_0x28ba11=_[_0xbd2b('0x3c')]({},_0x28ba11,_0x21dcd8[_0xbd2b('0x3f')]);var _0xef8bb3={'where':_0x28ba11['where']};return db[_0xbd2b('0x2c')][_0xbd2b('0x40')](_0xef8bb3)[_0xbd2b('0x25')](function(_0x40df8b){_0x32d59c[_0xbd2b('0x40')]=_0x40df8b;if(_0x21dcd8[_0xbd2b('0x31')]['includeAll']){_0x28ba11[_0xbd2b('0x41')]=[{'all':!![]}];}return db[_0xbd2b('0x2c')][_0xbd2b('0x42')](_0x28ba11);})['then'](function(_0x57c275){_0x32d59c['rows']=_0x57c275;return _0x32d59c;})[_0xbd2b('0x25')](respondWithFilteredResult(_0x5cb9a0,_0x28ba11))[_0xbd2b('0x43')](handleError(_0x5cb9a0,null));};exports[_0xbd2b('0x44')]=function(_0x903b22,_0x309ad2){var _0x47b68d={'raw':![],'where':{'id':_0x903b22['params']['id']}},_0xc23827={};_0xc23827[_0xbd2b('0x30')]=_['keys'](db[_0xbd2b('0x2c')][_0xbd2b('0x2d')]);_0xc23827[_0xbd2b('0x31')]=_['keys'](_0x903b22['query']);_0xc23827[_0xbd2b('0x33')]=_['intersection'](_0xc23827[_0xbd2b('0x30')],_0xc23827[_0xbd2b('0x31')]);_0x47b68d[_0xbd2b('0x35')]=_[_0xbd2b('0x34')](_0xc23827[_0xbd2b('0x30')],qs[_0xbd2b('0x36')](_0x903b22[_0xbd2b('0x31')][_0xbd2b('0x36')]));_0x47b68d['attributes']=_0x47b68d[_0xbd2b('0x35')]['length']?_0x47b68d['attributes']:_0xc23827['model'];if(_0x903b22[_0xbd2b('0x31')]['includeAll']){_0x47b68d[_0xbd2b('0x41')]=[{'all':!![]}];}_0x47b68d=_[_0xbd2b('0x3c')]({},_0x47b68d,_0x903b22[_0xbd2b('0x3f')]);return db['JscriptyProject'][_0xbd2b('0x45')](_0x47b68d)['then'](handleEntityNotFound(_0x309ad2,null))[_0xbd2b('0x25')](respondWithResult(_0x309ad2,null))[_0xbd2b('0x43')](handleError(_0x309ad2,null));};exports[_0xbd2b('0x46')]=function(_0x2dae90,_0x3194af){return db[_0xbd2b('0x2c')]['create'](_0x2dae90[_0xbd2b('0x47')],{})[_0xbd2b('0x25')](function(_0x3ec181){var _0x18361d=_0x2dae90[_0xbd2b('0x48')][_0xbd2b('0x49')]({'plain':!![]});if(!_0x18361d)throw new Error(_0xbd2b('0x4a'));if(_0x18361d['role']===_0xbd2b('0x48')){var _0x4d639d=_0x3ec181[_0xbd2b('0x49')]({'plain':!![]});var _0x1a056f=_0xbd2b('0x26');return db[_0xbd2b('0x4b')][_0xbd2b('0x45')]({'where':{'name':_0x1a056f,'userProfileId':_0x18361d[_0xbd2b('0x4c')]},'raw':!![]})[_0xbd2b('0x25')](function(_0x35ccf5){if(_0x35ccf5&&_0x35ccf5[_0xbd2b('0x4d')]===0x0){return db[_0xbd2b('0x27')][_0xbd2b('0x46')]({'name':_0x4d639d['name'],'resourceId':_0x4d639d['id'],'type':_0x35ccf5[_0xbd2b('0x29')],'sectionId':_0x35ccf5['id']},{})['then'](function(){return _0x3ec181;});}else{return _0x3ec181;}})[_0xbd2b('0x43')](function(_0x4a88db){logger[_0xbd2b('0x28')](_0xbd2b('0x4e'),_0x4a88db);throw _0x4a88db;});}return _0x3ec181;})[_0xbd2b('0x25')](respondWithResult(_0x3194af,0xc9))[_0xbd2b('0x43')](handleError(_0x3194af,null));};exports['clone']=function(_0x3854c6,_0x38427e){var _0x43b90c={'where':{'id':_0x3854c6[_0xbd2b('0x4f')]['id']}},_0x1efbc0={};_0x1efbc0[_0xbd2b('0x30')]=_['keys'](db['JscriptyProject']['rawAttributes']);_0x43b90c[_0xbd2b('0x35')]=_[_0xbd2b('0x34')](_0x1efbc0['model'],qs[_0xbd2b('0x36')](_0x3854c6[_0xbd2b('0x31')][_0xbd2b('0x36')]));_0x43b90c[_0xbd2b('0x35')]=_0x43b90c['attributes']['length']?_0x43b90c[_0xbd2b('0x35')]:_0x1efbc0[_0xbd2b('0x30')];if(_0x3854c6[_0xbd2b('0x31')][_0xbd2b('0x50')]){_0x43b90c[_0xbd2b('0x41')]=[{'all':!![]}];}_0x43b90c=_['merge']({},_0x43b90c,_0x3854c6[_0xbd2b('0x3f')]);return db['JscriptyProject'][_0xbd2b('0x45')](_0x43b90c)[_0xbd2b('0x25')](handleEntityNotFound(_0x38427e,null))[_0xbd2b('0x25')](function(_0x142b11){if(_0x142b11){var _0xae49a4=_0x142b11[_0xbd2b('0x49')]({'plain':!![]});_0xae49a4=qs[_0xbd2b('0x51')](_0xae49a4,['id',_0xbd2b('0x52'),_0xbd2b('0x53')]);_0x3854c6[_0xbd2b('0x47')]=_[_0xbd2b('0x51')](_0x3854c6[_0xbd2b('0x47')],['id',_0xbd2b('0x52'),_0xbd2b('0x53')]);return db[_0xbd2b('0x2c')]['create'](_[_0xbd2b('0x3c')](_0xae49a4,_0x3854c6[_0xbd2b('0x47')]),{'include':_0x3854c6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xbd2b('0x25')](function(_0x789237){var _0x5c34c0=_0x3854c6[_0xbd2b('0x48')][_0xbd2b('0x49')]({'plain':!![]});if(!_0x5c34c0)throw new Error(_0xbd2b('0x4a'));if(_0x5c34c0['role']===_0xbd2b('0x48')){var _0x45e8c5=_0x789237[_0xbd2b('0x49')]({'plain':!![]});var _0x47c700=_0xbd2b('0x26');return db[_0xbd2b('0x4b')][_0xbd2b('0x45')]({'where':{'name':_0x47c700,'userProfileId':_0x5c34c0[_0xbd2b('0x4c')]},'raw':!![]})['then'](function(_0x4eab9d){if(_0x4eab9d&&_0x4eab9d[_0xbd2b('0x4d')]===0x0){return db[_0xbd2b('0x27')][_0xbd2b('0x46')]({'name':_0x45e8c5[_0xbd2b('0x29')],'resourceId':_0x45e8c5['id'],'type':_0x4eab9d[_0xbd2b('0x29')],'sectionId':_0x4eab9d['id']},{})[_0xbd2b('0x25')](function(){return _0x789237;});}else{return _0x789237;}})[_0xbd2b('0x43')](function(_0x37c000){logger['error'](_0xbd2b('0x4e'),_0x37c000);throw _0x37c000;});}return _0x789237;});}})[_0xbd2b('0x25')](respondWithResult(_0x38427e,0xc9))[_0xbd2b('0x43')](handleError(_0x38427e,null));};exports[_0xbd2b('0x24')]=function(_0x4deb48,_0x2773b1){if(_0x4deb48[_0xbd2b('0x47')]['id']){delete _0x4deb48[_0xbd2b('0x47')]['id'];}return db['JscriptyProject']['find']({'where':{'id':_0x4deb48[_0xbd2b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2773b1,null))[_0xbd2b('0x25')](saveUpdates(_0x4deb48[_0xbd2b('0x47')],null))[_0xbd2b('0x25')](respondWithResult(_0x2773b1,null))['catch'](handleError(_0x2773b1,null));};exports[_0xbd2b('0x54')]=function(_0xa3f015,_0x22a5c2){return db[_0xbd2b('0x2c')]['find']({'where':{'id':_0xa3f015[_0xbd2b('0x4f')]['id']}})[_0xbd2b('0x25')](handleEntityNotFound(_0x22a5c2,null))[_0xbd2b('0x25')](removeEntity(_0x22a5c2,null))[_0xbd2b('0x43')](handleError(_0x22a5c2,null));};exports[_0xbd2b('0x55')]=function(_0x1a39af,_0xea90e4,_0x56dfde){var _0x471130={'raw':!![],'where':{}};var _0x3b7329={};var _0x36b8a9={'count':0x0,'rows':[]};return db[_0xbd2b('0x2c')][_0xbd2b('0x56')]({'where':{'id':_0x1a39af[_0xbd2b('0x4f')]['id']}})[_0xbd2b('0x25')](handleEntityNotFound(_0xea90e4,null))[_0xbd2b('0x25')](function(_0x5909bc){if(_0x5909bc){_0x3b7329[_0xbd2b('0x30')]=_[_0xbd2b('0x32')](db[_0xbd2b('0x57')]['rawAttributes']);_0x3b7329[_0xbd2b('0x31')]=_[_0xbd2b('0x32')](_0x1a39af[_0xbd2b('0x31')]);_0x3b7329[_0xbd2b('0x33')]=_['intersection'](_0x3b7329['model'],_0x3b7329[_0xbd2b('0x31')]);_0x471130['attributes']=_[_0xbd2b('0x34')](_0x3b7329['model'],qs['fields'](_0x1a39af[_0xbd2b('0x31')][_0xbd2b('0x36')]));_0x471130[_0xbd2b('0x35')]=_0x471130[_0xbd2b('0x35')][_0xbd2b('0x58')]?_0x471130[_0xbd2b('0x35')]:_0x3b7329['model'];if(!_0x1a39af['query'][_0xbd2b('0x37')](_0xbd2b('0x59'))){_0x471130[_0xbd2b('0x1e')]=qs[_0xbd2b('0x1e')](_0x1a39af['query'][_0xbd2b('0x1e')]);_0x471130[_0xbd2b('0x1d')]=qs[_0xbd2b('0x1d')](_0x1a39af[_0xbd2b('0x31')][_0xbd2b('0x1d')]);}_0x471130[_0xbd2b('0x38')]=qs[_0xbd2b('0x5a')](_0x1a39af[_0xbd2b('0x31')][_0xbd2b('0x5a')]);_0x471130[_0xbd2b('0x39')]=qs[_0xbd2b('0x33')](_[_0xbd2b('0x3a')](_0x1a39af[_0xbd2b('0x31')],_0x3b7329[_0xbd2b('0x33')]));_0x471130['where']['ProjectId']=_0x5909bc['id'];if(_0x1a39af['query'][_0xbd2b('0x3b')]){_0x471130[_0xbd2b('0x39')]=_['merge'](_0x471130[_0xbd2b('0x39')],{'$or':_[_0xbd2b('0x2b')](_0x471130[_0xbd2b('0x35')],function(_0x15e16e){var _0x26d07a={};_0x26d07a[_0x15e16e]={'$like':'%'+_0x1a39af['query'][_0xbd2b('0x3b')]+'%'};return _0x26d07a;})});}_0x471130=_[_0xbd2b('0x3c')]({},_0x471130,_0x1a39af[_0xbd2b('0x3f')]);return db[_0xbd2b('0x57')][_0xbd2b('0x40')]({'where':_0x471130[_0xbd2b('0x39')]})[_0xbd2b('0x25')](function(_0x1cd2f5){_0x36b8a9['count']=_0x1cd2f5;if(_0x1a39af['query']['includeAll']){_0x471130[_0xbd2b('0x41')]=[{'all':!![]}];}return db[_0xbd2b('0x57')][_0xbd2b('0x42')](_0x471130);})['then'](function(_0xb8ba6f){_0x36b8a9[_0xbd2b('0x5b')]=_0xb8ba6f;return _0x36b8a9;});}})['then'](respondWithFilteredResult(_0xea90e4,_0x471130))['catch'](handleError(_0xea90e4,null));};exports[_0xbd2b('0x5c')]=function(_0x342c65,_0x3427a3,_0x3127fb){var _0x136119={'raw':!![],'where':{}};var _0x55cc40={};var _0x5325c8={'count':0x0,'rows':[]};return db[_0xbd2b('0x2c')][_0xbd2b('0x56')]({'where':{'id':_0x342c65['params']['id']}})[_0xbd2b('0x25')](handleEntityNotFound(_0x3427a3,null))[_0xbd2b('0x25')](function(_0x217332){if(_0x217332){_0x55cc40[_0xbd2b('0x30')]=_[_0xbd2b('0x32')](db[_0xbd2b('0x5d')][_0xbd2b('0x2d')]);_0x55cc40[_0xbd2b('0x31')]=_[_0xbd2b('0x32')](_0x342c65[_0xbd2b('0x31')]);_0x55cc40[_0xbd2b('0x33')]=_[_0xbd2b('0x34')](_0x55cc40['model'],_0x55cc40[_0xbd2b('0x31')]);_0x136119[_0xbd2b('0x35')]=_['intersection'](_0x55cc40[_0xbd2b('0x30')],qs[_0xbd2b('0x36')](_0x342c65['query'][_0xbd2b('0x36')]));_0x136119[_0xbd2b('0x35')]=_0x136119[_0xbd2b('0x35')][_0xbd2b('0x58')]?_0x136119[_0xbd2b('0x35')]:_0x55cc40['model'];if(!_0x342c65[_0xbd2b('0x31')]['hasOwnProperty']('nolimit')){_0x136119[_0xbd2b('0x1e')]=qs[_0xbd2b('0x1e')](_0x342c65[_0xbd2b('0x31')][_0xbd2b('0x1e')]);_0x136119[_0xbd2b('0x1d')]=qs['offset'](_0x342c65[_0xbd2b('0x31')][_0xbd2b('0x1d')]);}_0x136119[_0xbd2b('0x38')]=qs[_0xbd2b('0x5a')](_0x342c65['query'][_0xbd2b('0x5a')]);_0x136119[_0xbd2b('0x39')]=qs['filters'](_[_0xbd2b('0x3a')](_0x342c65[_0xbd2b('0x31')],_0x55cc40[_0xbd2b('0x33')]));_0x136119[_0xbd2b('0x39')][_0xbd2b('0x5e')]=_0x217332['id'];if(_0x342c65['query'][_0xbd2b('0x3b')]){_0x136119[_0xbd2b('0x39')]=_[_0xbd2b('0x3c')](_0x136119[_0xbd2b('0x39')],{'$or':_['map'](_0x136119[_0xbd2b('0x35')],function(_0x527d86){var _0x1ad33b={};_0x1ad33b[_0x527d86]={'$like':'%'+_0x342c65[_0xbd2b('0x31')][_0xbd2b('0x3b')]+'%'};return _0x1ad33b;})});}_0x136119=_[_0xbd2b('0x3c')]({},_0x136119,_0x342c65['options']);return db[_0xbd2b('0x5d')][_0xbd2b('0x40')]({'where':_0x136119[_0xbd2b('0x39')]})['then'](function(_0x52f62d){_0x5325c8[_0xbd2b('0x40')]=_0x52f62d;if(_0x342c65[_0xbd2b('0x31')][_0xbd2b('0x50')]){_0x136119[_0xbd2b('0x41')]=[{'all':!![]}];}return db[_0xbd2b('0x5d')][_0xbd2b('0x42')](_0x136119);})[_0xbd2b('0x25')](function(_0x1b0fb1){_0x5325c8[_0xbd2b('0x5b')]=_0x1b0fb1;return _0x5325c8;});}})['then'](respondWithFilteredResult(_0x3427a3,_0x136119))[_0xbd2b('0x43')](handleError(_0x3427a3,null));};function char(_0x11d99f){return _0xbd2b('0x5f')===typeof _0x11d99f?String[_0xbd2b('0x60')][_0xbd2b('0x21')](null,arguments):_0x11d99f;}function needsEncapsulation(_0xdac478){return!!_0xdac478&&(_0xdac478[_0xbd2b('0x61')]()['indexOf'](char(0xd))>=0x0||_0xdac478[_0xbd2b('0x61')]()[_0xbd2b('0x62')](char(0xa))>=0x0||_0xdac478[_0xbd2b('0x61')]()['indexOf'](char(0x2c))>=0x0||_0xdac478[_0xbd2b('0x61')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x4ddc84){var _0x75b10f=char(0x22),_0x3c1598='\x5c'+char(0x22),_0x39a5ba=_0x4ddc84[_0xbd2b('0x61')]()[_0xbd2b('0x63')](new RegExp(_0x75b10f,'g'),_0x3c1598);return _0x75b10f+_0x39a5ba+_0x75b10f;}exports[_0xbd2b('0x64')]=function(_0x77cce1,_0x62d3e7,_0x24d7c0){var _0x50b9c8,_0x2f94ab;var _0x4ba8fd={'where':{'ProjectId':_0x77cce1[_0xbd2b('0x4f')]['id']}};if(_0x77cce1[_0xbd2b('0x31')]['startTime']){_0x4ba8fd[_0xbd2b('0x39')][_0xbd2b('0x65')]=JSON['parse'](_0x77cce1[_0xbd2b('0x31')][_0xbd2b('0x66')]);}return db[_0xbd2b('0x57')][_0xbd2b('0x42')](_0x4ba8fd)[_0xbd2b('0x25')](handleEntityNotFound(_0x62d3e7,null))[_0xbd2b('0x25')](function(_0x2aa57d){if(_0x2aa57d){_0x50b9c8=_0x2aa57d;return db[_0xbd2b('0x67')][_0xbd2b('0x42')]({'where':{'SessionId':{'$in':_[_0xbd2b('0x2b')](_0x50b9c8,'id')},'ProjectId':_0x77cce1[_0xbd2b('0x4f')]['id']},'order':_0xbd2b('0x68')});}})[_0xbd2b('0x25')](handleEntityNotFound(_0x62d3e7,null))[_0xbd2b('0x25')](function(_0x52f7fc){if(_0x52f7fc){_0x2f94ab=_0x52f7fc;var _0x390d0b={};for(var _0x2e1265=0x0,_0x52227b=_0x2f94ab[_0xbd2b('0x58')];_0x2e1265<_0x52227b;_0x2e1265++){if(!_0x390d0b[_0xbd2b('0x37')](_0x2f94ab[_0x2e1265]['questionId'])){_0x390d0b[_0x2f94ab[_0x2e1265][_0xbd2b('0x69')]]=needsEncapsulation(_0x2f94ab[_0x2e1265][_0xbd2b('0x6a')])?encapsulate(_0x2f94ab[_0x2e1265][_0xbd2b('0x6a')]):_0x2f94ab[_0x2e1265]['question'];}}var _0x938381=[],_0x272446={};for(var _0x27592a=0x0,_0x478f81=_0x50b9c8[_0xbd2b('0x58')];_0x27592a<_0x478f81;_0x27592a++){_0x272446={'ProjectId':_0x77cce1[_0xbd2b('0x4f')]['id'],'SessionId':_0x50b9c8[_0x27592a]['id'],'StartTime':moment(_0x50b9c8[_0x27592a][_0xbd2b('0x65')])[_0xbd2b('0x6b')](_0xbd2b('0x6c'))};for(var _0x20a842=0x0,_0x29dd63=_0x2f94ab[_0xbd2b('0x58')];_0x20a842<_0x29dd63;_0x20a842++){if(_0x2f94ab[_0x20a842][_0xbd2b('0x6d')]==_0x50b9c8[_0x27592a]['id']&&_0x390d0b['hasOwnProperty'](_0x2f94ab[_0x20a842][_0xbd2b('0x69')])){_0x272446[_0x390d0b[_0x2f94ab[_0x20a842][_0xbd2b('0x69')]]]=_0x2f94ab[_0x20a842]['answer'];}}for(var _0x43f3c3 in _0x390d0b){if(!_0x272446[_0xbd2b('0x37')](_0x390d0b[_0x43f3c3])){_0x272446[_0x390d0b[_0x43f3c3]]=null;}}_0x938381[_0xbd2b('0x6e')](_0x272446);}return _0x938381;}})[_0xbd2b('0x25')](function(_0x2dedb5){if(!_[_0xbd2b('0x6f')](_0x2dedb5)){var _0x430a1e=toCsv(_0x2dedb5);var _0xf96f61=Date[_0xbd2b('0x70')]();fs[_0xbd2b('0x71')](util[_0xbd2b('0x6b')](_0xbd2b('0x72'),_0x77cce1[_0xbd2b('0x4f')]['id'],_0xf96f61),_0x430a1e);_0x62d3e7[_0xbd2b('0x73')](_0xbd2b('0x74'),'attachment;\x20filename='+util[_0xbd2b('0x6b')](_0xbd2b('0x75'),_0x77cce1[_0xbd2b('0x4f')]['id'],_0xf96f61));_0x62d3e7[_0xbd2b('0x73')](_0xbd2b('0x76'),_0xbd2b('0x77'));return _0x62d3e7['download'](util[_0xbd2b('0x6b')](_0xbd2b('0x72'),_0x77cce1[_0xbd2b('0x4f')]['id'],_0xf96f61));}else{return _0x62d3e7[_0xbd2b('0x19')](0xcc);}})['catch'](handleError(_0x62d3e7,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 460b9ce..95532d8 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 _0x5638=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x42457a,_0xb24256){var _0x409ae1=function(_0x34083f){while(--_0x34083f){_0x42457a['push'](_0x42457a['shift']());}};_0x409ae1(++_0xb24256);}(_0x5638,0x8d));var _0x8563=function(_0x4720f8,_0x273953){_0x4720f8=_0x4720f8-0x0;var _0x39c207=_0x5638[_0x4720f8];return _0x39c207;};'use strict';var _=require(_0x8563('0x0'));var util=require(_0x8563('0x1'));var logger=require(_0x8563('0x2'))(_0x8563('0x3'));var moment=require('moment');var BPromise=require(_0x8563('0x4'));var rp=require(_0x8563('0x5'));var fs=require('fs');var path=require(_0x8563('0x6'));var rimraf=require(_0x8563('0x7'));var config=require(_0x8563('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x8563('0x9')]=function(_0x49e1db,_0x2dbea4){return _0x49e1db[_0x8563('0xa')](_0x8563('0xb'),attributes,{'tableName':_0x8563('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x564b=['exports','define','JscriptyProject','jscripty_projects','util','../../config/logger','api','bluebird'];(function(_0x2af353,_0x418430){var _0x3f3f4e=function(_0x186bb5){while(--_0x186bb5){_0x2af353['push'](_0x2af353['shift']());}};_0x3f3f4e(++_0x418430);}(_0x564b,0x8c));var _0xb564=function(_0x57fd31,_0x54d6ab){_0x57fd31=_0x57fd31-0x0;var _0x5d6a8e=_0x564b[_0x57fd31];return _0x5d6a8e;};'use strict';var _=require('lodash');var util=require(_0xb564('0x0'));var logger=require(_0xb564('0x1'))(_0xb564('0x2'));var moment=require('moment');var BPromise=require(_0xb564('0x3'));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('./jscriptyProject.attributes');module[_0xb564('0x4')]=function(_0x366e89,_0x278e40){return _0x366e89[_0xb564('0x5')](_0xb564('0x6'),attributes,{'tableName':_0xb564('0x7'),'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 4e2137c..8eb42f0 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 _0xb1e0=['rpc','jayson/promise','request','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x265543,_0x890136){var _0x1b417b=function(_0x12736b){while(--_0x12736b){_0x265543['push'](_0x265543['shift']());}};_0x1b417b(++_0x890136);}(_0xb1e0,0x139));var _0x0b1e=function(_0x29e3f2,_0x5c8272){_0x29e3f2=_0x29e3f2-0x0;var _0x44cc67=_0xb1e0[_0x29e3f2];return _0x44cc67;};'use strict';var _=require(_0x0b1e('0x0'));var util=require(_0x0b1e('0x1'));var moment=require('moment');var BPromise=require(_0x0b1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b1e('0x3'));var db=require(_0x0b1e('0x4'))['db'];var utils=require(_0x0b1e('0x5'));var logger=require(_0x0b1e('0x6'))(_0x0b1e('0x7'));var config=require('../../config/environment');var jayson=require(_0x0b1e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dabc4,_0x4d2890,_0x48d4d9){return new BPromise(function(_0x24fdb2,_0x281d0b){return client[_0x0b1e('0x9')](_0x3dabc4,_0x48d4d9)['then'](function(_0x5575c6){logger[_0x0b1e('0xa')]('JscriptyProject,\x20%s,\x20%s',_0x4d2890,'request\x20sent');logger[_0x0b1e('0xb')](_0x0b1e('0xc'),_0x4d2890,_0x0b1e('0xd'),JSON[_0x0b1e('0xe')](_0x5575c6));if(_0x5575c6[_0x0b1e('0xf')]){if(_0x5575c6[_0x0b1e('0xf')][_0x0b1e('0x10')]===0x1f4){logger[_0x0b1e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x4d2890,_0x5575c6[_0x0b1e('0xf')][_0x0b1e('0x11')]);return _0x281d0b(_0x5575c6[_0x0b1e('0xf')][_0x0b1e('0x11')]);}logger[_0x0b1e('0xf')](_0x0b1e('0x12'),_0x4d2890,_0x5575c6['error'][_0x0b1e('0x11')]);return _0x24fdb2(_0x5575c6['error'][_0x0b1e('0x11')]);}else{logger[_0x0b1e('0xa')](_0x0b1e('0x12'),_0x4d2890,_0x0b1e('0xd'));_0x24fdb2(_0x5575c6[_0x0b1e('0x13')]['message']);}})['catch'](function(_0xd54b93){logger[_0x0b1e('0xf')](_0x0b1e('0x12'),_0x4d2890,_0xd54b93);_0x281d0b(_0xd54b93);});});} \ No newline at end of file +var _0x536b=['../../config/utils','../../config/logger','rpc','client','http','info','JscriptyProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1cd59b,_0x235d63){var _0x2a7a17=function(_0x1e4b65){while(--_0x1e4b65){_0x1cd59b['push'](_0x1cd59b['shift']());}};_0x2a7a17(++_0x235d63);}(_0x536b,0x1c7));var _0xb536=function(_0x466d0e,_0x3caef5){_0x466d0e=_0x466d0e-0x0;var _0x51e4e0=_0x536b[_0x466d0e];return _0x51e4e0;};'use strict';var _=require(_0xb536('0x0'));var util=require(_0xb536('0x1'));var moment=require(_0xb536('0x2'));var BPromise=require(_0xb536('0x3'));var rs=require(_0xb536('0x4'));var fs=require('fs');var Redis=require(_0xb536('0x5'));var db=require(_0xb536('0x6'))['db'];var utils=require(_0xb536('0x7'));var logger=require(_0xb536('0x8'))(_0xb536('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb536('0xa')][_0xb536('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x289866,_0x429b1e,_0x46e995){return new BPromise(function(_0x39e32a,_0x3201b5){return client['request'](_0x289866,_0x46e995)['then'](function(_0x5e5ea8){logger[_0xb536('0xc')](_0xb536('0xd'),_0x429b1e,'request\x20sent');logger[_0xb536('0xe')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x429b1e,_0xb536('0xf'),JSON[_0xb536('0x10')](_0x5e5ea8));if(_0x5e5ea8[_0xb536('0x11')]){if(_0x5e5ea8[_0xb536('0x11')][_0xb536('0x12')]===0x1f4){logger[_0xb536('0x11')](_0xb536('0xd'),_0x429b1e,_0x5e5ea8['error']['message']);return _0x3201b5(_0x5e5ea8[_0xb536('0x11')]['message']);}logger[_0xb536('0x11')](_0xb536('0xd'),_0x429b1e,_0x5e5ea8[_0xb536('0x11')][_0xb536('0x13')]);return _0x39e32a(_0x5e5ea8[_0xb536('0x11')][_0xb536('0x13')]);}else{logger[_0xb536('0xc')](_0xb536('0xd'),_0x429b1e,_0xb536('0xf'));_0x39e32a(_0x5e5ea8['result'][_0xb536('0x13')]);}})[_0xb536('0x14')](function(_0xa9deae){logger[_0xb536('0x11')](_0xb536('0xd'),_0x429b1e,_0xa9deae);_0x3201b5(_0xa9deae);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 43e3516..3fdd9b1 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 _0x3ce2=['/describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','index'];(function(_0xd77ea0,_0x51e90f){var _0x4388db=function(_0x12af5f){while(--_0x12af5f){_0xd77ea0['push'](_0xd77ea0['shift']());}};_0x4388db(++_0x51e90f);}(_0x3ce2,0x1dd));var _0x23ce=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3ce2[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x23ce('0x0'));var util=require(_0x23ce('0x1'));var path=require(_0x23ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x23ce('0x3'));var router=express[_0x23ce('0x4')]();var auth=require(_0x23ce('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x23ce('0x6')]('/',auth[_0x23ce('0x7')](),controller[_0x23ce('0x8')]);router[_0x23ce('0x6')](_0x23ce('0x9'),auth[_0x23ce('0x7')](),controller['describe']);router[_0x23ce('0x6')](_0x23ce('0xa'),auth[_0x23ce('0x7')](),controller[_0x23ce('0xb')]);router[_0x23ce('0xc')]('/',auth[_0x23ce('0x7')](),controller[_0x23ce('0xd')]);router[_0x23ce('0xe')](_0x23ce('0xa'),auth[_0x23ce('0x7')](),controller[_0x23ce('0xf')]);router[_0x23ce('0x10')](_0x23ce('0xa'),auth['isAuthenticated'](),controller[_0x23ce('0x11')]);module['exports']=router; \ No newline at end of file +var _0xcfe3=['show','post','create','put','update','delete','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xcfe3,0xe4));var _0x3cfe=function(_0x14b96c,_0x30ab58){_0x14b96c=_0x14b96c-0x0;var _0x4d30b1=_0xcfe3[_0x14b96c];return _0x4d30b1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3cfe('0x0'));var timeout=require(_0x3cfe('0x1'));var express=require(_0x3cfe('0x2'));var router=express[_0x3cfe('0x3')]();var auth=require(_0x3cfe('0x4'));var interaction=require(_0x3cfe('0x5'));var config=require(_0x3cfe('0x6'));var controller=require(_0x3cfe('0x7'));router[_0x3cfe('0x8')]('/',auth[_0x3cfe('0x9')](),controller[_0x3cfe('0xa')]);router[_0x3cfe('0x8')](_0x3cfe('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x3cfe('0x9')](),controller[_0x3cfe('0xc')]);router[_0x3cfe('0xd')]('/',auth[_0x3cfe('0x9')](),controller[_0x3cfe('0xe')]);router[_0x3cfe('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3cfe('0x10')]);router[_0x3cfe('0x11')](_0x3cfe('0x12'),auth[_0x3cfe('0x9')](),controller['destroy']);module[_0x3cfe('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 328d129..7aa1325 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 _0xd20a=['STRING','TEXT','sequelize'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd20a,0x1df));var _0xad20=function(_0x5ef8f7,_0xcefb41){_0x5ef8f7=_0x5ef8f7-0x0;var _0x8616ef=_0xd20a[_0x5ef8f7];return _0x8616ef;};'use strict';var Sequelize=require(_0xad20('0x0'));module['exports']={'question':{'type':Sequelize[_0xad20('0x1')]},'answer':{'type':Sequelize[_0xad20('0x2')]('long')},'membername':{'type':Sequelize[_0xad20('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xad20('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xad20('0x1')]}}; \ No newline at end of file +var _0xd7d7=['sequelize','STRING'];(function(_0x4eb662,_0x540e40){var _0x2d7889=function(_0xbe80a7){while(--_0xbe80a7){_0x4eb662['push'](_0x4eb662['shift']());}};_0x2d7889(++_0x540e40);}(_0xd7d7,0xc6));var _0x7d7d=function(_0x306b0a,_0x14a78f){_0x306b0a=_0x306b0a-0x0;var _0x215862=_0xd7d7[_0x306b0a];return _0x215862;};'use strict';var Sequelize=require(_0x7d7d('0x0'));module['exports']={'question':{'type':Sequelize[_0x7d7d('0x1')]},'answer':{'type':Sequelize['TEXT']('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x7d7d('0x1')]},'queue':{'type':Sequelize[_0x7d7d('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7d7d('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x7d7d('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 21e47d9..7b3d22d 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 _0x3a0b=['update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','json','count','status','set','Content-Range','apply','reject'];(function(_0x4df551,_0x1cd135){var _0x412d19=function(_0x3032e7){while(--_0x3032e7){_0x4df551['push'](_0x4df551['shift']());}};_0x412d19(++_0x1cd135);}(_0x3a0b,0xc4));var _0xb3a0=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x3a0b[_0x1e05c1];return _0x15f1ca;};'use strict';var pdf=require(_0xb3a0('0x0'));var emlformat=require(_0xb3a0('0x1'));var rimraf=require(_0xb3a0('0x2'));var zipdir=require(_0xb3a0('0x3'));var jsonpatch=require(_0xb3a0('0x4'));var rp=require(_0xb3a0('0x5'));var moment=require(_0xb3a0('0x6'));var BPromise=require(_0xb3a0('0x7'));var Mustache=require(_0xb3a0('0x8'));var util=require(_0xb3a0('0x9'));var path=require(_0xb3a0('0xa'));var sox=require('sox');var csv=require(_0xb3a0('0xb'));var ejs=require(_0xb3a0('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb3a0('0xd'));var jsforce=require(_0xb3a0('0xe'));var deskjs=require(_0xb3a0('0xf'));var toCsv=require(_0xb3a0('0xb'));var querystring=require(_0xb3a0('0x10'));var Papa=require(_0xb3a0('0x11'));var Redis=require(_0xb3a0('0x12'));var authService=require(_0xb3a0('0x13'));var qs=require(_0xb3a0('0x14'));var as=require(_0xb3a0('0x15'));var hardwareService=require(_0xb3a0('0x16'));var logger=require(_0xb3a0('0x17'))(_0xb3a0('0x18'));var utils=require('../../config/utils');var config=require(_0xb3a0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48749d,_0x18adac){_0x18adac=_0x18adac||0xcc;return function(_0x1491d6){if(_0x1491d6){return _0x48749d[_0xb3a0('0x1a')](_0x18adac);}return _0x48749d['status'](_0x18adac)[_0xb3a0('0x1b')]();};}function respondWithResult(_0xc66b77,_0x54ea9e){_0x54ea9e=_0x54ea9e||0xc8;return function(_0x525f14){if(_0x525f14){return _0xc66b77['status'](_0x54ea9e)[_0xb3a0('0x1c')](_0x525f14);}};}function respondWithFilteredResult(_0x3f3524,_0x5dd417){return function(_0x33550b){if(_0x33550b){var _0x4d2353=_0x33550b[_0xb3a0('0x1d')],_0x4861e3=_0x5dd417['offset'],_0xb4edac=_0x5dd417['offset']+_0x5dd417['limit'],_0x32ee2c;if(_0xb4edac>=_0x4d2353){_0xb4edac=_0x4d2353;_0x32ee2c=0xc8;}else{_0x32ee2c=0xce;}_0x3f3524[_0xb3a0('0x1e')](_0x32ee2c);return _0x3f3524[_0xb3a0('0x1f')](_0xb3a0('0x20'),_0x4861e3+'-'+_0xb4edac+'/'+_0x4d2353)[_0xb3a0('0x1c')](_0x33550b);}return null;};}function patchUpdates(_0x5170de){return function(_0x55182f){try{jsonpatch[_0xb3a0('0x21')](_0x55182f,_0x5170de,!![]);}catch(_0x164917){return BPromise[_0xb3a0('0x22')](_0x164917);}return _0x55182f['save']();};}function saveUpdates(_0x3338d7,_0x3013e5){return function(_0x892e56){if(_0x892e56){return _0x892e56[_0xb3a0('0x23')](_0x3338d7)[_0xb3a0('0x24')](function(_0x379ead){return _0x379ead;});}return null;};}function removeEntity(_0x5f54f3,_0x5bf9a0){return function(_0x457e45){if(_0x457e45){return _0x457e45[_0xb3a0('0x25')]()[_0xb3a0('0x24')](function(){_0x5f54f3[_0xb3a0('0x1e')](0xcc)[_0xb3a0('0x1b')]();});}};}function handleEntityNotFound(_0x40e8a6,_0x4156da){return function(_0x2ed750){if(!_0x2ed750){_0x40e8a6[_0xb3a0('0x1a')](0x194);}return _0x2ed750;};}function handleError(_0x3a108c,_0x403710){_0x403710=_0x403710||0x1f4;return function(_0x190865){logger[_0xb3a0('0x26')](_0x190865[_0xb3a0('0x27')]);if(_0x190865[_0xb3a0('0x28')]){delete _0x190865['name'];}_0x3a108c[_0xb3a0('0x1e')](_0x403710)[_0xb3a0('0x29')](_0x190865);};}exports[_0xb3a0('0x2a')]=function(_0x4475cc,_0x4fe6ee){var _0xfc0a6={},_0x391f9d={},_0x1bb7de={'count':0x0,'rows':[]};var _0x406c77=_[_0xb3a0('0x2b')](db[_0xb3a0('0x2c')][_0xb3a0('0x2d')],function(_0x306f17){return{'name':_0x306f17['fieldName'],'type':_0x306f17[_0xb3a0('0x2e')][_0xb3a0('0x2f')]};});_0x391f9d[_0xb3a0('0x30')]=_[_0xb3a0('0x2b')](_0x406c77,_0xb3a0('0x28'));_0x391f9d[_0xb3a0('0x31')]=_['keys'](_0x4475cc[_0xb3a0('0x31')]);_0x391f9d[_0xb3a0('0x32')]=_[_0xb3a0('0x33')](_0x391f9d[_0xb3a0('0x30')],_0x391f9d['query']);_0xfc0a6[_0xb3a0('0x34')]=_['intersection'](_0x391f9d['model'],qs[_0xb3a0('0x35')](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x35')]));_0xfc0a6['attributes']=_0xfc0a6[_0xb3a0('0x34')][_0xb3a0('0x36')]?_0xfc0a6[_0xb3a0('0x34')]:_0x391f9d[_0xb3a0('0x30')];if(!_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x37')](_0xb3a0('0x38'))){_0xfc0a6[_0xb3a0('0x39')]=qs['limit'](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x39')]);_0xfc0a6[_0xb3a0('0x3a')]=qs[_0xb3a0('0x3a')](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3a')]);}_0xfc0a6[_0xb3a0('0x3b')]=qs[_0xb3a0('0x3c')](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3c')]);_0xfc0a6[_0xb3a0('0x3d')]=qs[_0xb3a0('0x32')](_[_0xb3a0('0x3e')](_0x4475cc[_0xb3a0('0x31')],_0x391f9d[_0xb3a0('0x32')]));if(_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3f')]){_0xfc0a6[_0xb3a0('0x3d')]=_['merge'](_0xfc0a6['where'],{'$or':_[_0xb3a0('0x2b')](_0x406c77,function(_0x2c32ed){if(_0x2c32ed[_0xb3a0('0x2e')]!=='VIRTUAL'){var _0x49ca03={};_0x49ca03[_0x2c32ed[_0xb3a0('0x28')]]={'$like':'%'+_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3f')]+'%'};return _0x49ca03;}})});}_0xfc0a6=_[_0xb3a0('0x40')]({},_0xfc0a6,_0x4475cc[_0xb3a0('0x41')]);var _0x1bf98a={'where':_0xfc0a6[_0xb3a0('0x3d')]};return db[_0xb3a0('0x2c')][_0xb3a0('0x1d')](_0x1bf98a)['then'](function(_0x1c66e4){_0x1bb7de[_0xb3a0('0x1d')]=_0x1c66e4;if(_0x4475cc['query'][_0xb3a0('0x42')]){_0xfc0a6['include']=[{'all':!![]}];}return db[_0xb3a0('0x2c')][_0xb3a0('0x43')](_0xfc0a6);})[_0xb3a0('0x24')](function(_0x1d0136){_0x1bb7de[_0xb3a0('0x44')]=_0x1d0136;return _0x1bb7de;})[_0xb3a0('0x24')](respondWithFilteredResult(_0x4fe6ee,_0xfc0a6))[_0xb3a0('0x45')](handleError(_0x4fe6ee,null));};exports[_0xb3a0('0x46')]=function(_0x540f87,_0x546064){var _0x52634b={'raw':!![],'where':{'id':_0x540f87[_0xb3a0('0x47')]['id']}},_0x5ca10f={};_0x5ca10f[_0xb3a0('0x30')]=_[_0xb3a0('0x48')](db[_0xb3a0('0x2c')][_0xb3a0('0x2d')]);_0x5ca10f[_0xb3a0('0x31')]=_[_0xb3a0('0x48')](_0x540f87[_0xb3a0('0x31')]);_0x5ca10f[_0xb3a0('0x32')]=_[_0xb3a0('0x33')](_0x5ca10f[_0xb3a0('0x30')],_0x5ca10f[_0xb3a0('0x31')]);_0x52634b['attributes']=_['intersection'](_0x5ca10f[_0xb3a0('0x30')],qs['fields'](_0x540f87[_0xb3a0('0x31')][_0xb3a0('0x35')]));_0x52634b[_0xb3a0('0x34')]=_0x52634b[_0xb3a0('0x34')][_0xb3a0('0x36')]?_0x52634b[_0xb3a0('0x34')]:_0x5ca10f[_0xb3a0('0x30')];if(_0x540f87[_0xb3a0('0x31')][_0xb3a0('0x42')]){_0x52634b[_0xb3a0('0x49')]=[{'all':!![]}];}_0x52634b=_[_0xb3a0('0x40')]({},_0x52634b,_0x540f87[_0xb3a0('0x41')]);return db[_0xb3a0('0x2c')][_0xb3a0('0x4a')](_0x52634b)[_0xb3a0('0x24')](handleEntityNotFound(_0x546064,null))['then'](respondWithResult(_0x546064,null))[_0xb3a0('0x45')](handleError(_0x546064,null));};exports['create']=function(_0x9ccf1d,_0x366f9c){return db[_0xb3a0('0x2c')]['create'](_0x9ccf1d[_0xb3a0('0x4b')],{})[_0xb3a0('0x24')](respondWithResult(_0x366f9c,0xc9))[_0xb3a0('0x45')](handleError(_0x366f9c,null));};exports[_0xb3a0('0x23')]=function(_0x52d57d,_0x1f5692){if(_0x52d57d[_0xb3a0('0x4b')]['id']){delete _0x52d57d[_0xb3a0('0x4b')]['id'];}return db[_0xb3a0('0x2c')][_0xb3a0('0x4a')]({'where':{'id':_0x52d57d[_0xb3a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f5692,null))[_0xb3a0('0x24')](saveUpdates(_0x52d57d[_0xb3a0('0x4b')],null))['then'](respondWithResult(_0x1f5692,null))[_0xb3a0('0x45')](handleError(_0x1f5692,null));};exports[_0xb3a0('0x25')]=function(_0x26ca2d,_0x5a0f55){return db[_0xb3a0('0x2c')][_0xb3a0('0x4a')]({'where':{'id':_0x26ca2d[_0xb3a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a0f55,null))['then'](removeEntity(_0x5a0f55,null))['catch'](handleError(_0x5a0f55,null));};exports[_0xb3a0('0x4c')]=function(_0x39fdf2,_0x4bb245){return db[_0xb3a0('0x2c')][_0xb3a0('0x4c')]()[_0xb3a0('0x24')](respondWithResult(_0x4bb245,null))[_0xb3a0('0x45')](handleError(_0x4bb245,null));}; \ No newline at end of file +var _0x5527=['nolimit','limit','order','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','JscriptyQuestionReport','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length'];(function(_0x3f3571,_0x216802){var _0xa45351=function(_0x39dd47){while(--_0x39dd47){_0x3f3571['push'](_0x3f3571['shift']());}};_0xa45351(++_0x216802);}(_0x5527,0x12e));var _0x7552=function(_0x14c508,_0xe3eb12){_0x14c508=_0x14c508-0x0;var _0x259d0a=_0x5527[_0x14c508];return _0x259d0a;};'use strict';var pdf=require(_0x7552('0x0'));var emlformat=require(_0x7552('0x1'));var rimraf=require(_0x7552('0x2'));var zipdir=require(_0x7552('0x3'));var jsonpatch=require(_0x7552('0x4'));var rp=require('request-promise');var moment=require(_0x7552('0x5'));var BPromise=require(_0x7552('0x6'));var Mustache=require('mustache');var util=require(_0x7552('0x7'));var path=require('path');var sox=require(_0x7552('0x8'));var csv=require(_0x7552('0x9'));var ejs=require(_0x7552('0xa'));var fs=require('fs');var _=require(_0x7552('0xb'));var squel=require('squel');var crypto=require(_0x7552('0xc'));var jsforce=require(_0x7552('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7552('0x9'));var querystring=require(_0x7552('0xe'));var Papa=require(_0x7552('0xf'));var Redis=require(_0x7552('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7552('0x11'));var as=require(_0x7552('0x12'));var hardwareService=require(_0x7552('0x13'));var logger=require(_0x7552('0x14'))(_0x7552('0x15'));var utils=require(_0x7552('0x16'));var config=require(_0x7552('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b1e8e,_0x222bb8){_0x222bb8=_0x222bb8||0xcc;return function(_0x1dfb70){if(_0x1dfb70){return _0x2b1e8e[_0x7552('0x18')](_0x222bb8);}return _0x2b1e8e['status'](_0x222bb8)[_0x7552('0x19')]();};}function respondWithResult(_0x1ececf,_0x137029){_0x137029=_0x137029||0xc8;return function(_0x223e9a){if(_0x223e9a){return _0x1ececf[_0x7552('0x1a')](_0x137029)[_0x7552('0x1b')](_0x223e9a);}};}function respondWithFilteredResult(_0x4f05da,_0x38b8bb){return function(_0x497c7e){if(_0x497c7e){var _0x122f6e=_0x497c7e[_0x7552('0x1c')],_0x5838c1=_0x38b8bb['offset'],_0x206c4e=_0x38b8bb[_0x7552('0x1d')]+_0x38b8bb['limit'],_0x233003;if(_0x206c4e>=_0x122f6e){_0x206c4e=_0x122f6e;_0x233003=0xc8;}else{_0x233003=0xce;}_0x4f05da['status'](_0x233003);return _0x4f05da[_0x7552('0x1e')](_0x7552('0x1f'),_0x5838c1+'-'+_0x206c4e+'/'+_0x122f6e)[_0x7552('0x1b')](_0x497c7e);}return null;};}function patchUpdates(_0x21825e){return function(_0x46c535){try{jsonpatch[_0x7552('0x20')](_0x46c535,_0x21825e,!![]);}catch(_0x2a2a41){return BPromise[_0x7552('0x21')](_0x2a2a41);}return _0x46c535[_0x7552('0x22')]();};}function saveUpdates(_0x121aa2,_0x47b7b7){return function(_0x42e49e){if(_0x42e49e){return _0x42e49e['update'](_0x121aa2)[_0x7552('0x23')](function(_0xa435de){return _0xa435de;});}return null;};}function removeEntity(_0x2ddf16,_0x198486){return function(_0x2f41cb){if(_0x2f41cb){return _0x2f41cb[_0x7552('0x24')]()[_0x7552('0x23')](function(){_0x2ddf16[_0x7552('0x1a')](0xcc)[_0x7552('0x19')]();});}};}function handleEntityNotFound(_0x361647,_0x2b9c62){return function(_0x4a898e){if(!_0x4a898e){_0x361647[_0x7552('0x18')](0x194);}return _0x4a898e;};}function handleError(_0x38a1e5,_0x38c4fc){_0x38c4fc=_0x38c4fc||0x1f4;return function(_0x190f97){logger[_0x7552('0x25')](_0x190f97[_0x7552('0x26')]);if(_0x190f97['name']){delete _0x190f97[_0x7552('0x27')];}_0x38a1e5[_0x7552('0x1a')](_0x38c4fc)['send'](_0x190f97);};}exports['index']=function(_0x5722cb,_0x4602a8){var _0x2d2855={},_0x583c5e={},_0xe0e640={'count':0x0,'rows':[]};var _0x7e329a=_['map'](db[_0x7552('0x28')][_0x7552('0x29')],function(_0xfea2cc){return{'name':_0xfea2cc[_0x7552('0x2a')],'type':_0xfea2cc['type'][_0x7552('0x2b')]};});_0x583c5e[_0x7552('0x2c')]=_[_0x7552('0x2d')](_0x7e329a,_0x7552('0x27'));_0x583c5e['query']=_[_0x7552('0x2e')](_0x5722cb[_0x7552('0x2f')]);_0x583c5e[_0x7552('0x30')]=_[_0x7552('0x31')](_0x583c5e['model'],_0x583c5e['query']);_0x2d2855[_0x7552('0x32')]=_[_0x7552('0x31')](_0x583c5e[_0x7552('0x2c')],qs[_0x7552('0x33')](_0x5722cb[_0x7552('0x2f')]['fields']));_0x2d2855[_0x7552('0x32')]=_0x2d2855[_0x7552('0x32')][_0x7552('0x34')]?_0x2d2855['attributes']:_0x583c5e['model'];if(!_0x5722cb[_0x7552('0x2f')]['hasOwnProperty'](_0x7552('0x35'))){_0x2d2855[_0x7552('0x36')]=qs['limit'](_0x5722cb['query'][_0x7552('0x36')]);_0x2d2855[_0x7552('0x1d')]=qs[_0x7552('0x1d')](_0x5722cb[_0x7552('0x2f')][_0x7552('0x1d')]);}_0x2d2855[_0x7552('0x37')]=qs[_0x7552('0x38')](_0x5722cb[_0x7552('0x2f')][_0x7552('0x38')]);_0x2d2855[_0x7552('0x39')]=qs['filters'](_['pick'](_0x5722cb[_0x7552('0x2f')],_0x583c5e[_0x7552('0x30')]));if(_0x5722cb[_0x7552('0x2f')]['filter']){_0x2d2855[_0x7552('0x39')]=_[_0x7552('0x3a')](_0x2d2855[_0x7552('0x39')],{'$or':_['map'](_0x7e329a,function(_0x1617bb){if(_0x1617bb['type']!==_0x7552('0x3b')){var _0x129d4c={};_0x129d4c[_0x1617bb['name']]={'$like':'%'+_0x5722cb[_0x7552('0x2f')]['filter']+'%'};return _0x129d4c;}})});}_0x2d2855=_[_0x7552('0x3a')]({},_0x2d2855,_0x5722cb[_0x7552('0x3c')]);var _0x5d3e96={'where':_0x2d2855[_0x7552('0x39')]};return db[_0x7552('0x28')]['count'](_0x5d3e96)[_0x7552('0x23')](function(_0x2275cf){_0xe0e640[_0x7552('0x1c')]=_0x2275cf;if(_0x5722cb['query'][_0x7552('0x3d')]){_0x2d2855[_0x7552('0x3e')]=[{'all':!![]}];}return db[_0x7552('0x28')][_0x7552('0x3f')](_0x2d2855);})[_0x7552('0x23')](function(_0x2228ed){_0xe0e640['rows']=_0x2228ed;return _0xe0e640;})[_0x7552('0x23')](respondWithFilteredResult(_0x4602a8,_0x2d2855))[_0x7552('0x40')](handleError(_0x4602a8,null));};exports[_0x7552('0x41')]=function(_0x5c61b9,_0x2e969d){var _0x52db88={'raw':!![],'where':{'id':_0x5c61b9[_0x7552('0x42')]['id']}},_0x5e09a5={};_0x5e09a5['model']=_[_0x7552('0x2e')](db[_0x7552('0x28')][_0x7552('0x29')]);_0x5e09a5['query']=_[_0x7552('0x2e')](_0x5c61b9['query']);_0x5e09a5[_0x7552('0x30')]=_[_0x7552('0x31')](_0x5e09a5[_0x7552('0x2c')],_0x5e09a5['query']);_0x52db88[_0x7552('0x32')]=_[_0x7552('0x31')](_0x5e09a5[_0x7552('0x2c')],qs[_0x7552('0x33')](_0x5c61b9['query']['fields']));_0x52db88[_0x7552('0x32')]=_0x52db88['attributes'][_0x7552('0x34')]?_0x52db88[_0x7552('0x32')]:_0x5e09a5[_0x7552('0x2c')];if(_0x5c61b9[_0x7552('0x2f')][_0x7552('0x3d')]){_0x52db88[_0x7552('0x3e')]=[{'all':!![]}];}_0x52db88=_[_0x7552('0x3a')]({},_0x52db88,_0x5c61b9['options']);return db[_0x7552('0x28')]['find'](_0x52db88)['then'](handleEntityNotFound(_0x2e969d,null))[_0x7552('0x23')](respondWithResult(_0x2e969d,null))[_0x7552('0x40')](handleError(_0x2e969d,null));};exports['create']=function(_0x266867,_0x387030){return db[_0x7552('0x28')][_0x7552('0x43')](_0x266867[_0x7552('0x44')],{})[_0x7552('0x23')](respondWithResult(_0x387030,0xc9))[_0x7552('0x40')](handleError(_0x387030,null));};exports['update']=function(_0x51f536,_0x13b51f){if(_0x51f536['body']['id']){delete _0x51f536[_0x7552('0x44')]['id'];}return db[_0x7552('0x28')][_0x7552('0x45')]({'where':{'id':_0x51f536[_0x7552('0x42')]['id']}})[_0x7552('0x23')](handleEntityNotFound(_0x13b51f,null))[_0x7552('0x23')](saveUpdates(_0x51f536[_0x7552('0x44')],null))[_0x7552('0x23')](respondWithResult(_0x13b51f,null))[_0x7552('0x40')](handleError(_0x13b51f,null));};exports[_0x7552('0x24')]=function(_0x4ff675,_0x24ee3a){return db[_0x7552('0x28')][_0x7552('0x45')]({'where':{'id':_0x4ff675[_0x7552('0x42')]['id']}})[_0x7552('0x23')](handleEntityNotFound(_0x24ee3a,null))['then'](removeEntity(_0x24ee3a,null))['catch'](handleError(_0x24ee3a,null));};exports[_0x7552('0x46')]=function(_0x255e4d,_0x54b9ce){return db[_0x7552('0x28')][_0x7552('0x46')]()[_0x7552('0x23')](respondWithResult(_0x54b9ce,null))[_0x7552('0x40')](handleError(_0x54b9ce,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index ddb9ff3..799d7b9 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 _0x02e9=['exports','JscriptyQuestionReport','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptyQuestionReport.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x02e9,0xde));var _0x902e=function(_0x7694f1,_0x5c6983){_0x7694f1=_0x7694f1-0x0;var _0x49edb8=_0x02e9[_0x7694f1];return _0x49edb8;};'use strict';var _=require(_0x902e('0x0'));var util=require('util');var logger=require(_0x902e('0x1'))(_0x902e('0x2'));var moment=require(_0x902e('0x3'));var BPromise=require(_0x902e('0x4'));var rp=require(_0x902e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x902e('0x6'));var config=require('../../config/environment');var attributes=require(_0x902e('0x7'));module[_0x902e('0x8')]=function(_0x2c7194,_0x41c882){return _0x2c7194['define'](_0x902e('0x9'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x68d7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api'];(function(_0x111c8f,_0xc1d071){var _0x201c80=function(_0x3dab64){while(--_0x3dab64){_0x111c8f['push'](_0x111c8f['shift']());}};_0x201c80(++_0xc1d071);}(_0x68d7,0x169));var _0x768d=function(_0x36c4cb,_0xa7dc8e){_0x36c4cb=_0x36c4cb-0x0;var _0x7ad6ab=_0x68d7[_0x36c4cb];return _0x7ad6ab;};'use strict';var _=require(_0x768d('0x0'));var util=require('util');var logger=require(_0x768d('0x1'))(_0x768d('0x2'));var moment=require(_0x768d('0x3'));var BPromise=require(_0x768d('0x4'));var rp=require(_0x768d('0x5'));var fs=require('fs');var path=require(_0x768d('0x6'));var rimraf=require(_0x768d('0x7'));var config=require(_0x768d('0x8'));var attributes=require(_0x768d('0x9'));module['exports']=function(_0x5690c2,_0x1fb2db){return _0x5690c2[_0x768d('0xa')](_0x768d('0xb'),attributes,{'tableName':_0x768d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index e2ad2bd..5ec4460 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 _0x34c4=['request\x20sent','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x50cc89,_0x5cef49){var _0x449d06=function(_0x407663){while(--_0x407663){_0x50cc89['push'](_0x50cc89['shift']());}};_0x449d06(++_0x5cef49);}(_0x34c4,0x146));var _0x434c=function(_0x324b37,_0x7df30a){_0x324b37=_0x324b37-0x0;var _0x16d109=_0x34c4[_0x324b37];return _0x16d109;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x434c('0x0'));var rs=require(_0x434c('0x1'));var fs=require('fs');var Redis=require(_0x434c('0x2'));var db=require(_0x434c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x434c('0x4'));var config=require(_0x434c('0x5'));var jayson=require(_0x434c('0x6'));var client=jayson['client'][_0x434c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11fa82,_0x5958d6,_0x3484f3){return new BPromise(function(_0x396d12,_0x1ffef5){return client[_0x434c('0x8')](_0x11fa82,_0x3484f3)[_0x434c('0x9')](function(_0x140fc7){logger[_0x434c('0xa')](_0x434c('0xb'),_0x5958d6,'request\x20sent');logger[_0x434c('0xc')](_0x434c('0xd'),_0x5958d6,_0x434c('0xe'),JSON['stringify'](_0x140fc7));if(_0x140fc7[_0x434c('0xf')]){if(_0x140fc7[_0x434c('0xf')][_0x434c('0x10')]===0x1f4){logger[_0x434c('0xf')](_0x434c('0xb'),_0x5958d6,_0x140fc7[_0x434c('0xf')][_0x434c('0x11')]);return _0x1ffef5(_0x140fc7[_0x434c('0xf')][_0x434c('0x11')]);}logger[_0x434c('0xf')](_0x434c('0xb'),_0x5958d6,_0x140fc7[_0x434c('0xf')]['message']);return _0x396d12(_0x140fc7[_0x434c('0xf')][_0x434c('0x11')]);}else{logger[_0x434c('0xa')](_0x434c('0xb'),_0x5958d6,_0x434c('0xe'));_0x396d12(_0x140fc7[_0x434c('0x12')][_0x434c('0x11')]);}})[_0x434c('0x13')](function(_0x54e2a3){logger[_0x434c('0xf')](_0x434c('0xb'),_0x5958d6,_0x54e2a3);_0x1ffef5(_0x54e2a3);});});} \ No newline at end of file +var _0x29db=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash'];(function(_0x24dcaf,_0x2904be){var _0xce66c1=function(_0x361e3c){while(--_0x361e3c){_0x24dcaf['push'](_0x24dcaf['shift']());}};_0xce66c1(++_0x2904be);}(_0x29db,0x1a8));var _0xb29d=function(_0x10dd34,_0xfc7bca){_0x10dd34=_0x10dd34-0x0;var _0x4cc8f7=_0x29db[_0x10dd34];return _0x4cc8f7;};'use strict';var _=require(_0xb29d('0x0'));var util=require(_0xb29d('0x1'));var moment=require(_0xb29d('0x2'));var BPromise=require(_0xb29d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb29d('0x4'));var db=require(_0xb29d('0x5'))['db'];var utils=require(_0xb29d('0x6'));var logger=require(_0xb29d('0x7'))(_0xb29d('0x8'));var config=require(_0xb29d('0x9'));var jayson=require(_0xb29d('0xa'));var client=jayson[_0xb29d('0xb')][_0xb29d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x379409,_0x4c3cf7,_0x2a1a83){return new BPromise(function(_0x5cfe76,_0x39e0f7){return client['request'](_0x379409,_0x2a1a83)[_0xb29d('0xd')](function(_0x45061b){logger[_0xb29d('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c3cf7,'request\x20sent');logger[_0xb29d('0xf')](_0xb29d('0x10'),_0x4c3cf7,_0xb29d('0x11'),JSON[_0xb29d('0x12')](_0x45061b));if(_0x45061b['error']){if(_0x45061b[_0xb29d('0x13')][_0xb29d('0x14')]===0x1f4){logger[_0xb29d('0x13')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c3cf7,_0x45061b[_0xb29d('0x13')]['message']);return _0x39e0f7(_0x45061b[_0xb29d('0x13')][_0xb29d('0x15')]);}logger[_0xb29d('0x13')](_0xb29d('0x16'),_0x4c3cf7,_0x45061b[_0xb29d('0x13')][_0xb29d('0x15')]);return _0x5cfe76(_0x45061b[_0xb29d('0x13')]['message']);}else{logger['info']('JscriptyQuestionReport,\x20%s,\x20%s',_0x4c3cf7,_0xb29d('0x11'));_0x5cfe76(_0x45061b[_0xb29d('0x17')][_0xb29d('0x15')]);}})[_0xb29d('0x18')](function(_0x5b05b6){logger[_0xb29d('0x13')](_0xb29d('0x16'),_0x4c3cf7,_0x5b05b6);_0x39e0f7(_0x5b05b6);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 61e144d..62918b8 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 _0xc6ab=['/describe','describe','show','getQuestions','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0xc6ab,0x96));var _0xbc6a=function(_0x1b0d72,_0x36a6c2){_0x1b0d72=_0x1b0d72-0x0;var _0x5db38b=_0xc6ab[_0x1b0d72];return _0x5db38b;};'use strict';var multer=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var path=require(_0xbc6a('0x2'));var timeout=require(_0xbc6a('0x3'));var express=require(_0xbc6a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbc6a('0x5'));var config=require(_0xbc6a('0x6'));var controller=require(_0xbc6a('0x7'));router[_0xbc6a('0x8')]('/',auth[_0xbc6a('0x9')](),controller['index']);router[_0xbc6a('0x8')](_0xbc6a('0xa'),auth[_0xbc6a('0x9')](),controller[_0xbc6a('0xb')]);router[_0xbc6a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbc6a('0xc')]);router[_0xbc6a('0x8')]('/:id/questions',auth['isAuthenticated'](),controller[_0xbc6a('0xd')]);router[_0xbc6a('0xe')]('/',auth['isAuthenticated'](),controller[_0xbc6a('0xf')]);router[_0xbc6a('0x10')](_0xbc6a('0x11'),auth['isAuthenticated'](),controller[_0xbc6a('0x12')]);router[_0xbc6a('0x13')](_0xbc6a('0x11'),auth[_0xbc6a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8b7c=['delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','post','update'];(function(_0x8047e1,_0x254e3e){var _0x45910b=function(_0x1ecd7f){while(--_0x1ecd7f){_0x8047e1['push'](_0x8047e1['shift']());}};_0x45910b(++_0x254e3e);}(_0x8b7c,0x119));var _0xc8b7=function(_0x3b0e76,_0x239221){_0x3b0e76=_0x3b0e76-0x0;var _0x1e4af4=_0x8b7c[_0x3b0e76];return _0x1e4af4;};'use strict';var multer=require(_0xc8b7('0x0'));var util=require(_0xc8b7('0x1'));var path=require(_0xc8b7('0x2'));var timeout=require(_0xc8b7('0x3'));var express=require(_0xc8b7('0x4'));var router=express[_0xc8b7('0x5')]();var auth=require(_0xc8b7('0x6'));var interaction=require(_0xc8b7('0x7'));var config=require('../../config/environment');var controller=require(_0xc8b7('0x8'));router[_0xc8b7('0x9')]('/',auth[_0xc8b7('0xa')](),controller['index']);router[_0xc8b7('0x9')](_0xc8b7('0xb'),auth[_0xc8b7('0xa')](),controller[_0xc8b7('0xc')]);router[_0xc8b7('0x9')](_0xc8b7('0xd'),auth['isAuthenticated'](),controller[_0xc8b7('0xe')]);router['get'](_0xc8b7('0xf'),auth[_0xc8b7('0xa')](),controller[_0xc8b7('0x10')]);router[_0xc8b7('0x11')]('/',auth[_0xc8b7('0xa')](),controller['create']);router['put']('/:id',auth[_0xc8b7('0xa')](),controller[_0xc8b7('0x12')]);router[_0xc8b7('0x13')](_0xc8b7('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ee2ca7d..703ffba 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 _0xa117=['setDataValue','starttime','format','DATE','STRING','BOOLEAN','moment','exports'];(function(_0x5989af,_0x325855){var _0x1dc945=function(_0x4e86e4){while(--_0x4e86e4){_0x5989af['push'](_0x5989af['shift']());}};_0x1dc945(++_0x325855);}(_0xa117,0x1b6));var _0x7a11=function(_0x1672df,_0x4cf9f2){_0x1672df=_0x1672df-0x0;var _0x318d1a=_0xa117[_0x1672df];return _0x318d1a;};'use strict';var moment=require(_0x7a11('0x0'));var Sequelize=require('sequelize');module[_0x7a11('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1ee296){this[_0x7a11('0x2')](_0x7a11('0x3'),_0x1ee296);this['setDataValue']('endtime',moment()[_0x7a11('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7a11('0x5')]},'membername':{'type':Sequelize[_0x7a11('0x6')]},'projectname':{'type':Sequelize[_0x7a11('0x6')]},'queue':{'type':Sequelize[_0x7a11('0x6')]},'uniqueid':{'type':Sequelize[_0x7a11('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7a11('0x6')]},'completed':{'type':Sequelize[_0x7a11('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x158c=['BOOLEAN','moment','sequelize','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0x158c,0x14b));var _0xc158=function(_0x310b6d,_0x4ec35a){_0x310b6d=_0x310b6d-0x0;var _0xb37591=_0x158c[_0x310b6d];return _0xb37591;};'use strict';var moment=require(_0xc158('0x0'));var Sequelize=require(_0xc158('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xc158('0x2')],'set':function(_0x4b79a9){this[_0xc158('0x3')](_0xc158('0x4'),_0x4b79a9);this[_0xc158('0x3')](_0xc158('0x5'),moment()[_0xc158('0x6')](_0xc158('0x7')));}},'endtime':{'type':Sequelize[_0xc158('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc158('0x8')]},'calleridname':{'type':Sequelize[_0xc158('0x8')]},'calleridnum':{'type':Sequelize[_0xc158('0x8')]},'completed':{'type':Sequelize[_0xc158('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 366d528..41de76c 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 _0xbdc1=['rawAttributes','fieldName','type','key','model','name','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','map','JscriptySessionReport'];(function(_0x41d489,_0x4b9925){var _0x45d24d=function(_0x41a657){while(--_0x41a657){_0x41d489['push'](_0x41d489['shift']());}};_0x45d24d(++_0x4b9925);}(_0xbdc1,0x11f));var _0x1bdc=function(_0x5d8817,_0x2e371e){_0x5d8817=_0x5d8817-0x0;var _0xfc63e0=_0xbdc1[_0x5d8817];return _0xfc63e0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1bdc('0x0'));var rimraf=require(_0x1bdc('0x1'));var zipdir=require(_0x1bdc('0x2'));var jsonpatch=require(_0x1bdc('0x3'));var rp=require(_0x1bdc('0x4'));var moment=require(_0x1bdc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bdc('0x6'));var util=require(_0x1bdc('0x7'));var path=require('path');var sox=require(_0x1bdc('0x8'));var csv=require(_0x1bdc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1bdc('0xa'));var squel=require(_0x1bdc('0xb'));var crypto=require(_0x1bdc('0xc'));var jsforce=require(_0x1bdc('0xd'));var deskjs=require(_0x1bdc('0xe'));var toCsv=require(_0x1bdc('0x9'));var querystring=require(_0x1bdc('0xf'));var Papa=require(_0x1bdc('0x10'));var Redis=require(_0x1bdc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1bdc('0x12'));var as=require(_0x1bdc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bdc('0x14'))(_0x1bdc('0x15'));var utils=require(_0x1bdc('0x16'));var config=require(_0x1bdc('0x17'));var db=require(_0x1bdc('0x18'))['db'];function respondWithStatusCode(_0x8a88cc,_0x51cbad){_0x51cbad=_0x51cbad||0xcc;return function(_0x435dfb){if(_0x435dfb){return _0x8a88cc[_0x1bdc('0x19')](_0x51cbad);}return _0x8a88cc[_0x1bdc('0x1a')](_0x51cbad)['end']();};}function respondWithResult(_0x41e039,_0x1ae30e){_0x1ae30e=_0x1ae30e||0xc8;return function(_0x3ad7b8){if(_0x3ad7b8){return _0x41e039[_0x1bdc('0x1a')](_0x1ae30e)[_0x1bdc('0x1b')](_0x3ad7b8);}};}function respondWithFilteredResult(_0x1645c7,_0x5c6a7c){return function(_0x1a0472){if(_0x1a0472){var _0x413200=_0x1a0472[_0x1bdc('0x1c')],_0x579508=_0x5c6a7c[_0x1bdc('0x1d')],_0x4cfe9f=_0x5c6a7c[_0x1bdc('0x1d')]+_0x5c6a7c[_0x1bdc('0x1e')],_0x2afb13;if(_0x4cfe9f>=_0x413200){_0x4cfe9f=_0x413200;_0x2afb13=0xc8;}else{_0x2afb13=0xce;}_0x1645c7['status'](_0x2afb13);return _0x1645c7[_0x1bdc('0x1f')](_0x1bdc('0x20'),_0x579508+'-'+_0x4cfe9f+'/'+_0x413200)['json'](_0x1a0472);}return null;};}function patchUpdates(_0x3a7fff){return function(_0x29acaf){try{jsonpatch[_0x1bdc('0x21')](_0x29acaf,_0x3a7fff,!![]);}catch(_0x9d04e){return BPromise[_0x1bdc('0x22')](_0x9d04e);}return _0x29acaf[_0x1bdc('0x23')]();};}function saveUpdates(_0x314163,_0x4f907c){return function(_0xaa6f74){if(_0xaa6f74){return _0xaa6f74[_0x1bdc('0x24')](_0x314163)['then'](function(_0x189a8c){return _0x189a8c;});}return null;};}function removeEntity(_0x3ab560,_0x1f0742){return function(_0x21c143){if(_0x21c143){return _0x21c143['destroy']()[_0x1bdc('0x25')](function(){_0x3ab560[_0x1bdc('0x1a')](0xcc)[_0x1bdc('0x26')]();});}};}function handleEntityNotFound(_0x3ceaf0,_0x1671a1){return function(_0x46a743){if(!_0x46a743){_0x3ceaf0['sendStatus'](0x194);}return _0x46a743;};}function handleError(_0x29eda7,_0x16a727){_0x16a727=_0x16a727||0x1f4;return function(_0x20312e){logger[_0x1bdc('0x27')](_0x20312e[_0x1bdc('0x28')]);if(_0x20312e['name']){delete _0x20312e['name'];}_0x29eda7[_0x1bdc('0x1a')](_0x16a727)[_0x1bdc('0x29')](_0x20312e);};}exports[_0x1bdc('0x2a')]=function(_0x2bd39c,_0x4ef882){var _0x488bcb={},_0x10aaa9={},_0x4cf0ab={'count':0x0,'rows':[]};var _0x3889d3=_[_0x1bdc('0x2b')](db[_0x1bdc('0x2c')][_0x1bdc('0x2d')],function(_0x502b79){return{'name':_0x502b79[_0x1bdc('0x2e')],'type':_0x502b79[_0x1bdc('0x2f')][_0x1bdc('0x30')]};});_0x10aaa9[_0x1bdc('0x31')]=_[_0x1bdc('0x2b')](_0x3889d3,_0x1bdc('0x32'));_0x10aaa9['query']=_[_0x1bdc('0x33')](_0x2bd39c['query']);_0x10aaa9['filters']=_[_0x1bdc('0x34')](_0x10aaa9[_0x1bdc('0x31')],_0x10aaa9['query']);_0x488bcb[_0x1bdc('0x35')]=_['intersection'](_0x10aaa9['model'],qs[_0x1bdc('0x36')](_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x36')]));_0x488bcb[_0x1bdc('0x35')]=_0x488bcb[_0x1bdc('0x35')][_0x1bdc('0x38')]?_0x488bcb[_0x1bdc('0x35')]:_0x10aaa9[_0x1bdc('0x31')];if(!_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x39')](_0x1bdc('0x3a'))){_0x488bcb['limit']=qs[_0x1bdc('0x1e')](_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x1e')]);_0x488bcb[_0x1bdc('0x1d')]=qs[_0x1bdc('0x1d')](_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x1d')]);}_0x488bcb[_0x1bdc('0x3b')]=qs[_0x1bdc('0x3c')](_0x2bd39c[_0x1bdc('0x37')]['sort']);_0x488bcb['where']=qs['filters'](_[_0x1bdc('0x3d')](_0x2bd39c['query'],_0x10aaa9[_0x1bdc('0x3e')]));if(_0x2bd39c['query'][_0x1bdc('0x3f')]){_0x488bcb[_0x1bdc('0x40')]=_['merge'](_0x488bcb[_0x1bdc('0x40')],{'$or':_[_0x1bdc('0x2b')](_0x3889d3,function(_0x30e1e7){if(_0x30e1e7[_0x1bdc('0x2f')]!==_0x1bdc('0x41')){var _0x237437={};_0x237437[_0x30e1e7[_0x1bdc('0x32')]]={'$like':'%'+_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x3f')]+'%'};return _0x237437;}})});}_0x488bcb=_[_0x1bdc('0x42')]({},_0x488bcb,_0x2bd39c[_0x1bdc('0x43')]);var _0x20b1e8={'where':_0x488bcb['where']};return db[_0x1bdc('0x2c')][_0x1bdc('0x1c')](_0x20b1e8)[_0x1bdc('0x25')](function(_0x39c00b){_0x4cf0ab[_0x1bdc('0x1c')]=_0x39c00b;if(_0x2bd39c['query']['includeAll']){_0x488bcb[_0x1bdc('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x1bdc('0x45')](_0x488bcb);})[_0x1bdc('0x25')](function(_0x24350e){_0x4cf0ab[_0x1bdc('0x46')]=_0x24350e;return _0x4cf0ab;})[_0x1bdc('0x25')](respondWithFilteredResult(_0x4ef882,_0x488bcb))[_0x1bdc('0x47')](handleError(_0x4ef882,null));};exports[_0x1bdc('0x48')]=function(_0x2a3ce9,_0x4adf93){var _0x341366={'raw':!![],'where':{'id':_0x2a3ce9['params']['id']}},_0x3e98b5={};_0x3e98b5[_0x1bdc('0x31')]=_[_0x1bdc('0x33')](db['JscriptySessionReport']['rawAttributes']);_0x3e98b5[_0x1bdc('0x37')]=_[_0x1bdc('0x33')](_0x2a3ce9[_0x1bdc('0x37')]);_0x3e98b5[_0x1bdc('0x3e')]=_[_0x1bdc('0x34')](_0x3e98b5[_0x1bdc('0x31')],_0x3e98b5['query']);_0x341366[_0x1bdc('0x35')]=_['intersection'](_0x3e98b5[_0x1bdc('0x31')],qs[_0x1bdc('0x36')](_0x2a3ce9['query'][_0x1bdc('0x36')]));_0x341366[_0x1bdc('0x35')]=_0x341366[_0x1bdc('0x35')][_0x1bdc('0x38')]?_0x341366[_0x1bdc('0x35')]:_0x3e98b5['model'];if(_0x2a3ce9[_0x1bdc('0x37')][_0x1bdc('0x49')]){_0x341366[_0x1bdc('0x44')]=[{'all':!![]}];}_0x341366=_['merge']({},_0x341366,_0x2a3ce9[_0x1bdc('0x43')]);return db['JscriptySessionReport'][_0x1bdc('0x4a')](_0x341366)['then'](handleEntityNotFound(_0x4adf93,null))[_0x1bdc('0x25')](respondWithResult(_0x4adf93,null))[_0x1bdc('0x47')](handleError(_0x4adf93,null));};exports[_0x1bdc('0x4b')]=function(_0x465eeb,_0x258c74){return db[_0x1bdc('0x2c')][_0x1bdc('0x4b')](_0x465eeb[_0x1bdc('0x4c')],{})['then'](respondWithResult(_0x258c74,0xc9))[_0x1bdc('0x47')](handleError(_0x258c74,null));};exports['update']=function(_0x23fa9d,_0x1d7e13){if(_0x23fa9d[_0x1bdc('0x4c')]['id']){delete _0x23fa9d[_0x1bdc('0x4c')]['id'];}return db[_0x1bdc('0x2c')][_0x1bdc('0x4a')]({'where':{'id':_0x23fa9d[_0x1bdc('0x4d')]['id']}})[_0x1bdc('0x25')](handleEntityNotFound(_0x1d7e13,null))[_0x1bdc('0x25')](saveUpdates(_0x23fa9d[_0x1bdc('0x4c')],null))[_0x1bdc('0x25')](respondWithResult(_0x1d7e13,null))[_0x1bdc('0x47')](handleError(_0x1d7e13,null));};exports[_0x1bdc('0x4e')]=function(_0x50fd72,_0x34349f){return db[_0x1bdc('0x2c')][_0x1bdc('0x4a')]({'where':{'id':_0x50fd72[_0x1bdc('0x4d')]['id']}})[_0x1bdc('0x25')](handleEntityNotFound(_0x34349f,null))[_0x1bdc('0x25')](removeEntity(_0x34349f,null))[_0x1bdc('0x47')](handleError(_0x34349f,null));};exports[_0x1bdc('0x4f')]=function(_0x4ec5c0,_0x1fb847){return db['JscriptySessionReport'][_0x1bdc('0x4f')]()['then'](respondWithResult(_0x1fb847,null))[_0x1bdc('0x47')](handleError(_0x1fb847,null));};exports[_0x1bdc('0x50')]=function(_0x2f1077,_0x5368c3,_0x3eace9){var _0x1bdd17={'raw':!![],'where':{}};var _0x3c3c3e={};var _0x1dda5f={'count':0x0,'rows':[]};return db[_0x1bdc('0x2c')][_0x1bdc('0x51')]({'where':{'id':_0x2f1077[_0x1bdc('0x4d')]['id']}})[_0x1bdc('0x25')](handleEntityNotFound(_0x5368c3,null))[_0x1bdc('0x25')](function(_0x27164a){if(_0x27164a){_0x3c3c3e[_0x1bdc('0x31')]=_[_0x1bdc('0x33')](db[_0x1bdc('0x52')]['rawAttributes']);_0x3c3c3e['query']=_['keys'](_0x2f1077[_0x1bdc('0x37')]);_0x3c3c3e[_0x1bdc('0x3e')]=_[_0x1bdc('0x34')](_0x3c3c3e[_0x1bdc('0x31')],_0x3c3c3e['query']);_0x1bdd17[_0x1bdc('0x35')]=_['intersection'](_0x3c3c3e['model'],qs[_0x1bdc('0x36')](_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x36')]));_0x1bdd17[_0x1bdc('0x35')]=_0x1bdd17[_0x1bdc('0x35')][_0x1bdc('0x38')]?_0x1bdd17['attributes']:_0x3c3c3e[_0x1bdc('0x31')];if(!_0x2f1077[_0x1bdc('0x37')]['hasOwnProperty'](_0x1bdc('0x3a'))){_0x1bdd17[_0x1bdc('0x1e')]=qs[_0x1bdc('0x1e')](_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x1e')]);_0x1bdd17[_0x1bdc('0x1d')]=qs['offset'](_0x2f1077[_0x1bdc('0x37')]['offset']);}_0x1bdd17[_0x1bdc('0x3b')]=qs[_0x1bdc('0x3c')](_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x3c')]);_0x1bdd17['where']=qs[_0x1bdc('0x3e')](_['pick'](_0x2f1077[_0x1bdc('0x37')],_0x3c3c3e[_0x1bdc('0x3e')]));_0x1bdd17[_0x1bdc('0x40')]['SessionId']=_0x27164a['id'];if(_0x2f1077['query'][_0x1bdc('0x3f')]){_0x1bdd17['where']=_[_0x1bdc('0x42')](_0x1bdd17[_0x1bdc('0x40')],{'$or':_[_0x1bdc('0x2b')](_0x1bdd17['attributes'],function(_0x457ee1){var _0x45a6c8={};_0x45a6c8[_0x457ee1]={'$like':'%'+_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x3f')]+'%'};return _0x45a6c8;})});}_0x1bdd17=_[_0x1bdc('0x42')]({},_0x1bdd17,_0x2f1077['options']);return db[_0x1bdc('0x52')][_0x1bdc('0x1c')]({'where':_0x1bdd17[_0x1bdc('0x40')]})[_0x1bdc('0x25')](function(_0xbd652d){_0x1dda5f[_0x1bdc('0x1c')]=_0xbd652d;if(_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x49')]){_0x1bdd17['include']=[{'all':!![]}];}return db[_0x1bdc('0x52')][_0x1bdc('0x45')](_0x1bdd17);})[_0x1bdc('0x25')](function(_0x5de0ed){_0x1dda5f[_0x1bdc('0x46')]=_0x5de0ed;return _0x1dda5f;});}})[_0x1bdc('0x25')](respondWithFilteredResult(_0x5368c3,_0x1bdd17))[_0x1bdc('0x47')](handleError(_0x5368c3,null));}; \ No newline at end of file +var _0x1594=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','status','reject','update','destroy','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','show','params','find','catch','create','body','describe','getQuestions','findOne','nolimit','SessionId','include','JscriptyQuestionReport','html-pdf','eml-format'];(function(_0x46e3e6,_0x361f4a){var _0x567574=function(_0x54a1e5){while(--_0x54a1e5){_0x46e3e6['push'](_0x46e3e6['shift']());}};_0x567574(++_0x361f4a);}(_0x1594,0x1d2));var _0x4159=function(_0x28eaf3,_0x5d818f){_0x28eaf3=_0x28eaf3-0x0;var _0x101410=_0x1594[_0x28eaf3];return _0x101410;};'use strict';var pdf=require(_0x4159('0x0'));var emlformat=require(_0x4159('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4159('0x2'));var jsonpatch=require(_0x4159('0x3'));var rp=require(_0x4159('0x4'));var moment=require(_0x4159('0x5'));var BPromise=require(_0x4159('0x6'));var Mustache=require(_0x4159('0x7'));var util=require('util');var path=require(_0x4159('0x8'));var sox=require(_0x4159('0x9'));var csv=require(_0x4159('0xa'));var ejs=require(_0x4159('0xb'));var fs=require('fs');var _=require(_0x4159('0xc'));var squel=require(_0x4159('0xd'));var crypto=require('crypto');var jsforce=require(_0x4159('0xe'));var deskjs=require(_0x4159('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4159('0x10'));var Redis=require(_0x4159('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4159('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4159('0x13'));var logger=require(_0x4159('0x14'))(_0x4159('0x15'));var utils=require(_0x4159('0x16'));var config=require(_0x4159('0x17'));var db=require(_0x4159('0x18'))['db'];function respondWithStatusCode(_0x550be3,_0x227ce8){_0x227ce8=_0x227ce8||0xcc;return function(_0x31ef52){if(_0x31ef52){return _0x550be3[_0x4159('0x19')](_0x227ce8);}return _0x550be3['status'](_0x227ce8)[_0x4159('0x1a')]();};}function respondWithResult(_0x4419f0,_0x1698f0){_0x1698f0=_0x1698f0||0xc8;return function(_0x41a1df){if(_0x41a1df){return _0x4419f0['status'](_0x1698f0)[_0x4159('0x1b')](_0x41a1df);}};}function respondWithFilteredResult(_0x3707ec,_0x269a28){return function(_0x4418ab){if(_0x4418ab){var _0x59367=_0x4418ab['count'],_0xb9fb3a=_0x269a28[_0x4159('0x1c')],_0x2ceb4a=_0x269a28['offset']+_0x269a28['limit'],_0x7c3a3;if(_0x2ceb4a>=_0x59367){_0x2ceb4a=_0x59367;_0x7c3a3=0xc8;}else{_0x7c3a3=0xce;}_0x3707ec[_0x4159('0x1d')](_0x7c3a3);return _0x3707ec['set']('Content-Range',_0xb9fb3a+'-'+_0x2ceb4a+'/'+_0x59367)[_0x4159('0x1b')](_0x4418ab);}return null;};}function patchUpdates(_0x556c4f){return function(_0x1eef49){try{jsonpatch['apply'](_0x1eef49,_0x556c4f,!![]);}catch(_0x237374){return BPromise[_0x4159('0x1e')](_0x237374);}return _0x1eef49['save']();};}function saveUpdates(_0x117bd0,_0x4ed507){return function(_0x1739be){if(_0x1739be){return _0x1739be[_0x4159('0x1f')](_0x117bd0)['then'](function(_0xc5941b){return _0xc5941b;});}return null;};}function removeEntity(_0x1ac2bd,_0x3d1641){return function(_0x2758fa){if(_0x2758fa){return _0x2758fa[_0x4159('0x20')]()[_0x4159('0x21')](function(){_0x1ac2bd[_0x4159('0x1d')](0xcc)[_0x4159('0x1a')]();});}};}function handleEntityNotFound(_0x5051c1,_0x3faeda){return function(_0x19c852){if(!_0x19c852){_0x5051c1['sendStatus'](0x194);}return _0x19c852;};}function handleError(_0x440f52,_0x5967e9){_0x5967e9=_0x5967e9||0x1f4;return function(_0x28be48){logger[_0x4159('0x22')](_0x28be48[_0x4159('0x23')]);if(_0x28be48[_0x4159('0x24')]){delete _0x28be48[_0x4159('0x24')];}_0x440f52['status'](_0x5967e9)[_0x4159('0x25')](_0x28be48);};}exports[_0x4159('0x26')]=function(_0x421cbe,_0x97169f){var _0x353607={},_0x45dbbe={},_0x10fe17={'count':0x0,'rows':[]};var _0xcc8f2a=_[_0x4159('0x27')](db[_0x4159('0x28')][_0x4159('0x29')],function(_0x3bcdec){return{'name':_0x3bcdec[_0x4159('0x2a')],'type':_0x3bcdec[_0x4159('0x2b')]['key']};});_0x45dbbe['model']=_[_0x4159('0x27')](_0xcc8f2a,_0x4159('0x24'));_0x45dbbe[_0x4159('0x2c')]=_[_0x4159('0x2d')](_0x421cbe[_0x4159('0x2c')]);_0x45dbbe[_0x4159('0x2e')]=_[_0x4159('0x2f')](_0x45dbbe[_0x4159('0x30')],_0x45dbbe[_0x4159('0x2c')]);_0x353607['attributes']=_[_0x4159('0x2f')](_0x45dbbe[_0x4159('0x30')],qs[_0x4159('0x31')](_0x421cbe['query'][_0x4159('0x31')]));_0x353607[_0x4159('0x32')]=_0x353607[_0x4159('0x32')][_0x4159('0x33')]?_0x353607[_0x4159('0x32')]:_0x45dbbe[_0x4159('0x30')];if(!_0x421cbe['query'][_0x4159('0x34')]('nolimit')){_0x353607[_0x4159('0x35')]=qs['limit'](_0x421cbe[_0x4159('0x2c')][_0x4159('0x35')]);_0x353607[_0x4159('0x1c')]=qs[_0x4159('0x1c')](_0x421cbe[_0x4159('0x2c')][_0x4159('0x1c')]);}_0x353607[_0x4159('0x36')]=qs[_0x4159('0x37')](_0x421cbe[_0x4159('0x2c')][_0x4159('0x37')]);_0x353607[_0x4159('0x38')]=qs[_0x4159('0x2e')](_[_0x4159('0x39')](_0x421cbe['query'],_0x45dbbe[_0x4159('0x2e')]));if(_0x421cbe[_0x4159('0x2c')][_0x4159('0x3a')]){_0x353607['where']=_[_0x4159('0x3b')](_0x353607['where'],{'$or':_[_0x4159('0x27')](_0xcc8f2a,function(_0x327478){if(_0x327478['type']!==_0x4159('0x3c')){var _0x401183={};_0x401183[_0x327478['name']]={'$like':'%'+_0x421cbe[_0x4159('0x2c')]['filter']+'%'};return _0x401183;}})});}_0x353607=_['merge']({},_0x353607,_0x421cbe[_0x4159('0x3d')]);var _0x2b187f={'where':_0x353607[_0x4159('0x38')]};return db[_0x4159('0x28')][_0x4159('0x3e')](_0x2b187f)[_0x4159('0x21')](function(_0x54a3d2){_0x10fe17[_0x4159('0x3e')]=_0x54a3d2;if(_0x421cbe['query'][_0x4159('0x3f')]){_0x353607['include']=[{'all':!![]}];}return db[_0x4159('0x28')]['findAll'](_0x353607);})[_0x4159('0x21')](function(_0x264faf){_0x10fe17[_0x4159('0x40')]=_0x264faf;return _0x10fe17;})[_0x4159('0x21')](respondWithFilteredResult(_0x97169f,_0x353607))['catch'](handleError(_0x97169f,null));};exports[_0x4159('0x41')]=function(_0x2a039a,_0x75ef25){var _0x1d56f9={'raw':!![],'where':{'id':_0x2a039a[_0x4159('0x42')]['id']}},_0x244238={};_0x244238[_0x4159('0x30')]=_[_0x4159('0x2d')](db[_0x4159('0x28')][_0x4159('0x29')]);_0x244238[_0x4159('0x2c')]=_[_0x4159('0x2d')](_0x2a039a['query']);_0x244238[_0x4159('0x2e')]=_['intersection'](_0x244238['model'],_0x244238[_0x4159('0x2c')]);_0x1d56f9[_0x4159('0x32')]=_['intersection'](_0x244238[_0x4159('0x30')],qs['fields'](_0x2a039a[_0x4159('0x2c')]['fields']));_0x1d56f9[_0x4159('0x32')]=_0x1d56f9[_0x4159('0x32')][_0x4159('0x33')]?_0x1d56f9[_0x4159('0x32')]:_0x244238[_0x4159('0x30')];if(_0x2a039a[_0x4159('0x2c')][_0x4159('0x3f')]){_0x1d56f9['include']=[{'all':!![]}];}_0x1d56f9=_['merge']({},_0x1d56f9,_0x2a039a[_0x4159('0x3d')]);return db['JscriptySessionReport'][_0x4159('0x43')](_0x1d56f9)[_0x4159('0x21')](handleEntityNotFound(_0x75ef25,null))[_0x4159('0x21')](respondWithResult(_0x75ef25,null))[_0x4159('0x44')](handleError(_0x75ef25,null));};exports[_0x4159('0x45')]=function(_0x523af,_0x49b198){return db['JscriptySessionReport'][_0x4159('0x45')](_0x523af['body'],{})[_0x4159('0x21')](respondWithResult(_0x49b198,0xc9))[_0x4159('0x44')](handleError(_0x49b198,null));};exports[_0x4159('0x1f')]=function(_0x1eebe1,_0x183a19){if(_0x1eebe1[_0x4159('0x46')]['id']){delete _0x1eebe1['body']['id'];}return db[_0x4159('0x28')][_0x4159('0x43')]({'where':{'id':_0x1eebe1[_0x4159('0x42')]['id']}})[_0x4159('0x21')](handleEntityNotFound(_0x183a19,null))[_0x4159('0x21')](saveUpdates(_0x1eebe1[_0x4159('0x46')],null))[_0x4159('0x21')](respondWithResult(_0x183a19,null))[_0x4159('0x44')](handleError(_0x183a19,null));};exports['destroy']=function(_0x5b9225,_0x2b8eff){return db[_0x4159('0x28')][_0x4159('0x43')]({'where':{'id':_0x5b9225[_0x4159('0x42')]['id']}})[_0x4159('0x21')](handleEntityNotFound(_0x2b8eff,null))[_0x4159('0x21')](removeEntity(_0x2b8eff,null))['catch'](handleError(_0x2b8eff,null));};exports[_0x4159('0x47')]=function(_0x49371e,_0x27b320){return db[_0x4159('0x28')][_0x4159('0x47')]()[_0x4159('0x21')](respondWithResult(_0x27b320,null))['catch'](handleError(_0x27b320,null));};exports[_0x4159('0x48')]=function(_0x497fd4,_0x281731,_0x2e4476){var _0x347a29={'raw':!![],'where':{}};var _0x4f42a6={};var _0x2d2dea={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x4159('0x49')]({'where':{'id':_0x497fd4['params']['id']}})[_0x4159('0x21')](handleEntityNotFound(_0x281731,null))[_0x4159('0x21')](function(_0x5bf8b7){if(_0x5bf8b7){_0x4f42a6[_0x4159('0x30')]=_[_0x4159('0x2d')](db['JscriptyQuestionReport'][_0x4159('0x29')]);_0x4f42a6[_0x4159('0x2c')]=_[_0x4159('0x2d')](_0x497fd4[_0x4159('0x2c')]);_0x4f42a6[_0x4159('0x2e')]=_[_0x4159('0x2f')](_0x4f42a6[_0x4159('0x30')],_0x4f42a6[_0x4159('0x2c')]);_0x347a29[_0x4159('0x32')]=_['intersection'](_0x4f42a6[_0x4159('0x30')],qs[_0x4159('0x31')](_0x497fd4[_0x4159('0x2c')][_0x4159('0x31')]));_0x347a29[_0x4159('0x32')]=_0x347a29[_0x4159('0x32')]['length']?_0x347a29['attributes']:_0x4f42a6['model'];if(!_0x497fd4[_0x4159('0x2c')][_0x4159('0x34')](_0x4159('0x4a'))){_0x347a29[_0x4159('0x35')]=qs[_0x4159('0x35')](_0x497fd4[_0x4159('0x2c')][_0x4159('0x35')]);_0x347a29[_0x4159('0x1c')]=qs[_0x4159('0x1c')](_0x497fd4[_0x4159('0x2c')]['offset']);}_0x347a29[_0x4159('0x36')]=qs[_0x4159('0x37')](_0x497fd4[_0x4159('0x2c')][_0x4159('0x37')]);_0x347a29['where']=qs['filters'](_[_0x4159('0x39')](_0x497fd4['query'],_0x4f42a6[_0x4159('0x2e')]));_0x347a29['where'][_0x4159('0x4b')]=_0x5bf8b7['id'];if(_0x497fd4[_0x4159('0x2c')][_0x4159('0x3a')]){_0x347a29[_0x4159('0x38')]=_[_0x4159('0x3b')](_0x347a29['where'],{'$or':_[_0x4159('0x27')](_0x347a29[_0x4159('0x32')],function(_0x40230c){var _0x14f190={};_0x14f190[_0x40230c]={'$like':'%'+_0x497fd4[_0x4159('0x2c')][_0x4159('0x3a')]+'%'};return _0x14f190;})});}_0x347a29=_[_0x4159('0x3b')]({},_0x347a29,_0x497fd4[_0x4159('0x3d')]);return db['JscriptyQuestionReport'][_0x4159('0x3e')]({'where':_0x347a29[_0x4159('0x38')]})[_0x4159('0x21')](function(_0x3e0ca0){_0x2d2dea['count']=_0x3e0ca0;if(_0x497fd4[_0x4159('0x2c')][_0x4159('0x3f')]){_0x347a29[_0x4159('0x4c')]=[{'all':!![]}];}return db[_0x4159('0x4d')]['findAll'](_0x347a29);})[_0x4159('0x21')](function(_0x400999){_0x2d2dea['rows']=_0x400999;return _0x2d2dea;});}})[_0x4159('0x21')](respondWithFilteredResult(_0x281731,_0x347a29))[_0x4159('0x44')](handleError(_0x281731,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 2ae7d85..b06dd21 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 _0xac78=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac78,0x19c));var _0x8ac7=function(_0x1921c2,_0x6c99ae){_0x1921c2=_0x1921c2-0x0;var _0x112039=_0xac78[_0x1921c2];return _0x112039;};'use strict';var _=require(_0x8ac7('0x0'));var util=require(_0x8ac7('0x1'));var logger=require(_0x8ac7('0x2'))(_0x8ac7('0x3'));var moment=require(_0x8ac7('0x4'));var BPromise=require(_0x8ac7('0x5'));var rp=require(_0x8ac7('0x6'));var fs=require('fs');var path=require(_0x8ac7('0x7'));var rimraf=require(_0x8ac7('0x8'));var config=require(_0x8ac7('0x9'));var attributes=require(_0x8ac7('0xa'));module[_0x8ac7('0xb')]=function(_0x142992,_0x5c1d24){return _0x142992['define'](_0x8ac7('0xc'),attributes,{'tableName':_0x8ac7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba25=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment'];(function(_0x2fa771,_0x511aec){var _0x8f89c2=function(_0x376db1){while(--_0x376db1){_0x2fa771['push'](_0x2fa771['shift']());}};_0x8f89c2(++_0x511aec);}(_0xba25,0x190));var _0x5ba2=function(_0x50fb0a,_0x1ffe68){_0x50fb0a=_0x50fb0a-0x0;var _0x1b5ed9=_0xba25[_0x50fb0a];return _0x1b5ed9;};'use strict';var _=require(_0x5ba2('0x0'));var util=require(_0x5ba2('0x1'));var logger=require(_0x5ba2('0x2'))(_0x5ba2('0x3'));var moment=require(_0x5ba2('0x4'));var BPromise=require(_0x5ba2('0x5'));var rp=require(_0x5ba2('0x6'));var fs=require('fs');var path=require(_0x5ba2('0x7'));var rimraf=require(_0x5ba2('0x8'));var config=require(_0x5ba2('0x9'));var attributes=require(_0x5ba2('0xa'));module[_0x5ba2('0xb')]=function(_0xf97275,_0xa96495){return _0xf97275[_0x5ba2('0xc')](_0x5ba2('0xd'),attributes,{'tableName':_0x5ba2('0xe'),'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 42b84ee..2229845 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 _0x292b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3e6188,_0xd8d390){var _0x47bfe6=function(_0x317c58){while(--_0x317c58){_0x3e6188['push'](_0x3e6188['shift']());}};_0x47bfe6(++_0xd8d390);}(_0x292b,0x64));var _0xb292=function(_0x1d73ab,_0x4db32c){_0x1d73ab=_0x1d73ab-0x0;var _0x2ed1df=_0x292b[_0x1d73ab];return _0x2ed1df;};'use strict';var _=require(_0xb292('0x0'));var util=require(_0xb292('0x1'));var moment=require(_0xb292('0x2'));var BPromise=require(_0xb292('0x3'));var rs=require(_0xb292('0x4'));var fs=require('fs');var Redis=require(_0xb292('0x5'));var db=require(_0xb292('0x6'))['db'];var utils=require(_0xb292('0x7'));var logger=require(_0xb292('0x8'))(_0xb292('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb292('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x298571,_0xa511d8,_0x47fe8e){return new BPromise(function(_0x43f8b7,_0x253a58){return client['request'](_0x298571,_0x47fe8e)['then'](function(_0x40d2f5){logger[_0xb292('0xb')](_0xb292('0xc'),_0xa511d8,'request\x20sent');logger[_0xb292('0xd')](_0xb292('0xe'),_0xa511d8,_0xb292('0xf'),JSON[_0xb292('0x10')](_0x40d2f5));if(_0x40d2f5['error']){if(_0x40d2f5[_0xb292('0x11')][_0xb292('0x12')]===0x1f4){logger[_0xb292('0x11')](_0xb292('0xc'),_0xa511d8,_0x40d2f5['error'][_0xb292('0x13')]);return _0x253a58(_0x40d2f5[_0xb292('0x11')]['message']);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0xa511d8,_0x40d2f5[_0xb292('0x11')][_0xb292('0x13')]);return _0x43f8b7(_0x40d2f5[_0xb292('0x11')][_0xb292('0x13')]);}else{logger[_0xb292('0xb')](_0xb292('0xc'),_0xa511d8,_0xb292('0xf'));_0x43f8b7(_0x40d2f5['result'][_0xb292('0x13')]);}})[_0xb292('0x14')](function(_0x386443){logger[_0xb292('0x11')](_0xb292('0xc'),_0xa511d8,_0x386443);_0x253a58(_0x386443);});});} \ No newline at end of file +var _0x52ed=['client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x52ed,0x186));var _0xd52e=function(_0xa2c0a3,_0x5bbac0){_0xa2c0a3=_0xa2c0a3-0x0;var _0x52c618=_0x52ed[_0xa2c0a3];return _0x52c618;};'use strict';var _=require(_0xd52e('0x0'));var util=require(_0xd52e('0x1'));var moment=require(_0xd52e('0x2'));var BPromise=require(_0xd52e('0x3'));var rs=require(_0xd52e('0x4'));var fs=require('fs');var Redis=require(_0xd52e('0x5'));var db=require(_0xd52e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd52e('0x7'))(_0xd52e('0x8'));var config=require('../../config/environment');var jayson=require(_0xd52e('0x9'));var client=jayson[_0xd52e('0xa')][_0xd52e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53127d,_0x3cbb39,_0x965bba){return new BPromise(function(_0x5e8436,_0x4b6d52){return client[_0xd52e('0xc')](_0x53127d,_0x965bba)[_0xd52e('0xd')](function(_0x44c263){logger[_0xd52e('0xe')](_0xd52e('0xf'),_0x3cbb39,_0xd52e('0x10'));logger[_0xd52e('0x11')](_0xd52e('0x12'),_0x3cbb39,_0xd52e('0x10'),JSON[_0xd52e('0x13')](_0x44c263));if(_0x44c263[_0xd52e('0x14')]){if(_0x44c263[_0xd52e('0x14')][_0xd52e('0x15')]===0x1f4){logger[_0xd52e('0x14')](_0xd52e('0xf'),_0x3cbb39,_0x44c263[_0xd52e('0x14')][_0xd52e('0x16')]);return _0x4b6d52(_0x44c263[_0xd52e('0x14')][_0xd52e('0x16')]);}logger[_0xd52e('0x14')](_0xd52e('0xf'),_0x3cbb39,_0x44c263[_0xd52e('0x14')][_0xd52e('0x16')]);return _0x5e8436(_0x44c263[_0xd52e('0x14')]['message']);}else{logger['info'](_0xd52e('0xf'),_0x3cbb39,_0xd52e('0x10'));_0x5e8436(_0x44c263[_0xd52e('0x17')][_0xd52e('0x16')]);}})[_0xd52e('0x18')](function(_0x4e8a07){logger['error'](_0xd52e('0xf'),_0x3cbb39,_0x4e8a07);_0x4b6d52(_0x4e8a07);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index fc3698f..09aedf1 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 _0x20ac=['./license.controller','get','put','/:id','update','exports','multer','path','Router'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0x20ac,0x1e3));var _0xc20a=function(_0x3c66e5,_0xab5ea3){_0x3c66e5=_0x3c66e5-0x0;var _0x678a=_0x20ac[_0x3c66e5];return _0x678a;};'use strict';var multer=require(_0xc20a('0x0'));var util=require('util');var path=require(_0xc20a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc20a('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc20a('0x3'));router[_0xc20a('0x4')]('/',controller['index']);router[_0xc20a('0x5')](_0xc20a('0x6'),auth['isAuthenticated'](),controller[_0xc20a('0x7')]);module[_0xc20a('0x8')]=router; \ No newline at end of file +var _0x5d11=['index','put','/:id','isAuthenticated','update','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./license.controller','get'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x5d11,0xa0));var _0x15d1=function(_0x37bf65,_0x220141){_0x37bf65=_0x37bf65-0x0;var _0x45a736=_0x5d11[_0x37bf65];return _0x45a736;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x15d1('0x0'));var timeout=require(_0x15d1('0x1'));var express=require(_0x15d1('0x2'));var router=express[_0x15d1('0x3')]();var auth=require(_0x15d1('0x4'));var interaction=require(_0x15d1('0x5'));var config=require('../../config/environment');var controller=require(_0x15d1('0x6'));router[_0x15d1('0x7')]('/',controller[_0x15d1('0x8')]);router[_0x15d1('0x9')](_0x15d1('0xa'),auth[_0x15d1('0xb')](),controller[_0x15d1('0xc')]);module[_0x15d1('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b518937..6c853e9 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 _0x1261=['exports','TEXT','STRING','INTEGER'];(function(_0x35d99e,_0x30de5f){var _0x5bb6a7=function(_0x567fc2){while(--_0x567fc2){_0x35d99e['push'](_0x35d99e['shift']());}};_0x5bb6a7(++_0x30de5f);}(_0x1261,0x144));var _0x1126=function(_0x58da8a,_0x1fb6ff){_0x58da8a=_0x58da8a-0x0;var _0x5294b9=_0x1261[_0x58da8a];return _0x5294b9;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'license':{'type':Sequelize[_0x1126('0x1')]},'data1':{'type':Sequelize[_0x1126('0x2')]},'data2':{'type':Sequelize[_0x1126('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x1126('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5fab=['exports','STRING','INTEGER','sequelize'];(function(_0x2f8280,_0x623a4e){var _0x3117c2=function(_0x1322ad){while(--_0x1322ad){_0x2f8280['push'](_0x2f8280['shift']());}};_0x3117c2(++_0x623a4e);}(_0x5fab,0x177));var _0xb5fa=function(_0x2c0931,_0x503573){_0x2c0931=_0x2c0931-0x0;var _0x3d781f=_0x5fab[_0x2c0931];return _0x3d781f;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0xb5fa('0x2')]},'data2':{'type':Sequelize[_0xb5fa('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb5fa('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 6cf8d9b..96c5d1f 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 _0xb19a=['sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','apply','reject','update','then','destroy','sendStatus','stack','name','send','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','find','params','get','checkLicense','body','demo','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path'];(function(_0x2327ed,_0x57898b){var _0x47d940=function(_0x308e7b){while(--_0x308e7b){_0x2327ed['push'](_0x2327ed['shift']());}};_0x47d940(++_0x57898b);}(_0xb19a,0x72));var _0xab19=function(_0x397ae6,_0x4923c0){_0x397ae6=_0x397ae6-0x0;var _0x8736a4=_0xb19a[_0x397ae6];return _0x8736a4;};'use strict';var pdf=require(_0xab19('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xab19('0x1'));var zipdir=require(_0xab19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab19('0x3'));var moment=require('moment');var BPromise=require(_0xab19('0x4'));var Mustache=require(_0xab19('0x5'));var util=require(_0xab19('0x6'));var path=require(_0xab19('0x7'));var sox=require(_0xab19('0x8'));var csv=require(_0xab19('0x9'));var ejs=require(_0xab19('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xab19('0xb'));var crypto=require(_0xab19('0xc'));var jsforce=require(_0xab19('0xd'));var deskjs=require(_0xab19('0xe'));var toCsv=require(_0xab19('0x9'));var querystring=require(_0xab19('0xf'));var Papa=require(_0xab19('0x10'));var Redis=require('ioredis');var authService=require(_0xab19('0x11'));var qs=require(_0xab19('0x12'));var as=require(_0xab19('0x13'));var hardwareService=require(_0xab19('0x14'));var logger=require(_0xab19('0x15'))(_0xab19('0x16'));var utils=require(_0xab19('0x17'));var config=require(_0xab19('0x18'));var db=require(_0xab19('0x19'))['db'];function respondWithStatusCode(_0x3df835,_0x318947){_0x318947=_0x318947||0xcc;return function(_0x4d75e5){if(_0x4d75e5){return _0x3df835['sendStatus'](_0x318947);}return _0x3df835[_0xab19('0x1a')](_0x318947)[_0xab19('0x1b')]();};}function respondWithResult(_0x4ec6fe,_0x4d2d1a){_0x4d2d1a=_0x4d2d1a||0xc8;return function(_0xd2c878){if(_0xd2c878){return _0x4ec6fe[_0xab19('0x1a')](_0x4d2d1a)[_0xab19('0x1c')](_0xd2c878);}};}function respondWithFilteredResult(_0x1e2370,_0x3fbe2e){return function(_0x2fcc57){if(_0x2fcc57){var _0x40098f=_0x2fcc57['count'],_0x414a03=_0x3fbe2e[_0xab19('0x1d')],_0xafc421=_0x3fbe2e[_0xab19('0x1d')]+_0x3fbe2e[_0xab19('0x1e')],_0x20046f;if(_0xafc421>=_0x40098f){_0xafc421=_0x40098f;_0x20046f=0xc8;}else{_0x20046f=0xce;}_0x1e2370[_0xab19('0x1a')](_0x20046f);return _0x1e2370[_0xab19('0x1f')]('Content-Range',_0x414a03+'-'+_0xafc421+'/'+_0x40098f)['json'](_0x2fcc57);}return null;};}function patchUpdates(_0x59cfe8){return function(_0x23a248){try{jsonpatch[_0xab19('0x20')](_0x23a248,_0x59cfe8,!![]);}catch(_0x436155){return BPromise[_0xab19('0x21')](_0x436155);}return _0x23a248['save']();};}function saveUpdates(_0x1e846e,_0x2b1458){return function(_0x19e294){if(_0x19e294){return _0x19e294[_0xab19('0x22')](_0x1e846e)[_0xab19('0x23')](function(_0x3eed1d){return _0x3eed1d;});}return null;};}function removeEntity(_0x126d73,_0x288259){return function(_0x296ea3){if(_0x296ea3){return _0x296ea3[_0xab19('0x24')]()['then'](function(){_0x126d73['status'](0xcc)[_0xab19('0x1b')]();});}};}function handleEntityNotFound(_0x409b02,_0x189109){return function(_0x6d8edd){if(!_0x6d8edd){_0x409b02[_0xab19('0x25')](0x194);}return _0x6d8edd;};}function handleError(_0x12c9f7,_0x4018c8){_0x4018c8=_0x4018c8||0x1f4;return function(_0x3f8f5d){logger['error'](_0x3f8f5d[_0xab19('0x26')]);if(_0x3f8f5d[_0xab19('0x27')]){delete _0x3f8f5d[_0xab19('0x27')];}_0x12c9f7[_0xab19('0x1a')](_0x4018c8)[_0xab19('0x28')](_0x3f8f5d);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x2a3839,_0x2c39f9){var _0x45ab28={'raw':!![],'where':{'id':0x1}},_0x528b6e={};_0x528b6e[_0xab19('0x29')]=_[_0xab19('0x2a')](db[_0xab19('0x2b')][_0xab19('0x2c')]);_0x528b6e[_0xab19('0x2d')]=_[_0xab19('0x2a')](_0x2a3839[_0xab19('0x2d')]);_0x528b6e[_0xab19('0x2e')]=_[_0xab19('0x2f')](_0x528b6e['model'],_0x528b6e['query']);_0x45ab28[_0xab19('0x30')]=_[_0xab19('0x2f')](_0x528b6e['model'],qs[_0xab19('0x31')](_0x2a3839[_0xab19('0x2d')]['fields']));_0x45ab28['attributes']=_0x45ab28[_0xab19('0x30')][_0xab19('0x32')]?_0x45ab28[_0xab19('0x30')]:_0x528b6e[_0xab19('0x29')];_0x45ab28=_[_0xab19('0x33')]({},_0x45ab28,_0x2a3839[_0xab19('0x34')]);return utilLicense[_0xab19('0x35')](_0x45ab28)['then'](respondWithResult(_0x2c39f9,null))[_0xab19('0x36')](handleError(_0x2c39f9,null));};exports[_0xab19('0x22')]=function(_0x2e5887,_0x5f1d79){if(_0x2e5887['body']['id']){delete _0x2e5887['body']['id'];}return db['License'][_0xab19('0x37')]({'where':{'id':_0x2e5887[_0xab19('0x38')]['id']}})[_0xab19('0x23')](handleEntityNotFound(_0x5f1d79,null))['then'](function(_0x275ffb){var _0x474036=_0x275ffb[_0xab19('0x39')]({'plain':!![]});return utilLicense[_0xab19('0x3a')](_0x474036,_0x2e5887[_0xab19('0x3b')]['key']);})[_0xab19('0x23')](function(_0x4236e1){if(!_0x4236e1[_0xab19('0x3c')]){return saveUpdates(_0x2e5887['body'],null);}return _0x4236e1;})[_0xab19('0x23')](respondWithResult(_0x5f1d79,null))[_0xab19('0x36')](handleError(_0x5f1d79,null));}; \ No newline at end of file +var _0x72fd=['../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','error','stack','name','send','../../config/license/util','index','model','keys','License','rawAttributes','query','filters','attributes','fields','merge','options','getLicense','body','find','params','get','key','demo','catch','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xd7418,_0x5eb86c){var _0xad12a4=function(_0x326ab2){while(--_0x326ab2){_0xd7418['push'](_0xd7418['shift']());}};_0xad12a4(++_0x5eb86c);}(_0x72fd,0x1e7));var _0xd72f=function(_0x5e1b81,_0x32b8bd){_0x5e1b81=_0x5e1b81-0x0;var _0x4b15d3=_0x72fd[_0x5e1b81];return _0x4b15d3;};'use strict';var pdf=require(_0xd72f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd72f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd72f('0x2'));var rp=require('request-promise');var moment=require(_0xd72f('0x3'));var BPromise=require(_0xd72f('0x4'));var Mustache=require(_0xd72f('0x5'));var util=require(_0xd72f('0x6'));var path=require(_0xd72f('0x7'));var sox=require(_0xd72f('0x8'));var csv=require(_0xd72f('0x9'));var ejs=require(_0xd72f('0xa'));var fs=require('fs');var _=require(_0xd72f('0xb'));var squel=require(_0xd72f('0xc'));var crypto=require(_0xd72f('0xd'));var jsforce=require(_0xd72f('0xe'));var deskjs=require(_0xd72f('0xf'));var toCsv=require(_0xd72f('0x9'));var querystring=require(_0xd72f('0x10'));var Papa=require('papaparse');var Redis=require(_0xd72f('0x11'));var authService=require(_0xd72f('0x12'));var qs=require(_0xd72f('0x13'));var as=require(_0xd72f('0x14'));var hardwareService=require(_0xd72f('0x15'));var logger=require(_0xd72f('0x16'))(_0xd72f('0x17'));var utils=require(_0xd72f('0x18'));var config=require(_0xd72f('0x19'));var db=require(_0xd72f('0x1a'))['db'];function respondWithStatusCode(_0x2e0ddb,_0x439028){_0x439028=_0x439028||0xcc;return function(_0x431058){if(_0x431058){return _0x2e0ddb[_0xd72f('0x1b')](_0x439028);}return _0x2e0ddb['status'](_0x439028)[_0xd72f('0x1c')]();};}function respondWithResult(_0x38e2e4,_0x50dd1c){_0x50dd1c=_0x50dd1c||0xc8;return function(_0x48633e){if(_0x48633e){return _0x38e2e4[_0xd72f('0x1d')](_0x50dd1c)[_0xd72f('0x1e')](_0x48633e);}};}function respondWithFilteredResult(_0x291fd6,_0x31ab59){return function(_0x2cffc9){if(_0x2cffc9){var _0x4c5063=_0x2cffc9[_0xd72f('0x1f')],_0x18a8c2=_0x31ab59[_0xd72f('0x20')],_0x5c2880=_0x31ab59[_0xd72f('0x20')]+_0x31ab59[_0xd72f('0x21')],_0x41a66d;if(_0x5c2880>=_0x4c5063){_0x5c2880=_0x4c5063;_0x41a66d=0xc8;}else{_0x41a66d=0xce;}_0x291fd6[_0xd72f('0x1d')](_0x41a66d);return _0x291fd6['set'](_0xd72f('0x22'),_0x18a8c2+'-'+_0x5c2880+'/'+_0x4c5063)['json'](_0x2cffc9);}return null;};}function patchUpdates(_0x356f5d){return function(_0x7ed248){try{jsonpatch['apply'](_0x7ed248,_0x356f5d,!![]);}catch(_0x2d0cb9){return BPromise[_0xd72f('0x23')](_0x2d0cb9);}return _0x7ed248[_0xd72f('0x24')]();};}function saveUpdates(_0x54794d,_0x4a3534){return function(_0x3c5a14){if(_0x3c5a14){return _0x3c5a14[_0xd72f('0x25')](_0x54794d)['then'](function(_0x3d03f5){return _0x3d03f5;});}return null;};}function removeEntity(_0x5b7b6e,_0x2b9331){return function(_0xb07087){if(_0xb07087){return _0xb07087[_0xd72f('0x26')]()[_0xd72f('0x27')](function(){_0x5b7b6e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e8f9a,_0x12ce6c){return function(_0x486694){if(!_0x486694){_0x5e8f9a[_0xd72f('0x1b')](0x194);}return _0x486694;};}function handleError(_0x22e108,_0xbf8e76){_0xbf8e76=_0xbf8e76||0x1f4;return function(_0x515d08){logger[_0xd72f('0x28')](_0x515d08[_0xd72f('0x29')]);if(_0x515d08[_0xd72f('0x2a')]){delete _0x515d08[_0xd72f('0x2a')];}_0x22e108['status'](_0xbf8e76)[_0xd72f('0x2b')](_0x515d08);};}var utilLicense=require(_0xd72f('0x2c'));exports[_0xd72f('0x2d')]=function(_0x2f726c,_0x5de722){var _0x1bf68e={'raw':!![],'where':{'id':0x1}},_0x4ab817={};_0x4ab817[_0xd72f('0x2e')]=_[_0xd72f('0x2f')](db[_0xd72f('0x30')][_0xd72f('0x31')]);_0x4ab817[_0xd72f('0x32')]=_[_0xd72f('0x2f')](_0x2f726c['query']);_0x4ab817[_0xd72f('0x33')]=_['intersection'](_0x4ab817[_0xd72f('0x2e')],_0x4ab817[_0xd72f('0x32')]);_0x1bf68e[_0xd72f('0x34')]=_['intersection'](_0x4ab817[_0xd72f('0x2e')],qs[_0xd72f('0x35')](_0x2f726c[_0xd72f('0x32')][_0xd72f('0x35')]));_0x1bf68e['attributes']=_0x1bf68e[_0xd72f('0x34')]['length']?_0x1bf68e[_0xd72f('0x34')]:_0x4ab817[_0xd72f('0x2e')];_0x1bf68e=_[_0xd72f('0x36')]({},_0x1bf68e,_0x2f726c[_0xd72f('0x37')]);return utilLicense[_0xd72f('0x38')](_0x1bf68e)[_0xd72f('0x27')](respondWithResult(_0x5de722,null))['catch'](handleError(_0x5de722,null));};exports['update']=function(_0x3b3e0a,_0x1e1d68){if(_0x3b3e0a[_0xd72f('0x39')]['id']){delete _0x3b3e0a[_0xd72f('0x39')]['id'];}return db['License'][_0xd72f('0x3a')]({'where':{'id':_0x3b3e0a[_0xd72f('0x3b')]['id']}})[_0xd72f('0x27')](handleEntityNotFound(_0x1e1d68,null))['then'](function(_0xd14bed){var _0x6de2fe=_0xd14bed[_0xd72f('0x3c')]({'plain':!![]});return utilLicense['checkLicense'](_0x6de2fe,_0x3b3e0a[_0xd72f('0x39')][_0xd72f('0x3d')]);})['then'](function(_0xe2c677){if(!_0xe2c677[_0xd72f('0x3e')]){return saveUpdates(_0x3b3e0a[_0xd72f('0x39')],null);}return _0xe2c677;})[_0xd72f('0x27')](respondWithResult(_0x1e1d68,null))[_0xd72f('0x3f')](handleError(_0x1e1d68,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index deb298d..6580e5b 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 _0x39a7=['moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','License','license','lodash','util','../../config/logger','api'];(function(_0x27cc47,_0x53ec88){var _0x4de163=function(_0x156bbf){while(--_0x156bbf){_0x27cc47['push'](_0x27cc47['shift']());}};_0x4de163(++_0x53ec88);}(_0x39a7,0x15b));var _0x739a=function(_0x491d35,_0x43f6e5){_0x491d35=_0x491d35-0x0;var _0x5a2de7=_0x39a7[_0x491d35];return _0x5a2de7;};'use strict';var _=require(_0x739a('0x0'));var util=require(_0x739a('0x1'));var logger=require(_0x739a('0x2'))(_0x739a('0x3'));var moment=require(_0x739a('0x4'));var BPromise=require(_0x739a('0x5'));var rp=require(_0x739a('0x6'));var fs=require('fs');var path=require(_0x739a('0x7'));var rimraf=require('rimraf');var config=require(_0x739a('0x8'));var attributes=require(_0x739a('0x9'));module[_0x739a('0xa')]=function(_0x5bf8f1,_0x30f170){return _0x5bf8f1['define'](_0x739a('0xb'),attributes,{'tableName':_0x739a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x04cc=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./license.attributes','define','lodash'];(function(_0x40b2e3,_0x50105b){var _0x24c2d1=function(_0x24adfc){while(--_0x24adfc){_0x40b2e3['push'](_0x40b2e3['shift']());}};_0x24c2d1(++_0x50105b);}(_0x04cc,0x10d));var _0xc04c=function(_0x39157f,_0x3d8c1e){_0x39157f=_0x39157f-0x0;var _0x1ae4e2=_0x04cc[_0x39157f];return _0x1ae4e2;};'use strict';var _=require(_0xc04c('0x0'));var util=require(_0xc04c('0x1'));var logger=require(_0xc04c('0x2'))('api');var moment=require(_0xc04c('0x3'));var BPromise=require(_0xc04c('0x4'));var rp=require(_0xc04c('0x5'));var fs=require('fs');var path=require(_0xc04c('0x6'));var rimraf=require(_0xc04c('0x7'));var config=require('../../config/environment');var attributes=require(_0xc04c('0x8'));module['exports']=function(_0xa5b439,_0x4b9e64){return _0xa5b439[_0xc04c('0x9')]('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 3dbcabe..f30b11d 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 _0x7948=['jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x496660,_0x4a7efb){var _0x599d80=function(_0x186b24){while(--_0x186b24){_0x496660['push'](_0x496660['shift']());}};_0x599d80(++_0x4a7efb);}(_0x7948,0x185));var _0x8794=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x7948[_0x4996d5];return _0x4793f9;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var moment=require(_0x8794('0x2'));var BPromise=require(_0x8794('0x3'));var rs=require(_0x8794('0x4'));var fs=require('fs');var Redis=require(_0x8794('0x5'));var db=require(_0x8794('0x6'))['db'];var utils=require(_0x8794('0x7'));var logger=require(_0x8794('0x8'))(_0x8794('0x9'));var config=require(_0x8794('0xa'));var jayson=require(_0x8794('0xb'));var client=jayson[_0x8794('0xc')][_0x8794('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28d12e,_0x2276f2,_0x22b452){return new BPromise(function(_0x27f31e,_0x6d7e86){return client[_0x8794('0xe')](_0x28d12e,_0x22b452)[_0x8794('0xf')](function(_0x2305d8){logger[_0x8794('0x10')](_0x8794('0x11'),_0x2276f2,_0x8794('0x12'));logger[_0x8794('0x13')](_0x8794('0x14'),_0x2276f2,_0x8794('0x12'),JSON[_0x8794('0x15')](_0x2305d8));if(_0x2305d8[_0x8794('0x16')]){if(_0x2305d8[_0x8794('0x16')]['code']===0x1f4){logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x6d7e86(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x27f31e(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}else{logger[_0x8794('0x10')]('License,\x20%s,\x20%s',_0x2276f2,_0x8794('0x12'));_0x27f31e(_0x2305d8['result']['message']);}})[_0x8794('0x18')](function(_0x8b862a){logger[_0x8794('0x16')]('License,\x20%s,\x20%s',_0x2276f2,_0x8b862a);_0x6d7e86(_0x8b862a);});});} \ No newline at end of file +var _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0xa902,0x8d));var _0x2a90=function(_0x316b49,_0x8aa65f){_0x316b49=_0x316b49-0x0;var _0xa5bc2c=_0xa902[_0x316b49];return _0xa5bc2c;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('License,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('License,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 38a7fe1..86df384 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 _0xfb02=['/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addInteraction','addApplications','put','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap'];(function(_0x410597,_0x104fd7){var _0x27ace3=function(_0x3dbf3b){while(--_0x3dbf3b){_0x410597['push'](_0x410597['shift']());}};_0x27ace3(++_0x104fd7);}(_0xfb02,0xf5));var _0x2fb0=function(_0x51bc84,_0x519320){_0x51bc84=_0x51bc84-0x0;var _0x3a953e=_0xfb02[_0x51bc84];return _0x3a953e;};'use strict';var multer=require('multer');var util=require(_0x2fb0('0x0'));var path=require(_0x2fb0('0x1'));var timeout=require('connect-timeout');var express=require(_0x2fb0('0x2'));var router=express[_0x2fb0('0x3')]();var auth=require(_0x2fb0('0x4'));var interaction=require(_0x2fb0('0x5'));var config=require(_0x2fb0('0x6'));var controller=require(_0x2fb0('0x7'));router[_0x2fb0('0x8')]('/',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0xa')]);router[_0x2fb0('0x8')](_0x2fb0('0xb'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0xc')]);router['get'](_0x2fb0('0xd'),auth[_0x2fb0('0x9')](),controller['show']);router['get'](_0x2fb0('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x2fb0('0x8')](_0x2fb0('0xf'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x10')]);router[_0x2fb0('0x8')](_0x2fb0('0x11'),auth['isAuthenticated'](),controller[_0x2fb0('0x12')]);router[_0x2fb0('0x8')](_0x2fb0('0x13'),auth[_0x2fb0('0x9')](),controller['getSmtp']);router[_0x2fb0('0x8')](_0x2fb0('0x14'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x15')]);router[_0x2fb0('0x8')](_0x2fb0('0x16'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x17')]);router[_0x2fb0('0x8')](_0x2fb0('0x18'),auth['isAuthenticated'](),controller[_0x2fb0('0x19')]);router[_0x2fb0('0x8')]('/:id/verify',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x1a')]);router[_0x2fb0('0x8')](_0x2fb0('0x1b'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x1c')]);router[_0x2fb0('0x1d')](_0x2fb0('0xe'),auth['isAuthenticated'](),controller[_0x2fb0('0x1e')]);router[_0x2fb0('0x1d')](_0x2fb0('0xf'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x1f')]);router[_0x2fb0('0x1d')]('/',auth[_0x2fb0('0x9')](),controller['create']);router[_0x2fb0('0x1d')](_0x2fb0('0x11'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x20')]);router[_0x2fb0('0x1d')](_0x2fb0('0x13'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x21')]);router[_0x2fb0('0x1d')](_0x2fb0('0x14'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x22')]);router[_0x2fb0('0x1d')]('/:id/applications',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x23')]);router[_0x2fb0('0x1d')]('/:id/send',auth[_0x2fb0('0x9')](),controller['send']);router[_0x2fb0('0x1d')](_0x2fb0('0x1b'),auth[_0x2fb0('0x9')](),controller['addAgents']);router[_0x2fb0('0x24')](_0x2fb0('0xd'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x25')]);router[_0x2fb0('0x26')](_0x2fb0('0xe'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x27')]);router[_0x2fb0('0x26')](_0x2fb0('0xf'),auth[_0x2fb0('0x9')](),controller['removeAnswers']);router[_0x2fb0('0x26')]('/:id/in_servers',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x28')]);router[_0x2fb0('0x26')](_0x2fb0('0x13'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x29')]);router['delete'](_0x2fb0('0xd'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x2a')]);router[_0x2fb0('0x26')](_0x2fb0('0x1b'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x4206=['/:id/users','post','addDisposition','create','addImap','addSmtp','addInteraction','/:id/send','send','put','removeDispositions','delete','removeAnswers','removeSmtp','removeAgents','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x4206,0x135));var _0x6420=function(_0xb91665,_0x3fa4ae){_0xb91665=_0xb91665-0x0;var _0x21d965=_0x4206[_0xb91665];return _0x21d965;};'use strict';var multer=require(_0x6420('0x0'));var util=require('util');var path=require(_0x6420('0x1'));var timeout=require(_0x6420('0x2'));var express=require(_0x6420('0x3'));var router=express[_0x6420('0x4')]();var auth=require(_0x6420('0x5'));var interaction=require(_0x6420('0x6'));var config=require('../../config/environment');var controller=require(_0x6420('0x7'));router[_0x6420('0x8')]('/',auth[_0x6420('0x9')](),controller['index']);router[_0x6420('0x8')](_0x6420('0xa'),auth[_0x6420('0x9')](),controller['describe']);router[_0x6420('0x8')](_0x6420('0xb'),auth[_0x6420('0x9')](),controller[_0x6420('0xc')]);router[_0x6420('0x8')](_0x6420('0xd'),auth[_0x6420('0x9')](),controller[_0x6420('0xe')]);router[_0x6420('0x8')](_0x6420('0xf'),auth[_0x6420('0x9')](),controller['getAnswers']);router[_0x6420('0x8')](_0x6420('0x10'),auth[_0x6420('0x9')](),controller[_0x6420('0x11')]);router[_0x6420('0x8')](_0x6420('0x12'),auth[_0x6420('0x9')](),controller[_0x6420('0x13')]);router[_0x6420('0x8')](_0x6420('0x14'),auth[_0x6420('0x9')](),controller['getInteractions']);router[_0x6420('0x8')](_0x6420('0x15'),auth[_0x6420('0x9')](),controller[_0x6420('0x16')]);router['get'](_0x6420('0x17'),auth[_0x6420('0x9')](),controller[_0x6420('0x18')]);router[_0x6420('0x8')](_0x6420('0x19'),auth[_0x6420('0x9')](),controller[_0x6420('0x1a')]);router[_0x6420('0x8')](_0x6420('0x1b'),auth['isAuthenticated'](),controller['getAgents']);router[_0x6420('0x1c')](_0x6420('0xd'),auth[_0x6420('0x9')](),controller[_0x6420('0x1d')]);router['post'](_0x6420('0xf'),auth[_0x6420('0x9')](),controller['addAnswer']);router[_0x6420('0x1c')]('/',auth[_0x6420('0x9')](),controller[_0x6420('0x1e')]);router[_0x6420('0x1c')]('/:id/in_servers',auth[_0x6420('0x9')](),controller[_0x6420('0x1f')]);router['post'](_0x6420('0x12'),auth[_0x6420('0x9')](),controller[_0x6420('0x20')]);router[_0x6420('0x1c')](_0x6420('0x14'),auth[_0x6420('0x9')](),controller[_0x6420('0x21')]);router[_0x6420('0x1c')](_0x6420('0x15'),auth['isAuthenticated'](),controller['addApplications']);router[_0x6420('0x1c')](_0x6420('0x22'),auth['isAuthenticated'](),controller[_0x6420('0x23')]);router['post']('/:id/users',auth[_0x6420('0x9')](),controller['addAgents']);router[_0x6420('0x24')](_0x6420('0xb'),auth[_0x6420('0x9')](),controller['update']);router['delete'](_0x6420('0xd'),auth[_0x6420('0x9')](),controller[_0x6420('0x25')]);router[_0x6420('0x26')](_0x6420('0xf'),auth[_0x6420('0x9')](),controller[_0x6420('0x27')]);router[_0x6420('0x26')](_0x6420('0x10'),auth[_0x6420('0x9')](),controller['removeImap']);router[_0x6420('0x26')](_0x6420('0x12'),auth[_0x6420('0x9')](),controller[_0x6420('0x28')]);router['delete'](_0x6420('0xb'),auth[_0x6420('0x9')](),controller['destroy']);router[_0x6420('0x26')](_0x6420('0x1b'),auth[_0x6420('0x9')](),controller[_0x6420('0x29')]);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 1ef14bc..5f5897d 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 _0xf7c5=['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','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x5e2b98,_0x439ca9){var _0x6fe570=function(_0xc450cf){while(--_0xc450cf){_0x5e2b98['push'](_0x5e2b98['shift']());}};_0x6fe570(++_0x439ca9);}(_0xf7c5,0x184));var _0x5f7c=function(_0x4e310c,_0x161a51){_0x4e310c=_0x4e310c-0x0;var _0x247cf7=_0xf7c5[_0x4e310c];return _0x247cf7;};'use strict';var Sequelize=require(_0x5f7c('0x0'));module[_0x5f7c('0x1')]={'description':{'type':Sequelize[_0x5f7c('0x2')]},'name':{'type':Sequelize[_0x5f7c('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5f7c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x5f7c('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x5f7c('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5f7c('0x2')],'allowNull':![],'defaultValue':_0x5f7c('0x5')},'fontSize':{'type':Sequelize[_0x5f7c('0x6')](0x2)[_0x5f7c('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5f7c('0x8');}},'notificationSound':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5f7c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5f7c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5f7c('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':![],'comment':_0x5f7c('0xa'),'set':function(_0x453dfb){if(!_0x453dfb)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x453dfb);}}}; \ No newline at end of file +var _0xa2ba=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','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'];(function(_0x3566ea,_0x50e87d){var _0x24c0b9=function(_0x1f22a5){while(--_0x1f22a5){_0x3566ea['push'](_0x3566ea['shift']());}};_0x24c0b9(++_0x50e87d);}(_0xa2ba,0x122));var _0xaa2b=function(_0xf5cc98,_0x10d06f){_0xf5cc98=_0xf5cc98-0x0;var _0x772573=_0xa2ba[_0xf5cc98];return _0x772573;};'use strict';var Sequelize=require(_0xaa2b('0x0'));module[_0xaa2b('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xaa2b('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xaa2b('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xaa2b('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xaa2b('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xaa2b('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xaa2b('0x4')]},'markAsUnread':{'type':Sequelize[_0xaa2b('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xaa2b('0x2')],'allowNull':![],'defaultValue':_0xaa2b('0x5')},'fontSize':{'type':Sequelize[_0xaa2b('0x6')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xaa2b('0x7');}},'notificationSound':{'type':Sequelize[_0xaa2b('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xaa2b('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xaa2b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xaa2b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xaa2b('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xaa2b('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xaa2b('0x9'),'set':function(_0x37b394){if(!_0x37b394)this['setDataValue'](_0xaa2b('0xa'),null);this[_0xaa2b('0xb')](_0xaa2b('0xc'),_0x37b394);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index f752702..71f5e1e 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 _0x4cf4=['addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','rimraf','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','register','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','get','MailAccounts','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','params','Pause','includeAll','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','isNil','cauthentication','user','cuser','password','pass','cpassword','authentication','port','host','service','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','Contact','User','Owner','internal','Tag','color','tag','sequelize','MailApplication','bulkCreate','priority','getApplications','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','secure','auth','sendMail','List\x20not\x20found','defaults','messageId','attach','out','Interaction','Messages','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account'];(function(_0x1e2e03,_0x25beff){var _0x4f4aba=function(_0x30e357){while(--_0x30e357){_0x1e2e03['push'](_0x1e2e03['shift']());}};_0x4f4aba(++_0x25beff);}(_0x4cf4,0x17d));var _0x44cf=function(_0x42bc9c,_0x1ad740){_0x42bc9c=_0x42bc9c-0x0;var _0x2cc903=_0x4cf4[_0x42bc9c];return _0x2cc903;};'use strict';var pdf=require(_0x44cf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x44cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44cf('0x2'));var util=require(_0x44cf('0x3'));var path=require(_0x44cf('0x4'));var sox=require(_0x44cf('0x5'));var csv=require('to-csv');var ejs=require(_0x44cf('0x6'));var fs=require('fs');var _=require(_0x44cf('0x7'));var squel=require(_0x44cf('0x8'));var crypto=require(_0x44cf('0x9'));var jsforce=require(_0x44cf('0xa'));var deskjs=require(_0x44cf('0xb'));var toCsv=require(_0x44cf('0xc'));var querystring=require(_0x44cf('0xd'));var Papa=require(_0x44cf('0xe'));var Redis=require(_0x44cf('0xf'));var authService=require(_0x44cf('0x10'));var qs=require(_0x44cf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44cf('0x12'));var logger=require(_0x44cf('0x13'))(_0x44cf('0x14'));var utils=require(_0x44cf('0x15'));var config=require(_0x44cf('0x16'));var db=require(_0x44cf('0x17'))['db'];config['redis']=_['defaults'](config[_0x44cf('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44cf('0x18')]));require('./mailAccount.socket')[_0x44cf('0x19')](socket);var jayson=require(_0x44cf('0x1a'));var client=jayson['client'][_0x44cf('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x23977f,_0x1472b4,_0x4829a1){if(_0x4829a1){var _0x126129=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x126129['test'](_0x1472b4)){return _0x23977f;}else{throw new db[(_0x44cf('0x1c'))][(_0x44cf('0x1d'))](_0x44cf('0x1e'));}}else{return _0x23977f;}}function respondWithRpcPromise(_0x13e5f7,_0x5c2bb9,_0x38a204,_0x1bb87f){return new BPromise(function(_0x5173bc,_0x960e5f){var _0x4b7376=_0x1bb87f||client;return _0x4b7376[_0x44cf('0x1f')](_0x13e5f7,_0x38a204)[_0x44cf('0x20')](function(_0x1ee6d4){logger[_0x44cf('0x21')](_0x44cf('0x22'),_0x5c2bb9,_0x44cf('0x23'));logger[_0x44cf('0x24')](_0x44cf('0x25'),_0x5c2bb9,_0x44cf('0x23'),JSON[_0x44cf('0x26')](_0x1ee6d4));if(_0x1ee6d4[_0x44cf('0x27')]){if(_0x1ee6d4[_0x44cf('0x27')][_0x44cf('0x28')]===0x1f4){logger[_0x44cf('0x27')](_0x44cf('0x22'),_0x5c2bb9,_0x1ee6d4[_0x44cf('0x27')]['message']);return _0x960e5f(_0x1ee6d4['error'][_0x44cf('0x29')]);}logger[_0x44cf('0x27')](_0x44cf('0x22'),_0x5c2bb9,_0x1ee6d4[_0x44cf('0x27')][_0x44cf('0x29')]);return _0x5173bc(_0x1ee6d4[_0x44cf('0x27')]['message']);}else{logger['info'](_0x44cf('0x22'),_0x5c2bb9,'request\x20sent');_0x5173bc(_0x1ee6d4[_0x44cf('0x2a')][_0x44cf('0x29')]);}})[_0x44cf('0x2b')](function(_0x17b174){logger[_0x44cf('0x27')]('MailAccount,\x20%s,\x20%s',_0x5c2bb9,_0x17b174);_0x960e5f(_0x17b174);});});}function respondWithStatusCode(_0x1aae07,_0x164ecc){_0x164ecc=_0x164ecc||0xcc;return function(_0x335515){if(_0x335515){return _0x1aae07[_0x44cf('0x2c')](_0x164ecc);}return _0x1aae07[_0x44cf('0x2d')](_0x164ecc)[_0x44cf('0x2e')]();};}function respondWithResult(_0x144dfe,_0xbabe8a){_0xbabe8a=_0xbabe8a||0xc8;return function(_0x150a41){if(_0x150a41){return _0x144dfe['status'](_0xbabe8a)[_0x44cf('0x2f')](_0x150a41);}};}function respondWithFilteredResult(_0x3e24fe,_0x230f17){return function(_0x29bd2a){if(_0x29bd2a){var _0x43bc1=_0x29bd2a[_0x44cf('0x30')],_0x3b33fb=_0x230f17[_0x44cf('0x31')],_0x68b42f=_0x230f17[_0x44cf('0x31')]+_0x230f17[_0x44cf('0x32')],_0x277158;if(_0x68b42f>=_0x43bc1){_0x68b42f=_0x43bc1;_0x277158=0xc8;}else{_0x277158=0xce;}_0x3e24fe[_0x44cf('0x2d')](_0x277158);return _0x3e24fe[_0x44cf('0x33')]('Content-Range',_0x3b33fb+'-'+_0x68b42f+'/'+_0x43bc1)[_0x44cf('0x2f')](_0x29bd2a);}return null;};}function patchUpdates(_0x51280a){return function(_0x55d4c4){try{jsonpatch['apply'](_0x55d4c4,_0x51280a,!![]);}catch(_0x27475f){return BPromise[_0x44cf('0x34')](_0x27475f);}return _0x55d4c4[_0x44cf('0x35')]();};}function saveUpdates(_0x1d47fc,_0xdb9809){return function(_0x1b5d17){if(_0x1b5d17){return _0x1b5d17[_0x44cf('0x36')](_0x1d47fc)[_0x44cf('0x20')](function(_0x37ed9b){return _0x37ed9b;});}return null;};}function removeEntity(_0x1c3302,_0x4029a4){return function(_0x5cff38){if(_0x5cff38){return _0x5cff38[_0x44cf('0x37')]()['then'](function(){var _0x2a8730=_0x5cff38[_0x44cf('0x38')]({'plain':!![]});var _0x1dd756=_0x44cf('0x39');return db['UserProfileResource'][_0x44cf('0x37')]({'where':{'type':_0x1dd756,'resourceId':_0x2a8730['id']}})[_0x44cf('0x20')](function(){return _0x5cff38;});})[_0x44cf('0x20')](function(){_0x1c3302[_0x44cf('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15bab9,_0x455eed){return function(_0x23c859){if(!_0x23c859){_0x15bab9[_0x44cf('0x2c')](0x194);}return _0x23c859;};}function handleError(_0x49f54e,_0x517a6f){_0x517a6f=_0x517a6f||0x1f4;return function(_0x49db6e){logger[_0x44cf('0x27')](_0x49db6e[_0x44cf('0x3a')]);if(_0x49db6e['name']){delete _0x49db6e[_0x44cf('0x3b')];}_0x49f54e[_0x44cf('0x2d')](_0x517a6f)[_0x44cf('0x3c')](_0x49db6e);};}exports[_0x44cf('0x3d')]=function(_0x3c638f,_0x9e692d){var _0x181c26={'include':[{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')},{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41')},{'model':db['Pause'],'as':_0x44cf('0x42')}]},_0x5a5872={},_0x4b59fd={'count':0x0,'rows':[]};var _0x2a9619=_['map'](db[_0x44cf('0x43')][_0x44cf('0x44')],function(_0x13cdf0){return{'name':_0x13cdf0[_0x44cf('0x45')],'type':_0x13cdf0['type'][_0x44cf('0x46')]};});_0x5a5872[_0x44cf('0x47')]=_[_0x44cf('0x48')](_0x2a9619,_0x44cf('0x3b'));_0x5a5872[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x3c638f[_0x44cf('0x49')]);_0x5a5872['filters']=_[_0x44cf('0x4b')](_0x5a5872['model'],_0x5a5872[_0x44cf('0x49')]);_0x181c26[_0x44cf('0x4c')]=_['intersection'](_0x5a5872[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x3c638f[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x181c26[_0x44cf('0x4c')]=_0x181c26[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x181c26[_0x44cf('0x4c')]:_0x5a5872[_0x44cf('0x47')];if(!_0x3c638f[_0x44cf('0x49')]['hasOwnProperty'](_0x44cf('0x4f'))){_0x181c26[_0x44cf('0x32')]=qs[_0x44cf('0x32')](_0x3c638f[_0x44cf('0x49')]['limit']);_0x181c26[_0x44cf('0x31')]=qs[_0x44cf('0x31')](_0x3c638f[_0x44cf('0x49')]['offset']);}_0x181c26['order']=qs[_0x44cf('0x50')](_0x3c638f[_0x44cf('0x49')]['sort']);_0x181c26[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x3c638f[_0x44cf('0x49')],_0x5a5872[_0x44cf('0x52')]));if(_0x3c638f[_0x44cf('0x49')][_0x44cf('0x54')]){_0x181c26[_0x44cf('0x51')]=_['merge'](_0x181c26['where'],{'$or':_[_0x44cf('0x48')](_0x2a9619,function(_0x2f1de4){if(_0x2f1de4[_0x44cf('0x55')]!==_0x44cf('0x56')){var _0x275d83={};_0x275d83[_0x2f1de4['name']]={'$like':'%'+_0x3c638f[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x275d83;}})});}_0x181c26=_[_0x44cf('0x57')]({},_0x181c26,_0x3c638f[_0x44cf('0x58')]);var _0x536a53={'where':_0x181c26[_0x44cf('0x51')]};return db['MailAccount']['count'](_0x536a53)[_0x44cf('0x20')](function(_0x1f65a1){_0x4b59fd['count']=_0x1f65a1;if(_0x3c638f['query']['includeAll']){_0x181c26[_0x44cf('0x59')]=[{'all':!![]}];}return db[_0x44cf('0x43')][_0x44cf('0x5a')](_0x181c26);})['then'](function(_0x4e0da0){_0x4b59fd[_0x44cf('0x5b')]=_0x4e0da0;return _0x4b59fd;})['then'](respondWithFilteredResult(_0x9e692d,_0x181c26))['catch'](handleError(_0x9e692d,null));};exports['show']=function(_0x4ae4df,_0x4deb36){var _0x3ab0be={'raw':![],'where':{'id':_0x4ae4df[_0x44cf('0x5c')]['id']},'include':[{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x44cf('0x5d')],'as':_0x44cf('0x42')}]},_0x2c25da={};_0x2c25da[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db['MailAccount'][_0x44cf('0x44')]);_0x2c25da[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x4ae4df[_0x44cf('0x49')]);_0x2c25da[_0x44cf('0x52')]=_['intersection'](_0x2c25da[_0x44cf('0x47')],_0x2c25da[_0x44cf('0x49')]);_0x3ab0be[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x2c25da[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x4ae4df[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x3ab0be[_0x44cf('0x4c')]=_0x3ab0be[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x3ab0be[_0x44cf('0x4c')]:_0x2c25da[_0x44cf('0x47')];if(_0x4ae4df[_0x44cf('0x49')][_0x44cf('0x5e')]){_0x3ab0be['include']=[{'all':!![]}];}_0x3ab0be=_['merge']({},_0x3ab0be,_0x4ae4df['options']);return db['MailAccount'][_0x44cf('0x5f')](_0x3ab0be)[_0x44cf('0x20')](handleEntityNotFound(_0x4deb36,null))['then'](respondWithResult(_0x4deb36,null))[_0x44cf('0x2b')](handleError(_0x4deb36,null));};exports['update']=function(_0x35bc73,_0x3ea22a){if(_0x35bc73['body']['id']){delete _0x35bc73[_0x44cf('0x60')]['id'];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x35bc73[_0x44cf('0x5c')]['id']},'include':[{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')},{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41')},{'model':db['Pause'],'as':_0x44cf('0x42')}]})[_0x44cf('0x20')](handleEntityNotFound(_0x3ea22a,null))[_0x44cf('0x20')](saveUpdates(_0x35bc73['body'],null))[_0x44cf('0x20')](function(_0x59cfb7){if(_0x59cfb7&&_0x35bc73[_0x44cf('0x60')][_0x44cf('0x3f')]){return db[_0x44cf('0x3e')][_0x44cf('0x36')](_0x35bc73[_0x44cf('0x60')]['Imap'],{'where':{'MailAccountId':_0x59cfb7['id']}})[_0x44cf('0x20')](function(){return _0x59cfb7;});}return _0x59cfb7;})[_0x44cf('0x20')](function(_0x4ad323){if(_0x4ad323&&_0x35bc73[_0x44cf('0x60')][_0x44cf('0x41')]){return db[_0x44cf('0x40')]['update'](_0x35bc73[_0x44cf('0x60')][_0x44cf('0x41')],{'where':{'MailAccountId':_0x4ad323['id']}})[_0x44cf('0x20')](function(){return _0x4ad323;});}return _0x4ad323;})[_0x44cf('0x20')](respondWithResult(_0x3ea22a,null))[_0x44cf('0x2b')](handleError(_0x3ea22a,null));};exports[_0x44cf('0x61')]=function(_0x4cc6ea,_0x2abaa8){return db[_0x44cf('0x43')][_0x44cf('0x61')]()[_0x44cf('0x20')](respondWithResult(_0x2abaa8,null))[_0x44cf('0x2b')](handleError(_0x2abaa8,null));};exports[_0x44cf('0x62')]=function(_0x522edb,_0x126c08,_0x2c5933){if(_0x522edb[_0x44cf('0x60')]['id']){delete _0x522edb[_0x44cf('0x60')]['id'];}return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x522edb[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x126c08,null))[_0x44cf('0x20')](function(_0x3d3135){if(_0x3d3135){_0x522edb[_0x44cf('0x60')][_0x44cf('0x63')]=_0x3d3135['id'];return db[_0x44cf('0x64')][_0x44cf('0x65')](_0x522edb[_0x44cf('0x60')]);}})['then'](respondWithResult(_0x126c08,null))[_0x44cf('0x2b')](handleError(_0x126c08,null));};exports[_0x44cf('0x66')]=function(_0x48e83b,_0x12cb6b,_0x84f2ca){var _0x241bfe={'raw':![],'where':{}};var _0x24f8d2={};var _0x33b0c3={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x48e83b[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x12cb6b,null))[_0x44cf('0x20')](function(_0x58a34d){if(_0x58a34d){_0x24f8d2[_0x44cf('0x47')]=_['keys'](db[_0x44cf('0x64')]['rawAttributes']);_0x24f8d2['query']=_[_0x44cf('0x4a')](_0x48e83b[_0x44cf('0x49')]);_0x24f8d2[_0x44cf('0x52')]=_[_0x44cf('0x4b')](_0x24f8d2[_0x44cf('0x47')],_0x24f8d2[_0x44cf('0x49')]);_0x241bfe[_0x44cf('0x4c')]=_['intersection'](_0x24f8d2[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x48e83b[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x241bfe[_0x44cf('0x4c')]=_0x241bfe[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x241bfe[_0x44cf('0x4c')]:_0x24f8d2[_0x44cf('0x47')];if(!_0x48e83b[_0x44cf('0x49')][_0x44cf('0x68')](_0x44cf('0x4f'))){_0x241bfe['limit']=qs['limit'](_0x48e83b['query'][_0x44cf('0x32')]);_0x241bfe[_0x44cf('0x31')]=qs[_0x44cf('0x31')](_0x48e83b[_0x44cf('0x49')]['offset']);}_0x241bfe[_0x44cf('0x69')]=qs[_0x44cf('0x50')](_0x48e83b[_0x44cf('0x49')]['sort']);_0x241bfe[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x48e83b[_0x44cf('0x49')],_0x24f8d2[_0x44cf('0x52')]));_0x241bfe[_0x44cf('0x51')]['MailAccountId']=_0x58a34d['id'];if(_0x48e83b[_0x44cf('0x49')][_0x44cf('0x54')]){_0x241bfe[_0x44cf('0x51')]=_[_0x44cf('0x57')](_0x241bfe['where'],{'$or':_['map'](_0x241bfe['attributes'],function(_0x4d9612){var _0x489ac5={};_0x489ac5[_0x4d9612]={'$like':'%'+_0x48e83b[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x489ac5;})});}_0x241bfe=_[_0x44cf('0x57')]({},_0x241bfe,_0x48e83b['options']);return db['Disposition'][_0x44cf('0x30')]({'where':_0x241bfe[_0x44cf('0x51')]})[_0x44cf('0x20')](function(_0x20f117){_0x33b0c3[_0x44cf('0x30')]=_0x20f117;if(_0x48e83b[_0x44cf('0x49')]['includeAll']){_0x241bfe[_0x44cf('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x44cf('0x5a')](_0x241bfe);})[_0x44cf('0x20')](function(_0x3754d6){_0x33b0c3['rows']=_0x3754d6;return _0x33b0c3;});}})[_0x44cf('0x20')](respondWithFilteredResult(_0x12cb6b,_0x241bfe))[_0x44cf('0x2b')](handleError(_0x12cb6b,null));};exports[_0x44cf('0x6a')]=function(_0x8065f3,_0x59e921,_0x1058a7){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x8065f3[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x59e921,null))['then'](function(_0x2803af){if(_0x2803af){return _0x2803af[_0x44cf('0x6a')](_0x8065f3[_0x44cf('0x49')][_0x44cf('0x6b')]);}})[_0x44cf('0x20')](respondWithStatusCode(_0x59e921,null))[_0x44cf('0x2b')](handleError(_0x59e921,null));};exports[_0x44cf('0x6c')]=function(_0x14ab44,_0x491318,_0x34794d){if(_0x14ab44[_0x44cf('0x60')]['id']){delete _0x14ab44['body']['id'];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x14ab44['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x491318,null))['then'](function(_0x3e57a8){if(_0x3e57a8){_0x14ab44['body'][_0x44cf('0x63')]=_0x3e57a8['id'];return db[_0x44cf('0x6d')][_0x44cf('0x65')](_0x14ab44[_0x44cf('0x60')]);}})[_0x44cf('0x20')](respondWithResult(_0x491318,null))[_0x44cf('0x2b')](handleError(_0x491318,null));};exports[_0x44cf('0x6e')]=function(_0x3c3b18,_0x3b0162,_0x14ea59){var _0x10ccbd={'raw':![],'where':{}};var _0x75019c={};var _0x1aea50={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x3c3b18[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x3b0162,null))[_0x44cf('0x20')](function(_0x3815d1){if(_0x3815d1){_0x75019c[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db[_0x44cf('0x6d')][_0x44cf('0x44')]);_0x75019c[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x3c3b18[_0x44cf('0x49')]);_0x75019c[_0x44cf('0x52')]=_[_0x44cf('0x4b')](_0x75019c[_0x44cf('0x47')],_0x75019c[_0x44cf('0x49')]);_0x10ccbd[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x75019c[_0x44cf('0x47')],qs['fields'](_0x3c3b18[_0x44cf('0x49')]['fields']));_0x10ccbd[_0x44cf('0x4c')]=_0x10ccbd[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x10ccbd[_0x44cf('0x4c')]:_0x75019c[_0x44cf('0x47')];if(!_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x68')]('nolimit')){_0x10ccbd[_0x44cf('0x32')]=qs[_0x44cf('0x32')](_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x32')]);_0x10ccbd[_0x44cf('0x31')]=qs['offset'](_0x3c3b18['query'][_0x44cf('0x31')]);}_0x10ccbd[_0x44cf('0x69')]=qs['sort'](_0x3c3b18['query']['sort']);_0x10ccbd[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x3c3b18['query'],_0x75019c['filters']));_0x10ccbd['where'][_0x44cf('0x63')]=_0x3815d1['id'];if(_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x54')]){_0x10ccbd['where']=_[_0x44cf('0x57')](_0x10ccbd['where'],{'$or':_[_0x44cf('0x48')](_0x10ccbd[_0x44cf('0x4c')],function(_0x3aebff){var _0x17a0b0={};_0x17a0b0[_0x3aebff]={'$like':'%'+_0x3c3b18['query']['filter']+'%'};return _0x17a0b0;})});}_0x10ccbd=_['merge']({},_0x10ccbd,_0x3c3b18['options']);return db['CannedAnswer'][_0x44cf('0x30')]({'where':_0x10ccbd[_0x44cf('0x51')]})[_0x44cf('0x20')](function(_0x577b5a){_0x1aea50[_0x44cf('0x30')]=_0x577b5a;if(_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x5e')]){_0x10ccbd['include']=[{'all':!![]}];}return db[_0x44cf('0x6d')][_0x44cf('0x5a')](_0x10ccbd);})[_0x44cf('0x20')](function(_0x694c55){_0x1aea50[_0x44cf('0x5b')]=_0x694c55;return _0x1aea50;});}})[_0x44cf('0x20')](respondWithFilteredResult(_0x3b0162,_0x10ccbd))[_0x44cf('0x2b')](handleError(_0x3b0162,null));};exports[_0x44cf('0x6f')]=function(_0x394a2a,_0x3ab70a,_0x4a58de){return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x394a2a[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x3ab70a,null))[_0x44cf('0x20')](function(_0x128997){if(_0x128997){return _0x128997[_0x44cf('0x6f')](_0x394a2a[_0x44cf('0x49')][_0x44cf('0x6b')]);}})['then'](respondWithStatusCode(_0x3ab70a,null))['catch'](handleError(_0x3ab70a,null));};exports[_0x44cf('0x65')]=function(_0x1bac32,_0x55f90b){var _0x1bc624={'name':_0x1bac32[_0x44cf('0x60')][_0x44cf('0x3b')],'key':_0x1bac32[_0x44cf('0x60')]['key'],'email':_0x1bac32[_0x44cf('0x60')][_0x44cf('0x70')],'ListId':_0x1bac32[_0x44cf('0x60')][_0x44cf('0x71')],'active':!_['isNil'](_0x1bac32['body'][_0x44cf('0x72')])?_0x1bac32[_0x44cf('0x60')]['active']:!![],'description':_0x1bac32['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0x44cf('0x73')](_0x1bac32[_0x44cf('0x60')]['cservice'])){if(_0x1bac32['body'][_0x44cf('0x74')]){_0x1bc624['Imap']['user']=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x75')]=_0x1bac32['body'][_0x44cf('0x76')];_0x1bc624['Imap'][_0x44cf('0x77')]=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x78')]=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x79')];}else{_0x1bc624[_0x44cf('0x3f')][_0x44cf('0x7a')]=_0x1bc624['Smtp'][_0x44cf('0x7a')]=![];}_0x1bc624[_0x44cf('0x3f')]['host']=_0x1bac32['body'][_0x44cf('0x3f')]['host'];_0x1bc624[_0x44cf('0x3f')]['port']=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x3f')][_0x44cf('0x7b')];_0x1bc624[_0x44cf('0x41')][_0x44cf('0x7c')]=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x41')][_0x44cf('0x7c')];_0x1bc624['Smtp']['port']=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x41')]['port'];}else{_0x1bc624[_0x44cf('0x3f')][_0x44cf('0x7d')]=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x7d')]=_0x1bac32[_0x44cf('0x60')]['cservice'];_0x1bc624[_0x44cf('0x3f')][_0x44cf('0x75')]=_0x1bc624['Smtp']['user']=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x76')];_0x1bc624['Imap'][_0x44cf('0x77')]=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x78')]=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x79')];}return db[_0x44cf('0x43')][_0x44cf('0x65')](_0x1bc624,{'include':[{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41')},{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')}]})[_0x44cf('0x20')](function(_0xf31fae){var _0x481487=_0x1bac32[_0x44cf('0x75')][_0x44cf('0x38')]({'plain':!![]});if(!_0x481487)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x481487[_0x44cf('0x7e')]===_0x44cf('0x75')){var _0x15c181=_0xf31fae[_0x44cf('0x38')]({'plain':!![]});return db[_0x44cf('0x7f')][_0x44cf('0x5f')]({'where':{'name':_0x44cf('0x39'),'userProfileId':_0x481487[_0x44cf('0x80')]},'raw':!![]})[_0x44cf('0x20')](function(_0x453b72){if(_0x453b72&&_0x453b72[_0x44cf('0x81')]===0x0){return db[_0x44cf('0x82')][_0x44cf('0x65')]({'name':_0x15c181['name'],'resourceId':_0x15c181['id'],'type':_0x453b72['name'],'sectionId':_0x453b72['id']},{})['then'](function(){return _0xf31fae;});}else{return _0xf31fae;}})[_0x44cf('0x2b')](function(_0x1069d8){logger[_0x44cf('0x27')](_0x44cf('0x83'),_0x1069d8);throw _0x1069d8;});}return _0xf31fae;})['then'](respondWithResult(_0x55f90b,0xc9))['catch'](handleError(_0x55f90b,null));};exports[_0x44cf('0x84')]=function(_0x44baae,_0x34214a,_0xce922f){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x44baae[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x34214a,null))[_0x44cf('0x20')](function(_0x3641c8){if(_0x3641c8){return _0x3641c8[_0x44cf('0x84')]();}return null;})[_0x44cf('0x20')](respondWithResult(_0x34214a,null))[_0x44cf('0x2b')](handleError(_0x34214a,null));};exports[_0x44cf('0x85')]=function(_0x498718,_0x37f8c2,_0x9f8e27){if(_0x498718[_0x44cf('0x60')]['id']){delete _0x498718[_0x44cf('0x60')]['id'];}return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x498718['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x37f8c2,null))[_0x44cf('0x20')](function(_0x379610){if(_0x379610){_0x498718[_0x44cf('0x60')][_0x44cf('0x63')]=_0x379610['id'];return db[_0x44cf('0x3e')][_0x44cf('0x65')](_0x498718[_0x44cf('0x60')]);}})['then'](respondWithResult(_0x37f8c2,null))[_0x44cf('0x2b')](handleError(_0x37f8c2,null));};exports['removeImap']=function(_0x30a9b4,_0x3aa8c0,_0x25ef1f){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x30a9b4[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3aa8c0,null))[_0x44cf('0x20')](function(_0x5a55dc){if(_0x5a55dc){return _0x5a55dc['setImap'](null);}return null;})[_0x44cf('0x20')](respondWithStatusCode(_0x3aa8c0,null))[_0x44cf('0x2b')](handleError(_0x3aa8c0,null));};exports[_0x44cf('0x86')]=function(_0x422595,_0x31298d,_0x6d7cce){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x422595[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x31298d,null))[_0x44cf('0x20')](function(_0x3c8aad){if(_0x3c8aad){return _0x3c8aad[_0x44cf('0x86')]();}return null;})['then'](respondWithResult(_0x31298d,null))[_0x44cf('0x2b')](handleError(_0x31298d,null));};exports[_0x44cf('0x87')]=function(_0x5e1b06,_0x4fa63a,_0xddd627){if(_0x5e1b06[_0x44cf('0x60')]['id']){delete _0x5e1b06[_0x44cf('0x60')]['id'];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x5e1b06[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4fa63a,null))[_0x44cf('0x20')](function(_0x2bb9fd){if(_0x2bb9fd){_0x5e1b06['body'][_0x44cf('0x63')]=_0x2bb9fd['id'];return db['MailServerOut'][_0x44cf('0x65')](_0x5e1b06[_0x44cf('0x60')]);}})['then'](respondWithResult(_0x4fa63a,null))[_0x44cf('0x2b')](handleError(_0x4fa63a,null));};exports[_0x44cf('0x88')]=function(_0x2372c7,_0xa47b93,_0x4d7130){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x2372c7[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0xa47b93,null))[_0x44cf('0x20')](function(_0x5ce843){if(_0x5ce843){return _0x5ce843[_0x44cf('0x89')](null);}return null;})[_0x44cf('0x20')](respondWithStatusCode(_0xa47b93,null))[_0x44cf('0x2b')](handleError(_0xa47b93,null));};exports['addInteraction']=function(_0x566022,_0x39992b,_0x4afa85){return db[_0x44cf('0x8a')][_0x44cf('0x5f')]({'where':{'id':_0x566022[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x39992b,null))[_0x44cf('0x20')](function(_0x24874a){if(_0x24874a){return _0x24874a[_0x44cf('0x8b')](_0x566022[_0x44cf('0x60')][_0x44cf('0x6b')],_[_0x44cf('0x8c')](_0x566022[_0x44cf('0x60')],['ids','id'])||{});}})[_0x44cf('0x20')](respondWithResult(_0x39992b,null))['catch'](handleError(_0x39992b,null));};exports['getInteractions']=function(_0x180055,_0x35e17c,_0xe039f0){var _0xed0e35={'raw':![],'where':{}};var _0xcb7a37={};var _0x5d5a6a={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x180055['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x35e17c,null))['then'](function(_0xc6fc0a){if(_0xc6fc0a){_0xcb7a37[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db['MailInteraction'][_0x44cf('0x44')]);_0xcb7a37[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x180055[_0x44cf('0x49')]);_0xcb7a37['filters']=_[_0x44cf('0x4b')](_0xcb7a37['model'],_0xcb7a37['query']);_0xed0e35['attributes']=_['intersection'](_0xcb7a37[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x180055[_0x44cf('0x49')][_0x44cf('0x4d')]));_0xed0e35[_0x44cf('0x4c')]=_0xed0e35[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0xed0e35[_0x44cf('0x4c')]:_0xcb7a37[_0x44cf('0x47')];if(!_0x180055['query']['hasOwnProperty'](_0x44cf('0x4f'))){_0xed0e35['limit']=qs[_0x44cf('0x32')](_0x180055[_0x44cf('0x49')][_0x44cf('0x32')]);_0xed0e35['offset']=qs[_0x44cf('0x31')](_0x180055[_0x44cf('0x49')][_0x44cf('0x31')]);}_0xed0e35['order']=qs[_0x44cf('0x50')](_0x180055[_0x44cf('0x49')][_0x44cf('0x50')]);_0xed0e35[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x180055[_0x44cf('0x49')],_0xcb7a37[_0x44cf('0x52')]));_0xed0e35[_0x44cf('0x51')][_0x44cf('0x63')]=_0xc6fc0a['id'];if(_0x180055[_0x44cf('0x49')][_0x44cf('0x54')]){_0xed0e35[_0x44cf('0x51')]=_['merge'](_0xed0e35[_0x44cf('0x51')],{'$or':_['map'](_0xed0e35['attributes'],function(_0xd1d730){var _0x38af87={};_0x38af87[_0xd1d730]={'$like':'%'+_0x180055[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x38af87;})});}_0xed0e35=_['merge']({},_0xed0e35,_0x180055[_0x44cf('0x58')]);return db[_0x44cf('0x8a')][_0x44cf('0x30')]({'where':_0xed0e35[_0x44cf('0x51')]})[_0x44cf('0x20')](function(_0xd8eb05){_0x5d5a6a[_0x44cf('0x30')]=_0xd8eb05;if(_0x180055[_0x44cf('0x49')]['includeAll']){_0xed0e35[_0x44cf('0x59')]=[{'model':db['CmContact'],'as':_0x44cf('0x8d'),'required':![]},{'model':db[_0x44cf('0x8e')],'as':_0x44cf('0x8f'),'attributes':['name','fullname',_0x44cf('0x90')],'required':![]},{'model':db[_0x44cf('0x91')],'as':'Tags','attributes':['id','name',_0x44cf('0x92')],'where':_0x180055[_0x44cf('0x49')][_0x44cf('0x93')]?{'id':_0x180055[_0x44cf('0x49')]['tag']}:undefined,'required':_0x180055['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0x44cf('0x5a')](_0xed0e35);})[_0x44cf('0x20')](function(_0x430444){_0x5d5a6a[_0x44cf('0x5b')]=_0x430444;return _0x5d5a6a;});}})[_0x44cf('0x20')](respondWithFilteredResult(_0x35e17c,_0xed0e35))[_0x44cf('0x2b')](handleError(_0x35e17c,null));};exports['addApplications']=function(_0x55b61f,_0x55c55c,_0x519e79){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x55b61f[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x55c55c,null))['then'](function(_0x57f7de){if(_0x57f7de){return db[_0x44cf('0x94')]['transaction'](function(_0x13ee69){return db[_0x44cf('0x95')][_0x44cf('0x37')]({'where':{'MailAccountId':_0x55b61f[_0x44cf('0x5c')]['id']},'transaction':_0x13ee69})[_0x44cf('0x20')](function(_0x563bd6){var _0x2823be=_[_0x44cf('0x48')](_0x55b61f[_0x44cf('0x60')],function(_0x313085){_0x313085[_0x44cf('0x63')]=_0x55b61f[_0x44cf('0x5c')]['id'];return _0x313085;});return db[_0x44cf('0x95')][_0x44cf('0x96')](_0x2823be,{'transaction':_0x13ee69});});})['then'](function(){return db[_0x44cf('0x95')]['findAndCountAll']({'where':{'MailAccountId':_0x55b61f[_0x44cf('0x5c')]['id']},'order':_0x44cf('0x97')});});}})['then'](respondWithResult(_0x55c55c,null))[_0x44cf('0x2b')](handleError(_0x55c55c,null));};exports[_0x44cf('0x98')]=function(_0x95bb7e,_0xb90c6f,_0x1ab7a7){var _0xd0154f={};var _0x20accd={};var _0x590da6;var _0x4c6d85;return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x95bb7e[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0xb90c6f,null))[_0x44cf('0x20')](function(_0x364db9){if(_0x364db9){_0x590da6=_0x364db9;_0x20accd['model']=_[_0x44cf('0x4a')](db[_0x44cf('0x95')]['rawAttributes']);_0x20accd['query']=_[_0x44cf('0x4a')](_0x95bb7e[_0x44cf('0x49')]);_0x20accd[_0x44cf('0x52')]=_['intersection'](_0x20accd['model'],_0x20accd[_0x44cf('0x49')]);_0xd0154f[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x20accd[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x95bb7e['query'][_0x44cf('0x4d')]));_0xd0154f[_0x44cf('0x4c')]=_0xd0154f[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0xd0154f['attributes']:_0x20accd[_0x44cf('0x47')];_0xd0154f[_0x44cf('0x69')]=qs['sort'](_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x50')]);_0xd0154f[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x95bb7e['query'],_0x20accd[_0x44cf('0x52')]));if(_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x54')]){_0xd0154f['where']=_[_0x44cf('0x57')](_0xd0154f[_0x44cf('0x51')],{'$or':_[_0x44cf('0x48')](_0xd0154f[_0x44cf('0x4c')],function(_0x3ea377){var _0x4cf0cc={};_0x4cf0cc[_0x3ea377]={'$like':'%'+_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x4cf0cc;})});}_0xd0154f=_[_0x44cf('0x57')]({},_0xd0154f,_0x95bb7e[_0x44cf('0x58')]);return _0x590da6['getApplications'](_0xd0154f);}})[_0x44cf('0x20')](function(_0x4a7de8){if(_0x4a7de8){_0x4c6d85=_0x4a7de8[_0x44cf('0x4e')];if(!_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x68')](_0x44cf('0x4f'))){_0xd0154f[_0x44cf('0x32')]=qs[_0x44cf('0x32')](_0x95bb7e[_0x44cf('0x49')]['limit']);_0xd0154f[_0x44cf('0x31')]=qs['offset'](_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x31')]);}return _0x590da6[_0x44cf('0x98')](_0xd0154f);}})['then'](function(_0x639b94){if(_0x639b94){return _0x639b94?{'count':_0x4c6d85,'rows':_0x639b94}:null;}})[_0x44cf('0x20')](respondWithResult(_0xb90c6f,null))['catch'](handleError(_0xb90c6f,null));};exports['getMessages']=function(_0x1d6e60,_0x2889bb,_0x2e3bb4){var _0x464295={'raw':!![],'where':{}};var _0xba175b={};var _0x13e1d7={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x1d6e60['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x2889bb,null))[_0x44cf('0x20')](function(_0x4f56da){if(_0x4f56da){_0xba175b[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db[_0x44cf('0x99')][_0x44cf('0x44')]);_0xba175b[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x1d6e60[_0x44cf('0x49')]);_0xba175b[_0x44cf('0x52')]=_['intersection'](_0xba175b[_0x44cf('0x47')],_0xba175b['query']);_0x464295['attributes']=_[_0x44cf('0x4b')](_0xba175b[_0x44cf('0x47')],qs['fields'](_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x464295[_0x44cf('0x4c')]=_0x464295[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x464295[_0x44cf('0x4c')]:_0xba175b[_0x44cf('0x47')];if(!_0x1d6e60['query'][_0x44cf('0x68')](_0x44cf('0x4f'))){_0x464295['limit']=qs[_0x44cf('0x32')](_0x1d6e60[_0x44cf('0x49')]['limit']);_0x464295[_0x44cf('0x31')]=qs[_0x44cf('0x31')](_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x31')]);}_0x464295['order']=qs[_0x44cf('0x50')](_0x1d6e60['query'][_0x44cf('0x50')]);_0x464295[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_['pick'](_0x1d6e60['query'],_0xba175b[_0x44cf('0x52')]));_0x464295[_0x44cf('0x51')][_0x44cf('0x63')]=_0x4f56da['id'];if(_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x54')]){_0x464295[_0x44cf('0x51')]=_[_0x44cf('0x57')](_0x464295[_0x44cf('0x51')],{'$or':_[_0x44cf('0x48')](_0x464295[_0x44cf('0x4c')],function(_0x401fac){var _0x3a60eb={};_0x3a60eb[_0x401fac]={'$like':'%'+_0x1d6e60[_0x44cf('0x49')]['filter']+'%'};return _0x3a60eb;})});}if(_0x1d6e60[_0x44cf('0x49')]['$gte']){var _0x46a49b=_0x1d6e60[_0x44cf('0x49')]['$gte'][_0x44cf('0x9a')](',');var _0x205a55={};_0x205a55[_0x46a49b[0x0]]={'$gte':moment(_0x46a49b[0x1])[_0x44cf('0x9b')](_0x44cf('0x9c'))};_0x464295['where']=_['merge'](_0x464295['where'],_0x205a55);}_0x464295=_[_0x44cf('0x57')]({},_0x464295,_0x1d6e60['options']);return db[_0x44cf('0x99')][_0x44cf('0x30')]({'where':_0x464295['where']})[_0x44cf('0x20')](function(_0x303d4a){_0x13e1d7[_0x44cf('0x30')]=_0x303d4a;if(_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x5e')]){_0x464295[_0x44cf('0x59')]=[{'all':!![]}];}return db['MailMessage'][_0x44cf('0x5a')](_0x464295);})[_0x44cf('0x20')](function(_0x491715){_0x13e1d7[_0x44cf('0x5b')]=_0x491715;return _0x13e1d7;});}})['then'](respondWithFilteredResult(_0x2889bb,_0x464295))[_0x44cf('0x2b')](handleError(_0x2889bb,null));};exports[_0x44cf('0x3c')]=function(_0x2aa691,_0x1e02e4,_0x2399be){var _0x276994,_0x1c8573={},_0xe49159;if(_0x2aa691[_0x44cf('0x60')]['to']){_0xe49159=_0x2aa691[_0x44cf('0x60')]['to']['split'](',')[0x0];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x2aa691[_0x44cf('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x44cf('0x9d'),'include':[{'model':db[_0x44cf('0x9e')],'as':_0x44cf('0x9f'),'where':{'email':_0xe49159},'limit':0x1,'order':[[_0x44cf('0xa0'),_0x44cf('0xa1')]]}]},{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41'),'raw':!![]}]})[_0x44cf('0x20')](handleEntityNotFound(_0x1e02e4,null))['then'](function(_0xc251b9){if(_0xc251b9){_0x276994=_0xc251b9;if(_0xc251b9['Smtp']){if(_[_0x44cf('0x73')](_0x2aa691['body'][_0x44cf('0xa2')])){_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa2')]=util[_0x44cf('0x9b')](_0x44cf('0xa3'),_0xc251b9['name'],_0xc251b9['email']||_0xc251b9[_0x44cf('0x41')][_0x44cf('0x75')]);}if(_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')]&&_0x2aa691[_0x44cf('0x60')]['attachments']['length']){for(var _0x1e5a22=0x0;_0x1e5a22<_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')][_0x44cf('0x4e')];_0x1e5a22+=0x1){_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')][_0x1e5a22]={'filename':_0x2aa691[_0x44cf('0x60')]['attachments'][_0x1e5a22][_0x44cf('0x3b')],'path':path[_0x44cf('0xa5')](config[_0x44cf('0xa6')],'server/files/attachments',_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')][_0x1e5a22][_0x44cf('0xa7')])};}}var _0x4e1535={'tls':{'rejectUnauthorized':![]}};if(_[_0x44cf('0x73')](_0xc251b9[_0x44cf('0x41')][_0x44cf('0x7d')])){if(_0xc251b9['Smtp']['authentication']){_0x4e1535['auth']={'user':_0xc251b9['Smtp']['user'],'pass':_0xc251b9[_0x44cf('0x41')][_0x44cf('0x78')]};}_0x4e1535[_0x44cf('0x7c')]=_0xc251b9[_0x44cf('0x41')][_0x44cf('0x7c')];_0x4e1535['port']=_0xc251b9['Smtp'][_0x44cf('0x7b')];_0x4e1535[_0x44cf('0xa8')]=_0xc251b9['Smtp'][_0x44cf('0xa8')];}else{_0x4e1535[_0x44cf('0x7d')]=_0xc251b9[_0x44cf('0x41')]['service'];_0x4e1535[_0x44cf('0xa9')]={'user':_0xc251b9[_0x44cf('0x41')][_0x44cf('0x75')],'pass':_0xc251b9[_0x44cf('0x41')]['pass']};}return respondWithRpcPromise('SendMail',_0x44cf('0xaa'),{'account':_0x4e1535,'message':_0x2aa691[_0x44cf('0x60')]});}else{throw new Error(_0x44cf('0xab'));}}})['then'](function(_0x25578c){if(_0x25578c){_0x1c8573=_0x25578c;if(_0x276994[_0x44cf('0x9d')]){if(_0x276994[_0x44cf('0x9d')][_0x44cf('0x9f')]['length']){return _0x276994['List'][_0x44cf('0x9f')][0x0];}else{return db['CmContact']['create'](_[_0x44cf('0xac')](_0x2aa691[_0x44cf('0x60')],{'firstName':_0x2aa691['body']['to'],'email':_0x2aa691[_0x44cf('0x60')]['to'],'phone':_0x2aa691[_0x44cf('0x60')]['to'],'ListId':_0x276994[_0x44cf('0x71')]}));}}else{throw new Error(_0x44cf('0xab'));}}})['then'](function(_0x3db575){if(_0x3db575){var _0x2d7213={'UserId':_0x2aa691[_0x44cf('0x75')]['id'],'ContactId':_0x3db575['id'],'MailAccountId':_0x276994['id'],'inReplyTo':_0x1c8573[_0x44cf('0xad')],'to':_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa2')],'cc':_0x2aa691[_0x44cf('0x60')]['cc'],'subject':_0x2aa691['body']['subject'],'attach':_0x2aa691['body'][_0x44cf('0xae')],'firstMsgDirection':_0x44cf('0xaf'),'lastMsgAt':moment()[_0x44cf('0x9b')](_0x44cf('0x9c')),'lastMsgDirection':'out','lastMsgBody':_0x2aa691[_0x44cf('0x60')]['body'],'Messages':[_[_0x44cf('0x57')](_0x2aa691[_0x44cf('0x60')],{'messageId':_0x1c8573[_0x44cf('0xad')],'sentAt':moment()['format'](_0x44cf('0x9c')),'read':!![],'MailAccountId':_0x276994['id'],'UserId':_0x2aa691['user']['id'],'ContactId':_0x3db575['id']})]};if(_0x2aa691[_0x44cf('0x60')][_0x44cf('0xb0')]){_0x2d7213=_[_0x44cf('0x57')](_0x2d7213,_0x2aa691[_0x44cf('0x60')]['Interaction']);}return db[_0x44cf('0x8a')][_0x44cf('0x65')](_0x2d7213,{'include':[{'model':db[_0x44cf('0x99')],'as':_0x44cf('0xb1')}]});}})['then'](respondWithResult(_0x1e02e4,null))['catch'](handleError(_0x1e02e4,null));};exports['verifySmtp']=function(_0x5ae2c8,_0x55437b,_0x1e84a7){return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x5ae2c8[_0x44cf('0x5c')]['id']},'include':[{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41'),'raw':!![]}]})[_0x44cf('0x20')](handleEntityNotFound(_0x55437b,null))['then'](function(_0x5c6a95){if(_0x5c6a95&&_0x5c6a95[_0x44cf('0x41')]){var _0xed6001={'id':_0x5c6a95['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c6a95['Smtp'][_0x44cf('0x7d')]){_0xed6001['service']=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7d')];}else{_0xed6001[_0x44cf('0x7c')]=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7c')];_0xed6001[_0x44cf('0x7b')]=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7b')];_0xed6001[_0x44cf('0xa8')]=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0xa8')];}if(_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7a')]){_0xed6001[_0x44cf('0xa9')]={'user':_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x75')],'pass':_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x78')]};}return respondWithRpcPromise('VerifySmtp',_0x44cf('0xb2'),{'account':_0xed6001});}})[_0x44cf('0x20')](respondWithResult(_0x55437b,null))[_0x44cf('0x2b')](handleError(_0x55437b,null));};exports[_0x44cf('0x37')]=function(_0x805da8,_0x3c6e70){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x805da8['params']['id']}})['then'](handleEntityNotFound(_0x3c6e70,null))[_0x44cf('0x20')](function(_0x379553){if(_0x379553&&_0x379553['service']){throw new db[(_0x44cf('0x1c'))][(_0x44cf('0x1d'))](_0x44cf('0xb3'));}return _0x379553;})[_0x44cf('0x20')](removeEntity(_0x3c6e70,null))[_0x44cf('0x2b')](handleError(_0x3c6e70,null));};exports[_0x44cf('0xb4')]=function(_0x412c23,_0x165013,_0x107b6b){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x412c23[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x165013,null))[_0x44cf('0x20')](function(_0x50b124){if(_0x50b124){return _0x50b124[_0x44cf('0xb4')](_0x412c23['body']['ids'],_['omit'](_0x412c23[_0x44cf('0x60')],[_0x44cf('0x6b'),'id'])||{})['spread'](function(_0x1e26da){for(var _0x3466c8=0x0;_0x3466c8<_0x412c23['body']['ids']['length'];_0x3466c8+=0x1){socket[_0x44cf('0xb5')](_0x44cf('0xb6'),{'UserId':_0x412c23['body'][_0x44cf('0x6b')][_0x3466c8],'MailAccountId':_0x412c23[_0x44cf('0x5c')]['id']});}return _0x1e26da;});}})[_0x44cf('0x20')](respondWithResult(_0x165013,null))[_0x44cf('0x2b')](handleError(_0x165013,null));};exports[_0x44cf('0xb7')]=function(_0x33f174,_0x341f32,_0x1fae87){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x33f174[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x341f32,null))[_0x44cf('0x20')](function(_0x2ffecf){if(_0x2ffecf){return _0x2ffecf[_0x44cf('0xb7')](_0x33f174[_0x44cf('0x49')][_0x44cf('0x6b')])[_0x44cf('0x20')](function(){if(_[_0x44cf('0xb8')](_0x33f174[_0x44cf('0x49')]['ids'])){for(var _0x4fc549=0x0;_0x4fc549<_0x33f174[_0x44cf('0x49')]['ids'][_0x44cf('0x4e')];_0x4fc549+=0x1){socket[_0x44cf('0xb5')](_0x44cf('0xb9'),{'UserId':Number(_0x33f174['query']['ids'][_0x4fc549]),'MailAccountId':Number(_0x33f174[_0x44cf('0x5c')]['id'])});}}else{socket[_0x44cf('0xb5')](_0x44cf('0xb9'),{'UserId':Number(_0x33f174[_0x44cf('0x49')][_0x44cf('0x6b')]),'MailAccountId':Number(_0x33f174[_0x44cf('0x5c')]['id'])});}});}})[_0x44cf('0x20')](respondWithStatusCode(_0x341f32,null))['catch'](handleError(_0x341f32,null));};exports['getAgents']=function(_0x503eec,_0x4ee555,_0xda1c76){var _0x13b8e1={};var _0x52a78d={};var _0x19ed86;var _0x25492d;return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x503eec[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ee555,null))[_0x44cf('0x20')](function(_0xc24299){if(_0xc24299){_0x19ed86=_0xc24299;_0x52a78d[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db[_0x44cf('0x8e')][_0x44cf('0x44')]);_0x52a78d[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x503eec['query']);_0x52a78d[_0x44cf('0x52')]=_[_0x44cf('0x4b')](_0x52a78d[_0x44cf('0x47')],_0x52a78d[_0x44cf('0x49')]);_0x13b8e1[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x52a78d[_0x44cf('0x47')],qs['fields'](_0x503eec['query'][_0x44cf('0x4d')]));_0x13b8e1['attributes']=_0x13b8e1[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x13b8e1[_0x44cf('0x4c')]:_0x52a78d[_0x44cf('0x47')];_0x13b8e1[_0x44cf('0x69')]=qs[_0x44cf('0x50')](_0x503eec[_0x44cf('0x49')][_0x44cf('0x50')]);_0x13b8e1[_0x44cf('0x51')]=qs['filters'](_[_0x44cf('0x53')](_0x503eec['query'],_0x52a78d[_0x44cf('0x52')]));if(_0x503eec[_0x44cf('0x49')]['filter']){_0x13b8e1[_0x44cf('0x51')]=_[_0x44cf('0x57')](_0x13b8e1[_0x44cf('0x51')],{'$or':_[_0x44cf('0x48')](_0x13b8e1[_0x44cf('0x4c')],function(_0x516a29){var _0x587ea1={};_0x587ea1[_0x516a29]={'$like':'%'+_0x503eec[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x587ea1;})});}_0x13b8e1=_[_0x44cf('0x57')]({},_0x13b8e1,_0x503eec[_0x44cf('0x58')]);return _0x19ed86[_0x44cf('0xba')](_0x13b8e1);}})['then'](function(_0x43d96a){if(_0x43d96a){_0x25492d=_0x43d96a['length'];if(!_0x503eec[_0x44cf('0x49')][_0x44cf('0x68')]('nolimit')){_0x13b8e1['limit']=qs[_0x44cf('0x32')](_0x503eec[_0x44cf('0x49')]['limit']);_0x13b8e1[_0x44cf('0x31')]=qs['offset'](_0x503eec['query'][_0x44cf('0x31')]);}return _0x19ed86[_0x44cf('0xba')](_0x13b8e1);}})['then'](function(_0x47ae9d){if(_0x47ae9d){return _0x47ae9d?{'count':_0x25492d,'rows':_0x47ae9d}:null;}})[_0x44cf('0x20')](respondWithResult(_0x4ee555,null))[_0x44cf('0x2b')](handleError(_0x4ee555,null));}; \ No newline at end of file +var _0x5e4d=['map','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','includeAll','find','body','describe','addDisposition','Disposition','create','getDispositions','findOne','order','removeDispositions','ids','addAnswer','MailAccountId','CannedAnswer','getAnswers','rows','removeAnswers','email','ListId','active','description','cservice','cauthentication','user','cuser','cpassword','authentication','host','port','service','password','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addImap','setImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','sequelize','transaction','bulkCreate','MailApplication','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','CmContact','updatedAt','isNil','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','messageId','subject','attach','out','Interaction','verifySmtp','ValidationError','addAgents','userMailAccount:save','removeAgents','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./mailAccount.socket','jayson/promise','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','MailAccount,\x20%s,\x20%s','message','info','request\x20sent','result','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','sendStatus','name','send','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x5e4d,0x137));var _0xd5e4=function(_0x753e7a,_0x47844d){_0x753e7a=_0x753e7a-0x0;var _0x35c999=_0x5e4d[_0x753e7a];return _0x35c999;};'use strict';var pdf=require(_0xd5e4('0x0'));var emlformat=require(_0xd5e4('0x1'));var rimraf=require(_0xd5e4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd5e4('0x3'));var rp=require(_0xd5e4('0x4'));var moment=require(_0xd5e4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd5e4('0x6'));var util=require('util');var path=require(_0xd5e4('0x7'));var sox=require(_0xd5e4('0x8'));var csv=require(_0xd5e4('0x9'));var ejs=require(_0xd5e4('0xa'));var fs=require('fs');var _=require(_0xd5e4('0xb'));var squel=require(_0xd5e4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd5e4('0xd'));var toCsv=require(_0xd5e4('0x9'));var querystring=require(_0xd5e4('0xe'));var Papa=require('papaparse');var Redis=require(_0xd5e4('0xf'));var authService=require(_0xd5e4('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5e4('0x11'))(_0xd5e4('0x12'));var utils=require('../../config/utils');var config=require(_0xd5e4('0x13'));var db=require(_0xd5e4('0x14'))['db'];config[_0xd5e4('0x15')]=_[_0xd5e4('0x16')](config[_0xd5e4('0x15')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd5e4('0x15')]));require(_0xd5e4('0x17'))['register'](socket);var jayson=require(_0xd5e4('0x18'));var client=jayson[_0xd5e4('0x19')]['http']({'port':0x232b});function checkPasswordPattern(_0x49b759,_0x189895,_0xee6368){if(_0xee6368){var _0xa931e2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa931e2[_0xd5e4('0x1a')](_0x189895)){return _0x49b759;}else{throw new db[(_0xd5e4('0x1b'))]['ValidationError'](_0xd5e4('0x1c'));}}else{return _0x49b759;}}function respondWithRpcPromise(_0x420f77,_0x4ca0ed,_0x5c3197,_0x2ed572){return new BPromise(function(_0x252e6b,_0x5c55a3){var _0x375d36=_0x2ed572||client;return _0x375d36[_0xd5e4('0x1d')](_0x420f77,_0x5c3197)[_0xd5e4('0x1e')](function(_0x41fa13){logger['info']('MailAccount,\x20%s,\x20%s',_0x4ca0ed,'request\x20sent');logger['debug'](_0xd5e4('0x1f'),_0x4ca0ed,'request\x20sent',JSON[_0xd5e4('0x20')](_0x41fa13));if(_0x41fa13[_0xd5e4('0x21')]){if(_0x41fa13['error'][_0xd5e4('0x22')]===0x1f4){logger[_0xd5e4('0x21')](_0xd5e4('0x23'),_0x4ca0ed,_0x41fa13[_0xd5e4('0x21')][_0xd5e4('0x24')]);return _0x5c55a3(_0x41fa13['error'][_0xd5e4('0x24')]);}logger['error'](_0xd5e4('0x23'),_0x4ca0ed,_0x41fa13['error']['message']);return _0x252e6b(_0x41fa13[_0xd5e4('0x21')][_0xd5e4('0x24')]);}else{logger[_0xd5e4('0x25')](_0xd5e4('0x23'),_0x4ca0ed,_0xd5e4('0x26'));_0x252e6b(_0x41fa13[_0xd5e4('0x27')][_0xd5e4('0x24')]);}})['catch'](function(_0x2d98a8){logger['error'](_0xd5e4('0x23'),_0x4ca0ed,_0x2d98a8);_0x5c55a3(_0x2d98a8);});});}function respondWithStatusCode(_0xd67ced,_0x329dec){_0x329dec=_0x329dec||0xcc;return function(_0xa45d94){if(_0xa45d94){return _0xd67ced['sendStatus'](_0x329dec);}return _0xd67ced['status'](_0x329dec)[_0xd5e4('0x28')]();};}function respondWithResult(_0x38f40f,_0x27f46e){_0x27f46e=_0x27f46e||0xc8;return function(_0x24de4f){if(_0x24de4f){return _0x38f40f[_0xd5e4('0x29')](_0x27f46e)['json'](_0x24de4f);}};}function respondWithFilteredResult(_0x27cb93,_0x4dca29){return function(_0x2a61ea){if(_0x2a61ea){var _0x44dadd=_0x2a61ea[_0xd5e4('0x2a')],_0x24256e=_0x4dca29[_0xd5e4('0x2b')],_0x45da34=_0x4dca29[_0xd5e4('0x2b')]+_0x4dca29[_0xd5e4('0x2c')],_0x23ba54;if(_0x45da34>=_0x44dadd){_0x45da34=_0x44dadd;_0x23ba54=0xc8;}else{_0x23ba54=0xce;}_0x27cb93[_0xd5e4('0x29')](_0x23ba54);return _0x27cb93[_0xd5e4('0x2d')](_0xd5e4('0x2e'),_0x24256e+'-'+_0x45da34+'/'+_0x44dadd)[_0xd5e4('0x2f')](_0x2a61ea);}return null;};}function patchUpdates(_0x297be7){return function(_0x5692b8){try{jsonpatch[_0xd5e4('0x30')](_0x5692b8,_0x297be7,!![]);}catch(_0x16d6db){return BPromise[_0xd5e4('0x31')](_0x16d6db);}return _0x5692b8[_0xd5e4('0x32')]();};}function saveUpdates(_0x2a90b8,_0x49d8e4){return function(_0x44148f){if(_0x44148f){return _0x44148f[_0xd5e4('0x33')](_0x2a90b8)['then'](function(_0x50c2fc){return _0x50c2fc;});}return null;};}function removeEntity(_0x17eea1,_0xdf59c9){return function(_0x1a9de7){if(_0x1a9de7){return _0x1a9de7[_0xd5e4('0x34')]()['then'](function(){var _0x3b080b=_0x1a9de7[_0xd5e4('0x35')]({'plain':!![]});var _0x18d0be=_0xd5e4('0x36');return db[_0xd5e4('0x37')][_0xd5e4('0x34')]({'where':{'type':_0x18d0be,'resourceId':_0x3b080b['id']}})[_0xd5e4('0x1e')](function(){return _0x1a9de7;});})['then'](function(){_0x17eea1[_0xd5e4('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b54e2,_0x360ed6){return function(_0x4b3b26){if(!_0x4b3b26){_0x4b54e2[_0xd5e4('0x38')](0x194);}return _0x4b3b26;};}function handleError(_0x334bba,_0x41e40d){_0x41e40d=_0x41e40d||0x1f4;return function(_0x160732){logger[_0xd5e4('0x21')](_0x160732['stack']);if(_0x160732[_0xd5e4('0x39')]){delete _0x160732[_0xd5e4('0x39')];}_0x334bba['status'](_0x41e40d)[_0xd5e4('0x3a')](_0x160732);};}exports['index']=function(_0x286f7f,_0x15f49f){var _0x3ef29b={'include':[{'model':db[_0xd5e4('0x3b')],'as':_0xd5e4('0x3c')},{'model':db[_0xd5e4('0x3d')],'as':_0xd5e4('0x3e')},{'model':db[_0xd5e4('0x3f')],'as':_0xd5e4('0x40')}]},_0x4c15f2={},_0x29371c={'count':0x0,'rows':[]};var _0x1356c3=_['map'](db[_0xd5e4('0x41')][_0xd5e4('0x42')],function(_0x40f4ed){return{'name':_0x40f4ed[_0xd5e4('0x43')],'type':_0x40f4ed[_0xd5e4('0x44')][_0xd5e4('0x45')]};});_0x4c15f2[_0xd5e4('0x46')]=_[_0xd5e4('0x47')](_0x1356c3,'name');_0x4c15f2['query']=_[_0xd5e4('0x48')](_0x286f7f[_0xd5e4('0x49')]);_0x4c15f2['filters']=_['intersection'](_0x4c15f2[_0xd5e4('0x46')],_0x4c15f2['query']);_0x3ef29b['attributes']=_[_0xd5e4('0x4a')](_0x4c15f2['model'],qs[_0xd5e4('0x4b')](_0x286f7f[_0xd5e4('0x49')][_0xd5e4('0x4b')]));_0x3ef29b[_0xd5e4('0x4c')]=_0x3ef29b[_0xd5e4('0x4c')][_0xd5e4('0x4d')]?_0x3ef29b[_0xd5e4('0x4c')]:_0x4c15f2[_0xd5e4('0x46')];if(!_0x286f7f[_0xd5e4('0x49')][_0xd5e4('0x4e')](_0xd5e4('0x4f'))){_0x3ef29b[_0xd5e4('0x2c')]=qs['limit'](_0x286f7f[_0xd5e4('0x49')][_0xd5e4('0x2c')]);_0x3ef29b['offset']=qs[_0xd5e4('0x2b')](_0x286f7f[_0xd5e4('0x49')][_0xd5e4('0x2b')]);}_0x3ef29b['order']=qs[_0xd5e4('0x50')](_0x286f7f[_0xd5e4('0x49')][_0xd5e4('0x50')]);_0x3ef29b[_0xd5e4('0x51')]=qs[_0xd5e4('0x52')](_[_0xd5e4('0x53')](_0x286f7f[_0xd5e4('0x49')],_0x4c15f2['filters']));if(_0x286f7f[_0xd5e4('0x49')][_0xd5e4('0x54')]){_0x3ef29b[_0xd5e4('0x51')]=_[_0xd5e4('0x55')](_0x3ef29b[_0xd5e4('0x51')],{'$or':_['map'](_0x1356c3,function(_0x5f3f8d){if(_0x5f3f8d['type']!==_0xd5e4('0x56')){var _0x1d9a2d={};_0x1d9a2d[_0x5f3f8d[_0xd5e4('0x39')]]={'$like':'%'+_0x286f7f[_0xd5e4('0x49')]['filter']+'%'};return _0x1d9a2d;}})});}_0x3ef29b=_[_0xd5e4('0x55')]({},_0x3ef29b,_0x286f7f[_0xd5e4('0x57')]);var _0x587344={'where':_0x3ef29b['where']};return db[_0xd5e4('0x41')][_0xd5e4('0x2a')](_0x587344)[_0xd5e4('0x1e')](function(_0xc83e14){_0x29371c[_0xd5e4('0x2a')]=_0xc83e14;if(_0x286f7f[_0xd5e4('0x49')]['includeAll']){_0x3ef29b[_0xd5e4('0x58')]=[{'all':!![]}];}return db['MailAccount'][_0xd5e4('0x59')](_0x3ef29b);})['then'](function(_0x3b0dcd){_0x29371c['rows']=_0x3b0dcd;return _0x29371c;})[_0xd5e4('0x1e')](respondWithFilteredResult(_0x15f49f,_0x3ef29b))[_0xd5e4('0x5a')](handleError(_0x15f49f,null));};exports['show']=function(_0xacbe7b,_0x8a576c){var _0x4887c3={'raw':![],'where':{'id':_0xacbe7b[_0xd5e4('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xd5e4('0x3c')},{'model':db[_0xd5e4('0x3d')],'as':_0xd5e4('0x3e')},{'model':db[_0xd5e4('0x3f')],'as':_0xd5e4('0x40')}]},_0x3afa1f={};_0x3afa1f[_0xd5e4('0x46')]=_['keys'](db[_0xd5e4('0x41')][_0xd5e4('0x42')]);_0x3afa1f[_0xd5e4('0x49')]=_[_0xd5e4('0x48')](_0xacbe7b[_0xd5e4('0x49')]);_0x3afa1f['filters']=_[_0xd5e4('0x4a')](_0x3afa1f[_0xd5e4('0x46')],_0x3afa1f[_0xd5e4('0x49')]);_0x4887c3['attributes']=_['intersection'](_0x3afa1f[_0xd5e4('0x46')],qs[_0xd5e4('0x4b')](_0xacbe7b['query']['fields']));_0x4887c3[_0xd5e4('0x4c')]=_0x4887c3[_0xd5e4('0x4c')]['length']?_0x4887c3['attributes']:_0x3afa1f[_0xd5e4('0x46')];if(_0xacbe7b[_0xd5e4('0x49')][_0xd5e4('0x5c')]){_0x4887c3[_0xd5e4('0x58')]=[{'all':!![]}];}_0x4887c3=_[_0xd5e4('0x55')]({},_0x4887c3,_0xacbe7b['options']);return db['MailAccount'][_0xd5e4('0x5d')](_0x4887c3)[_0xd5e4('0x1e')](handleEntityNotFound(_0x8a576c,null))[_0xd5e4('0x1e')](respondWithResult(_0x8a576c,null))[_0xd5e4('0x5a')](handleError(_0x8a576c,null));};exports[_0xd5e4('0x33')]=function(_0x3d929f,_0xcb97f){if(_0x3d929f[_0xd5e4('0x5e')]['id']){delete _0x3d929f[_0xd5e4('0x5e')]['id'];}return db[_0xd5e4('0x41')]['find']({'where':{'id':_0x3d929f[_0xd5e4('0x5b')]['id']},'include':[{'model':db[_0xd5e4('0x3b')],'as':_0xd5e4('0x3c')},{'model':db[_0xd5e4('0x3d')],'as':'Smtp'},{'model':db[_0xd5e4('0x3f')],'as':_0xd5e4('0x40')}]})['then'](handleEntityNotFound(_0xcb97f,null))[_0xd5e4('0x1e')](saveUpdates(_0x3d929f[_0xd5e4('0x5e')],null))[_0xd5e4('0x1e')](function(_0x207763){if(_0x207763&&_0x3d929f[_0xd5e4('0x5e')][_0xd5e4('0x3c')]){return db[_0xd5e4('0x3b')][_0xd5e4('0x33')](_0x3d929f[_0xd5e4('0x5e')][_0xd5e4('0x3c')],{'where':{'MailAccountId':_0x207763['id']}})['then'](function(){return _0x207763;});}return _0x207763;})[_0xd5e4('0x1e')](function(_0x17cf5a){if(_0x17cf5a&&_0x3d929f[_0xd5e4('0x5e')][_0xd5e4('0x3e')]){return db[_0xd5e4('0x3d')][_0xd5e4('0x33')](_0x3d929f[_0xd5e4('0x5e')][_0xd5e4('0x3e')],{'where':{'MailAccountId':_0x17cf5a['id']}})[_0xd5e4('0x1e')](function(){return _0x17cf5a;});}return _0x17cf5a;})[_0xd5e4('0x1e')](respondWithResult(_0xcb97f,null))[_0xd5e4('0x5a')](handleError(_0xcb97f,null));};exports[_0xd5e4('0x5f')]=function(_0x6b402a,_0x114298){return db['MailAccount']['describe']()[_0xd5e4('0x1e')](respondWithResult(_0x114298,null))[_0xd5e4('0x5a')](handleError(_0x114298,null));};exports[_0xd5e4('0x60')]=function(_0x362629,_0x156e68,_0x2cfa92){if(_0x362629['body']['id']){delete _0x362629[_0xd5e4('0x5e')]['id'];}return db[_0xd5e4('0x41')][_0xd5e4('0x5d')]({'where':{'id':_0x362629[_0xd5e4('0x5b')]['id']}})['then'](handleEntityNotFound(_0x156e68,null))[_0xd5e4('0x1e')](function(_0x1c13e4){if(_0x1c13e4){_0x362629['body']['MailAccountId']=_0x1c13e4['id'];return db[_0xd5e4('0x61')][_0xd5e4('0x62')](_0x362629[_0xd5e4('0x5e')]);}})[_0xd5e4('0x1e')](respondWithResult(_0x156e68,null))[_0xd5e4('0x5a')](handleError(_0x156e68,null));};exports[_0xd5e4('0x63')]=function(_0x386259,_0xf5eb85,_0x13c30a){var _0x538146={'raw':![],'where':{}};var _0x35f2f8={};var _0x3e58b7={'count':0x0,'rows':[]};return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x386259['params']['id']}})['then'](handleEntityNotFound(_0xf5eb85,null))[_0xd5e4('0x1e')](function(_0x496443){if(_0x496443){_0x35f2f8[_0xd5e4('0x46')]=_[_0xd5e4('0x48')](db[_0xd5e4('0x61')]['rawAttributes']);_0x35f2f8[_0xd5e4('0x49')]=_[_0xd5e4('0x48')](_0x386259['query']);_0x35f2f8[_0xd5e4('0x52')]=_['intersection'](_0x35f2f8[_0xd5e4('0x46')],_0x35f2f8[_0xd5e4('0x49')]);_0x538146[_0xd5e4('0x4c')]=_[_0xd5e4('0x4a')](_0x35f2f8[_0xd5e4('0x46')],qs[_0xd5e4('0x4b')](_0x386259['query'][_0xd5e4('0x4b')]));_0x538146[_0xd5e4('0x4c')]=_0x538146['attributes']['length']?_0x538146['attributes']:_0x35f2f8[_0xd5e4('0x46')];if(!_0x386259[_0xd5e4('0x49')][_0xd5e4('0x4e')](_0xd5e4('0x4f'))){_0x538146[_0xd5e4('0x2c')]=qs[_0xd5e4('0x2c')](_0x386259[_0xd5e4('0x49')][_0xd5e4('0x2c')]);_0x538146[_0xd5e4('0x2b')]=qs[_0xd5e4('0x2b')](_0x386259[_0xd5e4('0x49')][_0xd5e4('0x2b')]);}_0x538146[_0xd5e4('0x65')]=qs[_0xd5e4('0x50')](_0x386259['query'][_0xd5e4('0x50')]);_0x538146[_0xd5e4('0x51')]=qs['filters'](_['pick'](_0x386259[_0xd5e4('0x49')],_0x35f2f8[_0xd5e4('0x52')]));_0x538146[_0xd5e4('0x51')]['MailAccountId']=_0x496443['id'];if(_0x386259[_0xd5e4('0x49')][_0xd5e4('0x54')]){_0x538146[_0xd5e4('0x51')]=_[_0xd5e4('0x55')](_0x538146['where'],{'$or':_[_0xd5e4('0x47')](_0x538146[_0xd5e4('0x4c')],function(_0xdb17ae){var _0x1d1cee={};_0x1d1cee[_0xdb17ae]={'$like':'%'+_0x386259['query'][_0xd5e4('0x54')]+'%'};return _0x1d1cee;})});}_0x538146=_[_0xd5e4('0x55')]({},_0x538146,_0x386259['options']);return db[_0xd5e4('0x61')][_0xd5e4('0x2a')]({'where':_0x538146[_0xd5e4('0x51')]})[_0xd5e4('0x1e')](function(_0x20ac4b){_0x3e58b7[_0xd5e4('0x2a')]=_0x20ac4b;if(_0x386259['query'][_0xd5e4('0x5c')]){_0x538146[_0xd5e4('0x58')]=[{'all':!![]}];}return db[_0xd5e4('0x61')][_0xd5e4('0x59')](_0x538146);})[_0xd5e4('0x1e')](function(_0x459143){_0x3e58b7['rows']=_0x459143;return _0x3e58b7;});}})[_0xd5e4('0x1e')](respondWithFilteredResult(_0xf5eb85,_0x538146))[_0xd5e4('0x5a')](handleError(_0xf5eb85,null));};exports[_0xd5e4('0x66')]=function(_0x10dc4b,_0x42cc07,_0x2af91f){return db['MailAccount'][_0xd5e4('0x5d')]({'where':{'id':_0x10dc4b[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x42cc07,null))[_0xd5e4('0x1e')](function(_0x72d54){if(_0x72d54){return _0x72d54[_0xd5e4('0x66')](_0x10dc4b[_0xd5e4('0x49')][_0xd5e4('0x67')]);}})['then'](respondWithStatusCode(_0x42cc07,null))[_0xd5e4('0x5a')](handleError(_0x42cc07,null));};exports[_0xd5e4('0x68')]=function(_0x3163b2,_0x5c7aa8,_0x3a8f73){if(_0x3163b2['body']['id']){delete _0x3163b2[_0xd5e4('0x5e')]['id'];}return db[_0xd5e4('0x41')]['find']({'where':{'id':_0x3163b2['params']['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x5c7aa8,null))[_0xd5e4('0x1e')](function(_0x3313da){if(_0x3313da){_0x3163b2[_0xd5e4('0x5e')][_0xd5e4('0x69')]=_0x3313da['id'];return db[_0xd5e4('0x6a')][_0xd5e4('0x62')](_0x3163b2[_0xd5e4('0x5e')]);}})[_0xd5e4('0x1e')](respondWithResult(_0x5c7aa8,null))[_0xd5e4('0x5a')](handleError(_0x5c7aa8,null));};exports[_0xd5e4('0x6b')]=function(_0x1fec8b,_0xb2b177,_0x3e3fb7){var _0x4fe343={'raw':![],'where':{}};var _0x3d95d7={};var _0x3787f5={'count':0x0,'rows':[]};return db[_0xd5e4('0x41')]['findOne']({'where':{'id':_0x1fec8b['params']['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0xb2b177,null))[_0xd5e4('0x1e')](function(_0x370a97){if(_0x370a97){_0x3d95d7['model']=_['keys'](db['CannedAnswer'][_0xd5e4('0x42')]);_0x3d95d7[_0xd5e4('0x49')]=_['keys'](_0x1fec8b[_0xd5e4('0x49')]);_0x3d95d7['filters']=_[_0xd5e4('0x4a')](_0x3d95d7[_0xd5e4('0x46')],_0x3d95d7[_0xd5e4('0x49')]);_0x4fe343['attributes']=_[_0xd5e4('0x4a')](_0x3d95d7[_0xd5e4('0x46')],qs[_0xd5e4('0x4b')](_0x1fec8b['query'][_0xd5e4('0x4b')]));_0x4fe343['attributes']=_0x4fe343[_0xd5e4('0x4c')][_0xd5e4('0x4d')]?_0x4fe343[_0xd5e4('0x4c')]:_0x3d95d7[_0xd5e4('0x46')];if(!_0x1fec8b[_0xd5e4('0x49')][_0xd5e4('0x4e')](_0xd5e4('0x4f'))){_0x4fe343[_0xd5e4('0x2c')]=qs['limit'](_0x1fec8b[_0xd5e4('0x49')]['limit']);_0x4fe343[_0xd5e4('0x2b')]=qs['offset'](_0x1fec8b[_0xd5e4('0x49')][_0xd5e4('0x2b')]);}_0x4fe343[_0xd5e4('0x65')]=qs[_0xd5e4('0x50')](_0x1fec8b[_0xd5e4('0x49')][_0xd5e4('0x50')]);_0x4fe343['where']=qs['filters'](_[_0xd5e4('0x53')](_0x1fec8b[_0xd5e4('0x49')],_0x3d95d7[_0xd5e4('0x52')]));_0x4fe343[_0xd5e4('0x51')][_0xd5e4('0x69')]=_0x370a97['id'];if(_0x1fec8b[_0xd5e4('0x49')][_0xd5e4('0x54')]){_0x4fe343[_0xd5e4('0x51')]=_[_0xd5e4('0x55')](_0x4fe343[_0xd5e4('0x51')],{'$or':_['map'](_0x4fe343[_0xd5e4('0x4c')],function(_0x35971f){var _0x31f98f={};_0x31f98f[_0x35971f]={'$like':'%'+_0x1fec8b['query'][_0xd5e4('0x54')]+'%'};return _0x31f98f;})});}_0x4fe343=_[_0xd5e4('0x55')]({},_0x4fe343,_0x1fec8b[_0xd5e4('0x57')]);return db[_0xd5e4('0x6a')][_0xd5e4('0x2a')]({'where':_0x4fe343[_0xd5e4('0x51')]})[_0xd5e4('0x1e')](function(_0x2fbbf5){_0x3787f5[_0xd5e4('0x2a')]=_0x2fbbf5;if(_0x1fec8b['query'][_0xd5e4('0x5c')]){_0x4fe343[_0xd5e4('0x58')]=[{'all':!![]}];}return db[_0xd5e4('0x6a')][_0xd5e4('0x59')](_0x4fe343);})['then'](function(_0x250a97){_0x3787f5[_0xd5e4('0x6c')]=_0x250a97;return _0x3787f5;});}})['then'](respondWithFilteredResult(_0xb2b177,_0x4fe343))[_0xd5e4('0x5a')](handleError(_0xb2b177,null));};exports[_0xd5e4('0x6d')]=function(_0x162516,_0x21f5e5,_0x526a04){return db[_0xd5e4('0x41')]['find']({'where':{'id':_0x162516[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x21f5e5,null))[_0xd5e4('0x1e')](function(_0x358a85){if(_0x358a85){return _0x358a85[_0xd5e4('0x6d')](_0x162516[_0xd5e4('0x49')][_0xd5e4('0x67')]);}})[_0xd5e4('0x1e')](respondWithStatusCode(_0x21f5e5,null))['catch'](handleError(_0x21f5e5,null));};exports[_0xd5e4('0x62')]=function(_0x4b7671,_0x2125fa){var _0x3cc767={'name':_0x4b7671['body']['name'],'key':_0x4b7671['body'][_0xd5e4('0x45')],'email':_0x4b7671['body'][_0xd5e4('0x6e')],'ListId':_0x4b7671['body'][_0xd5e4('0x6f')],'active':!_['isNil'](_0x4b7671['body'][_0xd5e4('0x70')])?_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x70')]:!![],'description':_0x4b7671['body'][_0xd5e4('0x71')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x72')])){if(_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x73')]){_0x3cc767[_0xd5e4('0x3c')][_0xd5e4('0x74')]=_0x3cc767[_0xd5e4('0x3e')]['user']=_0x4b7671['body'][_0xd5e4('0x75')];_0x3cc767['Imap']['password']=_0x3cc767[_0xd5e4('0x3e')]['pass']=_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x76')];}else{_0x3cc767[_0xd5e4('0x3c')][_0xd5e4('0x77')]=_0x3cc767[_0xd5e4('0x3e')]['authentication']=![];}_0x3cc767[_0xd5e4('0x3c')][_0xd5e4('0x78')]=_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x3c')][_0xd5e4('0x78')];_0x3cc767[_0xd5e4('0x3c')][_0xd5e4('0x79')]=_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x3c')][_0xd5e4('0x79')];_0x3cc767['Smtp'][_0xd5e4('0x78')]=_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x3e')][_0xd5e4('0x78')];_0x3cc767[_0xd5e4('0x3e')][_0xd5e4('0x79')]=_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x3e')][_0xd5e4('0x79')];}else{_0x3cc767['Imap'][_0xd5e4('0x7a')]=_0x3cc767[_0xd5e4('0x3e')][_0xd5e4('0x7a')]=_0x4b7671['body'][_0xd5e4('0x72')];_0x3cc767[_0xd5e4('0x3c')]['user']=_0x3cc767['Smtp'][_0xd5e4('0x74')]=_0x4b7671[_0xd5e4('0x5e')][_0xd5e4('0x75')];_0x3cc767[_0xd5e4('0x3c')][_0xd5e4('0x7b')]=_0x3cc767['Smtp'][_0xd5e4('0x7c')]=_0x4b7671['body'][_0xd5e4('0x76')];}return db[_0xd5e4('0x41')]['create'](_0x3cc767,{'include':[{'model':db[_0xd5e4('0x3d')],'as':_0xd5e4('0x3e')},{'model':db[_0xd5e4('0x3b')],'as':_0xd5e4('0x3c')}]})[_0xd5e4('0x1e')](function(_0x44d827){var _0xd47e18=_0x4b7671[_0xd5e4('0x74')][_0xd5e4('0x35')]({'plain':!![]});if(!_0xd47e18)throw new Error(_0xd5e4('0x7d'));if(_0xd47e18[_0xd5e4('0x7e')]===_0xd5e4('0x74')){var _0x5edf52=_0x44d827[_0xd5e4('0x35')]({'plain':!![]});return db[_0xd5e4('0x7f')]['find']({'where':{'name':_0xd5e4('0x36'),'userProfileId':_0xd47e18[_0xd5e4('0x80')]},'raw':!![]})[_0xd5e4('0x1e')](function(_0x288af8){if(_0x288af8&&_0x288af8[_0xd5e4('0x81')]===0x0){return db[_0xd5e4('0x37')][_0xd5e4('0x62')]({'name':_0x5edf52[_0xd5e4('0x39')],'resourceId':_0x5edf52['id'],'type':_0x288af8[_0xd5e4('0x39')],'sectionId':_0x288af8['id']},{})[_0xd5e4('0x1e')](function(){return _0x44d827;});}else{return _0x44d827;}})[_0xd5e4('0x5a')](function(_0x35b5b2){logger[_0xd5e4('0x21')](_0xd5e4('0x82'),_0x35b5b2);throw _0x35b5b2;});}return _0x44d827;})[_0xd5e4('0x1e')](respondWithResult(_0x2125fa,0xc9))[_0xd5e4('0x5a')](handleError(_0x2125fa,null));};exports['getImap']=function(_0x3dfee0,_0x313dee,_0x57bab9){return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x3dfee0['params']['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x313dee,null))[_0xd5e4('0x1e')](function(_0x3099af){if(_0x3099af){return _0x3099af['getImap']();}return null;})[_0xd5e4('0x1e')](respondWithResult(_0x313dee,null))[_0xd5e4('0x5a')](handleError(_0x313dee,null));};exports[_0xd5e4('0x83')]=function(_0x4b274d,_0x377535,_0x4355bc){if(_0x4b274d[_0xd5e4('0x5e')]['id']){delete _0x4b274d[_0xd5e4('0x5e')]['id'];}return db[_0xd5e4('0x41')][_0xd5e4('0x5d')]({'where':{'id':_0x4b274d[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x377535,null))[_0xd5e4('0x1e')](function(_0x47785e){if(_0x47785e){_0x4b274d[_0xd5e4('0x5e')]['MailAccountId']=_0x47785e['id'];return db[_0xd5e4('0x3b')]['create'](_0x4b274d[_0xd5e4('0x5e')]);}})['then'](respondWithResult(_0x377535,null))[_0xd5e4('0x5a')](handleError(_0x377535,null));};exports['removeImap']=function(_0x576e04,_0x2274f6,_0x1b3a78){return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x576e04[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x2274f6,null))[_0xd5e4('0x1e')](function(_0x13363a){if(_0x13363a){return _0x13363a[_0xd5e4('0x84')](null);}return null;})[_0xd5e4('0x1e')](respondWithStatusCode(_0x2274f6,null))['catch'](handleError(_0x2274f6,null));};exports[_0xd5e4('0x85')]=function(_0x2867ff,_0x51adbd,_0x2ff1e8){return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x2867ff[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x51adbd,null))[_0xd5e4('0x1e')](function(_0x1f3209){if(_0x1f3209){return _0x1f3209[_0xd5e4('0x85')]();}return null;})[_0xd5e4('0x1e')](respondWithResult(_0x51adbd,null))[_0xd5e4('0x5a')](handleError(_0x51adbd,null));};exports['addSmtp']=function(_0x179cb6,_0x185269,_0x5f290f){if(_0x179cb6['body']['id']){delete _0x179cb6[_0xd5e4('0x5e')]['id'];}return db['MailAccount'][_0xd5e4('0x5d')]({'where':{'id':_0x179cb6[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x185269,null))[_0xd5e4('0x1e')](function(_0x1b062a){if(_0x1b062a){_0x179cb6['body']['MailAccountId']=_0x1b062a['id'];return db['MailServerOut'][_0xd5e4('0x62')](_0x179cb6['body']);}})[_0xd5e4('0x1e')](respondWithResult(_0x185269,null))[_0xd5e4('0x5a')](handleError(_0x185269,null));};exports['removeSmtp']=function(_0xebfcf8,_0x38ee30,_0x56550f){return db['MailAccount'][_0xd5e4('0x64')]({'where':{'id':_0xebfcf8[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x38ee30,null))['then'](function(_0x115c0b){if(_0x115c0b){return _0x115c0b[_0xd5e4('0x86')](null);}return null;})[_0xd5e4('0x1e')](respondWithStatusCode(_0x38ee30,null))['catch'](handleError(_0x38ee30,null));};exports[_0xd5e4('0x87')]=function(_0x37d5aa,_0x237676,_0x1608f2){return db[_0xd5e4('0x88')][_0xd5e4('0x5d')]({'where':{'id':_0x37d5aa[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x237676,null))[_0xd5e4('0x1e')](function(_0xb67ca6){if(_0xb67ca6){return _0xb67ca6[_0xd5e4('0x87')](_0x37d5aa[_0xd5e4('0x5e')][_0xd5e4('0x67')],_[_0xd5e4('0x89')](_0x37d5aa[_0xd5e4('0x5e')],[_0xd5e4('0x67'),'id'])||{});}})[_0xd5e4('0x1e')](respondWithResult(_0x237676,null))[_0xd5e4('0x5a')](handleError(_0x237676,null));};exports[_0xd5e4('0x8a')]=function(_0x79d87c,_0x122636,_0x30c15b){var _0x15c510={'raw':![],'where':{}};var _0x3b1293={};var _0x237d8a={'count':0x0,'rows':[]};return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x79d87c[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x122636,null))['then'](function(_0x2ccf55){if(_0x2ccf55){_0x3b1293[_0xd5e4('0x46')]=_[_0xd5e4('0x48')](db['MailInteraction'][_0xd5e4('0x42')]);_0x3b1293[_0xd5e4('0x49')]=_[_0xd5e4('0x48')](_0x79d87c[_0xd5e4('0x49')]);_0x3b1293[_0xd5e4('0x52')]=_[_0xd5e4('0x4a')](_0x3b1293['model'],_0x3b1293[_0xd5e4('0x49')]);_0x15c510[_0xd5e4('0x4c')]=_[_0xd5e4('0x4a')](_0x3b1293[_0xd5e4('0x46')],qs[_0xd5e4('0x4b')](_0x79d87c['query'][_0xd5e4('0x4b')]));_0x15c510[_0xd5e4('0x4c')]=_0x15c510[_0xd5e4('0x4c')]['length']?_0x15c510['attributes']:_0x3b1293[_0xd5e4('0x46')];if(!_0x79d87c[_0xd5e4('0x49')][_0xd5e4('0x4e')]('nolimit')){_0x15c510[_0xd5e4('0x2c')]=qs['limit'](_0x79d87c[_0xd5e4('0x49')][_0xd5e4('0x2c')]);_0x15c510[_0xd5e4('0x2b')]=qs[_0xd5e4('0x2b')](_0x79d87c[_0xd5e4('0x49')][_0xd5e4('0x2b')]);}_0x15c510[_0xd5e4('0x65')]=qs['sort'](_0x79d87c['query'][_0xd5e4('0x50')]);_0x15c510[_0xd5e4('0x51')]=qs[_0xd5e4('0x52')](_[_0xd5e4('0x53')](_0x79d87c[_0xd5e4('0x49')],_0x3b1293[_0xd5e4('0x52')]));_0x15c510[_0xd5e4('0x51')][_0xd5e4('0x69')]=_0x2ccf55['id'];if(_0x79d87c['query'][_0xd5e4('0x54')]){_0x15c510['where']=_['merge'](_0x15c510['where'],{'$or':_['map'](_0x15c510[_0xd5e4('0x4c')],function(_0x3ac364){var _0x4afd69={};_0x4afd69[_0x3ac364]={'$like':'%'+_0x79d87c[_0xd5e4('0x49')]['filter']+'%'};return _0x4afd69;})});}_0x15c510=_[_0xd5e4('0x55')]({},_0x15c510,_0x79d87c[_0xd5e4('0x57')]);return db[_0xd5e4('0x88')][_0xd5e4('0x2a')]({'where':_0x15c510['where']})[_0xd5e4('0x1e')](function(_0x51f09d){_0x237d8a[_0xd5e4('0x2a')]=_0x51f09d;if(_0x79d87c[_0xd5e4('0x49')][_0xd5e4('0x5c')]){_0x15c510['include']=[{'model':db['CmContact'],'as':_0xd5e4('0x8b'),'required':![]},{'model':db[_0xd5e4('0x8c')],'as':_0xd5e4('0x8d'),'attributes':[_0xd5e4('0x39'),_0xd5e4('0x8e'),'internal'],'required':![]},{'model':db[_0xd5e4('0x8f')],'as':_0xd5e4('0x90'),'attributes':['id',_0xd5e4('0x39'),_0xd5e4('0x91')],'where':_0x79d87c[_0xd5e4('0x49')]['tag']?{'id':_0x79d87c['query'][_0xd5e4('0x92')]}:undefined,'required':_0x79d87c[_0xd5e4('0x49')][_0xd5e4('0x92')]?!![]:![]}];}return db[_0xd5e4('0x88')][_0xd5e4('0x59')](_0x15c510);})['then'](function(_0x3f15e0){_0x237d8a[_0xd5e4('0x6c')]=_0x3f15e0;return _0x237d8a;});}})[_0xd5e4('0x1e')](respondWithFilteredResult(_0x122636,_0x15c510))[_0xd5e4('0x5a')](handleError(_0x122636,null));};exports[_0xd5e4('0x93')]=function(_0xeae74e,_0x28e111,_0x59a06c){return db[_0xd5e4('0x41')]['findOne']({'where':{'id':_0xeae74e['params']['id']}})['then'](handleEntityNotFound(_0x28e111,null))[_0xd5e4('0x1e')](function(_0x2d1648){if(_0x2d1648){return db[_0xd5e4('0x94')][_0xd5e4('0x95')](function(_0x35d1cc){return db['MailApplication'][_0xd5e4('0x34')]({'where':{'MailAccountId':_0xeae74e[_0xd5e4('0x5b')]['id']},'transaction':_0x35d1cc})[_0xd5e4('0x1e')](function(_0x2d4840){var _0x31b165=_[_0xd5e4('0x47')](_0xeae74e[_0xd5e4('0x5e')],function(_0xc7e117){_0xc7e117['MailAccountId']=_0xeae74e[_0xd5e4('0x5b')]['id'];return _0xc7e117;});return db['MailApplication'][_0xd5e4('0x96')](_0x31b165,{'transaction':_0x35d1cc});});})['then'](function(){return db[_0xd5e4('0x97')]['findAndCountAll']({'where':{'MailAccountId':_0xeae74e[_0xd5e4('0x5b')]['id']},'order':_0xd5e4('0x98')});});}})['then'](respondWithResult(_0x28e111,null))[_0xd5e4('0x5a')](handleError(_0x28e111,null));};exports[_0xd5e4('0x99')]=function(_0x3312e1,_0x174c50,_0x3804c3){var _0x22a671={};var _0xcd9648={};var _0x29fb9a;var _0x3f1b2a;return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x3312e1[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x174c50,null))[_0xd5e4('0x1e')](function(_0x3f6c3a){if(_0x3f6c3a){_0x29fb9a=_0x3f6c3a;_0xcd9648[_0xd5e4('0x46')]=_[_0xd5e4('0x48')](db['MailApplication'][_0xd5e4('0x42')]);_0xcd9648[_0xd5e4('0x49')]=_['keys'](_0x3312e1['query']);_0xcd9648[_0xd5e4('0x52')]=_[_0xd5e4('0x4a')](_0xcd9648[_0xd5e4('0x46')],_0xcd9648[_0xd5e4('0x49')]);_0x22a671[_0xd5e4('0x4c')]=_['intersection'](_0xcd9648[_0xd5e4('0x46')],qs[_0xd5e4('0x4b')](_0x3312e1[_0xd5e4('0x49')][_0xd5e4('0x4b')]));_0x22a671['attributes']=_0x22a671[_0xd5e4('0x4c')][_0xd5e4('0x4d')]?_0x22a671['attributes']:_0xcd9648['model'];_0x22a671['order']=qs[_0xd5e4('0x50')](_0x3312e1[_0xd5e4('0x49')]['sort']);_0x22a671[_0xd5e4('0x51')]=qs[_0xd5e4('0x52')](_['pick'](_0x3312e1[_0xd5e4('0x49')],_0xcd9648[_0xd5e4('0x52')]));if(_0x3312e1[_0xd5e4('0x49')][_0xd5e4('0x54')]){_0x22a671['where']=_[_0xd5e4('0x55')](_0x22a671[_0xd5e4('0x51')],{'$or':_[_0xd5e4('0x47')](_0x22a671[_0xd5e4('0x4c')],function(_0x8783cf){var _0x913d87={};_0x913d87[_0x8783cf]={'$like':'%'+_0x3312e1[_0xd5e4('0x49')]['filter']+'%'};return _0x913d87;})});}_0x22a671=_['merge']({},_0x22a671,_0x3312e1['options']);return _0x29fb9a['getApplications'](_0x22a671);}})[_0xd5e4('0x1e')](function(_0x47da8e){if(_0x47da8e){_0x3f1b2a=_0x47da8e[_0xd5e4('0x4d')];if(!_0x3312e1['query'][_0xd5e4('0x4e')]('nolimit')){_0x22a671[_0xd5e4('0x2c')]=qs[_0xd5e4('0x2c')](_0x3312e1[_0xd5e4('0x49')][_0xd5e4('0x2c')]);_0x22a671[_0xd5e4('0x2b')]=qs[_0xd5e4('0x2b')](_0x3312e1['query'][_0xd5e4('0x2b')]);}return _0x29fb9a['getApplications'](_0x22a671);}})[_0xd5e4('0x1e')](function(_0x75725c){if(_0x75725c){return _0x75725c?{'count':_0x3f1b2a,'rows':_0x75725c}:null;}})[_0xd5e4('0x1e')](respondWithResult(_0x174c50,null))[_0xd5e4('0x5a')](handleError(_0x174c50,null));};exports[_0xd5e4('0x9a')]=function(_0x4e08e7,_0xda82b,_0x47524a){var _0x43d305={'raw':!![],'where':{}};var _0x54450f={};var _0x5e0c68={'count':0x0,'rows':[]};return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x4e08e7[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0xda82b,null))[_0xd5e4('0x1e')](function(_0x10de2d){if(_0x10de2d){_0x54450f[_0xd5e4('0x46')]=_[_0xd5e4('0x48')](db[_0xd5e4('0x9b')][_0xd5e4('0x42')]);_0x54450f[_0xd5e4('0x49')]=_['keys'](_0x4e08e7[_0xd5e4('0x49')]);_0x54450f[_0xd5e4('0x52')]=_[_0xd5e4('0x4a')](_0x54450f['model'],_0x54450f[_0xd5e4('0x49')]);_0x43d305[_0xd5e4('0x4c')]=_['intersection'](_0x54450f[_0xd5e4('0x46')],qs[_0xd5e4('0x4b')](_0x4e08e7[_0xd5e4('0x49')][_0xd5e4('0x4b')]));_0x43d305[_0xd5e4('0x4c')]=_0x43d305['attributes'][_0xd5e4('0x4d')]?_0x43d305[_0xd5e4('0x4c')]:_0x54450f[_0xd5e4('0x46')];if(!_0x4e08e7[_0xd5e4('0x49')]['hasOwnProperty'](_0xd5e4('0x4f'))){_0x43d305[_0xd5e4('0x2c')]=qs[_0xd5e4('0x2c')](_0x4e08e7[_0xd5e4('0x49')][_0xd5e4('0x2c')]);_0x43d305[_0xd5e4('0x2b')]=qs[_0xd5e4('0x2b')](_0x4e08e7['query'][_0xd5e4('0x2b')]);}_0x43d305['order']=qs['sort'](_0x4e08e7['query']['sort']);_0x43d305[_0xd5e4('0x51')]=qs['filters'](_[_0xd5e4('0x53')](_0x4e08e7[_0xd5e4('0x49')],_0x54450f[_0xd5e4('0x52')]));_0x43d305[_0xd5e4('0x51')][_0xd5e4('0x69')]=_0x10de2d['id'];if(_0x4e08e7['query'][_0xd5e4('0x54')]){_0x43d305[_0xd5e4('0x51')]=_['merge'](_0x43d305['where'],{'$or':_['map'](_0x43d305[_0xd5e4('0x4c')],function(_0x1bdfad){var _0x474d4f={};_0x474d4f[_0x1bdfad]={'$like':'%'+_0x4e08e7[_0xd5e4('0x49')][_0xd5e4('0x54')]+'%'};return _0x474d4f;})});}if(_0x4e08e7['query'][_0xd5e4('0x9c')]){var _0x30daea=_0x4e08e7['query']['$gte'][_0xd5e4('0x9d')](',');var _0x5e76a9={};_0x5e76a9[_0x30daea[0x0]]={'$gte':moment(_0x30daea[0x1])[_0xd5e4('0x9e')](_0xd5e4('0x9f'))};_0x43d305[_0xd5e4('0x51')]=_[_0xd5e4('0x55')](_0x43d305['where'],_0x5e76a9);}_0x43d305=_[_0xd5e4('0x55')]({},_0x43d305,_0x4e08e7[_0xd5e4('0x57')]);return db['MailMessage'][_0xd5e4('0x2a')]({'where':_0x43d305[_0xd5e4('0x51')]})[_0xd5e4('0x1e')](function(_0x33dda3){_0x5e0c68['count']=_0x33dda3;if(_0x4e08e7['query']['includeAll']){_0x43d305['include']=[{'all':!![]}];}return db[_0xd5e4('0x9b')][_0xd5e4('0x59')](_0x43d305);})[_0xd5e4('0x1e')](function(_0x500a6c){_0x5e0c68[_0xd5e4('0x6c')]=_0x500a6c;return _0x5e0c68;});}})[_0xd5e4('0x1e')](respondWithFilteredResult(_0xda82b,_0x43d305))[_0xd5e4('0x5a')](handleError(_0xda82b,null));};exports[_0xd5e4('0x3a')]=function(_0x2ede56,_0x58a324,_0x2f0d41){var _0x5aa46f,_0x8ee521={},_0x3d676d;if(_0x2ede56[_0xd5e4('0x5e')]['to']){_0x3d676d=_0x2ede56[_0xd5e4('0x5e')]['to']['split'](',')[0x0];}return db[_0xd5e4('0x41')]['find']({'where':{'id':_0x2ede56[_0xd5e4('0x5b')]['id']},'include':[{'model':db[_0xd5e4('0xa0')],'as':_0xd5e4('0xa1'),'include':[{'model':db[_0xd5e4('0xa2')],'as':'Contacts','where':{'email':_0x3d676d},'limit':0x1,'order':[[_0xd5e4('0xa3'),'DESC']]}]},{'model':db[_0xd5e4('0x3d')],'as':_0xd5e4('0x3e'),'raw':!![]}]})['then'](handleEntityNotFound(_0x58a324,null))[_0xd5e4('0x1e')](function(_0x141f0d){if(_0x141f0d){_0x5aa46f=_0x141f0d;if(_0x141f0d[_0xd5e4('0x3e')]){if(_[_0xd5e4('0xa4')](_0x2ede56['body'][_0xd5e4('0xa5')])){_0x2ede56['body'][_0xd5e4('0xa5')]=util[_0xd5e4('0x9e')](_0xd5e4('0xa6'),_0x141f0d[_0xd5e4('0x39')],_0x141f0d[_0xd5e4('0x6e')]||_0x141f0d[_0xd5e4('0x3e')][_0xd5e4('0x74')]);}if(_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xa7')]&&_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xa7')]['length']){for(var _0x38e357=0x0;_0x38e357<_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xa7')]['length'];_0x38e357+=0x1){_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xa7')][_0x38e357]={'filename':_0x2ede56[_0xd5e4('0x5e')]['attachments'][_0x38e357][_0xd5e4('0x39')],'path':path[_0xd5e4('0xa8')](config[_0xd5e4('0xa9')],_0xd5e4('0xaa'),_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xa7')][_0x38e357][_0xd5e4('0xab')])};}}var _0x107dc3={'tls':{'rejectUnauthorized':![]}};if(_[_0xd5e4('0xa4')](_0x141f0d['Smtp'][_0xd5e4('0x7a')])){if(_0x141f0d[_0xd5e4('0x3e')][_0xd5e4('0x77')]){_0x107dc3[_0xd5e4('0xac')]={'user':_0x141f0d[_0xd5e4('0x3e')]['user'],'pass':_0x141f0d['Smtp'][_0xd5e4('0x7c')]};}_0x107dc3[_0xd5e4('0x78')]=_0x141f0d[_0xd5e4('0x3e')][_0xd5e4('0x78')];_0x107dc3[_0xd5e4('0x79')]=_0x141f0d[_0xd5e4('0x3e')]['port'];_0x107dc3['secure']=_0x141f0d[_0xd5e4('0x3e')][_0xd5e4('0xad')];}else{_0x107dc3[_0xd5e4('0x7a')]=_0x141f0d['Smtp'][_0xd5e4('0x7a')];_0x107dc3[_0xd5e4('0xac')]={'user':_0x141f0d['Smtp'][_0xd5e4('0x74')],'pass':_0x141f0d['Smtp'][_0xd5e4('0x7c')]};}return respondWithRpcPromise(_0xd5e4('0xae'),_0xd5e4('0xaf'),{'account':_0x107dc3,'message':_0x2ede56[_0xd5e4('0x5e')]});}else{throw new Error(_0xd5e4('0xb0'));}}})[_0xd5e4('0x1e')](function(_0x5cbc67){if(_0x5cbc67){_0x8ee521=_0x5cbc67;if(_0x5aa46f[_0xd5e4('0xa1')]){if(_0x5aa46f[_0xd5e4('0xa1')]['Contacts']['length']){return _0x5aa46f['List'][_0xd5e4('0xb1')][0x0];}else{return db[_0xd5e4('0xa2')]['create'](_[_0xd5e4('0x16')](_0x2ede56[_0xd5e4('0x5e')],{'firstName':_0x2ede56['body']['to'],'email':_0x2ede56[_0xd5e4('0x5e')]['to'],'phone':_0x2ede56[_0xd5e4('0x5e')]['to'],'ListId':_0x5aa46f[_0xd5e4('0x6f')]}));}}else{throw new Error(_0xd5e4('0xb0'));}}})[_0xd5e4('0x1e')](function(_0x51bbc2){if(_0x51bbc2){var _0x3089af={'UserId':_0x2ede56[_0xd5e4('0x74')]['id'],'ContactId':_0x51bbc2['id'],'MailAccountId':_0x5aa46f['id'],'inReplyTo':_0x8ee521[_0xd5e4('0xb2')],'to':_0x2ede56[_0xd5e4('0x5e')]['from'],'cc':_0x2ede56['body']['cc'],'subject':_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xb3')],'attach':_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xb4')],'firstMsgDirection':_0xd5e4('0xb5'),'lastMsgAt':moment()[_0xd5e4('0x9e')](_0xd5e4('0x9f')),'lastMsgDirection':'out','lastMsgBody':_0x2ede56[_0xd5e4('0x5e')]['body'],'Messages':[_['merge'](_0x2ede56[_0xd5e4('0x5e')],{'messageId':_0x8ee521[_0xd5e4('0xb2')],'sentAt':moment()[_0xd5e4('0x9e')](_0xd5e4('0x9f')),'read':!![],'MailAccountId':_0x5aa46f['id'],'UserId':_0x2ede56[_0xd5e4('0x74')]['id'],'ContactId':_0x51bbc2['id']})]};if(_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xb6')]){_0x3089af=_[_0xd5e4('0x55')](_0x3089af,_0x2ede56[_0xd5e4('0x5e')][_0xd5e4('0xb6')]);}return db[_0xd5e4('0x88')][_0xd5e4('0x62')](_0x3089af,{'include':[{'model':db[_0xd5e4('0x9b')],'as':'Messages'}]});}})['then'](respondWithResult(_0x58a324,null))[_0xd5e4('0x5a')](handleError(_0x58a324,null));};exports['verifySmtp']=function(_0x3a648b,_0x84de55,_0x21681d){return db[_0xd5e4('0x41')][_0xd5e4('0x5d')]({'where':{'id':_0x3a648b['params']['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x84de55,null))[_0xd5e4('0x1e')](function(_0x11561e){if(_0x11561e&&_0x11561e[_0xd5e4('0x3e')]){var _0x22ff51={'id':_0x11561e['id'],'tls':{'rejectUnauthorized':![]}};if(_0x11561e[_0xd5e4('0x3e')][_0xd5e4('0x7a')]){_0x22ff51[_0xd5e4('0x7a')]=_0x11561e[_0xd5e4('0x3e')][_0xd5e4('0x7a')];}else{_0x22ff51[_0xd5e4('0x78')]=_0x11561e[_0xd5e4('0x3e')][_0xd5e4('0x78')];_0x22ff51[_0xd5e4('0x79')]=_0x11561e[_0xd5e4('0x3e')][_0xd5e4('0x79')];_0x22ff51['secure']=_0x11561e[_0xd5e4('0x3e')][_0xd5e4('0xad')];}if(_0x11561e[_0xd5e4('0x3e')]['authentication']){_0x22ff51[_0xd5e4('0xac')]={'user':_0x11561e[_0xd5e4('0x3e')][_0xd5e4('0x74')],'pass':_0x11561e[_0xd5e4('0x3e')][_0xd5e4('0x7c')]};}return respondWithRpcPromise('VerifySmtp',_0xd5e4('0xb7'),{'account':_0x22ff51});}})[_0xd5e4('0x1e')](respondWithResult(_0x84de55,null))[_0xd5e4('0x5a')](handleError(_0x84de55,null));};exports[_0xd5e4('0x34')]=function(_0x177978,_0x1d66ed){return db[_0xd5e4('0x41')][_0xd5e4('0x5d')]({'where':{'id':_0x177978[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x1d66ed,null))[_0xd5e4('0x1e')](function(_0x140eb1){if(_0x140eb1&&_0x140eb1[_0xd5e4('0x7a')]){throw new db[(_0xd5e4('0x1b'))][(_0xd5e4('0xb8'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x140eb1;})[_0xd5e4('0x1e')](removeEntity(_0x1d66ed,null))[_0xd5e4('0x5a')](handleError(_0x1d66ed,null));};exports[_0xd5e4('0xb9')]=function(_0x145306,_0x4cbc8b,_0x4a2eb4){return db[_0xd5e4('0x41')][_0xd5e4('0x5d')]({'where':{'id':_0x145306[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x4cbc8b,null))[_0xd5e4('0x1e')](function(_0x431faf){if(_0x431faf){return _0x431faf[_0xd5e4('0xb9')](_0x145306['body']['ids'],_[_0xd5e4('0x89')](_0x145306[_0xd5e4('0x5e')],['ids','id'])||{})['spread'](function(_0x5a7257){for(var _0x42126a=0x0;_0x42126a<_0x145306[_0xd5e4('0x5e')][_0xd5e4('0x67')][_0xd5e4('0x4d')];_0x42126a+=0x1){socket['emit'](_0xd5e4('0xba'),{'UserId':_0x145306[_0xd5e4('0x5e')][_0xd5e4('0x67')][_0x42126a],'MailAccountId':_0x145306['params']['id']});}return _0x5a7257;});}})[_0xd5e4('0x1e')](respondWithResult(_0x4cbc8b,null))['catch'](handleError(_0x4cbc8b,null));};exports[_0xd5e4('0xbb')]=function(_0x2babd9,_0x3f6d09,_0x3b11e2){return db['MailAccount'][_0xd5e4('0x5d')]({'where':{'id':_0x2babd9['params']['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x3f6d09,null))[_0xd5e4('0x1e')](function(_0x445f6f){if(_0x445f6f){return _0x445f6f['removeAgents'](_0x2babd9['query'][_0xd5e4('0x67')])[_0xd5e4('0x1e')](function(){if(_['isArray'](_0x2babd9[_0xd5e4('0x49')]['ids'])){for(var _0x6900b=0x0;_0x6900b<_0x2babd9['query'][_0xd5e4('0x67')]['length'];_0x6900b+=0x1){socket[_0xd5e4('0xbc')](_0xd5e4('0xbd'),{'UserId':Number(_0x2babd9[_0xd5e4('0x49')]['ids'][_0x6900b]),'MailAccountId':Number(_0x2babd9['params']['id'])});}}else{socket['emit'](_0xd5e4('0xbd'),{'UserId':Number(_0x2babd9[_0xd5e4('0x49')]['ids']),'MailAccountId':Number(_0x2babd9[_0xd5e4('0x5b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3f6d09,null))[_0xd5e4('0x5a')](handleError(_0x3f6d09,null));};exports['getAgents']=function(_0x1eed2f,_0x58229d,_0x1070d7){var _0x36aba2={};var _0x33bf73={};var _0x44cdbd;var _0x3a460d;return db[_0xd5e4('0x41')][_0xd5e4('0x64')]({'where':{'id':_0x1eed2f[_0xd5e4('0x5b')]['id']}})[_0xd5e4('0x1e')](handleEntityNotFound(_0x58229d,null))[_0xd5e4('0x1e')](function(_0x5d53de){if(_0x5d53de){_0x44cdbd=_0x5d53de;_0x33bf73['model']=_[_0xd5e4('0x48')](db[_0xd5e4('0x8c')][_0xd5e4('0x42')]);_0x33bf73[_0xd5e4('0x49')]=_[_0xd5e4('0x48')](_0x1eed2f[_0xd5e4('0x49')]);_0x33bf73['filters']=_[_0xd5e4('0x4a')](_0x33bf73[_0xd5e4('0x46')],_0x33bf73['query']);_0x36aba2[_0xd5e4('0x4c')]=_[_0xd5e4('0x4a')](_0x33bf73[_0xd5e4('0x46')],qs[_0xd5e4('0x4b')](_0x1eed2f['query'][_0xd5e4('0x4b')]));_0x36aba2[_0xd5e4('0x4c')]=_0x36aba2['attributes'][_0xd5e4('0x4d')]?_0x36aba2[_0xd5e4('0x4c')]:_0x33bf73[_0xd5e4('0x46')];_0x36aba2[_0xd5e4('0x65')]=qs[_0xd5e4('0x50')](_0x1eed2f[_0xd5e4('0x49')]['sort']);_0x36aba2[_0xd5e4('0x51')]=qs[_0xd5e4('0x52')](_[_0xd5e4('0x53')](_0x1eed2f[_0xd5e4('0x49')],_0x33bf73[_0xd5e4('0x52')]));if(_0x1eed2f[_0xd5e4('0x49')][_0xd5e4('0x54')]){_0x36aba2['where']=_[_0xd5e4('0x55')](_0x36aba2[_0xd5e4('0x51')],{'$or':_['map'](_0x36aba2[_0xd5e4('0x4c')],function(_0x2a82de){var _0x294788={};_0x294788[_0x2a82de]={'$like':'%'+_0x1eed2f['query'][_0xd5e4('0x54')]+'%'};return _0x294788;})});}_0x36aba2=_[_0xd5e4('0x55')]({},_0x36aba2,_0x1eed2f[_0xd5e4('0x57')]);return _0x44cdbd[_0xd5e4('0xbe')](_0x36aba2);}})['then'](function(_0x49e0b7){if(_0x49e0b7){_0x3a460d=_0x49e0b7[_0xd5e4('0x4d')];if(!_0x1eed2f['query'][_0xd5e4('0x4e')](_0xd5e4('0x4f'))){_0x36aba2[_0xd5e4('0x2c')]=qs['limit'](_0x1eed2f[_0xd5e4('0x49')][_0xd5e4('0x2c')]);_0x36aba2[_0xd5e4('0x2b')]=qs['offset'](_0x1eed2f['query']['offset']);}return _0x44cdbd[_0xd5e4('0xbe')](_0x36aba2);}})[_0xd5e4('0x1e')](function(_0x400de0){if(_0x400de0){return _0x400de0?{'count':_0x3a460d,'rows':_0x400de0}:null;}})[_0xd5e4('0x1e')](respondWithResult(_0x58229d,null))[_0xd5e4('0x5a')](handleError(_0x58229d,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 391154b..3986729 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 _0xf18a=['setMaxListeners','save','update','emit','hook','events','../../mysqldb','MailAccount'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf18a,0x19d));var _0xaf18=function(_0x141b88,_0x5c4afd){_0x141b88=_0x141b88-0x0;var _0xf77a2=_0xf18a[_0x141b88];return _0xf77a2;};'use strict';var EventEmitter=require(_0xaf18('0x0'));var MailAccount=require(_0xaf18('0x1'))['db'][_0xaf18('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xaf18('0x3')](0x0);var events={'afterCreate':_0xaf18('0x4'),'afterUpdate':_0xaf18('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d085e){return function(_0x5cb2b2,_0x290864,_0x21d905){MailAccountEvents[_0xaf18('0x6')](_0x4d085e+':'+_0x5cb2b2['id'],_0x5cb2b2);MailAccountEvents['emit'](_0x4d085e,_0x5cb2b2);_0x21d905(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xaf18('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +var _0x9bbe=['hook','exports','../../mysqldb','MailAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9bbe,0xc2));var _0xe9bb=function(_0x9454b9,_0x455c65){_0x9454b9=_0x9454b9-0x0;var _0x3f92be=_0x9bbe[_0x9454b9];return _0x3f92be;};'use strict';var EventEmitter=require('events');var MailAccount=require(_0xe9bb('0x0'))['db'][_0xe9bb('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xe9bb('0x2')](0x0);var events={'afterCreate':_0xe9bb('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2ca9c4){return function(_0x166e04,_0x39428c,_0x1d3290){MailAccountEvents[_0xe9bb('0x4')](_0x2ca9c4+':'+_0x166e04['id'],_0x166e04);MailAccountEvents[_0xe9bb('0x4')](_0x2ca9c4,_0x166e04);_0x1d3290(null);};}for(var e in events){if(events[_0xe9bb('0x5')](e)){var event=events[e];MailAccount[_0xe9bb('0x6')](e,emitEvent(event));}}module[_0xe9bb('0x7')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 7561350..0831562 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 _0x7782=['../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x42e25e,_0x46cfd1){var _0x1ed3a6=function(_0x3558e8){while(--_0x3558e8){_0x42e25e['push'](_0x42e25e['shift']());}};_0x1ed3a6(++_0x46cfd1);}(_0x7782,0xa2));var _0x2778=function(_0x3f3d52,_0x32ba94){_0x3f3d52=_0x3f3d52-0x0;var _0x53f9eb=_0x7782[_0x3f3d52];return _0x53f9eb;};'use strict';var _=require('lodash');var util=require(_0x2778('0x0'));var logger=require('../../config/logger')(_0x2778('0x1'));var moment=require(_0x2778('0x2'));var BPromise=require(_0x2778('0x3'));var rp=require(_0x2778('0x4'));var fs=require('fs');var path=require(_0x2778('0x5'));var rimraf=require(_0x2778('0x6'));var config=require(_0x2778('0x7'));var attributes=require(_0x2778('0x8'));module[_0x2778('0x9')]=function(_0x5e5216,_0x420206){return _0x5e5216[_0x2778('0xa')](_0x2778('0xb'),attributes,{'tableName':_0x2778('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f73=['request-promise','rimraf','../../config/environment','./mailAccount.attributes','define','mail_accounts','lodash','util','moment'];(function(_0x219b38,_0x48f334){var _0xb043f1=function(_0x4545bf){while(--_0x4545bf){_0x219b38['push'](_0x219b38['shift']());}};_0xb043f1(++_0x48f334);}(_0x3f73,0xc3));var _0x33f7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x3f73[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x33f7('0x0'));var util=require(_0x33f7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x33f7('0x2'));var BPromise=require('bluebird');var rp=require(_0x33f7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x33f7('0x4'));var config=require(_0x33f7('0x5'));var attributes=require(_0x33f7('0x6'));module['exports']=function(_0x2c8ea9,_0x227540){return _0x2c8ea9[_0x33f7('0x7')]('MailAccount',attributes,{'tableName':_0x33f7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 8b042b2..ab862f9 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 _0xd84c=['CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','Contacts','DESC','MailApplication','Applications','get','omit','List','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','spread','interaction','created','attachments','bcc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMailAccount','MailAccount','options','attributes','limit','include','map','model','catch','find','raw','where','ShowMailAccount','body','mail'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0xd84c,0x102));var _0xcd84=function(_0x33dc07,_0x47f804){_0x33dc07=_0x33dc07-0x0;var _0x48af09=_0xd84c[_0x33dc07];return _0x48af09;};'use strict';var _=require(_0xcd84('0x0'));var util=require(_0xcd84('0x1'));var moment=require(_0xcd84('0x2'));var BPromise=require(_0xcd84('0x3'));var rs=require(_0xcd84('0x4'));var fs=require('fs');var Redis=require(_0xcd84('0x5'));var db=require(_0xcd84('0x6'))['db'];var utils=require(_0xcd84('0x7'));var logger=require(_0xcd84('0x8'))('rpc');var config=require(_0xcd84('0x9'));var jayson=require(_0xcd84('0xa'));var client=jayson[_0xcd84('0xb')][_0xcd84('0xc')]({'port':0x232c});config['redis']=_[_0xcd84('0xd')](config[_0xcd84('0xe')],{'host':_0xcd84('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd84('0xe')]));require(_0xcd84('0x10'))[_0xcd84('0x11')](socket);function respondWithRpcPromise(_0x31bce0,_0x50df85,_0xe2c10d){return new BPromise(function(_0xa36b98,_0x52c4c1){return client[_0xcd84('0x12')](_0x31bce0,_0xe2c10d)[_0xcd84('0x13')](function(_0x286306){logger['info'](_0xcd84('0x14'),_0x50df85,_0xcd84('0x15'));logger[_0xcd84('0x16')](_0xcd84('0x17'),_0x50df85,'request\x20sent',JSON[_0xcd84('0x18')](_0x286306));if(_0x286306[_0xcd84('0x19')]){if(_0x286306[_0xcd84('0x19')][_0xcd84('0x1a')]===0x1f4){logger[_0xcd84('0x19')](_0xcd84('0x14'),_0x50df85,_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);return _0x52c4c1(_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);}logger[_0xcd84('0x19')](_0xcd84('0x14'),_0x50df85,_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);return _0xa36b98(_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);}else{logger[_0xcd84('0x1c')](_0xcd84('0x14'),_0x50df85,'request\x20sent');_0xa36b98(_0x286306[_0xcd84('0x1d')][_0xcd84('0x1b')]);}})['catch'](function(_0x339472){logger[_0xcd84('0x19')](_0xcd84('0x14'),_0x50df85,_0x339472);_0x52c4c1(_0x339472);});});}exports[_0xcd84('0x1e')]=function(_0x737e9e){var _0x56116a=this;return new Promise(function(_0x3fd68f,_0x171813){return db[_0xcd84('0x1f')]['findAll']({'raw':_0x737e9e['options']?_0x737e9e[_0xcd84('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x737e9e[_0xcd84('0x20')]?_0x737e9e[_0xcd84('0x20')]['where']||null:null,'attributes':_0x737e9e[_0xcd84('0x20')]?_0x737e9e[_0xcd84('0x20')][_0xcd84('0x21')]||null:null,'limit':_0x737e9e[_0xcd84('0x20')]?_0x737e9e[_0xcd84('0x20')][_0xcd84('0x22')]||null:null,'include':_0x737e9e['options']?_0x737e9e[_0xcd84('0x20')][_0xcd84('0x23')]?_[_0xcd84('0x24')](_0x737e9e[_0xcd84('0x20')][_0xcd84('0x23')],function(_0x40d00a){return{'model':db[_0x40d00a[_0xcd84('0x25')]],'as':_0x40d00a['as'],'attributes':_0x40d00a['attributes'],'include':_0x40d00a['include']?_[_0xcd84('0x24')](_0x40d00a['include'],function(_0x5e27bd){return{'model':db[_0x5e27bd['model']],'as':_0x5e27bd['as'],'attributes':_0x5e27bd[_0xcd84('0x21')],'include':_0x5e27bd[_0xcd84('0x23')]?_['map'](_0x5e27bd[_0xcd84('0x23')],function(_0x3691a6){return{'model':db[_0x3691a6[_0xcd84('0x25')]],'as':_0x3691a6['as'],'attributes':_0x3691a6['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd84('0x13')](function(_0x5d4bff){logger[_0xcd84('0x1c')](_0xcd84('0x1e'),_0x737e9e);logger[_0xcd84('0x16')](_0xcd84('0x1e'),_0x737e9e,JSON[_0xcd84('0x18')](_0x5d4bff));_0x3fd68f(_0x5d4bff);})[_0xcd84('0x26')](function(_0x188d67){logger[_0xcd84('0x19')](_0xcd84('0x1e'),_0x188d67[_0xcd84('0x1b')],_0x737e9e);_0x171813(_0x56116a[_0xcd84('0x19')](0x1f4,_0x188d67[_0xcd84('0x1b')]));});});};exports['ShowMailAccount']=function(_0xe784cb){var _0x11ce76=this;return new Promise(function(_0x2bb0e7,_0x11a71e){return db['MailAccount'][_0xcd84('0x27')]({'raw':_0xe784cb[_0xcd84('0x20')]?_0xe784cb[_0xcd84('0x20')][_0xcd84('0x28')]===undefined?!![]:![]:!![],'where':_0xe784cb[_0xcd84('0x20')]?_0xe784cb['options'][_0xcd84('0x29')]||null:null,'attributes':_0xe784cb[_0xcd84('0x20')]?_0xe784cb[_0xcd84('0x20')][_0xcd84('0x21')]||null:null,'include':_0xe784cb[_0xcd84('0x20')]?_0xe784cb[_0xcd84('0x20')][_0xcd84('0x23')]?_['map'](_0xe784cb[_0xcd84('0x20')][_0xcd84('0x23')],function(_0x58acf3){return{'model':db[_0x58acf3[_0xcd84('0x25')]],'as':_0x58acf3['as'],'attributes':_0x58acf3['attributes'],'include':_0x58acf3[_0xcd84('0x23')]?_[_0xcd84('0x24')](_0x58acf3[_0xcd84('0x23')],function(_0x3c1cd7){return{'model':db[_0x3c1cd7[_0xcd84('0x25')]],'as':_0x3c1cd7['as'],'attributes':_0x3c1cd7[_0xcd84('0x21')],'include':_0x3c1cd7[_0xcd84('0x23')]?_[_0xcd84('0x24')](_0x3c1cd7[_0xcd84('0x23')],function(_0x2dd941){return{'model':db[_0x2dd941[_0xcd84('0x25')]],'as':_0x2dd941['as'],'attributes':_0x2dd941[_0xcd84('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcd84('0x13')](function(_0xea4f23){logger[_0xcd84('0x1c')]('ShowMailAccount',_0xe784cb);logger[_0xcd84('0x16')]('ShowMailAccount',_0xe784cb,JSON['stringify'](_0xea4f23));_0x2bb0e7(_0xea4f23);})[_0xcd84('0x26')](function(_0x23341d){logger[_0xcd84('0x19')](_0xcd84('0x2a'),_0x23341d['message'],_0xe784cb);_0x11a71e(_0x11ce76['error'](0x1f4,_0x23341d[_0xcd84('0x1b')]));});});};exports['NotifyMailAccount']=function(_0x36628f){var _0x40c5a7=this;return new Promise(function(_0x4dc8fb,_0x6377e2){var _0x4c9f90={'body':_0x36628f[_0xcd84('0x2b')],'channel':_0xcd84('0x2c')};var _0x6140d6=_['difference'](_['keys'](db[_0xcd84('0x2d')][_0xcd84('0x2e')]),[_0xcd84('0x2f'),_0xcd84('0x30'),'CompanyId',_0xcd84('0x31')]);var _0x2262d8=![];if(_0x36628f[_0xcd84('0x2b')]['id']){delete _0x36628f[_0xcd84('0x2b')]['id'];}if(_[_0xcd84('0x32')](_0x36628f[_0xcd84('0x2b')][_0xcd84('0x33')])){return _0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0xcd84('0x34')));}if(_['isNil'](_0x36628f[_0xcd84('0x2b')]['body'])||_0x36628f[_0xcd84('0x2b')]['body']===''){return _0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0xcd84('0x35')));}if(_['isNil'](_0x36628f['body'][_0xcd84('0x36')])){return _0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0xcd84('0x37')+_0x6140d6));}if(!_['includes'](_0x6140d6,_0x36628f['body'][_0xcd84('0x36')])){return _0x6377e2(_0x40c5a7['error'](0x1f4,_0xcd84('0x38')+_0x6140d6));}var _0xb392eb={};_0xb392eb[_0x36628f['body'][_0xcd84('0x36')]]=_0x36628f[_0xcd84('0x2b')]['from'];return db[_0xcd84('0x1f')][_0xcd84('0x27')]({'where':{'id':_0x36628f[_0xcd84('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xcd84('0x3a'),'where':_0xb392eb,'limit':0x1,'order':[[_0xcd84('0x30'),_0xcd84('0x3b')]]}]},{'model':db[_0xcd84('0x3c')],'as':_0xcd84('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xcd84('0x13')](function(_0x383bab){if(_0x383bab&&_0x383bab['List']){var _0x52092f=_0x383bab[_0xcd84('0x3e')]({'plain':!![]});_0x4c9f90[_0xcd84('0x39')]=_[_0xcd84('0x3f')](_0x52092f,[_0xcd84('0x3d'),_0xcd84('0x40')]);_0x4c9f90[_0xcd84('0x41')]=_0x52092f[_0xcd84('0x3d')];_0x4c9f90[_0xcd84('0x42')]=_0x52092f[_0xcd84('0x40')];_0x4c9f90[_0xcd84('0x41')]=_[_0xcd84('0x43')](_0x4c9f90['applications'],[_0xcd84('0x44')],['asc']);if(_0x4c9f90[_0xcd84('0x39')]&&_0x4c9f90['account'][_0xcd84('0x45')]){_0x4c9f90['applications'][_0xcd84('0x46')]({'id':0x0,'priority':_0x4c9f90['applications'][_0xcd84('0x47')]+0x1,'app':_0xcd84('0x48'),'appdata':'autoclose','interval':_0xcd84('0x49')});}if(_0x4c9f90[_0xcd84('0x39')][_0xcd84('0x3d')]){delete _0x4c9f90['account']['Applications'];}if(_0x4c9f90[_0xcd84('0x39')][_0xcd84('0x40')]){delete _0x4c9f90['account']['List'];}if(_0x52092f['List']['Contacts'][_0xcd84('0x47')]){return _0x52092f[_0xcd84('0x40')][_0xcd84('0x3a')][0x0];}var _0x52e473=_[_0xcd84('0xd')](_0x36628f[_0xcd84('0x2b')],{'firstName':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x33')],'ListId':_0x52092f[_0xcd84('0x31')]});_0x52e473[_0x36628f[_0xcd84('0x2b')][_0xcd84('0x36')]]=_0x36628f[_0xcd84('0x2b')][_0xcd84('0x33')];return db[_0xcd84('0x2d')][_0xcd84('0x4a')](_0x52e473);}else{throw new Error(_0xcd84('0x4b'));}})[_0xcd84('0x13')](function(_0x2711ac){_0x4c9f90[_0xcd84('0x4c')]=_0x2711ac;if(_0x2711ac){if(!_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x4d')]){_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x4d')]=rs[_0xcd84('0x4e')]()+'\x20'+_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x33')];}var _0x234b01={'ContactId':_0x2711ac['id'],'MailAccountId':_0x36628f[_0xcd84('0x39')]['id'],'inReplyTo':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['messageId'],'to':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x33')],'cc':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['cc'],'subject':_0x36628f['body'][_0xcd84('0x1b')][_0xcd84('0x4f')],'attach':_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x50')],'lastMsgAt':moment()[_0xcd84('0x51')](_0xcd84('0x52')),'lastMsgDirection':'in','lastMsgBody':_0x36628f['body'][_0xcd84('0x2b')]};return db['MailInteraction'][_0xcd84('0x27')]({'where':{'closed':![],'MailAccountId':_0x36628f[_0xcd84('0x39')]['id']},'include':[{'model':db[_0xcd84('0x53')],'as':'Messages','attributes':[_0xcd84('0x4d')],'where':{'messageId':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x54')]}}]})[_0xcd84('0x13')](function(_0x433dfe){if(_0x433dfe){return[_0x433dfe,![]];}return db['MailInteraction']['create'](_0x234b01)['then'](function(_0x1085c1){return[_0x1085c1,!![]];});});}else{throw new Error(_0xcd84('0x55'));}})[_0xcd84('0x56')](function(_0x430d9d,_0x1a0668){if(_0x430d9d){_0x2262d8=_0x1a0668;if(!_0x1a0668){return _0x430d9d['update']({'inReplyTo':_0x36628f['body']['message'][_0xcd84('0x4d')],'to':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x33')],'cc':_0x36628f[_0xcd84('0x2b')]['message']['cc'],'subject':_0x36628f['body'][_0xcd84('0x1b')][_0xcd84('0x4f')],'attach':_0x430d9d[_0xcd84('0x50')]?_0x430d9d[_0xcd84('0x50')]:_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x50')],'substatus':null,'substatusAt':moment()[_0xcd84('0x51')](_0xcd84('0x52')),'lastMsgAt':moment()[_0xcd84('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x2b')]});}else{return _0x430d9d;}}})['then'](function(_0x43d54c){_0x4c9f90[_0xcd84('0x57')]=_0x43d54c[_0xcd84('0x3e')]({'plain':!![]});_0x4c9f90[_0xcd84('0x57')][_0xcd84('0x58')]=_0x2262d8;return db[_0xcd84('0x53')][_0xcd84('0x4a')]({'body':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x2b')],'MailAccountId':_0x36628f[_0xcd84('0x39')]['id'],'MailInteractionId':_0x43d54c['id'],'direction':'in','ContactId':_0x4c9f90[_0xcd84('0x4c')]['id'],'messageId':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['messageId'],'from':_0x36628f['body'][_0xcd84('0x1b')][_0xcd84('0x33')],'to':_0x36628f['body'][_0xcd84('0x1b')]['to'],'cc':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['cc'],'subject':_0x36628f['body']['message']['subject'],'attach':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x50')],'Attachments':_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x59')],'originTo':_0x36628f[_0xcd84('0x2b')]['message']['originTo'],'originCc':_0x36628f['body'][_0xcd84('0x1b')]['originCc'],'bcc':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x5a')]},{'include':[{'model':db[_0xcd84('0x5b')],'as':_0xcd84('0x5c')}]});})[_0xcd84('0x13')](function(_0xcf40cb){_0x4c9f90[_0xcd84('0x1b')]=_0xcf40cb;if(_0x4c9f90['interaction'][_0xcd84('0x5d')]){return db[_0xcd84('0x5e')][_0xcd84('0x27')]({'attributes':['id',_0xcd84('0x5f')],'where':{'id':_0x4c9f90[_0xcd84('0x57')][_0xcd84('0x5d')]}})[_0xcd84('0x13')](function(_0x2e1c86){if(_0x2e1c86){_0x4c9f90[_0xcd84('0x41')][_0xcd84('0x60')]({'id':0x0,'priority':0x0,'app':_0xcd84('0x61'),'appdata':_0x2e1c86[_0xcd84('0x5f')]+','+(_0x4c9f90[_0xcd84('0x39')][_0xcd84('0x62')]||0xa),'interval':_0xcd84('0x49')});}return respondWithRpcPromise(_0xcd84('0x63'),_0xcd84('0x64'),_0x4c9f90);});}return respondWithRpcPromise(_0xcd84('0x63'),'startRouting',_0x4c9f90);})['then'](function(_0x1bcad1){_0x4dc8fb(_0x1bcad1);})[_0xcd84('0x26')](function(_0x54e905){_0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0x54e905[_0xcd84('0x1b')]));});});}; \ No newline at end of file +var _0x16d2=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch','find','ShowMailAccount','NotifyMailAccount','mail','difference','keys','rawAttributes','createdAt','CompanyId','ListId','body','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','account','CmList','CmContact','Contacts','updatedAt','DESC','Applications','Smtp','get','omit','List','applications','orderBy','autoclose','push','length','close','create','List\x20not\x20found','subject','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','messageId','inReplyTo','update','attach','format','interaction','created','contact','attachments','bcc','Attachment','Attachments','User','name','unshift','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x38854e,_0x23cbc9){var _0x3f8415=function(_0x4e493e){while(--_0x4e493e){_0x38854e['push'](_0x38854e['shift']());}};_0x3f8415(++_0x23cbc9);}(_0x16d2,0x123));var _0x216d=function(_0xd033df,_0x533be5){_0xd033df=_0xd033df-0x0;var _0x51e3ce=_0x16d2[_0xd033df];return _0x51e3ce;};'use strict';var _=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var moment=require(_0x216d('0x2'));var BPromise=require(_0x216d('0x3'));var rs=require(_0x216d('0x4'));var fs=require('fs');var Redis=require(_0x216d('0x5'));var db=require(_0x216d('0x6'))['db'];var utils=require(_0x216d('0x7'));var logger=require(_0x216d('0x8'))('rpc');var config=require(_0x216d('0x9'));var jayson=require(_0x216d('0xa'));var client=jayson[_0x216d('0xb')][_0x216d('0xc')]({'port':0x232c});config[_0x216d('0xd')]=_[_0x216d('0xe')](config[_0x216d('0xd')],{'host':_0x216d('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x216d('0xd')]));require(_0x216d('0x10'))[_0x216d('0x11')](socket);function respondWithRpcPromise(_0x227c46,_0x301058,_0x729bdf){return new BPromise(function(_0x5682cc,_0x7ca9c9){return client['request'](_0x227c46,_0x729bdf)[_0x216d('0x12')](function(_0x2e02ce){logger[_0x216d('0x13')](_0x216d('0x14'),_0x301058,_0x216d('0x15'));logger[_0x216d('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x301058,_0x216d('0x15'),JSON['stringify'](_0x2e02ce));if(_0x2e02ce[_0x216d('0x17')]){if(_0x2e02ce[_0x216d('0x17')]['code']===0x1f4){logger[_0x216d('0x17')](_0x216d('0x14'),_0x301058,_0x2e02ce['error'][_0x216d('0x18')]);return _0x7ca9c9(_0x2e02ce['error'][_0x216d('0x18')]);}logger[_0x216d('0x17')](_0x216d('0x14'),_0x301058,_0x2e02ce[_0x216d('0x17')][_0x216d('0x18')]);return _0x5682cc(_0x2e02ce[_0x216d('0x17')][_0x216d('0x18')]);}else{logger[_0x216d('0x13')](_0x216d('0x14'),_0x301058,'request\x20sent');_0x5682cc(_0x2e02ce[_0x216d('0x19')]['message']);}})['catch'](function(_0x133838){logger[_0x216d('0x17')]('MailAccount,\x20%s,\x20%s',_0x301058,_0x133838);_0x7ca9c9(_0x133838);});});}exports[_0x216d('0x1a')]=function(_0x462099){var _0x5abab0=this;return new Promise(function(_0x27e1c7,_0x13b8e0){return db[_0x216d('0x1b')][_0x216d('0x1c')]({'raw':_0x462099['options']?_0x462099[_0x216d('0x1d')][_0x216d('0x1e')]===undefined?!![]:![]:!![],'where':_0x462099[_0x216d('0x1d')]?_0x462099[_0x216d('0x1d')][_0x216d('0x1f')]||null:null,'attributes':_0x462099['options']?_0x462099[_0x216d('0x1d')][_0x216d('0x20')]||null:null,'limit':_0x462099[_0x216d('0x1d')]?_0x462099[_0x216d('0x1d')][_0x216d('0x21')]||null:null,'include':_0x462099['options']?_0x462099[_0x216d('0x1d')][_0x216d('0x22')]?_[_0x216d('0x23')](_0x462099['options']['include'],function(_0x56460f){return{'model':db[_0x56460f['model']],'as':_0x56460f['as'],'attributes':_0x56460f['attributes'],'include':_0x56460f[_0x216d('0x22')]?_[_0x216d('0x23')](_0x56460f[_0x216d('0x22')],function(_0x73b509){return{'model':db[_0x73b509[_0x216d('0x24')]],'as':_0x73b509['as'],'attributes':_0x73b509['attributes'],'include':_0x73b509['include']?_[_0x216d('0x23')](_0x73b509['include'],function(_0x23d1c3){return{'model':db[_0x23d1c3[_0x216d('0x24')]],'as':_0x23d1c3['as'],'attributes':_0x23d1c3[_0x216d('0x20')]};}):[]};}):[]};}):[]:[]})[_0x216d('0x12')](function(_0x307f2b){logger[_0x216d('0x13')](_0x216d('0x1a'),_0x462099);logger[_0x216d('0x16')](_0x216d('0x1a'),_0x462099,JSON[_0x216d('0x25')](_0x307f2b));_0x27e1c7(_0x307f2b);})[_0x216d('0x26')](function(_0x260134){logger[_0x216d('0x17')]('GetMailAccount',_0x260134[_0x216d('0x18')],_0x462099);_0x13b8e0(_0x5abab0[_0x216d('0x17')](0x1f4,_0x260134[_0x216d('0x18')]));});});};exports['ShowMailAccount']=function(_0x3b312f){var _0x1743ee=this;return new Promise(function(_0x394aca,_0xeff234){return db['MailAccount'][_0x216d('0x27')]({'raw':_0x3b312f[_0x216d('0x1d')]?_0x3b312f[_0x216d('0x1d')][_0x216d('0x1e')]===undefined?!![]:![]:!![],'where':_0x3b312f[_0x216d('0x1d')]?_0x3b312f[_0x216d('0x1d')][_0x216d('0x1f')]||null:null,'attributes':_0x3b312f[_0x216d('0x1d')]?_0x3b312f[_0x216d('0x1d')][_0x216d('0x20')]||null:null,'include':_0x3b312f[_0x216d('0x1d')]?_0x3b312f['options'][_0x216d('0x22')]?_[_0x216d('0x23')](_0x3b312f[_0x216d('0x1d')]['include'],function(_0x5b70e0){return{'model':db[_0x5b70e0[_0x216d('0x24')]],'as':_0x5b70e0['as'],'attributes':_0x5b70e0['attributes'],'include':_0x5b70e0[_0x216d('0x22')]?_['map'](_0x5b70e0['include'],function(_0x443138){return{'model':db[_0x443138[_0x216d('0x24')]],'as':_0x443138['as'],'attributes':_0x443138[_0x216d('0x20')],'include':_0x443138[_0x216d('0x22')]?_['map'](_0x443138['include'],function(_0x4e4c44){return{'model':db[_0x4e4c44[_0x216d('0x24')]],'as':_0x4e4c44['as'],'attributes':_0x4e4c44[_0x216d('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ff9a0){logger[_0x216d('0x13')]('ShowMailAccount',_0x3b312f);logger[_0x216d('0x16')](_0x216d('0x28'),_0x3b312f,JSON[_0x216d('0x25')](_0x3ff9a0));_0x394aca(_0x3ff9a0);})[_0x216d('0x26')](function(_0x56ce8a){logger[_0x216d('0x17')](_0x216d('0x28'),_0x56ce8a[_0x216d('0x18')],_0x3b312f);_0xeff234(_0x1743ee['error'](0x1f4,_0x56ce8a['message']));});});};exports[_0x216d('0x29')]=function(_0x2be24f){var _0x504a34=this;return new Promise(function(_0xf33f9c,_0x377c4a){var _0x4c3560={'body':_0x2be24f['body'],'channel':_0x216d('0x2a')};var _0x3519ab=_[_0x216d('0x2b')](_[_0x216d('0x2c')](db['CmContact'][_0x216d('0x2d')]),[_0x216d('0x2e'),'updatedAt',_0x216d('0x2f'),_0x216d('0x30')]);var _0x590eb6=![];if(_0x2be24f['body']['id']){delete _0x2be24f[_0x216d('0x31')]['id'];}if(_[_0x216d('0x32')](_0x2be24f[_0x216d('0x31')]['from'])){return _0x377c4a(_0x504a34[_0x216d('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0x2be24f[_0x216d('0x31')][_0x216d('0x31')])||_0x2be24f[_0x216d('0x31')]['body']===''){return _0x377c4a(_0x504a34[_0x216d('0x17')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x216d('0x32')](_0x2be24f[_0x216d('0x31')][_0x216d('0x33')])){return _0x377c4a(_0x504a34['error'](0x1f4,_0x216d('0x34')+_0x3519ab));}if(!_[_0x216d('0x35')](_0x3519ab,_0x2be24f[_0x216d('0x31')][_0x216d('0x33')])){return _0x377c4a(_0x504a34['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3519ab));}var _0x571c55={};_0x571c55[_0x2be24f[_0x216d('0x31')][_0x216d('0x33')]]=_0x2be24f[_0x216d('0x31')][_0x216d('0x36')];return db[_0x216d('0x1b')][_0x216d('0x27')]({'where':{'id':_0x2be24f[_0x216d('0x37')]['id']},'include':[{'model':db[_0x216d('0x38')],'as':'List','include':[{'model':db[_0x216d('0x39')],'as':_0x216d('0x3a'),'where':_0x571c55,'limit':0x1,'order':[[_0x216d('0x3b'),_0x216d('0x3c')]]}]},{'model':db['MailApplication'],'as':_0x216d('0x3d')},{'model':db['MailServerOut'],'as':_0x216d('0x3e')}]})[_0x216d('0x12')](function(_0xceb993){if(_0xceb993&&_0xceb993['List']){var _0x57e74f=_0xceb993[_0x216d('0x3f')]({'plain':!![]});_0x4c3560[_0x216d('0x37')]=_[_0x216d('0x40')](_0x57e74f,[_0x216d('0x3d'),_0x216d('0x41')]);_0x4c3560[_0x216d('0x42')]=_0x57e74f['Applications'];_0x4c3560['list']=_0x57e74f[_0x216d('0x41')];_0x4c3560['applications']=_[_0x216d('0x43')](_0x4c3560[_0x216d('0x42')],['priority'],['asc']);if(_0x4c3560['account']&&_0x4c3560['account'][_0x216d('0x44')]){_0x4c3560[_0x216d('0x42')][_0x216d('0x45')]({'id':0x0,'priority':_0x4c3560[_0x216d('0x42')][_0x216d('0x46')]+0x1,'app':_0x216d('0x47'),'appdata':_0x216d('0x44'),'interval':'*,*,*,*'});}if(_0x4c3560[_0x216d('0x37')][_0x216d('0x3d')]){delete _0x4c3560[_0x216d('0x37')]['Applications'];}if(_0x4c3560[_0x216d('0x37')][_0x216d('0x41')]){delete _0x4c3560[_0x216d('0x37')][_0x216d('0x41')];}if(_0x57e74f['List'][_0x216d('0x3a')][_0x216d('0x46')]){return _0x57e74f[_0x216d('0x41')][_0x216d('0x3a')][0x0];}var _0x4d7705=_[_0x216d('0xe')](_0x2be24f[_0x216d('0x31')],{'firstName':_0x2be24f['body'][_0x216d('0x36')],'ListId':_0x57e74f['ListId']});_0x4d7705[_0x2be24f[_0x216d('0x31')][_0x216d('0x33')]]=_0x2be24f[_0x216d('0x31')][_0x216d('0x36')];return db[_0x216d('0x39')][_0x216d('0x48')](_0x4d7705);}else{throw new Error(_0x216d('0x49'));}})[_0x216d('0x12')](function(_0x102a75){_0x4c3560['contact']=_0x102a75;if(_0x102a75){if(!_0x2be24f[_0x216d('0x31')][_0x216d('0x18')]['messageId']){_0x2be24f[_0x216d('0x31')][_0x216d('0x18')]['messageId']=rs['generate']()+'\x20'+_0x2be24f[_0x216d('0x31')]['message'][_0x216d('0x36')];}var _0x2684e0={'ContactId':_0x102a75['id'],'MailAccountId':_0x2be24f[_0x216d('0x37')]['id'],'inReplyTo':_0x2be24f['body'][_0x216d('0x18')]['messageId'],'to':_0x2be24f['body'][_0x216d('0x18')][_0x216d('0x36')],'cc':_0x2be24f['body'][_0x216d('0x18')]['cc'],'subject':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x4a')],'attach':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')]['attach'],'lastMsgAt':moment()['format'](_0x216d('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0x2be24f[_0x216d('0x31')][_0x216d('0x31')]};return db[_0x216d('0x4c')][_0x216d('0x27')]({'where':{'closed':![],'MailAccountId':_0x2be24f[_0x216d('0x37')]['id']},'include':[{'model':db[_0x216d('0x4d')],'as':_0x216d('0x4e'),'attributes':[_0x216d('0x4f')],'where':{'messageId':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x50')]}}]})['then'](function(_0x563f11){if(_0x563f11){return[_0x563f11,![]];}return db[_0x216d('0x4c')][_0x216d('0x48')](_0x2684e0)['then'](function(_0x421174){return[_0x421174,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x36828c,_0x3b9457){if(_0x36828c){_0x590eb6=_0x3b9457;if(!_0x3b9457){return _0x36828c[_0x216d('0x51')]({'inReplyTo':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x4f')],'to':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x36')],'cc':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')]['cc'],'subject':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x4a')],'attach':_0x36828c[_0x216d('0x52')]?_0x36828c[_0x216d('0x52')]:_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x52')],'substatus':null,'substatusAt':moment()[_0x216d('0x53')](_0x216d('0x4b')),'lastMsgAt':moment()[_0x216d('0x53')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x2be24f[_0x216d('0x31')]['body']});}else{return _0x36828c;}}})[_0x216d('0x12')](function(_0x51507b){_0x4c3560[_0x216d('0x54')]=_0x51507b[_0x216d('0x3f')]({'plain':!![]});_0x4c3560['interaction'][_0x216d('0x55')]=_0x590eb6;return db[_0x216d('0x4d')][_0x216d('0x48')]({'body':_0x2be24f[_0x216d('0x31')][_0x216d('0x31')],'MailAccountId':_0x2be24f[_0x216d('0x37')]['id'],'MailInteractionId':_0x51507b['id'],'direction':'in','ContactId':_0x4c3560[_0x216d('0x56')]['id'],'messageId':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')]['messageId'],'from':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x36')],'to':_0x2be24f['body']['message']['to'],'cc':_0x2be24f['body']['message']['cc'],'subject':_0x2be24f[_0x216d('0x31')]['message'][_0x216d('0x4a')],'attach':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x52')],'Attachments':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x57')],'originTo':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')]['originTo'],'originCc':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')]['originCc'],'bcc':_0x2be24f[_0x216d('0x31')][_0x216d('0x18')][_0x216d('0x58')]},{'include':[{'model':db[_0x216d('0x59')],'as':_0x216d('0x5a')}]});})[_0x216d('0x12')](function(_0x534b82){_0x4c3560['message']=_0x534b82;if(_0x4c3560[_0x216d('0x54')]['UserId']){return db[_0x216d('0x5b')][_0x216d('0x27')]({'attributes':['id',_0x216d('0x5c')],'where':{'id':_0x4c3560['interaction']['UserId']}})['then'](function(_0xa00fc2){if(_0xa00fc2){_0x4c3560[_0x216d('0x42')][_0x216d('0x5d')]({'id':0x0,'priority':0x0,'app':_0x216d('0x5e'),'appdata':_0xa00fc2['name']+','+(_0x4c3560[_0x216d('0x37')][_0x216d('0x5f')]||0xa),'interval':_0x216d('0x60')});}return respondWithRpcPromise('Start','startRouting',_0x4c3560);});}return respondWithRpcPromise(_0x216d('0x61'),_0x216d('0x62'),_0x4c3560);})[_0x216d('0x12')](function(_0x8d507c){_0xf33f9c(_0x8d507c);})[_0x216d('0x26')](function(_0x4ca61b){_0x377c4a(_0x504a34[_0x216d('0x17')](0x1f4,_0x4ca61b[_0x216d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index d49b694..ffeb8a0 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 _0x9305=['register','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x4e455f,_0x5d9502){var _0x59793d=function(_0x2c629f){while(--_0x2c629f){_0x4e455f['push'](_0x4e455f['shift']());}};_0x59793d(++_0x5d9502);}(_0x9305,0x1e2));var _0x5930=function(_0x5a9055,_0x48668d){_0x5a9055=_0x5a9055-0x0;var _0x24a9ae=_0x9305[_0x5a9055];return _0x24a9ae;};'use strict';var MailAccountEvents=require(_0x5930('0x0'));var events=[_0x5930('0x1'),_0x5930('0x2'),_0x5930('0x3')];function createListener(_0x5be178,_0x1769b6){return function(_0x1fc6b1){_0x1769b6[_0x5930('0x4')](_0x5be178,_0x1fc6b1);};}function removeListener(_0x16c710,_0x50d9ab){return function(){MailAccountEvents[_0x5930('0x5')](_0x16c710,_0x50d9ab);};}exports[_0x5930('0x6')]=function(_0x70d74f){for(var _0x2c4ada=0x0,_0x4b9cdf=events['length'];_0x2c4ada<_0x4b9cdf;_0x2c4ada++){var _0x2a3d8c=events[_0x2c4ada];var _0x80c566=createListener(_0x5930('0x7')+_0x2a3d8c,_0x70d74f);MailAccountEvents['on'](_0x2a3d8c,_0x80c566);}}; \ No newline at end of file +var _0x6b4e=['removeListener','register','length','mailAccount:','save','emit'];(function(_0x493a89,_0x2f5fac){var _0x5be45c=function(_0x1147ed){while(--_0x1147ed){_0x493a89['push'](_0x493a89['shift']());}};_0x5be45c(++_0x2f5fac);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x480856,_0x57b2cf){_0x480856=_0x480856-0x0;var _0x4d80d9=_0x6b4e[_0x480856];return _0x4d80d9;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0xe6b4('0x0'),'remove','update'];function createListener(_0x5c3328,_0x54da12){return function(_0x4566e9){_0x54da12[_0xe6b4('0x1')](_0x5c3328,_0x4566e9);};}function removeListener(_0x1aedc5,_0x344db1){return function(){MailAccountEvents[_0xe6b4('0x2')](_0x1aedc5,_0x344db1);};}exports[_0xe6b4('0x3')]=function(_0x598f8c){for(var _0x29c81b=0x0,_0x3458d8=events[_0xe6b4('0x4')];_0x29c81b<_0x3458d8;_0x29c81b++){var _0x1d062b=events[_0x29c81b];var _0x15cf31=createListener(_0xe6b4('0x5')+_0x1d062b,_0x598f8c);MailAccountEvents['on'](_0x1d062b,_0x15cf31);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 76a4821..c8ecbad 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 _0xb58b=['/:id','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x4ee47f,_0x44a4b3){var _0x555738=function(_0x54d9bb){while(--_0x54d9bb){_0x4ee47f['push'](_0x4ee47f['shift']());}};_0x555738(++_0x44a4b3);}(_0xb58b,0x1f1));var _0xbb58=function(_0x5a1e4f,_0x3b08eb){_0x5a1e4f=_0x5a1e4f-0x0;var _0x3df72c=_0xb58b[_0x5a1e4f];return _0x3df72c;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var auth=require(_0xbb58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb58('0x5'));var controller=require('./mailApplication.controller');router[_0xbb58('0x6')](_0xbb58('0x7'),auth[_0xbb58('0x8')](),controller['show']);router[_0xbb58('0x9')](_0xbb58('0x7'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0xb')](_0xbb58('0x7'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);module[_0xbb58('0xd')]=router; \ No newline at end of file +var _0x3f8c=['/:id','isAuthenticated','show','put','delete','destroy','exports','path','connect-timeout','express','Router'];(function(_0x196a6f,_0x475886){var _0x3be594=function(_0x57617e){while(--_0x57617e){_0x196a6f['push'](_0x196a6f['shift']());}};_0x3be594(++_0x475886);}(_0x3f8c,0x104));var _0xc3f8=function(_0x1f1af9,_0xc12a73){_0x1f1af9=_0x1f1af9-0x0;var _0x783152=_0x3f8c[_0x1f1af9];return _0x783152;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc3f8('0x0'));var timeout=require(_0xc3f8('0x1'));var express=require(_0xc3f8('0x2'));var router=express[_0xc3f8('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailApplication.controller');router['get'](_0xc3f8('0x4'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x6')]);router[_0xc3f8('0x7')](_0xc3f8('0x4'),auth[_0xc3f8('0x5')](),controller['update']);router[_0xc3f8('0x8')](_0xc3f8('0x4'),auth[_0xc3f8('0x5')](),controller[_0xc3f8('0x9')]);module[_0xc3f8('0xa')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 2938c68..6e36282 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 _0x1ecf=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x5682c8,_0x57c3c1){var _0x21469d=function(_0xf5a131){while(--_0xf5a131){_0x5682c8['push'](_0x5682c8['shift']());}};_0x21469d(++_0x57c3c1);}(_0x1ecf,0x15d));var _0xf1ec=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x1ecf[_0x46401e];return _0x447cba;};'use strict';var Sequelize=require('sequelize');module[_0xf1ec('0x0')]={'priority':{'type':Sequelize[_0xf1ec('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf1ec('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf1ec('0x3')]()},'description':{'type':Sequelize[_0xf1ec('0x2')]},'interval':{'type':Sequelize[_0xf1ec('0x2')],'defaultValue':_0xf1ec('0x4')}}; \ No newline at end of file +var _0x58a1=['STRING','*,*,*,*','INTEGER','TEXT'];(function(_0x380b5d,_0x3ae296){var _0x38b90d=function(_0x442e4d){while(--_0x442e4d){_0x380b5d['push'](_0x380b5d['shift']());}};_0x38b90d(++_0x3ae296);}(_0x58a1,0x72));var _0x158a=function(_0x347bf8,_0x3eb017){_0x347bf8=_0x347bf8-0x0;var _0x46f908=_0x58a1[_0x347bf8];return _0x46f908;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x158a('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x158a('0x1')]()},'description':{'type':Sequelize[_0x158a('0x2')]},'interval':{'type':Sequelize[_0x158a('0x2')],'defaultValue':_0x158a('0x3')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 9f5b9da..22127a9 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 _0x0bf2=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','count','limit','set','Content-Range','json','save','update','then','end','sendStatus','stack','name','send','show','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','body','params','destroy','html-pdf'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0bf2,0x172));var _0x20bf=function(_0x5a5b5a,_0x5d9856){_0x5a5b5a=_0x5a5b5a-0x0;var _0xb02dad=_0x0bf2[_0x5a5b5a];return _0xb02dad;};'use strict';var pdf=require(_0x20bf('0x0'));var emlformat=require(_0x20bf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20bf('0x2'));var rp=require(_0x20bf('0x3'));var moment=require(_0x20bf('0x4'));var BPromise=require(_0x20bf('0x5'));var Mustache=require(_0x20bf('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20bf('0x7'));var fs=require('fs');var _=require(_0x20bf('0x8'));var squel=require(_0x20bf('0x9'));var crypto=require(_0x20bf('0xa'));var jsforce=require(_0x20bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x20bf('0xc'));var querystring=require(_0x20bf('0xd'));var Papa=require(_0x20bf('0xe'));var Redis=require('ioredis');var authService=require(_0x20bf('0xf'));var qs=require(_0x20bf('0x10'));var as=require(_0x20bf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20bf('0x12'))(_0x20bf('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x20bf('0x14'))['db'];function respondWithStatusCode(_0x49200e,_0x224a95){_0x224a95=_0x224a95||0xcc;return function(_0x28da31){if(_0x28da31){return _0x49200e['sendStatus'](_0x224a95);}return _0x49200e[_0x20bf('0x15')](_0x224a95)['end']();};}function respondWithResult(_0x55d074,_0x1b4413){_0x1b4413=_0x1b4413||0xc8;return function(_0x441946){if(_0x441946){return _0x55d074[_0x20bf('0x15')](_0x1b4413)['json'](_0x441946);}};}function respondWithFilteredResult(_0x1467ac,_0x494115){return function(_0x2bb221){if(_0x2bb221){var _0x394b89=_0x2bb221[_0x20bf('0x16')],_0xcab346=_0x494115['offset'],_0x4e29b6=_0x494115['offset']+_0x494115[_0x20bf('0x17')],_0x535aa0;if(_0x4e29b6>=_0x394b89){_0x4e29b6=_0x394b89;_0x535aa0=0xc8;}else{_0x535aa0=0xce;}_0x1467ac[_0x20bf('0x15')](_0x535aa0);return _0x1467ac[_0x20bf('0x18')](_0x20bf('0x19'),_0xcab346+'-'+_0x4e29b6+'/'+_0x394b89)[_0x20bf('0x1a')](_0x2bb221);}return null;};}function patchUpdates(_0x337d22){return function(_0x745d9){try{jsonpatch['apply'](_0x745d9,_0x337d22,!![]);}catch(_0x4d9c0c){return BPromise['reject'](_0x4d9c0c);}return _0x745d9[_0x20bf('0x1b')]();};}function saveUpdates(_0x298dac,_0x3b221c){return function(_0x115b33){if(_0x115b33){return _0x115b33[_0x20bf('0x1c')](_0x298dac)['then'](function(_0x3476c6){return _0x3476c6;});}return null;};}function removeEntity(_0x35be51,_0x3dae72){return function(_0x516abb){if(_0x516abb){return _0x516abb['destroy']()[_0x20bf('0x1d')](function(){_0x35be51[_0x20bf('0x15')](0xcc)[_0x20bf('0x1e')]();});}};}function handleEntityNotFound(_0x1856bc,_0x22c749){return function(_0x2e48cf){if(!_0x2e48cf){_0x1856bc[_0x20bf('0x1f')](0x194);}return _0x2e48cf;};}function handleError(_0x5e9ad3,_0x3774ad){_0x3774ad=_0x3774ad||0x1f4;return function(_0x41c3a9){logger['error'](_0x41c3a9[_0x20bf('0x20')]);if(_0x41c3a9['name']){delete _0x41c3a9[_0x20bf('0x21')];}_0x5e9ad3[_0x20bf('0x15')](_0x3774ad)[_0x20bf('0x22')](_0x41c3a9);};}exports[_0x20bf('0x23')]=function(_0x51b0e3,_0x258588){var _0x41b808={'raw':!![],'where':{'id':_0x51b0e3['params']['id']}},_0x507dfb={};_0x507dfb[_0x20bf('0x24')]=_[_0x20bf('0x25')](db[_0x20bf('0x26')]['rawAttributes']);_0x507dfb[_0x20bf('0x27')]=_[_0x20bf('0x25')](_0x51b0e3['query']);_0x507dfb[_0x20bf('0x28')]=_['intersection'](_0x507dfb['model'],_0x507dfb[_0x20bf('0x27')]);_0x41b808['attributes']=_[_0x20bf('0x29')](_0x507dfb[_0x20bf('0x24')],qs['fields'](_0x51b0e3[_0x20bf('0x27')]['fields']));_0x41b808[_0x20bf('0x2a')]=_0x41b808[_0x20bf('0x2a')][_0x20bf('0x2b')]?_0x41b808[_0x20bf('0x2a')]:_0x507dfb[_0x20bf('0x24')];if(_0x51b0e3[_0x20bf('0x27')][_0x20bf('0x2c')]){_0x41b808[_0x20bf('0x2d')]=[{'all':!![]}];}_0x41b808=_[_0x20bf('0x2e')]({},_0x41b808,_0x51b0e3[_0x20bf('0x2f')]);return db[_0x20bf('0x26')][_0x20bf('0x30')](_0x41b808)[_0x20bf('0x1d')](handleEntityNotFound(_0x258588,null))[_0x20bf('0x1d')](respondWithResult(_0x258588,null))[_0x20bf('0x31')](handleError(_0x258588,null));};exports['update']=function(_0x50d293,_0x63aae5){if(_0x50d293[_0x20bf('0x32')]['id']){delete _0x50d293[_0x20bf('0x32')]['id'];}return db['MailApplication'][_0x20bf('0x30')]({'where':{'id':_0x50d293[_0x20bf('0x33')]['id']}})[_0x20bf('0x1d')](handleEntityNotFound(_0x63aae5,null))[_0x20bf('0x1d')](saveUpdates(_0x50d293[_0x20bf('0x32')],null))[_0x20bf('0x1d')](respondWithResult(_0x63aae5,null))[_0x20bf('0x31')](handleError(_0x63aae5,null));};exports[_0x20bf('0x34')]=function(_0x4fb06b,_0xf8a23){return db[_0x20bf('0x26')][_0x20bf('0x30')]({'where':{'id':_0x4fb06b['params']['id']}})[_0x20bf('0x1d')](handleEntityNotFound(_0xf8a23,null))[_0x20bf('0x1d')](removeEntity(_0xf8a23,null))[_0x20bf('0x31')](handleError(_0xf8a23,null));}; \ No newline at end of file +var _0x908e=['body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','MailApplication','catch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x908e,0x182));var _0xe908=function(_0x23cedf,_0x5e84e9){_0x23cedf=_0x23cedf-0x0;var _0x5788d1=_0x908e[_0x23cedf];return _0x5788d1;};'use strict';var pdf=require(_0xe908('0x0'));var emlformat=require(_0xe908('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe908('0x2'));var rp=require(_0xe908('0x3'));var moment=require(_0xe908('0x4'));var BPromise=require(_0xe908('0x5'));var Mustache=require('mustache');var util=require(_0xe908('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xe908('0x7'));var ejs=require(_0xe908('0x8'));var fs=require('fs');var _=require(_0xe908('0x9'));var squel=require(_0xe908('0xa'));var crypto=require(_0xe908('0xb'));var jsforce=require(_0xe908('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe908('0x7'));var querystring=require('querystring');var Papa=require(_0xe908('0xd'));var Redis=require(_0xe908('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe908('0xf'));var hardwareService=require(_0xe908('0x10'));var logger=require(_0xe908('0x11'))(_0xe908('0x12'));var utils=require(_0xe908('0x13'));var config=require(_0xe908('0x14'));var db=require(_0xe908('0x15'))['db'];function respondWithStatusCode(_0x105761,_0x54347e){_0x54347e=_0x54347e||0xcc;return function(_0x587054){if(_0x587054){return _0x105761[_0xe908('0x16')](_0x54347e);}return _0x105761['status'](_0x54347e)[_0xe908('0x17')]();};}function respondWithResult(_0xf24ff1,_0x21029a){_0x21029a=_0x21029a||0xc8;return function(_0x15358b){if(_0x15358b){return _0xf24ff1[_0xe908('0x18')](_0x21029a)['json'](_0x15358b);}};}function respondWithFilteredResult(_0x214997,_0x34343c){return function(_0xc5182b){if(_0xc5182b){var _0x114ea7=_0xc5182b[_0xe908('0x19')],_0x564500=_0x34343c[_0xe908('0x1a')],_0x530227=_0x34343c[_0xe908('0x1a')]+_0x34343c[_0xe908('0x1b')],_0x4e0729;if(_0x530227>=_0x114ea7){_0x530227=_0x114ea7;_0x4e0729=0xc8;}else{_0x4e0729=0xce;}_0x214997['status'](_0x4e0729);return _0x214997[_0xe908('0x1c')](_0xe908('0x1d'),_0x564500+'-'+_0x530227+'/'+_0x114ea7)[_0xe908('0x1e')](_0xc5182b);}return null;};}function patchUpdates(_0x2c9787){return function(_0xca69d8){try{jsonpatch['apply'](_0xca69d8,_0x2c9787,!![]);}catch(_0x137b1c){return BPromise['reject'](_0x137b1c);}return _0xca69d8[_0xe908('0x1f')]();};}function saveUpdates(_0x417943,_0x43ad6c){return function(_0x1c56e2){if(_0x1c56e2){return _0x1c56e2[_0xe908('0x20')](_0x417943)[_0xe908('0x21')](function(_0xa1d7b9){return _0xa1d7b9;});}return null;};}function removeEntity(_0x163263,_0x122960){return function(_0x376184){if(_0x376184){return _0x376184[_0xe908('0x22')]()[_0xe908('0x21')](function(){_0x163263[_0xe908('0x18')](0xcc)[_0xe908('0x17')]();});}};}function handleEntityNotFound(_0x212c95,_0x537e56){return function(_0x48eb99){if(!_0x48eb99){_0x212c95[_0xe908('0x16')](0x194);}return _0x48eb99;};}function handleError(_0xd64396,_0x136abb){_0x136abb=_0x136abb||0x1f4;return function(_0x583894){logger[_0xe908('0x23')](_0x583894[_0xe908('0x24')]);if(_0x583894['name']){delete _0x583894[_0xe908('0x25')];}_0xd64396[_0xe908('0x18')](_0x136abb)[_0xe908('0x26')](_0x583894);};}exports[_0xe908('0x27')]=function(_0x296b02,_0x53b512){var _0x154d4a={'raw':!![],'where':{'id':_0x296b02[_0xe908('0x28')]['id']}},_0x19e180={};_0x19e180[_0xe908('0x29')]=_[_0xe908('0x2a')](db['MailApplication'][_0xe908('0x2b')]);_0x19e180[_0xe908('0x2c')]=_[_0xe908('0x2a')](_0x296b02[_0xe908('0x2c')]);_0x19e180[_0xe908('0x2d')]=_[_0xe908('0x2e')](_0x19e180[_0xe908('0x29')],_0x19e180[_0xe908('0x2c')]);_0x154d4a['attributes']=_[_0xe908('0x2e')](_0x19e180[_0xe908('0x29')],qs[_0xe908('0x2f')](_0x296b02[_0xe908('0x2c')][_0xe908('0x2f')]));_0x154d4a[_0xe908('0x30')]=_0x154d4a[_0xe908('0x30')][_0xe908('0x31')]?_0x154d4a[_0xe908('0x30')]:_0x19e180['model'];if(_0x296b02[_0xe908('0x2c')]['includeAll']){_0x154d4a[_0xe908('0x32')]=[{'all':!![]}];}_0x154d4a=_[_0xe908('0x33')]({},_0x154d4a,_0x296b02['options']);return db[_0xe908('0x34')]['find'](_0x154d4a)['then'](handleEntityNotFound(_0x53b512,null))[_0xe908('0x21')](respondWithResult(_0x53b512,null))[_0xe908('0x35')](handleError(_0x53b512,null));};exports[_0xe908('0x20')]=function(_0x405c00,_0x5dc86b){if(_0x405c00[_0xe908('0x36')]['id']){delete _0x405c00['body']['id'];}return db[_0xe908('0x34')]['find']({'where':{'id':_0x405c00[_0xe908('0x28')]['id']}})['then'](handleEntityNotFound(_0x5dc86b,null))[_0xe908('0x21')](saveUpdates(_0x405c00[_0xe908('0x36')],null))[_0xe908('0x21')](respondWithResult(_0x5dc86b,null))[_0xe908('0x35')](handleError(_0x5dc86b,null));};exports[_0xe908('0x22')]=function(_0x2010d3,_0x29c721){return db[_0xe908('0x34')]['find']({'where':{'id':_0x2010d3[_0xe908('0x28')]['id']}})[_0xe908('0x21')](handleEntityNotFound(_0x29c721,null))[_0xe908('0x21')](removeEntity(_0x29c721,null))[_0xe908('0x35')](handleError(_0x29c721,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 92b01cb..c51f594 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 _0xf5b6=['path','rimraf','../../config/environment','./mailApplication.attributes','define','utf8mb4','../../config/logger','api','moment','bluebird'];(function(_0x349a99,_0x424b54){var _0x29a028=function(_0x1b79fe){while(--_0x1b79fe){_0x349a99['push'](_0x349a99['shift']());}};_0x29a028(++_0x424b54);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x5bc9d8,_0x39497b){_0x5bc9d8=_0x5bc9d8-0x0;var _0x2dd1f4=_0xf5b6[_0x5bc9d8];return _0x2dd1f4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f5b('0x0'))(_0x6f5b('0x1'));var moment=require(_0x6f5b('0x2'));var BPromise=require(_0x6f5b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f5b('0x4'));var rimraf=require(_0x6f5b('0x5'));var config=require(_0x6f5b('0x6'));var attributes=require(_0x6f5b('0x7'));module['exports']=function(_0x518ebf,_0x4baf5c){return _0x518ebf[_0x6f5b('0x8')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f5b('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0e56=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x1f27df,_0x4f1a64){var _0x286ee2=function(_0x255ea7){while(--_0x255ea7){_0x1f27df['push'](_0x1f27df['shift']());}};_0x286ee2(++_0x4f1a64);}(_0x0e56,0xf5));var _0x60e5=function(_0x29db14,_0x4fcd9f){_0x29db14=_0x29db14-0x0;var _0x5cfc55=_0x0e56[_0x29db14];return _0x5cfc55;};'use strict';var _=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var logger=require('../../config/logger')(_0x60e5('0x2'));var moment=require(_0x60e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x60e5('0x4'));var fs=require('fs');var path=require(_0x60e5('0x5'));var rimraf=require(_0x60e5('0x6'));var config=require(_0x60e5('0x7'));var attributes=require(_0x60e5('0x8'));module[_0x60e5('0x9')]=function(_0x25b3a4,_0x54422a){return _0x25b3a4[_0x60e5('0xa')](_0x60e5('0xb'),attributes,{'tableName':_0x60e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x60e5('0xd'),'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 5812db0..985d649 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 _0x7d05=['update','body','options','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailApplication','MailApplication'];(function(_0x245258,_0x38db2b){var _0x738639=function(_0x312d6c){while(--_0x312d6c){_0x245258['push'](_0x245258['shift']());}};_0x738639(++_0x38db2b);}(_0x7d05,0x162));var _0x57d0=function(_0x86ac57,_0x52338d){_0x86ac57=_0x86ac57-0x0;var _0x7e0586=_0x7d05[_0x86ac57];return _0x7e0586;};'use strict';var _=require(_0x57d0('0x0'));var util=require(_0x57d0('0x1'));var moment=require('moment');var BPromise=require(_0x57d0('0x2'));var rs=require(_0x57d0('0x3'));var fs=require('fs');var Redis=require(_0x57d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57d0('0x5'));var logger=require('../../config/logger')(_0x57d0('0x6'));var config=require(_0x57d0('0x7'));var jayson=require(_0x57d0('0x8'));var client=jayson['client'][_0x57d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ca53e,_0x24d003,_0x1dc973){return new BPromise(function(_0x4e80da,_0x4dc128){return client[_0x57d0('0xa')](_0x5ca53e,_0x1dc973)[_0x57d0('0xb')](function(_0xf8f337){logger['info'](_0x57d0('0xc'),_0x24d003,'request\x20sent');logger[_0x57d0('0xd')](_0x57d0('0xe'),_0x24d003,'request\x20sent',JSON[_0x57d0('0xf')](_0xf8f337));if(_0xf8f337[_0x57d0('0x10')]){if(_0xf8f337['error'][_0x57d0('0x11')]===0x1f4){logger[_0x57d0('0x10')](_0x57d0('0xc'),_0x24d003,_0xf8f337[_0x57d0('0x10')][_0x57d0('0x12')]);return _0x4dc128(_0xf8f337[_0x57d0('0x10')][_0x57d0('0x12')]);}logger[_0x57d0('0x10')](_0x57d0('0xc'),_0x24d003,_0xf8f337[_0x57d0('0x10')]['message']);return _0x4e80da(_0xf8f337[_0x57d0('0x10')][_0x57d0('0x12')]);}else{logger[_0x57d0('0x13')](_0x57d0('0xc'),_0x24d003,'request\x20sent');_0x4e80da(_0xf8f337['result'][_0x57d0('0x12')]);}})[_0x57d0('0x14')](function(_0x442ce7){logger[_0x57d0('0x10')](_0x57d0('0xc'),_0x24d003,_0x442ce7);_0x4dc128(_0x442ce7);});});}exports[_0x57d0('0x15')]=function(_0xdc8a9e){var _0x2db0d5=this;return new Promise(function(_0x584044,_0x5561ab){return db[_0x57d0('0x16')][_0x57d0('0x17')](_0xdc8a9e[_0x57d0('0x18')],{'raw':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e[_0x57d0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e['options'][_0x57d0('0x1a')]||null:null,'attributes':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e['options'][_0x57d0('0x1b')]||null:null,'limit':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e[_0x57d0('0x19')][_0x57d0('0x1c')]||null:null})[_0x57d0('0xb')](function(_0x23869d){logger[_0x57d0('0x13')](_0x57d0('0x15'),_0xdc8a9e);logger[_0x57d0('0xd')]('UpdateMailApplication',_0xdc8a9e,JSON[_0x57d0('0xf')](_0x23869d));_0x584044(_0x23869d);})['catch'](function(_0x2466b2){logger[_0x57d0('0x10')](_0x57d0('0x15'),_0x2466b2['message'],_0xdc8a9e);_0x5561ab(_0x2db0d5['error'](0x1f4,_0x2466b2['message']));});});}; \ No newline at end of file +var _0xe51d=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','catch','UpdateMailApplication','MailApplication','update','options','where','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe51d,0x76));var _0xde51=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe51d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xde51('0x0'));var moment=require(_0xde51('0x1'));var BPromise=require(_0xde51('0x2'));var rs=require(_0xde51('0x3'));var fs=require('fs');var Redis=require(_0xde51('0x4'));var db=require(_0xde51('0x5'))['db'];var utils=require(_0xde51('0x6'));var logger=require(_0xde51('0x7'))(_0xde51('0x8'));var config=require(_0xde51('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xde51('0xa')][_0xde51('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1922f2,_0x11dd44,_0x3354ce){return new BPromise(function(_0x49e898,_0x2ce4ee){return client[_0xde51('0xc')](_0x1922f2,_0x3354ce)['then'](function(_0xb0f81a){logger[_0xde51('0xd')]('MailApplication,\x20%s,\x20%s',_0x11dd44,'request\x20sent');logger[_0xde51('0xe')](_0xde51('0xf'),_0x11dd44,'request\x20sent',JSON[_0xde51('0x10')](_0xb0f81a));if(_0xb0f81a[_0xde51('0x11')]){if(_0xb0f81a['error'][_0xde51('0x12')]===0x1f4){logger[_0xde51('0x11')](_0xde51('0x13'),_0x11dd44,_0xb0f81a[_0xde51('0x11')][_0xde51('0x14')]);return _0x2ce4ee(_0xb0f81a[_0xde51('0x11')][_0xde51('0x14')]);}logger['error'](_0xde51('0x13'),_0x11dd44,_0xb0f81a[_0xde51('0x11')][_0xde51('0x14')]);return _0x49e898(_0xb0f81a['error']['message']);}else{logger[_0xde51('0xd')](_0xde51('0x13'),_0x11dd44,'request\x20sent');_0x49e898(_0xb0f81a[_0xde51('0x15')][_0xde51('0x14')]);}})[_0xde51('0x16')](function(_0x52e8a1){logger['error']('MailApplication,\x20%s,\x20%s',_0x11dd44,_0x52e8a1);_0x2ce4ee(_0x52e8a1);});});}exports[_0xde51('0x17')]=function(_0x33475c){var _0x53e90e=this;return new Promise(function(_0x41f300,_0x47300d){return db[_0xde51('0x18')][_0xde51('0x19')](_0x33475c['body'],{'raw':_0x33475c[_0xde51('0x1a')]?_0x33475c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33475c[_0xde51('0x1a')]?_0x33475c[_0xde51('0x1a')][_0xde51('0x1b')]||null:null,'attributes':_0x33475c[_0xde51('0x1a')]?_0x33475c[_0xde51('0x1a')][_0xde51('0x1c')]||null:null,'limit':_0x33475c['options']?_0x33475c[_0xde51('0x1a')][_0xde51('0x1d')]||null:null})[_0xde51('0x1e')](function(_0x1226cd){logger[_0xde51('0xd')](_0xde51('0x17'),_0x33475c);logger[_0xde51('0xe')](_0xde51('0x17'),_0x33475c,JSON[_0xde51('0x10')](_0x1226cd));_0x41f300(_0x1226cd);})['catch'](function(_0x3b8adc){logger[_0xde51('0x11')](_0xde51('0x17'),_0x3b8adc[_0xde51('0x14')],_0x33475c);_0x47300d(_0x53e90e[_0xde51('0x11')](0x1f4,_0x3b8adc[_0xde51('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 56d037b..7fbe01c 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 _0x88d5=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mailinteraction:addtags','addTags','put','tracked','mail','update','delete','mailinteraction:destroy','exports','multer','util'];(function(_0x3a1b94,_0x2b1b8b){var _0xb854d2=function(_0x1b1812){while(--_0x1b1812){_0x3a1b94['push'](_0x3a1b94['shift']());}};_0xb854d2(++_0x2b1b8b);}(_0x88d5,0x76));var _0x588d=function(_0x110e42,_0x134a3e){_0x110e42=_0x110e42-0x0;var _0x343f58=_0x88d5[_0x110e42];return _0x343f58;};'use strict';var multer=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var path=require(_0x588d('0x2'));var timeout=require(_0x588d('0x3'));var express=require(_0x588d('0x4'));var router=express['Router']();var auth=require(_0x588d('0x5'));var interaction=require(_0x588d('0x6'));var config=require('../../config/environment');var controller=require(_0x588d('0x7'));router[_0x588d('0x8')]('/',auth[_0x588d('0x9')](),controller[_0x588d('0xa')]);router[_0x588d('0x8')](_0x588d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x588d('0x8')](_0x588d('0xc'),auth[_0x588d('0x9')](),controller[_0x588d('0xd')]);router['get'](_0x588d('0xe'),auth['isAuthenticated'](),controller[_0x588d('0xf')]);router[_0x588d('0x8')]('/:id/download',auth[_0x588d('0x9')](),controller[_0x588d('0x10')]);router[_0x588d('0x11')]('/',auth['isAuthenticated'](),controller[_0x588d('0x12')]);router[_0x588d('0x11')]('/:id/messages',auth[_0x588d('0x9')](),controller[_0x588d('0x13')]);router[_0x588d('0x11')](_0x588d('0x14'),auth[_0x588d('0x9')](),interaction['tracked']('mail',_0x588d('0x15')),controller[_0x588d('0x16')]);router[_0x588d('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x588d('0x18')](_0x588d('0x19'),'mailinteraction:update'),controller[_0x588d('0x1a')]);router[_0x588d('0x1b')](_0x588d('0xc'),auth[_0x588d('0x9')](),interaction['tracked'](_0x588d('0x19'),_0x588d('0x1c')),controller['destroy']);router[_0x588d('0x1b')](_0x588d('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x588d('0x1d')]=router; \ No newline at end of file +var _0x8e52=['./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e52,0x1c6));var _0x28e5=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x8e52[_0x3f0b30];return _0x2748a5;};'use strict';var multer=require('multer');var util=require(_0x28e5('0x0'));var path=require(_0x28e5('0x1'));var timeout=require(_0x28e5('0x2'));var express=require(_0x28e5('0x3'));var router=express[_0x28e5('0x4')]();var auth=require(_0x28e5('0x5'));var interaction=require(_0x28e5('0x6'));var config=require(_0x28e5('0x7'));var controller=require(_0x28e5('0x8'));router[_0x28e5('0x9')]('/',auth[_0x28e5('0xa')](),controller[_0x28e5('0xb')]);router[_0x28e5('0x9')](_0x28e5('0xc'),auth[_0x28e5('0xa')](),controller['describe']);router[_0x28e5('0x9')](_0x28e5('0xd'),auth['isAuthenticated'](),controller[_0x28e5('0xe')]);router['get'](_0x28e5('0xf'),auth[_0x28e5('0xa')](),controller[_0x28e5('0x10')]);router[_0x28e5('0x9')](_0x28e5('0x11'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x28e5('0xa')](),controller[_0x28e5('0x12')]);router['post'](_0x28e5('0xf'),auth[_0x28e5('0xa')](),controller[_0x28e5('0x13')]);router['post'](_0x28e5('0x14'),auth['isAuthenticated'](),interaction[_0x28e5('0x15')](_0x28e5('0x16'),_0x28e5('0x17')),controller[_0x28e5('0x18')]);router[_0x28e5('0x19')](_0x28e5('0xd'),auth[_0x28e5('0xa')](),interaction[_0x28e5('0x15')](_0x28e5('0x16'),_0x28e5('0x1a')),controller[_0x28e5('0x1b')]);router[_0x28e5('0x1c')](_0x28e5('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x28e5('0x16'),_0x28e5('0x1d')),controller[_0x28e5('0x1e')]);router[_0x28e5('0x1c')](_0x28e5('0x14'),auth[_0x28e5('0xa')](),controller[_0x28e5('0x1f')]);module[_0x28e5('0x20')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 34b4b4a..ad4f79e 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 _0xa963=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xa963,0xb0));var _0x3a96=function(_0x2a098f,_0x1bf496){_0x2a098f=_0x2a098f-0x0;var _0x47cf56=_0xa963[_0x2a098f];return _0x47cf56;};'use strict';var Sequelize=require(_0x3a96('0x0'));var iconv=require(_0x3a96('0x1'));module[_0x3a96('0x2')]={'closed':{'type':Sequelize[_0x3a96('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3a96('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x3a96('0x5')](0x1fe)},'to':{'type':Sequelize[_0x3a96('0x5')]},'cc':{'type':Sequelize[_0x3a96('0x6')](_0x3a96('0x7'))},'subject':{'type':Sequelize[_0x3a96('0x6')]()},'attach':{'type':Sequelize[_0x3a96('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3a96('0x4')]},'substatus':{'type':Sequelize[_0x3a96('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x3a96('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3a96('0x8')]('in',_0x3a96('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3a96('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3a96('0x8')]('in',_0x3a96('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x3a96('0x6')]('long')},'lastMsgText':{'type':Sequelize[_0x3a96('0x6')](_0x3a96('0x7'))}}; \ No newline at end of file +var _0x3fca=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long','out','ENUM'];(function(_0xaa6ac0,_0x522266){var _0x297492=function(_0x2a89b0){while(--_0x2a89b0){_0xaa6ac0['push'](_0xaa6ac0['shift']());}};_0x297492(++_0x522266);}(_0x3fca,0xaa));var _0xa3fc=function(_0x33c504,_0x1bb9c8){_0x33c504=_0x33c504-0x0;var _0x4a6236=_0x3fca[_0x33c504];return _0x4a6236;};'use strict';var Sequelize=require(_0xa3fc('0x0'));var iconv=require(_0xa3fc('0x1'));module[_0xa3fc('0x2')]={'closed':{'type':Sequelize[_0xa3fc('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa3fc('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa3fc('0x5')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xa3fc('0x5')]},'cc':{'type':Sequelize[_0xa3fc('0x6')](_0xa3fc('0x7'))},'subject':{'type':Sequelize[_0xa3fc('0x6')]()},'attach':{'type':Sequelize[_0xa3fc('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa3fc('0x4')]},'substatus':{'type':Sequelize[_0xa3fc('0x5')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xa3fc('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xa3fc('0x9')]('in',_0xa3fc('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT']('long')},'lastMsgText':{'type':Sequelize[_0xa3fc('0x6')](_0xa3fc('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 25d16ce..a9ef4ff 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 _0x458d=['mail_interactions','cm_contacts','left_join','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','plainBody','compact','isEmpty','forEach','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','enableEmailPreview','all','show','params','rawAttributes','includeAll','include','options','create','body','update','addMessage','MailMessage','ids','getMessages','nolimit','MailInteractionId','findAll','rows','addTags','setTags','omit','spread','mailInteractionTags:save','removeTags','download','unix','server','files','tmp','root','attachments','join','Attachments','Messages','bcc','subject','get','mkdirSync','headers','Bcc','basename','existsSync','readFileSync','message%d.eml','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','MailInteraction','findOne','lastMsgText','fromString','catch','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','select','field','color','from','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users'];(function(_0xba2459,_0x4f8e0f){var _0x2400ce=function(_0x3a4936){while(--_0x3a4936){_0xba2459['push'](_0xba2459['shift']());}};_0x2400ce(++_0x4f8e0f);}(_0x458d,0x91));var _0xd458=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x458d[_0x13b8f3];return _0x1a6d06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd458('0x0'));var rimraf=require(_0xd458('0x1'));var zipdir=require(_0xd458('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd458('0x3'));var moment=require(_0xd458('0x4'));var BPromise=require(_0xd458('0x5'));var Mustache=require(_0xd458('0x6'));var util=require(_0xd458('0x7'));var path=require(_0xd458('0x8'));var sox=require(_0xd458('0x9'));var csv=require(_0xd458('0xa'));var ejs=require(_0xd458('0xb'));var fs=require('fs');var _=require(_0xd458('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd458('0xd'));var deskjs=require(_0xd458('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd458('0xf'));var htmlToText=require('html-to-text');var Redis=require(_0xd458('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd458('0x11'));var as=require(_0xd458('0x12'));var hardwareService=require(_0xd458('0x13'));var logger=require('../../config/logger')(_0xd458('0x14'));var utils=require(_0xd458('0x15'));var config=require('../../config/environment');var db=require(_0xd458('0x16'))['db'];config[_0xd458('0x17')]=_[_0xd458('0x18')](config['redis'],{'host':_0xd458('0x19'),'port':0x18eb});var socket=require(_0xd458('0x1a'))(new Redis(config[_0xd458('0x17')]));require(_0xd458('0x1b'))[_0xd458('0x1c')](socket);function respondWithStatusCode(_0xa0a6eb,_0x40b329){_0x40b329=_0x40b329||0xcc;return function(_0x212db6){if(_0x212db6){return _0xa0a6eb[_0xd458('0x1d')](_0x40b329);}return _0xa0a6eb[_0xd458('0x1e')](_0x40b329)[_0xd458('0x1f')]();};}function respondWithResult(_0xc2f00e,_0x443d35){_0x443d35=_0x443d35||0xc8;return function(_0xb1d9b7){if(_0xb1d9b7){return _0xc2f00e['status'](_0x443d35)[_0xd458('0x20')](_0xb1d9b7);}};}function respondWithFilteredResult(_0x10a0b0,_0x5ab3d9){return function(_0x3543c5){if(_0x3543c5){var _0x4e309c=_0x3543c5[_0xd458('0x21')],_0x1256af=_0x5ab3d9['offset'],_0x5b26eb=_0x5ab3d9[_0xd458('0x22')]+_0x5ab3d9[_0xd458('0x23')],_0x2798bc;if(_0x5b26eb>=_0x4e309c){_0x5b26eb=_0x4e309c;_0x2798bc=0xc8;}else{_0x2798bc=0xce;}_0x10a0b0[_0xd458('0x1e')](_0x2798bc);return _0x10a0b0[_0xd458('0x24')](_0xd458('0x25'),_0x1256af+'-'+_0x5b26eb+'/'+_0x4e309c)[_0xd458('0x20')](_0x3543c5);}return null;};}function patchUpdates(_0x511eff){return function(_0x417dcb){try{jsonpatch['apply'](_0x417dcb,_0x511eff,!![]);}catch(_0x3d250e){return BPromise['reject'](_0x3d250e);}return _0x417dcb['save']();};}function saveUpdates(_0x8ea52d,_0x313173){return function(_0x3307e8){if(_0x3307e8){return _0x3307e8['update'](_0x8ea52d)[_0xd458('0x26')](function(_0x58fd5c){return _0x58fd5c;});}return null;};}function removeEntity(_0x481a7b,_0x20e4ab){return function(_0x3e2a38){if(_0x3e2a38){return _0x3e2a38['destroy']()[_0xd458('0x26')](function(){_0x481a7b[_0xd458('0x1e')](0xcc)[_0xd458('0x1f')]();});}};}function handleEntityNotFound(_0x18298e,_0x3b8dfa){return function(_0x5d6603){if(!_0x5d6603){_0x18298e[_0xd458('0x1d')](0x194);}return _0x5d6603;};}function handleError(_0x1bb134,_0x4c7fcb){_0x4c7fcb=_0x4c7fcb||0x1f4;return function(_0x502825){logger[_0xd458('0x27')](_0x502825[_0xd458('0x28')]);if(_0x502825['name']){delete _0x502825[_0xd458('0x29')];}_0x1bb134[_0xd458('0x1e')](_0x4c7fcb)[_0xd458('0x2a')](_0x502825);};}function getInteractionUsers(_0x50ca1c,_0x1bcb86){return new BPromise(function(_0x1a9112,_0x1b6c9c){try{if(_0x1bcb86[_0x50ca1c['id']]){_0x50ca1c[_0xd458('0x2b')]=_[_0xd458('0x2c')](_0x1bcb86[_0x50ca1c['id']],function(_0x30d4fa){return{'id':_0x30d4fa['id'],'fullname':_0x30d4fa[_0xd458('0x2d')]};});}}catch(_0x3c2d3e){_0x1b6c9c(_0x3c2d3e);}_0x1a9112(_0x50ca1c);});}function getInteractionTags(_0x57633d,_0x3b6a70){return new BPromise(function(_0x110f6f,_0x2cad79){try{if(_0x57633d[_0xd458('0x2e')]){_0x57633d[_0xd458('0x2f')]=[];_0x57633d[_0xd458('0x2e')][_0xd458('0x30')](',')['forEach'](function(_0x48e1f4){_0x57633d[_0xd458('0x2f')][_0xd458('0x31')](_0x3b6a70[_0x48e1f4]);});}delete _0x57633d['TagIds'];}catch(_0x220bb8){_0x2cad79(_0x220bb8);}_0x110f6f(_0x57633d);});}function getLastMessageText(_0x423ec5){return new BPromise(function(_0x1538b3,_0xc5c731){return db[_0xd458('0x32')][_0xd458('0x33')]({'where':{'id':_0x423ec5['id']},'attributes':['lastMsgBody','lastMsgText'],'raw':!![]})[_0xd458('0x26')](function(_0x110dd3){if(!_0x110dd3[_0xd458('0x34')]){_0x423ec5[_0xd458('0x34')]=_['trimStart'](htmlToText[_0xd458('0x35')](_0x110dd3['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x423ec5[_0xd458('0x34')]=_0x110dd3[_0xd458('0x34')];}_0x1538b3(_0x423ec5);})[_0xd458('0x36')](function(_0x503492){_0xc5c731(_0x503492);});});}function updateMailInteraction(_0x47609a,_0x1ca545,_0x1a2d90,_0x4f3174){return new BPromise(function(_0x3ba898,_0x53dd26){return getInteractionUsers(_0x47609a,_0x1a2d90)['then'](function(_0xc65545){return getInteractionTags(_0xc65545,_0x1ca545);})[_0xd458('0x26')](function(_0x28a168){if(_0x4f3174){_0x3ba898(getLastMessageText(_0x28a168));}else{_0x3ba898(_0x28a168);}})[_0xd458('0x36')](function(_0x3e4f71){_0x53dd26(_0x3e4f71);});});}exports['index']=function(_0x3223a4,_0x49b400){var _0x2097fb={},_0x3e740d={},_0x53db58={'count':0x0,'rows':[]};var _0x20c524=_[_0xd458('0x2c')](db['MailInteraction']['rawAttributes'],function(_0x500faf){return{'name':_0x500faf['fieldName'],'type':_0x500faf['type'][_0xd458('0x37')]};});_0x3e740d[_0xd458('0x38')]=_['map'](_0x20c524,_0xd458('0x29'));_0x3e740d[_0xd458('0x39')]=_[_0xd458('0x3a')](_0x3223a4['query']);_0x3e740d[_0xd458('0x3b')]=_[_0xd458('0x3c')](_0x3e740d[_0xd458('0x38')],_0x3e740d[_0xd458('0x39')]);_0x2097fb[_0xd458('0x3d')]=_[_0xd458('0x3c')](_0x3e740d[_0xd458('0x38')],qs[_0xd458('0x3e')](_0x3223a4['query']['fields']));_0x2097fb[_0xd458('0x3d')]=_0x2097fb['attributes'][_0xd458('0x3f')]?_0x2097fb[_0xd458('0x3d')]:_0x3e740d[_0xd458('0x38')];if(!_0x3223a4[_0xd458('0x39')][_0xd458('0x40')]('nolimit')){_0x2097fb['limit']=qs['limit'](_0x3223a4[_0xd458('0x39')][_0xd458('0x23')]);_0x2097fb[_0xd458('0x22')]=qs[_0xd458('0x22')](_0x3223a4['query']['offset']);}_0x2097fb[_0xd458('0x41')]=qs[_0xd458('0x42')](_0x3223a4[_0xd458('0x39')][_0xd458('0x42')]);_0x2097fb['where']=qs[_0xd458('0x3b')](_[_0xd458('0x43')](_0x3223a4[_0xd458('0x39')],_0x3e740d[_0xd458('0x3b')]));var _0x3e13bd=[];var _0x288f98=squel[_0xd458('0x44')]()['field']('id')[_0xd458('0x45')](_0xd458('0x29'))['field'](_0xd458('0x46'))[_0xd458('0x47')]('tools_tags');var _0x2f4ee2=squel['select']()[_0xd458('0x45')]('u.id')[_0xd458('0x45')](_0xd458('0x48'))[_0xd458('0x45')](_0xd458('0x49'))[_0xd458('0x47')](_0xd458('0x4a'),'ui')['left_join'](_0xd458('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x1d8a11=squel[_0xd458('0x44')]()[_0xd458('0x47')](_0xd458('0x4c'),'i')['left_join'](_0xd458('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd458('0x4e')]('users','o','o.id\x20=\x20i.UserId')[_0xd458('0x4e')](_0xd458('0x4f'),'a',_0xd458('0x50'))[_0xd458('0x4e')]('mail_messages','me',_0xd458('0x51'))[_0xd458('0x4e')]('mail_interaction_has_tags','it',_0xd458('0x52'))[_0xd458('0x4e')]('tools_tags','t',_0xd458('0x53'));var _0x4db9f2=squel[_0xd458('0x54')]();var _0x432431=[];var _0xd08293=squel['expr']();var _0x2d94f3;if(_0x3223a4[_0xd458('0x39')][_0xd458('0x55')]){_0x2d94f3=as[_0xd458('0x56')](_0x3223a4[_0xd458('0x39')][_0xd458('0x55')]);var _0x1a98ab=_0x2d94f3['sqlOperator'];for(var _0x1d6922=0x0;_0x1d6922<_0x2d94f3[_0xd458('0x57')][_0xd458('0x3f')];_0x1d6922++){var _0x482149=_0x2d94f3[_0xd458('0x57')][_0x1d6922];var _0x3b7a96='i';var _0x15f247=_[_0xd458('0x58')](_0x20c524,[_0xd458('0x29'),_0x482149[_0xd458('0x45')]]);if(!_0x15f247){switch(_0x482149['field']){case _0xd458('0x59'):if(_0x482149[_0xd458('0x5a')]==0x1){_0x1d8a11[_0xd458('0x5b')]('`'+_0x482149[_0xd458('0x45')]+_0xd458('0x5c'));}else{_0x1d8a11['having']('`'+_0x482149[_0xd458('0x45')]+_0xd458('0x5d'));}break;case _0xd458('0x5e'):if(_0x482149[_0xd458('0x5f')]===_0xd458('0x60')){if(_0x482149[_0xd458('0x5a')]['split']('\x20')[_0xd458('0x3f')]>0x1){_0x4db9f2[_0x1a98ab](_0xd458('0x61'),qs['getFullTextValue'](_0x482149['value']),null);}else{var _0x39548d='%'+_0x482149[_0xd458('0x5a')]+'%';_0x4db9f2[_0x1a98ab](_0xd458('0x62'),_0x39548d,_0x39548d,_0x39548d);}}else{_0x15f247=_[_0xd458('0x58')](_0x20c524,['name',_0xd458('0x63')]);_0x482149[_0xd458('0x45')]='ContactId';_0x35fd4d=as[_0xd458('0x64')](_0x3b7a96,_0x15f247['type'],_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d[_0xd458('0x65')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x66')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);}break;case _0xd458('0x67'):var _0x37181b=_0x482149[_0xd458('0x5a')]['split'](',')[_0xd458('0x2c')](function(_0x5b19b2){return Number(_0x5b19b2);});_0x37181b['forEach'](function(_0x32aefd){_0xd08293['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x32aefd+',%');});_0x432431=_[_0xd458('0x68')](_0x432431,_0x37181b);break;case _0xd458('0x69'):if(_0x482149[_0xd458('0x5f')]===_0xd458('0x60')){_0x4db9f2[_0x1a98ab](_0xd458('0x6a'),'%'+_0x482149[_0xd458('0x5a')]+'%',null);}else{_0x15f247=_[_0xd458('0x58')](_0x20c524,[_0xd458('0x29'),_0xd458('0x6b')]);_0x482149[_0xd458('0x45')]=_0xd458('0x6b');_0x35fd4d=as[_0xd458('0x64')](_0x3b7a96,_0x15f247[_0xd458('0x6c')],_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d['text'],_0x35fd4d[_0xd458('0x5a')]['start'],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);}break;case _0xd458('0x6d'):_0x35fd4d=as[_0xd458('0x64')]('me',null,_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d[_0xd458('0x65')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x66')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);break;}}else{var _0x35fd4d=as[_0xd458('0x64')](_0x3b7a96,_0x15f247[_0xd458('0x6c')],_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d['text'],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x66')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);}}}else{var _0x222dd0=_(_0x3223a4[_0xd458('0x39')])['keys']()[_0xd458('0x2c')](function(_0x31db51){return _['some'](_0x20c524,['name',_0x31db51])?_0x31db51:undefined;})[_0xd458('0x6e')]()['value']();if(!_[_0xd458('0x6f')](_0x222dd0)){_0x222dd0[_0xd458('0x70')](function(_0x2295ce){if(_0x2295ce===_0xd458('0x71')){_0x1d8a11[_0xd458('0x72')](_0xd458('0x73'),[][_0xd458('0x74')](_0x3223a4[_0xd458('0x39')][_0x2295ce]));}else if(_0x2295ce===_0xd458('0x75')){var _0x22b4cb=JSON[_0xd458('0x76')](_0x3223a4[_0xd458('0x39')][_0x2295ce])[_0xd458('0x77')];var _0x29d1d4=JSON['parse'](_0x3223a4[_0xd458('0x39')][_0x2295ce])[_0xd458('0x78')];_0x1d8a11[_0xd458('0x72')](_0xd458('0x79'),_0x22b4cb,_0x29d1d4);}else{if(_0x3223a4[_0xd458('0x39')][_0x2295ce]===_0xd458('0x7a')){_0x1d8a11[_0xd458('0x72')]('i.'+_0x2295ce+_0xd458('0x7b'));}else{_0x1d8a11[_0xd458('0x72')]('i.'+_0x2295ce+'\x20=\x20?',_0x3223a4[_0xd458('0x39')][_0x2295ce]);}}});}if(_0x3223a4['query'][_0xd458('0x7c')]){if(_0x3223a4[_0xd458('0x39')][_0xd458('0x7c')]==0x1){_0x1d8a11[_0xd458('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x1d8a11[_0xd458('0x5b')](_0xd458('0x7d'));}}if(_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')]){_0x432431=_['isArray'](_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')])?_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')]:new Array(_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')]);_0x432431[_0xd458('0x70')](function(_0x49cab7){_0xd08293['or'](_0xd458('0x7f'),'%,'+_0x49cab7+',%');});}if(_0x3223a4['query'][_0xd458('0x80')]){var _0x17c2bc=_0x3223a4[_0xd458('0x39')]['filter'][_0xd458('0x81')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x17c2bc)){_0x4db9f2['or']('i.id\x20LIKE\x20?',_0x17c2bc+'%');}else if(qs[_0xd458('0x82')](_0x17c2bc)){_0x4db9f2['or'](_0xd458('0x83'),_0x17c2bc+'%');}else{_0x4db9f2['or'](_0xd458('0x84'),qs[_0xd458('0x85')](_0x17c2bc))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd458('0x85')](_0x17c2bc));}}}_0x1d8a11[_0xd458('0x72')](_0x4db9f2);_0x1d8a11['group']('i.id');var _0x288f2d={'type':db['Sequelize']['QueryTypes'][_0xd458('0x86')],'raw':!![]};var _0x830d2b=_0x1d8a11[_0xd458('0x87')]();_0x830d2b[_0xd458('0x45')](_0xd458('0x88'));_0x830d2b[_0xd458('0x45')](_0xd458('0x89'),_0xd458('0x59'));if(_0x2097fb[_0xd458('0x41')]){_0x2097fb[_0xd458('0x41')][_0xd458('0x70')](function(_0x4edad7){_0x1d8a11[_0xd458('0x41')]('i.'+_0x4edad7[0x0],_0x4edad7[0x1]===_0xd458('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x432431)){_0x1d8a11['having'](_0xd08293);_0x830d2b[_0xd458('0x72')](_0xd458('0x8b'),_0x432431);}BPromise[_0xd458('0x8c')]()[_0xd458('0x26')](function(){if(!_0x2d94f3&&_0x3223a4['query'][_0xd458('0x71')])return;return _0x3223a4['user'][_0xd458('0x8d')]({'attributes':['id'],'raw':!![]})[_0xd458('0x26')](function(_0x1c0135){if(_[_0xd458('0x6f')](_0x1c0135)){_0x830d2b[_0xd458('0x72')](_0xd458('0x8e'));_0x1d8a11[_0xd458('0x72')]('i.MailAccountId\x20IS\x20NULL');}else{_0x830d2b[_0xd458('0x72')](_0xd458('0x73'),_[_0xd458('0x2c')](_0x1c0135,'id'));_0x1d8a11[_0xd458('0x72')]('i.MailAccountId\x20IN\x20?',_[_0xd458('0x2c')](_0x1c0135,'id'));}});})['then'](function(){db[_0xd458('0x8f')][_0xd458('0x39')](_0x830d2b[_0xd458('0x90')](),_0x288f2d)[_0xd458('0x26')](function(_0x3af203){_0x53db58[_0xd458('0x21')]=_0x3af203[_0xd458('0x3f')];if(_0x53db58['count']===0x0)return[];return db[_0xd458('0x8f')]['query'](_0x288f98[_0xd458('0x90')](),_0x288f2d)['then'](function(_0x125af4){_0x3e13bd=_[_0xd458('0x91')](_0x125af4,'id');_0x288f2d=_[_0xd458('0x92')](_0x288f2d,{'model':db[_0xd458('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3223a4[_0xd458('0x39')][_0xd458('0x3e')]){_0x2097fb[_0xd458('0x3d')]['forEach'](function(_0x1d530c){_0x1d8a11[_0xd458('0x45')]('i.'+_0x1d530c);});}else{_0x1d8a11[_0xd458('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd458('0x59'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x93'),'Account.key');_0x1d8a11[_0xd458('0x45')]('a.mandatoryDisposition',_0xd458('0x94'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x88'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x95'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x96'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x97'));_0x1d8a11['field'](_0xd458('0x98'));_0x1d8a11['field'](_0xd458('0x99'));_0x1d8a11['field'](_0xd458('0x9a'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x9b'));_0x1d8a11[_0xd458('0x45')]('i.subject');_0x1d8a11[_0xd458('0x45')]('i.disposition');_0x1d8a11['field']('i.substatus');_0x1d8a11[_0xd458('0x45')](_0xd458('0x9c'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x9d'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x9e'));_0x1d8a11[_0xd458('0x45')]('i.UserId');_0x1d8a11[_0xd458('0x45')](_0xd458('0x9f'),_0xd458('0xa0'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xa1'),_0xd458('0xa2'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xa3'),_0xd458('0xa4'));_0x1d8a11[_0xd458('0x45')]('c.phone',_0xd458('0xa5'));_0x1d8a11[_0xd458('0x45')]('c.mobile',_0xd458('0xa6'));_0x1d8a11['field'](_0xd458('0xa7'),_0xd458('0xa8'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xa9'),'Owner.fullname');_0x1d8a11[_0xd458('0x45')](_0xd458('0xaa'),_0xd458('0xab'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xac'),_0xd458('0x2e'));}_0x1d8a11[_0xd458('0x23')](_0x2097fb[_0xd458('0x23')]);_0x1d8a11[_0xd458('0x22')](_0x2097fb[_0xd458('0x22')]);return db[_0xd458('0x8f')][_0xd458('0x39')](_0x1d8a11[_0xd458('0x90')](),_0x288f2d);})[_0xd458('0x26')](function(_0x5054fe){_0x2f4ee2[_0xd458('0x72')](_0xd458('0xad'),_[_0xd458('0x2c')](_0x5054fe,'id'));return db[_0xd458('0x8f')][_0xd458('0x39')](_0x2f4ee2[_0xd458('0x90')](),_0x288f2d)[_0xd458('0x26')](function(_0x284949){var _0x4cd76d=_['groupBy'](_0x284949,'MailInteractionId');var _0x1d4921=[];return db['Setting']['findOne']({'attributes':[_0xd458('0xae')],'raw':!![]})[_0xd458('0x26')](function(_0x5545a8){var _0x415310=_0x5545a8[_0xd458('0xae')];_0x5054fe[_0xd458('0x70')](function(_0x4127e1){_0x1d4921[_0xd458('0x31')](updateMailInteraction(_0x4127e1,_0x3e13bd,_0x4cd76d,_0x415310));});return BPromise[_0xd458('0xaf')](_0x1d4921);});});});})[_0xd458('0x26')](function(_0x445aec){_0x53db58['rows']=_0x445aec;return _0x53db58;})['then'](respondWithFilteredResult(_0x49b400,_0x2097fb));})[_0xd458('0x36')](handleError(_0x49b400,null));};exports[_0xd458('0xb0')]=function(_0x4b5e40,_0x2e420c){var _0x396987={'raw':![],'where':{'id':_0x4b5e40[_0xd458('0xb1')]['id']}},_0x5dcd54={};_0x5dcd54['model']=_[_0xd458('0x3a')](db[_0xd458('0x32')][_0xd458('0xb2')]);_0x5dcd54[_0xd458('0x39')]=_[_0xd458('0x3a')](_0x4b5e40[_0xd458('0x39')]);_0x5dcd54['filters']=_[_0xd458('0x3c')](_0x5dcd54[_0xd458('0x38')],_0x5dcd54[_0xd458('0x39')]);_0x396987[_0xd458('0x3d')]=_['intersection'](_0x5dcd54[_0xd458('0x38')],qs[_0xd458('0x3e')](_0x4b5e40[_0xd458('0x39')][_0xd458('0x3e')]));_0x396987[_0xd458('0x3d')]=_0x396987['attributes'][_0xd458('0x3f')]?_0x396987['attributes']:_0x5dcd54[_0xd458('0x38')];if(_0x4b5e40[_0xd458('0x39')][_0xd458('0xb3')]){_0x396987[_0xd458('0xb4')]=[{'all':!![]}];}_0x396987=_[_0xd458('0x92')]({},_0x396987,_0x4b5e40[_0xd458('0xb5')]);return db[_0xd458('0x32')]['find'](_0x396987)['then'](handleEntityNotFound(_0x2e420c,null))[_0xd458('0x26')](respondWithResult(_0x2e420c,null))[_0xd458('0x36')](handleError(_0x2e420c,null));};exports['create']=function(_0x4a2376,_0x430200){return db[_0xd458('0x32')][_0xd458('0xb6')](_0x4a2376[_0xd458('0xb7')],{})[_0xd458('0x26')](respondWithResult(_0x430200,0xc9))[_0xd458('0x36')](handleError(_0x430200,null));};exports[_0xd458('0xb8')]=function(_0xd9d2df,_0x39fc5b){if(_0xd9d2df[_0xd458('0xb7')]['id']){delete _0xd9d2df[_0xd458('0xb7')]['id'];}return db['MailInteraction'][_0xd458('0x58')]({'where':{'id':_0xd9d2df[_0xd458('0xb1')]['id']}})[_0xd458('0x26')](handleEntityNotFound(_0x39fc5b,null))[_0xd458('0x26')](saveUpdates(_0xd9d2df[_0xd458('0xb7')],null))[_0xd458('0x26')](respondWithResult(_0x39fc5b,null))['catch'](handleError(_0x39fc5b,null));};exports['destroy']=function(_0x1a4352,_0x3c18e0){return db[_0xd458('0x32')][_0xd458('0x58')]({'where':{'id':_0x1a4352['params']['id']}})['then'](handleEntityNotFound(_0x3c18e0,null))[_0xd458('0x26')](removeEntity(_0x3c18e0,null))['catch'](handleError(_0x3c18e0,null));};exports['describe']=function(_0x5d11c6,_0x61f0bc){return db[_0xd458('0x32')]['describe']()[_0xd458('0x26')](respondWithResult(_0x61f0bc,null))[_0xd458('0x36')](handleError(_0x61f0bc,null));};exports[_0xd458('0xb9')]=function(_0x13b651,_0x3c395a,_0x5bc6d0){return db[_0xd458('0xba')][_0xd458('0x58')]({'where':{'id':_0x13b651[_0xd458('0xb1')]['id']}})['then'](handleEntityNotFound(_0x3c395a,null))[_0xd458('0x26')](function(_0x51aa8a){if(_0x51aa8a){return _0x51aa8a[_0xd458('0xb9')](_0x13b651[_0xd458('0xb7')][_0xd458('0xbb')],_['omit'](_0x13b651[_0xd458('0xb7')],[_0xd458('0xbb'),'id'])||{});}})[_0xd458('0x26')](respondWithResult(_0x3c395a,null))[_0xd458('0x36')](handleError(_0x3c395a,null));};exports[_0xd458('0xbc')]=function(_0x26fe76,_0x52ea07,_0x312bd2){var _0x20b24a={'raw':![],'where':{}};var _0x37aef5={};var _0x574df1={'count':0x0,'rows':[]};return db['MailInteraction'][_0xd458('0x33')]({'where':{'id':_0x26fe76[_0xd458('0xb1')]['id']}})[_0xd458('0x26')](handleEntityNotFound(_0x52ea07,null))['then'](function(_0x2f3ecc){if(_0x2f3ecc){_0x37aef5[_0xd458('0x38')]=_['keys'](db[_0xd458('0xba')][_0xd458('0xb2')]);_0x37aef5[_0xd458('0x39')]=_[_0xd458('0x3a')](_0x26fe76[_0xd458('0x39')]);_0x37aef5[_0xd458('0x3b')]=_[_0xd458('0x3c')](_0x37aef5[_0xd458('0x38')],_0x37aef5[_0xd458('0x39')]);_0x20b24a[_0xd458('0x3d')]=_[_0xd458('0x3c')](_0x37aef5['model'],qs[_0xd458('0x3e')](_0x26fe76['query'][_0xd458('0x3e')]));_0x20b24a['attributes']=_0x20b24a[_0xd458('0x3d')]['length']?_0x20b24a[_0xd458('0x3d')]:_0x37aef5[_0xd458('0x38')];if(!_0x26fe76[_0xd458('0x39')][_0xd458('0x40')](_0xd458('0xbd'))){_0x20b24a[_0xd458('0x23')]=qs[_0xd458('0x23')](_0x26fe76[_0xd458('0x39')][_0xd458('0x23')]);_0x20b24a[_0xd458('0x22')]=qs[_0xd458('0x22')](_0x26fe76['query'][_0xd458('0x22')]);}_0x20b24a[_0xd458('0x41')]=qs[_0xd458('0x42')](_0x26fe76[_0xd458('0x39')][_0xd458('0x42')]);_0x20b24a[_0xd458('0x72')]=qs[_0xd458('0x3b')](_[_0xd458('0x43')](_0x26fe76['query'],_0x37aef5[_0xd458('0x3b')]));_0x20b24a['where'][_0xd458('0xbe')]=_0x2f3ecc['id'];if(_0x26fe76[_0xd458('0x39')][_0xd458('0x80')]){_0x20b24a['where']=_[_0xd458('0x92')](_0x20b24a[_0xd458('0x72')],{'$or':_[_0xd458('0x2c')](_0x20b24a[_0xd458('0x3d')],function(_0x1d911f){var _0x1b3d95={};_0x1b3d95[_0x1d911f]={'$like':'%'+_0x26fe76[_0xd458('0x39')][_0xd458('0x80')]+'%'};return _0x1b3d95;})});}if(_0x26fe76['query'][_0xd458('0x77')]){var _0x1d7140=_0x26fe76['query'][_0xd458('0x77')]['split'](',');var _0x224cae={};_0x224cae[_0x1d7140[0x0]]={'$gte':moment(_0x1d7140[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x20b24a['where']=_[_0xd458('0x92')](_0x20b24a['where'],_0x224cae);}_0x20b24a=_[_0xd458('0x92')]({},_0x20b24a,_0x26fe76[_0xd458('0xb5')]);return db['MailMessage']['count']({'where':_0x20b24a[_0xd458('0x72')]})[_0xd458('0x26')](function(_0x4708ba){_0x574df1['count']=_0x4708ba;if(_0x26fe76['query'][_0xd458('0xb3')]){_0x20b24a[_0xd458('0xb4')]=[{'all':!![]}];}return db[_0xd458('0xba')][_0xd458('0xbf')](_0x20b24a);})['then'](function(_0x17f169){_0x574df1[_0xd458('0xc0')]=_0x17f169;return _0x574df1;});}})[_0xd458('0x26')](respondWithFilteredResult(_0x52ea07,_0x20b24a))[_0xd458('0x36')](handleError(_0x52ea07,null));};exports[_0xd458('0xc1')]=function(_0x4fa996,_0x128d2a,_0x48be92){return db[_0xd458('0x32')][_0xd458('0x58')]({'where':{'id':_0x4fa996[_0xd458('0xb1')]['id']}})[_0xd458('0x26')](handleEntityNotFound(_0x128d2a,null))[_0xd458('0x26')](function(_0x58f5c6){if(_0x58f5c6){return _0x58f5c6[_0xd458('0xc2')](_0x4fa996[_0xd458('0xb7')][_0xd458('0xbb')],_[_0xd458('0xc3')](_0x4fa996['body'],[_0xd458('0xbb'),'id'])||{})[_0xd458('0xc4')](function(){return db[_0xd458('0x67')]['findAll']({'attributes':['id',_0xd458('0x29'),_0xd458('0x46')],'where':{'id':_0x4fa996[_0xd458('0xb7')][_0xd458('0xbb')]}});})['then'](function(_0x27b2cf){socket['emit'](_0xd458('0xc5'),{'id':Number(_0x4fa996[_0xd458('0xb1')]['id']),'tags':_0x27b2cf||[]});return{'id':Number(_0x4fa996['params']['id']),'tags':_0x27b2cf||[]};});}})[_0xd458('0x26')](respondWithResult(_0x128d2a,null))[_0xd458('0x36')](handleError(_0x128d2a,null));};exports[_0xd458('0xc6')]=function(_0x27271f,_0x5ad8e3,_0x471119){return db[_0xd458('0x32')]['find']({'where':{'id':_0x27271f[_0xd458('0xb1')]['id']}})['then'](handleEntityNotFound(_0x5ad8e3,null))[_0xd458('0x26')](function(_0x309a35){if(_0x309a35){return _0x309a35['removeTags'](_0x27271f['query'][_0xd458('0xbb')]);}})[_0xd458('0x26')](respondWithStatusCode(_0x5ad8e3,null))[_0xd458('0x36')](handleError(_0x5ad8e3,null));};exports[_0xd458('0xc7')]=function(_0x40f8b6,_0x1d30a0){var _0x22b8b3=moment()[_0xd458('0xc8')]()['toString']();var _0x18a235=path['join'](config['root'],_0xd458('0xc9'),_0xd458('0xca'),_0xd458('0xcb'));var _0x495665=path['join'](config[_0xd458('0xcc')],_0xd458('0xc9'),'files',_0xd458('0xcd'));var _0x564e76=path['join'](_0x18a235,_0x22b8b3);var _0x532cee=util['format']('transcript-%d-%s.zip',_0x40f8b6[_0xd458('0xb1')]['id'],_0x22b8b3);var _0x27d470=path[_0xd458('0xce')](_0x18a235,_0x532cee);var _0x38254a=[];if(_0x40f8b6[_0xd458('0x39')][_0xd458('0xcd')]){_0x38254a[_0xd458('0x31')]({'model':db['Attachment'],'as':_0xd458('0xcf'),'raw':!![]});}var _0x51f821=[{'model':db[_0xd458('0xba')],'as':_0xd458('0xd0'),'attributes':['id',_0xd458('0xb7'),_0xd458('0x47'),'to','cc',_0xd458('0xd1'),_0xd458('0xd2'),_0xd458('0x75')],'where':{'secret':![]},'order':qs[_0xd458('0x42')]('id'),'include':_0x38254a}];return db[_0xd458('0x32')][_0xd458('0x58')]({'where':{'id':_0x40f8b6['params']['id']},'include':_0x51f821})[_0xd458('0x26')](handleEntityNotFound(_0x1d30a0,null))[_0xd458('0x26')](function(_0x132b20){if(_0x132b20&&_0x132b20[_0xd458('0xd0')]){var _0x3311ef=_0x132b20[_0xd458('0xd3')]({'plain':!![]});fs[_0xd458('0xd4')](_0x564e76);return BPromise['each'](_0x3311ef[_0xd458('0xd0')],function(_0x44deeb,_0x232eca){var _0x53333d={'from':_0x44deeb[_0xd458('0x47')],'to':_0x44deeb['to'],'subject':_0x44deeb['subject'],'html':_0x44deeb['body'],'headers':{'Date':moment(_0x44deeb[_0xd458('0x75')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x44deeb['cc']){_0x53333d[_0xd458('0xd5')]['Cc']=_0x44deeb['cc'];}if(_0x44deeb[_0xd458('0xd1')]){_0x53333d['headers'][_0xd458('0xd6')]=_0x44deeb[_0xd458('0xd1')];}return new BPromise(function(_0x363077,_0x36c2e4){if(_0x44deeb[_0xd458('0xcf')]){for(var _0x543fc3=0x0;_0x543fc3<_0x44deeb['Attachments']['length'];_0x543fc3++){var _0x4bfbdf=_0x44deeb[_0xd458('0xcf')][_0x543fc3];var _0x28e02e=path['join'](_0x495665,_0x4bfbdf[_0xd458('0xd7')]);if(fs[_0xd458('0xd8')](_0x28e02e)){_0x53333d[_0xd458('0xcd')][_0xd458('0x31')]({'name':_0x4bfbdf[_0xd458('0x29')],'contentType':_0x4bfbdf[_0xd458('0x6c')],'data':fs[_0xd458('0xd9')](_0x28e02e)});}}}emlformat['build'](_0x53333d,function(_0x573539,_0x5207d3){if(_0x573539)return _0x36c2e4(_0x573539);fs['writeFileSync'](path['join'](_0x564e76,util['format'](_0xd458('0xda'),_0x232eca)),_0x5207d3);return _0x363077(_0x5207d3);});});})['then'](function(){return new BPromise(function(_0x2a17ff,_0x4db0b3){zipdir(_0x564e76,{'saveTo':_0x27d470},function(_0x20e0eb,_0x524023){if(_0x20e0eb)return _0x4db0b3(_0x20e0eb);return _0x2a17ff(_0x524023);});})[_0xd458('0x26')](function(){return new BPromise(function(_0x2b7aa7,_0x11833e){rimraf(_0x564e76,function(_0x414614){if(_0x414614)_0x11833e(_0x414614);return _0x2b7aa7();});});})[_0xd458('0x26')](function(){return _0x1d30a0[_0xd458('0xc7')](_0x27d470,_0x532cee,function(_0x41503f){if(_0x41503f){console[_0xd458('0xdb')]('err',_0x41503f);}else{fs[_0xd458('0xdc')](_0x27d470);}});});});}else{return _0x1d30a0['sendStatus'](0xc8);}})[_0xd458('0x36')](handleError(_0x1d30a0,null));}; \ No newline at end of file +var _0xafae=['intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','field','from','tools_tags','u.fullname','ui.MailInteractionId','u.id\x20=\x20ui.UserId','select','mail_interactions','left_join','cm_contacts','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20=\x200','`\x20>\x200','operator','$substring','value','getFullTextValue','ContactId','buildExpression','text','start','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','some','compact','isEmpty','MailAccountId','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','t.id\x20IN\x20?','resolve','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','i.createdAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','i.UserId','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','params','rawAttributes','includeAll','include','options','create','body','destroy','describe','addMessage','MailMessage','ids','omit','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','log','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','count','Content-Range','apply','reject','save','update','then','end','stack','name','send','Users','map','TagIds','forEach','Tags','MailInteraction','findOne','lastMsgBody','lastMsgText','fromString','catch','fieldName','type','model','query','keys','filters'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xafae,0x198));var _0xeafa=function(_0x3c5433,_0x515ff7){_0x3c5433=_0x3c5433-0x0;var _0x425f26=_0xafae[_0x3c5433];return _0x425f26;};'use strict';var pdf=require(_0xeafa('0x0'));var emlformat=require(_0xeafa('0x1'));var rimraf=require(_0xeafa('0x2'));var zipdir=require(_0xeafa('0x3'));var jsonpatch=require(_0xeafa('0x4'));var rp=require(_0xeafa('0x5'));var moment=require(_0xeafa('0x6'));var BPromise=require(_0xeafa('0x7'));var Mustache=require(_0xeafa('0x8'));var util=require(_0xeafa('0x9'));var path=require(_0xeafa('0xa'));var sox=require(_0xeafa('0xb'));var csv=require(_0xeafa('0xc'));var ejs=require(_0xeafa('0xd'));var fs=require('fs');var _=require(_0xeafa('0xe'));var squel=require('squel');var crypto=require(_0xeafa('0xf'));var jsforce=require(_0xeafa('0x10'));var deskjs=require(_0xeafa('0x11'));var toCsv=require(_0xeafa('0xc'));var querystring=require(_0xeafa('0x12'));var Papa=require(_0xeafa('0x13'));var htmlToText=require(_0xeafa('0x14'));var Redis=require(_0xeafa('0x15'));var authService=require(_0xeafa('0x16'));var qs=require(_0xeafa('0x17'));var as=require(_0xeafa('0x18'));var hardwareService=require(_0xeafa('0x19'));var logger=require(_0xeafa('0x1a'))(_0xeafa('0x1b'));var utils=require('../../config/utils');var config=require(_0xeafa('0x1c'));var db=require(_0xeafa('0x1d'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xeafa('0x1e'),'port':0x18eb});var socket=require(_0xeafa('0x1f'))(new Redis(config['redis']));require(_0xeafa('0x20'))[_0xeafa('0x21')](socket);function respondWithStatusCode(_0x600cd8,_0x50494e){_0x50494e=_0x50494e||0xcc;return function(_0x3070c8){if(_0x3070c8){return _0x600cd8[_0xeafa('0x22')](_0x50494e);}return _0x600cd8['status'](_0x50494e)['end']();};}function respondWithResult(_0x5c132e,_0x159e8f){_0x159e8f=_0x159e8f||0xc8;return function(_0x4d2f43){if(_0x4d2f43){return _0x5c132e[_0xeafa('0x23')](_0x159e8f)['json'](_0x4d2f43);}};}function respondWithFilteredResult(_0x1346f6,_0x3ee2ff){return function(_0x562b00){if(_0x562b00){var _0x13ee1c=_0x562b00[_0xeafa('0x24')],_0x31625b=_0x3ee2ff['offset'],_0x4d5d83=_0x3ee2ff['offset']+_0x3ee2ff['limit'],_0x38a380;if(_0x4d5d83>=_0x13ee1c){_0x4d5d83=_0x13ee1c;_0x38a380=0xc8;}else{_0x38a380=0xce;}_0x1346f6[_0xeafa('0x23')](_0x38a380);return _0x1346f6['set'](_0xeafa('0x25'),_0x31625b+'-'+_0x4d5d83+'/'+_0x13ee1c)['json'](_0x562b00);}return null;};}function patchUpdates(_0x517d0d){return function(_0x383893){try{jsonpatch[_0xeafa('0x26')](_0x383893,_0x517d0d,!![]);}catch(_0x5158ef){return BPromise[_0xeafa('0x27')](_0x5158ef);}return _0x383893[_0xeafa('0x28')]();};}function saveUpdates(_0x8eafb6,_0x27841f){return function(_0x5bd368){if(_0x5bd368){return _0x5bd368[_0xeafa('0x29')](_0x8eafb6)[_0xeafa('0x2a')](function(_0xd14958){return _0xd14958;});}return null;};}function removeEntity(_0x5a25ee,_0x1a1a1c){return function(_0x467deb){if(_0x467deb){return _0x467deb['destroy']()['then'](function(){_0x5a25ee[_0xeafa('0x23')](0xcc)[_0xeafa('0x2b')]();});}};}function handleEntityNotFound(_0xa814fe,_0x20a3d8){return function(_0x10319b){if(!_0x10319b){_0xa814fe[_0xeafa('0x22')](0x194);}return _0x10319b;};}function handleError(_0x1b7419,_0xa5fc8d){_0xa5fc8d=_0xa5fc8d||0x1f4;return function(_0x50c0e1){logger['error'](_0x50c0e1[_0xeafa('0x2c')]);if(_0x50c0e1['name']){delete _0x50c0e1[_0xeafa('0x2d')];}_0x1b7419[_0xeafa('0x23')](_0xa5fc8d)[_0xeafa('0x2e')](_0x50c0e1);};}function getInteractionUsers(_0x1763f9,_0x22d6b6){return new BPromise(function(_0x3f3681,_0x1f6ec1){try{if(_0x22d6b6[_0x1763f9['id']]){_0x1763f9[_0xeafa('0x2f')]=_[_0xeafa('0x30')](_0x22d6b6[_0x1763f9['id']],function(_0x469c90){return{'id':_0x469c90['id'],'fullname':_0x469c90['fullname']};});}}catch(_0x57d3d9){_0x1f6ec1(_0x57d3d9);}_0x3f3681(_0x1763f9);});}function getInteractionTags(_0x491ec1,_0x266926){return new BPromise(function(_0x1f9f03,_0x58b89a){try{if(_0x491ec1[_0xeafa('0x31')]){_0x491ec1['Tags']=[];_0x491ec1[_0xeafa('0x31')]['split'](',')[_0xeafa('0x32')](function(_0x43b205){_0x491ec1[_0xeafa('0x33')]['push'](_0x266926[_0x43b205]);});}delete _0x491ec1[_0xeafa('0x31')];}catch(_0x4c5e2f){_0x58b89a(_0x4c5e2f);}_0x1f9f03(_0x491ec1);});}function getLastMessageText(_0x4f8e93){return new BPromise(function(_0x459e24,_0x11c8ce){return db[_0xeafa('0x34')][_0xeafa('0x35')]({'where':{'id':_0x4f8e93['id']},'attributes':[_0xeafa('0x36'),_0xeafa('0x37')],'raw':!![]})[_0xeafa('0x2a')](function(_0x3ecfe6){if(!_0x3ecfe6[_0xeafa('0x37')]){_0x4f8e93['lastMsgText']=_['trimStart'](htmlToText[_0xeafa('0x38')](_0x3ecfe6['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x4f8e93[_0xeafa('0x37')]=_0x3ecfe6['lastMsgText'];}_0x459e24(_0x4f8e93);})[_0xeafa('0x39')](function(_0x380256){_0x11c8ce(_0x380256);});});}function updateMailInteraction(_0x59500e,_0x4eecf1,_0x1257a6,_0x3929fe){return new BPromise(function(_0x12c3b4,_0x37c1b7){return getInteractionUsers(_0x59500e,_0x1257a6)[_0xeafa('0x2a')](function(_0x3e3937){return getInteractionTags(_0x3e3937,_0x4eecf1);})[_0xeafa('0x2a')](function(_0xf64c64){if(_0x3929fe){_0x12c3b4(getLastMessageText(_0xf64c64));}else{_0x12c3b4(_0xf64c64);}})[_0xeafa('0x39')](function(_0x1786e6){_0x37c1b7(_0x1786e6);});});}exports['index']=function(_0x318eb6,_0x22bfba){var _0x177af6={},_0x41f789={},_0x2e4272={'count':0x0,'rows':[]};var _0x526746=_[_0xeafa('0x30')](db['MailInteraction']['rawAttributes'],function(_0x1bb30f){return{'name':_0x1bb30f[_0xeafa('0x3a')],'type':_0x1bb30f[_0xeafa('0x3b')]['key']};});_0x41f789[_0xeafa('0x3c')]=_['map'](_0x526746,_0xeafa('0x2d'));_0x41f789[_0xeafa('0x3d')]=_[_0xeafa('0x3e')](_0x318eb6[_0xeafa('0x3d')]);_0x41f789[_0xeafa('0x3f')]=_['intersection'](_0x41f789[_0xeafa('0x3c')],_0x41f789[_0xeafa('0x3d')]);_0x177af6['attributes']=_[_0xeafa('0x40')](_0x41f789[_0xeafa('0x3c')],qs[_0xeafa('0x41')](_0x318eb6[_0xeafa('0x3d')]['fields']));_0x177af6[_0xeafa('0x42')]=_0x177af6[_0xeafa('0x42')][_0xeafa('0x43')]?_0x177af6[_0xeafa('0x42')]:_0x41f789[_0xeafa('0x3c')];if(!_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x44')](_0xeafa('0x45'))){_0x177af6[_0xeafa('0x46')]=qs[_0xeafa('0x46')](_0x318eb6[_0xeafa('0x3d')]['limit']);_0x177af6['offset']=qs[_0xeafa('0x47')](_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x47')]);}_0x177af6[_0xeafa('0x48')]=qs[_0xeafa('0x49')](_0x318eb6['query'][_0xeafa('0x49')]);_0x177af6[_0xeafa('0x4a')]=qs[_0xeafa('0x3f')](_[_0xeafa('0x4b')](_0x318eb6[_0xeafa('0x3d')],_0x41f789[_0xeafa('0x3f')]));var _0x5e3819=[];var _0x1af350=squel['select']()[_0xeafa('0x4c')]('id')['field'](_0xeafa('0x2d'))[_0xeafa('0x4c')]('color')[_0xeafa('0x4d')](_0xeafa('0x4e'));var _0xb65f80=squel['select']()[_0xeafa('0x4c')]('u.id')[_0xeafa('0x4c')](_0xeafa('0x4f'))[_0xeafa('0x4c')](_0xeafa('0x50'))['from']('user_has_mail_interactions','ui')['left_join']('users','u',_0xeafa('0x51'));var _0x561167=squel[_0xeafa('0x52')]()[_0xeafa('0x4d')](_0xeafa('0x53'),'i')[_0xeafa('0x54')](_0xeafa('0x55'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xeafa('0x54')](_0xeafa('0x56'),'o',_0xeafa('0x57'))[_0xeafa('0x54')](_0xeafa('0x58'),'a',_0xeafa('0x59'))[_0xeafa('0x54')]('mail_messages','me','me.MailInteractionId\x20=\x20i.id')[_0xeafa('0x54')](_0xeafa('0x5a'),'it',_0xeafa('0x5b'))[_0xeafa('0x54')](_0xeafa('0x4e'),'t',_0xeafa('0x5c'));var _0x153ca7=squel[_0xeafa('0x5d')]();var _0x5f12e1=[];var _0x25beb1=squel['expr']();var _0x4eed30;if(_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x5e')]){_0x4eed30=as[_0xeafa('0x5f')](_0x318eb6['query'][_0xeafa('0x5e')]);var _0x4edb63=_0x4eed30['sqlOperator'];for(var _0x30c330=0x0;_0x30c330<_0x4eed30[_0xeafa('0x60')][_0xeafa('0x43')];_0x30c330++){var _0x3cad55=_0x4eed30[_0xeafa('0x60')][_0x30c330];var _0x38b667='i';var _0x28823c=_[_0xeafa('0x61')](_0x526746,['name',_0x3cad55[_0xeafa('0x4c')]]);if(!_0x28823c){switch(_0x3cad55[_0xeafa('0x4c')]){case'unreadMessages':if(_0x3cad55['value']==0x1){_0x561167[_0xeafa('0x62')]('`'+_0x3cad55['field']+_0xeafa('0x63'));}else{_0x561167[_0xeafa('0x62')]('`'+_0x3cad55[_0xeafa('0x4c')]+_0xeafa('0x64'));}break;case'Contact':if(_0x3cad55[_0xeafa('0x65')]===_0xeafa('0x66')){if(_0x3cad55[_0xeafa('0x67')]['split']('\x20')[_0xeafa('0x43')]>0x1){_0x153ca7[_0x4edb63]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xeafa('0x68')](_0x3cad55[_0xeafa('0x67')]),null);}else{var _0x4b4416='%'+_0x3cad55[_0xeafa('0x67')]+'%';_0x153ca7[_0x4edb63]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4b4416,_0x4b4416,_0x4b4416);}}else{_0x28823c=_[_0xeafa('0x61')](_0x526746,['name',_0xeafa('0x69')]);_0x3cad55[_0xeafa('0x4c')]=_0xeafa('0x69');_0x364dcc=as[_0xeafa('0x6a')](_0x38b667,_0x28823c[_0xeafa('0x3b')],_0x3cad55);_0x153ca7[_0x4edb63](_0x364dcc[_0xeafa('0x6b')],_0x364dcc[_0xeafa('0x67')][_0xeafa('0x6c')],_0x364dcc['value'][_0xeafa('0x2b')]);}break;case'Tag':var _0x2ea5f2=_0x3cad55[_0xeafa('0x67')][_0xeafa('0x6d')](',')[_0xeafa('0x30')](function(_0x35ec31){return Number(_0x35ec31);});_0x2ea5f2[_0xeafa('0x32')](function(_0x1a42e1){_0x25beb1['or'](_0xeafa('0x6e'),'%,'+_0x1a42e1+',%');});_0x5f12e1=_['union'](_0x5f12e1,_0x2ea5f2);break;case _0xeafa('0x6f'):if(_0x3cad55[_0xeafa('0x65')]==='$substring'){_0x153ca7[_0x4edb63](_0xeafa('0x70'),'%'+_0x3cad55[_0xeafa('0x67')]+'%',null);}else{_0x28823c=_[_0xeafa('0x61')](_0x526746,['name',_0xeafa('0x71')]);_0x3cad55[_0xeafa('0x4c')]=_0xeafa('0x71');_0x364dcc=as[_0xeafa('0x6a')](_0x38b667,_0x28823c[_0xeafa('0x3b')],_0x3cad55);_0x153ca7[_0x4edb63](_0x364dcc[_0xeafa('0x6b')],_0x364dcc['value']['start'],_0x364dcc['value'][_0xeafa('0x2b')]);}break;case _0xeafa('0x72'):_0x364dcc=as[_0xeafa('0x6a')]('me',null,_0x3cad55);_0x153ca7[_0x4edb63](_0x364dcc[_0xeafa('0x6b')],_0x364dcc['value']['start'],_0x364dcc[_0xeafa('0x67')]['end']);break;}}else{var _0x364dcc=as[_0xeafa('0x6a')](_0x38b667,_0x28823c[_0xeafa('0x3b')],_0x3cad55);_0x153ca7[_0x4edb63](_0x364dcc[_0xeafa('0x6b')],_0x364dcc['value']['start'],_0x364dcc[_0xeafa('0x67')][_0xeafa('0x2b')]);}}}else{var _0x31b747=_(_0x318eb6[_0xeafa('0x3d')])[_0xeafa('0x3e')]()[_0xeafa('0x30')](function(_0x4299cd){return _[_0xeafa('0x73')](_0x526746,[_0xeafa('0x2d'),_0x4299cd])?_0x4299cd:undefined;})[_0xeafa('0x74')]()[_0xeafa('0x67')]();if(!_[_0xeafa('0x75')](_0x31b747)){_0x31b747[_0xeafa('0x32')](function(_0x518846){if(_0x518846===_0xeafa('0x76')){_0x561167['where']('i.MailAccountId\x20IN\x20?',[][_0xeafa('0x77')](_0x318eb6[_0xeafa('0x3d')][_0x518846]));}else if(_0x518846===_0xeafa('0x78')){var _0x5f240f=JSON[_0xeafa('0x79')](_0x318eb6[_0xeafa('0x3d')][_0x518846])['$gte'];var _0x1275cc=JSON['parse'](_0x318eb6[_0xeafa('0x3d')][_0x518846])['$lte'];_0x561167[_0xeafa('0x4a')](_0xeafa('0x7a'),_0x5f240f,_0x1275cc);}else{if(_0x318eb6[_0xeafa('0x3d')][_0x518846]===_0xeafa('0x7b')){_0x561167[_0xeafa('0x4a')]('i.'+_0x518846+_0xeafa('0x7c'));}else{_0x561167[_0xeafa('0x4a')]('i.'+_0x518846+_0xeafa('0x7d'),_0x318eb6['query'][_0x518846]);}}});}if(_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x7e')]){if(_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x7e')]==0x1){_0x561167[_0xeafa('0x62')]('`unreadMessages`\x20=\x200');}else{_0x561167[_0xeafa('0x62')](_0xeafa('0x7f'));}}if(_0x318eb6['query']['tag']){_0x5f12e1=_[_0xeafa('0x80')](_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x81')])?_0x318eb6[_0xeafa('0x3d')]['tag']:new Array(_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x81')]);_0x5f12e1[_0xeafa('0x32')](function(_0x578170){_0x25beb1['or'](_0xeafa('0x6e'),'%,'+_0x578170+',%');});}if(_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x82')]){var _0x358db1=_0x318eb6['query'][_0xeafa('0x82')][_0xeafa('0x83')]('\x5c','\x5c\x5c')[_0xeafa('0x83')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x358db1)){_0x153ca7['or'](_0xeafa('0x84'),_0x358db1+'%');}else if(qs['isEmail'](_0x358db1)){_0x153ca7['or']('c.email\x20LIKE\x20?',_0x358db1+'%');}else{_0x153ca7['or'](_0xeafa('0x85'),qs[_0xeafa('0x68')](_0x358db1))['or'](_0xeafa('0x86'),qs[_0xeafa('0x68')](_0x358db1));}}}_0x561167[_0xeafa('0x4a')](_0x153ca7);_0x561167[_0xeafa('0x87')](_0xeafa('0x88'));var _0x39aba6={'type':db[_0xeafa('0x89')]['QueryTypes'][_0xeafa('0x8a')],'raw':!![]};var _0x45b642=_0x561167[_0xeafa('0x8b')]();_0x45b642[_0xeafa('0x4c')](_0xeafa('0x88'));_0x45b642[_0xeafa('0x4c')](_0xeafa('0x8c'),_0xeafa('0x8d'));if(_0x177af6['order']){_0x177af6[_0xeafa('0x48')][_0xeafa('0x32')](function(_0x48f689){_0x561167['order']('i.'+_0x48f689[0x0],_0x48f689[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x5f12e1)){_0x561167[_0xeafa('0x62')](_0x25beb1);_0x45b642[_0xeafa('0x4a')](_0xeafa('0x8e'),_0x5f12e1);}BPromise[_0xeafa('0x8f')]()[_0xeafa('0x2a')](function(){if(!_0x4eed30&&_0x318eb6[_0xeafa('0x3d')]['MailAccountId'])return;return _0x318eb6[_0xeafa('0x90')][_0xeafa('0x91')]({'attributes':['id'],'raw':!![]})[_0xeafa('0x2a')](function(_0x1b281f){if(_[_0xeafa('0x75')](_0x1b281f)){_0x45b642[_0xeafa('0x4a')](_0xeafa('0x92'));_0x561167[_0xeafa('0x4a')](_0xeafa('0x92'));}else{_0x45b642[_0xeafa('0x4a')](_0xeafa('0x93'),_['map'](_0x1b281f,'id'));_0x561167[_0xeafa('0x4a')]('i.MailAccountId\x20IN\x20?',_[_0xeafa('0x30')](_0x1b281f,'id'));}});})[_0xeafa('0x2a')](function(){db[_0xeafa('0x94')][_0xeafa('0x3d')](_0x45b642[_0xeafa('0x95')](),_0x39aba6)[_0xeafa('0x2a')](function(_0x3bc8bc){_0x2e4272[_0xeafa('0x24')]=_0x3bc8bc[_0xeafa('0x43')];if(_0x2e4272[_0xeafa('0x24')]===0x0)return[];return db['sequelize'][_0xeafa('0x3d')](_0x1af350[_0xeafa('0x95')](),_0x39aba6)['then'](function(_0x54986d){_0x5e3819=_[_0xeafa('0x96')](_0x54986d,'id');_0x39aba6=_[_0xeafa('0x97')](_0x39aba6,{'model':db[_0xeafa('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x318eb6[_0xeafa('0x3d')][_0xeafa('0x41')]){_0x177af6[_0xeafa('0x42')][_0xeafa('0x32')](function(_0x11898b){_0x561167[_0xeafa('0x4c')]('i.'+_0x11898b);});}else{_0x561167[_0xeafa('0x4c')](_0xeafa('0x8c'),_0xeafa('0x8d'));_0x561167['field'](_0xeafa('0x98'),'Account.key');_0x561167['field']('a.mandatoryDisposition',_0xeafa('0x99'));_0x561167[_0xeafa('0x4c')](_0xeafa('0x88'));_0x561167[_0xeafa('0x4c')](_0xeafa('0x9a'));_0x561167[_0xeafa('0x4c')]('i.updatedAt');_0x561167[_0xeafa('0x4c')](_0xeafa('0x9b'));_0x561167[_0xeafa('0x4c')](_0xeafa('0x9c'));_0x561167[_0xeafa('0x4c')](_0xeafa('0x9d'));_0x561167[_0xeafa('0x4c')](_0xeafa('0x9e'));_0x561167[_0xeafa('0x4c')](_0xeafa('0x9f'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xa0'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xa1'));_0x561167['field'](_0xeafa('0xa2'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xa3'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xa4'));_0x561167[_0xeafa('0x4c')]('i.MailAccountId');_0x561167[_0xeafa('0x4c')](_0xeafa('0xa5'));_0x561167[_0xeafa('0x4c')]('c.firstName',_0xeafa('0xa6'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xa7'),_0xeafa('0xa8'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xa9'),'Contact.email');_0x561167[_0xeafa('0x4c')](_0xeafa('0xaa'),_0xeafa('0xab'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xac'),'Contact.mobile');_0x561167[_0xeafa('0x4c')](_0xeafa('0xad'),'Contact.fax');_0x561167[_0xeafa('0x4c')](_0xeafa('0xae'),_0xeafa('0xaf'));_0x561167[_0xeafa('0x4c')](_0xeafa('0xb0'),'Owner.internal');_0x561167[_0xeafa('0x4c')](_0xeafa('0xb1'),_0xeafa('0x31'));}_0x561167[_0xeafa('0x46')](_0x177af6[_0xeafa('0x46')]);_0x561167[_0xeafa('0x47')](_0x177af6[_0xeafa('0x47')]);return db[_0xeafa('0x94')]['query'](_0x561167['toString'](),_0x39aba6);})['then'](function(_0x71d8ab){_0xb65f80[_0xeafa('0x4a')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x71d8ab,'id'));return db[_0xeafa('0x94')][_0xeafa('0x3d')](_0xb65f80['toString'](),_0x39aba6)[_0xeafa('0x2a')](function(_0xdf0552){var _0x3e4965=_['groupBy'](_0xdf0552,_0xeafa('0xb2'));var _0x5d678c=[];return db[_0xeafa('0xb3')][_0xeafa('0x35')]({'attributes':[_0xeafa('0xb4')],'raw':!![]})['then'](function(_0x128338){var _0xfc1573=_0x128338[_0xeafa('0xb4')];_0x71d8ab[_0xeafa('0x32')](function(_0x11ba6d){_0x5d678c[_0xeafa('0xb5')](updateMailInteraction(_0x11ba6d,_0x5e3819,_0x3e4965,_0xfc1573));});return BPromise[_0xeafa('0xb6')](_0x5d678c);});});});})[_0xeafa('0x2a')](function(_0x170ab8){_0x2e4272[_0xeafa('0xb7')]=_0x170ab8;return _0x2e4272;})[_0xeafa('0x2a')](respondWithFilteredResult(_0x22bfba,_0x177af6));})['catch'](handleError(_0x22bfba,null));};exports[_0xeafa('0xb8')]=function(_0xa0d9d3,_0x5e4307){var _0x3c5b6a={'raw':![],'where':{'id':_0xa0d9d3[_0xeafa('0xb9')]['id']}},_0x4acf69={};_0x4acf69[_0xeafa('0x3c')]=_['keys'](db[_0xeafa('0x34')][_0xeafa('0xba')]);_0x4acf69[_0xeafa('0x3d')]=_[_0xeafa('0x3e')](_0xa0d9d3[_0xeafa('0x3d')]);_0x4acf69[_0xeafa('0x3f')]=_[_0xeafa('0x40')](_0x4acf69[_0xeafa('0x3c')],_0x4acf69['query']);_0x3c5b6a['attributes']=_[_0xeafa('0x40')](_0x4acf69[_0xeafa('0x3c')],qs['fields'](_0xa0d9d3[_0xeafa('0x3d')][_0xeafa('0x41')]));_0x3c5b6a['attributes']=_0x3c5b6a['attributes']['length']?_0x3c5b6a[_0xeafa('0x42')]:_0x4acf69['model'];if(_0xa0d9d3[_0xeafa('0x3d')][_0xeafa('0xbb')]){_0x3c5b6a[_0xeafa('0xbc')]=[{'all':!![]}];}_0x3c5b6a=_[_0xeafa('0x97')]({},_0x3c5b6a,_0xa0d9d3[_0xeafa('0xbd')]);return db[_0xeafa('0x34')][_0xeafa('0x61')](_0x3c5b6a)[_0xeafa('0x2a')](handleEntityNotFound(_0x5e4307,null))[_0xeafa('0x2a')](respondWithResult(_0x5e4307,null))['catch'](handleError(_0x5e4307,null));};exports[_0xeafa('0xbe')]=function(_0x5594a3,_0x52f0e6){return db[_0xeafa('0x34')][_0xeafa('0xbe')](_0x5594a3['body'],{})[_0xeafa('0x2a')](respondWithResult(_0x52f0e6,0xc9))[_0xeafa('0x39')](handleError(_0x52f0e6,null));};exports[_0xeafa('0x29')]=function(_0x1d2624,_0x229c09){if(_0x1d2624[_0xeafa('0xbf')]['id']){delete _0x1d2624[_0xeafa('0xbf')]['id'];}return db[_0xeafa('0x34')]['find']({'where':{'id':_0x1d2624[_0xeafa('0xb9')]['id']}})['then'](handleEntityNotFound(_0x229c09,null))[_0xeafa('0x2a')](saveUpdates(_0x1d2624['body'],null))[_0xeafa('0x2a')](respondWithResult(_0x229c09,null))[_0xeafa('0x39')](handleError(_0x229c09,null));};exports[_0xeafa('0xc0')]=function(_0x470426,_0x328b07){return db[_0xeafa('0x34')]['find']({'where':{'id':_0x470426[_0xeafa('0xb9')]['id']}})[_0xeafa('0x2a')](handleEntityNotFound(_0x328b07,null))[_0xeafa('0x2a')](removeEntity(_0x328b07,null))[_0xeafa('0x39')](handleError(_0x328b07,null));};exports['describe']=function(_0x5eb82a,_0x4f568c){return db[_0xeafa('0x34')][_0xeafa('0xc1')]()[_0xeafa('0x2a')](respondWithResult(_0x4f568c,null))[_0xeafa('0x39')](handleError(_0x4f568c,null));};exports[_0xeafa('0xc2')]=function(_0x2c1da9,_0x1123fb,_0x2b53e1){return db[_0xeafa('0xc3')][_0xeafa('0x61')]({'where':{'id':_0x2c1da9[_0xeafa('0xb9')]['id']}})[_0xeafa('0x2a')](handleEntityNotFound(_0x1123fb,null))[_0xeafa('0x2a')](function(_0x3cd84b){if(_0x3cd84b){return _0x3cd84b['addMessage'](_0x2c1da9[_0xeafa('0xbf')][_0xeafa('0xc4')],_[_0xeafa('0xc5')](_0x2c1da9['body'],[_0xeafa('0xc4'),'id'])||{});}})[_0xeafa('0x2a')](respondWithResult(_0x1123fb,null))[_0xeafa('0x39')](handleError(_0x1123fb,null));};exports['getMessages']=function(_0x185f6d,_0xf34c46,_0x5c1fab){var _0x2fa8cb={'raw':![],'where':{}};var _0x32bf16={};var _0x3f2ec3={'count':0x0,'rows':[]};return db[_0xeafa('0x34')][_0xeafa('0x35')]({'where':{'id':_0x185f6d[_0xeafa('0xb9')]['id']}})[_0xeafa('0x2a')](handleEntityNotFound(_0xf34c46,null))[_0xeafa('0x2a')](function(_0x3f8fe6){if(_0x3f8fe6){_0x32bf16[_0xeafa('0x3c')]=_[_0xeafa('0x3e')](db[_0xeafa('0xc3')][_0xeafa('0xba')]);_0x32bf16['query']=_['keys'](_0x185f6d['query']);_0x32bf16[_0xeafa('0x3f')]=_[_0xeafa('0x40')](_0x32bf16[_0xeafa('0x3c')],_0x32bf16[_0xeafa('0x3d')]);_0x2fa8cb[_0xeafa('0x42')]=_[_0xeafa('0x40')](_0x32bf16[_0xeafa('0x3c')],qs[_0xeafa('0x41')](_0x185f6d[_0xeafa('0x3d')]['fields']));_0x2fa8cb['attributes']=_0x2fa8cb[_0xeafa('0x42')][_0xeafa('0x43')]?_0x2fa8cb[_0xeafa('0x42')]:_0x32bf16[_0xeafa('0x3c')];if(!_0x185f6d[_0xeafa('0x3d')][_0xeafa('0x44')](_0xeafa('0x45'))){_0x2fa8cb[_0xeafa('0x46')]=qs['limit'](_0x185f6d['query']['limit']);_0x2fa8cb[_0xeafa('0x47')]=qs['offset'](_0x185f6d[_0xeafa('0x3d')][_0xeafa('0x47')]);}_0x2fa8cb['order']=qs[_0xeafa('0x49')](_0x185f6d['query'][_0xeafa('0x49')]);_0x2fa8cb[_0xeafa('0x4a')]=qs['filters'](_[_0xeafa('0x4b')](_0x185f6d[_0xeafa('0x3d')],_0x32bf16[_0xeafa('0x3f')]));_0x2fa8cb[_0xeafa('0x4a')]['MailInteractionId']=_0x3f8fe6['id'];if(_0x185f6d[_0xeafa('0x3d')][_0xeafa('0x82')]){_0x2fa8cb[_0xeafa('0x4a')]=_['merge'](_0x2fa8cb[_0xeafa('0x4a')],{'$or':_[_0xeafa('0x30')](_0x2fa8cb[_0xeafa('0x42')],function(_0x30bdb1){var _0x35c3ba={};_0x35c3ba[_0x30bdb1]={'$like':'%'+_0x185f6d[_0xeafa('0x3d')]['filter']+'%'};return _0x35c3ba;})});}if(_0x185f6d['query']['$gte']){var _0x1d669b=_0x185f6d['query'][_0xeafa('0xc6')]['split'](',');var _0x4432cd={};_0x4432cd[_0x1d669b[0x0]]={'$gte':moment(_0x1d669b[0x1])[_0xeafa('0xc7')](_0xeafa('0xc8'))};_0x2fa8cb[_0xeafa('0x4a')]=_[_0xeafa('0x97')](_0x2fa8cb[_0xeafa('0x4a')],_0x4432cd);}_0x2fa8cb=_['merge']({},_0x2fa8cb,_0x185f6d[_0xeafa('0xbd')]);return db['MailMessage'][_0xeafa('0x24')]({'where':_0x2fa8cb['where']})['then'](function(_0x152a13){_0x3f2ec3['count']=_0x152a13;if(_0x185f6d['query']['includeAll']){_0x2fa8cb[_0xeafa('0xbc')]=[{'all':!![]}];}return db['MailMessage'][_0xeafa('0xc9')](_0x2fa8cb);})[_0xeafa('0x2a')](function(_0x560469){_0x3f2ec3['rows']=_0x560469;return _0x3f2ec3;});}})[_0xeafa('0x2a')](respondWithFilteredResult(_0xf34c46,_0x2fa8cb))['catch'](handleError(_0xf34c46,null));};exports[_0xeafa('0xca')]=function(_0x542b8e,_0x187f6c,_0xb086ea){return db[_0xeafa('0x34')][_0xeafa('0x61')]({'where':{'id':_0x542b8e[_0xeafa('0xb9')]['id']}})[_0xeafa('0x2a')](handleEntityNotFound(_0x187f6c,null))['then'](function(_0x4a33bf){if(_0x4a33bf){return _0x4a33bf[_0xeafa('0xcb')](_0x542b8e[_0xeafa('0xbf')][_0xeafa('0xc4')],_[_0xeafa('0xc5')](_0x542b8e[_0xeafa('0xbf')],[_0xeafa('0xc4'),'id'])||{})[_0xeafa('0xcc')](function(){return db[_0xeafa('0xcd')][_0xeafa('0xc9')]({'attributes':['id',_0xeafa('0x2d'),'color'],'where':{'id':_0x542b8e[_0xeafa('0xbf')][_0xeafa('0xc4')]}});})[_0xeafa('0x2a')](function(_0x4016a5){socket[_0xeafa('0xce')](_0xeafa('0xcf'),{'id':Number(_0x542b8e['params']['id']),'tags':_0x4016a5||[]});return{'id':Number(_0x542b8e[_0xeafa('0xb9')]['id']),'tags':_0x4016a5||[]};});}})['then'](respondWithResult(_0x187f6c,null))[_0xeafa('0x39')](handleError(_0x187f6c,null));};exports[_0xeafa('0xd0')]=function(_0x3b8ead,_0x4946db,_0x39c0e0){return db[_0xeafa('0x34')][_0xeafa('0x61')]({'where':{'id':_0x3b8ead[_0xeafa('0xb9')]['id']}})[_0xeafa('0x2a')](handleEntityNotFound(_0x4946db,null))[_0xeafa('0x2a')](function(_0x3210b4){if(_0x3210b4){return _0x3210b4[_0xeafa('0xd0')](_0x3b8ead['query'][_0xeafa('0xc4')]);}})[_0xeafa('0x2a')](respondWithStatusCode(_0x4946db,null))[_0xeafa('0x39')](handleError(_0x4946db,null));};exports[_0xeafa('0xd1')]=function(_0x283205,_0xd55ee2){var _0x616259=moment()[_0xeafa('0xd2')]()[_0xeafa('0x95')]();var _0x2c832c=path[_0xeafa('0xd3')](config[_0xeafa('0xd4')],_0xeafa('0xd5'),_0xeafa('0xd6'),_0xeafa('0xd7'));var _0x18f934=path[_0xeafa('0xd3')](config[_0xeafa('0xd4')],_0xeafa('0xd5'),_0xeafa('0xd6'),_0xeafa('0xd8'));var _0x1e7b38=path[_0xeafa('0xd3')](_0x2c832c,_0x616259);var _0x3ac1f8=util[_0xeafa('0xc7')](_0xeafa('0xd9'),_0x283205['params']['id'],_0x616259);var _0x6a52bc=path['join'](_0x2c832c,_0x3ac1f8);var _0x46a960=[];if(_0x283205[_0xeafa('0x3d')][_0xeafa('0xd8')]){_0x46a960[_0xeafa('0xb5')]({'model':db[_0xeafa('0xda')],'as':_0xeafa('0xdb'),'raw':!![]});}var _0x6255ae=[{'model':db['MailMessage'],'as':_0xeafa('0xdc'),'attributes':['id',_0xeafa('0xbf'),_0xeafa('0x4d'),'to','cc',_0xeafa('0xdd'),_0xeafa('0xde'),_0xeafa('0x78')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x46a960}];return db['MailInteraction']['find']({'where':{'id':_0x283205[_0xeafa('0xb9')]['id']},'include':_0x6255ae})[_0xeafa('0x2a')](handleEntityNotFound(_0xd55ee2,null))[_0xeafa('0x2a')](function(_0x462d3a){if(_0x462d3a&&_0x462d3a['Messages']){var _0x4604f8=_0x462d3a[_0xeafa('0xdf')]({'plain':!![]});fs[_0xeafa('0xe0')](_0x1e7b38);return BPromise[_0xeafa('0xe1')](_0x4604f8[_0xeafa('0xdc')],function(_0x541165,_0x100b20){var _0x4046ac={'from':_0x541165[_0xeafa('0x4d')],'to':_0x541165['to'],'subject':_0x541165[_0xeafa('0xde')],'html':_0x541165[_0xeafa('0xbf')],'headers':{'Date':moment(_0x541165[_0xeafa('0x78')])[_0xeafa('0xc7')](_0xeafa('0xe2'))},'attachments':[]};if(_0x541165['cc']){_0x4046ac[_0xeafa('0xe3')]['Cc']=_0x541165['cc'];}if(_0x541165[_0xeafa('0xdd')]){_0x4046ac[_0xeafa('0xe3')][_0xeafa('0xe4')]=_0x541165[_0xeafa('0xdd')];}return new BPromise(function(_0x4185f3,_0x2da67d){if(_0x541165[_0xeafa('0xdb')]){for(var _0xcb6201=0x0;_0xcb6201<_0x541165['Attachments'][_0xeafa('0x43')];_0xcb6201++){var _0x57081f=_0x541165[_0xeafa('0xdb')][_0xcb6201];var _0x313b8d=path['join'](_0x18f934,_0x57081f[_0xeafa('0xe5')]);if(fs[_0xeafa('0xe6')](_0x313b8d)){_0x4046ac[_0xeafa('0xd8')][_0xeafa('0xb5')]({'name':_0x57081f['name'],'contentType':_0x57081f[_0xeafa('0x3b')],'data':fs[_0xeafa('0xe7')](_0x313b8d)});}}}emlformat[_0xeafa('0xe8')](_0x4046ac,function(_0x10ac34,_0x299e0f){if(_0x10ac34)return _0x2da67d(_0x10ac34);fs[_0xeafa('0xe9')](path[_0xeafa('0xd3')](_0x1e7b38,util[_0xeafa('0xc7')](_0xeafa('0xea'),_0x100b20)),_0x299e0f);return _0x4185f3(_0x299e0f);});});})[_0xeafa('0x2a')](function(){return new BPromise(function(_0x37510c,_0x388f45){zipdir(_0x1e7b38,{'saveTo':_0x6a52bc},function(_0xecd383,_0x521dcb){if(_0xecd383)return _0x388f45(_0xecd383);return _0x37510c(_0x521dcb);});})[_0xeafa('0x2a')](function(){return new BPromise(function(_0x596d88,_0xe6cd52){rimraf(_0x1e7b38,function(_0x9e11a1){if(_0x9e11a1)_0xe6cd52(_0x9e11a1);return _0x596d88();});});})[_0xeafa('0x2a')](function(){return _0xd55ee2[_0xeafa('0xd1')](_0x6a52bc,_0x3ac1f8,function(_0x16a4e2){if(_0x16a4e2){console[_0xeafa('0xeb')]('err',_0x16a4e2);}else{fs['unlinkSync'](_0x6a52bc);}});});});}else{return _0xd55ee2['sendStatus'](0xc8);}})[_0xeafa('0x39')](handleError(_0xd55ee2,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 5be7786..f67d1c5 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 _0x6434=['hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','setDataValue','length','emit','catch'];(function(_0x254f1f,_0x4801e1){var _0x1e0b89=function(_0x4113f0){while(--_0x4113f0){_0x254f1f['push'](_0x254f1f['shift']());}};_0x1e0b89(++_0x4801e1);}(_0x6434,0x199));var _0x4643=function(_0xd8475a,_0x391968){_0xd8475a=_0xd8475a-0x0;var _0x417d99=_0x6434[_0xd8475a];return _0x417d99;};'use strict';var EventEmitter=require(_0x4643('0x0'));var MailInteraction=require(_0x4643('0x1'))['db'][_0x4643('0x2')];var MailMessage=require(_0x4643('0x1'))['db'][_0x4643('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4643('0x4')](0x0);var events={'afterCreate':_0x4643('0x5'),'afterUpdate':_0x4643('0x6'),'afterDestroy':_0x4643('0x7')};function emitEvent(_0x53cc3f){return function(_0x1bdf4c,_0x4d9f25,_0x3fce1f){_0x1bdf4c[_0x4643('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5d7de2){_0x1bdf4c['setDataValue'](_0x4643('0x9'),_0x5d7de2[_0x4643('0xa')](function(_0x3e5213){return{'id':_0x3e5213['id']};}));return MailMessage[_0x4643('0xb')]({'where':{'MailInteractionId':_0x1bdf4c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5146dd){_0x1bdf4c[_0x4643('0xc')]('unreadMessages',_0x5146dd[_0x4643('0xd')]);MailInteractionEvents[_0x4643('0xe')](_0x53cc3f+':'+_0x1bdf4c['id'],_0x1bdf4c);MailInteractionEvents[_0x4643('0xe')](_0x53cc3f,_0x1bdf4c);_0x3fce1f(null);})[_0x4643('0xf')](_0x3fce1f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x4643('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +var _0x6013=['setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','then'];(function(_0x1001b5,_0x536d2a){var _0x3cec0e=function(_0x32cb61){while(--_0x32cb61){_0x1001b5['push'](_0x1001b5['shift']());}};_0x3cec0e(++_0x536d2a);}(_0x6013,0x17e));var _0x3601=function(_0x52d543,_0x4982e1){_0x52d543=_0x52d543-0x0;var _0x572ca0=_0x6013[_0x52d543];return _0x572ca0;};'use strict';var EventEmitter=require(_0x3601('0x0'));var MailInteraction=require(_0x3601('0x1'))['db'][_0x3601('0x2')];var MailMessage=require(_0x3601('0x1'))['db'][_0x3601('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3601('0x4')](0x0);var events={'afterCreate':_0x3601('0x5'),'afterUpdate':_0x3601('0x6'),'afterDestroy':_0x3601('0x7')};function emitEvent(_0x1a4794){return function(_0x2dfd60,_0xd3d90b,_0x495484){_0x2dfd60['getUsers']({'attributes':['id'],'raw':!![]})[_0x3601('0x8')](function(_0x56cf71){_0x2dfd60[_0x3601('0x9')](_0x3601('0xa'),_0x56cf71['map'](function(_0x49fecb){return{'id':_0x49fecb['id']};}));return MailMessage[_0x3601('0xb')]({'where':{'MailInteractionId':_0x2dfd60['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3601('0x8')](function(_0x2cfb0f){_0x2dfd60[_0x3601('0x9')](_0x3601('0xc'),_0x2cfb0f[_0x3601('0xd')]);MailInteractionEvents['emit'](_0x1a4794+':'+_0x2dfd60['id'],_0x2dfd60);MailInteractionEvents[_0x3601('0xe')](_0x1a4794,_0x2dfd60);_0x495484(null);})['catch'](_0x495484(null));};}for(var e in events){if(events[_0x3601('0xf')](e)){var event=events[e];MailInteraction[_0x3601('0x10')](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 79758bb..72092ae 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 _0x8c1a=['bluebird','request-promise','path','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt','models','get','update','then','catch','utf8mb4','lodash','api','moment'];(function(_0x1116ac,_0xcbe059){var _0x3e806b=function(_0x33b585){while(--_0x33b585){_0x1116ac['push'](_0x1116ac['shift']());}};_0x3e806b(++_0xcbe059);}(_0x8c1a,0x1ad));var _0xa8c1=function(_0x3ba2a3,_0x34d0ba){_0x3ba2a3=_0x3ba2a3-0x0;var _0x2d0e38=_0x8c1a[_0x3ba2a3];return _0x2d0e38;};'use strict';var _=require(_0xa8c1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8c1('0x1'));var moment=require(_0xa8c1('0x2'));var BPromise=require(_0xa8c1('0x3'));var rp=require(_0xa8c1('0x4'));var fs=require('fs');var path=require(_0xa8c1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8c1('0x6'));module['exports']=function(_0x396c2e,_0x3d8943){return _0x396c2e['define'](_0xa8c1('0x7'),attributes,{'tableName':_0xa8c1('0x8'),'paranoid':![],'indexes':[{'name':_0xa8c1('0x9'),'fields':[_0xa8c1('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4892ab,_0xad239a,_0x305cd2){if(_0x4892ab[_0xa8c1('0xb')]){_0x4892ab['substatusAt']=moment()['format'](_0xa8c1('0xc'));}if(_0x4892ab[_0xa8c1('0xd')]){_0x4892ab[_0xa8c1('0xe')]=moment()[_0xa8c1('0xf')](_0xa8c1('0xc'));}_0x305cd2(null,_0xad239a);},'beforeUpdate':function(_0x1e52db,_0x55d7bc,_0x589e83){if(_0x1e52db[_0xa8c1('0x10')](_0xa8c1('0xb'))){_0x1e52db[_0xa8c1('0x11')]=_0x1e52db['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x1e52db[_0xa8c1('0x10')](_0xa8c1('0xd'))){_0x1e52db[_0xa8c1('0xe')]=moment()[_0xa8c1('0xf')](_0xa8c1('0xc'));_0x1e52db[_0xa8c1('0xb')]=null;_0x1e52db[_0xa8c1('0x11')]=null;}_0x589e83(null,_0x1e52db);},'afterUpdate':function(_0x45fa46,_0xec32ea,_0x1fc231){var _0x1763da=_0x396c2e[_0xa8c1('0x12')];var _0x47eb5f=_0x45fa46[_0xa8c1('0x13')]({'plain':!![]});if(_0x47eb5f[_0xa8c1('0xd')]){return _0x1763da['MailMessage'][_0xa8c1('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x47eb5f['id']}})[_0xa8c1('0x15')](function(){_0x1fc231();})[_0xa8c1('0x16')](function(_0x251a69){_0x1fc231(_0x251a69);});}else{_0x1fc231();}}},'charset':_0xa8c1('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1e88=['closedAt','changed','closed','substatusAt','models','get','MailMessage','update','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x435193,_0x24b26b){var _0x429c61=function(_0x2dd5e9){while(--_0x2dd5e9){_0x435193['push'](_0x435193['shift']());}};_0x429c61(++_0x24b26b);}(_0x1e88,0x1d3));var _0x81e8=function(_0x4bb25f,_0x35c34d){_0x4bb25f=_0x4bb25f-0x0;var _0x5a7612=_0x1e88[_0x4bb25f];return _0x5a7612;};'use strict';var _=require(_0x81e8('0x0'));var util=require(_0x81e8('0x1'));var logger=require(_0x81e8('0x2'))(_0x81e8('0x3'));var moment=require(_0x81e8('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x81e8('0x5'));var rimraf=require(_0x81e8('0x6'));var config=require(_0x81e8('0x7'));var attributes=require(_0x81e8('0x8'));module[_0x81e8('0x9')]=function(_0xcbdfb7,_0x591fbc){return _0xcbdfb7[_0x81e8('0xa')](_0x81e8('0xb'),attributes,{'tableName':_0x81e8('0xc'),'paranoid':![],'indexes':[{'name':_0x81e8('0xd'),'fields':[_0x81e8('0xe'),'to'],'type':_0x81e8('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2ee62c,_0x3db434,_0x30894c){if(_0x2ee62c[_0x81e8('0x10')]){_0x2ee62c['substatusAt']=moment()[_0x81e8('0x11')](_0x81e8('0x12'));}if(_0x2ee62c['closed']){_0x2ee62c[_0x81e8('0x13')]=moment()['format'](_0x81e8('0x12'));}_0x30894c(null,_0x3db434);},'beforeUpdate':function(_0x5c7e75,_0x1d4641,_0x8bc43c){if(_0x5c7e75[_0x81e8('0x14')](_0x81e8('0x10'))){_0x5c7e75['substatusAt']=_0x5c7e75[_0x81e8('0x10')]?moment()[_0x81e8('0x11')](_0x81e8('0x12')):null;}if(_0x5c7e75['changed'](_0x81e8('0x15'))){_0x5c7e75[_0x81e8('0x13')]=moment()[_0x81e8('0x11')](_0x81e8('0x12'));_0x5c7e75['substatus']=null;_0x5c7e75[_0x81e8('0x16')]=null;}_0x8bc43c(null,_0x5c7e75);},'afterUpdate':function(_0x3f571c,_0x4a16f2,_0x56619a){var _0x5adb4a=_0xcbdfb7[_0x81e8('0x17')];var _0x2e4e80=_0x3f571c[_0x81e8('0x18')]({'plain':!![]});if(_0x2e4e80['closed']){return _0x5adb4a[_0x81e8('0x19')][_0x81e8('0x1a')]({'read':!![]},{'where':{'MailInteractionId':_0x2e4e80['id']}})['then'](function(){_0x56619a();})['catch'](function(_0x568bf6){_0x56619a(_0x568bf6);});}else{_0x56619a();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index cda8537..9caaa71 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 _0x6a00=['MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','update','body','options','raw','limit','AddTagsToMailInteraction','MailInteraction','find','where','then','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info'];(function(_0x3a25ea,_0x2ab50b){var _0x3068f5=function(_0xc8cc12){while(--_0xc8cc12){_0x3a25ea['push'](_0x3a25ea['shift']());}};_0x3068f5(++_0x2ab50b);}(_0x6a00,0xc9));var _0x06a0=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x6a00[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x06a0('0x0'));var util=require(_0x06a0('0x1'));var moment=require('moment');var BPromise=require(_0x06a0('0x2'));var rs=require(_0x06a0('0x3'));var fs=require('fs');var Redis=require(_0x06a0('0x4'));var db=require(_0x06a0('0x5'))['db'];var utils=require(_0x06a0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x06a0('0x7'));var jayson=require(_0x06a0('0x8'));var client=jayson[_0x06a0('0x9')][_0x06a0('0xa')]({'port':0x232a});config[_0x06a0('0xb')]=_[_0x06a0('0xc')](config['redis'],{'host':_0x06a0('0xd'),'port':0x18eb});var socket=require(_0x06a0('0xe'))(new Redis(config[_0x06a0('0xb')]));require(_0x06a0('0xf'))[_0x06a0('0x10')](socket);function respondWithRpcPromise(_0x26c616,_0x4109fd,_0x1a3df3){return new BPromise(function(_0x469f3d,_0x380d12){return client[_0x06a0('0x11')](_0x26c616,_0x1a3df3)['then'](function(_0x5976ae){logger[_0x06a0('0x12')](_0x06a0('0x13'),_0x4109fd,_0x06a0('0x14'));logger[_0x06a0('0x15')](_0x06a0('0x16'),_0x4109fd,_0x06a0('0x14'),JSON[_0x06a0('0x17')](_0x5976ae));if(_0x5976ae[_0x06a0('0x18')]){if(_0x5976ae['error'][_0x06a0('0x19')]===0x1f4){logger[_0x06a0('0x18')](_0x06a0('0x13'),_0x4109fd,_0x5976ae['error'][_0x06a0('0x1a')]);return _0x380d12(_0x5976ae[_0x06a0('0x18')][_0x06a0('0x1a')]);}logger['error'](_0x06a0('0x13'),_0x4109fd,_0x5976ae[_0x06a0('0x18')]['message']);return _0x469f3d(_0x5976ae[_0x06a0('0x18')][_0x06a0('0x1a')]);}else{logger[_0x06a0('0x12')](_0x06a0('0x13'),_0x4109fd,_0x06a0('0x14'));_0x469f3d(_0x5976ae['result'][_0x06a0('0x1a')]);}})[_0x06a0('0x1b')](function(_0x35e239){logger[_0x06a0('0x18')](_0x06a0('0x13'),_0x4109fd,_0x35e239);_0x380d12(_0x35e239);});});}exports[_0x06a0('0x1c')]=function(_0x27389d){var _0x2d774d=this;return new Promise(function(_0x89c0b9,_0x9772f5){return db['MailInteraction'][_0x06a0('0x1d')](_0x27389d[_0x06a0('0x1e')],{'raw':_0x27389d[_0x06a0('0x1f')]?_0x27389d[_0x06a0('0x1f')][_0x06a0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27389d[_0x06a0('0x1f')]?_0x27389d['options']['where']||null:null,'attributes':_0x27389d[_0x06a0('0x1f')]?_0x27389d[_0x06a0('0x1f')]['attributes']||null:null,'limit':_0x27389d[_0x06a0('0x1f')]?_0x27389d[_0x06a0('0x1f')][_0x06a0('0x21')]||null:null})['then'](function(_0x98ae05){logger[_0x06a0('0x12')]('UpdateMailInteraction',_0x27389d);logger['debug']('UpdateMailInteraction',_0x27389d,JSON[_0x06a0('0x17')](_0x98ae05));_0x89c0b9(_0x98ae05);})[_0x06a0('0x1b')](function(_0x1ee00a){logger[_0x06a0('0x18')](_0x06a0('0x1c'),_0x1ee00a[_0x06a0('0x1a')],_0x27389d);_0x9772f5(_0x2d774d[_0x06a0('0x18')](0x1f4,_0x1ee00a[_0x06a0('0x1a')]));});});};exports[_0x06a0('0x22')]=function(_0x54b7c5){return new Promise(function(_0x187f6f,_0x49c8b0){return db[_0x06a0('0x23')][_0x06a0('0x24')]({'where':_0x54b7c5[_0x06a0('0x1f')]?_0x54b7c5[_0x06a0('0x1f')][_0x06a0('0x25')]||null:null})[_0x06a0('0x26')](function(_0x305ee4){if(_0x305ee4){return _0x305ee4[_0x06a0('0x27')](_0x54b7c5[_0x06a0('0x1e')]['ids'],_[_0x06a0('0x28')](_0x54b7c5[_0x06a0('0x1e')],[_0x06a0('0x29'),'id'])||{});}})[_0x06a0('0x2a')](function(_0x19ae90){logger['info'](_0x06a0('0x2b'),_0x54b7c5);logger['debug'](_0x06a0('0x2b'),_0x54b7c5,JSON[_0x06a0('0x17')](_0x19ae90));_0x187f6f(_0x19ae90);})['catch'](function(_0x5b6264){logger[_0x06a0('0x18')](_0x06a0('0x2b'),_0x5b6264[_0x06a0('0x1a')],_0x54b7c5);_0x49c8b0(_this[_0x06a0('0x18')](0x1f4,_0x5b6264['message']));});});}; \ No newline at end of file +var _0x5ec6=['MailInteraction','update','body','options','where','attributes','limit','debug','AddTagsToMailInteraction','find','addTags','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./mailInteraction.socket','then','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction'];(function(_0xd7f01c,_0x4fb96f){var _0x54580b=function(_0x1e01c9){while(--_0x1e01c9){_0xd7f01c['push'](_0xd7f01c['shift']());}};_0x54580b(++_0x4fb96f);}(_0x5ec6,0x7f));var _0x65ec=function(_0x27bdc9,_0x510daf){_0x27bdc9=_0x27bdc9-0x0;var _0x29b859=_0x5ec6[_0x27bdc9];return _0x29b859;};'use strict';var _=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var moment=require(_0x65ec('0x2'));var BPromise=require('bluebird');var rs=require(_0x65ec('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65ec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65ec('0x5'))('rpc');var config=require(_0x65ec('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x7')][_0x65ec('0x8')]({'port':0x232a});config['redis']=_[_0x65ec('0x9')](config[_0x65ec('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x65ec('0xb'))(new Redis(config[_0x65ec('0xa')]));require(_0x65ec('0xc'))['register'](socket);function respondWithRpcPromise(_0x49aacd,_0x3cf126,_0x5e78f8){return new BPromise(function(_0x136928,_0x28fe68){return client['request'](_0x49aacd,_0x5e78f8)[_0x65ec('0xd')](function(_0xd7cf80){logger['info'](_0x65ec('0xe'),_0x3cf126,_0x65ec('0xf'));logger['debug'](_0x65ec('0x10'),_0x3cf126,_0x65ec('0xf'),JSON[_0x65ec('0x11')](_0xd7cf80));if(_0xd7cf80[_0x65ec('0x12')]){if(_0xd7cf80[_0x65ec('0x12')][_0x65ec('0x13')]===0x1f4){logger[_0x65ec('0x12')](_0x65ec('0xe'),_0x3cf126,_0xd7cf80['error'][_0x65ec('0x14')]);return _0x28fe68(_0xd7cf80[_0x65ec('0x12')][_0x65ec('0x14')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x3cf126,_0xd7cf80[_0x65ec('0x12')][_0x65ec('0x14')]);return _0x136928(_0xd7cf80[_0x65ec('0x12')]['message']);}else{logger[_0x65ec('0x15')](_0x65ec('0xe'),_0x3cf126,_0x65ec('0xf'));_0x136928(_0xd7cf80[_0x65ec('0x16')][_0x65ec('0x14')]);}})[_0x65ec('0x17')](function(_0x37c494){logger[_0x65ec('0x12')](_0x65ec('0xe'),_0x3cf126,_0x37c494);_0x28fe68(_0x37c494);});});}exports[_0x65ec('0x18')]=function(_0x1f1a7d){var _0x3a8cef=this;return new Promise(function(_0x2e9b1d,_0x1467ac){return db[_0x65ec('0x19')][_0x65ec('0x1a')](_0x1f1a7d[_0x65ec('0x1b')],{'raw':_0x1f1a7d[_0x65ec('0x1c')]?_0x1f1a7d[_0x65ec('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f1a7d[_0x65ec('0x1c')]?_0x1f1a7d[_0x65ec('0x1c')][_0x65ec('0x1d')]||null:null,'attributes':_0x1f1a7d[_0x65ec('0x1c')]?_0x1f1a7d[_0x65ec('0x1c')][_0x65ec('0x1e')]||null:null,'limit':_0x1f1a7d[_0x65ec('0x1c')]?_0x1f1a7d['options'][_0x65ec('0x1f')]||null:null})[_0x65ec('0xd')](function(_0x13ac27){logger[_0x65ec('0x15')](_0x65ec('0x18'),_0x1f1a7d);logger[_0x65ec('0x20')](_0x65ec('0x18'),_0x1f1a7d,JSON[_0x65ec('0x11')](_0x13ac27));_0x2e9b1d(_0x13ac27);})[_0x65ec('0x17')](function(_0x4c846b){logger[_0x65ec('0x12')](_0x65ec('0x18'),_0x4c846b[_0x65ec('0x14')],_0x1f1a7d);_0x1467ac(_0x3a8cef[_0x65ec('0x12')](0x1f4,_0x4c846b['message']));});});};exports[_0x65ec('0x21')]=function(_0x588fe4){return new Promise(function(_0x37489f,_0x1ada47){return db[_0x65ec('0x19')][_0x65ec('0x22')]({'where':_0x588fe4[_0x65ec('0x1c')]?_0x588fe4[_0x65ec('0x1c')][_0x65ec('0x1d')]||null:null})[_0x65ec('0xd')](function(_0x984a82){if(_0x984a82){return _0x984a82[_0x65ec('0x23')](_0x588fe4[_0x65ec('0x1b')]['ids'],_['omit'](_0x588fe4[_0x65ec('0x1b')],['ids','id'])||{});}})[_0x65ec('0x24')](function(_0x443b0f){logger['info'](_0x65ec('0x25'),_0x588fe4);logger[_0x65ec('0x20')](_0x65ec('0x25'),_0x588fe4,JSON[_0x65ec('0x11')](_0x443b0f));_0x37489f(_0x443b0f);})['catch'](function(_0x3074df){logger[_0x65ec('0x12')](_0x65ec('0x25'),_0x3074df[_0x65ec('0x14')],_0x588fe4);_0x1ada47(_this[_0x65ec('0x12')](0x1f4,_0x3074df[_0x65ec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index aaced5e..5c11f9c 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 _0x547a=['./mailInteraction.events','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x10ce01,_0x637899){var _0x5aa831=function(_0x4bdf42){while(--_0x4bdf42){_0x10ce01['push'](_0x10ce01['shift']());}};_0x5aa831(++_0x637899);}(_0x547a,0xe0));var _0xa547=function(_0x1ff7d8,_0x323a12){_0x1ff7d8=_0x1ff7d8-0x0;var _0x5ff39=_0x547a[_0x1ff7d8];return _0x5ff39;};'use strict';var MailInteractionEvents=require(_0xa547('0x0'));var events=['save',_0xa547('0x1'),_0xa547('0x2')];function createListener(_0x1da8fe,_0x5dc568){return function(_0x5ee4e8){_0x5dc568[_0xa547('0x3')](_0x1da8fe,_0x5ee4e8);};}function removeListener(_0x4d73a7,_0x925ba9){return function(){MailInteractionEvents[_0xa547('0x4')](_0x4d73a7,_0x925ba9);};}exports[_0xa547('0x5')]=function(_0x2c8eb5){for(var _0x20ed6b=0x0,_0x341eeb=events[_0xa547('0x6')];_0x20ed6b<_0x341eeb;_0x20ed6b++){var _0x1eb8d2=events[_0x20ed6b];var _0x1ef306=createListener(_0xa547('0x7')+_0x1eb8d2,_0x2c8eb5);MailInteractionEvents['on'](_0x1eb8d2,_0x1ef306);}}; \ No newline at end of file +var _0x8b97=['update','emit','register','mailInteraction:','./mailInteraction.events','save','remove'];(function(_0x52b4a9,_0x5e440f){var _0x5523b2=function(_0x6ee516){while(--_0x6ee516){_0x52b4a9['push'](_0x52b4a9['shift']());}};_0x5523b2(++_0x5e440f);}(_0x8b97,0x9e));var _0x78b9=function(_0x54322c,_0x3986ac){_0x54322c=_0x54322c-0x0;var _0x15374b=_0x8b97[_0x54322c];return _0x15374b;};'use strict';var MailInteractionEvents=require(_0x78b9('0x0'));var events=[_0x78b9('0x1'),_0x78b9('0x2'),_0x78b9('0x3')];function createListener(_0xc079d4,_0x1efffa){return function(_0x39cc13){_0x1efffa[_0x78b9('0x4')](_0xc079d4,_0x39cc13);};}function removeListener(_0x50c1b4,_0x36e629){return function(){MailInteractionEvents['removeListener'](_0x50c1b4,_0x36e629);};}exports[_0x78b9('0x5')]=function(_0x6b0344){for(var _0x13f5d6=0x0,_0x4b56e0=events['length'];_0x13f5d6<_0x4b56e0;_0x13f5d6++){var _0x149b67=events[_0x13f5d6];var _0x1d3890=createListener(_0x78b9('0x6')+_0x149b67,_0x6b0344);MailInteractionEvents['on'](_0x149b67,_0x1d3890);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 342a54c..c00f921 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 _0x34e8=['./mailMessage.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13af3b,_0x5ab483){var _0x1bf05e=function(_0x1c8fde){while(--_0x1c8fde){_0x13af3b['push'](_0x13af3b['shift']());}};_0x1bf05e(++_0x5ab483);}(_0x34e8,0x12c));var _0x834e=function(_0x424bf7,_0x239d7f){_0x424bf7=_0x424bf7-0x0;var _0x3c6a0f=_0x34e8[_0x424bf7];return _0x3c6a0f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x10')]('/',auth[_0x834e('0xa')](),interaction[_0x834e('0x11')](_0x834e('0x12'),_0x834e('0x13')),controller[_0x834e('0x14')]);router[_0x834e('0x15')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0x16')]);router['put'](_0x834e('0x17'),auth[_0x834e('0xa')](),controller[_0x834e('0x18')]);router[_0x834e('0x15')]('/:id/reject',auth[_0x834e('0xa')](),controller[_0x834e('0x19')]);router['delete'](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x9957=['download','post','mail','mailmessage:create','put','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/download'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var auth=require(_0x7995('0x5'));var interaction=require(_0x7995('0x6'));var config=require(_0x7995('0x7'));var controller=require('./mailMessage.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['describe']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x8')](_0x7995('0xe'),auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0x10')]('/',auth[_0x7995('0x9')](),interaction['tracked'](_0x7995('0x11'),_0x7995('0x12')),controller['create']);router[_0x7995('0x13')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x13')](_0x7995('0x15'),auth[_0x7995('0x9')](),controller['accept']);router['put'](_0x7995('0x16'),auth[_0x7995('0x9')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller[_0x7995('0x19')]);module[_0x7995('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 cb094b0..6f2c5b9 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 _0x565e=['long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','sequelize','exports','TEXT'];(function(_0x15ebfa,_0x21c194){var _0x53d201=function(_0x8bd3d){while(--_0x8bd3d){_0x15ebfa['push'](_0x15ebfa['shift']());}};_0x53d201(++_0x21c194);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe565('0x0'));var _=require('lodash');module[_0xe565('0x1')]={'body':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xe565('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe565('0x5')]('in',_0xe565('0x6')),'defaultValue':_0xe565('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe565('0x7')](0x1fe)},'from':{'type':Sequelize[_0xe565('0x7')]},'to':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'cc':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'bcc':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'subject':{'type':Sequelize[_0xe565('0x2')]},'sentAt':{'type':Sequelize[_0xe565('0x8')]},'attach':{'type':Sequelize[_0xe565('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe565('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'originCc':{'type':Sequelize[_0xe565('0x2')]('long')}}; \ No newline at end of file +var _0x110e=['medium','BOOLEAN','STRING','DATE','INTEGER','sequelize','lodash','TEXT','long'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x110e,0x68));var _0xe110=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x110e[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0xe110('0x0'));var _=require(_0xe110('0x1'));module['exports']={'body':{'type':Sequelize[_0xe110('0x2')](_0xe110('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe110('0x2')](_0xe110('0x4'))},'read':{'type':Sequelize[_0xe110('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xe110('0x6')]},'to':{'type':Sequelize['TEXT'](_0xe110('0x3'))},'cc':{'type':Sequelize[_0xe110('0x2')](_0xe110('0x3'))},'bcc':{'type':Sequelize[_0xe110('0x2')](_0xe110('0x3'))},'subject':{'type':Sequelize[_0xe110('0x2')]},'sentAt':{'type':Sequelize[_0xe110('0x7')]},'attach':{'type':Sequelize[_0xe110('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe110('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xe110('0x2')](_0xe110('0x3'))},'originCc':{'type':Sequelize['TEXT'](_0xe110('0x3'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 82a87a7..b105a1e 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 _0x48a9=['api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','name','map','MailMessage','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','show','params','keys','rawAttributes','length','body','find','describe','create','direction','secret','split','MailAccount','findOne','CmList','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','service','pass','attachments','server/files/attachments','basename','List','Contacts','defaults','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','Contact','get','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','download','root','server','join','files','message-%s.eml','bcc','subject','createdAt','Attachment','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','writeFileSync','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3963a7,_0xd54133){var _0xcde099=function(_0x2c846e){while(--_0x2c846e){_0x3963a7['push'](_0x3963a7['shift']());}};_0xcde099(++_0xd54133);}(_0x48a9,0x95));var _0x948a=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x48a9[_0x14a862];return _0x245eb5;};'use strict';var pdf=require(_0x948a('0x0'));var emlformat=require(_0x948a('0x1'));var rimraf=require(_0x948a('0x2'));var zipdir=require(_0x948a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x948a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x948a('0x5'));var path=require(_0x948a('0x6'));var sox=require(_0x948a('0x7'));var csv=require(_0x948a('0x8'));var ejs=require(_0x948a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x948a('0xa'));var crypto=require(_0x948a('0xb'));var jsforce=require(_0x948a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x948a('0x8'));var querystring=require(_0x948a('0xd'));var Papa=require(_0x948a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x948a('0xf'));var as=require(_0x948a('0x10'));var hardwareService=require(_0x948a('0x11'));var logger=require(_0x948a('0x12'))(_0x948a('0x13'));var utils=require(_0x948a('0x14'));var config=require('../../config/environment');var db=require(_0x948a('0x15'))['db'];config[_0x948a('0x16')]=_['defaults'](config[_0x948a('0x16')],{'host':_0x948a('0x17'),'port':0x18eb});var socket=require(_0x948a('0x18'))(new Redis(config[_0x948a('0x16')]));require(_0x948a('0x19'))[_0x948a('0x1a')](socket);var jayson=require(_0x948a('0x1b'));var client=jayson[_0x948a('0x1c')]['http']({'port':0x232c});var client9003=jayson['client'][_0x948a('0x1d')]({'port':0x232b});var client9002=jayson['client'][_0x948a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4433a0,_0x2b09c1,_0x226178){if(_0x226178){var _0x2cac7f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2cac7f[_0x948a('0x1e')](_0x2b09c1)){return _0x4433a0;}else{throw new db[(_0x948a('0x1f'))][(_0x948a('0x20'))](_0x948a('0x21'));}}else{return _0x4433a0;}}function respondWithRpcPromise(_0x2dc192,_0x2181be,_0x8db119,_0x458abd){return new BPromise(function(_0x551dd1,_0xd72c0){var _0x2c5ead=_0x458abd||client;return _0x2c5ead['request'](_0x2dc192,_0x8db119)[_0x948a('0x22')](function(_0x4bd297){logger[_0x948a('0x23')](_0x948a('0x24'),_0x2181be,_0x948a('0x25'));logger[_0x948a('0x26')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2181be,_0x948a('0x25'),JSON[_0x948a('0x27')](_0x4bd297));if(_0x4bd297[_0x948a('0x28')]){if(_0x4bd297[_0x948a('0x28')][_0x948a('0x29')]===0x1f4){logger[_0x948a('0x28')]('MailMessage,\x20%s,\x20%s',_0x2181be,_0x4bd297[_0x948a('0x28')]['message']);return _0xd72c0(_0x4bd297[_0x948a('0x28')][_0x948a('0x2a')]);}logger[_0x948a('0x28')](_0x948a('0x24'),_0x2181be,_0x4bd297[_0x948a('0x28')][_0x948a('0x2a')]);return _0x551dd1(_0x4bd297['error']['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x2181be,_0x948a('0x25'));_0x551dd1(_0x4bd297[_0x948a('0x2b')][_0x948a('0x2a')]);}})[_0x948a('0x2c')](function(_0x3a94c1){logger[_0x948a('0x28')](_0x948a('0x24'),_0x2181be,_0x3a94c1);_0xd72c0(_0x3a94c1);});});}function respondWithStatusCode(_0x453d87,_0xbb91f7){_0xbb91f7=_0xbb91f7||0xcc;return function(_0x4e381a){if(_0x4e381a){return _0x453d87[_0x948a('0x2d')](_0xbb91f7);}return _0x453d87[_0x948a('0x2e')](_0xbb91f7)[_0x948a('0x2f')]();};}function respondWithResult(_0x2ef20f,_0x59f8f1){_0x59f8f1=_0x59f8f1||0xc8;return function(_0x349488){if(_0x349488){return _0x2ef20f[_0x948a('0x2e')](_0x59f8f1)[_0x948a('0x30')](_0x349488);}};}function respondWithFilteredResult(_0x1ca50b,_0x50582b){return function(_0x3ebb1a){if(_0x3ebb1a){var _0xe257ff=_0x3ebb1a['count'],_0x33d2f0=_0x50582b[_0x948a('0x31')],_0x302aca=_0x50582b[_0x948a('0x31')]+_0x50582b[_0x948a('0x32')],_0x338f39;if(_0x302aca>=_0xe257ff){_0x302aca=_0xe257ff;_0x338f39=0xc8;}else{_0x338f39=0xce;}_0x1ca50b[_0x948a('0x2e')](_0x338f39);return _0x1ca50b[_0x948a('0x33')](_0x948a('0x34'),_0x33d2f0+'-'+_0x302aca+'/'+_0xe257ff)['json'](_0x3ebb1a);}return null;};}function patchUpdates(_0x3686d7){return function(_0x375a5e){try{jsonpatch['apply'](_0x375a5e,_0x3686d7,!![]);}catch(_0x227ce9){return BPromise[_0x948a('0x35')](_0x227ce9);}return _0x375a5e[_0x948a('0x36')]();};}function saveUpdates(_0x1aad8b,_0x9754ad){return function(_0x410a01){if(_0x410a01){return _0x410a01[_0x948a('0x37')](_0x1aad8b)[_0x948a('0x22')](function(_0x549e70){return _0x549e70;});}return null;};}function removeEntity(_0x43d8c5,_0x29315e){return function(_0x4e9a4a){if(_0x4e9a4a){return _0x4e9a4a[_0x948a('0x38')]()[_0x948a('0x22')](function(){_0x43d8c5[_0x948a('0x2e')](0xcc)[_0x948a('0x2f')]();});}};}function handleEntityNotFound(_0x343e2d,_0x4b1636){return function(_0x48f9e4){if(!_0x48f9e4){_0x343e2d[_0x948a('0x2d')](0x194);}return _0x48f9e4;};}function handleError(_0x579883,_0x250073){_0x250073=_0x250073||0x1f4;return function(_0x10965e){logger[_0x948a('0x28')](_0x10965e['stack']);if(_0x10965e[_0x948a('0x39')]){delete _0x10965e[_0x948a('0x39')];}_0x579883['status'](_0x250073)['send'](_0x10965e);};}exports['index']=function(_0x5db800,_0x1a577b){var _0x340d5c={},_0x8c7c7e={},_0x1f343d={'count':0x0,'rows':[]};var _0x6f27e4=_[_0x948a('0x3a')](db[_0x948a('0x3b')]['rawAttributes'],function(_0x397e22){return{'name':_0x397e22[_0x948a('0x3c')],'type':_0x397e22[_0x948a('0x3d')][_0x948a('0x3e')]};});_0x8c7c7e['model']=_[_0x948a('0x3a')](_0x6f27e4,_0x948a('0x39'));_0x8c7c7e['query']=_['keys'](_0x5db800[_0x948a('0x3f')]);_0x8c7c7e[_0x948a('0x40')]=_[_0x948a('0x41')](_0x8c7c7e[_0x948a('0x42')],_0x8c7c7e[_0x948a('0x3f')]);_0x340d5c[_0x948a('0x43')]=_[_0x948a('0x41')](_0x8c7c7e[_0x948a('0x42')],qs['fields'](_0x5db800[_0x948a('0x3f')][_0x948a('0x44')]));_0x340d5c[_0x948a('0x43')]=_0x340d5c[_0x948a('0x43')]['length']?_0x340d5c['attributes']:_0x8c7c7e[_0x948a('0x42')];if(!_0x5db800['query'][_0x948a('0x45')](_0x948a('0x46'))){_0x340d5c[_0x948a('0x32')]=qs[_0x948a('0x32')](_0x5db800['query']['limit']);_0x340d5c[_0x948a('0x31')]=qs['offset'](_0x5db800['query'][_0x948a('0x31')]);}_0x340d5c[_0x948a('0x47')]=qs[_0x948a('0x48')](_0x5db800['query']['sort']);_0x340d5c[_0x948a('0x49')]=qs[_0x948a('0x40')](_['pick'](_0x5db800['query'],_0x8c7c7e[_0x948a('0x40')]));if(_0x5db800[_0x948a('0x3f')][_0x948a('0x4a')]){_0x340d5c[_0x948a('0x49')]=_['merge'](_0x340d5c[_0x948a('0x49')],{'$or':_[_0x948a('0x3a')](_0x6f27e4,function(_0x527e57){if(_0x527e57[_0x948a('0x3d')]!==_0x948a('0x4b')){var _0x1cfeaf={};_0x1cfeaf[_0x527e57['name']]={'$like':'%'+_0x5db800['query']['filter']+'%'};return _0x1cfeaf;}})});}_0x340d5c=_[_0x948a('0x4c')]({},_0x340d5c,_0x5db800[_0x948a('0x4d')]);var _0x1d2de8={'where':_0x340d5c[_0x948a('0x49')]};return db[_0x948a('0x3b')]['count'](_0x1d2de8)[_0x948a('0x22')](function(_0x36be04){_0x1f343d['count']=_0x36be04;if(_0x5db800[_0x948a('0x3f')][_0x948a('0x4e')]){_0x340d5c[_0x948a('0x4f')]=[{'all':!![]}];}return db[_0x948a('0x3b')]['findAll'](_0x340d5c);})[_0x948a('0x22')](function(_0x65143b){_0x1f343d['rows']=_0x65143b;return _0x1f343d;})[_0x948a('0x22')](respondWithFilteredResult(_0x1a577b,_0x340d5c))['catch'](handleError(_0x1a577b,null));};exports[_0x948a('0x50')]=function(_0xe3ebcf,_0x268dc1){var _0x46ea91={'raw':!![],'where':{'id':_0xe3ebcf[_0x948a('0x51')]['id']}},_0xab8b12={};_0xab8b12[_0x948a('0x42')]=_[_0x948a('0x52')](db[_0x948a('0x3b')][_0x948a('0x53')]);_0xab8b12['query']=_[_0x948a('0x52')](_0xe3ebcf[_0x948a('0x3f')]);_0xab8b12[_0x948a('0x40')]=_[_0x948a('0x41')](_0xab8b12[_0x948a('0x42')],_0xab8b12['query']);_0x46ea91[_0x948a('0x43')]=_['intersection'](_0xab8b12['model'],qs[_0x948a('0x44')](_0xe3ebcf[_0x948a('0x3f')][_0x948a('0x44')]));_0x46ea91[_0x948a('0x43')]=_0x46ea91[_0x948a('0x43')][_0x948a('0x54')]?_0x46ea91[_0x948a('0x43')]:_0xab8b12[_0x948a('0x42')];if(_0xe3ebcf['query'][_0x948a('0x4e')]){_0x46ea91[_0x948a('0x4f')]=[{'all':!![]}];}_0x46ea91=_[_0x948a('0x4c')]({},_0x46ea91,_0xe3ebcf[_0x948a('0x4d')]);return db[_0x948a('0x3b')]['find'](_0x46ea91)['then'](handleEntityNotFound(_0x268dc1,null))[_0x948a('0x22')](respondWithResult(_0x268dc1,null))[_0x948a('0x2c')](handleError(_0x268dc1,null));};exports[_0x948a('0x37')]=function(_0x34eda9,_0x41fd64){if(_0x34eda9[_0x948a('0x55')]['id']){delete _0x34eda9[_0x948a('0x55')]['id'];}return db[_0x948a('0x3b')][_0x948a('0x56')]({'where':{'id':_0x34eda9[_0x948a('0x51')]['id']}})[_0x948a('0x22')](handleEntityNotFound(_0x41fd64,null))[_0x948a('0x22')](saveUpdates(_0x34eda9[_0x948a('0x55')],null))[_0x948a('0x22')](respondWithResult(_0x41fd64,null))[_0x948a('0x2c')](handleError(_0x41fd64,null));};exports[_0x948a('0x38')]=function(_0x154302,_0x208e52){return db[_0x948a('0x3b')][_0x948a('0x56')]({'where':{'id':_0x154302[_0x948a('0x51')]['id']}})[_0x948a('0x22')](handleEntityNotFound(_0x208e52,null))['then'](removeEntity(_0x208e52,null))['catch'](handleError(_0x208e52,null));};exports[_0x948a('0x57')]=function(_0x596bd8,_0x651bc1){return db[_0x948a('0x3b')][_0x948a('0x57')]()[_0x948a('0x22')](respondWithResult(_0x651bc1,null))[_0x948a('0x2c')](handleError(_0x651bc1,null));};exports[_0x948a('0x58')]=function(_0x2a0242,_0x76c2de){return db['MailMessage'][_0x948a('0x58')](_0x2a0242[_0x948a('0x55')])['then'](function(_0x219128){if(_0x219128){if(_0x219128[_0x948a('0x59')]==='out'&&!_0x219128[_0x948a('0x5a')]){var _0x2f24d7,_0x594245,_0xb72ac9;if(_0x2a0242['body']['to']){_0x594245=_0x2a0242[_0x948a('0x55')]['to'][_0x948a('0x5b')](',')[0x0];}return db[_0x948a('0x5c')][_0x948a('0x5d')]({'where':{'id':_0x219128['MailAccountId']},'include':[{'model':db[_0x948a('0x5e')],'as':'List','include':[{'model':db[_0x948a('0x5f')],'as':'Contacts','where':{'email':_0x594245},'limit':0x1,'order':[[_0x948a('0x60'),_0x948a('0x61')]]}]},{'model':db[_0x948a('0x62')],'as':'Smtp','raw':!![]}]})[_0x948a('0x22')](function(_0x589ec5){_0x2f24d7=_0x589ec5;if(_0x2f24d7&&_0x2f24d7[_0x948a('0x63')]){var _0x2ba688={'tls':{'rejectUnauthorized':![]}};if(_[_0x948a('0x64')](_0x2f24d7[_0x948a('0x63')]['service'])){_0x2ba688['host']=_0x2f24d7[_0x948a('0x63')][_0x948a('0x65')];_0x2ba688['port']=_0x2f24d7['Smtp'][_0x948a('0x66')];_0x2ba688[_0x948a('0x67')]=_0x2f24d7[_0x948a('0x63')]['secure'];if(_0x2f24d7[_0x948a('0x63')][_0x948a('0x68')]){_0x2ba688[_0x948a('0x69')]={'user':_0x2f24d7[_0x948a('0x63')][_0x948a('0x6a')],'pass':_0x2f24d7[_0x948a('0x63')]['pass']};}}else{_0x2ba688[_0x948a('0x6b')]=_0x2f24d7['Smtp']['service'];_0x2ba688[_0x948a('0x69')]={'user':_0x2f24d7[_0x948a('0x63')][_0x948a('0x6a')],'pass':_0x2f24d7[_0x948a('0x63')][_0x948a('0x6c')]};_0x2ba688[_0x948a('0x67')]=_0x2f24d7[_0x948a('0x63')][_0x948a('0x67')];}if(_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')]&&_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x948a('0x54')]){for(var _0x4705a7=0x0;_0x4705a7<_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x948a('0x54')];_0x4705a7+=0x1){_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x4705a7]={'filename':_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x4705a7][_0x948a('0x39')],'path':path['join'](config['root'],_0x948a('0x6e'),_0x2a0242[_0x948a('0x55')]['attachments'][_0x4705a7][_0x948a('0x6f')])};}}_0xb72ac9={'account':_0x2ba688,'message':_0x2a0242[_0x948a('0x55')]};return;}})[_0x948a('0x22')](function(){if(_0x2f24d7[_0x948a('0x70')]){if(_0x2f24d7[_0x948a('0x70')]['Contacts']['length']){return _0x2f24d7[_0x948a('0x70')][_0x948a('0x71')][0x0];}else{return db['CmContact'][_0x948a('0x58')](_[_0x948a('0x72')](_0x2a0242[_0x948a('0x55')],{'firstName':_0x2a0242[_0x948a('0x55')]['to'],'email':_0x2a0242[_0x948a('0x55')]['to'],'phone':_0x2a0242['body']['to'],'ListId':_0x2f24d7[_0x948a('0x73')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x948a('0x22')](function(){if(_0xb72ac9){return respondWithRpcPromise(_0x948a('0x74'),_0x948a('0x75'),_0xb72ac9,client9003)[_0x948a('0x22')](function(_0x218511){return _0x219128[_0x948a('0x37')]({'read':!![],'messageId':_0x218511[_0x948a('0x76')],'sentAt':moment()[_0x948a('0x77')](_0x948a('0x78'))});})[_0x948a('0x2c')](function(_0x5cc669){logger[_0x948a('0x28')]('%s',JSON[_0x948a('0x27')](_0x5cc669));return _0x219128;});}return _0x219128;});}return _0x219128;}})[_0x948a('0x22')](respondWithResult(_0x76c2de,0xc9))[_0x948a('0x2c')](handleError(_0x76c2de,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x948a('0x79')]=function(_0x5b6378,_0x306cda,_0xb77af9){var _0x5d3118={'channel':_0x948a('0x7a')};if(_0x5b6378[_0x948a('0x55')]['id']){delete _0x5b6378[_0x948a('0x55')]['id'];}_0x5b6378[_0x948a('0x55')][_0x948a('0x7b')]=!![];_0x5b6378[_0x948a('0x55')][_0x948a('0x7c')]=moment()[_0x948a('0x77')](_0x948a('0x78'));_0x5b6378[_0x948a('0x55')][_0x948a('0x7d')]=_0x5b6378[_0x948a('0x55')]['UserId']||_0x5b6378[_0x948a('0x6a')]['id'];return db['MailMessage']['find']({'where':{'id':_0x5b6378[_0x948a('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x948a('0x5f')],'as':_0x948a('0x7e')}]})[_0x948a('0x22')](handleEntityNotFound(_0x306cda,null))[_0x948a('0x22')](saveUpdates(_0x5b6378[_0x948a('0x55')],null))[_0x948a('0x22')](function(_0x2a772e){if(_0x2a772e){_0x5d3118[_0x948a('0x2a')]=_0x2a772e[_0x948a('0x7f')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2a772e['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x306cda,null))[_0x948a('0x22')](function(_0x3ff9d8){if(_0x3ff9d8){return _0x3ff9d8[_0x948a('0x37')]({'UserId':_0x5b6378['body'][_0x948a('0x7d')],'read1stAt':_[_0x948a('0x64')](_0x3ff9d8[_0x948a('0x80')])?moment()['format'](_0x948a('0x78')):undefined});}return null;})[_0x948a('0x22')](function(_0x5751b9){if(_0x5751b9){_0x5d3118[_0x948a('0x81')]=_0x5751b9[_0x948a('0x7f')]({'plain':!![]});interaction_log[_0x948a('0x23')](_0x948a('0x82'),_0x5b6378['user']['id'],_0x5b6378[_0x948a('0x6a')][_0x948a('0x39')],_0x5b6378[_0x948a('0x6a')][_0x948a('0x83')],_0x5d3118[_0x948a('0x81')]['id'],_0x5b6378[_0x948a('0x55')]?JSON['stringify'](_0x5b6378[_0x948a('0x55')]):_0x948a('0x84'));return respondWithRpcPromise(_0x948a('0x85'),_0x948a('0x86'),_0x5d3118);}return null;})[_0x948a('0x22')](function(_0x1333b5){if(_0x1333b5){if(_0x5b6378[_0x948a('0x55')]['manual']){_0x5d3118[_0x948a('0x2a')]['interface']=util[_0x948a('0x77')](_0x948a('0x87'),_0x5b6378['user'][_0x948a('0x39')]);_0x5d3118['message'][_0x948a('0x88')]=_0x5d3118[_0x948a('0x88')];_0x5d3118[_0x948a('0x2a')][_0x948a('0x89')]=_0x948a('0x79');return respondWithRpcPromise('EventManager',_0x948a('0x8a'),{'event':_0x948a('0x8b'),'message':_0x5d3118[_0x948a('0x2a')]},client9002)['then'](function(){return _0x5d3118;});}return _0x5d3118;}return null;})[_0x948a('0x22')](respondWithResult(_0x306cda,null))[_0x948a('0x2c')](handleError(_0x306cda,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x948a('0x35')]=function(_0x1f68d6,_0x1b9ae2,_0x52db80){var _0x5c9a3b={'agent':{},'channel':_0x948a('0x7a')};if(_0x1f68d6['body']['id']){delete _0x1f68d6[_0x948a('0x55')]['id'];}_0x1f68d6[_0x948a('0x55')][_0x948a('0x7d')]=_0x1f68d6[_0x948a('0x55')][_0x948a('0x7d')]||_0x1f68d6[_0x948a('0x6a')]['id'];_0x5c9a3b[_0x948a('0x8c')]['id']=_0x1f68d6[_0x948a('0x55')][_0x948a('0x7d')];return db[_0x948a('0x3b')]['find']({'where':{'id':_0x1f68d6[_0x948a('0x51')]['id'],'UserId':null}})[_0x948a('0x22')](handleEntityNotFound(_0x1b9ae2,null))[_0x948a('0x22')](function(_0x68ca80){if(_0x68ca80){_0x5c9a3b[_0x948a('0x2a')]=_0x68ca80[_0x948a('0x7f')]({'plain':!![]});return db[_0x948a('0x8d')][_0x948a('0x56')]({'where':{'id':_0x68ca80['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1b9ae2,null))['then'](function(_0x59bc8d){if(_0x59bc8d){_0x5c9a3b[_0x948a('0x81')]=_0x59bc8d[_0x948a('0x7f')]({'plain':!![]});interaction_log[_0x948a('0x23')](_0x948a('0x8e'),_0x1f68d6[_0x948a('0x6a')]['id'],_0x1f68d6['user'][_0x948a('0x39')],_0x1f68d6[_0x948a('0x6a')][_0x948a('0x83')],_0x5c9a3b[_0x948a('0x81')]['id'],_0x1f68d6[_0x948a('0x55')]?JSON[_0x948a('0x27')](_0x1f68d6['body']):_0x948a('0x84'));return respondWithRpcPromise(_0x948a('0x8f'),_0x948a('0x90'),_0x5c9a3b);}return null;})[_0x948a('0x22')](function(_0xba1585){if(_0xba1585){_0xba1585[_0x948a('0x2a')][_0x948a('0x91')]=util[_0x948a('0x77')](_0x948a('0x87'),_0x1f68d6['user']['name']);_0xba1585[_0x948a('0x2a')][_0x948a('0x88')]=_0x5c9a3b['channel'];_0xba1585[_0x948a('0x2a')]['event']=_0x948a('0x35');respondWithRpcPromise(_0x948a('0x8a'),'EventManager',{'event':_0x948a('0x92'),'message':_0xba1585['message']},client9002);return _0x5c9a3b;}return null;})[_0x948a('0x22')](respondWithResult(_0x1b9ae2,null))[_0x948a('0x2c')](handleError(_0x1b9ae2,null));};exports[_0x948a('0x93')]=function(_0x8a85f8,_0x58e7d3){var _0xa6516a=moment()['unix']()['toString']();var _0x2b0276=path['join'](config[_0x948a('0x94')],_0x948a('0x95'),'files','tmp');var _0x29ec61=path[_0x948a('0x96')](config['root'],_0x948a('0x95'),_0x948a('0x97'),'attachments');var _0x524dfa=util[_0x948a('0x77')](_0x948a('0x98'),_0xa6516a);return db[_0x948a('0x3b')][_0x948a('0x56')]({'where':{'id':_0x8a85f8['params']['id']},'attributes':['id',_0x948a('0x55'),'from','to','cc',_0x948a('0x99'),_0x948a('0x9a'),_0x948a('0x9b')],'include':_0x8a85f8['query'][_0x948a('0x6d')]?[{'model':db[_0x948a('0x9c')],'as':'Attachments'}]:undefined})[_0x948a('0x22')](handleEntityNotFound(_0x58e7d3,null))['then'](function(_0x12221f){if(_0x12221f){var _0xbc7f6f=_0x12221f;var _0xfc4309={'from':_0xbc7f6f[_0x948a('0x9d')],'to':_0xbc7f6f['to'],'subject':_0xbc7f6f[_0x948a('0x9a')],'html':_0xbc7f6f[_0x948a('0x55')],'headers':{'Date':moment(_0xbc7f6f[_0x948a('0x9b')])[_0x948a('0x77')](_0x948a('0x9e'))},'attachments':[]};if(_0x12221f['cc']){_0xfc4309[_0x948a('0x9f')]['Cc']=_0x12221f['cc'];}if(_0x12221f[_0x948a('0x99')]){_0xfc4309[_0x948a('0x9f')][_0x948a('0xa0')]=_0x12221f[_0x948a('0x99')];}return new BPromise(function(_0x4c07e9,_0x2654dd){if(_0x12221f[_0x948a('0xa1')]){for(var _0xa63b0f=0x0;_0xa63b0f<_0x12221f[_0x948a('0xa1')][_0x948a('0x54')];_0xa63b0f++){var _0x1d90cc=_0x12221f[_0x948a('0xa1')][_0xa63b0f];var _0x11c971=path[_0x948a('0x96')](_0x29ec61,_0x1d90cc[_0x948a('0x6f')]);if(fs[_0x948a('0xa2')](_0x11c971)){_0xfc4309[_0x948a('0x6d')][_0x948a('0xa3')]({'name':_0x1d90cc[_0x948a('0x39')],'contentType':_0x1d90cc['type'],'data':fs[_0x948a('0xa4')](_0x11c971)});}}}emlformat['build'](_0xfc4309,function(_0x528cdc,_0x24e92e){if(_0x528cdc)return _0x2654dd(_0x528cdc);fs[_0x948a('0xa5')](path[_0x948a('0x96')](_0x2b0276,_0x524dfa),_0x24e92e);return _0x4c07e9(_0x24e92e);});});}})[_0x948a('0x22')](function(_0x4a77b8){if(_0x4a77b8){return _0x58e7d3['download'](path['join'](_0x2b0276,_0x524dfa),_0x524dfa,function(_0x3201ae){if(_0x3201ae){console[_0x948a('0xa6')]('err',_0x3201ae);}else{fs[_0x948a('0xa7')](path[_0x948a('0x96')](_0x2b0276,_0x524dfa));}});}})['catch'](handleError(_0x58e7d3,null));}; \ No newline at end of file +var _0x1f14=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','find','body','destroy','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmContact','Contacts','updatedAt','DESC','Smtp','isNil','host','port','secure','authentication','auth','user','pass','service','attachments','join','server/files/attachments','List','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','readAt','UserId','MailInteraction','MailInteractionId','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','manual','interface','SIP/%s','channel','EventManager','acceptmessage','null','RejectMessage','event','rejectmessage','download','unix','root','server','files','tmp','from','subject','Attachment','Attachments','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','push','readFileSync','build','writeFileSync','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','end','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key'];(function(_0x1c5de8,_0x1ec996){var _0x32fdf5=function(_0x279737){while(--_0x279737){_0x1c5de8['push'](_0x1c5de8['shift']());}};_0x32fdf5(++_0x1ec996);}(_0x1f14,0x10f));var _0x41f1=function(_0x115489,_0x1b1126){_0x115489=_0x115489-0x0;var _0x1d54b3=_0x1f14[_0x115489];return _0x1d54b3;};'use strict';var pdf=require(_0x41f1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x41f1('0x1'));var zipdir=require(_0x41f1('0x2'));var jsonpatch=require(_0x41f1('0x3'));var rp=require('request-promise');var moment=require(_0x41f1('0x4'));var BPromise=require(_0x41f1('0x5'));var Mustache=require(_0x41f1('0x6'));var util=require(_0x41f1('0x7'));var path=require(_0x41f1('0x8'));var sox=require(_0x41f1('0x9'));var csv=require(_0x41f1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x41f1('0xb'));var squel=require(_0x41f1('0xc'));var crypto=require(_0x41f1('0xd'));var jsforce=require(_0x41f1('0xe'));var deskjs=require(_0x41f1('0xf'));var toCsv=require(_0x41f1('0xa'));var querystring=require(_0x41f1('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x41f1('0x11'));var qs=require(_0x41f1('0x12'));var as=require(_0x41f1('0x13'));var hardwareService=require(_0x41f1('0x14'));var logger=require(_0x41f1('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x41f1('0x16')]=_[_0x41f1('0x17')](config[_0x41f1('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x41f1('0x18'))(new Redis(config[_0x41f1('0x16')]));require(_0x41f1('0x19'))[_0x41f1('0x1a')](socket);var jayson=require(_0x41f1('0x1b'));var client=jayson[_0x41f1('0x1c')][_0x41f1('0x1d')]({'port':0x232c});var client9003=jayson[_0x41f1('0x1c')]['http']({'port':0x232b});var client9002=jayson['client'][_0x41f1('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x1245d9,_0x4e45e5,_0x4bc8bf){if(_0x4bc8bf){var _0x2362f9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2362f9[_0x41f1('0x1e')](_0x4e45e5)){return _0x1245d9;}else{throw new db[(_0x41f1('0x1f'))]['ValidationError'](_0x41f1('0x20'));}}else{return _0x1245d9;}}function respondWithRpcPromise(_0x2a26bc,_0x452692,_0x24a72f,_0x45dfa5){return new BPromise(function(_0x15668e,_0x1a0359){var _0x40e638=_0x45dfa5||client;return _0x40e638[_0x41f1('0x21')](_0x2a26bc,_0x24a72f)[_0x41f1('0x22')](function(_0x1111f3){logger[_0x41f1('0x23')]('MailMessage,\x20%s,\x20%s',_0x452692,'request\x20sent');logger[_0x41f1('0x24')](_0x41f1('0x25'),_0x452692,_0x41f1('0x26'),JSON[_0x41f1('0x27')](_0x1111f3));if(_0x1111f3[_0x41f1('0x28')]){if(_0x1111f3[_0x41f1('0x28')][_0x41f1('0x29')]===0x1f4){logger[_0x41f1('0x28')](_0x41f1('0x2a'),_0x452692,_0x1111f3[_0x41f1('0x28')][_0x41f1('0x2b')]);return _0x1a0359(_0x1111f3['error'][_0x41f1('0x2b')]);}logger['error'](_0x41f1('0x2a'),_0x452692,_0x1111f3[_0x41f1('0x28')]['message']);return _0x15668e(_0x1111f3[_0x41f1('0x28')][_0x41f1('0x2b')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x452692,_0x41f1('0x26'));_0x15668e(_0x1111f3[_0x41f1('0x2c')][_0x41f1('0x2b')]);}})['catch'](function(_0x457c81){logger[_0x41f1('0x28')](_0x41f1('0x2a'),_0x452692,_0x457c81);_0x1a0359(_0x457c81);});});}function respondWithStatusCode(_0x5a62e5,_0xfdaeea){_0xfdaeea=_0xfdaeea||0xcc;return function(_0x218f90){if(_0x218f90){return _0x5a62e5[_0x41f1('0x2d')](_0xfdaeea);}return _0x5a62e5[_0x41f1('0x2e')](_0xfdaeea)['end']();};}function respondWithResult(_0x4a8c75,_0x1dd3ac){_0x1dd3ac=_0x1dd3ac||0xc8;return function(_0x37c2a4){if(_0x37c2a4){return _0x4a8c75[_0x41f1('0x2e')](_0x1dd3ac)[_0x41f1('0x2f')](_0x37c2a4);}};}function respondWithFilteredResult(_0x40ebcd,_0x2280e8){return function(_0x43d0d4){if(_0x43d0d4){var _0x1fb1cd=_0x43d0d4[_0x41f1('0x30')],_0xc922b8=_0x2280e8[_0x41f1('0x31')],_0x57b4ec=_0x2280e8['offset']+_0x2280e8[_0x41f1('0x32')],_0x201fe4;if(_0x57b4ec>=_0x1fb1cd){_0x57b4ec=_0x1fb1cd;_0x201fe4=0xc8;}else{_0x201fe4=0xce;}_0x40ebcd[_0x41f1('0x2e')](_0x201fe4);return _0x40ebcd[_0x41f1('0x33')](_0x41f1('0x34'),_0xc922b8+'-'+_0x57b4ec+'/'+_0x1fb1cd)['json'](_0x43d0d4);}return null;};}function patchUpdates(_0x3235f8){return function(_0x37a68e){try{jsonpatch['apply'](_0x37a68e,_0x3235f8,!![]);}catch(_0x5bcd5e){return BPromise[_0x41f1('0x35')](_0x5bcd5e);}return _0x37a68e[_0x41f1('0x36')]();};}function saveUpdates(_0x41daa0,_0x1edb85){return function(_0x2c89bb){if(_0x2c89bb){return _0x2c89bb[_0x41f1('0x37')](_0x41daa0)[_0x41f1('0x22')](function(_0x1750c7){return _0x1750c7;});}return null;};}function removeEntity(_0x3e25db,_0x3668f0){return function(_0x3c223e){if(_0x3c223e){return _0x3c223e['destroy']()[_0x41f1('0x22')](function(){_0x3e25db[_0x41f1('0x2e')](0xcc)[_0x41f1('0x38')]();});}};}function handleEntityNotFound(_0x57f272,_0x375804){return function(_0x5d1e0f){if(!_0x5d1e0f){_0x57f272[_0x41f1('0x2d')](0x194);}return _0x5d1e0f;};}function handleError(_0x1d3da4,_0x188a0f){_0x188a0f=_0x188a0f||0x1f4;return function(_0x37c39a){logger['error'](_0x37c39a[_0x41f1('0x39')]);if(_0x37c39a[_0x41f1('0x3a')]){delete _0x37c39a[_0x41f1('0x3a')];}_0x1d3da4[_0x41f1('0x2e')](_0x188a0f)[_0x41f1('0x3b')](_0x37c39a);};}exports[_0x41f1('0x3c')]=function(_0x23ee53,_0x38547e){var _0x57b2b9={},_0x50148e={},_0x37013a={'count':0x0,'rows':[]};var _0x3a25ce=_[_0x41f1('0x3d')](db[_0x41f1('0x3e')][_0x41f1('0x3f')],function(_0x18e4e8){return{'name':_0x18e4e8[_0x41f1('0x40')],'type':_0x18e4e8[_0x41f1('0x41')][_0x41f1('0x42')]};});_0x50148e[_0x41f1('0x43')]=_[_0x41f1('0x3d')](_0x3a25ce,_0x41f1('0x3a'));_0x50148e[_0x41f1('0x44')]=_[_0x41f1('0x45')](_0x23ee53['query']);_0x50148e[_0x41f1('0x46')]=_[_0x41f1('0x47')](_0x50148e[_0x41f1('0x43')],_0x50148e['query']);_0x57b2b9[_0x41f1('0x48')]=_['intersection'](_0x50148e['model'],qs[_0x41f1('0x49')](_0x23ee53[_0x41f1('0x44')]['fields']));_0x57b2b9['attributes']=_0x57b2b9[_0x41f1('0x48')][_0x41f1('0x4a')]?_0x57b2b9[_0x41f1('0x48')]:_0x50148e[_0x41f1('0x43')];if(!_0x23ee53[_0x41f1('0x44')][_0x41f1('0x4b')]('nolimit')){_0x57b2b9[_0x41f1('0x32')]=qs[_0x41f1('0x32')](_0x23ee53[_0x41f1('0x44')][_0x41f1('0x32')]);_0x57b2b9[_0x41f1('0x31')]=qs['offset'](_0x23ee53[_0x41f1('0x44')][_0x41f1('0x31')]);}_0x57b2b9['order']=qs[_0x41f1('0x4c')](_0x23ee53[_0x41f1('0x44')]['sort']);_0x57b2b9[_0x41f1('0x4d')]=qs['filters'](_[_0x41f1('0x4e')](_0x23ee53['query'],_0x50148e[_0x41f1('0x46')]));if(_0x23ee53['query']['filter']){_0x57b2b9[_0x41f1('0x4d')]=_['merge'](_0x57b2b9[_0x41f1('0x4d')],{'$or':_[_0x41f1('0x3d')](_0x3a25ce,function(_0x411c19){if(_0x411c19['type']!=='VIRTUAL'){var _0x48c3be={};_0x48c3be[_0x411c19['name']]={'$like':'%'+_0x23ee53[_0x41f1('0x44')][_0x41f1('0x4f')]+'%'};return _0x48c3be;}})});}_0x57b2b9=_[_0x41f1('0x50')]({},_0x57b2b9,_0x23ee53[_0x41f1('0x51')]);var _0xb88fcf={'where':_0x57b2b9[_0x41f1('0x4d')]};return db[_0x41f1('0x3e')][_0x41f1('0x30')](_0xb88fcf)[_0x41f1('0x22')](function(_0x407e0a){_0x37013a['count']=_0x407e0a;if(_0x23ee53[_0x41f1('0x44')][_0x41f1('0x52')]){_0x57b2b9[_0x41f1('0x53')]=[{'all':!![]}];}return db[_0x41f1('0x3e')][_0x41f1('0x54')](_0x57b2b9);})[_0x41f1('0x22')](function(_0x33ad02){_0x37013a['rows']=_0x33ad02;return _0x37013a;})['then'](respondWithFilteredResult(_0x38547e,_0x57b2b9))[_0x41f1('0x55')](handleError(_0x38547e,null));};exports[_0x41f1('0x56')]=function(_0x2442d4,_0x5a15a2){var _0x858eee={'raw':!![],'where':{'id':_0x2442d4[_0x41f1('0x57')]['id']}},_0x1d9249={};_0x1d9249[_0x41f1('0x43')]=_[_0x41f1('0x45')](db['MailMessage'][_0x41f1('0x3f')]);_0x1d9249[_0x41f1('0x44')]=_['keys'](_0x2442d4['query']);_0x1d9249['filters']=_['intersection'](_0x1d9249['model'],_0x1d9249[_0x41f1('0x44')]);_0x858eee['attributes']=_[_0x41f1('0x47')](_0x1d9249[_0x41f1('0x43')],qs[_0x41f1('0x49')](_0x2442d4[_0x41f1('0x44')]['fields']));_0x858eee['attributes']=_0x858eee[_0x41f1('0x48')][_0x41f1('0x4a')]?_0x858eee[_0x41f1('0x48')]:_0x1d9249[_0x41f1('0x43')];if(_0x2442d4['query'][_0x41f1('0x52')]){_0x858eee[_0x41f1('0x53')]=[{'all':!![]}];}_0x858eee=_[_0x41f1('0x50')]({},_0x858eee,_0x2442d4['options']);return db[_0x41f1('0x3e')][_0x41f1('0x58')](_0x858eee)[_0x41f1('0x22')](handleEntityNotFound(_0x5a15a2,null))[_0x41f1('0x22')](respondWithResult(_0x5a15a2,null))[_0x41f1('0x55')](handleError(_0x5a15a2,null));};exports[_0x41f1('0x37')]=function(_0x5f240f,_0x4a4523){if(_0x5f240f[_0x41f1('0x59')]['id']){delete _0x5f240f['body']['id'];}return db['MailMessage'][_0x41f1('0x58')]({'where':{'id':_0x5f240f[_0x41f1('0x57')]['id']}})['then'](handleEntityNotFound(_0x4a4523,null))[_0x41f1('0x22')](saveUpdates(_0x5f240f[_0x41f1('0x59')],null))[_0x41f1('0x22')](respondWithResult(_0x4a4523,null))[_0x41f1('0x55')](handleError(_0x4a4523,null));};exports[_0x41f1('0x5a')]=function(_0x48bb51,_0x4d3055){return db[_0x41f1('0x3e')][_0x41f1('0x58')]({'where':{'id':_0x48bb51[_0x41f1('0x57')]['id']}})[_0x41f1('0x22')](handleEntityNotFound(_0x4d3055,null))[_0x41f1('0x22')](removeEntity(_0x4d3055,null))['catch'](handleError(_0x4d3055,null));};exports[_0x41f1('0x5b')]=function(_0x22ae1e,_0x10e6c9){return db[_0x41f1('0x3e')][_0x41f1('0x5b')]()[_0x41f1('0x22')](respondWithResult(_0x10e6c9,null))[_0x41f1('0x55')](handleError(_0x10e6c9,null));};exports['create']=function(_0x5f3051,_0x1b7b90){return db[_0x41f1('0x3e')][_0x41f1('0x5c')](_0x5f3051[_0x41f1('0x59')])[_0x41f1('0x22')](function(_0x154859){if(_0x154859){if(_0x154859[_0x41f1('0x5d')]===_0x41f1('0x5e')&&!_0x154859[_0x41f1('0x5f')]){var _0x29d238,_0x1886ff,_0xbe319b;if(_0x5f3051[_0x41f1('0x59')]['to']){_0x1886ff=_0x5f3051[_0x41f1('0x59')]['to'][_0x41f1('0x60')](',')[0x0];}return db[_0x41f1('0x61')][_0x41f1('0x62')]({'where':{'id':_0x154859[_0x41f1('0x63')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x41f1('0x64')],'as':_0x41f1('0x65'),'where':{'email':_0x1886ff},'limit':0x1,'order':[[_0x41f1('0x66'),_0x41f1('0x67')]]}]},{'model':db['MailServerOut'],'as':_0x41f1('0x68'),'raw':!![]}]})[_0x41f1('0x22')](function(_0x2a882){_0x29d238=_0x2a882;if(_0x29d238&&_0x29d238[_0x41f1('0x68')]){var _0x28ce93={'tls':{'rejectUnauthorized':![]}};if(_[_0x41f1('0x69')](_0x29d238[_0x41f1('0x68')]['service'])){_0x28ce93[_0x41f1('0x6a')]=_0x29d238[_0x41f1('0x68')][_0x41f1('0x6a')];_0x28ce93[_0x41f1('0x6b')]=_0x29d238[_0x41f1('0x68')][_0x41f1('0x6b')];_0x28ce93[_0x41f1('0x6c')]=_0x29d238['Smtp'][_0x41f1('0x6c')];if(_0x29d238[_0x41f1('0x68')][_0x41f1('0x6d')]){_0x28ce93[_0x41f1('0x6e')]={'user':_0x29d238['Smtp'][_0x41f1('0x6f')],'pass':_0x29d238[_0x41f1('0x68')][_0x41f1('0x70')]};}}else{_0x28ce93[_0x41f1('0x71')]=_0x29d238[_0x41f1('0x68')]['service'];_0x28ce93[_0x41f1('0x6e')]={'user':_0x29d238['Smtp'][_0x41f1('0x6f')],'pass':_0x29d238['Smtp']['pass']};_0x28ce93[_0x41f1('0x6c')]=_0x29d238[_0x41f1('0x68')][_0x41f1('0x6c')];}if(_0x5f3051[_0x41f1('0x59')][_0x41f1('0x72')]&&_0x5f3051[_0x41f1('0x59')][_0x41f1('0x72')][_0x41f1('0x4a')]){for(var _0x4fd391=0x0;_0x4fd391<_0x5f3051[_0x41f1('0x59')][_0x41f1('0x72')][_0x41f1('0x4a')];_0x4fd391+=0x1){_0x5f3051['body'][_0x41f1('0x72')][_0x4fd391]={'filename':_0x5f3051[_0x41f1('0x59')][_0x41f1('0x72')][_0x4fd391]['name'],'path':path[_0x41f1('0x73')](config['root'],_0x41f1('0x74'),_0x5f3051[_0x41f1('0x59')][_0x41f1('0x72')][_0x4fd391]['basename'])};}}_0xbe319b={'account':_0x28ce93,'message':_0x5f3051[_0x41f1('0x59')]};return;}})[_0x41f1('0x22')](function(){if(_0x29d238[_0x41f1('0x75')]){if(_0x29d238[_0x41f1('0x75')]['Contacts'][_0x41f1('0x4a')]){return _0x29d238['List'][_0x41f1('0x65')][0x0];}else{return db[_0x41f1('0x64')][_0x41f1('0x5c')](_['defaults'](_0x5f3051[_0x41f1('0x59')],{'firstName':_0x5f3051['body']['to'],'email':_0x5f3051[_0x41f1('0x59')]['to'],'phone':_0x5f3051[_0x41f1('0x59')]['to'],'ListId':_0x29d238[_0x41f1('0x76')]}));}}else{throw new Error(_0x41f1('0x77'));}})[_0x41f1('0x22')](function(){if(_0xbe319b){return respondWithRpcPromise(_0x41f1('0x78'),_0x41f1('0x79'),_0xbe319b,client9003)[_0x41f1('0x22')](function(_0x3d7f07){return _0x154859[_0x41f1('0x37')]({'read':!![],'messageId':_0x3d7f07['messageId'],'sentAt':moment()[_0x41f1('0x7a')](_0x41f1('0x7b'))});})['catch'](function(_0x200d4e){logger[_0x41f1('0x28')]('%s',JSON['stringify'](_0x200d4e));return _0x154859;});}return _0x154859;});}return _0x154859;}})[_0x41f1('0x22')](respondWithResult(_0x1b7b90,0xc9))[_0x41f1('0x55')](handleError(_0x1b7b90,null));};var interaction_log=require(_0x41f1('0x15'))(_0x41f1('0x7c'));exports[_0x41f1('0x7d')]=function(_0x318b69,_0x2ad4f1,_0x43cf69){var _0x49350c={'channel':_0x41f1('0x7e')};if(_0x318b69[_0x41f1('0x59')]['id']){delete _0x318b69[_0x41f1('0x59')]['id'];}_0x318b69[_0x41f1('0x59')]['read']=!![];_0x318b69[_0x41f1('0x59')][_0x41f1('0x7f')]=moment()[_0x41f1('0x7a')](_0x41f1('0x7b'));_0x318b69['body'][_0x41f1('0x80')]=_0x318b69[_0x41f1('0x59')][_0x41f1('0x80')]||_0x318b69[_0x41f1('0x6f')]['id'];return db[_0x41f1('0x3e')][_0x41f1('0x58')]({'where':{'id':_0x318b69['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x41f1('0x22')](handleEntityNotFound(_0x2ad4f1,null))[_0x41f1('0x22')](saveUpdates(_0x318b69[_0x41f1('0x59')],null))[_0x41f1('0x22')](function(_0x6b6b21){if(_0x6b6b21){_0x49350c['message']=_0x6b6b21['get']({'plain':!![]});return db[_0x41f1('0x81')][_0x41f1('0x58')]({'where':{'id':_0x6b6b21[_0x41f1('0x82')]}});}return null;})[_0x41f1('0x22')](handleEntityNotFound(_0x2ad4f1,null))[_0x41f1('0x22')](function(_0x376ac4){if(_0x376ac4){return _0x376ac4[_0x41f1('0x37')]({'UserId':_0x318b69[_0x41f1('0x59')][_0x41f1('0x80')],'read1stAt':_['isNil'](_0x376ac4[_0x41f1('0x83')])?moment()[_0x41f1('0x7a')](_0x41f1('0x7b')):undefined});}return null;})['then'](function(_0x43ccd1){if(_0x43ccd1){_0x49350c[_0x41f1('0x84')]=_0x43ccd1[_0x41f1('0x85')]({'plain':!![]});interaction_log['info'](_0x41f1('0x86'),_0x318b69[_0x41f1('0x6f')]['id'],_0x318b69[_0x41f1('0x6f')][_0x41f1('0x3a')],_0x318b69[_0x41f1('0x6f')][_0x41f1('0x87')],_0x49350c[_0x41f1('0x84')]['id'],_0x318b69['body']?JSON[_0x41f1('0x27')](_0x318b69[_0x41f1('0x59')]):'null');return respondWithRpcPromise(_0x41f1('0x88'),'acceptMessage',_0x49350c);}return null;})[_0x41f1('0x22')](function(_0x2d7cfb){if(_0x2d7cfb){if(_0x318b69[_0x41f1('0x59')][_0x41f1('0x89')]){_0x49350c[_0x41f1('0x2b')][_0x41f1('0x8a')]=util[_0x41f1('0x7a')](_0x41f1('0x8b'),_0x318b69[_0x41f1('0x6f')][_0x41f1('0x3a')]);_0x49350c[_0x41f1('0x2b')][_0x41f1('0x8c')]=_0x49350c[_0x41f1('0x8c')];_0x49350c[_0x41f1('0x2b')]['event']=_0x41f1('0x7d');return respondWithRpcPromise(_0x41f1('0x8d'),_0x41f1('0x8d'),{'event':_0x41f1('0x8e'),'message':_0x49350c[_0x41f1('0x2b')]},client9002)[_0x41f1('0x22')](function(){return _0x49350c;});}return _0x49350c;}return null;})[_0x41f1('0x22')](respondWithResult(_0x2ad4f1,null))[_0x41f1('0x55')](handleError(_0x2ad4f1,null));};var interaction_log=require(_0x41f1('0x15'))(_0x41f1('0x7c'));exports['reject']=function(_0x1286e2,_0x1bd561,_0x5da26f){var _0x2768b0={'agent':{},'channel':_0x41f1('0x7e')};if(_0x1286e2[_0x41f1('0x59')]['id']){delete _0x1286e2[_0x41f1('0x59')]['id'];}_0x1286e2[_0x41f1('0x59')]['UserId']=_0x1286e2[_0x41f1('0x59')][_0x41f1('0x80')]||_0x1286e2[_0x41f1('0x6f')]['id'];_0x2768b0['agent']['id']=_0x1286e2[_0x41f1('0x59')]['UserId'];return db[_0x41f1('0x3e')][_0x41f1('0x58')]({'where':{'id':_0x1286e2['params']['id'],'UserId':null}})[_0x41f1('0x22')](handleEntityNotFound(_0x1bd561,null))[_0x41f1('0x22')](function(_0xb261d7){if(_0xb261d7){_0x2768b0['message']=_0xb261d7[_0x41f1('0x85')]({'plain':!![]});return db[_0x41f1('0x81')]['find']({'where':{'id':_0xb261d7[_0x41f1('0x82')]}});}return null;})['then'](handleEntityNotFound(_0x1bd561,null))['then'](function(_0x2fc75d){if(_0x2fc75d){_0x2768b0[_0x41f1('0x84')]=_0x2fc75d[_0x41f1('0x85')]({'plain':!![]});interaction_log[_0x41f1('0x23')]('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1286e2['user']['id'],_0x1286e2['user'][_0x41f1('0x3a')],_0x1286e2[_0x41f1('0x6f')][_0x41f1('0x87')],_0x2768b0[_0x41f1('0x84')]['id'],_0x1286e2[_0x41f1('0x59')]?JSON[_0x41f1('0x27')](_0x1286e2['body']):_0x41f1('0x8f'));return respondWithRpcPromise(_0x41f1('0x90'),'rejectMessage',_0x2768b0);}return null;})[_0x41f1('0x22')](function(_0x2b4105){if(_0x2b4105){_0x2b4105[_0x41f1('0x2b')][_0x41f1('0x8a')]=util[_0x41f1('0x7a')](_0x41f1('0x8b'),_0x1286e2[_0x41f1('0x6f')][_0x41f1('0x3a')]);_0x2b4105[_0x41f1('0x2b')][_0x41f1('0x8c')]=_0x2768b0[_0x41f1('0x8c')];_0x2b4105[_0x41f1('0x2b')][_0x41f1('0x91')]='reject';respondWithRpcPromise(_0x41f1('0x8d'),_0x41f1('0x8d'),{'event':_0x41f1('0x92'),'message':_0x2b4105['message']},client9002);return _0x2768b0;}return null;})['then'](respondWithResult(_0x1bd561,null))[_0x41f1('0x55')](handleError(_0x1bd561,null));};exports[_0x41f1('0x93')]=function(_0x6c04d0,_0x46ace8){var _0x4249cf=moment()[_0x41f1('0x94')]()['toString']();var _0x377c7c=path[_0x41f1('0x73')](config[_0x41f1('0x95')],_0x41f1('0x96'),_0x41f1('0x97'),_0x41f1('0x98'));var _0x99b51a=path[_0x41f1('0x73')](config[_0x41f1('0x95')],_0x41f1('0x96'),_0x41f1('0x97'),_0x41f1('0x72'));var _0x35abda=util[_0x41f1('0x7a')]('message-%s.eml',_0x4249cf);return db[_0x41f1('0x3e')]['find']({'where':{'id':_0x6c04d0[_0x41f1('0x57')]['id']},'attributes':['id',_0x41f1('0x59'),_0x41f1('0x99'),'to','cc','bcc',_0x41f1('0x9a'),'createdAt'],'include':_0x6c04d0[_0x41f1('0x44')][_0x41f1('0x72')]?[{'model':db[_0x41f1('0x9b')],'as':_0x41f1('0x9c')}]:undefined})[_0x41f1('0x22')](handleEntityNotFound(_0x46ace8,null))[_0x41f1('0x22')](function(_0x5e34c7){if(_0x5e34c7){var _0x554e8c=_0x5e34c7;var _0x132711={'from':_0x554e8c[_0x41f1('0x99')],'to':_0x554e8c['to'],'subject':_0x554e8c[_0x41f1('0x9a')],'html':_0x554e8c['body'],'headers':{'Date':moment(_0x554e8c[_0x41f1('0x9d')])[_0x41f1('0x7a')](_0x41f1('0x9e'))},'attachments':[]};if(_0x5e34c7['cc']){_0x132711[_0x41f1('0x9f')]['Cc']=_0x5e34c7['cc'];}if(_0x5e34c7[_0x41f1('0xa0')]){_0x132711[_0x41f1('0x9f')][_0x41f1('0xa1')]=_0x5e34c7[_0x41f1('0xa0')];}return new BPromise(function(_0x1ff3bd,_0x2380e9){if(_0x5e34c7[_0x41f1('0x9c')]){for(var _0x237cd2=0x0;_0x237cd2<_0x5e34c7[_0x41f1('0x9c')][_0x41f1('0x4a')];_0x237cd2++){var _0x2611a6=_0x5e34c7[_0x41f1('0x9c')][_0x237cd2];var _0x233492=path[_0x41f1('0x73')](_0x99b51a,_0x2611a6[_0x41f1('0xa2')]);if(fs['existsSync'](_0x233492)){_0x132711[_0x41f1('0x72')][_0x41f1('0xa3')]({'name':_0x2611a6[_0x41f1('0x3a')],'contentType':_0x2611a6[_0x41f1('0x41')],'data':fs[_0x41f1('0xa4')](_0x233492)});}}}emlformat[_0x41f1('0xa5')](_0x132711,function(_0x320b12,_0x15533d){if(_0x320b12)return _0x2380e9(_0x320b12);fs[_0x41f1('0xa6')](path['join'](_0x377c7c,_0x35abda),_0x15533d);return _0x1ff3bd(_0x15533d);});});}})['then'](function(_0x142e2c){if(_0x142e2c){return _0x46ace8[_0x41f1('0x93')](path[_0x41f1('0x73')](_0x377c7c,_0x35abda),_0x35abda,function(_0x5a32e6){if(_0x5a32e6){console['log'](_0x41f1('0xa7'),_0x5a32e6);}else{fs[_0x41f1('0xa8')](path[_0x41f1('0x73')](_0x377c7c,_0x35abda));}});}})[_0x41f1('0x55')](handleError(_0x46ace8,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 86cecf5..666b790 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 _0xb11e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save','update'];(function(_0x4b9af4,_0x1edf2d){var _0x31c5f4=function(_0x5dd17d){while(--_0x5dd17d){_0x4b9af4['push'](_0x4b9af4['shift']());}};_0x31c5f4(++_0x1edf2d);}(_0xb11e,0xeb));var _0xeb11=function(_0x5bbf47,_0x4c83a2){_0x5bbf47=_0x5bbf47-0x0;var _0x264906=_0xb11e[_0x5bbf47];return _0x264906;};'use strict';var EventEmitter=require(_0xeb11('0x0'));var MailMessage=require(_0xeb11('0x1'))['db'][_0xeb11('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb11('0x3'),'afterUpdate':_0xeb11('0x4'),'afterDestroy':_0xeb11('0x5')};function emitEvent(_0x1f4c06){return function(_0x3a23f6,_0x49c426,_0xa6fe58){MailMessageEvents[_0xeb11('0x6')](_0x1f4c06+':'+_0x3a23f6['id'],_0x3a23f6);MailMessageEvents['emit'](_0x1f4c06,_0x3a23f6);_0xa6fe58(null);};}for(var e in events){if(events[_0xeb11('0x7')](e)){var event=events[e];MailMessage[_0xeb11('0x8')](e,emitEvent(event));}}module[_0xeb11('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x0dc6=['../../mysqldb','MailMessage','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0xc753c8,_0x5627ff){var _0xd02f5c=function(_0xfb552e){while(--_0xfb552e){_0xc753c8['push'](_0xc753c8['shift']());}};_0xd02f5c(++_0x5627ff);}(_0x0dc6,0x183));var _0x60dc=function(_0x1b3a9e,_0x3b6e29){_0x1b3a9e=_0x1b3a9e-0x0;var _0x53cdc2=_0x0dc6[_0x1b3a9e];return _0x53cdc2;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x60dc('0x0'))['db'][_0x60dc('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x60dc('0x2')](0x0);var events={'afterCreate':_0x60dc('0x3'),'afterUpdate':_0x60dc('0x4'),'afterDestroy':_0x60dc('0x5')};function emitEvent(_0x45db6c){return function(_0x30a3ab,_0x221cba,_0x68b4c8){MailMessageEvents[_0x60dc('0x6')](_0x45db6c+':'+_0x30a3ab['id'],_0x30a3ab);MailMessageEvents['emit'](_0x45db6c,_0x30a3ab);_0x68b4c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x60dc('0x7')](e,emitEvent(event));}}module[_0x60dc('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index e45be36..f3a6695 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 _0x1ecf=['subject','FULLTEXT','body','models','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','plainBody'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x1ecf,0x1df));var _0xf1ec=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x1ecf[_0x1385dc];return _0x2f6469;};'use strict';var _=require(_0xf1ec('0x0'));var util=require(_0xf1ec('0x1'));var logger=require(_0xf1ec('0x2'))(_0xf1ec('0x3'));var moment=require(_0xf1ec('0x4'));var BPromise=require(_0xf1ec('0x5'));var rp=require('request-promise');var htmlToText=require(_0xf1ec('0x6'));var fs=require('fs');var path=require(_0xf1ec('0x7'));var rimraf=require(_0xf1ec('0x8'));var config=require(_0xf1ec('0x9'));var attributes=require(_0xf1ec('0xa'));module[_0xf1ec('0xb')]=function(_0x1cdaf,_0x18113a){return _0x1cdaf['define'](_0xf1ec('0xc'),attributes,{'tableName':_0xf1ec('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xf1ec('0xe')]},{'name':'fti_mail_messages','fields':[_0xf1ec('0xf'),_0xf1ec('0x10')],'type':_0xf1ec('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x180e64,_0x5e869e,_0x20aa12){if(_0x180e64[_0xf1ec('0x12')]){_0x180e64['plainBody']=htmlToText['fromString'](_0x180e64['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x20aa12(null,_0x5e869e);},'afterCreate':function(_0x3bdb13,_0x2f8036,_0x580202){var _0x36c6de=_0x1cdaf[_0xf1ec('0x13')];var _0x289a4e=_0x3bdb13['get']({'plain':!![]});if(_0x289a4e[_0xf1ec('0x14')][_0xf1ec('0x15')]()==='in'||_0x289a4e[_0xf1ec('0x14')][_0xf1ec('0x15')]()==='out'&&!_0x289a4e[_0xf1ec('0x16')]&&!_[_0xf1ec('0x17')](_0x289a4e[_0xf1ec('0x18')])){_0x36c6de[_0xf1ec('0x19')][_0xf1ec('0x1a')]({'where':{'id':_0x289a4e[_0xf1ec('0x1b')]}})[_0xf1ec('0x1c')](function(_0x246042){if(_0x246042){_0x246042['update']({'lastMsgAt':_0x289a4e[_0xf1ec('0x1d')],'lastMsgDirection':_0x289a4e[_0xf1ec('0x14')]['toLowerCase'](),'lastMsgBody':_0x289a4e[_0xf1ec('0x12')]});}})[_0xf1ec('0x1e')](function(_0x144af5){console['error'](_0x144af5);});}_0x580202();}},'charset':_0xf1ec('0x1f'),'collate':_0xf1ec('0x20')});}; \ No newline at end of file +var _0x7783=['request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','subject','FULLTEXT','body','plainBody','fromString','models','get','toLowerCase','direction','secret','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x16ee48,_0x4e660d){var _0x23f7bf=function(_0x31464e){while(--_0x31464e){_0x16ee48['push'](_0x16ee48['shift']());}};_0x23f7bf(++_0x4e660d);}(_0x7783,0x67));var _0x3778=function(_0x339512,_0x3db68f){_0x339512=_0x339512-0x0;var _0x308a21=_0x7783[_0x339512];return _0x308a21;};'use strict';var _=require(_0x3778('0x0'));var util=require(_0x3778('0x1'));var logger=require(_0x3778('0x2'))('api');var moment=require(_0x3778('0x3'));var BPromise=require(_0x3778('0x4'));var rp=require(_0x3778('0x5'));var htmlToText=require(_0x3778('0x6'));var fs=require('fs');var path=require(_0x3778('0x7'));var rimraf=require(_0x3778('0x8'));var config=require(_0x3778('0x9'));var attributes=require(_0x3778('0xa'));module[_0x3778('0xb')]=function(_0x30ab66,_0x118a2d){return _0x30ab66[_0x3778('0xc')](_0x3778('0xd'),attributes,{'tableName':_0x3778('0xe'),'paranoid':![],'indexes':[{'name':_0x3778('0xf'),'fields':[_0x3778('0xf')]},{'name':'fti_mail_messages','fields':['plainBody',_0x3778('0x10')],'type':_0x3778('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x345ff0,_0x464e2b,_0x1f13c0){if(_0x345ff0[_0x3778('0x12')]){_0x345ff0[_0x3778('0x13')]=htmlToText[_0x3778('0x14')](_0x345ff0[_0x3778('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1f13c0(null,_0x464e2b);},'afterCreate':function(_0x57333c,_0x549a74,_0x4c6b75){var _0x503286=_0x30ab66[_0x3778('0x15')];var _0x5b5ca0=_0x57333c[_0x3778('0x16')]({'plain':!![]});if(_0x5b5ca0['direction'][_0x3778('0x17')]()==='in'||_0x5b5ca0[_0x3778('0x18')][_0x3778('0x17')]()==='out'&&!_0x5b5ca0[_0x3778('0x19')]&&!_[_0x3778('0x1a')](_0x5b5ca0['UserId'])){_0x503286[_0x3778('0x1b')][_0x3778('0x1c')]({'where':{'id':_0x5b5ca0[_0x3778('0x1d')]}})[_0x3778('0x1e')](function(_0x334772){if(_0x334772){_0x334772[_0x3778('0x1f')]({'lastMsgAt':_0x5b5ca0[_0x3778('0x20')],'lastMsgDirection':_0x5b5ca0[_0x3778('0x18')][_0x3778('0x17')](),'lastMsgBody':_0x5b5ca0[_0x3778('0x12')]});}})[_0x3778('0x21')](function(_0x30c6d1){console['error'](_0x30c6d1);});}_0x4c6b75();}},'charset':_0x3778('0x22'),'collate':_0x3778('0x23')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 629e944..4f036ea 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 _0x229c=['stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x229c,0xcf));var _0xc229=function(_0x3aab88,_0x14c5b1){_0x3aab88=_0x3aab88-0x0;var _0x56009a=_0x229c[_0x3aab88];return _0x56009a;};'use strict';var _=require('lodash');var util=require(_0xc229('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc229('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc229('0x2'));var logger=require('../../config/logger')(_0xc229('0x3'));var config=require(_0xc229('0x4'));var jayson=require(_0xc229('0x5'));var client=jayson['client'][_0xc229('0x6')]({'port':0x232a});config['redis']=_[_0xc229('0x7')](config[_0xc229('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc229('0x9'))(new Redis(config[_0xc229('0x8')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1dc38f,_0x5a5d9b,_0x4abe4c){return new BPromise(function(_0x36263a,_0x1434a3){return client[_0xc229('0xa')](_0x1dc38f,_0x4abe4c)[_0xc229('0xb')](function(_0x25fd05){logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,_0xc229('0xe'));logger[_0xc229('0xf')](_0xc229('0x10'),_0x5a5d9b,_0xc229('0xe'),JSON[_0xc229('0x11')](_0x25fd05));if(_0x25fd05[_0xc229('0x12')]){if(_0x25fd05['error'][_0xc229('0x13')]===0x1f4){logger['error'](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x1434a3(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x36263a(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}else{logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,'request\x20sent');_0x36263a(_0x25fd05[_0xc229('0x15')][_0xc229('0x14')]);}})[_0xc229('0x16')](function(_0x193c75){logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x193c75);_0x1434a3(_0x193c75);});});}exports[_0xc229('0x17')]=function(_0x49c4aa){var _0x599eeb=this;return new Promise(function(_0x395362,_0x53dbba){return db[_0xc229('0x18')][_0xc229('0x19')](_0x49c4aa['body'],{'raw':_0x49c4aa['options']?_0x49c4aa[_0xc229('0x1a')][_0xc229('0x1b')]===undefined?!![]:![]:!![]})[_0xc229('0xb')](function(_0x3b20af){logger[_0xc229('0xc')](_0xc229('0x17'),_0x49c4aa);logger[_0xc229('0xf')]('CreateMailMessage',_0x49c4aa,JSON['stringify'](_0x3b20af));_0x395362(_0x3b20af);})[_0xc229('0x16')](function(_0xe55ddf){logger['error']('CreateMailMessage',_0xe55ddf[_0xc229('0x14')],_0x49c4aa);_0x53dbba(_0x599eeb[_0xc229('0x12')](0x1f4,_0xe55ddf[_0xc229('0x14')]));});});}; \ No newline at end of file +var _0xe7de=['register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','MailMessage','body','options','raw','CreateMailMessage','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket'];(function(_0x8a5c5c,_0x511a93){var _0x59be49=function(_0x1f8805){while(--_0x1f8805){_0x8a5c5c['push'](_0x8a5c5c['shift']());}};_0x59be49(++_0x511a93);}(_0xe7de,0x165));var _0xee7d=function(_0x244283,_0x4d123c){_0x244283=_0x244283-0x0;var _0x582c5e=_0xe7de[_0x244283];return _0x582c5e;};'use strict';var _=require(_0xee7d('0x0'));var util=require(_0xee7d('0x1'));var moment=require(_0xee7d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee7d('0x3'));var db=require(_0xee7d('0x4'))['db'];var utils=require(_0xee7d('0x5'));var logger=require(_0xee7d('0x6'))(_0xee7d('0x7'));var config=require(_0xee7d('0x8'));var jayson=require(_0xee7d('0x9'));var client=jayson[_0xee7d('0xa')][_0xee7d('0xb')]({'port':0x232a});config[_0xee7d('0xc')]=_[_0xee7d('0xd')](config[_0xee7d('0xc')],{'host':_0xee7d('0xe'),'port':0x18eb});var socket=require(_0xee7d('0xf'))(new Redis(config['redis']));require(_0xee7d('0x10'))[_0xee7d('0x11')](socket);function respondWithRpcPromise(_0x44e6ef,_0x474c53,_0x146172){return new BPromise(function(_0x36e00f,_0x598421){return client[_0xee7d('0x12')](_0x44e6ef,_0x146172)['then'](function(_0x1bf8af){logger[_0xee7d('0x13')](_0xee7d('0x14'),_0x474c53,_0xee7d('0x15'));logger[_0xee7d('0x16')](_0xee7d('0x17'),_0x474c53,_0xee7d('0x15'),JSON[_0xee7d('0x18')](_0x1bf8af));if(_0x1bf8af[_0xee7d('0x19')]){if(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1a')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x474c53,_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);return _0x598421(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);}logger[_0xee7d('0x19')](_0xee7d('0x14'),_0x474c53,_0x1bf8af['error'][_0xee7d('0x1b')]);return _0x36e00f(_0x1bf8af[_0xee7d('0x19')][_0xee7d('0x1b')]);}else{logger[_0xee7d('0x13')](_0xee7d('0x14'),_0x474c53,_0xee7d('0x15'));_0x36e00f(_0x1bf8af['result'][_0xee7d('0x1b')]);}})[_0xee7d('0x1c')](function(_0x3facfb){logger['error'](_0xee7d('0x14'),_0x474c53,_0x3facfb);_0x598421(_0x3facfb);});});}exports['CreateMailMessage']=function(_0x1ef8ea){var _0x34209e=this;return new Promise(function(_0x2eb283,_0x4f6445){return db[_0xee7d('0x1d')]['create'](_0x1ef8ea[_0xee7d('0x1e')],{'raw':_0x1ef8ea[_0xee7d('0x1f')]?_0x1ef8ea[_0xee7d('0x1f')][_0xee7d('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x32ad6e){logger[_0xee7d('0x13')](_0xee7d('0x21'),_0x1ef8ea);logger[_0xee7d('0x16')](_0xee7d('0x21'),_0x1ef8ea,JSON[_0xee7d('0x18')](_0x32ad6e));_0x2eb283(_0x32ad6e);})[_0xee7d('0x1c')](function(_0x34af16){logger[_0xee7d('0x19')]('CreateMailMessage',_0x34af16[_0xee7d('0x1b')],_0x1ef8ea);_0x4f6445(_0x34209e[_0xee7d('0x19')](0x1f4,_0x34af16[_0xee7d('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 9260f09..ffac10c 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 _0xee24=['length','mailMessage:','save','remove','emit','removeListener','register'];(function(_0x572f35,_0x61b2f0){var _0x47dea5=function(_0x492f43){while(--_0x492f43){_0x572f35['push'](_0x572f35['shift']());}};_0x47dea5(++_0x61b2f0);}(_0xee24,0x1a6));var _0x4ee2=function(_0x349b5c,_0x55e5fa){_0x349b5c=_0x349b5c-0x0;var _0x3efcac=_0xee24[_0x349b5c];return _0x3efcac;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x4ee2('0x0'),_0x4ee2('0x1'),'update'];function createListener(_0x234b61,_0x4e09d3){return function(_0x3ff71c){_0x4e09d3[_0x4ee2('0x2')](_0x234b61,_0x3ff71c);};}function removeListener(_0x5546e1,_0x1aee89){return function(){MailMessageEvents[_0x4ee2('0x3')](_0x5546e1,_0x1aee89);};}exports[_0x4ee2('0x4')]=function(_0x1993de){for(var _0x5c778f=0x0,_0x2e6e11=events[_0x4ee2('0x5')];_0x5c778f<_0x2e6e11;_0x5c778f++){var _0xe966eb=events[_0x5c778f];var _0x9a963c=createListener(_0x4ee2('0x6')+_0xe966eb,_0x1993de);MailMessageEvents['on'](_0xe966eb,_0x9a963c);}}; \ No newline at end of file +var _0xf7d5=['register','length','mailMessage:','./mailMessage.events','remove','emit'];(function(_0x5423a8,_0x3ef2a5){var _0x3d78b2=function(_0x444c9f){while(--_0x444c9f){_0x5423a8['push'](_0x5423a8['shift']());}};_0x3d78b2(++_0x3ef2a5);}(_0xf7d5,0x16b));var _0x5f7d=function(_0x2f1d70,_0x14763c){_0x2f1d70=_0x2f1d70-0x0;var _0x162fc5=_0xf7d5[_0x2f1d70];return _0x162fc5;};'use strict';var MailMessageEvents=require(_0x5f7d('0x0'));var events=['save',_0x5f7d('0x1'),'update'];function createListener(_0x2f994c,_0x494fcd){return function(_0x173078){_0x494fcd[_0x5f7d('0x2')](_0x2f994c,_0x173078);};}function removeListener(_0x847c7f,_0x43fd6a){return function(){MailMessageEvents['removeListener'](_0x847c7f,_0x43fd6a);};}exports[_0x5f7d('0x3')]=function(_0xeebc28){for(var _0x59bb86=0x0,_0xcb757=events[_0x5f7d('0x4')];_0x59bb86<_0xcb757;_0x59bb86++){var _0x5328c3=events[_0x59bb86];var _0x579f0b=createListener(_0x5f7d('0x5')+_0x5328c3,_0xeebc28);MailMessageEvents['on'](_0x5328c3,_0x579f0b);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index f9b0ec8..652e771 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 _0x56fd=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','put','/:id','update','delete','removeAgents','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members'];(function(_0x15c1d3,_0x3b7172){var _0x2f3e3e=function(_0x9b282c){while(--_0x9b282c){_0x15c1d3['push'](_0x15c1d3['shift']());}};_0x2f3e3e(++_0x3b7172);}(_0x56fd,0x1e8));var _0xd56f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56fd[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd56f('0x0'));var timeout=require(_0xd56f('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xd56f('0x2'));var interaction=require(_0xd56f('0x3'));var config=require('../../config/environment');var controller=require(_0xd56f('0x4'));router[_0xd56f('0x5')]('/',auth['isAuthenticated'](),controller[_0xd56f('0x6')]);router[_0xd56f('0x5')](_0xd56f('0x7'),auth[_0xd56f('0x8')](),controller[_0xd56f('0x9')]);router[_0xd56f('0x5')]('/:id',auth[_0xd56f('0x8')](),controller[_0xd56f('0xa')]);router[_0xd56f('0x5')](_0xd56f('0xb'),auth[_0xd56f('0x8')](),controller[_0xd56f('0xc')]);router[_0xd56f('0x5')](_0xd56f('0xd'),auth[_0xd56f('0x8')](),controller[_0xd56f('0xe')]);router[_0xd56f('0x5')](_0xd56f('0xf'),auth[_0xd56f('0x8')](),controller[_0xd56f('0x10')]);router['post']('/',auth[_0xd56f('0x8')](),controller[_0xd56f('0x11')]);router[_0xd56f('0x12')]('/:id/teams',auth[_0xd56f('0x8')](),controller['addTeams']);router['post'](_0xd56f('0xf'),auth[_0xd56f('0x8')](),controller['addAgents']);router[_0xd56f('0x13')](_0xd56f('0x14'),auth['isAuthenticated'](),controller[_0xd56f('0x15')]);router[_0xd56f('0x16')](_0xd56f('0x14'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xd56f('0xd'),auth[_0xd56f('0x8')](),controller['removeTeams']);router[_0xd56f('0x16')](_0xd56f('0xf'),auth['isAuthenticated'](),controller[_0xd56f('0x17')]);module[_0xd56f('0x18')]=router; \ No newline at end of file +var _0xa0d4=['/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x43ceb0,_0x1c6db0){var _0x58cb5a=function(_0x5c8dc9){while(--_0x5c8dc9){_0x43ceb0['push'](_0x43ceb0['shift']());}};_0x58cb5a(++_0x1c6db0);}(_0xa0d4,0x66));var _0x4a0d=function(_0x4dab10,_0x4b3811){_0x4dab10=_0x4dab10-0x0;var _0x155bca=_0xa0d4[_0x4dab10];return _0x155bca;};'use strict';var multer=require(_0x4a0d('0x0'));var util=require(_0x4a0d('0x1'));var path=require('path');var timeout=require(_0x4a0d('0x2'));var express=require(_0x4a0d('0x3'));var router=express[_0x4a0d('0x4')]();var auth=require(_0x4a0d('0x5'));var interaction=require(_0x4a0d('0x6'));var config=require(_0x4a0d('0x7'));var controller=require('./mailQueue.controller');router[_0x4a0d('0x8')]('/',auth[_0x4a0d('0x9')](),controller['index']);router[_0x4a0d('0x8')](_0x4a0d('0xa'),auth[_0x4a0d('0x9')](),controller[_0x4a0d('0xb')]);router[_0x4a0d('0x8')](_0x4a0d('0xc'),auth[_0x4a0d('0x9')](),controller['show']);router[_0x4a0d('0x8')](_0x4a0d('0xd'),auth[_0x4a0d('0x9')](),controller[_0x4a0d('0xe')]);router[_0x4a0d('0x8')](_0x4a0d('0xf'),auth['isAuthenticated'](),controller[_0x4a0d('0x10')]);router[_0x4a0d('0x8')](_0x4a0d('0x11'),auth[_0x4a0d('0x9')](),controller[_0x4a0d('0x12')]);router[_0x4a0d('0x13')]('/',auth[_0x4a0d('0x9')](),controller[_0x4a0d('0x14')]);router[_0x4a0d('0x13')](_0x4a0d('0xf'),auth[_0x4a0d('0x9')](),controller[_0x4a0d('0x15')]);router['post'](_0x4a0d('0x11'),auth[_0x4a0d('0x9')](),controller[_0x4a0d('0x16')]);router[_0x4a0d('0x17')](_0x4a0d('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4a0d('0x18')](_0x4a0d('0xc'),auth[_0x4a0d('0x9')](),controller[_0x4a0d('0x19')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x4a0d('0x1a')]);router[_0x4a0d('0x18')](_0x4a0d('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x4a0d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 83dade7..a68f4e9 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 _0xd94d=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0xa3ff70,_0x4a8609){var _0x538dbb=function(_0x299b73){while(--_0x299b73){_0xa3ff70['push'](_0xa3ff70['shift']());}};_0x538dbb(++_0x4a8609);}(_0xd94d,0x16f));var _0xdd94=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd94d[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xdd94('0x0')]={'name':{'type':Sequelize[_0xdd94('0x1')],'unique':_0xdd94('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdd94('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdd94('0x4')](_0xdd94('0x5'),_0xdd94('0x6'),_0xdd94('0x7'))}}; \ No newline at end of file +var _0xfe93=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','name','STRING'];(function(_0x4e141a,_0x29b849){var _0x1ce7fa=function(_0xcfdfd7){while(--_0xcfdfd7){_0x4e141a['push'](_0x4e141a['shift']());}};_0x1ce7fa(++_0x29b849);}(_0xfe93,0xf4));var _0x3fe9=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfe93[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x3fe9('0x0'));module[_0x3fe9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3fe9('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3fe9('0x3')]},'timeout':{'type':Sequelize[_0x3fe9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3fe9('0x5')](_0x3fe9('0x6'),_0x3fe9('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d268fc1..571b6e0 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 _0xb381=['order','where','merge','VIRTUAL','filter','options','include','rows','show','params','includeAll','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserMailQueue','hasOwnProperty','sort','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','count','offset','limit','set','json','reject','save','update','then','destroy','MailQueues','UserProfileResource','end','error','stack','name','MailQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x3cdbca,_0x2870ed){var _0x597682=function(_0x60e3a3){while(--_0x60e3a3){_0x3cdbca['push'](_0x3cdbca['shift']());}};_0x597682(++_0x2870ed);}(_0xb381,0x16d));var _0x1b38=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb381[_0x4c12ec];return _0x3ae42c;};'use strict';var pdf=require(_0x1b38('0x0'));var emlformat=require(_0x1b38('0x1'));var rimraf=require(_0x1b38('0x2'));var zipdir=require(_0x1b38('0x3'));var jsonpatch=require(_0x1b38('0x4'));var rp=require(_0x1b38('0x5'));var moment=require(_0x1b38('0x6'));var BPromise=require(_0x1b38('0x7'));var Mustache=require('mustache');var util=require(_0x1b38('0x8'));var path=require(_0x1b38('0x9'));var sox=require('sox');var csv=require(_0x1b38('0xa'));var ejs=require(_0x1b38('0xb'));var fs=require('fs');var _=require(_0x1b38('0xc'));var squel=require(_0x1b38('0xd'));var crypto=require(_0x1b38('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1b38('0xa'));var querystring=require('querystring');var Papa=require(_0x1b38('0xf'));var Redis=require(_0x1b38('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1b38('0x11'));var as=require(_0x1b38('0x12'));var hardwareService=require(_0x1b38('0x13'));var logger=require(_0x1b38('0x14'))(_0x1b38('0x15'));var utils=require('../../config/utils');var config=require(_0x1b38('0x16'));var db=require(_0x1b38('0x17'))['db'];config['redis']=_['defaults'](config[_0x1b38('0x18')],{'host':_0x1b38('0x19'),'port':0x18eb});var socket=require(_0x1b38('0x1a'))(new Redis(config[_0x1b38('0x18')]));require(_0x1b38('0x1b'))[_0x1b38('0x1c')](socket);function respondWithStatusCode(_0x527bc5,_0x4607e8){_0x4607e8=_0x4607e8||0xcc;return function(_0x5c0214){if(_0x5c0214){return _0x527bc5[_0x1b38('0x1d')](_0x4607e8);}return _0x527bc5['status'](_0x4607e8)['end']();};}function respondWithResult(_0xa212cf,_0x23bd81){_0x23bd81=_0x23bd81||0xc8;return function(_0x4be770){if(_0x4be770){return _0xa212cf[_0x1b38('0x1e')](_0x23bd81)['json'](_0x4be770);}};}function respondWithFilteredResult(_0x5720c8,_0x5e7fb4){return function(_0x3c8798){if(_0x3c8798){var _0x510fa8=_0x3c8798[_0x1b38('0x1f')],_0x2c96e9=_0x5e7fb4[_0x1b38('0x20')],_0x52f2ac=_0x5e7fb4[_0x1b38('0x20')]+_0x5e7fb4[_0x1b38('0x21')],_0x514ceb;if(_0x52f2ac>=_0x510fa8){_0x52f2ac=_0x510fa8;_0x514ceb=0xc8;}else{_0x514ceb=0xce;}_0x5720c8[_0x1b38('0x1e')](_0x514ceb);return _0x5720c8[_0x1b38('0x22')]('Content-Range',_0x2c96e9+'-'+_0x52f2ac+'/'+_0x510fa8)[_0x1b38('0x23')](_0x3c8798);}return null;};}function patchUpdates(_0x35648a){return function(_0x466156){try{jsonpatch['apply'](_0x466156,_0x35648a,!![]);}catch(_0x12975f){return BPromise[_0x1b38('0x24')](_0x12975f);}return _0x466156[_0x1b38('0x25')]();};}function saveUpdates(_0x4f8d92,_0x416d5f){return function(_0x361a76){if(_0x361a76){return _0x361a76[_0x1b38('0x26')](_0x4f8d92)[_0x1b38('0x27')](function(_0x1e144d){return _0x1e144d;});}return null;};}function removeEntity(_0x219c9c,_0xc60acf){return function(_0x42a3b1){if(_0x42a3b1){return _0x42a3b1[_0x1b38('0x28')]()[_0x1b38('0x27')](function(){var _0x4a7476=_0x42a3b1['get']({'plain':!![]});var _0x568ea7=_0x1b38('0x29');return db[_0x1b38('0x2a')][_0x1b38('0x28')]({'where':{'type':_0x568ea7,'resourceId':_0x4a7476['id']}})[_0x1b38('0x27')](function(){return _0x42a3b1;});})[_0x1b38('0x27')](function(){_0x219c9c['status'](0xcc)[_0x1b38('0x2b')]();});}};}function handleEntityNotFound(_0x4488d5,_0x4edf2d){return function(_0x43d105){if(!_0x43d105){_0x4488d5[_0x1b38('0x1d')](0x194);}return _0x43d105;};}function handleError(_0x397265,_0x5925e9){_0x5925e9=_0x5925e9||0x1f4;return function(_0x24da8b){logger[_0x1b38('0x2c')](_0x24da8b[_0x1b38('0x2d')]);if(_0x24da8b[_0x1b38('0x2e')]){delete _0x24da8b[_0x1b38('0x2e')];}_0x397265[_0x1b38('0x1e')](_0x5925e9)['send'](_0x24da8b);};}exports['index']=function(_0x45ace3,_0x1418d8){var _0x387ad4={},_0x582899={},_0x1fb05c={'count':0x0,'rows':[]};var _0x398963=_['map'](db[_0x1b38('0x2f')][_0x1b38('0x30')],function(_0x3931e2){return{'name':_0x3931e2['fieldName'],'type':_0x3931e2[_0x1b38('0x31')][_0x1b38('0x32')]};});_0x582899[_0x1b38('0x33')]=_[_0x1b38('0x34')](_0x398963,_0x1b38('0x2e'));_0x582899[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x45ace3[_0x1b38('0x35')]);_0x582899[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x582899['model'],_0x582899['query']);_0x387ad4[_0x1b38('0x39')]=_[_0x1b38('0x38')](_0x582899[_0x1b38('0x33')],qs[_0x1b38('0x3a')](_0x45ace3[_0x1b38('0x35')][_0x1b38('0x3a')]));_0x387ad4['attributes']=_0x387ad4[_0x1b38('0x39')][_0x1b38('0x3b')]?_0x387ad4[_0x1b38('0x39')]:_0x582899[_0x1b38('0x33')];if(!_0x45ace3['query']['hasOwnProperty'](_0x1b38('0x3c'))){_0x387ad4[_0x1b38('0x21')]=qs['limit'](_0x45ace3[_0x1b38('0x35')]['limit']);_0x387ad4[_0x1b38('0x20')]=qs[_0x1b38('0x20')](_0x45ace3[_0x1b38('0x35')][_0x1b38('0x20')]);}_0x387ad4[_0x1b38('0x3d')]=qs['sort'](_0x45ace3[_0x1b38('0x35')]['sort']);_0x387ad4[_0x1b38('0x3e')]=qs['filters'](_['pick'](_0x45ace3[_0x1b38('0x35')],_0x582899[_0x1b38('0x37')]));if(_0x45ace3[_0x1b38('0x35')]['filter']){_0x387ad4[_0x1b38('0x3e')]=_[_0x1b38('0x3f')](_0x387ad4[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x398963,function(_0x3104ee){if(_0x3104ee[_0x1b38('0x31')]!==_0x1b38('0x40')){var _0x4aa0fa={};_0x4aa0fa[_0x3104ee['name']]={'$like':'%'+_0x45ace3[_0x1b38('0x35')][_0x1b38('0x41')]+'%'};return _0x4aa0fa;}})});}_0x387ad4=_[_0x1b38('0x3f')]({},_0x387ad4,_0x45ace3[_0x1b38('0x42')]);var _0x598970={'where':_0x387ad4[_0x1b38('0x3e')]};return db['MailQueue'][_0x1b38('0x1f')](_0x598970)['then'](function(_0x3bc3aa){_0x1fb05c['count']=_0x3bc3aa;if(_0x45ace3[_0x1b38('0x35')]['includeAll']){_0x387ad4[_0x1b38('0x43')]=[{'all':!![]}];}return db[_0x1b38('0x2f')]['findAll'](_0x387ad4);})['then'](function(_0x39d5f9){_0x1fb05c[_0x1b38('0x44')]=_0x39d5f9;return _0x1fb05c;})['then'](respondWithFilteredResult(_0x1418d8,_0x387ad4))['catch'](handleError(_0x1418d8,null));};exports[_0x1b38('0x45')]=function(_0x30eec2,_0x1c0f77){var _0x3e0970={'raw':!![],'where':{'id':_0x30eec2[_0x1b38('0x46')]['id']}},_0x456e37={};_0x456e37[_0x1b38('0x33')]=_[_0x1b38('0x36')](db[_0x1b38('0x2f')][_0x1b38('0x30')]);_0x456e37[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x30eec2[_0x1b38('0x35')]);_0x456e37['filters']=_[_0x1b38('0x38')](_0x456e37[_0x1b38('0x33')],_0x456e37['query']);_0x3e0970[_0x1b38('0x39')]=_[_0x1b38('0x38')](_0x456e37['model'],qs[_0x1b38('0x3a')](_0x30eec2['query'][_0x1b38('0x3a')]));_0x3e0970[_0x1b38('0x39')]=_0x3e0970[_0x1b38('0x39')][_0x1b38('0x3b')]?_0x3e0970['attributes']:_0x456e37[_0x1b38('0x33')];if(_0x30eec2[_0x1b38('0x35')][_0x1b38('0x47')]){_0x3e0970[_0x1b38('0x43')]=[{'all':!![]}];}_0x3e0970=_[_0x1b38('0x3f')]({},_0x3e0970,_0x30eec2['options']);return db[_0x1b38('0x2f')][_0x1b38('0x48')](_0x3e0970)['then'](handleEntityNotFound(_0x1c0f77,null))[_0x1b38('0x27')](respondWithResult(_0x1c0f77,null))[_0x1b38('0x49')](handleError(_0x1c0f77,null));};exports[_0x1b38('0x4a')]=function(_0x4833e8,_0x217119){return db[_0x1b38('0x2f')][_0x1b38('0x4a')](_0x4833e8['body'],{})[_0x1b38('0x27')](function(_0x28319c){var _0x24e2da=_0x4833e8['user'][_0x1b38('0x4b')]({'plain':!![]});if(!_0x24e2da)throw new Error(_0x1b38('0x4c'));if(_0x24e2da[_0x1b38('0x4d')]===_0x1b38('0x4e')){var _0x2c47a7=_0x28319c[_0x1b38('0x4b')]({'plain':!![]});var _0x223647='MailQueues';return db[_0x1b38('0x4f')][_0x1b38('0x48')]({'where':{'name':_0x223647,'userProfileId':_0x24e2da[_0x1b38('0x50')]},'raw':!![]})['then'](function(_0x2b29ab){if(_0x2b29ab&&_0x2b29ab['autoAssociation']===0x0){return db[_0x1b38('0x2a')][_0x1b38('0x4a')]({'name':_0x2c47a7[_0x1b38('0x2e')],'resourceId':_0x2c47a7['id'],'type':_0x2b29ab[_0x1b38('0x2e')],'sectionId':_0x2b29ab['id']},{})['then'](function(){return _0x28319c;});}else{return _0x28319c;}})[_0x1b38('0x49')](function(_0x366895){logger[_0x1b38('0x2c')](_0x1b38('0x51'),_0x366895);throw _0x366895;});}return _0x28319c;})[_0x1b38('0x27')](respondWithResult(_0x217119,0xc9))[_0x1b38('0x49')](handleError(_0x217119,null));};exports[_0x1b38('0x26')]=function(_0x179739,_0x367ea0){if(_0x179739[_0x1b38('0x52')]['id']){delete _0x179739[_0x1b38('0x52')]['id'];}return db['MailQueue'][_0x1b38('0x48')]({'where':{'id':_0x179739[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x367ea0,null))[_0x1b38('0x27')](saveUpdates(_0x179739['body'],null))['then'](respondWithResult(_0x367ea0,null))[_0x1b38('0x49')](handleError(_0x367ea0,null));};exports[_0x1b38('0x28')]=function(_0x2732b2,_0x446d2f){return db[_0x1b38('0x2f')]['find']({'where':{'id':_0x2732b2['params']['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x446d2f,null))[_0x1b38('0x27')](removeEntity(_0x446d2f,null))['catch'](handleError(_0x446d2f,null));};exports['describe']=function(_0x325215,_0x3d66c3){return db['MailQueue'][_0x1b38('0x53')]()[_0x1b38('0x27')](respondWithResult(_0x3d66c3,null))[_0x1b38('0x49')](handleError(_0x3d66c3,null));};exports['getMembers']=function(_0x2d15af,_0x1e53d4,_0x425620){var _0x1b7e2c={'raw':!![],'where':{}},_0x50dd6c={},_0x57609a;return db[_0x1b38('0x2f')][_0x1b38('0x54')]({'where':{'id':_0x2d15af[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x1e53d4,null))['then'](function(_0x5e8320){if(_0x5e8320){_0x57609a=_0x5e8320['get']({'plain':!![]});_0x50dd6c[_0x1b38('0x33')]=_[_0x1b38('0x36')](db[_0x1b38('0x55')][_0x1b38('0x30')]);_0x50dd6c[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x2d15af[_0x1b38('0x35')]);_0x50dd6c[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x50dd6c[_0x1b38('0x33')],_0x50dd6c['query']);_0x1b7e2c[_0x1b38('0x39')]=_[_0x1b38('0x38')](_0x50dd6c[_0x1b38('0x33')],qs[_0x1b38('0x3a')](_0x2d15af[_0x1b38('0x35')][_0x1b38('0x3a')]));_0x1b7e2c[_0x1b38('0x39')]=_0x1b7e2c[_0x1b38('0x39')]['length']?_0x1b7e2c[_0x1b38('0x39')]:_0x50dd6c['model'];if(!_0x2d15af[_0x1b38('0x35')][_0x1b38('0x56')]('nolimit')){_0x1b7e2c['limit']=qs[_0x1b38('0x21')](_0x2d15af['query']['limit']);_0x1b7e2c[_0x1b38('0x20')]=qs[_0x1b38('0x20')](_0x2d15af[_0x1b38('0x35')][_0x1b38('0x20')]);}_0x1b7e2c[_0x1b38('0x3d')]=qs[_0x1b38('0x57')](_0x2d15af[_0x1b38('0x35')]['sort']);_0x1b7e2c[_0x1b38('0x3e')]=qs[_0x1b38('0x37')](_[_0x1b38('0x58')](_0x2d15af['query'],_0x50dd6c[_0x1b38('0x37')]));_0x1b7e2c[_0x1b38('0x3e')][_0x1b38('0x59')]=_0x5e8320['id'];if(_0x2d15af[_0x1b38('0x35')]['filter']){_0x1b7e2c[_0x1b38('0x3e')]=_['merge'](_0x1b7e2c[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x1b7e2c[_0x1b38('0x39')],function(_0x3e71c7){var _0x11f766={};_0x11f766[_0x3e71c7]={'$like':'%'+_0x2d15af[_0x1b38('0x35')]['filter']+'%'};return _0x11f766;})});}_0x1b7e2c=_[_0x1b38('0x3f')]({},_0x1b7e2c,_0x2d15af[_0x1b38('0x42')]);return db[_0x1b38('0x55')][_0x1b38('0x5a')](_0x1b7e2c);}})['then'](function(_0x174752){if(_0x174752){return db[_0x1b38('0x5b')][_0x1b38('0x5c')]({'where':{'id':_['map'](_0x174752,_0x1b38('0x5d')),'role':_0x1b38('0x5e')},'attributes':['id',_0x1b38('0x2e'),_0x1b38('0x5f'),_0x1b38('0x60'),_0x1b38('0x61')]});}})['then'](function(_0x56e803){if(_0x56e803){return{'count':_0x56e803[_0x1b38('0x1f')],'rows':_[_0x1b38('0x34')](_0x56e803['rows'],function(_0x48a2e8){return{'membername':_0x48a2e8[_0x1b38('0x2e')],'UserId':_0x48a2e8['id'],'queue_name':_0x57609a[_0x1b38('0x2e')],'MailQueueId':_0x57609a['id'],'interface':util[_0x1b38('0x62')](_0x1b38('0x63'),'SIP',_0x48a2e8[_0x1b38('0x2e')]),'penalty':0x0,'paused':_0x48a2e8[_0x1b38('0x5f')],'createdAt':_0x48a2e8[_0x1b38('0x61')],'updatedAt':_0x48a2e8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1e53d4,_0x1b7e2c))['catch'](handleError(_0x1e53d4,null));};exports[_0x1b38('0x64')]=function(_0x2202d9,_0x44e762,_0x4a7488){var _0x1ea234={};var _0x342b11={};var _0x19bbc5;var _0x15f2e3;return db['MailQueue'][_0x1b38('0x54')]({'where':{'id':_0x2202d9['params']['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x44e762,null))[_0x1b38('0x27')](function(_0x2bc2fa){if(_0x2bc2fa){_0x19bbc5=_0x2bc2fa;_0x342b11[_0x1b38('0x33')]=_['keys'](db[_0x1b38('0x65')][_0x1b38('0x30')]);_0x342b11[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x2202d9['query']);_0x342b11[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x342b11['model'],_0x342b11[_0x1b38('0x35')]);_0x1ea234[_0x1b38('0x39')]=_['intersection'](_0x342b11[_0x1b38('0x33')],qs[_0x1b38('0x3a')](_0x2202d9['query'][_0x1b38('0x3a')]));_0x1ea234[_0x1b38('0x39')]=_0x1ea234['attributes'][_0x1b38('0x3b')]?_0x1ea234[_0x1b38('0x39')]:_0x342b11[_0x1b38('0x33')];_0x1ea234[_0x1b38('0x3d')]=qs[_0x1b38('0x57')](_0x2202d9[_0x1b38('0x35')][_0x1b38('0x57')]);_0x1ea234[_0x1b38('0x3e')]=qs[_0x1b38('0x37')](_['pick'](_0x2202d9['query'],_0x342b11[_0x1b38('0x37')]));if(_0x2202d9[_0x1b38('0x35')]['filter']){_0x1ea234[_0x1b38('0x3e')]=_[_0x1b38('0x3f')](_0x1ea234[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x1ea234['attributes'],function(_0x9e7953){var _0x546d33={};_0x546d33[_0x9e7953]={'$like':'%'+_0x2202d9[_0x1b38('0x35')][_0x1b38('0x41')]+'%'};return _0x546d33;})});}_0x1ea234=_[_0x1b38('0x3f')]({},_0x1ea234,_0x2202d9[_0x1b38('0x42')]);return _0x19bbc5[_0x1b38('0x64')](_0x1ea234);}})['then'](function(_0x564944){if(_0x564944){_0x15f2e3=_0x564944[_0x1b38('0x3b')];if(!_0x2202d9[_0x1b38('0x35')][_0x1b38('0x56')](_0x1b38('0x3c'))){_0x1ea234[_0x1b38('0x21')]=qs['limit'](_0x2202d9[_0x1b38('0x35')][_0x1b38('0x21')]);_0x1ea234[_0x1b38('0x20')]=qs[_0x1b38('0x20')](_0x2202d9[_0x1b38('0x35')][_0x1b38('0x20')]);}return _0x19bbc5[_0x1b38('0x64')](_0x1ea234);}})[_0x1b38('0x27')](function(_0x2970ae){if(_0x2970ae){return _0x2970ae?{'count':_0x15f2e3,'rows':_0x2970ae}:null;}})[_0x1b38('0x27')](respondWithResult(_0x44e762,null))[_0x1b38('0x49')](handleError(_0x44e762,null));};exports[_0x1b38('0x66')]=function(_0x37d9ea,_0x1bf526,_0x2469d9){var _0x19559d=_0x37d9ea[_0x1b38('0x52')]['ids'];return db['Team'][_0x1b38('0x5a')]({'where':{'id':_0x19559d},'attributes':['id'],'include':[{'model':db[_0x1b38('0x5b')],'as':_0x1b38('0x67'),'attributes':['id','name',_0x1b38('0x68'),_0x1b38('0x69'),'interface'],'raw':!![]}]})[_0x1b38('0x27')](function(_0xa54752){if(_0xa54752){var _0x1be54b=_['flatMap'](_0xa54752,function(_0x16e769){var _0x42d8ab=_0x16e769[_0x1b38('0x4b')]({'plain':!![]});return _0x42d8ab[_0x1b38('0x67')];});return db[_0x1b38('0x2f')][_0x1b38('0x48')]({'where':{'id':_0x37d9ea[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](function(_0x798cb5){return db[_0x1b38('0x6a')][_0x1b38('0x6b')](function(_0x48c3a5){return _0x798cb5[_0x1b38('0x66')](_0x19559d,{'transaction':_0x48c3a5})[_0x1b38('0x27')](function(){return BPromise[_0x1b38('0x6c')](_0x1be54b,function(_0x1faa7f){return db['UserMailQueue'][_0x1b38('0x6d')]({'where':{'UserId':_0x1faa7f['id'],'MailQueueId':_0x37d9ea[_0x1b38('0x46')]['id']},'transaction':_0x48c3a5});});})[_0x1b38('0x27')](function(){_0x1be54b['forEach'](function(_0x2bd0f2){socket[_0x1b38('0x6e')](_0x1b38('0x6f'),{'UserId':_0x2bd0f2['id'],'MailQueueId':_0x798cb5['id']});});});});});}})['then'](respondWithStatusCode(_0x1bf526,null))[_0x1b38('0x49')](handleError(_0x1bf526,null));};exports[_0x1b38('0x70')]=function(_0x236b12,_0x2dbd93,_0x265ccf){return db[_0x1b38('0x65')][_0x1b38('0x5a')]({'where':{'id':_0x236b12[_0x1b38('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1b38('0x5b')],'as':_0x1b38('0x67'),'attributes':['id'],'raw':!![]}]})[_0x1b38('0x27')](handleEntityNotFound(_0x2dbd93,null))[_0x1b38('0x27')](function(_0x5bc88b){var _0x4ba077=_[_0x1b38('0x34')](_0x5bc88b,'id');var _0x98e435=[];var _0x336a67=[];var _0x17b36c=squel[_0x1b38('0x71')]();_0x17b36c[_0x1b38('0x72')](_0x1b38('0x73'))[_0x1b38('0x74')](_0x1b38('0x75'),'tq')[_0x1b38('0x76')](_0x1b38('0x77'),'ut',_0x1b38('0x78'))[_0x1b38('0x3e')]('MailQueueId\x20=\x20?',_0x236b12[_0x1b38('0x46')]['id']);for(var _0x49001a=0x0;_0x49001a<_0x5bc88b[_0x1b38('0x3b')];_0x49001a+=0x1){let _0x4a3cf4=_0x5bc88b[_0x49001a];for(var _0x428735=0x0;_0x428735<_0x4a3cf4[_0x1b38('0x67')][_0x1b38('0x3b')];_0x428735+=0x1){let _0x521765=_0x4a3cf4[_0x1b38('0x67')][_0x428735];var _0x2c5e5d=_0x17b36c[_0x1b38('0x79')]();_0x2c5e5d[_0x1b38('0x3e')](_0x1b38('0x7a'),_0x521765['id']);_0x336a67[_0x1b38('0x7b')](db[_0x1b38('0x6a')][_0x1b38('0x35')](_0x2c5e5d[_0x1b38('0x7c')](),{'type':db['sequelize'][_0x1b38('0x7d')][_0x1b38('0x7e')]})[_0x1b38('0x27')](function(_0x3c3793){if(_0x3c3793[_0x1b38('0x3b')]===0x1){return _0x521765['id'];}else{var _0x1bd150=_[_0x1b38('0x7f')](_[_0x1b38('0x34')](_0x3c3793,'TeamId'),function(_0x25ff5f){return _[_0x1b38('0x80')](_0x4ba077,_0x25ff5f);});if(_0x1bd150){return _0x521765['id'];}}}));}}return BPromise[_0x1b38('0x81')](_0x336a67)['then'](function(_0x379fe3){_0x98e435=_(_0x98e435)[_0x1b38('0x82')](_0x379fe3)[_0x1b38('0x83')]()[_0x1b38('0x84')]();return db[_0x1b38('0x2f')][_0x1b38('0x48')]({'where':{'id':_0x236b12['params']['id']}})[_0x1b38('0x27')](function(_0x342303){return db[_0x1b38('0x6a')][_0x1b38('0x6b')](function(_0x3ab72f){return _0x342303[_0x1b38('0x70')](_0x236b12[_0x1b38('0x35')][_0x1b38('0x85')],{'transaction':_0x3ab72f})[_0x1b38('0x27')](function(){if(!_[_0x1b38('0x86')](_0x98e435)){return _0x342303[_0x1b38('0x87')](_0x98e435,{'transaction':_0x3ab72f});}})['then'](function(){_0x98e435['forEach'](function(_0x43bc57){socket[_0x1b38('0x6e')](_0x1b38('0x88'),{'UserId':_0x43bc57,'MailQueueId':_0x342303['id']});});});});});});})[_0x1b38('0x27')](respondWithStatusCode(_0x2dbd93,null))[_0x1b38('0x49')](handleError(_0x2dbd93,null));};exports[_0x1b38('0x89')]=function(_0x1dd544,_0x155f56,_0xe825c9){return db[_0x1b38('0x2f')][_0x1b38('0x48')]({'where':{'id':_0x1dd544[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x155f56,null))['then'](function(_0xc4147c){if(_0xc4147c){return _0xc4147c[_0x1b38('0x89')](_0x1dd544[_0x1b38('0x52')]['ids'],_[_0x1b38('0x8a')](_0x1dd544[_0x1b38('0x52')],[_0x1b38('0x85'),'id'])||{})[_0x1b38('0x8b')](function(_0x5051a2){for(var _0x40638f=0x0;_0x40638f<_0x1dd544[_0x1b38('0x52')][_0x1b38('0x85')][_0x1b38('0x3b')];_0x40638f+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x1dd544[_0x1b38('0x52')][_0x1b38('0x85')][_0x40638f],'MailQueueId':_0x1dd544['params']['id']});}return _0x5051a2;});}})[_0x1b38('0x27')](respondWithResult(_0x155f56,null))['catch'](handleError(_0x155f56,null));};exports[_0x1b38('0x87')]=function(_0x154380,_0x338f12,_0x29df19){return db['MailQueue'][_0x1b38('0x48')]({'where':{'id':_0x154380[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x338f12,null))[_0x1b38('0x27')](function(_0x58d5ea){if(_0x58d5ea){return _0x58d5ea[_0x1b38('0x87')](_0x154380['query'][_0x1b38('0x85')])['then'](function(){if(_[_0x1b38('0x8c')](_0x154380[_0x1b38('0x35')][_0x1b38('0x85')])){for(var _0x5c4c9c=0x0;_0x5c4c9c<_0x154380[_0x1b38('0x35')][_0x1b38('0x85')][_0x1b38('0x3b')];_0x5c4c9c+=0x1){socket[_0x1b38('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x154380[_0x1b38('0x35')][_0x1b38('0x85')][_0x5c4c9c]),'MailQueueId':Number(_0x154380[_0x1b38('0x46')]['id'])});}}else{socket[_0x1b38('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x154380['query']['ids']),'MailQueueId':Number(_0x154380['params']['id'])});}});}})['then'](respondWithStatusCode(_0x338f12,null))[_0x1b38('0x49')](handleError(_0x338f12,null));};exports[_0x1b38('0x8d')]=function(_0x5bf47a,_0x35548a,_0x513bc2){var _0x3f5e62={};var _0x24ec09={};var _0x25392c;var _0x94bc38;return db['MailQueue'][_0x1b38('0x54')]({'where':{'id':_0x5bf47a[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x35548a,null))['then'](function(_0xc8a2a8){if(_0xc8a2a8){_0x25392c=_0xc8a2a8;_0x24ec09[_0x1b38('0x33')]=_[_0x1b38('0x36')](db[_0x1b38('0x5b')][_0x1b38('0x30')]);_0x24ec09['query']=_[_0x1b38('0x36')](_0x5bf47a[_0x1b38('0x35')]);_0x24ec09[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x24ec09[_0x1b38('0x33')],_0x24ec09['query']);_0x3f5e62['attributes']=_[_0x1b38('0x38')](_0x24ec09['model'],qs[_0x1b38('0x3a')](_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x3a')]));_0x3f5e62[_0x1b38('0x39')]=_0x3f5e62['attributes']['length']?_0x3f5e62[_0x1b38('0x39')]:_0x24ec09[_0x1b38('0x33')];_0x3f5e62[_0x1b38('0x3d')]=qs['sort'](_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x57')]);_0x3f5e62['where']=qs[_0x1b38('0x37')](_[_0x1b38('0x58')](_0x5bf47a[_0x1b38('0x35')],_0x24ec09['filters']));if(_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x41')]){_0x3f5e62[_0x1b38('0x3e')]=_[_0x1b38('0x3f')](_0x3f5e62[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x3f5e62[_0x1b38('0x39')],function(_0x3b950c){var _0x356595={};_0x356595[_0x3b950c]={'$like':'%'+_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x41')]+'%'};return _0x356595;})});}_0x3f5e62=_['merge']({},_0x3f5e62,_0x5bf47a[_0x1b38('0x42')]);return _0x25392c['getAgents'](_0x3f5e62);}})[_0x1b38('0x27')](function(_0x583d81){if(_0x583d81){_0x94bc38=_0x583d81[_0x1b38('0x3b')];if(!_0x5bf47a['query']['hasOwnProperty']('nolimit')){_0x3f5e62[_0x1b38('0x21')]=qs[_0x1b38('0x21')](_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x21')]);_0x3f5e62['offset']=qs['offset'](_0x5bf47a['query'][_0x1b38('0x20')]);}return _0x25392c[_0x1b38('0x8d')](_0x3f5e62);}})[_0x1b38('0x27')](function(_0x5a7264){if(_0x5a7264){return _0x5a7264?{'count':_0x94bc38,'rows':_0x5a7264}:null;}})['then'](respondWithResult(_0x35548a,null))[_0x1b38('0x49')](handleError(_0x35548a,null));}; \ No newline at end of file +var _0x27ba=['UserId','agent','mailPause','format','%s/%s','createdAt','updatedAt','getTeams','findOne','Team','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','findOrCreate','emit','userMailQueue:save','removeTeams','ids','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','value','isEmpty','forEach','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','json','offset','limit','set','apply','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filters','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','params','keys','length','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','order','MailQueueId','User','findAndCountAll'];(function(_0x1b5f07,_0x594963){var _0x522f58=function(_0x4d0b1c){while(--_0x4d0b1c){_0x1b5f07['push'](_0x1b5f07['shift']());}};_0x522f58(++_0x594963);}(_0x27ba,0xbb));var _0xa27b=function(_0x3d844b,_0x92a7f7){_0x3d844b=_0x3d844b-0x0;var _0x2cc3c8=_0x27ba[_0x3d844b];return _0x2cc3c8;};'use strict';var pdf=require(_0xa27b('0x0'));var emlformat=require(_0xa27b('0x1'));var rimraf=require(_0xa27b('0x2'));var zipdir=require(_0xa27b('0x3'));var jsonpatch=require(_0xa27b('0x4'));var rp=require('request-promise');var moment=require(_0xa27b('0x5'));var BPromise=require(_0xa27b('0x6'));var Mustache=require(_0xa27b('0x7'));var util=require(_0xa27b('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa27b('0x9'));var ejs=require(_0xa27b('0xa'));var fs=require('fs');var _=require(_0xa27b('0xb'));var squel=require(_0xa27b('0xc'));var crypto=require('crypto');var jsforce=require(_0xa27b('0xd'));var deskjs=require(_0xa27b('0xe'));var toCsv=require(_0xa27b('0x9'));var querystring=require(_0xa27b('0xf'));var Papa=require(_0xa27b('0x10'));var Redis=require(_0xa27b('0x11'));var authService=require(_0xa27b('0x12'));var qs=require(_0xa27b('0x13'));var as=require(_0xa27b('0x14'));var hardwareService=require(_0xa27b('0x15'));var logger=require(_0xa27b('0x16'))('api');var utils=require(_0xa27b('0x17'));var config=require(_0xa27b('0x18'));var db=require(_0xa27b('0x19'))['db'];config[_0xa27b('0x1a')]=_[_0xa27b('0x1b')](config[_0xa27b('0x1a')],{'host':_0xa27b('0x1c'),'port':0x18eb});var socket=require(_0xa27b('0x1d'))(new Redis(config[_0xa27b('0x1a')]));require(_0xa27b('0x1e'))['register'](socket);function respondWithStatusCode(_0x112745,_0x1a5702){_0x1a5702=_0x1a5702||0xcc;return function(_0x49efdc){if(_0x49efdc){return _0x112745['sendStatus'](_0x1a5702);}return _0x112745[_0xa27b('0x1f')](_0x1a5702)['end']();};}function respondWithResult(_0x3b2391,_0x1fdf02){_0x1fdf02=_0x1fdf02||0xc8;return function(_0x3793de){if(_0x3793de){return _0x3b2391[_0xa27b('0x1f')](_0x1fdf02)[_0xa27b('0x20')](_0x3793de);}};}function respondWithFilteredResult(_0x597b8c,_0x2bdb95){return function(_0x4c3d64){if(_0x4c3d64){var _0x5f20bd=_0x4c3d64['count'],_0x44acf9=_0x2bdb95['offset'],_0x483c59=_0x2bdb95[_0xa27b('0x21')]+_0x2bdb95[_0xa27b('0x22')],_0x5d49cd;if(_0x483c59>=_0x5f20bd){_0x483c59=_0x5f20bd;_0x5d49cd=0xc8;}else{_0x5d49cd=0xce;}_0x597b8c[_0xa27b('0x1f')](_0x5d49cd);return _0x597b8c[_0xa27b('0x23')]('Content-Range',_0x44acf9+'-'+_0x483c59+'/'+_0x5f20bd)[_0xa27b('0x20')](_0x4c3d64);}return null;};}function patchUpdates(_0x5a6369){return function(_0x29de19){try{jsonpatch[_0xa27b('0x24')](_0x29de19,_0x5a6369,!![]);}catch(_0x582c6f){return BPromise['reject'](_0x582c6f);}return _0x29de19[_0xa27b('0x25')]();};}function saveUpdates(_0x38459a,_0x438cf1){return function(_0x13ce13){if(_0x13ce13){return _0x13ce13[_0xa27b('0x26')](_0x38459a)[_0xa27b('0x27')](function(_0x25fa5f){return _0x25fa5f;});}return null;};}function removeEntity(_0x335e33,_0xc8ff7f){return function(_0xe90026){if(_0xe90026){return _0xe90026[_0xa27b('0x28')]()[_0xa27b('0x27')](function(){var _0x2d8f18=_0xe90026[_0xa27b('0x29')]({'plain':!![]});var _0x48908b='MailQueues';return db[_0xa27b('0x2a')][_0xa27b('0x28')]({'where':{'type':_0x48908b,'resourceId':_0x2d8f18['id']}})[_0xa27b('0x27')](function(){return _0xe90026;});})[_0xa27b('0x27')](function(){_0x335e33[_0xa27b('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d7389,_0x25fc4a){return function(_0x1ee533){if(!_0x1ee533){_0x2d7389[_0xa27b('0x2b')](0x194);}return _0x1ee533;};}function handleError(_0x58d691,_0x41b7ee){_0x41b7ee=_0x41b7ee||0x1f4;return function(_0x1e3ca0){logger[_0xa27b('0x2c')](_0x1e3ca0[_0xa27b('0x2d')]);if(_0x1e3ca0[_0xa27b('0x2e')]){delete _0x1e3ca0['name'];}_0x58d691[_0xa27b('0x1f')](_0x41b7ee)[_0xa27b('0x2f')](_0x1e3ca0);};}exports[_0xa27b('0x30')]=function(_0x37e8c3,_0x25e061){var _0x3ca0f8={},_0xec54a8={},_0x39bf21={'count':0x0,'rows':[]};var _0x3f7fb1=_[_0xa27b('0x31')](db[_0xa27b('0x32')][_0xa27b('0x33')],function(_0x45746b){return{'name':_0x45746b[_0xa27b('0x34')],'type':_0x45746b[_0xa27b('0x35')]['key']};});_0xec54a8[_0xa27b('0x36')]=_[_0xa27b('0x31')](_0x3f7fb1,'name');_0xec54a8[_0xa27b('0x37')]=_['keys'](_0x37e8c3['query']);_0xec54a8['filters']=_[_0xa27b('0x38')](_0xec54a8[_0xa27b('0x36')],_0xec54a8[_0xa27b('0x37')]);_0x3ca0f8['attributes']=_[_0xa27b('0x38')](_0xec54a8[_0xa27b('0x36')],qs[_0xa27b('0x39')](_0x37e8c3['query'][_0xa27b('0x39')]));_0x3ca0f8[_0xa27b('0x3a')]=_0x3ca0f8[_0xa27b('0x3a')]['length']?_0x3ca0f8[_0xa27b('0x3a')]:_0xec54a8[_0xa27b('0x36')];if(!_0x37e8c3[_0xa27b('0x37')][_0xa27b('0x3b')](_0xa27b('0x3c'))){_0x3ca0f8[_0xa27b('0x22')]=qs[_0xa27b('0x22')](_0x37e8c3[_0xa27b('0x37')][_0xa27b('0x22')]);_0x3ca0f8[_0xa27b('0x21')]=qs[_0xa27b('0x21')](_0x37e8c3['query']['offset']);}_0x3ca0f8['order']=qs[_0xa27b('0x3d')](_0x37e8c3['query'][_0xa27b('0x3d')]);_0x3ca0f8[_0xa27b('0x3e')]=qs['filters'](_[_0xa27b('0x3f')](_0x37e8c3[_0xa27b('0x37')],_0xec54a8[_0xa27b('0x40')]));if(_0x37e8c3[_0xa27b('0x37')][_0xa27b('0x41')]){_0x3ca0f8['where']=_['merge'](_0x3ca0f8[_0xa27b('0x3e')],{'$or':_['map'](_0x3f7fb1,function(_0x76fe81){if(_0x76fe81[_0xa27b('0x35')]!==_0xa27b('0x42')){var _0x396790={};_0x396790[_0x76fe81['name']]={'$like':'%'+_0x37e8c3[_0xa27b('0x37')][_0xa27b('0x41')]+'%'};return _0x396790;}})});}_0x3ca0f8=_[_0xa27b('0x43')]({},_0x3ca0f8,_0x37e8c3[_0xa27b('0x44')]);var _0x13228f={'where':_0x3ca0f8[_0xa27b('0x3e')]};return db[_0xa27b('0x32')]['count'](_0x13228f)['then'](function(_0x4842d7){_0x39bf21[_0xa27b('0x45')]=_0x4842d7;if(_0x37e8c3[_0xa27b('0x37')][_0xa27b('0x46')]){_0x3ca0f8['include']=[{'all':!![]}];}return db[_0xa27b('0x32')][_0xa27b('0x47')](_0x3ca0f8);})['then'](function(_0x3850a0){_0x39bf21[_0xa27b('0x48')]=_0x3850a0;return _0x39bf21;})[_0xa27b('0x27')](respondWithFilteredResult(_0x25e061,_0x3ca0f8))[_0xa27b('0x49')](handleError(_0x25e061,null));};exports[_0xa27b('0x4a')]=function(_0x238d11,_0x3d28bc){var _0x44ddb0={'raw':!![],'where':{'id':_0x238d11[_0xa27b('0x4b')]['id']}},_0x43540b={};_0x43540b[_0xa27b('0x36')]=_[_0xa27b('0x4c')](db['MailQueue']['rawAttributes']);_0x43540b[_0xa27b('0x37')]=_['keys'](_0x238d11[_0xa27b('0x37')]);_0x43540b['filters']=_[_0xa27b('0x38')](_0x43540b[_0xa27b('0x36')],_0x43540b[_0xa27b('0x37')]);_0x44ddb0['attributes']=_[_0xa27b('0x38')](_0x43540b[_0xa27b('0x36')],qs[_0xa27b('0x39')](_0x238d11[_0xa27b('0x37')]['fields']));_0x44ddb0[_0xa27b('0x3a')]=_0x44ddb0[_0xa27b('0x3a')][_0xa27b('0x4d')]?_0x44ddb0[_0xa27b('0x3a')]:_0x43540b[_0xa27b('0x36')];if(_0x238d11[_0xa27b('0x37')][_0xa27b('0x46')]){_0x44ddb0[_0xa27b('0x4e')]=[{'all':!![]}];}_0x44ddb0=_[_0xa27b('0x43')]({},_0x44ddb0,_0x238d11[_0xa27b('0x44')]);return db[_0xa27b('0x32')]['find'](_0x44ddb0)[_0xa27b('0x27')](handleEntityNotFound(_0x3d28bc,null))[_0xa27b('0x27')](respondWithResult(_0x3d28bc,null))[_0xa27b('0x49')](handleError(_0x3d28bc,null));};exports[_0xa27b('0x4f')]=function(_0x170485,_0x1af586){return db[_0xa27b('0x32')]['create'](_0x170485[_0xa27b('0x50')],{})[_0xa27b('0x27')](function(_0x29a9b9){var _0x17779c=_0x170485[_0xa27b('0x51')]['get']({'plain':!![]});if(!_0x17779c)throw new Error(_0xa27b('0x52'));if(_0x17779c[_0xa27b('0x53')]===_0xa27b('0x51')){var _0x17c5af=_0x29a9b9['get']({'plain':!![]});var _0x5baf99=_0xa27b('0x54');return db[_0xa27b('0x55')][_0xa27b('0x56')]({'where':{'name':_0x5baf99,'userProfileId':_0x17779c[_0xa27b('0x57')]},'raw':!![]})[_0xa27b('0x27')](function(_0x3f342c){if(_0x3f342c&&_0x3f342c[_0xa27b('0x58')]===0x0){return db[_0xa27b('0x2a')][_0xa27b('0x4f')]({'name':_0x17c5af[_0xa27b('0x2e')],'resourceId':_0x17c5af['id'],'type':_0x3f342c[_0xa27b('0x2e')],'sectionId':_0x3f342c['id']},{})[_0xa27b('0x27')](function(){return _0x29a9b9;});}else{return _0x29a9b9;}})['catch'](function(_0xef5714){logger[_0xa27b('0x2c')](_0xa27b('0x59'),_0xef5714);throw _0xef5714;});}return _0x29a9b9;})['then'](respondWithResult(_0x1af586,0xc9))[_0xa27b('0x49')](handleError(_0x1af586,null));};exports[_0xa27b('0x26')]=function(_0x1364e8,_0x4b5544){if(_0x1364e8[_0xa27b('0x50')]['id']){delete _0x1364e8['body']['id'];}return db[_0xa27b('0x32')][_0xa27b('0x56')]({'where':{'id':_0x1364e8['params']['id']}})['then'](handleEntityNotFound(_0x4b5544,null))[_0xa27b('0x27')](saveUpdates(_0x1364e8[_0xa27b('0x50')],null))[_0xa27b('0x27')](respondWithResult(_0x4b5544,null))['catch'](handleError(_0x4b5544,null));};exports[_0xa27b('0x28')]=function(_0xbc5202,_0x4ee831){return db[_0xa27b('0x32')][_0xa27b('0x56')]({'where':{'id':_0xbc5202[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](handleEntityNotFound(_0x4ee831,null))['then'](removeEntity(_0x4ee831,null))[_0xa27b('0x49')](handleError(_0x4ee831,null));};exports[_0xa27b('0x5a')]=function(_0x10fdaa,_0x945375){return db[_0xa27b('0x32')][_0xa27b('0x5a')]()[_0xa27b('0x27')](respondWithResult(_0x945375,null))[_0xa27b('0x49')](handleError(_0x945375,null));};exports[_0xa27b('0x5b')]=function(_0x1d05a9,_0x1706a1,_0x1adecf){var _0x1979a4={'raw':!![],'where':{}},_0x4292ed={},_0x2311ac;return db[_0xa27b('0x32')]['findOne']({'where':{'id':_0x1d05a9[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](handleEntityNotFound(_0x1706a1,null))[_0xa27b('0x27')](function(_0x52ce56){if(_0x52ce56){_0x2311ac=_0x52ce56[_0xa27b('0x29')]({'plain':!![]});_0x4292ed[_0xa27b('0x36')]=_[_0xa27b('0x4c')](db[_0xa27b('0x5c')]['rawAttributes']);_0x4292ed[_0xa27b('0x37')]=_[_0xa27b('0x4c')](_0x1d05a9[_0xa27b('0x37')]);_0x4292ed['filters']=_[_0xa27b('0x38')](_0x4292ed[_0xa27b('0x36')],_0x4292ed[_0xa27b('0x37')]);_0x1979a4[_0xa27b('0x3a')]=_[_0xa27b('0x38')](_0x4292ed[_0xa27b('0x36')],qs[_0xa27b('0x39')](_0x1d05a9[_0xa27b('0x37')][_0xa27b('0x39')]));_0x1979a4[_0xa27b('0x3a')]=_0x1979a4[_0xa27b('0x3a')][_0xa27b('0x4d')]?_0x1979a4[_0xa27b('0x3a')]:_0x4292ed['model'];if(!_0x1d05a9[_0xa27b('0x37')][_0xa27b('0x3b')](_0xa27b('0x3c'))){_0x1979a4[_0xa27b('0x22')]=qs[_0xa27b('0x22')](_0x1d05a9[_0xa27b('0x37')]['limit']);_0x1979a4[_0xa27b('0x21')]=qs[_0xa27b('0x21')](_0x1d05a9[_0xa27b('0x37')][_0xa27b('0x21')]);}_0x1979a4[_0xa27b('0x5d')]=qs['sort'](_0x1d05a9[_0xa27b('0x37')][_0xa27b('0x3d')]);_0x1979a4[_0xa27b('0x3e')]=qs[_0xa27b('0x40')](_[_0xa27b('0x3f')](_0x1d05a9[_0xa27b('0x37')],_0x4292ed['filters']));_0x1979a4[_0xa27b('0x3e')][_0xa27b('0x5e')]=_0x52ce56['id'];if(_0x1d05a9[_0xa27b('0x37')][_0xa27b('0x41')]){_0x1979a4[_0xa27b('0x3e')]=_[_0xa27b('0x43')](_0x1979a4['where'],{'$or':_['map'](_0x1979a4[_0xa27b('0x3a')],function(_0x4b7233){var _0x10f50a={};_0x10f50a[_0x4b7233]={'$like':'%'+_0x1d05a9[_0xa27b('0x37')][_0xa27b('0x41')]+'%'};return _0x10f50a;})});}_0x1979a4=_[_0xa27b('0x43')]({},_0x1979a4,_0x1d05a9[_0xa27b('0x44')]);return db[_0xa27b('0x5c')][_0xa27b('0x47')](_0x1979a4);}})['then'](function(_0x5dcdce){if(_0x5dcdce){return db[_0xa27b('0x5f')][_0xa27b('0x60')]({'where':{'id':_[_0xa27b('0x31')](_0x5dcdce,_0xa27b('0x61')),'role':_0xa27b('0x62')},'attributes':['id',_0xa27b('0x2e'),_0xa27b('0x63'),'updatedAt','createdAt']});}})[_0xa27b('0x27')](function(_0x2e08bd){if(_0x2e08bd){return{'count':_0x2e08bd['count'],'rows':_[_0xa27b('0x31')](_0x2e08bd[_0xa27b('0x48')],function(_0x44fdf0){return{'membername':_0x44fdf0['name'],'UserId':_0x44fdf0['id'],'queue_name':_0x2311ac[_0xa27b('0x2e')],'MailQueueId':_0x2311ac['id'],'interface':util[_0xa27b('0x64')](_0xa27b('0x65'),'SIP',_0x44fdf0[_0xa27b('0x2e')]),'penalty':0x0,'paused':_0x44fdf0['mailPause'],'createdAt':_0x44fdf0[_0xa27b('0x66')],'updatedAt':_0x44fdf0[_0xa27b('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa27b('0x27')](respondWithFilteredResult(_0x1706a1,_0x1979a4))[_0xa27b('0x49')](handleError(_0x1706a1,null));};exports[_0xa27b('0x68')]=function(_0x35bd06,_0x48c26d,_0x5d5095){var _0x190a5f={};var _0x3d7095={};var _0x32a645;var _0x5cbc88;return db['MailQueue'][_0xa27b('0x69')]({'where':{'id':_0x35bd06[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](handleEntityNotFound(_0x48c26d,null))[_0xa27b('0x27')](function(_0x1ccb0b){if(_0x1ccb0b){_0x32a645=_0x1ccb0b;_0x3d7095['model']=_[_0xa27b('0x4c')](db[_0xa27b('0x6a')][_0xa27b('0x33')]);_0x3d7095[_0xa27b('0x37')]=_[_0xa27b('0x4c')](_0x35bd06[_0xa27b('0x37')]);_0x3d7095[_0xa27b('0x40')]=_[_0xa27b('0x38')](_0x3d7095['model'],_0x3d7095[_0xa27b('0x37')]);_0x190a5f['attributes']=_['intersection'](_0x3d7095[_0xa27b('0x36')],qs[_0xa27b('0x39')](_0x35bd06[_0xa27b('0x37')][_0xa27b('0x39')]));_0x190a5f[_0xa27b('0x3a')]=_0x190a5f[_0xa27b('0x3a')][_0xa27b('0x4d')]?_0x190a5f[_0xa27b('0x3a')]:_0x3d7095[_0xa27b('0x36')];_0x190a5f['order']=qs['sort'](_0x35bd06[_0xa27b('0x37')][_0xa27b('0x3d')]);_0x190a5f['where']=qs[_0xa27b('0x40')](_['pick'](_0x35bd06['query'],_0x3d7095[_0xa27b('0x40')]));if(_0x35bd06['query']['filter']){_0x190a5f['where']=_[_0xa27b('0x43')](_0x190a5f['where'],{'$or':_['map'](_0x190a5f[_0xa27b('0x3a')],function(_0x312d99){var _0x9f2c01={};_0x9f2c01[_0x312d99]={'$like':'%'+_0x35bd06[_0xa27b('0x37')]['filter']+'%'};return _0x9f2c01;})});}_0x190a5f=_[_0xa27b('0x43')]({},_0x190a5f,_0x35bd06[_0xa27b('0x44')]);return _0x32a645[_0xa27b('0x68')](_0x190a5f);}})['then'](function(_0x5ee608){if(_0x5ee608){_0x5cbc88=_0x5ee608[_0xa27b('0x4d')];if(!_0x35bd06['query'][_0xa27b('0x3b')](_0xa27b('0x3c'))){_0x190a5f['limit']=qs['limit'](_0x35bd06[_0xa27b('0x37')][_0xa27b('0x22')]);_0x190a5f['offset']=qs[_0xa27b('0x21')](_0x35bd06[_0xa27b('0x37')]['offset']);}return _0x32a645[_0xa27b('0x68')](_0x190a5f);}})[_0xa27b('0x27')](function(_0x9a63b4){if(_0x9a63b4){return _0x9a63b4?{'count':_0x5cbc88,'rows':_0x9a63b4}:null;}})[_0xa27b('0x27')](respondWithResult(_0x48c26d,null))[_0xa27b('0x49')](handleError(_0x48c26d,null));};exports['addTeams']=function(_0x3fbb99,_0x118dae,_0x520b87){var _0xda7f55=_0x3fbb99[_0xa27b('0x50')]['ids'];return db[_0xa27b('0x6a')][_0xa27b('0x47')]({'where':{'id':_0xda7f55},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa27b('0x2e'),'online',_0xa27b('0x6b'),_0xa27b('0x6c')],'raw':!![]}]})[_0xa27b('0x27')](function(_0x116ae2){if(_0x116ae2){var _0xe9c6c0=_[_0xa27b('0x6d')](_0x116ae2,function(_0x137241){var _0x2d4ecd=_0x137241[_0xa27b('0x29')]({'plain':!![]});return _0x2d4ecd[_0xa27b('0x6e')];});return db[_0xa27b('0x32')][_0xa27b('0x56')]({'where':{'id':_0x3fbb99[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](function(_0x49ad47){return db[_0xa27b('0x6f')][_0xa27b('0x70')](function(_0x4a246a){return _0x49ad47[_0xa27b('0x71')](_0xda7f55,{'transaction':_0x4a246a})[_0xa27b('0x27')](function(){return BPromise['each'](_0xe9c6c0,function(_0x5ebf25){return db['UserMailQueue'][_0xa27b('0x72')]({'where':{'UserId':_0x5ebf25['id'],'MailQueueId':_0x3fbb99['params']['id']},'transaction':_0x4a246a});});})[_0xa27b('0x27')](function(){_0xe9c6c0['forEach'](function(_0x16c1b1){socket[_0xa27b('0x73')](_0xa27b('0x74'),{'UserId':_0x16c1b1['id'],'MailQueueId':_0x49ad47['id']});});});});});}})['then'](respondWithStatusCode(_0x118dae,null))[_0xa27b('0x49')](handleError(_0x118dae,null));};exports[_0xa27b('0x75')]=function(_0x57a470,_0xa4929d,_0x21f8ee){return db[_0xa27b('0x6a')]['findAll']({'where':{'id':_0x57a470['query'][_0xa27b('0x76')]},'attributes':['id'],'include':[{'model':db[_0xa27b('0x5f')],'as':_0xa27b('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xa27b('0x27')](handleEntityNotFound(_0xa4929d,null))[_0xa27b('0x27')](function(_0x2030b1){var _0x290c12=_[_0xa27b('0x31')](_0x2030b1,'id');var _0x2cf26a=[];var _0xedb2f0=[];var _0x4c7005=squel['select']();_0x4c7005[_0xa27b('0x77')](_0xa27b('0x78'))['from']('team_has_mail_queues','tq')[_0xa27b('0x79')]('user_has_teams','ut',_0xa27b('0x7a'))[_0xa27b('0x3e')](_0xa27b('0x7b'),_0x57a470[_0xa27b('0x4b')]['id']);for(var _0x1a4016=0x0;_0x1a4016<_0x2030b1[_0xa27b('0x4d')];_0x1a4016+=0x1){let _0x4e0011=_0x2030b1[_0x1a4016];for(var _0x11728c=0x0;_0x11728c<_0x4e0011[_0xa27b('0x6e')][_0xa27b('0x4d')];_0x11728c+=0x1){let _0x4b4f7=_0x4e0011[_0xa27b('0x6e')][_0x11728c];var _0x517bb3=_0x4c7005[_0xa27b('0x7c')]();_0x517bb3[_0xa27b('0x3e')](_0xa27b('0x7d'),_0x4b4f7['id']);_0xedb2f0['push'](db[_0xa27b('0x6f')][_0xa27b('0x37')](_0x517bb3[_0xa27b('0x7e')](),{'type':db['sequelize'][_0xa27b('0x7f')]['SELECT']})['then'](function(_0x3b223d){if(_0x3b223d['length']===0x1){return _0x4b4f7['id'];}else{var _0x280e57=_[_0xa27b('0x80')](_[_0xa27b('0x31')](_0x3b223d,_0xa27b('0x81')),function(_0x423255){return _[_0xa27b('0x82')](_0x290c12,_0x423255);});if(_0x280e57){return _0x4b4f7['id'];}}}));}}return BPromise['all'](_0xedb2f0)['then'](function(_0x2d7f11){_0x2cf26a=_(_0x2cf26a)[_0xa27b('0x83')](_0x2d7f11)['compact']()[_0xa27b('0x84')]();return db[_0xa27b('0x32')][_0xa27b('0x56')]({'where':{'id':_0x57a470[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](function(_0x13a2ee){return db[_0xa27b('0x6f')][_0xa27b('0x70')](function(_0x3cc43b){return _0x13a2ee[_0xa27b('0x75')](_0x57a470[_0xa27b('0x37')][_0xa27b('0x76')],{'transaction':_0x3cc43b})[_0xa27b('0x27')](function(){if(!_[_0xa27b('0x85')](_0x2cf26a)){return _0x13a2ee['removeAgents'](_0x2cf26a,{'transaction':_0x3cc43b});}})[_0xa27b('0x27')](function(){_0x2cf26a[_0xa27b('0x86')](function(_0x4df053){socket['emit'](_0xa27b('0x87'),{'UserId':_0x4df053,'MailQueueId':_0x13a2ee['id']});});});});});});})['then'](respondWithStatusCode(_0xa4929d,null))[_0xa27b('0x49')](handleError(_0xa4929d,null));};exports[_0xa27b('0x88')]=function(_0x18df23,_0x306669,_0x2d4dee){return db[_0xa27b('0x32')][_0xa27b('0x56')]({'where':{'id':_0x18df23[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](handleEntityNotFound(_0x306669,null))[_0xa27b('0x27')](function(_0x2e6f6a){if(_0x2e6f6a){return _0x2e6f6a['addAgents'](_0x18df23[_0xa27b('0x50')][_0xa27b('0x76')],_[_0xa27b('0x89')](_0x18df23[_0xa27b('0x50')],[_0xa27b('0x76'),'id'])||{})[_0xa27b('0x8a')](function(_0x1d346c){for(var _0x5e5509=0x0;_0x5e5509<_0x18df23[_0xa27b('0x50')]['ids']['length'];_0x5e5509+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x18df23['body'][_0xa27b('0x76')][_0x5e5509],'MailQueueId':_0x18df23[_0xa27b('0x4b')]['id']});}return _0x1d346c;});}})[_0xa27b('0x27')](respondWithResult(_0x306669,null))['catch'](handleError(_0x306669,null));};exports[_0xa27b('0x8b')]=function(_0x1789c3,_0x18ba44,_0x4496ed){return db[_0xa27b('0x32')][_0xa27b('0x56')]({'where':{'id':_0x1789c3[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](handleEntityNotFound(_0x18ba44,null))[_0xa27b('0x27')](function(_0x3fc303){if(_0x3fc303){return _0x3fc303[_0xa27b('0x8b')](_0x1789c3['query'][_0xa27b('0x76')])[_0xa27b('0x27')](function(){if(_[_0xa27b('0x8c')](_0x1789c3[_0xa27b('0x37')][_0xa27b('0x76')])){for(var _0x25c4b7=0x0;_0x25c4b7<_0x1789c3[_0xa27b('0x37')][_0xa27b('0x76')]['length'];_0x25c4b7+=0x1){socket[_0xa27b('0x73')](_0xa27b('0x87'),{'UserId':Number(_0x1789c3['query'][_0xa27b('0x76')][_0x25c4b7]),'MailQueueId':Number(_0x1789c3[_0xa27b('0x4b')]['id'])});}}else{socket[_0xa27b('0x73')](_0xa27b('0x87'),{'UserId':Number(_0x1789c3['query'][_0xa27b('0x76')]),'MailQueueId':Number(_0x1789c3['params']['id'])});}});}})['then'](respondWithStatusCode(_0x18ba44,null))[_0xa27b('0x49')](handleError(_0x18ba44,null));};exports[_0xa27b('0x8d')]=function(_0x3aa97a,_0x5722d8,_0xab9842){var _0x10b97f={};var _0x5c8fab={};var _0x1ec4a6;var _0x5651ab;return db[_0xa27b('0x32')][_0xa27b('0x69')]({'where':{'id':_0x3aa97a[_0xa27b('0x4b')]['id']}})[_0xa27b('0x27')](handleEntityNotFound(_0x5722d8,null))[_0xa27b('0x27')](function(_0x5a489f){if(_0x5a489f){_0x1ec4a6=_0x5a489f;_0x5c8fab[_0xa27b('0x36')]=_[_0xa27b('0x4c')](db['User'][_0xa27b('0x33')]);_0x5c8fab[_0xa27b('0x37')]=_['keys'](_0x3aa97a[_0xa27b('0x37')]);_0x5c8fab[_0xa27b('0x40')]=_['intersection'](_0x5c8fab[_0xa27b('0x36')],_0x5c8fab[_0xa27b('0x37')]);_0x10b97f[_0xa27b('0x3a')]=_[_0xa27b('0x38')](_0x5c8fab[_0xa27b('0x36')],qs[_0xa27b('0x39')](_0x3aa97a[_0xa27b('0x37')]['fields']));_0x10b97f[_0xa27b('0x3a')]=_0x10b97f[_0xa27b('0x3a')][_0xa27b('0x4d')]?_0x10b97f['attributes']:_0x5c8fab[_0xa27b('0x36')];_0x10b97f[_0xa27b('0x5d')]=qs[_0xa27b('0x3d')](_0x3aa97a[_0xa27b('0x37')][_0xa27b('0x3d')]);_0x10b97f['where']=qs[_0xa27b('0x40')](_[_0xa27b('0x3f')](_0x3aa97a[_0xa27b('0x37')],_0x5c8fab[_0xa27b('0x40')]));if(_0x3aa97a[_0xa27b('0x37')][_0xa27b('0x41')]){_0x10b97f['where']=_['merge'](_0x10b97f['where'],{'$or':_[_0xa27b('0x31')](_0x10b97f['attributes'],function(_0x51080b){var _0x3f1da1={};_0x3f1da1[_0x51080b]={'$like':'%'+_0x3aa97a[_0xa27b('0x37')][_0xa27b('0x41')]+'%'};return _0x3f1da1;})});}_0x10b97f=_[_0xa27b('0x43')]({},_0x10b97f,_0x3aa97a[_0xa27b('0x44')]);return _0x1ec4a6[_0xa27b('0x8d')](_0x10b97f);}})[_0xa27b('0x27')](function(_0x75db2a){if(_0x75db2a){_0x5651ab=_0x75db2a[_0xa27b('0x4d')];if(!_0x3aa97a[_0xa27b('0x37')][_0xa27b('0x3b')](_0xa27b('0x3c'))){_0x10b97f[_0xa27b('0x22')]=qs[_0xa27b('0x22')](_0x3aa97a[_0xa27b('0x37')]['limit']);_0x10b97f[_0xa27b('0x21')]=qs[_0xa27b('0x21')](_0x3aa97a[_0xa27b('0x37')]['offset']);}return _0x1ec4a6[_0xa27b('0x8d')](_0x10b97f);}})['then'](function(_0x1ed30f){if(_0x1ed30f){return _0x1ed30f?{'count':_0x5651ab,'rows':_0x1ed30f}:null;}})['then'](respondWithResult(_0x5722d8,null))[_0xa27b('0x49')](handleError(_0x5722d8,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 72bd740..1062c5f 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 _0xd601=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x33a800,_0x498b91){var _0x93016a=function(_0x3ee779){while(--_0x3ee779){_0x33a800['push'](_0x33a800['shift']());}};_0x93016a(++_0x498b91);}(_0xd601,0x11a));var _0x1d60=function(_0x5bc95e,_0x34e27a){_0x5bc95e=_0x5bc95e-0x0;var _0x1ebc03=_0xd601[_0x5bc95e];return _0x1ebc03;};'use strict';var EventEmitter=require(_0x1d60('0x0'));var MailQueue=require(_0x1d60('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d60('0x2'),'afterUpdate':'update','afterDestroy':_0x1d60('0x3')};function emitEvent(_0x53be92){return function(_0x26c77c,_0x931e87,_0x69e610){MailQueueEvents['emit'](_0x53be92+':'+_0x26c77c['id'],_0x26c77c);MailQueueEvents[_0x1d60('0x4')](_0x53be92,_0x26c77c);_0x69e610(null);};}for(var e in events){if(events[_0x1d60('0x5')](e)){var event=events[e];MailQueue[_0x1d60('0x6')](e,emitEvent(event));}}module[_0x1d60('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xc103=['setMaxListeners','update','emit','hook','../../mysqldb'];(function(_0x46e71d,_0x2503ff){var _0x33869a=function(_0x4cdf41){while(--_0x4cdf41){_0x46e71d['push'](_0x46e71d['shift']());}};_0x33869a(++_0x2503ff);}(_0xc103,0x199));var _0x3c10=function(_0x586ac8,_0x22c91f){_0x586ac8=_0x586ac8-0x0;var _0x27f9a4=_0xc103[_0x586ac8];return _0x27f9a4;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x3c10('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x3c10('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3c10('0x2'),'afterDestroy':'remove'};function emitEvent(_0x3d4af0){return function(_0x1b05de,_0x734f1b,_0x3a3e26){MailQueueEvents['emit'](_0x3d4af0+':'+_0x1b05de['id'],_0x1b05de);MailQueueEvents[_0x3c10('0x3')](_0x3d4af0,_0x1b05de);_0x3a3e26(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x3c10('0x4')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index f69fb12..084016f 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 _0xae19=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x328985,_0x16fe30){var _0x5ee9db=function(_0x2d5f11){while(--_0x2d5f11){_0x328985['push'](_0x328985['shift']());}};_0x5ee9db(++_0x16fe30);}(_0xae19,0x1e6));var _0x9ae1=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xae19[_0x79b649];return _0x1af9b1;};'use strict';var _=require('lodash');var util=require(_0x9ae1('0x0'));var logger=require(_0x9ae1('0x1'))(_0x9ae1('0x2'));var moment=require('moment');var BPromise=require(_0x9ae1('0x3'));var rp=require(_0x9ae1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ae1('0x5'));var config=require(_0x9ae1('0x6'));var attributes=require(_0x9ae1('0x7'));module[_0x9ae1('0x8')]=function(_0x2c22af,_0x4895dd){return _0x2c22af[_0x9ae1('0x9')](_0x9ae1('0xa'),attributes,{'tableName':_0x9ae1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa299=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','mail_queues'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xa299,0xdc));var _0x9a29=function(_0x434734,_0x47690f){_0x434734=_0x434734-0x0;var _0x3bae2b=_0xa299[_0x434734];return _0x3bae2b;};'use strict';var _=require(_0x9a29('0x0'));var util=require(_0x9a29('0x1'));var logger=require(_0x9a29('0x2'))(_0x9a29('0x3'));var moment=require(_0x9a29('0x4'));var BPromise=require(_0x9a29('0x5'));var rp=require(_0x9a29('0x6'));var fs=require('fs');var path=require(_0x9a29('0x7'));var rimraf=require(_0x9a29('0x8'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module['exports']=function(_0x34855a,_0xad18f0){return _0x34855a['define']('MailQueue',attributes,{'tableName':_0x9a29('0x9'),'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 69cba49..4fc638f 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 _0x4a0f=['ShowMailQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','GetMailQueue','debug'];(function(_0xce59d4,_0x581188){var _0x19d226=function(_0x16e5fa){while(--_0x16e5fa){_0xce59d4['push'](_0xce59d4['shift']());}};_0x19d226(++_0x581188);}(_0x4a0f,0x99));var _0xf4a0=function(_0x26f288,_0x14b630){_0x26f288=_0x26f288-0x0;var _0x573926=_0x4a0f[_0x26f288];return _0x573926;};'use strict';var _=require('lodash');var util=require(_0xf4a0('0x0'));var moment=require(_0xf4a0('0x1'));var BPromise=require(_0xf4a0('0x2'));var rs=require(_0xf4a0('0x3'));var fs=require('fs');var Redis=require(_0xf4a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4a0('0x5'));var logger=require(_0xf4a0('0x6'))('rpc');var config=require(_0xf4a0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf4a0('0x8')]({'port':0x232a});config[_0xf4a0('0x9')]=_[_0xf4a0('0xa')](config['redis'],{'host':_0xf4a0('0xb'),'port':0x18eb});var socket=require(_0xf4a0('0xc'))(new Redis(config[_0xf4a0('0x9')]));require('./mailQueue.socket')[_0xf4a0('0xd')](socket);function respondWithRpcPromise(_0x9e9471,_0x19ebad,_0x9dbfe5){return new BPromise(function(_0x1e8891,_0x4b1fa){return client['request'](_0x9e9471,_0x9dbfe5)['then'](function(_0x4bd642){logger[_0xf4a0('0xe')](_0xf4a0('0xf'),_0x19ebad,_0xf4a0('0x10'));logger['debug'](_0xf4a0('0x11'),_0x19ebad,_0xf4a0('0x10'),JSON[_0xf4a0('0x12')](_0x4bd642));if(_0x4bd642[_0xf4a0('0x13')]){if(_0x4bd642[_0xf4a0('0x13')][_0xf4a0('0x14')]===0x1f4){logger[_0xf4a0('0x13')]('MailQueue,\x20%s,\x20%s',_0x19ebad,_0x4bd642[_0xf4a0('0x13')]['message']);return _0x4b1fa(_0x4bd642[_0xf4a0('0x13')]['message']);}logger[_0xf4a0('0x13')](_0xf4a0('0xf'),_0x19ebad,_0x4bd642[_0xf4a0('0x13')][_0xf4a0('0x15')]);return _0x1e8891(_0x4bd642[_0xf4a0('0x13')][_0xf4a0('0x15')]);}else{logger['info'](_0xf4a0('0xf'),_0x19ebad,'request\x20sent');_0x1e8891(_0x4bd642[_0xf4a0('0x16')][_0xf4a0('0x15')]);}})[_0xf4a0('0x17')](function(_0x1102ec){logger[_0xf4a0('0x13')](_0xf4a0('0xf'),_0x19ebad,_0x1102ec);_0x4b1fa(_0x1102ec);});});}exports['GetMailQueue']=function(_0x2acb05){var _0x2ee4ad=this;return new Promise(function(_0x3e1466,_0xb1d5bf){return db[_0xf4a0('0x18')][_0xf4a0('0x19')]({'raw':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1c')]||null:null,'attributes':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')]['attributes']||null:null,'limit':_0x2acb05['options']?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1d')]||null:null,'include':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1e')]?_['map'](_0x2acb05['options'][_0xf4a0('0x1e')],function(_0x1344ff){return{'model':db[_0x1344ff['model']],'as':_0x1344ff['as'],'attributes':_0x1344ff['attributes'],'include':_0x1344ff[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0x1344ff[_0xf4a0('0x1e')],function(_0x1e46bf){return{'model':db[_0x1e46bf[_0xf4a0('0x20')]],'as':_0x1e46bf['as'],'attributes':_0x1e46bf[_0xf4a0('0x21')],'include':_0x1e46bf[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0x1e46bf[_0xf4a0('0x1e')],function(_0x1c535c){return{'model':db[_0x1c535c['model']],'as':_0x1c535c['as'],'attributes':_0x1c535c[_0xf4a0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf4a0('0x22')](function(_0x33a37d){logger[_0xf4a0('0xe')](_0xf4a0('0x23'),_0x2acb05);logger[_0xf4a0('0x24')](_0xf4a0('0x23'),_0x2acb05,JSON[_0xf4a0('0x12')](_0x33a37d));_0x3e1466(_0x33a37d);})['catch'](function(_0x25ecd6){logger[_0xf4a0('0x13')](_0xf4a0('0x23'),_0x25ecd6[_0xf4a0('0x15')],_0x2acb05);_0xb1d5bf(_0x2ee4ad[_0xf4a0('0x13')](0x1f4,_0x25ecd6[_0xf4a0('0x15')]));});});};exports['ShowMailQueue']=function(_0x548f3b){var _0x417a1d=this;return new Promise(function(_0x4b729b,_0x5576c2){return db[_0xf4a0('0x18')]['find']({'raw':_0x548f3b[_0xf4a0('0x1a')]?_0x548f3b[_0xf4a0('0x1a')][_0xf4a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x548f3b['options']?_0x548f3b[_0xf4a0('0x1a')][_0xf4a0('0x1c')]||null:null,'attributes':_0x548f3b[_0xf4a0('0x1a')]?_0x548f3b[_0xf4a0('0x1a')][_0xf4a0('0x21')]||null:null,'include':_0x548f3b[_0xf4a0('0x1a')]?_0x548f3b[_0xf4a0('0x1a')]['include']?_[_0xf4a0('0x1f')](_0x548f3b[_0xf4a0('0x1a')]['include'],function(_0xfbe742){return{'model':db[_0xfbe742[_0xf4a0('0x20')]],'as':_0xfbe742['as'],'attributes':_0xfbe742[_0xf4a0('0x21')],'include':_0xfbe742[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0xfbe742[_0xf4a0('0x1e')],function(_0x590299){return{'model':db[_0x590299[_0xf4a0('0x20')]],'as':_0x590299['as'],'attributes':_0x590299[_0xf4a0('0x21')],'include':_0x590299[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0x590299[_0xf4a0('0x1e')],function(_0x10d3b4){return{'model':db[_0x10d3b4[_0xf4a0('0x20')]],'as':_0x10d3b4['as'],'attributes':_0x10d3b4[_0xf4a0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf4a0('0x22')](function(_0x4d21b3){logger['info'](_0xf4a0('0x25'),_0x548f3b);logger[_0xf4a0('0x24')](_0xf4a0('0x25'),_0x548f3b,JSON[_0xf4a0('0x12')](_0x4d21b3));_0x4b729b(_0x4d21b3);})[_0xf4a0('0x17')](function(_0x4c450e){logger[_0xf4a0('0x13')]('ShowMailQueue',_0x4c450e[_0xf4a0('0x15')],_0x548f3b);_0x5576c2(_0x417a1d[_0xf4a0('0x13')](0x1f4,_0x4c450e[_0xf4a0('0x15')]));});});}; \ No newline at end of file +var _0x5a9c=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','MailQueue','findAll','options','raw','include','model','attributes','map','GetMailQueue','catch','where','ShowMailQueue','lodash','bluebird','ioredis','../../mysqldb'];(function(_0x10ea33,_0x182b9f){var _0x41aa6f=function(_0xdd7ca6){while(--_0xdd7ca6){_0x10ea33['push'](_0x10ea33['shift']());}};_0x41aa6f(++_0x182b9f);}(_0x5a9c,0xd4));var _0xc5a9=function(_0x3651ef,_0x379993){_0x3651ef=_0x3651ef-0x0;var _0x27dab1=_0x5a9c[_0x3651ef];return _0x27dab1;};'use strict';var _=require(_0xc5a9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc5a9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5a9('0x2'));var db=require(_0xc5a9('0x3'))['db'];var utils=require(_0xc5a9('0x4'));var logger=require(_0xc5a9('0x5'))(_0xc5a9('0x6'));var config=require(_0xc5a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc5a9('0x8')][_0xc5a9('0x9')]({'port':0x232a});config[_0xc5a9('0xa')]=_[_0xc5a9('0xb')](config[_0xc5a9('0xa')],{'host':_0xc5a9('0xc'),'port':0x18eb});var socket=require(_0xc5a9('0xd'))(new Redis(config[_0xc5a9('0xa')]));require('./mailQueue.socket')['register'](socket);function respondWithRpcPromise(_0x19ff96,_0x441110,_0x54d745){return new BPromise(function(_0x187562,_0x2a00e3){return client[_0xc5a9('0xe')](_0x19ff96,_0x54d745)[_0xc5a9('0xf')](function(_0x2242d7){logger[_0xc5a9('0x10')](_0xc5a9('0x11'),_0x441110,_0xc5a9('0x12'));logger[_0xc5a9('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x441110,_0xc5a9('0x12'),JSON[_0xc5a9('0x14')](_0x2242d7));if(_0x2242d7['error']){if(_0x2242d7[_0xc5a9('0x15')]['code']===0x1f4){logger[_0xc5a9('0x15')](_0xc5a9('0x11'),_0x441110,_0x2242d7['error'][_0xc5a9('0x16')]);return _0x2a00e3(_0x2242d7['error'][_0xc5a9('0x16')]);}logger[_0xc5a9('0x15')](_0xc5a9('0x11'),_0x441110,_0x2242d7[_0xc5a9('0x15')][_0xc5a9('0x16')]);return _0x187562(_0x2242d7[_0xc5a9('0x15')]['message']);}else{logger[_0xc5a9('0x10')](_0xc5a9('0x11'),_0x441110,_0xc5a9('0x12'));_0x187562(_0x2242d7[_0xc5a9('0x17')][_0xc5a9('0x16')]);}})['catch'](function(_0x41d2f2){logger[_0xc5a9('0x15')](_0xc5a9('0x11'),_0x441110,_0x41d2f2);_0x2a00e3(_0x41d2f2);});});}exports['GetMailQueue']=function(_0x53316d){var _0x2bc565=this;return new Promise(function(_0x57d34c,_0xfb0042){return db[_0xc5a9('0x18')][_0xc5a9('0x19')]({'raw':_0x53316d[_0xc5a9('0x1a')]?_0x53316d[_0xc5a9('0x1a')][_0xc5a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x53316d[_0xc5a9('0x1a')]?_0x53316d[_0xc5a9('0x1a')]['where']||null:null,'attributes':_0x53316d[_0xc5a9('0x1a')]?_0x53316d['options']['attributes']||null:null,'limit':_0x53316d[_0xc5a9('0x1a')]?_0x53316d['options']['limit']||null:null,'include':_0x53316d['options']?_0x53316d['options'][_0xc5a9('0x1c')]?_['map'](_0x53316d[_0xc5a9('0x1a')][_0xc5a9('0x1c')],function(_0x51d764){return{'model':db[_0x51d764[_0xc5a9('0x1d')]],'as':_0x51d764['as'],'attributes':_0x51d764[_0xc5a9('0x1e')],'include':_0x51d764[_0xc5a9('0x1c')]?_[_0xc5a9('0x1f')](_0x51d764['include'],function(_0x5c2751){return{'model':db[_0x5c2751[_0xc5a9('0x1d')]],'as':_0x5c2751['as'],'attributes':_0x5c2751['attributes'],'include':_0x5c2751['include']?_[_0xc5a9('0x1f')](_0x5c2751[_0xc5a9('0x1c')],function(_0x149fa4){return{'model':db[_0x149fa4[_0xc5a9('0x1d')]],'as':_0x149fa4['as'],'attributes':_0x149fa4['attributes']};}):[]};}):[]};}):[]:[]})[_0xc5a9('0xf')](function(_0x4903b5){logger[_0xc5a9('0x10')](_0xc5a9('0x20'),_0x53316d);logger['debug']('GetMailQueue',_0x53316d,JSON[_0xc5a9('0x14')](_0x4903b5));_0x57d34c(_0x4903b5);})[_0xc5a9('0x21')](function(_0x1099c0){logger[_0xc5a9('0x15')]('GetMailQueue',_0x1099c0[_0xc5a9('0x16')],_0x53316d);_0xfb0042(_0x2bc565['error'](0x1f4,_0x1099c0[_0xc5a9('0x16')]));});});};exports['ShowMailQueue']=function(_0x2caf5a){var _0x7d05f5=this;return new Promise(function(_0xe531f6,_0x3a6eab){return db[_0xc5a9('0x18')]['find']({'raw':_0x2caf5a['options']?_0x2caf5a[_0xc5a9('0x1a')][_0xc5a9('0x1b')]===undefined?!![]:![]:!![],'where':_0x2caf5a[_0xc5a9('0x1a')]?_0x2caf5a['options'][_0xc5a9('0x22')]||null:null,'attributes':_0x2caf5a[_0xc5a9('0x1a')]?_0x2caf5a[_0xc5a9('0x1a')][_0xc5a9('0x1e')]||null:null,'include':_0x2caf5a[_0xc5a9('0x1a')]?_0x2caf5a[_0xc5a9('0x1a')]['include']?_['map'](_0x2caf5a['options'][_0xc5a9('0x1c')],function(_0x260955){return{'model':db[_0x260955['model']],'as':_0x260955['as'],'attributes':_0x260955[_0xc5a9('0x1e')],'include':_0x260955['include']?_[_0xc5a9('0x1f')](_0x260955[_0xc5a9('0x1c')],function(_0x36bf02){return{'model':db[_0x36bf02['model']],'as':_0x36bf02['as'],'attributes':_0x36bf02['attributes'],'include':_0x36bf02[_0xc5a9('0x1c')]?_[_0xc5a9('0x1f')](_0x36bf02[_0xc5a9('0x1c')],function(_0x1627a2){return{'model':db[_0x1627a2[_0xc5a9('0x1d')]],'as':_0x1627a2['as'],'attributes':_0x1627a2[_0xc5a9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc5a9('0xf')](function(_0x45bfd2){logger[_0xc5a9('0x10')](_0xc5a9('0x23'),_0x2caf5a);logger[_0xc5a9('0x13')]('ShowMailQueue',_0x2caf5a,JSON['stringify'](_0x45bfd2));_0xe531f6(_0x45bfd2);})[_0xc5a9('0x21')](function(_0xbf4e46){logger[_0xc5a9('0x15')]('ShowMailQueue',_0xbf4e46[_0xc5a9('0x16')],_0x2caf5a);_0x3a6eab(_0x7d05f5[_0xc5a9('0x15')](0x1f4,_0xbf4e46[_0xc5a9('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 39c605e..4651d05 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 _0x2a19=['emit','removeListener','register','length','mailQueue:','save','remove','update'];(function(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0x2a19,0x125));var _0x92a1=function(_0x4d6463,_0x462a88){_0x4d6463=_0x4d6463-0x0;var _0x3cb018=_0x2a19[_0x4d6463];return _0x3cb018;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x92a1('0x0'),_0x92a1('0x1'),_0x92a1('0x2')];function createListener(_0x228c08,_0x26f170){return function(_0xf4bb55){_0x26f170[_0x92a1('0x3')](_0x228c08,_0xf4bb55);};}function removeListener(_0x2e5f43,_0x5c1507){return function(){MailQueueEvents[_0x92a1('0x4')](_0x2e5f43,_0x5c1507);};}exports[_0x92a1('0x5')]=function(_0x3dd431){for(var _0x4716b8=0x0,_0x198506=events[_0x92a1('0x6')];_0x4716b8<_0x198506;_0x4716b8++){var _0x1c015b=events[_0x4716b8];var _0x3ad046=createListener(_0x92a1('0x7')+_0x1c015b,_0x3dd431);MailQueueEvents['on'](_0x1c015b,_0x3ad046);}}; \ No newline at end of file +var _0x3472=['emit','length','mailQueue:','./mailQueue.events','remove','update'];(function(_0x4fd82f,_0x897f39){var _0x2ac1b9=function(_0x1580ae){while(--_0x1580ae){_0x4fd82f['push'](_0x4fd82f['shift']());}};_0x2ac1b9(++_0x897f39);}(_0x3472,0xd5));var _0x2347=function(_0x110d42,_0x73b342){_0x110d42=_0x110d42-0x0;var _0x4afe56=_0x3472[_0x110d42];return _0x4afe56;};'use strict';var MailQueueEvents=require(_0x2347('0x0'));var events=['save',_0x2347('0x1'),_0x2347('0x2')];function createListener(_0x47b004,_0xe03cc8){return function(_0x429443){_0xe03cc8[_0x2347('0x3')](_0x47b004,_0x429443);};}function removeListener(_0x5e0478,_0x2e69a2){return function(){MailQueueEvents['removeListener'](_0x5e0478,_0x2e69a2);};}exports['register']=function(_0x27da52){for(var _0xe071dc=0x0,_0x289979=events[_0x2347('0x4')];_0xe071dc<_0x289979;_0xe071dc++){var _0xd4818e=events[_0xe071dc];var _0x186539=createListener(_0x2347('0x5')+_0xd4818e,_0x27da52);MailQueueEvents['on'](_0xd4818e,_0x186539);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index f564944..29bb33f 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 _0x95b7=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x95b7,0x1f0));var _0x795b=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x95b7[_0x1b8e60];return _0x363363;};'use strict';var multer=require('multer');var util=require(_0x795b('0x0'));var path=require(_0x795b('0x1'));var timeout=require(_0x795b('0x2'));var express=require(_0x795b('0x3'));var router=express[_0x795b('0x4')]();var auth=require(_0x795b('0x5'));var interaction=require(_0x795b('0x6'));var config=require(_0x795b('0x7'));var controller=require('./mailQueueReport.controller');router[_0x795b('0x8')]('/',auth[_0x795b('0x9')](),controller[_0x795b('0xa')]);router['get'](_0x795b('0xb'),auth[_0x795b('0x9')](),controller[_0x795b('0xc')]);router[_0x795b('0x8')]('/:id',auth[_0x795b('0x9')](),controller[_0x795b('0xd')]);router[_0x795b('0xe')]('/',auth[_0x795b('0x9')](),controller[_0x795b('0xf')]);router[_0x795b('0x10')](_0x795b('0x11'),auth[_0x795b('0x9')](),controller[_0x795b('0x12')]);router[_0x795b('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x795b('0x14')]=router; \ No newline at end of file +var _0xb239=['multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','exports'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0xb239,0x187));var _0x9b23=function(_0x378d41,_0x4d688c){_0x378d41=_0x378d41-0x0;var _0xa8c290=_0xb239[_0x378d41];return _0xa8c290;};'use strict';var multer=require(_0x9b23('0x0'));var util=require('util');var path=require(_0x9b23('0x1'));var timeout=require(_0x9b23('0x2'));var express=require(_0x9b23('0x3'));var router=express['Router']();var auth=require(_0x9b23('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9b23('0x5'));var controller=require(_0x9b23('0x6'));router[_0x9b23('0x7')]('/',auth[_0x9b23('0x8')](),controller[_0x9b23('0x9')]);router[_0x9b23('0x7')](_0x9b23('0xa'),auth[_0x9b23('0x8')](),controller[_0x9b23('0xb')]);router['get'](_0x9b23('0xc'),auth[_0x9b23('0x8')](),controller[_0x9b23('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9b23('0xe')]);router['put'](_0x9b23('0xc'),auth[_0x9b23('0x8')](),controller[_0x9b23('0xf')]);router['delete'](_0x9b23('0xc'),auth[_0x9b23('0x8')](),controller['destroy']);module[_0x9b23('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 3c6b020..c635a09 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 _0x38ac=['exports','STRING','DATE','moment','sequelize'];(function(_0x4560b8,_0x3d487a){var _0x1e3747=function(_0x3a456c){while(--_0x3a456c){_0x4560b8['push'](_0x4560b8['shift']());}};_0x1e3747(++_0x3d487a);}(_0x38ac,0xe9));var _0xc38a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x38ac[_0x8c43de];return _0xa6591b;};'use strict';var moment=require(_0xc38a('0x0'));var Sequelize=require(_0xc38a('0x1'));module[_0xc38a('0x2')]={'uniqueid':{'type':Sequelize[_0xc38a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc38a('0x4')]},'leaveAt':{'type':Sequelize[_0xc38a('0x4')]},'acceptAt':{'type':Sequelize[_0xc38a('0x4')]},'exitAt':{'type':Sequelize[_0xc38a('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdea7=['exports','STRING','DATE'];(function(_0x466bc5,_0x3a0f2a){var _0x138952=function(_0x392fa2){while(--_0x392fa2){_0x466bc5['push'](_0x466bc5['shift']());}};_0x138952(++_0x3a0f2a);}(_0xdea7,0x126));var _0x7dea=function(_0x2ea6af,_0x255d1c){_0x2ea6af=_0x2ea6af-0x0;var _0x28bfc6=_0xdea7[_0x2ea6af];return _0x28bfc6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7dea('0x0')]={'uniqueid':{'type':Sequelize[_0x7dea('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x7dea('0x2')]},'leaveAt':{'type':Sequelize[_0x7dea('0x2')]},'acceptAt':{'type':Sequelize[_0x7dea('0x2')]},'exitAt':{'type':Sequelize[_0x7dea('0x2')]},'reason':{'type':Sequelize[_0x7dea('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 46cc1c3..dcb441e 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 _0xe342=['length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','catch','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4ff8e1,_0x453b90){var _0x51e5d3=function(_0x5987fe){while(--_0x5987fe){_0x4ff8e1['push'](_0x4ff8e1['shift']());}};_0x51e5d3(++_0x453b90);}(_0xe342,0xa4));var _0x2e34=function(_0x26ec1c,_0x274d1b){_0x26ec1c=_0x26ec1c-0x0;var _0x3759c0=_0xe342[_0x26ec1c];return _0x3759c0;};'use strict';var pdf=require(_0x2e34('0x0'));var emlformat=require(_0x2e34('0x1'));var rimraf=require(_0x2e34('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e34('0x3'));var rp=require(_0x2e34('0x4'));var moment=require(_0x2e34('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2e34('0x6'));var util=require(_0x2e34('0x7'));var path=require(_0x2e34('0x8'));var sox=require(_0x2e34('0x9'));var csv=require(_0x2e34('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2e34('0xb'));var squel=require(_0x2e34('0xc'));var crypto=require(_0x2e34('0xd'));var jsforce=require(_0x2e34('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e34('0xf'));var Redis=require(_0x2e34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2e34('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e34('0x12'));var logger=require('../../config/logger')(_0x2e34('0x13'));var utils=require(_0x2e34('0x14'));var config=require(_0x2e34('0x15'));var db=require(_0x2e34('0x16'))['db'];function respondWithStatusCode(_0x3ac227,_0x5a7d67){_0x5a7d67=_0x5a7d67||0xcc;return function(_0x315367){if(_0x315367){return _0x3ac227[_0x2e34('0x17')](_0x5a7d67);}return _0x3ac227[_0x2e34('0x18')](_0x5a7d67)[_0x2e34('0x19')]();};}function respondWithResult(_0x4ad609,_0x12c61d){_0x12c61d=_0x12c61d||0xc8;return function(_0x53b88e){if(_0x53b88e){return _0x4ad609[_0x2e34('0x18')](_0x12c61d)[_0x2e34('0x1a')](_0x53b88e);}};}function respondWithFilteredResult(_0x40951c,_0x2f24b4){return function(_0x9412d3){if(_0x9412d3){var _0x18abf2=_0x9412d3[_0x2e34('0x1b')],_0x24a797=_0x2f24b4[_0x2e34('0x1c')],_0x10a6c6=_0x2f24b4[_0x2e34('0x1c')]+_0x2f24b4['limit'],_0x265804;if(_0x10a6c6>=_0x18abf2){_0x10a6c6=_0x18abf2;_0x265804=0xc8;}else{_0x265804=0xce;}_0x40951c['status'](_0x265804);return _0x40951c['set'](_0x2e34('0x1d'),_0x24a797+'-'+_0x10a6c6+'/'+_0x18abf2)[_0x2e34('0x1a')](_0x9412d3);}return null;};}function patchUpdates(_0x2bb2f4){return function(_0x47717a){try{jsonpatch[_0x2e34('0x1e')](_0x47717a,_0x2bb2f4,!![]);}catch(_0x338111){return BPromise['reject'](_0x338111);}return _0x47717a[_0x2e34('0x1f')]();};}function saveUpdates(_0x341035,_0x1d225f){return function(_0x290d9d){if(_0x290d9d){return _0x290d9d[_0x2e34('0x20')](_0x341035)[_0x2e34('0x21')](function(_0xeeaf20){return _0xeeaf20;});}return null;};}function removeEntity(_0x1944c3,_0x502ffd){return function(_0x19e70e){if(_0x19e70e){return _0x19e70e[_0x2e34('0x22')]()['then'](function(){_0x1944c3[_0x2e34('0x18')](0xcc)[_0x2e34('0x19')]();});}};}function handleEntityNotFound(_0x3b0c03,_0x371f20){return function(_0x2b1f72){if(!_0x2b1f72){_0x3b0c03[_0x2e34('0x17')](0x194);}return _0x2b1f72;};}function handleError(_0x1b2898,_0x594fd7){_0x594fd7=_0x594fd7||0x1f4;return function(_0x3b5dae){logger[_0x2e34('0x23')](_0x3b5dae[_0x2e34('0x24')]);if(_0x3b5dae['name']){delete _0x3b5dae[_0x2e34('0x25')];}_0x1b2898[_0x2e34('0x18')](_0x594fd7)[_0x2e34('0x26')](_0x3b5dae);};}exports[_0x2e34('0x27')]=function(_0x41fd5e,_0xe28378){var _0x3600d8={},_0x45c0cc={},_0x375e60={'count':0x0,'rows':[]};var _0x587882=_[_0x2e34('0x28')](db[_0x2e34('0x29')][_0x2e34('0x2a')],function(_0x386f46){return{'name':_0x386f46['fieldName'],'type':_0x386f46[_0x2e34('0x2b')][_0x2e34('0x2c')]};});_0x45c0cc[_0x2e34('0x2d')]=_[_0x2e34('0x28')](_0x587882,'name');_0x45c0cc[_0x2e34('0x2e')]=_[_0x2e34('0x2f')](_0x41fd5e[_0x2e34('0x2e')]);_0x45c0cc[_0x2e34('0x30')]=_[_0x2e34('0x31')](_0x45c0cc['model'],_0x45c0cc[_0x2e34('0x2e')]);_0x3600d8[_0x2e34('0x32')]=_[_0x2e34('0x31')](_0x45c0cc['model'],qs[_0x2e34('0x33')](_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x33')]));_0x3600d8['attributes']=_0x3600d8[_0x2e34('0x32')][_0x2e34('0x34')]?_0x3600d8[_0x2e34('0x32')]:_0x45c0cc[_0x2e34('0x2d')];if(!_0x41fd5e['query']['hasOwnProperty'](_0x2e34('0x35'))){_0x3600d8['limit']=qs[_0x2e34('0x36')](_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x36')]);_0x3600d8[_0x2e34('0x1c')]=qs[_0x2e34('0x1c')](_0x41fd5e[_0x2e34('0x2e')]['offset']);}_0x3600d8[_0x2e34('0x37')]=qs[_0x2e34('0x38')](_0x41fd5e[_0x2e34('0x2e')]['sort']);_0x3600d8[_0x2e34('0x39')]=qs[_0x2e34('0x30')](_[_0x2e34('0x3a')](_0x41fd5e[_0x2e34('0x2e')],_0x45c0cc[_0x2e34('0x30')]));if(_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x3b')]){_0x3600d8[_0x2e34('0x39')]=_[_0x2e34('0x3c')](_0x3600d8[_0x2e34('0x39')],{'$or':_[_0x2e34('0x28')](_0x587882,function(_0x2b960a){if(_0x2b960a[_0x2e34('0x2b')]!==_0x2e34('0x3d')){var _0xbe174d={};_0xbe174d[_0x2b960a[_0x2e34('0x25')]]={'$like':'%'+_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x3b')]+'%'};return _0xbe174d;}})});}_0x3600d8=_[_0x2e34('0x3c')]({},_0x3600d8,_0x41fd5e['options']);var _0x33e667={'where':_0x3600d8['where']};return db['MailQueueReport'][_0x2e34('0x1b')](_0x33e667)[_0x2e34('0x21')](function(_0x5c330c){_0x375e60['count']=_0x5c330c;if(_0x41fd5e['query'][_0x2e34('0x3e')]){_0x3600d8['include']=[{'all':!![]}];}return db[_0x2e34('0x29')][_0x2e34('0x3f')](_0x3600d8);})[_0x2e34('0x21')](function(_0x19619c){_0x375e60[_0x2e34('0x40')]=_0x19619c;return _0x375e60;})[_0x2e34('0x21')](respondWithFilteredResult(_0xe28378,_0x3600d8))['catch'](handleError(_0xe28378,null));};exports['show']=function(_0xaf08d3,_0xa282d9){var _0x49717a={'raw':!![],'where':{'id':_0xaf08d3[_0x2e34('0x41')]['id']}},_0x5f0fb0={};_0x5f0fb0[_0x2e34('0x2d')]=_['keys'](db[_0x2e34('0x29')][_0x2e34('0x2a')]);_0x5f0fb0[_0x2e34('0x2e')]=_[_0x2e34('0x2f')](_0xaf08d3[_0x2e34('0x2e')]);_0x5f0fb0[_0x2e34('0x30')]=_[_0x2e34('0x31')](_0x5f0fb0[_0x2e34('0x2d')],_0x5f0fb0[_0x2e34('0x2e')]);_0x49717a[_0x2e34('0x32')]=_[_0x2e34('0x31')](_0x5f0fb0[_0x2e34('0x2d')],qs['fields'](_0xaf08d3[_0x2e34('0x2e')][_0x2e34('0x33')]));_0x49717a[_0x2e34('0x32')]=_0x49717a[_0x2e34('0x32')]['length']?_0x49717a[_0x2e34('0x32')]:_0x5f0fb0['model'];if(_0xaf08d3['query'][_0x2e34('0x3e')]){_0x49717a[_0x2e34('0x42')]=[{'all':!![]}];}_0x49717a=_[_0x2e34('0x3c')]({},_0x49717a,_0xaf08d3['options']);return db[_0x2e34('0x29')]['find'](_0x49717a)[_0x2e34('0x21')](handleEntityNotFound(_0xa282d9,null))[_0x2e34('0x21')](respondWithResult(_0xa282d9,null))[_0x2e34('0x43')](handleError(_0xa282d9,null));};exports[_0x2e34('0x44')]=function(_0x9d4add,_0x589b4f){return db[_0x2e34('0x29')]['create'](_0x9d4add['body'],{})[_0x2e34('0x21')](respondWithResult(_0x589b4f,0xc9))[_0x2e34('0x43')](handleError(_0x589b4f,null));};exports[_0x2e34('0x20')]=function(_0x56e872,_0xf214cc){if(_0x56e872[_0x2e34('0x45')]['id']){delete _0x56e872[_0x2e34('0x45')]['id'];}return db['MailQueueReport'][_0x2e34('0x46')]({'where':{'id':_0x56e872[_0x2e34('0x41')]['id']}})[_0x2e34('0x21')](handleEntityNotFound(_0xf214cc,null))['then'](saveUpdates(_0x56e872[_0x2e34('0x45')],null))['then'](respondWithResult(_0xf214cc,null))[_0x2e34('0x43')](handleError(_0xf214cc,null));};exports[_0x2e34('0x22')]=function(_0x968189,_0x34df24){return db[_0x2e34('0x29')]['find']({'where':{'id':_0x968189[_0x2e34('0x41')]['id']}})[_0x2e34('0x21')](handleEntityNotFound(_0x34df24,null))[_0x2e34('0x21')](removeEntity(_0x34df24,null))[_0x2e34('0x43')](handleError(_0x34df24,null));};exports[_0x2e34('0x47')]=function(_0x5155d7,_0x417f67){return db['MailQueueReport']['describe']()[_0x2e34('0x21')](respondWithResult(_0x417f67,null))[_0x2e34('0x43')](handleError(_0x417f67,null));}; \ No newline at end of file +var _0x25a3=['send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','create','body','find','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','error','name'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x25a3,0x1da));var _0x325a=function(_0x43b884,_0x2cb289){_0x43b884=_0x43b884-0x0;var _0x4101f8=_0x25a3[_0x43b884];return _0x4101f8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x325a('0x0'));var rimraf=require(_0x325a('0x1'));var zipdir=require(_0x325a('0x2'));var jsonpatch=require(_0x325a('0x3'));var rp=require(_0x325a('0x4'));var moment=require(_0x325a('0x5'));var BPromise=require(_0x325a('0x6'));var Mustache=require('mustache');var util=require(_0x325a('0x7'));var path=require(_0x325a('0x8'));var sox=require(_0x325a('0x9'));var csv=require(_0x325a('0xa'));var ejs=require(_0x325a('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x325a('0xc'));var crypto=require(_0x325a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x325a('0xe'));var toCsv=require(_0x325a('0xa'));var querystring=require(_0x325a('0xf'));var Papa=require('papaparse');var Redis=require(_0x325a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x325a('0x11'));var as=require(_0x325a('0x12'));var hardwareService=require(_0x325a('0x13'));var logger=require(_0x325a('0x14'))(_0x325a('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x325a('0x16'))['db'];function respondWithStatusCode(_0xd9c72c,_0x4c6dc2){_0x4c6dc2=_0x4c6dc2||0xcc;return function(_0x4778ed){if(_0x4778ed){return _0xd9c72c[_0x325a('0x17')](_0x4c6dc2);}return _0xd9c72c[_0x325a('0x18')](_0x4c6dc2)[_0x325a('0x19')]();};}function respondWithResult(_0x21ebe6,_0x11fa50){_0x11fa50=_0x11fa50||0xc8;return function(_0x518640){if(_0x518640){return _0x21ebe6[_0x325a('0x18')](_0x11fa50)[_0x325a('0x1a')](_0x518640);}};}function respondWithFilteredResult(_0x3dbb0e,_0x2e1841){return function(_0x391d6f){if(_0x391d6f){var _0x3716bb=_0x391d6f[_0x325a('0x1b')],_0xccffac=_0x2e1841[_0x325a('0x1c')],_0x4a05a=_0x2e1841['offset']+_0x2e1841['limit'],_0x5894ad;if(_0x4a05a>=_0x3716bb){_0x4a05a=_0x3716bb;_0x5894ad=0xc8;}else{_0x5894ad=0xce;}_0x3dbb0e[_0x325a('0x18')](_0x5894ad);return _0x3dbb0e[_0x325a('0x1d')](_0x325a('0x1e'),_0xccffac+'-'+_0x4a05a+'/'+_0x3716bb)[_0x325a('0x1a')](_0x391d6f);}return null;};}function patchUpdates(_0x5b7c5a){return function(_0x5ccc37){try{jsonpatch[_0x325a('0x1f')](_0x5ccc37,_0x5b7c5a,!![]);}catch(_0x12f26c){return BPromise['reject'](_0x12f26c);}return _0x5ccc37[_0x325a('0x20')]();};}function saveUpdates(_0x47a2a5,_0x449e28){return function(_0x534396){if(_0x534396){return _0x534396[_0x325a('0x21')](_0x47a2a5)['then'](function(_0x35b57b){return _0x35b57b;});}return null;};}function removeEntity(_0x15bea9,_0x116ddc){return function(_0x457885){if(_0x457885){return _0x457885['destroy']()[_0x325a('0x22')](function(){_0x15bea9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x529e14,_0x15ef07){return function(_0x396d96){if(!_0x396d96){_0x529e14[_0x325a('0x17')](0x194);}return _0x396d96;};}function handleError(_0x126355,_0x451478){_0x451478=_0x451478||0x1f4;return function(_0x192b75){logger[_0x325a('0x23')](_0x192b75['stack']);if(_0x192b75[_0x325a('0x24')]){delete _0x192b75[_0x325a('0x24')];}_0x126355[_0x325a('0x18')](_0x451478)[_0x325a('0x25')](_0x192b75);};}exports[_0x325a('0x26')]=function(_0x6953cf,_0x362f88){var _0x547e89={},_0x2cf852={},_0x4c36b2={'count':0x0,'rows':[]};var _0x13f239=_[_0x325a('0x27')](db[_0x325a('0x28')][_0x325a('0x29')],function(_0x2d7571){return{'name':_0x2d7571[_0x325a('0x2a')],'type':_0x2d7571[_0x325a('0x2b')][_0x325a('0x2c')]};});_0x2cf852[_0x325a('0x2d')]=_['map'](_0x13f239,'name');_0x2cf852['query']=_[_0x325a('0x2e')](_0x6953cf[_0x325a('0x2f')]);_0x2cf852[_0x325a('0x30')]=_[_0x325a('0x31')](_0x2cf852[_0x325a('0x2d')],_0x2cf852[_0x325a('0x2f')]);_0x547e89[_0x325a('0x32')]=_[_0x325a('0x31')](_0x2cf852[_0x325a('0x2d')],qs[_0x325a('0x33')](_0x6953cf['query'][_0x325a('0x33')]));_0x547e89[_0x325a('0x32')]=_0x547e89['attributes'][_0x325a('0x34')]?_0x547e89[_0x325a('0x32')]:_0x2cf852[_0x325a('0x2d')];if(!_0x6953cf[_0x325a('0x2f')][_0x325a('0x35')]('nolimit')){_0x547e89['limit']=qs[_0x325a('0x36')](_0x6953cf[_0x325a('0x2f')][_0x325a('0x36')]);_0x547e89[_0x325a('0x1c')]=qs[_0x325a('0x1c')](_0x6953cf['query'][_0x325a('0x1c')]);}_0x547e89[_0x325a('0x37')]=qs[_0x325a('0x38')](_0x6953cf[_0x325a('0x2f')][_0x325a('0x38')]);_0x547e89[_0x325a('0x39')]=qs[_0x325a('0x30')](_['pick'](_0x6953cf[_0x325a('0x2f')],_0x2cf852[_0x325a('0x30')]));if(_0x6953cf[_0x325a('0x2f')][_0x325a('0x3a')]){_0x547e89[_0x325a('0x39')]=_[_0x325a('0x3b')](_0x547e89[_0x325a('0x39')],{'$or':_[_0x325a('0x27')](_0x13f239,function(_0x4eb51f){if(_0x4eb51f[_0x325a('0x2b')]!==_0x325a('0x3c')){var _0xa1867d={};_0xa1867d[_0x4eb51f[_0x325a('0x24')]]={'$like':'%'+_0x6953cf[_0x325a('0x2f')][_0x325a('0x3a')]+'%'};return _0xa1867d;}})});}_0x547e89=_[_0x325a('0x3b')]({},_0x547e89,_0x6953cf[_0x325a('0x3d')]);var _0x24b613={'where':_0x547e89['where']};return db[_0x325a('0x28')][_0x325a('0x1b')](_0x24b613)['then'](function(_0x4f9922){_0x4c36b2[_0x325a('0x1b')]=_0x4f9922;if(_0x6953cf[_0x325a('0x2f')][_0x325a('0x3e')]){_0x547e89[_0x325a('0x3f')]=[{'all':!![]}];}return db['MailQueueReport'][_0x325a('0x40')](_0x547e89);})['then'](function(_0x40eb94){_0x4c36b2['rows']=_0x40eb94;return _0x4c36b2;})['then'](respondWithFilteredResult(_0x362f88,_0x547e89))[_0x325a('0x41')](handleError(_0x362f88,null));};exports[_0x325a('0x42')]=function(_0x2c745c,_0x23707b){var _0x5760da={'raw':!![],'where':{'id':_0x2c745c['params']['id']}},_0x50b6f9={};_0x50b6f9['model']=_[_0x325a('0x2e')](db[_0x325a('0x28')][_0x325a('0x29')]);_0x50b6f9['query']=_[_0x325a('0x2e')](_0x2c745c[_0x325a('0x2f')]);_0x50b6f9[_0x325a('0x30')]=_[_0x325a('0x31')](_0x50b6f9[_0x325a('0x2d')],_0x50b6f9[_0x325a('0x2f')]);_0x5760da['attributes']=_[_0x325a('0x31')](_0x50b6f9[_0x325a('0x2d')],qs[_0x325a('0x33')](_0x2c745c[_0x325a('0x2f')][_0x325a('0x33')]));_0x5760da[_0x325a('0x32')]=_0x5760da['attributes'][_0x325a('0x34')]?_0x5760da[_0x325a('0x32')]:_0x50b6f9[_0x325a('0x2d')];if(_0x2c745c[_0x325a('0x2f')][_0x325a('0x3e')]){_0x5760da[_0x325a('0x3f')]=[{'all':!![]}];}_0x5760da=_['merge']({},_0x5760da,_0x2c745c[_0x325a('0x3d')]);return db[_0x325a('0x28')]['find'](_0x5760da)[_0x325a('0x22')](handleEntityNotFound(_0x23707b,null))[_0x325a('0x22')](respondWithResult(_0x23707b,null))[_0x325a('0x41')](handleError(_0x23707b,null));};exports[_0x325a('0x43')]=function(_0x4c1f6d,_0x5f2e59){return db[_0x325a('0x28')][_0x325a('0x43')](_0x4c1f6d[_0x325a('0x44')],{})[_0x325a('0x22')](respondWithResult(_0x5f2e59,0xc9))[_0x325a('0x41')](handleError(_0x5f2e59,null));};exports[_0x325a('0x21')]=function(_0x14f9c7,_0x216036){if(_0x14f9c7[_0x325a('0x44')]['id']){delete _0x14f9c7[_0x325a('0x44')]['id'];}return db['MailQueueReport'][_0x325a('0x45')]({'where':{'id':_0x14f9c7[_0x325a('0x46')]['id']}})[_0x325a('0x22')](handleEntityNotFound(_0x216036,null))['then'](saveUpdates(_0x14f9c7['body'],null))[_0x325a('0x22')](respondWithResult(_0x216036,null))[_0x325a('0x41')](handleError(_0x216036,null));};exports[_0x325a('0x47')]=function(_0x13a330,_0x150d40){return db['MailQueueReport']['find']({'where':{'id':_0x13a330[_0x325a('0x46')]['id']}})[_0x325a('0x22')](handleEntityNotFound(_0x150d40,null))[_0x325a('0x22')](removeEntity(_0x150d40,null))[_0x325a('0x41')](handleError(_0x150d40,null));};exports[_0x325a('0x48')]=function(_0x2cb3eb,_0x54b97a){return db['MailQueueReport'][_0x325a('0x48')]()[_0x325a('0x22')](respondWithResult(_0x54b97a,null))['catch'](handleError(_0x54b97a,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 808b17f..cc12e05 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 _0xe300=['request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x453483,_0x2e6854){var _0x518fb8=function(_0x4eecc7){while(--_0x4eecc7){_0x453483['push'](_0x453483['shift']());}};_0x518fb8(++_0x2e6854);}(_0xe300,0xa4));var _0x0e30=function(_0x3f6da1,_0x1ed093){_0x3f6da1=_0x3f6da1-0x0;var _0x49ff13=_0xe300[_0x3f6da1];return _0x49ff13;};'use strict';var _=require(_0x0e30('0x0'));var util=require(_0x0e30('0x1'));var logger=require('../../config/logger')(_0x0e30('0x2'));var moment=require(_0x0e30('0x3'));var BPromise=require(_0x0e30('0x4'));var rp=require(_0x0e30('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e30('0x6'));var config=require(_0x0e30('0x7'));var attributes=require(_0x0e30('0x8'));module[_0x0e30('0x9')]=function(_0x2861d3,_0x36f5f6){return _0x2861d3['define'](_0x0e30('0xa'),attributes,{'tableName':_0x0e30('0xb'),'paranoid':![],'indexes':[{'name':_0x0e30('0xc'),'fields':[_0x0e30('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe250=['MailQueueReport','uniqueid','util','api','moment','bluebird','request-promise','path','define'];(function(_0x33a694,_0x9b6640){var _0x41ff01=function(_0x4c38b7){while(--_0x4c38b7){_0x33a694['push'](_0x33a694['shift']());}};_0x41ff01(++_0x9b6640);}(_0xe250,0x12b));var _0x0e25=function(_0x2cba24,_0x4c9907){_0x2cba24=_0x2cba24-0x0;var _0x13209f=_0xe250[_0x2cba24];return _0x13209f;};'use strict';var _=require('lodash');var util=require(_0x0e25('0x0'));var logger=require('../../config/logger')(_0x0e25('0x1'));var moment=require(_0x0e25('0x2'));var BPromise=require(_0x0e25('0x3'));var rp=require(_0x0e25('0x4'));var fs=require('fs');var path=require(_0x0e25('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./mailQueueReport.attributes');module['exports']=function(_0x5cfbfe,_0x5d7802){return _0x5cfbfe[_0x0e25('0x6')](_0x0e25('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0e25('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 5f1a9c1..e1e91ab 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 _0x90b1=['../../config/utils','../../config/logger','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x90b1,0x1bb));var _0x190b=function(_0x5d4364,_0x4a6c71){_0x5d4364=_0x5d4364-0x0;var _0x460809=_0x90b1[_0x5d4364];return _0x460809;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}exports[_0x190b('0x14')]=function(_0x21e458){var _0x56d07a=this;return new Promise(function(_0x16c009,_0x50a3c4){return db[_0x190b('0x15')][_0x190b('0x16')](_0x21e458[_0x190b('0x17')],{'raw':_0x21e458[_0x190b('0x18')]?_0x21e458[_0x190b('0x18')][_0x190b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3ed24c){logger[_0x190b('0x9')]('CreateMailQueueReport',_0x21e458);logger[_0x190b('0xc')]('CreateMailQueueReport',_0x21e458,JSON['stringify'](_0x3ed24c));_0x16c009(_0x3ed24c);})[_0x190b('0x13')](function(_0x42e7f2){logger[_0x190b('0xf')]('CreateMailQueueReport',_0x42e7f2[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a[_0x190b('0xf')](0x1f4,_0x42e7f2[_0x190b('0x11')]));});});};exports[_0x190b('0x1a')]=function(_0x3b8c74){var _0x3ad3a5=this;return new Promise(function(_0x1bce97,_0x519a76){return db['MailQueueReport'][_0x190b('0x1b')](_0x3b8c74[_0x190b('0x17')],{'raw':_0x3b8c74['options']?_0x3b8c74['options'][_0x190b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b8c74['options']?_0x3b8c74[_0x190b('0x18')][_0x190b('0x1c')]||null:null,'attributes':_0x3b8c74['options']?_0x3b8c74[_0x190b('0x18')][_0x190b('0x1d')]||null:null,'limit':_0x3b8c74['options']?_0x3b8c74[_0x190b('0x18')][_0x190b('0x1e')]||null:null})[_0x190b('0x1f')](function(_0x494f3f){logger['info'](_0x190b('0x1a'),_0x3b8c74);logger['debug'](_0x190b('0x1a'),_0x3b8c74,JSON[_0x190b('0xe')](_0x494f3f));_0x1bce97(_0x494f3f);})['catch'](function(_0x29775f){logger['error'](_0x190b('0x1a'),_0x29775f['message'],_0x3b8c74);_0x519a76(_0x3ad3a5[_0x190b('0xf')](0x1f4,_0x29775f['message']));});});}; \ No newline at end of file +var _0x01d9=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','options','stringify','UpdateMailQueueReport','update','body','raw'];(function(_0x45ed75,_0x565373){var _0x391c6a=function(_0x44f4d6){while(--_0x44f4d6){_0x45ed75['push'](_0x45ed75['shift']());}};_0x391c6a(++_0x565373);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6c9ac8,_0x21e1d7,_0x12c39f){return new BPromise(function(_0x313f85,_0x39fc94){return client[_0x901d('0xc')](_0x6c9ac8,_0x12c39f)[_0x901d('0xd')](function(_0x15076e){logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));logger[_0x901d('0x11')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x21e1d7,_0x901d('0x10'),JSON['stringify'](_0x15076e));if(_0x15076e[_0x901d('0x12')]){if(_0x15076e[_0x901d('0x12')][_0x901d('0x13')]===0x1f4){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e['error'][_0x901d('0x14')]);return _0x39fc94(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x15076e[_0x901d('0x12')]['message']);return _0x313f85(_0x15076e[_0x901d('0x12')][_0x901d('0x14')]);}else{logger[_0x901d('0xe')](_0x901d('0xf'),_0x21e1d7,_0x901d('0x10'));_0x313f85(_0x15076e[_0x901d('0x15')][_0x901d('0x14')]);}})[_0x901d('0x16')](function(_0x3368fc){logger[_0x901d('0x12')](_0x901d('0xf'),_0x21e1d7,_0x3368fc);_0x39fc94(_0x3368fc);});});}exports[_0x901d('0x17')]=function(_0x285353){var _0x403db9=this;return new Promise(function(_0x38f42b,_0x414171){return db[_0x901d('0x18')][_0x901d('0x19')](_0x285353['body'],{'raw':_0x285353[_0x901d('0x1a')]?_0x285353[_0x901d('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x496a06){logger['info'](_0x901d('0x17'),_0x285353);logger[_0x901d('0x11')]('CreateMailQueueReport',_0x285353,JSON[_0x901d('0x1b')](_0x496a06));_0x38f42b(_0x496a06);})[_0x901d('0x16')](function(_0x488e24){logger[_0x901d('0x12')](_0x901d('0x17'),_0x488e24[_0x901d('0x14')],_0x285353);_0x414171(_0x403db9[_0x901d('0x12')](0x1f4,_0x488e24[_0x901d('0x14')]));});});};exports[_0x901d('0x1c')]=function(_0x46e5c6){var _0x45b6a8=this;return new Promise(function(_0x4c1318,_0x196a76){return db[_0x901d('0x18')][_0x901d('0x1d')](_0x46e5c6[_0x901d('0x1e')],{'raw':_0x46e5c6['options']?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46e5c6[_0x901d('0x1a')]?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x20')]||null:null,'attributes':_0x46e5c6['options']?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x21')]||null:null,'limit':_0x46e5c6[_0x901d('0x1a')]?_0x46e5c6[_0x901d('0x1a')][_0x901d('0x22')]||null:null})[_0x901d('0xd')](function(_0x48e86e){logger[_0x901d('0xe')]('UpdateMailQueueReport',_0x46e5c6);logger[_0x901d('0x11')](_0x901d('0x1c'),_0x46e5c6,JSON[_0x901d('0x1b')](_0x48e86e));_0x4c1318(_0x48e86e);})[_0x901d('0x16')](function(_0x1b1c17){logger[_0x901d('0x12')](_0x901d('0x1c'),_0x1b1c17[_0x901d('0x14')],_0x46e5c6);_0x196a76(_0x45b6a8[_0x901d('0x12')](0x1f4,_0x1b1c17[_0x901d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 5173c00..db84e6c 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 _0xb39f=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0xb39f,0xc4));var _0xfb39=function(_0x45b2a4,_0x22e9db){_0x45b2a4=_0x45b2a4-0x0;var _0xbc4b20=_0xb39f[_0x45b2a4];return _0xbc4b20;};'use strict';var multer=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var path=require('path');var timeout=require(_0xfb39('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xfb39('0x3'));var interaction=require(_0xfb39('0x4'));var config=require(_0xfb39('0x5'));module[_0xfb39('0x6')]=router; \ No newline at end of file +var _0x31c8=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path','express'];(function(_0x2d6182,_0x5720e8){var _0x43d532=function(_0x4ef203){while(--_0x4ef203){_0x2d6182['push'](_0x2d6182['shift']());}};_0x43d532(++_0x5720e8);}(_0x31c8,0x146));var _0x831c=function(_0x39324b,_0x7293d){_0x39324b=_0x39324b-0x0;var _0x17df1d=_0x31c8[_0x39324b];return _0x17df1d;};'use strict';var multer=require('multer');var util=require(_0x831c('0x0'));var path=require(_0x831c('0x1'));var timeout=require('connect-timeout');var express=require(_0x831c('0x2'));var router=express[_0x831c('0x3')]();var auth=require(_0x831c('0x4'));var interaction=require(_0x831c('0x5'));var config=require(_0x831c('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index cae8fb4..c9725a6 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 _0xdd53=['STRING','BOOLEAN','username','INTEGER','sequelize','exports'];(function(_0x59ad93,_0x5ae764){var _0x5614bc=function(_0x2c6ea8){while(--_0x2c6ea8){_0x59ad93['push'](_0x59ad93['shift']());}};_0x5614bc(++_0x5ae764);}(_0xdd53,0x1ba));var _0x3dd5=function(_0x22f13a,_0x12bb8f){_0x22f13a=_0x22f13a-0x0;var _0x288f25=_0xdd53[_0x22f13a];return _0x288f25;};'use strict';var Sequelize=require(_0x3dd5('0x0'));module[_0x3dd5('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3dd5('0x2')]},'authentication':{'type':Sequelize[_0x3dd5('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3dd5('0x2')],'unique':_0x3dd5('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3dd5('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3dd5('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x3dd5('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3dd5('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3dd5('0x2')]}}; \ No newline at end of file +var _0x945f=['INBOX','sequelize','exports','STRING','BOOLEAN','username','INTEGER'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x945f,0x151));var _0xf945=function(_0x20d6ca,_0x2aea74){_0x20d6ca=_0x20d6ca-0x0;var _0x3b53aa=_0x945f[_0x20d6ca];return _0x3b53aa;};'use strict';var Sequelize=require(_0xf945('0x0'));module[_0xf945('0x1')]={'description':{'type':Sequelize[_0xf945('0x2')]},'host':{'type':Sequelize[_0xf945('0x2')]},'authentication':{'type':Sequelize[_0xf945('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf945('0x2')],'unique':_0xf945('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xf945('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf945('0x2')],'defaultValue':_0xf945('0x6')},'connTimeout':{'type':Sequelize[_0xf945('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf945('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf945('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 21aafe7..0293193 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 _0x5713=['exports','define','MailServerIn','mail_servers_in','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x3b0295,_0x218b0b){var _0x2cdd32=function(_0x266ba0){while(--_0x266ba0){_0x3b0295['push'](_0x3b0295['shift']());}};_0x2cdd32(++_0x218b0b);}(_0x5713,0x1c7));var _0x3571=function(_0x3e7775,_0x1a8aa6){_0x3e7775=_0x3e7775-0x0;var _0x34a090=_0x5713[_0x3e7775];return _0x34a090;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var logger=require('../../config/logger')(_0x3571('0x2'));var moment=require('moment');var BPromise=require(_0x3571('0x3'));var rp=require(_0x3571('0x4'));var fs=require('fs');var path=require(_0x3571('0x5'));var rimraf=require(_0x3571('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x3571('0x7')]=function(_0x415378,_0x3e114a){return _0x415378[_0x3571('0x8')](_0x3571('0x9'),attributes,{'tableName':_0x3571('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ae2=['define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6ae2,0x1ed));var _0x26ae=function(_0x2ce43b,_0x3ddc26){_0x2ce43b=_0x2ce43b-0x0;var _0x5a5e04=_0x6ae2[_0x2ce43b];return _0x5a5e04;};'use strict';var _=require(_0x26ae('0x0'));var util=require(_0x26ae('0x1'));var logger=require(_0x26ae('0x2'))(_0x26ae('0x3'));var moment=require(_0x26ae('0x4'));var BPromise=require(_0x26ae('0x5'));var rp=require(_0x26ae('0x6'));var fs=require('fs');var path=require(_0x26ae('0x7'));var rimraf=require(_0x26ae('0x8'));var config=require('../../config/environment');var attributes=require(_0x26ae('0x9'));module[_0x26ae('0xa')]=function(_0x595da8,_0x5609b0){return _0x595da8[_0x26ae('0xb')](_0x26ae('0xc'),attributes,{'tableName':_0x26ae('0xd'),'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 d74a4d5..e028874 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 _0x9726=['../../config/utils','rpc','../../config/environment','jayson/promise','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x9726,0x72));var _0x6972=function(_0x19c6a5,_0x6627fe){_0x19c6a5=_0x19c6a5-0x0;var _0x5c9581=_0x9726[_0x19c6a5];return _0x5c9581;};'use strict';var _=require(_0x6972('0x0'));var util=require('util');var moment=require(_0x6972('0x1'));var BPromise=require(_0x6972('0x2'));var rs=require(_0x6972('0x3'));var fs=require('fs');var Redis=require(_0x6972('0x4'));var db=require(_0x6972('0x5'))['db'];var utils=require(_0x6972('0x6'));var logger=require('../../config/logger')(_0x6972('0x7'));var config=require(_0x6972('0x8'));var jayson=require(_0x6972('0x9'));var client=jayson['client'][_0x6972('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4057d2,_0x23acaf,_0x64e524){return new BPromise(function(_0x4f0f17,_0x32fa6b){return client['request'](_0x4057d2,_0x64e524)['then'](function(_0x3df55f){logger[_0x6972('0xb')](_0x6972('0xc'),_0x23acaf,_0x6972('0xd'));logger[_0x6972('0xe')](_0x6972('0xf'),_0x23acaf,_0x6972('0xd'),JSON[_0x6972('0x10')](_0x3df55f));if(_0x3df55f[_0x6972('0x11')]){if(_0x3df55f['error']['code']===0x1f4){logger[_0x6972('0x11')](_0x6972('0xc'),_0x23acaf,_0x3df55f[_0x6972('0x11')]['message']);return _0x32fa6b(_0x3df55f[_0x6972('0x11')][_0x6972('0x12')]);}logger['error'](_0x6972('0xc'),_0x23acaf,_0x3df55f['error'][_0x6972('0x12')]);return _0x4f0f17(_0x3df55f[_0x6972('0x11')][_0x6972('0x12')]);}else{logger[_0x6972('0xb')](_0x6972('0xc'),_0x23acaf,'request\x20sent');_0x4f0f17(_0x3df55f[_0x6972('0x13')]['message']);}})[_0x6972('0x14')](function(_0x5ae2ac){logger[_0x6972('0x11')](_0x6972('0xc'),_0x23acaf,_0x5ae2ac);_0x32fa6b(_0x5ae2ac);});});}exports[_0x6972('0x15')]=function(_0x4d193f){var _0x207e32=this;return new Promise(function(_0x1cf858,_0xc79909){return db[_0x6972('0x16')][_0x6972('0x17')]({'raw':_0x4d193f['options']?_0x4d193f[_0x6972('0x18')][_0x6972('0x19')]===undefined?!![]:![]:!![],'where':_0x4d193f[_0x6972('0x18')]?_0x4d193f[_0x6972('0x18')]['where']||null:null,'attributes':_0x4d193f['options']?_0x4d193f[_0x6972('0x18')][_0x6972('0x1a')]||null:null,'limit':_0x4d193f[_0x6972('0x18')]?_0x4d193f[_0x6972('0x18')]['limit']||null:null,'include':_0x4d193f[_0x6972('0x18')]?_0x4d193f[_0x6972('0x18')][_0x6972('0x1b')]?_[_0x6972('0x1c')](_0x4d193f[_0x6972('0x18')][_0x6972('0x1b')],function(_0x4be8a3){return{'model':db[_0x4be8a3[_0x6972('0x1d')]],'as':_0x4be8a3['as'],'attributes':_0x4be8a3[_0x6972('0x1a')],'include':_0x4be8a3[_0x6972('0x1b')]?_[_0x6972('0x1c')](_0x4be8a3[_0x6972('0x1b')],function(_0x3ec303){return{'model':db[_0x3ec303[_0x6972('0x1d')]],'as':_0x3ec303['as'],'attributes':_0x3ec303[_0x6972('0x1a')],'include':_0x3ec303['include']?_['map'](_0x3ec303[_0x6972('0x1b')],function(_0x4d4456){return{'model':db[_0x4d4456['model']],'as':_0x4d4456['as'],'attributes':_0x4d4456[_0x6972('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe0c5d3){logger[_0x6972('0xb')](_0x6972('0x15'),_0x4d193f);logger[_0x6972('0xe')](_0x6972('0x15'),_0x4d193f,JSON[_0x6972('0x10')](_0xe0c5d3));_0x1cf858(_0xe0c5d3);})['catch'](function(_0x23fa27){logger[_0x6972('0x11')]('GetMailServerIn',_0x23fa27[_0x6972('0x12')],_0x4d193f);_0xc79909(_0x207e32[_0x6972('0x11')](0x1f4,_0x23fa27[_0x6972('0x12')]));});});}; \ No newline at end of file +var _0xf2dc=['limit','include','map','model','attributes','debug','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','GetMailServerIn','MailServerIn','options','raw','where'];(function(_0x269684,_0x54bd60){var _0x1f9270=function(_0x529d34){while(--_0x529d34){_0x269684['push'](_0x269684['shift']());}};_0x1f9270(++_0x54bd60);}(_0xf2dc,0x1aa));var _0xcf2d=function(_0x4f166a,_0x26f491){_0x4f166a=_0x4f166a-0x0;var _0x2ff54f=_0xf2dc[_0x4f166a];return _0x2ff54f;};'use strict';var _=require(_0xcf2d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf2d('0x1'));var rs=require(_0xcf2d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcf2d('0x3'))['db'];var utils=require(_0xcf2d('0x4'));var logger=require(_0xcf2d('0x5'))(_0xcf2d('0x6'));var config=require('../../config/environment');var jayson=require(_0xcf2d('0x7'));var client=jayson[_0xcf2d('0x8')][_0xcf2d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x167a9a,_0x22e543,_0xb029ab){return new BPromise(function(_0x2e3759,_0xbe633e){return client[_0xcf2d('0xa')](_0x167a9a,_0xb029ab)[_0xcf2d('0xb')](function(_0x38784c){logger['info'](_0xcf2d('0xc'),_0x22e543,_0xcf2d('0xd'));logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x22e543,_0xcf2d('0xd'),JSON['stringify'](_0x38784c));if(_0x38784c[_0xcf2d('0xe')]){if(_0x38784c[_0xcf2d('0xe')]['code']===0x1f4){logger[_0xcf2d('0xe')](_0xcf2d('0xc'),_0x22e543,_0x38784c[_0xcf2d('0xe')][_0xcf2d('0xf')]);return _0xbe633e(_0x38784c[_0xcf2d('0xe')][_0xcf2d('0xf')]);}logger['error'](_0xcf2d('0xc'),_0x22e543,_0x38784c[_0xcf2d('0xe')][_0xcf2d('0xf')]);return _0x2e3759(_0x38784c[_0xcf2d('0xe')][_0xcf2d('0xf')]);}else{logger[_0xcf2d('0x10')](_0xcf2d('0xc'),_0x22e543,_0xcf2d('0xd'));_0x2e3759(_0x38784c[_0xcf2d('0x11')][_0xcf2d('0xf')]);}})[_0xcf2d('0x12')](function(_0x2d2aa5){logger['error'](_0xcf2d('0xc'),_0x22e543,_0x2d2aa5);_0xbe633e(_0x2d2aa5);});});}exports[_0xcf2d('0x13')]=function(_0x27cdb4){var _0x3168c0=this;return new Promise(function(_0xf0e676,_0xedbc8a){return db[_0xcf2d('0x14')]['findAll']({'raw':_0x27cdb4[_0xcf2d('0x15')]?_0x27cdb4[_0xcf2d('0x15')][_0xcf2d('0x16')]===undefined?!![]:![]:!![],'where':_0x27cdb4[_0xcf2d('0x15')]?_0x27cdb4[_0xcf2d('0x15')][_0xcf2d('0x17')]||null:null,'attributes':_0x27cdb4['options']?_0x27cdb4['options']['attributes']||null:null,'limit':_0x27cdb4[_0xcf2d('0x15')]?_0x27cdb4['options'][_0xcf2d('0x18')]||null:null,'include':_0x27cdb4['options']?_0x27cdb4[_0xcf2d('0x15')][_0xcf2d('0x19')]?_[_0xcf2d('0x1a')](_0x27cdb4[_0xcf2d('0x15')][_0xcf2d('0x19')],function(_0x1595db){return{'model':db[_0x1595db['model']],'as':_0x1595db['as'],'attributes':_0x1595db['attributes'],'include':_0x1595db['include']?_[_0xcf2d('0x1a')](_0x1595db[_0xcf2d('0x19')],function(_0x1a8331){return{'model':db[_0x1a8331[_0xcf2d('0x1b')]],'as':_0x1a8331['as'],'attributes':_0x1a8331['attributes'],'include':_0x1a8331[_0xcf2d('0x19')]?_['map'](_0x1a8331[_0xcf2d('0x19')],function(_0x3e390f){return{'model':db[_0x3e390f[_0xcf2d('0x1b')]],'as':_0x3e390f['as'],'attributes':_0x3e390f[_0xcf2d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xcf2d('0xb')](function(_0x2d576b){logger[_0xcf2d('0x10')]('GetMailServerIn',_0x27cdb4);logger[_0xcf2d('0x1d')]('GetMailServerIn',_0x27cdb4,JSON['stringify'](_0x2d576b));_0xf0e676(_0x2d576b);})[_0xcf2d('0x12')](function(_0x27b7ec){logger[_0xcf2d('0xe')](_0xcf2d('0x13'),_0x27b7ec[_0xcf2d('0xf')],_0x27cdb4);_0xedbc8a(_0x3168c0[_0xcf2d('0xe')](0x1f4,_0x27b7ec[_0xcf2d('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4dce03a..295f2a0 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 _0xc26b=['/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated','create','put'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc26b,0x1a7));var _0xbc26=function(_0x4643d7,_0x539ccf){_0x4643d7=_0x4643d7-0x0;var _0x46ef2f=_0xc26b[_0x4643d7];return _0x46ef2f;};'use strict';var multer=require(_0xbc26('0x0'));var util=require(_0xbc26('0x1'));var path=require(_0xbc26('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc26('0x3'));var router=express['Router']();var auth=require(_0xbc26('0x4'));var interaction=require(_0xbc26('0x5'));var config=require(_0xbc26('0x6'));var controller=require('./mailServerOut.controller');router[_0xbc26('0x7')]('/',auth['isAuthenticated'](),controller[_0xbc26('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbc26('0x9')]);router[_0xbc26('0xa')]('/',auth[_0xbc26('0xb')](),controller[_0xbc26('0xc')]);router[_0xbc26('0xd')](_0xbc26('0xe'),auth['isAuthenticated'](),controller[_0xbc26('0xf')]);router[_0xbc26('0x10')](_0xbc26('0xe'),auth[_0xbc26('0xb')](),controller[_0xbc26('0x11')]);module[_0xbc26('0x12')]=router; \ No newline at end of file +var _0x7c0b=['../../config/environment','./mailServerOut.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x15c133,_0x390ba6){var _0x678ffb=function(_0xbe23a7){while(--_0xbe23a7){_0x15c133['push'](_0x15c133['shift']());}};_0x678ffb(++_0x390ba6);}(_0x7c0b,0xf0));var _0xb7c0=function(_0xf35a3c,_0x211596){_0xf35a3c=_0xf35a3c-0x0;var _0x281675=_0x7c0b[_0xf35a3c];return _0x281675;};'use strict';var multer=require(_0xb7c0('0x0'));var util=require(_0xb7c0('0x1'));var path=require(_0xb7c0('0x2'));var timeout=require(_0xb7c0('0x3'));var express=require('express');var router=express[_0xb7c0('0x4')]();var auth=require(_0xb7c0('0x5'));var interaction=require(_0xb7c0('0x6'));var config=require(_0xb7c0('0x7'));var controller=require(_0xb7c0('0x8'));router[_0xb7c0('0x9')]('/',auth[_0xb7c0('0xa')](),controller[_0xb7c0('0xb')]);router['get'](_0xb7c0('0xc'),auth[_0xb7c0('0xa')](),controller['show']);router[_0xb7c0('0xd')]('/',auth['isAuthenticated'](),controller[_0xb7c0('0xe')]);router[_0xb7c0('0xf')](_0xb7c0('0xc'),auth['isAuthenticated'](),controller[_0xb7c0('0x10')]);router[_0xb7c0('0x11')](_0xb7c0('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xb7c0('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 8c7588d..9a90942 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 _0x81d4=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x124096,_0xbb4341){var _0x123aed=function(_0x4db081){while(--_0x4db081){_0x124096['push'](_0x124096['shift']());}};_0x123aed(++_0xbb4341);}(_0x81d4,0x197));var _0x481d=function(_0x1a3e44,_0x5cc37a){_0x1a3e44=_0x1a3e44-0x0;var _0x3d912b=_0x81d4[_0x1a3e44];return _0x3d912b;};'use strict';var Sequelize=require('sequelize');module[_0x481d('0x0')]={'description':{'type':Sequelize[_0x481d('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x481d('0x1')]},'pass':{'type':Sequelize[_0x481d('0x1')]},'port':{'type':Sequelize[_0x481d('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x481d('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb073=['BOOLEAN','exports','STRING'];(function(_0x4fbb15,_0x21be0c){var _0x436338=function(_0x3b5a05){while(--_0x3b5a05){_0x4fbb15['push'](_0x4fbb15['shift']());}};_0x436338(++_0x21be0c);}(_0xb073,0x187));var _0x3b07=function(_0x56553a,_0x458912){_0x56553a=_0x56553a-0x0;var _0x408e7e=_0xb073[_0x56553a];return _0x408e7e;};'use strict';var Sequelize=require('sequelize');module[_0x3b07('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3b07('0x1')]},'user':{'type':Sequelize[_0x3b07('0x1')]},'pass':{'type':Sequelize[_0x3b07('0x1')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x3b07('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x3b07('0x1')]},'authentication':{'type':Sequelize[_0x3b07('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 6816cb8..af629fa 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 _0x1185=['apply','update','then','destroy','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','zip-dir','moment','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x1185,0x1f4));var _0x5118=function(_0x3d09f2,_0x3c3410){_0x3d09f2=_0x3d09f2-0x0;var _0x303486=_0x1185[_0x3d09f2];return _0x303486;};'use strict';var pdf=require(_0x5118('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5118('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5118('0x2'));var BPromise=require(_0x5118('0x3'));var Mustache=require(_0x5118('0x4'));var util=require(_0x5118('0x5'));var path=require('path');var sox=require(_0x5118('0x6'));var csv=require('to-csv');var ejs=require(_0x5118('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5118('0x8'));var crypto=require(_0x5118('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5118('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5118('0xb'));var Redis=require(_0x5118('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5118('0xd'));var hardwareService=require(_0x5118('0xe'));var logger=require('../../config/logger')(_0x5118('0xf'));var utils=require(_0x5118('0x10'));var config=require(_0x5118('0x11'));var db=require(_0x5118('0x12'))['db'];function respondWithStatusCode(_0x2ab1ca,_0x161105){_0x161105=_0x161105||0xcc;return function(_0x186d38){if(_0x186d38){return _0x2ab1ca[_0x5118('0x13')](_0x161105);}return _0x2ab1ca[_0x5118('0x14')](_0x161105)[_0x5118('0x15')]();};}function respondWithResult(_0x47d689,_0x14b474){_0x14b474=_0x14b474||0xc8;return function(_0x1d90ed){if(_0x1d90ed){return _0x47d689['status'](_0x14b474)[_0x5118('0x16')](_0x1d90ed);}};}function respondWithFilteredResult(_0x4d768e,_0x1e887e){return function(_0x198eff){if(_0x198eff){var _0x4fba20=_0x198eff[_0x5118('0x17')],_0xb6300=_0x1e887e[_0x5118('0x18')],_0xb096a8=_0x1e887e[_0x5118('0x18')]+_0x1e887e[_0x5118('0x19')],_0x72a6e;if(_0xb096a8>=_0x4fba20){_0xb096a8=_0x4fba20;_0x72a6e=0xc8;}else{_0x72a6e=0xce;}_0x4d768e['status'](_0x72a6e);return _0x4d768e[_0x5118('0x1a')](_0x5118('0x1b'),_0xb6300+'-'+_0xb096a8+'/'+_0x4fba20)['json'](_0x198eff);}return null;};}function patchUpdates(_0x47ef39){return function(_0x2617e3){try{jsonpatch[_0x5118('0x1c')](_0x2617e3,_0x47ef39,!![]);}catch(_0x17eaf7){return BPromise['reject'](_0x17eaf7);}return _0x2617e3['save']();};}function saveUpdates(_0x40ccf5,_0x20ab78){return function(_0x455c3e){if(_0x455c3e){return _0x455c3e[_0x5118('0x1d')](_0x40ccf5)[_0x5118('0x1e')](function(_0x5eb3d6){return _0x5eb3d6;});}return null;};}function removeEntity(_0x10fa8b,_0x52d0e8){return function(_0x1823a3){if(_0x1823a3){return _0x1823a3[_0x5118('0x1f')]()[_0x5118('0x1e')](function(){_0x10fa8b[_0x5118('0x14')](0xcc)[_0x5118('0x15')]();});}};}function handleEntityNotFound(_0x87a7f2,_0x3c4096){return function(_0x275b9b){if(!_0x275b9b){_0x87a7f2[_0x5118('0x13')](0x194);}return _0x275b9b;};}function handleError(_0xb32b0,_0x27fe42){_0x27fe42=_0x27fe42||0x1f4;return function(_0x582ae8){logger[_0x5118('0x20')](_0x582ae8['stack']);if(_0x582ae8[_0x5118('0x21')]){delete _0x582ae8[_0x5118('0x21')];}_0xb32b0[_0x5118('0x14')](_0x27fe42)[_0x5118('0x22')](_0x582ae8);};}exports[_0x5118('0x23')]=function(_0x285fd7,_0x1a24aa){var _0x2b0a67={},_0x2b5eba={},_0x224212={'count':0x0,'rows':[]};var _0x4c6790=_[_0x5118('0x24')](db[_0x5118('0x25')][_0x5118('0x26')],function(_0x282591){return{'name':_0x282591[_0x5118('0x27')],'type':_0x282591['type'][_0x5118('0x28')]};});_0x2b5eba[_0x5118('0x29')]=_['map'](_0x4c6790,_0x5118('0x21'));_0x2b5eba[_0x5118('0x2a')]=_[_0x5118('0x2b')](_0x285fd7[_0x5118('0x2a')]);_0x2b5eba[_0x5118('0x2c')]=_[_0x5118('0x2d')](_0x2b5eba['model'],_0x2b5eba['query']);_0x2b0a67[_0x5118('0x2e')]=_[_0x5118('0x2d')](_0x2b5eba[_0x5118('0x29')],qs[_0x5118('0x2f')](_0x285fd7[_0x5118('0x2a')][_0x5118('0x2f')]));_0x2b0a67[_0x5118('0x2e')]=_0x2b0a67['attributes'][_0x5118('0x30')]?_0x2b0a67[_0x5118('0x2e')]:_0x2b5eba[_0x5118('0x29')];if(!_0x285fd7[_0x5118('0x2a')][_0x5118('0x31')](_0x5118('0x32'))){_0x2b0a67[_0x5118('0x19')]=qs[_0x5118('0x19')](_0x285fd7[_0x5118('0x2a')]['limit']);_0x2b0a67[_0x5118('0x18')]=qs[_0x5118('0x18')](_0x285fd7['query'][_0x5118('0x18')]);}_0x2b0a67['order']=qs['sort'](_0x285fd7[_0x5118('0x2a')]['sort']);_0x2b0a67[_0x5118('0x33')]=qs[_0x5118('0x2c')](_[_0x5118('0x34')](_0x285fd7[_0x5118('0x2a')],_0x2b5eba['filters']));if(_0x285fd7[_0x5118('0x2a')][_0x5118('0x35')]){_0x2b0a67['where']=_[_0x5118('0x36')](_0x2b0a67[_0x5118('0x33')],{'$or':_[_0x5118('0x24')](_0x4c6790,function(_0x5cbcc8){if(_0x5cbcc8[_0x5118('0x37')]!=='VIRTUAL'){var _0x33bc06={};_0x33bc06[_0x5cbcc8[_0x5118('0x21')]]={'$like':'%'+_0x285fd7[_0x5118('0x2a')][_0x5118('0x35')]+'%'};return _0x33bc06;}})});}_0x2b0a67=_[_0x5118('0x36')]({},_0x2b0a67,_0x285fd7[_0x5118('0x38')]);var _0x114be2={'where':_0x2b0a67[_0x5118('0x33')]};return db[_0x5118('0x25')][_0x5118('0x17')](_0x114be2)[_0x5118('0x1e')](function(_0xd3ebe7){_0x224212[_0x5118('0x17')]=_0xd3ebe7;if(_0x285fd7[_0x5118('0x2a')][_0x5118('0x39')]){_0x2b0a67[_0x5118('0x3a')]=[{'all':!![]}];}return db[_0x5118('0x25')]['findAll'](_0x2b0a67);})[_0x5118('0x1e')](function(_0x5d2fa8){_0x224212[_0x5118('0x3b')]=_0x5d2fa8;return _0x224212;})[_0x5118('0x1e')](respondWithFilteredResult(_0x1a24aa,_0x2b0a67))[_0x5118('0x3c')](handleError(_0x1a24aa,null));};exports[_0x5118('0x3d')]=function(_0x8a0d80,_0x455b3a){var _0x3d6777={'raw':!![],'where':{'id':_0x8a0d80[_0x5118('0x3e')]['id']}},_0xcdc0db={};_0xcdc0db[_0x5118('0x29')]=_[_0x5118('0x2b')](db['MailServerOut'][_0x5118('0x26')]);_0xcdc0db[_0x5118('0x2a')]=_[_0x5118('0x2b')](_0x8a0d80['query']);_0xcdc0db[_0x5118('0x2c')]=_[_0x5118('0x2d')](_0xcdc0db[_0x5118('0x29')],_0xcdc0db[_0x5118('0x2a')]);_0x3d6777['attributes']=_['intersection'](_0xcdc0db['model'],qs[_0x5118('0x2f')](_0x8a0d80[_0x5118('0x2a')][_0x5118('0x2f')]));_0x3d6777[_0x5118('0x2e')]=_0x3d6777[_0x5118('0x2e')]['length']?_0x3d6777[_0x5118('0x2e')]:_0xcdc0db[_0x5118('0x29')];if(_0x8a0d80[_0x5118('0x2a')]['includeAll']){_0x3d6777[_0x5118('0x3a')]=[{'all':!![]}];}_0x3d6777=_['merge']({},_0x3d6777,_0x8a0d80[_0x5118('0x38')]);return db['MailServerOut'][_0x5118('0x3f')](_0x3d6777)['then'](handleEntityNotFound(_0x455b3a,null))[_0x5118('0x1e')](respondWithResult(_0x455b3a,null))[_0x5118('0x3c')](handleError(_0x455b3a,null));};exports[_0x5118('0x40')]=function(_0xfbfeec,_0x2e1beb){return db['MailServerOut'][_0x5118('0x40')](_0xfbfeec['body'],{})[_0x5118('0x1e')](respondWithResult(_0x2e1beb,0xc9))[_0x5118('0x3c')](handleError(_0x2e1beb,null));};exports[_0x5118('0x1d')]=function(_0x5a6d75,_0x1fa19a){if(_0x5a6d75[_0x5118('0x41')]['id']){delete _0x5a6d75['body']['id'];}return db['MailServerOut'][_0x5118('0x3f')]({'where':{'id':_0x5a6d75['params']['id']}})[_0x5118('0x1e')](handleEntityNotFound(_0x1fa19a,null))[_0x5118('0x1e')](saveUpdates(_0x5a6d75['body'],null))[_0x5118('0x1e')](respondWithResult(_0x1fa19a,null))['catch'](handleError(_0x1fa19a,null));};exports['destroy']=function(_0x412215,_0x40e622){return db[_0x5118('0x25')]['find']({'where':{'id':_0x412215['params']['id']}})[_0x5118('0x1e')](handleEntityNotFound(_0x40e622,null))[_0x5118('0x1e')](removeEntity(_0x40e622,null))['catch'](handleError(_0x40e622,null));}; \ No newline at end of file +var _0x55fd=['destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','MailServerOut','includeAll','findAll','rows','params','fields','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x55fd,0x70));var _0xd55f=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0x55fd[_0x4e1d03];return _0x362d4b;};'use strict';var pdf=require(_0xd55f('0x0'));var emlformat=require(_0xd55f('0x1'));var rimraf=require(_0xd55f('0x2'));var zipdir=require(_0xd55f('0x3'));var jsonpatch=require(_0xd55f('0x4'));var rp=require(_0xd55f('0x5'));var moment=require(_0xd55f('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd55f('0x7'));var util=require(_0xd55f('0x8'));var path=require(_0xd55f('0x9'));var sox=require(_0xd55f('0xa'));var csv=require('to-csv');var ejs=require(_0xd55f('0xb'));var fs=require('fs');var _=require(_0xd55f('0xc'));var squel=require(_0xd55f('0xd'));var crypto=require(_0xd55f('0xe'));var jsforce=require(_0xd55f('0xf'));var deskjs=require(_0xd55f('0x10'));var toCsv=require(_0xd55f('0x11'));var querystring=require(_0xd55f('0x12'));var Papa=require('papaparse');var Redis=require(_0xd55f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd55f('0x14'));var as=require(_0xd55f('0x15'));var hardwareService=require(_0xd55f('0x16'));var logger=require(_0xd55f('0x17'))(_0xd55f('0x18'));var utils=require(_0xd55f('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x542c48,_0x67fba1){_0x67fba1=_0x67fba1||0xcc;return function(_0x2ac4ce){if(_0x2ac4ce){return _0x542c48['sendStatus'](_0x67fba1);}return _0x542c48['status'](_0x67fba1)[_0xd55f('0x1a')]();};}function respondWithResult(_0x417fe3,_0x404c0d){_0x404c0d=_0x404c0d||0xc8;return function(_0x3ab11b){if(_0x3ab11b){return _0x417fe3[_0xd55f('0x1b')](_0x404c0d)[_0xd55f('0x1c')](_0x3ab11b);}};}function respondWithFilteredResult(_0xebd869,_0x129ed6){return function(_0x2806f4){if(_0x2806f4){var _0x7b06e=_0x2806f4[_0xd55f('0x1d')],_0x39f7b8=_0x129ed6['offset'],_0x3777c0=_0x129ed6[_0xd55f('0x1e')]+_0x129ed6[_0xd55f('0x1f')],_0x357f96;if(_0x3777c0>=_0x7b06e){_0x3777c0=_0x7b06e;_0x357f96=0xc8;}else{_0x357f96=0xce;}_0xebd869[_0xd55f('0x1b')](_0x357f96);return _0xebd869[_0xd55f('0x20')](_0xd55f('0x21'),_0x39f7b8+'-'+_0x3777c0+'/'+_0x7b06e)[_0xd55f('0x1c')](_0x2806f4);}return null;};}function patchUpdates(_0x2e1fc2){return function(_0x4bcb5e){try{jsonpatch[_0xd55f('0x22')](_0x4bcb5e,_0x2e1fc2,!![]);}catch(_0xd94153){return BPromise[_0xd55f('0x23')](_0xd94153);}return _0x4bcb5e['save']();};}function saveUpdates(_0x597997,_0x4c761b){return function(_0x5c90eb){if(_0x5c90eb){return _0x5c90eb[_0xd55f('0x24')](_0x597997)[_0xd55f('0x25')](function(_0x10c878){return _0x10c878;});}return null;};}function removeEntity(_0x45d725,_0x2a4a03){return function(_0x138b73){if(_0x138b73){return _0x138b73[_0xd55f('0x26')]()[_0xd55f('0x25')](function(){_0x45d725[_0xd55f('0x1b')](0xcc)[_0xd55f('0x1a')]();});}};}function handleEntityNotFound(_0x1684b1,_0x2dcd7d){return function(_0x5af2df){if(!_0x5af2df){_0x1684b1[_0xd55f('0x27')](0x194);}return _0x5af2df;};}function handleError(_0x36c9ac,_0x18902d){_0x18902d=_0x18902d||0x1f4;return function(_0x587434){logger[_0xd55f('0x28')](_0x587434[_0xd55f('0x29')]);if(_0x587434['name']){delete _0x587434[_0xd55f('0x2a')];}_0x36c9ac[_0xd55f('0x1b')](_0x18902d)[_0xd55f('0x2b')](_0x587434);};}exports[_0xd55f('0x2c')]=function(_0x49632c,_0x4c2afb){var _0xba1420={},_0x1d6f3b={},_0x427be8={'count':0x0,'rows':[]};var _0xd5ee0a=_[_0xd55f('0x2d')](db['MailServerOut'][_0xd55f('0x2e')],function(_0x20e697){return{'name':_0x20e697[_0xd55f('0x2f')],'type':_0x20e697[_0xd55f('0x30')][_0xd55f('0x31')]};});_0x1d6f3b[_0xd55f('0x32')]=_['map'](_0xd5ee0a,'name');_0x1d6f3b[_0xd55f('0x33')]=_[_0xd55f('0x34')](_0x49632c['query']);_0x1d6f3b[_0xd55f('0x35')]=_[_0xd55f('0x36')](_0x1d6f3b[_0xd55f('0x32')],_0x1d6f3b[_0xd55f('0x33')]);_0xba1420[_0xd55f('0x37')]=_[_0xd55f('0x36')](_0x1d6f3b[_0xd55f('0x32')],qs['fields'](_0x49632c['query']['fields']));_0xba1420[_0xd55f('0x37')]=_0xba1420[_0xd55f('0x37')]['length']?_0xba1420[_0xd55f('0x37')]:_0x1d6f3b[_0xd55f('0x32')];if(!_0x49632c['query'][_0xd55f('0x38')](_0xd55f('0x39'))){_0xba1420['limit']=qs[_0xd55f('0x1f')](_0x49632c['query'][_0xd55f('0x1f')]);_0xba1420[_0xd55f('0x1e')]=qs[_0xd55f('0x1e')](_0x49632c[_0xd55f('0x33')]['offset']);}_0xba1420[_0xd55f('0x3a')]=qs[_0xd55f('0x3b')](_0x49632c[_0xd55f('0x33')][_0xd55f('0x3b')]);_0xba1420[_0xd55f('0x3c')]=qs[_0xd55f('0x35')](_['pick'](_0x49632c['query'],_0x1d6f3b[_0xd55f('0x35')]));if(_0x49632c[_0xd55f('0x33')][_0xd55f('0x3d')]){_0xba1420[_0xd55f('0x3c')]=_[_0xd55f('0x3e')](_0xba1420[_0xd55f('0x3c')],{'$or':_[_0xd55f('0x2d')](_0xd5ee0a,function(_0x4d9e1b){if(_0x4d9e1b['type']!==_0xd55f('0x3f')){var _0x416871={};_0x416871[_0x4d9e1b[_0xd55f('0x2a')]]={'$like':'%'+_0x49632c[_0xd55f('0x33')][_0xd55f('0x3d')]+'%'};return _0x416871;}})});}_0xba1420=_[_0xd55f('0x3e')]({},_0xba1420,_0x49632c[_0xd55f('0x40')]);var _0x124ad4={'where':_0xba1420[_0xd55f('0x3c')]};return db[_0xd55f('0x41')]['count'](_0x124ad4)['then'](function(_0x7ef299){_0x427be8[_0xd55f('0x1d')]=_0x7ef299;if(_0x49632c[_0xd55f('0x33')][_0xd55f('0x42')]){_0xba1420['include']=[{'all':!![]}];}return db[_0xd55f('0x41')][_0xd55f('0x43')](_0xba1420);})[_0xd55f('0x25')](function(_0x2dde0b){_0x427be8[_0xd55f('0x44')]=_0x2dde0b;return _0x427be8;})[_0xd55f('0x25')](respondWithFilteredResult(_0x4c2afb,_0xba1420))['catch'](handleError(_0x4c2afb,null));};exports['show']=function(_0x112fa4,_0x24c7bb){var _0x550ac9={'raw':!![],'where':{'id':_0x112fa4[_0xd55f('0x45')]['id']}},_0x3714ef={};_0x3714ef[_0xd55f('0x32')]=_[_0xd55f('0x34')](db[_0xd55f('0x41')][_0xd55f('0x2e')]);_0x3714ef[_0xd55f('0x33')]=_[_0xd55f('0x34')](_0x112fa4[_0xd55f('0x33')]);_0x3714ef[_0xd55f('0x35')]=_['intersection'](_0x3714ef['model'],_0x3714ef[_0xd55f('0x33')]);_0x550ac9[_0xd55f('0x37')]=_[_0xd55f('0x36')](_0x3714ef[_0xd55f('0x32')],qs['fields'](_0x112fa4[_0xd55f('0x33')][_0xd55f('0x46')]));_0x550ac9[_0xd55f('0x37')]=_0x550ac9[_0xd55f('0x37')]['length']?_0x550ac9['attributes']:_0x3714ef[_0xd55f('0x32')];if(_0x112fa4[_0xd55f('0x33')][_0xd55f('0x42')]){_0x550ac9['include']=[{'all':!![]}];}_0x550ac9=_[_0xd55f('0x3e')]({},_0x550ac9,_0x112fa4[_0xd55f('0x40')]);return db['MailServerOut'][_0xd55f('0x47')](_0x550ac9)[_0xd55f('0x25')](handleEntityNotFound(_0x24c7bb,null))['then'](respondWithResult(_0x24c7bb,null))[_0xd55f('0x48')](handleError(_0x24c7bb,null));};exports[_0xd55f('0x49')]=function(_0x565007,_0x263d99){return db[_0xd55f('0x41')][_0xd55f('0x49')](_0x565007[_0xd55f('0x4a')],{})['then'](respondWithResult(_0x263d99,0xc9))[_0xd55f('0x48')](handleError(_0x263d99,null));};exports[_0xd55f('0x24')]=function(_0x1150eb,_0x5b45b7){if(_0x1150eb[_0xd55f('0x4a')]['id']){delete _0x1150eb[_0xd55f('0x4a')]['id'];}return db[_0xd55f('0x41')][_0xd55f('0x47')]({'where':{'id':_0x1150eb[_0xd55f('0x45')]['id']}})[_0xd55f('0x25')](handleEntityNotFound(_0x5b45b7,null))[_0xd55f('0x25')](saveUpdates(_0x1150eb[_0xd55f('0x4a')],null))[_0xd55f('0x25')](respondWithResult(_0x5b45b7,null))[_0xd55f('0x48')](handleError(_0x5b45b7,null));};exports[_0xd55f('0x26')]=function(_0x25d6d4,_0x337a2f){return db[_0xd55f('0x41')][_0xd55f('0x47')]({'where':{'id':_0x25d6d4['params']['id']}})[_0xd55f('0x25')](handleEntityNotFound(_0x337a2f,null))[_0xd55f('0x25')](removeEntity(_0x337a2f,null))[_0xd55f('0x48')](handleError(_0x337a2f,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 03ef39d..d618c68 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 _0x4819=['mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut'];(function(_0x50ebff,_0x134168){var _0x54a44c=function(_0x48bc63){while(--_0x48bc63){_0x50ebff['push'](_0x50ebff['shift']());}};_0x54a44c(++_0x134168);}(_0x4819,0xcd));var _0x9481=function(_0x1653b1,_0x35b7d1){_0x1653b1=_0x1653b1-0x0;var _0x3e0b17=_0x4819[_0x1653b1];return _0x3e0b17;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ef6=['exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes'];(function(_0x1d3470,_0x35887b){var _0x11805f=function(_0x3e2bbc){while(--_0x3e2bbc){_0x1d3470['push'](_0x1d3470['shift']());}};_0x11805f(++_0x35887b);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5013c4,_0x3ffb4c){_0x5013c4=_0x5013c4-0x0;var _0x4b7053=_0x8ef6[_0x5013c4];return _0x4b7053;};'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/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 16cea0d..b52a14f 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 _0xde94=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util'];(function(_0x39be78,_0x153915){var _0x119345=function(_0x1988fc){while(--_0x1988fc){_0x39be78['push'](_0x39be78['shift']());}};_0x119345(++_0x153915);}(_0xde94,0x18a));var _0x4de9=function(_0x2b9378,_0x5b3e0b){_0x2b9378=_0x2b9378-0x0;var _0xd6a718=_0xde94[_0x2b9378];return _0xd6a718;};'use strict';var _=require(_0x4de9('0x0'));var util=require(_0x4de9('0x1'));var moment=require(_0x4de9('0x2'));var BPromise=require(_0x4de9('0x3'));var rs=require(_0x4de9('0x4'));var fs=require('fs');var Redis=require(_0x4de9('0x5'));var db=require(_0x4de9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4de9('0x7'))('rpc');var config=require(_0x4de9('0x8'));var jayson=require(_0x4de9('0x9'));var client=jayson[_0x4de9('0xa')][_0x4de9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a04de,_0x1771af,_0x41d1a2){return new BPromise(function(_0x7b2538,_0x5834c4){return client['request'](_0x5a04de,_0x41d1a2)['then'](function(_0x22539a){logger[_0x4de9('0xc')](_0x4de9('0xd'),_0x1771af,_0x4de9('0xe'));logger[_0x4de9('0xf')](_0x4de9('0x10'),_0x1771af,_0x4de9('0xe'),JSON[_0x4de9('0x11')](_0x22539a));if(_0x22539a['error']){if(_0x22539a['error'][_0x4de9('0x12')]===0x1f4){logger['error'](_0x4de9('0xd'),_0x1771af,_0x22539a[_0x4de9('0x13')][_0x4de9('0x14')]);return _0x5834c4(_0x22539a[_0x4de9('0x13')][_0x4de9('0x14')]);}logger[_0x4de9('0x13')](_0x4de9('0xd'),_0x1771af,_0x22539a['error'][_0x4de9('0x14')]);return _0x7b2538(_0x22539a['error'][_0x4de9('0x14')]);}else{logger[_0x4de9('0xc')](_0x4de9('0xd'),_0x1771af,_0x4de9('0xe'));_0x7b2538(_0x22539a[_0x4de9('0x15')][_0x4de9('0x14')]);}})['catch'](function(_0x2f29bf){logger[_0x4de9('0x13')](_0x4de9('0xd'),_0x1771af,_0x2f29bf);_0x5834c4(_0x2f29bf);});});} \ No newline at end of file +var _0xfeb0=['error','code','message','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','MailServerOut,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0x2aba8f,_0x1d3e90){var _0x477f87=function(_0x843339){while(--_0x843339){_0x2aba8f['push'](_0x2aba8f['shift']());}};_0x477f87(++_0x1d3e90);}(_0xfeb0,0x76));var _0x0feb=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0xfeb0[_0x366388];return _0x41c97e;};'use strict';var _=require(_0x0feb('0x0'));var util=require(_0x0feb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0feb('0x2'));var db=require(_0x0feb('0x3'))['db'];var utils=require(_0x0feb('0x4'));var logger=require(_0x0feb('0x5'))(_0x0feb('0x6'));var config=require('../../config/environment');var jayson=require(_0x0feb('0x7'));var client=jayson[_0x0feb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ea269,_0xef431e,_0xb54c61){return new BPromise(function(_0x1ccc96,_0x2c2961){return client['request'](_0x1ea269,_0xb54c61)[_0x0feb('0x9')](function(_0x3e9aef){logger[_0x0feb('0xa')](_0x0feb('0xb'),_0xef431e,'request\x20sent');logger[_0x0feb('0xc')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0xef431e,_0x0feb('0xd'),JSON[_0x0feb('0xe')](_0x3e9aef));if(_0x3e9aef[_0x0feb('0xf')]){if(_0x3e9aef[_0x0feb('0xf')][_0x0feb('0x10')]===0x1f4){logger[_0x0feb('0xf')](_0x0feb('0xb'),_0xef431e,_0x3e9aef['error']['message']);return _0x2c2961(_0x3e9aef['error'][_0x0feb('0x11')]);}logger[_0x0feb('0xf')](_0x0feb('0xb'),_0xef431e,_0x3e9aef['error'][_0x0feb('0x11')]);return _0x1ccc96(_0x3e9aef[_0x0feb('0xf')][_0x0feb('0x11')]);}else{logger[_0x0feb('0xa')](_0x0feb('0xb'),_0xef431e,'request\x20sent');_0x1ccc96(_0x3e9aef['result'][_0x0feb('0x11')]);}})[_0x0feb('0x12')](function(_0x173cf4){logger[_0x0feb('0xf')](_0x0feb('0xb'),_0xef431e,_0x173cf4);_0x2c2961(_0x173cf4);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 012ea3d..fd34df9 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 _0xbeaa=['index','/describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated'];(function(_0x2e6d27,_0x3e8ab8){var _0x10dbe3=function(_0x3cd306){while(--_0x3cd306){_0x2e6d27['push'](_0x2e6d27['shift']());}};_0x10dbe3(++_0x3e8ab8);}(_0xbeaa,0x12f));var _0xabea=function(_0x2f1fc4,_0x37f9f2){_0x2f1fc4=_0x2f1fc4-0x0;var _0x10ed8e=_0xbeaa[_0x2f1fc4];return _0x10ed8e;};'use strict';var multer=require(_0xabea('0x0'));var util=require(_0xabea('0x1'));var path=require(_0xabea('0x2'));var timeout=require(_0xabea('0x3'));var express=require(_0xabea('0x4'));var router=express[_0xabea('0x5')]();var auth=require(_0xabea('0x6'));var interaction=require(_0xabea('0x7'));var config=require(_0xabea('0x8'));var controller=require(_0xabea('0x9'));router[_0xabea('0xa')]('/',auth[_0xabea('0xb')](),controller[_0xabea('0xc')]);router[_0xabea('0xa')](_0xabea('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xabea('0xe'),auth[_0xabea('0xb')](),controller[_0xabea('0xf')]);router[_0xabea('0x10')]('/',auth[_0xabea('0xb')](),controller[_0xabea('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xabea('0x12')](_0xabea('0xe'),auth[_0xabea('0xb')](),controller[_0xabea('0x13')]);module[_0xabea('0x14')]=router; \ No newline at end of file +var _0xbd12=['/describe','describe','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index'];(function(_0x45af6f,_0x5b39bc){var _0x134a54=function(_0x5071fd){while(--_0x5071fd){_0x45af6f['push'](_0x45af6f['shift']());}};_0x134a54(++_0x5b39bc);}(_0xbd12,0x196));var _0x2bd1=function(_0xc88f0c,_0x4a406b){_0xc88f0c=_0xc88f0c-0x0;var _0x5281f4=_0xbd12[_0xc88f0c];return _0x5281f4;};'use strict';var multer=require(_0x2bd1('0x0'));var util=require(_0x2bd1('0x1'));var path=require(_0x2bd1('0x2'));var timeout=require('connect-timeout');var express=require(_0x2bd1('0x3'));var router=express[_0x2bd1('0x4')]();var auth=require(_0x2bd1('0x5'));var interaction=require(_0x2bd1('0x6'));var config=require(_0x2bd1('0x7'));var controller=require(_0x2bd1('0x8'));router[_0x2bd1('0x9')]('/',auth[_0x2bd1('0xa')](),controller[_0x2bd1('0xb')]);router[_0x2bd1('0x9')](_0x2bd1('0xc'),auth['isAuthenticated'](),controller[_0x2bd1('0xd')]);router[_0x2bd1('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x2bd1('0xe')]);router[_0x2bd1('0xf')]('/',auth['isAuthenticated'](),controller[_0x2bd1('0x10')]);router[_0x2bd1('0x11')](_0x2bd1('0x12'),auth[_0x2bd1('0xa')](),controller['update']);router[_0x2bd1('0x13')](_0x2bd1('0x12'),auth[_0x2bd1('0xa')](),controller[_0x2bd1('0x14')]);module[_0x2bd1('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 0cf42f1..a8334c0 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 _0xff01=['sequelize','exports','name'];(function(_0x167ac8,_0x244397){var _0x1aa12c=function(_0x39e035){while(--_0x39e035){_0x167ac8['push'](_0x167ac8['shift']());}};_0x1aa12c(++_0x244397);}(_0xff01,0xb7));var _0x1ff0=function(_0x2a19da,_0x3f33fd){_0x2a19da=_0x2a19da-0x0;var _0x469571=_0xff01[_0x2a19da];return _0x469571;};'use strict';var Sequelize=require(_0x1ff0('0x0'));module[_0x1ff0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1ff0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x86dc=['sequelize','name','STRING'];(function(_0x328545,_0x140881){var _0x5a7526=function(_0x52b48e){while(--_0x52b48e){_0x328545['push'](_0x328545['shift']());}};_0x5a7526(++_0x140881);}(_0x86dc,0x13e));var _0xc86d=function(_0x4569bc,_0x45504d){_0x4569bc=_0x4569bc-0x0;var _0x865a5c=_0x86dc[_0x4569bc];return _0x865a5c;};'use strict';var Sequelize=require(_0xc86d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xc86d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc86d('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d917f8e..f504d29 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 _0x8958=['include','findAll','catch','length','options','find','create','body','params','destroy','describe','eml-format','moment','mustache','util','path','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','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','error','name','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','MailSubstatus','includeAll'];(function(_0x3c7340,_0x103b9c){var _0x2ae248=function(_0x34f846){while(--_0x34f846){_0x3c7340['push'](_0x3c7340['shift']());}};_0x2ae248(++_0x103b9c);}(_0x8958,0x93));var _0x8895=function(_0x1854ba,_0x33a502){_0x1854ba=_0x1854ba-0x0;var _0x284de4=_0x8958[_0x1854ba];return _0x284de4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8895('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8895('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x8895('0x2'));var util=require(_0x8895('0x3'));var path=require(_0x8895('0x4'));var sox=require('sox');var csv=require(_0x8895('0x5'));var ejs=require(_0x8895('0x6'));var fs=require('fs');var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0x5'));var querystring=require(_0x8895('0xb'));var Papa=require(_0x8895('0xc'));var Redis=require(_0x8895('0xd'));var authService=require(_0x8895('0xe'));var qs=require(_0x8895('0xf'));var as=require(_0x8895('0x10'));var hardwareService=require(_0x8895('0x11'));var logger=require(_0x8895('0x12'))('api');var utils=require(_0x8895('0x13'));var config=require(_0x8895('0x14'));var db=require(_0x8895('0x15'))['db'];function respondWithStatusCode(_0x301bec,_0x446e1a){_0x446e1a=_0x446e1a||0xcc;return function(_0xaf93bc){if(_0xaf93bc){return _0x301bec['sendStatus'](_0x446e1a);}return _0x301bec[_0x8895('0x16')](_0x446e1a)[_0x8895('0x17')]();};}function respondWithResult(_0x56c18e,_0x57d40a){_0x57d40a=_0x57d40a||0xc8;return function(_0x47b9fe){if(_0x47b9fe){return _0x56c18e[_0x8895('0x16')](_0x57d40a)['json'](_0x47b9fe);}};}function respondWithFilteredResult(_0x4156f5,_0x337101){return function(_0x195789){if(_0x195789){var _0x3d7b59=_0x195789[_0x8895('0x18')],_0x2c9d40=_0x337101[_0x8895('0x19')],_0x5b4c2e=_0x337101[_0x8895('0x19')]+_0x337101[_0x8895('0x1a')],_0x4128e2;if(_0x5b4c2e>=_0x3d7b59){_0x5b4c2e=_0x3d7b59;_0x4128e2=0xc8;}else{_0x4128e2=0xce;}_0x4156f5[_0x8895('0x16')](_0x4128e2);return _0x4156f5[_0x8895('0x1b')](_0x8895('0x1c'),_0x2c9d40+'-'+_0x5b4c2e+'/'+_0x3d7b59)[_0x8895('0x1d')](_0x195789);}return null;};}function patchUpdates(_0x2da618){return function(_0x24fef0){try{jsonpatch[_0x8895('0x1e')](_0x24fef0,_0x2da618,!![]);}catch(_0x2df795){return BPromise['reject'](_0x2df795);}return _0x24fef0['save']();};}function saveUpdates(_0x4fcbc3,_0x3daf43){return function(_0x456282){if(_0x456282){return _0x456282[_0x8895('0x1f')](_0x4fcbc3)[_0x8895('0x20')](function(_0x3f7d5a){return _0x3f7d5a;});}return null;};}function removeEntity(_0x35bda5,_0x461346){return function(_0xc1ce17){if(_0xc1ce17){return _0xc1ce17['destroy']()[_0x8895('0x20')](function(){_0x35bda5[_0x8895('0x16')](0xcc)[_0x8895('0x17')]();});}};}function handleEntityNotFound(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(!_0x4d092d){_0x1f71f3['sendStatus'](0x194);}return _0x4d092d;};}function handleError(_0x278c81,_0x398382){_0x398382=_0x398382||0x1f4;return function(_0x38f7ad){logger[_0x8895('0x21')](_0x38f7ad['stack']);if(_0x38f7ad[_0x8895('0x22')]){delete _0x38f7ad[_0x8895('0x22')];}_0x278c81[_0x8895('0x16')](_0x398382)['send'](_0x38f7ad);};}exports['index']=function(_0x78b57,_0x555e60){var _0x3d51b0={},_0x3e3b48={},_0x10b48f={'count':0x0,'rows':[]};var _0xf5fb66=_[_0x8895('0x23')](db['MailSubstatus']['rawAttributes'],function(_0x6e449d){return{'name':_0x6e449d[_0x8895('0x24')],'type':_0x6e449d[_0x8895('0x25')][_0x8895('0x26')]};});_0x3e3b48[_0x8895('0x27')]=_['map'](_0xf5fb66,'name');_0x3e3b48[_0x8895('0x28')]=_[_0x8895('0x29')](_0x78b57[_0x8895('0x28')]);_0x3e3b48[_0x8895('0x2a')]=_[_0x8895('0x2b')](_0x3e3b48['model'],_0x3e3b48[_0x8895('0x28')]);_0x3d51b0['attributes']=_[_0x8895('0x2b')](_0x3e3b48['model'],qs[_0x8895('0x2c')](_0x78b57[_0x8895('0x28')][_0x8895('0x2c')]));_0x3d51b0[_0x8895('0x2d')]=_0x3d51b0[_0x8895('0x2d')]['length']?_0x3d51b0[_0x8895('0x2d')]:_0x3e3b48[_0x8895('0x27')];if(!_0x78b57[_0x8895('0x28')][_0x8895('0x2e')](_0x8895('0x2f'))){_0x3d51b0['limit']=qs[_0x8895('0x1a')](_0x78b57['query'][_0x8895('0x1a')]);_0x3d51b0['offset']=qs[_0x8895('0x19')](_0x78b57[_0x8895('0x28')][_0x8895('0x19')]);}_0x3d51b0[_0x8895('0x30')]=qs[_0x8895('0x31')](_0x78b57['query'][_0x8895('0x31')]);_0x3d51b0['where']=qs[_0x8895('0x2a')](_[_0x8895('0x32')](_0x78b57[_0x8895('0x28')],_0x3e3b48[_0x8895('0x2a')]));if(_0x78b57[_0x8895('0x28')][_0x8895('0x33')]){_0x3d51b0['where']=_[_0x8895('0x34')](_0x3d51b0[_0x8895('0x35')],{'$or':_['map'](_0xf5fb66,function(_0x2557fc){if(_0x2557fc['type']!==_0x8895('0x36')){var _0x332a79={};_0x332a79[_0x2557fc['name']]={'$like':'%'+_0x78b57[_0x8895('0x28')][_0x8895('0x33')]+'%'};return _0x332a79;}})});}_0x3d51b0=_['merge']({},_0x3d51b0,_0x78b57['options']);var _0x202130={'where':_0x3d51b0[_0x8895('0x35')]};return db[_0x8895('0x37')][_0x8895('0x18')](_0x202130)[_0x8895('0x20')](function(_0x4917d1){_0x10b48f[_0x8895('0x18')]=_0x4917d1;if(_0x78b57[_0x8895('0x28')][_0x8895('0x38')]){_0x3d51b0[_0x8895('0x39')]=[{'all':!![]}];}return db[_0x8895('0x37')][_0x8895('0x3a')](_0x3d51b0);})['then'](function(_0x174be1){_0x10b48f['rows']=_0x174be1;return _0x10b48f;})[_0x8895('0x20')](respondWithFilteredResult(_0x555e60,_0x3d51b0))[_0x8895('0x3b')](handleError(_0x555e60,null));};exports['show']=function(_0x1ca234,_0x4e8fbc){var _0x1e6395={'raw':!![],'where':{'id':_0x1ca234['params']['id']}},_0x5e6413={};_0x5e6413['model']=_['keys'](db['MailSubstatus']['rawAttributes']);_0x5e6413[_0x8895('0x28')]=_[_0x8895('0x29')](_0x1ca234['query']);_0x5e6413['filters']=_[_0x8895('0x2b')](_0x5e6413[_0x8895('0x27')],_0x5e6413['query']);_0x1e6395[_0x8895('0x2d')]=_[_0x8895('0x2b')](_0x5e6413[_0x8895('0x27')],qs[_0x8895('0x2c')](_0x1ca234[_0x8895('0x28')]['fields']));_0x1e6395['attributes']=_0x1e6395['attributes'][_0x8895('0x3c')]?_0x1e6395['attributes']:_0x5e6413[_0x8895('0x27')];if(_0x1ca234[_0x8895('0x28')][_0x8895('0x38')]){_0x1e6395[_0x8895('0x39')]=[{'all':!![]}];}_0x1e6395=_['merge']({},_0x1e6395,_0x1ca234[_0x8895('0x3d')]);return db[_0x8895('0x37')][_0x8895('0x3e')](_0x1e6395)[_0x8895('0x20')](handleEntityNotFound(_0x4e8fbc,null))[_0x8895('0x20')](respondWithResult(_0x4e8fbc,null))[_0x8895('0x3b')](handleError(_0x4e8fbc,null));};exports[_0x8895('0x3f')]=function(_0x34e91e,_0x55fb78){return db[_0x8895('0x37')][_0x8895('0x3f')](_0x34e91e['body'],{})[_0x8895('0x20')](respondWithResult(_0x55fb78,0xc9))['catch'](handleError(_0x55fb78,null));};exports['update']=function(_0x13546d,_0x337a9f){if(_0x13546d[_0x8895('0x40')]['id']){delete _0x13546d['body']['id'];}return db[_0x8895('0x37')]['find']({'where':{'id':_0x13546d[_0x8895('0x41')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x337a9f,null))[_0x8895('0x20')](saveUpdates(_0x13546d[_0x8895('0x40')],null))[_0x8895('0x20')](respondWithResult(_0x337a9f,null))[_0x8895('0x3b')](handleError(_0x337a9f,null));};exports[_0x8895('0x42')]=function(_0x4dde7c,_0x47c4b9){return db[_0x8895('0x37')][_0x8895('0x3e')]({'where':{'id':_0x4dde7c['params']['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x47c4b9,null))['then'](removeEntity(_0x47c4b9,null))['catch'](handleError(_0x47c4b9,null));};exports[_0x8895('0x43')]=function(_0x4d52ac,_0x130203){return db[_0x8895('0x37')][_0x8895('0x43')]()[_0x8895('0x20')](respondWithResult(_0x130203,null))[_0x8895('0x3b')](handleError(_0x130203,null));}; \ No newline at end of file +var _0x2bd8=['fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','params','keys','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailSubstatus','rawAttributes'];(function(_0x3d6490,_0x19bd7c){var _0x7a2812=function(_0x1a13b5){while(--_0x1a13b5){_0x3d6490['push'](_0x3d6490['shift']());}};_0x7a2812(++_0x19bd7c);}(_0x2bd8,0x130));var _0x82bd=function(_0xf65b18,_0x42fbd9){_0xf65b18=_0xf65b18-0x0;var _0x40113f=_0x2bd8[_0xf65b18];return _0x40113f;};'use strict';var pdf=require(_0x82bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82bd('0x1'));var zipdir=require(_0x82bd('0x2'));var jsonpatch=require(_0x82bd('0x3'));var rp=require(_0x82bd('0x4'));var moment=require(_0x82bd('0x5'));var BPromise=require(_0x82bd('0x6'));var Mustache=require(_0x82bd('0x7'));var util=require('util');var path=require(_0x82bd('0x8'));var sox=require(_0x82bd('0x9'));var csv=require(_0x82bd('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x140ad6,_0x5f1ab9){_0x5f1ab9=_0x5f1ab9||0xcc;return function(_0xfaccf7){if(_0xfaccf7){return _0x140ad6['sendStatus'](_0x5f1ab9);}return _0x140ad6[_0x82bd('0x13')](_0x5f1ab9)[_0x82bd('0x14')]();};}function respondWithResult(_0x1b2324,_0x2ca530){_0x2ca530=_0x2ca530||0xc8;return function(_0x58d82b){if(_0x58d82b){return _0x1b2324[_0x82bd('0x13')](_0x2ca530)[_0x82bd('0x15')](_0x58d82b);}};}function respondWithFilteredResult(_0x52e533,_0x3667ef){return function(_0x4db39d){if(_0x4db39d){var _0x35dd09=_0x4db39d[_0x82bd('0x16')],_0x433e7d=_0x3667ef[_0x82bd('0x17')],_0x2c5155=_0x3667ef[_0x82bd('0x17')]+_0x3667ef[_0x82bd('0x18')],_0x300982;if(_0x2c5155>=_0x35dd09){_0x2c5155=_0x35dd09;_0x300982=0xc8;}else{_0x300982=0xce;}_0x52e533[_0x82bd('0x13')](_0x300982);return _0x52e533[_0x82bd('0x19')](_0x82bd('0x1a'),_0x433e7d+'-'+_0x2c5155+'/'+_0x35dd09)[_0x82bd('0x15')](_0x4db39d);}return null;};}function patchUpdates(_0x1c3779){return function(_0x253741){try{jsonpatch['apply'](_0x253741,_0x1c3779,!![]);}catch(_0x5688ed){return BPromise[_0x82bd('0x1b')](_0x5688ed);}return _0x253741[_0x82bd('0x1c')]();};}function saveUpdates(_0x2ee27c,_0xc9fcdf){return function(_0x34899b){if(_0x34899b){return _0x34899b[_0x82bd('0x1d')](_0x2ee27c)[_0x82bd('0x1e')](function(_0x32954d){return _0x32954d;});}return null;};}function removeEntity(_0x1fc715,_0x3291cd){return function(_0x2caa29){if(_0x2caa29){return _0x2caa29[_0x82bd('0x1f')]()[_0x82bd('0x1e')](function(){_0x1fc715[_0x82bd('0x13')](0xcc)[_0x82bd('0x14')]();});}};}function handleEntityNotFound(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(!_0x3b6b93){_0x2d9d95[_0x82bd('0x20')](0x194);}return _0x3b6b93;};}function handleError(_0x547e45,_0x4b3215){_0x4b3215=_0x4b3215||0x1f4;return function(_0x4248be){logger[_0x82bd('0x21')](_0x4248be[_0x82bd('0x22')]);if(_0x4248be[_0x82bd('0x23')]){delete _0x4248be[_0x82bd('0x23')];}_0x547e45[_0x82bd('0x13')](_0x4b3215)[_0x82bd('0x24')](_0x4248be);};}exports[_0x82bd('0x25')]=function(_0x2f0bb6,_0x2add80){var _0x53a2a6={},_0x5bd22f={},_0x5609b7={'count':0x0,'rows':[]};var _0x5d1015=_[_0x82bd('0x26')](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x190bca){return{'name':_0x190bca[_0x82bd('0x29')],'type':_0x190bca['type']['key']};});_0x5bd22f['model']=_[_0x82bd('0x26')](_0x5d1015,_0x82bd('0x23'));_0x5bd22f[_0x82bd('0x2a')]=_['keys'](_0x2f0bb6[_0x82bd('0x2a')]);_0x5bd22f['filters']=_[_0x82bd('0x2b')](_0x5bd22f[_0x82bd('0x2c')],_0x5bd22f[_0x82bd('0x2a')]);_0x53a2a6[_0x82bd('0x2d')]=_[_0x82bd('0x2b')](_0x5bd22f[_0x82bd('0x2c')],qs['fields'](_0x2f0bb6[_0x82bd('0x2a')][_0x82bd('0x2e')]));_0x53a2a6[_0x82bd('0x2d')]=_0x53a2a6['attributes'][_0x82bd('0x2f')]?_0x53a2a6['attributes']:_0x5bd22f['model'];if(!_0x2f0bb6[_0x82bd('0x2a')][_0x82bd('0x30')](_0x82bd('0x31'))){_0x53a2a6[_0x82bd('0x18')]=qs[_0x82bd('0x18')](_0x2f0bb6[_0x82bd('0x2a')][_0x82bd('0x18')]);_0x53a2a6[_0x82bd('0x17')]=qs[_0x82bd('0x17')](_0x2f0bb6[_0x82bd('0x2a')][_0x82bd('0x17')]);}_0x53a2a6[_0x82bd('0x32')]=qs[_0x82bd('0x33')](_0x2f0bb6[_0x82bd('0x2a')][_0x82bd('0x33')]);_0x53a2a6[_0x82bd('0x34')]=qs[_0x82bd('0x35')](_['pick'](_0x2f0bb6['query'],_0x5bd22f['filters']));if(_0x2f0bb6[_0x82bd('0x2a')][_0x82bd('0x36')]){_0x53a2a6['where']=_[_0x82bd('0x37')](_0x53a2a6['where'],{'$or':_['map'](_0x5d1015,function(_0x4c5f8d){if(_0x4c5f8d[_0x82bd('0x38')]!==_0x82bd('0x39')){var _0x28e521={};_0x28e521[_0x4c5f8d[_0x82bd('0x23')]]={'$like':'%'+_0x2f0bb6[_0x82bd('0x2a')]['filter']+'%'};return _0x28e521;}})});}_0x53a2a6=_['merge']({},_0x53a2a6,_0x2f0bb6['options']);var _0x64bc54={'where':_0x53a2a6['where']};return db['MailSubstatus'][_0x82bd('0x16')](_0x64bc54)[_0x82bd('0x1e')](function(_0x3192e2){_0x5609b7[_0x82bd('0x16')]=_0x3192e2;if(_0x2f0bb6[_0x82bd('0x2a')][_0x82bd('0x3a')]){_0x53a2a6[_0x82bd('0x3b')]=[{'all':!![]}];}return db[_0x82bd('0x27')][_0x82bd('0x3c')](_0x53a2a6);})['then'](function(_0x5c7661){_0x5609b7[_0x82bd('0x3d')]=_0x5c7661;return _0x5609b7;})[_0x82bd('0x1e')](respondWithFilteredResult(_0x2add80,_0x53a2a6))['catch'](handleError(_0x2add80,null));};exports['show']=function(_0x277b7a,_0x18a697){var _0x4d310b={'raw':!![],'where':{'id':_0x277b7a[_0x82bd('0x3e')]['id']}},_0x121f1f={};_0x121f1f[_0x82bd('0x2c')]=_[_0x82bd('0x3f')](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x121f1f[_0x82bd('0x2a')]=_[_0x82bd('0x3f')](_0x277b7a[_0x82bd('0x2a')]);_0x121f1f[_0x82bd('0x35')]=_[_0x82bd('0x2b')](_0x121f1f[_0x82bd('0x2c')],_0x121f1f['query']);_0x4d310b[_0x82bd('0x2d')]=_[_0x82bd('0x2b')](_0x121f1f['model'],qs['fields'](_0x277b7a[_0x82bd('0x2a')][_0x82bd('0x2e')]));_0x4d310b[_0x82bd('0x2d')]=_0x4d310b[_0x82bd('0x2d')][_0x82bd('0x2f')]?_0x4d310b['attributes']:_0x121f1f['model'];if(_0x277b7a[_0x82bd('0x2a')][_0x82bd('0x3a')]){_0x4d310b['include']=[{'all':!![]}];}_0x4d310b=_[_0x82bd('0x37')]({},_0x4d310b,_0x277b7a['options']);return db[_0x82bd('0x27')][_0x82bd('0x40')](_0x4d310b)['then'](handleEntityNotFound(_0x18a697,null))[_0x82bd('0x1e')](respondWithResult(_0x18a697,null))[_0x82bd('0x41')](handleError(_0x18a697,null));};exports['create']=function(_0x498824,_0x403afe){return db['MailSubstatus'][_0x82bd('0x42')](_0x498824[_0x82bd('0x43')],{})[_0x82bd('0x1e')](respondWithResult(_0x403afe,0xc9))[_0x82bd('0x41')](handleError(_0x403afe,null));};exports['update']=function(_0x53fd25,_0x1852f2){if(_0x53fd25[_0x82bd('0x43')]['id']){delete _0x53fd25['body']['id'];}return db[_0x82bd('0x27')][_0x82bd('0x40')]({'where':{'id':_0x53fd25[_0x82bd('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1852f2,null))[_0x82bd('0x1e')](saveUpdates(_0x53fd25[_0x82bd('0x43')],null))[_0x82bd('0x1e')](respondWithResult(_0x1852f2,null))[_0x82bd('0x41')](handleError(_0x1852f2,null));};exports[_0x82bd('0x1f')]=function(_0x2c2cb9,_0x2e97c3){return db[_0x82bd('0x27')][_0x82bd('0x40')]({'where':{'id':_0x2c2cb9[_0x82bd('0x3e')]['id']}})[_0x82bd('0x1e')](handleEntityNotFound(_0x2e97c3,null))[_0x82bd('0x1e')](removeEntity(_0x2e97c3,null))[_0x82bd('0x41')](handleError(_0x2e97c3,null));};exports['describe']=function(_0x63a2a0,_0x3ecab7){return db['MailSubstatus'][_0x82bd('0x44')]()[_0x82bd('0x1e')](respondWithResult(_0x3ecab7,null))[_0x82bd('0x41')](handleError(_0x3ecab7,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index a191873..1b0c601 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 _0x8383=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','api','moment','bluebird'];(function(_0x379469,_0x2eef1a){var _0x3c7003=function(_0x1d17d6){while(--_0x1d17d6){_0x379469['push'](_0x379469['shift']());}};_0x3c7003(++_0x2eef1a);}(_0x8383,0x98));var _0x3838=function(_0x561c3f,_0x57c9a9){_0x561c3f=_0x561c3f-0x0;var _0x494061=_0x8383[_0x561c3f];return _0x494061;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3838('0x1'));var moment=require(_0x3838('0x2'));var BPromise=require(_0x3838('0x3'));var rp=require(_0x3838('0x4'));var fs=require('fs');var path=require(_0x3838('0x5'));var rimraf=require(_0x3838('0x6'));var config=require(_0x3838('0x7'));var attributes=require(_0x3838('0x8'));module[_0x3838('0x9')]=function(_0x7a4cc0,_0x509656){return _0x7a4cc0[_0x3838('0xa')](_0x3838('0xb'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','define','MailSubstatus','mail_substatuses','lodash'];(function(_0x443b8c,_0x284994){var _0x1b30a7=function(_0x3b6769){while(--_0x3b6769){_0x443b8c['push'](_0x443b8c['shift']());}};_0x1b30a7(++_0x284994);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x1a7846,_0x59723e){_0x1a7846=_0x1a7846-0x0;var _0x48049=_0xf2e3[_0x1a7846];return _0x48049;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));module['exports']=function(_0x33a3b7,_0xdd6b3e){return _0x33a3b7[_0x3f2e('0xa')](_0x3f2e('0xb'),attributes,{'tableName':_0x3f2e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index e2bb265..e326a46 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 _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c997d,_0x588a83){var _0x28de12=function(_0x3505b1){while(--_0x3505b1){_0x4c997d['push'](_0x4c997d['shift']());}};_0x28de12(++_0x588a83);}(_0xaa88,0x137));var _0x8aa8=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xaa88[_0x28394f];return _0x2618d2;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var moment=require(_0x8aa8('0x2'));var BPromise=require(_0x8aa8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8aa8('0x4'));var db=require(_0x8aa8('0x5'))['db'];var utils=require(_0x8aa8('0x6'));var logger=require(_0x8aa8('0x7'))(_0x8aa8('0x8'));var config=require(_0x8aa8('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8aa8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5264ff,_0x449d2d,_0x1ed84d){return new BPromise(function(_0x27c08d,_0x40826f){return client['request'](_0x5264ff,_0x1ed84d)[_0x8aa8('0xb')](function(_0x2d974c){logger[_0x8aa8('0xc')]('MailSubstatus,\x20%s,\x20%s',_0x449d2d,_0x8aa8('0xd'));logger[_0x8aa8('0xe')](_0x8aa8('0xf'),_0x449d2d,_0x8aa8('0xd'),JSON['stringify'](_0x2d974c));if(_0x2d974c[_0x8aa8('0x10')]){if(_0x2d974c[_0x8aa8('0x10')]['code']===0x1f4){logger[_0x8aa8('0x10')](_0x8aa8('0x11'),_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x40826f(_0x2d974c[_0x8aa8('0x10')][_0x8aa8('0x12')]);}logger[_0x8aa8('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x449d2d,_0x2d974c[_0x8aa8('0x10')]['message']);return _0x27c08d(_0x2d974c['error'][_0x8aa8('0x12')]);}else{logger[_0x8aa8('0xc')](_0x8aa8('0x11'),_0x449d2d,_0x8aa8('0xd'));_0x27c08d(_0x2d974c[_0x8aa8('0x13')][_0x8aa8('0x12')]);}})[_0x8aa8('0x14')](function(_0xd59fb8){logger[_0x8aa8('0x10')]('MailSubstatus,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file +var _0xdace=['request\x20sent','debug','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xdace,0xc5));var _0xedac=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xdace[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('MailSubstatus,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 407770b..6589dfa 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 _0x588e=['create','put','delete','destroy','multer','util','express','Router','../../components/auth/service','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x37a505,_0x319129){var _0x5d094e=function(_0x5b78ea){while(--_0x5b78ea){_0x37a505['push'](_0x37a505['shift']());}};_0x5d094e(++_0x319129);}(_0x588e,0xa4));var _0xe588=function(_0x28e4ec,_0x22f691){_0x28e4ec=_0x28e4ec-0x0;var _0x161a64=_0x588e[_0x28e4ec];return _0x161a64;};'use strict';var multer=require(_0xe588('0x0'));var util=require(_0xe588('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe588('0x2'));var router=express[_0xe588('0x3')]();var auth=require(_0xe588('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe588('0x5'));router['get']('/',auth[_0xe588('0x6')](),controller['index']);router[_0xe588('0x7')](_0xe588('0x8'),auth[_0xe588('0x6')](),controller[_0xe588('0x9')]);router[_0xe588('0x7')](_0xe588('0xa'),auth[_0xe588('0x6')](),controller[_0xe588('0xb')]);router['post']('/',auth[_0xe588('0x6')](),controller[_0xe588('0xc')]);router[_0xe588('0xd')](_0xe588('0xa'),auth[_0xe588('0x6')](),controller['update']);router[_0xe588('0xe')](_0xe588('0xa'),auth[_0xe588('0x6')](),controller[_0xe588('0xf')]);module['exports']=router; \ No newline at end of file +var _0xb97a=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1b80f5,_0x5c8d48){var _0x53016e=function(_0x419bc1){while(--_0x419bc1){_0x1b80f5['push'](_0x1b80f5['shift']());}};_0x53016e(++_0x5c8d48);}(_0xb97a,0x196));var _0xab97=function(_0x491899,_0x1f6873){_0x491899=_0x491899-0x0;var _0xfa7348=_0xb97a[_0x491899];return _0xfa7348;};'use strict';var multer=require(_0xab97('0x0'));var util=require(_0xab97('0x1'));var path=require(_0xab97('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xab97('0x3')]();var auth=require(_0xab97('0x4'));var interaction=require(_0xab97('0x5'));var config=require(_0xab97('0x6'));var controller=require(_0xab97('0x7'));router[_0xab97('0x8')]('/',auth[_0xab97('0x9')](),controller[_0xab97('0xa')]);router[_0xab97('0x8')](_0xab97('0xb'),auth['isAuthenticated'](),controller[_0xab97('0xc')]);router[_0xab97('0x8')](_0xab97('0xd'),auth[_0xab97('0x9')](),controller[_0xab97('0xe')]);router[_0xab97('0xf')]('/',auth[_0xab97('0x9')](),controller[_0xab97('0x10')]);router[_0xab97('0x11')](_0xab97('0xd'),auth[_0xab97('0x9')](),controller[_0xab97('0x12')]);router[_0xab97('0x13')](_0xab97('0xd'),auth[_0xab97('0x9')](),controller[_0xab97('0x14')]);module[_0xab97('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index eee8bca..568f837 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 _0xf9a0=['NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x1b3fd5,_0x2de315){var _0x1d3450=function(_0x3dfede){while(--_0x3dfede){_0x1b3fd5['push'](_0x1b3fd5['shift']());}};_0x1d3450(++_0x2de315);}(_0xf9a0,0x1eb));var _0x0f9a=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xf9a0[_0x1b3a5c];return _0x2ae8cb;};'use strict';var moment=require(_0x0f9a('0x0'));var Sequelize=require(_0x0f9a('0x1'));module[_0x0f9a('0x2')]={'uniqueid':{'type':Sequelize[_0x0f9a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0f9a('0x4')](_0x0f9a('0x5'),_0x0f9a('0x6'),_0x0f9a('0x7')),'allowNull':![],'defaultValue':_0x0f9a('0x7')},'transferredAt':{'type':Sequelize[_0x0f9a('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x0f9a('0x9')]}}; \ No newline at end of file +var _0xfe5a=['moment','sequelize','STRING','ENUM','account','NOW'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xfe5a,0x150));var _0xafe5=function(_0x31e7a2,_0x4d9422){_0x31e7a2=_0x31e7a2-0x0;var _0x299953=_0xfe5a[_0x31e7a2];return _0x299953;};'use strict';var moment=require(_0xafe5('0x0'));var Sequelize=require(_0xafe5('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xafe5('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xafe5('0x3')](_0xafe5('0x4'),'agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xafe5('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index f7e8e6c..f7195c6 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x29a045,_0x2f73e2){var _0x3b4afe=function(_0x4ebd9a){while(--_0x4ebd9a){_0x29a045['push'](_0x29a045['shift']());}};_0x3b4afe(++_0x2f73e2);}(_0x7a54,0x106));var _0x47a5=function(_0x1e9c2d,_0x4600c3){_0x1e9c2d=_0x1e9c2d-0x0;var _0x178d2e=_0x7a54[_0x1e9c2d];return _0x178d2e;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x472e50,_0x53edc6){var _0x34fbbe=function(_0x1dec62){while(--_0x1dec62){_0x472e50['push'](_0x472e50['shift']());}};_0x34fbbe(++_0x53edc6);}(_0x7a54,0x106));var _0x47a5=function(_0x19af66,_0x4b7134){_0x19af66=_0x19af66-0x0;var _0x322dcf=_0x7a54[_0x19af66];return _0x322dcf;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 95720ff..7cc094c 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 _0xb417=['MailTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xb417,0x198));var _0x7b41=function(_0x25044b,_0x536424){_0x25044b=_0x25044b-0x0;var _0x232519=_0xb417[_0x25044b];return _0x232519;};'use strict';var _=require(_0x7b41('0x0'));var util=require(_0x7b41('0x1'));var logger=require(_0x7b41('0x2'))(_0x7b41('0x3'));var moment=require(_0x7b41('0x4'));var BPromise=require(_0x7b41('0x5'));var rp=require(_0x7b41('0x6'));var fs=require('fs');var path=require(_0x7b41('0x7'));var rimraf=require(_0x7b41('0x8'));var config=require(_0x7b41('0x9'));var attributes=require(_0x7b41('0xa'));module[_0x7b41('0xb')]=function(_0x2423bc,_0x3d290a){return _0x2423bc['define'](_0x7b41('0xc'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x7b41('0xd'),'fields':[_0x7b41('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe9a2=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','MailTransferReport','uniqueid'];(function(_0xd9099d,_0x2f059d){var _0x13e7ac=function(_0x52b306){while(--_0x52b306){_0xd9099d['push'](_0xd9099d['shift']());}};_0x13e7ac(++_0x2f059d);}(_0xe9a2,0x15c));var _0x2e9a=function(_0x5b95aa,_0x35333b){_0x5b95aa=_0x5b95aa-0x0;var _0x1fefda=_0xe9a2[_0x5b95aa];return _0x1fefda;};'use strict';var _=require(_0x2e9a('0x0'));var util=require(_0x2e9a('0x1'));var logger=require('../../config/logger')(_0x2e9a('0x2'));var moment=require(_0x2e9a('0x3'));var BPromise=require(_0x2e9a('0x4'));var rp=require(_0x2e9a('0x5'));var fs=require('fs');var path=require(_0x2e9a('0x6'));var rimraf=require('rimraf');var config=require(_0x2e9a('0x7'));var attributes=require('./mailTransferReport.attributes');module[_0x2e9a('0x8')]=function(_0x294902,_0x45c9fb){return _0x294902[_0x2e9a('0x9')](_0x2e9a('0xa'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x2e9a('0xb'),'fields':[_0x2e9a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 3dfc66b..3e69e90 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 _0x9fdd=['then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x108413,_0x1ca51c){var _0x1d328d=function(_0x5785db){while(--_0x5785db){_0x108413['push'](_0x108413['shift']());}};_0x1d328d(++_0x1ca51c);}(_0x9fdd,0x155));var _0xd9fd=function(_0x1891cd,_0x215204){_0x1891cd=_0x1891cd-0x0;var _0x23089a=_0x9fdd[_0x1891cd];return _0x23089a;};'use strict';var _=require(_0xd9fd('0x0'));var util=require(_0xd9fd('0x1'));var moment=require(_0xd9fd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9fd('0x3'));var db=require(_0xd9fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9fd('0x5'))(_0xd9fd('0x6'));var config=require(_0xd9fd('0x7'));var jayson=require(_0xd9fd('0x8'));var client=jayson['client'][_0xd9fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bcc14,_0x44455e,_0x1902ce){return new BPromise(function(_0xc997,_0x52cb5e){return client[_0xd9fd('0xa')](_0x5bcc14,_0x1902ce)[_0xd9fd('0xb')](function(_0x563941){logger[_0xd9fd('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x44455e,_0xd9fd('0xd'));logger[_0xd9fd('0xe')](_0xd9fd('0xf'),_0x44455e,_0xd9fd('0xd'),JSON[_0xd9fd('0x10')](_0x563941));if(_0x563941['error']){if(_0x563941['error'][_0xd9fd('0x11')]===0x1f4){logger[_0xd9fd('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x44455e,_0x563941['error'][_0xd9fd('0x13')]);return _0x52cb5e(_0x563941[_0xd9fd('0x12')][_0xd9fd('0x13')]);}logger['error'](_0xd9fd('0x14'),_0x44455e,_0x563941['error'][_0xd9fd('0x13')]);return _0xc997(_0x563941[_0xd9fd('0x12')]['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x44455e,_0xd9fd('0xd'));_0xc997(_0x563941['result'][_0xd9fd('0x13')]);}})[_0xd9fd('0x15')](function(_0x3ca5ad){logger[_0xd9fd('0x12')](_0xd9fd('0x14'),_0x44455e,_0x3ca5ad);_0x52cb5e(_0x3ca5ad);});});} \ No newline at end of file +var _0x048d=['MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug'];(function(_0x5800bf,_0x25f7cd){var _0x552f6e=function(_0x5de700){while(--_0x5de700){_0x5800bf['push'](_0x5800bf['shift']());}};_0x552f6e(++_0x25f7cd);}(_0x048d,0x1d6));var _0xd048=function(_0x230bd1,_0x5a2e9a){_0x230bd1=_0x230bd1-0x0;var _0x526919=_0x048d[_0x230bd1];return _0x526919;};'use strict';var _=require('lodash');var util=require(_0xd048('0x0'));var moment=require('moment');var BPromise=require(_0xd048('0x1'));var rs=require(_0xd048('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd048('0x3'))['db'];var utils=require(_0xd048('0x4'));var logger=require(_0xd048('0x5'))(_0xd048('0x6'));var config=require(_0xd048('0x7'));var jayson=require(_0xd048('0x8'));var client=jayson['client'][_0xd048('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1876b4,_0x58f4cb,_0x313258){return new BPromise(function(_0x4d7727,_0x1025e9){return client[_0xd048('0xa')](_0x1876b4,_0x313258)[_0xd048('0xb')](function(_0x5f4cb5){logger[_0xd048('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x58f4cb,'request\x20sent');logger[_0xd048('0xd')](_0xd048('0xe'),_0x58f4cb,_0xd048('0xf'),JSON[_0xd048('0x10')](_0x5f4cb5));if(_0x5f4cb5[_0xd048('0x11')]){if(_0x5f4cb5[_0xd048('0x11')][_0xd048('0x12')]===0x1f4){logger[_0xd048('0x11')](_0xd048('0x13'),_0x58f4cb,_0x5f4cb5['error'][_0xd048('0x14')]);return _0x1025e9(_0x5f4cb5[_0xd048('0x11')]['message']);}logger[_0xd048('0x11')](_0xd048('0x13'),_0x58f4cb,_0x5f4cb5[_0xd048('0x11')][_0xd048('0x14')]);return _0x4d7727(_0x5f4cb5[_0xd048('0x11')][_0xd048('0x14')]);}else{logger[_0xd048('0xc')](_0xd048('0x13'),_0x58f4cb,_0xd048('0xf'));_0x4d7727(_0x5f4cb5[_0xd048('0x15')][_0xd048('0x14')]);}})['catch'](function(_0x414af9){logger[_0xd048('0x11')](_0xd048('0x13'),_0x58f4cb,_0x414af9);_0x1025e9(_0x414af9);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6d2c10e..f0849e1 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 _0x3a83=['create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x348843,_0x252135){var _0x1e2d8c=function(_0x35c4bf){while(--_0x35c4bf){_0x348843['push'](_0x348843['shift']());}};_0x1e2d8c(++_0x252135);}(_0x3a83,0x9e));var _0x33a8=function(_0x75f328,_0x3ca37e){_0x75f328=_0x75f328-0x0;var _0x6c38fe=_0x3a83[_0x75f328];return _0x6c38fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x33a8('0x0'));var timeout=require(_0x33a8('0x1'));var express=require(_0x33a8('0x2'));var router=express['Router']();var auth=require(_0x33a8('0x3'));var interaction=require(_0x33a8('0x4'));var config=require(_0x33a8('0x5'));var controller=require(_0x33a8('0x6'));router[_0x33a8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x33a8('0x7')](_0x33a8('0x8'),auth[_0x33a8('0x9')](),controller[_0x33a8('0xa')]);router[_0x33a8('0x7')](_0x33a8('0xb'),auth[_0x33a8('0x9')](),controller['show']);router[_0x33a8('0xc')]('/',auth['isAuthenticated'](),controller[_0x33a8('0xd')]);router[_0x33a8('0xe')](_0x33a8('0xb'),auth[_0x33a8('0x9')](),controller[_0x33a8('0xf')]);router[_0x33a8('0x10')](_0x33a8('0xb'),auth[_0x33a8('0x9')](),controller[_0x33a8('0x11')]);module[_0x33a8('0x12')]=router; \ No newline at end of file +var _0xd233=['isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','path','express','../../config/environment','./memberReport.controller','get'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xd233,0xf0));var _0x3d23=function(_0x5ced8b,_0x5f0335){_0x5ced8b=_0x5ced8b-0x0;var _0x535973=_0xd233[_0x5ced8b];return _0x535973;};'use strict';var multer=require(_0x3d23('0x0'));var util=require(_0x3d23('0x1'));var path=require(_0x3d23('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d23('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3d23('0x4'));var controller=require(_0x3d23('0x5'));router[_0x3d23('0x6')]('/',auth[_0x3d23('0x7')](),controller[_0x3d23('0x8')]);router[_0x3d23('0x6')](_0x3d23('0x9'),auth[_0x3d23('0x7')](),controller[_0x3d23('0xa')]);router['get']('/:id',auth[_0x3d23('0x7')](),controller[_0x3d23('0xb')]);router[_0x3d23('0xc')]('/',auth[_0x3d23('0x7')](),controller[_0x3d23('0xd')]);router[_0x3d23('0xe')](_0x3d23('0xf'),auth['isAuthenticated'](),controller[_0x3d23('0x10')]);router[_0x3d23('0x11')](_0x3d23('0xf'),auth[_0x3d23('0x7')](),controller[_0x3d23('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 5cb90fe..16ba788 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 _0xa87f=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','seconds','setDataValue','exitAt','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x3ec30c,_0x8697ce){var _0x2e3cd8=function(_0x1bd513){while(--_0x1bd513){_0x3ec30c['push'](_0x3ec30c['shift']());}};_0x2e3cd8(++_0x8697ce);}(_0xa87f,0x16b));var _0xfa87=function(_0xdb2a50,_0x4db945){_0xdb2a50=_0xdb2a50-0x0;var _0x100b64=_0xa87f[_0xdb2a50];return _0x100b64;};'use strict';var Sequelize=require(_0xfa87('0x0'));var moment=require(_0xfa87('0x1'));module[_0xfa87('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfa87('0x3')]},'interface':{'type':Sequelize[_0xfa87('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xfa87('0x4')},'duration':{'type':Sequelize[_0xfa87('0x5')]},'enterAt':{'type':Sequelize[_0xfa87('0x6')]},'exitAt':{'type':Sequelize[_0xfa87('0x6')],'set':function(_0x26d799){var _0x599c67=moment(_0x26d799);var _0x332059=moment(this['getDataValue'](_0xfa87('0x7')));var _0xe71067=_0x599c67['diff'](_0x332059,_0xfa87('0x8'));this[_0xfa87('0x9')](_0xfa87('0xa'),_0x26d799);this[_0xfa87('0x9')]('duration',_0xe71067||null);}},'data1':{'type':Sequelize[_0xfa87('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xfa87('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xfa87('0x3')],'comment':_0xfa87('0xb')},'data4':{'type':Sequelize[_0xfa87('0x3')],'comment':_0xfa87('0xc')},'data5':{'type':Sequelize[_0xfa87('0x3')],'comment':_0xfa87('0xd')},'role':{'type':Sequelize[_0xfa87('0x3')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc7bc=['STRING','INTEGER','DATE','getDataValue','enterAt','diff','exitAt','setDataValue','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports'];(function(_0x4eb204,_0x834e7d){var _0x78c798=function(_0x3b5534){while(--_0x3b5534){_0x4eb204['push'](_0x4eb204['shift']());}};_0x78c798(++_0x834e7d);}(_0xc7bc,0x156));var _0xcc7b=function(_0x599aaf,_0x3d3622){_0x599aaf=_0x599aaf-0x0;var _0xd995f3=_0xc7bc[_0x599aaf];return _0xd995f3;};'use strict';var Sequelize=require(_0xcc7b('0x0'));var moment=require(_0xcc7b('0x1'));module[_0xcc7b('0x2')]={'channel':{'type':Sequelize[_0xcc7b('0x3')]},'membername':{'type':Sequelize[_0xcc7b('0x3')]},'interface':{'type':Sequelize[_0xcc7b('0x3')]},'type':{'type':Sequelize[_0xcc7b('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xcc7b('0x4')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcc7b('0x5')],'set':function(_0x23dbe2){var _0x24c62c=moment(_0x23dbe2);var _0x38fb53=moment(this[_0xcc7b('0x6')](_0xcc7b('0x7')));var _0x15127d=_0x24c62c[_0xcc7b('0x8')](_0x38fb53,'seconds');this['setDataValue'](_0xcc7b('0x9'),_0x23dbe2);this[_0xcc7b('0xa')]('duration',_0x15127d||null);}},'data1':{'type':Sequelize[_0xcc7b('0x3')],'comment':_0xcc7b('0xb')},'data2':{'type':Sequelize[_0xcc7b('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize['STRING'],'comment':_0xcc7b('0xc')},'data4':{'type':Sequelize[_0xcc7b('0x3')],'comment':_0xcc7b('0xd')},'data5':{'type':Sequelize[_0xcc7b('0x3')],'comment':_0xcc7b('0xe')},'role':{'type':Sequelize[_0xcc7b('0x3')]},'internal':{'type':Sequelize[_0xcc7b('0x4')]},'uniqueid':{'type':Sequelize[_0xcc7b('0x3')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 2eedeca..44c084d 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 _0x0d5b=['map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','MemberReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0xca746e,_0x362fa1){var _0x5e64d8=function(_0x526c71){while(--_0x526c71){_0xca746e['push'](_0xca746e['shift']());}};_0x5e64d8(++_0x362fa1);}(_0x0d5b,0xfa));var _0xb0d5=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x0d5b[_0x3740fe];return _0x55492b;};'use strict';var pdf=require(_0xb0d5('0x0'));var emlformat=require(_0xb0d5('0x1'));var rimraf=require(_0xb0d5('0x2'));var zipdir=require(_0xb0d5('0x3'));var jsonpatch=require(_0xb0d5('0x4'));var rp=require(_0xb0d5('0x5'));var moment=require(_0xb0d5('0x6'));var BPromise=require(_0xb0d5('0x7'));var Mustache=require(_0xb0d5('0x8'));var util=require('util');var path=require(_0xb0d5('0x9'));var sox=require('sox');var csv=require(_0xb0d5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb0d5('0xb'));var squel=require(_0xb0d5('0xc'));var crypto=require(_0xb0d5('0xd'));var jsforce=require(_0xb0d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb0d5('0xa'));var querystring=require('querystring');var Papa=require(_0xb0d5('0xf'));var Redis=require(_0xb0d5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb0d5('0x11'));var as=require(_0xb0d5('0x12'));var hardwareService=require(_0xb0d5('0x13'));var logger=require(_0xb0d5('0x14'))('api');var utils=require(_0xb0d5('0x15'));var config=require(_0xb0d5('0x16'));var db=require(_0xb0d5('0x17'))['db'];function respondWithStatusCode(_0x5d0f7f,_0x2f1294){_0x2f1294=_0x2f1294||0xcc;return function(_0xec7845){if(_0xec7845){return _0x5d0f7f[_0xb0d5('0x18')](_0x2f1294);}return _0x5d0f7f[_0xb0d5('0x19')](_0x2f1294)[_0xb0d5('0x1a')]();};}function respondWithResult(_0x54219a,_0x4eb9df){_0x4eb9df=_0x4eb9df||0xc8;return function(_0x3b5b28){if(_0x3b5b28){return _0x54219a['status'](_0x4eb9df)[_0xb0d5('0x1b')](_0x3b5b28);}};}function respondWithFilteredResult(_0x3cc49b,_0x5914c0){return function(_0x4cfd9f){if(_0x4cfd9f){var _0x16fba0=_0x4cfd9f[_0xb0d5('0x1c')],_0x587fdc=_0x5914c0['offset'],_0x324338=_0x5914c0[_0xb0d5('0x1d')]+_0x5914c0[_0xb0d5('0x1e')],_0x5adb84;if(_0x324338>=_0x16fba0){_0x324338=_0x16fba0;_0x5adb84=0xc8;}else{_0x5adb84=0xce;}_0x3cc49b['status'](_0x5adb84);return _0x3cc49b['set'](_0xb0d5('0x1f'),_0x587fdc+'-'+_0x324338+'/'+_0x16fba0)[_0xb0d5('0x1b')](_0x4cfd9f);}return null;};}function patchUpdates(_0x439dd5){return function(_0x413b90){try{jsonpatch['apply'](_0x413b90,_0x439dd5,!![]);}catch(_0xce673e){return BPromise[_0xb0d5('0x20')](_0xce673e);}return _0x413b90[_0xb0d5('0x21')]();};}function saveUpdates(_0x5b44cd,_0x183e77){return function(_0x17418e){if(_0x17418e){return _0x17418e[_0xb0d5('0x22')](_0x5b44cd)[_0xb0d5('0x23')](function(_0x3f1670){return _0x3f1670;});}return null;};}function removeEntity(_0x389835,_0x1b104a){return function(_0x2d46be){if(_0x2d46be){return _0x2d46be[_0xb0d5('0x24')]()[_0xb0d5('0x23')](function(){_0x389835['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b4ae6,_0x5afc52){return function(_0x1e4a94){if(!_0x1e4a94){_0x2b4ae6['sendStatus'](0x194);}return _0x1e4a94;};}function handleError(_0x3c4690,_0xcad6d4){_0xcad6d4=_0xcad6d4||0x1f4;return function(_0x3e52fd){logger[_0xb0d5('0x25')](_0x3e52fd[_0xb0d5('0x26')]);if(_0x3e52fd['name']){delete _0x3e52fd[_0xb0d5('0x27')];}_0x3c4690[_0xb0d5('0x19')](_0xcad6d4)[_0xb0d5('0x28')](_0x3e52fd);};}exports[_0xb0d5('0x29')]=function(_0x5e0fe0,_0x2ff705){var _0x3d87b4={},_0xa6b232={},_0x588a90={'count':0x0,'rows':[]};var _0x102db5=_[_0xb0d5('0x2a')](db['MemberReport']['rawAttributes'],function(_0x20862e){return{'name':_0x20862e[_0xb0d5('0x2b')],'type':_0x20862e[_0xb0d5('0x2c')][_0xb0d5('0x2d')]};});_0xa6b232['model']=_['map'](_0x102db5,_0xb0d5('0x27'));_0xa6b232[_0xb0d5('0x2e')]=_[_0xb0d5('0x2f')](_0x5e0fe0[_0xb0d5('0x2e')]);_0xa6b232[_0xb0d5('0x30')]=_[_0xb0d5('0x31')](_0xa6b232[_0xb0d5('0x32')],_0xa6b232[_0xb0d5('0x2e')]);_0x3d87b4[_0xb0d5('0x33')]=_[_0xb0d5('0x31')](_0xa6b232[_0xb0d5('0x32')],qs[_0xb0d5('0x34')](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x34')]));_0x3d87b4[_0xb0d5('0x33')]=_0x3d87b4['attributes'][_0xb0d5('0x35')]?_0x3d87b4[_0xb0d5('0x33')]:_0xa6b232[_0xb0d5('0x32')];if(!_0x5e0fe0[_0xb0d5('0x2e')]['hasOwnProperty'](_0xb0d5('0x36'))){_0x3d87b4[_0xb0d5('0x1e')]=qs[_0xb0d5('0x1e')](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x1e')]);_0x3d87b4[_0xb0d5('0x1d')]=qs['offset'](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x1d')]);}_0x3d87b4[_0xb0d5('0x37')]=qs['sort'](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x38')]);_0x3d87b4[_0xb0d5('0x39')]=qs['filters'](_['pick'](_0x5e0fe0[_0xb0d5('0x2e')],_0xa6b232[_0xb0d5('0x30')]));if(_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x3a')]){_0x3d87b4['where']=_['merge'](_0x3d87b4[_0xb0d5('0x39')],{'$or':_[_0xb0d5('0x2a')](_0x102db5,function(_0x11cc64){if(_0x11cc64[_0xb0d5('0x2c')]!=='VIRTUAL'){var _0x599fd6={};_0x599fd6[_0x11cc64[_0xb0d5('0x27')]]={'$like':'%'+_0x5e0fe0[_0xb0d5('0x2e')]['filter']+'%'};return _0x599fd6;}})});}_0x3d87b4=_[_0xb0d5('0x3b')]({},_0x3d87b4,_0x5e0fe0['options']);var _0xcd8819={'where':_0x3d87b4[_0xb0d5('0x39')]};return db[_0xb0d5('0x3c')][_0xb0d5('0x1c')](_0xcd8819)[_0xb0d5('0x23')](function(_0x455472){_0x588a90[_0xb0d5('0x1c')]=_0x455472;if(_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x3d')]){_0x3d87b4[_0xb0d5('0x3e')]=[{'all':!![]}];}return db['MemberReport'][_0xb0d5('0x3f')](_0x3d87b4);})[_0xb0d5('0x23')](function(_0x396ea8){_0x588a90[_0xb0d5('0x40')]=_0x396ea8;return _0x588a90;})[_0xb0d5('0x23')](respondWithFilteredResult(_0x2ff705,_0x3d87b4))[_0xb0d5('0x41')](handleError(_0x2ff705,null));};exports[_0xb0d5('0x42')]=function(_0x11308f,_0x14f52f){var _0x1198bd={'raw':!![],'where':{'id':_0x11308f[_0xb0d5('0x43')]['id']}},_0x456348={};_0x456348[_0xb0d5('0x32')]=_[_0xb0d5('0x2f')](db[_0xb0d5('0x3c')][_0xb0d5('0x44')]);_0x456348['query']=_['keys'](_0x11308f[_0xb0d5('0x2e')]);_0x456348[_0xb0d5('0x30')]=_[_0xb0d5('0x31')](_0x456348['model'],_0x456348[_0xb0d5('0x2e')]);_0x1198bd[_0xb0d5('0x33')]=_[_0xb0d5('0x31')](_0x456348[_0xb0d5('0x32')],qs[_0xb0d5('0x34')](_0x11308f[_0xb0d5('0x2e')][_0xb0d5('0x34')]));_0x1198bd[_0xb0d5('0x33')]=_0x1198bd['attributes'][_0xb0d5('0x35')]?_0x1198bd['attributes']:_0x456348[_0xb0d5('0x32')];if(_0x11308f['query']['includeAll']){_0x1198bd['include']=[{'all':!![]}];}_0x1198bd=_[_0xb0d5('0x3b')]({},_0x1198bd,_0x11308f['options']);return db['MemberReport'][_0xb0d5('0x45')](_0x1198bd)[_0xb0d5('0x23')](handleEntityNotFound(_0x14f52f,null))[_0xb0d5('0x23')](respondWithResult(_0x14f52f,null))[_0xb0d5('0x41')](handleError(_0x14f52f,null));};exports[_0xb0d5('0x46')]=function(_0x351910,_0x2965e4){return db[_0xb0d5('0x3c')][_0xb0d5('0x46')](_0x351910[_0xb0d5('0x47')],{})[_0xb0d5('0x23')](respondWithResult(_0x2965e4,0xc9))[_0xb0d5('0x41')](handleError(_0x2965e4,null));};exports[_0xb0d5('0x22')]=function(_0x50c383,_0x4744dd){if(_0x50c383[_0xb0d5('0x47')]['id']){delete _0x50c383[_0xb0d5('0x47')]['id'];}return db[_0xb0d5('0x3c')]['find']({'where':{'id':_0x50c383['params']['id']}})[_0xb0d5('0x23')](handleEntityNotFound(_0x4744dd,null))[_0xb0d5('0x23')](saveUpdates(_0x50c383[_0xb0d5('0x47')],null))[_0xb0d5('0x23')](respondWithResult(_0x4744dd,null))[_0xb0d5('0x41')](handleError(_0x4744dd,null));};exports['destroy']=function(_0x2c867f,_0x38bb03){return db[_0xb0d5('0x3c')][_0xb0d5('0x45')]({'where':{'id':_0x2c867f[_0xb0d5('0x43')]['id']}})[_0xb0d5('0x23')](handleEntityNotFound(_0x38bb03,null))[_0xb0d5('0x23')](removeEntity(_0x38bb03,null))[_0xb0d5('0x41')](handleError(_0x38bb03,null));};exports[_0xb0d5('0x48')]=function(_0x518548,_0x135061){return db[_0xb0d5('0x3c')][_0xb0d5('0x48')]()[_0xb0d5('0x23')](respondWithResult(_0x135061,null))[_0xb0d5('0x41')](handleError(_0x135061,null));}; \ No newline at end of file +var _0x28d0=['status','end','json','count','offset','limit','apply','save','then','destroy','error','stack','name','index','map','MemberReport','rawAttributes','type','key','keys','filters','intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x2da63d,_0x252354){var _0x5b829c=function(_0x1487e8){while(--_0x1487e8){_0x2da63d['push'](_0x2da63d['shift']());}};_0x5b829c(++_0x252354);}(_0x28d0,0x142));var _0x028d=function(_0x517022,_0x316564){_0x517022=_0x517022-0x0;var _0x657959=_0x28d0[_0x517022];return _0x657959;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x028d('0x0'));var zipdir=require(_0x028d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x028d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x028d('0x3'));var util=require('util');var path=require(_0x028d('0x4'));var sox=require(_0x028d('0x5'));var csv=require(_0x028d('0x6'));var ejs=require(_0x028d('0x7'));var fs=require('fs');var _=require(_0x028d('0x8'));var squel=require(_0x028d('0x9'));var crypto=require(_0x028d('0xa'));var jsforce=require(_0x028d('0xb'));var deskjs=require(_0x028d('0xc'));var toCsv=require(_0x028d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x028d('0xd'));var qs=require(_0x028d('0xe'));var as=require(_0x028d('0xf'));var hardwareService=require(_0x028d('0x10'));var logger=require(_0x028d('0x11'))(_0x028d('0x12'));var utils=require(_0x028d('0x13'));var config=require(_0x028d('0x14'));var db=require(_0x028d('0x15'))['db'];function respondWithStatusCode(_0x2c4a73,_0x246803){_0x246803=_0x246803||0xcc;return function(_0x36ddc1){if(_0x36ddc1){return _0x2c4a73[_0x028d('0x16')](_0x246803);}return _0x2c4a73[_0x028d('0x17')](_0x246803)[_0x028d('0x18')]();};}function respondWithResult(_0x46fef1,_0x22118d){_0x22118d=_0x22118d||0xc8;return function(_0x5156a3){if(_0x5156a3){return _0x46fef1[_0x028d('0x17')](_0x22118d)[_0x028d('0x19')](_0x5156a3);}};}function respondWithFilteredResult(_0x258914,_0x25b30d){return function(_0x5f5394){if(_0x5f5394){var _0x3cee08=_0x5f5394[_0x028d('0x1a')],_0x7686c=_0x25b30d[_0x028d('0x1b')],_0x2ad4aa=_0x25b30d[_0x028d('0x1b')]+_0x25b30d[_0x028d('0x1c')],_0x4c7588;if(_0x2ad4aa>=_0x3cee08){_0x2ad4aa=_0x3cee08;_0x4c7588=0xc8;}else{_0x4c7588=0xce;}_0x258914[_0x028d('0x17')](_0x4c7588);return _0x258914['set']('Content-Range',_0x7686c+'-'+_0x2ad4aa+'/'+_0x3cee08)[_0x028d('0x19')](_0x5f5394);}return null;};}function patchUpdates(_0x5613ad){return function(_0x251712){try{jsonpatch[_0x028d('0x1d')](_0x251712,_0x5613ad,!![]);}catch(_0x404ff1){return BPromise['reject'](_0x404ff1);}return _0x251712[_0x028d('0x1e')]();};}function saveUpdates(_0x1bd12f,_0x56bad6){return function(_0xb1ef0b){if(_0xb1ef0b){return _0xb1ef0b['update'](_0x1bd12f)[_0x028d('0x1f')](function(_0x38d44f){return _0x38d44f;});}return null;};}function removeEntity(_0x3a0235,_0x593ccd){return function(_0x451c7f){if(_0x451c7f){return _0x451c7f[_0x028d('0x20')]()[_0x028d('0x1f')](function(){_0x3a0235[_0x028d('0x17')](0xcc)[_0x028d('0x18')]();});}};}function handleEntityNotFound(_0x3ec363,_0x351283){return function(_0x310d00){if(!_0x310d00){_0x3ec363[_0x028d('0x16')](0x194);}return _0x310d00;};}function handleError(_0x196f4a,_0x1e15ce){_0x1e15ce=_0x1e15ce||0x1f4;return function(_0x228c9f){logger[_0x028d('0x21')](_0x228c9f[_0x028d('0x22')]);if(_0x228c9f[_0x028d('0x23')]){delete _0x228c9f[_0x028d('0x23')];}_0x196f4a[_0x028d('0x17')](_0x1e15ce)['send'](_0x228c9f);};}exports[_0x028d('0x24')]=function(_0x40dcc2,_0x7870f7){var _0x31c731={},_0x2bfbee={},_0x15bbfc={'count':0x0,'rows':[]};var _0xd31180=_[_0x028d('0x25')](db[_0x028d('0x26')][_0x028d('0x27')],function(_0x569b71){return{'name':_0x569b71['fieldName'],'type':_0x569b71[_0x028d('0x28')][_0x028d('0x29')]};});_0x2bfbee['model']=_[_0x028d('0x25')](_0xd31180,_0x028d('0x23'));_0x2bfbee['query']=_[_0x028d('0x2a')](_0x40dcc2['query']);_0x2bfbee[_0x028d('0x2b')]=_[_0x028d('0x2c')](_0x2bfbee['model'],_0x2bfbee[_0x028d('0x2d')]);_0x31c731[_0x028d('0x2e')]=_[_0x028d('0x2c')](_0x2bfbee[_0x028d('0x2f')],qs['fields'](_0x40dcc2[_0x028d('0x2d')][_0x028d('0x30')]));_0x31c731[_0x028d('0x2e')]=_0x31c731['attributes'][_0x028d('0x31')]?_0x31c731[_0x028d('0x2e')]:_0x2bfbee[_0x028d('0x2f')];if(!_0x40dcc2[_0x028d('0x2d')][_0x028d('0x32')](_0x028d('0x33'))){_0x31c731[_0x028d('0x1c')]=qs[_0x028d('0x1c')](_0x40dcc2[_0x028d('0x2d')][_0x028d('0x1c')]);_0x31c731[_0x028d('0x1b')]=qs[_0x028d('0x1b')](_0x40dcc2['query'][_0x028d('0x1b')]);}_0x31c731[_0x028d('0x34')]=qs[_0x028d('0x35')](_0x40dcc2[_0x028d('0x2d')]['sort']);_0x31c731[_0x028d('0x36')]=qs['filters'](_['pick'](_0x40dcc2[_0x028d('0x2d')],_0x2bfbee[_0x028d('0x2b')]));if(_0x40dcc2[_0x028d('0x2d')][_0x028d('0x37')]){_0x31c731['where']=_[_0x028d('0x38')](_0x31c731[_0x028d('0x36')],{'$or':_[_0x028d('0x25')](_0xd31180,function(_0x538780){if(_0x538780['type']!==_0x028d('0x39')){var _0x4073a1={};_0x4073a1[_0x538780['name']]={'$like':'%'+_0x40dcc2['query'][_0x028d('0x37')]+'%'};return _0x4073a1;}})});}_0x31c731=_[_0x028d('0x38')]({},_0x31c731,_0x40dcc2['options']);var _0xe9001b={'where':_0x31c731['where']};return db[_0x028d('0x26')][_0x028d('0x1a')](_0xe9001b)[_0x028d('0x1f')](function(_0x378a44){_0x15bbfc[_0x028d('0x1a')]=_0x378a44;if(_0x40dcc2[_0x028d('0x2d')][_0x028d('0x3a')]){_0x31c731[_0x028d('0x3b')]=[{'all':!![]}];}return db[_0x028d('0x26')][_0x028d('0x3c')](_0x31c731);})[_0x028d('0x1f')](function(_0x154f46){_0x15bbfc['rows']=_0x154f46;return _0x15bbfc;})[_0x028d('0x1f')](respondWithFilteredResult(_0x7870f7,_0x31c731))[_0x028d('0x3d')](handleError(_0x7870f7,null));};exports[_0x028d('0x3e')]=function(_0xeb9653,_0x7a9ff3){var _0xfb0e73={'raw':!![],'where':{'id':_0xeb9653[_0x028d('0x3f')]['id']}},_0xf819df={};_0xf819df['model']=_[_0x028d('0x2a')](db['MemberReport'][_0x028d('0x27')]);_0xf819df[_0x028d('0x2d')]=_[_0x028d('0x2a')](_0xeb9653['query']);_0xf819df[_0x028d('0x2b')]=_[_0x028d('0x2c')](_0xf819df[_0x028d('0x2f')],_0xf819df['query']);_0xfb0e73[_0x028d('0x2e')]=_[_0x028d('0x2c')](_0xf819df[_0x028d('0x2f')],qs[_0x028d('0x30')](_0xeb9653[_0x028d('0x2d')][_0x028d('0x30')]));_0xfb0e73['attributes']=_0xfb0e73[_0x028d('0x2e')][_0x028d('0x31')]?_0xfb0e73['attributes']:_0xf819df[_0x028d('0x2f')];if(_0xeb9653['query'][_0x028d('0x3a')]){_0xfb0e73[_0x028d('0x3b')]=[{'all':!![]}];}_0xfb0e73=_[_0x028d('0x38')]({},_0xfb0e73,_0xeb9653['options']);return db[_0x028d('0x26')][_0x028d('0x40')](_0xfb0e73)['then'](handleEntityNotFound(_0x7a9ff3,null))[_0x028d('0x1f')](respondWithResult(_0x7a9ff3,null))[_0x028d('0x3d')](handleError(_0x7a9ff3,null));};exports[_0x028d('0x41')]=function(_0x2a4a8d,_0x23714d){return db[_0x028d('0x26')][_0x028d('0x41')](_0x2a4a8d[_0x028d('0x42')],{})[_0x028d('0x1f')](respondWithResult(_0x23714d,0xc9))[_0x028d('0x3d')](handleError(_0x23714d,null));};exports[_0x028d('0x43')]=function(_0x11f697,_0x4a8b80){if(_0x11f697['body']['id']){delete _0x11f697[_0x028d('0x42')]['id'];}return db[_0x028d('0x26')][_0x028d('0x40')]({'where':{'id':_0x11f697[_0x028d('0x3f')]['id']}})[_0x028d('0x1f')](handleEntityNotFound(_0x4a8b80,null))[_0x028d('0x1f')](saveUpdates(_0x11f697[_0x028d('0x42')],null))[_0x028d('0x1f')](respondWithResult(_0x4a8b80,null))[_0x028d('0x3d')](handleError(_0x4a8b80,null));};exports[_0x028d('0x20')]=function(_0x346f0f,_0x1a22ba){return db['MemberReport'][_0x028d('0x40')]({'where':{'id':_0x346f0f['params']['id']}})[_0x028d('0x1f')](handleEntityNotFound(_0x1a22ba,null))[_0x028d('0x1f')](removeEntity(_0x1a22ba,null))[_0x028d('0x3d')](handleError(_0x1a22ba,null));};exports[_0x028d('0x44')]=function(_0x3b95af,_0x51dab1){return db[_0x028d('0x26')][_0x028d('0x44')]()[_0x028d('0x1f')](respondWithResult(_0x51dab1,null))[_0x028d('0x3d')](handleError(_0x51dab1,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index fc656b7..99beadf 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 _0xe4bf=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','interface'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4bf,0x1c0));var _0xfe4b=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0xe4bf[_0x466bc5];return _0x138952;};'use strict';var _=require(_0xfe4b('0x0'));var util=require(_0xfe4b('0x1'));var logger=require(_0xfe4b('0x2'))(_0xfe4b('0x3'));var moment=require('moment');var BPromise=require(_0xfe4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe4b('0x5'));var rimraf=require(_0xfe4b('0x6'));var config=require(_0xfe4b('0x7'));var attributes=require(_0xfe4b('0x8'));module['exports']=function(_0x485428,_0xf0382c){return _0x485428[_0xfe4b('0x9')](_0xfe4b('0xa'),attributes,{'tableName':_0xfe4b('0xb'),'paranoid':![],'indexes':[{'name':_0xfe4b('0xc'),'fields':['membername',_0xfe4b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e3e=['moment','bluebird','request-promise','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','membername_interface','membername','interface','lodash','util','../../config/logger'];(function(_0x4fe558,_0x13d205){var _0x8bd817=function(_0x46bf49){while(--_0x46bf49){_0x4fe558['push'](_0x4fe558['shift']());}};_0x8bd817(++_0x13d205);}(_0x1e3e,0x138));var _0xe1e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1e3e[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe1e3('0x0'));var util=require(_0xe1e3('0x1'));var logger=require(_0xe1e3('0x2'))('api');var moment=require(_0xe1e3('0x3'));var BPromise=require(_0xe1e3('0x4'));var rp=require(_0xe1e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe1e3('0x6'));var attributes=require(_0xe1e3('0x7'));module[_0xe1e3('0x8')]=function(_0x576217,_0x3e5cf7){return _0x576217[_0xe1e3('0x9')](_0xe1e3('0xa'),attributes,{'tableName':_0xe1e3('0xb'),'paranoid':![],'indexes':[{'name':_0xe1e3('0xc'),'fields':[_0xe1e3('0xd'),_0xe1e3('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 6040f7c..26c3bdc 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 _0x23f8=['body','update','UpdateMemberReport','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','stringify','CreateMemberReport','create'];(function(_0x49e843,_0x3f70b0){var _0x3334f5=function(_0x25b586){while(--_0x25b586){_0x49e843['push'](_0x49e843['shift']());}};_0x3334f5(++_0x3f70b0);}(_0x23f8,0x75));var _0x823f=function(_0xbfaba8,_0x1aa7e6){_0xbfaba8=_0xbfaba8-0x0;var _0x21dffc=_0x23f8[_0xbfaba8];return _0x21dffc;};'use strict';var _=require(_0x823f('0x0'));var util=require(_0x823f('0x1'));var moment=require(_0x823f('0x2'));var BPromise=require(_0x823f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x823f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x823f('0x5'));var logger=require('../../config/logger')(_0x823f('0x6'));var config=require(_0x823f('0x7'));var jayson=require(_0x823f('0x8'));var client=jayson['client'][_0x823f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x289fa5,_0x380936,_0x2f25c9){return new BPromise(function(_0x9a7518,_0x3b8dc1){return client['request'](_0x289fa5,_0x2f25c9)[_0x823f('0xa')](function(_0x5c6adf){logger[_0x823f('0xb')](_0x823f('0xc'),_0x380936,_0x823f('0xd'));logger[_0x823f('0xe')](_0x823f('0xf'),_0x380936,_0x823f('0xd'),JSON['stringify'](_0x5c6adf));if(_0x5c6adf[_0x823f('0x10')]){if(_0x5c6adf[_0x823f('0x10')][_0x823f('0x11')]===0x1f4){logger[_0x823f('0x10')]('MemberReport,\x20%s,\x20%s',_0x380936,_0x5c6adf[_0x823f('0x10')][_0x823f('0x12')]);return _0x3b8dc1(_0x5c6adf['error']['message']);}logger[_0x823f('0x10')](_0x823f('0xc'),_0x380936,_0x5c6adf[_0x823f('0x10')][_0x823f('0x12')]);return _0x9a7518(_0x5c6adf[_0x823f('0x10')][_0x823f('0x12')]);}else{logger[_0x823f('0xb')](_0x823f('0xc'),_0x380936,'request\x20sent');_0x9a7518(_0x5c6adf[_0x823f('0x13')][_0x823f('0x12')]);}})[_0x823f('0x14')](function(_0x5812c2){logger['error'](_0x823f('0xc'),_0x380936,_0x5812c2);_0x3b8dc1(_0x5812c2);});});}exports[_0x823f('0x15')]=function(_0x16a373){var _0x57304b=this;return new Promise(function(_0xbf60ad,_0x341f33){return db[_0x823f('0x16')][_0x823f('0x17')]({'raw':_0x16a373[_0x823f('0x18')]?_0x16a373[_0x823f('0x18')][_0x823f('0x19')]===undefined?!![]:![]:!![],'where':_0x16a373[_0x823f('0x18')]?_0x16a373[_0x823f('0x18')][_0x823f('0x1a')]||null:null,'attributes':_0x16a373['options']?_0x16a373[_0x823f('0x18')]['attributes']||null:null,'limit':_0x16a373[_0x823f('0x18')]?_0x16a373['options'][_0x823f('0x1b')]||null:null,'include':_0x16a373[_0x823f('0x18')]?_0x16a373[_0x823f('0x18')][_0x823f('0x1c')]?_[_0x823f('0x1d')](_0x16a373[_0x823f('0x18')][_0x823f('0x1c')],function(_0x49a88b){return{'model':db[_0x49a88b[_0x823f('0x1e')]],'as':_0x49a88b['as'],'attributes':_0x49a88b[_0x823f('0x1f')],'include':_0x49a88b['include']?_[_0x823f('0x1d')](_0x49a88b['include'],function(_0x36f29c){return{'model':db[_0x36f29c['model']],'as':_0x36f29c['as'],'attributes':_0x36f29c[_0x823f('0x1f')],'include':_0x36f29c[_0x823f('0x1c')]?_[_0x823f('0x1d')](_0x36f29c['include'],function(_0x195ce3){return{'model':db[_0x195ce3[_0x823f('0x1e')]],'as':_0x195ce3['as'],'attributes':_0x195ce3[_0x823f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x823f('0xa')](function(_0x56b427){logger[_0x823f('0xb')](_0x823f('0x15'),_0x16a373);logger[_0x823f('0xe')](_0x823f('0x15'),_0x16a373,JSON[_0x823f('0x20')](_0x56b427));_0xbf60ad(_0x56b427);})[_0x823f('0x14')](function(_0x2dddee){logger[_0x823f('0x10')](_0x823f('0x15'),_0x2dddee[_0x823f('0x12')],_0x16a373);_0x341f33(_0x57304b[_0x823f('0x10')](0x1f4,_0x2dddee['message']));});});};exports[_0x823f('0x21')]=function(_0x4b05a9){var _0x7ee702=this;return new Promise(function(_0x48c75d,_0x318563){return db[_0x823f('0x16')][_0x823f('0x22')](_0x4b05a9[_0x823f('0x23')],{'raw':_0x4b05a9[_0x823f('0x18')]?_0x4b05a9[_0x823f('0x18')][_0x823f('0x19')]===undefined?!![]:![]:!![]})[_0x823f('0xa')](function(_0x47ab76){logger[_0x823f('0xb')](_0x823f('0x21'),_0x4b05a9);logger[_0x823f('0xe')]('CreateMemberReport',_0x4b05a9,JSON[_0x823f('0x20')](_0x47ab76));_0x48c75d(_0x47ab76);})[_0x823f('0x14')](function(_0x336c99){logger['error'](_0x823f('0x21'),_0x336c99['message'],_0x4b05a9);_0x318563(_0x7ee702[_0x823f('0x10')](0x1f4,_0x336c99['message']));});});};exports['UpdateMemberReport']=function(_0x170d88){var _0x172a58=this;return new Promise(function(_0x9f91c3,_0x357578){return db['MemberReport'][_0x823f('0x24')](_0x170d88[_0x823f('0x23')],{'raw':_0x170d88[_0x823f('0x18')]?_0x170d88['options'][_0x823f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x170d88[_0x823f('0x18')]?_0x170d88['options'][_0x823f('0x1a')]||null:null,'attributes':_0x170d88[_0x823f('0x18')]?_0x170d88[_0x823f('0x18')]['attributes']||null:null,'limit':_0x170d88['options']?_0x170d88[_0x823f('0x18')][_0x823f('0x1b')]||null:null})[_0x823f('0xa')](function(_0x136bf2){logger['info'](_0x823f('0x25'),_0x170d88);logger[_0x823f('0xe')](_0x823f('0x25'),_0x170d88,JSON[_0x823f('0x20')](_0x136bf2));_0x9f91c3(_0x136bf2);})[_0x823f('0x14')](function(_0x308235){logger[_0x823f('0x10')](_0x823f('0x25'),_0x308235['message'],_0x170d88);_0x357578(_0x172a58[_0x823f('0x10')](0x1f4,_0x308235['message']));});});}; \ No newline at end of file +var _0x7245=['http','then','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x1e5f1a,_0x394a4e){var _0x3146db=function(_0x23821c){while(--_0x23821c){_0x1e5f1a['push'](_0x1e5f1a['shift']());}};_0x3146db(++_0x394a4e);}(_0x7245,0x86));var _0x5724=function(_0x4a7bf0,_0x3892de){_0x4a7bf0=_0x4a7bf0-0x0;var _0x4f6a09=_0x7245[_0x4a7bf0];return _0x4f6a09;};'use strict';var _=require(_0x5724('0x0'));var util=require(_0x5724('0x1'));var moment=require(_0x5724('0x2'));var BPromise=require('bluebird');var rs=require(_0x5724('0x3'));var fs=require('fs');var Redis=require(_0x5724('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5724('0x5'));var logger=require('../../config/logger')(_0x5724('0x6'));var config=require(_0x5724('0x7'));var jayson=require(_0x5724('0x8'));var client=jayson[_0x5724('0x9')][_0x5724('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53d9f7,_0x86b4c2,_0x1caa41){return new BPromise(function(_0x4fc114,_0x5a49a2){return client['request'](_0x53d9f7,_0x1caa41)[_0x5724('0xb')](function(_0x55643b){logger['info'](_0x5724('0xc'),_0x86b4c2,_0x5724('0xd'));logger[_0x5724('0xe')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x86b4c2,_0x5724('0xd'),JSON[_0x5724('0xf')](_0x55643b));if(_0x55643b['error']){if(_0x55643b[_0x5724('0x10')][_0x5724('0x11')]===0x1f4){logger[_0x5724('0x10')](_0x5724('0xc'),_0x86b4c2,_0x55643b[_0x5724('0x10')][_0x5724('0x12')]);return _0x5a49a2(_0x55643b[_0x5724('0x10')][_0x5724('0x12')]);}logger[_0x5724('0x10')](_0x5724('0xc'),_0x86b4c2,_0x55643b[_0x5724('0x10')][_0x5724('0x12')]);return _0x4fc114(_0x55643b['error'][_0x5724('0x12')]);}else{logger[_0x5724('0x13')](_0x5724('0xc'),_0x86b4c2,_0x5724('0xd'));_0x4fc114(_0x55643b['result'][_0x5724('0x12')]);}})[_0x5724('0x14')](function(_0x22e7f3){logger['error']('MemberReport,\x20%s,\x20%s',_0x86b4c2,_0x22e7f3);_0x5a49a2(_0x22e7f3);});});}exports[_0x5724('0x15')]=function(_0xf364e7){var _0x320ad1=this;return new Promise(function(_0x167dc1,_0x122c42){return db[_0x5724('0x16')][_0x5724('0x17')]({'raw':_0xf364e7[_0x5724('0x18')]?_0xf364e7[_0x5724('0x18')][_0x5724('0x19')]===undefined?!![]:![]:!![],'where':_0xf364e7['options']?_0xf364e7[_0x5724('0x18')][_0x5724('0x1a')]||null:null,'attributes':_0xf364e7[_0x5724('0x18')]?_0xf364e7[_0x5724('0x18')][_0x5724('0x1b')]||null:null,'limit':_0xf364e7[_0x5724('0x18')]?_0xf364e7[_0x5724('0x18')][_0x5724('0x1c')]||null:null,'include':_0xf364e7[_0x5724('0x18')]?_0xf364e7[_0x5724('0x18')][_0x5724('0x1d')]?_['map'](_0xf364e7['options'][_0x5724('0x1d')],function(_0x26f35b){return{'model':db[_0x26f35b['model']],'as':_0x26f35b['as'],'attributes':_0x26f35b[_0x5724('0x1b')],'include':_0x26f35b['include']?_[_0x5724('0x1e')](_0x26f35b[_0x5724('0x1d')],function(_0x357de6){return{'model':db[_0x357de6['model']],'as':_0x357de6['as'],'attributes':_0x357de6['attributes'],'include':_0x357de6[_0x5724('0x1d')]?_[_0x5724('0x1e')](_0x357de6['include'],function(_0x1762b7){return{'model':db[_0x1762b7['model']],'as':_0x1762b7['as'],'attributes':_0x1762b7[_0x5724('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5724('0xb')](function(_0x1b65ce){logger[_0x5724('0x13')]('GetMemberReport',_0xf364e7);logger['debug'](_0x5724('0x15'),_0xf364e7,JSON[_0x5724('0xf')](_0x1b65ce));_0x167dc1(_0x1b65ce);})[_0x5724('0x14')](function(_0x29af2f){logger[_0x5724('0x10')](_0x5724('0x15'),_0x29af2f['message'],_0xf364e7);_0x122c42(_0x320ad1['error'](0x1f4,_0x29af2f['message']));});});};exports[_0x5724('0x1f')]=function(_0x45be72){var _0x6de062=this;return new Promise(function(_0x52b7e4,_0x53ad73){return db[_0x5724('0x16')][_0x5724('0x20')](_0x45be72[_0x5724('0x21')],{'raw':_0x45be72[_0x5724('0x18')]?_0x45be72[_0x5724('0x18')][_0x5724('0x19')]===undefined?!![]:![]:!![]})[_0x5724('0xb')](function(_0x224a01){logger[_0x5724('0x13')](_0x5724('0x1f'),_0x45be72);logger[_0x5724('0xe')](_0x5724('0x1f'),_0x45be72,JSON['stringify'](_0x224a01));_0x52b7e4(_0x224a01);})[_0x5724('0x14')](function(_0xfb1213){logger[_0x5724('0x10')]('CreateMemberReport',_0xfb1213[_0x5724('0x12')],_0x45be72);_0x53ad73(_0x6de062[_0x5724('0x10')](0x1f4,_0xfb1213[_0x5724('0x12')]));});});};exports[_0x5724('0x22')]=function(_0x5dcb44){var _0x46b246=this;return new Promise(function(_0x4ad66b,_0x39095a){return db[_0x5724('0x16')][_0x5724('0x23')](_0x5dcb44[_0x5724('0x21')],{'raw':_0x5dcb44[_0x5724('0x18')]?_0x5dcb44[_0x5724('0x18')][_0x5724('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5dcb44['options']?_0x5dcb44[_0x5724('0x18')][_0x5724('0x1a')]||null:null,'attributes':_0x5dcb44['options']?_0x5dcb44[_0x5724('0x18')][_0x5724('0x1b')]||null:null,'limit':_0x5dcb44[_0x5724('0x18')]?_0x5dcb44[_0x5724('0x18')][_0x5724('0x1c')]||null:null})['then'](function(_0x1ae037){logger[_0x5724('0x13')](_0x5724('0x22'),_0x5dcb44);logger[_0x5724('0xe')](_0x5724('0x22'),_0x5dcb44,JSON[_0x5724('0xf')](_0x1ae037));_0x4ad66b(_0x1ae037);})['catch'](function(_0x319dc8){logger[_0x5724('0x10')](_0x5724('0x22'),_0x319dc8[_0x5724('0x12')],_0x5dcb44);_0x39095a(_0x46b246[_0x5724('0x10')](0x1f4,_0x319dc8['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 674e8c1..dec9377 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 _0xf4eb=['../../config/environment','./migration.controller','get','index','exports','multer','Router'];(function(_0x3059e3,_0x498f60){var _0x236f64=function(_0x5db9a3){while(--_0x5db9a3){_0x3059e3['push'](_0x3059e3['shift']());}};_0x236f64(++_0x498f60);}(_0xf4eb,0xec));var _0xbf4e=function(_0x380acb,_0x2b1afb){_0x380acb=_0x380acb-0x0;var _0x3492ea=_0xf4eb[_0x380acb];return _0x3492ea;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf4e('0x2'));var controller=require(_0xbf4e('0x3'));router[_0xbf4e('0x4')]('/',controller[_0xbf4e('0x5')]);module[_0xbf4e('0x6')]=router; \ No newline at end of file +var _0xcf66=['Router','../../config/environment','./migration.controller','index','exports','multer','util','path','express'];(function(_0x18d2c7,_0x4dd25d){var _0x33622c=function(_0x285db2){while(--_0x285db2){_0x18d2c7['push'](_0x18d2c7['shift']());}};_0x33622c(++_0x4dd25d);}(_0xcf66,0x71));var _0x6cf6=function(_0x404f55,_0x7c1ae3){_0x404f55=_0x404f55-0x0;var _0x2cb0fe=_0xcf66[_0x404f55];return _0x2cb0fe;};'use strict';var multer=require(_0x6cf6('0x0'));var util=require(_0x6cf6('0x1'));var path=require(_0x6cf6('0x2'));var timeout=require('connect-timeout');var express=require(_0x6cf6('0x3'));var router=express[_0x6cf6('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6cf6('0x5'));var controller=require(_0x6cf6('0x6'));router['get']('/',controller[_0x6cf6('0x7')]);module[_0x6cf6('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 5fc97a4..09479ad 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 _0xd819=['STRING','version','exports'];(function(_0x36afcb,_0x320403){var _0xf99b6c=function(_0xd52a73){while(--_0xd52a73){_0x36afcb['push'](_0x36afcb['shift']());}};_0xf99b6c(++_0x320403);}(_0xd819,0x1bb));var _0x9d81=function(_0x1eb856,_0x3ab151){_0x1eb856=_0x1eb856-0x0;var _0x629b2b=_0xd819[_0x1eb856];return _0x629b2b;};'use strict';var Sequelize=require('sequelize');module[_0x9d81('0x0')]={'version':{'type':Sequelize[_0x9d81('0x1')],'unique':_0x9d81('0x2')}}; \ No newline at end of file +var _0xae10=['STRING','sequelize'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xae10,0x1cf));var _0x0ae1=function(_0x5a8bc2,_0x101261){_0x5a8bc2=_0x5a8bc2-0x0;var _0x1ddd9a=_0xae10[_0x5a8bc2];return _0x1ddd9a;};'use strict';var Sequelize=require(_0x0ae1('0x0'));module['exports']={'version':{'type':Sequelize[_0x0ae1('0x1')],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 07678c0..20fb305 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 _0x7a54=['filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3a5ebf,_0x35350c){var _0xccb16c=function(_0x204197){while(--_0x204197){_0x3a5ebf['push'](_0x3a5ebf['shift']());}};_0xccb16c(++_0x35350c);}(_0x7a54,0x106));var _0x47a5=function(_0x212690,_0x4b8c78){_0x212690=_0x212690-0x0;var _0x29ba56=_0x7a54[_0x212690];return _0x29ba56;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['Migration'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));}; \ No newline at end of file +var _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x42e660,_0x1b053a){var _0x37cdde=function(_0x46f2bf){while(--_0x46f2bf){_0x42e660['push'](_0x42e660['shift']());}};_0x37cdde(++_0x1b053a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2fce8b,_0x348d13){_0x2fce8b=_0x2fce8b-0x0;var _0x361848=_0x5f2f[_0x2fce8b];return _0x361848;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index cd3d674..3c333ea 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 _0xadbe=['rimraf','./migration.attributes','migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5abdba,_0x21f1c4){var _0x32f52d=function(_0x1eddec){while(--_0x1eddec){_0x5abdba['push'](_0x5abdba['shift']());}};_0x32f52d(++_0x21f1c4);}(_0xadbe,0xd5));var _0xeadb=function(_0x54ecf5,_0xeba5f3){_0x54ecf5=_0x54ecf5-0x0;var _0x440d91=_0xadbe[_0x54ecf5];return _0x440d91;};'use strict';var _=require(_0xeadb('0x0'));var util=require('util');var logger=require(_0xeadb('0x1'))(_0xeadb('0x2'));var moment=require(_0xeadb('0x3'));var BPromise=require(_0xeadb('0x4'));var rp=require(_0xeadb('0x5'));var fs=require('fs');var path=require(_0xeadb('0x6'));var rimraf=require(_0xeadb('0x7'));var config=require('../../config/environment');var attributes=require(_0xeadb('0x8'));module['exports']=function(_0x18999b,_0x3b2697){return _0x18999b['define']('Migration',attributes,{'tableName':_0xeadb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c8f=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations','lodash','util'];(function(_0x481277,_0xeeb386){var _0x47fecd=function(_0x31c3da){while(--_0x31c3da){_0x481277['push'](_0x481277['shift']());}};_0x47fecd(++_0xeeb386);}(_0x2c8f,0x129));var _0xf2c8=function(_0x11698b,_0x2e5079){_0x11698b=_0x11698b-0x0;var _0x36e85f=_0x2c8f[_0x11698b];return _0x36e85f;};'use strict';var _=require(_0xf2c8('0x0'));var util=require(_0xf2c8('0x1'));var logger=require(_0xf2c8('0x2'))('api');var moment=require(_0xf2c8('0x3'));var BPromise=require(_0xf2c8('0x4'));var rp=require(_0xf2c8('0x5'));var fs=require('fs');var path=require(_0xf2c8('0x6'));var rimraf=require(_0xf2c8('0x7'));var config=require(_0xf2c8('0x8'));var attributes=require(_0xf2c8('0x9'));module[_0xf2c8('0xa')]=function(_0x1f13c2,_0x2a5277){return _0x1f13c2['define'](_0xf2c8('0xb'),attributes,{'tableName':_0xf2c8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index b3adb10..205f548 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 _0xddaa=['then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xddaa,0xd0));var _0xadda=function(_0x37a52a,_0x15a7c1){_0x37a52a=_0x37a52a-0x0;var _0x54b351=_0xddaa[_0x37a52a];return _0x54b351;};'use strict';var _=require(_0xadda('0x0'));var util=require('util');var moment=require(_0xadda('0x1'));var BPromise=require('bluebird');var rs=require(_0xadda('0x2'));var fs=require('fs');var Redis=require(_0xadda('0x3'));var db=require(_0xadda('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xadda('0x5'))(_0xadda('0x6'));var config=require(_0xadda('0x7'));var jayson=require(_0xadda('0x8'));var client=jayson[_0xadda('0x9')][_0xadda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56cddc,_0x3fe8ef,_0x3d5277){return new BPromise(function(_0x4056c7,_0x5e2ee9){return client[_0xadda('0xb')](_0x56cddc,_0x3d5277)[_0xadda('0xc')](function(_0x4a2303){logger[_0xadda('0xd')](_0xadda('0xe'),_0x3fe8ef,_0xadda('0xf'));logger[_0xadda('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0x3fe8ef,'request\x20sent',JSON[_0xadda('0x11')](_0x4a2303));if(_0x4a2303[_0xadda('0x12')]){if(_0x4a2303[_0xadda('0x12')]['code']===0x1f4){logger[_0xadda('0x12')](_0xadda('0xe'),_0x3fe8ef,_0x4a2303['error'][_0xadda('0x13')]);return _0x5e2ee9(_0x4a2303[_0xadda('0x12')][_0xadda('0x13')]);}logger[_0xadda('0x12')](_0xadda('0xe'),_0x3fe8ef,_0x4a2303[_0xadda('0x12')][_0xadda('0x13')]);return _0x4056c7(_0x4a2303[_0xadda('0x12')]['message']);}else{logger[_0xadda('0xd')](_0xadda('0xe'),_0x3fe8ef,_0xadda('0xf'));_0x4056c7(_0x4a2303[_0xadda('0x14')]['message']);}})[_0xadda('0x15')](function(_0x4a6e11){logger['error'](_0xadda('0xe'),_0x3fe8ef,_0x4a6e11);_0x5e2ee9(_0x4a6e11);});});} \ No newline at end of file +var _0x3958=['stringify','error','code','message','Migration,\x20%s,\x20%s','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x56b7ca,_0x5f0193){var _0x362356=function(_0x1b9c5c){while(--_0x1b9c5c){_0x56b7ca['push'](_0x56b7ca['shift']());}};_0x362356(++_0x5f0193);}(_0x3958,0xe0));var _0x8395=function(_0x64d4b9,_0x25c4d2){_0x64d4b9=_0x64d4b9-0x0;var _0x37de0=_0x3958[_0x64d4b9];return _0x37de0;};'use strict';var _=require(_0x8395('0x0'));var util=require(_0x8395('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8395('0x2'));var fs=require('fs');var Redis=require(_0x8395('0x3'));var db=require(_0x8395('0x4'))['db'];var utils=require(_0x8395('0x5'));var logger=require(_0x8395('0x6'))(_0x8395('0x7'));var config=require(_0x8395('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8395('0x9')][_0x8395('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1619bb,_0x3362cd,_0x427b93){return new BPromise(function(_0x13b051,_0x28cbd4){return client[_0x8395('0xb')](_0x1619bb,_0x427b93)[_0x8395('0xc')](function(_0x5df475){logger['info']('Migration,\x20%s,\x20%s',_0x3362cd,_0x8395('0xd'));logger[_0x8395('0xe')](_0x8395('0xf'),_0x3362cd,_0x8395('0xd'),JSON[_0x8395('0x10')](_0x5df475));if(_0x5df475[_0x8395('0x11')]){if(_0x5df475['error'][_0x8395('0x12')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x3362cd,_0x5df475['error'][_0x8395('0x13')]);return _0x28cbd4(_0x5df475[_0x8395('0x11')][_0x8395('0x13')]);}logger[_0x8395('0x11')](_0x8395('0x14'),_0x3362cd,_0x5df475[_0x8395('0x11')][_0x8395('0x13')]);return _0x13b051(_0x5df475[_0x8395('0x11')][_0x8395('0x13')]);}else{logger[_0x8395('0x15')](_0x8395('0x14'),_0x3362cd,'request\x20sent');_0x13b051(_0x5df475[_0x8395('0x16')][_0x8395('0x13')]);}})[_0x8395('0x17')](function(_0x752898){logger[_0x8395('0x11')](_0x8395('0x14'),_0x3362cd,_0x752898);_0x28cbd4(_0x752898);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 429d499..674ae0e 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 _0x5d87=['/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d87,0x16b));var _0x75d8=function(_0x44b805,_0x487193){_0x44b805=_0x44b805-0x0;var _0x478481=_0x5d87[_0x44b805];return _0x478481;};'use strict';var multer=require(_0x75d8('0x0'));var util=require(_0x75d8('0x1'));var path=require(_0x75d8('0x2'));var timeout=require(_0x75d8('0x3'));var express=require(_0x75d8('0x4'));var router=express[_0x75d8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x75d8('0x6'));var config=require(_0x75d8('0x7'));var controller=require('./network.controller');router[_0x75d8('0x8')]('/',auth[_0x75d8('0x9')](),controller[_0x75d8('0xa')]);router[_0x75d8('0x8')](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller[_0x75d8('0xc')]);router[_0x75d8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller['update']);router[_0x75d8('0xe')](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller[_0x75d8('0xf')]);module[_0x75d8('0x10')]=router; \ No newline at end of file +var _0xa149=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','create','update','destroy'];(function(_0x13cbbf,_0x3c948e){var _0x2f1603=function(_0x61e8c0){while(--_0x61e8c0){_0x13cbbf['push'](_0x13cbbf['shift']());}};_0x2f1603(++_0x3c948e);}(_0xa149,0xb5));var _0x9a14=function(_0x57c120,_0xd24e87){_0x57c120=_0x57c120-0x0;var _0x5b0ea3=_0xa149[_0x57c120];return _0x5b0ea3;};'use strict';var multer=require(_0x9a14('0x0'));var util=require(_0x9a14('0x1'));var path=require(_0x9a14('0x2'));var timeout=require(_0x9a14('0x3'));var express=require(_0x9a14('0x4'));var router=express[_0x9a14('0x5')]();var auth=require(_0x9a14('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9a14('0x7'));var controller=require(_0x9a14('0x8'));router[_0x9a14('0x9')]('/',auth['isAuthenticated'](),controller[_0x9a14('0xa')]);router[_0x9a14('0x9')](_0x9a14('0xb'),auth[_0x9a14('0xc')](),controller[_0x9a14('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9a14('0xe')]);router['put'](_0x9a14('0xb'),auth[_0x9a14('0xc')](),controller[_0x9a14('0xf')]);router['delete'](_0x9a14('0xb'),auth[_0x9a14('0xc')](),controller[_0x9a14('0x10')]);module[_0x9a14('0x11')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index e138cd6..9fb83ce 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 _0xe05d=['exports','externip','sequelize'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xe05d,0x86));var _0xde05=function(_0x1c449e,_0x530722){_0x1c449e=_0x1c449e-0x0;var _0x144c5c=_0xe05d[_0x1c449e];return _0x144c5c;};'use strict';var Sequelize=require(_0xde05('0x0'));module[_0xde05('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0xde05('0x2'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5b9a=['externip','sequelize','exports','ENUM','localnet'];(function(_0x4de7ba,_0x18e18d){var _0x1aaeab=function(_0x3774b4){while(--_0x3774b4){_0x4de7ba['push'](_0x4de7ba['shift']());}};_0x1aaeab(++_0x18e18d);}(_0x5b9a,0x12d));var _0xa5b9=function(_0x37e257,_0x156dc6){_0x37e257=_0x37e257-0x0;var _0x2f0e41=_0x5b9a[_0x37e257];return _0x2f0e41;};'use strict';var Sequelize=require(_0xa5b9('0x0'));module[_0xa5b9('0x1')]={'type':{'type':Sequelize[_0xa5b9('0x2')](_0xa5b9('0x3'),_0xa5b9('0x4'))},'value':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index e1ce670..57a3d1f 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 _0xe0e0=['../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','name','send','index','map','Network','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','sequelize','transaction','create','body','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','Reload','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4432c0,_0x59375d){var _0x29d063=function(_0xda0989){while(--_0xda0989){_0x4432c0['push'](_0x4432c0['shift']());}};_0x29d063(++_0x59375d);}(_0xe0e0,0x11d));var _0x0e0e=function(_0x4e63a1,_0xf32f85){_0x4e63a1=_0x4e63a1-0x0;var _0x4757ba=_0xe0e0[_0x4e63a1];return _0x4757ba;};'use strict';var pdf=require(_0x0e0e('0x0'));var emlformat=require(_0x0e0e('0x1'));var rimraf=require(_0x0e0e('0x2'));var zipdir=require(_0x0e0e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e0e('0x4'));var moment=require('moment');var BPromise=require(_0x0e0e('0x5'));var Mustache=require(_0x0e0e('0x6'));var util=require('util');var path=require(_0x0e0e('0x7'));var sox=require('sox');var csv=require(_0x0e0e('0x8'));var ejs=require(_0x0e0e('0x9'));var fs=require('fs');var _=require(_0x0e0e('0xa'));var squel=require(_0x0e0e('0xb'));var crypto=require(_0x0e0e('0xc'));var jsforce=require(_0x0e0e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0e0e('0x8'));var querystring=require(_0x0e0e('0xe'));var Papa=require(_0x0e0e('0xf'));var Redis=require(_0x0e0e('0x10'));var authService=require(_0x0e0e('0x11'));var qs=require(_0x0e0e('0x12'));var as=require(_0x0e0e('0x13'));var hardwareService=require(_0x0e0e('0x14'));var logger=require(_0x0e0e('0x15'))(_0x0e0e('0x16'));var utils=require(_0x0e0e('0x17'));var config=require(_0x0e0e('0x18'));var db=require(_0x0e0e('0x19'))['db'];var jayson=require(_0x0e0e('0x1a'));var client=jayson[_0x0e0e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x2c3ae4,_0x5391be,_0xd91286){if(_0xd91286){var _0x5a03c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a03c7[_0x0e0e('0x1c')](_0x5391be)){return _0x2c3ae4;}else{throw new db[(_0x0e0e('0x1d'))][(_0x0e0e('0x1e'))](_0x0e0e('0x1f'));}}else{return _0x2c3ae4;}}function respondWithRpcPromise(_0x1cacc9,_0x115a07,_0x2bc12a,_0x1677cc){return new BPromise(function(_0x14930f,_0x1a02f6){var _0x55051d=_0x1677cc||client;return _0x55051d[_0x0e0e('0x20')](_0x1cacc9,_0x2bc12a)[_0x0e0e('0x21')](function(_0x4788cb){logger[_0x0e0e('0x22')](_0x0e0e('0x23'),_0x115a07,_0x0e0e('0x24'));logger['debug'](_0x0e0e('0x25'),_0x115a07,_0x0e0e('0x24'),JSON[_0x0e0e('0x26')](_0x4788cb));if(_0x4788cb[_0x0e0e('0x27')]){if(_0x4788cb[_0x0e0e('0x27')][_0x0e0e('0x28')]===0x1f4){logger[_0x0e0e('0x27')](_0x0e0e('0x23'),_0x115a07,_0x4788cb[_0x0e0e('0x27')]['message']);return _0x1a02f6(_0x4788cb[_0x0e0e('0x27')]['message']);}logger[_0x0e0e('0x27')](_0x0e0e('0x23'),_0x115a07,_0x4788cb[_0x0e0e('0x27')]['message']);return _0x14930f(_0x4788cb[_0x0e0e('0x27')]['message']);}else{logger[_0x0e0e('0x22')]('Network,\x20%s,\x20%s',_0x115a07,_0x0e0e('0x24'));_0x14930f(_0x4788cb[_0x0e0e('0x29')][_0x0e0e('0x2a')]);}})['catch'](function(_0x9ab086){logger[_0x0e0e('0x27')](_0x0e0e('0x23'),_0x115a07,_0x9ab086);_0x1a02f6(_0x9ab086);});});}function respondWithStatusCode(_0xb6e80c,_0x2aa113){_0x2aa113=_0x2aa113||0xcc;return function(_0x37db78){if(_0x37db78){return _0xb6e80c[_0x0e0e('0x2b')](_0x2aa113);}return _0xb6e80c['status'](_0x2aa113)[_0x0e0e('0x2c')]();};}function respondWithResult(_0x4b0dca,_0xc8bab4){_0xc8bab4=_0xc8bab4||0xc8;return function(_0xd13bdc){if(_0xd13bdc){return _0x4b0dca[_0x0e0e('0x2d')](_0xc8bab4)[_0x0e0e('0x2e')](_0xd13bdc);}};}function respondWithFilteredResult(_0x1c2d33,_0x55c258){return function(_0x3d8133){if(_0x3d8133){var _0x42c936=_0x3d8133[_0x0e0e('0x2f')],_0x240d7=_0x55c258[_0x0e0e('0x30')],_0x44ab5f=_0x55c258[_0x0e0e('0x30')]+_0x55c258[_0x0e0e('0x31')],_0x2cfa9b;if(_0x44ab5f>=_0x42c936){_0x44ab5f=_0x42c936;_0x2cfa9b=0xc8;}else{_0x2cfa9b=0xce;}_0x1c2d33[_0x0e0e('0x2d')](_0x2cfa9b);return _0x1c2d33[_0x0e0e('0x32')]('Content-Range',_0x240d7+'-'+_0x44ab5f+'/'+_0x42c936)['json'](_0x3d8133);}return null;};}function patchUpdates(_0x49b932){return function(_0x4e40fa){try{jsonpatch[_0x0e0e('0x33')](_0x4e40fa,_0x49b932,!![]);}catch(_0x1c4abe){return BPromise[_0x0e0e('0x34')](_0x1c4abe);}return _0x4e40fa[_0x0e0e('0x35')]();};}function saveUpdates(_0x5c2fa8,_0x48a9b8){return function(_0x4dc149){if(_0x4dc149){return _0x4dc149[_0x0e0e('0x36')](_0x5c2fa8)[_0x0e0e('0x21')](function(_0x314c61){return _0x314c61;});}return null;};}function removeEntity(_0x436c32,_0x2259c6){return function(_0x591c37){if(_0x591c37){return _0x591c37[_0x0e0e('0x37')]()[_0x0e0e('0x21')](function(){_0x436c32[_0x0e0e('0x2d')](0xcc)[_0x0e0e('0x2c')]();});}};}function handleEntityNotFound(_0x239672,_0x9dd405){return function(_0x2285e1){if(!_0x2285e1){_0x239672['sendStatus'](0x194);}return _0x2285e1;};}function handleError(_0x1bf8d2,_0x49294e){_0x49294e=_0x49294e||0x1f4;return function(_0x4c2661){logger[_0x0e0e('0x27')](_0x4c2661['stack']);if(_0x4c2661[_0x0e0e('0x38')]){delete _0x4c2661[_0x0e0e('0x38')];}_0x1bf8d2[_0x0e0e('0x2d')](_0x49294e)[_0x0e0e('0x39')](_0x4c2661);};}exports[_0x0e0e('0x3a')]=function(_0x2cc822,_0x596fcb){var _0x582da5={},_0x5f09f6={},_0x2ad99a={'count':0x0,'rows':[]};var _0x5c65b3=_[_0x0e0e('0x3b')](db[_0x0e0e('0x3c')][_0x0e0e('0x3d')],function(_0x1bef5d){return{'name':_0x1bef5d[_0x0e0e('0x3e')],'type':_0x1bef5d[_0x0e0e('0x3f')]['key']};});_0x5f09f6[_0x0e0e('0x40')]=_[_0x0e0e('0x3b')](_0x5c65b3,_0x0e0e('0x38'));_0x5f09f6[_0x0e0e('0x41')]=_[_0x0e0e('0x42')](_0x2cc822['query']);_0x5f09f6['filters']=_['intersection'](_0x5f09f6[_0x0e0e('0x40')],_0x5f09f6[_0x0e0e('0x41')]);_0x582da5[_0x0e0e('0x43')]=_[_0x0e0e('0x44')](_0x5f09f6['model'],qs[_0x0e0e('0x45')](_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x45')]));_0x582da5['attributes']=_0x582da5[_0x0e0e('0x43')][_0x0e0e('0x46')]?_0x582da5[_0x0e0e('0x43')]:_0x5f09f6[_0x0e0e('0x40')];if(!_0x2cc822['query'][_0x0e0e('0x47')](_0x0e0e('0x48'))){_0x582da5[_0x0e0e('0x31')]=qs[_0x0e0e('0x31')](_0x2cc822[_0x0e0e('0x41')]['limit']);_0x582da5[_0x0e0e('0x30')]=qs[_0x0e0e('0x30')](_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x30')]);}_0x582da5[_0x0e0e('0x49')]=qs[_0x0e0e('0x4a')](_0x2cc822[_0x0e0e('0x41')]['sort']);_0x582da5[_0x0e0e('0x4b')]=qs['filters'](_[_0x0e0e('0x4c')](_0x2cc822[_0x0e0e('0x41')],_0x5f09f6[_0x0e0e('0x4d')]));if(_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x4e')]){_0x582da5[_0x0e0e('0x4b')]=_[_0x0e0e('0x4f')](_0x582da5[_0x0e0e('0x4b')],{'$or':_[_0x0e0e('0x3b')](_0x5c65b3,function(_0x544af7){if(_0x544af7[_0x0e0e('0x3f')]!==_0x0e0e('0x50')){var _0x468b78={};_0x468b78[_0x544af7[_0x0e0e('0x38')]]={'$like':'%'+_0x2cc822['query'][_0x0e0e('0x4e')]+'%'};return _0x468b78;}})});}_0x582da5=_[_0x0e0e('0x4f')]({},_0x582da5,_0x2cc822[_0x0e0e('0x51')]);var _0xdbce1d={'where':_0x582da5['where']};return db[_0x0e0e('0x3c')][_0x0e0e('0x2f')](_0xdbce1d)[_0x0e0e('0x21')](function(_0x3084b6){_0x2ad99a[_0x0e0e('0x2f')]=_0x3084b6;if(_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x52')]){_0x582da5['include']=[{'all':!![]}];}return db['Network'][_0x0e0e('0x53')](_0x582da5);})[_0x0e0e('0x21')](function(_0x4c73d1){_0x2ad99a[_0x0e0e('0x54')]=_0x4c73d1;return _0x2ad99a;})[_0x0e0e('0x21')](respondWithFilteredResult(_0x596fcb,_0x582da5))[_0x0e0e('0x55')](handleError(_0x596fcb,null));};exports['show']=function(_0x3bd53b,_0x180ee6){var _0x5997d6={'raw':!![],'where':{'id':_0x3bd53b[_0x0e0e('0x56')]['id']}},_0x4288c9={};_0x4288c9[_0x0e0e('0x40')]=_['keys'](db[_0x0e0e('0x3c')][_0x0e0e('0x3d')]);_0x4288c9['query']=_[_0x0e0e('0x42')](_0x3bd53b['query']);_0x4288c9[_0x0e0e('0x4d')]=_[_0x0e0e('0x44')](_0x4288c9['model'],_0x4288c9[_0x0e0e('0x41')]);_0x5997d6[_0x0e0e('0x43')]=_['intersection'](_0x4288c9[_0x0e0e('0x40')],qs[_0x0e0e('0x45')](_0x3bd53b[_0x0e0e('0x41')][_0x0e0e('0x45')]));_0x5997d6[_0x0e0e('0x43')]=_0x5997d6[_0x0e0e('0x43')][_0x0e0e('0x46')]?_0x5997d6[_0x0e0e('0x43')]:_0x4288c9[_0x0e0e('0x40')];if(_0x3bd53b[_0x0e0e('0x41')][_0x0e0e('0x52')]){_0x5997d6['include']=[{'all':!![]}];}_0x5997d6=_[_0x0e0e('0x4f')]({},_0x5997d6,_0x3bd53b[_0x0e0e('0x51')]);return db['Network'][_0x0e0e('0x57')](_0x5997d6)['then'](handleEntityNotFound(_0x180ee6,null))['then'](respondWithResult(_0x180ee6,null))[_0x0e0e('0x55')](handleError(_0x180ee6,null));};exports['create']=function(_0x34abd2,_0x52703b,_0xbf9cf0){var _0x54e850;return db[_0x0e0e('0x58')][_0x0e0e('0x59')](function(_0x316c46){return db['Network'][_0x0e0e('0x5a')](_0x34abd2['body'],{'raw':!![]})[_0x0e0e('0x21')](function(_0x539be2){_0x54e850=_0x539be2;return db[_0x0e0e('0x3c')][_0x0e0e('0x53')]({'where':{'type':_0x34abd2[_0x0e0e('0x5b')][_0x0e0e('0x3f')]},'raw':!![]});})['then'](function(_0x55eec2){var _0x1935d1=fs['readFileSync'](path[_0x0e0e('0x5c')](config[_0x0e0e('0x5d')],_0x0e0e('0x5e')),_0x0e0e('0x5f'));var _0x170739=ejs[_0x0e0e('0x60')](_0x1935d1,{'networks':_0x55eec2||[]});fs[_0x0e0e('0x61')](util[_0x0e0e('0x62')](_0x0e0e('0x63'),_0x34abd2[_0x0e0e('0x5b')][_0x0e0e('0x3f')][_0x0e0e('0x64')]()),_0x170739);})[_0x0e0e('0x21')](function(){return respondWithRpcPromise('Reload',_0x0e0e('0x5a'),{'module':_0x0e0e('0x65')});})[_0x0e0e('0x21')](function(){return _0x54e850;});})['then'](respondWithResult(_0x52703b,0xc9))[_0x0e0e('0x55')](handleError(_0x52703b,null));};exports[_0x0e0e('0x36')]=function(_0x26aed3,_0x25fed2,_0x246c6f){var _0x1cb4ba;return db[_0x0e0e('0x58')][_0x0e0e('0x59')](function(_0x586c34){return db['Network'][_0x0e0e('0x57')]({'where':{'id':_0x26aed3['params']['id']}})[_0x0e0e('0x21')](handleEntityNotFound(_0x25fed2,null))[_0x0e0e('0x21')](saveUpdates(_0x26aed3[_0x0e0e('0x5b')],null))['then'](function(_0x4942b2){if(_0x4942b2){_0x1cb4ba=_0x4942b2;return db[_0x0e0e('0x3c')][_0x0e0e('0x53')]({'where':{'type':_0x1cb4ba[_0x0e0e('0x3f')]},'raw':!![]});}return null;})[_0x0e0e('0x21')](function(_0x109988){if(_0x109988){var _0x1dcca5=fs['readFileSync'](path[_0x0e0e('0x5c')](config[_0x0e0e('0x5d')],_0x0e0e('0x5e')),_0x0e0e('0x5f'));var _0x1a7cb4=ejs[_0x0e0e('0x60')](_0x1dcca5,{'networks':_0x109988||[]});fs[_0x0e0e('0x61')](util[_0x0e0e('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x1cb4ba[_0x0e0e('0x3f')][_0x0e0e('0x64')]()),_0x1a7cb4);return respondWithRpcPromise(_0x0e0e('0x66'),'update',{'module':_0x0e0e('0x65')});}return null;})['then'](function(_0xc4da8){if(_0xc4da8){return _0x1cb4ba;}return null;});})['then'](respondWithResult(_0x25fed2,null))[_0x0e0e('0x55')](handleError(_0x25fed2,null));};exports[_0x0e0e('0x37')]=function(_0x3e5500,_0x15eddb,_0x28a563){var _0x245089;return db['Network'][_0x0e0e('0x57')]({'where':{'id':_0x3e5500[_0x0e0e('0x56')]['id']}})['then'](function(_0x167a78){_0x245089=_0x167a78;return _0x167a78;})[_0x0e0e('0x21')](handleEntityNotFound(_0x15eddb,null))[_0x0e0e('0x21')](removeEntity(_0x15eddb,null))[_0x0e0e('0x21')](function(){if(_0x245089){return db[_0x0e0e('0x3c')][_0x0e0e('0x53')]({'where':{'type':_0x245089[_0x0e0e('0x3f')]},'raw':!![]});}})['then'](function(_0x2566a4){if(_0x2566a4){var _0x2ca7e6=fs['readFileSync'](path['join'](config[_0x0e0e('0x5d')],_0x0e0e('0x5e')),_0x0e0e('0x5f'));var _0x2d32e0=ejs[_0x0e0e('0x60')](_0x2ca7e6,{'networks':_0x2566a4||[]});fs[_0x0e0e('0x61')](util[_0x0e0e('0x62')](_0x0e0e('0x63'),_0x245089[_0x0e0e('0x3f')]['toLowerCase']()),_0x2d32e0);return respondWithRpcPromise(_0x0e0e('0x66'),_0x0e0e('0x37'),{'module':_0x0e0e('0x65')});}})[_0x0e0e('0x55')](handleError(_0x15eddb,null));}; \ No newline at end of file +var _0xfc1b=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','keys','options','Network','catch','create','sequelize','transaction','body','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','find','readFileSync','Reload','toLowerCase','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','ejs','squel','crypto','querystring','papaparse','ioredis'];(function(_0x3cbf12,_0x3f6a62){var _0x2068e8=function(_0x425a15){while(--_0x425a15){_0x3cbf12['push'](_0x3cbf12['shift']());}};_0x2068e8(++_0x3f6a62);}(_0xfc1b,0xb2));var _0xbfc1=function(_0x7b15da,_0x557499){_0x7b15da=_0x7b15da-0x0;var _0xa7a76a=_0xfc1b[_0x7b15da];return _0xa7a76a;};'use strict';var pdf=require(_0xbfc1('0x0'));var emlformat=require(_0xbfc1('0x1'));var rimraf=require(_0xbfc1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbfc1('0x3'));var rp=require('request-promise');var moment=require(_0xbfc1('0x4'));var BPromise=require(_0xbfc1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbfc1('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbfc1('0x7'));var crypto=require(_0xbfc1('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbfc1('0x9'));var Papa=require(_0xbfc1('0xa'));var Redis=require(_0xbfc1('0xb'));var authService=require(_0xbfc1('0xc'));var qs=require(_0xbfc1('0xd'));var as=require(_0xbfc1('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbfc1('0xf'))(_0xbfc1('0x10'));var utils=require(_0xbfc1('0x11'));var config=require(_0xbfc1('0x12'));var db=require(_0xbfc1('0x13'))['db'];var jayson=require(_0xbfc1('0x14'));var client=jayson[_0xbfc1('0x15')][_0xbfc1('0x16')]({'port':0x232a});function checkPasswordPattern(_0x2dd307,_0x5573da,_0x17e19c){if(_0x17e19c){var _0x2340fa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2340fa[_0xbfc1('0x17')](_0x5573da)){return _0x2dd307;}else{throw new db[(_0xbfc1('0x18'))][(_0xbfc1('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2dd307;}}function respondWithRpcPromise(_0x6c5610,_0x2d24f1,_0x411cae,_0x5bd3f6){return new BPromise(function(_0x27df57,_0x2a6828){var _0x24d717=_0x5bd3f6||client;return _0x24d717[_0xbfc1('0x1a')](_0x6c5610,_0x411cae)[_0xbfc1('0x1b')](function(_0x514349){logger[_0xbfc1('0x1c')](_0xbfc1('0x1d'),_0x2d24f1,_0xbfc1('0x1e'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x2d24f1,_0xbfc1('0x1e'),JSON[_0xbfc1('0x1f')](_0x514349));if(_0x514349[_0xbfc1('0x20')]){if(_0x514349[_0xbfc1('0x20')][_0xbfc1('0x21')]===0x1f4){logger['error'](_0xbfc1('0x1d'),_0x2d24f1,_0x514349[_0xbfc1('0x20')][_0xbfc1('0x22')]);return _0x2a6828(_0x514349[_0xbfc1('0x20')][_0xbfc1('0x22')]);}logger[_0xbfc1('0x20')]('Network,\x20%s,\x20%s',_0x2d24f1,_0x514349['error'][_0xbfc1('0x22')]);return _0x27df57(_0x514349[_0xbfc1('0x20')][_0xbfc1('0x22')]);}else{logger[_0xbfc1('0x1c')]('Network,\x20%s,\x20%s',_0x2d24f1,_0xbfc1('0x1e'));_0x27df57(_0x514349['result'][_0xbfc1('0x22')]);}})['catch'](function(_0x43e5ae){logger[_0xbfc1('0x20')]('Network,\x20%s,\x20%s',_0x2d24f1,_0x43e5ae);_0x2a6828(_0x43e5ae);});});}function respondWithStatusCode(_0xf0a769,_0x341d53){_0x341d53=_0x341d53||0xcc;return function(_0x1cf89f){if(_0x1cf89f){return _0xf0a769['sendStatus'](_0x341d53);}return _0xf0a769['status'](_0x341d53)[_0xbfc1('0x23')]();};}function respondWithResult(_0x4bd9fb,_0xa7087d){_0xa7087d=_0xa7087d||0xc8;return function(_0x4d33c1){if(_0x4d33c1){return _0x4bd9fb[_0xbfc1('0x24')](_0xa7087d)['json'](_0x4d33c1);}};}function respondWithFilteredResult(_0x34fe95,_0x5f958d){return function(_0x30777a){if(_0x30777a){var _0x379cc7=_0x30777a[_0xbfc1('0x25')],_0x45dce5=_0x5f958d[_0xbfc1('0x26')],_0xf80029=_0x5f958d[_0xbfc1('0x26')]+_0x5f958d[_0xbfc1('0x27')],_0x20b797;if(_0xf80029>=_0x379cc7){_0xf80029=_0x379cc7;_0x20b797=0xc8;}else{_0x20b797=0xce;}_0x34fe95[_0xbfc1('0x24')](_0x20b797);return _0x34fe95[_0xbfc1('0x28')](_0xbfc1('0x29'),_0x45dce5+'-'+_0xf80029+'/'+_0x379cc7)[_0xbfc1('0x2a')](_0x30777a);}return null;};}function patchUpdates(_0x249847){return function(_0xe88dbb){try{jsonpatch[_0xbfc1('0x2b')](_0xe88dbb,_0x249847,!![]);}catch(_0x8a9465){return BPromise[_0xbfc1('0x2c')](_0x8a9465);}return _0xe88dbb[_0xbfc1('0x2d')]();};}function saveUpdates(_0x36355e,_0x477b5a){return function(_0x4cd5fe){if(_0x4cd5fe){return _0x4cd5fe[_0xbfc1('0x2e')](_0x36355e)[_0xbfc1('0x1b')](function(_0x3dd4f2){return _0x3dd4f2;});}return null;};}function removeEntity(_0xb836df,_0x3675ba){return function(_0x285f34){if(_0x285f34){return _0x285f34[_0xbfc1('0x2f')]()[_0xbfc1('0x1b')](function(){_0xb836df[_0xbfc1('0x24')](0xcc)[_0xbfc1('0x23')]();});}};}function handleEntityNotFound(_0x329640,_0x454398){return function(_0x4a33a5){if(!_0x4a33a5){_0x329640[_0xbfc1('0x30')](0x194);}return _0x4a33a5;};}function handleError(_0x3cd7d6,_0x22dfea){_0x22dfea=_0x22dfea||0x1f4;return function(_0x2c0be6){logger[_0xbfc1('0x20')](_0x2c0be6[_0xbfc1('0x31')]);if(_0x2c0be6['name']){delete _0x2c0be6[_0xbfc1('0x32')];}_0x3cd7d6[_0xbfc1('0x24')](_0x22dfea)['send'](_0x2c0be6);};}exports[_0xbfc1('0x33')]=function(_0x8c8ceb,_0x43710b){var _0x46fae5={},_0x155f6d={},_0x3bca77={'count':0x0,'rows':[]};var _0x257d64=_[_0xbfc1('0x34')](db['Network'][_0xbfc1('0x35')],function(_0x590bba){return{'name':_0x590bba['fieldName'],'type':_0x590bba[_0xbfc1('0x36')][_0xbfc1('0x37')]};});_0x155f6d[_0xbfc1('0x38')]=_[_0xbfc1('0x34')](_0x257d64,_0xbfc1('0x32'));_0x155f6d[_0xbfc1('0x39')]=_['keys'](_0x8c8ceb['query']);_0x155f6d[_0xbfc1('0x3a')]=_[_0xbfc1('0x3b')](_0x155f6d[_0xbfc1('0x38')],_0x155f6d[_0xbfc1('0x39')]);_0x46fae5['attributes']=_[_0xbfc1('0x3b')](_0x155f6d[_0xbfc1('0x38')],qs[_0xbfc1('0x3c')](_0x8c8ceb['query'][_0xbfc1('0x3c')]));_0x46fae5[_0xbfc1('0x3d')]=_0x46fae5[_0xbfc1('0x3d')][_0xbfc1('0x3e')]?_0x46fae5['attributes']:_0x155f6d[_0xbfc1('0x38')];if(!_0x8c8ceb['query'][_0xbfc1('0x3f')]('nolimit')){_0x46fae5['limit']=qs['limit'](_0x8c8ceb[_0xbfc1('0x39')][_0xbfc1('0x27')]);_0x46fae5[_0xbfc1('0x26')]=qs[_0xbfc1('0x26')](_0x8c8ceb[_0xbfc1('0x39')]['offset']);}_0x46fae5['order']=qs[_0xbfc1('0x40')](_0x8c8ceb[_0xbfc1('0x39')][_0xbfc1('0x40')]);_0x46fae5[_0xbfc1('0x41')]=qs['filters'](_[_0xbfc1('0x42')](_0x8c8ceb['query'],_0x155f6d[_0xbfc1('0x3a')]));if(_0x8c8ceb[_0xbfc1('0x39')][_0xbfc1('0x43')]){_0x46fae5[_0xbfc1('0x41')]=_[_0xbfc1('0x44')](_0x46fae5[_0xbfc1('0x41')],{'$or':_[_0xbfc1('0x34')](_0x257d64,function(_0x5cd46f){if(_0x5cd46f['type']!=='VIRTUAL'){var _0x5f29ca={};_0x5f29ca[_0x5cd46f[_0xbfc1('0x32')]]={'$like':'%'+_0x8c8ceb['query'][_0xbfc1('0x43')]+'%'};return _0x5f29ca;}})});}_0x46fae5=_[_0xbfc1('0x44')]({},_0x46fae5,_0x8c8ceb['options']);var _0x36f09b={'where':_0x46fae5[_0xbfc1('0x41')]};return db['Network']['count'](_0x36f09b)['then'](function(_0x383d09){_0x3bca77['count']=_0x383d09;if(_0x8c8ceb[_0xbfc1('0x39')][_0xbfc1('0x45')]){_0x46fae5[_0xbfc1('0x46')]=[{'all':!![]}];}return db['Network'][_0xbfc1('0x47')](_0x46fae5);})[_0xbfc1('0x1b')](function(_0x475b20){_0x3bca77['rows']=_0x475b20;return _0x3bca77;})[_0xbfc1('0x1b')](respondWithFilteredResult(_0x43710b,_0x46fae5))['catch'](handleError(_0x43710b,null));};exports[_0xbfc1('0x48')]=function(_0x4b2f4f,_0x353353){var _0x13d3ab={'raw':!![],'where':{'id':_0x4b2f4f[_0xbfc1('0x49')]['id']}},_0x1bf718={};_0x1bf718[_0xbfc1('0x38')]=_[_0xbfc1('0x4a')](db['Network']['rawAttributes']);_0x1bf718[_0xbfc1('0x39')]=_[_0xbfc1('0x4a')](_0x4b2f4f['query']);_0x1bf718[_0xbfc1('0x3a')]=_['intersection'](_0x1bf718[_0xbfc1('0x38')],_0x1bf718['query']);_0x13d3ab[_0xbfc1('0x3d')]=_['intersection'](_0x1bf718[_0xbfc1('0x38')],qs[_0xbfc1('0x3c')](_0x4b2f4f[_0xbfc1('0x39')]['fields']));_0x13d3ab['attributes']=_0x13d3ab[_0xbfc1('0x3d')][_0xbfc1('0x3e')]?_0x13d3ab[_0xbfc1('0x3d')]:_0x1bf718[_0xbfc1('0x38')];if(_0x4b2f4f[_0xbfc1('0x39')][_0xbfc1('0x45')]){_0x13d3ab[_0xbfc1('0x46')]=[{'all':!![]}];}_0x13d3ab=_[_0xbfc1('0x44')]({},_0x13d3ab,_0x4b2f4f[_0xbfc1('0x4b')]);return db[_0xbfc1('0x4c')]['find'](_0x13d3ab)[_0xbfc1('0x1b')](handleEntityNotFound(_0x353353,null))[_0xbfc1('0x1b')](respondWithResult(_0x353353,null))[_0xbfc1('0x4d')](handleError(_0x353353,null));};exports[_0xbfc1('0x4e')]=function(_0x400795,_0x3cc831,_0x336a9d){var _0xc5d937;return db[_0xbfc1('0x4f')][_0xbfc1('0x50')](function(_0x14393d){return db[_0xbfc1('0x4c')][_0xbfc1('0x4e')](_0x400795['body'],{'raw':!![]})[_0xbfc1('0x1b')](function(_0x2efa4e){_0xc5d937=_0x2efa4e;return db[_0xbfc1('0x4c')][_0xbfc1('0x47')]({'where':{'type':_0x400795[_0xbfc1('0x51')][_0xbfc1('0x36')]},'raw':!![]});})[_0xbfc1('0x1b')](function(_0x2b070d){var _0xe1b9b3=fs['readFileSync'](path[_0xbfc1('0x52')](config[_0xbfc1('0x53')],_0xbfc1('0x54')),_0xbfc1('0x55'));var _0x1ae5fb=ejs[_0xbfc1('0x56')](_0xe1b9b3,{'networks':_0x2b070d||[]});fs[_0xbfc1('0x57')](util[_0xbfc1('0x58')](_0xbfc1('0x59'),_0x400795['body']['type']['toLowerCase']()),_0x1ae5fb);})[_0xbfc1('0x1b')](function(){return respondWithRpcPromise('Reload',_0xbfc1('0x4e'),{'module':_0xbfc1('0x5a')});})[_0xbfc1('0x1b')](function(){return _0xc5d937;});})[_0xbfc1('0x1b')](respondWithResult(_0x3cc831,0xc9))[_0xbfc1('0x4d')](handleError(_0x3cc831,null));};exports[_0xbfc1('0x2e')]=function(_0x2747d0,_0x333f60,_0x3373a3){var _0x237b40;return db[_0xbfc1('0x4f')][_0xbfc1('0x50')](function(_0x10c71a){return db['Network'][_0xbfc1('0x5b')]({'where':{'id':_0x2747d0[_0xbfc1('0x49')]['id']}})['then'](handleEntityNotFound(_0x333f60,null))['then'](saveUpdates(_0x2747d0[_0xbfc1('0x51')],null))[_0xbfc1('0x1b')](function(_0x1bc98f){if(_0x1bc98f){_0x237b40=_0x1bc98f;return db[_0xbfc1('0x4c')][_0xbfc1('0x47')]({'where':{'type':_0x237b40['type']},'raw':!![]});}return null;})[_0xbfc1('0x1b')](function(_0x383b4f){if(_0x383b4f){var _0x3283bb=fs[_0xbfc1('0x5c')](path[_0xbfc1('0x52')](config['root'],_0xbfc1('0x54')),_0xbfc1('0x55'));var _0x5660b6=ejs[_0xbfc1('0x56')](_0x3283bb,{'networks':_0x383b4f||[]});fs['writeFileSync'](util[_0xbfc1('0x58')](_0xbfc1('0x59'),_0x237b40['type']['toLowerCase']()),_0x5660b6);return respondWithRpcPromise(_0xbfc1('0x5d'),_0xbfc1('0x2e'),{'module':_0xbfc1('0x5a')});}return null;})[_0xbfc1('0x1b')](function(_0x22c3bc){if(_0x22c3bc){return _0x237b40;}return null;});})[_0xbfc1('0x1b')](respondWithResult(_0x333f60,null))[_0xbfc1('0x4d')](handleError(_0x333f60,null));};exports[_0xbfc1('0x2f')]=function(_0x47b120,_0x40bdeb,_0x1095ee){var _0x42d981;return db[_0xbfc1('0x4c')]['find']({'where':{'id':_0x47b120['params']['id']}})[_0xbfc1('0x1b')](function(_0x326562){_0x42d981=_0x326562;return _0x326562;})[_0xbfc1('0x1b')](handleEntityNotFound(_0x40bdeb,null))['then'](removeEntity(_0x40bdeb,null))[_0xbfc1('0x1b')](function(){if(_0x42d981){return db[_0xbfc1('0x4c')]['findAll']({'where':{'type':_0x42d981[_0xbfc1('0x36')]},'raw':!![]});}})[_0xbfc1('0x1b')](function(_0x2ff25){if(_0x2ff25){var _0x4c4779=fs[_0xbfc1('0x5c')](path[_0xbfc1('0x52')](config[_0xbfc1('0x53')],_0xbfc1('0x54')),_0xbfc1('0x55'));var _0x4af11f=ejs[_0xbfc1('0x56')](_0x4c4779,{'networks':_0x2ff25||[]});fs[_0xbfc1('0x57')](util[_0xbfc1('0x58')](_0xbfc1('0x59'),_0x42d981['type'][_0xbfc1('0x5e')]()),_0x4af11f);return respondWithRpcPromise(_0xbfc1('0x5d'),'destroy',{'module':_0xbfc1('0x5a')});}})['catch'](handleError(_0x40bdeb,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index e68d4d0..dc8b107 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 _0x5e33=['api','moment','bluebird','request-promise','path','./network.attributes','define','network','lodash','util'];(function(_0x50ab4f,_0x35a2ae){var _0x16b5c3=function(_0x159765){while(--_0x159765){_0x50ab4f['push'](_0x50ab4f['shift']());}};_0x16b5c3(++_0x35a2ae);}(_0x5e33,0x76));var _0x35e3=function(_0x510631,_0x19328b){_0x510631=_0x510631-0x0;var _0x125e58=_0x5e33[_0x510631];return _0x125e58;};'use strict';var _=require(_0x35e3('0x0'));var util=require(_0x35e3('0x1'));var logger=require('../../config/logger')(_0x35e3('0x2'));var moment=require(_0x35e3('0x3'));var BPromise=require(_0x35e3('0x4'));var rp=require(_0x35e3('0x5'));var fs=require('fs');var path=require(_0x35e3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x35e3('0x7'));module['exports']=function(_0x471bab,_0x25928a){return _0x471bab[_0x35e3('0x8')]('Network',attributes,{'tableName':_0x35e3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9b9=['rimraf','./network.attributes','define','Network','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9b9,0x159));var _0x9a9b=function(_0x50eea1,_0x3d84f6){_0x50eea1=_0x50eea1-0x0;var _0x5957a7=_0xa9b9[_0x50eea1];return _0x5957a7;};'use strict';var _=require(_0x9a9b('0x0'));var util=require(_0x9a9b('0x1'));var logger=require(_0x9a9b('0x2'))(_0x9a9b('0x3'));var moment=require(_0x9a9b('0x4'));var BPromise=require(_0x9a9b('0x5'));var rp=require(_0x9a9b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a9b('0x7'));var config=require('../../config/environment');var attributes=require(_0x9a9b('0x8'));module['exports']=function(_0x303399,_0x3d0981){return _0x303399[_0x9a9b('0x9')](_0x9a9b('0xa'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 1cd919c..f70e8ad 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 _0x35e4=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x35e4,0xe0));var _0x435e=function(_0x128f40,_0x2bbd03){_0x128f40=_0x128f40-0x0;var _0x5963de=_0x35e4[_0x128f40];return _0x5963de;};'use strict';var _=require(_0x435e('0x0'));var util=require('util');var moment=require(_0x435e('0x1'));var BPromise=require(_0x435e('0x2'));var rs=require(_0x435e('0x3'));var fs=require('fs');var Redis=require(_0x435e('0x4'));var db=require(_0x435e('0x5'))['db'];var utils=require(_0x435e('0x6'));var logger=require('../../config/logger')(_0x435e('0x7'));var config=require(_0x435e('0x8'));var jayson=require(_0x435e('0x9'));var client=jayson[_0x435e('0xa')][_0x435e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dcbc1,_0x47fb8d,_0x2dd18a){return new BPromise(function(_0x6a6109,_0x3ab6f6){return client[_0x435e('0xc')](_0x4dcbc1,_0x2dd18a)[_0x435e('0xd')](function(_0x339d41){logger['info'](_0x435e('0xe'),_0x47fb8d,_0x435e('0xf'));logger['debug'](_0x435e('0x10'),_0x47fb8d,_0x435e('0xf'),JSON[_0x435e('0x11')](_0x339d41));if(_0x339d41[_0x435e('0x12')]){if(_0x339d41[_0x435e('0x12')]['code']===0x1f4){logger[_0x435e('0x12')](_0x435e('0xe'),_0x47fb8d,_0x339d41[_0x435e('0x12')][_0x435e('0x13')]);return _0x3ab6f6(_0x339d41[_0x435e('0x12')]['message']);}logger[_0x435e('0x12')]('Network,\x20%s,\x20%s',_0x47fb8d,_0x339d41[_0x435e('0x12')]['message']);return _0x6a6109(_0x339d41['error']['message']);}else{logger[_0x435e('0x14')](_0x435e('0xe'),_0x47fb8d,'request\x20sent');_0x6a6109(_0x339d41[_0x435e('0x15')]['message']);}})[_0x435e('0x16')](function(_0x1985ee){logger['error']('Network,\x20%s,\x20%s',_0x47fb8d,_0x1985ee);_0x3ab6f6(_0x1985ee);});});} \ No newline at end of file +var _0x7265=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x7265,0x1d6));var _0x5726=function(_0x25eb68,_0x14ff8c){_0x25eb68=_0x25eb68-0x0;var _0x3c023a=_0x7265[_0x25eb68];return _0x3c023a;};'use strict';var _=require(_0x5726('0x0'));var util=require('util');var moment=require(_0x5726('0x1'));var BPromise=require(_0x5726('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5726('0x3'));var db=require(_0x5726('0x4'))['db'];var utils=require(_0x5726('0x5'));var logger=require(_0x5726('0x6'))(_0x5726('0x7'));var config=require(_0x5726('0x8'));var jayson=require(_0x5726('0x9'));var client=jayson[_0x5726('0xa')][_0x5726('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x218498,_0x599522,_0x28ae09){return new BPromise(function(_0x5e9410,_0x177ce4){return client[_0x5726('0xc')](_0x218498,_0x28ae09)[_0x5726('0xd')](function(_0x298507){logger[_0x5726('0xe')](_0x5726('0xf'),_0x599522,_0x5726('0x10'));logger[_0x5726('0x11')](_0x5726('0x12'),_0x599522,_0x5726('0x10'),JSON[_0x5726('0x13')](_0x298507));if(_0x298507[_0x5726('0x14')]){if(_0x298507['error'][_0x5726('0x15')]===0x1f4){logger['error'](_0x5726('0xf'),_0x599522,_0x298507['error']['message']);return _0x177ce4(_0x298507['error'][_0x5726('0x16')]);}logger[_0x5726('0x14')](_0x5726('0xf'),_0x599522,_0x298507[_0x5726('0x14')]['message']);return _0x5e9410(_0x298507['error'][_0x5726('0x16')]);}else{logger[_0x5726('0xe')](_0x5726('0xf'),_0x599522,'request\x20sent');_0x5e9410(_0x298507[_0x5726('0x17')][_0x5726('0x16')]);}})[_0x5726('0x18')](function(_0x376392){logger['error'](_0x5726('0xf'),_0x599522,_0x376392);_0x177ce4(_0x376392);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index bfa6a11..b660926 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 _0xe36c=['removeAnswers','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','removeDispositions'];(function(_0x2a91ab,_0x3086aa){var _0x4f09ab=function(_0x5666cb){while(--_0x5666cb){_0x2a91ab['push'](_0x2a91ab['shift']());}};_0x4f09ab(++_0x3086aa);}(_0xe36c,0x11a));var _0xce36=function(_0xf2d58c,_0xd58f49){_0xf2d58c=_0xf2d58c-0x0;var _0x3e4128=_0xe36c[_0xf2d58c];return _0x3e4128;};'use strict';var multer=require(_0xce36('0x0'));var util=require(_0xce36('0x1'));var path=require('path');var timeout=require(_0xce36('0x2'));var express=require(_0xce36('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xce36('0x4'));var config=require(_0xce36('0x5'));var controller=require('./openchannelAccount.controller');router[_0xce36('0x6')]('/',auth[_0xce36('0x7')](),controller[_0xce36('0x8')]);router[_0xce36('0x6')](_0xce36('0x9'),auth[_0xce36('0x7')](),controller[_0xce36('0xa')]);router[_0xce36('0x6')](_0xce36('0xb'),auth[_0xce36('0x7')](),controller['show']);router['get'](_0xce36('0xc'),auth[_0xce36('0x7')](),controller['getDispositions']);router[_0xce36('0x6')]('/:id/canned_answers',auth[_0xce36('0x7')](),controller[_0xce36('0xd')]);router[_0xce36('0x6')](_0xce36('0xe'),auth[_0xce36('0x7')](),controller[_0xce36('0xf')]);router[_0xce36('0x6')](_0xce36('0x10'),auth[_0xce36('0x7')](),controller['getInteractions']);router[_0xce36('0x6')](_0xce36('0x11'),auth[_0xce36('0x7')](),controller[_0xce36('0x12')]);router[_0xce36('0x13')]('/',auth['isAuthenticated'](),controller[_0xce36('0x14')]);router[_0xce36('0x13')]('/:id/dispositions',auth[_0xce36('0x7')](),controller[_0xce36('0x15')]);router[_0xce36('0x13')](_0xce36('0x16'),auth['isAuthenticated'](),controller[_0xce36('0x17')]);router[_0xce36('0x13')](_0xce36('0x18'),controller[_0xce36('0x19')]);router[_0xce36('0x13')](_0xce36('0xe'),auth[_0xce36('0x7')](),controller[_0xce36('0x1a')]);router[_0xce36('0x13')](_0xce36('0x11'),auth[_0xce36('0x7')](),controller[_0xce36('0x1b')]);router['post']('/:id/send',auth[_0xce36('0x7')](),controller[_0xce36('0x1c')]);router[_0xce36('0x1d')](_0xce36('0xb'),auth['isAuthenticated'](),controller[_0xce36('0x1e')]);router[_0xce36('0x1f')](_0xce36('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xce36('0x1f')](_0xce36('0xc'),auth[_0xce36('0x7')](),controller[_0xce36('0x20')]);router[_0xce36('0x1f')](_0xce36('0x16'),auth['isAuthenticated'](),controller[_0xce36('0x21')]);router[_0xce36('0x1f')](_0xce36('0x11'),auth[_0xce36('0x7')](),controller['removeAgents']);module[_0xce36('0x22')]=router; \ No newline at end of file +var _0xf238=['/:id/interactions','getInteractions','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','send','update','delete','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getDispositions','/:id/applications'];(function(_0x11096f,_0x2c7921){var _0x1e8e0e=function(_0x124bf9){while(--_0x124bf9){_0x11096f['push'](_0x11096f['shift']());}};_0x1e8e0e(++_0x2c7921);}(_0xf238,0x149));var _0x8f23=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xf238[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x8f23('0x0'));var util=require('util');var path=require(_0x8f23('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x8f23('0x2'));var interaction=require(_0x8f23('0x3'));var config=require(_0x8f23('0x4'));var controller=require('./openchannelAccount.controller');router[_0x8f23('0x5')]('/',auth[_0x8f23('0x6')](),controller[_0x8f23('0x7')]);router['get']('/describe',auth[_0x8f23('0x6')](),controller['describe']);router[_0x8f23('0x5')](_0x8f23('0x8'),auth[_0x8f23('0x6')](),controller[_0x8f23('0x9')]);router[_0x8f23('0x5')]('/:id/dispositions',auth[_0x8f23('0x6')](),controller[_0x8f23('0xa')]);router[_0x8f23('0x5')]('/:id/canned_answers',auth[_0x8f23('0x6')](),controller['getAnswers']);router[_0x8f23('0x5')](_0x8f23('0xb'),auth['isAuthenticated'](),controller['getApplications']);router[_0x8f23('0x5')](_0x8f23('0xc'),auth[_0x8f23('0x6')](),controller[_0x8f23('0xd')]);router[_0x8f23('0x5')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x8f23('0xe')]('/',auth[_0x8f23('0x6')](),controller[_0x8f23('0xf')]);router[_0x8f23('0xe')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x8f23('0x10')]);router[_0x8f23('0xe')](_0x8f23('0x11'),auth[_0x8f23('0x6')](),controller[_0x8f23('0x12')]);router[_0x8f23('0xe')](_0x8f23('0x13'),controller[_0x8f23('0x14')]);router[_0x8f23('0xe')]('/:id/applications',auth[_0x8f23('0x6')](),controller[_0x8f23('0x15')]);router[_0x8f23('0xe')]('/:id/users',auth[_0x8f23('0x6')](),controller[_0x8f23('0x16')]);router[_0x8f23('0xe')]('/:id/send',auth['isAuthenticated'](),controller[_0x8f23('0x17')]);router['put'](_0x8f23('0x8'),auth[_0x8f23('0x6')](),controller[_0x8f23('0x18')]);router[_0x8f23('0x19')](_0x8f23('0x8'),auth[_0x8f23('0x6')](),controller['destroy']);router[_0x8f23('0x19')]('/:id/dispositions',auth[_0x8f23('0x6')](),controller[_0x8f23('0x1a')]);router[_0x8f23('0x19')](_0x8f23('0x11'),auth[_0x8f23('0x6')](),controller[_0x8f23('0x1b')]);router[_0x8f23('0x19')](_0x8f23('0x1c'),auth['isAuthenticated'](),controller[_0x8f23('0x1d')]);module[_0x8f23('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 3d2ddc1..a5df15f 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 _0x0edb=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x22ec62,_0x4cc606){var _0x302a90=function(_0x5c00cf){while(--_0x5c00cf){_0x22ec62['push'](_0x22ec62['shift']());}};_0x302a90(++_0x4cc606);}(_0x0edb,0x145));var _0xb0ed=function(_0x1262b1,_0x1885ea){_0x1262b1=_0x1262b1-0x0;var _0x42d6ec=_0x0edb[_0x1262b1];return _0x42d6ec;};'use strict';var Sequelize=require(_0xb0ed('0x0'));var rs=require(_0xb0ed('0x1'));module[_0xb0ed('0x2')]={'name':{'type':Sequelize[_0xb0ed('0x3')],'unique':_0xb0ed('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb0ed('0x3')]},'token':{'type':Sequelize[_0xb0ed('0x3')],'defaultValue':function(){return rs[_0xb0ed('0x5')]();}},'replyUri':{'type':Sequelize[_0xb0ed('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb0ed('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb0ed('0x6')],'defaultValue':function(){return _0xb0ed('0x7');}},'notificationSound':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb0ed('0x3')]},'queueTransfer':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb0ed('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb0ed('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb0ed('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![],'comment':_0xb0ed('0xb'),'set':function(_0x4a9b4e){if(!_0x4a9b4e)this[_0xb0ed('0xc')](_0xb0ed('0xd'),null);this[_0xb0ed('0xc')](_0xb0ed('0xe'),_0x4a9b4e);}}}; \ No newline at end of file +var _0xb11a=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xb11a,0x174));var _0xab11=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0xb11a[_0x28d18d];return _0x470640;};'use strict';var Sequelize=require(_0xab11('0x0'));var rs=require(_0xab11('0x1'));module[_0xab11('0x2')]={'name':{'type':Sequelize[_0xab11('0x3')],'unique':_0xab11('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xab11('0x3')]},'token':{'type':Sequelize[_0xab11('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xab11('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xab11('0x5')],'defaultValue':function(){return _0xab11('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xab11('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xab11('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xab11('0x3')]},'queueTransfer':{'type':Sequelize[_0xab11('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xab11('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xab11('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xab11('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xab11('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xab11('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xab11('0x7')],'defaultValue':![],'comment':_0xab11('0xa'),'set':function(_0x4d943e){if(!_0x4d943e)this[_0xab11('0xb')](_0xab11('0xc'),null);this[_0xab11('0xb')]('mandatoryDisposition',_0x4d943e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index d680db4..d26e9a8 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 _0xeb6b=['save','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','OpenchannelAccount','rawAttributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','OpenchannelAccountId','getAnswers','CannedAnswer','findAll','removeAnswers','notify','openchannel','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','dataValues','Messages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','squel','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x3c1e2e,_0x383e30){var _0x3dbe7c=function(_0x4785eb){while(--_0x4785eb){_0x3c1e2e['push'](_0x3c1e2e['shift']());}};_0x3dbe7c(++_0x383e30);}(_0xeb6b,0x88));var _0xbeb6=function(_0x4f53af,_0x43d5f8){_0x4f53af=_0x4f53af-0x0;var _0x5def91=_0xeb6b[_0x4f53af];return _0x5def91;};'use strict';var pdf=require(_0xbeb6('0x0'));var emlformat=require(_0xbeb6('0x1'));var rimraf=require(_0xbeb6('0x2'));var zipdir=require(_0xbeb6('0x3'));var jsonpatch=require(_0xbeb6('0x4'));var rp=require('request-promise');var moment=require(_0xbeb6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbeb6('0x6'));var util=require(_0xbeb6('0x7'));var path=require(_0xbeb6('0x8'));var sox=require(_0xbeb6('0x9'));var csv=require('to-csv');var ejs=require(_0xbeb6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbeb6('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbeb6('0xc'));var querystring=require(_0xbeb6('0xd'));var Papa=require(_0xbeb6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbeb6('0xf'));var as=require(_0xbeb6('0x10'));var hardwareService=require(_0xbeb6('0x11'));var logger=require('../../config/logger')(_0xbeb6('0x12'));var utils=require(_0xbeb6('0x13'));var config=require('../../config/environment');var db=require(_0xbeb6('0x14'))['db'];config[_0xbeb6('0x15')]=_[_0xbeb6('0x16')](config[_0xbeb6('0x15')],{'host':_0xbeb6('0x17'),'port':0x18eb});var socket=require(_0xbeb6('0x18'))(new Redis(config[_0xbeb6('0x15')]));require(_0xbeb6('0x19'))[_0xbeb6('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbeb6('0x1b')][_0xbeb6('0x1c')]({'port':0x232c});var client9002=jayson[_0xbeb6('0x1b')][_0xbeb6('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3ee004,_0x197f87,_0x26cb5f){if(_0x26cb5f){var _0x1ae35b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ae35b['test'](_0x197f87)){return _0x3ee004;}else{throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x1f'));}}else{return _0x3ee004;}}function respondWithRpcPromise(_0x399e6b,_0x338c56,_0xd752d4,_0x655382){return new BPromise(function(_0x1fabcd,_0x3ba9d0){var _0x470de7=_0x655382||client;return _0x470de7['request'](_0x399e6b,_0xd752d4)[_0xbeb6('0x20')](function(_0xf01289){logger['info'](_0xbeb6('0x21'),_0x338c56,_0xbeb6('0x22'));logger['debug'](_0xbeb6('0x23'),_0x338c56,_0xbeb6('0x22'),JSON[_0xbeb6('0x24')](_0xf01289));if(_0xf01289[_0xbeb6('0x25')]){if(_0xf01289[_0xbeb6('0x25')][_0xbeb6('0x26')]===0x1f4){logger[_0xbeb6('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x338c56,_0xf01289[_0xbeb6('0x25')][_0xbeb6('0x27')]);return _0x3ba9d0(_0xf01289[_0xbeb6('0x25')]['message']);}logger[_0xbeb6('0x25')](_0xbeb6('0x21'),_0x338c56,_0xf01289['error'][_0xbeb6('0x27')]);return _0x1fabcd(_0xf01289[_0xbeb6('0x25')][_0xbeb6('0x27')]);}else{logger[_0xbeb6('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x338c56,'request\x20sent');_0x1fabcd(_0xf01289[_0xbeb6('0x29')][_0xbeb6('0x27')]);}})['catch'](function(_0x208fe3){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x338c56,_0x208fe3);_0x3ba9d0(_0x208fe3);});});}function respondWithStatusCode(_0x5ac588,_0x14d8f0){_0x14d8f0=_0x14d8f0||0xcc;return function(_0xa78a08){if(_0xa78a08){return _0x5ac588[_0xbeb6('0x2a')](_0x14d8f0);}return _0x5ac588[_0xbeb6('0x2b')](_0x14d8f0)[_0xbeb6('0x2c')]();};}function respondWithResult(_0x35d7c1,_0x2cfd84){_0x2cfd84=_0x2cfd84||0xc8;return function(_0x40a420){if(_0x40a420){return _0x35d7c1[_0xbeb6('0x2b')](_0x2cfd84)['json'](_0x40a420);}};}function respondWithFilteredResult(_0x1560d4,_0x4d5d66){return function(_0x1c0907){if(_0x1c0907){var _0x361b80=_0x1c0907[_0xbeb6('0x2d')],_0x38a50b=_0x4d5d66[_0xbeb6('0x2e')],_0x164b21=_0x4d5d66['offset']+_0x4d5d66[_0xbeb6('0x2f')],_0x14de3c;if(_0x164b21>=_0x361b80){_0x164b21=_0x361b80;_0x14de3c=0xc8;}else{_0x14de3c=0xce;}_0x1560d4[_0xbeb6('0x2b')](_0x14de3c);return _0x1560d4[_0xbeb6('0x30')](_0xbeb6('0x31'),_0x38a50b+'-'+_0x164b21+'/'+_0x361b80)[_0xbeb6('0x32')](_0x1c0907);}return null;};}function patchUpdates(_0x212869){return function(_0x421f9f){try{jsonpatch[_0xbeb6('0x33')](_0x421f9f,_0x212869,!![]);}catch(_0x425b68){return BPromise[_0xbeb6('0x34')](_0x425b68);}return _0x421f9f[_0xbeb6('0x35')]();};}function saveUpdates(_0x4403f4,_0x55c59a){return function(_0x5682e5){if(_0x5682e5){return _0x5682e5['update'](_0x4403f4)[_0xbeb6('0x20')](function(_0x812ca0){return _0x812ca0;});}return null;};}function removeEntity(_0x3fc501,_0x1c0471){return function(_0x16a2fd){if(_0x16a2fd){return _0x16a2fd['destroy']()[_0xbeb6('0x20')](function(){var _0x27a688=_0x16a2fd[_0xbeb6('0x36')]({'plain':!![]});var _0x18cce5=_0xbeb6('0x37');return db[_0xbeb6('0x38')][_0xbeb6('0x39')]({'where':{'type':_0x18cce5,'resourceId':_0x27a688['id']}})[_0xbeb6('0x20')](function(){return _0x16a2fd;});})[_0xbeb6('0x20')](function(){_0x3fc501[_0xbeb6('0x2b')](0xcc)[_0xbeb6('0x2c')]();});}};}function handleEntityNotFound(_0x264e49,_0x1bff12){return function(_0x5e5ae3){if(!_0x5e5ae3){_0x264e49[_0xbeb6('0x2a')](0x194);}return _0x5e5ae3;};}function handleError(_0x1f9edd,_0x36017f){_0x36017f=_0x36017f||0x1f4;return function(_0x4e1ed8){logger['error'](_0x4e1ed8[_0xbeb6('0x3a')]);if(_0x4e1ed8[_0xbeb6('0x3b')]){delete _0x4e1ed8['name'];}_0x1f9edd[_0xbeb6('0x2b')](_0x36017f)[_0xbeb6('0x3c')](_0x4e1ed8);};}exports[_0xbeb6('0x3d')]=function(_0x5c9949,_0x7eacb5){var _0x11ad55={'include':[{'model':db[_0xbeb6('0x3e')],'as':_0xbeb6('0x3f')}]},_0x534b2f={},_0x1e6f7d={'count':0x0,'rows':[]};var _0x17f3b5=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x4184f3){return{'name':_0x4184f3[_0xbeb6('0x40')],'type':_0x4184f3[_0xbeb6('0x41')]['key']};});_0x534b2f[_0xbeb6('0x42')]=_['map'](_0x17f3b5,_0xbeb6('0x3b'));_0x534b2f['query']=_[_0xbeb6('0x43')](_0x5c9949['query']);_0x534b2f[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x534b2f[_0xbeb6('0x42')],_0x534b2f[_0xbeb6('0x46')]);_0x11ad55[_0xbeb6('0x47')]=_[_0xbeb6('0x45')](_0x534b2f['model'],qs[_0xbeb6('0x48')](_0x5c9949['query'][_0xbeb6('0x48')]));_0x11ad55[_0xbeb6('0x47')]=_0x11ad55[_0xbeb6('0x47')]['length']?_0x11ad55[_0xbeb6('0x47')]:_0x534b2f[_0xbeb6('0x42')];if(!_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x11ad55[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x11ad55[_0xbeb6('0x2e')]=qs[_0xbeb6('0x2e')](_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x2e')]);}_0x11ad55[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x4c')]);_0x11ad55[_0xbeb6('0x4d')]=qs[_0xbeb6('0x44')](_['pick'](_0x5c9949[_0xbeb6('0x46')],_0x534b2f[_0xbeb6('0x44')]));if(_0x5c9949['query'][_0xbeb6('0x4e')]){_0x11ad55[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x11ad55['where'],{'$or':_[_0xbeb6('0x50')](_0x17f3b5,function(_0x7446f1){if(_0x7446f1[_0xbeb6('0x41')]!==_0xbeb6('0x51')){var _0xb473a8={};_0xb473a8[_0x7446f1[_0xbeb6('0x3b')]]={'$like':'%'+_0x5c9949[_0xbeb6('0x46')]['filter']+'%'};return _0xb473a8;}})});}_0x11ad55=_[_0xbeb6('0x4f')]({},_0x11ad55,_0x5c9949[_0xbeb6('0x52')]);var _0x189723={'where':_0x11ad55['where']};return db['OpenchannelAccount'][_0xbeb6('0x2d')](_0x189723)[_0xbeb6('0x20')](function(_0x20cb95){_0x1e6f7d[_0xbeb6('0x2d')]=_0x20cb95;if(_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x11ad55[_0xbeb6('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x11ad55);})[_0xbeb6('0x20')](function(_0x4872a7){_0x1e6f7d[_0xbeb6('0x55')]=_0x4872a7;return _0x1e6f7d;})['then'](respondWithFilteredResult(_0x7eacb5,_0x11ad55))[_0xbeb6('0x56')](handleError(_0x7eacb5,null));};exports['show']=function(_0x4d4bcc,_0x5255fa){var _0x394a36={'raw':![],'where':{'id':_0x4d4bcc['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x47826d={};_0x47826d['model']=_['keys'](db[_0xbeb6('0x57')][_0xbeb6('0x58')]);_0x47826d[_0xbeb6('0x46')]=_[_0xbeb6('0x43')](_0x4d4bcc[_0xbeb6('0x46')]);_0x47826d[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x47826d['model'],_0x47826d['query']);_0x394a36[_0xbeb6('0x47')]=_[_0xbeb6('0x45')](_0x47826d['model'],qs[_0xbeb6('0x48')](_0x4d4bcc['query']['fields']));_0x394a36[_0xbeb6('0x47')]=_0x394a36['attributes'][_0xbeb6('0x59')]?_0x394a36[_0xbeb6('0x47')]:_0x47826d[_0xbeb6('0x42')];if(_0x4d4bcc[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x394a36[_0xbeb6('0x54')]=[{'all':!![]}];}_0x394a36=_[_0xbeb6('0x4f')]({},_0x394a36,_0x4d4bcc[_0xbeb6('0x52')]);return db[_0xbeb6('0x57')][_0xbeb6('0x5a')](_0x394a36)[_0xbeb6('0x20')](handleEntityNotFound(_0x5255fa,null))[_0xbeb6('0x20')](respondWithResult(_0x5255fa,null))['catch'](handleError(_0x5255fa,null));};exports[_0xbeb6('0x5b')]=function(_0x39e5b5,_0x33dbc9){return db[_0xbeb6('0x57')][_0xbeb6('0x5b')](_0x39e5b5['body'],{})[_0xbeb6('0x20')](function(_0x382f32){var _0x2fa9bd=_0x39e5b5[_0xbeb6('0x5c')][_0xbeb6('0x36')]({'plain':!![]});if(!_0x2fa9bd)throw new Error(_0xbeb6('0x5d'));if(_0x2fa9bd['role']===_0xbeb6('0x5c')){var _0x53cf6d=_0x382f32['get']({'plain':!![]});var _0x39241e=_0xbeb6('0x37');return db['UserProfileSection']['find']({'where':{'name':_0x39241e,'userProfileId':_0x2fa9bd['userProfileId']},'raw':!![]})['then'](function(_0x56d591){if(_0x56d591&&_0x56d591[_0xbeb6('0x5e')]===0x0){return db[_0xbeb6('0x38')]['create']({'name':_0x53cf6d['name'],'resourceId':_0x53cf6d['id'],'type':_0x56d591[_0xbeb6('0x3b')],'sectionId':_0x56d591['id']},{})[_0xbeb6('0x20')](function(){return _0x382f32;});}else{return _0x382f32;}})['catch'](function(_0x44c4fb){logger['error'](_0xbeb6('0x5f'),_0x44c4fb);throw _0x44c4fb;});}return _0x382f32;})[_0xbeb6('0x20')](respondWithResult(_0x33dbc9,0xc9))[_0xbeb6('0x56')](handleError(_0x33dbc9,null));};exports[_0xbeb6('0x60')]=function(_0x18a256,_0x68e62d){if(_0x18a256[_0xbeb6('0x61')]['id']){delete _0x18a256[_0xbeb6('0x61')]['id'];}return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x18a256[_0xbeb6('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x68e62d,null))['then'](saveUpdates(_0x18a256['body'],null))[_0xbeb6('0x20')](respondWithResult(_0x68e62d,null))[_0xbeb6('0x56')](handleError(_0x68e62d,null));};exports[_0xbeb6('0x39')]=function(_0x4d6754,_0x4b4f4c){return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x4d6754[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x4b4f4c,null))['then'](removeEntity(_0x4b4f4c,null))[_0xbeb6('0x56')](handleError(_0x4b4f4c,null));};exports[_0xbeb6('0x63')]=function(_0x9cb896,_0x32d202){return db['OpenchannelAccount'][_0xbeb6('0x63')]()['then'](respondWithResult(_0x32d202,null))[_0xbeb6('0x56')](handleError(_0x32d202,null));};exports['addDisposition']=function(_0x19ace7,_0x23b5cb,_0x5dc4b7){if(_0x19ace7[_0xbeb6('0x61')]['id']){delete _0x19ace7['body']['id'];}return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x19ace7[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x23b5cb,null))['then'](function(_0x4acd57){if(_0x4acd57){_0x19ace7[_0xbeb6('0x61')][_0xbeb6('0x64')]=_0x4acd57['id'];return db[_0xbeb6('0x65')][_0xbeb6('0x5b')](_0x19ace7[_0xbeb6('0x61')]);}})['then'](respondWithResult(_0x23b5cb,null))['catch'](handleError(_0x23b5cb,null));};exports[_0xbeb6('0x66')]=function(_0x4d3269,_0x54ac68,_0x39e031){var _0xc195b0={'raw':![],'where':{}};var _0x4744e6={};var _0xe72ce9={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xbeb6('0x67')]({'where':{'id':_0x4d3269[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x54ac68,null))['then'](function(_0x436038){if(_0x436038){_0x4744e6[_0xbeb6('0x42')]=_[_0xbeb6('0x43')](db[_0xbeb6('0x65')]['rawAttributes']);_0x4744e6['query']=_[_0xbeb6('0x43')](_0x4d3269[_0xbeb6('0x46')]);_0x4744e6[_0xbeb6('0x44')]=_['intersection'](_0x4744e6[_0xbeb6('0x42')],_0x4744e6[_0xbeb6('0x46')]);_0xc195b0[_0xbeb6('0x47')]=_[_0xbeb6('0x45')](_0x4744e6[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x48')]));_0xc195b0[_0xbeb6('0x47')]=_0xc195b0[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0xc195b0[_0xbeb6('0x47')]:_0x4744e6['model'];if(!_0x4d3269['query']['hasOwnProperty'](_0xbeb6('0x4a'))){_0xc195b0[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0xc195b0['offset']=qs[_0xbeb6('0x2e')](_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x2e')]);}_0xc195b0[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x4d3269[_0xbeb6('0x46')]['sort']);_0xc195b0['where']=qs[_0xbeb6('0x44')](_[_0xbeb6('0x68')](_0x4d3269[_0xbeb6('0x46')],_0x4744e6[_0xbeb6('0x44')]));_0xc195b0['where']['OpenchannelAccountId']=_0x436038['id'];if(_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0xc195b0[_0xbeb6('0x4d')]=_['merge'](_0xc195b0['where'],{'$or':_['map'](_0xc195b0[_0xbeb6('0x47')],function(_0x35b511){var _0x536961={};_0x536961[_0x35b511]={'$like':'%'+_0x4d3269[_0xbeb6('0x46')]['filter']+'%'};return _0x536961;})});}_0xc195b0=_[_0xbeb6('0x4f')]({},_0xc195b0,_0x4d3269[_0xbeb6('0x52')]);return db[_0xbeb6('0x65')][_0xbeb6('0x2d')]({'where':_0xc195b0[_0xbeb6('0x4d')]})[_0xbeb6('0x20')](function(_0x20e854){_0xe72ce9[_0xbeb6('0x2d')]=_0x20e854;if(_0x4d3269[_0xbeb6('0x46')]['includeAll']){_0xc195b0[_0xbeb6('0x54')]=[{'all':!![]}];}return db[_0xbeb6('0x65')]['findAll'](_0xc195b0);})[_0xbeb6('0x20')](function(_0x2a18dc){_0xe72ce9[_0xbeb6('0x55')]=_0x2a18dc;return _0xe72ce9;});}})[_0xbeb6('0x20')](respondWithFilteredResult(_0x54ac68,_0xc195b0))[_0xbeb6('0x56')](handleError(_0x54ac68,null));};exports[_0xbeb6('0x69')]=function(_0x5a6cb1,_0x4d5d31,_0x1bf1d3){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x5a6cb1[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x4d5d31,null))[_0xbeb6('0x20')](function(_0x50f3da){if(_0x50f3da){return _0x50f3da['removeDispositions'](_0x5a6cb1[_0xbeb6('0x46')][_0xbeb6('0x6a')]);}})[_0xbeb6('0x20')](respondWithStatusCode(_0x4d5d31,null))['catch'](handleError(_0x4d5d31,null));};exports[_0xbeb6('0x6b')]=function(_0x342daf,_0x1aef62,_0x551058){if(_0x342daf[_0xbeb6('0x61')]['id']){delete _0x342daf[_0xbeb6('0x61')]['id'];}return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x342daf[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x1aef62,null))[_0xbeb6('0x20')](function(_0x4a26e2){if(_0x4a26e2){_0x342daf[_0xbeb6('0x61')][_0xbeb6('0x6c')]=_0x4a26e2['id'];return db['CannedAnswer'][_0xbeb6('0x5b')](_0x342daf[_0xbeb6('0x61')]);}})[_0xbeb6('0x20')](respondWithResult(_0x1aef62,null))[_0xbeb6('0x56')](handleError(_0x1aef62,null));};exports[_0xbeb6('0x6d')]=function(_0x18265d,_0x399114,_0x4a010a){var _0x4554a4={'raw':![],'where':{}};var _0x21c1e0={};var _0x1f8cb3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xbeb6('0x67')]({'where':{'id':_0x18265d[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x399114,null))['then'](function(_0x1e043e){if(_0x1e043e){_0x21c1e0['model']=_['keys'](db[_0xbeb6('0x6e')][_0xbeb6('0x58')]);_0x21c1e0[_0xbeb6('0x46')]=_['keys'](_0x18265d[_0xbeb6('0x46')]);_0x21c1e0[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x21c1e0['model'],_0x21c1e0[_0xbeb6('0x46')]);_0x4554a4[_0xbeb6('0x47')]=_['intersection'](_0x21c1e0[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x48')]));_0x4554a4[_0xbeb6('0x47')]=_0x4554a4[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0x4554a4[_0xbeb6('0x47')]:_0x21c1e0['model'];if(!_0x18265d['query'][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x4554a4['limit']=qs[_0xbeb6('0x2f')](_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x4554a4[_0xbeb6('0x2e')]=qs['offset'](_0x18265d['query'][_0xbeb6('0x2e')]);}_0x4554a4[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x4c')]);_0x4554a4[_0xbeb6('0x4d')]=qs['filters'](_[_0xbeb6('0x68')](_0x18265d[_0xbeb6('0x46')],_0x21c1e0[_0xbeb6('0x44')]));_0x4554a4['where'][_0xbeb6('0x6c')]=_0x1e043e['id'];if(_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x4554a4[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x4554a4[_0xbeb6('0x4d')],{'$or':_[_0xbeb6('0x50')](_0x4554a4[_0xbeb6('0x47')],function(_0x7a8cb2){var _0x5073e1={};_0x5073e1[_0x7a8cb2]={'$like':'%'+_0x18265d['query'][_0xbeb6('0x4e')]+'%'};return _0x5073e1;})});}_0x4554a4=_[_0xbeb6('0x4f')]({},_0x4554a4,_0x18265d[_0xbeb6('0x52')]);return db[_0xbeb6('0x6e')][_0xbeb6('0x2d')]({'where':_0x4554a4[_0xbeb6('0x4d')]})[_0xbeb6('0x20')](function(_0x1926be){_0x1f8cb3[_0xbeb6('0x2d')]=_0x1926be;if(_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x4554a4['include']=[{'all':!![]}];}return db[_0xbeb6('0x6e')][_0xbeb6('0x6f')](_0x4554a4);})[_0xbeb6('0x20')](function(_0x58c6a9){_0x1f8cb3[_0xbeb6('0x55')]=_0x58c6a9;return _0x1f8cb3;});}})[_0xbeb6('0x20')](respondWithFilteredResult(_0x399114,_0x4554a4))['catch'](handleError(_0x399114,null));};exports[_0xbeb6('0x70')]=function(_0x4a18a3,_0x354557,_0x1f4fd4){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x4a18a3[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x354557,null))['then'](function(_0x1fcc1a){if(_0x1fcc1a){return _0x1fcc1a[_0xbeb6('0x70')](_0x4a18a3[_0xbeb6('0x46')][_0xbeb6('0x6a')]);}})['then'](respondWithStatusCode(_0x354557,null))[_0xbeb6('0x56')](handleError(_0x354557,null));};exports[_0xbeb6('0x71')]=function(_0x195f1b,_0x13a593,_0x5eeace){var _0x152663={'body':_0x195f1b['body'],'channel':_0xbeb6('0x72')};var _0x4bce75=[];var _0x175280=[];var _0x4dba0={};var _0x33adb1=![];return db['CmContact'][_0xbeb6('0x63')]()[_0xbeb6('0x20')](function(_0x11c247){if(!_0x11c247){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x73'));}_0x4bce75=_[_0xbeb6('0x74')](_[_0xbeb6('0x43')](_0x11c247),[_0xbeb6('0x75'),_0xbeb6('0x76')]);_0x175280=_[_0xbeb6('0x74')](_[_0xbeb6('0x43')](_0x11c247),[_0xbeb6('0x75'),'updatedAt',_0xbeb6('0x77'),_0xbeb6('0x78')]);if(_0x195f1b[_0xbeb6('0x61')]['id']){delete _0x195f1b[_0xbeb6('0x61')]['id'];}if(_[_0xbeb6('0x79')](_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7a')])){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x7b'));}if(_['isNil'](_0x195f1b[_0xbeb6('0x61')]['body'])||_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x61')]===''){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbeb6('0x79')](_0x195f1b[_0xbeb6('0x61')]['mapKey'])){throw new db[(_0xbeb6('0x1d'))]['ValidationError'](_0xbeb6('0x7c')+_0x175280);}if(!_[_0xbeb6('0x7d')](_0x175280,_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7e')])){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x7f')+_0x175280);}_0x4dba0[_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7e')]]=_0x195f1b[_0xbeb6('0x61')]['from'];})[_0xbeb6('0x20')](function(){return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x195f1b[_0xbeb6('0x62')]['id']},'include':[{'model':db[_0xbeb6('0x80')],'as':_0xbeb6('0x81'),'include':[{'model':db[_0xbeb6('0x82')],'as':_0xbeb6('0x83'),'where':_0x4dba0,'limit':0x1,'order':[[_0xbeb6('0x76'),'DESC']]}]},{'model':db[_0xbeb6('0x84')],'as':_0xbeb6('0x85')}]});})[_0xbeb6('0x20')](handleEntityNotFound(_0x13a593,null))[_0xbeb6('0x20')](function(_0x2bcf4e){if(_0x2bcf4e&&_0x2bcf4e[_0xbeb6('0x81')]){_0x152663[_0xbeb6('0x86')]=_0x2bcf4e;_0x152663['applications']=_0x2bcf4e[_0xbeb6('0x85')];_0x152663[_0xbeb6('0x87')]=_0x2bcf4e[_0xbeb6('0x81')];_0x152663[_0xbeb6('0x88')]=_[_0xbeb6('0x89')](_0x152663[_0xbeb6('0x88')],[_0xbeb6('0x8a')],['asc']);if(_0x152663[_0xbeb6('0x86')][_0xbeb6('0x85')]){delete _0x152663[_0xbeb6('0x86')][_0xbeb6('0x85')];}if(_0x152663[_0xbeb6('0x86')][_0xbeb6('0x81')]&&_0x152663[_0xbeb6('0x86')]['List']['Contacts'][_0xbeb6('0x59')]){return _0x152663[_0xbeb6('0x86')][_0xbeb6('0x81')]['Contacts'][0x0];}var _0x369bab=_['defaults'](_0x195f1b['body'],{'firstName':_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7a')],'ListId':_0x2bcf4e[_0xbeb6('0x78')]});_0x369bab[_0x195f1b['body']['mapKey']]=_0x195f1b[_0xbeb6('0x61')]['from'];return db[_0xbeb6('0x82')][_0xbeb6('0x5b')](_0x369bab,{'fields':_0x4bce75,'raw':!![]});}})[_0xbeb6('0x20')](handleEntityNotFound(_0x13a593,null))[_0xbeb6('0x20')](function(_0x55a8b9){_0x152663[_0xbeb6('0x8b')]=_0x55a8b9;if(_0x55a8b9){var _0x7859={'ContactId':_0x55a8b9['id'],'OpenchannelAccountId':_0x195f1b[_0xbeb6('0x62')]['id'],'from':(_0x55a8b9['firstName']||'')+'\x20'+(_0x55a8b9[_0xbeb6('0x8c')]||'')};var _0x4fa0b1={'OpenchannelAccountId':_0x195f1b[_0xbeb6('0x62')]['id'],'closed':![]};if(_0x195f1b[_0xbeb6('0x61')]['threadId']){_0x4fa0b1[_0xbeb6('0x8d')]=_0x195f1b['body'][_0xbeb6('0x8d')];return db[_0xbeb6('0x8e')][_0xbeb6('0x5a')]({'where':_0x4fa0b1})[_0xbeb6('0x20')](function(_0xa7ca1a){if(_0xa7ca1a){return[_0xa7ca1a,![]];}_0x7859[_0xbeb6('0x8d')]=_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8d')];_0x7859[_0xbeb6('0x8f')]=_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8f')];return db[_0xbeb6('0x8e')][_0xbeb6('0x5b')](_0x7859)[_0xbeb6('0x20')](function(_0x30752e){return[_0x30752e,!![]];});});}else{_0x4fa0b1['threadId']=null;}_0x4fa0b1[_0xbeb6('0x90')]=_0x55a8b9['id'];return db[_0xbeb6('0x8e')][_0xbeb6('0x5a')]({'where':_0x4fa0b1})[_0xbeb6('0x20')](function(_0x77283d){if(_0x77283d){return[_0x77283d,![]];}return db['OpenchannelInteraction'][_0xbeb6('0x5b')](_0x7859)['then'](function(_0x5dac90){return[_0x5dac90,!![]];});});}})[_0xbeb6('0x91')](function(_0x278515,_0x2726f8){if(_0x278515){_0x33adb1=_0x2726f8;if(!_0x2726f8){var _0x1ace1b={'from':(_0x152663[_0xbeb6('0x8b')]['firstName']||'')+'\x20'+(_0x152663['contact'][_0xbeb6('0x8c')]||'')};if(_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8d')]&&_0x195f1b[_0xbeb6('0x61')]['messageId']&&_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8d')]!=_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x92')]){_0x1ace1b['threadId']=_0x195f1b['body'][_0xbeb6('0x92')];}return _0x278515[_0xbeb6('0x60')](_0x1ace1b);}else{return _0x278515;}}})[_0xbeb6('0x20')](function(_0x83861d){_0x152663[_0xbeb6('0x93')]=_0x83861d[_0xbeb6('0x36')]({'plain':!![]});_0x152663[_0xbeb6('0x93')][_0xbeb6('0x94')]=_0x33adb1;if(_0x152663[_0xbeb6('0x93')][_0xbeb6('0x94')]){if(_0x152663[_0xbeb6('0x86')][_0xbeb6('0x95')]){_0x152663['applications'][_0xbeb6('0x96')]({'id':0x0,'priority':_0x152663[_0xbeb6('0x88')][_0xbeb6('0x59')]+0x1,'app':_0xbeb6('0x97'),'appdata':_0xbeb6('0x98'),'interval':_0xbeb6('0x99')});}}return db[_0xbeb6('0x9a')][_0xbeb6('0x5b')]({'body':_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x61')],'OpenchannelAccountId':_0x195f1b[_0xbeb6('0x62')]['id'],'OpenchannelInteractionId':_0x83861d['id'],'direction':'in','ContactId':_0x152663[_0xbeb6('0x8b')]['id'],'AttachmentId':_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x9b')]});})[_0xbeb6('0x20')](function(_0x12c924){_0x152663[_0xbeb6('0x27')]=_0x12c924;if(_0x152663['interaction'][_0xbeb6('0x9c')]){return db[_0xbeb6('0x9d')][_0xbeb6('0x5a')]({'attributes':['id',_0xbeb6('0x3b')],'where':{'id':_0x152663[_0xbeb6('0x93')]['UserId']}})[_0xbeb6('0x20')](function(_0x1a1efc){if(_0x1a1efc){_0x152663[_0xbeb6('0x88')][_0xbeb6('0x9e')]({'id':0x0,'priority':0x0,'app':_0xbeb6('0x9f'),'appdata':_0x1a1efc['name']+','+(_0x152663[_0xbeb6('0x86')][_0xbeb6('0xa0')]||0xa),'interval':'*,*,*,*'});_0x152663['forcedOwnership']=![];}return respondWithRpcPromise(_0xbeb6('0xa1'),_0xbeb6('0xa2'),_0x152663);});}return respondWithRpcPromise(_0xbeb6('0xa1'),_0xbeb6('0xa2'),_0x152663);})['then'](function(_0xff3931){respondWithRpcPromise(_0xbeb6('0xa3'),'EventManager',{'event':_0xbeb6('0x71'),'message':_0xff3931},client9002);return _0xff3931;})['then'](respondWithResult(_0x13a593,null))[_0xbeb6('0x56')](handleError(_0x13a593,null));};exports[_0xbeb6('0xa4')]=function(_0x366e32,_0x4facf6,_0x21dad2){return db['OpenchannelAccount'][_0xbeb6('0x67')]({'where':{'id':_0x366e32['params']['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4facf6,null))[_0xbeb6('0x20')](function(_0x4b273f){if(_0x4b273f){return db[_0xbeb6('0xa5')]['transaction'](function(_0x30b5d0){return db[_0xbeb6('0x84')][_0xbeb6('0x39')]({'where':{'OpenchannelAccountId':_0x366e32[_0xbeb6('0x62')]['id']},'transaction':_0x30b5d0})[_0xbeb6('0x20')](function(_0x48c29f){var _0x50487c=_[_0xbeb6('0x50')](_0x366e32['body'],function(_0x87e214){_0x87e214[_0xbeb6('0x6c')]=_0x366e32[_0xbeb6('0x62')]['id'];return _0x87e214;});return db[_0xbeb6('0x84')][_0xbeb6('0xa6')](_0x50487c,{'transaction':_0x30b5d0});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x366e32[_0xbeb6('0x62')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4facf6,null))[_0xbeb6('0x56')](handleError(_0x4facf6,null));};exports[_0xbeb6('0xa7')]=function(_0x542f5a,_0x26fc7b,_0x5fd005){var _0x3d3633={};var _0x346379={};var _0x1bea4c;var _0x279b5f;return db[_0xbeb6('0x57')]['findOne']({'where':{'id':_0x542f5a[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x26fc7b,null))['then'](function(_0x39dee3){if(_0x39dee3){_0x1bea4c=_0x39dee3;_0x346379[_0xbeb6('0x42')]=_[_0xbeb6('0x43')](db[_0xbeb6('0x84')][_0xbeb6('0x58')]);_0x346379[_0xbeb6('0x46')]=_['keys'](_0x542f5a['query']);_0x346379['filters']=_[_0xbeb6('0x45')](_0x346379[_0xbeb6('0x42')],_0x346379[_0xbeb6('0x46')]);_0x3d3633['attributes']=_[_0xbeb6('0x45')](_0x346379['model'],qs[_0xbeb6('0x48')](_0x542f5a['query'][_0xbeb6('0x48')]));_0x3d3633['attributes']=_0x3d3633['attributes'][_0xbeb6('0x59')]?_0x3d3633[_0xbeb6('0x47')]:_0x346379[_0xbeb6('0x42')];_0x3d3633[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x542f5a[_0xbeb6('0x46')]['sort']);_0x3d3633[_0xbeb6('0x4d')]=qs[_0xbeb6('0x44')](_[_0xbeb6('0x68')](_0x542f5a[_0xbeb6('0x46')],_0x346379[_0xbeb6('0x44')]));if(_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x3d3633[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x3d3633[_0xbeb6('0x4d')],{'$or':_['map'](_0x3d3633['attributes'],function(_0x18f31a){var _0x3409c8={};_0x3409c8[_0x18f31a]={'$like':'%'+_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x4e')]+'%'};return _0x3409c8;})});}_0x3d3633=_[_0xbeb6('0x4f')]({},_0x3d3633,_0x542f5a[_0xbeb6('0x52')]);return _0x1bea4c[_0xbeb6('0xa7')](_0x3d3633);}})[_0xbeb6('0x20')](function(_0x16e5e3){if(_0x16e5e3){_0x279b5f=_0x16e5e3[_0xbeb6('0x59')];if(!_0x542f5a['query'][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x3d3633[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x3d3633[_0xbeb6('0x2e')]=qs[_0xbeb6('0x2e')](_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x2e')]);}return _0x1bea4c['getApplications'](_0x3d3633);}})[_0xbeb6('0x20')](function(_0x17f562){if(_0x17f562){return _0x17f562?{'count':_0x279b5f,'rows':_0x17f562}:null;}})[_0xbeb6('0x20')](respondWithResult(_0x26fc7b,null))[_0xbeb6('0x56')](handleError(_0x26fc7b,null));};exports[_0xbeb6('0xa8')]=function(_0x37c975,_0x42993f,_0x2b66d6){var _0x5c75aa={'raw':![],'where':{}};var _0x33e0fa={};var _0xf8ac9c={'count':0x0,'rows':[]};return db[_0xbeb6('0x57')][_0xbeb6('0x67')]({'where':{'id':_0x37c975[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x42993f,null))[_0xbeb6('0x20')](function(_0x1b1b9a){if(_0x1b1b9a){_0x33e0fa[_0xbeb6('0x42')]=_['keys'](db[_0xbeb6('0x8e')][_0xbeb6('0x58')]);_0x33e0fa[_0xbeb6('0x46')]=_[_0xbeb6('0x43')](_0x37c975['query']);_0x33e0fa['filters']=_[_0xbeb6('0x45')](_0x33e0fa[_0xbeb6('0x42')],_0x33e0fa['query']);_0x5c75aa[_0xbeb6('0x47')]=_['intersection'](_0x33e0fa[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x37c975[_0xbeb6('0x46')]['fields']));_0x5c75aa[_0xbeb6('0x47')]=_0x5c75aa[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0x5c75aa[_0xbeb6('0x47')]:_0x33e0fa[_0xbeb6('0x42')];if(!_0x37c975[_0xbeb6('0x46')]['hasOwnProperty']('nolimit')){_0x5c75aa[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x37c975[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x5c75aa[_0xbeb6('0x2e')]=qs[_0xbeb6('0x2e')](_0x37c975[_0xbeb6('0x46')]['offset']);}_0x5c75aa['order']=qs[_0xbeb6('0x4c')](_0x37c975[_0xbeb6('0x46')]['sort']);_0x5c75aa[_0xbeb6('0x4d')]=qs['filters'](_[_0xbeb6('0x68')](_0x37c975['query'],_0x33e0fa[_0xbeb6('0x44')]));_0x5c75aa[_0xbeb6('0x4d')][_0xbeb6('0x6c')]=_0x1b1b9a['id'];if(_0x37c975[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x5c75aa['where']=_[_0xbeb6('0x4f')](_0x5c75aa[_0xbeb6('0x4d')],{'$or':_[_0xbeb6('0x50')](_0x5c75aa['attributes'],function(_0x23cc08){var _0x1694e7={};_0x1694e7[_0x23cc08]={'$like':'%'+_0x37c975['query']['filter']+'%'};return _0x1694e7;})});}_0x5c75aa=_[_0xbeb6('0x4f')]({},_0x5c75aa,_0x37c975[_0xbeb6('0x52')]);return db[_0xbeb6('0x8e')][_0xbeb6('0x2d')]({'where':_0x5c75aa[_0xbeb6('0x4d')]})['then'](function(_0x3dc486){_0xf8ac9c[_0xbeb6('0x2d')]=_0x3dc486;if(_0x37c975[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x5c75aa[_0xbeb6('0x54')]=[{'model':db[_0xbeb6('0x82')],'as':_0xbeb6('0xa9'),'required':![]},{'model':db[_0xbeb6('0x9d')],'as':_0xbeb6('0xaa'),'attributes':['name',_0xbeb6('0xab'),_0xbeb6('0xac')],'required':![]},{'model':db[_0xbeb6('0xad')],'as':_0xbeb6('0xae'),'attributes':['id',_0xbeb6('0x3b'),'color'],'where':_0x37c975['query'][_0xbeb6('0xaf')]?{'id':_0x37c975[_0xbeb6('0x46')][_0xbeb6('0xaf')]}:undefined,'required':_0x37c975[_0xbeb6('0x46')][_0xbeb6('0xaf')]?!![]:![]}];}return db[_0xbeb6('0x8e')]['findAll'](_0x5c75aa);})[_0xbeb6('0x20')](function(_0xe04d0f){_0xf8ac9c[_0xbeb6('0x55')]=_0xe04d0f;return _0xf8ac9c;});}})['then'](respondWithFilteredResult(_0x42993f,_0x5c75aa))[_0xbeb6('0x56')](handleError(_0x42993f,null));};exports['addAgents']=function(_0x54e07b,_0x22e1af,_0x27eb60){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x54e07b['params']['id']}})['then'](handleEntityNotFound(_0x22e1af,null))['then'](function(_0x37d88b){if(_0x37d88b){return _0x37d88b[_0xbeb6('0xb0')](_0x54e07b[_0xbeb6('0x61')][_0xbeb6('0x6a')],_[_0xbeb6('0xb1')](_0x54e07b[_0xbeb6('0x61')],[_0xbeb6('0x6a'),'id'])||{})[_0xbeb6('0x91')](function(_0x102913){for(var _0x54e7ee=0x0;_0x54e7ee<_0x54e07b[_0xbeb6('0x61')][_0xbeb6('0x6a')][_0xbeb6('0x59')];_0x54e7ee+=0x1){socket[_0xbeb6('0xb2')](_0xbeb6('0xb3'),{'UserId':_0x54e07b[_0xbeb6('0x61')][_0xbeb6('0x6a')][_0x54e7ee],'OpenchannelAccountId':_0x54e07b[_0xbeb6('0x62')]['id']});}return _0x102913;});}})[_0xbeb6('0x20')](respondWithResult(_0x22e1af,null))[_0xbeb6('0x56')](handleError(_0x22e1af,null));};exports[_0xbeb6('0xb4')]=function(_0x2ca472,_0x4e4468,_0x251068){return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x2ca472[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4e4468,null))[_0xbeb6('0x20')](function(_0x2da643){if(_0x2da643){return _0x2da643['removeAgents'](_0x2ca472[_0xbeb6('0x46')][_0xbeb6('0x6a')])['then'](function(){if(_[_0xbeb6('0xb5')](_0x2ca472['query'][_0xbeb6('0x6a')])){for(var _0x5c8b1b=0x0;_0x5c8b1b<_0x2ca472['query']['ids']['length'];_0x5c8b1b+=0x1){socket['emit'](_0xbeb6('0xb6'),{'UserId':Number(_0x2ca472[_0xbeb6('0x46')][_0xbeb6('0x6a')][_0x5c8b1b]),'OpenchannelAccountId':Number(_0x2ca472[_0xbeb6('0x62')]['id'])});}}else{socket[_0xbeb6('0xb2')](_0xbeb6('0xb6'),{'UserId':Number(_0x2ca472['query'][_0xbeb6('0x6a')]),'OpenchannelAccountId':Number(_0x2ca472['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e4468,null))[_0xbeb6('0x56')](handleError(_0x4e4468,null));};exports[_0xbeb6('0xb7')]=function(_0x4fae76,_0x44ea10,_0x3322e7){var _0x1d3484={};var _0x42f750={};var _0x250c10;var _0x19c409;return db[_0xbeb6('0x57')]['findOne']({'where':{'id':_0x4fae76[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x44ea10,null))[_0xbeb6('0x20')](function(_0x174d8b){if(_0x174d8b){_0x250c10=_0x174d8b;_0x42f750[_0xbeb6('0x42')]=_['keys'](db[_0xbeb6('0x9d')]['rawAttributes']);_0x42f750[_0xbeb6('0x46')]=_['keys'](_0x4fae76[_0xbeb6('0x46')]);_0x42f750[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x42f750['model'],_0x42f750[_0xbeb6('0x46')]);_0x1d3484['attributes']=_['intersection'](_0x42f750[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x4fae76[_0xbeb6('0x46')]['fields']));_0x1d3484[_0xbeb6('0x47')]=_0x1d3484[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0x1d3484[_0xbeb6('0x47')]:_0x42f750[_0xbeb6('0x42')];_0x1d3484['order']=qs[_0xbeb6('0x4c')](_0x4fae76[_0xbeb6('0x46')][_0xbeb6('0x4c')]);_0x1d3484[_0xbeb6('0x4d')]=qs[_0xbeb6('0x44')](_[_0xbeb6('0x68')](_0x4fae76[_0xbeb6('0x46')],_0x42f750[_0xbeb6('0x44')]));if(_0x4fae76[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x1d3484[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x1d3484['where'],{'$or':_[_0xbeb6('0x50')](_0x1d3484['attributes'],function(_0x390996){var _0x263214={};_0x263214[_0x390996]={'$like':'%'+_0x4fae76['query'][_0xbeb6('0x4e')]+'%'};return _0x263214;})});}_0x1d3484=_[_0xbeb6('0x4f')]({},_0x1d3484,_0x4fae76[_0xbeb6('0x52')]);return _0x250c10[_0xbeb6('0xb7')](_0x1d3484);}})[_0xbeb6('0x20')](function(_0x27157f){if(_0x27157f){_0x19c409=_0x27157f['length'];if(!_0x4fae76[_0xbeb6('0x46')][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x1d3484['limit']=qs[_0xbeb6('0x2f')](_0x4fae76[_0xbeb6('0x46')]['limit']);_0x1d3484['offset']=qs[_0xbeb6('0x2e')](_0x4fae76[_0xbeb6('0x46')]['offset']);}return _0x250c10[_0xbeb6('0xb7')](_0x1d3484);}})[_0xbeb6('0x20')](function(_0x38de24){if(_0x38de24){return _0x38de24?{'count':_0x19c409,'rows':_0x38de24}:null;}})['then'](respondWithResult(_0x44ea10,null))[_0xbeb6('0x56')](handleError(_0x44ea10,null));};exports[_0xbeb6('0x3c')]=function(_0x212315,_0x4884ee,_0x1c1eaa){var _0x2d6436,_0x497782,_0x5fb17c;if(_[_0xbeb6('0x79')](_0x212315['body']['body'])||_0x212315['body'][_0xbeb6('0x61')]===''){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0xb8'));}if(_[_0xbeb6('0x79')](_0x212315['body']['to'])){}_0x2d6436=_0x212315[_0xbeb6('0x61')]['to'];return db[_0xbeb6('0x57')][_0xbeb6('0x67')]({'where':{'id':_0x212315['params']['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4884ee,null))[_0xbeb6('0x20')](function(_0x9b1ec2){if(_0x9b1ec2){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x9b1ec2['id']},'include':[{'model':db[_0xbeb6('0x80')],'as':_0xbeb6('0x81'),'include':[{'model':db[_0xbeb6('0x82')],'as':_0xbeb6('0x83'),'where':{[_0x9b1ec2['mapKey']]:_0x2d6436},'limit':0x1,'order':[['updatedAt',_0xbeb6('0xb9')]]}]}]})[_0xbeb6('0x20')](handleEntityNotFound(_0x4884ee,null))[_0xbeb6('0x20')](function(_0x2ba673){if(_0x2ba673&&_0x2ba673[_0xbeb6('0x81')]){_0x497782=_0x2ba673['get']({'plain':!![]});if(_0x497782['List']&&_0x497782[_0xbeb6('0x81')][_0xbeb6('0x83')][_0xbeb6('0x59')]){return _0x497782[_0xbeb6('0x81')][_0xbeb6('0x83')][0x0];}return db[_0xbeb6('0x82')][_0xbeb6('0x5b')](_['defaults'](_0x212315[_0xbeb6('0x61')],{'firstName':_0x2d6436,[_0x2ba673[_0xbeb6('0x7e')]]:_0x2d6436,'phone':_0x2d6436,'ListId':_0x497782[_0xbeb6('0x78')]}));}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4884ee,null))['then'](function(_0x23bf94){if(_0x23bf94){_0x5fb17c=_0x23bf94;return db[_0xbeb6('0x8e')][_0xbeb6('0x5a')]({'where':{'ContactId':_0x5fb17c['id'],'closed':![],'OpenchannelAccountId':_0x497782['id']}})[_0xbeb6('0x20')](function(_0x2bc841){if(_0x2bc841){return[_0x2bc841,![]];}return db[_0xbeb6('0x8e')][_0xbeb6('0x5b')]({'UserId':_0x212315[_0xbeb6('0x5c')]['id'],'ContactId':_0x5fb17c['id'],'OpenchannelAccountId':_0x497782['id'],'lastMsgDirection':_0xbeb6('0xba'),'Messages':[_[_0xbeb6('0x4f')](_0x212315[_0xbeb6('0x61')],{'read':![],'body':_0x212315[_0xbeb6('0x61')][_0xbeb6('0x61')],'OpenchannelAccountId':_0x497782['id'],'UserId':_0x212315[_0xbeb6('0x5c')]['id'],'ContactId':_0x5fb17c['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xbeb6('0x20')](function(_0x4e272e){return[_0x4e272e,!![]];});});}})[_0xbeb6('0x91')](function(_0x4a50c3,_0x451410){if(_0x451410){return _0x4a50c3;}return db[_0xbeb6('0x9a')][_0xbeb6('0x5b')](_[_0xbeb6('0x4f')](_0x212315[_0xbeb6('0x61')],{'read':![],'body':_0x212315[_0xbeb6('0x61')][_0xbeb6('0x61')],'OpenchannelAccountId':_0x497782['id'],'OpenchannelInteractionId':_0x4a50c3['id'],'UserId':_0x212315['user']['id'],'ContactId':_0x5fb17c['id']}))[_0xbeb6('0x20')](function(_0x151db3){_0x4a50c3[_0xbeb6('0xbb')][_0xbeb6('0xbc')]=[];_0x4a50c3[_0xbeb6('0xbb')][_0xbeb6('0xbc')][_0xbeb6('0x96')](_0x151db3['dataValues']);return _0x4a50c3;});});}})[_0xbeb6('0x20')](respondWithResult(_0x4884ee,null))[_0xbeb6('0x56')](handleError(_0x4884ee,null));}; \ No newline at end of file +var _0xae4d=['create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','addDisposition','OpnechannelAccountId','getDispositions','findOne','OpenchannelAccountId','include','Disposition','findAll','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','notify','openchannel','describe','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','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','from','List','CmContact','Contacts','Applications','account','applications','list','orderBy','priority','asc','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','addApplications','sequelize','OpenchannelApplication','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','removeAgents','emit','userOpenchannelAccount:remove','getAgents','send','CmList','DESC','Messages','dataValues','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','destroy','get','UserProfileResource','name','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','rows','Pause','keys','includeAll'];(function(_0x47967f,_0x4f4ebb){var _0x2acea4=function(_0x346752){while(--_0x346752){_0x47967f['push'](_0x47967f['shift']());}};_0x2acea4(++_0x4f4ebb);}(_0xae4d,0x129));var _0xdae4=function(_0x239795,_0x391f30){_0x239795=_0x239795-0x0;var _0x25c22b=_0xae4d[_0x239795];return _0x25c22b;};'use strict';var pdf=require(_0xdae4('0x0'));var emlformat=require(_0xdae4('0x1'));var rimraf=require(_0xdae4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdae4('0x3'));var moment=require(_0xdae4('0x4'));var BPromise=require(_0xdae4('0x5'));var Mustache=require(_0xdae4('0x6'));var util=require(_0xdae4('0x7'));var path=require(_0xdae4('0x8'));var sox=require(_0xdae4('0x9'));var csv=require(_0xdae4('0xa'));var ejs=require(_0xdae4('0xb'));var fs=require('fs');var _=require(_0xdae4('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdae4('0xd'));var deskjs=require(_0xdae4('0xe'));var toCsv=require(_0xdae4('0xa'));var querystring=require('querystring');var Papa=require(_0xdae4('0xf'));var Redis=require('ioredis');var authService=require(_0xdae4('0x10'));var qs=require(_0xdae4('0x11'));var as=require(_0xdae4('0x12'));var hardwareService=require(_0xdae4('0x13'));var logger=require(_0xdae4('0x14'))(_0xdae4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xdae4('0x16'))['db'];config[_0xdae4('0x17')]=_[_0xdae4('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xdae4('0x19'))(new Redis(config[_0xdae4('0x17')]));require(_0xdae4('0x1a'))[_0xdae4('0x1b')](socket);var jayson=require(_0xdae4('0x1c'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xdae4('0x1d')][_0xdae4('0x1e')]({'port':0x232a});function checkPasswordPattern(_0xfc63c7,_0x5cece6,_0x5b8fef){if(_0x5b8fef){var _0x2002cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2002cc[_0xdae4('0x1f')](_0x5cece6)){return _0xfc63c7;}else{throw new db['Sequelize'][(_0xdae4('0x20'))](_0xdae4('0x21'));}}else{return _0xfc63c7;}}function respondWithRpcPromise(_0x483b9a,_0x21ddf9,_0x19acb7,_0x58bff0){return new BPromise(function(_0x3e16c4,_0x136e1b){var _0x4150d0=_0x58bff0||client;return _0x4150d0[_0xdae4('0x22')](_0x483b9a,_0x19acb7)[_0xdae4('0x23')](function(_0x152bc0){logger[_0xdae4('0x24')](_0xdae4('0x25'),_0x21ddf9,_0xdae4('0x26'));logger[_0xdae4('0x27')](_0xdae4('0x28'),_0x21ddf9,_0xdae4('0x26'),JSON[_0xdae4('0x29')](_0x152bc0));if(_0x152bc0[_0xdae4('0x2a')]){if(_0x152bc0[_0xdae4('0x2a')]['code']===0x1f4){logger['error'](_0xdae4('0x25'),_0x21ddf9,_0x152bc0['error'][_0xdae4('0x2b')]);return _0x136e1b(_0x152bc0['error'][_0xdae4('0x2b')]);}logger[_0xdae4('0x2a')](_0xdae4('0x25'),_0x21ddf9,_0x152bc0[_0xdae4('0x2a')]['message']);return _0x3e16c4(_0x152bc0[_0xdae4('0x2a')][_0xdae4('0x2b')]);}else{logger[_0xdae4('0x24')](_0xdae4('0x25'),_0x21ddf9,_0xdae4('0x26'));_0x3e16c4(_0x152bc0[_0xdae4('0x2c')][_0xdae4('0x2b')]);}})[_0xdae4('0x2d')](function(_0x1f4d17){logger[_0xdae4('0x2a')](_0xdae4('0x25'),_0x21ddf9,_0x1f4d17);_0x136e1b(_0x1f4d17);});});}function respondWithStatusCode(_0x40c108,_0x817a6a){_0x817a6a=_0x817a6a||0xcc;return function(_0x245ed7){if(_0x245ed7){return _0x40c108[_0xdae4('0x2e')](_0x817a6a);}return _0x40c108[_0xdae4('0x2f')](_0x817a6a)[_0xdae4('0x30')]();};}function respondWithResult(_0x1ebcab,_0x59a431){_0x59a431=_0x59a431||0xc8;return function(_0x52f70a){if(_0x52f70a){return _0x1ebcab[_0xdae4('0x2f')](_0x59a431)['json'](_0x52f70a);}};}function respondWithFilteredResult(_0x4721b1,_0x458dd8){return function(_0x230a4a){if(_0x230a4a){var _0x22485e=_0x230a4a[_0xdae4('0x31')],_0x2902f2=_0x458dd8[_0xdae4('0x32')],_0x1e5022=_0x458dd8[_0xdae4('0x32')]+_0x458dd8[_0xdae4('0x33')],_0x2e7f8e;if(_0x1e5022>=_0x22485e){_0x1e5022=_0x22485e;_0x2e7f8e=0xc8;}else{_0x2e7f8e=0xce;}_0x4721b1['status'](_0x2e7f8e);return _0x4721b1[_0xdae4('0x34')](_0xdae4('0x35'),_0x2902f2+'-'+_0x1e5022+'/'+_0x22485e)['json'](_0x230a4a);}return null;};}function patchUpdates(_0x4146d){return function(_0x24a98f){try{jsonpatch['apply'](_0x24a98f,_0x4146d,!![]);}catch(_0x49ec8d){return BPromise[_0xdae4('0x36')](_0x49ec8d);}return _0x24a98f[_0xdae4('0x37')]();};}function saveUpdates(_0x567816,_0x5b469d){return function(_0x54176a){if(_0x54176a){return _0x54176a['update'](_0x567816)[_0xdae4('0x23')](function(_0x2151b8){return _0x2151b8;});}return null;};}function removeEntity(_0x517cc3,_0x105c12){return function(_0x464390){if(_0x464390){return _0x464390[_0xdae4('0x38')]()[_0xdae4('0x23')](function(){var _0x3a9cb2=_0x464390[_0xdae4('0x39')]({'plain':!![]});var _0xd90f8a='OpenchannelAccounts';return db[_0xdae4('0x3a')]['destroy']({'where':{'type':_0xd90f8a,'resourceId':_0x3a9cb2['id']}})[_0xdae4('0x23')](function(){return _0x464390;});})[_0xdae4('0x23')](function(){_0x517cc3[_0xdae4('0x2f')](0xcc)[_0xdae4('0x30')]();});}};}function handleEntityNotFound(_0x23ccd7,_0x3e043d){return function(_0x54458d){if(!_0x54458d){_0x23ccd7['sendStatus'](0x194);}return _0x54458d;};}function handleError(_0x42f1fe,_0x3fe8d5){_0x3fe8d5=_0x3fe8d5||0x1f4;return function(_0x26fe1e){logger['error'](_0x26fe1e['stack']);if(_0x26fe1e[_0xdae4('0x3b')]){delete _0x26fe1e[_0xdae4('0x3b')];}_0x42f1fe['status'](_0x3fe8d5)['send'](_0x26fe1e);};}exports['index']=function(_0x398a1b,_0x3f6126){var _0x797529={'include':[{'model':db['Pause'],'as':_0xdae4('0x3c')}]},_0x1e09dd={},_0xadb0f9={'count':0x0,'rows':[]};var _0x2eeb4b=_[_0xdae4('0x3d')](db[_0xdae4('0x3e')][_0xdae4('0x3f')],function(_0x4f1849){return{'name':_0x4f1849['fieldName'],'type':_0x4f1849['type'][_0xdae4('0x40')]};});_0x1e09dd[_0xdae4('0x41')]=_[_0xdae4('0x3d')](_0x2eeb4b,_0xdae4('0x3b'));_0x1e09dd[_0xdae4('0x42')]=_['keys'](_0x398a1b[_0xdae4('0x42')]);_0x1e09dd[_0xdae4('0x43')]=_[_0xdae4('0x44')](_0x1e09dd['model'],_0x1e09dd[_0xdae4('0x42')]);_0x797529['attributes']=_[_0xdae4('0x44')](_0x1e09dd[_0xdae4('0x41')],qs[_0xdae4('0x45')](_0x398a1b['query'][_0xdae4('0x45')]));_0x797529[_0xdae4('0x46')]=_0x797529[_0xdae4('0x46')][_0xdae4('0x47')]?_0x797529[_0xdae4('0x46')]:_0x1e09dd[_0xdae4('0x41')];if(!_0x398a1b[_0xdae4('0x42')][_0xdae4('0x48')](_0xdae4('0x49'))){_0x797529[_0xdae4('0x33')]=qs['limit'](_0x398a1b[_0xdae4('0x42')][_0xdae4('0x33')]);_0x797529[_0xdae4('0x32')]=qs['offset'](_0x398a1b[_0xdae4('0x42')]['offset']);}_0x797529[_0xdae4('0x4a')]=qs[_0xdae4('0x4b')](_0x398a1b[_0xdae4('0x42')][_0xdae4('0x4b')]);_0x797529[_0xdae4('0x4c')]=qs[_0xdae4('0x43')](_[_0xdae4('0x4d')](_0x398a1b[_0xdae4('0x42')],_0x1e09dd[_0xdae4('0x43')]));if(_0x398a1b[_0xdae4('0x42')]['filter']){_0x797529[_0xdae4('0x4c')]=_[_0xdae4('0x4e')](_0x797529[_0xdae4('0x4c')],{'$or':_[_0xdae4('0x3d')](_0x2eeb4b,function(_0x1f114d){if(_0x1f114d[_0xdae4('0x4f')]!==_0xdae4('0x50')){var _0x4a7c47={};_0x4a7c47[_0x1f114d[_0xdae4('0x3b')]]={'$like':'%'+_0x398a1b[_0xdae4('0x42')][_0xdae4('0x51')]+'%'};return _0x4a7c47;}})});}_0x797529=_[_0xdae4('0x4e')]({},_0x797529,_0x398a1b[_0xdae4('0x52')]);var _0x2571f8={'where':_0x797529[_0xdae4('0x4c')]};return db[_0xdae4('0x3e')][_0xdae4('0x31')](_0x2571f8)[_0xdae4('0x23')](function(_0x54d6f2){_0xadb0f9[_0xdae4('0x31')]=_0x54d6f2;if(_0x398a1b['query']['includeAll']){_0x797529['include']=[{'all':!![]}];}return db[_0xdae4('0x3e')]['findAll'](_0x797529);})[_0xdae4('0x23')](function(_0x6018a5){_0xadb0f9[_0xdae4('0x53')]=_0x6018a5;return _0xadb0f9;})[_0xdae4('0x23')](respondWithFilteredResult(_0x3f6126,_0x797529))[_0xdae4('0x2d')](handleError(_0x3f6126,null));};exports['show']=function(_0x36b450,_0x4cbfd9){var _0x21b569={'raw':![],'where':{'id':_0x36b450['params']['id']},'include':[{'model':db[_0xdae4('0x54')],'as':_0xdae4('0x3c')}]},_0xa4a1f6={};_0xa4a1f6[_0xdae4('0x41')]=_[_0xdae4('0x55')](db['OpenchannelAccount'][_0xdae4('0x3f')]);_0xa4a1f6['query']=_[_0xdae4('0x55')](_0x36b450['query']);_0xa4a1f6[_0xdae4('0x43')]=_['intersection'](_0xa4a1f6[_0xdae4('0x41')],_0xa4a1f6[_0xdae4('0x42')]);_0x21b569['attributes']=_[_0xdae4('0x44')](_0xa4a1f6[_0xdae4('0x41')],qs['fields'](_0x36b450[_0xdae4('0x42')][_0xdae4('0x45')]));_0x21b569['attributes']=_0x21b569[_0xdae4('0x46')]['length']?_0x21b569['attributes']:_0xa4a1f6[_0xdae4('0x41')];if(_0x36b450[_0xdae4('0x42')][_0xdae4('0x56')]){_0x21b569['include']=[{'all':!![]}];}_0x21b569=_[_0xdae4('0x4e')]({},_0x21b569,_0x36b450[_0xdae4('0x52')]);return db[_0xdae4('0x3e')]['find'](_0x21b569)[_0xdae4('0x23')](handleEntityNotFound(_0x4cbfd9,null))['then'](respondWithResult(_0x4cbfd9,null))[_0xdae4('0x2d')](handleError(_0x4cbfd9,null));};exports[_0xdae4('0x57')]=function(_0x342fe3,_0x4ba6e4){return db[_0xdae4('0x3e')][_0xdae4('0x57')](_0x342fe3[_0xdae4('0x58')],{})[_0xdae4('0x23')](function(_0x3de977){var _0x5eea2e=_0x342fe3['user'][_0xdae4('0x39')]({'plain':!![]});if(!_0x5eea2e)throw new Error(_0xdae4('0x59'));if(_0x5eea2e[_0xdae4('0x5a')]===_0xdae4('0x5b')){var _0x5de051=_0x3de977[_0xdae4('0x39')]({'plain':!![]});var _0x276a73=_0xdae4('0x5c');return db[_0xdae4('0x5d')]['find']({'where':{'name':_0x276a73,'userProfileId':_0x5eea2e[_0xdae4('0x5e')]},'raw':!![]})['then'](function(_0x3d4790){if(_0x3d4790&&_0x3d4790[_0xdae4('0x5f')]===0x0){return db[_0xdae4('0x3a')][_0xdae4('0x57')]({'name':_0x5de051[_0xdae4('0x3b')],'resourceId':_0x5de051['id'],'type':_0x3d4790[_0xdae4('0x3b')],'sectionId':_0x3d4790['id']},{})[_0xdae4('0x23')](function(){return _0x3de977;});}else{return _0x3de977;}})['catch'](function(_0x353e62){logger['error'](_0xdae4('0x60'),_0x353e62);throw _0x353e62;});}return _0x3de977;})[_0xdae4('0x23')](respondWithResult(_0x4ba6e4,0xc9))['catch'](handleError(_0x4ba6e4,null));};exports[_0xdae4('0x61')]=function(_0x3f1fbb,_0x54b391){if(_0x3f1fbb['body']['id']){delete _0x3f1fbb['body']['id'];}return db[_0xdae4('0x3e')][_0xdae4('0x62')]({'where':{'id':_0x3f1fbb[_0xdae4('0x63')]['id']},'include':[{'model':db[_0xdae4('0x54')],'as':_0xdae4('0x3c')}]})[_0xdae4('0x23')](handleEntityNotFound(_0x54b391,null))[_0xdae4('0x23')](saveUpdates(_0x3f1fbb['body'],null))['then'](respondWithResult(_0x54b391,null))[_0xdae4('0x2d')](handleError(_0x54b391,null));};exports[_0xdae4('0x38')]=function(_0x2e81b3,_0x428e97){return db[_0xdae4('0x3e')][_0xdae4('0x62')]({'where':{'id':_0x2e81b3[_0xdae4('0x63')]['id']}})['then'](handleEntityNotFound(_0x428e97,null))[_0xdae4('0x23')](removeEntity(_0x428e97,null))['catch'](handleError(_0x428e97,null));};exports['describe']=function(_0x4c7d67,_0x4cacee){return db[_0xdae4('0x3e')]['describe']()[_0xdae4('0x23')](respondWithResult(_0x4cacee,null))[_0xdae4('0x2d')](handleError(_0x4cacee,null));};exports[_0xdae4('0x64')]=function(_0x194623,_0x26d754,_0x498538){if(_0x194623['body']['id']){delete _0x194623[_0xdae4('0x58')]['id'];}return db[_0xdae4('0x3e')][_0xdae4('0x62')]({'where':{'id':_0x194623[_0xdae4('0x63')]['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x26d754,null))[_0xdae4('0x23')](function(_0x3f3c20){if(_0x3f3c20){_0x194623[_0xdae4('0x58')][_0xdae4('0x65')]=_0x3f3c20['id'];return db['Disposition']['create'](_0x194623[_0xdae4('0x58')]);}})[_0xdae4('0x23')](respondWithResult(_0x26d754,null))[_0xdae4('0x2d')](handleError(_0x26d754,null));};exports[_0xdae4('0x66')]=function(_0x418c23,_0x532ebd,_0x21a40f){var _0x1d9bd9={'raw':![],'where':{}};var _0x1c3635={};var _0x24a090={'count':0x0,'rows':[]};return db[_0xdae4('0x3e')][_0xdae4('0x67')]({'where':{'id':_0x418c23[_0xdae4('0x63')]['id']}})['then'](handleEntityNotFound(_0x532ebd,null))['then'](function(_0x4dfba0){if(_0x4dfba0){_0x1c3635[_0xdae4('0x41')]=_['keys'](db['Disposition'][_0xdae4('0x3f')]);_0x1c3635[_0xdae4('0x42')]=_[_0xdae4('0x55')](_0x418c23[_0xdae4('0x42')]);_0x1c3635[_0xdae4('0x43')]=_[_0xdae4('0x44')](_0x1c3635['model'],_0x1c3635[_0xdae4('0x42')]);_0x1d9bd9[_0xdae4('0x46')]=_['intersection'](_0x1c3635['model'],qs['fields'](_0x418c23[_0xdae4('0x42')][_0xdae4('0x45')]));_0x1d9bd9[_0xdae4('0x46')]=_0x1d9bd9[_0xdae4('0x46')][_0xdae4('0x47')]?_0x1d9bd9[_0xdae4('0x46')]:_0x1c3635[_0xdae4('0x41')];if(!_0x418c23[_0xdae4('0x42')][_0xdae4('0x48')](_0xdae4('0x49'))){_0x1d9bd9[_0xdae4('0x33')]=qs[_0xdae4('0x33')](_0x418c23[_0xdae4('0x42')][_0xdae4('0x33')]);_0x1d9bd9['offset']=qs[_0xdae4('0x32')](_0x418c23['query'][_0xdae4('0x32')]);}_0x1d9bd9[_0xdae4('0x4a')]=qs['sort'](_0x418c23[_0xdae4('0x42')][_0xdae4('0x4b')]);_0x1d9bd9[_0xdae4('0x4c')]=qs[_0xdae4('0x43')](_[_0xdae4('0x4d')](_0x418c23['query'],_0x1c3635[_0xdae4('0x43')]));_0x1d9bd9[_0xdae4('0x4c')][_0xdae4('0x68')]=_0x4dfba0['id'];if(_0x418c23[_0xdae4('0x42')][_0xdae4('0x51')]){_0x1d9bd9[_0xdae4('0x4c')]=_[_0xdae4('0x4e')](_0x1d9bd9[_0xdae4('0x4c')],{'$or':_['map'](_0x1d9bd9['attributes'],function(_0x558f68){var _0x3d812f={};_0x3d812f[_0x558f68]={'$like':'%'+_0x418c23[_0xdae4('0x42')]['filter']+'%'};return _0x3d812f;})});}_0x1d9bd9=_[_0xdae4('0x4e')]({},_0x1d9bd9,_0x418c23[_0xdae4('0x52')]);return db['Disposition'][_0xdae4('0x31')]({'where':_0x1d9bd9['where']})[_0xdae4('0x23')](function(_0x5990b5){_0x24a090['count']=_0x5990b5;if(_0x418c23[_0xdae4('0x42')][_0xdae4('0x56')]){_0x1d9bd9[_0xdae4('0x69')]=[{'all':!![]}];}return db[_0xdae4('0x6a')][_0xdae4('0x6b')](_0x1d9bd9);})[_0xdae4('0x23')](function(_0x5ab9fe){_0x24a090[_0xdae4('0x53')]=_0x5ab9fe;return _0x24a090;});}})['then'](respondWithFilteredResult(_0x532ebd,_0x1d9bd9))['catch'](handleError(_0x532ebd,null));};exports[_0xdae4('0x6c')]=function(_0x51fcb7,_0x27f203,_0xb4fa32){return db[_0xdae4('0x3e')]['find']({'where':{'id':_0x51fcb7[_0xdae4('0x63')]['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x27f203,null))[_0xdae4('0x23')](function(_0x107570){if(_0x107570){return _0x107570[_0xdae4('0x6c')](_0x51fcb7[_0xdae4('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x27f203,null))[_0xdae4('0x2d')](handleError(_0x27f203,null));};exports[_0xdae4('0x6d')]=function(_0x58415f,_0x254077,_0x41452d){if(_0x58415f[_0xdae4('0x58')]['id']){delete _0x58415f[_0xdae4('0x58')]['id'];}return db[_0xdae4('0x3e')]['find']({'where':{'id':_0x58415f['params']['id']}})['then'](handleEntityNotFound(_0x254077,null))[_0xdae4('0x23')](function(_0x42d2b2){if(_0x42d2b2){_0x58415f['body'][_0xdae4('0x68')]=_0x42d2b2['id'];return db['CannedAnswer'][_0xdae4('0x57')](_0x58415f[_0xdae4('0x58')]);}})[_0xdae4('0x23')](respondWithResult(_0x254077,null))[_0xdae4('0x2d')](handleError(_0x254077,null));};exports[_0xdae4('0x6e')]=function(_0x33c958,_0x2b3712,_0x4a8c20){var _0x193a21={'raw':![],'where':{}};var _0x4cd45c={};var _0x235f21={'count':0x0,'rows':[]};return db[_0xdae4('0x3e')][_0xdae4('0x67')]({'where':{'id':_0x33c958[_0xdae4('0x63')]['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x2b3712,null))[_0xdae4('0x23')](function(_0x299552){if(_0x299552){_0x4cd45c[_0xdae4('0x41')]=_[_0xdae4('0x55')](db[_0xdae4('0x6f')][_0xdae4('0x3f')]);_0x4cd45c[_0xdae4('0x42')]=_['keys'](_0x33c958[_0xdae4('0x42')]);_0x4cd45c[_0xdae4('0x43')]=_[_0xdae4('0x44')](_0x4cd45c[_0xdae4('0x41')],_0x4cd45c[_0xdae4('0x42')]);_0x193a21[_0xdae4('0x46')]=_[_0xdae4('0x44')](_0x4cd45c['model'],qs[_0xdae4('0x45')](_0x33c958['query'][_0xdae4('0x45')]));_0x193a21[_0xdae4('0x46')]=_0x193a21[_0xdae4('0x46')][_0xdae4('0x47')]?_0x193a21[_0xdae4('0x46')]:_0x4cd45c[_0xdae4('0x41')];if(!_0x33c958['query'][_0xdae4('0x48')](_0xdae4('0x49'))){_0x193a21[_0xdae4('0x33')]=qs[_0xdae4('0x33')](_0x33c958['query'][_0xdae4('0x33')]);_0x193a21[_0xdae4('0x32')]=qs[_0xdae4('0x32')](_0x33c958[_0xdae4('0x42')][_0xdae4('0x32')]);}_0x193a21[_0xdae4('0x4a')]=qs[_0xdae4('0x4b')](_0x33c958['query'][_0xdae4('0x4b')]);_0x193a21[_0xdae4('0x4c')]=qs[_0xdae4('0x43')](_[_0xdae4('0x4d')](_0x33c958[_0xdae4('0x42')],_0x4cd45c[_0xdae4('0x43')]));_0x193a21[_0xdae4('0x4c')][_0xdae4('0x68')]=_0x299552['id'];if(_0x33c958[_0xdae4('0x42')]['filter']){_0x193a21[_0xdae4('0x4c')]=_[_0xdae4('0x4e')](_0x193a21[_0xdae4('0x4c')],{'$or':_['map'](_0x193a21[_0xdae4('0x46')],function(_0x226ab9){var _0x2d92c4={};_0x2d92c4[_0x226ab9]={'$like':'%'+_0x33c958[_0xdae4('0x42')][_0xdae4('0x51')]+'%'};return _0x2d92c4;})});}_0x193a21=_[_0xdae4('0x4e')]({},_0x193a21,_0x33c958['options']);return db[_0xdae4('0x6f')][_0xdae4('0x31')]({'where':_0x193a21[_0xdae4('0x4c')]})[_0xdae4('0x23')](function(_0x445fca){_0x235f21[_0xdae4('0x31')]=_0x445fca;if(_0x33c958['query'][_0xdae4('0x56')]){_0x193a21[_0xdae4('0x69')]=[{'all':!![]}];}return db['CannedAnswer'][_0xdae4('0x6b')](_0x193a21);})[_0xdae4('0x23')](function(_0x22c8a5){_0x235f21[_0xdae4('0x53')]=_0x22c8a5;return _0x235f21;});}})[_0xdae4('0x23')](respondWithFilteredResult(_0x2b3712,_0x193a21))[_0xdae4('0x2d')](handleError(_0x2b3712,null));};exports[_0xdae4('0x70')]=function(_0x28c1dd,_0x51722f,_0xa10921){return db['OpenchannelAccount'][_0xdae4('0x62')]({'where':{'id':_0x28c1dd[_0xdae4('0x63')]['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x51722f,null))[_0xdae4('0x23')](function(_0x884a37){if(_0x884a37){return _0x884a37['removeAnswers'](_0x28c1dd[_0xdae4('0x42')][_0xdae4('0x71')]);}})[_0xdae4('0x23')](respondWithStatusCode(_0x51722f,null))[_0xdae4('0x2d')](handleError(_0x51722f,null));};exports[_0xdae4('0x72')]=function(_0x5be42b,_0x492e89,_0x56d789){var _0x12ea69={'body':_0x5be42b['body'],'channel':_0xdae4('0x73')};var _0x494d23=[];var _0x419ef6=[];var _0xc4f8fa={};var _0x5afd77=![];return db['CmContact'][_0xdae4('0x74')]()[_0xdae4('0x23')](function(_0x354c71){if(!_0x354c71){throw new db[(_0xdae4('0x75'))][(_0xdae4('0x20'))](_0xdae4('0x76'));}_0x494d23=_['difference'](_[_0xdae4('0x55')](_0x354c71),[_0xdae4('0x77'),_0xdae4('0x78')]);_0x419ef6=_[_0xdae4('0x79')](_[_0xdae4('0x55')](_0x354c71),['createdAt',_0xdae4('0x78'),_0xdae4('0x7a'),_0xdae4('0x7b')]);if(_0x5be42b[_0xdae4('0x58')]['id']){delete _0x5be42b[_0xdae4('0x58')]['id'];}if(_[_0xdae4('0x7c')](_0x5be42b[_0xdae4('0x58')]['from'])){throw new db[(_0xdae4('0x75'))][(_0xdae4('0x20'))](_0xdae4('0x7d'));}if(_[_0xdae4('0x7c')](_0x5be42b['body'][_0xdae4('0x58')])||_0x5be42b['body'][_0xdae4('0x58')]===''){throw new db[(_0xdae4('0x75'))][(_0xdae4('0x20'))](_0xdae4('0x7e'));}if(_[_0xdae4('0x7c')](_0x5be42b[_0xdae4('0x58')][_0xdae4('0x7f')])){throw new db[(_0xdae4('0x75'))][(_0xdae4('0x20'))](_0xdae4('0x80')+_0x419ef6);}if(!_[_0xdae4('0x81')](_0x419ef6,_0x5be42b[_0xdae4('0x58')]['mapKey'])){throw new db[(_0xdae4('0x75'))]['ValidationError'](_0xdae4('0x82')+_0x419ef6);}_0xc4f8fa[_0x5be42b[_0xdae4('0x58')][_0xdae4('0x7f')]]=_0x5be42b[_0xdae4('0x58')][_0xdae4('0x83')];})[_0xdae4('0x23')](function(){return db[_0xdae4('0x3e')]['find']({'where':{'id':_0x5be42b[_0xdae4('0x63')]['id']},'include':[{'model':db['CmList'],'as':_0xdae4('0x84'),'include':[{'model':db[_0xdae4('0x85')],'as':_0xdae4('0x86'),'where':_0xc4f8fa,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xdae4('0x87')}]});})[_0xdae4('0x23')](handleEntityNotFound(_0x492e89,null))[_0xdae4('0x23')](function(_0x4bbc90){if(_0x4bbc90&&_0x4bbc90[_0xdae4('0x84')]){_0x12ea69[_0xdae4('0x88')]=_0x4bbc90;_0x12ea69[_0xdae4('0x89')]=_0x4bbc90[_0xdae4('0x87')];_0x12ea69[_0xdae4('0x8a')]=_0x4bbc90[_0xdae4('0x84')];_0x12ea69[_0xdae4('0x89')]=_[_0xdae4('0x8b')](_0x12ea69[_0xdae4('0x89')],[_0xdae4('0x8c')],[_0xdae4('0x8d')]);if(_0x12ea69[_0xdae4('0x88')][_0xdae4('0x87')]){delete _0x12ea69[_0xdae4('0x88')][_0xdae4('0x87')];}if(_0x12ea69['account'][_0xdae4('0x84')]&&_0x12ea69[_0xdae4('0x88')][_0xdae4('0x84')][_0xdae4('0x86')][_0xdae4('0x47')]){return _0x12ea69[_0xdae4('0x88')][_0xdae4('0x84')][_0xdae4('0x86')][0x0];}var _0x2e2491=_['defaults'](_0x5be42b[_0xdae4('0x58')],{'firstName':_0x5be42b['body'][_0xdae4('0x83')],'ListId':_0x4bbc90[_0xdae4('0x7b')]});_0x2e2491[_0x5be42b[_0xdae4('0x58')][_0xdae4('0x7f')]]=_0x5be42b[_0xdae4('0x58')]['from'];return db[_0xdae4('0x85')][_0xdae4('0x57')](_0x2e2491,{'fields':_0x494d23,'raw':!![]});}})[_0xdae4('0x23')](handleEntityNotFound(_0x492e89,null))[_0xdae4('0x23')](function(_0x1e142d){_0x12ea69['contact']=_0x1e142d;if(_0x1e142d){var _0x4ef4ba={'ContactId':_0x1e142d['id'],'OpenchannelAccountId':_0x5be42b['params']['id'],'from':(_0x1e142d[_0xdae4('0x8e')]||'')+'\x20'+(_0x1e142d[_0xdae4('0x8f')]||'')};var _0x25046e={'OpenchannelAccountId':_0x5be42b[_0xdae4('0x63')]['id'],'closed':![]};if(_0x5be42b[_0xdae4('0x58')][_0xdae4('0x90')]){_0x25046e[_0xdae4('0x90')]=_0x5be42b['body'][_0xdae4('0x90')];return db['OpenchannelInteraction'][_0xdae4('0x62')]({'where':_0x25046e})[_0xdae4('0x23')](function(_0x559507){if(_0x559507){return[_0x559507,![]];}_0x4ef4ba[_0xdae4('0x90')]=_0x5be42b[_0xdae4('0x58')][_0xdae4('0x90')];_0x4ef4ba[_0xdae4('0x91')]=_0x5be42b[_0xdae4('0x58')][_0xdae4('0x91')];return db[_0xdae4('0x92')][_0xdae4('0x57')](_0x4ef4ba)[_0xdae4('0x23')](function(_0x10c612){return[_0x10c612,!![]];});});}else{_0x25046e['threadId']=null;}_0x25046e[_0xdae4('0x93')]=_0x1e142d['id'];return db['OpenchannelInteraction'][_0xdae4('0x62')]({'where':_0x25046e})[_0xdae4('0x23')](function(_0x1fe17d){if(_0x1fe17d){return[_0x1fe17d,![]];}return db[_0xdae4('0x92')][_0xdae4('0x57')](_0x4ef4ba)[_0xdae4('0x23')](function(_0x31181c){return[_0x31181c,!![]];});});}})[_0xdae4('0x94')](function(_0x2cb443,_0x4f5cb2){if(_0x2cb443){_0x5afd77=_0x4f5cb2;if(!_0x4f5cb2){var _0x5c1103={'from':(_0x12ea69['contact'][_0xdae4('0x8e')]||'')+'\x20'+(_0x12ea69[_0xdae4('0x95')]['lastName']||'')};if(_0x5be42b[_0xdae4('0x58')][_0xdae4('0x90')]&&_0x5be42b[_0xdae4('0x58')][_0xdae4('0x96')]&&_0x5be42b['body'][_0xdae4('0x90')]!=_0x5be42b[_0xdae4('0x58')][_0xdae4('0x96')]){_0x5c1103[_0xdae4('0x90')]=_0x5be42b[_0xdae4('0x58')][_0xdae4('0x96')];}return _0x2cb443['update'](_0x5c1103);}else{return _0x2cb443;}}})[_0xdae4('0x23')](function(_0x409167){_0x12ea69[_0xdae4('0x97')]=_0x409167[_0xdae4('0x39')]({'plain':!![]});_0x12ea69[_0xdae4('0x97')][_0xdae4('0x98')]=_0x5afd77;if(_0x12ea69[_0xdae4('0x97')][_0xdae4('0x98')]){if(_0x12ea69['account'][_0xdae4('0x99')]){_0x12ea69[_0xdae4('0x89')][_0xdae4('0x9a')]({'id':0x0,'priority':_0x12ea69[_0xdae4('0x89')][_0xdae4('0x47')]+0x1,'app':_0xdae4('0x9b'),'appdata':'unmanaged','interval':_0xdae4('0x9c')});}}return db[_0xdae4('0x9d')][_0xdae4('0x57')]({'body':_0x5be42b['body'][_0xdae4('0x58')],'OpenchannelAccountId':_0x5be42b[_0xdae4('0x63')]['id'],'OpenchannelInteractionId':_0x409167['id'],'direction':'in','ContactId':_0x12ea69[_0xdae4('0x95')]['id'],'AttachmentId':_0x5be42b[_0xdae4('0x58')][_0xdae4('0x9e')]});})[_0xdae4('0x23')](function(_0x570819){_0x12ea69[_0xdae4('0x2b')]=_0x570819;if(_0x12ea69[_0xdae4('0x97')]['UserId']){return db[_0xdae4('0x9f')][_0xdae4('0x62')]({'attributes':['id',_0xdae4('0x3b')],'where':{'id':_0x12ea69[_0xdae4('0x97')][_0xdae4('0xa0')]}})[_0xdae4('0x23')](function(_0x361836){if(_0x361836){_0x12ea69[_0xdae4('0x89')][_0xdae4('0xa1')]({'id':0x0,'priority':0x0,'app':_0xdae4('0xa2'),'appdata':_0x361836[_0xdae4('0x3b')]+','+(_0x12ea69[_0xdae4('0x88')][_0xdae4('0xa3')]||0xa),'interval':'*,*,*,*'});_0x12ea69[_0xdae4('0xa4')]=![];}return respondWithRpcPromise(_0xdae4('0xa5'),_0xdae4('0xa6'),_0x12ea69);});}return respondWithRpcPromise(_0xdae4('0xa5'),_0xdae4('0xa6'),_0x12ea69);})[_0xdae4('0x23')](function(_0x1ae8b2){respondWithRpcPromise('EventManager','EventManager',{'event':_0xdae4('0x72'),'message':_0x1ae8b2},client9002);return _0x1ae8b2;})[_0xdae4('0x23')](respondWithResult(_0x492e89,null))[_0xdae4('0x2d')](handleError(_0x492e89,null));};exports[_0xdae4('0xa7')]=function(_0x443981,_0x2f511f,_0x2b9248){return db['OpenchannelAccount'][_0xdae4('0x67')]({'where':{'id':_0x443981['params']['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x2f511f,null))[_0xdae4('0x23')](function(_0x5d4280){if(_0x5d4280){return db[_0xdae4('0xa8')]['transaction'](function(_0x7b8674){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x443981[_0xdae4('0x63')]['id']},'transaction':_0x7b8674})[_0xdae4('0x23')](function(_0xc78d55){var _0x5e2339=_['map'](_0x443981['body'],function(_0x58e706){_0x58e706[_0xdae4('0x68')]=_0x443981[_0xdae4('0x63')]['id'];return _0x58e706;});return db[_0xdae4('0xa9')][_0xdae4('0xaa')](_0x5e2339,{'transaction':_0x7b8674});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x443981[_0xdae4('0x63')]['id']},'order':'priority'});});}})[_0xdae4('0x23')](respondWithResult(_0x2f511f,null))['catch'](handleError(_0x2f511f,null));};exports['getApplications']=function(_0x393515,_0x237f44,_0x4c8376){var _0x375a42={};var _0x334574={};var _0x224a4a;var _0x982b1f;return db[_0xdae4('0x3e')][_0xdae4('0x67')]({'where':{'id':_0x393515[_0xdae4('0x63')]['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x237f44,null))['then'](function(_0x3be8c1){if(_0x3be8c1){_0x224a4a=_0x3be8c1;_0x334574[_0xdae4('0x41')]=_['keys'](db['OpenchannelApplication'][_0xdae4('0x3f')]);_0x334574['query']=_[_0xdae4('0x55')](_0x393515[_0xdae4('0x42')]);_0x334574[_0xdae4('0x43')]=_[_0xdae4('0x44')](_0x334574[_0xdae4('0x41')],_0x334574[_0xdae4('0x42')]);_0x375a42[_0xdae4('0x46')]=_[_0xdae4('0x44')](_0x334574[_0xdae4('0x41')],qs['fields'](_0x393515[_0xdae4('0x42')][_0xdae4('0x45')]));_0x375a42['attributes']=_0x375a42[_0xdae4('0x46')][_0xdae4('0x47')]?_0x375a42[_0xdae4('0x46')]:_0x334574['model'];_0x375a42['order']=qs[_0xdae4('0x4b')](_0x393515[_0xdae4('0x42')][_0xdae4('0x4b')]);_0x375a42[_0xdae4('0x4c')]=qs[_0xdae4('0x43')](_[_0xdae4('0x4d')](_0x393515[_0xdae4('0x42')],_0x334574['filters']));if(_0x393515[_0xdae4('0x42')][_0xdae4('0x51')]){_0x375a42[_0xdae4('0x4c')]=_[_0xdae4('0x4e')](_0x375a42['where'],{'$or':_[_0xdae4('0x3d')](_0x375a42['attributes'],function(_0x39e3d6){var _0x58a003={};_0x58a003[_0x39e3d6]={'$like':'%'+_0x393515[_0xdae4('0x42')][_0xdae4('0x51')]+'%'};return _0x58a003;})});}_0x375a42=_[_0xdae4('0x4e')]({},_0x375a42,_0x393515[_0xdae4('0x52')]);return _0x224a4a[_0xdae4('0xab')](_0x375a42);}})[_0xdae4('0x23')](function(_0x28e97d){if(_0x28e97d){_0x982b1f=_0x28e97d[_0xdae4('0x47')];if(!_0x393515[_0xdae4('0x42')][_0xdae4('0x48')](_0xdae4('0x49'))){_0x375a42[_0xdae4('0x33')]=qs[_0xdae4('0x33')](_0x393515[_0xdae4('0x42')][_0xdae4('0x33')]);_0x375a42[_0xdae4('0x32')]=qs[_0xdae4('0x32')](_0x393515[_0xdae4('0x42')]['offset']);}return _0x224a4a['getApplications'](_0x375a42);}})[_0xdae4('0x23')](function(_0x4a3f55){if(_0x4a3f55){return _0x4a3f55?{'count':_0x982b1f,'rows':_0x4a3f55}:null;}})['then'](respondWithResult(_0x237f44,null))[_0xdae4('0x2d')](handleError(_0x237f44,null));};exports[_0xdae4('0xac')]=function(_0x217462,_0x144cce,_0x19c278){var _0x3161c5={'raw':![],'where':{}};var _0x17dcd6={};var _0x5e7f25={'count':0x0,'rows':[]};return db[_0xdae4('0x3e')][_0xdae4('0x67')]({'where':{'id':_0x217462[_0xdae4('0x63')]['id']}})['then'](handleEntityNotFound(_0x144cce,null))['then'](function(_0x5dc4d1){if(_0x5dc4d1){_0x17dcd6['model']=_[_0xdae4('0x55')](db[_0xdae4('0x92')][_0xdae4('0x3f')]);_0x17dcd6['query']=_[_0xdae4('0x55')](_0x217462[_0xdae4('0x42')]);_0x17dcd6['filters']=_[_0xdae4('0x44')](_0x17dcd6[_0xdae4('0x41')],_0x17dcd6['query']);_0x3161c5[_0xdae4('0x46')]=_[_0xdae4('0x44')](_0x17dcd6[_0xdae4('0x41')],qs['fields'](_0x217462[_0xdae4('0x42')][_0xdae4('0x45')]));_0x3161c5[_0xdae4('0x46')]=_0x3161c5[_0xdae4('0x46')]['length']?_0x3161c5[_0xdae4('0x46')]:_0x17dcd6['model'];if(!_0x217462['query'][_0xdae4('0x48')](_0xdae4('0x49'))){_0x3161c5[_0xdae4('0x33')]=qs[_0xdae4('0x33')](_0x217462['query'][_0xdae4('0x33')]);_0x3161c5[_0xdae4('0x32')]=qs[_0xdae4('0x32')](_0x217462['query'][_0xdae4('0x32')]);}_0x3161c5[_0xdae4('0x4a')]=qs[_0xdae4('0x4b')](_0x217462[_0xdae4('0x42')][_0xdae4('0x4b')]);_0x3161c5[_0xdae4('0x4c')]=qs[_0xdae4('0x43')](_[_0xdae4('0x4d')](_0x217462['query'],_0x17dcd6[_0xdae4('0x43')]));_0x3161c5[_0xdae4('0x4c')]['OpenchannelAccountId']=_0x5dc4d1['id'];if(_0x217462[_0xdae4('0x42')][_0xdae4('0x51')]){_0x3161c5['where']=_['merge'](_0x3161c5[_0xdae4('0x4c')],{'$or':_[_0xdae4('0x3d')](_0x3161c5[_0xdae4('0x46')],function(_0x4238c0){var _0x5e45fa={};_0x5e45fa[_0x4238c0]={'$like':'%'+_0x217462[_0xdae4('0x42')][_0xdae4('0x51')]+'%'};return _0x5e45fa;})});}_0x3161c5=_[_0xdae4('0x4e')]({},_0x3161c5,_0x217462[_0xdae4('0x52')]);return db['OpenchannelInteraction'][_0xdae4('0x31')]({'where':_0x3161c5[_0xdae4('0x4c')]})['then'](function(_0x11c1ce){_0x5e7f25[_0xdae4('0x31')]=_0x11c1ce;if(_0x217462[_0xdae4('0x42')][_0xdae4('0x56')]){_0x3161c5[_0xdae4('0x69')]=[{'model':db[_0xdae4('0x85')],'as':_0xdae4('0xad'),'required':![]},{'model':db[_0xdae4('0x9f')],'as':_0xdae4('0xae'),'attributes':[_0xdae4('0x3b'),_0xdae4('0xaf'),_0xdae4('0xb0')],'required':![]},{'model':db[_0xdae4('0xb1')],'as':_0xdae4('0xb2'),'attributes':['id','name',_0xdae4('0xb3')],'where':_0x217462[_0xdae4('0x42')]['tag']?{'id':_0x217462[_0xdae4('0x42')][_0xdae4('0xb4')]}:undefined,'required':_0x217462['query'][_0xdae4('0xb4')]?!![]:![]}];}return db[_0xdae4('0x92')][_0xdae4('0x6b')](_0x3161c5);})[_0xdae4('0x23')](function(_0x32afba){_0x5e7f25[_0xdae4('0x53')]=_0x32afba;return _0x5e7f25;});}})[_0xdae4('0x23')](respondWithFilteredResult(_0x144cce,_0x3161c5))[_0xdae4('0x2d')](handleError(_0x144cce,null));};exports[_0xdae4('0xb5')]=function(_0x52e45b,_0x563aa0,_0xf53763){return db[_0xdae4('0x3e')]['find']({'where':{'id':_0x52e45b['params']['id']}})['then'](handleEntityNotFound(_0x563aa0,null))[_0xdae4('0x23')](function(_0x49a015){if(_0x49a015){return _0x49a015[_0xdae4('0xb5')](_0x52e45b[_0xdae4('0x58')][_0xdae4('0x71')],_[_0xdae4('0xb6')](_0x52e45b[_0xdae4('0x58')],[_0xdae4('0x71'),'id'])||{})[_0xdae4('0x94')](function(_0x57c96f){for(var _0x962231=0x0;_0x962231<_0x52e45b[_0xdae4('0x58')][_0xdae4('0x71')][_0xdae4('0x47')];_0x962231+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':_0x52e45b[_0xdae4('0x58')][_0xdae4('0x71')][_0x962231],'OpenchannelAccountId':_0x52e45b[_0xdae4('0x63')]['id']});}return _0x57c96f;});}})[_0xdae4('0x23')](respondWithResult(_0x563aa0,null))[_0xdae4('0x2d')](handleError(_0x563aa0,null));};exports[_0xdae4('0xb7')]=function(_0x1588a0,_0xdd9123,_0x3b3cad){return db[_0xdae4('0x3e')][_0xdae4('0x62')]({'where':{'id':_0x1588a0[_0xdae4('0x63')]['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0xdd9123,null))[_0xdae4('0x23')](function(_0x323ff4){if(_0x323ff4){return _0x323ff4[_0xdae4('0xb7')](_0x1588a0[_0xdae4('0x42')][_0xdae4('0x71')])[_0xdae4('0x23')](function(){if(_['isArray'](_0x1588a0[_0xdae4('0x42')][_0xdae4('0x71')])){for(var _0x13e86f=0x0;_0x13e86f<_0x1588a0[_0xdae4('0x42')][_0xdae4('0x71')][_0xdae4('0x47')];_0x13e86f+=0x1){socket[_0xdae4('0xb8')](_0xdae4('0xb9'),{'UserId':Number(_0x1588a0[_0xdae4('0x42')]['ids'][_0x13e86f]),'OpenchannelAccountId':Number(_0x1588a0[_0xdae4('0x63')]['id'])});}}else{socket['emit'](_0xdae4('0xb9'),{'UserId':Number(_0x1588a0[_0xdae4('0x42')][_0xdae4('0x71')]),'OpenchannelAccountId':Number(_0x1588a0['params']['id'])});}});}})[_0xdae4('0x23')](respondWithStatusCode(_0xdd9123,null))[_0xdae4('0x2d')](handleError(_0xdd9123,null));};exports[_0xdae4('0xba')]=function(_0x391a9c,_0x509dcd,_0x2c6c26){var _0x233219={};var _0xc65924={};var _0x1f6f6f;var _0x1d5578;return db['OpenchannelAccount'][_0xdae4('0x67')]({'where':{'id':_0x391a9c['params']['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x509dcd,null))[_0xdae4('0x23')](function(_0x9f5942){if(_0x9f5942){_0x1f6f6f=_0x9f5942;_0xc65924[_0xdae4('0x41')]=_['keys'](db['User'][_0xdae4('0x3f')]);_0xc65924['query']=_[_0xdae4('0x55')](_0x391a9c[_0xdae4('0x42')]);_0xc65924[_0xdae4('0x43')]=_['intersection'](_0xc65924[_0xdae4('0x41')],_0xc65924[_0xdae4('0x42')]);_0x233219[_0xdae4('0x46')]=_[_0xdae4('0x44')](_0xc65924[_0xdae4('0x41')],qs['fields'](_0x391a9c['query']['fields']));_0x233219[_0xdae4('0x46')]=_0x233219[_0xdae4('0x46')][_0xdae4('0x47')]?_0x233219['attributes']:_0xc65924[_0xdae4('0x41')];_0x233219[_0xdae4('0x4a')]=qs[_0xdae4('0x4b')](_0x391a9c[_0xdae4('0x42')][_0xdae4('0x4b')]);_0x233219[_0xdae4('0x4c')]=qs[_0xdae4('0x43')](_[_0xdae4('0x4d')](_0x391a9c[_0xdae4('0x42')],_0xc65924[_0xdae4('0x43')]));if(_0x391a9c[_0xdae4('0x42')]['filter']){_0x233219['where']=_[_0xdae4('0x4e')](_0x233219[_0xdae4('0x4c')],{'$or':_[_0xdae4('0x3d')](_0x233219[_0xdae4('0x46')],function(_0x4f5041){var _0x4fd70a={};_0x4fd70a[_0x4f5041]={'$like':'%'+_0x391a9c['query']['filter']+'%'};return _0x4fd70a;})});}_0x233219=_['merge']({},_0x233219,_0x391a9c[_0xdae4('0x52')]);return _0x1f6f6f[_0xdae4('0xba')](_0x233219);}})['then'](function(_0x5dfb31){if(_0x5dfb31){_0x1d5578=_0x5dfb31['length'];if(!_0x391a9c['query'][_0xdae4('0x48')](_0xdae4('0x49'))){_0x233219[_0xdae4('0x33')]=qs[_0xdae4('0x33')](_0x391a9c['query'][_0xdae4('0x33')]);_0x233219[_0xdae4('0x32')]=qs[_0xdae4('0x32')](_0x391a9c[_0xdae4('0x42')]['offset']);}return _0x1f6f6f[_0xdae4('0xba')](_0x233219);}})['then'](function(_0x47991c){if(_0x47991c){return _0x47991c?{'count':_0x1d5578,'rows':_0x47991c}:null;}})[_0xdae4('0x23')](respondWithResult(_0x509dcd,null))['catch'](handleError(_0x509dcd,null));};exports[_0xdae4('0xbb')]=function(_0x1aadc0,_0x3ff34e,_0x5ded2a){var _0x1589b9,_0x32584a,_0x352882;if(_[_0xdae4('0x7c')](_0x1aadc0['body'][_0xdae4('0x58')])||_0x1aadc0[_0xdae4('0x58')][_0xdae4('0x58')]===''){throw new db[(_0xdae4('0x75'))][(_0xdae4('0x20'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xdae4('0x7c')](_0x1aadc0[_0xdae4('0x58')]['to'])){}_0x1589b9=_0x1aadc0[_0xdae4('0x58')]['to'];return db[_0xdae4('0x3e')][_0xdae4('0x67')]({'where':{'id':_0x1aadc0[_0xdae4('0x63')]['id']}})[_0xdae4('0x23')](handleEntityNotFound(_0x3ff34e,null))['then'](function(_0x243b63){if(_0x243b63){return db[_0xdae4('0x3e')][_0xdae4('0x62')]({'where':{'id':_0x243b63['id']},'include':[{'model':db[_0xdae4('0xbc')],'as':_0xdae4('0x84'),'include':[{'model':db[_0xdae4('0x85')],'as':_0xdae4('0x86'),'where':{[_0x243b63[_0xdae4('0x7f')]]:_0x1589b9},'limit':0x1,'order':[['updatedAt',_0xdae4('0xbd')]]}]}]})[_0xdae4('0x23')](handleEntityNotFound(_0x3ff34e,null))[_0xdae4('0x23')](function(_0x584c11){if(_0x584c11&&_0x584c11[_0xdae4('0x84')]){_0x32584a=_0x584c11['get']({'plain':!![]});if(_0x32584a[_0xdae4('0x84')]&&_0x32584a[_0xdae4('0x84')]['Contacts']['length']){return _0x32584a['List']['Contacts'][0x0];}return db[_0xdae4('0x85')]['create'](_[_0xdae4('0x18')](_0x1aadc0[_0xdae4('0x58')],{'firstName':_0x1589b9,[_0x584c11[_0xdae4('0x7f')]]:_0x1589b9,'phone':_0x1589b9,'ListId':_0x32584a[_0xdae4('0x7b')]}));}})[_0xdae4('0x23')](handleEntityNotFound(_0x3ff34e,null))[_0xdae4('0x23')](function(_0x1fc936){if(_0x1fc936){_0x352882=_0x1fc936;return db[_0xdae4('0x92')]['find']({'where':{'ContactId':_0x352882['id'],'closed':![],'OpenchannelAccountId':_0x32584a['id']}})['then'](function(_0x3a248d){if(_0x3a248d){return[_0x3a248d,![]];}return db[_0xdae4('0x92')][_0xdae4('0x57')]({'UserId':_0x1aadc0['user']['id'],'ContactId':_0x352882['id'],'OpenchannelAccountId':_0x32584a['id'],'lastMsgDirection':'out','Messages':[_[_0xdae4('0x4e')](_0x1aadc0[_0xdae4('0x58')],{'read':![],'body':_0x1aadc0[_0xdae4('0x58')][_0xdae4('0x58')],'OpenchannelAccountId':_0x32584a['id'],'UserId':_0x1aadc0[_0xdae4('0x5b')]['id'],'ContactId':_0x352882['id']})]},{'include':[{'model':db[_0xdae4('0x9d')],'as':_0xdae4('0xbe')}]})[_0xdae4('0x23')](function(_0xbfe088){return[_0xbfe088,!![]];});});}})['spread'](function(_0x4d4ec7,_0xf0095d){if(_0xf0095d){return _0x4d4ec7;}return db[_0xdae4('0x9d')][_0xdae4('0x57')](_[_0xdae4('0x4e')](_0x1aadc0[_0xdae4('0x58')],{'read':![],'body':_0x1aadc0['body'][_0xdae4('0x58')],'OpenchannelAccountId':_0x32584a['id'],'OpenchannelInteractionId':_0x4d4ec7['id'],'UserId':_0x1aadc0['user']['id'],'ContactId':_0x352882['id']}))['then'](function(_0x385e3f){_0x4d4ec7['dataValues'][_0xdae4('0xbe')]=[];_0x4d4ec7[_0xdae4('0xbf')][_0xdae4('0xbe')][_0xdae4('0x9a')](_0x385e3f['dataValues']);return _0x4d4ec7;});});}})[_0xdae4('0x23')](respondWithResult(_0x3ff34e,null))[_0xdae4('0x2d')](handleError(_0x3ff34e,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index cf9e24c..6b96e42 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 _0x2fd6=['hook','exports','events','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x2fd6,0x13d));var _0x62fd=function(_0x24f2c5,_0x63725c){_0x24f2c5=_0x24f2c5-0x0;var _0x4168eb=_0x2fd6[_0x24f2c5];return _0x4168eb;};'use strict';var EventEmitter=require(_0x62fd('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x62fd('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x62fd('0x2')](0x0);var events={'afterCreate':_0x62fd('0x3'),'afterUpdate':'update','afterDestroy':_0x62fd('0x4')};function emitEvent(_0x31f9dc){return function(_0x580512,_0x1300e6,_0x3d05fa){OpenchannelAccountEvents['emit'](_0x31f9dc+':'+_0x580512['id'],_0x580512);OpenchannelAccountEvents[_0x62fd('0x5')](_0x31f9dc,_0x580512);_0x3d05fa(null);};}for(var e in events){if(events[_0x62fd('0x6')](e)){var event=events[e];OpenchannelAccount[_0x62fd('0x7')](e,emitEvent(event));}}module[_0x62fd('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x91c6=['OpenchannelAccount','setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x1ec2d8,_0x202e41){var _0x1c9235=function(_0x3416bc){while(--_0x3416bc){_0x1ec2d8['push'](_0x1ec2d8['shift']());}};_0x1c9235(++_0x202e41);}(_0x91c6,0x193));var _0x691c=function(_0x4591a9,_0x5187d7){_0x4591a9=_0x4591a9-0x0;var _0x2a8f5b=_0x91c6[_0x4591a9];return _0x2a8f5b;};'use strict';var EventEmitter=require(_0x691c('0x0'));var OpenchannelAccount=require(_0x691c('0x1'))['db'][_0x691c('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x691c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x691c('0x4'),'afterDestroy':_0x691c('0x5')};function emitEvent(_0x5a76eb){return function(_0x26b080,_0xc714cf,_0x507883){OpenchannelAccountEvents[_0x691c('0x6')](_0x5a76eb+':'+_0x26b080['id'],_0x26b080);OpenchannelAccountEvents[_0x691c('0x6')](_0x5a76eb,_0x26b080);_0x507883(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0x691c('0x7')](e,emitEvent(event));}}module[_0x691c('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 109d75d..5c34eb2 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 _0x602f=['./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1539be,_0x53c016){var _0x5b1c62=function(_0x521d2a){while(--_0x521d2a){_0x1539be['push'](_0x1539be['shift']());}};_0x5b1c62(++_0x53c016);}(_0x602f,0x1f3));var _0xf602=function(_0x3b0294,_0x58dfaa){_0x3b0294=_0x3b0294-0x0;var _0x5d4878=_0x602f[_0x3b0294];return _0x5d4878;};'use strict';var _=require(_0xf602('0x0'));var util=require(_0xf602('0x1'));var logger=require(_0xf602('0x2'))('api');var moment=require(_0xf602('0x3'));var BPromise=require(_0xf602('0x4'));var rp=require(_0xf602('0x5'));var fs=require('fs');var path=require(_0xf602('0x6'));var rimraf=require('rimraf');var config=require(_0xf602('0x7'));var attributes=require(_0xf602('0x8'));module[_0xf602('0x9')]=function(_0x58be29,_0x289a81){return _0x58be29[_0xf602('0xa')](_0xf602('0xb'),attributes,{'tableName':_0xf602('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb95a=['path','rimraf','../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3bbbee,_0x2a01d4){var _0x418d01=function(_0x49968a){while(--_0x49968a){_0x3bbbee['push'](_0x3bbbee['shift']());}};_0x418d01(++_0x2a01d4);}(_0xb95a,0x13b));var _0xab95=function(_0x2d2a83,_0x54b8cf){_0x2d2a83=_0x2d2a83-0x0;var _0x58a2a9=_0xb95a[_0x2d2a83];return _0x58a2a9;};'use strict';var _=require(_0xab95('0x0'));var util=require(_0xab95('0x1'));var logger=require(_0xab95('0x2'))(_0xab95('0x3'));var moment=require(_0xab95('0x4'));var BPromise=require(_0xab95('0x5'));var rp=require(_0xab95('0x6'));var fs=require('fs');var path=require(_0xab95('0x7'));var rimraf=require(_0xab95('0x8'));var config=require(_0xab95('0x9'));var attributes=require(_0xab95('0xa'));module[_0xab95('0xb')]=function(_0x4ef149,_0xa2ba87){return _0x4ef149[_0xab95('0xc')](_0xab95('0xd'),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 68bd0a5..bcf04e5 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 _0x2829=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4bc22a,_0x294fb5){var _0x1dfa1e=function(_0x2396b2){while(--_0x2396b2){_0x4bc22a['push'](_0x4bc22a['shift']());}};_0x1dfa1e(++_0x294fb5);}(_0x2829,0x16f));var _0x9282=function(_0x33da30,_0x58ae68){_0x33da30=_0x33da30-0x0;var _0x5f19a5=_0x2829[_0x33da30];return _0x5f19a5;};'use strict';var _=require(_0x9282('0x0'));var util=require('util');var moment=require(_0x9282('0x1'));var BPromise=require(_0x9282('0x2'));var rs=require(_0x9282('0x3'));var fs=require('fs');var Redis=require(_0x9282('0x4'));var db=require(_0x9282('0x5'))['db'];var utils=require(_0x9282('0x6'));var logger=require(_0x9282('0x7'))(_0x9282('0x8'));var config=require('../../config/environment');var jayson=require(_0x9282('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9282('0xa')](config[_0x9282('0xb')],{'host':_0x9282('0xc'),'port':0x18eb});var socket=require(_0x9282('0xd'))(new Redis(config[_0x9282('0xb')]));require(_0x9282('0xe'))[_0x9282('0xf')](socket);function respondWithRpcPromise(_0x52f67d,_0x199981,_0x5568e9){return new BPromise(function(_0x539e2c,_0x4230f9){return client[_0x9282('0x10')](_0x52f67d,_0x5568e9)[_0x9282('0x11')](function(_0x412d0b){logger[_0x9282('0x12')](_0x9282('0x13'),_0x199981,_0x9282('0x14'));logger[_0x9282('0x15')](_0x9282('0x16'),_0x199981,_0x9282('0x14'),JSON[_0x9282('0x17')](_0x412d0b));if(_0x412d0b[_0x9282('0x18')]){if(_0x412d0b['error']['code']===0x1f4){logger[_0x9282('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x199981,_0x412d0b[_0x9282('0x18')]['message']);return _0x4230f9(_0x412d0b['error'][_0x9282('0x19')]);}logger[_0x9282('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x199981,_0x412d0b[_0x9282('0x18')][_0x9282('0x19')]);return _0x539e2c(_0x412d0b[_0x9282('0x18')][_0x9282('0x19')]);}else{logger[_0x9282('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x199981,_0x9282('0x14'));_0x539e2c(_0x412d0b[_0x9282('0x1a')][_0x9282('0x19')]);}})[_0x9282('0x1b')](function(_0x40c014){logger[_0x9282('0x18')](_0x9282('0x13'),_0x199981,_0x40c014);_0x4230f9(_0x40c014);});});} \ No newline at end of file +var _0x71ec=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','defaults','redis','socket.io-emitter','./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x452614,_0x221bcb){var _0x210da2=function(_0x56c9a7){while(--_0x56c9a7){_0x452614['push'](_0x452614['shift']());}};_0x210da2(++_0x221bcb);}(_0x71ec,0xc6));var _0xc71e=function(_0x5b685e,_0x3e69ad){_0x5b685e=_0x5b685e-0x0;var _0x9a0173=_0x71ec[_0x5b685e];return _0x9a0173;};'use strict';var _=require('lodash');var util=require(_0xc71e('0x0'));var moment=require('moment');var BPromise=require(_0xc71e('0x1'));var rs=require(_0xc71e('0x2'));var fs=require('fs');var Redis=require(_0xc71e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc71e('0x4'));var logger=require(_0xc71e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc71e('0x6'));var client=jayson['client'][_0xc71e('0x7')]({'port':0x232a});config['redis']=_[_0xc71e('0x8')](config[_0xc71e('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xc71e('0xa'))(new Redis(config[_0xc71e('0x9')]));require(_0xc71e('0xb'))[_0xc71e('0xc')](socket);function respondWithRpcPromise(_0x5e9101,_0x392ac3,_0xf18205){return new BPromise(function(_0x19988e,_0x888808){return client['request'](_0x5e9101,_0xf18205)[_0xc71e('0xd')](function(_0x5438ca){logger[_0xc71e('0xe')](_0xc71e('0xf'),_0x392ac3,_0xc71e('0x10'));logger[_0xc71e('0x11')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x392ac3,_0xc71e('0x10'),JSON[_0xc71e('0x12')](_0x5438ca));if(_0x5438ca['error']){if(_0x5438ca[_0xc71e('0x13')]['code']===0x1f4){logger[_0xc71e('0x13')](_0xc71e('0xf'),_0x392ac3,_0x5438ca[_0xc71e('0x13')][_0xc71e('0x14')]);return _0x888808(_0x5438ca[_0xc71e('0x13')][_0xc71e('0x14')]);}logger[_0xc71e('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x392ac3,_0x5438ca['error'][_0xc71e('0x14')]);return _0x19988e(_0x5438ca['error']['message']);}else{logger[_0xc71e('0xe')]('OpenchannelAccount,\x20%s,\x20%s',_0x392ac3,_0xc71e('0x10'));_0x19988e(_0x5438ca['result'][_0xc71e('0x14')]);}})[_0xc71e('0x15')](function(_0x3cf762){logger['error'](_0xc71e('0xf'),_0x392ac3,_0x3cf762);_0x888808(_0x3cf762);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index d39e208..d663816 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 _0x47aa=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x47aa,0xb4));var _0xa47a=function(_0x5b364a,_0x12d484){_0x5b364a=_0x5b364a-0x0;var _0x11b073=_0x47aa[_0x5b364a];return _0x11b073;};'use strict';var OpenchannelAccountEvents=require(_0xa47a('0x0'));var events=[_0xa47a('0x1'),_0xa47a('0x2'),_0xa47a('0x3')];function createListener(_0x4a0b51,_0x17a93d){return function(_0x271a84){_0x17a93d['emit'](_0x4a0b51,_0x271a84);};}function removeListener(_0x17c0c9,_0xb32f90){return function(){OpenchannelAccountEvents[_0xa47a('0x4')](_0x17c0c9,_0xb32f90);};}exports[_0xa47a('0x5')]=function(_0x47b169){for(var _0x25afaa=0x0,_0xb8b308=events[_0xa47a('0x6')];_0x25afaa<_0xb8b308;_0x25afaa++){var _0x4618d2=events[_0x25afaa];var _0x3fb6ef=createListener(_0xa47a('0x7')+_0x4618d2,_0x47b169);OpenchannelAccountEvents['on'](_0x4618d2,_0x3fb6ef);}}; \ No newline at end of file +var _0xb075=['update','register','length','openchannelAccount:','./openchannelAccount.events','save','remove'];(function(_0x4ee9cd,_0xd375b0){var _0x328a5b=function(_0x3ad1f4){while(--_0x3ad1f4){_0x4ee9cd['push'](_0x4ee9cd['shift']());}};_0x328a5b(++_0xd375b0);}(_0xb075,0x1ee));var _0x5b07=function(_0x3a228c,_0xe0398f){_0x3a228c=_0x3a228c-0x0;var _0x440983=_0xb075[_0x3a228c];return _0x440983;};'use strict';var OpenchannelAccountEvents=require(_0x5b07('0x0'));var events=[_0x5b07('0x1'),_0x5b07('0x2'),_0x5b07('0x3')];function createListener(_0x1d1d80,_0x461cc9){return function(_0x39fed1){_0x461cc9['emit'](_0x1d1d80,_0x39fed1);};}function removeListener(_0x38d5de,_0x3bf915){return function(){OpenchannelAccountEvents['removeListener'](_0x38d5de,_0x3bf915);};}exports[_0x5b07('0x4')]=function(_0x40983a){for(var _0x3504a8=0x0,_0x6c705f=events[_0x5b07('0x5')];_0x3504a8<_0x6c705f;_0x3504a8++){var _0x3575a0=events[_0x3504a8];var _0x533cb9=createListener(_0x5b07('0x6')+_0x3575a0,_0x40983a);OpenchannelAccountEvents['on'](_0x3575a0,_0x533cb9);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index dc50249..5bb251e 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 _0xc9c7=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0xafc6b9,_0x182d12){var _0x232247=function(_0x20542f){while(--_0x20542f){_0xafc6b9['push'](_0xafc6b9['shift']());}};_0x232247(++_0x182d12);}(_0xc9c7,0xaa));var _0x7c9c=function(_0x5aaa51,_0x31d769){_0x5aaa51=_0x5aaa51-0x0;var _0x1cc02f=_0xc9c7[_0x5aaa51];return _0x1cc02f;};'use strict';var multer=require(_0x7c9c('0x0'));var util=require(_0x7c9c('0x1'));var path=require(_0x7c9c('0x2'));var timeout=require(_0x7c9c('0x3'));var express=require(_0x7c9c('0x4'));var router=express[_0x7c9c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7c9c('0x6'));var config=require(_0x7c9c('0x7'));var controller=require(_0x7c9c('0x8'));router[_0x7c9c('0x9')]('/',auth[_0x7c9c('0xa')](),controller[_0x7c9c('0xb')]);router[_0x7c9c('0x9')](_0x7c9c('0xc'),auth[_0x7c9c('0xa')](),controller[_0x7c9c('0xd')]);router[_0x7c9c('0xe')]('/',auth[_0x7c9c('0xa')](),controller[_0x7c9c('0xf')]);router[_0x7c9c('0x10')]('/:id',auth[_0x7c9c('0xa')](),controller[_0x7c9c('0x11')]);router[_0x7c9c('0x12')](_0x7c9c('0xc'),auth[_0x7c9c('0xa')](),controller[_0x7c9c('0x13')]);module['exports']=router; \ No newline at end of file +var _0x02b4=['show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x151a0d,_0x3a83fa){var _0x192001=function(_0x2ae446){while(--_0x2ae446){_0x151a0d['push'](_0x151a0d['shift']());}};_0x192001(++_0x3a83fa);}(_0x02b4,0xcf));var _0x402b=function(_0x266a87,_0x49cc90){_0x266a87=_0x266a87-0x0;var _0x374f12=_0x02b4[_0x266a87];return _0x374f12;};'use strict';var multer=require(_0x402b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x402b('0x1'));var express=require('express');var router=express[_0x402b('0x2')]();var auth=require(_0x402b('0x3'));var interaction=require(_0x402b('0x4'));var config=require(_0x402b('0x5'));var controller=require('./openchannelApplication.controller');router[_0x402b('0x6')]('/',auth[_0x402b('0x7')](),controller[_0x402b('0x8')]);router['get']('/:id',auth[_0x402b('0x7')](),controller[_0x402b('0x9')]);router[_0x402b('0xa')]('/',auth[_0x402b('0x7')](),controller[_0x402b('0xb')]);router[_0x402b('0xc')](_0x402b('0xd'),auth[_0x402b('0x7')](),controller[_0x402b('0xe')]);router[_0x402b('0xf')](_0x402b('0xd'),auth[_0x402b('0x7')](),controller[_0x402b('0x10')]);module[_0x402b('0x11')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 5991416..573f3c7 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 _0x237f=['sequelize','INTEGER','STRING','*,*,*,*'];(function(_0x467b2c,_0x3dd3b1){var _0x32c38e=function(_0x455ac8){while(--_0x455ac8){_0x467b2c['push'](_0x467b2c['shift']());}};_0x32c38e(++_0x3dd3b1);}(_0x237f,0x178));var _0xf237=function(_0x1760e9,_0xbbfd0b){_0x1760e9=_0x1760e9-0x0;var _0x3fe586=_0x237f[_0x1760e9];return _0x3fe586;};'use strict';var Sequelize=require(_0xf237('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf237('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf237('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf237('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf237('0x3')}}; \ No newline at end of file +var _0x9d53=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x303cb0,_0x287085){var _0x1ca18d=function(_0x49875c){while(--_0x49875c){_0x303cb0['push'](_0x303cb0['shift']());}};_0x1ca18d(++_0x287085);}(_0x9d53,0xa8));var _0x39d5=function(_0x4ccabb,_0x32f82f){_0x4ccabb=_0x4ccabb-0x0;var _0x414db2=_0x9d53[_0x4ccabb];return _0x414db2;};'use strict';var Sequelize=require(_0x39d5('0x0'));module[_0x39d5('0x1')]={'priority':{'type':Sequelize[_0x39d5('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x39d5('0x3')]},'interval':{'type':Sequelize[_0x39d5('0x3')],'defaultValue':_0x39d5('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 16d34ae..db8c094 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 _0x4576=['ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','findAll','rows','show','includeAll','find','catch','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv'];(function(_0x2d7906,_0x135c71){var _0x20d9be=function(_0x27ccfe){while(--_0x27ccfe){_0x2d7906['push'](_0x2d7906['shift']());}};_0x20d9be(++_0x135c71);}(_0x4576,0x15e));var _0x6457=function(_0x214cc6,_0x320b97){_0x214cc6=_0x214cc6-0x0;var _0x1a389d=_0x4576[_0x214cc6];return _0x1a389d;};'use strict';var pdf=require(_0x6457('0x0'));var emlformat=require(_0x6457('0x1'));var rimraf=require(_0x6457('0x2'));var zipdir=require(_0x6457('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6457('0x4'));var moment=require(_0x6457('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6457('0x6'));var path=require(_0x6457('0x7'));var sox=require(_0x6457('0x8'));var csv=require(_0x6457('0x9'));var ejs=require(_0x6457('0xa'));var fs=require('fs');var _=require(_0x6457('0xb'));var squel=require(_0x6457('0xc'));var crypto=require('crypto');var jsforce=require(_0x6457('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6457('0x9'));var querystring=require(_0x6457('0xe'));var Papa=require(_0x6457('0xf'));var Redis=require(_0x6457('0x10'));var authService=require(_0x6457('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6457('0x12'));var logger=require(_0x6457('0x13'))(_0x6457('0x14'));var utils=require('../../config/utils');var config=require(_0x6457('0x15'));var db=require(_0x6457('0x16'))['db'];function respondWithStatusCode(_0x432691,_0x14cd9e){_0x14cd9e=_0x14cd9e||0xcc;return function(_0x496433){if(_0x496433){return _0x432691[_0x6457('0x17')](_0x14cd9e);}return _0x432691['status'](_0x14cd9e)['end']();};}function respondWithResult(_0x254ab9,_0x1ef651){_0x1ef651=_0x1ef651||0xc8;return function(_0x47033f){if(_0x47033f){return _0x254ab9[_0x6457('0x18')](_0x1ef651)['json'](_0x47033f);}};}function respondWithFilteredResult(_0x1917a8,_0x14a278){return function(_0xb990b9){if(_0xb990b9){var _0x2e9d7f=_0xb990b9[_0x6457('0x19')],_0x47909d=_0x14a278[_0x6457('0x1a')],_0x52cdb8=_0x14a278['offset']+_0x14a278[_0x6457('0x1b')],_0x25eec8;if(_0x52cdb8>=_0x2e9d7f){_0x52cdb8=_0x2e9d7f;_0x25eec8=0xc8;}else{_0x25eec8=0xce;}_0x1917a8[_0x6457('0x18')](_0x25eec8);return _0x1917a8[_0x6457('0x1c')]('Content-Range',_0x47909d+'-'+_0x52cdb8+'/'+_0x2e9d7f)[_0x6457('0x1d')](_0xb990b9);}return null;};}function patchUpdates(_0x5561fc){return function(_0x33582e){try{jsonpatch[_0x6457('0x1e')](_0x33582e,_0x5561fc,!![]);}catch(_0x40d97d){return BPromise[_0x6457('0x1f')](_0x40d97d);}return _0x33582e['save']();};}function saveUpdates(_0x1a299d,_0x406f12){return function(_0x15185f){if(_0x15185f){return _0x15185f[_0x6457('0x20')](_0x1a299d)[_0x6457('0x21')](function(_0x296af7){return _0x296af7;});}return null;};}function removeEntity(_0x2fdc0c,_0x41603e){return function(_0x304ae1){if(_0x304ae1){return _0x304ae1[_0x6457('0x22')]()['then'](function(){_0x2fdc0c[_0x6457('0x18')](0xcc)[_0x6457('0x23')]();});}};}function handleEntityNotFound(_0x6f5678,_0x264695){return function(_0x47e935){if(!_0x47e935){_0x6f5678['sendStatus'](0x194);}return _0x47e935;};}function handleError(_0x3cd42d,_0x2bf8dd){_0x2bf8dd=_0x2bf8dd||0x1f4;return function(_0x530841){logger[_0x6457('0x24')](_0x530841[_0x6457('0x25')]);if(_0x530841[_0x6457('0x26')]){delete _0x530841[_0x6457('0x26')];}_0x3cd42d[_0x6457('0x18')](_0x2bf8dd)[_0x6457('0x27')](_0x530841);};}exports[_0x6457('0x28')]=function(_0x15b718,_0x2db0a9){var _0x20a68a={},_0x25f2c8={},_0x13b435={'count':0x0,'rows':[]};var _0x42bb78=_[_0x6457('0x29')](db[_0x6457('0x2a')][_0x6457('0x2b')],function(_0x51ed5c){return{'name':_0x51ed5c[_0x6457('0x2c')],'type':_0x51ed5c['type'][_0x6457('0x2d')]};});_0x25f2c8['model']=_[_0x6457('0x29')](_0x42bb78,'name');_0x25f2c8[_0x6457('0x2e')]=_[_0x6457('0x2f')](_0x15b718[_0x6457('0x2e')]);_0x25f2c8[_0x6457('0x30')]=_[_0x6457('0x31')](_0x25f2c8[_0x6457('0x32')],_0x25f2c8['query']);_0x20a68a[_0x6457('0x33')]=_[_0x6457('0x31')](_0x25f2c8[_0x6457('0x32')],qs['fields'](_0x15b718[_0x6457('0x2e')][_0x6457('0x34')]));_0x20a68a['attributes']=_0x20a68a[_0x6457('0x33')][_0x6457('0x35')]?_0x20a68a[_0x6457('0x33')]:_0x25f2c8[_0x6457('0x32')];if(!_0x15b718[_0x6457('0x2e')][_0x6457('0x36')](_0x6457('0x37'))){_0x20a68a[_0x6457('0x1b')]=qs['limit'](_0x15b718[_0x6457('0x2e')]['limit']);_0x20a68a[_0x6457('0x1a')]=qs[_0x6457('0x1a')](_0x15b718['query'][_0x6457('0x1a')]);}_0x20a68a[_0x6457('0x38')]=qs[_0x6457('0x39')](_0x15b718['query'][_0x6457('0x39')]);_0x20a68a[_0x6457('0x3a')]=qs[_0x6457('0x30')](_['pick'](_0x15b718[_0x6457('0x2e')],_0x25f2c8[_0x6457('0x30')]));if(_0x15b718[_0x6457('0x2e')][_0x6457('0x3b')]){_0x20a68a['where']=_[_0x6457('0x3c')](_0x20a68a[_0x6457('0x3a')],{'$or':_['map'](_0x42bb78,function(_0x368895){if(_0x368895[_0x6457('0x3d')]!=='VIRTUAL'){var _0x68f9df={};_0x68f9df[_0x368895[_0x6457('0x26')]]={'$like':'%'+_0x15b718[_0x6457('0x2e')][_0x6457('0x3b')]+'%'};return _0x68f9df;}})});}_0x20a68a=_['merge']({},_0x20a68a,_0x15b718[_0x6457('0x3e')]);var _0x4b5c2b={'where':_0x20a68a[_0x6457('0x3a')]};return db[_0x6457('0x2a')]['count'](_0x4b5c2b)[_0x6457('0x21')](function(_0xaaa55b){_0x13b435[_0x6457('0x19')]=_0xaaa55b;if(_0x15b718[_0x6457('0x2e')]['includeAll']){_0x20a68a[_0x6457('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x6457('0x40')](_0x20a68a);})[_0x6457('0x21')](function(_0x49ed7f){_0x13b435[_0x6457('0x41')]=_0x49ed7f;return _0x13b435;})[_0x6457('0x21')](respondWithFilteredResult(_0x2db0a9,_0x20a68a))['catch'](handleError(_0x2db0a9,null));};exports[_0x6457('0x42')]=function(_0x27b0dc,_0x19e5da){var _0x4e8cc6={'raw':!![],'where':{'id':_0x27b0dc['params']['id']}},_0x51dfef={};_0x51dfef[_0x6457('0x32')]=_[_0x6457('0x2f')](db[_0x6457('0x2a')][_0x6457('0x2b')]);_0x51dfef['query']=_['keys'](_0x27b0dc[_0x6457('0x2e')]);_0x51dfef['filters']=_[_0x6457('0x31')](_0x51dfef['model'],_0x51dfef[_0x6457('0x2e')]);_0x4e8cc6[_0x6457('0x33')]=_[_0x6457('0x31')](_0x51dfef[_0x6457('0x32')],qs['fields'](_0x27b0dc[_0x6457('0x2e')][_0x6457('0x34')]));_0x4e8cc6[_0x6457('0x33')]=_0x4e8cc6[_0x6457('0x33')][_0x6457('0x35')]?_0x4e8cc6[_0x6457('0x33')]:_0x51dfef['model'];if(_0x27b0dc[_0x6457('0x2e')][_0x6457('0x43')]){_0x4e8cc6[_0x6457('0x3f')]=[{'all':!![]}];}_0x4e8cc6=_[_0x6457('0x3c')]({},_0x4e8cc6,_0x27b0dc['options']);return db[_0x6457('0x2a')][_0x6457('0x44')](_0x4e8cc6)[_0x6457('0x21')](handleEntityNotFound(_0x19e5da,null))[_0x6457('0x21')](respondWithResult(_0x19e5da,null))[_0x6457('0x45')](handleError(_0x19e5da,null));};exports['create']=function(_0x5e9e05,_0x287467){return db[_0x6457('0x2a')]['create'](_0x5e9e05[_0x6457('0x46')],{})['then'](respondWithResult(_0x287467,0xc9))[_0x6457('0x45')](handleError(_0x287467,null));};exports[_0x6457('0x20')]=function(_0x547cbf,_0x5150e9){if(_0x547cbf[_0x6457('0x46')]['id']){delete _0x547cbf[_0x6457('0x46')]['id'];}return db[_0x6457('0x2a')][_0x6457('0x44')]({'where':{'id':_0x547cbf['params']['id']}})[_0x6457('0x21')](handleEntityNotFound(_0x5150e9,null))['then'](saveUpdates(_0x547cbf[_0x6457('0x46')],null))[_0x6457('0x21')](respondWithResult(_0x5150e9,null))[_0x6457('0x45')](handleError(_0x5150e9,null));};exports[_0x6457('0x22')]=function(_0x180976,_0x541a57){return db[_0x6457('0x2a')][_0x6457('0x44')]({'where':{'id':_0x180976[_0x6457('0x47')]['id']}})[_0x6457('0x21')](handleEntityNotFound(_0x541a57,null))[_0x6457('0x21')](removeEntity(_0x541a57,null))[_0x6457('0x45')](handleError(_0x541a57,null));}; \ No newline at end of file +var _0xaa60=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x229934,_0x2e210c){var _0x1c49cb=function(_0x56cc0a){while(--_0x56cc0a){_0x229934['push'](_0x229934['shift']());}};_0x1c49cb(++_0x2e210c);}(_0xaa60,0x163));var _0x0aa6=function(_0x45d4f3,_0x2fa12b){_0x45d4f3=_0x45d4f3-0x0;var _0x4deec2=_0xaa60[_0x45d4f3];return _0x4deec2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0aa6('0x0'));var rimraf=require(_0x0aa6('0x1'));var zipdir=require(_0x0aa6('0x2'));var jsonpatch=require(_0x0aa6('0x3'));var rp=require(_0x0aa6('0x4'));var moment=require(_0x0aa6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0aa6('0x6'));var util=require(_0x0aa6('0x7'));var path=require(_0x0aa6('0x8'));var sox=require(_0x0aa6('0x9'));var csv=require('to-csv');var ejs=require(_0x0aa6('0xa'));var fs=require('fs');var _=require(_0x0aa6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0aa6('0xc'));var deskjs=require(_0x0aa6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0aa6('0xe'));var Papa=require(_0x0aa6('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0aa6('0x10'));var as=require(_0x0aa6('0x11'));var hardwareService=require(_0x0aa6('0x12'));var logger=require(_0x0aa6('0x13'))(_0x0aa6('0x14'));var utils=require(_0x0aa6('0x15'));var config=require(_0x0aa6('0x16'));var db=require(_0x0aa6('0x17'))['db'];function respondWithStatusCode(_0x7ca701,_0x4be634){_0x4be634=_0x4be634||0xcc;return function(_0x12da25){if(_0x12da25){return _0x7ca701[_0x0aa6('0x18')](_0x4be634);}return _0x7ca701[_0x0aa6('0x19')](_0x4be634)[_0x0aa6('0x1a')]();};}function respondWithResult(_0x257479,_0x15f413){_0x15f413=_0x15f413||0xc8;return function(_0x4cc47c){if(_0x4cc47c){return _0x257479['status'](_0x15f413)[_0x0aa6('0x1b')](_0x4cc47c);}};}function respondWithFilteredResult(_0x12675b,_0x1a7277){return function(_0x29479b){if(_0x29479b){var _0xb7d134=_0x29479b[_0x0aa6('0x1c')],_0x53e480=_0x1a7277['offset'],_0x106ad0=_0x1a7277['offset']+_0x1a7277[_0x0aa6('0x1d')],_0x2d4fd0;if(_0x106ad0>=_0xb7d134){_0x106ad0=_0xb7d134;_0x2d4fd0=0xc8;}else{_0x2d4fd0=0xce;}_0x12675b[_0x0aa6('0x19')](_0x2d4fd0);return _0x12675b[_0x0aa6('0x1e')](_0x0aa6('0x1f'),_0x53e480+'-'+_0x106ad0+'/'+_0xb7d134)[_0x0aa6('0x1b')](_0x29479b);}return null;};}function patchUpdates(_0xc3e2d2){return function(_0x4d2fdc){try{jsonpatch[_0x0aa6('0x20')](_0x4d2fdc,_0xc3e2d2,!![]);}catch(_0x1e468d){return BPromise[_0x0aa6('0x21')](_0x1e468d);}return _0x4d2fdc[_0x0aa6('0x22')]();};}function saveUpdates(_0x1d7631,_0x4f45f1){return function(_0x198481){if(_0x198481){return _0x198481[_0x0aa6('0x23')](_0x1d7631)[_0x0aa6('0x24')](function(_0x3e1624){return _0x3e1624;});}return null;};}function removeEntity(_0x2cb1f9,_0x463032){return function(_0x2b445a){if(_0x2b445a){return _0x2b445a[_0x0aa6('0x25')]()['then'](function(){_0x2cb1f9['status'](0xcc)[_0x0aa6('0x1a')]();});}};}function handleEntityNotFound(_0x1d7cc8,_0x2e0ba8){return function(_0x1e6416){if(!_0x1e6416){_0x1d7cc8['sendStatus'](0x194);}return _0x1e6416;};}function handleError(_0x23c1d4,_0x330acb){_0x330acb=_0x330acb||0x1f4;return function(_0x4b4c49){logger[_0x0aa6('0x26')](_0x4b4c49[_0x0aa6('0x27')]);if(_0x4b4c49['name']){delete _0x4b4c49[_0x0aa6('0x28')];}_0x23c1d4[_0x0aa6('0x19')](_0x330acb)[_0x0aa6('0x29')](_0x4b4c49);};}exports[_0x0aa6('0x2a')]=function(_0x275a8f,_0x27e164){var _0x28d4ff={},_0x3497cc={},_0x55830b={'count':0x0,'rows':[]};var _0x2fedfd=_[_0x0aa6('0x2b')](db[_0x0aa6('0x2c')][_0x0aa6('0x2d')],function(_0x393684){return{'name':_0x393684[_0x0aa6('0x2e')],'type':_0x393684[_0x0aa6('0x2f')]['key']};});_0x3497cc[_0x0aa6('0x30')]=_[_0x0aa6('0x2b')](_0x2fedfd,'name');_0x3497cc[_0x0aa6('0x31')]=_['keys'](_0x275a8f[_0x0aa6('0x31')]);_0x3497cc[_0x0aa6('0x32')]=_[_0x0aa6('0x33')](_0x3497cc[_0x0aa6('0x30')],_0x3497cc['query']);_0x28d4ff[_0x0aa6('0x34')]=_['intersection'](_0x3497cc[_0x0aa6('0x30')],qs['fields'](_0x275a8f[_0x0aa6('0x31')][_0x0aa6('0x35')]));_0x28d4ff[_0x0aa6('0x34')]=_0x28d4ff[_0x0aa6('0x34')]['length']?_0x28d4ff['attributes']:_0x3497cc[_0x0aa6('0x30')];if(!_0x275a8f['query'][_0x0aa6('0x36')](_0x0aa6('0x37'))){_0x28d4ff[_0x0aa6('0x1d')]=qs[_0x0aa6('0x1d')](_0x275a8f[_0x0aa6('0x31')][_0x0aa6('0x1d')]);_0x28d4ff[_0x0aa6('0x38')]=qs['offset'](_0x275a8f[_0x0aa6('0x31')][_0x0aa6('0x38')]);}_0x28d4ff[_0x0aa6('0x39')]=qs[_0x0aa6('0x3a')](_0x275a8f['query'][_0x0aa6('0x3a')]);_0x28d4ff[_0x0aa6('0x3b')]=qs[_0x0aa6('0x32')](_[_0x0aa6('0x3c')](_0x275a8f[_0x0aa6('0x31')],_0x3497cc[_0x0aa6('0x32')]));if(_0x275a8f[_0x0aa6('0x31')][_0x0aa6('0x3d')]){_0x28d4ff[_0x0aa6('0x3b')]=_[_0x0aa6('0x3e')](_0x28d4ff[_0x0aa6('0x3b')],{'$or':_[_0x0aa6('0x2b')](_0x2fedfd,function(_0x11054d){if(_0x11054d[_0x0aa6('0x2f')]!=='VIRTUAL'){var _0x4132ca={};_0x4132ca[_0x11054d['name']]={'$like':'%'+_0x275a8f[_0x0aa6('0x31')]['filter']+'%'};return _0x4132ca;}})});}_0x28d4ff=_[_0x0aa6('0x3e')]({},_0x28d4ff,_0x275a8f[_0x0aa6('0x3f')]);var _0x51771d={'where':_0x28d4ff[_0x0aa6('0x3b')]};return db[_0x0aa6('0x2c')][_0x0aa6('0x1c')](_0x51771d)['then'](function(_0x29009b){_0x55830b[_0x0aa6('0x1c')]=_0x29009b;if(_0x275a8f['query'][_0x0aa6('0x40')]){_0x28d4ff[_0x0aa6('0x41')]=[{'all':!![]}];}return db[_0x0aa6('0x2c')][_0x0aa6('0x42')](_0x28d4ff);})[_0x0aa6('0x24')](function(_0xc629da){_0x55830b[_0x0aa6('0x43')]=_0xc629da;return _0x55830b;})['then'](respondWithFilteredResult(_0x27e164,_0x28d4ff))[_0x0aa6('0x44')](handleError(_0x27e164,null));};exports[_0x0aa6('0x45')]=function(_0x19c62b,_0x50e9ec){var _0x4d9b40={'raw':!![],'where':{'id':_0x19c62b[_0x0aa6('0x46')]['id']}},_0xe59e72={};_0xe59e72[_0x0aa6('0x30')]=_[_0x0aa6('0x47')](db[_0x0aa6('0x2c')]['rawAttributes']);_0xe59e72[_0x0aa6('0x31')]=_[_0x0aa6('0x47')](_0x19c62b[_0x0aa6('0x31')]);_0xe59e72[_0x0aa6('0x32')]=_['intersection'](_0xe59e72[_0x0aa6('0x30')],_0xe59e72[_0x0aa6('0x31')]);_0x4d9b40['attributes']=_[_0x0aa6('0x33')](_0xe59e72[_0x0aa6('0x30')],qs[_0x0aa6('0x35')](_0x19c62b['query'][_0x0aa6('0x35')]));_0x4d9b40[_0x0aa6('0x34')]=_0x4d9b40['attributes'][_0x0aa6('0x48')]?_0x4d9b40[_0x0aa6('0x34')]:_0xe59e72['model'];if(_0x19c62b[_0x0aa6('0x31')][_0x0aa6('0x40')]){_0x4d9b40['include']=[{'all':!![]}];}_0x4d9b40=_[_0x0aa6('0x3e')]({},_0x4d9b40,_0x19c62b[_0x0aa6('0x3f')]);return db['OpenchannelApplication'][_0x0aa6('0x49')](_0x4d9b40)[_0x0aa6('0x24')](handleEntityNotFound(_0x50e9ec,null))[_0x0aa6('0x24')](respondWithResult(_0x50e9ec,null))[_0x0aa6('0x44')](handleError(_0x50e9ec,null));};exports[_0x0aa6('0x4a')]=function(_0x53ffec,_0x52d57f){return db[_0x0aa6('0x2c')]['create'](_0x53ffec['body'],{})['then'](respondWithResult(_0x52d57f,0xc9))['catch'](handleError(_0x52d57f,null));};exports[_0x0aa6('0x23')]=function(_0xf09cd6,_0x193402){if(_0xf09cd6['body']['id']){delete _0xf09cd6['body']['id'];}return db[_0x0aa6('0x2c')][_0x0aa6('0x49')]({'where':{'id':_0xf09cd6[_0x0aa6('0x46')]['id']}})[_0x0aa6('0x24')](handleEntityNotFound(_0x193402,null))['then'](saveUpdates(_0xf09cd6['body'],null))[_0x0aa6('0x24')](respondWithResult(_0x193402,null))['catch'](handleError(_0x193402,null));};exports[_0x0aa6('0x25')]=function(_0x290287,_0x3add96){return db[_0x0aa6('0x2c')][_0x0aa6('0x49')]({'where':{'id':_0x290287['params']['id']}})[_0x0aa6('0x24')](handleEntityNotFound(_0x3add96,null))[_0x0aa6('0x24')](removeEntity(_0x3add96,null))[_0x0aa6('0x44')](handleError(_0x3add96,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e3fa662..07336cc 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 _0xeb6d=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x1410a9,_0x2d4289){var _0x43339d=function(_0x37df0e){while(--_0x37df0e){_0x1410a9['push'](_0x1410a9['shift']());}};_0x43339d(++_0x2d4289);}(_0xeb6d,0xdf));var _0xdeb6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xeb6d[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xdeb6('0x0'));var util=require('util');var logger=require(_0xdeb6('0x1'))(_0xdeb6('0x2'));var moment=require('moment');var BPromise=require(_0xdeb6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdeb6('0x4'));var config=require('../../config/environment');var attributes=require(_0xdeb6('0x5'));module[_0xdeb6('0x6')]=function(_0x413463,_0x5eedb6){return _0x413463[_0xdeb6('0x7')](_0xdeb6('0x8'),attributes,{'tableName':_0xdeb6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb6('0xa'),'collate':_0xdeb6('0xb')});}; \ No newline at end of file +var _0xfeb7=['util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelApplication.attributes','exports','OpenchannelApplication','utf8mb4','lodash'];(function(_0x558379,_0x456d76){var _0x1fce0e=function(_0x8e9e4){while(--_0x8e9e4){_0x558379['push'](_0x558379['shift']());}};_0x1fce0e(++_0x456d76);}(_0xfeb7,0xa7));var _0x7feb=function(_0x17ca45,_0x2b2634){_0x17ca45=_0x17ca45-0x0;var _0x422973=_0xfeb7[_0x17ca45];return _0x422973;};'use strict';var _=require(_0x7feb('0x0'));var util=require(_0x7feb('0x1'));var logger=require(_0x7feb('0x2'))(_0x7feb('0x3'));var moment=require(_0x7feb('0x4'));var BPromise=require(_0x7feb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7feb('0x6'));var rimraf=require(_0x7feb('0x7'));var config=require('../../config/environment');var attributes=require(_0x7feb('0x8'));module[_0x7feb('0x9')]=function(_0xe8fea2,_0x4ec68b){return _0xe8fea2['define'](_0x7feb('0xa'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7feb('0xb'),'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 9df3f54..ed9ca79 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 _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x27fad0,_0x2168d6){var _0x4d373a=function(_0x100b60){while(--_0x100b60){_0x27fad0['push'](_0x27fad0['shift']());}};_0x4d373a(++_0x2168d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x43f585,_0x3f8ba8){_0x43f585=_0x43f585-0x0;var _0x399005=_0xb10b[_0x43f585];return _0x399005;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0x5f2f=['error','code','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','debug','stringify'];(function(_0x37d3f3,_0xca010f){var _0x185c9c=function(_0x5e2bf2){while(--_0x5e2bf2){_0x37d3f3['push'](_0x37d3f3['shift']());}};_0x185c9c(++_0xca010f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x22c922,_0x5b6a98){_0x22c922=_0x22c922-0x0;var _0x58e79e=_0x5f2f[_0x22c922];return _0x58e79e;};'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')]('OpenchannelApplication,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20fccd['options']?_0x20fccd['options'][_0xf5f2('0x1d')]||null:null,'attributes':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd['options'][_0xf5f2('0x1e')]||null:null,'limit':_0x20fccd[_0xf5f2('0x1b')]?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null})[_0xf5f2('0x20')](function(_0x4c691a){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x4c691a));_0x4ff59b(_0x4c691a);})['catch'](function(_0x529f07){logger[_0xf5f2('0x11')](_0xf5f2('0x17'),_0x529f07[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x529f07[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index fb20af5..199a622 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 _0x7a3a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','destroy','removeTags'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0x7a3a,0x1bb));var _0xa7a3=function(_0x31660d,_0x516425){_0x31660d=_0x31660d-0x0;var _0x17c0c=_0x7a3a[_0x31660d];return _0x17c0c;};'use strict';var multer=require(_0xa7a3('0x0'));var util=require(_0xa7a3('0x1'));var path=require(_0xa7a3('0x2'));var timeout=require(_0xa7a3('0x3'));var express=require(_0xa7a3('0x4'));var router=express[_0xa7a3('0x5')]();var auth=require(_0xa7a3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa7a3('0x7'));var controller=require(_0xa7a3('0x8'));router[_0xa7a3('0x9')]('/',auth['isAuthenticated'](),controller[_0xa7a3('0xa')]);router[_0xa7a3('0x9')](_0xa7a3('0xb'),auth[_0xa7a3('0xc')](),controller[_0xa7a3('0xd')]);router[_0xa7a3('0x9')](_0xa7a3('0xe'),auth[_0xa7a3('0xc')](),controller['show']);router[_0xa7a3('0x9')](_0xa7a3('0xf'),auth[_0xa7a3('0xc')](),controller[_0xa7a3('0x10')]);router[_0xa7a3('0x9')](_0xa7a3('0x11'),auth[_0xa7a3('0xc')](),controller[_0xa7a3('0x12')]);router[_0xa7a3('0x13')]('/',auth[_0xa7a3('0xc')](),controller[_0xa7a3('0x14')]);router['post'](_0xa7a3('0xf'),auth['isAuthenticated'](),controller[_0xa7a3('0x15')]);router[_0xa7a3('0x13')](_0xa7a3('0x16'),auth['isAuthenticated'](),interaction[_0xa7a3('0x17')](_0xa7a3('0x18'),_0xa7a3('0x19')),controller[_0xa7a3('0x1a')]);router[_0xa7a3('0x1b')](_0xa7a3('0xe'),auth[_0xa7a3('0xc')](),interaction['tracked'](_0xa7a3('0x18'),'openchannelinteraction:update'),controller[_0xa7a3('0x1c')]);router[_0xa7a3('0x1d')](_0xa7a3('0xe'),auth[_0xa7a3('0xc')](),interaction[_0xa7a3('0x17')](_0xa7a3('0x18'),_0xa7a3('0x1e')),controller[_0xa7a3('0x1f')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0xa7a3('0x20')]);module[_0xa7a3('0x21')]=router; \ No newline at end of file +var _0x3c80=['addMessage','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','post'];(function(_0x19b351,_0x547358){var _0x104803=function(_0x412161){while(--_0x412161){_0x19b351['push'](_0x19b351['shift']());}};_0x104803(++_0x547358);}(_0x3c80,0x1db));var _0x03c8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3c80[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x03c8('0x0'));var util=require(_0x03c8('0x1'));var path=require(_0x03c8('0x2'));var timeout=require(_0x03c8('0x3'));var express=require('express');var router=express[_0x03c8('0x4')]();var auth=require(_0x03c8('0x5'));var interaction=require(_0x03c8('0x6'));var config=require(_0x03c8('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x03c8('0x8')](),controller[_0x03c8('0x9')]);router[_0x03c8('0xa')](_0x03c8('0xb'),auth[_0x03c8('0x8')](),controller[_0x03c8('0xc')]);router[_0x03c8('0xa')](_0x03c8('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x03c8('0xa')](_0x03c8('0xe'),auth[_0x03c8('0x8')](),controller[_0x03c8('0xf')]);router[_0x03c8('0xa')](_0x03c8('0x10'),auth[_0x03c8('0x8')](),controller['download']);router[_0x03c8('0x11')]('/',auth[_0x03c8('0x8')](),controller['create']);router['post'](_0x03c8('0xe'),auth[_0x03c8('0x8')](),controller[_0x03c8('0x12')]);router[_0x03c8('0x11')]('/:id/tags',auth[_0x03c8('0x8')](),interaction[_0x03c8('0x13')](_0x03c8('0x14'),_0x03c8('0x15')),controller['addTags']);router[_0x03c8('0x16')](_0x03c8('0xd'),auth[_0x03c8('0x8')](),interaction[_0x03c8('0x13')](_0x03c8('0x14'),_0x03c8('0x17')),controller[_0x03c8('0x18')]);router['delete'](_0x03c8('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x03c8('0x14'),_0x03c8('0x19')),controller[_0x03c8('0x1a')]);router['delete'](_0x03c8('0x1b'),auth[_0x03c8('0x8')](),controller[_0x03c8('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 86ba731..92dc34b 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 _0xbc0c=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x32680b,_0x30bf91){var _0x1eb84a=function(_0xd5fd45){while(--_0xd5fd45){_0x32680b['push'](_0x32680b['shift']());}};_0x1eb84a(++_0x30bf91);}(_0xbc0c,0x127));var _0xcbc0=function(_0x25fb3b,_0x267969){_0x25fb3b=_0x25fb3b-0x0;var _0x10cd35=_0xbc0c[_0x25fb3b];return _0x10cd35;};'use strict';var Sequelize=require(_0xcbc0('0x0'));module[_0xcbc0('0x1')]={'closed':{'type':Sequelize[_0xcbc0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcbc0('0x3')]},'disposition':{'type':Sequelize[_0xcbc0('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xcbc0('0x4')]},'externalUrl':{'type':Sequelize[_0xcbc0('0x4')]},'lastMsgAt':{'type':Sequelize[_0xcbc0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcbc0('0x5')]('in',_0xcbc0('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xcbc0('0x4')]}}; \ No newline at end of file +var _0xc704=['DATE','STRING','BOOLEAN'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0xc704,0xb6));var _0x4c70=function(_0x5c0404,_0x3b754e){_0x5c0404=_0x5c0404-0x0;var _0xab50bf=_0xc704[_0x5c0404];return _0xab50bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0x4c70('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4c70('0x1')]},'disposition':{'type':Sequelize[_0x4c70('0x2')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4c70('0x1')]},'threadId':{'type':Sequelize[_0x4c70('0x2')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0x4c70('0x1')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x4c70('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 0f10338..66302e1 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 _0x9a59=['openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','start','Tag','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','compact','isEmpty','OpenchannelAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','t.id\x20IN\x20?','resolve','getOpenchannelAccounts','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','catch','show','params','intersection','includeAll','include','options','find','create','body','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','direction','OpenchannelAccount','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','Owner','closedAt','threadId','Public','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','secret','renderFile','views','downloadInteraction.html','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9a59,0x9c));var _0x99a5=function(_0x2df2b3,_0x51983b){_0x2df2b3=_0x2df2b3-0x0;var _0x1f40fa=_0x9a59[_0x2df2b3];return _0x1f40fa;};'use strict';var pdf=require(_0x99a5('0x0'));var emlformat=require(_0x99a5('0x1'));var rimraf=require(_0x99a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99a5('0x3'));var rp=require(_0x99a5('0x4'));var moment=require(_0x99a5('0x5'));var BPromise=require(_0x99a5('0x6'));var Mustache=require(_0x99a5('0x7'));var util=require(_0x99a5('0x8'));var path=require(_0x99a5('0x9'));var sox=require(_0x99a5('0xa'));var csv=require('to-csv');var ejs=require(_0x99a5('0xb'));var fs=require('fs');var _=require(_0x99a5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x99a5('0xd'));var deskjs=require(_0x99a5('0xe'));var toCsv=require(_0x99a5('0xf'));var querystring=require(_0x99a5('0x10'));var Papa=require(_0x99a5('0x11'));var Redis=require('ioredis');var authService=require(_0x99a5('0x12'));var qs=require(_0x99a5('0x13'));var as=require(_0x99a5('0x14'));var hardwareService=require(_0x99a5('0x15'));var logger=require(_0x99a5('0x16'))(_0x99a5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x99a5('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99a5('0x19')]));require('./openchannelInteraction.socket')[_0x99a5('0x1a')](socket);function respondWithStatusCode(_0x18a804,_0x15f3ae){_0x15f3ae=_0x15f3ae||0xcc;return function(_0x20a4c6){if(_0x20a4c6){return _0x18a804[_0x99a5('0x1b')](_0x15f3ae);}return _0x18a804[_0x99a5('0x1c')](_0x15f3ae)[_0x99a5('0x1d')]();};}function respondWithResult(_0x1bf2f1,_0x408237){_0x408237=_0x408237||0xc8;return function(_0x52e28a){if(_0x52e28a){return _0x1bf2f1[_0x99a5('0x1c')](_0x408237)[_0x99a5('0x1e')](_0x52e28a);}};}function respondWithFilteredResult(_0x190b41,_0x54c58b){return function(_0x2879d9){if(_0x2879d9){var _0x52c5ce=_0x2879d9[_0x99a5('0x1f')],_0x124cd5=_0x54c58b['offset'],_0x4fa830=_0x54c58b[_0x99a5('0x20')]+_0x54c58b['limit'],_0x2c9d65;if(_0x4fa830>=_0x52c5ce){_0x4fa830=_0x52c5ce;_0x2c9d65=0xc8;}else{_0x2c9d65=0xce;}_0x190b41[_0x99a5('0x1c')](_0x2c9d65);return _0x190b41[_0x99a5('0x21')](_0x99a5('0x22'),_0x124cd5+'-'+_0x4fa830+'/'+_0x52c5ce)[_0x99a5('0x1e')](_0x2879d9);}return null;};}function patchUpdates(_0x26ee42){return function(_0x16ae50){try{jsonpatch['apply'](_0x16ae50,_0x26ee42,!![]);}catch(_0x1b6939){return BPromise[_0x99a5('0x23')](_0x1b6939);}return _0x16ae50[_0x99a5('0x24')]();};}function saveUpdates(_0x181d0e,_0x6a6e03){return function(_0x6b0f77){if(_0x6b0f77){return _0x6b0f77[_0x99a5('0x25')](_0x181d0e)[_0x99a5('0x26')](function(_0x417387){return _0x417387;});}return null;};}function removeEntity(_0x51d779,_0x337388){return function(_0x414e3b){if(_0x414e3b){return _0x414e3b[_0x99a5('0x27')]()[_0x99a5('0x26')](function(){_0x51d779['status'](0xcc)[_0x99a5('0x1d')]();});}};}function handleEntityNotFound(_0xee397d,_0x17b4af){return function(_0xe3d379){if(!_0xe3d379){_0xee397d[_0x99a5('0x1b')](0x194);}return _0xe3d379;};}function handleError(_0x4df5c3,_0x29d544){_0x29d544=_0x29d544||0x1f4;return function(_0x5bf0de){logger['error'](_0x5bf0de[_0x99a5('0x28')]);if(_0x5bf0de[_0x99a5('0x29')]){delete _0x5bf0de[_0x99a5('0x29')];}_0x4df5c3['status'](_0x29d544)[_0x99a5('0x2a')](_0x5bf0de);};}function getInteractionUsers(_0x556653,_0x3ae231){return new BPromise(function(_0x5d978b,_0x52b0b2){try{if(_0x3ae231[_0x556653['id']]){_0x556653[_0x99a5('0x2b')]=_[_0x99a5('0x2c')](_0x3ae231[_0x556653['id']],function(_0x3854a4){return{'id':_0x3854a4['id'],'fullname':_0x3854a4[_0x99a5('0x2d')]};});}}catch(_0x325f82){_0x52b0b2(_0x325f82);}_0x5d978b(_0x556653);});}function getInteractionTags(_0x446c3a,_0x40018a){return new BPromise(function(_0x128af6,_0x58cd2c){try{if(_0x446c3a[_0x99a5('0x2e')]){_0x446c3a['Tags']=[];_0x446c3a[_0x99a5('0x2e')][_0x99a5('0x2f')](',')[_0x99a5('0x30')](function(_0x1cf4dd){_0x446c3a[_0x99a5('0x31')][_0x99a5('0x32')](_0x40018a[_0x1cf4dd]);});}delete _0x446c3a[_0x99a5('0x2e')];}catch(_0x3e96a6){_0x58cd2c(_0x3e96a6);}_0x128af6(_0x446c3a);});}function updateOpenchannelInteraction(_0x5d4166,_0x4c8504,_0x247696){return new BPromise(function(_0x36308a,_0x295ab9){return getInteractionUsers(_0x5d4166,_0x247696)[_0x99a5('0x26')](function(_0x3c0cb6){return getInteractionTags(_0x3c0cb6,_0x4c8504);})[_0x99a5('0x26')](function(_0x2d54c1){_0x36308a(_0x2d54c1);})['catch'](function(_0x494037){_0x295ab9(_0x494037);});});}exports[_0x99a5('0x33')]=function(_0x5a8167,_0x1a9f23){var _0xf3951b={},_0x17635e={},_0x314407={'count':0x0,'rows':[]};var _0x127d42=_[_0x99a5('0x2c')](db[_0x99a5('0x34')][_0x99a5('0x35')],function(_0x30f2a){return{'name':_0x30f2a[_0x99a5('0x36')],'type':_0x30f2a['type'][_0x99a5('0x37')]};});_0x17635e[_0x99a5('0x38')]=_[_0x99a5('0x2c')](_0x127d42,'name');_0x17635e[_0x99a5('0x39')]=_[_0x99a5('0x3a')](_0x5a8167[_0x99a5('0x39')]);_0x17635e[_0x99a5('0x3b')]=_['intersection'](_0x17635e[_0x99a5('0x38')],_0x17635e[_0x99a5('0x39')]);_0xf3951b[_0x99a5('0x3c')]=_['intersection'](_0x17635e[_0x99a5('0x38')],qs[_0x99a5('0x3d')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x3d')]));_0xf3951b[_0x99a5('0x3c')]=_0xf3951b[_0x99a5('0x3c')][_0x99a5('0x3e')]?_0xf3951b[_0x99a5('0x3c')]:_0x17635e[_0x99a5('0x38')];if(!_0x5a8167[_0x99a5('0x39')][_0x99a5('0x3f')](_0x99a5('0x40'))){_0xf3951b['limit']=qs[_0x99a5('0x41')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x41')]);_0xf3951b['offset']=qs[_0x99a5('0x20')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x20')]);}_0xf3951b[_0x99a5('0x42')]=qs[_0x99a5('0x43')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x43')]);_0xf3951b[_0x99a5('0x44')]=qs[_0x99a5('0x3b')](_[_0x99a5('0x45')](_0x5a8167[_0x99a5('0x39')],_0x17635e[_0x99a5('0x3b')]));var _0x5b391f=[];var _0x3e1774=squel['select']()[_0x99a5('0x46')]('id')[_0x99a5('0x46')](_0x99a5('0x29'))[_0x99a5('0x46')]('color')[_0x99a5('0x47')](_0x99a5('0x48'));var _0x1d1f23=squel[_0x99a5('0x49')]()[_0x99a5('0x46')](_0x99a5('0x4a'))['field'](_0x99a5('0x4b'))[_0x99a5('0x46')](_0x99a5('0x4c'))[_0x99a5('0x47')](_0x99a5('0x4d'),'ui')[_0x99a5('0x4e')]('users','u',_0x99a5('0x4f'));var _0x5ca3c3=squel[_0x99a5('0x49')]()[_0x99a5('0x47')]('openchannel_interactions','i')['left_join']('cm_contacts','c',_0x99a5('0x50'))[_0x99a5('0x4e')](_0x99a5('0x51'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x99a5('0x52'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0x99a5('0x53'),'me',_0x99a5('0x54'))[_0x99a5('0x4e')](_0x99a5('0x55'),'it',_0x99a5('0x56'))[_0x99a5('0x4e')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0xc2c1d1=squel['expr']();var _0x2fe022=[];var _0x5ae77f=squel[_0x99a5('0x57')]();var _0x59a562;if(_0x5a8167['query'][_0x99a5('0x58')]){_0x59a562=as[_0x99a5('0x59')](_0x5a8167['query'][_0x99a5('0x58')]);var _0x255de1=_0x59a562[_0x99a5('0x5a')];for(var _0x20f421=0x0;_0x20f421<_0x59a562[_0x99a5('0x5b')][_0x99a5('0x3e')];_0x20f421++){var _0x40f8b0=_0x59a562[_0x99a5('0x5b')][_0x20f421];var _0x23c509='i';var _0x170f46=_['find'](_0x127d42,['name',_0x40f8b0[_0x99a5('0x46')]]);if(!_0x170f46){switch(_0x40f8b0[_0x99a5('0x46')]){case _0x99a5('0x5c'):if(_0x40f8b0[_0x99a5('0x5d')]==0x1){_0x5ca3c3[_0x99a5('0x5e')]('`'+_0x40f8b0['field']+_0x99a5('0x5f'));}else{_0x5ca3c3[_0x99a5('0x5e')]('`'+_0x40f8b0[_0x99a5('0x46')]+_0x99a5('0x60'));}break;case _0x99a5('0x61'):if(_0x40f8b0['operator']==='$substring'){if(_0x40f8b0[_0x99a5('0x5d')]['split']('\x20')[_0x99a5('0x3e')]>0x1){_0xc2c1d1[_0x255de1](_0x99a5('0x62'),qs[_0x99a5('0x63')](_0x40f8b0[_0x99a5('0x5d')]),null);}else{var _0x542dac='%'+_0x40f8b0['value']+'%';_0xc2c1d1[_0x255de1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x542dac,_0x542dac,_0x542dac);}}else{_0x170f46=_['find'](_0x127d42,[_0x99a5('0x29'),_0x99a5('0x64')]);_0x40f8b0[_0x99a5('0x46')]=_0x99a5('0x64');_0x54bcb2=as[_0x99a5('0x65')](_0x23c509,_0x170f46[_0x99a5('0x66')],_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2['text'],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x67')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x1d')]);}break;case _0x99a5('0x68'):var _0x26c7d9=_0x40f8b0[_0x99a5('0x5d')][_0x99a5('0x2f')](',')['map'](function(_0x11d3d2){return Number(_0x11d3d2);});_0x26c7d9['forEach'](function(_0x487e5f){_0x5ae77f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x487e5f+',%');});_0x2fe022=_[_0x99a5('0x69')](_0x2fe022,_0x26c7d9);break;case _0x99a5('0x6a'):if(_0x40f8b0[_0x99a5('0x6b')]===_0x99a5('0x6c')){_0xc2c1d1[_0x255de1](_0x99a5('0x6d'),'%'+_0x40f8b0[_0x99a5('0x5d')]+'%',null);}else{_0x170f46=_['find'](_0x127d42,[_0x99a5('0x29'),_0x99a5('0x6e')]);_0x40f8b0[_0x99a5('0x46')]=_0x99a5('0x6e');_0x54bcb2=as[_0x99a5('0x65')](_0x23c509,_0x170f46[_0x99a5('0x66')],_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2[_0x99a5('0x6f')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x67')],_0x54bcb2['value'][_0x99a5('0x1d')]);}break;case'body':_0x54bcb2=as[_0x99a5('0x65')]('me',null,_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2['text'],_0x54bcb2[_0x99a5('0x5d')]['start'],_0x54bcb2['value'][_0x99a5('0x1d')]);break;}}else{var _0x54bcb2=as['buildExpression'](_0x23c509,_0x170f46['type'],_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2[_0x99a5('0x6f')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x67')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x1d')]);}}}else{var _0x4a33fa=_(_0x5a8167['query'])[_0x99a5('0x3a')]()[_0x99a5('0x2c')](function(_0x4c81a9){return _[_0x99a5('0x70')](_0x127d42,[_0x99a5('0x29'),_0x4c81a9])?_0x4c81a9:undefined;})[_0x99a5('0x71')]()[_0x99a5('0x5d')]();if(!_[_0x99a5('0x72')](_0x4a33fa)){_0x4a33fa[_0x99a5('0x30')](function(_0x4494ae){if(_0x4494ae===_0x99a5('0x73')){_0x5ca3c3[_0x99a5('0x44')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x5a8167[_0x99a5('0x39')][_0x4494ae]));}else if(_0x4494ae===_0x99a5('0x74')){var _0x440571=JSON[_0x99a5('0x75')](_0x5a8167['query'][_0x4494ae])[_0x99a5('0x76')];var _0x268232=JSON['parse'](_0x5a8167[_0x99a5('0x39')][_0x4494ae])[_0x99a5('0x77')];_0x5ca3c3[_0x99a5('0x44')](_0x99a5('0x78'),_0x440571,_0x268232);}else{if(_0x5a8167['query'][_0x4494ae]===_0x99a5('0x79')){_0x5ca3c3['where']('i.'+_0x4494ae+_0x99a5('0x7a'));}else{_0x5ca3c3['where']('i.'+_0x4494ae+_0x99a5('0x7b'),_0x5a8167[_0x99a5('0x39')][_0x4494ae]);}}});}if(_0x5a8167['query'][_0x99a5('0x7c')]){if(_0x5a8167['query'][_0x99a5('0x7c')]==0x1){_0x5ca3c3[_0x99a5('0x5e')](_0x99a5('0x7d'));}else{_0x5ca3c3[_0x99a5('0x5e')](_0x99a5('0x7e'));}}if(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x7f')]){_0x2fe022=_['isArray'](_0x5a8167['query'][_0x99a5('0x7f')])?_0x5a8167[_0x99a5('0x39')][_0x99a5('0x7f')]:new Array(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x7f')]);_0x2fe022[_0x99a5('0x30')](function(_0xe38a8e){_0x5ae77f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xe38a8e+',%');});}if(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x80')]){var _0x3045b9=_0x5a8167['query'][_0x99a5('0x80')][_0x99a5('0x81')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x99a5('0x82')](_0x3045b9)){_0xc2c1d1['or'](_0x99a5('0x83'),_0x3045b9+'%');}else{_0xc2c1d1['or'](_0x99a5('0x84'),qs[_0x99a5('0x63')](_0x3045b9))['or'](_0x99a5('0x85'),_0x3045b9+'%')['or'](_0x99a5('0x86'),_0x3045b9+'%');}}}_0x5ca3c3['where'](_0xc2c1d1);_0x5ca3c3[_0x99a5('0x87')](_0x99a5('0x88'));var _0x5e7e6b={'type':db[_0x99a5('0x89')][_0x99a5('0x8a')]['SELECT'],'raw':!![]};var _0x304dcf=_0x5ca3c3[_0x99a5('0x8b')]();_0x304dcf[_0x99a5('0x46')](_0x99a5('0x88'));_0x304dcf[_0x99a5('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0xf3951b['order']){_0xf3951b['order'][_0x99a5('0x30')](function(_0x2c8436){_0x5ca3c3[_0x99a5('0x42')]('i.'+_0x2c8436[0x0],_0x2c8436[0x1]==='DESC'?![]:!![]);});}if(!_[_0x99a5('0x72')](_0x2fe022)){_0x5ca3c3[_0x99a5('0x5e')](_0x5ae77f);_0x304dcf[_0x99a5('0x44')](_0x99a5('0x8c'),_0x2fe022);}BPromise[_0x99a5('0x8d')]()[_0x99a5('0x26')](function(){if(!_0x59a562&&_0x5a8167['query'][_0x99a5('0x73')])return;return _0x5a8167['user'][_0x99a5('0x8e')]({'attributes':['id'],'raw':!![]})[_0x99a5('0x26')](function(_0x277c67){if(_['isEmpty'](_0x277c67)){_0x304dcf['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x5ca3c3[_0x99a5('0x44')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x304dcf[_0x99a5('0x44')](_0x99a5('0x8f'),_[_0x99a5('0x2c')](_0x277c67,'id'));_0x5ca3c3[_0x99a5('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x99a5('0x2c')](_0x277c67,'id'));}});})[_0x99a5('0x26')](function(){db[_0x99a5('0x90')][_0x99a5('0x39')](_0x304dcf['toString'](),_0x5e7e6b)[_0x99a5('0x26')](function(_0x2d1548){_0x314407[_0x99a5('0x1f')]=_0x2d1548[_0x99a5('0x3e')];if(_0x314407[_0x99a5('0x1f')]===0x0)return[];return db['sequelize'][_0x99a5('0x39')](_0x3e1774[_0x99a5('0x91')](),_0x5e7e6b)[_0x99a5('0x26')](function(_0x1fe1c0){_0x5b391f=_[_0x99a5('0x92')](_0x1fe1c0,'id');_0x5e7e6b=_[_0x99a5('0x93')](_0x5e7e6b,{'model':db[_0x99a5('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x3d')]){_0xf3951b['attributes'][_0x99a5('0x30')](function(_0x5f6720){_0x5ca3c3[_0x99a5('0x46')]('i.'+_0x5f6720);});}else{_0x5ca3c3['field'](_0x99a5('0x94'),_0x99a5('0x5c'));_0x5ca3c3[_0x99a5('0x46')]('a.key','Account.key');_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x95'),_0x99a5('0x96'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x97'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x98'),_0x99a5('0x99'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x9a'),_0x99a5('0x9b'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x9c'),_0x99a5('0x9d'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x9e'),_0x99a5('0x9f'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa0'),_0x99a5('0xa1'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa2'),_0x99a5('0xa3'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa4'),'Owner.fullname');_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa5'),_0x99a5('0xa6'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa7'),_0x99a5('0x2e'));}_0x5ca3c3[_0x99a5('0x41')](_0xf3951b['limit']);_0x5ca3c3[_0x99a5('0x20')](_0xf3951b[_0x99a5('0x20')]);return db[_0x99a5('0x90')][_0x99a5('0x39')](_0x5ca3c3[_0x99a5('0x91')](),_0x5e7e6b);})[_0x99a5('0x26')](function(_0x4a4182){_0x1d1f23[_0x99a5('0x44')](_0x99a5('0xa8'),_[_0x99a5('0x2c')](_0x4a4182,'id'));return db[_0x99a5('0x90')]['query'](_0x1d1f23[_0x99a5('0x91')](),_0x5e7e6b)[_0x99a5('0x26')](function(_0x38919a){var _0x27935a=_['groupBy'](_0x38919a,_0x99a5('0xa9'));var _0x4a5e57=[];_0x4a4182[_0x99a5('0x30')](function(_0x1ad537){_0x4a5e57['push'](updateOpenchannelInteraction(_0x1ad537,_0x5b391f,_0x27935a));});return BPromise[_0x99a5('0xaa')](_0x4a5e57);});});})[_0x99a5('0x26')](function(_0x4ee008){_0x314407[_0x99a5('0xab')]=_0x4ee008;return _0x314407;})[_0x99a5('0x26')](respondWithFilteredResult(_0x1a9f23,_0xf3951b));})[_0x99a5('0xac')](handleError(_0x1a9f23,null));};exports[_0x99a5('0xad')]=function(_0x3056eb,_0x286ec2){var _0x300a93={'raw':![],'where':{'id':_0x3056eb[_0x99a5('0xae')]['id']}},_0x1b1e7b={};_0x1b1e7b[_0x99a5('0x38')]=_['keys'](db['OpenchannelInteraction'][_0x99a5('0x35')]);_0x1b1e7b['query']=_[_0x99a5('0x3a')](_0x3056eb[_0x99a5('0x39')]);_0x1b1e7b[_0x99a5('0x3b')]=_['intersection'](_0x1b1e7b[_0x99a5('0x38')],_0x1b1e7b[_0x99a5('0x39')]);_0x300a93['attributes']=_[_0x99a5('0xaf')](_0x1b1e7b[_0x99a5('0x38')],qs[_0x99a5('0x3d')](_0x3056eb[_0x99a5('0x39')][_0x99a5('0x3d')]));_0x300a93[_0x99a5('0x3c')]=_0x300a93[_0x99a5('0x3c')][_0x99a5('0x3e')]?_0x300a93[_0x99a5('0x3c')]:_0x1b1e7b[_0x99a5('0x38')];if(_0x3056eb[_0x99a5('0x39')][_0x99a5('0xb0')]){_0x300a93[_0x99a5('0xb1')]=[{'all':!![]}];}_0x300a93=_[_0x99a5('0x93')]({},_0x300a93,_0x3056eb[_0x99a5('0xb2')]);return db[_0x99a5('0x34')][_0x99a5('0xb3')](_0x300a93)[_0x99a5('0x26')](handleEntityNotFound(_0x286ec2,null))['then'](respondWithResult(_0x286ec2,null))[_0x99a5('0xac')](handleError(_0x286ec2,null));};exports[_0x99a5('0xb4')]=function(_0x262bf4,_0x22aaac){return db[_0x99a5('0x34')][_0x99a5('0xb4')](_0x262bf4[_0x99a5('0xb5')],{})['then'](respondWithResult(_0x22aaac,0xc9))['catch'](handleError(_0x22aaac,null));};exports[_0x99a5('0x25')]=function(_0x4388df,_0x442b64){if(_0x4388df[_0x99a5('0xb5')]['id']){delete _0x4388df[_0x99a5('0xb5')]['id'];}return db['OpenchannelInteraction'][_0x99a5('0xb3')]({'where':{'id':_0x4388df['params']['id']}})['then'](handleEntityNotFound(_0x442b64,null))[_0x99a5('0x26')](saveUpdates(_0x4388df['body'],null))['then'](respondWithResult(_0x442b64,null))[_0x99a5('0xac')](handleError(_0x442b64,null));};exports[_0x99a5('0x27')]=function(_0x65cc90,_0x2e4d72){return db[_0x99a5('0x34')][_0x99a5('0xb3')]({'where':{'id':_0x65cc90[_0x99a5('0xae')]['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x2e4d72,null))[_0x99a5('0x26')](removeEntity(_0x2e4d72,null))['catch'](handleError(_0x2e4d72,null));};exports['describe']=function(_0x16f93,_0x1d8aa2){return db[_0x99a5('0x34')][_0x99a5('0xb6')]()[_0x99a5('0x26')](respondWithResult(_0x1d8aa2,null))[_0x99a5('0xac')](handleError(_0x1d8aa2,null));};exports[_0x99a5('0xb7')]=function(_0xfb5385,_0x214f32,_0x43ea0c){return db[_0x99a5('0xb8')][_0x99a5('0xb3')]({'where':{'id':_0xfb5385['params']['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x214f32,null))['then'](function(_0x2d7f72){if(_0x2d7f72){return _0x2d7f72['addMessage'](_0xfb5385[_0x99a5('0xb5')]['ids'],_[_0x99a5('0xb9')](_0xfb5385[_0x99a5('0xb5')],[_0x99a5('0xba'),'id'])||{});}})[_0x99a5('0x26')](respondWithResult(_0x214f32,null))['catch'](handleError(_0x214f32,null));};exports[_0x99a5('0xbb')]=function(_0x28e0bf,_0x487c94,_0x12480c){var _0x7f41b9={'raw':![],'where':{}};var _0x182d90={};var _0x211c6a={'count':0x0,'rows':[]};return db[_0x99a5('0x34')][_0x99a5('0xbc')]({'where':{'id':_0x28e0bf['params']['id']}})['then'](handleEntityNotFound(_0x487c94,null))['then'](function(_0x543f87){if(_0x543f87){_0x182d90[_0x99a5('0x38')]=_[_0x99a5('0x3a')](db[_0x99a5('0xb8')][_0x99a5('0x35')]);_0x182d90['query']=_[_0x99a5('0x3a')](_0x28e0bf[_0x99a5('0x39')]);_0x182d90[_0x99a5('0x3b')]=_[_0x99a5('0xaf')](_0x182d90[_0x99a5('0x38')],_0x182d90['query']);_0x7f41b9[_0x99a5('0x3c')]=_[_0x99a5('0xaf')](_0x182d90[_0x99a5('0x38')],qs['fields'](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x3d')]));_0x7f41b9[_0x99a5('0x3c')]=_0x7f41b9[_0x99a5('0x3c')][_0x99a5('0x3e')]?_0x7f41b9[_0x99a5('0x3c')]:_0x182d90[_0x99a5('0x38')];if(!_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x3f')](_0x99a5('0x40'))){_0x7f41b9[_0x99a5('0x41')]=qs[_0x99a5('0x41')](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x41')]);_0x7f41b9[_0x99a5('0x20')]=qs[_0x99a5('0x20')](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x20')]);}_0x7f41b9[_0x99a5('0x42')]=qs[_0x99a5('0x43')](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x43')]);_0x7f41b9['where']=qs[_0x99a5('0x3b')](_[_0x99a5('0x45')](_0x28e0bf[_0x99a5('0x39')],_0x182d90[_0x99a5('0x3b')]));_0x7f41b9[_0x99a5('0x44')][_0x99a5('0xa9')]=_0x543f87['id'];if(_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x80')]){_0x7f41b9[_0x99a5('0x44')]=_[_0x99a5('0x93')](_0x7f41b9[_0x99a5('0x44')],{'$or':_[_0x99a5('0x2c')](_0x7f41b9[_0x99a5('0x3c')],function(_0x4857ee){var _0x2d6abe={};_0x2d6abe[_0x4857ee]={'$like':'%'+_0x28e0bf['query'][_0x99a5('0x80')]+'%'};return _0x2d6abe;})});}if(_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x76')]){var _0x2bfe3f=_0x28e0bf['query'][_0x99a5('0x76')][_0x99a5('0x2f')](',');var _0x2abe88={};_0x2abe88[_0x2bfe3f[0x0]]={'$gte':moment(_0x2bfe3f[0x1])[_0x99a5('0xbd')](_0x99a5('0xbe'))};_0x7f41b9['where']=_['merge'](_0x7f41b9[_0x99a5('0x44')],_0x2abe88);}_0x7f41b9=_[_0x99a5('0x93')]({},_0x7f41b9,_0x28e0bf['options']);return db[_0x99a5('0xb8')][_0x99a5('0x1f')]({'where':_0x7f41b9[_0x99a5('0x44')]})[_0x99a5('0x26')](function(_0x457f6d){_0x211c6a[_0x99a5('0x1f')]=_0x457f6d;if(_0x28e0bf['query'][_0x99a5('0xb0')]){_0x7f41b9[_0x99a5('0xb1')]=[{'all':!![]}];}return db[_0x99a5('0xb8')][_0x99a5('0xbf')](_0x7f41b9);})['then'](function(_0x5845c5){_0x211c6a[_0x99a5('0xab')]=_0x5845c5;return _0x211c6a;});}})['then'](respondWithFilteredResult(_0x487c94,_0x7f41b9))[_0x99a5('0xac')](handleError(_0x487c94,null));};exports[_0x99a5('0xc0')]=function(_0x2c4dc1,_0x481b0a,_0x366992){return db[_0x99a5('0x34')][_0x99a5('0xb3')]({'where':{'id':_0x2c4dc1[_0x99a5('0xae')]['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x481b0a,null))['then'](function(_0x562f55){if(_0x562f55){return _0x562f55['setTags'](_0x2c4dc1[_0x99a5('0xb5')][_0x99a5('0xba')],_[_0x99a5('0xb9')](_0x2c4dc1[_0x99a5('0xb5')],['ids','id'])||{})[_0x99a5('0xc1')](function(){return db[_0x99a5('0x68')][_0x99a5('0xbf')]({'attributes':['id',_0x99a5('0x29'),'color'],'where':{'id':_0x2c4dc1['body'][_0x99a5('0xba')]}});})[_0x99a5('0x26')](function(_0x2f8928){socket['emit'](_0x99a5('0xc2'),{'id':Number(_0x2c4dc1[_0x99a5('0xae')]['id']),'tags':_0x2f8928||[]});return{'id':Number(_0x2c4dc1[_0x99a5('0xae')]['id']),'tags':_0x2f8928||[]};});}})[_0x99a5('0x26')](respondWithResult(_0x481b0a,null))['catch'](handleError(_0x481b0a,null));};exports[_0x99a5('0xc3')]=function(_0x4f6ba9,_0x389630,_0x312f0e){return db['OpenchannelInteraction'][_0x99a5('0xb3')]({'where':{'id':_0x4f6ba9[_0x99a5('0xae')]['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x389630,null))[_0x99a5('0x26')](function(_0x11df93){if(_0x11df93){return _0x11df93[_0x99a5('0xc3')](_0x4f6ba9[_0x99a5('0x39')][_0x99a5('0xba')]);}})[_0x99a5('0x26')](respondWithStatusCode(_0x389630,null))[_0x99a5('0xac')](handleError(_0x389630,null));};exports[_0x99a5('0xc4')]=function(_0x314e68,_0x3889b5){var _0x3b5c91=moment()[_0x99a5('0xc5')]()[_0x99a5('0x91')]();var _0x566055=path[_0x99a5('0xc6')](config[_0x99a5('0xc7')],_0x99a5('0xc8'),_0x99a5('0xc9'),'tmp');var _0x38b826=path[_0x99a5('0xc6')](config['root'],_0x99a5('0xc8'),_0x99a5('0xc9'),'attachments');var _0x4cf38c=path['join'](_0x566055,_0x3b5c91);var _0x477d11=util[_0x99a5('0xbd')](_0x99a5('0xca'),_0x314e68[_0x99a5('0xae')]['id'],_0x3b5c91);var _0x34a3a0=path[_0x99a5('0xc6')](_0x566055,_0x477d11);var _0x44eb2c=[];_0x44eb2c[_0x99a5('0x32')]({'model':db[_0x99a5('0x6a')],'as':_0x99a5('0x6a'),'attributes':['id','fullname'],'raw':!![]});_0x44eb2c[_0x99a5('0x32')]({'model':db[_0x99a5('0xcb')],'as':'Contact','attributes':['id',_0x99a5('0xcc'),_0x99a5('0xcd')],'raw':!![]});if(_0x314e68[_0x99a5('0x39')][_0x99a5('0xce')]){_0x44eb2c['push']({'model':db['Attachment'],'as':_0x99a5('0xcf'),'raw':!![]});}var _0x488448=[{'model':db[_0x99a5('0xb8')],'as':'Messages','attributes':['id',_0x99a5('0xb5'),_0x99a5('0x74'),_0x99a5('0xd0'),'secret',_0x99a5('0x7c')],'include':_0x44eb2c}];_0x488448['push']({'model':db[_0x99a5('0xd1')],'as':'Account','attributes':['id',_0x99a5('0x29')]});_0x488448[_0x99a5('0x32')]({'model':db[_0x99a5('0x6a')],'as':'Owner','attributes':['id','fullname']});return db['OpenchannelInteraction'][_0x99a5('0xb3')]({'where':{'id':_0x314e68[_0x99a5('0xae')]['id']},'include':_0x488448})[_0x99a5('0x26')](handleEntityNotFound(_0x3889b5,null))[_0x99a5('0x26')](function(_0x33bbe4){if(_0x33bbe4){var _0x525251=_0x33bbe4[_0x99a5('0xd2')]({'plain':!![]});fs[_0x99a5('0xd3')](_0x4cf38c);var _0x597a4f={'format':'A4','border':_0x99a5('0xd4'),'header':{'height':_0x99a5('0xd5'),'contents':{'first':_0x99a5('0xd6')}},'footer':{'height':_0x99a5('0xd7'),'contents':{'default':util[_0x99a5('0xbd')](_0x99a5('0xd8'),util[_0x99a5('0xbd')]('%s\x20#%d',_0x99a5('0xd9'),_0x525251['id']),moment()[_0x99a5('0xbd')](_0x99a5('0xda'))['toString']())}}};var _0x48b57e={'channel':_0x99a5('0xd9'),'account':_0x525251['Account'][_0x99a5('0x29')],'agent':_0x525251['Owner']?_0x525251[_0x99a5('0xdb')]['fullname']:'N.A.','createdAt':moment(_0x525251[_0x99a5('0x74')])[_0x99a5('0xbd')](_0x99a5('0xbe'))[_0x99a5('0x91')](),'closedAt':_0x525251['closed']?moment(_0x525251[_0x99a5('0xdc')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x525251['disposition'],'visibility':_0x525251[_0x99a5('0xdd')]?_0x99a5('0xde'):_0x99a5('0xdf'),'messages':_(_0x525251[_0x99a5('0xe0')])['filter']({'secret':![]})[_0x99a5('0x2c')](function(_0xb08327){if(_0xb08327[_0x99a5('0xcf')]){var _0x1aca2d=path[_0x99a5('0xc6')](_0x38b826,_0xb08327[_0x99a5('0xcf')][_0x99a5('0xe1')]);if(fs['existsSync'](_0x1aca2d)){fs[_0x99a5('0xe2')](_0x1aca2d)[_0x99a5('0xe3')](fs[_0x99a5('0xe4')](path[_0x99a5('0xc6')](_0x4cf38c,_0xb08327['Attachment'][_0x99a5('0xe1')])));}}return{'date':moment(_0xb08327[_0x99a5('0x74')])[_0x99a5('0xbd')](_0x99a5('0xbe'))[_0x99a5('0x91')](),'sender':_0xb08327[_0x99a5('0xd0')]===_0x99a5('0xe5')?_0xb08327[_0x99a5('0x6a')]?_0xb08327[_0x99a5('0x6a')]['fullname']:'System':_0xb08327[_0x99a5('0x61')]['firstName']+(_0xb08327[_0x99a5('0x61')][_0x99a5('0xcd')]?'\x20'+_0xb08327['Contact'][_0x99a5('0xcd')]:''),'body':_0xb08327[_0x99a5('0xcf')]?_0xb08327[_0x99a5('0xcf')][_0x99a5('0xe1')]:_0xb08327['body'],'direction':_0xb08327[_0x99a5('0xd0')]==='out'?'A':'C','secret':_0xb08327[_0x99a5('0xe6')],'read':_0xb08327[_0x99a5('0x7c')],'attachment':_0xb08327['Attachment']};})[_0x99a5('0x5d')]()};return ejs[_0x99a5('0xe7')](path[_0x99a5('0xc6')](config[_0x99a5('0xc7')],_0x99a5('0xc8'),_0x99a5('0xe8'),_0x99a5('0xe9')),{'interaction':_0x48b57e})[_0x99a5('0x26')](function(_0x1a7ae0){return new BPromise(function(_0x6c97df,_0x42b5f5){pdf[_0x99a5('0xb4')](_0x1a7ae0,_0x597a4f)['toFile'](path[_0x99a5('0xc6')](_0x4cf38c,_0x99a5('0xea')+_0x525251['id']+'-'+_0x3b5c91+_0x99a5('0xeb')),function(_0x599d64,_0x339f43){if(_0x599d64)return _0x42b5f5(_0x599d64);_0x6c97df(_0x339f43);});});})[_0x99a5('0x26')](function(){return new BPromise(function(_0x2e0057,_0xc782c6){zipdir(_0x4cf38c,{'saveTo':_0x34a3a0},function(_0x3a839e,_0x51cb49){if(_0x3a839e)return _0xc782c6(_0x3a839e);return _0x2e0057(_0x51cb49);});})[_0x99a5('0x26')](function(){return new BPromise(function(_0x33a45a,_0x354513){rimraf(_0x4cf38c,function(_0x4b60d0){if(_0x4b60d0)_0x354513(_0x4b60d0);return _0x33a45a();});});})[_0x99a5('0x26')](function(){return _0x3889b5['download'](_0x34a3a0,_0x477d11,function(_0xe778bb){if(_0xe778bb){console[_0x99a5('0xec')](_0x99a5('0xed'),_0xe778bb);}else{fs['unlinkSync'](_0x34a3a0);}});});});}else{return _0x3889b5['sendStatus'](0xc8);}})[_0x99a5('0xac')](handleError(_0x3889b5,null));}; \ No newline at end of file +var _0xa8dd=['zip-dir','fast-json-patch','request-promise','bluebird','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','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','isEmpty','OpenchannelAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','order','DESC','t.id\x20IN\x20?','resolve','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','options','create','params','destroy','describe','addMessage','omit','ids','getMessages','findOne','OpenchannelMessage','includeAll','findAll','rows','setTags','spread','removeTags','unix','join','root','server','files','attachments','format','transcript-%d-%s.zip','User','CmContact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','OpenchannelAccount','Account','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','YYYY-MM-DD','Openchannel','Owner','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','basename','existsSync','createReadStream','pipe','out','System','downloadInteraction.html','toFile','transcript-','.pdf','download','err','html-pdf'];(function(_0x147238,_0x3ae17e){var _0x10370c=function(_0x3b2a98){while(--_0x3b2a98){_0x147238['push'](_0x147238['shift']());}};_0x10370c(++_0x3ae17e);}(_0xa8dd,0x1dd));var _0xda8d=function(_0x133804,_0x46eafb){_0x133804=_0x133804-0x0;var _0x45b070=_0xa8dd[_0x133804];return _0x45b070;};'use strict';var pdf=require(_0xda8d('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda8d('0x1'));var jsonpatch=require(_0xda8d('0x2'));var rp=require(_0xda8d('0x3'));var moment=require('moment');var BPromise=require(_0xda8d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xda8d('0x5'));var csv=require(_0xda8d('0x6'));var ejs=require(_0xda8d('0x7'));var fs=require('fs');var _=require(_0xda8d('0x8'));var squel=require(_0xda8d('0x9'));var crypto=require(_0xda8d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xda8d('0xb'));var toCsv=require(_0xda8d('0x6'));var querystring=require(_0xda8d('0xc'));var Papa=require(_0xda8d('0xd'));var Redis=require('ioredis');var authService=require(_0xda8d('0xe'));var qs=require(_0xda8d('0xf'));var as=require(_0xda8d('0x10'));var hardwareService=require(_0xda8d('0x11'));var logger=require(_0xda8d('0x12'))(_0xda8d('0x13'));var utils=require(_0xda8d('0x14'));var config=require(_0xda8d('0x15'));var db=require(_0xda8d('0x16'))['db'];config[_0xda8d('0x17')]=_[_0xda8d('0x18')](config[_0xda8d('0x17')],{'host':_0xda8d('0x19'),'port':0x18eb});var socket=require(_0xda8d('0x1a'))(new Redis(config[_0xda8d('0x17')]));require('./openchannelInteraction.socket')[_0xda8d('0x1b')](socket);function respondWithStatusCode(_0x152c7f,_0x3f6cb9){_0x3f6cb9=_0x3f6cb9||0xcc;return function(_0x37cd05){if(_0x37cd05){return _0x152c7f[_0xda8d('0x1c')](_0x3f6cb9);}return _0x152c7f[_0xda8d('0x1d')](_0x3f6cb9)[_0xda8d('0x1e')]();};}function respondWithResult(_0xc34684,_0x23cc18){_0x23cc18=_0x23cc18||0xc8;return function(_0x10d70b){if(_0x10d70b){return _0xc34684[_0xda8d('0x1d')](_0x23cc18)[_0xda8d('0x1f')](_0x10d70b);}};}function respondWithFilteredResult(_0x43b7dc,_0x2a0f9f){return function(_0x4f10c3){if(_0x4f10c3){var _0x1831ff=_0x4f10c3[_0xda8d('0x20')],_0x212bb6=_0x2a0f9f[_0xda8d('0x21')],_0x2db200=_0x2a0f9f[_0xda8d('0x21')]+_0x2a0f9f[_0xda8d('0x22')],_0x181a4b;if(_0x2db200>=_0x1831ff){_0x2db200=_0x1831ff;_0x181a4b=0xc8;}else{_0x181a4b=0xce;}_0x43b7dc['status'](_0x181a4b);return _0x43b7dc[_0xda8d('0x23')](_0xda8d('0x24'),_0x212bb6+'-'+_0x2db200+'/'+_0x1831ff)[_0xda8d('0x1f')](_0x4f10c3);}return null;};}function patchUpdates(_0x939432){return function(_0xea314c){try{jsonpatch['apply'](_0xea314c,_0x939432,!![]);}catch(_0x27c052){return BPromise[_0xda8d('0x25')](_0x27c052);}return _0xea314c[_0xda8d('0x26')]();};}function saveUpdates(_0x2f7a0a,_0x2c91d1){return function(_0x59425b){if(_0x59425b){return _0x59425b[_0xda8d('0x27')](_0x2f7a0a)[_0xda8d('0x28')](function(_0x4ea560){return _0x4ea560;});}return null;};}function removeEntity(_0x3f0d47,_0x538580){return function(_0x19e41f){if(_0x19e41f){return _0x19e41f['destroy']()['then'](function(){_0x3f0d47[_0xda8d('0x1d')](0xcc)[_0xda8d('0x1e')]();});}};}function handleEntityNotFound(_0x197f09,_0x3b19a1){return function(_0x3bb345){if(!_0x3bb345){_0x197f09[_0xda8d('0x1c')](0x194);}return _0x3bb345;};}function handleError(_0x9689d8,_0x13aef8){_0x13aef8=_0x13aef8||0x1f4;return function(_0x1fe23b){logger[_0xda8d('0x29')](_0x1fe23b[_0xda8d('0x2a')]);if(_0x1fe23b['name']){delete _0x1fe23b[_0xda8d('0x2b')];}_0x9689d8[_0xda8d('0x1d')](_0x13aef8)[_0xda8d('0x2c')](_0x1fe23b);};}function getInteractionUsers(_0x4f3854,_0x3ad56f){return new BPromise(function(_0x2f1df4,_0x253edb){try{if(_0x3ad56f[_0x4f3854['id']]){_0x4f3854[_0xda8d('0x2d')]=_[_0xda8d('0x2e')](_0x3ad56f[_0x4f3854['id']],function(_0x4a101d){return{'id':_0x4a101d['id'],'fullname':_0x4a101d[_0xda8d('0x2f')]};});}}catch(_0x297f96){_0x253edb(_0x297f96);}_0x2f1df4(_0x4f3854);});}function getInteractionTags(_0x5a54d0,_0x1bd3bf){return new BPromise(function(_0x5c3830,_0x4f0b11){try{if(_0x5a54d0[_0xda8d('0x30')]){_0x5a54d0['Tags']=[];_0x5a54d0['TagIds'][_0xda8d('0x31')](',')[_0xda8d('0x32')](function(_0x3873bf){_0x5a54d0['Tags'][_0xda8d('0x33')](_0x1bd3bf[_0x3873bf]);});}delete _0x5a54d0['TagIds'];}catch(_0x5a8807){_0x4f0b11(_0x5a8807);}_0x5c3830(_0x5a54d0);});}function updateOpenchannelInteraction(_0x4f6de1,_0x3c2430,_0x157dc6){return new BPromise(function(_0x555d13,_0x14cd5a){return getInteractionUsers(_0x4f6de1,_0x157dc6)[_0xda8d('0x28')](function(_0x3ac54e){return getInteractionTags(_0x3ac54e,_0x3c2430);})[_0xda8d('0x28')](function(_0x15eab){_0x555d13(_0x15eab);})[_0xda8d('0x34')](function(_0x4f038e){_0x14cd5a(_0x4f038e);});});}exports[_0xda8d('0x35')]=function(_0x3d9953,_0x761bcf){var _0x38f6e0={},_0x2259ba={},_0x18e0a7={'count':0x0,'rows':[]};var _0x3a822c=_[_0xda8d('0x2e')](db[_0xda8d('0x36')][_0xda8d('0x37')],function(_0x51ac65){return{'name':_0x51ac65[_0xda8d('0x38')],'type':_0x51ac65[_0xda8d('0x39')][_0xda8d('0x3a')]};});_0x2259ba['model']=_[_0xda8d('0x2e')](_0x3a822c,'name');_0x2259ba[_0xda8d('0x3b')]=_[_0xda8d('0x3c')](_0x3d9953[_0xda8d('0x3b')]);_0x2259ba['filters']=_[_0xda8d('0x3d')](_0x2259ba[_0xda8d('0x3e')],_0x2259ba[_0xda8d('0x3b')]);_0x38f6e0['attributes']=_[_0xda8d('0x3d')](_0x2259ba['model'],qs['fields'](_0x3d9953['query'][_0xda8d('0x3f')]));_0x38f6e0[_0xda8d('0x40')]=_0x38f6e0[_0xda8d('0x40')][_0xda8d('0x41')]?_0x38f6e0[_0xda8d('0x40')]:_0x2259ba[_0xda8d('0x3e')];if(!_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x42')]('nolimit')){_0x38f6e0[_0xda8d('0x22')]=qs[_0xda8d('0x22')](_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x22')]);_0x38f6e0[_0xda8d('0x21')]=qs['offset'](_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x21')]);}_0x38f6e0['order']=qs['sort'](_0x3d9953['query'][_0xda8d('0x43')]);_0x38f6e0[_0xda8d('0x44')]=qs[_0xda8d('0x45')](_[_0xda8d('0x46')](_0x3d9953[_0xda8d('0x3b')],_0x2259ba[_0xda8d('0x45')]));var _0x40af3e=[];var _0x4630ab=squel[_0xda8d('0x47')]()[_0xda8d('0x48')]('id')[_0xda8d('0x48')](_0xda8d('0x2b'))[_0xda8d('0x48')](_0xda8d('0x49'))[_0xda8d('0x4a')](_0xda8d('0x4b'));var _0x3d4740=squel[_0xda8d('0x47')]()['field'](_0xda8d('0x4c'))[_0xda8d('0x48')]('u.fullname')[_0xda8d('0x48')](_0xda8d('0x4d'))[_0xda8d('0x4a')]('user_has_openchannel_interactions','ui')['left_join']('users','u',_0xda8d('0x4e'));var _0x3e4fa2=squel[_0xda8d('0x47')]()['from'](_0xda8d('0x4f'),'i')[_0xda8d('0x50')]('cm_contacts','c',_0xda8d('0x51'))[_0xda8d('0x50')](_0xda8d('0x52'),'o',_0xda8d('0x53'))[_0xda8d('0x50')](_0xda8d('0x54'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0xda8d('0x50')](_0xda8d('0x55'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xda8d('0x50')](_0xda8d('0x56'),'it',_0xda8d('0x57'))[_0xda8d('0x50')](_0xda8d('0x4b'),'t',_0xda8d('0x58'));var _0x4bff61=squel[_0xda8d('0x59')]();var _0x5bd939=[];var _0x219216=squel[_0xda8d('0x59')]();var _0xc1ed94;if(_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x5a')]){_0xc1ed94=as[_0xda8d('0x5b')](_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x5a')]);var _0x34bdb8=_0xc1ed94[_0xda8d('0x5c')];for(var _0xb0fa0b=0x0;_0xb0fa0b<_0xc1ed94[_0xda8d('0x5d')][_0xda8d('0x41')];_0xb0fa0b++){var _0x5a4279=_0xc1ed94[_0xda8d('0x5d')][_0xb0fa0b];var _0x1a4c5f='i';var _0x3d0aef=_[_0xda8d('0x5e')](_0x3a822c,['name',_0x5a4279[_0xda8d('0x48')]]);if(!_0x3d0aef){switch(_0x5a4279['field']){case _0xda8d('0x5f'):if(_0x5a4279[_0xda8d('0x60')]==0x1){_0x3e4fa2['having']('`'+_0x5a4279[_0xda8d('0x48')]+'`\x20=\x200');}else{_0x3e4fa2[_0xda8d('0x61')]('`'+_0x5a4279[_0xda8d('0x48')]+_0xda8d('0x62'));}break;case _0xda8d('0x63'):if(_0x5a4279[_0xda8d('0x64')]===_0xda8d('0x65')){if(_0x5a4279['value'][_0xda8d('0x31')]('\x20')['length']>0x1){_0x4bff61[_0x34bdb8](_0xda8d('0x66'),qs['getFullTextValue'](_0x5a4279['value']),null);}else{var _0x8c1aa4='%'+_0x5a4279[_0xda8d('0x60')]+'%';_0x4bff61[_0x34bdb8](_0xda8d('0x67'),_0x8c1aa4,_0x8c1aa4,_0x8c1aa4);}}else{_0x3d0aef=_[_0xda8d('0x5e')](_0x3a822c,[_0xda8d('0x2b'),_0xda8d('0x68')]);_0x5a4279[_0xda8d('0x48')]=_0xda8d('0x68');_0x1f66f0=as[_0xda8d('0x69')](_0x1a4c5f,_0x3d0aef[_0xda8d('0x39')],_0x5a4279);_0x4bff61[_0x34bdb8](_0x1f66f0['text'],_0x1f66f0['value'][_0xda8d('0x6a')],_0x1f66f0[_0xda8d('0x60')][_0xda8d('0x1e')]);}break;case _0xda8d('0x6b'):var _0x38c560=_0x5a4279[_0xda8d('0x60')][_0xda8d('0x31')](',')[_0xda8d('0x2e')](function(_0x84babf){return Number(_0x84babf);});_0x38c560[_0xda8d('0x32')](function(_0x554bf4){_0x219216['or'](_0xda8d('0x6c'),'%,'+_0x554bf4+',%');});_0x5bd939=_[_0xda8d('0x6d')](_0x5bd939,_0x38c560);break;case'User':if(_0x5a4279[_0xda8d('0x64')]==='$substring'){_0x4bff61[_0x34bdb8](_0xda8d('0x6e'),'%'+_0x5a4279[_0xda8d('0x60')]+'%',null);}else{_0x3d0aef=_[_0xda8d('0x5e')](_0x3a822c,['name',_0xda8d('0x6f')]);_0x5a4279[_0xda8d('0x48')]=_0xda8d('0x6f');_0x1f66f0=as[_0xda8d('0x69')](_0x1a4c5f,_0x3d0aef[_0xda8d('0x39')],_0x5a4279);_0x4bff61[_0x34bdb8](_0x1f66f0[_0xda8d('0x70')],_0x1f66f0['value'][_0xda8d('0x6a')],_0x1f66f0[_0xda8d('0x60')]['end']);}break;case _0xda8d('0x71'):_0x1f66f0=as['buildExpression']('me',null,_0x5a4279);_0x4bff61[_0x34bdb8](_0x1f66f0['text'],_0x1f66f0[_0xda8d('0x60')][_0xda8d('0x6a')],_0x1f66f0[_0xda8d('0x60')][_0xda8d('0x1e')]);break;}}else{var _0x1f66f0=as[_0xda8d('0x69')](_0x1a4c5f,_0x3d0aef[_0xda8d('0x39')],_0x5a4279);_0x4bff61[_0x34bdb8](_0x1f66f0[_0xda8d('0x70')],_0x1f66f0[_0xda8d('0x60')]['start'],_0x1f66f0[_0xda8d('0x60')][_0xda8d('0x1e')]);}}}else{var _0xde10b9=_(_0x3d9953[_0xda8d('0x3b')])['keys']()['map'](function(_0x4bc773){return _[_0xda8d('0x72')](_0x3a822c,[_0xda8d('0x2b'),_0x4bc773])?_0x4bc773:undefined;})[_0xda8d('0x73')]()[_0xda8d('0x60')]();if(!_[_0xda8d('0x74')](_0xde10b9)){_0xde10b9[_0xda8d('0x32')](function(_0x1491dd){if(_0x1491dd===_0xda8d('0x75')){_0x3e4fa2[_0xda8d('0x44')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xda8d('0x76')](_0x3d9953['query'][_0x1491dd]));}else if(_0x1491dd==='createdAt'){var _0x2379e9=JSON[_0xda8d('0x77')](_0x3d9953[_0xda8d('0x3b')][_0x1491dd])[_0xda8d('0x78')];var _0x31711f=JSON[_0xda8d('0x77')](_0x3d9953[_0xda8d('0x3b')][_0x1491dd])[_0xda8d('0x79')];_0x3e4fa2[_0xda8d('0x44')](_0xda8d('0x7a'),_0x2379e9,_0x31711f);}else{if(_0x3d9953[_0xda8d('0x3b')][_0x1491dd]===_0xda8d('0x7b')){_0x3e4fa2[_0xda8d('0x44')]('i.'+_0x1491dd+_0xda8d('0x7c'));}else{_0x3e4fa2[_0xda8d('0x44')]('i.'+_0x1491dd+_0xda8d('0x7d'),_0x3d9953[_0xda8d('0x3b')][_0x1491dd]);}}});}if(_0x3d9953['query'][_0xda8d('0x7e')]){if(_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x7e')]==0x1){_0x3e4fa2[_0xda8d('0x61')]('`unreadMessages`\x20=\x200');}else{_0x3e4fa2['having'](_0xda8d('0x7f'));}}if(_0x3d9953['query'][_0xda8d('0x80')]){_0x5bd939=_['isArray'](_0x3d9953['query']['tag'])?_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x80')]:new Array(_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x80')]);_0x5bd939['forEach'](function(_0x5f4cb6){_0x219216['or'](_0xda8d('0x6c'),'%,'+_0x5f4cb6+',%');});}if(_0x3d9953[_0xda8d('0x3b')]['filter']){var _0x5c8b43=_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x81')][_0xda8d('0x82')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0xda8d('0x83'));if(qs['isNumeric'](_0x5c8b43)){_0x4bff61['or'](_0xda8d('0x84'),_0x5c8b43+'%');}else{_0x4bff61['or'](_0xda8d('0x85'),qs[_0xda8d('0x86')](_0x5c8b43))['or'](_0xda8d('0x87'),_0x5c8b43+'%')['or'](_0xda8d('0x88'),_0x5c8b43+'%');}}}_0x3e4fa2[_0xda8d('0x44')](_0x4bff61);_0x3e4fa2[_0xda8d('0x89')]('i.id');var _0x41f0ac={'type':db['Sequelize'][_0xda8d('0x8a')][_0xda8d('0x8b')],'raw':!![]};var _0x572a22=_0x3e4fa2[_0xda8d('0x8c')]();_0x572a22[_0xda8d('0x48')](_0xda8d('0x8d'));_0x572a22[_0xda8d('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xda8d('0x5f'));if(_0x38f6e0[_0xda8d('0x8e')]){_0x38f6e0[_0xda8d('0x8e')][_0xda8d('0x32')](function(_0x30615a){_0x3e4fa2[_0xda8d('0x8e')]('i.'+_0x30615a[0x0],_0x30615a[0x1]===_0xda8d('0x8f')?![]:!![]);});}if(!_['isEmpty'](_0x5bd939)){_0x3e4fa2[_0xda8d('0x61')](_0x219216);_0x572a22['where'](_0xda8d('0x90'),_0x5bd939);}BPromise[_0xda8d('0x91')]()[_0xda8d('0x28')](function(){if(!_0xc1ed94&&_0x3d9953[_0xda8d('0x3b')]['OpenchannelAccountId'])return;return _0x3d9953[_0xda8d('0x92')][_0xda8d('0x93')]({'attributes':['id'],'raw':!![]})[_0xda8d('0x28')](function(_0x4f2668){if(_[_0xda8d('0x74')](_0x4f2668)){_0x572a22[_0xda8d('0x44')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x3e4fa2[_0xda8d('0x44')](_0xda8d('0x94'));}else{_0x572a22[_0xda8d('0x44')](_0xda8d('0x95'),_[_0xda8d('0x2e')](_0x4f2668,'id'));_0x3e4fa2[_0xda8d('0x44')](_0xda8d('0x95'),_[_0xda8d('0x2e')](_0x4f2668,'id'));}});})[_0xda8d('0x28')](function(){db[_0xda8d('0x96')][_0xda8d('0x3b')](_0x572a22[_0xda8d('0x97')](),_0x41f0ac)[_0xda8d('0x28')](function(_0x4ebfa7){_0x18e0a7[_0xda8d('0x20')]=_0x4ebfa7[_0xda8d('0x41')];if(_0x18e0a7[_0xda8d('0x20')]===0x0)return[];return db[_0xda8d('0x96')][_0xda8d('0x3b')](_0x4630ab['toString'](),_0x41f0ac)[_0xda8d('0x28')](function(_0x27b372){_0x40af3e=_[_0xda8d('0x98')](_0x27b372,'id');_0x41f0ac=_[_0xda8d('0x99')](_0x41f0ac,{'model':db[_0xda8d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3d9953[_0xda8d('0x3b')][_0xda8d('0x3f')]){_0x38f6e0[_0xda8d('0x40')][_0xda8d('0x32')](function(_0x2216bb){_0x3e4fa2[_0xda8d('0x48')]('i.'+_0x2216bb);});}else{_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0x9a'),'unreadMessages');_0x3e4fa2[_0xda8d('0x48')]('a.key',_0xda8d('0x9b'));_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0x9c'),'Account.mandatoryDisposition');_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0x9d'));_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0x9e'),_0xda8d('0x9f'));_0x3e4fa2['field'](_0xda8d('0xa0'),_0xda8d('0xa1'));_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0xa2'),_0xda8d('0xa3'));_0x3e4fa2['field'](_0xda8d('0xa4'),'Contact.phone');_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0xa5'),_0xda8d('0xa6'));_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0xa7'),_0xda8d('0xa8'));_0x3e4fa2[_0xda8d('0x48')]('o.fullname',_0xda8d('0xa9'));_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0xaa'),_0xda8d('0xab'));_0x3e4fa2[_0xda8d('0x48')](_0xda8d('0xac'),'TagIds');}_0x3e4fa2[_0xda8d('0x22')](_0x38f6e0['limit']);_0x3e4fa2[_0xda8d('0x21')](_0x38f6e0[_0xda8d('0x21')]);return db[_0xda8d('0x96')][_0xda8d('0x3b')](_0x3e4fa2[_0xda8d('0x97')](),_0x41f0ac);})[_0xda8d('0x28')](function(_0x175df7){_0x3d4740['where'](_0xda8d('0xad'),_['map'](_0x175df7,'id'));return db[_0xda8d('0x96')]['query'](_0x3d4740[_0xda8d('0x97')](),_0x41f0ac)['then'](function(_0x526efd){var _0x4f556e=_[_0xda8d('0xae')](_0x526efd,_0xda8d('0xaf'));var _0xcb0c9=[];_0x175df7[_0xda8d('0x32')](function(_0x2e54f9){_0xcb0c9[_0xda8d('0x33')](updateOpenchannelInteraction(_0x2e54f9,_0x40af3e,_0x4f556e));});return BPromise[_0xda8d('0xb0')](_0xcb0c9);});});})[_0xda8d('0x28')](function(_0x5bdf17){_0x18e0a7['rows']=_0x5bdf17;return _0x18e0a7;})[_0xda8d('0x28')](respondWithFilteredResult(_0x761bcf,_0x38f6e0));})[_0xda8d('0x34')](handleError(_0x761bcf,null));};exports['show']=function(_0x144845,_0x4f71b4){var _0x16e3c4={'raw':![],'where':{'id':_0x144845['params']['id']}},_0x2848b3={};_0x2848b3[_0xda8d('0x3e')]=_[_0xda8d('0x3c')](db[_0xda8d('0x36')][_0xda8d('0x37')]);_0x2848b3['query']=_[_0xda8d('0x3c')](_0x144845['query']);_0x2848b3[_0xda8d('0x45')]=_['intersection'](_0x2848b3['model'],_0x2848b3[_0xda8d('0x3b')]);_0x16e3c4['attributes']=_['intersection'](_0x2848b3[_0xda8d('0x3e')],qs[_0xda8d('0x3f')](_0x144845['query'][_0xda8d('0x3f')]));_0x16e3c4[_0xda8d('0x40')]=_0x16e3c4[_0xda8d('0x40')]['length']?_0x16e3c4[_0xda8d('0x40')]:_0x2848b3['model'];if(_0x144845[_0xda8d('0x3b')]['includeAll']){_0x16e3c4['include']=[{'all':!![]}];}_0x16e3c4=_[_0xda8d('0x99')]({},_0x16e3c4,_0x144845[_0xda8d('0xb1')]);return db[_0xda8d('0x36')]['find'](_0x16e3c4)[_0xda8d('0x28')](handleEntityNotFound(_0x4f71b4,null))[_0xda8d('0x28')](respondWithResult(_0x4f71b4,null))[_0xda8d('0x34')](handleError(_0x4f71b4,null));};exports[_0xda8d('0xb2')]=function(_0x18d0dc,_0x3b7fa4){return db[_0xda8d('0x36')][_0xda8d('0xb2')](_0x18d0dc[_0xda8d('0x71')],{})[_0xda8d('0x28')](respondWithResult(_0x3b7fa4,0xc9))[_0xda8d('0x34')](handleError(_0x3b7fa4,null));};exports[_0xda8d('0x27')]=function(_0x5bc8da,_0x22db9b){if(_0x5bc8da['body']['id']){delete _0x5bc8da['body']['id'];}return db['OpenchannelInteraction'][_0xda8d('0x5e')]({'where':{'id':_0x5bc8da[_0xda8d('0xb3')]['id']}})['then'](handleEntityNotFound(_0x22db9b,null))['then'](saveUpdates(_0x5bc8da[_0xda8d('0x71')],null))[_0xda8d('0x28')](respondWithResult(_0x22db9b,null))[_0xda8d('0x34')](handleError(_0x22db9b,null));};exports[_0xda8d('0xb4')]=function(_0x17931c,_0x3e4d29){return db[_0xda8d('0x36')][_0xda8d('0x5e')]({'where':{'id':_0x17931c[_0xda8d('0xb3')]['id']}})['then'](handleEntityNotFound(_0x3e4d29,null))['then'](removeEntity(_0x3e4d29,null))[_0xda8d('0x34')](handleError(_0x3e4d29,null));};exports[_0xda8d('0xb5')]=function(_0x5791d7,_0x519673){return db[_0xda8d('0x36')][_0xda8d('0xb5')]()['then'](respondWithResult(_0x519673,null))[_0xda8d('0x34')](handleError(_0x519673,null));};exports['addMessage']=function(_0x5e440f,_0x2bc6ee,_0x3a075d){return db['OpenchannelMessage']['find']({'where':{'id':_0x5e440f[_0xda8d('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2bc6ee,null))[_0xda8d('0x28')](function(_0x2a11ae){if(_0x2a11ae){return _0x2a11ae[_0xda8d('0xb6')](_0x5e440f[_0xda8d('0x71')]['ids'],_[_0xda8d('0xb7')](_0x5e440f[_0xda8d('0x71')],[_0xda8d('0xb8'),'id'])||{});}})[_0xda8d('0x28')](respondWithResult(_0x2bc6ee,null))[_0xda8d('0x34')](handleError(_0x2bc6ee,null));};exports[_0xda8d('0xb9')]=function(_0x358629,_0x280016,_0x5c8c7e){var _0x3419fa={'raw':![],'where':{}};var _0x33b3d4={};var _0x319fff={'count':0x0,'rows':[]};return db[_0xda8d('0x36')][_0xda8d('0xba')]({'where':{'id':_0x358629[_0xda8d('0xb3')]['id']}})[_0xda8d('0x28')](handleEntityNotFound(_0x280016,null))[_0xda8d('0x28')](function(_0x2a16f6){if(_0x2a16f6){_0x33b3d4[_0xda8d('0x3e')]=_[_0xda8d('0x3c')](db[_0xda8d('0xbb')][_0xda8d('0x37')]);_0x33b3d4[_0xda8d('0x3b')]=_[_0xda8d('0x3c')](_0x358629[_0xda8d('0x3b')]);_0x33b3d4[_0xda8d('0x45')]=_['intersection'](_0x33b3d4['model'],_0x33b3d4[_0xda8d('0x3b')]);_0x3419fa['attributes']=_[_0xda8d('0x3d')](_0x33b3d4['model'],qs[_0xda8d('0x3f')](_0x358629[_0xda8d('0x3b')][_0xda8d('0x3f')]));_0x3419fa[_0xda8d('0x40')]=_0x3419fa[_0xda8d('0x40')][_0xda8d('0x41')]?_0x3419fa['attributes']:_0x33b3d4[_0xda8d('0x3e')];if(!_0x358629['query']['hasOwnProperty']('nolimit')){_0x3419fa['limit']=qs[_0xda8d('0x22')](_0x358629[_0xda8d('0x3b')][_0xda8d('0x22')]);_0x3419fa['offset']=qs[_0xda8d('0x21')](_0x358629[_0xda8d('0x3b')][_0xda8d('0x21')]);}_0x3419fa['order']=qs[_0xda8d('0x43')](_0x358629[_0xda8d('0x3b')]['sort']);_0x3419fa[_0xda8d('0x44')]=qs['filters'](_[_0xda8d('0x46')](_0x358629[_0xda8d('0x3b')],_0x33b3d4['filters']));_0x3419fa[_0xda8d('0x44')]['OpenchannelInteractionId']=_0x2a16f6['id'];if(_0x358629[_0xda8d('0x3b')]['filter']){_0x3419fa['where']=_['merge'](_0x3419fa['where'],{'$or':_['map'](_0x3419fa[_0xda8d('0x40')],function(_0x2d48fd){var _0x36f607={};_0x36f607[_0x2d48fd]={'$like':'%'+_0x358629[_0xda8d('0x3b')][_0xda8d('0x81')]+'%'};return _0x36f607;})});}if(_0x358629[_0xda8d('0x3b')]['$gte']){var _0x34e87f=_0x358629[_0xda8d('0x3b')]['$gte'][_0xda8d('0x31')](',');var _0x424d2e={};_0x424d2e[_0x34e87f[0x0]]={'$gte':moment(_0x34e87f[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3419fa[_0xda8d('0x44')]=_[_0xda8d('0x99')](_0x3419fa['where'],_0x424d2e);}_0x3419fa=_[_0xda8d('0x99')]({},_0x3419fa,_0x358629[_0xda8d('0xb1')]);return db[_0xda8d('0xbb')]['count']({'where':_0x3419fa[_0xda8d('0x44')]})['then'](function(_0x283585){_0x319fff[_0xda8d('0x20')]=_0x283585;if(_0x358629[_0xda8d('0x3b')][_0xda8d('0xbc')]){_0x3419fa['include']=[{'all':!![]}];}return db[_0xda8d('0xbb')][_0xda8d('0xbd')](_0x3419fa);})[_0xda8d('0x28')](function(_0x357f73){_0x319fff[_0xda8d('0xbe')]=_0x357f73;return _0x319fff;});}})[_0xda8d('0x28')](respondWithFilteredResult(_0x280016,_0x3419fa))[_0xda8d('0x34')](handleError(_0x280016,null));};exports['addTags']=function(_0x19c0e8,_0xa2278,_0x3101d7){return db[_0xda8d('0x36')][_0xda8d('0x5e')]({'where':{'id':_0x19c0e8[_0xda8d('0xb3')]['id']}})[_0xda8d('0x28')](handleEntityNotFound(_0xa2278,null))[_0xda8d('0x28')](function(_0x933d7){if(_0x933d7){return _0x933d7[_0xda8d('0xbf')](_0x19c0e8[_0xda8d('0x71')]['ids'],_[_0xda8d('0xb7')](_0x19c0e8[_0xda8d('0x71')],[_0xda8d('0xb8'),'id'])||{})[_0xda8d('0xc0')](function(){return db['Tag'][_0xda8d('0xbd')]({'attributes':['id',_0xda8d('0x2b'),'color'],'where':{'id':_0x19c0e8['body'][_0xda8d('0xb8')]}});})['then'](function(_0x4f1a6){socket['emit']('openchannelInteractionTags:save',{'id':Number(_0x19c0e8[_0xda8d('0xb3')]['id']),'tags':_0x4f1a6||[]});return{'id':Number(_0x19c0e8[_0xda8d('0xb3')]['id']),'tags':_0x4f1a6||[]};});}})[_0xda8d('0x28')](respondWithResult(_0xa2278,null))[_0xda8d('0x34')](handleError(_0xa2278,null));};exports[_0xda8d('0xc1')]=function(_0x1a1743,_0x59e017,_0x2bb191){return db[_0xda8d('0x36')][_0xda8d('0x5e')]({'where':{'id':_0x1a1743['params']['id']}})[_0xda8d('0x28')](handleEntityNotFound(_0x59e017,null))[_0xda8d('0x28')](function(_0x56c679){if(_0x56c679){return _0x56c679[_0xda8d('0xc1')](_0x1a1743['query'][_0xda8d('0xb8')]);}})['then'](respondWithStatusCode(_0x59e017,null))[_0xda8d('0x34')](handleError(_0x59e017,null));};exports['download']=function(_0x2b63ba,_0x1b97e6){var _0x394956=moment()[_0xda8d('0xc2')]()[_0xda8d('0x97')]();var _0x3dd31c=path[_0xda8d('0xc3')](config[_0xda8d('0xc4')],_0xda8d('0xc5'),_0xda8d('0xc6'),'tmp');var _0xd67f8=path['join'](config[_0xda8d('0xc4')],_0xda8d('0xc5'),_0xda8d('0xc6'),_0xda8d('0xc7'));var _0x49987e=path[_0xda8d('0xc3')](_0x3dd31c,_0x394956);var _0x5967af=util[_0xda8d('0xc8')](_0xda8d('0xc9'),_0x2b63ba['params']['id'],_0x394956);var _0x3fcd37=path[_0xda8d('0xc3')](_0x3dd31c,_0x5967af);var _0x21c994=[];_0x21c994['push']({'model':db[_0xda8d('0xca')],'as':'User','attributes':['id',_0xda8d('0x2f')],'raw':!![]});_0x21c994[_0xda8d('0x33')]({'model':db[_0xda8d('0xcb')],'as':_0xda8d('0x63'),'attributes':['id',_0xda8d('0xcc'),_0xda8d('0xcd')],'raw':!![]});if(_0x2b63ba['query'][_0xda8d('0xc7')]){_0x21c994['push']({'model':db[_0xda8d('0xce')],'as':'Attachment','raw':!![]});}var _0x11a851=[{'model':db[_0xda8d('0xbb')],'as':_0xda8d('0xcf'),'attributes':['id',_0xda8d('0x71'),_0xda8d('0xd0'),_0xda8d('0xd1'),_0xda8d('0xd2'),_0xda8d('0x7e')],'include':_0x21c994}];_0x11a851[_0xda8d('0x33')]({'model':db[_0xda8d('0xd3')],'as':_0xda8d('0xd4'),'attributes':['id',_0xda8d('0x2b')]});_0x11a851[_0xda8d('0x33')]({'model':db[_0xda8d('0xca')],'as':'Owner','attributes':['id','fullname']});return db[_0xda8d('0x36')][_0xda8d('0x5e')]({'where':{'id':_0x2b63ba[_0xda8d('0xb3')]['id']},'include':_0x11a851})[_0xda8d('0x28')](handleEntityNotFound(_0x1b97e6,null))[_0xda8d('0x28')](function(_0x325029){if(_0x325029){var _0x4a73cc=_0x325029[_0xda8d('0xd5')]({'plain':!![]});fs[_0xda8d('0xd6')](_0x49987e);var _0x4219d2={'format':'A4','border':_0xda8d('0xd7'),'header':{'height':'40px','contents':{'first':_0xda8d('0xd8')}},'footer':{'height':_0xda8d('0xd9'),'contents':{'default':util['format'](_0xda8d('0xda'),util['format']('%s\x20#%d','Openchannel',_0x4a73cc['id']),moment()[_0xda8d('0xc8')](_0xda8d('0xdb'))['toString']())}}};var _0x4db8f5={'channel':_0xda8d('0xdc'),'account':_0x4a73cc[_0xda8d('0xd4')][_0xda8d('0x2b')],'agent':_0x4a73cc[_0xda8d('0xdd')]?_0x4a73cc[_0xda8d('0xdd')][_0xda8d('0x2f')]:_0xda8d('0xde'),'createdAt':moment(_0x4a73cc[_0xda8d('0xd0')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xda8d('0x97')](),'closedAt':_0x4a73cc['closed']?moment(_0x4a73cc[_0xda8d('0xdf')])[_0xda8d('0xc8')](_0xda8d('0xe0'))[_0xda8d('0x97')]():'','disposition':_0x4a73cc[_0xda8d('0xe1')],'visibility':_0x4a73cc[_0xda8d('0xe2')]?'Public':'Private','messages':_(_0x4a73cc['Messages'])[_0xda8d('0x81')]({'secret':![]})[_0xda8d('0x2e')](function(_0x17df2b){if(_0x17df2b[_0xda8d('0xce')]){var _0x2f9936=path[_0xda8d('0xc3')](_0xd67f8,_0x17df2b[_0xda8d('0xce')][_0xda8d('0xe3')]);if(fs[_0xda8d('0xe4')](_0x2f9936)){fs[_0xda8d('0xe5')](_0x2f9936)[_0xda8d('0xe6')](fs['createWriteStream'](path[_0xda8d('0xc3')](_0x49987e,_0x17df2b[_0xda8d('0xce')][_0xda8d('0xe3')])));}}return{'date':moment(_0x17df2b[_0xda8d('0xd0')])[_0xda8d('0xc8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xda8d('0x97')](),'sender':_0x17df2b[_0xda8d('0xd1')]===_0xda8d('0xe7')?_0x17df2b[_0xda8d('0xca')]?_0x17df2b[_0xda8d('0xca')]['fullname']:_0xda8d('0xe8'):_0x17df2b[_0xda8d('0x63')]['firstName']+(_0x17df2b[_0xda8d('0x63')][_0xda8d('0xcd')]?'\x20'+_0x17df2b[_0xda8d('0x63')][_0xda8d('0xcd')]:''),'body':_0x17df2b[_0xda8d('0xce')]?_0x17df2b['Attachment']['basename']:_0x17df2b['body'],'direction':_0x17df2b[_0xda8d('0xd1')]===_0xda8d('0xe7')?'A':'C','secret':_0x17df2b[_0xda8d('0xd2')],'read':_0x17df2b[_0xda8d('0x7e')],'attachment':_0x17df2b[_0xda8d('0xce')]};})[_0xda8d('0x60')]()};return ejs['renderFile'](path[_0xda8d('0xc3')](config[_0xda8d('0xc4')],_0xda8d('0xc5'),'views',_0xda8d('0xe9')),{'interaction':_0x4db8f5})[_0xda8d('0x28')](function(_0x498087){return new BPromise(function(_0x22078c,_0x330e75){pdf[_0xda8d('0xb2')](_0x498087,_0x4219d2)[_0xda8d('0xea')](path[_0xda8d('0xc3')](_0x49987e,_0xda8d('0xeb')+_0x4a73cc['id']+'-'+_0x394956+_0xda8d('0xec')),function(_0x5ad5e7,_0x56da71){if(_0x5ad5e7)return _0x330e75(_0x5ad5e7);_0x22078c(_0x56da71);});});})['then'](function(){return new BPromise(function(_0x4d24f5,_0x164047){zipdir(_0x49987e,{'saveTo':_0x3fcd37},function(_0x22122a,_0x4ce9fe){if(_0x22122a)return _0x164047(_0x22122a);return _0x4d24f5(_0x4ce9fe);});})[_0xda8d('0x28')](function(){return new BPromise(function(_0xff86b4,_0x2fafec){rimraf(_0x49987e,function(_0xd934d1){if(_0xd934d1)_0x2fafec(_0xd934d1);return _0xff86b4();});});})['then'](function(){return _0x1b97e6[_0xda8d('0xed')](_0x3fcd37,_0x5967af,function(_0x289952){if(_0x289952){console['log'](_0xda8d('0xee'),_0x289952);}else{fs['unlinkSync'](_0x3fcd37);}});});});}else{return _0x1b97e6[_0xda8d('0x1c')](0xc8);}})[_0xda8d('0x34')](handleError(_0x1b97e6,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 542910e..50e2a69 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 _0xb9a9=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','events'];(function(_0x5e5c94,_0x183718){var _0x12cc64=function(_0x435549){while(--_0x435549){_0x5e5c94['push'](_0x5e5c94['shift']());}};_0x12cc64(++_0x183718);}(_0xb9a9,0x143));var _0x9b9a=function(_0x4baddc,_0x561460){_0x4baddc=_0x4baddc-0x0;var _0x195522=_0xb9a9[_0x4baddc];return _0x195522;};'use strict';var EventEmitter=require(_0x9b9a('0x0'));var OpenchannelInteraction=require(_0x9b9a('0x1'))['db'][_0x9b9a('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x9b9a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9b9a('0x4')](0x0);var events={'afterCreate':_0x9b9a('0x5'),'afterUpdate':_0x9b9a('0x6'),'afterDestroy':_0x9b9a('0x7')};function emitEvent(_0x2fbf2c){return function(_0x583182,_0x233e84,_0x93e24d){_0x583182[_0x9b9a('0x8')]({'attributes':['id'],'raw':!![]})[_0x9b9a('0x9')](function(_0x29a4f0){_0x583182['setDataValue']('Users',_0x29a4f0[_0x9b9a('0xa')](function(_0xd02b87){return{'id':_0xd02b87['id']};}));return OpenchannelMessage[_0x9b9a('0xb')]({'where':{'OpenchannelInteractionId':_0x583182['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9b9a('0x9')](function(_0x4a7b69){_0x583182[_0x9b9a('0xc')](_0x9b9a('0xd'),_0x4a7b69['length']);OpenchannelInteractionEvents[_0x9b9a('0xe')](_0x2fbf2c+':'+_0x583182['id'],_0x583182);OpenchannelInteractionEvents[_0x9b9a('0xe')](_0x2fbf2c,_0x583182);_0x93e24d(null);})[_0x9b9a('0xf')](_0x93e24d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x9b9a('0x10')](e,emitEvent(event));}}module[_0x9b9a('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xd754=['then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hook','exports','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','update','remove','getUsers'];(function(_0xc24da,_0x5409f3){var _0x39b847=function(_0x4a8f3a){while(--_0x4a8f3a){_0xc24da['push'](_0xc24da['shift']());}};_0x39b847(++_0x5409f3);}(_0xd754,0x1bb));var _0x4d75=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xd754[_0x1cfa0d];return _0xe33279;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x4d75('0x0'))['db'][_0x4d75('0x1')];var OpenchannelMessage=require(_0x4d75('0x0'))['db'][_0x4d75('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4d75('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4d75('0x4'),'afterDestroy':_0x4d75('0x5')};function emitEvent(_0x20b534){return function(_0x5c78f1,_0x2bd104,_0xcbab25){_0x5c78f1[_0x4d75('0x6')]({'attributes':['id'],'raw':!![]})[_0x4d75('0x7')](function(_0x461d88){_0x5c78f1[_0x4d75('0x8')](_0x4d75('0x9'),_0x461d88[_0x4d75('0xa')](function(_0x191a16){return{'id':_0x191a16['id']};}));return OpenchannelMessage[_0x4d75('0xb')]({'where':{'OpenchannelInteractionId':_0x5c78f1['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x173fd6){_0x5c78f1[_0x4d75('0x8')](_0x4d75('0xc'),_0x173fd6[_0x4d75('0xd')]);OpenchannelInteractionEvents[_0x4d75('0xe')](_0x20b534+':'+_0x5c78f1['id'],_0x5c78f1);OpenchannelInteractionEvents['emit'](_0x20b534,_0x5c78f1);_0xcbab25(null);})[_0x4d75('0xf')](_0xcbab25(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x4d75('0x10')](e,emitEvent(event));}}module[_0x4d75('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 17f2f28..633b928 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 _0x3937=['path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird'];(function(_0x46482b,_0x3ca30e){var _0x4826b3=function(_0x188524){while(--_0x188524){_0x46482b['push'](_0x46482b['shift']());}};_0x4826b3(++_0x3ca30e);}(_0x3937,0xbf));var _0x7393=function(_0x385dde,_0x18b8fc){_0x385dde=_0x385dde-0x0;var _0x34b250=_0x3937[_0x385dde];return _0x34b250;};'use strict';var _=require(_0x7393('0x0'));var util=require('util');var logger=require(_0x7393('0x1'))(_0x7393('0x2'));var moment=require('moment');var BPromise=require(_0x7393('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7393('0x4'));var rimraf=require('rimraf');var config=require(_0x7393('0x5'));var attributes=require(_0x7393('0x6'));module[_0x7393('0x7')]=function(_0x1f538f,_0x15eabd){return _0x1f538f[_0x7393('0x8')](_0x7393('0x9'),attributes,{'tableName':_0x7393('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x944b0b,_0x4efb50,_0x565ab6){if(_0x944b0b[_0x7393('0xb')](_0x7393('0xc'))){_0x944b0b[_0x7393('0xd')]=moment()['format'](_0x7393('0xe'));}_0x565ab6(null,_0x944b0b);}}});}; \ No newline at end of file +var _0xb46f=['OpenchannelInteraction','format','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','define'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb46f,0xb6));var _0xfb46=function(_0x14338f,_0x40f5b8){_0x14338f=_0x14338f-0x0;var _0x3dff02=_0xb46f[_0x14338f];return _0x3dff02;};'use strict';var _=require(_0xfb46('0x0'));var util=require(_0xfb46('0x1'));var logger=require('../../config/logger')(_0xfb46('0x2'));var moment=require(_0xfb46('0x3'));var BPromise=require(_0xfb46('0x4'));var rp=require(_0xfb46('0x5'));var fs=require('fs');var path=require(_0xfb46('0x6'));var rimraf=require('rimraf');var config=require(_0xfb46('0x7'));var attributes=require('./openchannelInteraction.attributes');module[_0xfb46('0x8')]=function(_0x3a5255,_0x186da6){return _0x3a5255[_0xfb46('0x9')](_0xfb46('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9871f5,_0x298a84,_0x4b1a94){if(_0x9871f5['changed']('closed')){_0x9871f5['closedAt']=moment()[_0xfb46('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4b1a94(null,_0x9871f5);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index bce0960..7fb6c4e 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 _0x875e=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','raw','where','attributes','limit','then','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','ioredis'];(function(_0x57fbfb,_0x222cde){var _0x151099=function(_0x3292bd){while(--_0x3292bd){_0x57fbfb['push'](_0x57fbfb['shift']());}};_0x151099(++_0x222cde);}(_0x875e,0x196));var _0xe875=function(_0x35335f,_0x4861ff){_0x35335f=_0x35335f-0x0;var _0x4a9103=_0x875e[_0x35335f];return _0x4a9103;};'use strict';var _=require(_0xe875('0x0'));var util=require(_0xe875('0x1'));var moment=require(_0xe875('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe875('0x3'));var db=require(_0xe875('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe875('0x5'))(_0xe875('0x6'));var config=require(_0xe875('0x7'));var jayson=require(_0xe875('0x8'));var client=jayson[_0xe875('0x9')][_0xe875('0xa')]({'port':0x232a});config[_0xe875('0xb')]=_[_0xe875('0xc')](config[_0xe875('0xb')],{'host':_0xe875('0xd'),'port':0x18eb});var socket=require(_0xe875('0xe'))(new Redis(config[_0xe875('0xb')]));require(_0xe875('0xf'))['register'](socket);function respondWithRpcPromise(_0x4fd9c9,_0x3aab36,_0x26e345){return new BPromise(function(_0x5b25c9,_0x288cbb){return client['request'](_0x4fd9c9,_0x26e345)['then'](function(_0x20eb54){logger[_0xe875('0x10')](_0xe875('0x11'),_0x3aab36,_0xe875('0x12'));logger[_0xe875('0x13')](_0xe875('0x14'),_0x3aab36,'request\x20sent',JSON['stringify'](_0x20eb54));if(_0x20eb54['error']){if(_0x20eb54['error']['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3aab36,_0x20eb54[_0xe875('0x15')]['message']);return _0x288cbb(_0x20eb54[_0xe875('0x15')][_0xe875('0x16')]);}logger[_0xe875('0x15')](_0xe875('0x11'),_0x3aab36,_0x20eb54[_0xe875('0x15')][_0xe875('0x16')]);return _0x5b25c9(_0x20eb54[_0xe875('0x15')][_0xe875('0x16')]);}else{logger[_0xe875('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3aab36,_0xe875('0x12'));_0x5b25c9(_0x20eb54[_0xe875('0x17')][_0xe875('0x16')]);}})[_0xe875('0x18')](function(_0x461feb){logger[_0xe875('0x15')](_0xe875('0x11'),_0x3aab36,_0x461feb);_0x288cbb(_0x461feb);});});}exports['UpdateOpenchannelInteraction']=function(_0x3a833e){var _0x1f72d8=this;return new Promise(function(_0x4d029d,_0x21bc6e){return db['OpenchannelInteraction'][_0xe875('0x19')](_0x3a833e[_0xe875('0x1a')],{'raw':_0x3a833e[_0xe875('0x1b')]?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a833e[_0xe875('0x1b')]?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1d')]||null:null,'attributes':_0x3a833e['options']?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1e')]||null:null,'limit':_0x3a833e[_0xe875('0x1b')]?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1f')]||null:null})[_0xe875('0x20')](function(_0x2a0f9c){logger[_0xe875('0x10')](_0xe875('0x21'),_0x3a833e);logger[_0xe875('0x13')](_0xe875('0x21'),_0x3a833e,JSON[_0xe875('0x22')](_0x2a0f9c));_0x4d029d(_0x2a0f9c);})[_0xe875('0x18')](function(_0x28b222){logger[_0xe875('0x15')](_0xe875('0x21'),_0x28b222['message'],_0x3a833e);_0x21bc6e(_0x1f72d8[_0xe875('0x15')](0x1f4,_0x28b222[_0xe875('0x16')]));});});};exports[_0xe875('0x23')]=function(_0x4a4f41){return new Promise(function(_0x4f3c05,_0x57eb1b){return db['OpenchannelInteraction'][_0xe875('0x24')]({'where':_0x4a4f41[_0xe875('0x1b')]?_0x4a4f41[_0xe875('0x1b')]['where']||null:null})[_0xe875('0x20')](function(_0x3dfc1d){if(_0x3dfc1d){return _0x3dfc1d['addTags'](_0x4a4f41[_0xe875('0x1a')][_0xe875('0x25')],_[_0xe875('0x26')](_0x4a4f41[_0xe875('0x1a')],[_0xe875('0x25'),'id'])||{});}})[_0xe875('0x27')](function(_0x3023d6){logger['info'](_0xe875('0x28'),_0x4a4f41);logger[_0xe875('0x13')](_0xe875('0x28'),_0x4a4f41,JSON[_0xe875('0x22')](_0x3023d6));_0x4f3c05(_0x3023d6);})[_0xe875('0x18')](function(_0x11e9bd){logger[_0xe875('0x15')](_0xe875('0x28'),_0x11e9bd[_0xe875('0x16')],_0x4a4f41);_0x57eb1b(_this[_0xe875('0x15')](0x1f4,_0x11e9bd[_0xe875('0x16')]));});});}; \ No newline at end of file +var _0x61f1=['register','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelInteraction','update','body','options','where','attributes','limit','UpdateOpenchannelInteraction','ids','AddTags','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','socket.io-emitter','./openchannelInteraction.socket'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0x61f1,0x96));var _0x161f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x61f1[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x161f('0x0'));var fs=require('fs');var Redis=require(_0x161f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x161f('0x2'));var logger=require(_0x161f('0x3'))(_0x161f('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x161f('0x5')]['http']({'port':0x232a});config[_0x161f('0x6')]=_[_0x161f('0x7')](config[_0x161f('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0x161f('0x8'))(new Redis(config[_0x161f('0x6')]));require(_0x161f('0x9'))[_0x161f('0xa')](socket);function respondWithRpcPromise(_0x52851a,_0x1d4bca,_0x467eca){return new BPromise(function(_0x27a909,_0x581ed2){return client[_0x161f('0xb')](_0x52851a,_0x467eca)[_0x161f('0xc')](function(_0x33179d){logger[_0x161f('0xd')](_0x161f('0xe'),_0x1d4bca,_0x161f('0xf'));logger['debug'](_0x161f('0x10'),_0x1d4bca,_0x161f('0xf'),JSON[_0x161f('0x11')](_0x33179d));if(_0x33179d[_0x161f('0x12')]){if(_0x33179d[_0x161f('0x12')][_0x161f('0x13')]===0x1f4){logger[_0x161f('0x12')](_0x161f('0xe'),_0x1d4bca,_0x33179d[_0x161f('0x12')][_0x161f('0x14')]);return _0x581ed2(_0x33179d[_0x161f('0x12')][_0x161f('0x14')]);}logger['error'](_0x161f('0xe'),_0x1d4bca,_0x33179d['error'][_0x161f('0x14')]);return _0x27a909(_0x33179d[_0x161f('0x12')][_0x161f('0x14')]);}else{logger[_0x161f('0xd')](_0x161f('0xe'),_0x1d4bca,_0x161f('0xf'));_0x27a909(_0x33179d[_0x161f('0x15')][_0x161f('0x14')]);}})['catch'](function(_0x524fb4){logger[_0x161f('0x12')](_0x161f('0xe'),_0x1d4bca,_0x524fb4);_0x581ed2(_0x524fb4);});});}exports['UpdateOpenchannelInteraction']=function(_0x4d799f){var _0x3f4e4e=this;return new Promise(function(_0x4d1150,_0x2f535a){return db[_0x161f('0x16')][_0x161f('0x17')](_0x4d799f[_0x161f('0x18')],{'raw':_0x4d799f['options']?_0x4d799f[_0x161f('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4d799f[_0x161f('0x19')]?_0x4d799f['options'][_0x161f('0x1a')]||null:null,'attributes':_0x4d799f[_0x161f('0x19')]?_0x4d799f[_0x161f('0x19')][_0x161f('0x1b')]||null:null,'limit':_0x4d799f['options']?_0x4d799f['options'][_0x161f('0x1c')]||null:null})[_0x161f('0xc')](function(_0x2e6bab){logger[_0x161f('0xd')](_0x161f('0x1d'),_0x4d799f);logger['debug'](_0x161f('0x1d'),_0x4d799f,JSON['stringify'](_0x2e6bab));_0x4d1150(_0x2e6bab);})['catch'](function(_0x5bc3e6){logger[_0x161f('0x12')](_0x161f('0x1d'),_0x5bc3e6[_0x161f('0x14')],_0x4d799f);_0x2f535a(_0x3f4e4e['error'](0x1f4,_0x5bc3e6['message']));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x4eceaa){return new Promise(function(_0x43366c,_0x5b1e1f){return db['OpenchannelInteraction']['find']({'where':_0x4eceaa[_0x161f('0x19')]?_0x4eceaa[_0x161f('0x19')][_0x161f('0x1a')]||null:null})['then'](function(_0x3317c6){if(_0x3317c6){return _0x3317c6['addTags'](_0x4eceaa[_0x161f('0x18')][_0x161f('0x1e')],_['omit'](_0x4eceaa[_0x161f('0x18')],[_0x161f('0x1e'),'id'])||{});}})['spread'](function(_0x29e9fd){logger['info'](_0x161f('0x1f'),_0x4eceaa);logger['debug'](_0x161f('0x1f'),_0x4eceaa,JSON[_0x161f('0x11')](_0x29e9fd));_0x43366c(_0x29e9fd);})['catch'](function(_0x2f433e){logger[_0x161f('0x12')](_0x161f('0x1f'),_0x2f433e[_0x161f('0x14')],_0x4eceaa);_0x5b1e1f(_this[_0x161f('0x12')](0x1f4,_0x2f433e['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index a741912..1b60748 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 _0xcea7=['remove','update','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x58da17,_0x432f59){var _0x36f552=function(_0x467386){while(--_0x467386){_0x58da17['push'](_0x58da17['shift']());}};_0x36f552(++_0x432f59);}(_0xcea7,0x139));var _0x7cea=function(_0x114b58,_0x46e22b){_0x114b58=_0x114b58-0x0;var _0xe1d24a=_0xcea7[_0x114b58];return _0xe1d24a;};'use strict';var OpenchannelInteractionEvents=require(_0x7cea('0x0'));var events=[_0x7cea('0x1'),_0x7cea('0x2'),_0x7cea('0x3')];function createListener(_0x28c66f,_0x4f7f23){return function(_0x5dc0bd){_0x4f7f23['emit'](_0x28c66f,_0x5dc0bd);};}function removeListener(_0x4ff076,_0x354148){return function(){OpenchannelInteractionEvents[_0x7cea('0x4')](_0x4ff076,_0x354148);};}exports['register']=function(_0x39c1d3){for(var _0x37c7dd=0x0,_0xc2c1b9=events[_0x7cea('0x5')];_0x37c7dd<_0xc2c1b9;_0x37c7dd++){var _0x120f5a=events[_0x37c7dd];var _0x1f74ef=createListener(_0x7cea('0x6')+_0x120f5a,_0x39c1d3);OpenchannelInteractionEvents['on'](_0x120f5a,_0x1f74ef);}}; \ No newline at end of file +var _0x1abb=['register','openchannelInteraction:','remove','update','emit','removeListener'];(function(_0x3b7f4d,_0x5ce89e){var _0x47e489=function(_0x4368db){while(--_0x4368db){_0x3b7f4d['push'](_0x3b7f4d['shift']());}};_0x47e489(++_0x5ce89e);}(_0x1abb,0x16a));var _0xb1ab=function(_0x1e271f,_0xf14504){_0x1e271f=_0x1e271f-0x0;var _0x2b2ac5=_0x1abb[_0x1e271f];return _0x2b2ac5;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0xb1ab('0x0'),_0xb1ab('0x1')];function createListener(_0x2e6823,_0x290f39){return function(_0x5d1802){_0x290f39[_0xb1ab('0x2')](_0x2e6823,_0x5d1802);};}function removeListener(_0x1ed376,_0x19a880){return function(){OpenchannelInteractionEvents[_0xb1ab('0x3')](_0x1ed376,_0x19a880);};}exports[_0xb1ab('0x4')]=function(_0x490577){for(var _0x2e42cf=0x0,_0x4e3aab=events['length'];_0x2e42cf<_0x4e3aab;_0x2e42cf++){var _0x476eb6=events[_0x2e42cf];var _0x2c6c3e=createListener(_0xb1ab('0x5')+_0x476eb6,_0x490577);OpenchannelInteractionEvents['on'](_0x476eb6,_0x2c6c3e);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 875a67e..7db0760 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 _0x5571=['/:id/accept','accept','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','tracked','openchannelmessage:create','put','update'];(function(_0x418e4d,_0x1d1fb7){var _0x3387f2=function(_0x187915){while(--_0x187915){_0x418e4d['push'](_0x418e4d['shift']());}};_0x3387f2(++_0x1d1fb7);}(_0x5571,0x1ba));var _0x1557=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x5571[_0x1ebc6c];return _0x3a826d;};'use strict';var multer=require(_0x1557('0x0'));var util=require(_0x1557('0x1'));var path=require(_0x1557('0x2'));var timeout=require('connect-timeout');var express=require(_0x1557('0x3'));var router=express[_0x1557('0x4')]();var auth=require(_0x1557('0x5'));var interaction=require(_0x1557('0x6'));var config=require(_0x1557('0x7'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x1557('0x8')](),controller['index']);router[_0x1557('0x9')](_0x1557('0xa'),auth[_0x1557('0x8')](),controller[_0x1557('0xb')]);router[_0x1557('0x9')](_0x1557('0xc'),auth[_0x1557('0x8')](),controller[_0x1557('0xd')]);router['post']('/',auth[_0x1557('0x8')](),interaction[_0x1557('0xe')]('openchannel',_0x1557('0xf')),controller['create']);router[_0x1557('0x10')](_0x1557('0xc'),auth[_0x1557('0x8')](),controller[_0x1557('0x11')]);router[_0x1557('0x10')](_0x1557('0x12'),auth[_0x1557('0x8')](),controller[_0x1557('0x13')]);router[_0x1557('0x10')]('/:id/reject',auth[_0x1557('0x8')](),controller['reject']);router[_0x1557('0x14')](_0x1557('0xc'),auth[_0x1557('0x8')](),controller[_0x1557('0x15')]);module[_0x1557('0x16')]=router; \ No newline at end of file +var _0xd7a4=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','isAuthenticated','/:id','show','post','tracked','openchannel','create','put','/:id/accept','/:id/reject','reject','delete','destroy','util','path','connect-timeout','Router'];(function(_0x50677f,_0x4c2886){var _0x4a267f=function(_0x3b32bf){while(--_0x3b32bf){_0x50677f['push'](_0x50677f['shift']());}};_0x4a267f(++_0x4c2886);}(_0xd7a4,0xcb));var _0x4d7a=function(_0x5030e9,_0xd283f7){_0x5030e9=_0x5030e9-0x0;var _0xdf2d41=_0xd7a4[_0x5030e9];return _0xdf2d41;};'use strict';var multer=require('multer');var util=require(_0x4d7a('0x0'));var path=require(_0x4d7a('0x1'));var timeout=require(_0x4d7a('0x2'));var express=require('express');var router=express[_0x4d7a('0x3')]();var auth=require(_0x4d7a('0x4'));var interaction=require(_0x4d7a('0x5'));var config=require(_0x4d7a('0x6'));var controller=require('./openchannelMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x4d7a('0x7')]);router[_0x4d7a('0x8')](_0x4d7a('0x9'),auth[_0x4d7a('0xa')](),controller['describe']);router[_0x4d7a('0x8')](_0x4d7a('0xb'),auth[_0x4d7a('0xa')](),controller[_0x4d7a('0xc')]);router[_0x4d7a('0xd')]('/',auth[_0x4d7a('0xa')](),interaction[_0x4d7a('0xe')](_0x4d7a('0xf'),'openchannelmessage:create'),controller[_0x4d7a('0x10')]);router['put'](_0x4d7a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x4d7a('0x11')](_0x4d7a('0x12'),auth[_0x4d7a('0xa')](),controller['accept']);router[_0x4d7a('0x11')](_0x4d7a('0x13'),auth[_0x4d7a('0xa')](),controller[_0x4d7a('0x14')]);router[_0x4d7a('0x15')](_0x4d7a('0xb'),auth['isAuthenticated'](),controller[_0x4d7a('0x16')]);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 8d5155e..662c6d2 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 _0x0ee8=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x0ee8,0x1b9));var _0x80ee=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0ee8[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x80ee('0x0'));module[_0x80ee('0x1')]={'body':{'type':Sequelize[_0x80ee('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x80ee('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x80ee('0x4')]('in',_0x80ee('0x5')),'defaultValue':_0x80ee('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x80ee('0x6')]}}; \ No newline at end of file +var _0x2388=['DATE','sequelize','medium','out'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x2388,0x139));var _0x8238=function(_0x3662bb,_0x1fbf43){_0x3662bb=_0x3662bb-0x0;var _0x38e052=_0x2388[_0x3662bb];return _0x38e052;};'use strict';var Sequelize=require(_0x8238('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x8238('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x8238('0x2')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x8238('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index d5c7d94..a0383d2 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 _0x735d=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','./openchannelMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','end','status','json','count','offset','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','length','create','body','find','params','describe','../../config/logger','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','openchannel-interactions','agent','interaction','stringify','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf'];(function(_0x474f6a,_0x278ab3){var _0x15ef31=function(_0x487047){while(--_0x487047){_0x474f6a['push'](_0x474f6a['shift']());}};_0x15ef31(++_0x278ab3);}(_0x735d,0x1e9));var _0xd735=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x735d[_0x419e17];return _0x1f2044;};'use strict';var pdf=require(_0xd735('0x0'));var emlformat=require(_0xd735('0x1'));var rimraf=require(_0xd735('0x2'));var zipdir=require(_0xd735('0x3'));var jsonpatch=require(_0xd735('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd735('0x5'));var Mustache=require(_0xd735('0x6'));var util=require(_0xd735('0x7'));var path=require(_0xd735('0x8'));var sox=require(_0xd735('0x9'));var csv=require(_0xd735('0xa'));var ejs=require(_0xd735('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd735('0xc'));var crypto=require(_0xd735('0xd'));var jsforce=require(_0xd735('0xe'));var deskjs=require(_0xd735('0xf'));var toCsv=require(_0xd735('0xa'));var querystring=require(_0xd735('0x10'));var Papa=require(_0xd735('0x11'));var Redis=require('ioredis');var authService=require(_0xd735('0x12'));var qs=require(_0xd735('0x13'));var as=require(_0xd735('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd735('0x15'));var utils=require(_0xd735('0x16'));var config=require(_0xd735('0x17'));var db=require('../../mysqldb')['db'];config[_0xd735('0x18')]=_[_0xd735('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd735('0x1a'))[_0xd735('0x1b')](socket);var jayson=require(_0xd735('0x1c'));var client=jayson[_0xd735('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xd735('0x1d')][_0xd735('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3a6dcb,_0x997d52,_0x2ad977){if(_0x2ad977){var _0x3acc9a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3acc9a[_0xd735('0x1f')](_0x997d52)){return _0x3a6dcb;}else{throw new db[(_0xd735('0x20'))][(_0xd735('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3a6dcb;}}function respondWithRpcPromise(_0x48b212,_0x4c4ee3,_0x23f1c6,_0x185a2d){return new BPromise(function(_0x18087a,_0x5eff8d){var _0x3746cf=_0x185a2d||client;return _0x3746cf[_0xd735('0x22')](_0x48b212,_0x23f1c6)[_0xd735('0x23')](function(_0x10e619){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x4c4ee3,_0xd735('0x24'));logger[_0xd735('0x25')](_0xd735('0x26'),_0x4c4ee3,_0xd735('0x24'),JSON['stringify'](_0x10e619));if(_0x10e619['error']){if(_0x10e619[_0xd735('0x27')][_0xd735('0x28')]===0x1f4){logger[_0xd735('0x27')](_0xd735('0x29'),_0x4c4ee3,_0x10e619[_0xd735('0x27')]['message']);return _0x5eff8d(_0x10e619[_0xd735('0x27')][_0xd735('0x2a')]);}logger['error'](_0xd735('0x29'),_0x4c4ee3,_0x10e619['error'][_0xd735('0x2a')]);return _0x18087a(_0x10e619[_0xd735('0x27')][_0xd735('0x2a')]);}else{logger[_0xd735('0x2b')](_0xd735('0x29'),_0x4c4ee3,_0xd735('0x24'));_0x18087a(_0x10e619[_0xd735('0x2c')][_0xd735('0x2a')]);}})[_0xd735('0x2d')](function(_0x26b823){logger[_0xd735('0x27')](_0xd735('0x29'),_0x4c4ee3,_0x26b823);_0x5eff8d(_0x26b823);});});}function respondWithStatusCode(_0x1837be,_0x449371){_0x449371=_0x449371||0xcc;return function(_0x39d29c){if(_0x39d29c){return _0x1837be['sendStatus'](_0x449371);}return _0x1837be['status'](_0x449371)[_0xd735('0x2e')]();};}function respondWithResult(_0x5a9539,_0x2d23c6){_0x2d23c6=_0x2d23c6||0xc8;return function(_0x2d4635){if(_0x2d4635){return _0x5a9539[_0xd735('0x2f')](_0x2d23c6)[_0xd735('0x30')](_0x2d4635);}};}function respondWithFilteredResult(_0x2f9b9d,_0x3e4f5c){return function(_0x3eb049){if(_0x3eb049){var _0x4161d6=_0x3eb049[_0xd735('0x31')],_0x439da0=_0x3e4f5c[_0xd735('0x32')],_0x454e08=_0x3e4f5c['offset']+_0x3e4f5c['limit'],_0x456ea1;if(_0x454e08>=_0x4161d6){_0x454e08=_0x4161d6;_0x456ea1=0xc8;}else{_0x456ea1=0xce;}_0x2f9b9d['status'](_0x456ea1);return _0x2f9b9d['set'](_0xd735('0x33'),_0x439da0+'-'+_0x454e08+'/'+_0x4161d6)[_0xd735('0x30')](_0x3eb049);}return null;};}function patchUpdates(_0x591564){return function(_0x4e921f){try{jsonpatch['apply'](_0x4e921f,_0x591564,!![]);}catch(_0x5ea623){return BPromise[_0xd735('0x34')](_0x5ea623);}return _0x4e921f[_0xd735('0x35')]();};}function saveUpdates(_0x2d7463,_0x24eb26){return function(_0x200a58){if(_0x200a58){return _0x200a58[_0xd735('0x36')](_0x2d7463)[_0xd735('0x23')](function(_0x4742e9){return _0x4742e9;});}return null;};}function removeEntity(_0x599141,_0x2a3cb0){return function(_0x5c5c95){if(_0x5c5c95){return _0x5c5c95[_0xd735('0x37')]()[_0xd735('0x23')](function(){_0x599141[_0xd735('0x2f')](0xcc)[_0xd735('0x2e')]();});}};}function handleEntityNotFound(_0xf1af52,_0x334f67){return function(_0x2c2a66){if(!_0x2c2a66){_0xf1af52[_0xd735('0x38')](0x194);}return _0x2c2a66;};}function handleError(_0x2f0c94,_0x2300ee){_0x2300ee=_0x2300ee||0x1f4;return function(_0x21c37c){logger[_0xd735('0x27')](_0x21c37c[_0xd735('0x39')]);if(_0x21c37c[_0xd735('0x3a')]){delete _0x21c37c[_0xd735('0x3a')];}_0x2f0c94[_0xd735('0x2f')](_0x2300ee)[_0xd735('0x3b')](_0x21c37c);};}exports[_0xd735('0x3c')]=function(_0x42fbde,_0x179088){var _0xe5aeb1={},_0x198731={},_0x1cd191={'count':0x0,'rows':[]};var _0x410e22=_[_0xd735('0x3d')](db[_0xd735('0x3e')]['rawAttributes'],function(_0x13350e){return{'name':_0x13350e['fieldName'],'type':_0x13350e[_0xd735('0x3f')][_0xd735('0x40')]};});_0x198731['model']=_[_0xd735('0x3d')](_0x410e22,_0xd735('0x3a'));_0x198731[_0xd735('0x41')]=_[_0xd735('0x42')](_0x42fbde['query']);_0x198731[_0xd735('0x43')]=_[_0xd735('0x44')](_0x198731[_0xd735('0x45')],_0x198731[_0xd735('0x41')]);_0xe5aeb1[_0xd735('0x46')]=_[_0xd735('0x44')](_0x198731[_0xd735('0x45')],qs[_0xd735('0x47')](_0x42fbde['query'][_0xd735('0x47')]));_0xe5aeb1['attributes']=_0xe5aeb1[_0xd735('0x46')]['length']?_0xe5aeb1['attributes']:_0x198731['model'];if(!_0x42fbde[_0xd735('0x41')][_0xd735('0x48')]('nolimit')){_0xe5aeb1[_0xd735('0x49')]=qs[_0xd735('0x49')](_0x42fbde[_0xd735('0x41')][_0xd735('0x49')]);_0xe5aeb1['offset']=qs[_0xd735('0x32')](_0x42fbde['query'][_0xd735('0x32')]);}_0xe5aeb1['order']=qs[_0xd735('0x4a')](_0x42fbde['query'][_0xd735('0x4a')]);_0xe5aeb1[_0xd735('0x4b')]=qs[_0xd735('0x43')](_[_0xd735('0x4c')](_0x42fbde[_0xd735('0x41')],_0x198731[_0xd735('0x43')]));if(_0x42fbde[_0xd735('0x41')][_0xd735('0x4d')]){_0xe5aeb1['where']=_[_0xd735('0x4e')](_0xe5aeb1[_0xd735('0x4b')],{'$or':_[_0xd735('0x3d')](_0x410e22,function(_0x5dc877){if(_0x5dc877[_0xd735('0x3f')]!==_0xd735('0x4f')){var _0x3fc7c3={};_0x3fc7c3[_0x5dc877[_0xd735('0x3a')]]={'$like':'%'+_0x42fbde[_0xd735('0x41')][_0xd735('0x4d')]+'%'};return _0x3fc7c3;}})});}_0xe5aeb1=_[_0xd735('0x4e')]({},_0xe5aeb1,_0x42fbde[_0xd735('0x50')]);var _0x1e4ee1={'where':_0xe5aeb1[_0xd735('0x4b')]};return db[_0xd735('0x3e')][_0xd735('0x31')](_0x1e4ee1)[_0xd735('0x23')](function(_0x28db55){_0x1cd191[_0xd735('0x31')]=_0x28db55;if(_0x42fbde[_0xd735('0x41')][_0xd735('0x51')]){_0xe5aeb1[_0xd735('0x52')]=[{'all':!![]}];}return db[_0xd735('0x3e')][_0xd735('0x53')](_0xe5aeb1);})[_0xd735('0x23')](function(_0x128975){_0x1cd191[_0xd735('0x54')]=_0x128975;return _0x1cd191;})['then'](respondWithFilteredResult(_0x179088,_0xe5aeb1))[_0xd735('0x2d')](handleError(_0x179088,null));};exports['show']=function(_0x71f4ec,_0x365d07){var _0x4296a9={'raw':!![],'where':{'id':_0x71f4ec['params']['id']}},_0x3e5079={};_0x3e5079[_0xd735('0x45')]=_[_0xd735('0x42')](db[_0xd735('0x3e')][_0xd735('0x55')]);_0x3e5079[_0xd735('0x41')]=_['keys'](_0x71f4ec['query']);_0x3e5079[_0xd735('0x43')]=_[_0xd735('0x44')](_0x3e5079['model'],_0x3e5079[_0xd735('0x41')]);_0x4296a9['attributes']=_[_0xd735('0x44')](_0x3e5079[_0xd735('0x45')],qs['fields'](_0x71f4ec[_0xd735('0x41')]['fields']));_0x4296a9[_0xd735('0x46')]=_0x4296a9['attributes'][_0xd735('0x56')]?_0x4296a9[_0xd735('0x46')]:_0x3e5079[_0xd735('0x45')];if(_0x71f4ec[_0xd735('0x41')][_0xd735('0x51')]){_0x4296a9[_0xd735('0x52')]=[{'all':!![]}];}_0x4296a9=_['merge']({},_0x4296a9,_0x71f4ec[_0xd735('0x50')]);return db[_0xd735('0x3e')]['find'](_0x4296a9)['then'](handleEntityNotFound(_0x365d07,null))[_0xd735('0x23')](respondWithResult(_0x365d07,null))[_0xd735('0x2d')](handleError(_0x365d07,null));};exports[_0xd735('0x57')]=function(_0x36611c,_0x2dc841){return db[_0xd735('0x3e')]['create'](_0x36611c[_0xd735('0x58')],{})[_0xd735('0x23')](respondWithResult(_0x2dc841,0xc9))['catch'](handleError(_0x2dc841,null));};exports['update']=function(_0x2d0200,_0x264236){if(_0x2d0200[_0xd735('0x58')]['id']){delete _0x2d0200[_0xd735('0x58')]['id'];}return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x2d0200[_0xd735('0x5a')]['id']}})['then'](handleEntityNotFound(_0x264236,null))[_0xd735('0x23')](saveUpdates(_0x2d0200[_0xd735('0x58')],null))[_0xd735('0x23')](respondWithResult(_0x264236,null))[_0xd735('0x2d')](handleError(_0x264236,null));};exports['destroy']=function(_0x4363ad,_0x59f19e){return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x4363ad[_0xd735('0x5a')]['id']}})[_0xd735('0x23')](handleEntityNotFound(_0x59f19e,null))[_0xd735('0x23')](removeEntity(_0x59f19e,null))[_0xd735('0x2d')](handleError(_0x59f19e,null));};exports['describe']=function(_0x3dabd2,_0x345b7a){return db['OpenchannelMessage'][_0xd735('0x5b')]()[_0xd735('0x23')](respondWithResult(_0x345b7a,null))[_0xd735('0x2d')](handleError(_0x345b7a,null));};var interaction_log=require(_0xd735('0x5c'))('openchannel-interactions');exports[_0xd735('0x5d')]=function(_0x2a3222,_0x19c188,_0x3c7fcc){var _0x328a4e={'channel':'openchannel'};if(_0x2a3222[_0xd735('0x58')]['id']){delete _0x2a3222['body']['id'];}_0x2a3222['body'][_0xd735('0x5e')]=!![];_0x2a3222[_0xd735('0x58')][_0xd735('0x5f')]=moment()[_0xd735('0x60')](_0xd735('0x61'));_0x2a3222[_0xd735('0x58')]['UserId']=_0x2a3222['body'][_0xd735('0x62')]||_0x2a3222[_0xd735('0x63')]['id'];return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x2a3222['params']['id'],'UserId':null},'include':[{'model':db[_0xd735('0x64')],'as':'Contact'}]})[_0xd735('0x23')](handleEntityNotFound(_0x19c188,null))[_0xd735('0x23')](saveUpdates(_0x2a3222['body'],null))[_0xd735('0x23')](function(_0x3e65a3){if(_0x3e65a3){_0x328a4e[_0xd735('0x2a')]=_0x3e65a3[_0xd735('0x65')]({'plain':!![]});return db[_0xd735('0x66')][_0xd735('0x59')]({'where':{'id':_0x3e65a3[_0xd735('0x67')]}});}return null;})[_0xd735('0x23')](handleEntityNotFound(_0x19c188,null))[_0xd735('0x23')](function(_0x2e2282){if(_0x2e2282){return _0x2e2282[_0xd735('0x36')]({'UserId':_0x2a3222[_0xd735('0x58')][_0xd735('0x62')],'read1stAt':_[_0xd735('0x68')](_0x2e2282['read1stAt'])?moment()[_0xd735('0x60')](_0xd735('0x61')):undefined});}return null;})[_0xd735('0x23')](function(_0x14579b){if(_0x14579b){_0x328a4e['interaction']=_0x14579b[_0xd735('0x65')]({'plain':!![]});interaction_log[_0xd735('0x2b')](_0xd735('0x69'),_0x2a3222[_0xd735('0x63')]['id'],_0x2a3222[_0xd735('0x63')][_0xd735('0x3a')],_0x2a3222['user'][_0xd735('0x6a')],_0x328a4e['interaction']['id'],_0x2a3222[_0xd735('0x58')]?JSON['stringify'](_0x2a3222['body']):_0xd735('0x6b'));return respondWithRpcPromise(_0xd735('0x6c'),_0xd735('0x6d'),_0x328a4e);}return null;})['then'](function(_0x110d23){if(_0x110d23){if(_0x2a3222['body'][_0xd735('0x6e')]){_0x328a4e[_0xd735('0x2a')]['interface']=util['format'](_0xd735('0x6f'),_0x2a3222[_0xd735('0x63')]['name']);_0x328a4e['message'][_0xd735('0x70')]=_0x328a4e['channel'];_0x328a4e[_0xd735('0x2a')][_0xd735('0x71')]=_0xd735('0x5d');return respondWithRpcPromise(_0xd735('0x72'),_0xd735('0x72'),{'event':'acceptmessage','message':_0x328a4e[_0xd735('0x2a')]},client9002)['then'](function(){return _0x328a4e;});}return _0x328a4e;}return null;})[_0xd735('0x23')](respondWithResult(_0x19c188,null))[_0xd735('0x2d')](handleError(_0x19c188,null));};var interaction_log=require(_0xd735('0x5c'))(_0xd735('0x73'));exports[_0xd735('0x34')]=function(_0x5d4e58,_0xd7f14e,_0x47a387){var _0x10273f={'agent':{},'channel':'openchannel'};if(_0x5d4e58[_0xd735('0x58')]['id']){delete _0x5d4e58[_0xd735('0x58')]['id'];}_0x5d4e58['body'][_0xd735('0x62')]=_0x5d4e58[_0xd735('0x58')][_0xd735('0x62')]||_0x5d4e58['user']['id'];_0x10273f[_0xd735('0x74')]['id']=_0x5d4e58[_0xd735('0x58')][_0xd735('0x62')];return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x5d4e58[_0xd735('0x5a')]['id'],'UserId':null}})[_0xd735('0x23')](handleEntityNotFound(_0xd7f14e,null))['then'](function(_0x360411){if(_0x360411){_0x10273f['message']=_0x360411[_0xd735('0x65')]({'plain':!![]});return db[_0xd735('0x66')][_0xd735('0x59')]({'where':{'id':_0x360411['OpenchannelInteractionId']}});}return null;})[_0xd735('0x23')](handleEntityNotFound(_0xd7f14e,null))[_0xd735('0x23')](function(_0x4814f5){if(_0x4814f5){_0x10273f[_0xd735('0x75')]=_0x4814f5[_0xd735('0x65')]({'plain':!![]});interaction_log[_0xd735('0x2b')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d4e58[_0xd735('0x63')]['id'],_0x5d4e58[_0xd735('0x63')][_0xd735('0x3a')],_0x5d4e58[_0xd735('0x63')][_0xd735('0x6a')],_0x10273f[_0xd735('0x75')]['id'],_0x5d4e58[_0xd735('0x58')]?JSON[_0xd735('0x76')](_0x5d4e58['body']):_0xd735('0x6b'));return respondWithRpcPromise(_0xd735('0x77'),_0xd735('0x78'),_0x10273f);}return null;})[_0xd735('0x23')](function(_0xf9395f){if(_0xf9395f){_0xf9395f[_0xd735('0x2a')][_0xd735('0x79')]=util[_0xd735('0x60')](_0xd735('0x6f'),_0x5d4e58[_0xd735('0x63')][_0xd735('0x3a')]);_0xf9395f[_0xd735('0x2a')]['channel']=_0x10273f[_0xd735('0x70')];_0xf9395f[_0xd735('0x2a')][_0xd735('0x71')]='reject';respondWithRpcPromise('EventManager',_0xd735('0x72'),{'event':_0xd735('0x7a'),'message':_0xf9395f['message']},client9002);return _0x10273f;}return null;})[_0xd735('0x23')](respondWithResult(_0xd7f14e,null))[_0xd735('0x2d')](handleError(_0xd7f14e,null));}; \ No newline at end of file +var _0x282a=['get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','manual','SIP/%s','channel','EventManager','acceptmessage','openchannel-interactions','agent','role','RejectMessage','event','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/logger','api','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','client','test','Sequelize','ValidationError','request','then','info','request\x20sent','debug','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','end','status','count','offset','limit','Content-Range','json','apply','reject','save','update','sendStatus','name','send','index','OpenchannelMessage','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','show','params','find','create','body','destroy','describe','accept','openchannel','format','user','CmContact','Contact','OpenchannelInteraction','OpenchannelInteractionId','UserId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction'];(function(_0x2b62ef,_0x5722a8){var _0x529282=function(_0x6917e7){while(--_0x6917e7){_0x2b62ef['push'](_0x2b62ef['shift']());}};_0x529282(++_0x5722a8);}(_0x282a,0x1ef));var _0xa282=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x282a[_0xc4001c];return _0x49f7bc;};'use strict';var pdf=require(_0xa282('0x0'));var emlformat=require(_0xa282('0x1'));var rimraf=require(_0xa282('0x2'));var zipdir=require(_0xa282('0x3'));var jsonpatch=require(_0xa282('0x4'));var rp=require(_0xa282('0x5'));var moment=require(_0xa282('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa282('0x7'));var util=require(_0xa282('0x8'));var path=require(_0xa282('0x9'));var sox=require(_0xa282('0xa'));var csv=require(_0xa282('0xb'));var ejs=require(_0xa282('0xc'));var fs=require('fs');var _=require(_0xa282('0xd'));var squel=require(_0xa282('0xe'));var crypto=require(_0xa282('0xf'));var jsforce=require(_0xa282('0x10'));var deskjs=require(_0xa282('0x11'));var toCsv=require(_0xa282('0xb'));var querystring=require(_0xa282('0x12'));var Papa=require(_0xa282('0x13'));var Redis=require('ioredis');var authService=require(_0xa282('0x14'));var qs=require(_0xa282('0x15'));var as=require(_0xa282('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa282('0x17'))(_0xa282('0x18'));var utils=require(_0xa282('0x19'));var config=require('../../config/environment');var db=require(_0xa282('0x1a'))['db'];config['redis']=_[_0xa282('0x1b')](config[_0xa282('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xa282('0x1d'))(new Redis(config[_0xa282('0x1c')]));require('./openchannelMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xa282('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x5ed849,_0x631815,_0x58f2ba){if(_0x58f2ba){var _0x42e851=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x42e851[_0xa282('0x1f')](_0x631815)){return _0x5ed849;}else{throw new db[(_0xa282('0x20'))][(_0xa282('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5ed849;}}function respondWithRpcPromise(_0x500a99,_0x2f4e04,_0x5df2f8,_0x19e865){return new BPromise(function(_0x22feca,_0xaa0271){var _0x8fd423=_0x19e865||client;return _0x8fd423[_0xa282('0x22')](_0x500a99,_0x5df2f8)[_0xa282('0x23')](function(_0x1bae83){logger[_0xa282('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f4e04,_0xa282('0x25'));logger[_0xa282('0x26')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2f4e04,_0xa282('0x25'),JSON[_0xa282('0x27')](_0x1bae83));if(_0x1bae83['error']){if(_0x1bae83[_0xa282('0x28')][_0xa282('0x29')]===0x1f4){logger[_0xa282('0x28')](_0xa282('0x2a'),_0x2f4e04,_0x1bae83[_0xa282('0x28')][_0xa282('0x2b')]);return _0xaa0271(_0x1bae83[_0xa282('0x28')][_0xa282('0x2b')]);}logger['error'](_0xa282('0x2a'),_0x2f4e04,_0x1bae83[_0xa282('0x28')][_0xa282('0x2b')]);return _0x22feca(_0x1bae83['error'][_0xa282('0x2b')]);}else{logger['info'](_0xa282('0x2a'),_0x2f4e04,'request\x20sent');_0x22feca(_0x1bae83[_0xa282('0x2c')][_0xa282('0x2b')]);}})[_0xa282('0x2d')](function(_0x3d6a1e){logger[_0xa282('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0x2f4e04,_0x3d6a1e);_0xaa0271(_0x3d6a1e);});});}function respondWithStatusCode(_0x2af9f2,_0x3ac7c7){_0x3ac7c7=_0x3ac7c7||0xcc;return function(_0x337d28){if(_0x337d28){return _0x2af9f2['sendStatus'](_0x3ac7c7);}return _0x2af9f2['status'](_0x3ac7c7)[_0xa282('0x2e')]();};}function respondWithResult(_0x5b8c13,_0x2dc84d){_0x2dc84d=_0x2dc84d||0xc8;return function(_0x266f15){if(_0x266f15){return _0x5b8c13[_0xa282('0x2f')](_0x2dc84d)['json'](_0x266f15);}};}function respondWithFilteredResult(_0x4245e1,_0xaaa2d1){return function(_0x4e3439){if(_0x4e3439){var _0x4aafa5=_0x4e3439[_0xa282('0x30')],_0x5b0fbc=_0xaaa2d1['offset'],_0x5d3aa1=_0xaaa2d1[_0xa282('0x31')]+_0xaaa2d1[_0xa282('0x32')],_0x5c1818;if(_0x5d3aa1>=_0x4aafa5){_0x5d3aa1=_0x4aafa5;_0x5c1818=0xc8;}else{_0x5c1818=0xce;}_0x4245e1[_0xa282('0x2f')](_0x5c1818);return _0x4245e1['set'](_0xa282('0x33'),_0x5b0fbc+'-'+_0x5d3aa1+'/'+_0x4aafa5)[_0xa282('0x34')](_0x4e3439);}return null;};}function patchUpdates(_0xd59f9f){return function(_0x10bc08){try{jsonpatch[_0xa282('0x35')](_0x10bc08,_0xd59f9f,!![]);}catch(_0x3029c3){return BPromise[_0xa282('0x36')](_0x3029c3);}return _0x10bc08[_0xa282('0x37')]();};}function saveUpdates(_0x52dd0f,_0x23a213){return function(_0x50951c){if(_0x50951c){return _0x50951c[_0xa282('0x38')](_0x52dd0f)[_0xa282('0x23')](function(_0x265000){return _0x265000;});}return null;};}function removeEntity(_0x252ba0,_0x137612){return function(_0xf6c862){if(_0xf6c862){return _0xf6c862['destroy']()[_0xa282('0x23')](function(){_0x252ba0[_0xa282('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b80d8,_0x3b2600){return function(_0x2ad4ca){if(!_0x2ad4ca){_0x4b80d8[_0xa282('0x39')](0x194);}return _0x2ad4ca;};}function handleError(_0x3b6824,_0x3edd65){_0x3edd65=_0x3edd65||0x1f4;return function(_0x3977ef){logger[_0xa282('0x28')](_0x3977ef['stack']);if(_0x3977ef['name']){delete _0x3977ef[_0xa282('0x3a')];}_0x3b6824[_0xa282('0x2f')](_0x3edd65)[_0xa282('0x3b')](_0x3977ef);};}exports[_0xa282('0x3c')]=function(_0x39c4da,_0x3d318e){var _0x5a8975={},_0x3f22c4={},_0xb9f282={'count':0x0,'rows':[]};var _0x114a77=_['map'](db[_0xa282('0x3d')][_0xa282('0x3e')],function(_0x2494e4){return{'name':_0x2494e4['fieldName'],'type':_0x2494e4['type'][_0xa282('0x3f')]};});_0x3f22c4['model']=_['map'](_0x114a77,_0xa282('0x3a'));_0x3f22c4[_0xa282('0x40')]=_[_0xa282('0x41')](_0x39c4da[_0xa282('0x40')]);_0x3f22c4[_0xa282('0x42')]=_[_0xa282('0x43')](_0x3f22c4[_0xa282('0x44')],_0x3f22c4[_0xa282('0x40')]);_0x5a8975[_0xa282('0x45')]=_[_0xa282('0x43')](_0x3f22c4[_0xa282('0x44')],qs[_0xa282('0x46')](_0x39c4da['query'][_0xa282('0x46')]));_0x5a8975[_0xa282('0x45')]=_0x5a8975[_0xa282('0x45')][_0xa282('0x47')]?_0x5a8975[_0xa282('0x45')]:_0x3f22c4[_0xa282('0x44')];if(!_0x39c4da['query'][_0xa282('0x48')](_0xa282('0x49'))){_0x5a8975[_0xa282('0x32')]=qs[_0xa282('0x32')](_0x39c4da[_0xa282('0x40')][_0xa282('0x32')]);_0x5a8975[_0xa282('0x31')]=qs[_0xa282('0x31')](_0x39c4da[_0xa282('0x40')][_0xa282('0x31')]);}_0x5a8975[_0xa282('0x4a')]=qs[_0xa282('0x4b')](_0x39c4da[_0xa282('0x40')][_0xa282('0x4b')]);_0x5a8975[_0xa282('0x4c')]=qs['filters'](_[_0xa282('0x4d')](_0x39c4da[_0xa282('0x40')],_0x3f22c4['filters']));if(_0x39c4da[_0xa282('0x40')][_0xa282('0x4e')]){_0x5a8975[_0xa282('0x4c')]=_[_0xa282('0x4f')](_0x5a8975[_0xa282('0x4c')],{'$or':_[_0xa282('0x50')](_0x114a77,function(_0x4834d6){if(_0x4834d6[_0xa282('0x51')]!==_0xa282('0x52')){var _0x257da6={};_0x257da6[_0x4834d6[_0xa282('0x3a')]]={'$like':'%'+_0x39c4da[_0xa282('0x40')][_0xa282('0x4e')]+'%'};return _0x257da6;}})});}_0x5a8975=_[_0xa282('0x4f')]({},_0x5a8975,_0x39c4da[_0xa282('0x53')]);var _0x4cbc87={'where':_0x5a8975[_0xa282('0x4c')]};return db['OpenchannelMessage'][_0xa282('0x30')](_0x4cbc87)['then'](function(_0x1824a0){_0xb9f282[_0xa282('0x30')]=_0x1824a0;if(_0x39c4da[_0xa282('0x40')][_0xa282('0x54')]){_0x5a8975[_0xa282('0x55')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x5a8975);})[_0xa282('0x23')](function(_0x5bdd22){_0xb9f282['rows']=_0x5bdd22;return _0xb9f282;})[_0xa282('0x23')](respondWithFilteredResult(_0x3d318e,_0x5a8975))['catch'](handleError(_0x3d318e,null));};exports[_0xa282('0x56')]=function(_0x1f6cfb,_0xa4b61a){var _0x199f32={'raw':!![],'where':{'id':_0x1f6cfb[_0xa282('0x57')]['id']}},_0x23159a={};_0x23159a['model']=_[_0xa282('0x41')](db[_0xa282('0x3d')][_0xa282('0x3e')]);_0x23159a[_0xa282('0x40')]=_[_0xa282('0x41')](_0x1f6cfb[_0xa282('0x40')]);_0x23159a[_0xa282('0x42')]=_[_0xa282('0x43')](_0x23159a[_0xa282('0x44')],_0x23159a[_0xa282('0x40')]);_0x199f32[_0xa282('0x45')]=_[_0xa282('0x43')](_0x23159a[_0xa282('0x44')],qs[_0xa282('0x46')](_0x1f6cfb[_0xa282('0x40')]['fields']));_0x199f32[_0xa282('0x45')]=_0x199f32['attributes'][_0xa282('0x47')]?_0x199f32[_0xa282('0x45')]:_0x23159a[_0xa282('0x44')];if(_0x1f6cfb[_0xa282('0x40')][_0xa282('0x54')]){_0x199f32['include']=[{'all':!![]}];}_0x199f32=_[_0xa282('0x4f')]({},_0x199f32,_0x1f6cfb[_0xa282('0x53')]);return db['OpenchannelMessage'][_0xa282('0x58')](_0x199f32)[_0xa282('0x23')](handleEntityNotFound(_0xa4b61a,null))[_0xa282('0x23')](respondWithResult(_0xa4b61a,null))['catch'](handleError(_0xa4b61a,null));};exports[_0xa282('0x59')]=function(_0x54407e,_0x5aa2bd){return db[_0xa282('0x3d')]['create'](_0x54407e['body'],{})[_0xa282('0x23')](respondWithResult(_0x5aa2bd,0xc9))[_0xa282('0x2d')](handleError(_0x5aa2bd,null));};exports[_0xa282('0x38')]=function(_0x5c6fd8,_0x4f86ad){if(_0x5c6fd8[_0xa282('0x5a')]['id']){delete _0x5c6fd8[_0xa282('0x5a')]['id'];}return db['OpenchannelMessage'][_0xa282('0x58')]({'where':{'id':_0x5c6fd8[_0xa282('0x57')]['id']}})['then'](handleEntityNotFound(_0x4f86ad,null))[_0xa282('0x23')](saveUpdates(_0x5c6fd8[_0xa282('0x5a')],null))[_0xa282('0x23')](respondWithResult(_0x4f86ad,null))['catch'](handleError(_0x4f86ad,null));};exports[_0xa282('0x5b')]=function(_0x3170f0,_0x445eeb){return db[_0xa282('0x3d')]['find']({'where':{'id':_0x3170f0[_0xa282('0x57')]['id']}})[_0xa282('0x23')](handleEntityNotFound(_0x445eeb,null))['then'](removeEntity(_0x445eeb,null))[_0xa282('0x2d')](handleError(_0x445eeb,null));};exports[_0xa282('0x5c')]=function(_0x54d5e5,_0x482031){return db[_0xa282('0x3d')][_0xa282('0x5c')]()[_0xa282('0x23')](respondWithResult(_0x482031,null))[_0xa282('0x2d')](handleError(_0x482031,null));};var interaction_log=require(_0xa282('0x17'))('openchannel-interactions');exports[_0xa282('0x5d')]=function(_0x3ddd9a,_0x402458,_0x2af849){var _0x5cf861={'channel':_0xa282('0x5e')};if(_0x3ddd9a['body']['id']){delete _0x3ddd9a[_0xa282('0x5a')]['id'];}_0x3ddd9a[_0xa282('0x5a')]['read']=!![];_0x3ddd9a[_0xa282('0x5a')]['readAt']=moment()[_0xa282('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x3ddd9a[_0xa282('0x5a')]['UserId']=_0x3ddd9a[_0xa282('0x5a')]['UserId']||_0x3ddd9a[_0xa282('0x60')]['id'];return db[_0xa282('0x3d')][_0xa282('0x58')]({'where':{'id':_0x3ddd9a[_0xa282('0x57')]['id'],'UserId':null},'include':[{'model':db[_0xa282('0x61')],'as':_0xa282('0x62')}]})[_0xa282('0x23')](handleEntityNotFound(_0x402458,null))['then'](saveUpdates(_0x3ddd9a[_0xa282('0x5a')],null))[_0xa282('0x23')](function(_0xe4d5a){if(_0xe4d5a){_0x5cf861[_0xa282('0x2b')]=_0xe4d5a['get']({'plain':!![]});return db[_0xa282('0x63')]['find']({'where':{'id':_0xe4d5a[_0xa282('0x64')]}});}return null;})[_0xa282('0x23')](handleEntityNotFound(_0x402458,null))['then'](function(_0x18edfb){if(_0x18edfb){return _0x18edfb[_0xa282('0x38')]({'UserId':_0x3ddd9a['body'][_0xa282('0x65')],'read1stAt':_['isNil'](_0x18edfb[_0xa282('0x66')])?moment()[_0xa282('0x5f')](_0xa282('0x67')):undefined});}return null;})[_0xa282('0x23')](function(_0x366770){if(_0x366770){_0x5cf861[_0xa282('0x68')]=_0x366770[_0xa282('0x69')]({'plain':!![]});interaction_log['info'](_0xa282('0x6a'),_0x3ddd9a[_0xa282('0x60')]['id'],_0x3ddd9a[_0xa282('0x60')][_0xa282('0x3a')],_0x3ddd9a[_0xa282('0x60')]['role'],_0x5cf861[_0xa282('0x68')]['id'],_0x3ddd9a['body']?JSON[_0xa282('0x27')](_0x3ddd9a[_0xa282('0x5a')]):_0xa282('0x6b'));return respondWithRpcPromise('AcceptMessage',_0xa282('0x6c'),_0x5cf861);}return null;})['then'](function(_0xa0f841){if(_0xa0f841){if(_0x3ddd9a[_0xa282('0x5a')][_0xa282('0x6d')]){_0x5cf861[_0xa282('0x2b')]['interface']=util[_0xa282('0x5f')](_0xa282('0x6e'),_0x3ddd9a[_0xa282('0x60')][_0xa282('0x3a')]);_0x5cf861[_0xa282('0x2b')][_0xa282('0x6f')]=_0x5cf861[_0xa282('0x6f')];_0x5cf861[_0xa282('0x2b')]['event']='accept';return respondWithRpcPromise(_0xa282('0x70'),_0xa282('0x70'),{'event':_0xa282('0x71'),'message':_0x5cf861[_0xa282('0x2b')]},client9002)['then'](function(){return _0x5cf861;});}return _0x5cf861;}return null;})[_0xa282('0x23')](respondWithResult(_0x402458,null))[_0xa282('0x2d')](handleError(_0x402458,null));};var interaction_log=require(_0xa282('0x17'))(_0xa282('0x72'));exports[_0xa282('0x36')]=function(_0x174778,_0x334141,_0x465e62){var _0x365382={'agent':{},'channel':_0xa282('0x5e')};if(_0x174778[_0xa282('0x5a')]['id']){delete _0x174778[_0xa282('0x5a')]['id'];}_0x174778[_0xa282('0x5a')]['UserId']=_0x174778[_0xa282('0x5a')][_0xa282('0x65')]||_0x174778[_0xa282('0x60')]['id'];_0x365382[_0xa282('0x73')]['id']=_0x174778['body'][_0xa282('0x65')];return db['OpenchannelMessage'][_0xa282('0x58')]({'where':{'id':_0x174778[_0xa282('0x57')]['id'],'UserId':null}})[_0xa282('0x23')](handleEntityNotFound(_0x334141,null))['then'](function(_0xe7447f){if(_0xe7447f){_0x365382[_0xa282('0x2b')]=_0xe7447f[_0xa282('0x69')]({'plain':!![]});return db['OpenchannelInteraction'][_0xa282('0x58')]({'where':{'id':_0xe7447f[_0xa282('0x64')]}});}return null;})[_0xa282('0x23')](handleEntityNotFound(_0x334141,null))[_0xa282('0x23')](function(_0x6df2bc){if(_0x6df2bc){_0x365382[_0xa282('0x68')]=_0x6df2bc['get']({'plain':!![]});interaction_log[_0xa282('0x24')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x174778['user']['id'],_0x174778[_0xa282('0x60')]['name'],_0x174778[_0xa282('0x60')][_0xa282('0x74')],_0x365382[_0xa282('0x68')]['id'],_0x174778['body']?JSON[_0xa282('0x27')](_0x174778[_0xa282('0x5a')]):_0xa282('0x6b'));return respondWithRpcPromise(_0xa282('0x75'),'rejectMessage',_0x365382);}return null;})['then'](function(_0x4c5f1f){if(_0x4c5f1f){_0x4c5f1f[_0xa282('0x2b')]['interface']=util[_0xa282('0x5f')](_0xa282('0x6e'),_0x174778[_0xa282('0x60')][_0xa282('0x3a')]);_0x4c5f1f['message']['channel']=_0x365382['channel'];_0x4c5f1f[_0xa282('0x2b')][_0xa282('0x76')]=_0xa282('0x36');respondWithRpcPromise(_0xa282('0x70'),'EventManager',{'event':_0xa282('0x77'),'message':_0x4c5f1f[_0xa282('0x2b')]},client9002);return _0x365382;}return null;})['then'](respondWithResult(_0x334141,null))[_0xa282('0x2d')](handleError(_0x334141,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 924d959..b85f021 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 _0xa20f=['setMaxListeners','update','events','../../mysqldb','OpenchannelMessage'];(function(_0x4b98c2,_0x4f8940){var _0x43a9e4=function(_0x4cb734){while(--_0x4cb734){_0x4b98c2['push'](_0x4b98c2['shift']());}};_0x43a9e4(++_0x4f8940);}(_0xa20f,0x183));var _0xfa20=function(_0x4fcb0f,_0x5e8627){_0x4fcb0f=_0x4fcb0f-0x0;var _0xf9107d=_0xa20f[_0x4fcb0f];return _0xf9107d;};'use strict';var EventEmitter=require(_0xfa20('0x0'));var OpenchannelMessage=require(_0xfa20('0x1'))['db'][_0xfa20('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xfa20('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa20('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e0b60){return function(_0x3bd25f,_0x1300d4,_0x1327de){OpenchannelMessageEvents['emit'](_0x3e0b60+':'+_0x3bd25f['id'],_0x3bd25f);OpenchannelMessageEvents['emit'](_0x3e0b60,_0x3bd25f);_0x1327de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file +var _0xfcbb=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x35f3f3,_0x2f34cc){var _0xab1111=function(_0x20328b){while(--_0x20328b){_0x35f3f3['push'](_0x35f3f3['shift']());}};_0xab1111(++_0x2f34cc);}(_0xfcbb,0x12d));var _0xbfcb=function(_0x3f43b6,_0x55d08e){_0x3f43b6=_0x3f43b6-0x0;var _0x1556b6=_0xfcbb[_0x3f43b6];return _0x1556b6;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xbfcb('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbfcb('0x1'),'afterDestroy':_0xbfcb('0x2')};function emitEvent(_0x1c66f2){return function(_0x48011a,_0x3f1bfb,_0x3e6c72){OpenchannelMessageEvents[_0xbfcb('0x3')](_0x1c66f2+':'+_0x48011a['id'],_0x48011a);OpenchannelMessageEvents[_0xbfcb('0x3')](_0x1c66f2,_0x48011a);_0x3e6c72(null);};}for(var e in events){if(events[_0xbfcb('0x4')](e)){var event=events[e];OpenchannelMessage[_0xbfcb('0x5')](e,emitEvent(event));}}module[_0xbfcb('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index a34aff6..0b67014 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 _0x34ce=['body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','catch','CmContact','find','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','method','GET','info','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x527529,_0x28384e){var _0x53be48=function(_0x1f83f1){while(--_0x1f83f1){_0x527529['push'](_0x527529['shift']());}};_0x53be48(++_0x28384e);}(_0x34ce,0xd1));var _0xe34c=function(_0x503790,_0x525c78){_0x503790=_0x503790-0x0;var _0x388092=_0x34ce[_0x503790];return _0x388092;};'use strict';var _=require('lodash');var util=require(_0xe34c('0x0'));var logger=require('../../config/logger')(_0xe34c('0x1'));var moment=require('moment');var BPromise=require(_0xe34c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe34c('0x3'));var config=require(_0xe34c('0x4'));var attributes=require(_0xe34c('0x5'));module[_0xe34c('0x6')]=function(_0x59a836,_0xe6359d){return _0x59a836[_0xe34c('0x7')](_0xe34c('0x8'),attributes,{'tableName':_0xe34c('0x9'),'paranoid':![],'indexes':[{'name':_0xe34c('0xa'),'fields':[_0xe34c('0xb')],'type':_0xe34c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53d4e8,_0x1b83e9,_0x3aa09c){var _0x2d5ef4=_0x59a836[_0xe34c('0xd')];var _0x4f5b07=_0x53d4e8[_0xe34c('0xe')]({'plain':!![]});if(_0x4f5b07[_0xe34c('0xf')][_0xe34c('0x10')]()==='in'||_0x4f5b07[_0xe34c('0xf')]['toLowerCase']()===_0xe34c('0x11')&&!_0x4f5b07['secret']&&!_[_0xe34c('0x12')](_0x4f5b07[_0xe34c('0x13')])){_0x2d5ef4[_0xe34c('0x14')]['findOne']({'where':{'id':_0x4f5b07[_0xe34c('0x15')]}})[_0xe34c('0x16')](function(_0x8e9f0b){if(_0x8e9f0b){_0x8e9f0b['update']({'lastMsgAt':_0x4f5b07['createdAt'],'lastMsgDirection':_0x4f5b07['direction']['toLowerCase']()});}})[_0xe34c('0x17')](function(_0x1dddfc){console['error'](_0x1dddfc);});}if(_0x4f5b07[_0xe34c('0xf')]===_0xe34c('0x11')&&!_0x4f5b07['secret']){var _0x3f5778;_0x2d5ef4[_0xe34c('0x18')]['describe']()[_0xe34c('0x16')](function(_0x46632d){return _0x2d5ef4['OpenchannelAccount'][_0xe34c('0x19')]({'where':{'id':_0x4f5b07['OpenchannelAccountId']},'include':[{'model':_0x2d5ef4['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x4f5b07[_0xe34c('0x15')]},'limit':0x1,'include':[{'model':_0x2d5ef4[_0xe34c('0x18')],'as':_0xe34c('0x1a'),'attributes':_[_0xe34c('0x1b')](_0x46632d)}]}]});})[_0xe34c('0x16')](function(_0xe56f65){_0x3f5778=_0xe56f65[_0xe34c('0xe')]({'plain':!![]});if(_0x3f5778&&_0x3f5778[_0xe34c('0x1c')]){logger['info'](_0xe34c('0x1d'),_0xe34c('0x1e'),util[_0xe34c('0x1f')](_0xe34c('0x20'),_0x4f5b07['id'],_0x3f5778[_0xe34c('0x1c')]));if(_0x3f5778[_0xe34c('0x21')]&&_0x3f5778[_0xe34c('0x21')][_0xe34c('0x22')]){_0x4f5b07[_0xe34c('0x23')]=_['omit'](_0x3f5778['Interactions'][0x0],'Contact');_0x4f5b07[_0xe34c('0x1a')]=_0x3f5778[_0xe34c('0x21')][0x0][_0xe34c('0x1a')];}var _0x1b83e9={'method':'POST','uri':encodeURI(_0x3f5778['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1b83e9[_0xe34c('0x24')]){case _0xe34c('0x25'):_0x1b83e9['qs']=_0x4f5b07;break;case'POST':_0x1b83e9[_0xe34c('0xb')]=_0x4f5b07;break;}return rp(_0x1b83e9)['then'](function(_0x315719){logger[_0xe34c('0x26')](_0xe34c('0x1d'),_0xe34c('0x1e'),util[_0xe34c('0x1f')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4f5b07['id'],_0x3f5778['replyUri']));if(_0x315719['body'][_0xe34c('0x27')]&&_0x315719[_0xe34c('0xb')][_0xe34c('0x27')]!=_0x4f5b07[_0xe34c('0x23')][_0xe34c('0x27')]){return _0x2d5ef4[_0xe34c('0x14')]['update']({'threadId':_0x315719[_0xe34c('0xb')][_0xe34c('0x27')]},{'logging':!![],'where':{'id':_0x4f5b07[_0xe34c('0x23')]['id']}});}else{return;}})['then'](function(){return _0x53d4e8['update']({'read':!![]});})[_0xe34c('0x17')](function(_0xe3ef65){logger['error'](_0xe34c('0x1d'),_0xe34c('0x1e'),util[_0xe34c('0x28')](_0xe3ef65,{'showHidden':![],'depth':null}));_0x3aa09c();});}else{_0x3aa09c();}})[_0xe34c('0x29')](function(){_0x3aa09c();});}else{_0x3aa09c();}}},'charset':_0xe34c('0x2a'),'collate':_0xe34c('0x2b')});}; \ No newline at end of file +var _0x849a=['keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','GET','POST','info','format','threadId','OpenchannelInteraction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','toLowerCase','direction','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','out','secret','describe','Interactions','CmContact'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x849a,0xdb));var _0xa849=function(_0x38d261,_0xc2684d){_0x38d261=_0x38d261-0x0;var _0x39e968=_0x849a[_0x38d261];return _0x39e968;};'use strict';var _=require(_0xa849('0x0'));var util=require('util');var logger=require(_0xa849('0x1'))(_0xa849('0x2'));var moment=require('moment');var BPromise=require(_0xa849('0x3'));var rp=require(_0xa849('0x4'));var fs=require('fs');var path=require(_0xa849('0x5'));var rimraf=require(_0xa849('0x6'));var config=require(_0xa849('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xa849('0x8')]=function(_0x5907b9,_0x2c98e0){return _0x5907b9[_0xa849('0x9')](_0xa849('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xa849('0xb'),'fields':[_0xa849('0xc')],'type':_0xa849('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x40b2d5,_0x156fa8,_0x1f7d89){var _0x172f04=_0x5907b9[_0xa849('0xe')];var _0x2bb6bf=_0x40b2d5['get']({'plain':!![]});if(_0x2bb6bf['direction'][_0xa849('0xf')]()==='in'||_0x2bb6bf[_0xa849('0x10')][_0xa849('0xf')]()==='out'&&!_0x2bb6bf['secret']&&!_[_0xa849('0x11')](_0x2bb6bf[_0xa849('0x12')])){_0x172f04['OpenchannelInteraction'][_0xa849('0x13')]({'where':{'id':_0x2bb6bf[_0xa849('0x14')]}})[_0xa849('0x15')](function(_0x522bd7){if(_0x522bd7){_0x522bd7[_0xa849('0x16')]({'lastMsgAt':_0x2bb6bf[_0xa849('0x17')],'lastMsgDirection':_0x2bb6bf['direction'][_0xa849('0xf')]()});}})[_0xa849('0x18')](function(_0x255163){console[_0xa849('0x19')](_0x255163);});}if(_0x2bb6bf[_0xa849('0x10')]===_0xa849('0x1a')&&!_0x2bb6bf[_0xa849('0x1b')]){var _0x3704ff;_0x172f04['CmContact'][_0xa849('0x1c')]()[_0xa849('0x15')](function(_0x231886){return _0x172f04['OpenchannelAccount']['find']({'where':{'id':_0x2bb6bf['OpenchannelAccountId']},'include':[{'model':_0x172f04['OpenchannelInteraction'],'as':_0xa849('0x1d'),'where':{'id':_0x2bb6bf['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x172f04[_0xa849('0x1e')],'as':'Contact','attributes':_[_0xa849('0x1f')](_0x231886)}]}]});})[_0xa849('0x15')](function(_0x306bde){_0x3704ff=_0x306bde['get']({'plain':!![]});if(_0x3704ff&&_0x3704ff[_0xa849('0x20')]){logger['info'](_0xa849('0x21'),_0xa849('0x22'),util['format'](_0xa849('0x23'),_0x2bb6bf['id'],_0x3704ff[_0xa849('0x20')]));if(_0x3704ff['Interactions']&&_0x3704ff[_0xa849('0x1d')][_0xa849('0x24')]){_0x2bb6bf[_0xa849('0x25')]=_[_0xa849('0x26')](_0x3704ff[_0xa849('0x1d')][0x0],_0xa849('0x27'));_0x2bb6bf[_0xa849('0x27')]=_0x3704ff[_0xa849('0x1d')][0x0][_0xa849('0x27')];}var _0x156fa8={'method':'POST','uri':encodeURI(_0x3704ff['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x156fa8['method']){case _0xa849('0x28'):_0x156fa8['qs']=_0x2bb6bf;break;case _0xa849('0x29'):_0x156fa8[_0xa849('0xc')]=_0x2bb6bf;break;}return rp(_0x156fa8)[_0xa849('0x15')](function(_0x2fb8ed){logger[_0xa849('0x2a')](_0xa849('0x21'),_0xa849('0x22'),util[_0xa849('0x2b')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x2bb6bf['id'],_0x3704ff[_0xa849('0x20')]));if(_0x2fb8ed[_0xa849('0xc')]['threadId']&&_0x2fb8ed[_0xa849('0xc')][_0xa849('0x2c')]!=_0x2bb6bf['Interaction'][_0xa849('0x2c')]){return _0x172f04[_0xa849('0x2d')]['update']({'threadId':_0x2fb8ed[_0xa849('0xc')][_0xa849('0x2c')]},{'logging':!![],'where':{'id':_0x2bb6bf['Interaction']['id']}});}else{return;}})['then'](function(){return _0x40b2d5[_0xa849('0x16')]({'read':!![]});})[_0xa849('0x18')](function(_0x3e96bb){logger[_0xa849('0x19')](_0xa849('0x21'),'afterCreate',util[_0xa849('0x2e')](_0x3e96bb,{'showHidden':![],'depth':null}));_0x1f7d89();});}else{_0x1f7d89();}})[_0xa849('0x2f')](function(){_0x1f7d89();});}else{_0x1f7d89();}}},'charset':_0xa849('0x30'),'collate':_0xa849('0x31')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 29ba5ee..f0f2a07 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 _0xd1ca=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','catch','create','body','options','raw','then','CreateOpenchannelMessage','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','socket.io-emitter','./openchannelMessage.socket','register','request','info','request\x20sent','debug'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xd1ca,0x140));var _0xad1c=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xd1ca[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require('../../config/logger')(_0xad1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad1c('0x6')][_0xad1c('0x7')]({'port':0x232a});config[_0xad1c('0x8')]=_['defaults'](config[_0xad1c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xad1c('0x9'))(new Redis(config[_0xad1c('0x8')]));require(_0xad1c('0xa'))[_0xad1c('0xb')](socket);function respondWithRpcPromise(_0x24bad3,_0x27364d,_0x1cc68b){return new BPromise(function(_0x3d790c,_0x46ecae){return client[_0xad1c('0xc')](_0x24bad3,_0x1cc68b)['then'](function(_0x195454){logger[_0xad1c('0xd')]('OpenchannelMessage,\x20%s,\x20%s',_0x27364d,_0xad1c('0xe'));logger[_0xad1c('0xf')](_0xad1c('0x10'),_0x27364d,_0xad1c('0xe'),JSON[_0xad1c('0x11')](_0x195454));if(_0x195454[_0xad1c('0x12')]){if(_0x195454[_0xad1c('0x12')]['code']===0x1f4){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x46ecae(_0x195454[_0xad1c('0x12')]['message']);}logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x3d790c(_0x195454['error'][_0xad1c('0x14')]);}else{logger['info'](_0xad1c('0x13'),_0x27364d,_0xad1c('0xe'));_0x3d790c(_0x195454['result']['message']);}})[_0xad1c('0x15')](function(_0xa353d8){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0xa353d8);_0x46ecae(_0xa353d8);});});}exports['CreateOpenchannelMessage']=function(_0x2db328){var _0x46eb38=this;return new Promise(function(_0xa80469,_0x51d25c){return db['OpenchannelMessage'][_0xad1c('0x16')](_0x2db328[_0xad1c('0x17')],{'raw':_0x2db328[_0xad1c('0x18')]?_0x2db328[_0xad1c('0x18')][_0xad1c('0x19')]===undefined?!![]:![]:!![]})[_0xad1c('0x1a')](function(_0x2a6953){logger['info'](_0xad1c('0x1b'),_0x2db328);logger[_0xad1c('0xf')](_0xad1c('0x1b'),_0x2db328,JSON[_0xad1c('0x11')](_0x2a6953));_0xa80469(_0x2a6953);})[_0xad1c('0x15')](function(_0x1f7a30){logger['error'](_0xad1c('0x1b'),_0x1f7a30['message'],_0x2db328);_0x51d25c(_0x46eb38[_0xad1c('0x12')](0x1f4,_0x1f7a30[_0xad1c('0x14')]));});});}; \ No newline at end of file +var _0xf19c=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','randomstring','ioredis'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0xf19c,0x10b));var _0xcf19=function(_0xda83ec,_0x54a3d6){_0xda83ec=_0xda83ec-0x0;var _0x5b3258=_0xf19c[_0xda83ec];return _0x5b3258;};'use strict';var _=require(_0xcf19('0x0'));var util=require(_0xcf19('0x1'));var moment=require(_0xcf19('0x2'));var BPromise=require('bluebird');var rs=require(_0xcf19('0x3'));var fs=require('fs');var Redis=require(_0xcf19('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcf19('0x5'));var logger=require(_0xcf19('0x6'))(_0xcf19('0x7'));var config=require(_0xcf19('0x8'));var jayson=require(_0xcf19('0x9'));var client=jayson['client'][_0xcf19('0xa')]({'port':0x232a});config[_0xcf19('0xb')]=_[_0xcf19('0xc')](config[_0xcf19('0xb')],{'host':_0xcf19('0xd'),'port':0x18eb});var socket=require(_0xcf19('0xe'))(new Redis(config['redis']));require(_0xcf19('0xf'))[_0xcf19('0x10')](socket);function respondWithRpcPromise(_0xde8967,_0x257184,_0x87afe6){return new BPromise(function(_0x3141eb,_0x3c9355){return client[_0xcf19('0x11')](_0xde8967,_0x87afe6)[_0xcf19('0x12')](function(_0x547a0b){logger[_0xcf19('0x13')](_0xcf19('0x14'),_0x257184,_0xcf19('0x15'));logger[_0xcf19('0x16')](_0xcf19('0x17'),_0x257184,_0xcf19('0x15'),JSON[_0xcf19('0x18')](_0x547a0b));if(_0x547a0b[_0xcf19('0x19')]){if(_0x547a0b[_0xcf19('0x19')][_0xcf19('0x1a')]===0x1f4){logger[_0xcf19('0x19')](_0xcf19('0x14'),_0x257184,_0x547a0b[_0xcf19('0x19')][_0xcf19('0x1b')]);return _0x3c9355(_0x547a0b[_0xcf19('0x19')][_0xcf19('0x1b')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x257184,_0x547a0b[_0xcf19('0x19')][_0xcf19('0x1b')]);return _0x3141eb(_0x547a0b[_0xcf19('0x19')][_0xcf19('0x1b')]);}else{logger[_0xcf19('0x13')](_0xcf19('0x14'),_0x257184,'request\x20sent');_0x3141eb(_0x547a0b[_0xcf19('0x1c')][_0xcf19('0x1b')]);}})['catch'](function(_0x289799){logger['error'](_0xcf19('0x14'),_0x257184,_0x289799);_0x3c9355(_0x289799);});});}exports['CreateOpenchannelMessage']=function(_0x24bfb2){var _0x1cff96=this;return new Promise(function(_0x3cc3e3,_0x2658b9){return db[_0xcf19('0x1d')][_0xcf19('0x1e')](_0x24bfb2['body'],{'raw':_0x24bfb2['options']?_0x24bfb2[_0xcf19('0x1f')][_0xcf19('0x20')]===undefined?!![]:![]:!![]})[_0xcf19('0x12')](function(_0x58ed76){logger[_0xcf19('0x13')](_0xcf19('0x21'),_0x24bfb2);logger[_0xcf19('0x16')](_0xcf19('0x21'),_0x24bfb2,JSON['stringify'](_0x58ed76));_0x3cc3e3(_0x58ed76);})['catch'](function(_0xf2bda6){logger[_0xcf19('0x19')](_0xcf19('0x21'),_0xf2bda6[_0xcf19('0x1b')],_0x24bfb2);_0x2658b9(_0x1cff96[_0xcf19('0x19')](0x1f4,_0xf2bda6[_0xcf19('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index d1176d1..dc7c3f8 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 _0xa9e0=['register','length','openchannelMessage:','./openchannelMessage.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(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var OpenchannelMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){OpenchannelMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);OpenchannelMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xac4a=['save','remove','update','removeListener','./openchannelMessage.events'];(function(_0x5c879e,_0xe58074){var _0x30942b=function(_0x535b57){while(--_0x535b57){_0x5c879e['push'](_0x5c879e['shift']());}};_0x30942b(++_0xe58074);}(_0xac4a,0x13f));var _0xaac4=function(_0x1bb7f7,_0x20fcfa){_0x1bb7f7=_0x1bb7f7-0x0;var _0x3013be=_0xac4a[_0x1bb7f7];return _0x3013be;};'use strict';var OpenchannelMessageEvents=require(_0xaac4('0x0'));var events=[_0xaac4('0x1'),_0xaac4('0x2'),_0xaac4('0x3')];function createListener(_0x38f4f4,_0x1dc251){return function(_0x5aeb7d){_0x1dc251['emit'](_0x38f4f4,_0x5aeb7d);};}function removeListener(_0x2af0f6,_0x2a5762){return function(){OpenchannelMessageEvents[_0xaac4('0x4')](_0x2af0f6,_0x2a5762);};}exports['register']=function(_0x1283a5){for(var _0x53d03a=0x0,_0x1cdfc5=events['length'];_0x53d03a<_0x1cdfc5;_0x53d03a++){var _0x1e4283=events[_0x53d03a];var _0x27354c=createListener('openchannelMessage:'+_0x1e4283,_0x1283a5);OpenchannelMessageEvents['on'](_0x1e4283,_0x27354c);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index b1927bf..9c855da 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 _0xb7a7=['../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x47bb70,_0x332b61){_0x47bb70=_0x47bb70-0x0;var _0x555e0e=_0xb7a7[_0x47bb70];return _0x555e0e;};'use strict';var multer=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var path=require(_0x7b7a('0x2'));var timeout=require(_0x7b7a('0x3'));var express=require(_0x7b7a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7b7a('0x5'));var config=require(_0x7b7a('0x6'));var controller=require(_0x7b7a('0x7'));router['get']('/',auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x9')]);router[_0x7b7a('0xa')](_0x7b7a('0xb'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0xc')]);router[_0x7b7a('0xa')](_0x7b7a('0xd'),auth[_0x7b7a('0x8')](),controller['show']);router[_0x7b7a('0xa')]('/:id/members',auth[_0x7b7a('0x8')](),controller[_0x7b7a('0xe')]);router[_0x7b7a('0xa')](_0x7b7a('0xf'),auth[_0x7b7a('0x8')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7b7a('0x10')]);router[_0x7b7a('0x11')]('/',auth['isAuthenticated'](),controller[_0x7b7a('0x12')]);router[_0x7b7a('0x11')](_0x7b7a('0xf'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x13')]);router[_0x7b7a('0x11')](_0x7b7a('0x14'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x15')]);router[_0x7b7a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7b7a('0x17')]);router[_0x7b7a('0x18')](_0x7b7a('0xd'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x19')]);router['delete'](_0x7b7a('0xf'),auth['isAuthenticated'](),controller[_0x7b7a('0x1a')]);router[_0x7b7a('0x18')](_0x7b7a('0x14'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x1b')]);module[_0x7b7a('0x1c')]=router; \ No newline at end of file +var _0xb76d=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','create','post','addAgents','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x1930ba,_0x599e9e){var _0x1dc4a1=function(_0x3d935e){while(--_0x3d935e){_0x1930ba['push'](_0x1930ba['shift']());}};_0x1dc4a1(++_0x599e9e);}(_0xb76d,0x119));var _0xdb76=function(_0x4ce4f7,_0x39a854){_0x4ce4f7=_0x4ce4f7-0x0;var _0x1f88b4=_0xb76d[_0x4ce4f7];return _0x1f88b4;};'use strict';var multer=require(_0xdb76('0x0'));var util=require('util');var path=require(_0xdb76('0x1'));var timeout=require(_0xdb76('0x2'));var express=require(_0xdb76('0x3'));var router=express['Router']();var auth=require(_0xdb76('0x4'));var interaction=require(_0xdb76('0x5'));var config=require(_0xdb76('0x6'));var controller=require(_0xdb76('0x7'));router[_0xdb76('0x8')]('/',auth[_0xdb76('0x9')](),controller['index']);router[_0xdb76('0x8')](_0xdb76('0xa'),auth[_0xdb76('0x9')](),controller[_0xdb76('0xb')]);router['get'](_0xdb76('0xc'),auth[_0xdb76('0x9')](),controller['show']);router[_0xdb76('0x8')](_0xdb76('0xd'),auth[_0xdb76('0x9')](),controller[_0xdb76('0xe')]);router[_0xdb76('0x8')](_0xdb76('0xf'),auth[_0xdb76('0x9')](),controller['getTeams']);router['get'](_0xdb76('0x10'),auth[_0xdb76('0x9')](),controller[_0xdb76('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdb76('0x12')]);router['post'](_0xdb76('0xf'),auth['isAuthenticated'](),controller['addTeams']);router[_0xdb76('0x13')](_0xdb76('0x10'),auth[_0xdb76('0x9')](),controller[_0xdb76('0x14')]);router['put'](_0xdb76('0xc'),auth[_0xdb76('0x9')](),controller['update']);router[_0xdb76('0x15')](_0xdb76('0xc'),auth[_0xdb76('0x9')](),controller[_0xdb76('0x16')]);router[_0xdb76('0x15')](_0xdb76('0xf'),auth['isAuthenticated'](),controller[_0xdb76('0x17')]);router[_0xdb76('0x15')](_0xdb76('0x10'),auth['isAuthenticated'](),controller[_0xdb76('0x18')]);module[_0xdb76('0x19')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index aec34b9..c93128d 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 _0x8ce1=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x8ce1,0x152));var _0x18ce=function(_0x4b1d6e,_0x4b4a2e){_0x4b1d6e=_0x4b1d6e-0x0;var _0x46629b=_0x8ce1[_0x4b1d6e];return _0x46629b;};'use strict';var Sequelize=require(_0x18ce('0x0'));module[_0x18ce('0x1')]={'name':{'type':Sequelize[_0x18ce('0x2')],'unique':_0x18ce('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x18ce('0x2')]},'timeout':{'type':Sequelize[_0x18ce('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x18ce('0x5')]('rrmemory',_0x18ce('0x6'),_0x18ce('0x7'))}}; \ No newline at end of file +var _0x3ef8=['INTEGER','rrmemory','roundrobin','exports','STRING'];(function(_0x4b35ce,_0x4f1e65){var _0x5e5879=function(_0x9ef94){while(--_0x9ef94){_0x4b35ce['push'](_0x4b35ce['shift']());}};_0x5e5879(++_0x4f1e65);}(_0x3ef8,0xc6));var _0x83ef=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x3ef8[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x83ef('0x0')]={'name':{'type':Sequelize[_0x83ef('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x83ef('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x83ef('0x3'),'beepall',_0x83ef('0x4'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 0dc3b06..0a948eb 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 _0x4e20=['get','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','OpenchannelQueue','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','openchannelPause','createdAt','rows','format','%s/%s','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','ids','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','destroy','then'];(function(_0x3ab45d,_0x4c9e00){var _0xa59256=function(_0x5b7588){while(--_0x5b7588){_0x3ab45d['push'](_0x3ab45d['shift']());}};_0xa59256(++_0x4c9e00);}(_0x4e20,0x173));var _0x04e2=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0x4e20[_0x29d2d2];return _0x3f6476;};'use strict';var pdf=require(_0x04e2('0x0'));var emlformat=require(_0x04e2('0x1'));var rimraf=require(_0x04e2('0x2'));var zipdir=require(_0x04e2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04e2('0x4'));var moment=require(_0x04e2('0x5'));var BPromise=require(_0x04e2('0x6'));var Mustache=require(_0x04e2('0x7'));var util=require(_0x04e2('0x8'));var path=require(_0x04e2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x04e2('0xa'));var fs=require('fs');var _=require(_0x04e2('0xb'));var squel=require(_0x04e2('0xc'));var crypto=require(_0x04e2('0xd'));var jsforce=require(_0x04e2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x04e2('0xf'));var querystring=require(_0x04e2('0x10'));var Papa=require(_0x04e2('0x11'));var Redis=require('ioredis');var authService=require(_0x04e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x04e2('0x13'));var hardwareService=require(_0x04e2('0x14'));var logger=require(_0x04e2('0x15'))(_0x04e2('0x16'));var utils=require(_0x04e2('0x17'));var config=require(_0x04e2('0x18'));var db=require(_0x04e2('0x19'))['db'];config['redis']=_[_0x04e2('0x1a')](config[_0x04e2('0x1b')],{'host':_0x04e2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04e2('0x1b')]));require(_0x04e2('0x1d'))['register'](socket);function respondWithStatusCode(_0x3bb12c,_0x498b4a){_0x498b4a=_0x498b4a||0xcc;return function(_0x3d63bf){if(_0x3d63bf){return _0x3bb12c[_0x04e2('0x1e')](_0x498b4a);}return _0x3bb12c[_0x04e2('0x1f')](_0x498b4a)[_0x04e2('0x20')]();};}function respondWithResult(_0x59d2fc,_0xdcaf1e){_0xdcaf1e=_0xdcaf1e||0xc8;return function(_0x3af2d9){if(_0x3af2d9){return _0x59d2fc['status'](_0xdcaf1e)['json'](_0x3af2d9);}};}function respondWithFilteredResult(_0x50381e,_0x7c608d){return function(_0xb2641a){if(_0xb2641a){var _0x3aa4c9=_0xb2641a[_0x04e2('0x21')],_0x54c64b=_0x7c608d[_0x04e2('0x22')],_0x18b9f6=_0x7c608d['offset']+_0x7c608d[_0x04e2('0x23')],_0x35ea77;if(_0x18b9f6>=_0x3aa4c9){_0x18b9f6=_0x3aa4c9;_0x35ea77=0xc8;}else{_0x35ea77=0xce;}_0x50381e['status'](_0x35ea77);return _0x50381e[_0x04e2('0x24')](_0x04e2('0x25'),_0x54c64b+'-'+_0x18b9f6+'/'+_0x3aa4c9)['json'](_0xb2641a);}return null;};}function patchUpdates(_0x4faba9){return function(_0x59322d){try{jsonpatch[_0x04e2('0x26')](_0x59322d,_0x4faba9,!![]);}catch(_0x4e3f55){return BPromise['reject'](_0x4e3f55);}return _0x59322d[_0x04e2('0x27')]();};}function saveUpdates(_0x13b92f,_0x12f6a9){return function(_0x4db233){if(_0x4db233){return _0x4db233[_0x04e2('0x28')](_0x13b92f)['then'](function(_0x191d65){return _0x191d65;});}return null;};}function removeEntity(_0x26c992,_0x40cdf9){return function(_0x1ef6cc){if(_0x1ef6cc){return _0x1ef6cc[_0x04e2('0x29')]()[_0x04e2('0x2a')](function(){var _0x1d6f12=_0x1ef6cc[_0x04e2('0x2b')]({'plain':!![]});var _0x4e8e4e='OpenchannelQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x4e8e4e,'resourceId':_0x1d6f12['id']}})[_0x04e2('0x2a')](function(){return _0x1ef6cc;});})[_0x04e2('0x2a')](function(){_0x26c992['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3cd8,_0xb28cdf){return function(_0x581e5e){if(!_0x581e5e){_0x2d3cd8['sendStatus'](0x194);}return _0x581e5e;};}function handleError(_0x5dd669,_0x2f8184){_0x2f8184=_0x2f8184||0x1f4;return function(_0x3d8028){logger[_0x04e2('0x2c')](_0x3d8028['stack']);if(_0x3d8028[_0x04e2('0x2d')]){delete _0x3d8028['name'];}_0x5dd669[_0x04e2('0x1f')](_0x2f8184)[_0x04e2('0x2e')](_0x3d8028);};}exports[_0x04e2('0x2f')]=function(_0x234fcb,_0x11bdbe){var _0x22d873={},_0x35b2c9={},_0x456de1={'count':0x0,'rows':[]};var _0x375ea2=_[_0x04e2('0x30')](db['OpenchannelQueue'][_0x04e2('0x31')],function(_0x585f95){return{'name':_0x585f95['fieldName'],'type':_0x585f95[_0x04e2('0x32')][_0x04e2('0x33')]};});_0x35b2c9[_0x04e2('0x34')]=_[_0x04e2('0x30')](_0x375ea2,_0x04e2('0x2d'));_0x35b2c9[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x234fcb[_0x04e2('0x35')]);_0x35b2c9[_0x04e2('0x37')]=_['intersection'](_0x35b2c9[_0x04e2('0x34')],_0x35b2c9['query']);_0x22d873[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x35b2c9[_0x04e2('0x34')],qs['fields'](_0x234fcb[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x22d873[_0x04e2('0x38')]=_0x22d873['attributes'][_0x04e2('0x3b')]?_0x22d873[_0x04e2('0x38')]:_0x35b2c9[_0x04e2('0x34')];if(!_0x234fcb['query'][_0x04e2('0x3c')](_0x04e2('0x3d'))){_0x22d873[_0x04e2('0x23')]=qs[_0x04e2('0x23')](_0x234fcb[_0x04e2('0x35')]['limit']);_0x22d873[_0x04e2('0x22')]=qs[_0x04e2('0x22')](_0x234fcb[_0x04e2('0x35')][_0x04e2('0x22')]);}_0x22d873[_0x04e2('0x3e')]=qs[_0x04e2('0x3f')](_0x234fcb[_0x04e2('0x35')][_0x04e2('0x3f')]);_0x22d873[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_[_0x04e2('0x41')](_0x234fcb[_0x04e2('0x35')],_0x35b2c9['filters']));if(_0x234fcb[_0x04e2('0x35')][_0x04e2('0x42')]){_0x22d873[_0x04e2('0x40')]=_[_0x04e2('0x43')](_0x22d873['where'],{'$or':_[_0x04e2('0x30')](_0x375ea2,function(_0xbe42e4){if(_0xbe42e4[_0x04e2('0x32')]!=='VIRTUAL'){var _0x4ef445={};_0x4ef445[_0xbe42e4[_0x04e2('0x2d')]]={'$like':'%'+_0x234fcb['query'][_0x04e2('0x42')]+'%'};return _0x4ef445;}})});}_0x22d873=_['merge']({},_0x22d873,_0x234fcb[_0x04e2('0x44')]);var _0x31af7b={'where':_0x22d873[_0x04e2('0x40')]};return db['OpenchannelQueue'][_0x04e2('0x21')](_0x31af7b)[_0x04e2('0x2a')](function(_0x2bc710){_0x456de1[_0x04e2('0x21')]=_0x2bc710;if(_0x234fcb[_0x04e2('0x35')][_0x04e2('0x45')]){_0x22d873[_0x04e2('0x46')]=[{'all':!![]}];}return db[_0x04e2('0x47')]['findAll'](_0x22d873);})['then'](function(_0x751685){_0x456de1['rows']=_0x751685;return _0x456de1;})[_0x04e2('0x2a')](respondWithFilteredResult(_0x11bdbe,_0x22d873))[_0x04e2('0x48')](handleError(_0x11bdbe,null));};exports[_0x04e2('0x49')]=function(_0x1d7c7b,_0x3eb7aa){var _0x4f7965={'raw':!![],'where':{'id':_0x1d7c7b[_0x04e2('0x4a')]['id']}},_0x22adba={};_0x22adba['model']=_[_0x04e2('0x36')](db[_0x04e2('0x47')][_0x04e2('0x31')]);_0x22adba[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x1d7c7b[_0x04e2('0x35')]);_0x22adba[_0x04e2('0x37')]=_[_0x04e2('0x39')](_0x22adba['model'],_0x22adba[_0x04e2('0x35')]);_0x4f7965['attributes']=_[_0x04e2('0x39')](_0x22adba[_0x04e2('0x34')],qs[_0x04e2('0x3a')](_0x1d7c7b[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x4f7965['attributes']=_0x4f7965[_0x04e2('0x38')][_0x04e2('0x3b')]?_0x4f7965['attributes']:_0x22adba[_0x04e2('0x34')];if(_0x1d7c7b[_0x04e2('0x35')][_0x04e2('0x45')]){_0x4f7965[_0x04e2('0x46')]=[{'all':!![]}];}_0x4f7965=_[_0x04e2('0x43')]({},_0x4f7965,_0x1d7c7b['options']);return db['OpenchannelQueue'][_0x04e2('0x4b')](_0x4f7965)[_0x04e2('0x2a')](handleEntityNotFound(_0x3eb7aa,null))[_0x04e2('0x2a')](respondWithResult(_0x3eb7aa,null))[_0x04e2('0x48')](handleError(_0x3eb7aa,null));};exports[_0x04e2('0x4c')]=function(_0x1431fc,_0x59c0ac){return db['OpenchannelQueue'][_0x04e2('0x4c')](_0x1431fc[_0x04e2('0x4d')],{})['then'](function(_0x2a6055){var _0x497ab9=_0x1431fc[_0x04e2('0x4e')][_0x04e2('0x2b')]({'plain':!![]});if(!_0x497ab9)throw new Error(_0x04e2('0x4f'));if(_0x497ab9[_0x04e2('0x50')]===_0x04e2('0x4e')){var _0x286275=_0x2a6055['get']({'plain':!![]});var _0x5bd31f=_0x04e2('0x51');return db[_0x04e2('0x52')][_0x04e2('0x4b')]({'where':{'name':_0x5bd31f,'userProfileId':_0x497ab9[_0x04e2('0x53')]},'raw':!![]})[_0x04e2('0x2a')](function(_0x38e38b){if(_0x38e38b&&_0x38e38b[_0x04e2('0x54')]===0x0){return db[_0x04e2('0x55')]['create']({'name':_0x286275[_0x04e2('0x2d')],'resourceId':_0x286275['id'],'type':_0x38e38b[_0x04e2('0x2d')],'sectionId':_0x38e38b['id']},{})['then'](function(){return _0x2a6055;});}else{return _0x2a6055;}})[_0x04e2('0x48')](function(_0x1b939a){logger[_0x04e2('0x2c')](_0x04e2('0x56'),_0x1b939a);throw _0x1b939a;});}return _0x2a6055;})[_0x04e2('0x2a')](respondWithResult(_0x59c0ac,0xc9))[_0x04e2('0x48')](handleError(_0x59c0ac,null));};exports['update']=function(_0x26f4cb,_0x36425a){if(_0x26f4cb[_0x04e2('0x4d')]['id']){delete _0x26f4cb[_0x04e2('0x4d')]['id'];}return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x26f4cb[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x36425a,null))[_0x04e2('0x2a')](saveUpdates(_0x26f4cb[_0x04e2('0x4d')],null))['then'](respondWithResult(_0x36425a,null))['catch'](handleError(_0x36425a,null));};exports[_0x04e2('0x29')]=function(_0x3ae28d,_0x332d76){return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x3ae28d[_0x04e2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x332d76,null))[_0x04e2('0x2a')](removeEntity(_0x332d76,null))[_0x04e2('0x48')](handleError(_0x332d76,null));};exports['describe']=function(_0x4371fc,_0x260148){return db['OpenchannelQueue'][_0x04e2('0x57')]()['then'](respondWithResult(_0x260148,null))['catch'](handleError(_0x260148,null));};exports['getMembers']=function(_0x146127,_0x5cef3b,_0x2c81ba){var _0x4c3bc8={'raw':!![],'where':{}},_0x43d5f1={},_0x24ab07;return db[_0x04e2('0x47')][_0x04e2('0x58')]({'where':{'id':_0x146127[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x5cef3b,null))['then'](function(_0x5b53de){if(_0x5b53de){_0x24ab07=_0x5b53de[_0x04e2('0x2b')]({'plain':!![]});_0x43d5f1[_0x04e2('0x34')]=_[_0x04e2('0x36')](db[_0x04e2('0x59')][_0x04e2('0x31')]);_0x43d5f1['query']=_['keys'](_0x146127['query']);_0x43d5f1[_0x04e2('0x37')]=_[_0x04e2('0x39')](_0x43d5f1['model'],_0x43d5f1['query']);_0x4c3bc8[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x43d5f1[_0x04e2('0x34')],qs[_0x04e2('0x3a')](_0x146127[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x4c3bc8[_0x04e2('0x38')]=_0x4c3bc8['attributes'][_0x04e2('0x3b')]?_0x4c3bc8['attributes']:_0x43d5f1['model'];if(!_0x146127[_0x04e2('0x35')][_0x04e2('0x3c')]('nolimit')){_0x4c3bc8[_0x04e2('0x23')]=qs[_0x04e2('0x23')](_0x146127[_0x04e2('0x35')][_0x04e2('0x23')]);_0x4c3bc8['offset']=qs['offset'](_0x146127[_0x04e2('0x35')][_0x04e2('0x22')]);}_0x4c3bc8['order']=qs['sort'](_0x146127['query'][_0x04e2('0x3f')]);_0x4c3bc8[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_[_0x04e2('0x41')](_0x146127['query'],_0x43d5f1[_0x04e2('0x37')]));_0x4c3bc8[_0x04e2('0x40')][_0x04e2('0x5a')]=_0x5b53de['id'];if(_0x146127['query'][_0x04e2('0x42')]){_0x4c3bc8[_0x04e2('0x40')]=_[_0x04e2('0x43')](_0x4c3bc8[_0x04e2('0x40')],{'$or':_[_0x04e2('0x30')](_0x4c3bc8[_0x04e2('0x38')],function(_0x3b614d){var _0x2f103d={};_0x2f103d[_0x3b614d]={'$like':'%'+_0x146127[_0x04e2('0x35')][_0x04e2('0x42')]+'%'};return _0x2f103d;})});}_0x4c3bc8=_[_0x04e2('0x43')]({},_0x4c3bc8,_0x146127[_0x04e2('0x44')]);return db[_0x04e2('0x59')][_0x04e2('0x5b')](_0x4c3bc8);}})[_0x04e2('0x2a')](function(_0x157324){if(_0x157324){return db[_0x04e2('0x5c')]['findAndCountAll']({'where':{'id':_[_0x04e2('0x30')](_0x157324,'UserId'),'role':'agent'},'attributes':['id',_0x04e2('0x2d'),_0x04e2('0x5d'),'updatedAt',_0x04e2('0x5e')]});}})[_0x04e2('0x2a')](function(_0xb82527){if(_0xb82527){return{'count':_0xb82527[_0x04e2('0x21')],'rows':_['map'](_0xb82527[_0x04e2('0x5f')],function(_0x3c9b2c){return{'membername':_0x3c9b2c[_0x04e2('0x2d')],'UserId':_0x3c9b2c['id'],'queue_name':_0x24ab07[_0x04e2('0x2d')],'OpenchannelQueueId':_0x24ab07['id'],'interface':util[_0x04e2('0x60')](_0x04e2('0x61'),'SIP',_0x3c9b2c[_0x04e2('0x2d')]),'penalty':0x0,'paused':_0x3c9b2c['openchannelPause'],'createdAt':_0x3c9b2c[_0x04e2('0x5e')],'updatedAt':_0x3c9b2c[_0x04e2('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x04e2('0x2a')](respondWithFilteredResult(_0x5cef3b,_0x4c3bc8))[_0x04e2('0x48')](handleError(_0x5cef3b,null));};exports['getTeams']=function(_0x9c3878,_0x2d530e,_0x2837f8){var _0x689b00={};var _0x21bb76={};var _0x2e7679;var _0x276e37;return db[_0x04e2('0x47')]['findOne']({'where':{'id':_0x9c3878[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x2d530e,null))[_0x04e2('0x2a')](function(_0x42e915){if(_0x42e915){_0x2e7679=_0x42e915;_0x21bb76[_0x04e2('0x34')]=_[_0x04e2('0x36')](db[_0x04e2('0x63')][_0x04e2('0x31')]);_0x21bb76[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x9c3878[_0x04e2('0x35')]);_0x21bb76['filters']=_[_0x04e2('0x39')](_0x21bb76[_0x04e2('0x34')],_0x21bb76[_0x04e2('0x35')]);_0x689b00[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x21bb76[_0x04e2('0x34')],qs[_0x04e2('0x3a')](_0x9c3878[_0x04e2('0x35')]['fields']));_0x689b00[_0x04e2('0x38')]=_0x689b00[_0x04e2('0x38')]['length']?_0x689b00[_0x04e2('0x38')]:_0x21bb76[_0x04e2('0x34')];_0x689b00[_0x04e2('0x3e')]=qs[_0x04e2('0x3f')](_0x9c3878[_0x04e2('0x35')][_0x04e2('0x3f')]);_0x689b00[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_[_0x04e2('0x41')](_0x9c3878[_0x04e2('0x35')],_0x21bb76['filters']));if(_0x9c3878['query'][_0x04e2('0x42')]){_0x689b00['where']=_[_0x04e2('0x43')](_0x689b00[_0x04e2('0x40')],{'$or':_[_0x04e2('0x30')](_0x689b00[_0x04e2('0x38')],function(_0x5b1fa5){var _0x399ede={};_0x399ede[_0x5b1fa5]={'$like':'%'+_0x9c3878[_0x04e2('0x35')][_0x04e2('0x42')]+'%'};return _0x399ede;})});}_0x689b00=_['merge']({},_0x689b00,_0x9c3878['options']);return _0x2e7679[_0x04e2('0x64')](_0x689b00);}})[_0x04e2('0x2a')](function(_0x4edf41){if(_0x4edf41){_0x276e37=_0x4edf41[_0x04e2('0x3b')];if(!_0x9c3878[_0x04e2('0x35')][_0x04e2('0x3c')]('nolimit')){_0x689b00[_0x04e2('0x23')]=qs[_0x04e2('0x23')](_0x9c3878['query'][_0x04e2('0x23')]);_0x689b00['offset']=qs[_0x04e2('0x22')](_0x9c3878[_0x04e2('0x35')][_0x04e2('0x22')]);}return _0x2e7679[_0x04e2('0x64')](_0x689b00);}})['then'](function(_0x567aeb){if(_0x567aeb){return _0x567aeb?{'count':_0x276e37,'rows':_0x567aeb}:null;}})[_0x04e2('0x2a')](respondWithResult(_0x2d530e,null))[_0x04e2('0x48')](handleError(_0x2d530e,null));};exports[_0x04e2('0x65')]=function(_0x3cc3f9,_0xdd494d,_0x5020af){var _0x588ceb=_0x3cc3f9['body']['ids'];return db['Team'][_0x04e2('0x5b')]({'where':{'id':_0x588ceb},'attributes':['id'],'include':[{'model':db[_0x04e2('0x5c')],'as':_0x04e2('0x66'),'attributes':['id',_0x04e2('0x2d'),_0x04e2('0x67'),_0x04e2('0x68'),_0x04e2('0x69')],'raw':!![]}]})[_0x04e2('0x2a')](function(_0x3ccc83){if(_0x3ccc83){var _0x1f9f8b=_[_0x04e2('0x6a')](_0x3ccc83,function(_0x2d6c2f){var _0x78a79e=_0x2d6c2f[_0x04e2('0x2b')]({'plain':!![]});return _0x78a79e[_0x04e2('0x66')];});return db[_0x04e2('0x47')]['find']({'where':{'id':_0x3cc3f9[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](function(_0x27dc5f){return db[_0x04e2('0x6b')][_0x04e2('0x6c')](function(_0x3fbed5){return _0x27dc5f[_0x04e2('0x65')](_0x588ceb,{'transaction':_0x3fbed5})[_0x04e2('0x2a')](function(){return BPromise[_0x04e2('0x6d')](_0x1f9f8b,function(_0x3430fb){return db[_0x04e2('0x59')][_0x04e2('0x6e')]({'where':{'UserId':_0x3430fb['id'],'OpenchannelQueueId':_0x3cc3f9[_0x04e2('0x4a')]['id']},'transaction':_0x3fbed5});});})[_0x04e2('0x2a')](function(){_0x1f9f8b[_0x04e2('0x6f')](function(_0x221da6){socket[_0x04e2('0x70')](_0x04e2('0x71'),{'UserId':_0x221da6['id'],'OpenchannelQueueId':_0x27dc5f['id']});});});});});}})[_0x04e2('0x2a')](respondWithStatusCode(_0xdd494d,null))[_0x04e2('0x48')](handleError(_0xdd494d,null));};exports['removeTeams']=function(_0x37c55f,_0x5a81e0,_0x53e094){return db['Team'][_0x04e2('0x5b')]({'where':{'id':_0x37c55f[_0x04e2('0x35')][_0x04e2('0x72')]},'attributes':['id'],'include':[{'model':db[_0x04e2('0x5c')],'as':_0x04e2('0x66'),'attributes':['id'],'raw':!![]}]})[_0x04e2('0x2a')](handleEntityNotFound(_0x5a81e0,null))[_0x04e2('0x2a')](function(_0x3aae2f){var _0x52ddf6=_[_0x04e2('0x30')](_0x3aae2f,'id');var _0x3701da=[];var _0x4b1aca=[];var _0x29c2ac=squel['select']();_0x29c2ac['field'](_0x04e2('0x73'))[_0x04e2('0x74')]('team_has_openchannel_queues','tq')['join'](_0x04e2('0x75'),'ut',_0x04e2('0x76'))['where'](_0x04e2('0x77'),_0x37c55f[_0x04e2('0x4a')]['id']);for(var _0x7085a2=0x0;_0x7085a2<_0x3aae2f[_0x04e2('0x3b')];_0x7085a2+=0x1){let _0x36aa3e=_0x3aae2f[_0x7085a2];for(var _0x370d0f=0x0;_0x370d0f<_0x36aa3e[_0x04e2('0x66')][_0x04e2('0x3b')];_0x370d0f+=0x1){let _0x3a783a=_0x36aa3e[_0x04e2('0x66')][_0x370d0f];var _0x5ed2d8=_0x29c2ac[_0x04e2('0x78')]();_0x5ed2d8[_0x04e2('0x40')](_0x04e2('0x79'),_0x3a783a['id']);_0x4b1aca['push'](db[_0x04e2('0x6b')][_0x04e2('0x35')](_0x5ed2d8['toString'](),{'type':db[_0x04e2('0x6b')][_0x04e2('0x7a')][_0x04e2('0x7b')]})[_0x04e2('0x2a')](function(_0xb2339d){if(_0xb2339d[_0x04e2('0x3b')]===0x1){return _0x3a783a['id'];}else{var _0x54bcc6=_[_0x04e2('0x7c')](_['map'](_0xb2339d,_0x04e2('0x7d')),function(_0x8ee390){return _['includes'](_0x52ddf6,_0x8ee390);});if(_0x54bcc6){return _0x3a783a['id'];}}}));}}return BPromise[_0x04e2('0x7e')](_0x4b1aca)[_0x04e2('0x2a')](function(_0x1591b0){_0x3701da=_(_0x3701da)[_0x04e2('0x7f')](_0x1591b0)[_0x04e2('0x80')]()[_0x04e2('0x81')]();return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x37c55f[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](function(_0x234e63){return db['sequelize'][_0x04e2('0x6c')](function(_0xcbe23b){return _0x234e63[_0x04e2('0x82')](_0x37c55f[_0x04e2('0x35')][_0x04e2('0x72')],{'transaction':_0xcbe23b})[_0x04e2('0x2a')](function(){if(!_[_0x04e2('0x83')](_0x3701da)){return _0x234e63['removeAgents'](_0x3701da,{'transaction':_0xcbe23b});}})[_0x04e2('0x2a')](function(){_0x3701da[_0x04e2('0x6f')](function(_0x5090ca){socket[_0x04e2('0x70')](_0x04e2('0x84'),{'UserId':_0x5090ca,'OpenchannelQueueId':_0x234e63['id']});});});});});});})[_0x04e2('0x2a')](respondWithStatusCode(_0x5a81e0,null))[_0x04e2('0x48')](handleError(_0x5a81e0,null));};exports[_0x04e2('0x85')]=function(_0x3e835a,_0x3ce587,_0x150229){return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x3e835a[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x3ce587,null))[_0x04e2('0x2a')](function(_0x33363c){if(_0x33363c){return _0x33363c[_0x04e2('0x85')](_0x3e835a['body']['ids'],_[_0x04e2('0x86')](_0x3e835a[_0x04e2('0x4d')],['ids','id'])||{})['spread'](function(_0xf0e040){for(var _0x233c42=0x0;_0x233c42<_0x3e835a['body']['ids']['length'];_0x233c42+=0x1){socket[_0x04e2('0x70')](_0x04e2('0x71'),{'UserId':_0x3e835a[_0x04e2('0x4d')][_0x04e2('0x72')][_0x233c42],'OpenchannelQueueId':_0x3e835a['params']['id']});}return _0xf0e040;});}})[_0x04e2('0x2a')](respondWithResult(_0x3ce587,null))['catch'](handleError(_0x3ce587,null));};exports[_0x04e2('0x87')]=function(_0x317610,_0x391161,_0x2ad3b6){return db[_0x04e2('0x47')]['find']({'where':{'id':_0x317610[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x391161,null))[_0x04e2('0x2a')](function(_0x23f5a9){if(_0x23f5a9){return _0x23f5a9['removeAgents'](_0x317610['query'][_0x04e2('0x72')])[_0x04e2('0x2a')](function(){if(_[_0x04e2('0x88')](_0x317610[_0x04e2('0x35')][_0x04e2('0x72')])){for(var _0x559a5e=0x0;_0x559a5e<_0x317610[_0x04e2('0x35')][_0x04e2('0x72')][_0x04e2('0x3b')];_0x559a5e+=0x1){socket['emit'](_0x04e2('0x84'),{'UserId':Number(_0x317610[_0x04e2('0x35')][_0x04e2('0x72')][_0x559a5e]),'OpenchannelQueueId':Number(_0x317610[_0x04e2('0x4a')]['id'])});}}else{socket[_0x04e2('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x317610[_0x04e2('0x35')][_0x04e2('0x72')]),'OpenchannelQueueId':Number(_0x317610[_0x04e2('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x391161,null))[_0x04e2('0x48')](handleError(_0x391161,null));};exports['getAgents']=function(_0x576d5b,_0x302b25,_0x359ae5){var _0x1c9669={};var _0x1b39db={};var _0x43f62e;var _0x1c6ecc;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x576d5b[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x302b25,null))['then'](function(_0xb574e3){if(_0xb574e3){_0x43f62e=_0xb574e3;_0x1b39db[_0x04e2('0x34')]=_[_0x04e2('0x36')](db[_0x04e2('0x5c')]['rawAttributes']);_0x1b39db[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x576d5b[_0x04e2('0x35')]);_0x1b39db[_0x04e2('0x37')]=_['intersection'](_0x1b39db[_0x04e2('0x34')],_0x1b39db[_0x04e2('0x35')]);_0x1c9669[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x1b39db[_0x04e2('0x34')],qs['fields'](_0x576d5b[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x1c9669[_0x04e2('0x38')]=_0x1c9669['attributes'][_0x04e2('0x3b')]?_0x1c9669[_0x04e2('0x38')]:_0x1b39db['model'];_0x1c9669['order']=qs[_0x04e2('0x3f')](_0x576d5b[_0x04e2('0x35')][_0x04e2('0x3f')]);_0x1c9669[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_['pick'](_0x576d5b[_0x04e2('0x35')],_0x1b39db[_0x04e2('0x37')]));if(_0x576d5b['query']['filter']){_0x1c9669['where']=_['merge'](_0x1c9669[_0x04e2('0x40')],{'$or':_[_0x04e2('0x30')](_0x1c9669[_0x04e2('0x38')],function(_0x2cb9ee){var _0x530351={};_0x530351[_0x2cb9ee]={'$like':'%'+_0x576d5b['query'][_0x04e2('0x42')]+'%'};return _0x530351;})});}_0x1c9669=_[_0x04e2('0x43')]({},_0x1c9669,_0x576d5b[_0x04e2('0x44')]);return _0x43f62e[_0x04e2('0x89')](_0x1c9669);}})[_0x04e2('0x2a')](function(_0x5ac779){if(_0x5ac779){_0x1c6ecc=_0x5ac779['length'];if(!_0x576d5b[_0x04e2('0x35')][_0x04e2('0x3c')](_0x04e2('0x3d'))){_0x1c9669['limit']=qs[_0x04e2('0x23')](_0x576d5b[_0x04e2('0x35')][_0x04e2('0x23')]);_0x1c9669[_0x04e2('0x22')]=qs[_0x04e2('0x22')](_0x576d5b['query'][_0x04e2('0x22')]);}return _0x43f62e[_0x04e2('0x89')](_0x1c9669);}})[_0x04e2('0x2a')](function(_0x47d746){if(_0x47d746){return _0x47d746?{'count':_0x1c6ecc,'rows':_0x47d746}:null;}})['then'](respondWithResult(_0x302b25,null))['catch'](handleError(_0x302b25,null));}; \ No newline at end of file +var _0x2c21=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','OpenchannelQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','OpenchannelQueueId','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','forEach','emit','userOpenchannelQueue:save','removeTeams','Team','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','union','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','error','stack','name','map','OpenchannelQueue','rawAttributes','type'];(function(_0x5806c3,_0x5105d8){var _0x48ac77=function(_0x4826ec){while(--_0x4826ec){_0x5806c3['push'](_0x5806c3['shift']());}};_0x48ac77(++_0x5105d8);}(_0x2c21,0xe0));var _0x12c2=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x2c21[_0x26bcec];return _0x1049dc;};'use strict';var pdf=require(_0x12c2('0x0'));var emlformat=require(_0x12c2('0x1'));var rimraf=require(_0x12c2('0x2'));var zipdir=require(_0x12c2('0x3'));var jsonpatch=require(_0x12c2('0x4'));var rp=require('request-promise');var moment=require(_0x12c2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x12c2('0x6'));var util=require('util');var path=require(_0x12c2('0x7'));var sox=require(_0x12c2('0x8'));var csv=require(_0x12c2('0x9'));var ejs=require(_0x12c2('0xa'));var fs=require('fs');var _=require(_0x12c2('0xb'));var squel=require('squel');var crypto=require(_0x12c2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x12c2('0xd'));var toCsv=require(_0x12c2('0x9'));var querystring=require(_0x12c2('0xe'));var Papa=require(_0x12c2('0xf'));var Redis=require('ioredis');var authService=require(_0x12c2('0x10'));var qs=require(_0x12c2('0x11'));var as=require(_0x12c2('0x12'));var hardwareService=require(_0x12c2('0x13'));var logger=require(_0x12c2('0x14'))('api');var utils=require(_0x12c2('0x15'));var config=require(_0x12c2('0x16'));var db=require(_0x12c2('0x17'))['db'];config[_0x12c2('0x18')]=_['defaults'](config[_0x12c2('0x18')],{'host':_0x12c2('0x19'),'port':0x18eb});var socket=require(_0x12c2('0x1a'))(new Redis(config[_0x12c2('0x18')]));require(_0x12c2('0x1b'))['register'](socket);function respondWithStatusCode(_0x26af22,_0x299215){_0x299215=_0x299215||0xcc;return function(_0x458bd3){if(_0x458bd3){return _0x26af22[_0x12c2('0x1c')](_0x299215);}return _0x26af22[_0x12c2('0x1d')](_0x299215)[_0x12c2('0x1e')]();};}function respondWithResult(_0x172bcb,_0x46fa87){_0x46fa87=_0x46fa87||0xc8;return function(_0x3324db){if(_0x3324db){return _0x172bcb[_0x12c2('0x1d')](_0x46fa87)[_0x12c2('0x1f')](_0x3324db);}};}function respondWithFilteredResult(_0x59aca4,_0x10aaa3){return function(_0x192e46){if(_0x192e46){var _0x5eafaa=_0x192e46[_0x12c2('0x20')],_0x2aad91=_0x10aaa3[_0x12c2('0x21')],_0x560941=_0x10aaa3[_0x12c2('0x21')]+_0x10aaa3[_0x12c2('0x22')],_0x57aa03;if(_0x560941>=_0x5eafaa){_0x560941=_0x5eafaa;_0x57aa03=0xc8;}else{_0x57aa03=0xce;}_0x59aca4[_0x12c2('0x1d')](_0x57aa03);return _0x59aca4[_0x12c2('0x23')](_0x12c2('0x24'),_0x2aad91+'-'+_0x560941+'/'+_0x5eafaa)['json'](_0x192e46);}return null;};}function patchUpdates(_0x10a5d2){return function(_0x4ea72f){try{jsonpatch['apply'](_0x4ea72f,_0x10a5d2,!![]);}catch(_0x5ede0b){return BPromise[_0x12c2('0x25')](_0x5ede0b);}return _0x4ea72f['save']();};}function saveUpdates(_0x40ee20,_0x9e0362){return function(_0x595f77){if(_0x595f77){return _0x595f77[_0x12c2('0x26')](_0x40ee20)[_0x12c2('0x27')](function(_0x2684c4){return _0x2684c4;});}return null;};}function removeEntity(_0x139a8f,_0x2c4df7){return function(_0x45d921){if(_0x45d921){return _0x45d921[_0x12c2('0x28')]()[_0x12c2('0x27')](function(){var _0x19cde7=_0x45d921[_0x12c2('0x29')]({'plain':!![]});var _0xadc19b='OpenchannelQueues';return db[_0x12c2('0x2a')][_0x12c2('0x28')]({'where':{'type':_0xadc19b,'resourceId':_0x19cde7['id']}})[_0x12c2('0x27')](function(){return _0x45d921;});})['then'](function(){_0x139a8f[_0x12c2('0x1d')](0xcc)[_0x12c2('0x1e')]();});}};}function handleEntityNotFound(_0x24322d,_0xed2b0d){return function(_0x3e0421){if(!_0x3e0421){_0x24322d[_0x12c2('0x1c')](0x194);}return _0x3e0421;};}function handleError(_0x11166c,_0x30666c){_0x30666c=_0x30666c||0x1f4;return function(_0x47ac0c){logger[_0x12c2('0x2b')](_0x47ac0c[_0x12c2('0x2c')]);if(_0x47ac0c[_0x12c2('0x2d')]){delete _0x47ac0c['name'];}_0x11166c['status'](_0x30666c)['send'](_0x47ac0c);};}exports['index']=function(_0x1c924e,_0x357041){var _0x17ceb1={},_0x5a0c79={},_0x1ad22f={'count':0x0,'rows':[]};var _0x1576b1=_[_0x12c2('0x2e')](db[_0x12c2('0x2f')][_0x12c2('0x30')],function(_0x2b38f0){return{'name':_0x2b38f0['fieldName'],'type':_0x2b38f0[_0x12c2('0x31')]['key']};});_0x5a0c79[_0x12c2('0x32')]=_[_0x12c2('0x2e')](_0x1576b1,_0x12c2('0x2d'));_0x5a0c79[_0x12c2('0x33')]=_['keys'](_0x1c924e[_0x12c2('0x33')]);_0x5a0c79[_0x12c2('0x34')]=_[_0x12c2('0x35')](_0x5a0c79['model'],_0x5a0c79['query']);_0x17ceb1[_0x12c2('0x36')]=_['intersection'](_0x5a0c79[_0x12c2('0x32')],qs[_0x12c2('0x37')](_0x1c924e[_0x12c2('0x33')]['fields']));_0x17ceb1[_0x12c2('0x36')]=_0x17ceb1[_0x12c2('0x36')][_0x12c2('0x38')]?_0x17ceb1['attributes']:_0x5a0c79[_0x12c2('0x32')];if(!_0x1c924e['query'][_0x12c2('0x39')](_0x12c2('0x3a'))){_0x17ceb1['limit']=qs[_0x12c2('0x22')](_0x1c924e[_0x12c2('0x33')][_0x12c2('0x22')]);_0x17ceb1[_0x12c2('0x21')]=qs[_0x12c2('0x21')](_0x1c924e[_0x12c2('0x33')]['offset']);}_0x17ceb1['order']=qs[_0x12c2('0x3b')](_0x1c924e[_0x12c2('0x33')][_0x12c2('0x3b')]);_0x17ceb1[_0x12c2('0x3c')]=qs[_0x12c2('0x34')](_[_0x12c2('0x3d')](_0x1c924e['query'],_0x5a0c79[_0x12c2('0x34')]));if(_0x1c924e[_0x12c2('0x33')][_0x12c2('0x3e')]){_0x17ceb1[_0x12c2('0x3c')]=_[_0x12c2('0x3f')](_0x17ceb1['where'],{'$or':_[_0x12c2('0x2e')](_0x1576b1,function(_0x19387b){if(_0x19387b[_0x12c2('0x31')]!==_0x12c2('0x40')){var _0x3211af={};_0x3211af[_0x19387b[_0x12c2('0x2d')]]={'$like':'%'+_0x1c924e[_0x12c2('0x33')][_0x12c2('0x3e')]+'%'};return _0x3211af;}})});}_0x17ceb1=_[_0x12c2('0x3f')]({},_0x17ceb1,_0x1c924e[_0x12c2('0x41')]);var _0x719d33={'where':_0x17ceb1[_0x12c2('0x3c')]};return db[_0x12c2('0x2f')]['count'](_0x719d33)[_0x12c2('0x27')](function(_0x5946d5){_0x1ad22f[_0x12c2('0x20')]=_0x5946d5;if(_0x1c924e[_0x12c2('0x33')][_0x12c2('0x42')]){_0x17ceb1[_0x12c2('0x43')]=[{'all':!![]}];}return db[_0x12c2('0x2f')][_0x12c2('0x44')](_0x17ceb1);})['then'](function(_0x3859f3){_0x1ad22f[_0x12c2('0x45')]=_0x3859f3;return _0x1ad22f;})[_0x12c2('0x27')](respondWithFilteredResult(_0x357041,_0x17ceb1))['catch'](handleError(_0x357041,null));};exports[_0x12c2('0x46')]=function(_0x475f44,_0x2c2358){var _0x1df0df={'raw':!![],'where':{'id':_0x475f44[_0x12c2('0x47')]['id']}},_0x30c32b={};_0x30c32b['model']=_[_0x12c2('0x48')](db['OpenchannelQueue'][_0x12c2('0x30')]);_0x30c32b[_0x12c2('0x33')]=_[_0x12c2('0x48')](_0x475f44[_0x12c2('0x33')]);_0x30c32b['filters']=_['intersection'](_0x30c32b['model'],_0x30c32b[_0x12c2('0x33')]);_0x1df0df[_0x12c2('0x36')]=_['intersection'](_0x30c32b[_0x12c2('0x32')],qs['fields'](_0x475f44[_0x12c2('0x33')][_0x12c2('0x37')]));_0x1df0df['attributes']=_0x1df0df['attributes']['length']?_0x1df0df[_0x12c2('0x36')]:_0x30c32b[_0x12c2('0x32')];if(_0x475f44[_0x12c2('0x33')]['includeAll']){_0x1df0df['include']=[{'all':!![]}];}_0x1df0df=_[_0x12c2('0x3f')]({},_0x1df0df,_0x475f44[_0x12c2('0x41')]);return db['OpenchannelQueue'][_0x12c2('0x49')](_0x1df0df)[_0x12c2('0x27')](handleEntityNotFound(_0x2c2358,null))[_0x12c2('0x27')](respondWithResult(_0x2c2358,null))[_0x12c2('0x4a')](handleError(_0x2c2358,null));};exports[_0x12c2('0x4b')]=function(_0x3b60ce,_0x431968){return db[_0x12c2('0x2f')][_0x12c2('0x4b')](_0x3b60ce[_0x12c2('0x4c')],{})['then'](function(_0x4e912f){var _0x58ed99=_0x3b60ce['user'][_0x12c2('0x29')]({'plain':!![]});if(!_0x58ed99)throw new Error(_0x12c2('0x4d'));if(_0x58ed99[_0x12c2('0x4e')]===_0x12c2('0x4f')){var _0x4f3259=_0x4e912f[_0x12c2('0x29')]({'plain':!![]});var _0x71c50b=_0x12c2('0x50');return db['UserProfileSection'][_0x12c2('0x49')]({'where':{'name':_0x71c50b,'userProfileId':_0x58ed99[_0x12c2('0x51')]},'raw':!![]})[_0x12c2('0x27')](function(_0x125102){if(_0x125102&&_0x125102[_0x12c2('0x52')]===0x0){return db[_0x12c2('0x2a')]['create']({'name':_0x4f3259['name'],'resourceId':_0x4f3259['id'],'type':_0x125102[_0x12c2('0x2d')],'sectionId':_0x125102['id']},{})[_0x12c2('0x27')](function(){return _0x4e912f;});}else{return _0x4e912f;}})[_0x12c2('0x4a')](function(_0x305e99){logger['error'](_0x12c2('0x53'),_0x305e99);throw _0x305e99;});}return _0x4e912f;})['then'](respondWithResult(_0x431968,0xc9))[_0x12c2('0x4a')](handleError(_0x431968,null));};exports[_0x12c2('0x26')]=function(_0x2fe00f,_0x2b77f4){if(_0x2fe00f[_0x12c2('0x4c')]['id']){delete _0x2fe00f['body']['id'];}return db[_0x12c2('0x2f')][_0x12c2('0x49')]({'where':{'id':_0x2fe00f[_0x12c2('0x47')]['id']}})[_0x12c2('0x27')](handleEntityNotFound(_0x2b77f4,null))[_0x12c2('0x27')](saveUpdates(_0x2fe00f[_0x12c2('0x4c')],null))[_0x12c2('0x27')](respondWithResult(_0x2b77f4,null))[_0x12c2('0x4a')](handleError(_0x2b77f4,null));};exports[_0x12c2('0x28')]=function(_0x54aa2d,_0x216867){return db[_0x12c2('0x2f')][_0x12c2('0x49')]({'where':{'id':_0x54aa2d['params']['id']}})['then'](handleEntityNotFound(_0x216867,null))[_0x12c2('0x27')](removeEntity(_0x216867,null))[_0x12c2('0x4a')](handleError(_0x216867,null));};exports['describe']=function(_0x45b08e,_0x101aa2){return db[_0x12c2('0x2f')][_0x12c2('0x54')]()['then'](respondWithResult(_0x101aa2,null))['catch'](handleError(_0x101aa2,null));};exports[_0x12c2('0x55')]=function(_0x167964,_0x3da58d,_0x1e11e6){var _0x1b918f={'raw':!![],'where':{}},_0x36df22={},_0x554395;return db['OpenchannelQueue'][_0x12c2('0x56')]({'where':{'id':_0x167964[_0x12c2('0x47')]['id']}})[_0x12c2('0x27')](handleEntityNotFound(_0x3da58d,null))[_0x12c2('0x27')](function(_0x2d4bab){if(_0x2d4bab){_0x554395=_0x2d4bab[_0x12c2('0x29')]({'plain':!![]});_0x36df22[_0x12c2('0x32')]=_['keys'](db['UserOpenchannelQueue'][_0x12c2('0x30')]);_0x36df22[_0x12c2('0x33')]=_[_0x12c2('0x48')](_0x167964[_0x12c2('0x33')]);_0x36df22[_0x12c2('0x34')]=_[_0x12c2('0x35')](_0x36df22[_0x12c2('0x32')],_0x36df22[_0x12c2('0x33')]);_0x1b918f[_0x12c2('0x36')]=_[_0x12c2('0x35')](_0x36df22[_0x12c2('0x32')],qs['fields'](_0x167964[_0x12c2('0x33')][_0x12c2('0x37')]));_0x1b918f[_0x12c2('0x36')]=_0x1b918f[_0x12c2('0x36')]['length']?_0x1b918f[_0x12c2('0x36')]:_0x36df22[_0x12c2('0x32')];if(!_0x167964[_0x12c2('0x33')][_0x12c2('0x39')](_0x12c2('0x3a'))){_0x1b918f[_0x12c2('0x22')]=qs[_0x12c2('0x22')](_0x167964['query'][_0x12c2('0x22')]);_0x1b918f[_0x12c2('0x21')]=qs[_0x12c2('0x21')](_0x167964[_0x12c2('0x33')][_0x12c2('0x21')]);}_0x1b918f[_0x12c2('0x57')]=qs['sort'](_0x167964['query'][_0x12c2('0x3b')]);_0x1b918f[_0x12c2('0x3c')]=qs[_0x12c2('0x34')](_['pick'](_0x167964['query'],_0x36df22['filters']));_0x1b918f[_0x12c2('0x3c')][_0x12c2('0x58')]=_0x2d4bab['id'];if(_0x167964['query'][_0x12c2('0x3e')]){_0x1b918f[_0x12c2('0x3c')]=_[_0x12c2('0x3f')](_0x1b918f['where'],{'$or':_[_0x12c2('0x2e')](_0x1b918f['attributes'],function(_0x507402){var _0xd72370={};_0xd72370[_0x507402]={'$like':'%'+_0x167964['query'][_0x12c2('0x3e')]+'%'};return _0xd72370;})});}_0x1b918f=_[_0x12c2('0x3f')]({},_0x1b918f,_0x167964[_0x12c2('0x41')]);return db[_0x12c2('0x59')][_0x12c2('0x44')](_0x1b918f);}})['then'](function(_0x21b307){if(_0x21b307){return db[_0x12c2('0x5a')][_0x12c2('0x5b')]({'where':{'id':_[_0x12c2('0x2e')](_0x21b307,_0x12c2('0x5c')),'role':_0x12c2('0x5d')},'attributes':['id',_0x12c2('0x2d'),_0x12c2('0x5e'),_0x12c2('0x5f'),_0x12c2('0x60')]});}})[_0x12c2('0x27')](function(_0x599980){if(_0x599980){return{'count':_0x599980[_0x12c2('0x20')],'rows':_['map'](_0x599980[_0x12c2('0x45')],function(_0x193676){return{'membername':_0x193676[_0x12c2('0x2d')],'UserId':_0x193676['id'],'queue_name':_0x554395[_0x12c2('0x2d')],'OpenchannelQueueId':_0x554395['id'],'interface':util[_0x12c2('0x61')](_0x12c2('0x62'),_0x12c2('0x63'),_0x193676[_0x12c2('0x2d')]),'penalty':0x0,'paused':_0x193676[_0x12c2('0x5e')],'createdAt':_0x193676[_0x12c2('0x60')],'updatedAt':_0x193676[_0x12c2('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x12c2('0x27')](respondWithFilteredResult(_0x3da58d,_0x1b918f))[_0x12c2('0x4a')](handleError(_0x3da58d,null));};exports['getTeams']=function(_0x59afbe,_0x10f93b,_0x47204a){var _0x497feb={};var _0x1db4d4={};var _0x18433c;var _0x15f97c;return db[_0x12c2('0x2f')][_0x12c2('0x56')]({'where':{'id':_0x59afbe[_0x12c2('0x47')]['id']}})[_0x12c2('0x27')](handleEntityNotFound(_0x10f93b,null))[_0x12c2('0x27')](function(_0x474016){if(_0x474016){_0x18433c=_0x474016;_0x1db4d4[_0x12c2('0x32')]=_[_0x12c2('0x48')](db['Team'][_0x12c2('0x30')]);_0x1db4d4[_0x12c2('0x33')]=_[_0x12c2('0x48')](_0x59afbe[_0x12c2('0x33')]);_0x1db4d4[_0x12c2('0x34')]=_[_0x12c2('0x35')](_0x1db4d4[_0x12c2('0x32')],_0x1db4d4[_0x12c2('0x33')]);_0x497feb['attributes']=_[_0x12c2('0x35')](_0x1db4d4[_0x12c2('0x32')],qs[_0x12c2('0x37')](_0x59afbe[_0x12c2('0x33')][_0x12c2('0x37')]));_0x497feb[_0x12c2('0x36')]=_0x497feb[_0x12c2('0x36')][_0x12c2('0x38')]?_0x497feb[_0x12c2('0x36')]:_0x1db4d4['model'];_0x497feb[_0x12c2('0x57')]=qs['sort'](_0x59afbe[_0x12c2('0x33')][_0x12c2('0x3b')]);_0x497feb[_0x12c2('0x3c')]=qs['filters'](_[_0x12c2('0x3d')](_0x59afbe[_0x12c2('0x33')],_0x1db4d4[_0x12c2('0x34')]));if(_0x59afbe[_0x12c2('0x33')]['filter']){_0x497feb[_0x12c2('0x3c')]=_[_0x12c2('0x3f')](_0x497feb[_0x12c2('0x3c')],{'$or':_['map'](_0x497feb[_0x12c2('0x36')],function(_0x32339b){var _0x96512={};_0x96512[_0x32339b]={'$like':'%'+_0x59afbe[_0x12c2('0x33')][_0x12c2('0x3e')]+'%'};return _0x96512;})});}_0x497feb=_[_0x12c2('0x3f')]({},_0x497feb,_0x59afbe['options']);return _0x18433c['getTeams'](_0x497feb);}})['then'](function(_0x475f38){if(_0x475f38){_0x15f97c=_0x475f38['length'];if(!_0x59afbe[_0x12c2('0x33')][_0x12c2('0x39')](_0x12c2('0x3a'))){_0x497feb['limit']=qs[_0x12c2('0x22')](_0x59afbe['query']['limit']);_0x497feb[_0x12c2('0x21')]=qs['offset'](_0x59afbe[_0x12c2('0x33')]['offset']);}return _0x18433c[_0x12c2('0x64')](_0x497feb);}})[_0x12c2('0x27')](function(_0xe1a692){if(_0xe1a692){return _0xe1a692?{'count':_0x15f97c,'rows':_0xe1a692}:null;}})[_0x12c2('0x27')](respondWithResult(_0x10f93b,null))[_0x12c2('0x4a')](handleError(_0x10f93b,null));};exports['addTeams']=function(_0x5cdaf2,_0x2a427d,_0x1f5342){var _0x299060=_0x5cdaf2[_0x12c2('0x4c')][_0x12c2('0x65')];return db['Team'][_0x12c2('0x44')]({'where':{'id':_0x299060},'attributes':['id'],'include':[{'model':db[_0x12c2('0x5a')],'as':_0x12c2('0x66'),'attributes':['id',_0x12c2('0x2d'),_0x12c2('0x67'),_0x12c2('0x68'),_0x12c2('0x69')],'raw':!![]}]})[_0x12c2('0x27')](function(_0x4ae1f7){if(_0x4ae1f7){var _0x578d19=_[_0x12c2('0x6a')](_0x4ae1f7,function(_0x37fd8b){var _0x541892=_0x37fd8b[_0x12c2('0x29')]({'plain':!![]});return _0x541892[_0x12c2('0x66')];});return db[_0x12c2('0x2f')][_0x12c2('0x49')]({'where':{'id':_0x5cdaf2[_0x12c2('0x47')]['id']}})[_0x12c2('0x27')](function(_0x51fbae){return db[_0x12c2('0x6b')][_0x12c2('0x6c')](function(_0x437be4){return _0x51fbae[_0x12c2('0x6d')](_0x299060,{'transaction':_0x437be4})[_0x12c2('0x27')](function(){return BPromise[_0x12c2('0x6e')](_0x578d19,function(_0x536343){return db[_0x12c2('0x59')]['findOrCreate']({'where':{'UserId':_0x536343['id'],'OpenchannelQueueId':_0x5cdaf2[_0x12c2('0x47')]['id']},'transaction':_0x437be4});});})[_0x12c2('0x27')](function(){_0x578d19[_0x12c2('0x6f')](function(_0x5bcc1d){socket[_0x12c2('0x70')](_0x12c2('0x71'),{'UserId':_0x5bcc1d['id'],'OpenchannelQueueId':_0x51fbae['id']});});});});});}})[_0x12c2('0x27')](respondWithStatusCode(_0x2a427d,null))[_0x12c2('0x4a')](handleError(_0x2a427d,null));};exports[_0x12c2('0x72')]=function(_0x74fbf3,_0x39583d,_0x472c24){return db[_0x12c2('0x73')]['findAll']({'where':{'id':_0x74fbf3['query'][_0x12c2('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x12c2('0x66'),'attributes':['id'],'raw':!![]}]})[_0x12c2('0x27')](handleEntityNotFound(_0x39583d,null))[_0x12c2('0x27')](function(_0x1d7cb5){var _0x4d2625=_['map'](_0x1d7cb5,'id');var _0x4e574d=[];var _0x31693c=[];var _0x1eb15b=squel[_0x12c2('0x74')]();_0x1eb15b[_0x12c2('0x75')](_0x12c2('0x76'))[_0x12c2('0x77')]('team_has_openchannel_queues','tq')['join'](_0x12c2('0x78'),'ut',_0x12c2('0x79'))[_0x12c2('0x3c')](_0x12c2('0x7a'),_0x74fbf3[_0x12c2('0x47')]['id']);for(var _0x7fb687=0x0;_0x7fb687<_0x1d7cb5['length'];_0x7fb687+=0x1){let _0x12b151=_0x1d7cb5[_0x7fb687];for(var _0x18f8b5=0x0;_0x18f8b5<_0x12b151[_0x12c2('0x66')][_0x12c2('0x38')];_0x18f8b5+=0x1){let _0x4ce099=_0x12b151[_0x12c2('0x66')][_0x18f8b5];var _0x48bb22=_0x1eb15b['clone']();_0x48bb22[_0x12c2('0x3c')](_0x12c2('0x7b'),_0x4ce099['id']);_0x31693c['push'](db[_0x12c2('0x6b')][_0x12c2('0x33')](_0x48bb22[_0x12c2('0x7c')](),{'type':db[_0x12c2('0x6b')][_0x12c2('0x7d')][_0x12c2('0x7e')]})[_0x12c2('0x27')](function(_0x50db6b){if(_0x50db6b[_0x12c2('0x38')]===0x1){return _0x4ce099['id'];}else{var _0x1f9039=_['every'](_['map'](_0x50db6b,_0x12c2('0x7f')),function(_0x4c34f8){return _[_0x12c2('0x80')](_0x4d2625,_0x4c34f8);});if(_0x1f9039){return _0x4ce099['id'];}}}));}}return BPromise['all'](_0x31693c)[_0x12c2('0x27')](function(_0x47badd){_0x4e574d=_(_0x4e574d)[_0x12c2('0x81')](_0x47badd)['compact']()['value']();return db[_0x12c2('0x2f')]['find']({'where':{'id':_0x74fbf3[_0x12c2('0x47')]['id']}})['then'](function(_0x1399ec){return db['sequelize'][_0x12c2('0x6c')](function(_0x4eb50a){return _0x1399ec['removeTeams'](_0x74fbf3['query'][_0x12c2('0x65')],{'transaction':_0x4eb50a})[_0x12c2('0x27')](function(){if(!_[_0x12c2('0x82')](_0x4e574d)){return _0x1399ec[_0x12c2('0x83')](_0x4e574d,{'transaction':_0x4eb50a});}})['then'](function(){_0x4e574d[_0x12c2('0x6f')](function(_0x5a1989){socket['emit'](_0x12c2('0x84'),{'UserId':_0x5a1989,'OpenchannelQueueId':_0x1399ec['id']});});});});});});})[_0x12c2('0x27')](respondWithStatusCode(_0x39583d,null))[_0x12c2('0x4a')](handleError(_0x39583d,null));};exports[_0x12c2('0x85')]=function(_0x28b235,_0x382890,_0x35fbbf){return db[_0x12c2('0x2f')][_0x12c2('0x49')]({'where':{'id':_0x28b235[_0x12c2('0x47')]['id']}})[_0x12c2('0x27')](handleEntityNotFound(_0x382890,null))[_0x12c2('0x27')](function(_0x52171d){if(_0x52171d){return _0x52171d[_0x12c2('0x85')](_0x28b235[_0x12c2('0x4c')][_0x12c2('0x65')],_[_0x12c2('0x86')](_0x28b235[_0x12c2('0x4c')],['ids','id'])||{})['spread'](function(_0x5af08a){for(var _0x3c9e2c=0x0;_0x3c9e2c<_0x28b235[_0x12c2('0x4c')][_0x12c2('0x65')]['length'];_0x3c9e2c+=0x1){socket[_0x12c2('0x70')](_0x12c2('0x71'),{'UserId':_0x28b235[_0x12c2('0x4c')][_0x12c2('0x65')][_0x3c9e2c],'OpenchannelQueueId':_0x28b235[_0x12c2('0x47')]['id']});}return _0x5af08a;});}})[_0x12c2('0x27')](respondWithResult(_0x382890,null))['catch'](handleError(_0x382890,null));};exports[_0x12c2('0x83')]=function(_0x5f2ea0,_0x401f5b,_0x4081cc){return db[_0x12c2('0x2f')][_0x12c2('0x49')]({'where':{'id':_0x5f2ea0[_0x12c2('0x47')]['id']}})[_0x12c2('0x27')](handleEntityNotFound(_0x401f5b,null))['then'](function(_0x49f978){if(_0x49f978){return _0x49f978[_0x12c2('0x83')](_0x5f2ea0[_0x12c2('0x33')][_0x12c2('0x65')])[_0x12c2('0x27')](function(){if(_[_0x12c2('0x87')](_0x5f2ea0[_0x12c2('0x33')]['ids'])){for(var _0x3301ab=0x0;_0x3301ab<_0x5f2ea0[_0x12c2('0x33')][_0x12c2('0x65')][_0x12c2('0x38')];_0x3301ab+=0x1){socket[_0x12c2('0x70')](_0x12c2('0x84'),{'UserId':Number(_0x5f2ea0['query']['ids'][_0x3301ab]),'OpenchannelQueueId':Number(_0x5f2ea0['params']['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x5f2ea0['query'][_0x12c2('0x65')]),'OpenchannelQueueId':Number(_0x5f2ea0['params']['id'])});}});}})[_0x12c2('0x27')](respondWithStatusCode(_0x401f5b,null))[_0x12c2('0x4a')](handleError(_0x401f5b,null));};exports[_0x12c2('0x88')]=function(_0x5904b1,_0x4202d6,_0x3b1bdf){var _0x2db09f={};var _0x7cbd9d={};var _0x5bec5a;var _0x3f468c;return db[_0x12c2('0x2f')]['findOne']({'where':{'id':_0x5904b1[_0x12c2('0x47')]['id']}})[_0x12c2('0x27')](handleEntityNotFound(_0x4202d6,null))[_0x12c2('0x27')](function(_0x256319){if(_0x256319){_0x5bec5a=_0x256319;_0x7cbd9d[_0x12c2('0x32')]=_[_0x12c2('0x48')](db[_0x12c2('0x5a')][_0x12c2('0x30')]);_0x7cbd9d[_0x12c2('0x33')]=_[_0x12c2('0x48')](_0x5904b1[_0x12c2('0x33')]);_0x7cbd9d['filters']=_[_0x12c2('0x35')](_0x7cbd9d[_0x12c2('0x32')],_0x7cbd9d[_0x12c2('0x33')]);_0x2db09f['attributes']=_[_0x12c2('0x35')](_0x7cbd9d[_0x12c2('0x32')],qs['fields'](_0x5904b1[_0x12c2('0x33')][_0x12c2('0x37')]));_0x2db09f['attributes']=_0x2db09f[_0x12c2('0x36')][_0x12c2('0x38')]?_0x2db09f['attributes']:_0x7cbd9d[_0x12c2('0x32')];_0x2db09f['order']=qs[_0x12c2('0x3b')](_0x5904b1['query']['sort']);_0x2db09f['where']=qs[_0x12c2('0x34')](_[_0x12c2('0x3d')](_0x5904b1[_0x12c2('0x33')],_0x7cbd9d[_0x12c2('0x34')]));if(_0x5904b1[_0x12c2('0x33')][_0x12c2('0x3e')]){_0x2db09f['where']=_[_0x12c2('0x3f')](_0x2db09f['where'],{'$or':_[_0x12c2('0x2e')](_0x2db09f[_0x12c2('0x36')],function(_0x5b37f6){var _0x52c778={};_0x52c778[_0x5b37f6]={'$like':'%'+_0x5904b1[_0x12c2('0x33')][_0x12c2('0x3e')]+'%'};return _0x52c778;})});}_0x2db09f=_[_0x12c2('0x3f')]({},_0x2db09f,_0x5904b1[_0x12c2('0x41')]);return _0x5bec5a[_0x12c2('0x88')](_0x2db09f);}})['then'](function(_0x2f369e){if(_0x2f369e){_0x3f468c=_0x2f369e[_0x12c2('0x38')];if(!_0x5904b1['query'][_0x12c2('0x39')]('nolimit')){_0x2db09f[_0x12c2('0x22')]=qs[_0x12c2('0x22')](_0x5904b1[_0x12c2('0x33')][_0x12c2('0x22')]);_0x2db09f[_0x12c2('0x21')]=qs[_0x12c2('0x21')](_0x5904b1['query']['offset']);}return _0x5bec5a[_0x12c2('0x88')](_0x2db09f);}})[_0x12c2('0x27')](function(_0x3050ce){if(_0x3050ce){return _0x3050ce?{'count':_0x3f468c,'rows':_0x3050ce}:null;}})[_0x12c2('0x27')](respondWithResult(_0x4202d6,null))[_0x12c2('0x4a')](handleError(_0x4202d6,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 413fa2d..ceb170a 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 _0x3b8d=['hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','update','remove','emit'];(function(_0x50dd2d,_0x2ed7d5){var _0x7b56fc=function(_0x48ce66){while(--_0x48ce66){_0x50dd2d['push'](_0x50dd2d['shift']());}};_0x7b56fc(++_0x2ed7d5);}(_0x3b8d,0x9a));var _0xd3b8=function(_0x37c19c,_0x57956d){_0x37c19c=_0x37c19c-0x0;var _0x58a02e=_0x3b8d[_0x37c19c];return _0x58a02e;};'use strict';var EventEmitter=require(_0xd3b8('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xd3b8('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd3b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd3b8('0x3'),'afterDestroy':_0xd3b8('0x4')};function emitEvent(_0x10cd3b){return function(_0x3d369b,_0x3fa477,_0x51b2be){OpenchannelQueueEvents[_0xd3b8('0x5')](_0x10cd3b+':'+_0x3d369b['id'],_0x3d369b);OpenchannelQueueEvents[_0xd3b8('0x5')](_0x10cd3b,_0x3d369b);_0x51b2be(null);};}for(var e in events){if(events[_0xd3b8('0x6')](e)){var event=events[e];OpenchannelQueue[_0xd3b8('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0xbf03=['remove','hasOwnProperty','hook','events','../../mysqldb','OpenchannelQueue','save','update'];(function(_0x26a72f,_0x55aabe){var _0x501369=function(_0x319a89){while(--_0x319a89){_0x26a72f['push'](_0x26a72f['shift']());}};_0x501369(++_0x55aabe);}(_0xbf03,0xfb));var _0x3bf0=function(_0x228f3b,_0x179e70){_0x228f3b=_0x228f3b-0x0;var _0x3f33f3=_0xbf03[_0x228f3b];return _0x3f33f3;};'use strict';var EventEmitter=require(_0x3bf0('0x0'));var OpenchannelQueue=require(_0x3bf0('0x1'))['db'][_0x3bf0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3bf0('0x3'),'afterUpdate':_0x3bf0('0x4'),'afterDestroy':_0x3bf0('0x5')};function emitEvent(_0x23b3a0){return function(_0x1853e6,_0xc6a534,_0x59ccd1){OpenchannelQueueEvents['emit'](_0x23b3a0+':'+_0x1853e6['id'],_0x1853e6);OpenchannelQueueEvents['emit'](_0x23b3a0,_0x1853e6);_0x59ccd1(null);};}for(var e in events){if(events[_0x3bf0('0x6')](e)){var event=events[e];OpenchannelQueue[_0x3bf0('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 8a0103d..e7dc8de 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 _0x7033=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x18fb78,_0x5e7f91){var _0x55ca13=function(_0x5ee98d){while(--_0x5ee98d){_0x18fb78['push'](_0x18fb78['shift']());}};_0x55ca13(++_0x5e7f91);}(_0x7033,0x19e));var _0x3703=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7033[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3703('0x0'));var util=require(_0x3703('0x1'));var logger=require(_0x3703('0x2'))(_0x3703('0x3'));var moment=require('moment');var BPromise=require(_0x3703('0x4'));var rp=require(_0x3703('0x5'));var fs=require('fs');var path=require(_0x3703('0x6'));var rimraf=require(_0x3703('0x7'));var config=require(_0x3703('0x8'));var attributes=require(_0x3703('0x9'));module[_0x3703('0xa')]=function(_0x283af9,_0x1170b6){return _0x283af9[_0x3703('0xb')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x094c=['rimraf','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue','util','../../config/logger','moment','bluebird','path'];(function(_0x3c54b3,_0xef5b1a){var _0x50f6f0=function(_0x17f3ea){while(--_0x17f3ea){_0x3c54b3['push'](_0x3c54b3['shift']());}};_0x50f6f0(++_0xef5b1a);}(_0x094c,0x131));var _0xc094=function(_0x41b654,_0x39239c){_0x41b654=_0x41b654-0x0;var _0x55c219=_0x094c[_0x41b654];return _0x55c219;};'use strict';var _=require('lodash');var util=require(_0xc094('0x0'));var logger=require(_0xc094('0x1'))('api');var moment=require(_0xc094('0x2'));var BPromise=require(_0xc094('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc094('0x4'));var rimraf=require(_0xc094('0x5'));var config=require(_0xc094('0x6'));var attributes=require(_0xc094('0x7'));module[_0xc094('0x8')]=function(_0x3226a1,_0x1366bf){return _0x3226a1['define'](_0xc094('0x9'),attributes,{'tableName':'openchannel_queues','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 af0a299..7d7a2b2 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 _0x5290=['debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','OpenchannelQueue','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info'];(function(_0x43d009,_0x96507d){var _0x20e0ce=function(_0x3033cb){while(--_0x3033cb){_0x43d009['push'](_0x43d009['shift']());}};_0x20e0ce(++_0x96507d);}(_0x5290,0x199));var _0x0529=function(_0x49d72b,_0x37e291){_0x49d72b=_0x49d72b-0x0;var _0x1462fb=_0x5290[_0x49d72b];return _0x1462fb;};'use strict';var _=require(_0x0529('0x0'));var util=require(_0x0529('0x1'));var moment=require(_0x0529('0x2'));var BPromise=require(_0x0529('0x3'));var rs=require(_0x0529('0x4'));var fs=require('fs');var Redis=require(_0x0529('0x5'));var db=require(_0x0529('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0529('0x7'))(_0x0529('0x8'));var config=require(_0x0529('0x9'));var jayson=require(_0x0529('0xa'));var client=jayson[_0x0529('0xb')][_0x0529('0xc')]({'port':0x232a});config[_0x0529('0xd')]=_['defaults'](config['redis'],{'host':_0x0529('0xe'),'port':0x18eb});var socket=require(_0x0529('0xf'))(new Redis(config[_0x0529('0xd')]));require(_0x0529('0x10'))[_0x0529('0x11')](socket);function respondWithRpcPromise(_0x352f14,_0xb38402,_0x39d7ba){return new BPromise(function(_0x48c0cf,_0x2f8966){return client[_0x0529('0x12')](_0x352f14,_0x39d7ba)[_0x0529('0x13')](function(_0x44782c){logger[_0x0529('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0xb38402,'request\x20sent');logger[_0x0529('0x15')](_0x0529('0x16'),_0xb38402,_0x0529('0x17'),JSON[_0x0529('0x18')](_0x44782c));if(_0x44782c[_0x0529('0x19')]){if(_0x44782c[_0x0529('0x19')][_0x0529('0x1a')]===0x1f4){logger['error'](_0x0529('0x1b'),_0xb38402,_0x44782c['error'][_0x0529('0x1c')]);return _0x2f8966(_0x44782c[_0x0529('0x19')][_0x0529('0x1c')]);}logger[_0x0529('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0xb38402,_0x44782c[_0x0529('0x19')][_0x0529('0x1c')]);return _0x48c0cf(_0x44782c['error']['message']);}else{logger[_0x0529('0x14')](_0x0529('0x1b'),_0xb38402,_0x0529('0x17'));_0x48c0cf(_0x44782c[_0x0529('0x1d')][_0x0529('0x1c')]);}})[_0x0529('0x1e')](function(_0x29a897){logger[_0x0529('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0xb38402,_0x29a897);_0x2f8966(_0x29a897);});});}exports[_0x0529('0x1f')]=function(_0x3e3aee){var _0x67e3af=this;return new Promise(function(_0x24568e,_0x59d941){return db['OpenchannelQueue'][_0x0529('0x20')]({'raw':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee['options'][_0x0529('0x22')]===undefined?!![]:![]:!![],'where':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee[_0x0529('0x21')][_0x0529('0x23')]||null:null,'attributes':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee['options'][_0x0529('0x24')]||null:null,'limit':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee[_0x0529('0x21')][_0x0529('0x25')]||null:null,'include':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee[_0x0529('0x21')][_0x0529('0x26')]?_['map'](_0x3e3aee['options'][_0x0529('0x26')],function(_0x126eca){return{'model':db[_0x126eca['model']],'as':_0x126eca['as'],'attributes':_0x126eca[_0x0529('0x24')],'include':_0x126eca[_0x0529('0x26')]?_[_0x0529('0x27')](_0x126eca[_0x0529('0x26')],function(_0x2f8ef2){return{'model':db[_0x2f8ef2[_0x0529('0x28')]],'as':_0x2f8ef2['as'],'attributes':_0x2f8ef2['attributes'],'include':_0x2f8ef2[_0x0529('0x26')]?_[_0x0529('0x27')](_0x2f8ef2[_0x0529('0x26')],function(_0x492131){return{'model':db[_0x492131[_0x0529('0x28')]],'as':_0x492131['as'],'attributes':_0x492131[_0x0529('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0529('0x13')](function(_0x4238f0){logger['info'](_0x0529('0x1f'),_0x3e3aee);logger[_0x0529('0x15')](_0x0529('0x1f'),_0x3e3aee,JSON[_0x0529('0x18')](_0x4238f0));_0x24568e(_0x4238f0);})[_0x0529('0x1e')](function(_0x33d798){logger[_0x0529('0x19')](_0x0529('0x1f'),_0x33d798[_0x0529('0x1c')],_0x3e3aee);_0x59d941(_0x67e3af[_0x0529('0x19')](0x1f4,_0x33d798['message']));});});};exports['ShowOpenchannelQueue']=function(_0xa8c423){var _0x278384=this;return new Promise(function(_0x3654d0,_0x3ed72b){return db[_0x0529('0x29')]['find']({'raw':_0xa8c423[_0x0529('0x21')]?_0xa8c423[_0x0529('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0xa8c423[_0x0529('0x21')]?_0xa8c423[_0x0529('0x21')][_0x0529('0x23')]||null:null,'attributes':_0xa8c423['options']?_0xa8c423['options'][_0x0529('0x24')]||null:null,'include':_0xa8c423[_0x0529('0x21')]?_0xa8c423['options'][_0x0529('0x26')]?_[_0x0529('0x27')](_0xa8c423[_0x0529('0x21')]['include'],function(_0x1dfdd0){return{'model':db[_0x1dfdd0['model']],'as':_0x1dfdd0['as'],'attributes':_0x1dfdd0[_0x0529('0x24')],'include':_0x1dfdd0[_0x0529('0x26')]?_['map'](_0x1dfdd0[_0x0529('0x26')],function(_0x289de9){return{'model':db[_0x289de9[_0x0529('0x28')]],'as':_0x289de9['as'],'attributes':_0x289de9[_0x0529('0x24')],'include':_0x289de9[_0x0529('0x26')]?_[_0x0529('0x27')](_0x289de9[_0x0529('0x26')],function(_0x25b43c){return{'model':db[_0x25b43c[_0x0529('0x28')]],'as':_0x25b43c['as'],'attributes':_0x25b43c[_0x0529('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0529('0x13')](function(_0x1f923c){logger['info']('ShowOpenchannelQueue',_0xa8c423);logger[_0x0529('0x15')]('ShowOpenchannelQueue',_0xa8c423,JSON[_0x0529('0x18')](_0x1f923c));_0x3654d0(_0x1f923c);})[_0x0529('0x1e')](function(_0xf45aac){logger['error'](_0x0529('0x2a'),_0xf45aac[_0x0529('0x1c')],_0xa8c423);_0x3ed72b(_0x278384[_0x0529('0x19')](0x1f4,_0xf45aac[_0x0529('0x1c')]));});});}; \ No newline at end of file +var _0xb4aa=['result','catch','OpenchannelQueue','options','where','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find','raw','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message'];(function(_0x316239,_0x290544){var _0x44bdbd=function(_0x2478b0){while(--_0x2478b0){_0x316239['push'](_0x316239['shift']());}};_0x44bdbd(++_0x290544);}(_0xb4aa,0xcc));var _0xab4a=function(_0x362720,_0x214620){_0x362720=_0x362720-0x0;var _0x229658=_0xb4aa[_0x362720];return _0x229658;};'use strict';var _=require(_0xab4a('0x0'));var util=require('util');var moment=require(_0xab4a('0x1'));var BPromise=require('bluebird');var rs=require(_0xab4a('0x2'));var fs=require('fs');var Redis=require(_0xab4a('0x3'));var db=require(_0xab4a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xab4a('0x5'))('rpc');var config=require(_0xab4a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xab4a('0x7')][_0xab4a('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xab4a('0x9'),'port':0x18eb});var socket=require(_0xab4a('0xa'))(new Redis(config[_0xab4a('0xb')]));require(_0xab4a('0xc'))[_0xab4a('0xd')](socket);function respondWithRpcPromise(_0x352aa5,_0x24a89c,_0x579439){return new BPromise(function(_0x18441c,_0x5b7ec4){return client[_0xab4a('0xe')](_0x352aa5,_0x579439)[_0xab4a('0xf')](function(_0x191d4e){logger[_0xab4a('0x10')](_0xab4a('0x11'),_0x24a89c,'request\x20sent');logger[_0xab4a('0x12')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x24a89c,_0xab4a('0x13'),JSON[_0xab4a('0x14')](_0x191d4e));if(_0x191d4e[_0xab4a('0x15')]){if(_0x191d4e['error'][_0xab4a('0x16')]===0x1f4){logger[_0xab4a('0x15')]('OpenchannelQueue,\x20%s,\x20%s',_0x24a89c,_0x191d4e['error'][_0xab4a('0x17')]);return _0x5b7ec4(_0x191d4e[_0xab4a('0x15')]['message']);}logger[_0xab4a('0x15')](_0xab4a('0x11'),_0x24a89c,_0x191d4e['error'][_0xab4a('0x17')]);return _0x18441c(_0x191d4e['error'][_0xab4a('0x17')]);}else{logger[_0xab4a('0x10')](_0xab4a('0x11'),_0x24a89c,'request\x20sent');_0x18441c(_0x191d4e[_0xab4a('0x18')]['message']);}})[_0xab4a('0x19')](function(_0x3d9e40){logger[_0xab4a('0x15')](_0xab4a('0x11'),_0x24a89c,_0x3d9e40);_0x5b7ec4(_0x3d9e40);});});}exports['GetOpenchannelQueue']=function(_0x3956f4){var _0x413684=this;return new Promise(function(_0x26438b,_0x5cf80c){return db[_0xab4a('0x1a')]['findAll']({'raw':_0x3956f4[_0xab4a('0x1b')]?_0x3956f4[_0xab4a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x3956f4[_0xab4a('0x1b')]?_0x3956f4[_0xab4a('0x1b')][_0xab4a('0x1c')]||null:null,'attributes':_0x3956f4[_0xab4a('0x1b')]?_0x3956f4[_0xab4a('0x1b')][_0xab4a('0x1d')]||null:null,'limit':_0x3956f4[_0xab4a('0x1b')]?_0x3956f4[_0xab4a('0x1b')][_0xab4a('0x1e')]||null:null,'include':_0x3956f4['options']?_0x3956f4[_0xab4a('0x1b')][_0xab4a('0x1f')]?_[_0xab4a('0x20')](_0x3956f4[_0xab4a('0x1b')][_0xab4a('0x1f')],function(_0x238867){return{'model':db[_0x238867[_0xab4a('0x21')]],'as':_0x238867['as'],'attributes':_0x238867[_0xab4a('0x1d')],'include':_0x238867[_0xab4a('0x1f')]?_['map'](_0x238867[_0xab4a('0x1f')],function(_0x5128ea){return{'model':db[_0x5128ea[_0xab4a('0x21')]],'as':_0x5128ea['as'],'attributes':_0x5128ea[_0xab4a('0x1d')],'include':_0x5128ea[_0xab4a('0x1f')]?_[_0xab4a('0x20')](_0x5128ea[_0xab4a('0x1f')],function(_0x2a985e){return{'model':db[_0x2a985e[_0xab4a('0x21')]],'as':_0x2a985e['as'],'attributes':_0x2a985e[_0xab4a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x101a5b){logger[_0xab4a('0x10')]('GetOpenchannelQueue',_0x3956f4);logger['debug'](_0xab4a('0x22'),_0x3956f4,JSON[_0xab4a('0x14')](_0x101a5b));_0x26438b(_0x101a5b);})[_0xab4a('0x19')](function(_0x3f09f7){logger[_0xab4a('0x15')](_0xab4a('0x22'),_0x3f09f7[_0xab4a('0x17')],_0x3956f4);_0x5cf80c(_0x413684[_0xab4a('0x15')](0x1f4,_0x3f09f7['message']));});});};exports[_0xab4a('0x23')]=function(_0x3c7c0e){var _0x2a0cf9=this;return new Promise(function(_0x42532d,_0x5405dd){return db[_0xab4a('0x1a')][_0xab4a('0x24')]({'raw':_0x3c7c0e[_0xab4a('0x1b')]?_0x3c7c0e[_0xab4a('0x1b')][_0xab4a('0x25')]===undefined?!![]:![]:!![],'where':_0x3c7c0e[_0xab4a('0x1b')]?_0x3c7c0e['options'][_0xab4a('0x1c')]||null:null,'attributes':_0x3c7c0e[_0xab4a('0x1b')]?_0x3c7c0e[_0xab4a('0x1b')][_0xab4a('0x1d')]||null:null,'include':_0x3c7c0e[_0xab4a('0x1b')]?_0x3c7c0e[_0xab4a('0x1b')]['include']?_[_0xab4a('0x20')](_0x3c7c0e[_0xab4a('0x1b')][_0xab4a('0x1f')],function(_0x32a657){return{'model':db[_0x32a657['model']],'as':_0x32a657['as'],'attributes':_0x32a657[_0xab4a('0x1d')],'include':_0x32a657[_0xab4a('0x1f')]?_[_0xab4a('0x20')](_0x32a657[_0xab4a('0x1f')],function(_0x26e957){return{'model':db[_0x26e957[_0xab4a('0x21')]],'as':_0x26e957['as'],'attributes':_0x26e957[_0xab4a('0x1d')],'include':_0x26e957[_0xab4a('0x1f')]?_[_0xab4a('0x20')](_0x26e957[_0xab4a('0x1f')],function(_0x339302){return{'model':db[_0x339302[_0xab4a('0x21')]],'as':_0x339302['as'],'attributes':_0x339302[_0xab4a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xab4a('0xf')](function(_0x2df532){logger[_0xab4a('0x10')](_0xab4a('0x23'),_0x3c7c0e);logger[_0xab4a('0x12')](_0xab4a('0x23'),_0x3c7c0e,JSON[_0xab4a('0x14')](_0x2df532));_0x42532d(_0x2df532);})[_0xab4a('0x19')](function(_0x3093c4){logger['error'](_0xab4a('0x23'),_0x3093c4['message'],_0x3c7c0e);_0x5405dd(_0x2a0cf9[_0xab4a('0x15')](0x1f4,_0x3093c4['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 2a4b86d..2a1a905 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 _0x7b01=['./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x2f4893,_0x3dcc45){var _0x2ab9ce=function(_0x1aaa0b){while(--_0x1aaa0b){_0x2f4893['push'](_0x2f4893['shift']());}};_0x2ab9ce(++_0x3dcc45);}(_0x7b01,0xcc));var _0x17b0=function(_0x2f30c3,_0x4afef1){_0x2f30c3=_0x2f30c3-0x0;var _0x5ac876=_0x7b01[_0x2f30c3];return _0x5ac876;};'use strict';var OpenchannelQueueEvents=require(_0x17b0('0x0'));var events=[_0x17b0('0x1'),_0x17b0('0x2'),_0x17b0('0x3')];function createListener(_0x43c0ac,_0x27c3f6){return function(_0x106cd8){_0x27c3f6[_0x17b0('0x4')](_0x43c0ac,_0x106cd8);};}function removeListener(_0x13016b,_0x1acbac){return function(){OpenchannelQueueEvents[_0x17b0('0x5')](_0x13016b,_0x1acbac);};}exports['register']=function(_0xde0fcb){for(var _0x26dd51=0x0,_0x4a860c=events['length'];_0x26dd51<_0x4a860c;_0x26dd51++){var _0x4a19ab=events[_0x26dd51];var _0x554036=createListener('openchannelQueue:'+_0x4a19ab,_0xde0fcb);OpenchannelQueueEvents['on'](_0x4a19ab,_0x554036);}}; \ No newline at end of file +var _0xc36b=['update','emit','removeListener','register','length','openchannelQueue:','save'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc36b,0x13a));var _0xbc36=function(_0x4d1b06,_0x17d246){_0x4d1b06=_0x4d1b06-0x0;var _0x31152b=_0xc36b[_0x4d1b06];return _0x31152b;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xbc36('0x0'),'remove',_0xbc36('0x1')];function createListener(_0xf9d50f,_0x12d1d7){return function(_0x468151){_0x12d1d7[_0xbc36('0x2')](_0xf9d50f,_0x468151);};}function removeListener(_0x2ae690,_0x60d4b1){return function(){OpenchannelQueueEvents[_0xbc36('0x3')](_0x2ae690,_0x60d4b1);};}exports[_0xbc36('0x4')]=function(_0x5e0061){for(var _0x1f1c21=0x0,_0x39a656=events[_0xbc36('0x5')];_0x1f1c21<_0x39a656;_0x1f1c21++){var _0x108132=events[_0x1f1c21];var _0x2d7688=createListener(_0xbc36('0x6')+_0x108132,_0x5e0061);OpenchannelQueueEvents['on'](_0x108132,_0x2d7688);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 6169d65..dd3345e 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 _0xa0b7=['exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa0b7,0xac));var _0x7a0b=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xa0b7[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x7a0b('0x0'));var util=require(_0x7a0b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7a0b('0x2'));var router=express[_0x7a0b('0x3')]();var auth=require(_0x7a0b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7a0b('0x5'));var controller=require(_0x7a0b('0x6'));router[_0x7a0b('0x7')]('/',auth[_0x7a0b('0x8')](),controller[_0x7a0b('0x9')]);router[_0x7a0b('0x7')]('/describe',auth[_0x7a0b('0x8')](),controller[_0x7a0b('0xa')]);router[_0x7a0b('0x7')](_0x7a0b('0xb'),auth[_0x7a0b('0x8')](),controller[_0x7a0b('0xc')]);router[_0x7a0b('0xd')]('/',auth[_0x7a0b('0x8')](),controller[_0x7a0b('0xe')]);router[_0x7a0b('0xf')](_0x7a0b('0xb'),auth[_0x7a0b('0x8')](),controller[_0x7a0b('0x10')]);router[_0x7a0b('0x11')](_0x7a0b('0xb'),auth[_0x7a0b('0x8')](),controller['destroy']);module[_0x7a0b('0x12')]=router; \ No newline at end of file +var _0xe39a=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2d56a5,_0x12125d){var _0x350e2a=function(_0x47f785){while(--_0x47f785){_0x2d56a5['push'](_0x2d56a5['shift']());}};_0x350e2a(++_0x12125d);}(_0xe39a,0x1e1));var _0xae39=function(_0x4f8cf5,_0x66c5a7){_0x4f8cf5=_0x4f8cf5-0x0;var _0x339420=_0xe39a[_0x4f8cf5];return _0x339420;};'use strict';var multer=require(_0xae39('0x0'));var util=require(_0xae39('0x1'));var path=require('path');var timeout=require(_0xae39('0x2'));var express=require(_0xae39('0x3'));var router=express[_0xae39('0x4')]();var auth=require(_0xae39('0x5'));var interaction=require(_0xae39('0x6'));var config=require('../../config/environment');var controller=require(_0xae39('0x7'));router[_0xae39('0x8')]('/',auth[_0xae39('0x9')](),controller[_0xae39('0xa')]);router['get'](_0xae39('0xb'),auth[_0xae39('0x9')](),controller[_0xae39('0xc')]);router[_0xae39('0x8')](_0xae39('0xd'),auth[_0xae39('0x9')](),controller[_0xae39('0xe')]);router['post']('/',auth[_0xae39('0x9')](),controller[_0xae39('0xf')]);router[_0xae39('0x10')](_0xae39('0xd'),auth[_0xae39('0x9')](),controller[_0xae39('0x11')]);router[_0xae39('0x12')]('/:id',auth[_0xae39('0x9')](),controller[_0xae39('0x13')]);module[_0xae39('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index a806d86..5734b3b 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 _0xcdac=['DATE','moment','exports'];(function(_0xb5c518,_0x4fd792){var _0x219178=function(_0x5e53b1){while(--_0x5e53b1){_0xb5c518['push'](_0xb5c518['shift']());}};_0x219178(++_0x4fd792);}(_0xcdac,0xaf));var _0xccda=function(_0x29f26e,_0x1183d5){_0x29f26e=_0x29f26e-0x0;var _0x4507dc=_0xcdac[_0x29f26e];return _0x4507dc;};'use strict';var moment=require(_0xccda('0x0'));var Sequelize=require('sequelize');module[_0xccda('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xccda('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xccda('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd7ed=['exports','STRING','DATE'];(function(_0x1b8c03,_0x494e18){var _0x2afa5e=function(_0xfc20be){while(--_0xfc20be){_0x1b8c03['push'](_0x1b8c03['shift']());}};_0x2afa5e(++_0x494e18);}(_0xd7ed,0xe7));var _0xdd7e=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0xd7ed[_0x1b70e3];return _0x1452ab;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xdd7e('0x0')]={'uniqueid':{'type':Sequelize[_0xdd7e('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xdd7e('0x1')]},'joinAt':{'type':Sequelize[_0xdd7e('0x2')]},'leaveAt':{'type':Sequelize[_0xdd7e('0x2')]},'acceptAt':{'type':Sequelize[_0xdd7e('0x2')]},'exitAt':{'type':Sequelize[_0xdd7e('0x2')]},'reason':{'type':Sequelize[_0xdd7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 1b6f64a..3588c3b 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 _0xcaef=['where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','OpenchannelQueueReport','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort'];(function(_0x3d10b5,_0x2760bf){var _0xae1af4=function(_0x1d4e53){while(--_0x1d4e53){_0x3d10b5['push'](_0x3d10b5['shift']());}};_0xae1af4(++_0x2760bf);}(_0xcaef,0x1c9));var _0xfcae=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xcaef[_0xc8a931];return _0x28bd27;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfcae('0x0'));var rimraf=require(_0xfcae('0x1'));var zipdir=require(_0xfcae('0x2'));var jsonpatch=require(_0xfcae('0x3'));var rp=require('request-promise');var moment=require(_0xfcae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfcae('0x5'));var util=require(_0xfcae('0x6'));var path=require('path');var sox=require(_0xfcae('0x7'));var csv=require(_0xfcae('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfcae('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfcae('0xa'));var deskjs=require(_0xfcae('0xb'));var toCsv=require(_0xfcae('0x8'));var querystring=require('querystring');var Papa=require(_0xfcae('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfcae('0xd'));var as=require(_0xfcae('0xe'));var hardwareService=require(_0xfcae('0xf'));var logger=require(_0xfcae('0x10'))(_0xfcae('0x11'));var utils=require(_0xfcae('0x12'));var config=require(_0xfcae('0x13'));var db=require(_0xfcae('0x14'))['db'];function respondWithStatusCode(_0x2b8561,_0x56398a){_0x56398a=_0x56398a||0xcc;return function(_0x209f76){if(_0x209f76){return _0x2b8561[_0xfcae('0x15')](_0x56398a);}return _0x2b8561[_0xfcae('0x16')](_0x56398a)[_0xfcae('0x17')]();};}function respondWithResult(_0x2569c2,_0x38e387){_0x38e387=_0x38e387||0xc8;return function(_0x19cf42){if(_0x19cf42){return _0x2569c2[_0xfcae('0x16')](_0x38e387)['json'](_0x19cf42);}};}function respondWithFilteredResult(_0x42a59b,_0x4a84aa){return function(_0x145ee3){if(_0x145ee3){var _0x12a15e=_0x145ee3[_0xfcae('0x18')],_0x1ab8f3=_0x4a84aa[_0xfcae('0x19')],_0x3e8a36=_0x4a84aa[_0xfcae('0x19')]+_0x4a84aa[_0xfcae('0x1a')],_0x7504d;if(_0x3e8a36>=_0x12a15e){_0x3e8a36=_0x12a15e;_0x7504d=0xc8;}else{_0x7504d=0xce;}_0x42a59b['status'](_0x7504d);return _0x42a59b[_0xfcae('0x1b')]('Content-Range',_0x1ab8f3+'-'+_0x3e8a36+'/'+_0x12a15e)[_0xfcae('0x1c')](_0x145ee3);}return null;};}function patchUpdates(_0xb79156){return function(_0x2ed097){try{jsonpatch[_0xfcae('0x1d')](_0x2ed097,_0xb79156,!![]);}catch(_0x439567){return BPromise[_0xfcae('0x1e')](_0x439567);}return _0x2ed097[_0xfcae('0x1f')]();};}function saveUpdates(_0x50c34a,_0x53cb65){return function(_0x1f79cb){if(_0x1f79cb){return _0x1f79cb[_0xfcae('0x20')](_0x50c34a)[_0xfcae('0x21')](function(_0x17daf9){return _0x17daf9;});}return null;};}function removeEntity(_0x1e9b7a,_0x35d5d7){return function(_0xc2d0ed){if(_0xc2d0ed){return _0xc2d0ed[_0xfcae('0x22')]()[_0xfcae('0x21')](function(){_0x1e9b7a['status'](0xcc)[_0xfcae('0x17')]();});}};}function handleEntityNotFound(_0x4571a9,_0x57687e){return function(_0x49e534){if(!_0x49e534){_0x4571a9['sendStatus'](0x194);}return _0x49e534;};}function handleError(_0x337324,_0x5a19be){_0x5a19be=_0x5a19be||0x1f4;return function(_0x229e86){logger[_0xfcae('0x23')](_0x229e86[_0xfcae('0x24')]);if(_0x229e86['name']){delete _0x229e86[_0xfcae('0x25')];}_0x337324[_0xfcae('0x16')](_0x5a19be)[_0xfcae('0x26')](_0x229e86);};}exports[_0xfcae('0x27')]=function(_0x58611e,_0x4ca906){var _0x48f6bb={},_0x47b7ed={},_0x4b874b={'count':0x0,'rows':[]};var _0x28f157=_['map'](db['OpenchannelQueueReport'][_0xfcae('0x28')],function(_0xb3f001){return{'name':_0xb3f001[_0xfcae('0x29')],'type':_0xb3f001['type'][_0xfcae('0x2a')]};});_0x47b7ed['model']=_['map'](_0x28f157,'name');_0x47b7ed[_0xfcae('0x2b')]=_[_0xfcae('0x2c')](_0x58611e[_0xfcae('0x2b')]);_0x47b7ed[_0xfcae('0x2d')]=_['intersection'](_0x47b7ed['model'],_0x47b7ed['query']);_0x48f6bb[_0xfcae('0x2e')]=_[_0xfcae('0x2f')](_0x47b7ed[_0xfcae('0x30')],qs['fields'](_0x58611e['query'][_0xfcae('0x31')]));_0x48f6bb['attributes']=_0x48f6bb[_0xfcae('0x2e')][_0xfcae('0x32')]?_0x48f6bb[_0xfcae('0x2e')]:_0x47b7ed[_0xfcae('0x30')];if(!_0x58611e[_0xfcae('0x2b')]['hasOwnProperty'](_0xfcae('0x33'))){_0x48f6bb[_0xfcae('0x1a')]=qs[_0xfcae('0x1a')](_0x58611e['query'][_0xfcae('0x1a')]);_0x48f6bb[_0xfcae('0x19')]=qs[_0xfcae('0x19')](_0x58611e[_0xfcae('0x2b')]['offset']);}_0x48f6bb[_0xfcae('0x34')]=qs[_0xfcae('0x35')](_0x58611e[_0xfcae('0x2b')]['sort']);_0x48f6bb[_0xfcae('0x36')]=qs[_0xfcae('0x2d')](_[_0xfcae('0x37')](_0x58611e[_0xfcae('0x2b')],_0x47b7ed['filters']));if(_0x58611e['query']['filter']){_0x48f6bb[_0xfcae('0x36')]=_[_0xfcae('0x38')](_0x48f6bb['where'],{'$or':_[_0xfcae('0x39')](_0x28f157,function(_0x5039d6){if(_0x5039d6['type']!==_0xfcae('0x3a')){var _0x28cdbe={};_0x28cdbe[_0x5039d6[_0xfcae('0x25')]]={'$like':'%'+_0x58611e[_0xfcae('0x2b')][_0xfcae('0x3b')]+'%'};return _0x28cdbe;}})});}_0x48f6bb=_[_0xfcae('0x38')]({},_0x48f6bb,_0x58611e[_0xfcae('0x3c')]);var _0x14a200={'where':_0x48f6bb['where']};return db['OpenchannelQueueReport']['count'](_0x14a200)['then'](function(_0x50db9){_0x4b874b[_0xfcae('0x18')]=_0x50db9;if(_0x58611e['query'][_0xfcae('0x3d')]){_0x48f6bb[_0xfcae('0x3e')]=[{'all':!![]}];}return db[_0xfcae('0x3f')][_0xfcae('0x40')](_0x48f6bb);})[_0xfcae('0x21')](function(_0x2f57a7){_0x4b874b[_0xfcae('0x41')]=_0x2f57a7;return _0x4b874b;})[_0xfcae('0x21')](respondWithFilteredResult(_0x4ca906,_0x48f6bb))[_0xfcae('0x42')](handleError(_0x4ca906,null));};exports[_0xfcae('0x43')]=function(_0xc54cba,_0x23873f){var _0x3f6d02={'raw':!![],'where':{'id':_0xc54cba[_0xfcae('0x44')]['id']}},_0x4211fc={};_0x4211fc[_0xfcae('0x30')]=_[_0xfcae('0x2c')](db['OpenchannelQueueReport'][_0xfcae('0x28')]);_0x4211fc[_0xfcae('0x2b')]=_['keys'](_0xc54cba[_0xfcae('0x2b')]);_0x4211fc[_0xfcae('0x2d')]=_[_0xfcae('0x2f')](_0x4211fc[_0xfcae('0x30')],_0x4211fc[_0xfcae('0x2b')]);_0x3f6d02[_0xfcae('0x2e')]=_[_0xfcae('0x2f')](_0x4211fc['model'],qs[_0xfcae('0x31')](_0xc54cba[_0xfcae('0x2b')]['fields']));_0x3f6d02[_0xfcae('0x2e')]=_0x3f6d02[_0xfcae('0x2e')][_0xfcae('0x32')]?_0x3f6d02[_0xfcae('0x2e')]:_0x4211fc['model'];if(_0xc54cba['query']['includeAll']){_0x3f6d02[_0xfcae('0x3e')]=[{'all':!![]}];}_0x3f6d02=_['merge']({},_0x3f6d02,_0xc54cba[_0xfcae('0x3c')]);return db['OpenchannelQueueReport'][_0xfcae('0x45')](_0x3f6d02)['then'](handleEntityNotFound(_0x23873f,null))[_0xfcae('0x21')](respondWithResult(_0x23873f,null))[_0xfcae('0x42')](handleError(_0x23873f,null));};exports[_0xfcae('0x46')]=function(_0x55838c,_0x5991d4){return db['OpenchannelQueueReport']['create'](_0x55838c[_0xfcae('0x47')],{})['then'](respondWithResult(_0x5991d4,0xc9))[_0xfcae('0x42')](handleError(_0x5991d4,null));};exports[_0xfcae('0x20')]=function(_0x25b433,_0x1dd6ba){if(_0x25b433['body']['id']){delete _0x25b433[_0xfcae('0x47')]['id'];}return db[_0xfcae('0x3f')]['find']({'where':{'id':_0x25b433[_0xfcae('0x44')]['id']}})[_0xfcae('0x21')](handleEntityNotFound(_0x1dd6ba,null))['then'](saveUpdates(_0x25b433['body'],null))[_0xfcae('0x21')](respondWithResult(_0x1dd6ba,null))['catch'](handleError(_0x1dd6ba,null));};exports[_0xfcae('0x22')]=function(_0x3fcb7b,_0x41b0fe){return db['OpenchannelQueueReport'][_0xfcae('0x45')]({'where':{'id':_0x3fcb7b[_0xfcae('0x44')]['id']}})[_0xfcae('0x21')](handleEntityNotFound(_0x41b0fe,null))['then'](removeEntity(_0x41b0fe,null))[_0xfcae('0x42')](handleError(_0x41b0fe,null));};exports[_0xfcae('0x48')]=function(_0x2e699a,_0x14d98a){return db[_0xfcae('0x3f')][_0xfcae('0x48')]()['then'](respondWithResult(_0x14d98a,null))[_0xfcae('0x42')](handleError(_0x14d98a,null));}; \ No newline at end of file +var _0xe6e4=['status','end','json','count','offset','limit','set','Content-Range','save','then','error','stack','name','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x479110,_0x1989e9){var _0x33b372=function(_0x234023){while(--_0x234023){_0x479110['push'](_0x479110['shift']());}};_0x33b372(++_0x1989e9);}(_0xe6e4,0xc1));var _0x4e6e=function(_0x476f49,_0x105660){_0x476f49=_0x476f49-0x0;var _0x48addd=_0xe6e4[_0x476f49];return _0x48addd;};'use strict';var pdf=require(_0x4e6e('0x0'));var emlformat=require(_0x4e6e('0x1'));var rimraf=require(_0x4e6e('0x2'));var zipdir=require(_0x4e6e('0x3'));var jsonpatch=require(_0x4e6e('0x4'));var rp=require(_0x4e6e('0x5'));var moment=require(_0x4e6e('0x6'));var BPromise=require(_0x4e6e('0x7'));var Mustache=require(_0x4e6e('0x8'));var util=require('util');var path=require(_0x4e6e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4e6e('0xa'));var fs=require('fs');var _=require(_0x4e6e('0xb'));var squel=require('squel');var crypto=require(_0x4e6e('0xc'));var jsforce=require(_0x4e6e('0xd'));var deskjs=require(_0x4e6e('0xe'));var toCsv=require(_0x4e6e('0xf'));var querystring=require(_0x4e6e('0x10'));var Papa=require('papaparse');var Redis=require(_0x4e6e('0x11'));var authService=require(_0x4e6e('0x12'));var qs=require(_0x4e6e('0x13'));var as=require(_0x4e6e('0x14'));var hardwareService=require(_0x4e6e('0x15'));var logger=require('../../config/logger')(_0x4e6e('0x16'));var utils=require(_0x4e6e('0x17'));var config=require('../../config/environment');var db=require(_0x4e6e('0x18'))['db'];function respondWithStatusCode(_0x2eb24d,_0x373fb7){_0x373fb7=_0x373fb7||0xcc;return function(_0xcf3f18){if(_0xcf3f18){return _0x2eb24d[_0x4e6e('0x19')](_0x373fb7);}return _0x2eb24d[_0x4e6e('0x1a')](_0x373fb7)[_0x4e6e('0x1b')]();};}function respondWithResult(_0x539031,_0x15d2b2){_0x15d2b2=_0x15d2b2||0xc8;return function(_0x1bdafd){if(_0x1bdafd){return _0x539031[_0x4e6e('0x1a')](_0x15d2b2)[_0x4e6e('0x1c')](_0x1bdafd);}};}function respondWithFilteredResult(_0x538d12,_0xf16a18){return function(_0x4c0909){if(_0x4c0909){var _0x4f8b21=_0x4c0909[_0x4e6e('0x1d')],_0x2658e4=_0xf16a18[_0x4e6e('0x1e')],_0x45a1be=_0xf16a18[_0x4e6e('0x1e')]+_0xf16a18[_0x4e6e('0x1f')],_0x4ad569;if(_0x45a1be>=_0x4f8b21){_0x45a1be=_0x4f8b21;_0x4ad569=0xc8;}else{_0x4ad569=0xce;}_0x538d12['status'](_0x4ad569);return _0x538d12[_0x4e6e('0x20')](_0x4e6e('0x21'),_0x2658e4+'-'+_0x45a1be+'/'+_0x4f8b21)[_0x4e6e('0x1c')](_0x4c0909);}return null;};}function patchUpdates(_0x3dbc30){return function(_0x3580be){try{jsonpatch['apply'](_0x3580be,_0x3dbc30,!![]);}catch(_0x1fbf0d){return BPromise['reject'](_0x1fbf0d);}return _0x3580be[_0x4e6e('0x22')]();};}function saveUpdates(_0x1f0cec,_0x143333){return function(_0x1bdbd8){if(_0x1bdbd8){return _0x1bdbd8['update'](_0x1f0cec)[_0x4e6e('0x23')](function(_0x3b15b9){return _0x3b15b9;});}return null;};}function removeEntity(_0x20306c,_0x587c9b){return function(_0x40248f){if(_0x40248f){return _0x40248f['destroy']()[_0x4e6e('0x23')](function(){_0x20306c[_0x4e6e('0x1a')](0xcc)[_0x4e6e('0x1b')]();});}};}function handleEntityNotFound(_0x4a0855,_0x255e4e){return function(_0x355e22){if(!_0x355e22){_0x4a0855['sendStatus'](0x194);}return _0x355e22;};}function handleError(_0x3d9c61,_0x1afbd1){_0x1afbd1=_0x1afbd1||0x1f4;return function(_0x2e8be5){logger[_0x4e6e('0x24')](_0x2e8be5[_0x4e6e('0x25')]);if(_0x2e8be5[_0x4e6e('0x26')]){delete _0x2e8be5[_0x4e6e('0x26')];}_0x3d9c61[_0x4e6e('0x1a')](_0x1afbd1)['send'](_0x2e8be5);};}exports['index']=function(_0x51e6c0,_0x4f6279){var _0x484af8={},_0x50a220={},_0x2ce2f2={'count':0x0,'rows':[]};var _0x55a56b=_[_0x4e6e('0x27')](db[_0x4e6e('0x28')]['rawAttributes'],function(_0x4d5e3d){return{'name':_0x4d5e3d[_0x4e6e('0x29')],'type':_0x4d5e3d[_0x4e6e('0x2a')][_0x4e6e('0x2b')]};});_0x50a220[_0x4e6e('0x2c')]=_[_0x4e6e('0x27')](_0x55a56b,_0x4e6e('0x26'));_0x50a220[_0x4e6e('0x2d')]=_[_0x4e6e('0x2e')](_0x51e6c0['query']);_0x50a220[_0x4e6e('0x2f')]=_[_0x4e6e('0x30')](_0x50a220[_0x4e6e('0x2c')],_0x50a220['query']);_0x484af8[_0x4e6e('0x31')]=_[_0x4e6e('0x30')](_0x50a220[_0x4e6e('0x2c')],qs[_0x4e6e('0x32')](_0x51e6c0[_0x4e6e('0x2d')][_0x4e6e('0x32')]));_0x484af8[_0x4e6e('0x31')]=_0x484af8[_0x4e6e('0x31')][_0x4e6e('0x33')]?_0x484af8[_0x4e6e('0x31')]:_0x50a220[_0x4e6e('0x2c')];if(!_0x51e6c0[_0x4e6e('0x2d')]['hasOwnProperty'](_0x4e6e('0x34'))){_0x484af8[_0x4e6e('0x1f')]=qs[_0x4e6e('0x1f')](_0x51e6c0[_0x4e6e('0x2d')][_0x4e6e('0x1f')]);_0x484af8[_0x4e6e('0x1e')]=qs['offset'](_0x51e6c0[_0x4e6e('0x2d')][_0x4e6e('0x1e')]);}_0x484af8[_0x4e6e('0x35')]=qs[_0x4e6e('0x36')](_0x51e6c0[_0x4e6e('0x2d')][_0x4e6e('0x36')]);_0x484af8[_0x4e6e('0x37')]=qs[_0x4e6e('0x2f')](_[_0x4e6e('0x38')](_0x51e6c0[_0x4e6e('0x2d')],_0x50a220[_0x4e6e('0x2f')]));if(_0x51e6c0[_0x4e6e('0x2d')][_0x4e6e('0x39')]){_0x484af8['where']=_[_0x4e6e('0x3a')](_0x484af8[_0x4e6e('0x37')],{'$or':_[_0x4e6e('0x27')](_0x55a56b,function(_0x1654ea){if(_0x1654ea[_0x4e6e('0x2a')]!=='VIRTUAL'){var _0x265874={};_0x265874[_0x1654ea[_0x4e6e('0x26')]]={'$like':'%'+_0x51e6c0[_0x4e6e('0x2d')][_0x4e6e('0x39')]+'%'};return _0x265874;}})});}_0x484af8=_['merge']({},_0x484af8,_0x51e6c0[_0x4e6e('0x3b')]);var _0x3a54c2={'where':_0x484af8['where']};return db['OpenchannelQueueReport']['count'](_0x3a54c2)[_0x4e6e('0x23')](function(_0x51a602){_0x2ce2f2[_0x4e6e('0x1d')]=_0x51a602;if(_0x51e6c0['query'][_0x4e6e('0x3c')]){_0x484af8['include']=[{'all':!![]}];}return db[_0x4e6e('0x28')][_0x4e6e('0x3d')](_0x484af8);})[_0x4e6e('0x23')](function(_0x3cb3fa){_0x2ce2f2[_0x4e6e('0x3e')]=_0x3cb3fa;return _0x2ce2f2;})['then'](respondWithFilteredResult(_0x4f6279,_0x484af8))[_0x4e6e('0x3f')](handleError(_0x4f6279,null));};exports[_0x4e6e('0x40')]=function(_0x58da73,_0x2bf98a){var _0x3ef8e3={'raw':!![],'where':{'id':_0x58da73[_0x4e6e('0x41')]['id']}},_0x34fe6f={};_0x34fe6f['model']=_[_0x4e6e('0x2e')](db['OpenchannelQueueReport'][_0x4e6e('0x42')]);_0x34fe6f[_0x4e6e('0x2d')]=_[_0x4e6e('0x2e')](_0x58da73[_0x4e6e('0x2d')]);_0x34fe6f[_0x4e6e('0x2f')]=_[_0x4e6e('0x30')](_0x34fe6f[_0x4e6e('0x2c')],_0x34fe6f['query']);_0x3ef8e3[_0x4e6e('0x31')]=_[_0x4e6e('0x30')](_0x34fe6f['model'],qs['fields'](_0x58da73[_0x4e6e('0x2d')][_0x4e6e('0x32')]));_0x3ef8e3[_0x4e6e('0x31')]=_0x3ef8e3[_0x4e6e('0x31')]['length']?_0x3ef8e3[_0x4e6e('0x31')]:_0x34fe6f[_0x4e6e('0x2c')];if(_0x58da73[_0x4e6e('0x2d')][_0x4e6e('0x3c')]){_0x3ef8e3[_0x4e6e('0x43')]=[{'all':!![]}];}_0x3ef8e3=_[_0x4e6e('0x3a')]({},_0x3ef8e3,_0x58da73[_0x4e6e('0x3b')]);return db['OpenchannelQueueReport']['find'](_0x3ef8e3)[_0x4e6e('0x23')](handleEntityNotFound(_0x2bf98a,null))[_0x4e6e('0x23')](respondWithResult(_0x2bf98a,null))[_0x4e6e('0x3f')](handleError(_0x2bf98a,null));};exports['create']=function(_0x36527b,_0x1cc8eb){return db[_0x4e6e('0x28')][_0x4e6e('0x44')](_0x36527b['body'],{})[_0x4e6e('0x23')](respondWithResult(_0x1cc8eb,0xc9))[_0x4e6e('0x3f')](handleError(_0x1cc8eb,null));};exports['update']=function(_0x5ae39a,_0x1eb4b4){if(_0x5ae39a['body']['id']){delete _0x5ae39a[_0x4e6e('0x45')]['id'];}return db[_0x4e6e('0x28')][_0x4e6e('0x46')]({'where':{'id':_0x5ae39a[_0x4e6e('0x41')]['id']}})[_0x4e6e('0x23')](handleEntityNotFound(_0x1eb4b4,null))['then'](saveUpdates(_0x5ae39a['body'],null))[_0x4e6e('0x23')](respondWithResult(_0x1eb4b4,null))[_0x4e6e('0x3f')](handleError(_0x1eb4b4,null));};exports[_0x4e6e('0x47')]=function(_0x4d485c,_0x54c56b){return db[_0x4e6e('0x28')]['find']({'where':{'id':_0x4d485c[_0x4e6e('0x41')]['id']}})[_0x4e6e('0x23')](handleEntityNotFound(_0x54c56b,null))[_0x4e6e('0x23')](removeEntity(_0x54c56b,null))[_0x4e6e('0x3f')](handleError(_0x54c56b,null));};exports[_0x4e6e('0x48')]=function(_0x441ae5,_0x44eab4){return db[_0x4e6e('0x28')][_0x4e6e('0x48')]()[_0x4e6e('0x23')](respondWithResult(_0x44eab4,null))[_0x4e6e('0x3f')](handleError(_0x44eab4,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 78d2561..01b0676 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 _0xea2f=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue'];(function(_0x3578a4,_0x4289f0){var _0x2214f8=function(_0x1f236b){while(--_0x1f236b){_0x3578a4['push'](_0x3578a4['shift']());}};_0x2214f8(++_0x4289f0);}(_0xea2f,0x6d));var _0xfea2=function(_0x5eab75,_0x1d7d5e){_0x5eab75=_0x5eab75-0x0;var _0x517bb8=_0xea2f[_0x5eab75];return _0x517bb8;};'use strict';var _=require(_0xfea2('0x0'));var util=require('util');var logger=require(_0xfea2('0x1'))(_0xfea2('0x2'));var moment=require('moment');var BPromise=require(_0xfea2('0x3'));var rp=require(_0xfea2('0x4'));var fs=require('fs');var path=require(_0xfea2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfea2('0x6'));module[_0xfea2('0x7')]=function(_0x2a347a,_0x10c38b){return _0x2a347a[_0xfea2('0x8')](_0xfea2('0x9'),attributes,{'tableName':_0xfea2('0xa'),'paranoid':![],'indexes':[{'name':_0xfea2('0xb'),'fields':[_0xfea2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x58f4=['exports','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes'];(function(_0xe79592,_0x1efc03){var _0x13818c=function(_0x118437){while(--_0x118437){_0xe79592['push'](_0xe79592['shift']());}};_0x13818c(++_0x1efc03);}(_0x58f4,0x1b2));var _0x458f=function(_0xc1ece9,_0xfb02cf){_0xc1ece9=_0xc1ece9-0x0;var _0xc00a51=_0x58f4[_0xc1ece9];return _0xc00a51;};'use strict';var _=require('lodash');var util=require(_0x458f('0x0'));var logger=require(_0x458f('0x1'))(_0x458f('0x2'));var moment=require(_0x458f('0x3'));var BPromise=require(_0x458f('0x4'));var rp=require(_0x458f('0x5'));var fs=require('fs');var path=require(_0x458f('0x6'));var rimraf=require(_0x458f('0x7'));var config=require(_0x458f('0x8'));var attributes=require(_0x458f('0x9'));module[_0x458f('0xa')]=function(_0x103d54,_0x5a1908){return _0x103d54['define']('OpenchannelQueueReport',attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x458f('0xb'),'fields':[_0x458f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 9092667..9490f63 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 _0x6b19=['result','catch','CreateOpenchannelQueueReport','body','raw','debug','stringify','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','options','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x2a7f54,_0x734751){var _0x1ee999=function(_0x5e2781){while(--_0x5e2781){_0x2a7f54['push'](_0x2a7f54['shift']());}};_0x1ee999(++_0x734751);}(_0x6b19,0xf4));var _0x96b1=function(_0x4f5518,_0x533868){_0x4f5518=_0x4f5518-0x0;var _0x2179e3=_0x6b19[_0x4f5518];return _0x2179e3;};'use strict';var _=require(_0x96b1('0x0'));var util=require('util');var moment=require(_0x96b1('0x1'));var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b1('0x3'));var db=require(_0x96b1('0x4'))['db'];var utils=require(_0x96b1('0x5'));var logger=require(_0x96b1('0x6'))('rpc');var config=require(_0x96b1('0x7'));var jayson=require(_0x96b1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x288d77,_0x2347c5,_0x519fbe){return new BPromise(function(_0x280b00,_0x2300ad){return client['request'](_0x288d77,_0x519fbe)[_0x96b1('0x9')](function(_0x6323a6){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,_0x96b1('0xc'));logger['debug'](_0x96b1('0xd'),_0x2347c5,'request\x20sent',JSON['stringify'](_0x6323a6));if(_0x6323a6['error']){if(_0x6323a6['error'][_0x96b1('0xe')]===0x1f4){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x2300ad(_0x6323a6['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x280b00(_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,'request\x20sent');_0x280b00(_0x6323a6[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x350b2c){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x350b2c);_0x2300ad(_0x350b2c);});});}exports[_0x96b1('0x13')]=function(_0x41227b){var _0x1749a7=this;return new Promise(function(_0x44cc44,_0xd1eebb){return db['OpenchannelQueueReport']['create'](_0x41227b[_0x96b1('0x14')],{'raw':_0x41227b['options']?_0x41227b['options'][_0x96b1('0x15')]===undefined?!![]:![]:!![]})[_0x96b1('0x9')](function(_0x2bb819){logger['info'](_0x96b1('0x13'),_0x41227b);logger[_0x96b1('0x16')](_0x96b1('0x13'),_0x41227b,JSON[_0x96b1('0x17')](_0x2bb819));_0x44cc44(_0x2bb819);})[_0x96b1('0x12')](function(_0x276919){logger[_0x96b1('0xf')](_0x96b1('0x13'),_0x276919[_0x96b1('0x10')],_0x41227b);_0xd1eebb(_0x1749a7[_0x96b1('0xf')](0x1f4,_0x276919[_0x96b1('0x10')]));});});};exports[_0x96b1('0x18')]=function(_0x295f05){var _0x2f2d4e=this;return new Promise(function(_0xe433b1,_0x232d49){return db[_0x96b1('0x19')][_0x96b1('0x1a')](_0x295f05[_0x96b1('0x14')],{'raw':_0x295f05[_0x96b1('0x1b')]?_0x295f05[_0x96b1('0x1b')][_0x96b1('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295f05[_0x96b1('0x1b')]?_0x295f05[_0x96b1('0x1b')]['where']||null:null,'attributes':_0x295f05['options']?_0x295f05[_0x96b1('0x1b')]['attributes']||null:null,'limit':_0x295f05[_0x96b1('0x1b')]?_0x295f05[_0x96b1('0x1b')][_0x96b1('0x1c')]||null:null})[_0x96b1('0x9')](function(_0x4e4426){logger['info'](_0x96b1('0x18'),_0x295f05);logger[_0x96b1('0x16')]('UpdateOpenchannelQueueReport',_0x295f05,JSON[_0x96b1('0x17')](_0x4e4426));_0xe433b1(_0x4e4426);})[_0x96b1('0x12')](function(_0xfa903e){logger[_0x96b1('0xf')](_0x96b1('0x18'),_0xfa903e[_0x96b1('0x10')],_0x295f05);_0x232d49(_0x2f2d4e['error'](0x1f4,_0xfa903e[_0x96b1('0x10')]));});});}; \ No newline at end of file +var _0xab00=['client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelQueueReport','create','body','options','CreateOpenchannelQueueReport','update','raw','where','limit','debug','UpdateOpenchannelQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x47b98d,_0x2110a5){var _0x4e53fe=function(_0x35f015){while(--_0x35f015){_0x47b98d['push'](_0x47b98d['shift']());}};_0x4e53fe(++_0x2110a5);}(_0xab00,0x1b9));var _0x0ab0=function(_0x58cf81,_0x59288b){_0x58cf81=_0x58cf81-0x0;var _0x3ba237=_0xab00[_0x58cf81];return _0x3ba237;};'use strict';var _=require(_0x0ab0('0x0'));var util=require(_0x0ab0('0x1'));var moment=require(_0x0ab0('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ab0('0x3'));var fs=require('fs');var Redis=require(_0x0ab0('0x4'));var db=require(_0x0ab0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ab0('0x6'))('rpc');var config=require(_0x0ab0('0x7'));var jayson=require(_0x0ab0('0x8'));var client=jayson[_0x0ab0('0x9')][_0x0ab0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x363359,_0x25742b,_0x59fb03){return new BPromise(function(_0x3e934d,_0x2cbb53){return client['request'](_0x363359,_0x59fb03)[_0x0ab0('0xb')](function(_0x4f4a28){logger[_0x0ab0('0xc')](_0x0ab0('0xd'),_0x25742b,'request\x20sent');logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x25742b,'request\x20sent',JSON[_0x0ab0('0xe')](_0x4f4a28));if(_0x4f4a28['error']){if(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x10')]===0x1f4){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x2cbb53(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}logger[_0x0ab0('0xf')](_0x0ab0('0xd'),_0x25742b,_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);return _0x3e934d(_0x4f4a28[_0x0ab0('0xf')][_0x0ab0('0x11')]);}else{logger[_0x0ab0('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x25742b,'request\x20sent');_0x3e934d(_0x4f4a28['result'][_0x0ab0('0x11')]);}})[_0x0ab0('0x12')](function(_0x2f594b){logger['error'](_0x0ab0('0xd'),_0x25742b,_0x2f594b);_0x2cbb53(_0x2f594b);});});}exports['CreateOpenchannelQueueReport']=function(_0x5b3bef){var _0x5710bf=this;return new Promise(function(_0x171341,_0x3ea3f1){return db[_0x0ab0('0x13')][_0x0ab0('0x14')](_0x5b3bef[_0x0ab0('0x15')],{'raw':_0x5b3bef[_0x0ab0('0x16')]?_0x5b3bef[_0x0ab0('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2cda33){logger[_0x0ab0('0xc')](_0x0ab0('0x17'),_0x5b3bef);logger['debug'](_0x0ab0('0x17'),_0x5b3bef,JSON['stringify'](_0x2cda33));_0x171341(_0x2cda33);})[_0x0ab0('0x12')](function(_0x2ccb3e){logger[_0x0ab0('0xf')](_0x0ab0('0x17'),_0x2ccb3e[_0x0ab0('0x11')],_0x5b3bef);_0x3ea3f1(_0x5710bf[_0x0ab0('0xf')](0x1f4,_0x2ccb3e[_0x0ab0('0x11')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2a4629){var _0xe7f0a5=this;return new Promise(function(_0x2635a2,_0x5e3ebb){return db[_0x0ab0('0x13')][_0x0ab0('0x18')](_0x2a4629[_0x0ab0('0x15')],{'raw':_0x2a4629['options']?_0x2a4629[_0x0ab0('0x16')][_0x0ab0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a4629[_0x0ab0('0x16')]?_0x2a4629[_0x0ab0('0x16')][_0x0ab0('0x1a')]||null:null,'attributes':_0x2a4629['options']?_0x2a4629[_0x0ab0('0x16')]['attributes']||null:null,'limit':_0x2a4629[_0x0ab0('0x16')]?_0x2a4629[_0x0ab0('0x16')][_0x0ab0('0x1b')]||null:null})[_0x0ab0('0xb')](function(_0x5ae993){logger[_0x0ab0('0xc')]('UpdateOpenchannelQueueReport',_0x2a4629);logger[_0x0ab0('0x1c')](_0x0ab0('0x1d'),_0x2a4629,JSON[_0x0ab0('0xe')](_0x5ae993));_0x2635a2(_0x5ae993);})[_0x0ab0('0x12')](function(_0x657f32){logger[_0x0ab0('0xf')](_0x0ab0('0x1d'),_0x657f32[_0x0ab0('0x11')],_0x2a4629);_0x5e3ebb(_0xe7f0a5[_0x0ab0('0xf')](0x1f4,_0x657f32[_0x0ab0('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 87e89fd..d3f0cd9 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x34bd34,_0x1444f7){var _0x4e36d6=function(_0x20ed8e){while(--_0x20ed8e){_0x34bd34['push'](_0x34bd34['shift']());}};_0x4e36d6(++_0x1444f7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index bbf29da..33b6136 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 _0x83a4=['account','agent','queue','DATE','NOW','sequelize','exports','STRING','ENUM'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x83a4,0x17f));var _0x483a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x83a4[_0x209941];return _0x1e8729;};'use strict';var moment=require('moment');var Sequelize=require(_0x483a('0x0'));module[_0x483a('0x1')]={'uniqueid':{'type':Sequelize[_0x483a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x483a('0x3')](_0x483a('0x4'),_0x483a('0x5'),_0x483a('0x6')),'allowNull':![],'defaultValue':_0x483a('0x6')},'transferredAt':{'type':Sequelize[_0x483a('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x483a('0x8')]}}; \ No newline at end of file +var _0xe63b=['queue','DATE','NOW','moment','sequelize','exports','STRING','ENUM','account','agent'];(function(_0x186d5d,_0x5cf8a9){var _0x1abb84=function(_0x1b6034){while(--_0x1b6034){_0x186d5d['push'](_0x186d5d['shift']());}};_0x1abb84(++_0x5cf8a9);}(_0xe63b,0xe9));var _0xbe63=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xe63b[_0x29d94e];return _0x106237;};'use strict';var moment=require(_0xbe63('0x0'));var Sequelize=require(_0xbe63('0x1'));module[_0xbe63('0x2')]={'uniqueid':{'type':Sequelize[_0xbe63('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xbe63('0x4')](_0xbe63('0x5'),_0xbe63('0x6'),_0xbe63('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xbe63('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xbe63('0x9')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 48137ec..ec7e8e5 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 _0xad82=['offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','create','body','find','describe','html-pdf','eml-format','rimraf','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x2f9424,_0x39e0f9){var _0x179915=function(_0x141fb3){while(--_0x141fb3){_0x2f9424['push'](_0x2f9424['shift']());}};_0x179915(++_0x39e0f9);}(_0xad82,0x10f));var _0x2ad8=function(_0x3ef8a9,_0x59a7c2){_0x3ef8a9=_0x3ef8a9-0x0;var _0x424f63=_0xad82[_0x3ef8a9];return _0x424f63;};'use strict';var pdf=require(_0x2ad8('0x0'));var emlformat=require(_0x2ad8('0x1'));var rimraf=require(_0x2ad8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ad8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2ad8('0x4'));var util=require(_0x2ad8('0x5'));var path=require(_0x2ad8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2ad8('0x7'));var fs=require('fs');var _=require(_0x2ad8('0x8'));var squel=require(_0x2ad8('0x9'));var crypto=require(_0x2ad8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2ad8('0xb'));var toCsv=require(_0x2ad8('0xc'));var querystring=require(_0x2ad8('0xd'));var Papa=require('papaparse');var Redis=require(_0x2ad8('0xe'));var authService=require(_0x2ad8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2ad8('0x10'));var hardwareService=require(_0x2ad8('0x11'));var logger=require('../../config/logger')(_0x2ad8('0x12'));var utils=require(_0x2ad8('0x13'));var config=require(_0x2ad8('0x14'));var db=require(_0x2ad8('0x15'))['db'];function respondWithStatusCode(_0x478aa4,_0xbdf87a){_0xbdf87a=_0xbdf87a||0xcc;return function(_0x536eb5){if(_0x536eb5){return _0x478aa4[_0x2ad8('0x16')](_0xbdf87a);}return _0x478aa4[_0x2ad8('0x17')](_0xbdf87a)[_0x2ad8('0x18')]();};}function respondWithResult(_0x4a4c00,_0x58ef60){_0x58ef60=_0x58ef60||0xc8;return function(_0x5b2dd3){if(_0x5b2dd3){return _0x4a4c00['status'](_0x58ef60)['json'](_0x5b2dd3);}};}function respondWithFilteredResult(_0xf41c05,_0x1e52eb){return function(_0x985e80){if(_0x985e80){var _0xa6716=_0x985e80['count'],_0x308ef5=_0x1e52eb[_0x2ad8('0x19')],_0x3e0836=_0x1e52eb[_0x2ad8('0x19')]+_0x1e52eb[_0x2ad8('0x1a')],_0x143b1f;if(_0x3e0836>=_0xa6716){_0x3e0836=_0xa6716;_0x143b1f=0xc8;}else{_0x143b1f=0xce;}_0xf41c05['status'](_0x143b1f);return _0xf41c05[_0x2ad8('0x1b')](_0x2ad8('0x1c'),_0x308ef5+'-'+_0x3e0836+'/'+_0xa6716)[_0x2ad8('0x1d')](_0x985e80);}return null;};}function patchUpdates(_0x1bee29){return function(_0x76f8ca){try{jsonpatch[_0x2ad8('0x1e')](_0x76f8ca,_0x1bee29,!![]);}catch(_0x465dab){return BPromise[_0x2ad8('0x1f')](_0x465dab);}return _0x76f8ca[_0x2ad8('0x20')]();};}function saveUpdates(_0x5bde59,_0x8022d4){return function(_0x3ae341){if(_0x3ae341){return _0x3ae341[_0x2ad8('0x21')](_0x5bde59)['then'](function(_0x2c0b49){return _0x2c0b49;});}return null;};}function removeEntity(_0x4009b2,_0x3aa1d7){return function(_0x22af70){if(_0x22af70){return _0x22af70[_0x2ad8('0x22')]()[_0x2ad8('0x23')](function(){_0x4009b2[_0x2ad8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ec68,_0x35201a){return function(_0x4fe60f){if(!_0x4fe60f){_0x49ec68[_0x2ad8('0x16')](0x194);}return _0x4fe60f;};}function handleError(_0x4a3792,_0x501fc5){_0x501fc5=_0x501fc5||0x1f4;return function(_0x243c8f){logger[_0x2ad8('0x24')](_0x243c8f[_0x2ad8('0x25')]);if(_0x243c8f[_0x2ad8('0x26')]){delete _0x243c8f[_0x2ad8('0x26')];}_0x4a3792[_0x2ad8('0x17')](_0x501fc5)['send'](_0x243c8f);};}exports[_0x2ad8('0x27')]=function(_0x2a874f,_0x259d7f){var _0x55ee35={},_0x2caf43={},_0x50d8ad={'count':0x0,'rows':[]};var _0x589b45=_[_0x2ad8('0x28')](db[_0x2ad8('0x29')][_0x2ad8('0x2a')],function(_0x4866df){return{'name':_0x4866df[_0x2ad8('0x2b')],'type':_0x4866df[_0x2ad8('0x2c')][_0x2ad8('0x2d')]};});_0x2caf43[_0x2ad8('0x2e')]=_[_0x2ad8('0x28')](_0x589b45,'name');_0x2caf43[_0x2ad8('0x2f')]=_[_0x2ad8('0x30')](_0x2a874f['query']);_0x2caf43[_0x2ad8('0x31')]=_[_0x2ad8('0x32')](_0x2caf43['model'],_0x2caf43[_0x2ad8('0x2f')]);_0x55ee35[_0x2ad8('0x33')]=_[_0x2ad8('0x32')](_0x2caf43['model'],qs[_0x2ad8('0x34')](_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x34')]));_0x55ee35[_0x2ad8('0x33')]=_0x55ee35[_0x2ad8('0x33')][_0x2ad8('0x35')]?_0x55ee35[_0x2ad8('0x33')]:_0x2caf43[_0x2ad8('0x2e')];if(!_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x36')](_0x2ad8('0x37'))){_0x55ee35[_0x2ad8('0x1a')]=qs[_0x2ad8('0x1a')](_0x2a874f[_0x2ad8('0x2f')]['limit']);_0x55ee35[_0x2ad8('0x19')]=qs[_0x2ad8('0x19')](_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x19')]);}_0x55ee35['order']=qs[_0x2ad8('0x38')](_0x2a874f[_0x2ad8('0x2f')]['sort']);_0x55ee35[_0x2ad8('0x39')]=qs[_0x2ad8('0x31')](_[_0x2ad8('0x3a')](_0x2a874f[_0x2ad8('0x2f')],_0x2caf43[_0x2ad8('0x31')]));if(_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x3b')]){_0x55ee35[_0x2ad8('0x39')]=_[_0x2ad8('0x3c')](_0x55ee35['where'],{'$or':_[_0x2ad8('0x28')](_0x589b45,function(_0x3192c3){if(_0x3192c3[_0x2ad8('0x2c')]!==_0x2ad8('0x3d')){var _0x3fbb90={};_0x3fbb90[_0x3192c3['name']]={'$like':'%'+_0x2a874f['query'][_0x2ad8('0x3b')]+'%'};return _0x3fbb90;}})});}_0x55ee35=_[_0x2ad8('0x3c')]({},_0x55ee35,_0x2a874f[_0x2ad8('0x3e')]);var _0xa4e1a0={'where':_0x55ee35[_0x2ad8('0x39')]};return db[_0x2ad8('0x29')][_0x2ad8('0x3f')](_0xa4e1a0)[_0x2ad8('0x23')](function(_0x369114){_0x50d8ad[_0x2ad8('0x3f')]=_0x369114;if(_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x40')]){_0x55ee35[_0x2ad8('0x41')]=[{'all':!![]}];}return db[_0x2ad8('0x29')][_0x2ad8('0x42')](_0x55ee35);})[_0x2ad8('0x23')](function(_0x40f956){_0x50d8ad[_0x2ad8('0x43')]=_0x40f956;return _0x50d8ad;})[_0x2ad8('0x23')](respondWithFilteredResult(_0x259d7f,_0x55ee35))[_0x2ad8('0x44')](handleError(_0x259d7f,null));};exports['show']=function(_0x37c69d,_0x3f0c2b){var _0x346d19={'raw':!![],'where':{'id':_0x37c69d[_0x2ad8('0x45')]['id']}},_0x3898cb={};_0x3898cb[_0x2ad8('0x2e')]=_['keys'](db['OpenchannelTransferReport'][_0x2ad8('0x2a')]);_0x3898cb[_0x2ad8('0x2f')]=_[_0x2ad8('0x30')](_0x37c69d[_0x2ad8('0x2f')]);_0x3898cb[_0x2ad8('0x31')]=_[_0x2ad8('0x32')](_0x3898cb[_0x2ad8('0x2e')],_0x3898cb['query']);_0x346d19[_0x2ad8('0x33')]=_['intersection'](_0x3898cb['model'],qs[_0x2ad8('0x34')](_0x37c69d[_0x2ad8('0x2f')]['fields']));_0x346d19['attributes']=_0x346d19[_0x2ad8('0x33')][_0x2ad8('0x35')]?_0x346d19['attributes']:_0x3898cb[_0x2ad8('0x2e')];if(_0x37c69d[_0x2ad8('0x2f')][_0x2ad8('0x40')]){_0x346d19[_0x2ad8('0x41')]=[{'all':!![]}];}_0x346d19=_[_0x2ad8('0x3c')]({},_0x346d19,_0x37c69d[_0x2ad8('0x3e')]);return db[_0x2ad8('0x29')]['find'](_0x346d19)[_0x2ad8('0x23')](handleEntityNotFound(_0x3f0c2b,null))[_0x2ad8('0x23')](respondWithResult(_0x3f0c2b,null))['catch'](handleError(_0x3f0c2b,null));};exports[_0x2ad8('0x46')]=function(_0x3d0df1,_0x17a5ba){return db[_0x2ad8('0x29')][_0x2ad8('0x46')](_0x3d0df1[_0x2ad8('0x47')],{})[_0x2ad8('0x23')](respondWithResult(_0x17a5ba,0xc9))[_0x2ad8('0x44')](handleError(_0x17a5ba,null));};exports['update']=function(_0x58b955,_0x268a34){if(_0x58b955['body']['id']){delete _0x58b955[_0x2ad8('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x2ad8('0x48')]({'where':{'id':_0x58b955[_0x2ad8('0x45')]['id']}})['then'](handleEntityNotFound(_0x268a34,null))[_0x2ad8('0x23')](saveUpdates(_0x58b955[_0x2ad8('0x47')],null))['then'](respondWithResult(_0x268a34,null))[_0x2ad8('0x44')](handleError(_0x268a34,null));};exports['destroy']=function(_0x3e9643,_0x310dbe){return db['OpenchannelTransferReport'][_0x2ad8('0x48')]({'where':{'id':_0x3e9643[_0x2ad8('0x45')]['id']}})[_0x2ad8('0x23')](handleEntityNotFound(_0x310dbe,null))[_0x2ad8('0x23')](removeEntity(_0x310dbe,null))[_0x2ad8('0x44')](handleError(_0x310dbe,null));};exports[_0x2ad8('0x49')]=function(_0x4e0e7a,_0x348903){return db[_0x2ad8('0x29')][_0x2ad8('0x49')]()[_0x2ad8('0x23')](respondWithResult(_0x348903,null))[_0x2ad8('0x44')](handleError(_0x348903,null));}; \ No newline at end of file +var _0x8de4=['lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','intersection','options','create','OpenchannelTransferReport','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv'];(function(_0x4fe5d0,_0x463938){var _0x104238=function(_0x238437){while(--_0x238437){_0x4fe5d0['push'](_0x4fe5d0['shift']());}};_0x104238(++_0x463938);}(_0x8de4,0x199));var _0x48de=function(_0x2043f5,_0x558cb8){_0x2043f5=_0x2043f5-0x0;var _0x1fd3f0=_0x8de4[_0x2043f5];return _0x1fd3f0;};'use strict';var pdf=require(_0x48de('0x0'));var emlformat=require(_0x48de('0x1'));var rimraf=require(_0x48de('0x2'));var zipdir=require(_0x48de('0x3'));var jsonpatch=require(_0x48de('0x4'));var rp=require(_0x48de('0x5'));var moment=require(_0x48de('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x48de('0x7'));var util=require(_0x48de('0x8'));var path=require(_0x48de('0x9'));var sox=require('sox');var csv=require(_0x48de('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x48de('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x48de('0xc'));var deskjs=require(_0x48de('0xd'));var toCsv=require(_0x48de('0xa'));var querystring=require(_0x48de('0xe'));var Papa=require(_0x48de('0xf'));var Redis=require(_0x48de('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x48de('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x48de('0x12'))(_0x48de('0x13'));var utils=require(_0x48de('0x14'));var config=require(_0x48de('0x15'));var db=require(_0x48de('0x16'))['db'];function respondWithStatusCode(_0x1cc87d,_0x9ebe6d){_0x9ebe6d=_0x9ebe6d||0xcc;return function(_0x1eb08d){if(_0x1eb08d){return _0x1cc87d[_0x48de('0x17')](_0x9ebe6d);}return _0x1cc87d[_0x48de('0x18')](_0x9ebe6d)[_0x48de('0x19')]();};}function respondWithResult(_0x3ae47e,_0x584544){_0x584544=_0x584544||0xc8;return function(_0x94d1a5){if(_0x94d1a5){return _0x3ae47e[_0x48de('0x18')](_0x584544)[_0x48de('0x1a')](_0x94d1a5);}};}function respondWithFilteredResult(_0x36e9d0,_0x26cc57){return function(_0x41ceb4){if(_0x41ceb4){var _0x1d82bc=_0x41ceb4['count'],_0x3cf635=_0x26cc57[_0x48de('0x1b')],_0x10000c=_0x26cc57[_0x48de('0x1b')]+_0x26cc57[_0x48de('0x1c')],_0x36a330;if(_0x10000c>=_0x1d82bc){_0x10000c=_0x1d82bc;_0x36a330=0xc8;}else{_0x36a330=0xce;}_0x36e9d0[_0x48de('0x18')](_0x36a330);return _0x36e9d0['set'](_0x48de('0x1d'),_0x3cf635+'-'+_0x10000c+'/'+_0x1d82bc)[_0x48de('0x1a')](_0x41ceb4);}return null;};}function patchUpdates(_0x340c8a){return function(_0x46dff0){try{jsonpatch['apply'](_0x46dff0,_0x340c8a,!![]);}catch(_0xc55149){return BPromise['reject'](_0xc55149);}return _0x46dff0[_0x48de('0x1e')]();};}function saveUpdates(_0x1dc1ff,_0xe54034){return function(_0x42b797){if(_0x42b797){return _0x42b797[_0x48de('0x1f')](_0x1dc1ff)[_0x48de('0x20')](function(_0xcbf1d6){return _0xcbf1d6;});}return null;};}function removeEntity(_0x4de5f8,_0x594657){return function(_0x5a238c){if(_0x5a238c){return _0x5a238c[_0x48de('0x21')]()['then'](function(){_0x4de5f8[_0x48de('0x18')](0xcc)[_0x48de('0x19')]();});}};}function handleEntityNotFound(_0x2f3bc2,_0x5d3e8f){return function(_0x1a5042){if(!_0x1a5042){_0x2f3bc2[_0x48de('0x17')](0x194);}return _0x1a5042;};}function handleError(_0x3d5401,_0x1d2dd1){_0x1d2dd1=_0x1d2dd1||0x1f4;return function(_0x30ff24){logger[_0x48de('0x22')](_0x30ff24[_0x48de('0x23')]);if(_0x30ff24[_0x48de('0x24')]){delete _0x30ff24[_0x48de('0x24')];}_0x3d5401['status'](_0x1d2dd1)[_0x48de('0x25')](_0x30ff24);};}exports['index']=function(_0x23a84e,_0x573539){var _0x245a8c={},_0x4eeae0={},_0x19ecc0={'count':0x0,'rows':[]};var _0x125ba4=_[_0x48de('0x26')](db['OpenchannelTransferReport'][_0x48de('0x27')],function(_0x25908f){return{'name':_0x25908f[_0x48de('0x28')],'type':_0x25908f[_0x48de('0x29')][_0x48de('0x2a')]};});_0x4eeae0[_0x48de('0x2b')]=_['map'](_0x125ba4,_0x48de('0x24'));_0x4eeae0[_0x48de('0x2c')]=_[_0x48de('0x2d')](_0x23a84e[_0x48de('0x2c')]);_0x4eeae0[_0x48de('0x2e')]=_['intersection'](_0x4eeae0[_0x48de('0x2b')],_0x4eeae0[_0x48de('0x2c')]);_0x245a8c[_0x48de('0x2f')]=_['intersection'](_0x4eeae0[_0x48de('0x2b')],qs['fields'](_0x23a84e['query'][_0x48de('0x30')]));_0x245a8c[_0x48de('0x2f')]=_0x245a8c[_0x48de('0x2f')][_0x48de('0x31')]?_0x245a8c[_0x48de('0x2f')]:_0x4eeae0[_0x48de('0x2b')];if(!_0x23a84e[_0x48de('0x2c')][_0x48de('0x32')](_0x48de('0x33'))){_0x245a8c['limit']=qs['limit'](_0x23a84e[_0x48de('0x2c')]['limit']);_0x245a8c['offset']=qs[_0x48de('0x1b')](_0x23a84e[_0x48de('0x2c')][_0x48de('0x1b')]);}_0x245a8c['order']=qs[_0x48de('0x34')](_0x23a84e['query'][_0x48de('0x34')]);_0x245a8c[_0x48de('0x35')]=qs['filters'](_['pick'](_0x23a84e[_0x48de('0x2c')],_0x4eeae0['filters']));if(_0x23a84e[_0x48de('0x2c')]['filter']){_0x245a8c[_0x48de('0x35')]=_[_0x48de('0x36')](_0x245a8c[_0x48de('0x35')],{'$or':_[_0x48de('0x26')](_0x125ba4,function(_0x24e42e){if(_0x24e42e[_0x48de('0x29')]!==_0x48de('0x37')){var _0x1b972c={};_0x1b972c[_0x24e42e[_0x48de('0x24')]]={'$like':'%'+_0x23a84e[_0x48de('0x2c')]['filter']+'%'};return _0x1b972c;}})});}_0x245a8c=_['merge']({},_0x245a8c,_0x23a84e['options']);var _0x43a53b={'where':_0x245a8c[_0x48de('0x35')]};return db['OpenchannelTransferReport'][_0x48de('0x38')](_0x43a53b)[_0x48de('0x20')](function(_0x20dff2){_0x19ecc0[_0x48de('0x38')]=_0x20dff2;if(_0x23a84e[_0x48de('0x2c')][_0x48de('0x39')]){_0x245a8c[_0x48de('0x3a')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x48de('0x3b')](_0x245a8c);})[_0x48de('0x20')](function(_0x321382){_0x19ecc0[_0x48de('0x3c')]=_0x321382;return _0x19ecc0;})['then'](respondWithFilteredResult(_0x573539,_0x245a8c))[_0x48de('0x3d')](handleError(_0x573539,null));};exports['show']=function(_0x43ae68,_0x4c8933){var _0x14cb7c={'raw':!![],'where':{'id':_0x43ae68[_0x48de('0x3e')]['id']}},_0x3ecfcf={};_0x3ecfcf[_0x48de('0x2b')]=_[_0x48de('0x2d')](db['OpenchannelTransferReport'][_0x48de('0x27')]);_0x3ecfcf[_0x48de('0x2c')]=_[_0x48de('0x2d')](_0x43ae68['query']);_0x3ecfcf[_0x48de('0x2e')]=_[_0x48de('0x3f')](_0x3ecfcf[_0x48de('0x2b')],_0x3ecfcf['query']);_0x14cb7c[_0x48de('0x2f')]=_[_0x48de('0x3f')](_0x3ecfcf['model'],qs[_0x48de('0x30')](_0x43ae68[_0x48de('0x2c')][_0x48de('0x30')]));_0x14cb7c[_0x48de('0x2f')]=_0x14cb7c[_0x48de('0x2f')][_0x48de('0x31')]?_0x14cb7c[_0x48de('0x2f')]:_0x3ecfcf['model'];if(_0x43ae68[_0x48de('0x2c')]['includeAll']){_0x14cb7c[_0x48de('0x3a')]=[{'all':!![]}];}_0x14cb7c=_[_0x48de('0x36')]({},_0x14cb7c,_0x43ae68[_0x48de('0x40')]);return db['OpenchannelTransferReport']['find'](_0x14cb7c)[_0x48de('0x20')](handleEntityNotFound(_0x4c8933,null))[_0x48de('0x20')](respondWithResult(_0x4c8933,null))['catch'](handleError(_0x4c8933,null));};exports[_0x48de('0x41')]=function(_0x333a38,_0x58657a){return db[_0x48de('0x42')][_0x48de('0x41')](_0x333a38['body'],{})[_0x48de('0x20')](respondWithResult(_0x58657a,0xc9))[_0x48de('0x3d')](handleError(_0x58657a,null));};exports[_0x48de('0x1f')]=function(_0x397780,_0x82c0e0){if(_0x397780[_0x48de('0x43')]['id']){delete _0x397780['body']['id'];}return db[_0x48de('0x42')][_0x48de('0x44')]({'where':{'id':_0x397780['params']['id']}})['then'](handleEntityNotFound(_0x82c0e0,null))['then'](saveUpdates(_0x397780[_0x48de('0x43')],null))[_0x48de('0x20')](respondWithResult(_0x82c0e0,null))['catch'](handleError(_0x82c0e0,null));};exports[_0x48de('0x21')]=function(_0xc579cd,_0x7561eb){return db[_0x48de('0x42')]['find']({'where':{'id':_0xc579cd[_0x48de('0x3e')]['id']}})[_0x48de('0x20')](handleEntityNotFound(_0x7561eb,null))['then'](removeEntity(_0x7561eb,null))['catch'](handleError(_0x7561eb,null));};exports[_0x48de('0x45')]=function(_0x87b5df,_0x18c310){return db[_0x48de('0x42')][_0x48de('0x45')]()[_0x48de('0x20')](respondWithResult(_0x18c310,null))['catch'](handleError(_0x18c310,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 8b27694..b334e89 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 _0xe077=['./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xfae21d,_0x5066d0){var _0xffc171=function(_0x198169){while(--_0x198169){_0xfae21d['push'](_0xfae21d['shift']());}};_0xffc171(++_0x5066d0);}(_0xe077,0x1d8));var _0x7e07=function(_0x27af67,_0x2770b6){_0x27af67=_0x27af67-0x0;var _0x158f75=_0xe077[_0x27af67];return _0x158f75;};'use strict';var _=require('lodash');var util=require(_0x7e07('0x0'));var logger=require(_0x7e07('0x1'))(_0x7e07('0x2'));var moment=require(_0x7e07('0x3'));var BPromise=require(_0x7e07('0x4'));var rp=require(_0x7e07('0x5'));var fs=require('fs');var path=require(_0x7e07('0x6'));var rimraf=require('rimraf');var config=require(_0x7e07('0x7'));var attributes=require(_0x7e07('0x8'));module['exports']=function(_0x3c6839,_0x4bfd01){return _0x3c6839[_0x7e07('0x9')](_0x7e07('0xa'),attributes,{'tableName':_0x7e07('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6152=['OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6152,0x15e));var _0x2615=function(_0x2721d4,_0x542657){_0x2721d4=_0x2721d4-0x0;var _0x8ff41=_0x6152[_0x2721d4];return _0x8ff41;};'use strict';var _=require(_0x2615('0x0'));var util=require(_0x2615('0x1'));var logger=require(_0x2615('0x2'))('api');var moment=require(_0x2615('0x3'));var BPromise=require(_0x2615('0x4'));var rp=require(_0x2615('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2615('0x6'));var config=require(_0x2615('0x7'));var attributes=require(_0x2615('0x8'));module['exports']=function(_0x17f6ba,_0x20287a){return _0x17f6ba[_0x2615('0x9')](_0x2615('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x2615('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index eb5095b..f47747b 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 _0x408f=['then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x56e976,_0x1319fa){var _0x28262e=function(_0x5ab66f){while(--_0x5ab66f){_0x56e976['push'](_0x56e976['shift']());}};_0x28262e(++_0x1319fa);}(_0x408f,0x1c1));var _0xf408=function(_0x597496,_0x82f653){_0x597496=_0x597496-0x0;var _0x2d4faf=_0x408f[_0x597496];return _0x2d4faf;};'use strict';var _=require(_0xf408('0x0'));var util=require(_0xf408('0x1'));var moment=require('moment');var BPromise=require(_0xf408('0x2'));var rs=require(_0xf408('0x3'));var fs=require('fs');var Redis=require(_0xf408('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf408('0x5'));var logger=require(_0xf408('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf408('0x7'));var client=jayson[_0xf408('0x8')][_0xf408('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe678ff,_0x2f1c04,_0x31d015){return new BPromise(function(_0x315c6e,_0x8baadd){return client[_0xf408('0xa')](_0xe678ff,_0x31d015)[_0xf408('0xb')](function(_0x2204c2){logger[_0xf408('0xc')](_0xf408('0xd'),_0x2f1c04,_0xf408('0xe'));logger[_0xf408('0xf')](_0xf408('0x10'),_0x2f1c04,_0xf408('0xe'),JSON[_0xf408('0x11')](_0x2204c2));if(_0x2204c2[_0xf408('0x12')]){if(_0x2204c2[_0xf408('0x12')][_0xf408('0x13')]===0x1f4){logger[_0xf408('0x12')](_0xf408('0xd'),_0x2f1c04,_0x2204c2[_0xf408('0x12')][_0xf408('0x14')]);return _0x8baadd(_0x2204c2['error'][_0xf408('0x14')]);}logger[_0xf408('0x12')](_0xf408('0xd'),_0x2f1c04,_0x2204c2[_0xf408('0x12')]['message']);return _0x315c6e(_0x2204c2[_0xf408('0x12')][_0xf408('0x14')]);}else{logger['info'](_0xf408('0xd'),_0x2f1c04,'request\x20sent');_0x315c6e(_0x2204c2[_0xf408('0x15')]['message']);}})[_0xf408('0x16')](function(_0xe499e0){logger['error'](_0xf408('0xd'),_0x2f1c04,_0xe499e0);_0x8baadd(_0xe499e0);});});} \ No newline at end of file +var _0x56f3=['request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x50585d,_0x475bc4){var _0x253a0c=function(_0x2da7e8){while(--_0x2da7e8){_0x50585d['push'](_0x50585d['shift']());}};_0x253a0c(++_0x475bc4);}(_0x56f3,0x87));var _0x356f=function(_0x517265,_0x18158b){_0x517265=_0x517265-0x0;var _0x2b039e=_0x56f3[_0x517265];return _0x2b039e;};'use strict';var _=require('lodash');var util=require(_0x356f('0x0'));var moment=require(_0x356f('0x1'));var BPromise=require(_0x356f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x356f('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x356f('0x4'));var config=require(_0x356f('0x5'));var jayson=require(_0x356f('0x6'));var client=jayson[_0x356f('0x7')][_0x356f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x243462,_0x518be8,_0xbeafcd){return new BPromise(function(_0x127551,_0x211024){return client[_0x356f('0x9')](_0x243462,_0xbeafcd)['then'](function(_0x3638b1){logger[_0x356f('0xa')](_0x356f('0xb'),_0x518be8,_0x356f('0xc'));logger[_0x356f('0xd')](_0x356f('0xe'),_0x518be8,'request\x20sent',JSON[_0x356f('0xf')](_0x3638b1));if(_0x3638b1[_0x356f('0x10')]){if(_0x3638b1[_0x356f('0x10')][_0x356f('0x11')]===0x1f4){logger[_0x356f('0x10')](_0x356f('0xb'),_0x518be8,_0x3638b1['error'][_0x356f('0x12')]);return _0x211024(_0x3638b1[_0x356f('0x10')]['message']);}logger[_0x356f('0x10')](_0x356f('0xb'),_0x518be8,_0x3638b1[_0x356f('0x10')]['message']);return _0x127551(_0x3638b1[_0x356f('0x10')][_0x356f('0x12')]);}else{logger[_0x356f('0xa')](_0x356f('0xb'),_0x518be8,'request\x20sent');_0x127551(_0x3638b1[_0x356f('0x13')][_0x356f('0x12')]);}})[_0x356f('0x14')](function(_0x5d0f9e){logger[_0x356f('0x10')](_0x356f('0xb'),_0x518be8,_0x5d0f9e);_0x211024(_0x5d0f9e);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index c9b2fe2..06b605f 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 _0x323a=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0x323a,0x8b));var _0xa323=function(_0x42835a,_0x5259a7){_0x42835a=_0x42835a-0x0;var _0xa4f23b=_0x323a[_0x42835a];return _0xa4f23b;};'use strict';var multer=require(_0xa323('0x0'));var util=require(_0xa323('0x1'));var path=require(_0xa323('0x2'));var timeout=require(_0xa323('0x3'));var express=require(_0xa323('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa323('0x5'));var config=require(_0xa323('0x6'));var controller=require(_0xa323('0x7'));router['get']('/',auth[_0xa323('0x8')](),controller[_0xa323('0x9')]);router[_0xa323('0xa')](_0xa323('0xb'),auth[_0xa323('0x8')](),controller[_0xa323('0xc')]);router[_0xa323('0xd')]('/',auth[_0xa323('0x8')](),controller[_0xa323('0xe')]);router[_0xa323('0xf')](_0xa323('0xb'),auth['isAuthenticated'](),controller[_0xa323('0x10')]);router[_0xa323('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa323('0x12')]);module[_0xa323('0x13')]=router; \ No newline at end of file +var _0x5713=['../../config/environment','get','index','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x185656,_0x36b620){var _0x24a077=function(_0x270c03){while(--_0x270c03){_0x185656['push'](_0x185656['shift']());}};_0x24a077(++_0x36b620);}(_0x5713,0x116));var _0x3571=function(_0x1488ba,_0xfd38bd){_0x1488ba=_0x1488ba-0x0;var _0x5c2147=_0x5713[_0x1488ba];return _0x5c2147;};'use strict';var multer=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var path=require(_0x3571('0x2'));var timeout=require(_0x3571('0x3'));var express=require(_0x3571('0x4'));var router=express[_0x3571('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x3571('0x6'));var config=require(_0x3571('0x7'));var controller=require('./pause.controller');router[_0x3571('0x8')]('/',auth['isAuthenticated'](),controller[_0x3571('0x9')]);router[_0x3571('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3571('0xa')]('/',auth[_0x3571('0xb')](),controller[_0x3571('0xc')]);router[_0x3571('0xd')](_0x3571('0xe'),auth[_0x3571('0xb')](),controller[_0x3571('0xf')]);router[_0x3571('0x10')]('/:id',auth[_0x3571('0xb')](),controller[_0x3571('0x11')]);module[_0x3571('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 3462a0a..5d7e7bf 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 _0xd395=['sequelize','exports','STRING','name'];(function(_0x58384b,_0xc9dc35){var _0x4f039f=function(_0x413651){while(--_0x413651){_0x58384b['push'](_0x58384b['shift']());}};_0x4f039f(++_0xc9dc35);}(_0xd395,0x1bc));var _0x5d39=function(_0x499796,_0x3a11bc){_0x499796=_0x499796-0x0;var _0x1bb45c=_0xd395[_0x499796];return _0x1bb45c;};'use strict';var Sequelize=require(_0x5d39('0x0'));module[_0x5d39('0x1')]={'name':{'type':Sequelize[_0x5d39('0x2')],'unique':_0x5d39('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5d39('0x2')]}}; \ No newline at end of file +var _0xc06b=['sequelize','STRING'];(function(_0x3f477c,_0x52b7ff){var _0x4c36b3=function(_0x3b47bb){while(--_0x3b47bb){_0x3f477c['push'](_0x3f477c['shift']());}};_0x4c36b3(++_0x52b7ff);}(_0xc06b,0x1c8));var _0xbc06=function(_0x414658,_0x32591f){_0x414658=_0x414658-0x0;var _0x3f33b8=_0xc06b[_0x414658];return _0x3f33b8;};'use strict';var Sequelize=require(_0xbc06('0x0'));module['exports']={'name':{'type':Sequelize[_0xbc06('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xbc06('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 2d9579c..d321b84 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 _0x7536=['userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','map','Pause','fieldName','type','key','query','filters','intersection','model','fields','length','hasOwnProperty','sort','filter','where','VIRTUAL','merge','options','include','findAll','show','params','keys','rawAttributes','attributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x7536,0xf3));var _0x6753=function(_0x330d1f,_0x47c710){_0x330d1f=_0x330d1f-0x0;var _0x1df784=_0x7536[_0x330d1f];return _0x1df784;};'use strict';var pdf=require(_0x6753('0x0'));var emlformat=require(_0x6753('0x1'));var rimraf=require(_0x6753('0x2'));var zipdir=require(_0x6753('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6753('0x4'));var Mustache=require(_0x6753('0x5'));var util=require(_0x6753('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6753('0x7'));var ejs=require(_0x6753('0x8'));var fs=require('fs');var _=require(_0x6753('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6753('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6753('0x7'));var querystring=require(_0x6753('0xb'));var Papa=require('papaparse');var Redis=require(_0x6753('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6753('0xd'));var as=require(_0x6753('0xe'));var hardwareService=require(_0x6753('0xf'));var logger=require(_0x6753('0x10'))(_0x6753('0x11'));var utils=require(_0x6753('0x12'));var config=require(_0x6753('0x13'));var db=require(_0x6753('0x14'))['db'];function respondWithStatusCode(_0xcf97,_0x545dfa){_0x545dfa=_0x545dfa||0xcc;return function(_0x2c9e7d){if(_0x2c9e7d){return _0xcf97[_0x6753('0x15')](_0x545dfa);}return _0xcf97['status'](_0x545dfa)[_0x6753('0x16')]();};}function respondWithResult(_0x48810e,_0xd548d0){_0xd548d0=_0xd548d0||0xc8;return function(_0xf6f441){if(_0xf6f441){return _0x48810e['status'](_0xd548d0)[_0x6753('0x17')](_0xf6f441);}};}function respondWithFilteredResult(_0xb73c8,_0x1f7d2f){return function(_0x21955a){if(_0x21955a){var _0x6460e3=_0x21955a[_0x6753('0x18')],_0x58e193=_0x1f7d2f[_0x6753('0x19')],_0x4cd3c8=_0x1f7d2f[_0x6753('0x19')]+_0x1f7d2f[_0x6753('0x1a')],_0x484381;if(_0x4cd3c8>=_0x6460e3){_0x4cd3c8=_0x6460e3;_0x484381=0xc8;}else{_0x484381=0xce;}_0xb73c8[_0x6753('0x1b')](_0x484381);return _0xb73c8[_0x6753('0x1c')]('Content-Range',_0x58e193+'-'+_0x4cd3c8+'/'+_0x6460e3)[_0x6753('0x17')](_0x21955a);}return null;};}function patchUpdates(_0x5cd193){return function(_0x5695e6){try{jsonpatch[_0x6753('0x1d')](_0x5695e6,_0x5cd193,!![]);}catch(_0x45bd8c){return BPromise[_0x6753('0x1e')](_0x45bd8c);}return _0x5695e6[_0x6753('0x1f')]();};}function saveUpdates(_0x38946f,_0x2c401c){return function(_0x59b715){if(_0x59b715){return _0x59b715['update'](_0x38946f)[_0x6753('0x20')](function(_0x2c0903){return _0x2c0903;});}return null;};}function removeEntity(_0x10a108,_0xc3b8dd){return function(_0x1e9e0d){if(_0x1e9e0d){return _0x1e9e0d['destroy']()[_0x6753('0x20')](function(){var _0x47c3f1=_0x1e9e0d[_0x6753('0x21')]({'plain':!![]});var _0x2ad6e5=_0x6753('0x22');return db[_0x6753('0x23')][_0x6753('0x24')]({'where':{'type':_0x2ad6e5,'resourceId':_0x47c3f1['id']}})[_0x6753('0x20')](function(){return _0x1e9e0d;});})[_0x6753('0x20')](function(){_0x10a108[_0x6753('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x143b3e,_0x5e006d){return function(_0x1881c3){if(!_0x1881c3){_0x143b3e[_0x6753('0x15')](0x194);}return _0x1881c3;};}function handleError(_0x3cd555,_0x5df925){_0x5df925=_0x5df925||0x1f4;return function(_0x3262b1){logger[_0x6753('0x25')](_0x3262b1[_0x6753('0x26')]);if(_0x3262b1['name']){delete _0x3262b1[_0x6753('0x27')];}_0x3cd555[_0x6753('0x1b')](_0x5df925)[_0x6753('0x28')](_0x3262b1);};}exports[_0x6753('0x29')]=function(_0x166b66,_0x25e218){var _0x5ac5fe={},_0x2c890f={},_0x4a457e={'count':0x0,'rows':[]};var _0x4ed095=_[_0x6753('0x2a')](db[_0x6753('0x2b')]['rawAttributes'],function(_0x1a6710){return{'name':_0x1a6710[_0x6753('0x2c')],'type':_0x1a6710[_0x6753('0x2d')][_0x6753('0x2e')]};});_0x2c890f['model']=_[_0x6753('0x2a')](_0x4ed095,_0x6753('0x27'));_0x2c890f[_0x6753('0x2f')]=_['keys'](_0x166b66[_0x6753('0x2f')]);_0x2c890f[_0x6753('0x30')]=_[_0x6753('0x31')](_0x2c890f[_0x6753('0x32')],_0x2c890f[_0x6753('0x2f')]);_0x5ac5fe['attributes']=_[_0x6753('0x31')](_0x2c890f[_0x6753('0x32')],qs[_0x6753('0x33')](_0x166b66[_0x6753('0x2f')][_0x6753('0x33')]));_0x5ac5fe['attributes']=_0x5ac5fe['attributes'][_0x6753('0x34')]?_0x5ac5fe['attributes']:_0x2c890f[_0x6753('0x32')];if(!_0x166b66[_0x6753('0x2f')][_0x6753('0x35')]('nolimit')){_0x5ac5fe['limit']=qs['limit'](_0x166b66['query']['limit']);_0x5ac5fe[_0x6753('0x19')]=qs[_0x6753('0x19')](_0x166b66[_0x6753('0x2f')]['offset']);}_0x5ac5fe['order']=qs[_0x6753('0x36')](_0x166b66[_0x6753('0x2f')][_0x6753('0x36')]);_0x5ac5fe['where']=qs[_0x6753('0x30')](_['pick'](_0x166b66[_0x6753('0x2f')],_0x2c890f['filters']));if(_0x166b66[_0x6753('0x2f')][_0x6753('0x37')]){_0x5ac5fe[_0x6753('0x38')]=_['merge'](_0x5ac5fe[_0x6753('0x38')],{'$or':_[_0x6753('0x2a')](_0x4ed095,function(_0x29a631){if(_0x29a631[_0x6753('0x2d')]!==_0x6753('0x39')){var _0x328bf6={};_0x328bf6[_0x29a631[_0x6753('0x27')]]={'$like':'%'+_0x166b66[_0x6753('0x2f')][_0x6753('0x37')]+'%'};return _0x328bf6;}})});}_0x5ac5fe=_[_0x6753('0x3a')]({},_0x5ac5fe,_0x166b66[_0x6753('0x3b')]);var _0x717939={'where':_0x5ac5fe[_0x6753('0x38')]};return db[_0x6753('0x2b')][_0x6753('0x18')](_0x717939)[_0x6753('0x20')](function(_0x42525c){_0x4a457e[_0x6753('0x18')]=_0x42525c;if(_0x166b66['query']['includeAll']){_0x5ac5fe[_0x6753('0x3c')]=[{'all':!![]}];}return db[_0x6753('0x2b')][_0x6753('0x3d')](_0x5ac5fe);})[_0x6753('0x20')](function(_0x1688e5){_0x4a457e['rows']=_0x1688e5;return _0x4a457e;})[_0x6753('0x20')](respondWithFilteredResult(_0x25e218,_0x5ac5fe))['catch'](handleError(_0x25e218,null));};exports[_0x6753('0x3e')]=function(_0x18d2b9,_0x124a5f){var _0x119e9a={'raw':!![],'where':{'id':_0x18d2b9[_0x6753('0x3f')]['id']}},_0x4d5e1c={};_0x4d5e1c[_0x6753('0x32')]=_[_0x6753('0x40')](db[_0x6753('0x2b')][_0x6753('0x41')]);_0x4d5e1c[_0x6753('0x2f')]=_['keys'](_0x18d2b9['query']);_0x4d5e1c[_0x6753('0x30')]=_[_0x6753('0x31')](_0x4d5e1c[_0x6753('0x32')],_0x4d5e1c[_0x6753('0x2f')]);_0x119e9a['attributes']=_[_0x6753('0x31')](_0x4d5e1c[_0x6753('0x32')],qs['fields'](_0x18d2b9[_0x6753('0x2f')][_0x6753('0x33')]));_0x119e9a[_0x6753('0x42')]=_0x119e9a['attributes'][_0x6753('0x34')]?_0x119e9a['attributes']:_0x4d5e1c['model'];if(_0x18d2b9[_0x6753('0x2f')]['includeAll']){_0x119e9a[_0x6753('0x3c')]=[{'all':!![]}];}_0x119e9a=_[_0x6753('0x3a')]({},_0x119e9a,_0x18d2b9[_0x6753('0x3b')]);return db['Pause']['find'](_0x119e9a)[_0x6753('0x20')](handleEntityNotFound(_0x124a5f,null))[_0x6753('0x20')](respondWithResult(_0x124a5f,null))['catch'](handleError(_0x124a5f,null));};exports[_0x6753('0x43')]=function(_0x57db9d,_0x566be6){return db[_0x6753('0x2b')][_0x6753('0x43')](_0x57db9d[_0x6753('0x44')],{})[_0x6753('0x20')](function(_0x27e3f9){var _0xf7f4dc=_0x57db9d['user'][_0x6753('0x21')]({'plain':!![]});if(!_0xf7f4dc)throw new Error(_0x6753('0x45'));if(_0xf7f4dc[_0x6753('0x46')]===_0x6753('0x47')){var _0x4bee22=_0x27e3f9[_0x6753('0x21')]({'plain':!![]});var _0x598088='Pauses';return db[_0x6753('0x48')]['find']({'where':{'name':_0x598088,'userProfileId':_0xf7f4dc[_0x6753('0x49')]},'raw':!![]})[_0x6753('0x20')](function(_0x335d23){if(_0x335d23&&_0x335d23[_0x6753('0x4a')]===0x0){return db[_0x6753('0x23')][_0x6753('0x43')]({'name':_0x4bee22[_0x6753('0x27')],'resourceId':_0x4bee22['id'],'type':_0x335d23['name'],'sectionId':_0x335d23['id']},{})['then'](function(){return _0x27e3f9;});}else{return _0x27e3f9;}})[_0x6753('0x4b')](function(_0x16c2ff){logger[_0x6753('0x25')](_0x6753('0x4c'),_0x16c2ff);throw _0x16c2ff;});}return _0x27e3f9;})[_0x6753('0x20')](respondWithResult(_0x566be6,0xc9))[_0x6753('0x4b')](handleError(_0x566be6,null));};exports[_0x6753('0x4d')]=function(_0x1f5727,_0x3d61fe){if(_0x1f5727[_0x6753('0x44')]['id']){delete _0x1f5727[_0x6753('0x44')]['id'];}return db['Pause']['find']({'where':{'id':_0x1f5727['params']['id']}})['then'](handleEntityNotFound(_0x3d61fe,null))[_0x6753('0x20')](saveUpdates(_0x1f5727[_0x6753('0x44')],null))[_0x6753('0x20')](respondWithResult(_0x3d61fe,null))['catch'](handleError(_0x3d61fe,null));};exports[_0x6753('0x24')]=function(_0x430563,_0x18f192){return db['Pause'][_0x6753('0x4e')]({'where':{'id':_0x430563[_0x6753('0x3f')]['id']}})[_0x6753('0x20')](handleEntityNotFound(_0x18f192,null))[_0x6753('0x20')](removeEntity(_0x18f192,null))[_0x6753('0x4b')](handleError(_0x18f192,null));}; \ No newline at end of file +var _0x0093=['intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','options','Pause','includeAll','include','findAll','rows','show','keys','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','params','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','rawAttributes','type','key','map','query','filters'];(function(_0x4be8ba,_0x5d10ba){var _0x1af822=function(_0x40ed8a){while(--_0x40ed8a){_0x4be8ba['push'](_0x4be8ba['shift']());}};_0x1af822(++_0x5d10ba);}(_0x0093,0x160));var _0x3009=function(_0x3aecc7,_0x39dbcd){_0x3aecc7=_0x3aecc7-0x0;var _0x37f386=_0x0093[_0x3aecc7];return _0x37f386;};'use strict';var pdf=require(_0x3009('0x0'));var emlformat=require(_0x3009('0x1'));var rimraf=require(_0x3009('0x2'));var zipdir=require(_0x3009('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3009('0x4'));var BPromise=require(_0x3009('0x5'));var Mustache=require(_0x3009('0x6'));var util=require(_0x3009('0x7'));var path=require(_0x3009('0x8'));var sox=require('sox');var csv=require(_0x3009('0x9'));var ejs=require(_0x3009('0xa'));var fs=require('fs');var _=require(_0x3009('0xb'));var squel=require(_0x3009('0xc'));var crypto=require(_0x3009('0xd'));var jsforce=require(_0x3009('0xe'));var deskjs=require(_0x3009('0xf'));var toCsv=require(_0x3009('0x9'));var querystring=require(_0x3009('0x10'));var Papa=require(_0x3009('0x11'));var Redis=require('ioredis');var authService=require(_0x3009('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3009('0x13'));var hardwareService=require(_0x3009('0x14'));var logger=require(_0x3009('0x15'))(_0x3009('0x16'));var utils=require(_0x3009('0x17'));var config=require(_0x3009('0x18'));var db=require(_0x3009('0x19'))['db'];function respondWithStatusCode(_0x2304b9,_0x2848be){_0x2848be=_0x2848be||0xcc;return function(_0x2fdf89){if(_0x2fdf89){return _0x2304b9[_0x3009('0x1a')](_0x2848be);}return _0x2304b9[_0x3009('0x1b')](_0x2848be)[_0x3009('0x1c')]();};}function respondWithResult(_0x5cd659,_0x435931){_0x435931=_0x435931||0xc8;return function(_0x5f40d7){if(_0x5f40d7){return _0x5cd659['status'](_0x435931)[_0x3009('0x1d')](_0x5f40d7);}};}function respondWithFilteredResult(_0x8d7418,_0x374fef){return function(_0x5ef767){if(_0x5ef767){var _0x27af85=_0x5ef767[_0x3009('0x1e')],_0xde1430=_0x374fef[_0x3009('0x1f')],_0x22a694=_0x374fef[_0x3009('0x1f')]+_0x374fef[_0x3009('0x20')],_0x35b5d6;if(_0x22a694>=_0x27af85){_0x22a694=_0x27af85;_0x35b5d6=0xc8;}else{_0x35b5d6=0xce;}_0x8d7418[_0x3009('0x1b')](_0x35b5d6);return _0x8d7418['set'](_0x3009('0x21'),_0xde1430+'-'+_0x22a694+'/'+_0x27af85)[_0x3009('0x1d')](_0x5ef767);}return null;};}function patchUpdates(_0x34ca36){return function(_0x48337b){try{jsonpatch[_0x3009('0x22')](_0x48337b,_0x34ca36,!![]);}catch(_0x43532a){return BPromise['reject'](_0x43532a);}return _0x48337b[_0x3009('0x23')]();};}function saveUpdates(_0x5d565a,_0x291152){return function(_0x4d31de){if(_0x4d31de){return _0x4d31de[_0x3009('0x24')](_0x5d565a)[_0x3009('0x25')](function(_0x241703){return _0x241703;});}return null;};}function removeEntity(_0x5ecd27,_0x133a5c){return function(_0x37906e){if(_0x37906e){return _0x37906e[_0x3009('0x26')]()['then'](function(){var _0x358b13=_0x37906e[_0x3009('0x27')]({'plain':!![]});var _0x4afca9=_0x3009('0x28');return db[_0x3009('0x29')][_0x3009('0x26')]({'where':{'type':_0x4afca9,'resourceId':_0x358b13['id']}})[_0x3009('0x25')](function(){return _0x37906e;});})['then'](function(){_0x5ecd27[_0x3009('0x1b')](0xcc)[_0x3009('0x1c')]();});}};}function handleEntityNotFound(_0x45fae3,_0x4e2e87){return function(_0x20d993){if(!_0x20d993){_0x45fae3['sendStatus'](0x194);}return _0x20d993;};}function handleError(_0x21234b,_0x1b2f09){_0x1b2f09=_0x1b2f09||0x1f4;return function(_0x190fe2){logger[_0x3009('0x2a')](_0x190fe2[_0x3009('0x2b')]);if(_0x190fe2[_0x3009('0x2c')]){delete _0x190fe2[_0x3009('0x2c')];}_0x21234b[_0x3009('0x1b')](_0x1b2f09)[_0x3009('0x2d')](_0x190fe2);};}exports[_0x3009('0x2e')]=function(_0x5b2aad,_0x415dfd){var _0x2f5749={},_0x3a1521={},_0x4d822d={'count':0x0,'rows':[]};var _0x37cc69=_['map'](db['Pause'][_0x3009('0x2f')],function(_0x451109){return{'name':_0x451109['fieldName'],'type':_0x451109[_0x3009('0x30')][_0x3009('0x31')]};});_0x3a1521['model']=_[_0x3009('0x32')](_0x37cc69,_0x3009('0x2c'));_0x3a1521['query']=_['keys'](_0x5b2aad[_0x3009('0x33')]);_0x3a1521[_0x3009('0x34')]=_[_0x3009('0x35')](_0x3a1521[_0x3009('0x36')],_0x3a1521[_0x3009('0x33')]);_0x2f5749['attributes']=_['intersection'](_0x3a1521[_0x3009('0x36')],qs['fields'](_0x5b2aad['query'][_0x3009('0x37')]));_0x2f5749[_0x3009('0x38')]=_0x2f5749[_0x3009('0x38')][_0x3009('0x39')]?_0x2f5749['attributes']:_0x3a1521['model'];if(!_0x5b2aad[_0x3009('0x33')][_0x3009('0x3a')]('nolimit')){_0x2f5749['limit']=qs[_0x3009('0x20')](_0x5b2aad[_0x3009('0x33')]['limit']);_0x2f5749[_0x3009('0x1f')]=qs[_0x3009('0x1f')](_0x5b2aad['query'][_0x3009('0x1f')]);}_0x2f5749['order']=qs['sort'](_0x5b2aad['query'][_0x3009('0x3b')]);_0x2f5749[_0x3009('0x3c')]=qs[_0x3009('0x34')](_[_0x3009('0x3d')](_0x5b2aad['query'],_0x3a1521[_0x3009('0x34')]));if(_0x5b2aad['query']['filter']){_0x2f5749['where']=_['merge'](_0x2f5749['where'],{'$or':_[_0x3009('0x32')](_0x37cc69,function(_0x20fa5e){if(_0x20fa5e[_0x3009('0x30')]!=='VIRTUAL'){var _0x21cac2={};_0x21cac2[_0x20fa5e[_0x3009('0x2c')]]={'$like':'%'+_0x5b2aad['query']['filter']+'%'};return _0x21cac2;}})});}_0x2f5749=_['merge']({},_0x2f5749,_0x5b2aad[_0x3009('0x3e')]);var _0x3dffb9={'where':_0x2f5749['where']};return db[_0x3009('0x3f')][_0x3009('0x1e')](_0x3dffb9)[_0x3009('0x25')](function(_0x5044d8){_0x4d822d[_0x3009('0x1e')]=_0x5044d8;if(_0x5b2aad[_0x3009('0x33')][_0x3009('0x40')]){_0x2f5749[_0x3009('0x41')]=[{'all':!![]}];}return db['Pause'][_0x3009('0x42')](_0x2f5749);})[_0x3009('0x25')](function(_0x15fd7f){_0x4d822d[_0x3009('0x43')]=_0x15fd7f;return _0x4d822d;})[_0x3009('0x25')](respondWithFilteredResult(_0x415dfd,_0x2f5749))['catch'](handleError(_0x415dfd,null));};exports[_0x3009('0x44')]=function(_0x13fd1a,_0x3f9679){var _0x371a90={'raw':!![],'where':{'id':_0x13fd1a['params']['id']}},_0x3cda80={};_0x3cda80[_0x3009('0x36')]=_[_0x3009('0x45')](db[_0x3009('0x3f')][_0x3009('0x2f')]);_0x3cda80[_0x3009('0x33')]=_[_0x3009('0x45')](_0x13fd1a[_0x3009('0x33')]);_0x3cda80[_0x3009('0x34')]=_[_0x3009('0x35')](_0x3cda80[_0x3009('0x36')],_0x3cda80[_0x3009('0x33')]);_0x371a90['attributes']=_['intersection'](_0x3cda80['model'],qs[_0x3009('0x37')](_0x13fd1a[_0x3009('0x33')][_0x3009('0x37')]));_0x371a90['attributes']=_0x371a90[_0x3009('0x38')][_0x3009('0x39')]?_0x371a90[_0x3009('0x38')]:_0x3cda80['model'];if(_0x13fd1a['query'][_0x3009('0x40')]){_0x371a90[_0x3009('0x41')]=[{'all':!![]}];}_0x371a90=_['merge']({},_0x371a90,_0x13fd1a[_0x3009('0x3e')]);return db[_0x3009('0x3f')][_0x3009('0x46')](_0x371a90)[_0x3009('0x25')](handleEntityNotFound(_0x3f9679,null))['then'](respondWithResult(_0x3f9679,null))[_0x3009('0x47')](handleError(_0x3f9679,null));};exports[_0x3009('0x48')]=function(_0x10fc39,_0x46dcff){return db[_0x3009('0x3f')][_0x3009('0x48')](_0x10fc39[_0x3009('0x49')],{})[_0x3009('0x25')](function(_0x5215a4){var _0xcb9bae=_0x10fc39[_0x3009('0x4a')][_0x3009('0x27')]({'plain':!![]});if(!_0xcb9bae)throw new Error(_0x3009('0x4b'));if(_0xcb9bae[_0x3009('0x4c')]===_0x3009('0x4a')){var _0x3e4275=_0x5215a4['get']({'plain':!![]});var _0x3ec5be=_0x3009('0x28');return db[_0x3009('0x4d')]['find']({'where':{'name':_0x3ec5be,'userProfileId':_0xcb9bae[_0x3009('0x4e')]},'raw':!![]})[_0x3009('0x25')](function(_0x3d3b8c){if(_0x3d3b8c&&_0x3d3b8c[_0x3009('0x4f')]===0x0){return db[_0x3009('0x29')]['create']({'name':_0x3e4275[_0x3009('0x2c')],'resourceId':_0x3e4275['id'],'type':_0x3d3b8c[_0x3009('0x2c')],'sectionId':_0x3d3b8c['id']},{})[_0x3009('0x25')](function(){return _0x5215a4;});}else{return _0x5215a4;}})[_0x3009('0x47')](function(_0x45ff5a){logger[_0x3009('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45ff5a);throw _0x45ff5a;});}return _0x5215a4;})[_0x3009('0x25')](respondWithResult(_0x46dcff,0xc9))[_0x3009('0x47')](handleError(_0x46dcff,null));};exports['update']=function(_0x3a3991,_0x39db59){if(_0x3a3991[_0x3009('0x49')]['id']){delete _0x3a3991[_0x3009('0x49')]['id'];}return db[_0x3009('0x3f')][_0x3009('0x46')]({'where':{'id':_0x3a3991[_0x3009('0x50')]['id']}})['then'](handleEntityNotFound(_0x39db59,null))[_0x3009('0x25')](saveUpdates(_0x3a3991[_0x3009('0x49')],null))['then'](respondWithResult(_0x39db59,null))[_0x3009('0x47')](handleError(_0x39db59,null));};exports[_0x3009('0x26')]=function(_0x2ee9d1,_0x559e29){return db[_0x3009('0x3f')][_0x3009('0x46')]({'where':{'id':_0x2ee9d1[_0x3009('0x50')]['id']}})['then'](handleEntityNotFound(_0x559e29,null))[_0x3009('0x25')](removeEntity(_0x559e29,null))['catch'](handleError(_0x559e29,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 3acfac0..e5fd589 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 _0x8533=['tools_pauses','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x8533,0x141));var _0x3853=function(_0x17add1,_0x206a15){_0x17add1=_0x17add1-0x0;var _0x5cc49e=_0x8533[_0x17add1];return _0x5cc49e;};'use strict';var _=require(_0x3853('0x0'));var util=require(_0x3853('0x1'));var logger=require(_0x3853('0x2'))('api');var moment=require(_0x3853('0x3'));var BPromise=require(_0x3853('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3853('0x5'));var rimraf=require('rimraf');var config=require(_0x3853('0x6'));var attributes=require('./pause.attributes');module[_0x3853('0x7')]=function(_0x4644ba,_0x630746){return _0x4644ba[_0x3853('0x8')]('Pause',attributes,{'tableName':_0x3853('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x578c=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x578c,0x158));var _0xc578=function(_0x117dfa,_0x5cae6d){_0x117dfa=_0x117dfa-0x0;var _0x379320=_0x578c[_0x117dfa];return _0x379320;};'use strict';var _=require(_0xc578('0x0'));var util=require(_0xc578('0x1'));var logger=require(_0xc578('0x2'))('api');var moment=require(_0xc578('0x3'));var BPromise=require(_0xc578('0x4'));var rp=require(_0xc578('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc578('0x6'));var config=require(_0xc578('0x7'));var attributes=require(_0xc578('0x8'));module[_0xc578('0x9')]=function(_0x178786,_0x3305c9){return _0x178786[_0xc578('0xa')](_0xc578('0xb'),attributes,{'tableName':_0xc578('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index b390fe0..04900ce 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 _0x3140=['Pause','find','options','where','attributes','include','map','model','then','ShowPause','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','Pause,\x20%s,\x20%s','message','catch'];(function(_0x190517,_0x5e2937){var _0x28e76f=function(_0x3c8d4d){while(--_0x3c8d4d){_0x190517['push'](_0x190517['shift']());}};_0x28e76f(++_0x5e2937);}(_0x3140,0xaf));var _0x0314=function(_0x52b395,_0x1afa64){_0x52b395=_0x52b395-0x0;var _0x55d9d4=_0x3140[_0x52b395];return _0x55d9d4;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('Pause,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});}exports['ShowPause']=function(_0x575b68){var _0x39db0b=this;return new Promise(function(_0x329679,_0x583d39){return db[_0x0314('0x17')][_0x0314('0x18')]({'raw':_0x575b68['options']?_0x575b68[_0x0314('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1a')]||null:null,'attributes':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1b')]||null:null,'include':_0x575b68['options']?_0x575b68['options'][_0x0314('0x1c')]?_[_0x0314('0x1d')](_0x575b68[_0x0314('0x19')][_0x0314('0x1c')],function(_0x3ec03d){return{'model':db[_0x3ec03d[_0x0314('0x1e')]],'as':_0x3ec03d['as'],'attributes':_0x3ec03d['attributes'],'include':_0x3ec03d[_0x0314('0x1c')]?_[_0x0314('0x1d')](_0x3ec03d['include'],function(_0xe95292){return{'model':db[_0xe95292[_0x0314('0x1e')]],'as':_0xe95292['as'],'attributes':_0xe95292[_0x0314('0x1b')],'include':_0xe95292[_0x0314('0x1c')]?_[_0x0314('0x1d')](_0xe95292[_0x0314('0x1c')],function(_0x5d5b13){return{'model':db[_0x5d5b13[_0x0314('0x1e')]],'as':_0x5d5b13['as'],'attributes':_0x5d5b13[_0x0314('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0314('0x1f')](function(_0x47c2d1){logger[_0x0314('0xd')](_0x0314('0x20'),_0x575b68);logger['debug']('ShowPause',_0x575b68,JSON[_0x0314('0x11')](_0x47c2d1));_0x329679(_0x47c2d1);})[_0x0314('0x16')](function(_0x550dc4){logger[_0x0314('0x12')](_0x0314('0x20'),_0x550dc4['message'],_0x575b68);_0x583d39(_0x39db0b['error'](0x1f4,_0x550dc4[_0x0314('0x15')]));});});}; \ No newline at end of file +var _0x5b4a=['request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','error','code','message','ShowPause','Pause','options','raw','where','attributes','include','map','model','stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x5b4a,0x1d1));var _0xa5b4=function(_0x1d9685,_0x427472){_0x1d9685=_0x1d9685-0x0;var _0x49b5b2=_0x5b4a[_0x1d9685];return _0x49b5b2;};'use strict';var _=require(_0xa5b4('0x0'));var util=require(_0xa5b4('0x1'));var moment=require(_0xa5b4('0x2'));var BPromise=require(_0xa5b4('0x3'));var rs=require(_0xa5b4('0x4'));var fs=require('fs');var Redis=require(_0xa5b4('0x5'));var db=require(_0xa5b4('0x6'))['db'];var utils=require(_0xa5b4('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5b4('0x8'));var jayson=require(_0xa5b4('0x9'));var client=jayson['client'][_0xa5b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11c8c2,_0x18f6b6,_0x4b90b5){return new BPromise(function(_0x7ed620,_0x481d01){return client[_0xa5b4('0xb')](_0x11c8c2,_0x4b90b5)[_0xa5b4('0xc')](function(_0x2ac098){logger[_0xa5b4('0xd')](_0xa5b4('0xe'),_0x18f6b6,_0xa5b4('0xf'));logger[_0xa5b4('0x10')](_0xa5b4('0x11'),_0x18f6b6,_0xa5b4('0xf'),JSON['stringify'](_0x2ac098));if(_0x2ac098[_0xa5b4('0x12')]){if(_0x2ac098[_0xa5b4('0x12')][_0xa5b4('0x13')]===0x1f4){logger['error'](_0xa5b4('0xe'),_0x18f6b6,_0x2ac098[_0xa5b4('0x12')]['message']);return _0x481d01(_0x2ac098[_0xa5b4('0x12')][_0xa5b4('0x14')]);}logger[_0xa5b4('0x12')](_0xa5b4('0xe'),_0x18f6b6,_0x2ac098[_0xa5b4('0x12')][_0xa5b4('0x14')]);return _0x7ed620(_0x2ac098['error'][_0xa5b4('0x14')]);}else{logger[_0xa5b4('0xd')](_0xa5b4('0xe'),_0x18f6b6,_0xa5b4('0xf'));_0x7ed620(_0x2ac098['result'][_0xa5b4('0x14')]);}})['catch'](function(_0x5383c6){logger[_0xa5b4('0x12')](_0xa5b4('0xe'),_0x18f6b6,_0x5383c6);_0x481d01(_0x5383c6);});});}exports[_0xa5b4('0x15')]=function(_0x48e25c){var _0x227a8a=this;return new Promise(function(_0x3718d3,_0x2c2c2d){return db[_0xa5b4('0x16')]['find']({'raw':_0x48e25c[_0xa5b4('0x17')]?_0x48e25c[_0xa5b4('0x17')][_0xa5b4('0x18')]===undefined?!![]:![]:!![],'where':_0x48e25c[_0xa5b4('0x17')]?_0x48e25c[_0xa5b4('0x17')][_0xa5b4('0x19')]||null:null,'attributes':_0x48e25c[_0xa5b4('0x17')]?_0x48e25c['options'][_0xa5b4('0x1a')]||null:null,'include':_0x48e25c[_0xa5b4('0x17')]?_0x48e25c[_0xa5b4('0x17')][_0xa5b4('0x1b')]?_[_0xa5b4('0x1c')](_0x48e25c[_0xa5b4('0x17')][_0xa5b4('0x1b')],function(_0x289863){return{'model':db[_0x289863['model']],'as':_0x289863['as'],'attributes':_0x289863[_0xa5b4('0x1a')],'include':_0x289863['include']?_['map'](_0x289863[_0xa5b4('0x1b')],function(_0x4f7ad7){return{'model':db[_0x4f7ad7[_0xa5b4('0x1d')]],'as':_0x4f7ad7['as'],'attributes':_0x4f7ad7['attributes'],'include':_0x4f7ad7[_0xa5b4('0x1b')]?_[_0xa5b4('0x1c')](_0x4f7ad7['include'],function(_0x3200b4){return{'model':db[_0x3200b4[_0xa5b4('0x1d')]],'as':_0x3200b4['as'],'attributes':_0x3200b4[_0xa5b4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa5b4('0xc')](function(_0x433eb3){logger['info'](_0xa5b4('0x15'),_0x48e25c);logger[_0xa5b4('0x10')](_0xa5b4('0x15'),_0x48e25c,JSON[_0xa5b4('0x1e')](_0x433eb3));_0x3718d3(_0x433eb3);})[_0xa5b4('0x1f')](function(_0x263a58){logger[_0xa5b4('0x12')](_0xa5b4('0x15'),_0x263a58[_0xa5b4('0x14')],_0x48e25c);_0x2c2c2d(_0x227a8a[_0xa5b4('0x12')](0x1f4,_0x263a58[_0xa5b4('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 3b87542..1a945c4 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 _0xb924=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','join','root','originalname','format','%s-%s%s','basename','extname','post','single','webhookPost','/:id','update','delete','exports','multer'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0xb924,0x15b));var _0x4b92=function(_0x149cba,_0x4584eb){_0x149cba=_0x149cba-0x0;var _0x3af2b2=_0xb924[_0x149cba];return _0x3af2b2;};'use strict';var multer=require(_0x4b92('0x0'));var util=require(_0x4b92('0x1'));var path=require(_0x4b92('0x2'));var timeout=require(_0x4b92('0x3'));var express=require('express');var router=express[_0x4b92('0x4')]();var auth=require(_0x4b92('0x5'));var interaction=require(_0x4b92('0x6'));var config=require(_0x4b92('0x7'));var controller=require('./plugin.controller');router[_0x4b92('0x8')]('/',auth[_0x4b92('0x9')](),controller[_0x4b92('0xa')]);router[_0x4b92('0x8')](_0x4b92('0xb'),controller[_0x4b92('0xc')]);router[_0x4b92('0x8')]('/:id',auth[_0x4b92('0x9')](),controller[_0x4b92('0xd')]);router['get'](_0x4b92('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd4780c,_0x1b44c4,_0x1da650){_0x1da650(null,path[_0x4b92('0xf')](config[_0x4b92('0x10')],'server/files/plugins'));},'filename':function(_0x5cbd3b,_0x2bd8e7,_0x58df66){_0x2bd8e7[_0x4b92('0x11')]=_0x2bd8e7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x58df66(null,util[_0x4b92('0x12')](_0x4b92('0x13'),path[_0x4b92('0x14')](_0x2bd8e7[_0x4b92('0x11')],path[_0x4b92('0x15')](_0x2bd8e7[_0x4b92('0x11')])),Date['now'](),path[_0x4b92('0x15')](_0x2bd8e7['originalname'])));}})});router[_0x4b92('0x16')]('/',upload[_0x4b92('0x17')]('file'),controller['upload']);router[_0x4b92('0x16')](_0x4b92('0xb'),controller[_0x4b92('0x18')]);router['put'](_0x4b92('0x19'),auth[_0x4b92('0x9')](),controller[_0x4b92('0x1a')]);router[_0x4b92('0x1b')](_0x4b92('0x19'),auth[_0x4b92('0x9')](),controller['delete']);module[_0x4b92('0x1c')]=router; \ No newline at end of file +var _0x34a3=['../../components/interaction/service','../../config/environment','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','update','delete','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x487d9a,_0x18f3d4){var _0x3deda0=function(_0x50e77d){while(--_0x50e77d){_0x487d9a['push'](_0x487d9a['shift']());}};_0x3deda0(++_0x18f3d4);}(_0x34a3,0xb5));var _0x334a=function(_0x1cfe2e,_0x1ebbcd){_0x1cfe2e=_0x1cfe2e-0x0;var _0x39233f=_0x34a3[_0x1cfe2e];return _0x39233f;};'use strict';var multer=require(_0x334a('0x0'));var util=require(_0x334a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x334a('0x2'));var router=express[_0x334a('0x3')]();var auth=require(_0x334a('0x4'));var interaction=require(_0x334a('0x5'));var config=require(_0x334a('0x6'));var controller=require('./plugin.controller');router[_0x334a('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x334a('0x8'),controller[_0x334a('0x9')]);router[_0x334a('0x7')](_0x334a('0xa'),auth[_0x334a('0xb')](),controller[_0x334a('0xc')]);router[_0x334a('0x7')](_0x334a('0xd'),auth[_0x334a('0xb')](),controller[_0x334a('0xe')]);var upload=multer({'storage':multer[_0x334a('0xf')]({'destination':function(_0x12ec01,_0x345c18,_0x359ff6){_0x359ff6(null,path[_0x334a('0x10')](config['root'],_0x334a('0x11')));},'filename':function(_0x5c1130,_0x229b26,_0xc8f543){_0x229b26['originalname']=_0x229b26[_0x334a('0x12')][_0x334a('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xc8f543(null,util[_0x334a('0x14')](_0x334a('0x15'),path[_0x334a('0x16')](_0x229b26[_0x334a('0x12')],path[_0x334a('0x17')](_0x229b26[_0x334a('0x12')])),Date[_0x334a('0x18')](),path[_0x334a('0x17')](_0x229b26['originalname'])));}})});router[_0x334a('0x19')]('/',upload[_0x334a('0x1a')](_0x334a('0x1b')),controller['upload']);router[_0x334a('0x19')](_0x334a('0x8'),controller['webhookPost']);router['put'](_0x334a('0xa'),auth[_0x334a('0xb')](),controller[_0x334a('0x1c')]);router[_0x334a('0x1d')](_0x334a('0xa'),auth[_0x334a('0xb')](),controller[_0x334a('0x1d')]);module[_0x334a('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 567f3cb..cd56d31 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 _0x2b51=['STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports'];(function(_0x4b2f6d,_0x49f451){var _0xf73d2b=function(_0x559fa4){while(--_0x559fa4){_0x4b2f6d['push'](_0x4b2f6d['shift']());}};_0xf73d2b(++_0x49f451);}(_0x2b51,0x1c5));var _0x12b5=function(_0x24cf9b,_0x19a454){_0x24cf9b=_0x24cf9b-0x0;var _0x48735d=_0x2b51[_0x24cf9b];return _0x48735d;};'use strict';var Sequelize=require(_0x12b5('0x0'));module[_0x12b5('0x1')]={'name':{'type':Sequelize[_0x12b5('0x2')]},'type':{'type':Sequelize[_0x12b5('0x3')](_0x12b5('0x4'),_0x12b5('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x12b5('0x6')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x12b5('0x7')],'defaultValue':0x0,'comment':_0x12b5('0x8')},'sidebar':{'type':Sequelize[_0x12b5('0x3')](_0x12b5('0x9'),_0x12b5('0xa'),_0x12b5('0xb'),_0x12b5('0xc')),'defaultValue':_0x12b5('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x12b5('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x12b5('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2049=['STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','exports'];(function(_0x1194c4,_0x598963){var _0x32ea56=function(_0x35ce44){while(--_0x35ce44){_0x1194c4['push'](_0x1194c4['shift']());}};_0x32ea56(++_0x598963);}(_0x2049,0x15d));var _0x9204=function(_0x197b38,_0x394a4d){_0x197b38=_0x197b38-0x0;var _0x20a23a=_0x2049[_0x197b38];return _0x20a23a;};'use strict';var Sequelize=require('sequelize');module[_0x9204('0x0')]={'name':{'type':Sequelize[_0x9204('0x1')]},'type':{'type':Sequelize['ENUM'](_0x9204('0x2'),_0x9204('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9204('0x4')]},'path':{'type':Sequelize[_0x9204('0x1')],'comment':_0x9204('0x5')},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9204('0x6')},'sidebar':{'type':Sequelize['ENUM'](_0x9204('0x7'),'agentOnly',_0x9204('0x8'),_0x9204('0x9')),'defaultValue':_0x9204('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x9204('0x1')]},'adminUrl':{'type':Sequelize[_0x9204('0x1')]},'agentUrl':{'type':Sequelize[_0x9204('0x1')]},'scriptName':{'type':Sequelize[_0x9204('0x1')]},'scriptPath':{'type':Sequelize[_0x9204('0x1')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 5cd1f6f..f5213ea 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 _0x8df4=['**/*','join','finalize','existsSync','Plugin\x20not\x20found','Download\x20completed','info','upload','extname','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','version','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','Plugin','include','findAll','rows','params','rawAttributes','length','find','catch','download','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob'];(function(_0xa7d678,_0x3dfdff){var _0x5cc539=function(_0x4393d7){while(--_0x4393d7){_0xa7d678['push'](_0xa7d678['shift']());}};_0x5cc539(++_0x3dfdff);}(_0x8df4,0x1a9));var _0x48df=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x8df4[_0x31e5cb];return _0x4170df;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x48df('0x0'));var rimraf=require(_0x48df('0x1'));var zipdir=require(_0x48df('0x2'));var jsonpatch=require(_0x48df('0x3'));var rp=require(_0x48df('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x48df('0x5'));var util=require(_0x48df('0x6'));var path=require(_0x48df('0x7'));var sox=require(_0x48df('0x8'));var csv=require('to-csv');var ejs=require(_0x48df('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x48df('0xa'));var crypto=require('crypto');var jsforce=require(_0x48df('0xb'));var deskjs=require(_0x48df('0xc'));var toCsv=require(_0x48df('0xd'));var querystring=require('querystring');var Papa=require(_0x48df('0xe'));var extract=require(_0x48df('0xf'));var rimraf=require(_0x48df('0x1'));var archiver=require(_0x48df('0x10'));var Redis=require('ioredis');var authService=require(_0x48df('0x11'));var qs=require(_0x48df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48df('0x13'));var logger=require(_0x48df('0x14'))(_0x48df('0x15'));var utils=require(_0x48df('0x16'));var config=require(_0x48df('0x17'));var db=require(_0x48df('0x18'))['db'];config['redis']=_['defaults'](config[_0x48df('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x48df('0x1a'))(new Redis(config['redis']));require(_0x48df('0x1b'))[_0x48df('0x1c')](socket);function respondWithStatusCode(_0x247668,_0x12f7e5){_0x12f7e5=_0x12f7e5||0xcc;return function(_0x44ab39){if(_0x44ab39){return _0x247668[_0x48df('0x1d')](_0x12f7e5);}return _0x247668[_0x48df('0x1e')](_0x12f7e5)['end']();};}function respondWithResult(_0x1f83d8,_0x40d949){_0x40d949=_0x40d949||0xc8;return function(_0x1b1ef3){if(_0x1b1ef3){return _0x1f83d8['status'](_0x40d949)[_0x48df('0x1f')](_0x1b1ef3);}};}function respondWithFilteredResult(_0x413977,_0x40b315){return function(_0xcff49){if(_0xcff49){var _0x5ab39f=_0xcff49[_0x48df('0x20')],_0x472021=_0x40b315[_0x48df('0x21')],_0x5b0b5=_0x40b315[_0x48df('0x21')]+_0x40b315[_0x48df('0x22')],_0x4807fd;if(_0x5b0b5>=_0x5ab39f){_0x5b0b5=_0x5ab39f;_0x4807fd=0xc8;}else{_0x4807fd=0xce;}_0x413977[_0x48df('0x1e')](_0x4807fd);return _0x413977[_0x48df('0x23')](_0x48df('0x24'),_0x472021+'-'+_0x5b0b5+'/'+_0x5ab39f)['json'](_0xcff49);}return null;};}function patchUpdates(_0x9f428c){return function(_0x1ce5a9){try{jsonpatch[_0x48df('0x25')](_0x1ce5a9,_0x9f428c,!![]);}catch(_0x45b779){return BPromise[_0x48df('0x26')](_0x45b779);}return _0x1ce5a9[_0x48df('0x27')]();};}function saveUpdates(_0x2cedf4,_0x394f94){return function(_0xf4ebbc){if(_0xf4ebbc){return _0xf4ebbc[_0x48df('0x28')](_0x2cedf4)['then'](function(_0x197b00){return _0x197b00;});}return null;};}function removeEntity(_0x398c57,_0x4e01f9){return function(_0x2bc7f6){if(_0x2bc7f6){return _0x2bc7f6[_0x48df('0x29')]()[_0x48df('0x2a')](function(){var _0x1726c2=_0x2bc7f6[_0x48df('0x2b')]({'plain':!![]});var _0xcaf8a4='Plugins';return db[_0x48df('0x2c')]['destroy']({'where':{'type':_0xcaf8a4,'resourceId':_0x1726c2['id']}})[_0x48df('0x2a')](function(){return _0x2bc7f6;});})[_0x48df('0x2a')](function(){_0x398c57[_0x48df('0x1e')](0xcc)[_0x48df('0x2d')]();});}};}function handleEntityNotFound(_0x13af3d,_0x49b98a){return function(_0x83554e){if(!_0x83554e){_0x13af3d[_0x48df('0x1d')](0x194);}return _0x83554e;};}function handleError(_0x103738,_0x2ee379){_0x2ee379=_0x2ee379||0x1f4;return function(_0x22b1e4){logger[_0x48df('0x2e')](_0x22b1e4[_0x48df('0x2f')]);if(_0x22b1e4[_0x48df('0x30')]){delete _0x22b1e4[_0x48df('0x30')];}_0x103738[_0x48df('0x1e')](_0x2ee379)[_0x48df('0x31')](_0x22b1e4);};}exports[_0x48df('0x32')]=function(_0x209b36,_0x39e017){var _0x4c4993={},_0x547029={},_0xfe66e7={'count':0x0,'rows':[]};var _0x1561d9=_['map'](db['Plugin']['rawAttributes'],function(_0x3be0ac){return{'name':_0x3be0ac[_0x48df('0x33')],'type':_0x3be0ac[_0x48df('0x34')][_0x48df('0x35')]};});_0x547029['model']=_[_0x48df('0x36')](_0x1561d9,'name');_0x547029['query']=_[_0x48df('0x37')](_0x209b36[_0x48df('0x38')]);_0x547029[_0x48df('0x39')]=_[_0x48df('0x3a')](_0x547029[_0x48df('0x3b')],_0x547029['query']);_0x4c4993[_0x48df('0x3c')]=_[_0x48df('0x3a')](_0x547029[_0x48df('0x3b')],qs[_0x48df('0x3d')](_0x209b36[_0x48df('0x38')]['fields']));_0x4c4993[_0x48df('0x3c')]=_0x4c4993['attributes']['length']?_0x4c4993['attributes']:_0x547029[_0x48df('0x3b')];if(!_0x209b36[_0x48df('0x38')]['hasOwnProperty'](_0x48df('0x3e'))){_0x4c4993[_0x48df('0x22')]=qs[_0x48df('0x22')](_0x209b36['query'][_0x48df('0x22')]);_0x4c4993[_0x48df('0x21')]=qs['offset'](_0x209b36[_0x48df('0x38')][_0x48df('0x21')]);}_0x4c4993[_0x48df('0x3f')]=qs[_0x48df('0x40')](_0x209b36[_0x48df('0x38')]['sort']);_0x4c4993['where']=qs[_0x48df('0x39')](_[_0x48df('0x41')](_0x209b36[_0x48df('0x38')],_0x547029[_0x48df('0x39')]));if(_0x209b36[_0x48df('0x38')]['filter']){_0x4c4993[_0x48df('0x42')]=_[_0x48df('0x43')](_0x4c4993[_0x48df('0x42')],{'$or':_[_0x48df('0x36')](_0x1561d9,function(_0x433061){if(_0x433061[_0x48df('0x34')]!==_0x48df('0x44')){var _0x4dde01={};_0x4dde01[_0x433061['name']]={'$like':'%'+_0x209b36[_0x48df('0x38')]['filter']+'%'};return _0x4dde01;}})});}_0x4c4993=_['merge']({},_0x4c4993,_0x209b36[_0x48df('0x45')]);var _0x28d062={'where':_0x4c4993[_0x48df('0x42')]};return db[_0x48df('0x46')][_0x48df('0x20')](_0x28d062)[_0x48df('0x2a')](function(_0xe6cf9b){_0xfe66e7[_0x48df('0x20')]=_0xe6cf9b;if(_0x209b36[_0x48df('0x38')]['includeAll']){_0x4c4993[_0x48df('0x47')]=[{'all':!![]}];}return db[_0x48df('0x46')][_0x48df('0x48')](_0x4c4993);})['then'](function(_0x3dd292){_0xfe66e7[_0x48df('0x49')]=_0x3dd292;return _0xfe66e7;})['then'](respondWithFilteredResult(_0x39e017,_0x4c4993))['catch'](handleError(_0x39e017,null));};exports['show']=function(_0x2b89db,_0x4c21f7){var _0xd15fb5={'raw':!![],'where':{'id':_0x2b89db[_0x48df('0x4a')]['id']}},_0x5d92bd={};_0x5d92bd[_0x48df('0x3b')]=_[_0x48df('0x37')](db[_0x48df('0x46')][_0x48df('0x4b')]);_0x5d92bd[_0x48df('0x38')]=_[_0x48df('0x37')](_0x2b89db['query']);_0x5d92bd[_0x48df('0x39')]=_['intersection'](_0x5d92bd['model'],_0x5d92bd[_0x48df('0x38')]);_0xd15fb5[_0x48df('0x3c')]=_['intersection'](_0x5d92bd[_0x48df('0x3b')],qs[_0x48df('0x3d')](_0x2b89db[_0x48df('0x38')][_0x48df('0x3d')]));_0xd15fb5[_0x48df('0x3c')]=_0xd15fb5[_0x48df('0x3c')][_0x48df('0x4c')]?_0xd15fb5[_0x48df('0x3c')]:_0x5d92bd[_0x48df('0x3b')];if(_0x2b89db['query']['includeAll']){_0xd15fb5[_0x48df('0x47')]=[{'all':!![]}];}_0xd15fb5=_[_0x48df('0x43')]({},_0xd15fb5,_0x2b89db[_0x48df('0x45')]);return db['Plugin'][_0x48df('0x4d')](_0xd15fb5)[_0x48df('0x2a')](handleEntityNotFound(_0x4c21f7,null))[_0x48df('0x2a')](respondWithResult(_0x4c21f7,null))[_0x48df('0x4e')](handleError(_0x4c21f7,null));};exports[_0x48df('0x4f')]=function(_0x19c3c5,_0x5f5337,_0x2cd4a9){return db[_0x48df('0x46')][_0x48df('0x4d')]({'where':{'id':_0x19c3c5['params']['id']},'attributes':[_0x48df('0x30'),_0x48df('0x7')],'raw':!![]})[_0x48df('0x2a')](handleEntityNotFound(_0x5f5337,null))[_0x48df('0x2a')](function(_0x56a54d){if(_0x56a54d){var _0x8d1ce=path['join'](config[_0x48df('0x50')],_0x48df('0x51'),util[_0x48df('0x52')](_0x48df('0x53'),path[_0x48df('0x54')](_0x56a54d[_0x48df('0x7')])));var _0x4c7c30=fs[_0x48df('0x55')](_0x8d1ce);var _0x54fff7=archiver(_0x48df('0x56'),{'zlib':{'level':0x9}});_0x54fff7['on'](_0x48df('0x57'),function(_0x530c8a){if(_0x530c8a[_0x48df('0x58')]===_0x48df('0x59')){logger[_0x48df('0x2e')](_0x530c8a);}else{throw new db[(_0x48df('0x5a'))][(_0x48df('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x54fff7['on'](_0x48df('0x2e'),function(_0x8ced89){throw new db[(_0x48df('0x5a'))][(_0x48df('0x5b'))](_0x48df('0x5c'));});_0x54fff7['pipe'](_0x4c7c30);_0x54fff7[_0x48df('0x5d')](_0x48df('0x5e'),{'cwd':path[_0x48df('0x5f')](config[_0x48df('0x50')],_0x48df('0x51'),path['dirname'](_0x56a54d[_0x48df('0x7')])),'ignore':[path[_0x48df('0x5f')](path[_0x48df('0x54')](_0x56a54d[_0x48df('0x7')]),'node_modules/**/*'),path[_0x48df('0x5f')](path['basename'](_0x56a54d['path']),'attachments/**/*')],'nodir':!![]})[_0x48df('0x60')]();_0x4c7c30['on']('close',function(){if(!fs[_0x48df('0x61')](_0x8d1ce)){throw new db[(_0x48df('0x5a'))]['Error'](_0x48df('0x62'));}return _0x5f5337['download'](_0x8d1ce,util[_0x48df('0x52')](_0x48df('0x53'),path['basename'](_0x56a54d[_0x48df('0x7')])),function(_0x344df8){if(_0x344df8){throw new db[(_0x48df('0x5a'))][(_0x48df('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x8d1ce);logger['info'](_0x48df('0x63'));logger[_0x48df('0x64')]('Temporary\x20file\x20removed');});});}return null;})[_0x48df('0x4e')](handleError(_0x5f5337,null));};exports[_0x48df('0x65')]=function(_0x2b9d2c,_0x2d0179,_0x5a0d46){var _0x20db97=path[_0x48df('0x54')](_0x2b9d2c['file']['filename'],path[_0x48df('0x66')](_0x2b9d2c[_0x48df('0x67')]['filename']));var _0x4374cf=path[_0x48df('0x5f')](config[_0x48df('0x50')],'server/files/plugins',_0x2b9d2c['file'][_0x48df('0x68')]);var _0x4b025c=path[_0x48df('0x5f')](config[_0x48df('0x50')],'server/files/plugins',_0x20db97);logger['info'](_0x48df('0x69'),_0x4374cf);logger['info'](_0x48df('0x6a'),_0x4b025c);try{fs[_0x48df('0x6b')](_0x4374cf,parseInt(_0x48df('0x6c'),0x8));extract(_0x4374cf,{'dir':_0x4b025c},function(_0xbbc736){if(_0xbbc736){logger[_0x48df('0x2e')](_0xbbc736);handleError(_0xbbc736,!![]);};var _0x370c8d=fs[_0x48df('0x6d')](_0x4b025c);if(_0x370c8d[_0x48df('0x4c')]>0x1){removeReferences(_0x4374cf,_0x4b025c);logger[_0x48df('0x2e')](_0x48df('0x6e'));return _0x5a0d46(new Error(_0x48df('0x6e')));}var _0x44b7e9=fs[_0x48df('0x6f')](path[_0x48df('0x5f')](_0x4b025c,_0x370c8d[0x0]));if(_0x44b7e9['isFile']()){removeReferences(_0x4374cf,_0x4b025c);logger[_0x48df('0x2e')]('Invalid\x20plugin\x20structure');return _0x5a0d46(new Error('Invalid\x20plugin\x20structure'));}if(_0x44b7e9[_0x48df('0x70')]()){var _0x44e986=fs[_0x48df('0x6d')](path[_0x48df('0x5f')](_0x4b025c,_0x370c8d[0x0]));if(_0x44e986[_0x48df('0x4c')]===0x0){removeReferences(_0x4374cf,_0x4b025c);logger[_0x48df('0x2e')](_0x48df('0x6e'));return _0x5a0d46(new Error(_0x48df('0x6e')));}var _0x22aff4=_0x44e986[_0x48df('0x71')](function(_0x2701be){return _0x2701be==='manifest.json';});if(!_0x22aff4){return _0x5a0d46(new Error('Plugin\x20manifest\x20missing'));}var _0x55761f=fs[_0x48df('0x72')](path['join'](_0x4b025c,_0x370c8d[0x0],_0x48df('0x73')));var _0x1c52b0=JSON[_0x48df('0x74')](_0x55761f);if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x30')]){return _0x5a0d46(new Error(_0x48df('0x76')));}if('undefined'==typeof _0x1c52b0[_0x48df('0x34')]){return _0x5a0d46(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x1c52b0['version']){return _0x5a0d46(new Error(_0x48df('0x77')));}if('undefined'==typeof _0x1c52b0[_0x48df('0x78')]){return _0x5a0d46(new Error(_0x48df('0x79')));}if(_0x1c52b0[_0x48df('0x34')]===_0x48df('0x7a')){if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')]){return _0x5a0d46(new Error(_0x48df('0x7c')));}if(_0x48df('0x75')==typeof _0x1c52b0['parameters'][_0x48df('0x7b')]['admin']&&'undefined'==typeof _0x1c52b0['parameters'][_0x48df('0x7b')][_0x48df('0x7d')]){return _0x5a0d46(new Error(_0x48df('0x7e')));}}else if(_0x1c52b0['type']===_0x48df('0x7f')){if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x80')]){return _0x5a0d46(new Error(_0x48df('0x81')));}if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x82')]){return _0x5a0d46(new Error(_0x48df('0x83')));}}else{return _0x5a0d46(new Error(_0x48df('0x84')));}var _0x151655=_0x1c52b0[_0x48df('0x30')];var _0x48c503=_0x1c52b0[_0x48df('0x85')];var _0x2e84f1=_0x1c52b0[_0x48df('0x34')];var _0x48fa9c=_0x1c52b0[_0x48df('0x86')]?_0x1c52b0[_0x48df('0x86')]:'always';var _0x37a2d2=_0x1c52b0[_0x48df('0x87')]?_0x1c52b0[_0x48df('0x87')]:'icon-apps';var _0x3ba62d='';var _0x353de7='';var _0x1c0750='';var _0xc893e5='';var _0x101328=_0x1c52b0[_0x48df('0x88')];if(_0x2e84f1===_0x48df('0x7a')){if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')]['views'][_0x48df('0x89')]){var _0x4e41c2=_0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')][_0x48df('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x4e41c2)){_0x3ba62d=path[_0x48df('0x5f')](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x4e41c2);}else{_0x3ba62d=_0x4e41c2;}}else{logger[_0x48df('0x64')](_0x48df('0x8c'));}if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')][_0x48df('0x7d')]){var _0x41fa4e=_0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')][_0x48df('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x41fa4e)){_0x353de7=path['join'](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x41fa4e);}else{_0x353de7=_0x41fa4e;}}else{logger[_0x48df('0x64')](_0x48df('0x8d'));}}else if(_0x2e84f1===_0x48df('0x7f')){_0x1c0750=_0x1c52b0[_0x48df('0x78')][_0x48df('0x80')];_0xc893e5=_0x1c52b0[_0x48df('0x78')][_0x48df('0x82')];if('undefined'!=typeof _0x1c52b0[_0x48df('0x78')]['views']){if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')]['admin']){var _0x4e41c2=_0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x4e41c2)){_0x3ba62d=path[_0x48df('0x5f')](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x4e41c2);}else{_0x3ba62d=_0x4e41c2;}}if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')]['views'][_0x48df('0x7d')]){var _0x41fa4e=_0x1c52b0['parameters'][_0x48df('0x7b')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x41fa4e)){_0x353de7=path[_0x48df('0x5f')](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x41fa4e);}else{_0x353de7=_0x41fa4e;}}}}var _0x4a31e3={'name':_0x151655,'description':_0x48c503,'path':path[_0x48df('0x5f')](_0x20db97,_0x370c8d[0x0]),'type':_0x2e84f1,'sidebar':_0x48fa9c,'icon':_0x37a2d2,'adminUrl':_0x3ba62d,'agentUrl':_0x353de7,'scriptName':_0x1c0750,'scriptPath':_0xc893e5,'version':_0x101328};removeReferences(_0x4374cf,null);return db[_0x48df('0x46')]['create'](_0x4a31e3)[_0x48df('0x2a')](function(_0x506707){var _0x5af0fc={'role':_0x2b9d2c[_0x48df('0x8e')][_0x48df('0x8f')],'userProfileId':_0x2b9d2c[_0x48df('0x8e')][_0x48df('0x90')]};if(!_0x5af0fc)throw new Error(_0x48df('0x91'));if(_0x5af0fc[_0x48df('0x8f')]===_0x48df('0x92')){var _0x243551=_0x506707[_0x48df('0x2b')]({'plain':!![]});return db[_0x48df('0x93')][_0x48df('0x4d')]({'where':{'name':_0x48df('0x94'),'userProfileId':_0x5af0fc[_0x48df('0x90')]},'raw':!![]})[_0x48df('0x2a')](function(_0x147d41){if(_0x147d41&&_0x147d41[_0x48df('0x95')]===0x0){return db[_0x48df('0x2c')][_0x48df('0x96')]({'name':_0x243551['name'],'resourceId':_0x243551['id'],'type':_0x147d41[_0x48df('0x30')],'sectionId':_0x147d41['id']},{})[_0x48df('0x2a')](function(){return _0x506707;});}else{return _0x506707;}})[_0x48df('0x4e')](function(_0x27fe3c){logger['error'](_0x48df('0x97'),_0x27fe3c);throw _0x27fe3c;});}return _0x506707;})[_0x48df('0x2a')](respondWithResult(_0x2d0179,null))[_0x48df('0x4e')](handleError(_0x2d0179,null));}});}catch(_0xbdd885){_0x2d0179[_0x48df('0x1e')](0x1f4)['send'](_0xbdd885);}};function removeReferences(_0x20961a,_0x444684){try{if(_0x20961a){fs[_0x48df('0x98')](_0x20961a);logger['info'](_0x48df('0x99'));}if(_0x444684){rimraf(_0x444684,function(){});logger[_0x48df('0x64')](_0x48df('0x9a'));}}catch(_0x461005){logger[_0x48df('0x2e')](_0x461005);}}exports[_0x48df('0x28')]=function(_0x161ba7,_0x3c3485,_0x562a63){return db[_0x48df('0x46')][_0x48df('0x4d')]({'where':{'id':_0x161ba7['params']['id']}})[_0x48df('0x2a')](handleEntityNotFound(_0x3c3485,null))[_0x48df('0x2a')](saveUpdates(_0x161ba7[_0x48df('0x8e')],null))[_0x48df('0x2a')](respondWithResult(_0x3c3485,null))[_0x48df('0x4e')](handleError(_0x3c3485,null));};exports[_0x48df('0x9b')]=function(_0x14ffdd,_0x3620bd,_0x3a9f90){return db[_0x48df('0x46')][_0x48df('0x4d')]({'where':{'id':_0x14ffdd[_0x48df('0x4a')]['id']}})[_0x48df('0x2a')](function(_0x2d50da){if(_0x2d50da){return _0x2d50da[_0x48df('0x29')]();}})['then'](function(_0x4a7afe){rimraf(path['join'](config[_0x48df('0x50')],_0x48df('0x51'),path[_0x48df('0x9c')](_0x4a7afe['path'])),function(){});return _0x4a7afe;})['then'](handleEntityNotFound(_0x3620bd,null))[_0x48df('0x2a')](respondWithStatusCode(_0x3620bd,null))[_0x48df('0x4e')](handleError(_0x3620bd,null));};exports[_0x48df('0x9d')]=function(_0x26907f,_0x283df1,_0x359de8){return BPromise[_0x48df('0x9e')]()[_0x48df('0x2a')](function(){if(!_0x26907f[_0x48df('0x38')][_0x48df('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x26907f['query'][_0x48df('0x9f')]){throw new Error(_0x48df('0xa0'));}var _0x34a4f8=_0x26907f[_0x48df('0x38')][_0x48df('0xa1')]?_0x26907f[_0x48df('0x38')][_0x48df('0xa1')]+':'+_0x26907f[_0x48df('0x38')][_0x48df('0x9f')]:_0x48df('0xa2')+_0x26907f[_0x48df('0x38')]['port'];var _0x519cad=_0x26907f[_0x48df('0x38')][_0x48df('0x1f')]?_0x26907f[_0x48df('0x38')][_0x48df('0x1f')]:!![];var _0xd3761d=_0x26907f[_0x48df('0x38')][_0x48df('0xa3')]?_0x26907f[_0x48df('0x38')][_0x48df('0xa3')]:null;var _0x499a87={'method':_0x26907f[_0x48df('0xa4')],'uri':util['format'](_0x48df('0xa5'),_0x34a4f8,_0x26907f[_0x48df('0x38')][_0x48df('0x7')]),'json':_0x519cad,'resolveWithFullResponse':!![],'encoding':_0xd3761d,'qs':_0x26907f[_0x48df('0x38')]};if(_0x26907f[_0x48df('0xa6')]){_0x499a87[_0x48df('0xa6')]=_0x26907f[_0x48df('0xa6')];if(_0x499a87[_0x48df('0xa6')][_0x48df('0xa7')]){delete _0x499a87[_0x48df('0xa6')][_0x48df('0xa7')];}}if(_0x499a87[_0x48df('0xa6')][_0x48df('0xa8')]){delete _0x499a87[_0x48df('0xa6')][_0x48df('0xa8')];}return rp(_0x499a87);})[_0x48df('0x2a')](function(_0x445137){if(_0x445137){_0x283df1[_0x48df('0x23')](_0x445137[_0x48df('0xa6')]);logger['info'](_0x445137[_0x48df('0x8e')]);if(_[_0x48df('0xa9')](_0x26907f[_0x48df('0x38')]['path'],_0x48df('0x4f'))&&_0x445137[_0x48df('0xaa')]==0x1f4){return _0x283df1['sendStatus'](_0x445137[_0x48df('0xaa')]);}else{return _0x283df1[_0x48df('0x1e')](_0x445137[_0x48df('0xaa')])[_0x48df('0x31')](_0x445137[_0x48df('0x8e')]);}}else{return _0x283df1[_0x48df('0x1d')](0xc8);}})[_0x48df('0x4e')](handleError(_0x283df1,null));};exports[_0x48df('0xab')]=function(_0x47bb6a,_0x2d2ddc,_0x3de76a){return BPromise[_0x48df('0x9e')]()[_0x48df('0x2a')](function(){if(!_0x47bb6a[_0x48df('0x38')][_0x48df('0x7')]){throw new Error(_0x48df('0xac'));}if(!_0x47bb6a[_0x48df('0x38')][_0x48df('0x9f')]){throw new Error(_0x48df('0xa0'));}var _0x2dc8f9=_0x47bb6a[_0x48df('0x38')]['hostname']?_0x47bb6a[_0x48df('0x38')]['hostname']+':'+_0x47bb6a[_0x48df('0x38')][_0x48df('0x9f')]:'http://localhost:'+_0x47bb6a[_0x48df('0x38')][_0x48df('0x9f')];var _0x5ebdb3=_0x47bb6a[_0x48df('0x38')]['json']?_0x47bb6a[_0x48df('0x38')][_0x48df('0x1f')]:!![];var _0x3c4089=_0x47bb6a['query'][_0x48df('0xa3')]?_0x47bb6a[_0x48df('0x38')][_0x48df('0xa3')]:null;var _0x15ece4={'method':_0x47bb6a[_0x48df('0xa4')],'uri':util['format'](_0x48df('0xa5'),_0x2dc8f9,_0x47bb6a[_0x48df('0x38')][_0x48df('0x7')]),'json':_0x5ebdb3,'resolveWithFullResponse':!![],'encoding':_0x3c4089,'body':_0x47bb6a[_0x48df('0x8e')]};if(_0x47bb6a[_0x48df('0xa6')]){_0x15ece4[_0x48df('0xa6')]=_0x47bb6a['headers'];if(_0x15ece4['headers'][_0x48df('0xa7')]){delete _0x15ece4['headers'][_0x48df('0xa7')];}}if(_0x15ece4['headers'][_0x48df('0xa8')]){delete _0x15ece4[_0x48df('0xa6')][_0x48df('0xa8')];}return rp(_0x15ece4);})[_0x48df('0x2a')](function(_0x3f0789){if(_0x3f0789){_0x2d2ddc[_0x48df('0x23')](_0x3f0789[_0x48df('0xa6')]);logger[_0x48df('0x64')](_0x3f0789[_0x48df('0x8e')]);return _0x2d2ddc[_0x48df('0x1e')](_0x3f0789[_0x48df('0xaa')])[_0x48df('0x31')](_0x3f0789['body']);}else{return _0x2d2ddc['sendStatus'](0xc8);}})[_0x48df('0x4e')](handleError(_0x2d2ddc,null));}; \ No newline at end of file +var _0x8c0e=['code','Error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','attachments/**/*','finalize','close','Error\x20while\x20downloading\x20the\x20plugin','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','info','Plugin\x20upload\x20destination:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','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','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','test','plugins','agent','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','jsforce','querystring','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./plugin.socket','register','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','include','findAll','rows','catch','show','keys','fields','length','includeAll','options','find','download','params','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','warning'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x8c0e,0x197));var _0xe8c0=function(_0x25bc11,_0x393bbc){_0x25bc11=_0x25bc11-0x0;var _0x42dadc=_0x8c0e[_0x25bc11];return _0x42dadc;};'use strict';var pdf=require(_0xe8c0('0x0'));var emlformat=require(_0xe8c0('0x1'));var rimraf=require(_0xe8c0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe8c0('0x3'));var moment=require(_0xe8c0('0x4'));var BPromise=require(_0xe8c0('0x5'));var Mustache=require(_0xe8c0('0x6'));var util=require(_0xe8c0('0x7'));var path=require(_0xe8c0('0x8'));var sox=require('sox');var csv=require(_0xe8c0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe8c0('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe8c0('0x9'));var querystring=require(_0xe8c0('0xb'));var Papa=require('papaparse');var extract=require(_0xe8c0('0xc'));var rimraf=require(_0xe8c0('0x2'));var archiver=require(_0xe8c0('0xd'));var Redis=require('ioredis');var authService=require(_0xe8c0('0xe'));var qs=require(_0xe8c0('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe8c0('0x10'));var utils=require(_0xe8c0('0x11'));var config=require(_0xe8c0('0x12'));var db=require(_0xe8c0('0x13'))['db'];config['redis']=_[_0xe8c0('0x14')](config[_0xe8c0('0x15')],{'host':_0xe8c0('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe8c0('0x15')]));require(_0xe8c0('0x17'))[_0xe8c0('0x18')](socket);function respondWithStatusCode(_0x133fe1,_0x499124){_0x499124=_0x499124||0xcc;return function(_0x1fad22){if(_0x1fad22){return _0x133fe1[_0xe8c0('0x19')](_0x499124);}return _0x133fe1[_0xe8c0('0x1a')](_0x499124)[_0xe8c0('0x1b')]();};}function respondWithResult(_0x5bc7fc,_0x59d547){_0x59d547=_0x59d547||0xc8;return function(_0x138cb3){if(_0x138cb3){return _0x5bc7fc[_0xe8c0('0x1a')](_0x59d547)['json'](_0x138cb3);}};}function respondWithFilteredResult(_0x28ea95,_0xd7f5b7){return function(_0x1ea578){if(_0x1ea578){var _0x4731e1=_0x1ea578[_0xe8c0('0x1c')],_0x33e4a7=_0xd7f5b7[_0xe8c0('0x1d')],_0x1b505a=_0xd7f5b7['offset']+_0xd7f5b7['limit'],_0x188e56;if(_0x1b505a>=_0x4731e1){_0x1b505a=_0x4731e1;_0x188e56=0xc8;}else{_0x188e56=0xce;}_0x28ea95[_0xe8c0('0x1a')](_0x188e56);return _0x28ea95[_0xe8c0('0x1e')](_0xe8c0('0x1f'),_0x33e4a7+'-'+_0x1b505a+'/'+_0x4731e1)[_0xe8c0('0x20')](_0x1ea578);}return null;};}function patchUpdates(_0x3fa943){return function(_0x56bc6b){try{jsonpatch['apply'](_0x56bc6b,_0x3fa943,!![]);}catch(_0x1b3af5){return BPromise[_0xe8c0('0x21')](_0x1b3af5);}return _0x56bc6b[_0xe8c0('0x22')]();};}function saveUpdates(_0xc61ec7,_0xde2e55){return function(_0x79824c){if(_0x79824c){return _0x79824c[_0xe8c0('0x23')](_0xc61ec7)[_0xe8c0('0x24')](function(_0x4c94bd){return _0x4c94bd;});}return null;};}function removeEntity(_0x5d56f2,_0x11984e){return function(_0x572559){if(_0x572559){return _0x572559[_0xe8c0('0x25')]()[_0xe8c0('0x24')](function(){var _0x2f4527=_0x572559[_0xe8c0('0x26')]({'plain':!![]});var _0x277e88=_0xe8c0('0x27');return db[_0xe8c0('0x28')][_0xe8c0('0x25')]({'where':{'type':_0x277e88,'resourceId':_0x2f4527['id']}})['then'](function(){return _0x572559;});})[_0xe8c0('0x24')](function(){_0x5d56f2[_0xe8c0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fc32d,_0x4db592){return function(_0x362ef4){if(!_0x362ef4){_0x1fc32d[_0xe8c0('0x19')](0x194);}return _0x362ef4;};}function handleError(_0x3368f0,_0x91fce6){_0x91fce6=_0x91fce6||0x1f4;return function(_0x5eac35){logger[_0xe8c0('0x29')](_0x5eac35[_0xe8c0('0x2a')]);if(_0x5eac35[_0xe8c0('0x2b')]){delete _0x5eac35[_0xe8c0('0x2b')];}_0x3368f0[_0xe8c0('0x1a')](_0x91fce6)[_0xe8c0('0x2c')](_0x5eac35);};}exports[_0xe8c0('0x2d')]=function(_0x5b2401,_0x1b26d9){var _0x2287c4={},_0x294330={},_0x1485e3={'count':0x0,'rows':[]};var _0x5287fe=_[_0xe8c0('0x2e')](db[_0xe8c0('0x2f')][_0xe8c0('0x30')],function(_0x45ad15){return{'name':_0x45ad15[_0xe8c0('0x31')],'type':_0x45ad15[_0xe8c0('0x32')][_0xe8c0('0x33')]};});_0x294330[_0xe8c0('0x34')]=_[_0xe8c0('0x2e')](_0x5287fe,_0xe8c0('0x2b'));_0x294330[_0xe8c0('0x35')]=_['keys'](_0x5b2401[_0xe8c0('0x35')]);_0x294330[_0xe8c0('0x36')]=_['intersection'](_0x294330[_0xe8c0('0x34')],_0x294330[_0xe8c0('0x35')]);_0x2287c4[_0xe8c0('0x37')]=_[_0xe8c0('0x38')](_0x294330[_0xe8c0('0x34')],qs['fields'](_0x5b2401['query']['fields']));_0x2287c4[_0xe8c0('0x37')]=_0x2287c4[_0xe8c0('0x37')]['length']?_0x2287c4['attributes']:_0x294330[_0xe8c0('0x34')];if(!_0x5b2401['query'][_0xe8c0('0x39')](_0xe8c0('0x3a'))){_0x2287c4['limit']=qs[_0xe8c0('0x3b')](_0x5b2401['query']['limit']);_0x2287c4[_0xe8c0('0x1d')]=qs['offset'](_0x5b2401[_0xe8c0('0x35')][_0xe8c0('0x1d')]);}_0x2287c4[_0xe8c0('0x3c')]=qs[_0xe8c0('0x3d')](_0x5b2401[_0xe8c0('0x35')]['sort']);_0x2287c4['where']=qs[_0xe8c0('0x36')](_[_0xe8c0('0x3e')](_0x5b2401[_0xe8c0('0x35')],_0x294330[_0xe8c0('0x36')]));if(_0x5b2401['query'][_0xe8c0('0x3f')]){_0x2287c4[_0xe8c0('0x40')]=_['merge'](_0x2287c4['where'],{'$or':_[_0xe8c0('0x2e')](_0x5287fe,function(_0x51d5a1){if(_0x51d5a1[_0xe8c0('0x32')]!==_0xe8c0('0x41')){var _0x5c2eb9={};_0x5c2eb9[_0x51d5a1[_0xe8c0('0x2b')]]={'$like':'%'+_0x5b2401[_0xe8c0('0x35')][_0xe8c0('0x3f')]+'%'};return _0x5c2eb9;}})});}_0x2287c4=_[_0xe8c0('0x42')]({},_0x2287c4,_0x5b2401['options']);var _0x51909a={'where':_0x2287c4[_0xe8c0('0x40')]};return db['Plugin'][_0xe8c0('0x1c')](_0x51909a)[_0xe8c0('0x24')](function(_0x44f980){_0x1485e3[_0xe8c0('0x1c')]=_0x44f980;if(_0x5b2401['query']['includeAll']){_0x2287c4[_0xe8c0('0x43')]=[{'all':!![]}];}return db[_0xe8c0('0x2f')][_0xe8c0('0x44')](_0x2287c4);})[_0xe8c0('0x24')](function(_0x3d419b){_0x1485e3[_0xe8c0('0x45')]=_0x3d419b;return _0x1485e3;})[_0xe8c0('0x24')](respondWithFilteredResult(_0x1b26d9,_0x2287c4))[_0xe8c0('0x46')](handleError(_0x1b26d9,null));};exports[_0xe8c0('0x47')]=function(_0x18588c,_0x71677a){var _0x5ec0b3={'raw':!![],'where':{'id':_0x18588c['params']['id']}},_0xd72008={};_0xd72008[_0xe8c0('0x34')]=_[_0xe8c0('0x48')](db[_0xe8c0('0x2f')][_0xe8c0('0x30')]);_0xd72008['query']=_[_0xe8c0('0x48')](_0x18588c['query']);_0xd72008['filters']=_[_0xe8c0('0x38')](_0xd72008['model'],_0xd72008['query']);_0x5ec0b3[_0xe8c0('0x37')]=_['intersection'](_0xd72008[_0xe8c0('0x34')],qs['fields'](_0x18588c[_0xe8c0('0x35')][_0xe8c0('0x49')]));_0x5ec0b3[_0xe8c0('0x37')]=_0x5ec0b3[_0xe8c0('0x37')][_0xe8c0('0x4a')]?_0x5ec0b3[_0xe8c0('0x37')]:_0xd72008[_0xe8c0('0x34')];if(_0x18588c[_0xe8c0('0x35')][_0xe8c0('0x4b')]){_0x5ec0b3[_0xe8c0('0x43')]=[{'all':!![]}];}_0x5ec0b3=_[_0xe8c0('0x42')]({},_0x5ec0b3,_0x18588c[_0xe8c0('0x4c')]);return db[_0xe8c0('0x2f')][_0xe8c0('0x4d')](_0x5ec0b3)[_0xe8c0('0x24')](handleEntityNotFound(_0x71677a,null))[_0xe8c0('0x24')](respondWithResult(_0x71677a,null))[_0xe8c0('0x46')](handleError(_0x71677a,null));};exports[_0xe8c0('0x4e')]=function(_0xac6c,_0x32ccc6,_0x4b016a){return db[_0xe8c0('0x2f')][_0xe8c0('0x4d')]({'where':{'id':_0xac6c[_0xe8c0('0x4f')]['id']},'attributes':[_0xe8c0('0x2b'),_0xe8c0('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x32ccc6,null))[_0xe8c0('0x24')](function(_0x21c97c){if(_0x21c97c){var _0x31a5cc=path[_0xe8c0('0x50')](config[_0xe8c0('0x51')],_0xe8c0('0x52'),util[_0xe8c0('0x53')](_0xe8c0('0x54'),path[_0xe8c0('0x55')](_0x21c97c[_0xe8c0('0x8')])));var _0x5aff79=fs[_0xe8c0('0x56')](_0x31a5cc);var _0x58928f=archiver('zip',{'zlib':{'level':0x9}});_0x58928f['on'](_0xe8c0('0x57'),function(_0x388e98){if(_0x388e98[_0xe8c0('0x58')]==='ENOENT'){logger[_0xe8c0('0x29')](_0x388e98);}else{throw new db['Sequelize'][(_0xe8c0('0x59'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x58928f['on'](_0xe8c0('0x29'),function(_0x48e328){throw new db[(_0xe8c0('0x5a'))][(_0xe8c0('0x59'))](_0xe8c0('0x5b'));});_0x58928f['pipe'](_0x5aff79);_0x58928f[_0xe8c0('0x5c')](_0xe8c0('0x5d'),{'cwd':path[_0xe8c0('0x50')](config[_0xe8c0('0x51')],_0xe8c0('0x52'),path[_0xe8c0('0x5e')](_0x21c97c[_0xe8c0('0x8')])),'ignore':[path[_0xe8c0('0x50')](path[_0xe8c0('0x55')](_0x21c97c[_0xe8c0('0x8')]),'node_modules/**/*'),path[_0xe8c0('0x50')](path[_0xe8c0('0x55')](_0x21c97c['path']),_0xe8c0('0x5f'))],'nodir':!![]})[_0xe8c0('0x60')]();_0x5aff79['on'](_0xe8c0('0x61'),function(){if(!fs['existsSync'](_0x31a5cc)){throw new db[(_0xe8c0('0x5a'))][(_0xe8c0('0x59'))]('Plugin\x20not\x20found');}return _0x32ccc6[_0xe8c0('0x4e')](_0x31a5cc,util[_0xe8c0('0x53')]('%s.zip',path[_0xe8c0('0x55')](_0x21c97c[_0xe8c0('0x8')])),function(_0x15131c){if(_0x15131c){throw new db['Sequelize'][(_0xe8c0('0x59'))](_0xe8c0('0x62'));}fs['unlinkSync'](_0x31a5cc);logger['info'](_0xe8c0('0x63'));logger['info'](_0xe8c0('0x64'));});});}return null;})[_0xe8c0('0x46')](handleError(_0x32ccc6,null));};exports['upload']=function(_0x237301,_0x27ee15,_0x5a4be7){var _0x51636b=path[_0xe8c0('0x55')](_0x237301[_0xe8c0('0x65')][_0xe8c0('0x66')],path[_0xe8c0('0x67')](_0x237301[_0xe8c0('0x65')][_0xe8c0('0x66')]));var _0x17b2b6=path[_0xe8c0('0x50')](config[_0xe8c0('0x51')],_0xe8c0('0x52'),_0x237301[_0xe8c0('0x65')][_0xe8c0('0x66')]);var _0x23076f=path['join'](config[_0xe8c0('0x51')],'server/files/plugins',_0x51636b);logger['info'](_0xe8c0('0x68'),_0x17b2b6);logger[_0xe8c0('0x69')](_0xe8c0('0x6a'),_0x23076f);try{fs['chmodSync'](_0x17b2b6,parseInt(_0xe8c0('0x6b'),0x8));extract(_0x17b2b6,{'dir':_0x23076f},function(_0x1aff41){if(_0x1aff41){logger[_0xe8c0('0x29')](_0x1aff41);handleError(_0x1aff41,!![]);};var _0x578e3d=fs['readdirSync'](_0x23076f);if(_0x578e3d[_0xe8c0('0x4a')]>0x1){removeReferences(_0x17b2b6,_0x23076f);logger['error'](_0xe8c0('0x6c'));return _0x5a4be7(new Error(_0xe8c0('0x6c')));}var _0x57537a=fs[_0xe8c0('0x6d')](path[_0xe8c0('0x50')](_0x23076f,_0x578e3d[0x0]));if(_0x57537a['isFile']()){removeReferences(_0x17b2b6,_0x23076f);logger[_0xe8c0('0x29')](_0xe8c0('0x6c'));return _0x5a4be7(new Error(_0xe8c0('0x6c')));}if(_0x57537a['isDirectory']()){var _0xc01fd9=fs[_0xe8c0('0x6e')](path['join'](_0x23076f,_0x578e3d[0x0]));if(_0xc01fd9[_0xe8c0('0x4a')]===0x0){removeReferences(_0x17b2b6,_0x23076f);logger['error'](_0xe8c0('0x6c'));return _0x5a4be7(new Error(_0xe8c0('0x6c')));}var _0x34b68f=_0xc01fd9[_0xe8c0('0x6f')](function(_0x4b245e){return _0x4b245e===_0xe8c0('0x70');});if(!_0x34b68f){return _0x5a4be7(new Error(_0xe8c0('0x71')));}var _0x36cb2b=fs['readFileSync'](path[_0xe8c0('0x50')](_0x23076f,_0x578e3d[0x0],'manifest.json'));var _0x1de079=JSON[_0xe8c0('0x72')](_0x36cb2b);if(_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x2b')]){return _0x5a4be7(new Error(_0xe8c0('0x74')));}if(_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x32')]){return _0x5a4be7(new Error(_0xe8c0('0x75')));}if(_0xe8c0('0x73')==typeof _0x1de079['version']){return _0x5a4be7(new Error(_0xe8c0('0x76')));}if(_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x77')]){return _0x5a4be7(new Error(_0xe8c0('0x78')));}if(_0x1de079['type']===_0xe8c0('0x79')){if(_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')]){return _0x5a4be7(new Error(_0xe8c0('0x7b')));}if(_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')][_0xe8c0('0x7c')]&&_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x77')]['views']['agent']){return _0x5a4be7(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x1de079[_0xe8c0('0x32')]===_0xe8c0('0x7d')){if(_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7e')]){return _0x5a4be7(new Error(_0xe8c0('0x7f')));}if(_0xe8c0('0x73')==typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x80')]){return _0x5a4be7(new Error(_0xe8c0('0x81')));}}else{return _0x5a4be7(new Error(_0xe8c0('0x82')));}var _0x3e0a03=_0x1de079[_0xe8c0('0x2b')];var _0x5173ed=_0x1de079[_0xe8c0('0x83')];var _0x6e634f=_0x1de079[_0xe8c0('0x32')];var _0x423325=_0x1de079[_0xe8c0('0x84')]?_0x1de079[_0xe8c0('0x84')]:_0xe8c0('0x85');var _0x40c8dc=_0x1de079[_0xe8c0('0x86')]?_0x1de079[_0xe8c0('0x86')]:_0xe8c0('0x87');var _0x5806b5='';var _0x3f69f9='';var _0x83c57c='';var _0x2223fb='';var _0x3482a8=_0x1de079[_0xe8c0('0x88')];if(_0x6e634f===_0xe8c0('0x79')){if(_0xe8c0('0x73')!=typeof _0x1de079['parameters'][_0xe8c0('0x7a')][_0xe8c0('0x7c')]){var _0x2e5f46=_0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')][_0xe8c0('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xe8c0('0x89')](_0x2e5f46)){_0x5806b5=path[_0xe8c0('0x50')](_0xe8c0('0x8a'),_0x51636b,_0x578e3d[0x0],_0x2e5f46);}else{_0x5806b5=_0x2e5f46;}}else{logger[_0xe8c0('0x69')]('Warning:\x20admin\x20view\x20not\x20specified');}if('undefined'!=typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')][_0xe8c0('0x8b')]){var _0x3b7a6a=_0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xe8c0('0x89')](_0x3b7a6a)){_0x3f69f9=path[_0xe8c0('0x50')]('plugins',_0x51636b,_0x578e3d[0x0],_0x3b7a6a);}else{_0x3f69f9=_0x3b7a6a;}}else{logger['info'](_0xe8c0('0x8c'));}}else if(_0x6e634f===_0xe8c0('0x7d')){_0x83c57c=_0x1de079[_0xe8c0('0x77')]['scriptName'];_0x2223fb=_0x1de079[_0xe8c0('0x77')]['scriptPath'];if(_0xe8c0('0x73')!=typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')]){if(_0xe8c0('0x73')!=typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')][_0xe8c0('0x7c')]){var _0x2e5f46=_0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')][_0xe8c0('0x7c')];if(!/^(f|ht)tps?:\/\//i[_0xe8c0('0x89')](_0x2e5f46)){_0x5806b5=path[_0xe8c0('0x50')](_0xe8c0('0x8a'),_0x51636b,_0x578e3d[0x0],_0x2e5f46);}else{_0x5806b5=_0x2e5f46;}}if(_0xe8c0('0x73')!=typeof _0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')][_0xe8c0('0x8b')]){var _0x3b7a6a=_0x1de079[_0xe8c0('0x77')][_0xe8c0('0x7a')][_0xe8c0('0x8b')];if(!/^(f|ht)tps?:\/\//i[_0xe8c0('0x89')](_0x3b7a6a)){_0x3f69f9=path[_0xe8c0('0x50')](_0xe8c0('0x8a'),_0x51636b,_0x578e3d[0x0],_0x3b7a6a);}else{_0x3f69f9=_0x3b7a6a;}}}}var _0x151b75={'name':_0x3e0a03,'description':_0x5173ed,'path':path['join'](_0x51636b,_0x578e3d[0x0]),'type':_0x6e634f,'sidebar':_0x423325,'icon':_0x40c8dc,'adminUrl':_0x5806b5,'agentUrl':_0x3f69f9,'scriptName':_0x83c57c,'scriptPath':_0x2223fb,'version':_0x3482a8};removeReferences(_0x17b2b6,null);return db['Plugin'][_0xe8c0('0x8d')](_0x151b75)[_0xe8c0('0x24')](function(_0x59950b){var _0xed6540={'role':_0x237301[_0xe8c0('0x8e')][_0xe8c0('0x8f')],'userProfileId':_0x237301[_0xe8c0('0x8e')][_0xe8c0('0x90')]};if(!_0xed6540)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xed6540[_0xe8c0('0x8f')]===_0xe8c0('0x91')){var _0x2a0f4a=_0x59950b[_0xe8c0('0x26')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe8c0('0x27'),'userProfileId':_0xed6540[_0xe8c0('0x90')]},'raw':!![]})[_0xe8c0('0x24')](function(_0x18f82c){if(_0x18f82c&&_0x18f82c['autoAssociation']===0x0){return db[_0xe8c0('0x28')][_0xe8c0('0x8d')]({'name':_0x2a0f4a[_0xe8c0('0x2b')],'resourceId':_0x2a0f4a['id'],'type':_0x18f82c[_0xe8c0('0x2b')],'sectionId':_0x18f82c['id']},{})['then'](function(){return _0x59950b;});}else{return _0x59950b;}})[_0xe8c0('0x46')](function(_0x12017f){logger[_0xe8c0('0x29')](_0xe8c0('0x92'),_0x12017f);throw _0x12017f;});}return _0x59950b;})[_0xe8c0('0x24')](respondWithResult(_0x27ee15,null))[_0xe8c0('0x46')](handleError(_0x27ee15,null));}});}catch(_0x108b4b){_0x27ee15[_0xe8c0('0x1a')](0x1f4)['send'](_0x108b4b);}};function removeReferences(_0x387484,_0x8833fa){try{if(_0x387484){fs[_0xe8c0('0x93')](_0x387484);logger['info'](_0xe8c0('0x94'));}if(_0x8833fa){rimraf(_0x8833fa,function(){});logger[_0xe8c0('0x69')](_0xe8c0('0x95'));}}catch(_0x5774ad){logger[_0xe8c0('0x29')](_0x5774ad);}}exports['update']=function(_0x5368d9,_0x27b45b,_0x2d76c5){return db[_0xe8c0('0x2f')][_0xe8c0('0x4d')]({'where':{'id':_0x5368d9[_0xe8c0('0x4f')]['id']}})[_0xe8c0('0x24')](handleEntityNotFound(_0x27b45b,null))[_0xe8c0('0x24')](saveUpdates(_0x5368d9[_0xe8c0('0x8e')],null))['then'](respondWithResult(_0x27b45b,null))['catch'](handleError(_0x27b45b,null));};exports[_0xe8c0('0x96')]=function(_0x9616ee,_0xb9b930,_0x1d2c04){return db[_0xe8c0('0x2f')][_0xe8c0('0x4d')]({'where':{'id':_0x9616ee['params']['id']}})['then'](function(_0x59a113){if(_0x59a113){return _0x59a113['destroy']();}})[_0xe8c0('0x24')](function(_0x23aa45){rimraf(path[_0xe8c0('0x50')](config[_0xe8c0('0x51')],'server/files/plugins',path[_0xe8c0('0x5e')](_0x23aa45[_0xe8c0('0x8')])),function(){});return _0x23aa45;})[_0xe8c0('0x24')](handleEntityNotFound(_0xb9b930,null))[_0xe8c0('0x24')](respondWithStatusCode(_0xb9b930,null))[_0xe8c0('0x46')](handleError(_0xb9b930,null));};exports[_0xe8c0('0x97')]=function(_0x2bb4b4,_0x3a2367,_0x166e1c){return BPromise[_0xe8c0('0x98')]()[_0xe8c0('0x24')](function(){if(!_0x2bb4b4['query'][_0xe8c0('0x8')]){throw new Error(_0xe8c0('0x99'));}if(!_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x1653d9=_0x2bb4b4[_0xe8c0('0x35')]['hostname']?_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x9b')]+':'+_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x9a')]:_0xe8c0('0x9c')+_0x2bb4b4[_0xe8c0('0x35')]['port'];var _0x51ac8f=_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x20')]?_0x2bb4b4['query'][_0xe8c0('0x20')]:!![];var _0x2bc79b=_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x9d')]?_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x9d')]:null;var _0x2bc50a={'method':_0x2bb4b4['method'],'uri':util[_0xe8c0('0x53')](_0xe8c0('0x9e'),_0x1653d9,_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x8')]),'json':_0x51ac8f,'resolveWithFullResponse':!![],'encoding':_0x2bc79b,'qs':_0x2bb4b4[_0xe8c0('0x35')]};if(_0x2bb4b4[_0xe8c0('0x9f')]){_0x2bc50a['headers']=_0x2bb4b4[_0xe8c0('0x9f')];if(_0x2bc50a[_0xe8c0('0x9f')][_0xe8c0('0xa0')]){delete _0x2bc50a[_0xe8c0('0x9f')][_0xe8c0('0xa0')];}}if(_0x2bc50a['headers']['content-type']){delete _0x2bc50a[_0xe8c0('0x9f')][_0xe8c0('0xa1')];}return rp(_0x2bc50a);})[_0xe8c0('0x24')](function(_0x5f42c9){if(_0x5f42c9){_0x3a2367['set'](_0x5f42c9['headers']);logger[_0xe8c0('0x69')](_0x5f42c9[_0xe8c0('0x8e')]);if(_[_0xe8c0('0xa2')](_0x2bb4b4[_0xe8c0('0x35')][_0xe8c0('0x8')],_0xe8c0('0x4e'))&&_0x5f42c9['statusCode']==0x1f4){return _0x3a2367[_0xe8c0('0x19')](_0x5f42c9[_0xe8c0('0xa3')]);}else{return _0x3a2367[_0xe8c0('0x1a')](_0x5f42c9[_0xe8c0('0xa3')])[_0xe8c0('0x2c')](_0x5f42c9[_0xe8c0('0x8e')]);}}else{return _0x3a2367[_0xe8c0('0x19')](0xc8);}})['catch'](handleError(_0x3a2367,null));};exports[_0xe8c0('0xa4')]=function(_0x10262d,_0x4ae912,_0x21638f){return BPromise[_0xe8c0('0x98')]()[_0xe8c0('0x24')](function(){if(!_0x10262d[_0xe8c0('0x35')][_0xe8c0('0x8')]){throw new Error(_0xe8c0('0x99'));}if(!_0x10262d[_0xe8c0('0x35')][_0xe8c0('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4a839d=_0x10262d['query'][_0xe8c0('0x9b')]?_0x10262d[_0xe8c0('0x35')][_0xe8c0('0x9b')]+':'+_0x10262d[_0xe8c0('0x35')][_0xe8c0('0x9a')]:_0xe8c0('0x9c')+_0x10262d[_0xe8c0('0x35')][_0xe8c0('0x9a')];var _0x51d3ec=_0x10262d['query'][_0xe8c0('0x20')]?_0x10262d[_0xe8c0('0x35')][_0xe8c0('0x20')]:!![];var _0x3266b0=_0x10262d[_0xe8c0('0x35')][_0xe8c0('0x9d')]?_0x10262d[_0xe8c0('0x35')]['encoding']:null;var _0x3e9687={'method':_0x10262d['method'],'uri':util[_0xe8c0('0x53')](_0xe8c0('0x9e'),_0x4a839d,_0x10262d['query'][_0xe8c0('0x8')]),'json':_0x51d3ec,'resolveWithFullResponse':!![],'encoding':_0x3266b0,'body':_0x10262d[_0xe8c0('0x8e')]};if(_0x10262d[_0xe8c0('0x9f')]){_0x3e9687[_0xe8c0('0x9f')]=_0x10262d[_0xe8c0('0x9f')];if(_0x3e9687[_0xe8c0('0x9f')]['content-length']){delete _0x3e9687[_0xe8c0('0x9f')][_0xe8c0('0xa0')];}}if(_0x3e9687[_0xe8c0('0x9f')][_0xe8c0('0xa1')]){delete _0x3e9687[_0xe8c0('0x9f')][_0xe8c0('0xa1')];}return rp(_0x3e9687);})[_0xe8c0('0x24')](function(_0x54f3a2){if(_0x54f3a2){_0x4ae912[_0xe8c0('0x1e')](_0x54f3a2['headers']);logger['info'](_0x54f3a2[_0xe8c0('0x8e')]);return _0x4ae912[_0xe8c0('0x1a')](_0x54f3a2[_0xe8c0('0xa3')])['send'](_0x54f3a2['body']);}else{return _0x4ae912[_0xe8c0('0x19')](0xc8);}})[_0xe8c0('0x46')](handleError(_0x4ae912,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index b6c5d48..f9fe824 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 _0x3d04=['Plugin','setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x43d0('0x0'));var Plugin=require(_0x43d0('0x1'))['db'][_0x43d0('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x43d0('0x3')](0x0);var events={'afterCreate':_0x43d0('0x4'),'afterUpdate':_0x43d0('0x5'),'afterDestroy':_0x43d0('0x6')};function emitEvent(_0x1f80fd){return function(_0x5a9e1d,_0x2a4d4c,_0x1a75d4){PluginEvents[_0x43d0('0x7')](_0x1f80fd+':'+_0x5a9e1d['id'],_0x5a9e1d);PluginEvents[_0x43d0('0x7')](_0x1f80fd,_0x5a9e1d);_0x1a75d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x32f4=['update','remove','emit','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x40ec7a,_0x2bc7d8){var _0x300870=function(_0x41296c){while(--_0x41296c){_0x40ec7a['push'](_0x40ec7a['shift']());}};_0x300870(++_0x2bc7d8);}(_0x32f4,0x154));var _0x432f=function(_0x3e0d81,_0x569911){_0x3e0d81=_0x3e0d81-0x0;var _0x6cb16=_0x32f4[_0x3e0d81];return _0x6cb16;};'use strict';var EventEmitter=require(_0x432f('0x0'));var Plugin=require(_0x432f('0x1'))['db'][_0x432f('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x432f('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x432f('0x4'),'afterDestroy':_0x432f('0x5')};function emitEvent(_0x51a71a){return function(_0x354293,_0x1eabac,_0x344a29){PluginEvents[_0x432f('0x6')](_0x51a71a+':'+_0x354293['id'],_0x354293);PluginEvents[_0x432f('0x6')](_0x51a71a,_0x354293);_0x344a29(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x432f('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index b36171a..3c1d59a 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 _0xe14b=['bluebird','path','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','moment'];(function(_0x214bc8,_0x2ef807){var _0x540a91=function(_0x375743){while(--_0x375743){_0x214bc8['push'](_0x214bc8['shift']());}};_0x540a91(++_0x2ef807);}(_0xe14b,0x93));var _0xbe14=function(_0x88554e,_0x57fbc3){_0x88554e=_0x88554e-0x0;var _0x3af07f=_0xe14b[_0x88554e];return _0x3af07f;};'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 _0xf2ca=['define','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x28d83e,_0x47f6b3){var _0x5e9f91=function(_0x7ca824){while(--_0x7ca824){_0x28d83e['push'](_0x28d83e['shift']());}};_0x5e9f91(++_0x47f6b3);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0xf2ca[_0x3b3750];return _0x1b9e8b;};'use strict';var _=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('api');var moment=require(_0xaf2c('0x3'));var BPromise=require(_0xaf2c('0x4'));var rp=require(_0xaf2c('0x5'));var fs=require('fs');var path=require(_0xaf2c('0x6'));var rimraf=require(_0xaf2c('0x7'));var config=require(_0xaf2c('0x8'));var attributes=require('./plugin.attributes');module[_0xaf2c('0x9')]=function(_0x100d17,_0x297740){return _0x100d17[_0xaf2c('0xa')]('Plugin',attributes,{'tableName':_0xaf2c('0xb'),'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 1f82dbd..09490c0 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 _0x0015=['jayson/promise','redis','defaults','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x52e266,_0x586656){var _0x335947=function(_0x22892c){while(--_0x22892c){_0x52e266['push'](_0x52e266['shift']());}};_0x335947(++_0x586656);}(_0x0015,0x1ba));var _0x5001=function(_0x4f5f88,_0x2ad2d4){_0x4f5f88=_0x4f5f88-0x0;var _0x3fe1dc=_0x0015[_0x4f5f88];return _0x3fe1dc;};'use strict';var _=require('lodash');var util=require(_0x5001('0x0'));var moment=require('moment');var BPromise=require(_0x5001('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5001('0x2'));var db=require(_0x5001('0x3'))['db'];var utils=require(_0x5001('0x4'));var logger=require(_0x5001('0x5'))(_0x5001('0x6'));var config=require(_0x5001('0x7'));var jayson=require(_0x5001('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5001('0x9')]=_[_0x5001('0xa')](config[_0x5001('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5001('0xb'))(new Redis(config[_0x5001('0x9')]));require('./plugin.socket')[_0x5001('0xc')](socket);function respondWithRpcPromise(_0x3f483f,_0x38665d,_0x3a6eb4){return new BPromise(function(_0x69a40c,_0x3eb80b){return client['request'](_0x3f483f,_0x3a6eb4)[_0x5001('0xd')](function(_0x34ceac){logger[_0x5001('0xe')](_0x5001('0xf'),_0x38665d,'request\x20sent');logger[_0x5001('0x10')](_0x5001('0x11'),_0x38665d,_0x5001('0x12'),JSON[_0x5001('0x13')](_0x34ceac));if(_0x34ceac[_0x5001('0x14')]){if(_0x34ceac[_0x5001('0x14')]['code']===0x1f4){logger[_0x5001('0x14')](_0x5001('0xf'),_0x38665d,_0x34ceac['error'][_0x5001('0x15')]);return _0x3eb80b(_0x34ceac[_0x5001('0x14')][_0x5001('0x15')]);}logger[_0x5001('0x14')](_0x5001('0xf'),_0x38665d,_0x34ceac[_0x5001('0x14')][_0x5001('0x15')]);return _0x69a40c(_0x34ceac[_0x5001('0x14')]['message']);}else{logger['info'](_0x5001('0xf'),_0x38665d,_0x5001('0x12'));_0x69a40c(_0x34ceac[_0x5001('0x16')][_0x5001('0x15')]);}})[_0x5001('0x17')](function(_0x1c2187){logger[_0x5001('0x14')](_0x5001('0xf'),_0x38665d,_0x1c2187);_0x3eb80b(_0x1c2187);});});}exports[_0x5001('0x18')]=function(_0x21b94d){var _0x4bf17e=this;return new Promise(function(_0x4a4e5c,_0x571015){return db[_0x5001('0x19')][_0x5001('0x1a')](_0x21b94d[_0x5001('0x1b')],{'raw':_0x21b94d[_0x5001('0x1c')]?_0x21b94d[_0x5001('0x1c')][_0x5001('0x1d')]===undefined?!![]:![]:!![]})[_0x5001('0xd')](function(_0x436c36){logger[_0x5001('0xe')]('CreatePlugin',_0x21b94d);logger[_0x5001('0x10')](_0x5001('0x18'),_0x21b94d,JSON[_0x5001('0x13')](_0x436c36));_0x4a4e5c(_0x436c36);})[_0x5001('0x17')](function(_0x165467){logger[_0x5001('0x14')](_0x5001('0x18'),_0x165467[_0x5001('0x15')],_0x21b94d);_0x571015(_0x4bf17e[_0x5001('0x14')](0x1f4,_0x165467[_0x5001('0x15')]));});});}; \ No newline at end of file +var _0xa4c7=['info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','catch','CreatePlugin','Plugin','create','options','stringify','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','request','then'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xa4c7,0x1bf));var _0x7a4c=function(_0x2dd044,_0x2b2eb2){_0x2dd044=_0x2dd044-0x0;var _0x49797c=_0xa4c7[_0x2dd044];return _0x49797c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7a4c('0x0'));var BPromise=require(_0x7a4c('0x1'));var rs=require(_0x7a4c('0x2'));var fs=require('fs');var Redis=require(_0x7a4c('0x3'));var db=require(_0x7a4c('0x4'))['db'];var utils=require(_0x7a4c('0x5'));var logger=require(_0x7a4c('0x6'))(_0x7a4c('0x7'));var config=require(_0x7a4c('0x8'));var jayson=require(_0x7a4c('0x9'));var client=jayson[_0x7a4c('0xa')][_0x7a4c('0xb')]({'port':0x232a});config[_0x7a4c('0xc')]=_[_0x7a4c('0xd')](config[_0x7a4c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a4c('0xe'))(new Redis(config[_0x7a4c('0xc')]));require(_0x7a4c('0xf'))['register'](socket);function respondWithRpcPromise(_0x2f26bf,_0x5899dd,_0x3bb079){return new BPromise(function(_0x258c0f,_0x288549){return client[_0x7a4c('0x10')](_0x2f26bf,_0x3bb079)[_0x7a4c('0x11')](function(_0x41d560){logger[_0x7a4c('0x12')](_0x7a4c('0x13'),_0x5899dd,_0x7a4c('0x14'));logger[_0x7a4c('0x15')](_0x7a4c('0x16'),_0x5899dd,'request\x20sent',JSON['stringify'](_0x41d560));if(_0x41d560[_0x7a4c('0x17')]){if(_0x41d560[_0x7a4c('0x17')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x5899dd,_0x41d560['error'][_0x7a4c('0x18')]);return _0x288549(_0x41d560[_0x7a4c('0x17')][_0x7a4c('0x18')]);}logger[_0x7a4c('0x17')](_0x7a4c('0x13'),_0x5899dd,_0x41d560[_0x7a4c('0x17')][_0x7a4c('0x18')]);return _0x258c0f(_0x41d560['error'][_0x7a4c('0x18')]);}else{logger[_0x7a4c('0x12')]('Plugin,\x20%s,\x20%s',_0x5899dd,_0x7a4c('0x14'));_0x258c0f(_0x41d560['result'][_0x7a4c('0x18')]);}})[_0x7a4c('0x19')](function(_0x24ebf3){logger[_0x7a4c('0x17')](_0x7a4c('0x13'),_0x5899dd,_0x24ebf3);_0x288549(_0x24ebf3);});});}exports[_0x7a4c('0x1a')]=function(_0x4cf9fe){var _0x23c940=this;return new Promise(function(_0x59cd48,_0x2f003f){return db[_0x7a4c('0x1b')][_0x7a4c('0x1c')](_0x4cf9fe['body'],{'raw':_0x4cf9fe[_0x7a4c('0x1d')]?_0x4cf9fe[_0x7a4c('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x7a4c('0x11')](function(_0x3a650e){logger[_0x7a4c('0x12')]('CreatePlugin',_0x4cf9fe);logger[_0x7a4c('0x15')](_0x7a4c('0x1a'),_0x4cf9fe,JSON[_0x7a4c('0x1e')](_0x3a650e));_0x59cd48(_0x3a650e);})[_0x7a4c('0x19')](function(_0x1c3c6f){logger['error'](_0x7a4c('0x1a'),_0x1c3c6f[_0x7a4c('0x18')],_0x4cf9fe);_0x2f003f(_0x23c940[_0x7a4c('0x17')](0x1f4,_0x1c3c6f[_0x7a4c('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index a7ac16b..3b103a8 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 _0xefa1=['removeListener','register','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x10bbae,_0x597e4d){var _0x507f1e=function(_0x44653d){while(--_0x44653d){_0x10bbae['push'](_0x10bbae['shift']());}};_0x507f1e(++_0x597e4d);}(_0xefa1,0x175));var _0x1efa=function(_0x198746,_0x37f224){_0x198746=_0x198746-0x0;var _0x246f0e=_0xefa1[_0x198746];return _0x246f0e;};'use strict';var PluginEvents=require(_0x1efa('0x0'));var events=[_0x1efa('0x1'),_0x1efa('0x2'),_0x1efa('0x3')];function createListener(_0x1628d8,_0x251e87){return function(_0x5036dc){_0x251e87[_0x1efa('0x4')](_0x1628d8,_0x5036dc);};}function removeListener(_0x5e0280,_0x1380a1){return function(){PluginEvents[_0x1efa('0x5')](_0x5e0280,_0x1380a1);};}exports[_0x1efa('0x6')]=function(_0x56253e){for(var _0x5a860a=0x0,_0x342bac=events[_0x1efa('0x7')];_0x5a860a<_0x342bac;_0x5a860a++){var _0x58411e=events[_0x5a860a];var _0x28c8b3=createListener(_0x1efa('0x8')+_0x58411e,_0x56253e);PluginEvents['on'](_0x58411e,_0x28c8b3);}}; \ No newline at end of file +var _0xba5a=['length','plugin:','save','remove','update','emit'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0xba5a,0x1d0));var _0xaba5=function(_0x280c4b,_0xfe785d){_0x280c4b=_0x280c4b-0x0;var _0x2a5e90=_0xba5a[_0x280c4b];return _0x2a5e90;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0xaba5('0x0'),_0xaba5('0x1'),_0xaba5('0x2')];function createListener(_0x4d6746,_0x50efd4){return function(_0x1b27e2){_0x50efd4[_0xaba5('0x3')](_0x4d6746,_0x1b27e2);};}function removeListener(_0x30f663,_0x11ac8b){return function(){PluginEvents['removeListener'](_0x30f663,_0x11ac8b);};}exports['register']=function(_0x58b605){for(var _0x35a186=0x0,_0x5e6b46=events[_0xaba5('0x4')];_0x35a186<_0x5e6b46;_0x35a186++){var _0x1dba58=events[_0x35a186];var _0x3772a2=createListener(_0xaba5('0x5')+_0x1dba58,_0x58b605);PluginEvents['on'](_0x1dba58,_0x3772a2);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 70528da..41d1b43 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 _0x7585=['post','put','update','delete','/:id','express','Router','../../components/auth/service','./pm2.controller','get','isAuthenticated','index','show'];(function(_0x3e208d,_0x2ea610){var _0x569e5c=function(_0x33c7d1){while(--_0x33c7d1){_0x3e208d['push'](_0x3e208d['shift']());}};_0x569e5c(++_0x2ea610);}(_0x7585,0x1bf));var _0x5758=function(_0x375c02,_0x15f9ee){_0x375c02=_0x375c02-0x0;var _0x288ddc=_0x7585[_0x375c02];return _0x288ddc;};'use strict';var express=require(_0x5758('0x0'));var router=express[_0x5758('0x1')]();var auth=require(_0x5758('0x2'));var controller=require(_0x5758('0x3'));router[_0x5758('0x4')]('/',auth[_0x5758('0x5')](),controller[_0x5758('0x6')]);router[_0x5758('0x4')]('/:id',auth[_0x5758('0x5')](),controller[_0x5758('0x7')]);router[_0x5758('0x8')]('/',auth[_0x5758('0x5')](),controller['create']);router[_0x5758('0x9')]('/:id',auth[_0x5758('0x5')](),controller[_0x5758('0xa')]);router[_0x5758('0xb')](_0x5758('0xc'),auth[_0x5758('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4304=['index','show','create','/:id','update','delete','destroy','exports','express','Router','../../components/auth/service','./pm2.controller','get','isAuthenticated'];(function(_0x49195a,_0x57488b){var _0x473211=function(_0x46a5a0){while(--_0x46a5a0){_0x49195a['push'](_0x49195a['shift']());}};_0x473211(++_0x57488b);}(_0x4304,0x1ba));var _0x4430=function(_0x438223,_0x39e76b){_0x438223=_0x438223-0x0;var _0x1c29b0=_0x4304[_0x438223];return _0x1c29b0;};'use strict';var express=require(_0x4430('0x0'));var router=express[_0x4430('0x1')]();var auth=require(_0x4430('0x2'));var controller=require(_0x4430('0x3'));router[_0x4430('0x4')]('/',auth[_0x4430('0x5')](),controller[_0x4430('0x6')]);router[_0x4430('0x4')]('/:id',auth[_0x4430('0x5')](),controller[_0x4430('0x7')]);router['post']('/',auth[_0x4430('0x5')](),controller[_0x4430('0x8')]);router['put'](_0x4430('0x9'),auth[_0x4430('0x5')](),controller[_0x4430('0xa')]);router[_0x4430('0xb')](_0x4430('0x9'),auth[_0x4430('0x5')](),controller[_0x4430('0xc')]);module[_0x4430('0xd')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 9e555ce..93dba0a 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 _0x9369=['error','name','send','index','then','reject','express','motion2','length','catch','show','describe','params','create','body','../../files/plugins','script','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status'];(function(_0x129625,_0x5144ca){var _0x10334d=function(_0x4cda2a){while(--_0x4cda2a){_0x129625['push'](_0x129625['shift']());}};_0x10334d(++_0x5144ca);}(_0x9369,0xb9));var _0x9936=function(_0x5ab8f7,_0x3e778b){_0x5ab8f7=_0x5ab8f7-0x0;var _0x3e81e2=_0x9369[_0x5ab8f7];return _0x3e81e2;};'use strict';var _=require(_0x9936('0x0'));var pm2=require(_0x9936('0x1'));var logger=require(_0x9936('0x2'))(_0x9936('0x3'));var path=require(_0x9936('0x4'));var exec=require(_0x9936('0x5'))[_0x9936('0x6')];var BPromise=require(_0x9936('0x7'));function handleEntityNotFound(_0x358207,_0x838e77){return function(_0x4ceee0){if(!_0x4ceee0){_0x358207[_0x9936('0x8')](0x194);;}return _0x4ceee0;};}function respondWithResult(_0x1d4ec2,_0x25d7e0){_0x25d7e0=_0x25d7e0||0xc8;return function(_0x47dc50){if(_0x47dc50){return _0x1d4ec2[_0x9936('0x9')](_0x25d7e0)['json'](_0x47dc50);}return null;};}function handleError(_0xe8fecd,_0x515212){_0x515212=_0x515212||0x1f4;return function(_0x28587c){logger[_0x9936('0xa')](_0x28587c['stack']);if(_0x28587c[_0x9936('0xb')]){delete _0x28587c[_0x9936('0xb')];}_0xe8fecd['status'](_0x515212)[_0x9936('0xc')](_0x28587c);};}function execChildProcess(){return new BPromise(function(_0x525a95,_0x31bbae){exec('npm\x20install',function(_0x1e66fa,_0x2bb744,_0x3af5eb){logger['info'](_0x2bb744);logger['info'](_0x3af5eb);if(_0x1e66fa){logger['error'](_0x1e66fa);return _0x31bbae(_0x1e66fa);}return _0x525a95(_0x2bb744);});});}exports[_0x9936('0xd')]=function(_0x5e1e4c,_0x5d43ec){return pm2['list']()[_0x9936('0xe')](function(_0x122ca1){if(_0x122ca1){var _0x357d24=_[_0x9936('0xf')](_0x122ca1,function(_0x2372b6){return _0x2372b6['name']===_0x9936('0x10')||_0x2372b6[_0x9936('0xb')]===_0x9936('0x11');});return{'rows':_0x357d24,'count':_0x357d24[_0x9936('0x12')]};}return null;})[_0x9936('0xe')](respondWithResult(_0x5d43ec,null))[_0x9936('0x13')](handleError(_0x5d43ec,null));};exports[_0x9936('0x14')]=function(_0x2ab018,_0x4b1c2c){return pm2[_0x9936('0x15')](_0x2ab018[_0x9936('0x16')]['id'])[_0x9936('0xe')](respondWithResult(_0x4b1c2c,null))['then'](handleEntityNotFound(_0x4b1c2c,null))[_0x9936('0x13')](handleError(_0x4b1c2c,null));};exports[_0x9936('0x17')]=function(_0x141dc9,_0x5243aa){if(_0x141dc9[_0x9936('0x18')][_0x9936('0xb')]&&_0x141dc9[_0x9936('0x18')]['script']){var _0x473a92=path['join'](__dirname,_0x9936('0x19'),_0x141dc9[_0x9936('0x18')][_0x9936('0x1a')]);var _0x4af67c=process[_0x9936('0x1b')]();process[_0x9936('0x1c')](path[_0x9936('0x1d')](_0x473a92));return execChildProcess()[_0x9936('0xe')](function(_0x30da9b){process['chdir'](_0x4af67c);return pm2[_0x9936('0x1e')]({'name':_0x141dc9[_0x9936('0x18')][_0x9936('0xb')],'script':_0x473a92});})[_0x9936('0xe')](function(_0x53c407){pm2['dump']();return _0x53c407[0x0];})['then'](respondWithResult(_0x5243aa,0xc9))['catch'](handleError(_0x5243aa,null));}else{return _0x5243aa[_0x9936('0x9')](0x1f4)[_0x9936('0xc')]({'message':_0x9936('0x1f')});}};exports[_0x9936('0x20')]=function(_0x137171,_0x3b1d6b){if(_0x137171['body']['id']){delete _0x137171[_0x9936('0x18')]['id'];}var _0x564566={'online':_0x9936('0x21'),'stopped':_0x9936('0x22')};if(_0x564566[_0x9936('0x23')](_0x137171[_0x9936('0x18')][_0x9936('0x9')])){return pm2[_0x564566[_0x137171['body']['status']]](_0x137171[_0x9936('0x16')]['id'])[_0x9936('0xe')](respondWithResult(_0x3b1d6b,0xc8))[_0x9936('0x13')](handleError(_0x3b1d6b,null));}else{return _0x3b1d6b[_0x9936('0x9')](0x1f4)[_0x9936('0xc')]({'message':_0x9936('0x24')});}};exports[_0x9936('0x25')]=function(_0x46411c,_0x48186b){if(_0x46411c['body']['id']){delete _0x46411c[_0x9936('0x18')]['id'];}if(_0x46411c['params']['id']){return pm2[_0x9936('0x26')](_0x46411c[_0x9936('0x16')]['id'])[_0x9936('0xe')](function(_0x475749){pm2['dump']();return _0x475749[0x0];})[_0x9936('0xe')](respondWithResult(_0x48186b,null))[_0x9936('0x13')](handleError(_0x48186b,null));}else{return _0x48186b[_0x9936('0x9')](0x1f4)[_0x9936('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x9df1=['status','send','info','index','list','then','reject','express','catch','show','describe','params','body','join','../../files/plugins','script','cwd','chdir','dirname','dump','update','restart','stop','hasOwnProperty','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','api','path','child_process','exec','bluebird','sendStatus','json','error','stack','name'];(function(_0x3874ce,_0x307d61){var _0x1c71b8=function(_0x4a8837){while(--_0x4a8837){_0x3874ce['push'](_0x3874ce['shift']());}};_0x1c71b8(++_0x307d61);}(_0x9df1,0xde));var _0x19df=function(_0x32ad65,_0x2c8fe6){_0x32ad65=_0x32ad65-0x0;var _0x503759=_0x9df1[_0x32ad65];return _0x503759;};'use strict';var _=require(_0x19df('0x0'));var pm2=require(_0x19df('0x1'));var logger=require('../../config/logger')(_0x19df('0x2'));var path=require(_0x19df('0x3'));var exec=require(_0x19df('0x4'))[_0x19df('0x5')];var BPromise=require(_0x19df('0x6'));function handleEntityNotFound(_0x54693d,_0x5db4ad){return function(_0x4761e9){if(!_0x4761e9){_0x54693d[_0x19df('0x7')](0x194);;}return _0x4761e9;};}function respondWithResult(_0x5a6f4b,_0x80b8bc){_0x80b8bc=_0x80b8bc||0xc8;return function(_0x45a867){if(_0x45a867){return _0x5a6f4b['status'](_0x80b8bc)[_0x19df('0x8')](_0x45a867);}return null;};}function handleError(_0x2b0ba1,_0x3cc3d0){_0x3cc3d0=_0x3cc3d0||0x1f4;return function(_0x25e885){logger[_0x19df('0x9')](_0x25e885[_0x19df('0xa')]);if(_0x25e885[_0x19df('0xb')]){delete _0x25e885[_0x19df('0xb')];}_0x2b0ba1[_0x19df('0xc')](_0x3cc3d0)[_0x19df('0xd')](_0x25e885);};}function execChildProcess(){return new BPromise(function(_0x1998fe,_0x242c0b){exec('npm\x20install',function(_0x24874e,_0x4ae8e1,_0x15689c){logger[_0x19df('0xe')](_0x4ae8e1);logger['info'](_0x15689c);if(_0x24874e){logger[_0x19df('0x9')](_0x24874e);return _0x242c0b(_0x24874e);}return _0x1998fe(_0x4ae8e1);});});}exports[_0x19df('0xf')]=function(_0x51ab5b,_0x53046d){return pm2[_0x19df('0x10')]()[_0x19df('0x11')](function(_0x14db6e){if(_0x14db6e){var _0x25062b=_[_0x19df('0x12')](_0x14db6e,function(_0x1ec270){return _0x1ec270['name']===_0x19df('0x13')||_0x1ec270[_0x19df('0xb')]==='motion2';});return{'rows':_0x25062b,'count':_0x25062b['length']};}return null;})['then'](respondWithResult(_0x53046d,null))[_0x19df('0x14')](handleError(_0x53046d,null));};exports[_0x19df('0x15')]=function(_0x255872,_0x429fb5){return pm2[_0x19df('0x16')](_0x255872[_0x19df('0x17')]['id'])[_0x19df('0x11')](respondWithResult(_0x429fb5,null))[_0x19df('0x11')](handleEntityNotFound(_0x429fb5,null))['catch'](handleError(_0x429fb5,null));};exports['create']=function(_0x5845b8,_0x10d29b){if(_0x5845b8[_0x19df('0x18')]['name']&&_0x5845b8[_0x19df('0x18')]['script']){var _0xddb153=path[_0x19df('0x19')](__dirname,_0x19df('0x1a'),_0x5845b8[_0x19df('0x18')][_0x19df('0x1b')]);var _0x462bc4=process[_0x19df('0x1c')]();process[_0x19df('0x1d')](path[_0x19df('0x1e')](_0xddb153));return execChildProcess()[_0x19df('0x11')](function(_0x4722c2){process[_0x19df('0x1d')](_0x462bc4);return pm2['start']({'name':_0x5845b8[_0x19df('0x18')][_0x19df('0xb')],'script':_0xddb153});})[_0x19df('0x11')](function(_0xaa5b0a){pm2[_0x19df('0x1f')]();return _0xaa5b0a[0x0];})[_0x19df('0x11')](respondWithResult(_0x10d29b,0xc9))['catch'](handleError(_0x10d29b,null));}else{return _0x10d29b[_0x19df('0xc')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x19df('0x20')]=function(_0x4adbd5,_0x5b55d6){if(_0x4adbd5[_0x19df('0x18')]['id']){delete _0x4adbd5[_0x19df('0x18')]['id'];}var _0x267a95={'online':_0x19df('0x21'),'stopped':_0x19df('0x22')};if(_0x267a95[_0x19df('0x23')](_0x4adbd5[_0x19df('0x18')][_0x19df('0xc')])){return pm2[_0x267a95[_0x4adbd5[_0x19df('0x18')][_0x19df('0xc')]]](_0x4adbd5[_0x19df('0x17')]['id'])['then'](respondWithResult(_0x5b55d6,0xc8))[_0x19df('0x14')](handleError(_0x5b55d6,null));}else{return _0x5b55d6[_0x19df('0xc')](0x1f4)[_0x19df('0xd')]({'message':_0x19df('0x24')});}};exports['destroy']=function(_0x19bb72,_0x3ee1d2){if(_0x19bb72['body']['id']){delete _0x19bb72[_0x19df('0x18')]['id'];}if(_0x19bb72[_0x19df('0x17')]['id']){return pm2[_0x19df('0x25')](_0x19bb72['params']['id'])[_0x19df('0x11')](function(_0x3e9ce7){pm2[_0x19df('0x1f')]();return _0x3e9ce7[0x0];})['then'](respondWithResult(_0x3ee1d2,null))[_0x19df('0x14')](handleError(_0x3ee1d2,null));}else{return _0x3ee1d2[_0x19df('0xc')](0x1f4)[_0x19df('0xd')]({'message':_0x19df('0x26')});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 45871bd..01b38b5 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 _0x1660=['exports','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x510c01,_0x5ca5c0){var _0x515f9f=function(_0x40933b){while(--_0x40933b){_0x510c01['push'](_0x510c01['shift']());}};_0x515f9f(++_0x5ca5c0);}(_0x1660,0x1f0));var _0x0166=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x1660[_0x47aa64];return _0x549c7a;};'use strict';var multer=require('multer');var util=require(_0x0166('0x0'));var path=require(_0x0166('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x0166('0x2'));var interaction=require(_0x0166('0x3'));var config=require('../../config/environment');module[_0x0166('0x4')]=router; \ No newline at end of file +var _0x8c90=['../../config/environment','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8c90,0x122));var _0x08c9=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x8c90[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x08c9('0x0'));var util=require('util');var path=require(_0x08c9('0x1'));var timeout=require(_0x08c9('0x2'));var express=require(_0x08c9('0x3'));var router=express['Router']();var auth=require(_0x08c9('0x4'));var interaction=require(_0x08c9('0x5'));var config=require(_0x08c9('0x6'));module[_0x08c9('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 25dd10e..67842fc 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 _0xe24d=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0xe24d,0x135));var _0xde24=function(_0xacc39f,_0x39be51){_0xacc39f=_0xacc39f-0x0;var _0x278b6=_0xe24d[_0xacc39f];return _0x278b6;};'use strict';var Sequelize=require(_0xde24('0x0'));module[_0xde24('0x1')]={'state':{'type':Sequelize[_0xde24('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xde24('0x3')]},'scheduledat':{'type':Sequelize[_0xde24('0x4')]},'uniqueid':{'type':Sequelize[_0xde24('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xde24('0x4')]},'ringtime':{'type':Sequelize[_0xde24('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xde24('0x3')]},'campaigntype':{'type':Sequelize[_0xde24('0x3')]},'membername':{'type':Sequelize[_0xde24('0x3')]}}; \ No newline at end of file +var _0x7848=['sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7848,0x122));var _0x8784=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0x7848[_0x13137e];return _0x346261;};'use strict';var Sequelize=require(_0x8784('0x0'));module[_0x8784('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8784('0x2')]},'scheduledat':{'type':Sequelize[_0x8784('0x3')]},'uniqueid':{'type':Sequelize[_0x8784('0x2')]},'starttime':{'type':Sequelize[_0x8784('0x3')]},'responsetime':{'type':Sequelize[_0x8784('0x3')]},'ringtime':{'type':Sequelize[_0x8784('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8784('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8784('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 9e782c9..e4ba388 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 _0xe660=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','util','../../config/logger','api','moment'];(function(_0x25190b,_0x358002){var _0x553aef=function(_0xf5bbb3){while(--_0xf5bbb3){_0x25190b['push'](_0x25190b['shift']());}};_0x553aef(++_0x358002);}(_0xe660,0x14c));var _0x0e66=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xe660[_0x281e5e];return _0x5a22d2;};'use strict';var _=require('lodash');var util=require(_0x0e66('0x0'));var logger=require(_0x0e66('0x1'))(_0x0e66('0x2'));var moment=require(_0x0e66('0x3'));var BPromise=require('bluebird');var rp=require(_0x0e66('0x4'));var fs=require('fs');var path=require(_0x0e66('0x5'));var rimraf=require(_0x0e66('0x6'));var config=require(_0x0e66('0x7'));var attributes=require(_0x0e66('0x8'));module[_0x0e66('0x9')]=function(_0x4eaf53,_0x5ae9b9){return _0x4eaf53[_0x0e66('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x0e66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x136c=['./reportAgentPreview.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x40012b,_0x11a4ae){var _0x5abd8f=function(_0x5b8d1a){while(--_0x5b8d1a){_0x40012b['push'](_0x40012b['shift']());}};_0x5abd8f(++_0x11a4ae);}(_0x136c,0x123));var _0xc136=function(_0x41c7bf,_0x5f2b75){_0x41c7bf=_0x41c7bf-0x0;var _0x50e829=_0x136c[_0x41c7bf];return _0x50e829;};'use strict';var _=require(_0xc136('0x0'));var util=require(_0xc136('0x1'));var logger=require(_0xc136('0x2'))(_0xc136('0x3'));var moment=require(_0xc136('0x4'));var BPromise=require('bluebird');var rp=require(_0xc136('0x5'));var fs=require('fs');var path=require(_0xc136('0x6'));var rimraf=require(_0xc136('0x7'));var config=require(_0xc136('0x8'));var attributes=require(_0xc136('0x9'));module[_0xc136('0xa')]=function(_0x862468,_0x5761ac){return _0x862468[_0xc136('0xb')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','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 775b001..2e9209b 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 _0xd7c7=['../../config/utils','../../config/environment','jayson/promise','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd7c7,0xcc));var _0x7d7c=function(_0x3fc1bc,_0x37ca9b){_0x3fc1bc=_0x3fc1bc-0x0;var _0xc31e7d=_0xd7c7[_0x3fc1bc];return _0xc31e7d;};'use strict';var _=require(_0x7d7c('0x0'));var util=require('util');var moment=require(_0x7d7c('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d7c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d7c('0x3'))['db'];var utils=require(_0x7d7c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7d7c('0x5'));var jayson=require(_0x7d7c('0x6'));var client=jayson['client'][_0x7d7c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a17f6,_0x25ebb2,_0x5b7b66){return new BPromise(function(_0x3034c6,_0x4f68ae){return client[_0x7d7c('0x8')](_0x2a17f6,_0x5b7b66)[_0x7d7c('0x9')](function(_0x3b549f){logger['info'](_0x7d7c('0xa'),_0x25ebb2,_0x7d7c('0xb'));logger[_0x7d7c('0xc')](_0x7d7c('0xd'),_0x25ebb2,'request\x20sent',JSON[_0x7d7c('0xe')](_0x3b549f));if(_0x3b549f[_0x7d7c('0xf')]){if(_0x3b549f[_0x7d7c('0xf')][_0x7d7c('0x10')]===0x1f4){logger[_0x7d7c('0xf')](_0x7d7c('0xa'),_0x25ebb2,_0x3b549f['error'][_0x7d7c('0x11')]);return _0x4f68ae(_0x3b549f['error']['message']);}logger[_0x7d7c('0xf')](_0x7d7c('0xa'),_0x25ebb2,_0x3b549f['error'][_0x7d7c('0x11')]);return _0x3034c6(_0x3b549f[_0x7d7c('0xf')][_0x7d7c('0x11')]);}else{logger[_0x7d7c('0x12')](_0x7d7c('0xa'),_0x25ebb2,_0x7d7c('0xb'));_0x3034c6(_0x3b549f[_0x7d7c('0x13')]['message']);}})['catch'](function(_0x120fb7){logger[_0x7d7c('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x25ebb2,_0x120fb7);_0x4f68ae(_0x120fb7);});});}exports[_0x7d7c('0x14')]=function(_0x205a89){var _0x339361=this;return new Promise(function(_0x4f327d,_0xefec52){return db[_0x7d7c('0x15')][_0x7d7c('0x16')](_0x205a89['body'],{'raw':_0x205a89[_0x7d7c('0x17')]?_0x205a89['options'][_0x7d7c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3149d3){logger[_0x7d7c('0x12')](_0x7d7c('0x14'),_0x205a89);logger[_0x7d7c('0xc')](_0x7d7c('0x14'),_0x205a89,JSON[_0x7d7c('0xe')](_0x3149d3));_0x4f327d(_0x3149d3);})[_0x7d7c('0x19')](function(_0x2bd843){logger[_0x7d7c('0xf')]('CreateReportAgentPreview',_0x2bd843[_0x7d7c('0x11')],_0x205a89);_0xefec52(_0x339361['error'](0x1f4,_0x2bd843[_0x7d7c('0x11')]));});});}; \ No newline at end of file +var _0x8a96=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','create','options','CreateReportAgentPreview','debug','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x8a96,0x1f2));var _0x68a9=function(_0x4edd8f,_0x527515){_0x4edd8f=_0x4edd8f-0x0;var _0x298af0=_0x8a96[_0x4edd8f];return _0x298af0;};'use strict';var _=require(_0x68a9('0x0'));var util=require(_0x68a9('0x1'));var moment=require(_0x68a9('0x2'));var BPromise=require('bluebird');var rs=require(_0x68a9('0x3'));var fs=require('fs');var Redis=require(_0x68a9('0x4'));var db=require(_0x68a9('0x5'))['db'];var utils=require(_0x68a9('0x6'));var logger=require(_0x68a9('0x7'))(_0x68a9('0x8'));var config=require(_0x68a9('0x9'));var jayson=require(_0x68a9('0xa'));var client=jayson[_0x68a9('0xb')][_0x68a9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x584bc2,_0x1385c7,_0x50c7f0){return new BPromise(function(_0x3e540b,_0x409478){return client['request'](_0x584bc2,_0x50c7f0)[_0x68a9('0xd')](function(_0x708c49){logger[_0x68a9('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x1385c7,_0x68a9('0xf'));logger['debug'](_0x68a9('0x10'),_0x1385c7,_0x68a9('0xf'),JSON[_0x68a9('0x11')](_0x708c49));if(_0x708c49['error']){if(_0x708c49[_0x68a9('0x12')][_0x68a9('0x13')]===0x1f4){logger[_0x68a9('0x12')]('ReportAgentPreview,\x20%s,\x20%s',_0x1385c7,_0x708c49[_0x68a9('0x12')][_0x68a9('0x14')]);return _0x409478(_0x708c49[_0x68a9('0x12')][_0x68a9('0x14')]);}logger[_0x68a9('0x12')](_0x68a9('0x15'),_0x1385c7,_0x708c49[_0x68a9('0x12')][_0x68a9('0x14')]);return _0x3e540b(_0x708c49['error'][_0x68a9('0x14')]);}else{logger[_0x68a9('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x1385c7,_0x68a9('0xf'));_0x3e540b(_0x708c49[_0x68a9('0x16')][_0x68a9('0x14')]);}})['catch'](function(_0x522c12){logger[_0x68a9('0x12')](_0x68a9('0x15'),_0x1385c7,_0x522c12);_0x409478(_0x522c12);});});}exports['CreateReportAgentPreview']=function(_0x2296d1){var _0x43a296=this;return new Promise(function(_0x3a762f,_0x393678){return db['ReportAgentPreview'][_0x68a9('0x17')](_0x2296d1['body'],{'raw':_0x2296d1[_0x68a9('0x18')]?_0x2296d1['options']['raw']===undefined?!![]:![]:!![]})[_0x68a9('0xd')](function(_0x3ba3c4){logger[_0x68a9('0xe')](_0x68a9('0x19'),_0x2296d1);logger[_0x68a9('0x1a')](_0x68a9('0x19'),_0x2296d1,JSON['stringify'](_0x3ba3c4));_0x3a762f(_0x3ba3c4);})[_0x68a9('0x1b')](function(_0x518c82){logger[_0x68a9('0x12')](_0x68a9('0x19'),_0x518c82[_0x68a9('0x14')],_0x2296d1);_0x393678(_0x43a296[_0x68a9('0x12')](0x1f4,_0x518c82['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1bcce6a..053467b 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 _0x4365=['queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','showVoiceQueues','/outbound','outbound','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify'];(function(_0xee5cf1,_0x576ae9){var _0x22b513=function(_0x7376e7){while(--_0x7376e7){_0xee5cf1['push'](_0xee5cf1['shift']());}};_0x22b513(++_0x576ae9);}(_0x4365,0x143));var _0x5436=function(_0x546bf5,_0x52fc92){_0x546bf5=_0x546bf5-0x0;var _0x5632c8=_0x4365[_0x546bf5];return _0x5632c8;};'use strict';var multer=require(_0x5436('0x0'));var util=require(_0x5436('0x1'));var path=require('path');var express=require(_0x5436('0x2'));var router=express[_0x5436('0x3')]();var auth=require(_0x5436('0x4'));var controller=require(_0x5436('0x5'));router[_0x5436('0x6')](_0x5436('0x7'),auth[_0x5436('0x8')](),controller[_0x5436('0x9')]);router[_0x5436('0x6')](_0x5436('0xa'),auth[_0x5436('0x8')](),controller[_0x5436('0xb')]);router[_0x5436('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x5436('0x8')](),controller[_0x5436('0xc')]);router[_0x5436('0x6')](_0x5436('0xd'),auth[_0x5436('0x8')](),controller[_0x5436('0xe')]);router['get']('/chat/queues',auth[_0x5436('0x8')](),controller[_0x5436('0xf')]);router[_0x5436('0x6')](_0x5436('0x10'),auth[_0x5436('0x8')](),controller[_0x5436('0x11')]);router[_0x5436('0x6')](_0x5436('0x12'),auth['isAuthenticated'](),controller[_0x5436('0x13')]);router[_0x5436('0x6')]('/openchannel/queues',auth[_0x5436('0x8')](),controller[_0x5436('0x14')]);router[_0x5436('0x6')](_0x5436('0x15'),auth['isAuthenticated'](),controller[_0x5436('0x16')]);router['get'](_0x5436('0x17'),auth[_0x5436('0x8')](),controller['faxQueues']);router['get'](_0x5436('0x18'),auth[_0x5436('0x8')](),controller[_0x5436('0x19')]);router[_0x5436('0x6')](_0x5436('0x1a'),auth['isAuthenticated'](),controller[_0x5436('0x1b')]);router['get'](_0x5436('0x1c'),auth['isAuthenticated'](),controller[_0x5436('0x1d')]);router['get'](_0x5436('0x1e'),auth[_0x5436('0x8')](),controller[_0x5436('0x1f')]);router['get'](_0x5436('0x20'),auth['isAuthenticated'](),controller[_0x5436('0x21')]);router[_0x5436('0x6')]('/voice/queues/:id',auth[_0x5436('0x8')](),controller[_0x5436('0x22')]);router[_0x5436('0x6')](_0x5436('0x23'),auth[_0x5436('0x8')](),controller[_0x5436('0x24')]);router[_0x5436('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller['outboundChannels']);router['get']('/agents',auth[_0x5436('0x8')](),controller[_0x5436('0x25')]);router[_0x5436('0x26')](_0x5436('0x27'),auth[_0x5436('0x8')](),controller[_0x5436('0x28')]);router[_0x5436('0x6')](_0x5436('0x29'),auth[_0x5436('0x8')](),controller[_0x5436('0x2a')]);router['get'](_0x5436('0x2b'),auth[_0x5436('0x8')](),controller['trunks']);router[_0x5436('0x6')](_0x5436('0x2c'),auth[_0x5436('0x8')](),controller[_0x5436('0x2d')]);router[_0x5436('0x6')](_0x5436('0x2e'),auth[_0x5436('0x8')](),controller[_0x5436('0x2f')]);router['get']('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x5436('0x30')]);router['get'](_0x5436('0x31'),auth[_0x5436('0x8')](),controller[_0x5436('0x32')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x5436('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x5436('0x6')](_0x5436('0x33'),auth['isAuthenticated'](),controller[_0x5436('0x34')]);router['get'](_0x5436('0x35'),auth[_0x5436('0x8')](),controller[_0x5436('0x36')]);router[_0x5436('0x37')](_0x5436('0x38'),auth[_0x5436('0x8')](),controller[_0x5436('0x39')]('mail'));router[_0x5436('0x6')](_0x5436('0x3a'),auth['isAuthenticated'](),controller[_0x5436('0x3b')]);router[_0x5436('0x37')](_0x5436('0x3c'),auth[_0x5436('0x8')](),controller[_0x5436('0x39')]('chat'));router[_0x5436('0x6')](_0x5436('0x3d'),auth['isAuthenticated'](),controller[_0x5436('0x3e')]);router[_0x5436('0x37')](_0x5436('0x3f'),auth[_0x5436('0x8')](),controller[_0x5436('0x39')](_0x5436('0x40')));router['get'](_0x5436('0x41'),auth[_0x5436('0x8')](),controller[_0x5436('0x42')]);router[_0x5436('0x37')](_0x5436('0x43'),auth[_0x5436('0x8')](),controller['queueNotify']('openchannel'));router[_0x5436('0x6')](_0x5436('0x44'),auth[_0x5436('0x8')](),controller[_0x5436('0x45')]);router['post'](_0x5436('0x46'),auth['isAuthenticated'](),controller[_0x5436('0x39')](_0x5436('0x47')));router['get'](_0x5436('0x48'),auth['isAuthenticated'](),controller[_0x5436('0x49')]);router[_0x5436('0x37')]('/agents/:id/notify',auth[_0x5436('0x8')](),controller[_0x5436('0x4a')]);module[_0x5436('0x4b')]=router; \ No newline at end of file +var _0xeff4=['showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','post','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','showSmsQueues','/agents/:id/notify','agentNotify','multer','util','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','outbound','/outbound/channels','outboundChannels','/agents','agents','put','/agents/:id/capacity','telephones','trunks','/campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/mail/queues/:id/notify','queueNotify','mail'];(function(_0xea0022,_0x53a2b6){var _0x2a5b94=function(_0x47ef8d){while(--_0x47ef8d){_0xea0022['push'](_0xea0022['shift']());}};_0x2a5b94(++_0x53a2b6);}(_0xeff4,0xe5));var _0x4eff=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xeff4[_0x36c5b0];return _0xf19333;};'use strict';var multer=require(_0x4eff('0x0'));var util=require(_0x4eff('0x1'));var path=require('path');var express=require('express');var router=express[_0x4eff('0x2')]();var auth=require(_0x4eff('0x3'));var controller=require(_0x4eff('0x4'));router[_0x4eff('0x5')]('/voice/channels',auth[_0x4eff('0x6')](),controller[_0x4eff('0x7')]);router[_0x4eff('0x5')](_0x4eff('0x8'),auth['isAuthenticated'](),controller[_0x4eff('0x9')]);router[_0x4eff('0x5')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x4eff('0xa')]);router[_0x4eff('0x5')](_0x4eff('0xb'),auth[_0x4eff('0x6')](),controller[_0x4eff('0xc')]);router[_0x4eff('0x5')]('/chat/queues',auth[_0x4eff('0x6')](),controller[_0x4eff('0xd')]);router[_0x4eff('0x5')](_0x4eff('0xe'),auth[_0x4eff('0x6')](),controller[_0x4eff('0xf')]);router[_0x4eff('0x5')](_0x4eff('0x10'),auth[_0x4eff('0x6')](),controller['mailAccounts']);router['get'](_0x4eff('0x11'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x12')]);router[_0x4eff('0x5')](_0x4eff('0x13'),auth['isAuthenticated'](),controller[_0x4eff('0x14')]);router[_0x4eff('0x5')]('/fax/queues',auth[_0x4eff('0x6')](),controller[_0x4eff('0x15')]);router[_0x4eff('0x5')](_0x4eff('0x16'),auth[_0x4eff('0x6')](),controller['voiceQueuesPreview']);router[_0x4eff('0x5')](_0x4eff('0x17'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x18')]);router['get'](_0x4eff('0x19'),auth['isAuthenticated'](),controller[_0x4eff('0x1a')]);router[_0x4eff('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0x4eff('0x6')](),controller[_0x4eff('0x1b')]);router[_0x4eff('0x5')](_0x4eff('0x1c'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x1d')]);router[_0x4eff('0x5')](_0x4eff('0x1e'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x1f')]);router[_0x4eff('0x5')]('/outbound',auth[_0x4eff('0x6')](),controller[_0x4eff('0x20')]);router['get'](_0x4eff('0x21'),auth['isAuthenticated'](),controller[_0x4eff('0x22')]);router[_0x4eff('0x5')](_0x4eff('0x23'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x24')]);router[_0x4eff('0x25')](_0x4eff('0x26'),auth[_0x4eff('0x6')](),controller['agentCapacity']);router[_0x4eff('0x5')]('/telephones',auth['isAuthenticated'](),controller[_0x4eff('0x27')]);router[_0x4eff('0x5')]('/trunks',auth[_0x4eff('0x6')](),controller[_0x4eff('0x28')]);router[_0x4eff('0x5')](_0x4eff('0x29'),auth['isAuthenticated'](),controller['campaigns']);router['get'](_0x4eff('0x2a'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x2b')]);router[_0x4eff('0x5')]('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x4eff('0x2c')]);router['get'](_0x4eff('0x2d'),auth[_0x4eff('0x6')](),controller['mailQueuesWaitingInteractions']);router['get']('/openchannel/queues/waitinginteractions',auth[_0x4eff('0x6')](),controller['openchannelQueuesWaitingInteractions']);router[_0x4eff('0x5')](_0x4eff('0x2e'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x2f')]);router[_0x4eff('0x5')]('/fax/queues/waitinginteractions',auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router['post'](_0x4eff('0x30'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x31')](_0x4eff('0x32')));router[_0x4eff('0x5')]('/mail/queues/:id',auth[_0x4eff('0x6')](),controller[_0x4eff('0x33')]);router['post'](_0x4eff('0x34'),auth[_0x4eff('0x6')](),controller['queueNotify'](_0x4eff('0x35')));router[_0x4eff('0x5')](_0x4eff('0x36'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x37')]);router[_0x4eff('0x38')](_0x4eff('0x39'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x31')](_0x4eff('0x3a')));router[_0x4eff('0x5')](_0x4eff('0x3b'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x3c')]);router[_0x4eff('0x38')](_0x4eff('0x3d'),auth['isAuthenticated'](),controller[_0x4eff('0x31')](_0x4eff('0x3e')));router[_0x4eff('0x5')](_0x4eff('0x3f'),auth['isAuthenticated'](),controller[_0x4eff('0x40')]);router[_0x4eff('0x38')](_0x4eff('0x41'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x31')](_0x4eff('0x42')));router[_0x4eff('0x5')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x4eff('0x43')]);router[_0x4eff('0x38')](_0x4eff('0x44'),auth[_0x4eff('0x6')](),controller[_0x4eff('0x45')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index d1af696..78041f7 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 _0xeae2=['findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Queue','findOne','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','From','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','Website','Agent\x20not\x20found','create','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','request','then','error','message','result','catch','sendStatus','stack','name','status','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport'];(function(_0x588790,_0x25b2d6){var _0x15d353=function(_0x4bfcbe){while(--_0x4bfcbe){_0x588790['push'](_0x588790['shift']());}};_0x15d353(++_0x25b2d6);}(_0xeae2,0x19a));var _0x2eae=function(_0x12afa7,_0x35aae2){_0x12afa7=_0x12afa7-0x0;var _0x2d7308=_0xeae2[_0x12afa7];return _0x2d7308;};'use strict';var BPromise=require(_0x2eae('0x0'));var moment=require(_0x2eae('0x1'));var _=require(_0x2eae('0x2'));var util=require(_0x2eae('0x3'));var db=require(_0x2eae('0x4'))['db'];var logger=require(_0x2eae('0x5'))(_0x2eae('0x6'));var jayson=require(_0x2eae('0x7'));var amiClient=jayson[_0x2eae('0x8')]['http']({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x2eae('0x8')]['http']({'port':0x232c});function respondWithRpcPromise(_0x55e423,_0x7d0aa5,_0x5f0a10){return new BPromise(function(_0x5439ab,_0x52b678){var _0x25cd07=_0x5f0a10?_0x5f0a10:amiClient;return _0x25cd07[_0x2eae('0x9')](_0x55e423,_0x7d0aa5)[_0x2eae('0xa')](function(_0x4eef1f){if(_0x4eef1f['error']){if(_0x4eef1f['error']['code']===0x1f4){return _0x52b678(_0x4eef1f[_0x2eae('0xb')]['message']);}return _0x5439ab(_0x4eef1f[_0x2eae('0xb')][_0x2eae('0xc')]);}else{_0x5439ab(_0x4eef1f[_0x2eae('0xd')]);}})[_0x2eae('0xe')](function(_0x1c12fe){_0x52b678(_0x1c12fe);});});}function respondWithResult(_0x3d4e7b,_0x2c2497){_0x2c2497=_0x2c2497||0xc8;return function(_0x583536){if(_0x583536){return _0x3d4e7b['status'](_0x2c2497)['json'](_0x583536);}return _0x3d4e7b[_0x2eae('0xf')](0x194);};}function handleError(_0x4e6806,_0x81c90d){_0x81c90d=_0x81c90d||0x1f4;return function(_0x2b1a0a){logger[_0x2eae('0xb')](_0x2b1a0a[_0x2eae('0x10')]);if(_0x2b1a0a[_0x2eae('0x11')]){delete _0x2b1a0a[_0x2eae('0x11')];}_0x4e6806[_0x2eae('0x12')](_0x81c90d)[_0x2eae('0x13')](_0x2b1a0a);};}function findById(_0xcee3c7){return function(_0x57ca18){if(!_['isNil'](_0xcee3c7)&&!_[_0x2eae('0x14')](_0x57ca18)&&!_['isNil'](_0x57ca18[_0x2eae('0x15')])){return _['find'](_0x57ca18[_0x2eae('0x15')],function(_0xe642dd){return _0xe642dd['id']==_0xcee3c7;});}return null;};}exports[_0x2eae('0x16')]=function(_0x6eda8b,_0x4361f1){return respondWithRpcPromise(_0x2eae('0x17'),_0x6eda8b[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x4361f1,null))['catch'](handleError(_0x4361f1,null));};exports[_0x2eae('0x19')]=function(_0x58bc3d,_0x282060){return respondWithRpcPromise(_0x2eae('0x1a'),_[_0x2eae('0x1b')](_0x58bc3d[_0x2eae('0x18')],_0x58bc3d['params']))[_0x2eae('0xa')](respondWithResult(_0x282060,null))['catch'](handleError(_0x282060,null));};exports['voiceChannelStopMixMonitor']=function(_0x47c395,_0x579245){return respondWithRpcPromise(_0x2eae('0x1c'),_['merge'](_0x47c395[_0x2eae('0x18')],_0x47c395[_0x2eae('0x1d')]))[_0x2eae('0xa')](respondWithResult(_0x579245,null))[_0x2eae('0xe')](handleError(_0x579245,null));};exports[_0x2eae('0x1e')]=function(_0x25fb73,_0x1b5597){return respondWithRpcPromise(_0x2eae('0x1f'),_0x25fb73[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x1b5597,null))[_0x2eae('0xe')](handleError(_0x1b5597,null));};exports[_0x2eae('0x20')]=function(_0xcb98a3,_0x1acf9b){return respondWithRpcPromise(_0x2eae('0x1f'),_0xcb98a3[_0x2eae('0x18')])[_0x2eae('0xa')](findById(_0xcb98a3['params']['id']))[_0x2eae('0xa')](respondWithResult(_0x1acf9b,null))[_0x2eae('0xe')](handleError(_0x1acf9b,null));};exports[_0x2eae('0x21')]=function(_0x108bfd,_0x30a71f){return respondWithRpcPromise(_0x2eae('0x22'),_[_0x2eae('0x1b')](_0x108bfd[_0x2eae('0x18')],_0x108bfd[_0x2eae('0x1d')]))['then'](respondWithResult(_0x30a71f,null))[_0x2eae('0xe')](handleError(_0x30a71f,null));};exports[_0x2eae('0x23')]=function(_0x18a1c6,_0x3fd11b){return respondWithRpcPromise(_0x2eae('0x24'),_0x18a1c6[_0x2eae('0x18')])['then'](respondWithResult(_0x3fd11b,null))['catch'](handleError(_0x3fd11b,null));};exports[_0x2eae('0x25')]=function(_0x14031a,_0x12edd6){return respondWithRpcPromise(_0x2eae('0x26'),_['merge'](_0x14031a[_0x2eae('0x18')],_0x14031a[_0x2eae('0x1d')]))[_0x2eae('0xa')](respondWithResult(_0x12edd6,null))[_0x2eae('0xe')](handleError(_0x12edd6,null));};exports[_0x2eae('0x27')]=function(_0x4fb6ff,_0x39aa27){return respondWithRpcPromise(_0x2eae('0x28'),_[_0x2eae('0x1b')](_0x4fb6ff[_0x2eae('0x18')],_0x4fb6ff[_0x2eae('0x1d')]))[_0x2eae('0xa')](respondWithResult(_0x39aa27,null))[_0x2eae('0xe')](handleError(_0x39aa27,null));};exports[_0x2eae('0x29')]=function(_0x2765d7,_0x351a4d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x2eae('0x1b')](_0x2765d7[_0x2eae('0x18')],_0x2765d7['params']))[_0x2eae('0xa')](respondWithResult(_0x351a4d,null))[_0x2eae('0xe')](handleError(_0x351a4d,null));};exports[_0x2eae('0x2a')]=function(_0x5bfa7e,_0x20978b){return respondWithRpcPromise(_0x2eae('0x2b'),_0x5bfa7e[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x20978b,null))[_0x2eae('0xe')](handleError(_0x20978b,null));};exports['outboundChannels']=function(_0xbdf6b4,_0x1bda57){return respondWithRpcPromise(_0x2eae('0x2c'),_0xbdf6b4[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x1bda57,null))[_0x2eae('0xe')](handleError(_0x1bda57,null));};exports[_0x2eae('0x2d')]=function(_0x2fa5d,_0x3dd0e1){var _0xffda71;return respondWithRpcPromise(_0x2eae('0x2e'),_0x2fa5d[_0x2eae('0x18')])[_0x2eae('0xa')](function(_0x5a47af){_0xffda71=_0x5a47af;return respondWithRpcPromise(_0x2eae('0x2e'),_0x2fa5d[_0x2eae('0x18')],routingClient);})[_0x2eae('0xa')](function(_0x2f266d){return _[_0x2eae('0x1b')]({},_0x2f266d,_0xffda71);})['then'](respondWithResult(_0x3dd0e1,null))['catch'](handleError(_0x3dd0e1,null));};exports[_0x2eae('0x2f')]=function(_0x493899,_0x598cd9){if(_0x493899['body']&&_0x493899[_0x2eae('0x30')]['interaction']&&_0x493899[_0x2eae('0x31')]&&_0x493899[_0x2eae('0x31')]['name']){for(var _0x41f682 in _0x493899['body']['interaction']){if(_0x493899['body'][_0x2eae('0x32')]['hasOwnProperty'](_0x41f682)){db['MemberReport'][_0x2eae('0x33')]({'where':{'channel':_0x41f682,'membername':_0x493899[_0x2eae('0x31')]['name'],'type':_0x2eae('0x34'),'exitAt':null,'uniqueid':_0x493899[_0x2eae('0x30')]['interaction'][_0x41f682]&&_0x493899['body'][_0x2eae('0x32')][_0x41f682][_0x2eae('0x35')]?{'$notIn':_0x493899[_0x2eae('0x30')][_0x2eae('0x32')][_0x41f682]}:{'$ne':null}}})[_0x2eae('0xa')](function(_0x58e939){var _0x390fbc=moment()[_0x2eae('0x36')](_0x2eae('0x37'));for(var _0x2ca6bf=0x0,_0x27306f=_0x58e939[_0x2eae('0x35')];_0x2ca6bf<_0x27306f;_0x2ca6bf+=0x1){_0x58e939[_0x2ca6bf][_0x2eae('0x38')]({'exitAt':_0x390fbc});}});for(var _0x594530=0x0;_0x594530<_0x493899[_0x2eae('0x30')]['interaction'][_0x41f682][_0x2eae('0x35')];_0x594530+=0x1){db[_0x2eae('0x39')][_0x2eae('0x3a')]({'where':{'channel':_0x41f682,'membername':_0x493899[_0x2eae('0x31')]['name'],'type':_0x2eae('0x34'),'uniqueid':_0x493899['body'][_0x2eae('0x32')][_0x41f682][_0x594530],'exitAt':null},'defaults':{'channel':_0x41f682,'membername':_0x493899[_0x2eae('0x31')]['name'],'interface':_['isNil'](_0x493899['user']['interface'])?util['format'](_0x2eae('0x3b'),_0x493899[_0x2eae('0x31')][_0x2eae('0x11')]):_0x493899[_0x2eae('0x31')][_0x2eae('0x3c')],'type':_0x2eae('0x34'),'enterAt':moment()[_0x2eae('0x36')](_0x2eae('0x37')),'role':_0x2eae('0x3d'),'internal':_0x493899[_0x2eae('0x31')][_0x2eae('0x3e')],'uniqueid':_0x493899[_0x2eae('0x30')]['interaction'][_0x41f682][_0x594530]}});}}}}return respondWithRpcPromise(_0x2eae('0x3f'),{'id':_0x493899[_0x2eae('0x1d')]['id'],'capacity':_0x493899[_0x2eae('0x30')][_0x2eae('0x40')]},routingClient)[_0x2eae('0xa')](respondWithResult(_0x598cd9,null))['catch'](handleError(_0x598cd9,null));};exports[_0x2eae('0x41')]=function(_0x51ae0d,_0x2f7a26){return respondWithRpcPromise(_0x2eae('0x42'),_0x51ae0d[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x2f7a26,null))[_0x2eae('0xe')](handleError(_0x2f7a26,null));};exports[_0x2eae('0x43')]=function(_0x43597f,_0x4a2d89){return respondWithRpcPromise(_0x2eae('0x44'),_0x43597f[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x4a2d89,null))['catch'](handleError(_0x4a2d89,null));};exports[_0x2eae('0x45')]=function(_0x4fc7c7,_0x125962){return respondWithRpcPromise(_0x2eae('0x46'),_0x4fc7c7[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x125962,null))[_0x2eae('0xe')](handleError(_0x125962,null));};exports[_0x2eae('0x47')]=function(_0x3bc9eb,_0x4650c4){return respondWithRpcPromise('ChatQueues',_0x3bc9eb[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x4650c4,null))['catch'](handleError(_0x4650c4,null));};exports[_0x2eae('0x48')]=function(_0xd4357b,_0x3e176c){return respondWithRpcPromise(_0x2eae('0x49'),_0xd4357b['query'],routingClient)[_0x2eae('0xa')](findById(_0xd4357b[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x3e176c,null))['catch'](handleError(_0x3e176c,null));};exports[_0x2eae('0x4a')]=function(_0x48e9d2,_0x3a272d){return respondWithRpcPromise(_0x2eae('0x4b'),_0x48e9d2[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x3a272d,null))['catch'](handleError(_0x3a272d,null));};exports[_0x2eae('0x4c')]=function(_0x4e3f6d,_0x56d983){return respondWithRpcPromise(_0x2eae('0x4b'),_0x4e3f6d[_0x2eae('0x18')],routingClient)['then'](findById(_0x4e3f6d[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x56d983,null))[_0x2eae('0xe')](handleError(_0x56d983,null));};exports[_0x2eae('0x4d')]=function(_0x29f901,_0x42eb72){return respondWithRpcPromise(_0x2eae('0x4e'),_0x29f901['query'],mailClient)['then'](respondWithResult(_0x42eb72,null))['catch'](handleError(_0x42eb72,null));};exports['openchannelQueues']=function(_0x4edc16,_0x541b22){return respondWithRpcPromise(_0x2eae('0x4f'),_0x4edc16['query'],routingClient)[_0x2eae('0xa')](respondWithResult(_0x541b22,null))[_0x2eae('0xe')](handleError(_0x541b22,null));};exports['showOpenchannelQueues']=function(_0x3aa651,_0xd8ddc7){return respondWithRpcPromise(_0x2eae('0x4f'),_0x3aa651['query'],routingClient)[_0x2eae('0xa')](findById(_0x3aa651['params']['id']))['then'](respondWithResult(_0xd8ddc7,null))[_0x2eae('0xe')](handleError(_0xd8ddc7,null));};exports[_0x2eae('0x50')]=function(_0x341bd2,_0x17e9e8){return respondWithRpcPromise(_0x2eae('0x51'),_0x341bd2[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x17e9e8,null))[_0x2eae('0xe')](handleError(_0x17e9e8,null));};exports['showSmsQueues']=function(_0x236691,_0x16af21){return respondWithRpcPromise(_0x2eae('0x51'),_0x236691[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](findById(_0x236691[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x16af21,null))[_0x2eae('0xe')](handleError(_0x16af21,null));};exports[_0x2eae('0x52')]=function(_0x54d390,_0x5d9fb6){return respondWithRpcPromise(_0x2eae('0x53'),_0x54d390[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x5d9fb6,null))['catch'](handleError(_0x5d9fb6,null));};exports[_0x2eae('0x54')]=function(_0x2afb19,_0x547eaa){return respondWithRpcPromise(_0x2eae('0x53'),_0x2afb19[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](findById(_0x2afb19[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x547eaa,null))[_0x2eae('0xe')](handleError(_0x547eaa,null));};exports[_0x2eae('0x55')]=function(_0x33b665,_0x262b32){return respondWithRpcPromise(_0x2eae('0x56'),_0x33b665[_0x2eae('0x18')])['then'](respondWithResult(_0x262b32,null))[_0x2eae('0xe')](handleError(_0x262b32,null));};exports['chatQueuesWaitingInteractions']=function(_0x20a701,_0x79ae37){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x20a701[_0x2eae('0x18')],routingClient)['then'](respondWithResult(_0x79ae37,null))[_0x2eae('0xe')](handleError(_0x79ae37,null));};exports['mailQueuesWaitingInteractions']=function(_0x5759eb,_0x49a596){return respondWithRpcPromise(_0x2eae('0x57'),_0x5759eb[_0x2eae('0x18')],routingClient)['then'](respondWithResult(_0x49a596,null))[_0x2eae('0xe')](handleError(_0x49a596,null));};exports[_0x2eae('0x58')]=function(_0x543a86,_0x405c5c){return respondWithRpcPromise(_0x2eae('0x59'),_0x543a86[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x405c5c,null))['catch'](handleError(_0x405c5c,null));};exports[_0x2eae('0x5a')]=function(_0x38b13e,_0x13faf1){return respondWithRpcPromise(_0x2eae('0x5b'),_0x38b13e[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x13faf1,null))[_0x2eae('0xe')](handleError(_0x13faf1,null));};exports[_0x2eae('0x5c')]=function(_0x5593d2,_0x373387){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5593d2[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x373387,null))[_0x2eae('0xe')](handleError(_0x373387,null));};exports[_0x2eae('0x5d')]=function(_0x41f06b){return function(_0x3e62da,_0x52895d){var _0x599c60,_0x5a0c02;var _0x2a10a1=_['capitalize'](_0x41f06b);var _0x51452c=_0x41f06b===_0x2eae('0x5e')?'Website':'Account';return db[_0x2a10a1+_0x2eae('0x5f')][_0x2eae('0x60')]({'raw':!![],'where':{'id':_0x3e62da[_0x2eae('0x1d')]['id']}})[_0x2eae('0xa')](function(_0x18f515){if(_['isNil'](_0x18f515)){throw new Error(_0x2a10a1+'\x20Queue\x20not\x20found');}_0x599c60=_0x18f515;return db[_0x2a10a1+_0x2eae('0x61')][_0x2eae('0x60')]({'where':{'id':_0x3e62da[_0x2eae('0x30')][_0x2eae('0x62')]},'include':[{'model':db[_0x2a10a1+_0x2eae('0x63')],'as':'Interaction'},{'model':db[_0x2a10a1+_0x51452c],'as':_0x2eae('0x64')}]});})['then'](function(_0x93fe50){if(_[_0x2eae('0x14')](_0x93fe50)){throw new Error(_0x2a10a1+_0x2eae('0x65'));}_0x5a0c02=_0x93fe50;return _0x93fe50[_0x2eae('0x66')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2eae('0xa')](function(){var _0x4a3f59={'uniqueid':_0x41f06b+'.'+_0x5a0c02['id']+'.'+_0x5a0c02[_0x2eae('0x63')]['id'],'FromUserId':_0x3e62da[_0x2eae('0x31')]['id'],'type':_0x2eae('0x67')};_0x4a3f59[_0x2a10a1+_0x2eae('0x68')]=_0x5a0c02['id'];_0x4a3f59[_0x2a10a1+'InteractionId']=_0x5a0c02[_0x2eae('0x63')]['id'];_0x4a3f59[_0x2eae('0x69')+_0x2a10a1+_0x51452c+'Id']=_0x5a0c02[_0x2eae('0x64')]['id'];_0x4a3f59['To'+_0x2a10a1+'QueueId']=_0x599c60['id'];return db[_0x2a10a1+_0x2eae('0x6a')]['create'](_0x4a3f59);})[_0x2eae('0xa')](function(){return respondWithRpcPromise(_0x2eae('0x6b'),{'channel':_0x41f06b,'interaction':_0x5a0c02[_0x2eae('0x63')],'message':_0x5a0c02,'account':_0x5a0c02['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x599c60['name']+','+(_0x5a0c02[_0x2eae('0x64')][_0x2eae('0x6c')]||0x12c),'interval':_0x2eae('0x6d')}]},routingClient);})[_0x2eae('0xa')](respondWithResult(_0x52895d,null))[_0x2eae('0xe')](handleError(_0x52895d,null));};};exports[_0x2eae('0x6e')]=function(_0x1e6663,_0x4e6d58){var _0x5dc886,_0x4b0fcc;if(_[_0x2eae('0x14')](_0x1e6663[_0x2eae('0x30')]['channel'])){throw new Error(_0x2eae('0x6f'));}var _0x4d81c3=_0x1e6663[_0x2eae('0x30')][_0x2eae('0x70')];var _0x4c9a07=_['capitalize'](_0x4d81c3);var _0x50903a=_0x4d81c3===_0x2eae('0x5e')?_0x2eae('0x71'):_0x2eae('0x64');return db['User'][_0x2eae('0x60')]({'raw':!![],'where':{'id':_0x1e6663[_0x2eae('0x1d')]['id'],'role':_0x2eae('0x3d')}})[_0x2eae('0xa')](function(_0x2ff51e){if(_[_0x2eae('0x14')](_0x2ff51e)){throw new Error(_0x2eae('0x72'));}_0x5dc886=_0x2ff51e;return db[_0x4c9a07+_0x2eae('0x61')][_0x2eae('0x60')]({'where':{'id':_0x1e6663[_0x2eae('0x30')]['messageId']},'include':[{'model':db[_0x4c9a07+_0x2eae('0x63')],'as':_0x2eae('0x63')},{'model':db[_0x4c9a07+_0x50903a],'as':_0x2eae('0x64')}]});})[_0x2eae('0xa')](function(_0x11c46b){if(_[_0x2eae('0x14')](_0x11c46b)){throw new Error(_0x4c9a07+_0x2eae('0x65'));}_0x4b0fcc=_0x11c46b;return _0x11c46b[_0x2eae('0x66')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2eae('0xa')](function(){var _0x24fae7={'uniqueid':_0x4d81c3+'.'+_0x4b0fcc['id']+'.'+_0x4b0fcc[_0x2eae('0x63')]['id'],'FromUserId':_0x1e6663[_0x2eae('0x31')]['id'],'type':'queue','ToUserId':_0x5dc886['id']};_0x24fae7[_0x4c9a07+_0x2eae('0x68')]=_0x4b0fcc['id'];_0x24fae7[_0x4c9a07+'InteractionId']=_0x4b0fcc[_0x2eae('0x63')]['id'];_0x24fae7[_0x2eae('0x69')+_0x4c9a07+_0x50903a+'Id']=_0x4b0fcc[_0x2eae('0x64')]['id'];return db[_0x4c9a07+_0x2eae('0x6a')][_0x2eae('0x73')](_0x24fae7);})[_0x2eae('0xa')](function(){return respondWithRpcPromise(_0x2eae('0x6b'),{'channel':_0x4d81c3,'interaction':_0x4b0fcc[_0x2eae('0x63')],'message':_0x4b0fcc,'account':_0x4b0fcc[_0x2eae('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2eae('0x3d'),'appdata':_0x5dc886[_0x2eae('0x11')]+','+(_0x4b0fcc[_0x2eae('0x64')][_0x2eae('0x74')]||0x12c),'interval':_0x2eae('0x6d')}]},routingClient);})[_0x2eae('0xa')](respondWithResult(_0x4e6d58,null))[_0x2eae('0xe')](handleError(_0x4e6d58,null));}; \ No newline at end of file +var _0x2dc5=['../../config/logger','api','client','http','request','then','error','code','message','result','catch','status','json','sendStatus','stack','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','name','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','capacity','Telephones','trunks','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','TransferReport','create','Start','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','findOne','Agent\x20not\x20found','bluebird','moment','lodash','../../mysqldb'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0x2dc5,0x1d0));var _0x52dc=function(_0x2cca91,_0x4b88ca){_0x2cca91=_0x2cca91-0x0;var _0x50ac46=_0x2dc5[_0x2cca91];return _0x50ac46;};'use strict';var BPromise=require(_0x52dc('0x0'));var moment=require(_0x52dc('0x1'));var _=require(_0x52dc('0x2'));var util=require('util');var db=require(_0x52dc('0x3'))['db'];var logger=require(_0x52dc('0x4'))(_0x52dc('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x52dc('0x6')][_0x52dc('0x7')]({'port':0x232a});var mailClient=jayson['client'][_0x52dc('0x7')]({'port':0x232b});var routingClient=jayson[_0x52dc('0x6')][_0x52dc('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x256a00,_0x2071a5,_0xf8f3d6){return new BPromise(function(_0x40121f,_0x1243cf){var _0x3f5030=_0xf8f3d6?_0xf8f3d6:amiClient;return _0x3f5030[_0x52dc('0x8')](_0x256a00,_0x2071a5)[_0x52dc('0x9')](function(_0x3bdbcb){if(_0x3bdbcb[_0x52dc('0xa')]){if(_0x3bdbcb[_0x52dc('0xa')][_0x52dc('0xb')]===0x1f4){return _0x1243cf(_0x3bdbcb['error'][_0x52dc('0xc')]);}return _0x40121f(_0x3bdbcb[_0x52dc('0xa')][_0x52dc('0xc')]);}else{_0x40121f(_0x3bdbcb[_0x52dc('0xd')]);}})[_0x52dc('0xe')](function(_0x5898f4){_0x1243cf(_0x5898f4);});});}function respondWithResult(_0x468939,_0xd3d350){_0xd3d350=_0xd3d350||0xc8;return function(_0x85f244){if(_0x85f244){return _0x468939[_0x52dc('0xf')](_0xd3d350)[_0x52dc('0x10')](_0x85f244);}return _0x468939[_0x52dc('0x11')](0x194);};}function handleError(_0x5eaafa,_0x14b977){_0x14b977=_0x14b977||0x1f4;return function(_0x3d516f){logger[_0x52dc('0xa')](_0x3d516f[_0x52dc('0x12')]);if(_0x3d516f['name']){delete _0x3d516f['name'];}_0x5eaafa[_0x52dc('0xf')](_0x14b977)[_0x52dc('0x13')](_0x3d516f);};}function findById(_0x9d35c0){return function(_0x9d3c32){if(!_[_0x52dc('0x14')](_0x9d35c0)&&!_[_0x52dc('0x14')](_0x9d3c32)&&!_[_0x52dc('0x14')](_0x9d3c32[_0x52dc('0x15')])){return _[_0x52dc('0x16')](_0x9d3c32['rows'],function(_0x254da5){return _0x254da5['id']==_0x9d35c0;});}return null;};}exports[_0x52dc('0x17')]=function(_0x92bc4b,_0x523486){return respondWithRpcPromise(_0x52dc('0x18'),_0x92bc4b[_0x52dc('0x19')])[_0x52dc('0x9')](respondWithResult(_0x523486,null))[_0x52dc('0xe')](handleError(_0x523486,null));};exports[_0x52dc('0x1a')]=function(_0x1f555a,_0xb413b3){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x52dc('0x1b')](_0x1f555a[_0x52dc('0x19')],_0x1f555a[_0x52dc('0x1c')]))[_0x52dc('0x9')](respondWithResult(_0xb413b3,null))[_0x52dc('0xe')](handleError(_0xb413b3,null));};exports[_0x52dc('0x1d')]=function(_0x47f21c,_0x52d0df){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x52dc('0x1b')](_0x47f21c[_0x52dc('0x19')],_0x47f21c['params']))[_0x52dc('0x9')](respondWithResult(_0x52d0df,null))[_0x52dc('0xe')](handleError(_0x52d0df,null));};exports[_0x52dc('0x1e')]=function(_0x113072,_0x4df94f){return respondWithRpcPromise(_0x52dc('0x1f'),_0x113072['query'])[_0x52dc('0x9')](respondWithResult(_0x4df94f,null))[_0x52dc('0xe')](handleError(_0x4df94f,null));};exports[_0x52dc('0x20')]=function(_0x31ca5f,_0x5e4c68){return respondWithRpcPromise(_0x52dc('0x1f'),_0x31ca5f['query'])['then'](findById(_0x31ca5f[_0x52dc('0x1c')]['id']))[_0x52dc('0x9')](respondWithResult(_0x5e4c68,null))[_0x52dc('0xe')](handleError(_0x5e4c68,null));};exports[_0x52dc('0x21')]=function(_0x3d6317,_0x51fc77){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x52dc('0x1b')](_0x3d6317[_0x52dc('0x19')],_0x3d6317[_0x52dc('0x1c')]))[_0x52dc('0x9')](respondWithResult(_0x51fc77,null))[_0x52dc('0xe')](handleError(_0x51fc77,null));};exports[_0x52dc('0x22')]=function(_0x2decb0,_0x1b5d7a){return respondWithRpcPromise(_0x52dc('0x23'),_0x2decb0['query'])[_0x52dc('0x9')](respondWithResult(_0x1b5d7a,null))[_0x52dc('0xe')](handleError(_0x1b5d7a,null));};exports[_0x52dc('0x24')]=function(_0x53a1db,_0x36578b){return respondWithRpcPromise(_0x52dc('0x25'),_[_0x52dc('0x1b')](_0x53a1db[_0x52dc('0x19')],_0x53a1db[_0x52dc('0x1c')]))['then'](respondWithResult(_0x36578b,null))[_0x52dc('0xe')](handleError(_0x36578b,null));};exports[_0x52dc('0x26')]=function(_0x21caf0,_0x185035){return respondWithRpcPromise(_0x52dc('0x27'),_['merge'](_0x21caf0[_0x52dc('0x19')],_0x21caf0[_0x52dc('0x1c')]))[_0x52dc('0x9')](respondWithResult(_0x185035,null))[_0x52dc('0xe')](handleError(_0x185035,null));};exports[_0x52dc('0x28')]=function(_0x59f234,_0x277343){return respondWithRpcPromise(_0x52dc('0x29'),_[_0x52dc('0x1b')](_0x59f234['query'],_0x59f234[_0x52dc('0x1c')]))[_0x52dc('0x9')](respondWithResult(_0x277343,null))[_0x52dc('0xe')](handleError(_0x277343,null));};exports['outbound']=function(_0x1ef5a1,_0x39ad1){return respondWithRpcPromise(_0x52dc('0x2a'),_0x1ef5a1['query'])[_0x52dc('0x9')](respondWithResult(_0x39ad1,null))['catch'](handleError(_0x39ad1,null));};exports[_0x52dc('0x2b')]=function(_0x4a285e,_0x4dc4d7){return respondWithRpcPromise(_0x52dc('0x2c'),_0x4a285e[_0x52dc('0x19')])[_0x52dc('0x9')](respondWithResult(_0x4dc4d7,null))[_0x52dc('0xe')](handleError(_0x4dc4d7,null));};exports[_0x52dc('0x2d')]=function(_0x2b7d9b,_0x3fc50b){var _0x401ed2;return respondWithRpcPromise(_0x52dc('0x2e'),_0x2b7d9b[_0x52dc('0x19')])['then'](function(_0x289f35){_0x401ed2=_0x289f35;return respondWithRpcPromise('Agents',_0x2b7d9b['query'],routingClient);})['then'](function(_0x1d83aa){return _[_0x52dc('0x1b')]({},_0x1d83aa,_0x401ed2);})[_0x52dc('0x9')](respondWithResult(_0x3fc50b,null))[_0x52dc('0xe')](handleError(_0x3fc50b,null));};exports[_0x52dc('0x2f')]=function(_0x4974a5,_0x1a6051){if(_0x4974a5['body']&&_0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')]&&_0x4974a5[_0x52dc('0x32')]&&_0x4974a5[_0x52dc('0x32')]['name']){for(var _0xc8c9e0 in _0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')]){if(_0x4974a5[_0x52dc('0x30')]['interaction']['hasOwnProperty'](_0xc8c9e0)){db[_0x52dc('0x33')][_0x52dc('0x34')]({'where':{'channel':_0xc8c9e0,'membername':_0x4974a5[_0x52dc('0x32')][_0x52dc('0x35')],'type':_0x52dc('0x36'),'exitAt':null,'uniqueid':_0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')][_0xc8c9e0]&&_0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')][_0xc8c9e0][_0x52dc('0x37')]?{'$notIn':_0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')][_0xc8c9e0]}:{'$ne':null}}})[_0x52dc('0x9')](function(_0x46a6ad){var _0x320490=moment()[_0x52dc('0x38')](_0x52dc('0x39'));for(var _0x360429=0x0,_0x53775c=_0x46a6ad['length'];_0x360429<_0x53775c;_0x360429+=0x1){_0x46a6ad[_0x360429][_0x52dc('0x3a')]({'exitAt':_0x320490});}});for(var _0x31ddb6=0x0;_0x31ddb6<_0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')][_0xc8c9e0][_0x52dc('0x37')];_0x31ddb6+=0x1){db[_0x52dc('0x33')][_0x52dc('0x3b')]({'where':{'channel':_0xc8c9e0,'membername':_0x4974a5[_0x52dc('0x32')][_0x52dc('0x35')],'type':_0x52dc('0x36'),'uniqueid':_0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')][_0xc8c9e0][_0x31ddb6],'exitAt':null},'defaults':{'channel':_0xc8c9e0,'membername':_0x4974a5[_0x52dc('0x32')][_0x52dc('0x35')],'interface':_[_0x52dc('0x14')](_0x4974a5[_0x52dc('0x32')][_0x52dc('0x3c')])?util[_0x52dc('0x38')](_0x52dc('0x3d'),_0x4974a5[_0x52dc('0x32')][_0x52dc('0x35')]):_0x4974a5[_0x52dc('0x32')]['interface'],'type':_0x52dc('0x36'),'enterAt':moment()['format'](_0x52dc('0x39')),'role':_0x52dc('0x3e'),'internal':_0x4974a5[_0x52dc('0x32')]['internal'],'uniqueid':_0x4974a5[_0x52dc('0x30')][_0x52dc('0x31')][_0xc8c9e0][_0x31ddb6]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x4974a5['params']['id'],'capacity':_0x4974a5[_0x52dc('0x30')][_0x52dc('0x3f')]},routingClient)[_0x52dc('0x9')](respondWithResult(_0x1a6051,null))[_0x52dc('0xe')](handleError(_0x1a6051,null));};exports['telephones']=function(_0x30a643,_0x318b75){return respondWithRpcPromise(_0x52dc('0x40'),_0x30a643[_0x52dc('0x19')])['then'](respondWithResult(_0x318b75,null))[_0x52dc('0xe')](handleError(_0x318b75,null));};exports[_0x52dc('0x41')]=function(_0x27247c,_0x46af03){return respondWithRpcPromise(_0x52dc('0x42'),_0x27247c[_0x52dc('0x19')])[_0x52dc('0x9')](respondWithResult(_0x46af03,null))[_0x52dc('0xe')](handleError(_0x46af03,null));};exports['campaigns']=function(_0x47fc79,_0x5cbf3c){return respondWithRpcPromise(_0x52dc('0x43'),_0x47fc79[_0x52dc('0x19')])['then'](respondWithResult(_0x5cbf3c,null))['catch'](handleError(_0x5cbf3c,null));};exports[_0x52dc('0x44')]=function(_0x275984,_0x29aaff){return respondWithRpcPromise(_0x52dc('0x45'),_0x275984[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](respondWithResult(_0x29aaff,null))['catch'](handleError(_0x29aaff,null));};exports[_0x52dc('0x46')]=function(_0x1ff6b2,_0x202e55){return respondWithRpcPromise(_0x52dc('0x45'),_0x1ff6b2['query'],routingClient)['then'](findById(_0x1ff6b2[_0x52dc('0x1c')]['id']))['then'](respondWithResult(_0x202e55,null))[_0x52dc('0xe')](handleError(_0x202e55,null));};exports[_0x52dc('0x47')]=function(_0x94f42f,_0x3f6889){return respondWithRpcPromise(_0x52dc('0x48'),_0x94f42f[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](respondWithResult(_0x3f6889,null))[_0x52dc('0xe')](handleError(_0x3f6889,null));};exports[_0x52dc('0x49')]=function(_0x5142a5,_0x575751){return respondWithRpcPromise(_0x52dc('0x48'),_0x5142a5[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](findById(_0x5142a5['params']['id']))[_0x52dc('0x9')](respondWithResult(_0x575751,null))[_0x52dc('0xe')](handleError(_0x575751,null));};exports[_0x52dc('0x4a')]=function(_0x531614,_0x20fd68){return respondWithRpcPromise('MailAccounts',_0x531614[_0x52dc('0x19')],mailClient)[_0x52dc('0x9')](respondWithResult(_0x20fd68,null))['catch'](handleError(_0x20fd68,null));};exports[_0x52dc('0x4b')]=function(_0x5163a8,_0x41cd21){return respondWithRpcPromise(_0x52dc('0x4c'),_0x5163a8['query'],routingClient)[_0x52dc('0x9')](respondWithResult(_0x41cd21,null))[_0x52dc('0xe')](handleError(_0x41cd21,null));};exports[_0x52dc('0x4d')]=function(_0x493b63,_0x84c332){return respondWithRpcPromise(_0x52dc('0x4c'),_0x493b63['query'],routingClient)[_0x52dc('0x9')](findById(_0x493b63[_0x52dc('0x1c')]['id']))[_0x52dc('0x9')](respondWithResult(_0x84c332,null))['catch'](handleError(_0x84c332,null));};exports[_0x52dc('0x4e')]=function(_0xf8365e,_0x4bd8e5){return respondWithRpcPromise('SmsQueues',_0xf8365e['query'],routingClient)['then'](respondWithResult(_0x4bd8e5,null))[_0x52dc('0xe')](handleError(_0x4bd8e5,null));};exports['showSmsQueues']=function(_0x18eec7,_0x47a79c){return respondWithRpcPromise(_0x52dc('0x4f'),_0x18eec7[_0x52dc('0x19')],routingClient)['then'](findById(_0x18eec7[_0x52dc('0x1c')]['id']))[_0x52dc('0x9')](respondWithResult(_0x47a79c,null))[_0x52dc('0xe')](handleError(_0x47a79c,null));};exports[_0x52dc('0x50')]=function(_0xbe8a7b,_0xe223da){return respondWithRpcPromise(_0x52dc('0x51'),_0xbe8a7b[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](respondWithResult(_0xe223da,null))[_0x52dc('0xe')](handleError(_0xe223da,null));};exports[_0x52dc('0x52')]=function(_0x2371d5,_0x5a0cbb){return respondWithRpcPromise(_0x52dc('0x51'),_0x2371d5[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](findById(_0x2371d5[_0x52dc('0x1c')]['id']))[_0x52dc('0x9')](respondWithResult(_0x5a0cbb,null))[_0x52dc('0xe')](handleError(_0x5a0cbb,null));};exports[_0x52dc('0x53')]=function(_0x3e9e0c,_0x37f86a){return respondWithRpcPromise(_0x52dc('0x54'),_0x3e9e0c[_0x52dc('0x19')])['then'](respondWithResult(_0x37f86a,null))['catch'](handleError(_0x37f86a,null));};exports[_0x52dc('0x55')]=function(_0x4db1d1,_0xddfa3a){return respondWithRpcPromise(_0x52dc('0x56'),_0x4db1d1[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](respondWithResult(_0xddfa3a,null))['catch'](handleError(_0xddfa3a,null));};exports[_0x52dc('0x57')]=function(_0x4c3757,_0x382a13){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x4c3757['query'],routingClient)[_0x52dc('0x9')](respondWithResult(_0x382a13,null))[_0x52dc('0xe')](handleError(_0x382a13,null));};exports[_0x52dc('0x58')]=function(_0x3e1d68,_0x5765fa){return respondWithRpcPromise(_0x52dc('0x59'),_0x3e1d68[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](respondWithResult(_0x5765fa,null))[_0x52dc('0xe')](handleError(_0x5765fa,null));};exports['smsQueuesWaitingInteractions']=function(_0x16001a,_0x583500){return respondWithRpcPromise(_0x52dc('0x5a'),_0x16001a['query'],routingClient)[_0x52dc('0x9')](respondWithResult(_0x583500,null))[_0x52dc('0xe')](handleError(_0x583500,null));};exports[_0x52dc('0x5b')]=function(_0x53c8f2,_0x234c7f){return respondWithRpcPromise(_0x52dc('0x5c'),_0x53c8f2[_0x52dc('0x19')],routingClient)[_0x52dc('0x9')](respondWithResult(_0x234c7f,null))['catch'](handleError(_0x234c7f,null));};exports[_0x52dc('0x5d')]=function(_0x44766b){return function(_0x1d1dbe,_0x1b1f50){var _0x57aab5,_0x4f3588;var _0x5917ad=_[_0x52dc('0x5e')](_0x44766b);var _0x2274e6=_0x44766b===_0x52dc('0x5f')?_0x52dc('0x60'):_0x52dc('0x61');return db[_0x5917ad+_0x52dc('0x62')]['findOne']({'raw':!![],'where':{'id':_0x1d1dbe[_0x52dc('0x1c')]['id']}})[_0x52dc('0x9')](function(_0x502bc8){if(_[_0x52dc('0x14')](_0x502bc8)){throw new Error(_0x5917ad+_0x52dc('0x63'));}_0x57aab5=_0x502bc8;return db[_0x5917ad+_0x52dc('0x64')]['findOne']({'where':{'id':_0x1d1dbe[_0x52dc('0x30')][_0x52dc('0x65')]},'include':[{'model':db[_0x5917ad+_0x52dc('0x66')],'as':_0x52dc('0x66')},{'model':db[_0x5917ad+_0x2274e6],'as':_0x52dc('0x61')}]});})['then'](function(_0x333f80){if(_[_0x52dc('0x14')](_0x333f80)){throw new Error(_0x5917ad+_0x52dc('0x67'));}_0x4f3588=_0x333f80;return _0x333f80[_0x52dc('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x52dc('0x9')](function(){var _0x215fa3={'uniqueid':_0x44766b+'.'+_0x4f3588['id']+'.'+_0x4f3588['Interaction']['id'],'FromUserId':_0x1d1dbe[_0x52dc('0x32')]['id'],'type':_0x52dc('0x69')};_0x215fa3[_0x5917ad+_0x52dc('0x6a')]=_0x4f3588['id'];_0x215fa3[_0x5917ad+_0x52dc('0x6b')]=_0x4f3588[_0x52dc('0x66')]['id'];_0x215fa3['From'+_0x5917ad+_0x2274e6+'Id']=_0x4f3588[_0x52dc('0x61')]['id'];_0x215fa3['To'+_0x5917ad+'QueueId']=_0x57aab5['id'];return db[_0x5917ad+_0x52dc('0x6c')][_0x52dc('0x6d')](_0x215fa3);})[_0x52dc('0x9')](function(){return respondWithRpcPromise(_0x52dc('0x6e'),{'channel':_0x44766b,'interaction':_0x4f3588[_0x52dc('0x66')],'message':_0x4f3588,'account':_0x4f3588[_0x52dc('0x61')],'applications':[{'id':0x0,'priority':0x1,'app':_0x52dc('0x69'),'appdata':_0x57aab5[_0x52dc('0x35')]+','+(_0x4f3588['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x52dc('0x9')](respondWithResult(_0x1b1f50,null))['catch'](handleError(_0x1b1f50,null));};};exports[_0x52dc('0x6f')]=function(_0x516404,_0x5373b8){var _0x2de07b,_0x8c3210;if(_['isNil'](_0x516404[_0x52dc('0x30')]['channel'])){throw new Error(_0x52dc('0x70'));}var _0x58ab80=_0x516404[_0x52dc('0x30')][_0x52dc('0x71')];var _0x155320=_[_0x52dc('0x5e')](_0x58ab80);var _0x241cab=_0x58ab80===_0x52dc('0x5f')?_0x52dc('0x60'):_0x52dc('0x61');return db[_0x52dc('0x72')][_0x52dc('0x73')]({'raw':!![],'where':{'id':_0x516404[_0x52dc('0x1c')]['id'],'role':_0x52dc('0x3e')}})[_0x52dc('0x9')](function(_0x105d56){if(_[_0x52dc('0x14')](_0x105d56)){throw new Error(_0x52dc('0x74'));}_0x2de07b=_0x105d56;return db[_0x155320+_0x52dc('0x64')][_0x52dc('0x73')]({'where':{'id':_0x516404[_0x52dc('0x30')]['messageId']},'include':[{'model':db[_0x155320+_0x52dc('0x66')],'as':_0x52dc('0x66')},{'model':db[_0x155320+_0x241cab],'as':_0x52dc('0x61')}]});})['then'](function(_0x416468){if(_[_0x52dc('0x14')](_0x416468)){throw new Error(_0x155320+_0x52dc('0x67'));}_0x8c3210=_0x416468;return _0x416468[_0x52dc('0x68')]({'read':0x0,'readAt':null,'UserId':null});})[_0x52dc('0x9')](function(){var _0x583a8a={'uniqueid':_0x58ab80+'.'+_0x8c3210['id']+'.'+_0x8c3210['Interaction']['id'],'FromUserId':_0x516404['user']['id'],'type':_0x52dc('0x69'),'ToUserId':_0x2de07b['id']};_0x583a8a[_0x155320+_0x52dc('0x6a')]=_0x8c3210['id'];_0x583a8a[_0x155320+_0x52dc('0x6b')]=_0x8c3210[_0x52dc('0x66')]['id'];_0x583a8a['From'+_0x155320+_0x241cab+'Id']=_0x8c3210[_0x52dc('0x61')]['id'];return db[_0x155320+_0x52dc('0x6c')][_0x52dc('0x6d')](_0x583a8a);})[_0x52dc('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x58ab80,'interaction':_0x8c3210[_0x52dc('0x66')],'message':_0x8c3210,'account':_0x8c3210['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x52dc('0x3e'),'appdata':_0x2de07b[_0x52dc('0x35')]+','+(_0x8c3210[_0x52dc('0x61')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x52dc('0x9')](respondWithResult(_0x5373b8,null))['catch'](handleError(_0x5373b8,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d7bf06b..e729b58 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 _0x909c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/run','run','post','create','/:id','update','delete','multer','util'];(function(_0x5116bc,_0x1b2c2e){var _0x115397=function(_0x46a78a){while(--_0x46a78a){_0x5116bc['push'](_0x5116bc['shift']());}};_0x115397(++_0x1b2c2e);}(_0x909c,0x11e));var _0xc909=function(_0x7e705f,_0x3162ca){_0x7e705f=_0x7e705f-0x0;var _0x5bce16=_0x909c[_0x7e705f];return _0x5bce16;};'use strict';var multer=require(_0xc909('0x0'));var util=require(_0xc909('0x1'));var path=require('path');var timeout=require(_0xc909('0x2'));var express=require(_0xc909('0x3'));var router=express[_0xc909('0x4')]();var auth=require(_0xc909('0x5'));var interaction=require(_0xc909('0x6'));var config=require(_0xc909('0x7'));var controller=require('./schedule.controller');router[_0xc909('0x8')]('/',auth[_0xc909('0x9')](),controller[_0xc909('0xa')]);router['get']('/:id',auth[_0xc909('0x9')](),controller['show']);router[_0xc909('0x8')](_0xc909('0xb'),auth['isAuthenticated'](),controller[_0xc909('0xc')]);router[_0xc909('0xd')]('/',auth[_0xc909('0x9')](),controller[_0xc909('0xe')]);router['put'](_0xc909('0xf'),auth['isAuthenticated'](),controller[_0xc909('0x10')]);router[_0xc909('0x11')](_0xc909('0xf'),auth[_0xc909('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xfbd6=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','run','put','/:id','update'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xfbd6,0x88));var _0x6fbd=function(_0x2073d0,_0x3f6b1d){_0x2073d0=_0x2073d0-0x0;var _0x39856a=_0xfbd6[_0x2073d0];return _0x39856a;};'use strict';var multer=require(_0x6fbd('0x0'));var util=require(_0x6fbd('0x1'));var path=require(_0x6fbd('0x2'));var timeout=require('connect-timeout');var express=require(_0x6fbd('0x3'));var router=express[_0x6fbd('0x4')]();var auth=require(_0x6fbd('0x5'));var interaction=require(_0x6fbd('0x6'));var config=require(_0x6fbd('0x7'));var controller=require(_0x6fbd('0x8'));router[_0x6fbd('0x9')]('/',auth[_0x6fbd('0xa')](),controller[_0x6fbd('0xb')]);router[_0x6fbd('0x9')]('/:id',auth[_0x6fbd('0xa')](),controller['show']);router['get']('/:id/run',auth[_0x6fbd('0xa')](),controller[_0x6fbd('0xc')]);router['post']('/',auth[_0x6fbd('0xa')](),controller['create']);router[_0x6fbd('0xd')](_0x6fbd('0xe'),auth[_0x6fbd('0xa')](),controller[_0x6fbd('0xf')]);router[_0x6fbd('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x6fbd('0x11')]);module[_0x6fbd('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index bbfe9b1..74a8f37 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 _0x4489=['ENUM','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','quarters','weeks','hours','minutes','days','xlsx','csv'];(function(_0x6f7453,_0xe0cf17){var _0x1e81a6=function(_0x5a19c2){while(--_0x5a19c2){_0x6f7453['push'](_0x6f7453['shift']());}};_0x1e81a6(++_0xe0cf17);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9448('0x0'));module[_0x9448('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9448('0x2')]},'active':{'type':Sequelize[_0x9448('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9448('0x2')],'allowNull':![],'defaultValue':_0x9448('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x9448('0x5'),'months',_0x9448('0x6'),'days',_0x9448('0x7'),_0x9448('0x8')),'allowNull':![],'defaultValue':_0x9448('0x9')},'output':{'type':Sequelize['ENUM']('csv','pdf',_0x9448('0xa')),'allowNull':![],'defaultValue':_0x9448('0xb')},'type':{'type':Sequelize[_0x9448('0xc')](_0x9448('0xd'),_0x9448('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x9448('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9448('0x2')]},'cc':{'type':Sequelize[_0x9448('0xf')]},'bcc':{'type':Sequelize[_0x9448('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x9448('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xd1f9=['weeks','days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','quarters','months'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xd1f9,0x88));var _0x9d1f=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0xd1f9[_0x45783c];return _0x1161da;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d1f('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0x9d1f('0x0')]},'active':{'type':Sequelize[_0x9d1f('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9d1f('0x0')],'allowNull':![],'defaultValue':_0x9d1f('0x2')},'startAt':{'type':Sequelize[_0x9d1f('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9d1f('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9d1f('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9d1f('0x5')]('years',_0x9d1f('0x6'),_0x9d1f('0x7'),_0x9d1f('0x8'),_0x9d1f('0x9'),_0x9d1f('0xa'),_0x9d1f('0xb')),'allowNull':![],'defaultValue':_0x9d1f('0x9')},'output':{'type':Sequelize[_0x9d1f('0x5')](_0x9d1f('0xc'),_0x9d1f('0xd'),_0x9d1f('0xe')),'allowNull':![],'defaultValue':_0x9d1f('0xc')},'type':{'type':Sequelize[_0x9d1f('0x5')](_0x9d1f('0xf'),_0x9d1f('0x10')),'allowNull':![],'defaultValue':_0x9d1f('0xf')},'sendMail':{'type':Sequelize[_0x9d1f('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0x9d1f('0x0')]},'cc':{'type':Sequelize[_0x9d1f('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x9d1f('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 94ecedd..6d7584e 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 _0x4eea=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','map','Schedule','rawAttributes','key','model','keys','filters','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x4eea,0x196));var _0xa4ee=function(_0x47d975,_0x3ab09d){_0x47d975=_0x47d975-0x0;var _0x437b99=_0x4eea[_0x47d975];return _0x437b99;};'use strict';var pdf=require(_0xa4ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa4ee('0x1'));var zipdir=require(_0xa4ee('0x2'));var jsonpatch=require(_0xa4ee('0x3'));var rp=require(_0xa4ee('0x4'));var moment=require(_0xa4ee('0x5'));var BPromise=require(_0xa4ee('0x6'));var Mustache=require(_0xa4ee('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa4ee('0x8'));var csv=require(_0xa4ee('0x9'));var ejs=require(_0xa4ee('0xa'));var fs=require('fs');var _=require(_0xa4ee('0xb'));var squel=require(_0xa4ee('0xc'));var crypto=require(_0xa4ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa4ee('0xe'));var toCsv=require(_0xa4ee('0x9'));var querystring=require('querystring');var Papa=require(_0xa4ee('0xf'));var Redis=require(_0xa4ee('0x10'));var authService=require(_0xa4ee('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa4ee('0x12'));var hardwareService=require(_0xa4ee('0x13'));var logger=require(_0xa4ee('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa4ee('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac2de,_0x5afe26){_0x5afe26=_0x5afe26||0xcc;return function(_0x21dc94){if(_0x21dc94){return _0x1ac2de[_0xa4ee('0x16')](_0x5afe26);}return _0x1ac2de['status'](_0x5afe26)['end']();};}function respondWithResult(_0x4f0612,_0x32dd35){_0x32dd35=_0x32dd35||0xc8;return function(_0x28b818){if(_0x28b818){return _0x4f0612[_0xa4ee('0x17')](_0x32dd35)[_0xa4ee('0x18')](_0x28b818);}};}function respondWithFilteredResult(_0x21fc93,_0x112838){return function(_0x4975f3){if(_0x4975f3){var _0x46f3cf=_0x4975f3[_0xa4ee('0x19')],_0x18ed6d=_0x112838[_0xa4ee('0x1a')],_0x347e04=_0x112838[_0xa4ee('0x1a')]+_0x112838[_0xa4ee('0x1b')],_0x4cd48a;if(_0x347e04>=_0x46f3cf){_0x347e04=_0x46f3cf;_0x4cd48a=0xc8;}else{_0x4cd48a=0xce;}_0x21fc93['status'](_0x4cd48a);return _0x21fc93['set'](_0xa4ee('0x1c'),_0x18ed6d+'-'+_0x347e04+'/'+_0x46f3cf)['json'](_0x4975f3);}return null;};}function patchUpdates(_0x2b631b){return function(_0x1c4084){try{jsonpatch['apply'](_0x1c4084,_0x2b631b,!![]);}catch(_0x39b28f){return BPromise['reject'](_0x39b28f);}return _0x1c4084[_0xa4ee('0x1d')]();};}function saveUpdates(_0x5436f7,_0xdd3698){return function(_0x4251bc){if(_0x4251bc){return _0x4251bc[_0xa4ee('0x1e')](_0x5436f7)[_0xa4ee('0x1f')](function(_0x5abfea){return _0x5abfea;});}return null;};}function removeEntity(_0x319d9c,_0x59c0bf){return function(_0x570b61){if(_0x570b61){return _0x570b61[_0xa4ee('0x20')]()[_0xa4ee('0x1f')](function(){var _0x79ddb=_0x570b61[_0xa4ee('0x21')]({'plain':!![]});var _0x240343=_0xa4ee('0x22');return db[_0xa4ee('0x23')]['destroy']({'where':{'type':_0x240343,'resourceId':_0x79ddb['id']}})[_0xa4ee('0x1f')](function(){return _0x570b61;});})[_0xa4ee('0x1f')](function(){_0x319d9c[_0xa4ee('0x17')](0xcc)[_0xa4ee('0x24')]();});}};}function handleEntityNotFound(_0x49559b,_0x56ceec){return function(_0x4e013c){if(!_0x4e013c){_0x49559b[_0xa4ee('0x16')](0x194);}return _0x4e013c;};}function handleError(_0x28cb14,_0x1bd11f){_0x1bd11f=_0x1bd11f||0x1f4;return function(_0x2973fd){logger[_0xa4ee('0x25')](_0x2973fd[_0xa4ee('0x26')]);if(_0x2973fd[_0xa4ee('0x27')]){delete _0x2973fd[_0xa4ee('0x27')];}_0x28cb14[_0xa4ee('0x17')](_0x1bd11f)['send'](_0x2973fd);};}exports['index']=function(_0x4e6178,_0x29f198){var _0x3902da={},_0x3a61a7={},_0x536cd5={'count':0x0,'rows':[]};var _0x1ffc50=_[_0xa4ee('0x28')](db[_0xa4ee('0x29')][_0xa4ee('0x2a')],function(_0x5abb7b){return{'name':_0x5abb7b['fieldName'],'type':_0x5abb7b['type'][_0xa4ee('0x2b')]};});_0x3a61a7[_0xa4ee('0x2c')]=_[_0xa4ee('0x28')](_0x1ffc50,_0xa4ee('0x27'));_0x3a61a7['query']=_[_0xa4ee('0x2d')](_0x4e6178['query']);_0x3a61a7[_0xa4ee('0x2e')]=_['intersection'](_0x3a61a7[_0xa4ee('0x2c')],_0x3a61a7['query']);_0x3902da[_0xa4ee('0x2f')]=_['intersection'](_0x3a61a7[_0xa4ee('0x2c')],qs[_0xa4ee('0x30')](_0x4e6178[_0xa4ee('0x31')]['fields']));_0x3902da[_0xa4ee('0x2f')]=_0x3902da[_0xa4ee('0x2f')][_0xa4ee('0x32')]?_0x3902da[_0xa4ee('0x2f')]:_0x3a61a7['model'];if(!_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x33')](_0xa4ee('0x34'))){_0x3902da[_0xa4ee('0x1b')]=qs[_0xa4ee('0x1b')](_0x4e6178[_0xa4ee('0x31')]['limit']);_0x3902da[_0xa4ee('0x1a')]=qs[_0xa4ee('0x1a')](_0x4e6178['query'][_0xa4ee('0x1a')]);}_0x3902da[_0xa4ee('0x35')]=qs[_0xa4ee('0x36')](_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x36')]);_0x3902da[_0xa4ee('0x37')]=qs[_0xa4ee('0x2e')](_[_0xa4ee('0x38')](_0x4e6178[_0xa4ee('0x31')],_0x3a61a7['filters']));if(_0x4e6178['query']['filter']){_0x3902da[_0xa4ee('0x37')]=_[_0xa4ee('0x39')](_0x3902da[_0xa4ee('0x37')],{'$or':_[_0xa4ee('0x28')](_0x1ffc50,function(_0x3b27aa){if(_0x3b27aa[_0xa4ee('0x3a')]!==_0xa4ee('0x3b')){var _0x3f1149={};_0x3f1149[_0x3b27aa[_0xa4ee('0x27')]]={'$like':'%'+_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x3c')]+'%'};return _0x3f1149;}})});}_0x3902da=_[_0xa4ee('0x39')]({},_0x3902da,_0x4e6178[_0xa4ee('0x3d')]);var _0x36a67f={'where':_0x3902da['where']};return db['Schedule'][_0xa4ee('0x19')](_0x36a67f)[_0xa4ee('0x1f')](function(_0xa25073){_0x536cd5[_0xa4ee('0x19')]=_0xa25073;if(_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x3e')]){_0x3902da[_0xa4ee('0x3f')]=[{'all':!![]}];}return db[_0xa4ee('0x29')]['findAll'](_0x3902da);})[_0xa4ee('0x1f')](function(_0x44b1bd){_0x536cd5['rows']=_0x44b1bd;return _0x536cd5;})[_0xa4ee('0x1f')](respondWithFilteredResult(_0x29f198,_0x3902da))[_0xa4ee('0x40')](handleError(_0x29f198,null));};exports[_0xa4ee('0x41')]=function(_0x502f7f,_0x1f7bbe){var _0x95f983={'raw':![],'where':{'id':_0x502f7f['params']['id']}},_0x41b34e={};_0x41b34e[_0xa4ee('0x2c')]=_['keys'](db[_0xa4ee('0x29')][_0xa4ee('0x2a')]);_0x41b34e['query']=_[_0xa4ee('0x2d')](_0x502f7f[_0xa4ee('0x31')]);_0x41b34e['filters']=_[_0xa4ee('0x42')](_0x41b34e[_0xa4ee('0x2c')],_0x41b34e[_0xa4ee('0x31')]);_0x95f983['attributes']=_[_0xa4ee('0x42')](_0x41b34e[_0xa4ee('0x2c')],qs['fields'](_0x502f7f['query']['fields']));_0x95f983[_0xa4ee('0x2f')]=_0x95f983[_0xa4ee('0x2f')]['length']?_0x95f983['attributes']:_0x41b34e[_0xa4ee('0x2c')];if(_0x502f7f[_0xa4ee('0x31')][_0xa4ee('0x3e')]){_0x95f983['include']=[{'all':!![]}];}_0x95f983=_['merge']({},_0x95f983,_0x502f7f[_0xa4ee('0x3d')]);return db['Schedule'][_0xa4ee('0x43')](_0x95f983)['then'](handleEntityNotFound(_0x1f7bbe,null))[_0xa4ee('0x1f')](respondWithResult(_0x1f7bbe,null))[_0xa4ee('0x40')](handleError(_0x1f7bbe,null));};exports[_0xa4ee('0x44')]=function(_0x3bca19,_0x2c176e){return db[_0xa4ee('0x29')][_0xa4ee('0x44')](_0x3bca19[_0xa4ee('0x45')],{})[_0xa4ee('0x1f')](function(_0x2e676c){var _0x284c54=_0x3bca19[_0xa4ee('0x46')]['get']({'plain':!![]});if(!_0x284c54)throw new Error(_0xa4ee('0x47'));if(_0x284c54[_0xa4ee('0x48')]===_0xa4ee('0x46')){var _0x2710d8=_0x2e676c[_0xa4ee('0x21')]({'plain':!![]});var _0x2927e2=_0xa4ee('0x22');return db[_0xa4ee('0x49')][_0xa4ee('0x43')]({'where':{'name':_0x2927e2,'userProfileId':_0x284c54[_0xa4ee('0x4a')]},'raw':!![]})[_0xa4ee('0x1f')](function(_0x5c612d){if(_0x5c612d&&_0x5c612d[_0xa4ee('0x4b')]===0x0){return db[_0xa4ee('0x23')]['create']({'name':_0x2710d8[_0xa4ee('0x27')],'resourceId':_0x2710d8['id'],'type':_0x5c612d['name'],'sectionId':_0x5c612d['id']},{})[_0xa4ee('0x1f')](function(){return _0x2e676c;});}else{return _0x2e676c;}})['catch'](function(_0x139ff8){logger[_0xa4ee('0x25')](_0xa4ee('0x4c'),_0x139ff8);throw _0x139ff8;});}return _0x2e676c;})['then'](respondWithResult(_0x2c176e,0xc9))[_0xa4ee('0x40')](handleError(_0x2c176e,null));};exports['update']=function(_0x55a673,_0x1f2506){if(_0x55a673[_0xa4ee('0x45')]['id']){delete _0x55a673['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x55a673['params']['id']}})[_0xa4ee('0x1f')](handleEntityNotFound(_0x1f2506,null))[_0xa4ee('0x1f')](saveUpdates(_0x55a673['body'],null))[_0xa4ee('0x1f')](respondWithResult(_0x1f2506,null))['catch'](handleError(_0x1f2506,null));};exports[_0xa4ee('0x20')]=function(_0x4abeba,_0x487624){return db['Schedule'][_0xa4ee('0x43')]({'where':{'id':_0x4abeba[_0xa4ee('0x4d')]['id']}})[_0xa4ee('0x1f')](handleEntityNotFound(_0x487624,null))[_0xa4ee('0x1f')](removeEntity(_0x487624,null))[_0xa4ee('0x40')](handleError(_0x487624,null));};exports[_0xa4ee('0x4e')]=function(_0x972718,_0x235b5d,_0x5d59a3){var _0x214b7d=require(_0xa4ee('0x4f'));return db[_0xa4ee('0x29')]['find']({'where':{'id':_0x972718[_0xa4ee('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x235b5d,null))['then'](function(){_0x214b7d['run'](_0x972718['params']['id']);})[_0xa4ee('0x1f')](respondWithStatusCode(_0x235b5d,null))[_0xa4ee('0x40')](handleError(_0x235b5d,null));}; \ No newline at end of file +var _0xa7ba=['model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','count','include','findAll','rows','show','length','includeAll','merge','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','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','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Scheduler','end','error','stack','name','map','Schedule','rawAttributes','fieldName','type'];(function(_0x80789d,_0x372e63){var _0x56908e=function(_0xaf2a8b){while(--_0xaf2a8b){_0x80789d['push'](_0x80789d['shift']());}};_0x56908e(++_0x372e63);}(_0xa7ba,0x7c));var _0xaa7b=function(_0x2da7dd,_0x2acb15){_0x2da7dd=_0x2da7dd-0x0;var _0x5bdf2a=_0xa7ba[_0x2da7dd];return _0x5bdf2a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa7b('0x0'));var rimraf=require(_0xaa7b('0x1'));var zipdir=require(_0xaa7b('0x2'));var jsonpatch=require(_0xaa7b('0x3'));var rp=require('request-promise');var moment=require(_0xaa7b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaa7b('0x5'));var util=require(_0xaa7b('0x6'));var path=require(_0xaa7b('0x7'));var sox=require(_0xaa7b('0x8'));var csv=require(_0xaa7b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa7b('0xa'));var squel=require(_0xaa7b('0xb'));var crypto=require(_0xaa7b('0xc'));var jsforce=require(_0xaa7b('0xd'));var deskjs=require(_0xaa7b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaa7b('0xf'));var Papa=require(_0xaa7b('0x10'));var Redis=require(_0xaa7b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaa7b('0x12'));var as=require(_0xaa7b('0x13'));var hardwareService=require(_0xaa7b('0x14'));var logger=require(_0xaa7b('0x15'))('api');var utils=require(_0xaa7b('0x16'));var config=require(_0xaa7b('0x17'));var db=require(_0xaa7b('0x18'))['db'];function respondWithStatusCode(_0x252e2e,_0x324f78){_0x324f78=_0x324f78||0xcc;return function(_0x4e4b6f){if(_0x4e4b6f){return _0x252e2e['sendStatus'](_0x324f78);}return _0x252e2e['status'](_0x324f78)['end']();};}function respondWithResult(_0x15e662,_0x46668b){_0x46668b=_0x46668b||0xc8;return function(_0x20d636){if(_0x20d636){return _0x15e662[_0xaa7b('0x19')](_0x46668b)[_0xaa7b('0x1a')](_0x20d636);}};}function respondWithFilteredResult(_0x2daa4f,_0x1e1c9c){return function(_0x54db13){if(_0x54db13){var _0x2668e0=_0x54db13['count'],_0x4cdabf=_0x1e1c9c[_0xaa7b('0x1b')],_0x395f95=_0x1e1c9c[_0xaa7b('0x1b')]+_0x1e1c9c[_0xaa7b('0x1c')],_0x17b15d;if(_0x395f95>=_0x2668e0){_0x395f95=_0x2668e0;_0x17b15d=0xc8;}else{_0x17b15d=0xce;}_0x2daa4f[_0xaa7b('0x19')](_0x17b15d);return _0x2daa4f[_0xaa7b('0x1d')](_0xaa7b('0x1e'),_0x4cdabf+'-'+_0x395f95+'/'+_0x2668e0)[_0xaa7b('0x1a')](_0x54db13);}return null;};}function patchUpdates(_0xcf0998){return function(_0xc59aaf){try{jsonpatch[_0xaa7b('0x1f')](_0xc59aaf,_0xcf0998,!![]);}catch(_0x2d643f){return BPromise[_0xaa7b('0x20')](_0x2d643f);}return _0xc59aaf[_0xaa7b('0x21')]();};}function saveUpdates(_0x11e3c9,_0x30af2c){return function(_0x535b02){if(_0x535b02){return _0x535b02[_0xaa7b('0x22')](_0x11e3c9)[_0xaa7b('0x23')](function(_0x1ccc64){return _0x1ccc64;});}return null;};}function removeEntity(_0x1f11a2,_0x23fab8){return function(_0xc899db){if(_0xc899db){return _0xc899db[_0xaa7b('0x24')]()[_0xaa7b('0x23')](function(){var _0x3d28bb=_0xc899db[_0xaa7b('0x25')]({'plain':!![]});var _0x48972e=_0xaa7b('0x26');return db['UserProfileResource'][_0xaa7b('0x24')]({'where':{'type':_0x48972e,'resourceId':_0x3d28bb['id']}})['then'](function(){return _0xc899db;});})[_0xaa7b('0x23')](function(){_0x1f11a2['status'](0xcc)[_0xaa7b('0x27')]();});}};}function handleEntityNotFound(_0x3e4c0f,_0x2fd653){return function(_0x5848e3){if(!_0x5848e3){_0x3e4c0f['sendStatus'](0x194);}return _0x5848e3;};}function handleError(_0x3b8c1d,_0x4d0375){_0x4d0375=_0x4d0375||0x1f4;return function(_0x42fdc4){logger[_0xaa7b('0x28')](_0x42fdc4[_0xaa7b('0x29')]);if(_0x42fdc4[_0xaa7b('0x2a')]){delete _0x42fdc4[_0xaa7b('0x2a')];}_0x3b8c1d[_0xaa7b('0x19')](_0x4d0375)['send'](_0x42fdc4);};}exports['index']=function(_0x46a89b,_0x3bb6ae){var _0x3271a4={},_0x2d5c9c={},_0x2aeefa={'count':0x0,'rows':[]};var _0x4db78d=_[_0xaa7b('0x2b')](db[_0xaa7b('0x2c')][_0xaa7b('0x2d')],function(_0x59e731){return{'name':_0x59e731[_0xaa7b('0x2e')],'type':_0x59e731[_0xaa7b('0x2f')]['key']};});_0x2d5c9c[_0xaa7b('0x30')]=_[_0xaa7b('0x2b')](_0x4db78d,_0xaa7b('0x2a'));_0x2d5c9c[_0xaa7b('0x31')]=_[_0xaa7b('0x32')](_0x46a89b['query']);_0x2d5c9c[_0xaa7b('0x33')]=_[_0xaa7b('0x34')](_0x2d5c9c[_0xaa7b('0x30')],_0x2d5c9c['query']);_0x3271a4['attributes']=_[_0xaa7b('0x34')](_0x2d5c9c[_0xaa7b('0x30')],qs[_0xaa7b('0x35')](_0x46a89b[_0xaa7b('0x31')][_0xaa7b('0x35')]));_0x3271a4[_0xaa7b('0x36')]=_0x3271a4[_0xaa7b('0x36')]['length']?_0x3271a4[_0xaa7b('0x36')]:_0x2d5c9c[_0xaa7b('0x30')];if(!_0x46a89b[_0xaa7b('0x31')][_0xaa7b('0x37')](_0xaa7b('0x38'))){_0x3271a4['limit']=qs[_0xaa7b('0x1c')](_0x46a89b['query'][_0xaa7b('0x1c')]);_0x3271a4[_0xaa7b('0x1b')]=qs[_0xaa7b('0x1b')](_0x46a89b[_0xaa7b('0x31')][_0xaa7b('0x1b')]);}_0x3271a4[_0xaa7b('0x39')]=qs[_0xaa7b('0x3a')](_0x46a89b[_0xaa7b('0x31')][_0xaa7b('0x3a')]);_0x3271a4[_0xaa7b('0x3b')]=qs['filters'](_[_0xaa7b('0x3c')](_0x46a89b['query'],_0x2d5c9c['filters']));if(_0x46a89b['query'][_0xaa7b('0x3d')]){_0x3271a4[_0xaa7b('0x3b')]=_['merge'](_0x3271a4[_0xaa7b('0x3b')],{'$or':_[_0xaa7b('0x2b')](_0x4db78d,function(_0x2dfd09){if(_0x2dfd09[_0xaa7b('0x2f')]!==_0xaa7b('0x3e')){var _0x2a2948={};_0x2a2948[_0x2dfd09[_0xaa7b('0x2a')]]={'$like':'%'+_0x46a89b['query'][_0xaa7b('0x3d')]+'%'};return _0x2a2948;}})});}_0x3271a4=_['merge']({},_0x3271a4,_0x46a89b[_0xaa7b('0x3f')]);var _0x427655={'where':_0x3271a4[_0xaa7b('0x3b')]};return db[_0xaa7b('0x2c')][_0xaa7b('0x40')](_0x427655)[_0xaa7b('0x23')](function(_0x696cbe){_0x2aeefa[_0xaa7b('0x40')]=_0x696cbe;if(_0x46a89b[_0xaa7b('0x31')]['includeAll']){_0x3271a4[_0xaa7b('0x41')]=[{'all':!![]}];}return db[_0xaa7b('0x2c')][_0xaa7b('0x42')](_0x3271a4);})['then'](function(_0x539a97){_0x2aeefa[_0xaa7b('0x43')]=_0x539a97;return _0x2aeefa;})['then'](respondWithFilteredResult(_0x3bb6ae,_0x3271a4))['catch'](handleError(_0x3bb6ae,null));};exports[_0xaa7b('0x44')]=function(_0x214bbe,_0x498a92){var _0x1ff284={'raw':![],'where':{'id':_0x214bbe['params']['id']}},_0x1344cb={};_0x1344cb[_0xaa7b('0x30')]=_[_0xaa7b('0x32')](db[_0xaa7b('0x2c')][_0xaa7b('0x2d')]);_0x1344cb['query']=_[_0xaa7b('0x32')](_0x214bbe['query']);_0x1344cb[_0xaa7b('0x33')]=_['intersection'](_0x1344cb[_0xaa7b('0x30')],_0x1344cb[_0xaa7b('0x31')]);_0x1ff284['attributes']=_['intersection'](_0x1344cb[_0xaa7b('0x30')],qs['fields'](_0x214bbe[_0xaa7b('0x31')]['fields']));_0x1ff284[_0xaa7b('0x36')]=_0x1ff284[_0xaa7b('0x36')][_0xaa7b('0x45')]?_0x1ff284[_0xaa7b('0x36')]:_0x1344cb[_0xaa7b('0x30')];if(_0x214bbe[_0xaa7b('0x31')][_0xaa7b('0x46')]){_0x1ff284['include']=[{'all':!![]}];}_0x1ff284=_[_0xaa7b('0x47')]({},_0x1ff284,_0x214bbe[_0xaa7b('0x3f')]);return db[_0xaa7b('0x2c')][_0xaa7b('0x48')](_0x1ff284)[_0xaa7b('0x23')](handleEntityNotFound(_0x498a92,null))[_0xaa7b('0x23')](respondWithResult(_0x498a92,null))[_0xaa7b('0x49')](handleError(_0x498a92,null));};exports['create']=function(_0x57404a,_0x40828e){return db[_0xaa7b('0x2c')][_0xaa7b('0x4a')](_0x57404a['body'],{})[_0xaa7b('0x23')](function(_0x4d2518){var _0x481396=_0x57404a[_0xaa7b('0x4b')][_0xaa7b('0x25')]({'plain':!![]});if(!_0x481396)throw new Error(_0xaa7b('0x4c'));if(_0x481396[_0xaa7b('0x4d')]===_0xaa7b('0x4b')){var _0x261a67=_0x4d2518['get']({'plain':!![]});var _0x111a56=_0xaa7b('0x26');return db['UserProfileSection'][_0xaa7b('0x48')]({'where':{'name':_0x111a56,'userProfileId':_0x481396[_0xaa7b('0x4e')]},'raw':!![]})['then'](function(_0x337f85){if(_0x337f85&&_0x337f85[_0xaa7b('0x4f')]===0x0){return db[_0xaa7b('0x50')][_0xaa7b('0x4a')]({'name':_0x261a67['name'],'resourceId':_0x261a67['id'],'type':_0x337f85[_0xaa7b('0x2a')],'sectionId':_0x337f85['id']},{})['then'](function(){return _0x4d2518;});}else{return _0x4d2518;}})['catch'](function(_0x409199){logger[_0xaa7b('0x28')](_0xaa7b('0x51'),_0x409199);throw _0x409199;});}return _0x4d2518;})[_0xaa7b('0x23')](respondWithResult(_0x40828e,0xc9))[_0xaa7b('0x49')](handleError(_0x40828e,null));};exports[_0xaa7b('0x22')]=function(_0x523d0a,_0x4aabc4){if(_0x523d0a[_0xaa7b('0x52')]['id']){delete _0x523d0a[_0xaa7b('0x52')]['id'];}return db[_0xaa7b('0x2c')][_0xaa7b('0x48')]({'where':{'id':_0x523d0a['params']['id']}})[_0xaa7b('0x23')](handleEntityNotFound(_0x4aabc4,null))[_0xaa7b('0x23')](saveUpdates(_0x523d0a[_0xaa7b('0x52')],null))[_0xaa7b('0x23')](respondWithResult(_0x4aabc4,null))[_0xaa7b('0x49')](handleError(_0x4aabc4,null));};exports[_0xaa7b('0x24')]=function(_0x4e8e61,_0x57c9f3){return db['Schedule']['find']({'where':{'id':_0x4e8e61[_0xaa7b('0x53')]['id']}})['then'](handleEntityNotFound(_0x57c9f3,null))['then'](removeEntity(_0x57c9f3,null))[_0xaa7b('0x49')](handleError(_0x57c9f3,null));};exports[_0xaa7b('0x54')]=function(_0x44bd42,_0x21fab7,_0x965ee1){var _0x5060b0=require(_0xaa7b('0x55'));return db[_0xaa7b('0x2c')][_0xaa7b('0x48')]({'where':{'id':_0x44bd42['params']['id']},'raw':!![]})[_0xaa7b('0x23')](handleEntityNotFound(_0x21fab7,null))['then'](function(){_0x5060b0[_0xaa7b('0x54')](_0x44bd42[_0xaa7b('0x53')]['id']);})[_0xaa7b('0x23')](respondWithStatusCode(_0x21fab7,null))[_0xaa7b('0x49')](handleError(_0x21fab7,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f62f560..2cabda3 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 _0xaf8e=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xaf8e,0xd2));var _0xeaf8=function(_0xd1db29,_0x4b9d9b){_0xd1db29=_0xd1db29-0x0;var _0x3257e1=_0xaf8e[_0xd1db29];return _0x3257e1;};'use strict';var _=require(_0xeaf8('0x0'));var util=require(_0xeaf8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeaf8('0x2'));var BPromise=require(_0xeaf8('0x3'));var rp=require(_0xeaf8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeaf8('0x5'));var config=require(_0xeaf8('0x6'));var attributes=require(_0xeaf8('0x7'));module[_0xeaf8('0x8')]=function(_0x4f51b0,_0x354e87){return _0x4f51b0[_0xeaf8('0x9')](_0xeaf8('0xa'),attributes,{'tableName':_0xeaf8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x38d4=['rimraf','../../config/environment','./schedule.attributes','exports','define','tools_schedules','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x29cdde,_0x42fc0f){var _0x3940bd=function(_0x3bf544){while(--_0x3bf544){_0x29cdde['push'](_0x29cdde['shift']());}};_0x3940bd(++_0x42fc0f);}(_0x38d4,0x10e));var _0x438d=function(_0x2dcdd8,_0xd390a8){_0x2dcdd8=_0x2dcdd8-0x0;var _0x56524f=_0x38d4[_0x2dcdd8];return _0x56524f;};'use strict';var _=require(_0x438d('0x0'));var util=require('util');var logger=require(_0x438d('0x1'))(_0x438d('0x2'));var moment=require(_0x438d('0x3'));var BPromise=require('bluebird');var rp=require(_0x438d('0x4'));var fs=require('fs');var path=require(_0x438d('0x5'));var rimraf=require(_0x438d('0x6'));var config=require(_0x438d('0x7'));var attributes=require(_0x438d('0x8'));module[_0x438d('0x9')]=function(_0x90a7cb,_0x4632ab){return _0x90a7cb[_0x438d('0xa')]('Schedule',attributes,{'tableName':_0x438d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 6448a3d..71a7130 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 _0x0590=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment'];(function(_0x373ce6,_0x1a0131){var _0x49c3b3=function(_0x3445d5){while(--_0x3445d5){_0x373ce6['push'](_0x373ce6['shift']());}};_0x49c3b3(++_0x1a0131);}(_0x0590,0x102));var _0x0059=function(_0x2e0c29,_0x3153b1){_0x2e0c29=_0x2e0c29-0x0;var _0x197545=_0x0590[_0x2e0c29];return _0x197545;};'use strict';var _=require(_0x0059('0x0'));var util=require('util');var moment=require(_0x0059('0x1'));var BPromise=require(_0x0059('0x2'));var rs=require(_0x0059('0x3'));var fs=require('fs');var Redis=require(_0x0059('0x4'));var db=require(_0x0059('0x5'))['db'];var utils=require(_0x0059('0x6'));var logger=require('../../config/logger')(_0x0059('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0059('0x8')][_0x0059('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ad213,_0x55ea54,_0x401aeb){return new BPromise(function(_0x571000,_0x12149e){return client['request'](_0x4ad213,_0x401aeb)['then'](function(_0x54a8ab){logger[_0x0059('0xa')](_0x0059('0xb'),_0x55ea54,_0x0059('0xc'));logger[_0x0059('0xd')](_0x0059('0xe'),_0x55ea54,_0x0059('0xc'),JSON[_0x0059('0xf')](_0x54a8ab));if(_0x54a8ab[_0x0059('0x10')]){if(_0x54a8ab[_0x0059('0x10')][_0x0059('0x11')]===0x1f4){logger[_0x0059('0x10')](_0x0059('0xb'),_0x55ea54,_0x54a8ab['error']['message']);return _0x12149e(_0x54a8ab[_0x0059('0x10')][_0x0059('0x12')]);}logger[_0x0059('0x10')](_0x0059('0xb'),_0x55ea54,_0x54a8ab['error'][_0x0059('0x12')]);return _0x571000(_0x54a8ab[_0x0059('0x10')]['message']);}else{logger[_0x0059('0xa')](_0x0059('0xb'),_0x55ea54,'request\x20sent');_0x571000(_0x54a8ab['result'][_0x0059('0x12')]);}})[_0x0059('0x13')](function(_0xc017ac){logger[_0x0059('0x10')](_0x0059('0xb'),_0x55ea54,_0xc017ac);_0x12149e(_0xc017ac);});});} \ No newline at end of file +var _0xbc65=['jayson/promise','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment'];(function(_0x46ef1d,_0x24926){var _0x49ce69=function(_0x5db4fc){while(--_0x5db4fc){_0x46ef1d['push'](_0x46ef1d['shift']());}};_0x49ce69(++_0x24926);}(_0xbc65,0xdf));var _0x5bc6=function(_0xd0eaea,_0x24fed6){_0xd0eaea=_0xd0eaea-0x0;var _0x130271=_0xbc65[_0xd0eaea];return _0x130271;};'use strict';var _=require(_0x5bc6('0x0'));var util=require(_0x5bc6('0x1'));var moment=require(_0x5bc6('0x2'));var BPromise=require(_0x5bc6('0x3'));var rs=require(_0x5bc6('0x4'));var fs=require('fs');var Redis=require(_0x5bc6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5bc6('0x6'));var config=require(_0x5bc6('0x7'));var jayson=require(_0x5bc6('0x8'));var client=jayson[_0x5bc6('0x9')][_0x5bc6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x163f8c,_0x2329c5,_0x13124e){return new BPromise(function(_0x141dd7,_0x324a31){return client['request'](_0x163f8c,_0x13124e)[_0x5bc6('0xb')](function(_0x6f8b2e){logger[_0x5bc6('0xc')](_0x5bc6('0xd'),_0x2329c5,_0x5bc6('0xe'));logger[_0x5bc6('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x2329c5,_0x5bc6('0xe'),JSON[_0x5bc6('0x10')](_0x6f8b2e));if(_0x6f8b2e[_0x5bc6('0x11')]){if(_0x6f8b2e[_0x5bc6('0x11')]['code']===0x1f4){logger[_0x5bc6('0x11')](_0x5bc6('0xd'),_0x2329c5,_0x6f8b2e[_0x5bc6('0x11')][_0x5bc6('0x12')]);return _0x324a31(_0x6f8b2e[_0x5bc6('0x11')][_0x5bc6('0x12')]);}logger[_0x5bc6('0x11')](_0x5bc6('0xd'),_0x2329c5,_0x6f8b2e[_0x5bc6('0x11')][_0x5bc6('0x12')]);return _0x141dd7(_0x6f8b2e[_0x5bc6('0x11')][_0x5bc6('0x12')]);}else{logger[_0x5bc6('0xc')](_0x5bc6('0xd'),_0x2329c5,_0x5bc6('0xe'));_0x141dd7(_0x6f8b2e[_0x5bc6('0x13')][_0x5bc6('0x12')]);}})[_0x5bc6('0x14')](function(_0x57ecc8){logger[_0x5bc6('0x11')](_0x5bc6('0xd'),_0x2329c5,_0x57ecc8);_0x324a31(_0x57ecc8);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index b4f69a5..1458f3e 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 _0x76b7=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download'];(function(_0x42ce95,_0x5db664){var _0x554c0f=function(_0x212ced){while(--_0x212ced){_0x42ce95['push'](_0x42ce95['shift']());}};_0x554c0f(++_0x5db664);}(_0x76b7,0x66));var _0x776b=function(_0xdccaa3,_0x176487){_0xdccaa3=_0xdccaa3-0x0;var _0x4dd05b=_0x76b7[_0xdccaa3];return _0x4dd05b;};'use strict';var multer=require(_0x776b('0x0'));var util=require(_0x776b('0x1'));var path=require(_0x776b('0x2'));var timeout=require(_0x776b('0x3'));var express=require(_0x776b('0x4'));var router=express['Router']();var auth=require(_0x776b('0x5'));var interaction=require(_0x776b('0x6'));var config=require(_0x776b('0x7'));var controller=require(_0x776b('0x8'));router[_0x776b('0x9')]('/',auth[_0x776b('0xa')](),controller[_0x776b('0xb')]);router[_0x776b('0x9')](_0x776b('0xc'),auth[_0x776b('0xa')](),controller[_0x776b('0xd')]);router[_0x776b('0x9')](_0x776b('0xe'),auth[_0x776b('0xa')](),controller[_0x776b('0xf')]);router['get'](_0x776b('0x10'),auth[_0x776b('0xa')](),controller[_0x776b('0x11')]);router[_0x776b('0x12')]('/',auth[_0x776b('0xa')](),controller['create']);router[_0x776b('0x13')](_0x776b('0xe'),auth[_0x776b('0xa')](),controller[_0x776b('0x14')]);router[_0x776b('0x15')](_0x776b('0xe'),auth[_0x776b('0xa')](),controller[_0x776b('0x16')]);module[_0x776b('0x17')]=router; \ No newline at end of file +var _0x5390=['/describe','describe','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','index'];(function(_0x1c4c1a,_0x1e4d6b){var _0x434002=function(_0x2ebb88){while(--_0x2ebb88){_0x1c4c1a['push'](_0x1c4c1a['shift']());}};_0x434002(++_0x1e4d6b);}(_0x5390,0x1ec));var _0x0539=function(_0x2b43d5,_0x586224){_0x2b43d5=_0x2b43d5-0x0;var _0xc2d4db=_0x5390[_0x2b43d5];return _0xc2d4db;};'use strict';var multer=require(_0x0539('0x0'));var util=require(_0x0539('0x1'));var path=require(_0x0539('0x2'));var timeout=require(_0x0539('0x3'));var express=require(_0x0539('0x4'));var router=express[_0x0539('0x5')]();var auth=require(_0x0539('0x6'));var interaction=require(_0x0539('0x7'));var config=require('../../config/environment');var controller=require(_0x0539('0x8'));router[_0x0539('0x9')]('/',auth[_0x0539('0xa')](),controller[_0x0539('0xb')]);router[_0x0539('0x9')](_0x0539('0xc'),auth[_0x0539('0xa')](),controller[_0x0539('0xd')]);router[_0x0539('0x9')](_0x0539('0xe'),auth[_0x0539('0xa')](),controller[_0x0539('0xf')]);router[_0x0539('0x9')](_0x0539('0x10'),auth[_0x0539('0xa')](),controller[_0x0539('0x11')]);router[_0x0539('0x12')]('/',auth[_0x0539('0xa')](),controller[_0x0539('0x13')]);router[_0x0539('0x14')]('/:id',auth[_0x0539('0xa')](),controller[_0x0539('0x15')]);router[_0x0539('0x16')](_0x0539('0xe'),auth[_0x0539('0xa')](),controller[_0x0539('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2ee5beb..675bc41 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 _0x008c=['extname','STRING','replace','setDataValue','closedAt','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x461c39,_0x2ffc4e){_0x461c39=_0x461c39-0x0;var _0x149a9b=_0x008c[_0x461c39];return _0x149a9b;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var config=require(_0xc008('0x3'));module[_0xc008('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc008('0x5')](_0xc008('0x6'))?path[_0xc008('0x7')](this[_0xc008('0x5')](_0xc008('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xc008('0x8')]},'channel':{'type':Sequelize[_0xc008('0x8')]},'value':{'type':Sequelize[_0xc008('0x8')],'set':function(_0x9c8cb2){var _0x4af530=_0x9c8cb2[_0xc008('0x9')](/\\/g,'/');this['setDataValue'](_0xc008('0x6'),_0x4af530);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x27830d){this[_0xc008('0xa')]('startedAt',moment()['subtract'](_0x27830d,'ms'));this['setDataValue'](_0xc008('0xb'),moment());this[_0xc008('0xa')]('duration',_0x27830d);}},'startedAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0xd')))[_0xc008('0xe')](_0xc008('0xf'))[_0xc008('0x10')]();}},'closedAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this['getDataValue']('closedAt'))[_0xc008('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xc008('0x10')]();}},'createdAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0x11')))[_0xc008('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0x12')))[_0xc008('0xe')](_0xc008('0xf'))['toString']();}}}; \ No newline at end of file +var _0xdbf5=['getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','startedAt','duration','MM-DD-YYYY\x20HH:mm','toString','DATE','closedAt','createdAt','format','updatedAt','moment','exports','VIRTUAL'];(function(_0x5524af,_0x597e72){var _0x3202d8=function(_0x3feebe){while(--_0x3feebe){_0x5524af['push'](_0x5524af['shift']());}};_0x3202d8(++_0x597e72);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x23426e,_0x81d1c0){_0x23426e=_0x23426e-0x0;var _0x206558=_0xdbf5[_0x23426e];return _0x206558;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5dbf('0x0'));var path=require('path');var config=require('../../config/environment');module[_0x5dbf('0x1')]={'format':{'type':Sequelize[_0x5dbf('0x2')],'get':function(){return this[_0x5dbf('0x3')](_0x5dbf('0x4'))?path[_0x5dbf('0x5')](this[_0x5dbf('0x3')](_0x5dbf('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0x5dbf('0x6')]},'channel':{'type':Sequelize[_0x5dbf('0x6')]},'value':{'type':Sequelize[_0x5dbf('0x6')],'set':function(_0x209b7d){var _0x88128e=_0x209b7d[_0x5dbf('0x7')](/\\/g,'/');this['setDataValue'](_0x5dbf('0x4'),_0x88128e);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x5dbf('0x8')],'set':function(_0x3bec50){this[_0x5dbf('0x9')](_0x5dbf('0xa'),moment()['subtract'](_0x3bec50,'ms'));this[_0x5dbf('0x9')]('closedAt',moment());this['setDataValue'](_0x5dbf('0xb'),_0x3bec50);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0x5dbf('0xa')))['format'](_0x5dbf('0xc'))[_0x5dbf('0xd')]();}},'closedAt':{'type':Sequelize[_0x5dbf('0xe')],'get':function(){return moment(this[_0x5dbf('0x3')](_0x5dbf('0xf')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5dbf('0xd')]();}},'createdAt':{'type':Sequelize[_0x5dbf('0xe')],'get':function(){return moment(this['getDataValue'](_0x5dbf('0x10')))[_0x5dbf('0x11')](_0x5dbf('0xc'))[_0x5dbf('0xd')]();}},'updatedAt':{'type':Sequelize[_0x5dbf('0xe')],'get':function(){return moment(this[_0x5dbf('0x3')](_0x5dbf('0x12')))['format']('MM-DD-YYYY\x20HH:mm')[_0x5dbf('0xd')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index ad43b9e..ad9f0c9 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 _0x22b3=['describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','send','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','update','createdAt','value'];(function(_0x1a3f14,_0x30f4c6){var _0x1c71ae=function(_0x537e4c){while(--_0x537e4c){_0x1a3f14['push'](_0x1a3f14['shift']());}};_0x1c71ae(++_0x30f4c6);}(_0x22b3,0x189));var _0x322b=function(_0xeaf726,_0x4f911d){_0xeaf726=_0xeaf726-0x0;var _0x163b78=_0x22b3[_0xeaf726];return _0x163b78;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x322b('0x0'));var zipdir=require(_0x322b('0x1'));var jsonpatch=require(_0x322b('0x2'));var rp=require(_0x322b('0x3'));var moment=require(_0x322b('0x4'));var BPromise=require(_0x322b('0x5'));var Mustache=require('mustache');var util=require(_0x322b('0x6'));var path=require('path');var sox=require(_0x322b('0x7'));var csv=require(_0x322b('0x8'));var ejs=require(_0x322b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x322b('0xa'));var deskjs=require(_0x322b('0xb'));var toCsv=require(_0x322b('0x8'));var querystring=require('querystring');var Papa=require(_0x322b('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x322b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x322b('0xe'));var config=require(_0x322b('0xf'));var db=require(_0x322b('0x10'))['db'];function respondWithStatusCode(_0x101da5,_0x3d733e){_0x3d733e=_0x3d733e||0xcc;return function(_0x5d051b){if(_0x5d051b){return _0x101da5[_0x322b('0x11')](_0x3d733e);}return _0x101da5[_0x322b('0x12')](_0x3d733e)[_0x322b('0x13')]();};}function respondWithResult(_0x209788,_0x1d2b41){_0x1d2b41=_0x1d2b41||0xc8;return function(_0x39c301){if(_0x39c301){return _0x209788[_0x322b('0x12')](_0x1d2b41)[_0x322b('0x14')](_0x39c301);}};}function respondWithFilteredResult(_0x319722,_0x28588e){return function(_0x52bffb){if(_0x52bffb){var _0x2d2fcc=_0x52bffb[_0x322b('0x15')],_0x2eef1b=_0x28588e[_0x322b('0x16')],_0x35e1ce=_0x28588e[_0x322b('0x16')]+_0x28588e[_0x322b('0x17')],_0x378348;if(_0x35e1ce>=_0x2d2fcc){_0x35e1ce=_0x2d2fcc;_0x378348=0xc8;}else{_0x378348=0xce;}_0x319722[_0x322b('0x12')](_0x378348);return _0x319722[_0x322b('0x18')]('Content-Range',_0x2eef1b+'-'+_0x35e1ce+'/'+_0x2d2fcc)[_0x322b('0x14')](_0x52bffb);}return null;};}function patchUpdates(_0x493dd9){return function(_0x27a13c){try{jsonpatch[_0x322b('0x19')](_0x27a13c,_0x493dd9,!![]);}catch(_0x4dcad4){return BPromise[_0x322b('0x1a')](_0x4dcad4);}return _0x27a13c[_0x322b('0x1b')]();};}function saveUpdates(_0x4144b1,_0x52d9d5){return function(_0x44ba40){if(_0x44ba40){return _0x44ba40['update'](_0x4144b1)[_0x322b('0x1c')](function(_0x27010e){return _0x27010e;});}return null;};}function removeEntity(_0x15ec23,_0x1c4e8a){return function(_0x21959e){if(_0x21959e){return _0x21959e['destroy']()[_0x322b('0x1c')](function(){_0x15ec23[_0x322b('0x12')](0xcc)[_0x322b('0x13')]();});}};}function handleEntityNotFound(_0x4e98a3,_0x47b50a){return function(_0x38d4fa){if(!_0x38d4fa){_0x4e98a3[_0x322b('0x11')](0x194);}return _0x38d4fa;};}function handleError(_0x37a0a1,_0x133757){_0x133757=_0x133757||0x1f4;return function(_0xb0028c){logger[_0x322b('0x1d')](_0xb0028c[_0x322b('0x1e')]);if(_0xb0028c[_0x322b('0x1f')]){delete _0xb0028c['name'];}_0x37a0a1[_0x322b('0x12')](_0x133757)['send'](_0xb0028c);};}exports[_0x322b('0x20')]=function(_0x469be5,_0x750880){var _0x1e5557={},_0x5d5772={},_0x451ad5={'count':0x0,'rows':[]};var _0x1c678f=_[_0x322b('0x21')](db[_0x322b('0x22')][_0x322b('0x23')],function(_0x13e2e3){return{'name':_0x13e2e3[_0x322b('0x24')],'type':_0x13e2e3[_0x322b('0x25')]['key']};});_0x5d5772[_0x322b('0x26')]=_[_0x322b('0x27')](_[_0x322b('0x21')](_0x1c678f,_0x322b('0x1f')),[_0x322b('0x28')]);_0x5d5772[_0x322b('0x29')]=_[_0x322b('0x2a')](_0x469be5['query']);_0x5d5772['filters']=_['intersection'](_0x5d5772[_0x322b('0x26')],_0x5d5772[_0x322b('0x29')]);_0x1e5557[_0x322b('0x2b')]=_[_0x322b('0x2c')](_0x5d5772[_0x322b('0x26')],qs[_0x322b('0x2d')](_0x469be5[_0x322b('0x29')][_0x322b('0x2d')]));_0x1e5557[_0x322b('0x2b')]=_0x1e5557[_0x322b('0x2b')]['length']?_0x1e5557[_0x322b('0x2b')]:_0x5d5772['model'];if(!_0x469be5['query'][_0x322b('0x2e')]('nolimit')){_0x1e5557[_0x322b('0x17')]=qs['limit'](_0x469be5['query']['limit']);_0x1e5557['offset']=qs[_0x322b('0x16')](_0x469be5[_0x322b('0x29')][_0x322b('0x16')]);}_0x1e5557['order']=qs[_0x322b('0x2f')](_0x469be5[_0x322b('0x29')][_0x322b('0x2f')]);_0x1e5557[_0x322b('0x30')]=qs[_0x322b('0x31')](_[_0x322b('0x32')](_0x469be5[_0x322b('0x29')],_0x5d5772[_0x322b('0x31')]));if(_0x469be5[_0x322b('0x29')][_0x322b('0x33')]){_0x1e5557[_0x322b('0x30')]=_['merge'](_0x1e5557[_0x322b('0x30')],{'$or':_[_0x322b('0x21')](_0x1c678f,function(_0x47971b){if(_0x47971b['type']!=='VIRTUAL'){var _0x315dad={};_0x315dad[_0x47971b[_0x322b('0x1f')]]={'$like':'%'+_0x469be5['query'][_0x322b('0x33')]+'%'};return _0x315dad;}})});}_0x1e5557=_[_0x322b('0x34')]({},_0x1e5557,_0x469be5[_0x322b('0x35')]);var _0x3a7a18={'where':_0x1e5557[_0x322b('0x30')]};return db['ScreenRecording'][_0x322b('0x15')](_0x3a7a18)[_0x322b('0x1c')](function(_0x5d1f4a){_0x451ad5[_0x322b('0x15')]=_0x5d1f4a;if(_0x469be5[_0x322b('0x29')][_0x322b('0x36')]){_0x1e5557[_0x322b('0x37')]=[{'all':!![]}];}return db['ScreenRecording'][_0x322b('0x38')](_0x1e5557);})[_0x322b('0x1c')](function(_0x2fd7f9){_0x451ad5[_0x322b('0x39')]=_0x2fd7f9;return _0x451ad5;})[_0x322b('0x1c')](respondWithFilteredResult(_0x750880,_0x1e5557))[_0x322b('0x3a')](handleError(_0x750880,null));};exports['show']=function(_0x19db09,_0x28fa5f){var _0x52c116={'raw':![],'where':{'id':_0x19db09[_0x322b('0x3b')]['id']}},_0x8e0aee={};_0x8e0aee[_0x322b('0x26')]=_[_0x322b('0x2a')](db[_0x322b('0x22')]['rawAttributes']);_0x8e0aee[_0x322b('0x29')]=_[_0x322b('0x2a')](_0x19db09['query']);_0x8e0aee[_0x322b('0x31')]=_[_0x322b('0x2c')](_0x8e0aee[_0x322b('0x26')],_0x8e0aee[_0x322b('0x29')]);_0x52c116['attributes']=_[_0x322b('0x2c')](_0x8e0aee[_0x322b('0x26')],qs[_0x322b('0x2d')](_0x19db09[_0x322b('0x29')][_0x322b('0x2d')]));_0x52c116['attributes']=_0x52c116[_0x322b('0x2b')][_0x322b('0x3c')]?_0x52c116[_0x322b('0x2b')]:_0x8e0aee[_0x322b('0x26')];if(_0x19db09['query']['includeAll']){_0x52c116[_0x322b('0x37')]=[{'all':!![]}];}_0x52c116=_[_0x322b('0x34')]({},_0x52c116,_0x19db09[_0x322b('0x35')]);return db['ScreenRecording'][_0x322b('0x3d')](_0x52c116)[_0x322b('0x1c')](handleEntityNotFound(_0x28fa5f,null))[_0x322b('0x1c')](respondWithResult(_0x28fa5f,null))[_0x322b('0x3a')](handleError(_0x28fa5f,null));};exports[_0x322b('0x3e')]=function(_0x2d8732,_0x4a552f){return db[_0x322b('0x22')]['create'](_0x2d8732[_0x322b('0x3f')],{})[_0x322b('0x1c')](respondWithResult(_0x4a552f,0xc9))[_0x322b('0x3a')](handleError(_0x4a552f,null));};exports[_0x322b('0x40')]=function(_0x5ab68d,_0x1939a4){if(_0x5ab68d[_0x322b('0x3f')]['id']){delete _0x5ab68d['body']['id'];}delete _0x5ab68d[_0x322b('0x3f')]['duration'];delete _0x5ab68d[_0x322b('0x3f')][_0x322b('0x41')];delete _0x5ab68d['body']['closedAt'];delete _0x5ab68d[_0x322b('0x3f')][_0x322b('0x42')];return db['ScreenRecording'][_0x322b('0x3d')]({'where':{'id':_0x5ab68d['params']['id']}})['then'](handleEntityNotFound(_0x1939a4,null))['then'](saveUpdates(_0x5ab68d[_0x322b('0x3f')],null))[_0x322b('0x1c')](respondWithResult(_0x1939a4,null))['catch'](handleError(_0x1939a4,null));};exports[_0x322b('0x43')]=function(_0x50eb23,_0x29be57){return db[_0x322b('0x22')][_0x322b('0x43')]()[_0x322b('0x1c')](respondWithResult(_0x29be57,null))['catch'](handleError(_0x29be57,null));};exports[_0x322b('0x44')]=function(_0x24c7cd,_0x27deb3,_0x27b431){var _0x4da266=require(_0x322b('0x45'));var _0x2eecd3=![];var _0x559f2d={};if(_0x24c7cd['query'][_0x322b('0x25')]&&_0x24c7cd['query'][_0x322b('0x25')]===_0x322b('0x46')){_0x559f2d[_0x322b('0x46')]=_0x24c7cd[_0x322b('0x3b')]['id'];}else{_0x559f2d['id']=_0x24c7cd[_0x322b('0x3b')]['id'];}return db[_0x322b('0x22')][_0x322b('0x3d')]({'where':_0x559f2d,'attributes':['id',_0x322b('0x42')],'raw':!![]})['then'](handleEntityNotFound(_0x27deb3,null))[_0x322b('0x1c')](function(_0x29ac0e){if(_0x29ac0e){var _0x3db88c=path[_0x322b('0x47')](config['root'],_0x322b('0x48'),_0x29ac0e[_0x322b('0x42')]);var _0x4a2123=util[_0x322b('0x28')](_0x322b('0x49'),_0x3db88c);if(fs[_0x322b('0x4a')](_0x4a2123)){_0x2eecd3=!![];return _0x4da266[_0x322b('0x4b')](_0x4a2123,_0x3db88c,config['secrets'][_0x322b('0x4c')])[_0x322b('0x1c')](function(){return _0x29ac0e;});}return _0x29ac0e;}})[_0x322b('0x1c')](function(_0x4915e7){if(_0x4915e7){var _0x1f6559=path[_0x322b('0x47')](config[_0x322b('0x4d')],'server/files/screen_recordings',_0x4915e7[_0x322b('0x42')]);if(!fs[_0x322b('0x4a')](_0x1f6559)){throw new db[(_0x322b('0x4e'))][(_0x322b('0x4f'))](_0x322b('0x50'));}if(_0x4915e7[_0x322b('0x51')]){return _0x27deb3[_0x322b('0x44')](_0x1f6559,_0x4915e7['filename']+path[_0x322b('0x52')](_0x1f6559),function(){if(_0x2eecd3){fs[_0x322b('0x53')](_0x1f6559);}});}else{return _0x27deb3[_0x322b('0x44')](_0x1f6559,function(_0x330424){if(_0x2eecd3){fs[_0x322b('0x53')](_0x1f6559);}});}}})[_0x322b('0x3a')](function(_0x255bfe){if(_0x255bfe['message']===_0x322b('0x50')){_0x27deb3['status'](0x194)[_0x322b('0x54')]('Not\x20found');}else{return handleError(_0x27deb3,null);}});};exports[_0x322b('0x55')]=function(_0x399060,_0x52b064){return db[_0x322b('0x22')][_0x322b('0x3d')]({'where':{'id':_0x399060['params']['id']}})[_0x322b('0x1c')](function(_0xe746eb){if(!_0xe746eb)throw new ReferenceError('Entity\x20not\x20found');return _0xe746eb;})[_0x322b('0x1c')](function(_0x22473a){var _0x79a138=path[_0x322b('0x47')](config[_0x322b('0x4d')],_0x322b('0x48'),_0x22473a[_0x322b('0x42')]);logger[_0x322b('0x56')](_0x322b('0x57'),_0x79a138);if(!_[_0x322b('0x58')](_0x22473a[_0x322b('0x42')])&&fs['existsSync'](_0x79a138)){logger[_0x322b('0x56')](_0x322b('0x59')+_0x79a138+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x322b('0x5a')](_0x79a138);}_0x79a138=_0x79a138+'.cypher';if(!_[_0x322b('0x58')](_0x22473a['value'])&&fs[_0x322b('0x4a')](_0x79a138)){logger[_0x322b('0x56')](_0x322b('0x59')+_0x79a138+_0x322b('0x5b'));fs[_0x322b('0x5a')](_0x79a138);}return _0x22473a;})['then'](function(_0x178520){if(!_0x178520)throw new InternalError();return _0x178520['destroy']();})['then'](function(){_0x52b064['status'](0xcc)['end']();})[_0x322b('0x3a')](function(_0x5b6f00){var _0xa714d2=0x1f4;if(e instanceof ReferenceError){_0xa714d2=0x194;}else if(e instanceof InternalError){_0xa714d2=0x1f4;}logger[_0x322b('0x1d')](_0x5b6f00['stack']);if(_0x5b6f00[_0x322b('0x1f')]){delete _0x5b6f00[_0x322b('0x1f')];}_0x52b064['status'](_0xa714d2)[_0x322b('0x54')](_0x5b6f00);});}; \ No newline at end of file +var _0x6a01=['closedAt','value','describe','uniqueid','find','root','server/files/screen_recordings','existsSync','decryptFile','secrets','join','Sequelize','ScreenRecording\x20not\x20found','download','filename','extname','unlink','message','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','model','differenceBy','format','query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','options','includeAll','include','ScreenRecording','findAll','catch','params','attributes','create','body','duration','createdAt'];(function(_0x38d256,_0x28c754){var _0x3b9e76=function(_0x33fbc4){while(--_0x33fbc4){_0x38d256['push'](_0x38d256['shift']());}};_0x3b9e76(++_0x28c754);}(_0x6a01,0x14f));var _0x16a0=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x6a01[_0x553a87];return _0x12d1e6;};'use strict';var pdf=require(_0x16a0('0x0'));var emlformat=require(_0x16a0('0x1'));var rimraf=require(_0x16a0('0x2'));var zipdir=require(_0x16a0('0x3'));var jsonpatch=require(_0x16a0('0x4'));var rp=require(_0x16a0('0x5'));var moment=require(_0x16a0('0x6'));var BPromise=require(_0x16a0('0x7'));var Mustache=require(_0x16a0('0x8'));var util=require(_0x16a0('0x9'));var path=require(_0x16a0('0xa'));var sox=require(_0x16a0('0xb'));var csv=require(_0x16a0('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x16a0('0xd'));var squel=require(_0x16a0('0xe'));var crypto=require(_0x16a0('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x16a0('0x10'));var toCsv=require(_0x16a0('0xc'));var querystring=require('querystring');var Papa=require(_0x16a0('0x11'));var Redis=require(_0x16a0('0x12'));var authService=require(_0x16a0('0x13'));var qs=require(_0x16a0('0x14'));var as=require(_0x16a0('0x15'));var hardwareService=require(_0x16a0('0x16'));var logger=require(_0x16a0('0x17'))('api');var utils=require(_0x16a0('0x18'));var config=require(_0x16a0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ffc24,_0x14221a){_0x14221a=_0x14221a||0xcc;return function(_0x2f8751){if(_0x2f8751){return _0x3ffc24['sendStatus'](_0x14221a);}return _0x3ffc24[_0x16a0('0x1a')](_0x14221a)[_0x16a0('0x1b')]();};}function respondWithResult(_0xac3369,_0x5ae413){_0x5ae413=_0x5ae413||0xc8;return function(_0x15bbe9){if(_0x15bbe9){return _0xac3369[_0x16a0('0x1a')](_0x5ae413)[_0x16a0('0x1c')](_0x15bbe9);}};}function respondWithFilteredResult(_0x136df4,_0x278f10){return function(_0x2d0431){if(_0x2d0431){var _0x5e7d6a=_0x2d0431[_0x16a0('0x1d')],_0x42cca6=_0x278f10[_0x16a0('0x1e')],_0x6ff4f4=_0x278f10['offset']+_0x278f10['limit'],_0x55e287;if(_0x6ff4f4>=_0x5e7d6a){_0x6ff4f4=_0x5e7d6a;_0x55e287=0xc8;}else{_0x55e287=0xce;}_0x136df4[_0x16a0('0x1a')](_0x55e287);return _0x136df4[_0x16a0('0x1f')](_0x16a0('0x20'),_0x42cca6+'-'+_0x6ff4f4+'/'+_0x5e7d6a)['json'](_0x2d0431);}return null;};}function patchUpdates(_0x1b741c){return function(_0x478fb0){try{jsonpatch[_0x16a0('0x21')](_0x478fb0,_0x1b741c,!![]);}catch(_0x3912c3){return BPromise[_0x16a0('0x22')](_0x3912c3);}return _0x478fb0[_0x16a0('0x23')]();};}function saveUpdates(_0x48543c,_0x28d001){return function(_0x29d955){if(_0x29d955){return _0x29d955[_0x16a0('0x24')](_0x48543c)[_0x16a0('0x25')](function(_0x47c056){return _0x47c056;});}return null;};}function removeEntity(_0x4fe5cf,_0x5a78cc){return function(_0x4dff27){if(_0x4dff27){return _0x4dff27[_0x16a0('0x26')]()[_0x16a0('0x25')](function(){_0x4fe5cf['status'](0xcc)[_0x16a0('0x1b')]();});}};}function handleEntityNotFound(_0x2fdcd7,_0x3928c9){return function(_0x21babd){if(!_0x21babd){_0x2fdcd7[_0x16a0('0x27')](0x194);}return _0x21babd;};}function handleError(_0x3ed1be,_0x498a52){_0x498a52=_0x498a52||0x1f4;return function(_0x10575e){logger[_0x16a0('0x28')](_0x10575e[_0x16a0('0x29')]);if(_0x10575e['name']){delete _0x10575e[_0x16a0('0x2a')];}_0x3ed1be[_0x16a0('0x1a')](_0x498a52)[_0x16a0('0x2b')](_0x10575e);};}exports['index']=function(_0x35f995,_0xc860cf){var _0x1d7341={},_0x3fba6d={},_0x209082={'count':0x0,'rows':[]};var _0x264642=_[_0x16a0('0x2c')](db['ScreenRecording'][_0x16a0('0x2d')],function(_0xa56c77){return{'name':_0xa56c77[_0x16a0('0x2e')],'type':_0xa56c77[_0x16a0('0x2f')]['key']};});_0x3fba6d[_0x16a0('0x30')]=_[_0x16a0('0x31')](_[_0x16a0('0x2c')](_0x264642,_0x16a0('0x2a')),[_0x16a0('0x32')]);_0x3fba6d[_0x16a0('0x33')]=_[_0x16a0('0x34')](_0x35f995['query']);_0x3fba6d[_0x16a0('0x35')]=_[_0x16a0('0x36')](_0x3fba6d['model'],_0x3fba6d[_0x16a0('0x33')]);_0x1d7341['attributes']=_[_0x16a0('0x36')](_0x3fba6d[_0x16a0('0x30')],qs[_0x16a0('0x37')](_0x35f995[_0x16a0('0x33')]['fields']));_0x1d7341['attributes']=_0x1d7341['attributes'][_0x16a0('0x38')]?_0x1d7341['attributes']:_0x3fba6d[_0x16a0('0x30')];if(!_0x35f995[_0x16a0('0x33')][_0x16a0('0x39')](_0x16a0('0x3a'))){_0x1d7341['limit']=qs[_0x16a0('0x3b')](_0x35f995[_0x16a0('0x33')][_0x16a0('0x3b')]);_0x1d7341['offset']=qs[_0x16a0('0x1e')](_0x35f995[_0x16a0('0x33')][_0x16a0('0x1e')]);}_0x1d7341['order']=qs[_0x16a0('0x3c')](_0x35f995[_0x16a0('0x33')][_0x16a0('0x3c')]);_0x1d7341['where']=qs[_0x16a0('0x35')](_[_0x16a0('0x3d')](_0x35f995[_0x16a0('0x33')],_0x3fba6d[_0x16a0('0x35')]));if(_0x35f995[_0x16a0('0x33')][_0x16a0('0x3e')]){_0x1d7341[_0x16a0('0x3f')]=_[_0x16a0('0x40')](_0x1d7341[_0x16a0('0x3f')],{'$or':_[_0x16a0('0x2c')](_0x264642,function(_0x2eb45a){if(_0x2eb45a[_0x16a0('0x2f')]!=='VIRTUAL'){var _0x4aa082={};_0x4aa082[_0x2eb45a[_0x16a0('0x2a')]]={'$like':'%'+_0x35f995[_0x16a0('0x33')][_0x16a0('0x3e')]+'%'};return _0x4aa082;}})});}_0x1d7341=_['merge']({},_0x1d7341,_0x35f995[_0x16a0('0x41')]);var _0x3c632a={'where':_0x1d7341['where']};return db['ScreenRecording'][_0x16a0('0x1d')](_0x3c632a)['then'](function(_0x3a0651){_0x209082[_0x16a0('0x1d')]=_0x3a0651;if(_0x35f995[_0x16a0('0x33')][_0x16a0('0x42')]){_0x1d7341[_0x16a0('0x43')]=[{'all':!![]}];}return db[_0x16a0('0x44')][_0x16a0('0x45')](_0x1d7341);})[_0x16a0('0x25')](function(_0x269787){_0x209082['rows']=_0x269787;return _0x209082;})[_0x16a0('0x25')](respondWithFilteredResult(_0xc860cf,_0x1d7341))[_0x16a0('0x46')](handleError(_0xc860cf,null));};exports['show']=function(_0x340e75,_0x11891d){var _0x15dc77={'raw':![],'where':{'id':_0x340e75[_0x16a0('0x47')]['id']}},_0x3b3473={};_0x3b3473[_0x16a0('0x30')]=_[_0x16a0('0x34')](db[_0x16a0('0x44')][_0x16a0('0x2d')]);_0x3b3473[_0x16a0('0x33')]=_['keys'](_0x340e75[_0x16a0('0x33')]);_0x3b3473[_0x16a0('0x35')]=_['intersection'](_0x3b3473[_0x16a0('0x30')],_0x3b3473[_0x16a0('0x33')]);_0x15dc77[_0x16a0('0x48')]=_[_0x16a0('0x36')](_0x3b3473[_0x16a0('0x30')],qs[_0x16a0('0x37')](_0x340e75[_0x16a0('0x33')][_0x16a0('0x37')]));_0x15dc77[_0x16a0('0x48')]=_0x15dc77[_0x16a0('0x48')]['length']?_0x15dc77[_0x16a0('0x48')]:_0x3b3473['model'];if(_0x340e75[_0x16a0('0x33')][_0x16a0('0x42')]){_0x15dc77[_0x16a0('0x43')]=[{'all':!![]}];}_0x15dc77=_['merge']({},_0x15dc77,_0x340e75['options']);return db[_0x16a0('0x44')]['find'](_0x15dc77)['then'](handleEntityNotFound(_0x11891d,null))[_0x16a0('0x25')](respondWithResult(_0x11891d,null))['catch'](handleError(_0x11891d,null));};exports[_0x16a0('0x49')]=function(_0x5d0f61,_0x55d151){return db[_0x16a0('0x44')][_0x16a0('0x49')](_0x5d0f61[_0x16a0('0x4a')],{})[_0x16a0('0x25')](respondWithResult(_0x55d151,0xc9))[_0x16a0('0x46')](handleError(_0x55d151,null));};exports['update']=function(_0x3ffb24,_0x443d0a){if(_0x3ffb24['body']['id']){delete _0x3ffb24[_0x16a0('0x4a')]['id'];}delete _0x3ffb24['body'][_0x16a0('0x4b')];delete _0x3ffb24[_0x16a0('0x4a')][_0x16a0('0x4c')];delete _0x3ffb24['body'][_0x16a0('0x4d')];delete _0x3ffb24['body'][_0x16a0('0x4e')];return db[_0x16a0('0x44')]['find']({'where':{'id':_0x3ffb24[_0x16a0('0x47')]['id']}})[_0x16a0('0x25')](handleEntityNotFound(_0x443d0a,null))[_0x16a0('0x25')](saveUpdates(_0x3ffb24[_0x16a0('0x4a')],null))['then'](respondWithResult(_0x443d0a,null))[_0x16a0('0x46')](handleError(_0x443d0a,null));};exports[_0x16a0('0x4f')]=function(_0x6d5acb,_0xffa08b){return db[_0x16a0('0x44')]['describe']()['then'](respondWithResult(_0xffa08b,null))[_0x16a0('0x46')](handleError(_0xffa08b,null));};exports['download']=function(_0x3e9d5b,_0x414d4b,_0x1b89c0){var _0xc55141=require('../../components/encryptor');var _0x1e867c=![];var _0x2f76d6={};if(_0x3e9d5b[_0x16a0('0x33')][_0x16a0('0x2f')]&&_0x3e9d5b[_0x16a0('0x33')][_0x16a0('0x2f')]===_0x16a0('0x50')){_0x2f76d6[_0x16a0('0x50')]=_0x3e9d5b[_0x16a0('0x47')]['id'];}else{_0x2f76d6['id']=_0x3e9d5b['params']['id'];}return db['ScreenRecording'][_0x16a0('0x51')]({'where':_0x2f76d6,'attributes':['id',_0x16a0('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x414d4b,null))['then'](function(_0x505896){if(_0x505896){var _0x1961bb=path['join'](config[_0x16a0('0x52')],_0x16a0('0x53'),_0x505896[_0x16a0('0x4e')]);var _0x2fdd58=util[_0x16a0('0x32')]('%s.cypher',_0x1961bb);if(fs[_0x16a0('0x54')](_0x2fdd58)){_0x1e867c=!![];return _0xc55141[_0x16a0('0x55')](_0x2fdd58,_0x1961bb,config[_0x16a0('0x56')]['recording'])[_0x16a0('0x25')](function(){return _0x505896;});}return _0x505896;}})[_0x16a0('0x25')](function(_0x36bb0b){if(_0x36bb0b){var _0x42136a=path[_0x16a0('0x57')](config[_0x16a0('0x52')],_0x16a0('0x53'),_0x36bb0b[_0x16a0('0x4e')]);if(!fs[_0x16a0('0x54')](_0x42136a)){throw new db[(_0x16a0('0x58'))]['ValidationError'](_0x16a0('0x59'));}if(_0x36bb0b['filename']){return _0x414d4b[_0x16a0('0x5a')](_0x42136a,_0x36bb0b[_0x16a0('0x5b')]+path[_0x16a0('0x5c')](_0x42136a),function(){if(_0x1e867c){fs['unlink'](_0x42136a);}});}else{return _0x414d4b['download'](_0x42136a,function(_0x466efd){if(_0x1e867c){fs[_0x16a0('0x5d')](_0x42136a);}});}}})[_0x16a0('0x46')](function(_0x1399ce){if(_0x1399ce[_0x16a0('0x5e')]===_0x16a0('0x59')){_0x414d4b[_0x16a0('0x1a')](0x194)['send'](_0x16a0('0x5f'));}else{return handleError(_0x414d4b,null);}});};exports['destroy']=function(_0x40d932,_0x3cc2d5){return db[_0x16a0('0x44')][_0x16a0('0x51')]({'where':{'id':_0x40d932[_0x16a0('0x47')]['id']}})['then'](function(_0x51e80e){if(!_0x51e80e)throw new ReferenceError(_0x16a0('0x60'));return _0x51e80e;})[_0x16a0('0x25')](function(_0x4c6137){var _0x49c006=path[_0x16a0('0x57')](config[_0x16a0('0x52')],_0x16a0('0x53'),_0x4c6137[_0x16a0('0x4e')]);logger[_0x16a0('0x61')](_0x16a0('0x62'),_0x49c006);if(!_[_0x16a0('0x63')](_0x4c6137[_0x16a0('0x4e')])&&fs[_0x16a0('0x54')](_0x49c006)){logger[_0x16a0('0x61')](_0x16a0('0x64')+_0x49c006+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x49c006);}_0x49c006=_0x49c006+_0x16a0('0x65');if(!_[_0x16a0('0x63')](_0x4c6137[_0x16a0('0x4e')])&&fs[_0x16a0('0x54')](_0x49c006)){logger[_0x16a0('0x61')](_0x16a0('0x64')+_0x49c006+_0x16a0('0x66'));fs['unlinkSync'](_0x49c006);}return _0x4c6137;})[_0x16a0('0x25')](function(_0xcbbfb){if(!_0xcbbfb)throw new InternalError();return _0xcbbfb[_0x16a0('0x26')]();})[_0x16a0('0x25')](function(){_0x3cc2d5[_0x16a0('0x1a')](0xcc)[_0x16a0('0x1b')]();})[_0x16a0('0x46')](function(_0x3dd04f){var _0x43c4e4=0x1f4;if(e instanceof ReferenceError){_0x43c4e4=0x194;}else if(e instanceof InternalError){_0x43c4e4=0x1f4;}logger[_0x16a0('0x28')](_0x3dd04f[_0x16a0('0x29')]);if(_0x3dd04f[_0x16a0('0x2a')]){delete _0x3dd04f[_0x16a0('0x2a')];}_0x3cc2d5['status'](_0x43c4e4)[_0x16a0('0x2b')](_0x3dd04f);});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 2d768ae..6ad9bed 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 _0x660e=['./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x513016,_0x1143c9){var _0x4189f5=function(_0x20ca15){while(--_0x20ca15){_0x513016['push'](_0x513016['shift']());}};_0x4189f5(++_0x1143c9);}(_0x660e,0x156));var _0xe660=function(_0x313ace,_0x1acde2){_0x313ace=_0x313ace-0x0;var _0x5c0b94=_0x660e[_0x313ace];return _0x5c0b94;};'use strict';var _=require(_0xe660('0x0'));var util=require(_0xe660('0x1'));var logger=require(_0xe660('0x2'))(_0xe660('0x3'));var moment=require(_0xe660('0x4'));var BPromise=require(_0xe660('0x5'));var rp=require(_0xe660('0x6'));var fs=require('fs');var path=require(_0xe660('0x7'));var rimraf=require(_0xe660('0x8'));var config=require('../../config/environment');var attributes=require(_0xe660('0x9'));module['exports']=function(_0x22e07f,_0x165e24){return _0x22e07f['define'](_0xe660('0xa'),attributes,{'tableName':_0xe660('0xb'),'paranoid':![],'indexes':[{'name':_0xe660('0xc'),'fields':[_0xe660('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa449=['lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x4a6217,_0x324686){var _0x38e45c=function(_0x371802){while(--_0x371802){_0x4a6217['push'](_0x4a6217['shift']());}};_0x38e45c(++_0x324686);}(_0xa449,0x198));var _0x9a44=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa449[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x9a44('0x0'));var util=require(_0x9a44('0x1'));var logger=require(_0x9a44('0x2'))(_0x9a44('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9a44('0x4'));var fs=require('fs');var path=require(_0x9a44('0x5'));var rimraf=require('rimraf');var config=require(_0x9a44('0x6'));var attributes=require('./screenRecording.attributes');module[_0x9a44('0x7')]=function(_0x898df3,_0x4fb715){return _0x898df3[_0x9a44('0x8')](_0x9a44('0x9'),attributes,{'tableName':_0x9a44('0xa'),'paranoid':![],'indexes':[{'name':_0x9a44('0xb'),'fields':[_0x9a44('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 df4b672..445558f 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 _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xd922a0,_0xf31a1){var _0x34f366=function(_0x29dbf4){while(--_0x29dbf4){_0xd922a0['push'](_0xd922a0['shift']());}};_0x34f366(++_0xf31a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x9bad2e,_0x5973ca){var _0x297e27=function(_0x250af7){while(--_0x250af7){_0x9bad2e['push'](_0x9bad2e['shift']());}};_0x297e27(++_0x5973ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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/setting/index.js b/server/api/setting/index.js index aa14e99..98b0a14 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 _0xfa02=['getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','logo','extname','originalname','post','single','file','addLogo','%s%s','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred'];(function(_0x5ee8a1,_0x357d4f){var _0x59123c=function(_0x5a6648){while(--_0x5a6648){_0x5ee8a1['push'](_0x5ee8a1['shift']());}};_0x59123c(++_0x357d4f);}(_0xfa02,0xfb));var _0x2fa0=function(_0x47ba83,_0x2873f7){_0x47ba83=_0x47ba83-0x0;var _0x2d8e4c=_0xfa02[_0x47ba83];return _0x2d8e4c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2fa0('0x0'));var router=express[_0x2fa0('0x1')]();var auth=require(_0x2fa0('0x2'));var interaction=require(_0x2fa0('0x3'));var config=require(_0x2fa0('0x4'));var controller=require(_0x2fa0('0x5'));router[_0x2fa0('0x6')]('/',auth[_0x2fa0('0x7')](),controller[_0x2fa0('0x8')]);router[_0x2fa0('0x6')](_0x2fa0('0x9'),controller[_0x2fa0('0xa')]);router[_0x2fa0('0x6')]('/:id/logo',controller['getLogo']);router[_0x2fa0('0x6')](_0x2fa0('0xb'),controller[_0x2fa0('0xc')]);router['get']('/:id/gdpr',controller[_0x2fa0('0xd')]);router['get'](_0x2fa0('0xe'),controller[_0x2fa0('0xf')]);router[_0x2fa0('0x6')](_0x2fa0('0x10'),controller['getFavicon']);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0x52fefc,_0xc6759e,_0x5430af){_0x5430af(null,path[_0x2fa0('0x12')](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x25df77,_0x257a78,_0x564447){_0x564447(null,util[_0x2fa0('0x15')]('%s%s',_0x2fa0('0x16'),path[_0x2fa0('0x17')](_0x257a78[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')]('/:id/logo',upload[_0x2fa0('0x1a')](_0x2fa0('0x1b')),controller[_0x2fa0('0x1c')]);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0x1bd59b,_0x27e714,_0x45e09f){_0x45e09f(null,path[_0x2fa0('0x12')](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x534454,_0x253a9a,_0x47449e){_0x47449e(null,util[_0x2fa0('0x15')](_0x2fa0('0x1d'),'logologin',path[_0x2fa0('0x17')](_0x253a9a[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')](_0x2fa0('0xb'),upload['single']('file'),controller[_0x2fa0('0x1e')]);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0xea977f,_0x257714,_0x2b9868){_0x2b9868(null,path['join'](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x2af358,_0x128c1e,_0x2ea956){_0x2ea956(null,util[_0x2fa0('0x15')]('%s%s',_0x2fa0('0x1f'),path[_0x2fa0('0x17')](_0x128c1e[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')](_0x2fa0('0xe'),upload[_0x2fa0('0x1a')](_0x2fa0('0x1b')),controller[_0x2fa0('0x20')]);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0x13c208,_0x211c13,_0x41b16f){_0x41b16f(null,path[_0x2fa0('0x12')](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x569647,_0x4f93c2,_0x19a464){_0x19a464(null,util[_0x2fa0('0x15')](_0x2fa0('0x1d'),_0x2fa0('0x21'),path[_0x2fa0('0x17')](_0x4f93c2[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')]('/:id/favicon',upload['single'](_0x2fa0('0x1b')),controller[_0x2fa0('0x22')]);router[_0x2fa0('0x23')](_0x2fa0('0x9'),auth[_0x2fa0('0x7')](),controller[_0x2fa0('0x24')]);module[_0x2fa0('0x25')]=router; \ No newline at end of file +var _0x243d=['format','logo','post','single','file','addLogo','server/files/images/logos/','%s%s','logologin','extname','originalname','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','/:id','multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/logo','getLogo','/:id/logo_login','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x4c3057,_0x4193ba){var _0x83fd6d=function(_0x3d554f){while(--_0x3d554f){_0x4c3057['push'](_0x4c3057['shift']());}};_0x83fd6d(++_0x4193ba);}(_0x243d,0x14a));var _0xd243=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x243d[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xd243('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd243('0x1'));var express=require('express');var router=express[_0xd243('0x2')]();var auth=require(_0xd243('0x3'));var interaction=require(_0xd243('0x4'));var config=require('../../config/environment');var controller=require('./setting.controller');router[_0xd243('0x5')]('/',auth[_0xd243('0x6')](),controller[_0xd243('0x7')]);router[_0xd243('0x5')]('/:id',controller[_0xd243('0x8')]);router[_0xd243('0x5')](_0xd243('0x9'),controller[_0xd243('0xa')]);router[_0xd243('0x5')](_0xd243('0xb'),controller['getLogoLogin']);router[_0xd243('0x5')](_0xd243('0xc'),controller[_0xd243('0xd')]);router[_0xd243('0x5')](_0xd243('0xe'),controller[_0xd243('0xf')]);router[_0xd243('0x5')](_0xd243('0x10'),controller[_0xd243('0x11')]);var upload=multer({'storage':multer[_0xd243('0x12')]({'destination':function(_0x25f481,_0x19f02f,_0x5b2cbc){_0x5b2cbc(null,path[_0xd243('0x13')](config[_0xd243('0x14')],'server/files/images/logos/'));},'filename':function(_0xc88d1d,_0x32ae02,_0x25fdcc){_0x25fdcc(null,util[_0xd243('0x15')]('%s%s',_0xd243('0x16'),path['extname'](_0x32ae02['originalname'])));}})});router[_0xd243('0x17')](_0xd243('0x9'),upload[_0xd243('0x18')](_0xd243('0x19')),controller[_0xd243('0x1a')]);var upload=multer({'storage':multer[_0xd243('0x12')]({'destination':function(_0x4f0c7b,_0x1ed0bb,_0x62b08f){_0x62b08f(null,path[_0xd243('0x13')](config[_0xd243('0x14')],_0xd243('0x1b')));},'filename':function(_0x311a4e,_0xa5e75a,_0x5ad5a8){_0x5ad5a8(null,util[_0xd243('0x15')](_0xd243('0x1c'),_0xd243('0x1d'),path[_0xd243('0x1e')](_0xa5e75a[_0xd243('0x1f')])));}})});router[_0xd243('0x17')](_0xd243('0xb'),upload[_0xd243('0x18')](_0xd243('0x19')),controller[_0xd243('0x20')]);var upload=multer({'storage':multer[_0xd243('0x12')]({'destination':function(_0x4b4d57,_0x1b122b,_0x3306c3){_0x3306c3(null,path[_0xd243('0x13')](config[_0xd243('0x14')],'server/files/images/logos/'));},'filename':function(_0x3f3b23,_0x1964dd,_0x1afd9e){_0x1afd9e(null,util[_0xd243('0x15')](_0xd243('0x1c'),_0xd243('0x21'),path['extname'](_0x1964dd[_0xd243('0x1f')])));}})});router[_0xd243('0x17')](_0xd243('0xe'),upload[_0xd243('0x18')](_0xd243('0x19')),controller[_0xd243('0x22')]);var upload=multer({'storage':multer[_0xd243('0x12')]({'destination':function(_0x867ae0,_0x5d2131,_0x27eee1){_0x27eee1(null,path['join'](config[_0xd243('0x14')],'server/files/images/logos/'));},'filename':function(_0x56e5ac,_0x14478c,_0x582e2d){_0x582e2d(null,util[_0xd243('0x15')](_0xd243('0x1c'),_0xd243('0x23'),path[_0xd243('0x1e')](_0x14478c[_0xd243('0x1f')])));}})});router[_0xd243('0x17')](_0xd243('0x10'),upload['single'](_0xd243('0x19')),controller[_0xd243('0x24')]);router[_0xd243('0x25')](_0xd243('0x26'),auth[_0xd243('0x6')](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 45226de..0675994 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 _0x5937=['min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','exports','INTEGER'];(function(_0x7a2507,_0x505b2d){var _0x106fc9=function(_0x5ddbba){while(--_0x5ddbba){_0x7a2507['push'](_0x7a2507['shift']());}};_0x106fc9(++_0x505b2d);}(_0x5937,0x1b6));var _0x7593=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5937[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x7593('0x0')]={'min_internal':{'type':Sequelize[_0x7593('0x1')](0xb),'unique':_0x7593('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x7593('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x7593('0x3')],'defaultValue':_0x7593('0x4')},'logo':{'type':Sequelize[_0x7593('0x3')]},'defaultLogo':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x7593('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x7593('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x7593('0x3')]},'turnaddr':{'type':Sequelize[_0x7593('0x3')]},'turnusername':{'type':Sequelize[_0x7593('0x3')]},'turnpassword':{'type':Sequelize[_0x7593('0x3')]},'pageTitle':{'type':Sequelize[_0x7593('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x7593('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x7593('0x3')],'defaultValue':_0x7593('0x6')},'enableEmailPreview':{'type':Sequelize[_0x7593('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x7593('0x7')},'chatTimeout':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x7593('0x3')]},'defaultPreferred':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x7593('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x7593('0x3')]},'defaultFavicon':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x8d73=['https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize','min_internal','INTEGER','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN'];(function(_0x5ef186,_0x10c138){var _0x1c8077=function(_0x361bd5){while(--_0x361bd5){_0x5ef186['push'](_0x5ef186['shift']());}};_0x1c8077(++_0x10c138);}(_0x8d73,0x15a));var _0x38d7=function(_0x41c44d,_0x31d1eb){_0x41c44d=_0x41c44d-0x0;var _0x5e00f5=_0x8d73[_0x41c44d];return _0x5e00f5;};'use strict';var Sequelize=require(_0x38d7('0x0'));module['exports']={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0x38d7('0x1'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x38d7('0x2')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x38d7('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x38d7('0x3')},'logo':{'type':Sequelize[_0x38d7('0x4')]},'defaultLogo':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x38d7('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x38d7('0x4')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x38d7('0x4')]},'turnpassword':{'type':Sequelize[_0x38d7('0x4')]},'pageTitle':{'type':Sequelize[_0x38d7('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x38d7('0x4')],'defaultValue':_0x38d7('0x6')},'enableEmailPreview':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x38d7('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x38d7('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x38d7('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x38d7('0x7')},'chatTimeout':{'type':Sequelize[_0x38d7('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x38d7('0x4')]},'defaultPreferred':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x38d7('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x38d7('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x38d7('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x38d7('0x4')]},'defaultFavicon':{'type':Sequelize[_0x38d7('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x38d7('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 65098c9..c1e1ccc 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 _0x56dd=['VIRTUAL','options','includeAll','include','findAll','show','params','find','update','body','readFileSync','root','server/files/templates/stun.ejs','render','join','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','toLower','default_logo.png','custom','upperFirst','\x20not\x20found','download','getLogoLogin','default_loginLogo.png','Sequelize','getPreferred','defaultPreferred','default_preferred.png','default','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0xa4d6e,_0x193b55){var _0x1f421f=function(_0x21bd16){while(--_0x21bd16){_0xa4d6e['push'](_0xa4d6e['shift']());}};_0x1f421f(++_0x193b55);}(_0x56dd,0xb3));var _0xd56d=function(_0x24ee9c,_0x56df20){_0x24ee9c=_0x24ee9c-0x0;var _0x4b06c7=_0x56dd[_0x24ee9c];return _0x4b06c7;};'use strict';var pdf=require(_0xd56d('0x0'));var emlformat=require(_0xd56d('0x1'));var rimraf=require(_0xd56d('0x2'));var zipdir=require(_0xd56d('0x3'));var jsonpatch=require(_0xd56d('0x4'));var rp=require(_0xd56d('0x5'));var moment=require(_0xd56d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd56d('0x7'));var util=require('util');var path=require(_0xd56d('0x8'));var sox=require(_0xd56d('0x9'));var csv=require(_0xd56d('0xa'));var ejs=require(_0xd56d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd56d('0xc'));var crypto=require(_0xd56d('0xd'));var jsforce=require(_0xd56d('0xe'));var deskjs=require(_0xd56d('0xf'));var toCsv=require(_0xd56d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd56d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd56d('0x11'));var as=require(_0xd56d('0x12'));var hardwareService=require(_0xd56d('0x13'));var logger=require(_0xd56d('0x14'))(_0xd56d('0x15'));var utils=require(_0xd56d('0x16'));var config=require(_0xd56d('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd56d('0x18'));var client=jayson['client'][_0xd56d('0x19')]({'port':0x232a});function checkPasswordPattern(_0xe1cc9c,_0x42f09c,_0x3e2a8b){if(_0x3e2a8b){var _0x52eca7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x52eca7['test'](_0x42f09c)){return _0xe1cc9c;}else{throw new db['Sequelize'][(_0xd56d('0x1a'))](_0xd56d('0x1b'));}}else{return _0xe1cc9c;}}function respondWithRpcPromise(_0x214a6c,_0x2914f2,_0x5e52ff,_0x52f168){return new BPromise(function(_0x45df6a,_0x516c95){var _0x3ef0f0=_0x52f168||client;return _0x3ef0f0['request'](_0x214a6c,_0x5e52ff)[_0xd56d('0x1c')](function(_0x3e49e6){logger[_0xd56d('0x1d')](_0xd56d('0x1e'),_0x2914f2,_0xd56d('0x1f'));logger[_0xd56d('0x20')](_0xd56d('0x21'),_0x2914f2,_0xd56d('0x1f'),JSON['stringify'](_0x3e49e6));if(_0x3e49e6[_0xd56d('0x22')]){if(_0x3e49e6[_0xd56d('0x22')][_0xd56d('0x23')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x2914f2,_0x3e49e6[_0xd56d('0x22')][_0xd56d('0x24')]);return _0x516c95(_0x3e49e6[_0xd56d('0x22')]['message']);}logger[_0xd56d('0x22')](_0xd56d('0x1e'),_0x2914f2,_0x3e49e6['error'][_0xd56d('0x24')]);return _0x45df6a(_0x3e49e6[_0xd56d('0x22')]['message']);}else{logger[_0xd56d('0x1d')]('Setting,\x20%s,\x20%s',_0x2914f2,_0xd56d('0x1f'));_0x45df6a(_0x3e49e6[_0xd56d('0x25')]['message']);}})[_0xd56d('0x26')](function(_0x1add97){logger[_0xd56d('0x22')](_0xd56d('0x1e'),_0x2914f2,_0x1add97);_0x516c95(_0x1add97);});});}function respondWithStatusCode(_0x558645,_0x35cdd4){_0x35cdd4=_0x35cdd4||0xcc;return function(_0x1d667c){if(_0x1d667c){return _0x558645[_0xd56d('0x27')](_0x35cdd4);}return _0x558645[_0xd56d('0x28')](_0x35cdd4)[_0xd56d('0x29')]();};}function respondWithResult(_0x260426,_0x5411ab){_0x5411ab=_0x5411ab||0xc8;return function(_0x54152b){if(_0x54152b){return _0x260426[_0xd56d('0x28')](_0x5411ab)['json'](_0x54152b);}};}function respondWithFilteredResult(_0x337df7,_0x103ec9){return function(_0x147058){if(_0x147058){var _0x563b83=_0x147058[_0xd56d('0x2a')],_0x2d38df=_0x103ec9[_0xd56d('0x2b')],_0x3ee8cb=_0x103ec9[_0xd56d('0x2b')]+_0x103ec9[_0xd56d('0x2c')],_0x5af1a3;if(_0x3ee8cb>=_0x563b83){_0x3ee8cb=_0x563b83;_0x5af1a3=0xc8;}else{_0x5af1a3=0xce;}_0x337df7[_0xd56d('0x28')](_0x5af1a3);return _0x337df7['set'](_0xd56d('0x2d'),_0x2d38df+'-'+_0x3ee8cb+'/'+_0x563b83)[_0xd56d('0x2e')](_0x147058);}return null;};}function patchUpdates(_0x5136d8){return function(_0x2d10d3){try{jsonpatch[_0xd56d('0x2f')](_0x2d10d3,_0x5136d8,!![]);}catch(_0x59452b){return BPromise[_0xd56d('0x30')](_0x59452b);}return _0x2d10d3[_0xd56d('0x31')]();};}function saveUpdates(_0x4506cf,_0x319c0b){return function(_0x11ed96){if(_0x11ed96){return _0x11ed96['update'](_0x4506cf)[_0xd56d('0x1c')](function(_0x50ff2c){return _0x50ff2c;});}return null;};}function removeEntity(_0x169e8b,_0x3d9df0){return function(_0x35250d){if(_0x35250d){return _0x35250d[_0xd56d('0x32')]()[_0xd56d('0x1c')](function(){_0x169e8b['status'](0xcc)[_0xd56d('0x29')]();});}};}function handleEntityNotFound(_0x1bc5b5,_0xd4d73a){return function(_0x38cdbd){if(!_0x38cdbd){_0x1bc5b5[_0xd56d('0x27')](0x194);}return _0x38cdbd;};}function handleError(_0x343632,_0x1661bb){_0x1661bb=_0x1661bb||0x1f4;return function(_0x1874ad){logger[_0xd56d('0x22')](_0x1874ad[_0xd56d('0x33')]);if(_0x1874ad[_0xd56d('0x34')]){delete _0x1874ad[_0xd56d('0x34')];}_0x343632[_0xd56d('0x28')](_0x1661bb)[_0xd56d('0x35')](_0x1874ad);};}exports['index']=function(_0x40ecb9,_0x47865a){var _0x29ed50={},_0xbf90f={},_0x28e74b={'count':0x0,'rows':[]};var _0x4b53a6=_[_0xd56d('0x36')](db[_0xd56d('0x37')][_0xd56d('0x38')],function(_0x4b60e3){return{'name':_0x4b60e3[_0xd56d('0x39')],'type':_0x4b60e3[_0xd56d('0x3a')][_0xd56d('0x3b')]};});_0xbf90f[_0xd56d('0x3c')]=_[_0xd56d('0x36')](_0x4b53a6,_0xd56d('0x34'));_0xbf90f[_0xd56d('0x3d')]=_[_0xd56d('0x3e')](_0x40ecb9[_0xd56d('0x3d')]);_0xbf90f[_0xd56d('0x3f')]=_[_0xd56d('0x40')](_0xbf90f[_0xd56d('0x3c')],_0xbf90f[_0xd56d('0x3d')]);_0x29ed50['attributes']=_[_0xd56d('0x40')](_0xbf90f[_0xd56d('0x3c')],qs['fields'](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x41')]));_0x29ed50[_0xd56d('0x42')]=_0x29ed50[_0xd56d('0x42')][_0xd56d('0x43')]?_0x29ed50[_0xd56d('0x42')]:_0xbf90f[_0xd56d('0x3c')];if(!_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x44')](_0xd56d('0x45'))){_0x29ed50['limit']=qs[_0xd56d('0x2c')](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x2c')]);_0x29ed50['offset']=qs['offset'](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x2b')]);}_0x29ed50['order']=qs[_0xd56d('0x46')](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x46')]);_0x29ed50['where']=qs[_0xd56d('0x3f')](_[_0xd56d('0x47')](_0x40ecb9[_0xd56d('0x3d')],_0xbf90f[_0xd56d('0x3f')]));if(_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x48')]){_0x29ed50[_0xd56d('0x49')]=_[_0xd56d('0x4a')](_0x29ed50[_0xd56d('0x49')],{'$or':_[_0xd56d('0x36')](_0x4b53a6,function(_0x249bec){if(_0x249bec[_0xd56d('0x3a')]!==_0xd56d('0x4b')){var _0x3abb8f={};_0x3abb8f[_0x249bec[_0xd56d('0x34')]]={'$like':'%'+_0x40ecb9['query']['filter']+'%'};return _0x3abb8f;}})});}_0x29ed50=_[_0xd56d('0x4a')]({},_0x29ed50,_0x40ecb9[_0xd56d('0x4c')]);var _0x47895a={'where':_0x29ed50[_0xd56d('0x49')]};return db[_0xd56d('0x37')][_0xd56d('0x2a')](_0x47895a)[_0xd56d('0x1c')](function(_0x13ce1f){_0x28e74b['count']=_0x13ce1f;if(_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x4d')]){_0x29ed50[_0xd56d('0x4e')]=[{'all':!![]}];}return db['Setting'][_0xd56d('0x4f')](_0x29ed50);})[_0xd56d('0x1c')](function(_0x51b4e2){_0x28e74b['rows']=_0x51b4e2;return _0x28e74b;})[_0xd56d('0x1c')](respondWithFilteredResult(_0x47865a,_0x29ed50))[_0xd56d('0x26')](handleError(_0x47865a,null));};exports[_0xd56d('0x50')]=function(_0x4ccbf8,_0x186430){var _0x472d6d={'raw':![],'where':{'id':_0x4ccbf8[_0xd56d('0x51')]['id']}},_0x1040ce={};_0x1040ce[_0xd56d('0x3c')]=_[_0xd56d('0x3e')](db[_0xd56d('0x37')][_0xd56d('0x38')]);_0x1040ce[_0xd56d('0x3d')]=_[_0xd56d('0x3e')](_0x4ccbf8['query']);_0x1040ce[_0xd56d('0x3f')]=_[_0xd56d('0x40')](_0x1040ce[_0xd56d('0x3c')],_0x1040ce['query']);_0x472d6d[_0xd56d('0x42')]=_[_0xd56d('0x40')](_0x1040ce[_0xd56d('0x3c')],qs[_0xd56d('0x41')](_0x4ccbf8[_0xd56d('0x3d')][_0xd56d('0x41')]));_0x472d6d['attributes']=_0x472d6d[_0xd56d('0x42')]['length']?_0x472d6d['attributes']:_0x1040ce[_0xd56d('0x3c')];if(_0x4ccbf8[_0xd56d('0x3d')][_0xd56d('0x4d')]){_0x472d6d[_0xd56d('0x4e')]=[{'all':!![]}];}_0x472d6d=_[_0xd56d('0x4a')]({},_0x472d6d,_0x4ccbf8[_0xd56d('0x4c')]);return db[_0xd56d('0x37')][_0xd56d('0x52')](_0x472d6d)[_0xd56d('0x1c')](handleEntityNotFound(_0x186430,null))[_0xd56d('0x1c')](respondWithResult(_0x186430,null))[_0xd56d('0x26')](handleError(_0x186430,null));};exports[_0xd56d('0x53')]=function(_0x242aa3,_0x272238,_0x19c465){var _0x4d14a8;return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x242aa3[_0xd56d('0x51')]['id']}})['then'](handleEntityNotFound(_0x272238,null))[_0xd56d('0x1c')](saveUpdates(_0x242aa3[_0xd56d('0x54')],null))['then'](function(_0x1fb2d3){if(_0x1fb2d3){_0x4d14a8=_0x1fb2d3['get']({'plain':!![]});var _0x22ddc4=fs[_0xd56d('0x55')](path['join'](config[_0xd56d('0x56')],_0xd56d('0x57')),'utf8');var _0x2d75e8=ejs[_0xd56d('0x58')](_0x22ddc4,_0x4d14a8);var _0x7338cc=fs[_0xd56d('0x55')](path[_0xd56d('0x59')](config[_0xd56d('0x56')],'server/files/templates/turn.ejs'),_0xd56d('0x5a'));var _0x2472db=ejs[_0xd56d('0x58')](_0x7338cc,_0x4d14a8);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2d75e8);fs[_0xd56d('0x5b')](_0xd56d('0x5c'),_0x2472db);return respondWithRpcPromise(_0xd56d('0x5d'),'update',{'module':_0xd56d('0x5e')});}})[_0xd56d('0x1c')](function(){return respondWithRpcPromise(_0xd56d('0x5d'),_0xd56d('0x53'),{'module':_0xd56d('0x5f')});})['then'](function(){return _0x4d14a8||null;})[_0xd56d('0x1c')](respondWithResult(_0x272238,null))[_0xd56d('0x26')](handleError(_0x272238,null));};exports[_0xd56d('0x60')]=function(_0x5ea054,_0x2ab963,_0x1d87c1){if(_0x5ea054[_0xd56d('0x61')]&&_0x5ea054[_0xd56d('0x61')][_0xd56d('0x62')]){_0x5ea054[_0xd56d('0x54')]['logo']=_0x5ea054['file'][_0xd56d('0x62')];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x5ea054['params']['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0x2ab963,null))['then'](saveUpdates(_0x5ea054[_0xd56d('0x54')],null))[_0xd56d('0x1c')](respondWithResult(_0x2ab963,null))[_0xd56d('0x26')](handleError(_0x2ab963,null));};exports[_0xd56d('0x63')]=function(_0x58d0c1,_0x1f2fab,_0x200f76){if(_0x58d0c1['file']&&_0x58d0c1[_0xd56d('0x61')][_0xd56d('0x62')]){_0x58d0c1[_0xd56d('0x54')][_0xd56d('0x64')]=_0x58d0c1[_0xd56d('0x61')][_0xd56d('0x62')];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x58d0c1['params']['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0x1f2fab,null))[_0xd56d('0x1c')](saveUpdates(_0x58d0c1[_0xd56d('0x54')],null))[_0xd56d('0x1c')](respondWithResult(_0x1f2fab,null))[_0xd56d('0x26')](handleError(_0x1f2fab,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x66')]=function(_0x23ecf9,_0x2b20d7,_0x310e72){var _0x2239e6=_0xd56d('0x67');var _0x27b5b7={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x519772){if(_0x519772){_0x27b5b7=_0x519772;}return db['Setting'][_0xd56d('0x52')]({'where':{'id':_0x23ecf9['params']['id']},'attributes':[_0xd56d('0x69'),'loginLogo',_0xd56d('0x6a'),_0xd56d('0x6b'),_0xd56d('0x6c'),_0xd56d('0x6d'),'defaultPreferred',_0xd56d('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x2b20d7,null))[_0xd56d('0x1c')](function(_0x7de82c){if(_0x7de82c){var _0x7d9caa=_0x7de82c[_0xd56d('0x69')]&&fs[_0xd56d('0x6f')](path['join'](config[_0xd56d('0x56')],_0x2239e6,_[_0xd56d('0x70')](_0x7de82c['logo'])))?path['join'](config[_0xd56d('0x56')],_0x2239e6,_[_0xd56d('0x70')](_0x7de82c[_0xd56d('0x69')])):path[_0xd56d('0x59')](config['root'],_0x2239e6,_[_0xd56d('0x70')](_0xd56d('0x71')));var _0x26753d='default'+_['upperFirst']('logo');if(_0x7de82c[_0x26753d]||!_0x27b5b7[_0xd56d('0x72')]){_0x7d9caa=path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x2239e6,_[_0xd56d('0x70')](_0xd56d('0x71')));}if(!fs[_0xd56d('0x6f')](_0x7d9caa)){throw new db['Sequelize'][(_0xd56d('0x1a'))](_[_0xd56d('0x73')]('logo')+_0xd56d('0x74'));}return _0x2b20d7[_0xd56d('0x75')](_0x7d9caa);}})['catch'](handleError(_0x2b20d7,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x76')]=function(_0x53fc10,_0x5aa0b4,_0x35d9da){var _0x756348='server/files/images/logos';var _0x467f0b={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x364ea8){if(_0x364ea8){_0x467f0b=_0x364ea8;}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x53fc10[_0xd56d('0x51')]['id']},'attributes':[_0xd56d('0x69'),_0xd56d('0x64'),'preferred',_0xd56d('0x6b'),_0xd56d('0x6c'),'defaultLoginLogo','defaultPreferred',_0xd56d('0x6e')],'raw':!![]});})[_0xd56d('0x1c')](handleEntityNotFound(_0x5aa0b4,null))[_0xd56d('0x1c')](function(_0x2c1268){if(_0x2c1268){var _0x2b48d9=_0x2c1268[_0xd56d('0x64')]&&fs[_0xd56d('0x6f')](path['join'](config[_0xd56d('0x56')],_0x756348,_[_0xd56d('0x70')](_0x2c1268[_0xd56d('0x64')])))?path['join'](config[_0xd56d('0x56')],_0x756348,_[_0xd56d('0x70')](_0x2c1268[_0xd56d('0x64')])):path['join'](config['root'],_0x756348,_[_0xd56d('0x70')]('default_loginLogo.png'));var _0x58abbf='default'+_[_0xd56d('0x73')](_0xd56d('0x64'));if(_0x2c1268[_0x58abbf]||!_0x467f0b[_0xd56d('0x72')]){_0x2b48d9=path['join'](config[_0xd56d('0x56')],_0x756348,_[_0xd56d('0x70')](_0xd56d('0x77')));}if(!fs['existsSync'](_0x2b48d9)){throw new db[(_0xd56d('0x78'))][(_0xd56d('0x1a'))](_[_0xd56d('0x73')]('loginLogo')+'\x20not\x20found');}return _0x5aa0b4[_0xd56d('0x75')](_0x2b48d9);}})[_0xd56d('0x26')](handleError(_0x5aa0b4,null));};exports['gdpr']=function(_0x4acf65,_0x18a0b1){return db['Setting']['find']({'where':{'id':_0x4acf65['params']['id']},'attributes':['securePassword']})[_0xd56d('0x1c')](respondWithResult(_0x18a0b1,null))[_0xd56d('0x26')](handleError(_0x18a0b1,null));};exports['addPreferred']=function(_0x4bfb9f,_0x48d96c,_0xaca5b8){if(_0x4bfb9f['file']&&_0x4bfb9f[_0xd56d('0x61')][_0xd56d('0x62')]){_0x4bfb9f['body'][_0xd56d('0x6a')]=_0x4bfb9f['file']['filename'];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x4bfb9f[_0xd56d('0x51')]['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0x48d96c,null))[_0xd56d('0x1c')](saveUpdates(_0x4bfb9f[_0xd56d('0x54')],null))[_0xd56d('0x1c')](respondWithResult(_0x48d96c,null))[_0xd56d('0x26')](handleError(_0x48d96c,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x79')]=function(_0x4f9810,_0x4e4106,_0x22c1f2){var _0x26fc63=_0xd56d('0x67');var _0x5541e5={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x2c6c66){if(_0x2c6c66){_0x5541e5=_0x2c6c66;}return db['Setting']['find']({'where':{'id':_0x4f9810[_0xd56d('0x51')]['id']},'attributes':['logo',_0xd56d('0x64'),'preferred','favicon',_0xd56d('0x6c'),_0xd56d('0x6d'),_0xd56d('0x7a'),_0xd56d('0x6e')],'raw':!![]});})[_0xd56d('0x1c')](handleEntityNotFound(_0x4e4106,null))[_0xd56d('0x1c')](function(_0x1e6c3a){if(_0x1e6c3a){var _0x271ea3=_0x1e6c3a['preferred']&&fs[_0xd56d('0x6f')](path[_0xd56d('0x59')](config['root'],_0x26fc63,_[_0xd56d('0x70')](_0x1e6c3a['preferred'])))?path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x26fc63,_[_0xd56d('0x70')](_0x1e6c3a[_0xd56d('0x6a')])):path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x26fc63,_[_0xd56d('0x70')](_0xd56d('0x7b')));var _0x4a32ae=_0xd56d('0x7c')+_['upperFirst'](_0xd56d('0x6a'));if(_0x1e6c3a[_0x4a32ae]||!_0x5541e5[_0xd56d('0x72')]||!_0x5541e5[_0xd56d('0x6a')]){_0x271ea3=path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x26fc63,_[_0xd56d('0x70')](_0xd56d('0x7b')));}if(!fs['existsSync'](_0x271ea3)){throw new db[(_0xd56d('0x78'))][(_0xd56d('0x1a'))](_[_0xd56d('0x73')](_0xd56d('0x6a'))+'\x20not\x20found');}return _0x4e4106['download'](_0x271ea3);}})[_0xd56d('0x26')](handleError(_0x4e4106,null));};exports['addFavicon']=function(_0x3d291c,_0xc13229,_0x390ae2){if(_0x3d291c['file']&&_0x3d291c[_0xd56d('0x61')][_0xd56d('0x62')]){_0x3d291c[_0xd56d('0x54')][_0xd56d('0x6b')]=_0x3d291c[_0xd56d('0x61')][_0xd56d('0x62')];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x3d291c[_0xd56d('0x51')]['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0xc13229,null))[_0xd56d('0x1c')](saveUpdates(_0x3d291c['body'],null))[_0xd56d('0x1c')](respondWithResult(_0xc13229,null))[_0xd56d('0x26')](handleError(_0xc13229,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x7d')]=function(_0x34dccd,_0x57c103,_0x29a017){var _0x484ca5='server/files/images/logos';var _0x4465d0={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x776fd7){if(_0x776fd7){_0x4465d0=_0x776fd7;}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x34dccd[_0xd56d('0x51')]['id']},'attributes':[_0xd56d('0x69'),_0xd56d('0x64'),_0xd56d('0x6a'),_0xd56d('0x6b'),_0xd56d('0x6c'),_0xd56d('0x6d'),_0xd56d('0x7a'),_0xd56d('0x6e')],'raw':!![]});})[_0xd56d('0x1c')](handleEntityNotFound(_0x57c103,null))[_0xd56d('0x1c')](function(_0x4d54f3){if(_0x4d54f3){var _0x528076=_0x4d54f3[_0xd56d('0x6b')]&&fs['existsSync'](path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x484ca5,_[_0xd56d('0x70')](_0x4d54f3['favicon'])))?path[_0xd56d('0x59')](config['root'],_0x484ca5,_['toLower'](_0x4d54f3['favicon'])):path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x484ca5,_[_0xd56d('0x70')](_0xd56d('0x7e')));var _0x2f37bc=_0xd56d('0x7c')+_[_0xd56d('0x73')](_0xd56d('0x6b'));if(_0x4d54f3[_0x2f37bc]||!_0x4465d0[_0xd56d('0x72')]){_0x528076=path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x484ca5,_[_0xd56d('0x70')]('default_favicon.ico'));}if(!fs[_0xd56d('0x6f')](_0x528076)){throw new db[(_0xd56d('0x78'))][(_0xd56d('0x1a'))](_[_0xd56d('0x73')](_0xd56d('0x6b'))+'\x20not\x20found');}return _0x57c103[_0xd56d('0x75')](_0x528076);}})['catch'](handleError(_0x57c103,null));}; \ No newline at end of file +var _0x9318=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','end','count','set','Content-Range','json','apply','destroy','sendStatus','name','send','index','map','Setting','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','limit','offset','order','sort','pick','where','merge','filter','options','includeAll','findAll','rows','include','find','params','body','get','readFileSync','join','root','server/files/templates/stun.ejs','utf8','render','writeFileSync','Reload','update','res_rtp_asterisk.so','addLogo','file','logo','filename','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','Sequelize','upperFirst','\x20not\x20found','download','default_loginLogo.png','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','custom','default_favicon.ico','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service'];(function(_0x153a15,_0x1d9f43){var _0x142618=function(_0x2e3a6e){while(--_0x2e3a6e){_0x153a15['push'](_0x153a15['shift']());}};_0x142618(++_0x1d9f43);}(_0x9318,0x1dd));var _0x8931=function(_0x166922,_0x3a4fac){_0x166922=_0x166922-0x0;var _0x33cea5=_0x9318[_0x166922];return _0x33cea5;};'use strict';var pdf=require(_0x8931('0x0'));var emlformat=require(_0x8931('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8931('0x2'));var jsonpatch=require(_0x8931('0x3'));var rp=require(_0x8931('0x4'));var moment=require(_0x8931('0x5'));var BPromise=require(_0x8931('0x6'));var Mustache=require(_0x8931('0x7'));var util=require(_0x8931('0x8'));var path=require(_0x8931('0x9'));var sox=require(_0x8931('0xa'));var csv=require(_0x8931('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8931('0xc'));var squel=require(_0x8931('0xd'));var crypto=require(_0x8931('0xe'));var jsforce=require(_0x8931('0xf'));var deskjs=require(_0x8931('0x10'));var toCsv=require(_0x8931('0xb'));var querystring=require(_0x8931('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8931('0x12'));var qs=require(_0x8931('0x13'));var as=require(_0x8931('0x14'));var hardwareService=require(_0x8931('0x15'));var logger=require(_0x8931('0x16'))(_0x8931('0x17'));var utils=require('../../config/utils');var config=require(_0x8931('0x18'));var db=require(_0x8931('0x19'))['db'];var jayson=require(_0x8931('0x1a'));var client=jayson['client'][_0x8931('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xfc649e,_0x4f76c4,_0x520dec){if(_0x520dec){var _0x1ebd91=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ebd91[_0x8931('0x1c')](_0x4f76c4)){return _0xfc649e;}else{throw new db['Sequelize'][(_0x8931('0x1d'))](_0x8931('0x1e'));}}else{return _0xfc649e;}}function respondWithRpcPromise(_0x5c3268,_0x22f366,_0x5dfcbe,_0x4bb6ac){return new BPromise(function(_0x10a0d4,_0x48ebd5){var _0x7227d8=_0x4bb6ac||client;return _0x7227d8['request'](_0x5c3268,_0x5dfcbe)[_0x8931('0x1f')](function(_0x5dedfc){logger['info'](_0x8931('0x20'),_0x22f366,_0x8931('0x21'));logger['debug'](_0x8931('0x22'),_0x22f366,'request\x20sent',JSON[_0x8931('0x23')](_0x5dedfc));if(_0x5dedfc[_0x8931('0x24')]){if(_0x5dedfc['error']['code']===0x1f4){logger[_0x8931('0x24')](_0x8931('0x20'),_0x22f366,_0x5dedfc[_0x8931('0x24')]['message']);return _0x48ebd5(_0x5dedfc[_0x8931('0x24')]['message']);}logger['error'](_0x8931('0x20'),_0x22f366,_0x5dedfc['error'][_0x8931('0x25')]);return _0x10a0d4(_0x5dedfc[_0x8931('0x24')]['message']);}else{logger[_0x8931('0x26')](_0x8931('0x20'),_0x22f366,_0x8931('0x21'));_0x10a0d4(_0x5dedfc[_0x8931('0x27')][_0x8931('0x25')]);}})[_0x8931('0x28')](function(_0x35408b){logger[_0x8931('0x24')](_0x8931('0x20'),_0x22f366,_0x35408b);_0x48ebd5(_0x35408b);});});}function respondWithStatusCode(_0x4cc0d5,_0x464db6){_0x464db6=_0x464db6||0xcc;return function(_0x3707d2){if(_0x3707d2){return _0x4cc0d5['sendStatus'](_0x464db6);}return _0x4cc0d5[_0x8931('0x29')](_0x464db6)[_0x8931('0x2a')]();};}function respondWithResult(_0x26ef4f,_0xcb4c4a){_0xcb4c4a=_0xcb4c4a||0xc8;return function(_0x10ea31){if(_0x10ea31){return _0x26ef4f[_0x8931('0x29')](_0xcb4c4a)['json'](_0x10ea31);}};}function respondWithFilteredResult(_0x29f69e,_0x2e6179){return function(_0x1ac110){if(_0x1ac110){var _0x6071ff=_0x1ac110[_0x8931('0x2b')],_0x151893=_0x2e6179['offset'],_0x2c5b32=_0x2e6179['offset']+_0x2e6179['limit'],_0x15338a;if(_0x2c5b32>=_0x6071ff){_0x2c5b32=_0x6071ff;_0x15338a=0xc8;}else{_0x15338a=0xce;}_0x29f69e['status'](_0x15338a);return _0x29f69e[_0x8931('0x2c')](_0x8931('0x2d'),_0x151893+'-'+_0x2c5b32+'/'+_0x6071ff)[_0x8931('0x2e')](_0x1ac110);}return null;};}function patchUpdates(_0x35d6ad){return function(_0x375c99){try{jsonpatch[_0x8931('0x2f')](_0x375c99,_0x35d6ad,!![]);}catch(_0xa2c34e){return BPromise['reject'](_0xa2c34e);}return _0x375c99['save']();};}function saveUpdates(_0x5652f8,_0x5d8ec9){return function(_0x5c12be){if(_0x5c12be){return _0x5c12be['update'](_0x5652f8)['then'](function(_0x3db823){return _0x3db823;});}return null;};}function removeEntity(_0x287186,_0x296896){return function(_0x2e56b0){if(_0x2e56b0){return _0x2e56b0[_0x8931('0x30')]()[_0x8931('0x1f')](function(){_0x287186[_0x8931('0x29')](0xcc)[_0x8931('0x2a')]();});}};}function handleEntityNotFound(_0xd800fd,_0x428c10){return function(_0x332685){if(!_0x332685){_0xd800fd[_0x8931('0x31')](0x194);}return _0x332685;};}function handleError(_0x3a953b,_0x5a3af1){_0x5a3af1=_0x5a3af1||0x1f4;return function(_0xccd4b0){logger['error'](_0xccd4b0['stack']);if(_0xccd4b0[_0x8931('0x32')]){delete _0xccd4b0[_0x8931('0x32')];}_0x3a953b[_0x8931('0x29')](_0x5a3af1)[_0x8931('0x33')](_0xccd4b0);};}exports[_0x8931('0x34')]=function(_0x1e7f0f,_0x444ee7){var _0x5ef882={},_0x3c4522={},_0x9ad2e={'count':0x0,'rows':[]};var _0x1bea97=_[_0x8931('0x35')](db[_0x8931('0x36')][_0x8931('0x37')],function(_0x1879f0){return{'name':_0x1879f0['fieldName'],'type':_0x1879f0[_0x8931('0x38')][_0x8931('0x39')]};});_0x3c4522[_0x8931('0x3a')]=_['map'](_0x1bea97,_0x8931('0x32'));_0x3c4522[_0x8931('0x3b')]=_[_0x8931('0x3c')](_0x1e7f0f[_0x8931('0x3b')]);_0x3c4522[_0x8931('0x3d')]=_[_0x8931('0x3e')](_0x3c4522[_0x8931('0x3a')],_0x3c4522[_0x8931('0x3b')]);_0x5ef882[_0x8931('0x3f')]=_[_0x8931('0x3e')](_0x3c4522[_0x8931('0x3a')],qs[_0x8931('0x40')](_0x1e7f0f[_0x8931('0x3b')][_0x8931('0x40')]));_0x5ef882[_0x8931('0x3f')]=_0x5ef882['attributes'][_0x8931('0x41')]?_0x5ef882['attributes']:_0x3c4522['model'];if(!_0x1e7f0f[_0x8931('0x3b')]['hasOwnProperty']('nolimit')){_0x5ef882[_0x8931('0x42')]=qs[_0x8931('0x42')](_0x1e7f0f[_0x8931('0x3b')][_0x8931('0x42')]);_0x5ef882[_0x8931('0x43')]=qs[_0x8931('0x43')](_0x1e7f0f[_0x8931('0x3b')][_0x8931('0x43')]);}_0x5ef882[_0x8931('0x44')]=qs[_0x8931('0x45')](_0x1e7f0f[_0x8931('0x3b')][_0x8931('0x45')]);_0x5ef882['where']=qs[_0x8931('0x3d')](_[_0x8931('0x46')](_0x1e7f0f[_0x8931('0x3b')],_0x3c4522[_0x8931('0x3d')]));if(_0x1e7f0f[_0x8931('0x3b')]['filter']){_0x5ef882[_0x8931('0x47')]=_[_0x8931('0x48')](_0x5ef882[_0x8931('0x47')],{'$or':_[_0x8931('0x35')](_0x1bea97,function(_0x288c0a){if(_0x288c0a[_0x8931('0x38')]!=='VIRTUAL'){var _0x5c91bd={};_0x5c91bd[_0x288c0a[_0x8931('0x32')]]={'$like':'%'+_0x1e7f0f[_0x8931('0x3b')][_0x8931('0x49')]+'%'};return _0x5c91bd;}})});}_0x5ef882=_[_0x8931('0x48')]({},_0x5ef882,_0x1e7f0f[_0x8931('0x4a')]);var _0x3444e6={'where':_0x5ef882['where']};return db[_0x8931('0x36')][_0x8931('0x2b')](_0x3444e6)['then'](function(_0x59edad){_0x9ad2e[_0x8931('0x2b')]=_0x59edad;if(_0x1e7f0f[_0x8931('0x3b')][_0x8931('0x4b')]){_0x5ef882['include']=[{'all':!![]}];}return db['Setting'][_0x8931('0x4c')](_0x5ef882);})['then'](function(_0x30d358){_0x9ad2e[_0x8931('0x4d')]=_0x30d358;return _0x9ad2e;})['then'](respondWithFilteredResult(_0x444ee7,_0x5ef882))[_0x8931('0x28')](handleError(_0x444ee7,null));};exports['show']=function(_0x521172,_0x2fa165){var _0x20079c={'raw':![],'where':{'id':_0x521172['params']['id']}},_0x147267={};_0x147267[_0x8931('0x3a')]=_[_0x8931('0x3c')](db['Setting'][_0x8931('0x37')]);_0x147267['query']=_['keys'](_0x521172[_0x8931('0x3b')]);_0x147267[_0x8931('0x3d')]=_[_0x8931('0x3e')](_0x147267[_0x8931('0x3a')],_0x147267[_0x8931('0x3b')]);_0x20079c[_0x8931('0x3f')]=_['intersection'](_0x147267['model'],qs[_0x8931('0x40')](_0x521172['query'][_0x8931('0x40')]));_0x20079c[_0x8931('0x3f')]=_0x20079c['attributes'][_0x8931('0x41')]?_0x20079c['attributes']:_0x147267[_0x8931('0x3a')];if(_0x521172[_0x8931('0x3b')][_0x8931('0x4b')]){_0x20079c[_0x8931('0x4e')]=[{'all':!![]}];}_0x20079c=_[_0x8931('0x48')]({},_0x20079c,_0x521172['options']);return db[_0x8931('0x36')]['find'](_0x20079c)['then'](handleEntityNotFound(_0x2fa165,null))['then'](respondWithResult(_0x2fa165,null))[_0x8931('0x28')](handleError(_0x2fa165,null));};exports['update']=function(_0x4290f9,_0x43366d,_0x5f3a50){var _0x28f5af;return db['Setting'][_0x8931('0x4f')]({'where':{'id':_0x4290f9[_0x8931('0x50')]['id']}})['then'](handleEntityNotFound(_0x43366d,null))[_0x8931('0x1f')](saveUpdates(_0x4290f9[_0x8931('0x51')],null))[_0x8931('0x1f')](function(_0x25c3d7){if(_0x25c3d7){_0x28f5af=_0x25c3d7[_0x8931('0x52')]({'plain':!![]});var _0x31e387=fs[_0x8931('0x53')](path[_0x8931('0x54')](config[_0x8931('0x55')],_0x8931('0x56')),_0x8931('0x57'));var _0x5626a2=ejs[_0x8931('0x58')](_0x31e387,_0x28f5af);var _0xe2e563=fs[_0x8931('0x53')](path['join'](config[_0x8931('0x55')],'server/files/templates/turn.ejs'),_0x8931('0x57'));var _0x4da2c6=ejs[_0x8931('0x58')](_0xe2e563,_0x28f5af);fs[_0x8931('0x59')]('/etc/asterisk/stun_xcally.conf',_0x5626a2);fs[_0x8931('0x59')]('/etc/asterisk/turn_xcally.conf',_0x4da2c6);return respondWithRpcPromise(_0x8931('0x5a'),'update',{'module':'res_stun_monitor.so'});}})[_0x8931('0x1f')](function(){return respondWithRpcPromise(_0x8931('0x5a'),_0x8931('0x5b'),{'module':_0x8931('0x5c')});})[_0x8931('0x1f')](function(){return _0x28f5af||null;})[_0x8931('0x1f')](respondWithResult(_0x43366d,null))[_0x8931('0x28')](handleError(_0x43366d,null));};exports[_0x8931('0x5d')]=function(_0x537c95,_0xc52a4f,_0x3ae00a){if(_0x537c95[_0x8931('0x5e')]&&_0x537c95['file']['filename']){_0x537c95[_0x8931('0x51')][_0x8931('0x5f')]=_0x537c95['file'][_0x8931('0x60')];}return db[_0x8931('0x36')][_0x8931('0x4f')]({'where':{'id':_0x537c95['params']['id']}})[_0x8931('0x1f')](handleEntityNotFound(_0xc52a4f,null))[_0x8931('0x1f')](saveUpdates(_0x537c95[_0x8931('0x51')],null))['then'](respondWithResult(_0xc52a4f,null))[_0x8931('0x28')](handleError(_0xc52a4f,null));};exports['addLogoLogin']=function(_0x158cc2,_0x4ea31b,_0xff59c1){if(_0x158cc2['file']&&_0x158cc2[_0x8931('0x5e')][_0x8931('0x60')]){_0x158cc2[_0x8931('0x51')][_0x8931('0x61')]=_0x158cc2[_0x8931('0x5e')]['filename'];}return db[_0x8931('0x36')][_0x8931('0x4f')]({'where':{'id':_0x158cc2[_0x8931('0x50')]['id']}})[_0x8931('0x1f')](handleEntityNotFound(_0x4ea31b,null))[_0x8931('0x1f')](saveUpdates(_0x158cc2[_0x8931('0x51')],null))[_0x8931('0x1f')](respondWithResult(_0x4ea31b,null))[_0x8931('0x28')](handleError(_0x4ea31b,null));};var utilLicense=require(_0x8931('0x62'));exports[_0x8931('0x63')]=function(_0x15bde9,_0x4770ec,_0x55b39c){var _0x3cd256=_0x8931('0x64');var _0x14430d={'custom':![]};return utilLicense[_0x8931('0x65')]()[_0x8931('0x1f')](function(_0x406f96){if(_0x406f96){_0x14430d=_0x406f96;}return db['Setting']['find']({'where':{'id':_0x15bde9[_0x8931('0x50')]['id']},'attributes':[_0x8931('0x5f'),_0x8931('0x61'),_0x8931('0x66'),_0x8931('0x67'),_0x8931('0x68'),_0x8931('0x69'),_0x8931('0x6a'),_0x8931('0x6b')],'raw':!![]});})[_0x8931('0x1f')](handleEntityNotFound(_0x4770ec,null))[_0x8931('0x1f')](function(_0xb9a1){if(_0xb9a1){var _0x392d49=_0xb9a1['logo']&&fs[_0x8931('0x6c')](path['join'](config[_0x8931('0x55')],_0x3cd256,_[_0x8931('0x6d')](_0xb9a1[_0x8931('0x5f')])))?path['join'](config['root'],_0x3cd256,_['toLower'](_0xb9a1[_0x8931('0x5f')])):path[_0x8931('0x54')](config[_0x8931('0x55')],_0x3cd256,_[_0x8931('0x6d')](_0x8931('0x6e')));var _0x427318=_0x8931('0x6f')+_['upperFirst'](_0x8931('0x5f'));if(_0xb9a1[_0x427318]||!_0x14430d['custom']){_0x392d49=path[_0x8931('0x54')](config[_0x8931('0x55')],_0x3cd256,_[_0x8931('0x6d')]('default_logo.png'));}if(!fs[_0x8931('0x6c')](_0x392d49)){throw new db[(_0x8931('0x70'))][(_0x8931('0x1d'))](_[_0x8931('0x71')](_0x8931('0x5f'))+_0x8931('0x72'));}return _0x4770ec[_0x8931('0x73')](_0x392d49);}})[_0x8931('0x28')](handleError(_0x4770ec,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x5a5f87,_0x33390f,_0x1eb6f8){var _0x2f2d19=_0x8931('0x64');var _0x46e715={'custom':![]};return utilLicense[_0x8931('0x65')]()['then'](function(_0x12cb07){if(_0x12cb07){_0x46e715=_0x12cb07;}return db['Setting'][_0x8931('0x4f')]({'where':{'id':_0x5a5f87['params']['id']},'attributes':[_0x8931('0x5f'),_0x8931('0x61'),_0x8931('0x66'),'favicon',_0x8931('0x68'),'defaultLoginLogo',_0x8931('0x6a'),_0x8931('0x6b')],'raw':!![]});})[_0x8931('0x1f')](handleEntityNotFound(_0x33390f,null))['then'](function(_0x26ac8b){if(_0x26ac8b){var _0xe50906=_0x26ac8b[_0x8931('0x61')]&&fs[_0x8931('0x6c')](path[_0x8931('0x54')](config[_0x8931('0x55')],_0x2f2d19,_[_0x8931('0x6d')](_0x26ac8b[_0x8931('0x61')])))?path[_0x8931('0x54')](config[_0x8931('0x55')],_0x2f2d19,_[_0x8931('0x6d')](_0x26ac8b[_0x8931('0x61')])):path['join'](config[_0x8931('0x55')],_0x2f2d19,_['toLower'](_0x8931('0x74')));var _0x2732ba=_0x8931('0x6f')+_[_0x8931('0x71')]('loginLogo');if(_0x26ac8b[_0x2732ba]||!_0x46e715['custom']){_0xe50906=path[_0x8931('0x54')](config[_0x8931('0x55')],_0x2f2d19,_['toLower']('default_loginLogo.png'));}if(!fs[_0x8931('0x6c')](_0xe50906)){throw new db[(_0x8931('0x70'))][(_0x8931('0x1d'))](_[_0x8931('0x71')](_0x8931('0x61'))+_0x8931('0x72'));}return _0x33390f[_0x8931('0x73')](_0xe50906);}})[_0x8931('0x28')](handleError(_0x33390f,null));};exports[_0x8931('0x75')]=function(_0x982b37,_0xce2775){return db[_0x8931('0x36')]['find']({'where':{'id':_0x982b37[_0x8931('0x50')]['id']},'attributes':[_0x8931('0x76')]})[_0x8931('0x1f')](respondWithResult(_0xce2775,null))[_0x8931('0x28')](handleError(_0xce2775,null));};exports[_0x8931('0x77')]=function(_0x1ee843,_0x5b6195,_0x33ed02){if(_0x1ee843['file']&&_0x1ee843[_0x8931('0x5e')]['filename']){_0x1ee843[_0x8931('0x51')]['preferred']=_0x1ee843[_0x8931('0x5e')]['filename'];}return db[_0x8931('0x36')][_0x8931('0x4f')]({'where':{'id':_0x1ee843[_0x8931('0x50')]['id']}})[_0x8931('0x1f')](handleEntityNotFound(_0x5b6195,null))[_0x8931('0x1f')](saveUpdates(_0x1ee843['body'],null))[_0x8931('0x1f')](respondWithResult(_0x5b6195,null))[_0x8931('0x28')](handleError(_0x5b6195,null));};var utilLicense=require(_0x8931('0x62'));exports[_0x8931('0x78')]=function(_0x56c7b8,_0x2474bc,_0x588105){var _0x438cfc=_0x8931('0x64');var _0x3333d7={'custom':![]};return utilLicense[_0x8931('0x65')]()[_0x8931('0x1f')](function(_0x3a3359){if(_0x3a3359){_0x3333d7=_0x3a3359;}return db['Setting'][_0x8931('0x4f')]({'where':{'id':_0x56c7b8[_0x8931('0x50')]['id']},'attributes':[_0x8931('0x5f'),_0x8931('0x61'),_0x8931('0x66'),_0x8931('0x67'),_0x8931('0x68'),_0x8931('0x69'),_0x8931('0x6a'),_0x8931('0x6b')],'raw':!![]});})[_0x8931('0x1f')](handleEntityNotFound(_0x2474bc,null))[_0x8931('0x1f')](function(_0x31849a){if(_0x31849a){var _0x34c814=_0x31849a[_0x8931('0x66')]&&fs[_0x8931('0x6c')](path[_0x8931('0x54')](config[_0x8931('0x55')],_0x438cfc,_['toLower'](_0x31849a[_0x8931('0x66')])))?path[_0x8931('0x54')](config[_0x8931('0x55')],_0x438cfc,_['toLower'](_0x31849a[_0x8931('0x66')])):path[_0x8931('0x54')](config[_0x8931('0x55')],_0x438cfc,_[_0x8931('0x6d')](_0x8931('0x79')));var _0x4acc36=_0x8931('0x6f')+_['upperFirst'](_0x8931('0x66'));if(_0x31849a[_0x4acc36]||!_0x3333d7[_0x8931('0x7a')]||!_0x3333d7[_0x8931('0x66')]){_0x34c814=path[_0x8931('0x54')](config[_0x8931('0x55')],_0x438cfc,_[_0x8931('0x6d')](_0x8931('0x79')));}if(!fs[_0x8931('0x6c')](_0x34c814)){throw new db[(_0x8931('0x70'))][(_0x8931('0x1d'))](_['upperFirst']('preferred')+'\x20not\x20found');}return _0x2474bc[_0x8931('0x73')](_0x34c814);}})[_0x8931('0x28')](handleError(_0x2474bc,null));};exports['addFavicon']=function(_0x5d2278,_0x440b9b,_0x3784f2){if(_0x5d2278['file']&&_0x5d2278['file'][_0x8931('0x60')]){_0x5d2278[_0x8931('0x51')][_0x8931('0x67')]=_0x5d2278[_0x8931('0x5e')][_0x8931('0x60')];}return db[_0x8931('0x36')]['find']({'where':{'id':_0x5d2278[_0x8931('0x50')]['id']}})['then'](handleEntityNotFound(_0x440b9b,null))[_0x8931('0x1f')](saveUpdates(_0x5d2278[_0x8931('0x51')],null))['then'](respondWithResult(_0x440b9b,null))[_0x8931('0x28')](handleError(_0x440b9b,null));};var utilLicense=require(_0x8931('0x62'));exports['getFavicon']=function(_0x1e8e0b,_0x6c0d45,_0x30d783){var _0x333988=_0x8931('0x64');var _0x4f596a={'custom':![]};return utilLicense[_0x8931('0x65')]()[_0x8931('0x1f')](function(_0x233d2d){if(_0x233d2d){_0x4f596a=_0x233d2d;}return db[_0x8931('0x36')][_0x8931('0x4f')]({'where':{'id':_0x1e8e0b['params']['id']},'attributes':[_0x8931('0x5f'),_0x8931('0x61'),_0x8931('0x66'),'favicon',_0x8931('0x68'),_0x8931('0x69'),_0x8931('0x6a'),_0x8931('0x6b')],'raw':!![]});})[_0x8931('0x1f')](handleEntityNotFound(_0x6c0d45,null))['then'](function(_0xf238b2){if(_0xf238b2){var _0x3cdad5=_0xf238b2[_0x8931('0x67')]&&fs[_0x8931('0x6c')](path[_0x8931('0x54')](config[_0x8931('0x55')],_0x333988,_[_0x8931('0x6d')](_0xf238b2['favicon'])))?path[_0x8931('0x54')](config[_0x8931('0x55')],_0x333988,_[_0x8931('0x6d')](_0xf238b2[_0x8931('0x67')])):path['join'](config[_0x8931('0x55')],_0x333988,_[_0x8931('0x6d')](_0x8931('0x7b')));var _0xb3b0b8='default'+_['upperFirst'](_0x8931('0x67'));if(_0xf238b2[_0xb3b0b8]||!_0x4f596a[_0x8931('0x7a')]){_0x3cdad5=path[_0x8931('0x54')](config[_0x8931('0x55')],_0x333988,_[_0x8931('0x6d')](_0x8931('0x7b')));}if(!fs[_0x8931('0x6c')](_0x3cdad5)){throw new db[(_0x8931('0x70'))]['ValidationError'](_['upperFirst'](_0x8931('0x67'))+'\x20not\x20found');}return _0x6c0d45['download'](_0x3cdad5);}})[_0x8931('0x28')](handleError(_0x6c0d45,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 69d8360..f4cef38 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 _0xdb1c=['exports','define','settings','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes'];(function(_0x3fd0e0,_0x33c544){var _0x282d11=function(_0xec6c90){while(--_0xec6c90){_0x3fd0e0['push'](_0x3fd0e0['shift']());}};_0x282d11(++_0x33c544);}(_0xdb1c,0x1bd));var _0xcdb1=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xdb1c[_0x547af];return _0x22f7f4;};'use strict';var _=require(_0xcdb1('0x0'));var util=require(_0xcdb1('0x1'));var logger=require('../../config/logger')(_0xcdb1('0x2'));var moment=require(_0xcdb1('0x3'));var BPromise=require(_0xcdb1('0x4'));var rp=require(_0xcdb1('0x5'));var fs=require('fs');var path=require(_0xcdb1('0x6'));var rimraf=require(_0xcdb1('0x7'));var config=require(_0xcdb1('0x8'));var attributes=require(_0xcdb1('0x9'));module[_0xcdb1('0xa')]=function(_0x1c84d9,_0x5df875){return _0x1c84d9[_0xcdb1('0xb')]('Setting',attributes,{'tableName':_0xcdb1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd0c0=['settings','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xd0c0,0x1a5));var _0x0d0c=function(_0x2d4264,_0x34154e){_0x2d4264=_0x2d4264-0x0;var _0x2914f2=_0xd0c0[_0x2d4264];return _0x2914f2;};'use strict';var _=require('lodash');var util=require(_0x0d0c('0x0'));var logger=require(_0x0d0c('0x1'))('api');var moment=require(_0x0d0c('0x2'));var BPromise=require('bluebird');var rp=require(_0x0d0c('0x3'));var fs=require('fs');var path=require(_0x0d0c('0x4'));var rimraf=require(_0x0d0c('0x5'));var config=require(_0x0d0c('0x6'));var attributes=require(_0x0d0c('0x7'));module[_0x0d0c('0x8')]=function(_0xa2c5db,_0x193a43){return _0xa2c5db['define']('Setting',attributes,{'tableName':_0x0d0c('0x9'),'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 02e8e87..df8d034 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 _0xfd13=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd13,0x1c7));var _0x3fd1=function(_0x1d9428,_0x5021a0){_0x1d9428=_0x1d9428-0x0;var _0x162843=_0xfd13[_0x1d9428];return _0x162843;};'use strict';var _=require('lodash');var util=require(_0x3fd1('0x0'));var moment=require(_0x3fd1('0x1'));var BPromise=require(_0x3fd1('0x2'));var rs=require(_0x3fd1('0x3'));var fs=require('fs');var Redis=require(_0x3fd1('0x4'));var db=require(_0x3fd1('0x5'))['db'];var utils=require(_0x3fd1('0x6'));var logger=require(_0x3fd1('0x7'))('rpc');var config=require(_0x3fd1('0x8'));var jayson=require(_0x3fd1('0x9'));var client=jayson[_0x3fd1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x382d8a,_0x2417d8,_0x3b841f){return new BPromise(function(_0x1fa195,_0x5eec46){return client[_0x3fd1('0xb')](_0x382d8a,_0x3b841f)[_0x3fd1('0xc')](function(_0x4dbca7){logger[_0x3fd1('0xd')](_0x3fd1('0xe'),_0x2417d8,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x2417d8,_0x3fd1('0xf'),JSON[_0x3fd1('0x10')](_0x4dbca7));if(_0x4dbca7[_0x3fd1('0x11')]){if(_0x4dbca7['error'][_0x3fd1('0x12')]===0x1f4){logger[_0x3fd1('0x11')]('Setting,\x20%s,\x20%s',_0x2417d8,_0x4dbca7[_0x3fd1('0x11')][_0x3fd1('0x13')]);return _0x5eec46(_0x4dbca7['error'][_0x3fd1('0x13')]);}logger[_0x3fd1('0x11')]('Setting,\x20%s,\x20%s',_0x2417d8,_0x4dbca7[_0x3fd1('0x11')][_0x3fd1('0x13')]);return _0x1fa195(_0x4dbca7['error']['message']);}else{logger['info'](_0x3fd1('0xe'),_0x2417d8,_0x3fd1('0xf'));_0x1fa195(_0x4dbca7['result'][_0x3fd1('0x13')]);}})[_0x3fd1('0x14')](function(_0x1594b0){logger['error'](_0x3fd1('0xe'),_0x2417d8,_0x1594b0);_0x5eec46(_0x1594b0);});});} \ No newline at end of file +var _0xaabc=['moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x38bfb6,_0x17bc5a){var _0x17f5f9=function(_0x5bd015){while(--_0x5bd015){_0x38bfb6['push'](_0x38bfb6['shift']());}};_0x17f5f9(++_0x17bc5a);}(_0xaabc,0x9e));var _0xcaab=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0xaabc[_0xb6e2ea];return _0x2a57bb;};'use strict';var _=require(_0xcaab('0x0'));var util=require(_0xcaab('0x1'));var moment=require(_0xcaab('0x2'));var BPromise=require('bluebird');var rs=require(_0xcaab('0x3'));var fs=require('fs');var Redis=require(_0xcaab('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcaab('0x5'));var config=require(_0xcaab('0x6'));var jayson=require(_0xcaab('0x7'));var client=jayson[_0xcaab('0x8')][_0xcaab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c0a74,_0xef2f3a,_0x2b7900){return new BPromise(function(_0x17f15b,_0x15f19d){return client['request'](_0x2c0a74,_0x2b7900)[_0xcaab('0xa')](function(_0x56c94c){logger[_0xcaab('0xb')](_0xcaab('0xc'),_0xef2f3a,_0xcaab('0xd'));logger['debug'](_0xcaab('0xe'),_0xef2f3a,_0xcaab('0xd'),JSON[_0xcaab('0xf')](_0x56c94c));if(_0x56c94c[_0xcaab('0x10')]){if(_0x56c94c[_0xcaab('0x10')][_0xcaab('0x11')]===0x1f4){logger['error'](_0xcaab('0xc'),_0xef2f3a,_0x56c94c[_0xcaab('0x10')][_0xcaab('0x12')]);return _0x15f19d(_0x56c94c[_0xcaab('0x10')][_0xcaab('0x12')]);}logger[_0xcaab('0x10')](_0xcaab('0xc'),_0xef2f3a,_0x56c94c[_0xcaab('0x10')][_0xcaab('0x12')]);return _0x17f15b(_0x56c94c['error'][_0xcaab('0x12')]);}else{logger[_0xcaab('0xb')](_0xcaab('0xc'),_0xef2f3a,_0xcaab('0xd'));_0x17f15b(_0x56c94c[_0xcaab('0x13')][_0xcaab('0x12')]);}})['catch'](function(_0x397ca6){logger[_0xcaab('0x10')](_0xcaab('0xc'),_0xef2f3a,_0x397ca6);_0x15f19d(_0x397ca6);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 81ca90c..091155c 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 _0x35d0=['/:id/status','status','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','statusGet','/:id/users','getAgents','post','addAnswer','notify','addApplications','/:id/send','send'];(function(_0x30143a,_0x2dcff2){var _0x5b3b41=function(_0x55acd3){while(--_0x55acd3){_0x30143a['push'](_0x30143a['shift']());}};_0x5b3b41(++_0x2dcff2);}(_0x35d0,0xf9));var _0x035d=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0x35d0[_0x4cc03b];return _0xf0358c;};'use strict';var multer=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var path=require('path');var timeout=require(_0x035d('0x2'));var express=require(_0x035d('0x3'));var router=express[_0x035d('0x4')]();var auth=require(_0x035d('0x5'));var interaction=require(_0x035d('0x6'));var config=require(_0x035d('0x7'));var controller=require('./smsAccount.controller');router[_0x035d('0x8')]('/',auth[_0x035d('0x9')](),controller[_0x035d('0xa')]);router[_0x035d('0x8')]('/describe',auth[_0x035d('0x9')](),controller[_0x035d('0xb')]);router[_0x035d('0x8')](_0x035d('0xc'),auth[_0x035d('0x9')](),controller[_0x035d('0xd')]);router[_0x035d('0x8')](_0x035d('0xe'),auth[_0x035d('0x9')](),controller[_0x035d('0xf')]);router['get'](_0x035d('0x10'),auth['isAuthenticated'](),controller[_0x035d('0x11')]);router['get'](_0x035d('0x12'),auth['isAuthenticated'](),controller[_0x035d('0x13')]);router[_0x035d('0x8')](_0x035d('0x14'),auth[_0x035d('0x9')](),controller[_0x035d('0x15')]);router['get']('/:id/status',controller[_0x035d('0x16')]);router[_0x035d('0x8')](_0x035d('0x17'),auth[_0x035d('0x9')](),controller[_0x035d('0x18')]);router[_0x035d('0x19')]('/',auth[_0x035d('0x9')](),controller['create']);router[_0x035d('0x19')](_0x035d('0xe'),auth[_0x035d('0x9')](),controller['addDisposition']);router[_0x035d('0x19')]('/:id/canned_answers',auth[_0x035d('0x9')](),controller[_0x035d('0x1a')]);router[_0x035d('0x19')]('/:id/notify',controller[_0x035d('0x1b')]);router[_0x035d('0x19')]('/:id/applications',auth[_0x035d('0x9')](),controller[_0x035d('0x1c')]);router[_0x035d('0x19')](_0x035d('0x1d'),auth['isAuthenticated'](),controller[_0x035d('0x1e')]);router[_0x035d('0x19')](_0x035d('0x1f'),controller[_0x035d('0x20')]);router['post'](_0x035d('0x17'),auth[_0x035d('0x9')](),controller[_0x035d('0x21')]);router['put'](_0x035d('0xc'),auth[_0x035d('0x9')](),controller[_0x035d('0x22')]);router[_0x035d('0x23')](_0x035d('0xc'),auth[_0x035d('0x9')](),controller[_0x035d('0x24')]);router[_0x035d('0x23')](_0x035d('0xe'),auth['isAuthenticated'](),controller[_0x035d('0x25')]);router[_0x035d('0x23')]('/:id/canned_answers',auth[_0x035d('0x9')](),controller[_0x035d('0x26')]);router[_0x035d('0x23')]('/:id/users',auth[_0x035d('0x9')](),controller[_0x035d('0x27')]);module['exports']=router; \ No newline at end of file +var _0x373d=['index','/describe','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send','send','status','addAgents','put','delete','destroy','removeAnswers','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x686318,_0x128a25){var _0x406328=function(_0x107d6f){while(--_0x107d6f){_0x686318['push'](_0x686318['shift']());}};_0x406328(++_0x128a25);}(_0x373d,0x1ae));var _0xd373=function(_0x2e49fc,_0x4a11bf){_0x2e49fc=_0x2e49fc-0x0;var _0xa7ba95=_0x373d[_0x2e49fc];return _0xa7ba95;};'use strict';var multer=require(_0xd373('0x0'));var util=require(_0xd373('0x1'));var path=require(_0xd373('0x2'));var timeout=require('connect-timeout');var express=require(_0xd373('0x3'));var router=express['Router']();var auth=require(_0xd373('0x4'));var interaction=require(_0xd373('0x5'));var config=require(_0xd373('0x6'));var controller=require(_0xd373('0x7'));router[_0xd373('0x8')]('/',auth[_0xd373('0x9')](),controller[_0xd373('0xa')]);router[_0xd373('0x8')](_0xd373('0xb'),auth[_0xd373('0x9')](),controller[_0xd373('0xc')]);router[_0xd373('0x8')](_0xd373('0xd'),auth[_0xd373('0x9')](),controller['show']);router['get'](_0xd373('0xe'),auth[_0xd373('0x9')](),controller[_0xd373('0xf')]);router['get']('/:id/canned_answers',auth[_0xd373('0x9')](),controller[_0xd373('0x10')]);router['get'](_0xd373('0x11'),auth[_0xd373('0x9')](),controller['getApplications']);router['get'](_0xd373('0x12'),auth[_0xd373('0x9')](),controller[_0xd373('0x13')]);router[_0xd373('0x8')](_0xd373('0x14'),controller[_0xd373('0x15')]);router['get'](_0xd373('0x16'),auth[_0xd373('0x9')](),controller[_0xd373('0x17')]);router[_0xd373('0x18')]('/',auth[_0xd373('0x9')](),controller[_0xd373('0x19')]);router[_0xd373('0x18')](_0xd373('0xe'),auth[_0xd373('0x9')](),controller[_0xd373('0x1a')]);router[_0xd373('0x18')](_0xd373('0x1b'),auth['isAuthenticated'](),controller[_0xd373('0x1c')]);router[_0xd373('0x18')]('/:id/notify',controller['notify']);router[_0xd373('0x18')](_0xd373('0x11'),auth['isAuthenticated'](),controller[_0xd373('0x1d')]);router[_0xd373('0x18')](_0xd373('0x1e'),auth['isAuthenticated'](),controller[_0xd373('0x1f')]);router['post'](_0xd373('0x14'),controller[_0xd373('0x20')]);router['post'](_0xd373('0x16'),auth[_0xd373('0x9')](),controller[_0xd373('0x21')]);router[_0xd373('0x22')](_0xd373('0xd'),auth[_0xd373('0x9')](),controller['update']);router[_0xd373('0x23')]('/:id',auth[_0xd373('0x9')](),controller[_0xd373('0x24')]);router['delete'](_0xd373('0xe'),auth[_0xd373('0x9')](),controller['removeDispositions']);router[_0xd373('0x23')](_0xd373('0x1b'),auth[_0xd373('0x9')](),controller[_0xd373('0x25')]);router[_0xd373('0x23')](_0xd373('0x16'),auth[_0xd373('0x9')](),controller[_0xd373('0x26')]);module[_0xd373('0x27')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 642e9cb..9fd2ebe 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 _0x813e=['STRING','name','generate','twilio','skebby','plivo','clickatell','csc','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x1eeac1,_0x136763){var _0x3b6bea=function(_0x1f4558){while(--_0x1f4558){_0x1eeac1['push'](_0x1eeac1['shift']());}};_0x3b6bea(++_0x136763);}(_0x813e,0xba));var _0xe813=function(_0x7cf8eb,_0x5a470e){_0x7cf8eb=_0x7cf8eb-0x0;var _0x24e417=_0x813e[_0x7cf8eb];return _0x24e417;};'use strict';var Sequelize=require(_0xe813('0x0'));var rs=require(_0xe813('0x1'));module[_0xe813('0x2')]={'name':{'type':Sequelize[_0xe813('0x3')],'unique':_0xe813('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe813('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe813('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe813('0x3')],'defaultValue':function(){return rs[_0xe813('0x5')]();}},'phone':{'type':Sequelize[_0xe813('0x3')]},'type':{'type':Sequelize['ENUM'](_0xe813('0x6'),_0xe813('0x7'),'connectel','clicksend',_0xe813('0x8'),_0xe813('0x9'),_0xe813('0xa'),'infobip',_0xe813('0xb'))},'accountSid':{'type':Sequelize[_0xe813('0x3')]},'authId':{'type':Sequelize[_0xe813('0x3')]},'authToken':{'type':Sequelize[_0xe813('0x3')]},'smsMethod':{'type':Sequelize[_0xe813('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0xe813('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xe813('0x3')]},'senderString':{'type':Sequelize[_0xe813('0x3')]},'deliveryReport':{'type':Sequelize[_0xe813('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xe813('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe813('0xe')],'defaultValue':function(){return _0xe813('0xf');}},'notificationSound':{'type':Sequelize[_0xe813('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe813('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe813('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe813('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe813('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xe813('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xdeb3e2){if(!_0xdeb3e2)this[_0xe813('0x12')](_0xe813('0x13'),null);this[_0xe813('0x12')](_0xe813('0x14'),_0xdeb3e2);}}}; \ No newline at end of file +var _0x0e16=['mandatoryDisposition','sequelize','randomstring','STRING','generate','ENUM','twilio','skebby','connectel','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x53ccbc,_0x17cc4c){var _0xd9c0dd=function(_0xd6e256){while(--_0xd6e256){_0x53ccbc['push'](_0x53ccbc['shift']());}};_0xd9c0dd(++_0x17cc4c);}(_0x0e16,0xd3));var _0x60e1=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x0e16[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x60e1('0x0'));var rs=require(_0x60e1('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x60e1('0x2')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x60e1('0x2')],'defaultValue':function(){return rs[_0x60e1('0x3')]();}},'phone':{'type':Sequelize[_0x60e1('0x2')]},'type':{'type':Sequelize[_0x60e1('0x4')](_0x60e1('0x5'),_0x60e1('0x6'),_0x60e1('0x7'),'clicksend',_0x60e1('0x8'),_0x60e1('0x9'),_0x60e1('0xa'),_0x60e1('0xb'),_0x60e1('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x60e1('0x2')]},'authToken':{'type':Sequelize[_0x60e1('0x2')]},'smsMethod':{'type':Sequelize[_0x60e1('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x60e1('0x2')]},'password':{'type':Sequelize[_0x60e1('0x2')]},'apiKey':{'type':Sequelize[_0x60e1('0x2')]},'senderString':{'type':Sequelize[_0x60e1('0x2')]},'deliveryReport':{'type':Sequelize[_0x60e1('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x60e1('0xe');}},'notificationSound':{'type':Sequelize[_0x60e1('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x60e1('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x60e1('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x60e1('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x60e1('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60e1('0xf')],'comment':_0x60e1('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x60e1('0x11'),'set':function(_0x5876ab){if(!_0x5876ab)this['setDataValue'](_0x60e1('0x12'),null);this[_0x60e1('0x13')](_0x60e1('0x14'),_0x5876ab);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ccd01c8..599e90e 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 _0xbe67=['fast-json-patch','moment','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','sort','where','filter','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','getDispositions','hasOwnProperty','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','SmsApplication','Applications','account','applications','orderBy','priority','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','From','Body','MessageSid','from','sender','text','connectel','clicksend','message_id','plivo','Text','results','messageId','csc','originatingAddress','fromNumber','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','CmContact','contact','spread','interaction','created','autoclose','close','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','set','Content-Type','send','\x0a','addApplications','findOne','sequelize','bulkCreate','getApplications','SmsInteraction','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','push','endpoint\x20/status\x20POST\x20/','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','infobip','DELIVERED','groupName','clickatell','redif','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','zip-dir'];(function(_0x58f2e7,_0x3c2877){var _0x238c22=function(_0xb94bd8){while(--_0xb94bd8){_0x58f2e7['push'](_0x58f2e7['shift']());}};_0x238c22(++_0x3c2877);}(_0xbe67,0x1b2));var _0x7be6=function(_0x563f30,_0x54be20){_0x563f30=_0x563f30-0x0;var _0x549c2d=_0xbe67[_0x563f30];return _0x549c2d;};'use strict';var pdf=require(_0x7be6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7be6('0x1'));var jsonpatch=require(_0x7be6('0x2'));var rp=require('request-promise');var moment=require(_0x7be6('0x3'));var BPromise=require(_0x7be6('0x4'));var Mustache=require(_0x7be6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7be6('0x6'));var ejs=require(_0x7be6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7be6('0x8'));var crypto=require(_0x7be6('0x9'));var jsforce=require(_0x7be6('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7be6('0xb'));var Papa=require(_0x7be6('0xc'));var Redis=require('ioredis');var authService=require(_0x7be6('0xd'));var qs=require(_0x7be6('0xe'));var as=require(_0x7be6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7be6('0x10'))(_0x7be6('0x11'));var utils=require(_0x7be6('0x12'));var config=require(_0x7be6('0x13'));var db=require('../../mysqldb')['db'];config[_0x7be6('0x14')]=_[_0x7be6('0x15')](config[_0x7be6('0x14')],{'host':_0x7be6('0x16'),'port':0x18eb});var socket=require(_0x7be6('0x17'))(new Redis(config[_0x7be6('0x14')]));require(_0x7be6('0x18'))['register'](socket);var jayson=require(_0x7be6('0x19'));var client=jayson[_0x7be6('0x1a')]['http']({'port':0x232c});function checkPasswordPattern(_0x2e484d,_0x3e35fe,_0x4b37fb){if(_0x4b37fb){var _0x5877b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5877b9[_0x7be6('0x1b')](_0x3e35fe)){return _0x2e484d;}else{throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x1e'));}}else{return _0x2e484d;}}function respondWithRpcPromise(_0x487ccc,_0x1562c8,_0x13dfc8,_0x192f34){return new BPromise(function(_0x2c989a,_0x1b3425){var _0x298b9=_0x192f34||client;return _0x298b9['request'](_0x487ccc,_0x13dfc8)[_0x7be6('0x1f')](function(_0x397852){logger[_0x7be6('0x20')](_0x7be6('0x21'),_0x1562c8,_0x7be6('0x22'));logger['debug'](_0x7be6('0x23'),_0x1562c8,_0x7be6('0x22'),JSON[_0x7be6('0x24')](_0x397852));if(_0x397852[_0x7be6('0x25')]){if(_0x397852['error'][_0x7be6('0x26')]===0x1f4){logger['error'](_0x7be6('0x21'),_0x1562c8,_0x397852['error']['message']);return _0x1b3425(_0x397852[_0x7be6('0x25')][_0x7be6('0x27')]);}logger[_0x7be6('0x25')]('SmsAccount,\x20%s,\x20%s',_0x1562c8,_0x397852[_0x7be6('0x25')][_0x7be6('0x27')]);return _0x2c989a(_0x397852[_0x7be6('0x25')][_0x7be6('0x27')]);}else{logger[_0x7be6('0x20')](_0x7be6('0x21'),_0x1562c8,'request\x20sent');_0x2c989a(_0x397852['result'][_0x7be6('0x27')]);}})[_0x7be6('0x28')](function(_0x1ae047){logger[_0x7be6('0x25')](_0x7be6('0x21'),_0x1562c8,_0x1ae047);_0x1b3425(_0x1ae047);});});}function respondWithStatusCode(_0x52e809,_0x49d42b){_0x49d42b=_0x49d42b||0xcc;return function(_0x133f12){if(_0x133f12){return _0x52e809[_0x7be6('0x29')](_0x49d42b);}return _0x52e809[_0x7be6('0x2a')](_0x49d42b)[_0x7be6('0x2b')]();};}function respondWithResult(_0x5c2131,_0xac3d49){_0xac3d49=_0xac3d49||0xc8;return function(_0x3e516c){if(_0x3e516c){return _0x5c2131[_0x7be6('0x2a')](_0xac3d49)[_0x7be6('0x2c')](_0x3e516c);}};}function respondWithFilteredResult(_0x5993e1,_0x2d5abe){return function(_0x45cba5){if(_0x45cba5){var _0xabb127=_0x45cba5[_0x7be6('0x2d')],_0x577eaa=_0x2d5abe[_0x7be6('0x2e')],_0x5e2689=_0x2d5abe[_0x7be6('0x2e')]+_0x2d5abe[_0x7be6('0x2f')],_0x1c5cf2;if(_0x5e2689>=_0xabb127){_0x5e2689=_0xabb127;_0x1c5cf2=0xc8;}else{_0x1c5cf2=0xce;}_0x5993e1[_0x7be6('0x2a')](_0x1c5cf2);return _0x5993e1['set'](_0x7be6('0x30'),_0x577eaa+'-'+_0x5e2689+'/'+_0xabb127)['json'](_0x45cba5);}return null;};}function patchUpdates(_0x43df0d){return function(_0x1f78f8){try{jsonpatch[_0x7be6('0x31')](_0x1f78f8,_0x43df0d,!![]);}catch(_0x48955b){return BPromise[_0x7be6('0x32')](_0x48955b);}return _0x1f78f8['save']();};}function saveUpdates(_0x2dc131,_0x478758){return function(_0x6c95f5){if(_0x6c95f5){return _0x6c95f5[_0x7be6('0x33')](_0x2dc131)[_0x7be6('0x1f')](function(_0x39efcd){return _0x39efcd;});}return null;};}function removeEntity(_0x63c56b,_0x305a6b){return function(_0x497a40){if(_0x497a40){return _0x497a40[_0x7be6('0x34')]()[_0x7be6('0x1f')](function(){var _0x5a6a95=_0x497a40[_0x7be6('0x35')]({'plain':!![]});var _0x3c04d0=_0x7be6('0x36');return db[_0x7be6('0x37')][_0x7be6('0x34')]({'where':{'type':_0x3c04d0,'resourceId':_0x5a6a95['id']}})[_0x7be6('0x1f')](function(){return _0x497a40;});})[_0x7be6('0x1f')](function(){_0x63c56b[_0x7be6('0x2a')](0xcc)[_0x7be6('0x2b')]();});}};}function handleEntityNotFound(_0x1abe08,_0x6496fe){return function(_0x56c195){if(!_0x56c195){_0x1abe08[_0x7be6('0x29')](0x194);}return _0x56c195;};}function handleError(_0x1f35bc,_0x5d1074){_0x5d1074=_0x5d1074||0x1f4;return function(_0x440bd0){logger[_0x7be6('0x25')](_0x440bd0[_0x7be6('0x38')]);if(_0x440bd0[_0x7be6('0x39')]){delete _0x440bd0[_0x7be6('0x39')];}_0x1f35bc[_0x7be6('0x2a')](_0x5d1074)['send'](_0x440bd0);};}exports[_0x7be6('0x3a')]=function(_0x407d27,_0x33b73c){var _0x19e36b={'include':[{'model':db[_0x7be6('0x3b')],'as':'mandatoryDispositionPause'}]},_0x497efe={},_0x5808db={'count':0x0,'rows':[]};var _0x591f3c=_[_0x7be6('0x3c')](db[_0x7be6('0x3d')][_0x7be6('0x3e')],function(_0x2f74a1){return{'name':_0x2f74a1[_0x7be6('0x3f')],'type':_0x2f74a1[_0x7be6('0x40')][_0x7be6('0x41')]};});_0x497efe['model']=_[_0x7be6('0x3c')](_0x591f3c,'name');_0x497efe[_0x7be6('0x42')]=_[_0x7be6('0x43')](_0x407d27['query']);_0x497efe[_0x7be6('0x44')]=_['intersection'](_0x497efe[_0x7be6('0x45')],_0x497efe[_0x7be6('0x42')]);_0x19e36b[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x497efe[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x48')]));_0x19e36b['attributes']=_0x19e36b[_0x7be6('0x46')][_0x7be6('0x49')]?_0x19e36b[_0x7be6('0x46')]:_0x497efe[_0x7be6('0x45')];if(!_0x407d27[_0x7be6('0x42')]['hasOwnProperty'](_0x7be6('0x4a'))){_0x19e36b[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x2f')]);_0x19e36b[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x2e')]);}_0x19e36b['order']=qs[_0x7be6('0x4b')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x4b')]);_0x19e36b[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_['pick'](_0x407d27[_0x7be6('0x42')],_0x497efe['filters']));if(_0x407d27['query'][_0x7be6('0x4d')]){_0x19e36b[_0x7be6('0x4c')]=_['merge'](_0x19e36b[_0x7be6('0x4c')],{'$or':_[_0x7be6('0x3c')](_0x591f3c,function(_0x15db6b){if(_0x15db6b['type']!=='VIRTUAL'){var _0x2b292c={};_0x2b292c[_0x15db6b[_0x7be6('0x39')]]={'$like':'%'+_0x407d27['query'][_0x7be6('0x4d')]+'%'};return _0x2b292c;}})});}_0x19e36b=_['merge']({},_0x19e36b,_0x407d27[_0x7be6('0x4e')]);var _0x3703c5={'where':_0x19e36b[_0x7be6('0x4c')]};return db[_0x7be6('0x3d')][_0x7be6('0x2d')](_0x3703c5)['then'](function(_0x2004b4){_0x5808db[_0x7be6('0x2d')]=_0x2004b4;if(_0x407d27[_0x7be6('0x42')][_0x7be6('0x4f')]){_0x19e36b[_0x7be6('0x50')]=[{'all':!![]}];}return db[_0x7be6('0x3d')][_0x7be6('0x51')](_0x19e36b);})[_0x7be6('0x1f')](function(_0xca0ac6){_0x5808db[_0x7be6('0x52')]=_0xca0ac6;return _0x5808db;})['then'](respondWithFilteredResult(_0x33b73c,_0x19e36b))[_0x7be6('0x28')](handleError(_0x33b73c,null));};exports[_0x7be6('0x53')]=function(_0x48936a,_0x5ac4c7){var _0x2881c1={'raw':![],'where':{'id':_0x48936a['params']['id']},'include':[{'model':db[_0x7be6('0x3b')],'as':_0x7be6('0x54')}]},_0x497d27={};_0x497d27[_0x7be6('0x45')]=_[_0x7be6('0x43')](db['SmsAccount'][_0x7be6('0x3e')]);_0x497d27['query']=_['keys'](_0x48936a[_0x7be6('0x42')]);_0x497d27[_0x7be6('0x44')]=_[_0x7be6('0x47')](_0x497d27[_0x7be6('0x45')],_0x497d27[_0x7be6('0x42')]);_0x2881c1[_0x7be6('0x46')]=_['intersection'](_0x497d27['model'],qs[_0x7be6('0x48')](_0x48936a[_0x7be6('0x42')][_0x7be6('0x48')]));_0x2881c1[_0x7be6('0x46')]=_0x2881c1[_0x7be6('0x46')][_0x7be6('0x49')]?_0x2881c1[_0x7be6('0x46')]:_0x497d27[_0x7be6('0x45')];if(_0x48936a[_0x7be6('0x42')]['includeAll']){_0x2881c1[_0x7be6('0x50')]=[{'all':!![]}];}_0x2881c1=_[_0x7be6('0x55')]({},_0x2881c1,_0x48936a[_0x7be6('0x4e')]);return db[_0x7be6('0x3d')][_0x7be6('0x56')](_0x2881c1)['then'](handleEntityNotFound(_0x5ac4c7,null))['then'](respondWithResult(_0x5ac4c7,null))[_0x7be6('0x28')](handleError(_0x5ac4c7,null));};exports[_0x7be6('0x57')]=function(_0x410bb1,_0x2fa0c1){return db[_0x7be6('0x3d')][_0x7be6('0x57')](_0x410bb1[_0x7be6('0x58')],{})[_0x7be6('0x1f')](function(_0x1ead9b){var _0x4c5f55=_0x410bb1[_0x7be6('0x59')][_0x7be6('0x35')]({'plain':!![]});if(!_0x4c5f55)throw new Error(_0x7be6('0x5a'));if(_0x4c5f55[_0x7be6('0x5b')]===_0x7be6('0x59')){var _0x49c203=_0x1ead9b[_0x7be6('0x35')]({'plain':!![]});var _0x18e368='SmsAccounts';return db['UserProfileSection'][_0x7be6('0x56')]({'where':{'name':_0x18e368,'userProfileId':_0x4c5f55[_0x7be6('0x5c')]},'raw':!![]})[_0x7be6('0x1f')](function(_0x26eae8){if(_0x26eae8&&_0x26eae8[_0x7be6('0x5d')]===0x0){return db[_0x7be6('0x37')][_0x7be6('0x57')]({'name':_0x49c203[_0x7be6('0x39')],'resourceId':_0x49c203['id'],'type':_0x26eae8[_0x7be6('0x39')],'sectionId':_0x26eae8['id']},{})[_0x7be6('0x1f')](function(){return _0x1ead9b;});}else{return _0x1ead9b;}})['catch'](function(_0x1e4c65){logger[_0x7be6('0x25')](_0x7be6('0x5e'),_0x1e4c65);throw _0x1e4c65;});}return _0x1ead9b;})[_0x7be6('0x1f')](respondWithResult(_0x2fa0c1,0xc9))[_0x7be6('0x28')](handleError(_0x2fa0c1,null));};exports[_0x7be6('0x33')]=function(_0x27330f,_0x531987){if(_0x27330f[_0x7be6('0x58')]['id']){delete _0x27330f[_0x7be6('0x58')]['id'];}return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x27330f[_0x7be6('0x5f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x7be6('0x1f')](handleEntityNotFound(_0x531987,null))[_0x7be6('0x1f')](saveUpdates(_0x27330f['body'],null))[_0x7be6('0x1f')](respondWithResult(_0x531987,null))[_0x7be6('0x28')](handleError(_0x531987,null));};exports[_0x7be6('0x34')]=function(_0x23dcd0,_0x17a145){return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x23dcd0['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x17a145,null))[_0x7be6('0x1f')](removeEntity(_0x17a145,null))['catch'](handleError(_0x17a145,null));};exports[_0x7be6('0x60')]=function(_0x3aaa44,_0x1b6aba){return db[_0x7be6('0x3d')][_0x7be6('0x60')]()[_0x7be6('0x1f')](respondWithResult(_0x1b6aba,null))[_0x7be6('0x28')](handleError(_0x1b6aba,null));};exports['addDisposition']=function(_0x5c31da,_0x54a446,_0x206805){if(_0x5c31da[_0x7be6('0x58')]['id']){delete _0x5c31da[_0x7be6('0x58')]['id'];}return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x5c31da[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x54a446,null))['then'](function(_0x23168d){if(_0x23168d){_0x5c31da['body'][_0x7be6('0x61')]=_0x23168d['id'];return db[_0x7be6('0x62')][_0x7be6('0x57')](_0x5c31da[_0x7be6('0x58')]);}})['then'](respondWithResult(_0x54a446,null))[_0x7be6('0x28')](handleError(_0x54a446,null));};exports[_0x7be6('0x63')]=function(_0x229b0b,_0xf9e8d5,_0x4e834a){var _0x3dfb41={'raw':![],'where':{}};var _0x274c77={};var _0x53cb54={'count':0x0,'rows':[]};return db[_0x7be6('0x3d')]['findOne']({'where':{'id':_0x229b0b['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0xf9e8d5,null))[_0x7be6('0x1f')](function(_0x1796ad){if(_0x1796ad){_0x274c77['model']=_[_0x7be6('0x43')](db[_0x7be6('0x62')][_0x7be6('0x3e')]);_0x274c77['query']=_[_0x7be6('0x43')](_0x229b0b[_0x7be6('0x42')]);_0x274c77[_0x7be6('0x44')]=_['intersection'](_0x274c77['model'],_0x274c77[_0x7be6('0x42')]);_0x3dfb41[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x274c77[_0x7be6('0x45')],qs['fields'](_0x229b0b[_0x7be6('0x42')][_0x7be6('0x48')]));_0x3dfb41['attributes']=_0x3dfb41[_0x7be6('0x46')]['length']?_0x3dfb41[_0x7be6('0x46')]:_0x274c77[_0x7be6('0x45')];if(!_0x229b0b[_0x7be6('0x42')][_0x7be6('0x64')]('nolimit')){_0x3dfb41[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x229b0b['query'][_0x7be6('0x2f')]);_0x3dfb41[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x229b0b[_0x7be6('0x42')][_0x7be6('0x2e')]);}_0x3dfb41[_0x7be6('0x65')]=qs['sort'](_0x229b0b['query'][_0x7be6('0x4b')]);_0x3dfb41['where']=qs[_0x7be6('0x44')](_[_0x7be6('0x66')](_0x229b0b[_0x7be6('0x42')],_0x274c77['filters']));_0x3dfb41[_0x7be6('0x4c')]['SmsAccountId']=_0x1796ad['id'];if(_0x229b0b[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x3dfb41['where']=_[_0x7be6('0x55')](_0x3dfb41[_0x7be6('0x4c')],{'$or':_['map'](_0x3dfb41[_0x7be6('0x46')],function(_0x1560c3){var _0x1ccac6={};_0x1ccac6[_0x1560c3]={'$like':'%'+_0x229b0b[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x1ccac6;})});}_0x3dfb41=_[_0x7be6('0x55')]({},_0x3dfb41,_0x229b0b[_0x7be6('0x4e')]);return db[_0x7be6('0x62')][_0x7be6('0x2d')]({'where':_0x3dfb41[_0x7be6('0x4c')]})['then'](function(_0x503891){_0x53cb54[_0x7be6('0x2d')]=_0x503891;if(_0x229b0b[_0x7be6('0x42')]['includeAll']){_0x3dfb41[_0x7be6('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x7be6('0x51')](_0x3dfb41);})['then'](function(_0x1568b9){_0x53cb54[_0x7be6('0x52')]=_0x1568b9;return _0x53cb54;});}})[_0x7be6('0x1f')](respondWithFilteredResult(_0xf9e8d5,_0x3dfb41))[_0x7be6('0x28')](handleError(_0xf9e8d5,null));};exports['removeDispositions']=function(_0x395fed,_0x456e3b,_0x400f0c){return db['SmsAccount'][_0x7be6('0x56')]({'where':{'id':_0x395fed['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x456e3b,null))[_0x7be6('0x1f')](function(_0x3e064e){if(_0x3e064e){return _0x3e064e[_0x7be6('0x67')](_0x395fed[_0x7be6('0x42')][_0x7be6('0x68')]);}})[_0x7be6('0x1f')](respondWithStatusCode(_0x456e3b,null))['catch'](handleError(_0x456e3b,null));};exports[_0x7be6('0x69')]=function(_0x226a23,_0x492d2a,_0xfd44f8){if(_0x226a23[_0x7be6('0x58')]['id']){delete _0x226a23['body']['id'];}return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x226a23[_0x7be6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x492d2a,null))['then'](function(_0x51dd6b){if(_0x51dd6b){_0x226a23[_0x7be6('0x58')]['SmsAccountId']=_0x51dd6b['id'];return db['CannedAnswer'][_0x7be6('0x57')](_0x226a23['body']);}})[_0x7be6('0x1f')](respondWithResult(_0x492d2a,null))['catch'](handleError(_0x492d2a,null));};exports['getAnswers']=function(_0x2102b6,_0x1e1dd5,_0x4d4d34){var _0x410830={'raw':![],'where':{}};var _0x22d358={};var _0x1e652c={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2102b6['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x1e1dd5,null))['then'](function(_0x43cab9){if(_0x43cab9){_0x22d358[_0x7be6('0x45')]=_['keys'](db[_0x7be6('0x6a')]['rawAttributes']);_0x22d358[_0x7be6('0x42')]=_['keys'](_0x2102b6[_0x7be6('0x42')]);_0x22d358['filters']=_[_0x7be6('0x47')](_0x22d358[_0x7be6('0x45')],_0x22d358[_0x7be6('0x42')]);_0x410830[_0x7be6('0x46')]=_['intersection'](_0x22d358[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x2102b6[_0x7be6('0x42')]['fields']));_0x410830[_0x7be6('0x46')]=_0x410830['attributes'][_0x7be6('0x49')]?_0x410830[_0x7be6('0x46')]:_0x22d358[_0x7be6('0x45')];if(!_0x2102b6['query'][_0x7be6('0x64')](_0x7be6('0x4a'))){_0x410830['limit']=qs['limit'](_0x2102b6[_0x7be6('0x42')]['limit']);_0x410830[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x2102b6['query'][_0x7be6('0x2e')]);}_0x410830[_0x7be6('0x65')]=qs[_0x7be6('0x4b')](_0x2102b6[_0x7be6('0x42')][_0x7be6('0x4b')]);_0x410830[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_['pick'](_0x2102b6[_0x7be6('0x42')],_0x22d358[_0x7be6('0x44')]));_0x410830['where']['SmsAccountId']=_0x43cab9['id'];if(_0x2102b6[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x410830[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x410830['where'],{'$or':_[_0x7be6('0x3c')](_0x410830['attributes'],function(_0x570e02){var _0x2c2065={};_0x2c2065[_0x570e02]={'$like':'%'+_0x2102b6[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x2c2065;})});}_0x410830=_['merge']({},_0x410830,_0x2102b6['options']);return db[_0x7be6('0x6a')][_0x7be6('0x2d')]({'where':_0x410830['where']})[_0x7be6('0x1f')](function(_0x26bc34){_0x1e652c[_0x7be6('0x2d')]=_0x26bc34;if(_0x2102b6[_0x7be6('0x42')]['includeAll']){_0x410830[_0x7be6('0x50')]=[{'all':!![]}];}return db[_0x7be6('0x6a')]['findAll'](_0x410830);})['then'](function(_0x5a42fb){_0x1e652c[_0x7be6('0x52')]=_0x5a42fb;return _0x1e652c;});}})['then'](respondWithFilteredResult(_0x1e1dd5,_0x410830))[_0x7be6('0x28')](handleError(_0x1e1dd5,null));};exports[_0x7be6('0x6b')]=function(_0x5cd024,_0x4e5310,_0x746641){return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x5cd024[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x4e5310,null))['then'](function(_0x3f6165){if(_0x3f6165){return _0x3f6165[_0x7be6('0x6b')](_0x5cd024[_0x7be6('0x42')]['ids']);}})[_0x7be6('0x1f')](respondWithStatusCode(_0x4e5310,null))[_0x7be6('0x28')](handleError(_0x4e5310,null));};exports['notify']=function(_0x1dee88,_0x37e62c,_0x3c031e){var _0x1dd58e={'channel':'sms'};var _0x4adc1f=[];var _0x3e274d=[];var _0xb1bfd0={};return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x1dee88[_0x7be6('0x5f')]['id']},'include':[{'model':db[_0x7be6('0x6c')],'as':_0x7be6('0x6d')}]})[_0x7be6('0x1f')](handleEntityNotFound(_0x37e62c,null))[_0x7be6('0x1f')](function(_0x108136){_0x1dd58e[_0x7be6('0x6e')]=_0x108136;_0x1dd58e[_0x7be6('0x6f')]=_[_0x7be6('0x70')](_0x108136[_0x7be6('0x6d')],[_0x7be6('0x71')],['asc']);if(_0x1dd58e[_0x7be6('0x6e')]['Applications']){delete _0x1dd58e[_0x7be6('0x6e')][_0x7be6('0x6d')];}return db['CmContact'][_0x7be6('0x60')]();})[_0x7be6('0x1f')](function(_0x17385a){if(!_0x17385a){throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x72'));}_0x4adc1f=_['difference'](_['keys'](_0x17385a),['createdAt',_0x7be6('0x73')]);_0x3e274d=_[_0x7be6('0x74')](_[_0x7be6('0x43')](_0x17385a),[_0x7be6('0x75'),_0x7be6('0x73'),_0x7be6('0x76'),_0x7be6('0x77')]);_0x1dd58e[_0x7be6('0x58')]={'mapKey':_0x7be6('0x78')};if(_0x1dd58e[_0x7be6('0x6e')][_0x7be6('0x40')]){switch(_0x1dd58e['account'][_0x7be6('0x40')]){case _0x7be6('0x79'):_0x1dd58e[_0x7be6('0x58')]['from']=_0x1dee88['body'][_0x7be6('0x7a')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88['body'][_0x7be6('0x7b')];_0x1dd58e[_0x7be6('0x58')]['messageId']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7c')];break;case'skebby':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]='+'+_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7e')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7f')];break;case _0x7be6('0x80'):_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7d')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88['body'][_0x7be6('0x27')];break;case _0x7be6('0x81'):_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88['body'][_0x7be6('0x7d')];_0x1dd58e[_0x7be6('0x58')]['body']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x58')];_0x1dd58e[_0x7be6('0x58')]['messageId']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x82')];break;case _0x7be6('0x83'):_0x1dd58e[_0x7be6('0x58')]['from']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7a')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88['body'][_0x7be6('0x84')];_0x1dd58e[_0x7be6('0x58')]['messageId']=_0x1dee88[_0x7be6('0x58')]['MessageUUID'];break;case'infobip':_0x1dd58e[_0x7be6('0x58')]['from']='+'+_0x1dee88[_0x7be6('0x58')]['results'][0x0][_0x7be6('0x7d')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x85')][0x0]['text'];_0x1dd58e['body']['messageId']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x85')][0x0][_0x7be6('0x86')];break;case _0x7be6('0x87'):_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88['body'][_0x7be6('0x88')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')]['segmentedMessage'][_0x7be6('0x27')];break;case'clickatell':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88['body'][_0x7be6('0x89')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7f')];_0x1dd58e['body'][_0x7be6('0x86')]=_0x1dee88['body']['replyMessageId'];break;case _0x7be6('0x8a'):_0x1dd58e[_0x7be6('0x58')]['from']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7d')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x27')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x86')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x8b')];break;}}if(_0x1dd58e[_0x7be6('0x58')]['id']){delete _0x1dd58e[_0x7be6('0x58')]['id'];}if(_[_0x7be6('0x8c')](_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')])){throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x8d'));}if(_[_0x7be6('0x8c')](_0x1dd58e[_0x7be6('0x58')]['body'])||_0x1dd58e['body'][_0x7be6('0x58')]===''){throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x8e'));}if(_[_0x7be6('0x8c')](_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x8f')])){throw new db[(_0x7be6('0x1c'))]['ValidationError'](_0x7be6('0x90')+_0x3e274d);}if(!_['includes'](_0x3e274d,_0x1dd58e['body']['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e274d);}_0xb1bfd0[_0x1dd58e[_0x7be6('0x58')]['mapKey']]=_0x1dd58e['body']['from'];return db[_0x7be6('0x91')][_0x7be6('0x56')]({'where':{'id':_0x1dd58e['account'][_0x7be6('0x77')]},'include':[{'model':db['CmContact'],'as':_0x7be6('0x92'),'where':_0xb1bfd0,'limit':0x1,'order':[[_0x7be6('0x73'),_0x7be6('0x93')]]}]});})[_0x7be6('0x1f')](handleEntityNotFound(_0x37e62c,null))[_0x7be6('0x1f')](function(_0x3c5f8e){if(_0x3c5f8e){_0x1dd58e[_0x7be6('0x94')]=_['omit'](_0x3c5f8e,[_0x7be6('0x92')]);if(_0x3c5f8e[_0x7be6('0x92')]['length']){return _0x3c5f8e[_0x7be6('0x92')][0x0];}var _0x284c61=_[_0x7be6('0x15')](_0x1dd58e['body'],{'firstName':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')],'ListId':_0x3c5f8e['id']});_0x284c61[_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x8f')]]=_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')];return db[_0x7be6('0x95')][_0x7be6('0x57')](_0x284c61,{'fields':_0x4adc1f,'raw':!![]});}})[_0x7be6('0x1f')](handleEntityNotFound(_0x37e62c,null))['then'](function(_0xe1280e){if(_0xe1280e){_0x1dd58e[_0x7be6('0x96')]=_0xe1280e;var _0x5058b0={'ContactId':_0xe1280e['id'],'phone':_0x1dd58e['body'][_0x7be6('0x7d')],'SmsAccountId':_0x1dee88[_0x7be6('0x5f')]['id']};var _0x5a2ac5={'ContactId':_0xe1280e['id'],'SmsAccountId':_0x1dee88[_0x7be6('0x5f')]['id'],'closed':![]};return db['SmsInteraction'][_0x7be6('0x56')]({'where':_0x5a2ac5})[_0x7be6('0x1f')](function(_0x4c68ff){if(_0x4c68ff){return[_0x4c68ff,![]];}return db['SmsInteraction'][_0x7be6('0x57')](_0x5058b0)[_0x7be6('0x1f')](function(_0x22ddf7){return[_0x22ddf7,!![]];});});}})[_0x7be6('0x97')](function(_0x3ce6fe,_0xbbcbe6){_0x1dd58e['interaction']=_0x3ce6fe[_0x7be6('0x35')]({'plain':!![]});_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x99')]=![];if(_0xbbcbe6){if(_0x1dd58e[_0x7be6('0x6e')][_0x7be6('0x9a')]){_0x1dd58e[_0x7be6('0x6f')]['push']({'id':0x0,'priority':_0x1dd58e[_0x7be6('0x6f')][_0x7be6('0x49')]+0x1,'app':_0x7be6('0x9b'),'appdata':'unmanaged','interval':_0x7be6('0x9c')});}_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x99')]=!![];}return db['SmsMessage'][_0x7be6('0x57')]({'phone':_0x1dd58e['body'][_0x7be6('0x7d')],'messageId':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x86')],'body':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')],'SmsAccountId':_0x1dee88[_0x7be6('0x5f')]['id'],'SmsInteractionId':_0x3ce6fe['id'],'direction':'in','ContactId':_0x3ce6fe[_0x7be6('0x9d')],'AttachmentId':_0x1dd58e['body']['AttachmentId']});})[_0x7be6('0x1f')](function(_0x3d410b){_0x1dd58e[_0x7be6('0x27')]=_0x3d410b;if(_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x9e')]){return db[_0x7be6('0x9f')][_0x7be6('0x56')]({'attributes':['id',_0x7be6('0x39')],'where':{'id':_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x9e')]}})[_0x7be6('0x1f')](function(_0x56fc5f){if(_0x56fc5f){_0x1dd58e['applications'][_0x7be6('0xa0')]({'id':0x0,'priority':0x0,'app':_0x7be6('0xa1'),'appdata':_0x56fc5f[_0x7be6('0x39')]+','+(_0x1dd58e[_0x7be6('0x6e')][_0x7be6('0xa2')]||0xa),'interval':_0x7be6('0x9c')});}return respondWithRpcPromise(_0x7be6('0xa3'),_0x7be6('0xa4'),_0x1dd58e);});}return respondWithRpcPromise(_0x7be6('0xa3'),_0x7be6('0xa4'),_0x1dd58e);})[_0x7be6('0x1f')](function(_0x37b765){if(_0x37b765){var _0x41ac89=0xc8;var _0x515455=_0x7be6('0xa5');logger[_0x7be6('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x515455,_0x41ac89,_0x7be6('0xa6'));logger[_0x7be6('0xa7')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x515455,_0x41ac89,'entity\x20found',JSON[_0x7be6('0x24')](_0x37b765));if(_0x1dd58e['account'][_0x7be6('0x40')]==='twilio'){return _0x37e62c[_0x7be6('0x2a')](_0x41ac89)[_0x7be6('0xa8')](_0x7be6('0xa9'),'text/xml')[_0x7be6('0xaa')](_0x7be6('0xab'));}else{return _0x37e62c[_0x7be6('0x2a')](_0x41ac89)[_0x7be6('0x2c')](_0x37b765);}}})[_0x7be6('0x28')](handleError(_0x37e62c,null));};exports[_0x7be6('0xac')]=function(_0x340d9a,_0xbbfcf4,_0x5de68d){return db['SmsAccount'][_0x7be6('0xad')]({'where':{'id':_0x340d9a['params']['id']}})['then'](handleEntityNotFound(_0xbbfcf4,null))[_0x7be6('0x1f')](function(_0x53fa17){if(_0x53fa17){return db[_0x7be6('0xae')]['transaction'](function(_0xc210f7){return db[_0x7be6('0x6c')][_0x7be6('0x34')]({'where':{'SmsAccountId':_0x340d9a[_0x7be6('0x5f')]['id']},'transaction':_0xc210f7})[_0x7be6('0x1f')](function(_0x2052ee){var _0x20fa58=_[_0x7be6('0x3c')](_0x340d9a['body'],function(_0x3f8452){_0x3f8452[_0x7be6('0x61')]=_0x340d9a[_0x7be6('0x5f')]['id'];return _0x3f8452;});return db[_0x7be6('0x6c')][_0x7be6('0xaf')](_0x20fa58,{'transaction':_0xc210f7});});})[_0x7be6('0x1f')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x340d9a[_0x7be6('0x5f')]['id']},'order':_0x7be6('0x71')});});}})['then'](respondWithResult(_0xbbfcf4,null))[_0x7be6('0x28')](handleError(_0xbbfcf4,null));};exports[_0x7be6('0xb0')]=function(_0x445823,_0x1dcbcb,_0x34ae8f){var _0x32cfb2={};var _0x24b895={};var _0x592b81;var _0x5d1051;return db[_0x7be6('0x3d')][_0x7be6('0xad')]({'where':{'id':_0x445823[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x1dcbcb,null))[_0x7be6('0x1f')](function(_0x2d42a9){if(_0x2d42a9){_0x592b81=_0x2d42a9;_0x24b895['model']=_[_0x7be6('0x43')](db[_0x7be6('0x6c')][_0x7be6('0x3e')]);_0x24b895[_0x7be6('0x42')]=_[_0x7be6('0x43')](_0x445823[_0x7be6('0x42')]);_0x24b895['filters']=_[_0x7be6('0x47')](_0x24b895[_0x7be6('0x45')],_0x24b895[_0x7be6('0x42')]);_0x32cfb2[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x24b895[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x445823[_0x7be6('0x42')][_0x7be6('0x48')]));_0x32cfb2[_0x7be6('0x46')]=_0x32cfb2[_0x7be6('0x46')][_0x7be6('0x49')]?_0x32cfb2['attributes']:_0x24b895['model'];_0x32cfb2['order']=qs[_0x7be6('0x4b')](_0x445823[_0x7be6('0x42')][_0x7be6('0x4b')]);_0x32cfb2['where']=qs['filters'](_['pick'](_0x445823[_0x7be6('0x42')],_0x24b895[_0x7be6('0x44')]));if(_0x445823[_0x7be6('0x42')]['filter']){_0x32cfb2[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x32cfb2[_0x7be6('0x4c')],{'$or':_[_0x7be6('0x3c')](_0x32cfb2[_0x7be6('0x46')],function(_0x21238b){var _0x2bf123={};_0x2bf123[_0x21238b]={'$like':'%'+_0x445823[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x2bf123;})});}_0x32cfb2=_[_0x7be6('0x55')]({},_0x32cfb2,_0x445823[_0x7be6('0x4e')]);return _0x592b81[_0x7be6('0xb0')](_0x32cfb2);}})['then'](function(_0x593833){if(_0x593833){_0x5d1051=_0x593833[_0x7be6('0x49')];if(!_0x445823[_0x7be6('0x42')]['hasOwnProperty'](_0x7be6('0x4a'))){_0x32cfb2[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x445823[_0x7be6('0x42')]['limit']);_0x32cfb2[_0x7be6('0x2e')]=qs['offset'](_0x445823[_0x7be6('0x42')][_0x7be6('0x2e')]);}return _0x592b81[_0x7be6('0xb0')](_0x32cfb2);}})[_0x7be6('0x1f')](function(_0x3d20e3){if(_0x3d20e3){return _0x3d20e3?{'count':_0x5d1051,'rows':_0x3d20e3}:null;}})[_0x7be6('0x1f')](respondWithResult(_0x1dcbcb,null))['catch'](handleError(_0x1dcbcb,null));};exports['getInteractions']=function(_0x5baa73,_0x3c784c,_0x2f5182){var _0x213efc={'raw':![],'where':{}};var _0x586396={};var _0x2ac021={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7be6('0xad')]({'where':{'id':_0x5baa73[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x3c784c,null))[_0x7be6('0x1f')](function(_0x29133a){if(_0x29133a){_0x586396[_0x7be6('0x45')]=_[_0x7be6('0x43')](db[_0x7be6('0xb1')]['rawAttributes']);_0x586396[_0x7be6('0x42')]=_[_0x7be6('0x43')](_0x5baa73[_0x7be6('0x42')]);_0x586396['filters']=_[_0x7be6('0x47')](_0x586396[_0x7be6('0x45')],_0x586396[_0x7be6('0x42')]);_0x213efc[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x586396[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x5baa73[_0x7be6('0x42')]['fields']));_0x213efc[_0x7be6('0x46')]=_0x213efc[_0x7be6('0x46')]['length']?_0x213efc[_0x7be6('0x46')]:_0x586396[_0x7be6('0x45')];if(!_0x5baa73[_0x7be6('0x42')][_0x7be6('0x64')]('nolimit')){_0x213efc[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x5baa73[_0x7be6('0x42')][_0x7be6('0x2f')]);_0x213efc[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x5baa73['query'][_0x7be6('0x2e')]);}_0x213efc[_0x7be6('0x65')]=qs[_0x7be6('0x4b')](_0x5baa73[_0x7be6('0x42')]['sort']);_0x213efc[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_[_0x7be6('0x66')](_0x5baa73[_0x7be6('0x42')],_0x586396['filters']));_0x213efc[_0x7be6('0x4c')][_0x7be6('0x61')]=_0x29133a['id'];if(_0x5baa73[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x213efc[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x213efc[_0x7be6('0x4c')],{'$or':_[_0x7be6('0x3c')](_0x213efc[_0x7be6('0x46')],function(_0x3a04f8){var _0x24b042={};_0x24b042[_0x3a04f8]={'$like':'%'+_0x5baa73['query'][_0x7be6('0x4d')]+'%'};return _0x24b042;})});}_0x213efc=_['merge']({},_0x213efc,_0x5baa73[_0x7be6('0x4e')]);return db[_0x7be6('0xb1')]['count']({'where':_0x213efc['where']})[_0x7be6('0x1f')](function(_0x3f0c62){_0x2ac021[_0x7be6('0x2d')]=_0x3f0c62;if(_0x5baa73[_0x7be6('0x42')][_0x7be6('0x4f')]){_0x213efc['include']=[{'model':db[_0x7be6('0x95')],'as':_0x7be6('0xb2'),'required':![]},{'model':db[_0x7be6('0x9f')],'as':_0x7be6('0xb3'),'attributes':['name',_0x7be6('0xb4'),'internal'],'required':![]},{'model':db[_0x7be6('0xb5')],'as':_0x7be6('0xb6'),'attributes':['id','name',_0x7be6('0xb7')],'where':_0x5baa73[_0x7be6('0x42')][_0x7be6('0xb8')]?{'id':_0x5baa73[_0x7be6('0x42')][_0x7be6('0xb8')]}:undefined,'required':_0x5baa73[_0x7be6('0x42')][_0x7be6('0xb8')]?!![]:![]}];}return db[_0x7be6('0xb1')]['findAll'](_0x213efc);})[_0x7be6('0x1f')](function(_0x53bbc4){_0x2ac021['rows']=_0x53bbc4;return _0x2ac021;});}})[_0x7be6('0x1f')](respondWithFilteredResult(_0x3c784c,_0x213efc))['catch'](handleError(_0x3c784c,null));};exports['send']=function(_0x4d035e,_0x300251,_0xb9dbbf){var _0x221c17,_0x47a857,_0x298bca;if(_[_0x7be6('0x8c')](_0x4d035e[_0x7be6('0x58')][_0x7be6('0x58')])||_0x4d035e['body']['body']===''){throw new db['Sequelize'][(_0x7be6('0x1d'))](_0x7be6('0x8e'));}if(_['isNil'](_0x4d035e[_0x7be6('0x58')]['to'])){throw new db['Sequelize'][(_0x7be6('0x1d'))](_0x7be6('0xb9'));}_0x221c17=_0x4d035e[_0x7be6('0x58')]['to'];return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x4d035e[_0x7be6('0x5f')]['id']},'include':[{'model':db[_0x7be6('0x91')],'as':_0x7be6('0xba'),'include':[{'model':db[_0x7be6('0x95')],'as':_0x7be6('0x92'),'where':{'mobile':_0x221c17},'limit':0x1,'order':[[_0x7be6('0x73'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x300251,null))[_0x7be6('0x1f')](function(_0x47a586){if(_0x47a586&&_0x47a586[_0x7be6('0xba')]){_0x47a857=_0x47a586[_0x7be6('0x35')]({'plain':!![]});if(_0x47a857[_0x7be6('0xba')]&&_0x47a857[_0x7be6('0xba')][_0x7be6('0x92')][_0x7be6('0x49')]){return _0x47a857[_0x7be6('0xba')]['Contacts'][0x0];}return db['CmContact'][_0x7be6('0x57')](_[_0x7be6('0x15')](_0x4d035e[_0x7be6('0x58')],{'firstName':_0x221c17,'mobile':_0x221c17,'phone':_0x221c17,'ListId':_0x47a857[_0x7be6('0x77')]}));}})[_0x7be6('0x1f')](handleEntityNotFound(_0x300251,null))['then'](function(_0x4a7c17){if(_0x4a7c17){_0x298bca=_0x4a7c17;return db[_0x7be6('0xb1')][_0x7be6('0x56')]({'where':{'ContactId':_0x298bca['id'],'closed':![],'SmsAccountId':_0x47a857['id']}})['then'](function(_0x446d52){if(_0x446d52){return[_0x446d52,![]];}return db['SmsInteraction'][_0x7be6('0x57')]({'UserId':_0x4d035e[_0x7be6('0x59')]['id'],'ContactId':_0x298bca['id'],'SmsAccountId':_0x47a857['id'],'phone':_0x221c17,'firstMsgDirection':_0x7be6('0xbb'),'Messages':[_['merge'](_0x4d035e[_0x7be6('0x58')],{'read':![],'body':_0x4d035e[_0x7be6('0x58')]['body'],'phone':_0x221c17,'SmsAccountId':_0x47a857['id'],'UserId':_0x4d035e[_0x7be6('0x59')]['id'],'ContactId':_0x298bca['id']})]},{'include':[{'model':db[_0x7be6('0xbc')],'as':_0x7be6('0xbd')}]})[_0x7be6('0x1f')](function(_0x468b41){return[_0x468b41,!![]];});});}})[_0x7be6('0x97')](function(_0xefc105,_0x55bc29){if(_0x55bc29){return _0xefc105;}return db['SmsMessage'][_0x7be6('0x57')](_[_0x7be6('0x55')](_0x4d035e[_0x7be6('0x58')],{'read':![],'body':_0x4d035e['body'][_0x7be6('0x58')],'phone':_0x221c17,'SmsAccountId':_0x47a857['id'],'SmsInteractionId':_0xefc105['id'],'UserId':_0x4d035e[_0x7be6('0x59')]['id'],'ContactId':_0x298bca['id']}))['then'](function(_0x7ad4ca){_0xefc105[_0x7be6('0xbe')]['Messages']=[];_0xefc105[_0x7be6('0xbe')]['Messages'][_0x7be6('0xbf')](_0x7ad4ca[_0x7be6('0xbe')]);return _0xefc105;});})[_0x7be6('0x1f')](respondWithResult(_0x300251,null))[_0x7be6('0x28')](handleError(_0x300251,null));};exports['status']=function(_0x4b365a,_0x3c1eb8,_0x428802){if(_0x4b365a[_0x7be6('0x58')]['id']){delete _0x4b365a['body']['id'];}console['log'](_0x7be6('0xc0'),_0x4b365a[_0x7be6('0x58')]);var _0x459822,_0x53dc15,_0x42fca7;return db['SmsAccount']['find']({'where':{'id':_0x4b365a['params']['id']}})['then'](handleEntityNotFound(_0x3c1eb8,null))[_0x7be6('0x1f')](function(_0x235259){if(_0x235259){_0x42fca7=_0x235259;logger[_0x7be6('0xa7')](_0x7be6('0x23'),_0x7be6('0x2a'),'received\x20delivery\x20report\x20from',_0x235259[_0x7be6('0x40')],util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));switch(_0x235259['type']){case _0x7be6('0xc2'):if(_0x4b365a[_0x7be6('0x58')]['skebby_dispatch_id']&&_0x4b365a['body'][_0x7be6('0x2a')]){_0x53dc15=_0x4b365a['body'][_0x7be6('0x2a')];return db[_0x7be6('0xbc')]['find']({'where':{'messageId':_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc3')]}});}break;case'connectel':if(_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc4')]&&_0x4b365a[_0x7be6('0x58')]['statusInt']){_0x53dc15=_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc5')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x4b365a[_0x7be6('0x58')]['requestid']}});}break;case'clicksend':if(_0x4b365a['body']['message_id']&&_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc6')]){_0x53dc15=_0x4b365a['body'][_0x7be6('0xc6')];return db['SmsMessage'][_0x7be6('0x56')]({'where':{'messageId':_0x4b365a[_0x7be6('0x58')][_0x7be6('0x82')]}});}break;case _0x7be6('0xc7'):var _0x5e2fdd=_0x4b365a['body'][_0x7be6('0x85')][0x0];if(_0x5e2fdd[_0x7be6('0x86')]&&_0x5e2fdd[_0x7be6('0x2a')]['groupName']===_0x7be6('0xc8')){_0x53dc15=_0x5e2fdd[_0x7be6('0x2a')][_0x7be6('0xc9')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x5e2fdd['messageId']}});}break;case _0x7be6('0xca'):if(_0x4b365a[_0x7be6('0x58')][_0x7be6('0x86')]&&_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')]){_0x53dc15=_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x4b365a[_0x7be6('0x58')][_0x7be6('0x86')]}});}break;case _0x7be6('0x8a'):if(_0x4b365a['body'][_0x7be6('0xcb')]&&_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')]){_0x53dc15=_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4b365a['body'][_0x7be6('0xcb')]}});}break;}}})[_0x7be6('0x1f')](handleEntityNotFound(_0x3c1eb8,null))[_0x7be6('0x1f')](function(_0x2fce91){if(_0x2fce91){_0x459822=_0x2fce91;switch(_0x42fca7[_0x7be6('0x40')]){case _0x7be6('0xc2'):if(_0x53dc15===_0x7be6('0xc8')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xc2'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0x80'):if(_0x53dc15==='1'){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xc2'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0x81'):if(!_0x4b365a[_0x7be6('0x58')][_0x7be6('0xcc')]&&_0x53dc15>=0xc8&&_0x53dc15<=0xce){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0x81'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0xc7'):var _0x453fc6=_0x4b365a['body']['results'][0x0];if(_0x453fc6[_0x7be6('0x2a')][_0x7be6('0xc9')]===_0x7be6('0xc8')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),'infobip',util['inspect'](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0xca'):if(_0x53dc15=='DELIVERED_TO_GATEWAY'||_0x53dc15==_0x7be6('0xcd')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xca'),util['inspect'](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x53dc15===_0x7be6('0xce')||_0x53dc15===_0x7be6('0xcf')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0x8a'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x459822;}})[_0x7be6('0x1f')](respondWithResult(_0x3c1eb8,null))[_0x7be6('0x28')](handleError(_0x3c1eb8,null));};exports[_0x7be6('0xd0')]=function(_0x207057,_0x1412cf,_0x5aafe4){var _0x3f089a,_0x4b49d3,_0x3e8f57;return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x207057[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x1412cf,null))[_0x7be6('0x1f')](function(_0x352102){if(_0x352102){_0x3e8f57=_0x352102;logger[_0x7be6('0xa7')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xd1'),_0x352102['type'],util[_0x7be6('0xc1')](_0x207057['query'],{'showHidden':![],'depth':null}));switch(_0x352102[_0x7be6('0x40')]){case _0x7be6('0x87'):if(_0x207057['query'][_0x7be6('0xd2')]&&_0x207057[_0x7be6('0x42')][_0x7be6('0xd3')]){_0x4b49d3=_0x207057[_0x7be6('0x42')][_0x7be6('0xd3')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x207057['query']['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x1412cf,null))[_0x7be6('0x1f')](function(_0x1fee62){if(_0x1fee62){_0x3f089a=_0x1fee62;switch(_0x3e8f57[_0x7be6('0x40')]){case _0x7be6('0x87'):if(_0x4b49d3==='2'||_0x4b49d3==='6'){return _0x3f089a[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0x87'),util[_0x7be6('0xc1')](_0x207057[_0x7be6('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x3f089a;}})[_0x7be6('0x1f')](respondWithResult(_0x1412cf,null))[_0x7be6('0x28')](handleError(_0x1412cf,null));};exports[_0x7be6('0xd4')]=function(_0x193c26,_0x20db2d,_0x592944){return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x193c26[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x20db2d,null))[_0x7be6('0x1f')](function(_0x491079){if(_0x491079){return _0x491079['addAgents'](_0x193c26[_0x7be6('0x58')]['ids'],_[_0x7be6('0xd5')](_0x193c26['body'],[_0x7be6('0x68'),'id'])||{})[_0x7be6('0x97')](function(_0x26ef2f){for(var _0x34a052=0x0;_0x34a052<_0x193c26['body'][_0x7be6('0x68')][_0x7be6('0x49')];_0x34a052+=0x1){socket[_0x7be6('0xd6')]('userSmsAccount:save',{'UserId':_0x193c26[_0x7be6('0x58')]['ids'][_0x34a052],'SmsAccountId':_0x193c26[_0x7be6('0x5f')]['id']});}return _0x26ef2f;});}})['then'](respondWithResult(_0x20db2d,null))[_0x7be6('0x28')](handleError(_0x20db2d,null));};exports[_0x7be6('0xd7')]=function(_0x332767,_0x413225,_0x10359a){return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x332767[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x413225,null))[_0x7be6('0x1f')](function(_0xefdb93){if(_0xefdb93){return _0xefdb93[_0x7be6('0xd7')](_0x332767['query'][_0x7be6('0x68')])[_0x7be6('0x1f')](function(){if(_['isArray'](_0x332767[_0x7be6('0x42')][_0x7be6('0x68')])){for(var _0x4deec3=0x0;_0x4deec3<_0x332767['query'][_0x7be6('0x68')][_0x7be6('0x49')];_0x4deec3+=0x1){socket['emit'](_0x7be6('0xd8'),{'UserId':Number(_0x332767['query'][_0x7be6('0x68')][_0x4deec3]),'SmsAccountId':Number(_0x332767[_0x7be6('0x5f')]['id'])});}}else{socket[_0x7be6('0xd6')]('userSmsAccount:remove',{'UserId':Number(_0x332767[_0x7be6('0x42')][_0x7be6('0x68')]),'SmsAccountId':Number(_0x332767[_0x7be6('0x5f')]['id'])});}});}})[_0x7be6('0x1f')](respondWithStatusCode(_0x413225,null))[_0x7be6('0x28')](handleError(_0x413225,null));};exports[_0x7be6('0xd9')]=function(_0x52dc9d,_0x5c57bd,_0x3bc95e){var _0x429f37={};var _0x1128d7={};var _0x10e853;var _0x372869;return db[_0x7be6('0x3d')][_0x7be6('0xad')]({'where':{'id':_0x52dc9d['params']['id']}})['then'](handleEntityNotFound(_0x5c57bd,null))[_0x7be6('0x1f')](function(_0x2437bd){if(_0x2437bd){_0x10e853=_0x2437bd;_0x1128d7['model']=_[_0x7be6('0x43')](db[_0x7be6('0x9f')][_0x7be6('0x3e')]);_0x1128d7[_0x7be6('0x42')]=_['keys'](_0x52dc9d[_0x7be6('0x42')]);_0x1128d7[_0x7be6('0x44')]=_[_0x7be6('0x47')](_0x1128d7[_0x7be6('0x45')],_0x1128d7[_0x7be6('0x42')]);_0x429f37[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x1128d7['model'],qs[_0x7be6('0x48')](_0x52dc9d[_0x7be6('0x42')]['fields']));_0x429f37['attributes']=_0x429f37[_0x7be6('0x46')][_0x7be6('0x49')]?_0x429f37[_0x7be6('0x46')]:_0x1128d7[_0x7be6('0x45')];_0x429f37[_0x7be6('0x65')]=qs[_0x7be6('0x4b')](_0x52dc9d[_0x7be6('0x42')]['sort']);_0x429f37[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_[_0x7be6('0x66')](_0x52dc9d[_0x7be6('0x42')],_0x1128d7[_0x7be6('0x44')]));if(_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x429f37[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x429f37[_0x7be6('0x4c')],{'$or':_['map'](_0x429f37[_0x7be6('0x46')],function(_0x1b718d){var _0x103e56={};_0x103e56[_0x1b718d]={'$like':'%'+_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x103e56;})});}_0x429f37=_[_0x7be6('0x55')]({},_0x429f37,_0x52dc9d[_0x7be6('0x4e')]);return _0x10e853[_0x7be6('0xd9')](_0x429f37);}})['then'](function(_0xd4ab54){if(_0xd4ab54){_0x372869=_0xd4ab54[_0x7be6('0x49')];if(!_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x64')](_0x7be6('0x4a'))){_0x429f37[_0x7be6('0x2f')]=qs['limit'](_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x2f')]);_0x429f37[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x2e')]);}return _0x10e853[_0x7be6('0xd9')](_0x429f37);}})[_0x7be6('0x1f')](function(_0x4c7da5){if(_0x4c7da5){return _0x4c7da5?{'count':_0x372869,'rows':_0x4c7da5}:null;}})[_0x7be6('0x1f')](respondWithResult(_0x5c57bd,null))[_0x7be6('0x28')](handleError(_0x5c57bd,null));}; \ No newline at end of file +var _0x351c=['Messages','push','log','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','DELIVERED','redif','error_code','groupName','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox','ejs','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','error','SmsAccount,\x20%s,\x20%s','message','result','status','count','offset','limit','set','Content-Range','apply','save','update','destroy','get','UserProfileResource','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','SmsAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','sms','Applications','applications','orderBy','account','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','From','Body','messageId','MessageSid','skebby','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','segmentedMessage','clickatell','fromNumber','replyMessageId','intelepeer','refid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','User','unshift','agent','startRouting','receiveMessage','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','json','addApplications','sequelize','transaction','SmsApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','CmContact','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','SmsMessage','dataValues'];(function(_0x4191bc,_0x3096c5){var _0x1ffd4e=function(_0x36faed){while(--_0x36faed){_0x4191bc['push'](_0x4191bc['shift']());}};_0x1ffd4e(++_0x3096c5);}(_0x351c,0xfc));var _0xc351=function(_0x1ff922,_0x5f314d){_0x1ff922=_0x1ff922-0x0;var _0x398946=_0x351c[_0x1ff922];return _0x398946;};'use strict';var pdf=require(_0xc351('0x0'));var emlformat=require(_0xc351('0x1'));var rimraf=require(_0xc351('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc351('0x3'));var rp=require('request-promise');var moment=require(_0xc351('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc351('0x5'));var path=require(_0xc351('0x6'));var sox=require(_0xc351('0x7'));var csv=require('to-csv');var ejs=require(_0xc351('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc351('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc351('0xa'));var toCsv=require(_0xc351('0xb'));var querystring=require('querystring');var Papa=require(_0xc351('0xc'));var Redis=require(_0xc351('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xc351('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc351('0xf'));var logger=require(_0xc351('0x10'))(_0xc351('0x11'));var utils=require(_0xc351('0x12'));var config=require('../../config/environment');var db=require(_0xc351('0x13'))['db'];config[_0xc351('0x14')]=_[_0xc351('0x15')](config[_0xc351('0x14')],{'host':_0xc351('0x16'),'port':0x18eb});var socket=require(_0xc351('0x17'))(new Redis(config['redis']));require(_0xc351('0x18'))['register'](socket);var jayson=require(_0xc351('0x19'));var client=jayson['client'][_0xc351('0x1a')]({'port':0x232c});function checkPasswordPattern(_0x1be1a7,_0x36aeee,_0xa3cd0b){if(_0xa3cd0b){var _0x2b2017=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b2017[_0xc351('0x1b')](_0x36aeee)){return _0x1be1a7;}else{throw new db[(_0xc351('0x1c'))][(_0xc351('0x1d'))](_0xc351('0x1e'));}}else{return _0x1be1a7;}}function respondWithRpcPromise(_0x3c505a,_0x4f5ec4,_0x253106,_0x37dbd7){return new BPromise(function(_0x1eb47f,_0x367029){var _0x2cfaea=_0x37dbd7||client;return _0x2cfaea[_0xc351('0x1f')](_0x3c505a,_0x253106)[_0xc351('0x20')](function(_0x3771d2){logger[_0xc351('0x21')]('SmsAccount,\x20%s,\x20%s',_0x4f5ec4,_0xc351('0x22'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4f5ec4,_0xc351('0x22'),JSON[_0xc351('0x23')](_0x3771d2));if(_0x3771d2[_0xc351('0x24')]){if(_0x3771d2[_0xc351('0x24')]['code']===0x1f4){logger[_0xc351('0x24')](_0xc351('0x25'),_0x4f5ec4,_0x3771d2[_0xc351('0x24')][_0xc351('0x26')]);return _0x367029(_0x3771d2[_0xc351('0x24')][_0xc351('0x26')]);}logger[_0xc351('0x24')](_0xc351('0x25'),_0x4f5ec4,_0x3771d2[_0xc351('0x24')][_0xc351('0x26')]);return _0x1eb47f(_0x3771d2[_0xc351('0x24')][_0xc351('0x26')]);}else{logger[_0xc351('0x21')](_0xc351('0x25'),_0x4f5ec4,_0xc351('0x22'));_0x1eb47f(_0x3771d2[_0xc351('0x27')][_0xc351('0x26')]);}})['catch'](function(_0x4a4638){logger[_0xc351('0x24')]('SmsAccount,\x20%s,\x20%s',_0x4f5ec4,_0x4a4638);_0x367029(_0x4a4638);});});}function respondWithStatusCode(_0x44908c,_0x4f2662){_0x4f2662=_0x4f2662||0xcc;return function(_0x53ab3e){if(_0x53ab3e){return _0x44908c['sendStatus'](_0x4f2662);}return _0x44908c[_0xc351('0x28')](_0x4f2662)['end']();};}function respondWithResult(_0x32e679,_0x377d29){_0x377d29=_0x377d29||0xc8;return function(_0xc46748){if(_0xc46748){return _0x32e679['status'](_0x377d29)['json'](_0xc46748);}};}function respondWithFilteredResult(_0x5c53d8,_0x1a3c23){return function(_0x233a13){if(_0x233a13){var _0x2e7439=_0x233a13[_0xc351('0x29')],_0xe559b9=_0x1a3c23[_0xc351('0x2a')],_0x286c25=_0x1a3c23[_0xc351('0x2a')]+_0x1a3c23[_0xc351('0x2b')],_0x38103b;if(_0x286c25>=_0x2e7439){_0x286c25=_0x2e7439;_0x38103b=0xc8;}else{_0x38103b=0xce;}_0x5c53d8[_0xc351('0x28')](_0x38103b);return _0x5c53d8[_0xc351('0x2c')](_0xc351('0x2d'),_0xe559b9+'-'+_0x286c25+'/'+_0x2e7439)['json'](_0x233a13);}return null;};}function patchUpdates(_0x4406a6){return function(_0x4d9fb6){try{jsonpatch[_0xc351('0x2e')](_0x4d9fb6,_0x4406a6,!![]);}catch(_0x21bb6e){return BPromise['reject'](_0x21bb6e);}return _0x4d9fb6[_0xc351('0x2f')]();};}function saveUpdates(_0x187446,_0x148d2c){return function(_0x3bb09f){if(_0x3bb09f){return _0x3bb09f[_0xc351('0x30')](_0x187446)[_0xc351('0x20')](function(_0x591407){return _0x591407;});}return null;};}function removeEntity(_0x24c3be,_0x4d5c69){return function(_0x33cefd){if(_0x33cefd){return _0x33cefd[_0xc351('0x31')]()[_0xc351('0x20')](function(){var _0x494df3=_0x33cefd[_0xc351('0x32')]({'plain':!![]});var _0x40d320='SmsAccounts';return db[_0xc351('0x33')]['destroy']({'where':{'type':_0x40d320,'resourceId':_0x494df3['id']}})[_0xc351('0x20')](function(){return _0x33cefd;});})[_0xc351('0x20')](function(){_0x24c3be[_0xc351('0x28')](0xcc)[_0xc351('0x34')]();});}};}function handleEntityNotFound(_0x11abc5,_0x292cab){return function(_0x4bc47d){if(!_0x4bc47d){_0x11abc5[_0xc351('0x35')](0x194);}return _0x4bc47d;};}function handleError(_0x3d2607,_0x2b557f){_0x2b557f=_0x2b557f||0x1f4;return function(_0xf474a7){logger['error'](_0xf474a7[_0xc351('0x36')]);if(_0xf474a7[_0xc351('0x37')]){delete _0xf474a7[_0xc351('0x37')];}_0x3d2607[_0xc351('0x28')](_0x2b557f)[_0xc351('0x38')](_0xf474a7);};}exports[_0xc351('0x39')]=function(_0x52028f,_0x25f19c){var _0x518d79={'include':[{'model':db[_0xc351('0x3a')],'as':_0xc351('0x3b')}]},_0x8ca56b={},_0x3f0bef={'count':0x0,'rows':[]};var _0x283e82=_[_0xc351('0x3c')](db[_0xc351('0x3d')]['rawAttributes'],function(_0x2cd77c){return{'name':_0x2cd77c[_0xc351('0x3e')],'type':_0x2cd77c[_0xc351('0x3f')][_0xc351('0x40')]};});_0x8ca56b[_0xc351('0x41')]=_[_0xc351('0x3c')](_0x283e82,_0xc351('0x37'));_0x8ca56b[_0xc351('0x42')]=_[_0xc351('0x43')](_0x52028f['query']);_0x8ca56b[_0xc351('0x44')]=_[_0xc351('0x45')](_0x8ca56b['model'],_0x8ca56b[_0xc351('0x42')]);_0x518d79[_0xc351('0x46')]=_[_0xc351('0x45')](_0x8ca56b['model'],qs[_0xc351('0x47')](_0x52028f[_0xc351('0x42')][_0xc351('0x47')]));_0x518d79[_0xc351('0x46')]=_0x518d79['attributes'][_0xc351('0x48')]?_0x518d79[_0xc351('0x46')]:_0x8ca56b[_0xc351('0x41')];if(!_0x52028f[_0xc351('0x42')][_0xc351('0x49')]('nolimit')){_0x518d79[_0xc351('0x2b')]=qs[_0xc351('0x2b')](_0x52028f[_0xc351('0x42')]['limit']);_0x518d79[_0xc351('0x2a')]=qs[_0xc351('0x2a')](_0x52028f['query']['offset']);}_0x518d79['order']=qs['sort'](_0x52028f['query'][_0xc351('0x4a')]);_0x518d79[_0xc351('0x4b')]=qs[_0xc351('0x44')](_['pick'](_0x52028f[_0xc351('0x42')],_0x8ca56b['filters']));if(_0x52028f[_0xc351('0x42')]['filter']){_0x518d79[_0xc351('0x4b')]=_[_0xc351('0x4c')](_0x518d79[_0xc351('0x4b')],{'$or':_[_0xc351('0x3c')](_0x283e82,function(_0x24adff){if(_0x24adff[_0xc351('0x3f')]!==_0xc351('0x4d')){var _0x25794c={};_0x25794c[_0x24adff[_0xc351('0x37')]]={'$like':'%'+_0x52028f[_0xc351('0x42')][_0xc351('0x4e')]+'%'};return _0x25794c;}})});}_0x518d79=_[_0xc351('0x4c')]({},_0x518d79,_0x52028f[_0xc351('0x4f')]);var _0x535c46={'where':_0x518d79[_0xc351('0x4b')]};return db[_0xc351('0x3d')][_0xc351('0x29')](_0x535c46)[_0xc351('0x20')](function(_0x32c0de){_0x3f0bef[_0xc351('0x29')]=_0x32c0de;if(_0x52028f[_0xc351('0x42')][_0xc351('0x50')]){_0x518d79[_0xc351('0x51')]=[{'all':!![]}];}return db[_0xc351('0x3d')][_0xc351('0x52')](_0x518d79);})['then'](function(_0x156a59){_0x3f0bef[_0xc351('0x53')]=_0x156a59;return _0x3f0bef;})['then'](respondWithFilteredResult(_0x25f19c,_0x518d79))[_0xc351('0x54')](handleError(_0x25f19c,null));};exports[_0xc351('0x55')]=function(_0xa019a3,_0x50a2fa){var _0x458f1e={'raw':![],'where':{'id':_0xa019a3[_0xc351('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xc351('0x3b')}]},_0x1f03c4={};_0x1f03c4[_0xc351('0x41')]=_['keys'](db[_0xc351('0x3d')][_0xc351('0x57')]);_0x1f03c4[_0xc351('0x42')]=_[_0xc351('0x43')](_0xa019a3[_0xc351('0x42')]);_0x1f03c4[_0xc351('0x44')]=_[_0xc351('0x45')](_0x1f03c4[_0xc351('0x41')],_0x1f03c4[_0xc351('0x42')]);_0x458f1e[_0xc351('0x46')]=_[_0xc351('0x45')](_0x1f03c4[_0xc351('0x41')],qs['fields'](_0xa019a3[_0xc351('0x42')][_0xc351('0x47')]));_0x458f1e[_0xc351('0x46')]=_0x458f1e[_0xc351('0x46')]['length']?_0x458f1e[_0xc351('0x46')]:_0x1f03c4[_0xc351('0x41')];if(_0xa019a3['query']['includeAll']){_0x458f1e[_0xc351('0x51')]=[{'all':!![]}];}_0x458f1e=_[_0xc351('0x4c')]({},_0x458f1e,_0xa019a3['options']);return db[_0xc351('0x3d')][_0xc351('0x58')](_0x458f1e)[_0xc351('0x20')](handleEntityNotFound(_0x50a2fa,null))['then'](respondWithResult(_0x50a2fa,null))[_0xc351('0x54')](handleError(_0x50a2fa,null));};exports[_0xc351('0x59')]=function(_0x1e70fe,_0x3a606f){return db['SmsAccount'][_0xc351('0x59')](_0x1e70fe[_0xc351('0x5a')],{})['then'](function(_0x10f6e3){var _0x50e3bf=_0x1e70fe['user'][_0xc351('0x32')]({'plain':!![]});if(!_0x50e3bf)throw new Error(_0xc351('0x5b'));if(_0x50e3bf[_0xc351('0x5c')]===_0xc351('0x5d')){var _0x95aa09=_0x10f6e3[_0xc351('0x32')]({'plain':!![]});var _0x3ae197=_0xc351('0x5e');return db['UserProfileSection'][_0xc351('0x58')]({'where':{'name':_0x3ae197,'userProfileId':_0x50e3bf['userProfileId']},'raw':!![]})[_0xc351('0x20')](function(_0x4c8448){if(_0x4c8448&&_0x4c8448[_0xc351('0x5f')]===0x0){return db[_0xc351('0x33')][_0xc351('0x59')]({'name':_0x95aa09[_0xc351('0x37')],'resourceId':_0x95aa09['id'],'type':_0x4c8448[_0xc351('0x37')],'sectionId':_0x4c8448['id']},{})['then'](function(){return _0x10f6e3;});}else{return _0x10f6e3;}})[_0xc351('0x54')](function(_0x2ebc42){logger['error'](_0xc351('0x60'),_0x2ebc42);throw _0x2ebc42;});}return _0x10f6e3;})[_0xc351('0x20')](respondWithResult(_0x3a606f,0xc9))[_0xc351('0x54')](handleError(_0x3a606f,null));};exports[_0xc351('0x30')]=function(_0xe0242d,_0x3a6682){if(_0xe0242d[_0xc351('0x5a')]['id']){delete _0xe0242d[_0xc351('0x5a')]['id'];}return db[_0xc351('0x3d')][_0xc351('0x58')]({'where':{'id':_0xe0242d[_0xc351('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xc351('0x3b')}]})[_0xc351('0x20')](handleEntityNotFound(_0x3a6682,null))[_0xc351('0x20')](saveUpdates(_0xe0242d[_0xc351('0x5a')],null))[_0xc351('0x20')](respondWithResult(_0x3a6682,null))['catch'](handleError(_0x3a6682,null));};exports[_0xc351('0x31')]=function(_0x267d50,_0x126dcf){return db[_0xc351('0x3d')][_0xc351('0x58')]({'where':{'id':_0x267d50[_0xc351('0x56')]['id']}})['then'](handleEntityNotFound(_0x126dcf,null))[_0xc351('0x20')](removeEntity(_0x126dcf,null))[_0xc351('0x54')](handleError(_0x126dcf,null));};exports[_0xc351('0x61')]=function(_0x1b25e6,_0x10627b){return db[_0xc351('0x3d')][_0xc351('0x61')]()[_0xc351('0x20')](respondWithResult(_0x10627b,null))[_0xc351('0x54')](handleError(_0x10627b,null));};exports['addDisposition']=function(_0x34391b,_0x3b7b87,_0x28a27d){if(_0x34391b[_0xc351('0x5a')]['id']){delete _0x34391b['body']['id'];}return db[_0xc351('0x3d')]['find']({'where':{'id':_0x34391b[_0xc351('0x56')]['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x3b7b87,null))['then'](function(_0x40dda2){if(_0x40dda2){_0x34391b[_0xc351('0x5a')][_0xc351('0x62')]=_0x40dda2['id'];return db[_0xc351('0x63')][_0xc351('0x59')](_0x34391b[_0xc351('0x5a')]);}})['then'](respondWithResult(_0x3b7b87,null))['catch'](handleError(_0x3b7b87,null));};exports[_0xc351('0x64')]=function(_0x5e12b0,_0x2ebaf2,_0x58bd6b){var _0x4d5a9c={'raw':![],'where':{}};var _0xaf6ac3={};var _0x554f53={'count':0x0,'rows':[]};return db[_0xc351('0x3d')][_0xc351('0x65')]({'where':{'id':_0x5e12b0[_0xc351('0x56')]['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x2ebaf2,null))['then'](function(_0x2e9454){if(_0x2e9454){_0xaf6ac3[_0xc351('0x41')]=_[_0xc351('0x43')](db['Disposition'][_0xc351('0x57')]);_0xaf6ac3[_0xc351('0x42')]=_[_0xc351('0x43')](_0x5e12b0[_0xc351('0x42')]);_0xaf6ac3['filters']=_[_0xc351('0x45')](_0xaf6ac3[_0xc351('0x41')],_0xaf6ac3[_0xc351('0x42')]);_0x4d5a9c['attributes']=_[_0xc351('0x45')](_0xaf6ac3[_0xc351('0x41')],qs['fields'](_0x5e12b0[_0xc351('0x42')][_0xc351('0x47')]));_0x4d5a9c[_0xc351('0x46')]=_0x4d5a9c[_0xc351('0x46')][_0xc351('0x48')]?_0x4d5a9c[_0xc351('0x46')]:_0xaf6ac3[_0xc351('0x41')];if(!_0x5e12b0['query']['hasOwnProperty']('nolimit')){_0x4d5a9c[_0xc351('0x2b')]=qs['limit'](_0x5e12b0[_0xc351('0x42')][_0xc351('0x2b')]);_0x4d5a9c[_0xc351('0x2a')]=qs['offset'](_0x5e12b0['query']['offset']);}_0x4d5a9c[_0xc351('0x66')]=qs[_0xc351('0x4a')](_0x5e12b0[_0xc351('0x42')][_0xc351('0x4a')]);_0x4d5a9c[_0xc351('0x4b')]=qs[_0xc351('0x44')](_[_0xc351('0x67')](_0x5e12b0[_0xc351('0x42')],_0xaf6ac3[_0xc351('0x44')]));_0x4d5a9c[_0xc351('0x4b')][_0xc351('0x62')]=_0x2e9454['id'];if(_0x5e12b0[_0xc351('0x42')][_0xc351('0x4e')]){_0x4d5a9c[_0xc351('0x4b')]=_[_0xc351('0x4c')](_0x4d5a9c['where'],{'$or':_[_0xc351('0x3c')](_0x4d5a9c['attributes'],function(_0x47f6e2){var _0x374b18={};_0x374b18[_0x47f6e2]={'$like':'%'+_0x5e12b0[_0xc351('0x42')][_0xc351('0x4e')]+'%'};return _0x374b18;})});}_0x4d5a9c=_[_0xc351('0x4c')]({},_0x4d5a9c,_0x5e12b0['options']);return db[_0xc351('0x63')]['count']({'where':_0x4d5a9c[_0xc351('0x4b')]})[_0xc351('0x20')](function(_0x3a088e){_0x554f53['count']=_0x3a088e;if(_0x5e12b0['query'][_0xc351('0x50')]){_0x4d5a9c[_0xc351('0x51')]=[{'all':!![]}];}return db['Disposition'][_0xc351('0x52')](_0x4d5a9c);})[_0xc351('0x20')](function(_0x231b6e){_0x554f53[_0xc351('0x53')]=_0x231b6e;return _0x554f53;});}})[_0xc351('0x20')](respondWithFilteredResult(_0x2ebaf2,_0x4d5a9c))[_0xc351('0x54')](handleError(_0x2ebaf2,null));};exports[_0xc351('0x68')]=function(_0x4c473b,_0x3eb647,_0x4d4f0f){return db[_0xc351('0x3d')]['find']({'where':{'id':_0x4c473b[_0xc351('0x56')]['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x3eb647,null))[_0xc351('0x20')](function(_0x36cb90){if(_0x36cb90){return _0x36cb90[_0xc351('0x68')](_0x4c473b[_0xc351('0x42')][_0xc351('0x69')]);}})[_0xc351('0x20')](respondWithStatusCode(_0x3eb647,null))[_0xc351('0x54')](handleError(_0x3eb647,null));};exports[_0xc351('0x6a')]=function(_0x150a4d,_0xce0c21,_0x5010e6){if(_0x150a4d[_0xc351('0x5a')]['id']){delete _0x150a4d[_0xc351('0x5a')]['id'];}return db[_0xc351('0x3d')][_0xc351('0x58')]({'where':{'id':_0x150a4d[_0xc351('0x56')]['id']}})[_0xc351('0x20')](handleEntityNotFound(_0xce0c21,null))[_0xc351('0x20')](function(_0x24d5be){if(_0x24d5be){_0x150a4d[_0xc351('0x5a')][_0xc351('0x62')]=_0x24d5be['id'];return db[_0xc351('0x6b')][_0xc351('0x59')](_0x150a4d['body']);}})[_0xc351('0x20')](respondWithResult(_0xce0c21,null))[_0xc351('0x54')](handleError(_0xce0c21,null));};exports[_0xc351('0x6c')]=function(_0x24ee58,_0x12fb05,_0x625ba5){var _0x26aefb={'raw':![],'where':{}};var _0x2b41b9={};var _0x316c08={'count':0x0,'rows':[]};return db[_0xc351('0x3d')][_0xc351('0x65')]({'where':{'id':_0x24ee58['params']['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x12fb05,null))['then'](function(_0x42fc4e){if(_0x42fc4e){_0x2b41b9[_0xc351('0x41')]=_[_0xc351('0x43')](db[_0xc351('0x6b')][_0xc351('0x57')]);_0x2b41b9[_0xc351('0x42')]=_[_0xc351('0x43')](_0x24ee58[_0xc351('0x42')]);_0x2b41b9[_0xc351('0x44')]=_[_0xc351('0x45')](_0x2b41b9[_0xc351('0x41')],_0x2b41b9[_0xc351('0x42')]);_0x26aefb[_0xc351('0x46')]=_[_0xc351('0x45')](_0x2b41b9[_0xc351('0x41')],qs[_0xc351('0x47')](_0x24ee58[_0xc351('0x42')]['fields']));_0x26aefb['attributes']=_0x26aefb[_0xc351('0x46')]['length']?_0x26aefb[_0xc351('0x46')]:_0x2b41b9[_0xc351('0x41')];if(!_0x24ee58[_0xc351('0x42')][_0xc351('0x49')](_0xc351('0x6d'))){_0x26aefb['limit']=qs[_0xc351('0x2b')](_0x24ee58['query'][_0xc351('0x2b')]);_0x26aefb[_0xc351('0x2a')]=qs[_0xc351('0x2a')](_0x24ee58[_0xc351('0x42')]['offset']);}_0x26aefb['order']=qs[_0xc351('0x4a')](_0x24ee58[_0xc351('0x42')][_0xc351('0x4a')]);_0x26aefb[_0xc351('0x4b')]=qs['filters'](_['pick'](_0x24ee58['query'],_0x2b41b9[_0xc351('0x44')]));_0x26aefb['where'][_0xc351('0x62')]=_0x42fc4e['id'];if(_0x24ee58[_0xc351('0x42')][_0xc351('0x4e')]){_0x26aefb[_0xc351('0x4b')]=_[_0xc351('0x4c')](_0x26aefb[_0xc351('0x4b')],{'$or':_[_0xc351('0x3c')](_0x26aefb[_0xc351('0x46')],function(_0x2c263e){var _0x1b39d0={};_0x1b39d0[_0x2c263e]={'$like':'%'+_0x24ee58[_0xc351('0x42')][_0xc351('0x4e')]+'%'};return _0x1b39d0;})});}_0x26aefb=_[_0xc351('0x4c')]({},_0x26aefb,_0x24ee58[_0xc351('0x4f')]);return db[_0xc351('0x6b')][_0xc351('0x29')]({'where':_0x26aefb[_0xc351('0x4b')]})[_0xc351('0x20')](function(_0x4ae243){_0x316c08[_0xc351('0x29')]=_0x4ae243;if(_0x24ee58[_0xc351('0x42')][_0xc351('0x50')]){_0x26aefb['include']=[{'all':!![]}];}return db[_0xc351('0x6b')][_0xc351('0x52')](_0x26aefb);})[_0xc351('0x20')](function(_0x34beb0){_0x316c08[_0xc351('0x53')]=_0x34beb0;return _0x316c08;});}})[_0xc351('0x20')](respondWithFilteredResult(_0x12fb05,_0x26aefb))['catch'](handleError(_0x12fb05,null));};exports[_0xc351('0x6e')]=function(_0x504a11,_0xa8cd1d,_0x202460){return db[_0xc351('0x3d')][_0xc351('0x58')]({'where':{'id':_0x504a11['params']['id']}})[_0xc351('0x20')](handleEntityNotFound(_0xa8cd1d,null))['then'](function(_0x25c478){if(_0x25c478){return _0x25c478[_0xc351('0x6e')](_0x504a11['query'][_0xc351('0x69')]);}})['then'](respondWithStatusCode(_0xa8cd1d,null))[_0xc351('0x54')](handleError(_0xa8cd1d,null));};exports[_0xc351('0x6f')]=function(_0x1ec12b,_0x1907b,_0x54dfed){var _0x6d110d={'channel':_0xc351('0x70')};var _0x2f00f9=[];var _0x6b4df5=[];var _0x1d3a4d={};return db['SmsAccount'][_0xc351('0x58')]({'where':{'id':_0x1ec12b[_0xc351('0x56')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xc351('0x71')}]})[_0xc351('0x20')](handleEntityNotFound(_0x1907b,null))[_0xc351('0x20')](function(_0x39f46e){_0x6d110d['account']=_0x39f46e;_0x6d110d[_0xc351('0x72')]=_[_0xc351('0x73')](_0x39f46e[_0xc351('0x71')],['priority'],['asc']);if(_0x6d110d[_0xc351('0x74')][_0xc351('0x71')]){delete _0x6d110d[_0xc351('0x74')][_0xc351('0x71')];}return db['CmContact']['describe']();})[_0xc351('0x20')](function(_0x21d1e3){if(!_0x21d1e3){throw new db[(_0xc351('0x1c'))][(_0xc351('0x1d'))](_0xc351('0x75'));}_0x2f00f9=_[_0xc351('0x76')](_[_0xc351('0x43')](_0x21d1e3),[_0xc351('0x77'),_0xc351('0x78')]);_0x6b4df5=_[_0xc351('0x76')](_[_0xc351('0x43')](_0x21d1e3),[_0xc351('0x77'),'updatedAt',_0xc351('0x79'),_0xc351('0x7a')]);_0x6d110d['body']={'mapKey':'mobile'};if(_0x6d110d[_0xc351('0x74')][_0xc351('0x3f')]){switch(_0x6d110d[_0xc351('0x74')][_0xc351('0x3f')]){case'twilio':_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x7c')];_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x7d')];_0x6d110d['body'][_0xc351('0x7e')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x7f')];break;case _0xc351('0x80'):_0x6d110d['body'][_0xc351('0x7b')]='+'+_0x1ec12b['body'][_0xc351('0x81')];_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x82')];break;case _0xc351('0x83'):_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')]=_0x1ec12b['body'][_0xc351('0x7b')];_0x6d110d['body'][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x26')];break;case _0xc351('0x84'):_0x6d110d['body'][_0xc351('0x7b')]=_0x1ec12b['body']['from'];_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x5a')];_0x6d110d[_0xc351('0x5a')]['messageId']=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x85')];break;case _0xc351('0x86'):_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x7c')];_0x6d110d['body'][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x87')];_0x6d110d['body'][_0xc351('0x7e')]=_0x1ec12b['body'][_0xc351('0x88')];break;case _0xc351('0x89'):_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')]='+'+_0x1ec12b[_0xc351('0x5a')][_0xc351('0x8a')][0x0][_0xc351('0x7b')];_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x8a')][0x0][_0xc351('0x82')];_0x6d110d[_0xc351('0x5a')]['messageId']=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x8a')][0x0]['messageId'];break;case _0xc351('0x8b'):_0x6d110d[_0xc351('0x5a')]['from']=_0x1ec12b[_0xc351('0x5a')]['originatingAddress'];_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x8c')][_0xc351('0x26')];break;case _0xc351('0x8d'):_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x8e')];_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x82')];_0x6d110d[_0xc351('0x5a')][_0xc351('0x7e')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x8f')];break;case _0xc351('0x90'):_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')]=_0x1ec12b[_0xc351('0x5a')]['from'];_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x26')];_0x6d110d[_0xc351('0x5a')][_0xc351('0x7e')]=_0x1ec12b[_0xc351('0x5a')][_0xc351('0x91')];break;}}if(_0x6d110d[_0xc351('0x5a')]['id']){delete _0x6d110d[_0xc351('0x5a')]['id'];}if(_['isNil'](_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')])){throw new db[(_0xc351('0x1c'))]['ValidationError'](_0xc351('0x92'));}if(_[_0xc351('0x93')](_0x6d110d[_0xc351('0x5a')]['body'])||_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')]===''){throw new db[(_0xc351('0x1c'))][(_0xc351('0x1d'))](_0xc351('0x94'));}if(_['isNil'](_0x6d110d['body'][_0xc351('0x95')])){throw new db[(_0xc351('0x1c'))][(_0xc351('0x1d'))](_0xc351('0x96')+_0x6b4df5);}if(!_[_0xc351('0x97')](_0x6b4df5,_0x6d110d['body']['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6b4df5);}_0x1d3a4d[_0x6d110d[_0xc351('0x5a')][_0xc351('0x95')]]=_0x6d110d['body'][_0xc351('0x7b')];return db[_0xc351('0x98')][_0xc351('0x58')]({'where':{'id':_0x6d110d[_0xc351('0x74')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xc351('0x99'),'where':_0x1d3a4d,'limit':0x1,'order':[[_0xc351('0x78'),_0xc351('0x9a')]]}]});})[_0xc351('0x20')](handleEntityNotFound(_0x1907b,null))[_0xc351('0x20')](function(_0x340324){if(_0x340324){_0x6d110d[_0xc351('0x9b')]=_[_0xc351('0x9c')](_0x340324,[_0xc351('0x99')]);if(_0x340324[_0xc351('0x99')][_0xc351('0x48')]){return _0x340324[_0xc351('0x99')][0x0];}var _0x373df9=_[_0xc351('0x15')](_0x6d110d['body'],{'firstName':_0x6d110d[_0xc351('0x5a')]['from'],'ListId':_0x340324['id']});_0x373df9[_0x6d110d[_0xc351('0x5a')]['mapKey']]=_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')];return db['CmContact'][_0xc351('0x59')](_0x373df9,{'fields':_0x2f00f9,'raw':!![]});}})[_0xc351('0x20')](handleEntityNotFound(_0x1907b,null))[_0xc351('0x20')](function(_0xbfc46c){if(_0xbfc46c){_0x6d110d[_0xc351('0x9d')]=_0xbfc46c;var _0x19d0f8={'ContactId':_0xbfc46c['id'],'phone':_0x6d110d['body'][_0xc351('0x7b')],'SmsAccountId':_0x1ec12b[_0xc351('0x56')]['id']};var _0x20c311={'ContactId':_0xbfc46c['id'],'SmsAccountId':_0x1ec12b[_0xc351('0x56')]['id'],'closed':![]};return db[_0xc351('0x9e')][_0xc351('0x58')]({'where':_0x20c311})[_0xc351('0x20')](function(_0x7a487c){if(_0x7a487c){return[_0x7a487c,![]];}return db[_0xc351('0x9e')]['create'](_0x19d0f8)[_0xc351('0x20')](function(_0x3cfb3e){return[_0x3cfb3e,!![]];});});}})[_0xc351('0x9f')](function(_0x36e4e9,_0x1e8df6){_0x6d110d[_0xc351('0xa0')]=_0x36e4e9[_0xc351('0x32')]({'plain':!![]});_0x6d110d[_0xc351('0xa0')][_0xc351('0xa1')]=![];if(_0x1e8df6){if(_0x6d110d[_0xc351('0x74')][_0xc351('0xa2')]){_0x6d110d[_0xc351('0x72')]['push']({'id':0x0,'priority':_0x6d110d[_0xc351('0x72')][_0xc351('0x48')]+0x1,'app':_0xc351('0xa3'),'appdata':_0xc351('0xa4'),'interval':_0xc351('0xa5')});}_0x6d110d[_0xc351('0xa0')][_0xc351('0xa1')]=!![];}return db['SmsMessage'][_0xc351('0x59')]({'phone':_0x6d110d[_0xc351('0x5a')][_0xc351('0x7b')],'messageId':_0x6d110d['body'][_0xc351('0x7e')],'body':_0x6d110d[_0xc351('0x5a')][_0xc351('0x5a')],'SmsAccountId':_0x1ec12b['params']['id'],'SmsInteractionId':_0x36e4e9['id'],'direction':'in','ContactId':_0x36e4e9[_0xc351('0xa6')],'AttachmentId':_0x6d110d[_0xc351('0x5a')]['AttachmentId']});})['then'](function(_0xc7bdd3){_0x6d110d[_0xc351('0x26')]=_0xc7bdd3;if(_0x6d110d[_0xc351('0xa0')]['UserId']){return db[_0xc351('0xa7')][_0xc351('0x58')]({'attributes':['id',_0xc351('0x37')],'where':{'id':_0x6d110d[_0xc351('0xa0')]['UserId']}})[_0xc351('0x20')](function(_0x2e1207){if(_0x2e1207){_0x6d110d['applications'][_0xc351('0xa8')]({'id':0x0,'priority':0x0,'app':_0xc351('0xa9'),'appdata':_0x2e1207['name']+','+(_0x6d110d['account']['waitForTheAssignedAgent']||0xa),'interval':_0xc351('0xa5')});}return respondWithRpcPromise('Start',_0xc351('0xaa'),_0x6d110d);});}return respondWithRpcPromise('Start',_0xc351('0xaa'),_0x6d110d);})[_0xc351('0x20')](function(_0x5eb66f){if(_0x5eb66f){var _0x3d3438=0xc8;var _0x598653=_0xc351('0xab');logger['info'](_0xc351('0xac'),_0x598653,_0x3d3438,_0xc351('0xad'));logger[_0xc351('0xae')](_0xc351('0xaf'),_0x598653,_0x3d3438,_0xc351('0xad'),JSON[_0xc351('0x23')](_0x5eb66f));if(_0x6d110d['account'][_0xc351('0x3f')]==='twilio'){return _0x1907b[_0xc351('0x28')](_0x3d3438)[_0xc351('0x2c')](_0xc351('0xb0'),_0xc351('0xb1'))['send'](_0xc351('0xb2'));}else{return _0x1907b['status'](_0x3d3438)[_0xc351('0xb3')](_0x5eb66f);}}})['catch'](handleError(_0x1907b,null));};exports[_0xc351('0xb4')]=function(_0x55d404,_0x5c086b,_0x5f5327){return db[_0xc351('0x3d')]['findOne']({'where':{'id':_0x55d404[_0xc351('0x56')]['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x5c086b,null))[_0xc351('0x20')](function(_0x30ed5c){if(_0x30ed5c){return db[_0xc351('0xb5')][_0xc351('0xb6')](function(_0x507732){return db[_0xc351('0xb7')][_0xc351('0x31')]({'where':{'SmsAccountId':_0x55d404[_0xc351('0x56')]['id']},'transaction':_0x507732})[_0xc351('0x20')](function(_0x2002a2){var _0x3dee03=_[_0xc351('0x3c')](_0x55d404[_0xc351('0x5a')],function(_0x409e65){_0x409e65[_0xc351('0x62')]=_0x55d404[_0xc351('0x56')]['id'];return _0x409e65;});return db[_0xc351('0xb7')][_0xc351('0xb8')](_0x3dee03,{'transaction':_0x507732});});})[_0xc351('0x20')](function(){return db['SmsApplication'][_0xc351('0xb9')]({'where':{'SmsAccountId':_0x55d404[_0xc351('0x56')]['id']},'order':_0xc351('0xba')});});}})['then'](respondWithResult(_0x5c086b,null))[_0xc351('0x54')](handleError(_0x5c086b,null));};exports['getApplications']=function(_0x4419b1,_0x15370c,_0x310229){var _0x5f4aad={};var _0x6b1155={};var _0x3e6fa0;var _0x346614;return db['SmsAccount'][_0xc351('0x65')]({'where':{'id':_0x4419b1['params']['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x15370c,null))[_0xc351('0x20')](function(_0x58058a){if(_0x58058a){_0x3e6fa0=_0x58058a;_0x6b1155[_0xc351('0x41')]=_[_0xc351('0x43')](db[_0xc351('0xb7')][_0xc351('0x57')]);_0x6b1155[_0xc351('0x42')]=_[_0xc351('0x43')](_0x4419b1['query']);_0x6b1155[_0xc351('0x44')]=_['intersection'](_0x6b1155[_0xc351('0x41')],_0x6b1155[_0xc351('0x42')]);_0x5f4aad[_0xc351('0x46')]=_['intersection'](_0x6b1155[_0xc351('0x41')],qs[_0xc351('0x47')](_0x4419b1['query'][_0xc351('0x47')]));_0x5f4aad[_0xc351('0x46')]=_0x5f4aad[_0xc351('0x46')][_0xc351('0x48')]?_0x5f4aad[_0xc351('0x46')]:_0x6b1155['model'];_0x5f4aad[_0xc351('0x66')]=qs[_0xc351('0x4a')](_0x4419b1[_0xc351('0x42')][_0xc351('0x4a')]);_0x5f4aad[_0xc351('0x4b')]=qs[_0xc351('0x44')](_[_0xc351('0x67')](_0x4419b1[_0xc351('0x42')],_0x6b1155['filters']));if(_0x4419b1[_0xc351('0x42')]['filter']){_0x5f4aad['where']=_[_0xc351('0x4c')](_0x5f4aad[_0xc351('0x4b')],{'$or':_['map'](_0x5f4aad[_0xc351('0x46')],function(_0x165bc2){var _0x3276d9={};_0x3276d9[_0x165bc2]={'$like':'%'+_0x4419b1['query'][_0xc351('0x4e')]+'%'};return _0x3276d9;})});}_0x5f4aad=_['merge']({},_0x5f4aad,_0x4419b1[_0xc351('0x4f')]);return _0x3e6fa0[_0xc351('0xbb')](_0x5f4aad);}})[_0xc351('0x20')](function(_0x146611){if(_0x146611){_0x346614=_0x146611[_0xc351('0x48')];if(!_0x4419b1['query'][_0xc351('0x49')]('nolimit')){_0x5f4aad['limit']=qs[_0xc351('0x2b')](_0x4419b1[_0xc351('0x42')][_0xc351('0x2b')]);_0x5f4aad['offset']=qs[_0xc351('0x2a')](_0x4419b1[_0xc351('0x42')][_0xc351('0x2a')]);}return _0x3e6fa0[_0xc351('0xbb')](_0x5f4aad);}})[_0xc351('0x20')](function(_0x1d0375){if(_0x1d0375){return _0x1d0375?{'count':_0x346614,'rows':_0x1d0375}:null;}})['then'](respondWithResult(_0x15370c,null))[_0xc351('0x54')](handleError(_0x15370c,null));};exports[_0xc351('0xbc')]=function(_0x557b04,_0x420f8c,_0x17048e){var _0x108f87={'raw':![],'where':{}};var _0x192267={};var _0x378d6e={'count':0x0,'rows':[]};return db[_0xc351('0x3d')]['findOne']({'where':{'id':_0x557b04['params']['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x420f8c,null))[_0xc351('0x20')](function(_0xc71bf5){if(_0xc71bf5){_0x192267[_0xc351('0x41')]=_[_0xc351('0x43')](db[_0xc351('0x9e')][_0xc351('0x57')]);_0x192267[_0xc351('0x42')]=_['keys'](_0x557b04['query']);_0x192267['filters']=_[_0xc351('0x45')](_0x192267[_0xc351('0x41')],_0x192267[_0xc351('0x42')]);_0x108f87[_0xc351('0x46')]=_['intersection'](_0x192267['model'],qs[_0xc351('0x47')](_0x557b04['query']['fields']));_0x108f87[_0xc351('0x46')]=_0x108f87[_0xc351('0x46')][_0xc351('0x48')]?_0x108f87['attributes']:_0x192267['model'];if(!_0x557b04['query'][_0xc351('0x49')](_0xc351('0x6d'))){_0x108f87[_0xc351('0x2b')]=qs[_0xc351('0x2b')](_0x557b04[_0xc351('0x42')]['limit']);_0x108f87[_0xc351('0x2a')]=qs[_0xc351('0x2a')](_0x557b04[_0xc351('0x42')]['offset']);}_0x108f87[_0xc351('0x66')]=qs[_0xc351('0x4a')](_0x557b04['query']['sort']);_0x108f87['where']=qs[_0xc351('0x44')](_[_0xc351('0x67')](_0x557b04[_0xc351('0x42')],_0x192267[_0xc351('0x44')]));_0x108f87[_0xc351('0x4b')][_0xc351('0x62')]=_0xc71bf5['id'];if(_0x557b04[_0xc351('0x42')][_0xc351('0x4e')]){_0x108f87['where']=_[_0xc351('0x4c')](_0x108f87['where'],{'$or':_[_0xc351('0x3c')](_0x108f87[_0xc351('0x46')],function(_0x3458eb){var _0x2a4f32={};_0x2a4f32[_0x3458eb]={'$like':'%'+_0x557b04[_0xc351('0x42')][_0xc351('0x4e')]+'%'};return _0x2a4f32;})});}_0x108f87=_[_0xc351('0x4c')]({},_0x108f87,_0x557b04[_0xc351('0x4f')]);return db[_0xc351('0x9e')][_0xc351('0x29')]({'where':_0x108f87[_0xc351('0x4b')]})['then'](function(_0x3f0a3b){_0x378d6e[_0xc351('0x29')]=_0x3f0a3b;if(_0x557b04[_0xc351('0x42')][_0xc351('0x50')]){_0x108f87[_0xc351('0x51')]=[{'model':db[_0xc351('0xbd')],'as':'Contact','required':![]},{'model':db[_0xc351('0xa7')],'as':'Owner','attributes':[_0xc351('0x37'),_0xc351('0xbe'),_0xc351('0xbf')],'required':![]},{'model':db[_0xc351('0xc0')],'as':'Tags','attributes':['id','name',_0xc351('0xc1')],'where':_0x557b04[_0xc351('0x42')][_0xc351('0xc2')]?{'id':_0x557b04[_0xc351('0x42')][_0xc351('0xc2')]}:undefined,'required':_0x557b04[_0xc351('0x42')][_0xc351('0xc2')]?!![]:![]}];}return db['SmsInteraction'][_0xc351('0x52')](_0x108f87);})[_0xc351('0x20')](function(_0x352055){_0x378d6e[_0xc351('0x53')]=_0x352055;return _0x378d6e;});}})['then'](respondWithFilteredResult(_0x420f8c,_0x108f87))[_0xc351('0x54')](handleError(_0x420f8c,null));};exports['send']=function(_0x150130,_0x30839e,_0x499d86){var _0x352193,_0x2dda03,_0x3892c9;if(_[_0xc351('0x93')](_0x150130[_0xc351('0x5a')][_0xc351('0x5a')])||_0x150130['body'][_0xc351('0x5a')]===''){throw new db[(_0xc351('0x1c'))]['ValidationError'](_0xc351('0x94'));}if(_['isNil'](_0x150130[_0xc351('0x5a')]['to'])){throw new db['Sequelize'][(_0xc351('0x1d'))](_0xc351('0xc3'));}_0x352193=_0x150130['body']['to'];return db[_0xc351('0x3d')][_0xc351('0x58')]({'where':{'id':_0x150130[_0xc351('0x56')]['id']},'include':[{'model':db[_0xc351('0x98')],'as':_0xc351('0xc4'),'include':[{'model':db[_0xc351('0xbd')],'as':_0xc351('0x99'),'where':{'mobile':_0x352193},'limit':0x1,'order':[['updatedAt',_0xc351('0x9a')]]}]}]})['then'](handleEntityNotFound(_0x30839e,null))[_0xc351('0x20')](function(_0x1068f8){if(_0x1068f8&&_0x1068f8[_0xc351('0xc4')]){_0x2dda03=_0x1068f8[_0xc351('0x32')]({'plain':!![]});if(_0x2dda03[_0xc351('0xc4')]&&_0x2dda03[_0xc351('0xc4')][_0xc351('0x99')]['length']){return _0x2dda03['List'][_0xc351('0x99')][0x0];}return db[_0xc351('0xbd')][_0xc351('0x59')](_[_0xc351('0x15')](_0x150130['body'],{'firstName':_0x352193,'mobile':_0x352193,'phone':_0x352193,'ListId':_0x2dda03['ListId']}));}})[_0xc351('0x20')](handleEntityNotFound(_0x30839e,null))['then'](function(_0x109b66){if(_0x109b66){_0x3892c9=_0x109b66;return db[_0xc351('0x9e')][_0xc351('0x58')]({'where':{'ContactId':_0x3892c9['id'],'closed':![],'SmsAccountId':_0x2dda03['id']}})['then'](function(_0x30b602){if(_0x30b602){return[_0x30b602,![]];}return db[_0xc351('0x9e')]['create']({'UserId':_0x150130[_0xc351('0x5d')]['id'],'ContactId':_0x3892c9['id'],'SmsAccountId':_0x2dda03['id'],'phone':_0x352193,'firstMsgDirection':_0xc351('0xc5'),'Messages':[_['merge'](_0x150130[_0xc351('0x5a')],{'read':![],'body':_0x150130[_0xc351('0x5a')][_0xc351('0x5a')],'phone':_0x352193,'SmsAccountId':_0x2dda03['id'],'UserId':_0x150130[_0xc351('0x5d')]['id'],'ContactId':_0x3892c9['id']})]},{'include':[{'model':db[_0xc351('0xc6')],'as':'Messages'}]})[_0xc351('0x20')](function(_0x3b838c){return[_0x3b838c,!![]];});});}})['spread'](function(_0x460971,_0xa2481a){if(_0xa2481a){return _0x460971;}return db[_0xc351('0xc6')][_0xc351('0x59')](_[_0xc351('0x4c')](_0x150130[_0xc351('0x5a')],{'read':![],'body':_0x150130['body'][_0xc351('0x5a')],'phone':_0x352193,'SmsAccountId':_0x2dda03['id'],'SmsInteractionId':_0x460971['id'],'UserId':_0x150130['user']['id'],'ContactId':_0x3892c9['id']}))[_0xc351('0x20')](function(_0x43e03a){_0x460971[_0xc351('0xc7')][_0xc351('0xc8')]=[];_0x460971['dataValues'][_0xc351('0xc8')][_0xc351('0xc9')](_0x43e03a[_0xc351('0xc7')]);return _0x460971;});})[_0xc351('0x20')](respondWithResult(_0x30839e,null))[_0xc351('0x54')](handleError(_0x30839e,null));};exports[_0xc351('0x28')]=function(_0x5a376d,_0x1973ca,_0x1bd92e){if(_0x5a376d[_0xc351('0x5a')]['id']){delete _0x5a376d[_0xc351('0x5a')]['id'];}console[_0xc351('0xca')]('endpoint\x20/status\x20POST\x20/',_0x5a376d[_0xc351('0x5a')]);var _0xbc7535,_0x248f91,_0xd54b51;return db[_0xc351('0x3d')][_0xc351('0x58')]({'where':{'id':_0x5a376d['params']['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x1973ca,null))[_0xc351('0x20')](function(_0x2d5e3c){if(_0x2d5e3c){_0xd54b51=_0x2d5e3c;logger[_0xc351('0xae')](_0xc351('0xac'),_0xc351('0x28'),_0xc351('0xcb'),_0x2d5e3c['type'],util[_0xc351('0xcc')](_0x5a376d[_0xc351('0x5a')],{'showHidden':![],'depth':null}));switch(_0x2d5e3c['type']){case _0xc351('0x80'):if(_0x5a376d[_0xc351('0x5a')][_0xc351('0xcd')]&&_0x5a376d[_0xc351('0x5a')][_0xc351('0x28')]){_0x248f91=_0x5a376d[_0xc351('0x5a')][_0xc351('0x28')];return db[_0xc351('0xc6')][_0xc351('0x58')]({'where':{'messageId':_0x5a376d[_0xc351('0x5a')][_0xc351('0xcd')]}});}break;case _0xc351('0x83'):if(_0x5a376d['body'][_0xc351('0xce')]&&_0x5a376d[_0xc351('0x5a')][_0xc351('0xcf')]){_0x248f91=_0x5a376d['body'][_0xc351('0xcf')];return db['SmsMessage']['find']({'where':{'messageId':_0x5a376d[_0xc351('0x5a')]['requestid']}});}break;case _0xc351('0x84'):if(_0x5a376d[_0xc351('0x5a')][_0xc351('0x85')]&&_0x5a376d[_0xc351('0x5a')][_0xc351('0xd0')]){_0x248f91=_0x5a376d['body'][_0xc351('0xd0')];return db[_0xc351('0xc6')][_0xc351('0x58')]({'where':{'messageId':_0x5a376d[_0xc351('0x5a')]['message_id']}});}break;case _0xc351('0x89'):var _0x32ffdd=_0x5a376d['body'][_0xc351('0x8a')][0x0];if(_0x32ffdd[_0xc351('0x7e')]&&_0x32ffdd[_0xc351('0x28')]['groupName']===_0xc351('0xd1')){_0x248f91=_0x32ffdd[_0xc351('0x28')]['groupName'];return db[_0xc351('0xc6')][_0xc351('0x58')]({'where':{'messageId':_0x32ffdd[_0xc351('0x7e')]}});}break;case _0xc351('0x8d'):if(_0x5a376d[_0xc351('0x5a')][_0xc351('0x7e')]&&_0x5a376d['body']['status']){_0x248f91=_0x5a376d[_0xc351('0x5a')][_0xc351('0x28')];return db[_0xc351('0xc6')]['find']({'where':{'messageId':_0x5a376d['body']['messageId']}});}break;case'intelepeer':if(_0x5a376d[_0xc351('0x5a')][_0xc351('0xd2')]&&_0x5a376d[_0xc351('0x5a')][_0xc351('0x28')]){_0x248f91=_0x5a376d[_0xc351('0x5a')][_0xc351('0x28')];return db['SmsMessage'][_0xc351('0x58')]({'where':{'messageId':_0x5a376d[_0xc351('0x5a')][_0xc351('0xd2')]}});}break;}}})[_0xc351('0x20')](handleEntityNotFound(_0x1973ca,null))[_0xc351('0x20')](function(_0x51466d){if(_0x51466d){_0xbc7535=_0x51466d;switch(_0xd54b51['type']){case _0xc351('0x80'):if(_0x248f91===_0xc351('0xd1')){return _0xbc7535[_0xc351('0x30')]({'read':!![]});}else{logger[_0xc351('0x24')](_0xc351('0xac'),_0xc351('0x28'),_0xc351('0x80'),util[_0xc351('0xcc')](_0x5a376d[_0xc351('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc351('0x83'):if(_0x248f91==='1'){return _0xbc7535[_0xc351('0x30')]({'read':!![]});}else{logger['error'](_0xc351('0xac'),'status',_0xc351('0x80'),util[_0xc351('0xcc')](_0x5a376d[_0xc351('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc351('0x84'):if(!_0x5a376d[_0xc351('0x5a')][_0xc351('0xd3')]&&_0x248f91>=0xc8&&_0x248f91<=0xce){return _0xbc7535[_0xc351('0x30')]({'read':!![]});}else{logger[_0xc351('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xc351('0x84'),util[_0xc351('0xcc')](_0x5a376d[_0xc351('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc351('0x89'):var _0x26e62c=_0x5a376d['body'][_0xc351('0x8a')][0x0];if(_0x26e62c[_0xc351('0x28')][_0xc351('0xd4')]==='DELIVERED'){return _0xbc7535[_0xc351('0x30')]({'read':!![]});}else{logger['error'](_0xc351('0xac'),'status','infobip',util['inspect'](_0x5a376d[_0xc351('0x5a')],{'showHidden':![],'depth':null}));}break;case _0xc351('0x8d'):if(_0x248f91==_0xc351('0xd5')||_0x248f91==_0xc351('0xd6')){return _0xbc7535[_0xc351('0x30')]({'read':!![]});}else{logger[_0xc351('0x24')](_0xc351('0xac'),_0xc351('0x28'),_0xc351('0x8d'),util[_0xc351('0xcc')](_0x5a376d[_0xc351('0x5a')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x248f91===_0xc351('0xd7')||_0x248f91==='ACCEPTD'){return _0xbc7535[_0xc351('0x30')]({'read':!![]});}else{logger[_0xc351('0x24')](_0xc351('0xac'),_0xc351('0x28'),_0xc351('0x90'),util[_0xc351('0xcc')](_0x5a376d['body'],{'showHidden':![],'depth':null}));}break;}return _0xbc7535;}})[_0xc351('0x20')](respondWithResult(_0x1973ca,null))[_0xc351('0x54')](handleError(_0x1973ca,null));};exports[_0xc351('0xd8')]=function(_0x5386fd,_0x33ef9a,_0x1f96a5){var _0x422bd5,_0x2b6b32,_0xd2750e;return db[_0xc351('0x3d')]['find']({'where':{'id':_0x5386fd['params']['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x33ef9a,null))[_0xc351('0x20')](function(_0x2221a6){if(_0x2221a6){_0xd2750e=_0x2221a6;logger[_0xc351('0xae')](_0xc351('0xac'),_0xc351('0x28'),_0xc351('0xcb'),_0x2221a6['type'],util[_0xc351('0xcc')](_0x5386fd[_0xc351('0x42')],{'showHidden':![],'depth':null}));switch(_0x2221a6['type']){case _0xc351('0x8b'):if(_0x5386fd[_0xc351('0x42')][_0xc351('0xd9')]&&_0x5386fd[_0xc351('0x42')][_0xc351('0xda')]){_0x2b6b32=_0x5386fd[_0xc351('0x42')][_0xc351('0xda')];return db[_0xc351('0xc6')]['find']({'where':{'messageId':_0x5386fd[_0xc351('0x42')]['message-id']}});}break;}}})[_0xc351('0x20')](handleEntityNotFound(_0x33ef9a,null))[_0xc351('0x20')](function(_0x5f2495){if(_0x5f2495){_0x422bd5=_0x5f2495;switch(_0xd2750e[_0xc351('0x3f')]){case _0xc351('0x8b'):if(_0x2b6b32==='2'||_0x2b6b32==='6'){return _0x422bd5[_0xc351('0x30')]({'read':!![]});}else{logger[_0xc351('0x24')](_0xc351('0xac'),_0xc351('0x28'),_0xc351('0x8b'),util[_0xc351('0xcc')](_0x5386fd[_0xc351('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x422bd5;}})[_0xc351('0x20')](respondWithResult(_0x33ef9a,null))['catch'](handleError(_0x33ef9a,null));};exports[_0xc351('0xdb')]=function(_0x21b02e,_0x3d5706,_0xf21c22){return db['SmsAccount'][_0xc351('0x58')]({'where':{'id':_0x21b02e['params']['id']}})['then'](handleEntityNotFound(_0x3d5706,null))[_0xc351('0x20')](function(_0x2442e6){if(_0x2442e6){return _0x2442e6[_0xc351('0xdb')](_0x21b02e[_0xc351('0x5a')][_0xc351('0x69')],_[_0xc351('0x9c')](_0x21b02e[_0xc351('0x5a')],[_0xc351('0x69'),'id'])||{})[_0xc351('0x9f')](function(_0x3a257a){for(var _0x295f37=0x0;_0x295f37<_0x21b02e[_0xc351('0x5a')]['ids'][_0xc351('0x48')];_0x295f37+=0x1){socket['emit'](_0xc351('0xdc'),{'UserId':_0x21b02e['body'][_0xc351('0x69')][_0x295f37],'SmsAccountId':_0x21b02e[_0xc351('0x56')]['id']});}return _0x3a257a;});}})['then'](respondWithResult(_0x3d5706,null))[_0xc351('0x54')](handleError(_0x3d5706,null));};exports[_0xc351('0xdd')]=function(_0x304ef0,_0x3cb4b5,_0x140e12){return db[_0xc351('0x3d')][_0xc351('0x58')]({'where':{'id':_0x304ef0[_0xc351('0x56')]['id']}})[_0xc351('0x20')](handleEntityNotFound(_0x3cb4b5,null))[_0xc351('0x20')](function(_0x5d31c4){if(_0x5d31c4){return _0x5d31c4[_0xc351('0xdd')](_0x304ef0[_0xc351('0x42')][_0xc351('0x69')])['then'](function(){if(_[_0xc351('0xde')](_0x304ef0[_0xc351('0x42')][_0xc351('0x69')])){for(var _0x97879b=0x0;_0x97879b<_0x304ef0[_0xc351('0x42')][_0xc351('0x69')][_0xc351('0x48')];_0x97879b+=0x1){socket[_0xc351('0xdf')]('userSmsAccount:remove',{'UserId':Number(_0x304ef0[_0xc351('0x42')][_0xc351('0x69')][_0x97879b]),'SmsAccountId':Number(_0x304ef0[_0xc351('0x56')]['id'])});}}else{socket[_0xc351('0xdf')](_0xc351('0xe0'),{'UserId':Number(_0x304ef0[_0xc351('0x42')]['ids']),'SmsAccountId':Number(_0x304ef0[_0xc351('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x3cb4b5,null))[_0xc351('0x54')](handleError(_0x3cb4b5,null));};exports[_0xc351('0xe1')]=function(_0xbd7a27,_0x1163e2,_0x5f4d47){var _0x3fcb45={};var _0x486ee8={};var _0xc22e97;var _0x195e88;return db['SmsAccount']['findOne']({'where':{'id':_0xbd7a27[_0xc351('0x56')]['id']}})['then'](handleEntityNotFound(_0x1163e2,null))[_0xc351('0x20')](function(_0x303f4a){if(_0x303f4a){_0xc22e97=_0x303f4a;_0x486ee8[_0xc351('0x41')]=_[_0xc351('0x43')](db[_0xc351('0xa7')][_0xc351('0x57')]);_0x486ee8[_0xc351('0x42')]=_['keys'](_0xbd7a27[_0xc351('0x42')]);_0x486ee8[_0xc351('0x44')]=_[_0xc351('0x45')](_0x486ee8[_0xc351('0x41')],_0x486ee8[_0xc351('0x42')]);_0x3fcb45[_0xc351('0x46')]=_[_0xc351('0x45')](_0x486ee8[_0xc351('0x41')],qs['fields'](_0xbd7a27['query']['fields']));_0x3fcb45[_0xc351('0x46')]=_0x3fcb45[_0xc351('0x46')][_0xc351('0x48')]?_0x3fcb45[_0xc351('0x46')]:_0x486ee8[_0xc351('0x41')];_0x3fcb45['order']=qs[_0xc351('0x4a')](_0xbd7a27[_0xc351('0x42')][_0xc351('0x4a')]);_0x3fcb45[_0xc351('0x4b')]=qs[_0xc351('0x44')](_[_0xc351('0x67')](_0xbd7a27[_0xc351('0x42')],_0x486ee8[_0xc351('0x44')]));if(_0xbd7a27[_0xc351('0x42')][_0xc351('0x4e')]){_0x3fcb45[_0xc351('0x4b')]=_[_0xc351('0x4c')](_0x3fcb45[_0xc351('0x4b')],{'$or':_[_0xc351('0x3c')](_0x3fcb45['attributes'],function(_0xf5440d){var _0xb23156={};_0xb23156[_0xf5440d]={'$like':'%'+_0xbd7a27[_0xc351('0x42')][_0xc351('0x4e')]+'%'};return _0xb23156;})});}_0x3fcb45=_[_0xc351('0x4c')]({},_0x3fcb45,_0xbd7a27[_0xc351('0x4f')]);return _0xc22e97[_0xc351('0xe1')](_0x3fcb45);}})[_0xc351('0x20')](function(_0x6bac15){if(_0x6bac15){_0x195e88=_0x6bac15['length'];if(!_0xbd7a27[_0xc351('0x42')][_0xc351('0x49')]('nolimit')){_0x3fcb45['limit']=qs[_0xc351('0x2b')](_0xbd7a27[_0xc351('0x42')][_0xc351('0x2b')]);_0x3fcb45[_0xc351('0x2a')]=qs['offset'](_0xbd7a27[_0xc351('0x42')][_0xc351('0x2a')]);}return _0xc22e97[_0xc351('0xe1')](_0x3fcb45);}})['then'](function(_0x2f6775){if(_0x2f6775){return _0x2f6775?{'count':_0x195e88,'rows':_0x2f6775}:null;}})[_0xc351('0x20')](respondWithResult(_0x1163e2,null))['catch'](handleError(_0x1163e2,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2130c57..7892eef 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 _0x2101=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x570d3d,_0x3557c1){var _0x4395e7=function(_0x43b75f){while(--_0x43b75f){_0x570d3d['push'](_0x570d3d['shift']());}};_0x4395e7(++_0x3557c1);}(_0x2101,0x12b));var _0x1210=function(_0x591122,_0x193cf6){_0x591122=_0x591122-0x0;var _0x2b638d=_0x2101[_0x591122];return _0x2b638d;};'use strict';var EventEmitter=require(_0x1210('0x0'));var SmsAccount=require(_0x1210('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1210('0x2')](0x0);var events={'afterCreate':_0x1210('0x3'),'afterUpdate':_0x1210('0x4'),'afterDestroy':_0x1210('0x5')};function emitEvent(_0x4e47a7){return function(_0x2094cb,_0x41b432,_0x3c7dc0){SmsAccountEvents[_0x1210('0x6')](_0x4e47a7+':'+_0x2094cb['id'],_0x2094cb);SmsAccountEvents['emit'](_0x4e47a7,_0x2094cb);_0x3c7dc0(null);};}for(var e in events){if(events[_0x1210('0x7')](e)){var event=events[e];SmsAccount[_0x1210('0x8')](e,emitEvent(event));}}module[_0x1210('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x5fec=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x5fec,0x91));var _0xc5fe=function(_0x427c8c,_0x4c049f){_0x427c8c=_0x427c8c-0x0;var _0x39526c=_0x5fec[_0x427c8c];return _0x39526c;};'use strict';var EventEmitter=require(_0xc5fe('0x0'));var SmsAccount=require(_0xc5fe('0x1'))['db'][_0xc5fe('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc5fe('0x3')](0x0);var events={'afterCreate':_0xc5fe('0x4'),'afterUpdate':_0xc5fe('0x5'),'afterDestroy':_0xc5fe('0x6')};function emitEvent(_0x1096cd){return function(_0xf426e0,_0x38809d,_0x51826d){SmsAccountEvents['emit'](_0x1096cd+':'+_0xf426e0['id'],_0xf426e0);SmsAccountEvents['emit'](_0x1096cd,_0xf426e0);_0x51826d(null);};}for(var e in events){if(events[_0xc5fe('0x7')](e)){var event=events[e];SmsAccount[_0xc5fe('0x8')](e,emitEvent(event));}}module[_0xc5fe('0x9')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 0e60d5c..6c151c7 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 _0x9c5b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','util','../../config/logger','api'];(function(_0x335da6,_0x14f5df){var _0x27382d=function(_0x118d2a){while(--_0x118d2a){_0x335da6['push'](_0x335da6['shift']());}};_0x27382d(++_0x14f5df);}(_0x9c5b,0x1eb));var _0xb9c5=function(_0x5ba5b0,_0x2b35bf){_0x5ba5b0=_0x5ba5b0-0x0;var _0xd540ac=_0x9c5b[_0x5ba5b0];return _0xd540ac;};'use strict';var _=require('lodash');var util=require(_0xb9c5('0x0'));var logger=require(_0xb9c5('0x1'))(_0xb9c5('0x2'));var moment=require(_0xb9c5('0x3'));var BPromise=require(_0xb9c5('0x4'));var rp=require(_0xb9c5('0x5'));var fs=require('fs');var path=require(_0xb9c5('0x6'));var rimraf=require(_0xb9c5('0x7'));var config=require(_0xb9c5('0x8'));var attributes=require(_0xb9c5('0x9'));module[_0xb9c5('0xa')]=function(_0x3e5de6,_0xbd162){return _0x3e5de6[_0xb9c5('0xb')](_0xb9c5('0xc'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18e4=['define','SmsAccount','../../config/logger','api','moment','rimraf','../../config/environment','./smsAccount.attributes','exports'];(function(_0x325af0,_0x10fad6){var _0x3ca843=function(_0x3cfdf1){while(--_0x3cfdf1){_0x325af0['push'](_0x325af0['shift']());}};_0x3ca843(++_0x10fad6);}(_0x18e4,0x110));var _0x418e=function(_0x561195,_0x1f9dec){_0x561195=_0x561195-0x0;var _0x5c87c3=_0x18e4[_0x561195];return _0x5c87c3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x418e('0x0'))(_0x418e('0x1'));var moment=require(_0x418e('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x418e('0x3'));var config=require(_0x418e('0x4'));var attributes=require(_0x418e('0x5'));module[_0x418e('0x6')]=function(_0x4636fe,_0x18aaeb){return _0x4636fe[_0x418e('0x7')](_0x418e('0x8'),attributes,{'tableName':'sms_accounts','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 498c655..e78cdf1 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 _0x55ed=['ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','map','include','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ed,0x1a1));var _0xd55e=function(_0x19237b,_0x262f3f){_0x19237b=_0x19237b-0x0;var _0x141cde=_0x55ed[_0x19237b];return _0x141cde;};'use strict';var _=require(_0xd55e('0x0'));var util=require(_0xd55e('0x1'));var moment=require('moment');var BPromise=require(_0xd55e('0x2'));var rs=require(_0xd55e('0x3'));var fs=require('fs');var Redis=require(_0xd55e('0x4'));var db=require(_0xd55e('0x5'))['db'];var utils=require(_0xd55e('0x6'));var logger=require('../../config/logger')(_0xd55e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd55e('0x8'));var client=jayson[_0xd55e('0x9')][_0xd55e('0xa')]({'port':0x232a});config[_0xd55e('0xb')]=_['defaults'](config['redis'],{'host':_0xd55e('0xc'),'port':0x18eb});var socket=require(_0xd55e('0xd'))(new Redis(config['redis']));require(_0xd55e('0xe'))['register'](socket);function respondWithRpcPromise(_0x55069f,_0x5ab7d9,_0x291289){return new BPromise(function(_0x21a2e2,_0x641ae1){return client['request'](_0x55069f,_0x291289)[_0xd55e('0xf')](function(_0x301ae2){logger[_0xd55e('0x10')](_0xd55e('0x11'),_0x5ab7d9,'request\x20sent');logger[_0xd55e('0x12')](_0xd55e('0x13'),_0x5ab7d9,'request\x20sent',JSON[_0xd55e('0x14')](_0x301ae2));if(_0x301ae2[_0xd55e('0x15')]){if(_0x301ae2[_0xd55e('0x15')][_0xd55e('0x16')]===0x1f4){logger[_0xd55e('0x15')](_0xd55e('0x11'),_0x5ab7d9,_0x301ae2[_0xd55e('0x15')][_0xd55e('0x17')]);return _0x641ae1(_0x301ae2[_0xd55e('0x15')][_0xd55e('0x17')]);}logger[_0xd55e('0x15')](_0xd55e('0x11'),_0x5ab7d9,_0x301ae2[_0xd55e('0x15')]['message']);return _0x21a2e2(_0x301ae2[_0xd55e('0x15')][_0xd55e('0x17')]);}else{logger[_0xd55e('0x10')](_0xd55e('0x11'),_0x5ab7d9,_0xd55e('0x18'));_0x21a2e2(_0x301ae2[_0xd55e('0x19')][_0xd55e('0x17')]);}})[_0xd55e('0x1a')](function(_0x53b2c5){logger[_0xd55e('0x15')]('SmsAccount,\x20%s,\x20%s',_0x5ab7d9,_0x53b2c5);_0x641ae1(_0x53b2c5);});});}exports[_0xd55e('0x1b')]=function(_0x3aa007){var _0x449a71=this;return new Promise(function(_0x15ea65,_0x41c9d2){return db[_0xd55e('0x1c')][_0xd55e('0x1d')]({'raw':_0x3aa007['options']?_0x3aa007['options'][_0xd55e('0x1e')]===undefined?!![]:![]:!![],'where':_0x3aa007[_0xd55e('0x1f')]?_0x3aa007[_0xd55e('0x1f')][_0xd55e('0x20')]||null:null,'attributes':_0x3aa007[_0xd55e('0x1f')]?_0x3aa007[_0xd55e('0x1f')][_0xd55e('0x21')]||null:null,'include':_0x3aa007[_0xd55e('0x1f')]?_0x3aa007[_0xd55e('0x1f')]['include']?_[_0xd55e('0x22')](_0x3aa007[_0xd55e('0x1f')][_0xd55e('0x23')],function(_0x5309f0){return{'model':db[_0x5309f0[_0xd55e('0x24')]],'as':_0x5309f0['as'],'attributes':_0x5309f0['attributes'],'include':_0x5309f0[_0xd55e('0x23')]?_['map'](_0x5309f0[_0xd55e('0x23')],function(_0x46fb96){return{'model':db[_0x46fb96['model']],'as':_0x46fb96['as'],'attributes':_0x46fb96[_0xd55e('0x21')],'include':_0x46fb96[_0xd55e('0x23')]?_[_0xd55e('0x22')](_0x46fb96['include'],function(_0x541c79){return{'model':db[_0x541c79[_0xd55e('0x24')]],'as':_0x541c79['as'],'attributes':_0x541c79['attributes']};}):[]};}):[]};}):[]:[]})[_0xd55e('0xf')](function(_0x516795){logger[_0xd55e('0x10')](_0xd55e('0x1b'),_0x3aa007);logger[_0xd55e('0x12')](_0xd55e('0x1b'),_0x3aa007,JSON[_0xd55e('0x14')](_0x516795));_0x15ea65(_0x516795);})[_0xd55e('0x1a')](function(_0x301221){logger[_0xd55e('0x15')](_0xd55e('0x1b'),_0x301221['message'],_0x3aa007);_0x41c9d2(_0x449a71[_0xd55e('0x15')](0x1f4,_0x301221['message']));});});}; \ No newline at end of file +var _0xb006=['stringify','error','SmsAccount,\x20%s,\x20%s','message','result','catch','options','raw','where','attributes','include','map','model','ShowSmsAccount','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x27b6e3,_0x3445d1){var _0x3b2f1a=function(_0x371b01){while(--_0x371b01){_0x27b6e3['push'](_0x27b6e3['shift']());}};_0x3b2f1a(++_0x3445d1);}(_0xb006,0xd5));var _0x6b00=function(_0x6487e3,_0x3ef5ac){_0x6487e3=_0x6487e3-0x0;var _0x4c1f77=_0xb006[_0x6487e3];return _0x4c1f77;};'use strict';var _=require(_0x6b00('0x0'));var util=require(_0x6b00('0x1'));var moment=require('moment');var BPromise=require(_0x6b00('0x2'));var rs=require(_0x6b00('0x3'));var fs=require('fs');var Redis=require(_0x6b00('0x4'));var db=require(_0x6b00('0x5'))['db'];var utils=require(_0x6b00('0x6'));var logger=require(_0x6b00('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6b00('0x8'));var client=jayson[_0x6b00('0x9')][_0x6b00('0xa')]({'port':0x232a});config['redis']=_[_0x6b00('0xb')](config[_0x6b00('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x20a2fb,_0x518dc0,_0x289709){return new BPromise(function(_0x13f463,_0x24f304){return client[_0x6b00('0xd')](_0x20a2fb,_0x289709)[_0x6b00('0xe')](function(_0x3acd26){logger[_0x6b00('0xf')]('SmsAccount,\x20%s,\x20%s',_0x518dc0,_0x6b00('0x10'));logger['debug'](_0x6b00('0x11'),_0x518dc0,_0x6b00('0x10'),JSON[_0x6b00('0x12')](_0x3acd26));if(_0x3acd26[_0x6b00('0x13')]){if(_0x3acd26['error']['code']===0x1f4){logger[_0x6b00('0x13')](_0x6b00('0x14'),_0x518dc0,_0x3acd26[_0x6b00('0x13')]['message']);return _0x24f304(_0x3acd26[_0x6b00('0x13')][_0x6b00('0x15')]);}logger['error'](_0x6b00('0x14'),_0x518dc0,_0x3acd26[_0x6b00('0x13')][_0x6b00('0x15')]);return _0x13f463(_0x3acd26[_0x6b00('0x13')][_0x6b00('0x15')]);}else{logger[_0x6b00('0xf')](_0x6b00('0x14'),_0x518dc0,_0x6b00('0x10'));_0x13f463(_0x3acd26[_0x6b00('0x16')][_0x6b00('0x15')]);}})[_0x6b00('0x17')](function(_0x537fbc){logger[_0x6b00('0x13')](_0x6b00('0x14'),_0x518dc0,_0x537fbc);_0x24f304(_0x537fbc);});});}exports['ShowSmsAccount']=function(_0x2f054c){var _0x4c226=this;return new Promise(function(_0x59753d,_0x25ad2e){return db['SmsAccount']['find']({'raw':_0x2f054c[_0x6b00('0x18')]?_0x2f054c['options'][_0x6b00('0x19')]===undefined?!![]:![]:!![],'where':_0x2f054c['options']?_0x2f054c[_0x6b00('0x18')][_0x6b00('0x1a')]||null:null,'attributes':_0x2f054c[_0x6b00('0x18')]?_0x2f054c[_0x6b00('0x18')][_0x6b00('0x1b')]||null:null,'include':_0x2f054c[_0x6b00('0x18')]?_0x2f054c[_0x6b00('0x18')][_0x6b00('0x1c')]?_[_0x6b00('0x1d')](_0x2f054c['options'][_0x6b00('0x1c')],function(_0x264c84){return{'model':db[_0x264c84[_0x6b00('0x1e')]],'as':_0x264c84['as'],'attributes':_0x264c84[_0x6b00('0x1b')],'include':_0x264c84[_0x6b00('0x1c')]?_[_0x6b00('0x1d')](_0x264c84['include'],function(_0xa82d0b){return{'model':db[_0xa82d0b['model']],'as':_0xa82d0b['as'],'attributes':_0xa82d0b[_0x6b00('0x1b')],'include':_0xa82d0b[_0x6b00('0x1c')]?_['map'](_0xa82d0b[_0x6b00('0x1c')],function(_0x3be234){return{'model':db[_0x3be234[_0x6b00('0x1e')]],'as':_0x3be234['as'],'attributes':_0x3be234[_0x6b00('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6b00('0xe')](function(_0x5abd4e){logger[_0x6b00('0xf')](_0x6b00('0x1f'),_0x2f054c);logger[_0x6b00('0x20')]('ShowSmsAccount',_0x2f054c,JSON[_0x6b00('0x12')](_0x5abd4e));_0x59753d(_0x5abd4e);})[_0x6b00('0x17')](function(_0x220cec){logger[_0x6b00('0x13')](_0x6b00('0x1f'),_0x220cec[_0x6b00('0x15')],_0x2f054c);_0x25ad2e(_0x4c226[_0x6b00('0x13')](0x1f4,_0x220cec[_0x6b00('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 0d55003..e1c388e 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 _0xfb75=['smsAccount:','save','remove','removeListener','length'];(function(_0x2eaffb,_0x44edcf){var _0x390b63=function(_0x162457){while(--_0x162457){_0x2eaffb['push'](_0x2eaffb['shift']());}};_0x390b63(++_0x44edcf);}(_0xfb75,0x1cd));var _0x5fb7=function(_0x98bb84,_0x3e8864){_0x98bb84=_0x98bb84-0x0;var _0xdbd0d2=_0xfb75[_0x98bb84];return _0xdbd0d2;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x5fb7('0x0'),_0x5fb7('0x1'),'update'];function createListener(_0x395c72,_0xfcaf91){return function(_0x346099){_0xfcaf91['emit'](_0x395c72,_0x346099);};}function removeListener(_0x11b6c7,_0x575885){return function(){SmsAccountEvents[_0x5fb7('0x2')](_0x11b6c7,_0x575885);};}exports['register']=function(_0x4c46be){for(var _0x3b992b=0x0,_0x49ab59=events[_0x5fb7('0x3')];_0x3b992b<_0x49ab59;_0x3b992b++){var _0xc10aa1=events[_0x3b992b];var _0x4cc05c=createListener(_0x5fb7('0x4')+_0xc10aa1,_0x4c46be);SmsAccountEvents['on'](_0xc10aa1,_0x4cc05c);}}; \ No newline at end of file +var _0x5c38=['length','smsAccount:','save','update','emit','removeListener'];(function(_0x3f28a3,_0x339440){var _0x357aa8=function(_0x1fc984){while(--_0x1fc984){_0x3f28a3['push'](_0x3f28a3['shift']());}};_0x357aa8(++_0x339440);}(_0x5c38,0xe0));var _0x85c3=function(_0x389e5f,_0x1b4511){_0x389e5f=_0x389e5f-0x0;var _0x3aa068=_0x5c38[_0x389e5f];return _0x3aa068;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x85c3('0x0'),'remove',_0x85c3('0x1')];function createListener(_0x9d3d10,_0x533ae4){return function(_0x130a36){_0x533ae4[_0x85c3('0x2')](_0x9d3d10,_0x130a36);};}function removeListener(_0x469209,_0x36be42){return function(){SmsAccountEvents[_0x85c3('0x3')](_0x469209,_0x36be42);};}exports['register']=function(_0x15667e){for(var _0x41a6c7=0x0,_0x57f824=events[_0x85c3('0x4')];_0x41a6c7<_0x57f824;_0x41a6c7++){var _0x142421=events[_0x41a6c7];var _0xaf804c=createListener(_0x85c3('0x5')+_0x142421,_0x15667e);SmsAccountEvents['on'](_0x142421,_0xaf804c);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 97ea5b5..1bf3e11 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 _0x536c=['isAuthenticated','index','/:id','post','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','get'];(function(_0x3fd62f,_0x1aeaeb){var _0x25d507=function(_0x4f63bd){while(--_0x4f63bd){_0x3fd62f['push'](_0x3fd62f['shift']());}};_0x25d507(++_0x1aeaeb);}(_0x536c,0xf5));var _0xc536=function(_0x14bbdc,_0x49b365){_0x14bbdc=_0x14bbdc-0x0;var _0x5eac57=_0x536c[_0x14bbdc];return _0x5eac57;};'use strict';var multer=require(_0xc536('0x0'));var util=require(_0xc536('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc536('0x2')]();var auth=require(_0xc536('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc536('0x4'));var controller=require(_0xc536('0x5'));router[_0xc536('0x6')]('/',auth[_0xc536('0x7')](),controller[_0xc536('0x8')]);router[_0xc536('0x6')](_0xc536('0x9'),auth[_0xc536('0x7')](),controller['show']);router[_0xc536('0xa')]('/',auth[_0xc536('0x7')](),controller['create']);router['put'](_0xc536('0x9'),auth[_0xc536('0x7')](),controller['update']);router[_0xc536('0xb')]('/:id',auth[_0xc536('0x7')](),controller[_0xc536('0xc')]);module[_0xc536('0xd')]=router; \ No newline at end of file +var _0x2bf7=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','./smsApplication.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy','exports'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0x2bf7,0x6c));var _0x72bf=function(_0x5b1bae,_0x475f56){_0x5b1bae=_0x5b1bae-0x0;var _0x8c25ef=_0x2bf7[_0x5b1bae];return _0x8c25ef;};'use strict';var multer=require(_0x72bf('0x0'));var util=require(_0x72bf('0x1'));var path=require(_0x72bf('0x2'));var timeout=require(_0x72bf('0x3'));var express=require(_0x72bf('0x4'));var router=express[_0x72bf('0x5')]();var auth=require(_0x72bf('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x72bf('0x7'));router[_0x72bf('0x8')]('/',auth[_0x72bf('0x9')](),controller[_0x72bf('0xa')]);router[_0x72bf('0x8')](_0x72bf('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x72bf('0x9')](),controller[_0x72bf('0xc')]);router[_0x72bf('0xd')]('/:id',auth[_0x72bf('0x9')](),controller[_0x72bf('0xe')]);router[_0x72bf('0xf')](_0x72bf('0xb'),auth[_0x72bf('0x9')](),controller[_0x72bf('0x10')]);module[_0x72bf('0x11')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 04dcb79..5815186 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 _0x412e=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x412e,0x19e));var _0xe412=function(_0x10b8bb,_0x569099){_0x10b8bb=_0x10b8bb-0x0;var _0x3d204b=_0x412e[_0x10b8bb];return _0x3d204b;};'use strict';var Sequelize=require(_0xe412('0x0'));module[_0xe412('0x1')]={'priority':{'type':Sequelize[_0xe412('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe412('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe412('0x4')]()},'description':{'type':Sequelize[_0xe412('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x2913=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x44de23,_0x2833ed){var _0x58b4e2=function(_0x4e9edc){while(--_0x4e9edc){_0x44de23['push'](_0x44de23['shift']());}};_0x58b4e2(++_0x2833ed);}(_0x2913,0x13f));var _0x3291=function(_0x4224cd,_0x10eebb){_0x4224cd=_0x4224cd-0x0;var _0x5e3971=_0x2913[_0x4224cd];return _0x5e3971;};'use strict';var Sequelize=require('sequelize');module[_0x3291('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3291('0x1')],'allowNull':![],'defaultValue':_0x3291('0x2')},'appdata':{'type':Sequelize[_0x3291('0x3')]()},'description':{'type':Sequelize[_0x3291('0x1')]},'interval':{'type':Sequelize[_0x3291('0x1')],'defaultValue':_0x3291('0x4')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index e2df2c6..1b7fe3f 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 _0x82a2=['where','filters','filter','VIRTUAL','merge','options','findAll','rows','show','rawAttributes','length','includeAll','include','find','catch','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsApplication','fieldName','type','key','query','keys','intersection','model','attributes','fields','limit','order','sort'];(function(_0x42584f,_0x2f20b4){var _0x95c318=function(_0x81b733){while(--_0x81b733){_0x42584f['push'](_0x42584f['shift']());}};_0x95c318(++_0x2f20b4);}(_0x82a2,0x17a));var _0x282a=function(_0x10d6f6,_0x412ee8){_0x10d6f6=_0x10d6f6-0x0;var _0x1990a8=_0x82a2[_0x10d6f6];return _0x1990a8;};'use strict';var pdf=require(_0x282a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x282a('0x1'));var zipdir=require(_0x282a('0x2'));var jsonpatch=require(_0x282a('0x3'));var rp=require(_0x282a('0x4'));var moment=require(_0x282a('0x5'));var BPromise=require(_0x282a('0x6'));var Mustache=require(_0x282a('0x7'));var util=require(_0x282a('0x8'));var path=require(_0x282a('0x9'));var sox=require('sox');var csv=require(_0x282a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x282a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x282a('0xc'));var deskjs=require(_0x282a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x282a('0xe'));var Papa=require(_0x282a('0xf'));var Redis=require('ioredis');var authService=require(_0x282a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x282a('0x11'));var hardwareService=require(_0x282a('0x12'));var logger=require(_0x282a('0x13'))(_0x282a('0x14'));var utils=require(_0x282a('0x15'));var config=require(_0x282a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68be07,_0x4bb787){_0x4bb787=_0x4bb787||0xcc;return function(_0x46f56b){if(_0x46f56b){return _0x68be07[_0x282a('0x17')](_0x4bb787);}return _0x68be07[_0x282a('0x18')](_0x4bb787)[_0x282a('0x19')]();};}function respondWithResult(_0x2cfaf4,_0x2c18bd){_0x2c18bd=_0x2c18bd||0xc8;return function(_0x11eda4){if(_0x11eda4){return _0x2cfaf4[_0x282a('0x18')](_0x2c18bd)[_0x282a('0x1a')](_0x11eda4);}};}function respondWithFilteredResult(_0x4b11a6,_0xcca204){return function(_0x545fdb){if(_0x545fdb){var _0x13d36e=_0x545fdb[_0x282a('0x1b')],_0x566f3b=_0xcca204[_0x282a('0x1c')],_0x1ac92d=_0xcca204[_0x282a('0x1c')]+_0xcca204['limit'],_0x28295e;if(_0x1ac92d>=_0x13d36e){_0x1ac92d=_0x13d36e;_0x28295e=0xc8;}else{_0x28295e=0xce;}_0x4b11a6[_0x282a('0x18')](_0x28295e);return _0x4b11a6['set'](_0x282a('0x1d'),_0x566f3b+'-'+_0x1ac92d+'/'+_0x13d36e)[_0x282a('0x1a')](_0x545fdb);}return null;};}function patchUpdates(_0x41ce61){return function(_0x20f834){try{jsonpatch[_0x282a('0x1e')](_0x20f834,_0x41ce61,!![]);}catch(_0x367ab3){return BPromise[_0x282a('0x1f')](_0x367ab3);}return _0x20f834[_0x282a('0x20')]();};}function saveUpdates(_0x5ef563,_0x9edc47){return function(_0x1313b5){if(_0x1313b5){return _0x1313b5[_0x282a('0x21')](_0x5ef563)[_0x282a('0x22')](function(_0x3ff422){return _0x3ff422;});}return null;};}function removeEntity(_0x11608c,_0x101578){return function(_0x405f03){if(_0x405f03){return _0x405f03[_0x282a('0x23')]()[_0x282a('0x22')](function(){_0x11608c[_0x282a('0x18')](0xcc)[_0x282a('0x19')]();});}};}function handleEntityNotFound(_0x7b7e4f,_0x4ffb0f){return function(_0x1f273c){if(!_0x1f273c){_0x7b7e4f[_0x282a('0x17')](0x194);}return _0x1f273c;};}function handleError(_0x2fbef9,_0x231897){_0x231897=_0x231897||0x1f4;return function(_0x35adad){logger['error'](_0x35adad[_0x282a('0x24')]);if(_0x35adad[_0x282a('0x25')]){delete _0x35adad[_0x282a('0x25')];}_0x2fbef9['status'](_0x231897)[_0x282a('0x26')](_0x35adad);};}exports[_0x282a('0x27')]=function(_0x33e66e,_0x49ac7f){var _0x14212e={},_0x5af65c={},_0x4280b8={'count':0x0,'rows':[]};var _0x91250b=_[_0x282a('0x28')](db[_0x282a('0x29')]['rawAttributes'],function(_0x19928a){return{'name':_0x19928a[_0x282a('0x2a')],'type':_0x19928a[_0x282a('0x2b')][_0x282a('0x2c')]};});_0x5af65c['model']=_[_0x282a('0x28')](_0x91250b,'name');_0x5af65c[_0x282a('0x2d')]=_[_0x282a('0x2e')](_0x33e66e[_0x282a('0x2d')]);_0x5af65c['filters']=_[_0x282a('0x2f')](_0x5af65c[_0x282a('0x30')],_0x5af65c[_0x282a('0x2d')]);_0x14212e[_0x282a('0x31')]=_[_0x282a('0x2f')](_0x5af65c[_0x282a('0x30')],qs['fields'](_0x33e66e[_0x282a('0x2d')][_0x282a('0x32')]));_0x14212e[_0x282a('0x31')]=_0x14212e[_0x282a('0x31')]['length']?_0x14212e[_0x282a('0x31')]:_0x5af65c[_0x282a('0x30')];if(!_0x33e66e[_0x282a('0x2d')]['hasOwnProperty']('nolimit')){_0x14212e[_0x282a('0x33')]=qs[_0x282a('0x33')](_0x33e66e[_0x282a('0x2d')][_0x282a('0x33')]);_0x14212e[_0x282a('0x1c')]=qs[_0x282a('0x1c')](_0x33e66e['query'][_0x282a('0x1c')]);}_0x14212e[_0x282a('0x34')]=qs[_0x282a('0x35')](_0x33e66e[_0x282a('0x2d')][_0x282a('0x35')]);_0x14212e[_0x282a('0x36')]=qs[_0x282a('0x37')](_['pick'](_0x33e66e[_0x282a('0x2d')],_0x5af65c[_0x282a('0x37')]));if(_0x33e66e[_0x282a('0x2d')][_0x282a('0x38')]){_0x14212e[_0x282a('0x36')]=_['merge'](_0x14212e['where'],{'$or':_['map'](_0x91250b,function(_0x346772){if(_0x346772['type']!==_0x282a('0x39')){var _0x619ef9={};_0x619ef9[_0x346772[_0x282a('0x25')]]={'$like':'%'+_0x33e66e[_0x282a('0x2d')]['filter']+'%'};return _0x619ef9;}})});}_0x14212e=_[_0x282a('0x3a')]({},_0x14212e,_0x33e66e[_0x282a('0x3b')]);var _0x40b1e6={'where':_0x14212e[_0x282a('0x36')]};return db['SmsApplication'][_0x282a('0x1b')](_0x40b1e6)['then'](function(_0x2abef5){_0x4280b8['count']=_0x2abef5;if(_0x33e66e[_0x282a('0x2d')]['includeAll']){_0x14212e['include']=[{'all':!![]}];}return db[_0x282a('0x29')][_0x282a('0x3c')](_0x14212e);})[_0x282a('0x22')](function(_0x237b51){_0x4280b8[_0x282a('0x3d')]=_0x237b51;return _0x4280b8;})[_0x282a('0x22')](respondWithFilteredResult(_0x49ac7f,_0x14212e))['catch'](handleError(_0x49ac7f,null));};exports[_0x282a('0x3e')]=function(_0x5175ea,_0x15699a){var _0xd3f577={'raw':!![],'where':{'id':_0x5175ea['params']['id']}},_0x9cfba6={};_0x9cfba6[_0x282a('0x30')]=_[_0x282a('0x2e')](db[_0x282a('0x29')][_0x282a('0x3f')]);_0x9cfba6[_0x282a('0x2d')]=_[_0x282a('0x2e')](_0x5175ea['query']);_0x9cfba6[_0x282a('0x37')]=_[_0x282a('0x2f')](_0x9cfba6['model'],_0x9cfba6['query']);_0xd3f577[_0x282a('0x31')]=_[_0x282a('0x2f')](_0x9cfba6[_0x282a('0x30')],qs[_0x282a('0x32')](_0x5175ea[_0x282a('0x2d')][_0x282a('0x32')]));_0xd3f577['attributes']=_0xd3f577['attributes'][_0x282a('0x40')]?_0xd3f577[_0x282a('0x31')]:_0x9cfba6[_0x282a('0x30')];if(_0x5175ea[_0x282a('0x2d')][_0x282a('0x41')]){_0xd3f577[_0x282a('0x42')]=[{'all':!![]}];}_0xd3f577=_[_0x282a('0x3a')]({},_0xd3f577,_0x5175ea[_0x282a('0x3b')]);return db[_0x282a('0x29')][_0x282a('0x43')](_0xd3f577)[_0x282a('0x22')](handleEntityNotFound(_0x15699a,null))[_0x282a('0x22')](respondWithResult(_0x15699a,null))[_0x282a('0x44')](handleError(_0x15699a,null));};exports[_0x282a('0x45')]=function(_0x4a0709,_0x3c6918){return db[_0x282a('0x29')][_0x282a('0x45')](_0x4a0709[_0x282a('0x46')],{})[_0x282a('0x22')](respondWithResult(_0x3c6918,0xc9))[_0x282a('0x44')](handleError(_0x3c6918,null));};exports[_0x282a('0x21')]=function(_0x260f87,_0x9b5f58){if(_0x260f87[_0x282a('0x46')]['id']){delete _0x260f87[_0x282a('0x46')]['id'];}return db['SmsApplication'][_0x282a('0x43')]({'where':{'id':_0x260f87[_0x282a('0x47')]['id']}})[_0x282a('0x22')](handleEntityNotFound(_0x9b5f58,null))[_0x282a('0x22')](saveUpdates(_0x260f87[_0x282a('0x46')],null))[_0x282a('0x22')](respondWithResult(_0x9b5f58,null))['catch'](handleError(_0x9b5f58,null));};exports[_0x282a('0x23')]=function(_0x2d1006,_0x1b940f){return db[_0x282a('0x29')]['find']({'where':{'id':_0x2d1006[_0x282a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b940f,null))[_0x282a('0x22')](removeEntity(_0x1b940f,null))[_0x282a('0x44')](handleError(_0x1b940f,null));}; \ No newline at end of file +var _0x0321=['show','params','keys','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','limit','where','filter','merge','VIRTUAL','options','SmsApplication','count','includeAll','findAll','catch'];(function(_0x48d776,_0xb7dfa1){var _0x4973d7=function(_0xf08a7a){while(--_0xf08a7a){_0x48d776['push'](_0x48d776['shift']());}};_0x4973d7(++_0xb7dfa1);}(_0x0321,0x1f1));var _0x1032=function(_0x1159b6,_0x42650a){_0x1159b6=_0x1159b6-0x0;var _0x141b4b=_0x0321[_0x1159b6];return _0x141b4b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1032('0x0'));var rimraf=require(_0x1032('0x1'));var zipdir=require(_0x1032('0x2'));var jsonpatch=require(_0x1032('0x3'));var rp=require(_0x1032('0x4'));var moment=require(_0x1032('0x5'));var BPromise=require(_0x1032('0x6'));var Mustache=require('mustache');var util=require(_0x1032('0x7'));var path=require(_0x1032('0x8'));var sox=require(_0x1032('0x9'));var csv=require(_0x1032('0xa'));var ejs=require(_0x1032('0xb'));var fs=require('fs');var _=require(_0x1032('0xc'));var squel=require(_0x1032('0xd'));var crypto=require(_0x1032('0xe'));var jsforce=require(_0x1032('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1032('0xa'));var querystring=require(_0x1032('0x10'));var Papa=require(_0x1032('0x11'));var Redis=require('ioredis');var authService=require(_0x1032('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1032('0x13'));var hardwareService=require(_0x1032('0x14'));var logger=require('../../config/logger')(_0x1032('0x15'));var utils=require(_0x1032('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2755a2,_0x50e379){_0x50e379=_0x50e379||0xcc;return function(_0x141354){if(_0x141354){return _0x2755a2[_0x1032('0x17')](_0x50e379);}return _0x2755a2[_0x1032('0x18')](_0x50e379)[_0x1032('0x19')]();};}function respondWithResult(_0x5d8e63,_0x1c2b07){_0x1c2b07=_0x1c2b07||0xc8;return function(_0x473958){if(_0x473958){return _0x5d8e63[_0x1032('0x18')](_0x1c2b07)[_0x1032('0x1a')](_0x473958);}};}function respondWithFilteredResult(_0x13ff3a,_0x1bb0fb){return function(_0x4ffddb){if(_0x4ffddb){var _0x5d48b7=_0x4ffddb['count'],_0x3a5a92=_0x1bb0fb['offset'],_0x1356b7=_0x1bb0fb[_0x1032('0x1b')]+_0x1bb0fb['limit'],_0x3e0df1;if(_0x1356b7>=_0x5d48b7){_0x1356b7=_0x5d48b7;_0x3e0df1=0xc8;}else{_0x3e0df1=0xce;}_0x13ff3a['status'](_0x3e0df1);return _0x13ff3a['set'](_0x1032('0x1c'),_0x3a5a92+'-'+_0x1356b7+'/'+_0x5d48b7)['json'](_0x4ffddb);}return null;};}function patchUpdates(_0x5b68ea){return function(_0x30bad){try{jsonpatch[_0x1032('0x1d')](_0x30bad,_0x5b68ea,!![]);}catch(_0x108908){return BPromise[_0x1032('0x1e')](_0x108908);}return _0x30bad[_0x1032('0x1f')]();};}function saveUpdates(_0x423399,_0x5196f5){return function(_0x646d27){if(_0x646d27){return _0x646d27[_0x1032('0x20')](_0x423399)[_0x1032('0x21')](function(_0x53ce00){return _0x53ce00;});}return null;};}function removeEntity(_0x432fd4,_0x2734e2){return function(_0x4dd275){if(_0x4dd275){return _0x4dd275[_0x1032('0x22')]()['then'](function(){_0x432fd4[_0x1032('0x18')](0xcc)[_0x1032('0x19')]();});}};}function handleEntityNotFound(_0xb30914,_0x43bba5){return function(_0xba64c6){if(!_0xba64c6){_0xb30914['sendStatus'](0x194);}return _0xba64c6;};}function handleError(_0x2b98d9,_0x31e95f){_0x31e95f=_0x31e95f||0x1f4;return function(_0x2dac1c){logger[_0x1032('0x23')](_0x2dac1c[_0x1032('0x24')]);if(_0x2dac1c[_0x1032('0x25')]){delete _0x2dac1c[_0x1032('0x25')];}_0x2b98d9[_0x1032('0x18')](_0x31e95f)[_0x1032('0x26')](_0x2dac1c);};}exports[_0x1032('0x27')]=function(_0x1d51e1,_0x1c1501){var _0x3ef9b4={},_0x403132={},_0x5a98e9={'count':0x0,'rows':[]};var _0x388338=_[_0x1032('0x28')](db['SmsApplication'][_0x1032('0x29')],function(_0x192850){return{'name':_0x192850[_0x1032('0x2a')],'type':_0x192850[_0x1032('0x2b')][_0x1032('0x2c')]};});_0x403132[_0x1032('0x2d')]=_[_0x1032('0x28')](_0x388338,_0x1032('0x25'));_0x403132[_0x1032('0x2e')]=_['keys'](_0x1d51e1[_0x1032('0x2e')]);_0x403132[_0x1032('0x2f')]=_[_0x1032('0x30')](_0x403132[_0x1032('0x2d')],_0x403132['query']);_0x3ef9b4[_0x1032('0x31')]=_[_0x1032('0x30')](_0x403132[_0x1032('0x2d')],qs[_0x1032('0x32')](_0x1d51e1[_0x1032('0x2e')][_0x1032('0x32')]));_0x3ef9b4[_0x1032('0x31')]=_0x3ef9b4['attributes'][_0x1032('0x33')]?_0x3ef9b4[_0x1032('0x31')]:_0x403132[_0x1032('0x2d')];if(!_0x1d51e1[_0x1032('0x2e')]['hasOwnProperty']('nolimit')){_0x3ef9b4['limit']=qs[_0x1032('0x34')](_0x1d51e1[_0x1032('0x2e')]['limit']);_0x3ef9b4['offset']=qs[_0x1032('0x1b')](_0x1d51e1['query']['offset']);}_0x3ef9b4['order']=qs['sort'](_0x1d51e1[_0x1032('0x2e')]['sort']);_0x3ef9b4[_0x1032('0x35')]=qs['filters'](_['pick'](_0x1d51e1['query'],_0x403132[_0x1032('0x2f')]));if(_0x1d51e1[_0x1032('0x2e')][_0x1032('0x36')]){_0x3ef9b4[_0x1032('0x35')]=_[_0x1032('0x37')](_0x3ef9b4[_0x1032('0x35')],{'$or':_[_0x1032('0x28')](_0x388338,function(_0x41a816){if(_0x41a816['type']!==_0x1032('0x38')){var _0x233875={};_0x233875[_0x41a816['name']]={'$like':'%'+_0x1d51e1['query'][_0x1032('0x36')]+'%'};return _0x233875;}})});}_0x3ef9b4=_[_0x1032('0x37')]({},_0x3ef9b4,_0x1d51e1[_0x1032('0x39')]);var _0x2db650={'where':_0x3ef9b4[_0x1032('0x35')]};return db[_0x1032('0x3a')]['count'](_0x2db650)[_0x1032('0x21')](function(_0x1fa19a){_0x5a98e9[_0x1032('0x3b')]=_0x1fa19a;if(_0x1d51e1[_0x1032('0x2e')][_0x1032('0x3c')]){_0x3ef9b4['include']=[{'all':!![]}];}return db[_0x1032('0x3a')][_0x1032('0x3d')](_0x3ef9b4);})[_0x1032('0x21')](function(_0x4a69c2){_0x5a98e9['rows']=_0x4a69c2;return _0x5a98e9;})[_0x1032('0x21')](respondWithFilteredResult(_0x1c1501,_0x3ef9b4))[_0x1032('0x3e')](handleError(_0x1c1501,null));};exports[_0x1032('0x3f')]=function(_0x1e436d,_0x1426c5){var _0x4cbde3={'raw':!![],'where':{'id':_0x1e436d[_0x1032('0x40')]['id']}},_0x2c8d34={};_0x2c8d34[_0x1032('0x2d')]=_[_0x1032('0x41')](db[_0x1032('0x3a')][_0x1032('0x29')]);_0x2c8d34[_0x1032('0x2e')]=_['keys'](_0x1e436d['query']);_0x2c8d34[_0x1032('0x2f')]=_['intersection'](_0x2c8d34[_0x1032('0x2d')],_0x2c8d34[_0x1032('0x2e')]);_0x4cbde3['attributes']=_[_0x1032('0x30')](_0x2c8d34[_0x1032('0x2d')],qs['fields'](_0x1e436d['query'][_0x1032('0x32')]));_0x4cbde3[_0x1032('0x31')]=_0x4cbde3[_0x1032('0x31')][_0x1032('0x33')]?_0x4cbde3['attributes']:_0x2c8d34[_0x1032('0x2d')];if(_0x1e436d['query']['includeAll']){_0x4cbde3[_0x1032('0x42')]=[{'all':!![]}];}_0x4cbde3=_[_0x1032('0x37')]({},_0x4cbde3,_0x1e436d[_0x1032('0x39')]);return db[_0x1032('0x3a')][_0x1032('0x43')](_0x4cbde3)[_0x1032('0x21')](handleEntityNotFound(_0x1426c5,null))['then'](respondWithResult(_0x1426c5,null))[_0x1032('0x3e')](handleError(_0x1426c5,null));};exports['create']=function(_0x538841,_0x1f7ad3){return db[_0x1032('0x3a')][_0x1032('0x44')](_0x538841[_0x1032('0x45')],{})[_0x1032('0x21')](respondWithResult(_0x1f7ad3,0xc9))['catch'](handleError(_0x1f7ad3,null));};exports[_0x1032('0x20')]=function(_0x21e4ed,_0x335e9c){if(_0x21e4ed[_0x1032('0x45')]['id']){delete _0x21e4ed[_0x1032('0x45')]['id'];}return db[_0x1032('0x3a')][_0x1032('0x43')]({'where':{'id':_0x21e4ed['params']['id']}})[_0x1032('0x21')](handleEntityNotFound(_0x335e9c,null))[_0x1032('0x21')](saveUpdates(_0x21e4ed[_0x1032('0x45')],null))[_0x1032('0x21')](respondWithResult(_0x335e9c,null))[_0x1032('0x3e')](handleError(_0x335e9c,null));};exports[_0x1032('0x22')]=function(_0x1874a7,_0x5d50af){return db['SmsApplication'][_0x1032('0x43')]({'where':{'id':_0x1874a7[_0x1032('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d50af,null))[_0x1032('0x21')](removeEntity(_0x5d50af,null))['catch'](handleError(_0x5d50af,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 6e5777c..de15787 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 _0x0f9e=['utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0xcc6303,_0x16009e){var _0x296680=function(_0x61d223){while(--_0x61d223){_0xcc6303['push'](_0xcc6303['shift']());}};_0x296680(++_0x16009e);}(_0x0f9e,0x6d));var _0xe0f9=function(_0x317185,_0x4b2b22){_0x317185=_0x317185-0x0;var _0x198de4=_0x0f9e[_0x317185];return _0x198de4;};'use strict';var _=require(_0xe0f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe0f9('0x1'));var moment=require(_0xe0f9('0x2'));var BPromise=require('bluebird');var rp=require(_0xe0f9('0x3'));var fs=require('fs');var path=require(_0xe0f9('0x4'));var rimraf=require('rimraf');var config=require(_0xe0f9('0x5'));var attributes=require(_0xe0f9('0x6'));module[_0xe0f9('0x7')]=function(_0x506990,_0x532820){return _0x506990[_0xe0f9('0x8')](_0xe0f9('0x9'),attributes,{'tableName':_0xe0f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe0f9('0xb')});}; \ No newline at end of file +var _0x55bf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x3195d1,_0x486141){var _0x1e7b2f=function(_0x1aced4){while(--_0x1aced4){_0x3195d1['push'](_0x3195d1['shift']());}};_0x1e7b2f(++_0x486141);}(_0x55bf,0x107));var _0xf55b=function(_0x10feb2,_0x535794){_0x10feb2=_0x10feb2-0x0;var _0x2e13a5=_0x55bf[_0x10feb2];return _0x2e13a5;};'use strict';var _=require(_0xf55b('0x0'));var util=require(_0xf55b('0x1'));var logger=require(_0xf55b('0x2'))('api');var moment=require(_0xf55b('0x3'));var BPromise=require(_0xf55b('0x4'));var rp=require(_0xf55b('0x5'));var fs=require('fs');var path=require(_0xf55b('0x6'));var rimraf=require(_0xf55b('0x7'));var config=require(_0xf55b('0x8'));var attributes=require(_0xf55b('0x9'));module['exports']=function(_0xdf1556,_0x2c118e){return _0xdf1556[_0xf55b('0xa')](_0xf55b('0xb'),attributes,{'tableName':_0xf55b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf55b('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index c8ac030..9ba8476 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 _0xa41a=['rpc','../../config/environment','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x280d66,_0x19dac9){var _0x26de45=function(_0x4cfa09){while(--_0x4cfa09){_0x280d66['push'](_0x280d66['shift']());}};_0x26de45(++_0x19dac9);}(_0xa41a,0x6b));var _0xaa41=function(_0x23c0b5,_0x4e4463){_0x23c0b5=_0x23c0b5-0x0;var _0xdd4e7e=_0xa41a[_0x23c0b5];return _0xdd4e7e;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0xf725=['http','then','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x1e9acf,_0x303f7c){var _0x70e0fc=function(_0x336f43){while(--_0x336f43){_0x1e9acf['push'](_0x1e9acf['shift']());}};_0x70e0fc(++_0x303f7c);}(_0xf725,0x7e));var _0x5f72=function(_0xd89f3c,_0x3992c7){_0xd89f3c=_0xd89f3c-0x0;var _0xf0dea2=_0xf725[_0xd89f3c];return _0xf0dea2;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require(_0x5f72('0x7'));var logger=require(_0x5f72('0x8'))(_0x5f72('0x9'));var config=require('../../config/environment');var jayson=require(_0x5f72('0xa'));var client=jayson[_0x5f72('0xb')][_0x5f72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193393,_0x148af8,_0x4961d1){return new BPromise(function(_0x158aa3,_0x523365){return client['request'](_0x193393,_0x4961d1)[_0x5f72('0xd')](function(_0x3f189d){logger['info'](_0x5f72('0xe'),_0x148af8,_0x5f72('0xf'));logger['debug'](_0x5f72('0x10'),_0x148af8,_0x5f72('0xf'),JSON[_0x5f72('0x11')](_0x3f189d));if(_0x3f189d[_0x5f72('0x12')]){if(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x13')]===0x1f4){logger[_0x5f72('0x12')]('SmsApplication,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);return _0x523365(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);}logger[_0x5f72('0x12')]('SmsApplication,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')]['message']);return _0x158aa3(_0x3f189d['error'][_0x5f72('0x14')]);}else{logger['info'](_0x5f72('0xe'),_0x148af8,'request\x20sent');_0x158aa3(_0x3f189d[_0x5f72('0x15')]['message']);}})[_0x5f72('0x16')](function(_0x2c7ac6){logger['error'](_0x5f72('0xe'),_0x148af8,_0x2c7ac6);_0x523365(_0x2c7ac6);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 996b70d..52b3e8c 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 _0x5abf=['/:id','getMessages','/:id/download','download','post','/:id/messages','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2fac17,_0x54bf13){var _0x2c4a41=function(_0x395a10){while(--_0x395a10){_0x2fac17['push'](_0x2fac17['shift']());}};_0x2c4a41(++_0x54bf13);}(_0x5abf,0x72));var _0xf5ab=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x5abf[_0x2e1907];return _0x401555;};'use strict';var multer=require(_0xf5ab('0x0'));var util=require(_0xf5ab('0x1'));var path=require(_0xf5ab('0x2'));var timeout=require(_0xf5ab('0x3'));var express=require(_0xf5ab('0x4'));var router=express[_0xf5ab('0x5')]();var auth=require(_0xf5ab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf5ab('0x7'));var controller=require(_0xf5ab('0x8'));router[_0xf5ab('0x9')]('/',auth[_0xf5ab('0xa')](),controller[_0xf5ab('0xb')]);router['get'](_0xf5ab('0xc'),auth[_0xf5ab('0xa')](),controller[_0xf5ab('0xd')]);router['get'](_0xf5ab('0xe'),auth[_0xf5ab('0xa')](),controller['show']);router[_0xf5ab('0x9')]('/:id/messages',auth[_0xf5ab('0xa')](),controller[_0xf5ab('0xf')]);router[_0xf5ab('0x9')](_0xf5ab('0x10'),auth[_0xf5ab('0xa')](),controller[_0xf5ab('0x11')]);router[_0xf5ab('0x12')]('/',auth[_0xf5ab('0xa')](),controller['create']);router['post'](_0xf5ab('0x13'),auth[_0xf5ab('0xa')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xf5ab('0xa')](),interaction[_0xf5ab('0x14')](_0xf5ab('0x15'),_0xf5ab('0x16')),controller[_0xf5ab('0x17')]);router['put'](_0xf5ab('0xe'),auth[_0xf5ab('0xa')](),interaction['tracked'](_0xf5ab('0x15'),_0xf5ab('0x18')),controller[_0xf5ab('0x19')]);router[_0xf5ab('0x1a')](_0xf5ab('0xe'),auth[_0xf5ab('0xa')](),interaction[_0xf5ab('0x14')](_0xf5ab('0x15'),_0xf5ab('0x1b')),controller[_0xf5ab('0x1c')]);router['delete'](_0xf5ab('0x1d'),auth[_0xf5ab('0xa')](),controller[_0xf5ab('0x1e')]);module[_0xf5ab('0x1f')]=router; \ No newline at end of file +var _0x4c8c=['/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','update','delete','destroy','removeTags','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages'];(function(_0x54ba5b,_0x5b7508){var _0x5e16ac=function(_0x131aed){while(--_0x131aed){_0x54ba5b['push'](_0x54ba5b['shift']());}};_0x5e16ac(++_0x5b7508);}(_0x4c8c,0x1b3));var _0xc4c8=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x4c8c[_0x34bc6c];return _0x168820;};'use strict';var multer=require(_0xc4c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc4c8('0x1'));var express=require(_0xc4c8('0x2'));var router=express[_0xc4c8('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc4c8('0x4'));var config=require(_0xc4c8('0x5'));var controller=require('./smsInteraction.controller');router[_0xc4c8('0x6')]('/',auth[_0xc4c8('0x7')](),controller['index']);router[_0xc4c8('0x6')](_0xc4c8('0x8'),auth[_0xc4c8('0x7')](),controller[_0xc4c8('0x9')]);router['get'](_0xc4c8('0xa'),auth[_0xc4c8('0x7')](),controller['show']);router[_0xc4c8('0x6')](_0xc4c8('0xb'),auth['isAuthenticated'](),controller[_0xc4c8('0xc')]);router[_0xc4c8('0x6')](_0xc4c8('0xd'),auth[_0xc4c8('0x7')](),controller[_0xc4c8('0xe')]);router[_0xc4c8('0xf')]('/',auth[_0xc4c8('0x7')](),controller[_0xc4c8('0x10')]);router[_0xc4c8('0xf')]('/:id/messages',auth[_0xc4c8('0x7')](),controller[_0xc4c8('0x11')]);router[_0xc4c8('0xf')](_0xc4c8('0x12'),auth[_0xc4c8('0x7')](),interaction[_0xc4c8('0x13')](_0xc4c8('0x14'),_0xc4c8('0x15')),controller[_0xc4c8('0x16')]);router['put'](_0xc4c8('0xa'),auth[_0xc4c8('0x7')](),interaction[_0xc4c8('0x13')]('sms','smsinteraction:update'),controller[_0xc4c8('0x17')]);router[_0xc4c8('0x18')]('/:id',auth[_0xc4c8('0x7')](),interaction[_0xc4c8('0x13')](_0xc4c8('0x14'),'smsinteraction:destroy'),controller[_0xc4c8('0x19')]);router[_0xc4c8('0x18')](_0xc4c8('0x12'),auth['isAuthenticated'](),controller[_0xc4c8('0x1a')]);module[_0xc4c8('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index aa4ace8..d3d3065 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 _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x4e310d,_0x1b88d9){var _0xf2e3f=function(_0x4d2eef){while(--_0x4d2eef){_0x4e310d['push'](_0x4e310d['shift']());}};_0xf2e3f(++_0x1b88d9);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x25de09,_0x96ed5a){var _0x3eda1e=function(_0x5e879c){while(--_0x5e879c){_0x25de09['push'](_0x25de09['shift']());}};_0x3eda1e(++_0x96ed5a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index f40d2c9..3bc712d 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 _0xcb81=['\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','replace','\x27\x27\x27\x27','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','user','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','catch','show','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','nolimit','pick','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','files','tmp','join','root','server','User','CmContact','Contact','firstName','lastName','direction','secret','Account','Owner','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Sms','closed','disposition','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','field','from','select','u.id','u.fullname','user_has_sms_interactions','left_join','users','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','operator','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL'];(function(_0x3a548b,_0xcccc77){var _0x311ea5=function(_0xc45d66){while(--_0xc45d66){_0x3a548b['push'](_0x3a548b['shift']());}};_0x311ea5(++_0xcccc77);}(_0xcb81,0x154));var _0x1cb8=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xcb81[_0x251d9c];return _0x16ae64;};'use strict';var pdf=require(_0x1cb8('0x0'));var emlformat=require(_0x1cb8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1cb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1cb8('0x3'));var Mustache=require(_0x1cb8('0x4'));var util=require(_0x1cb8('0x5'));var path=require(_0x1cb8('0x6'));var sox=require(_0x1cb8('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb8('0x8'));var fs=require('fs');var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var db=require('../../mysqldb')['db'];config[_0x1cb8('0x16')]=_[_0x1cb8('0x17')](config[_0x1cb8('0x16')],{'host':_0x1cb8('0x18'),'port':0x18eb});var socket=require(_0x1cb8('0x19'))(new Redis(config['redis']));require(_0x1cb8('0x1a'))[_0x1cb8('0x1b')](socket);function respondWithStatusCode(_0xcb6ad1,_0x14d84d){_0x14d84d=_0x14d84d||0xcc;return function(_0x41c232){if(_0x41c232){return _0xcb6ad1[_0x1cb8('0x1c')](_0x14d84d);}return _0xcb6ad1[_0x1cb8('0x1d')](_0x14d84d)[_0x1cb8('0x1e')]();};}function respondWithResult(_0x5af4a3,_0x17a95d){_0x17a95d=_0x17a95d||0xc8;return function(_0x4b4917){if(_0x4b4917){return _0x5af4a3[_0x1cb8('0x1d')](_0x17a95d)[_0x1cb8('0x1f')](_0x4b4917);}};}function respondWithFilteredResult(_0x2e5009,_0x46abd0){return function(_0x2635a8){if(_0x2635a8){var _0x308088=_0x2635a8[_0x1cb8('0x20')],_0x3bfbcf=_0x46abd0[_0x1cb8('0x21')],_0x9f0adb=_0x46abd0[_0x1cb8('0x21')]+_0x46abd0['limit'],_0x2631db;if(_0x9f0adb>=_0x308088){_0x9f0adb=_0x308088;_0x2631db=0xc8;}else{_0x2631db=0xce;}_0x2e5009[_0x1cb8('0x1d')](_0x2631db);return _0x2e5009[_0x1cb8('0x22')](_0x1cb8('0x23'),_0x3bfbcf+'-'+_0x9f0adb+'/'+_0x308088)[_0x1cb8('0x1f')](_0x2635a8);}return null;};}function patchUpdates(_0x4abf3a){return function(_0x279115){try{jsonpatch['apply'](_0x279115,_0x4abf3a,!![]);}catch(_0x436a27){return BPromise[_0x1cb8('0x24')](_0x436a27);}return _0x279115[_0x1cb8('0x25')]();};}function saveUpdates(_0x38ff3a,_0x559916){return function(_0x5515f7){if(_0x5515f7){return _0x5515f7[_0x1cb8('0x26')](_0x38ff3a)[_0x1cb8('0x27')](function(_0x22dafe){return _0x22dafe;});}return null;};}function removeEntity(_0x44a00d,_0x2473b8){return function(_0x30985c){if(_0x30985c){return _0x30985c[_0x1cb8('0x28')]()['then'](function(){_0x44a00d[_0x1cb8('0x1d')](0xcc)[_0x1cb8('0x1e')]();});}};}function handleEntityNotFound(_0x35c890,_0xeeb21d){return function(_0x17f5f8){if(!_0x17f5f8){_0x35c890[_0x1cb8('0x1c')](0x194);}return _0x17f5f8;};}function handleError(_0x4ca3be,_0x1ec995){_0x1ec995=_0x1ec995||0x1f4;return function(_0x23ac21){logger[_0x1cb8('0x29')](_0x23ac21[_0x1cb8('0x2a')]);if(_0x23ac21[_0x1cb8('0x2b')]){delete _0x23ac21['name'];}_0x4ca3be[_0x1cb8('0x1d')](_0x1ec995)[_0x1cb8('0x2c')](_0x23ac21);};}function getInteractionUsers(_0x3a8b53,_0x21c17a){return new BPromise(function(_0x4fda96,_0x2a79e0){try{if(_0x21c17a[_0x3a8b53['id']]){_0x3a8b53[_0x1cb8('0x2d')]=_[_0x1cb8('0x2e')](_0x21c17a[_0x3a8b53['id']],function(_0x5bf630){return{'id':_0x5bf630['id'],'fullname':_0x5bf630[_0x1cb8('0x2f')]};});}}catch(_0x2a6da9){_0x2a79e0(_0x2a6da9);}_0x4fda96(_0x3a8b53);});}function getInteractionTags(_0x17abe1,_0x5558fe){return new BPromise(function(_0x73be67,_0x3e2af4){try{if(_0x17abe1[_0x1cb8('0x30')]){_0x17abe1[_0x1cb8('0x31')]=[];_0x17abe1[_0x1cb8('0x30')]['split'](',')[_0x1cb8('0x32')](function(_0x1de806){_0x17abe1[_0x1cb8('0x31')][_0x1cb8('0x33')](_0x5558fe[_0x1de806]);});}delete _0x17abe1[_0x1cb8('0x30')];}catch(_0x287d02){_0x3e2af4(_0x287d02);}_0x73be67(_0x17abe1);});}function updateSmsInteraction(_0x145f75,_0x18cc99,_0x1aaae4){return new BPromise(function(_0x562975,_0x5cd6bd){return getInteractionUsers(_0x145f75,_0x1aaae4)[_0x1cb8('0x27')](function(_0x14b801){return getInteractionTags(_0x14b801,_0x18cc99);})[_0x1cb8('0x27')](function(_0x5be4b7){_0x562975(_0x5be4b7);})['catch'](function(_0x20fca9){_0x5cd6bd(_0x20fca9);});});}exports[_0x1cb8('0x34')]=function(_0x9cdbed,_0xb21715){var _0x198848={},_0x63ee4e={},_0x3cc898={'count':0x0,'rows':[]};var _0x43dce0=_['map'](db[_0x1cb8('0x35')][_0x1cb8('0x36')],function(_0x1f888e){return{'name':_0x1f888e[_0x1cb8('0x37')],'type':_0x1f888e[_0x1cb8('0x38')][_0x1cb8('0x39')]};});_0x63ee4e[_0x1cb8('0x3a')]=_[_0x1cb8('0x2e')](_0x43dce0,_0x1cb8('0x2b'));_0x63ee4e['query']=_[_0x1cb8('0x3b')](_0x9cdbed[_0x1cb8('0x3c')]);_0x63ee4e['filters']=_[_0x1cb8('0x3d')](_0x63ee4e[_0x1cb8('0x3a')],_0x63ee4e[_0x1cb8('0x3c')]);_0x198848[_0x1cb8('0x3e')]=_[_0x1cb8('0x3d')](_0x63ee4e['model'],qs[_0x1cb8('0x3f')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x3f')]));_0x198848['attributes']=_0x198848['attributes']['length']?_0x198848[_0x1cb8('0x3e')]:_0x63ee4e[_0x1cb8('0x3a')];if(!_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x40')]('nolimit')){_0x198848['limit']=qs[_0x1cb8('0x41')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x41')]);_0x198848[_0x1cb8('0x21')]=qs[_0x1cb8('0x21')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x21')]);}_0x198848[_0x1cb8('0x42')]=qs['sort'](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x43')]);_0x198848[_0x1cb8('0x44')]=qs[_0x1cb8('0x45')](_['pick'](_0x9cdbed[_0x1cb8('0x3c')],_0x63ee4e['filters']));var _0x2060a6=[];var _0x37230e=squel['select']()[_0x1cb8('0x46')]('id')[_0x1cb8('0x46')](_0x1cb8('0x2b'))['field']('color')[_0x1cb8('0x47')]('tools_tags');var _0xbfefb1=squel[_0x1cb8('0x48')]()[_0x1cb8('0x46')](_0x1cb8('0x49'))[_0x1cb8('0x46')](_0x1cb8('0x4a'))[_0x1cb8('0x46')]('ui.SmsInteractionId')[_0x1cb8('0x47')](_0x1cb8('0x4b'),'ui')[_0x1cb8('0x4c')](_0x1cb8('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x2cb11d=squel[_0x1cb8('0x48')]()[_0x1cb8('0x47')](_0x1cb8('0x4e'),'i')[_0x1cb8('0x4c')]('cm_contacts','c',_0x1cb8('0x4f'))[_0x1cb8('0x4c')](_0x1cb8('0x4d'),'o',_0x1cb8('0x50'))[_0x1cb8('0x4c')]('sms_accounts','a',_0x1cb8('0x51'))[_0x1cb8('0x4c')]('sms_messages','me',_0x1cb8('0x52'))[_0x1cb8('0x4c')](_0x1cb8('0x53'),'it',_0x1cb8('0x54'))[_0x1cb8('0x4c')](_0x1cb8('0x55'),'t',_0x1cb8('0x56'));var _0x219541=squel[_0x1cb8('0x57')]();var _0x713a43=[];var _0x1e78e3=squel[_0x1cb8('0x57')]();var _0x3c9076;if(_0x9cdbed[_0x1cb8('0x3c')]['search']){_0x3c9076=as[_0x1cb8('0x58')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x59')]);var _0x41a57e=_0x3c9076[_0x1cb8('0x5a')];for(var _0x15f0ba=0x0;_0x15f0ba<_0x3c9076[_0x1cb8('0x5b')]['length'];_0x15f0ba++){var _0x21e74f=_0x3c9076[_0x1cb8('0x5b')][_0x15f0ba];var _0x26177a='i';var _0x58ea8f=_['find'](_0x43dce0,[_0x1cb8('0x2b'),_0x21e74f[_0x1cb8('0x46')]]);if(!_0x58ea8f){switch(_0x21e74f[_0x1cb8('0x46')]){case _0x1cb8('0x5c'):if(_0x21e74f[_0x1cb8('0x5d')]==0x1){_0x2cb11d['having']('`'+_0x21e74f[_0x1cb8('0x46')]+_0x1cb8('0x5e'));}else{_0x2cb11d[_0x1cb8('0x5f')]('`'+_0x21e74f['field']+'`\x20>\x200');}break;case'Contact':if(_0x21e74f[_0x1cb8('0x60')]==='$substring'){if(_0x21e74f[_0x1cb8('0x5d')][_0x1cb8('0x61')]('\x20')[_0x1cb8('0x62')]>0x1){_0x219541[_0x41a57e](_0x1cb8('0x63'),qs[_0x1cb8('0x64')](_0x21e74f['value']),null);}else{var _0x21c7af='%'+_0x21e74f[_0x1cb8('0x5d')]+'%';_0x219541[_0x41a57e](_0x1cb8('0x65'),_0x21c7af,_0x21c7af,_0x21c7af);}}else{_0x58ea8f=_[_0x1cb8('0x66')](_0x43dce0,[_0x1cb8('0x2b'),_0x1cb8('0x67')]);_0x21e74f[_0x1cb8('0x46')]='ContactId';_0x48fcdc=as[_0x1cb8('0x68')](_0x26177a,_0x58ea8f[_0x1cb8('0x38')],_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);}break;case'Tag':var _0x542064=_0x21e74f['value'][_0x1cb8('0x61')](',')['map'](function(_0x2f3daa){return Number(_0x2f3daa);});_0x542064[_0x1cb8('0x32')](function(_0x1c801e){_0x1e78e3['or'](_0x1cb8('0x6b'),'%,'+_0x1c801e+',%');});_0x713a43=_[_0x1cb8('0x6c')](_0x713a43,_0x542064);break;case'User':if(_0x21e74f['operator']==='$substring'){_0x219541[_0x41a57e](_0x1cb8('0x6d'),'%'+_0x21e74f[_0x1cb8('0x5d')]+'%',null);}else{_0x58ea8f=_['find'](_0x43dce0,[_0x1cb8('0x2b'),'UserId']);_0x21e74f[_0x1cb8('0x46')]=_0x1cb8('0x6e');_0x48fcdc=as['buildExpression'](_0x26177a,_0x58ea8f[_0x1cb8('0x38')],_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);}break;case _0x1cb8('0x6f'):_0x48fcdc=as[_0x1cb8('0x68')]('me',null,_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);break;}}else{var _0x48fcdc=as[_0x1cb8('0x68')](_0x26177a,_0x58ea8f[_0x1cb8('0x38')],_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc['value'][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);}}}else{var _0x16685c=_(_0x9cdbed['query'])[_0x1cb8('0x3b')]()[_0x1cb8('0x2e')](function(_0x5299c6){return _[_0x1cb8('0x70')](_0x43dce0,[_0x1cb8('0x2b'),_0x5299c6])?_0x5299c6:undefined;})['compact']()[_0x1cb8('0x5d')]();if(!_[_0x1cb8('0x71')](_0x16685c)){_0x16685c[_0x1cb8('0x32')](function(_0x36bc1f){if(_0x36bc1f==='SmsAccountId'){_0x2cb11d['where']('i.SmsAccountId\x20IN\x20?',[][_0x1cb8('0x72')](_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f]));}else if(_0x36bc1f===_0x1cb8('0x73')){var _0x426939=JSON[_0x1cb8('0x74')](_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f])[_0x1cb8('0x75')];var _0x4b0cf9=JSON[_0x1cb8('0x74')](_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f])[_0x1cb8('0x76')];_0x2cb11d['where'](_0x1cb8('0x77'),_0x426939,_0x4b0cf9);}else{if(_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f]===_0x1cb8('0x78')){_0x2cb11d[_0x1cb8('0x44')]('i.'+_0x36bc1f+_0x1cb8('0x79'));}else{_0x2cb11d['where']('i.'+_0x36bc1f+_0x1cb8('0x7a'),_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f]);}}});}if(_0x9cdbed[_0x1cb8('0x3c')]['read']){if(_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x7b')]==0x1){_0x2cb11d['having'](_0x1cb8('0x7c'));}else{_0x2cb11d['having']('`unreadMessages`\x20>\x200');}}if(_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x7d')]){_0x713a43=_[_0x1cb8('0x7e')](_0x9cdbed['query']['tag'])?_0x9cdbed['query'][_0x1cb8('0x7d')]:new Array(_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x7d')]);_0x713a43[_0x1cb8('0x32')](function(_0x3a8294){_0x1e78e3['or'](_0x1cb8('0x6b'),'%,'+_0x3a8294+',%');});}if(_0x9cdbed[_0x1cb8('0x3c')]['filter']){var _0x4fc533=_0x9cdbed['query']['filter'][_0x1cb8('0x7f')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x1cb8('0x80'));if(qs['isNumeric'](_0x4fc533)){_0x219541['or']('i.id\x20LIKE\x20?',_0x4fc533+'%')['or']('i.phone\x20LIKE\x20?',_0x4fc533+'%');}else{_0x219541['or'](_0x1cb8('0x81'),qs[_0x1cb8('0x64')](_0x4fc533))['or'](_0x1cb8('0x82'),_0x4fc533+'%');}}}_0x2cb11d[_0x1cb8('0x44')](_0x219541);_0x2cb11d[_0x1cb8('0x83')](_0x1cb8('0x84'));var _0x3f1998={'type':db[_0x1cb8('0x85')][_0x1cb8('0x86')][_0x1cb8('0x87')],'raw':!![]};var _0x1cb6ea=_0x2cb11d[_0x1cb8('0x88')]();_0x1cb6ea[_0x1cb8('0x46')](_0x1cb8('0x84'));_0x1cb6ea[_0x1cb8('0x46')](_0x1cb8('0x89'),'unreadMessages');if(_0x198848[_0x1cb8('0x42')]){_0x198848[_0x1cb8('0x42')][_0x1cb8('0x32')](function(_0xa6c1a4){_0x2cb11d[_0x1cb8('0x42')]('i.'+_0xa6c1a4[0x0],_0xa6c1a4[0x1]===_0x1cb8('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x713a43)){_0x2cb11d[_0x1cb8('0x5f')](_0x1e78e3);_0x1cb6ea[_0x1cb8('0x44')](_0x1cb8('0x8b'),_0x713a43);}BPromise[_0x1cb8('0x8c')]()[_0x1cb8('0x27')](function(){if(!_0x3c9076&&_0x9cdbed['query'][_0x1cb8('0x8d')])return;return _0x9cdbed[_0x1cb8('0x8e')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x1cb8('0x27')](function(_0x5c9195){if(_[_0x1cb8('0x71')](_0x5c9195)){_0x1cb6ea[_0x1cb8('0x44')](_0x1cb8('0x8f'));_0x2cb11d['where'](_0x1cb8('0x8f'));}else{_0x1cb6ea[_0x1cb8('0x44')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x5c9195,'id'));_0x2cb11d[_0x1cb8('0x44')](_0x1cb8('0x90'),_['map'](_0x5c9195,'id'));}});})[_0x1cb8('0x27')](function(){db[_0x1cb8('0x91')][_0x1cb8('0x3c')](_0x1cb6ea[_0x1cb8('0x92')](),_0x3f1998)[_0x1cb8('0x27')](function(_0x1195b5){_0x3cc898[_0x1cb8('0x20')]=_0x1195b5['length'];if(_0x3cc898[_0x1cb8('0x20')]===0x0)return[];return db['sequelize']['query'](_0x37230e['toString'](),_0x3f1998)[_0x1cb8('0x27')](function(_0x217178){_0x2060a6=_[_0x1cb8('0x93')](_0x217178,'id');_0x3f1998=_[_0x1cb8('0x94')](_0x3f1998,{'model':db[_0x1cb8('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9cdbed[_0x1cb8('0x3c')]['fields']){_0x198848['attributes'][_0x1cb8('0x32')](function(_0x5589da){_0x2cb11d[_0x1cb8('0x46')]('i.'+_0x5589da);});}else{_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x89'),'unreadMessages');_0x2cb11d['field'](_0x1cb8('0x95'),'Account.key');_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x96'),_0x1cb8('0x97'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x98'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x99'),_0x1cb8('0x9a'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x9b'),_0x1cb8('0x9c'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x9d'),'Contact.email');_0x2cb11d['field'](_0x1cb8('0x9e'),_0x1cb8('0x9f'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa0'),'Contact.mobile');_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa1'),_0x1cb8('0xa2'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa3'),'Owner.fullname');_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa4'),_0x1cb8('0xa5'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa6'),_0x1cb8('0x30'));}_0x2cb11d[_0x1cb8('0x41')](_0x198848[_0x1cb8('0x41')]);_0x2cb11d[_0x1cb8('0x21')](_0x198848[_0x1cb8('0x21')]);return db['sequelize'][_0x1cb8('0x3c')](_0x2cb11d[_0x1cb8('0x92')](),_0x3f1998);})['then'](function(_0x5c5a7d){_0xbfefb1[_0x1cb8('0x44')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x5c5a7d,'id'));return db[_0x1cb8('0x91')][_0x1cb8('0x3c')](_0xbfefb1['toString'](),_0x3f1998)['then'](function(_0xf05712){var _0x5510dd=_[_0x1cb8('0xa7')](_0xf05712,'SmsInteractionId');var _0x343af9=[];_0x5c5a7d[_0x1cb8('0x32')](function(_0x5d890e){_0x343af9[_0x1cb8('0x33')](updateSmsInteraction(_0x5d890e,_0x2060a6,_0x5510dd));});return BPromise[_0x1cb8('0xa8')](_0x343af9);});});})[_0x1cb8('0x27')](function(_0x425afa){_0x3cc898[_0x1cb8('0xa9')]=_0x425afa;return _0x3cc898;})[_0x1cb8('0x27')](respondWithFilteredResult(_0xb21715,_0x198848));})[_0x1cb8('0xaa')](handleError(_0xb21715,null));};exports[_0x1cb8('0xab')]=function(_0x4ef049,_0x2025ec){var _0x5de093={'raw':![],'where':{'id':_0x4ef049[_0x1cb8('0xac')]['id']}},_0x1b90c6={};_0x1b90c6[_0x1cb8('0x3a')]=_['keys'](db['SmsInteraction'][_0x1cb8('0x36')]);_0x1b90c6[_0x1cb8('0x3c')]=_[_0x1cb8('0x3b')](_0x4ef049['query']);_0x1b90c6['filters']=_['intersection'](_0x1b90c6['model'],_0x1b90c6[_0x1cb8('0x3c')]);_0x5de093[_0x1cb8('0x3e')]=_[_0x1cb8('0x3d')](_0x1b90c6[_0x1cb8('0x3a')],qs[_0x1cb8('0x3f')](_0x4ef049[_0x1cb8('0x3c')]['fields']));_0x5de093[_0x1cb8('0x3e')]=_0x5de093[_0x1cb8('0x3e')][_0x1cb8('0x62')]?_0x5de093[_0x1cb8('0x3e')]:_0x1b90c6[_0x1cb8('0x3a')];if(_0x4ef049['query'][_0x1cb8('0xad')]){_0x5de093[_0x1cb8('0xae')]=[{'all':!![]}];}_0x5de093=_[_0x1cb8('0x94')]({},_0x5de093,_0x4ef049[_0x1cb8('0xaf')]);return db[_0x1cb8('0x35')][_0x1cb8('0x66')](_0x5de093)[_0x1cb8('0x27')](handleEntityNotFound(_0x2025ec,null))['then'](respondWithResult(_0x2025ec,null))['catch'](handleError(_0x2025ec,null));};exports['create']=function(_0x151615,_0x333408){return db[_0x1cb8('0x35')][_0x1cb8('0xb0')](_0x151615['body'],{})[_0x1cb8('0x27')](respondWithResult(_0x333408,0xc9))['catch'](handleError(_0x333408,null));};exports[_0x1cb8('0x26')]=function(_0x107833,_0x441a76){if(_0x107833['body']['id']){delete _0x107833['body']['id'];}return db[_0x1cb8('0x35')][_0x1cb8('0x66')]({'where':{'id':_0x107833[_0x1cb8('0xac')]['id']}})[_0x1cb8('0x27')](handleEntityNotFound(_0x441a76,null))['then'](saveUpdates(_0x107833[_0x1cb8('0x6f')],null))[_0x1cb8('0x27')](respondWithResult(_0x441a76,null))[_0x1cb8('0xaa')](handleError(_0x441a76,null));};exports['destroy']=function(_0x246215,_0x4997b0){return db[_0x1cb8('0x35')][_0x1cb8('0x66')]({'where':{'id':_0x246215[_0x1cb8('0xac')]['id']}})['then'](handleEntityNotFound(_0x4997b0,null))['then'](removeEntity(_0x4997b0,null))[_0x1cb8('0xaa')](handleError(_0x4997b0,null));};exports['describe']=function(_0x45e036,_0xc98ccd){return db['SmsInteraction'][_0x1cb8('0xb1')]()[_0x1cb8('0x27')](respondWithResult(_0xc98ccd,null))[_0x1cb8('0xaa')](handleError(_0xc98ccd,null));};exports[_0x1cb8('0xb2')]=function(_0xd550d4,_0x4cd7d8,_0x1a8ac0){return db[_0x1cb8('0xb3')][_0x1cb8('0x66')]({'where':{'id':_0xd550d4[_0x1cb8('0xac')]['id']}})['then'](handleEntityNotFound(_0x4cd7d8,null))[_0x1cb8('0x27')](function(_0x2faf40){if(_0x2faf40){return _0x2faf40[_0x1cb8('0xb2')](_0xd550d4[_0x1cb8('0x6f')]['ids'],_['omit'](_0xd550d4['body'],[_0x1cb8('0xb4'),'id'])||{});}})[_0x1cb8('0x27')](respondWithResult(_0x4cd7d8,null))[_0x1cb8('0xaa')](handleError(_0x4cd7d8,null));};exports[_0x1cb8('0xb5')]=function(_0x37ca01,_0x3873bd,_0x53bb05){var _0x34123f={'raw':![],'where':{}};var _0x406131={};var _0x9141ed={'count':0x0,'rows':[]};return db[_0x1cb8('0x35')][_0x1cb8('0xb6')]({'where':{'id':_0x37ca01[_0x1cb8('0xac')]['id']}})[_0x1cb8('0x27')](handleEntityNotFound(_0x3873bd,null))['then'](function(_0x20d863){if(_0x20d863){_0x406131[_0x1cb8('0x3a')]=_[_0x1cb8('0x3b')](db[_0x1cb8('0xb3')]['rawAttributes']);_0x406131[_0x1cb8('0x3c')]=_['keys'](_0x37ca01[_0x1cb8('0x3c')]);_0x406131[_0x1cb8('0x45')]=_['intersection'](_0x406131[_0x1cb8('0x3a')],_0x406131[_0x1cb8('0x3c')]);_0x34123f[_0x1cb8('0x3e')]=_[_0x1cb8('0x3d')](_0x406131['model'],qs[_0x1cb8('0x3f')](_0x37ca01['query'][_0x1cb8('0x3f')]));_0x34123f['attributes']=_0x34123f[_0x1cb8('0x3e')][_0x1cb8('0x62')]?_0x34123f[_0x1cb8('0x3e')]:_0x406131[_0x1cb8('0x3a')];if(!_0x37ca01[_0x1cb8('0x3c')]['hasOwnProperty'](_0x1cb8('0xb7'))){_0x34123f['limit']=qs['limit'](_0x37ca01[_0x1cb8('0x3c')]['limit']);_0x34123f[_0x1cb8('0x21')]=qs['offset'](_0x37ca01['query'][_0x1cb8('0x21')]);}_0x34123f[_0x1cb8('0x42')]=qs[_0x1cb8('0x43')](_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0x43')]);_0x34123f[_0x1cb8('0x44')]=qs[_0x1cb8('0x45')](_[_0x1cb8('0xb8')](_0x37ca01[_0x1cb8('0x3c')],_0x406131[_0x1cb8('0x45')]));_0x34123f[_0x1cb8('0x44')]['SmsInteractionId']=_0x20d863['id'];if(_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0xb9')]){_0x34123f['where']=_['merge'](_0x34123f['where'],{'$or':_['map'](_0x34123f[_0x1cb8('0x3e')],function(_0x23a8ff){var _0x206f28={};_0x206f28[_0x23a8ff]={'$like':'%'+_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0xb9')]+'%'};return _0x206f28;})});}if(_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0x75')]){var _0x1d1296=_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0x75')]['split'](',');var _0xb57c40={};_0xb57c40[_0x1d1296[0x0]]={'$gte':moment(_0x1d1296[0x1])[_0x1cb8('0xba')](_0x1cb8('0xbb'))};_0x34123f['where']=_[_0x1cb8('0x94')](_0x34123f['where'],_0xb57c40);}_0x34123f=_[_0x1cb8('0x94')]({},_0x34123f,_0x37ca01[_0x1cb8('0xaf')]);return db[_0x1cb8('0xb3')][_0x1cb8('0x20')]({'where':_0x34123f[_0x1cb8('0x44')]})[_0x1cb8('0x27')](function(_0xe63fda){_0x9141ed[_0x1cb8('0x20')]=_0xe63fda;if(_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0xad')]){_0x34123f[_0x1cb8('0xae')]=[{'all':!![]}];}return db[_0x1cb8('0xb3')][_0x1cb8('0xbc')](_0x34123f);})['then'](function(_0x13e0ea){_0x9141ed['rows']=_0x13e0ea;return _0x9141ed;});}})[_0x1cb8('0x27')](respondWithFilteredResult(_0x3873bd,_0x34123f))[_0x1cb8('0xaa')](handleError(_0x3873bd,null));};exports['addTags']=function(_0xf18760,_0x411a4c,_0x546975){return db[_0x1cb8('0x35')]['find']({'where':{'id':_0xf18760[_0x1cb8('0xac')]['id']}})['then'](handleEntityNotFound(_0x411a4c,null))[_0x1cb8('0x27')](function(_0x2f20b0){if(_0x2f20b0){return _0x2f20b0[_0x1cb8('0xbd')](_0xf18760[_0x1cb8('0x6f')]['ids'],_[_0x1cb8('0xbe')](_0xf18760['body'],[_0x1cb8('0xb4'),'id'])||{})[_0x1cb8('0xbf')](function(){return db[_0x1cb8('0xc0')][_0x1cb8('0xbc')]({'attributes':['id',_0x1cb8('0x2b'),_0x1cb8('0xc1')],'where':{'id':_0xf18760[_0x1cb8('0x6f')]['ids']}});})[_0x1cb8('0x27')](function(_0x5a56f9){socket[_0x1cb8('0xc2')](_0x1cb8('0xc3'),{'id':Number(_0xf18760[_0x1cb8('0xac')]['id']),'tags':_0x5a56f9||[]});return{'id':Number(_0xf18760[_0x1cb8('0xac')]['id']),'tags':_0x5a56f9||[]};});}})[_0x1cb8('0x27')](respondWithResult(_0x411a4c,null))['catch'](handleError(_0x411a4c,null));};exports[_0x1cb8('0xc4')]=function(_0x522267,_0x336cd9,_0x3014d1){return db[_0x1cb8('0x35')][_0x1cb8('0x66')]({'where':{'id':_0x522267[_0x1cb8('0xac')]['id']}})[_0x1cb8('0x27')](handleEntityNotFound(_0x336cd9,null))[_0x1cb8('0x27')](function(_0x22c43c){if(_0x22c43c){return _0x22c43c[_0x1cb8('0xc4')](_0x522267[_0x1cb8('0x3c')][_0x1cb8('0xb4')]);}})[_0x1cb8('0x27')](respondWithStatusCode(_0x336cd9,null))[_0x1cb8('0xaa')](handleError(_0x336cd9,null));};exports[_0x1cb8('0xc5')]=function(_0x36e3c5,_0x209ec2){var _0x4bde90=moment()[_0x1cb8('0xc6')]()[_0x1cb8('0x92')]();var _0x4d2573=path['join'](config['root'],'server',_0x1cb8('0xc7'),_0x1cb8('0xc8'));var _0x1a0f6b=path[_0x1cb8('0xc9')](config[_0x1cb8('0xca')],_0x1cb8('0xcb'),_0x1cb8('0xc7'),'attachments');var _0x468daa=path['join'](_0x4d2573,_0x4bde90);var _0x2e2ae4=util[_0x1cb8('0xba')]('transcript-%d-%s.zip',_0x36e3c5[_0x1cb8('0xac')]['id'],_0x4bde90);var _0x2acac2=path[_0x1cb8('0xc9')](_0x4d2573,_0x2e2ae4);var _0x15a2c3=[];_0x15a2c3[_0x1cb8('0x33')]({'model':db[_0x1cb8('0xcc')],'as':_0x1cb8('0xcc'),'attributes':['id',_0x1cb8('0x2f')],'raw':!![]});_0x15a2c3['push']({'model':db[_0x1cb8('0xcd')],'as':_0x1cb8('0xce'),'attributes':['id',_0x1cb8('0xcf'),_0x1cb8('0xd0')],'raw':!![]});var _0x3f869f=[{'model':db[_0x1cb8('0xb3')],'as':'Messages','attributes':['id',_0x1cb8('0x6f'),'createdAt',_0x1cb8('0xd1'),_0x1cb8('0xd2'),_0x1cb8('0x7b')],'include':_0x15a2c3}];_0x3f869f[_0x1cb8('0x33')]({'model':db['SmsAccount'],'as':_0x1cb8('0xd3'),'attributes':['id',_0x1cb8('0x2b')]});_0x3f869f['push']({'model':db['User'],'as':_0x1cb8('0xd4'),'attributes':['id',_0x1cb8('0x2f')]});return db['SmsInteraction'][_0x1cb8('0x66')]({'where':{'id':_0x36e3c5[_0x1cb8('0xac')]['id']},'include':_0x3f869f})['then'](handleEntityNotFound(_0x209ec2,null))[_0x1cb8('0x27')](function(_0xb28014){if(_0xb28014){var _0x4b0bdf=_0xb28014[_0x1cb8('0xd5')]({'plain':!![]});fs[_0x1cb8('0xd6')](_0x468daa);var _0x377dc5={'format':'A4','border':'10px','header':{'height':_0x1cb8('0xd7'),'contents':{'first':_0x1cb8('0xd8')}},'footer':{'height':_0x1cb8('0xd9'),'contents':{'default':util['format'](_0x1cb8('0xda'),util[_0x1cb8('0xba')]('%s\x20#%d',_0x1cb8('0xdb'),_0x4b0bdf['id']),moment()[_0x1cb8('0xba')]('YYYY-MM-DD')['toString']())}}};var _0x22766d={'channel':_0x1cb8('0xdb'),'account':_0x4b0bdf['Account'][_0x1cb8('0x2b')],'agent':_0x4b0bdf['Owner']?_0x4b0bdf[_0x1cb8('0xd4')][_0x1cb8('0x2f')]:'N.A.','createdAt':moment(_0x4b0bdf['createdAt'])['format'](_0x1cb8('0xbb'))['toString'](),'closedAt':_0x4b0bdf[_0x1cb8('0xdc')]?moment(_0x4b0bdf['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x1cb8('0x92')]():'','disposition':_0x4b0bdf[_0x1cb8('0xdd')],'messages':_(_0x4b0bdf['Messages'])[_0x1cb8('0xb9')]({'secret':![]})[_0x1cb8('0x2e')](function(_0x465d52){return{'date':moment(_0x465d52['createdAt'])[_0x1cb8('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1cb8('0x92')](),'sender':_0x465d52[_0x1cb8('0xd1')]==='out'?_0x465d52[_0x1cb8('0xcc')]?_0x465d52[_0x1cb8('0xcc')][_0x1cb8('0x2f')]:_0x1cb8('0xde'):_0x465d52['Contact'][_0x1cb8('0xcf')]+(_0x465d52[_0x1cb8('0xce')]['lastName']?'\x20'+_0x465d52[_0x1cb8('0xce')][_0x1cb8('0xd0')]:''),'body':_0x465d52['body'],'direction':_0x465d52[_0x1cb8('0xd1')]==='out'?'A':'C','secret':_0x465d52[_0x1cb8('0xd2')],'read':_0x465d52[_0x1cb8('0x7b')]};})['value']()};return ejs[_0x1cb8('0xdf')](path[_0x1cb8('0xc9')](config[_0x1cb8('0xca')],_0x1cb8('0xcb'),'views',_0x1cb8('0xe0')),{'interaction':_0x22766d})['then'](function(_0x3cc211){return new BPromise(function(_0x58edca,_0x214973){pdf[_0x1cb8('0xb0')](_0x3cc211,_0x377dc5)[_0x1cb8('0xe1')](path[_0x1cb8('0xc9')](_0x468daa,_0x1cb8('0xe2')+_0x4b0bdf['id']+'-'+_0x4bde90+_0x1cb8('0xe3')),function(_0x2a70ca,_0x248736){if(_0x2a70ca)return _0x214973(_0x2a70ca);_0x58edca(_0x248736);});});})[_0x1cb8('0x27')](function(){return new BPromise(function(_0x39fab4,_0x46aa97){zipdir(_0x468daa,{'saveTo':_0x2acac2},function(_0x361ecb,_0x326f40){if(_0x361ecb)return _0x46aa97(_0x361ecb);return _0x39fab4(_0x326f40);});})['then'](function(){return new BPromise(function(_0x50ac66,_0x1b6e36){rimraf(_0x468daa,function(_0x10db2a){if(_0x10db2a)_0x1b6e36(_0x10db2a);return _0x50ac66();});});})[_0x1cb8('0x27')](function(){return _0x209ec2[_0x1cb8('0xc5')](_0x2acac2,_0x2e2ae4,function(_0x42967c){if(_0x42967c){console[_0x1cb8('0xe4')](_0x1cb8('0xe5'),_0x42967c);}else{fs[_0x1cb8('0xe6')](_0x2acac2);}});});});}else{return _0x209ec2[_0x1cb8('0x1c')](0xc8);}})['catch'](handleError(_0x209ec2,null));}; \ No newline at end of file +var _0x50a6=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','field','color','from','tools_tags','select','u.id','u.fullname','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','resolve','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','SmsInteraction','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','all','rows','show','params','filters','includeAll','include','merge','options','create','body','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','Tag','smsInteractionTags:save','removeTags','unix','root','server','files','join','CmContact','lastName','Messages','direction','secret','SmsAccount','Account','get','mkdirSync','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','Owner','N.A.','closed','closedAt','disposition','out','System','firstName','Contact','downloadInteraction.html','download','err','unlinkSync','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','end','status','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','name','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','rawAttributes','fieldName','type','model','query','keys'];(function(_0x29b2a2,_0x4b7224){var _0x836e8c=function(_0xbea41e){while(--_0xbea41e){_0x29b2a2['push'](_0x29b2a2['shift']());}};_0x836e8c(++_0x4b7224);}(_0x50a6,0xa4));var _0x650a=function(_0x242152,_0x2f7b09){_0x242152=_0x242152-0x0;var _0x167a0d=_0x50a6[_0x242152];return _0x167a0d;};'use strict';var pdf=require(_0x650a('0x0'));var emlformat=require(_0x650a('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x650a('0x2'));var rp=require('request-promise');var moment=require(_0x650a('0x3'));var BPromise=require(_0x650a('0x4'));var Mustache=require(_0x650a('0x5'));var util=require('util');var path=require(_0x650a('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x650a('0x7'));var fs=require('fs');var _=require(_0x650a('0x8'));var squel=require(_0x650a('0x9'));var crypto=require(_0x650a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x650a('0xb'));var toCsv=require('to-csv');var querystring=require(_0x650a('0xc'));var Papa=require(_0x650a('0xd'));var Redis=require('ioredis');var authService=require(_0x650a('0xe'));var qs=require(_0x650a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x650a('0x10'));var logger=require('../../config/logger')(_0x650a('0x11'));var utils=require('../../config/utils');var config=require(_0x650a('0x12'));var db=require('../../mysqldb')['db'];config[_0x650a('0x13')]=_['defaults'](config[_0x650a('0x13')],{'host':_0x650a('0x14'),'port':0x18eb});var socket=require(_0x650a('0x15'))(new Redis(config['redis']));require(_0x650a('0x16'))[_0x650a('0x17')](socket);function respondWithStatusCode(_0x2f727d,_0x15f2fd){_0x15f2fd=_0x15f2fd||0xcc;return function(_0x35c6dc){if(_0x35c6dc){return _0x2f727d[_0x650a('0x18')](_0x15f2fd);}return _0x2f727d['status'](_0x15f2fd)[_0x650a('0x19')]();};}function respondWithResult(_0x4fdd82,_0x1f94ab){_0x1f94ab=_0x1f94ab||0xc8;return function(_0x3c2206){if(_0x3c2206){return _0x4fdd82[_0x650a('0x1a')](_0x1f94ab)['json'](_0x3c2206);}};}function respondWithFilteredResult(_0x4b4ba1,_0x5285e0){return function(_0x52e5bb){if(_0x52e5bb){var _0x2ad2d7=_0x52e5bb[_0x650a('0x1b')],_0x359314=_0x5285e0['offset'],_0x41d2fa=_0x5285e0['offset']+_0x5285e0[_0x650a('0x1c')],_0xd0f717;if(_0x41d2fa>=_0x2ad2d7){_0x41d2fa=_0x2ad2d7;_0xd0f717=0xc8;}else{_0xd0f717=0xce;}_0x4b4ba1[_0x650a('0x1a')](_0xd0f717);return _0x4b4ba1['set'](_0x650a('0x1d'),_0x359314+'-'+_0x41d2fa+'/'+_0x2ad2d7)[_0x650a('0x1e')](_0x52e5bb);}return null;};}function patchUpdates(_0x59b5e4){return function(_0x158356){try{jsonpatch[_0x650a('0x1f')](_0x158356,_0x59b5e4,!![]);}catch(_0x26defd){return BPromise[_0x650a('0x20')](_0x26defd);}return _0x158356[_0x650a('0x21')]();};}function saveUpdates(_0x489a5f,_0x88531d){return function(_0x5d547f){if(_0x5d547f){return _0x5d547f[_0x650a('0x22')](_0x489a5f)[_0x650a('0x23')](function(_0xb12c52){return _0xb12c52;});}return null;};}function removeEntity(_0x469e53,_0x2ed256){return function(_0x326d60){if(_0x326d60){return _0x326d60[_0x650a('0x24')]()[_0x650a('0x23')](function(){_0x469e53[_0x650a('0x1a')](0xcc)[_0x650a('0x19')]();});}};}function handleEntityNotFound(_0xa902e6,_0x234fce){return function(_0xd89a9e){if(!_0xd89a9e){_0xa902e6[_0x650a('0x18')](0x194);}return _0xd89a9e;};}function handleError(_0x398a99,_0x39a155){_0x39a155=_0x39a155||0x1f4;return function(_0x15b876){logger[_0x650a('0x25')](_0x15b876['stack']);if(_0x15b876[_0x650a('0x26')]){delete _0x15b876[_0x650a('0x26')];}_0x398a99[_0x650a('0x1a')](_0x39a155)['send'](_0x15b876);};}function getInteractionUsers(_0x1c6845,_0x2338f4){return new BPromise(function(_0x454ff8,_0x783509){try{if(_0x2338f4[_0x1c6845['id']]){_0x1c6845[_0x650a('0x27')]=_[_0x650a('0x28')](_0x2338f4[_0x1c6845['id']],function(_0x4d0848){return{'id':_0x4d0848['id'],'fullname':_0x4d0848[_0x650a('0x29')]};});}}catch(_0x1c8621){_0x783509(_0x1c8621);}_0x454ff8(_0x1c6845);});}function getInteractionTags(_0x199c86,_0x18c197){return new BPromise(function(_0x25a47c,_0x3e15ba){try{if(_0x199c86[_0x650a('0x2a')]){_0x199c86[_0x650a('0x2b')]=[];_0x199c86['TagIds'][_0x650a('0x2c')](',')[_0x650a('0x2d')](function(_0x2e0370){_0x199c86['Tags'][_0x650a('0x2e')](_0x18c197[_0x2e0370]);});}delete _0x199c86[_0x650a('0x2a')];}catch(_0x54d5a4){_0x3e15ba(_0x54d5a4);}_0x25a47c(_0x199c86);});}function updateSmsInteraction(_0x6dbd77,_0x21577d,_0x41cdc6){return new BPromise(function(_0x50ad29,_0x5b4a47){return getInteractionUsers(_0x6dbd77,_0x41cdc6)['then'](function(_0x52fbc1){return getInteractionTags(_0x52fbc1,_0x21577d);})[_0x650a('0x23')](function(_0x446f5d){_0x50ad29(_0x446f5d);})[_0x650a('0x2f')](function(_0x574330){_0x5b4a47(_0x574330);});});}exports[_0x650a('0x30')]=function(_0x269539,_0x48d82a){var _0x447070={},_0xe766b1={},_0x16f8db={'count':0x0,'rows':[]};var _0xd2256b=_[_0x650a('0x28')](db['SmsInteraction'][_0x650a('0x31')],function(_0x4ccb6f){return{'name':_0x4ccb6f[_0x650a('0x32')],'type':_0x4ccb6f[_0x650a('0x33')]['key']};});_0xe766b1[_0x650a('0x34')]=_[_0x650a('0x28')](_0xd2256b,'name');_0xe766b1[_0x650a('0x35')]=_[_0x650a('0x36')](_0x269539[_0x650a('0x35')]);_0xe766b1['filters']=_[_0x650a('0x37')](_0xe766b1[_0x650a('0x34')],_0xe766b1[_0x650a('0x35')]);_0x447070[_0x650a('0x38')]=_['intersection'](_0xe766b1[_0x650a('0x34')],qs[_0x650a('0x39')](_0x269539[_0x650a('0x35')]['fields']));_0x447070['attributes']=_0x447070[_0x650a('0x38')][_0x650a('0x3a')]?_0x447070['attributes']:_0xe766b1[_0x650a('0x34')];if(!_0x269539['query'][_0x650a('0x3b')](_0x650a('0x3c'))){_0x447070[_0x650a('0x1c')]=qs[_0x650a('0x1c')](_0x269539[_0x650a('0x35')]['limit']);_0x447070[_0x650a('0x3d')]=qs['offset'](_0x269539[_0x650a('0x35')][_0x650a('0x3d')]);}_0x447070[_0x650a('0x3e')]=qs[_0x650a('0x3f')](_0x269539[_0x650a('0x35')][_0x650a('0x3f')]);_0x447070[_0x650a('0x40')]=qs['filters'](_['pick'](_0x269539[_0x650a('0x35')],_0xe766b1['filters']));var _0x5e5179=[];var _0x1e0868=squel['select']()[_0x650a('0x41')]('id')['field'](_0x650a('0x26'))[_0x650a('0x41')](_0x650a('0x42'))[_0x650a('0x43')](_0x650a('0x44'));var _0xe89309=squel[_0x650a('0x45')]()[_0x650a('0x41')](_0x650a('0x46'))[_0x650a('0x41')](_0x650a('0x47'))[_0x650a('0x41')]('ui.SmsInteractionId')[_0x650a('0x43')](_0x650a('0x48'),'ui')[_0x650a('0x49')](_0x650a('0x4a'),'u',_0x650a('0x4b'));var _0x426845=squel['select']()[_0x650a('0x43')](_0x650a('0x4c'),'i')[_0x650a('0x49')](_0x650a('0x4d'),'c',_0x650a('0x4e'))[_0x650a('0x49')]('users','o','o.id\x20=\x20i.UserId')[_0x650a('0x49')](_0x650a('0x4f'),'a',_0x650a('0x50'))['left_join'](_0x650a('0x51'),'me','me.SmsInteractionId\x20=\x20i.id')[_0x650a('0x49')](_0x650a('0x52'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x650a('0x49')](_0x650a('0x44'),'t',_0x650a('0x53'));var _0x47ec0d=squel[_0x650a('0x54')]();var _0x3e7cfc=[];var _0x24f84a=squel['expr']();var _0x17a40d;if(_0x269539[_0x650a('0x35')][_0x650a('0x55')]){_0x17a40d=as[_0x650a('0x56')](_0x269539[_0x650a('0x35')]['search']);var _0x54e8af=_0x17a40d[_0x650a('0x57')];for(var _0x34fdcf=0x0;_0x34fdcf<_0x17a40d['conditions'][_0x650a('0x3a')];_0x34fdcf++){var _0x27dfcd=_0x17a40d[_0x650a('0x58')][_0x34fdcf];var _0x51278f='i';var _0x42e23f=_[_0x650a('0x59')](_0xd2256b,['name',_0x27dfcd[_0x650a('0x41')]]);if(!_0x42e23f){switch(_0x27dfcd[_0x650a('0x41')]){case _0x650a('0x5a'):if(_0x27dfcd[_0x650a('0x5b')]==0x1){_0x426845[_0x650a('0x5c')]('`'+_0x27dfcd['field']+_0x650a('0x5d'));}else{_0x426845[_0x650a('0x5c')]('`'+_0x27dfcd[_0x650a('0x41')]+_0x650a('0x5e'));}break;case'Contact':if(_0x27dfcd['operator']===_0x650a('0x5f')){if(_0x27dfcd[_0x650a('0x5b')]['split']('\x20')[_0x650a('0x3a')]>0x1){_0x47ec0d[_0x54e8af](_0x650a('0x60'),qs[_0x650a('0x61')](_0x27dfcd[_0x650a('0x5b')]),null);}else{var _0x42cf04='%'+_0x27dfcd[_0x650a('0x5b')]+'%';_0x47ec0d[_0x54e8af](_0x650a('0x62'),_0x42cf04,_0x42cf04,_0x42cf04);}}else{_0x42e23f=_[_0x650a('0x59')](_0xd2256b,[_0x650a('0x26'),_0x650a('0x63')]);_0x27dfcd[_0x650a('0x41')]=_0x650a('0x63');_0x3624ee=as[_0x650a('0x64')](_0x51278f,_0x42e23f[_0x650a('0x33')],_0x27dfcd);_0x47ec0d[_0x54e8af](_0x3624ee[_0x650a('0x65')],_0x3624ee['value']['start'],_0x3624ee[_0x650a('0x5b')][_0x650a('0x19')]);}break;case'Tag':var _0x4c74f4=_0x27dfcd[_0x650a('0x5b')]['split'](',')[_0x650a('0x28')](function(_0x5c44e5){return Number(_0x5c44e5);});_0x4c74f4['forEach'](function(_0x1b2a4a){_0x24f84a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1b2a4a+',%');});_0x3e7cfc=_[_0x650a('0x66')](_0x3e7cfc,_0x4c74f4);break;case _0x650a('0x67'):if(_0x27dfcd['operator']===_0x650a('0x5f')){_0x47ec0d[_0x54e8af](_0x650a('0x68'),'%'+_0x27dfcd[_0x650a('0x5b')]+'%',null);}else{_0x42e23f=_[_0x650a('0x59')](_0xd2256b,[_0x650a('0x26'),_0x650a('0x69')]);_0x27dfcd['field']=_0x650a('0x69');_0x3624ee=as[_0x650a('0x64')](_0x51278f,_0x42e23f[_0x650a('0x33')],_0x27dfcd);_0x47ec0d[_0x54e8af](_0x3624ee['text'],_0x3624ee[_0x650a('0x5b')][_0x650a('0x6a')],_0x3624ee[_0x650a('0x5b')]['end']);}break;case'body':_0x3624ee=as[_0x650a('0x64')]('me',null,_0x27dfcd);_0x47ec0d[_0x54e8af](_0x3624ee[_0x650a('0x65')],_0x3624ee['value'][_0x650a('0x6a')],_0x3624ee[_0x650a('0x5b')][_0x650a('0x19')]);break;}}else{var _0x3624ee=as[_0x650a('0x64')](_0x51278f,_0x42e23f[_0x650a('0x33')],_0x27dfcd);_0x47ec0d[_0x54e8af](_0x3624ee['text'],_0x3624ee[_0x650a('0x5b')][_0x650a('0x6a')],_0x3624ee[_0x650a('0x5b')]['end']);}}}else{var _0x436531=_(_0x269539[_0x650a('0x35')])['keys']()[_0x650a('0x28')](function(_0x509710){return _[_0x650a('0x6b')](_0xd2256b,['name',_0x509710])?_0x509710:undefined;})[_0x650a('0x6c')]()[_0x650a('0x5b')]();if(!_['isEmpty'](_0x436531)){_0x436531[_0x650a('0x2d')](function(_0x14954c){if(_0x14954c===_0x650a('0x6d')){_0x426845[_0x650a('0x40')](_0x650a('0x6e'),[][_0x650a('0x6f')](_0x269539[_0x650a('0x35')][_0x14954c]));}else if(_0x14954c===_0x650a('0x70')){var _0x5a08d9=JSON[_0x650a('0x71')](_0x269539[_0x650a('0x35')][_0x14954c])[_0x650a('0x72')];var _0xba1b88=JSON['parse'](_0x269539['query'][_0x14954c])[_0x650a('0x73')];_0x426845['where'](_0x650a('0x74'),_0x5a08d9,_0xba1b88);}else{if(_0x269539[_0x650a('0x35')][_0x14954c]===_0x650a('0x75')){_0x426845[_0x650a('0x40')]('i.'+_0x14954c+_0x650a('0x76'));}else{_0x426845[_0x650a('0x40')]('i.'+_0x14954c+'\x20=\x20?',_0x269539[_0x650a('0x35')][_0x14954c]);}}});}if(_0x269539['query'][_0x650a('0x77')]){if(_0x269539[_0x650a('0x35')][_0x650a('0x77')]==0x1){_0x426845[_0x650a('0x5c')](_0x650a('0x78'));}else{_0x426845['having'](_0x650a('0x79'));}}if(_0x269539[_0x650a('0x35')][_0x650a('0x7a')]){_0x3e7cfc=_[_0x650a('0x7b')](_0x269539[_0x650a('0x35')][_0x650a('0x7a')])?_0x269539[_0x650a('0x35')][_0x650a('0x7a')]:new Array(_0x269539[_0x650a('0x35')][_0x650a('0x7a')]);_0x3e7cfc['forEach'](function(_0x5057ee){_0x24f84a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x5057ee+',%');});}if(_0x269539[_0x650a('0x35')][_0x650a('0x7c')]){var _0x4b1302=_0x269539[_0x650a('0x35')][_0x650a('0x7c')][_0x650a('0x7d')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x650a('0x7e'));if(qs['isNumeric'](_0x4b1302)){_0x47ec0d['or'](_0x650a('0x7f'),_0x4b1302+'%')['or'](_0x650a('0x80'),_0x4b1302+'%');}else{_0x47ec0d['or'](_0x650a('0x81'),qs[_0x650a('0x61')](_0x4b1302))['or'](_0x650a('0x82'),_0x4b1302+'%');}}}_0x426845['where'](_0x47ec0d);_0x426845['group'](_0x650a('0x83'));var _0x3ec8c0={'type':db[_0x650a('0x84')]['QueryTypes'][_0x650a('0x85')],'raw':!![]};var _0x5dc433=_0x426845['clone']();_0x5dc433[_0x650a('0x41')](_0x650a('0x83'));_0x5dc433[_0x650a('0x41')](_0x650a('0x86'),_0x650a('0x5a'));if(_0x447070['order']){_0x447070[_0x650a('0x3e')][_0x650a('0x2d')](function(_0x2a5ff6){_0x426845['order']('i.'+_0x2a5ff6[0x0],_0x2a5ff6[0x1]==='DESC'?![]:!![]);});}if(!_[_0x650a('0x87')](_0x3e7cfc)){_0x426845['having'](_0x24f84a);_0x5dc433['where']('t.id\x20IN\x20?',_0x3e7cfc);}BPromise[_0x650a('0x88')]()['then'](function(){if(!_0x17a40d&&_0x269539['query'][_0x650a('0x6d')])return;return _0x269539['user'][_0x650a('0x89')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e31b2){if(_[_0x650a('0x87')](_0x3e31b2)){_0x5dc433[_0x650a('0x40')](_0x650a('0x8a'));_0x426845['where'](_0x650a('0x8a'));}else{_0x5dc433['where']('i.SmsAccountId\x20IN\x20?',_[_0x650a('0x28')](_0x3e31b2,'id'));_0x426845[_0x650a('0x40')](_0x650a('0x6e'),_[_0x650a('0x28')](_0x3e31b2,'id'));}});})[_0x650a('0x23')](function(){db[_0x650a('0x8b')]['query'](_0x5dc433[_0x650a('0x8c')](),_0x3ec8c0)[_0x650a('0x23')](function(_0x7b1d6c){_0x16f8db['count']=_0x7b1d6c[_0x650a('0x3a')];if(_0x16f8db[_0x650a('0x1b')]===0x0)return[];return db[_0x650a('0x8b')][_0x650a('0x35')](_0x1e0868[_0x650a('0x8c')](),_0x3ec8c0)['then'](function(_0x33ae0c){_0x5e5179=_[_0x650a('0x8d')](_0x33ae0c,'id');_0x3ec8c0=_['merge'](_0x3ec8c0,{'model':db[_0x650a('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x269539['query']['fields']){_0x447070[_0x650a('0x38')][_0x650a('0x2d')](function(_0x4df8cf){_0x426845[_0x650a('0x41')]('i.'+_0x4df8cf);});}else{_0x426845[_0x650a('0x41')](_0x650a('0x86'),_0x650a('0x5a'));_0x426845[_0x650a('0x41')](_0x650a('0x8f'),'Account.key');_0x426845[_0x650a('0x41')](_0x650a('0x90'),_0x650a('0x91'));_0x426845[_0x650a('0x41')](_0x650a('0x92'));_0x426845[_0x650a('0x41')]('c.firstName',_0x650a('0x93'));_0x426845[_0x650a('0x41')](_0x650a('0x94'),_0x650a('0x95'));_0x426845[_0x650a('0x41')](_0x650a('0x96'),'Contact.email');_0x426845[_0x650a('0x41')](_0x650a('0x97'),'Contact.phone');_0x426845[_0x650a('0x41')](_0x650a('0x98'),'Contact.mobile');_0x426845['field']('c.fax',_0x650a('0x99'));_0x426845[_0x650a('0x41')](_0x650a('0x9a'),'Owner.fullname');_0x426845[_0x650a('0x41')](_0x650a('0x9b'),_0x650a('0x9c'));_0x426845[_0x650a('0x41')](_0x650a('0x9d'),_0x650a('0x2a'));}_0x426845['limit'](_0x447070[_0x650a('0x1c')]);_0x426845[_0x650a('0x3d')](_0x447070['offset']);return db[_0x650a('0x8b')][_0x650a('0x35')](_0x426845[_0x650a('0x8c')](),_0x3ec8c0);})[_0x650a('0x23')](function(_0x1766e6){_0xe89309[_0x650a('0x40')](_0x650a('0x9e'),_[_0x650a('0x28')](_0x1766e6,'id'));return db[_0x650a('0x8b')][_0x650a('0x35')](_0xe89309['toString'](),_0x3ec8c0)['then'](function(_0x37ac7e){var _0xb303e9=_['groupBy'](_0x37ac7e,_0x650a('0x9f'));var _0x26080d=[];_0x1766e6[_0x650a('0x2d')](function(_0x2250a3){_0x26080d[_0x650a('0x2e')](updateSmsInteraction(_0x2250a3,_0x5e5179,_0xb303e9));});return BPromise[_0x650a('0xa0')](_0x26080d);});});})[_0x650a('0x23')](function(_0x3afb4e){_0x16f8db[_0x650a('0xa1')]=_0x3afb4e;return _0x16f8db;})[_0x650a('0x23')](respondWithFilteredResult(_0x48d82a,_0x447070));})['catch'](handleError(_0x48d82a,null));};exports[_0x650a('0xa2')]=function(_0x3c2db8,_0x40e225){var _0x3584c8={'raw':![],'where':{'id':_0x3c2db8[_0x650a('0xa3')]['id']}},_0x56dec4={};_0x56dec4[_0x650a('0x34')]=_[_0x650a('0x36')](db[_0x650a('0x8e')][_0x650a('0x31')]);_0x56dec4[_0x650a('0x35')]=_[_0x650a('0x36')](_0x3c2db8[_0x650a('0x35')]);_0x56dec4[_0x650a('0xa4')]=_[_0x650a('0x37')](_0x56dec4[_0x650a('0x34')],_0x56dec4['query']);_0x3584c8[_0x650a('0x38')]=_[_0x650a('0x37')](_0x56dec4[_0x650a('0x34')],qs[_0x650a('0x39')](_0x3c2db8['query']['fields']));_0x3584c8[_0x650a('0x38')]=_0x3584c8[_0x650a('0x38')][_0x650a('0x3a')]?_0x3584c8[_0x650a('0x38')]:_0x56dec4[_0x650a('0x34')];if(_0x3c2db8[_0x650a('0x35')][_0x650a('0xa5')]){_0x3584c8[_0x650a('0xa6')]=[{'all':!![]}];}_0x3584c8=_[_0x650a('0xa7')]({},_0x3584c8,_0x3c2db8[_0x650a('0xa8')]);return db[_0x650a('0x8e')][_0x650a('0x59')](_0x3584c8)[_0x650a('0x23')](handleEntityNotFound(_0x40e225,null))[_0x650a('0x23')](respondWithResult(_0x40e225,null))[_0x650a('0x2f')](handleError(_0x40e225,null));};exports[_0x650a('0xa9')]=function(_0x2e9cc6,_0x7e5f7){return db[_0x650a('0x8e')][_0x650a('0xa9')](_0x2e9cc6[_0x650a('0xaa')],{})[_0x650a('0x23')](respondWithResult(_0x7e5f7,0xc9))['catch'](handleError(_0x7e5f7,null));};exports[_0x650a('0x22')]=function(_0x4271be,_0x2f47a4){if(_0x4271be[_0x650a('0xaa')]['id']){delete _0x4271be[_0x650a('0xaa')]['id'];}return db['SmsInteraction'][_0x650a('0x59')]({'where':{'id':_0x4271be[_0x650a('0xa3')]['id']}})[_0x650a('0x23')](handleEntityNotFound(_0x2f47a4,null))[_0x650a('0x23')](saveUpdates(_0x4271be[_0x650a('0xaa')],null))[_0x650a('0x23')](respondWithResult(_0x2f47a4,null))[_0x650a('0x2f')](handleError(_0x2f47a4,null));};exports[_0x650a('0x24')]=function(_0xd11c,_0x53165d){return db[_0x650a('0x8e')]['find']({'where':{'id':_0xd11c[_0x650a('0xa3')]['id']}})[_0x650a('0x23')](handleEntityNotFound(_0x53165d,null))[_0x650a('0x23')](removeEntity(_0x53165d,null))[_0x650a('0x2f')](handleError(_0x53165d,null));};exports[_0x650a('0xab')]=function(_0x31b290,_0x434d83){return db['SmsInteraction'][_0x650a('0xab')]()[_0x650a('0x23')](respondWithResult(_0x434d83,null))[_0x650a('0x2f')](handleError(_0x434d83,null));};exports[_0x650a('0xac')]=function(_0x514d65,_0x31dd17,_0x1c2f72){return db['SmsMessage']['find']({'where':{'id':_0x514d65[_0x650a('0xa3')]['id']}})[_0x650a('0x23')](handleEntityNotFound(_0x31dd17,null))[_0x650a('0x23')](function(_0xabf308){if(_0xabf308){return _0xabf308[_0x650a('0xac')](_0x514d65[_0x650a('0xaa')]['ids'],_[_0x650a('0xad')](_0x514d65[_0x650a('0xaa')],[_0x650a('0xae'),'id'])||{});}})[_0x650a('0x23')](respondWithResult(_0x31dd17,null))[_0x650a('0x2f')](handleError(_0x31dd17,null));};exports[_0x650a('0xaf')]=function(_0x709569,_0xbf8c9d,_0xf924fa){var _0x1c90f5={'raw':![],'where':{}};var _0x5bb83e={};var _0x37089b={'count':0x0,'rows':[]};return db[_0x650a('0x8e')][_0x650a('0xb0')]({'where':{'id':_0x709569['params']['id']}})[_0x650a('0x23')](handleEntityNotFound(_0xbf8c9d,null))[_0x650a('0x23')](function(_0x3d0715){if(_0x3d0715){_0x5bb83e[_0x650a('0x34')]=_['keys'](db[_0x650a('0xb1')][_0x650a('0x31')]);_0x5bb83e[_0x650a('0x35')]=_[_0x650a('0x36')](_0x709569[_0x650a('0x35')]);_0x5bb83e['filters']=_[_0x650a('0x37')](_0x5bb83e[_0x650a('0x34')],_0x5bb83e['query']);_0x1c90f5[_0x650a('0x38')]=_[_0x650a('0x37')](_0x5bb83e[_0x650a('0x34')],qs[_0x650a('0x39')](_0x709569[_0x650a('0x35')][_0x650a('0x39')]));_0x1c90f5[_0x650a('0x38')]=_0x1c90f5['attributes']['length']?_0x1c90f5['attributes']:_0x5bb83e['model'];if(!_0x709569[_0x650a('0x35')][_0x650a('0x3b')](_0x650a('0x3c'))){_0x1c90f5['limit']=qs['limit'](_0x709569[_0x650a('0x35')][_0x650a('0x1c')]);_0x1c90f5['offset']=qs[_0x650a('0x3d')](_0x709569[_0x650a('0x35')][_0x650a('0x3d')]);}_0x1c90f5[_0x650a('0x3e')]=qs[_0x650a('0x3f')](_0x709569[_0x650a('0x35')][_0x650a('0x3f')]);_0x1c90f5[_0x650a('0x40')]=qs[_0x650a('0xa4')](_[_0x650a('0xb2')](_0x709569[_0x650a('0x35')],_0x5bb83e[_0x650a('0xa4')]));_0x1c90f5[_0x650a('0x40')][_0x650a('0x9f')]=_0x3d0715['id'];if(_0x709569[_0x650a('0x35')][_0x650a('0x7c')]){_0x1c90f5[_0x650a('0x40')]=_[_0x650a('0xa7')](_0x1c90f5[_0x650a('0x40')],{'$or':_[_0x650a('0x28')](_0x1c90f5['attributes'],function(_0x5e1e2d){var _0x5d3cce={};_0x5d3cce[_0x5e1e2d]={'$like':'%'+_0x709569[_0x650a('0x35')][_0x650a('0x7c')]+'%'};return _0x5d3cce;})});}if(_0x709569[_0x650a('0x35')][_0x650a('0x72')]){var _0x15d6b2=_0x709569['query'][_0x650a('0x72')][_0x650a('0x2c')](',');var _0x4c6c7f={};_0x4c6c7f[_0x15d6b2[0x0]]={'$gte':moment(_0x15d6b2[0x1])[_0x650a('0xb3')](_0x650a('0xb4'))};_0x1c90f5[_0x650a('0x40')]=_[_0x650a('0xa7')](_0x1c90f5[_0x650a('0x40')],_0x4c6c7f);}_0x1c90f5=_[_0x650a('0xa7')]({},_0x1c90f5,_0x709569[_0x650a('0xa8')]);return db['SmsMessage']['count']({'where':_0x1c90f5[_0x650a('0x40')]})[_0x650a('0x23')](function(_0x9a2407){_0x37089b[_0x650a('0x1b')]=_0x9a2407;if(_0x709569[_0x650a('0x35')][_0x650a('0xa5')]){_0x1c90f5[_0x650a('0xa6')]=[{'all':!![]}];}return db['SmsMessage'][_0x650a('0xb5')](_0x1c90f5);})[_0x650a('0x23')](function(_0x2262d7){_0x37089b['rows']=_0x2262d7;return _0x37089b;});}})['then'](respondWithFilteredResult(_0xbf8c9d,_0x1c90f5))['catch'](handleError(_0xbf8c9d,null));};exports['addTags']=function(_0x454cee,_0x4c71b8,_0x4f8982){return db[_0x650a('0x8e')][_0x650a('0x59')]({'where':{'id':_0x454cee['params']['id']}})[_0x650a('0x23')](handleEntityNotFound(_0x4c71b8,null))[_0x650a('0x23')](function(_0xb8cd4f){if(_0xb8cd4f){return _0xb8cd4f['setTags'](_0x454cee[_0x650a('0xaa')][_0x650a('0xae')],_[_0x650a('0xad')](_0x454cee[_0x650a('0xaa')],['ids','id'])||{})['spread'](function(){return db[_0x650a('0xb6')][_0x650a('0xb5')]({'attributes':['id',_0x650a('0x26'),'color'],'where':{'id':_0x454cee[_0x650a('0xaa')][_0x650a('0xae')]}});})[_0x650a('0x23')](function(_0x5a9508){socket['emit'](_0x650a('0xb7'),{'id':Number(_0x454cee[_0x650a('0xa3')]['id']),'tags':_0x5a9508||[]});return{'id':Number(_0x454cee[_0x650a('0xa3')]['id']),'tags':_0x5a9508||[]};});}})['then'](respondWithResult(_0x4c71b8,null))['catch'](handleError(_0x4c71b8,null));};exports[_0x650a('0xb8')]=function(_0x402bf1,_0x503514,_0x264cbe){return db[_0x650a('0x8e')]['find']({'where':{'id':_0x402bf1[_0x650a('0xa3')]['id']}})[_0x650a('0x23')](handleEntityNotFound(_0x503514,null))[_0x650a('0x23')](function(_0x1378a7){if(_0x1378a7){return _0x1378a7[_0x650a('0xb8')](_0x402bf1[_0x650a('0x35')]['ids']);}})[_0x650a('0x23')](respondWithStatusCode(_0x503514,null))[_0x650a('0x2f')](handleError(_0x503514,null));};exports['download']=function(_0xf9ae49,_0x4a0b5d){var _0x5b01da=moment()[_0x650a('0xb9')]()['toString']();var _0x479e1c=path['join'](config[_0x650a('0xba')],_0x650a('0xbb'),_0x650a('0xbc'),'tmp');var _0x439739=path[_0x650a('0xbd')](config[_0x650a('0xba')],_0x650a('0xbb'),_0x650a('0xbc'),'attachments');var _0xfb7e88=path[_0x650a('0xbd')](_0x479e1c,_0x5b01da);var _0x165704=util[_0x650a('0xb3')]('transcript-%d-%s.zip',_0xf9ae49['params']['id'],_0x5b01da);var _0x588d6b=path[_0x650a('0xbd')](_0x479e1c,_0x165704);var _0x227591=[];_0x227591[_0x650a('0x2e')]({'model':db[_0x650a('0x67')],'as':_0x650a('0x67'),'attributes':['id',_0x650a('0x29')],'raw':!![]});_0x227591[_0x650a('0x2e')]({'model':db[_0x650a('0xbe')],'as':'Contact','attributes':['id','firstName',_0x650a('0xbf')],'raw':!![]});var _0x5230ac=[{'model':db[_0x650a('0xb1')],'as':_0x650a('0xc0'),'attributes':['id',_0x650a('0xaa'),_0x650a('0x70'),_0x650a('0xc1'),_0x650a('0xc2'),'read'],'include':_0x227591}];_0x5230ac[_0x650a('0x2e')]({'model':db[_0x650a('0xc3')],'as':_0x650a('0xc4'),'attributes':['id',_0x650a('0x26')]});_0x5230ac[_0x650a('0x2e')]({'model':db[_0x650a('0x67')],'as':'Owner','attributes':['id','fullname']});return db[_0x650a('0x8e')][_0x650a('0x59')]({'where':{'id':_0xf9ae49['params']['id']},'include':_0x5230ac})['then'](handleEntityNotFound(_0x4a0b5d,null))[_0x650a('0x23')](function(_0x30a3d5){if(_0x30a3d5){var _0x1f1d29=_0x30a3d5[_0x650a('0xc5')]({'plain':!![]});fs[_0x650a('0xc6')](_0xfb7e88);var _0x3142eb={'format':'A4','border':'10px','header':{'height':_0x650a('0xc7'),'contents':{'first':_0x650a('0xc8')}},'footer':{'height':_0x650a('0xc9'),'contents':{'default':util[_0x650a('0xb3')](_0x650a('0xca'),util[_0x650a('0xb3')](_0x650a('0xcb'),_0x650a('0xcc'),_0x1f1d29['id']),moment()['format'](_0x650a('0xcd'))[_0x650a('0x8c')]())}}};var _0x2300a5={'channel':'Sms','account':_0x1f1d29[_0x650a('0xc4')]['name'],'agent':_0x1f1d29[_0x650a('0xce')]?_0x1f1d29[_0x650a('0xce')][_0x650a('0x29')]:_0x650a('0xcf'),'createdAt':moment(_0x1f1d29[_0x650a('0x70')])['format'](_0x650a('0xb4'))[_0x650a('0x8c')](),'closedAt':_0x1f1d29[_0x650a('0xd0')]?moment(_0x1f1d29[_0x650a('0xd1')])['format'](_0x650a('0xb4'))[_0x650a('0x8c')]():'','disposition':_0x1f1d29[_0x650a('0xd2')],'messages':_(_0x1f1d29[_0x650a('0xc0')])[_0x650a('0x7c')]({'secret':![]})['map'](function(_0x4b4e61){return{'date':moment(_0x4b4e61[_0x650a('0x70')])[_0x650a('0xb3')](_0x650a('0xb4'))['toString'](),'sender':_0x4b4e61[_0x650a('0xc1')]===_0x650a('0xd3')?_0x4b4e61[_0x650a('0x67')]?_0x4b4e61[_0x650a('0x67')]['fullname']:_0x650a('0xd4'):_0x4b4e61['Contact'][_0x650a('0xd5')]+(_0x4b4e61[_0x650a('0xd6')][_0x650a('0xbf')]?'\x20'+_0x4b4e61['Contact'][_0x650a('0xbf')]:''),'body':_0x4b4e61[_0x650a('0xaa')],'direction':_0x4b4e61['direction']===_0x650a('0xd3')?'A':'C','secret':_0x4b4e61['secret'],'read':_0x4b4e61[_0x650a('0x77')]};})[_0x650a('0x5b')]()};return ejs['renderFile'](path[_0x650a('0xbd')](config['root'],_0x650a('0xbb'),'views',_0x650a('0xd7')),{'interaction':_0x2300a5})[_0x650a('0x23')](function(_0x184c2a){return new BPromise(function(_0x27163d,_0x36419d){pdf[_0x650a('0xa9')](_0x184c2a,_0x3142eb)['toFile'](path[_0x650a('0xbd')](_0xfb7e88,'transcript-'+_0x1f1d29['id']+'-'+_0x5b01da+'.pdf'),function(_0x510d3c,_0x26d146){if(_0x510d3c)return _0x36419d(_0x510d3c);_0x27163d(_0x26d146);});});})[_0x650a('0x23')](function(){return new BPromise(function(_0x107e02,_0x147627){zipdir(_0xfb7e88,{'saveTo':_0x588d6b},function(_0x5dcc18,_0x1b6ef1){if(_0x5dcc18)return _0x147627(_0x5dcc18);return _0x107e02(_0x1b6ef1);});})[_0x650a('0x23')](function(){return new BPromise(function(_0x238471,_0x255ef1){rimraf(_0xfb7e88,function(_0x9a3456){if(_0x9a3456)_0x255ef1(_0x9a3456);return _0x238471();});});})[_0x650a('0x23')](function(){return _0x4a0b5d[_0x650a('0xd8')](_0x588d6b,_0x165704,function(_0x2a0153){if(_0x2a0153){console['log'](_0x650a('0xd9'),_0x2a0153);}else{fs[_0x650a('0xda')](_0x588d6b);}});});});}else{return _0x4a0b5d['sendStatus'](0xc8);}})[_0x650a('0x2f')](handleError(_0x4a0b5d,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index a16b5ba..27cc70b 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 _0x34e8=['events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x2d8691,_0x508608){var _0x18b596=function(_0x129934){while(--_0x129934){_0x2d8691['push'](_0x2d8691['shift']());}};_0x18b596(++_0x508608);}(_0x34e8,0x12c));var _0x834e=function(_0x48be80,_0x1f9942){_0x48be80=_0x48be80-0x0;var _0x114d73=_0x34e8[_0x48be80];return _0x114d73;};'use strict';var EventEmitter=require(_0x834e('0x0'));var SmsInteraction=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var SmsMessage=require(_0x834e('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x834e('0x3')](0x0);var events={'afterCreate':_0x834e('0x4'),'afterUpdate':_0x834e('0x5'),'afterDestroy':_0x834e('0x6')};function emitEvent(_0x289ef2){return function(_0x19a3e0,_0x398bee,_0x4a2018){_0x19a3e0[_0x834e('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e16d2){_0x19a3e0[_0x834e('0x8')](_0x834e('0x9'),_0x3e16d2[_0x834e('0xa')](function(_0x33ea05){return{'id':_0x33ea05['id']};}));return SmsMessage[_0x834e('0xb')]({'where':{'SmsInteractionId':_0x19a3e0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x834e('0xc')](function(_0x1af45a){_0x19a3e0[_0x834e('0x8')](_0x834e('0xd'),_0x1af45a[_0x834e('0xe')]);SmsInteractionEvents[_0x834e('0xf')](_0x289ef2+':'+_0x19a3e0['id'],_0x19a3e0);SmsInteractionEvents[_0x834e('0xf')](_0x289ef2,_0x19a3e0);_0x4a2018(null);})[_0x834e('0x10')](_0x4a2018(null));};}for(var e in events){if(events[_0x834e('0x11')](e)){var event=events[e];SmsInteraction[_0x834e('0x12')](e,emitEvent(event));}}module[_0x834e('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0x6c7b=['getUsers','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','hook','exports','events','SmsMessage','save','update','remove'];(function(_0x4d6d6b,_0x16b622){var _0x52c265=function(_0x2d0fd3){while(--_0x2d0fd3){_0x4d6d6b['push'](_0x4d6d6b['shift']());}};_0x52c265(++_0x16b622);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x4013b1,_0x24bfeb){_0x4013b1=_0x4013b1-0x0;var _0x64a485=_0x6c7b[_0x4013b1];return _0x64a485;};'use strict';var EventEmitter=require(_0xb6c7('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require('../../mysqldb')['db'][_0xb6c7('0x1')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6c7('0x2'),'afterUpdate':_0xb6c7('0x3'),'afterDestroy':_0xb6c7('0x4')};function emitEvent(_0x5857e0){return function(_0x294dc9,_0x290c39,_0xfe3eb9){_0x294dc9[_0xb6c7('0x5')]({'attributes':['id'],'raw':!![]})[_0xb6c7('0x6')](function(_0x5dd47a){_0x294dc9[_0xb6c7('0x7')](_0xb6c7('0x8'),_0x5dd47a[_0xb6c7('0x9')](function(_0x9c88ae){return{'id':_0x9c88ae['id']};}));return SmsMessage[_0xb6c7('0xa')]({'where':{'SmsInteractionId':_0x294dc9['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb6c7('0x6')](function(_0x245016){_0x294dc9[_0xb6c7('0x7')]('unreadMessages',_0x245016['length']);SmsInteractionEvents[_0xb6c7('0xb')](_0x5857e0+':'+_0x294dc9['id'],_0x294dc9);SmsInteractionEvents[_0xb6c7('0xb')](_0x5857e0,_0x294dc9);_0xfe3eb9(null);})[_0xb6c7('0xc')](_0xfe3eb9(null));};}for(var e in events){if(events[_0xb6c7('0xd')](e)){var event=events[e];SmsInteraction[_0xb6c7('0xe')](e,emitEvent(event));}}module[_0xb6c7('0xf')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0c3eb5c..c3d2a6a 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 _0xd8af=['./smsInteraction.attributes','exports','define','sms_interactions','closed','closedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x486acb,_0x532b25){var _0x2233cd=function(_0x2b9ddc){while(--_0x2b9ddc){_0x486acb['push'](_0x486acb['shift']());}};_0x2233cd(++_0x532b25);}(_0xd8af,0x1a6));var _0xfd8a=function(_0x59cade,_0x50b0d2){_0x59cade=_0x59cade-0x0;var _0x40d64a=_0xd8af[_0x59cade];return _0x40d64a;};'use strict';var _=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var logger=require(_0xfd8a('0x2'))(_0xfd8a('0x3'));var moment=require(_0xfd8a('0x4'));var BPromise=require(_0xfd8a('0x5'));var rp=require(_0xfd8a('0x6'));var fs=require('fs');var path=require(_0xfd8a('0x7'));var rimraf=require(_0xfd8a('0x8'));var config=require(_0xfd8a('0x9'));var attributes=require(_0xfd8a('0xa'));module[_0xfd8a('0xb')]=function(_0x5bc0eb,_0x1031f1){return _0x5bc0eb[_0xfd8a('0xc')]('SmsInteraction',attributes,{'tableName':_0xfd8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42c1ef,_0x36ad3e,_0x86eda7){if(_0x42c1ef['changed'](_0xfd8a('0xe'))){_0x42c1ef[_0xfd8a('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x86eda7(null,_0x42c1ef);}}});}; \ No newline at end of file +var _0xf806=['define','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes','exports'];(function(_0x4df34d,_0x4f4e5f){var _0x52f574=function(_0x3be3e9){while(--_0x3be3e9){_0x4df34d['push'](_0x4df34d['shift']());}};_0x52f574(++_0x4f4e5f);}(_0xf806,0xb6));var _0x6f80=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf806[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6f80('0x0'));var util=require('util');var logger=require(_0x6f80('0x1'))(_0x6f80('0x2'));var moment=require(_0x6f80('0x3'));var BPromise=require(_0x6f80('0x4'));var rp=require(_0x6f80('0x5'));var fs=require('fs');var path=require(_0x6f80('0x6'));var rimraf=require(_0x6f80('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f80('0x8'));module[_0x6f80('0x9')]=function(_0x379402,_0x5e5313){return _0x379402[_0x6f80('0xa')]('SmsInteraction',attributes,{'tableName':_0x6f80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5458cc,_0x5db525,_0x4f0578){if(_0x5458cc[_0x6f80('0xc')](_0x6f80('0xd'))){_0x5458cc[_0x6f80('0xe')]=moment()['format'](_0x6f80('0xf'));}_0x4f0578(null,_0x5458cc);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index f4d01b9..33d2809 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 _0x2bfd=['update','body','options','attributes','AddTagsToSmsInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction'];(function(_0x3e996b,_0x238f14){var _0xdb59cb=function(_0x37b84e){while(--_0x37b84e){_0x3e996b['push'](_0x3e996b['shift']());}};_0xdb59cb(++_0x238f14);}(_0x2bfd,0x115));var _0xd2bf=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x2bfd[_0x43b08];return _0x5e05f4;};'use strict';var _=require(_0xd2bf('0x0'));var util=require(_0xd2bf('0x1'));var moment=require(_0xd2bf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2bf('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd2bf('0x5'));var jayson=require(_0xd2bf('0x6'));var client=jayson[_0xd2bf('0x7')][_0xd2bf('0x8')]({'port':0x232a});config[_0xd2bf('0x9')]=_[_0xd2bf('0xa')](config[_0xd2bf('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd2bf('0xb'))(new Redis(config[_0xd2bf('0x9')]));require(_0xd2bf('0xc'))['register'](socket);function respondWithRpcPromise(_0x3c0519,_0x28bac2,_0x1af14b){return new BPromise(function(_0xb7b351,_0x5c92e8){return client[_0xd2bf('0xd')](_0x3c0519,_0x1af14b)[_0xd2bf('0xe')](function(_0x147110){logger['info'](_0xd2bf('0xf'),_0x28bac2,_0xd2bf('0x10'));logger[_0xd2bf('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x28bac2,_0xd2bf('0x10'),JSON[_0xd2bf('0x12')](_0x147110));if(_0x147110['error']){if(_0x147110[_0xd2bf('0x13')][_0xd2bf('0x14')]===0x1f4){logger[_0xd2bf('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x28bac2,_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);return _0x5c92e8(_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);}logger[_0xd2bf('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x28bac2,_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);return _0xb7b351(_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);}else{logger[_0xd2bf('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x28bac2,_0xd2bf('0x10'));_0xb7b351(_0x147110[_0xd2bf('0x17')]['message']);}})[_0xd2bf('0x18')](function(_0x1fdbdc){logger[_0xd2bf('0x13')](_0xd2bf('0xf'),_0x28bac2,_0x1fdbdc);_0x5c92e8(_0x1fdbdc);});});}exports[_0xd2bf('0x19')]=function(_0x3a4f3b){var _0x421588=this;return new Promise(function(_0x4bd6c8,_0xed7376){return db[_0xd2bf('0x1a')][_0xd2bf('0x1b')](_0x3a4f3b[_0xd2bf('0x1c')],{'raw':_0x3a4f3b[_0xd2bf('0x1d')]?_0x3a4f3b[_0xd2bf('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4f3b['options']?_0x3a4f3b[_0xd2bf('0x1d')]['where']||null:null,'attributes':_0x3a4f3b[_0xd2bf('0x1d')]?_0x3a4f3b[_0xd2bf('0x1d')][_0xd2bf('0x1e')]||null:null,'limit':_0x3a4f3b['options']?_0x3a4f3b[_0xd2bf('0x1d')]['limit']||null:null})[_0xd2bf('0xe')](function(_0x50fc79){logger[_0xd2bf('0x16')](_0xd2bf('0x19'),_0x3a4f3b);logger['debug'](_0xd2bf('0x19'),_0x3a4f3b,JSON[_0xd2bf('0x12')](_0x50fc79));_0x4bd6c8(_0x50fc79);})[_0xd2bf('0x18')](function(_0xeeb3d4){logger[_0xd2bf('0x13')](_0xd2bf('0x19'),_0xeeb3d4['message'],_0x3a4f3b);_0xed7376(_0x421588[_0xd2bf('0x13')](0x1f4,_0xeeb3d4['message']));});});};exports[_0xd2bf('0x1f')]=function(_0x312fa0){return new Promise(function(_0x37ab52,_0x5751b1){return db[_0xd2bf('0x1a')][_0xd2bf('0x20')]({'where':_0x312fa0[_0xd2bf('0x1d')]?_0x312fa0[_0xd2bf('0x1d')][_0xd2bf('0x21')]||null:null})['then'](function(_0x457cfc){if(_0x457cfc){return _0x457cfc[_0xd2bf('0x22')](_0x312fa0[_0xd2bf('0x1c')][_0xd2bf('0x23')],_[_0xd2bf('0x24')](_0x312fa0[_0xd2bf('0x1c')],[_0xd2bf('0x23'),'id'])||{});}})['spread'](function(_0x569b41){logger['info'](_0xd2bf('0x25'),_0x312fa0);logger[_0xd2bf('0x11')]('AddTags',_0x312fa0,JSON['stringify'](_0x569b41));_0x37ab52(_0x569b41);})['catch'](function(_0x504c0c){logger[_0xd2bf('0x13')](_0xd2bf('0x25'),_0x504c0c[_0xd2bf('0x15')],_0x312fa0);_0x5751b1(_this[_0xd2bf('0x13')](0x1f4,_0x504c0c[_0xd2bf('0x15')]));});});}; \ No newline at end of file +var _0xbe4c=['message','catch','UpdateSmsInteraction','options','raw','where','stringify','AddTagsToSmsInteraction','find','addTags','omit','ids','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0xbe4c,0x146));var _0xcbe4=function(_0x2ec4af,_0x2ab30e){_0x2ec4af=_0x2ec4af-0x0;var _0x314980=_0xbe4c[_0x2ec4af];return _0x314980;};'use strict';var _=require(_0xcbe4('0x0'));var util=require(_0xcbe4('0x1'));var moment=require(_0xcbe4('0x2'));var BPromise=require(_0xcbe4('0x3'));var rs=require(_0xcbe4('0x4'));var fs=require('fs');var Redis=require(_0xcbe4('0x5'));var db=require(_0xcbe4('0x6'))['db'];var utils=require(_0xcbe4('0x7'));var logger=require('../../config/logger')(_0xcbe4('0x8'));var config=require(_0xcbe4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcbe4('0xa')][_0xcbe4('0xb')]({'port':0x232a});config[_0xcbe4('0xc')]=_['defaults'](config[_0xcbe4('0xc')],{'host':_0xcbe4('0xd'),'port':0x18eb});var socket=require(_0xcbe4('0xe'))(new Redis(config[_0xcbe4('0xc')]));require(_0xcbe4('0xf'))[_0xcbe4('0x10')](socket);function respondWithRpcPromise(_0x59d7c1,_0x4c47f3,_0xb1cdc5){return new BPromise(function(_0x7252f9,_0x14a2e1){return client[_0xcbe4('0x11')](_0x59d7c1,_0xb1cdc5)[_0xcbe4('0x12')](function(_0x3967f6){logger[_0xcbe4('0x13')](_0xcbe4('0x14'),_0x4c47f3,_0xcbe4('0x15'));logger['debug'](_0xcbe4('0x16'),_0x4c47f3,_0xcbe4('0x15'),JSON['stringify'](_0x3967f6));if(_0x3967f6['error']){if(_0x3967f6[_0xcbe4('0x17')][_0xcbe4('0x18')]===0x1f4){logger[_0xcbe4('0x17')](_0xcbe4('0x14'),_0x4c47f3,_0x3967f6['error'][_0xcbe4('0x19')]);return _0x14a2e1(_0x3967f6['error'][_0xcbe4('0x19')]);}logger[_0xcbe4('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x4c47f3,_0x3967f6['error'][_0xcbe4('0x19')]);return _0x7252f9(_0x3967f6['error'][_0xcbe4('0x19')]);}else{logger[_0xcbe4('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x4c47f3,_0xcbe4('0x15'));_0x7252f9(_0x3967f6['result']['message']);}})[_0xcbe4('0x1a')](function(_0x5535a1){logger[_0xcbe4('0x17')](_0xcbe4('0x14'),_0x4c47f3,_0x5535a1);_0x14a2e1(_0x5535a1);});});}exports[_0xcbe4('0x1b')]=function(_0x42b6de){var _0x8c001=this;return new Promise(function(_0x5db3d5,_0x285709){return db['SmsInteraction']['update'](_0x42b6de['body'],{'raw':_0x42b6de[_0xcbe4('0x1c')]?_0x42b6de['options'][_0xcbe4('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42b6de[_0xcbe4('0x1c')]?_0x42b6de[_0xcbe4('0x1c')][_0xcbe4('0x1e')]||null:null,'attributes':_0x42b6de[_0xcbe4('0x1c')]?_0x42b6de['options']['attributes']||null:null,'limit':_0x42b6de[_0xcbe4('0x1c')]?_0x42b6de['options']['limit']||null:null})[_0xcbe4('0x12')](function(_0x15f500){logger[_0xcbe4('0x13')](_0xcbe4('0x1b'),_0x42b6de);logger['debug'](_0xcbe4('0x1b'),_0x42b6de,JSON[_0xcbe4('0x1f')](_0x15f500));_0x5db3d5(_0x15f500);})[_0xcbe4('0x1a')](function(_0x36f1c6){logger[_0xcbe4('0x17')](_0xcbe4('0x1b'),_0x36f1c6[_0xcbe4('0x19')],_0x42b6de);_0x285709(_0x8c001[_0xcbe4('0x17')](0x1f4,_0x36f1c6[_0xcbe4('0x19')]));});});};exports[_0xcbe4('0x20')]=function(_0x382d17){return new Promise(function(_0x1bcdf8,_0xed7406){return db['SmsInteraction'][_0xcbe4('0x21')]({'where':_0x382d17['options']?_0x382d17[_0xcbe4('0x1c')][_0xcbe4('0x1e')]||null:null})[_0xcbe4('0x12')](function(_0x581c27){if(_0x581c27){return _0x581c27[_0xcbe4('0x22')](_0x382d17['body']['ids'],_[_0xcbe4('0x23')](_0x382d17['body'],[_0xcbe4('0x24'),'id'])||{});}})['spread'](function(_0x36b082){logger[_0xcbe4('0x13')](_0xcbe4('0x25'),_0x382d17);logger[_0xcbe4('0x26')](_0xcbe4('0x25'),_0x382d17,JSON['stringify'](_0x36b082));_0x1bcdf8(_0x36b082);})['catch'](function(_0x32033c){logger[_0xcbe4('0x17')](_0xcbe4('0x25'),_0x32033c[_0xcbe4('0x19')],_0x382d17);_0xed7406(_this[_0xcbe4('0x17')](0x1f4,_0x32033c[_0xcbe4('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index f2747ff..028e098 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 _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x292183,_0xd1a505){var _0x35017e=function(_0x1225e1){while(--_0x1225e1){_0x292183['push'](_0x292183['shift']());}};_0x35017e(++_0xd1a505);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}}; \ No newline at end of file +var _0xd8b0=['save','emit','./smsInteraction.events'];(function(_0x1e98e0,_0xc530c0){var _0x7bf267=function(_0x2d4ee0){while(--_0x2d4ee0){_0x1e98e0['push'](_0x1e98e0['shift']());}};_0x7bf267(++_0xc530c0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var SmsInteractionEvents=require(_0x0d8b('0x0'));var events=[_0x0d8b('0x1'),'remove','update'];function createListener(_0x4b72b0,_0x3ff8df){return function(_0x5b9b89){_0x3ff8df[_0x0d8b('0x2')](_0x4b72b0,_0x5b9b89);};}function removeListener(_0x364286,_0x8196ed){return function(){SmsInteractionEvents['removeListener'](_0x364286,_0x8196ed);};}exports['register']=function(_0x3f8b6f){for(var _0x227c63=0x0,_0x39f43a=events['length'];_0x227c63<_0x39f43a;_0x227c63++){var _0x413284=events[_0x227c63];var _0x284169=createListener('smsInteraction:'+_0x413284,_0x3f8b6f);SmsInteractionEvents['on'](_0x413284,_0x284169);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 34cfa73..651deb0 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 _0xb1d2=['/:id','post','tracked','sms','smsmessage:create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','/describe','describe','get'];(function(_0x109285,_0x30a3e9){var _0x59dab4=function(_0xab0e25){while(--_0xab0e25){_0x109285['push'](_0x109285['shift']());}};_0x59dab4(++_0x30a3e9);}(_0xb1d2,0xdf));var _0x2b1d=function(_0x175f9d,_0x3cbaab){_0x175f9d=_0x175f9d-0x0;var _0x1698dc=_0xb1d2[_0x175f9d];return _0x1698dc;};'use strict';var multer=require(_0x2b1d('0x0'));var util=require('util');var path=require(_0x2b1d('0x1'));var timeout=require(_0x2b1d('0x2'));var express=require(_0x2b1d('0x3'));var router=express['Router']();var auth=require(_0x2b1d('0x4'));var interaction=require(_0x2b1d('0x5'));var config=require('../../config/environment');var controller=require(_0x2b1d('0x6'));router['get']('/',auth[_0x2b1d('0x7')](),controller['index']);router['get'](_0x2b1d('0x8'),auth[_0x2b1d('0x7')](),controller[_0x2b1d('0x9')]);router[_0x2b1d('0xa')](_0x2b1d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2b1d('0xc')]('/',auth[_0x2b1d('0x7')](),interaction[_0x2b1d('0xd')](_0x2b1d('0xe'),_0x2b1d('0xf')),controller['create']);router['post']('/:id/status',controller[_0x2b1d('0x10')]);router[_0x2b1d('0x11')](_0x2b1d('0xb'),auth['isAuthenticated'](),controller[_0x2b1d('0x12')]);router[_0x2b1d('0x11')](_0x2b1d('0x13'),auth['isAuthenticated'](),controller[_0x2b1d('0x14')]);router[_0x2b1d('0x11')](_0x2b1d('0x15'),auth[_0x2b1d('0x7')](),controller[_0x2b1d('0x16')]);router[_0x2b1d('0x17')](_0x2b1d('0xb'),auth[_0x2b1d('0x7')](),controller[_0x2b1d('0x18')]);module[_0x2b1d('0x19')]=router; \ No newline at end of file +var _0x17b6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/describe','describe','/:id','isAuthenticated','sms','smsmessage:create','post','status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer'];(function(_0x5e5218,_0x4226ef){var _0x2dcd35=function(_0x11049f){while(--_0x11049f){_0x5e5218['push'](_0x5e5218['shift']());}};_0x2dcd35(++_0x4226ef);}(_0x17b6,0xb5));var _0x617b=function(_0x147c59,_0x43059b){_0x147c59=_0x147c59-0x0;var _0x78c4bf=_0x17b6[_0x147c59];return _0x78c4bf;};'use strict';var multer=require(_0x617b('0x0'));var util=require('util');var path=require(_0x617b('0x1'));var timeout=require(_0x617b('0x2'));var express=require(_0x617b('0x3'));var router=express[_0x617b('0x4')]();var auth=require(_0x617b('0x5'));var interaction=require(_0x617b('0x6'));var config=require(_0x617b('0x7'));var controller=require('./smsMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x617b('0x8')]);router[_0x617b('0x9')](_0x617b('0xa'),auth['isAuthenticated'](),controller[_0x617b('0xb')]);router[_0x617b('0x9')](_0x617b('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x617b('0xd')](),interaction['tracked'](_0x617b('0xe'),_0x617b('0xf')),controller['create']);router[_0x617b('0x10')]('/:id/status',controller[_0x617b('0x11')]);router[_0x617b('0x12')](_0x617b('0xc'),auth[_0x617b('0xd')](),controller[_0x617b('0x13')]);router[_0x617b('0x12')](_0x617b('0x14'),auth[_0x617b('0xd')](),controller[_0x617b('0x15')]);router[_0x617b('0x12')](_0x617b('0x16'),auth[_0x617b('0xd')](),controller['reject']);router[_0x617b('0x17')]('/:id',auth[_0x617b('0xd')](),controller[_0x617b('0x18')]);module[_0x617b('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 618c13c..583ff4c 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 _0x4c8d=['STRING','DATE','exports','TEXT','medium','BOOLEAN','out'];(function(_0x1a96d6,_0x2ace51){var _0x505671=function(_0x567183){while(--_0x567183){_0x1a96d6['push'](_0x1a96d6['shift']());}};_0x505671(++_0x2ace51);}(_0x4c8d,0xf7));var _0xd4c8=function(_0x348ac0,_0x372fc1){_0x348ac0=_0x348ac0-0x0;var _0x56406f=_0x4c8d[_0x348ac0];return _0x56406f;};'use strict';var Sequelize=require('sequelize');module[_0xd4c8('0x0')]={'body':{'type':Sequelize[_0xd4c8('0x1')](_0xd4c8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd4c8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd4c8('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd4c8('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xd4c8('0x6')]},'secret':{'type':Sequelize[_0xd4c8('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xffb3=['out','STRING','DATE','sequelize','medium','BOOLEAN','ENUM'];(function(_0x39e134,_0xd37a5d){var _0x3239a7=function(_0x597cc7){while(--_0x597cc7){_0x39e134['push'](_0x39e134['shift']());}};_0x3239a7(++_0xd37a5d);}(_0xffb3,0xb2));var _0x3ffb=function(_0x212d65,_0x2b6240){_0x212d65=_0x212d65-0x0;var _0x5452ab=_0xffb3[_0x212d65];return _0x5452ab;};'use strict';var Sequelize=require(_0x3ffb('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x3ffb('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x3ffb('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3ffb('0x3')]('in',_0x3ffb('0x4')),'defaultValue':_0x3ffb('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3ffb('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x3ffb('0x6')]},'secret':{'type':Sequelize[_0x3ffb('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8adbdd7..1f1a10f 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 _0x245b=['interaction','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','reject','sms','agent','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','delivered','Status','inspect','infobip','results','groupName','DELIVERED','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./smsMessage.socket','jayson/promise','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','save','update','destroy','end','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2464c7,_0xed8be){var _0x5a52a7=function(_0xeb1a55){while(--_0xeb1a55){_0x2464c7['push'](_0x2464c7['shift']());}};_0x5a52a7(++_0xed8be);}(_0x245b,0xa8));var _0xb245=function(_0x5b8973,_0xacb7e4){_0x5b8973=_0x5b8973-0x0;var _0x2a4cab=_0x245b[_0x5b8973];return _0x2a4cab;};'use strict';var pdf=require(_0xb245('0x0'));var emlformat=require(_0xb245('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb245('0x2'));var jsonpatch=require(_0xb245('0x3'));var rp=require(_0xb245('0x4'));var moment=require(_0xb245('0x5'));var BPromise=require(_0xb245('0x6'));var Mustache=require('mustache');var util=require(_0xb245('0x7'));var path=require(_0xb245('0x8'));var sox=require('sox');var csv=require(_0xb245('0x9'));var ejs=require(_0xb245('0xa'));var fs=require('fs');var _=require(_0xb245('0xb'));var squel=require(_0xb245('0xc'));var crypto=require('crypto');var jsforce=require(_0xb245('0xd'));var deskjs=require(_0xb245('0xe'));var toCsv=require(_0xb245('0x9'));var querystring=require('querystring');var Papa=require(_0xb245('0xf'));var Redis=require(_0xb245('0x10'));var authService=require(_0xb245('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb245('0x12'));var hardwareService=require(_0xb245('0x13'));var logger=require(_0xb245('0x14'))(_0xb245('0x15'));var utils=require('../../config/utils');var config=require(_0xb245('0x16'));var db=require(_0xb245('0x17'))['db'];config[_0xb245('0x18')]=_['defaults'](config['redis'],{'host':_0xb245('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb245('0x1a'))['register'](socket);var jayson=require(_0xb245('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xb245('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d5f51,_0x5d3d9b,_0x40aec){if(_0x40aec){var _0x53cb61=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53cb61[_0xb245('0x1d')](_0x5d3d9b)){return _0x2d5f51;}else{throw new db['Sequelize'][(_0xb245('0x1e'))](_0xb245('0x1f'));}}else{return _0x2d5f51;}}function respondWithRpcPromise(_0x58758b,_0x779e8a,_0x27a325,_0x36453d){return new BPromise(function(_0x18612c,_0x31c3b9){var _0x930457=_0x36453d||client;return _0x930457[_0xb245('0x20')](_0x58758b,_0x27a325)[_0xb245('0x21')](function(_0x854c15){logger[_0xb245('0x22')](_0xb245('0x23'),_0x779e8a,_0xb245('0x24'));logger['debug'](_0xb245('0x25'),_0x779e8a,_0xb245('0x24'),JSON[_0xb245('0x26')](_0x854c15));if(_0x854c15['error']){if(_0x854c15[_0xb245('0x27')][_0xb245('0x28')]===0x1f4){logger['error'](_0xb245('0x23'),_0x779e8a,_0x854c15['error'][_0xb245('0x29')]);return _0x31c3b9(_0x854c15[_0xb245('0x27')]['message']);}logger[_0xb245('0x27')](_0xb245('0x23'),_0x779e8a,_0x854c15[_0xb245('0x27')]['message']);return _0x18612c(_0x854c15['error']['message']);}else{logger['info'](_0xb245('0x23'),_0x779e8a,_0xb245('0x24'));_0x18612c(_0x854c15[_0xb245('0x2a')][_0xb245('0x29')]);}})[_0xb245('0x2b')](function(_0x5c1c7b){logger[_0xb245('0x27')](_0xb245('0x23'),_0x779e8a,_0x5c1c7b);_0x31c3b9(_0x5c1c7b);});});}function respondWithStatusCode(_0x2abeb6,_0x531469){_0x531469=_0x531469||0xcc;return function(_0x3021ca){if(_0x3021ca){return _0x2abeb6[_0xb245('0x2c')](_0x531469);}return _0x2abeb6['status'](_0x531469)['end']();};}function respondWithResult(_0x418eda,_0x377d24){_0x377d24=_0x377d24||0xc8;return function(_0x4cf583){if(_0x4cf583){return _0x418eda[_0xb245('0x2d')](_0x377d24)[_0xb245('0x2e')](_0x4cf583);}};}function respondWithFilteredResult(_0x1f4d3c,_0x5103ef){return function(_0xf4c6bc){if(_0xf4c6bc){var _0x248ea0=_0xf4c6bc[_0xb245('0x2f')],_0x2db8a2=_0x5103ef[_0xb245('0x30')],_0x146e3c=_0x5103ef['offset']+_0x5103ef[_0xb245('0x31')],_0x310021;if(_0x146e3c>=_0x248ea0){_0x146e3c=_0x248ea0;_0x310021=0xc8;}else{_0x310021=0xce;}_0x1f4d3c[_0xb245('0x2d')](_0x310021);return _0x1f4d3c[_0xb245('0x32')]('Content-Range',_0x2db8a2+'-'+_0x146e3c+'/'+_0x248ea0)[_0xb245('0x2e')](_0xf4c6bc);}return null;};}function patchUpdates(_0x3d24bf){return function(_0x41edfb){try{jsonpatch['apply'](_0x41edfb,_0x3d24bf,!![]);}catch(_0x9f8d9e){return BPromise['reject'](_0x9f8d9e);}return _0x41edfb[_0xb245('0x33')]();};}function saveUpdates(_0x1e93f0,_0x5a5207){return function(_0x5af540){if(_0x5af540){return _0x5af540[_0xb245('0x34')](_0x1e93f0)[_0xb245('0x21')](function(_0x5cb981){return _0x5cb981;});}return null;};}function removeEntity(_0x14e234,_0x4450f4){return function(_0xc28947){if(_0xc28947){return _0xc28947[_0xb245('0x35')]()['then'](function(){_0x14e234[_0xb245('0x2d')](0xcc)[_0xb245('0x36')]();});}};}function handleEntityNotFound(_0x146d7c,_0x510c05){return function(_0x209184){if(!_0x209184){_0x146d7c['sendStatus'](0x194);}return _0x209184;};}function handleError(_0x34d2a0,_0xc215f3){_0xc215f3=_0xc215f3||0x1f4;return function(_0x523dca){logger['error'](_0x523dca['stack']);if(_0x523dca['name']){delete _0x523dca[_0xb245('0x37')];}_0x34d2a0['status'](_0xc215f3)[_0xb245('0x38')](_0x523dca);};}exports[_0xb245('0x39')]=function(_0x344ee7,_0x5816ba){var _0x56a3f8={},_0x782589={},_0x3811fe={'count':0x0,'rows':[]};var _0x5a2b3e=_['map'](db[_0xb245('0x3a')][_0xb245('0x3b')],function(_0x9ac08){return{'name':_0x9ac08[_0xb245('0x3c')],'type':_0x9ac08[_0xb245('0x3d')][_0xb245('0x3e')]};});_0x782589[_0xb245('0x3f')]=_[_0xb245('0x40')](_0x5a2b3e,_0xb245('0x37'));_0x782589[_0xb245('0x41')]=_[_0xb245('0x42')](_0x344ee7['query']);_0x782589[_0xb245('0x43')]=_[_0xb245('0x44')](_0x782589['model'],_0x782589[_0xb245('0x41')]);_0x56a3f8[_0xb245('0x45')]=_[_0xb245('0x44')](_0x782589[_0xb245('0x3f')],qs[_0xb245('0x46')](_0x344ee7[_0xb245('0x41')][_0xb245('0x46')]));_0x56a3f8[_0xb245('0x45')]=_0x56a3f8[_0xb245('0x45')][_0xb245('0x47')]?_0x56a3f8[_0xb245('0x45')]:_0x782589[_0xb245('0x3f')];if(!_0x344ee7[_0xb245('0x41')][_0xb245('0x48')]('nolimit')){_0x56a3f8[_0xb245('0x31')]=qs[_0xb245('0x31')](_0x344ee7[_0xb245('0x41')]['limit']);_0x56a3f8[_0xb245('0x30')]=qs[_0xb245('0x30')](_0x344ee7[_0xb245('0x41')][_0xb245('0x30')]);}_0x56a3f8[_0xb245('0x49')]=qs[_0xb245('0x4a')](_0x344ee7[_0xb245('0x41')][_0xb245('0x4a')]);_0x56a3f8['where']=qs['filters'](_[_0xb245('0x4b')](_0x344ee7[_0xb245('0x41')],_0x782589[_0xb245('0x43')]));if(_0x344ee7[_0xb245('0x41')]['filter']){_0x56a3f8[_0xb245('0x4c')]=_[_0xb245('0x4d')](_0x56a3f8['where'],{'$or':_[_0xb245('0x40')](_0x5a2b3e,function(_0xb88663){if(_0xb88663[_0xb245('0x3d')]!=='VIRTUAL'){var _0x578eb4={};_0x578eb4[_0xb88663[_0xb245('0x37')]]={'$like':'%'+_0x344ee7[_0xb245('0x41')][_0xb245('0x4e')]+'%'};return _0x578eb4;}})});}_0x56a3f8=_['merge']({},_0x56a3f8,_0x344ee7[_0xb245('0x4f')]);var _0x4ae3d7={'where':_0x56a3f8['where']};return db[_0xb245('0x3a')][_0xb245('0x2f')](_0x4ae3d7)[_0xb245('0x21')](function(_0x20341f){_0x3811fe['count']=_0x20341f;if(_0x344ee7['query'][_0xb245('0x50')]){_0x56a3f8[_0xb245('0x51')]=[{'all':!![]}];}return db[_0xb245('0x3a')][_0xb245('0x52')](_0x56a3f8);})['then'](function(_0x1e17ec){_0x3811fe[_0xb245('0x53')]=_0x1e17ec;return _0x3811fe;})[_0xb245('0x21')](respondWithFilteredResult(_0x5816ba,_0x56a3f8))[_0xb245('0x2b')](handleError(_0x5816ba,null));};exports[_0xb245('0x54')]=function(_0x11a72b,_0x4c3c1a){var _0x24c8fb={'raw':!![],'where':{'id':_0x11a72b[_0xb245('0x55')]['id']}},_0x1e5f1b={};_0x1e5f1b[_0xb245('0x3f')]=_[_0xb245('0x42')](db['SmsMessage']['rawAttributes']);_0x1e5f1b[_0xb245('0x41')]=_[_0xb245('0x42')](_0x11a72b[_0xb245('0x41')]);_0x1e5f1b[_0xb245('0x43')]=_[_0xb245('0x44')](_0x1e5f1b['model'],_0x1e5f1b[_0xb245('0x41')]);_0x24c8fb[_0xb245('0x45')]=_[_0xb245('0x44')](_0x1e5f1b[_0xb245('0x3f')],qs[_0xb245('0x46')](_0x11a72b[_0xb245('0x41')][_0xb245('0x46')]));_0x24c8fb['attributes']=_0x24c8fb[_0xb245('0x45')]['length']?_0x24c8fb[_0xb245('0x45')]:_0x1e5f1b[_0xb245('0x3f')];if(_0x11a72b[_0xb245('0x41')][_0xb245('0x50')]){_0x24c8fb[_0xb245('0x51')]=[{'all':!![]}];}_0x24c8fb=_['merge']({},_0x24c8fb,_0x11a72b[_0xb245('0x4f')]);return db[_0xb245('0x3a')]['find'](_0x24c8fb)['then'](handleEntityNotFound(_0x4c3c1a,null))[_0xb245('0x21')](respondWithResult(_0x4c3c1a,null))[_0xb245('0x2b')](handleError(_0x4c3c1a,null));};exports[_0xb245('0x56')]=function(_0x2cb372,_0x1a7b73){return db[_0xb245('0x3a')][_0xb245('0x56')](_0x2cb372[_0xb245('0x57')],{})['then'](respondWithResult(_0x1a7b73,0xc9))[_0xb245('0x2b')](handleError(_0x1a7b73,null));};exports['update']=function(_0x355cb4,_0x870d95){if(_0x355cb4['body']['id']){delete _0x355cb4[_0xb245('0x57')]['id'];}return db[_0xb245('0x3a')][_0xb245('0x58')]({'where':{'id':_0x355cb4[_0xb245('0x55')]['id']}})[_0xb245('0x21')](handleEntityNotFound(_0x870d95,null))[_0xb245('0x21')](saveUpdates(_0x355cb4[_0xb245('0x57')],null))[_0xb245('0x21')](respondWithResult(_0x870d95,null))['catch'](handleError(_0x870d95,null));};exports[_0xb245('0x35')]=function(_0x3956df,_0x1e3983){return db[_0xb245('0x3a')][_0xb245('0x58')]({'where':{'id':_0x3956df[_0xb245('0x55')]['id']}})[_0xb245('0x21')](handleEntityNotFound(_0x1e3983,null))[_0xb245('0x21')](removeEntity(_0x1e3983,null))[_0xb245('0x2b')](handleError(_0x1e3983,null));};exports[_0xb245('0x59')]=function(_0x4d1327,_0x609892){return db[_0xb245('0x3a')][_0xb245('0x59')]()[_0xb245('0x21')](respondWithResult(_0x609892,null))['catch'](handleError(_0x609892,null));};var interaction_log=require(_0xb245('0x14'))(_0xb245('0x5a'));exports[_0xb245('0x5b')]=function(_0xd91951,_0x10f2e5,_0x4866b6){var _0x59ec86={'channel':'sms'};if(_0xd91951['body']['id']){delete _0xd91951[_0xb245('0x57')]['id'];}_0xd91951[_0xb245('0x57')]['read']=!![];_0xd91951['body'][_0xb245('0x5c')]=moment()[_0xb245('0x5d')](_0xb245('0x5e'));_0xd91951['body']['UserId']=_0xd91951['body'][_0xb245('0x5f')]||_0xd91951[_0xb245('0x60')]['id'];return db['SmsMessage'][_0xb245('0x58')]({'where':{'id':_0xd91951[_0xb245('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xb245('0x61')],'as':_0xb245('0x62')}]})[_0xb245('0x21')](handleEntityNotFound(_0x10f2e5,null))[_0xb245('0x21')](saveUpdates(_0xd91951[_0xb245('0x57')],null))[_0xb245('0x21')](function(_0x75f2c0){if(_0x75f2c0){_0x59ec86[_0xb245('0x29')]=_0x75f2c0[_0xb245('0x63')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x75f2c0['SmsInteractionId']}});}return null;})[_0xb245('0x21')](handleEntityNotFound(_0x10f2e5,null))[_0xb245('0x21')](function(_0x3e59ad){if(_0x3e59ad){return _0x3e59ad[_0xb245('0x34')]({'UserId':_0xd91951[_0xb245('0x57')][_0xb245('0x5f')],'read1stAt':_[_0xb245('0x64')](_0x3e59ad['read1stAt'])?moment()['format'](_0xb245('0x5e')):undefined});}return null;})[_0xb245('0x21')](function(_0x1ebcdb){if(_0x1ebcdb){_0x59ec86['interaction']=_0x1ebcdb[_0xb245('0x63')]({'plain':!![]});interaction_log[_0xb245('0x22')](_0xb245('0x65'),_0xd91951[_0xb245('0x60')]['id'],_0xd91951[_0xb245('0x60')][_0xb245('0x37')],_0xd91951[_0xb245('0x60')]['role'],_0x59ec86[_0xb245('0x66')]['id'],_0xd91951[_0xb245('0x57')]?JSON['stringify'](_0xd91951[_0xb245('0x57')]):_0xb245('0x67'));return respondWithRpcPromise(_0xb245('0x68'),_0xb245('0x69'),_0x59ec86);}return null;})[_0xb245('0x21')](function(_0x4f9554){if(_0x4f9554){if(_0xd91951[_0xb245('0x57')][_0xb245('0x6a')]){_0x59ec86['message']['interface']=util[_0xb245('0x5d')](_0xb245('0x6b'),_0xd91951[_0xb245('0x60')][_0xb245('0x37')]);_0x59ec86[_0xb245('0x29')][_0xb245('0x6c')]=_0x59ec86[_0xb245('0x6c')];_0x59ec86['message']['event']=_0xb245('0x5b');return respondWithRpcPromise(_0xb245('0x6d'),_0xb245('0x6d'),{'event':'acceptmessage','message':_0x59ec86[_0xb245('0x29')]},client9002)[_0xb245('0x21')](function(){return _0x59ec86;});}return _0x59ec86;}return null;})[_0xb245('0x21')](respondWithResult(_0x10f2e5,null))[_0xb245('0x2b')](handleError(_0x10f2e5,null));};var interaction_log=require(_0xb245('0x14'))(_0xb245('0x5a'));exports[_0xb245('0x6e')]=function(_0x58f58d,_0x4b242b,_0x216000){var _0xb94e2e={'agent':{},'channel':_0xb245('0x6f')};if(_0x58f58d[_0xb245('0x57')]['id']){delete _0x58f58d[_0xb245('0x57')]['id'];}_0x58f58d[_0xb245('0x57')][_0xb245('0x5f')]=_0x58f58d[_0xb245('0x57')]['UserId']||_0x58f58d[_0xb245('0x60')]['id'];_0xb94e2e[_0xb245('0x70')]['id']=_0x58f58d[_0xb245('0x57')][_0xb245('0x5f')];return db[_0xb245('0x3a')]['find']({'where':{'id':_0x58f58d[_0xb245('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b242b,null))[_0xb245('0x21')](function(_0x549ddc){if(_0x549ddc){_0xb94e2e['message']=_0x549ddc[_0xb245('0x63')]({'plain':!![]});return db[_0xb245('0x71')][_0xb245('0x58')]({'where':{'id':_0x549ddc[_0xb245('0x72')]}});}return null;})[_0xb245('0x21')](handleEntityNotFound(_0x4b242b,null))['then'](function(_0x3fc3b5){if(_0x3fc3b5){_0xb94e2e[_0xb245('0x66')]=_0x3fc3b5[_0xb245('0x63')]({'plain':!![]});interaction_log[_0xb245('0x22')](_0xb245('0x73'),_0x58f58d[_0xb245('0x60')]['id'],_0x58f58d['user']['name'],_0x58f58d[_0xb245('0x60')]['role'],_0xb94e2e[_0xb245('0x66')]['id'],_0x58f58d[_0xb245('0x57')]?JSON[_0xb245('0x26')](_0x58f58d[_0xb245('0x57')]):_0xb245('0x67'));return respondWithRpcPromise(_0xb245('0x74'),_0xb245('0x75'),_0xb94e2e);}return null;})[_0xb245('0x21')](function(_0x4129de){if(_0x4129de){_0x4129de[_0xb245('0x29')]['interface']=util[_0xb245('0x5d')]('SIP/%s',_0x58f58d['user'][_0xb245('0x37')]);_0x4129de[_0xb245('0x29')][_0xb245('0x6c')]=_0xb94e2e['channel'];_0x4129de[_0xb245('0x29')][_0xb245('0x76')]=_0xb245('0x6e');respondWithRpcPromise('EventManager',_0xb245('0x6d'),{'event':_0xb245('0x77'),'message':_0x4129de[_0xb245('0x29')]},client9002);return _0xb94e2e;}return null;})[_0xb245('0x21')](respondWithResult(_0x4b242b,null))[_0xb245('0x2b')](handleError(_0x4b242b,null));};exports['status']=function(_0x44cfde,_0x283b4a,_0x4a0e48){if(_0x44cfde[_0xb245('0x57')]['id']){delete _0x44cfde[_0xb245('0x57')]['id'];}var _0x448fe5;return db['SmsMessage']['find']({'where':{'id':_0x44cfde['params']['id']}})[_0xb245('0x21')](handleEntityNotFound(_0x283b4a,null))['then'](function(_0x106601){if(_0x106601){_0x448fe5=_0x106601;return db['SmsAccount']['find']({'where':{'id':_0x106601[_0xb245('0x78')]}});}})[_0xb245('0x21')](handleEntityNotFound(_0x283b4a,null))[_0xb245('0x21')](function(_0x376b23){if(_0x376b23){logger['debug'](_0xb245('0x25'),_0xb245('0x2d'),_0xb245('0x79'),_0x376b23[_0xb245('0x3d')],util['inspect'](_0x44cfde[_0xb245('0x57')],{'showHidden':![],'depth':null}));switch(_0x376b23[_0xb245('0x3d')]){case _0xb245('0x7a'):if(_0x44cfde[_0xb245('0x57')]['MessageSid']&&_0x44cfde[_0xb245('0x57')][_0xb245('0x7b')]===_0x448fe5['messageId']){return _0x448fe5['update']({'read':!![]});}else{logger['error'](_0xb245('0x7c'),_0xb245('0x2d'),'twilio',util['inspect'](_0x44cfde['body'],{'showHidden':![],'depth':null}));}break;case _0xb245('0x7d'):if(_0x44cfde[_0xb245('0x57')][_0xb245('0x7e')]&&_0x44cfde[_0xb245('0x57')][_0xb245('0x7e')]===_0x448fe5[_0xb245('0x7f')]&&_['indexOf'](['sent',_0xb245('0x80')],_0x44cfde[_0xb245('0x57')][_0xb245('0x81')])>=0x0){return _0x448fe5[_0xb245('0x34')]({'read':!![]});}else{logger[_0xb245('0x27')](_0xb245('0x7c'),_0xb245('0x2d'),'plivio',util[_0xb245('0x82')](_0x44cfde[_0xb245('0x57')],{'showHidden':![],'depth':null}));}break;case _0xb245('0x83'):var _0xc637f3=_0x44cfde['body'][_0xb245('0x84')][0x0];if(_0xc637f3[_0xb245('0x2d')][_0xb245('0x85')]===_0xb245('0x86')){return _0x448fe5['update']({'read':!![]});}else{logger[_0xb245('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb245('0x2d'),'infobip',util[_0xb245('0x82')](_0x44cfde[_0xb245('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x448fe5;}})['then'](respondWithResult(_0x283b4a,null))[_0xb245('0x2b')](handleError(_0x283b4a,null));}; \ No newline at end of file +var _0x8374=['intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsMessage','includeAll','include','rows','show','params','rawAttributes','attributes','find','create','body','update','describe','sms-interactions','accept','sms','read','readAt','format','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','interface','channel','event','EventManager','acceptmessage','../../config/logger','agent','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','socket.io-emitter','./smsMessage.socket','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters'];(function(_0xfe7c2,_0x3d3caf){var _0x5041d6=function(_0x15a8c6){while(--_0x15a8c6){_0xfe7c2['push'](_0xfe7c2['shift']());}};_0x5041d6(++_0x3d3caf);}(_0x8374,0x174));var _0x4837=function(_0x16a930,_0x146719){_0x16a930=_0x16a930-0x0;var _0x3f0b5f=_0x8374[_0x16a930];return _0x3f0b5f;};'use strict';var pdf=require(_0x4837('0x0'));var emlformat=require(_0x4837('0x1'));var rimraf=require(_0x4837('0x2'));var zipdir=require(_0x4837('0x3'));var jsonpatch=require(_0x4837('0x4'));var rp=require(_0x4837('0x5'));var moment=require(_0x4837('0x6'));var BPromise=require(_0x4837('0x7'));var Mustache=require(_0x4837('0x8'));var util=require(_0x4837('0x9'));var path=require(_0x4837('0xa'));var sox=require(_0x4837('0xb'));var csv=require(_0x4837('0xc'));var ejs=require(_0x4837('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4837('0xe'));var crypto=require('crypto');var jsforce=require(_0x4837('0xf'));var deskjs=require(_0x4837('0x10'));var toCsv=require(_0x4837('0xc'));var querystring=require(_0x4837('0x11'));var Papa=require(_0x4837('0x12'));var Redis=require(_0x4837('0x13'));var authService=require(_0x4837('0x14'));var qs=require(_0x4837('0x15'));var as=require(_0x4837('0x16'));var hardwareService=require(_0x4837('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0x4837('0x18'));var config=require('../../config/environment');var db=require(_0x4837('0x19'))['db'];config[_0x4837('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4837('0x1b'))(new Redis(config[_0x4837('0x1a')]));require(_0x4837('0x1c'))[_0x4837('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4837('0x1e')][_0x4837('0x1f')]({'port':0x232c});var client9002=jayson[_0x4837('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x1685ee,_0xae4f01,_0x5d49b6){if(_0x5d49b6){var _0x216899=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x216899[_0x4837('0x20')](_0xae4f01)){return _0x1685ee;}else{throw new db[(_0x4837('0x21'))][(_0x4837('0x22'))](_0x4837('0x23'));}}else{return _0x1685ee;}}function respondWithRpcPromise(_0x2505ce,_0x48b61b,_0xf21681,_0x1cb24a){return new BPromise(function(_0x427171,_0x3c4d53){var _0x41f86c=_0x1cb24a||client;return _0x41f86c[_0x4837('0x24')](_0x2505ce,_0xf21681)[_0x4837('0x25')](function(_0x4b482d){logger['info'](_0x4837('0x26'),_0x48b61b,_0x4837('0x27'));logger[_0x4837('0x28')](_0x4837('0x29'),_0x48b61b,'request\x20sent',JSON[_0x4837('0x2a')](_0x4b482d));if(_0x4b482d['error']){if(_0x4b482d[_0x4837('0x2b')]['code']===0x1f4){logger['error'](_0x4837('0x26'),_0x48b61b,_0x4b482d['error']['message']);return _0x3c4d53(_0x4b482d['error'][_0x4837('0x2c')]);}logger[_0x4837('0x2b')]('SmsMessage,\x20%s,\x20%s',_0x48b61b,_0x4b482d[_0x4837('0x2b')][_0x4837('0x2c')]);return _0x427171(_0x4b482d['error'][_0x4837('0x2c')]);}else{logger[_0x4837('0x2d')]('SmsMessage,\x20%s,\x20%s',_0x48b61b,_0x4837('0x27'));_0x427171(_0x4b482d[_0x4837('0x2e')][_0x4837('0x2c')]);}})[_0x4837('0x2f')](function(_0x2b2e48){logger['error'](_0x4837('0x26'),_0x48b61b,_0x2b2e48);_0x3c4d53(_0x2b2e48);});});}function respondWithStatusCode(_0x153bc7,_0x39b61b){_0x39b61b=_0x39b61b||0xcc;return function(_0x314bee){if(_0x314bee){return _0x153bc7[_0x4837('0x30')](_0x39b61b);}return _0x153bc7[_0x4837('0x31')](_0x39b61b)[_0x4837('0x32')]();};}function respondWithResult(_0x107a5f,_0x55f82b){_0x55f82b=_0x55f82b||0xc8;return function(_0x18f95c){if(_0x18f95c){return _0x107a5f[_0x4837('0x31')](_0x55f82b)[_0x4837('0x33')](_0x18f95c);}};}function respondWithFilteredResult(_0x2da6bf,_0x594039){return function(_0x18c7a7){if(_0x18c7a7){var _0xf3e0d7=_0x18c7a7[_0x4837('0x34')],_0x139e3c=_0x594039['offset'],_0xccb861=_0x594039[_0x4837('0x35')]+_0x594039['limit'],_0x569ae1;if(_0xccb861>=_0xf3e0d7){_0xccb861=_0xf3e0d7;_0x569ae1=0xc8;}else{_0x569ae1=0xce;}_0x2da6bf[_0x4837('0x31')](_0x569ae1);return _0x2da6bf[_0x4837('0x36')](_0x4837('0x37'),_0x139e3c+'-'+_0xccb861+'/'+_0xf3e0d7)['json'](_0x18c7a7);}return null;};}function patchUpdates(_0x5f37ca){return function(_0x43bdb3){try{jsonpatch[_0x4837('0x38')](_0x43bdb3,_0x5f37ca,!![]);}catch(_0x442484){return BPromise[_0x4837('0x39')](_0x442484);}return _0x43bdb3[_0x4837('0x3a')]();};}function saveUpdates(_0x5ba853,_0x3c7582){return function(_0x1243ac){if(_0x1243ac){return _0x1243ac['update'](_0x5ba853)[_0x4837('0x25')](function(_0x5388ec){return _0x5388ec;});}return null;};}function removeEntity(_0x35c4e5,_0x5a0022){return function(_0x571add){if(_0x571add){return _0x571add[_0x4837('0x3b')]()[_0x4837('0x25')](function(){_0x35c4e5[_0x4837('0x31')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253f49,_0x1d88ae){return function(_0x59d704){if(!_0x59d704){_0x253f49[_0x4837('0x30')](0x194);}return _0x59d704;};}function handleError(_0x57d0e5,_0x1d422d){_0x1d422d=_0x1d422d||0x1f4;return function(_0x349bec){logger[_0x4837('0x2b')](_0x349bec[_0x4837('0x3c')]);if(_0x349bec['name']){delete _0x349bec[_0x4837('0x3d')];}_0x57d0e5[_0x4837('0x31')](_0x1d422d)[_0x4837('0x3e')](_0x349bec);};}exports[_0x4837('0x3f')]=function(_0x55abf6,_0x12af2a){var _0x5d1eae={},_0x441090={},_0x4ae82f={'count':0x0,'rows':[]};var _0x465737=_[_0x4837('0x40')](db['SmsMessage']['rawAttributes'],function(_0x3ab0bb){return{'name':_0x3ab0bb[_0x4837('0x41')],'type':_0x3ab0bb[_0x4837('0x42')][_0x4837('0x43')]};});_0x441090[_0x4837('0x44')]=_[_0x4837('0x40')](_0x465737,_0x4837('0x3d'));_0x441090[_0x4837('0x45')]=_[_0x4837('0x46')](_0x55abf6[_0x4837('0x45')]);_0x441090[_0x4837('0x47')]=_[_0x4837('0x48')](_0x441090[_0x4837('0x44')],_0x441090[_0x4837('0x45')]);_0x5d1eae['attributes']=_['intersection'](_0x441090[_0x4837('0x44')],qs[_0x4837('0x49')](_0x55abf6[_0x4837('0x45')][_0x4837('0x49')]));_0x5d1eae['attributes']=_0x5d1eae['attributes'][_0x4837('0x4a')]?_0x5d1eae['attributes']:_0x441090['model'];if(!_0x55abf6[_0x4837('0x45')][_0x4837('0x4b')](_0x4837('0x4c'))){_0x5d1eae['limit']=qs[_0x4837('0x4d')](_0x55abf6[_0x4837('0x45')]['limit']);_0x5d1eae[_0x4837('0x35')]=qs[_0x4837('0x35')](_0x55abf6[_0x4837('0x45')][_0x4837('0x35')]);}_0x5d1eae[_0x4837('0x4e')]=qs[_0x4837('0x4f')](_0x55abf6[_0x4837('0x45')][_0x4837('0x4f')]);_0x5d1eae[_0x4837('0x50')]=qs[_0x4837('0x47')](_[_0x4837('0x51')](_0x55abf6[_0x4837('0x45')],_0x441090[_0x4837('0x47')]));if(_0x55abf6[_0x4837('0x45')][_0x4837('0x52')]){_0x5d1eae['where']=_[_0x4837('0x53')](_0x5d1eae[_0x4837('0x50')],{'$or':_[_0x4837('0x40')](_0x465737,function(_0x37a227){if(_0x37a227['type']!==_0x4837('0x54')){var _0x3f2995={};_0x3f2995[_0x37a227['name']]={'$like':'%'+_0x55abf6['query'][_0x4837('0x52')]+'%'};return _0x3f2995;}})});}_0x5d1eae=_[_0x4837('0x53')]({},_0x5d1eae,_0x55abf6[_0x4837('0x55')]);var _0x4e2155={'where':_0x5d1eae[_0x4837('0x50')]};return db[_0x4837('0x56')][_0x4837('0x34')](_0x4e2155)[_0x4837('0x25')](function(_0x1ae0f8){_0x4ae82f[_0x4837('0x34')]=_0x1ae0f8;if(_0x55abf6[_0x4837('0x45')][_0x4837('0x57')]){_0x5d1eae[_0x4837('0x58')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x5d1eae);})[_0x4837('0x25')](function(_0x489894){_0x4ae82f[_0x4837('0x59')]=_0x489894;return _0x4ae82f;})[_0x4837('0x25')](respondWithFilteredResult(_0x12af2a,_0x5d1eae))[_0x4837('0x2f')](handleError(_0x12af2a,null));};exports[_0x4837('0x5a')]=function(_0x32384d,_0x20f8c7){var _0x5c68e5={'raw':!![],'where':{'id':_0x32384d[_0x4837('0x5b')]['id']}},_0x38de6f={};_0x38de6f[_0x4837('0x44')]=_[_0x4837('0x46')](db['SmsMessage'][_0x4837('0x5c')]);_0x38de6f[_0x4837('0x45')]=_[_0x4837('0x46')](_0x32384d[_0x4837('0x45')]);_0x38de6f[_0x4837('0x47')]=_[_0x4837('0x48')](_0x38de6f['model'],_0x38de6f[_0x4837('0x45')]);_0x5c68e5[_0x4837('0x5d')]=_['intersection'](_0x38de6f[_0x4837('0x44')],qs[_0x4837('0x49')](_0x32384d[_0x4837('0x45')][_0x4837('0x49')]));_0x5c68e5['attributes']=_0x5c68e5[_0x4837('0x5d')][_0x4837('0x4a')]?_0x5c68e5[_0x4837('0x5d')]:_0x38de6f[_0x4837('0x44')];if(_0x32384d[_0x4837('0x45')][_0x4837('0x57')]){_0x5c68e5[_0x4837('0x58')]=[{'all':!![]}];}_0x5c68e5=_['merge']({},_0x5c68e5,_0x32384d[_0x4837('0x55')]);return db[_0x4837('0x56')][_0x4837('0x5e')](_0x5c68e5)[_0x4837('0x25')](handleEntityNotFound(_0x20f8c7,null))[_0x4837('0x25')](respondWithResult(_0x20f8c7,null))[_0x4837('0x2f')](handleError(_0x20f8c7,null));};exports[_0x4837('0x5f')]=function(_0x48cfd6,_0x44595a){return db[_0x4837('0x56')][_0x4837('0x5f')](_0x48cfd6[_0x4837('0x60')],{})[_0x4837('0x25')](respondWithResult(_0x44595a,0xc9))[_0x4837('0x2f')](handleError(_0x44595a,null));};exports[_0x4837('0x61')]=function(_0xf0c3ca,_0xde57ba){if(_0xf0c3ca[_0x4837('0x60')]['id']){delete _0xf0c3ca[_0x4837('0x60')]['id'];}return db[_0x4837('0x56')][_0x4837('0x5e')]({'where':{'id':_0xf0c3ca[_0x4837('0x5b')]['id']}})[_0x4837('0x25')](handleEntityNotFound(_0xde57ba,null))[_0x4837('0x25')](saveUpdates(_0xf0c3ca['body'],null))[_0x4837('0x25')](respondWithResult(_0xde57ba,null))[_0x4837('0x2f')](handleError(_0xde57ba,null));};exports[_0x4837('0x3b')]=function(_0x569f45,_0x1482b1){return db[_0x4837('0x56')]['find']({'where':{'id':_0x569f45[_0x4837('0x5b')]['id']}})[_0x4837('0x25')](handleEntityNotFound(_0x1482b1,null))['then'](removeEntity(_0x1482b1,null))[_0x4837('0x2f')](handleError(_0x1482b1,null));};exports[_0x4837('0x62')]=function(_0x5db106,_0x2101e3){return db[_0x4837('0x56')][_0x4837('0x62')]()[_0x4837('0x25')](respondWithResult(_0x2101e3,null))[_0x4837('0x2f')](handleError(_0x2101e3,null));};var interaction_log=require('../../config/logger')(_0x4837('0x63'));exports[_0x4837('0x64')]=function(_0x1dff60,_0x28b8e2,_0x1bbea9){var _0x191f27={'channel':_0x4837('0x65')};if(_0x1dff60[_0x4837('0x60')]['id']){delete _0x1dff60[_0x4837('0x60')]['id'];}_0x1dff60[_0x4837('0x60')][_0x4837('0x66')]=!![];_0x1dff60[_0x4837('0x60')][_0x4837('0x67')]=moment()[_0x4837('0x68')]('YYYY-MM-DD\x20HH:mm:ss');_0x1dff60[_0x4837('0x60')][_0x4837('0x69')]=_0x1dff60[_0x4837('0x60')][_0x4837('0x69')]||_0x1dff60[_0x4837('0x6a')]['id'];return db['SmsMessage'][_0x4837('0x5e')]({'where':{'id':_0x1dff60[_0x4837('0x5b')]['id'],'UserId':null},'include':[{'model':db[_0x4837('0x6b')],'as':_0x4837('0x6c')}]})['then'](handleEntityNotFound(_0x28b8e2,null))[_0x4837('0x25')](saveUpdates(_0x1dff60['body'],null))[_0x4837('0x25')](function(_0x129859){if(_0x129859){_0x191f27[_0x4837('0x2c')]=_0x129859[_0x4837('0x6d')]({'plain':!![]});return db[_0x4837('0x6e')][_0x4837('0x5e')]({'where':{'id':_0x129859[_0x4837('0x6f')]}});}return null;})[_0x4837('0x25')](handleEntityNotFound(_0x28b8e2,null))[_0x4837('0x25')](function(_0x314e53){if(_0x314e53){return _0x314e53[_0x4837('0x61')]({'UserId':_0x1dff60[_0x4837('0x60')][_0x4837('0x69')],'read1stAt':_[_0x4837('0x70')](_0x314e53[_0x4837('0x71')])?moment()[_0x4837('0x68')](_0x4837('0x72')):undefined});}return null;})[_0x4837('0x25')](function(_0x33d57a){if(_0x33d57a){_0x191f27['interaction']=_0x33d57a[_0x4837('0x6d')]({'plain':!![]});interaction_log[_0x4837('0x2d')](_0x4837('0x73'),_0x1dff60[_0x4837('0x6a')]['id'],_0x1dff60[_0x4837('0x6a')]['name'],_0x1dff60[_0x4837('0x6a')][_0x4837('0x74')],_0x191f27['interaction']['id'],_0x1dff60['body']?JSON['stringify'](_0x1dff60[_0x4837('0x60')]):_0x4837('0x75'));return respondWithRpcPromise('AcceptMessage',_0x4837('0x76'),_0x191f27);}return null;})[_0x4837('0x25')](function(_0x56e957){if(_0x56e957){if(_0x1dff60[_0x4837('0x60')]['manual']){_0x191f27[_0x4837('0x2c')][_0x4837('0x77')]=util['format']('SIP/%s',_0x1dff60[_0x4837('0x6a')][_0x4837('0x3d')]);_0x191f27['message'][_0x4837('0x78')]=_0x191f27[_0x4837('0x78')];_0x191f27[_0x4837('0x2c')][_0x4837('0x79')]='accept';return respondWithRpcPromise(_0x4837('0x7a'),_0x4837('0x7a'),{'event':_0x4837('0x7b'),'message':_0x191f27[_0x4837('0x2c')]},client9002)[_0x4837('0x25')](function(){return _0x191f27;});}return _0x191f27;}return null;})[_0x4837('0x25')](respondWithResult(_0x28b8e2,null))[_0x4837('0x2f')](handleError(_0x28b8e2,null));};var interaction_log=require(_0x4837('0x7c'))(_0x4837('0x63'));exports[_0x4837('0x39')]=function(_0xc95697,_0xc910fb,_0x588157){var _0x27400d={'agent':{},'channel':_0x4837('0x65')};if(_0xc95697[_0x4837('0x60')]['id']){delete _0xc95697[_0x4837('0x60')]['id'];}_0xc95697[_0x4837('0x60')][_0x4837('0x69')]=_0xc95697[_0x4837('0x60')][_0x4837('0x69')]||_0xc95697[_0x4837('0x6a')]['id'];_0x27400d[_0x4837('0x7d')]['id']=_0xc95697['body'][_0x4837('0x69')];return db[_0x4837('0x56')][_0x4837('0x5e')]({'where':{'id':_0xc95697['params']['id'],'UserId':null}})[_0x4837('0x25')](handleEntityNotFound(_0xc910fb,null))[_0x4837('0x25')](function(_0x2f09f0){if(_0x2f09f0){_0x27400d[_0x4837('0x2c')]=_0x2f09f0[_0x4837('0x6d')]({'plain':!![]});return db['SmsInteraction'][_0x4837('0x5e')]({'where':{'id':_0x2f09f0[_0x4837('0x6f')]}});}return null;})['then'](handleEntityNotFound(_0xc910fb,null))['then'](function(_0x42dee0){if(_0x42dee0){_0x27400d[_0x4837('0x7e')]=_0x42dee0[_0x4837('0x6d')]({'plain':!![]});interaction_log['info'](_0x4837('0x7f'),_0xc95697[_0x4837('0x6a')]['id'],_0xc95697[_0x4837('0x6a')]['name'],_0xc95697['user']['role'],_0x27400d[_0x4837('0x7e')]['id'],_0xc95697[_0x4837('0x60')]?JSON[_0x4837('0x2a')](_0xc95697['body']):_0x4837('0x75'));return respondWithRpcPromise(_0x4837('0x80'),_0x4837('0x81'),_0x27400d);}return null;})[_0x4837('0x25')](function(_0x53e56f){if(_0x53e56f){_0x53e56f[_0x4837('0x2c')][_0x4837('0x77')]=util[_0x4837('0x68')](_0x4837('0x82'),_0xc95697[_0x4837('0x6a')][_0x4837('0x3d')]);_0x53e56f[_0x4837('0x2c')][_0x4837('0x78')]=_0x27400d['channel'];_0x53e56f[_0x4837('0x2c')][_0x4837('0x79')]=_0x4837('0x39');respondWithRpcPromise(_0x4837('0x7a'),'EventManager',{'event':_0x4837('0x83'),'message':_0x53e56f['message']},client9002);return _0x27400d;}return null;})[_0x4837('0x25')](respondWithResult(_0xc910fb,null))[_0x4837('0x2f')](handleError(_0xc910fb,null));};exports[_0x4837('0x31')]=function(_0x19dcd4,_0x5399d5,_0x1f5e8c){if(_0x19dcd4[_0x4837('0x60')]['id']){delete _0x19dcd4[_0x4837('0x60')]['id'];}var _0x2a3706;return db[_0x4837('0x56')][_0x4837('0x5e')]({'where':{'id':_0x19dcd4[_0x4837('0x5b')]['id']}})[_0x4837('0x25')](handleEntityNotFound(_0x5399d5,null))[_0x4837('0x25')](function(_0x365d5d){if(_0x365d5d){_0x2a3706=_0x365d5d;return db['SmsAccount']['find']({'where':{'id':_0x365d5d['SmsAccountId']}});}})[_0x4837('0x25')](handleEntityNotFound(_0x5399d5,null))[_0x4837('0x25')](function(_0x2924f4){if(_0x2924f4){logger[_0x4837('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s','status',_0x4837('0x84'),_0x2924f4[_0x4837('0x42')],util[_0x4837('0x85')](_0x19dcd4[_0x4837('0x60')],{'showHidden':![],'depth':null}));switch(_0x2924f4['type']){case _0x4837('0x86'):if(_0x19dcd4[_0x4837('0x60')][_0x4837('0x87')]&&_0x19dcd4['body'][_0x4837('0x87')]===_0x2a3706[_0x4837('0x88')]){return _0x2a3706[_0x4837('0x61')]({'read':!![]});}else{logger[_0x4837('0x2b')](_0x4837('0x89'),_0x4837('0x31'),_0x4837('0x86'),util[_0x4837('0x85')](_0x19dcd4[_0x4837('0x60')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x19dcd4[_0x4837('0x60')][_0x4837('0x8a')]&&_0x19dcd4[_0x4837('0x60')]['MessageUUID']===_0x2a3706[_0x4837('0x88')]&&_[_0x4837('0x8b')]([_0x4837('0x8c'),_0x4837('0x8d')],_0x19dcd4[_0x4837('0x60')][_0x4837('0x8e')])>=0x0){return _0x2a3706[_0x4837('0x61')]({'read':!![]});}else{logger[_0x4837('0x2b')](_0x4837('0x89'),_0x4837('0x31'),_0x4837('0x8f'),util[_0x4837('0x85')](_0x19dcd4[_0x4837('0x60')],{'showHidden':![],'depth':null}));}break;case _0x4837('0x90'):var _0x59c736=_0x19dcd4[_0x4837('0x60')][_0x4837('0x91')][0x0];if(_0x59c736[_0x4837('0x31')][_0x4837('0x92')]===_0x4837('0x93')){return _0x2a3706[_0x4837('0x61')]({'read':!![]});}else{logger[_0x4837('0x2b')](_0x4837('0x89'),_0x4837('0x31'),_0x4837('0x90'),util[_0x4837('0x85')](_0x19dcd4[_0x4837('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x2a3706;}})[_0x4837('0x25')](respondWithResult(_0x5399d5,null))['catch'](handleError(_0x5399d5,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index bd58c6d..2326821 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 _0x3944=['hook','events','SmsMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x3944,0x8d));var _0x4394=function(_0x5f5111,_0xf6871a){_0x5f5111=_0x5f5111-0x0;var _0x4c8bf1=_0x3944[_0x5f5111];return _0x4c8bf1;};'use strict';var EventEmitter=require(_0x4394('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x4394('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4394('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4394('0x3')};function emitEvent(_0x5c7215){return function(_0x4cfa58,_0x1860fa,_0x2e3676){SmsMessageEvents[_0x4394('0x4')](_0x5c7215+':'+_0x4cfa58['id'],_0x4cfa58);SmsMessageEvents[_0x4394('0x4')](_0x5c7215,_0x4cfa58);_0x2e3676(null);};}for(var e in events){if(events[_0x4394('0x5')](e)){var event=events[e];SmsMessage[_0x4394('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x102c=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x439e50,_0x2aa7de){var _0x5157d6=function(_0x411f48){while(--_0x411f48){_0x439e50['push'](_0x439e50['shift']());}};_0x5157d6(++_0x2aa7de);}(_0x102c,0x161));var _0xc102=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0x102c[_0x54d4a8];return _0x3b321b;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0xc102('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc102('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc102('0x2'),'afterDestroy':'remove'};function emitEvent(_0x261fb9){return function(_0x3e1b8e,_0x1f889c,_0x3b3c65){SmsMessageEvents['emit'](_0x261fb9+':'+_0x3e1b8e['id'],_0x3e1b8e);SmsMessageEvents[_0xc102('0x3')](_0x261fb9,_0x3e1b8e);_0x3b3c65(null);};}for(var e in events){if(events[_0xc102('0x4')](e)){var event=events[e];SmsMessage[_0xc102('0x5')](e,emitEvent(event));}}module[_0xc102('0x6')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 338ac87..3b23c9c 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 _0x305c=['smsMethod','sender','username','&password=','GET','POST','user_key','session_key','total_sent','internal_order_id','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','message_uuid','infobip','baseUrl','/auth/1/session','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiKey','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','bluebird','request-promise','path','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteraction','update','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','skebby','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x305c,0x1a4));var _0xc305=function(_0x2bf799,_0x3d81dc){_0x2bf799=_0x2bf799-0x0;var _0x220479=_0x305c[_0x2bf799];return _0x220479;};'use strict';var _=require('lodash');var util=require(_0xc305('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc305('0x1'));var rp=require(_0xc305('0x2'));var fs=require('fs');var path=require(_0xc305('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x2ac4ff,_0x280265){return _0x2ac4ff[_0xc305('0x4')](_0xc305('0x5'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xc305('0x6'),'fields':[_0xc305('0x6')]},{'name':_0xc305('0x7'),'fields':[_0xc305('0x8')],'type':_0xc305('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x450690,_0x5e5674,_0x9fdae5){var _0x3f1291=_0x2ac4ff[_0xc305('0xa')];var _0x171659=_0x450690['get']({'plain':!![]});if(_0x171659[_0xc305('0xb')][_0xc305('0xc')]()==='in'||_0x171659[_0xc305('0xb')]['toLowerCase']()===_0xc305('0xd')&&!_0x171659[_0xc305('0xe')]&&!_[_0xc305('0xf')](_0x171659['UserId'])){_0x3f1291[_0xc305('0x10')]['findOne']({'where':{'id':_0x171659['SmsInteractionId']}})['then'](function(_0x100b15){if(_0x100b15){_0x100b15[_0xc305('0x11')]({'lastMsgAt':_0x171659['createdAt'],'lastMsgDirection':_0x171659['direction'][_0xc305('0xc')]()});}})[_0xc305('0x12')](function(_0x96f5c0){console['error'](_0x96f5c0);});}if(_0x171659[_0xc305('0xb')]===_0xc305('0xd')&&!_0x171659['secret']){var _0xc91b34;_0x3f1291[_0xc305('0x13')][_0xc305('0x14')]({'where':{'id':_0x171659[_0xc305('0x15')]},'raw':!![]})['then'](function(_0xa9d904){_0xc91b34=_0xa9d904;if(_0xc91b34&&_0xc91b34[_0xc305('0x16')]){switch(_0xc91b34[_0xc305('0x16')]){case _0xc305('0x17'):var _0x2b4387=require('twilio');if(_0xc91b34[_0xc305('0x18')]&&_0xc91b34[_0xc305('0x19')]&&_0xc91b34[_0xc305('0x1a')]){var _0x5c8f87=new _0x2b4387(_0xc91b34[_0xc305('0x18')],_0xc91b34['authToken']);_0x5c8f87['messages'][_0xc305('0x1b')]({'body':_0x171659['body'],'to':_0x171659['phone'],'from':_0xc91b34[_0xc305('0x1a')],'statusCallback':_0xc91b34[_0xc305('0x1c')]+_0xc305('0x1d')+_0x171659['id']+_0xc305('0x1e')+_0xc91b34[_0xc305('0x1f')]})[_0xc305('0x20')](function(_0x16a72c){if(_0x16a72c['sid']){return _0x450690[_0xc305('0x11')]({'messageId':_0x16a72c[_0xc305('0x21')]});}})[_0xc305('0x12')](function(_0x3841be){logger['error'](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x17'),util[_0xc305('0x24')](_0x3841be,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x17'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xc305('0x26'):var _0x3613ed='https://api.skebby.it/API/v1.0/REST/';if(_0xc91b34['username']&&_0xc91b34[_0xc305('0x27')]){var _0x4e8a90={'recipient':[_0x171659[_0xc305('0x1a')]],'message':_0x171659[_0xc305('0x8')],'message_type':_0xc91b34['smsMethod']};if(_0xc91b34[_0xc305('0x28')]&&_0xc91b34[_0xc305('0x28')]!=='SI'){_0x4e8a90[_0xc305('0x29')]=_0xc91b34[_0xc305('0x1a')];}var _0x19b29d={'url':_0x3613ed+'login?username='+_0xc91b34[_0xc305('0x2a')]+_0xc305('0x2b')+_0xc91b34[_0xc305('0x27')],'method':_0xc305('0x2c')};rp(_0x19b29d)[_0xc305('0x20')](function(_0x3e643d){var _0x469f5b=_0x3e643d['split'](';');var _0x5a9d31={'user_key':_0x469f5b[0x0],'session_key':_0x469f5b[0x1]};_0x19b29d={'url':_0x3613ed+'sms','method':_0xc305('0x2d'),'headers':{'user_key':_0x5a9d31[_0xc305('0x2e')],'Session_key':_0x5a9d31[_0xc305('0x2f')]},'json':!![],'body':_0x4e8a90};return rp(_0x19b29d);})['then'](function(_0x3b485a){if(_0x3b485a[_0xc305('0x30')]>=0x1){var _0x19ec04={'messageId':_0x3b485a[_0xc305('0x31')]};if(_0xc91b34[_0xc305('0x28')]!=='GP'||!_0xc91b34['deliveryReport']){_0x19ec04['read']=!![];}return _0x450690[_0xc305('0x11')](_0x19ec04);}else{return logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),_0xc305('0x26'),util[_0xc305('0x24')](_0x3b485a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x191e7e){return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'skebby',util[_0xc305('0x24')](_0x191e7e,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'skebby',_0xc305('0x32'));}break;case _0xc305('0x33'):if(_0xc91b34[_0xc305('0x19')]){var _0x6db335={'recipient':_0x171659[_0xc305('0x1a')],'message':_0x171659[_0xc305('0x8')],'sender':_0xc91b34[_0xc305('0x34')]||_0xc91b34['phone'],'authorization':_0xc91b34['authToken']};var _0x5e5674={'method':_0xc305('0x2d'),'uri':_0xc305('0x35'),'body':_0x6db335,'json':!![]};rp(_0x5e5674)['then'](function(_0x5aa01f){var _0x3470c7={'messageId':_0x5aa01f[_0xc305('0x36')]};if(!_0xc91b34[_0xc305('0x37')]){_0x3470c7[_0xc305('0x38')]=!![];}return _0x450690[_0xc305('0x11')](_0x3470c7);})[_0xc305('0x12')](function(_0x376113){logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc305('0x33'),util[_0xc305('0x24')](_0x376113,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x33'),_0xc305('0x39'));}break;case _0xc305('0x3a'):if(_0xc91b34[_0xc305('0x2a')]&&_0xc91b34[_0xc305('0x27')]){var _0x6db335={'messages':[{'source':'xCALLY\x20Motion','to':_0x171659[_0xc305('0x1a')],'body':_0x171659['body'],'from':_0xc91b34[_0xc305('0x34')]||_0xc91b34[_0xc305('0x1a')]}]};var _0x17bfe7=util['format'](_0xc305('0x3b'),_0xc91b34[_0xc305('0x2a')],_0xc91b34['password']);var _0x5e5674={'method':_0xc305('0x2d'),'uri':_0xc305('0x3c'),'body':_0x6db335,'headers':{'Authorization':util[_0xc305('0x3d')](_0xc305('0x3e'),new Buffer(_0x17bfe7)[_0xc305('0x3f')](_0xc305('0x40')))},'json':!![]};rp(_0x5e5674)['then'](function(_0x3d872b){if(_0x3d872b[_0xc305('0x41')]>=0xc8&&_0x3d872b[_0xc305('0x41')]<=0xce){if(_0x3d872b['data']&&_0x3d872b[_0xc305('0x42')][_0xc305('0x43')]>0x0){var _0x5dd21a=_[_0xc305('0x44')](_0x3d872b[_0xc305('0x42')][_0xc305('0x45')]);var _0x327cd4={'messageId':_0x5dd21a[_0xc305('0x46')]};if(!_0xc91b34[_0xc305('0x37')]){_0x327cd4[_0xc305('0x38')]=!![];}return _0x450690[_0xc305('0x11')](_0x327cd4);}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'clickSend',util[_0xc305('0x24')](_0x3d872b,{'showHidden':![],'depth':null}));}}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x47'),util[_0xc305('0x24')](_0x3d872b,{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x1f97a1){logger[_0xc305('0x25')](_0xc305('0x22'),'afterCreate',_0xc305('0x47'),util[_0xc305('0x24')](_0x1f97a1,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'clickSend',_0xc305('0x32'));}break;case _0xc305('0x48'):if(_0xc91b34[_0xc305('0x49')]&&_0xc91b34[_0xc305('0x19')]){var _0x6db335={'dst':_0x171659['phone'],'text':_0x171659['body'],'src':_0xc91b34['senderString']||_0xc91b34['phone'],'url':_0xc91b34[_0xc305('0x1c')]+_0xc305('0x1d')+_0x171659['id']+_0xc305('0x1e')+_0xc91b34[_0xc305('0x1f')]};var _0x17bfe7=util[_0xc305('0x3d')](_0xc305('0x3b'),_0xc91b34['authId'],_0xc91b34['authToken']);var _0x5e5674={'method':_0xc305('0x2d'),'uri':util[_0xc305('0x3d')]('https://api.plivo.com/v1/Account/%s/Message/',_0xc91b34[_0xc305('0x49')]),'body':_0x6db335,'headers':{'Authorization':util[_0xc305('0x3d')]('Basic\x20%s',new Buffer(_0x17bfe7)[_0xc305('0x3f')](_0xc305('0x40')))},'json':!![]};rp(_0x5e5674)[_0xc305('0x20')](function(_0x443fb2){var _0xd04730={'messageId':_0x443fb2[_0xc305('0x4a')][0x0]};return _0x450690['update'](_0xd04730);})[_0xc305('0x12')](function(_0x453c9f){logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x48'),util[_0xc305('0x24')](_0x453c9f,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x48'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc305('0x4b'):if(_0xc91b34[_0xc305('0x2a')]&&_0xc91b34[_0xc305('0x27')]){if(_0xc91b34['baseUrl']){var _0xcb06f6={'method':_0xc305('0x2d'),'uri':_0xc91b34[_0xc305('0x4c')]+_0xc305('0x4d'),'body':{'username':_0xc91b34[_0xc305('0x2a')],'password':_0xc91b34[_0xc305('0x27')]},'json':!![]};return rp(_0xcb06f6)[_0xc305('0x20')](function(_0x31c272){var _0x34d539={'method':_0xc305('0x2d'),'uri':_0xc91b34[_0xc305('0x4c')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0xc91b34[_0xc305('0x1a')],'destinations':[{'to':_0x171659[_0xc305('0x1a')]}],'text':_0x171659[_0xc305('0x8')],'notifyUrl':_0xc91b34[_0xc305('0x1c')]+'/api/sms/messages/'+_0x171659['id']+_0xc305('0x1e')+_0xc91b34[_0xc305('0x1f')],'notifyContentType':'application/json','callbackData':_0xc91b34['phone']+';'+_0x171659[_0xc305('0x8')]}]},'headers':{'Authorization':_0xc305('0x4e')+_0x31c272['token']},'json':!![]};return rp(_0x34d539)[_0xc305('0x20')](function(_0x4179bd){if(_0x4179bd[_0xc305('0x45')]){var _0x2cf948={'messageId':_0x4179bd[_0xc305('0x45')][0x0][_0xc305('0x6')]};if(!_0xc91b34[_0xc305('0x37')]){_0x2cf948[_0xc305('0x38')]=!![];}return _0x450690['update'](_0x2cf948);}else{return logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),_0xc305('0x4b'),util[_0xc305('0x24')](_0x4179bd,{'showHidden':![],'depth':null}));}});})[_0xc305('0x12')](function(_0x4e1e15){return logger['error'](_0xc305('0x22'),_0xc305('0x23'),'infobip',util['inspect'](_0x4e1e15,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),_0xc305('0x4b'),_0xc305('0x4f'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0xc305('0x32'));}break;case _0xc305('0x50'):var _0xf60a46=require(_0xc305('0x51'));if(_0xc91b34['apiKey']){var _0x569e2b={};_0x569e2b[_0xc305('0x52')]=_0xc91b34[_0xc305('0x2a')];_0x569e2b[_0xc305('0x1a')]=_0x171659[_0xc305('0x1a')];_0x569e2b[_0xc305('0x29')]=_0xc91b34[_0xc305('0x1a')];_0x569e2b[_0xc305('0x53')]=_0x171659[_0xc305('0x8')];_0x569e2b[_0xc305('0x54')]=+new Date();var _0x2b4feb='';var _0x72101a='';var _0x2f62cb=Object[_0xc305('0x55')](_0x569e2b);_0x2f62cb[_0xc305('0x56')]();for(var _0xa622f6=0x0;_0xa622f6<_0x2f62cb[_0xc305('0x57')];_0xa622f6++){if(_0x2b4feb!=''){_0x2b4feb+='&';}_0x2b4feb+=_0x2f62cb[_0xa622f6]+'='+encodeURIComponent(_0x569e2b[_0x2f62cb[_0xa622f6]]);_0x72101a+=_0x569e2b[_0x2f62cb[_0xa622f6]];}_0x72101a+=_0xc91b34['apiKey'];_0x72101a=_0xf60a46[_0xc305('0x58')](_0xc305('0x59'))[_0xc305('0x11')](_0x72101a)[_0xc305('0x5a')](_0xc305('0x5b'));if(_0x2b4feb!==''){_0x2b4feb+='&';}_0x2b4feb+=_0xc305('0x5c')+_0x72101a;var _0x19b29d={'method':_0xc305('0x2c'),'uri':_0xc91b34[_0xc305('0x4c')]+_0xc305('0x5d')+_0x2b4feb,'json':!![]};return rp(_0x19b29d)[_0xc305('0x20')](function(_0x14e51a){var _0x2a7a45=Object[_0xc305('0x55')](_0x14e51a);if(_0x14e51a[_0x2a7a45[0x0]][_0xc305('0x25')]&&parseInt(_0x14e51a[_0x2a7a45[0x0]]['error'])===0x0){var _0x2d94b4={'messageId':_0x14e51a[_0x2a7a45[0x0]][_0xc305('0x5e')]};if(!_0xc91b34['deliveryReport']){_0x2d94b4[_0xc305('0x38')]=!![];}return _0x450690[_0xc305('0x11')](_0x2d94b4);}else{return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x50'),util[_0xc305('0x24')](_0x14e51a[_0xc305('0x25')],{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x460892){return logger['error'](_0xc305('0x22'),_0xc305('0x23'),'csc',util[_0xc305('0x24')](_0x460892,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x50'),_0xc305('0x5f'));}break;case _0xc305('0x60'):if(_0xc91b34['apiKey']){var _0x284f04={'method':'POST','uri':_0xc305('0x61'),'headers':{'Authorization':_0xc91b34[_0xc305('0x62')]},'body':{'content':_0x171659[_0xc305('0x8')],'to':[_0x171659[_0xc305('0x1a')]],'from':_0xc91b34[_0xc305('0x1a')],'binary':![],'clientMessageId':_0xc305('0x63'),'charset':_0xc305('0x64')},'json':!![]};rp(_0x284f04)[_0xc305('0x20')](function(_0x4e8a5e){if(!_0x4e8a5e[_0xc305('0x25')]){var _0x1db054={'messageId':_0x4e8a5e[_0xc305('0x45')][0x0][_0xc305('0x65')]};if(!_0xc91b34[_0xc305('0x37')]){_0x1db054['read']=!![];}return _0x450690[_0xc305('0x11')](_0x1db054);}else{return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x60'),util[_0xc305('0x24')](_0x4e8a5e[_0xc305('0x25')],{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x142fa3){return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x60'),util[_0xc305('0x24')](_0x142fa3,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x60'),_0xc305('0x5f'));}break;case _0xc305('0x66'):if(_0xc91b34[_0xc305('0x62')]){var _0x29a158={};var _0x19b29d={'method':_0xc305('0x2d'),'uri':_0xc305('0x67'),'headers':{'Authorization':'Bearer\x20'+_0xc91b34[_0xc305('0x62')],'Content-Type':_0xc305('0x68')},'body':{'from':_0xc91b34['phone'],'to':_0x171659[_0xc305('0x1a')],'text':_0x171659[_0xc305('0x8')]},'json':!![]};return rp(_0x19b29d)[_0xc305('0x20')](function(_0x4df29f){if(_0x4df29f[_0xc305('0x69')]==0xca){_0x29a158[_0xc305('0x6a')]=_0x4df29f;var _0x470bb1={'method':_0xc305('0x2d'),'uri':_0xc305('0x6b'),'headers':{'Authorization':_0xc305('0x6c')+_0xc91b34['apiKey'],'Content-Type':_0xc305('0x68')},'body':{'refid':_0x29a158[_0xc305('0x6a')][_0xc305('0x6d')]},'json':!![]};return rp(_0x470bb1)[_0xc305('0x20')](function(_0x10db85){_0x29a158[_0xc305('0x6e')]=_0x10db85;var _0xeb63a0={'messageId':_0x29a158[_0xc305('0x6a')][_0xc305('0x6d')],'read':!![]};return _0x450690[_0xc305('0x11')](_0xeb63a0);});}else{return logger[_0xc305('0x25')](_0xc305('0x22'),'afterCreate','intelepeer',util[_0xc305('0x24')](_0x4df29f,{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x171f32){return logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),'intelepeer',util[_0xc305('0x24')](_0x171f32,{'showHidden':![],'depth':null}));});}else{return logger[_0xc305('0x25')](_0xc305('0x22'),'afterCreate','intelepeer',_0xc305('0x6f'));}break;}}})[_0xc305('0x70')](function(){_0x9fdae5();});}else{_0x9fdae5();}}},'charset':_0xc305('0x71'),'collate':_0xc305('0x72')});}; \ No newline at end of file +var _0x003a=['https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','clicksend','password','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','token','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','apiKey','createHash','hex','signature=','/external/get/send.php?','id_sms','clickatell','UTF-8','apiMessageId','Missing\x20parameters:\x20apiKey','intelepeer','Bearer\x20','application/json','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','rimraf','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','FULLTEXT','models','get','toLowerCase','direction','isNil','SmsInteraction','findOne','then','createdAt','catch','error','secret','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','create','body','phone','remote','/api/sms/messages/','/status?token=','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby'];(function(_0x289891,_0x49a0fa){var _0x31cf2e=function(_0x8cebce){while(--_0x8cebce){_0x289891['push'](_0x289891['shift']());}};_0x31cf2e(++_0x49a0fa);}(_0x003a,0x1b0));var _0xa003=function(_0x3f2d99,_0x1b5944){_0x3f2d99=_0x3f2d99-0x0;var _0x4c4cfd=_0x003a[_0x3f2d99];return _0x4c4cfd;};'use strict';var _=require('lodash');var util=require(_0xa003('0x0'));var logger=require(_0xa003('0x1'))(_0xa003('0x2'));var moment=require(_0xa003('0x3'));var BPromise=require(_0xa003('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa003('0x5'));var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module[_0xa003('0x6')]=function(_0x14873e,_0x53ab99){return _0x14873e[_0xa003('0x7')](_0xa003('0x8'),attributes,{'tableName':_0xa003('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa003('0xa')]},{'name':_0xa003('0xb'),'fields':['body'],'type':_0xa003('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x59df06,_0x52fcdb,_0x11c5b0){var _0x2ba114=_0x14873e[_0xa003('0xd')];var _0x150048=_0x59df06[_0xa003('0xe')]({'plain':!![]});if(_0x150048['direction'][_0xa003('0xf')]()==='in'||_0x150048[_0xa003('0x10')][_0xa003('0xf')]()==='out'&&!_0x150048['secret']&&!_[_0xa003('0x11')](_0x150048['UserId'])){_0x2ba114[_0xa003('0x12')][_0xa003('0x13')]({'where':{'id':_0x150048['SmsInteractionId']}})[_0xa003('0x14')](function(_0x4f11f6){if(_0x4f11f6){_0x4f11f6['update']({'lastMsgAt':_0x150048[_0xa003('0x15')],'lastMsgDirection':_0x150048[_0xa003('0x10')][_0xa003('0xf')]()});}})[_0xa003('0x16')](function(_0x3698d1){console[_0xa003('0x17')](_0x3698d1);});}if(_0x150048['direction']==='out'&&!_0x150048[_0xa003('0x18')]){var _0x448db4;_0x2ba114[_0xa003('0x19')]['find']({'where':{'id':_0x150048[_0xa003('0x1a')]},'raw':!![]})['then'](function(_0x5211da){_0x448db4=_0x5211da;if(_0x448db4&&_0x448db4[_0xa003('0x1b')]){switch(_0x448db4[_0xa003('0x1b')]){case _0xa003('0x1c'):var _0x36cae3=require('twilio');if(_0x448db4[_0xa003('0x1d')]&&_0x448db4[_0xa003('0x1e')]&&_0x448db4['phone']){var _0x146b71=new _0x36cae3(_0x448db4[_0xa003('0x1d')],_0x448db4[_0xa003('0x1e')]);_0x146b71['messages'][_0xa003('0x1f')]({'body':_0x150048[_0xa003('0x20')],'to':_0x150048[_0xa003('0x21')],'from':_0x448db4[_0xa003('0x21')],'statusCallback':_0x448db4[_0xa003('0x22')]+_0xa003('0x23')+_0x150048['id']+_0xa003('0x24')+_0x448db4['token']})[_0xa003('0x14')](function(_0x4dfe6e){if(_0x4dfe6e[_0xa003('0x25')]){return _0x59df06[_0xa003('0x26')]({'messageId':_0x4dfe6e[_0xa003('0x25')]});}})['catch'](function(_0xbba76b){logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),'twilio',util[_0xa003('0x29')](_0xbba76b,{'showHidden':![],'depth':null}));});}else{logger[_0xa003('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa003('0x28'),_0xa003('0x1c'),_0xa003('0x2a'));}break;case _0xa003('0x2b'):var _0x24fad8=_0xa003('0x2c');if(_0x448db4[_0xa003('0x2d')]&&_0x448db4['password']){var _0x3eac8b={'recipient':[_0x150048[_0xa003('0x21')]],'message':_0x150048[_0xa003('0x20')],'message_type':_0x448db4['smsMethod']};if(_0x448db4[_0xa003('0x2e')]&&_0x448db4[_0xa003('0x2e')]!=='SI'){_0x3eac8b[_0xa003('0x2f')]=_0x448db4[_0xa003('0x21')];}var _0x553407={'url':_0x24fad8+_0xa003('0x30')+_0x448db4[_0xa003('0x2d')]+_0xa003('0x31')+_0x448db4['password'],'method':_0xa003('0x32')};rp(_0x553407)['then'](function(_0x4b7c80){var _0x59d82a=_0x4b7c80[_0xa003('0x33')](';');var _0x2e085e={'user_key':_0x59d82a[0x0],'session_key':_0x59d82a[0x1]};_0x553407={'url':_0x24fad8+_0xa003('0x34'),'method':_0xa003('0x35'),'headers':{'user_key':_0x2e085e[_0xa003('0x36')],'Session_key':_0x2e085e[_0xa003('0x37')]},'json':!![],'body':_0x3eac8b};return rp(_0x553407);})[_0xa003('0x14')](function(_0x517f3a){if(_0x517f3a[_0xa003('0x38')]>=0x1){var _0x34fcca={'messageId':_0x517f3a[_0xa003('0x39')]};if(_0x448db4[_0xa003('0x2e')]!=='GP'||!_0x448db4['deliveryReport']){_0x34fcca[_0xa003('0x3a')]=!![];}return _0x59df06[_0xa003('0x26')](_0x34fcca);}else{return logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x2b'),util[_0xa003('0x29')](_0x517f3a,{'showHidden':![],'depth':null}));}})[_0xa003('0x16')](function(_0x216b2d){return logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x2b'),util[_0xa003('0x29')](_0x216b2d,{'showHidden':![],'depth':null}));});}else{logger[_0xa003('0x17')](_0xa003('0x27'),'afterCreate',_0xa003('0x2b'),_0xa003('0x3b'));}break;case _0xa003('0x3c'):if(_0x448db4[_0xa003('0x1e')]){var _0x56cebd={'recipient':_0x150048[_0xa003('0x21')],'message':_0x150048[_0xa003('0x20')],'sender':_0x448db4['senderString']||_0x448db4[_0xa003('0x21')],'authorization':_0x448db4['authToken']};var _0x52fcdb={'method':_0xa003('0x35'),'uri':_0xa003('0x3d'),'body':_0x56cebd,'json':!![]};rp(_0x52fcdb)[_0xa003('0x14')](function(_0x190121){var _0x18f703={'messageId':_0x190121[_0xa003('0x3e')]};if(!_0x448db4[_0xa003('0x3f')]){_0x18f703[_0xa003('0x3a')]=!![];}return _0x59df06[_0xa003('0x26')](_0x18f703);})[_0xa003('0x16')](function(_0x2cd8bd){logger[_0xa003('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa003('0x28'),_0xa003('0x3c'),util['inspect'](_0x2cd8bd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x3c'),'Missing\x20parameters:\x20authToken');}break;case _0xa003('0x40'):if(_0x448db4[_0xa003('0x2d')]&&_0x448db4[_0xa003('0x41')]){var _0x56cebd={'messages':[{'source':_0xa003('0x42'),'to':_0x150048[_0xa003('0x21')],'body':_0x150048[_0xa003('0x20')],'from':_0x448db4['senderString']||_0x448db4[_0xa003('0x21')]}]};var _0x303aca=util[_0xa003('0x43')](_0xa003('0x44'),_0x448db4['username'],_0x448db4[_0xa003('0x41')]);var _0x52fcdb={'method':_0xa003('0x35'),'uri':_0xa003('0x45'),'body':_0x56cebd,'headers':{'Authorization':util[_0xa003('0x43')](_0xa003('0x46'),new Buffer(_0x303aca)[_0xa003('0x47')]('base64'))},'json':!![]};rp(_0x52fcdb)[_0xa003('0x14')](function(_0x5938b6){if(_0x5938b6[_0xa003('0x48')]>=0xc8&&_0x5938b6[_0xa003('0x48')]<=0xce){if(_0x5938b6['data']&&_0x5938b6[_0xa003('0x49')][_0xa003('0x4a')]>0x0){var _0x4a5dc9=_[_0xa003('0x4b')](_0x5938b6[_0xa003('0x49')][_0xa003('0x4c')]);var _0x318577={'messageId':_0x4a5dc9[_0xa003('0x4d')]};if(!_0x448db4[_0xa003('0x3f')]){_0x318577[_0xa003('0x3a')]=!![];}return _0x59df06[_0xa003('0x26')](_0x318577);}else{logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x4e'),util[_0xa003('0x29')](_0x5938b6,{'showHidden':![],'depth':null}));}}else{logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x4e'),util[_0xa003('0x29')](_0x5938b6,{'showHidden':![],'depth':null}));}})[_0xa003('0x16')](function(_0x7bc5e8){logger['error'](_0xa003('0x27'),'afterCreate',_0xa003('0x4e'),util[_0xa003('0x29')](_0x7bc5e8,{'showHidden':![],'depth':null}));});}else{logger[_0xa003('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa003('0x28'),_0xa003('0x4e'),_0xa003('0x3b'));}break;case _0xa003('0x4f'):if(_0x448db4[_0xa003('0x50')]&&_0x448db4[_0xa003('0x1e')]){var _0x56cebd={'dst':_0x150048[_0xa003('0x21')],'text':_0x150048[_0xa003('0x20')],'src':_0x448db4['senderString']||_0x448db4[_0xa003('0x21')],'url':_0x448db4[_0xa003('0x22')]+_0xa003('0x23')+_0x150048['id']+_0xa003('0x24')+_0x448db4[_0xa003('0x51')]};var _0x303aca=util[_0xa003('0x43')]('%s:%s',_0x448db4[_0xa003('0x50')],_0x448db4['authToken']);var _0x52fcdb={'method':_0xa003('0x35'),'uri':util['format'](_0xa003('0x52'),_0x448db4[_0xa003('0x50')]),'body':_0x56cebd,'headers':{'Authorization':util['format'](_0xa003('0x46'),new Buffer(_0x303aca)[_0xa003('0x47')](_0xa003('0x53')))},'json':!![]};rp(_0x52fcdb)[_0xa003('0x14')](function(_0x45fbc4){var _0x2045b6={'messageId':_0x45fbc4[_0xa003('0x54')][0x0]};return _0x59df06[_0xa003('0x26')](_0x2045b6);})[_0xa003('0x16')](function(_0x26bb86){logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x4f'),util['inspect'](_0x26bb86,{'showHidden':![],'depth':null}));});}else{logger[_0xa003('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa003('0x28'),'plivo',_0xa003('0x55'));}break;case _0xa003('0x56'):if(_0x448db4[_0xa003('0x2d')]&&_0x448db4[_0xa003('0x41')]){if(_0x448db4[_0xa003('0x57')]){var _0x14f904={'method':_0xa003('0x35'),'uri':_0x448db4[_0xa003('0x57')]+_0xa003('0x58'),'body':{'username':_0x448db4[_0xa003('0x2d')],'password':_0x448db4['password']},'json':!![]};return rp(_0x14f904)['then'](function(_0x55d069){var _0x5b8fa5={'method':_0xa003('0x35'),'uri':_0x448db4['baseUrl']+_0xa003('0x59'),'body':{'messages':[{'from':_0x448db4[_0xa003('0x21')],'destinations':[{'to':_0x150048[_0xa003('0x21')]}],'text':_0x150048[_0xa003('0x20')],'notifyUrl':_0x448db4[_0xa003('0x22')]+_0xa003('0x23')+_0x150048['id']+_0xa003('0x24')+_0x448db4[_0xa003('0x51')],'notifyContentType':'application/json','callbackData':_0x448db4[_0xa003('0x21')]+';'+_0x150048[_0xa003('0x20')]}]},'headers':{'Authorization':_0xa003('0x5a')+_0x55d069[_0xa003('0x51')]},'json':!![]};return rp(_0x5b8fa5)['then'](function(_0x565690){if(_0x565690[_0xa003('0x4c')]){var _0x1aec36={'messageId':_0x565690[_0xa003('0x4c')][0x0]['messageId']};if(!_0x448db4[_0xa003('0x3f')]){_0x1aec36[_0xa003('0x3a')]=!![];}return _0x59df06[_0xa003('0x26')](_0x1aec36);}else{return logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x56'),util[_0xa003('0x29')](_0x565690,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x2fd3c4){return logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x56'),util[_0xa003('0x29')](_0x2fd3c4,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x56'),_0xa003('0x5b'));}}else{logger[_0xa003('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa003('0x56'),_0xa003('0x3b'));}break;case _0xa003('0x5c'):var _0x348581=require(_0xa003('0x5d'));if(_0x448db4['apiKey']){var _0x40298c={};_0x40298c[_0xa003('0x5e')]=_0x448db4[_0xa003('0x2d')];_0x40298c[_0xa003('0x21')]=_0x150048[_0xa003('0x21')];_0x40298c[_0xa003('0x2f')]=_0x448db4['phone'];_0x40298c[_0xa003('0x5f')]=_0x150048['body'];_0x40298c[_0xa003('0x60')]=+new Date();var _0x14cb1='';var _0x912c0='';var _0x1e440b=Object[_0xa003('0x61')](_0x40298c);_0x1e440b[_0xa003('0x62')]();for(var _0x2c1e7a=0x0;_0x2c1e7a<_0x1e440b['length'];_0x2c1e7a++){if(_0x14cb1!=''){_0x14cb1+='&';}_0x14cb1+=_0x1e440b[_0x2c1e7a]+'='+encodeURIComponent(_0x40298c[_0x1e440b[_0x2c1e7a]]);_0x912c0+=_0x40298c[_0x1e440b[_0x2c1e7a]];}_0x912c0+=_0x448db4[_0xa003('0x63')];_0x912c0=_0x348581[_0xa003('0x64')]('md5')['update'](_0x912c0)['digest'](_0xa003('0x65'));if(_0x14cb1!==''){_0x14cb1+='&';}_0x14cb1+=_0xa003('0x66')+_0x912c0;var _0x553407={'method':'GET','uri':_0x448db4[_0xa003('0x57')]+_0xa003('0x67')+_0x14cb1,'json':!![]};return rp(_0x553407)['then'](function(_0x54dc96){var _0x21ff36=Object[_0xa003('0x61')](_0x54dc96);if(_0x54dc96[_0x21ff36[0x0]][_0xa003('0x17')]&&parseInt(_0x54dc96[_0x21ff36[0x0]][_0xa003('0x17')])===0x0){var _0x253367={'messageId':_0x54dc96[_0x21ff36[0x0]][_0xa003('0x68')]};if(!_0x448db4[_0xa003('0x3f')]){_0x253367[_0xa003('0x3a')]=!![];}return _0x59df06[_0xa003('0x26')](_0x253367);}else{return logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x5c'),util[_0xa003('0x29')](_0x54dc96['error'],{'showHidden':![],'depth':null}));}})[_0xa003('0x16')](function(_0x1e62f8){return logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),'csc',util[_0xa003('0x29')](_0x1e62f8,{'showHidden':![],'depth':null}));});}else{logger[_0xa003('0x17')](_0xa003('0x27'),'afterCreate',_0xa003('0x5c'),'Missing\x20parameters:\x20apiKey');}break;case _0xa003('0x69'):if(_0x448db4['apiKey']){var _0x48ad77={'method':_0xa003('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x448db4[_0xa003('0x63')]},'body':{'content':_0x150048[_0xa003('0x20')],'to':[_0x150048[_0xa003('0x21')]],'from':_0x448db4[_0xa003('0x21')],'binary':![],'clientMessageId':'uuid','charset':_0xa003('0x6a')},'json':!![]};rp(_0x48ad77)[_0xa003('0x14')](function(_0x5db36b){if(!_0x5db36b['error']){var _0x248a0b={'messageId':_0x5db36b['messages'][0x0][_0xa003('0x6b')]};if(!_0x448db4['deliveryReport']){_0x248a0b['read']=!![];}return _0x59df06[_0xa003('0x26')](_0x248a0b);}else{return logger['error'](_0xa003('0x27'),'afterCreate','clickatell',util[_0xa003('0x29')](_0x5db36b[_0xa003('0x17')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x1908a3){return logger[_0xa003('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa003('0x69'),util[_0xa003('0x29')](_0x1908a3,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa003('0x27'),_0xa003('0x28'),'clickatell',_0xa003('0x6c'));}break;case _0xa003('0x6d'):if(_0x448db4[_0xa003('0x63')]){var _0x8d9c34={};var _0x553407={'method':_0xa003('0x35'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0xa003('0x6e')+_0x448db4[_0xa003('0x63')],'Content-Type':_0xa003('0x6f')},'body':{'from':_0x448db4[_0xa003('0x21')],'to':_0x150048[_0xa003('0x21')],'text':_0x150048[_0xa003('0x20')]},'json':!![]};return rp(_0x553407)[_0xa003('0x14')](function(_0x1c58b7){if(_0x1c58b7['code']==0xca){_0x8d9c34['message']=_0x1c58b7;var _0x519337={'method':'POST','uri':_0xa003('0x70'),'headers':{'Authorization':_0xa003('0x6e')+_0x448db4[_0xa003('0x63')],'Content-Type':_0xa003('0x6f')},'body':{'refid':_0x8d9c34[_0xa003('0x71')][_0xa003('0x72')]},'json':!![]};return rp(_0x519337)[_0xa003('0x14')](function(_0x54ce5a){_0x8d9c34[_0xa003('0x73')]=_0x54ce5a;var _0x12c7b2={'messageId':_0x8d9c34['message'][_0xa003('0x72')],'read':!![]};return _0x59df06[_0xa003('0x26')](_0x12c7b2);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa003('0x28'),_0xa003('0x6d'),util[_0xa003('0x29')](_0x1c58b7,{'showHidden':![],'depth':null}));}})[_0xa003('0x16')](function(_0x35129b){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa003('0x28'),'intelepeer',util[_0xa003('0x29')](_0x35129b,{'showHidden':![],'depth':null}));});}else{return logger[_0xa003('0x17')](_0xa003('0x27'),_0xa003('0x28'),_0xa003('0x6d'),_0xa003('0x74'));}break;}}})['finally'](function(){_0x11c5b0();});}else{_0x11c5b0();}}},'charset':_0xa003('0x75'),'collate':_0xa003('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 6a27e2f..dabf016 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 _0x14a0=['code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x53fab2,_0x3b04f4){var _0x57ebe6=function(_0x13543e){while(--_0x13543e){_0x53fab2['push'](_0x53fab2['shift']());}};_0x57ebe6(++_0x3b04f4);}(_0x14a0,0x8e));var _0x014a=function(_0x456a22,_0x46356d){_0x456a22=_0x456a22-0x0;var _0xd81882=_0x14a0[_0x456a22];return _0xd81882;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});config['redis']=_[_0x014a('0xa')](config[_0x014a('0xb')],{'host':_0x014a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x014a('0xd'))['register'](socket);function respondWithRpcPromise(_0x490ea2,_0x5aa52f,_0x4f3539){return new BPromise(function(_0x330469,_0x4c7418){return client[_0x014a('0xe')](_0x490ea2,_0x4f3539)[_0x014a('0xf')](function(_0x543bbf){logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));logger[_0x014a('0x13')](_0x014a('0x14'),_0x5aa52f,_0x014a('0x12'),JSON[_0x014a('0x15')](_0x543bbf));if(_0x543bbf[_0x014a('0x16')]){if(_0x543bbf[_0x014a('0x16')][_0x014a('0x17')]===0x1f4){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x4c7418(_0x543bbf[_0x014a('0x16')]['message']);}logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x330469(_0x543bbf[_0x014a('0x16')][_0x014a('0x18')]);}else{logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));_0x330469(_0x543bbf[_0x014a('0x19')][_0x014a('0x18')]);}})[_0x014a('0x1a')](function(_0x3b9341){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x3b9341);_0x4c7418(_0x3b9341);});});}exports[_0x014a('0x1b')]=function(_0x34e5c3){var _0x5c69c5=this;return new Promise(function(_0x359903,_0x109a9c){return db[_0x014a('0x1c')][_0x014a('0x1d')](_0x34e5c3[_0x014a('0x1e')],{'raw':_0x34e5c3[_0x014a('0x1f')]?_0x34e5c3[_0x014a('0x1f')][_0x014a('0x20')]===undefined?!![]:![]:!![]})[_0x014a('0xf')](function(_0x486e66){logger[_0x014a('0x10')]('CreateSmsMessage',_0x34e5c3);logger[_0x014a('0x13')](_0x014a('0x1b'),_0x34e5c3,JSON[_0x014a('0x15')](_0x486e66));_0x359903(_0x486e66);})[_0x014a('0x1a')](function(_0x2b3c10){logger[_0x014a('0x16')](_0x014a('0x1b'),_0x2b3c10[_0x014a('0x18')],_0x34e5c3);_0x109a9c(_0x5c69c5[_0x014a('0x16')](0x1f4,_0x2b3c10['message']));});});}; \ No newline at end of file +var _0xb10b=['options','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','body'];(function(_0x5d8da5,_0x2741a7){var _0x29f058=function(_0x347ed4){while(--_0x347ed4){_0x5d8da5['push'](_0x5d8da5['shift']());}};_0x29f058(++_0x2741a7);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ab8f8,_0x387f87){_0x1ab8f8=_0x1ab8f8-0x0;var _0x777a63=_0xb10b[_0x1ab8f8];return _0x777a63;};'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});config[_0xbb10('0xb')]=_['defaults'](config[_0xbb10('0xb')],{'host':_0xbb10('0xc'),'port':0x18eb});var socket=require(_0xbb10('0xd'))(new Redis(config[_0xbb10('0xb')]));require(_0xbb10('0xe'))[_0xbb10('0xf')](socket);function respondWithRpcPromise(_0x229887,_0xa3adc8,_0x5ab04a){return new BPromise(function(_0x4e47f8,_0x20bd61){return client[_0xbb10('0x10')](_0x229887,_0x5ab04a)[_0xbb10('0x11')](function(_0x5e136d){logger[_0xbb10('0x12')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbb10('0x13'));logger[_0xbb10('0x14')](_0xbb10('0x15'),_0xa3adc8,_0xbb10('0x13'),JSON[_0xbb10('0x16')](_0x5e136d));if(_0x5e136d[_0xbb10('0x17')]){if(_0x5e136d['error'][_0xbb10('0x18')]===0x1f4){logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);return _0x20bd61(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}logger[_0xbb10('0x17')](_0xbb10('0x19'),_0xa3adc8,_0x5e136d[_0xbb10('0x17')]['message']);return _0x4e47f8(_0x5e136d[_0xbb10('0x17')][_0xbb10('0x1a')]);}else{logger[_0xbb10('0x12')](_0xbb10('0x19'),_0xa3adc8,_0xbb10('0x13'));_0x4e47f8(_0x5e136d[_0xbb10('0x1b')][_0xbb10('0x1a')]);}})[_0xbb10('0x1c')](function(_0xbf2906){logger[_0xbb10('0x17')]('SmsMessage,\x20%s,\x20%s',_0xa3adc8,_0xbf2906);_0x20bd61(_0xbf2906);});});}exports[_0xbb10('0x1d')]=function(_0x19f48d){var _0x388fab=this;return new Promise(function(_0x109908,_0xdf237d){return db[_0xbb10('0x1e')]['create'](_0x19f48d[_0xbb10('0x1f')],{'raw':_0x19f48d[_0xbb10('0x20')]?_0x19f48d['options']['raw']===undefined?!![]:![]:!![]})[_0xbb10('0x11')](function(_0x311abe){logger[_0xbb10('0x12')](_0xbb10('0x1d'),_0x19f48d);logger[_0xbb10('0x14')](_0xbb10('0x1d'),_0x19f48d,JSON[_0xbb10('0x16')](_0x311abe));_0x109908(_0x311abe);})[_0xbb10('0x1c')](function(_0x7f2377){logger[_0xbb10('0x17')](_0xbb10('0x1d'),_0x7f2377[_0xbb10('0x1a')],_0x19f48d);_0xdf237d(_0x388fab['error'](0x1f4,_0x7f2377['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index c467509..2f7e2f3 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 _0x92b5=['remove','update','emit','removeListener','smsMessage:','./smsMessage.events','save'];(function(_0x2e41c6,_0x1c39e8){var _0x2d2879=function(_0x196c8f){while(--_0x196c8f){_0x2e41c6['push'](_0x2e41c6['shift']());}};_0x2d2879(++_0x1c39e8);}(_0x92b5,0x194));var _0x592b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x92b5[_0x2dafbe];return _0x58a45a;};'use strict';var SmsMessageEvents=require(_0x592b('0x0'));var events=[_0x592b('0x1'),_0x592b('0x2'),_0x592b('0x3')];function createListener(_0x3e04e3,_0x172f3e){return function(_0x2301f9){_0x172f3e[_0x592b('0x4')](_0x3e04e3,_0x2301f9);};}function removeListener(_0x3825a0,_0x354a3c){return function(){SmsMessageEvents[_0x592b('0x5')](_0x3825a0,_0x354a3c);};}exports['register']=function(_0x1c1705){for(var _0x462364=0x0,_0x51ff86=events['length'];_0x462364<_0x51ff86;_0x462364++){var _0x474295=events[_0x462364];var _0x45cc13=createListener(_0x592b('0x6')+_0x474295,_0x1c1705);SmsMessageEvents['on'](_0x474295,_0x45cc13);}}; \ No newline at end of file +var _0xbf94=['update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','remove'];(function(_0x3cd87a,_0x3f6d3f){var _0x52035e=function(_0x4e9131){while(--_0x4e9131){_0x3cd87a['push'](_0x3cd87a['shift']());}};_0x52035e(++_0x3f6d3f);}(_0xbf94,0x196));var _0x4bf9=function(_0x587c68,_0x1733f5){_0x587c68=_0x587c68-0x0;var _0x14c8f0=_0xbf94[_0x587c68];return _0x14c8f0;};'use strict';var SmsMessageEvents=require(_0x4bf9('0x0'));var events=['save',_0x4bf9('0x1'),_0x4bf9('0x2')];function createListener(_0x56d83b,_0x191c36){return function(_0x539a47){_0x191c36[_0x4bf9('0x3')](_0x56d83b,_0x539a47);};}function removeListener(_0x3bdf57,_0x491561){return function(){SmsMessageEvents[_0x4bf9('0x4')](_0x3bdf57,_0x491561);};}exports[_0x4bf9('0x5')]=function(_0x4f0b0c){for(var _0xbe303a=0x0,_0x182b9d=events[_0x4bf9('0x6')];_0xbe303a<_0x182b9d;_0xbe303a++){var _0x2c7a7b=events[_0xbe303a];var _0x422600=createListener(_0x4bf9('0x7')+_0x2c7a7b,_0x4f0b0c);SmsMessageEvents['on'](_0x2c7a7b,_0x422600);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index a3413fb..8113cd2 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 _0xc949=['addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x4e5f8c,_0x45d226){var _0x5bebda=function(_0x3becec){while(--_0x3becec){_0x4e5f8c['push'](_0x4e5f8c['shift']());}};_0x5bebda(++_0x45d226);}(_0xc949,0x181));var _0x9c94=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc949[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9c94('0x5'));var config=require(_0x9c94('0x6'));var controller=require('./smsQueue.controller');router[_0x9c94('0x7')]('/',auth[_0x9c94('0x8')](),controller[_0x9c94('0x9')]);router[_0x9c94('0x7')]('/describe',auth[_0x9c94('0x8')](),controller[_0x9c94('0xa')]);router[_0x9c94('0x7')](_0x9c94('0xb'),auth[_0x9c94('0x8')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x7')](_0x9c94('0xd'),auth[_0x9c94('0x8')](),controller[_0x9c94('0xe')]);router['get'](_0x9c94('0xf'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x10')]);router[_0x9c94('0x7')](_0x9c94('0x11'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x12')]);router[_0x9c94('0x13')]('/',auth[_0x9c94('0x8')](),controller[_0x9c94('0x14')]);router[_0x9c94('0x13')](_0x9c94('0xf'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x15')]);router['post'](_0x9c94('0x11'),auth['isAuthenticated'](),controller[_0x9c94('0x16')]);router[_0x9c94('0x17')]('/:id',auth[_0x9c94('0x8')](),controller['update']);router['delete'](_0x9c94('0xb'),auth['isAuthenticated'](),controller[_0x9c94('0x18')]);router[_0x9c94('0x19')]('/:id/teams',auth[_0x9c94('0x8')](),controller[_0x9c94('0x1a')]);router[_0x9c94('0x19')](_0x9c94('0x11'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x1b')]);module[_0x9c94('0x1c')]=router; \ No newline at end of file +var _0x2428=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','/describe','describe','show','/:id/members','getMembers','post','/:id/teams','addAgents','put','/:id','update','delete','destroy','removeTeams','/:id/users','exports','util','path','connect-timeout','express','Router'];(function(_0x31e5cb,_0x2f5adf){var _0x4170df=function(_0x31c53e){while(--_0x31c53e){_0x31e5cb['push'](_0x31e5cb['shift']());}};_0x4170df(++_0x2f5adf);}(_0x2428,0xd3));var _0x8242=function(_0xca8c54,_0x10b227){_0xca8c54=_0xca8c54-0x0;var _0x52b03b=_0x2428[_0xca8c54];return _0x52b03b;};'use strict';var multer=require('multer');var util=require(_0x8242('0x0'));var path=require(_0x8242('0x1'));var timeout=require(_0x8242('0x2'));var express=require(_0x8242('0x3'));var router=express[_0x8242('0x4')]();var auth=require(_0x8242('0x5'));var interaction=require(_0x8242('0x6'));var config=require(_0x8242('0x7'));var controller=require(_0x8242('0x8'));router[_0x8242('0x9')]('/',auth[_0x8242('0xa')](),controller['index']);router[_0x8242('0x9')](_0x8242('0xb'),auth[_0x8242('0xa')](),controller[_0x8242('0xc')]);router[_0x8242('0x9')]('/:id',auth[_0x8242('0xa')](),controller[_0x8242('0xd')]);router[_0x8242('0x9')](_0x8242('0xe'),auth['isAuthenticated'](),controller[_0x8242('0xf')]);router[_0x8242('0x9')]('/:id/teams',auth[_0x8242('0xa')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x8242('0x10')]('/',auth[_0x8242('0xa')](),controller['create']);router['post'](_0x8242('0x11'),auth[_0x8242('0xa')](),controller['addTeams']);router[_0x8242('0x10')]('/:id/users',auth[_0x8242('0xa')](),controller[_0x8242('0x12')]);router[_0x8242('0x13')](_0x8242('0x14'),auth[_0x8242('0xa')](),controller[_0x8242('0x15')]);router[_0x8242('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x8242('0x17')]);router[_0x8242('0x16')](_0x8242('0x11'),auth[_0x8242('0xa')](),controller[_0x8242('0x18')]);router[_0x8242('0x16')](_0x8242('0x19'),auth[_0x8242('0xa')](),controller['removeAgents']);module[_0x8242('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index a692f91..e048fe3 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 _0x32ea=['sequelize','exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32ea,0x126));var _0xa32e=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0x32ea[_0x4a82ac];return _0x58ee97;};'use strict';var Sequelize=require(_0xa32e('0x0'));module[_0xa32e('0x1')]={'name':{'type':Sequelize[_0xa32e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa32e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa32e('0x3')](_0xa32e('0x4'),_0xa32e('0x5'),_0xa32e('0x6'))}}; \ No newline at end of file +var _0x12ae=['roundrobin','exports','STRING','ENUM','rrmemory','beepall'];(function(_0x3a2fb6,_0x40f20e){var _0x25de93=function(_0x57ea53){while(--_0x57ea53){_0x3a2fb6['push'](_0x3a2fb6['shift']());}};_0x25de93(++_0x40f20e);}(_0x12ae,0x175));var _0xe12a=function(_0x1f4920,_0x3e010c){_0x1f4920=_0x1f4920-0x0;var _0x1f062b=_0x12ae[_0x1f4920];return _0x1f062b;};'use strict';var Sequelize=require('sequelize');module[_0xe12a('0x0')]={'name':{'type':Sequelize[_0xe12a('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe12a('0x2')](_0xe12a('0x3'),_0xe12a('0x4'),_0xe12a('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index af2a86a..113959e 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 _0x0b0e=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','offset','Content-Range','apply','reject','update','then','get','SmsQueues','destroy','end','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserSmsQueue','findAndCountAll','UserId','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','forEach','omit','spread','userSmsQueue:remove','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0x0b0e[_0x1f27df];return _0x286ee2;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];config[_0xe0b0('0x17')]=_[_0xe0b0('0x18')](config[_0xe0b0('0x17')],{'host':_0xe0b0('0x19'),'port':0x18eb});var socket=require(_0xe0b0('0x1a'))(new Redis(config['redis']));require(_0xe0b0('0x1b'))[_0xe0b0('0x1c')](socket);function respondWithStatusCode(_0x743318,_0x24babd){_0x24babd=_0x24babd||0xcc;return function(_0x177c24){if(_0x177c24){return _0x743318['sendStatus'](_0x24babd);}return _0x743318[_0xe0b0('0x1d')](_0x24babd)['end']();};}function respondWithResult(_0x35cb40,_0xadee6e){_0xadee6e=_0xadee6e||0xc8;return function(_0x519ae8){if(_0x519ae8){return _0x35cb40[_0xe0b0('0x1d')](_0xadee6e)['json'](_0x519ae8);}};}function respondWithFilteredResult(_0x2d6fb6,_0x100204){return function(_0x56bcc7){if(_0x56bcc7){var _0x54a3eb=_0x56bcc7['count'],_0x46bb44=_0x100204[_0xe0b0('0x1e')],_0x50a441=_0x100204['offset']+_0x100204['limit'],_0x4df8da;if(_0x50a441>=_0x54a3eb){_0x50a441=_0x54a3eb;_0x4df8da=0xc8;}else{_0x4df8da=0xce;}_0x2d6fb6[_0xe0b0('0x1d')](_0x4df8da);return _0x2d6fb6['set'](_0xe0b0('0x1f'),_0x46bb44+'-'+_0x50a441+'/'+_0x54a3eb)['json'](_0x56bcc7);}return null;};}function patchUpdates(_0x2c84cc){return function(_0x1cd7c4){try{jsonpatch[_0xe0b0('0x20')](_0x1cd7c4,_0x2c84cc,!![]);}catch(_0x310a6d){return BPromise[_0xe0b0('0x21')](_0x310a6d);}return _0x1cd7c4['save']();};}function saveUpdates(_0x4cae54,_0x2fa820){return function(_0x5512bb){if(_0x5512bb){return _0x5512bb[_0xe0b0('0x22')](_0x4cae54)[_0xe0b0('0x23')](function(_0x513e63){return _0x513e63;});}return null;};}function removeEntity(_0x170ad8,_0x503883){return function(_0x2208d0){if(_0x2208d0){return _0x2208d0['destroy']()[_0xe0b0('0x23')](function(){var _0x576352=_0x2208d0[_0xe0b0('0x24')]({'plain':!![]});var _0x4de537=_0xe0b0('0x25');return db['UserProfileResource'][_0xe0b0('0x26')]({'where':{'type':_0x4de537,'resourceId':_0x576352['id']}})['then'](function(){return _0x2208d0;});})[_0xe0b0('0x23')](function(){_0x170ad8[_0xe0b0('0x1d')](0xcc)[_0xe0b0('0x27')]();});}};}function handleEntityNotFound(_0x1d91ad,_0x3ec2){return function(_0x10745d){if(!_0x10745d){_0x1d91ad['sendStatus'](0x194);}return _0x10745d;};}function handleError(_0x1444b9,_0x1b8aa8){_0x1b8aa8=_0x1b8aa8||0x1f4;return function(_0x5b7a64){logger[_0xe0b0('0x28')](_0x5b7a64[_0xe0b0('0x29')]);if(_0x5b7a64[_0xe0b0('0x2a')]){delete _0x5b7a64[_0xe0b0('0x2a')];}_0x1444b9[_0xe0b0('0x1d')](_0x1b8aa8)[_0xe0b0('0x2b')](_0x5b7a64);};}exports[_0xe0b0('0x2c')]=function(_0x4fb3b7,_0x1854b8){var _0x3c0109={},_0x48a9b5={},_0x4fe400={'count':0x0,'rows':[]};var _0x158b7f=_[_0xe0b0('0x2d')](db[_0xe0b0('0x2e')][_0xe0b0('0x2f')],function(_0x2ab1b1){return{'name':_0x2ab1b1['fieldName'],'type':_0x2ab1b1[_0xe0b0('0x30')][_0xe0b0('0x31')]};});_0x48a9b5[_0xe0b0('0x32')]=_[_0xe0b0('0x2d')](_0x158b7f,_0xe0b0('0x2a'));_0x48a9b5['query']=_[_0xe0b0('0x33')](_0x4fb3b7[_0xe0b0('0x34')]);_0x48a9b5[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x48a9b5[_0xe0b0('0x32')],_0x48a9b5[_0xe0b0('0x34')]);_0x3c0109[_0xe0b0('0x37')]=_[_0xe0b0('0x36')](_0x48a9b5[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x38')]));_0x3c0109[_0xe0b0('0x37')]=_0x3c0109[_0xe0b0('0x37')][_0xe0b0('0x39')]?_0x3c0109['attributes']:_0x48a9b5[_0xe0b0('0x32')];if(!_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x3a')](_0xe0b0('0x3b'))){_0x3c0109[_0xe0b0('0x3c')]=qs[_0xe0b0('0x3c')](_0x4fb3b7[_0xe0b0('0x34')]['limit']);_0x3c0109['offset']=qs['offset'](_0x4fb3b7['query'][_0xe0b0('0x1e')]);}_0x3c0109[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x4fb3b7['query'][_0xe0b0('0x3e')]);_0x3c0109[_0xe0b0('0x3f')]=qs[_0xe0b0('0x35')](_[_0xe0b0('0x40')](_0x4fb3b7['query'],_0x48a9b5[_0xe0b0('0x35')]));if(_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x41')]){_0x3c0109[_0xe0b0('0x3f')]=_[_0xe0b0('0x42')](_0x3c0109[_0xe0b0('0x3f')],{'$or':_[_0xe0b0('0x2d')](_0x158b7f,function(_0x115a69){if(_0x115a69[_0xe0b0('0x30')]!=='VIRTUAL'){var _0x3e349b={};_0x3e349b[_0x115a69['name']]={'$like':'%'+_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x41')]+'%'};return _0x3e349b;}})});}_0x3c0109=_[_0xe0b0('0x42')]({},_0x3c0109,_0x4fb3b7[_0xe0b0('0x43')]);var _0x4d0f98={'where':_0x3c0109[_0xe0b0('0x3f')]};return db[_0xe0b0('0x2e')][_0xe0b0('0x44')](_0x4d0f98)[_0xe0b0('0x23')](function(_0x19c80e){_0x4fe400[_0xe0b0('0x44')]=_0x19c80e;if(_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x45')]){_0x3c0109['include']=[{'all':!![]}];}return db[_0xe0b0('0x2e')][_0xe0b0('0x46')](_0x3c0109);})['then'](function(_0x515bd2){_0x4fe400[_0xe0b0('0x47')]=_0x515bd2;return _0x4fe400;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x1854b8,_0x3c0109))['catch'](handleError(_0x1854b8,null));};exports[_0xe0b0('0x48')]=function(_0x285d61,_0x6bca5c){var _0x1c869d={'raw':!![],'where':{'id':_0x285d61['params']['id']}},_0x1a8cc7={};_0x1a8cc7['model']=_['keys'](db[_0xe0b0('0x2e')][_0xe0b0('0x2f')]);_0x1a8cc7['query']=_[_0xe0b0('0x33')](_0x285d61[_0xe0b0('0x34')]);_0x1a8cc7[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x1a8cc7[_0xe0b0('0x32')],_0x1a8cc7['query']);_0x1c869d['attributes']=_[_0xe0b0('0x36')](_0x1a8cc7[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0x285d61[_0xe0b0('0x34')][_0xe0b0('0x38')]));_0x1c869d['attributes']=_0x1c869d[_0xe0b0('0x37')][_0xe0b0('0x39')]?_0x1c869d['attributes']:_0x1a8cc7['model'];if(_0x285d61['query'][_0xe0b0('0x45')]){_0x1c869d[_0xe0b0('0x49')]=[{'all':!![]}];}_0x1c869d=_[_0xe0b0('0x42')]({},_0x1c869d,_0x285d61[_0xe0b0('0x43')]);return db['SmsQueue'][_0xe0b0('0x4a')](_0x1c869d)[_0xe0b0('0x23')](handleEntityNotFound(_0x6bca5c,null))['then'](respondWithResult(_0x6bca5c,null))['catch'](handleError(_0x6bca5c,null));};exports[_0xe0b0('0x4b')]=function(_0x1bc6e0,_0x497f4f){return db[_0xe0b0('0x2e')][_0xe0b0('0x4b')](_0x1bc6e0['body'],{})['then'](function(_0x123ad2){var _0x511679=_0x1bc6e0[_0xe0b0('0x4c')][_0xe0b0('0x24')]({'plain':!![]});if(!_0x511679)throw new Error(_0xe0b0('0x4d'));if(_0x511679[_0xe0b0('0x4e')]===_0xe0b0('0x4c')){var _0xf9e694=_0x123ad2['get']({'plain':!![]});var _0x5d018d=_0xe0b0('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x5d018d,'userProfileId':_0x511679[_0xe0b0('0x4f')]},'raw':!![]})[_0xe0b0('0x23')](function(_0x54cf7b){if(_0x54cf7b&&_0x54cf7b['autoAssociation']===0x0){return db[_0xe0b0('0x50')][_0xe0b0('0x4b')]({'name':_0xf9e694[_0xe0b0('0x2a')],'resourceId':_0xf9e694['id'],'type':_0x54cf7b[_0xe0b0('0x2a')],'sectionId':_0x54cf7b['id']},{})[_0xe0b0('0x23')](function(){return _0x123ad2;});}else{return _0x123ad2;}})[_0xe0b0('0x51')](function(_0x84fabb){logger['error'](_0xe0b0('0x52'),_0x84fabb);throw _0x84fabb;});}return _0x123ad2;})['then'](respondWithResult(_0x497f4f,0xc9))[_0xe0b0('0x51')](handleError(_0x497f4f,null));};exports['update']=function(_0x5b2055,_0x33822e){if(_0x5b2055[_0xe0b0('0x53')]['id']){delete _0x5b2055[_0xe0b0('0x53')]['id'];}return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x5b2055[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x33822e,null))[_0xe0b0('0x23')](saveUpdates(_0x5b2055[_0xe0b0('0x53')],null))['then'](respondWithResult(_0x33822e,null))[_0xe0b0('0x51')](handleError(_0x33822e,null));};exports['destroy']=function(_0x2b5553,_0x3ae36e){return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x2b5553[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x3ae36e,null))['then'](removeEntity(_0x3ae36e,null))[_0xe0b0('0x51')](handleError(_0x3ae36e,null));};exports[_0xe0b0('0x55')]=function(_0x437a15,_0x271445){return db[_0xe0b0('0x2e')][_0xe0b0('0x55')]()[_0xe0b0('0x23')](respondWithResult(_0x271445,null))[_0xe0b0('0x51')](handleError(_0x271445,null));};exports[_0xe0b0('0x56')]=function(_0xf331df,_0x1eb5d6,_0x18ab99){var _0xc719d2={'raw':!![],'where':{}},_0x10eb99={},_0xcdf97;return db[_0xe0b0('0x2e')][_0xe0b0('0x57')]({'where':{'id':_0xf331df[_0xe0b0('0x54')]['id']}})['then'](handleEntityNotFound(_0x1eb5d6,null))[_0xe0b0('0x23')](function(_0xe7fbac){if(_0xe7fbac){_0xcdf97=_0xe7fbac[_0xe0b0('0x24')]({'plain':!![]});_0x10eb99[_0xe0b0('0x32')]=_[_0xe0b0('0x33')](db[_0xe0b0('0x58')][_0xe0b0('0x2f')]);_0x10eb99['query']=_['keys'](_0xf331df[_0xe0b0('0x34')]);_0x10eb99[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x10eb99['model'],_0x10eb99[_0xe0b0('0x34')]);_0xc719d2[_0xe0b0('0x37')]=_[_0xe0b0('0x36')](_0x10eb99[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0xf331df['query'][_0xe0b0('0x38')]));_0xc719d2[_0xe0b0('0x37')]=_0xc719d2[_0xe0b0('0x37')]['length']?_0xc719d2[_0xe0b0('0x37')]:_0x10eb99[_0xe0b0('0x32')];if(!_0xf331df['query'][_0xe0b0('0x3a')]('nolimit')){_0xc719d2['limit']=qs[_0xe0b0('0x3c')](_0xf331df['query']['limit']);_0xc719d2[_0xe0b0('0x1e')]=qs[_0xe0b0('0x1e')](_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x1e')]);}_0xc719d2['order']=qs[_0xe0b0('0x3e')](_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x3e')]);_0xc719d2[_0xe0b0('0x3f')]=qs[_0xe0b0('0x35')](_[_0xe0b0('0x40')](_0xf331df[_0xe0b0('0x34')],_0x10eb99[_0xe0b0('0x35')]));_0xc719d2['where']['SmsQueueId']=_0xe7fbac['id'];if(_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x41')]){_0xc719d2[_0xe0b0('0x3f')]=_['merge'](_0xc719d2['where'],{'$or':_[_0xe0b0('0x2d')](_0xc719d2[_0xe0b0('0x37')],function(_0x5d7cf4){var _0x5eca3d={};_0x5eca3d[_0x5d7cf4]={'$like':'%'+_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x41')]+'%'};return _0x5eca3d;})});}_0xc719d2=_[_0xe0b0('0x42')]({},_0xc719d2,_0xf331df[_0xe0b0('0x43')]);return db[_0xe0b0('0x58')][_0xe0b0('0x46')](_0xc719d2);}})[_0xe0b0('0x23')](function(_0x1b997d){if(_0x1b997d){return db['User'][_0xe0b0('0x59')]({'where':{'id':_[_0xe0b0('0x2d')](_0x1b997d,_0xe0b0('0x5a')),'role':'agent'},'attributes':['id','name','smsPause','updatedAt','createdAt']});}})['then'](function(_0x252527){if(_0x252527){return{'count':_0x252527['count'],'rows':_['map'](_0x252527[_0xe0b0('0x47')],function(_0x2dc06d){return{'membername':_0x2dc06d[_0xe0b0('0x2a')],'UserId':_0x2dc06d['id'],'queue_name':_0xcdf97[_0xe0b0('0x2a')],'SmsQueueId':_0xcdf97['id'],'interface':util[_0xe0b0('0x5b')](_0xe0b0('0x5c'),_0xe0b0('0x5d'),_0x2dc06d[_0xe0b0('0x2a')]),'penalty':0x0,'paused':_0x2dc06d['smsPause'],'createdAt':_0x2dc06d[_0xe0b0('0x5e')],'updatedAt':_0x2dc06d[_0xe0b0('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x23')](respondWithFilteredResult(_0x1eb5d6,_0xc719d2))[_0xe0b0('0x51')](handleError(_0x1eb5d6,null));};exports[_0xe0b0('0x60')]=function(_0x1f70fb,_0x16a2ae,_0x5e3e28){var _0xaf2607={};var _0x5981a3={};var _0x2c9147;var _0x28b927;return db[_0xe0b0('0x2e')][_0xe0b0('0x57')]({'where':{'id':_0x1f70fb['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x16a2ae,null))[_0xe0b0('0x23')](function(_0x49deef){if(_0x49deef){_0x2c9147=_0x49deef;_0x5981a3['model']=_[_0xe0b0('0x33')](db[_0xe0b0('0x61')][_0xe0b0('0x2f')]);_0x5981a3[_0xe0b0('0x34')]=_[_0xe0b0('0x33')](_0x1f70fb[_0xe0b0('0x34')]);_0x5981a3[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x5981a3[_0xe0b0('0x32')],_0x5981a3[_0xe0b0('0x34')]);_0xaf2607['attributes']=_['intersection'](_0x5981a3[_0xe0b0('0x32')],qs['fields'](_0x1f70fb['query']['fields']));_0xaf2607['attributes']=_0xaf2607[_0xe0b0('0x37')]['length']?_0xaf2607[_0xe0b0('0x37')]:_0x5981a3[_0xe0b0('0x32')];_0xaf2607[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x1f70fb['query'][_0xe0b0('0x3e')]);_0xaf2607[_0xe0b0('0x3f')]=qs['filters'](_[_0xe0b0('0x40')](_0x1f70fb[_0xe0b0('0x34')],_0x5981a3[_0xe0b0('0x35')]));if(_0x1f70fb[_0xe0b0('0x34')][_0xe0b0('0x41')]){_0xaf2607['where']=_['merge'](_0xaf2607['where'],{'$or':_['map'](_0xaf2607['attributes'],function(_0xfbe16d){var _0x567e1a={};_0x567e1a[_0xfbe16d]={'$like':'%'+_0x1f70fb[_0xe0b0('0x34')]['filter']+'%'};return _0x567e1a;})});}_0xaf2607=_[_0xe0b0('0x42')]({},_0xaf2607,_0x1f70fb[_0xe0b0('0x43')]);return _0x2c9147[_0xe0b0('0x60')](_0xaf2607);}})[_0xe0b0('0x23')](function(_0x199929){if(_0x199929){_0x28b927=_0x199929[_0xe0b0('0x39')];if(!_0x1f70fb['query']['hasOwnProperty']('nolimit')){_0xaf2607['limit']=qs[_0xe0b0('0x3c')](_0x1f70fb[_0xe0b0('0x34')][_0xe0b0('0x3c')]);_0xaf2607[_0xe0b0('0x1e')]=qs[_0xe0b0('0x1e')](_0x1f70fb['query'][_0xe0b0('0x1e')]);}return _0x2c9147[_0xe0b0('0x60')](_0xaf2607);}})[_0xe0b0('0x23')](function(_0xc6090e){if(_0xc6090e){return _0xc6090e?{'count':_0x28b927,'rows':_0xc6090e}:null;}})[_0xe0b0('0x23')](respondWithResult(_0x16a2ae,null))[_0xe0b0('0x51')](handleError(_0x16a2ae,null));};exports[_0xe0b0('0x62')]=function(_0x7beacf,_0x14f721,_0x5565ef){var _0x589c47=_0x7beacf[_0xe0b0('0x53')][_0xe0b0('0x63')];return db['Team'][_0xe0b0('0x46')]({'where':{'id':_0x589c47},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x64')],'as':_0xe0b0('0x65'),'attributes':['id',_0xe0b0('0x2a'),_0xe0b0('0x66'),_0xe0b0('0x67'),_0xe0b0('0x68')],'raw':!![]}]})[_0xe0b0('0x23')](function(_0x50b883){if(_0x50b883){var _0x5f4911=_['flatMap'](_0x50b883,function(_0xc19743){var _0x90d471=_0xc19743['get']({'plain':!![]});return _0x90d471[_0xe0b0('0x65')];});return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x7beacf[_0xe0b0('0x54')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x69')](function(_0x266835){return _0x56c4b9['addTeams'](_0x589c47,{'transaction':_0x266835})[_0xe0b0('0x23')](function(){return BPromise[_0xe0b0('0x6a')](_0x5f4911,function(_0x5547ee){return db['UserSmsQueue'][_0xe0b0('0x6b')]({'where':{'UserId':_0x5547ee['id'],'SmsQueueId':_0x7beacf['params']['id']},'transaction':_0x266835});});})[_0xe0b0('0x23')](function(){_0x5f4911['forEach'](function(_0x22e240){socket[_0xe0b0('0x6c')](_0xe0b0('0x6d'),{'UserId':_0x22e240['id'],'SmsQueueId':_0x56c4b9['id']});});});});});}})[_0xe0b0('0x23')](respondWithStatusCode(_0x14f721,null))[_0xe0b0('0x51')](handleError(_0x14f721,null));};exports[_0xe0b0('0x6e')]=function(_0x434dfa,_0x2ebbb5,_0xf76449){return db['Team'][_0xe0b0('0x46')]({'where':{'id':_0x434dfa[_0xe0b0('0x34')][_0xe0b0('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ebbb5,null))[_0xe0b0('0x23')](function(_0x350c40){var _0x570402=_[_0xe0b0('0x2d')](_0x350c40,'id');var _0x4e4b45=[];var _0x528932=[];var _0x4e0b18=squel['select']();_0x4e0b18['field'](_0xe0b0('0x6f'))[_0xe0b0('0x70')](_0xe0b0('0x71'),'tq')[_0xe0b0('0x72')](_0xe0b0('0x73'),'ut',_0xe0b0('0x74'))['where'](_0xe0b0('0x75'),_0x434dfa[_0xe0b0('0x54')]['id']);for(var _0x421b3b=0x0;_0x421b3b<_0x350c40['length'];_0x421b3b+=0x1){let _0x2a4f5d=_0x350c40[_0x421b3b];for(var _0x447641=0x0;_0x447641<_0x2a4f5d['Agents']['length'];_0x447641+=0x1){let _0x33f89a=_0x2a4f5d['Agents'][_0x447641];var _0x46ab89=_0x4e0b18[_0xe0b0('0x76')]();_0x46ab89[_0xe0b0('0x3f')](_0xe0b0('0x77'),_0x33f89a['id']);_0x528932[_0xe0b0('0x78')](db[_0xe0b0('0x79')][_0xe0b0('0x34')](_0x46ab89['toString'](),{'type':db[_0xe0b0('0x79')][_0xe0b0('0x7a')][_0xe0b0('0x7b')]})[_0xe0b0('0x23')](function(_0x2b087b){if(_0x2b087b['length']===0x1){return _0x33f89a['id'];}else{var _0x5b91a2=_[_0xe0b0('0x7c')](_[_0xe0b0('0x2d')](_0x2b087b,_0xe0b0('0x7d')),function(_0x268d0c){return _[_0xe0b0('0x7e')](_0x570402,_0x268d0c);});if(_0x5b91a2){return _0x33f89a['id'];}}}));}}return BPromise[_0xe0b0('0x7f')](_0x528932)[_0xe0b0('0x23')](function(_0x387389){_0x4e4b45=_(_0x4e4b45)[_0xe0b0('0x80')](_0x387389)[_0xe0b0('0x81')]()['value']();return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x434dfa[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](function(_0x55e456){return db[_0xe0b0('0x79')][_0xe0b0('0x69')](function(_0x1641dd){return _0x55e456[_0xe0b0('0x6e')](_0x434dfa[_0xe0b0('0x34')]['ids'],{'transaction':_0x1641dd})[_0xe0b0('0x23')](function(){if(!_['isEmpty'](_0x4e4b45)){return _0x55e456[_0xe0b0('0x82')](_0x4e4b45,{'transaction':_0x1641dd});}})[_0xe0b0('0x23')](function(){_0x4e4b45[_0xe0b0('0x83')](function(_0x23c448){socket[_0xe0b0('0x6c')]('userSmsQueue:remove',{'UserId':_0x23c448,'SmsQueueId':_0x55e456['id']});});});});});});})['then'](respondWithStatusCode(_0x2ebbb5,null))[_0xe0b0('0x51')](handleError(_0x2ebbb5,null));};exports['addAgents']=function(_0x436ab9,_0x4c82d6,_0x1b10be){return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x436ab9[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x4c82d6,null))[_0xe0b0('0x23')](function(_0x43ff30){if(_0x43ff30){return _0x43ff30['addAgents'](_0x436ab9['body'][_0xe0b0('0x63')],_[_0xe0b0('0x84')](_0x436ab9[_0xe0b0('0x53')],[_0xe0b0('0x63'),'id'])||{})[_0xe0b0('0x85')](function(_0x2b4d49){for(var _0x3b7a7a=0x0;_0x3b7a7a<_0x436ab9[_0xe0b0('0x53')][_0xe0b0('0x63')][_0xe0b0('0x39')];_0x3b7a7a+=0x1){socket['emit']('userSmsQueue:save',{'UserId':_0x436ab9[_0xe0b0('0x53')][_0xe0b0('0x63')][_0x3b7a7a],'SmsQueueId':_0x436ab9[_0xe0b0('0x54')]['id']});}return _0x2b4d49;});}})[_0xe0b0('0x23')](respondWithResult(_0x4c82d6,null))[_0xe0b0('0x51')](handleError(_0x4c82d6,null));};exports[_0xe0b0('0x82')]=function(_0x33b67a,_0x51995b,_0x4c4748){return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x33b67a[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x51995b,null))[_0xe0b0('0x23')](function(_0x19cc74){if(_0x19cc74){return _0x19cc74[_0xe0b0('0x82')](_0x33b67a[_0xe0b0('0x34')][_0xe0b0('0x63')])[_0xe0b0('0x23')](function(){if(_['isArray'](_0x33b67a[_0xe0b0('0x34')][_0xe0b0('0x63')])){for(var _0x47b456=0x0;_0x47b456<_0x33b67a[_0xe0b0('0x34')][_0xe0b0('0x63')][_0xe0b0('0x39')];_0x47b456+=0x1){socket[_0xe0b0('0x6c')](_0xe0b0('0x86'),{'UserId':Number(_0x33b67a['query'][_0xe0b0('0x63')][_0x47b456]),'SmsQueueId':Number(_0x33b67a[_0xe0b0('0x54')]['id'])});}}else{socket[_0xe0b0('0x6c')](_0xe0b0('0x86'),{'UserId':Number(_0x33b67a[_0xe0b0('0x34')]['ids']),'SmsQueueId':Number(_0x33b67a[_0xe0b0('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x51995b,null))[_0xe0b0('0x51')](handleError(_0x51995b,null));};exports[_0xe0b0('0x87')]=function(_0x17cc14,_0x539a12,_0x5d5e32){var _0x45ae1a={};var _0x2349df={};var _0x619226;var _0x47d9d1;return db['SmsQueue']['findOne']({'where':{'id':_0x17cc14['params']['id']}})['then'](handleEntityNotFound(_0x539a12,null))['then'](function(_0x3474ab){if(_0x3474ab){_0x619226=_0x3474ab;_0x2349df[_0xe0b0('0x32')]=_['keys'](db[_0xe0b0('0x64')][_0xe0b0('0x2f')]);_0x2349df[_0xe0b0('0x34')]=_[_0xe0b0('0x33')](_0x17cc14[_0xe0b0('0x34')]);_0x2349df['filters']=_['intersection'](_0x2349df[_0xe0b0('0x32')],_0x2349df[_0xe0b0('0x34')]);_0x45ae1a[_0xe0b0('0x37')]=_['intersection'](_0x2349df[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x38')]));_0x45ae1a[_0xe0b0('0x37')]=_0x45ae1a[_0xe0b0('0x37')]['length']?_0x45ae1a['attributes']:_0x2349df['model'];_0x45ae1a[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x3e')]);_0x45ae1a[_0xe0b0('0x3f')]=qs[_0xe0b0('0x35')](_[_0xe0b0('0x40')](_0x17cc14[_0xe0b0('0x34')],_0x2349df['filters']));if(_0x17cc14['query'][_0xe0b0('0x41')]){_0x45ae1a[_0xe0b0('0x3f')]=_[_0xe0b0('0x42')](_0x45ae1a['where'],{'$or':_[_0xe0b0('0x2d')](_0x45ae1a[_0xe0b0('0x37')],function(_0x9f1fb){var _0x4949fe={};_0x4949fe[_0x9f1fb]={'$like':'%'+_0x17cc14[_0xe0b0('0x34')]['filter']+'%'};return _0x4949fe;})});}_0x45ae1a=_[_0xe0b0('0x42')]({},_0x45ae1a,_0x17cc14[_0xe0b0('0x43')]);return _0x619226[_0xe0b0('0x87')](_0x45ae1a);}})[_0xe0b0('0x23')](function(_0x3b133a){if(_0x3b133a){_0x47d9d1=_0x3b133a[_0xe0b0('0x39')];if(!_0x17cc14[_0xe0b0('0x34')]['hasOwnProperty'](_0xe0b0('0x3b'))){_0x45ae1a[_0xe0b0('0x3c')]=qs['limit'](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x3c')]);_0x45ae1a[_0xe0b0('0x1e')]=qs['offset'](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x1e')]);}return _0x619226[_0xe0b0('0x87')](_0x45ae1a);}})['then'](function(_0xed8461){if(_0xed8461){return _0xed8461?{'count':_0x47d9d1,'rows':_0xed8461}:null;}})[_0xe0b0('0x23')](respondWithResult(_0x539a12,null))[_0xe0b0('0x51')](handleError(_0x539a12,null));}; \ No newline at end of file +var _0x5f66=['ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','removeAgents','addAgents','isArray','userSmsQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsQueue.socket','register','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','name','send','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','SmsQueue','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserSmsQueue','hasOwnProperty','SmsQueueId','map','User','findAndCountAll','UserId','smsPause','updatedAt','createdAt','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userSmsQueue:save','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65f6('0x13'))['db'];config['redis']=_[_0x65f6('0x14')](config['redis'],{'host':_0x65f6('0x15'),'port':0x18eb});var socket=require(_0x65f6('0x16'))(new Redis(config[_0x65f6('0x17')]));require(_0x65f6('0x18'))[_0x65f6('0x19')](socket);function respondWithStatusCode(_0x1d29fd,_0x44144b){_0x44144b=_0x44144b||0xcc;return function(_0xb1d40a){if(_0xb1d40a){return _0x1d29fd[_0x65f6('0x1a')](_0x44144b);}return _0x1d29fd[_0x65f6('0x1b')](_0x44144b)['end']();};}function respondWithResult(_0x19b9ff,_0x49a913){_0x49a913=_0x49a913||0xc8;return function(_0x5dd324){if(_0x5dd324){return _0x19b9ff[_0x65f6('0x1b')](_0x49a913)[_0x65f6('0x1c')](_0x5dd324);}};}function respondWithFilteredResult(_0x37330d,_0x1c955c){return function(_0x1b1cbb){if(_0x1b1cbb){var _0x1f974c=_0x1b1cbb['count'],_0xc8660c=_0x1c955c[_0x65f6('0x1d')],_0x18380e=_0x1c955c['offset']+_0x1c955c['limit'],_0x495dd6;if(_0x18380e>=_0x1f974c){_0x18380e=_0x1f974c;_0x495dd6=0xc8;}else{_0x495dd6=0xce;}_0x37330d['status'](_0x495dd6);return _0x37330d[_0x65f6('0x1e')](_0x65f6('0x1f'),_0xc8660c+'-'+_0x18380e+'/'+_0x1f974c)['json'](_0x1b1cbb);}return null;};}function patchUpdates(_0x39e19f){return function(_0x270893){try{jsonpatch[_0x65f6('0x20')](_0x270893,_0x39e19f,!![]);}catch(_0x3876ed){return BPromise[_0x65f6('0x21')](_0x3876ed);}return _0x270893[_0x65f6('0x22')]();};}function saveUpdates(_0x581374,_0x197a49){return function(_0x4bb39e){if(_0x4bb39e){return _0x4bb39e['update'](_0x581374)[_0x65f6('0x23')](function(_0xd173f4){return _0xd173f4;});}return null;};}function removeEntity(_0x524e42,_0x1eeaaa){return function(_0x471a33){if(_0x471a33){return _0x471a33[_0x65f6('0x24')]()[_0x65f6('0x23')](function(){var _0x4f5a69=_0x471a33[_0x65f6('0x25')]({'plain':!![]});var _0x59ea32=_0x65f6('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x59ea32,'resourceId':_0x4f5a69['id']}})['then'](function(){return _0x471a33;});})[_0x65f6('0x23')](function(){_0x524e42[_0x65f6('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x296cd9,_0x28f710){return function(_0x52277c){if(!_0x52277c){_0x296cd9[_0x65f6('0x1a')](0x194);}return _0x52277c;};}function handleError(_0x2bff2b,_0x28d0df){_0x28d0df=_0x28d0df||0x1f4;return function(_0x559330){logger['error'](_0x559330['stack']);if(_0x559330[_0x65f6('0x27')]){delete _0x559330[_0x65f6('0x27')];}_0x2bff2b[_0x65f6('0x1b')](_0x28d0df)[_0x65f6('0x28')](_0x559330);};}exports[_0x65f6('0x29')]=function(_0x14a387,_0x144e55){var _0x4ace4c={},_0x4ea23d={},_0x154cbd={'count':0x0,'rows':[]};var _0x27e284=_['map'](db['SmsQueue'][_0x65f6('0x2a')],function(_0x1ce43c){return{'name':_0x1ce43c[_0x65f6('0x2b')],'type':_0x1ce43c[_0x65f6('0x2c')][_0x65f6('0x2d')]};});_0x4ea23d[_0x65f6('0x2e')]=_['map'](_0x27e284,_0x65f6('0x27'));_0x4ea23d[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0x14a387['query']);_0x4ea23d[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x4ea23d[_0x65f6('0x2e')],_0x4ea23d[_0x65f6('0x2f')]);_0x4ace4c[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x4ea23d['model'],qs[_0x65f6('0x34')](_0x14a387[_0x65f6('0x2f')]['fields']));_0x4ace4c[_0x65f6('0x33')]=_0x4ace4c['attributes'][_0x65f6('0x35')]?_0x4ace4c['attributes']:_0x4ea23d[_0x65f6('0x2e')];if(!_0x14a387[_0x65f6('0x2f')]['hasOwnProperty'](_0x65f6('0x36'))){_0x4ace4c[_0x65f6('0x37')]=qs[_0x65f6('0x37')](_0x14a387['query']['limit']);_0x4ace4c[_0x65f6('0x1d')]=qs['offset'](_0x14a387[_0x65f6('0x2f')]['offset']);}_0x4ace4c[_0x65f6('0x38')]=qs[_0x65f6('0x39')](_0x14a387['query'][_0x65f6('0x39')]);_0x4ace4c['where']=qs['filters'](_[_0x65f6('0x3a')](_0x14a387[_0x65f6('0x2f')],_0x4ea23d[_0x65f6('0x31')]));if(_0x14a387[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x4ace4c[_0x65f6('0x3c')]=_[_0x65f6('0x3d')](_0x4ace4c[_0x65f6('0x3c')],{'$or':_['map'](_0x27e284,function(_0x3aa254){if(_0x3aa254['type']!==_0x65f6('0x3e')){var _0xa4394a={};_0xa4394a[_0x3aa254[_0x65f6('0x27')]]={'$like':'%'+_0x14a387[_0x65f6('0x2f')]['filter']+'%'};return _0xa4394a;}})});}_0x4ace4c=_[_0x65f6('0x3d')]({},_0x4ace4c,_0x14a387[_0x65f6('0x3f')]);var _0x413819={'where':_0x4ace4c[_0x65f6('0x3c')]};return db[_0x65f6('0x40')][_0x65f6('0x41')](_0x413819)[_0x65f6('0x23')](function(_0x2acca5){_0x154cbd[_0x65f6('0x41')]=_0x2acca5;if(_0x14a387['query'][_0x65f6('0x42')]){_0x4ace4c[_0x65f6('0x43')]=[{'all':!![]}];}return db[_0x65f6('0x40')][_0x65f6('0x44')](_0x4ace4c);})[_0x65f6('0x23')](function(_0x1ac040){_0x154cbd[_0x65f6('0x45')]=_0x1ac040;return _0x154cbd;})[_0x65f6('0x23')](respondWithFilteredResult(_0x144e55,_0x4ace4c))[_0x65f6('0x46')](handleError(_0x144e55,null));};exports[_0x65f6('0x47')]=function(_0xcf19da,_0x2c008a){var _0x6c4d94={'raw':!![],'where':{'id':_0xcf19da[_0x65f6('0x48')]['id']}},_0x27157d={};_0x27157d[_0x65f6('0x2e')]=_['keys'](db[_0x65f6('0x40')][_0x65f6('0x2a')]);_0x27157d[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0xcf19da['query']);_0x27157d[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x27157d[_0x65f6('0x2e')],_0x27157d['query']);_0x6c4d94[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x27157d[_0x65f6('0x2e')],qs[_0x65f6('0x34')](_0xcf19da['query'][_0x65f6('0x34')]));_0x6c4d94['attributes']=_0x6c4d94[_0x65f6('0x33')][_0x65f6('0x35')]?_0x6c4d94['attributes']:_0x27157d[_0x65f6('0x2e')];if(_0xcf19da['query'][_0x65f6('0x42')]){_0x6c4d94[_0x65f6('0x43')]=[{'all':!![]}];}_0x6c4d94=_[_0x65f6('0x3d')]({},_0x6c4d94,_0xcf19da[_0x65f6('0x3f')]);return db[_0x65f6('0x40')][_0x65f6('0x49')](_0x6c4d94)['then'](handleEntityNotFound(_0x2c008a,null))['then'](respondWithResult(_0x2c008a,null))[_0x65f6('0x46')](handleError(_0x2c008a,null));};exports[_0x65f6('0x4a')]=function(_0x3b647a,_0x1e9e29){return db[_0x65f6('0x40')][_0x65f6('0x4a')](_0x3b647a[_0x65f6('0x4b')],{})[_0x65f6('0x23')](function(_0x414f49){var _0x517a47=_0x3b647a[_0x65f6('0x4c')][_0x65f6('0x25')]({'plain':!![]});if(!_0x517a47)throw new Error(_0x65f6('0x4d'));if(_0x517a47['role']===_0x65f6('0x4c')){var _0x42d453=_0x414f49['get']({'plain':!![]});var _0x22d745=_0x65f6('0x26');return db['UserProfileSection'][_0x65f6('0x49')]({'where':{'name':_0x22d745,'userProfileId':_0x517a47['userProfileId']},'raw':!![]})[_0x65f6('0x23')](function(_0x3b241f){if(_0x3b241f&&_0x3b241f[_0x65f6('0x4e')]===0x0){return db['UserProfileResource'][_0x65f6('0x4a')]({'name':_0x42d453[_0x65f6('0x27')],'resourceId':_0x42d453['id'],'type':_0x3b241f['name'],'sectionId':_0x3b241f['id']},{})[_0x65f6('0x23')](function(){return _0x414f49;});}else{return _0x414f49;}})[_0x65f6('0x46')](function(_0x48a2ed){logger[_0x65f6('0x4f')](_0x65f6('0x50'),_0x48a2ed);throw _0x48a2ed;});}return _0x414f49;})[_0x65f6('0x23')](respondWithResult(_0x1e9e29,0xc9))[_0x65f6('0x46')](handleError(_0x1e9e29,null));};exports[_0x65f6('0x51')]=function(_0x2350ca,_0x1d620a){if(_0x2350ca[_0x65f6('0x4b')]['id']){delete _0x2350ca['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x2350ca[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x1d620a,null))[_0x65f6('0x23')](saveUpdates(_0x2350ca[_0x65f6('0x4b')],null))['then'](respondWithResult(_0x1d620a,null))[_0x65f6('0x46')](handleError(_0x1d620a,null));};exports[_0x65f6('0x24')]=function(_0x9ff849,_0x50f63a){return db[_0x65f6('0x40')][_0x65f6('0x49')]({'where':{'id':_0x9ff849[_0x65f6('0x48')]['id']}})['then'](handleEntityNotFound(_0x50f63a,null))['then'](removeEntity(_0x50f63a,null))[_0x65f6('0x46')](handleError(_0x50f63a,null));};exports[_0x65f6('0x52')]=function(_0x4125cb,_0x39364f){return db[_0x65f6('0x40')][_0x65f6('0x52')]()[_0x65f6('0x23')](respondWithResult(_0x39364f,null))[_0x65f6('0x46')](handleError(_0x39364f,null));};exports[_0x65f6('0x53')]=function(_0xddbd90,_0xa7eee9,_0x141fcc){var _0x30adee={'raw':!![],'where':{}},_0x3e3143={},_0x5ba9c6;return db[_0x65f6('0x40')][_0x65f6('0x54')]({'where':{'id':_0xddbd90[_0x65f6('0x48')]['id']}})['then'](handleEntityNotFound(_0xa7eee9,null))[_0x65f6('0x23')](function(_0x16dec0){if(_0x16dec0){_0x5ba9c6=_0x16dec0[_0x65f6('0x25')]({'plain':!![]});_0x3e3143[_0x65f6('0x2e')]=_['keys'](db[_0x65f6('0x55')][_0x65f6('0x2a')]);_0x3e3143[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0xddbd90['query']);_0x3e3143[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x3e3143['model'],_0x3e3143[_0x65f6('0x2f')]);_0x30adee[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x3e3143['model'],qs[_0x65f6('0x34')](_0xddbd90[_0x65f6('0x2f')][_0x65f6('0x34')]));_0x30adee[_0x65f6('0x33')]=_0x30adee[_0x65f6('0x33')][_0x65f6('0x35')]?_0x30adee['attributes']:_0x3e3143['model'];if(!_0xddbd90['query'][_0x65f6('0x56')](_0x65f6('0x36'))){_0x30adee[_0x65f6('0x37')]=qs[_0x65f6('0x37')](_0xddbd90[_0x65f6('0x2f')][_0x65f6('0x37')]);_0x30adee['offset']=qs[_0x65f6('0x1d')](_0xddbd90[_0x65f6('0x2f')]['offset']);}_0x30adee[_0x65f6('0x38')]=qs[_0x65f6('0x39')](_0xddbd90[_0x65f6('0x2f')]['sort']);_0x30adee[_0x65f6('0x3c')]=qs[_0x65f6('0x31')](_['pick'](_0xddbd90[_0x65f6('0x2f')],_0x3e3143[_0x65f6('0x31')]));_0x30adee[_0x65f6('0x3c')][_0x65f6('0x57')]=_0x16dec0['id'];if(_0xddbd90[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x30adee[_0x65f6('0x3c')]=_['merge'](_0x30adee['where'],{'$or':_[_0x65f6('0x58')](_0x30adee[_0x65f6('0x33')],function(_0x4a9524){var _0x417ba5={};_0x417ba5[_0x4a9524]={'$like':'%'+_0xddbd90['query'][_0x65f6('0x3b')]+'%'};return _0x417ba5;})});}_0x30adee=_['merge']({},_0x30adee,_0xddbd90[_0x65f6('0x3f')]);return db[_0x65f6('0x55')][_0x65f6('0x44')](_0x30adee);}})[_0x65f6('0x23')](function(_0x145aaa){if(_0x145aaa){return db[_0x65f6('0x59')][_0x65f6('0x5a')]({'where':{'id':_[_0x65f6('0x58')](_0x145aaa,_0x65f6('0x5b')),'role':'agent'},'attributes':['id','name',_0x65f6('0x5c'),_0x65f6('0x5d'),_0x65f6('0x5e')]});}})['then'](function(_0x49cd14){if(_0x49cd14){return{'count':_0x49cd14[_0x65f6('0x41')],'rows':_[_0x65f6('0x58')](_0x49cd14[_0x65f6('0x45')],function(_0xc703f9){return{'membername':_0xc703f9[_0x65f6('0x27')],'UserId':_0xc703f9['id'],'queue_name':_0x5ba9c6[_0x65f6('0x27')],'SmsQueueId':_0x5ba9c6['id'],'interface':util['format']('%s/%s',_0x65f6('0x5f'),_0xc703f9[_0x65f6('0x27')]),'penalty':0x0,'paused':_0xc703f9['smsPause'],'createdAt':_0xc703f9[_0x65f6('0x5e')],'updatedAt':_0xc703f9['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x65f6('0x23')](respondWithFilteredResult(_0xa7eee9,_0x30adee))[_0x65f6('0x46')](handleError(_0xa7eee9,null));};exports[_0x65f6('0x60')]=function(_0x16726d,_0x558888,_0x34ab7b){var _0x351d43={};var _0x11411c={};var _0x59131c;var _0x4c0511;return db[_0x65f6('0x40')]['findOne']({'where':{'id':_0x16726d[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x558888,null))[_0x65f6('0x23')](function(_0x354b90){if(_0x354b90){_0x59131c=_0x354b90;_0x11411c['model']=_['keys'](db['Team'][_0x65f6('0x2a')]);_0x11411c[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0x16726d['query']);_0x11411c[_0x65f6('0x31')]=_[_0x65f6('0x32')](_0x11411c[_0x65f6('0x2e')],_0x11411c['query']);_0x351d43[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x11411c['model'],qs[_0x65f6('0x34')](_0x16726d[_0x65f6('0x2f')]['fields']));_0x351d43[_0x65f6('0x33')]=_0x351d43['attributes'][_0x65f6('0x35')]?_0x351d43['attributes']:_0x11411c[_0x65f6('0x2e')];_0x351d43[_0x65f6('0x38')]=qs['sort'](_0x16726d[_0x65f6('0x2f')][_0x65f6('0x39')]);_0x351d43[_0x65f6('0x3c')]=qs[_0x65f6('0x31')](_[_0x65f6('0x3a')](_0x16726d[_0x65f6('0x2f')],_0x11411c[_0x65f6('0x31')]));if(_0x16726d[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x351d43[_0x65f6('0x3c')]=_[_0x65f6('0x3d')](_0x351d43['where'],{'$or':_[_0x65f6('0x58')](_0x351d43[_0x65f6('0x33')],function(_0x15c8b7){var _0x219e42={};_0x219e42[_0x15c8b7]={'$like':'%'+_0x16726d['query'][_0x65f6('0x3b')]+'%'};return _0x219e42;})});}_0x351d43=_[_0x65f6('0x3d')]({},_0x351d43,_0x16726d['options']);return _0x59131c[_0x65f6('0x60')](_0x351d43);}})['then'](function(_0x10d98f){if(_0x10d98f){_0x4c0511=_0x10d98f['length'];if(!_0x16726d[_0x65f6('0x2f')][_0x65f6('0x56')]('nolimit')){_0x351d43['limit']=qs[_0x65f6('0x37')](_0x16726d[_0x65f6('0x2f')]['limit']);_0x351d43[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x16726d[_0x65f6('0x2f')]['offset']);}return _0x59131c[_0x65f6('0x60')](_0x351d43);}})[_0x65f6('0x23')](function(_0x5889dc){if(_0x5889dc){return _0x5889dc?{'count':_0x4c0511,'rows':_0x5889dc}:null;}})[_0x65f6('0x23')](respondWithResult(_0x558888,null))['catch'](handleError(_0x558888,null));};exports[_0x65f6('0x61')]=function(_0x57eb49,_0x51105d,_0x20687f){var _0x1cf4ed=_0x57eb49[_0x65f6('0x4b')][_0x65f6('0x62')];return db[_0x65f6('0x63')][_0x65f6('0x44')]({'where':{'id':_0x1cf4ed},'attributes':['id'],'include':[{'model':db[_0x65f6('0x59')],'as':_0x65f6('0x64'),'attributes':['id','name','online',_0x65f6('0x65'),'interface'],'raw':!![]}]})[_0x65f6('0x23')](function(_0x36699b){if(_0x36699b){var _0x21b5f2=_[_0x65f6('0x66')](_0x36699b,function(_0x43127b){var _0x56bd9d=_0x43127b[_0x65f6('0x25')]({'plain':!![]});return _0x56bd9d[_0x65f6('0x64')];});return db[_0x65f6('0x40')]['find']({'where':{'id':_0x57eb49[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](function(_0x4254c2){return db[_0x65f6('0x67')][_0x65f6('0x68')](function(_0x16bf93){return _0x4254c2['addTeams'](_0x1cf4ed,{'transaction':_0x16bf93})['then'](function(){return BPromise[_0x65f6('0x69')](_0x21b5f2,function(_0x10d744){return db[_0x65f6('0x55')][_0x65f6('0x6a')]({'where':{'UserId':_0x10d744['id'],'SmsQueueId':_0x57eb49['params']['id']},'transaction':_0x16bf93});});})['then'](function(){_0x21b5f2[_0x65f6('0x6b')](function(_0x452f1e){socket[_0x65f6('0x6c')](_0x65f6('0x6d'),{'UserId':_0x452f1e['id'],'SmsQueueId':_0x4254c2['id']});});});});});}})[_0x65f6('0x23')](respondWithStatusCode(_0x51105d,null))[_0x65f6('0x46')](handleError(_0x51105d,null));};exports['removeTeams']=function(_0x4d607a,_0x5851b6,_0x2c59f6){return db[_0x65f6('0x63')][_0x65f6('0x44')]({'where':{'id':_0x4d607a[_0x65f6('0x2f')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x65f6('0x64'),'attributes':['id'],'raw':!![]}]})[_0x65f6('0x23')](handleEntityNotFound(_0x5851b6,null))['then'](function(_0x346fa9){var _0x52004e=_[_0x65f6('0x58')](_0x346fa9,'id');var _0x4f3ef8=[];var _0x3a30ed=[];var _0x208fee=squel['select']();_0x208fee[_0x65f6('0x6e')](_0x65f6('0x6f'))[_0x65f6('0x70')](_0x65f6('0x71'),'tq')[_0x65f6('0x72')](_0x65f6('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x65f6('0x3c')]('SmsQueueId\x20=\x20?',_0x4d607a[_0x65f6('0x48')]['id']);for(var _0x56336a=0x0;_0x56336a<_0x346fa9[_0x65f6('0x35')];_0x56336a+=0x1){let _0x3528be=_0x346fa9[_0x56336a];for(var _0xdf396c=0x0;_0xdf396c<_0x3528be[_0x65f6('0x64')]['length'];_0xdf396c+=0x1){let _0x2b6f98=_0x3528be[_0x65f6('0x64')][_0xdf396c];var _0x376a23=_0x208fee['clone']();_0x376a23['where'](_0x65f6('0x74'),_0x2b6f98['id']);_0x3a30ed[_0x65f6('0x75')](db['sequelize'][_0x65f6('0x2f')](_0x376a23[_0x65f6('0x76')](),{'type':db[_0x65f6('0x67')]['QueryTypes'][_0x65f6('0x77')]})[_0x65f6('0x23')](function(_0x5df361){if(_0x5df361[_0x65f6('0x35')]===0x1){return _0x2b6f98['id'];}else{var _0x7136bc=_[_0x65f6('0x78')](_['map'](_0x5df361,_0x65f6('0x79')),function(_0x2287fc){return _[_0x65f6('0x7a')](_0x52004e,_0x2287fc);});if(_0x7136bc){return _0x2b6f98['id'];}}}));}}return BPromise['all'](_0x3a30ed)[_0x65f6('0x23')](function(_0x4febfa){_0x4f3ef8=_(_0x4f3ef8)[_0x65f6('0x7b')](_0x4febfa)[_0x65f6('0x7c')]()[_0x65f6('0x7d')]();return db[_0x65f6('0x40')][_0x65f6('0x49')]({'where':{'id':_0x4d607a[_0x65f6('0x48')]['id']}})['then'](function(_0x284473){return db[_0x65f6('0x67')][_0x65f6('0x68')](function(_0x32a101){return _0x284473[_0x65f6('0x7e')](_0x4d607a['query']['ids'],{'transaction':_0x32a101})['then'](function(){if(!_[_0x65f6('0x7f')](_0x4f3ef8)){return _0x284473[_0x65f6('0x80')](_0x4f3ef8,{'transaction':_0x32a101});}})[_0x65f6('0x23')](function(){_0x4f3ef8['forEach'](function(_0x151cee){socket['emit']('userSmsQueue:remove',{'UserId':_0x151cee,'SmsQueueId':_0x284473['id']});});});});});});})[_0x65f6('0x23')](respondWithStatusCode(_0x5851b6,null))[_0x65f6('0x46')](handleError(_0x5851b6,null));};exports['addAgents']=function(_0xdd36c4,_0x3c5053,_0x43ed6c){return db[_0x65f6('0x40')][_0x65f6('0x49')]({'where':{'id':_0xdd36c4[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x3c5053,null))[_0x65f6('0x23')](function(_0x477f29){if(_0x477f29){return _0x477f29[_0x65f6('0x81')](_0xdd36c4[_0x65f6('0x4b')][_0x65f6('0x62')],_['omit'](_0xdd36c4[_0x65f6('0x4b')],['ids','id'])||{})['spread'](function(_0x24d524){for(var _0x10a877=0x0;_0x10a877<_0xdd36c4[_0x65f6('0x4b')][_0x65f6('0x62')]['length'];_0x10a877+=0x1){socket[_0x65f6('0x6c')]('userSmsQueue:save',{'UserId':_0xdd36c4['body'][_0x65f6('0x62')][_0x10a877],'SmsQueueId':_0xdd36c4[_0x65f6('0x48')]['id']});}return _0x24d524;});}})[_0x65f6('0x23')](respondWithResult(_0x3c5053,null))[_0x65f6('0x46')](handleError(_0x3c5053,null));};exports[_0x65f6('0x80')]=function(_0xcdfebe,_0x5a33cf,_0x5c8131){return db['SmsQueue'][_0x65f6('0x49')]({'where':{'id':_0xcdfebe[_0x65f6('0x48')]['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x5a33cf,null))['then'](function(_0x29396f){if(_0x29396f){return _0x29396f['removeAgents'](_0xcdfebe['query'][_0x65f6('0x62')])[_0x65f6('0x23')](function(){if(_[_0x65f6('0x82')](_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')])){for(var _0x5adf21=0x0;_0x5adf21<_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')][_0x65f6('0x35')];_0x5adf21+=0x1){socket[_0x65f6('0x6c')]('userSmsQueue:remove',{'UserId':Number(_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')][_0x5adf21]),'SmsQueueId':Number(_0xcdfebe[_0x65f6('0x48')]['id'])});}}else{socket[_0x65f6('0x6c')](_0x65f6('0x83'),{'UserId':Number(_0xcdfebe[_0x65f6('0x2f')][_0x65f6('0x62')]),'SmsQueueId':Number(_0xcdfebe[_0x65f6('0x48')]['id'])});}});}})['then'](respondWithStatusCode(_0x5a33cf,null))[_0x65f6('0x46')](handleError(_0x5a33cf,null));};exports[_0x65f6('0x84')]=function(_0x3efa55,_0x8adb47,_0x146c11){var _0x4171a1={};var _0x57667e={};var _0x3fd6ee;var _0x19c425;return db['SmsQueue'][_0x65f6('0x54')]({'where':{'id':_0x3efa55['params']['id']}})[_0x65f6('0x23')](handleEntityNotFound(_0x8adb47,null))[_0x65f6('0x23')](function(_0xd87bec){if(_0xd87bec){_0x3fd6ee=_0xd87bec;_0x57667e[_0x65f6('0x2e')]=_[_0x65f6('0x30')](db['User'][_0x65f6('0x2a')]);_0x57667e[_0x65f6('0x2f')]=_[_0x65f6('0x30')](_0x3efa55[_0x65f6('0x2f')]);_0x57667e[_0x65f6('0x31')]=_['intersection'](_0x57667e['model'],_0x57667e[_0x65f6('0x2f')]);_0x4171a1[_0x65f6('0x33')]=_[_0x65f6('0x32')](_0x57667e[_0x65f6('0x2e')],qs['fields'](_0x3efa55['query']['fields']));_0x4171a1[_0x65f6('0x33')]=_0x4171a1[_0x65f6('0x33')][_0x65f6('0x35')]?_0x4171a1['attributes']:_0x57667e[_0x65f6('0x2e')];_0x4171a1[_0x65f6('0x38')]=qs[_0x65f6('0x39')](_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x39')]);_0x4171a1['where']=qs[_0x65f6('0x31')](_[_0x65f6('0x3a')](_0x3efa55['query'],_0x57667e['filters']));if(_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x3b')]){_0x4171a1[_0x65f6('0x3c')]=_[_0x65f6('0x3d')](_0x4171a1[_0x65f6('0x3c')],{'$or':_['map'](_0x4171a1[_0x65f6('0x33')],function(_0x4b080a){var _0x280c96={};_0x280c96[_0x4b080a]={'$like':'%'+_0x3efa55['query'][_0x65f6('0x3b')]+'%'};return _0x280c96;})});}_0x4171a1=_['merge']({},_0x4171a1,_0x3efa55[_0x65f6('0x3f')]);return _0x3fd6ee['getAgents'](_0x4171a1);}})[_0x65f6('0x23')](function(_0x3b9aed){if(_0x3b9aed){_0x19c425=_0x3b9aed['length'];if(!_0x3efa55['query'][_0x65f6('0x56')](_0x65f6('0x36'))){_0x4171a1[_0x65f6('0x37')]=qs[_0x65f6('0x37')](_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x37')]);_0x4171a1[_0x65f6('0x1d')]=qs[_0x65f6('0x1d')](_0x3efa55[_0x65f6('0x2f')][_0x65f6('0x1d')]);}return _0x3fd6ee[_0x65f6('0x84')](_0x4171a1);}})[_0x65f6('0x23')](function(_0x264d8b){if(_0x264d8b){return _0x264d8b?{'count':_0x19c425,'rows':_0x264d8b}:null;}})[_0x65f6('0x23')](respondWithResult(_0x8adb47,null))[_0x65f6('0x46')](handleError(_0x8adb47,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index af95881..5d2ed50 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 _0x8856=['hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x5caeb3,_0x396308){var _0x3d3563=function(_0xbcea7f){while(--_0xbcea7f){_0x5caeb3['push'](_0x5caeb3['shift']());}};_0x3d3563(++_0x396308);}(_0x8856,0xe2));var _0x6885=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8856[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6885('0x0'));var SmsQueue=require(_0x6885('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6885('0x2'),'afterUpdate':_0x6885('0x3'),'afterDestroy':_0x6885('0x4')};function emitEvent(_0x492311){return function(_0x58d1de,_0xdb0d43,_0x1c5fac){SmsQueueEvents[_0x6885('0x5')](_0x492311+':'+_0x58d1de['id'],_0x58d1de);SmsQueueEvents[_0x6885('0x5')](_0x492311,_0x58d1de);_0x1c5fac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x6885('0x6')](e,emitEvent(event));}}module[_0x6885('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0x8d33=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x555ebb,_0x4b1b68){var _0x3c0a4a=function(_0x312e2f){while(--_0x312e2f){_0x555ebb['push'](_0x555ebb['shift']());}};_0x3c0a4a(++_0x4b1b68);}(_0x8d33,0x188));var _0x38d3=function(_0x464e82,_0x2d55e7){_0x464e82=_0x464e82-0x0;var _0x6cf5a8=_0x8d33[_0x464e82];return _0x6cf5a8;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0x38d3('0x0'))['db'][_0x38d3('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x38d3('0x2')](0x0);var events={'afterCreate':_0x38d3('0x3'),'afterUpdate':'update','afterDestroy':_0x38d3('0x4')};function emitEvent(_0x31ae8f){return function(_0x11f54f,_0x2942c4,_0x5eb673){SmsQueueEvents[_0x38d3('0x5')](_0x31ae8f+':'+_0x11f54f['id'],_0x11f54f);SmsQueueEvents[_0x38d3('0x5')](_0x31ae8f,_0x11f54f);_0x5eb673(null);};}for(var e in events){if(events[_0x38d3('0x6')](e)){var event=events[e];SmsQueue[_0x38d3('0x7')](e,emitEvent(event));}}module[_0x38d3('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index c0eaf54..381d906 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 _0xf5e8=['../../config/logger','api','moment','request-promise','path','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util'];(function(_0x51aaf1,_0x60cf44){var _0x2493f0=function(_0x4751c6){while(--_0x4751c6){_0x51aaf1['push'](_0x51aaf1['shift']());}};_0x2493f0(++_0x60cf44);}(_0xf5e8,0xfa));var _0x8f5e=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0xf5e8[_0x1fc1f9];return _0x4987ca;};'use strict';var _=require(_0x8f5e('0x0'));var util=require(_0x8f5e('0x1'));var logger=require(_0x8f5e('0x2'))(_0x8f5e('0x3'));var moment=require(_0x8f5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f5e('0x5'));var fs=require('fs');var path=require(_0x8f5e('0x6'));var rimraf=require('rimraf');var config=require(_0x8f5e('0x7'));var attributes=require(_0x8f5e('0x8'));module[_0x8f5e('0x9')]=function(_0x1c94da,_0x48ed61){return _0x1c94da['define'](_0x8f5e('0xa'),attributes,{'tableName':_0x8f5e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc90d=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues'];(function(_0x1fc12f,_0x30bbbb){var _0x5652a8=function(_0x49bf83){while(--_0x49bf83){_0x1fc12f['push'](_0x1fc12f['shift']());}};_0x5652a8(++_0x30bbbb);}(_0xc90d,0x134));var _0xdc90=function(_0x503ffd,_0x8ecde){_0x503ffd=_0x503ffd-0x0;var _0x160437=_0xc90d[_0x503ffd];return _0x160437;};'use strict';var _=require(_0xdc90('0x0'));var util=require(_0xdc90('0x1'));var logger=require(_0xdc90('0x2'))('api');var moment=require(_0xdc90('0x3'));var BPromise=require(_0xdc90('0x4'));var rp=require(_0xdc90('0x5'));var fs=require('fs');var path=require(_0xdc90('0x6'));var rimraf=require(_0xdc90('0x7'));var config=require(_0xdc90('0x8'));var attributes=require(_0xdc90('0x9'));module[_0xdc90('0xa')]=function(_0x1f6228,_0x3b4855){return _0x1f6228[_0xdc90('0xb')](_0xdc90('0xc'),attributes,{'tableName':_0xdc90('0xd'),'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 c122a3e..7cc23c2 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 _0xece5=['map','include','model','attributes','catch','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit'];(function(_0x1bd8fd,_0x526cee){var _0x36f371=function(_0x14b14e){while(--_0x14b14e){_0x1bd8fd['push'](_0x1bd8fd['shift']());}};_0x36f371(++_0x526cee);}(_0xece5,0xab));var _0x5ece=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xece5[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x5ece('0x0'));var util=require(_0x5ece('0x1'));var moment=require(_0x5ece('0x2'));var BPromise=require(_0x5ece('0x3'));var rs=require(_0x5ece('0x4'));var fs=require('fs');var Redis=require(_0x5ece('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ece('0x6'));var logger=require(_0x5ece('0x7'))('rpc');var config=require(_0x5ece('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5ece('0x9')][_0x5ece('0xa')]({'port':0x232a});config[_0x5ece('0xb')]=_[_0x5ece('0xc')](config[_0x5ece('0xb')],{'host':_0x5ece('0xd'),'port':0x18eb});var socket=require(_0x5ece('0xe'))(new Redis(config[_0x5ece('0xb')]));require(_0x5ece('0xf'))[_0x5ece('0x10')](socket);function respondWithRpcPromise(_0x2f31bc,_0x1a0085,_0x46bd9c){return new BPromise(function(_0x3fe2cd,_0x467f70){return client['request'](_0x2f31bc,_0x46bd9c)[_0x5ece('0x11')](function(_0x2ca6f8){logger['info'](_0x5ece('0x12'),_0x1a0085,_0x5ece('0x13'));logger[_0x5ece('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1a0085,_0x5ece('0x13'),JSON[_0x5ece('0x15')](_0x2ca6f8));if(_0x2ca6f8['error']){if(_0x2ca6f8[_0x5ece('0x16')][_0x5ece('0x17')]===0x1f4){logger[_0x5ece('0x16')](_0x5ece('0x12'),_0x1a0085,_0x2ca6f8[_0x5ece('0x16')]['message']);return _0x467f70(_0x2ca6f8[_0x5ece('0x16')][_0x5ece('0x18')]);}logger['error'](_0x5ece('0x12'),_0x1a0085,_0x2ca6f8[_0x5ece('0x16')][_0x5ece('0x18')]);return _0x3fe2cd(_0x2ca6f8[_0x5ece('0x16')]['message']);}else{logger[_0x5ece('0x19')](_0x5ece('0x12'),_0x1a0085,_0x5ece('0x13'));_0x3fe2cd(_0x2ca6f8[_0x5ece('0x1a')]['message']);}})['catch'](function(_0x5253a5){logger['error']('SmsQueue,\x20%s,\x20%s',_0x1a0085,_0x5253a5);_0x467f70(_0x5253a5);});});}exports[_0x5ece('0x1b')]=function(_0x579151){var _0x21cb76=this;return new Promise(function(_0x2203d5,_0x51531b){return db[_0x5ece('0x1c')][_0x5ece('0x1d')]({'raw':_0x579151[_0x5ece('0x1e')]?_0x579151[_0x5ece('0x1e')][_0x5ece('0x1f')]===undefined?!![]:![]:!![],'where':_0x579151[_0x5ece('0x1e')]?_0x579151[_0x5ece('0x1e')][_0x5ece('0x20')]||null:null,'attributes':_0x579151[_0x5ece('0x1e')]?_0x579151[_0x5ece('0x1e')]['attributes']||null:null,'limit':_0x579151['options']?_0x579151[_0x5ece('0x1e')][_0x5ece('0x21')]||null:null,'include':_0x579151['options']?_0x579151[_0x5ece('0x1e')]['include']?_[_0x5ece('0x22')](_0x579151[_0x5ece('0x1e')][_0x5ece('0x23')],function(_0x2d2be5){return{'model':db[_0x2d2be5[_0x5ece('0x24')]],'as':_0x2d2be5['as'],'attributes':_0x2d2be5['attributes'],'include':_0x2d2be5['include']?_[_0x5ece('0x22')](_0x2d2be5[_0x5ece('0x23')],function(_0x3d24bf){return{'model':db[_0x3d24bf['model']],'as':_0x3d24bf['as'],'attributes':_0x3d24bf[_0x5ece('0x25')],'include':_0x3d24bf[_0x5ece('0x23')]?_[_0x5ece('0x22')](_0x3d24bf[_0x5ece('0x23')],function(_0x2d712a){return{'model':db[_0x2d712a[_0x5ece('0x24')]],'as':_0x2d712a['as'],'attributes':_0x2d712a[_0x5ece('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5ece('0x11')](function(_0xb35dd4){logger['info'](_0x5ece('0x1b'),_0x579151);logger['debug'](_0x5ece('0x1b'),_0x579151,JSON[_0x5ece('0x15')](_0xb35dd4));_0x2203d5(_0xb35dd4);})[_0x5ece('0x26')](function(_0x358fd2){logger[_0x5ece('0x16')](_0x5ece('0x1b'),_0x358fd2['message'],_0x579151);_0x51531b(_0x21cb76['error'](0x1f4,_0x358fd2[_0x5ece('0x18')]));});});};exports[_0x5ece('0x27')]=function(_0x4a868c){var _0x277360=this;return new Promise(function(_0x49a210,_0x40a2e8){return db[_0x5ece('0x1c')][_0x5ece('0x28')]({'raw':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c[_0x5ece('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c[_0x5ece('0x1e')][_0x5ece('0x20')]||null:null,'attributes':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c[_0x5ece('0x1e')][_0x5ece('0x25')]||null:null,'include':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c['options']['include']?_[_0x5ece('0x22')](_0x4a868c[_0x5ece('0x1e')][_0x5ece('0x23')],function(_0x13bf55){return{'model':db[_0x13bf55[_0x5ece('0x24')]],'as':_0x13bf55['as'],'attributes':_0x13bf55[_0x5ece('0x25')],'include':_0x13bf55[_0x5ece('0x23')]?_['map'](_0x13bf55['include'],function(_0x30f2c2){return{'model':db[_0x30f2c2[_0x5ece('0x24')]],'as':_0x30f2c2['as'],'attributes':_0x30f2c2['attributes'],'include':_0x30f2c2[_0x5ece('0x23')]?_[_0x5ece('0x22')](_0x30f2c2['include'],function(_0x630a5){return{'model':db[_0x630a5['model']],'as':_0x630a5['as'],'attributes':_0x630a5['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ece('0x11')](function(_0x426566){logger[_0x5ece('0x19')](_0x5ece('0x27'),_0x4a868c);logger[_0x5ece('0x14')](_0x5ece('0x27'),_0x4a868c,JSON[_0x5ece('0x15')](_0x426566));_0x49a210(_0x426566);})[_0x5ece('0x26')](function(_0xa8db6f){logger[_0x5ece('0x16')](_0x5ece('0x27'),_0xa8db6f[_0x5ece('0x18')],_0x4a868c);_0x40a2e8(_0x277360['error'](0x1f4,_0xa8db6f['message']));});});}; \ No newline at end of file +var _0xd06f=['GetSmsQueue','ShowSmsQueue','find','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','redis','defaults','localhost','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x3a7b6e,_0x48fda6){var _0xddc8ba=function(_0x5c5bc2){while(--_0x5c5bc2){_0x3a7b6e['push'](_0x3a7b6e['shift']());}};_0xddc8ba(++_0x48fda6);}(_0xd06f,0x124));var _0xfd06=function(_0x212009,_0x4be73a){_0x212009=_0x212009-0x0;var _0x2ee852=_0xd06f[_0x212009];return _0x2ee852;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd06('0x0'));var BPromise=require(_0xfd06('0x1'));var rs=require(_0xfd06('0x2'));var fs=require('fs');var Redis=require(_0xfd06('0x3'));var db=require(_0xfd06('0x4'))['db'];var utils=require(_0xfd06('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xfd06('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xfd06('0x7')]['http']({'port':0x232a});config[_0xfd06('0x8')]=_[_0xfd06('0x9')](config[_0xfd06('0x8')],{'host':_0xfd06('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd06('0x8')]));require(_0xfd06('0xb'))[_0xfd06('0xc')](socket);function respondWithRpcPromise(_0x137a5e,_0x58bcfe,_0x393f7f){return new BPromise(function(_0x2c73c0,_0x1797d1){return client['request'](_0x137a5e,_0x393f7f)[_0xfd06('0xd')](function(_0x93cca0){logger[_0xfd06('0xe')](_0xfd06('0xf'),_0x58bcfe,_0xfd06('0x10'));logger['debug'](_0xfd06('0x11'),_0x58bcfe,_0xfd06('0x10'),JSON['stringify'](_0x93cca0));if(_0x93cca0[_0xfd06('0x12')]){if(_0x93cca0['error'][_0xfd06('0x13')]===0x1f4){logger[_0xfd06('0x12')](_0xfd06('0xf'),_0x58bcfe,_0x93cca0['error'][_0xfd06('0x14')]);return _0x1797d1(_0x93cca0[_0xfd06('0x12')][_0xfd06('0x14')]);}logger['error'](_0xfd06('0xf'),_0x58bcfe,_0x93cca0[_0xfd06('0x12')][_0xfd06('0x14')]);return _0x2c73c0(_0x93cca0[_0xfd06('0x12')][_0xfd06('0x14')]);}else{logger[_0xfd06('0xe')](_0xfd06('0xf'),_0x58bcfe,'request\x20sent');_0x2c73c0(_0x93cca0[_0xfd06('0x15')][_0xfd06('0x14')]);}})['catch'](function(_0x5b5682){logger[_0xfd06('0x12')](_0xfd06('0xf'),_0x58bcfe,_0x5b5682);_0x1797d1(_0x5b5682);});});}exports['GetSmsQueue']=function(_0x28ea51){var _0x45c8e3=this;return new Promise(function(_0x7c1ea7,_0x3326f1){return db[_0xfd06('0x16')][_0xfd06('0x17')]({'raw':_0x28ea51[_0xfd06('0x18')]?_0x28ea51[_0xfd06('0x18')][_0xfd06('0x19')]===undefined?!![]:![]:!![],'where':_0x28ea51[_0xfd06('0x18')]?_0x28ea51['options'][_0xfd06('0x1a')]||null:null,'attributes':_0x28ea51[_0xfd06('0x18')]?_0x28ea51[_0xfd06('0x18')]['attributes']||null:null,'limit':_0x28ea51[_0xfd06('0x18')]?_0x28ea51[_0xfd06('0x18')][_0xfd06('0x1b')]||null:null,'include':_0x28ea51['options']?_0x28ea51[_0xfd06('0x18')][_0xfd06('0x1c')]?_[_0xfd06('0x1d')](_0x28ea51['options']['include'],function(_0x2ff4a2){return{'model':db[_0x2ff4a2[_0xfd06('0x1e')]],'as':_0x2ff4a2['as'],'attributes':_0x2ff4a2[_0xfd06('0x1f')],'include':_0x2ff4a2[_0xfd06('0x1c')]?_[_0xfd06('0x1d')](_0x2ff4a2[_0xfd06('0x1c')],function(_0x14680e){return{'model':db[_0x14680e[_0xfd06('0x1e')]],'as':_0x14680e['as'],'attributes':_0x14680e['attributes'],'include':_0x14680e[_0xfd06('0x1c')]?_[_0xfd06('0x1d')](_0x14680e[_0xfd06('0x1c')],function(_0x29895b){return{'model':db[_0x29895b[_0xfd06('0x1e')]],'as':_0x29895b['as'],'attributes':_0x29895b[_0xfd06('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x223f55){logger['info'](_0xfd06('0x20'),_0x28ea51);logger['debug'](_0xfd06('0x20'),_0x28ea51,JSON['stringify'](_0x223f55));_0x7c1ea7(_0x223f55);})['catch'](function(_0x41486a){logger[_0xfd06('0x12')]('GetSmsQueue',_0x41486a[_0xfd06('0x14')],_0x28ea51);_0x3326f1(_0x45c8e3[_0xfd06('0x12')](0x1f4,_0x41486a[_0xfd06('0x14')]));});});};exports[_0xfd06('0x21')]=function(_0x35c94a){var _0x1dc80f=this;return new Promise(function(_0x152053,_0x7e288b){return db[_0xfd06('0x16')][_0xfd06('0x22')]({'raw':_0x35c94a[_0xfd06('0x18')]?_0x35c94a[_0xfd06('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x35c94a[_0xfd06('0x18')]?_0x35c94a[_0xfd06('0x18')][_0xfd06('0x1a')]||null:null,'attributes':_0x35c94a['options']?_0x35c94a[_0xfd06('0x18')]['attributes']||null:null,'include':_0x35c94a[_0xfd06('0x18')]?_0x35c94a['options']['include']?_[_0xfd06('0x1d')](_0x35c94a[_0xfd06('0x18')][_0xfd06('0x1c')],function(_0x2c1d2e){return{'model':db[_0x2c1d2e[_0xfd06('0x1e')]],'as':_0x2c1d2e['as'],'attributes':_0x2c1d2e['attributes'],'include':_0x2c1d2e['include']?_['map'](_0x2c1d2e[_0xfd06('0x1c')],function(_0x36d38c){return{'model':db[_0x36d38c[_0xfd06('0x1e')]],'as':_0x36d38c['as'],'attributes':_0x36d38c[_0xfd06('0x1f')],'include':_0x36d38c[_0xfd06('0x1c')]?_[_0xfd06('0x1d')](_0x36d38c[_0xfd06('0x1c')],function(_0x7389ef){return{'model':db[_0x7389ef[_0xfd06('0x1e')]],'as':_0x7389ef['as'],'attributes':_0x7389ef[_0xfd06('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfd06('0xd')](function(_0x459380){logger['info'](_0xfd06('0x21'),_0x35c94a);logger['debug'](_0xfd06('0x21'),_0x35c94a,JSON['stringify'](_0x459380));_0x152053(_0x459380);})[_0xfd06('0x23')](function(_0x28fa04){logger[_0xfd06('0x12')]('ShowSmsQueue',_0x28fa04[_0xfd06('0x14')],_0x35c94a);_0x7e288b(_0x1dc80f['error'](0x1f4,_0x28fa04[_0xfd06('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 181e06b..6e80ee9 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 _0x465f=['emit','removeListener','register','smsQueue:','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x465f,0x19c));var _0xf465=function(_0x2a8e21,_0x377d49){_0x2a8e21=_0x2a8e21-0x0;var _0x37b0f7=_0x465f[_0x2a8e21];return _0x37b0f7;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0xf465('0x0'),_0xf465('0x1')];function createListener(_0xf3ec5a,_0x3c3082){return function(_0x15bc4e){_0x3c3082[_0xf465('0x2')](_0xf3ec5a,_0x15bc4e);};}function removeListener(_0x2fbd41,_0x46dc57){return function(){SmsQueueEvents[_0xf465('0x3')](_0x2fbd41,_0x46dc57);};}exports[_0xf465('0x4')]=function(_0x39aae1){for(var _0x11caab=0x0,_0x440aa0=events['length'];_0x11caab<_0x440aa0;_0x11caab++){var _0x4a906d=events[_0x11caab];var _0x98c33d=createListener(_0xf465('0x5')+_0x4a906d,_0x39aae1);SmsQueueEvents['on'](_0x4a906d,_0x98c33d);}}; \ No newline at end of file +var _0x0697=['emit','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x14fa0b,_0x58efd6){var _0x55bb13=function(_0x4f6b78){while(--_0x4f6b78){_0x14fa0b['push'](_0x14fa0b['shift']());}};_0x55bb13(++_0x58efd6);}(_0x0697,0x12c));var _0x7069=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x0697[_0x36c5b0];return _0xf19333;};'use strict';var SmsQueueEvents=require(_0x7069('0x0'));var events=[_0x7069('0x1'),_0x7069('0x2'),_0x7069('0x3')];function createListener(_0x428640,_0x52f7aa){return function(_0x5e315c){_0x52f7aa[_0x7069('0x4')](_0x428640,_0x5e315c);};}function removeListener(_0x51022d,_0x4b739){return function(){SmsQueueEvents['removeListener'](_0x51022d,_0x4b739);};}exports[_0x7069('0x5')]=function(_0x3325d6){for(var _0x597618=0x0,_0x405283=events[_0x7069('0x6')];_0x597618<_0x405283;_0x597618++){var _0x28231c=events[_0x597618];var _0x542abd=createListener(_0x7069('0x7')+_0x28231c,_0x3325d6);SmsQueueEvents['on'](_0x28231c,_0x542abd);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 2b07c31..1432ba4 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 _0x6400=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','destroy'];(function(_0xabe76b,_0x5692ae){var _0x43c206=function(_0x450c1c){while(--_0x450c1c){_0xabe76b['push'](_0xabe76b['shift']());}};_0x43c206(++_0x5692ae);}(_0x6400,0x1ee));var _0x0640=function(_0xeb996f,_0x5e1c36){_0xeb996f=_0xeb996f-0x0;var _0xe1d530=_0x6400[_0xeb996f];return _0xe1d530;};'use strict';var multer=require(_0x0640('0x0'));var util=require('util');var path=require(_0x0640('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0640('0x2')]();var auth=require(_0x0640('0x3'));var interaction=require(_0x0640('0x4'));var config=require(_0x0640('0x5'));var controller=require('./smsQueueReport.controller');router[_0x0640('0x6')]('/',auth['isAuthenticated'](),controller[_0x0640('0x7')]);router[_0x0640('0x6')](_0x0640('0x8'),auth[_0x0640('0x9')](),controller[_0x0640('0xa')]);router[_0x0640('0x6')](_0x0640('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0640('0xc')]('/',auth[_0x0640('0x9')](),controller['create']);router[_0x0640('0xd')](_0x0640('0xb'),auth[_0x0640('0x9')](),controller[_0x0640('0xe')]);router['delete']('/:id',auth[_0x0640('0x9')](),controller[_0x0640('0xf')]);module[_0x0640('0x10')]=router; \ No newline at end of file +var _0x02c2=['../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','post','create','put','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x02c2,0xd2));var _0x202c=function(_0x3a8122,_0x386428){_0x3a8122=_0x3a8122-0x0;var _0x3000e2=_0x02c2[_0x3a8122];return _0x3000e2;};'use strict';var multer=require(_0x202c('0x0'));var util=require(_0x202c('0x1'));var path=require(_0x202c('0x2'));var timeout=require(_0x202c('0x3'));var express=require(_0x202c('0x4'));var router=express[_0x202c('0x5')]();var auth=require(_0x202c('0x6'));var interaction=require(_0x202c('0x7'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router['get']('/',auth[_0x202c('0x8')](),controller[_0x202c('0x9')]);router['get'](_0x202c('0xa'),auth[_0x202c('0x8')](),controller[_0x202c('0xb')]);router[_0x202c('0xc')](_0x202c('0xd'),auth[_0x202c('0x8')](),controller['show']);router[_0x202c('0xe')]('/',auth[_0x202c('0x8')](),controller[_0x202c('0xf')]);router[_0x202c('0x10')]('/:id',auth[_0x202c('0x8')](),controller['update']);router[_0x202c('0x11')](_0x202c('0xd'),auth[_0x202c('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 222de06..3997bf3 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 _0x9807=['moment','exports','STRING','DATE'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9807,0x1ec));var _0x7980=function(_0xa20eb7,_0x2fd723){_0xa20eb7=_0xa20eb7-0x0;var _0x512cc7=_0x9807[_0xa20eb7];return _0x512cc7;};'use strict';var moment=require(_0x7980('0x0'));var Sequelize=require('sequelize');module[_0x7980('0x1')]={'uniqueid':{'type':Sequelize[_0x7980('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7980('0x2')]},'joinAt':{'type':Sequelize[_0x7980('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7980('0x3')]},'exitAt':{'type':Sequelize[_0x7980('0x3')]},'reason':{'type':Sequelize[_0x7980('0x2')]}}; \ No newline at end of file +var _0x76ad=['moment','sequelize','STRING','DATE'];(function(_0xc65834,_0x5df6fb){var _0x5da298=function(_0x30fbc2){while(--_0x30fbc2){_0xc65834['push'](_0xc65834['shift']());}};_0x5da298(++_0x5df6fb);}(_0x76ad,0x14c));var _0xd76a=function(_0x30ae7b,_0x3a718f){_0x30ae7b=_0x30ae7b-0x0;var _0xa9d0cf=_0x76ad[_0x30ae7b];return _0xa9d0cf;};'use strict';var moment=require(_0xd76a('0x0'));var Sequelize=require(_0xd76a('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xd76a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd76a('0x2')]},'joinAt':{'type':Sequelize[_0xd76a('0x3')]},'leaveAt':{'type':Sequelize[_0xd76a('0x3')]},'acceptAt':{'type':Sequelize[_0xd76a('0x3')]},'exitAt':{'type':Sequelize[_0xd76a('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index b8e02fd..cc619cd 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 _0x751c=['mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','name','send','SmsQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','includeAll','include','findAll','show','params','length','options','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x751c,0x16b));var _0xc751=function(_0x161c92,_0x2b2378){_0x161c92=_0x161c92-0x0;var _0xc40a7f=_0x751c[_0x161c92];return _0xc40a7f;};'use strict';var pdf=require(_0xc751('0x0'));var emlformat=require(_0xc751('0x1'));var rimraf=require(_0xc751('0x2'));var zipdir=require(_0xc751('0x3'));var jsonpatch=require(_0xc751('0x4'));var rp=require(_0xc751('0x5'));var moment=require('moment');var BPromise=require(_0xc751('0x6'));var Mustache=require(_0xc751('0x7'));var util=require(_0xc751('0x8'));var path=require(_0xc751('0x9'));var sox=require(_0xc751('0xa'));var csv=require(_0xc751('0xb'));var ejs=require(_0xc751('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc751('0xd'));var crypto=require(_0xc751('0xe'));var jsforce=require(_0xc751('0xf'));var deskjs=require(_0xc751('0x10'));var toCsv=require(_0xc751('0xb'));var querystring=require(_0xc751('0x11'));var Papa=require(_0xc751('0x12'));var Redis=require(_0xc751('0x13'));var authService=require(_0xc751('0x14'));var qs=require(_0xc751('0x15'));var as=require(_0xc751('0x16'));var hardwareService=require(_0xc751('0x17'));var logger=require('../../config/logger')(_0xc751('0x18'));var utils=require(_0xc751('0x19'));var config=require(_0xc751('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b2559,_0x2eb7b9){_0x2eb7b9=_0x2eb7b9||0xcc;return function(_0x7bfd08){if(_0x7bfd08){return _0x4b2559[_0xc751('0x1b')](_0x2eb7b9);}return _0x4b2559[_0xc751('0x1c')](_0x2eb7b9)[_0xc751('0x1d')]();};}function respondWithResult(_0x593e92,_0x23752f){_0x23752f=_0x23752f||0xc8;return function(_0x9e7232){if(_0x9e7232){return _0x593e92[_0xc751('0x1c')](_0x23752f)[_0xc751('0x1e')](_0x9e7232);}};}function respondWithFilteredResult(_0x325ea1,_0x176083){return function(_0x2ac42c){if(_0x2ac42c){var _0x5cee02=_0x2ac42c[_0xc751('0x1f')],_0x3bc9fe=_0x176083[_0xc751('0x20')],_0x83e854=_0x176083['offset']+_0x176083[_0xc751('0x21')],_0x4caea8;if(_0x83e854>=_0x5cee02){_0x83e854=_0x5cee02;_0x4caea8=0xc8;}else{_0x4caea8=0xce;}_0x325ea1['status'](_0x4caea8);return _0x325ea1[_0xc751('0x22')](_0xc751('0x23'),_0x3bc9fe+'-'+_0x83e854+'/'+_0x5cee02)[_0xc751('0x1e')](_0x2ac42c);}return null;};}function patchUpdates(_0x26c63a){return function(_0xb99ca6){try{jsonpatch['apply'](_0xb99ca6,_0x26c63a,!![]);}catch(_0xee005f){return BPromise[_0xc751('0x24')](_0xee005f);}return _0xb99ca6[_0xc751('0x25')]();};}function saveUpdates(_0x441ec1,_0x1195d7){return function(_0x32db40){if(_0x32db40){return _0x32db40[_0xc751('0x26')](_0x441ec1)[_0xc751('0x27')](function(_0x30110f){return _0x30110f;});}return null;};}function removeEntity(_0x4c03aa,_0x7efe55){return function(_0x35eb79){if(_0x35eb79){return _0x35eb79['destroy']()['then'](function(){_0x4c03aa[_0xc751('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6bfb,_0x19d9bc){return function(_0x18ae5f){if(!_0x18ae5f){_0x2c6bfb[_0xc751('0x1b')](0x194);}return _0x18ae5f;};}function handleError(_0x22af90,_0x56e4dc){_0x56e4dc=_0x56e4dc||0x1f4;return function(_0x31f295){logger[_0xc751('0x28')](_0x31f295['stack']);if(_0x31f295[_0xc751('0x29')]){delete _0x31f295[_0xc751('0x29')];}_0x22af90[_0xc751('0x1c')](_0x56e4dc)[_0xc751('0x2a')](_0x31f295);};}exports['index']=function(_0x1aadbb,_0x399277){var _0x55e6c3={},_0x2b1f20={},_0x24e7ba={'count':0x0,'rows':[]};var _0x52d94c=_['map'](db[_0xc751('0x2b')][_0xc751('0x2c')],function(_0x4c260f){return{'name':_0x4c260f[_0xc751('0x2d')],'type':_0x4c260f[_0xc751('0x2e')]['key']};});_0x2b1f20[_0xc751('0x2f')]=_[_0xc751('0x30')](_0x52d94c,_0xc751('0x29'));_0x2b1f20[_0xc751('0x31')]=_[_0xc751('0x32')](_0x1aadbb[_0xc751('0x31')]);_0x2b1f20[_0xc751('0x33')]=_[_0xc751('0x34')](_0x2b1f20[_0xc751('0x2f')],_0x2b1f20[_0xc751('0x31')]);_0x55e6c3['attributes']=_[_0xc751('0x34')](_0x2b1f20[_0xc751('0x2f')],qs[_0xc751('0x35')](_0x1aadbb[_0xc751('0x31')][_0xc751('0x35')]));_0x55e6c3[_0xc751('0x36')]=_0x55e6c3['attributes']['length']?_0x55e6c3[_0xc751('0x36')]:_0x2b1f20[_0xc751('0x2f')];if(!_0x1aadbb[_0xc751('0x31')][_0xc751('0x37')](_0xc751('0x38'))){_0x55e6c3[_0xc751('0x21')]=qs['limit'](_0x1aadbb[_0xc751('0x31')][_0xc751('0x21')]);_0x55e6c3['offset']=qs[_0xc751('0x20')](_0x1aadbb['query'][_0xc751('0x20')]);}_0x55e6c3['order']=qs['sort'](_0x1aadbb[_0xc751('0x31')][_0xc751('0x39')]);_0x55e6c3[_0xc751('0x3a')]=qs[_0xc751('0x33')](_['pick'](_0x1aadbb[_0xc751('0x31')],_0x2b1f20[_0xc751('0x33')]));if(_0x1aadbb[_0xc751('0x31')]['filter']){_0x55e6c3[_0xc751('0x3a')]=_['merge'](_0x55e6c3[_0xc751('0x3a')],{'$or':_[_0xc751('0x30')](_0x52d94c,function(_0x113fe1){if(_0x113fe1['type']!==_0xc751('0x3b')){var _0x3a8350={};_0x3a8350[_0x113fe1[_0xc751('0x29')]]={'$like':'%'+_0x1aadbb['query']['filter']+'%'};return _0x3a8350;}})});}_0x55e6c3=_[_0xc751('0x3c')]({},_0x55e6c3,_0x1aadbb['options']);var _0x29da47={'where':_0x55e6c3['where']};return db[_0xc751('0x2b')][_0xc751('0x1f')](_0x29da47)[_0xc751('0x27')](function(_0x5d7dff){_0x24e7ba[_0xc751('0x1f')]=_0x5d7dff;if(_0x1aadbb[_0xc751('0x31')][_0xc751('0x3d')]){_0x55e6c3[_0xc751('0x3e')]=[{'all':!![]}];}return db[_0xc751('0x2b')][_0xc751('0x3f')](_0x55e6c3);})[_0xc751('0x27')](function(_0x8d256a){_0x24e7ba['rows']=_0x8d256a;return _0x24e7ba;})['then'](respondWithFilteredResult(_0x399277,_0x55e6c3))['catch'](handleError(_0x399277,null));};exports[_0xc751('0x40')]=function(_0x44371a,_0x1a2559){var _0x2aacce={'raw':!![],'where':{'id':_0x44371a[_0xc751('0x41')]['id']}},_0x3f9159={};_0x3f9159[_0xc751('0x2f')]=_['keys'](db[_0xc751('0x2b')]['rawAttributes']);_0x3f9159[_0xc751('0x31')]=_[_0xc751('0x32')](_0x44371a['query']);_0x3f9159[_0xc751('0x33')]=_['intersection'](_0x3f9159[_0xc751('0x2f')],_0x3f9159[_0xc751('0x31')]);_0x2aacce['attributes']=_[_0xc751('0x34')](_0x3f9159['model'],qs[_0xc751('0x35')](_0x44371a['query'][_0xc751('0x35')]));_0x2aacce[_0xc751('0x36')]=_0x2aacce[_0xc751('0x36')][_0xc751('0x42')]?_0x2aacce[_0xc751('0x36')]:_0x3f9159[_0xc751('0x2f')];if(_0x44371a[_0xc751('0x31')][_0xc751('0x3d')]){_0x2aacce[_0xc751('0x3e')]=[{'all':!![]}];}_0x2aacce=_['merge']({},_0x2aacce,_0x44371a[_0xc751('0x43')]);return db[_0xc751('0x2b')][_0xc751('0x44')](_0x2aacce)[_0xc751('0x27')](handleEntityNotFound(_0x1a2559,null))[_0xc751('0x27')](respondWithResult(_0x1a2559,null))[_0xc751('0x45')](handleError(_0x1a2559,null));};exports['create']=function(_0xb8107a,_0x2aa403){return db['SmsQueueReport'][_0xc751('0x46')](_0xb8107a[_0xc751('0x47')],{})[_0xc751('0x27')](respondWithResult(_0x2aa403,0xc9))[_0xc751('0x45')](handleError(_0x2aa403,null));};exports[_0xc751('0x26')]=function(_0x2c5c89,_0x3ebf38){if(_0x2c5c89[_0xc751('0x47')]['id']){delete _0x2c5c89['body']['id'];}return db['SmsQueueReport'][_0xc751('0x44')]({'where':{'id':_0x2c5c89[_0xc751('0x41')]['id']}})[_0xc751('0x27')](handleEntityNotFound(_0x3ebf38,null))[_0xc751('0x27')](saveUpdates(_0x2c5c89[_0xc751('0x47')],null))['then'](respondWithResult(_0x3ebf38,null))['catch'](handleError(_0x3ebf38,null));};exports[_0xc751('0x48')]=function(_0x40f5c3,_0x229f9a){return db['SmsQueueReport']['find']({'where':{'id':_0x40f5c3[_0xc751('0x41')]['id']}})[_0xc751('0x27')](handleEntityNotFound(_0x229f9a,null))['then'](removeEntity(_0x229f9a,null))[_0xc751('0x45')](handleError(_0x229f9a,null));};exports[_0xc751('0x49')]=function(_0x4cd7e3,_0x1f0d2d){return db[_0xc751('0x2b')][_0xc751('0x49')]()[_0xc751('0x27')](respondWithResult(_0x1f0d2d,null))[_0xc751('0x45')](handleError(_0x1f0d2d,null));}; \ No newline at end of file +var _0x5501=['fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','SmsQueueReport','findAll','catch','show','params','filters','includeAll','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x5501,0x19c));var _0x1550=function(_0x36092b,_0x232ad7){_0x36092b=_0x36092b-0x0;var _0x50a77e=_0x5501[_0x36092b];return _0x50a77e;};'use strict';var pdf=require(_0x1550('0x0'));var emlformat=require(_0x1550('0x1'));var rimraf=require(_0x1550('0x2'));var zipdir=require(_0x1550('0x3'));var jsonpatch=require(_0x1550('0x4'));var rp=require(_0x1550('0x5'));var moment=require(_0x1550('0x6'));var BPromise=require(_0x1550('0x7'));var Mustache=require(_0x1550('0x8'));var util=require(_0x1550('0x9'));var path=require(_0x1550('0xa'));var sox=require(_0x1550('0xb'));var csv=require(_0x1550('0xc'));var ejs=require(_0x1550('0xd'));var fs=require('fs');var _=require(_0x1550('0xe'));var squel=require(_0x1550('0xf'));var crypto=require('crypto');var jsforce=require(_0x1550('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1550('0xc'));var querystring=require(_0x1550('0x11'));var Papa=require(_0x1550('0x12'));var Redis=require(_0x1550('0x13'));var authService=require(_0x1550('0x14'));var qs=require(_0x1550('0x15'));var as=require(_0x1550('0x16'));var hardwareService=require(_0x1550('0x17'));var logger=require('../../config/logger')(_0x1550('0x18'));var utils=require(_0x1550('0x19'));var config=require(_0x1550('0x1a'));var db=require(_0x1550('0x1b'))['db'];function respondWithStatusCode(_0x1c037b,_0x1ff006){_0x1ff006=_0x1ff006||0xcc;return function(_0x1b0092){if(_0x1b0092){return _0x1c037b[_0x1550('0x1c')](_0x1ff006);}return _0x1c037b['status'](_0x1ff006)[_0x1550('0x1d')]();};}function respondWithResult(_0x3b2774,_0x322a62){_0x322a62=_0x322a62||0xc8;return function(_0x1ba957){if(_0x1ba957){return _0x3b2774[_0x1550('0x1e')](_0x322a62)[_0x1550('0x1f')](_0x1ba957);}};}function respondWithFilteredResult(_0x763058,_0x4ece16){return function(_0x30a668){if(_0x30a668){var _0x750b31=_0x30a668[_0x1550('0x20')],_0x42d4c=_0x4ece16[_0x1550('0x21')],_0x518243=_0x4ece16['offset']+_0x4ece16[_0x1550('0x22')],_0x417f00;if(_0x518243>=_0x750b31){_0x518243=_0x750b31;_0x417f00=0xc8;}else{_0x417f00=0xce;}_0x763058[_0x1550('0x1e')](_0x417f00);return _0x763058[_0x1550('0x23')](_0x1550('0x24'),_0x42d4c+'-'+_0x518243+'/'+_0x750b31)[_0x1550('0x1f')](_0x30a668);}return null;};}function patchUpdates(_0x199e74){return function(_0xe965f7){try{jsonpatch[_0x1550('0x25')](_0xe965f7,_0x199e74,!![]);}catch(_0xa8096d){return BPromise['reject'](_0xa8096d);}return _0xe965f7['save']();};}function saveUpdates(_0x390f87,_0x56c22b){return function(_0x4c16c4){if(_0x4c16c4){return _0x4c16c4[_0x1550('0x26')](_0x390f87)['then'](function(_0x207b6a){return _0x207b6a;});}return null;};}function removeEntity(_0x33f859,_0x4fc8d2){return function(_0x308423){if(_0x308423){return _0x308423[_0x1550('0x27')]()[_0x1550('0x28')](function(){_0x33f859[_0x1550('0x1e')](0xcc)[_0x1550('0x1d')]();});}};}function handleEntityNotFound(_0x9f7443,_0x4c4b03){return function(_0x7928b){if(!_0x7928b){_0x9f7443[_0x1550('0x1c')](0x194);}return _0x7928b;};}function handleError(_0x200add,_0x560a1b){_0x560a1b=_0x560a1b||0x1f4;return function(_0x549bce){logger[_0x1550('0x29')](_0x549bce[_0x1550('0x2a')]);if(_0x549bce[_0x1550('0x2b')]){delete _0x549bce[_0x1550('0x2b')];}_0x200add['status'](_0x560a1b)[_0x1550('0x2c')](_0x549bce);};}exports[_0x1550('0x2d')]=function(_0x3ad059,_0x4b2f72){var _0x332bfa={},_0x92e4e9={},_0x31ef6c={'count':0x0,'rows':[]};var _0x93dc34=_[_0x1550('0x2e')](db['SmsQueueReport'][_0x1550('0x2f')],function(_0x30ae5e){return{'name':_0x30ae5e[_0x1550('0x30')],'type':_0x30ae5e[_0x1550('0x31')][_0x1550('0x32')]};});_0x92e4e9[_0x1550('0x33')]=_[_0x1550('0x2e')](_0x93dc34,_0x1550('0x2b'));_0x92e4e9[_0x1550('0x34')]=_[_0x1550('0x35')](_0x3ad059[_0x1550('0x34')]);_0x92e4e9['filters']=_[_0x1550('0x36')](_0x92e4e9[_0x1550('0x33')],_0x92e4e9[_0x1550('0x34')]);_0x332bfa[_0x1550('0x37')]=_[_0x1550('0x36')](_0x92e4e9[_0x1550('0x33')],qs['fields'](_0x3ad059[_0x1550('0x34')][_0x1550('0x38')]));_0x332bfa[_0x1550('0x37')]=_0x332bfa[_0x1550('0x37')][_0x1550('0x39')]?_0x332bfa[_0x1550('0x37')]:_0x92e4e9['model'];if(!_0x3ad059[_0x1550('0x34')][_0x1550('0x3a')](_0x1550('0x3b'))){_0x332bfa[_0x1550('0x22')]=qs[_0x1550('0x22')](_0x3ad059['query'][_0x1550('0x22')]);_0x332bfa['offset']=qs['offset'](_0x3ad059[_0x1550('0x34')][_0x1550('0x21')]);}_0x332bfa['order']=qs[_0x1550('0x3c')](_0x3ad059['query'][_0x1550('0x3c')]);_0x332bfa['where']=qs['filters'](_[_0x1550('0x3d')](_0x3ad059[_0x1550('0x34')],_0x92e4e9['filters']));if(_0x3ad059[_0x1550('0x34')][_0x1550('0x3e')]){_0x332bfa[_0x1550('0x3f')]=_[_0x1550('0x40')](_0x332bfa[_0x1550('0x3f')],{'$or':_[_0x1550('0x2e')](_0x93dc34,function(_0x521bea){if(_0x521bea[_0x1550('0x31')]!=='VIRTUAL'){var _0x2beb01={};_0x2beb01[_0x521bea[_0x1550('0x2b')]]={'$like':'%'+_0x3ad059[_0x1550('0x34')][_0x1550('0x3e')]+'%'};return _0x2beb01;}})});}_0x332bfa=_[_0x1550('0x40')]({},_0x332bfa,_0x3ad059[_0x1550('0x41')]);var _0x3603b7={'where':_0x332bfa['where']};return db[_0x1550('0x42')]['count'](_0x3603b7)[_0x1550('0x28')](function(_0x466f2a){_0x31ef6c[_0x1550('0x20')]=_0x466f2a;if(_0x3ad059[_0x1550('0x34')]['includeAll']){_0x332bfa['include']=[{'all':!![]}];}return db['SmsQueueReport'][_0x1550('0x43')](_0x332bfa);})[_0x1550('0x28')](function(_0x11cd4d){_0x31ef6c['rows']=_0x11cd4d;return _0x31ef6c;})['then'](respondWithFilteredResult(_0x4b2f72,_0x332bfa))[_0x1550('0x44')](handleError(_0x4b2f72,null));};exports[_0x1550('0x45')]=function(_0x28cd0e,_0x33010d){var _0x1eb442={'raw':!![],'where':{'id':_0x28cd0e[_0x1550('0x46')]['id']}},_0x5505fe={};_0x5505fe['model']=_[_0x1550('0x35')](db['SmsQueueReport'][_0x1550('0x2f')]);_0x5505fe[_0x1550('0x34')]=_[_0x1550('0x35')](_0x28cd0e['query']);_0x5505fe[_0x1550('0x47')]=_['intersection'](_0x5505fe[_0x1550('0x33')],_0x5505fe[_0x1550('0x34')]);_0x1eb442[_0x1550('0x37')]=_[_0x1550('0x36')](_0x5505fe[_0x1550('0x33')],qs['fields'](_0x28cd0e[_0x1550('0x34')][_0x1550('0x38')]));_0x1eb442[_0x1550('0x37')]=_0x1eb442[_0x1550('0x37')][_0x1550('0x39')]?_0x1eb442[_0x1550('0x37')]:_0x5505fe[_0x1550('0x33')];if(_0x28cd0e[_0x1550('0x34')][_0x1550('0x48')]){_0x1eb442[_0x1550('0x49')]=[{'all':!![]}];}_0x1eb442=_[_0x1550('0x40')]({},_0x1eb442,_0x28cd0e[_0x1550('0x41')]);return db['SmsQueueReport'][_0x1550('0x4a')](_0x1eb442)[_0x1550('0x28')](handleEntityNotFound(_0x33010d,null))[_0x1550('0x28')](respondWithResult(_0x33010d,null))[_0x1550('0x44')](handleError(_0x33010d,null));};exports[_0x1550('0x4b')]=function(_0x498655,_0x3deef9){return db[_0x1550('0x42')][_0x1550('0x4b')](_0x498655[_0x1550('0x4c')],{})[_0x1550('0x28')](respondWithResult(_0x3deef9,0xc9))[_0x1550('0x44')](handleError(_0x3deef9,null));};exports['update']=function(_0x3b29ea,_0x733dee){if(_0x3b29ea[_0x1550('0x4c')]['id']){delete _0x3b29ea[_0x1550('0x4c')]['id'];}return db[_0x1550('0x42')][_0x1550('0x4a')]({'where':{'id':_0x3b29ea['params']['id']}})['then'](handleEntityNotFound(_0x733dee,null))[_0x1550('0x28')](saveUpdates(_0x3b29ea['body'],null))['then'](respondWithResult(_0x733dee,null))['catch'](handleError(_0x733dee,null));};exports[_0x1550('0x27')]=function(_0x193eb5,_0x5bb8a4){return db[_0x1550('0x42')][_0x1550('0x4a')]({'where':{'id':_0x193eb5['params']['id']}})[_0x1550('0x28')](handleEntityNotFound(_0x5bb8a4,null))[_0x1550('0x28')](removeEntity(_0x5bb8a4,null))[_0x1550('0x44')](handleError(_0x5bb8a4,null));};exports[_0x1550('0x4d')]=function(_0x41ba43,_0x1938d7){return db['SmsQueueReport'][_0x1550('0x4d')]()[_0x1550('0x28')](respondWithResult(_0x1938d7,null))['catch'](handleError(_0x1938d7,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 723d921..49dfda0 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 _0x7e93=['util','../../config/logger','api','bluebird','request-promise','rimraf','exports','SmsQueueReport','report_sms_queue','uniqueid','lodash'];(function(_0x3ff986,_0x3e239e){var _0x2595f6=function(_0x2a00c8){while(--_0x2a00c8){_0x3ff986['push'](_0x3ff986['shift']());}};_0x2595f6(++_0x3e239e);}(_0x7e93,0x78));var _0x37e9=function(_0x5abe53,_0x20f765){_0x5abe53=_0x5abe53-0x0;var _0x53d334=_0x7e93[_0x5abe53];return _0x53d334;};'use strict';var _=require(_0x37e9('0x0'));var util=require(_0x37e9('0x1'));var logger=require(_0x37e9('0x2'))(_0x37e9('0x3'));var moment=require('moment');var BPromise=require(_0x37e9('0x4'));var rp=require(_0x37e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37e9('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueueReport.attributes');module[_0x37e9('0x7')]=function(_0x45a5a2,_0x44abb3){return _0x45a5a2['define'](_0x37e9('0x8'),attributes,{'tableName':_0x37e9('0x9'),'paranoid':![],'indexes':[{'name':_0x37e9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc831=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','SmsQueueReport','report_sms_queue','uniqueid','util'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xc831,0x103));var _0x1c83=function(_0x14927b,_0xc43bb1){_0x14927b=_0x14927b-0x0;var _0x137d61=_0xc831[_0x14927b];return _0x137d61;};'use strict';var _=require('lodash');var util=require(_0x1c83('0x0'));var logger=require(_0x1c83('0x1'))(_0x1c83('0x2'));var moment=require(_0x1c83('0x3'));var BPromise=require(_0x1c83('0x4'));var rp=require(_0x1c83('0x5'));var fs=require('fs');var path=require(_0x1c83('0x6'));var rimraf=require(_0x1c83('0x7'));var config=require(_0x1c83('0x8'));var attributes=require(_0x1c83('0x9'));module['exports']=function(_0x5682fb,_0x2f52ea){return _0x5682fb['define'](_0x1c83('0xa'),attributes,{'tableName':_0x1c83('0xb'),'paranoid':![],'indexes':[{'name':_0x1c83('0xc'),'fields':[_0x1c83('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 3bf2c2f..1f3f684 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 _0x8812=['../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x104282,_0x46f99d){var _0x1dc92b=function(_0x380876){while(--_0x380876){_0x104282['push'](_0x104282['shift']());}};_0x1dc92b(++_0x46f99d);}(_0x8812,0x18e));var _0x2881=function(_0x17f8dd,_0x538286){_0x17f8dd=_0x17f8dd-0x0;var _0x5049de=_0x8812[_0x17f8dd];return _0x5049de;};'use strict';var _=require(_0x2881('0x0'));var util=require('util');var moment=require(_0x2881('0x1'));var BPromise=require(_0x2881('0x2'));var rs=require(_0x2881('0x3'));var fs=require('fs');var Redis=require(_0x2881('0x4'));var db=require(_0x2881('0x5'))['db'];var utils=require(_0x2881('0x6'));var logger=require(_0x2881('0x7'))(_0x2881('0x8'));var config=require(_0x2881('0x9'));var jayson=require(_0x2881('0xa'));var client=jayson[_0x2881('0xb')][_0x2881('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36f5fe,_0x128f64,_0x1b41ed){return new BPromise(function(_0x4d9d38,_0x2a1d1d){return client[_0x2881('0xd')](_0x36f5fe,_0x1b41ed)[_0x2881('0xe')](function(_0x5088b0){logger[_0x2881('0xf')](_0x2881('0x10'),_0x128f64,_0x2881('0x11'));logger[_0x2881('0x12')](_0x2881('0x13'),_0x128f64,'request\x20sent',JSON[_0x2881('0x14')](_0x5088b0));if(_0x5088b0[_0x2881('0x15')]){if(_0x5088b0[_0x2881('0x15')][_0x2881('0x16')]===0x1f4){logger[_0x2881('0x15')](_0x2881('0x10'),_0x128f64,_0x5088b0[_0x2881('0x15')][_0x2881('0x17')]);return _0x2a1d1d(_0x5088b0[_0x2881('0x15')][_0x2881('0x17')]);}logger['error'](_0x2881('0x10'),_0x128f64,_0x5088b0[_0x2881('0x15')][_0x2881('0x17')]);return _0x4d9d38(_0x5088b0['error'][_0x2881('0x17')]);}else{logger[_0x2881('0xf')](_0x2881('0x10'),_0x128f64,_0x2881('0x11'));_0x4d9d38(_0x5088b0[_0x2881('0x18')][_0x2881('0x17')]);}})[_0x2881('0x19')](function(_0x5df9bc){logger[_0x2881('0x15')](_0x2881('0x10'),_0x128f64,_0x5df9bc);_0x2a1d1d(_0x5df9bc);});});}exports[_0x2881('0x1a')]=function(_0x3e101c){var _0x1353d0=this;return new Promise(function(_0x2e3db5,_0x4aba44){return db[_0x2881('0x1b')][_0x2881('0x1c')](_0x3e101c[_0x2881('0x1d')],{'raw':_0x3e101c[_0x2881('0x1e')]?_0x3e101c[_0x2881('0x1e')][_0x2881('0x1f')]===undefined?!![]:![]:!![]})[_0x2881('0xe')](function(_0x972149){logger[_0x2881('0xf')](_0x2881('0x1a'),_0x3e101c);logger[_0x2881('0x12')](_0x2881('0x1a'),_0x3e101c,JSON[_0x2881('0x14')](_0x972149));_0x2e3db5(_0x972149);})['catch'](function(_0x4d70d4){logger[_0x2881('0x15')](_0x2881('0x1a'),_0x4d70d4[_0x2881('0x17')],_0x3e101c);_0x4aba44(_0x1353d0['error'](0x1f4,_0x4d70d4['message']));});});};exports[_0x2881('0x20')]=function(_0x480967){var _0x178958=this;return new Promise(function(_0xb78001,_0x4eda88){return db['SmsQueueReport'][_0x2881('0x21')](_0x480967[_0x2881('0x1d')],{'raw':_0x480967['options']?_0x480967[_0x2881('0x1e')][_0x2881('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x480967[_0x2881('0x1e')]?_0x480967[_0x2881('0x1e')][_0x2881('0x22')]||null:null,'attributes':_0x480967['options']?_0x480967[_0x2881('0x1e')][_0x2881('0x23')]||null:null,'limit':_0x480967[_0x2881('0x1e')]?_0x480967[_0x2881('0x1e')][_0x2881('0x24')]||null:null})[_0x2881('0xe')](function(_0x1a6e06){logger[_0x2881('0xf')](_0x2881('0x20'),_0x480967);logger[_0x2881('0x12')]('UpdateSmsQueueReport',_0x480967,JSON[_0x2881('0x14')](_0x1a6e06));_0xb78001(_0x1a6e06);})[_0x2881('0x19')](function(_0x19020a){logger[_0x2881('0x15')](_0x2881('0x20'),_0x19020a['message'],_0x480967);_0x4eda88(_0x178958[_0x2881('0x15')](0x1f4,_0x19020a[_0x2881('0x17')]));});});}; \ No newline at end of file +var _0x9d30=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','CreateSmsQueueReport','create','body','options','raw','then','stringify','catch','SmsQueueReport','update','where','attributes','limit','UpdateSmsQueueReport','lodash'];(function(_0x5f18c2,_0x1b353d){var _0x5574fc=function(_0x4c57f4){while(--_0x4c57f4){_0x5f18c2['push'](_0x5f18c2['shift']());}};_0x5574fc(++_0x1b353d);}(_0x9d30,0x7f));var _0x09d3=function(_0x2f63e7,_0x24b126){_0x2f63e7=_0x2f63e7-0x0;var _0x10c83c=_0x9d30[_0x2f63e7];return _0x10c83c;};'use strict';var _=require(_0x09d3('0x0'));var util=require('util');var moment=require(_0x09d3('0x1'));var BPromise=require(_0x09d3('0x2'));var rs=require(_0x09d3('0x3'));var fs=require('fs');var Redis=require(_0x09d3('0x4'));var db=require(_0x09d3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x09d3('0x6'))(_0x09d3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x09d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28ac74,_0x6f247b,_0x49e95f){return new BPromise(function(_0x23167b,_0x230b48){return client[_0x09d3('0x9')](_0x28ac74,_0x49e95f)['then'](function(_0x529b5a){logger[_0x09d3('0xa')](_0x09d3('0xb'),_0x6f247b,_0x09d3('0xc'));logger[_0x09d3('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x6f247b,'request\x20sent',JSON['stringify'](_0x529b5a));if(_0x529b5a[_0x09d3('0xe')]){if(_0x529b5a[_0x09d3('0xe')][_0x09d3('0xf')]===0x1f4){logger[_0x09d3('0xe')](_0x09d3('0xb'),_0x6f247b,_0x529b5a[_0x09d3('0xe')][_0x09d3('0x10')]);return _0x230b48(_0x529b5a[_0x09d3('0xe')][_0x09d3('0x10')]);}logger[_0x09d3('0xe')](_0x09d3('0xb'),_0x6f247b,_0x529b5a[_0x09d3('0xe')]['message']);return _0x23167b(_0x529b5a[_0x09d3('0xe')][_0x09d3('0x10')]);}else{logger[_0x09d3('0xa')](_0x09d3('0xb'),_0x6f247b,_0x09d3('0xc'));_0x23167b(_0x529b5a[_0x09d3('0x11')][_0x09d3('0x10')]);}})['catch'](function(_0x17a4ac){logger[_0x09d3('0xe')](_0x09d3('0xb'),_0x6f247b,_0x17a4ac);_0x230b48(_0x17a4ac);});});}exports[_0x09d3('0x12')]=function(_0x3fd539){var _0x1c64ef=this;return new Promise(function(_0xadba29,_0x517ccb){return db['SmsQueueReport'][_0x09d3('0x13')](_0x3fd539[_0x09d3('0x14')],{'raw':_0x3fd539[_0x09d3('0x15')]?_0x3fd539[_0x09d3('0x15')][_0x09d3('0x16')]===undefined?!![]:![]:!![]})[_0x09d3('0x17')](function(_0x2790c1){logger[_0x09d3('0xa')](_0x09d3('0x12'),_0x3fd539);logger['debug'](_0x09d3('0x12'),_0x3fd539,JSON[_0x09d3('0x18')](_0x2790c1));_0xadba29(_0x2790c1);})[_0x09d3('0x19')](function(_0x1a4210){logger[_0x09d3('0xe')](_0x09d3('0x12'),_0x1a4210[_0x09d3('0x10')],_0x3fd539);_0x517ccb(_0x1c64ef[_0x09d3('0xe')](0x1f4,_0x1a4210[_0x09d3('0x10')]));});});};exports['UpdateSmsQueueReport']=function(_0x246107){var _0x4d4a63=this;return new Promise(function(_0x484f46,_0x348d7c){return db[_0x09d3('0x1a')][_0x09d3('0x1b')](_0x246107[_0x09d3('0x14')],{'raw':_0x246107[_0x09d3('0x15')]?_0x246107[_0x09d3('0x15')][_0x09d3('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x246107['options']?_0x246107[_0x09d3('0x15')][_0x09d3('0x1c')]||null:null,'attributes':_0x246107[_0x09d3('0x15')]?_0x246107[_0x09d3('0x15')][_0x09d3('0x1d')]||null:null,'limit':_0x246107[_0x09d3('0x15')]?_0x246107[_0x09d3('0x15')][_0x09d3('0x1e')]||null:null})['then'](function(_0x5ea7db){logger[_0x09d3('0xa')](_0x09d3('0x1f'),_0x246107);logger['debug'](_0x09d3('0x1f'),_0x246107,JSON['stringify'](_0x5ea7db));_0x484f46(_0x5ea7db);})['catch'](function(_0x10bd64){logger[_0x09d3('0xe')]('UpdateSmsQueueReport',_0x10bd64[_0x09d3('0x10')],_0x246107);_0x348d7c(_0x4d4a63['error'](0x1f4,_0x10bd64[_0x09d3('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index fc0f394..1c8a496 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 _0x6cb4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x351fbf,_0x4b9078){var _0x44a8b2=function(_0x3c754e){while(--_0x3c754e){_0x351fbf['push'](_0x351fbf['shift']());}};_0x44a8b2(++_0x4b9078);}(_0x6cb4,0xff));var _0x46cb=function(_0x4228fe,_0x339477){_0x4228fe=_0x4228fe-0x0;var _0x13e4e3=_0x6cb4[_0x4228fe];return _0x13e4e3;};'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 auth=require(_0x46cb('0x6'));var interaction=require(_0x46cb('0x7'));var config=require(_0x46cb('0x8'));var controller=require('./smsTransferReport.controller');router[_0x46cb('0x9')]('/',auth['isAuthenticated'](),controller[_0x46cb('0xa')]);router['get'](_0x46cb('0xb'),auth[_0x46cb('0xc')](),controller[_0x46cb('0xd')]);router[_0x46cb('0x9')](_0x46cb('0xe'),auth[_0x46cb('0xc')](),controller['show']);router[_0x46cb('0xf')]('/',auth[_0x46cb('0xc')](),controller['create']);router[_0x46cb('0x10')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0x11')]);router[_0x46cb('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x46cb('0x13')]=router; \ No newline at end of file +var _0x087b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','exports','multer','util','express'];(function(_0x24c135,_0xdb4450){var _0x290c66=function(_0x537cf8){while(--_0x537cf8){_0x24c135['push'](_0x24c135['shift']());}};_0x290c66(++_0xdb4450);}(_0x087b,0x11a));var _0xb087=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x087b[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var auth=require(_0xb087('0x3'));var interaction=require(_0xb087('0x4'));var config=require(_0xb087('0x5'));var controller=require(_0xb087('0x6'));router[_0xb087('0x7')]('/',auth[_0xb087('0x8')](),controller[_0xb087('0x9')]);router[_0xb087('0x7')](_0xb087('0xa'),auth[_0xb087('0x8')](),controller[_0xb087('0xb')]);router[_0xb087('0x7')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller[_0xb087('0xd')]);router[_0xb087('0xe')]('/',auth[_0xb087('0x8')](),controller['create']);router[_0xb087('0xf')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller[_0xb087('0x10')]);router[_0xb087('0x11')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller['destroy']);module[_0xb087('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index cd26733..d7f0810 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 _0x110b=['exports','STRING','ENUM','queue','DATE','sequelize'];(function(_0x3832f9,_0x59c443){var _0x37418c=function(_0x133ee9){while(--_0x133ee9){_0x3832f9['push'](_0x3832f9['shift']());}};_0x37418c(++_0x59c443);}(_0x110b,0x1cd));var _0xb110=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x110b[_0x3430aa];return _0x2ac5c;};'use strict';var moment=require('moment');var Sequelize=require(_0xb110('0x0'));module[_0xb110('0x1')]={'uniqueid':{'type':Sequelize[_0xb110('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb110('0x3')]('account','agent',_0xb110('0x4')),'allowNull':![],'defaultValue':_0xb110('0x4')},'transferredAt':{'type':Sequelize[_0xb110('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xa35c=['account','agent','queue','DATE','NOW','sequelize','exports','ENUM'];(function(_0x53d3b0,_0x62aa42){var _0x44f608=function(_0x47f276){while(--_0x47f276){_0x53d3b0['push'](_0x53d3b0['shift']());}};_0x44f608(++_0x62aa42);}(_0xa35c,0x1e5));var _0xca35=function(_0x2f1f5f,_0x495287){_0x2f1f5f=_0x2f1f5f-0x0;var _0x5c0dec=_0xa35c[_0x2f1f5f];return _0x5c0dec;};'use strict';var moment=require('moment');var Sequelize=require(_0xca35('0x0'));module[_0xca35('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xca35('0x2')](_0xca35('0x3'),_0xca35('0x4'),'queue'),'allowNull':![],'defaultValue':_0xca35('0x5')},'transferredAt':{'type':Sequelize[_0xca35('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xca35('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 77248ba..ac978a2 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 _0xad64=['ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv'];(function(_0x15ea3c,_0x46807c){var _0x5e7757=function(_0x5b406c){while(--_0x5b406c){_0x15ea3c['push'](_0x15ea3c['shift']());}};_0x5e7757(++_0x46807c);}(_0xad64,0x1c5));var _0x4ad6=function(_0x5acae3,_0x31d121){_0x5acae3=_0x5acae3-0x0;var _0x9a433d=_0xad64[_0x5acae3];return _0x9a433d;};'use strict';var pdf=require(_0x4ad6('0x0'));var emlformat=require(_0x4ad6('0x1'));var rimraf=require(_0x4ad6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ad6('0x3'));var rp=require('request-promise');var moment=require(_0x4ad6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ad6('0x5'));var path=require(_0x4ad6('0x6'));var sox=require(_0x4ad6('0x7'));var csv=require(_0x4ad6('0x8'));var ejs=require(_0x4ad6('0x9'));var fs=require('fs');var _=require(_0x4ad6('0xa'));var squel=require(_0x4ad6('0xb'));var crypto=require(_0x4ad6('0xc'));var jsforce=require(_0x4ad6('0xd'));var deskjs=require(_0x4ad6('0xe'));var toCsv=require(_0x4ad6('0x8'));var querystring=require('querystring');var Papa=require(_0x4ad6('0xf'));var Redis=require(_0x4ad6('0x10'));var authService=require(_0x4ad6('0x11'));var qs=require(_0x4ad6('0x12'));var as=require(_0x4ad6('0x13'));var hardwareService=require(_0x4ad6('0x14'));var logger=require(_0x4ad6('0x15'))(_0x4ad6('0x16'));var utils=require('../../config/utils');var config=require(_0x4ad6('0x17'));var db=require(_0x4ad6('0x18'))['db'];function respondWithStatusCode(_0x2f5d6a,_0x467ed4){_0x467ed4=_0x467ed4||0xcc;return function(_0x1fcecd){if(_0x1fcecd){return _0x2f5d6a[_0x4ad6('0x19')](_0x467ed4);}return _0x2f5d6a[_0x4ad6('0x1a')](_0x467ed4)['end']();};}function respondWithResult(_0x2ef1f2,_0x1765c9){_0x1765c9=_0x1765c9||0xc8;return function(_0x1051d9){if(_0x1051d9){return _0x2ef1f2[_0x4ad6('0x1a')](_0x1765c9)[_0x4ad6('0x1b')](_0x1051d9);}};}function respondWithFilteredResult(_0x4ff461,_0x89e5f3){return function(_0x250b10){if(_0x250b10){var _0x522ff9=_0x250b10[_0x4ad6('0x1c')],_0x3c89a7=_0x89e5f3[_0x4ad6('0x1d')],_0x59898f=_0x89e5f3[_0x4ad6('0x1d')]+_0x89e5f3[_0x4ad6('0x1e')],_0x2b6d64;if(_0x59898f>=_0x522ff9){_0x59898f=_0x522ff9;_0x2b6d64=0xc8;}else{_0x2b6d64=0xce;}_0x4ff461[_0x4ad6('0x1a')](_0x2b6d64);return _0x4ff461[_0x4ad6('0x1f')](_0x4ad6('0x20'),_0x3c89a7+'-'+_0x59898f+'/'+_0x522ff9)[_0x4ad6('0x1b')](_0x250b10);}return null;};}function patchUpdates(_0x5c05db){return function(_0x1b04ad){try{jsonpatch['apply'](_0x1b04ad,_0x5c05db,!![]);}catch(_0x416454){return BPromise[_0x4ad6('0x21')](_0x416454);}return _0x1b04ad[_0x4ad6('0x22')]();};}function saveUpdates(_0x2b50b2,_0x30a8ec){return function(_0x20e047){if(_0x20e047){return _0x20e047[_0x4ad6('0x23')](_0x2b50b2)['then'](function(_0x1488c8){return _0x1488c8;});}return null;};}function removeEntity(_0x29e136,_0x5f427c){return function(_0x5c79a9){if(_0x5c79a9){return _0x5c79a9[_0x4ad6('0x24')]()[_0x4ad6('0x25')](function(){_0x29e136['status'](0xcc)[_0x4ad6('0x26')]();});}};}function handleEntityNotFound(_0x35169b,_0x52df74){return function(_0x305f2d){if(!_0x305f2d){_0x35169b[_0x4ad6('0x19')](0x194);}return _0x305f2d;};}function handleError(_0x5e174b,_0x3d37aa){_0x3d37aa=_0x3d37aa||0x1f4;return function(_0x38cb50){logger[_0x4ad6('0x27')](_0x38cb50[_0x4ad6('0x28')]);if(_0x38cb50['name']){delete _0x38cb50[_0x4ad6('0x29')];}_0x5e174b[_0x4ad6('0x1a')](_0x3d37aa)[_0x4ad6('0x2a')](_0x38cb50);};}exports[_0x4ad6('0x2b')]=function(_0x42136e,_0x2ca082){var _0xea38d3={},_0x95b0f3={},_0x1de35f={'count':0x0,'rows':[]};var _0x5b3412=_[_0x4ad6('0x2c')](db[_0x4ad6('0x2d')][_0x4ad6('0x2e')],function(_0x55fa0f){return{'name':_0x55fa0f[_0x4ad6('0x2f')],'type':_0x55fa0f[_0x4ad6('0x30')]['key']};});_0x95b0f3[_0x4ad6('0x31')]=_['map'](_0x5b3412,_0x4ad6('0x29'));_0x95b0f3[_0x4ad6('0x32')]=_[_0x4ad6('0x33')](_0x42136e[_0x4ad6('0x32')]);_0x95b0f3[_0x4ad6('0x34')]=_['intersection'](_0x95b0f3[_0x4ad6('0x31')],_0x95b0f3['query']);_0xea38d3[_0x4ad6('0x35')]=_[_0x4ad6('0x36')](_0x95b0f3[_0x4ad6('0x31')],qs[_0x4ad6('0x37')](_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x37')]));_0xea38d3[_0x4ad6('0x35')]=_0xea38d3[_0x4ad6('0x35')][_0x4ad6('0x38')]?_0xea38d3['attributes']:_0x95b0f3[_0x4ad6('0x31')];if(!_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x39')](_0x4ad6('0x3a'))){_0xea38d3[_0x4ad6('0x1e')]=qs[_0x4ad6('0x1e')](_0x42136e['query'][_0x4ad6('0x1e')]);_0xea38d3[_0x4ad6('0x1d')]=qs[_0x4ad6('0x1d')](_0x42136e['query'][_0x4ad6('0x1d')]);}_0xea38d3[_0x4ad6('0x3b')]=qs[_0x4ad6('0x3c')](_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x3c')]);_0xea38d3[_0x4ad6('0x3d')]=qs[_0x4ad6('0x34')](_['pick'](_0x42136e[_0x4ad6('0x32')],_0x95b0f3[_0x4ad6('0x34')]));if(_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x3e')]){_0xea38d3[_0x4ad6('0x3d')]=_[_0x4ad6('0x3f')](_0xea38d3[_0x4ad6('0x3d')],{'$or':_[_0x4ad6('0x2c')](_0x5b3412,function(_0x1de026){if(_0x1de026[_0x4ad6('0x30')]!==_0x4ad6('0x40')){var _0x4befdd={};_0x4befdd[_0x1de026[_0x4ad6('0x29')]]={'$like':'%'+_0x42136e[_0x4ad6('0x32')]['filter']+'%'};return _0x4befdd;}})});}_0xea38d3=_[_0x4ad6('0x3f')]({},_0xea38d3,_0x42136e[_0x4ad6('0x41')]);var _0x20b2d4={'where':_0xea38d3[_0x4ad6('0x3d')]};return db['SmsTransferReport'][_0x4ad6('0x1c')](_0x20b2d4)['then'](function(_0x154aec){_0x1de35f['count']=_0x154aec;if(_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x42')]){_0xea38d3[_0x4ad6('0x43')]=[{'all':!![]}];}return db[_0x4ad6('0x2d')][_0x4ad6('0x44')](_0xea38d3);})['then'](function(_0x4e79b7){_0x1de35f[_0x4ad6('0x45')]=_0x4e79b7;return _0x1de35f;})[_0x4ad6('0x25')](respondWithFilteredResult(_0x2ca082,_0xea38d3))['catch'](handleError(_0x2ca082,null));};exports[_0x4ad6('0x46')]=function(_0x1a5665,_0x5b4ec1){var _0xb0b722={'raw':!![],'where':{'id':_0x1a5665[_0x4ad6('0x47')]['id']}},_0x29d193={};_0x29d193['model']=_['keys'](db[_0x4ad6('0x2d')][_0x4ad6('0x2e')]);_0x29d193[_0x4ad6('0x32')]=_[_0x4ad6('0x33')](_0x1a5665[_0x4ad6('0x32')]);_0x29d193[_0x4ad6('0x34')]=_[_0x4ad6('0x36')](_0x29d193['model'],_0x29d193[_0x4ad6('0x32')]);_0xb0b722[_0x4ad6('0x35')]=_[_0x4ad6('0x36')](_0x29d193[_0x4ad6('0x31')],qs[_0x4ad6('0x37')](_0x1a5665['query']['fields']));_0xb0b722[_0x4ad6('0x35')]=_0xb0b722[_0x4ad6('0x35')][_0x4ad6('0x38')]?_0xb0b722[_0x4ad6('0x35')]:_0x29d193[_0x4ad6('0x31')];if(_0x1a5665[_0x4ad6('0x32')][_0x4ad6('0x42')]){_0xb0b722[_0x4ad6('0x43')]=[{'all':!![]}];}_0xb0b722=_[_0x4ad6('0x3f')]({},_0xb0b722,_0x1a5665[_0x4ad6('0x41')]);return db[_0x4ad6('0x2d')]['find'](_0xb0b722)[_0x4ad6('0x25')](handleEntityNotFound(_0x5b4ec1,null))[_0x4ad6('0x25')](respondWithResult(_0x5b4ec1,null))[_0x4ad6('0x48')](handleError(_0x5b4ec1,null));};exports[_0x4ad6('0x49')]=function(_0x1dd945,_0x118733){return db[_0x4ad6('0x2d')]['create'](_0x1dd945[_0x4ad6('0x4a')],{})['then'](respondWithResult(_0x118733,0xc9))[_0x4ad6('0x48')](handleError(_0x118733,null));};exports[_0x4ad6('0x23')]=function(_0x3ef2df,_0x10a341){if(_0x3ef2df[_0x4ad6('0x4a')]['id']){delete _0x3ef2df['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x3ef2df['params']['id']}})[_0x4ad6('0x25')](handleEntityNotFound(_0x10a341,null))[_0x4ad6('0x25')](saveUpdates(_0x3ef2df[_0x4ad6('0x4a')],null))[_0x4ad6('0x25')](respondWithResult(_0x10a341,null))[_0x4ad6('0x48')](handleError(_0x10a341,null));};exports['destroy']=function(_0x46eb57,_0x584c92){return db['SmsTransferReport'][_0x4ad6('0x4b')]({'where':{'id':_0x46eb57[_0x4ad6('0x47')]['id']}})[_0x4ad6('0x25')](handleEntityNotFound(_0x584c92,null))[_0x4ad6('0x25')](removeEntity(_0x584c92,null))[_0x4ad6('0x48')](handleError(_0x584c92,null));};exports[_0x4ad6('0x4c')]=function(_0x1d6188,_0x29a6a5){return db[_0x4ad6('0x2d')][_0x4ad6('0x4c')]()[_0x4ad6('0x25')](respondWithResult(_0x29a6a5,null))['catch'](handleError(_0x29a6a5,null));}; \ No newline at end of file +var _0x3704=['request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','end','status','json','offset','limit','set','reject','save','update','then','stack','name','send','index','map','SmsTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','catch','rawAttributes','options','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3704,0xd0));var _0x4370=function(_0x1f9002,_0x598e78){_0x1f9002=_0x1f9002-0x0;var _0x13fdd5=_0x3704[_0x1f9002];return _0x13fdd5;};'use strict';var pdf=require(_0x4370('0x0'));var emlformat=require(_0x4370('0x1'));var rimraf=require(_0x4370('0x2'));var zipdir=require(_0x4370('0x3'));var jsonpatch=require(_0x4370('0x4'));var rp=require(_0x4370('0x5'));var moment=require(_0x4370('0x6'));var BPromise=require(_0x4370('0x7'));var Mustache=require(_0x4370('0x8'));var util=require(_0x4370('0x9'));var path=require('path');var sox=require(_0x4370('0xa'));var csv=require('to-csv');var ejs=require(_0x4370('0xb'));var fs=require('fs');var _=require(_0x4370('0xc'));var squel=require('squel');var crypto=require(_0x4370('0xd'));var jsforce=require(_0x4370('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4370('0xf'));var querystring=require('querystring');var Papa=require(_0x4370('0x10'));var Redis=require(_0x4370('0x11'));var authService=require(_0x4370('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4370('0x13'));var hardwareService=require(_0x4370('0x14'));var logger=require(_0x4370('0x15'))('api');var utils=require(_0x4370('0x16'));var config=require('../../config/environment');var db=require(_0x4370('0x17'))['db'];function respondWithStatusCode(_0x255256,_0x2f8ccd){_0x2f8ccd=_0x2f8ccd||0xcc;return function(_0x5a962c){if(_0x5a962c){return _0x255256[_0x4370('0x18')](_0x2f8ccd);}return _0x255256['status'](_0x2f8ccd)[_0x4370('0x19')]();};}function respondWithResult(_0xe51dd2,_0x3fb605){_0x3fb605=_0x3fb605||0xc8;return function(_0x49d772){if(_0x49d772){return _0xe51dd2[_0x4370('0x1a')](_0x3fb605)[_0x4370('0x1b')](_0x49d772);}};}function respondWithFilteredResult(_0x5738ec,_0x43d195){return function(_0x5e86fa){if(_0x5e86fa){var _0x93880f=_0x5e86fa['count'],_0x282866=_0x43d195[_0x4370('0x1c')],_0x1a0cb0=_0x43d195[_0x4370('0x1c')]+_0x43d195[_0x4370('0x1d')],_0x5d5f36;if(_0x1a0cb0>=_0x93880f){_0x1a0cb0=_0x93880f;_0x5d5f36=0xc8;}else{_0x5d5f36=0xce;}_0x5738ec[_0x4370('0x1a')](_0x5d5f36);return _0x5738ec[_0x4370('0x1e')]('Content-Range',_0x282866+'-'+_0x1a0cb0+'/'+_0x93880f)[_0x4370('0x1b')](_0x5e86fa);}return null;};}function patchUpdates(_0x488278){return function(_0x95817){try{jsonpatch['apply'](_0x95817,_0x488278,!![]);}catch(_0x10fd76){return BPromise[_0x4370('0x1f')](_0x10fd76);}return _0x95817[_0x4370('0x20')]();};}function saveUpdates(_0xce917d,_0x5e9e48){return function(_0x195883){if(_0x195883){return _0x195883[_0x4370('0x21')](_0xce917d)[_0x4370('0x22')](function(_0x262e95){return _0x262e95;});}return null;};}function removeEntity(_0x5db71b,_0xfee799){return function(_0x559d61){if(_0x559d61){return _0x559d61['destroy']()['then'](function(){_0x5db71b[_0x4370('0x1a')](0xcc)[_0x4370('0x19')]();});}};}function handleEntityNotFound(_0x17b94f,_0xbce4df){return function(_0x59dd03){if(!_0x59dd03){_0x17b94f[_0x4370('0x18')](0x194);}return _0x59dd03;};}function handleError(_0x6ceb02,_0x3303eb){_0x3303eb=_0x3303eb||0x1f4;return function(_0x4b3f76){logger['error'](_0x4b3f76[_0x4370('0x23')]);if(_0x4b3f76[_0x4370('0x24')]){delete _0x4b3f76[_0x4370('0x24')];}_0x6ceb02[_0x4370('0x1a')](_0x3303eb)[_0x4370('0x25')](_0x4b3f76);};}exports[_0x4370('0x26')]=function(_0x2bb3fa,_0x3b617e){var _0x54b61c={},_0x6ae09={},_0x541dde={'count':0x0,'rows':[]};var _0x3591e0=_[_0x4370('0x27')](db[_0x4370('0x28')]['rawAttributes'],function(_0x517af5){return{'name':_0x517af5['fieldName'],'type':_0x517af5[_0x4370('0x29')][_0x4370('0x2a')]};});_0x6ae09[_0x4370('0x2b')]=_['map'](_0x3591e0,'name');_0x6ae09[_0x4370('0x2c')]=_[_0x4370('0x2d')](_0x2bb3fa[_0x4370('0x2c')]);_0x6ae09[_0x4370('0x2e')]=_[_0x4370('0x2f')](_0x6ae09['model'],_0x6ae09[_0x4370('0x2c')]);_0x54b61c[_0x4370('0x30')]=_[_0x4370('0x2f')](_0x6ae09[_0x4370('0x2b')],qs[_0x4370('0x31')](_0x2bb3fa[_0x4370('0x2c')][_0x4370('0x31')]));_0x54b61c[_0x4370('0x30')]=_0x54b61c[_0x4370('0x30')][_0x4370('0x32')]?_0x54b61c[_0x4370('0x30')]:_0x6ae09['model'];if(!_0x2bb3fa[_0x4370('0x2c')][_0x4370('0x33')](_0x4370('0x34'))){_0x54b61c[_0x4370('0x1d')]=qs[_0x4370('0x1d')](_0x2bb3fa['query'][_0x4370('0x1d')]);_0x54b61c['offset']=qs[_0x4370('0x1c')](_0x2bb3fa[_0x4370('0x2c')][_0x4370('0x1c')]);}_0x54b61c[_0x4370('0x35')]=qs[_0x4370('0x36')](_0x2bb3fa[_0x4370('0x2c')][_0x4370('0x36')]);_0x54b61c[_0x4370('0x37')]=qs[_0x4370('0x2e')](_[_0x4370('0x38')](_0x2bb3fa[_0x4370('0x2c')],_0x6ae09[_0x4370('0x2e')]));if(_0x2bb3fa[_0x4370('0x2c')][_0x4370('0x39')]){_0x54b61c[_0x4370('0x37')]=_[_0x4370('0x3a')](_0x54b61c['where'],{'$or':_['map'](_0x3591e0,function(_0x47a0ec){if(_0x47a0ec[_0x4370('0x29')]!==_0x4370('0x3b')){var _0x180b96={};_0x180b96[_0x47a0ec['name']]={'$like':'%'+_0x2bb3fa[_0x4370('0x2c')][_0x4370('0x39')]+'%'};return _0x180b96;}})});}_0x54b61c=_[_0x4370('0x3a')]({},_0x54b61c,_0x2bb3fa['options']);var _0x4c987c={'where':_0x54b61c[_0x4370('0x37')]};return db[_0x4370('0x28')][_0x4370('0x3c')](_0x4c987c)['then'](function(_0x2ec49d){_0x541dde[_0x4370('0x3c')]=_0x2ec49d;if(_0x2bb3fa[_0x4370('0x2c')]['includeAll']){_0x54b61c[_0x4370('0x3d')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x4370('0x3e')](_0x54b61c);})[_0x4370('0x22')](function(_0x25edb5){_0x541dde[_0x4370('0x3f')]=_0x25edb5;return _0x541dde;})['then'](respondWithFilteredResult(_0x3b617e,_0x54b61c))[_0x4370('0x40')](handleError(_0x3b617e,null));};exports['show']=function(_0x4a1c28,_0x23247b){var _0x39dfba={'raw':!![],'where':{'id':_0x4a1c28['params']['id']}},_0x33f89e={};_0x33f89e[_0x4370('0x2b')]=_[_0x4370('0x2d')](db[_0x4370('0x28')][_0x4370('0x41')]);_0x33f89e[_0x4370('0x2c')]=_[_0x4370('0x2d')](_0x4a1c28[_0x4370('0x2c')]);_0x33f89e['filters']=_['intersection'](_0x33f89e[_0x4370('0x2b')],_0x33f89e[_0x4370('0x2c')]);_0x39dfba['attributes']=_[_0x4370('0x2f')](_0x33f89e['model'],qs['fields'](_0x4a1c28['query'][_0x4370('0x31')]));_0x39dfba[_0x4370('0x30')]=_0x39dfba['attributes']['length']?_0x39dfba[_0x4370('0x30')]:_0x33f89e['model'];if(_0x4a1c28[_0x4370('0x2c')]['includeAll']){_0x39dfba[_0x4370('0x3d')]=[{'all':!![]}];}_0x39dfba=_[_0x4370('0x3a')]({},_0x39dfba,_0x4a1c28[_0x4370('0x42')]);return db[_0x4370('0x28')][_0x4370('0x43')](_0x39dfba)[_0x4370('0x22')](handleEntityNotFound(_0x23247b,null))[_0x4370('0x22')](respondWithResult(_0x23247b,null))[_0x4370('0x40')](handleError(_0x23247b,null));};exports[_0x4370('0x44')]=function(_0x510c8e,_0x1b21a8){return db[_0x4370('0x28')][_0x4370('0x44')](_0x510c8e[_0x4370('0x45')],{})[_0x4370('0x22')](respondWithResult(_0x1b21a8,0xc9))['catch'](handleError(_0x1b21a8,null));};exports[_0x4370('0x21')]=function(_0x243252,_0xd4b0b6){if(_0x243252[_0x4370('0x45')]['id']){delete _0x243252['body']['id'];}return db['SmsTransferReport'][_0x4370('0x43')]({'where':{'id':_0x243252[_0x4370('0x46')]['id']}})[_0x4370('0x22')](handleEntityNotFound(_0xd4b0b6,null))[_0x4370('0x22')](saveUpdates(_0x243252[_0x4370('0x45')],null))['then'](respondWithResult(_0xd4b0b6,null))[_0x4370('0x40')](handleError(_0xd4b0b6,null));};exports['destroy']=function(_0xe667c7,_0x2acecd){return db[_0x4370('0x28')][_0x4370('0x43')]({'where':{'id':_0xe667c7['params']['id']}})[_0x4370('0x22')](handleEntityNotFound(_0x2acecd,null))[_0x4370('0x22')](removeEntity(_0x2acecd,null))[_0x4370('0x40')](handleError(_0x2acecd,null));};exports['describe']=function(_0x3d75e1,_0x37a1d5){return db['SmsTransferReport']['describe']()[_0x4370('0x22')](respondWithResult(_0x37a1d5,null))[_0x4370('0x40')](handleError(_0x37a1d5,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index dc0256a..6038bfd 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 _0xda19=['request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','moment'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xda19,0xd5));var _0x9da1=function(_0x334829,_0x3dd523){_0x334829=_0x334829-0x0;var _0x37d036=_0xda19[_0x334829];return _0x37d036;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2a07=['moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x5b0a0c,_0x587d12){var _0x3350f=function(_0x5f042a){while(--_0x5f042a){_0x5b0a0c['push'](_0x5b0a0c['shift']());}};_0x3350f(++_0x587d12);}(_0x2a07,0x74));var _0x72a0=function(_0x3074f3,_0x4f2c03){_0x3074f3=_0x3074f3-0x0;var _0x53f112=_0x2a07[_0x3074f3];return _0x53f112;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index a240775..445be63 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 _0x81ea=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x81ea,0x151));var _0xa81e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x81ea[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa81e('0x0'));var util=require(_0xa81e('0x1'));var moment=require(_0xa81e('0x2'));var BPromise=require(_0xa81e('0x3'));var rs=require(_0xa81e('0x4'));var fs=require('fs');var Redis=require(_0xa81e('0x5'));var db=require(_0xa81e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa81e('0x7'))(_0xa81e('0x8'));var config=require(_0xa81e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa81e('0xa')][_0xa81e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45934f,_0x3d19d4,_0x1b4084){return new BPromise(function(_0x23efc1,_0x4a08dd){return client[_0xa81e('0xc')](_0x45934f,_0x1b4084)[_0xa81e('0xd')](function(_0x3cd72e){logger[_0xa81e('0xe')](_0xa81e('0xf'),_0x3d19d4,_0xa81e('0x10'));logger[_0xa81e('0x11')](_0xa81e('0x12'),_0x3d19d4,_0xa81e('0x10'),JSON[_0xa81e('0x13')](_0x3cd72e));if(_0x3cd72e['error']){if(_0x3cd72e[_0xa81e('0x14')][_0xa81e('0x15')]===0x1f4){logger[_0xa81e('0x14')](_0xa81e('0xf'),_0x3d19d4,_0x3cd72e['error'][_0xa81e('0x16')]);return _0x4a08dd(_0x3cd72e[_0xa81e('0x14')][_0xa81e('0x16')]);}logger[_0xa81e('0x14')](_0xa81e('0xf'),_0x3d19d4,_0x3cd72e['error'][_0xa81e('0x16')]);return _0x23efc1(_0x3cd72e[_0xa81e('0x14')]['message']);}else{logger[_0xa81e('0xe')](_0xa81e('0xf'),_0x3d19d4,'request\x20sent');_0x23efc1(_0x3cd72e[_0xa81e('0x17')][_0xa81e('0x16')]);}})[_0xa81e('0x18')](function(_0x2a3786){logger[_0xa81e('0x14')](_0xa81e('0xf'),_0x3d19d4,_0x2a3786);_0x4a08dd(_0x2a3786);});});} \ No newline at end of file +var _0x369d=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x58f245,_0x3e4f31){var _0x1f0cfb=function(_0x515942){while(--_0x515942){_0x58f245['push'](_0x58f245['shift']());}};_0x1f0cfb(++_0x3e4f31);}(_0x369d,0x1e5));var _0xd369=function(_0x56e6e0,_0x3d34e7){_0x56e6e0=_0x56e6e0-0x0;var _0x1cf8a6=_0x369d[_0x56e6e0];return _0x1cf8a6;};'use strict';var _=require(_0xd369('0x0'));var util=require(_0xd369('0x1'));var moment=require(_0xd369('0x2'));var BPromise=require(_0xd369('0x3'));var rs=require(_0xd369('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd369('0x5'))['db'];var utils=require(_0xd369('0x6'));var logger=require(_0xd369('0x7'))(_0xd369('0x8'));var config=require('../../config/environment');var jayson=require(_0xd369('0x9'));var client=jayson[_0xd369('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x193d18,_0x1701ef,_0x405d56){return new BPromise(function(_0x28c563,_0x3a94bd){return client[_0xd369('0xb')](_0x193d18,_0x405d56)[_0xd369('0xc')](function(_0x5edc9d){logger[_0xd369('0xd')](_0xd369('0xe'),_0x1701ef,_0xd369('0xf'));logger[_0xd369('0x10')](_0xd369('0x11'),_0x1701ef,_0xd369('0xf'),JSON[_0xd369('0x12')](_0x5edc9d));if(_0x5edc9d['error']){if(_0x5edc9d[_0xd369('0x13')][_0xd369('0x14')]===0x1f4){logger[_0xd369('0x13')](_0xd369('0xe'),_0x1701ef,_0x5edc9d[_0xd369('0x13')][_0xd369('0x15')]);return _0x3a94bd(_0x5edc9d[_0xd369('0x13')][_0xd369('0x15')]);}logger[_0xd369('0x13')](_0xd369('0xe'),_0x1701ef,_0x5edc9d['error'][_0xd369('0x15')]);return _0x28c563(_0x5edc9d['error']['message']);}else{logger['info'](_0xd369('0xe'),_0x1701ef,_0xd369('0xf'));_0x28c563(_0x5edc9d[_0xd369('0x16')]['message']);}})[_0xd369('0x17')](function(_0x43ff05){logger[_0xd369('0x13')](_0xd369('0xe'),_0x1701ef,_0x43ff05);_0x3a94bd(_0x43ff05);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1ad2e5c..7728e56 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 _0x6fbc=['path','connect-timeout','express','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/download','download','join','root','originalname','replace','format','basename','extname','now','single','file','put','update','delete','exports','multer'];(function(_0x482523,_0x4bd47c){var _0x4d321b=function(_0x3d6b56){while(--_0x3d6b56){_0x482523['push'](_0x482523['shift']());}};_0x4d321b(++_0x4bd47c);}(_0x6fbc,0x1b9));var _0xc6fb=function(_0x1cf9b5,_0x54bd73){_0x1cf9b5=_0x1cf9b5-0x0;var _0xaeef06=_0x6fbc[_0x1cf9b5];return _0xaeef06;};'use strict';var multer=require(_0xc6fb('0x0'));var util=require('util');var path=require(_0xc6fb('0x1'));var timeout=require(_0xc6fb('0x2'));var express=require(_0xc6fb('0x3'));var router=express['Router']();var auth=require(_0xc6fb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0xc6fb('0x5')](),controller[_0xc6fb('0x6')]);router[_0xc6fb('0x7')](_0xc6fb('0x8'),auth[_0xc6fb('0x5')](),controller[_0xc6fb('0x9')]);router[_0xc6fb('0x7')](_0xc6fb('0xa'),auth[_0xc6fb('0x5')](),controller[_0xc6fb('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e3391,_0x553b0c,_0x1e0ab0){_0x1e0ab0(null,path[_0xc6fb('0xc')](config[_0xc6fb('0xd')],'server/files/sounds/original/'));},'filename':function(_0x2289fb,_0x56726c,_0x3910eb){_0x56726c[_0xc6fb('0xe')]=_0x56726c[_0xc6fb('0xe')][_0xc6fb('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3910eb(null,util[_0xc6fb('0x10')]('%s-%s%s',path[_0xc6fb('0x11')](_0x56726c['originalname'],path[_0xc6fb('0x12')](_0x56726c[_0xc6fb('0xe')])),Date[_0xc6fb('0x13')](),path[_0xc6fb('0x12')](_0x56726c[_0xc6fb('0xe')])));}})});router['post']('/',upload[_0xc6fb('0x14')](_0xc6fb('0x15')),controller['create']);router[_0xc6fb('0x16')](_0xc6fb('0x8'),auth[_0xc6fb('0x5')](),controller[_0xc6fb('0x17')]);router[_0xc6fb('0x18')](_0xc6fb('0x8'),auth['isAuthenticated'](),controller[_0xc6fb('0x18')]);module[_0xc6fb('0x19')]=router; \ No newline at end of file +var _0xfb5b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','show','/:id/download','download','root','server/files/sounds/original/','originalname','replace','format','extname','now','file','put','/:id','update','delete','exports'];(function(_0x5939da,_0x2a96c7){var _0x41cfb4=function(_0x3c6278){while(--_0x3c6278){_0x5939da['push'](_0x5939da['shift']());}};_0x41cfb4(++_0x2a96c7);}(_0xfb5b,0x129));var _0xbfb5=function(_0x28df65,_0x3ec4a8){_0x28df65=_0x28df65-0x0;var _0x14c567=_0xfb5b[_0x28df65];return _0x14c567;};'use strict';var multer=require(_0xbfb5('0x0'));var util=require(_0xbfb5('0x1'));var path=require(_0xbfb5('0x2'));var timeout=require(_0xbfb5('0x3'));var express=require(_0xbfb5('0x4'));var router=express[_0xbfb5('0x5')]();var auth=require(_0xbfb5('0x6'));var interaction=require(_0xbfb5('0x7'));var config=require(_0xbfb5('0x8'));var controller=require(_0xbfb5('0x9'));router['get']('/',auth[_0xbfb5('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbfb5('0xb')]);router['get'](_0xbfb5('0xc'),auth[_0xbfb5('0xa')](),controller[_0xbfb5('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6fb822,_0xeb6036,_0x3c7695){_0x3c7695(null,path['join'](config[_0xbfb5('0xe')],_0xbfb5('0xf')));},'filename':function(_0x5bb2a2,_0x194012,_0x1d0e6e){_0x194012[_0xbfb5('0x10')]=_0x194012[_0xbfb5('0x10')][_0xbfb5('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d0e6e(null,util[_0xbfb5('0x12')]('%s-%s%s',path['basename'](_0x194012[_0xbfb5('0x10')],path[_0xbfb5('0x13')](_0x194012[_0xbfb5('0x10')])),Date[_0xbfb5('0x14')](),path['extname'](_0x194012['originalname'])));}})});router['post']('/',upload['single'](_0xbfb5('0x15')),controller['create']);router[_0xbfb5('0x16')](_0xbfb5('0x17'),auth['isAuthenticated'](),controller[_0xbfb5('0x18')]);router[_0xbfb5('0x19')](_0xbfb5('0x17'),auth[_0xbfb5('0xa')](),controller[_0xbfb5('0x19')]);module[_0xbfb5('0x1a')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index f1943a7..5e3b18c 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 _0x2aff=['exports','STRING','name','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x248ad2,_0x4a2cdb){var _0x56983a=function(_0x4e5eed){while(--_0x4e5eed){_0x248ad2['push'](_0x248ad2['shift']());}};_0x56983a(++_0x4a2cdb);}(_0x2aff,0x1bf));var _0xf2af=function(_0x3fb63c,_0x37bb5b){_0x3fb63c=_0x3fb63c-0x0;var _0x1aa895=_0x2aff[_0x3fb63c];return _0x1aa895;};'use strict';var Sequelize=require(_0xf2af('0x0'));module[_0xf2af('0x1')]={'name':{'type':Sequelize[_0xf2af('0x2')],'unique':_0xf2af('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf2af('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xf2af('0x2')]},'original_format':{'type':Sequelize[_0xf2af('0x2')]},'original_duration':{'type':Sequelize[_0xf2af('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xf2af('0x5')]},'original_bitRate':{'type':Sequelize[_0xf2af('0x6')]},'original_sampleRate':{'type':Sequelize[_0xf2af('0x5')]},'converted_format':{'type':Sequelize[_0xf2af('0x2')]},'converted_duration':{'type':Sequelize[_0xf2af('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xf2af('0x6')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xf2af('0x6')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xe184=['sequelize','exports','name','STRING','FLOAT','BIGINT','INTEGER'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xe184,0xaf));var _0x4e18=function(_0x4896ce,_0x11a82f){_0x4896ce=_0x4896ce-0x0;var _0x1f3b62=_0xe184[_0x4896ce];return _0x1f3b62;};'use strict';var Sequelize=require(_0x4e18('0x0'));module[_0x4e18('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4e18('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x4e18('0x3')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x4e18('0x3')]},'original_format':{'type':Sequelize[_0x4e18('0x3')]},'original_duration':{'type':Sequelize[_0x4e18('0x4')]},'original_sampleCount':{'type':Sequelize[_0x4e18('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x4e18('0x5')]},'original_sampleRate':{'type':Sequelize[_0x4e18('0x6')]},'converted_format':{'type':Sequelize[_0x4e18('0x3')]},'converted_duration':{'type':Sequelize[_0x4e18('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x4e18('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x4e18('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x4e18('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index d2da3f1..d6de881 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 _0x5f4f=['save_name','Sequelize','ValidationError','%s.%s','create','basename','file','originalname','extname','substring','wav','filename','format','info','Sound\x20upload\x20filepath:\x20%s','0777','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','chmodSync','body','userProfileId','role','user','UserProfileSection','autoAssociation','start','params','delete','server/files/sounds/original','original_format','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','download','find','converted_format','join','root','server/files/sounds/converted'];(function(_0x5846a4,_0x2b86ea){var _0x498c99=function(_0x396667){while(--_0x396667){_0x5846a4['push'](_0x5846a4['shift']());}};_0x498c99(++_0x2b86ea);}(_0x5f4f,0x122));var _0xf5f4=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x5f4f[_0x3f6e26];return _0x474345;};'use strict';var pdf=require(_0xf5f4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf5f4('0x1'));var zipdir=require(_0xf5f4('0x2'));var jsonpatch=require(_0xf5f4('0x3'));var rp=require(_0xf5f4('0x4'));var moment=require(_0xf5f4('0x5'));var BPromise=require(_0xf5f4('0x6'));var Mustache=require(_0xf5f4('0x7'));var util=require(_0xf5f4('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf5f4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf5f4('0xa'));var crypto=require(_0xf5f4('0xb'));var jsforce=require(_0xf5f4('0xc'));var deskjs=require(_0xf5f4('0xd'));var toCsv=require(_0xf5f4('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f4('0xe'));var Redis=require(_0xf5f4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf5f4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f4('0x11'))('api');var utils=require(_0xf5f4('0x12'));var config=require(_0xf5f4('0x13'));var db=require(_0xf5f4('0x14'))['db'];function respondWithStatusCode(_0x5b99d0,_0x4cd5e8){_0x4cd5e8=_0x4cd5e8||0xcc;return function(_0x4a751c){if(_0x4a751c){return _0x5b99d0[_0xf5f4('0x15')](_0x4cd5e8);}return _0x5b99d0[_0xf5f4('0x16')](_0x4cd5e8)[_0xf5f4('0x17')]();};}function respondWithResult(_0x331366,_0x491d3a){_0x491d3a=_0x491d3a||0xc8;return function(_0x5a4c78){if(_0x5a4c78){return _0x331366[_0xf5f4('0x16')](_0x491d3a)['json'](_0x5a4c78);}};}function respondWithFilteredResult(_0x46674c,_0x1aa957){return function(_0x3db46e){if(_0x3db46e){var _0x4dc55c=_0x3db46e[_0xf5f4('0x18')],_0x595bc4=_0x1aa957['offset'],_0x25f936=_0x1aa957[_0xf5f4('0x19')]+_0x1aa957[_0xf5f4('0x1a')],_0x18e996;if(_0x25f936>=_0x4dc55c){_0x25f936=_0x4dc55c;_0x18e996=0xc8;}else{_0x18e996=0xce;}_0x46674c[_0xf5f4('0x16')](_0x18e996);return _0x46674c[_0xf5f4('0x1b')](_0xf5f4('0x1c'),_0x595bc4+'-'+_0x25f936+'/'+_0x4dc55c)[_0xf5f4('0x1d')](_0x3db46e);}return null;};}function patchUpdates(_0x1c0ece){return function(_0x34782c){try{jsonpatch[_0xf5f4('0x1e')](_0x34782c,_0x1c0ece,!![]);}catch(_0x59b499){return BPromise[_0xf5f4('0x1f')](_0x59b499);}return _0x34782c[_0xf5f4('0x20')]();};}function saveUpdates(_0x2d4727,_0x16aa6a){return function(_0x6ca053){if(_0x6ca053){return _0x6ca053[_0xf5f4('0x21')](_0x2d4727)['then'](function(_0x2555f7){return _0x2555f7;});}return null;};}function removeEntity(_0x16d497,_0xa2c414){return function(_0x5ca8e3){if(_0x5ca8e3){return _0x5ca8e3[_0xf5f4('0x22')]()[_0xf5f4('0x23')](function(){var _0x5f30fc=_0x5ca8e3[_0xf5f4('0x24')]({'plain':!![]});var _0x2f1592=_0xf5f4('0x25');return db[_0xf5f4('0x26')][_0xf5f4('0x22')]({'where':{'type':_0x2f1592,'resourceId':_0x5f30fc['id']}})['then'](function(){return _0x5ca8e3;});})[_0xf5f4('0x23')](function(){_0x16d497[_0xf5f4('0x16')](0xcc)[_0xf5f4('0x17')]();});}};}function handleEntityNotFound(_0x49aa3d,_0x3eea48){return function(_0x549f75){if(!_0x549f75){_0x49aa3d[_0xf5f4('0x15')](0x194);}return _0x549f75;};}function handleError(_0x77efd,_0x5e109f){_0x5e109f=_0x5e109f||0x1f4;return function(_0x3f8c15){logger[_0xf5f4('0x27')](_0x3f8c15[_0xf5f4('0x28')]);if(_0x3f8c15[_0xf5f4('0x29')]){delete _0x3f8c15[_0xf5f4('0x29')];}_0x77efd[_0xf5f4('0x16')](_0x5e109f)[_0xf5f4('0x2a')](_0x3f8c15);};}exports[_0xf5f4('0x2b')]=function(_0x5629d2,_0x31c538){var _0x98f54={},_0x413602={},_0x1165c5={'count':0x0,'rows':[]};var _0x2ff152=_[_0xf5f4('0x2c')](db[_0xf5f4('0x2d')]['rawAttributes'],function(_0x557ccc){return{'name':_0x557ccc[_0xf5f4('0x2e')],'type':_0x557ccc[_0xf5f4('0x2f')][_0xf5f4('0x30')]};});_0x413602[_0xf5f4('0x31')]=_[_0xf5f4('0x2c')](_0x2ff152,_0xf5f4('0x29'));_0x413602[_0xf5f4('0x32')]=_[_0xf5f4('0x33')](_0x5629d2[_0xf5f4('0x32')]);_0x413602[_0xf5f4('0x34')]=_[_0xf5f4('0x35')](_0x413602[_0xf5f4('0x31')],_0x413602[_0xf5f4('0x32')]);_0x98f54[_0xf5f4('0x36')]=_[_0xf5f4('0x35')](_0x413602[_0xf5f4('0x31')],qs['fields'](_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x37')]));_0x98f54[_0xf5f4('0x36')]=_0x98f54[_0xf5f4('0x36')][_0xf5f4('0x38')]?_0x98f54[_0xf5f4('0x36')]:_0x413602[_0xf5f4('0x31')];if(!_0x5629d2[_0xf5f4('0x32')]['hasOwnProperty'](_0xf5f4('0x39'))){_0x98f54['limit']=qs[_0xf5f4('0x1a')](_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x1a')]);_0x98f54[_0xf5f4('0x19')]=qs[_0xf5f4('0x19')](_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x19')]);}_0x98f54[_0xf5f4('0x3a')]=qs['sort'](_0x5629d2[_0xf5f4('0x32')]['sort']);_0x98f54['where']=qs['filters'](_[_0xf5f4('0x3b')](_0x5629d2['query'],_0x413602['filters']));if(_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x3c')]){_0x98f54[_0xf5f4('0x3d')]=_[_0xf5f4('0x3e')](_0x98f54[_0xf5f4('0x3d')],{'$or':_[_0xf5f4('0x2c')](_0x2ff152,function(_0x4806c3){if(_0x4806c3[_0xf5f4('0x2f')]!==_0xf5f4('0x3f')){var _0x277eb7={};_0x277eb7[_0x4806c3[_0xf5f4('0x29')]]={'$like':'%'+_0x5629d2['query']['filter']+'%'};return _0x277eb7;}})});}_0x98f54=_[_0xf5f4('0x3e')]({},_0x98f54,_0x5629d2[_0xf5f4('0x40')]);var _0x50a096={'where':_0x98f54[_0xf5f4('0x3d')]};return db[_0xf5f4('0x2d')][_0xf5f4('0x18')](_0x50a096)[_0xf5f4('0x23')](function(_0x2c1e7f){_0x1165c5[_0xf5f4('0x18')]=_0x2c1e7f;if(_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x41')]){_0x98f54[_0xf5f4('0x42')]=[{'all':!![]}];}return db[_0xf5f4('0x2d')][_0xf5f4('0x43')](_0x98f54);})['then'](function(_0x14a566){_0x1165c5['rows']=_0x14a566;return _0x1165c5;})[_0xf5f4('0x23')](respondWithFilteredResult(_0x31c538,_0x98f54))[_0xf5f4('0x44')](handleError(_0x31c538,null));};exports['show']=function(_0x36b3f2,_0x2a2ac3){var _0x2aa7ee={'raw':!![],'where':{'id':_0x36b3f2['params']['id']}},_0x22650c={};_0x22650c[_0xf5f4('0x31')]=_[_0xf5f4('0x33')](db['Sound'][_0xf5f4('0x45')]);_0x22650c[_0xf5f4('0x32')]=_['keys'](_0x36b3f2[_0xf5f4('0x32')]);_0x22650c[_0xf5f4('0x34')]=_[_0xf5f4('0x35')](_0x22650c['model'],_0x22650c[_0xf5f4('0x32')]);_0x2aa7ee['attributes']=_[_0xf5f4('0x35')](_0x22650c[_0xf5f4('0x31')],qs['fields'](_0x36b3f2['query']['fields']));_0x2aa7ee[_0xf5f4('0x36')]=_0x2aa7ee[_0xf5f4('0x36')][_0xf5f4('0x38')]?_0x2aa7ee[_0xf5f4('0x36')]:_0x22650c[_0xf5f4('0x31')];if(_0x36b3f2[_0xf5f4('0x32')]['includeAll']){_0x2aa7ee[_0xf5f4('0x42')]=[{'all':!![]}];}_0x2aa7ee=_[_0xf5f4('0x3e')]({},_0x2aa7ee,_0x36b3f2[_0xf5f4('0x40')]);return db[_0xf5f4('0x2d')]['find'](_0x2aa7ee)[_0xf5f4('0x23')](handleEntityNotFound(_0x2a2ac3,null))[_0xf5f4('0x23')](respondWithResult(_0x2a2ac3,null))['catch'](handleError(_0x2a2ac3,null));};exports[_0xf5f4('0x46')]=function(_0x34d540,_0x23ce09,_0x4bc074){return db[_0xf5f4('0x2d')][_0xf5f4('0x47')]({'where':{'id':_0x34d540['params']['id']},'attributes':['name','save_name',_0xf5f4('0x48')],'raw':!![]})[_0xf5f4('0x23')](handleEntityNotFound(_0x23ce09,null))['then'](function(_0x1f98d7){if(_0x1f98d7){if(!fs['existsSync'](path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],_0xf5f4('0x4b'),_0x1f98d7[_0xf5f4('0x4c')]+'.'+_0x1f98d7[_0xf5f4('0x48')]))){throw new db[(_0xf5f4('0x4d'))][(_0xf5f4('0x4e'))]('Sound\x20not\x20found');}return _0x23ce09[_0xf5f4('0x46')](path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],_0xf5f4('0x4b'),util['format'](_0xf5f4('0x4f'),_0x1f98d7[_0xf5f4('0x4c')],_0x1f98d7['converted_format'])),util['format'](_0xf5f4('0x4f'),_0x1f98d7[_0xf5f4('0x29')],_0x1f98d7[_0xf5f4('0x48')]));}return null;})[_0xf5f4('0x44')](handleError(_0x23ce09,null));};exports[_0xf5f4('0x50')]=function(_0x1fedfe,_0x231e33,_0x2de484){var _0x498ebf={'name':path[_0xf5f4('0x51')](_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x53')],path[_0xf5f4('0x54')](_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x53')])),'save_name':path[_0xf5f4('0x51')](_0x1fedfe['file']['filename'],path[_0xf5f4('0x54')](_0x1fedfe[_0xf5f4('0x52')]['filename'])),'original_format':path[_0xf5f4('0x54')](_0x1fedfe[_0xf5f4('0x52')]['originalname'])[_0xf5f4('0x55')](0x1),'converted_format':_0xf5f4('0x56')};var _0x3f071d=path['join'](config[_0xf5f4('0x4a')],'server/files/sounds/original',_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x57')]);var _0x2edd8b=path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],'server/files/sounds/converted',util[_0xf5f4('0x58')](_0xf5f4('0x4f'),path[_0xf5f4('0x51')](_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x57')],path[_0xf5f4('0x54')](_0x1fedfe['file']['filename'])),_0x498ebf[_0xf5f4('0x48')]));logger[_0xf5f4('0x59')](_0xf5f4('0x5a'),_0x3f071d);logger[_0xf5f4('0x59')]('Sound\x20upload\x20destination:\x20%s',_0x2edd8b);try{fs['chmodSync'](_0x3f071d,parseInt(_0xf5f4('0x5b'),0x8));var _0x5044b4=sox['transcode'](_0x3f071d,_0x2edd8b,{'sampleRate':0x1f40,'format':_0xf5f4('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5044b4['on'](_0xf5f4('0x27'),function(_0xbd9eba){fs['unlinkSync'](_0x3f071d);_0x231e33['status'](0x1f4)['send'](_0xbd9eba);});_0x5044b4['on'](_0xf5f4('0x5c'),function(_0x116249){_0x498ebf[_0xf5f4('0x5d')]=isNaN(_0x116249['duration'])?null:_0x116249['duration']*0x3e8;_0x498ebf[_0xf5f4('0x5e')]=isNaN(_0x116249['sampleCount'])?null:_0x116249[_0xf5f4('0x5f')];_0x498ebf[_0xf5f4('0x60')]=isNaN(_0x116249[_0xf5f4('0x61')])?null:_0x116249[_0xf5f4('0x61')];_0x498ebf[_0xf5f4('0x62')]=isNaN(_0x116249['bitRate'])?null:_0x116249['bitRate'];_0x498ebf[_0xf5f4('0x63')]=isNaN(_0x116249['sampleRate'])?null:_0x116249[_0xf5f4('0x64')];});_0x5044b4['on'](_0xf5f4('0x65'),function(_0xacd01){_0x498ebf[_0xf5f4('0x66')]=isNaN(_0xacd01[_0xf5f4('0x67')])?null:_0xacd01[_0xf5f4('0x67')]*0x3e8;_0x498ebf[_0xf5f4('0x68')]=isNaN(_0xacd01[_0xf5f4('0x5f')])?null:_0xacd01[_0xf5f4('0x5f')];_0x498ebf[_0xf5f4('0x69')]=isNaN(_0xacd01[_0xf5f4('0x61')])?null:_0xacd01[_0xf5f4('0x61')];_0x498ebf[_0xf5f4('0x6a')]=isNaN(_0xacd01[_0xf5f4('0x6b')])?null:_0xacd01[_0xf5f4('0x6b')];_0x498ebf[_0xf5f4('0x6c')]=isNaN(_0xacd01[_0xf5f4('0x64')])?null:_0xacd01[_0xf5f4('0x64')];});_0x5044b4['on'](_0xf5f4('0x17'),function(){fs[_0xf5f4('0x6d')](_0x2edd8b,parseInt('0777',0x8));return db[_0xf5f4('0x2d')][_0xf5f4('0x50')](_0x498ebf)[_0xf5f4('0x23')](function(_0x3dc1a2){var _0x8ba1dd={'role':_0x1fedfe[_0xf5f4('0x6e')]['role'],'userProfileId':_0x1fedfe['body'][_0xf5f4('0x6f')]};if(!_0x8ba1dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8ba1dd[_0xf5f4('0x70')]===_0xf5f4('0x71')){var _0x28d87e=_0x3dc1a2[_0xf5f4('0x24')]({'plain':!![]});return db[_0xf5f4('0x72')][_0xf5f4('0x47')]({'where':{'name':_0xf5f4('0x25'),'userProfileId':_0x8ba1dd[_0xf5f4('0x6f')]},'raw':!![]})[_0xf5f4('0x23')](function(_0x96f6c1){if(_0x96f6c1&&_0x96f6c1[_0xf5f4('0x73')]===0x0){return db['UserProfileResource'][_0xf5f4('0x50')]({'name':_0x28d87e[_0xf5f4('0x29')],'resourceId':_0x28d87e['id'],'type':_0x96f6c1['name'],'sectionId':_0x96f6c1['id']},{})[_0xf5f4('0x23')](function(){return _0x3dc1a2;});}else{return _0x3dc1a2;}})[_0xf5f4('0x44')](function(_0x1f0c84){logger[_0xf5f4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f0c84);throw _0x1f0c84;});}return _0x3dc1a2;})[_0xf5f4('0x23')](respondWithResult(_0x231e33,null))[_0xf5f4('0x44')](handleError(_0x231e33,null));});_0x5044b4[_0xf5f4('0x74')]();}catch(_0x51e745){_0x231e33[_0xf5f4('0x16')](0x1f4)[_0xf5f4('0x2a')](_0x51e745);}};exports[_0xf5f4('0x21')]=function(_0x49a963,_0x16cc76,_0x36cd32){return db[_0xf5f4('0x2d')][_0xf5f4('0x47')]({'where':{'id':_0x49a963[_0xf5f4('0x75')]['id']}})[_0xf5f4('0x23')](handleEntityNotFound(_0x16cc76,null))['then'](saveUpdates(_[_0xf5f4('0x3b')](_0x49a963[_0xf5f4('0x6e')],['name','description']),null))[_0xf5f4('0x23')](respondWithResult(_0x16cc76,null))['catch'](handleError(_0x16cc76,null));};exports[_0xf5f4('0x76')]=function(_0x5c6356,_0x282ee3,_0x188336){return db['Sound'][_0xf5f4('0x47')]({'where':{'id':_0x5c6356[_0xf5f4('0x75')]['id']}})['then'](function(_0x79e564){if(_0x79e564){return _0x79e564[_0xf5f4('0x22')]();}})[_0xf5f4('0x23')](function(_0x52c8ed){var _0x3bedb1=path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],_0xf5f4('0x77'),util['format'](_0xf5f4('0x4f'),_0x52c8ed[_0xf5f4('0x4c')],_0x52c8ed[_0xf5f4('0x78')]));var _0x45d3d7=path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],'server/files/sounds/converted',util[_0xf5f4('0x58')](_0xf5f4('0x4f'),_0x52c8ed[_0xf5f4('0x4c')],_0x52c8ed['converted_format']));fs[_0xf5f4('0x79')](_0x3bedb1);fs[_0xf5f4('0x79')](_0x45d3d7);return _0x52c8ed;})[_0xf5f4('0x23')](function(_0x5f5ba2){if(_0x5f5ba2){return _0x282ee3[_0xf5f4('0x16')](0xcc)[_0xf5f4('0x17')]();}})['then'](handleEntityNotFound(_0x282ee3,null))[_0xf5f4('0x44')](handleError(_0x282ee3,null));}; \ No newline at end of file +var _0xdbf0=['sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','then','get','Sounds','destroy','error','name','send','index','fieldName','model','keys','query','filters','intersection','attributes','fields','length','order','pick','filter','where','merge','map','type','VIRTUAL','options','Sound','includeAll','include','findAll','rows','catch','show','params','find','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','unlinkSync','src','original_duration','duration','original_sampleCount'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0xdbf0,0x17f));var _0x0dbf=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xdbf0[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require(_0x0dbf('0x0'));var emlformat=require(_0x0dbf('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0dbf('0x2'));var jsonpatch=require(_0x0dbf('0x3'));var rp=require(_0x0dbf('0x4'));var moment=require(_0x0dbf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0dbf('0x6'));var util=require(_0x0dbf('0x7'));var path=require(_0x0dbf('0x8'));var sox=require('sox');var csv=require(_0x0dbf('0x9'));var ejs=require(_0x0dbf('0xa'));var fs=require('fs');var _=require(_0x0dbf('0xb'));var squel=require(_0x0dbf('0xc'));var crypto=require(_0x0dbf('0xd'));var jsforce=require(_0x0dbf('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0dbf('0x9'));var querystring=require(_0x0dbf('0xf'));var Papa=require(_0x0dbf('0x10'));var Redis=require(_0x0dbf('0x11'));var authService=require(_0x0dbf('0x12'));var qs=require(_0x0dbf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0dbf('0x14'));var logger=require(_0x0dbf('0x15'))(_0x0dbf('0x16'));var utils=require(_0x0dbf('0x17'));var config=require(_0x0dbf('0x18'));var db=require(_0x0dbf('0x19'))['db'];function respondWithStatusCode(_0x546945,_0xb53a90){_0xb53a90=_0xb53a90||0xcc;return function(_0x2542da){if(_0x2542da){return _0x546945[_0x0dbf('0x1a')](_0xb53a90);}return _0x546945[_0x0dbf('0x1b')](_0xb53a90)[_0x0dbf('0x1c')]();};}function respondWithResult(_0x966439,_0x46a659){_0x46a659=_0x46a659||0xc8;return function(_0xe58c78){if(_0xe58c78){return _0x966439[_0x0dbf('0x1b')](_0x46a659)[_0x0dbf('0x1d')](_0xe58c78);}};}function respondWithFilteredResult(_0x347d1d,_0x2e76ac){return function(_0x327277){if(_0x327277){var _0x395e31=_0x327277[_0x0dbf('0x1e')],_0x4e4541=_0x2e76ac[_0x0dbf('0x1f')],_0x496b0d=_0x2e76ac[_0x0dbf('0x1f')]+_0x2e76ac[_0x0dbf('0x20')],_0x31a961;if(_0x496b0d>=_0x395e31){_0x496b0d=_0x395e31;_0x31a961=0xc8;}else{_0x31a961=0xce;}_0x347d1d[_0x0dbf('0x1b')](_0x31a961);return _0x347d1d['set'](_0x0dbf('0x21'),_0x4e4541+'-'+_0x496b0d+'/'+_0x395e31)[_0x0dbf('0x1d')](_0x327277);}return null;};}function patchUpdates(_0x5161ca){return function(_0x4160fb){try{jsonpatch[_0x0dbf('0x22')](_0x4160fb,_0x5161ca,!![]);}catch(_0x582872){return BPromise['reject'](_0x582872);}return _0x4160fb[_0x0dbf('0x23')]();};}function saveUpdates(_0x229d4d,_0x4de1e4){return function(_0x152d2d){if(_0x152d2d){return _0x152d2d['update'](_0x229d4d)[_0x0dbf('0x24')](function(_0x2b7260){return _0x2b7260;});}return null;};}function removeEntity(_0x1ff76c,_0x1fba13){return function(_0x59ea33){if(_0x59ea33){return _0x59ea33['destroy']()[_0x0dbf('0x24')](function(){var _0xc10e97=_0x59ea33[_0x0dbf('0x25')]({'plain':!![]});var _0x4b296e=_0x0dbf('0x26');return db['UserProfileResource'][_0x0dbf('0x27')]({'where':{'type':_0x4b296e,'resourceId':_0xc10e97['id']}})[_0x0dbf('0x24')](function(){return _0x59ea33;});})[_0x0dbf('0x24')](function(){_0x1ff76c[_0x0dbf('0x1b')](0xcc)[_0x0dbf('0x1c')]();});}};}function handleEntityNotFound(_0x6e4c64,_0x4fb4d0){return function(_0x2b3ec4){if(!_0x2b3ec4){_0x6e4c64[_0x0dbf('0x1a')](0x194);}return _0x2b3ec4;};}function handleError(_0x41cdbc,_0x55c536){_0x55c536=_0x55c536||0x1f4;return function(_0x4fabfc){logger[_0x0dbf('0x28')](_0x4fabfc['stack']);if(_0x4fabfc[_0x0dbf('0x29')]){delete _0x4fabfc[_0x0dbf('0x29')];}_0x41cdbc[_0x0dbf('0x1b')](_0x55c536)[_0x0dbf('0x2a')](_0x4fabfc);};}exports[_0x0dbf('0x2b')]=function(_0x4dd775,_0xb5af4b){var _0x1d914a={},_0x2311d6={},_0x2a59bd={'count':0x0,'rows':[]};var _0x2f3121=_['map'](db['Sound']['rawAttributes'],function(_0x21eb17){return{'name':_0x21eb17[_0x0dbf('0x2c')],'type':_0x21eb17['type']['key']};});_0x2311d6[_0x0dbf('0x2d')]=_['map'](_0x2f3121,_0x0dbf('0x29'));_0x2311d6['query']=_[_0x0dbf('0x2e')](_0x4dd775[_0x0dbf('0x2f')]);_0x2311d6[_0x0dbf('0x30')]=_[_0x0dbf('0x31')](_0x2311d6[_0x0dbf('0x2d')],_0x2311d6['query']);_0x1d914a[_0x0dbf('0x32')]=_['intersection'](_0x2311d6[_0x0dbf('0x2d')],qs[_0x0dbf('0x33')](_0x4dd775[_0x0dbf('0x2f')]['fields']));_0x1d914a[_0x0dbf('0x32')]=_0x1d914a['attributes'][_0x0dbf('0x34')]?_0x1d914a[_0x0dbf('0x32')]:_0x2311d6[_0x0dbf('0x2d')];if(!_0x4dd775[_0x0dbf('0x2f')]['hasOwnProperty']('nolimit')){_0x1d914a[_0x0dbf('0x20')]=qs['limit'](_0x4dd775['query'][_0x0dbf('0x20')]);_0x1d914a[_0x0dbf('0x1f')]=qs[_0x0dbf('0x1f')](_0x4dd775[_0x0dbf('0x2f')]['offset']);}_0x1d914a[_0x0dbf('0x35')]=qs['sort'](_0x4dd775[_0x0dbf('0x2f')]['sort']);_0x1d914a['where']=qs['filters'](_[_0x0dbf('0x36')](_0x4dd775[_0x0dbf('0x2f')],_0x2311d6[_0x0dbf('0x30')]));if(_0x4dd775['query'][_0x0dbf('0x37')]){_0x1d914a[_0x0dbf('0x38')]=_[_0x0dbf('0x39')](_0x1d914a[_0x0dbf('0x38')],{'$or':_[_0x0dbf('0x3a')](_0x2f3121,function(_0x1525ad){if(_0x1525ad[_0x0dbf('0x3b')]!==_0x0dbf('0x3c')){var _0x372fb0={};_0x372fb0[_0x1525ad['name']]={'$like':'%'+_0x4dd775[_0x0dbf('0x2f')][_0x0dbf('0x37')]+'%'};return _0x372fb0;}})});}_0x1d914a=_[_0x0dbf('0x39')]({},_0x1d914a,_0x4dd775[_0x0dbf('0x3d')]);var _0x2c08ca={'where':_0x1d914a['where']};return db[_0x0dbf('0x3e')]['count'](_0x2c08ca)[_0x0dbf('0x24')](function(_0x58e2e7){_0x2a59bd[_0x0dbf('0x1e')]=_0x58e2e7;if(_0x4dd775[_0x0dbf('0x2f')][_0x0dbf('0x3f')]){_0x1d914a[_0x0dbf('0x40')]=[{'all':!![]}];}return db[_0x0dbf('0x3e')][_0x0dbf('0x41')](_0x1d914a);})[_0x0dbf('0x24')](function(_0x18237c){_0x2a59bd[_0x0dbf('0x42')]=_0x18237c;return _0x2a59bd;})['then'](respondWithFilteredResult(_0xb5af4b,_0x1d914a))[_0x0dbf('0x43')](handleError(_0xb5af4b,null));};exports[_0x0dbf('0x44')]=function(_0x31d560,_0x1d56a1){var _0x2207ef={'raw':!![],'where':{'id':_0x31d560[_0x0dbf('0x45')]['id']}},_0x44bd3a={};_0x44bd3a[_0x0dbf('0x2d')]=_[_0x0dbf('0x2e')](db['Sound']['rawAttributes']);_0x44bd3a[_0x0dbf('0x2f')]=_[_0x0dbf('0x2e')](_0x31d560[_0x0dbf('0x2f')]);_0x44bd3a['filters']=_[_0x0dbf('0x31')](_0x44bd3a[_0x0dbf('0x2d')],_0x44bd3a[_0x0dbf('0x2f')]);_0x2207ef[_0x0dbf('0x32')]=_[_0x0dbf('0x31')](_0x44bd3a['model'],qs[_0x0dbf('0x33')](_0x31d560[_0x0dbf('0x2f')][_0x0dbf('0x33')]));_0x2207ef['attributes']=_0x2207ef[_0x0dbf('0x32')][_0x0dbf('0x34')]?_0x2207ef[_0x0dbf('0x32')]:_0x44bd3a[_0x0dbf('0x2d')];if(_0x31d560[_0x0dbf('0x2f')][_0x0dbf('0x3f')]){_0x2207ef[_0x0dbf('0x40')]=[{'all':!![]}];}_0x2207ef=_['merge']({},_0x2207ef,_0x31d560[_0x0dbf('0x3d')]);return db['Sound'][_0x0dbf('0x46')](_0x2207ef)[_0x0dbf('0x24')](handleEntityNotFound(_0x1d56a1,null))[_0x0dbf('0x24')](respondWithResult(_0x1d56a1,null))['catch'](handleError(_0x1d56a1,null));};exports[_0x0dbf('0x47')]=function(_0x1cf8a9,_0x3b9c22,_0x73ce4){return db[_0x0dbf('0x3e')][_0x0dbf('0x46')]({'where':{'id':_0x1cf8a9['params']['id']},'attributes':[_0x0dbf('0x29'),_0x0dbf('0x48'),_0x0dbf('0x49')],'raw':!![]})[_0x0dbf('0x24')](handleEntityNotFound(_0x3b9c22,null))['then'](function(_0x55ecc2){if(_0x55ecc2){if(!fs[_0x0dbf('0x4a')](path[_0x0dbf('0x4b')](config[_0x0dbf('0x4c')],'server/files/sounds/converted',_0x55ecc2['save_name']+'.'+_0x55ecc2[_0x0dbf('0x49')]))){throw new db[(_0x0dbf('0x4d'))][(_0x0dbf('0x4e'))](_0x0dbf('0x4f'));}return _0x3b9c22[_0x0dbf('0x47')](path[_0x0dbf('0x4b')](config[_0x0dbf('0x4c')],_0x0dbf('0x50'),util[_0x0dbf('0x51')](_0x0dbf('0x52'),_0x55ecc2['save_name'],_0x55ecc2[_0x0dbf('0x49')])),util['format']('%s.%s',_0x55ecc2[_0x0dbf('0x29')],_0x55ecc2[_0x0dbf('0x49')]));}return null;})[_0x0dbf('0x43')](handleError(_0x3b9c22,null));};exports[_0x0dbf('0x53')]=function(_0x398779,_0x561e44,_0x5483b9){var _0x3f33e1={'name':path[_0x0dbf('0x54')](_0x398779[_0x0dbf('0x55')][_0x0dbf('0x56')],path['extname'](_0x398779[_0x0dbf('0x55')]['originalname'])),'save_name':path['basename'](_0x398779[_0x0dbf('0x55')]['filename'],path[_0x0dbf('0x57')](_0x398779[_0x0dbf('0x55')][_0x0dbf('0x58')])),'original_format':path[_0x0dbf('0x57')](_0x398779[_0x0dbf('0x55')]['originalname'])[_0x0dbf('0x59')](0x1),'converted_format':_0x0dbf('0x5a')};var _0x2e25b5=path['join'](config[_0x0dbf('0x4c')],_0x0dbf('0x5b'),_0x398779[_0x0dbf('0x55')][_0x0dbf('0x58')]);var _0x3e341d=path['join'](config[_0x0dbf('0x4c')],_0x0dbf('0x50'),util[_0x0dbf('0x51')](_0x0dbf('0x52'),path[_0x0dbf('0x54')](_0x398779[_0x0dbf('0x55')]['filename'],path['extname'](_0x398779[_0x0dbf('0x55')][_0x0dbf('0x58')])),_0x3f33e1[_0x0dbf('0x49')]));logger[_0x0dbf('0x5c')](_0x0dbf('0x5d'),_0x2e25b5);logger[_0x0dbf('0x5c')](_0x0dbf('0x5e'),_0x3e341d);try{fs['chmodSync'](_0x2e25b5,parseInt(_0x0dbf('0x5f'),0x8));var _0x5d0800=sox['transcode'](_0x2e25b5,_0x3e341d,{'sampleRate':0x1f40,'format':_0x0dbf('0x5a'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5d0800['on']('error',function(_0x135f79){fs[_0x0dbf('0x60')](_0x2e25b5);_0x561e44[_0x0dbf('0x1b')](0x1f4)['send'](_0x135f79);});_0x5d0800['on'](_0x0dbf('0x61'),function(_0x53dfd3){_0x3f33e1[_0x0dbf('0x62')]=isNaN(_0x53dfd3[_0x0dbf('0x63')])?null:_0x53dfd3[_0x0dbf('0x63')]*0x3e8;_0x3f33e1[_0x0dbf('0x64')]=isNaN(_0x53dfd3[_0x0dbf('0x65')])?null:_0x53dfd3[_0x0dbf('0x65')];_0x3f33e1[_0x0dbf('0x66')]=isNaN(_0x53dfd3['channelCount'])?null:_0x53dfd3[_0x0dbf('0x67')];_0x3f33e1[_0x0dbf('0x68')]=isNaN(_0x53dfd3[_0x0dbf('0x69')])?null:_0x53dfd3[_0x0dbf('0x69')];_0x3f33e1[_0x0dbf('0x6a')]=isNaN(_0x53dfd3[_0x0dbf('0x6b')])?null:_0x53dfd3[_0x0dbf('0x6b')];});_0x5d0800['on'](_0x0dbf('0x6c'),function(_0x4de073){_0x3f33e1[_0x0dbf('0x6d')]=isNaN(_0x4de073[_0x0dbf('0x63')])?null:_0x4de073[_0x0dbf('0x63')]*0x3e8;_0x3f33e1[_0x0dbf('0x6e')]=isNaN(_0x4de073[_0x0dbf('0x65')])?null:_0x4de073['sampleCount'];_0x3f33e1[_0x0dbf('0x6f')]=isNaN(_0x4de073[_0x0dbf('0x67')])?null:_0x4de073[_0x0dbf('0x67')];_0x3f33e1[_0x0dbf('0x70')]=isNaN(_0x4de073[_0x0dbf('0x69')])?null:_0x4de073[_0x0dbf('0x69')];_0x3f33e1[_0x0dbf('0x71')]=isNaN(_0x4de073[_0x0dbf('0x6b')])?null:_0x4de073[_0x0dbf('0x6b')];});_0x5d0800['on']('end',function(){fs['chmodSync'](_0x3e341d,parseInt(_0x0dbf('0x5f'),0x8));return db[_0x0dbf('0x3e')]['create'](_0x3f33e1)[_0x0dbf('0x24')](function(_0xb674cc){var _0xa9e0e3={'role':_0x398779[_0x0dbf('0x72')]['role'],'userProfileId':_0x398779[_0x0dbf('0x72')][_0x0dbf('0x73')]};if(!_0xa9e0e3)throw new Error(_0x0dbf('0x74'));if(_0xa9e0e3['role']==='user'){var _0x8c06c9=_0xb674cc[_0x0dbf('0x25')]({'plain':!![]});return db[_0x0dbf('0x75')][_0x0dbf('0x46')]({'where':{'name':_0x0dbf('0x26'),'userProfileId':_0xa9e0e3['userProfileId']},'raw':!![]})[_0x0dbf('0x24')](function(_0x4fea6c){if(_0x4fea6c&&_0x4fea6c[_0x0dbf('0x76')]===0x0){return db[_0x0dbf('0x77')][_0x0dbf('0x53')]({'name':_0x8c06c9['name'],'resourceId':_0x8c06c9['id'],'type':_0x4fea6c['name'],'sectionId':_0x4fea6c['id']},{})[_0x0dbf('0x24')](function(){return _0xb674cc;});}else{return _0xb674cc;}})[_0x0dbf('0x43')](function(_0x34ef46){logger['error'](_0x0dbf('0x78'),_0x34ef46);throw _0x34ef46;});}return _0xb674cc;})[_0x0dbf('0x24')](respondWithResult(_0x561e44,null))[_0x0dbf('0x43')](handleError(_0x561e44,null));});_0x5d0800['start']();}catch(_0x12131d){_0x561e44[_0x0dbf('0x1b')](0x1f4)['send'](_0x12131d);}};exports['update']=function(_0x16d6d6,_0x3566df,_0xb99559){return db[_0x0dbf('0x3e')]['find']({'where':{'id':_0x16d6d6[_0x0dbf('0x45')]['id']}})['then'](handleEntityNotFound(_0x3566df,null))[_0x0dbf('0x24')](saveUpdates(_[_0x0dbf('0x36')](_0x16d6d6[_0x0dbf('0x72')],[_0x0dbf('0x29'),'description']),null))[_0x0dbf('0x24')](respondWithResult(_0x3566df,null))[_0x0dbf('0x43')](handleError(_0x3566df,null));};exports['delete']=function(_0x5a16ba,_0x4689f9,_0x1e7736){return db[_0x0dbf('0x3e')]['find']({'where':{'id':_0x5a16ba[_0x0dbf('0x45')]['id']}})[_0x0dbf('0x24')](function(_0x47d4c4){if(_0x47d4c4){return _0x47d4c4[_0x0dbf('0x27')]();}})[_0x0dbf('0x24')](function(_0x55e411){var _0x10c9c9=path[_0x0dbf('0x4b')](config[_0x0dbf('0x4c')],_0x0dbf('0x5b'),util[_0x0dbf('0x51')](_0x0dbf('0x52'),_0x55e411['save_name'],_0x55e411['original_format']));var _0x482b16=path['join'](config[_0x0dbf('0x4c')],_0x0dbf('0x50'),util[_0x0dbf('0x51')]('%s.%s',_0x55e411[_0x0dbf('0x48')],_0x55e411['converted_format']));fs[_0x0dbf('0x60')](_0x10c9c9);fs[_0x0dbf('0x60')](_0x482b16);return _0x55e411;})[_0x0dbf('0x24')](function(_0x194be4){if(_0x194be4){return _0x4689f9['status'](0xcc)[_0x0dbf('0x1c')]();}})[_0x0dbf('0x24')](handleEntityNotFound(_0x4689f9,null))['catch'](handleError(_0x4689f9,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index d1d9f6d..3e5842c 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 _0x3eea=['./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x5abdd0,_0x380e6b){var _0x260276=function(_0x37a6d8){while(--_0x37a6d8){_0x5abdd0['push'](_0x5abdd0['shift']());}};_0x260276(++_0x380e6b);}(_0x3eea,0xf7));var _0xa3ee=function(_0x1c1825,_0x372467){_0x1c1825=_0x1c1825-0x0;var _0x2f6058=_0x3eea[_0x1c1825];return _0x2f6058;};'use strict';var _=require(_0xa3ee('0x0'));var util=require(_0xa3ee('0x1'));var logger=require(_0xa3ee('0x2'))('api');var moment=require(_0xa3ee('0x3'));var BPromise=require('bluebird');var rp=require(_0xa3ee('0x4'));var fs=require('fs');var path=require(_0xa3ee('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa3ee('0x6'));module[_0xa3ee('0x7')]=function(_0x20ec3b,_0xf404b2){return _0x20ec3b[_0xa3ee('0x8')](_0xa3ee('0x9'),attributes,{'tableName':_0xa3ee('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5d8=['request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','../../config/logger','moment','bluebird'];(function(_0x35c450,_0x3330b9){var _0x391f45=function(_0xf8a00e){while(--_0xf8a00e){_0x35c450['push'](_0x35c450['shift']());}};_0x391f45(++_0x3330b9);}(_0xd5d8,0x1a9));var _0x8d5d=function(_0x4ab8d2,_0x174185){_0x4ab8d2=_0x4ab8d2-0x0;var _0x1b1437=_0xd5d8[_0x4ab8d2];return _0x1b1437;};'use strict';var _=require('lodash');var util=require(_0x8d5d('0x0'));var logger=require(_0x8d5d('0x1'))('api');var moment=require(_0x8d5d('0x2'));var BPromise=require(_0x8d5d('0x3'));var rp=require(_0x8d5d('0x4'));var fs=require('fs');var path=require(_0x8d5d('0x5'));var rimraf=require(_0x8d5d('0x6'));var config=require(_0x8d5d('0x7'));var attributes=require(_0x8d5d('0x8'));module[_0x8d5d('0x9')]=function(_0x11f4fb,_0x33ec8a){return _0x11f4fb[_0x8d5d('0xa')](_0x8d5d('0xb'),attributes,{'tableName':_0x8d5d('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 7b34abe..d5520eb 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 _0x406d=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','find','options','raw','where','attributes','include','map','model','ShowSound','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x406d,0x6d));var _0xd406=function(_0x2ef51f,_0x1b88a4){_0x2ef51f=_0x2ef51f-0x0;var _0x34d617=_0x406d[_0x2ef51f];return _0x34d617;};'use strict';var _=require(_0xd406('0x0'));var util=require(_0xd406('0x1'));var moment=require(_0xd406('0x2'));var BPromise=require('bluebird');var rs=require(_0xd406('0x3'));var fs=require('fs');var Redis=require(_0xd406('0x4'));var db=require(_0xd406('0x5'))['db'];var utils=require(_0xd406('0x6'));var logger=require(_0xd406('0x7'))('rpc');var config=require(_0xd406('0x8'));var jayson=require(_0xd406('0x9'));var client=jayson[_0xd406('0xa')][_0xd406('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x642276,_0x52679b,_0x352dac){return new BPromise(function(_0x6b9644,_0xe1f607){return client['request'](_0x642276,_0x352dac)[_0xd406('0xc')](function(_0x492099){logger['info'](_0xd406('0xd'),_0x52679b,_0xd406('0xe'));logger[_0xd406('0xf')](_0xd406('0x10'),_0x52679b,'request\x20sent',JSON[_0xd406('0x11')](_0x492099));if(_0x492099['error']){if(_0x492099[_0xd406('0x12')][_0xd406('0x13')]===0x1f4){logger[_0xd406('0x12')](_0xd406('0xd'),_0x52679b,_0x492099[_0xd406('0x12')][_0xd406('0x14')]);return _0xe1f607(_0x492099['error'][_0xd406('0x14')]);}logger['error'](_0xd406('0xd'),_0x52679b,_0x492099['error'][_0xd406('0x14')]);return _0x6b9644(_0x492099[_0xd406('0x12')][_0xd406('0x14')]);}else{logger[_0xd406('0x15')]('Sound,\x20%s,\x20%s',_0x52679b,_0xd406('0xe'));_0x6b9644(_0x492099['result'][_0xd406('0x14')]);}})['catch'](function(_0x23ddb5){logger['error'](_0xd406('0xd'),_0x52679b,_0x23ddb5);_0xe1f607(_0x23ddb5);});});}exports['ShowSound']=function(_0x12f371){var _0x19d43a=this;return new Promise(function(_0x873f01,_0x20047a){return db['Sound'][_0xd406('0x16')]({'raw':_0x12f371[_0xd406('0x17')]?_0x12f371[_0xd406('0x17')][_0xd406('0x18')]===undefined?!![]:![]:!![],'where':_0x12f371[_0xd406('0x17')]?_0x12f371[_0xd406('0x17')][_0xd406('0x19')]||null:null,'attributes':_0x12f371[_0xd406('0x17')]?_0x12f371['options'][_0xd406('0x1a')]||null:null,'include':_0x12f371[_0xd406('0x17')]?_0x12f371[_0xd406('0x17')][_0xd406('0x1b')]?_['map'](_0x12f371[_0xd406('0x17')][_0xd406('0x1b')],function(_0x94e6f8){return{'model':db[_0x94e6f8['model']],'as':_0x94e6f8['as'],'attributes':_0x94e6f8[_0xd406('0x1a')],'include':_0x94e6f8['include']?_[_0xd406('0x1c')](_0x94e6f8['include'],function(_0x21292a){return{'model':db[_0x21292a[_0xd406('0x1d')]],'as':_0x21292a['as'],'attributes':_0x21292a[_0xd406('0x1a')],'include':_0x21292a[_0xd406('0x1b')]?_[_0xd406('0x1c')](_0x21292a[_0xd406('0x1b')],function(_0x15e75a){return{'model':db[_0x15e75a[_0xd406('0x1d')]],'as':_0x15e75a['as'],'attributes':_0x15e75a[_0xd406('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd406('0xc')](function(_0x36e89c){logger['info'](_0xd406('0x1e'),_0x12f371);logger[_0xd406('0xf')](_0xd406('0x1e'),_0x12f371,JSON['stringify'](_0x36e89c));_0x873f01(_0x36e89c);})['catch'](function(_0x3a9f45){logger['error']('ShowSound',_0x3a9f45[_0xd406('0x14')],_0x12f371);_0x20047a(_0x19d43a[_0xd406('0x12')](0x1f4,_0x3a9f45[_0xd406('0x14')]));});});}; \ No newline at end of file +var _0x9709=['client','http','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x421924,_0x15d560){var _0x10b657=function(_0x355529){while(--_0x355529){_0x421924['push'](_0x421924['shift']());}};_0x10b657(++_0x15d560);}(_0x9709,0x17f));var _0x9970=function(_0x2a1db6,_0x5bd31a){_0x2a1db6=_0x2a1db6-0x0;var _0x41d420=_0x9709[_0x2a1db6];return _0x41d420;};'use strict';var _=require(_0x9970('0x0'));var util=require(_0x9970('0x1'));var moment=require(_0x9970('0x2'));var BPromise=require(_0x9970('0x3'));var rs=require(_0x9970('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9970('0x5'))['db'];var utils=require(_0x9970('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9970('0x7')][_0x9970('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17f117,_0x11b661,_0x46cafa){return new BPromise(function(_0x2fba76,_0x1eb1e9){return client['request'](_0x17f117,_0x46cafa)[_0x9970('0x9')](function(_0x47d024){logger[_0x9970('0xa')](_0x9970('0xb'),_0x11b661,'request\x20sent');logger[_0x9970('0xc')](_0x9970('0xd'),_0x11b661,_0x9970('0xe'),JSON[_0x9970('0xf')](_0x47d024));if(_0x47d024[_0x9970('0x10')]){if(_0x47d024[_0x9970('0x10')][_0x9970('0x11')]===0x1f4){logger[_0x9970('0x10')](_0x9970('0xb'),_0x11b661,_0x47d024['error'][_0x9970('0x12')]);return _0x1eb1e9(_0x47d024[_0x9970('0x10')]['message']);}logger['error']('Sound,\x20%s,\x20%s',_0x11b661,_0x47d024[_0x9970('0x10')][_0x9970('0x12')]);return _0x2fba76(_0x47d024[_0x9970('0x10')]['message']);}else{logger[_0x9970('0xa')](_0x9970('0xb'),_0x11b661,_0x9970('0xe'));_0x2fba76(_0x47d024['result'][_0x9970('0x12')]);}})[_0x9970('0x13')](function(_0x551f35){logger[_0x9970('0x10')](_0x9970('0xb'),_0x11b661,_0x551f35);_0x1eb1e9(_0x551f35);});});}exports[_0x9970('0x14')]=function(_0xb07f9c){var _0x3a9586=this;return new Promise(function(_0x5eb2e8,_0x3f2ebf){return db[_0x9970('0x15')][_0x9970('0x16')]({'raw':_0xb07f9c[_0x9970('0x17')]?_0xb07f9c[_0x9970('0x17')][_0x9970('0x18')]===undefined?!![]:![]:!![],'where':_0xb07f9c[_0x9970('0x17')]?_0xb07f9c[_0x9970('0x17')][_0x9970('0x19')]||null:null,'attributes':_0xb07f9c['options']?_0xb07f9c[_0x9970('0x17')][_0x9970('0x1a')]||null:null,'include':_0xb07f9c[_0x9970('0x17')]?_0xb07f9c[_0x9970('0x17')][_0x9970('0x1b')]?_[_0x9970('0x1c')](_0xb07f9c[_0x9970('0x17')][_0x9970('0x1b')],function(_0x5e0dcb){return{'model':db[_0x5e0dcb[_0x9970('0x1d')]],'as':_0x5e0dcb['as'],'attributes':_0x5e0dcb[_0x9970('0x1a')],'include':_0x5e0dcb[_0x9970('0x1b')]?_[_0x9970('0x1c')](_0x5e0dcb[_0x9970('0x1b')],function(_0x35856c){return{'model':db[_0x35856c[_0x9970('0x1d')]],'as':_0x35856c['as'],'attributes':_0x35856c[_0x9970('0x1a')],'include':_0x35856c['include']?_['map'](_0x35856c['include'],function(_0x286677){return{'model':db[_0x286677['model']],'as':_0x286677['as'],'attributes':_0x286677[_0x9970('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9970('0x9')](function(_0x45dfaa){logger['info'](_0x9970('0x14'),_0xb07f9c);logger[_0x9970('0xc')](_0x9970('0x14'),_0xb07f9c,JSON[_0x9970('0xf')](_0x45dfaa));_0x5eb2e8(_0x45dfaa);})[_0x9970('0x13')](function(_0x304d7b){logger[_0x9970('0x10')](_0x9970('0x14'),_0x304d7b[_0x9970('0x12')],_0xb07f9c);_0x3f2ebf(_0x3a9586[_0x9970('0x10')](0x1f4,_0x304d7b[_0x9970('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f65b7bf..aa1556f 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 _0xb00a=['destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2ac05c,_0x1cc6f5){var _0x26bee0=function(_0x48c5db){while(--_0x48c5db){_0x2ac05c['push'](_0x2ac05c['shift']());}};_0x26bee0(++_0x1cc6f5);}(_0xb00a,0x122));var _0xab00=function(_0x409579,_0x21bf4b){_0x409579=_0x409579-0x0;var _0x3d328b=_0xb00a[_0x409579];return _0x3d328b;};'use strict';var multer=require(_0xab00('0x0'));var util=require(_0xab00('0x1'));var path=require(_0xab00('0x2'));var timeout=require(_0xab00('0x3'));var express=require(_0xab00('0x4'));var router=express[_0xab00('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xab00('0x6'));var config=require('../../config/environment');var controller=require(_0xab00('0x7'));router[_0xab00('0x8')]('/',auth[_0xab00('0x9')](),controller[_0xab00('0xa')]);router[_0xab00('0x8')](_0xab00('0xb'),auth[_0xab00('0x9')](),controller[_0xab00('0xc')]);router[_0xab00('0xd')]('/',auth[_0xab00('0x9')](),controller['create']);router[_0xab00('0xe')]('/:id',auth[_0xab00('0x9')](),controller[_0xab00('0xf')]);router['delete']('/:id',auth[_0xab00('0x9')](),controller[_0xab00('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf375=['multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports'];(function(_0x2bb02b,_0x34060e){var _0x161db1=function(_0xf57b4e){while(--_0xf57b4e){_0x2bb02b['push'](_0x2bb02b['shift']());}};_0x161db1(++_0x34060e);}(_0xf375,0xd2));var _0x5f37=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf375[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5f37('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5f37('0x1'));var express=require(_0x5f37('0x2'));var router=express['Router']();var auth=require(_0x5f37('0x3'));var interaction=require(_0x5f37('0x4'));var config=require('../../config/environment');var controller=require(_0x5f37('0x5'));router['get']('/',auth[_0x5f37('0x6')](),controller[_0x5f37('0x7')]);router['get'](_0x5f37('0x8'),auth[_0x5f37('0x6')](),controller['show']);router[_0x5f37('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5f37('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5f37('0xb')]);router[_0x5f37('0xc')]('/:id',auth[_0x5f37('0x6')](),controller[_0x5f37('0xd')]);module[_0x5f37('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index d2c5456..9a7bfcc 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 _0x7382=['out','sequelize','STRING','TEXT','medium'];(function(_0x522f19,_0x45021d){var _0x34b033=function(_0x58891e){while(--_0x58891e){_0x522f19['push'](_0x522f19['shift']());}};_0x34b033(++_0x45021d);}(_0x7382,0xa6));var _0x2738=function(_0x331894,_0x4d657e){_0x331894=_0x331894-0x0;var _0x2031a8=_0x7382[_0x331894];return _0x2031a8;};'use strict';var Sequelize=require(_0x2738('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2738('0x1')]},'body':{'type':Sequelize[_0x2738('0x2')](_0x2738('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2738('0x4')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file +var _0xc59e=['sequelize','exports','STRING','medium','ENUM','out'];(function(_0x1d5c12,_0x12777e){var _0x553d6f=function(_0x5d0f53){while(--_0x5d0f53){_0x1d5c12['push'](_0x1d5c12['shift']());}};_0x553d6f(++_0x12777e);}(_0xc59e,0x7e));var _0xec59=function(_0x115ac5,_0x24271a){_0x115ac5=_0x115ac5-0x0;var _0x2c13e6=_0xc59e[_0x115ac5];return _0x2c13e6;};'use strict';var Sequelize=require(_0xec59('0x0'));module[_0xec59('0x1')]={'uniqueid':{'type':Sequelize[_0xec59('0x2')]},'body':{'type':Sequelize['TEXT'](_0xec59('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xec59('0x4')]('in',_0xec59('0x5')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index e80b1c8..d5e9dbe 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 _0x8d84=['html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','SquareMessage','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','rawAttributes','include','find','catch','create','body','params'];(function(_0x38de1f,_0x4f69be){var _0x46b9b8=function(_0x4b6077){while(--_0x4b6077){_0x38de1f['push'](_0x38de1f['shift']());}};_0x46b9b8(++_0x4f69be);}(_0x8d84,0x114));var _0x48d8=function(_0x46e611,_0x961733){_0x46e611=_0x46e611-0x0;var _0x438c60=_0x8d84[_0x46e611];return _0x438c60;};'use strict';var pdf=require(_0x48d8('0x0'));var emlformat=require(_0x48d8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x48d8('0x2'));var rp=require(_0x48d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x48d8('0x4'));var util=require(_0x48d8('0x5'));var path=require(_0x48d8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x48d8('0x7'));var squel=require('squel');var crypto=require(_0x48d8('0x8'));var jsforce=require(_0x48d8('0x9'));var deskjs=require(_0x48d8('0xa'));var toCsv=require(_0x48d8('0xb'));var querystring=require(_0x48d8('0xc'));var Papa=require(_0x48d8('0xd'));var Redis=require('ioredis');var authService=require(_0x48d8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x48d8('0xf'));var hardwareService=require(_0x48d8('0x10'));var logger=require(_0x48d8('0x11'))(_0x48d8('0x12'));var utils=require(_0x48d8('0x13'));var config=require(_0x48d8('0x14'));var db=require(_0x48d8('0x15'))['db'];function respondWithStatusCode(_0x46188c,_0x4020fb){_0x4020fb=_0x4020fb||0xcc;return function(_0x49b02c){if(_0x49b02c){return _0x46188c[_0x48d8('0x16')](_0x4020fb);}return _0x46188c['status'](_0x4020fb)[_0x48d8('0x17')]();};}function respondWithResult(_0x5c938b,_0x3e621d){_0x3e621d=_0x3e621d||0xc8;return function(_0x56422a){if(_0x56422a){return _0x5c938b[_0x48d8('0x18')](_0x3e621d)[_0x48d8('0x19')](_0x56422a);}};}function respondWithFilteredResult(_0x4c16ce,_0x2046c9){return function(_0x4195f7){if(_0x4195f7){var _0x24d776=_0x4195f7[_0x48d8('0x1a')],_0x3c3449=_0x2046c9[_0x48d8('0x1b')],_0x1952cc=_0x2046c9[_0x48d8('0x1b')]+_0x2046c9[_0x48d8('0x1c')],_0x29b8f9;if(_0x1952cc>=_0x24d776){_0x1952cc=_0x24d776;_0x29b8f9=0xc8;}else{_0x29b8f9=0xce;}_0x4c16ce['status'](_0x29b8f9);return _0x4c16ce[_0x48d8('0x1d')](_0x48d8('0x1e'),_0x3c3449+'-'+_0x1952cc+'/'+_0x24d776)[_0x48d8('0x19')](_0x4195f7);}return null;};}function patchUpdates(_0x310619){return function(_0x467ff3){try{jsonpatch[_0x48d8('0x1f')](_0x467ff3,_0x310619,!![]);}catch(_0x247d8e){return BPromise['reject'](_0x247d8e);}return _0x467ff3[_0x48d8('0x20')]();};}function saveUpdates(_0xb67c41,_0x37c7cc){return function(_0x556f11){if(_0x556f11){return _0x556f11[_0x48d8('0x21')](_0xb67c41)[_0x48d8('0x22')](function(_0x7a8b76){return _0x7a8b76;});}return null;};}function removeEntity(_0x521721,_0x286e2f){return function(_0x411044){if(_0x411044){return _0x411044[_0x48d8('0x23')]()[_0x48d8('0x22')](function(){_0x521721[_0x48d8('0x18')](0xcc)[_0x48d8('0x17')]();});}};}function handleEntityNotFound(_0x3f43b9,_0x56e82a){return function(_0x138732){if(!_0x138732){_0x3f43b9['sendStatus'](0x194);}return _0x138732;};}function handleError(_0x467a60,_0x4a4e89){_0x4a4e89=_0x4a4e89||0x1f4;return function(_0x540f60){logger['error'](_0x540f60[_0x48d8('0x24')]);if(_0x540f60['name']){delete _0x540f60[_0x48d8('0x25')];}_0x467a60['status'](_0x4a4e89)['send'](_0x540f60);};}exports[_0x48d8('0x26')]=function(_0x3ea189,_0x37a1ba){var _0xaf7879={},_0x10e3d6={},_0x2d1944={'count':0x0,'rows':[]};var _0x4b91c9=_[_0x48d8('0x27')](db[_0x48d8('0x28')]['rawAttributes'],function(_0x5d4736){return{'name':_0x5d4736['fieldName'],'type':_0x5d4736['type'][_0x48d8('0x29')]};});_0x10e3d6['model']=_[_0x48d8('0x27')](_0x4b91c9,_0x48d8('0x25'));_0x10e3d6[_0x48d8('0x2a')]=_[_0x48d8('0x2b')](_0x3ea189[_0x48d8('0x2a')]);_0x10e3d6[_0x48d8('0x2c')]=_[_0x48d8('0x2d')](_0x10e3d6['model'],_0x10e3d6[_0x48d8('0x2a')]);_0xaf7879['attributes']=_[_0x48d8('0x2d')](_0x10e3d6[_0x48d8('0x2e')],qs['fields'](_0x3ea189['query'][_0x48d8('0x2f')]));_0xaf7879['attributes']=_0xaf7879['attributes'][_0x48d8('0x30')]?_0xaf7879[_0x48d8('0x31')]:_0x10e3d6['model'];if(!_0x3ea189['query'][_0x48d8('0x32')]('nolimit')){_0xaf7879[_0x48d8('0x1c')]=qs[_0x48d8('0x1c')](_0x3ea189[_0x48d8('0x2a')][_0x48d8('0x1c')]);_0xaf7879['offset']=qs[_0x48d8('0x1b')](_0x3ea189[_0x48d8('0x2a')]['offset']);}_0xaf7879['order']=qs['sort'](_0x3ea189[_0x48d8('0x2a')][_0x48d8('0x33')]);_0xaf7879[_0x48d8('0x34')]=qs[_0x48d8('0x2c')](_[_0x48d8('0x35')](_0x3ea189[_0x48d8('0x2a')],_0x10e3d6[_0x48d8('0x2c')]));if(_0x3ea189[_0x48d8('0x2a')]['filter']){_0xaf7879[_0x48d8('0x34')]=_['merge'](_0xaf7879[_0x48d8('0x34')],{'$or':_[_0x48d8('0x27')](_0x4b91c9,function(_0x2d1ba4){if(_0x2d1ba4[_0x48d8('0x36')]!==_0x48d8('0x37')){var _0x4d5d6e={};_0x4d5d6e[_0x2d1ba4[_0x48d8('0x25')]]={'$like':'%'+_0x3ea189['query'][_0x48d8('0x38')]+'%'};return _0x4d5d6e;}})});}_0xaf7879=_[_0x48d8('0x39')]({},_0xaf7879,_0x3ea189[_0x48d8('0x3a')]);var _0xbf942b={'where':_0xaf7879[_0x48d8('0x34')]};return db[_0x48d8('0x28')][_0x48d8('0x1a')](_0xbf942b)[_0x48d8('0x22')](function(_0x39f124){_0x2d1944['count']=_0x39f124;if(_0x3ea189[_0x48d8('0x2a')][_0x48d8('0x3b')]){_0xaf7879['include']=[{'all':!![]}];}return db['SquareMessage'][_0x48d8('0x3c')](_0xaf7879);})[_0x48d8('0x22')](function(_0x2ce1f2){_0x2d1944[_0x48d8('0x3d')]=_0x2ce1f2;return _0x2d1944;})[_0x48d8('0x22')](respondWithFilteredResult(_0x37a1ba,_0xaf7879))['catch'](handleError(_0x37a1ba,null));};exports['show']=function(_0x5c6a89,_0xc9b9e6){var _0x58b60f={'raw':!![],'where':{'id':_0x5c6a89['params']['id']}},_0x3a6339={};_0x3a6339[_0x48d8('0x2e')]=_['keys'](db[_0x48d8('0x28')][_0x48d8('0x3e')]);_0x3a6339['query']=_[_0x48d8('0x2b')](_0x5c6a89[_0x48d8('0x2a')]);_0x3a6339[_0x48d8('0x2c')]=_[_0x48d8('0x2d')](_0x3a6339[_0x48d8('0x2e')],_0x3a6339[_0x48d8('0x2a')]);_0x58b60f[_0x48d8('0x31')]=_[_0x48d8('0x2d')](_0x3a6339[_0x48d8('0x2e')],qs['fields'](_0x5c6a89[_0x48d8('0x2a')]['fields']));_0x58b60f[_0x48d8('0x31')]=_0x58b60f[_0x48d8('0x31')][_0x48d8('0x30')]?_0x58b60f['attributes']:_0x3a6339[_0x48d8('0x2e')];if(_0x5c6a89[_0x48d8('0x2a')][_0x48d8('0x3b')]){_0x58b60f[_0x48d8('0x3f')]=[{'all':!![]}];}_0x58b60f=_[_0x48d8('0x39')]({},_0x58b60f,_0x5c6a89[_0x48d8('0x3a')]);return db[_0x48d8('0x28')][_0x48d8('0x40')](_0x58b60f)[_0x48d8('0x22')](handleEntityNotFound(_0xc9b9e6,null))['then'](respondWithResult(_0xc9b9e6,null))[_0x48d8('0x41')](handleError(_0xc9b9e6,null));};exports[_0x48d8('0x42')]=function(_0xfca382,_0x2ddfae){return db['SquareMessage'][_0x48d8('0x42')](_0xfca382['body'],{})[_0x48d8('0x22')](respondWithResult(_0x2ddfae,0xc9))[_0x48d8('0x41')](handleError(_0x2ddfae,null));};exports[_0x48d8('0x21')]=function(_0x5c459c,_0x57eb8d){if(_0x5c459c[_0x48d8('0x43')]['id']){delete _0x5c459c[_0x48d8('0x43')]['id'];}return db[_0x48d8('0x28')][_0x48d8('0x40')]({'where':{'id':_0x5c459c[_0x48d8('0x44')]['id']}})[_0x48d8('0x22')](handleEntityNotFound(_0x57eb8d,null))[_0x48d8('0x22')](saveUpdates(_0x5c459c[_0x48d8('0x43')],null))[_0x48d8('0x22')](respondWithResult(_0x57eb8d,null))[_0x48d8('0x41')](handleError(_0x57eb8d,null));};exports['destroy']=function(_0x5659e6,_0x51fbbe){return db[_0x48d8('0x28')][_0x48d8('0x40')]({'where':{'id':_0x5659e6[_0x48d8('0x44')]['id']}})[_0x48d8('0x22')](handleEntityNotFound(_0x51fbbe,null))['then'](removeEntity(_0x51fbbe,null))[_0x48d8('0x41')](handleError(_0x51fbbe,null));}; \ No newline at end of file +var _0x2802=['eml-format','rimraf','zip-dir','moment','bluebird','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','api','../../config/utils','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','fields','query','attributes','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','html-pdf'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x2802,0x1b5));var _0x2280=function(_0x1558ab,_0x39d1de){_0x1558ab=_0x1558ab-0x0;var _0x53b64a=_0x2802[_0x1558ab];return _0x53b64a;};'use strict';var pdf=require(_0x2280('0x0'));var emlformat=require(_0x2280('0x1'));var rimraf=require(_0x2280('0x2'));var zipdir=require(_0x2280('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2280('0x4'));var BPromise=require(_0x2280('0x5'));var Mustache=require(_0x2280('0x6'));var util=require(_0x2280('0x7'));var path=require(_0x2280('0x8'));var sox=require(_0x2280('0x9'));var csv=require(_0x2280('0xa'));var ejs=require(_0x2280('0xb'));var fs=require('fs');var _=require(_0x2280('0xc'));var squel=require(_0x2280('0xd'));var crypto=require(_0x2280('0xe'));var jsforce=require(_0x2280('0xf'));var deskjs=require(_0x2280('0x10'));var toCsv=require(_0x2280('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2280('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2280('0x12'));var as=require(_0x2280('0x13'));var hardwareService=require(_0x2280('0x14'));var logger=require(_0x2280('0x15'))(_0x2280('0x16'));var utils=require(_0x2280('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x281050,_0x408d2c){_0x408d2c=_0x408d2c||0xcc;return function(_0xaf38c0){if(_0xaf38c0){return _0x281050['sendStatus'](_0x408d2c);}return _0x281050['status'](_0x408d2c)[_0x2280('0x18')]();};}function respondWithResult(_0x4bb37c,_0xa978d4){_0xa978d4=_0xa978d4||0xc8;return function(_0x286bd2){if(_0x286bd2){return _0x4bb37c[_0x2280('0x19')](_0xa978d4)[_0x2280('0x1a')](_0x286bd2);}};}function respondWithFilteredResult(_0x293a2f,_0x37277a){return function(_0x5af7f3){if(_0x5af7f3){var _0x5462a8=_0x5af7f3[_0x2280('0x1b')],_0x2296a2=_0x37277a[_0x2280('0x1c')],_0x4f8ef1=_0x37277a[_0x2280('0x1c')]+_0x37277a[_0x2280('0x1d')],_0x3aad38;if(_0x4f8ef1>=_0x5462a8){_0x4f8ef1=_0x5462a8;_0x3aad38=0xc8;}else{_0x3aad38=0xce;}_0x293a2f['status'](_0x3aad38);return _0x293a2f[_0x2280('0x1e')](_0x2280('0x1f'),_0x2296a2+'-'+_0x4f8ef1+'/'+_0x5462a8)[_0x2280('0x1a')](_0x5af7f3);}return null;};}function patchUpdates(_0x4131f9){return function(_0x5a978f){try{jsonpatch[_0x2280('0x20')](_0x5a978f,_0x4131f9,!![]);}catch(_0x3dcca6){return BPromise[_0x2280('0x21')](_0x3dcca6);}return _0x5a978f['save']();};}function saveUpdates(_0x33a50e,_0x5d3157){return function(_0x29c311){if(_0x29c311){return _0x29c311[_0x2280('0x22')](_0x33a50e)['then'](function(_0x57bdb1){return _0x57bdb1;});}return null;};}function removeEntity(_0x46d7a7,_0x23654a){return function(_0x5c6f95){if(_0x5c6f95){return _0x5c6f95[_0x2280('0x23')]()[_0x2280('0x24')](function(){_0x46d7a7[_0x2280('0x19')](0xcc)[_0x2280('0x18')]();});}};}function handleEntityNotFound(_0x1c13b7,_0x345926){return function(_0x292cb9){if(!_0x292cb9){_0x1c13b7[_0x2280('0x25')](0x194);}return _0x292cb9;};}function handleError(_0x119be7,_0x5789e6){_0x5789e6=_0x5789e6||0x1f4;return function(_0x4e0212){logger[_0x2280('0x26')](_0x4e0212[_0x2280('0x27')]);if(_0x4e0212[_0x2280('0x28')]){delete _0x4e0212['name'];}_0x119be7[_0x2280('0x19')](_0x5789e6)[_0x2280('0x29')](_0x4e0212);};}exports[_0x2280('0x2a')]=function(_0x4916d7,_0x1d7d42){var _0x580a66={},_0x44678f={},_0x5df5c3={'count':0x0,'rows':[]};var _0x37ef52=_['map'](db[_0x2280('0x2b')][_0x2280('0x2c')],function(_0x1daa3e){return{'name':_0x1daa3e[_0x2280('0x2d')],'type':_0x1daa3e[_0x2280('0x2e')][_0x2280('0x2f')]};});_0x44678f[_0x2280('0x30')]=_[_0x2280('0x31')](_0x37ef52,_0x2280('0x28'));_0x44678f['query']=_[_0x2280('0x32')](_0x4916d7['query']);_0x44678f[_0x2280('0x33')]=_[_0x2280('0x34')](_0x44678f[_0x2280('0x30')],_0x44678f['query']);_0x580a66['attributes']=_['intersection'](_0x44678f[_0x2280('0x30')],qs[_0x2280('0x35')](_0x4916d7[_0x2280('0x36')][_0x2280('0x35')]));_0x580a66[_0x2280('0x37')]=_0x580a66[_0x2280('0x37')][_0x2280('0x38')]?_0x580a66[_0x2280('0x37')]:_0x44678f[_0x2280('0x30')];if(!_0x4916d7[_0x2280('0x36')]['hasOwnProperty'](_0x2280('0x39'))){_0x580a66[_0x2280('0x1d')]=qs[_0x2280('0x1d')](_0x4916d7[_0x2280('0x36')]['limit']);_0x580a66[_0x2280('0x1c')]=qs['offset'](_0x4916d7[_0x2280('0x36')][_0x2280('0x1c')]);}_0x580a66[_0x2280('0x3a')]=qs['sort'](_0x4916d7[_0x2280('0x36')][_0x2280('0x3b')]);_0x580a66[_0x2280('0x3c')]=qs['filters'](_['pick'](_0x4916d7[_0x2280('0x36')],_0x44678f[_0x2280('0x33')]));if(_0x4916d7[_0x2280('0x36')]['filter']){_0x580a66[_0x2280('0x3c')]=_['merge'](_0x580a66[_0x2280('0x3c')],{'$or':_['map'](_0x37ef52,function(_0x2a4c5e){if(_0x2a4c5e['type']!==_0x2280('0x3d')){var _0x16e869={};_0x16e869[_0x2a4c5e[_0x2280('0x28')]]={'$like':'%'+_0x4916d7[_0x2280('0x36')][_0x2280('0x3e')]+'%'};return _0x16e869;}})});}_0x580a66=_[_0x2280('0x3f')]({},_0x580a66,_0x4916d7[_0x2280('0x40')]);var _0x2a32f7={'where':_0x580a66[_0x2280('0x3c')]};return db['SquareMessage']['count'](_0x2a32f7)[_0x2280('0x24')](function(_0x483b59){_0x5df5c3[_0x2280('0x1b')]=_0x483b59;if(_0x4916d7['query'][_0x2280('0x41')]){_0x580a66[_0x2280('0x42')]=[{'all':!![]}];}return db[_0x2280('0x2b')][_0x2280('0x43')](_0x580a66);})[_0x2280('0x24')](function(_0x5708d6){_0x5df5c3['rows']=_0x5708d6;return _0x5df5c3;})[_0x2280('0x24')](respondWithFilteredResult(_0x1d7d42,_0x580a66))[_0x2280('0x44')](handleError(_0x1d7d42,null));};exports['show']=function(_0x155424,_0x46e062){var _0x2b8012={'raw':!![],'where':{'id':_0x155424[_0x2280('0x45')]['id']}},_0x5e08b5={};_0x5e08b5[_0x2280('0x30')]=_['keys'](db[_0x2280('0x2b')]['rawAttributes']);_0x5e08b5[_0x2280('0x36')]=_[_0x2280('0x32')](_0x155424['query']);_0x5e08b5[_0x2280('0x33')]=_[_0x2280('0x34')](_0x5e08b5[_0x2280('0x30')],_0x5e08b5['query']);_0x2b8012[_0x2280('0x37')]=_['intersection'](_0x5e08b5['model'],qs[_0x2280('0x35')](_0x155424['query']['fields']));_0x2b8012[_0x2280('0x37')]=_0x2b8012['attributes'][_0x2280('0x38')]?_0x2b8012['attributes']:_0x5e08b5[_0x2280('0x30')];if(_0x155424['query'][_0x2280('0x41')]){_0x2b8012[_0x2280('0x42')]=[{'all':!![]}];}_0x2b8012=_['merge']({},_0x2b8012,_0x155424[_0x2280('0x40')]);return db['SquareMessage'][_0x2280('0x46')](_0x2b8012)[_0x2280('0x24')](handleEntityNotFound(_0x46e062,null))[_0x2280('0x24')](respondWithResult(_0x46e062,null))[_0x2280('0x44')](handleError(_0x46e062,null));};exports[_0x2280('0x47')]=function(_0x1d9e33,_0x471c9e){return db[_0x2280('0x2b')][_0x2280('0x47')](_0x1d9e33[_0x2280('0x48')],{})[_0x2280('0x24')](respondWithResult(_0x471c9e,0xc9))[_0x2280('0x44')](handleError(_0x471c9e,null));};exports[_0x2280('0x22')]=function(_0x8bc66c,_0x3e9270){if(_0x8bc66c[_0x2280('0x48')]['id']){delete _0x8bc66c['body']['id'];}return db['SquareMessage'][_0x2280('0x46')]({'where':{'id':_0x8bc66c[_0x2280('0x45')]['id']}})[_0x2280('0x24')](handleEntityNotFound(_0x3e9270,null))[_0x2280('0x24')](saveUpdates(_0x8bc66c[_0x2280('0x48')],null))[_0x2280('0x24')](respondWithResult(_0x3e9270,null))[_0x2280('0x44')](handleError(_0x3e9270,null));};exports['destroy']=function(_0x5cf6d3,_0x1d0766){return db[_0x2280('0x2b')][_0x2280('0x46')]({'where':{'id':_0x5cf6d3[_0x2280('0x45')]['id']}})['then'](handleEntityNotFound(_0x1d0766,null))[_0x2280('0x24')](removeEntity(_0x1d0766,null))[_0x2280('0x44')](handleError(_0x1d0766,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 1a4f138..133ae36 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 _0xba45=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x325319,_0x5f1e47){var _0x4feada=function(_0x2dffac){while(--_0x2dffac){_0x325319['push'](_0x325319['shift']());}};_0x4feada(++_0x5f1e47);}(_0xba45,0x14f));var _0x5ba4=function(_0x4aff25,_0x469c8e){_0x4aff25=_0x4aff25-0x0;var _0x4b032d=_0xba45[_0x4aff25];return _0x4b032d;};'use strict';var _=require(_0x5ba4('0x0'));var util=require(_0x5ba4('0x1'));var logger=require(_0x5ba4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ba4('0x3'));var rp=require(_0x5ba4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ba4('0x5'));var attributes=require(_0x5ba4('0x6'));module[_0x5ba4('0x7')]=function(_0x350248,_0x11546e){return _0x350248[_0x5ba4('0x8')](_0x5ba4('0x9'),attributes,{'tableName':_0x5ba4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c12=['rimraf','./squareMessage.attributes','exports','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','path'];(function(_0x4ceea3,_0x3f7cbb){var _0x171137=function(_0x27c4bf){while(--_0x27c4bf){_0x4ceea3['push'](_0x4ceea3['shift']());}};_0x171137(++_0x3f7cbb);}(_0x4c12,0x102));var _0x24c1=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x4c12[_0x58c20f];return _0x3b0318;};'use strict';var _=require(_0x24c1('0x0'));var util=require(_0x24c1('0x1'));var logger=require(_0x24c1('0x2'))(_0x24c1('0x3'));var moment=require(_0x24c1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x24c1('0x5'));var rimraf=require(_0x24c1('0x6'));var config=require('../../config/environment');var attributes=require(_0x24c1('0x7'));module[_0x24c1('0x8')]=function(_0x3d4f71,_0x56a612){return _0x3d4f71['define'](_0x24c1('0x9'),attributes,{'tableName':_0x24c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 5f1cb2f..e878c8e 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 _0x9505=['client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','body','options','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x16f6b9,_0x14b4e1){var _0x4329b0=function(_0x103f34){while(--_0x103f34){_0x16f6b9['push'](_0x16f6b9['shift']());}};_0x4329b0(++_0x14b4e1);}(_0x9505,0x1e5));var _0x5950=function(_0x4b3d75,_0xd82902){_0x4b3d75=_0x4b3d75-0x0;var _0x4374e9=_0x9505[_0x4b3d75];return _0x4374e9;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var moment=require('moment');var BPromise=require(_0x5950('0x2'));var rs=require(_0x5950('0x3'));var fs=require('fs');var Redis=require(_0x5950('0x4'));var db=require(_0x5950('0x5'))['db'];var utils=require(_0x5950('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5950('0x7'));var jayson=require(_0x5950('0x8'));var client=jayson[_0x5950('0x9')][_0x5950('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa518,_0x4b9478,_0x425d17){return new BPromise(function(_0x362f04,_0x3986aa){return client[_0x5950('0xb')](_0x4aa518,_0x425d17)[_0x5950('0xc')](function(_0x1df039){logger[_0x5950('0xd')](_0x5950('0xe'),_0x4b9478,_0x5950('0xf'));logger['debug'](_0x5950('0x10'),_0x4b9478,_0x5950('0xf'),JSON['stringify'](_0x1df039));if(_0x1df039['error']){if(_0x1df039[_0x5950('0x11')][_0x5950('0x12')]===0x1f4){logger[_0x5950('0x11')](_0x5950('0xe'),_0x4b9478,_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);return _0x3986aa(_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);}logger[_0x5950('0x11')](_0x5950('0xe'),_0x4b9478,_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);return _0x362f04(_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);}else{logger[_0x5950('0xd')](_0x5950('0xe'),_0x4b9478,_0x5950('0xf'));_0x362f04(_0x1df039[_0x5950('0x14')][_0x5950('0x13')]);}})[_0x5950('0x15')](function(_0xface83){logger['error']('SquareMessage,\x20%s,\x20%s',_0x4b9478,_0xface83);_0x3986aa(_0xface83);});});}exports[_0x5950('0x16')]=function(_0x40f50c){var _0x3a7821=this;return new Promise(function(_0x5a9530,_0x3e0032){return db['SquareMessage']['create'](_0x40f50c[_0x5950('0x17')],{'raw':_0x40f50c[_0x5950('0x18')]?_0x40f50c[_0x5950('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x5950('0xc')](function(_0x3ea879){logger['info']('CreateSquareMessage',_0x40f50c);logger['debug']('CreateSquareMessage',_0x40f50c,JSON[_0x5950('0x19')](_0x3ea879));_0x5a9530(_0x3ea879);})[_0x5950('0x15')](function(_0x66c416){logger[_0x5950('0x11')]('CreateSquareMessage',_0x66c416[_0x5950('0x13')],_0x40f50c);_0x3e0032(_0x3a7821[_0x5950('0x11')](0x1f4,_0x66c416[_0x5950('0x13')]));});});}; \ No newline at end of file +var _0x9536=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateSquareMessage','SquareMessage','create','body','options','raw'];(function(_0x184422,_0x1971df){var _0x4115dd=function(_0x1faaa2){while(--_0x1faaa2){_0x184422['push'](_0x184422['shift']());}};_0x4115dd(++_0x1971df);}(_0x9536,0x179));var _0x6953=function(_0x23a79e,_0x235f89){_0x23a79e=_0x23a79e-0x0;var _0x3dab57=_0x9536[_0x23a79e];return _0x3dab57;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('SquareMessage,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});}exports[_0x6953('0x17')]=function(_0x2da771){var _0x4b43ae=this;return new Promise(function(_0x10858a,_0x3207dd){return db[_0x6953('0x18')][_0x6953('0x19')](_0x2da771[_0x6953('0x1a')],{'raw':_0x2da771['options']?_0x2da771[_0x6953('0x1b')][_0x6953('0x1c')]===undefined?!![]:![]:!![]})[_0x6953('0xc')](function(_0x2ba433){logger[_0x6953('0x15')]('CreateSquareMessage',_0x2da771);logger[_0x6953('0xf')](_0x6953('0x17'),_0x2da771,JSON['stringify'](_0x2ba433));_0x10858a(_0x2ba433);})[_0x6953('0x16')](function(_0x40c9d1){logger[_0x6953('0x12')](_0x6953('0x17'),_0x40c9d1['message'],_0x2da771);_0x3207dd(_0x4b43ae[_0x6953('0x12')](0x1f4,_0x40c9d1[_0x6953('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 6a7a6e3..2caeb15 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 _0x93ea=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','post','create','delete','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93ea,0x131));var _0xa93e=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x93ea[_0x4e198a];return _0xb84bfe;};'use strict';var multer=require(_0xa93e('0x0'));var util=require(_0xa93e('0x1'));var path=require('path');var timeout=require(_0xa93e('0x2'));var express=require(_0xa93e('0x3'));var router=express['Router']();var auth=require(_0xa93e('0x4'));var interaction=require(_0xa93e('0x5'));var config=require(_0xa93e('0x6'));var controller=require(_0xa93e('0x7'));router[_0xa93e('0x8')]('/',auth[_0xa93e('0x9')](),controller[_0xa93e('0xa')]);router[_0xa93e('0x8')](_0xa93e('0xb'),auth[_0xa93e('0x9')](),controller[_0xa93e('0xc')]);router['get'](_0xa93e('0xd'),auth[_0xa93e('0x9')](),timeout('15s'),controller['test']);router[_0xa93e('0xe')]('/',auth['isAuthenticated'](),controller[_0xa93e('0xf')]);router['put'](_0xa93e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa93e('0x10')](_0xa93e('0xb'),auth[_0xa93e('0x9')](),controller['destroy']);module[_0xa93e('0x11')]=router; \ No newline at end of file +var _0x0ec2=['../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0x0ec2,0x72));var _0x20ec=function(_0x5a99db,_0x1cece5){_0x5a99db=_0x5a99db-0x0;var _0x3aad62=_0x0ec2[_0x5a99db];return _0x3aad62;};'use strict';var multer=require(_0x20ec('0x0'));var util=require('util');var path=require(_0x20ec('0x1'));var timeout=require(_0x20ec('0x2'));var express=require(_0x20ec('0x3'));var router=express[_0x20ec('0x4')]();var auth=require(_0x20ec('0x5'));var interaction=require(_0x20ec('0x6'));var config=require(_0x20ec('0x7'));var controller=require(_0x20ec('0x8'));router[_0x20ec('0x9')]('/',auth[_0x20ec('0xa')](),controller[_0x20ec('0xb')]);router[_0x20ec('0x9')](_0x20ec('0xc'),auth[_0x20ec('0xa')](),controller[_0x20ec('0xd')]);router['get'](_0x20ec('0xe'),auth['isAuthenticated'](),timeout(_0x20ec('0xf')),controller[_0x20ec('0x10')]);router[_0x20ec('0x11')]('/',auth[_0x20ec('0xa')](),controller[_0x20ec('0x12')]);router[_0x20ec('0x13')](_0x20ec('0xc'),auth[_0x20ec('0xa')](),controller[_0x20ec('0x14')]);router[_0x20ec('0x15')]('/:id',auth[_0x20ec('0xa')](),controller[_0x20ec('0x16')]);module[_0x20ec('0x17')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index dd9375f..b6dcd98 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 _0x985f=['name','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x985f,0x18d));var _0xf985=function(_0x2c79f5,_0x363799){_0x2c79f5=_0x2c79f5-0x0;var _0x154903=_0x985f[_0x2c79f5];return _0x154903;};'use strict';var Sequelize=require(_0xf985('0x0'));module[_0xf985('0x1')]={'name':{'type':Sequelize[_0xf985('0x2')],'unique':_0xf985('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf985('0x2')]}}; \ No newline at end of file +var _0xb8cd=['STRING','name','sequelize','exports'];(function(_0x19017c,_0x4b54a3){var _0x5b7272=function(_0x4ac0a1){while(--_0x4ac0a1){_0x19017c['push'](_0x19017c['shift']());}};_0x5b7272(++_0x4b54a3);}(_0xb8cd,0x13a));var _0xdb8c=function(_0x41d2f8,_0xc97234){_0x41d2f8=_0x41d2f8-0x0;var _0x2bc031=_0xb8cd[_0x41d2f8];return _0x2bc031;};'use strict';var Sequelize=require(_0xdb8c('0x0'));module[_0xdb8c('0x1')]={'name':{'type':Sequelize[_0xdb8c('0x2')],'unique':_0xdb8c('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdb8c('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 2b4f3a1..9953d4f 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 _0x112a=['type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','offset','order','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','Content-Range','apply','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName'];(function(_0x1d16f1,_0x1eca1c){var _0xf8dbf5=function(_0x3d2a0b){while(--_0x3d2a0b){_0x1d16f1['push'](_0x1d16f1['shift']());}};_0xf8dbf5(++_0x1eca1c);}(_0x112a,0x12d));var _0xa112=function(_0x4dd35a,_0x3b03d7){_0x4dd35a=_0x4dd35a-0x0;var _0x2d95e5=_0x112a[_0x4dd35a];return _0x2d95e5;};'use strict';var pdf=require(_0xa112('0x0'));var emlformat=require(_0xa112('0x1'));var rimraf=require(_0xa112('0x2'));var zipdir=require(_0xa112('0x3'));var jsonpatch=require(_0xa112('0x4'));var rp=require(_0xa112('0x5'));var moment=require(_0xa112('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa112('0x7'));var util=require('util');var path=require(_0xa112('0x8'));var sox=require(_0xa112('0x9'));var csv=require(_0xa112('0xa'));var ejs=require(_0xa112('0xb'));var fs=require('fs');var _=require(_0xa112('0xc'));var squel=require(_0xa112('0xd'));var crypto=require(_0xa112('0xe'));var jsforce=require(_0xa112('0xf'));var deskjs=require(_0xa112('0x10'));var toCsv=require(_0xa112('0xa'));var querystring=require(_0xa112('0x11'));var Papa=require(_0xa112('0x12'));var Redis=require(_0xa112('0x13'));var authService=require(_0xa112('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa112('0x15'))(_0xa112('0x16'));var utils=require(_0xa112('0x17'));var config=require('../../config/environment');var db=require(_0xa112('0x18'))['db'];function respondWithStatusCode(_0x124649,_0x67855){_0x67855=_0x67855||0xcc;return function(_0x15a60d){if(_0x15a60d){return _0x124649[_0xa112('0x19')](_0x67855);}return _0x124649[_0xa112('0x1a')](_0x67855)[_0xa112('0x1b')]();};}function respondWithResult(_0x51283b,_0x21c3c0){_0x21c3c0=_0x21c3c0||0xc8;return function(_0x4b87ac){if(_0x4b87ac){return _0x51283b['status'](_0x21c3c0)['json'](_0x4b87ac);}};}function respondWithFilteredResult(_0x4a4536,_0x541d6b){return function(_0xf17648){if(_0xf17648){var _0x4eba6c=_0xf17648[_0xa112('0x1c')],_0x2611cf=_0x541d6b['offset'],_0x54c9fa=_0x541d6b['offset']+_0x541d6b[_0xa112('0x1d')],_0x22cd51;if(_0x54c9fa>=_0x4eba6c){_0x54c9fa=_0x4eba6c;_0x22cd51=0xc8;}else{_0x22cd51=0xce;}_0x4a4536['status'](_0x22cd51);return _0x4a4536['set'](_0xa112('0x1e'),_0x2611cf+'-'+_0x54c9fa+'/'+_0x4eba6c)['json'](_0xf17648);}return null;};}function patchUpdates(_0x5e84fb){return function(_0x56b8ed){try{jsonpatch[_0xa112('0x1f')](_0x56b8ed,_0x5e84fb,!![]);}catch(_0x4bcc8a){return BPromise['reject'](_0x4bcc8a);}return _0x56b8ed[_0xa112('0x20')]();};}function saveUpdates(_0x5bad02,_0x38a259){return function(_0x292ca8){if(_0x292ca8){return _0x292ca8['update'](_0x5bad02)[_0xa112('0x21')](function(_0x59f486){return _0x59f486;});}return null;};}function removeEntity(_0x110861,_0xf4d933){return function(_0x5b8799){if(_0x5b8799){return _0x5b8799[_0xa112('0x22')]()[_0xa112('0x21')](function(){var _0x249656=_0x5b8799[_0xa112('0x23')]({'plain':!![]});var _0x1666aa=_0xa112('0x24');return db[_0xa112('0x25')][_0xa112('0x22')]({'where':{'type':_0x1666aa,'resourceId':_0x249656['id']}})[_0xa112('0x21')](function(){return _0x5b8799;});})[_0xa112('0x21')](function(){_0x110861['status'](0xcc)[_0xa112('0x1b')]();});}};}function handleEntityNotFound(_0x585053,_0x4b3d53){return function(_0x2c47a2){if(!_0x2c47a2){_0x585053[_0xa112('0x19')](0x194);}return _0x2c47a2;};}function handleError(_0x1c5159,_0x24d609){_0x24d609=_0x24d609||0x1f4;return function(_0x4f9c8a){logger[_0xa112('0x26')](_0x4f9c8a[_0xa112('0x27')]);if(_0x4f9c8a['name']){delete _0x4f9c8a[_0xa112('0x28')];}_0x1c5159['status'](_0x24d609)[_0xa112('0x29')](_0x4f9c8a);};}exports[_0xa112('0x2a')]=function(_0x30bbf2,_0x4b1065){var _0x166833={},_0x528f7e={},_0x35a383={'count':0x0,'rows':[]};var _0x4eeb77=_[_0xa112('0x2b')](db[_0xa112('0x2c')][_0xa112('0x2d')],function(_0x5733ac){return{'name':_0x5733ac[_0xa112('0x2e')],'type':_0x5733ac[_0xa112('0x2f')][_0xa112('0x30')]};});_0x528f7e[_0xa112('0x31')]=_['map'](_0x4eeb77,_0xa112('0x28'));_0x528f7e['query']=_[_0xa112('0x32')](_0x30bbf2['query']);_0x528f7e[_0xa112('0x33')]=_[_0xa112('0x34')](_0x528f7e['model'],_0x528f7e[_0xa112('0x35')]);_0x166833[_0xa112('0x36')]=_[_0xa112('0x34')](_0x528f7e[_0xa112('0x31')],qs[_0xa112('0x37')](_0x30bbf2[_0xa112('0x35')][_0xa112('0x37')]));_0x166833[_0xa112('0x36')]=_0x166833[_0xa112('0x36')][_0xa112('0x38')]?_0x166833[_0xa112('0x36')]:_0x528f7e[_0xa112('0x31')];if(!_0x30bbf2[_0xa112('0x35')]['hasOwnProperty'](_0xa112('0x39'))){_0x166833[_0xa112('0x1d')]=qs[_0xa112('0x1d')](_0x30bbf2[_0xa112('0x35')]['limit']);_0x166833[_0xa112('0x3a')]=qs[_0xa112('0x3a')](_0x30bbf2[_0xa112('0x35')][_0xa112('0x3a')]);}_0x166833[_0xa112('0x3b')]=qs['sort'](_0x30bbf2['query']['sort']);_0x166833['where']=qs[_0xa112('0x33')](_[_0xa112('0x3c')](_0x30bbf2[_0xa112('0x35')],_0x528f7e[_0xa112('0x33')]));if(_0x30bbf2[_0xa112('0x35')][_0xa112('0x3d')]){_0x166833[_0xa112('0x3e')]=_[_0xa112('0x3f')](_0x166833[_0xa112('0x3e')],{'$or':_['map'](_0x4eeb77,function(_0x5d9fbb){if(_0x5d9fbb['type']!==_0xa112('0x40')){var _0x5820f5={};_0x5820f5[_0x5d9fbb[_0xa112('0x28')]]={'$like':'%'+_0x30bbf2[_0xa112('0x35')]['filter']+'%'};return _0x5820f5;}})});}_0x166833=_[_0xa112('0x3f')]({},_0x166833,_0x30bbf2[_0xa112('0x41')]);var _0x52734f={'where':_0x166833[_0xa112('0x3e')]};return db[_0xa112('0x2c')]['count'](_0x52734f)[_0xa112('0x21')](function(_0x8fb315){_0x35a383[_0xa112('0x1c')]=_0x8fb315;if(_0x30bbf2[_0xa112('0x35')]['includeAll']){_0x166833['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xa112('0x42')](_0x166833);})['then'](function(_0x1a4a77){_0x35a383[_0xa112('0x43')]=_0x1a4a77;return _0x35a383;})[_0xa112('0x21')](respondWithFilteredResult(_0x4b1065,_0x166833))[_0xa112('0x44')](handleError(_0x4b1065,null));};exports[_0xa112('0x45')]=function(_0x22e7bf,_0x3b8904){var _0x267298={'raw':!![],'where':{'id':_0x22e7bf['params']['id']}},_0x2285a9={};_0x2285a9['model']=_[_0xa112('0x32')](db['SquareOdbc'][_0xa112('0x2d')]);_0x2285a9[_0xa112('0x35')]=_[_0xa112('0x32')](_0x22e7bf[_0xa112('0x35')]);_0x2285a9['filters']=_[_0xa112('0x34')](_0x2285a9[_0xa112('0x31')],_0x2285a9['query']);_0x267298[_0xa112('0x36')]=_[_0xa112('0x34')](_0x2285a9[_0xa112('0x31')],qs[_0xa112('0x37')](_0x22e7bf['query'][_0xa112('0x37')]));_0x267298[_0xa112('0x36')]=_0x267298[_0xa112('0x36')][_0xa112('0x38')]?_0x267298['attributes']:_0x2285a9[_0xa112('0x31')];if(_0x22e7bf[_0xa112('0x35')][_0xa112('0x46')]){_0x267298[_0xa112('0x47')]=[{'all':!![]}];}_0x267298=_[_0xa112('0x3f')]({},_0x267298,_0x22e7bf[_0xa112('0x41')]);return db[_0xa112('0x2c')][_0xa112('0x48')](_0x267298)[_0xa112('0x21')](handleEntityNotFound(_0x3b8904,null))[_0xa112('0x21')](respondWithResult(_0x3b8904,null))[_0xa112('0x44')](handleError(_0x3b8904,null));};exports[_0xa112('0x49')]=function(_0x1e5e2c,_0xb20aa2){return db[_0xa112('0x2c')][_0xa112('0x49')](_0x1e5e2c[_0xa112('0x4a')],{})[_0xa112('0x21')](function(_0x35796d){var _0x310c2f=_0x1e5e2c['user'][_0xa112('0x23')]({'plain':!![]});if(!_0x310c2f)throw new Error(_0xa112('0x4b'));if(_0x310c2f[_0xa112('0x4c')]===_0xa112('0x4d')){var _0x53db27=_0x35796d[_0xa112('0x23')]({'plain':!![]});var _0x436814=_0xa112('0x24');return db['UserProfileSection'][_0xa112('0x48')]({'where':{'name':_0x436814,'userProfileId':_0x310c2f[_0xa112('0x4e')]},'raw':!![]})[_0xa112('0x21')](function(_0x56d7a5){if(_0x56d7a5&&_0x56d7a5[_0xa112('0x4f')]===0x0){return db[_0xa112('0x25')][_0xa112('0x49')]({'name':_0x53db27['name'],'resourceId':_0x53db27['id'],'type':_0x56d7a5[_0xa112('0x28')],'sectionId':_0x56d7a5['id']},{})[_0xa112('0x21')](function(){return _0x35796d;});}else{return _0x35796d;}})['catch'](function(_0x26a66a){logger['error'](_0xa112('0x50'),_0x26a66a);throw _0x26a66a;});}return _0x35796d;})['then'](respondWithResult(_0xb20aa2,0xc9))['catch'](handleError(_0xb20aa2,null));};exports[_0xa112('0x51')]=function(_0x5bf9f1,_0x190b18){if(_0x5bf9f1[_0xa112('0x4a')]['id']){delete _0x5bf9f1['body']['id'];}return db[_0xa112('0x2c')][_0xa112('0x48')]({'where':{'id':_0x5bf9f1['params']['id']}})[_0xa112('0x21')](handleEntityNotFound(_0x190b18,null))[_0xa112('0x21')](saveUpdates(_0x5bf9f1['body'],null))[_0xa112('0x21')](respondWithResult(_0x190b18,null))[_0xa112('0x44')](handleError(_0x190b18,null));};exports['destroy']=function(_0x40b218,_0x514b5){return db[_0xa112('0x2c')][_0xa112('0x48')]({'where':{'id':_0x40b218['params']['id']}})[_0xa112('0x21')](handleEntityNotFound(_0x514b5,null))[_0xa112('0x21')](removeEntity(_0x514b5,null))[_0xa112('0x44')](handleError(_0x514b5,null));};exports['test']=function(_0x329d7a,_0x1dab3d,_0xdc9dc7){var _0x4b2bd8;return db[_0xa112('0x2c')][_0xa112('0x48')]({'where':{'id':_0x329d7a[_0xa112('0x52')]['id']},'attributes':['id',_0xa112('0x53')]})[_0xa112('0x21')](handleEntityNotFound(_0x1dab3d,null))['then'](function(_0x4bff29){if(_0x4bff29){var _0x580093=require(_0xa112('0x54'))();_0x580093[_0xa112('0x55')](_0x4bff29['dsn']);_0x580093[_0xa112('0x56')]();return _0x4bff29;}})[_0xa112('0x21')](respondWithResult(_0x1dab3d,null))[_0xa112('0x44')](handleError(_0x1dab3d,null));}; \ No newline at end of file +var _0xbc15=['apply','reject','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','key','map','query','keys','attributes','intersection','model','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','fields','options','find','create','body','user','role','ODBC','UserProfileSection','userProfileId','autoAssociation','test','dsn','openSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','to-csv','ejs','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','json','offset','limit','set'];(function(_0x470e72,_0x532a0e){var _0x3386f9=function(_0x3b96be){while(--_0x3b96be){_0x470e72['push'](_0x470e72['shift']());}};_0x3386f9(++_0x532a0e);}(_0xbc15,0xd2));var _0x5bc1=function(_0xe7d9a4,_0xc0a4cb){_0xe7d9a4=_0xe7d9a4-0x0;var _0x470875=_0xbc15[_0xe7d9a4];return _0x470875;};'use strict';var pdf=require(_0x5bc1('0x0'));var emlformat=require(_0x5bc1('0x1'));var rimraf=require(_0x5bc1('0x2'));var zipdir=require(_0x5bc1('0x3'));var jsonpatch=require(_0x5bc1('0x4'));var rp=require(_0x5bc1('0x5'));var moment=require('moment');var BPromise=require(_0x5bc1('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x5bc1('0x7'));var ejs=require(_0x5bc1('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5bc1('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x5bc1('0x7'));var querystring=require(_0x5bc1('0xa'));var Papa=require(_0x5bc1('0xb'));var Redis=require(_0x5bc1('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x5bc1('0xd'));var as=require(_0x5bc1('0xe'));var hardwareService=require(_0x5bc1('0xf'));var logger=require(_0x5bc1('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5bc1('0x11'))['db'];function respondWithStatusCode(_0x142259,_0x288667){_0x288667=_0x288667||0xcc;return function(_0x10e48c){if(_0x10e48c){return _0x142259[_0x5bc1('0x12')](_0x288667);}return _0x142259['status'](_0x288667)['end']();};}function respondWithResult(_0x4a9180,_0x31d719){_0x31d719=_0x31d719||0xc8;return function(_0x9882e1){if(_0x9882e1){return _0x4a9180[_0x5bc1('0x13')](_0x31d719)[_0x5bc1('0x14')](_0x9882e1);}};}function respondWithFilteredResult(_0x5b355a,_0x3d9d08){return function(_0x2aef42){if(_0x2aef42){var _0x19b1b2=_0x2aef42['count'],_0x1fbdfa=_0x3d9d08[_0x5bc1('0x15')],_0x491a70=_0x3d9d08[_0x5bc1('0x15')]+_0x3d9d08[_0x5bc1('0x16')],_0x536421;if(_0x491a70>=_0x19b1b2){_0x491a70=_0x19b1b2;_0x536421=0xc8;}else{_0x536421=0xce;}_0x5b355a[_0x5bc1('0x13')](_0x536421);return _0x5b355a[_0x5bc1('0x17')]('Content-Range',_0x1fbdfa+'-'+_0x491a70+'/'+_0x19b1b2)[_0x5bc1('0x14')](_0x2aef42);}return null;};}function patchUpdates(_0xc78e64){return function(_0x1b8b85){try{jsonpatch[_0x5bc1('0x18')](_0x1b8b85,_0xc78e64,!![]);}catch(_0xb2c736){return BPromise[_0x5bc1('0x19')](_0xb2c736);}return _0x1b8b85['save']();};}function saveUpdates(_0xb3488f,_0x365608){return function(_0x48fbe8){if(_0x48fbe8){return _0x48fbe8[_0x5bc1('0x1a')](_0xb3488f)[_0x5bc1('0x1b')](function(_0x616cea){return _0x616cea;});}return null;};}function removeEntity(_0x2cc180,_0x2434f1){return function(_0x5dc00c){if(_0x5dc00c){return _0x5dc00c['destroy']()[_0x5bc1('0x1b')](function(){var _0x462851=_0x5dc00c[_0x5bc1('0x1c')]({'plain':!![]});var _0x44bf8d='ODBC';return db[_0x5bc1('0x1d')][_0x5bc1('0x1e')]({'where':{'type':_0x44bf8d,'resourceId':_0x462851['id']}})[_0x5bc1('0x1b')](function(){return _0x5dc00c;});})['then'](function(){_0x2cc180['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x271d46,_0x91f429){return function(_0x1afb5d){if(!_0x1afb5d){_0x271d46[_0x5bc1('0x12')](0x194);}return _0x1afb5d;};}function handleError(_0x4df240,_0x58cee9){_0x58cee9=_0x58cee9||0x1f4;return function(_0x3e7375){logger[_0x5bc1('0x1f')](_0x3e7375[_0x5bc1('0x20')]);if(_0x3e7375[_0x5bc1('0x21')]){delete _0x3e7375['name'];}_0x4df240[_0x5bc1('0x13')](_0x58cee9)[_0x5bc1('0x22')](_0x3e7375);};}exports[_0x5bc1('0x23')]=function(_0x340519,_0x2d3971){var _0x5f1655={},_0x2df0e1={},_0x37d336={'count':0x0,'rows':[]};var _0x4c4db1=_['map'](db[_0x5bc1('0x24')][_0x5bc1('0x25')],function(_0xfdcb97){return{'name':_0xfdcb97[_0x5bc1('0x26')],'type':_0xfdcb97[_0x5bc1('0x27')][_0x5bc1('0x28')]};});_0x2df0e1['model']=_[_0x5bc1('0x29')](_0x4c4db1,'name');_0x2df0e1[_0x5bc1('0x2a')]=_[_0x5bc1('0x2b')](_0x340519[_0x5bc1('0x2a')]);_0x2df0e1['filters']=_['intersection'](_0x2df0e1['model'],_0x2df0e1[_0x5bc1('0x2a')]);_0x5f1655[_0x5bc1('0x2c')]=_[_0x5bc1('0x2d')](_0x2df0e1[_0x5bc1('0x2e')],qs['fields'](_0x340519['query']['fields']));_0x5f1655['attributes']=_0x5f1655['attributes'][_0x5bc1('0x2f')]?_0x5f1655[_0x5bc1('0x2c')]:_0x2df0e1[_0x5bc1('0x2e')];if(!_0x340519[_0x5bc1('0x2a')][_0x5bc1('0x30')](_0x5bc1('0x31'))){_0x5f1655[_0x5bc1('0x16')]=qs['limit'](_0x340519[_0x5bc1('0x2a')]['limit']);_0x5f1655[_0x5bc1('0x15')]=qs[_0x5bc1('0x15')](_0x340519[_0x5bc1('0x2a')][_0x5bc1('0x15')]);}_0x5f1655['order']=qs[_0x5bc1('0x32')](_0x340519['query'][_0x5bc1('0x32')]);_0x5f1655[_0x5bc1('0x33')]=qs[_0x5bc1('0x34')](_[_0x5bc1('0x35')](_0x340519[_0x5bc1('0x2a')],_0x2df0e1[_0x5bc1('0x34')]));if(_0x340519[_0x5bc1('0x2a')][_0x5bc1('0x36')]){_0x5f1655[_0x5bc1('0x33')]=_[_0x5bc1('0x37')](_0x5f1655[_0x5bc1('0x33')],{'$or':_[_0x5bc1('0x29')](_0x4c4db1,function(_0x3f3412){if(_0x3f3412[_0x5bc1('0x27')]!==_0x5bc1('0x38')){var _0x13d3b6={};_0x13d3b6[_0x3f3412[_0x5bc1('0x21')]]={'$like':'%'+_0x340519[_0x5bc1('0x2a')][_0x5bc1('0x36')]+'%'};return _0x13d3b6;}})});}_0x5f1655=_[_0x5bc1('0x37')]({},_0x5f1655,_0x340519['options']);var _0x30839b={'where':_0x5f1655[_0x5bc1('0x33')]};return db[_0x5bc1('0x24')]['count'](_0x30839b)['then'](function(_0x28215c){_0x37d336[_0x5bc1('0x39')]=_0x28215c;if(_0x340519[_0x5bc1('0x2a')][_0x5bc1('0x3a')]){_0x5f1655[_0x5bc1('0x3b')]=[{'all':!![]}];}return db[_0x5bc1('0x24')]['findAll'](_0x5f1655);})[_0x5bc1('0x1b')](function(_0x4225cf){_0x37d336[_0x5bc1('0x3c')]=_0x4225cf;return _0x37d336;})['then'](respondWithFilteredResult(_0x2d3971,_0x5f1655))[_0x5bc1('0x3d')](handleError(_0x2d3971,null));};exports[_0x5bc1('0x3e')]=function(_0x1bbdab,_0x14293e){var _0x129dc5={'raw':!![],'where':{'id':_0x1bbdab[_0x5bc1('0x3f')]['id']}},_0x228f44={};_0x228f44[_0x5bc1('0x2e')]=_[_0x5bc1('0x2b')](db['SquareOdbc'][_0x5bc1('0x25')]);_0x228f44[_0x5bc1('0x2a')]=_[_0x5bc1('0x2b')](_0x1bbdab[_0x5bc1('0x2a')]);_0x228f44[_0x5bc1('0x34')]=_[_0x5bc1('0x2d')](_0x228f44[_0x5bc1('0x2e')],_0x228f44[_0x5bc1('0x2a')]);_0x129dc5[_0x5bc1('0x2c')]=_[_0x5bc1('0x2d')](_0x228f44[_0x5bc1('0x2e')],qs[_0x5bc1('0x40')](_0x1bbdab[_0x5bc1('0x2a')]['fields']));_0x129dc5['attributes']=_0x129dc5[_0x5bc1('0x2c')][_0x5bc1('0x2f')]?_0x129dc5[_0x5bc1('0x2c')]:_0x228f44['model'];if(_0x1bbdab['query']['includeAll']){_0x129dc5[_0x5bc1('0x3b')]=[{'all':!![]}];}_0x129dc5=_[_0x5bc1('0x37')]({},_0x129dc5,_0x1bbdab[_0x5bc1('0x41')]);return db[_0x5bc1('0x24')][_0x5bc1('0x42')](_0x129dc5)[_0x5bc1('0x1b')](handleEntityNotFound(_0x14293e,null))[_0x5bc1('0x1b')](respondWithResult(_0x14293e,null))[_0x5bc1('0x3d')](handleError(_0x14293e,null));};exports[_0x5bc1('0x43')]=function(_0x3c84c3,_0x4add3f){return db[_0x5bc1('0x24')][_0x5bc1('0x43')](_0x3c84c3[_0x5bc1('0x44')],{})[_0x5bc1('0x1b')](function(_0x277f4a){var _0x2cbb52=_0x3c84c3[_0x5bc1('0x45')][_0x5bc1('0x1c')]({'plain':!![]});if(!_0x2cbb52)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cbb52[_0x5bc1('0x46')]==='user'){var _0x1bc760=_0x277f4a['get']({'plain':!![]});var _0x2de3b3=_0x5bc1('0x47');return db[_0x5bc1('0x48')][_0x5bc1('0x42')]({'where':{'name':_0x2de3b3,'userProfileId':_0x2cbb52[_0x5bc1('0x49')]},'raw':!![]})[_0x5bc1('0x1b')](function(_0x50877d){if(_0x50877d&&_0x50877d[_0x5bc1('0x4a')]===0x0){return db['UserProfileResource'][_0x5bc1('0x43')]({'name':_0x1bc760[_0x5bc1('0x21')],'resourceId':_0x1bc760['id'],'type':_0x50877d['name'],'sectionId':_0x50877d['id']},{})[_0x5bc1('0x1b')](function(){return _0x277f4a;});}else{return _0x277f4a;}})[_0x5bc1('0x3d')](function(_0x206b01){logger[_0x5bc1('0x1f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x206b01);throw _0x206b01;});}return _0x277f4a;})[_0x5bc1('0x1b')](respondWithResult(_0x4add3f,0xc9))[_0x5bc1('0x3d')](handleError(_0x4add3f,null));};exports[_0x5bc1('0x1a')]=function(_0x5802d4,_0x1e7813){if(_0x5802d4[_0x5bc1('0x44')]['id']){delete _0x5802d4['body']['id'];}return db[_0x5bc1('0x24')][_0x5bc1('0x42')]({'where':{'id':_0x5802d4[_0x5bc1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1e7813,null))[_0x5bc1('0x1b')](saveUpdates(_0x5802d4['body'],null))[_0x5bc1('0x1b')](respondWithResult(_0x1e7813,null))['catch'](handleError(_0x1e7813,null));};exports[_0x5bc1('0x1e')]=function(_0x25a9b4,_0x3f3025){return db[_0x5bc1('0x24')][_0x5bc1('0x42')]({'where':{'id':_0x25a9b4[_0x5bc1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3f3025,null))[_0x5bc1('0x1b')](removeEntity(_0x3f3025,null))['catch'](handleError(_0x3f3025,null));};exports[_0x5bc1('0x4b')]=function(_0x576d61,_0x544642,_0x332e3d){var _0x1752fb;return db[_0x5bc1('0x24')][_0x5bc1('0x42')]({'where':{'id':_0x576d61[_0x5bc1('0x3f')]['id']},'attributes':['id',_0x5bc1('0x4c')]})[_0x5bc1('0x1b')](handleEntityNotFound(_0x544642,null))[_0x5bc1('0x1b')](function(_0x281a2c){if(_0x281a2c){var _0x1bffce=require('odbc')();_0x1bffce[_0x5bc1('0x4d')](_0x281a2c[_0x5bc1('0x4c')]);_0x1bffce['closeSync']();return _0x281a2c;}})[_0x5bc1('0x1b')](respondWithResult(_0x544642,null))[_0x5bc1('0x3d')](handleError(_0x544642,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index c7d60b8..2f1f6ff 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 _0xfcef=['bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','moment'];(function(_0x584174,_0x2eab85){var _0x372a75=function(_0x2194a9){while(--_0x2194a9){_0x584174['push'](_0x584174['shift']());}};_0x372a75(++_0x2eab85);}(_0xfcef,0x74));var _0xffce=function(_0x2b9321,_0x28eddc){_0x2b9321=_0x2b9321-0x0;var _0x430a69=_0xfcef[_0x2b9321];return _0x430a69;};'use strict';var _=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var logger=require(_0xffce('0x2'))('api');var moment=require(_0xffce('0x3'));var BPromise=require(_0xffce('0x4'));var rp=require(_0xffce('0x5'));var fs=require('fs');var path=require(_0xffce('0x6'));var rimraf=require(_0xffce('0x7'));var config=require(_0xffce('0x8'));var attributes=require(_0xffce('0x9'));module['exports']=function(_0x263173,_0xa18bee){return _0x263173[_0xffce('0xa')]('SquareOdbc',attributes,{'tableName':_0xffce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xda16=['exports','define','square_odbc','lodash','util','../../config/logger','api','path','rimraf','../../config/environment'];(function(_0x16b6b7,_0x4e29df){var _0x16cb5e=function(_0x592213){while(--_0x592213){_0x16b6b7['push'](_0x16b6b7['shift']());}};_0x16cb5e(++_0x4e29df);}(_0xda16,0x1cf));var _0x6da1=function(_0x2de0d1,_0x2bb5e2){_0x2de0d1=_0x2de0d1-0x0;var _0x1c1cae=_0xda16[_0x2de0d1];return _0x1c1cae;};'use strict';var _=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var logger=require(_0x6da1('0x2'))(_0x6da1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6da1('0x4'));var rimraf=require(_0x6da1('0x5'));var config=require(_0x6da1('0x6'));var attributes=require('./squareOdbc.attributes');module[_0x6da1('0x7')]=function(_0xf0ed70,_0x41561a){return _0xf0ed70[_0x6da1('0x8')]('SquareOdbc',attributes,{'tableName':_0x6da1('0x9'),'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 d557906..b639ab4 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 _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x11d6c8,_0x3bb8e2){var _0x553f63=function(_0x326abe){while(--_0x326abe){_0x11d6c8['push'](_0x11d6c8['shift']());}};_0x553f63(++_0x3bb8e2);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x3e74=['catch','SquareOdbc','find','options','raw','where','attributes','include','map','model','then','ShowSquareOdbc','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','SquareOdbc,\x20%s,\x20%s','message','info'];(function(_0x1f3bfb,_0x2db1b1){var _0xb87807=function(_0x408d65){while(--_0x408d65){_0x1f3bfb['push'](_0x1f3bfb['shift']());}};_0xb87807(++_0x2db1b1);}(_0x3e74,0x175));var _0x43e7=function(_0x4e702a,_0x126054){_0x4e702a=_0x4e702a-0x0;var _0xb14d6b=_0x3e74[_0x4e702a];return _0xb14d6b;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('SquareOdbc,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowSquareOdbc']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 52938a4..094fb70 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 _0x4cf8=['put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','getUsers','create','post','/:id/users','addUsers'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5ef7b8,_0x15cc07){_0x5ef7b8=_0x5ef7b8-0x0;var _0x2c7148=_0x4cf8[_0x5ef7b8];return _0x2c7148;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var auth=require(_0x84cf('0x6'));var interaction=require(_0x84cf('0x7'));var config=require(_0x84cf('0x8'));var controller=require(_0x84cf('0x9'));router[_0x84cf('0xa')]('/',auth[_0x84cf('0xb')](),controller['index']);router['get'](_0x84cf('0xc'),auth['isAuthenticated'](),controller[_0x84cf('0xd')]);router[_0x84cf('0xa')]('/:id/users',auth[_0x84cf('0xb')](),controller[_0x84cf('0xe')]);router['post']('/',auth[_0x84cf('0xb')](),controller[_0x84cf('0xf')]);router[_0x84cf('0x10')](_0x84cf('0x11'),auth['isAuthenticated'](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x84cf('0x14')]);router[_0x84cf('0x15')](_0x84cf('0xc'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x16')]);router[_0x84cf('0x15')](_0x84cf('0x11'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x17')]);module[_0x84cf('0x18')]=router; \ No newline at end of file +var _0x9ffd=['destroy','removeUsers','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','index','/:id','isAuthenticated','show','/:id/users','getUsers','addUsers','put','update','delete'];(function(_0x51b21b,_0x564cde){var _0x2efe75=function(_0x4d1390){while(--_0x4d1390){_0x51b21b['push'](_0x51b21b['shift']());}};_0x2efe75(++_0x564cde);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x511201,_0xb61bd2){_0x511201=_0x511201-0x0;var _0x95b491=_0x9ffd[_0x511201];return _0x95b491;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var auth=require(_0xd9ff('0x5'));var interaction=require(_0xd9ff('0x6'));var config=require('../../config/environment');var controller=require(_0xd9ff('0x7'));router[_0xd9ff('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9ff('0x9')]);router[_0xd9ff('0x8')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0x8')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x12')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 708727c..b85b531 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 _0xd803=['sequelize','exports','STRING','BLOB','long','getDataValue','preproduction','utf8','production'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xd803,0x14d));var _0x3d80=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xd803[_0x312abc];return _0x314298;};'use strict';var Sequelize=require(_0x3d80('0x0'));module[_0x3d80('0x1')]={'name':{'type':Sequelize[_0x3d80('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3d80('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x3d80('0x3')](_0x3d80('0x4')),'get':function(){if(this[_0x3d80('0x5')](_0x3d80('0x6'))){return this['getDataValue'](_0x3d80('0x6'))['toString'](_0x3d80('0x7'));}}},'production':{'type':Sequelize[_0x3d80('0x3')](_0x3d80('0x4')),'get':function(){if(this[_0x3d80('0x5')](_0x3d80('0x8'))){return this['getDataValue'](_0x3d80('0x8'))['toString'](_0x3d80('0x7'));}}}}; \ No newline at end of file +var _0x1282=['TEXT','long','getDataValue','BLOB','production','toString','sequelize','exports','STRING','name'];(function(_0x268601,_0x1c836a){var _0xae412c=function(_0x17f33d){while(--_0x17f33d){_0x268601['push'](_0x268601['shift']());}};_0xae412c(++_0x1c836a);}(_0x1282,0xb0));var _0x2128=function(_0xef8c9e,_0x5a64fd){_0xef8c9e=_0xef8c9e-0x0;var _0xb36aea=_0x1282[_0xef8c9e];return _0xb36aea;};'use strict';var Sequelize=require(_0x2128('0x0'));module[_0x2128('0x1')]={'name':{'type':Sequelize[_0x2128('0x2')],'unique':_0x2128('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2128('0x2')]},'notes':{'type':Sequelize[_0x2128('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x2128('0x5')),'get':function(){if(this[_0x2128('0x6')]('preproduction')){return this[_0x2128('0x6')]('preproduction')['toString']('utf8');}}},'production':{'type':Sequelize[_0x2128('0x7')]('long'),'get':function(){if(this[_0x2128('0x6')](_0x2128('0x8'))){return this[_0x2128('0x6')](_0x2128('0x8'))[_0x2128('0x9')]('utf8');}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 3ba52a3..1e3544d 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 _0x702d=['include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','json','count','offset','limit','status','set','apply','reject','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','SquareProject','rawAttributes','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x702d,0x147));var _0xd702=function(_0x571f54,_0x73367b){_0x571f54=_0x571f54-0x0;var _0x2dd534=_0x702d[_0x571f54];return _0x2dd534;};'use strict';var pdf=require(_0xd702('0x0'));var emlformat=require(_0xd702('0x1'));var rimraf=require(_0xd702('0x2'));var zipdir=require(_0xd702('0x3'));var jsonpatch=require(_0xd702('0x4'));var rp=require('request-promise');var moment=require(_0xd702('0x5'));var BPromise=require(_0xd702('0x6'));var Mustache=require(_0xd702('0x7'));var util=require(_0xd702('0x8'));var path=require('path');var sox=require(_0xd702('0x9'));var csv=require('to-csv');var ejs=require(_0xd702('0xa'));var fs=require('fs');var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0xe'));var querystring=require(_0xd702('0xf'));var Papa=require(_0xd702('0x10'));var Redis=require(_0xd702('0x11'));var authService=require(_0xd702('0x12'));var qs=require(_0xd702('0x13'));var as=require(_0xd702('0x14'));var hardwareService=require(_0xd702('0x15'));var logger=require(_0xd702('0x16'))(_0xd702('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd702('0x18'))['db'];config[_0xd702('0x19')]=_[_0xd702('0x1a')](config['redis'],{'host':_0xd702('0x1b'),'port':0x18eb});var socket=require(_0xd702('0x1c'))(new Redis(config[_0xd702('0x19')]));require(_0xd702('0x1d'))[_0xd702('0x1e')](socket);function respondWithStatusCode(_0x181ff2,_0x59dd33){_0x59dd33=_0x59dd33||0xcc;return function(_0x2f26b9){if(_0x2f26b9){return _0x181ff2[_0xd702('0x1f')](_0x59dd33);}return _0x181ff2['status'](_0x59dd33)[_0xd702('0x20')]();};}function respondWithResult(_0x4922f8,_0x268c66){_0x268c66=_0x268c66||0xc8;return function(_0x210c32){if(_0x210c32){return _0x4922f8['status'](_0x268c66)[_0xd702('0x21')](_0x210c32);}};}function respondWithFilteredResult(_0x2f3e1f,_0x2a87f2){return function(_0x4fdbbd){if(_0x4fdbbd){var _0x5b3b1d=_0x4fdbbd[_0xd702('0x22')],_0x2205de=_0x2a87f2[_0xd702('0x23')],_0x5a296e=_0x2a87f2[_0xd702('0x23')]+_0x2a87f2[_0xd702('0x24')],_0x3fbcec;if(_0x5a296e>=_0x5b3b1d){_0x5a296e=_0x5b3b1d;_0x3fbcec=0xc8;}else{_0x3fbcec=0xce;}_0x2f3e1f[_0xd702('0x25')](_0x3fbcec);return _0x2f3e1f[_0xd702('0x26')]('Content-Range',_0x2205de+'-'+_0x5a296e+'/'+_0x5b3b1d)['json'](_0x4fdbbd);}return null;};}function patchUpdates(_0x536ca8){return function(_0x55516e){try{jsonpatch[_0xd702('0x27')](_0x55516e,_0x536ca8,!![]);}catch(_0x5cbff4){return BPromise[_0xd702('0x28')](_0x5cbff4);}return _0x55516e['save']();};}function saveUpdates(_0xc4c246,_0x5824ec){return function(_0x5e8d61){if(_0x5e8d61){return _0x5e8d61['update'](_0xc4c246)[_0xd702('0x29')](function(_0xeec2e4){return _0xeec2e4;});}return null;};}function removeEntity(_0x459184,_0x49761c){return function(_0x1f0c44){if(_0x1f0c44){return _0x1f0c44[_0xd702('0x2a')]()[_0xd702('0x29')](function(){var _0x2eaa03=_0x1f0c44[_0xd702('0x2b')]({'plain':!![]});var _0x146f35=_0xd702('0x2c');return db[_0xd702('0x2d')][_0xd702('0x2a')]({'where':{'type':_0x146f35,'resourceId':_0x2eaa03['id']}})['then'](function(){return _0x1f0c44;});})[_0xd702('0x29')](function(){_0x459184[_0xd702('0x25')](0xcc)[_0xd702('0x20')]();});}};}function handleEntityNotFound(_0x335202,_0xbe4518){return function(_0x38505d){if(!_0x38505d){_0x335202[_0xd702('0x1f')](0x194);}return _0x38505d;};}function handleError(_0x22441b,_0x5f1084){_0x5f1084=_0x5f1084||0x1f4;return function(_0x47c9a2){logger[_0xd702('0x2e')](_0x47c9a2[_0xd702('0x2f')]);if(_0x47c9a2['name']){delete _0x47c9a2[_0xd702('0x30')];}_0x22441b[_0xd702('0x25')](_0x5f1084)[_0xd702('0x31')](_0x47c9a2);};}exports[_0xd702('0x32')]=function(_0x56e9cd,_0x213c31){var _0x313281={},_0x1630ed={},_0x43fe18={'count':0x0,'rows':[]};var _0x3baedf=_['map'](db[_0xd702('0x33')][_0xd702('0x34')],function(_0x21ae67){return{'name':_0x21ae67['fieldName'],'type':_0x21ae67[_0xd702('0x35')]['key']};});_0x1630ed['model']=_[_0xd702('0x36')](_0x3baedf,_0xd702('0x30'));_0x1630ed[_0xd702('0x37')]=_['keys'](_0x56e9cd[_0xd702('0x37')]);_0x1630ed[_0xd702('0x38')]=_['intersection'](_0x1630ed[_0xd702('0x39')],_0x1630ed[_0xd702('0x37')]);_0x313281[_0xd702('0x3a')]=_[_0xd702('0x3b')](_0x1630ed[_0xd702('0x39')],qs[_0xd702('0x3c')](_0x56e9cd[_0xd702('0x37')][_0xd702('0x3c')]));_0x313281[_0xd702('0x3a')]=_0x313281[_0xd702('0x3a')][_0xd702('0x3d')]?_0x313281[_0xd702('0x3a')]:_0x1630ed[_0xd702('0x39')];if(!_0x56e9cd['query'][_0xd702('0x3e')](_0xd702('0x3f'))){_0x313281[_0xd702('0x24')]=qs[_0xd702('0x24')](_0x56e9cd[_0xd702('0x37')][_0xd702('0x24')]);_0x313281[_0xd702('0x23')]=qs['offset'](_0x56e9cd['query'][_0xd702('0x23')]);}_0x313281[_0xd702('0x40')]=qs['sort'](_0x56e9cd['query'][_0xd702('0x41')]);_0x313281[_0xd702('0x42')]=qs['filters'](_[_0xd702('0x43')](_0x56e9cd[_0xd702('0x37')],_0x1630ed[_0xd702('0x38')]));if(_0x56e9cd['query'][_0xd702('0x44')]){_0x313281[_0xd702('0x42')]=_[_0xd702('0x45')](_0x313281['where'],{'$or':_[_0xd702('0x36')](_0x3baedf,function(_0x512854){if(_0x512854[_0xd702('0x35')]!==_0xd702('0x46')){var _0x1ba18e={};_0x1ba18e[_0x512854[_0xd702('0x30')]]={'$like':'%'+_0x56e9cd[_0xd702('0x37')][_0xd702('0x44')]+'%'};return _0x1ba18e;}})});}_0x313281=_[_0xd702('0x45')]({},_0x313281,_0x56e9cd[_0xd702('0x47')]);var _0x5ad70f={'where':_0x313281[_0xd702('0x42')]};return db[_0xd702('0x33')][_0xd702('0x22')](_0x5ad70f)[_0xd702('0x29')](function(_0x11cc81){_0x43fe18['count']=_0x11cc81;if(_0x56e9cd[_0xd702('0x37')][_0xd702('0x48')]){_0x313281[_0xd702('0x49')]=[{'all':!![]}];}return db['SquareProject'][_0xd702('0x4a')](_0x313281);})[_0xd702('0x29')](function(_0x283d8c){_0x43fe18[_0xd702('0x4b')]=_0x283d8c;return _0x43fe18;})['then'](respondWithFilteredResult(_0x213c31,_0x313281))[_0xd702('0x4c')](handleError(_0x213c31,null));};exports[_0xd702('0x4d')]=function(_0x1743bd,_0x3579ea){var _0x185e4a={'raw':![],'where':{'id':_0x1743bd[_0xd702('0x4e')]['id']}},_0x564974={};_0x564974[_0xd702('0x39')]=_['keys'](db['SquareProject'][_0xd702('0x34')]);_0x564974[_0xd702('0x37')]=_[_0xd702('0x4f')](_0x1743bd[_0xd702('0x37')]);_0x564974[_0xd702('0x38')]=_[_0xd702('0x3b')](_0x564974[_0xd702('0x39')],_0x564974[_0xd702('0x37')]);_0x185e4a[_0xd702('0x3a')]=_['intersection'](_0x564974['model'],qs[_0xd702('0x3c')](_0x1743bd['query'][_0xd702('0x3c')]));_0x185e4a['attributes']=_0x185e4a[_0xd702('0x3a')]['length']?_0x185e4a[_0xd702('0x3a')]:_0x564974['model'];if(_0x1743bd[_0xd702('0x37')][_0xd702('0x48')]){_0x185e4a['include']=[{'all':!![]}];}_0x185e4a=_[_0xd702('0x45')]({},_0x185e4a,_0x1743bd[_0xd702('0x47')]);return db[_0xd702('0x33')][_0xd702('0x50')](_0x185e4a)[_0xd702('0x29')](handleEntityNotFound(_0x3579ea,null))['then'](respondWithResult(_0x3579ea,null))[_0xd702('0x4c')](handleError(_0x3579ea,null));};exports[_0xd702('0x51')]=function(_0x2d09be,_0x59bc33){return db[_0xd702('0x33')]['create'](_0x2d09be[_0xd702('0x52')],{})[_0xd702('0x29')](function(_0x1bd39e){var _0x55282d=_0x2d09be['user'][_0xd702('0x2b')]({'plain':!![]});if(!_0x55282d)throw new Error(_0xd702('0x53'));if(_0x55282d[_0xd702('0x54')]===_0xd702('0x55')){var _0x16e59b=_0x1bd39e[_0xd702('0x2b')]({'plain':!![]});var _0x3efa03=_0xd702('0x2c');return db[_0xd702('0x56')][_0xd702('0x50')]({'where':{'name':_0x3efa03,'userProfileId':_0x55282d['userProfileId']},'raw':!![]})['then'](function(_0x2980d5){if(_0x2980d5&&_0x2980d5[_0xd702('0x57')]===0x0){return db[_0xd702('0x2d')]['create']({'name':_0x16e59b['name'],'resourceId':_0x16e59b['id'],'type':_0x2980d5[_0xd702('0x30')],'sectionId':_0x2980d5['id']},{})['then'](function(){return _0x1bd39e;});}else{return _0x1bd39e;}})[_0xd702('0x4c')](function(_0x6a1ba){logger[_0xd702('0x2e')](_0xd702('0x58'),_0x6a1ba);throw _0x6a1ba;});}return _0x1bd39e;})[_0xd702('0x29')](respondWithResult(_0x59bc33,0xc9))[_0xd702('0x4c')](handleError(_0x59bc33,null));};exports[_0xd702('0x59')]=function(_0x2863a3,_0x3ae4ab){if(_0x2863a3['body']['id']){delete _0x2863a3[_0xd702('0x52')]['id'];}return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x2863a3[_0xd702('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ae4ab,null))[_0xd702('0x29')](saveUpdates(_0x2863a3['body'],null))[_0xd702('0x29')](respondWithResult(_0x3ae4ab,null))['catch'](handleError(_0x3ae4ab,null));};exports['destroy']=function(_0x2a31c0,_0x2351af){return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x2a31c0[_0xd702('0x4e')]['id']}})[_0xd702('0x29')](handleEntityNotFound(_0x2351af,null))['then'](removeEntity(_0x2351af,null))[_0xd702('0x4c')](handleError(_0x2351af,null));};exports[_0xd702('0x5a')]=function(_0x55719b,_0x3a6012,_0x316520){return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x55719b[_0xd702('0x4e')]['id']}})[_0xd702('0x29')](handleEntityNotFound(_0x3a6012,null))['then'](function(_0x2186e7){if(_0x2186e7){return _0x2186e7[_0xd702('0x5a')](_0x55719b[_0xd702('0x52')][_0xd702('0x5b')],_[_0xd702('0x5c')](_0x55719b['body'],['ids','id'])||{});}})[_0xd702('0x29')](respondWithResult(_0x3a6012,null))['catch'](handleError(_0x3a6012,null));};exports['removeUsers']=function(_0x2fa2c7,_0x48e348,_0x2a30cf){return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x2fa2c7[_0xd702('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48e348,null))[_0xd702('0x29')](function(_0x5cf316){if(_0x5cf316){return _0x5cf316[_0xd702('0x5d')](_0x2fa2c7['query'][_0xd702('0x5b')])[_0xd702('0x29')](function(){if(_[_0xd702('0x5e')](_0x2fa2c7[_0xd702('0x37')][_0xd702('0x5b')])){for(var _0x1b9588=0x0;_0x1b9588<_0x2fa2c7[_0xd702('0x37')]['ids']['length'];_0x1b9588+=0x1){socket[_0xd702('0x5f')]('userSquareProject:remove',{'UserId':Number(_0x2fa2c7[_0xd702('0x37')][_0xd702('0x5b')][_0x1b9588]),'SquareProjectId':Number(_0x2fa2c7['params']['id'])});}}else{socket[_0xd702('0x5f')](_0xd702('0x60'),{'UserId':Number(_0x2fa2c7['query'][_0xd702('0x5b')]),'SquareProjectId':Number(_0x2fa2c7['params']['id'])});}});}})[_0xd702('0x29')](respondWithStatusCode(_0x48e348,null))[_0xd702('0x4c')](handleError(_0x48e348,null));};exports[_0xd702('0x61')]=function(_0xc9611d,_0x4a570f,_0x476480){var _0x3777ae={};var _0x35740d={};var _0x2106d0;var _0x36a782;return db['SquareProject'][_0xd702('0x62')]({'where':{'id':_0xc9611d[_0xd702('0x4e')]['id']}})[_0xd702('0x29')](handleEntityNotFound(_0x4a570f,null))[_0xd702('0x29')](function(_0x29fc86){if(_0x29fc86){_0x2106d0=_0x29fc86;_0x35740d[_0xd702('0x39')]=_['keys'](db[_0xd702('0x63')]['rawAttributes']);_0x35740d[_0xd702('0x37')]=_[_0xd702('0x4f')](_0xc9611d[_0xd702('0x37')]);_0x35740d[_0xd702('0x38')]=_['intersection'](_0x35740d[_0xd702('0x39')],_0x35740d[_0xd702('0x37')]);_0x3777ae[_0xd702('0x3a')]=_[_0xd702('0x3b')](_0x35740d[_0xd702('0x39')],qs['fields'](_0xc9611d['query'][_0xd702('0x3c')]));_0x3777ae[_0xd702('0x3a')]=_0x3777ae[_0xd702('0x3a')][_0xd702('0x3d')]?_0x3777ae[_0xd702('0x3a')]:_0x35740d[_0xd702('0x39')];_0x3777ae[_0xd702('0x40')]=qs[_0xd702('0x41')](_0xc9611d[_0xd702('0x37')][_0xd702('0x41')]);_0x3777ae[_0xd702('0x42')]=qs[_0xd702('0x38')](_[_0xd702('0x43')](_0xc9611d[_0xd702('0x37')],_0x35740d[_0xd702('0x38')]));if(_0xc9611d[_0xd702('0x37')]['filter']){_0x3777ae[_0xd702('0x42')]=_['merge'](_0x3777ae['where'],{'$or':_[_0xd702('0x36')](_0x3777ae['attributes'],function(_0x8f6104){var _0x2cfc2c={};_0x2cfc2c[_0x8f6104]={'$like':'%'+_0xc9611d[_0xd702('0x37')][_0xd702('0x44')]+'%'};return _0x2cfc2c;})});}_0x3777ae=_[_0xd702('0x45')]({},_0x3777ae,_0xc9611d[_0xd702('0x47')]);return _0x2106d0[_0xd702('0x61')](_0x3777ae);}})[_0xd702('0x29')](function(_0x408f2d){if(_0x408f2d){_0x36a782=_0x408f2d[_0xd702('0x3d')];if(!_0xc9611d[_0xd702('0x37')][_0xd702('0x3e')](_0xd702('0x3f'))){_0x3777ae[_0xd702('0x24')]=qs[_0xd702('0x24')](_0xc9611d[_0xd702('0x37')][_0xd702('0x24')]);_0x3777ae[_0xd702('0x23')]=qs[_0xd702('0x23')](_0xc9611d['query'][_0xd702('0x23')]);}return _0x2106d0[_0xd702('0x61')](_0x3777ae);}})[_0xd702('0x29')](function(_0x2d8a0b){if(_0x2d8a0b){return _0x2d8a0b?{'count':_0x36a782,'rows':_0x2d8a0b}:null;}})[_0xd702('0x29')](respondWithResult(_0x4a570f,null))['catch'](handleError(_0x4a570f,null));}; \ No newline at end of file +var _0x44a3=['SquareProject','includeAll','findAll','rows','catch','show','params','keys','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','nolimit','getUsers','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','get','SquareProjects','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options'];(function(_0x2ccbd3,_0x1b7ec6){var _0x19141b=function(_0x422077){while(--_0x422077){_0x2ccbd3['push'](_0x2ccbd3['shift']());}};_0x19141b(++_0x1b7ec6);}(_0x44a3,0x1a9));var _0x344a=function(_0x35d775,_0x25431e){_0x35d775=_0x35d775-0x0;var _0x59384d=_0x44a3[_0x35d775];return _0x59384d;};'use strict';var pdf=require(_0x344a('0x0'));var emlformat=require(_0x344a('0x1'));var rimraf=require(_0x344a('0x2'));var zipdir=require(_0x344a('0x3'));var jsonpatch=require(_0x344a('0x4'));var rp=require(_0x344a('0x5'));var moment=require(_0x344a('0x6'));var BPromise=require(_0x344a('0x7'));var Mustache=require('mustache');var util=require(_0x344a('0x8'));var path=require(_0x344a('0x9'));var sox=require(_0x344a('0xa'));var csv=require(_0x344a('0xb'));var ejs=require(_0x344a('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x344a('0xd'));var toCsv=require(_0x344a('0xb'));var querystring=require(_0x344a('0xe'));var Papa=require(_0x344a('0xf'));var Redis=require(_0x344a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x344a('0x11'));var as=require(_0x344a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x344a('0x13'))('api');var utils=require(_0x344a('0x14'));var config=require('../../config/environment');var db=require(_0x344a('0x15'))['db'];config[_0x344a('0x16')]=_['defaults'](config['redis'],{'host':_0x344a('0x17'),'port':0x18eb});var socket=require(_0x344a('0x18'))(new Redis(config[_0x344a('0x16')]));require(_0x344a('0x19'))[_0x344a('0x1a')](socket);function respondWithStatusCode(_0x133ad4,_0x4ee562){_0x4ee562=_0x4ee562||0xcc;return function(_0x4032d7){if(_0x4032d7){return _0x133ad4[_0x344a('0x1b')](_0x4ee562);}return _0x133ad4[_0x344a('0x1c')](_0x4ee562)[_0x344a('0x1d')]();};}function respondWithResult(_0x58c8cd,_0x54a643){_0x54a643=_0x54a643||0xc8;return function(_0x3609ce){if(_0x3609ce){return _0x58c8cd[_0x344a('0x1c')](_0x54a643)[_0x344a('0x1e')](_0x3609ce);}};}function respondWithFilteredResult(_0x325051,_0x48b3ab){return function(_0x397de6){if(_0x397de6){var _0x277c06=_0x397de6[_0x344a('0x1f')],_0x49b55f=_0x48b3ab[_0x344a('0x20')],_0x9fe854=_0x48b3ab[_0x344a('0x20')]+_0x48b3ab[_0x344a('0x21')],_0x274016;if(_0x9fe854>=_0x277c06){_0x9fe854=_0x277c06;_0x274016=0xc8;}else{_0x274016=0xce;}_0x325051[_0x344a('0x1c')](_0x274016);return _0x325051[_0x344a('0x22')](_0x344a('0x23'),_0x49b55f+'-'+_0x9fe854+'/'+_0x277c06)[_0x344a('0x1e')](_0x397de6);}return null;};}function patchUpdates(_0x4b3552){return function(_0x16c0fe){try{jsonpatch[_0x344a('0x24')](_0x16c0fe,_0x4b3552,!![]);}catch(_0xe0bdd4){return BPromise[_0x344a('0x25')](_0xe0bdd4);}return _0x16c0fe[_0x344a('0x26')]();};}function saveUpdates(_0x80ae12,_0x185303){return function(_0x976bcf){if(_0x976bcf){return _0x976bcf[_0x344a('0x27')](_0x80ae12)[_0x344a('0x28')](function(_0x90070c){return _0x90070c;});}return null;};}function removeEntity(_0x3b2ab9,_0x5ce9da){return function(_0x266fce){if(_0x266fce){return _0x266fce['destroy']()[_0x344a('0x28')](function(){var _0x5bb9b0=_0x266fce[_0x344a('0x29')]({'plain':!![]});var _0x484f97=_0x344a('0x2a');return db[_0x344a('0x2b')][_0x344a('0x2c')]({'where':{'type':_0x484f97,'resourceId':_0x5bb9b0['id']}})[_0x344a('0x28')](function(){return _0x266fce;});})[_0x344a('0x28')](function(){_0x3b2ab9[_0x344a('0x1c')](0xcc)[_0x344a('0x1d')]();});}};}function handleEntityNotFound(_0x114637,_0x4f2499){return function(_0x283f63){if(!_0x283f63){_0x114637[_0x344a('0x1b')](0x194);}return _0x283f63;};}function handleError(_0x26cf51,_0xc02d6){_0xc02d6=_0xc02d6||0x1f4;return function(_0x14bd54){logger[_0x344a('0x2d')](_0x14bd54['stack']);if(_0x14bd54[_0x344a('0x2e')]){delete _0x14bd54['name'];}_0x26cf51['status'](_0xc02d6)[_0x344a('0x2f')](_0x14bd54);};}exports[_0x344a('0x30')]=function(_0x5a36bb,_0x4803db){var _0x5cd9c6={},_0x5cafd2={},_0x16f490={'count':0x0,'rows':[]};var _0x23c484=_[_0x344a('0x31')](db['SquareProject'][_0x344a('0x32')],function(_0x32e78f){return{'name':_0x32e78f[_0x344a('0x33')],'type':_0x32e78f[_0x344a('0x34')][_0x344a('0x35')]};});_0x5cafd2[_0x344a('0x36')]=_[_0x344a('0x31')](_0x23c484,'name');_0x5cafd2[_0x344a('0x37')]=_['keys'](_0x5a36bb['query']);_0x5cafd2['filters']=_[_0x344a('0x38')](_0x5cafd2[_0x344a('0x36')],_0x5cafd2[_0x344a('0x37')]);_0x5cd9c6[_0x344a('0x39')]=_[_0x344a('0x38')](_0x5cafd2[_0x344a('0x36')],qs['fields'](_0x5a36bb[_0x344a('0x37')][_0x344a('0x3a')]));_0x5cd9c6[_0x344a('0x39')]=_0x5cd9c6['attributes'][_0x344a('0x3b')]?_0x5cd9c6[_0x344a('0x39')]:_0x5cafd2[_0x344a('0x36')];if(!_0x5a36bb[_0x344a('0x37')][_0x344a('0x3c')]('nolimit')){_0x5cd9c6[_0x344a('0x21')]=qs[_0x344a('0x21')](_0x5a36bb[_0x344a('0x37')][_0x344a('0x21')]);_0x5cd9c6[_0x344a('0x20')]=qs['offset'](_0x5a36bb[_0x344a('0x37')][_0x344a('0x20')]);}_0x5cd9c6[_0x344a('0x3d')]=qs[_0x344a('0x3e')](_0x5a36bb[_0x344a('0x37')]['sort']);_0x5cd9c6[_0x344a('0x3f')]=qs[_0x344a('0x40')](_[_0x344a('0x41')](_0x5a36bb[_0x344a('0x37')],_0x5cafd2[_0x344a('0x40')]));if(_0x5a36bb[_0x344a('0x37')][_0x344a('0x42')]){_0x5cd9c6[_0x344a('0x3f')]=_['merge'](_0x5cd9c6[_0x344a('0x3f')],{'$or':_[_0x344a('0x31')](_0x23c484,function(_0x3d34c3){if(_0x3d34c3[_0x344a('0x34')]!==_0x344a('0x43')){var _0x54fc28={};_0x54fc28[_0x3d34c3[_0x344a('0x2e')]]={'$like':'%'+_0x5a36bb[_0x344a('0x37')][_0x344a('0x42')]+'%'};return _0x54fc28;}})});}_0x5cd9c6=_[_0x344a('0x44')]({},_0x5cd9c6,_0x5a36bb[_0x344a('0x45')]);var _0xc3e6c3={'where':_0x5cd9c6[_0x344a('0x3f')]};return db[_0x344a('0x46')][_0x344a('0x1f')](_0xc3e6c3)['then'](function(_0x115a9c){_0x16f490[_0x344a('0x1f')]=_0x115a9c;if(_0x5a36bb[_0x344a('0x37')][_0x344a('0x47')]){_0x5cd9c6['include']=[{'all':!![]}];}return db[_0x344a('0x46')][_0x344a('0x48')](_0x5cd9c6);})[_0x344a('0x28')](function(_0x41f25b){_0x16f490[_0x344a('0x49')]=_0x41f25b;return _0x16f490;})[_0x344a('0x28')](respondWithFilteredResult(_0x4803db,_0x5cd9c6))[_0x344a('0x4a')](handleError(_0x4803db,null));};exports[_0x344a('0x4b')]=function(_0x483c39,_0x4509be){var _0x2de5aa={'raw':![],'where':{'id':_0x483c39[_0x344a('0x4c')]['id']}},_0x4cf8ef={};_0x4cf8ef[_0x344a('0x36')]=_['keys'](db[_0x344a('0x46')][_0x344a('0x32')]);_0x4cf8ef['query']=_[_0x344a('0x4d')](_0x483c39[_0x344a('0x37')]);_0x4cf8ef['filters']=_[_0x344a('0x38')](_0x4cf8ef[_0x344a('0x36')],_0x4cf8ef[_0x344a('0x37')]);_0x2de5aa['attributes']=_[_0x344a('0x38')](_0x4cf8ef['model'],qs[_0x344a('0x3a')](_0x483c39[_0x344a('0x37')][_0x344a('0x3a')]));_0x2de5aa[_0x344a('0x39')]=_0x2de5aa['attributes']['length']?_0x2de5aa[_0x344a('0x39')]:_0x4cf8ef[_0x344a('0x36')];if(_0x483c39[_0x344a('0x37')][_0x344a('0x47')]){_0x2de5aa[_0x344a('0x4e')]=[{'all':!![]}];}_0x2de5aa=_[_0x344a('0x44')]({},_0x2de5aa,_0x483c39[_0x344a('0x45')]);return db[_0x344a('0x46')][_0x344a('0x4f')](_0x2de5aa)[_0x344a('0x28')](handleEntityNotFound(_0x4509be,null))['then'](respondWithResult(_0x4509be,null))[_0x344a('0x4a')](handleError(_0x4509be,null));};exports[_0x344a('0x50')]=function(_0x6fad37,_0xbad7ca){return db['SquareProject'][_0x344a('0x50')](_0x6fad37['body'],{})['then'](function(_0xa6b6b5){var _0x240cb3=_0x6fad37['user'][_0x344a('0x29')]({'plain':!![]});if(!_0x240cb3)throw new Error(_0x344a('0x51'));if(_0x240cb3[_0x344a('0x52')]===_0x344a('0x53')){var _0x51e411=_0xa6b6b5[_0x344a('0x29')]({'plain':!![]});var _0xbcdcac=_0x344a('0x2a');return db[_0x344a('0x54')][_0x344a('0x4f')]({'where':{'name':_0xbcdcac,'userProfileId':_0x240cb3[_0x344a('0x55')]},'raw':!![]})[_0x344a('0x28')](function(_0xe9fc2b){if(_0xe9fc2b&&_0xe9fc2b[_0x344a('0x56')]===0x0){return db[_0x344a('0x2b')]['create']({'name':_0x51e411[_0x344a('0x2e')],'resourceId':_0x51e411['id'],'type':_0xe9fc2b['name'],'sectionId':_0xe9fc2b['id']},{})[_0x344a('0x28')](function(){return _0xa6b6b5;});}else{return _0xa6b6b5;}})[_0x344a('0x4a')](function(_0x1d2f7a){logger['error'](_0x344a('0x57'),_0x1d2f7a);throw _0x1d2f7a;});}return _0xa6b6b5;})[_0x344a('0x28')](respondWithResult(_0xbad7ca,0xc9))[_0x344a('0x4a')](handleError(_0xbad7ca,null));};exports[_0x344a('0x27')]=function(_0x346cf3,_0x35ccde){if(_0x346cf3[_0x344a('0x58')]['id']){delete _0x346cf3[_0x344a('0x58')]['id'];}return db[_0x344a('0x46')]['find']({'where':{'id':_0x346cf3[_0x344a('0x4c')]['id']}})[_0x344a('0x28')](handleEntityNotFound(_0x35ccde,null))[_0x344a('0x28')](saveUpdates(_0x346cf3[_0x344a('0x58')],null))[_0x344a('0x28')](respondWithResult(_0x35ccde,null))['catch'](handleError(_0x35ccde,null));};exports[_0x344a('0x2c')]=function(_0x163047,_0x1f3667){return db[_0x344a('0x46')]['find']({'where':{'id':_0x163047[_0x344a('0x4c')]['id']}})[_0x344a('0x28')](handleEntityNotFound(_0x1f3667,null))['then'](removeEntity(_0x1f3667,null))[_0x344a('0x4a')](handleError(_0x1f3667,null));};exports[_0x344a('0x59')]=function(_0x16482c,_0x2ea2ad,_0x2a8fc1){return db[_0x344a('0x46')][_0x344a('0x4f')]({'where':{'id':_0x16482c['params']['id']}})['then'](handleEntityNotFound(_0x2ea2ad,null))['then'](function(_0x41dc89){if(_0x41dc89){return _0x41dc89[_0x344a('0x59')](_0x16482c[_0x344a('0x58')][_0x344a('0x5a')],_['omit'](_0x16482c[_0x344a('0x58')],['ids','id'])||{});}})['then'](respondWithResult(_0x2ea2ad,null))['catch'](handleError(_0x2ea2ad,null));};exports['removeUsers']=function(_0x3d396b,_0x3e252f,_0x20665a){return db[_0x344a('0x46')]['find']({'where':{'id':_0x3d396b['params']['id']}})['then'](handleEntityNotFound(_0x3e252f,null))[_0x344a('0x28')](function(_0x9bc11f){if(_0x9bc11f){return _0x9bc11f[_0x344a('0x5b')](_0x3d396b[_0x344a('0x37')][_0x344a('0x5a')])['then'](function(){if(_[_0x344a('0x5c')](_0x3d396b[_0x344a('0x37')][_0x344a('0x5a')])){for(var _0x5673ef=0x0;_0x5673ef<_0x3d396b[_0x344a('0x37')]['ids']['length'];_0x5673ef+=0x1){socket[_0x344a('0x5d')]('userSquareProject:remove',{'UserId':Number(_0x3d396b['query'][_0x344a('0x5a')][_0x5673ef]),'SquareProjectId':Number(_0x3d396b[_0x344a('0x4c')]['id'])});}}else{socket['emit'](_0x344a('0x5e'),{'UserId':Number(_0x3d396b['query'][_0x344a('0x5a')]),'SquareProjectId':Number(_0x3d396b[_0x344a('0x4c')]['id'])});}});}})[_0x344a('0x28')](respondWithStatusCode(_0x3e252f,null))['catch'](handleError(_0x3e252f,null));};exports['getUsers']=function(_0x4f79da,_0x2e1342,_0xb4ddd7){var _0x393ca2={};var _0x5e300f={};var _0x4d8746;var _0x24bd35;return db[_0x344a('0x46')][_0x344a('0x5f')]({'where':{'id':_0x4f79da['params']['id']}})[_0x344a('0x28')](handleEntityNotFound(_0x2e1342,null))[_0x344a('0x28')](function(_0x5b1e0e){if(_0x5b1e0e){_0x4d8746=_0x5b1e0e;_0x5e300f[_0x344a('0x36')]=_['keys'](db[_0x344a('0x60')]['rawAttributes']);_0x5e300f['query']=_['keys'](_0x4f79da[_0x344a('0x37')]);_0x5e300f[_0x344a('0x40')]=_[_0x344a('0x38')](_0x5e300f[_0x344a('0x36')],_0x5e300f[_0x344a('0x37')]);_0x393ca2[_0x344a('0x39')]=_['intersection'](_0x5e300f[_0x344a('0x36')],qs[_0x344a('0x3a')](_0x4f79da[_0x344a('0x37')][_0x344a('0x3a')]));_0x393ca2[_0x344a('0x39')]=_0x393ca2['attributes'][_0x344a('0x3b')]?_0x393ca2[_0x344a('0x39')]:_0x5e300f['model'];_0x393ca2[_0x344a('0x3d')]=qs[_0x344a('0x3e')](_0x4f79da[_0x344a('0x37')][_0x344a('0x3e')]);_0x393ca2['where']=qs[_0x344a('0x40')](_[_0x344a('0x41')](_0x4f79da[_0x344a('0x37')],_0x5e300f[_0x344a('0x40')]));if(_0x4f79da[_0x344a('0x37')][_0x344a('0x42')]){_0x393ca2[_0x344a('0x3f')]=_[_0x344a('0x44')](_0x393ca2['where'],{'$or':_[_0x344a('0x31')](_0x393ca2[_0x344a('0x39')],function(_0x453134){var _0x12a9c7={};_0x12a9c7[_0x453134]={'$like':'%'+_0x4f79da[_0x344a('0x37')][_0x344a('0x42')]+'%'};return _0x12a9c7;})});}_0x393ca2=_[_0x344a('0x44')]({},_0x393ca2,_0x4f79da[_0x344a('0x45')]);return _0x4d8746['getUsers'](_0x393ca2);}})[_0x344a('0x28')](function(_0x425647){if(_0x425647){_0x24bd35=_0x425647[_0x344a('0x3b')];if(!_0x4f79da[_0x344a('0x37')]['hasOwnProperty'](_0x344a('0x61'))){_0x393ca2[_0x344a('0x21')]=qs[_0x344a('0x21')](_0x4f79da[_0x344a('0x37')][_0x344a('0x21')]);_0x393ca2[_0x344a('0x20')]=qs[_0x344a('0x20')](_0x4f79da[_0x344a('0x37')]['offset']);}return _0x4d8746[_0x344a('0x62')](_0x393ca2);}})[_0x344a('0x28')](function(_0x59b076){if(_0x59b076){return _0x59b076?{'count':_0x24bd35,'rows':_0x59b076}:null;}})[_0x344a('0x28')](respondWithResult(_0x2e1342,null))['catch'](handleError(_0x2e1342,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index d272021..c7db48f 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 _0x9dbd=['emit','hasOwnProperty','hook','exports','SquareProject','setMaxListeners','save','update','remove'];(function(_0x64c6e3,_0x3b5371){var _0x69c52f=function(_0x573d04){while(--_0x573d04){_0x64c6e3['push'](_0x64c6e3['shift']());}};_0x69c52f(++_0x3b5371);}(_0x9dbd,0xa6));var _0xd9db=function(_0x3a6b1f,_0x226951){_0x3a6b1f=_0x3a6b1f-0x0;var _0x225b9b=_0x9dbd[_0x3a6b1f];return _0x225b9b;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0xd9db('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd9db('0x1')](0x0);var events={'afterCreate':_0xd9db('0x2'),'afterUpdate':_0xd9db('0x3'),'afterDestroy':_0xd9db('0x4')};function emitEvent(_0x4075bc){return function(_0x4d4582,_0xc9d435,_0x13e062){SquareProjectEvents['emit'](_0x4075bc+':'+_0x4d4582['id'],_0x4d4582);SquareProjectEvents[_0xd9db('0x5')](_0x4075bc,_0x4d4582);_0x13e062(null);};}for(var e in events){if(events[_0xd9db('0x6')](e)){var event=events[e];SquareProject[_0xd9db('0x7')](e,emitEvent(event));}}module[_0xd9db('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x46b9=['emit','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x5431c8,_0x149f38){var _0x487711=function(_0x1a0e66){while(--_0x1a0e66){_0x5431c8['push'](_0x5431c8['shift']());}};_0x487711(++_0x149f38);}(_0x46b9,0x13e));var _0x946b=function(_0xda3235,_0x4164f1){_0xda3235=_0xda3235-0x0;var _0x38db4e=_0x46b9[_0xda3235];return _0x38db4e;};'use strict';var EventEmitter=require(_0x946b('0x0'));var SquareProject=require(_0x946b('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x946b('0x2')](0x0);var events={'afterCreate':_0x946b('0x3'),'afterUpdate':_0x946b('0x4'),'afterDestroy':_0x946b('0x5')};function emitEvent(_0x3dc4c6){return function(_0x37d427,_0x54859d,_0x298113){SquareProjectEvents[_0x946b('0x6')](_0x3dc4c6+':'+_0x37d427['id'],_0x37d427);SquareProjectEvents[_0x946b('0x6')](_0x3dc4c6,_0x37d427);_0x298113(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x946b('0x7')](e,emitEvent(event));}}module[_0x946b('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 9c995b6..7a71191 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 _0xde4b=['path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','lodash','api','moment','bluebird','request-promise'];(function(_0x4415e0,_0x5d1862){var _0x4d40dc=function(_0x4b1942){while(--_0x4b1942){_0x4415e0['push'](_0x4415e0['shift']());}};_0x4d40dc(++_0x5d1862);}(_0xde4b,0x8b));var _0xbde4=function(_0x198a7b,_0x53475c){_0x198a7b=_0x198a7b-0x0;var _0x443281=_0xde4b[_0x198a7b];return _0x443281;};'use strict';var _=require(_0xbde4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbde4('0x1'));var moment=require(_0xbde4('0x2'));var BPromise=require(_0xbde4('0x3'));var rp=require(_0xbde4('0x4'));var fs=require('fs');var path=require(_0xbde4('0x5'));var rimraf=require(_0xbde4('0x6'));var config=require(_0xbde4('0x7'));var attributes=require(_0xbde4('0x8'));module['exports']=function(_0x51c35d,_0x15249b){return _0x51c35d[_0xbde4('0x9')](_0xbde4('0xa'),attributes,{'tableName':_0xbde4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf64e=['rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x10218b,_0x3fe426){var _0x2be3c9=function(_0x56c82f){while(--_0x56c82f){_0x10218b['push'](_0x10218b['shift']());}};_0x2be3c9(++_0x3fe426);}(_0xf64e,0x1e6));var _0xef64=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xf64e[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require(_0xef64('0x0'));var logger=require(_0xef64('0x1'))('api');var moment=require(_0xef64('0x2'));var BPromise=require(_0xef64('0x3'));var rp=require(_0xef64('0x4'));var fs=require('fs');var path=require(_0xef64('0x5'));var rimraf=require(_0xef64('0x6'));var config=require(_0xef64('0x7'));var attributes=require(_0xef64('0x8'));module[_0xef64('0x9')]=function(_0x3e66fd,_0x793302){return _0x3e66fd[_0xef64('0xa')](_0xef64('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 5526452..4b361cd 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 _0x803f=['SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','ShowSquareProject','SquareProject','find','options','raw','map','include','model','attributes','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug'];(function(_0x54caea,_0x2b87fd){var _0x27eae6=function(_0x3e01db){while(--_0x3e01db){_0x54caea['push'](_0x54caea['shift']());}};_0x27eae6(++_0x2b87fd);}(_0x803f,0x18d));var _0xf803=function(_0x49ed14,_0x1216a4){_0x49ed14=_0x49ed14-0x0;var _0x46711b=_0x803f[_0x49ed14];return _0x46711b;};'use strict';var _=require('lodash');var util=require(_0xf803('0x0'));var moment=require(_0xf803('0x1'));var BPromise=require(_0xf803('0x2'));var rs=require(_0xf803('0x3'));var fs=require('fs');var Redis=require(_0xf803('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf803('0x5'));var logger=require(_0xf803('0x6'))(_0xf803('0x7'));var config=require(_0xf803('0x8'));var jayson=require(_0xf803('0x9'));var client=jayson[_0xf803('0xa')][_0xf803('0xb')]({'port':0x232a});config['redis']=_[_0xf803('0xc')](config['redis'],{'host':_0xf803('0xd'),'port':0x18eb});var socket=require(_0xf803('0xe'))(new Redis(config['redis']));require('./squareProject.socket')[_0xf803('0xf')](socket);function respondWithRpcPromise(_0x44518e,_0x30685c,_0x5d0b5e){return new BPromise(function(_0x4dea0a,_0x5f1976){return client[_0xf803('0x10')](_0x44518e,_0x5d0b5e)[_0xf803('0x11')](function(_0x9c685){logger[_0xf803('0x12')]('SquareProject,\x20%s,\x20%s',_0x30685c,_0xf803('0x13'));logger[_0xf803('0x14')](_0xf803('0x15'),_0x30685c,'request\x20sent',JSON[_0xf803('0x16')](_0x9c685));if(_0x9c685[_0xf803('0x17')]){if(_0x9c685[_0xf803('0x17')][_0xf803('0x18')]===0x1f4){logger[_0xf803('0x17')](_0xf803('0x19'),_0x30685c,_0x9c685[_0xf803('0x17')][_0xf803('0x1a')]);return _0x5f1976(_0x9c685[_0xf803('0x17')][_0xf803('0x1a')]);}logger[_0xf803('0x17')]('SquareProject,\x20%s,\x20%s',_0x30685c,_0x9c685[_0xf803('0x17')][_0xf803('0x1a')]);return _0x4dea0a(_0x9c685[_0xf803('0x17')]['message']);}else{logger[_0xf803('0x12')](_0xf803('0x19'),_0x30685c,_0xf803('0x13'));_0x4dea0a(_0x9c685[_0xf803('0x1b')][_0xf803('0x1a')]);}})['catch'](function(_0x3dfa25){logger['error'](_0xf803('0x19'),_0x30685c,_0x3dfa25);_0x5f1976(_0x3dfa25);});});}exports[_0xf803('0x1c')]=function(_0x5d8c4a){var _0x2fa79c=this;return new Promise(function(_0x2bf958,_0x3b8832){return db[_0xf803('0x1d')][_0xf803('0x1e')]({'raw':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a['options'][_0xf803('0x20')]===undefined?!![]:![]:!![],'where':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a[_0xf803('0x1f')]['where']||null:null,'attributes':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a[_0xf803('0x1f')]['attributes']||null:null,'include':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a[_0xf803('0x1f')]['include']?_[_0xf803('0x21')](_0x5d8c4a[_0xf803('0x1f')]['include'],function(_0xfd860c){return{'model':db[_0xfd860c['model']],'as':_0xfd860c['as'],'attributes':_0xfd860c['attributes'],'include':_0xfd860c[_0xf803('0x22')]?_[_0xf803('0x21')](_0xfd860c['include'],function(_0x4d7ea0){return{'model':db[_0x4d7ea0[_0xf803('0x23')]],'as':_0x4d7ea0['as'],'attributes':_0x4d7ea0[_0xf803('0x24')],'include':_0x4d7ea0[_0xf803('0x22')]?_[_0xf803('0x21')](_0x4d7ea0[_0xf803('0x22')],function(_0x3ca00d){return{'model':db[_0x3ca00d[_0xf803('0x23')]],'as':_0x3ca00d['as'],'attributes':_0x3ca00d[_0xf803('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf803('0x11')](function(_0x49067c){logger['info'](_0xf803('0x1c'),_0x5d8c4a);logger['debug'](_0xf803('0x1c'),_0x5d8c4a,JSON[_0xf803('0x16')](_0x49067c));_0x2bf958(_0x49067c);})[_0xf803('0x25')](function(_0x1c41ed){logger['error'](_0xf803('0x1c'),_0x1c41ed[_0xf803('0x1a')],_0x5d8c4a);_0x3b8832(_0x2fa79c[_0xf803('0x17')](0x1f4,_0x1c41ed[_0xf803('0x1a')]));});});}; \ No newline at end of file +var _0x7cfb=['options','raw','where','attributes','include','map','model','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','catch','ShowSquareProject','find'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0x7cfb,0x9b));var _0xb7cf=function(_0x316c83,_0x1fa2f1){_0x316c83=_0x316c83-0x0;var _0x18a7ef=_0x7cfb[_0x316c83];return _0x18a7ef;};'use strict';var _=require(_0xb7cf('0x0'));var util=require(_0xb7cf('0x1'));var moment=require(_0xb7cf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7cf('0x3'));var db=require(_0xb7cf('0x4'))['db'];var utils=require(_0xb7cf('0x5'));var logger=require(_0xb7cf('0x6'))(_0xb7cf('0x7'));var config=require(_0xb7cf('0x8'));var jayson=require(_0xb7cf('0x9'));var client=jayson[_0xb7cf('0xa')][_0xb7cf('0xb')]({'port':0x232a});config[_0xb7cf('0xc')]=_['defaults'](config[_0xb7cf('0xc')],{'host':_0xb7cf('0xd'),'port':0x18eb});var socket=require(_0xb7cf('0xe'))(new Redis(config[_0xb7cf('0xc')]));require('./squareProject.socket')[_0xb7cf('0xf')](socket);function respondWithRpcPromise(_0x5bfd4e,_0x32a2d9,_0x241b91){return new BPromise(function(_0x13f362,_0x3ec75c){return client[_0xb7cf('0x10')](_0x5bfd4e,_0x241b91)[_0xb7cf('0x11')](function(_0x49faef){logger[_0xb7cf('0x12')]('SquareProject,\x20%s,\x20%s',_0x32a2d9,_0xb7cf('0x13'));logger[_0xb7cf('0x14')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x32a2d9,_0xb7cf('0x13'),JSON[_0xb7cf('0x15')](_0x49faef));if(_0x49faef[_0xb7cf('0x16')]){if(_0x49faef['error'][_0xb7cf('0x17')]===0x1f4){logger['error'](_0xb7cf('0x18'),_0x32a2d9,_0x49faef[_0xb7cf('0x16')][_0xb7cf('0x19')]);return _0x3ec75c(_0x49faef[_0xb7cf('0x16')][_0xb7cf('0x19')]);}logger['error'](_0xb7cf('0x18'),_0x32a2d9,_0x49faef[_0xb7cf('0x16')][_0xb7cf('0x19')]);return _0x13f362(_0x49faef[_0xb7cf('0x16')][_0xb7cf('0x19')]);}else{logger[_0xb7cf('0x12')]('SquareProject,\x20%s,\x20%s',_0x32a2d9,'request\x20sent');_0x13f362(_0x49faef[_0xb7cf('0x1a')]['message']);}})[_0xb7cf('0x1b')](function(_0x761630){logger[_0xb7cf('0x16')]('SquareProject,\x20%s,\x20%s',_0x32a2d9,_0x761630);_0x3ec75c(_0x761630);});});}exports[_0xb7cf('0x1c')]=function(_0x51265e){var _0x3931ee=this;return new Promise(function(_0x3b3bac,_0x312942){return db['SquareProject'][_0xb7cf('0x1d')]({'raw':_0x51265e[_0xb7cf('0x1e')]?_0x51265e['options'][_0xb7cf('0x1f')]===undefined?!![]:![]:!![],'where':_0x51265e[_0xb7cf('0x1e')]?_0x51265e[_0xb7cf('0x1e')][_0xb7cf('0x20')]||null:null,'attributes':_0x51265e[_0xb7cf('0x1e')]?_0x51265e[_0xb7cf('0x1e')][_0xb7cf('0x21')]||null:null,'include':_0x51265e[_0xb7cf('0x1e')]?_0x51265e[_0xb7cf('0x1e')][_0xb7cf('0x22')]?_[_0xb7cf('0x23')](_0x51265e[_0xb7cf('0x1e')][_0xb7cf('0x22')],function(_0x55f519){return{'model':db[_0x55f519['model']],'as':_0x55f519['as'],'attributes':_0x55f519['attributes'],'include':_0x55f519['include']?_['map'](_0x55f519[_0xb7cf('0x22')],function(_0xc891bd){return{'model':db[_0xc891bd[_0xb7cf('0x24')]],'as':_0xc891bd['as'],'attributes':_0xc891bd[_0xb7cf('0x21')],'include':_0xc891bd[_0xb7cf('0x22')]?_[_0xb7cf('0x23')](_0xc891bd[_0xb7cf('0x22')],function(_0x3e5a0c){return{'model':db[_0x3e5a0c[_0xb7cf('0x24')]],'as':_0x3e5a0c['as'],'attributes':_0x3e5a0c[_0xb7cf('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb7cf('0x11')](function(_0x7ffefd){logger[_0xb7cf('0x12')](_0xb7cf('0x1c'),_0x51265e);logger[_0xb7cf('0x14')](_0xb7cf('0x1c'),_0x51265e,JSON[_0xb7cf('0x15')](_0x7ffefd));_0x3b3bac(_0x7ffefd);})['catch'](function(_0x54e1f4){logger[_0xb7cf('0x16')](_0xb7cf('0x1c'),_0x54e1f4[_0xb7cf('0x19')],_0x51265e);_0x312942(_0x3931ee[_0xb7cf('0x16')](0x1f4,_0x54e1f4[_0xb7cf('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index f23568a..37de448 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 _0x7096=['emit','removeListener','register','length','save','update'];(function(_0x5c9cad,_0x36aad4){var _0x2107d4=function(_0x11a291){while(--_0x11a291){_0x5c9cad['push'](_0x5c9cad['shift']());}};_0x2107d4(++_0x36aad4);}(_0x7096,0x10c));var _0x6709=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7096[_0x311c35];return _0x5cc50c;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6709('0x0'),'remove',_0x6709('0x1')];function createListener(_0x5c668a,_0x233cbf){return function(_0x9544e0){_0x233cbf[_0x6709('0x2')](_0x5c668a,_0x9544e0);};}function removeListener(_0xccdcb5,_0x3cd087){return function(){SquareProjectEvents[_0x6709('0x3')](_0xccdcb5,_0x3cd087);};}exports[_0x6709('0x4')]=function(_0x9d630f){for(var _0xa35832=0x0,_0x3e2223=events[_0x6709('0x5')];_0xa35832<_0x3e2223;_0xa35832++){var _0x985814=events[_0xa35832];var _0x30147f=createListener('squareProject:'+_0x985814,_0x9d630f);SquareProjectEvents['on'](_0x985814,_0x30147f);}}; \ No newline at end of file +var _0x31f0=['emit','removeListener','squareProject:','./squareProject.events','remove'];(function(_0x3f1cbd,_0x4d2716){var _0x28ccfe=function(_0x69fc04){while(--_0x69fc04){_0x3f1cbd['push'](_0x3f1cbd['shift']());}};_0x28ccfe(++_0x4d2716);}(_0x31f0,0xb7));var _0x031f=function(_0x4e2198,_0x399d54){_0x4e2198=_0x4e2198-0x0;var _0x22fdd7=_0x31f0[_0x4e2198];return _0x22fdd7;};'use strict';var SquareProjectEvents=require(_0x031f('0x0'));var events=['save',_0x031f('0x1'),'update'];function createListener(_0x3747a5,_0x2021ea){return function(_0x2b04d4){_0x2021ea[_0x031f('0x2')](_0x3747a5,_0x2b04d4);};}function removeListener(_0x526a45,_0x3c0612){return function(){SquareProjectEvents[_0x031f('0x3')](_0x526a45,_0x3c0612);};}exports['register']=function(_0x4c0f94){for(var _0x56328c=0x0,_0x3dc98e=events['length'];_0x56328c<_0x3dc98e;_0x56328c++){var _0x365f59=events[_0x56328c];var _0x4300b4=createListener(_0x031f('0x4')+_0x365f59,_0x4c0f94);SquareProjectEvents['on'](_0x365f59,_0x4300b4);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 0cba463..2f4bc74 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 _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','delete','exports'];(function(_0x5ccdee,_0x5cefde){var _0x1b1d02=function(_0x20dddf){while(--_0x20dddf){_0x5ccdee['push'](_0x5ccdee['shift']());}};_0x1b1d02(++_0x5cefde);}(_0x0b0e,0x187));var _0xe0b0=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0x0b0e[_0x16d411];return _0x20336d;};'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 auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file +var _0xadb5=['isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller'];(function(_0x5e3b07,_0x46321f){var _0x5c9684=function(_0x35563b){while(--_0x35563b){_0x5e3b07['push'](_0x5e3b07['shift']());}};_0x5c9684(++_0x46321f);}(_0xadb5,0xad));var _0x5adb=function(_0x2859dd,_0x2cd41e){_0x2859dd=_0x2859dd-0x0;var _0xdcefd1=_0xadb5[_0x2859dd];return _0xdcefd1;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router[_0x5adb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x11')]);router[_0x5adb('0x12')](_0x5adb('0xa'),auth['isAuthenticated'](),controller[_0x5adb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 8930368..705a046 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 _0xc391=['STRING','exports'];(function(_0x3f5cdc,_0x5932ba){var _0x4f2f3b=function(_0x162e48){while(--_0x162e48){_0x3f5cdc['push'](_0x3f5cdc['shift']());}};_0x4f2f3b(++_0x5932ba);}(_0xc391,0xc9));var _0x1c39=function(_0x95342f,_0x21eda6){_0x95342f=_0x95342f-0x0;var _0x47155b=_0xc391[_0x95342f];return _0x47155b;};'use strict';var Sequelize=require('sequelize');module[_0x1c39('0x0')]={'uniqueid':{'type':Sequelize[_0x1c39('0x1')]},'callerid':{'type':Sequelize[_0x1c39('0x1')]},'calleridname':{'type':Sequelize[_0x1c39('0x1')]},'context':{'type':Sequelize[_0x1c39('0x1')]},'extension':{'type':Sequelize[_0x1c39('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1c39('0x1')]},'dnid':{'type':Sequelize[_0x1c39('0x1')]},'projectName':{'type':Sequelize[_0x1c39('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x1c39('0x1')]}}; \ No newline at end of file +var _0x37d4=['STRING','sequelize'];(function(_0x48329f,_0x5d5d46){var _0x3ab982=function(_0x751635){while(--_0x751635){_0x48329f['push'](_0x48329f['shift']());}};_0x3ab982(++_0x5d5d46);}(_0x37d4,0x145));var _0x437d=function(_0xa51499,_0x4b88f1){_0xa51499=_0xa51499-0x0;var _0x4308ff=_0x37d4[_0xa51499];return _0x4308ff;};'use strict';var Sequelize=require(_0x437d('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x437d('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x437d('0x1')]},'context':{'type':Sequelize[_0x437d('0x1')]},'extension':{'type':Sequelize[_0x437d('0x1')]},'priority':{'type':Sequelize[_0x437d('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x437d('0x1')]},'filename':{'type':Sequelize[_0x437d('0x1')]},'savePath':{'type':Sequelize[_0x437d('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 9cceb49..ec4890f 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 _0xf682=['key','model','query','filters','attributes','fields','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','options','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','SquareRecording','rawAttributes','fieldName','type'];(function(_0xc5a2a2,_0x10f3f2){var _0x5bda71=function(_0x5dde99){while(--_0x5dde99){_0xc5a2a2['push'](_0xc5a2a2['shift']());}};_0x5bda71(++_0x10f3f2);}(_0xf682,0x12f));var _0x2f68=function(_0x4ca225,_0x1285d4){_0x4ca225=_0x4ca225-0x0;var _0x201869=_0xf682[_0x4ca225];return _0x201869;};'use strict';var pdf=require(_0x2f68('0x0'));var emlformat=require(_0x2f68('0x1'));var rimraf=require(_0x2f68('0x2'));var zipdir=require(_0x2f68('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2f68('0x4'));var BPromise=require(_0x2f68('0x5'));var Mustache=require(_0x2f68('0x6'));var util=require(_0x2f68('0x7'));var path=require('path');var sox=require(_0x2f68('0x8'));var csv=require(_0x2f68('0x9'));var ejs=require(_0x2f68('0xa'));var fs=require('fs');var _=require(_0x2f68('0xb'));var squel=require('squel');var crypto=require(_0x2f68('0xc'));var jsforce=require(_0x2f68('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2f68('0xe'));var authService=require(_0x2f68('0xf'));var qs=require(_0x2f68('0x10'));var as=require(_0x2f68('0x11'));var hardwareService=require(_0x2f68('0x12'));var logger=require(_0x2f68('0x13'))(_0x2f68('0x14'));var utils=require(_0x2f68('0x15'));var config=require(_0x2f68('0x16'));var db=require(_0x2f68('0x17'))['db'];function respondWithStatusCode(_0x375ac8,_0xe71dbe){_0xe71dbe=_0xe71dbe||0xcc;return function(_0x2d9b69){if(_0x2d9b69){return _0x375ac8[_0x2f68('0x18')](_0xe71dbe);}return _0x375ac8[_0x2f68('0x19')](_0xe71dbe)[_0x2f68('0x1a')]();};}function respondWithResult(_0x596e19,_0xfb1457){_0xfb1457=_0xfb1457||0xc8;return function(_0x348383){if(_0x348383){return _0x596e19[_0x2f68('0x19')](_0xfb1457)[_0x2f68('0x1b')](_0x348383);}};}function respondWithFilteredResult(_0x12fea5,_0x1c2225){return function(_0x421602){if(_0x421602){var _0x3106d2=_0x421602[_0x2f68('0x1c')],_0x4e4a11=_0x1c2225['offset'],_0x38bd00=_0x1c2225[_0x2f68('0x1d')]+_0x1c2225['limit'],_0xf276f4;if(_0x38bd00>=_0x3106d2){_0x38bd00=_0x3106d2;_0xf276f4=0xc8;}else{_0xf276f4=0xce;}_0x12fea5[_0x2f68('0x19')](_0xf276f4);return _0x12fea5['set'](_0x2f68('0x1e'),_0x4e4a11+'-'+_0x38bd00+'/'+_0x3106d2)[_0x2f68('0x1b')](_0x421602);}return null;};}function patchUpdates(_0x1e6118){return function(_0x4f9f98){try{jsonpatch[_0x2f68('0x1f')](_0x4f9f98,_0x1e6118,!![]);}catch(_0x5d06d2){return BPromise[_0x2f68('0x20')](_0x5d06d2);}return _0x4f9f98[_0x2f68('0x21')]();};}function saveUpdates(_0x1b550c,_0x5b7723){return function(_0x47ac88){if(_0x47ac88){return _0x47ac88[_0x2f68('0x22')](_0x1b550c)[_0x2f68('0x23')](function(_0x4c23ee){return _0x4c23ee;});}return null;};}function removeEntity(_0x4feb59,_0x3141b4){return function(_0x5d6ab9){if(_0x5d6ab9){return _0x5d6ab9[_0x2f68('0x24')]()['then'](function(){_0x4feb59[_0x2f68('0x19')](0xcc)[_0x2f68('0x1a')]();});}};}function handleEntityNotFound(_0x2d0738,_0x14ef8e){return function(_0x31992a){if(!_0x31992a){_0x2d0738[_0x2f68('0x18')](0x194);}return _0x31992a;};}function handleError(_0x5a557f,_0x5cc4f2){_0x5cc4f2=_0x5cc4f2||0x1f4;return function(_0x274518){logger[_0x2f68('0x25')](_0x274518['stack']);if(_0x274518['name']){delete _0x274518[_0x2f68('0x26')];}_0x5a557f['status'](_0x5cc4f2)[_0x2f68('0x27')](_0x274518);};}exports['index']=function(_0x3614c6,_0x388ec0){var _0x154750={},_0x3747cf={},_0x545353={'count':0x0,'rows':[]};var _0x4fe0a5=_[_0x2f68('0x28')](db[_0x2f68('0x29')][_0x2f68('0x2a')],function(_0x44ce52){return{'name':_0x44ce52[_0x2f68('0x2b')],'type':_0x44ce52[_0x2f68('0x2c')][_0x2f68('0x2d')]};});_0x3747cf[_0x2f68('0x2e')]=_[_0x2f68('0x28')](_0x4fe0a5,_0x2f68('0x26'));_0x3747cf[_0x2f68('0x2f')]=_['keys'](_0x3614c6['query']);_0x3747cf[_0x2f68('0x30')]=_['intersection'](_0x3747cf[_0x2f68('0x2e')],_0x3747cf[_0x2f68('0x2f')]);_0x154750[_0x2f68('0x31')]=_['intersection'](_0x3747cf['model'],qs['fields'](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x32')]));_0x154750['attributes']=_0x154750[_0x2f68('0x31')]['length']?_0x154750[_0x2f68('0x31')]:_0x3747cf['model'];if(!_0x3614c6[_0x2f68('0x2f')]['hasOwnProperty']('nolimit')){_0x154750[_0x2f68('0x33')]=qs[_0x2f68('0x33')](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x33')]);_0x154750[_0x2f68('0x1d')]=qs[_0x2f68('0x1d')](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x1d')]);}_0x154750['order']=qs[_0x2f68('0x34')](_0x3614c6[_0x2f68('0x2f')]['sort']);_0x154750[_0x2f68('0x35')]=qs['filters'](_[_0x2f68('0x36')](_0x3614c6[_0x2f68('0x2f')],_0x3747cf[_0x2f68('0x30')]));if(_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x37')]){_0x154750[_0x2f68('0x35')]=_['merge'](_0x154750['where'],{'$or':_[_0x2f68('0x28')](_0x4fe0a5,function(_0x4fcdd1){if(_0x4fcdd1[_0x2f68('0x2c')]!==_0x2f68('0x38')){var _0x4f83d9={};_0x4f83d9[_0x4fcdd1[_0x2f68('0x26')]]={'$like':'%'+_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x37')]+'%'};return _0x4f83d9;}})});}_0x154750=_[_0x2f68('0x39')]({},_0x154750,_0x3614c6['options']);var _0x4b56d1={'where':_0x154750[_0x2f68('0x35')]};return db[_0x2f68('0x29')][_0x2f68('0x1c')](_0x4b56d1)[_0x2f68('0x23')](function(_0x8735d9){_0x545353['count']=_0x8735d9;if(_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x3a')]){_0x154750[_0x2f68('0x3b')]=[{'all':!![]}];}return db[_0x2f68('0x29')][_0x2f68('0x3c')](_0x154750);})[_0x2f68('0x23')](function(_0x443cde){_0x545353[_0x2f68('0x3d')]=_0x443cde;return _0x545353;})[_0x2f68('0x23')](respondWithFilteredResult(_0x388ec0,_0x154750))[_0x2f68('0x3e')](handleError(_0x388ec0,null));};exports[_0x2f68('0x3f')]=function(_0x4ea143,_0x58c130){var _0x3c27eb={'raw':!![],'where':{'id':_0x4ea143[_0x2f68('0x40')]['id']}},_0x2ed970={};_0x2ed970[_0x2f68('0x2e')]=_['keys'](db[_0x2f68('0x29')][_0x2f68('0x2a')]);_0x2ed970[_0x2f68('0x2f')]=_[_0x2f68('0x41')](_0x4ea143[_0x2f68('0x2f')]);_0x2ed970[_0x2f68('0x30')]=_['intersection'](_0x2ed970[_0x2f68('0x2e')],_0x2ed970[_0x2f68('0x2f')]);_0x3c27eb['attributes']=_[_0x2f68('0x42')](_0x2ed970[_0x2f68('0x2e')],qs[_0x2f68('0x32')](_0x4ea143['query'][_0x2f68('0x32')]));_0x3c27eb[_0x2f68('0x31')]=_0x3c27eb[_0x2f68('0x31')][_0x2f68('0x43')]?_0x3c27eb['attributes']:_0x2ed970[_0x2f68('0x2e')];if(_0x4ea143['query'][_0x2f68('0x3a')]){_0x3c27eb[_0x2f68('0x3b')]=[{'all':!![]}];}_0x3c27eb=_[_0x2f68('0x39')]({},_0x3c27eb,_0x4ea143[_0x2f68('0x44')]);return db[_0x2f68('0x29')][_0x2f68('0x45')](_0x3c27eb)[_0x2f68('0x23')](handleEntityNotFound(_0x58c130,null))['then'](respondWithResult(_0x58c130,null))[_0x2f68('0x3e')](handleError(_0x58c130,null));};exports[_0x2f68('0x46')]=function(_0x1bfede,_0x191a2a){return db[_0x2f68('0x29')]['create'](_0x1bfede[_0x2f68('0x47')],{})[_0x2f68('0x23')](respondWithResult(_0x191a2a,0xc9))[_0x2f68('0x3e')](handleError(_0x191a2a,null));};exports['update']=function(_0x29723a,_0x453425){if(_0x29723a[_0x2f68('0x47')]['id']){delete _0x29723a['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x29723a[_0x2f68('0x40')]['id']}})['then'](handleEntityNotFound(_0x453425,null))[_0x2f68('0x23')](saveUpdates(_0x29723a[_0x2f68('0x47')],null))['then'](respondWithResult(_0x453425,null))[_0x2f68('0x3e')](handleError(_0x453425,null));};exports[_0x2f68('0x24')]=function(_0x1a42b5,_0x155374){return db[_0x2f68('0x29')][_0x2f68('0x45')]({'where':{'id':_0x1a42b5[_0x2f68('0x40')]['id']}})[_0x2f68('0x23')](handleEntityNotFound(_0x155374,null))[_0x2f68('0x23')](removeEntity(_0x155374,null))['catch'](handleError(_0x155374,null));};exports[_0x2f68('0x48')]=function(_0x3ffa83,_0x5466d9,_0x1901f7){var _0x2fb4f1=require(_0x2f68('0x49'));var _0x875748=![];var _0x400782={};if(_0x3ffa83[_0x2f68('0x2f')][_0x2f68('0x2c')]&&_0x3ffa83['query'][_0x2f68('0x2c')]===_0x2f68('0x4a')){_0x400782[_0x2f68('0x4a')]=_0x3ffa83[_0x2f68('0x40')]['id'];}else{_0x400782['id']=_0x3ffa83[_0x2f68('0x40')]['id'];}return db['SquareRecording'][_0x2f68('0x45')]({'where':_0x400782,'attributes':['id',_0x2f68('0x4b'),_0x2f68('0x4c')],'raw':!![]})[_0x2f68('0x23')](handleEntityNotFound(_0x5466d9,null))['then'](function(_0x14f573){if(_0x14f573){var _0x39d6c3=_0x14f573[_0x2f68('0x4b')];var _0xb777ac=util[_0x2f68('0x4d')](_0x2f68('0x4e'),_0x39d6c3);if(fs['existsSync'](_0xb777ac)){_0x875748=!![];return _0x2fb4f1['decryptFile'](_0xb777ac,_0x39d6c3,config[_0x2f68('0x4f')][_0x2f68('0x50')])[_0x2f68('0x23')](function(){return _0x14f573;});}return _0x14f573;}})[_0x2f68('0x23')](function(_0x4edb12){if(_0x4edb12){var _0x514f83=_0x4edb12['savePath'];if(!fs[_0x2f68('0x51')](_0x514f83)){throw new db[(_0x2f68('0x52'))][(_0x2f68('0x53'))](_0x2f68('0x54'));}if(_0x4edb12[_0x2f68('0x4c')]){return _0x5466d9[_0x2f68('0x48')](_0x514f83,_0x4edb12['filename']+path['extname'](_0x514f83),function(){if(_0x875748){fs[_0x2f68('0x55')](_0x514f83);}});}else{return _0x5466d9['download'](_0x514f83,function(_0x1de0d9){if(_0x875748){fs[_0x2f68('0x55')](_0x514f83);}});}}})['catch'](function(_0x22974c){if(_0x22974c[_0x2f68('0x56')]==='SquareRecording\x20not\x20found'){_0x5466d9['status'](0x194)[_0x2f68('0x27')]('Not\x20found');}else{return handleError(_0x5466d9,null);}});}; \ No newline at end of file +var _0x7980=['options','find','create','body','update','params','../../components/encryptor','uniqueid','filename','savePath','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','message','send','Not\x20found','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','set','apply','reject','destroy','sendStatus','stack','name','index','SquareRecording','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type','then','include','catch','show','length','includeAll','merge'];(function(_0x2c2e57,_0x1d6cbb){var _0xe89ecb=function(_0x2dde01){while(--_0x2dde01){_0x2c2e57['push'](_0x2c2e57['shift']());}};_0xe89ecb(++_0x1d6cbb);}(_0x7980,0x123));var _0x0798=function(_0x50f87d,_0x4bdf62){_0x50f87d=_0x50f87d-0x0;var _0x265cae=_0x7980[_0x50f87d];return _0x265cae;};'use strict';var pdf=require(_0x0798('0x0'));var emlformat=require(_0x0798('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x0798('0x2'));var jsonpatch=require(_0x0798('0x3'));var rp=require(_0x0798('0x4'));var moment=require(_0x0798('0x5'));var BPromise=require(_0x0798('0x6'));var Mustache=require(_0x0798('0x7'));var util=require(_0x0798('0x8'));var path=require(_0x0798('0x9'));var sox=require('sox');var csv=require(_0x0798('0xa'));var ejs=require(_0x0798('0xb'));var fs=require('fs');var _=require(_0x0798('0xc'));var squel=require(_0x0798('0xd'));var crypto=require(_0x0798('0xe'));var jsforce=require(_0x0798('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0798('0xa'));var querystring=require(_0x0798('0x10'));var Papa=require(_0x0798('0x11'));var Redis=require(_0x0798('0x12'));var authService=require(_0x0798('0x13'));var qs=require(_0x0798('0x14'));var as=require(_0x0798('0x15'));var hardwareService=require(_0x0798('0x16'));var logger=require(_0x0798('0x17'))(_0x0798('0x18'));var utils=require(_0x0798('0x19'));var config=require(_0x0798('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1db338,_0x549e25){_0x549e25=_0x549e25||0xcc;return function(_0x24bbcf){if(_0x24bbcf){return _0x1db338['sendStatus'](_0x549e25);}return _0x1db338[_0x0798('0x1b')](_0x549e25)['end']();};}function respondWithResult(_0x33c953,_0x1c34f8){_0x1c34f8=_0x1c34f8||0xc8;return function(_0xe39220){if(_0xe39220){return _0x33c953[_0x0798('0x1b')](_0x1c34f8)[_0x0798('0x1c')](_0xe39220);}};}function respondWithFilteredResult(_0x1e84c0,_0x12e352){return function(_0x129328){if(_0x129328){var _0x69bc9b=_0x129328[_0x0798('0x1d')],_0xe435f7=_0x12e352[_0x0798('0x1e')],_0x7b402d=_0x12e352[_0x0798('0x1e')]+_0x12e352[_0x0798('0x1f')],_0x1c3cf5;if(_0x7b402d>=_0x69bc9b){_0x7b402d=_0x69bc9b;_0x1c3cf5=0xc8;}else{_0x1c3cf5=0xce;}_0x1e84c0[_0x0798('0x1b')](_0x1c3cf5);return _0x1e84c0[_0x0798('0x20')]('Content-Range',_0xe435f7+'-'+_0x7b402d+'/'+_0x69bc9b)[_0x0798('0x1c')](_0x129328);}return null;};}function patchUpdates(_0x101221){return function(_0x2199cd){try{jsonpatch[_0x0798('0x21')](_0x2199cd,_0x101221,!![]);}catch(_0x317e08){return BPromise[_0x0798('0x22')](_0x317e08);}return _0x2199cd['save']();};}function saveUpdates(_0x17202c,_0x58e55c){return function(_0x136a4c){if(_0x136a4c){return _0x136a4c['update'](_0x17202c)['then'](function(_0xed35b3){return _0xed35b3;});}return null;};}function removeEntity(_0x3d5f69,_0x12e5e6){return function(_0xbefc4e){if(_0xbefc4e){return _0xbefc4e[_0x0798('0x23')]()['then'](function(){_0x3d5f69[_0x0798('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23f09b,_0x522893){return function(_0x28ebe7){if(!_0x28ebe7){_0x23f09b[_0x0798('0x24')](0x194);}return _0x28ebe7;};}function handleError(_0x2f108b,_0x4cd9c0){_0x4cd9c0=_0x4cd9c0||0x1f4;return function(_0x320a85){logger['error'](_0x320a85[_0x0798('0x25')]);if(_0x320a85[_0x0798('0x26')]){delete _0x320a85[_0x0798('0x26')];}_0x2f108b[_0x0798('0x1b')](_0x4cd9c0)['send'](_0x320a85);};}exports[_0x0798('0x27')]=function(_0x5e7837,_0x1467db){var _0x449244={},_0x4068b3={},_0x52d8f9={'count':0x0,'rows':[]};var _0x16bdb7=_['map'](db[_0x0798('0x28')][_0x0798('0x29')],function(_0x3d0ed0){return{'name':_0x3d0ed0['fieldName'],'type':_0x3d0ed0['type'][_0x0798('0x2a')]};});_0x4068b3[_0x0798('0x2b')]=_[_0x0798('0x2c')](_0x16bdb7,_0x0798('0x26'));_0x4068b3['query']=_[_0x0798('0x2d')](_0x5e7837[_0x0798('0x2e')]);_0x4068b3[_0x0798('0x2f')]=_[_0x0798('0x30')](_0x4068b3[_0x0798('0x2b')],_0x4068b3[_0x0798('0x2e')]);_0x449244[_0x0798('0x31')]=_[_0x0798('0x30')](_0x4068b3[_0x0798('0x2b')],qs[_0x0798('0x32')](_0x5e7837['query'][_0x0798('0x32')]));_0x449244[_0x0798('0x31')]=_0x449244[_0x0798('0x31')]['length']?_0x449244[_0x0798('0x31')]:_0x4068b3[_0x0798('0x2b')];if(!_0x5e7837['query'][_0x0798('0x33')](_0x0798('0x34'))){_0x449244[_0x0798('0x1f')]=qs[_0x0798('0x1f')](_0x5e7837[_0x0798('0x2e')][_0x0798('0x1f')]);_0x449244[_0x0798('0x1e')]=qs[_0x0798('0x1e')](_0x5e7837[_0x0798('0x2e')][_0x0798('0x1e')]);}_0x449244['order']=qs[_0x0798('0x35')](_0x5e7837['query'][_0x0798('0x35')]);_0x449244['where']=qs['filters'](_[_0x0798('0x36')](_0x5e7837[_0x0798('0x2e')],_0x4068b3[_0x0798('0x2f')]));if(_0x5e7837[_0x0798('0x2e')][_0x0798('0x37')]){_0x449244[_0x0798('0x38')]=_['merge'](_0x449244[_0x0798('0x38')],{'$or':_['map'](_0x16bdb7,function(_0x4093c5){if(_0x4093c5[_0x0798('0x39')]!=='VIRTUAL'){var _0xac90e4={};_0xac90e4[_0x4093c5[_0x0798('0x26')]]={'$like':'%'+_0x5e7837[_0x0798('0x2e')][_0x0798('0x37')]+'%'};return _0xac90e4;}})});}_0x449244=_['merge']({},_0x449244,_0x5e7837['options']);var _0x5a877e={'where':_0x449244[_0x0798('0x38')]};return db[_0x0798('0x28')][_0x0798('0x1d')](_0x5a877e)[_0x0798('0x3a')](function(_0xdd8e2b){_0x52d8f9[_0x0798('0x1d')]=_0xdd8e2b;if(_0x5e7837[_0x0798('0x2e')]['includeAll']){_0x449244[_0x0798('0x3b')]=[{'all':!![]}];}return db[_0x0798('0x28')]['findAll'](_0x449244);})[_0x0798('0x3a')](function(_0x25543c){_0x52d8f9['rows']=_0x25543c;return _0x52d8f9;})[_0x0798('0x3a')](respondWithFilteredResult(_0x1467db,_0x449244))[_0x0798('0x3c')](handleError(_0x1467db,null));};exports[_0x0798('0x3d')]=function(_0x46233e,_0x4bb54b){var _0x1e5470={'raw':!![],'where':{'id':_0x46233e['params']['id']}},_0x1f8cc3={};_0x1f8cc3[_0x0798('0x2b')]=_['keys'](db[_0x0798('0x28')][_0x0798('0x29')]);_0x1f8cc3[_0x0798('0x2e')]=_[_0x0798('0x2d')](_0x46233e[_0x0798('0x2e')]);_0x1f8cc3['filters']=_[_0x0798('0x30')](_0x1f8cc3[_0x0798('0x2b')],_0x1f8cc3[_0x0798('0x2e')]);_0x1e5470[_0x0798('0x31')]=_[_0x0798('0x30')](_0x1f8cc3[_0x0798('0x2b')],qs[_0x0798('0x32')](_0x46233e['query']['fields']));_0x1e5470[_0x0798('0x31')]=_0x1e5470[_0x0798('0x31')][_0x0798('0x3e')]?_0x1e5470[_0x0798('0x31')]:_0x1f8cc3[_0x0798('0x2b')];if(_0x46233e[_0x0798('0x2e')][_0x0798('0x3f')]){_0x1e5470[_0x0798('0x3b')]=[{'all':!![]}];}_0x1e5470=_[_0x0798('0x40')]({},_0x1e5470,_0x46233e[_0x0798('0x41')]);return db[_0x0798('0x28')][_0x0798('0x42')](_0x1e5470)['then'](handleEntityNotFound(_0x4bb54b,null))[_0x0798('0x3a')](respondWithResult(_0x4bb54b,null))[_0x0798('0x3c')](handleError(_0x4bb54b,null));};exports[_0x0798('0x43')]=function(_0x2e308b,_0xf9e77e){return db[_0x0798('0x28')]['create'](_0x2e308b[_0x0798('0x44')],{})[_0x0798('0x3a')](respondWithResult(_0xf9e77e,0xc9))[_0x0798('0x3c')](handleError(_0xf9e77e,null));};exports[_0x0798('0x45')]=function(_0x35762d,_0x56930c){if(_0x35762d[_0x0798('0x44')]['id']){delete _0x35762d[_0x0798('0x44')]['id'];}return db[_0x0798('0x28')]['find']({'where':{'id':_0x35762d[_0x0798('0x46')]['id']}})[_0x0798('0x3a')](handleEntityNotFound(_0x56930c,null))['then'](saveUpdates(_0x35762d[_0x0798('0x44')],null))[_0x0798('0x3a')](respondWithResult(_0x56930c,null))[_0x0798('0x3c')](handleError(_0x56930c,null));};exports[_0x0798('0x23')]=function(_0x582264,_0x1c8b3b){return db['SquareRecording']['find']({'where':{'id':_0x582264[_0x0798('0x46')]['id']}})[_0x0798('0x3a')](handleEntityNotFound(_0x1c8b3b,null))[_0x0798('0x3a')](removeEntity(_0x1c8b3b,null))[_0x0798('0x3c')](handleError(_0x1c8b3b,null));};exports['download']=function(_0x2646b0,_0x23d5ac,_0x4be4bd){var _0x47905c=require(_0x0798('0x47'));var _0x266023=![];var _0x57d8a3={};if(_0x2646b0['query'][_0x0798('0x39')]&&_0x2646b0[_0x0798('0x2e')]['type']===_0x0798('0x48')){_0x57d8a3[_0x0798('0x48')]=_0x2646b0[_0x0798('0x46')]['id'];}else{_0x57d8a3['id']=_0x2646b0[_0x0798('0x46')]['id'];}return db[_0x0798('0x28')]['find']({'where':_0x57d8a3,'attributes':['id','savePath',_0x0798('0x49')],'raw':!![]})[_0x0798('0x3a')](handleEntityNotFound(_0x23d5ac,null))[_0x0798('0x3a')](function(_0x579fb8){if(_0x579fb8){var _0x191d49=_0x579fb8[_0x0798('0x4a')];var _0x58d7a3=util[_0x0798('0x4b')]('%s.cypher',_0x191d49);if(fs[_0x0798('0x4c')](_0x58d7a3)){_0x266023=!![];return _0x47905c[_0x0798('0x4d')](_0x58d7a3,_0x191d49,config[_0x0798('0x4e')][_0x0798('0x4f')])[_0x0798('0x3a')](function(){return _0x579fb8;});}return _0x579fb8;}})[_0x0798('0x3a')](function(_0x11ea99){if(_0x11ea99){var _0x30eda5=_0x11ea99[_0x0798('0x4a')];if(!fs['existsSync'](_0x30eda5)){throw new db[(_0x0798('0x50'))][(_0x0798('0x51'))](_0x0798('0x52'));}if(_0x11ea99[_0x0798('0x49')]){return _0x23d5ac[_0x0798('0x53')](_0x30eda5,_0x11ea99[_0x0798('0x49')]+path[_0x0798('0x54')](_0x30eda5),function(){if(_0x266023){fs[_0x0798('0x55')](_0x30eda5);}});}else{return _0x23d5ac[_0x0798('0x53')](_0x30eda5,function(_0x20a92){if(_0x266023){fs[_0x0798('0x55')](_0x30eda5);}});}}})['catch'](function(_0x4e2eff){if(_0x4e2eff[_0x0798('0x56')]===_0x0798('0x52')){_0x23d5ac['status'](0x194)[_0x0798('0x57')](_0x0798('0x58'));}else{return handleError(_0x23d5ac,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7c83133..296da74 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 _0xea5b=['bluebird','request-promise','path','rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0xea5b,0x152));var _0xbea5=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xea5b[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var logger=require(_0xbea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbea5('0x3'));var rp=require(_0xbea5('0x4'));var fs=require('fs');var path=require(_0xbea5('0x5'));var rimraf=require(_0xbea5('0x6'));var config=require('../../config/environment');var attributes=require(_0xbea5('0x7'));module['exports']=function(_0x2db67a,_0x3d9263){return _0x2db67a[_0xbea5('0x8')](_0xbea5('0x9'),attributes,{'tableName':_0xbea5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58a4=['bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x269ccf,_0x23f182){var _0x20c0fa=function(_0x181e58){while(--_0x181e58){_0x269ccf['push'](_0x269ccf['shift']());}};_0x20c0fa(++_0x23f182);}(_0x58a4,0xbf));var _0x458a=function(_0x5496ff,_0x104d17){_0x5496ff=_0x5496ff-0x0;var _0x36881c=_0x58a4[_0x5496ff];return _0x36881c;};'use strict';var _=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var logger=require(_0x458a('0x2'))(_0x458a('0x3'));var moment=require(_0x458a('0x4'));var BPromise=require(_0x458a('0x5'));var rp=require(_0x458a('0x6'));var fs=require('fs');var path=require(_0x458a('0x7'));var rimraf=require(_0x458a('0x8'));var config=require(_0x458a('0x9'));var attributes=require(_0x458a('0xa'));module[_0x458a('0xb')]=function(_0x2f5d44,_0x57de3c){return _0x2f5d44['define'](_0x458a('0xc'),attributes,{'tableName':_0x458a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 6531ee9..b6090ff 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 _0xc5a0=['request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x537dfe,_0x5441e8){var _0x300ffe=function(_0x173edf){while(--_0x173edf){_0x537dfe['push'](_0x537dfe['shift']());}};_0x300ffe(++_0x5441e8);}(_0xc5a0,0xf9));var _0x0c5a=function(_0x362b1f,_0x59852c){_0x362b1f=_0x362b1f-0x0;var _0x2fe300=_0xc5a0[_0x362b1f];return _0x2fe300;};'use strict';var _=require(_0x0c5a('0x0'));var util=require(_0x0c5a('0x1'));var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var rs=require(_0x0c5a('0x4'));var fs=require('fs');var Redis=require(_0x0c5a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c5a('0x6'));var logger=require(_0x0c5a('0x7'))('rpc');var config=require(_0x0c5a('0x8'));var jayson=require(_0x0c5a('0x9'));var client=jayson[_0x0c5a('0xa')][_0x0c5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33e514,_0x5d90ba,_0x5e260a){return new BPromise(function(_0x4aca1e,_0x201f70){return client[_0x0c5a('0xc')](_0x33e514,_0x5e260a)[_0x0c5a('0xd')](function(_0x3495cc){logger[_0x0c5a('0xe')](_0x0c5a('0xf'),_0x5d90ba,_0x0c5a('0x10'));logger[_0x0c5a('0x11')](_0x0c5a('0x12'),_0x5d90ba,_0x0c5a('0x10'),JSON[_0x0c5a('0x13')](_0x3495cc));if(_0x3495cc['error']){if(_0x3495cc[_0x0c5a('0x14')]['code']===0x1f4){logger[_0x0c5a('0x14')]('SquareRecording,\x20%s,\x20%s',_0x5d90ba,_0x3495cc[_0x0c5a('0x14')][_0x0c5a('0x15')]);return _0x201f70(_0x3495cc[_0x0c5a('0x14')][_0x0c5a('0x15')]);}logger[_0x0c5a('0x14')](_0x0c5a('0xf'),_0x5d90ba,_0x3495cc['error'][_0x0c5a('0x15')]);return _0x4aca1e(_0x3495cc[_0x0c5a('0x14')][_0x0c5a('0x15')]);}else{logger[_0x0c5a('0xe')](_0x0c5a('0xf'),_0x5d90ba,'request\x20sent');_0x4aca1e(_0x3495cc['result'][_0x0c5a('0x15')]);}})[_0x0c5a('0x16')](function(_0x386d85){logger[_0x0c5a('0x14')](_0x0c5a('0xf'),_0x5d90ba,_0x386d85);_0x201f70(_0x386d85);});});}exports[_0x0c5a('0x17')]=function(_0x278b7e){var _0x299fbc=this;return new Promise(function(_0x506042,_0x4e2fc4){return db[_0x0c5a('0x18')][_0x0c5a('0x19')](_0x278b7e[_0x0c5a('0x1a')],{'raw':_0x278b7e[_0x0c5a('0x1b')]?_0x278b7e[_0x0c5a('0x1b')][_0x0c5a('0x1c')]===undefined?!![]:![]:!![]})[_0x0c5a('0xd')](function(_0x12a40c){logger[_0x0c5a('0xe')](_0x0c5a('0x17'),_0x278b7e);logger['debug'](_0x0c5a('0x17'),_0x278b7e,JSON['stringify'](_0x12a40c));_0x506042(_0x12a40c);})['catch'](function(_0xd7e0aa){logger[_0x0c5a('0x14')](_0x0c5a('0x17'),_0xd7e0aa[_0x0c5a('0x15')],_0x278b7e);_0x4e2fc4(_0x299fbc[_0x0c5a('0x14')](0x1f4,_0xd7e0aa[_0x0c5a('0x15')]));});});}; \ No newline at end of file +var _0x91c4=['code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','create','body','raw','then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','debug','request\x20sent','stringify','error'];(function(_0x188703,_0x596b26){var _0x1a0c81=function(_0x1cd22d){while(--_0x1cd22d){_0x188703['push'](_0x188703['shift']());}};_0x1a0c81(++_0x596b26);}(_0x91c4,0x1d6));var _0x491c=function(_0xd7a900,_0x9e1e7e){_0xd7a900=_0xd7a900-0x0;var _0x585433=_0x91c4[_0xd7a900];return _0x585433;};'use strict';var _=require(_0x491c('0x0'));var util=require('util');var moment=require(_0x491c('0x1'));var BPromise=require('bluebird');var rs=require(_0x491c('0x2'));var fs=require('fs');var Redis=require(_0x491c('0x3'));var db=require(_0x491c('0x4'))['db'];var utils=require(_0x491c('0x5'));var logger=require(_0x491c('0x6'))(_0x491c('0x7'));var config=require(_0x491c('0x8'));var jayson=require(_0x491c('0x9'));var client=jayson['client'][_0x491c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x8a1f66,_0x447f57,_0x28d734){return new BPromise(function(_0x1e332d,_0x16a0d0){return client['request'](_0x8a1f66,_0x28d734)['then'](function(_0x56c621){logger[_0x491c('0xb')]('SquareRecording,\x20%s,\x20%s',_0x447f57,'request\x20sent');logger[_0x491c('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x447f57,_0x491c('0xd'),JSON[_0x491c('0xe')](_0x56c621));if(_0x56c621[_0x491c('0xf')]){if(_0x56c621['error'][_0x491c('0x10')]===0x1f4){logger[_0x491c('0xf')](_0x491c('0x11'),_0x447f57,_0x56c621[_0x491c('0xf')][_0x491c('0x12')]);return _0x16a0d0(_0x56c621['error'][_0x491c('0x12')]);}logger[_0x491c('0xf')](_0x491c('0x11'),_0x447f57,_0x56c621[_0x491c('0xf')][_0x491c('0x12')]);return _0x1e332d(_0x56c621[_0x491c('0xf')][_0x491c('0x12')]);}else{logger[_0x491c('0xb')](_0x491c('0x11'),_0x447f57,_0x491c('0xd'));_0x1e332d(_0x56c621[_0x491c('0x13')][_0x491c('0x12')]);}})[_0x491c('0x14')](function(_0x33657f){logger[_0x491c('0xf')](_0x491c('0x11'),_0x447f57,_0x33657f);_0x16a0d0(_0x33657f);});});}exports[_0x491c('0x15')]=function(_0x1e04fc){var _0x4bdd82=this;return new Promise(function(_0x4318a4,_0x1900c7){return db[_0x491c('0x16')][_0x491c('0x17')](_0x1e04fc[_0x491c('0x18')],{'raw':_0x1e04fc['options']?_0x1e04fc['options'][_0x491c('0x19')]===undefined?!![]:![]:!![]})[_0x491c('0x1a')](function(_0x235297){logger[_0x491c('0xb')](_0x491c('0x15'),_0x1e04fc);logger[_0x491c('0xc')]('CreateSquareRecording',_0x1e04fc,JSON['stringify'](_0x235297));_0x4318a4(_0x235297);})[_0x491c('0x14')](function(_0x32badd){logger['error'](_0x491c('0x15'),_0x32badd[_0x491c('0x12')],_0x1e04fc);_0x1900c7(_0x4bdd82[_0x491c('0xf')](0x1f4,_0x32badd[_0x491c('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 93c1753..16552d2 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 _0xeda5=['post','create','/:id','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xeda5,0x138));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5eda('0x0'));var util=require('util');var path=require(_0x5eda('0x1'));var timeout=require('connect-timeout');var express=require(_0x5eda('0x2'));var router=express[_0x5eda('0x3')]();var auth=require(_0x5eda('0x4'));var interaction=require(_0x5eda('0x5'));var config=require(_0x5eda('0x6'));var controller=require('./squareReport.controller');router[_0x5eda('0x7')]('/',auth[_0x5eda('0x8')](),controller[_0x5eda('0x9')]);router[_0x5eda('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x5eda('0x8')](),controller[_0x5eda('0xa')]);router[_0x5eda('0xb')]('/',auth['isAuthenticated'](),controller[_0x5eda('0xc')]);router['put'](_0x5eda('0xd'),auth[_0x5eda('0x8')](),controller[_0x5eda('0xe')]);router['delete'](_0x5eda('0xd'),auth[_0x5eda('0x8')](),controller[_0x5eda('0xf')]);module[_0x5eda('0x10')]=router; \ No newline at end of file +var _0xd3be=['update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./squareReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3be,0x8f));var _0xed3b=function(_0x3a69bf,_0x174c3d){_0x3a69bf=_0x3a69bf-0x0;var _0x253ab5=_0xd3be[_0x3a69bf];return _0x253ab5;};'use strict';var multer=require(_0xed3b('0x0'));var util=require(_0xed3b('0x1'));var path=require(_0xed3b('0x2'));var timeout=require(_0xed3b('0x3'));var express=require(_0xed3b('0x4'));var router=express['Router']();var auth=require(_0xed3b('0x5'));var interaction=require(_0xed3b('0x6'));var config=require('../../config/environment');var controller=require(_0xed3b('0x7'));router['get']('/',auth[_0xed3b('0x8')](),controller[_0xed3b('0x9')]);router['get'](_0xed3b('0xa'),auth[_0xed3b('0x8')](),controller[_0xed3b('0xb')]);router[_0xed3b('0xc')](_0xed3b('0xd'),auth[_0xed3b('0x8')](),controller[_0xed3b('0xe')]);router['post']('/',auth[_0xed3b('0x8')](),controller[_0xed3b('0xf')]);router[_0xed3b('0x10')](_0xed3b('0xd'),auth['isAuthenticated'](),controller[_0xed3b('0x11')]);router['delete'](_0xed3b('0xd'),auth['isAuthenticated'](),controller[_0xed3b('0x12')]);module[_0xed3b('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index a8ef148..cb3ccc5 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 _0x7de3=['DATE','sequelize','exports','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7de3,0x1b5));var _0x37de=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x7de3[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0x37de('0x0'));module[_0x37de('0x1')]={'network':{'type':Sequelize[_0x37de('0x2')]},'network_script':{'type':Sequelize[_0x37de('0x2')]},'request':{'type':Sequelize[_0x37de('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x37de('0x2')]},'uniqueid':{'type':Sequelize[_0x37de('0x2')]},'version':{'type':Sequelize[_0x37de('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x37de('0x2')]},'callingpres':{'type':Sequelize[_0x37de('0x2')]},'callingani2':{'type':Sequelize[_0x37de('0x2')]},'callington':{'type':Sequelize[_0x37de('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x37de('0x2')]},'rdnis':{'type':Sequelize[_0x37de('0x2')]},'context':{'type':Sequelize[_0x37de('0x2')]},'extension':{'type':Sequelize[_0x37de('0x2')]},'priority':{'type':Sequelize[_0x37de('0x2')]},'enhanced':{'type':Sequelize[_0x37de('0x2')]},'accountcode':{'type':Sequelize[_0x37de('0x2')]},'threadid':{'type':Sequelize[_0x37de('0x2')]},'project_name':{'type':Sequelize[_0x37de('0x2')]},'joinAt':{'type':Sequelize[_0x37de('0x3')]},'leaveAt':{'type':Sequelize[_0x37de('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x66f8=['DATE','BOOLEAN','exports','STRING'];(function(_0x7b0cef,_0x231199){var _0x2d22a8=function(_0x34231d){while(--_0x34231d){_0x7b0cef['push'](_0x7b0cef['shift']());}};_0x2d22a8(++_0x231199);}(_0x66f8,0x1ce));var _0x866f=function(_0x1d5f11,_0xfcfb44){_0x1d5f11=_0x1d5f11-0x0;var _0x3ff2f0=_0x66f8[_0x1d5f11];return _0x3ff2f0;};'use strict';var Sequelize=require('sequelize');module[_0x866f('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x866f('0x1')]},'request':{'type':Sequelize[_0x866f('0x1')]},'channel':{'type':Sequelize[_0x866f('0x1')]},'language':{'type':Sequelize[_0x866f('0x1')]},'type':{'type':Sequelize[_0x866f('0x1')]},'uniqueid':{'type':Sequelize[_0x866f('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x866f('0x1')]},'calleridname':{'type':Sequelize[_0x866f('0x1')]},'callingpres':{'type':Sequelize[_0x866f('0x1')]},'callingani2':{'type':Sequelize[_0x866f('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x866f('0x1')]},'rdnis':{'type':Sequelize[_0x866f('0x1')]},'context':{'type':Sequelize[_0x866f('0x1')]},'extension':{'type':Sequelize[_0x866f('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x866f('0x1')]},'accountcode':{'type':Sequelize[_0x866f('0x1')]},'threadid':{'type':Sequelize[_0x866f('0x1')]},'project_name':{'type':Sequelize[_0x866f('0x1')]},'joinAt':{'type':Sequelize[_0x866f('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'bot':{'type':Sequelize[_0x866f('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d790b69..3ad7ac5 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 _0xc4aa=['request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']));if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['SquareReport']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['SquareReport'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['SquareReport'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['SquareReport'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file +var _0xf494=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','limit','apply','reject','update','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0xf494,0x1c6));var _0x4f49=function(_0x2d5e4c,_0x11e2b5){_0x2d5e4c=_0x2d5e4c-0x0;var _0x3a7f53=_0xf494[_0x2d5e4c];return _0x3a7f53;};'use strict';var pdf=require(_0x4f49('0x0'));var emlformat=require(_0x4f49('0x1'));var rimraf=require(_0x4f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f49('0x3'));var rp=require(_0x4f49('0x4'));var moment=require(_0x4f49('0x5'));var BPromise=require(_0x4f49('0x6'));var Mustache=require(_0x4f49('0x7'));var util=require(_0x4f49('0x8'));var path=require(_0x4f49('0x9'));var sox=require(_0x4f49('0xa'));var csv=require(_0x4f49('0xb'));var ejs=require(_0x4f49('0xc'));var fs=require('fs');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('0xb'));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 db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b9cd3,_0x12527d){_0x12527d=_0x12527d||0xcc;return function(_0x4bf89f){if(_0x4bf89f){return _0x4b9cd3[_0x4f49('0x18')](_0x12527d);}return _0x4b9cd3[_0x4f49('0x19')](_0x12527d)[_0x4f49('0x1a')]();};}function respondWithResult(_0x2efe49,_0x1a0f1e){_0x1a0f1e=_0x1a0f1e||0xc8;return function(_0x2f0131){if(_0x2f0131){return _0x2efe49[_0x4f49('0x19')](_0x1a0f1e)['json'](_0x2f0131);}};}function respondWithFilteredResult(_0x515ace,_0x1f2d0d){return function(_0x415e83){if(_0x415e83){var _0x5878f4=_0x415e83[_0x4f49('0x1b')],_0x5bdfaf=_0x1f2d0d['offset'],_0x2f0a0d=_0x1f2d0d[_0x4f49('0x1c')]+_0x1f2d0d[_0x4f49('0x1d')],_0x2ecaaa;if(_0x2f0a0d>=_0x5878f4){_0x2f0a0d=_0x5878f4;_0x2ecaaa=0xc8;}else{_0x2ecaaa=0xce;}_0x515ace[_0x4f49('0x19')](_0x2ecaaa);return _0x515ace['set']('Content-Range',_0x5bdfaf+'-'+_0x2f0a0d+'/'+_0x5878f4)['json'](_0x415e83);}return null;};}function patchUpdates(_0x47f1e8){return function(_0xb2081a){try{jsonpatch[_0x4f49('0x1e')](_0xb2081a,_0x47f1e8,!![]);}catch(_0x1c2d70){return BPromise[_0x4f49('0x1f')](_0x1c2d70);}return _0xb2081a['save']();};}function saveUpdates(_0x416893,_0x2aed27){return function(_0x197a49){if(_0x197a49){return _0x197a49[_0x4f49('0x20')](_0x416893)[_0x4f49('0x21')](function(_0x509f7c){return _0x509f7c;});}return null;};}function removeEntity(_0x3e7e28,_0x357446){return function(_0x3ae590){if(_0x3ae590){return _0x3ae590['destroy']()[_0x4f49('0x21')](function(){_0x3e7e28[_0x4f49('0x19')](0xcc)[_0x4f49('0x1a')]();});}};}function handleEntityNotFound(_0x43c458,_0x9d30aa){return function(_0x36187b){if(!_0x36187b){_0x43c458['sendStatus'](0x194);}return _0x36187b;};}function handleError(_0x4e9041,_0x3a947b){_0x3a947b=_0x3a947b||0x1f4;return function(_0x429de7){logger['error'](_0x429de7[_0x4f49('0x22')]);if(_0x429de7[_0x4f49('0x23')]){delete _0x429de7[_0x4f49('0x23')];}_0x4e9041['status'](_0x3a947b)[_0x4f49('0x24')](_0x429de7);};}exports[_0x4f49('0x25')]=function(_0x298785,_0x148153){var _0xfefbab={},_0x122404={},_0x4915af={'count':0x0,'rows':[]};var _0x50c571=_[_0x4f49('0x26')](db[_0x4f49('0x27')][_0x4f49('0x28')],function(_0x560050){return{'name':_0x560050[_0x4f49('0x29')],'type':_0x560050[_0x4f49('0x2a')][_0x4f49('0x2b')]};});_0x122404['model']=_['map'](_0x50c571,_0x4f49('0x23'));_0x122404[_0x4f49('0x2c')]=_[_0x4f49('0x2d')](_0x298785['query']);_0x122404[_0x4f49('0x2e')]=_[_0x4f49('0x2f')](_0x122404[_0x4f49('0x30')],_0x122404[_0x4f49('0x2c')]);_0xfefbab[_0x4f49('0x31')]=_[_0x4f49('0x2f')](_0x122404[_0x4f49('0x30')],qs[_0x4f49('0x32')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x32')]));_0xfefbab[_0x4f49('0x31')]=_0xfefbab[_0x4f49('0x31')][_0x4f49('0x33')]?_0xfefbab[_0x4f49('0x31')]:_0x122404[_0x4f49('0x30')];if(!_0x298785[_0x4f49('0x2c')][_0x4f49('0x34')](_0x4f49('0x35'))){_0xfefbab[_0x4f49('0x1d')]=qs['limit'](_0x298785[_0x4f49('0x2c')][_0x4f49('0x1d')]);_0xfefbab[_0x4f49('0x1c')]=qs[_0x4f49('0x1c')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x1c')]);}_0xfefbab[_0x4f49('0x36')]=qs[_0x4f49('0x37')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x37')]);_0xfefbab[_0x4f49('0x38')]=qs[_0x4f49('0x2e')](_[_0x4f49('0x39')](_0x298785['query'],_0x122404[_0x4f49('0x2e')]));if(_0x298785[_0x4f49('0x2c')][_0x4f49('0x3a')]){_0xfefbab[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0xfefbab[_0x4f49('0x38')],{'$or':_[_0x4f49('0x26')](_0x50c571,function(_0x25fdf8){if(_0x25fdf8[_0x4f49('0x2a')]!==_0x4f49('0x3c')){var _0x173b6e={};_0x173b6e[_0x25fdf8[_0x4f49('0x23')]]={'$like':'%'+_0x298785[_0x4f49('0x2c')][_0x4f49('0x3a')]+'%'};return _0x173b6e;}})});}_0xfefbab=_['merge']({},_0xfefbab,_0x298785[_0x4f49('0x3d')]);var _0xb0e6c2={'where':_0xfefbab['where']};return db[_0x4f49('0x27')][_0x4f49('0x1b')](_0xb0e6c2)['then'](function(_0x29e762){_0x4915af[_0x4f49('0x1b')]=_0x29e762;if(_0x298785[_0x4f49('0x2c')][_0x4f49('0x3e')]){_0xfefbab[_0x4f49('0x3f')]=[{'all':!![]}];}return db[_0x4f49('0x27')][_0x4f49('0x40')](_0xfefbab);})['then'](function(_0x5e1461){_0x4915af['rows']=_0x5e1461;return _0x4915af;})[_0x4f49('0x21')](respondWithFilteredResult(_0x148153,_0xfefbab))[_0x4f49('0x41')](handleError(_0x148153,null));};exports[_0x4f49('0x42')]=function(_0x373f90,_0x1053b2){var _0x1ecf6c={'raw':!![],'where':{'id':_0x373f90[_0x4f49('0x43')]['id']}},_0x38aff8={};_0x38aff8[_0x4f49('0x30')]=_['keys'](db['SquareReport'][_0x4f49('0x28')]);_0x38aff8[_0x4f49('0x2c')]=_[_0x4f49('0x2d')](_0x373f90['query']);_0x38aff8[_0x4f49('0x2e')]=_['intersection'](_0x38aff8['model'],_0x38aff8[_0x4f49('0x2c')]);_0x1ecf6c[_0x4f49('0x31')]=_[_0x4f49('0x2f')](_0x38aff8['model'],qs[_0x4f49('0x32')](_0x373f90[_0x4f49('0x2c')]['fields']));_0x1ecf6c[_0x4f49('0x31')]=_0x1ecf6c['attributes'][_0x4f49('0x33')]?_0x1ecf6c[_0x4f49('0x31')]:_0x38aff8[_0x4f49('0x30')];if(_0x373f90['query'][_0x4f49('0x3e')]){_0x1ecf6c[_0x4f49('0x3f')]=[{'all':!![]}];}_0x1ecf6c=_[_0x4f49('0x3b')]({},_0x1ecf6c,_0x373f90[_0x4f49('0x3d')]);return db[_0x4f49('0x27')][_0x4f49('0x44')](_0x1ecf6c)[_0x4f49('0x21')](handleEntityNotFound(_0x1053b2,null))[_0x4f49('0x21')](respondWithResult(_0x1053b2,null))[_0x4f49('0x41')](handleError(_0x1053b2,null));};exports[_0x4f49('0x45')]=function(_0x4fe382,_0x26c222){return db[_0x4f49('0x27')]['create'](_0x4fe382[_0x4f49('0x46')],{})['then'](respondWithResult(_0x26c222,0xc9))[_0x4f49('0x41')](handleError(_0x26c222,null));};exports[_0x4f49('0x20')]=function(_0x2d3dcd,_0x300230){if(_0x2d3dcd['body']['id']){delete _0x2d3dcd[_0x4f49('0x46')]['id'];}return db[_0x4f49('0x27')][_0x4f49('0x44')]({'where':{'id':_0x2d3dcd[_0x4f49('0x43')]['id']}})[_0x4f49('0x21')](handleEntityNotFound(_0x300230,null))[_0x4f49('0x21')](saveUpdates(_0x2d3dcd[_0x4f49('0x46')],null))[_0x4f49('0x21')](respondWithResult(_0x300230,null))[_0x4f49('0x41')](handleError(_0x300230,null));};exports[_0x4f49('0x47')]=function(_0x1be59a,_0x4482f7){return db[_0x4f49('0x27')][_0x4f49('0x44')]({'where':{'id':_0x1be59a[_0x4f49('0x43')]['id']}})[_0x4f49('0x21')](handleEntityNotFound(_0x4482f7,null))['then'](removeEntity(_0x4482f7,null))['catch'](handleError(_0x4482f7,null));};exports[_0x4f49('0x48')]=function(_0x197670,_0x36bcc2){return db[_0x4f49('0x27')][_0x4f49('0x48')]()[_0x4f49('0x21')](respondWithResult(_0x36bcc2,null))[_0x4f49('0x41')](handleError(_0x36bcc2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index a1d2545..9025cc7 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 _0x0db7=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0db7,0x9b));var _0x70db=function(_0x34d6b5,_0x3588e0){_0x34d6b5=_0x34d6b5-0x0;var _0x1fe906=_0x0db7[_0x34d6b5];return _0x1fe906;};'use strict';var _=require(_0x70db('0x0'));var util=require(_0x70db('0x1'));var logger=require(_0x70db('0x2'))('api');var moment=require(_0x70db('0x3'));var BPromise=require(_0x70db('0x4'));var rp=require(_0x70db('0x5'));var fs=require('fs');var path=require(_0x70db('0x6'));var rimraf=require(_0x70db('0x7'));var config=require(_0x70db('0x8'));var attributes=require(_0x70db('0x9'));module[_0x70db('0xa')]=function(_0x34a703,_0x5308c6){return _0x34a703['define'](_0x70db('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x70db('0xc'),'fields':[_0x70db('0xd'),_0x70db('0xe')]},{'name':_0x70db('0xf'),'fields':[_0x70db('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x898b=['uniqueid','leaveAt','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0x898b,0x1c4));var _0xb898=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x898b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb898('0x0'));var util=require(_0xb898('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb898('0x2'));var BPromise=require(_0xb898('0x3'));var rp=require(_0xb898('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb898('0x5'));var config=require(_0xb898('0x6'));var attributes=require(_0xb898('0x7'));module[_0xb898('0x8')]=function(_0x92a22c,_0x5bc5cb){return _0x92a22c[_0xb898('0x9')](_0xb898('0xa'),attributes,{'tableName':_0xb898('0xb'),'paranoid':![],'indexes':[{'name':_0xb898('0xc'),'fields':[_0xb898('0xd'),'project_name']},{'name':_0xb898('0xe'),'fields':[_0xb898('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d309c52..d4d07c5 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 _0x5771=['randomstring','../../config/logger','jayson/promise','client','http','request','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','options','raw','then','body','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird'];(function(_0x14d33d,_0x42c9d2){var _0x1a9ec7=function(_0x2c6704){while(--_0x2c6704){_0x14d33d['push'](_0x14d33d['shift']());}};_0x1a9ec7(++_0x42c9d2);}(_0x5771,0x114));var _0x1577=function(_0xc2c38b,_0x5b82d9){_0xc2c38b=_0xc2c38b-0x0;var _0x23ff55=_0x5771[_0xc2c38b];return _0x23ff55;};'use strict';var _=require(_0x1577('0x0'));var util=require(_0x1577('0x1'));var moment=require(_0x1577('0x2'));var BPromise=require(_0x1577('0x3'));var rs=require(_0x1577('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1577('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1577('0x6'));var client=jayson[_0x1577('0x7')][_0x1577('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2abcbc,_0x395794,_0x12086a){return new BPromise(function(_0x3f37e3,_0x13c641){return client[_0x1577('0x9')](_0x2abcbc,_0x12086a)['then'](function(_0x214137){logger[_0x1577('0xa')]('SquareReport,\x20%s,\x20%s',_0x395794,'request\x20sent');logger[_0x1577('0xb')](_0x1577('0xc'),_0x395794,'request\x20sent',JSON[_0x1577('0xd')](_0x214137));if(_0x214137[_0x1577('0xe')]){if(_0x214137[_0x1577('0xe')]['code']===0x1f4){logger[_0x1577('0xe')](_0x1577('0xf'),_0x395794,_0x214137[_0x1577('0xe')]['message']);return _0x13c641(_0x214137['error']['message']);}logger['error']('SquareReport,\x20%s,\x20%s',_0x395794,_0x214137[_0x1577('0xe')][_0x1577('0x10')]);return _0x3f37e3(_0x214137['error'][_0x1577('0x10')]);}else{logger[_0x1577('0xa')]('SquareReport,\x20%s,\x20%s',_0x395794,'request\x20sent');_0x3f37e3(_0x214137['result'][_0x1577('0x10')]);}})[_0x1577('0x11')](function(_0x530e30){logger['error'](_0x1577('0xf'),_0x395794,_0x530e30);_0x13c641(_0x530e30);});});}exports[_0x1577('0x12')]=function(_0x4ac695){var _0x55b50e=this;return new Promise(function(_0x167d2b,_0x4fad0a){return db[_0x1577('0x13')]['create'](_0x4ac695['body'],{'raw':_0x4ac695[_0x1577('0x14')]?_0x4ac695['options'][_0x1577('0x15')]===undefined?!![]:![]:!![]})[_0x1577('0x16')](function(_0x7d71df){logger['info'](_0x1577('0x12'),_0x4ac695);logger[_0x1577('0xb')](_0x1577('0x12'),_0x4ac695,JSON['stringify'](_0x7d71df));_0x167d2b(_0x7d71df);})[_0x1577('0x11')](function(_0x2ee577){logger[_0x1577('0xe')]('CreateSquareReport',_0x2ee577[_0x1577('0x10')],_0x4ac695);_0x4fad0a(_0x55b50e[_0x1577('0xe')](0x1f4,_0x2ee577['message']));});});};exports['UpdateSquareReport']=function(_0x20df48){var _0x7b69e3=this;return new Promise(function(_0x2ae9dd,_0x4614b3){return db[_0x1577('0x13')]['update'](_0x20df48[_0x1577('0x17')],{'raw':_0x20df48[_0x1577('0x14')]?_0x20df48[_0x1577('0x14')][_0x1577('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20df48['options']?_0x20df48[_0x1577('0x14')][_0x1577('0x18')]||null:null,'attributes':_0x20df48[_0x1577('0x14')]?_0x20df48[_0x1577('0x14')][_0x1577('0x19')]||null:null,'limit':_0x20df48['options']?_0x20df48['options'][_0x1577('0x1a')]||null:null})[_0x1577('0x16')](function(_0x65c8b5){logger[_0x1577('0xa')](_0x1577('0x1b'),_0x20df48);logger[_0x1577('0xb')]('UpdateSquareReport',_0x20df48,JSON[_0x1577('0xd')](_0x65c8b5));_0x2ae9dd(_0x65c8b5);})[_0x1577('0x11')](function(_0x4cf146){logger[_0x1577('0xe')](_0x1577('0x1b'),_0x4cf146['message'],_0x20df48);_0x4614b3(_0x7b69e3[_0x1577('0xe')](0x1f4,_0x4cf146[_0x1577('0x10')]));});});}; \ No newline at end of file +var _0xef69=['stringify','error','code','message','result','catch','CreateSquareReport','create','body','options','then','debug','UpdateSquareReport','SquareReport','raw','where','attributes','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef69,0x1be));var _0x9ef6=function(_0x112b01,_0x7fbb25){_0x112b01=_0x112b01-0x0;var _0x2af193=_0xef69[_0x112b01];return _0x2af193;};'use strict';var _=require(_0x9ef6('0x0'));var util=require(_0x9ef6('0x1'));var moment=require(_0x9ef6('0x2'));var BPromise=require('bluebird');var rs=require(_0x9ef6('0x3'));var fs=require('fs');var Redis=require(_0x9ef6('0x4'));var db=require(_0x9ef6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ef6('0x6'))(_0x9ef6('0x7'));var config=require(_0x9ef6('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9ef6('0x9')][_0x9ef6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x18e8b4,_0x680fee,_0x2ca24b){return new BPromise(function(_0x2b32a9,_0x4ba4c3){return client[_0x9ef6('0xb')](_0x18e8b4,_0x2ca24b)['then'](function(_0x411ab7){logger[_0x9ef6('0xc')](_0x9ef6('0xd'),_0x680fee,'request\x20sent');logger['debug'](_0x9ef6('0xe'),_0x680fee,_0x9ef6('0xf'),JSON[_0x9ef6('0x10')](_0x411ab7));if(_0x411ab7[_0x9ef6('0x11')]){if(_0x411ab7[_0x9ef6('0x11')][_0x9ef6('0x12')]===0x1f4){logger[_0x9ef6('0x11')](_0x9ef6('0xd'),_0x680fee,_0x411ab7[_0x9ef6('0x11')][_0x9ef6('0x13')]);return _0x4ba4c3(_0x411ab7['error'][_0x9ef6('0x13')]);}logger[_0x9ef6('0x11')](_0x9ef6('0xd'),_0x680fee,_0x411ab7[_0x9ef6('0x11')][_0x9ef6('0x13')]);return _0x2b32a9(_0x411ab7['error']['message']);}else{logger[_0x9ef6('0xc')](_0x9ef6('0xd'),_0x680fee,_0x9ef6('0xf'));_0x2b32a9(_0x411ab7[_0x9ef6('0x14')]['message']);}})[_0x9ef6('0x15')](function(_0x480a18){logger[_0x9ef6('0x11')]('SquareReport,\x20%s,\x20%s',_0x680fee,_0x480a18);_0x4ba4c3(_0x480a18);});});}exports[_0x9ef6('0x16')]=function(_0x2709a){var _0x2c5545=this;return new Promise(function(_0x18b732,_0xb74539){return db['SquareReport'][_0x9ef6('0x17')](_0x2709a[_0x9ef6('0x18')],{'raw':_0x2709a['options']?_0x2709a[_0x9ef6('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x9ef6('0x1a')](function(_0x15e2ca){logger[_0x9ef6('0xc')](_0x9ef6('0x16'),_0x2709a);logger[_0x9ef6('0x1b')]('CreateSquareReport',_0x2709a,JSON['stringify'](_0x15e2ca));_0x18b732(_0x15e2ca);})['catch'](function(_0x523b1e){logger[_0x9ef6('0x11')]('CreateSquareReport',_0x523b1e[_0x9ef6('0x13')],_0x2709a);_0xb74539(_0x2c5545[_0x9ef6('0x11')](0x1f4,_0x523b1e[_0x9ef6('0x13')]));});});};exports[_0x9ef6('0x1c')]=function(_0x533c8b){var _0x4e7aeb=this;return new Promise(function(_0x3c6c7f,_0x2c593a){return db[_0x9ef6('0x1d')]['update'](_0x533c8b[_0x9ef6('0x18')],{'raw':_0x533c8b['options']?_0x533c8b['options'][_0x9ef6('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533c8b['options']?_0x533c8b['options'][_0x9ef6('0x1f')]||null:null,'attributes':_0x533c8b[_0x9ef6('0x19')]?_0x533c8b[_0x9ef6('0x19')][_0x9ef6('0x20')]||null:null,'limit':_0x533c8b['options']?_0x533c8b['options']['limit']||null:null})[_0x9ef6('0x1a')](function(_0x31ec97){logger[_0x9ef6('0xc')](_0x9ef6('0x1c'),_0x533c8b);logger[_0x9ef6('0x1b')](_0x9ef6('0x1c'),_0x533c8b,JSON[_0x9ef6('0x10')](_0x31ec97));_0x3c6c7f(_0x31ec97);})[_0x9ef6('0x15')](function(_0x141da4){logger[_0x9ef6('0x11')](_0x9ef6('0x1c'),_0x141da4[_0x9ef6('0x13')],_0x533c8b);_0x2c593a(_0x4e7aeb['error'](0x1f4,_0x141da4[_0x9ef6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b8b9c44..e045651 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 _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x814b,0x1a2));var _0xb814=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0x814b[_0x3a3d20];return _0x33bc94;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x814b,0x1a2));var _0xb814=function(_0x4b2b03,_0xbf34ee){_0x4b2b03=_0x4b2b03-0x0;var _0x1bf0ed=_0x814b[_0x4b2b03];return _0x1bf0ed;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('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 8356201..08cc98a 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 _0x13ba=['exports','STRING','TEXT','sequelize'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x13ba,0x83));var _0xa13b=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x13ba[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0xa13b('0x0'));module[_0xa13b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xa13b('0x2')]},'application':{'type':Sequelize[_0xa13b('0x2')]},'data':{'type':Sequelize[_0xa13b('0x3')]},'project_name':{'type':Sequelize[_0xa13b('0x2')]},'callerid':{'type':Sequelize[_0xa13b('0x2')]}}; \ No newline at end of file +var _0x4051=['sequelize','exports','STRING','TEXT'];(function(_0x11aa3d,_0x3f3af9){var _0x3000d1=function(_0x3ffb4f){while(--_0x3ffb4f){_0x11aa3d['push'](_0x11aa3d['shift']());}};_0x3000d1(++_0x3f3af9);}(_0x4051,0xe4));var _0x1405=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0x4051[_0x2d2c16];return _0x53f2fb;};'use strict';var Sequelize=require(_0x1405('0x0'));module[_0x1405('0x1')]={'uniqueid':{'type':Sequelize[_0x1405('0x2')]},'node':{'type':Sequelize[_0x1405('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x1405('0x3')]},'project_name':{'type':Sequelize[_0x1405('0x2')]},'callerid':{'type':Sequelize[_0x1405('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 6dde1fa..e3d62e9 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 _0xc6a7=['lodash','squel','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','json','count','offset','limit','apply','reject','update','then','destroy','stack','send','index','map','SquareDetailsReport','type','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x43f53c,_0x368dae){var _0x4d56a9=function(_0x502b60){while(--_0x502b60){_0x43f53c['push'](_0x43f53c['shift']());}};_0x4d56a9(++_0x368dae);}(_0xc6a7,0x198));var _0x7c6a=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xc6a7[_0x616290];return _0x453879;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7c6a('0x0'));var rimraf=require(_0x7c6a('0x1'));var zipdir=require(_0x7c6a('0x2'));var jsonpatch=require(_0x7c6a('0x3'));var rp=require(_0x7c6a('0x4'));var moment=require('moment');var BPromise=require(_0x7c6a('0x5'));var Mustache=require(_0x7c6a('0x6'));var util=require(_0x7c6a('0x7'));var path=require(_0x7c6a('0x8'));var sox=require(_0x7c6a('0x9'));var csv=require(_0x7c6a('0xa'));var ejs=require(_0x7c6a('0xb'));var fs=require('fs');var _=require(_0x7c6a('0xc'));var squel=require(_0x7c6a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c6a('0xe'));var toCsv=require(_0x7c6a('0xa'));var querystring=require(_0x7c6a('0xf'));var Papa=require(_0x7c6a('0x10'));var Redis=require('ioredis');var authService=require(_0x7c6a('0x11'));var qs=require(_0x7c6a('0x12'));var as=require(_0x7c6a('0x13'));var hardwareService=require(_0x7c6a('0x14'));var logger=require(_0x7c6a('0x15'))(_0x7c6a('0x16'));var utils=require(_0x7c6a('0x17'));var config=require(_0x7c6a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29d82e,_0x139ff8){_0x139ff8=_0x139ff8||0xcc;return function(_0x24c7c1){if(_0x24c7c1){return _0x29d82e[_0x7c6a('0x19')](_0x139ff8);}return _0x29d82e[_0x7c6a('0x1a')](_0x139ff8)['end']();};}function respondWithResult(_0x1c3ea5,_0x1e271a){_0x1e271a=_0x1e271a||0xc8;return function(_0x20bbd4){if(_0x20bbd4){return _0x1c3ea5['status'](_0x1e271a)[_0x7c6a('0x1b')](_0x20bbd4);}};}function respondWithFilteredResult(_0x5457f8,_0x76b55b){return function(_0x3163c7){if(_0x3163c7){var _0x44f7dd=_0x3163c7[_0x7c6a('0x1c')],_0x2d23ed=_0x76b55b[_0x7c6a('0x1d')],_0x34b6f7=_0x76b55b['offset']+_0x76b55b[_0x7c6a('0x1e')],_0x5229e4;if(_0x34b6f7>=_0x44f7dd){_0x34b6f7=_0x44f7dd;_0x5229e4=0xc8;}else{_0x5229e4=0xce;}_0x5457f8['status'](_0x5229e4);return _0x5457f8['set']('Content-Range',_0x2d23ed+'-'+_0x34b6f7+'/'+_0x44f7dd)['json'](_0x3163c7);}return null;};}function patchUpdates(_0x3c42d7){return function(_0x538a47){try{jsonpatch[_0x7c6a('0x1f')](_0x538a47,_0x3c42d7,!![]);}catch(_0x107de9){return BPromise[_0x7c6a('0x20')](_0x107de9);}return _0x538a47['save']();};}function saveUpdates(_0x3b05f7,_0x35c037){return function(_0xf490bb){if(_0xf490bb){return _0xf490bb[_0x7c6a('0x21')](_0x3b05f7)[_0x7c6a('0x22')](function(_0x554329){return _0x554329;});}return null;};}function removeEntity(_0x52b759,_0x58b75d){return function(_0x4ab350){if(_0x4ab350){return _0x4ab350[_0x7c6a('0x23')]()[_0x7c6a('0x22')](function(){_0x52b759[_0x7c6a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e06cb,_0x15e16f){return function(_0xf57726){if(!_0xf57726){_0x2e06cb[_0x7c6a('0x19')](0x194);}return _0xf57726;};}function handleError(_0x54f3e4,_0x290515){_0x290515=_0x290515||0x1f4;return function(_0x1b081e){logger['error'](_0x1b081e[_0x7c6a('0x24')]);if(_0x1b081e['name']){delete _0x1b081e['name'];}_0x54f3e4[_0x7c6a('0x1a')](_0x290515)[_0x7c6a('0x25')](_0x1b081e);};}exports[_0x7c6a('0x26')]=function(_0x5d1397,_0x79ac45){var _0x187372={},_0x5c5c1e={},_0x4bc249={'count':0x0,'rows':[]};var _0x3efb5e=_[_0x7c6a('0x27')](db[_0x7c6a('0x28')]['rawAttributes'],function(_0x6968ad){return{'name':_0x6968ad['fieldName'],'type':_0x6968ad[_0x7c6a('0x29')]['key']};});_0x5c5c1e['model']=_[_0x7c6a('0x27')](_0x3efb5e,_0x7c6a('0x2a'));_0x5c5c1e[_0x7c6a('0x2b')]=_[_0x7c6a('0x2c')](_0x5d1397[_0x7c6a('0x2b')]);_0x5c5c1e[_0x7c6a('0x2d')]=_['intersection'](_0x5c5c1e[_0x7c6a('0x2e')],_0x5c5c1e[_0x7c6a('0x2b')]);_0x187372[_0x7c6a('0x2f')]=_[_0x7c6a('0x30')](_0x5c5c1e[_0x7c6a('0x2e')],qs[_0x7c6a('0x31')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x31')]));_0x187372[_0x7c6a('0x2f')]=_0x187372[_0x7c6a('0x2f')][_0x7c6a('0x32')]?_0x187372['attributes']:_0x5c5c1e['model'];if(!_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x33')](_0x7c6a('0x34'))){_0x187372[_0x7c6a('0x1e')]=qs[_0x7c6a('0x1e')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x1e')]);_0x187372[_0x7c6a('0x1d')]=qs[_0x7c6a('0x1d')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x1d')]);}_0x187372['order']=qs[_0x7c6a('0x35')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x35')]);_0x187372[_0x7c6a('0x36')]=qs[_0x7c6a('0x2d')](_['pick'](_0x5d1397[_0x7c6a('0x2b')],_0x5c5c1e[_0x7c6a('0x2d')]));if(_0x5d1397[_0x7c6a('0x2b')]['filter']){_0x187372[_0x7c6a('0x36')]=_[_0x7c6a('0x37')](_0x187372[_0x7c6a('0x36')],{'$or':_[_0x7c6a('0x27')](_0x3efb5e,function(_0x156205){if(_0x156205[_0x7c6a('0x29')]!=='VIRTUAL'){var _0x585036={};_0x585036[_0x156205['name']]={'$like':'%'+_0x5d1397['query'][_0x7c6a('0x38')]+'%'};return _0x585036;}})});}_0x187372=_[_0x7c6a('0x37')]({},_0x187372,_0x5d1397['options']);var _0x48dc3b={'where':_0x187372[_0x7c6a('0x36')]};return db[_0x7c6a('0x28')]['count'](_0x48dc3b)[_0x7c6a('0x22')](function(_0x2323c1){_0x4bc249['count']=_0x2323c1;if(_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x39')]){_0x187372[_0x7c6a('0x3a')]=[{'all':!![]}];}return db[_0x7c6a('0x28')][_0x7c6a('0x3b')](_0x187372);})[_0x7c6a('0x22')](function(_0x1b6bff){_0x4bc249[_0x7c6a('0x3c')]=_0x1b6bff;return _0x4bc249;})[_0x7c6a('0x22')](respondWithFilteredResult(_0x79ac45,_0x187372))[_0x7c6a('0x3d')](handleError(_0x79ac45,null));};exports[_0x7c6a('0x3e')]=function(_0x4922cb,_0xc49f4a){var _0x2ecb1b={'raw':!![],'where':{'id':_0x4922cb[_0x7c6a('0x3f')]['id']}},_0x5c7bd0={};_0x5c7bd0[_0x7c6a('0x2e')]=_[_0x7c6a('0x2c')](db[_0x7c6a('0x28')][_0x7c6a('0x40')]);_0x5c7bd0[_0x7c6a('0x2b')]=_['keys'](_0x4922cb[_0x7c6a('0x2b')]);_0x5c7bd0[_0x7c6a('0x2d')]=_[_0x7c6a('0x30')](_0x5c7bd0[_0x7c6a('0x2e')],_0x5c7bd0[_0x7c6a('0x2b')]);_0x2ecb1b[_0x7c6a('0x2f')]=_[_0x7c6a('0x30')](_0x5c7bd0[_0x7c6a('0x2e')],qs[_0x7c6a('0x31')](_0x4922cb['query']['fields']));_0x2ecb1b['attributes']=_0x2ecb1b['attributes'][_0x7c6a('0x32')]?_0x2ecb1b[_0x7c6a('0x2f')]:_0x5c7bd0[_0x7c6a('0x2e')];if(_0x4922cb[_0x7c6a('0x2b')][_0x7c6a('0x39')]){_0x2ecb1b[_0x7c6a('0x3a')]=[{'all':!![]}];}_0x2ecb1b=_[_0x7c6a('0x37')]({},_0x2ecb1b,_0x4922cb[_0x7c6a('0x41')]);return db[_0x7c6a('0x28')][_0x7c6a('0x42')](_0x2ecb1b)[_0x7c6a('0x22')](handleEntityNotFound(_0xc49f4a,null))[_0x7c6a('0x22')](respondWithResult(_0xc49f4a,null))['catch'](handleError(_0xc49f4a,null));};exports[_0x7c6a('0x43')]=function(_0x151cfe,_0x54270d){return db[_0x7c6a('0x28')][_0x7c6a('0x43')](_0x151cfe[_0x7c6a('0x44')],{})[_0x7c6a('0x22')](respondWithResult(_0x54270d,0xc9))['catch'](handleError(_0x54270d,null));};exports[_0x7c6a('0x21')]=function(_0x4465a0,_0x18cde5){if(_0x4465a0[_0x7c6a('0x44')]['id']){delete _0x4465a0['body']['id'];}return db[_0x7c6a('0x28')][_0x7c6a('0x42')]({'where':{'id':_0x4465a0[_0x7c6a('0x3f')]['id']}})[_0x7c6a('0x22')](handleEntityNotFound(_0x18cde5,null))[_0x7c6a('0x22')](saveUpdates(_0x4465a0[_0x7c6a('0x44')],null))[_0x7c6a('0x22')](respondWithResult(_0x18cde5,null))[_0x7c6a('0x3d')](handleError(_0x18cde5,null));};exports[_0x7c6a('0x23')]=function(_0x4da9b0,_0x13e8bc){return db['SquareDetailsReport'][_0x7c6a('0x42')]({'where':{'id':_0x4da9b0[_0x7c6a('0x3f')]['id']}})[_0x7c6a('0x22')](handleEntityNotFound(_0x13e8bc,null))[_0x7c6a('0x22')](removeEntity(_0x13e8bc,null))['catch'](handleError(_0x13e8bc,null));};exports['describe']=function(_0x297a86,_0x28a50e){return db['SquareDetailsReport'][_0x7c6a('0x45')]()[_0x7c6a('0x22')](respondWithResult(_0x28a50e,null))[_0x7c6a('0x3d')](handleError(_0x28a50e,null));}; \ No newline at end of file +var _0x160b=['squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','index','map','SquareDetailsReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','merge','VIRTUAL','name','options','count','findAll','catch','show','includeAll','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0x160b,0x108));var _0xb160=function(_0x207533,_0x2044c9){_0x207533=_0x207533-0x0;var _0x387b9f=_0x160b[_0x207533];return _0x387b9f;};'use strict';var pdf=require(_0xb160('0x0'));var emlformat=require(_0xb160('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb160('0x2'));var jsonpatch=require(_0xb160('0x3'));var rp=require(_0xb160('0x4'));var moment=require(_0xb160('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb160('0x6'));var util=require(_0xb160('0x7'));var path=require(_0xb160('0x8'));var sox=require(_0xb160('0x9'));var csv=require(_0xb160('0xa'));var ejs=require(_0xb160('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb160('0xc'));var crypto=require(_0xb160('0xd'));var jsforce=require(_0xb160('0xe'));var deskjs=require(_0xb160('0xf'));var toCsv=require(_0xb160('0xa'));var querystring=require(_0xb160('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb160('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb160('0x12'));var hardwareService=require(_0xb160('0x13'));var logger=require('../../config/logger')(_0xb160('0x14'));var utils=require('../../config/utils');var config=require(_0xb160('0x15'));var db=require(_0xb160('0x16'))['db'];function respondWithStatusCode(_0x57d61f,_0x4c1dfb){_0x4c1dfb=_0x4c1dfb||0xcc;return function(_0x13c4ba){if(_0x13c4ba){return _0x57d61f[_0xb160('0x17')](_0x4c1dfb);}return _0x57d61f[_0xb160('0x18')](_0x4c1dfb)[_0xb160('0x19')]();};}function respondWithResult(_0x18d7b8,_0x11cd1a){_0x11cd1a=_0x11cd1a||0xc8;return function(_0x218061){if(_0x218061){return _0x18d7b8[_0xb160('0x18')](_0x11cd1a)[_0xb160('0x1a')](_0x218061);}};}function respondWithFilteredResult(_0x5756ed,_0x27333d){return function(_0x196f98){if(_0x196f98){var _0x4b36da=_0x196f98['count'],_0x5604cb=_0x27333d[_0xb160('0x1b')],_0x5a1333=_0x27333d['offset']+_0x27333d[_0xb160('0x1c')],_0x36ac9e;if(_0x5a1333>=_0x4b36da){_0x5a1333=_0x4b36da;_0x36ac9e=0xc8;}else{_0x36ac9e=0xce;}_0x5756ed[_0xb160('0x18')](_0x36ac9e);return _0x5756ed[_0xb160('0x1d')](_0xb160('0x1e'),_0x5604cb+'-'+_0x5a1333+'/'+_0x4b36da)[_0xb160('0x1a')](_0x196f98);}return null;};}function patchUpdates(_0x4174d8){return function(_0x1ec535){try{jsonpatch[_0xb160('0x1f')](_0x1ec535,_0x4174d8,!![]);}catch(_0x4f4797){return BPromise[_0xb160('0x20')](_0x4f4797);}return _0x1ec535[_0xb160('0x21')]();};}function saveUpdates(_0x3a1020,_0xa50fbe){return function(_0x21a762){if(_0x21a762){return _0x21a762[_0xb160('0x22')](_0x3a1020)['then'](function(_0x3b0a96){return _0x3b0a96;});}return null;};}function removeEntity(_0x35bbbd,_0x4c871a){return function(_0x595b4d){if(_0x595b4d){return _0x595b4d[_0xb160('0x23')]()[_0xb160('0x24')](function(){_0x35bbbd[_0xb160('0x18')](0xcc)[_0xb160('0x19')]();});}};}function handleEntityNotFound(_0x1dd74e,_0x21da57){return function(_0x11795b){if(!_0x11795b){_0x1dd74e[_0xb160('0x17')](0x194);}return _0x11795b;};}function handleError(_0x173d34,_0x41c0da){_0x41c0da=_0x41c0da||0x1f4;return function(_0x209d3a){logger[_0xb160('0x25')](_0x209d3a[_0xb160('0x26')]);if(_0x209d3a['name']){delete _0x209d3a['name'];}_0x173d34[_0xb160('0x18')](_0x41c0da)['send'](_0x209d3a);};}exports[_0xb160('0x27')]=function(_0x4b9860,_0xeb20a9){var _0x42d6df={},_0x477d6f={},_0x63c0b={'count':0x0,'rows':[]};var _0x21d6f6=_[_0xb160('0x28')](db[_0xb160('0x29')]['rawAttributes'],function(_0x1f85fe){return{'name':_0x1f85fe[_0xb160('0x2a')],'type':_0x1f85fe[_0xb160('0x2b')][_0xb160('0x2c')]};});_0x477d6f[_0xb160('0x2d')]=_[_0xb160('0x28')](_0x21d6f6,'name');_0x477d6f[_0xb160('0x2e')]=_[_0xb160('0x2f')](_0x4b9860[_0xb160('0x2e')]);_0x477d6f['filters']=_[_0xb160('0x30')](_0x477d6f['model'],_0x477d6f[_0xb160('0x2e')]);_0x42d6df[_0xb160('0x31')]=_['intersection'](_0x477d6f[_0xb160('0x2d')],qs[_0xb160('0x32')](_0x4b9860['query'][_0xb160('0x32')]));_0x42d6df[_0xb160('0x31')]=_0x42d6df[_0xb160('0x31')]['length']?_0x42d6df[_0xb160('0x31')]:_0x477d6f[_0xb160('0x2d')];if(!_0x4b9860[_0xb160('0x2e')]['hasOwnProperty'](_0xb160('0x33'))){_0x42d6df[_0xb160('0x1c')]=qs['limit'](_0x4b9860['query']['limit']);_0x42d6df[_0xb160('0x1b')]=qs[_0xb160('0x1b')](_0x4b9860[_0xb160('0x2e')][_0xb160('0x1b')]);}_0x42d6df['order']=qs['sort'](_0x4b9860[_0xb160('0x2e')][_0xb160('0x34')]);_0x42d6df[_0xb160('0x35')]=qs[_0xb160('0x36')](_[_0xb160('0x37')](_0x4b9860[_0xb160('0x2e')],_0x477d6f[_0xb160('0x36')]));if(_0x4b9860[_0xb160('0x2e')]['filter']){_0x42d6df[_0xb160('0x35')]=_[_0xb160('0x38')](_0x42d6df['where'],{'$or':_[_0xb160('0x28')](_0x21d6f6,function(_0x2f3356){if(_0x2f3356[_0xb160('0x2b')]!==_0xb160('0x39')){var _0x59d1dc={};_0x59d1dc[_0x2f3356[_0xb160('0x3a')]]={'$like':'%'+_0x4b9860[_0xb160('0x2e')]['filter']+'%'};return _0x59d1dc;}})});}_0x42d6df=_[_0xb160('0x38')]({},_0x42d6df,_0x4b9860[_0xb160('0x3b')]);var _0x163f41={'where':_0x42d6df[_0xb160('0x35')]};return db[_0xb160('0x29')][_0xb160('0x3c')](_0x163f41)[_0xb160('0x24')](function(_0x473a58){_0x63c0b['count']=_0x473a58;if(_0x4b9860['query']['includeAll']){_0x42d6df['include']=[{'all':!![]}];}return db[_0xb160('0x29')][_0xb160('0x3d')](_0x42d6df);})[_0xb160('0x24')](function(_0x1f72a1){_0x63c0b['rows']=_0x1f72a1;return _0x63c0b;})[_0xb160('0x24')](respondWithFilteredResult(_0xeb20a9,_0x42d6df))[_0xb160('0x3e')](handleError(_0xeb20a9,null));};exports[_0xb160('0x3f')]=function(_0x1a8320,_0x5e171b){var _0x52ba31={'raw':!![],'where':{'id':_0x1a8320['params']['id']}},_0x99a798={};_0x99a798[_0xb160('0x2d')]=_[_0xb160('0x2f')](db['SquareDetailsReport']['rawAttributes']);_0x99a798[_0xb160('0x2e')]=_[_0xb160('0x2f')](_0x1a8320[_0xb160('0x2e')]);_0x99a798[_0xb160('0x36')]=_['intersection'](_0x99a798[_0xb160('0x2d')],_0x99a798[_0xb160('0x2e')]);_0x52ba31[_0xb160('0x31')]=_[_0xb160('0x30')](_0x99a798[_0xb160('0x2d')],qs[_0xb160('0x32')](_0x1a8320['query'][_0xb160('0x32')]));_0x52ba31[_0xb160('0x31')]=_0x52ba31[_0xb160('0x31')]['length']?_0x52ba31[_0xb160('0x31')]:_0x99a798['model'];if(_0x1a8320['query'][_0xb160('0x40')]){_0x52ba31['include']=[{'all':!![]}];}_0x52ba31=_[_0xb160('0x38')]({},_0x52ba31,_0x1a8320[_0xb160('0x3b')]);return db[_0xb160('0x29')][_0xb160('0x41')](_0x52ba31)[_0xb160('0x24')](handleEntityNotFound(_0x5e171b,null))[_0xb160('0x24')](respondWithResult(_0x5e171b,null))['catch'](handleError(_0x5e171b,null));};exports['create']=function(_0x1fdc76,_0x42fed9){return db['SquareDetailsReport'][_0xb160('0x42')](_0x1fdc76[_0xb160('0x43')],{})['then'](respondWithResult(_0x42fed9,0xc9))[_0xb160('0x3e')](handleError(_0x42fed9,null));};exports['update']=function(_0x290db2,_0x1f78f3){if(_0x290db2[_0xb160('0x43')]['id']){delete _0x290db2[_0xb160('0x43')]['id'];}return db[_0xb160('0x29')][_0xb160('0x41')]({'where':{'id':_0x290db2[_0xb160('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f78f3,null))[_0xb160('0x24')](saveUpdates(_0x290db2[_0xb160('0x43')],null))[_0xb160('0x24')](respondWithResult(_0x1f78f3,null))[_0xb160('0x3e')](handleError(_0x1f78f3,null));};exports['destroy']=function(_0x387584,_0x555c98){return db[_0xb160('0x29')]['find']({'where':{'id':_0x387584[_0xb160('0x44')]['id']}})['then'](handleEntityNotFound(_0x555c98,null))[_0xb160('0x24')](removeEntity(_0x555c98,null))[_0xb160('0x3e')](handleError(_0x555c98,null));};exports['describe']=function(_0x18bb64,_0x19959c){return db[_0xb160('0x29')]['describe']()[_0xb160('0x24')](respondWithResult(_0x19959c,null))[_0xb160('0x3e')](handleError(_0x19959c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 93689a5..b5a8800 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 _0x5f14=['define','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x7c7843,_0x2f5468){var _0x393bc0=function(_0x2bc352){while(--_0x2bc352){_0x7c7843['push'](_0x7c7843['shift']());}};_0x393bc0(++_0x2f5468);}(_0x5f14,0x157));var _0x45f1=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x5f14[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x45f1('0x0'));var util=require(_0x45f1('0x1'));var logger=require(_0x45f1('0x2'))(_0x45f1('0x3'));var moment=require(_0x45f1('0x4'));var BPromise=require(_0x45f1('0x5'));var rp=require(_0x45f1('0x6'));var fs=require('fs');var path=require(_0x45f1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x45f1('0x8')]=function(_0x50e5a4,_0x43e2d9){return _0x50e5a4[_0x45f1('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x45f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8d9=['../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x535cf7,_0x387418){var _0x26faee=function(_0x582b55){while(--_0x582b55){_0x535cf7['push'](_0x535cf7['shift']());}};_0x26faee(++_0x387418);}(_0xa8d9,0x1f1));var _0x9a8d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa8d9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9a8d('0x0'));var util=require(_0x9a8d('0x1'));var logger=require(_0x9a8d('0x2'))(_0x9a8d('0x3'));var moment=require(_0x9a8d('0x4'));var BPromise=require('bluebird');var rp=require(_0x9a8d('0x5'));var fs=require('fs');var path=require(_0x9a8d('0x6'));var rimraf=require('rimraf');var config=require(_0x9a8d('0x7'));var attributes=require(_0x9a8d('0x8'));module[_0x9a8d('0x9')]=function(_0x107151,_0x22d107){return _0x107151['define'](_0x9a8d('0xa'),attributes,{'tableName':_0x9a8d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 7f98202..7a53649 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 _0x9d3a=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9d3a,0x8e));var _0xa9d3=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0x9d3a[_0x1f6f84];return _0x177f40;};'use strict';var _=require(_0xa9d3('0x0'));var util=require(_0xa9d3('0x1'));var moment=require(_0xa9d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa9d3('0x3'));var fs=require('fs');var Redis=require(_0xa9d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9d3('0x5'));var config=require(_0xa9d3('0x6'));var jayson=require(_0xa9d3('0x7'));var client=jayson['client'][_0xa9d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3db214,_0x3f18dc,_0x50d4fe){return new BPromise(function(_0x1d28cb,_0xf250ff){return client[_0xa9d3('0x9')](_0x3db214,_0x50d4fe)[_0xa9d3('0xa')](function(_0x5601a1){logger[_0xa9d3('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x3f18dc,_0xa9d3('0xc'));logger[_0xa9d3('0xd')](_0xa9d3('0xe'),_0x3f18dc,_0xa9d3('0xc'),JSON[_0xa9d3('0xf')](_0x5601a1));if(_0x5601a1['error']){if(_0x5601a1[_0xa9d3('0x10')]['code']===0x1f4){logger[_0xa9d3('0x10')](_0xa9d3('0x11'),_0x3f18dc,_0x5601a1['error'][_0xa9d3('0x12')]);return _0xf250ff(_0x5601a1[_0xa9d3('0x10')]['message']);}logger[_0xa9d3('0x10')](_0xa9d3('0x11'),_0x3f18dc,_0x5601a1[_0xa9d3('0x10')]['message']);return _0x1d28cb(_0x5601a1[_0xa9d3('0x10')]['message']);}else{logger[_0xa9d3('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x3f18dc,_0xa9d3('0xc'));_0x1d28cb(_0x5601a1[_0xa9d3('0x13')]['message']);}})[_0xa9d3('0x14')](function(_0x31d4f1){logger['error'](_0xa9d3('0x11'),_0x3f18dc,_0x31d4f1);_0xf250ff(_0x31d4f1);});});}exports[_0xa9d3('0x15')]=function(_0x280dba){var _0x34a51b=this;return new Promise(function(_0x27940a,_0x2b2654){return db[_0xa9d3('0x16')][_0xa9d3('0x17')](_0x280dba[_0xa9d3('0x18')],{'raw':_0x280dba[_0xa9d3('0x19')]?_0x280dba[_0xa9d3('0x19')][_0xa9d3('0x1a')]===undefined?!![]:![]:!![]})[_0xa9d3('0xa')](function(_0x1f4579){logger[_0xa9d3('0xb')]('CreateSquareDetailsReport',_0x280dba);logger[_0xa9d3('0xd')](_0xa9d3('0x15'),_0x280dba,JSON[_0xa9d3('0xf')](_0x1f4579));_0x27940a(_0x1f4579);})[_0xa9d3('0x14')](function(_0x6324){logger[_0xa9d3('0x10')]('CreateSquareDetailsReport',_0x6324[_0xa9d3('0x12')],_0x280dba);_0x2b2654(_0x34a51b[_0xa9d3('0x10')](0x1f4,_0x6324[_0xa9d3('0x12')]));});});}; \ No newline at end of file +var _0x3b0a=['code','SquareDetailsReport,\x20%s,\x20%s','message','result','CreateSquareDetailsReport','SquareDetailsReport','options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b433d,_0x438ce8){var _0x2b62d9=function(_0x13074e){while(--_0x13074e){_0x2b433d['push'](_0x2b433d['shift']());}};_0x2b62d9(++_0x438ce8);}(_0x3b0a,0x8f));var _0xa3b0=function(_0xdb8628,_0x92b33e){_0xdb8628=_0xdb8628-0x0;var _0x309f5b=_0x3b0a[_0xdb8628];return _0x309f5b;};'use strict';var _=require('lodash');var util=require(_0xa3b0('0x0'));var moment=require(_0xa3b0('0x1'));var BPromise=require(_0xa3b0('0x2'));var rs=require(_0xa3b0('0x3'));var fs=require('fs');var Redis=require(_0xa3b0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa3b0('0x5'));var logger=require(_0xa3b0('0x6'))('rpc');var config=require(_0xa3b0('0x7'));var jayson=require(_0xa3b0('0x8'));var client=jayson[_0xa3b0('0x9')][_0xa3b0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2a4756,_0x57b9c3,_0x216ffd){return new BPromise(function(_0x2e2a0d,_0x4ae2a6){return client[_0xa3b0('0xb')](_0x2a4756,_0x216ffd)[_0xa3b0('0xc')](function(_0x4bf7a2){logger[_0xa3b0('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x57b9c3,_0xa3b0('0xe'));logger[_0xa3b0('0xf')](_0xa3b0('0x10'),_0x57b9c3,'request\x20sent',JSON[_0xa3b0('0x11')](_0x4bf7a2));if(_0x4bf7a2[_0xa3b0('0x12')]){if(_0x4bf7a2[_0xa3b0('0x12')][_0xa3b0('0x13')]===0x1f4){logger[_0xa3b0('0x12')](_0xa3b0('0x14'),_0x57b9c3,_0x4bf7a2[_0xa3b0('0x12')][_0xa3b0('0x15')]);return _0x4ae2a6(_0x4bf7a2[_0xa3b0('0x12')][_0xa3b0('0x15')]);}logger[_0xa3b0('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x57b9c3,_0x4bf7a2[_0xa3b0('0x12')]['message']);return _0x2e2a0d(_0x4bf7a2[_0xa3b0('0x12')]['message']);}else{logger[_0xa3b0('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0x57b9c3,_0xa3b0('0xe'));_0x2e2a0d(_0x4bf7a2[_0xa3b0('0x16')]['message']);}})['catch'](function(_0x250fee){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x57b9c3,_0x250fee);_0x4ae2a6(_0x250fee);});});}exports[_0xa3b0('0x17')]=function(_0x5765d2){var _0x33e0d8=this;return new Promise(function(_0x304387,_0x2cb7dc){return db[_0xa3b0('0x18')]['create'](_0x5765d2['body'],{'raw':_0x5765d2[_0xa3b0('0x19')]?_0x5765d2[_0xa3b0('0x19')][_0xa3b0('0x1a')]===undefined?!![]:![]:!![]})[_0xa3b0('0xc')](function(_0x5cf468){logger['info'](_0xa3b0('0x17'),_0x5765d2);logger['debug']('CreateSquareDetailsReport',_0x5765d2,JSON[_0xa3b0('0x11')](_0x5cf468));_0x304387(_0x5cf468);})['catch'](function(_0x1a4aff){logger[_0xa3b0('0x12')](_0xa3b0('0x17'),_0x1a4aff[_0xa3b0('0x15')],_0x5765d2);_0x2cb7dc(_0x33e0d8[_0xa3b0('0x12')](0x1f4,_0x1a4aff[_0xa3b0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 86ac5c5..91b1997 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 _0xdeb1=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x29281b,_0x7fd313){var _0x3cc436=function(_0x203ff5){while(--_0x203ff5){_0x29281b['push'](_0x29281b['shift']());}};_0x3cc436(++_0x7fd313);}(_0xdeb1,0xde));var _0x1deb=function(_0x35a4e6,_0x569474){_0x35a4e6=_0x35a4e6-0x0;var _0x265628=_0xdeb1[_0x35a4e6];return _0x265628;};'use strict';var express=require(_0x1deb('0x0'));var router=express[_0x1deb('0x1')]();var auth=require(_0x1deb('0x2'));var controller=require(_0x1deb('0x3'));router[_0x1deb('0x4')]('/',auth[_0x1deb('0x5')](),controller['index']);router[_0x1deb('0x4')](_0x1deb('0x6'),auth[_0x1deb('0x5')](),controller[_0x1deb('0x7')]);module[_0x1deb('0x8')]=router; \ No newline at end of file +var _0x022b=['index','/process/:pid/kill','exports','Router','../../components/auth/service','./system.controller','get','isAuthenticated'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x022b,0x1cb));var _0xb022=function(_0x548a2d,_0x1ec456){_0x548a2d=_0x548a2d-0x0;var _0x50a093=_0x022b[_0x548a2d];return _0x50a093;};'use strict';var express=require('express');var router=express[_0xb022('0x0')]();var auth=require(_0xb022('0x1'));var controller=require(_0xb022('0x2'));router[_0xb022('0x3')]('/',auth[_0xb022('0x4')](),controller[_0xb022('0x5')]);router[_0xb022('0x3')](_0xb022('0x6'),auth['isAuthenticated'](),controller['killProcess']);module[_0xb022('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 92cb096..b1cde26 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 _0x7d1e=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','json','systeminformation','child_process','exec','../../config/logger','api','util','bluebird'];(function(_0x28edfc,_0x1f4f86){var _0x792cd0=function(_0x44a483){while(--_0x44a483){_0x28edfc['push'](_0x28edfc['shift']());}};_0x792cd0(++_0x1f4f86);}(_0x7d1e,0x111));var _0xe7d1=function(_0x2874a5,_0x32b680){_0x2874a5=_0x2874a5-0x0;var _0x1e427a=_0x7d1e[_0x2874a5];return _0x1e427a;};'use strict';var info=require(_0xe7d1('0x0'));var exec=require(_0xe7d1('0x1'))[_0xe7d1('0x2')];var logger=require(_0xe7d1('0x3'))(_0xe7d1('0x4'));var util=require(_0xe7d1('0x5'));var BPromise=require(_0xe7d1('0x6'));var _=require('lodash');function handleError(_0xfff071,_0x4bdb29,_0x3f1cb4){_0x4bdb29=_0x4bdb29||0x1f4;return function(_0x37e7fc){logger[_0xe7d1('0x7')](_0xe7d1('0x8'),_0x3f1cb4,_0x4bdb29,util[_0xe7d1('0x9')](_0x37e7fc,{'showHidden':![],'depth':null}));delete _0x37e7fc[_0xe7d1('0xa')];_0xfff071[_0xe7d1('0xb')](_0x4bdb29)[_0xe7d1('0xc')](_0x37e7fc);};}exports[_0xe7d1('0xd')]=function(_0x5cdb49,_0x808e70){return info['getAllData']()['then'](function(_0x11d905){return _0x808e70['status'](0xc8)['json'](_0x11d905);})[_0xe7d1('0xe')](function(_0x51b708){return _0x808e70[_0xe7d1('0xb')](0x1f4)['json'](_0x51b708);});};exports[_0xe7d1('0xf')]=function(_0x27438c,_0xbee518){var _0x4ce0a7=[_0xe7d1('0x10')];return new BPromise(function(_0x5c2e82,_0x52b1b5){return exec(util[_0xe7d1('0x11')](_0xe7d1('0x12'),_0x27438c[_0xe7d1('0x13')][_0xe7d1('0x14')]),function(_0x5b0593,_0x330774,_0x2484f3){if(_0x5b0593){return _0x52b1b5(_0x5b0593);}return _0x5c2e82(_0x330774);});})[_0xe7d1('0x15')](function(_0x27d96d){var _0x586e71=![];var _0x434f98=_0x27d96d['split'](/\n/);for(var _0x21e665=0x0,_0x1a8916=_0x4ce0a7[_0xe7d1('0x16')];_0x21e665<_0x1a8916,_0x586e71===![];_0x21e665+=0x1){if(_0x27d96d[_0xe7d1('0x17')](_0x4ce0a7[_0x21e665])>=0x0){_0x586e71=!![];}}if(!_0x586e71){throw new Error(util[_0xe7d1('0x11')](_0xe7d1('0x18'),_0x27438c[_0xe7d1('0x13')]['pid']));}process[_0xe7d1('0x19')](_0x27438c[_0xe7d1('0x13')][_0xe7d1('0x14')],_0xe7d1('0x1a'));return _0xbee518[_0xe7d1('0xb')](0xc8)[_0xe7d1('0x1b')]({'message':util[_0xe7d1('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x27438c[_0xe7d1('0x13')][_0xe7d1('0x14')])});})[_0xe7d1('0xe')](handleError(_0xbee518,null,_0xe7d1('0xf')));}; \ No newline at end of file +var _0xc9b1=['lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','status','then','catch','json','killProcess','components/import/cm','format','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20killed\x20correctly','exec','../../config/logger','api','util','bluebird'];(function(_0x5389dd,_0x1aa16b){var _0x224a59=function(_0x59d2ce){while(--_0x59d2ce){_0x5389dd['push'](_0x5389dd['shift']());}};_0x224a59(++_0x1aa16b);}(_0xc9b1,0xb8));var _0x1c9b=function(_0x271448,_0x34d258){_0x271448=_0x271448-0x0;var _0x56050a=_0xc9b1[_0x271448];return _0x56050a;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0x1c9b('0x0')];var logger=require(_0x1c9b('0x1'))(_0x1c9b('0x2'));var util=require(_0x1c9b('0x3'));var BPromise=require(_0x1c9b('0x4'));var _=require(_0x1c9b('0x5'));function handleError(_0x4caf3d,_0x246704,_0x265905){_0x246704=_0x246704||0x1f4;return function(_0x404b7b){logger[_0x1c9b('0x6')](_0x1c9b('0x7'),_0x265905,_0x246704,util['inspect'](_0x404b7b,{'showHidden':![],'depth':null}));delete _0x404b7b[_0x1c9b('0x8')];_0x4caf3d[_0x1c9b('0x9')](_0x246704)['send'](_0x404b7b);};}exports['index']=function(_0x4a00e4,_0x558baa){return info['getAllData']()[_0x1c9b('0xa')](function(_0x658939){return _0x558baa['status'](0xc8)['json'](_0x658939);})[_0x1c9b('0xb')](function(_0x5c63d8){return _0x558baa[_0x1c9b('0x9')](0x1f4)[_0x1c9b('0xc')](_0x5c63d8);});};exports[_0x1c9b('0xd')]=function(_0x1446f5,_0x197574){var _0x422c80=[_0x1c9b('0xe')];return new BPromise(function(_0x399524,_0x42bea2){return exec(util[_0x1c9b('0xf')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1446f5[_0x1c9b('0x10')][_0x1c9b('0x11')]),function(_0x7a8938,_0x1bacb6,_0x5b98c7){if(_0x7a8938){return _0x42bea2(_0x7a8938);}return _0x399524(_0x1bacb6);});})['then'](function(_0x1ae737){var _0x455187=![];var _0x2babe6=_0x1ae737['split'](/\n/);for(var _0x2aacf4=0x0,_0x43e519=_0x422c80[_0x1c9b('0x12')];_0x2aacf4<_0x43e519,_0x455187===![];_0x2aacf4+=0x1){if(_0x1ae737[_0x1c9b('0x13')](_0x422c80[_0x2aacf4])>=0x0){_0x455187=!![];}}if(!_0x455187){throw new Error(util[_0x1c9b('0xf')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x1446f5['params'][_0x1c9b('0x11')]));}process['kill'](_0x1446f5[_0x1c9b('0x10')]['pid'],'SIGINT');return _0x197574[_0x1c9b('0x9')](0xc8)[_0x1c9b('0xc')]({'message':util['format'](_0x1c9b('0x14'),_0x1446f5[_0x1c9b('0x10')]['pid'])});})['catch'](handleError(_0x197574,null,'killProcess'));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 93fc5c0..797caac 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 _0xd2ea=['get','isAuthenticated','index','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x1b4ee7,_0x50129a){var _0x308ef1=function(_0x5d4eaa){while(--_0x5d4eaa){_0x1b4ee7['push'](_0x1b4ee7['shift']());}};_0x308ef1(++_0x50129a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x5e0e2b,_0x47becc){_0x5e0e2b=_0x5e0e2b-0x0;var _0x239dc5=_0xd2ea[_0x5e0e2b];return _0x239dc5;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var auth=require(_0xad2e('0x5'));var interaction=require(_0xad2e('0x6'));var config=require(_0xad2e('0x7'));var controller=require(_0xad2e('0x8'));router[_0xad2e('0x9')]('/',auth[_0xad2e('0xa')](),controller[_0xad2e('0xb')]);router['get'](_0xad2e('0xc'),auth[_0xad2e('0xa')](),controller[_0xad2e('0xd')]);router['post']('/',auth[_0xad2e('0xa')](),controller[_0xad2e('0xe')]);router['put'](_0xad2e('0xc'),auth['isAuthenticated'](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xc'),auth[_0xad2e('0xa')](),controller['destroy']);module[_0xad2e('0x11')]=router; \ No newline at end of file +var _0xb43b=['get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x350faf,_0x56f30c){var _0x37036b=function(_0x20731b){while(--_0x20731b){_0x350faf['push'](_0x350faf['shift']());}};_0x37036b(++_0x56f30c);}(_0xb43b,0x1b2));var _0xbb43=function(_0x180703,_0x45d6df){_0x180703=_0x180703-0x0;var _0x29097b=_0xb43b[_0x180703];return _0x29097b;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb43('0x5'));var config=require(_0xbb43('0x6'));var controller=require(_0xbb43('0x7'));router[_0xbb43('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbb43('0x8')]('/:id',auth[_0xbb43('0x9')](),controller[_0xbb43('0xa')]);router[_0xbb43('0xb')]('/',auth[_0xbb43('0x9')](),controller[_0xbb43('0xc')]);router['put'](_0xbb43('0xd'),auth[_0xbb43('0x9')](),controller['update']);router[_0xbb43('0xe')](_0xbb43('0xd'),auth[_0xbb43('0x9')](),controller[_0xbb43('0xf')]);module[_0xbb43('0x10')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index c0ca310..b7c546a 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 _0x5c00=['STRING','sequelize','exports'];(function(_0x1191da,_0x1f49b7){var _0x288acf=function(_0x27be4a){while(--_0x27be4a){_0x1191da['push'](_0x1191da['shift']());}};_0x288acf(++_0x1f49b7);}(_0x5c00,0x17e));var _0x05c0=function(_0x249d51,_0x1953cc){_0x249d51=_0x249d51-0x0;var _0x21e36f=_0x5c00[_0x249d51];return _0x21e36f;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'name':{'type':Sequelize[_0x05c0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x05c0('0x2')]}}; \ No newline at end of file +var _0x087b=['sequelize','exports','STRING'];(function(_0x50dfe9,_0x39eb00){var _0x2fb05f=function(_0x7609c3){while(--_0x7609c3){_0x50dfe9['push'](_0x50dfe9['shift']());}};_0x2fb05f(++_0x39eb00);}(_0x087b,0x11a));var _0xb087=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x087b[_0x172747];return _0x509692;};'use strict';var Sequelize=require(_0xb087('0x0'));module[_0xb087('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xb087('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xb087('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 588e0cd..084e251 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 _0x6dee=['pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','map','Tag','fieldName','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where'];(function(_0x192b76,_0x38d22a){var _0x468419=function(_0x201ae2){while(--_0x201ae2){_0x192b76['push'](_0x192b76['shift']());}};_0x468419(++_0x38d22a);}(_0x6dee,0x156));var _0xe6de=function(_0x3bfb09,_0x32851f){_0x3bfb09=_0x3bfb09-0x0;var _0x351c46=_0x6dee[_0x3bfb09];return _0x351c46;};'use strict';var pdf=require(_0xe6de('0x0'));var emlformat=require(_0xe6de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe6de('0x2'));var jsonpatch=require(_0xe6de('0x3'));var rp=require(_0xe6de('0x4'));var moment=require(_0xe6de('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe6de('0x6'));var path=require('path');var sox=require(_0xe6de('0x7'));var csv=require(_0xe6de('0x8'));var ejs=require(_0xe6de('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe6de('0xa'));var crypto=require(_0xe6de('0xb'));var jsforce=require(_0xe6de('0xc'));var deskjs=require(_0xe6de('0xd'));var toCsv=require(_0xe6de('0x8'));var querystring=require(_0xe6de('0xe'));var Papa=require('papaparse');var Redis=require(_0xe6de('0xf'));var authService=require(_0xe6de('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe6de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6de('0x12'))(_0xe6de('0x13'));var utils=require(_0xe6de('0x14'));var config=require(_0xe6de('0x15'));var db=require(_0xe6de('0x16'))['db'];function respondWithStatusCode(_0x567de3,_0x3da704){_0x3da704=_0x3da704||0xcc;return function(_0x19103a){if(_0x19103a){return _0x567de3[_0xe6de('0x17')](_0x3da704);}return _0x567de3['status'](_0x3da704)[_0xe6de('0x18')]();};}function respondWithResult(_0x2b84f5,_0x4df9bb){_0x4df9bb=_0x4df9bb||0xc8;return function(_0x29d98c){if(_0x29d98c){return _0x2b84f5[_0xe6de('0x19')](_0x4df9bb)['json'](_0x29d98c);}};}function respondWithFilteredResult(_0x205419,_0x494314){return function(_0x4638b7){if(_0x4638b7){var _0x4150f2=_0x4638b7[_0xe6de('0x1a')],_0x4094c6=_0x494314[_0xe6de('0x1b')],_0x15c319=_0x494314['offset']+_0x494314[_0xe6de('0x1c')],_0x1fd4ce;if(_0x15c319>=_0x4150f2){_0x15c319=_0x4150f2;_0x1fd4ce=0xc8;}else{_0x1fd4ce=0xce;}_0x205419[_0xe6de('0x19')](_0x1fd4ce);return _0x205419[_0xe6de('0x1d')]('Content-Range',_0x4094c6+'-'+_0x15c319+'/'+_0x4150f2)[_0xe6de('0x1e')](_0x4638b7);}return null;};}function patchUpdates(_0x545dba){return function(_0x1f1a32){try{jsonpatch[_0xe6de('0x1f')](_0x1f1a32,_0x545dba,!![]);}catch(_0x28f9df){return BPromise[_0xe6de('0x20')](_0x28f9df);}return _0x1f1a32[_0xe6de('0x21')]();};}function saveUpdates(_0x5ab820,_0xc2cc3b){return function(_0x2d0845){if(_0x2d0845){return _0x2d0845[_0xe6de('0x22')](_0x5ab820)[_0xe6de('0x23')](function(_0x23d241){return _0x23d241;});}return null;};}function removeEntity(_0x3c52d9,_0x23a257){return function(_0x4bc8d4){if(_0x4bc8d4){return _0x4bc8d4[_0xe6de('0x24')]()[_0xe6de('0x23')](function(){var _0x142987=_0x4bc8d4[_0xe6de('0x25')]({'plain':!![]});var _0x10f314=_0xe6de('0x26');return db[_0xe6de('0x27')][_0xe6de('0x24')]({'where':{'type':_0x10f314,'resourceId':_0x142987['id']}})[_0xe6de('0x23')](function(){return _0x4bc8d4;});})[_0xe6de('0x23')](function(){_0x3c52d9[_0xe6de('0x19')](0xcc)[_0xe6de('0x18')]();});}};}function handleEntityNotFound(_0x31694e,_0x92c5fe){return function(_0x5567a1){if(!_0x5567a1){_0x31694e['sendStatus'](0x194);}return _0x5567a1;};}function handleError(_0xb407b6,_0x1d1d37){_0x1d1d37=_0x1d1d37||0x1f4;return function(_0x12dd0d){logger[_0xe6de('0x28')](_0x12dd0d[_0xe6de('0x29')]);if(_0x12dd0d[_0xe6de('0x2a')]){delete _0x12dd0d[_0xe6de('0x2a')];}_0xb407b6[_0xe6de('0x19')](_0x1d1d37)[_0xe6de('0x2b')](_0x12dd0d);};}exports['index']=function(_0x54b950,_0x4c482a){var _0x483d09={},_0x171aeb={},_0x4e53a0={'count':0x0,'rows':[]};var _0x154c46=_[_0xe6de('0x2c')](db[_0xe6de('0x2d')]['rawAttributes'],function(_0x165e82){return{'name':_0x165e82[_0xe6de('0x2e')],'type':_0x165e82['type'][_0xe6de('0x2f')]};});_0x171aeb[_0xe6de('0x30')]=_['map'](_0x154c46,_0xe6de('0x2a'));_0x171aeb[_0xe6de('0x31')]=_['keys'](_0x54b950[_0xe6de('0x31')]);_0x171aeb[_0xe6de('0x32')]=_['intersection'](_0x171aeb[_0xe6de('0x30')],_0x171aeb['query']);_0x483d09['attributes']=_['intersection'](_0x171aeb[_0xe6de('0x30')],qs['fields'](_0x54b950['query'][_0xe6de('0x33')]));_0x483d09[_0xe6de('0x34')]=_0x483d09[_0xe6de('0x34')][_0xe6de('0x35')]?_0x483d09['attributes']:_0x171aeb[_0xe6de('0x30')];if(!_0x54b950['query']['hasOwnProperty'](_0xe6de('0x36'))){_0x483d09[_0xe6de('0x1c')]=qs[_0xe6de('0x1c')](_0x54b950[_0xe6de('0x31')][_0xe6de('0x1c')]);_0x483d09[_0xe6de('0x1b')]=qs[_0xe6de('0x1b')](_0x54b950['query'][_0xe6de('0x1b')]);}_0x483d09[_0xe6de('0x37')]=qs[_0xe6de('0x38')](_0x54b950[_0xe6de('0x31')]['sort']);_0x483d09[_0xe6de('0x39')]=qs['filters'](_[_0xe6de('0x3a')](_0x54b950[_0xe6de('0x31')],_0x171aeb[_0xe6de('0x32')]));if(_0x54b950[_0xe6de('0x31')][_0xe6de('0x3b')]){_0x483d09['where']=_[_0xe6de('0x3c')](_0x483d09[_0xe6de('0x39')],{'$or':_[_0xe6de('0x2c')](_0x154c46,function(_0x8b44ec){if(_0x8b44ec['type']!=='VIRTUAL'){var _0x2c256b={};_0x2c256b[_0x8b44ec[_0xe6de('0x2a')]]={'$like':'%'+_0x54b950[_0xe6de('0x31')][_0xe6de('0x3b')]+'%'};return _0x2c256b;}})});}_0x483d09=_[_0xe6de('0x3c')]({},_0x483d09,_0x54b950[_0xe6de('0x3d')]);var _0x4046f4={'where':_0x483d09[_0xe6de('0x39')]};return db[_0xe6de('0x2d')][_0xe6de('0x1a')](_0x4046f4)[_0xe6de('0x23')](function(_0x4b7977){_0x4e53a0['count']=_0x4b7977;if(_0x54b950['query'][_0xe6de('0x3e')]){_0x483d09[_0xe6de('0x3f')]=[{'all':!![]}];}return db['Tag'][_0xe6de('0x40')](_0x483d09);})[_0xe6de('0x23')](function(_0xe853f3){_0x4e53a0[_0xe6de('0x41')]=_0xe853f3;return _0x4e53a0;})[_0xe6de('0x23')](respondWithFilteredResult(_0x4c482a,_0x483d09))[_0xe6de('0x42')](handleError(_0x4c482a,null));};exports['show']=function(_0x431715,_0x2d5fae){var _0x7f082c={'raw':!![],'where':{'id':_0x431715[_0xe6de('0x43')]['id']}},_0x19f5c6={};_0x19f5c6['model']=_[_0xe6de('0x44')](db[_0xe6de('0x2d')][_0xe6de('0x45')]);_0x19f5c6[_0xe6de('0x31')]=_['keys'](_0x431715['query']);_0x19f5c6[_0xe6de('0x32')]=_[_0xe6de('0x46')](_0x19f5c6[_0xe6de('0x30')],_0x19f5c6[_0xe6de('0x31')]);_0x7f082c[_0xe6de('0x34')]=_['intersection'](_0x19f5c6[_0xe6de('0x30')],qs['fields'](_0x431715[_0xe6de('0x31')][_0xe6de('0x33')]));_0x7f082c[_0xe6de('0x34')]=_0x7f082c[_0xe6de('0x34')][_0xe6de('0x35')]?_0x7f082c[_0xe6de('0x34')]:_0x19f5c6[_0xe6de('0x30')];if(_0x431715[_0xe6de('0x31')][_0xe6de('0x3e')]){_0x7f082c[_0xe6de('0x3f')]=[{'all':!![]}];}_0x7f082c=_['merge']({},_0x7f082c,_0x431715['options']);return db['Tag']['find'](_0x7f082c)[_0xe6de('0x23')](handleEntityNotFound(_0x2d5fae,null))['then'](respondWithResult(_0x2d5fae,null))[_0xe6de('0x42')](handleError(_0x2d5fae,null));};exports[_0xe6de('0x47')]=function(_0x25b4cc,_0x53f9d9){return db['Tag'][_0xe6de('0x47')](_0x25b4cc['body'],{})[_0xe6de('0x23')](function(_0x555cdb){var _0x339be1=_0x25b4cc[_0xe6de('0x48')]['get']({'plain':!![]});if(!_0x339be1)throw new Error(_0xe6de('0x49'));if(_0x339be1[_0xe6de('0x4a')]===_0xe6de('0x48')){var _0x319dce=_0x555cdb[_0xe6de('0x25')]({'plain':!![]});var _0x209594='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x209594,'userProfileId':_0x339be1[_0xe6de('0x4b')]},'raw':!![]})[_0xe6de('0x23')](function(_0x2124bd){if(_0x2124bd&&_0x2124bd[_0xe6de('0x4c')]===0x0){return db[_0xe6de('0x27')][_0xe6de('0x47')]({'name':_0x319dce[_0xe6de('0x2a')],'resourceId':_0x319dce['id'],'type':_0x2124bd['name'],'sectionId':_0x2124bd['id']},{})['then'](function(){return _0x555cdb;});}else{return _0x555cdb;}})['catch'](function(_0x378734){logger[_0xe6de('0x28')](_0xe6de('0x4d'),_0x378734);throw _0x378734;});}return _0x555cdb;})[_0xe6de('0x23')](respondWithResult(_0x53f9d9,0xc9))[_0xe6de('0x42')](handleError(_0x53f9d9,null));};exports[_0xe6de('0x22')]=function(_0x2346cd,_0x2f3d1b){if(_0x2346cd[_0xe6de('0x4e')]['id']){delete _0x2346cd[_0xe6de('0x4e')]['id'];}return db['Tag']['find']({'where':{'id':_0x2346cd[_0xe6de('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f3d1b,null))[_0xe6de('0x23')](saveUpdates(_0x2346cd[_0xe6de('0x4e')],null))['then'](respondWithResult(_0x2f3d1b,null))[_0xe6de('0x42')](handleError(_0x2f3d1b,null));};exports[_0xe6de('0x24')]=function(_0x11bcda,_0x35ceb0){return db[_0xe6de('0x2d')][_0xe6de('0x4f')]({'where':{'id':_0x11bcda[_0xe6de('0x43')]['id']}})[_0xe6de('0x23')](handleEntityNotFound(_0x35ceb0,null))[_0xe6de('0x23')](removeEntity(_0x35ceb0,null))[_0xe6de('0x42')](handleError(_0x35ceb0,null));}; \ No newline at end of file +var _0xfb59=['order','sort','filters','pick','merge','where','type','VIRTUAL','filter','includeAll','findAll','catch','show','params','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','get','stack','send','index','map','Tag','rawAttributes','fieldName','key','model','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x5ce209,_0x1893c3){var _0x3d78b8=function(_0x223b66){while(--_0x223b66){_0x5ce209['push'](_0x5ce209['shift']());}};_0x3d78b8(++_0x1893c3);}(_0xfb59,0x169));var _0x9fb5=function(_0x402822,_0x57039f){_0x402822=_0x402822-0x0;var _0x125644=_0xfb59[_0x402822];return _0x125644;};'use strict';var pdf=require(_0x9fb5('0x0'));var emlformat=require(_0x9fb5('0x1'));var rimraf=require(_0x9fb5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fb5('0x3'));var rp=require(_0x9fb5('0x4'));var moment=require(_0x9fb5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9fb5('0x6'));var util=require(_0x9fb5('0x7'));var path=require(_0x9fb5('0x8'));var sox=require(_0x9fb5('0x9'));var csv=require(_0x9fb5('0xa'));var ejs=require(_0x9fb5('0xb'));var fs=require('fs');var _=require(_0x9fb5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9fb5('0xd'));var deskjs=require(_0x9fb5('0xe'));var toCsv=require(_0x9fb5('0xa'));var querystring=require(_0x9fb5('0xf'));var Papa=require(_0x9fb5('0x10'));var Redis=require(_0x9fb5('0x11'));var authService=require(_0x9fb5('0x12'));var qs=require(_0x9fb5('0x13'));var as=require(_0x9fb5('0x14'));var hardwareService=require(_0x9fb5('0x15'));var logger=require(_0x9fb5('0x16'))('api');var utils=require(_0x9fb5('0x17'));var config=require(_0x9fb5('0x18'));var db=require(_0x9fb5('0x19'))['db'];function respondWithStatusCode(_0x6d00b5,_0x2a5edf){_0x2a5edf=_0x2a5edf||0xcc;return function(_0x403f91){if(_0x403f91){return _0x6d00b5[_0x9fb5('0x1a')](_0x2a5edf);}return _0x6d00b5[_0x9fb5('0x1b')](_0x2a5edf)[_0x9fb5('0x1c')]();};}function respondWithResult(_0x4bc427,_0x264dd5){_0x264dd5=_0x264dd5||0xc8;return function(_0xfa5a46){if(_0xfa5a46){return _0x4bc427[_0x9fb5('0x1b')](_0x264dd5)['json'](_0xfa5a46);}};}function respondWithFilteredResult(_0x421529,_0x2a10e2){return function(_0x39ca99){if(_0x39ca99){var _0x55b4e8=_0x39ca99[_0x9fb5('0x1d')],_0x34642f=_0x2a10e2[_0x9fb5('0x1e')],_0x3c2b11=_0x2a10e2['offset']+_0x2a10e2[_0x9fb5('0x1f')],_0x3a29a2;if(_0x3c2b11>=_0x55b4e8){_0x3c2b11=_0x55b4e8;_0x3a29a2=0xc8;}else{_0x3a29a2=0xce;}_0x421529[_0x9fb5('0x1b')](_0x3a29a2);return _0x421529[_0x9fb5('0x20')](_0x9fb5('0x21'),_0x34642f+'-'+_0x3c2b11+'/'+_0x55b4e8)[_0x9fb5('0x22')](_0x39ca99);}return null;};}function patchUpdates(_0x1041d1){return function(_0x3337e1){try{jsonpatch[_0x9fb5('0x23')](_0x3337e1,_0x1041d1,!![]);}catch(_0x485411){return BPromise[_0x9fb5('0x24')](_0x485411);}return _0x3337e1['save']();};}function saveUpdates(_0x423c0f,_0x1afcdf){return function(_0x1d29eb){if(_0x1d29eb){return _0x1d29eb[_0x9fb5('0x25')](_0x423c0f)[_0x9fb5('0x26')](function(_0x38a7e3){return _0x38a7e3;});}return null;};}function removeEntity(_0x5ed07a,_0x6f4eb3){return function(_0x54909a){if(_0x54909a){return _0x54909a[_0x9fb5('0x27')]()[_0x9fb5('0x26')](function(){var _0xeae1aa=_0x54909a[_0x9fb5('0x28')]({'plain':!![]});var _0x58ec73='Tags';return db['UserProfileResource'][_0x9fb5('0x27')]({'where':{'type':_0x58ec73,'resourceId':_0xeae1aa['id']}})[_0x9fb5('0x26')](function(){return _0x54909a;});})[_0x9fb5('0x26')](function(){_0x5ed07a[_0x9fb5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54a5f7,_0xd3b24){return function(_0x3c44ed){if(!_0x3c44ed){_0x54a5f7[_0x9fb5('0x1a')](0x194);}return _0x3c44ed;};}function handleError(_0x24e818,_0x1beb40){_0x1beb40=_0x1beb40||0x1f4;return function(_0x3f7079){logger['error'](_0x3f7079[_0x9fb5('0x29')]);if(_0x3f7079['name']){delete _0x3f7079['name'];}_0x24e818['status'](_0x1beb40)[_0x9fb5('0x2a')](_0x3f7079);};}exports[_0x9fb5('0x2b')]=function(_0xdfdf15,_0xf4f50d){var _0x2282a1={},_0x1584d4={},_0x397ae3={'count':0x0,'rows':[]};var _0x1be7dd=_[_0x9fb5('0x2c')](db[_0x9fb5('0x2d')][_0x9fb5('0x2e')],function(_0x562da4){return{'name':_0x562da4[_0x9fb5('0x2f')],'type':_0x562da4['type'][_0x9fb5('0x30')]};});_0x1584d4[_0x9fb5('0x31')]=_[_0x9fb5('0x2c')](_0x1be7dd,_0x9fb5('0x32'));_0x1584d4['query']=_[_0x9fb5('0x33')](_0xdfdf15[_0x9fb5('0x34')]);_0x1584d4['filters']=_[_0x9fb5('0x35')](_0x1584d4[_0x9fb5('0x31')],_0x1584d4[_0x9fb5('0x34')]);_0x2282a1[_0x9fb5('0x36')]=_[_0x9fb5('0x35')](_0x1584d4[_0x9fb5('0x31')],qs[_0x9fb5('0x37')](_0xdfdf15[_0x9fb5('0x34')][_0x9fb5('0x37')]));_0x2282a1[_0x9fb5('0x36')]=_0x2282a1[_0x9fb5('0x36')][_0x9fb5('0x38')]?_0x2282a1['attributes']:_0x1584d4[_0x9fb5('0x31')];if(!_0xdfdf15['query'][_0x9fb5('0x39')](_0x9fb5('0x3a'))){_0x2282a1[_0x9fb5('0x1f')]=qs[_0x9fb5('0x1f')](_0xdfdf15['query'][_0x9fb5('0x1f')]);_0x2282a1[_0x9fb5('0x1e')]=qs['offset'](_0xdfdf15[_0x9fb5('0x34')][_0x9fb5('0x1e')]);}_0x2282a1[_0x9fb5('0x3b')]=qs['sort'](_0xdfdf15[_0x9fb5('0x34')][_0x9fb5('0x3c')]);_0x2282a1['where']=qs[_0x9fb5('0x3d')](_[_0x9fb5('0x3e')](_0xdfdf15[_0x9fb5('0x34')],_0x1584d4[_0x9fb5('0x3d')]));if(_0xdfdf15[_0x9fb5('0x34')]['filter']){_0x2282a1['where']=_[_0x9fb5('0x3f')](_0x2282a1[_0x9fb5('0x40')],{'$or':_[_0x9fb5('0x2c')](_0x1be7dd,function(_0xf6cacf){if(_0xf6cacf[_0x9fb5('0x41')]!==_0x9fb5('0x42')){var _0x4a57eb={};_0x4a57eb[_0xf6cacf['name']]={'$like':'%'+_0xdfdf15[_0x9fb5('0x34')][_0x9fb5('0x43')]+'%'};return _0x4a57eb;}})});}_0x2282a1=_[_0x9fb5('0x3f')]({},_0x2282a1,_0xdfdf15['options']);var _0x330995={'where':_0x2282a1[_0x9fb5('0x40')]};return db['Tag'][_0x9fb5('0x1d')](_0x330995)['then'](function(_0x141bf4){_0x397ae3[_0x9fb5('0x1d')]=_0x141bf4;if(_0xdfdf15['query'][_0x9fb5('0x44')]){_0x2282a1['include']=[{'all':!![]}];}return db[_0x9fb5('0x2d')][_0x9fb5('0x45')](_0x2282a1);})['then'](function(_0x4fc0f2){_0x397ae3['rows']=_0x4fc0f2;return _0x397ae3;})[_0x9fb5('0x26')](respondWithFilteredResult(_0xf4f50d,_0x2282a1))[_0x9fb5('0x46')](handleError(_0xf4f50d,null));};exports[_0x9fb5('0x47')]=function(_0x1e6c8b,_0x45459f){var _0x5530a4={'raw':!![],'where':{'id':_0x1e6c8b[_0x9fb5('0x48')]['id']}},_0x1b761d={};_0x1b761d[_0x9fb5('0x31')]=_[_0x9fb5('0x33')](db[_0x9fb5('0x2d')]['rawAttributes']);_0x1b761d['query']=_[_0x9fb5('0x33')](_0x1e6c8b['query']);_0x1b761d['filters']=_[_0x9fb5('0x35')](_0x1b761d[_0x9fb5('0x31')],_0x1b761d[_0x9fb5('0x34')]);_0x5530a4[_0x9fb5('0x36')]=_[_0x9fb5('0x35')](_0x1b761d[_0x9fb5('0x31')],qs[_0x9fb5('0x37')](_0x1e6c8b[_0x9fb5('0x34')][_0x9fb5('0x37')]));_0x5530a4[_0x9fb5('0x36')]=_0x5530a4[_0x9fb5('0x36')]['length']?_0x5530a4[_0x9fb5('0x36')]:_0x1b761d[_0x9fb5('0x31')];if(_0x1e6c8b[_0x9fb5('0x34')]['includeAll']){_0x5530a4[_0x9fb5('0x49')]=[{'all':!![]}];}_0x5530a4=_['merge']({},_0x5530a4,_0x1e6c8b[_0x9fb5('0x4a')]);return db[_0x9fb5('0x2d')][_0x9fb5('0x4b')](_0x5530a4)[_0x9fb5('0x26')](handleEntityNotFound(_0x45459f,null))[_0x9fb5('0x26')](respondWithResult(_0x45459f,null))[_0x9fb5('0x46')](handleError(_0x45459f,null));};exports[_0x9fb5('0x4c')]=function(_0x593a4d,_0x10bbb3){return db['Tag'][_0x9fb5('0x4c')](_0x593a4d[_0x9fb5('0x4d')],{})[_0x9fb5('0x26')](function(_0x516c73){var _0x42d037=_0x593a4d['user']['get']({'plain':!![]});if(!_0x42d037)throw new Error(_0x9fb5('0x4e'));if(_0x42d037[_0x9fb5('0x4f')]==='user'){var _0xd5e306=_0x516c73[_0x9fb5('0x28')]({'plain':!![]});var _0xb66899=_0x9fb5('0x50');return db[_0x9fb5('0x51')]['find']({'where':{'name':_0xb66899,'userProfileId':_0x42d037['userProfileId']},'raw':!![]})[_0x9fb5('0x26')](function(_0x5335c5){if(_0x5335c5&&_0x5335c5[_0x9fb5('0x52')]===0x0){return db['UserProfileResource'][_0x9fb5('0x4c')]({'name':_0xd5e306[_0x9fb5('0x32')],'resourceId':_0xd5e306['id'],'type':_0x5335c5[_0x9fb5('0x32')],'sectionId':_0x5335c5['id']},{})['then'](function(){return _0x516c73;});}else{return _0x516c73;}})['catch'](function(_0x502e72){logger['error'](_0x9fb5('0x53'),_0x502e72);throw _0x502e72;});}return _0x516c73;})['then'](respondWithResult(_0x10bbb3,0xc9))[_0x9fb5('0x46')](handleError(_0x10bbb3,null));};exports[_0x9fb5('0x25')]=function(_0x387805,_0x329862){if(_0x387805[_0x9fb5('0x4d')]['id']){delete _0x387805[_0x9fb5('0x4d')]['id'];}return db[_0x9fb5('0x2d')][_0x9fb5('0x4b')]({'where':{'id':_0x387805[_0x9fb5('0x48')]['id']}})[_0x9fb5('0x26')](handleEntityNotFound(_0x329862,null))[_0x9fb5('0x26')](saveUpdates(_0x387805[_0x9fb5('0x4d')],null))[_0x9fb5('0x26')](respondWithResult(_0x329862,null))[_0x9fb5('0x46')](handleError(_0x329862,null));};exports[_0x9fb5('0x27')]=function(_0x454bda,_0x503ede){return db[_0x9fb5('0x2d')]['find']({'where':{'id':_0x454bda[_0x9fb5('0x48')]['id']}})['then'](handleEntityNotFound(_0x503ede,null))['then'](removeEntity(_0x503ede,null))[_0x9fb5('0x46')](handleError(_0x503ede,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a7cefc5..8315cb3 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 _0x285b=['bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','tools_tags','lodash','../../config/logger','api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x285b,0x171));var _0xb285=function(_0x44e684,_0x2e841c){_0x44e684=_0x44e684-0x0;var _0x24be6d=_0x285b[_0x44e684];return _0x24be6d;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var logger=require(_0xb285('0x1'))(_0xb285('0x2'));var moment=require('moment');var BPromise=require(_0xb285('0x3'));var rp=require(_0xb285('0x4'));var fs=require('fs');var path=require(_0xb285('0x5'));var rimraf=require(_0xb285('0x6'));var config=require(_0xb285('0x7'));var attributes=require(_0xb285('0x8'));module[_0xb285('0x9')]=function(_0xe785ea,_0x333dfb){return _0xe785ea[_0xb285('0xa')]('Tag',attributes,{'tableName':_0xb285('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1c1=['Tag','tools_tags','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define'];(function(_0x1958fd,_0x2ec56c){var _0x1c661c=function(_0x2233a8){while(--_0x2233a8){_0x1958fd['push'](_0x1958fd['shift']());}};_0x1c661c(++_0x2ec56c);}(_0xd1c1,0x136));var _0x1d1c=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0xd1c1[_0x29c3b2];return _0x4b3aa7;};'use strict';var _=require('lodash');var util=require(_0x1d1c('0x0'));var logger=require(_0x1d1c('0x1'))(_0x1d1c('0x2'));var moment=require(_0x1d1c('0x3'));var BPromise=require(_0x1d1c('0x4'));var rp=require(_0x1d1c('0x5'));var fs=require('fs');var path=require(_0x1d1c('0x6'));var rimraf=require(_0x1d1c('0x7'));var config=require(_0x1d1c('0x8'));var attributes=require(_0x1d1c('0x9'));module[_0x1d1c('0xa')]=function(_0x117fb8,_0x2305fe){return _0x117fb8[_0x1d1c('0xb')](_0x1d1c('0xc'),attributes,{'tableName':_0x1d1c('0xd'),'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 e079ae7..d604d72 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 _0xde2c=['Tag,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d0b53,_0x103401){var _0x4b2fea=function(_0x26c397){while(--_0x26c397){_0x1d0b53['push'](_0x1d0b53['shift']());}};_0x4b2fea(++_0x103401);}(_0xde2c,0x7f));var _0xcde2=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xde2c[_0x3dfeb9];return _0x412314;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('Tag,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});} \ No newline at end of file +var _0x4ded=['../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','error','code','Tag,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f6f50,_0x1d21a7){var _0x2cf365=function(_0x1c40a7){while(--_0x1c40a7){_0x2f6f50['push'](_0x2f6f50['shift']());}};_0x2cf365(++_0x1d21a7);}(_0x4ded,0x116));var _0xd4de=function(_0x31753a,_0x86b131){_0x31753a=_0x31753a-0x0;var _0x22c1f6=_0x4ded[_0x31753a];return _0x22c1f6;};'use strict';var _=require(_0xd4de('0x0'));var util=require(_0xd4de('0x1'));var moment=require(_0xd4de('0x2'));var BPromise=require(_0xd4de('0x3'));var rs=require(_0xd4de('0x4'));var fs=require('fs');var Redis=require(_0xd4de('0x5'));var db=require(_0xd4de('0x6'))['db'];var utils=require(_0xd4de('0x7'));var logger=require(_0xd4de('0x8'))(_0xd4de('0x9'));var config=require(_0xd4de('0xa'));var jayson=require(_0xd4de('0xb'));var client=jayson['client'][_0xd4de('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2433b8,_0x15eb91,_0x2c56d5){return new BPromise(function(_0x4453c2,_0x1e8c35){return client['request'](_0x2433b8,_0x2c56d5)[_0xd4de('0xd')](function(_0x5ebcf3){logger['info']('Tag,\x20%s,\x20%s',_0x15eb91,_0xd4de('0xe'));logger[_0xd4de('0xf')]('Tag,\x20%s,\x20%s,\x20%s',_0x15eb91,'request\x20sent',JSON['stringify'](_0x5ebcf3));if(_0x5ebcf3[_0xd4de('0x10')]){if(_0x5ebcf3['error'][_0xd4de('0x11')]===0x1f4){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x1e8c35(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);return _0x4453c2(_0x5ebcf3[_0xd4de('0x10')][_0xd4de('0x13')]);}else{logger[_0xd4de('0x14')](_0xd4de('0x12'),_0x15eb91,_0xd4de('0xe'));_0x4453c2(_0x5ebcf3[_0xd4de('0x15')]['message']);}})['catch'](function(_0x3df820){logger[_0xd4de('0x10')](_0xd4de('0x12'),_0x15eb91,_0x3df820);_0x1e8c35(_0x3df820);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 4a9f499..1e6ad4c 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 _0x43f3=['/:id','show','/:id/queues','/:id/users','getAgents','post','addQueues','addAgents','delete','removeQueues','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1860c6,_0x4c2118){var _0x5b2447=function(_0x468a6d){while(--_0x468a6d){_0x1860c6['push'](_0x1860c6['shift']());}};_0x5b2447(++_0x4c2118);}(_0x43f3,0x140));var _0x343f=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x43f3[_0x18cac4];return _0x2227c6;};'use strict';var multer=require(_0x343f('0x0'));var util=require(_0x343f('0x1'));var path=require(_0x343f('0x2'));var timeout=require('connect-timeout');var express=require(_0x343f('0x3'));var router=express['Router']();var auth=require(_0x343f('0x4'));var interaction=require(_0x343f('0x5'));var config=require(_0x343f('0x6'));var controller=require('./team.controller');router[_0x343f('0x7')]('/',auth[_0x343f('0x8')](),controller[_0x343f('0x9')]);router[_0x343f('0x7')](_0x343f('0xa'),auth[_0x343f('0x8')](),controller[_0x343f('0xb')]);router[_0x343f('0x7')](_0x343f('0xc'),auth[_0x343f('0x8')](),controller['getQueues']);router['get'](_0x343f('0xd'),auth[_0x343f('0x8')](),controller[_0x343f('0xe')]);router[_0x343f('0xf')]('/',auth[_0x343f('0x8')](),controller['create']);router['post'](_0x343f('0xc'),auth[_0x343f('0x8')](),controller[_0x343f('0x10')]);router['post'](_0x343f('0xd'),auth[_0x343f('0x8')](),controller[_0x343f('0x11')]);router['put'](_0x343f('0xa'),auth[_0x343f('0x8')](),controller['update']);router['delete'](_0x343f('0xa'),auth[_0x343f('0x8')](),controller['destroy']);router[_0x343f('0x12')](_0x343f('0xc'),auth[_0x343f('0x8')](),controller[_0x343f('0x13')]);router[_0x343f('0x12')](_0x343f('0xd'),auth['isAuthenticated'](),controller[_0x343f('0x14')]);module[_0x343f('0x15')]=router; \ No newline at end of file +var _0x814c=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','isAuthenticated','show','/:id/queues','getQueues','/:id/users','addQueues','post','addAgents','put','delete','removeQueues','removeAgents'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x814c,0x1aa));var _0xc814=function(_0x563a42,_0x1ca389){_0x563a42=_0x563a42-0x0;var _0x22a396=_0x814c[_0x563a42];return _0x22a396;};'use strict';var multer=require(_0xc814('0x0'));var util=require(_0xc814('0x1'));var path=require('path');var timeout=require(_0xc814('0x2'));var express=require(_0xc814('0x3'));var router=express[_0xc814('0x4')]();var auth=require(_0xc814('0x5'));var interaction=require(_0xc814('0x6'));var config=require(_0xc814('0x7'));var controller=require(_0xc814('0x8'));router[_0xc814('0x9')]('/',auth['isAuthenticated'](),controller[_0xc814('0xa')]);router['get'](_0xc814('0xb'),auth[_0xc814('0xc')](),controller[_0xc814('0xd')]);router[_0xc814('0x9')](_0xc814('0xe'),auth['isAuthenticated'](),controller[_0xc814('0xf')]);router['get'](_0xc814('0x10'),auth[_0xc814('0xc')](),controller['getAgents']);router['post']('/',auth[_0xc814('0xc')](),controller['create']);router['post']('/:id/queues',auth[_0xc814('0xc')](),controller[_0xc814('0x11')]);router[_0xc814('0x12')](_0xc814('0x10'),auth['isAuthenticated'](),controller[_0xc814('0x13')]);router[_0xc814('0x14')](_0xc814('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xc814('0x15')](_0xc814('0xb'),auth[_0xc814('0xc')](),controller['destroy']);router[_0xc814('0x15')]('/:id/queues',auth[_0xc814('0xc')](),controller[_0xc814('0x16')]);router[_0xc814('0x15')](_0xc814('0x10'),auth['isAuthenticated'](),controller[_0xc814('0x17')]);module[_0xc814('0x18')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 6de42ff..1b9bc3c 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 _0x9200=['exports','STRING','name'];(function(_0x3ec625,_0x155d6e){var _0x38cea9=function(_0x316a2b){while(--_0x316a2b){_0x3ec625['push'](_0x3ec625['shift']());}};_0x38cea9(++_0x155d6e);}(_0x9200,0x81));var _0x0920=function(_0x2bd27b,_0x10a749){_0x2bd27b=_0x2bd27b-0x0;var _0x4ca7e0=_0x9200[_0x2bd27b];return _0x4ca7e0;};'use strict';var Sequelize=require('sequelize');module[_0x0920('0x0')]={'name':{'type':Sequelize[_0x0920('0x1')],'allowNull':![],'unique':_0x0920('0x2')},'description':{'type':Sequelize[_0x0920('0x1')]}}; \ No newline at end of file +var _0xfb19=['sequelize','STRING','name'];(function(_0x536835,_0x4e4711){var _0x407f42=function(_0x50f4bc){while(--_0x50f4bc){_0x536835['push'](_0x536835['shift']());}};_0x407f42(++_0x4e4711);}(_0xfb19,0xd2));var _0x9fb1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb19[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9fb1('0x0'));module['exports']={'name':{'type':Sequelize[_0x9fb1('0x1')],'allowNull':![],'unique':_0x9fb1('0x2')},'description':{'type':Sequelize[_0x9fb1('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 1f740ca..d10fad5 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 _0x8276=['Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','each','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','omit','spread','emit','userTeam:save','removeAgents','chat','mail','sms','fax','openchannel','voice','isArray','userTeam:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','get','name','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError'];(function(_0x5df957,_0x4c204e){var _0x463330=function(_0x116fcb){while(--_0x116fcb){_0x5df957['push'](_0x5df957['shift']());}};_0x463330(++_0x4c204e);}(_0x8276,0xa7));var _0x6827=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8276[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x6827('0x0'));var emlformat=require(_0x6827('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6827('0x2'));var rp=require(_0x6827('0x3'));var moment=require('moment');var BPromise=require(_0x6827('0x4'));var Mustache=require(_0x6827('0x5'));var util=require('util');var path=require(_0x6827('0x6'));var sox=require(_0x6827('0x7'));var csv=require(_0x6827('0x8'));var ejs=require(_0x6827('0x9'));var fs=require('fs');var _=require(_0x6827('0xa'));var squel=require(_0x6827('0xb'));var crypto=require(_0x6827('0xc'));var jsforce=require(_0x6827('0xd'));var deskjs=require(_0x6827('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6827('0xf'));var Papa=require(_0x6827('0x10'));var Redis=require(_0x6827('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6827('0x12'));var as=require(_0x6827('0x13'));var hardwareService=require(_0x6827('0x14'));var logger=require('../../config/logger')(_0x6827('0x15'));var utils=require(_0x6827('0x16'));var config=require(_0x6827('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6827('0x18')],{'host':_0x6827('0x19'),'port':0x18eb});var socket=require(_0x6827('0x1a'))(new Redis(config['redis']));require(_0x6827('0x1b'))[_0x6827('0x1c')](socket);function respondWithStatusCode(_0x587cd9,_0x55cb16){_0x55cb16=_0x55cb16||0xcc;return function(_0x15b583){if(_0x15b583){return _0x587cd9[_0x6827('0x1d')](_0x55cb16);}return _0x587cd9[_0x6827('0x1e')](_0x55cb16)[_0x6827('0x1f')]();};}function respondWithResult(_0x1bac80,_0x4b4aac){_0x4b4aac=_0x4b4aac||0xc8;return function(_0x4bdef4){if(_0x4bdef4){return _0x1bac80[_0x6827('0x1e')](_0x4b4aac)[_0x6827('0x20')](_0x4bdef4);}};}function respondWithFilteredResult(_0x52b9ad,_0x50e3dc){return function(_0x81c2dd){if(_0x81c2dd){var _0x4a9c42=_0x81c2dd[_0x6827('0x21')],_0x41a029=_0x50e3dc[_0x6827('0x22')],_0x9cf7c0=_0x50e3dc[_0x6827('0x22')]+_0x50e3dc['limit'],_0x38563b;if(_0x9cf7c0>=_0x4a9c42){_0x9cf7c0=_0x4a9c42;_0x38563b=0xc8;}else{_0x38563b=0xce;}_0x52b9ad[_0x6827('0x1e')](_0x38563b);return _0x52b9ad[_0x6827('0x23')]('Content-Range',_0x41a029+'-'+_0x9cf7c0+'/'+_0x4a9c42)[_0x6827('0x20')](_0x81c2dd);}return null;};}function patchUpdates(_0x127e5b){return function(_0xe97703){try{jsonpatch[_0x6827('0x24')](_0xe97703,_0x127e5b,!![]);}catch(_0x17e4cc){return BPromise[_0x6827('0x25')](_0x17e4cc);}return _0xe97703[_0x6827('0x26')]();};}function saveUpdates(_0x15f8b3,_0x2d65d0){return function(_0x4cb2e5){if(_0x4cb2e5){return _0x4cb2e5[_0x6827('0x27')](_0x15f8b3)['then'](function(_0x25e37e){return _0x25e37e;});}return null;};}function removeEntity(_0x5c3a1f,_0x162cdb){return function(_0x621dd9){if(_0x621dd9){return _0x621dd9[_0x6827('0x28')]()[_0x6827('0x29')](function(){var _0xfca65c=_0x621dd9[_0x6827('0x2a')]({'plain':!![]});var _0x657390='Teams';return db['UserProfileResource'][_0x6827('0x28')]({'where':{'type':_0x657390,'resourceId':_0xfca65c['id']}})[_0x6827('0x29')](function(){return _0x621dd9;});})[_0x6827('0x29')](function(){_0x5c3a1f[_0x6827('0x1e')](0xcc)[_0x6827('0x1f')]();});}};}function handleEntityNotFound(_0x365b73,_0x320943){return function(_0x43300a){if(!_0x43300a){_0x365b73[_0x6827('0x1d')](0x194);}return _0x43300a;};}function handleError(_0x42bc7d,_0x547444){_0x547444=_0x547444||0x1f4;return function(_0x6f9b98){logger['error'](_0x6f9b98['stack']);if(_0x6f9b98[_0x6827('0x2b')]){delete _0x6f9b98[_0x6827('0x2b')];}_0x42bc7d[_0x6827('0x1e')](_0x547444)['send'](_0x6f9b98);};}exports[_0x6827('0x2c')]=function(_0x179072,_0x4f9106){var _0x5b4def={},_0x26674b={},_0x189eec={'count':0x0,'rows':[]};var _0x570198=_[_0x6827('0x2d')](db['Team'][_0x6827('0x2e')],function(_0x1cbb8f){return{'name':_0x1cbb8f[_0x6827('0x2f')],'type':_0x1cbb8f[_0x6827('0x30')]['key']};});_0x26674b['model']=_[_0x6827('0x2d')](_0x570198,_0x6827('0x2b'));_0x26674b[_0x6827('0x31')]=_['keys'](_0x179072[_0x6827('0x31')]);_0x26674b[_0x6827('0x32')]=_[_0x6827('0x33')](_0x26674b[_0x6827('0x34')],_0x26674b['query']);_0x5b4def['attributes']=_[_0x6827('0x33')](_0x26674b[_0x6827('0x34')],qs['fields'](_0x179072[_0x6827('0x31')]['fields']));_0x5b4def[_0x6827('0x35')]=_0x5b4def['attributes'][_0x6827('0x36')]?_0x5b4def['attributes']:_0x26674b['model'];if(!_0x179072['query'][_0x6827('0x37')](_0x6827('0x38'))){_0x5b4def[_0x6827('0x39')]=qs[_0x6827('0x39')](_0x179072[_0x6827('0x31')]['limit']);_0x5b4def[_0x6827('0x22')]=qs[_0x6827('0x22')](_0x179072['query'][_0x6827('0x22')]);}_0x5b4def[_0x6827('0x3a')]=qs[_0x6827('0x3b')](_0x179072[_0x6827('0x31')][_0x6827('0x3b')]);_0x5b4def[_0x6827('0x3c')]=qs[_0x6827('0x32')](_[_0x6827('0x3d')](_0x179072[_0x6827('0x31')],_0x26674b[_0x6827('0x32')]));if(_0x179072[_0x6827('0x31')][_0x6827('0x3e')]){_0x5b4def[_0x6827('0x3c')]=_[_0x6827('0x3f')](_0x5b4def[_0x6827('0x3c')],{'$or':_[_0x6827('0x2d')](_0x570198,function(_0x24222d){if(_0x24222d[_0x6827('0x30')]!==_0x6827('0x40')){var _0x305c55={};_0x305c55[_0x24222d[_0x6827('0x2b')]]={'$like':'%'+_0x179072[_0x6827('0x31')][_0x6827('0x3e')]+'%'};return _0x305c55;}})});}_0x5b4def=_[_0x6827('0x3f')]({},_0x5b4def,_0x179072[_0x6827('0x41')]);var _0xbc2d88={'where':_0x5b4def[_0x6827('0x3c')]};return db[_0x6827('0x42')][_0x6827('0x21')](_0xbc2d88)[_0x6827('0x29')](function(_0x3e78b2){_0x189eec['count']=_0x3e78b2;if(_0x179072[_0x6827('0x31')][_0x6827('0x43')]){_0x5b4def[_0x6827('0x44')]=[{'all':!![]}];}return db[_0x6827('0x42')][_0x6827('0x45')](_0x5b4def);})[_0x6827('0x29')](function(_0x27c50a){_0x189eec[_0x6827('0x46')]=_0x27c50a;return _0x189eec;})['then'](respondWithFilteredResult(_0x4f9106,_0x5b4def))[_0x6827('0x47')](handleError(_0x4f9106,null));};exports[_0x6827('0x48')]=function(_0x1d7d35,_0x3123af){var _0x285e59={'raw':![],'where':{'id':_0x1d7d35[_0x6827('0x49')]['id']}},_0x113a24={};_0x113a24[_0x6827('0x34')]=_[_0x6827('0x4a')](db['Team'][_0x6827('0x2e')]);_0x113a24['query']=_[_0x6827('0x4a')](_0x1d7d35[_0x6827('0x31')]);_0x113a24['filters']=_[_0x6827('0x33')](_0x113a24['model'],_0x113a24[_0x6827('0x31')]);_0x285e59[_0x6827('0x35')]=_[_0x6827('0x33')](_0x113a24['model'],qs[_0x6827('0x4b')](_0x1d7d35[_0x6827('0x31')]['fields']));_0x285e59[_0x6827('0x35')]=_0x285e59['attributes'][_0x6827('0x36')]?_0x285e59[_0x6827('0x35')]:_0x113a24[_0x6827('0x34')];if(_0x1d7d35[_0x6827('0x31')][_0x6827('0x43')]){_0x285e59['include']=[{'all':!![]}];}_0x285e59=_[_0x6827('0x3f')]({},_0x285e59,_0x1d7d35[_0x6827('0x41')]);return db[_0x6827('0x42')][_0x6827('0x4c')](_0x285e59)[_0x6827('0x29')](handleEntityNotFound(_0x3123af,null))['then'](respondWithResult(_0x3123af,null))[_0x6827('0x47')](handleError(_0x3123af,null));};exports['create']=function(_0x5c135c,_0x37b2a5){return db[_0x6827('0x42')][_0x6827('0x4d')](_0x5c135c[_0x6827('0x4e')],{})['then'](function(_0x3105ee){var _0x503ea3=_0x5c135c[_0x6827('0x4f')][_0x6827('0x2a')]({'plain':!![]});if(!_0x503ea3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x503ea3[_0x6827('0x50')]==='user'){var _0x131141=_0x3105ee[_0x6827('0x2a')]({'plain':!![]});var _0x4ae374='Teams';return db[_0x6827('0x51')][_0x6827('0x4c')]({'where':{'name':_0x4ae374,'userProfileId':_0x503ea3[_0x6827('0x52')]},'raw':!![]})[_0x6827('0x29')](function(_0x51a084){if(_0x51a084&&_0x51a084[_0x6827('0x53')]===0x0){return db[_0x6827('0x54')][_0x6827('0x4d')]({'name':_0x131141[_0x6827('0x2b')],'resourceId':_0x131141['id'],'type':_0x51a084[_0x6827('0x2b')],'sectionId':_0x51a084['id']},{})[_0x6827('0x29')](function(){return _0x3105ee;});}else{return _0x3105ee;}})[_0x6827('0x47')](function(_0x389a65){logger[_0x6827('0x55')](_0x6827('0x56'),_0x389a65);throw _0x389a65;});}return _0x3105ee;})['then'](respondWithResult(_0x37b2a5,0xc9))['catch'](handleError(_0x37b2a5,null));};exports['update']=function(_0x3549fc,_0xfeb8c6){if(_0x3549fc[_0x6827('0x4e')]['id']){delete _0x3549fc['body']['id'];}return db['Team']['find']({'where':{'id':_0x3549fc[_0x6827('0x49')]['id']}})[_0x6827('0x29')](handleEntityNotFound(_0xfeb8c6,null))[_0x6827('0x29')](saveUpdates(_0x3549fc[_0x6827('0x4e')],null))[_0x6827('0x29')](respondWithResult(_0xfeb8c6,null))['catch'](handleError(_0xfeb8c6,null));};exports[_0x6827('0x28')]=function(_0x3102da,_0x31cd5a){return db[_0x6827('0x42')][_0x6827('0x4c')]({'where':{'id':_0x3102da[_0x6827('0x49')]['id']}})[_0x6827('0x29')](handleEntityNotFound(_0x31cd5a,null))[_0x6827('0x29')](removeEntity(_0x31cd5a,null))[_0x6827('0x47')](handleError(_0x31cd5a,null));};exports[_0x6827('0x57')]=function(_0x57561b,_0x5b5583,_0x214769){return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x57561b[_0x6827('0x49')]['id']}})[_0x6827('0x29')](handleEntityNotFound(_0x5b5583,null))[_0x6827('0x29')](function(_0xa70dd4){if(!_0x57561b[_0x6827('0x31')][_0x6827('0x59')]||!utils[_0x6827('0x5a')](_0x57561b[_0x6827('0x31')]['channel'])){throw new db[(_0x6827('0x5b'))][(_0x6827('0x5c'))](_0x6827('0x5d'));}var _0xe5c000={};var _0x82203f={};_0x82203f[_0x6827('0x34')]=_['keys'](db[_['capitalize'](_0x57561b['query']['channel'][_0x6827('0x5e')]())+_0x6827('0x5f')][_0x6827('0x2e')]);_0x82203f[_0x6827('0x31')]=_[_0x6827('0x4a')](_0x57561b[_0x6827('0x31')]);_0x82203f[_0x6827('0x32')]=_[_0x6827('0x33')](_0x82203f[_0x6827('0x34')],_0x82203f[_0x6827('0x31')]);_0xe5c000[_0x6827('0x35')]=_[_0x6827('0x33')](_0x82203f[_0x6827('0x34')],qs['fields'](_0x57561b[_0x6827('0x31')]['fields']));_0xe5c000[_0x6827('0x35')]=_0xe5c000[_0x6827('0x35')][_0x6827('0x36')]?_0xe5c000[_0x6827('0x35')]:_0x82203f['model'];_0xe5c000[_0x6827('0x39')]=qs[_0x6827('0x39')](_0x57561b['query']['limit']);_0xe5c000[_0x6827('0x22')]=qs[_0x6827('0x22')](_0x57561b[_0x6827('0x31')]['offset']);_0xe5c000['order']=qs[_0x6827('0x3b')](_0x57561b[_0x6827('0x31')][_0x6827('0x3b')]);_0xe5c000['where']=qs[_0x6827('0x32')](_[_0x6827('0x3d')](_0x57561b[_0x6827('0x31')],_0x82203f[_0x6827('0x32')]));_0xe5c000=_['merge']({},_0xe5c000,_0x57561b[_0x6827('0x41')]);return _0xa70dd4['get'+_[_0x6827('0x60')](_0x57561b['query'][_0x6827('0x59')][_0x6827('0x5e')]())+_0x6827('0x61')](_0xe5c000);})['then'](respondWithResult(_0x5b5583,null))[_0x6827('0x47')](handleError(_0x5b5583,null));};exports[_0x6827('0x62')]=function(_0x402d49,_0x44f181,_0x4a652a){return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x402d49[_0x6827('0x49')]['id']}})[_0x6827('0x29')](function(_0x267827){if(_0x267827){if(!_0x402d49[_0x6827('0x4e')]['channel']||!utils[_0x6827('0x5a')](_0x402d49['body']['channel'])){throw new db['Sequelize'][(_0x6827('0x5c'))](_0x6827('0x5d'));}return _0x267827[_0x6827('0x63')+_[_0x6827('0x60')](_0x402d49[_0x6827('0x4e')]['channel'][_0x6827('0x5e')]())+_0x6827('0x61')](_0x402d49[_0x6827('0x4e')][_0x6827('0x64')]);}return null;})[_0x6827('0x29')](handleEntityNotFound(_0x44f181,null))[_0x6827('0x29')](respondWithStatusCode(_0x44f181,null))[_0x6827('0x47')](handleError(_0x44f181,null));};exports[_0x6827('0x65')]=function(_0x68510d,_0xf84419,_0x2b7844){return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x68510d[_0x6827('0x49')]['id']}})['then'](function(_0x148052){if(_0x148052){if(!_0x68510d[_0x6827('0x31')][_0x6827('0x59')]||!utils[_0x6827('0x5a')](_0x68510d['query']['channel'])){throw new db[(_0x6827('0x5b'))][(_0x6827('0x5c'))](_0x6827('0x5d'));}return _0x148052[_0x6827('0x66')+_['capitalize'](_0x68510d[_0x6827('0x31')][_0x6827('0x59')]['toLowerCase']())+_0x6827('0x61')](_0x68510d[_0x6827('0x31')]['ids']);}return null;})[_0x6827('0x29')](handleEntityNotFound(_0xf84419,null))[_0x6827('0x29')](respondWithStatusCode(_0xf84419,null))[_0x6827('0x47')](handleError(_0xf84419,null));};exports[_0x6827('0x67')]=function(_0x5806ec,_0xb669aa,_0x3cbe44){return db[_0x6827('0x42')][_0x6827('0x4c')]({'where':{'id':_0x5806ec['params']['id']}})[_0x6827('0x29')](handleEntityNotFound(_0xb669aa,null))[_0x6827('0x29')](function(_0x86cecd){if(_0x86cecd){var _0x244e9f=[_0x6827('0x68'),_0x6827('0x69'),_0x6827('0x6a'),_0x6827('0x6b'),'Fax',_0x6827('0x6c')];return BPromise['each'](_0x244e9f,function(_0x163bfe){return _0x86cecd['get'+_0x163bfe+_0x6827('0x61')]({'attributes':['id','name']})[_0x6827('0x29')](function(_0x2d7eef){return BPromise[_0x6827('0x6d')](_0x2d7eef,function(_0xb2ddd8){return _0xb2ddd8[_0x6827('0x67')](_0x5806ec[_0x6827('0x4e')]['ids'])['then'](function(){if(_0x163bfe==='Voice'){return db['User'][_0x6827('0x45')]({'where':{'id':_0x5806ec[_0x6827('0x4e')][_0x6827('0x64')]},'attributes':['id',_0x6827('0x2b'),'online',_0x6827('0x6e'),_0x6827('0x6f')],'raw':!![]})[_0x6827('0x29')](function(_0x5973c0){return BPromise['each'](_['filter'](_0x5973c0,{'online':0x1}),function(_0x201105){return db[_0x6827('0x70')][_0x6827('0x71')]({'membername':_0x201105[_0x6827('0x2b')],'UserId':_0x201105['id'],'queue_name':_0xb2ddd8[_0x6827('0x2b')],'VoiceQueueId':_0xb2ddd8['id'],'interface':_[_0x6827('0x72')](_0x201105[_0x6827('0x6f')])?util[_0x6827('0x73')]('SIP/%s',_0x201105[_0x6827('0x2b')]):_0x201105[_0x6827('0x6f')],'paused':_0x201105[_0x6827('0x6e')]||![],'penalty':0x0});});});}});});})[_0x6827('0x29')](function(){return _0x86cecd;});})[_0x6827('0x29')](function(){return _0x86cecd;});}})[_0x6827('0x29')](function(_0x1d3a65){if(_0x1d3a65){return _0x1d3a65[_0x6827('0x67')](_0x5806ec['body'][_0x6827('0x64')],_[_0x6827('0x74')](_0x5806ec[_0x6827('0x4e')],[_0x6827('0x64'),'id'])||{})[_0x6827('0x75')](function(_0x38b59b){for(var _0x5aee3d=0x0;_0x5aee3d<_0x5806ec[_0x6827('0x4e')][_0x6827('0x64')][_0x6827('0x36')];_0x5aee3d+=0x1){socket[_0x6827('0x76')](_0x6827('0x77'),{'UserId':_0x5806ec['body'][_0x6827('0x64')][_0x5aee3d],'TeamId':_0x5806ec[_0x6827('0x49')]['id']});}return _0x38b59b;});}})[_0x6827('0x29')](respondWithResult(_0xb669aa,null))[_0x6827('0x47')](handleError(_0xb669aa,null));};exports[_0x6827('0x78')]=function(_0xf5323,_0x50cce2,_0x3e5817){return db[_0x6827('0x42')][_0x6827('0x4c')]({'where':{'id':_0xf5323[_0x6827('0x49')]['id']}})['then'](handleEntityNotFound(_0x50cce2,null))[_0x6827('0x29')](function(_0x4c8b77){if(_0x4c8b77){return BPromise[_0x6827('0x6d')](['voice',_0x6827('0x79'),_0x6827('0x7a'),_0x6827('0x7b'),_0x6827('0x7c'),_0x6827('0x7d')],function(_0x2d1bd9){return _0x4c8b77[_0x6827('0x2a')+_[_0x6827('0x60')](_0x2d1bd9)+_0x6827('0x61')]({'attributes':['id','name']})[_0x6827('0x29')](function(_0x30586a){return BPromise[_0x6827('0x6d')](_0x30586a,function(_0x1ec9f5){return _0x1ec9f5['removeAgents'](_0xf5323[_0x6827('0x31')][_0x6827('0x64')])['then'](function(){if(_0x2d1bd9===_0x6827('0x7e')){return db[_0x6827('0x70')][_0x6827('0x28')]({'where':{'VoiceQueueId':_0x1ec9f5['id'],'UserId':_0xf5323[_0x6827('0x31')][_0x6827('0x64')]}});}});});})[_0x6827('0x29')](function(){return _0x4c8b77;});})[_0x6827('0x29')](function(){return _0x4c8b77;});}})[_0x6827('0x29')](function(_0x2bd005){if(_0x2bd005){return _0x2bd005[_0x6827('0x78')](_0xf5323[_0x6827('0x31')][_0x6827('0x64')])[_0x6827('0x29')](function(){if(_[_0x6827('0x7f')](_0xf5323[_0x6827('0x31')][_0x6827('0x64')])){for(var _0x4a8ca6=0x0;_0x4a8ca6<_0xf5323[_0x6827('0x31')][_0x6827('0x64')][_0x6827('0x36')];_0x4a8ca6+=0x1){socket[_0x6827('0x76')](_0x6827('0x80'),{'UserId':Number(_0xf5323[_0x6827('0x31')][_0x6827('0x64')][_0x4a8ca6]),'TeamId':Number(_0xf5323[_0x6827('0x49')]['id'])});}}else{socket[_0x6827('0x76')]('userTeam:remove',{'UserId':Number(_0xf5323[_0x6827('0x31')][_0x6827('0x64')]),'TeamId':Number(_0xf5323[_0x6827('0x49')]['id'])});}});}})[_0x6827('0x29')](respondWithStatusCode(_0x50cce2,null))['catch'](handleError(_0x50cce2,null));};exports[_0x6827('0x81')]=function(_0x403c47,_0x4088a9,_0x305a83){var _0x48c57c={};var _0x4fd919={};var _0x2244d3;var _0x226889;return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x403c47['params']['id']}})[_0x6827('0x29')](handleEntityNotFound(_0x4088a9,null))[_0x6827('0x29')](function(_0x2921b0){if(_0x2921b0){_0x2244d3=_0x2921b0;_0x4fd919[_0x6827('0x34')]=_['keys'](db['User'][_0x6827('0x2e')]);_0x4fd919[_0x6827('0x31')]=_[_0x6827('0x4a')](_0x403c47[_0x6827('0x31')]);_0x4fd919[_0x6827('0x32')]=_['intersection'](_0x4fd919[_0x6827('0x34')],_0x4fd919['query']);_0x48c57c[_0x6827('0x35')]=_[_0x6827('0x33')](_0x4fd919['model'],qs[_0x6827('0x4b')](_0x403c47[_0x6827('0x31')][_0x6827('0x4b')]));_0x48c57c[_0x6827('0x35')]=_0x48c57c['attributes'][_0x6827('0x36')]?_0x48c57c[_0x6827('0x35')]:_0x4fd919[_0x6827('0x34')];_0x48c57c[_0x6827('0x3a')]=qs[_0x6827('0x3b')](_0x403c47[_0x6827('0x31')][_0x6827('0x3b')]);_0x48c57c[_0x6827('0x3c')]=qs[_0x6827('0x32')](_[_0x6827('0x3d')](_0x403c47[_0x6827('0x31')],_0x4fd919[_0x6827('0x32')]));if(_0x403c47[_0x6827('0x31')][_0x6827('0x3e')]){_0x48c57c[_0x6827('0x3c')]=_[_0x6827('0x3f')](_0x48c57c[_0x6827('0x3c')],{'$or':_[_0x6827('0x2d')](_0x48c57c[_0x6827('0x35')],function(_0x24c7ab){var _0x3c045f={};_0x3c045f[_0x24c7ab]={'$like':'%'+_0x403c47['query']['filter']+'%'};return _0x3c045f;})});}_0x48c57c=_[_0x6827('0x3f')]({},_0x48c57c,_0x403c47[_0x6827('0x41')]);return _0x2244d3['getAgents'](_0x48c57c);}})[_0x6827('0x29')](function(_0xe81f50){if(_0xe81f50){_0x226889=_0xe81f50[_0x6827('0x36')];if(!_0x403c47['query'][_0x6827('0x37')]('nolimit')){_0x48c57c[_0x6827('0x39')]=qs['limit'](_0x403c47[_0x6827('0x31')]['limit']);_0x48c57c['offset']=qs[_0x6827('0x22')](_0x403c47[_0x6827('0x31')]['offset']);}return _0x2244d3[_0x6827('0x81')](_0x48c57c);}})[_0x6827('0x29')](function(_0x3f1fb4){if(_0x3f1fb4){return _0x3f1fb4?{'count':_0x226889,'rows':_0x3f1fb4}:null;}})[_0x6827('0x29')](respondWithResult(_0x4088a9,null))[_0x6827('0x47')](handleError(_0x4088a9,null));}; \ No newline at end of file +var _0x9c9b=['ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','each','User','online','voicePause','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','omit','emit','removeAgents','voice','chat','sms','fax','openchannel','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','redis','./team.socket','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','map','Team','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','rows','catch','params','rawAttributes','intersection','create','body','get','role','Teams','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','channel','isValidChannel','Sequelize'];(function(_0x395324,_0x56198d){var _0x234f15=function(_0x397317){while(--_0x397317){_0x395324['push'](_0x395324['shift']());}};_0x234f15(++_0x56198d);}(_0x9c9b,0x194));var _0xb9c9=function(_0x887954,_0x275ad5){_0x887954=_0x887954-0x0;var _0x396b39=_0x9c9b[_0x887954];return _0x396b39;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb9c9('0x0'));var rimraf=require(_0xb9c9('0x1'));var zipdir=require(_0xb9c9('0x2'));var jsonpatch=require(_0xb9c9('0x3'));var rp=require(_0xb9c9('0x4'));var moment=require('moment');var BPromise=require(_0xb9c9('0x5'));var Mustache=require(_0xb9c9('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xb9c9('0x7'));var ejs=require(_0xb9c9('0x8'));var fs=require('fs');var _=require(_0xb9c9('0x9'));var squel=require(_0xb9c9('0xa'));var crypto=require(_0xb9c9('0xb'));var jsforce=require(_0xb9c9('0xc'));var deskjs=require(_0xb9c9('0xd'));var toCsv=require(_0xb9c9('0x7'));var querystring=require(_0xb9c9('0xe'));var Papa=require(_0xb9c9('0xf'));var Redis=require(_0xb9c9('0x10'));var authService=require(_0xb9c9('0x11'));var qs=require(_0xb9c9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb9c9('0x13'))(_0xb9c9('0x14'));var utils=require(_0xb9c9('0x15'));var config=require(_0xb9c9('0x16'));var db=require(_0xb9c9('0x17'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb9c9('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb9c9('0x19')]));require(_0xb9c9('0x1a'))['register'](socket);function respondWithStatusCode(_0x5e0372,_0x1e19c1){_0x1e19c1=_0x1e19c1||0xcc;return function(_0x2cc5c1){if(_0x2cc5c1){return _0x5e0372[_0xb9c9('0x1b')](_0x1e19c1);}return _0x5e0372['status'](_0x1e19c1)[_0xb9c9('0x1c')]();};}function respondWithResult(_0x1af04b,_0xf55953){_0xf55953=_0xf55953||0xc8;return function(_0xf48fa6){if(_0xf48fa6){return _0x1af04b[_0xb9c9('0x1d')](_0xf55953)['json'](_0xf48fa6);}};}function respondWithFilteredResult(_0x36719c,_0x3fbf85){return function(_0x1a82b3){if(_0x1a82b3){var _0x5b569f=_0x1a82b3[_0xb9c9('0x1e')],_0x5b9586=_0x3fbf85[_0xb9c9('0x1f')],_0x4b5414=_0x3fbf85[_0xb9c9('0x1f')]+_0x3fbf85[_0xb9c9('0x20')],_0x5551cd;if(_0x4b5414>=_0x5b569f){_0x4b5414=_0x5b569f;_0x5551cd=0xc8;}else{_0x5551cd=0xce;}_0x36719c[_0xb9c9('0x1d')](_0x5551cd);return _0x36719c[_0xb9c9('0x21')](_0xb9c9('0x22'),_0x5b9586+'-'+_0x4b5414+'/'+_0x5b569f)[_0xb9c9('0x23')](_0x1a82b3);}return null;};}function patchUpdates(_0x380a42){return function(_0xa91185){try{jsonpatch[_0xb9c9('0x24')](_0xa91185,_0x380a42,!![]);}catch(_0x130d40){return BPromise[_0xb9c9('0x25')](_0x130d40);}return _0xa91185['save']();};}function saveUpdates(_0xbdbb51,_0x51edac){return function(_0x1f9c85){if(_0x1f9c85){return _0x1f9c85[_0xb9c9('0x26')](_0xbdbb51)[_0xb9c9('0x27')](function(_0x292f41){return _0x292f41;});}return null;};}function removeEntity(_0x46379d,_0x50e5f0){return function(_0x21ff54){if(_0x21ff54){return _0x21ff54[_0xb9c9('0x28')]()[_0xb9c9('0x27')](function(){var _0x14c123=_0x21ff54['get']({'plain':!![]});var _0x24cc1d='Teams';return db['UserProfileResource']['destroy']({'where':{'type':_0x24cc1d,'resourceId':_0x14c123['id']}})[_0xb9c9('0x27')](function(){return _0x21ff54;});})[_0xb9c9('0x27')](function(){_0x46379d[_0xb9c9('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3198c,_0x139b84){return function(_0xdf8e50){if(!_0xdf8e50){_0xe3198c[_0xb9c9('0x1b')](0x194);}return _0xdf8e50;};}function handleError(_0x2417fd,_0x3bfc70){_0x3bfc70=_0x3bfc70||0x1f4;return function(_0x2fb33f){logger[_0xb9c9('0x29')](_0x2fb33f[_0xb9c9('0x2a')]);if(_0x2fb33f['name']){delete _0x2fb33f[_0xb9c9('0x2b')];}_0x2417fd[_0xb9c9('0x1d')](_0x3bfc70)[_0xb9c9('0x2c')](_0x2fb33f);};}exports['index']=function(_0x44585d,_0x1811a5){var _0x46d421={},_0x8f749a={},_0x55640f={'count':0x0,'rows':[]};var _0x3a6f46=_[_0xb9c9('0x2d')](db[_0xb9c9('0x2e')]['rawAttributes'],function(_0x38bacd){return{'name':_0x38bacd[_0xb9c9('0x2f')],'type':_0x38bacd[_0xb9c9('0x30')][_0xb9c9('0x31')]};});_0x8f749a[_0xb9c9('0x32')]=_[_0xb9c9('0x2d')](_0x3a6f46,_0xb9c9('0x2b'));_0x8f749a[_0xb9c9('0x33')]=_[_0xb9c9('0x34')](_0x44585d[_0xb9c9('0x33')]);_0x8f749a[_0xb9c9('0x35')]=_['intersection'](_0x8f749a[_0xb9c9('0x32')],_0x8f749a['query']);_0x46d421[_0xb9c9('0x36')]=_['intersection'](_0x8f749a[_0xb9c9('0x32')],qs[_0xb9c9('0x37')](_0x44585d[_0xb9c9('0x33')][_0xb9c9('0x37')]));_0x46d421[_0xb9c9('0x36')]=_0x46d421['attributes'][_0xb9c9('0x38')]?_0x46d421[_0xb9c9('0x36')]:_0x8f749a['model'];if(!_0x44585d[_0xb9c9('0x33')][_0xb9c9('0x39')](_0xb9c9('0x3a'))){_0x46d421[_0xb9c9('0x20')]=qs[_0xb9c9('0x20')](_0x44585d['query'][_0xb9c9('0x20')]);_0x46d421[_0xb9c9('0x1f')]=qs[_0xb9c9('0x1f')](_0x44585d[_0xb9c9('0x33')][_0xb9c9('0x1f')]);}_0x46d421[_0xb9c9('0x3b')]=qs[_0xb9c9('0x3c')](_0x44585d[_0xb9c9('0x33')][_0xb9c9('0x3c')]);_0x46d421['where']=qs[_0xb9c9('0x35')](_[_0xb9c9('0x3d')](_0x44585d[_0xb9c9('0x33')],_0x8f749a[_0xb9c9('0x35')]));if(_0x44585d['query'][_0xb9c9('0x3e')]){_0x46d421[_0xb9c9('0x3f')]=_['merge'](_0x46d421['where'],{'$or':_[_0xb9c9('0x2d')](_0x3a6f46,function(_0x170381){if(_0x170381[_0xb9c9('0x30')]!==_0xb9c9('0x40')){var _0x1f3ce3={};_0x1f3ce3[_0x170381[_0xb9c9('0x2b')]]={'$like':'%'+_0x44585d[_0xb9c9('0x33')]['filter']+'%'};return _0x1f3ce3;}})});}_0x46d421=_[_0xb9c9('0x41')]({},_0x46d421,_0x44585d[_0xb9c9('0x42')]);var _0x37b84b={'where':_0x46d421[_0xb9c9('0x3f')]};return db[_0xb9c9('0x2e')][_0xb9c9('0x1e')](_0x37b84b)[_0xb9c9('0x27')](function(_0x3c0c98){_0x55640f[_0xb9c9('0x1e')]=_0x3c0c98;if(_0x44585d[_0xb9c9('0x33')][_0xb9c9('0x43')]){_0x46d421[_0xb9c9('0x44')]=[{'all':!![]}];}return db[_0xb9c9('0x2e')]['findAll'](_0x46d421);})[_0xb9c9('0x27')](function(_0x2efeec){_0x55640f[_0xb9c9('0x45')]=_0x2efeec;return _0x55640f;})['then'](respondWithFilteredResult(_0x1811a5,_0x46d421))[_0xb9c9('0x46')](handleError(_0x1811a5,null));};exports['show']=function(_0x17432f,_0x12339e){var _0x558aa7={'raw':![],'where':{'id':_0x17432f[_0xb9c9('0x47')]['id']}},_0x37344c={};_0x37344c[_0xb9c9('0x32')]=_[_0xb9c9('0x34')](db[_0xb9c9('0x2e')][_0xb9c9('0x48')]);_0x37344c['query']=_['keys'](_0x17432f['query']);_0x37344c[_0xb9c9('0x35')]=_[_0xb9c9('0x49')](_0x37344c['model'],_0x37344c[_0xb9c9('0x33')]);_0x558aa7[_0xb9c9('0x36')]=_[_0xb9c9('0x49')](_0x37344c[_0xb9c9('0x32')],qs[_0xb9c9('0x37')](_0x17432f[_0xb9c9('0x33')][_0xb9c9('0x37')]));_0x558aa7['attributes']=_0x558aa7[_0xb9c9('0x36')][_0xb9c9('0x38')]?_0x558aa7[_0xb9c9('0x36')]:_0x37344c[_0xb9c9('0x32')];if(_0x17432f[_0xb9c9('0x33')][_0xb9c9('0x43')]){_0x558aa7[_0xb9c9('0x44')]=[{'all':!![]}];}_0x558aa7=_[_0xb9c9('0x41')]({},_0x558aa7,_0x17432f[_0xb9c9('0x42')]);return db[_0xb9c9('0x2e')]['find'](_0x558aa7)[_0xb9c9('0x27')](handleEntityNotFound(_0x12339e,null))['then'](respondWithResult(_0x12339e,null))[_0xb9c9('0x46')](handleError(_0x12339e,null));};exports[_0xb9c9('0x4a')]=function(_0x280f24,_0x503067){return db['Team']['create'](_0x280f24[_0xb9c9('0x4b')],{})['then'](function(_0x5a2d2a){var _0x57dd16=_0x280f24['user'][_0xb9c9('0x4c')]({'plain':!![]});if(!_0x57dd16)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57dd16[_0xb9c9('0x4d')]==='user'){var _0xca049b=_0x5a2d2a[_0xb9c9('0x4c')]({'plain':!![]});var _0x25c5c3=_0xb9c9('0x4e');return db['UserProfileSection'][_0xb9c9('0x4f')]({'where':{'name':_0x25c5c3,'userProfileId':_0x57dd16[_0xb9c9('0x50')]},'raw':!![]})[_0xb9c9('0x27')](function(_0x1dc430){if(_0x1dc430&&_0x1dc430[_0xb9c9('0x51')]===0x0){return db[_0xb9c9('0x52')][_0xb9c9('0x4a')]({'name':_0xca049b['name'],'resourceId':_0xca049b['id'],'type':_0x1dc430[_0xb9c9('0x2b')],'sectionId':_0x1dc430['id']},{})['then'](function(){return _0x5a2d2a;});}else{return _0x5a2d2a;}})['catch'](function(_0x463b58){logger[_0xb9c9('0x29')](_0xb9c9('0x53'),_0x463b58);throw _0x463b58;});}return _0x5a2d2a;})[_0xb9c9('0x27')](respondWithResult(_0x503067,0xc9))[_0xb9c9('0x46')](handleError(_0x503067,null));};exports[_0xb9c9('0x26')]=function(_0x2b5daf,_0x1ef9cd){if(_0x2b5daf[_0xb9c9('0x4b')]['id']){delete _0x2b5daf[_0xb9c9('0x4b')]['id'];}return db[_0xb9c9('0x2e')][_0xb9c9('0x4f')]({'where':{'id':_0x2b5daf[_0xb9c9('0x47')]['id']}})[_0xb9c9('0x27')](handleEntityNotFound(_0x1ef9cd,null))[_0xb9c9('0x27')](saveUpdates(_0x2b5daf[_0xb9c9('0x4b')],null))['then'](respondWithResult(_0x1ef9cd,null))['catch'](handleError(_0x1ef9cd,null));};exports[_0xb9c9('0x28')]=function(_0xf8f72d,_0x3497f8){return db[_0xb9c9('0x2e')][_0xb9c9('0x4f')]({'where':{'id':_0xf8f72d[_0xb9c9('0x47')]['id']}})[_0xb9c9('0x27')](handleEntityNotFound(_0x3497f8,null))['then'](removeEntity(_0x3497f8,null))[_0xb9c9('0x46')](handleError(_0x3497f8,null));};exports['getQueues']=function(_0x53f38d,_0x6c3304,_0x17fc50){return db['Team'][_0xb9c9('0x54')]({'where':{'id':_0x53f38d[_0xb9c9('0x47')]['id']}})[_0xb9c9('0x27')](handleEntityNotFound(_0x6c3304,null))['then'](function(_0x8fad8f){if(!_0x53f38d['query'][_0xb9c9('0x55')]||!utils[_0xb9c9('0x56')](_0x53f38d[_0xb9c9('0x33')][_0xb9c9('0x55')])){throw new db[(_0xb9c9('0x57'))][(_0xb9c9('0x58'))](_0xb9c9('0x59'));}var _0x109bc0={};var _0x4586b6={};_0x4586b6['model']=_[_0xb9c9('0x34')](db[_[_0xb9c9('0x5a')](_0x53f38d[_0xb9c9('0x33')][_0xb9c9('0x55')][_0xb9c9('0x5b')]())+'Queue'][_0xb9c9('0x48')]);_0x4586b6[_0xb9c9('0x33')]=_[_0xb9c9('0x34')](_0x53f38d[_0xb9c9('0x33')]);_0x4586b6[_0xb9c9('0x35')]=_[_0xb9c9('0x49')](_0x4586b6['model'],_0x4586b6['query']);_0x109bc0[_0xb9c9('0x36')]=_[_0xb9c9('0x49')](_0x4586b6[_0xb9c9('0x32')],qs['fields'](_0x53f38d[_0xb9c9('0x33')]['fields']));_0x109bc0['attributes']=_0x109bc0[_0xb9c9('0x36')]['length']?_0x109bc0['attributes']:_0x4586b6[_0xb9c9('0x32')];_0x109bc0[_0xb9c9('0x20')]=qs[_0xb9c9('0x20')](_0x53f38d[_0xb9c9('0x33')]['limit']);_0x109bc0['offset']=qs[_0xb9c9('0x1f')](_0x53f38d[_0xb9c9('0x33')]['offset']);_0x109bc0[_0xb9c9('0x3b')]=qs['sort'](_0x53f38d[_0xb9c9('0x33')][_0xb9c9('0x3c')]);_0x109bc0[_0xb9c9('0x3f')]=qs[_0xb9c9('0x35')](_[_0xb9c9('0x3d')](_0x53f38d['query'],_0x4586b6[_0xb9c9('0x35')]));_0x109bc0=_['merge']({},_0x109bc0,_0x53f38d[_0xb9c9('0x42')]);return _0x8fad8f[_0xb9c9('0x4c')+_[_0xb9c9('0x5a')](_0x53f38d['query']['channel'][_0xb9c9('0x5b')]())+_0xb9c9('0x5c')](_0x109bc0);})[_0xb9c9('0x27')](respondWithResult(_0x6c3304,null))['catch'](handleError(_0x6c3304,null));};exports[_0xb9c9('0x5d')]=function(_0x31e800,_0x22b9e0,_0xec06a4){return db[_0xb9c9('0x2e')][_0xb9c9('0x54')]({'where':{'id':_0x31e800[_0xb9c9('0x47')]['id']}})[_0xb9c9('0x27')](function(_0x45b22d){if(_0x45b22d){if(!_0x31e800[_0xb9c9('0x4b')][_0xb9c9('0x55')]||!utils[_0xb9c9('0x56')](_0x31e800[_0xb9c9('0x4b')][_0xb9c9('0x55')])){throw new db[(_0xb9c9('0x57'))][(_0xb9c9('0x58'))](_0xb9c9('0x59'));}return _0x45b22d[_0xb9c9('0x5e')+_['capitalize'](_0x31e800[_0xb9c9('0x4b')][_0xb9c9('0x55')][_0xb9c9('0x5b')]())+_0xb9c9('0x5c')](_0x31e800[_0xb9c9('0x4b')][_0xb9c9('0x5f')]);}return null;})[_0xb9c9('0x27')](handleEntityNotFound(_0x22b9e0,null))[_0xb9c9('0x27')](respondWithStatusCode(_0x22b9e0,null))[_0xb9c9('0x46')](handleError(_0x22b9e0,null));};exports[_0xb9c9('0x60')]=function(_0x162ad0,_0x710489,_0x3f5029){return db[_0xb9c9('0x2e')][_0xb9c9('0x54')]({'where':{'id':_0x162ad0[_0xb9c9('0x47')]['id']}})[_0xb9c9('0x27')](function(_0x54ddb1){if(_0x54ddb1){if(!_0x162ad0[_0xb9c9('0x33')][_0xb9c9('0x55')]||!utils[_0xb9c9('0x56')](_0x162ad0[_0xb9c9('0x33')][_0xb9c9('0x55')])){throw new db[(_0xb9c9('0x57'))][(_0xb9c9('0x58'))](_0xb9c9('0x59'));}return _0x54ddb1[_0xb9c9('0x61')+_[_0xb9c9('0x5a')](_0x162ad0[_0xb9c9('0x33')]['channel'][_0xb9c9('0x5b')]())+_0xb9c9('0x5c')](_0x162ad0[_0xb9c9('0x33')][_0xb9c9('0x5f')]);}return null;})[_0xb9c9('0x27')](handleEntityNotFound(_0x710489,null))['then'](respondWithStatusCode(_0x710489,null))[_0xb9c9('0x46')](handleError(_0x710489,null));};exports[_0xb9c9('0x62')]=function(_0x2140bd,_0x584cb2,_0x2a003f){return db[_0xb9c9('0x2e')]['find']({'where':{'id':_0x2140bd['params']['id']}})[_0xb9c9('0x27')](handleEntityNotFound(_0x584cb2,null))['then'](function(_0x47c0c8){if(_0x47c0c8){var _0x443822=['Voice',_0xb9c9('0x63'),_0xb9c9('0x64'),_0xb9c9('0x65'),_0xb9c9('0x66'),_0xb9c9('0x67')];return BPromise[_0xb9c9('0x68')](_0x443822,function(_0x599b50){return _0x47c0c8[_0xb9c9('0x4c')+_0x599b50+_0xb9c9('0x5c')]({'attributes':['id','name']})['then'](function(_0x3cd19e){return BPromise[_0xb9c9('0x68')](_0x3cd19e,function(_0x3028c1){return _0x3028c1[_0xb9c9('0x62')](_0x2140bd[_0xb9c9('0x4b')]['ids'])[_0xb9c9('0x27')](function(){if(_0x599b50==='Voice'){return db[_0xb9c9('0x69')]['findAll']({'where':{'id':_0x2140bd[_0xb9c9('0x4b')][_0xb9c9('0x5f')]},'attributes':['id',_0xb9c9('0x2b'),_0xb9c9('0x6a'),_0xb9c9('0x6b'),'interface'],'raw':!![]})[_0xb9c9('0x27')](function(_0x41061e){return BPromise[_0xb9c9('0x68')](_[_0xb9c9('0x3e')](_0x41061e,{'online':0x1}),function(_0x27c367){return db[_0xb9c9('0x6c')][_0xb9c9('0x6d')]({'membername':_0x27c367[_0xb9c9('0x2b')],'UserId':_0x27c367['id'],'queue_name':_0x3028c1[_0xb9c9('0x2b')],'VoiceQueueId':_0x3028c1['id'],'interface':_[_0xb9c9('0x6e')](_0x27c367['interface'])?util[_0xb9c9('0x6f')](_0xb9c9('0x70'),_0x27c367[_0xb9c9('0x2b')]):_0x27c367[_0xb9c9('0x71')],'paused':_0x27c367[_0xb9c9('0x6b')]||![],'penalty':0x0});});});}});});})[_0xb9c9('0x27')](function(){return _0x47c0c8;});})[_0xb9c9('0x27')](function(){return _0x47c0c8;});}})[_0xb9c9('0x27')](function(_0x370f60){if(_0x370f60){return _0x370f60[_0xb9c9('0x62')](_0x2140bd[_0xb9c9('0x4b')][_0xb9c9('0x5f')],_[_0xb9c9('0x72')](_0x2140bd[_0xb9c9('0x4b')],[_0xb9c9('0x5f'),'id'])||{})['spread'](function(_0x13ab31){for(var _0x42b3bc=0x0;_0x42b3bc<_0x2140bd[_0xb9c9('0x4b')][_0xb9c9('0x5f')]['length'];_0x42b3bc+=0x1){socket[_0xb9c9('0x73')]('userTeam:save',{'UserId':_0x2140bd[_0xb9c9('0x4b')][_0xb9c9('0x5f')][_0x42b3bc],'TeamId':_0x2140bd[_0xb9c9('0x47')]['id']});}return _0x13ab31;});}})[_0xb9c9('0x27')](respondWithResult(_0x584cb2,null))[_0xb9c9('0x46')](handleError(_0x584cb2,null));};exports[_0xb9c9('0x74')]=function(_0x4546af,_0x9d6f95,_0x1d161c){return db[_0xb9c9('0x2e')][_0xb9c9('0x4f')]({'where':{'id':_0x4546af[_0xb9c9('0x47')]['id']}})[_0xb9c9('0x27')](handleEntityNotFound(_0x9d6f95,null))['then'](function(_0x343d16){if(_0x343d16){return BPromise[_0xb9c9('0x68')]([_0xb9c9('0x75'),_0xb9c9('0x76'),'mail',_0xb9c9('0x77'),_0xb9c9('0x78'),_0xb9c9('0x79')],function(_0x1afb48){return _0x343d16['get'+_[_0xb9c9('0x5a')](_0x1afb48)+_0xb9c9('0x5c')]({'attributes':['id',_0xb9c9('0x2b')]})[_0xb9c9('0x27')](function(_0xdfcae3){return BPromise[_0xb9c9('0x68')](_0xdfcae3,function(_0x5625e7){return _0x5625e7[_0xb9c9('0x74')](_0x4546af[_0xb9c9('0x33')]['ids'])[_0xb9c9('0x27')](function(){if(_0x1afb48===_0xb9c9('0x75')){return db[_0xb9c9('0x6c')][_0xb9c9('0x28')]({'where':{'VoiceQueueId':_0x5625e7['id'],'UserId':_0x4546af[_0xb9c9('0x33')][_0xb9c9('0x5f')]}});}});});})['then'](function(){return _0x343d16;});})[_0xb9c9('0x27')](function(){return _0x343d16;});}})[_0xb9c9('0x27')](function(_0x3b54ae){if(_0x3b54ae){return _0x3b54ae[_0xb9c9('0x74')](_0x4546af['query'][_0xb9c9('0x5f')])['then'](function(){if(_['isArray'](_0x4546af['query'][_0xb9c9('0x5f')])){for(var _0x14fe17=0x0;_0x14fe17<_0x4546af[_0xb9c9('0x33')][_0xb9c9('0x5f')]['length'];_0x14fe17+=0x1){socket[_0xb9c9('0x73')]('userTeam:remove',{'UserId':Number(_0x4546af['query'][_0xb9c9('0x5f')][_0x14fe17]),'TeamId':Number(_0x4546af['params']['id'])});}}else{socket[_0xb9c9('0x73')]('userTeam:remove',{'UserId':Number(_0x4546af['query'][_0xb9c9('0x5f')]),'TeamId':Number(_0x4546af['params']['id'])});}});}})['then'](respondWithStatusCode(_0x9d6f95,null))[_0xb9c9('0x46')](handleError(_0x9d6f95,null));};exports[_0xb9c9('0x7a')]=function(_0x61c75f,_0x4c4a61,_0x27d275){var _0x4fecc3={};var _0x11c97a={};var _0x463a26;var _0x446b28;return db[_0xb9c9('0x2e')][_0xb9c9('0x54')]({'where':{'id':_0x61c75f['params']['id']}})[_0xb9c9('0x27')](handleEntityNotFound(_0x4c4a61,null))['then'](function(_0x146f1d){if(_0x146f1d){_0x463a26=_0x146f1d;_0x11c97a[_0xb9c9('0x32')]=_[_0xb9c9('0x34')](db['User'][_0xb9c9('0x48')]);_0x11c97a[_0xb9c9('0x33')]=_[_0xb9c9('0x34')](_0x61c75f[_0xb9c9('0x33')]);_0x11c97a[_0xb9c9('0x35')]=_[_0xb9c9('0x49')](_0x11c97a[_0xb9c9('0x32')],_0x11c97a[_0xb9c9('0x33')]);_0x4fecc3[_0xb9c9('0x36')]=_[_0xb9c9('0x49')](_0x11c97a['model'],qs[_0xb9c9('0x37')](_0x61c75f[_0xb9c9('0x33')][_0xb9c9('0x37')]));_0x4fecc3[_0xb9c9('0x36')]=_0x4fecc3[_0xb9c9('0x36')]['length']?_0x4fecc3[_0xb9c9('0x36')]:_0x11c97a['model'];_0x4fecc3[_0xb9c9('0x3b')]=qs[_0xb9c9('0x3c')](_0x61c75f[_0xb9c9('0x33')]['sort']);_0x4fecc3[_0xb9c9('0x3f')]=qs[_0xb9c9('0x35')](_[_0xb9c9('0x3d')](_0x61c75f[_0xb9c9('0x33')],_0x11c97a['filters']));if(_0x61c75f[_0xb9c9('0x33')]['filter']){_0x4fecc3[_0xb9c9('0x3f')]=_['merge'](_0x4fecc3[_0xb9c9('0x3f')],{'$or':_[_0xb9c9('0x2d')](_0x4fecc3['attributes'],function(_0x3e42bd){var _0x3cb8de={};_0x3cb8de[_0x3e42bd]={'$like':'%'+_0x61c75f['query'][_0xb9c9('0x3e')]+'%'};return _0x3cb8de;})});}_0x4fecc3=_[_0xb9c9('0x41')]({},_0x4fecc3,_0x61c75f[_0xb9c9('0x42')]);return _0x463a26[_0xb9c9('0x7a')](_0x4fecc3);}})[_0xb9c9('0x27')](function(_0x4c7a6d){if(_0x4c7a6d){_0x446b28=_0x4c7a6d[_0xb9c9('0x38')];if(!_0x61c75f[_0xb9c9('0x33')]['hasOwnProperty'](_0xb9c9('0x3a'))){_0x4fecc3[_0xb9c9('0x20')]=qs[_0xb9c9('0x20')](_0x61c75f[_0xb9c9('0x33')]['limit']);_0x4fecc3[_0xb9c9('0x1f')]=qs['offset'](_0x61c75f[_0xb9c9('0x33')][_0xb9c9('0x1f')]);}return _0x463a26[_0xb9c9('0x7a')](_0x4fecc3);}})['then'](function(_0x48a112){if(_0x48a112){return _0x48a112?{'count':_0x446b28,'rows':_0x48a112}:null;}})[_0xb9c9('0x27')](respondWithResult(_0x4c4a61,null))['catch'](handleError(_0x4c4a61,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 635052f..5895eb0 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 _0xc8f5=['exports','events','../../mysqldb','Team','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x16972f,_0x24951d){var _0x3e2509=function(_0x52339a){while(--_0x52339a){_0x16972f['push'](_0x16972f['shift']());}};_0x3e2509(++_0x24951d);}(_0xc8f5,0x14b));var _0x5c8f=function(_0x476c6c,_0x434db8){_0x476c6c=_0x476c6c-0x0;var _0xbb94db=_0xc8f5[_0x476c6c];return _0xbb94db;};'use strict';var EventEmitter=require(_0x5c8f('0x0'));var Team=require(_0x5c8f('0x1'))['db'][_0x5c8f('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c8f('0x3'),'afterUpdate':_0x5c8f('0x4'),'afterDestroy':_0x5c8f('0x5')};function emitEvent(_0x4e54e8){return function(_0x32945f,_0x2f6837,_0x2b40c7){TeamEvents['emit'](_0x4e54e8+':'+_0x32945f['id'],_0x32945f);TeamEvents[_0x5c8f('0x6')](_0x4e54e8,_0x32945f);_0x2b40c7(null);};}for(var e in events){if(events[_0x5c8f('0x7')](e)){var event=events[e];Team[_0x5c8f('0x8')](e,emitEvent(event));}}module[_0x5c8f('0x9')]=TeamEvents; \ No newline at end of file +var _0x3168=['emit','hook','events','Team','update','remove'];(function(_0x1f56bd,_0x4d7e10){var _0x1796e6=function(_0x49969a){while(--_0x49969a){_0x1f56bd['push'](_0x1f56bd['shift']());}};_0x1796e6(++_0x4d7e10);}(_0x3168,0x92));var _0x8316=function(_0x130044,_0x475876){_0x130044=_0x130044-0x0;var _0x1528fa=_0x3168[_0x130044];return _0x1528fa;};'use strict';var EventEmitter=require(_0x8316('0x0'));var Team=require('../../mysqldb')['db'][_0x8316('0x1')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8316('0x2'),'afterDestroy':_0x8316('0x3')};function emitEvent(_0x4a2199){return function(_0x7b7e03,_0x44fd84,_0x2d1f0a){TeamEvents[_0x8316('0x4')](_0x4a2199+':'+_0x7b7e03['id'],_0x7b7e03);TeamEvents[_0x8316('0x4')](_0x4a2199,_0x7b7e03);_0x2d1f0a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x8316('0x5')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index b73398a..62fda11 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 _0xaa01=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d8bfc,_0x1bdf05){var _0x33853c=function(_0xcb8317){while(--_0xcb8317){_0x3d8bfc['push'](_0x3d8bfc['shift']());}};_0x33853c(++_0x1bdf05);}(_0xaa01,0x131));var _0x1aa0=function(_0x22b251,_0x2ee672){_0x22b251=_0x22b251-0x0;var _0x227eca=_0xaa01[_0x22b251];return _0x227eca;};'use strict';var _=require(_0x1aa0('0x0'));var util=require(_0x1aa0('0x1'));var logger=require(_0x1aa0('0x2'))(_0x1aa0('0x3'));var moment=require(_0x1aa0('0x4'));var BPromise=require(_0x1aa0('0x5'));var rp=require(_0x1aa0('0x6'));var fs=require('fs');var path=require(_0x1aa0('0x7'));var rimraf=require(_0x1aa0('0x8'));var config=require(_0x1aa0('0x9'));var attributes=require('./team.attributes');module[_0x1aa0('0xa')]=function(_0x14eb40,_0x22455a){return _0x14eb40[_0x1aa0('0xb')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8029=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./team.attributes','define','lodash'];(function(_0x1af6cf,_0x5312e4){var _0x12b093=function(_0x21b559){while(--_0x21b559){_0x1af6cf['push'](_0x1af6cf['shift']());}};_0x12b093(++_0x5312e4);}(_0x8029,0x167));var _0x9802=function(_0x1b5847,_0x541240){_0x1b5847=_0x1b5847-0x0;var _0x48d975=_0x8029[_0x1b5847];return _0x48d975;};'use strict';var _=require(_0x9802('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9802('0x1'));var moment=require(_0x9802('0x2'));var BPromise=require(_0x9802('0x3'));var rp=require(_0x9802('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9802('0x5'));var config=require(_0x9802('0x6'));var attributes=require(_0x9802('0x7'));module['exports']=function(_0x1d94a2,_0x21ccce){return _0x1d94a2[_0x9802('0x8')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 28b2515..9c3efe9 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 _0x2970=['http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','Team,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3d5701,_0x4c60ad){var _0x259f6c=function(_0x1630fc){while(--_0x1630fc){_0x3d5701['push'](_0x3d5701['shift']());}};_0x259f6c(++_0x4c60ad);}(_0x2970,0x151));var _0x0297=function(_0x16f026,_0x2baae7){_0x16f026=_0x16f026-0x0;var _0x380606=_0x2970[_0x16f026];return _0x380606;};'use strict';var _=require(_0x0297('0x0'));var util=require(_0x0297('0x1'));var moment=require('moment');var BPromise=require(_0x0297('0x2'));var rs=require(_0x0297('0x3'));var fs=require('fs');var Redis=require(_0x0297('0x4'));var db=require(_0x0297('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0297('0x6'))(_0x0297('0x7'));var config=require(_0x0297('0x8'));var jayson=require(_0x0297('0x9'));var client=jayson[_0x0297('0xa')][_0x0297('0xb')]({'port':0x232a});config[_0x0297('0xc')]=_[_0x0297('0xd')](config[_0x0297('0xc')],{'host':_0x0297('0xe'),'port':0x18eb});var socket=require(_0x0297('0xf'))(new Redis(config[_0x0297('0xc')]));require(_0x0297('0x10'))[_0x0297('0x11')](socket);function respondWithRpcPromise(_0x12a2b4,_0x5945f4,_0x15f60b){return new BPromise(function(_0x75d56e,_0x39524b){return client[_0x0297('0x12')](_0x12a2b4,_0x15f60b)[_0x0297('0x13')](function(_0x3c5546){logger[_0x0297('0x14')]('Team,\x20%s,\x20%s',_0x5945f4,_0x0297('0x15'));logger[_0x0297('0x16')](_0x0297('0x17'),_0x5945f4,_0x0297('0x15'),JSON[_0x0297('0x18')](_0x3c5546));if(_0x3c5546[_0x0297('0x19')]){if(_0x3c5546[_0x0297('0x19')]['code']===0x1f4){logger[_0x0297('0x19')]('Team,\x20%s,\x20%s',_0x5945f4,_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);return _0x39524b(_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);}logger[_0x0297('0x19')](_0x0297('0x1b'),_0x5945f4,_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);return _0x75d56e(_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);}else{logger[_0x0297('0x14')]('Team,\x20%s,\x20%s',_0x5945f4,_0x0297('0x15'));_0x75d56e(_0x3c5546[_0x0297('0x1c')][_0x0297('0x1a')]);}})['catch'](function(_0x6dea2b){logger[_0x0297('0x19')](_0x0297('0x1b'),_0x5945f4,_0x6dea2b);_0x39524b(_0x6dea2b);});});} \ No newline at end of file +var _0x22f6=['../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','bluebird','../../config/utils','../../config/logger','rpc'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x22f6,0x190));var _0x622f=function(_0x35b725,_0xe15e0){_0x35b725=_0x35b725-0x0;var _0x1f7a4f=_0x22f6[_0x35b725];return _0x1f7a4f;};'use strict';var _=require('lodash');var util=require(_0x622f('0x0'));var moment=require('moment');var BPromise=require(_0x622f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x622f('0x2'));var logger=require(_0x622f('0x3'))(_0x622f('0x4'));var config=require(_0x622f('0x5'));var jayson=require(_0x622f('0x6'));var client=jayson['client'][_0x622f('0x7')]({'port':0x232a});config[_0x622f('0x8')]=_[_0x622f('0x9')](config['redis'],{'host':_0x622f('0xa'),'port':0x18eb});var socket=require(_0x622f('0xb'))(new Redis(config[_0x622f('0x8')]));require(_0x622f('0xc'))[_0x622f('0xd')](socket);function respondWithRpcPromise(_0x4e1811,_0x4a3a94,_0x32af3a){return new BPromise(function(_0x137de9,_0xa1ef19){return client[_0x622f('0xe')](_0x4e1811,_0x32af3a)[_0x622f('0xf')](function(_0x458d66){logger['info'](_0x622f('0x10'),_0x4a3a94,'request\x20sent');logger[_0x622f('0x11')](_0x622f('0x12'),_0x4a3a94,_0x622f('0x13'),JSON[_0x622f('0x14')](_0x458d66));if(_0x458d66['error']){if(_0x458d66[_0x622f('0x15')][_0x622f('0x16')]===0x1f4){logger[_0x622f('0x15')](_0x622f('0x10'),_0x4a3a94,_0x458d66[_0x622f('0x15')][_0x622f('0x17')]);return _0xa1ef19(_0x458d66[_0x622f('0x15')][_0x622f('0x17')]);}logger[_0x622f('0x15')]('Team,\x20%s,\x20%s',_0x4a3a94,_0x458d66[_0x622f('0x15')]['message']);return _0x137de9(_0x458d66['error']['message']);}else{logger[_0x622f('0x18')](_0x622f('0x10'),_0x4a3a94,'request\x20sent');_0x137de9(_0x458d66[_0x622f('0x19')]['message']);}})[_0x622f('0x1a')](function(_0x980377){logger['error'](_0x622f('0x10'),_0x4a3a94,_0x980377);_0xa1ef19(_0x980377);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 8803ada..6c93dde 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 _0x1fcc=['save','update','emit','register','length','team:','./team.events'];(function(_0x3cbde6,_0x162a28){var _0x16a559=function(_0x461c8d){while(--_0x461c8d){_0x3cbde6['push'](_0x3cbde6['shift']());}};_0x16a559(++_0x162a28);}(_0x1fcc,0x125));var _0xc1fc=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x1fcc[_0x5c6299];return _0x23b564;};'use strict';var TeamEvents=require(_0xc1fc('0x0'));var events=[_0xc1fc('0x1'),'remove',_0xc1fc('0x2')];function createListener(_0x1aa3f8,_0xb73e0a){return function(_0x3b3add){_0xb73e0a[_0xc1fc('0x3')](_0x1aa3f8,_0x3b3add);};}function removeListener(_0x2e6a9b,_0xf9bb59){return function(){TeamEvents['removeListener'](_0x2e6a9b,_0xf9bb59);};}exports[_0xc1fc('0x4')]=function(_0x2fe1fc){for(var _0x26899d=0x0,_0x4df2ae=events[_0xc1fc('0x5')];_0x26899d<_0x4df2ae;_0x26899d++){var _0x1f847d=events[_0x26899d];var _0x5ae7b3=createListener(_0xc1fc('0x6')+_0x1f847d,_0x2fe1fc);TeamEvents['on'](_0x1f847d,_0x5ae7b3);}}; \ No newline at end of file +var _0xbd36=['register','length','team:','./team.events','save','remove','removeListener'];(function(_0x2d72ab,_0x5a97f5){var _0x256423=function(_0x94ed46){while(--_0x94ed46){_0x2d72ab['push'](_0x2d72ab['shift']());}};_0x256423(++_0x5a97f5);}(_0xbd36,0x65));var _0x6bd3=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xbd36[_0x1035c1];return _0x308d67;};'use strict';var TeamEvents=require(_0x6bd3('0x0'));var events=[_0x6bd3('0x1'),_0x6bd3('0x2'),'update'];function createListener(_0x4dc784,_0x38f353){return function(_0x64cdcc){_0x38f353['emit'](_0x4dc784,_0x64cdcc);};}function removeListener(_0x3b2956,_0xa0380){return function(){TeamEvents[_0x6bd3('0x3')](_0x3b2956,_0xa0380);};}exports[_0x6bd3('0x4')]=function(_0x4f9f7e){for(var _0x193bb4=0x0,_0x173035=events[_0x6bd3('0x5')];_0x193bb4<_0x173035;_0x193bb4++){var _0x1b4148=events[_0x193bb4];var _0x1b2946=createListener(_0x6bd3('0x6')+_0x1b4148,_0x4f9f7e);TeamEvents['on'](_0x1b4148,_0x1b2946);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 34fdc59..45eabb8 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 _0x152b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','put','/:id','update','delete','destroy','multer','util'];(function(_0x2473a5,_0x1778d1){var _0x36c5af=function(_0x29c4a4){while(--_0x29c4a4){_0x2473a5['push'](_0x2473a5['shift']());}};_0x36c5af(++_0x1778d1);}(_0x152b,0x130));var _0xb152=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0x152b[_0x5a187b];return _0x14d601;};'use strict';var multer=require(_0xb152('0x0'));var util=require(_0xb152('0x1'));var path=require('path');var timeout=require(_0xb152('0x2'));var express=require(_0xb152('0x3'));var router=express[_0xb152('0x4')]();var auth=require(_0xb152('0x5'));var interaction=require(_0xb152('0x6'));var config=require(_0xb152('0x7'));var controller=require('./template.controller');router[_0xb152('0x8')]('/',auth[_0xb152('0x9')](),controller[_0xb152('0xa')]);router[_0xb152('0x8')]('/:id',auth[_0xb152('0x9')](),controller[_0xb152('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb152('0xc')](_0xb152('0xd'),auth[_0xb152('0x9')](),controller[_0xb152('0xe')]);router[_0xb152('0xf')](_0xb152('0xd'),auth[_0xb152('0x9')](),controller[_0xb152('0x10')]);module['exports']=router; \ No newline at end of file +var _0x055a=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x055a,0xf1));var _0xa055=function(_0x83500f,_0x1b1f13){_0x83500f=_0x83500f-0x0;var _0x5c1481=_0x055a[_0x83500f];return _0x5c1481;};'use strict';var multer=require('multer');var util=require(_0xa055('0x0'));var path=require(_0xa055('0x1'));var timeout=require(_0xa055('0x2'));var express=require(_0xa055('0x3'));var router=express[_0xa055('0x4')]();var auth=require(_0xa055('0x5'));var interaction=require(_0xa055('0x6'));var config=require(_0xa055('0x7'));var controller=require(_0xa055('0x8'));router[_0xa055('0x9')]('/',auth['isAuthenticated'](),controller[_0xa055('0xa')]);router[_0xa055('0x9')](_0xa055('0xb'),auth[_0xa055('0xc')](),controller[_0xa055('0xd')]);router[_0xa055('0xe')]('/',auth[_0xa055('0xc')](),controller[_0xa055('0xf')]);router[_0xa055('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa055('0x11')]);router[_0xa055('0x12')](_0xa055('0xb'),auth[_0xa055('0xc')](),controller[_0xa055('0x13')]);module[_0xa055('0x14')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 5722bad..7bf883d 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 _0x1856=['STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1856,0x185));var _0x6185=function(_0x346e9f,_0x30947a){_0x346e9f=_0x346e9f-0x0;var _0x36703d=_0x1856[_0x346e9f];return _0x36703d;};'use strict';var Sequelize=require(_0x6185('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6185('0x1')]},'html':{'type':Sequelize[_0x6185('0x2')]}}; \ No newline at end of file +var _0x6c00=['TEXT','sequelize','exports','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6c00,0x1a9));var _0x06c0=function(_0x39780c,_0x5782c9){_0x39780c=_0x39780c-0x0;var _0x53c19b=_0x6c00[_0x39780c];return _0x53c19b;};'use strict';var Sequelize=require(_0x06c0('0x0'));module[_0x06c0('0x1')]={'name':{'type':Sequelize[_0x06c0('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x06c0('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index ea5f35c..5447ef4 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 _0xd9ca=['Template','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','end','stack','name','send','index','map'];(function(_0x1744f4,_0x34e39){var _0x508288=function(_0x35ad3d){while(--_0x35ad3d){_0x1744f4['push'](_0x1744f4['shift']());}};_0x508288(++_0x34e39);}(_0xd9ca,0xc0));var _0xad9c=function(_0x35f7db,_0x290096){_0x35f7db=_0x35f7db-0x0;var _0x50006a=_0xd9ca[_0x35f7db];return _0x50006a;};'use strict';var pdf=require(_0xad9c('0x0'));var emlformat=require(_0xad9c('0x1'));var rimraf=require(_0xad9c('0x2'));var zipdir=require(_0xad9c('0x3'));var jsonpatch=require(_0xad9c('0x4'));var rp=require(_0xad9c('0x5'));var moment=require('moment');var BPromise=require(_0xad9c('0x6'));var Mustache=require(_0xad9c('0x7'));var util=require(_0xad9c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xad9c('0x9'));var ejs=require(_0xad9c('0xa'));var fs=require('fs');var _=require(_0xad9c('0xb'));var squel=require(_0xad9c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xad9c('0xd'));var toCsv=require(_0xad9c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad9c('0xe'));var authService=require(_0xad9c('0xf'));var qs=require(_0xad9c('0x10'));var as=require(_0xad9c('0x11'));var hardwareService=require(_0xad9c('0x12'));var logger=require('../../config/logger')(_0xad9c('0x13'));var utils=require('../../config/utils');var config=require(_0xad9c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56e4ab,_0x83e140){_0x83e140=_0x83e140||0xcc;return function(_0x429572){if(_0x429572){return _0x56e4ab[_0xad9c('0x15')](_0x83e140);}return _0x56e4ab['status'](_0x83e140)['end']();};}function respondWithResult(_0x1c5f53,_0x4ffd1e){_0x4ffd1e=_0x4ffd1e||0xc8;return function(_0x4417fc){if(_0x4417fc){return _0x1c5f53[_0xad9c('0x16')](_0x4ffd1e)[_0xad9c('0x17')](_0x4417fc);}};}function respondWithFilteredResult(_0x118ec0,_0x577e0c){return function(_0x22d731){if(_0x22d731){var _0x50d398=_0x22d731['count'],_0x151fe9=_0x577e0c[_0xad9c('0x18')],_0x65bdb7=_0x577e0c['offset']+_0x577e0c[_0xad9c('0x19')],_0x1bc954;if(_0x65bdb7>=_0x50d398){_0x65bdb7=_0x50d398;_0x1bc954=0xc8;}else{_0x1bc954=0xce;}_0x118ec0['status'](_0x1bc954);return _0x118ec0[_0xad9c('0x1a')](_0xad9c('0x1b'),_0x151fe9+'-'+_0x65bdb7+'/'+_0x50d398)[_0xad9c('0x17')](_0x22d731);}return null;};}function patchUpdates(_0x1ff1a4){return function(_0x3bd408){try{jsonpatch[_0xad9c('0x1c')](_0x3bd408,_0x1ff1a4,!![]);}catch(_0x10b2bc){return BPromise[_0xad9c('0x1d')](_0x10b2bc);}return _0x3bd408['save']();};}function saveUpdates(_0x2bab71,_0x50a09d){return function(_0x21a878){if(_0x21a878){return _0x21a878[_0xad9c('0x1e')](_0x2bab71)[_0xad9c('0x1f')](function(_0x12edfc){return _0x12edfc;});}return null;};}function removeEntity(_0x29f550,_0x44e3b1){return function(_0x2c3e7f){if(_0x2c3e7f){return _0x2c3e7f[_0xad9c('0x20')]()[_0xad9c('0x1f')](function(){var _0x41011b=_0x2c3e7f[_0xad9c('0x21')]({'plain':!![]});var _0x15531d=_0xad9c('0x22');return db[_0xad9c('0x23')][_0xad9c('0x20')]({'where':{'type':_0x15531d,'resourceId':_0x41011b['id']}})[_0xad9c('0x1f')](function(){return _0x2c3e7f;});})[_0xad9c('0x1f')](function(){_0x29f550[_0xad9c('0x16')](0xcc)[_0xad9c('0x24')]();});}};}function handleEntityNotFound(_0x282c05,_0x6bf06d){return function(_0x15ab11){if(!_0x15ab11){_0x282c05[_0xad9c('0x15')](0x194);}return _0x15ab11;};}function handleError(_0x432d61,_0x225a20){_0x225a20=_0x225a20||0x1f4;return function(_0x140ab8){logger['error'](_0x140ab8[_0xad9c('0x25')]);if(_0x140ab8[_0xad9c('0x26')]){delete _0x140ab8[_0xad9c('0x26')];}_0x432d61['status'](_0x225a20)[_0xad9c('0x27')](_0x140ab8);};}exports[_0xad9c('0x28')]=function(_0x388199,_0xe43291){var _0x4d2005={},_0x5cb2f3={},_0x3f0810={'count':0x0,'rows':[]};var _0x492e41=_[_0xad9c('0x29')](db[_0xad9c('0x2a')]['rawAttributes'],function(_0xf4ab43){return{'name':_0xf4ab43[_0xad9c('0x2b')],'type':_0xf4ab43[_0xad9c('0x2c')][_0xad9c('0x2d')]};});_0x5cb2f3[_0xad9c('0x2e')]=_[_0xad9c('0x29')](_0x492e41,_0xad9c('0x26'));_0x5cb2f3[_0xad9c('0x2f')]=_[_0xad9c('0x30')](_0x388199['query']);_0x5cb2f3['filters']=_[_0xad9c('0x31')](_0x5cb2f3[_0xad9c('0x2e')],_0x5cb2f3[_0xad9c('0x2f')]);_0x4d2005['attributes']=_['intersection'](_0x5cb2f3['model'],qs[_0xad9c('0x32')](_0x388199[_0xad9c('0x2f')][_0xad9c('0x32')]));_0x4d2005[_0xad9c('0x33')]=_0x4d2005['attributes'][_0xad9c('0x34')]?_0x4d2005[_0xad9c('0x33')]:_0x5cb2f3[_0xad9c('0x2e')];if(!_0x388199[_0xad9c('0x2f')][_0xad9c('0x35')](_0xad9c('0x36'))){_0x4d2005['limit']=qs[_0xad9c('0x19')](_0x388199['query'][_0xad9c('0x19')]);_0x4d2005[_0xad9c('0x18')]=qs[_0xad9c('0x18')](_0x388199[_0xad9c('0x2f')][_0xad9c('0x18')]);}_0x4d2005[_0xad9c('0x37')]=qs[_0xad9c('0x38')](_0x388199['query'][_0xad9c('0x38')]);_0x4d2005[_0xad9c('0x39')]=qs[_0xad9c('0x3a')](_['pick'](_0x388199[_0xad9c('0x2f')],_0x5cb2f3[_0xad9c('0x3a')]));if(_0x388199[_0xad9c('0x2f')]['filter']){_0x4d2005['where']=_['merge'](_0x4d2005[_0xad9c('0x39')],{'$or':_[_0xad9c('0x29')](_0x492e41,function(_0x45da95){if(_0x45da95[_0xad9c('0x2c')]!=='VIRTUAL'){var _0x260b94={};_0x260b94[_0x45da95[_0xad9c('0x26')]]={'$like':'%'+_0x388199['query'][_0xad9c('0x3b')]+'%'};return _0x260b94;}})});}_0x4d2005=_[_0xad9c('0x3c')]({},_0x4d2005,_0x388199[_0xad9c('0x3d')]);var _0x1806de={'where':_0x4d2005[_0xad9c('0x39')]};return db[_0xad9c('0x2a')][_0xad9c('0x3e')](_0x1806de)[_0xad9c('0x1f')](function(_0x587131){_0x3f0810[_0xad9c('0x3e')]=_0x587131;if(_0x388199[_0xad9c('0x2f')][_0xad9c('0x3f')]){_0x4d2005[_0xad9c('0x40')]=[{'all':!![]}];}return db[_0xad9c('0x2a')][_0xad9c('0x41')](_0x4d2005);})[_0xad9c('0x1f')](function(_0x13b599){_0x3f0810[_0xad9c('0x42')]=_0x13b599;return _0x3f0810;})[_0xad9c('0x1f')](respondWithFilteredResult(_0xe43291,_0x4d2005))[_0xad9c('0x43')](handleError(_0xe43291,null));};exports['show']=function(_0x3f67a6,_0x23ae14){var _0x5419f4={'raw':!![],'where':{'id':_0x3f67a6[_0xad9c('0x44')]['id']}},_0x5c35c6={};_0x5c35c6[_0xad9c('0x2e')]=_[_0xad9c('0x30')](db[_0xad9c('0x2a')][_0xad9c('0x45')]);_0x5c35c6[_0xad9c('0x2f')]=_[_0xad9c('0x30')](_0x3f67a6[_0xad9c('0x2f')]);_0x5c35c6['filters']=_[_0xad9c('0x31')](_0x5c35c6['model'],_0x5c35c6[_0xad9c('0x2f')]);_0x5419f4['attributes']=_[_0xad9c('0x31')](_0x5c35c6['model'],qs['fields'](_0x3f67a6['query'][_0xad9c('0x32')]));_0x5419f4[_0xad9c('0x33')]=_0x5419f4[_0xad9c('0x33')][_0xad9c('0x34')]?_0x5419f4[_0xad9c('0x33')]:_0x5c35c6[_0xad9c('0x2e')];if(_0x3f67a6[_0xad9c('0x2f')]['includeAll']){_0x5419f4['include']=[{'all':!![]}];}_0x5419f4=_[_0xad9c('0x3c')]({},_0x5419f4,_0x3f67a6[_0xad9c('0x3d')]);return db[_0xad9c('0x2a')][_0xad9c('0x46')](_0x5419f4)[_0xad9c('0x1f')](handleEntityNotFound(_0x23ae14,null))[_0xad9c('0x1f')](respondWithResult(_0x23ae14,null))[_0xad9c('0x43')](handleError(_0x23ae14,null));};exports['create']=function(_0x4b1cb9,_0x2966ae){return db[_0xad9c('0x2a')][_0xad9c('0x47')](_0x4b1cb9['body'],{})[_0xad9c('0x1f')](function(_0x1b9e67){var _0xe9a8c2=_0x4b1cb9[_0xad9c('0x48')][_0xad9c('0x21')]({'plain':!![]});if(!_0xe9a8c2)throw new Error(_0xad9c('0x49'));if(_0xe9a8c2['role']===_0xad9c('0x48')){var _0x5691b1=_0x1b9e67[_0xad9c('0x21')]({'plain':!![]});var _0x2e16ae=_0xad9c('0x22');return db[_0xad9c('0x4a')][_0xad9c('0x46')]({'where':{'name':_0x2e16ae,'userProfileId':_0xe9a8c2['userProfileId']},'raw':!![]})[_0xad9c('0x1f')](function(_0x5a3b5b){if(_0x5a3b5b&&_0x5a3b5b['autoAssociation']===0x0){return db[_0xad9c('0x23')][_0xad9c('0x47')]({'name':_0x5691b1[_0xad9c('0x26')],'resourceId':_0x5691b1['id'],'type':_0x5a3b5b['name'],'sectionId':_0x5a3b5b['id']},{})['then'](function(){return _0x1b9e67;});}else{return _0x1b9e67;}})[_0xad9c('0x43')](function(_0x53b02c){logger[_0xad9c('0x4b')](_0xad9c('0x4c'),_0x53b02c);throw _0x53b02c;});}return _0x1b9e67;})[_0xad9c('0x1f')](respondWithResult(_0x2966ae,0xc9))['catch'](handleError(_0x2966ae,null));};exports[_0xad9c('0x1e')]=function(_0x9683e7,_0x260941){if(_0x9683e7['body']['id']){delete _0x9683e7['body']['id'];}return db[_0xad9c('0x2a')][_0xad9c('0x46')]({'where':{'id':_0x9683e7[_0xad9c('0x44')]['id']}})[_0xad9c('0x1f')](handleEntityNotFound(_0x260941,null))[_0xad9c('0x1f')](saveUpdates(_0x9683e7[_0xad9c('0x4d')],null))[_0xad9c('0x1f')](respondWithResult(_0x260941,null))[_0xad9c('0x43')](handleError(_0x260941,null));};exports['destroy']=function(_0x32b742,_0x36fe8a){return db[_0xad9c('0x2a')]['find']({'where':{'id':_0x32b742[_0xad9c('0x44')]['id']}})[_0xad9c('0x1f')](handleEntityNotFound(_0x36fe8a,null))['then'](removeEntity(_0x36fe8a,null))[_0xad9c('0x43')](handleError(_0x36fe8a,null));}; \ No newline at end of file +var _0x6e0f=['ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Template','include','findAll','rows','catch','show','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv'];(function(_0x58ec1e,_0x6974ce){var _0x28011d=function(_0x10b474){while(--_0x10b474){_0x58ec1e['push'](_0x58ec1e['shift']());}};_0x28011d(++_0x6974ce);}(_0x6e0f,0x150));var _0xf6e0=function(_0x52aec5,_0x49e60d){_0x52aec5=_0x52aec5-0x0;var _0x4c23dd=_0x6e0f[_0x52aec5];return _0x4c23dd;};'use strict';var pdf=require(_0xf6e0('0x0'));var emlformat=require(_0xf6e0('0x1'));var rimraf=require(_0xf6e0('0x2'));var zipdir=require(_0xf6e0('0x3'));var jsonpatch=require(_0xf6e0('0x4'));var rp=require(_0xf6e0('0x5'));var moment=require(_0xf6e0('0x6'));var BPromise=require(_0xf6e0('0x7'));var Mustache=require(_0xf6e0('0x8'));var util=require(_0xf6e0('0x9'));var path=require(_0xf6e0('0xa'));var sox=require('sox');var csv=require(_0xf6e0('0xb'));var ejs=require(_0xf6e0('0xc'));var fs=require('fs');var _=require(_0xf6e0('0xd'));var squel=require(_0xf6e0('0xe'));var crypto=require(_0xf6e0('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6e0('0xb'));var querystring=require('querystring');var Papa=require(_0xf6e0('0x10'));var Redis=require(_0xf6e0('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf6e0('0x12'));var as=require(_0xf6e0('0x13'));var hardwareService=require(_0xf6e0('0x14'));var logger=require('../../config/logger')(_0xf6e0('0x15'));var utils=require(_0xf6e0('0x16'));var config=require(_0xf6e0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c080f,_0x2b9bfd){_0x2b9bfd=_0x2b9bfd||0xcc;return function(_0x2eee8c){if(_0x2eee8c){return _0x5c080f[_0xf6e0('0x18')](_0x2b9bfd);}return _0x5c080f[_0xf6e0('0x19')](_0x2b9bfd)[_0xf6e0('0x1a')]();};}function respondWithResult(_0x351960,_0x427762){_0x427762=_0x427762||0xc8;return function(_0x42b159){if(_0x42b159){return _0x351960[_0xf6e0('0x19')](_0x427762)[_0xf6e0('0x1b')](_0x42b159);}};}function respondWithFilteredResult(_0x17fc33,_0x52f961){return function(_0x4b7d98){if(_0x4b7d98){var _0xe944b2=_0x4b7d98[_0xf6e0('0x1c')],_0x214e78=_0x52f961['offset'],_0x56644e=_0x52f961[_0xf6e0('0x1d')]+_0x52f961[_0xf6e0('0x1e')],_0x4bc783;if(_0x56644e>=_0xe944b2){_0x56644e=_0xe944b2;_0x4bc783=0xc8;}else{_0x4bc783=0xce;}_0x17fc33[_0xf6e0('0x19')](_0x4bc783);return _0x17fc33[_0xf6e0('0x1f')](_0xf6e0('0x20'),_0x214e78+'-'+_0x56644e+'/'+_0xe944b2)[_0xf6e0('0x1b')](_0x4b7d98);}return null;};}function patchUpdates(_0x1fe41d){return function(_0x5a49e7){try{jsonpatch[_0xf6e0('0x21')](_0x5a49e7,_0x1fe41d,!![]);}catch(_0x911597){return BPromise[_0xf6e0('0x22')](_0x911597);}return _0x5a49e7[_0xf6e0('0x23')]();};}function saveUpdates(_0x464590,_0x4d3c1f){return function(_0x6dd79d){if(_0x6dd79d){return _0x6dd79d[_0xf6e0('0x24')](_0x464590)[_0xf6e0('0x25')](function(_0x39a18e){return _0x39a18e;});}return null;};}function removeEntity(_0x4cc424,_0x528e18){return function(_0x2125ff){if(_0x2125ff){return _0x2125ff[_0xf6e0('0x26')]()[_0xf6e0('0x25')](function(){var _0x371d9c=_0x2125ff[_0xf6e0('0x27')]({'plain':!![]});var _0x202059='Templates';return db[_0xf6e0('0x28')][_0xf6e0('0x26')]({'where':{'type':_0x202059,'resourceId':_0x371d9c['id']}})[_0xf6e0('0x25')](function(){return _0x2125ff;});})[_0xf6e0('0x25')](function(){_0x4cc424[_0xf6e0('0x19')](0xcc)[_0xf6e0('0x1a')]();});}};}function handleEntityNotFound(_0x30df84,_0x142372){return function(_0x310444){if(!_0x310444){_0x30df84[_0xf6e0('0x18')](0x194);}return _0x310444;};}function handleError(_0x51921f,_0x406803){_0x406803=_0x406803||0x1f4;return function(_0x12b6d2){logger[_0xf6e0('0x29')](_0x12b6d2[_0xf6e0('0x2a')]);if(_0x12b6d2[_0xf6e0('0x2b')]){delete _0x12b6d2[_0xf6e0('0x2b')];}_0x51921f['status'](_0x406803)[_0xf6e0('0x2c')](_0x12b6d2);};}exports[_0xf6e0('0x2d')]=function(_0x40bb42,_0x24c10b){var _0x87a96e={},_0x5b8b04={},_0x421977={'count':0x0,'rows':[]};var _0x43363f=_[_0xf6e0('0x2e')](db['Template'][_0xf6e0('0x2f')],function(_0x396cde){return{'name':_0x396cde[_0xf6e0('0x30')],'type':_0x396cde[_0xf6e0('0x31')][_0xf6e0('0x32')]};});_0x5b8b04['model']=_['map'](_0x43363f,_0xf6e0('0x2b'));_0x5b8b04['query']=_[_0xf6e0('0x33')](_0x40bb42[_0xf6e0('0x34')]);_0x5b8b04[_0xf6e0('0x35')]=_[_0xf6e0('0x36')](_0x5b8b04[_0xf6e0('0x37')],_0x5b8b04['query']);_0x87a96e[_0xf6e0('0x38')]=_[_0xf6e0('0x36')](_0x5b8b04['model'],qs[_0xf6e0('0x39')](_0x40bb42[_0xf6e0('0x34')]['fields']));_0x87a96e['attributes']=_0x87a96e[_0xf6e0('0x38')]['length']?_0x87a96e[_0xf6e0('0x38')]:_0x5b8b04[_0xf6e0('0x37')];if(!_0x40bb42['query'][_0xf6e0('0x3a')](_0xf6e0('0x3b'))){_0x87a96e[_0xf6e0('0x1e')]=qs[_0xf6e0('0x1e')](_0x40bb42[_0xf6e0('0x34')][_0xf6e0('0x1e')]);_0x87a96e[_0xf6e0('0x1d')]=qs[_0xf6e0('0x1d')](_0x40bb42[_0xf6e0('0x34')][_0xf6e0('0x1d')]);}_0x87a96e[_0xf6e0('0x3c')]=qs[_0xf6e0('0x3d')](_0x40bb42[_0xf6e0('0x34')][_0xf6e0('0x3d')]);_0x87a96e[_0xf6e0('0x3e')]=qs[_0xf6e0('0x35')](_[_0xf6e0('0x3f')](_0x40bb42[_0xf6e0('0x34')],_0x5b8b04['filters']));if(_0x40bb42[_0xf6e0('0x34')]['filter']){_0x87a96e[_0xf6e0('0x3e')]=_[_0xf6e0('0x40')](_0x87a96e[_0xf6e0('0x3e')],{'$or':_[_0xf6e0('0x2e')](_0x43363f,function(_0x4a1ca0){if(_0x4a1ca0[_0xf6e0('0x31')]!==_0xf6e0('0x41')){var _0xb36fde={};_0xb36fde[_0x4a1ca0['name']]={'$like':'%'+_0x40bb42[_0xf6e0('0x34')][_0xf6e0('0x42')]+'%'};return _0xb36fde;}})});}_0x87a96e=_[_0xf6e0('0x40')]({},_0x87a96e,_0x40bb42[_0xf6e0('0x43')]);var _0x22c786={'where':_0x87a96e['where']};return db[_0xf6e0('0x44')][_0xf6e0('0x1c')](_0x22c786)[_0xf6e0('0x25')](function(_0x4c55f4){_0x421977['count']=_0x4c55f4;if(_0x40bb42[_0xf6e0('0x34')]['includeAll']){_0x87a96e[_0xf6e0('0x45')]=[{'all':!![]}];}return db[_0xf6e0('0x44')][_0xf6e0('0x46')](_0x87a96e);})[_0xf6e0('0x25')](function(_0x1799f0){_0x421977[_0xf6e0('0x47')]=_0x1799f0;return _0x421977;})[_0xf6e0('0x25')](respondWithFilteredResult(_0x24c10b,_0x87a96e))[_0xf6e0('0x48')](handleError(_0x24c10b,null));};exports[_0xf6e0('0x49')]=function(_0x39a090,_0x525647){var _0x455fe8={'raw':!![],'where':{'id':_0x39a090['params']['id']}},_0x572433={};_0x572433['model']=_[_0xf6e0('0x33')](db[_0xf6e0('0x44')][_0xf6e0('0x2f')]);_0x572433[_0xf6e0('0x34')]=_[_0xf6e0('0x33')](_0x39a090[_0xf6e0('0x34')]);_0x572433[_0xf6e0('0x35')]=_[_0xf6e0('0x36')](_0x572433[_0xf6e0('0x37')],_0x572433[_0xf6e0('0x34')]);_0x455fe8[_0xf6e0('0x38')]=_[_0xf6e0('0x36')](_0x572433[_0xf6e0('0x37')],qs['fields'](_0x39a090[_0xf6e0('0x34')][_0xf6e0('0x39')]));_0x455fe8[_0xf6e0('0x38')]=_0x455fe8[_0xf6e0('0x38')][_0xf6e0('0x4a')]?_0x455fe8[_0xf6e0('0x38')]:_0x572433[_0xf6e0('0x37')];if(_0x39a090[_0xf6e0('0x34')][_0xf6e0('0x4b')]){_0x455fe8[_0xf6e0('0x45')]=[{'all':!![]}];}_0x455fe8=_[_0xf6e0('0x40')]({},_0x455fe8,_0x39a090[_0xf6e0('0x43')]);return db[_0xf6e0('0x44')][_0xf6e0('0x4c')](_0x455fe8)[_0xf6e0('0x25')](handleEntityNotFound(_0x525647,null))[_0xf6e0('0x25')](respondWithResult(_0x525647,null))[_0xf6e0('0x48')](handleError(_0x525647,null));};exports['create']=function(_0x23cb8c,_0xa4eb34){return db[_0xf6e0('0x44')][_0xf6e0('0x4d')](_0x23cb8c[_0xf6e0('0x4e')],{})[_0xf6e0('0x25')](function(_0x5cdc10){var _0x4e9b03=_0x23cb8c[_0xf6e0('0x4f')][_0xf6e0('0x27')]({'plain':!![]});if(!_0x4e9b03)throw new Error(_0xf6e0('0x50'));if(_0x4e9b03[_0xf6e0('0x51')]===_0xf6e0('0x4f')){var _0x7443af=_0x5cdc10[_0xf6e0('0x27')]({'plain':!![]});var _0x20b108='Templates';return db[_0xf6e0('0x52')][_0xf6e0('0x4c')]({'where':{'name':_0x20b108,'userProfileId':_0x4e9b03[_0xf6e0('0x53')]},'raw':!![]})['then'](function(_0x3345f9){if(_0x3345f9&&_0x3345f9[_0xf6e0('0x54')]===0x0){return db[_0xf6e0('0x28')][_0xf6e0('0x4d')]({'name':_0x7443af[_0xf6e0('0x2b')],'resourceId':_0x7443af['id'],'type':_0x3345f9[_0xf6e0('0x2b')],'sectionId':_0x3345f9['id']},{})['then'](function(){return _0x5cdc10;});}else{return _0x5cdc10;}})['catch'](function(_0x7ffc0f){logger[_0xf6e0('0x29')](_0xf6e0('0x55'),_0x7ffc0f);throw _0x7ffc0f;});}return _0x5cdc10;})[_0xf6e0('0x25')](respondWithResult(_0xa4eb34,0xc9))[_0xf6e0('0x48')](handleError(_0xa4eb34,null));};exports[_0xf6e0('0x24')]=function(_0x166c18,_0x206162){if(_0x166c18[_0xf6e0('0x4e')]['id']){delete _0x166c18[_0xf6e0('0x4e')]['id'];}return db[_0xf6e0('0x44')][_0xf6e0('0x4c')]({'where':{'id':_0x166c18[_0xf6e0('0x56')]['id']}})['then'](handleEntityNotFound(_0x206162,null))['then'](saveUpdates(_0x166c18[_0xf6e0('0x4e')],null))['then'](respondWithResult(_0x206162,null))['catch'](handleError(_0x206162,null));};exports[_0xf6e0('0x26')]=function(_0x427da7,_0x268d1f){return db['Template'][_0xf6e0('0x4c')]({'where':{'id':_0x427da7[_0xf6e0('0x56')]['id']}})[_0xf6e0('0x25')](handleEntityNotFound(_0x268d1f,null))[_0xf6e0('0x25')](removeEntity(_0x268d1f,null))[_0xf6e0('0x48')](handleError(_0x268d1f,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 64dc35a..a7fcb3c 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 _0xb3f8=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','lodash','util','api','moment','bluebird'];(function(_0x239eaf,_0x1968b4){var _0x8863f7=function(_0x1b34d7){while(--_0x1b34d7){_0x239eaf['push'](_0x239eaf['shift']());}};_0x8863f7(++_0x1968b4);}(_0xb3f8,0x14d));var _0x8b3f=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xb3f8[_0x18fb16];return _0x147b0d;};'use strict';var _=require(_0x8b3f('0x0'));var util=require(_0x8b3f('0x1'));var logger=require('../../config/logger')(_0x8b3f('0x2'));var moment=require(_0x8b3f('0x3'));var BPromise=require(_0x8b3f('0x4'));var rp=require(_0x8b3f('0x5'));var fs=require('fs');var path=require(_0x8b3f('0x6'));var rimraf=require(_0x8b3f('0x7'));var config=require(_0x8b3f('0x8'));var attributes=require(_0x8b3f('0x9'));module[_0x8b3f('0xa')]=function(_0x576df0,_0x2f3443){return _0x576df0[_0x8b3f('0xb')](_0x8b3f('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fbc=['../../config/logger','api','bluebird','path','../../config/environment','./template.attributes','Template','tools_templates','util'];(function(_0x2a744b,_0x393bbc){var _0x430a5e=function(_0x4d34e9){while(--_0x4d34e9){_0x2a744b['push'](_0x2a744b['shift']());}};_0x430a5e(++_0x393bbc);}(_0x0fbc,0xb3));var _0xc0fb=function(_0x28884c,_0x1ed6b4){_0x28884c=_0x28884c-0x0;var _0x654b52=_0x0fbc[_0x28884c];return _0x654b52;};'use strict';var _=require('lodash');var util=require(_0xc0fb('0x0'));var logger=require(_0xc0fb('0x1'))(_0xc0fb('0x2'));var moment=require('moment');var BPromise=require(_0xc0fb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0fb('0x4'));var rimraf=require('rimraf');var config=require(_0xc0fb('0x5'));var attributes=require(_0xc0fb('0x6'));module['exports']=function(_0x5cc1f1,_0x23c8f6){return _0x5cc1f1['define'](_0xc0fb('0x7'),attributes,{'tableName':_0xc0fb('0x8'),'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 15712da..06bc2da 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 _0x7387=['../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetTemplate','Template','options','raw','limit','include','map','model','attributes','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x7387,0x8b));var _0x7738=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7387[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x7738('0x0'));var moment=require('moment');var BPromise=require(_0x7738('0x1'));var rs=require(_0x7738('0x2'));var fs=require('fs');var Redis=require(_0x7738('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7738('0x4'));var logger=require(_0x7738('0x5'))('rpc');var config=require(_0x7738('0x6'));var jayson=require(_0x7738('0x7'));var client=jayson['client'][_0x7738('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d7bd6,_0x54bcbe,_0x1e91d5){return new BPromise(function(_0x1c7c24,_0x22f765){return client[_0x7738('0x9')](_0x4d7bd6,_0x1e91d5)[_0x7738('0xa')](function(_0x173036){logger[_0x7738('0xb')](_0x7738('0xc'),_0x54bcbe,_0x7738('0xd'));logger[_0x7738('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x54bcbe,_0x7738('0xd'),JSON[_0x7738('0xf')](_0x173036));if(_0x173036[_0x7738('0x10')]){if(_0x173036[_0x7738('0x10')]['code']===0x1f4){logger[_0x7738('0x10')](_0x7738('0xc'),_0x54bcbe,_0x173036[_0x7738('0x10')][_0x7738('0x11')]);return _0x22f765(_0x173036[_0x7738('0x10')]['message']);}logger[_0x7738('0x10')](_0x7738('0xc'),_0x54bcbe,_0x173036[_0x7738('0x10')][_0x7738('0x11')]);return _0x1c7c24(_0x173036[_0x7738('0x10')][_0x7738('0x11')]);}else{logger['info'](_0x7738('0xc'),_0x54bcbe,'request\x20sent');_0x1c7c24(_0x173036[_0x7738('0x12')][_0x7738('0x11')]);}})[_0x7738('0x13')](function(_0x459b2d){logger[_0x7738('0x10')](_0x7738('0xc'),_0x54bcbe,_0x459b2d);_0x22f765(_0x459b2d);});});}exports[_0x7738('0x14')]=function(_0x5cc3f7){var _0x214097=this;return new Promise(function(_0x13d75f,_0x4e734e){return db[_0x7738('0x15')]['findAll']({'raw':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')][_0x7738('0x17')]===undefined?!![]:![]:!![],'where':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')]['where']||null:null,'attributes':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')]['attributes']||null:null,'limit':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')][_0x7738('0x18')]||null:null,'include':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7['options'][_0x7738('0x19')]?_[_0x7738('0x1a')](_0x5cc3f7[_0x7738('0x16')][_0x7738('0x19')],function(_0x5d3591){return{'model':db[_0x5d3591[_0x7738('0x1b')]],'as':_0x5d3591['as'],'attributes':_0x5d3591[_0x7738('0x1c')],'include':_0x5d3591[_0x7738('0x19')]?_[_0x7738('0x1a')](_0x5d3591[_0x7738('0x19')],function(_0x12e37b){return{'model':db[_0x12e37b[_0x7738('0x1b')]],'as':_0x12e37b['as'],'attributes':_0x12e37b[_0x7738('0x1c')],'include':_0x12e37b[_0x7738('0x19')]?_[_0x7738('0x1a')](_0x12e37b[_0x7738('0x19')],function(_0x5bc792){return{'model':db[_0x5bc792[_0x7738('0x1b')]],'as':_0x5bc792['as'],'attributes':_0x5bc792[_0x7738('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7738('0xa')](function(_0x1dcdc0){logger[_0x7738('0xb')](_0x7738('0x14'),_0x5cc3f7);logger[_0x7738('0xe')]('GetTemplate',_0x5cc3f7,JSON[_0x7738('0xf')](_0x1dcdc0));_0x13d75f(_0x1dcdc0);})[_0x7738('0x13')](function(_0x134719){logger[_0x7738('0x10')](_0x7738('0x14'),_0x134719[_0x7738('0x11')],_0x5cc3f7);_0x4e734e(_0x214097[_0x7738('0x10')](0x1f4,_0x134719['message']));});});}; \ No newline at end of file +var _0xaa77=['attributes','limit','include','map','model','stringify','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetTemplate','options','raw'];(function(_0x2fbb1a,_0x62dcb9){var _0x51019b=function(_0x15acc0){while(--_0x15acc0){_0x2fbb1a['push'](_0x2fbb1a['shift']());}};_0x51019b(++_0x62dcb9);}(_0xaa77,0x9c));var _0x7aa7=function(_0x1c1dc7,_0x3f79b3){_0x1c1dc7=_0x1c1dc7-0x0;var _0x4ab49c=_0xaa77[_0x1c1dc7];return _0x4ab49c;};'use strict';var _=require(_0x7aa7('0x0'));var util=require(_0x7aa7('0x1'));var moment=require('moment');var BPromise=require(_0x7aa7('0x2'));var rs=require(_0x7aa7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7aa7('0x4'));var logger=require(_0x7aa7('0x5'))(_0x7aa7('0x6'));var config=require('../../config/environment');var jayson=require(_0x7aa7('0x7'));var client=jayson[_0x7aa7('0x8')][_0x7aa7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x286345,_0x33314e,_0x2586c1){return new BPromise(function(_0x27289b,_0x3310e8){return client[_0x7aa7('0xa')](_0x286345,_0x2586c1)[_0x7aa7('0xb')](function(_0x2f2c09){logger[_0x7aa7('0xc')](_0x7aa7('0xd'),_0x33314e,_0x7aa7('0xe'));logger[_0x7aa7('0xf')](_0x7aa7('0x10'),_0x33314e,'request\x20sent',JSON['stringify'](_0x2f2c09));if(_0x2f2c09[_0x7aa7('0x11')]){if(_0x2f2c09[_0x7aa7('0x11')][_0x7aa7('0x12')]===0x1f4){logger['error'](_0x7aa7('0xd'),_0x33314e,_0x2f2c09['error'][_0x7aa7('0x13')]);return _0x3310e8(_0x2f2c09['error'][_0x7aa7('0x13')]);}logger['error'](_0x7aa7('0xd'),_0x33314e,_0x2f2c09['error'][_0x7aa7('0x13')]);return _0x27289b(_0x2f2c09[_0x7aa7('0x11')][_0x7aa7('0x13')]);}else{logger[_0x7aa7('0xc')]('Template,\x20%s,\x20%s',_0x33314e,_0x7aa7('0xe'));_0x27289b(_0x2f2c09['result'][_0x7aa7('0x13')]);}})[_0x7aa7('0x14')](function(_0xb9b55d){logger['error'](_0x7aa7('0xd'),_0x33314e,_0xb9b55d);_0x3310e8(_0xb9b55d);});});}exports[_0x7aa7('0x15')]=function(_0x43453e){var _0x2c40b5=this;return new Promise(function(_0x523e4d,_0x18b3bb){return db['Template']['findAll']({'raw':_0x43453e['options']?_0x43453e[_0x7aa7('0x16')][_0x7aa7('0x17')]===undefined?!![]:![]:!![],'where':_0x43453e['options']?_0x43453e[_0x7aa7('0x16')]['where']||null:null,'attributes':_0x43453e[_0x7aa7('0x16')]?_0x43453e['options'][_0x7aa7('0x18')]||null:null,'limit':_0x43453e[_0x7aa7('0x16')]?_0x43453e[_0x7aa7('0x16')][_0x7aa7('0x19')]||null:null,'include':_0x43453e[_0x7aa7('0x16')]?_0x43453e['options'][_0x7aa7('0x1a')]?_[_0x7aa7('0x1b')](_0x43453e[_0x7aa7('0x16')]['include'],function(_0x680f84){return{'model':db[_0x680f84['model']],'as':_0x680f84['as'],'attributes':_0x680f84['attributes'],'include':_0x680f84[_0x7aa7('0x1a')]?_['map'](_0x680f84[_0x7aa7('0x1a')],function(_0x4d02b6){return{'model':db[_0x4d02b6[_0x7aa7('0x1c')]],'as':_0x4d02b6['as'],'attributes':_0x4d02b6[_0x7aa7('0x18')],'include':_0x4d02b6[_0x7aa7('0x1a')]?_[_0x7aa7('0x1b')](_0x4d02b6[_0x7aa7('0x1a')],function(_0x1bd94b){return{'model':db[_0x1bd94b[_0x7aa7('0x1c')]],'as':_0x1bd94b['as'],'attributes':_0x1bd94b[_0x7aa7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1fd59b){logger[_0x7aa7('0xc')](_0x7aa7('0x15'),_0x43453e);logger['debug'](_0x7aa7('0x15'),_0x43453e,JSON[_0x7aa7('0x1d')](_0x1fd59b));_0x523e4d(_0x1fd59b);})['catch'](function(_0x4610c7){logger[_0x7aa7('0x11')](_0x7aa7('0x15'),_0x4610c7[_0x7aa7('0x13')],_0x43453e);_0x18b3bb(_0x2c40b5[_0x7aa7('0x11')](0x1f4,_0x4610c7[_0x7aa7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index ec63ee0..c68a094 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 _0x2c7f=['getAllConditions','/:id/any_conditions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','/:id','delete','destroy','exports','multer','util','express','Router','./trigger.controller','get','isAuthenticated','index','/:id/all_conditions'];(function(_0x488760,_0x3744a5){var _0x2f1afa=function(_0x13ccc4){while(--_0x13ccc4){_0x488760['push'](_0x488760['shift']());}};_0x2f1afa(++_0x3744a5);}(_0x2c7f,0x1b0));var _0xf2c7=function(_0x414c49,_0x5c5d25){_0x414c49=_0x414c49-0x0;var _0x5d9759=_0x2c7f[_0x414c49];return _0x5d9759;};'use strict';var multer=require(_0xf2c7('0x0'));var util=require(_0xf2c7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf2c7('0x2'));var router=express[_0xf2c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf2c7('0x4'));router[_0xf2c7('0x5')]('/',auth[_0xf2c7('0x6')](),controller[_0xf2c7('0x7')]);router[_0xf2c7('0x5')]('/:id',auth[_0xf2c7('0x6')](),controller['show']);router[_0xf2c7('0x5')](_0xf2c7('0x8'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0x9')]);router[_0xf2c7('0x5')](_0xf2c7('0xa'),auth[_0xf2c7('0x6')](),controller['getAnyConditions']);router[_0xf2c7('0x5')]('/:id/actions',auth[_0xf2c7('0x6')](),controller['getActions']);router[_0xf2c7('0xb')]('/',auth[_0xf2c7('0x6')](),controller[_0xf2c7('0xc')]);router[_0xf2c7('0xb')](_0xf2c7('0x8'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0xd')]);router[_0xf2c7('0xb')](_0xf2c7('0xa'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0xe')]);router[_0xf2c7('0xb')](_0xf2c7('0xf'),auth['isAuthenticated'](),controller[_0xf2c7('0x10')]);router['put'](_0xf2c7('0x11'),auth[_0xf2c7('0x6')](),controller['update']);router[_0xf2c7('0x12')](_0xf2c7('0x11'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0x13')]);module[_0xf2c7('0x14')]=router; \ No newline at end of file +var _0x721c=['/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','isAuthenticated','create','post','addAllCondition','addAnyCondition','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','/:id','show'];(function(_0x34ef08,_0x3490fc){var _0x161a4f=function(_0x47f7a1){while(--_0x47f7a1){_0x34ef08['push'](_0x34ef08['shift']());}};_0x161a4f(++_0x3490fc);}(_0x721c,0x152));var _0xc721=function(_0x372740,_0x4f9c44){_0x372740=_0x372740-0x0;var _0x2d2b27=_0x721c[_0x372740];return _0x2d2b27;};'use strict';var multer=require(_0xc721('0x0'));var util=require(_0xc721('0x1'));var path=require(_0xc721('0x2'));var timeout=require(_0xc721('0x3'));var express=require(_0xc721('0x4'));var router=express[_0xc721('0x5')]();var auth=require(_0xc721('0x6'));var interaction=require(_0xc721('0x7'));var config=require(_0xc721('0x8'));var controller=require(_0xc721('0x9'));router[_0xc721('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc721('0xa')](_0xc721('0xb'),auth['isAuthenticated'](),controller[_0xc721('0xc')]);router[_0xc721('0xa')](_0xc721('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xc721('0xa')](_0xc721('0xe'),auth['isAuthenticated'](),controller[_0xc721('0xf')]);router[_0xc721('0xa')](_0xc721('0x10'),auth[_0xc721('0x11')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0xc721('0x12')]);router[_0xc721('0x13')](_0xc721('0xd'),auth['isAuthenticated'](),controller[_0xc721('0x14')]);router[_0xc721('0x13')](_0xc721('0xe'),auth['isAuthenticated'](),controller[_0xc721('0x15')]);router[_0xc721('0x13')](_0xc721('0x10'),auth[_0xc721('0x11')](),controller['addAction']);router[_0xc721('0x16')](_0xc721('0xb'),auth[_0xc721('0x11')](),controller[_0xc721('0x17')]);router[_0xc721('0x18')](_0xc721('0xb'),auth[_0xc721('0x11')](),controller[_0xc721('0x19')]);module[_0xc721('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 2bd38f1..693c81e 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 _0xce64=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce64,0x11a));var _0x4ce6=function(_0x40be6f,_0x3c2f55){_0x40be6f=_0x40be6f-0x0;var _0x1f652b=_0xce64[_0x40be6f];return _0x1f652b;};'use strict';var Sequelize=require('sequelize');module[_0x4ce6('0x0')]={'name':{'type':Sequelize[_0x4ce6('0x1')]},'channel':{'type':Sequelize[_0x4ce6('0x1')]},'description':{'type':Sequelize[_0x4ce6('0x1')]},'status':{'type':Sequelize[_0x4ce6('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x13c2=['exports','STRING','sequelize'];(function(_0x3deb9e,_0x4b1c7e){var _0x5ee0ec=function(_0x596baa){while(--_0x596baa){_0x3deb9e['push'](_0x3deb9e['shift']());}};_0x5ee0ec(++_0x4b1c7e);}(_0x13c2,0xb3));var _0x213c=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x13c2[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0x213c('0x0'));module[_0x213c('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x213c('0x2')]},'description':{'type':Sequelize[_0x213c('0x2')]},'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 ef7f2a0..317cb4f 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 _0xbfce=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','error','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','keys','length','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x267cec,_0x608100){var _0x252df3=function(_0x2442f5){while(--_0x2442f5){_0x267cec['push'](_0x267cec['shift']());}};_0x252df3(++_0x608100);}(_0xbfce,0x161));var _0xebfc=function(_0x54536f,_0x1948c5){_0x54536f=_0x54536f-0x0;var _0x4befc1=_0xbfce[_0x54536f];return _0x4befc1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xebfc('0x0'));var rimraf=require(_0xebfc('0x1'));var zipdir=require(_0xebfc('0x2'));var jsonpatch=require(_0xebfc('0x3'));var rp=require(_0xebfc('0x4'));var moment=require(_0xebfc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xebfc('0x6'));var util=require('util');var path=require('path');var sox=require(_0xebfc('0x7'));var csv=require(_0xebfc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xebfc('0x9'));var squel=require('squel');var crypto=require(_0xebfc('0xa'));var jsforce=require(_0xebfc('0xb'));var deskjs=require(_0xebfc('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xebfc('0xd'));var authService=require(_0xebfc('0xe'));var qs=require(_0xebfc('0xf'));var as=require(_0xebfc('0x10'));var hardwareService=require(_0xebfc('0x11'));var logger=require(_0xebfc('0x12'))(_0xebfc('0x13'));var utils=require(_0xebfc('0x14'));var config=require(_0xebfc('0x15'));var db=require(_0xebfc('0x16'))['db'];function respondWithStatusCode(_0x9294f5,_0x2febae){_0x2febae=_0x2febae||0xcc;return function(_0x2dbf9f){if(_0x2dbf9f){return _0x9294f5[_0xebfc('0x17')](_0x2febae);}return _0x9294f5[_0xebfc('0x18')](_0x2febae)['end']();};}function respondWithResult(_0x3c1c84,_0x44d239){_0x44d239=_0x44d239||0xc8;return function(_0x89eb21){if(_0x89eb21){return _0x3c1c84[_0xebfc('0x18')](_0x44d239)[_0xebfc('0x19')](_0x89eb21);}};}function respondWithFilteredResult(_0x364d80,_0x52ebc5){return function(_0x2950b2){if(_0x2950b2){var _0x58450c=_0x2950b2[_0xebfc('0x1a')],_0xe8f4f=_0x52ebc5[_0xebfc('0x1b')],_0x2e84bb=_0x52ebc5[_0xebfc('0x1b')]+_0x52ebc5[_0xebfc('0x1c')],_0x3657bb;if(_0x2e84bb>=_0x58450c){_0x2e84bb=_0x58450c;_0x3657bb=0xc8;}else{_0x3657bb=0xce;}_0x364d80['status'](_0x3657bb);return _0x364d80[_0xebfc('0x1d')](_0xebfc('0x1e'),_0xe8f4f+'-'+_0x2e84bb+'/'+_0x58450c)[_0xebfc('0x19')](_0x2950b2);}return null;};}function patchUpdates(_0xe18510){return function(_0x138503){try{jsonpatch[_0xebfc('0x1f')](_0x138503,_0xe18510,!![]);}catch(_0x1061c6){return BPromise[_0xebfc('0x20')](_0x1061c6);}return _0x138503['save']();};}function saveUpdates(_0x2f12d3,_0x16483e){return function(_0x2208e7){if(_0x2208e7){return _0x2208e7[_0xebfc('0x21')](_0x2f12d3)[_0xebfc('0x22')](function(_0x3867f6){return _0x3867f6;});}return null;};}function removeEntity(_0x22cb60,_0x2bacd7){return function(_0x4ad6e2){if(_0x4ad6e2){return _0x4ad6e2[_0xebfc('0x23')]()[_0xebfc('0x22')](function(){var _0x5d7a63=_0x4ad6e2[_0xebfc('0x24')]({'plain':!![]});var _0xc27b61='Triggers';return db[_0xebfc('0x25')][_0xebfc('0x23')]({'where':{'type':_0xc27b61,'resourceId':_0x5d7a63['id']}})[_0xebfc('0x22')](function(){return _0x4ad6e2;});})[_0xebfc('0x22')](function(){_0x22cb60[_0xebfc('0x18')](0xcc)[_0xebfc('0x26')]();});}};}function handleEntityNotFound(_0x538d57,_0x460fcd){return function(_0x2d394b){if(!_0x2d394b){_0x538d57[_0xebfc('0x17')](0x194);}return _0x2d394b;};}function handleError(_0x1f5151,_0x4157cb){_0x4157cb=_0x4157cb||0x1f4;return function(_0x17005a){logger['error'](_0x17005a[_0xebfc('0x27')]);if(_0x17005a[_0xebfc('0x28')]){delete _0x17005a['name'];}_0x1f5151[_0xebfc('0x18')](_0x4157cb)[_0xebfc('0x29')](_0x17005a);};}exports[_0xebfc('0x2a')]=function(_0x17d514,_0x339204){var _0x544efa={},_0x3ad8e4={},_0x5cc4d2={'count':0x0,'rows':[]};var _0x24a1e3=_[_0xebfc('0x2b')](db[_0xebfc('0x2c')][_0xebfc('0x2d')],function(_0x6a719d){return{'name':_0x6a719d[_0xebfc('0x2e')],'type':_0x6a719d[_0xebfc('0x2f')]['key']};});_0x3ad8e4[_0xebfc('0x30')]=_['map'](_0x24a1e3,'name');_0x3ad8e4[_0xebfc('0x31')]=_['keys'](_0x17d514[_0xebfc('0x31')]);_0x3ad8e4[_0xebfc('0x32')]=_['intersection'](_0x3ad8e4[_0xebfc('0x30')],_0x3ad8e4[_0xebfc('0x31')]);_0x544efa[_0xebfc('0x33')]=_[_0xebfc('0x34')](_0x3ad8e4['model'],qs['fields'](_0x17d514[_0xebfc('0x31')]['fields']));_0x544efa[_0xebfc('0x33')]=_0x544efa[_0xebfc('0x33')]['length']?_0x544efa['attributes']:_0x3ad8e4[_0xebfc('0x30')];if(!_0x17d514[_0xebfc('0x31')][_0xebfc('0x35')]('nolimit')){_0x544efa[_0xebfc('0x1c')]=qs[_0xebfc('0x1c')](_0x17d514['query'][_0xebfc('0x1c')]);_0x544efa[_0xebfc('0x1b')]=qs[_0xebfc('0x1b')](_0x17d514[_0xebfc('0x31')][_0xebfc('0x1b')]);}_0x544efa[_0xebfc('0x36')]=qs[_0xebfc('0x37')](_0x17d514['query'][_0xebfc('0x37')]);_0x544efa[_0xebfc('0x38')]=qs[_0xebfc('0x32')](_[_0xebfc('0x39')](_0x17d514[_0xebfc('0x31')],_0x3ad8e4[_0xebfc('0x32')]));if(_0x17d514['query'][_0xebfc('0x3a')]){_0x544efa[_0xebfc('0x38')]=_[_0xebfc('0x3b')](_0x544efa[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x24a1e3,function(_0xf05c0f){if(_0xf05c0f['type']!==_0xebfc('0x3c')){var _0x411569={};_0x411569[_0xf05c0f[_0xebfc('0x28')]]={'$like':'%'+_0x17d514[_0xebfc('0x31')][_0xebfc('0x3a')]+'%'};return _0x411569;}})});}_0x544efa=_[_0xebfc('0x3b')]({},_0x544efa,_0x17d514['options']);var _0x1199da={'where':_0x544efa[_0xebfc('0x38')]};return db[_0xebfc('0x2c')][_0xebfc('0x1a')](_0x1199da)['then'](function(_0x125d7d){_0x5cc4d2[_0xebfc('0x1a')]=_0x125d7d;if(_0x17d514[_0xebfc('0x31')][_0xebfc('0x3d')]){_0x544efa[_0xebfc('0x3e')]=[{'all':!![]}];}return db[_0xebfc('0x2c')]['findAll'](_0x544efa);})[_0xebfc('0x22')](function(_0x34e810){_0x5cc4d2[_0xebfc('0x3f')]=_0x34e810;return _0x5cc4d2;})[_0xebfc('0x22')](respondWithFilteredResult(_0x339204,_0x544efa))[_0xebfc('0x40')](handleError(_0x339204,null));};exports[_0xebfc('0x41')]=function(_0x4f038d,_0x599b87){var _0x13c0d7={'raw':![],'where':{'id':_0x4f038d[_0xebfc('0x42')]['id']}},_0x1ca62f={};_0x1ca62f[_0xebfc('0x30')]=_['keys'](db[_0xebfc('0x2c')][_0xebfc('0x2d')]);_0x1ca62f['query']=_['keys'](_0x4f038d['query']);_0x1ca62f['filters']=_[_0xebfc('0x34')](_0x1ca62f[_0xebfc('0x30')],_0x1ca62f[_0xebfc('0x31')]);_0x13c0d7[_0xebfc('0x33')]=_[_0xebfc('0x34')](_0x1ca62f[_0xebfc('0x30')],qs[_0xebfc('0x43')](_0x4f038d[_0xebfc('0x31')][_0xebfc('0x43')]));_0x13c0d7[_0xebfc('0x33')]=_0x13c0d7['attributes']['length']?_0x13c0d7[_0xebfc('0x33')]:_0x1ca62f['model'];if(_0x4f038d[_0xebfc('0x31')]['includeAll']){_0x13c0d7['include']=[{'all':!![]}];}_0x13c0d7=_[_0xebfc('0x3b')]({},_0x13c0d7,_0x4f038d[_0xebfc('0x44')]);return db['Trigger'][_0xebfc('0x45')](_0x13c0d7)[_0xebfc('0x22')](handleEntityNotFound(_0x599b87,null))[_0xebfc('0x22')](respondWithResult(_0x599b87,null))[_0xebfc('0x40')](handleError(_0x599b87,null));};exports[_0xebfc('0x46')]=function(_0x5c45fc,_0x36040d){return db[_0xebfc('0x2c')]['create'](_0x5c45fc[_0xebfc('0x47')],{})[_0xebfc('0x22')](function(_0x225a3c){var _0xd6ff21=_0x5c45fc[_0xebfc('0x48')][_0xebfc('0x24')]({'plain':!![]});if(!_0xd6ff21)throw new Error(_0xebfc('0x49'));if(_0xd6ff21[_0xebfc('0x4a')]===_0xebfc('0x48')){var _0x1ff14f=_0x225a3c[_0xebfc('0x24')]({'plain':!![]});var _0x3d94cd=_0xebfc('0x4b');return db[_0xebfc('0x4c')][_0xebfc('0x45')]({'where':{'name':_0x3d94cd,'userProfileId':_0xd6ff21[_0xebfc('0x4d')]},'raw':!![]})['then'](function(_0x3ed0ca){if(_0x3ed0ca&&_0x3ed0ca['autoAssociation']===0x0){return db[_0xebfc('0x25')][_0xebfc('0x46')]({'name':_0x1ff14f[_0xebfc('0x28')],'resourceId':_0x1ff14f['id'],'type':_0x3ed0ca[_0xebfc('0x28')],'sectionId':_0x3ed0ca['id']},{})[_0xebfc('0x22')](function(){return _0x225a3c;});}else{return _0x225a3c;}})['catch'](function(_0x5bebae){logger[_0xebfc('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bebae);throw _0x5bebae;});}return _0x225a3c;})[_0xebfc('0x22')](respondWithResult(_0x36040d,0xc9))[_0xebfc('0x40')](handleError(_0x36040d,null));};exports[_0xebfc('0x21')]=function(_0x368f78,_0x37b791){if(_0x368f78[_0xebfc('0x47')]['id']){delete _0x368f78[_0xebfc('0x47')]['id'];}return db['Trigger'][_0xebfc('0x45')]({'where':{'id':_0x368f78[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x37b791,null))[_0xebfc('0x22')](saveUpdates(_0x368f78[_0xebfc('0x47')],null))[_0xebfc('0x22')](respondWithResult(_0x37b791,null))[_0xebfc('0x40')](handleError(_0x37b791,null));};exports[_0xebfc('0x23')]=function(_0x209f0a,_0x55ef8d){return db[_0xebfc('0x2c')][_0xebfc('0x45')]({'where':{'id':_0x209f0a[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x55ef8d,null))[_0xebfc('0x22')](removeEntity(_0x55ef8d,null))[_0xebfc('0x40')](handleError(_0x55ef8d,null));};exports['addAllCondition']=function(_0x2cc0b0,_0x8bb70f,_0x162b56){if(_0x2cc0b0[_0xebfc('0x47')]['id']){delete _0x2cc0b0[_0xebfc('0x47')]['id'];}return db[_0xebfc('0x2c')]['find']({'where':{'id':_0x2cc0b0[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x8bb70f,null))[_0xebfc('0x22')](function(_0x474047){if(_0x474047){_0x2cc0b0[_0xebfc('0x47')]['TriggerAllId']=_0x474047['id'];return db[_0xebfc('0x4f')][_0xebfc('0x46')](_0x2cc0b0['body']);}})[_0xebfc('0x22')](respondWithResult(_0x8bb70f,null))[_0xebfc('0x40')](handleError(_0x8bb70f,null));};exports[_0xebfc('0x50')]=function(_0x44c808,_0x26ba00,_0x46ddf0){if(_0x44c808['body']['id']){delete _0x44c808[_0xebfc('0x47')]['id'];}return db['Trigger'][_0xebfc('0x45')]({'where':{'id':_0x44c808['params']['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x26ba00,null))['then'](function(_0x2e75e6){if(_0x2e75e6){_0x44c808[_0xebfc('0x47')][_0xebfc('0x51')]=_0x2e75e6['id'];return db[_0xebfc('0x4f')][_0xebfc('0x46')](_0x44c808[_0xebfc('0x47')]);}})[_0xebfc('0x22')](respondWithResult(_0x26ba00,null))[_0xebfc('0x40')](handleError(_0x26ba00,null));};exports[_0xebfc('0x52')]=function(_0x3dd0db,_0x375907,_0x2075e4){var _0x1a5ca4={};var _0x3d92c9={};var _0x3e0816;var _0x39b62c;return db[_0xebfc('0x2c')][_0xebfc('0x53')]({'where':{'id':_0x3dd0db[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x375907,null))[_0xebfc('0x22')](function(_0x53ea4f){if(_0x53ea4f){_0x3e0816=_0x53ea4f;_0x3d92c9[_0xebfc('0x30')]=_[_0xebfc('0x54')](db[_0xebfc('0x4f')][_0xebfc('0x2d')]);_0x3d92c9[_0xebfc('0x31')]=_['keys'](_0x3dd0db[_0xebfc('0x31')]);_0x3d92c9[_0xebfc('0x32')]=_[_0xebfc('0x34')](_0x3d92c9[_0xebfc('0x30')],_0x3d92c9['query']);_0x1a5ca4[_0xebfc('0x33')]=_['intersection'](_0x3d92c9['model'],qs[_0xebfc('0x43')](_0x3dd0db[_0xebfc('0x31')]['fields']));_0x1a5ca4[_0xebfc('0x33')]=_0x1a5ca4[_0xebfc('0x33')][_0xebfc('0x55')]?_0x1a5ca4['attributes']:_0x3d92c9[_0xebfc('0x30')];_0x1a5ca4['order']=qs['sort'](_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x37')]);_0x1a5ca4[_0xebfc('0x38')]=qs[_0xebfc('0x32')](_[_0xebfc('0x39')](_0x3dd0db[_0xebfc('0x31')],_0x3d92c9[_0xebfc('0x32')]));if(_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x3a')]){_0x1a5ca4[_0xebfc('0x38')]=_[_0xebfc('0x3b')](_0x1a5ca4[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x1a5ca4['attributes'],function(_0x35ea18){var _0x316375={};_0x316375[_0x35ea18]={'$like':'%'+_0x3dd0db['query'][_0xebfc('0x3a')]+'%'};return _0x316375;})});}_0x1a5ca4=_['merge']({},_0x1a5ca4,_0x3dd0db['options']);return _0x3e0816[_0xebfc('0x52')](_0x1a5ca4);}})[_0xebfc('0x22')](function(_0x5bfe26){if(_0x5bfe26){_0x39b62c=_0x5bfe26[_0xebfc('0x55')];if(!_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x35')](_0xebfc('0x56'))){_0x1a5ca4['limit']=qs[_0xebfc('0x1c')](_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x1c')]);_0x1a5ca4['offset']=qs['offset'](_0x3dd0db[_0xebfc('0x31')]['offset']);}return _0x3e0816['getAllConditions'](_0x1a5ca4);}})[_0xebfc('0x22')](function(_0x13f7ec){if(_0x13f7ec){return _0x13f7ec?{'count':_0x39b62c,'rows':_0x13f7ec}:null;}})[_0xebfc('0x22')](respondWithResult(_0x375907,null))[_0xebfc('0x40')](handleError(_0x375907,null));};exports[_0xebfc('0x57')]=function(_0x272540,_0x29d8f6,_0x3d4c2d){var _0x5002f3={};var _0x2d1bbb={};var _0x1aa3af;var _0x2f7dd5;return db[_0xebfc('0x2c')][_0xebfc('0x53')]({'where':{'id':_0x272540['params']['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x29d8f6,null))['then'](function(_0x560424){if(_0x560424){_0x1aa3af=_0x560424;_0x2d1bbb[_0xebfc('0x30')]=_['keys'](db['Condition']['rawAttributes']);_0x2d1bbb[_0xebfc('0x31')]=_[_0xebfc('0x54')](_0x272540[_0xebfc('0x31')]);_0x2d1bbb[_0xebfc('0x32')]=_[_0xebfc('0x34')](_0x2d1bbb['model'],_0x2d1bbb['query']);_0x5002f3['attributes']=_[_0xebfc('0x34')](_0x2d1bbb[_0xebfc('0x30')],qs[_0xebfc('0x43')](_0x272540[_0xebfc('0x31')][_0xebfc('0x43')]));_0x5002f3[_0xebfc('0x33')]=_0x5002f3['attributes'][_0xebfc('0x55')]?_0x5002f3['attributes']:_0x2d1bbb['model'];_0x5002f3['order']=qs[_0xebfc('0x37')](_0x272540[_0xebfc('0x31')][_0xebfc('0x37')]);_0x5002f3['where']=qs['filters'](_[_0xebfc('0x39')](_0x272540[_0xebfc('0x31')],_0x2d1bbb[_0xebfc('0x32')]));if(_0x272540['query'][_0xebfc('0x3a')]){_0x5002f3[_0xebfc('0x38')]=_[_0xebfc('0x3b')](_0x5002f3[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x5002f3[_0xebfc('0x33')],function(_0xceff1e){var _0x4a3a79={};_0x4a3a79[_0xceff1e]={'$like':'%'+_0x272540['query'][_0xebfc('0x3a')]+'%'};return _0x4a3a79;})});}_0x5002f3=_[_0xebfc('0x3b')]({},_0x5002f3,_0x272540[_0xebfc('0x44')]);return _0x1aa3af[_0xebfc('0x57')](_0x5002f3);}})[_0xebfc('0x22')](function(_0x35d631){if(_0x35d631){_0x2f7dd5=_0x35d631[_0xebfc('0x55')];if(!_0x272540[_0xebfc('0x31')][_0xebfc('0x35')](_0xebfc('0x56'))){_0x5002f3[_0xebfc('0x1c')]=qs['limit'](_0x272540['query'][_0xebfc('0x1c')]);_0x5002f3[_0xebfc('0x1b')]=qs[_0xebfc('0x1b')](_0x272540[_0xebfc('0x31')]['offset']);}return _0x1aa3af[_0xebfc('0x57')](_0x5002f3);}})['then'](function(_0x3e2a5b){if(_0x3e2a5b){return _0x3e2a5b?{'count':_0x2f7dd5,'rows':_0x3e2a5b}:null;}})[_0xebfc('0x22')](respondWithResult(_0x29d8f6,null))[_0xebfc('0x40')](handleError(_0x29d8f6,null));};exports[_0xebfc('0x58')]=function(_0x49bf8b,_0xd77cb8,_0x13521a){if(_0x49bf8b[_0xebfc('0x47')]['id']){delete _0x49bf8b[_0xebfc('0x47')]['id'];}return db['Trigger'][_0xebfc('0x45')]({'where':{'id':_0x49bf8b[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0xd77cb8,null))[_0xebfc('0x22')](function(_0x4bcebb){if(_0x4bcebb){_0x49bf8b[_0xebfc('0x47')][_0xebfc('0x59')]=_0x4bcebb['id'];return db[_0xebfc('0x5a')]['create'](_0x49bf8b[_0xebfc('0x47')]);}})[_0xebfc('0x22')](respondWithResult(_0xd77cb8,null))[_0xebfc('0x40')](handleError(_0xd77cb8,null));};exports[_0xebfc('0x5b')]=function(_0x303311,_0x58437f,_0x7f2605){var _0x3d071f={};var _0x251087={};var _0x146d43;var _0x27426a;return db[_0xebfc('0x2c')][_0xebfc('0x53')]({'where':{'id':_0x303311[_0xebfc('0x42')]['id']}})['then'](handleEntityNotFound(_0x58437f,null))[_0xebfc('0x22')](function(_0x28bdf6){if(_0x28bdf6){_0x146d43=_0x28bdf6;_0x251087[_0xebfc('0x30')]=_['keys'](db[_0xebfc('0x5a')][_0xebfc('0x2d')]);_0x251087['query']=_[_0xebfc('0x54')](_0x303311[_0xebfc('0x31')]);_0x251087[_0xebfc('0x32')]=_['intersection'](_0x251087[_0xebfc('0x30')],_0x251087[_0xebfc('0x31')]);_0x3d071f[_0xebfc('0x33')]=_[_0xebfc('0x34')](_0x251087[_0xebfc('0x30')],qs['fields'](_0x303311[_0xebfc('0x31')][_0xebfc('0x43')]));_0x3d071f[_0xebfc('0x33')]=_0x3d071f[_0xebfc('0x33')]['length']?_0x3d071f[_0xebfc('0x33')]:_0x251087['model'];_0x3d071f[_0xebfc('0x36')]=qs[_0xebfc('0x37')](_0x303311[_0xebfc('0x31')][_0xebfc('0x37')]);_0x3d071f[_0xebfc('0x38')]=qs[_0xebfc('0x32')](_[_0xebfc('0x39')](_0x303311[_0xebfc('0x31')],_0x251087[_0xebfc('0x32')]));if(_0x303311['query'][_0xebfc('0x3a')]){_0x3d071f[_0xebfc('0x38')]=_['merge'](_0x3d071f[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x3d071f['attributes'],function(_0x4a17fa){var _0x4ab1fb={};_0x4ab1fb[_0x4a17fa]={'$like':'%'+_0x303311[_0xebfc('0x31')][_0xebfc('0x3a')]+'%'};return _0x4ab1fb;})});}_0x3d071f=_[_0xebfc('0x3b')]({},_0x3d071f,_0x303311[_0xebfc('0x44')]);return _0x146d43['getActions'](_0x3d071f);}})['then'](function(_0x5826c3){if(_0x5826c3){_0x27426a=_0x5826c3[_0xebfc('0x55')];if(!_0x303311[_0xebfc('0x31')][_0xebfc('0x35')](_0xebfc('0x56'))){_0x3d071f['limit']=qs[_0xebfc('0x1c')](_0x303311[_0xebfc('0x31')][_0xebfc('0x1c')]);_0x3d071f[_0xebfc('0x1b')]=qs['offset'](_0x303311[_0xebfc('0x31')][_0xebfc('0x1b')]);}return _0x146d43[_0xebfc('0x5b')](_0x3d071f);}})[_0xebfc('0x22')](function(_0x4815e7){if(_0x4815e7){return _0x4815e7?{'count':_0x27426a,'rows':_0x4815e7}:null;}})[_0xebfc('0x22')](respondWithResult(_0x58437f,null))[_0xebfc('0x40')](handleError(_0x58437f,null));}; \ No newline at end of file +var _0x775e=['keys','filters','model','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','count','includeAll','include','findAll','rows','show','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','params','Condition','TriggerAnyId','getAllConditions','findOne','pick','options','nolimit','getAnyConditions','addAction','getActions','Action','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','error','stack','name','index','map','Trigger','rawAttributes','fieldName'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x775e,0xda));var _0xe775=function(_0x2ec2ef,_0x175229){_0x2ec2ef=_0x2ec2ef-0x0;var _0x142f09=_0x775e[_0x2ec2ef];return _0x142f09;};'use strict';var pdf=require(_0xe775('0x0'));var emlformat=require(_0xe775('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe775('0x2'));var rp=require(_0xe775('0x3'));var moment=require('moment');var BPromise=require(_0xe775('0x4'));var Mustache=require(_0xe775('0x5'));var util=require('util');var path=require(_0xe775('0x6'));var sox=require(_0xe775('0x7'));var csv=require(_0xe775('0x8'));var ejs=require(_0xe775('0x9'));var fs=require('fs');var _=require(_0xe775('0xa'));var squel=require(_0xe775('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe775('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe775('0xd'));var Papa=require('papaparse');var Redis=require(_0xe775('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe775('0xf'));var as=require(_0xe775('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe775('0x11'))(_0xe775('0x12'));var utils=require(_0xe775('0x13'));var config=require(_0xe775('0x14'));var db=require(_0xe775('0x15'))['db'];function respondWithStatusCode(_0x21b02b,_0x3e86db){_0x3e86db=_0x3e86db||0xcc;return function(_0x4a57ec){if(_0x4a57ec){return _0x21b02b[_0xe775('0x16')](_0x3e86db);}return _0x21b02b[_0xe775('0x17')](_0x3e86db)[_0xe775('0x18')]();};}function respondWithResult(_0x10cc61,_0xa3c53e){_0xa3c53e=_0xa3c53e||0xc8;return function(_0x34a947){if(_0x34a947){return _0x10cc61[_0xe775('0x17')](_0xa3c53e)[_0xe775('0x19')](_0x34a947);}};}function respondWithFilteredResult(_0x312e86,_0x32907e){return function(_0x5c99c3){if(_0x5c99c3){var _0x4a6e8b=_0x5c99c3['count'],_0x50955b=_0x32907e[_0xe775('0x1a')],_0x53605c=_0x32907e['offset']+_0x32907e[_0xe775('0x1b')],_0x3200e9;if(_0x53605c>=_0x4a6e8b){_0x53605c=_0x4a6e8b;_0x3200e9=0xc8;}else{_0x3200e9=0xce;}_0x312e86[_0xe775('0x17')](_0x3200e9);return _0x312e86[_0xe775('0x1c')](_0xe775('0x1d'),_0x50955b+'-'+_0x53605c+'/'+_0x4a6e8b)['json'](_0x5c99c3);}return null;};}function patchUpdates(_0x2f6fa4){return function(_0x5189d9){try{jsonpatch[_0xe775('0x1e')](_0x5189d9,_0x2f6fa4,!![]);}catch(_0x2dac8d){return BPromise[_0xe775('0x1f')](_0x2dac8d);}return _0x5189d9[_0xe775('0x20')]();};}function saveUpdates(_0x5efad1,_0x3ba23e){return function(_0xd6aee7){if(_0xd6aee7){return _0xd6aee7[_0xe775('0x21')](_0x5efad1)[_0xe775('0x22')](function(_0x18d785){return _0x18d785;});}return null;};}function removeEntity(_0x788b2,_0x3c0109){return function(_0x2c141d){if(_0x2c141d){return _0x2c141d[_0xe775('0x23')]()[_0xe775('0x22')](function(){var _0x2a5f56=_0x2c141d[_0xe775('0x24')]({'plain':!![]});var _0x5d769d=_0xe775('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x5d769d,'resourceId':_0x2a5f56['id']}})[_0xe775('0x22')](function(){return _0x2c141d;});})[_0xe775('0x22')](function(){_0x788b2[_0xe775('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb8ce4,_0x3d85b7){return function(_0x25336a){if(!_0x25336a){_0xb8ce4[_0xe775('0x16')](0x194);}return _0x25336a;};}function handleError(_0x4baebf,_0x2d90fe){_0x2d90fe=_0x2d90fe||0x1f4;return function(_0x156c24){logger[_0xe775('0x26')](_0x156c24[_0xe775('0x27')]);if(_0x156c24[_0xe775('0x28')]){delete _0x156c24[_0xe775('0x28')];}_0x4baebf[_0xe775('0x17')](_0x2d90fe)['send'](_0x156c24);};}exports[_0xe775('0x29')]=function(_0x50ef79,_0x8e7a9c){var _0x283670={},_0x929433={},_0x1e2a01={'count':0x0,'rows':[]};var _0x4aedf1=_[_0xe775('0x2a')](db[_0xe775('0x2b')][_0xe775('0x2c')],function(_0x253bba){return{'name':_0x253bba[_0xe775('0x2d')],'type':_0x253bba['type']['key']};});_0x929433['model']=_[_0xe775('0x2a')](_0x4aedf1,'name');_0x929433['query']=_[_0xe775('0x2e')](_0x50ef79['query']);_0x929433[_0xe775('0x2f')]=_['intersection'](_0x929433[_0xe775('0x30')],_0x929433[_0xe775('0x31')]);_0x283670[_0xe775('0x32')]=_[_0xe775('0x33')](_0x929433[_0xe775('0x30')],qs[_0xe775('0x34')](_0x50ef79[_0xe775('0x31')][_0xe775('0x34')]));_0x283670[_0xe775('0x32')]=_0x283670['attributes'][_0xe775('0x35')]?_0x283670[_0xe775('0x32')]:_0x929433[_0xe775('0x30')];if(!_0x50ef79[_0xe775('0x31')][_0xe775('0x36')]('nolimit')){_0x283670[_0xe775('0x1b')]=qs[_0xe775('0x1b')](_0x50ef79[_0xe775('0x31')][_0xe775('0x1b')]);_0x283670[_0xe775('0x1a')]=qs[_0xe775('0x1a')](_0x50ef79[_0xe775('0x31')][_0xe775('0x1a')]);}_0x283670[_0xe775('0x37')]=qs[_0xe775('0x38')](_0x50ef79[_0xe775('0x31')][_0xe775('0x38')]);_0x283670['where']=qs[_0xe775('0x2f')](_['pick'](_0x50ef79['query'],_0x929433[_0xe775('0x2f')]));if(_0x50ef79[_0xe775('0x31')][_0xe775('0x39')]){_0x283670[_0xe775('0x3a')]=_['merge'](_0x283670[_0xe775('0x3a')],{'$or':_[_0xe775('0x2a')](_0x4aedf1,function(_0x3e38d1){if(_0x3e38d1[_0xe775('0x3b')]!==_0xe775('0x3c')){var _0x3f5170={};_0x3f5170[_0x3e38d1[_0xe775('0x28')]]={'$like':'%'+_0x50ef79[_0xe775('0x31')]['filter']+'%'};return _0x3f5170;}})});}_0x283670=_[_0xe775('0x3d')]({},_0x283670,_0x50ef79['options']);var _0x40537a={'where':_0x283670[_0xe775('0x3a')]};return db[_0xe775('0x2b')][_0xe775('0x3e')](_0x40537a)['then'](function(_0x53aa8d){_0x1e2a01[_0xe775('0x3e')]=_0x53aa8d;if(_0x50ef79[_0xe775('0x31')][_0xe775('0x3f')]){_0x283670[_0xe775('0x40')]=[{'all':!![]}];}return db[_0xe775('0x2b')][_0xe775('0x41')](_0x283670);})[_0xe775('0x22')](function(_0x16a917){_0x1e2a01[_0xe775('0x42')]=_0x16a917;return _0x1e2a01;})[_0xe775('0x22')](respondWithFilteredResult(_0x8e7a9c,_0x283670))['catch'](handleError(_0x8e7a9c,null));};exports[_0xe775('0x43')]=function(_0x415b65,_0x195ee4){var _0x4df8d8={'raw':![],'where':{'id':_0x415b65['params']['id']}},_0x682c57={};_0x682c57[_0xe775('0x30')]=_[_0xe775('0x2e')](db['Trigger'][_0xe775('0x2c')]);_0x682c57[_0xe775('0x31')]=_['keys'](_0x415b65[_0xe775('0x31')]);_0x682c57[_0xe775('0x2f')]=_[_0xe775('0x33')](_0x682c57['model'],_0x682c57[_0xe775('0x31')]);_0x4df8d8['attributes']=_[_0xe775('0x33')](_0x682c57['model'],qs[_0xe775('0x34')](_0x415b65['query'][_0xe775('0x34')]));_0x4df8d8['attributes']=_0x4df8d8['attributes'][_0xe775('0x35')]?_0x4df8d8[_0xe775('0x32')]:_0x682c57[_0xe775('0x30')];if(_0x415b65['query'][_0xe775('0x3f')]){_0x4df8d8['include']=[{'all':!![]}];}_0x4df8d8=_[_0xe775('0x3d')]({},_0x4df8d8,_0x415b65['options']);return db[_0xe775('0x2b')]['find'](_0x4df8d8)['then'](handleEntityNotFound(_0x195ee4,null))[_0xe775('0x22')](respondWithResult(_0x195ee4,null))[_0xe775('0x44')](handleError(_0x195ee4,null));};exports[_0xe775('0x45')]=function(_0x49bd67,_0x24069c){return db[_0xe775('0x2b')]['create'](_0x49bd67[_0xe775('0x46')],{})['then'](function(_0x167f9d){var _0x294bf4=_0x49bd67[_0xe775('0x47')][_0xe775('0x24')]({'plain':!![]});if(!_0x294bf4)throw new Error(_0xe775('0x48'));if(_0x294bf4[_0xe775('0x49')]===_0xe775('0x47')){var _0x5919da=_0x167f9d[_0xe775('0x24')]({'plain':!![]});var _0x4d7a1f=_0xe775('0x25');return db['UserProfileSection'][_0xe775('0x4a')]({'where':{'name':_0x4d7a1f,'userProfileId':_0x294bf4[_0xe775('0x4b')]},'raw':!![]})[_0xe775('0x22')](function(_0x3b3e76){if(_0x3b3e76&&_0x3b3e76['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5919da[_0xe775('0x28')],'resourceId':_0x5919da['id'],'type':_0x3b3e76[_0xe775('0x28')],'sectionId':_0x3b3e76['id']},{})[_0xe775('0x22')](function(){return _0x167f9d;});}else{return _0x167f9d;}})['catch'](function(_0x2a1056){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a1056);throw _0x2a1056;});}return _0x167f9d;})[_0xe775('0x22')](respondWithResult(_0x24069c,0xc9))[_0xe775('0x44')](handleError(_0x24069c,null));};exports[_0xe775('0x21')]=function(_0x2855ce,_0x16f8c2){if(_0x2855ce[_0xe775('0x46')]['id']){delete _0x2855ce['body']['id'];}return db[_0xe775('0x2b')][_0xe775('0x4a')]({'where':{'id':_0x2855ce[_0xe775('0x4c')]['id']}})['then'](handleEntityNotFound(_0x16f8c2,null))[_0xe775('0x22')](saveUpdates(_0x2855ce[_0xe775('0x46')],null))['then'](respondWithResult(_0x16f8c2,null))['catch'](handleError(_0x16f8c2,null));};exports['destroy']=function(_0x4b6efa,_0xad4abd){return db[_0xe775('0x2b')][_0xe775('0x4a')]({'where':{'id':_0x4b6efa['params']['id']}})['then'](handleEntityNotFound(_0xad4abd,null))['then'](removeEntity(_0xad4abd,null))['catch'](handleError(_0xad4abd,null));};exports['addAllCondition']=function(_0x16056e,_0x4286db,_0x895db6){if(_0x16056e['body']['id']){delete _0x16056e['body']['id'];}return db[_0xe775('0x2b')]['find']({'where':{'id':_0x16056e[_0xe775('0x4c')]['id']}})[_0xe775('0x22')](handleEntityNotFound(_0x4286db,null))[_0xe775('0x22')](function(_0x4b73ed){if(_0x4b73ed){_0x16056e[_0xe775('0x46')]['TriggerAllId']=_0x4b73ed['id'];return db[_0xe775('0x4d')]['create'](_0x16056e[_0xe775('0x46')]);}})[_0xe775('0x22')](respondWithResult(_0x4286db,null))[_0xe775('0x44')](handleError(_0x4286db,null));};exports['addAnyCondition']=function(_0x1d8111,_0x1860c1,_0x4b83dc){if(_0x1d8111[_0xe775('0x46')]['id']){delete _0x1d8111[_0xe775('0x46')]['id'];}return db[_0xe775('0x2b')]['find']({'where':{'id':_0x1d8111['params']['id']}})[_0xe775('0x22')](handleEntityNotFound(_0x1860c1,null))[_0xe775('0x22')](function(_0xc29c6f){if(_0xc29c6f){_0x1d8111[_0xe775('0x46')][_0xe775('0x4e')]=_0xc29c6f['id'];return db[_0xe775('0x4d')][_0xe775('0x45')](_0x1d8111['body']);}})[_0xe775('0x22')](respondWithResult(_0x1860c1,null))[_0xe775('0x44')](handleError(_0x1860c1,null));};exports[_0xe775('0x4f')]=function(_0x15cf3e,_0x390a3f,_0x3705a1){var _0x3586c6={};var _0x1ec979={};var _0x1c7087;var _0x57ffb2;return db[_0xe775('0x2b')][_0xe775('0x50')]({'where':{'id':_0x15cf3e[_0xe775('0x4c')]['id']}})[_0xe775('0x22')](handleEntityNotFound(_0x390a3f,null))[_0xe775('0x22')](function(_0x2c0247){if(_0x2c0247){_0x1c7087=_0x2c0247;_0x1ec979[_0xe775('0x30')]=_['keys'](db[_0xe775('0x4d')][_0xe775('0x2c')]);_0x1ec979[_0xe775('0x31')]=_[_0xe775('0x2e')](_0x15cf3e[_0xe775('0x31')]);_0x1ec979['filters']=_[_0xe775('0x33')](_0x1ec979[_0xe775('0x30')],_0x1ec979[_0xe775('0x31')]);_0x3586c6[_0xe775('0x32')]=_[_0xe775('0x33')](_0x1ec979['model'],qs[_0xe775('0x34')](_0x15cf3e['query'][_0xe775('0x34')]));_0x3586c6[_0xe775('0x32')]=_0x3586c6['attributes']['length']?_0x3586c6[_0xe775('0x32')]:_0x1ec979[_0xe775('0x30')];_0x3586c6['order']=qs[_0xe775('0x38')](_0x15cf3e[_0xe775('0x31')][_0xe775('0x38')]);_0x3586c6[_0xe775('0x3a')]=qs[_0xe775('0x2f')](_[_0xe775('0x51')](_0x15cf3e[_0xe775('0x31')],_0x1ec979['filters']));if(_0x15cf3e[_0xe775('0x31')][_0xe775('0x39')]){_0x3586c6[_0xe775('0x3a')]=_[_0xe775('0x3d')](_0x3586c6['where'],{'$or':_[_0xe775('0x2a')](_0x3586c6['attributes'],function(_0x48e5b3){var _0x14beef={};_0x14beef[_0x48e5b3]={'$like':'%'+_0x15cf3e[_0xe775('0x31')][_0xe775('0x39')]+'%'};return _0x14beef;})});}_0x3586c6=_['merge']({},_0x3586c6,_0x15cf3e[_0xe775('0x52')]);return _0x1c7087[_0xe775('0x4f')](_0x3586c6);}})['then'](function(_0x2bae13){if(_0x2bae13){_0x57ffb2=_0x2bae13[_0xe775('0x35')];if(!_0x15cf3e[_0xe775('0x31')]['hasOwnProperty'](_0xe775('0x53'))){_0x3586c6[_0xe775('0x1b')]=qs[_0xe775('0x1b')](_0x15cf3e['query'][_0xe775('0x1b')]);_0x3586c6[_0xe775('0x1a')]=qs['offset'](_0x15cf3e[_0xe775('0x31')][_0xe775('0x1a')]);}return _0x1c7087['getAllConditions'](_0x3586c6);}})[_0xe775('0x22')](function(_0x90b244){if(_0x90b244){return _0x90b244?{'count':_0x57ffb2,'rows':_0x90b244}:null;}})[_0xe775('0x22')](respondWithResult(_0x390a3f,null))[_0xe775('0x44')](handleError(_0x390a3f,null));};exports[_0xe775('0x54')]=function(_0x519d3a,_0x92cfd7,_0x36790d){var _0x5744f3={};var _0x3523e8={};var _0x3eac8f;var _0x3420ac;return db[_0xe775('0x2b')]['findOne']({'where':{'id':_0x519d3a[_0xe775('0x4c')]['id']}})['then'](handleEntityNotFound(_0x92cfd7,null))[_0xe775('0x22')](function(_0x19491f){if(_0x19491f){_0x3eac8f=_0x19491f;_0x3523e8[_0xe775('0x30')]=_[_0xe775('0x2e')](db[_0xe775('0x4d')][_0xe775('0x2c')]);_0x3523e8[_0xe775('0x31')]=_['keys'](_0x519d3a[_0xe775('0x31')]);_0x3523e8[_0xe775('0x2f')]=_[_0xe775('0x33')](_0x3523e8['model'],_0x3523e8[_0xe775('0x31')]);_0x5744f3[_0xe775('0x32')]=_[_0xe775('0x33')](_0x3523e8[_0xe775('0x30')],qs['fields'](_0x519d3a[_0xe775('0x31')][_0xe775('0x34')]));_0x5744f3[_0xe775('0x32')]=_0x5744f3[_0xe775('0x32')][_0xe775('0x35')]?_0x5744f3[_0xe775('0x32')]:_0x3523e8[_0xe775('0x30')];_0x5744f3[_0xe775('0x37')]=qs['sort'](_0x519d3a[_0xe775('0x31')][_0xe775('0x38')]);_0x5744f3[_0xe775('0x3a')]=qs[_0xe775('0x2f')](_['pick'](_0x519d3a[_0xe775('0x31')],_0x3523e8[_0xe775('0x2f')]));if(_0x519d3a[_0xe775('0x31')][_0xe775('0x39')]){_0x5744f3[_0xe775('0x3a')]=_['merge'](_0x5744f3[_0xe775('0x3a')],{'$or':_['map'](_0x5744f3['attributes'],function(_0x3c3392){var _0x2e9143={};_0x2e9143[_0x3c3392]={'$like':'%'+_0x519d3a['query']['filter']+'%'};return _0x2e9143;})});}_0x5744f3=_['merge']({},_0x5744f3,_0x519d3a[_0xe775('0x52')]);return _0x3eac8f[_0xe775('0x54')](_0x5744f3);}})['then'](function(_0x10d6c3){if(_0x10d6c3){_0x3420ac=_0x10d6c3[_0xe775('0x35')];if(!_0x519d3a[_0xe775('0x31')][_0xe775('0x36')](_0xe775('0x53'))){_0x5744f3['limit']=qs[_0xe775('0x1b')](_0x519d3a[_0xe775('0x31')]['limit']);_0x5744f3[_0xe775('0x1a')]=qs['offset'](_0x519d3a[_0xe775('0x31')][_0xe775('0x1a')]);}return _0x3eac8f[_0xe775('0x54')](_0x5744f3);}})['then'](function(_0x47783f){if(_0x47783f){return _0x47783f?{'count':_0x3420ac,'rows':_0x47783f}:null;}})[_0xe775('0x22')](respondWithResult(_0x92cfd7,null))[_0xe775('0x44')](handleError(_0x92cfd7,null));};exports[_0xe775('0x55')]=function(_0x3141b6,_0x3520ed,_0x4dbc77){if(_0x3141b6['body']['id']){delete _0x3141b6[_0xe775('0x46')]['id'];}return db['Trigger']['find']({'where':{'id':_0x3141b6[_0xe775('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3520ed,null))[_0xe775('0x22')](function(_0x5b459){if(_0x5b459){_0x3141b6[_0xe775('0x46')]['TriggerId']=_0x5b459['id'];return db['Action'][_0xe775('0x45')](_0x3141b6[_0xe775('0x46')]);}})[_0xe775('0x22')](respondWithResult(_0x3520ed,null))['catch'](handleError(_0x3520ed,null));};exports[_0xe775('0x56')]=function(_0x260a60,_0x42b581,_0x49b739){var _0x32262f={};var _0x1bc09f={};var _0x504dcd;var _0x53e6fe;return db[_0xe775('0x2b')][_0xe775('0x50')]({'where':{'id':_0x260a60[_0xe775('0x4c')]['id']}})[_0xe775('0x22')](handleEntityNotFound(_0x42b581,null))['then'](function(_0x510977){if(_0x510977){_0x504dcd=_0x510977;_0x1bc09f['model']=_[_0xe775('0x2e')](db[_0xe775('0x57')][_0xe775('0x2c')]);_0x1bc09f[_0xe775('0x31')]=_['keys'](_0x260a60[_0xe775('0x31')]);_0x1bc09f[_0xe775('0x2f')]=_[_0xe775('0x33')](_0x1bc09f[_0xe775('0x30')],_0x1bc09f[_0xe775('0x31')]);_0x32262f['attributes']=_[_0xe775('0x33')](_0x1bc09f[_0xe775('0x30')],qs[_0xe775('0x34')](_0x260a60[_0xe775('0x31')][_0xe775('0x34')]));_0x32262f[_0xe775('0x32')]=_0x32262f[_0xe775('0x32')][_0xe775('0x35')]?_0x32262f[_0xe775('0x32')]:_0x1bc09f[_0xe775('0x30')];_0x32262f[_0xe775('0x37')]=qs[_0xe775('0x38')](_0x260a60['query'][_0xe775('0x38')]);_0x32262f[_0xe775('0x3a')]=qs[_0xe775('0x2f')](_[_0xe775('0x51')](_0x260a60['query'],_0x1bc09f[_0xe775('0x2f')]));if(_0x260a60[_0xe775('0x31')][_0xe775('0x39')]){_0x32262f['where']=_[_0xe775('0x3d')](_0x32262f['where'],{'$or':_[_0xe775('0x2a')](_0x32262f[_0xe775('0x32')],function(_0x48de9d){var _0x51eb9a={};_0x51eb9a[_0x48de9d]={'$like':'%'+_0x260a60['query'][_0xe775('0x39')]+'%'};return _0x51eb9a;})});}_0x32262f=_[_0xe775('0x3d')]({},_0x32262f,_0x260a60['options']);return _0x504dcd[_0xe775('0x56')](_0x32262f);}})['then'](function(_0x921faa){if(_0x921faa){_0x53e6fe=_0x921faa[_0xe775('0x35')];if(!_0x260a60[_0xe775('0x31')]['hasOwnProperty']('nolimit')){_0x32262f[_0xe775('0x1b')]=qs[_0xe775('0x1b')](_0x260a60[_0xe775('0x31')][_0xe775('0x1b')]);_0x32262f[_0xe775('0x1a')]=qs[_0xe775('0x1a')](_0x260a60[_0xe775('0x31')][_0xe775('0x1a')]);}return _0x504dcd[_0xe775('0x56')](_0x32262f);}})[_0xe775('0x22')](function(_0x54545c){if(_0x54545c){return _0x54545c?{'count':_0x53e6fe,'rows':_0x54545c}:null;}})[_0xe775('0x22')](respondWithResult(_0x42b581,null))[_0xe775('0x44')](handleError(_0x42b581,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 6676489..81f0b93 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 _0x3854=['./trigger.attributes','exports','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x198dc5,_0x25dc86){var _0x22206f=function(_0x434d92){while(--_0x434d92){_0x198dc5['push'](_0x198dc5['shift']());}};_0x22206f(++_0x25dc86);}(_0x3854,0xb3));var _0x4385=function(_0x142046,_0x19f25e){_0x142046=_0x142046-0x0;var _0x5e3807=_0x3854[_0x142046];return _0x5e3807;};'use strict';var _=require(_0x4385('0x0'));var util=require(_0x4385('0x1'));var logger=require(_0x4385('0x2'))(_0x4385('0x3'));var moment=require('moment');var BPromise=require(_0x4385('0x4'));var rp=require(_0x4385('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4385('0x6'));var config=require(_0x4385('0x7'));var attributes=require(_0x4385('0x8'));module[_0x4385('0x9')]=function(_0x3bb9ed,_0x31d589){return _0x3bb9ed['define']('Trigger',attributes,{'tableName':_0x4385('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f47=['rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b1053,_0xc320c8){var _0xfd8754=function(_0x35ce0f){while(--_0x35ce0f){_0x5b1053['push'](_0x5b1053['shift']());}};_0xfd8754(++_0xc320c8);}(_0x7f47,0xa3));var _0x77f4=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x7f47[_0x580971];return _0x16d873;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x77f4('0x0'))(_0x77f4('0x1'));var moment=require(_0x77f4('0x2'));var BPromise=require(_0x77f4('0x3'));var rp=require(_0x77f4('0x4'));var fs=require('fs');var path=require(_0x77f4('0x5'));var rimraf=require(_0x77f4('0x6'));var config=require(_0x77f4('0x7'));var attributes=require(_0x77f4('0x8'));module[_0x77f4('0x9')]=function(_0x24440a,_0x57e226){return _0x24440a[_0x77f4('0xa')](_0x77f4('0xb'),attributes,{'tableName':_0x77f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index 677a3cb..2abe671 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 _0x13f6=['debug','stringify','error','code','message','info','result','GetTrigger','Trigger','findAll','options','limit','include','map','model','attributes','ShowTrigger','find','raw','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x408fa7,_0x303486){var _0x1bceea=function(_0x4641ca){while(--_0x4641ca){_0x408fa7['push'](_0x408fa7['shift']());}};_0x1bceea(++_0x303486);}(_0x13f6,0x124));var _0x613f=function(_0x28c4f5,_0x483592){_0x28c4f5=_0x28c4f5-0x0;var _0x296953=_0x13f6[_0x28c4f5];return _0x296953;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('Trigger,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('Trigger,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')]({'raw':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['where']||null:null,'attributes':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')]['attributes']||null:null,'limit':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')][_0x613f('0x19')]||null:null,'include':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x4f9dae[_0x613f('0x18')]['include'],function(_0x41104e){return{'model':db[_0x41104e[_0x613f('0x1c')]],'as':_0x41104e['as'],'attributes':_0x41104e[_0x613f('0x1d')],'include':_0x41104e[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x41104e['include'],function(_0x30fb15){return{'model':db[_0x30fb15[_0x613f('0x1c')]],'as':_0x30fb15['as'],'attributes':_0x30fb15['attributes'],'include':_0x30fb15[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x30fb15[_0x613f('0x1a')],function(_0x4a878d){return{'model':db[_0x4a878d['model']],'as':_0x4a878d['as'],'attributes':_0x4a878d['attributes']};}):[]};}):[]};}):[]:[]})[_0x613f('0xb')](function(_0x594c28){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x594c28));_0x1e5a11(_0x594c28);})['catch'](function(_0x4cff5d){logger['error'](_0x613f('0x15'),_0x4cff5d[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x4cff5d['message']));});});};exports[_0x613f('0x1e')]=function(_0x439478){var _0xd335a6=this;return new Promise(function(_0x19bb8f,_0x4f8500){return db[_0x613f('0x16')][_0x613f('0x1f')]({'raw':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')][_0x613f('0x20')]===undefined?!![]:![]:!![],'where':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x21')]||null:null,'attributes':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')]['attributes']||null:null,'include':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x439478[_0x613f('0x18')][_0x613f('0x1a')],function(_0x2bceaa){return{'model':db[_0x2bceaa[_0x613f('0x1c')]],'as':_0x2bceaa['as'],'attributes':_0x2bceaa['attributes'],'include':_0x2bceaa[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x2bceaa[_0x613f('0x1a')],function(_0x25b2e4){return{'model':db[_0x25b2e4[_0x613f('0x1c')]],'as':_0x25b2e4['as'],'attributes':_0x25b2e4['attributes'],'include':_0x25b2e4['include']?_['map'](_0x25b2e4[_0x613f('0x1a')],function(_0x72c804){return{'model':db[_0x72c804[_0x613f('0x1c')]],'as':_0x72c804['as'],'attributes':_0x72c804[_0x613f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fc02e){logger[_0x613f('0x13')]('ShowTrigger',_0x439478);logger[_0x613f('0xe')]('ShowTrigger',_0x439478,JSON[_0x613f('0xf')](_0x2fc02e));_0x19bb8f(_0x2fc02e);})['catch'](function(_0x36dfd4){logger['error'](_0x613f('0x1e'),_0x36dfd4[_0x613f('0x12')],_0x439478);_0x4f8500(_0xd335a6[_0x613f('0x10')](0x1f4,_0x36dfd4['message']));});});}; \ No newline at end of file +var _0xb03e=['raw','where','attributes','limit','include','map','model','then','ShowTrigger','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Trigger,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options'];(function(_0x38c6e5,_0x2abade){var _0x4b8307=function(_0x21b98b){while(--_0x21b98b){_0x38c6e5['push'](_0x38c6e5['shift']());}};_0x4b8307(++_0x2abade);}(_0xb03e,0x1eb));var _0xeb03=function(_0xb89589,_0x3d0afd){_0xb89589=_0xb89589-0x0;var _0x202520=_0xb03e[_0xb89589];return _0x202520;};'use strict';var _=require('lodash');var util=require(_0xeb03('0x0'));var moment=require(_0xeb03('0x1'));var BPromise=require(_0xeb03('0x2'));var rs=require(_0xeb03('0x3'));var fs=require('fs');var Redis=require(_0xeb03('0x4'));var db=require(_0xeb03('0x5'))['db'];var utils=require(_0xeb03('0x6'));var logger=require(_0xeb03('0x7'))(_0xeb03('0x8'));var config=require(_0xeb03('0x9'));var jayson=require(_0xeb03('0xa'));var client=jayson[_0xeb03('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b58a2,_0x3d3322,_0x3a6e31){return new BPromise(function(_0x246c6e,_0x3f2c74){return client[_0xeb03('0xc')](_0x3b58a2,_0x3a6e31)['then'](function(_0x403b77){logger[_0xeb03('0xd')](_0xeb03('0xe'),_0x3d3322,'request\x20sent');logger[_0xeb03('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x3d3322,_0xeb03('0x10'),JSON[_0xeb03('0x11')](_0x403b77));if(_0x403b77[_0xeb03('0x12')]){if(_0x403b77[_0xeb03('0x12')][_0xeb03('0x13')]===0x1f4){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x3f2c74(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}logger[_0xeb03('0x12')]('Trigger,\x20%s,\x20%s',_0x3d3322,_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);return _0x246c6e(_0x403b77[_0xeb03('0x12')][_0xeb03('0x14')]);}else{logger['info'](_0xeb03('0xe'),_0x3d3322,_0xeb03('0x10'));_0x246c6e(_0x403b77[_0xeb03('0x15')]['message']);}})[_0xeb03('0x16')](function(_0x46dd1b){logger[_0xeb03('0x12')](_0xeb03('0xe'),_0x3d3322,_0x46dd1b);_0x3f2c74(_0x46dd1b);});});}exports[_0xeb03('0x17')]=function(_0x1b4cbd){var _0x167a33=this;return new Promise(function(_0x8d6725,_0x177f9c){return db[_0xeb03('0x18')][_0xeb03('0x19')]({'raw':_0x1b4cbd[_0xeb03('0x1a')]?_0x1b4cbd[_0xeb03('0x1a')][_0xeb03('0x1b')]===undefined?!![]:![]:!![],'where':_0x1b4cbd['options']?_0x1b4cbd[_0xeb03('0x1a')][_0xeb03('0x1c')]||null:null,'attributes':_0x1b4cbd[_0xeb03('0x1a')]?_0x1b4cbd[_0xeb03('0x1a')][_0xeb03('0x1d')]||null:null,'limit':_0x1b4cbd[_0xeb03('0x1a')]?_0x1b4cbd[_0xeb03('0x1a')][_0xeb03('0x1e')]||null:null,'include':_0x1b4cbd[_0xeb03('0x1a')]?_0x1b4cbd['options'][_0xeb03('0x1f')]?_[_0xeb03('0x20')](_0x1b4cbd[_0xeb03('0x1a')][_0xeb03('0x1f')],function(_0x2f99e6){return{'model':db[_0x2f99e6['model']],'as':_0x2f99e6['as'],'attributes':_0x2f99e6[_0xeb03('0x1d')],'include':_0x2f99e6[_0xeb03('0x1f')]?_[_0xeb03('0x20')](_0x2f99e6[_0xeb03('0x1f')],function(_0x3f276a){return{'model':db[_0x3f276a[_0xeb03('0x21')]],'as':_0x3f276a['as'],'attributes':_0x3f276a[_0xeb03('0x1d')],'include':_0x3f276a[_0xeb03('0x1f')]?_[_0xeb03('0x20')](_0x3f276a['include'],function(_0x832372){return{'model':db[_0x832372[_0xeb03('0x21')]],'as':_0x832372['as'],'attributes':_0x832372[_0xeb03('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb03('0x22')](function(_0x4cdea6){logger['info'](_0xeb03('0x17'),_0x1b4cbd);logger['debug'](_0xeb03('0x17'),_0x1b4cbd,JSON[_0xeb03('0x11')](_0x4cdea6));_0x8d6725(_0x4cdea6);})[_0xeb03('0x16')](function(_0x5db8bb){logger[_0xeb03('0x12')]('GetTrigger',_0x5db8bb['message'],_0x1b4cbd);_0x177f9c(_0x167a33['error'](0x1f4,_0x5db8bb['message']));});});};exports[_0xeb03('0x23')]=function(_0x433ce8){var _0x5d0cc1=this;return new Promise(function(_0x528479,_0x4d830a){return db['Trigger'][_0xeb03('0x24')]({'raw':_0x433ce8[_0xeb03('0x1a')]?_0x433ce8[_0xeb03('0x1a')][_0xeb03('0x1b')]===undefined?!![]:![]:!![],'where':_0x433ce8[_0xeb03('0x1a')]?_0x433ce8['options'][_0xeb03('0x1c')]||null:null,'attributes':_0x433ce8['options']?_0x433ce8[_0xeb03('0x1a')][_0xeb03('0x1d')]||null:null,'include':_0x433ce8[_0xeb03('0x1a')]?_0x433ce8[_0xeb03('0x1a')][_0xeb03('0x1f')]?_[_0xeb03('0x20')](_0x433ce8[_0xeb03('0x1a')][_0xeb03('0x1f')],function(_0x552c86){return{'model':db[_0x552c86[_0xeb03('0x21')]],'as':_0x552c86['as'],'attributes':_0x552c86['attributes'],'include':_0x552c86[_0xeb03('0x1f')]?_[_0xeb03('0x20')](_0x552c86[_0xeb03('0x1f')],function(_0x2bf8be){return{'model':db[_0x2bf8be[_0xeb03('0x21')]],'as':_0x2bf8be['as'],'attributes':_0x2bf8be[_0xeb03('0x1d')],'include':_0x2bf8be['include']?_[_0xeb03('0x20')](_0x2bf8be['include'],function(_0x585cb5){return{'model':db[_0x585cb5['model']],'as':_0x585cb5['as'],'attributes':_0x585cb5[_0xeb03('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xeb03('0x22')](function(_0x1bb6bb){logger[_0xeb03('0xd')](_0xeb03('0x23'),_0x433ce8);logger['debug'](_0xeb03('0x23'),_0x433ce8,JSON[_0xeb03('0x11')](_0x1bb6bb));_0x528479(_0x1bb6bb);})[_0xeb03('0x16')](function(_0x51a4ba){logger['error'](_0xeb03('0x23'),_0x51a4ba[_0xeb03('0x14')],_0x433ce8);_0x4d830a(_0x5d0cc1[_0xeb03('0x12')](0x1f4,_0x51a4ba['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 1033b4a..f163278 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 _0xa630=['index','/:id','show','post','/:id/clone','create','put','update','delete','exports','multer','util','express','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa630,0xbe));var _0x0a63=function(_0x41925c,_0x1cebae){_0x41925c=_0x41925c-0x0;var _0x2b4a47=_0xa630[_0x41925c];return _0x2b4a47;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var auth=require(_0x0a63('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a63('0x4'));var controller=require(_0x0a63('0x5'));router[_0x0a63('0x6')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0x8')]);router['get'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xa')]);router[_0x0a63('0xb')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller['clone']);router[_0x0a63('0xb')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0xd')]);router[_0x0a63('0xe')](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xf')]);router[_0x0a63('0x10')](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller['destroy']);module[_0x0a63('0x11')]=router; \ No newline at end of file +var _0xa41a=['../../config/environment','./trunk.controller','get','index','show','post','isAuthenticated','clone','create','put','/:id','update','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x274700,_0x2338c5){var _0x47128c=function(_0x575c23){while(--_0x575c23){_0x274700['push'](_0x274700['shift']());}};_0x47128c(++_0x2338c5);}(_0xa41a,0x6b));var _0xaa41=function(_0x25cf0e,_0x23ab45){_0x25cf0e=_0x25cf0e-0x0;var _0x1e4a1e=_0xa41a[_0x25cf0e];return _0x1e4a1e;};'use strict';var multer=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var path=require('path');var timeout=require(_0xaa41('0x2'));var express=require(_0xaa41('0x3'));var router=express[_0xaa41('0x4')]();var auth=require(_0xaa41('0x5'));var interaction=require(_0xaa41('0x6'));var config=require(_0xaa41('0x7'));var controller=require(_0xaa41('0x8'));router[_0xaa41('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa41('0xa')]);router[_0xaa41('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xaa41('0xb')]);router[_0xaa41('0xc')]('/:id/clone',auth[_0xaa41('0xd')](),controller[_0xaa41('0xe')]);router[_0xaa41('0xc')]('/',auth[_0xaa41('0xd')](),controller[_0xaa41('0xf')]);router[_0xaa41('0x10')](_0xaa41('0x11'),auth[_0xaa41('0xd')](),controller[_0xaa41('0x12')]);router['delete'](_0xaa41('0x11'),auth[_0xaa41('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4a2526c..3ec7ea3 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 _0x978c=['uas','pai','fingerprint','active','passive','actpass','update,nonat','sequelize','exports','name','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','info','shortinfo','rfc2833','yes','nonat','update','force_rport,comedia','setDataValue','nat','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac'];(function(_0x48d5d8,_0x169804){var _0x3dcbcd=function(_0x32b472){while(--_0x32b472){_0x48d5d8['push'](_0x48d5d8['shift']());}};_0x3dcbcd(++_0x169804);}(_0x978c,0x12d));var _0xc978=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x978c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc978('0x0'));module[_0xc978('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc978('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xc978('0x3'),_0xc978('0x4'),'peer'),'allowNull':![],'defaultValue':_0xc978('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc978('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xc978('0x6'),'ALLOWED_PASSED_SCREEN',_0xc978('0x7'),_0xc978('0x8'),'PROHIB_NOT_SCREENED',_0xc978('0x9'),_0xc978('0xa'),_0xc978('0xb'))},'deny':{'type':Sequelize[_0xc978('0xc')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xc978('0xc')]},'transport':{'type':Sequelize[_0xc978('0xc')],'defaultValue':_0xc978('0xd'),'set':function(_0x1aa89b){this['setDataValue'](_0xc978('0xe'),_0x1aa89b?_0x1aa89b[_0xc978('0xf')](','):null);},'get':function(){return this[_0xc978('0x10')](_0xc978('0xe'))?this['getDataValue'](_0xc978('0xe'))[_0xc978('0x11')](','):null;},'comment':_0xc978('0x12')},'dtmfmode':{'type':Sequelize[_0xc978('0x13')]('rfc2833',_0xc978('0x14'),_0xc978('0x15'),'inband','auto'),'defaultValue':_0xc978('0x16')},'directmedia':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no',_0xc978('0x18'),_0xc978('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc978('0xc')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xc978('0xc')],'defaultValue':_0xc978('0x1a'),'set':function(_0x531d23){this[_0xc978('0x1b')](_0xc978('0x1c'),_0x531d23?_0x531d23[_0xc978('0xf')](','):null);},'get':function(){return this[_0xc978('0x10')]('nat')?this[_0xc978('0x10')](_0xc978('0x1c'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xc978('0xc')]},'namedcallgroup':{'type':Sequelize[_0xc978('0xc')]},'pickupgroup':{'type':Sequelize[_0xc978('0xc')]},'namedpickupgroup':{'type':Sequelize[_0xc978('0xc')]},'language':{'type':Sequelize[_0xc978('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc978('0xc')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xc978('0x1d')},'allow':{'type':Sequelize[_0xc978('0xc')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x196b6f){this[_0xc978('0x1b')]('allow',_0x196b6f?_0x196b6f['join'](';'):_0xc978('0x1e'));},'get':function(){return this[_0xc978('0x10')](_0xc978('0x1f'))?this[_0xc978('0x10')](_0xc978('0x1f'))[_0xc978('0x11')](';'):null;},'comment':_0xc978('0x20')},'autoframing':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'insecure':{'type':Sequelize[_0xc978('0xc')],'defaultValue':_0xc978('0x21'),'set':function(_0xff0347){this[_0xc978('0x1b')]('insecure',_0xff0347?_0xff0347[_0xc978('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xc978('0x22'))?this[_0xc978('0x10')](_0xc978('0x22'))[_0xc978('0x11')](','):null;},'comment':_0xc978('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no','never')},'promiscredir':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'accountcode':{'type':Sequelize[_0xc978('0x24')](0xb)},'setvar':{'type':Sequelize[_0xc978('0xc')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xc978('0x25')},'amaflags':{'type':Sequelize[_0xc978('0xc')]},'callcounter':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no'),'defaultValue':_0xc978('0x17')},'busylevel':{'type':Sequelize[_0xc978('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xc978('0x13')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xc978('0xc')]},'template':{'type':Sequelize[_0xc978('0xc')]},'videosupport':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no',_0xc978('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc978('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'mailbox':{'type':Sequelize[_0xc978('0xc')]},'session_timers':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x27'),_0xc978('0x28'),'originate')},'session_expires':{'type':Sequelize[_0xc978('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x29'),_0xc978('0x2a')),'defaultValue':_0xc978('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xc978('0xc')]},'fromdomain':{'type':Sequelize[_0xc978('0xc')]},'fromuser':{'type':Sequelize[_0xc978('0xc')]},'port':{'type':Sequelize[_0xc978('0x24')](0x5)},'qualify':{'type':Sequelize[_0xc978('0x13')]('yes','no'),'defaultValue':_0xc978('0x17')},'keepalive':{'type':Sequelize[_0xc978('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xc978('0xc')]},'defaultuser':{'type':Sequelize[_0xc978('0xc')]},'rtptimeout':{'type':Sequelize[_0xc978('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc978('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xc978('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc978('0xc')]},'callbackextension':{'type':Sequelize[_0xc978('0xc')]},'timert1':{'type':Sequelize[_0xc978('0x24')](0xb)},'timerb':{'type':Sequelize[_0xc978('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xc978('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xc978('0xc')]},'contactacl':{'type':Sequelize[_0xc978('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0xc978('0xc')]},'use_q850_reason':{'type':Sequelize[_0xc978('0xc')]},'maxforwards':{'type':Sequelize[_0xc978('0x24')](0xb)},'encryption':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no',_0xc978('0x2c'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xc978('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc978('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0xc978('0xc')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x2d'),_0xc978('0x2e'),_0xc978('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc978('0xc')]},'usereqphone':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc978('0xc')]},'recordofffeature':{'type':Sequelize[_0xc978('0xc')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xc978('0xc')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xc978('0xc')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc978('0xc')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no',_0xc978('0x18'),'update',_0xc978('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xc978('0xc')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc978('0xc')],'defaultValue':'no'}}; \ No newline at end of file +var _0xa420=['split','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','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','accept','originate','uac','uas','pai','fingerprint','certificate','actpass','dynamic','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','getDataValue','transport'];(function(_0x4e3b9c,_0x4d76a3){var _0x358b13=function(_0x2409d6){while(--_0x2409d6){_0x4e3b9c['push'](_0x4e3b9c['shift']());}};_0x358b13(++_0x4d76a3);}(_0xa420,0x80));var _0x0a42=function(_0x435ec1,_0x4304c3){_0x435ec1=_0x435ec1-0x0;var _0x4186b2=_0xa420[_0x435ec1];return _0x4186b2;};'use strict';var Sequelize=require(_0x0a42('0x0'));module[_0x0a42('0x1')]={'name':{'type':Sequelize[_0x0a42('0x2')],'allowNull':![],'unique':_0x0a42('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x5'),_0x0a42('0x6'),'peer'),'allowNull':![],'defaultValue':_0x0a42('0x5')},'context':{'type':Sequelize[_0x0a42('0x2')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x7'),_0x0a42('0x8'),_0x0a42('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0x0a42('0xa'),_0x0a42('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x0a42('0x2')]},'permit':{'type':Sequelize[_0x0a42('0x2')]},'secret':{'type':Sequelize[_0x0a42('0x2')]},'md5secret':{'type':Sequelize[_0x0a42('0x2')]},'remotesecret':{'type':Sequelize[_0x0a42('0x2')]},'transport':{'type':Sequelize[_0x0a42('0x2')],'defaultValue':_0x0a42('0xc'),'set':function(_0x3e340c){this['setDataValue']('transport',_0x3e340c?_0x3e340c[_0x0a42('0xd')](','):null);},'get':function(){return this[_0x0a42('0xe')](_0x0a42('0xf'))?this[_0x0a42('0xe')](_0x0a42('0xf'))[_0x0a42('0x10')](','):null;},'comment':_0x0a42('0x11')},'dtmfmode':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x12'),_0x0a42('0x13'),_0x0a42('0x14'),_0x0a42('0x15'),_0x0a42('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x0a42('0x17'),'no','nonat',_0x0a42('0x18'),_0x0a42('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a42('0x2')]},'directmediadeny':{'type':Sequelize[_0x0a42('0x2')]},'nat':{'type':Sequelize[_0x0a42('0x2')],'defaultValue':_0x0a42('0x1a'),'set':function(_0x5cadcf){this[_0x0a42('0x1b')](_0x0a42('0x1c'),_0x5cadcf?_0x5cadcf[_0x0a42('0xd')](','):null);},'get':function(){return this[_0x0a42('0xe')](_0x0a42('0x1c'))?this[_0x0a42('0xe')](_0x0a42('0x1c'))[_0x0a42('0x10')](','):null;},'comment':_0x0a42('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0a42('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x0a42('0x2')]},'language':{'type':Sequelize[_0x0a42('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a42('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x0a42('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x1e884c){this[_0x0a42('0x1b')](_0x0a42('0x1e'),_0x1e884c?_0x1e884c[_0x0a42('0xd')](';'):_0x0a42('0x1f'));},'get':function(){return this[_0x0a42('0xe')](_0x0a42('0x1e'))?this[_0x0a42('0xe')]('allow')['split'](';'):null;},'comment':_0x0a42('0x20')},'autoframing':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x0a42('0x21'),'set':function(_0x559936){this['setDataValue'](_0x0a42('0x22'),_0x559936?_0x559936[_0x0a42('0xd')](','):null);},'get':function(){return this[_0x0a42('0xe')](_0x0a42('0x22'))?this['getDataValue'](_0x0a42('0x22'))[_0x0a42('0x10')](','):null;},'comment':_0x0a42('0x23')},'trustrpid':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a42('0x4')]('yes','no','never')},'promiscredir':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'accountcode':{'type':Sequelize[_0x0a42('0x24')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x0a42('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no'),'defaultValue':_0x0a42('0x17')},'busylevel':{'type':Sequelize[_0x0a42('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x0a42('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0a42('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x0a42('0x2')]},'template':{'type':Sequelize[_0x0a42('0x2')]},'videosupport':{'type':Sequelize[_0x0a42('0x4')]('yes','no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a42('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'mailbox':{'type':Sequelize[_0x0a42('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x0a42('0x26'),'refuse',_0x0a42('0x27'))},'session_expires':{'type':Sequelize[_0x0a42('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x0a42('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x28'),_0x0a42('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0x0a42('0x2')]},'fromdomain':{'type':Sequelize[_0x0a42('0x2')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0a42('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x0a42('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x0a42('0x2')]},'rtptimeout':{'type':Sequelize[_0x0a42('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0a42('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0a42('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no',_0x0a42('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a42('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x0a42('0x24')](0xb)},'timerb':{'type':Sequelize[_0x0a42('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x0a42('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x0a42('0x2')]},'contactdeny':{'type':Sequelize[_0x0a42('0x2')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x0a42('0x2')]},'use_q850_reason':{'type':Sequelize[_0x0a42('0x2')]},'maxforwards':{'type':Sequelize[_0x0a42('0x24')](0xb)},'encryption':{'type':Sequelize[_0x0a42('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0x0a42('0x17'),'no')},'icesupport':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a42('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no',_0x0a42('0x2b'),_0x0a42('0x2c'))},'dtlsrekey':{'type':Sequelize[_0x0a42('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0a42('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x0a42('0x2')]},'dtlscafile':{'type':Sequelize[_0x0a42('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize['ENUM']('active','passive',_0x0a42('0x2d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a42('0x2')]},'usereqphone':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0a42('0x2')]},'recordofffeature':{'type':Sequelize[_0x0a42('0x2')]},'call_limit':{'type':Sequelize[_0x0a42('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x0a42('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x0a42('0x2')]},'mohsuggest':{'type':Sequelize[_0x0a42('0x2')]},'parkinglot':{'type':Sequelize[_0x0a42('0x2')]},'description':{'type':Sequelize[_0x0a42('0x2')]},'host':{'type':Sequelize[_0x0a42('0x2')],'defaultValue':_0x0a42('0x2e')},'canreinvite':{'type':Sequelize[_0x0a42('0x4')](_0x0a42('0x17'),'no','nonat',_0x0a42('0x18'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x0a42('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0a42('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 1e1c3f7..cbf87b6 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 _0x7caf=['utf8','join','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','keys','find','clone','params','options','createdAt','body','omit','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','readFileSync','root','server/files/templates/trunk.ejs'];(function(_0x169d7c,_0x343edc){var _0x20db78=function(_0xa5eee8){while(--_0xa5eee8){_0x169d7c['push'](_0x169d7c['shift']());}};_0x20db78(++_0x343edc);}(_0x7caf,0x154));var _0xf7ca=function(_0x1e6234,_0x912787){_0x1e6234=_0x1e6234-0x0;var _0x54090d=_0x7caf[_0x1e6234];return _0x54090d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf7ca('0x0'));var rimraf=require(_0xf7ca('0x1'));var zipdir=require(_0xf7ca('0x2'));var jsonpatch=require(_0xf7ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf7ca('0x4'));var Mustache=require(_0xf7ca('0x5'));var util=require(_0xf7ca('0x6'));var path=require('path');var sox=require(_0xf7ca('0x7'));var csv=require(_0xf7ca('0x8'));var ejs=require(_0xf7ca('0x9'));var fs=require('fs');var _=require(_0xf7ca('0xa'));var squel=require(_0xf7ca('0xb'));var crypto=require(_0xf7ca('0xc'));var jsforce=require(_0xf7ca('0xd'));var deskjs=require(_0xf7ca('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf7ca('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf7ca('0x10'));var as=require(_0xf7ca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7ca('0x12'))(_0xf7ca('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf7ca('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf7ca('0x15')]({'port':0x232a});function checkPasswordPattern(_0x5395f2,_0x4d29ba,_0x45bdaa){if(_0x45bdaa){var _0x35d5a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35d5a8['test'](_0x4d29ba)){return _0x5395f2;}else{throw new db[(_0xf7ca('0x16'))]['ValidationError'](_0xf7ca('0x17'));}}else{return _0x5395f2;}}function respondWithRpcPromise(_0x526f7d,_0x274c59,_0x162f63,_0xebe980){return new BPromise(function(_0x312b83,_0x4c9d03){var _0x1d7100=_0xebe980||client;return _0x1d7100[_0xf7ca('0x18')](_0x526f7d,_0x162f63)['then'](function(_0x1a6572){logger[_0xf7ca('0x19')](_0xf7ca('0x1a'),_0x274c59,_0xf7ca('0x1b'));logger['debug'](_0xf7ca('0x1c'),_0x274c59,'request\x20sent',JSON[_0xf7ca('0x1d')](_0x1a6572));if(_0x1a6572[_0xf7ca('0x1e')]){if(_0x1a6572[_0xf7ca('0x1e')]['code']===0x1f4){logger[_0xf7ca('0x1e')](_0xf7ca('0x1a'),_0x274c59,_0x1a6572[_0xf7ca('0x1e')][_0xf7ca('0x1f')]);return _0x4c9d03(_0x1a6572['error'][_0xf7ca('0x1f')]);}logger[_0xf7ca('0x1e')](_0xf7ca('0x1a'),_0x274c59,_0x1a6572['error'][_0xf7ca('0x1f')]);return _0x312b83(_0x1a6572[_0xf7ca('0x1e')][_0xf7ca('0x1f')]);}else{logger[_0xf7ca('0x19')]('Trunk,\x20%s,\x20%s',_0x274c59,_0xf7ca('0x1b'));_0x312b83(_0x1a6572[_0xf7ca('0x20')][_0xf7ca('0x1f')]);}})[_0xf7ca('0x21')](function(_0x50e921){logger['error'](_0xf7ca('0x1a'),_0x274c59,_0x50e921);_0x4c9d03(_0x50e921);});});}function respondWithStatusCode(_0x5021b0,_0x48a717){_0x48a717=_0x48a717||0xcc;return function(_0x486417){if(_0x486417){return _0x5021b0[_0xf7ca('0x22')](_0x48a717);}return _0x5021b0[_0xf7ca('0x23')](_0x48a717)[_0xf7ca('0x24')]();};}function respondWithResult(_0x443419,_0x427360){_0x427360=_0x427360||0xc8;return function(_0x469a06){if(_0x469a06){return _0x443419[_0xf7ca('0x23')](_0x427360)[_0xf7ca('0x25')](_0x469a06);}};}function respondWithFilteredResult(_0x5d6e2a,_0x1ae297){return function(_0x4ceecb){if(_0x4ceecb){var _0x54470d=_0x4ceecb[_0xf7ca('0x26')],_0x4cfe74=_0x1ae297[_0xf7ca('0x27')],_0xe3285b=_0x1ae297['offset']+_0x1ae297['limit'],_0x91e97d;if(_0xe3285b>=_0x54470d){_0xe3285b=_0x54470d;_0x91e97d=0xc8;}else{_0x91e97d=0xce;}_0x5d6e2a[_0xf7ca('0x23')](_0x91e97d);return _0x5d6e2a[_0xf7ca('0x28')](_0xf7ca('0x29'),_0x4cfe74+'-'+_0xe3285b+'/'+_0x54470d)[_0xf7ca('0x25')](_0x4ceecb);}return null;};}function patchUpdates(_0x1515d7){return function(_0x54682e){try{jsonpatch[_0xf7ca('0x2a')](_0x54682e,_0x1515d7,!![]);}catch(_0x2f47bb){return BPromise[_0xf7ca('0x2b')](_0x2f47bb);}return _0x54682e['save']();};}function saveUpdates(_0xbc186b,_0x4f4b4f){return function(_0x27e6d2){if(_0x27e6d2){return _0x27e6d2[_0xf7ca('0x2c')](_0xbc186b)[_0xf7ca('0x2d')](function(_0x17040e){return _0x17040e;});}return null;};}function removeEntity(_0x5ee6de,_0x4778b8){return function(_0x4c41c2){if(_0x4c41c2){return _0x4c41c2[_0xf7ca('0x2e')]()['then'](function(){var _0x3e3887=_0x4c41c2[_0xf7ca('0x2f')]({'plain':!![]});var _0x35acd0=_0xf7ca('0x30');return db[_0xf7ca('0x31')][_0xf7ca('0x2e')]({'where':{'type':_0x35acd0,'resourceId':_0x3e3887['id']}})['then'](function(){return _0x4c41c2;});})[_0xf7ca('0x2d')](function(){_0x5ee6de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32dcc4,_0x25606e){return function(_0x1de930){if(!_0x1de930){_0x32dcc4[_0xf7ca('0x22')](0x194);}return _0x1de930;};}function handleError(_0x57a113,_0x34c43d){_0x34c43d=_0x34c43d||0x1f4;return function(_0xf68200){logger[_0xf7ca('0x1e')](_0xf68200[_0xf7ca('0x32')]);if(_0xf68200[_0xf7ca('0x33')]){delete _0xf68200[_0xf7ca('0x33')];}_0x57a113[_0xf7ca('0x23')](_0x34c43d)[_0xf7ca('0x34')](_0xf68200);};}exports[_0xf7ca('0x35')]=function(_0x5916ef,_0x25c40b){var _0x2cd1e6={},_0x2eb719={},_0x227fdd={'count':0x0,'rows':[]};var _0x43dea5=_[_0xf7ca('0x36')](db[_0xf7ca('0x37')][_0xf7ca('0x38')],function(_0x2a8fdd){return{'name':_0x2a8fdd[_0xf7ca('0x39')],'type':_0x2a8fdd['type'][_0xf7ca('0x3a')]};});_0x2eb719[_0xf7ca('0x3b')]=_[_0xf7ca('0x36')](_0x43dea5,_0xf7ca('0x33'));_0x2eb719[_0xf7ca('0x3c')]=_['keys'](_0x5916ef[_0xf7ca('0x3c')]);_0x2eb719[_0xf7ca('0x3d')]=_[_0xf7ca('0x3e')](_0x2eb719[_0xf7ca('0x3b')],_0x2eb719[_0xf7ca('0x3c')]);_0x2cd1e6[_0xf7ca('0x3f')]=_['intersection'](_0x2eb719['model'],qs[_0xf7ca('0x40')](_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x40')]));_0x2cd1e6[_0xf7ca('0x3f')]=_0x2cd1e6[_0xf7ca('0x3f')][_0xf7ca('0x41')]?_0x2cd1e6[_0xf7ca('0x3f')]:_0x2eb719[_0xf7ca('0x3b')];if(!_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x42')](_0xf7ca('0x43'))){_0x2cd1e6[_0xf7ca('0x44')]=qs['limit'](_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x44')]);_0x2cd1e6['offset']=qs[_0xf7ca('0x27')](_0x5916ef[_0xf7ca('0x3c')]['offset']);}_0x2cd1e6[_0xf7ca('0x45')]=qs[_0xf7ca('0x46')](_0x5916ef[_0xf7ca('0x3c')]['sort']);_0x2cd1e6[_0xf7ca('0x47')]=qs[_0xf7ca('0x3d')](_[_0xf7ca('0x48')](_0x5916ef[_0xf7ca('0x3c')],_0x2eb719[_0xf7ca('0x3d')]));if(_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x49')]){_0x2cd1e6[_0xf7ca('0x47')]=_['merge'](_0x2cd1e6[_0xf7ca('0x47')],{'$or':_[_0xf7ca('0x36')](_0x43dea5,function(_0x4e8b12){if(_0x4e8b12[_0xf7ca('0x4a')]!==_0xf7ca('0x4b')){var _0x98c95e={};_0x98c95e[_0x4e8b12[_0xf7ca('0x33')]]={'$like':'%'+_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x49')]+'%'};return _0x98c95e;}})});}_0x2cd1e6=_[_0xf7ca('0x4c')]({},_0x2cd1e6,_0x5916ef['options']);var _0x368312={'where':_0x2cd1e6['where']};return db[_0xf7ca('0x37')][_0xf7ca('0x26')](_0x368312)[_0xf7ca('0x2d')](function(_0x2e2717){_0x227fdd[_0xf7ca('0x26')]=_0x2e2717;if(_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x4d')]){_0x2cd1e6[_0xf7ca('0x4e')]=[{'all':!![]}];}return db[_0xf7ca('0x37')][_0xf7ca('0x4f')](_0x2cd1e6);})['then'](function(_0x33502e){_0x227fdd[_0xf7ca('0x50')]=_0x33502e;return _0x227fdd;})[_0xf7ca('0x2d')](respondWithFilteredResult(_0x25c40b,_0x2cd1e6))[_0xf7ca('0x21')](handleError(_0x25c40b,null));};exports[_0xf7ca('0x51')]=function(_0x382fda,_0x43a9e7){var _0x5d34c2={'raw':![],'where':{'id':_0x382fda['params']['id']}},_0x2e254d={};_0x2e254d['model']=_[_0xf7ca('0x52')](db[_0xf7ca('0x37')][_0xf7ca('0x38')]);_0x2e254d['query']=_[_0xf7ca('0x52')](_0x382fda[_0xf7ca('0x3c')]);_0x2e254d[_0xf7ca('0x3d')]=_['intersection'](_0x2e254d[_0xf7ca('0x3b')],_0x2e254d[_0xf7ca('0x3c')]);_0x5d34c2['attributes']=_['intersection'](_0x2e254d[_0xf7ca('0x3b')],qs['fields'](_0x382fda[_0xf7ca('0x3c')][_0xf7ca('0x40')]));_0x5d34c2[_0xf7ca('0x3f')]=_0x5d34c2[_0xf7ca('0x3f')][_0xf7ca('0x41')]?_0x5d34c2[_0xf7ca('0x3f')]:_0x2e254d[_0xf7ca('0x3b')];if(_0x382fda[_0xf7ca('0x3c')]['includeAll']){_0x5d34c2[_0xf7ca('0x4e')]=[{'all':!![]}];}_0x5d34c2=_[_0xf7ca('0x4c')]({},_0x5d34c2,_0x382fda['options']);return db[_0xf7ca('0x37')][_0xf7ca('0x53')](_0x5d34c2)[_0xf7ca('0x2d')](handleEntityNotFound(_0x43a9e7,null))[_0xf7ca('0x2d')](respondWithResult(_0x43a9e7,null))[_0xf7ca('0x21')](handleError(_0x43a9e7,null));};exports[_0xf7ca('0x54')]=function(_0x140809,_0x381273){var _0x56582d={'where':{'id':_0x140809[_0xf7ca('0x55')]['id']}},_0x23fd21={};_0x23fd21[_0xf7ca('0x3b')]=_[_0xf7ca('0x52')](db[_0xf7ca('0x37')][_0xf7ca('0x38')]);_0x56582d['attributes']=_[_0xf7ca('0x3e')](_0x23fd21[_0xf7ca('0x3b')],qs['fields'](_0x140809[_0xf7ca('0x3c')][_0xf7ca('0x40')]));_0x56582d[_0xf7ca('0x3f')]=_0x56582d['attributes'][_0xf7ca('0x41')]?_0x56582d[_0xf7ca('0x3f')]:_0x23fd21[_0xf7ca('0x3b')];if(_0x140809['query'][_0xf7ca('0x4d')]){_0x56582d[_0xf7ca('0x4e')]=[{'all':!![]}];}_0x56582d=_['merge']({},_0x56582d,_0x140809[_0xf7ca('0x56')]);return db[_0xf7ca('0x37')][_0xf7ca('0x53')](_0x56582d)['then'](handleEntityNotFound(_0x381273,null))[_0xf7ca('0x2d')](function(_0x96a5cb){if(_0x96a5cb){var _0x512d38=_0x96a5cb[_0xf7ca('0x2f')]({'plain':!![]});_0x512d38=qs['omit'](_0x512d38,['id',_0xf7ca('0x57'),'updatedAt']);_0x140809[_0xf7ca('0x58')]=_[_0xf7ca('0x59')](_0x140809[_0xf7ca('0x58')],['id',_0xf7ca('0x57'),'updatedAt']);return db[_0xf7ca('0x37')]['create'](_[_0xf7ca('0x4c')](_0x512d38,_0x140809[_0xf7ca('0x58')]),{'include':_0x140809[_0xf7ca('0x3c')][_0xf7ca('0x4d')]?[{'all':!![]}]:undefined})[_0xf7ca('0x2d')](function(_0x3e6436){var _0x4a892a=_0x140809[_0xf7ca('0x5a')][_0xf7ca('0x2f')]({'plain':!![]});if(!_0x4a892a)throw new Error(_0xf7ca('0x5b'));if(_0x4a892a[_0xf7ca('0x5c')]===_0xf7ca('0x5a')){var _0x1562e3=_0x3e6436[_0xf7ca('0x2f')]({'plain':!![]});var _0x2acde2='Trunks';return db[_0xf7ca('0x5d')][_0xf7ca('0x53')]({'where':{'name':_0x2acde2,'userProfileId':_0x4a892a[_0xf7ca('0x5e')]},'raw':!![]})['then'](function(_0x40d38d){if(_0x40d38d&&_0x40d38d[_0xf7ca('0x5f')]===0x0){return db[_0xf7ca('0x31')][_0xf7ca('0x60')]({'name':_0x1562e3[_0xf7ca('0x33')],'resourceId':_0x1562e3['id'],'type':_0x40d38d['name'],'sectionId':_0x40d38d['id']},{})[_0xf7ca('0x2d')](function(){return _0x3e6436;});}else{return _0x3e6436;}})[_0xf7ca('0x21')](function(_0x115029){logger[_0xf7ca('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x115029);throw _0x115029;});}return _0x3e6436;});}})[_0xf7ca('0x2d')](respondWithResult(_0x381273,0xc9))[_0xf7ca('0x21')](handleError(_0x381273,null));};exports[_0xf7ca('0x60')]=function(_0x342876,_0x56f14e,_0x3de86e){var _0xdbbc9;return db[_0xf7ca('0x37')][_0xf7ca('0x60')](_0x342876['body'],{'raw':!![]})[_0xf7ca('0x2d')](function(_0x2048ad){_0xdbbc9=_0x2048ad;return db[_0xf7ca('0x37')][_0xf7ca('0x4f')]({'raw':!![]});})[_0xf7ca('0x2d')](function(_0x1bd842){var _0x5e0c0c=fs[_0xf7ca('0x61')](path['join'](config[_0xf7ca('0x62')],_0xf7ca('0x63')),_0xf7ca('0x64'));var _0x3c4ec2=fs[_0xf7ca('0x61')](path[_0xf7ca('0x65')](config[_0xf7ca('0x62')],'server/files/templates/registry.ejs'),_0xf7ca('0x64'));var _0x5b95c3=ejs[_0xf7ca('0x66')](_0x5e0c0c,{'trunks':_0x1bd842||[]});fs[_0xf7ca('0x67')](_0xf7ca('0x68'),_0x5b95c3);if(_0xdbbc9['registry']){var _0x754efa=ejs[_0xf7ca('0x66')](_0x3c4ec2,{'trunks':_0x1bd842||[]});fs[_0xf7ca('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x754efa);}})['then'](function(){return respondWithRpcPromise(_0xf7ca('0x69'),_0xf7ca('0x60'),{'module':_0xf7ca('0x6a')});})['then'](function(){var _0x39b4db=_0x342876[_0xf7ca('0x5a')][_0xf7ca('0x2f')]({'plain':!![]});if(!_0x39b4db)throw new Error(_0xf7ca('0x5b'));if(_0x39b4db[_0xf7ca('0x5c')]===_0xf7ca('0x5a')){var _0x31f34e=_0xdbbc9[_0xf7ca('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0xf7ca('0x53')]({'where':{'name':_0xf7ca('0x30'),'userProfileId':_0x39b4db[_0xf7ca('0x5e')]},'raw':!![]})[_0xf7ca('0x2d')](function(_0x7db52d){if(_0x7db52d&&_0x7db52d[_0xf7ca('0x5f')]===0x0){return db[_0xf7ca('0x31')][_0xf7ca('0x60')]({'name':_0x31f34e[_0xf7ca('0x33')],'resourceId':_0x31f34e['id'],'type':_0x7db52d[_0xf7ca('0x33')],'sectionId':_0x7db52d['id']},{})[_0xf7ca('0x2d')](function(){return _0xdbbc9;});}else{return _0xdbbc9;}})[_0xf7ca('0x21')](function(_0x26cf0c){logger[_0xf7ca('0x1e')](_0xf7ca('0x6b'),_0x26cf0c);throw _0x26cf0c;});}return _0xdbbc9;})[_0xf7ca('0x2d')](respondWithResult(_0x56f14e,0xc9))[_0xf7ca('0x21')](handleError(_0x56f14e,null));};exports[_0xf7ca('0x2c')]=function(_0x44c83d,_0x2aae5e,_0x5bcbb4){var _0x307389;return db['Trunk'][_0xf7ca('0x53')]({'where':{'id':_0x44c83d['params']['id']}})[_0xf7ca('0x2d')](handleEntityNotFound(_0x2aae5e,null))[_0xf7ca('0x2d')](saveUpdates(_0x44c83d[_0xf7ca('0x58')],null))['then'](function(_0x155faf){if(_0x155faf){_0x307389=_0x155faf;return db[_0xf7ca('0x37')]['findAll']({'raw':!![]});}})[_0xf7ca('0x2d')](function(_0x67d484){if(_0x67d484){var _0x450b17=fs[_0xf7ca('0x61')](path[_0xf7ca('0x65')](config[_0xf7ca('0x62')],'server/files/templates/trunk.ejs'),_0xf7ca('0x64'));var _0x4c4ecd=fs[_0xf7ca('0x61')](path[_0xf7ca('0x65')](config['root'],_0xf7ca('0x6c')),_0xf7ca('0x64'));var _0x4e7ce6=ejs[_0xf7ca('0x66')](_0x450b17,{'trunks':_0x67d484||[]});fs[_0xf7ca('0x67')](_0xf7ca('0x68'),_0x4e7ce6);var _0x8b80c6=ejs[_0xf7ca('0x66')](_0x4c4ecd,{'trunks':_0x67d484||[]});fs[_0xf7ca('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x8b80c6);return respondWithRpcPromise(_0xf7ca('0x69'),_0xf7ca('0x2c'),{'module':_0xf7ca('0x6a')});}return null;})[_0xf7ca('0x2d')](function(_0x787f45){if(_0x787f45){return _0x307389;}})[_0xf7ca('0x2d')](respondWithResult(_0x2aae5e,null))[_0xf7ca('0x21')](handleError(_0x2aae5e,null));};exports[_0xf7ca('0x2e')]=function(_0xf1f414,_0x38ad7d,_0x1426c8){var _0x22914b;return db[_0xf7ca('0x37')][_0xf7ca('0x53')]({'where':{'id':_0xf1f414[_0xf7ca('0x55')]['id']}})['then'](handleEntityNotFound(_0x38ad7d,null))['then'](removeEntity(_0x38ad7d,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xf7ca('0x2d')](function(_0x5a4f82){var _0x2817d3=fs['readFileSync'](path[_0xf7ca('0x65')](config['root'],_0xf7ca('0x63')),'utf8');var _0x41d4f6=fs['readFileSync'](path[_0xf7ca('0x65')](config[_0xf7ca('0x62')],_0xf7ca('0x6c')),_0xf7ca('0x64'));var _0x181068=ejs[_0xf7ca('0x66')](_0x2817d3,{'trunks':_0x5a4f82});var _0x5aafb2=ejs[_0xf7ca('0x66')](_0x41d4f6,{'trunks':_0x5a4f82});fs[_0xf7ca('0x67')](_0xf7ca('0x68'),_0x181068);fs[_0xf7ca('0x67')](_0xf7ca('0x6d'),_0x5aafb2);return respondWithRpcPromise('Reload','destroy',{'module':_0xf7ca('0x6a')});})[_0xf7ca('0x21')](handleError(_0x38ad7d,null));}; \ No newline at end of file +var _0x1018=['lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','save','destroy','UserProfileResource','end','stack','name','send','index','map','Trunk','rawAttributes','type','key','model','query','keys','intersection','attributes','length','nolimit','offset','order','sort','where','filters','pick','filter','merge','includeAll','include','rows','catch','params','find','fields','options','get','omit','createdAt','body','updatedAt','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findAll','readFileSync','join','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','update','root','utf8','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x328e02,_0x1576f6){var _0x39dd82=function(_0x2d353d){while(--_0x2d353d){_0x328e02['push'](_0x328e02['shift']());}};_0x39dd82(++_0x1576f6);}(_0x1018,0x6a));var _0x8101=function(_0x321b3a,_0x15137a){_0x321b3a=_0x321b3a-0x0;var _0x4b99cd=_0x1018[_0x321b3a];return _0x4b99cd;};'use strict';var pdf=require(_0x8101('0x0'));var emlformat=require(_0x8101('0x1'));var rimraf=require(_0x8101('0x2'));var zipdir=require(_0x8101('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8101('0x4'));var moment=require(_0x8101('0x5'));var BPromise=require(_0x8101('0x6'));var Mustache=require(_0x8101('0x7'));var util=require(_0x8101('0x8'));var path=require(_0x8101('0x9'));var sox=require(_0x8101('0xa'));var csv=require(_0x8101('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8101('0xc'));var squel=require('squel');var crypto=require(_0x8101('0xd'));var jsforce=require(_0x8101('0xe'));var deskjs=require(_0x8101('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8101('0x10'));var Papa=require(_0x8101('0x11'));var Redis=require(_0x8101('0x12'));var authService=require(_0x8101('0x13'));var qs=require(_0x8101('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8101('0x15'));var logger=require(_0x8101('0x16'))(_0x8101('0x17'));var utils=require(_0x8101('0x18'));var config=require(_0x8101('0x19'));var db=require(_0x8101('0x1a'))['db'];var jayson=require(_0x8101('0x1b'));var client=jayson['client'][_0x8101('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3dafe7,_0x13d761,_0x2bdde8){if(_0x2bdde8){var _0x398df7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x398df7[_0x8101('0x1d')](_0x13d761)){return _0x3dafe7;}else{throw new db[(_0x8101('0x1e'))][(_0x8101('0x1f'))](_0x8101('0x20'));}}else{return _0x3dafe7;}}function respondWithRpcPromise(_0x1204d8,_0x303782,_0x163ab4,_0x1a2a7a){return new BPromise(function(_0x1bde52,_0x2c5aec){var _0x395f20=_0x1a2a7a||client;return _0x395f20[_0x8101('0x21')](_0x1204d8,_0x163ab4)[_0x8101('0x22')](function(_0x1f8890){logger[_0x8101('0x23')](_0x8101('0x24'),_0x303782,_0x8101('0x25'));logger[_0x8101('0x26')]('Trunk,\x20%s,\x20%s,\x20%s',_0x303782,_0x8101('0x25'),JSON[_0x8101('0x27')](_0x1f8890));if(_0x1f8890[_0x8101('0x28')]){if(_0x1f8890['error'][_0x8101('0x29')]===0x1f4){logger[_0x8101('0x28')](_0x8101('0x24'),_0x303782,_0x1f8890[_0x8101('0x28')][_0x8101('0x2a')]);return _0x2c5aec(_0x1f8890[_0x8101('0x28')][_0x8101('0x2a')]);}logger[_0x8101('0x28')](_0x8101('0x24'),_0x303782,_0x1f8890['error'][_0x8101('0x2a')]);return _0x1bde52(_0x1f8890[_0x8101('0x28')][_0x8101('0x2a')]);}else{logger[_0x8101('0x23')]('Trunk,\x20%s,\x20%s',_0x303782,_0x8101('0x25'));_0x1bde52(_0x1f8890[_0x8101('0x2b')][_0x8101('0x2a')]);}})['catch'](function(_0x276234){logger[_0x8101('0x28')](_0x8101('0x24'),_0x303782,_0x276234);_0x2c5aec(_0x276234);});});}function respondWithStatusCode(_0x598ab2,_0x1e2d17){_0x1e2d17=_0x1e2d17||0xcc;return function(_0x4785ba){if(_0x4785ba){return _0x598ab2[_0x8101('0x2c')](_0x1e2d17);}return _0x598ab2[_0x8101('0x2d')](_0x1e2d17)['end']();};}function respondWithResult(_0x44c875,_0x36452e){_0x36452e=_0x36452e||0xc8;return function(_0x41847d){if(_0x41847d){return _0x44c875[_0x8101('0x2d')](_0x36452e)[_0x8101('0x2e')](_0x41847d);}};}function respondWithFilteredResult(_0x4bc1a9,_0x4f5cea){return function(_0x10a02c){if(_0x10a02c){var _0x3abe7b=_0x10a02c[_0x8101('0x2f')],_0xc9415d=_0x4f5cea['offset'],_0xb3a58b=_0x4f5cea['offset']+_0x4f5cea[_0x8101('0x30')],_0xb70534;if(_0xb3a58b>=_0x3abe7b){_0xb3a58b=_0x3abe7b;_0xb70534=0xc8;}else{_0xb70534=0xce;}_0x4bc1a9['status'](_0xb70534);return _0x4bc1a9[_0x8101('0x31')](_0x8101('0x32'),_0xc9415d+'-'+_0xb3a58b+'/'+_0x3abe7b)['json'](_0x10a02c);}return null;};}function patchUpdates(_0x412ac5){return function(_0x5ffdbf){try{jsonpatch[_0x8101('0x33')](_0x5ffdbf,_0x412ac5,!![]);}catch(_0xe8bb02){return BPromise[_0x8101('0x34')](_0xe8bb02);}return _0x5ffdbf[_0x8101('0x35')]();};}function saveUpdates(_0x40e3d0,_0x3e13c0){return function(_0x2254db){if(_0x2254db){return _0x2254db['update'](_0x40e3d0)[_0x8101('0x22')](function(_0x4a0a8c){return _0x4a0a8c;});}return null;};}function removeEntity(_0x351c2c,_0x386173){return function(_0x2b81ee){if(_0x2b81ee){return _0x2b81ee[_0x8101('0x36')]()['then'](function(){var _0x4e29a5=_0x2b81ee['get']({'plain':!![]});var _0x4f6bf0='Trunks';return db[_0x8101('0x37')][_0x8101('0x36')]({'where':{'type':_0x4f6bf0,'resourceId':_0x4e29a5['id']}})['then'](function(){return _0x2b81ee;});})[_0x8101('0x22')](function(){_0x351c2c[_0x8101('0x2d')](0xcc)[_0x8101('0x38')]();});}};}function handleEntityNotFound(_0x42e51f,_0x3775cb){return function(_0x35dd0d){if(!_0x35dd0d){_0x42e51f['sendStatus'](0x194);}return _0x35dd0d;};}function handleError(_0x5272bf,_0x27c731){_0x27c731=_0x27c731||0x1f4;return function(_0x4fb815){logger[_0x8101('0x28')](_0x4fb815[_0x8101('0x39')]);if(_0x4fb815[_0x8101('0x3a')]){delete _0x4fb815[_0x8101('0x3a')];}_0x5272bf[_0x8101('0x2d')](_0x27c731)[_0x8101('0x3b')](_0x4fb815);};}exports[_0x8101('0x3c')]=function(_0x3ed1ba,_0x40c593){var _0x4ff29f={},_0xaf5f6d={},_0x4c0c13={'count':0x0,'rows':[]};var _0x790d30=_[_0x8101('0x3d')](db[_0x8101('0x3e')][_0x8101('0x3f')],function(_0x377d96){return{'name':_0x377d96['fieldName'],'type':_0x377d96[_0x8101('0x40')][_0x8101('0x41')]};});_0xaf5f6d[_0x8101('0x42')]=_[_0x8101('0x3d')](_0x790d30,_0x8101('0x3a'));_0xaf5f6d[_0x8101('0x43')]=_[_0x8101('0x44')](_0x3ed1ba['query']);_0xaf5f6d['filters']=_[_0x8101('0x45')](_0xaf5f6d['model'],_0xaf5f6d[_0x8101('0x43')]);_0x4ff29f['attributes']=_[_0x8101('0x45')](_0xaf5f6d[_0x8101('0x42')],qs['fields'](_0x3ed1ba[_0x8101('0x43')]['fields']));_0x4ff29f['attributes']=_0x4ff29f[_0x8101('0x46')][_0x8101('0x47')]?_0x4ff29f[_0x8101('0x46')]:_0xaf5f6d[_0x8101('0x42')];if(!_0x3ed1ba['query']['hasOwnProperty'](_0x8101('0x48'))){_0x4ff29f[_0x8101('0x30')]=qs[_0x8101('0x30')](_0x3ed1ba['query'][_0x8101('0x30')]);_0x4ff29f[_0x8101('0x49')]=qs[_0x8101('0x49')](_0x3ed1ba[_0x8101('0x43')][_0x8101('0x49')]);}_0x4ff29f[_0x8101('0x4a')]=qs[_0x8101('0x4b')](_0x3ed1ba['query']['sort']);_0x4ff29f[_0x8101('0x4c')]=qs[_0x8101('0x4d')](_[_0x8101('0x4e')](_0x3ed1ba[_0x8101('0x43')],_0xaf5f6d[_0x8101('0x4d')]));if(_0x3ed1ba[_0x8101('0x43')][_0x8101('0x4f')]){_0x4ff29f['where']=_[_0x8101('0x50')](_0x4ff29f[_0x8101('0x4c')],{'$or':_[_0x8101('0x3d')](_0x790d30,function(_0x180a4f){if(_0x180a4f[_0x8101('0x40')]!=='VIRTUAL'){var _0x416284={};_0x416284[_0x180a4f['name']]={'$like':'%'+_0x3ed1ba[_0x8101('0x43')][_0x8101('0x4f')]+'%'};return _0x416284;}})});}_0x4ff29f=_['merge']({},_0x4ff29f,_0x3ed1ba['options']);var _0x54adb9={'where':_0x4ff29f['where']};return db['Trunk'][_0x8101('0x2f')](_0x54adb9)['then'](function(_0x218dcf){_0x4c0c13['count']=_0x218dcf;if(_0x3ed1ba['query'][_0x8101('0x51')]){_0x4ff29f[_0x8101('0x52')]=[{'all':!![]}];}return db[_0x8101('0x3e')]['findAll'](_0x4ff29f);})[_0x8101('0x22')](function(_0x534d01){_0x4c0c13[_0x8101('0x53')]=_0x534d01;return _0x4c0c13;})[_0x8101('0x22')](respondWithFilteredResult(_0x40c593,_0x4ff29f))[_0x8101('0x54')](handleError(_0x40c593,null));};exports['show']=function(_0x78e24,_0x1ce07a){var _0x4c9417={'raw':![],'where':{'id':_0x78e24[_0x8101('0x55')]['id']}},_0x740e5e={};_0x740e5e[_0x8101('0x42')]=_[_0x8101('0x44')](db['Trunk'][_0x8101('0x3f')]);_0x740e5e[_0x8101('0x43')]=_[_0x8101('0x44')](_0x78e24[_0x8101('0x43')]);_0x740e5e[_0x8101('0x4d')]=_['intersection'](_0x740e5e[_0x8101('0x42')],_0x740e5e[_0x8101('0x43')]);_0x4c9417['attributes']=_[_0x8101('0x45')](_0x740e5e[_0x8101('0x42')],qs['fields'](_0x78e24[_0x8101('0x43')]['fields']));_0x4c9417[_0x8101('0x46')]=_0x4c9417[_0x8101('0x46')]['length']?_0x4c9417[_0x8101('0x46')]:_0x740e5e[_0x8101('0x42')];if(_0x78e24['query']['includeAll']){_0x4c9417['include']=[{'all':!![]}];}_0x4c9417=_[_0x8101('0x50')]({},_0x4c9417,_0x78e24['options']);return db[_0x8101('0x3e')][_0x8101('0x56')](_0x4c9417)[_0x8101('0x22')](handleEntityNotFound(_0x1ce07a,null))[_0x8101('0x22')](respondWithResult(_0x1ce07a,null))[_0x8101('0x54')](handleError(_0x1ce07a,null));};exports['clone']=function(_0x2c5329,_0xec7558){var _0xe99bf={'where':{'id':_0x2c5329['params']['id']}},_0x5254f1={};_0x5254f1[_0x8101('0x42')]=_['keys'](db['Trunk'][_0x8101('0x3f')]);_0xe99bf[_0x8101('0x46')]=_[_0x8101('0x45')](_0x5254f1[_0x8101('0x42')],qs[_0x8101('0x57')](_0x2c5329[_0x8101('0x43')][_0x8101('0x57')]));_0xe99bf['attributes']=_0xe99bf['attributes'][_0x8101('0x47')]?_0xe99bf['attributes']:_0x5254f1[_0x8101('0x42')];if(_0x2c5329[_0x8101('0x43')][_0x8101('0x51')]){_0xe99bf[_0x8101('0x52')]=[{'all':!![]}];}_0xe99bf=_[_0x8101('0x50')]({},_0xe99bf,_0x2c5329[_0x8101('0x58')]);return db[_0x8101('0x3e')][_0x8101('0x56')](_0xe99bf)['then'](handleEntityNotFound(_0xec7558,null))[_0x8101('0x22')](function(_0x161814){if(_0x161814){var _0xb24d48=_0x161814[_0x8101('0x59')]({'plain':!![]});_0xb24d48=qs[_0x8101('0x5a')](_0xb24d48,['id',_0x8101('0x5b'),'updatedAt']);_0x2c5329[_0x8101('0x5c')]=_[_0x8101('0x5a')](_0x2c5329[_0x8101('0x5c')],['id',_0x8101('0x5b'),_0x8101('0x5d')]);return db['Trunk']['create'](_['merge'](_0xb24d48,_0x2c5329[_0x8101('0x5c')]),{'include':_0x2c5329['query'][_0x8101('0x51')]?[{'all':!![]}]:undefined})[_0x8101('0x22')](function(_0x2dcd76){var _0x589ada=_0x2c5329[_0x8101('0x5e')][_0x8101('0x59')]({'plain':!![]});if(!_0x589ada)throw new Error(_0x8101('0x5f'));if(_0x589ada[_0x8101('0x60')]===_0x8101('0x5e')){var _0x278c6b=_0x2dcd76[_0x8101('0x59')]({'plain':!![]});var _0x22bdb7=_0x8101('0x61');return db['UserProfileSection']['find']({'where':{'name':_0x22bdb7,'userProfileId':_0x589ada[_0x8101('0x62')]},'raw':!![]})[_0x8101('0x22')](function(_0x38e2bc){if(_0x38e2bc&&_0x38e2bc[_0x8101('0x63')]===0x0){return db['UserProfileResource'][_0x8101('0x64')]({'name':_0x278c6b['name'],'resourceId':_0x278c6b['id'],'type':_0x38e2bc['name'],'sectionId':_0x38e2bc['id']},{})[_0x8101('0x22')](function(){return _0x2dcd76;});}else{return _0x2dcd76;}})[_0x8101('0x54')](function(_0xdb453f){logger[_0x8101('0x28')](_0x8101('0x65'),_0xdb453f);throw _0xdb453f;});}return _0x2dcd76;});}})[_0x8101('0x22')](respondWithResult(_0xec7558,0xc9))['catch'](handleError(_0xec7558,null));};exports['create']=function(_0x804d08,_0x4ae68e,_0x3cc9a8){var _0x355e8e;return db['Trunk'][_0x8101('0x64')](_0x804d08[_0x8101('0x5c')],{'raw':!![]})[_0x8101('0x22')](function(_0x2b9ce9){_0x355e8e=_0x2b9ce9;return db['Trunk'][_0x8101('0x66')]({'raw':!![]});})[_0x8101('0x22')](function(_0x452200){var _0x5c308c=fs[_0x8101('0x67')](path[_0x8101('0x68')](config['root'],_0x8101('0x69')),'utf8');var _0x32e3eb=fs[_0x8101('0x67')](path[_0x8101('0x68')](config['root'],_0x8101('0x6a')),'utf8');var _0x4d2d00=ejs[_0x8101('0x6b')](_0x5c308c,{'trunks':_0x452200||[]});fs[_0x8101('0x6c')](_0x8101('0x6d'),_0x4d2d00);if(_0x355e8e[_0x8101('0x6e')]){var _0x13efec=ejs[_0x8101('0x6b')](_0x32e3eb,{'trunks':_0x452200||[]});fs[_0x8101('0x6c')](_0x8101('0x6f'),_0x13efec);}})[_0x8101('0x22')](function(){return respondWithRpcPromise(_0x8101('0x70'),_0x8101('0x64'),{'module':_0x8101('0x71')});})[_0x8101('0x22')](function(){var _0x1ef2e0=_0x804d08[_0x8101('0x5e')]['get']({'plain':!![]});if(!_0x1ef2e0)throw new Error(_0x8101('0x5f'));if(_0x1ef2e0[_0x8101('0x60')]===_0x8101('0x5e')){var _0x215cdb=_0x355e8e[_0x8101('0x59')]({'plain':!![]});return db[_0x8101('0x72')][_0x8101('0x56')]({'where':{'name':_0x8101('0x61'),'userProfileId':_0x1ef2e0[_0x8101('0x62')]},'raw':!![]})[_0x8101('0x22')](function(_0x37e490){if(_0x37e490&&_0x37e490[_0x8101('0x63')]===0x0){return db[_0x8101('0x37')][_0x8101('0x64')]({'name':_0x215cdb[_0x8101('0x3a')],'resourceId':_0x215cdb['id'],'type':_0x37e490['name'],'sectionId':_0x37e490['id']},{})[_0x8101('0x22')](function(){return _0x355e8e;});}else{return _0x355e8e;}})['catch'](function(_0x4ef25e){logger[_0x8101('0x28')](_0x8101('0x65'),_0x4ef25e);throw _0x4ef25e;});}return _0x355e8e;})['then'](respondWithResult(_0x4ae68e,0xc9))[_0x8101('0x54')](handleError(_0x4ae68e,null));};exports[_0x8101('0x73')]=function(_0xe50cd2,_0x47ec54,_0x7bae36){var _0x566f15;return db[_0x8101('0x3e')][_0x8101('0x56')]({'where':{'id':_0xe50cd2[_0x8101('0x55')]['id']}})[_0x8101('0x22')](handleEntityNotFound(_0x47ec54,null))[_0x8101('0x22')](saveUpdates(_0xe50cd2[_0x8101('0x5c')],null))[_0x8101('0x22')](function(_0x2c920c){if(_0x2c920c){_0x566f15=_0x2c920c;return db[_0x8101('0x3e')][_0x8101('0x66')]({'raw':!![]});}})[_0x8101('0x22')](function(_0x2517b8){if(_0x2517b8){var _0xd6f3e9=fs['readFileSync'](path[_0x8101('0x68')](config[_0x8101('0x74')],_0x8101('0x69')),_0x8101('0x75'));var _0x57db5b=fs[_0x8101('0x67')](path[_0x8101('0x68')](config[_0x8101('0x74')],_0x8101('0x6a')),_0x8101('0x75'));var _0xdb997a=ejs[_0x8101('0x6b')](_0xd6f3e9,{'trunks':_0x2517b8||[]});fs[_0x8101('0x6c')](_0x8101('0x6d'),_0xdb997a);var _0x1eff37=ejs[_0x8101('0x6b')](_0x57db5b,{'trunks':_0x2517b8||[]});fs[_0x8101('0x6c')](_0x8101('0x6f'),_0x1eff37);return respondWithRpcPromise(_0x8101('0x70'),_0x8101('0x73'),{'module':_0x8101('0x71')});}return null;})['then'](function(_0x3c39cc){if(_0x3c39cc){return _0x566f15;}})[_0x8101('0x22')](respondWithResult(_0x47ec54,null))[_0x8101('0x54')](handleError(_0x47ec54,null));};exports['destroy']=function(_0x29f61f,_0x1e2a87,_0x532ec9){var _0xb0aea9;return db[_0x8101('0x3e')]['find']({'where':{'id':_0x29f61f['params']['id']}})['then'](handleEntityNotFound(_0x1e2a87,null))[_0x8101('0x22')](removeEntity(_0x1e2a87,null))[_0x8101('0x22')](function(){return db[_0x8101('0x3e')]['findAll']({'raw':!![]});})[_0x8101('0x22')](function(_0x1f4756){var _0xe4b1d4=fs[_0x8101('0x67')](path[_0x8101('0x68')](config[_0x8101('0x74')],_0x8101('0x69')),_0x8101('0x75'));var _0x29a2ab=fs[_0x8101('0x67')](path[_0x8101('0x68')](config['root'],_0x8101('0x6a')),_0x8101('0x75'));var _0xf01dd=ejs[_0x8101('0x6b')](_0xe4b1d4,{'trunks':_0x1f4756});var _0x5e78b3=ejs[_0x8101('0x6b')](_0x29a2ab,{'trunks':_0x1f4756});fs[_0x8101('0x6c')](_0x8101('0x6d'),_0xf01dd);fs[_0x8101('0x6c')](_0x8101('0x6f'),_0x5e78b3);return respondWithRpcPromise('Reload',_0x8101('0x36'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1e2a87,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 8226919..1c3257a 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 _0x4e72=['./trunk.attributes','define','tools_trunks','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x331aac,_0x53d85a){var _0x102ee0=function(_0x1d47e4){while(--_0x1d47e4){_0x331aac['push'](_0x331aac['shift']());}};_0x102ee0(++_0x53d85a);}(_0x4e72,0x137));var _0x24e7=function(_0x5b17ed,_0x462615){_0x5b17ed=_0x5b17ed-0x0;var _0x2d15e3=_0x4e72[_0x5b17ed];return _0x2d15e3;};'use strict';var _=require(_0x24e7('0x0'));var util=require(_0x24e7('0x1'));var logger=require(_0x24e7('0x2'))(_0x24e7('0x3'));var moment=require(_0x24e7('0x4'));var BPromise=require('bluebird');var rp=require(_0x24e7('0x5'));var fs=require('fs');var path=require(_0x24e7('0x6'));var rimraf=require(_0x24e7('0x7'));var config=require('../../config/environment');var attributes=require(_0x24e7('0x8'));module['exports']=function(_0x3ff161,_0x2c238a){return _0x3ff161[_0x24e7('0x9')]('Trunk',attributes,{'tableName':_0x24e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd88=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash','util'];(function(_0x41595a,_0x2634b4){var _0x4f21ae=function(_0x55b7cd){while(--_0x55b7cd){_0x41595a['push'](_0x41595a['shift']());}};_0x4f21ae(++_0x2634b4);}(_0xfd88,0x116));var _0x8fd8=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0xfd88[_0xc5a279];return _0xc755d3;};'use strict';var _=require(_0x8fd8('0x0'));var util=require(_0x8fd8('0x1'));var logger=require(_0x8fd8('0x2'))(_0x8fd8('0x3'));var moment=require('moment');var BPromise=require(_0x8fd8('0x4'));var rp=require(_0x8fd8('0x5'));var fs=require('fs');var path=require(_0x8fd8('0x6'));var rimraf=require(_0x8fd8('0x7'));var config=require(_0x8fd8('0x8'));var attributes=require(_0x8fd8('0x9'));module[_0x8fd8('0xa')]=function(_0x368570,_0x1a4782){return _0x368570[_0x8fd8('0xb')](_0x8fd8('0xc'),attributes,{'tableName':_0x8fd8('0xd'),'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 67065a6..71548dd 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 _0x5f2f=['map','include','model','attributes','then','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','limit'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa85234,_0x582a56){_0xa85234=_0xa85234-0x0;var _0x19b52f=_0x5f2f[_0xa85234];return _0x19b52f;};'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')]('Trunk,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetTrunk',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetTrunk',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowTrunk',_0x153924);logger[_0xf5f2('0xf')]('ShowTrunk',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowTrunk',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file +var _0x5eb8=['where','moment','bluebird','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','message','catch','Trunk','findAll','options','raw','limit','include','model','attributes','map','then','GetTrunk','stringify','ShowTrunk'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x5eb8,0xb0));var _0x85eb=function(_0x8550ba,_0x57c10d){_0x8550ba=_0x8550ba-0x0;var _0x432399=_0x5eb8[_0x8550ba];return _0x432399;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('Trunk,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['GetTrunk']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')]({'raw':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8['options'][_0x85eb('0x18')]===undefined?!![]:![]:!![],'where':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')]['where']||null:null,'attributes':_0x50d2a8['options']?_0x50d2a8['options']['attributes']||null:null,'limit':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x19')]||null:null,'include':_0x50d2a8[_0x85eb('0x17')]?_0x50d2a8[_0x85eb('0x17')][_0x85eb('0x1a')]?_['map'](_0x50d2a8['options']['include'],function(_0x298e84){return{'model':db[_0x298e84[_0x85eb('0x1b')]],'as':_0x298e84['as'],'attributes':_0x298e84[_0x85eb('0x1c')],'include':_0x298e84[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x298e84[_0x85eb('0x1a')],function(_0x5dfc96){return{'model':db[_0x5dfc96[_0x85eb('0x1b')]],'as':_0x5dfc96['as'],'attributes':_0x5dfc96[_0x85eb('0x1c')],'include':_0x5dfc96[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x5dfc96[_0x85eb('0x1a')],function(_0x57a03c){return{'model':db[_0x57a03c[_0x85eb('0x1b')]],'as':_0x57a03c['as'],'attributes':_0x57a03c[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x3e7eb9){logger[_0x85eb('0xd')](_0x85eb('0x1f'),_0x50d2a8);logger['debug']('GetTrunk',_0x50d2a8,JSON[_0x85eb('0x20')](_0x3e7eb9));_0x39ca96(_0x3e7eb9);})['catch'](function(_0xa9b14f){logger['error'](_0x85eb('0x1f'),_0xa9b14f[_0x85eb('0x13')],_0x50d2a8);_0x10cf2f(_0xe198ca[_0x85eb('0x12')](0x1f4,_0xa9b14f[_0x85eb('0x13')]));});});};exports[_0x85eb('0x21')]=function(_0xf4ac13){var _0x41ed76=this;return new Promise(function(_0x5decd5,_0x237f19){return db[_0x85eb('0x15')]['find']({'raw':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13['options']['raw']===undefined?!![]:![]:!![],'where':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x22')]||null:null,'attributes':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1c')]||null:null,'include':_0xf4ac13[_0x85eb('0x17')]?_0xf4ac13[_0x85eb('0x17')][_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0xf4ac13['options'][_0x85eb('0x1a')],function(_0x3a5b87){return{'model':db[_0x3a5b87['model']],'as':_0x3a5b87['as'],'attributes':_0x3a5b87['attributes'],'include':_0x3a5b87[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x3a5b87[_0x85eb('0x1a')],function(_0x12cb4c){return{'model':db[_0x12cb4c[_0x85eb('0x1b')]],'as':_0x12cb4c['as'],'attributes':_0x12cb4c[_0x85eb('0x1c')],'include':_0x12cb4c[_0x85eb('0x1a')]?_[_0x85eb('0x1d')](_0x12cb4c[_0x85eb('0x1a')],function(_0x373e5f){return{'model':db[_0x373e5f[_0x85eb('0x1b')]],'as':_0x373e5f['as'],'attributes':_0x373e5f[_0x85eb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x85eb('0x1e')](function(_0x33605a){logger['info'](_0x85eb('0x21'),_0xf4ac13);logger[_0x85eb('0x10')]('ShowTrunk',_0xf4ac13,JSON['stringify'](_0x33605a));_0x5decd5(_0x33605a);})[_0x85eb('0x14')](function(_0xe22d16){logger['error'](_0x85eb('0x21'),_0xe22d16['message'],_0xf4ac13);_0x237f19(_0x41ed76[_0x85eb('0x12')](0x1f4,_0xe22d16['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 2fa4bac..5a3bd9f 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 _0x1261=['getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','addContacts','create','diskStorage','server/files/images/','format','%s-%s','single','file','login','/:id/logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addSmsInteractions','/:id/openchannel_interactions','/:id/fax_accounts','/:id/openchannel_accounts','addSquareProjects','/:id/api_key','put','update','changePassword','removeQueues','removeTeams','delete','destroy','/:id/fax_interactions','/:id/sms_interactions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','/:id/square_projects','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','describe','/whoami','isAuthenticated','whoami','/:id','show','/:id/avatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites'];(function(_0x5026a9,_0x127495){var _0xe38943=function(_0x5c0e9e){while(--_0x5c0e9e){_0x5026a9['push'](_0x5026a9['shift']());}};_0xe38943(++_0x127495);}(_0x1261,0x144));var _0x1126=function(_0x283b55,_0x279bee){_0x283b55=_0x283b55-0x0;var _0x192e58=_0x1261[_0x283b55];return _0x192e58;};'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 auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['get'](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x10')]);router['get'](_0x1126('0x11'),controller['getAvatar']);router['get'](_0x1126('0x12'),auth['isAuthenticated'](),controller[_0x1126('0x13')]);router[_0x1126('0x9')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x15')]);router[_0x1126('0x9')](_0x1126('0x16'),auth[_0x1126('0xd')](),controller[_0x1126('0x17')]);router['get']('/:id/groups',auth[_0x1126('0xd')](),controller[_0x1126('0x18')]);router[_0x1126('0x9')]('/:id/recordings',auth[_0x1126('0xd')](),controller['getRecordings']);router[_0x1126('0x9')](_0x1126('0x19'),auth[_0x1126('0xd')](),controller['getScreenRecordings']);router[_0x1126('0x9')](_0x1126('0x1a'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x1126('0x9')](_0x1126('0x1b'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x1126('0x9')]('/:id/mail/interactions',auth[_0x1126('0xd')](),controller[_0x1126('0x1c')]);router[_0x1126('0x9')]('/:id/sms/interactions',auth[_0x1126('0xd')](),controller['getSmsInteractions']);router['get'](_0x1126('0x1d'),auth[_0x1126('0xd')](),controller[_0x1126('0x1e')]);router[_0x1126('0x9')]('/:id/teams',auth[_0x1126('0xd')](),controller[_0x1126('0x1f')]);router['get'](_0x1126('0x20'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x1126('0x21'),auth[_0x1126('0xd')](),controller[_0x1126('0x22')]);router[_0x1126('0x9')](_0x1126('0x23'),auth[_0x1126('0xd')](),controller[_0x1126('0x24')]);router[_0x1126('0x9')]('/:id/fax_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x25')]);router[_0x1126('0x9')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x1126('0x26')]);router[_0x1126('0x9')]('/:id/openchannel_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x27')]);router['get'](_0x1126('0x28'),auth['isAuthenticated'](),controller[_0x1126('0x29')]);router['get'](_0x1126('0x2a'),auth['isAuthenticated'](),controller[_0x1126('0x2b')]);router['get']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x1126('0x2c')]);router[_0x1126('0x9')](_0x1126('0x2d'),auth['isAuthenticated'](),controller[_0x1126('0x2e')]);router[_0x1126('0x9')]('/:id/api_key',auth[_0x1126('0xd')](),controller[_0x1126('0x2f')]);router[_0x1126('0x30')](_0x1126('0x31'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x1126('0x30')](_0x1126('0x12'),auth[_0x1126('0xd')](),controller[_0x1126('0x32')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0x33')]);router[_0x1126('0x30')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1126('0x34')]({'destination':function(_0x457efd,_0x1e8402,_0x42e773){_0x42e773(null,path['join'](config['root'],_0x1126('0x35')));},'filename':function(_0x31d07c,_0x511e6b,_0xde37cf){_0xde37cf(null,util[_0x1126('0x36')](_0x1126('0x37'),Date['now'](),_0x511e6b['originalname']));}})});router[_0x1126('0x30')](_0x1126('0x11'),upload[_0x1126('0x38')](_0x1126('0x39')),controller['addAvatar']);router[_0x1126('0x30')]('/:id/login',auth[_0x1126('0xd')](),controller[_0x1126('0x3a')]);router[_0x1126('0x30')](_0x1126('0x3b'),auth[_0x1126('0xd')](),controller['logout']);router[_0x1126('0x30')](_0x1126('0x3c'),auth[_0x1126('0xd')](),controller[_0x1126('0x3d')]);router[_0x1126('0x30')](_0x1126('0x3e'),auth[_0x1126('0xd')](),controller['unpause']);router[_0x1126('0x30')](_0x1126('0x3f'),auth[_0x1126('0xd')](),controller[_0x1126('0x40')]);router[_0x1126('0x30')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x1126('0x41')]);router[_0x1126('0x30')](_0x1126('0x42'),auth[_0x1126('0xd')](),controller[_0x1126('0x43')]);router[_0x1126('0x30')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x1126('0x30')]('/:id/sms_interactions',auth[_0x1126('0xd')](),controller[_0x1126('0x44')]);router[_0x1126('0x30')](_0x1126('0x45'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x1126('0x30')](_0x1126('0x46'),auth[_0x1126('0xd')](),controller['addFaxAccounts']);router[_0x1126('0x30')]('/:id/mail_accounts',auth[_0x1126('0xd')](),controller['addMailAccounts']);router[_0x1126('0x30')](_0x1126('0x47'),auth[_0x1126('0xd')](),controller['addOpenchannelAccounts']);router[_0x1126('0x30')](_0x1126('0x28'),auth[_0x1126('0xd')](),controller['addSmsAccounts']);router['post']('/:id/chat_websites',auth[_0x1126('0xd')](),controller['addChatWebsites']);router[_0x1126('0x30')]('/:id/square_projects',auth[_0x1126('0xd')](),controller[_0x1126('0x48')]);router[_0x1126('0x30')](_0x1126('0x49'),auth[_0x1126('0xd')](),controller['createApiKey']);router[_0x1126('0x4a')](_0x1126('0xf'),auth['isAuthenticated'](),controller[_0x1126('0x4b')]);router[_0x1126('0x4a')]('/:id/password',auth[_0x1126('0xd')](),controller[_0x1126('0x4c')]);router['delete'](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x4d')]);router['delete'](_0x1126('0x3f'),auth[_0x1126('0xd')](),controller[_0x1126('0x4e')]);router[_0x1126('0x4f')](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x50')]);router[_0x1126('0x4f')]('/:id/chat_interactions',auth[_0x1126('0xd')](),controller['removeChatInteractions']);router[_0x1126('0x4f')](_0x1126('0x42'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x1126('0x4f')](_0x1126('0x51'),auth[_0x1126('0xd')](),controller['removeFaxInteractions']);router[_0x1126('0x4f')](_0x1126('0x52'),auth[_0x1126('0xd')](),controller[_0x1126('0x53')]);router['delete'](_0x1126('0x45'),auth[_0x1126('0xd')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x1126('0x54')]);router[_0x1126('0x4f')]('/:id/mail_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x55')]);router[_0x1126('0x4f')](_0x1126('0x47'),auth[_0x1126('0xd')](),controller['removeOpenchannelAccounts']);router[_0x1126('0x4f')](_0x1126('0x28'),auth['isAuthenticated'](),controller[_0x1126('0x56')]);router[_0x1126('0x4f')](_0x1126('0x2a'),auth[_0x1126('0xd')](),controller[_0x1126('0x57')]);router['delete'](_0x1126('0x58'),auth['isAuthenticated'](),controller[_0x1126('0x59')]);router[_0x1126('0x4f')](_0x1126('0x49'),auth['isAuthenticated'](),controller[_0x1126('0x5a')]);module[_0x1126('0x5b')]=router; \ No newline at end of file +var _0x5f2f=['createApiKey','update','/:id/password','changePassword','removeQueues','removeTeams','destroy','delete','removeFaxInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/whoami','/:id','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','join','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x41eeb7,_0x50ae5a){_0x41eeb7=_0x41eeb7-0x0;var _0x3acc97=_0x5f2f[_0x41eeb7];return _0x3acc97;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./user.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['whoami']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')]('/:id/avatar',controller['getAvatar']);router[_0xf5f2('0x8')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x8')](_0xf5f2('0x10'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x11')]);router[_0xf5f2('0x8')]('/:id/queues_rt',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x8')](_0xf5f2('0x13'),auth[_0xf5f2('0x9')](),controller['getGroups']);router[_0xf5f2('0x8')](_0xf5f2('0x14'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x15')]);router[_0xf5f2('0x8')](_0xf5f2('0x16'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x8')](_0xf5f2('0x18'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x19')]);router[_0xf5f2('0x8')](_0xf5f2('0x1a'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1b')]);router[_0xf5f2('0x8')]('/:id/mail/interactions',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1c')]);router['get']('/:id/sms/interactions',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1d')]);router['get'](_0xf5f2('0x1e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1f')]);router[_0xf5f2('0x8')](_0xf5f2('0x20'),auth['isAuthenticated'](),controller[_0xf5f2('0x21')]);router[_0xf5f2('0x8')](_0xf5f2('0x22'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x23')]);router['get']('/:id/agents',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x24')]);router[_0xf5f2('0x8')](_0xf5f2('0x25'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x26')]);router[_0xf5f2('0x8')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller['getFaxAccounts']);router[_0xf5f2('0x8')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x29')]);router[_0xf5f2('0x8')](_0xf5f2('0x2a'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xf5f2('0x8')](_0xf5f2('0x2b'),auth[_0xf5f2('0x9')](),controller['getSmsAccounts']);router['get'](_0xf5f2('0x2c'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x2d')]);router[_0xf5f2('0x8')](_0xf5f2('0x2e'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0xf5f2('0x8')]('/:id/scheduled_calls',auth[_0xf5f2('0x9')](),controller['getScheduledCalls']);router[_0xf5f2('0x8')](_0xf5f2('0x2f'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x30')]);router[_0xf5f2('0x31')](_0xf5f2('0x32'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x33')]);router['post'](_0xf5f2('0xe'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x34')]);router[_0xf5f2('0x31')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x35')]);router[_0xf5f2('0x31')]('/:id/queues',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fc168,_0x4b8c42,_0x18ae07){_0x18ae07(null,path[_0xf5f2('0x37')](config[_0xf5f2('0x38')],_0xf5f2('0x39')));},'filename':function(_0x59a6dd,_0x5a98d7,_0x41088b){_0x41088b(null,util[_0xf5f2('0x3a')](_0xf5f2('0x3b'),Date['now'](),_0x5a98d7[_0xf5f2('0x3c')]));}})});router['post'](_0xf5f2('0x3d'),upload['single'](_0xf5f2('0x3e')),controller[_0xf5f2('0x3f')]);router['post'](_0xf5f2('0x40'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x41')]);router[_0xf5f2('0x31')]('/:id/logout',auth['isAuthenticated'](),controller[_0xf5f2('0x42')]);router[_0xf5f2('0x31')](_0xf5f2('0x43'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x44')]);router[_0xf5f2('0x31')](_0xf5f2('0x45'),auth['isAuthenticated'](),controller[_0xf5f2('0x46')]);router[_0xf5f2('0x31')]('/:id/teams',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x47')]);router[_0xf5f2('0x31')](_0xf5f2('0x48'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x49')]);router[_0xf5f2('0x31')](_0xf5f2('0x4a'),auth['isAuthenticated'](),controller[_0xf5f2('0x4b')]);router[_0xf5f2('0x31')](_0xf5f2('0x4c'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0xf5f2('0x4d'),auth[_0xf5f2('0x9')](),controller['addSmsInteractions']);router[_0xf5f2('0x31')](_0xf5f2('0x4e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x4f')]);router[_0xf5f2('0x31')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x50')]);router[_0xf5f2('0x31')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x51')]);router[_0xf5f2('0x31')](_0xf5f2('0x2a'),auth['isAuthenticated'](),controller[_0xf5f2('0x52')]);router['post'](_0xf5f2('0x2b'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x53')]);router[_0xf5f2('0x31')](_0xf5f2('0x2c'),auth[_0xf5f2('0x9')](),controller['addChatWebsites']);router[_0xf5f2('0x31')](_0xf5f2('0x2e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x54')]);router[_0xf5f2('0x31')](_0xf5f2('0x2f'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x55')]);router['put'](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x56')]);router['put'](_0xf5f2('0x57'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x58')]);router['delete']('/:id/queues',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x59')]);router['delete'](_0xf5f2('0x20'),auth['isAuthenticated'](),controller[_0xf5f2('0x5a')]);router['delete'](_0xf5f2('0xd'),auth['isAuthenticated'](),controller[_0xf5f2('0x5b')]);router[_0xf5f2('0x5c')](_0xf5f2('0x48'),auth[_0xf5f2('0x9')](),controller['removeChatInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x4a'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x4c'),auth['isAuthenticated'](),controller[_0xf5f2('0x5d')]);router[_0xf5f2('0x5c')](_0xf5f2('0x4d'),auth[_0xf5f2('0x9')](),controller['removeSmsInteractions']);router['delete'](_0xf5f2('0x4e'),auth[_0xf5f2('0x9')](),controller['removeOpenchannelInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x5e')]);router[_0xf5f2('0x5c')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller['removeMailAccounts']);router['delete'](_0xf5f2('0x2a'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x5f')]);router[_0xf5f2('0x5c')](_0xf5f2('0x2b'),auth['isAuthenticated'](),controller[_0xf5f2('0x60')]);router[_0xf5f2('0x5c')](_0xf5f2('0x2c'),auth['isAuthenticated'](),controller[_0xf5f2('0x61')]);router['delete'](_0xf5f2('0x2e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x62')]);router[_0xf5f2('0x5c')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xf5f2('0x63')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 60f8cad..a7d8b42 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=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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'];(function(_0x55dbdc,_0x2a203a){var _0x5d7a04=function(_0x44621e){while(--_0x44621e){_0x55dbdc['push'](_0x55dbdc['shift']());}};_0x5d7a04(++_0x2a203a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](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[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](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')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'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(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'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('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'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[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'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[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'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[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','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'];(function(_0x17976c,_0x1e7a52){var _0xf83a5e=function(_0x4efbae){while(--_0x4efbae){_0x17976c['push'](_0x17976c['shift']());}};_0xf83a5e(++_0x1e7a52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'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':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](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[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](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')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'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(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'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('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'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[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'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[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'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[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 466d4ac..b2d6bf9 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 _0x7a54=['col','count','includeAll','include','findAll','catch','show','params','differenceBy','options','bulkCreate','body','describe','addContacts','ids','omit','agent\x20role','admin','getLicense','telephones','users','count\x20%s:\x20%s','create','internal','Setting','findById','min_internal','max','isNil','QueryTypes','from','voicemail','mailbox','fullname','101','102','103','104','106','107','108','100','111','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','Telephones','UserProfileSection','userProfileId','autoAssociation','changePassword','findOne','securePassword','newPassword','authenticate','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','toLowerCase','Queues','penalty','spread','capitalize','QueueId','Queue:save','VoiceQueue','voice','push','SIP/%s','voicePause','each','UserVoiceQueueRt','upsert','removeQueues','remove','emit','Queue:remove','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','getContacts','order','sort','CmList','List','Tag','Tags','tag','getQueues','Queue','pick','getVoiceQueuesRt','getGroups','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','UserId','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','login','phone','mobile','format','LOCAL/%s@from-sip/n','user:forcelogout','headers','connection','socket','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','isMiddleware','resolve','logout','all','pause','updateAttributes','DEFAULT\x20PAUSE','chatPause','openchannelPause','smsPause','pauseType','lastPauseAt','QueuePause','unpause','manual','mail','chat','fax','openchannel','set','%s%s','Pause','getTeams','addTeams','Voice','getChatQueues','setDataValue','Chat','getMailQueues','getSmsQueues','Sms','getFaxQueues','Fax','getOpenchannelQueues','transaction','getDataValue','removeTeams','Team','Openchannel','flatten','removeAgent','getLists','getAgents','Agents','values','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','isArray','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','addSquareProjects','removeSquareProjects','concat','$and','$or','$gt','$gte','$lte','$eq','$between','$notBetween','$in','$notIn','$iLike','$like','$overlap','$contains','$contained','$any','firstName','CmContact','Contact','CmHopper','rows','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','generateApiKey','iat','nonce','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','whoami','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./user.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','reject','update','destroy','get','user','agent','telephone','filter','ignore','map','value','includes','role','find','name','UserProfileResource','stack','send','index','User','rawAttributes','fieldName','key','password','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','filters','merge','type','sequelize','lower'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0x7a54,0x106));var _0x47a5=function(_0x4d9327,_0x3d34b7){_0x4d9327=_0x4d9327-0x0;var _0x455dc6=_0x7a54[_0x4d9327];return _0x455dc6;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);var jayson=require(_0x47a5('0x1a'));var client=jayson[_0x47a5('0x1b')][_0x47a5('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x190faa,_0x4e99a8,_0x362359){if(_0x362359){var _0x11faf5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11faf5[_0x47a5('0x1d')](_0x4e99a8)){return _0x190faa;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x190faa;}}function respondWithRpcPromise(_0x549de3,_0x138bc0,_0x4b966e,_0x5247fd){return new BPromise(function(_0x423a81,_0xaf70a6){var _0x2ce454=_0x5247fd||client;return _0x2ce454[_0x47a5('0x20')](_0x549de3,_0x4b966e)[_0x47a5('0x21')](function(_0x12b98e){logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,_0x47a5('0x24'));logger['debug'](_0x47a5('0x25'),_0x138bc0,_0x47a5('0x24'),JSON['stringify'](_0x12b98e));if(_0x12b98e[_0x47a5('0x26')]){if(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x27')]===0x1f4){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);return _0xaf70a6(_0x12b98e[_0x47a5('0x26')]['message']);}logger[_0x47a5('0x26')](_0x47a5('0x23'),_0x138bc0,_0x12b98e['error'][_0x47a5('0x28')]);return _0x423a81(_0x12b98e[_0x47a5('0x26')][_0x47a5('0x28')]);}else{logger[_0x47a5('0x22')](_0x47a5('0x23'),_0x138bc0,'request\x20sent');_0x423a81(_0x12b98e['result'][_0x47a5('0x28')]);}})['catch'](function(_0x1ea9c8){logger['error'](_0x47a5('0x23'),_0x138bc0,_0x1ea9c8);_0xaf70a6(_0x1ea9c8);});});}function respondWithStatusCode(_0x378208,_0x36ad34){_0x36ad34=_0x36ad34||0xcc;return function(_0x1dac65){if(_0x1dac65){return _0x378208[_0x47a5('0x29')](_0x36ad34);}return _0x378208[_0x47a5('0x2a')](_0x36ad34)[_0x47a5('0x2b')]();};}function respondWithResult(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0xc8;return function(_0x361bfa){if(_0x361bfa){return _0x136b14[_0x47a5('0x2a')](_0x16631f)[_0x47a5('0x2c')](_0x361bfa);}};}function respondWithFilteredResult(_0x3ad507,_0x528582){return function(_0x243210){if(_0x243210){var _0x51833b=_0x243210['count'],_0x2ef875=_0x528582[_0x47a5('0x2d')],_0x9ac908=_0x528582[_0x47a5('0x2d')]+_0x528582[_0x47a5('0x2e')],_0x16901f;if(_0x9ac908>=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086=[{'name':'Users','value':_0x47a5('0x33'),'ignore':!![]},{'name':'Agents','value':_0x47a5('0x34'),'ignore':![]},{'name':'Telephones','value':_0x47a5('0x35'),'ignore':![]}];var _0x3534cb=_(_0x50c086)[_0x47a5('0x36')](_0x47a5('0x37'))[_0x47a5('0x38')](_0x47a5('0x39'))[_0x47a5('0x39')]();if(_[_0x47a5('0x3a')](_0x3534cb,_0x52749b[_0x47a5('0x3b')])){return;}var _0x4caed5=_[_0x47a5('0x3c')](_0x50c086,[_0x47a5('0x39'),_0x52749b['role']])[_0x47a5('0x3d')];return db[_0x47a5('0x3e')][_0x47a5('0x31')]({'where':{'type':_0x4caed5,'resourceId':_0x52749b['id']}})['then'](function(){return _0x403028;});})[_0x47a5('0x21')](function(){_0x274e34[_0x47a5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ebba0,_0x19218a){return function(_0x54ae35){if(!_0x54ae35){_0x2ebba0['sendStatus'](0x194);}return _0x54ae35;};}function handleError(_0x5ebd8c,_0x12d9f2){_0x12d9f2=_0x12d9f2||0x1f4;return function(_0x5c569e){logger[_0x47a5('0x26')](_0x5c569e[_0x47a5('0x3f')]);if(_0x5c569e[_0x47a5('0x3d')]){delete _0x5c569e[_0x47a5('0x3d')];}_0x5ebd8c[_0x47a5('0x2a')](_0x12d9f2)[_0x47a5('0x40')](_0x5c569e);};}exports[_0x47a5('0x41')]=function(_0x1f3d01,_0x3fa2a8){var _0x36a24e={},_0x280500={},_0x1658e8={'count':0x0,'rows':[]};var _0x23d6d8=_['map'](db[_0x47a5('0x42')][_0x47a5('0x43')],function(_0x331474){return{'name':_0x331474[_0x47a5('0x44')],'type':_0x331474['type'][_0x47a5('0x45')]};});_0x280500['model']=_['differenceBy'](_['map'](_0x23d6d8,'name'),[_0x47a5('0x46'),'salt']);_0x280500[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x1f3d01[_0x47a5('0x47')]);_0x280500['filters']=_[_0x47a5('0x49')](_0x280500[_0x47a5('0x4a')],_0x280500['query']);_0x36a24e['attributes']=_[_0x47a5('0x49')](_0x280500['model'],qs[_0x47a5('0x4b')](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x36a24e[_0x47a5('0x4c')]=_0x36a24e[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x36a24e[_0x47a5('0x4c')]:_0x280500[_0x47a5('0x4a')];if(!_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x36a24e[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x36a24e[_0x47a5('0x2d')]=qs['offset'](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x36a24e['order']=qs['sort'](_0x1f3d01[_0x47a5('0x47')]['sort']);_0x36a24e[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_['pick'](_0x1f3d01['query'],_0x280500[_0x47a5('0x51')]));if(_0x1f3d01['query'][_0x47a5('0x36')]){_0x36a24e[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x36a24e[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x23d6d8,function(_0x26acd2){if(_0x26acd2[_0x47a5('0x53')]!=='VIRTUAL'){return db['sequelize'][_0x47a5('0x50')](db[_0x47a5('0x54')]['fn'](_0x47a5('0x55'),db[_0x47a5('0x54')][_0x47a5('0x56')](_0x26acd2[_0x47a5('0x3d')])),{'$like':db[_0x47a5('0x54')]['fn']('lower','%'+_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x36')]+'%')});}})});}_0x36a24e=_[_0x47a5('0x52')]({},_0x36a24e,_0x1f3d01['options']);var _0x12ca40={'where':_0x36a24e['where']};return db[_0x47a5('0x42')][_0x47a5('0x57')](_0x12ca40)[_0x47a5('0x21')](function(_0xf03bd5){_0x1658e8['count']=_0xf03bd5;if(_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x58')]){_0x36a24e[_0x47a5('0x59')]=[{'all':!![]}];}return db[_0x47a5('0x42')][_0x47a5('0x5a')](_0x36a24e);})[_0x47a5('0x21')](function(_0x24e9f4){_0x1658e8['rows']=_0x24e9f4;return _0x1658e8;})[_0x47a5('0x21')](respondWithFilteredResult(_0x3fa2a8,_0x36a24e))[_0x47a5('0x5b')](handleError(_0x3fa2a8,null));};exports[_0x47a5('0x5c')]=function(_0x8da9fb,_0x3329aa){var _0x1ab0bf={'raw':![],'where':{'id':_0x8da9fb[_0x47a5('0x5d')]['id']}},_0x572233={};_0x572233[_0x47a5('0x4a')]=_[_0x47a5('0x5e')](_['keys'](db[_0x47a5('0x42')][_0x47a5('0x43')]),[_0x47a5('0x46'),'salt']);_0x572233['query']=_[_0x47a5('0x48')](_0x8da9fb[_0x47a5('0x47')]);_0x572233['filters']=_['intersection'](_0x572233[_0x47a5('0x4a')],_0x572233['query']);_0x1ab0bf[_0x47a5('0x4c')]=_['intersection'](_0x572233['model'],qs[_0x47a5('0x4b')](_0x8da9fb[_0x47a5('0x47')]['fields']));_0x1ab0bf[_0x47a5('0x4c')]=_0x1ab0bf[_0x47a5('0x4c')]['length']?_0x1ab0bf['attributes']:_0x572233[_0x47a5('0x4a')];if(_0x8da9fb[_0x47a5('0x47')][_0x47a5('0x58')]){_0x1ab0bf[_0x47a5('0x59')]=[{'all':!![]}];}_0x1ab0bf=_['merge']({},_0x1ab0bf,_0x8da9fb[_0x47a5('0x5f')]);return db[_0x47a5('0x42')][_0x47a5('0x3c')](_0x1ab0bf)['then'](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x21')](respondWithResult(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports[_0x47a5('0x60')]=function(_0x470da6,_0x943a15){return db[_0x47a5('0x42')][_0x47a5('0x60')](_0x470da6['body'],{'raw':![],'individualHooks':!![]})[_0x47a5('0x21')](respondWithResult(_0x943a15,0xc9))['catch'](handleError(_0x943a15,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}delete _0x5eb150[_0x47a5('0x61')]['role'];return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x5eb150[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x5b')](handleError(_0x4f8564,null));};exports['describe']=function(_0x22c886,_0x274d31){return db['User'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x274d31,null))[_0x47a5('0x5b')](handleError(_0x274d31,null));};exports[_0x47a5('0x63')]=function(_0x2d6494,_0x215634,_0x35cca8){return db[_0x47a5('0x42')]['find']({'where':{'id':_0x2d6494[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x215634,null))[_0x47a5('0x21')](function(_0x26e7fc){if(_0x26e7fc){return _0x26e7fc[_0x47a5('0x63')](_0x2d6494['body'][_0x47a5('0x64')],_[_0x47a5('0x65')](_0x2d6494[_0x47a5('0x61')],[_0x47a5('0x64'),'id'])||{});}})[_0x47a5('0x21')](respondWithResult(_0x215634,null))[_0x47a5('0x5b')](handleError(_0x215634,null));};var getLicense=function(_0x453191){return new BPromise(function(_0x149d34,_0x350af8){var _0x44cb90=0x0;_0x453191[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x34')&&_0x149d34(_0x47a5('0x66'));return db[_0x47a5('0x42')]['count']({'where':{'$or':[{'role':_0x453191[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x35')?'telephone':[_0x47a5('0x67'),_0x47a5('0x33')]}]}})[_0x47a5('0x21')](function(_0x26f1ac){_0x44cb90=_0x26f1ac;return require('../../config/license/util')[_0x47a5('0x68')]();})['then'](function(_0x2d5ee6){var _0x487e21=_0x453191[_0x47a5('0x61')]['role']===_0x47a5('0x35')?_0x47a5('0x69'):_0x47a5('0x6a');if(!_['isNil'](_0x2d5ee6[_0x487e21])&&_0x44cb90>=_0x2d5ee6[_0x487e21]){return _0x350af8({'message':'License\x20limit\x20reached'});}return _0x149d34(util['format'](_0x47a5('0x6b'),_0x487e21,_0x44cb90));})[_0x47a5('0x5b')](function(_0xe3c0a7){return _0x350af8(_0xe3c0a7);});});};exports[_0x47a5('0x6c')]=function(_0x525055,_0x6c0f0){return getLicense(_0x525055)[_0x47a5('0x21')](function(_0x390bc0){if(!_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]){var _0xb9f589;return db[_0x47a5('0x6e')][_0x47a5('0x6f')](0x1)[_0x47a5('0x21')](function(_0xc69a68){return checkPasswordPattern(_0xc69a68,_0x525055[_0x47a5('0x61')][_0x47a5('0x46')],_0xc69a68['securePassword']);})[_0x47a5('0x21')](function(_0x4833be){_0xb9f589=_0x4833be[_0x47a5('0x70')];return db[_0x47a5('0x42')][_0x47a5('0x71')](_0x47a5('0x6d'));})[_0x47a5('0x21')](function(_0xa9c853){if(_[_0x47a5('0x72')](_0xa9c853)){if(_0xb9f589){_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=_0xb9f589;}else{_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=0x1;}}else{if(_[_0x47a5('0x72')](_0xb9f589)||_0xb9f589==_0xa9c853){_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=_0xa9c853+0x1;}else if(_0xb9f589>_0xa9c853){_0x525055[_0x47a5('0x61')]['internal']=_0xb9f589;}else{return db['sequelize']['query']('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[_0x47a5('0x54')][_0x47a5('0x73')]['SELECT']})[_0x47a5('0x21')](function(_0x44dda2){if(_0x44dda2&&_0x44dda2[_0x47a5('0x4d')]){for(var _0x396102=0x0,_0x3cd335=_0x44dda2[_0x47a5('0x4d')];_0x396102<_0x3cd335&&_[_0x47a5('0x72')](_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]);_0x396102++){if(_0xb9f589<=_0x44dda2[_0x396102][_0x47a5('0x74')]){_0x525055[_0x47a5('0x61')]['internal']=_0x44dda2[_0x396102][_0x47a5('0x74')];}else if(_0xb9f589>_0x44dda2[_0x396102][_0x47a5('0x74')]&&_0xb9f589<=_0x44dda2[_0x396102]['to']){_0x525055[_0x47a5('0x61')]['internal']=_0xb9f589;}}}if(_[_0x47a5('0x72')](_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')])){_0x525055['body'][_0x47a5('0x6d')]=_0xa9c853+0x1;}});}}});}})['then'](function(){if(_0x525055['body'][_0x47a5('0x75')]){_0x525055[_0x47a5('0x61')][_0x47a5('0x76')]=_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')];_0x525055[_0x47a5('0x61')]['VoiceMail']={'mailbox':_0x525055['body'][_0x47a5('0x6d')],'password':_0x525055['body'][_0x47a5('0x46')],'fullname':_0x525055[_0x47a5('0x61')][_0x47a5('0x77')],'email':_0x525055[_0x47a5('0x61')]['email']};}if(_0x525055[_0x47a5('0x61')]&&_0x525055['body']['role']===_0x47a5('0x34')){_0x525055[_0x47a5('0x61')]['permissions']=[_0x47a5('0x78'),_0x47a5('0x79'),_0x47a5('0x7a'),'110',_0x47a5('0x7b'),'105',_0x47a5('0x7c'),_0x47a5('0x7d'),_0x47a5('0x7e'),'109',_0x47a5('0x7f'),_0x47a5('0x80')];}return db[_0x47a5('0x42')]['create'](_0x525055[_0x47a5('0x61')],{'include':[{'model':db['VoiceMail'],'as':_0x47a5('0x81')}]});})['then'](function(_0x135d2e){if(_0x525055[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x33'))return _0x135d2e;var _0x51738b=_0x525055[_0x47a5('0x33')][_0x47a5('0x32')]({'plain':!![]});if(!_0x51738b)throw new Error(_0x47a5('0x82'));if(_0x51738b[_0x47a5('0x3b')]===_0x47a5('0x33')){var _0x57ac25=_0x135d2e['get']({'plain':!![]});var _0x569550=[{'name':'Agents','value':_0x47a5('0x34')},{'name':_0x47a5('0x83'),'value':_0x47a5('0x35')}];var _0x5018e9=_[_0x47a5('0x3c')](_0x569550,[_0x47a5('0x39'),_0x57ac25['role']])[_0x47a5('0x3d')];return db[_0x47a5('0x84')][_0x47a5('0x3c')]({'where':{'name':_0x5018e9,'userProfileId':_0x51738b[_0x47a5('0x85')]},'raw':!![]})['then'](function(_0x4b5353){if(_0x4b5353&&_0x4b5353[_0x47a5('0x86')]===0x0){return db[_0x47a5('0x3e')]['create']({'name':_0x57ac25[_0x47a5('0x3d')],'resourceId':_0x57ac25['id'],'type':_0x4b5353[_0x47a5('0x3d')],'sectionId':_0x4b5353['id']},{})['then'](function(){return _0x135d2e;});}else{return _0x135d2e;}})[_0x47a5('0x5b')](function(_0x2a02cd){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a02cd);throw _0x2a02cd;});}return _0x135d2e;})[_0x47a5('0x21')](respondWithResult(_0x6c0f0,0xc9))['catch'](handleError(_0x6c0f0,null));};exports[_0x47a5('0x87')]=function(_0x5e2946,_0x243c8b,_0x3c620e){var _0x4995be=![];if(_0x5e2946[_0x47a5('0x61')]['id']){delete _0x5e2946['body']['id'];}return db[_0x47a5('0x6e')][_0x47a5('0x88')]({'attributes':['id',_0x47a5('0x89')]})[_0x47a5('0x21')](function(_0x49b76a){_0x4995be=_0x49b76a[_0x47a5('0x89')];return db['User']['find']({'where':{'id':_0x5e2946[_0x47a5('0x5d')]['id']}});})[_0x47a5('0x21')](function(_0x352238){if(_0x352238){if(_0x352238['id']==_0x5e2946[_0x47a5('0x33')]['id']){if(!_0x5e2946[_0x47a5('0x61')]['oldPassword']||!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x352238[_0x47a5('0x8b')](_0x5e2946['body'][_0x47a5('0x8c')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8c')]==_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x8e'));}return _0x352238;}else if(_0x5e2946[_0x47a5('0x33')]['role']==_0x47a5('0x67')){if(!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x47a5('0x8f'));}return _0x352238;}else if(_0x5e2946[_0x47a5('0x33')]['role']=='user'){if(!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db['Sequelize'][(_0x47a5('0x1f'))](_0x47a5('0x8f'));}if(_0x352238['role']!=_0x47a5('0x34')){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x90'));}return _0x352238;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unauthorized');}}return null;})['then'](handleEntityNotFound(_0x243c8b,null))['then'](function(_0x133b7a){return checkPasswordPattern(_0x133b7a,_0x5e2946[_0x47a5('0x61')]['newPassword'],_0x4995be);})[_0x47a5('0x21')](saveUpdates({'password':_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')],'passwordResetAt':_0x5e2946[_0x47a5('0x33')]['id']==_0x5e2946[_0x47a5('0x5d')]['id']?moment():null},null))['then'](respondWithResult(_0x243c8b,null))[_0x47a5('0x5b')](handleError(_0x243c8b,null));};exports['addQueues']=function(_0x4eb534,_0x5db0ed,_0x21cb5f){var _0x4d23c8=_0x4eb534[_0x47a5('0x61')][_0x47a5('0x91')];return db[_0x47a5('0x42')]['find']({'where':{'id':_0x4eb534[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b'),_0x47a5('0x92'),_0x47a5('0x93'),'voicePause',_0x47a5('0x94')]})[_0x47a5('0x21')](handleEntityNotFound(_0x5db0ed,null))['then'](function(_0x42ba59){if(_0x42ba59){if(!utils[_0x47a5('0x95')](_0x4d23c8)){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x96'));}return _0x42ba59[_0x47a5('0x97')+_['capitalize'](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x99')](_0x4eb534['body'][_0x47a5('0x64')],{'penalty':_0x4eb534[_0x47a5('0x61')][_0x47a5('0x9a')]||0x0})[_0x47a5('0x9b')](function(_0x4ce0ac){for(var _0x4a68b0=0x0;_0x4a68b0<_0x4eb534['body']['ids'][_0x47a5('0x4d')];_0x4a68b0+=0x1){var _0x27793e={'UserId':_0x4eb534[_0x47a5('0x5d')]['id']};_0x27793e[_[_0x47a5('0x9c')](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x9d')]=_0x4eb534[_0x47a5('0x61')][_0x47a5('0x64')][_0x4a68b0];socket['emit'](_0x47a5('0x33')+_[_0x47a5('0x9c')](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x9e'),_0x27793e);}return _0x4ce0ac;})['then'](function(){if(_0x4d23c8==='voice'){return db[_0x47a5('0x9f')]['findAll']({'where':{'id':_0x4eb534['body'][_0x47a5('0x64')]||[]},'raw':!![],'attributes':['id',_0x47a5('0x3d')]});}})['then'](function(_0x148742){var _0x476991=_0x42ba59[_0x47a5('0x32')]({'plain':!![]});var _0x48835f=[];if(_0x4d23c8===_0x47a5('0xa0')&&_0x476991[_0x47a5('0x3b')]==='agent'&&_0x476991[_0x47a5('0x92')]){for(var _0x280b7b=0x0;_0x280b7b<_0x148742[_0x47a5('0x4d')];_0x280b7b+=0x1){_0x48835f[_0x47a5('0xa1')]({'membername':_0x476991[_0x47a5('0x3d')],'UserId':_0x476991['id'],'queue_name':_0x148742[_0x280b7b][_0x47a5('0x3d')],'VoiceQueueId':_0x148742[_0x280b7b]['id'],'interface':_['isNil'](_0x476991[_0x47a5('0x94')])?util['format'](_0x47a5('0xa2'),_0x476991[_0x47a5('0x3d')]):_0x476991[_0x47a5('0x94')],'paused':_0x476991[_0x47a5('0xa3')]||![],'penalty':_0x4eb534['body'][_0x47a5('0x9a')]||0x0});}return BPromise[_0x47a5('0xa4')](_0x48835f,function(_0x151540){return db[_0x47a5('0xa5')][_0x47a5('0xa6')](_0x151540);});}return _0x42ba59;});}})[_0x47a5('0x21')](respondWithStatusCode(_0x5db0ed,null))[_0x47a5('0x5b')](handleError(_0x5db0ed,null));};exports[_0x47a5('0xa7')]=function(_0x1b3e82,_0xa2045c,_0x109738){var _0x301031;return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x1b3e82[_0x47a5('0x5d')]['id']},'attributes':['id','name',_0x47a5('0x3b')]})[_0x47a5('0x21')](handleEntityNotFound(_0xa2045c,null))[_0x47a5('0x21')](function(_0x2ccf21){if(_0x2ccf21){_0x301031=_0x2ccf21;if(!_0x1b3e82[_0x47a5('0x47')]['channel']||!utils[_0x47a5('0x95')](_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x91')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x96'));}return _0x2ccf21[_0x47a5('0xa8')+_['capitalize'](_0x1b3e82['query'][_0x47a5('0x91')]['toLowerCase']())+_0x47a5('0x99')](_0x1b3e82['query'][_0x47a5('0x64')]);}})[_0x47a5('0x21')](function(_0x134c1a){for(var _0x2bc7ae=0x0;_0x2bc7ae<_0x1b3e82['query'][_0x47a5('0x64')][_0x47a5('0x4d')];_0x2bc7ae+=0x1){var _0xaca12c={'UserId':_0x1b3e82['params']['id']};_0xaca12c[_['capitalize'](_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x91')][_0x47a5('0x98')]())+_0x47a5('0x9d')]=_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x64')][_0x2bc7ae];socket[_0x47a5('0xa9')](_0x47a5('0x33')+_['capitalize'](_0x1b3e82[_0x47a5('0x47')]['channel'][_0x47a5('0x98')]())+_0x47a5('0xaa'),_0xaca12c);}return _0x134c1a;})['then'](function(){if(_0x1b3e82['query'][_0x47a5('0x91')]===_0x47a5('0xa0')){return db['UserVoiceQueueRt'][_0x47a5('0x31')]({'where':{'UserId':_0x1b3e82[_0x47a5('0x5d')]['id'],'VoiceQueueId':_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x64')]},'individualHooks':!![]})['then'](function(){return _0x301031;});}return _0x301031;})[_0x47a5('0x21')](respondWithStatusCode(_0xa2045c,null))['catch'](handleError(_0xa2045c,null));};exports['addAvatar']=function(_0x4c3ebb,_0x1e0171,_0x5a975d){_0x4c3ebb[_0x47a5('0x61')][_0x47a5('0xab')]=_0x4c3ebb[_0x47a5('0xac')][_0x47a5('0xad')];return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x4c3ebb[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1e0171,null))[_0x47a5('0x21')](saveUpdates(_0x4c3ebb[_0x47a5('0x61')],null))[_0x47a5('0x21')](respondWithResult(_0x1e0171,null))[_0x47a5('0x5b')](handleError(_0x1e0171,null));};exports[_0x47a5('0xae')]=function(_0x1bfa3b,_0xff64fb,_0x5e17cb){var _0xdd95c8=path[_0x47a5('0xaf')](config[_0x47a5('0xb0')],_0x47a5('0xb1'));return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x1bfa3b['params']['id']},'attributes':['id',_0x47a5('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0xff64fb,null))[_0x47a5('0x21')](function(_0x468b96){if(_0x468b96){if(_[_0x47a5('0x72')](_0x468b96['userpic'])){return _0xff64fb[_0x47a5('0xb2')](_0xdd95c8);}else{if(!fs[_0x47a5('0xb3')](path[_0x47a5('0xaf')](config['root'],'server/files/images/',_0x468b96[_0x47a5('0xab')]))){return _0xff64fb[_0x47a5('0xb2')](_0xdd95c8);}return _0xff64fb[_0x47a5('0xb2')](path[_0x47a5('0xaf')](config[_0x47a5('0xb0')],'server/files/images/',_0x468b96[_0x47a5('0xab')]));}}})['catch'](handleError(_0xff64fb,null));};exports[_0x47a5('0xb4')]=function(_0xdeaf4e,_0x46647f,_0x2d6ae7){var _0x5b18a2={};var _0x4dc67c={};var _0x1a054e;var _0x20034a;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0xdeaf4e[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46647f,null))[_0x47a5('0x21')](function(_0x3ae5b5){if(_0x3ae5b5){_0x1a054e=_0x3ae5b5;_0x4dc67c[_0x47a5('0x4a')]=_['keys'](db['CmContact'][_0x47a5('0x43')]);_0x4dc67c['query']=_[_0x47a5('0x48')](_0xdeaf4e[_0x47a5('0x47')]);_0x4dc67c[_0x47a5('0x51')]=_['intersection'](_0x4dc67c[_0x47a5('0x4a')],_0x4dc67c[_0x47a5('0x47')]);_0x5b18a2['attributes']=_[_0x47a5('0x49')](_0x4dc67c['model'],qs[_0x47a5('0x4b')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x5b18a2['attributes']=_0x5b18a2['attributes']['length']?_0x5b18a2['attributes']:_0x4dc67c['model'];_0x5b18a2[_0x47a5('0xb5')]=qs['sort'](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x5b18a2['where']=qs['filters'](_['pick'](_0xdeaf4e[_0x47a5('0x47')],_0x4dc67c['filters']));if(_0xdeaf4e['query']['filter']){_0x5b18a2[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5b18a2[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x5b18a2['attributes'],function(_0xdda046){var _0x559943={};_0x559943[_0xdda046]={'$like':'%'+_0xdeaf4e[_0x47a5('0x47')]['filter']+'%'};return _0x559943;})});}_0x5b18a2=_[_0x47a5('0x52')]({},_0x5b18a2,_0xdeaf4e[_0x47a5('0x5f')]);return _0x1a054e[_0x47a5('0xb4')](_0x5b18a2);}})['then'](function(_0x106bbe){if(_0x106bbe){_0x20034a=_0x106bbe[_0x47a5('0x4d')];if(_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4e')]('includeAll')){_0x5b18a2[_0x47a5('0x59')]=[{'model':db[_0x47a5('0xb7')],'as':_0x47a5('0xb8'),'required':![]},{'model':db[_0x47a5('0xb9')],'as':_0x47a5('0xba'),'attributes':['id',_0x47a5('0x3d'),'color'],'where':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]?{'id':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]}:undefined,'required':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]?!![]:![]}];}if(!_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x5b18a2[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5b18a2[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x1a054e['getContacts'](_0x5b18a2);}})[_0x47a5('0x21')](function(_0x5ee5c5){if(_0x5ee5c5){return _0x5ee5c5?{'count':_0x20034a,'rows':_0x5ee5c5}:null;}})['then'](respondWithResult(_0x46647f,null))[_0x47a5('0x5b')](handleError(_0x46647f,null));};exports[_0x47a5('0xbc')]=function(_0x36f910,_0x4d4039,_0x1f8e28){var _0xd8381b;var _0x101459;var _0x3e8fce={};var _0x30e5fb;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x36f910[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b')]})[_0x47a5('0x21')](handleEntityNotFound(_0x4d4039,null))[_0x47a5('0x21')](function(_0x203bc9){if(!utils['isValidChannel'](_0x36f910['query'][_0x47a5('0x91')])){throw new db['Sequelize'][(_0x47a5('0x1f'))](_0x47a5('0x96'));}_0xd8381b=_0x203bc9;var _0x1f776e={};_0x1f776e[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0xbd')][_0x47a5('0x43')]);_0x1f776e['query']=_[_0x47a5('0x48')](_0x36f910[_0x47a5('0x47')]);_0x1f776e[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x1f776e[_0x47a5('0x4a')],_0x1f776e[_0x47a5('0x47')]);_0x3e8fce[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x1f776e[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x36f910[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x3e8fce[_0x47a5('0x4c')]=_0x3e8fce[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x3e8fce[_0x47a5('0x4c')]:_0x1f776e[_0x47a5('0x4a')];_0x3e8fce[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x36f910[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x3e8fce[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x36f910['query'],_0x1f776e[_0x47a5('0x51')]));if(_0x36f910[_0x47a5('0x47')][_0x47a5('0x36')]){_0x3e8fce[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3e8fce[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x3e8fce[_0x47a5('0x4c')],function(_0x478e46){var _0x25fdca={};_0x25fdca[_0x478e46]={'$like':'%'+_0x36f910[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x25fdca;})});}_0x3e8fce=_['merge']({},_0x3e8fce,_0x36f910[_0x47a5('0x5f')]);switch(_0xd8381b[_0x47a5('0x3b')]){case _0x47a5('0x67'):return db[_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0xbd')][_0x47a5('0x5a')](_0x3e8fce);case _0x47a5('0x33'):case'agent':return _0xd8381b[_0x47a5('0x32')+_['capitalize'](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0x99')](_0x3e8fce);default:throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unknown\x20role');}})[_0x47a5('0x21')](function(_0xe3f0d7){_0x30e5fb=_0xe3f0d7[_0x47a5('0x4d')];if(!_0x36f910[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x3e8fce['limit']=qs[_0x47a5('0x2e')](_0x36f910[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x3e8fce[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x36f910['query'][_0x47a5('0x2d')]);}switch(_0xd8381b['role']){case _0x47a5('0x67'):return db[_['capitalize'](_0x36f910[_0x47a5('0x47')]['channel'])+'Queue'][_0x47a5('0x5a')](_0x3e8fce);case _0x47a5('0x33'):case'agent':return _0xd8381b[_0x47a5('0x32')+_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0x99')](_0x3e8fce);}})[_0x47a5('0x21')](function(_0x508622){return{'count':_0x30e5fb,'rows':_0x508622};})[_0x47a5('0x21')](respondWithResult(_0x4d4039,null))[_0x47a5('0x5b')](handleError(_0x4d4039,null));};exports[_0x47a5('0xbf')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={};var _0x2678cb={};var _0x56808d;var _0x13449b;return db[_0x47a5('0x42')]['findOne']({'where':{'id':_0x30b0f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x37721c,null))['then'](function(_0x1e38ce){if(_0x1e38ce){_0x56808d=_0x1e38ce;_0x2678cb[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_0x47a5('0xa5')][_0x47a5('0x43')]);_0x2678cb[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x30b0f9['query']);_0x2678cb[_0x47a5('0x51')]=_['intersection'](_0x2678cb[_0x47a5('0x4a')],_0x2678cb[_0x47a5('0x47')]);_0x5973d4[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x2678cb[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x5973d4[_0x47a5('0x4c')]=_0x5973d4[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x5973d4[_0x47a5('0x4c')]:_0x2678cb['model'];_0x5973d4[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x30b0f9[_0x47a5('0x47')]['sort']);_0x5973d4[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x30b0f9[_0x47a5('0x47')],_0x2678cb[_0x47a5('0x51')]));if(_0x30b0f9[_0x47a5('0x47')]['filter']){_0x5973d4[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5973d4[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x5973d4[_0x47a5('0x4c')],function(_0x3c80d7){var _0x42a384={};_0x42a384[_0x3c80d7]={'$like':'%'+_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x42a384;})});}_0x5973d4=_[_0x47a5('0x52')]({},_0x5973d4,_0x30b0f9['options']);return _0x56808d['getVoiceQueuesRt'](_0x5973d4);}})[_0x47a5('0x21')](function(_0x144524){if(_0x144524){_0x13449b=_0x144524[_0x47a5('0x4d')];if(!_0x30b0f9['query'][_0x47a5('0x4e')]('nolimit')){_0x5973d4['limit']=qs[_0x47a5('0x2e')](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs['offset'](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x56808d['getVoiceQueuesRt'](_0x5973d4);}})['then'](function(_0x50a2e4){if(_0x50a2e4){return _0x50a2e4?{'count':_0x13449b,'rows':_0x50a2e4}:null;}})[_0x47a5('0x21')](respondWithResult(_0x37721c,null))[_0x47a5('0x5b')](handleError(_0x37721c,null));};exports[_0x47a5('0xc0')]=function(_0x3c1a63,_0x1d2a59,_0x4c555c){var _0x5391aa={};var _0x362e82={};var _0x1b0fd4;var _0x3a0c7b;return db[_0x47a5('0x42')]['findOne']({'where':{'id':_0x3c1a63[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1d2a59,null))[_0x47a5('0x21')](function(_0x57a70d){if(_0x57a70d){_0x1b0fd4=_0x57a70d;_0x362e82['model']=_['keys'](db['ChatGroup'][_0x47a5('0x43')]);_0x362e82[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x3c1a63[_0x47a5('0x47')]);_0x362e82[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x362e82[_0x47a5('0x4a')],_0x362e82[_0x47a5('0x47')]);_0x5391aa[_0x47a5('0x4c')]=_['intersection'](_0x362e82[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x3c1a63['query'][_0x47a5('0x4b')]));_0x5391aa[_0x47a5('0x4c')]=_0x5391aa[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x5391aa['attributes']:_0x362e82[_0x47a5('0x4a')];_0x5391aa[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x3c1a63['query']['sort']);_0x5391aa[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x3c1a63['query'],_0x362e82[_0x47a5('0x51')]));if(_0x3c1a63[_0x47a5('0x47')][_0x47a5('0x36')]){_0x5391aa[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5391aa['where'],{'$or':_['map'](_0x5391aa[_0x47a5('0x4c')],function(_0x2797b9){var _0x9e8f05={};_0x9e8f05[_0x2797b9]={'$like':'%'+_0x3c1a63[_0x47a5('0x47')]['filter']+'%'};return _0x9e8f05;})});}_0x5391aa=_['merge']({},_0x5391aa,_0x3c1a63[_0x47a5('0x5f')]);return _0x1b0fd4['getGroups'](_0x5391aa);}})[_0x47a5('0x21')](function(_0x5c9ddd){if(_0x5c9ddd){_0x3a0c7b=_0x5c9ddd[_0x47a5('0x4d')];if(!_0x3c1a63['query'][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x5391aa[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3c1a63[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5391aa[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x3c1a63['query'][_0x47a5('0x2d')]);}return _0x1b0fd4[_0x47a5('0xc0')](_0x5391aa);}})['then'](function(_0x34f93d){if(_0x34f93d){return _0x34f93d?{'count':_0x3a0c7b,'rows':_0x34f93d}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1d2a59,null))['catch'](handleError(_0x1d2a59,null));};exports['getRecordings']=function(_0x330065,_0x55c4ae,_0x457634){var _0x181b57={'raw':!![],'where':{}};var _0x268c9c={};var _0x4f8b87={'count':0x0,'rows':[]};return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x330065[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x55c4ae,null))[_0x47a5('0x21')](function(_0x454609){if(_0x454609){_0x268c9c[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0xc1')][_0x47a5('0x43')]);_0x268c9c[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x330065[_0x47a5('0x47')]);_0x268c9c[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x268c9c['model'],_0x268c9c['query']);_0x181b57[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x268c9c[_0x47a5('0x4a')],qs['fields'](_0x330065['query'][_0x47a5('0x4b')]));_0x181b57[_0x47a5('0x4c')]=_0x181b57[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x181b57[_0x47a5('0x4c')]:_0x268c9c[_0x47a5('0x4a')];if(!_0x330065[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x181b57[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x330065['query'][_0x47a5('0x2e')]);_0x181b57[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x330065[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x181b57[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x330065[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x181b57[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x330065[_0x47a5('0x47')],_0x268c9c['filters']));_0x181b57[_0x47a5('0x50')]['UserId']=_0x454609['id'];if(_0x330065[_0x47a5('0x47')]['filter']){_0x181b57[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x181b57[_0x47a5('0x50')],{'$or':_['map'](_0x181b57[_0x47a5('0x4c')],function(_0x4aba8c){var _0x23667e={};_0x23667e[_0x4aba8c]={'$like':'%'+_0x330065[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x23667e;})});}_0x181b57=_[_0x47a5('0x52')]({},_0x181b57,_0x330065['options']);return db[_0x47a5('0xc1')]['count']({'where':_0x181b57['where']})[_0x47a5('0x21')](function(_0x15e970){_0x4f8b87[_0x47a5('0x57')]=_0x15e970;if(_0x330065[_0x47a5('0x47')][_0x47a5('0x58')]){_0x181b57[_0x47a5('0x59')]=[{'all':!![]}];}return db[_0x47a5('0xc1')][_0x47a5('0x5a')](_0x181b57);})[_0x47a5('0x21')](function(_0x598c19){_0x4f8b87['rows']=_0x598c19;return _0x4f8b87;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x55c4ae,_0x181b57))[_0x47a5('0x5b')](handleError(_0x55c4ae,null));};exports[_0x47a5('0xc2')]=function(_0x349166,_0x616b88,_0x4da0df){var _0x3cfa62={'raw':!![],'where':{}};var _0x3dbd9a={};var _0x16bcec={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x349166[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x616b88,null))['then'](function(_0x145286){if(_0x145286){_0x3dbd9a[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db['ScreenRecording'][_0x47a5('0x43')]);_0x3dbd9a[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x349166[_0x47a5('0x47')]);_0x3dbd9a[_0x47a5('0x51')]=_['intersection'](_0x3dbd9a[_0x47a5('0x4a')],_0x3dbd9a[_0x47a5('0x47')]);_0x3cfa62[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x3dbd9a['model'],qs['fields'](_0x349166[_0x47a5('0x47')]['fields']));_0x3cfa62[_0x47a5('0x4c')]=_0x3cfa62[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x3cfa62[_0x47a5('0x4c')]:_0x3dbd9a[_0x47a5('0x4a')];if(!_0x349166[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x3cfa62[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x349166['query']['limit']);_0x3cfa62[_0x47a5('0x2d')]=qs['offset'](_0x349166[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x3cfa62[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x349166[_0x47a5('0x47')]['sort']);_0x3cfa62['where']=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x349166[_0x47a5('0x47')],_0x3dbd9a[_0x47a5('0x51')]));_0x3cfa62[_0x47a5('0x50')]['UserId']=_0x145286['id'];if(_0x349166[_0x47a5('0x47')][_0x47a5('0x36')]){_0x3cfa62[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3cfa62[_0x47a5('0x50')],{'$or':_['map'](_0x3cfa62[_0x47a5('0x4c')],function(_0x171b0a){var _0xed859f={};_0xed859f[_0x171b0a]={'$like':'%'+_0x349166[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0xed859f;})});}_0x3cfa62=_[_0x47a5('0x52')]({},_0x3cfa62,_0x349166[_0x47a5('0x5f')]);return db[_0x47a5('0xc3')][_0x47a5('0x57')]({'where':_0x3cfa62[_0x47a5('0x50')]})[_0x47a5('0x21')](function(_0x5a6f09){_0x16bcec[_0x47a5('0x57')]=_0x5a6f09;if(_0x349166[_0x47a5('0x47')][_0x47a5('0x58')]){_0x3cfa62[_0x47a5('0x59')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x3cfa62);})['then'](function(_0x269086){_0x16bcec['rows']=_0x269086;return _0x16bcec;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x616b88,_0x3cfa62))[_0x47a5('0x5b')](handleError(_0x616b88,null));};exports['getChatInteractions']=function(_0x10c01f,_0x1d8538,_0x1ec47a){var _0x58bef7={};var _0x457398={};var _0x515ef0;var _0x2beef2;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x10c01f[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1d8538,null))[_0x47a5('0x21')](function(_0x4adfda){if(_0x4adfda){_0x515ef0=_0x4adfda;_0x457398['model']=_['keys'](db[_0x47a5('0xc4')][_0x47a5('0x43')]);_0x457398[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x10c01f[_0x47a5('0x47')]);_0x457398[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x457398[_0x47a5('0x4a')],_0x457398[_0x47a5('0x47')]);_0x58bef7[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x457398[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x10c01f[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x58bef7[_0x47a5('0x4c')]=_0x58bef7['attributes'][_0x47a5('0x4d')]?_0x58bef7[_0x47a5('0x4c')]:_0x457398[_0x47a5('0x4a')];_0x58bef7[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x10c01f[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x58bef7[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x10c01f['query'],_0x457398[_0x47a5('0x51')]));if(_0x10c01f[_0x47a5('0x47')]['filter']){_0x58bef7[_0x47a5('0x50')]=_['merge'](_0x58bef7[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x58bef7[_0x47a5('0x4c')],function(_0x27834d){var _0x374a81={};_0x374a81[_0x27834d]={'$like':'%'+_0x10c01f['query'][_0x47a5('0x36')]+'%'};return _0x374a81;})});}_0x58bef7=_[_0x47a5('0x52')]({},_0x58bef7,_0x10c01f[_0x47a5('0x5f')]);return _0x515ef0['getChatInteractions'](_0x58bef7);}})['then'](function(_0x1e75b9){if(_0x1e75b9){_0x2beef2=_0x1e75b9[_0x47a5('0x4d')];if(!_0x10c01f[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x58bef7[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x10c01f['query'][_0x47a5('0x2e')]);_0x58bef7[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x10c01f[_0x47a5('0x47')]['offset']);}return _0x515ef0[_0x47a5('0xc5')](_0x58bef7);}})['then'](function(_0x1a1570){if(_0x1a1570){return _0x1a1570?{'count':_0x2beef2,'rows':_0x1a1570}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1d8538,null))[_0x47a5('0x5b')](handleError(_0x1d8538,null));};exports[_0x47a5('0xc6')]=function(_0x5b7656,_0x1203f9,_0x147d77){var _0x402eb6={};var _0xed80c4={};var _0x46a2bd;var _0x4c2b0c;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x5b7656[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1203f9,null))[_0x47a5('0x21')](function(_0x3d4398){if(_0x3d4398){_0x46a2bd=_0x3d4398;_0xed80c4['model']=_[_0x47a5('0x48')](db[_0x47a5('0xc7')]['rawAttributes']);_0xed80c4['query']=_[_0x47a5('0x48')](_0x5b7656[_0x47a5('0x47')]);_0xed80c4[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0xed80c4[_0x47a5('0x4a')],_0xed80c4[_0x47a5('0x47')]);_0x402eb6['attributes']=_['intersection'](_0xed80c4[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x5b7656['query'][_0x47a5('0x4b')]));_0x402eb6[_0x47a5('0x4c')]=_0x402eb6['attributes'][_0x47a5('0x4d')]?_0x402eb6['attributes']:_0xed80c4['model'];_0x402eb6['order']=qs[_0x47a5('0xb6')](_0x5b7656[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x402eb6['where']=qs[_0x47a5('0x51')](_['pick'](_0x5b7656[_0x47a5('0x47')],_0xed80c4['filters']));if(_0x5b7656[_0x47a5('0x47')][_0x47a5('0x36')]){_0x402eb6[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x402eb6[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x402eb6[_0x47a5('0x4c')],function(_0x15d573){var _0x1396c2={};_0x1396c2[_0x15d573]={'$like':'%'+_0x5b7656['query'][_0x47a5('0x36')]+'%'};return _0x1396c2;})});}_0x402eb6=_[_0x47a5('0x52')]({},_0x402eb6,_0x5b7656[_0x47a5('0x5f')]);return _0x46a2bd['getOpenchannelInteractions'](_0x402eb6);}})[_0x47a5('0x21')](function(_0x1bd422){if(_0x1bd422){_0x4c2b0c=_0x1bd422[_0x47a5('0x4d')];if(!_0x5b7656[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x402eb6[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x5b7656[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x402eb6['offset']=qs['offset'](_0x5b7656['query']['offset']);}return _0x46a2bd[_0x47a5('0xc6')](_0x402eb6);}})['then'](function(_0x2330ae){if(_0x2330ae){return _0x2330ae?{'count':_0x4c2b0c,'rows':_0x2330ae}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1203f9,null))['catch'](handleError(_0x1203f9,null));};exports[_0x47a5('0xc8')]=function(_0x157ca3,_0x41ee22,_0x375c67){var _0x2cbf08={'raw':!![],'where':{}};var _0x1b3a60={};var _0x4a759c={'count':0x0,'rows':[]};return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x157ca3['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x41ee22,null))['then'](function(_0x412f6a){if(_0x412f6a){_0x1b3a60[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_0x47a5('0xc9')][_0x47a5('0x43')]);_0x1b3a60[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x157ca3['query']);_0x1b3a60[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x1b3a60['model'],_0x1b3a60[_0x47a5('0x47')]);_0x2cbf08[_0x47a5('0x4c')]=_['intersection'](_0x1b3a60[_0x47a5('0x4a')],qs['fields'](_0x157ca3[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x2cbf08[_0x47a5('0x4c')]=_0x2cbf08[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x2cbf08['attributes']:_0x1b3a60['model'];if(!_0x157ca3[_0x47a5('0x47')]['hasOwnProperty']('nolimit')){_0x2cbf08['limit']=qs[_0x47a5('0x2e')](_0x157ca3['query'][_0x47a5('0x2e')]);_0x2cbf08[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x157ca3['query']['offset']);}_0x2cbf08[_0x47a5('0xb5')]=qs['sort'](_0x157ca3['query'][_0x47a5('0xb6')]);_0x2cbf08['where']=qs['filters'](_[_0x47a5('0xbe')](_0x157ca3[_0x47a5('0x47')],_0x1b3a60['filters']));_0x2cbf08[_0x47a5('0x50')][_0x47a5('0xca')]=_0x412f6a['id'];if(_0x157ca3[_0x47a5('0x47')][_0x47a5('0x36')]){_0x2cbf08[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x2cbf08['where'],{'$or':_[_0x47a5('0x38')](_0x2cbf08[_0x47a5('0x4c')],function(_0x4641b1){var _0x26a3ad={};_0x26a3ad[_0x4641b1]={'$like':'%'+_0x157ca3['query'][_0x47a5('0x36')]+'%'};return _0x26a3ad;})});}_0x2cbf08=_[_0x47a5('0x52')]({},_0x2cbf08,_0x157ca3[_0x47a5('0x5f')]);return db['MailInteraction'][_0x47a5('0x57')]({'where':_0x2cbf08['where']})['then'](function(_0x187de4){_0x4a759c[_0x47a5('0x57')]=_0x187de4;if(_0x157ca3['query']['includeAll']){_0x2cbf08['include']=[{'all':!![]}];}return db[_0x47a5('0xc9')][_0x47a5('0x5a')](_0x2cbf08);})['then'](function(_0x462ac5){_0x4a759c['rows']=_0x462ac5;return _0x4a759c;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x41ee22,_0x2cbf08))[_0x47a5('0x5b')](handleError(_0x41ee22,null));};exports['getSmsInteractions']=function(_0x1528d2,_0x307d7f,_0x5f2507){var _0x3fbd67={};var _0x5bca81={};var _0x447c32;var _0x46ae21;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x1528d2[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x307d7f,null))[_0x47a5('0x21')](function(_0x1ebfcd){if(_0x1ebfcd){_0x447c32=_0x1ebfcd;_0x5bca81['model']=_[_0x47a5('0x48')](db[_0x47a5('0xcb')][_0x47a5('0x43')]);_0x5bca81[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x1528d2['query']);_0x5bca81[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x5bca81['model'],_0x5bca81[_0x47a5('0x47')]);_0x3fbd67[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x5bca81[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x1528d2['query'][_0x47a5('0x4b')]));_0x3fbd67['attributes']=_0x3fbd67['attributes'][_0x47a5('0x4d')]?_0x3fbd67['attributes']:_0x5bca81[_0x47a5('0x4a')];_0x3fbd67[_0x47a5('0xb5')]=qs['sort'](_0x1528d2[_0x47a5('0x47')]['sort']);_0x3fbd67[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x1528d2[_0x47a5('0x47')],_0x5bca81[_0x47a5('0x51')]));if(_0x1528d2[_0x47a5('0x47')]['filter']){_0x3fbd67[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3fbd67[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x3fbd67[_0x47a5('0x4c')],function(_0x1c0230){var _0x69b145={};_0x69b145[_0x1c0230]={'$like':'%'+_0x1528d2[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x69b145;})});}_0x3fbd67=_[_0x47a5('0x52')]({},_0x3fbd67,_0x1528d2[_0x47a5('0x5f')]);return _0x447c32[_0x47a5('0xcc')](_0x3fbd67);}})[_0x47a5('0x21')](function(_0x3f5f4c){if(_0x3f5f4c){_0x46ae21=_0x3f5f4c[_0x47a5('0x4d')];if(!_0x1528d2[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x3fbd67['limit']=qs[_0x47a5('0x2e')](_0x1528d2[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x3fbd67[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x1528d2[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x447c32[_0x47a5('0xcc')](_0x3fbd67);}})['then'](function(_0x247099){if(_0x247099){return _0x247099?{'count':_0x46ae21,'rows':_0x247099}:null;}})['then'](respondWithResult(_0x307d7f,null))[_0x47a5('0x5b')](handleError(_0x307d7f,null));};exports[_0x47a5('0xcd')]=function(_0x22bc01,_0x15245f,_0x7d41dd){var _0x58edf5={};var _0x7eed9d={};var _0x1faf8f;var _0x2668fb;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x22bc01[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x15245f,null))[_0x47a5('0x21')](function(_0x4123ca){if(_0x4123ca){_0x1faf8f=_0x4123ca;_0x7eed9d[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0xce')][_0x47a5('0x43')]);_0x7eed9d['query']=_[_0x47a5('0x48')](_0x22bc01[_0x47a5('0x47')]);_0x7eed9d[_0x47a5('0x51')]=_['intersection'](_0x7eed9d['model'],_0x7eed9d[_0x47a5('0x47')]);_0x58edf5[_0x47a5('0x4c')]=_['intersection'](_0x7eed9d[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x22bc01[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x58edf5[_0x47a5('0x4c')]=_0x58edf5[_0x47a5('0x4c')]['length']?_0x58edf5[_0x47a5('0x4c')]:_0x7eed9d['model'];_0x58edf5[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x22bc01[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x58edf5[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x22bc01[_0x47a5('0x47')],_0x7eed9d['filters']));if(_0x22bc01[_0x47a5('0x47')]['filter']){_0x58edf5[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x58edf5[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x58edf5[_0x47a5('0x4c')],function(_0x225aff){var _0x17e8fd={};_0x17e8fd[_0x225aff]={'$like':'%'+_0x22bc01['query'][_0x47a5('0x36')]+'%'};return _0x17e8fd;})});}_0x58edf5=_[_0x47a5('0x52')]({},_0x58edf5,_0x22bc01[_0x47a5('0x5f')]);return _0x1faf8f[_0x47a5('0xcd')](_0x58edf5);}})[_0x47a5('0x21')](function(_0x38ac56){if(_0x38ac56){_0x2668fb=_0x38ac56[_0x47a5('0x4d')];if(!_0x22bc01['query'][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x58edf5[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x22bc01['query']['limit']);_0x58edf5[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x22bc01[_0x47a5('0x47')]['offset']);}return _0x1faf8f[_0x47a5('0xcd')](_0x58edf5);}})[_0x47a5('0x21')](function(_0x5173c4){if(_0x5173c4){return _0x5173c4?{'count':_0x2668fb,'rows':_0x5173c4}:null;}})['then'](respondWithResult(_0x15245f,null))[_0x47a5('0x5b')](handleError(_0x15245f,null));};exports[_0x47a5('0xcf')]=function(_0x3a01a8,_0x58767a,_0x4b3955){var _0xbe4d48;var _0x3f93f6;var _0x394c88;var _0x509b44=!_[_0x47a5('0x72')](_0x3a01a8[_0x47a5('0x5d')]['id'])?_0x3a01a8[_0x47a5('0x5d')]['id']:!_['isNil'](_0x3a01a8[_0x47a5('0x33')]['id'])?_0x3a01a8['user']['id']:null;return db[_0x47a5('0x42')]['find']({'where':{'id':_0x509b44,'role':{'$or':[_0x47a5('0x67'),_0x47a5('0x33'),_0x47a5('0x34')]}},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0xd0'),_0x47a5('0xd1'),_0x47a5('0x3b'),_0x47a5('0x6d'),_0x47a5('0x93')]})[_0x47a5('0x21')](function(_0x5822a1){if(_0x5822a1){if(_0x5822a1[_0x47a5('0x3b')]===_0x47a5('0x34')){_0xbe4d48=_0x5822a1;if(_0x3a01a8[_0x47a5('0x61')][_0x47a5('0x94')]){_0x394c88=util[_0x47a5('0xd2')](_0x47a5('0xd3'),_0xbe4d48[_0x3a01a8[_0x47a5('0x61')][_0x47a5('0x94')]]);}else if(_0x3a01a8[_0x47a5('0x61')]['intrf']){_0x394c88=util[_0x47a5('0xd2')]('SIP/%s',_0x3a01a8[_0x47a5('0x61')]['intrf']);}else{_0x394c88=util[_0x47a5('0xd2')]('SIP/%s',_0xbe4d48['name']);}socket['to'](util[_0x47a5('0xd2')]('user:%s',_0xbe4d48['name']))[_0x47a5('0xa9')](_0x47a5('0xd4'),{'ip':_0x3a01a8[_0x47a5('0xd5')]['x-forwarded-for']||_0x3a01a8[_0x47a5('0xd6')]['remoteAddress']||_0x3a01a8[_0x47a5('0xd7')]['remoteAddress']||_0x3a01a8[_0x47a5('0xd6')][_0x47a5('0xd7')]['remoteAddress']});return db[_0x47a5('0xa5')][_0x47a5('0x31')]({'where':{'membername':_0xbe4d48['name']},'individualHooks':!![]});}}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0xbe4d48){return _0xbe4d48[_0x47a5('0xd8')]({'raw':!![]});}})[_0x47a5('0x21')](function(_0x219fad){if(_0xbe4d48){var _0x3d3ecc=[];if(_0x219fad){_0x3f93f6=_0x219fad;if(_0x3f93f6[_0x47a5('0x4d')]){for(var _0x58c85c=0x0;_0x58c85c<_0x3f93f6[_0x47a5('0x4d')];_0x58c85c++){_0x3d3ecc[_0x47a5('0xa1')]({'membername':_0xbe4d48[_0x47a5('0x3d')],'UserId':_0xbe4d48['id'],'queue_name':_0x3f93f6[_0x58c85c][_0x47a5('0x3d')],'VoiceQueueId':_0x3f93f6[_0x58c85c]['id'],'interface':_0x394c88,'paused':_0xbe4d48[_0x47a5('0x93')]||![],'penalty':_0x3f93f6[_0x58c85c][_0x47a5('0xd9')]||0x0});}return BPromise[_0x47a5('0xa4')](_0x3d3ecc,function(_0x2cb7bc){return db['UserVoiceQueueRt']['upsert'](_0x2cb7bc);});}}}})[_0x47a5('0x21')](function(){if(_0xbe4d48){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0xbe4d48[_0x47a5('0x3d')],'exitAt':null}});}})['then'](function(_0x26fa54){if(_0xbe4d48){var _0x597b10=[];_0x26fa54[_0x47a5('0xdb')](function(_0x4e2798){_0x597b10['push'](_0x4e2798[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))}));});return BPromise['all'](_0x597b10);}})[_0x47a5('0x21')](function(){if(_0xbe4d48){var _0x2f35d7=[];var _0x4eee42=[];var _0x293db4=utils[_0x47a5('0xdd')]();var _0x1ce2ab={'membername':_0xbe4d48[_0x47a5('0x3d')],'interface':_0x394c88,'enterAt':moment()['format'](_0x47a5('0xdc')),'role':_0xbe4d48['role'],'internal':_0xbe4d48[_0x47a5('0x6d')]};_0x293db4['forEach'](function(_0x272d3f){_0x2f35d7[_0x47a5('0xa1')](_[_0x47a5('0x52')]({'channel':_0x272d3f,'type':'LOGIN','data1':_0x3a01a8[_0x47a5('0x61')][_0x47a5('0xde')],'data2':_0x394c88},_0x1ce2ab));if(_0xbe4d48[_0x47a5('0x93')]){_0x4eee42['push'](_[_0x47a5('0x52')]({'channel':_0x272d3f,'type':_0x47a5('0xdf'),'data1':_0x47a5('0xe0')},_0x1ce2ab));}});return db[_0x47a5('0xda')]['bulkCreate'](_0x2f35d7['concat'](_0x4eee42),{'individualHooks':!![]});}})[_0x47a5('0x21')](function(){if(_0xbe4d48){return _0xbe4d48[_0x47a5('0x30')]({'online':!![],'lastLoginAt':moment()['format'](_0x47a5('0xdc')),'voicePause':_0xbe4d48['loginInPause']||![],'mailPause':_0xbe4d48[_0x47a5('0x93')]||![],'chatPause':_0xbe4d48[_0x47a5('0x93')]||![],'faxPause':_0xbe4d48[_0x47a5('0x93')]||![],'smsPause':_0xbe4d48[_0x47a5('0x93')]||![],'openchannelPause':_0xbe4d48[_0x47a5('0x93')]||![],'pauseType':_0xbe4d48[_0x47a5('0x93')]?'LOGININPAUSE':null,'interface':_0x394c88,'lastPauseAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))});}})[_0x47a5('0x21')](function(_0x4c4887){if(_0x3a01a8[_0x47a5('0xe1')]){return _0x4b3955();}else{return BPromise[_0x47a5('0xe2')](_0x4c4887)[_0x47a5('0x21')](respondWithResult(_0x58767a,null));}})[_0x47a5('0x5b')](handleError(_0x58767a,null));};exports[_0x47a5('0xe3')]=function(_0x45f55f,_0x1fa671,_0x52c4b0){var _0x214b20;return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x45f55f[_0x47a5('0x5d')]['id'],'role':'agent'},'attributes':['id','name','role']})[_0x47a5('0x21')](handleEntityNotFound(_0x1fa671,null))[_0x47a5('0x21')](function(_0x3a4ed1){if(_0x3a4ed1){_0x214b20=_0x3a4ed1;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x214b20[_0x47a5('0x3d')]},'individualHooks':!![]});}})[_0x47a5('0x21')](function(){return db[_0x47a5('0xda')][_0x47a5('0x5a')]({'where':{'membername':_0x214b20[_0x47a5('0x3d')],'exitAt':null}});})['then'](function(_0x24e2db){var _0x401fa2=[];_0x24e2db[_0x47a5('0xdb')](function(_0x1afd4f){_0x401fa2[_0x47a5('0xa1')](_0x1afd4f[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))}));});return BPromise[_0x47a5('0xe4')](_0x401fa2);})['then'](function(){return _0x214b20[_0x47a5('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x47a5('0x21')](respondWithResult(_0x1fa671,null))[_0x47a5('0x5b')](handleError(_0x1fa671,null));};exports[_0x47a5('0xe5')]=function(_0xc91abd,_0x5411d9,_0x13fbff){var _0x4691da;return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x1},{'where':{'UserId':_0xc91abd['params']['id']},'individualHooks':!![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0x42')]['find']({'where':{'id':_0xc91abd[_0x47a5('0x5d')]['id'],'role':_0x47a5('0x34')},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b'),_0x47a5('0x6d'),_0x47a5('0x94')]});})['then'](handleEntityNotFound(_0x5411d9,null))[_0x47a5('0x21')](function(_0x7a562d){if(_0x7a562d){_0x4691da=_0x7a562d;return respondWithRpcPromise('QueuePause','pause',{'id':_0x4691da['id'],'name':_0x4691da['name'],'pause':!![]});}})[_0x47a5('0x21')](function(){if(_0x4691da){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0x4691da[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}});}})['then'](function(_0x1d50e6){if(_0x1d50e6[_0x47a5('0x4d')]){var _0x10b205=moment()[_0x47a5('0xd2')](_0x47a5('0xdc'));for(var _0x5eb17b=0x0,_0x3886ef=_0x1d50e6['length'];_0x5eb17b<_0x3886ef;_0x5eb17b++){_0x1d50e6[_0x5eb17b][_0x47a5('0xe6')]({'exitAt':_0x10b205});}}})['then'](function(){var _0x2e392c=[];var _0x20a276=utils['getChannels']();_0x20a276['forEach'](function(_0x4c271d){_0x2e392c[_0x47a5('0xa1')]({'channel':_0x4c271d,'membername':_0x4691da[_0x47a5('0x3d')],'interface':_[_0x47a5('0x72')](_0x4691da['interface'])?util[_0x47a5('0xd2')](_0x47a5('0xa2'),_0x4691da[_0x47a5('0x3d')]):_0x4691da[_0x47a5('0x94')],'type':_0x47a5('0xdf'),'enterAt':moment()[_0x47a5('0xd2')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xc91abd[_0x47a5('0x61')]['type']||_0x47a5('0xe7'),'role':_0x4691da[_0x47a5('0x3b')],'internal':_0x4691da[_0x47a5('0x6d')]});});return db['MemberReport'][_0x47a5('0x60')](_0x2e392c,{'individualHooks':!![]});})[_0x47a5('0x21')](function(){return _0x4691da[_0x47a5('0x30')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xc91abd[_0x47a5('0x61')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))});})[_0x47a5('0x21')](respondWithResult(_0x5411d9,null))[_0x47a5('0x5b')](handleError(_0x5411d9,null));};exports['unpause']=function(_0x3d67f2,_0xc1fbd,_0x1b8fe1){var _0x477b0a;return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x3d67f2[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),'role',_0x47a5('0xa3'),'mailPause',_0x47a5('0xe8'),'faxPause',_0x47a5('0xe9'),_0x47a5('0xea'),_0x47a5('0xeb'),_0x47a5('0xec')]})[_0x47a5('0x21')](handleEntityNotFound(_0xc1fbd,null))[_0x47a5('0x21')](function(_0x332861){if(_0x332861){_0x477b0a=_0x332861;if(_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')]&&!utils[_0x47a5('0x95')](_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unknown\x20channel');}switch(_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')]){case _0x47a5('0xa0'):return respondWithRpcPromise(_0x47a5('0xed'),_0x47a5('0xee'),{'id':_0x477b0a['id'],'name':_0x477b0a['name'],'pause':![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x0},{'where':{'UserId':_0x477b0a['id']},'individualHooks':!![]});})[_0x47a5('0x21')](function(){return db['MemberReport'][_0x47a5('0x3c')]({'where':{'channel':_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')],'membername':_0x477b0a['name'],'type':_0x47a5('0xdf'),'exitAt':null}});})[_0x47a5('0x21')](function(_0x220bbc){if(_0x220bbc){return _0x220bbc[_0x47a5('0x30')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x47a5('0xef')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x477b0a[_0x47a5('0x30')]({'voicePause':![]});});case _0x47a5('0xf0'):case _0x47a5('0xf1'):case _0x47a5('0xf2'):case'sms':case _0x47a5('0xf3'):return db['MemberReport'][_0x47a5('0x3c')]({'where':{'channel':_0x3d67f2['body'][_0x47a5('0x91')],'membername':_0x477b0a[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}})[_0x47a5('0x21')](function(_0x28b7c5){if(_0x28b7c5){return _0x28b7c5[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x47a5('0xef')},{'individualHooks':!![]});}return null;})[_0x47a5('0x21')](function(){var _0x34827f={};_[_0x47a5('0xf4')](_0x34827f,util[_0x47a5('0xd2')](_0x47a5('0xf5'),_0x3d67f2['body'][_0x47a5('0x91')],_0x47a5('0xf6')),![]);return _0x477b0a[_0x47a5('0x30')](_0x34827f);});default:return respondWithRpcPromise(_0x47a5('0xed'),'unpause',{'id':_0x477b0a['id'],'name':_0x477b0a[_0x47a5('0x3d')],'pause':![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x0},{'where':{'UserId':_0x477b0a['id']}});})[_0x47a5('0x21')](function(){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0x477b0a[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}});})['then'](function(_0xf49931){var _0x3fdc24=[];_0xf49931[_0x47a5('0xdb')](function(_0x4aaac3){_0x3fdc24[_0x47a5('0xa1')](_0x4aaac3['update']({'exitAt':moment()['format'](_0x47a5('0xdc')),'data2':_0x47a5('0xef')}));});return BPromise[_0x47a5('0xe4')](_0x3fdc24);})[_0x47a5('0x21')](function(){return _0x477b0a['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0xc1fbd,null))[_0x47a5('0x5b')](handleError(_0xc1fbd,null));};exports[_0x47a5('0xf7')]=function(_0x110692,_0x542be5,_0x2273ad){var _0x540856={};var _0x266b23={};var _0x37ee58;var _0x5f4c9b;return db['User'][_0x47a5('0x88')]({'where':{'id':_0x110692['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x542be5,null))[_0x47a5('0x21')](function(_0xb112ff){if(_0xb112ff){_0x37ee58=_0xb112ff;_0x266b23['model']=_[_0x47a5('0x48')](db['Team'][_0x47a5('0x43')]);_0x266b23[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x110692[_0x47a5('0x47')]);_0x266b23[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x266b23[_0x47a5('0x4a')],_0x266b23[_0x47a5('0x47')]);_0x540856['attributes']=_[_0x47a5('0x49')](_0x266b23[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x110692[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x540856[_0x47a5('0x4c')]=_0x540856[_0x47a5('0x4c')]['length']?_0x540856[_0x47a5('0x4c')]:_0x266b23[_0x47a5('0x4a')];_0x540856[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x110692[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x540856[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x110692[_0x47a5('0x47')],_0x266b23[_0x47a5('0x51')]));if(_0x110692[_0x47a5('0x47')][_0x47a5('0x36')]){_0x540856[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x540856[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x540856[_0x47a5('0x4c')],function(_0x221166){var _0x4a91f3={};_0x4a91f3[_0x221166]={'$like':'%'+_0x110692['query']['filter']+'%'};return _0x4a91f3;})});}_0x540856=_[_0x47a5('0x52')]({},_0x540856,_0x110692[_0x47a5('0x5f')]);return _0x37ee58[_0x47a5('0xf7')](_0x540856);}})['then'](function(_0x5bc8ec){if(_0x5bc8ec){_0x5f4c9b=_0x5bc8ec[_0x47a5('0x4d')];if(!_0x110692[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x540856[_0x47a5('0x2e')]=qs['limit'](_0x110692[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x540856[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x110692[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x37ee58[_0x47a5('0xf7')](_0x540856);}})[_0x47a5('0x21')](function(_0x3bd433){if(_0x3bd433){return _0x3bd433?{'count':_0x5f4c9b,'rows':_0x3bd433}:null;}})[_0x47a5('0x21')](respondWithResult(_0x542be5,null))[_0x47a5('0x5b')](handleError(_0x542be5,null));};exports['addTeams']=function(_0x51d725,_0x56ae6a){return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x51d725[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x56ae6a,null))[_0x47a5('0x21')](function(_0x3e80b7){if(_0x3e80b7){var _0x2e7341=_0x3e80b7['get']({'plain':!![]});return _0x3e80b7[_0x47a5('0xf8')](_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')],_[_0x47a5('0x65')](_0x51d725[_0x47a5('0x61')],['ids','id'])||{})[_0x47a5('0x21')](function(){for(var _0x4456b2=0x0;_0x4456b2<_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')][_0x47a5('0x4d')];_0x4456b2++){var _0x4013b0=[];db['Team'][_0x47a5('0x88')]({'where':{'id':_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')][_0x4456b2]}})[_0x47a5('0x21')](function(_0x5ed8b7){_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xd8')]()[_0x47a5('0x21')](function(_0x4cedc2){for(var _0x5b62ef=0x0;_0x5b62ef<_0x4cedc2[_0x47a5('0x4d')];_0x5b62ef++){_0x4cedc2[_0x5b62ef]['setDataValue'](_0x47a5('0x91'),_0x47a5('0xf9'));}return _0x4cedc2;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfa')]()[_0x47a5('0x21')](function(_0x2ff028){for(var _0x375f3d=0x0;_0x375f3d<_0x2ff028[_0x47a5('0x4d')];_0x375f3d++){_0x2ff028[_0x375f3d][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xfc'));}return _0x2ff028;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfd')]()['then'](function(_0x42e9ac){for(var _0x3a4c03=0x0;_0x3a4c03<_0x42e9ac[_0x47a5('0x4d')];_0x3a4c03++){_0x42e9ac[_0x3a4c03][_0x47a5('0xfb')](_0x47a5('0x91'),'Mail');}return _0x42e9ac;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfe')]()['then'](function(_0x397a3a){for(var _0x389d99=0x0;_0x389d99<_0x397a3a[_0x47a5('0x4d')];_0x389d99++){_0x397a3a[_0x389d99]['setDataValue'](_0x47a5('0x91'),_0x47a5('0xff'));}return _0x397a3a;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0x100')]()[_0x47a5('0x21')](function(_0x3673d9){for(var _0x347777=0x0;_0x347777<_0x3673d9['length'];_0x347777++){_0x3673d9[_0x347777][_0x47a5('0xfb')]('channel',_0x47a5('0x101'));}return _0x3673d9;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0x102')]()[_0x47a5('0x21')](function(_0x4233b4){for(var _0x33b9a8=0x0;_0x33b9a8<_0x4233b4[_0x47a5('0x4d')];_0x33b9a8++){_0x4233b4[_0x33b9a8][_0x47a5('0xfb')]('channel','Openchannel');}return _0x4233b4;}));return BPromise['all'](_0x4013b0);})[_0x47a5('0x21')](function(_0x157b95){var _0x55d2fe=_['flatten'](_0x157b95);_0x4013b0=[];return db[_0x47a5('0x54')][_0x47a5('0x103')](function(_0x96a85e){for(var _0x43ad6f=0x0;_0x43ad6f<_0x55d2fe['length'];_0x43ad6f++){_0x4013b0['push'](_0x55d2fe[_0x43ad6f]['addAgent'](_0x2e7341['id']),{'transaction':_0x96a85e});}return BPromise[_0x47a5('0xe4')](_0x4013b0)[_0x47a5('0x21')](function(){if(_0x2e7341[_0x47a5('0x92')]){return BPromise['each'](_[_0x47a5('0x36')](_0x55d2fe,function(_0x40c37a){return _0x40c37a[_0x47a5('0x104')]('channel')===_0x47a5('0xf9');}),function(_0x2cd01e){return db[_0x47a5('0xa5')][_0x47a5('0xa6')]({'membername':_0x2e7341['name'],'UserId':_0x2e7341['id'],'queue_name':_0x2cd01e['name'],'VoiceQueueId':_0x2cd01e['id'],'interface':_['isNil'](_0x2e7341[_0x47a5('0x94')])?util[_0x47a5('0xd2')](_0x47a5('0xa2'),_0x2e7341[_0x47a5('0x3d')]):_0x2e7341['interface'],'paused':_0x2e7341[_0x47a5('0xa3')]||![],'penalty':_0x2e7341[_0x47a5('0x9a')]},{'transaction':_0x96a85e});});}else{return;}})[_0x47a5('0x21')](function(){for(var _0x174e97=0x0;_0x174e97<_0x55d2fe[_0x47a5('0x4d')];_0x174e97++){var _0x59e7ac=_0x55d2fe[_0x174e97][_0x47a5('0x104')](_0x47a5('0x91'));var _0x3067a6=_0x59e7ac+_0x47a5('0x9d');socket[_0x47a5('0xa9')]('user'+_0x59e7ac+_0x47a5('0x9e'),{'UserId':_0x2e7341['id'],['queueField']:_0x55d2fe[_0x174e97]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x56ae6a,null))[_0x47a5('0x5b')](handleError(_0x56ae6a,null));};exports[_0x47a5('0x105')]=function(_0x2a6f95,_0x1cd13){return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x2a6f95['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1cd13,null))['then'](function(_0x539be9){if(_0x539be9){var _0x78040f=_0x539be9['get']({'plain':!![]});var _0x52b7ac=_0x2a6f95[_0x47a5('0x47')][_0x47a5('0x64')];return _0x539be9[_0x47a5('0x105')](_0x52b7ac)['then'](function(){for(var _0x5177ec=0x0;_0x5177ec<_0x52b7ac[_0x47a5('0x4d')];_0x5177ec++){var _0x21f34f=[];db[_0x47a5('0x106')]['findOne']({'where':{'id':_0x52b7ac[_0x5177ec]}})[_0x47a5('0x21')](function(_0x502d6a){_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xd8')]()[_0x47a5('0x21')](function(_0x45d525){for(var _0x4f3d20=0x0;_0x4f3d20<_0x45d525[_0x47a5('0x4d')];_0x4f3d20++){_0x45d525[_0x4f3d20][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xf9'));}return _0x45d525;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xfa')]()[_0x47a5('0x21')](function(_0xc787a6){for(var _0x148464=0x0;_0x148464<_0xc787a6[_0x47a5('0x4d')];_0x148464++){_0xc787a6[_0x148464]['setDataValue']('channel',_0x47a5('0xfc'));}return _0xc787a6;}));_0x21f34f['push'](_0x502d6a[_0x47a5('0xfd')]()[_0x47a5('0x21')](function(_0x16cfed){for(var _0x5630d2=0x0;_0x5630d2<_0x16cfed[_0x47a5('0x4d')];_0x5630d2++){_0x16cfed[_0x5630d2][_0x47a5('0xfb')]('channel','Mail');}return _0x16cfed;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xfe')]()['then'](function(_0x164ceb){for(var _0x16f7d6=0x0;_0x16f7d6<_0x164ceb['length'];_0x16f7d6++){_0x164ceb[_0x16f7d6][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xff'));}return _0x164ceb;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0x100')]()[_0x47a5('0x21')](function(_0x44bab7){for(var _0x5e6a83=0x0;_0x5e6a83<_0x44bab7[_0x47a5('0x4d')];_0x5e6a83++){_0x44bab7[_0x5e6a83][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0x101'));}return _0x44bab7;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a['getOpenchannelQueues']()['then'](function(_0x3a0c77){for(var _0x53f771=0x0;_0x53f771<_0x3a0c77[_0x47a5('0x4d')];_0x53f771++){_0x3a0c77[_0x53f771][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0x107'));}return _0x3a0c77;}));return BPromise[_0x47a5('0xe4')](_0x21f34f);})[_0x47a5('0x21')](function(_0x5d6bd9){var _0x40bee3=_[_0x47a5('0x108')](_0x5d6bd9);_0x21f34f=[];return db[_0x47a5('0x54')][_0x47a5('0x103')](function(_0x27d543){for(var _0x28c8b2=0x0;_0x28c8b2<_0x40bee3[_0x47a5('0x4d')];_0x28c8b2++){_0x21f34f[_0x47a5('0xa1')](_0x40bee3[_0x28c8b2][_0x47a5('0x109')](_0x78040f['id']),{'transaction':_0x27d543});}return BPromise['all'](_0x21f34f)[_0x47a5('0x21')](function(){if(_0x78040f[_0x47a5('0x92')]){return BPromise[_0x47a5('0xa4')](_[_0x47a5('0x36')](_0x40bee3,function(_0xf2a1f6){return _0xf2a1f6[_0x47a5('0x104')](_0x47a5('0x91'))==='Voice';}),function(_0x181b62){return db[_0x47a5('0xa5')][_0x47a5('0x31')]({'where':{'VoiceQueueId':_0x181b62['id'],'UserId':_0x78040f['id']},'transaction':_0x27d543});});}else{return;}})[_0x47a5('0x21')](function(){for(var _0x8b0c50=0x0;_0x8b0c50<_0x40bee3[_0x47a5('0x4d')];_0x8b0c50++){var _0x4b3dee=_0x40bee3[_0x8b0c50][_0x47a5('0x104')](_0x47a5('0x91'));var _0x1911a8=_0x4b3dee+_0x47a5('0x9d');socket['emit']('user'+_0x4b3dee+'Queue:remove',{'UserId':_0x78040f['id'],['queueField']:_0x40bee3[_0x8b0c50]['id']});}});});});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x1cd13,null))[_0x47a5('0x5b')](handleError(_0x1cd13,null));};exports[_0x47a5('0x10a')]=function(_0x140311,_0x55a2e3,_0x44da0c){var _0x557632={};var _0x44d91e={};var _0x5b133e;var _0x154e18;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x140311['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x55a2e3,null))[_0x47a5('0x21')](function(_0x2b919b){if(_0x2b919b){_0x5b133e=_0x2b919b;_0x44d91e[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db['CmList'][_0x47a5('0x43')]);_0x44d91e[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x140311['query']);_0x44d91e[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x44d91e[_0x47a5('0x4a')],_0x44d91e[_0x47a5('0x47')]);_0x557632['attributes']=_['intersection'](_0x44d91e[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x140311[_0x47a5('0x47')]['fields']));_0x557632[_0x47a5('0x4c')]=_0x557632[_0x47a5('0x4c')]['length']?_0x557632[_0x47a5('0x4c')]:_0x44d91e['model'];_0x557632[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x140311[_0x47a5('0x47')]['sort']);_0x557632[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x140311[_0x47a5('0x47')],_0x44d91e['filters']));if(_0x140311[_0x47a5('0x47')]['filter']){_0x557632[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x557632[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x557632[_0x47a5('0x4c')],function(_0x327287){var _0x105bf4={};_0x105bf4[_0x327287]={'$like':'%'+_0x140311['query'][_0x47a5('0x36')]+'%'};return _0x105bf4;})});}_0x557632=_[_0x47a5('0x52')]({},_0x557632,_0x140311[_0x47a5('0x5f')]);return _0x5b133e['getLists'](_0x557632);}})['then'](function(_0x244ad1){if(_0x244ad1){_0x154e18=_0x244ad1[_0x47a5('0x4d')];if(!_0x140311[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x557632[_0x47a5('0x2e')]=qs['limit'](_0x140311[_0x47a5('0x47')]['limit']);_0x557632[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x140311['query'][_0x47a5('0x2d')]);}return _0x5b133e[_0x47a5('0x10a')](_0x557632);}})[_0x47a5('0x21')](function(_0xf33ce7){if(_0xf33ce7){return _0xf33ce7?{'count':_0x154e18,'rows':_0xf33ce7}:null;}})['then'](respondWithResult(_0x55a2e3,null))['catch'](handleError(_0x55a2e3,null));};exports[_0x47a5('0x10b')]=function(_0x5d4843,_0x1f5f9a,_0x5b52ef){var _0x13d821={};var _0x5035d9={};var _0x314d50;var _0x2780a9;return db['User'][_0x47a5('0x88')]({'where':{'id':_0x5d4843[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1f5f9a,null))[_0x47a5('0x21')](function(_0x4410c4){if(_0x4410c4){_0x314d50=_0x4410c4;_0x5035d9[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0x42')][_0x47a5('0x43')]);_0x5035d9[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x5d4843[_0x47a5('0x47')]);_0x5035d9[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x5035d9[_0x47a5('0x4a')],_0x5035d9['query']);_0x13d821['attributes']=_[_0x47a5('0x49')](_0x5035d9[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x5d4843['query'][_0x47a5('0x4b')]));_0x13d821[_0x47a5('0x4c')]=_0x13d821[_0x47a5('0x4c')]['length']?_0x13d821[_0x47a5('0x4c')]:_0x5035d9[_0x47a5('0x4a')];_0x13d821[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x5d4843['query'][_0x47a5('0xb6')]);_0x13d821[_0x47a5('0x50')]=qs['filters'](_['pick'](_0x5d4843[_0x47a5('0x47')],_0x5035d9['filters']));if(_0x5d4843[_0x47a5('0x47')][_0x47a5('0x36')]){_0x13d821[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x13d821['where'],{'$or':_[_0x47a5('0x38')](_0x13d821[_0x47a5('0x4c')],function(_0x3c6d55){var _0x2022cf={};_0x2022cf[_0x3c6d55]={'$like':'%'+_0x5d4843[_0x47a5('0x47')]['filter']+'%'};return _0x2022cf;})});}_0x13d821[_0x47a5('0x4a')]=db[_0x47a5('0x42')];_0x13d821['as']='Agents';_0x13d821=_[_0x47a5('0x52')]({},_0x13d821,_0x5d4843[_0x47a5('0x5f')]);return _0x314d50['getVoiceQueues']({'include':[_0x13d821]});}})[_0x47a5('0x21')](function(_0x20d637){if(_0x20d637){var _0x3d67f8={},_0x53f444=[],_0x4e558d=0x0;for(var _0x13e1da=0x0;_0x13e1da<_0x20d637[_0x47a5('0x4d')];_0x13e1da+=0x1){for(var _0xf6f823=0x0,_0x162fc1;_0xf6f823<_0x20d637[_0x13e1da][_0x47a5('0x10c')][_0x47a5('0x4d')];_0xf6f823+=0x1){_0x162fc1=_0x20d637[_0x13e1da][_0x47a5('0x10c')][_0xf6f823][_0x47a5('0x32')]({'plain':!![]});_0x3d67f8[_0x162fc1['id']]=_0x162fc1;}}_0x3d67f8=_[_0x47a5('0x10d')](_0x3d67f8);for(var _0x3122b5=qs[_0x47a5('0x2d')](_0x5d4843[_0x47a5('0x47')]['offset']);_0x3122b5<_0x3d67f8[_0x47a5('0x4d')]&&_0x53f444['length']=_0x221624){_0x448d5c=_0x221624;_0x56f2da=0xc8;}else{_0x56f2da=0xce;}_0x1d30aa['status'](_0x56f2da);return _0x1d30aa[_0xbb10('0x33')](_0xbb10('0x34'),_0x4ee02e+'-'+_0x448d5c+'/'+_0x221624)['json'](_0x5d5c80);}return null;};}function patchUpdates(_0x359ad4){return function(_0x37dde7){try{jsonpatch[_0xbb10('0x35')](_0x37dde7,_0x359ad4,!![]);}catch(_0x1c0b57){return BPromise[_0xbb10('0x36')](_0x1c0b57);}return _0x37dde7[_0xbb10('0x37')]();};}function saveUpdates(_0xf85197,_0x4975f5){return function(_0x25acb3){if(_0x25acb3){return _0x25acb3[_0xbb10('0x38')](_0xf85197)[_0xbb10('0x24')](function(_0x8c1ce6){return _0x8c1ce6;});}return null;};}function removeEntity(_0xfb2c5e,_0x9de708){return function(_0x188cbd){if(_0x188cbd){return _0x188cbd[_0xbb10('0x39')]()[_0xbb10('0x24')](function(){var _0x56943c=_0x188cbd[_0xbb10('0x3a')]({'plain':!![]});var _0x150107=[{'name':_0xbb10('0x3b'),'value':_0xbb10('0x3c'),'ignore':!![]},{'name':'Agents','value':_0xbb10('0x3d'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x3eb3cc=_(_0x150107)[_0xbb10('0x3e')](_0xbb10('0x3f'))[_0xbb10('0x40')](_0xbb10('0x41'))[_0xbb10('0x41')]();if(_['includes'](_0x3eb3cc,_0x56943c[_0xbb10('0x42')])){return;}var _0x25d72f=_['find'](_0x150107,['value',_0x56943c['role']])[_0xbb10('0x43')];return db[_0xbb10('0x44')][_0xbb10('0x39')]({'where':{'type':_0x25d72f,'resourceId':_0x56943c['id']}})['then'](function(){return _0x188cbd;});})[_0xbb10('0x24')](function(){_0xfb2c5e[_0xbb10('0x2e')](0xcc)[_0xbb10('0x2f')]();});}};}function handleEntityNotFound(_0x4d1a83,_0x17b6c5){return function(_0x12238a){if(!_0x12238a){_0x4d1a83[_0xbb10('0x2d')](0x194);}return _0x12238a;};}function handleError(_0x446f49,_0x4f1cdd){_0x4f1cdd=_0x4f1cdd||0x1f4;return function(_0xd238e9){logger[_0xbb10('0x2a')](_0xd238e9['stack']);if(_0xd238e9[_0xbb10('0x43')]){delete _0xd238e9[_0xbb10('0x43')];}_0x446f49[_0xbb10('0x2e')](_0x4f1cdd)[_0xbb10('0x45')](_0xd238e9);};}exports[_0xbb10('0x46')]=function(_0x185a52,_0x5f3d67){var _0x1e8f79={},_0x1c7fae={},_0x3e7b4c={'count':0x0,'rows':[]};var _0x3d3c41=_['map'](db[_0xbb10('0x47')][_0xbb10('0x48')],function(_0x23dc18){return{'name':_0x23dc18[_0xbb10('0x49')],'type':_0x23dc18['type'][_0xbb10('0x4a')]};});_0x1c7fae[_0xbb10('0x4b')]=_['differenceBy'](_['map'](_0x3d3c41,_0xbb10('0x43')),['password',_0xbb10('0x4c')]);_0x1c7fae[_0xbb10('0x4d')]=_['keys'](_0x185a52[_0xbb10('0x4d')]);_0x1c7fae[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1c7fae['model'],_0x1c7fae[_0xbb10('0x4d')]);_0x1e8f79[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x1c7fae[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x1e8f79[_0xbb10('0x50')]=_0x1e8f79[_0xbb10('0x50')][_0xbb10('0x52')]?_0x1e8f79[_0xbb10('0x50')]:_0x1c7fae[_0xbb10('0x4b')];if(!_0x185a52['query'][_0xbb10('0x53')](_0xbb10('0x54'))){_0x1e8f79['limit']=qs[_0xbb10('0x55')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1e8f79[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x1e8f79['order']=qs['sort'](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1e8f79[_0xbb10('0x57')]=qs['filters'](_['pick'](_0x185a52[_0xbb10('0x4d')],_0x1c7fae[_0xbb10('0x4e')]));if(_0x185a52[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x1e8f79[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x1e8f79[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x3d3c41,function(_0x2626d8){if(_0x2626d8[_0xbb10('0x59')]!=='VIRTUAL'){return db['sequelize'][_0xbb10('0x57')](db[_0xbb10('0x5a')]['fn'](_0xbb10('0x5b'),db[_0xbb10('0x5a')][_0xbb10('0x5c')](_0x2626d8[_0xbb10('0x43')])),{'$like':db[_0xbb10('0x5a')]['fn'](_0xbb10('0x5b'),'%'+_0x185a52[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%')});}})});}_0x1e8f79=_[_0xbb10('0x58')]({},_0x1e8f79,_0x185a52[_0xbb10('0x5d')]);var _0x61e689={'where':_0x1e8f79[_0xbb10('0x57')]};return db[_0xbb10('0x47')]['count'](_0x61e689)[_0xbb10('0x24')](function(_0x5bd44d){_0x3e7b4c[_0xbb10('0x31')]=_0x5bd44d;if(_0x185a52[_0xbb10('0x4d')][_0xbb10('0x5e')]){_0x1e8f79[_0xbb10('0x5f')]=[{'all':!![]}];}return db[_0xbb10('0x47')][_0xbb10('0x60')](_0x1e8f79);})[_0xbb10('0x24')](function(_0x44eec1){_0x3e7b4c[_0xbb10('0x61')]=_0x44eec1;return _0x3e7b4c;})[_0xbb10('0x24')](respondWithFilteredResult(_0x5f3d67,_0x1e8f79))[_0xbb10('0x2c')](handleError(_0x5f3d67,null));};exports[_0xbb10('0x62')]=function(_0x1d49e1,_0x3d7e17){var _0x4475e1={'raw':![],'where':{'id':_0x1d49e1[_0xbb10('0x63')]['id']}},_0x5de0cc={};_0x5de0cc[_0xbb10('0x4b')]=_[_0xbb10('0x64')](_[_0xbb10('0x65')](db[_0xbb10('0x47')][_0xbb10('0x48')]),['password',_0xbb10('0x4c')]);_0x5de0cc[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x1d49e1[_0xbb10('0x4d')]);_0x5de0cc[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x5de0cc[_0xbb10('0x4b')],_0x5de0cc[_0xbb10('0x4d')]);_0x4475e1[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x5de0cc[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x1d49e1[_0xbb10('0x4d')]['fields']));_0x4475e1['attributes']=_0x4475e1[_0xbb10('0x50')][_0xbb10('0x52')]?_0x4475e1[_0xbb10('0x50')]:_0x5de0cc[_0xbb10('0x4b')];if(_0x1d49e1['query']['includeAll']){_0x4475e1[_0xbb10('0x5f')]=[{'all':!![]}];}_0x4475e1=_[_0xbb10('0x58')]({},_0x4475e1,_0x1d49e1[_0xbb10('0x5d')]);return db[_0xbb10('0x47')][_0xbb10('0x66')](_0x4475e1)[_0xbb10('0x24')](handleEntityNotFound(_0x3d7e17,null))[_0xbb10('0x24')](respondWithResult(_0x3d7e17,null))['catch'](handleError(_0x3d7e17,null));};exports[_0xbb10('0x67')]=function(_0x216cff,_0x4917a5){return db['User']['bulkCreate'](_0x216cff[_0xbb10('0x68')],{'raw':![],'individualHooks':!![]})[_0xbb10('0x24')](respondWithResult(_0x4917a5,0xc9))[_0xbb10('0x2c')](handleError(_0x4917a5,null));};exports['update']=function(_0x4e6e7c,_0x5846d1){if(_0x4e6e7c[_0xbb10('0x68')]['id']){delete _0x4e6e7c[_0xbb10('0x68')]['id'];}delete _0x4e6e7c[_0xbb10('0x68')]['role'];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x4e6e7c['params']['id']}})['then'](handleEntityNotFound(_0x5846d1,null))[_0xbb10('0x24')](saveUpdates(_0x4e6e7c[_0xbb10('0x68')],null))[_0xbb10('0x24')](respondWithResult(_0x5846d1,null))[_0xbb10('0x2c')](handleError(_0x5846d1,null));};exports['describe']=function(_0x43eaec,_0xec48ac){return db[_0xbb10('0x47')]['describe']()[_0xbb10('0x24')](respondWithResult(_0xec48ac,null))[_0xbb10('0x2c')](handleError(_0xec48ac,null));};exports[_0xbb10('0x69')]=function(_0x5b2bd4,_0x2ca491,_0x31e85e){return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x5b2bd4['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x2ca491,null))[_0xbb10('0x24')](function(_0x108e5b){if(_0x108e5b){return _0x108e5b[_0xbb10('0x69')](_0x5b2bd4['body'][_0xbb10('0x6a')],_[_0xbb10('0x6b')](_0x5b2bd4[_0xbb10('0x68')],[_0xbb10('0x6a'),'id'])||{});}})[_0xbb10('0x24')](respondWithResult(_0x2ca491,null))[_0xbb10('0x2c')](handleError(_0x2ca491,null));};var getLicense=function(_0x1e4694){return new BPromise(function(_0x4a30c5,_0x4a13d7){var _0x5acd5e=0x0;_0x1e4694[_0xbb10('0x68')][_0xbb10('0x42')]===_0xbb10('0x3d')&&_0x4a30c5('agent\x20role');return db['User'][_0xbb10('0x31')]({'where':{'$or':[{'role':_0x1e4694[_0xbb10('0x68')][_0xbb10('0x42')]===_0xbb10('0x6c')?_0xbb10('0x6c'):[_0xbb10('0x6d'),'user']}]}})[_0xbb10('0x24')](function(_0x15fae2){_0x5acd5e=_0x15fae2;return require(_0xbb10('0x6e'))[_0xbb10('0x6f')]();})[_0xbb10('0x24')](function(_0x5bfc68){var _0x56094a=_0x1e4694['body'][_0xbb10('0x42')]===_0xbb10('0x6c')?_0xbb10('0x70'):_0xbb10('0x71');if(!_[_0xbb10('0x72')](_0x5bfc68[_0x56094a])&&_0x5acd5e>=_0x5bfc68[_0x56094a]){return _0x4a13d7({'message':_0xbb10('0x73')});}return _0x4a30c5(util['format'](_0xbb10('0x74'),_0x56094a,_0x5acd5e));})['catch'](function(_0x4fe3b5){return _0x4a13d7(_0x4fe3b5);});});};exports['create']=function(_0xdf634f,_0x13040d){return getLicense(_0xdf634f)[_0xbb10('0x24')](function(_0x108f99){if(!_0xdf634f['body'][_0xbb10('0x75')]){var _0x5c583b;return db['Setting'][_0xbb10('0x76')](0x1)[_0xbb10('0x24')](function(_0x29529c){return checkPasswordPattern(_0x29529c,_0xdf634f[_0xbb10('0x68')][_0xbb10('0x77')],_0x29529c['securePassword']);})[_0xbb10('0x24')](function(_0x19fcec){_0x5c583b=_0x19fcec[_0xbb10('0x78')];return db[_0xbb10('0x47')][_0xbb10('0x79')](_0xbb10('0x75'));})[_0xbb10('0x24')](function(_0x53fa98){if(_[_0xbb10('0x72')](_0x53fa98)){if(_0x5c583b){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x5c583b;}else{_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=0x1;}}else{if(_[_0xbb10('0x72')](_0x5c583b)||_0x5c583b==_0x53fa98){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x53fa98+0x1;}else if(_0x5c583b>_0x53fa98){_0xdf634f['body'][_0xbb10('0x75')]=_0x5c583b;}else{return db[_0xbb10('0x5a')][_0xbb10('0x4d')]('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['sequelize']['QueryTypes'][_0xbb10('0x7a')]})['then'](function(_0x4e3d6a){if(_0x4e3d6a&&_0x4e3d6a[_0xbb10('0x52')]){for(var _0x3ee56b=0x0,_0x33ff06=_0x4e3d6a[_0xbb10('0x52')];_0x3ee56b<_0x33ff06&&_[_0xbb10('0x72')](_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]);_0x3ee56b++){if(_0x5c583b<=_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')]){_0xdf634f[_0xbb10('0x68')]['internal']=_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')];}else if(_0x5c583b>_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')]&&_0x5c583b<=_0x4e3d6a[_0x3ee56b]['to']){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x5c583b;}}}if(_['isNil'](_0xdf634f['body'][_0xbb10('0x75')])){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x53fa98+0x1;}});}}});}})[_0xbb10('0x24')](function(){if(_0xdf634f['body'][_0xbb10('0x7c')]){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7d')]=_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')];_0xdf634f['body']['VoiceMail']={'mailbox':_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')],'password':_0xdf634f[_0xbb10('0x68')]['password'],'fullname':_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7e')],'email':_0xdf634f['body']['email']};}if(_0xdf634f[_0xbb10('0x68')]&&_0xdf634f[_0xbb10('0x68')][_0xbb10('0x42')]==='agent'){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7f')]=[_0xbb10('0x80'),_0xbb10('0x81'),_0xbb10('0x82'),_0xbb10('0x83'),_0xbb10('0x84'),_0xbb10('0x85'),_0xbb10('0x86'),'107',_0xbb10('0x87'),_0xbb10('0x88'),_0xbb10('0x89'),_0xbb10('0x8a')];}return db[_0xbb10('0x47')][_0xbb10('0x8b')](_0xdf634f[_0xbb10('0x68')],{'include':[{'model':db[_0xbb10('0x8c')],'as':_0xbb10('0x8c')}]});})[_0xbb10('0x24')](function(_0x15e043){if(_0xdf634f[_0xbb10('0x68')]['role']==='user')return _0x15e043;var _0xe1fc51=_0xdf634f[_0xbb10('0x3c')][_0xbb10('0x3a')]({'plain':!![]});if(!_0xe1fc51)throw new Error(_0xbb10('0x8d'));if(_0xe1fc51[_0xbb10('0x42')]==='user'){var _0x2749a7=_0x15e043[_0xbb10('0x3a')]({'plain':!![]});var _0x3b4d0b=[{'name':_0xbb10('0x8e'),'value':_0xbb10('0x3d')},{'name':_0xbb10('0x8f'),'value':'telephone'}];var _0xb25e71=_[_0xbb10('0x66')](_0x3b4d0b,['value',_0x2749a7[_0xbb10('0x42')]])['name'];return db[_0xbb10('0x90')][_0xbb10('0x66')]({'where':{'name':_0xb25e71,'userProfileId':_0xe1fc51[_0xbb10('0x91')]},'raw':!![]})[_0xbb10('0x24')](function(_0x3a4a6e){if(_0x3a4a6e&&_0x3a4a6e['autoAssociation']===0x0){return db[_0xbb10('0x44')]['create']({'name':_0x2749a7[_0xbb10('0x43')],'resourceId':_0x2749a7['id'],'type':_0x3a4a6e[_0xbb10('0x43')],'sectionId':_0x3a4a6e['id']},{})['then'](function(){return _0x15e043;});}else{return _0x15e043;}})['catch'](function(_0x415407){logger[_0xbb10('0x2a')](_0xbb10('0x92'),_0x415407);throw _0x415407;});}return _0x15e043;})[_0xbb10('0x24')](respondWithResult(_0x13040d,0xc9))[_0xbb10('0x2c')](handleError(_0x13040d,null));};exports[_0xbb10('0x93')]=function(_0x1b6ebc,_0x25b4ef,_0x252ab8){var _0xbccd46=![];if(_0x1b6ebc[_0xbb10('0x68')]['id']){delete _0x1b6ebc['body']['id'];}return db[_0xbb10('0x94')][_0xbb10('0x95')]({'attributes':['id',_0xbb10('0x96')]})[_0xbb10('0x24')](function(_0xfe02f5){_0xbccd46=_0xfe02f5[_0xbb10('0x96')];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x1b6ebc[_0xbb10('0x63')]['id']}});})[_0xbb10('0x24')](function(_0x1c4235){if(_0x1c4235){if(_0x1c4235['id']==_0x1b6ebc[_0xbb10('0x3c')]['id']){if(!_0x1b6ebc['body'][_0xbb10('0x97')]||!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9a'));}if(!_0x1c4235[_0xbb10('0x9b')](_0x1b6ebc['body'][_0xbb10('0x97')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9c'));}if(_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x97')]==_0x1b6ebc['body']['newPassword']){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9d'));}return _0x1c4235;}else if(_0x1b6ebc['user'][_0xbb10('0x42')]==_0xbb10('0x6d')){if(!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))]['ValidationError'](_0xbb10('0x9e'));}return _0x1c4235;}else if(_0x1b6ebc['user'][_0xbb10('0x42')]==_0xbb10('0x3c')){if(!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1c4235[_0xbb10('0x42')]!=_0xbb10('0x3d')){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9f'));}return _0x1c4235;}else{throw new db['Sequelize'][(_0xbb10('0x99'))](_0xbb10('0x9f'));}}return null;})[_0xbb10('0x24')](handleEntityNotFound(_0x25b4ef,null))['then'](function(_0xd68afa){return checkPasswordPattern(_0xd68afa,_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x98')],_0xbccd46);})[_0xbb10('0x24')](saveUpdates({'password':_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x98')],'passwordResetAt':_0x1b6ebc[_0xbb10('0x3c')]['id']==_0x1b6ebc[_0xbb10('0x63')]['id']?moment():null},null))[_0xbb10('0x24')](respondWithResult(_0x25b4ef,null))['catch'](handleError(_0x25b4ef,null));};exports['addQueues']=function(_0x37e40c,_0xe7238b,_0x293f3f){var _0x44f097=_0x37e40c[_0xbb10('0x68')][_0xbb10('0xa0')];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x37e40c[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42'),_0xbb10('0xa1'),_0xbb10('0xa2'),'voicePause',_0xbb10('0xa3')]})[_0xbb10('0x24')](handleEntityNotFound(_0xe7238b,null))[_0xbb10('0x24')](function(_0x1222eb){if(_0x1222eb){if(!utils[_0xbb10('0xa4')](_0x44f097)){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}return _0x1222eb[_0xbb10('0xa6')+_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+'Queues'](_0x37e40c[_0xbb10('0x68')]['ids'],{'penalty':_0x37e40c[_0xbb10('0x68')][_0xbb10('0xa9')]||0x0})[_0xbb10('0xaa')](function(_0x112261){for(var _0x2b6e27=0x0;_0x2b6e27<_0x37e40c[_0xbb10('0x68')]['ids'][_0xbb10('0x52')];_0x2b6e27+=0x1){var _0x5c484c={'UserId':_0x37e40c[_0xbb10('0x63')]['id']};_0x5c484c[_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+_0xbb10('0xab')]=_0x37e40c[_0xbb10('0x68')][_0xbb10('0x6a')][_0x2b6e27];socket[_0xbb10('0xac')](_0xbb10('0x3c')+_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+_0xbb10('0xad'),_0x5c484c);}return _0x112261;})[_0xbb10('0x24')](function(){if(_0x44f097==='voice'){return db[_0xbb10('0xae')]['findAll']({'where':{'id':_0x37e40c[_0xbb10('0x68')][_0xbb10('0x6a')]||[]},'raw':!![],'attributes':['id',_0xbb10('0x43')]});}})[_0xbb10('0x24')](function(_0x44c229){var _0x40271f=_0x1222eb[_0xbb10('0x3a')]({'plain':!![]});var _0x5e9888=[];if(_0x44f097===_0xbb10('0xaf')&&_0x40271f['role']==='agent'&&_0x40271f[_0xbb10('0xa1')]){for(var _0x35cbb9=0x0;_0x35cbb9<_0x44c229[_0xbb10('0x52')];_0x35cbb9+=0x1){_0x5e9888[_0xbb10('0xb0')]({'membername':_0x40271f[_0xbb10('0x43')],'UserId':_0x40271f['id'],'queue_name':_0x44c229[_0x35cbb9][_0xbb10('0x43')],'VoiceQueueId':_0x44c229[_0x35cbb9]['id'],'interface':_['isNil'](_0x40271f[_0xbb10('0xa3')])?util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x40271f[_0xbb10('0x43')]):_0x40271f[_0xbb10('0xa3')],'paused':_0x40271f[_0xbb10('0xb3')]||![],'penalty':_0x37e40c['body'][_0xbb10('0xa9')]||0x0});}return BPromise[_0xbb10('0xb4')](_0x5e9888,function(_0xb7c454){return db[_0xbb10('0xb5')][_0xbb10('0xb6')](_0xb7c454);});}return _0x1222eb;});}})[_0xbb10('0x24')](respondWithStatusCode(_0xe7238b,null))[_0xbb10('0x2c')](handleError(_0xe7238b,null));};exports['removeQueues']=function(_0x33a43e,_0x5e4ae9,_0x3afbcf){var _0x4a6660;return db['User'][_0xbb10('0x66')]({'where':{'id':_0x33a43e[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42')]})[_0xbb10('0x24')](handleEntityNotFound(_0x5e4ae9,null))['then'](function(_0xa42b80){if(_0xa42b80){_0x4a6660=_0xa42b80;if(!_0x33a43e['query']['channel']||!utils['isValidChannel'](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}return _0xa42b80['remove'+_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')][_0xbb10('0xa8')]())+_0xbb10('0xb7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0x6a')]);}})['then'](function(_0x4c95c2){for(var _0x584a62=0x0;_0x584a62<_0x33a43e[_0xbb10('0x4d')][_0xbb10('0x6a')][_0xbb10('0x52')];_0x584a62+=0x1){var _0x3125c3={'UserId':_0x33a43e[_0xbb10('0x63')]['id']};_0x3125c3[_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')][_0xbb10('0xa8')]())+_0xbb10('0xab')]=_0x33a43e['query']['ids'][_0x584a62];socket['emit'](_0xbb10('0x3c')+_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')]['channel'][_0xbb10('0xa8')]())+_0xbb10('0xb8'),_0x3125c3);}return _0x4c95c2;})[_0xbb10('0x24')](function(){if(_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')]===_0xbb10('0xaf')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x33a43e[_0xbb10('0x63')]['id'],'VoiceQueueId':_0x33a43e['query'][_0xbb10('0x6a')]},'individualHooks':!![]})[_0xbb10('0x24')](function(){return _0x4a6660;});}return _0x4a6660;})[_0xbb10('0x24')](respondWithStatusCode(_0x5e4ae9,null))[_0xbb10('0x2c')](handleError(_0x5e4ae9,null));};exports[_0xbb10('0xb9')]=function(_0x2dfa04,_0x13a29e,_0x1388f6){_0x2dfa04[_0xbb10('0x68')][_0xbb10('0xba')]=_0x2dfa04['file'][_0xbb10('0xbb')];return db['User'][_0xbb10('0x66')]({'where':{'id':_0x2dfa04['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x13a29e,null))[_0xbb10('0x24')](saveUpdates(_0x2dfa04[_0xbb10('0x68')],null))[_0xbb10('0x24')](respondWithResult(_0x13a29e,null))['catch'](handleError(_0x13a29e,null));};exports[_0xbb10('0xbc')]=function(_0x4960b1,_0xfe1154,_0x1b6b9f){var _0xcdaf04=path['join'](config[_0xbb10('0xbd')],_0xbb10('0xbe'));return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x4960b1[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0xba')],'raw':!![]})['then'](handleEntityNotFound(_0xfe1154,null))['then'](function(_0x522a88){if(_0x522a88){if(_[_0xbb10('0x72')](_0x522a88['userpic'])){return _0xfe1154[_0xbb10('0xbf')](_0xcdaf04);}else{if(!fs['existsSync'](path[_0xbb10('0xc0')](config[_0xbb10('0xbd')],_0xbb10('0xc1'),_0x522a88['userpic']))){return _0xfe1154['download'](_0xcdaf04);}return _0xfe1154[_0xbb10('0xbf')](path[_0xbb10('0xc0')](config[_0xbb10('0xbd')],'server/files/images/',_0x522a88[_0xbb10('0xba')]));}}})[_0xbb10('0x2c')](handleError(_0xfe1154,null));};exports[_0xbb10('0xc2')]=function(_0x4848b9,_0x47d144,_0x5a685d){var _0x2980b7={};var _0x55aa03={};var _0x3dfbcd;var _0x1c2c95;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x4848b9[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x47d144,null))[_0xbb10('0x24')](function(_0x20a2c4){if(_0x20a2c4){_0x3dfbcd=_0x20a2c4;_0x55aa03[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xc3')]['rawAttributes']);_0x55aa03[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x4848b9['query']);_0x55aa03[_0xbb10('0x4e')]=_['intersection'](_0x55aa03['model'],_0x55aa03[_0xbb10('0x4d')]);_0x2980b7[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x55aa03[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x4848b9['query'][_0xbb10('0x51')]));_0x2980b7[_0xbb10('0x50')]=_0x2980b7['attributes'][_0xbb10('0x52')]?_0x2980b7[_0xbb10('0x50')]:_0x55aa03['model'];_0x2980b7[_0xbb10('0xc4')]=qs['sort'](_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x2980b7[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x4848b9[_0xbb10('0x4d')],_0x55aa03[_0xbb10('0x4e')]));if(_0x4848b9['query'][_0xbb10('0x3e')]){_0x2980b7[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x2980b7[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x2980b7[_0xbb10('0x50')],function(_0x518990){var _0x550301={};_0x550301[_0x518990]={'$like':'%'+_0x4848b9['query'][_0xbb10('0x3e')]+'%'};return _0x550301;})});}_0x2980b7=_[_0xbb10('0x58')]({},_0x2980b7,_0x4848b9[_0xbb10('0x5d')]);return _0x3dfbcd[_0xbb10('0xc2')](_0x2980b7);}})['then'](function(_0x3b01a3){if(_0x3b01a3){_0x1c2c95=_0x3b01a3[_0xbb10('0x52')];if(_0x4848b9[_0xbb10('0x4d')]['hasOwnProperty']('includeAll')){_0x2980b7[_0xbb10('0x5f')]=[{'model':db['CmList'],'as':_0xbb10('0xc6'),'required':![]},{'model':db[_0xbb10('0xc7')],'as':_0xbb10('0xc8'),'attributes':['id',_0xbb10('0x43'),_0xbb10('0xc9')],'where':_0x4848b9[_0xbb10('0x4d')][_0xbb10('0xca')]?{'id':_0x4848b9['query'][_0xbb10('0xca')]}:undefined,'required':_0x4848b9[_0xbb10('0x4d')]['tag']?!![]:![]}];}if(!_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x2980b7['limit']=qs['limit'](_0x4848b9['query'][_0xbb10('0x55')]);_0x2980b7[_0xbb10('0x32')]=qs['offset'](_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x3dfbcd[_0xbb10('0xc2')](_0x2980b7);}})[_0xbb10('0x24')](function(_0x3d6b3b){if(_0x3d6b3b){return _0x3d6b3b?{'count':_0x1c2c95,'rows':_0x3d6b3b}:null;}})[_0xbb10('0x24')](respondWithResult(_0x47d144,null))[_0xbb10('0x2c')](handleError(_0x47d144,null));};exports['getQueues']=function(_0x304603,_0x4fe7e4,_0x5a7c4e){var _0x4aa0d7;var _0x142b84;var _0x572d73={};var _0x5bd1f0;return db[_0xbb10('0x47')]['findOne']({'where':{'id':_0x304603[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42')]})['then'](handleEntityNotFound(_0x4fe7e4,null))['then'](function(_0x447c0d){if(!utils['isValidChannel'](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])){throw new db['Sequelize']['ValidationError'](_0xbb10('0xa5'));}_0x4aa0d7=_0x447c0d;var _0x385bab={};_0x385bab[_0xbb10('0x4b')]=_['keys'](db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+'Queue'][_0xbb10('0x48')]);_0x385bab[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x304603[_0xbb10('0x4d')]);_0x385bab[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x385bab[_0xbb10('0x4b')],_0x385bab[_0xbb10('0x4d')]);_0x572d73[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x385bab[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x304603[_0xbb10('0x4d')]['fields']));_0x572d73['attributes']=_0x572d73[_0xbb10('0x50')]['length']?_0x572d73[_0xbb10('0x50')]:_0x385bab[_0xbb10('0x4b')];_0x572d73[_0xbb10('0xc4')]=qs['sort'](_0x304603[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x572d73[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x304603['query'],_0x385bab[_0xbb10('0x4e')]));if(_0x304603[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x572d73[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x572d73[_0xbb10('0x57')],{'$or':_['map'](_0x572d73[_0xbb10('0x50')],function(_0x2f0262){var _0x5d013c={};_0x5d013c[_0x2f0262]={'$like':'%'+_0x304603[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x5d013c;})});}_0x572d73=_[_0xbb10('0x58')]({},_0x572d73,_0x304603[_0xbb10('0x5d')]);switch(_0x4aa0d7[_0xbb10('0x42')]){case _0xbb10('0x6d'):return db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+_0xbb10('0xcb')][_0xbb10('0x60')](_0x572d73);case _0xbb10('0x3c'):case _0xbb10('0x3d'):return _0x4aa0d7[_0xbb10('0x3a')+_[_0xbb10('0xa7')](_0x304603['query'][_0xbb10('0xa0')])+_0xbb10('0xb7')](_0x572d73);default:throw new db['Sequelize']['ValidationError'](_0xbb10('0xcc'));}})[_0xbb10('0x24')](function(_0x24810b){_0x5bd1f0=_0x24810b[_0xbb10('0x52')];if(!_0x304603[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x572d73[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x304603['query']['limit']);_0x572d73['offset']=qs['offset'](_0x304603['query']['offset']);}switch(_0x4aa0d7[_0xbb10('0x42')]){case _0xbb10('0x6d'):return db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')]['channel'])+_0xbb10('0xcb')][_0xbb10('0x60')](_0x572d73);case _0xbb10('0x3c'):case _0xbb10('0x3d'):return _0x4aa0d7['get'+_['capitalize'](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+'Queues'](_0x572d73);}})['then'](function(_0x154a91){return{'count':_0x5bd1f0,'rows':_0x154a91};})[_0xbb10('0x24')](respondWithResult(_0x4fe7e4,null))[_0xbb10('0x2c')](handleError(_0x4fe7e4,null));};exports[_0xbb10('0xcd')]=function(_0x18cda3,_0x564dc6,_0x4744f4){var _0x5382e9={};var _0x4c97b9={};var _0x9d96e2;var _0x27f277;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x18cda3[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x564dc6,null))['then'](function(_0x9c1581){if(_0x9c1581){_0x9d96e2=_0x9c1581;_0x4c97b9[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xb5')][_0xbb10('0x48')]);_0x4c97b9[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x18cda3[_0xbb10('0x4d')]);_0x4c97b9[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x4c97b9[_0xbb10('0x4b')],_0x4c97b9[_0xbb10('0x4d')]);_0x5382e9[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x4c97b9[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x5382e9[_0xbb10('0x50')]=_0x5382e9[_0xbb10('0x50')][_0xbb10('0x52')]?_0x5382e9[_0xbb10('0x50')]:_0x4c97b9['model'];_0x5382e9[_0xbb10('0xc4')]=qs['sort'](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x5382e9[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x18cda3['query'],_0x4c97b9['filters']));if(_0x18cda3['query'][_0xbb10('0x3e')]){_0x5382e9[_0xbb10('0x57')]=_['merge'](_0x5382e9[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x5382e9[_0xbb10('0x50')],function(_0x4c7c62){var _0xae8e0a={};_0xae8e0a[_0x4c7c62]={'$like':'%'+_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0xae8e0a;})});}_0x5382e9=_['merge']({},_0x5382e9,_0x18cda3[_0xbb10('0x5d')]);return _0x9d96e2['getVoiceQueuesRt'](_0x5382e9);}})[_0xbb10('0x24')](function(_0x50fe23){if(_0x50fe23){_0x27f277=_0x50fe23['length'];if(!_0x18cda3['query']['hasOwnProperty']('nolimit')){_0x5382e9['limit']=qs[_0xbb10('0x55')](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x5382e9[_0xbb10('0x32')]=qs['offset'](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x9d96e2[_0xbb10('0xcd')](_0x5382e9);}})[_0xbb10('0x24')](function(_0x466e6e){if(_0x466e6e){return _0x466e6e?{'count':_0x27f277,'rows':_0x466e6e}:null;}})[_0xbb10('0x24')](respondWithResult(_0x564dc6,null))[_0xbb10('0x2c')](handleError(_0x564dc6,null));};exports[_0xbb10('0xce')]=function(_0x419085,_0x9e7ed6,_0x4c9378){var _0x1e4ed3={};var _0x1ffc94={};var _0x288ccc;var _0x5c5ecc;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x419085[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x9e7ed6,null))['then'](function(_0x370460){if(_0x370460){_0x288ccc=_0x370460;_0x1ffc94[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xcf')][_0xbb10('0x48')]);_0x1ffc94[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x419085[_0xbb10('0x4d')]);_0x1ffc94[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1ffc94[_0xbb10('0x4b')],_0x1ffc94['query']);_0x1e4ed3[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x1ffc94['model'],qs['fields'](_0x419085[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x1e4ed3['attributes']=_0x1e4ed3[_0xbb10('0x50')][_0xbb10('0x52')]?_0x1e4ed3['attributes']:_0x1ffc94[_0xbb10('0x4b')];_0x1e4ed3[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x419085[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1e4ed3['where']=qs['filters'](_['pick'](_0x419085[_0xbb10('0x4d')],_0x1ffc94['filters']));if(_0x419085[_0xbb10('0x4d')]['filter']){_0x1e4ed3['where']=_[_0xbb10('0x58')](_0x1e4ed3[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x1e4ed3[_0xbb10('0x50')],function(_0x2527f4){var _0x189054={};_0x189054[_0x2527f4]={'$like':'%'+_0x419085['query']['filter']+'%'};return _0x189054;})});}_0x1e4ed3=_['merge']({},_0x1e4ed3,_0x419085[_0xbb10('0x5d')]);return _0x288ccc[_0xbb10('0xce')](_0x1e4ed3);}})[_0xbb10('0x24')](function(_0x2991a9){if(_0x2991a9){_0x5c5ecc=_0x2991a9[_0xbb10('0x52')];if(!_0x419085[_0xbb10('0x4d')][_0xbb10('0x53')]('nolimit')){_0x1e4ed3[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x419085[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1e4ed3['offset']=qs[_0xbb10('0x32')](_0x419085['query']['offset']);}return _0x288ccc[_0xbb10('0xce')](_0x1e4ed3);}})[_0xbb10('0x24')](function(_0x449e7e){if(_0x449e7e){return _0x449e7e?{'count':_0x5c5ecc,'rows':_0x449e7e}:null;}})[_0xbb10('0x24')](respondWithResult(_0x9e7ed6,null))[_0xbb10('0x2c')](handleError(_0x9e7ed6,null));};exports[_0xbb10('0xd0')]=function(_0x4b7bf8,_0x39fdd3,_0x1bba7c){var _0x374dd9={'raw':!![],'where':{}};var _0x276a5c={};var _0x3ccc6c={'count':0x0,'rows':[]};return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x4b7bf8['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x39fdd3,null))[_0xbb10('0x24')](function(_0x391bce){if(_0x391bce){_0x276a5c['model']=_['keys'](db[_0xbb10('0xd1')][_0xbb10('0x48')]);_0x276a5c[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x4b7bf8[_0xbb10('0x4d')]);_0x276a5c[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x276a5c['model'],_0x276a5c[_0xbb10('0x4d')]);_0x374dd9[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x276a5c['model'],qs['fields'](_0x4b7bf8['query']['fields']));_0x374dd9[_0xbb10('0x50')]=_0x374dd9[_0xbb10('0x50')][_0xbb10('0x52')]?_0x374dd9[_0xbb10('0x50')]:_0x276a5c['model'];if(!_0x4b7bf8[_0xbb10('0x4d')]['hasOwnProperty'](_0xbb10('0x54'))){_0x374dd9[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x374dd9[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x374dd9[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x4b7bf8[_0xbb10('0x4d')]['sort']);_0x374dd9[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x4b7bf8['query'],_0x276a5c[_0xbb10('0x4e')]));_0x374dd9['where'][_0xbb10('0xd2')]=_0x391bce['id'];if(_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x374dd9[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x374dd9['where'],{'$or':_['map'](_0x374dd9[_0xbb10('0x50')],function(_0x4cf5cc){var _0x553bb8={};_0x553bb8[_0x4cf5cc]={'$like':'%'+_0x4b7bf8[_0xbb10('0x4d')]['filter']+'%'};return _0x553bb8;})});}_0x374dd9=_[_0xbb10('0x58')]({},_0x374dd9,_0x4b7bf8[_0xbb10('0x5d')]);return db[_0xbb10('0xd1')][_0xbb10('0x31')]({'where':_0x374dd9[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x3a0940){_0x3ccc6c[_0xbb10('0x31')]=_0x3a0940;if(_0x4b7bf8['query'][_0xbb10('0x5e')]){_0x374dd9['include']=[{'all':!![]}];}return db[_0xbb10('0xd1')]['findAll'](_0x374dd9);})[_0xbb10('0x24')](function(_0x10cc4c){_0x3ccc6c['rows']=_0x10cc4c;return _0x3ccc6c;});}})[_0xbb10('0x24')](respondWithFilteredResult(_0x39fdd3,_0x374dd9))[_0xbb10('0x2c')](handleError(_0x39fdd3,null));};exports[_0xbb10('0xd3')]=function(_0x5ef974,_0x17b086,_0x1a8503){var _0x327b64={'raw':!![],'where':{}};var _0x4df6c0={};var _0x100e82={'count':0x0,'rows':[]};return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x5ef974['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x17b086,null))['then'](function(_0x399ec4){if(_0x399ec4){_0x4df6c0[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd4')][_0xbb10('0x48')]);_0x4df6c0[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x5ef974[_0xbb10('0x4d')]);_0x4df6c0[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x4df6c0['model'],_0x4df6c0['query']);_0x327b64[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x4df6c0[_0xbb10('0x4b')],qs['fields'](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x327b64[_0xbb10('0x50')]=_0x327b64[_0xbb10('0x50')][_0xbb10('0x52')]?_0x327b64[_0xbb10('0x50')]:_0x4df6c0[_0xbb10('0x4b')];if(!_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x53')]('nolimit')){_0x327b64[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x327b64['offset']=qs[_0xbb10('0x32')](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x327b64['order']=qs['sort'](_0x5ef974[_0xbb10('0x4d')]['sort']);_0x327b64[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x5ef974[_0xbb10('0x4d')],_0x4df6c0[_0xbb10('0x4e')]));_0x327b64[_0xbb10('0x57')][_0xbb10('0xd2')]=_0x399ec4['id'];if(_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x327b64['where']=_[_0xbb10('0x58')](_0x327b64[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x327b64[_0xbb10('0x50')],function(_0x2f0a58){var _0xfe1846={};_0xfe1846[_0x2f0a58]={'$like':'%'+_0x5ef974['query'][_0xbb10('0x3e')]+'%'};return _0xfe1846;})});}_0x327b64=_[_0xbb10('0x58')]({},_0x327b64,_0x5ef974[_0xbb10('0x5d')]);return db[_0xbb10('0xd4')][_0xbb10('0x31')]({'where':_0x327b64[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x4f3f44){_0x100e82[_0xbb10('0x31')]=_0x4f3f44;if(_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x5e')]){_0x327b64['include']=[{'all':!![]}];}return db[_0xbb10('0xd4')]['findAll'](_0x327b64);})[_0xbb10('0x24')](function(_0x33fb06){_0x100e82[_0xbb10('0x61')]=_0x33fb06;return _0x100e82;});}})['then'](respondWithFilteredResult(_0x17b086,_0x327b64))['catch'](handleError(_0x17b086,null));};exports[_0xbb10('0xd5')]=function(_0x3ba356,_0xbb410e,_0x27ea82){var _0x8ef7c1={};var _0x34dddb={};var _0x4602f4;var _0x440af2;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x3ba356[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0xbb410e,null))['then'](function(_0x3fd42f){if(_0x3fd42f){_0x4602f4=_0x3fd42f;_0x34dddb[_0xbb10('0x4b')]=_['keys'](db['ChatInteraction'][_0xbb10('0x48')]);_0x34dddb[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x3ba356['query']);_0x34dddb[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x34dddb['model'],_0x34dddb[_0xbb10('0x4d')]);_0x8ef7c1[_0xbb10('0x50')]=_['intersection'](_0x34dddb['model'],qs[_0xbb10('0x51')](_0x3ba356[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x8ef7c1['attributes']=_0x8ef7c1['attributes'][_0xbb10('0x52')]?_0x8ef7c1[_0xbb10('0x50')]:_0x34dddb['model'];_0x8ef7c1[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x3ba356['query'][_0xbb10('0x56')]);_0x8ef7c1[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x3ba356['query'],_0x34dddb[_0xbb10('0x4e')]));if(_0x3ba356['query'][_0xbb10('0x3e')]){_0x8ef7c1[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x8ef7c1[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x8ef7c1[_0xbb10('0x50')],function(_0x3fcdc3){var _0x4533e2={};_0x4533e2[_0x3fcdc3]={'$like':'%'+_0x3ba356['query'][_0xbb10('0x3e')]+'%'};return _0x4533e2;})});}_0x8ef7c1=_[_0xbb10('0x58')]({},_0x8ef7c1,_0x3ba356[_0xbb10('0x5d')]);return _0x4602f4[_0xbb10('0xd5')](_0x8ef7c1);}})['then'](function(_0x4bdabe){if(_0x4bdabe){_0x440af2=_0x4bdabe[_0xbb10('0x52')];if(!_0x3ba356[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x8ef7c1['limit']=qs[_0xbb10('0x55')](_0x3ba356[_0xbb10('0x4d')]['limit']);_0x8ef7c1[_0xbb10('0x32')]=qs['offset'](_0x3ba356['query'][_0xbb10('0x32')]);}return _0x4602f4[_0xbb10('0xd5')](_0x8ef7c1);}})[_0xbb10('0x24')](function(_0x193d45){if(_0x193d45){return _0x193d45?{'count':_0x440af2,'rows':_0x193d45}:null;}})[_0xbb10('0x24')](respondWithResult(_0xbb410e,null))['catch'](handleError(_0xbb410e,null));};exports[_0xbb10('0xd6')]=function(_0x262078,_0x356601,_0x24acce){var _0x1b7274={};var _0x344089={};var _0xb90ba5;var _0x1f80ce;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x262078[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x356601,null))[_0xbb10('0x24')](function(_0x9fcc26){if(_0x9fcc26){_0xb90ba5=_0x9fcc26;_0x344089[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd7')][_0xbb10('0x48')]);_0x344089[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x262078[_0xbb10('0x4d')]);_0x344089[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x344089[_0xbb10('0x4b')],_0x344089[_0xbb10('0x4d')]);_0x1b7274[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x344089['model'],qs[_0xbb10('0x51')](_0x262078[_0xbb10('0x4d')]['fields']));_0x1b7274[_0xbb10('0x50')]=_0x1b7274[_0xbb10('0x50')]['length']?_0x1b7274[_0xbb10('0x50')]:_0x344089[_0xbb10('0x4b')];_0x1b7274['order']=qs[_0xbb10('0x56')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1b7274[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x262078[_0xbb10('0x4d')],_0x344089[_0xbb10('0x4e')]));if(_0x262078[_0xbb10('0x4d')]['filter']){_0x1b7274[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x1b7274[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x1b7274[_0xbb10('0x50')],function(_0x3045ff){var _0x2f626b={};_0x2f626b[_0x3045ff]={'$like':'%'+_0x262078[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x2f626b;})});}_0x1b7274=_[_0xbb10('0x58')]({},_0x1b7274,_0x262078[_0xbb10('0x5d')]);return _0xb90ba5['getOpenchannelInteractions'](_0x1b7274);}})[_0xbb10('0x24')](function(_0x2c19cb){if(_0x2c19cb){_0x1f80ce=_0x2c19cb[_0xbb10('0x52')];if(!_0x262078[_0xbb10('0x4d')]['hasOwnProperty']('nolimit')){_0x1b7274[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1b7274['offset']=qs[_0xbb10('0x32')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0xb90ba5['getOpenchannelInteractions'](_0x1b7274);}})['then'](function(_0x4206bf){if(_0x4206bf){return _0x4206bf?{'count':_0x1f80ce,'rows':_0x4206bf}:null;}})[_0xbb10('0x24')](respondWithResult(_0x356601,null))['catch'](handleError(_0x356601,null));};exports['getMailInteractions']=function(_0x424bb1,_0x615606,_0xbda10){var _0x45cd03={'raw':!![],'where':{}};var _0xc6af40={};var _0x338080={'count':0x0,'rows':[]};return db['User'][_0xbb10('0x95')]({'where':{'id':_0x424bb1[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x615606,null))[_0xbb10('0x24')](function(_0xb4d322){if(_0xb4d322){_0xc6af40[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd8')][_0xbb10('0x48')]);_0xc6af40[_0xbb10('0x4d')]=_['keys'](_0x424bb1[_0xbb10('0x4d')]);_0xc6af40[_0xbb10('0x4e')]=_['intersection'](_0xc6af40['model'],_0xc6af40['query']);_0x45cd03['attributes']=_['intersection'](_0xc6af40['model'],qs['fields'](_0x424bb1['query'][_0xbb10('0x51')]));_0x45cd03[_0xbb10('0x50')]=_0x45cd03['attributes'][_0xbb10('0x52')]?_0x45cd03[_0xbb10('0x50')]:_0xc6af40[_0xbb10('0x4b')];if(!_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x45cd03[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x45cd03[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x424bb1['query'][_0xbb10('0x32')]);}_0x45cd03[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x45cd03['where']=qs[_0xbb10('0x4e')](_['pick'](_0x424bb1['query'],_0xc6af40[_0xbb10('0x4e')]));_0x45cd03[_0xbb10('0x57')]['UserId']=_0xb4d322['id'];if(_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x45cd03[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x45cd03[_0xbb10('0x57')],{'$or':_['map'](_0x45cd03['attributes'],function(_0x44bf0a){var _0x118b63={};_0x118b63[_0x44bf0a]={'$like':'%'+_0x424bb1['query'][_0xbb10('0x3e')]+'%'};return _0x118b63;})});}_0x45cd03=_[_0xbb10('0x58')]({},_0x45cd03,_0x424bb1[_0xbb10('0x5d')]);return db[_0xbb10('0xd8')][_0xbb10('0x31')]({'where':_0x45cd03[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x3be6ec){_0x338080[_0xbb10('0x31')]=_0x3be6ec;if(_0x424bb1['query'][_0xbb10('0x5e')]){_0x45cd03[_0xbb10('0x5f')]=[{'all':!![]}];}return db[_0xbb10('0xd8')][_0xbb10('0x60')](_0x45cd03);})['then'](function(_0x20347b){_0x338080[_0xbb10('0x61')]=_0x20347b;return _0x338080;});}})['then'](respondWithFilteredResult(_0x615606,_0x45cd03))['catch'](handleError(_0x615606,null));};exports[_0xbb10('0xd9')]=function(_0x5a4de3,_0x40ff8e,_0x30ffca){var _0x214dcb={};var _0x3e19f4={};var _0x56e3d0;var _0x90ab9f;return db['User'][_0xbb10('0x95')]({'where':{'id':_0x5a4de3[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x40ff8e,null))[_0xbb10('0x24')](function(_0xa5cb35){if(_0xa5cb35){_0x56e3d0=_0xa5cb35;_0x3e19f4[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xda')][_0xbb10('0x48')]);_0x3e19f4['query']=_[_0xbb10('0x65')](_0x5a4de3[_0xbb10('0x4d')]);_0x3e19f4[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x3e19f4[_0xbb10('0x4b')],_0x3e19f4['query']);_0x214dcb[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x3e19f4[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x5a4de3[_0xbb10('0x4d')]['fields']));_0x214dcb['attributes']=_0x214dcb['attributes'][_0xbb10('0x52')]?_0x214dcb['attributes']:_0x3e19f4['model'];_0x214dcb[_0xbb10('0xc4')]=qs['sort'](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x214dcb['where']=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x5a4de3[_0xbb10('0x4d')],_0x3e19f4[_0xbb10('0x4e')]));if(_0x5a4de3['query']['filter']){_0x214dcb['where']=_[_0xbb10('0x58')](_0x214dcb[_0xbb10('0x57')],{'$or':_['map'](_0x214dcb[_0xbb10('0x50')],function(_0x3fd91c){var _0x3d2e5f={};_0x3d2e5f[_0x3fd91c]={'$like':'%'+_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x3d2e5f;})});}_0x214dcb=_['merge']({},_0x214dcb,_0x5a4de3[_0xbb10('0x5d')]);return _0x56e3d0[_0xbb10('0xd9')](_0x214dcb);}})[_0xbb10('0x24')](function(_0x4aa311){if(_0x4aa311){_0x90ab9f=_0x4aa311[_0xbb10('0x52')];if(!_0x5a4de3['query'][_0xbb10('0x53')](_0xbb10('0x54'))){_0x214dcb[_0xbb10('0x55')]=qs['limit'](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x214dcb['offset']=qs[_0xbb10('0x32')](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x56e3d0[_0xbb10('0xd9')](_0x214dcb);}})[_0xbb10('0x24')](function(_0x589c18){if(_0x589c18){return _0x589c18?{'count':_0x90ab9f,'rows':_0x589c18}:null;}})['then'](respondWithResult(_0x40ff8e,null))[_0xbb10('0x2c')](handleError(_0x40ff8e,null));};exports[_0xbb10('0xdb')]=function(_0x22dd3d,_0x1b0734,_0x1aaedc){var _0x55fd95={};var _0x173721={};var _0x33481b;var _0x42ff51;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x22dd3d['params']['id']}})['then'](handleEntityNotFound(_0x1b0734,null))[_0xbb10('0x24')](function(_0x18f6b1){if(_0x18f6b1){_0x33481b=_0x18f6b1;_0x173721[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db['FaxInteraction']['rawAttributes']);_0x173721[_0xbb10('0x4d')]=_['keys'](_0x22dd3d['query']);_0x173721['filters']=_['intersection'](_0x173721[_0xbb10('0x4b')],_0x173721[_0xbb10('0x4d')]);_0x55fd95[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x173721[_0xbb10('0x4b')],qs['fields'](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x55fd95[_0xbb10('0x50')]=_0x55fd95['attributes'][_0xbb10('0x52')]?_0x55fd95[_0xbb10('0x50')]:_0x173721[_0xbb10('0x4b')];_0x55fd95[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x55fd95[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x22dd3d[_0xbb10('0x4d')],_0x173721[_0xbb10('0x4e')]));if(_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x55fd95[_0xbb10('0x57')]=_['merge'](_0x55fd95['where'],{'$or':_['map'](_0x55fd95[_0xbb10('0x50')],function(_0x58fbef){var _0x1ae32c={};_0x1ae32c[_0x58fbef]={'$like':'%'+_0x22dd3d['query'][_0xbb10('0x3e')]+'%'};return _0x1ae32c;})});}_0x55fd95=_['merge']({},_0x55fd95,_0x22dd3d['options']);return _0x33481b[_0xbb10('0xdb')](_0x55fd95);}})[_0xbb10('0x24')](function(_0x49670b){if(_0x49670b){_0x42ff51=_0x49670b[_0xbb10('0x52')];if(!_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x55fd95['limit']=qs['limit'](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x55fd95[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x33481b[_0xbb10('0xdb')](_0x55fd95);}})['then'](function(_0x5414f9){if(_0x5414f9){return _0x5414f9?{'count':_0x42ff51,'rows':_0x5414f9}:null;}})['then'](respondWithResult(_0x1b0734,null))['catch'](handleError(_0x1b0734,null));};exports[_0xbb10('0xdc')]=function(_0x592a30,_0x1d6630,_0x2e512a){var _0x177bd9;var _0x20305b;var _0x3ba9cc;var _0x57a6bc=!_[_0xbb10('0x72')](_0x592a30[_0xbb10('0x63')]['id'])?_0x592a30[_0xbb10('0x63')]['id']:!_[_0xbb10('0x72')](_0x592a30[_0xbb10('0x3c')]['id'])?_0x592a30[_0xbb10('0x3c')]['id']:null;return db['User']['find']({'where':{'id':_0x57a6bc,'role':{'$or':[_0xbb10('0x6d'),_0xbb10('0x3c'),_0xbb10('0x3d')]}},'attributes':['id',_0xbb10('0x43'),_0xbb10('0xdd'),'mobile','role',_0xbb10('0x75'),_0xbb10('0xa2')]})['then'](function(_0x50dde9){if(_0x50dde9){if(_0x50dde9[_0xbb10('0x42')]===_0xbb10('0x3d')){_0x177bd9=_0x50dde9;if(_0x592a30[_0xbb10('0x68')][_0xbb10('0xa3')]){_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xde'),_0x177bd9[_0x592a30['body'][_0xbb10('0xa3')]]);}else if(_0x592a30[_0xbb10('0x68')][_0xbb10('0xdf')]){_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x592a30[_0xbb10('0x68')][_0xbb10('0xdf')]);}else{_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x177bd9['name']);}socket['to'](util['format']('user:%s',_0x177bd9[_0xbb10('0x43')]))[_0xbb10('0xac')](_0xbb10('0xe0'),{'ip':_0x592a30[_0xbb10('0xe1')]['x-forwarded-for']||_0x592a30['connection']['remoteAddress']||_0x592a30[_0xbb10('0xe2')][_0xbb10('0xe3')]||_0x592a30[_0xbb10('0xe4')][_0xbb10('0xe2')][_0xbb10('0xe3')]});return db[_0xbb10('0xb5')][_0xbb10('0x39')]({'where':{'membername':_0x177bd9[_0xbb10('0x43')]},'individualHooks':!![]});}}else{throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xe5'));}})[_0xbb10('0x24')](function(){if(_0x177bd9){return _0x177bd9[_0xbb10('0xe6')]({'raw':!![]});}})[_0xbb10('0x24')](function(_0x5f074d){if(_0x177bd9){var _0x33f424=[];if(_0x5f074d){_0x20305b=_0x5f074d;if(_0x20305b[_0xbb10('0x52')]){for(var _0x2a73f5=0x0;_0x2a73f5<_0x20305b[_0xbb10('0x52')];_0x2a73f5++){_0x33f424[_0xbb10('0xb0')]({'membername':_0x177bd9[_0xbb10('0x43')],'UserId':_0x177bd9['id'],'queue_name':_0x20305b[_0x2a73f5]['name'],'VoiceQueueId':_0x20305b[_0x2a73f5]['id'],'interface':_0x3ba9cc,'paused':_0x177bd9[_0xbb10('0xa2')]||![],'penalty':_0x20305b[_0x2a73f5][_0xbb10('0xe7')]||0x0});}return BPromise[_0xbb10('0xb4')](_0x33f424,function(_0x2de756){return db[_0xbb10('0xb5')][_0xbb10('0xb6')](_0x2de756);});}}}})[_0xbb10('0x24')](function(){if(_0x177bd9){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x177bd9['name'],'exitAt':null}});}})[_0xbb10('0x24')](function(_0x1085c3){if(_0x177bd9){var _0x2ebd37=[];_0x1085c3[_0xbb10('0xe9')](function(_0x3f33de){_0x2ebd37[_0xbb10('0xb0')](_0x3f33de[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea'))}));});return BPromise['all'](_0x2ebd37);}})[_0xbb10('0x24')](function(){if(_0x177bd9){var _0x4fac24=[];var _0x15c71d=[];var _0x2cd1b0=utils['getChannels']();var _0x57b52d={'membername':_0x177bd9[_0xbb10('0x43')],'interface':_0x3ba9cc,'enterAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'role':_0x177bd9[_0xbb10('0x42')],'internal':_0x177bd9[_0xbb10('0x75')]};_0x2cd1b0[_0xbb10('0xe9')](function(_0x2b69f9){_0x4fac24[_0xbb10('0xb0')](_[_0xbb10('0x58')]({'channel':_0x2b69f9,'type':_0xbb10('0xeb'),'data1':_0x592a30[_0xbb10('0x68')][_0xbb10('0xec')],'data2':_0x3ba9cc},_0x57b52d));if(_0x177bd9[_0xbb10('0xa2')]){_0x15c71d[_0xbb10('0xb0')](_[_0xbb10('0x58')]({'channel':_0x2b69f9,'type':'PAUSE','data1':_0xbb10('0xed')},_0x57b52d));}});return db['MemberReport'][_0xbb10('0x67')](_0x4fac24[_0xbb10('0xee')](_0x15c71d),{'individualHooks':!![]});}})[_0xbb10('0x24')](function(){if(_0x177bd9){return _0x177bd9[_0xbb10('0x38')]({'online':!![],'lastLoginAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'voicePause':_0x177bd9[_0xbb10('0xa2')]||![],'mailPause':_0x177bd9[_0xbb10('0xa2')]||![],'chatPause':_0x177bd9[_0xbb10('0xa2')]||![],'faxPause':_0x177bd9['loginInPause']||![],'smsPause':_0x177bd9['loginInPause']||![],'openchannelPause':_0x177bd9[_0xbb10('0xa2')]||![],'pauseType':_0x177bd9[_0xbb10('0xa2')]?_0xbb10('0xed'):null,'interface':_0x3ba9cc,'lastPauseAt':moment()['format'](_0xbb10('0xea'))});}})['then'](function(_0x283310){if(_0x592a30[_0xbb10('0xef')]){return _0x2e512a();}else{return BPromise['resolve'](_0x283310)[_0xbb10('0x24')](respondWithResult(_0x1d6630,null));}})[_0xbb10('0x2c')](handleError(_0x1d6630,null));};exports[_0xbb10('0xf0')]=function(_0xc1691,_0xff4c3b,_0x5dccd7){var _0x1821fc;return db[_0xbb10('0x47')]['find']({'where':{'id':_0xc1691[_0xbb10('0x63')]['id'],'role':_0xbb10('0x3d')},'attributes':['id','name',_0xbb10('0x42')]})[_0xbb10('0x24')](handleEntityNotFound(_0xff4c3b,null))[_0xbb10('0x24')](function(_0x24f1d2){if(_0x24f1d2){_0x1821fc=_0x24f1d2;return db['UserVoiceQueueRt'][_0xbb10('0x39')]({'where':{'membername':_0x1821fc[_0xbb10('0x43')]},'individualHooks':!![]});}})[_0xbb10('0x24')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x1821fc[_0xbb10('0x43')],'exitAt':null}});})[_0xbb10('0x24')](function(_0x29d8d7){var _0x2a13d7=[];_0x29d8d7['forEach'](function(_0x9f8b04){_0x2a13d7[_0xbb10('0xb0')](_0x9f8b04[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea'))}));});return BPromise['all'](_0x2a13d7);})['then'](function(){return _0x1821fc[_0xbb10('0x38')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xbb10('0x24')](respondWithResult(_0xff4c3b,null))['catch'](handleError(_0xff4c3b,null));};exports['pause']=function(_0x1536d1,_0x2eeb15,_0x4c75ae){var _0x3a25fe;return db[_0xbb10('0xb5')][_0xbb10('0x38')]({'paused':0x1},{'where':{'UserId':_0x1536d1['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x1536d1[_0xbb10('0x63')]['id'],'role':_0xbb10('0x3d')},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42'),'internal',_0xbb10('0xa3')]});})[_0xbb10('0x24')](handleEntityNotFound(_0x2eeb15,null))[_0xbb10('0x24')](function(_0x218f91){if(_0x218f91){_0x3a25fe=_0x218f91;return respondWithRpcPromise('QueuePause',_0xbb10('0xf1'),{'id':_0x3a25fe['id'],'name':_0x3a25fe[_0xbb10('0x43')],'pause':!![]});}})[_0xbb10('0x24')](function(){if(_0x3a25fe){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x3a25fe[_0xbb10('0x43')],'type':_0xbb10('0xf2'),'exitAt':null}});}})[_0xbb10('0x24')](function(_0x2b363c){if(_0x2b363c[_0xbb10('0x52')]){var _0x296bba=moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3201e2=0x0,_0xb4d550=_0x2b363c['length'];_0x3201e2<_0xb4d550;_0x3201e2++){_0x2b363c[_0x3201e2][_0xbb10('0xf3')]({'exitAt':_0x296bba});}}})[_0xbb10('0x24')](function(){var _0x1ccc9a=[];var _0x5daba5=utils[_0xbb10('0xf4')]();_0x5daba5[_0xbb10('0xe9')](function(_0x124fbe){_0x1ccc9a[_0xbb10('0xb0')]({'channel':_0x124fbe,'membername':_0x3a25fe[_0xbb10('0x43')],'interface':_[_0xbb10('0x72')](_0x3a25fe['interface'])?util[_0xbb10('0xb1')]('SIP/%s',_0x3a25fe[_0xbb10('0x43')]):_0x3a25fe[_0xbb10('0xa3')],'type':_0xbb10('0xf2'),'enterAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1536d1[_0xbb10('0x68')][_0xbb10('0x59')]||'DEFAULT\x20PAUSE','role':_0x3a25fe[_0xbb10('0x42')],'internal':_0x3a25fe['internal']});});return db[_0xbb10('0xe8')][_0xbb10('0x67')](_0x1ccc9a,{'individualHooks':!![]});})[_0xbb10('0x24')](function(){return _0x3a25fe[_0xbb10('0x38')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1536d1[_0xbb10('0x68')][_0xbb10('0x59')]||_0xbb10('0xf5'),'lastPauseAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x2eeb15,null))[_0xbb10('0x2c')](handleError(_0x2eeb15,null));};exports[_0xbb10('0xf6')]=function(_0x8133bb,_0x2b8f7c,_0x6f428e){var _0x3c5e1e;return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x8133bb[_0xbb10('0x63')]['id']},'attributes':['id','name',_0xbb10('0x42'),'voicePause',_0xbb10('0xf7'),_0xbb10('0xf8'),'faxPause',_0xbb10('0xf9'),_0xbb10('0xfa'),_0xbb10('0xfb'),_0xbb10('0xfc')]})[_0xbb10('0x24')](handleEntityNotFound(_0x2b8f7c,null))[_0xbb10('0x24')](function(_0x2d453f){if(_0x2d453f){_0x3c5e1e=_0x2d453f;if(_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')]&&!utils[_0xbb10('0xa4')](_0x8133bb['body'][_0xbb10('0xa0')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}switch(_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')]){case _0xbb10('0xaf'):return respondWithRpcPromise(_0xbb10('0xfd'),_0xbb10('0xf6'),{'id':_0x3c5e1e['id'],'name':_0x3c5e1e[_0xbb10('0x43')],'pause':![]})[_0xbb10('0x24')](function(){return db['UserVoiceQueueRt'][_0xbb10('0x38')]({'paused':0x0},{'where':{'UserId':_0x3c5e1e['id']},'individualHooks':!![]});})[_0xbb10('0x24')](function(){return db[_0xbb10('0xe8')]['find']({'where':{'channel':_0x8133bb['body'][_0xbb10('0xa0')],'membername':_0x3c5e1e['name'],'type':_0xbb10('0xf2'),'exitAt':null}});})[_0xbb10('0x24')](function(_0x291ff2){if(_0x291ff2){return _0x291ff2[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0xfe')},{'individualHooks':!![]});}return null;})[_0xbb10('0x24')](function(){return _0x3c5e1e[_0xbb10('0x38')]({'voicePause':![]});});case _0xbb10('0xff'):case _0xbb10('0x100'):case _0xbb10('0x101'):case _0xbb10('0x102'):case'openchannel':return db[_0xbb10('0xe8')][_0xbb10('0x66')]({'where':{'channel':_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')],'membername':_0x3c5e1e[_0xbb10('0x43')],'type':'PAUSE','exitAt':null}})[_0xbb10('0x24')](function(_0x3b73d4){if(_0x3b73d4){return _0x3b73d4[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xbb10('0x24')](function(){var _0x39b9f0={};_[_0xbb10('0x33')](_0x39b9f0,util[_0xbb10('0xb1')](_0xbb10('0x103'),_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')],'Pause'),![]);return _0x3c5e1e['update'](_0x39b9f0);});default:return respondWithRpcPromise(_0xbb10('0xfd'),_0xbb10('0xf6'),{'id':_0x3c5e1e['id'],'name':_0x3c5e1e['name'],'pause':![]})[_0xbb10('0x24')](function(){return db[_0xbb10('0xb5')][_0xbb10('0x38')]({'paused':0x0},{'where':{'UserId':_0x3c5e1e['id']}});})[_0xbb10('0x24')](function(){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x3c5e1e['name'],'type':_0xbb10('0xf2'),'exitAt':null}});})[_0xbb10('0x24')](function(_0x2d4461){var _0x6a9308=[];_0x2d4461['forEach'](function(_0x5dc194){_0x6a9308[_0xbb10('0xb0')](_0x5dc194[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'data2':_0xbb10('0xfe')}));});return BPromise[_0xbb10('0x104')](_0x6a9308);})[_0xbb10('0x24')](function(){return _0x3c5e1e[_0xbb10('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xbb10('0x24')](respondWithResult(_0x2b8f7c,null))[_0xbb10('0x2c')](handleError(_0x2b8f7c,null));};exports[_0xbb10('0x105')]=function(_0x3d8001,_0x9b1170,_0x178c61){var _0x5db2de={};var _0x84ad00={};var _0xa3da;var _0x45e0ab;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x3d8001[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x9b1170,null))[_0xbb10('0x24')](function(_0x813a33){if(_0x813a33){_0xa3da=_0x813a33;_0x84ad00[_0xbb10('0x4b')]=_['keys'](db['Team'][_0xbb10('0x48')]);_0x84ad00['query']=_[_0xbb10('0x65')](_0x3d8001[_0xbb10('0x4d')]);_0x84ad00['filters']=_['intersection'](_0x84ad00[_0xbb10('0x4b')],_0x84ad00[_0xbb10('0x4d')]);_0x5db2de['attributes']=_[_0xbb10('0x4f')](_0x84ad00[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x3d8001['query'][_0xbb10('0x51')]));_0x5db2de[_0xbb10('0x50')]=_0x5db2de[_0xbb10('0x50')]['length']?_0x5db2de[_0xbb10('0x50')]:_0x84ad00['model'];_0x5db2de[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x3d8001['query'][_0xbb10('0x56')]);_0x5db2de[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x3d8001[_0xbb10('0x4d')],_0x84ad00[_0xbb10('0x4e')]));if(_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x5db2de[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x5db2de[_0xbb10('0x57')],{'$or':_['map'](_0x5db2de[_0xbb10('0x50')],function(_0x229c31){var _0x2ff1a2={};_0x2ff1a2[_0x229c31]={'$like':'%'+_0x3d8001['query'][_0xbb10('0x3e')]+'%'};return _0x2ff1a2;})});}_0x5db2de=_[_0xbb10('0x58')]({},_0x5db2de,_0x3d8001[_0xbb10('0x5d')]);return _0xa3da[_0xbb10('0x105')](_0x5db2de);}})['then'](function(_0x347d0d){if(_0x347d0d){_0x45e0ab=_0x347d0d[_0xbb10('0x52')];if(!_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x5db2de[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x5db2de[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0xa3da[_0xbb10('0x105')](_0x5db2de);}})[_0xbb10('0x24')](function(_0x5a99ca){if(_0x5a99ca){return _0x5a99ca?{'count':_0x45e0ab,'rows':_0x5a99ca}:null;}})[_0xbb10('0x24')](respondWithResult(_0x9b1170,null))['catch'](handleError(_0x9b1170,null));};exports['addTeams']=function(_0x553054,_0x2f3e26){return db['User'][_0xbb10('0x66')]({'where':{'id':_0x553054['params']['id']}})['then'](handleEntityNotFound(_0x2f3e26,null))[_0xbb10('0x24')](function(_0x5278d0){if(_0x5278d0){var _0x2dcc71=_0x5278d0[_0xbb10('0x3a')]({'plain':!![]});return _0x5278d0[_0xbb10('0x106')](_0x553054[_0xbb10('0x68')]['ids'],_[_0xbb10('0x6b')](_0x553054[_0xbb10('0x68')],[_0xbb10('0x6a'),'id'])||{})[_0xbb10('0x24')](function(){for(var _0x281873=0x0;_0x281873<_0x553054[_0xbb10('0x68')]['ids'][_0xbb10('0x52')];_0x281873++){var _0x2fefd2=[];db[_0xbb10('0x107')][_0xbb10('0x95')]({'where':{'id':_0x553054[_0xbb10('0x68')][_0xbb10('0x6a')][_0x281873]}})[_0xbb10('0x24')](function(_0x20f65c){_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0xe6')]()['then'](function(_0x5b8ffd){for(var _0x5cf145=0x0;_0x5cf145<_0x5b8ffd[_0xbb10('0x52')];_0x5cf145++){_0x5b8ffd[_0x5cf145][_0xbb10('0x108')]('channel',_0xbb10('0x109'));}return _0x5b8ffd;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c['getChatQueues']()[_0xbb10('0x24')](function(_0x836686){for(var _0x3a3d86=0x0;_0x3a3d86<_0x836686[_0xbb10('0x52')];_0x3a3d86++){_0x836686[_0x3a3d86][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x10a'));}return _0x836686;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x10b')]()['then'](function(_0x15fce2){for(var _0x3301f8=0x0;_0x3301f8<_0x15fce2[_0xbb10('0x52')];_0x3301f8++){_0x15fce2[_0x3301f8][_0xbb10('0x108')]('channel',_0xbb10('0x10c'));}return _0x15fce2;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x10d')]()[_0xbb10('0x24')](function(_0xcb30de){for(var _0x46eaab=0x0;_0x46eaab<_0xcb30de[_0xbb10('0x52')];_0x46eaab++){_0xcb30de[_0x46eaab][_0xbb10('0x108')]('channel',_0xbb10('0x10e'));}return _0xcb30de;}));_0x2fefd2['push'](_0x20f65c[_0xbb10('0x10f')]()[_0xbb10('0x24')](function(_0x106a6a){for(var _0x5a9680=0x0;_0x5a9680<_0x106a6a[_0xbb10('0x52')];_0x5a9680++){_0x106a6a[_0x5a9680][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x110'));}return _0x106a6a;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x111')]()[_0xbb10('0x24')](function(_0x36a05f){for(var _0x258add=0x0;_0x258add<_0x36a05f['length'];_0x258add++){_0x36a05f[_0x258add][_0xbb10('0x108')]('channel',_0xbb10('0x112'));}return _0x36a05f;}));return BPromise[_0xbb10('0x104')](_0x2fefd2);})[_0xbb10('0x24')](function(_0x2fc812){var _0x5de09a=_[_0xbb10('0x113')](_0x2fc812);_0x2fefd2=[];return db[_0xbb10('0x5a')]['transaction'](function(_0x220d39){for(var _0xf8b732=0x0;_0xf8b732<_0x5de09a[_0xbb10('0x52')];_0xf8b732++){_0x2fefd2[_0xbb10('0xb0')](_0x5de09a[_0xf8b732]['addAgent'](_0x2dcc71['id']),{'transaction':_0x220d39});}return BPromise[_0xbb10('0x104')](_0x2fefd2)['then'](function(){if(_0x2dcc71[_0xbb10('0xa1')]){return BPromise['each'](_[_0xbb10('0x3e')](_0x5de09a,function(_0x2fe77a){return _0x2fe77a[_0xbb10('0x114')](_0xbb10('0xa0'))===_0xbb10('0x109');}),function(_0x1ba03d){return db[_0xbb10('0xb5')][_0xbb10('0xb6')]({'membername':_0x2dcc71[_0xbb10('0x43')],'UserId':_0x2dcc71['id'],'queue_name':_0x1ba03d[_0xbb10('0x43')],'VoiceQueueId':_0x1ba03d['id'],'interface':_[_0xbb10('0x72')](_0x2dcc71[_0xbb10('0xa3')])?util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x2dcc71['name']):_0x2dcc71[_0xbb10('0xa3')],'paused':_0x2dcc71['voicePause']||![],'penalty':_0x2dcc71[_0xbb10('0xa9')]},{'transaction':_0x220d39});});}else{return;}})[_0xbb10('0x24')](function(){for(var _0x71e092=0x0;_0x71e092<_0x5de09a['length'];_0x71e092++){var _0x3c1c6c=_0x5de09a[_0x71e092][_0xbb10('0x114')](_0xbb10('0xa0'));var _0x188a4a=_0x3c1c6c+'QueueId';socket['emit'](_0xbb10('0x3c')+_0x3c1c6c+_0xbb10('0xad'),{'UserId':_0x2dcc71['id'],['queueField']:_0x5de09a[_0x71e092]['id']});}});});});}});}})[_0xbb10('0x24')](respondWithStatusCode(_0x2f3e26,null))[_0xbb10('0x2c')](handleError(_0x2f3e26,null));};exports['removeTeams']=function(_0x2ee6af,_0x3f881c){return db[_0xbb10('0x47')]['findOne']({'where':{'id':_0x2ee6af['params']['id']}})['then'](handleEntityNotFound(_0x3f881c,null))['then'](function(_0x2bb476){if(_0x2bb476){var _0x2e1fdb=_0x2bb476['get']({'plain':!![]});var _0x4092d8=_0x2ee6af[_0xbb10('0x4d')][_0xbb10('0x6a')];return _0x2bb476['removeTeams'](_0x4092d8)['then'](function(){for(var _0x51179e=0x0;_0x51179e<_0x4092d8[_0xbb10('0x52')];_0x51179e++){var _0x382702=[];db['Team'][_0xbb10('0x95')]({'where':{'id':_0x4092d8[_0x51179e]}})[_0xbb10('0x24')](function(_0x77e6a2){_0x382702[_0xbb10('0xb0')](_0x77e6a2['getVoiceQueues']()[_0xbb10('0x24')](function(_0x45f333){for(var _0x1588f6=0x0;_0x1588f6<_0x45f333['length'];_0x1588f6++){_0x45f333[_0x1588f6][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x109'));}return _0x45f333;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x115')]()[_0xbb10('0x24')](function(_0x5d6665){for(var _0x4be971=0x0;_0x4be971<_0x5d6665[_0xbb10('0x52')];_0x4be971++){_0x5d6665[_0x4be971]['setDataValue']('channel',_0xbb10('0x10a'));}return _0x5d6665;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x10b')]()[_0xbb10('0x24')](function(_0x301bc6){for(var _0xda32a7=0x0;_0xda32a7<_0x301bc6[_0xbb10('0x52')];_0xda32a7++){_0x301bc6[_0xda32a7]['setDataValue'](_0xbb10('0xa0'),_0xbb10('0x10c'));}return _0x301bc6;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x10d')]()[_0xbb10('0x24')](function(_0x4e621c){for(var _0x5a5f1b=0x0;_0x5a5f1b<_0x4e621c[_0xbb10('0x52')];_0x5a5f1b++){_0x4e621c[_0x5a5f1b][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x10e'));}return _0x4e621c;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2['getFaxQueues']()['then'](function(_0x3e47ec){for(var _0x5c8df0=0x0;_0x5c8df0<_0x3e47ec[_0xbb10('0x52')];_0x5c8df0++){_0x3e47ec[_0x5c8df0][_0xbb10('0x108')]('channel','Fax');}return _0x3e47ec;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x111')]()[_0xbb10('0x24')](function(_0x245cc2){for(var _0x362eae=0x0;_0x362eae<_0x245cc2[_0xbb10('0x52')];_0x362eae++){_0x245cc2[_0x362eae]['setDataValue'](_0xbb10('0xa0'),_0xbb10('0x112'));}return _0x245cc2;}));return BPromise[_0xbb10('0x104')](_0x382702);})[_0xbb10('0x24')](function(_0x5c472e){var _0x5bc002=_[_0xbb10('0x113')](_0x5c472e);_0x382702=[];return db[_0xbb10('0x5a')][_0xbb10('0x116')](function(_0x1ba68f){for(var _0xb86419=0x0;_0xb86419<_0x5bc002[_0xbb10('0x52')];_0xb86419++){_0x382702['push'](_0x5bc002[_0xb86419]['removeAgent'](_0x2e1fdb['id']),{'transaction':_0x1ba68f});}return BPromise[_0xbb10('0x104')](_0x382702)[_0xbb10('0x24')](function(){if(_0x2e1fdb[_0xbb10('0xa1')]){return BPromise[_0xbb10('0xb4')](_['filter'](_0x5bc002,function(_0x463d0f){return _0x463d0f[_0xbb10('0x114')](_0xbb10('0xa0'))===_0xbb10('0x109');}),function(_0x3fa317){return db[_0xbb10('0xb5')][_0xbb10('0x39')]({'where':{'VoiceQueueId':_0x3fa317['id'],'UserId':_0x2e1fdb['id']},'transaction':_0x1ba68f});});}else{return;}})['then'](function(){for(var _0x3b0322=0x0;_0x3b0322<_0x5bc002[_0xbb10('0x52')];_0x3b0322++){var _0x26f413=_0x5bc002[_0x3b0322][_0xbb10('0x114')](_0xbb10('0xa0'));var _0x460157=_0x26f413+_0xbb10('0xab');socket[_0xbb10('0xac')]('user'+_0x26f413+_0xbb10('0xb8'),{'UserId':_0x2e1fdb['id'],['queueField']:_0x5bc002[_0x3b0322]['id']});}});});});}});}})[_0xbb10('0x24')](respondWithStatusCode(_0x3f881c,null))[_0xbb10('0x2c')](handleError(_0x3f881c,null));};exports['getLists']=function(_0x5457ed,_0x152c97,_0x2d81db){var _0x28ee28={};var _0x195a5b={};var _0x5db829;var _0x3053d2;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x5457ed[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x152c97,null))[_0xbb10('0x24')](function(_0x267335){if(_0x267335){_0x5db829=_0x267335;_0x195a5b[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0x117')]['rawAttributes']);_0x195a5b[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x5457ed[_0xbb10('0x4d')]);_0x195a5b['filters']=_['intersection'](_0x195a5b[_0xbb10('0x4b')],_0x195a5b['query']);_0x28ee28[_0xbb10('0x50')]=_['intersection'](_0x195a5b[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x5457ed[_0xbb10('0x4d')]['fields']));_0x28ee28[_0xbb10('0x50')]=_0x28ee28[_0xbb10('0x50')]['length']?_0x28ee28[_0xbb10('0x50')]:_0x195a5b[_0xbb10('0x4b')];_0x28ee28[_0xbb10('0xc4')]=qs['sort'](_0x5457ed[_0xbb10('0x4d')]['sort']);_0x28ee28[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x5457ed['query'],_0x195a5b['filters']));if(_0x5457ed['query'][_0xbb10('0x3e')]){_0x28ee28['where']=_[_0xbb10('0x58')](_0x28ee28['where'],{'$or':_[_0xbb10('0x40')](_0x28ee28[_0xbb10('0x50')],function(_0x4e63e1){var _0x4bfc39={};_0x4bfc39[_0x4e63e1]={'$like':'%'+_0x5457ed[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x4bfc39;})});}_0x28ee28=_['merge']({},_0x28ee28,_0x5457ed[_0xbb10('0x5d')]);return _0x5db829[_0xbb10('0x118')](_0x28ee28);}})[_0xbb10('0x24')](function(_0x4dd5da){if(_0x4dd5da){_0x3053d2=_0x4dd5da[_0xbb10('0x52')];if(!_0x5457ed[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x28ee28[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x5457ed[_0xbb10('0x4d')]['limit']);_0x28ee28[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x5457ed[_0xbb10('0x4d')]['offset']);}return _0x5db829[_0xbb10('0x118')](_0x28ee28);}})[_0xbb10('0x24')](function(_0x521aa3){if(_0x521aa3){return _0x521aa3?{'count':_0x3053d2,'rows':_0x521aa3}:null;}})[_0xbb10('0x24')](respondWithResult(_0x152c97,null))[_0xbb10('0x2c')](handleError(_0x152c97,null));};exports[_0xbb10('0x119')]=function(_0x347821,_0x28a567,_0x2a7921){var _0x12be2f={};var _0x302201={};var _0x256a13;var _0xf47d92;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x347821[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x28a567,null))[_0xbb10('0x24')](function(_0x11ae04){if(_0x11ae04){_0x256a13=_0x11ae04;_0x302201['model']=_['keys'](db[_0xbb10('0x47')][_0xbb10('0x48')]);_0x302201[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x347821['query']);_0x302201[_0xbb10('0x4e')]=_['intersection'](_0x302201['model'],_0x302201['query']);_0x12be2f[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x302201[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x347821['query'][_0xbb10('0x51')]));_0x12be2f['attributes']=_0x12be2f[_0xbb10('0x50')][_0xbb10('0x52')]?_0x12be2f[_0xbb10('0x50')]:_0x302201[_0xbb10('0x4b')];_0x12be2f[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x347821['query']['sort']);_0x12be2f[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x347821[_0xbb10('0x4d')],_0x302201[_0xbb10('0x4e')]));if(_0x347821['query'][_0xbb10('0x3e')]){_0x12be2f[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x12be2f[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x12be2f[_0xbb10('0x50')],function(_0x347199){var _0x4e366d={};_0x4e366d[_0x347199]={'$like':'%'+_0x347821[_0xbb10('0x4d')]['filter']+'%'};return _0x4e366d;})});}_0x12be2f[_0xbb10('0x4b')]=db[_0xbb10('0x47')];_0x12be2f['as']=_0xbb10('0x8e');_0x12be2f=_[_0xbb10('0x58')]({},_0x12be2f,_0x347821[_0xbb10('0x5d')]);return _0x256a13[_0xbb10('0xe6')]({'include':[_0x12be2f]});}})['then'](function(_0x2ddf65){if(_0x2ddf65){var _0x31d564={},_0x117375=[],_0x5e5dd0=0x0;for(var _0x4a7cf9=0x0;_0x4a7cf9<_0x2ddf65[_0xbb10('0x52')];_0x4a7cf9+=0x1){for(var _0x3134a6=0x0,_0x579c96;_0x3134a6<_0x2ddf65[_0x4a7cf9]['Agents'][_0xbb10('0x52')];_0x3134a6+=0x1){_0x579c96=_0x2ddf65[_0x4a7cf9][_0xbb10('0x8e')][_0x3134a6][_0xbb10('0x3a')]({'plain':!![]});_0x31d564[_0x579c96['id']]=_0x579c96;}}_0x31d564=_[_0xbb10('0x11a')](_0x31d564);for(var _0x528223=qs[_0xbb10('0x32')](_0x347821[_0xbb10('0x4d')][_0xbb10('0x32')]);_0x528223<_0x31d564[_0xbb10('0x52')]&&_0x117375['length']=_0x5bc27c[_0x5171('0x50')]){throw new Error(_0x5171('0x51'));}})[_0x5171('0xd')](function(){if(_0x383d7d){return db['UserVoiceQueueRt'][_0x5171('0x48')]({'where':{'membername':_0x383d7d[_0x5171('0x25')]},'individualHooks':!![]});}})['then'](function(){if(_0x383d7d){return _0x383d7d['getVoiceQueues']({'raw':!![]});}})[_0x5171('0xd')](function(_0x4163c5){if(_0x383d7d){if(_0x4163c5){var _0x656bc4=[];_0x3c0143=_0x4163c5;if(_0x3c0143[_0x5171('0x2d')]){for(var _0x2bf04f=0x0;_0x2bf04f<_0x3c0143['length'];_0x2bf04f++){_0x656bc4['push'](db['UserVoiceQueueRt'][_0x5171('0x52')]({'membername':_0x383d7d[_0x5171('0x25')],'UserId':_0x383d7d['id'],'queue_name':_0x3c0143[_0x2bf04f]['name'],'VoiceQueueId':_0x3c0143[_0x2bf04f]['id'],'interface':_0x468bb5,'paused':_0x383d7d[_0x5171('0x4c')]||![],'penalty':_0x3c0143[_0x2bf04f][_0x5171('0x53')]||0x0}));}return BPromise[_0x5171('0x46')](_0x656bc4);}}}})[_0x5171('0xd')](function(){if(_0x383d7d){return db[_0x5171('0x2a')][_0x5171('0x2b')]({'where':{'membername':_0x383d7d[_0x5171('0x25')],'exitAt':null}});}})['then'](function(_0x1234e8){if(_0x383d7d){if(_0x1234e8&&_0x1234e8['length']){var _0xc9ec0=[];_0x1234e8[_0x5171('0x30')](function(_0xd9754a){_0xc9ec0[_0x5171('0x31')](_0xd9754a['update']({'exitAt':moment()['format'](_0x5171('0x2e'))}));});return BPromise[_0x5171('0x46')](_0xc9ec0);}}})[_0x5171('0xd')](function(_0x56c907){if(_0x383d7d){var _0x277eb3=[];var _0x37e323=[];var _0x4335ec=utils[_0x5171('0x2f')]();var _0x536884={'membername':_0x383d7d['name'],'interface':_0x468bb5,'enterAt':moment()[_0x5171('0x34')](_0x5171('0x2e')),'role':_0x383d7d[_0x5171('0x26')],'internal':_0x383d7d['internal']};_0x4335ec[_0x5171('0x30')](function(_0x187dcb){_0x277eb3['push'](_[_0x5171('0x54')]({'channel':_0x187dcb,'type':_0x5171('0x55'),'data1':_0x5171('0x56'),'data2':_0x468bb5},_0x536884));if(_0x383d7d[_0x5171('0x4c')]){_0x37e323[_0x5171('0x31')](_[_0x5171('0x54')]({'channel':_0x187dcb,'type':'PAUSE','data1':_0x5171('0x57')},_0x536884));}});return db[_0x5171('0x2a')][_0x5171('0x39')](_0x277eb3[_0x5171('0x58')](_0x37e323),{'individualHooks':!![]});}})['then'](function(){if(_0x383d7d){return _0x383d7d[_0x5171('0x29')]({'online':!![],'lastLoginAt':moment()[_0x5171('0x34')](_0x5171('0x2e')),'voicePause':_0x383d7d[_0x5171('0x4c')]||![],'mailPause':_0x383d7d[_0x5171('0x4c')]||![],'chatPause':_0x383d7d['loginInPause']||![],'faxPause':_0x383d7d[_0x5171('0x4c')]||![],'smsPause':_0x383d7d[_0x5171('0x4c')]||![],'openchannelPause':_0x383d7d[_0x5171('0x4c')]||![],'pauseType':_0x383d7d['loginInPause']?_0x5171('0x57'):null,'lastPauseAt':moment()[_0x5171('0x34')](_0x5171('0x2e')),'interface':_0x468bb5});}})[_0x5171('0xd')](function(_0x24253e){_0x242444(_0x24253e);})[_0x5171('0x16')](function(_0x5e80ad){_0x586b81(_0x1c74d3['error'](0x1f4,_0x5e80ad[_0x5171('0x13')]));});});}; \ No newline at end of file +var _0x22b1=['User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','GetUser','User','findAll','options','raw','where','limit','map','include','model','attributes','ShowUser','find','PauseUser','name','internal','interface','update','MemberReport','PAUSE','length','format','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','DEFAULT\x20PAUSE','uniqueid','bulkCreate','body','type','findOne','channel','Unknown\x20channel','voice','YYYY-MM-DD\x20HH:mm:ss','mail','system','set','UserVoiceQueueRt','all','LogoutUser','LoginUser','role','phone','loginInPause','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','LOGININPAUSE','concat','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','debug'];(function(_0x4feeda,_0x186eb2){var _0x171296=function(_0x43eadd){while(--_0x43eadd){_0x4feeda['push'](_0x4feeda['shift']());}};_0x171296(++_0x186eb2);}(_0x22b1,0xa1));var _0x122b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x22b1[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require(_0x122b('0x0'));var moment=require(_0x122b('0x1'));var BPromise=require(_0x122b('0x2'));var rs=require(_0x122b('0x3'));var fs=require('fs');var Redis=require(_0x122b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x122b('0x5'));var logger=require(_0x122b('0x6'))(_0x122b('0x7'));var config=require(_0x122b('0x8'));var jayson=require(_0x122b('0x9'));var client=jayson[_0x122b('0xa')][_0x122b('0xb')]({'port':0x232a});config[_0x122b('0xc')]=_[_0x122b('0xd')](config[_0x122b('0xc')],{'host':_0x122b('0xe'),'port':0x18eb});var socket=require(_0x122b('0xf'))(new Redis(config[_0x122b('0xc')]));require(_0x122b('0x10'))[_0x122b('0x11')](socket);function respondWithRpcPromise(_0x2d8569,_0x2d081f,_0x2e9fcf){return new BPromise(function(_0x3f40b6,_0x515491){return client[_0x122b('0x12')](_0x2d8569,_0x2e9fcf)[_0x122b('0x13')](function(_0x11ed3e){logger[_0x122b('0x14')](_0x122b('0x15'),_0x2d081f,'request\x20sent');logger[_0x122b('0x16')](_0x122b('0x17'),_0x2d081f,_0x122b('0x18'),JSON[_0x122b('0x19')](_0x11ed3e));if(_0x11ed3e['error']){if(_0x11ed3e['error'][_0x122b('0x1a')]===0x1f4){logger[_0x122b('0x1b')](_0x122b('0x15'),_0x2d081f,_0x11ed3e['error'][_0x122b('0x1c')]);return _0x515491(_0x11ed3e[_0x122b('0x1b')][_0x122b('0x1c')]);}logger[_0x122b('0x1b')]('User,\x20%s,\x20%s',_0x2d081f,_0x11ed3e[_0x122b('0x1b')]['message']);return _0x3f40b6(_0x11ed3e[_0x122b('0x1b')][_0x122b('0x1c')]);}else{logger[_0x122b('0x14')](_0x122b('0x15'),_0x2d081f,'request\x20sent');_0x3f40b6(_0x11ed3e[_0x122b('0x1d')]['message']);}})[_0x122b('0x1e')](function(_0x262a3b){logger[_0x122b('0x1b')](_0x122b('0x15'),_0x2d081f,_0x262a3b);_0x515491(_0x262a3b);});});}exports[_0x122b('0x1f')]=function(_0x53c843){var _0x4cb2c5=this;return new Promise(function(_0x2e77c8,_0x175dda){return db[_0x122b('0x20')][_0x122b('0x21')]({'raw':_0x53c843[_0x122b('0x22')]?_0x53c843[_0x122b('0x22')][_0x122b('0x23')]===undefined?!![]:![]:!![],'where':_0x53c843[_0x122b('0x22')]?_0x53c843[_0x122b('0x22')][_0x122b('0x24')]||null:null,'attributes':_0x53c843[_0x122b('0x22')]?_0x53c843['options']['attributes']||null:null,'limit':_0x53c843['options']?_0x53c843[_0x122b('0x22')][_0x122b('0x25')]||null:null,'include':_0x53c843[_0x122b('0x22')]?_0x53c843['options']['include']?_[_0x122b('0x26')](_0x53c843[_0x122b('0x22')][_0x122b('0x27')],function(_0x20a998){return{'model':db[_0x20a998['model']],'as':_0x20a998['as'],'attributes':_0x20a998['attributes'],'include':_0x20a998[_0x122b('0x27')]?_[_0x122b('0x26')](_0x20a998[_0x122b('0x27')],function(_0x2e843f){return{'model':db[_0x2e843f[_0x122b('0x28')]],'as':_0x2e843f['as'],'attributes':_0x2e843f['attributes'],'include':_0x2e843f[_0x122b('0x27')]?_['map'](_0x2e843f[_0x122b('0x27')],function(_0x28893d){return{'model':db[_0x28893d[_0x122b('0x28')]],'as':_0x28893d['as'],'attributes':_0x28893d[_0x122b('0x29')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c09fd){logger['info']('GetUser',_0x53c843);logger['debug']('GetUser',_0x53c843,JSON[_0x122b('0x19')](_0x4c09fd));_0x2e77c8(_0x4c09fd);})[_0x122b('0x1e')](function(_0x4311a6){logger[_0x122b('0x1b')]('GetUser',_0x4311a6['message'],_0x53c843);_0x175dda(_0x4cb2c5[_0x122b('0x1b')](0x1f4,_0x4311a6['message']));});});};exports[_0x122b('0x2a')]=function(_0x3d8256){var _0x394223=this;return new Promise(function(_0x2098be,_0x1a674e){return db[_0x122b('0x20')][_0x122b('0x2b')]({'raw':_0x3d8256['options']?_0x3d8256[_0x122b('0x22')][_0x122b('0x23')]===undefined?!![]:![]:!![],'where':_0x3d8256[_0x122b('0x22')]?_0x3d8256[_0x122b('0x22')]['where']||null:null,'attributes':_0x3d8256[_0x122b('0x22')]?_0x3d8256[_0x122b('0x22')]['attributes']||null:null,'include':_0x3d8256[_0x122b('0x22')]?_0x3d8256['options']['include']?_[_0x122b('0x26')](_0x3d8256[_0x122b('0x22')][_0x122b('0x27')],function(_0x39dc0f){return{'model':db[_0x39dc0f[_0x122b('0x28')]],'as':_0x39dc0f['as'],'attributes':_0x39dc0f[_0x122b('0x29')],'include':_0x39dc0f['include']?_['map'](_0x39dc0f['include'],function(_0x5621a8){return{'model':db[_0x5621a8[_0x122b('0x28')]],'as':_0x5621a8['as'],'attributes':_0x5621a8[_0x122b('0x29')],'include':_0x5621a8[_0x122b('0x27')]?_[_0x122b('0x26')](_0x5621a8[_0x122b('0x27')],function(_0x1537ac){return{'model':db[_0x1537ac[_0x122b('0x28')]],'as':_0x1537ac['as'],'attributes':_0x1537ac[_0x122b('0x29')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2da951){logger[_0x122b('0x14')]('ShowUser',_0x3d8256);logger[_0x122b('0x16')](_0x122b('0x2a'),_0x3d8256,JSON[_0x122b('0x19')](_0x2da951));_0x2098be(_0x2da951);})['catch'](function(_0x455593){logger[_0x122b('0x1b')]('ShowUser',_0x455593['message'],_0x3d8256);_0x1a674e(_0x394223[_0x122b('0x1b')](0x1f4,_0x455593[_0x122b('0x1c')]));});});};exports[_0x122b('0x2c')]=function(_0x333dd4){var _0x5b81cb=this;return new Promise(function(_0x851ce0,_0x1d4a31){var _0x32898f;return db[_0x122b('0x20')]['find']({'where':_0x333dd4[_0x122b('0x22')][_0x122b('0x24')]||{},'attributes':['id',_0x122b('0x2d'),'role',_0x122b('0x2e'),_0x122b('0x2f')]})['then'](function(_0x5520d4){if(_0x5520d4){_0x32898f=_0x5520d4;return db['UserVoiceQueueRt'][_0x122b('0x30')]({'paused':0x1},{'where':{'UserId':_0x32898f['id']},'individualHooks':!![]});}})[_0x122b('0x13')](function(){if(_0x32898f){return db[_0x122b('0x31')][_0x122b('0x21')]({'where':{'membername':_0x32898f[_0x122b('0x2d')],'type':_0x122b('0x32'),'exitAt':null}});}})[_0x122b('0x13')](function(_0x1a0a06){if(_0x32898f){if(_0x1a0a06&&_0x1a0a06[_0x122b('0x33')]){var _0x3706d0=moment()[_0x122b('0x34')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x2276ff=0x0,_0x275148=_0x1a0a06['length'];_0x2276ff<_0x275148;_0x2276ff++){_0x1a0a06[_0x2276ff][_0x122b('0x35')]({'exitAt':_0x3706d0});}}}})[_0x122b('0x13')](function(){if(_0x32898f){var _0x3c7687=[];var _0x3e1e06=utils[_0x122b('0x36')]();_0x3e1e06[_0x122b('0x37')](function(_0x13d91a){_0x3c7687[_0x122b('0x38')]({'channel':_0x13d91a,'membername':_0x32898f[_0x122b('0x2d')],'interface':_[_0x122b('0x39')](_0x32898f['interface'])?util[_0x122b('0x34')](_0x122b('0x3a'),_0x32898f[_0x122b('0x2d')]):_0x32898f['interface'],'type':_0x122b('0x32'),'enterAt':moment()[_0x122b('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x333dd4['body']['type']||_0x122b('0x3b'),'role':_0x32898f['role'],'internal':_0x32898f[_0x122b('0x2e')],'uniqueid':_0x333dd4['body'][_0x122b('0x3c')]||null});});return db[_0x122b('0x31')][_0x122b('0x3d')](_0x3c7687,{'individualHooks':!![]});}})[_0x122b('0x13')](function(){if(_0x32898f){return _0x32898f[_0x122b('0x30')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x333dd4[_0x122b('0x3e')][_0x122b('0x3f')]||_0x122b('0x3b'),'lastPauseAt':moment()[_0x122b('0x34')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x122b('0x13')](function(_0x10492f){_0x851ce0(_0x10492f);})[_0x122b('0x1e')](function(_0x3459f2){_0x1d4a31(_0x5b81cb[_0x122b('0x1b')](0x1f4,_0x3459f2[_0x122b('0x1c')]));});});};exports['UnpauseUser']=function(_0x32c499){var _0x185f43=this;return new Promise(function(_0x4fd230,_0x3b7c8e){var _0x29d64e;return db[_0x122b('0x20')][_0x122b('0x40')]({'where':_0x32c499[_0x122b('0x22')][_0x122b('0x24')]||{},'attributes':['id','name']})['then'](function(_0x1e09e8){if(_0x1e09e8){_0x29d64e=_0x1e09e8;if(_0x32c499[_0x122b('0x3e')][_0x122b('0x41')]&&!utils['isValidChannel'](_0x32c499[_0x122b('0x3e')][_0x122b('0x41')])){throw new Error(_0x122b('0x42'));}switch(_0x32c499[_0x122b('0x3e')]['channel']){case _0x122b('0x43'):return db['UserVoiceQueueRt'][_0x122b('0x30')]({'paused':0x0},{'where':{'UserId':_0x29d64e['id']}})['then'](function(){return db[_0x122b('0x31')][_0x122b('0x2b')]({'where':{'channel':_0x32c499[_0x122b('0x3e')]['channel'],'membername':_0x29d64e['name'],'type':_0x122b('0x32'),'exitAt':null}});})[_0x122b('0x13')](function(_0x35aa65){if(_0x35aa65){return _0x35aa65[_0x122b('0x30')]({'exitAt':moment()[_0x122b('0x34')](_0x122b('0x44')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x122b('0x13')](function(){return _0x29d64e[_0x122b('0x30')]({'voicePause':![]});});case _0x122b('0x45'):case'chat':case'fax':case'sms':case'openchannel':return db['MemberReport']['find']({'where':{'channel':_0x32c499[_0x122b('0x3e')][_0x122b('0x41')],'membername':_0x29d64e[_0x122b('0x2d')],'type':_0x122b('0x32'),'exitAt':null}})['then'](function(_0x44bc35){return _0x44bc35['update']({'exitAt':moment()['format'](_0x122b('0x44')),'data2':_0x122b('0x46')},{'individualHooks':!![]});})[_0x122b('0x13')](function(){var _0x8f1be7={};_[_0x122b('0x47')](_0x8f1be7,util[_0x122b('0x34')]('%s%s',_0x32c499[_0x122b('0x3e')][_0x122b('0x41')],'Pause'),![]);return _0x29d64e[_0x122b('0x30')](_0x8f1be7);});default:return db[_0x122b('0x48')]['update']({'paused':0x0},{'where':{'UserId':_0x29d64e['id']}})[_0x122b('0x13')](function(){return db[_0x122b('0x31')][_0x122b('0x21')]({'where':{'membername':_0x29d64e['name'],'type':_0x122b('0x32'),'exitAt':null}});})[_0x122b('0x13')](function(_0x121806){var _0x4841d0=[];_0x121806[_0x122b('0x37')](function(_0x32561a){_0x4841d0['push'](_0x32561a[_0x122b('0x30')]({'exitAt':moment()['format'](_0x122b('0x44')),'data2':_0x122b('0x46')}));});return BPromise[_0x122b('0x49')](_0x4841d0);})[_0x122b('0x13')](function(){return _0x29d64e['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](function(_0x3dbd92){_0x4fd230(_0x3dbd92);})['catch'](function(_0x14f14f){_0x3b7c8e(_0x185f43[_0x122b('0x1b')](0x1f4,_0x14f14f[_0x122b('0x1c')]));});});};exports[_0x122b('0x4a')]=function(_0x47007e){var _0x5ae131=this;return new Promise(function(_0x3fbfbc,_0x115a20){var _0x4b878e;return db[_0x122b('0x20')]['findOne']({'where':_0x47007e[_0x122b('0x22')][_0x122b('0x24')]||{},'attributes':['id',_0x122b('0x2d')]})[_0x122b('0x13')](function(_0xa6f12c){if(_0xa6f12c){_0x4b878e=_0xa6f12c;return db[_0x122b('0x48')]['destroy']({'where':{'membername':_0x4b878e[_0x122b('0x2d')]},'individualHooks':!![]});}})['then'](function(){if(_0x4b878e){return db[_0x122b('0x31')][_0x122b('0x21')]({'where':{'membername':_0x4b878e[_0x122b('0x2d')],'exitAt':null}});}})[_0x122b('0x13')](function(_0x35a599){if(_0x4b878e){if(_0x35a599&&_0x35a599[_0x122b('0x33')]){var _0x1f4059=[];_0x35a599['forEach'](function(_0x43901d){_0x1f4059[_0x122b('0x38')](_0x43901d[_0x122b('0x30')]({'exitAt':moment()[_0x122b('0x34')](_0x122b('0x44'))}));});return BPromise[_0x122b('0x49')](_0x1f4059);}}})['then'](function(){if(_0x4b878e){return _0x4b878e[_0x122b('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x122b('0x13')](function(_0x36b22e){_0x3fbfbc(_0x36b22e);})['catch'](function(_0x161ffa){_0x115a20(_0x5ae131[_0x122b('0x1b')](0x1f4,_0x161ffa['message']));});});};exports[_0x122b('0x4b')]=function(_0x5ebbe9){var _0x2fe013=this;return new Promise(function(_0x1301b0,_0x3770e2){var _0x75ca6f;var _0x4697ee;var _0x2c052b;var _0x23d8be;return db[_0x122b('0x20')]['findOne']({'where':_0x5ebbe9[_0x122b('0x22')][_0x122b('0x24')]||{},'attributes':['id',_0x122b('0x2d'),_0x122b('0x4c'),'mobile',_0x122b('0x4d'),_0x122b('0x2e'),_0x122b('0x4e'),_0x122b('0x2f')]})[_0x122b('0x13')](function(_0x31a196){if(_0x31a196){_0x75ca6f=_0x31a196;_0x23d8be=_0x5ebbe9['body']['interface']?_0x5ebbe9['body'][_0x122b('0x2f')]:util[_0x122b('0x34')](_0x122b('0x3a'),_0x75ca6f[_0x122b('0x2d')]);return db[_0x122b('0x20')][_0x122b('0x4f')]({'where':{'role':_0x122b('0x50'),'online':!![],'id':{'$ne':_0x75ca6f['id']}}});}})[_0x122b('0x13')](function(_0x53ef52){if(_0x53ef52){_0x2c052b=_0x53ef52;return require(_0x122b('0x51'))[_0x122b('0x52')]();}})[_0x122b('0x13')](function(_0x4f92ec){if(_0x4f92ec&&_0x4f92ec[_0x122b('0x53')]&&_0x2c052b>=_0x4f92ec[_0x122b('0x53')]){throw new Error(_0x122b('0x54'));}})[_0x122b('0x13')](function(){if(_0x75ca6f){return db[_0x122b('0x48')][_0x122b('0x55')]({'where':{'membername':_0x75ca6f[_0x122b('0x2d')]},'individualHooks':!![]});}})[_0x122b('0x13')](function(){if(_0x75ca6f){return _0x75ca6f[_0x122b('0x56')]({'raw':!![]});}})['then'](function(_0x408ea3){if(_0x75ca6f){if(_0x408ea3){var _0x4d194a=[];_0x4697ee=_0x408ea3;if(_0x4697ee['length']){for(var _0x5799a2=0x0;_0x5799a2<_0x4697ee[_0x122b('0x33')];_0x5799a2++){_0x4d194a[_0x122b('0x38')](db[_0x122b('0x48')]['upsert']({'membername':_0x75ca6f['name'],'UserId':_0x75ca6f['id'],'queue_name':_0x4697ee[_0x5799a2][_0x122b('0x2d')],'VoiceQueueId':_0x4697ee[_0x5799a2]['id'],'interface':_0x23d8be,'paused':_0x75ca6f[_0x122b('0x4e')]||![],'penalty':_0x4697ee[_0x5799a2][_0x122b('0x57')]||0x0}));}return BPromise['all'](_0x4d194a);}}}})[_0x122b('0x13')](function(){if(_0x75ca6f){return db[_0x122b('0x31')]['findAll']({'where':{'membername':_0x75ca6f[_0x122b('0x2d')],'exitAt':null}});}})[_0x122b('0x13')](function(_0x5b214b){if(_0x75ca6f){if(_0x5b214b&&_0x5b214b[_0x122b('0x33')]){var _0x3e65f6=[];_0x5b214b['forEach'](function(_0x439dee){_0x3e65f6['push'](_0x439dee[_0x122b('0x30')]({'exitAt':moment()['format'](_0x122b('0x44'))}));});return BPromise[_0x122b('0x49')](_0x3e65f6);}}})[_0x122b('0x13')](function(_0x36e371){if(_0x75ca6f){var _0x432286=[];var _0x57082b=[];var _0x2b62ee=utils[_0x122b('0x36')]();var _0x18f9af={'membername':_0x75ca6f[_0x122b('0x2d')],'interface':_0x23d8be,'enterAt':moment()[_0x122b('0x34')](_0x122b('0x44')),'role':_0x75ca6f['role'],'internal':_0x75ca6f[_0x122b('0x2e')]};_0x2b62ee[_0x122b('0x37')](function(_0x25114e){_0x432286[_0x122b('0x38')](_[_0x122b('0x58')]({'channel':_0x25114e,'type':_0x122b('0x59'),'data1':'callysquare','data2':_0x23d8be},_0x18f9af));if(_0x75ca6f[_0x122b('0x4e')]){_0x57082b[_0x122b('0x38')](_[_0x122b('0x58')]({'channel':_0x25114e,'type':_0x122b('0x32'),'data1':_0x122b('0x5a')},_0x18f9af));}});return db[_0x122b('0x31')][_0x122b('0x3d')](_0x432286[_0x122b('0x5b')](_0x57082b),{'individualHooks':!![]});}})[_0x122b('0x13')](function(){if(_0x75ca6f){return _0x75ca6f['update']({'online':!![],'lastLoginAt':moment()[_0x122b('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x75ca6f[_0x122b('0x4e')]||![],'mailPause':_0x75ca6f[_0x122b('0x4e')]||![],'chatPause':_0x75ca6f[_0x122b('0x4e')]||![],'faxPause':_0x75ca6f[_0x122b('0x4e')]||![],'smsPause':_0x75ca6f['loginInPause']||![],'openchannelPause':_0x75ca6f[_0x122b('0x4e')]||![],'pauseType':_0x75ca6f[_0x122b('0x4e')]?_0x122b('0x5a'):null,'lastPauseAt':moment()[_0x122b('0x34')](_0x122b('0x44')),'interface':_0x23d8be});}})[_0x122b('0x13')](function(_0x25ac29){_0x1301b0(_0x25ac29);})[_0x122b('0x1e')](function(_0x2e2fec){_0x3770e2(_0x2fe013[_0x122b('0x1b')](0x1f4,_0x2e2fec['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 76d3344..3c4aa45 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 _0x74ad=['user:','./user.events','save','update','emit','removeListener','register','length'];(function(_0x1e5ef0,_0x2e9907){var _0x498783=function(_0x129236){while(--_0x129236){_0x1e5ef0['push'](_0x1e5ef0['shift']());}};_0x498783(++_0x2e9907);}(_0x74ad,0x119));var _0xd74a=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x74ad[_0xf16b1];return _0x26f94d;};'use strict';var UserEvents=require(_0xd74a('0x0'));var events=[_0xd74a('0x1'),'remove',_0xd74a('0x2')];function createListener(_0x424435,_0x518c7c){return function(_0x407484){_0x518c7c[_0xd74a('0x3')](_0x424435,_0x407484);};}function removeListener(_0x387832,_0x4c12fe){return function(){UserEvents[_0xd74a('0x4')](_0x387832,_0x4c12fe);};}exports[_0xd74a('0x5')]=function(_0x3c7399){for(var _0x4af1cf=0x0,_0x30910d=events[_0xd74a('0x6')];_0x4af1cf<_0x30910d;_0x4af1cf++){var _0x2776e6=events[_0x4af1cf];var _0x603227=createListener(_0xd74a('0x7')+_0x2776e6,_0x3c7399);UserEvents['on'](_0x2776e6,_0x603227);}}; \ No newline at end of file +var _0x7c57=['./user.events','save','remove','update','register'];(function(_0x4da192,_0x4c252b){var _0x26f4c8=function(_0x13c481){while(--_0x13c481){_0x4da192['push'](_0x4da192['shift']());}};_0x26f4c8(++_0x4c252b);}(_0x7c57,0xd7));var _0x77c5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7c57[_0x3dd15e];return _0x231fd0;};'use strict';var UserEvents=require(_0x77c5('0x0'));var events=[_0x77c5('0x1'),_0x77c5('0x2'),_0x77c5('0x3')];function createListener(_0xd7ece0,_0x22b552){return function(_0x154a31){_0x22b552['emit'](_0xd7ece0,_0x154a31);};}function removeListener(_0x4b298,_0x49045e){return function(){UserEvents['removeListener'](_0x4b298,_0x49045e);};}exports[_0x77c5('0x4')]=function(_0x793019){for(var _0x30999e=0x0,_0x574842=events['length'];_0x30999e<_0x574842;_0x30999e++){var _0xd3ff9d=events[_0x30999e];var _0x1eef47=createListener('user:'+_0xd3ff9d,_0x793019);UserEvents['on'](_0xd3ff9d,_0x1eef47);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index b035ed7..9b41345 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 _0xe88c=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x17d8de,_0x3234f9){var _0x3337ef=function(_0x2dcbcc){while(--_0x2dcbcc){_0x17d8de['push'](_0x17d8de['shift']());}};_0x3337ef(++_0x3234f9);}(_0xe88c,0x150));var _0xce88=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0xe88c[_0x2df1f2];return _0x38652b;};'use strict';var multer=require(_0xce88('0x0'));var util=require(_0xce88('0x1'));var path=require(_0xce88('0x2'));var timeout=require('connect-timeout');var express=require(_0xce88('0x3'));var router=express[_0xce88('0x4')]();var auth=require(_0xce88('0x5'));var interaction=require(_0xce88('0x6'));var config=require(_0xce88('0x7'));module[_0xce88('0x8')]=router; \ No newline at end of file +var _0x61d7=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','util','path'];(function(_0xc34e0a,_0x2f7d48){var _0x53b985=function(_0x586fd3){while(--_0x586fd3){_0xc34e0a['push'](_0xc34e0a['shift']());}};_0x53b985(++_0x2f7d48);}(_0x61d7,0x11d));var _0x761d=function(_0x8ea003,_0x15227a){_0x8ea003=_0x8ea003-0x0;var _0x3c82cf=_0x61d7[_0x8ea003];return _0x3c82cf;};'use strict';var multer=require('multer');var util=require(_0x761d('0x0'));var path=require(_0x761d('0x1'));var timeout=require(_0x761d('0x2'));var express=require(_0x761d('0x3'));var router=express['Router']();var auth=require(_0x761d('0x4'));var interaction=require(_0x761d('0x5'));var config=require(_0x761d('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 362b5f9..7963564 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x267dbc,_0x54bb35){var _0x214d8b=function(_0x420a61){while(--_0x420a61){_0x267dbc['push'](_0x267dbc['shift']());}};_0x214d8b(++_0x54bb35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x6aef63,_0x5af004){var _0x3f3c73=function(_0x44602f){while(--_0x44602f){_0x6aef63['push'](_0x6aef63['shift']());}};_0x3f3c73(++_0x5af004);}(_0xe706,0xa3));var _0x6e70=function(_0x48a73e,_0x39f1ac){_0x48a73e=_0x48a73e-0x0;var _0x390c0b=_0xe706[_0x48a73e];return _0x390c0b;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 7cf928a..b5d65cf 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 _0x18d4=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x18d4,0x19e));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x418d('0x0'));var util=require(_0x418d('0x1'));var logger=require(_0x418d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x418d('0x3'));var rp=require(_0x418d('0x4'));var fs=require('fs');var path=require(_0x418d('0x5'));var rimraf=require(_0x418d('0x6'));var config=require(_0x418d('0x7'));var attributes=require(_0x418d('0x8'));module[_0x418d('0x9')]=function(_0x2c0785,_0x27e1c0){return _0x2c0785[_0x418d('0xa')](_0x418d('0xb'),attributes,{'tableName':_0x418d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2752=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','lodash'];(function(_0x1539d5,_0x4375ac){var _0x1b1d51=function(_0x2cc7cf){while(--_0x2cc7cf){_0x1539d5['push'](_0x1539d5['shift']());}};_0x1b1d51(++_0x4375ac);}(_0x2752,0x12b));var _0x2275=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2752[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2275('0x0'));var util=require('util');var logger=require(_0x2275('0x1'))('api');var moment=require(_0x2275('0x2'));var BPromise=require(_0x2275('0x3'));var rp=require(_0x2275('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2275('0x5'));var config=require(_0x2275('0x6'));var attributes=require(_0x2275('0x7'));module[_0x2275('0x8')]=function(_0x19249d,_0x3bc1b9){return _0x19249d['define'](_0x2275('0x9'),attributes,{'tableName':'user_has_chat_queues','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 dd52472..8effc8e 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 _0xc14f=['error','code','UserChatQueue,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xc14f,0x99));var _0xfc14=function(_0x174edf,_0x1ef926){_0x174edf=_0x174edf-0x0;var _0x3e8b03=_0xc14f[_0x174edf];return _0x3e8b03;};'use strict';var _=require(_0xfc14('0x0'));var util=require(_0xfc14('0x1'));var moment=require('moment');var BPromise=require(_0xfc14('0x2'));var rs=require(_0xfc14('0x3'));var fs=require('fs');var Redis=require(_0xfc14('0x4'));var db=require(_0xfc14('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfc14('0x6'));var config=require(_0xfc14('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19848f,_0x12c7c4,_0x4bab91){return new BPromise(function(_0x5bb459,_0x1245df){return client[_0xfc14('0x9')](_0x19848f,_0x4bab91)[_0xfc14('0xa')](function(_0x153921){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x12c7c4,_0xfc14('0xb'));logger[_0xfc14('0xc')](_0xfc14('0xd'),_0x12c7c4,_0xfc14('0xb'),JSON[_0xfc14('0xe')](_0x153921));if(_0x153921[_0xfc14('0xf')]){if(_0x153921[_0xfc14('0xf')][_0xfc14('0x10')]===0x1f4){logger[_0xfc14('0xf')](_0xfc14('0x11'),_0x12c7c4,_0x153921['error'][_0xfc14('0x12')]);return _0x1245df(_0x153921['error'][_0xfc14('0x12')]);}logger[_0xfc14('0xf')](_0xfc14('0x11'),_0x12c7c4,_0x153921[_0xfc14('0xf')][_0xfc14('0x12')]);return _0x5bb459(_0x153921[_0xfc14('0xf')][_0xfc14('0x12')]);}else{logger[_0xfc14('0x13')](_0xfc14('0x11'),_0x12c7c4,_0xfc14('0xb'));_0x5bb459(_0x153921[_0xfc14('0x14')][_0xfc14('0x12')]);}})['catch'](function(_0x7032e2){logger[_0xfc14('0xf')](_0xfc14('0x11'),_0x12c7c4,_0x7032e2);_0x1245df(_0x7032e2);});});} \ No newline at end of file +var _0x6a50=['info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','UserChatQueue,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0x1a44bc,_0xfc81f2){var _0x3b8460=function(_0x5f33d9){while(--_0x5f33d9){_0x1a44bc['push'](_0x1a44bc['shift']());}};_0x3b8460(++_0xfc81f2);}(_0x6a50,0x66));var _0x06a5=function(_0x2b5513,_0x3fe5cd){_0x2b5513=_0x2b5513-0x0;var _0x578fd2=_0x6a50[_0x2b5513];return _0x578fd2;};'use strict';var _=require(_0x06a5('0x0'));var util=require(_0x06a5('0x1'));var moment=require(_0x06a5('0x2'));var BPromise=require(_0x06a5('0x3'));var rs=require(_0x06a5('0x4'));var fs=require('fs');var Redis=require(_0x06a5('0x5'));var db=require(_0x06a5('0x6'))['db'];var utils=require(_0x06a5('0x7'));var logger=require(_0x06a5('0x8'))(_0x06a5('0x9'));var config=require(_0x06a5('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x06a5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x379754,_0x52afbe,_0x32f968){return new BPromise(function(_0x2045ce,_0x3083d9){return client[_0x06a5('0xc')](_0x379754,_0x32f968)['then'](function(_0x23f475){logger[_0x06a5('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x52afbe,'request\x20sent');logger[_0x06a5('0xe')](_0x06a5('0xf'),_0x52afbe,_0x06a5('0x10'),JSON[_0x06a5('0x11')](_0x23f475));if(_0x23f475[_0x06a5('0x12')]){if(_0x23f475['error'][_0x06a5('0x13')]===0x1f4){logger[_0x06a5('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x52afbe,_0x23f475[_0x06a5('0x12')][_0x06a5('0x14')]);return _0x3083d9(_0x23f475['error'][_0x06a5('0x14')]);}logger[_0x06a5('0x12')](_0x06a5('0x15'),_0x52afbe,_0x23f475[_0x06a5('0x12')][_0x06a5('0x14')]);return _0x2045ce(_0x23f475[_0x06a5('0x12')]['message']);}else{logger[_0x06a5('0xd')](_0x06a5('0x15'),_0x52afbe,_0x06a5('0x10'));_0x2045ce(_0x23f475[_0x06a5('0x16')]['message']);}})['catch'](function(_0x4eaa05){logger[_0x06a5('0x12')]('UserChatQueue,\x20%s,\x20%s',_0x52afbe,_0x4eaa05);_0x3083d9(_0x4eaa05);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index b2f99a7..e6a3c95 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 _0x5c2e=['express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','connect-timeout'];(function(_0x99430b,_0x1ee60b){var _0x1865b2=function(_0x49aa91){while(--_0x49aa91){_0x99430b['push'](_0x99430b['shift']());}};_0x1865b2(++_0x1ee60b);}(_0x5c2e,0x13d));var _0xe5c2=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x5c2e[_0x91d019];return _0x19de1f;};'use strict';var multer=require(_0xe5c2('0x0'));var util=require(_0xe5c2('0x1'));var path=require('path');var timeout=require(_0xe5c2('0x2'));var express=require(_0xe5c2('0x3'));var router=express[_0xe5c2('0x4')]();var auth=require(_0xe5c2('0x5'));var interaction=require(_0xe5c2('0x6'));var config=require('../../config/environment');module[_0xe5c2('0x7')]=router; \ No newline at end of file +var _0x598d=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x7395d6,_0xa8e0d2){var _0x256e2c=function(_0x4e798e){while(--_0x4e798e){_0x7395d6['push'](_0x7395d6['shift']());}};_0x256e2c(++_0xa8e0d2);}(_0x598d,0x150));var _0xd598=function(_0x117b58,_0x272539){_0x117b58=_0x117b58-0x0;var _0x438370=_0x598d[_0x117b58];return _0x438370;};'use strict';var multer=require(_0xd598('0x0'));var util=require(_0xd598('0x1'));var path=require(_0xd598('0x2'));var timeout=require('connect-timeout');var express=require(_0xd598('0x3'));var router=express[_0xd598('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd598('0x5'));var config=require(_0xd598('0x6'));module[_0xd598('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 a17965d..56521b1 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 _0x0abf=['sequelize','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0abf[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0b0e=['STRING','sequelize','INTEGER'];(function(_0x40ed9f,_0x36017b){var _0xdc1c56=function(_0x238e71){while(--_0x238e71){_0x40ed9f['push'](_0x40ed9f['shift']());}};_0xdc1c56(++_0x36017b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x7e3bb8,_0x27c048){_0x7e3bb8=_0x7e3bb8-0x0;var _0x44c887=_0x0b0e[_0x7e3bb8];return _0x44c887;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xe0b0('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xe0b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index eec429a..515e473 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 _0x843e=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x1f4a62,_0x24192a){var _0x2a9fe7=function(_0x2c8e09){while(--_0x2c8e09){_0x1f4a62['push'](_0x1f4a62['shift']());}};_0x2a9fe7(++_0x24192a);}(_0x843e,0xcd));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe843('0x0'));var util=require(_0xe843('0x1'));var logger=require(_0xe843('0x2'))(_0xe843('0x3'));var moment=require('moment');var BPromise=require(_0xe843('0x4'));var rp=require(_0xe843('0x5'));var fs=require('fs');var path=require(_0xe843('0x6'));var rimraf=require(_0xe843('0x7'));var config=require(_0xe843('0x8'));var attributes=require(_0xe843('0x9'));module[_0xe843('0xa')]=function(_0x4dcba9,_0x3fdf63){return _0x4dcba9[_0xe843('0xb')]('UserFaxQueue',attributes,{'tableName':_0xe843('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x952b=['../../config/logger','api','bluebird','../../config/environment','./userFaxQueue.attributes','define','lodash'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0x952b,0x99));var _0xb952=function(_0x468493,_0x475605){_0x468493=_0x468493-0x0;var _0x4164dd=_0x952b[_0x468493];return _0x4164dd;};'use strict';var _=require(_0xb952('0x0'));var util=require('util');var logger=require(_0xb952('0x1'))(_0xb952('0x2'));var moment=require('moment');var BPromise=require(_0xb952('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb952('0x4'));var attributes=require(_0xb952('0x5'));module['exports']=function(_0x4173dd,_0x40737a){return _0x4173dd[_0xb952('0x6')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index ff29431..6a45305 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 _0xe98c=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24f7f9,_0x27ee1d){var _0x102c5b=function(_0x257781){while(--_0x257781){_0x24f7f9['push'](_0x24f7f9['shift']());}};_0x102c5b(++_0x27ee1d);}(_0xe98c,0xd3));var _0xce98=function(_0x28031b,_0x2dff75){_0x28031b=_0x28031b-0x0;var _0x20913d=_0xe98c[_0x28031b];return _0x20913d;};'use strict';var _=require(_0xce98('0x0'));var util=require(_0xce98('0x1'));var moment=require(_0xce98('0x2'));var BPromise=require(_0xce98('0x3'));var rs=require(_0xce98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce98('0x5'))['db'];var utils=require(_0xce98('0x6'));var logger=require(_0xce98('0x7'))(_0xce98('0x8'));var config=require(_0xce98('0x9'));var jayson=require(_0xce98('0xa'));var client=jayson[_0xce98('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9c5d9c,_0x3c6aaf,_0x203c84){return new BPromise(function(_0x5987b5,_0x114231){return client['request'](_0x9c5d9c,_0x203c84)[_0xce98('0xc')](function(_0x494dd1){logger[_0xce98('0xd')](_0xce98('0xe'),_0x3c6aaf,_0xce98('0xf'));logger['debug'](_0xce98('0x10'),_0x3c6aaf,_0xce98('0xf'),JSON[_0xce98('0x11')](_0x494dd1));if(_0x494dd1['error']){if(_0x494dd1[_0xce98('0x12')][_0xce98('0x13')]===0x1f4){logger[_0xce98('0x12')](_0xce98('0xe'),_0x3c6aaf,_0x494dd1[_0xce98('0x12')][_0xce98('0x14')]);return _0x114231(_0x494dd1['error']['message']);}logger[_0xce98('0x12')](_0xce98('0xe'),_0x3c6aaf,_0x494dd1['error'][_0xce98('0x14')]);return _0x5987b5(_0x494dd1['error'][_0xce98('0x14')]);}else{logger[_0xce98('0xd')](_0xce98('0xe'),_0x3c6aaf,_0xce98('0xf'));_0x5987b5(_0x494dd1[_0xce98('0x15')][_0xce98('0x14')]);}})[_0xce98('0x16')](function(_0x1944e2){logger[_0xce98('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x3c6aaf,_0x1944e2);_0x114231(_0x1944e2);});});} \ No newline at end of file +var _0x0c45=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5d3267,_0xe106a8){var _0x57dba1=function(_0x22d379){while(--_0x22d379){_0x5d3267['push'](_0x5d3267['shift']());}};_0x57dba1(++_0xe106a8);}(_0x0c45,0x1ec));var _0x50c4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c45[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x50c4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x50c4('0x1'));var rs=require(_0x50c4('0x2'));var fs=require('fs');var Redis=require(_0x50c4('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x50c4('0x4'));var config=require(_0x50c4('0x5'));var jayson=require(_0x50c4('0x6'));var client=jayson[_0x50c4('0x7')][_0x50c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x312155,_0x4e5f2a,_0x2433ed){return new BPromise(function(_0x4d2bba,_0x16b206){return client[_0x50c4('0x9')](_0x312155,_0x2433ed)[_0x50c4('0xa')](function(_0x551c86){logger[_0x50c4('0xb')](_0x50c4('0xc'),_0x4e5f2a,_0x50c4('0xd'));logger[_0x50c4('0xe')](_0x50c4('0xf'),_0x4e5f2a,_0x50c4('0xd'),JSON[_0x50c4('0x10')](_0x551c86));if(_0x551c86[_0x50c4('0x11')]){if(_0x551c86[_0x50c4('0x11')]['code']===0x1f4){logger[_0x50c4('0x11')](_0x50c4('0xc'),_0x4e5f2a,_0x551c86[_0x50c4('0x11')]['message']);return _0x16b206(_0x551c86[_0x50c4('0x11')][_0x50c4('0x12')]);}logger['error'](_0x50c4('0xc'),_0x4e5f2a,_0x551c86[_0x50c4('0x11')][_0x50c4('0x12')]);return _0x4d2bba(_0x551c86[_0x50c4('0x11')][_0x50c4('0x12')]);}else{logger[_0x50c4('0xb')](_0x50c4('0xc'),_0x4e5f2a,_0x50c4('0xd'));_0x4d2bba(_0x551c86[_0x50c4('0x13')]['message']);}})[_0x50c4('0x14')](function(_0x3098ce){logger[_0x50c4('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x4e5f2a,_0x3098ce);_0x16b206(_0x3098ce);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 3b0d15c..4eff1c6 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 _0x85f6=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path'];(function(_0x1f3ace,_0x45fc8d){var _0x24cbb2=function(_0x1b4118){while(--_0x1b4118){_0x1f3ace['push'](_0x1f3ace['shift']());}};_0x24cbb2(++_0x45fc8d);}(_0x85f6,0x1ad));var _0x685f=function(_0x24b636,_0x390351){_0x24b636=_0x24b636-0x0;var _0x96fd48=_0x85f6[_0x24b636];return _0x96fd48;};'use strict';var multer=require(_0x685f('0x0'));var util=require(_0x685f('0x1'));var path=require(_0x685f('0x2'));var timeout=require(_0x685f('0x3'));var express=require(_0x685f('0x4'));var router=express[_0x685f('0x5')]();var auth=require(_0x685f('0x6'));var interaction=require(_0x685f('0x7'));var config=require('../../config/environment');module[_0x685f('0x8')]=router; \ No newline at end of file +var _0x4002=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4002,0x109));var _0x2400=function(_0x1c79de,_0x2530c4){_0x1c79de=_0x1c79de-0x0;var _0x57a46f=_0x4002[_0x1c79de];return _0x57a46f;};'use strict';var multer=require(_0x2400('0x0'));var util=require(_0x2400('0x1'));var path=require(_0x2400('0x2'));var timeout=require(_0x2400('0x3'));var express=require(_0x2400('0x4'));var router=express['Router']();var auth=require(_0x2400('0x5'));var interaction=require(_0x2400('0x6'));var config=require(_0x2400('0x7'));module[_0x2400('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 18c7bdb..7f3baf7 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x39e60f,_0x4a0dc9){var _0x108208=function(_0x5504bc){while(--_0x5504bc){_0x39e60f['push'](_0x39e60f['shift']());}};_0x108208(++_0x4a0dc9);}(_0xe706,0xa3));var _0x6e70=function(_0x58feb8,_0x599bd4){_0x58feb8=_0x58feb8-0x0;var _0x5754dd=_0xe706[_0x58feb8];return _0x5754dd;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x14c0d6,_0x2eed9e){var _0x25d613=function(_0x52f926){while(--_0x52f926){_0x14c0d6['push'](_0x14c0d6['shift']());}};_0x25d613(++_0x2eed9e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('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 93fe9bb..a4bb884 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 _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4434e2,_0x532747){var _0x50304a=function(_0x40f048){while(--_0x40f048){_0x4434e2['push'](_0x4434e2['shift']());}};_0x50304a(++_0x532747);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['define','user_has_mail_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x284bc3,_0x22dffe){var _0x41ac81=function(_0x47031f){while(--_0x47031f){_0x284bc3['push'](_0x284bc3['shift']());}};_0x41ac81(++_0x22dffe);}(_0x757a,0xde));var _0xa757=function(_0x43f1f1,_0x1209dd){_0x43f1f1=_0x43f1f1-0x0;var _0x411509=_0x757a[_0x43f1f1];return _0x411509;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('UserMailQueue',attributes,{'tableName':_0xa757('0x9'),'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 d09672e..77bfd9d 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 _0xda42=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x53e55c,_0x40898b){var _0x451802=function(_0x83076b){while(--_0x83076b){_0x53e55c['push'](_0x53e55c['shift']());}};_0x451802(++_0x40898b);}(_0xda42,0x1bd));var _0x2da4=function(_0x396d6c,_0x29635e){_0x396d6c=_0x396d6c-0x0;var _0x107666=_0xda42[_0x396d6c];return _0x107666;};'use strict';var _=require(_0x2da4('0x0'));var util=require(_0x2da4('0x1'));var moment=require(_0x2da4('0x2'));var BPromise=require(_0x2da4('0x3'));var rs=require(_0x2da4('0x4'));var fs=require('fs');var Redis=require(_0x2da4('0x5'));var db=require(_0x2da4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2da4('0x7'))('rpc');var config=require(_0x2da4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x295468,_0x3e8602,_0x374354){return new BPromise(function(_0xcf4fc7,_0x30a981){return client[_0x2da4('0x9')](_0x295468,_0x374354)[_0x2da4('0xa')](function(_0x5db1f4){logger['info'](_0x2da4('0xb'),_0x3e8602,_0x2da4('0xc'));logger[_0x2da4('0xd')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x3e8602,_0x2da4('0xc'),JSON[_0x2da4('0xe')](_0x5db1f4));if(_0x5db1f4[_0x2da4('0xf')]){if(_0x5db1f4[_0x2da4('0xf')][_0x2da4('0x10')]===0x1f4){logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5db1f4['error'][_0x2da4('0x11')]);return _0x30a981(_0x5db1f4[_0x2da4('0xf')]['message']);}logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5db1f4[_0x2da4('0xf')]['message']);return _0xcf4fc7(_0x5db1f4[_0x2da4('0xf')][_0x2da4('0x11')]);}else{logger[_0x2da4('0x12')](_0x2da4('0xb'),_0x3e8602,'request\x20sent');_0xcf4fc7(_0x5db1f4['result'][_0x2da4('0x11')]);}})[_0x2da4('0x13')](function(_0x5e5338){logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5e5338);_0x30a981(_0x5e5338);});});} \ No newline at end of file +var _0xe49a=['UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','UserMailQueue,\x20%s,\x20%s','debug'];(function(_0x953b57,_0x11dd4e){var _0x258479=function(_0x3dbc3b){while(--_0x3dbc3b){_0x953b57['push'](_0x953b57['shift']());}};_0x258479(++_0x11dd4e);}(_0xe49a,0xd7));var _0xae49=function(_0x9afb29,_0x36c840){_0x9afb29=_0x9afb29-0x0;var _0xf51bba=_0xe49a[_0x9afb29];return _0xf51bba;};'use strict';var _=require('lodash');var util=require(_0xae49('0x0'));var moment=require(_0xae49('0x1'));var BPromise=require(_0xae49('0x2'));var rs=require(_0xae49('0x3'));var fs=require('fs');var Redis=require(_0xae49('0x4'));var db=require(_0xae49('0x5'))['db'];var utils=require(_0xae49('0x6'));var logger=require('../../config/logger')(_0xae49('0x7'));var config=require(_0xae49('0x8'));var jayson=require(_0xae49('0x9'));var client=jayson['client'][_0xae49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49eecf,_0x63a8be,_0x1e33f6){return new BPromise(function(_0x4480bf,_0x476f2a){return client[_0xae49('0xb')](_0x49eecf,_0x1e33f6)[_0xae49('0xc')](function(_0x408685){logger['info'](_0xae49('0xd'),_0x63a8be,'request\x20sent');logger[_0xae49('0xe')](_0xae49('0xf'),_0x63a8be,_0xae49('0x10'),JSON['stringify'](_0x408685));if(_0x408685[_0xae49('0x11')]){if(_0x408685[_0xae49('0x11')][_0xae49('0x12')]===0x1f4){logger[_0xae49('0x11')](_0xae49('0xd'),_0x63a8be,_0x408685[_0xae49('0x11')]['message']);return _0x476f2a(_0x408685['error'][_0xae49('0x13')]);}logger[_0xae49('0x11')](_0xae49('0xd'),_0x63a8be,_0x408685[_0xae49('0x11')][_0xae49('0x13')]);return _0x4480bf(_0x408685[_0xae49('0x11')][_0xae49('0x13')]);}else{logger[_0xae49('0x14')](_0xae49('0xd'),_0x63a8be,_0xae49('0x10'));_0x4480bf(_0x408685[_0xae49('0x15')]['message']);}})[_0xae49('0x16')](function(_0x2d5dcb){logger[_0xae49('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x63a8be,_0x2d5dcb);_0x476f2a(_0x2d5dcb);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index c0b1a91..e5d4c51 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 _0xc524=['../../config/environment','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x24f66d,_0x261e88){var _0x147cdb=function(_0x137ea5){while(--_0x137ea5){_0x24f66d['push'](_0x24f66d['shift']());}};_0x147cdb(++_0x261e88);}(_0xc524,0x140));var _0x4c52=function(_0x5b37ba,_0x398e45){_0x5b37ba=_0x5b37ba-0x0;var _0x26647a=_0xc524[_0x5b37ba];return _0x26647a;};'use strict';var multer=require('multer');var util=require(_0x4c52('0x0'));var path=require('path');var timeout=require(_0x4c52('0x1'));var express=require('express');var router=express[_0x4c52('0x2')]();var auth=require(_0x4c52('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4c52('0x4'));module[_0x4c52('0x5')]=router; \ No newline at end of file +var _0x1329=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router'];(function(_0x57edcf,_0x3d1026){var _0x715351=function(_0x2be67b){while(--_0x2be67b){_0x57edcf['push'](_0x57edcf['shift']());}};_0x715351(++_0x3d1026);}(_0x1329,0x199));var _0x9132=function(_0x39417f,_0x2ac630){_0x39417f=_0x39417f-0x0;var _0x52ec97=_0x1329[_0x39417f];return _0x52ec97;};'use strict';var multer=require(_0x9132('0x0'));var util=require(_0x9132('0x1'));var path=require(_0x9132('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9132('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x9132('0x4'));var config=require(_0x9132('0x5'));module[_0x9132('0x6')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 6b579cf..6ed37fb 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 _0xbaf0=['exports','INTEGER'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4ece94,_0x446e1b){var _0x37d818=function(_0x11a1e2){while(--_0x11a1e2){_0x4ece94['push'](_0x4ece94['shift']());}};_0x37d818(++_0x446e1b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index fbd8e0c..504a581 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 _0x1ffa=['rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2d97d4,_0x5a6dca){var _0x57665e=function(_0x512d9f){while(--_0x512d9f){_0x2d97d4['push'](_0x2d97d4['shift']());}};_0x57665e(++_0x5a6dca);}(_0x1ffa,0x1b3));var _0xa1ff=function(_0x50e53a,_0x585b10){_0x50e53a=_0x50e53a-0x0;var _0x221d4a=_0x1ffa[_0x50e53a];return _0x221d4a;};'use strict';var _=require(_0xa1ff('0x0'));var util=require(_0xa1ff('0x1'));var logger=require('../../config/logger')(_0xa1ff('0x2'));var moment=require(_0xa1ff('0x3'));var BPromise=require(_0xa1ff('0x4'));var rp=require(_0xa1ff('0x5'));var fs=require('fs');var path=require(_0xa1ff('0x6'));var rimraf=require(_0xa1ff('0x7'));var config=require(_0xa1ff('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xa1ff('0x9')]=function(_0xc3e4dd,_0x5e4b24){return _0xc3e4dd[_0xa1ff('0xa')](_0xa1ff('0xb'),attributes,{'tableName':_0xa1ff('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37f2=['exports','user_has_openchannel_queues','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x53056b,_0x28ab36){var _0x1b7612=function(_0x1e2995){while(--_0x1e2995){_0x53056b['push'](_0x53056b['shift']());}};_0x1b7612(++_0x28ab36);}(_0x37f2,0x158));var _0x237f=function(_0x4e061c,_0x5c74d8){_0x4e061c=_0x4e061c-0x0;var _0x4811a0=_0x37f2[_0x4e061c];return _0x4811a0;};'use strict';var _=require(_0x237f('0x0'));var util=require('util');var logger=require(_0x237f('0x1'))('api');var moment=require(_0x237f('0x2'));var BPromise=require('bluebird');var rp=require(_0x237f('0x3'));var fs=require('fs');var path=require(_0x237f('0x4'));var rimraf=require(_0x237f('0x5'));var config=require(_0x237f('0x6'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x237f('0x7')]=function(_0x59e629,_0x5c0439){return _0x59e629['define']('UserOpenchannelQueue',attributes,{'tableName':_0x237f('0x8'),'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 b1b33e5..7f21927 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 _0x4186=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x545cb9,_0x1a4c8f){var _0x168ac5=function(_0xe90ce0){while(--_0xe90ce0){_0x545cb9['push'](_0x545cb9['shift']());}};_0x168ac5(++_0x1a4c8f);}(_0x4186,0x1b6));var _0x6418=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0x4186[_0x7538c5];return _0x8b56be;};'use strict';var _=require(_0x6418('0x0'));var util=require('util');var moment=require(_0x6418('0x1'));var BPromise=require(_0x6418('0x2'));var rs=require(_0x6418('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6418('0x4'))['db'];var utils=require(_0x6418('0x5'));var logger=require('../../config/logger')(_0x6418('0x6'));var config=require(_0x6418('0x7'));var jayson=require(_0x6418('0x8'));var client=jayson[_0x6418('0x9')][_0x6418('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b1bc6,_0x54db96,_0x58322d){return new BPromise(function(_0x1b475a,_0x1a46ec){return client[_0x6418('0xb')](_0x2b1bc6,_0x58322d)[_0x6418('0xc')](function(_0x3e7812){logger[_0x6418('0xd')](_0x6418('0xe'),_0x54db96,_0x6418('0xf'));logger[_0x6418('0x10')](_0x6418('0x11'),_0x54db96,_0x6418('0xf'),JSON[_0x6418('0x12')](_0x3e7812));if(_0x3e7812[_0x6418('0x13')]){if(_0x3e7812[_0x6418('0x13')][_0x6418('0x14')]===0x1f4){logger[_0x6418('0x13')](_0x6418('0xe'),_0x54db96,_0x3e7812[_0x6418('0x13')][_0x6418('0x15')]);return _0x1a46ec(_0x3e7812[_0x6418('0x13')]['message']);}logger[_0x6418('0x13')](_0x6418('0xe'),_0x54db96,_0x3e7812[_0x6418('0x13')][_0x6418('0x15')]);return _0x1b475a(_0x3e7812['error'][_0x6418('0x15')]);}else{logger['info'](_0x6418('0xe'),_0x54db96,'request\x20sent');_0x1b475a(_0x3e7812[_0x6418('0x16')][_0x6418('0x15')]);}})[_0x6418('0x17')](function(_0x15ad98){logger[_0x6418('0x13')](_0x6418('0xe'),_0x54db96,_0x15ad98);_0x1a46ec(_0x15ad98);});});} \ No newline at end of file +var _0x3190=['debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserOpenchannelQueue,\x20%s,\x20%s'];(function(_0x5b7257,_0x3e79ac){var _0x32bc7a=function(_0x1c794d){while(--_0x1c794d){_0x5b7257['push'](_0x5b7257['shift']());}};_0x32bc7a(++_0x3e79ac);}(_0x3190,0x1c1));var _0x0319=function(_0x338506,_0x5b871b){_0x338506=_0x338506-0x0;var _0x45a86f=_0x3190[_0x338506];return _0x45a86f;};'use strict';var _=require(_0x0319('0x0'));var util=require(_0x0319('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0319('0x2'));var fs=require('fs');var Redis=require(_0x0319('0x3'));var db=require(_0x0319('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0319('0x5'))(_0x0319('0x6'));var config=require(_0x0319('0x7'));var jayson=require(_0x0319('0x8'));var client=jayson[_0x0319('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x259088,_0x44f10b,_0x36b716){return new BPromise(function(_0x17a70b,_0x109886){return client['request'](_0x259088,_0x36b716)[_0x0319('0xa')](function(_0x37b2ca){logger[_0x0319('0xb')](_0x0319('0xc'),_0x44f10b,'request\x20sent');logger[_0x0319('0xd')](_0x0319('0xe'),_0x44f10b,_0x0319('0xf'),JSON[_0x0319('0x10')](_0x37b2ca));if(_0x37b2ca['error']){if(_0x37b2ca['error']['code']===0x1f4){logger[_0x0319('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x44f10b,_0x37b2ca['error'][_0x0319('0x12')]);return _0x109886(_0x37b2ca[_0x0319('0x11')][_0x0319('0x12')]);}logger[_0x0319('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x44f10b,_0x37b2ca[_0x0319('0x11')][_0x0319('0x12')]);return _0x17a70b(_0x37b2ca[_0x0319('0x11')][_0x0319('0x12')]);}else{logger['info'](_0x0319('0xc'),_0x44f10b,_0x0319('0xf'));_0x17a70b(_0x37b2ca[_0x0319('0x13')][_0x0319('0x12')]);}})[_0x0319('0x14')](function(_0x4d3c36){logger[_0x0319('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x44f10b,_0x4d3c36);_0x109886(_0x4d3c36);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 81fc8ae..9121307 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 _0x1a31=['express','Router','../../components/auth/service','./userProfile.controller','get','isAuthenticated','describe','show','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put','update','delete','/:id','removeResources','exports','util','connect-timeout'];(function(_0x111579,_0x40e407){var _0x2ed083=function(_0x3a57b4){while(--_0x3a57b4){_0x111579['push'](_0x111579['shift']());}};_0x2ed083(++_0x40e407);}(_0x1a31,0xe8));var _0x11a3=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x1a31[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x11a3('0x0'));var path=require('path');var timeout=require(_0x11a3('0x1'));var express=require(_0x11a3('0x2'));var router=express[_0x11a3('0x3')]();var auth=require(_0x11a3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x11a3('0x5'));router[_0x11a3('0x6')]('/',auth[_0x11a3('0x7')](),controller['index']);router[_0x11a3('0x6')]('/describe',auth[_0x11a3('0x7')](),controller[_0x11a3('0x8')]);router[_0x11a3('0x6')]('/:id',auth[_0x11a3('0x7')](),controller[_0x11a3('0x9')]);router[_0x11a3('0x6')](_0x11a3('0xa'),auth[_0x11a3('0x7')](),controller[_0x11a3('0xb')]);router[_0x11a3('0x6')]('/:id/resources',auth[_0x11a3('0x7')](),controller[_0x11a3('0xc')]);router[_0x11a3('0xd')]('/',auth[_0x11a3('0x7')](),controller[_0x11a3('0xe')]);router[_0x11a3('0xd')](_0x11a3('0xf'),auth[_0x11a3('0x7')](),controller[_0x11a3('0x10')]);router[_0x11a3('0xd')]('/:id/sections',auth[_0x11a3('0x7')](),controller[_0x11a3('0x11')]);router[_0x11a3('0xd')](_0x11a3('0x12'),auth['isAuthenticated'](),controller[_0x11a3('0x13')]);router[_0x11a3('0x14')]('/:id',auth[_0x11a3('0x7')](),controller[_0x11a3('0x15')]);router[_0x11a3('0x16')](_0x11a3('0x17'),auth[_0x11a3('0x7')](),controller['destroy']);router[_0x11a3('0x16')]('/:id/sections',auth['isAuthenticated'](),controller['removeSections']);router[_0x11a3('0x16')](_0x11a3('0x12'),auth[_0x11a3('0x7')](),controller[_0x11a3('0x18')]);module[_0x11a3('0x19')]=router; \ No newline at end of file +var _0x9048=['clone','addResources','put','/:id','update','delete','destroy','removeSections','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','isAuthenticated','index','get','/describe','describe','/:id/sections','/:id/resources','getResources','post'];(function(_0x5a7458,_0x4ba944){var _0x5928ff=function(_0x5eac5b){while(--_0x5eac5b){_0x5a7458['push'](_0x5a7458['shift']());}};_0x5928ff(++_0x4ba944);}(_0x9048,0xa5));var _0x8904=function(_0x4041e2,_0x530537){_0x4041e2=_0x4041e2-0x0;var _0x90b20c=_0x9048[_0x4041e2];return _0x90b20c;};'use strict';var multer=require('multer');var util=require(_0x8904('0x0'));var path=require(_0x8904('0x1'));var timeout=require(_0x8904('0x2'));var express=require(_0x8904('0x3'));var router=express['Router']();var auth=require(_0x8904('0x4'));var interaction=require(_0x8904('0x5'));var config=require(_0x8904('0x6'));var controller=require(_0x8904('0x7'));router['get']('/',auth[_0x8904('0x8')](),controller[_0x8904('0x9')]);router[_0x8904('0xa')](_0x8904('0xb'),auth['isAuthenticated'](),controller[_0x8904('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x8904('0xd'),auth[_0x8904('0x8')](),controller['getSections']);router[_0x8904('0xa')](_0x8904('0xe'),auth['isAuthenticated'](),controller[_0x8904('0xf')]);router[_0x8904('0x10')]('/',auth[_0x8904('0x8')](),controller['create']);router['post']('/:id/clone',auth[_0x8904('0x8')](),controller[_0x8904('0x11')]);router['post'](_0x8904('0xd'),auth[_0x8904('0x8')](),controller['addSections']);router['post'](_0x8904('0xe'),auth[_0x8904('0x8')](),controller[_0x8904('0x12')]);router[_0x8904('0x13')](_0x8904('0x14'),auth[_0x8904('0x8')](),controller[_0x8904('0x15')]);router[_0x8904('0x16')](_0x8904('0x14'),auth[_0x8904('0x8')](),controller[_0x8904('0x17')]);router[_0x8904('0x16')](_0x8904('0xd'),auth[_0x8904('0x8')](),controller[_0x8904('0x18')]);router['delete'](_0x8904('0xe'),auth[_0x8904('0x8')](),controller['removeResources']);module[_0x8904('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ea1c52e..a1ca3b7 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 _0xa953=['sequelize','exports','STRING','name','setDataValue','crudPermissions','getDataValue','split'];(function(_0x154bd6,_0x3413ad){var _0x454637=function(_0x18cf9a){while(--_0x18cf9a){_0x154bd6['push'](_0x154bd6['shift']());}};_0x454637(++_0x3413ad);}(_0xa953,0x1d0));var _0x3a95=function(_0x2540db,_0x9b7318){_0x2540db=_0x2540db-0x0;var _0xbf6e9f=_0xa953[_0x2540db];return _0xbf6e9f;};'use strict';var Sequelize=require(_0x3a95('0x0'));module[_0x3a95('0x1')]={'name':{'type':Sequelize[_0x3a95('0x2')],'allowNull':![],'unique':_0x3a95('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x498fea){this[_0x3a95('0x4')](_0x3a95('0x5'),_0x498fea?_0x498fea['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x3a95('0x6')](_0x3a95('0x5'))[_0x3a95('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x3a95('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x6691=['setDataValue','crudPermissions','getDataValue','split','sequelize','exports','STRING','name'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x6691,0x134));var _0x1669=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6691[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require(_0x1669('0x0'));module[_0x1669('0x1')]={'name':{'type':Sequelize[_0x1669('0x2')],'allowNull':![],'unique':_0x1669('0x3')},'crudPermissions':{'type':Sequelize[_0x1669('0x2')],'set':function(_0x26106c){this[_0x1669('0x4')](_0x1669('0x5'),_0x26106c?_0x26106c['join'](''):[]);},'get':function(){return this[_0x1669('0x6')](_0x1669('0x5'))?this[_0x1669('0x6')](_0x1669('0x5'))[_0x1669('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x1669('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 9b68672..fd0fa7b 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 _0x35f4=['Pause','tags','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','extractedreports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','rawAttributes','fieldName','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','catch','params','keys','create','body','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','addSections','push','getSections','enabled','isEmpty','subsections','includes','some','findOne','forEach','resourceId','Plugin','addResources','sequelize','bulkCreate','removeResources','ids','getResources','section','undefined','Unknown\x20section','mergeResources','childModel','Sequelize','ValidationError','Invalid\x20section\x20\x27','parentSections','length','all','filter','ignore','pick','type','field','foreignKey','associatedResources','reportType','reportId','custom','CmContact','Tag','Tags','color','tag','ThroughTags','value','AnalyticExtractedReport','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','lists','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','User','role','Telephones','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','queuecampaigns','users','agents','telephones','Users','admin','Agents','zendeskaccounts','ZendeskAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','intervals','pauses'];(function(_0x213d56,_0x7e25ab){var _0x373a41=function(_0x5b415f){while(--_0x5b415f){_0x213d56['push'](_0x213d56['shift']());}};_0x373a41(++_0x7e25ab);}(_0x35f4,0xf2));var _0x435f=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0x35f4[_0x59710f];return _0xaae66a;};'use strict';var pdf=require(_0x435f('0x0'));var emlformat=require(_0x435f('0x1'));var rimraf=require(_0x435f('0x2'));var zipdir=require(_0x435f('0x3'));var jsonpatch=require(_0x435f('0x4'));var rp=require(_0x435f('0x5'));var moment=require(_0x435f('0x6'));var BPromise=require(_0x435f('0x7'));var Mustache=require(_0x435f('0x8'));var util=require(_0x435f('0x9'));var path=require(_0x435f('0xa'));var sox=require('sox');var csv=require(_0x435f('0xb'));var ejs=require(_0x435f('0xc'));var fs=require('fs');var _=require(_0x435f('0xd'));var squel=require(_0x435f('0xe'));var crypto=require(_0x435f('0xf'));var jsforce=require(_0x435f('0x10'));var deskjs=require(_0x435f('0x11'));var toCsv=require(_0x435f('0xb'));var querystring=require(_0x435f('0x12'));var Papa=require(_0x435f('0x13'));var Redis=require(_0x435f('0x14'));var authService=require(_0x435f('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x435f('0x16'));var hardwareService=require(_0x435f('0x17'));var logger=require(_0x435f('0x18'))(_0x435f('0x19'));var utils=require(_0x435f('0x1a'));var config=require(_0x435f('0x1b'));var db=require(_0x435f('0x1c'))['db'];config[_0x435f('0x1d')]=_['defaults'](config['redis'],{'host':_0x435f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x435f('0x1f'))['register'](socket);function respondWithStatusCode(_0x4762e9,_0x1f780d){_0x1f780d=_0x1f780d||0xcc;return function(_0x29f13c){if(_0x29f13c){return _0x4762e9[_0x435f('0x20')](_0x1f780d);}return _0x4762e9['status'](_0x1f780d)['end']();};}function respondWithResult(_0x1b708d,_0x4bf798){_0x4bf798=_0x4bf798||0xc8;return function(_0x551de9){if(_0x551de9){return _0x1b708d[_0x435f('0x21')](_0x4bf798)[_0x435f('0x22')](_0x551de9);}};}function respondWithFilteredResult(_0x2057e0,_0x27b135){return function(_0x469a28){if(_0x469a28){var _0x17c7a1=_0x469a28[_0x435f('0x23')],_0x3c631c=_0x27b135[_0x435f('0x24')],_0x415b78=_0x27b135['offset']+_0x27b135[_0x435f('0x25')],_0x41b982;if(_0x415b78>=_0x17c7a1){_0x415b78=_0x17c7a1;_0x41b982=0xc8;}else{_0x41b982=0xce;}_0x2057e0[_0x435f('0x21')](_0x41b982);return _0x2057e0[_0x435f('0x26')](_0x435f('0x27'),_0x3c631c+'-'+_0x415b78+'/'+_0x17c7a1)[_0x435f('0x22')](_0x469a28);}return null;};}function patchUpdates(_0x263bbf){return function(_0x596972){try{jsonpatch[_0x435f('0x28')](_0x596972,_0x263bbf,!![]);}catch(_0x1bfaae){return BPromise[_0x435f('0x29')](_0x1bfaae);}return _0x596972[_0x435f('0x2a')]();};}function saveUpdates(_0x3e8285,_0x27af64){return function(_0x1d69b3){if(_0x1d69b3){return _0x1d69b3[_0x435f('0x2b')](_0x3e8285)['then'](function(_0x2248b1){return _0x2248b1;});}return null;};}function removeEntity(_0x16e64b,_0x39782e){return function(_0x5d0621){if(_0x5d0621){return _0x5d0621['destroy']()[_0x435f('0x2c')](function(){_0x16e64b[_0x435f('0x21')](0xcc)[_0x435f('0x2d')]();});}};}function handleEntityNotFound(_0x334180,_0x192977){return function(_0x6695e7){if(!_0x6695e7){_0x334180['sendStatus'](0x194);}return _0x6695e7;};}function handleError(_0x1556ab,_0x573169){_0x573169=_0x573169||0x1f4;return function(_0xb01017){logger['error'](_0xb01017[_0x435f('0x2e')]);if(_0xb01017[_0x435f('0x2f')]){delete _0xb01017[_0x435f('0x2f')];}_0x1556ab[_0x435f('0x21')](_0x573169)[_0x435f('0x30')](_0xb01017);};}exports['index']=function(_0x40e5d0,_0x3568e8){var _0x2f7b52={},_0x7f7f5f={},_0x3a7ac0={'count':0x0,'rows':[]};var _0xed45e3=_['map'](db['UserProfile'][_0x435f('0x31')],function(_0x5466b8){return{'name':_0x5466b8[_0x435f('0x32')],'type':_0x5466b8['type'][_0x435f('0x33')]};});_0x7f7f5f['model']=_[_0x435f('0x34')](_0xed45e3,_0x435f('0x2f'));_0x7f7f5f['query']=_['keys'](_0x40e5d0[_0x435f('0x35')]);_0x7f7f5f[_0x435f('0x36')]=_[_0x435f('0x37')](_0x7f7f5f[_0x435f('0x38')],_0x7f7f5f[_0x435f('0x35')]);_0x2f7b52['attributes']=_['intersection'](_0x7f7f5f[_0x435f('0x38')],qs['fields'](_0x40e5d0[_0x435f('0x35')][_0x435f('0x39')]));_0x2f7b52[_0x435f('0x3a')]=_0x2f7b52[_0x435f('0x3a')]['length']?_0x2f7b52['attributes']:_0x7f7f5f[_0x435f('0x38')];if(!_0x40e5d0[_0x435f('0x35')][_0x435f('0x3b')](_0x435f('0x3c'))){_0x2f7b52[_0x435f('0x25')]=qs['limit'](_0x40e5d0['query'][_0x435f('0x25')]);_0x2f7b52[_0x435f('0x24')]=qs[_0x435f('0x24')](_0x40e5d0['query'][_0x435f('0x24')]);}_0x2f7b52[_0x435f('0x3d')]=qs[_0x435f('0x3e')](_0x40e5d0[_0x435f('0x35')][_0x435f('0x3e')]);_0x2f7b52[_0x435f('0x3f')]=qs['filters'](_['pick'](_0x40e5d0['query'],_0x7f7f5f[_0x435f('0x36')]));if(_0x40e5d0[_0x435f('0x35')]['filter']){_0x2f7b52['where']=_[_0x435f('0x40')](_0x2f7b52[_0x435f('0x3f')],{'$or':_['map'](_0xed45e3,function(_0x56c243){if(_0x56c243['type']!==_0x435f('0x41')){var _0x213735={};_0x213735[_0x56c243[_0x435f('0x2f')]]={'$like':'%'+_0x40e5d0['query']['filter']+'%'};return _0x213735;}})});}_0x2f7b52=_[_0x435f('0x40')]({},_0x2f7b52,_0x40e5d0[_0x435f('0x42')]);var _0x2482be={'where':_0x2f7b52[_0x435f('0x3f')]};return db[_0x435f('0x43')][_0x435f('0x23')](_0x2482be)[_0x435f('0x2c')](function(_0x192b59){_0x3a7ac0['count']=_0x192b59;if(_0x40e5d0[_0x435f('0x35')][_0x435f('0x44')]){_0x2f7b52[_0x435f('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x435f('0x46')](_0x2f7b52);})['then'](function(_0x97fe05){_0x3a7ac0[_0x435f('0x47')]=_0x97fe05;return _0x3a7ac0;})['then'](respondWithFilteredResult(_0x3568e8,_0x2f7b52))[_0x435f('0x48')](handleError(_0x3568e8,null));};exports['show']=function(_0x26345e,_0x30f13e){var _0x5ccca2={'raw':![],'where':{'id':_0x26345e[_0x435f('0x49')]['id']}},_0x55901c={};_0x55901c[_0x435f('0x38')]=_[_0x435f('0x4a')](db[_0x435f('0x43')][_0x435f('0x31')]);_0x55901c[_0x435f('0x35')]=_[_0x435f('0x4a')](_0x26345e[_0x435f('0x35')]);_0x55901c[_0x435f('0x36')]=_[_0x435f('0x37')](_0x55901c[_0x435f('0x38')],_0x55901c[_0x435f('0x35')]);_0x5ccca2[_0x435f('0x3a')]=_[_0x435f('0x37')](_0x55901c[_0x435f('0x38')],qs[_0x435f('0x39')](_0x26345e[_0x435f('0x35')][_0x435f('0x39')]));_0x5ccca2[_0x435f('0x3a')]=_0x5ccca2['attributes']['length']?_0x5ccca2[_0x435f('0x3a')]:_0x55901c[_0x435f('0x38')];if(_0x26345e[_0x435f('0x35')][_0x435f('0x44')]){_0x5ccca2[_0x435f('0x45')]=[{'all':!![]}];}_0x5ccca2=_[_0x435f('0x40')]({},_0x5ccca2,_0x26345e[_0x435f('0x42')]);return db[_0x435f('0x43')]['find'](_0x5ccca2)[_0x435f('0x2c')](handleEntityNotFound(_0x30f13e,null))[_0x435f('0x2c')](respondWithResult(_0x30f13e,null))[_0x435f('0x48')](handleError(_0x30f13e,null));};exports[_0x435f('0x4b')]=function(_0x5494f9,_0x15fb8d){return db[_0x435f('0x43')][_0x435f('0x4b')](_0x5494f9[_0x435f('0x4c')],{})['then'](respondWithResult(_0x15fb8d,0xc9))[_0x435f('0x48')](handleError(_0x15fb8d,null));};exports['clone']=function(_0x58552d,_0x2fed7b){var _0x196e47={'where':{'id':_0x58552d[_0x435f('0x49')]['id']}},_0x42418d={};_0x42418d[_0x435f('0x38')]=_['keys'](db[_0x435f('0x43')][_0x435f('0x31')]);_0x196e47[_0x435f('0x3a')]=_[_0x435f('0x37')](_0x42418d[_0x435f('0x38')],qs[_0x435f('0x39')](_0x58552d[_0x435f('0x35')][_0x435f('0x39')]));_0x196e47[_0x435f('0x3a')]=_0x196e47[_0x435f('0x3a')]['length']?_0x196e47['attributes']:_0x42418d['model'];if(_0x58552d[_0x435f('0x35')][_0x435f('0x44')]){_0x196e47['include']=[{'all':!![]}];}_0x196e47=_['merge']({},_0x196e47,_0x58552d[_0x435f('0x42')]);return db[_0x435f('0x43')][_0x435f('0x4d')](_0x196e47)['then'](handleEntityNotFound(_0x2fed7b,null))[_0x435f('0x2c')](function(_0x5745de){if(_0x5745de){var _0x21c5e3=_0x5745de[_0x435f('0x4e')]({'plain':!![]});_0x21c5e3=qs[_0x435f('0x4f')](_0x21c5e3,['id',_0x435f('0x50'),_0x435f('0x51'),_0x435f('0x52')]);_0x58552d['body']=_['omit'](_0x58552d[_0x435f('0x4c')],['id',_0x435f('0x50'),'updatedAt']);return db['sequelize'][_0x435f('0x53')](function(_0x7ca5ef){return db[_0x435f('0x43')][_0x435f('0x4b')](_[_0x435f('0x40')](_0x21c5e3,_0x58552d[_0x435f('0x4c')]),{'include':_0x58552d[_0x435f('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x7ca5ef})['then'](function(_0x9c9c5a){var _0x27e251=_0x9c9c5a[_0x435f('0x4e')]({'plain':!![]});return db[_0x435f('0x54')][_0x435f('0x46')]({'where':{'userProfileId':_0x58552d[_0x435f('0x49')]['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x281c61){if(_0x281c61){return BPromise['each'](_0x281c61,function(_0x385a2d){return new BPromise(function(_0x555d6b,_0x10c2c2){if(_0x385a2d['autoAssociation']===null||_0x385a2d[_0x435f('0x55')]===0x1)_0x555d6b(null);return db[_0x435f('0x56')][_0x435f('0x46')]({'where':{'sectionId':_0x385a2d['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x1ead44){var _0x365a7d=_[_0x435f('0x34')](_0x1ead44,function(_0x372acc){return qs[_0x435f('0x4f')](_0x372acc,['id',_0x435f('0x50'),_0x435f('0x51'),_0x435f('0x57')]);});_0x555d6b(_0x365a7d);})[_0x435f('0x48')](function(_0x2fc666){_0x10c2c2(_0x2fc666);});})[_0x435f('0x2c')](function(_0x23b88a){var _0x37e482=qs[_0x435f('0x4f')](_0x385a2d,['id',_0x435f('0x50'),_0x435f('0x51')]);_0x37e482[_0x435f('0x58')]=_0x27e251['id'];if(_0x23b88a)_0x37e482[_0x435f('0x59')]=_0x23b88a;return _0x37e482;})[_0x435f('0x2c')](function(_0x42520f){return db[_0x435f('0x54')][_0x435f('0x4b')](_0x42520f,{'include':[{'model':db['UserProfileResource'],'as':_0x435f('0x59')}],'raw':!![],'transaction':_0x7ca5ef});});})[_0x435f('0x2c')](function(){return _0x27e251;});}});});});}})[_0x435f('0x2c')](respondWithResult(_0x2fed7b,0xc9))['catch'](handleError(_0x2fed7b,null));};exports[_0x435f('0x2b')]=function(_0x131a63,_0x376061){if(_0x131a63[_0x435f('0x4c')]['id']){delete _0x131a63[_0x435f('0x4c')]['id'];}return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x131a63[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x376061,null))[_0x435f('0x2c')](saveUpdates(_0x131a63[_0x435f('0x4c')],null))[_0x435f('0x2c')](respondWithResult(_0x376061,null))[_0x435f('0x48')](handleError(_0x376061,null));};exports[_0x435f('0x5a')]=function(_0x56f647,_0x57632e){return db[_0x435f('0x43')]['find']({'where':{'id':_0x56f647[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x57632e,null))[_0x435f('0x2c')](removeEntity(_0x57632e,null))['catch'](handleError(_0x57632e,null));};exports['describe']=function(_0x3b50fd,_0x44eb0d){return db[_0x435f('0x43')]['describe']()['then'](respondWithResult(_0x44eb0d,null))[_0x435f('0x48')](handleError(_0x44eb0d,null));};exports[_0x435f('0x5b')]=function(_0x16da5a,_0x376a96){var _0x47645b=_0x16da5a[_0x435f('0x4c')];return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x16da5a[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x376a96,null))[_0x435f('0x2c')](function(_0x24157e){if(_0x24157e){return db['sequelize'][_0x435f('0x53')](function(_0x4ad0d6){return db[_0x435f('0x54')][_0x435f('0x5a')]({'where':{'userProfileId':_0x16da5a['params']['id'],'sectionId':_['map'](_0x47645b,function(_0x3590ea){return _0x3590ea[_0x435f('0x57')];})},'transaction':_0x4ad0d6})[_0x435f('0x2c')](function(){var _0xb00438=_[_0x435f('0x34')](_0x47645b,function(_0x3132b4){_0x3132b4['userProfileId']=_0x16da5a[_0x435f('0x49')]['id'];return _0x3132b4;});var _0x47eb7d=[];return BPromise['each'](_0xb00438,function(_0x566583){return db['UserProfileSection'][_0x435f('0x4b')](_0x566583,{'include':[{'model':db['UserProfileResource'],'as':_0x435f('0x59')}],'raw':!![],'transaction':_0x4ad0d6})[_0x435f('0x2c')](function(_0x565a4d){_0x47eb7d[_0x435f('0x5c')](_0x565a4d[_0x435f('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x47eb7d;});});});}})[_0x435f('0x2c')](function(_0x39f995){return _0x39f995;})['then'](respondWithResult(_0x376a96,null))[_0x435f('0x48')](handleError(_0x376a96,null));};exports['removeSections']=function(_0x130c55,_0x54de47){var _0x489401;return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x130c55[_0x435f('0x49')]['id']},'attributes':['id',_0x435f('0x2f')]})[_0x435f('0x2c')](handleEntityNotFound(_0x54de47,null))[_0x435f('0x2c')](function(_0x58baeb){if(_0x58baeb){_0x489401=_0x58baeb;return db[_0x435f('0x54')][_0x435f('0x5a')]({'where':{'userProfileId':_0x130c55['params']['id'],'sectionId':_0x130c55[_0x435f('0x35')]['ids']}});}})['then'](function(){return _0x489401;})[_0x435f('0x2c')](respondWithStatusCode(_0x54de47,null))[_0x435f('0x48')](handleError(_0x54de47,null));};exports[_0x435f('0x5d')]=function(_0x30c1d7,_0x18f5ad){var _0x1599a3=[];var _0x49550b=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x30c1d7[_0x435f('0x49')]['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x23413f){_0x1599a3=_['filter'](_0x23413f,function(_0x1e223f){return _0x1e223f[_0x435f('0x5e')]===0x1;});if(!_[_0x435f('0x5f')](_0x1599a3)){return _[_0x435f('0x34')](_0x1599a3,function(_0xbd6245){return _0xbd6245[_0x435f('0x57')];});}else{return;}})[_0x435f('0x2c')](function(_0x2bd674){if(_0x2bd674)_0x49550b=_0x2bd674;if(_['includes'](_0x49550b,0x64)){var _0x184ab8=_[_0x435f('0x4d')](_0x1599a3,{'sectionId':0x64});return hasDefaultDashboard(_0x184ab8)[_0x435f('0x2c')](function(_0x2be508){return _['map'](_0x1599a3,function(_0x266567){if(_0x266567[_0x435f('0x57')]===0x64){_0x266567[_0x435f('0x60')]=_0x2be508;}return _0x266567;});});}else{return;}})['then'](function(_0x5cef3e){if(_0x5cef3e)_0x1599a3=_0x5cef3e;if(_[_0x435f('0x61')](_0x49550b,0x3eb)||_[_0x435f('0x62')](_0x1599a3,{'enabled':![],'sectionId':0x3eb})){var _0x3433df=_[_0x435f('0x4d')](_0x1599a3,{'sectionId':0x3eb});return getCustomDashboards(_0x3433df)[_0x435f('0x2c')](function(_0x591569){return _[_0x435f('0x34')](_0x1599a3,function(_0x314bfa){if(_0x314bfa[_0x435f('0x57')]===0x3eb){_0x314bfa[_0x435f('0x60')]=_0x591569;}return _0x314bfa;});});}else{return;}})[_0x435f('0x2c')](function(_0x2a9c7a){if(_0x2a9c7a)_0x1599a3=_0x2a9c7a;if(_['includes'](_0x49550b,0x709)||_[_0x435f('0x62')](_0x1599a3,{'enabled':![],'sectionId':0x709})){var _0x303d37=_[_0x435f('0x4d')](_0x1599a3,{'sectionId':0x709});return getPlugins(_0x303d37)['then'](function(_0x42339c){return _[_0x435f('0x34')](_0x1599a3,function(_0x1800dc){if(_0x1800dc['sectionId']===0x709){_0x1800dc['subsections']=_0x42339c;}return _0x1800dc;});});}else{return;}})[_0x435f('0x2c')](function(_0x29c958){if(_0x29c958)_0x1599a3=_0x29c958;return _0x1599a3;})[_0x435f('0x2c')](respondWithResult(_0x18f5ad,null))[_0x435f('0x48')](handleError(_0x18f5ad,null));};function hasDefaultDashboard(_0x4ba9db){var _0x2f4edd=[0x65];return new BPromise(function(_0x545cb4,_0x179f0c){try{if(_0x4ba9db[_0x435f('0x55')]){_0x545cb4(_0x2f4edd);}else{return db[_0x435f('0x56')][_0x435f('0x63')]({'where':{'sectionId':_0x4ba9db['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x5296b9){if(_0x5296b9){_0x545cb4(_0x2f4edd);}});}}catch(_0x1fd061){_0x179f0c(_0x1fd061);}});}function getCustomDashboards(_0x5c7197){var _0x5eda1f=[];return new BPromise(function(_0x1d2fde,_0x87b56e){try{if(_0x5c7197[_0x435f('0x55')]){return db['Dashboard'][_0x435f('0x46')]({'raw':!![]})[_0x435f('0x2c')](function(_0x1a8302){_0x1a8302['forEach'](function(_0x51a62c){_0x5eda1f[_0x435f('0x5c')](_0x51a62c['id']+0x1869f);});_0x1d2fde(_0x5eda1f);});}else{return db[_0x435f('0x56')]['findAll']({'where':{'sectionId':_0x5c7197['id']},'raw':!![]})['then'](function(_0x5713ce){_0x5713ce[_0x435f('0x64')](function(_0x3a9fd8){_0x5eda1f[_0x435f('0x5c')](_0x3a9fd8[_0x435f('0x65')]+0x1869f);});_0x1d2fde(_0x5eda1f);});}}catch(_0x228e77){_0x87b56e(_0x228e77);}});}function getPlugins(_0x4438c0){var _0x9f27fe=[];return new BPromise(function(_0x1e55bd,_0x120645){try{if(_0x4438c0['autoAssociation']){return db[_0x435f('0x66')]['findAll']({'raw':!![]})[_0x435f('0x2c')](function(_0x1fa67c){_0x1fa67c[_0x435f('0x64')](function(_0x246f01){_0x9f27fe[_0x435f('0x5c')](_0x246f01['id']+0x15b38);});_0x1e55bd(_0x9f27fe);});}else{return db[_0x435f('0x56')][_0x435f('0x46')]({'where':{'sectionId':_0x4438c0['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x265cee){_0x265cee['forEach'](function(_0x27a92b){_0x9f27fe['push'](_0x27a92b[_0x435f('0x65')]+0x15b38);});_0x1e55bd(_0x9f27fe);});}}catch(_0x4fbdfb){_0x120645(_0x4fbdfb);}});}exports[_0x435f('0x67')]=function(_0x3f8634,_0x2f2b38){return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x3f8634[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x2f2b38,null))[_0x435f('0x2c')](function(_0x3e0f4e){if(_0x3e0f4e){return db[_0x435f('0x68')][_0x435f('0x53')](function(_0x1fe3b0){return db['UserProfileSection'][_0x435f('0x46')]({'where':{'userProfileId':_0x3f8634[_0x435f('0x49')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x50f81d){if(_0x50f81d){return db[_0x435f('0x54')][_0x435f('0x5a')]({'where':{'userProfileId':_0x3f8634[_0x435f('0x49')]['id'],'id':_[_0x435f('0x34')](_0x50f81d,function(_0x4dae78){return _0x4dae78['id'];})},'transaction':_0x1fe3b0});}})[_0x435f('0x2c')](function(_0x487ab4){var _0x82521f=_[_0x435f('0x34')](_0x3f8634[_0x435f('0x4c')],function(_0x5eb01f){_0x5eb01f[_0x435f('0x58')]=_0x3f8634[_0x435f('0x49')]['id'];return _0x5eb01f;});return db[_0x435f('0x54')]['bulkCreate'](_0x82521f,{'raw':!![],'transaction':_0x1fe3b0});})[_0x435f('0x2c')](function(_0x2c0efd){var _0x263665=_['filter'](_[_0x435f('0x34')](_0x2c0efd,function(_0x1e23d3){return _0x1e23d3[_0x435f('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x263665){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3f8634[_0x435f('0x49')]['id'],'sectionId':_[_0x435f('0x34')](_0x263665,function(_0x1c0583){return _0x1c0583[_0x435f('0x57')];})},'attributes':['id',_0x435f('0x57')],'raw':!![]})['then'](function(_0x13f59b){var _0x3e6cc5=_[_0x435f('0x34')](_0x3f8634[_0x435f('0x4c')],function(_0x297f1e){_0x297f1e[_0x435f('0x58')]=_0x3f8634[_0x435f('0x49')]['id'];return _0x297f1e;});return db[_0x435f('0x56')][_0x435f('0x69')](_0x3e6cc5,{'raw':!![],'transaction':_0x1fe3b0});});}})[_0x435f('0x48')](handleError(_0x2f2b38,null));});}})[_0x435f('0x2c')](function(_0x586fe0){var _0x2f2dac=_['map'](_0x586fe0,function(_0x4bfcd2){return _0x4bfcd2[_0x435f('0x4e')]({'plain':!![]});});})[_0x435f('0x2c')](respondWithResult(_0x2f2b38,null))[_0x435f('0x48')](handleError(_0x2f2b38,null));};exports['removeResources']=function(_0xc7109b,_0x5ba3dd,_0x1f61c3){return db['UserProfile'][_0x435f('0x4d')]({'where':{'id':_0xc7109b['params']['id']}})['then'](handleEntityNotFound(_0x5ba3dd,null))[_0x435f('0x2c')](function(_0x438002){if(_0x438002){return _0x438002[_0x435f('0x6a')](_0xc7109b[_0x435f('0x35')][_0x435f('0x6b')]);}})['then'](respondWithStatusCode(_0x5ba3dd,null))['catch'](handleError(_0x5ba3dd,null));};exports[_0x435f('0x6c')]=function(_0x40a28a,_0x4020ed){var _0x4404de={'raw':![],'where':{}};var _0x15eabe={};var _0x12b21d={'count':0x0,'rows':[]};var _0x2c6587=_0x40a28a[_0x435f('0x35')][_0x435f('0x6d')];if(typeof _0x2c6587===_0x435f('0x6e')){throw new db['Sequelize']['ValidationError'](_0x435f('0x6f'));}var _0x2a82ed=_0x40a28a['query'][_0x435f('0x70')]||![];var _0x213117=getQueryModels(_0x2c6587,_0x2a82ed);if(typeof _0x213117[_0x435f('0x71')]===_0x435f('0x6e')){throw new db[(_0x435f('0x72'))][(_0x435f('0x73'))](_0x435f('0x74')+_0x2c6587+'\x27');}var _0x3bd2f2=[];if(!_[_0x435f('0x5f')](_0x213117['parentSections'])){_0x3bd2f2=_0x213117[_0x435f('0x75')];}else{_0x3bd2f2=[{'name':_0x2c6587}];}return db[_0x435f('0x43')][_0x435f('0x63')]({'where':{'id':_0x40a28a[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x4020ed,null))[_0x435f('0x2c')](function(_0x2b37cf){if(_0x2b37cf){var _0x293ebc=[];for(var _0x559ba3=0x0;_0x559ba3<_0x3bd2f2[_0x435f('0x76')];_0x559ba3++){_0x293ebc[_0x435f('0x5c')](db[_0x435f('0x54')][_0x435f('0x63')]({'where':{'userProfileId':_0x2b37cf['id'],'name':_0x3bd2f2[_0x559ba3][_0x435f('0x2f')]},'raw':!![]}));}return BPromise[_0x435f('0x77')](_0x293ebc);}})[_0x435f('0x2c')](function(_0x4342b0){var _0x3448e6=_[_0x435f('0x78')](_0x4342b0,function(_0x5a25b5){return _0x5a25b5?_0x5a25b5:undefined;});var _0x214753=_[_0x435f('0x78')](_0x3bd2f2,[_0x435f('0x79'),!![]]);var _0x3c4ba9=_[_0x435f('0x5f')](_0x3448e6)&&_[_0x435f('0x5f')](_0x214753)?null:_['union'](_0x214753,_0x3448e6);if(_0x3c4ba9){var _0x5a28aa=[];for(var _0x32b3cb=0x0;_0x32b3cb<_0x3c4ba9[_0x435f('0x76')];_0x32b3cb++){var _0x73bf61=_[_0x435f('0x4d')](_0x3bd2f2,function(_0x280557){return _0x3c4ba9[_0x32b3cb]?_0x280557[_0x435f('0x2f')]===_0x3c4ba9[_0x32b3cb][_0x435f('0x2f')]:null;});if(_0x73bf61){if(_0x3c4ba9[_0x32b3cb][_0x435f('0x79')]){_0x5a28aa[_0x435f('0x5c')](getAllResources(_0x213117[_0x435f('0x71')],_0x3c4ba9[_0x32b3cb]));}else{if(!_0x3c4ba9[_0x32b3cb][_0x435f('0x55')]){_0x5a28aa[_0x435f('0x5c')](getAllowedResources(_0x73bf61,_0x3c4ba9[_0x32b3cb],_0x213117['childModel']));}else{if(_0x73bf61['model']){_0x5a28aa[_0x435f('0x5c')](getAllFilteredResources(_0x73bf61,_0x3c4ba9[_0x32b3cb]));}}}}}return BPromise[_0x435f('0x77')](_0x5a28aa);}else{return null;}})[_0x435f('0x2c')](function(_0x29be2e){var _0x5609c7=_0x29be2e;var _0x41eff6=null;if(_0x5609c7){_0x41eff6=_0x5609c7[_0x435f('0x76')]===0x1?_0x5609c7[0x0]:null;}if(_0x41eff6||_0x5609c7){var _0x981297=db[_0x213117['childModel']][_0x435f('0x31')];_0x15eabe[_0x435f('0x38')]=_['keys'](_0x981297);_0x15eabe[_0x435f('0x35')]=_[_0x435f('0x4a')](_0x40a28a['query']);_0x15eabe['filters']=_[_0x435f('0x37')](_0x15eabe['model'],_0x15eabe['query']);_0x4404de[_0x435f('0x3a')]=_['intersection'](_0x15eabe['model'],qs[_0x435f('0x39')](_0x40a28a[_0x435f('0x35')][_0x435f('0x39')]));_0x4404de['attributes']=_0x4404de[_0x435f('0x3a')][_0x435f('0x76')]?_0x4404de['attributes']:_0x15eabe[_0x435f('0x38')];if(!_0x40a28a[_0x435f('0x35')][_0x435f('0x3b')](_0x435f('0x3c'))){_0x4404de[_0x435f('0x25')]=qs['limit'](_0x40a28a[_0x435f('0x35')][_0x435f('0x25')]);_0x4404de[_0x435f('0x24')]=qs[_0x435f('0x24')](_0x40a28a[_0x435f('0x35')][_0x435f('0x24')]);}_0x4404de['order']=qs[_0x435f('0x3e')](_0x40a28a['query'][_0x435f('0x3e')]);_0x4404de[_0x435f('0x3f')]=qs[_0x435f('0x36')](_[_0x435f('0x7a')](_0x40a28a['query'],_0x15eabe[_0x435f('0x36')]));if(_0x40a28a['query'][_0x435f('0x78')]){_0x4404de[_0x435f('0x3f')]=_[_0x435f('0x40')](_0x4404de[_0x435f('0x3f')],{'$or':_[_0x435f('0x34')](_0x981297,function(_0x5d0f13){if(_0x5d0f13[_0x435f('0x7b')][_0x435f('0x33')]!=='VIRTUAL'){var _0x38a1e6={};_0x38a1e6[_0x5d0f13[_0x435f('0x7c')]]={'$like':'%'+_0x40a28a[_0x435f('0x35')][_0x435f('0x78')]+'%'};return _0x38a1e6;}})});}var _0x3f24ab=[];if(_0x41eff6){var _0x5c00a0=_[_0x435f('0x4d')](_0x3bd2f2,[_0x435f('0x2f'),_0x41eff6[_0x435f('0x2f')]]);if(_0x5c00a0[_0x435f('0x7c')]){var _0x44faa0={};if(_0x213117[_0x435f('0x71')]==='AnalyticExtractedReport'){_0x44faa0[_0x5c00a0[_0x435f('0x7d')]]=_[_0x435f('0x34')](_0x41eff6[_0x435f('0x7e')],'id');}else{_0x44faa0[_0x5c00a0['foreignKey']]=_0x41eff6[_0x435f('0x7e')];}_0x3f24ab['push'](_0x44faa0);}else{_0x4404de['where']['id']=_0x41eff6[_0x435f('0x7e')];}}else{for(var _0x2bf42c=0x0;_0x2bf42c<_0x5609c7[_0x435f('0x76')];_0x2bf42c++){var _0x5c00a0=_['find'](_0x3bd2f2,[_0x435f('0x2f'),_0x5609c7[_0x2bf42c][_0x435f('0x2f')]]);if(_0x5c00a0[_0x435f('0x7c')]){var _0x44faa0={};_0x44faa0[_0x5c00a0[_0x435f('0x7d')]]=_0x5609c7[_0x2bf42c]['associatedResources'];_0x3f24ab[_0x435f('0x5c')](_0x44faa0);}else{if(!_0x4404de['where']['id'])_0x4404de['where']['id']=[];_0x5609c7[_0x2bf42c]['associatedResources']['forEach'](function(_0x34c309){_0x4404de[_0x435f('0x3f')]['id'][_0x435f('0x5c')](_0x34c309);});}}}if(!_[_0x435f('0x5f')](_0x3f24ab)){_0x4404de['where']=_[_0x435f('0x40')](_0x4404de['where'],{'$and':{'$or':_0x3f24ab}});}_0x4404de=_[_0x435f('0x40')]({},_0x4404de,_0x40a28a[_0x435f('0x42')]);if(_0x41eff6&&!_0x41eff6[_0x435f('0x55')]&&_0x213117[_0x435f('0x71')]==='AnalyticExtractedReport'){if(_0x40a28a[_0x435f('0x35')][_0x435f('0x44')]){_0x4404de[_0x435f('0x45')]=[{'all':!![]}];}return db[_0x213117[_0x435f('0x71')]][_0x435f('0x46')](_0x4404de)['then'](function(_0x3f3e7f){var _0x1624e2=[];_0x3f3e7f[_0x435f('0x64')](function(_0x3f6ec0){var _0x5d7d07;switch(_0x3f6ec0[_0x435f('0x7f')]){case'default':_0x5d7d07=_[_0x435f('0x4d')](_0x41eff6['associatedResources'],function(_0x377cff){return _0x377cff['id']===_0x3f6ec0[_0x435f('0x80')]&&_0x377cff[_0x435f('0x7b')]==='DefaultReports';});break;case _0x435f('0x81'):_0x5d7d07=_[_0x435f('0x4d')](_0x41eff6[_0x435f('0x7e')],function(_0xc3bb62){return _0xc3bb62['id']===_0x3f6ec0[_0x435f('0x80')]&&_0xc3bb62[_0x435f('0x7b')]==='CustomReports';});break;}if(_0x5d7d07)_0x1624e2[_0x435f('0x5c')](_0x3f6ec0);});_0x12b21d[_0x435f('0x23')]=_0x1624e2[_0x435f('0x76')];_0x12b21d[_0x435f('0x47')]=_0x1624e2;return _0x12b21d;});}else{return db[_0x213117['childModel']][_0x435f('0x23')]({'where':_0x4404de[_0x435f('0x3f')]})[_0x435f('0x2c')](function(_0x62bd1e){_0x12b21d[_0x435f('0x23')]=_0x62bd1e;if(_0x40a28a[_0x435f('0x35')][_0x435f('0x44')]){if(_0x213117['childModel']===_0x435f('0x82')){_0x4404de['include']=[{'model':db[_0x435f('0x83')],'as':_0x435f('0x84'),'attributes':['id','name',_0x435f('0x85')],'required':_0x40a28a['query'][_0x435f('0x86')]?!![]:![]},{'model':db[_0x435f('0x83')],'as':_0x435f('0x87'),'attributes':['id',_0x435f('0x2f'),_0x435f('0x85')],'through':_0x40a28a[_0x435f('0x35')][_0x435f('0x86')]?{'attributes':[],'where':{'TagId':_0x40a28a[_0x435f('0x35')][_0x435f('0x86')]||undefined}}:{},'required':_0x40a28a['query'][_0x435f('0x86')]?!![]:![]}];}else{_0x4404de['include']=[{'all':!![]}];}}return db[_0x213117[_0x435f('0x71')]][_0x435f('0x46')](_0x4404de);})[_0x435f('0x2c')](function(_0x143f18){_0x12b21d[_0x435f('0x47')]=_0x143f18;return _0x12b21d;});}}else{return _0x12b21d;}})[_0x435f('0x2c')](respondWithFilteredResult(_0x4020ed,_0x4404de))[_0x435f('0x48')](handleError(_0x4020ed,null));};function getAllResources(_0x19f8f3,_0x28b619){return new BPromise(function(_0x571c45,_0x3b402f){if(_0x28b619){var _0x2a6aa8=_0x28b619['filter']?{[_0x28b619[_0x435f('0x78')][_0x435f('0x7c')]]:_0x28b619[_0x435f('0x78')][_0x435f('0x88')]}:undefined;return db[_0x19f8f3][_0x435f('0x46')]({'where':_0x2a6aa8,'raw':!![]})[_0x435f('0x2c')](function(_0x39b79a){_0x28b619[_0x435f('0x7e')]=_[_0x435f('0x34')](_0x39b79a,'id');_0x571c45(_0x28b619);})['catch'](function(_0x5b880d){_0x3b402f(_0x5b880d);});}else{_0x571c45(null);}});}function getAllFilteredResources(_0x4bad0c,_0x25bb4b){return new BPromise(function(_0x4ee12c,_0x3a3635){var _0x1822a3=_0x4bad0c['filter']?{[_0x4bad0c[_0x435f('0x78')][_0x435f('0x7c')]]:_0x4bad0c[_0x435f('0x78')][_0x435f('0x88')]}:undefined;return db[_0x4bad0c[_0x435f('0x38')]][_0x435f('0x46')]({'where':_0x1822a3,'raw':!![]})[_0x435f('0x2c')](function(_0x153b42){_0x25bb4b['associatedResources']=_[_0x435f('0x34')](_0x153b42,function(_0x1fe9cb){return _0x1fe9cb['name'];});_0x4ee12c(_0x25bb4b);})['catch'](function(_0x340bcd){_0x3a3635(_0x340bcd);});});}function getAllowedResources(_0x3a2b17,_0x2bcf06,_0x60b8a0){return new BPromise(function(_0x44c662,_0x3a54c3){if(_0x2bcf06){return db[_0x435f('0x56')]['findAll']({'where':{'sectionId':_0x2bcf06['id']},'raw':!![]})['then'](function(_0x9dbb06){if(_0x3a2b17[_0x435f('0x7c')]&&_0x3a2b17[_0x435f('0x7c')]!=='id'){_0x2bcf06[_0x435f('0x7e')]=_[_0x435f('0x34')](_0x9dbb06,function(_0x3dc8d3){return _0x3dc8d3[_0x3a2b17[_0x435f('0x7c')]];});}else{if(_0x60b8a0===_0x435f('0x89')){_0x2bcf06[_0x435f('0x7e')]=_['map'](_0x9dbb06,function(_0x251f48){return{'id':_0x251f48[_0x435f('0x65')],'type':_0x251f48[_0x435f('0x7b')]};});}else{_0x2bcf06[_0x435f('0x7e')]=_[_0x435f('0x34')](_0x9dbb06,function(_0x325f62){return _0x325f62['resourceId'];});}}_0x44c662(_0x2bcf06);})[_0x435f('0x48')](function(_0xbe47ab){_0x3a54c3(_0xbe47ab);});}else{_0x44c662(null);}});}function getQueryModels(_0x3579d8,_0x1d5c54){var _0x3fdef6=_0x3579d8[_0x435f('0x8a')]();var _0x1c26f8={'childModel':undefined,'parentSections':[]};switch(_0x3fdef6){case'squareprojects':_0x1c26f8[_0x435f('0x71')]=_0x435f('0x8b');break;case _0x435f('0x8c'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x8d');break;case _0x435f('0x8e'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x8f');_0x1c26f8['parentSections']=[{'name':_0x435f('0x90'),'field':'name','foreignKey':_0x435f('0x91')}];break;case'projects':_0x1c26f8[_0x435f('0x71')]=_0x435f('0x92');break;case _0x435f('0x93'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x82');_0x1c26f8[_0x435f('0x75')]=[{'name':_0x435f('0x94'),'field':'id','foreignKey':_0x435f('0x95')}];break;case _0x435f('0x96'):_0x1c26f8['childModel']='CmList';break;case _0x435f('0x97'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x98');break;case'globalcustomfields':_0x1c26f8[_0x435f('0x71')]='CmCustomField';break;case _0x435f('0x99'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x9a');break;case _0x435f('0x9b'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x9c');break;case'faxqueues':_0x1c26f8[_0x435f('0x71')]='FaxQueue';break;case'faxaccounts':_0x1c26f8[_0x435f('0x71')]='FaxAccount';break;case _0x435f('0x9d'):case'internalroutes':case _0x435f('0x9e'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x9f');break;case _0x435f('0xa0'):_0x1c26f8['childModel']=_0x435f('0xa1');break;case _0x435f('0xa2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa3');break;case'voicerecordings':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa4');_0x1c26f8[_0x435f('0x75')]=[{'name':'Agents','field':_0x435f('0x2f'),'foreignKey':'membername','model':_0x435f('0xa5'),'filter':{'field':_0x435f('0xa6'),'value':['agent']}},{'name':_0x435f('0xa7'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':_0x435f('0xa6'),'value':[_0x435f('0xa8')]}},{'name':_0x435f('0xa9'),'field':_0x435f('0x2f'),'foreignKey':'queue','model':_0x435f('0xaa'),'filter':{'field':_0x435f('0x7b'),'value':['inbound']}},{'name':_0x435f('0xab'),'field':_0x435f('0x2f'),'foreignKey':_0x435f('0xac'),'model':'VoiceQueue','filter':{'field':_0x435f('0x7b'),'value':[_0x435f('0xad')]}}];break;case'musiconholds':_0x1c26f8['childModel']=_0x435f('0xae');break;case _0x435f('0xaf'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb0');break;case _0x435f('0xb1'):_0x1c26f8[_0x435f('0x71')]='VoicePrefix';break;case _0x435f('0xb2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb3');break;case'mailqueues':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb4');break;case _0x435f('0xb5'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb6');break;case _0x435f('0xb7'):_0x1c26f8['childModel']=_0x435f('0xb8');break;case _0x435f('0xb9'):_0x1c26f8['childModel']=_0x435f('0xba');break;case _0x435f('0xbb'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xbc');break;case _0x435f('0xbd'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xbe');break;case _0x435f('0xbf'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xc0');break;case _0x435f('0xc1'):_0x1c26f8[_0x435f('0x71')]='Team';break;case'voicequeues':case _0x435f('0xc2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xaa');if(_0x1d5c54){_0x1c26f8[_0x435f('0x75')]=[{'name':_0x435f('0xa9')},{'name':'QueueCampaigns'}];}break;case _0x435f('0xc3'):case _0x435f('0xc4'):case _0x435f('0xc5'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa5');if(_0x1d5c54){_0x1c26f8[_0x435f('0x75')]=[{'name':_0x435f('0xc6'),'filter':{'field':_0x435f('0xa6'),'value':[_0x435f('0xc7'),'user']},'ignore':!![]},{'name':_0x435f('0xc8')},{'name':'Telephones'}];}break;case _0x435f('0xc9'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xca');break;case'salesforceaccounts':_0x1c26f8[_0x435f('0x71')]='SalesforceAccount';break;case'freshdeskaccounts':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xcb');break;case _0x435f('0xcc'):_0x1c26f8[_0x435f('0x71')]='SugarcrmAccount';break;case _0x435f('0xcd'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xce');break;case _0x435f('0xcf'):_0x1c26f8['childModel']=_0x435f('0xd0');break;case _0x435f('0xd1'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa5');break;case _0x435f('0xd2'):_0x1c26f8['childModel']='CannedAnswer';break;case _0x435f('0xd3'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xd4');break;case'customdashboards':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xd5');break;case _0x435f('0xd6'):_0x1c26f8[_0x435f('0x71')]='Interval';break;case _0x435f('0xd7'):_0x1c26f8['childModel']=_0x435f('0xd8');break;case'scheduler':_0x1c26f8[_0x435f('0x71')]='Schedule';break;case'sounds':_0x1c26f8[_0x435f('0x71')]='Sound';break;case _0x435f('0xd9'):_0x1c26f8['childModel']=_0x435f('0x83');break;case _0x435f('0xda'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xdb');break;case _0x435f('0xdc'):_0x1c26f8[_0x435f('0x71')]='Trigger';break;case _0x435f('0xdd'):_0x1c26f8['childModel']=_0x435f('0xde');break;case _0x435f('0xdf'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xe0');break;case _0x435f('0xe1'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x66');break;case _0x435f('0xe2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x89');_0x1c26f8[_0x435f('0x75')]=[{'name':'Reports','field':'id','foreignKey':_0x435f('0x80')}];break;case _0x435f('0xe3'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xe4');break;default:return _0x1c26f8;}return _0x1c26f8;} \ No newline at end of file +var _0xdbc3=['type','key','model','map','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','rows','catch','options','create','clone','params','get','updatedAt','crudPermissions','body','omit','createdAt','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','userProfileId','Resources','find','describe','push','removeSections','getSections','findAll','enabled','sectionId','subsections','includes','some','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize','ValidationError','mergeResources','childModel','parentSections','all','ignore','isEmpty','nolimit','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','custom','CustomReports','CmContact','Tag','Tags','tag','color','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','agent','Telephones','membername','User','role','telephone','VoiceQueues','VoiceQueue','inbound','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','agents','Users','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','dispositions','customdashboards','intervals','Interval','pauses','Pause','scheduler','Schedule','templates','Template','Trigger','trunks','Trunk','variables','plugins','Reports','metrics','AnalyticMetric','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','end','count','offset','limit','set','json','apply','save','update','then','destroy','sendStatus','stack','name','send','UserProfile','rawAttributes','fieldName'];(function(_0xd75141,_0x171a19){var _0x5a8690=function(_0x2eae43){while(--_0x2eae43){_0xd75141['push'](_0xd75141['shift']());}};_0x5a8690(++_0x171a19);}(_0xdbc3,0xbb));var _0x3dbc=function(_0x44b7a4,_0x4d71d1){_0x44b7a4=_0x44b7a4-0x0;var _0x364f93=_0xdbc3[_0x44b7a4];return _0x364f93;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3dbc('0x0'));var rimraf=require(_0x3dbc('0x1'));var zipdir=require(_0x3dbc('0x2'));var jsonpatch=require(_0x3dbc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3dbc('0x4'));var Mustache=require(_0x3dbc('0x5'));var util=require(_0x3dbc('0x6'));var path=require(_0x3dbc('0x7'));var sox=require(_0x3dbc('0x8'));var csv=require(_0x3dbc('0x9'));var ejs=require(_0x3dbc('0xa'));var fs=require('fs');var _=require(_0x3dbc('0xb'));var squel=require(_0x3dbc('0xc'));var crypto=require(_0x3dbc('0xd'));var jsforce=require(_0x3dbc('0xe'));var deskjs=require(_0x3dbc('0xf'));var toCsv=require(_0x3dbc('0x9'));var querystring=require(_0x3dbc('0x10'));var Papa=require(_0x3dbc('0x11'));var Redis=require(_0x3dbc('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3dbc('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3dbc('0x14'))('api');var utils=require(_0x3dbc('0x15'));var config=require(_0x3dbc('0x16'));var db=require(_0x3dbc('0x17'))['db'];config[_0x3dbc('0x18')]=_[_0x3dbc('0x19')](config[_0x3dbc('0x18')],{'host':_0x3dbc('0x1a'),'port':0x18eb});var socket=require(_0x3dbc('0x1b'))(new Redis(config[_0x3dbc('0x18')]));require(_0x3dbc('0x1c'))[_0x3dbc('0x1d')](socket);function respondWithStatusCode(_0x5d795b,_0x8cf715){_0x8cf715=_0x8cf715||0xcc;return function(_0x1a8510){if(_0x1a8510){return _0x5d795b['sendStatus'](_0x8cf715);}return _0x5d795b[_0x3dbc('0x1e')](_0x8cf715)[_0x3dbc('0x1f')]();};}function respondWithResult(_0x5417a8,_0x34a7e1){_0x34a7e1=_0x34a7e1||0xc8;return function(_0x868a37){if(_0x868a37){return _0x5417a8[_0x3dbc('0x1e')](_0x34a7e1)['json'](_0x868a37);}};}function respondWithFilteredResult(_0xd2f44a,_0xe661e0){return function(_0x1d949a){if(_0x1d949a){var _0x4e7990=_0x1d949a[_0x3dbc('0x20')],_0x151d48=_0xe661e0[_0x3dbc('0x21')],_0x1e4e09=_0xe661e0[_0x3dbc('0x21')]+_0xe661e0[_0x3dbc('0x22')],_0x157e5e;if(_0x1e4e09>=_0x4e7990){_0x1e4e09=_0x4e7990;_0x157e5e=0xc8;}else{_0x157e5e=0xce;}_0xd2f44a[_0x3dbc('0x1e')](_0x157e5e);return _0xd2f44a[_0x3dbc('0x23')]('Content-Range',_0x151d48+'-'+_0x1e4e09+'/'+_0x4e7990)[_0x3dbc('0x24')](_0x1d949a);}return null;};}function patchUpdates(_0x58145e){return function(_0x1836b3){try{jsonpatch[_0x3dbc('0x25')](_0x1836b3,_0x58145e,!![]);}catch(_0x34aead){return BPromise['reject'](_0x34aead);}return _0x1836b3[_0x3dbc('0x26')]();};}function saveUpdates(_0x563e83,_0x4ada09){return function(_0x32ba0b){if(_0x32ba0b){return _0x32ba0b[_0x3dbc('0x27')](_0x563e83)[_0x3dbc('0x28')](function(_0x47d70c){return _0x47d70c;});}return null;};}function removeEntity(_0x221c6c,_0x5a25b7){return function(_0x4e6424){if(_0x4e6424){return _0x4e6424[_0x3dbc('0x29')]()[_0x3dbc('0x28')](function(){_0x221c6c[_0x3dbc('0x1e')](0xcc)[_0x3dbc('0x1f')]();});}};}function handleEntityNotFound(_0x504a32,_0xe8f013){return function(_0x42a3ac){if(!_0x42a3ac){_0x504a32[_0x3dbc('0x2a')](0x194);}return _0x42a3ac;};}function handleError(_0x5566ce,_0x123f83){_0x123f83=_0x123f83||0x1f4;return function(_0x5f48bc){logger['error'](_0x5f48bc[_0x3dbc('0x2b')]);if(_0x5f48bc[_0x3dbc('0x2c')]){delete _0x5f48bc[_0x3dbc('0x2c')];}_0x5566ce[_0x3dbc('0x1e')](_0x123f83)[_0x3dbc('0x2d')](_0x5f48bc);};}exports['index']=function(_0x47c673,_0x2561be){var _0x323e17={},_0x5625ca={},_0x53bb93={'count':0x0,'rows':[]};var _0x35474a=_['map'](db[_0x3dbc('0x2e')][_0x3dbc('0x2f')],function(_0x47830e){return{'name':_0x47830e[_0x3dbc('0x30')],'type':_0x47830e[_0x3dbc('0x31')][_0x3dbc('0x32')]};});_0x5625ca[_0x3dbc('0x33')]=_[_0x3dbc('0x34')](_0x35474a,_0x3dbc('0x2c'));_0x5625ca[_0x3dbc('0x35')]=_[_0x3dbc('0x36')](_0x47c673[_0x3dbc('0x35')]);_0x5625ca['filters']=_['intersection'](_0x5625ca[_0x3dbc('0x33')],_0x5625ca[_0x3dbc('0x35')]);_0x323e17[_0x3dbc('0x37')]=_[_0x3dbc('0x38')](_0x5625ca[_0x3dbc('0x33')],qs[_0x3dbc('0x39')](_0x47c673['query'][_0x3dbc('0x39')]));_0x323e17['attributes']=_0x323e17['attributes'][_0x3dbc('0x3a')]?_0x323e17[_0x3dbc('0x37')]:_0x5625ca[_0x3dbc('0x33')];if(!_0x47c673[_0x3dbc('0x35')][_0x3dbc('0x3b')]('nolimit')){_0x323e17[_0x3dbc('0x22')]=qs[_0x3dbc('0x22')](_0x47c673[_0x3dbc('0x35')][_0x3dbc('0x22')]);_0x323e17[_0x3dbc('0x21')]=qs[_0x3dbc('0x21')](_0x47c673[_0x3dbc('0x35')][_0x3dbc('0x21')]);}_0x323e17[_0x3dbc('0x3c')]=qs[_0x3dbc('0x3d')](_0x47c673[_0x3dbc('0x35')]['sort']);_0x323e17[_0x3dbc('0x3e')]=qs[_0x3dbc('0x3f')](_[_0x3dbc('0x40')](_0x47c673['query'],_0x5625ca[_0x3dbc('0x3f')]));if(_0x47c673[_0x3dbc('0x35')]['filter']){_0x323e17[_0x3dbc('0x3e')]=_[_0x3dbc('0x41')](_0x323e17['where'],{'$or':_['map'](_0x35474a,function(_0xf54bf9){if(_0xf54bf9[_0x3dbc('0x31')]!==_0x3dbc('0x42')){var _0x3f39bf={};_0x3f39bf[_0xf54bf9[_0x3dbc('0x2c')]]={'$like':'%'+_0x47c673[_0x3dbc('0x35')][_0x3dbc('0x43')]+'%'};return _0x3f39bf;}})});}_0x323e17=_['merge']({},_0x323e17,_0x47c673['options']);var _0x3ecb11={'where':_0x323e17[_0x3dbc('0x3e')]};return db[_0x3dbc('0x2e')][_0x3dbc('0x20')](_0x3ecb11)[_0x3dbc('0x28')](function(_0x5bbb1a){_0x53bb93[_0x3dbc('0x20')]=_0x5bbb1a;if(_0x47c673[_0x3dbc('0x35')][_0x3dbc('0x44')]){_0x323e17[_0x3dbc('0x45')]=[{'all':!![]}];}return db[_0x3dbc('0x2e')]['findAll'](_0x323e17);})[_0x3dbc('0x28')](function(_0x1c230b){_0x53bb93[_0x3dbc('0x46')]=_0x1c230b;return _0x53bb93;})[_0x3dbc('0x28')](respondWithFilteredResult(_0x2561be,_0x323e17))[_0x3dbc('0x47')](handleError(_0x2561be,null));};exports['show']=function(_0x1f144c,_0x39b1ea){var _0x215be1={'raw':![],'where':{'id':_0x1f144c['params']['id']}},_0x21750a={};_0x21750a[_0x3dbc('0x33')]=_[_0x3dbc('0x36')](db[_0x3dbc('0x2e')]['rawAttributes']);_0x21750a[_0x3dbc('0x35')]=_[_0x3dbc('0x36')](_0x1f144c['query']);_0x21750a[_0x3dbc('0x3f')]=_['intersection'](_0x21750a[_0x3dbc('0x33')],_0x21750a['query']);_0x215be1[_0x3dbc('0x37')]=_[_0x3dbc('0x38')](_0x21750a['model'],qs[_0x3dbc('0x39')](_0x1f144c[_0x3dbc('0x35')][_0x3dbc('0x39')]));_0x215be1[_0x3dbc('0x37')]=_0x215be1[_0x3dbc('0x37')][_0x3dbc('0x3a')]?_0x215be1['attributes']:_0x21750a[_0x3dbc('0x33')];if(_0x1f144c[_0x3dbc('0x35')][_0x3dbc('0x44')]){_0x215be1[_0x3dbc('0x45')]=[{'all':!![]}];}_0x215be1=_[_0x3dbc('0x41')]({},_0x215be1,_0x1f144c[_0x3dbc('0x48')]);return db[_0x3dbc('0x2e')]['find'](_0x215be1)[_0x3dbc('0x28')](handleEntityNotFound(_0x39b1ea,null))['then'](respondWithResult(_0x39b1ea,null))[_0x3dbc('0x47')](handleError(_0x39b1ea,null));};exports[_0x3dbc('0x49')]=function(_0x3ac3bd,_0x17febe){return db[_0x3dbc('0x2e')][_0x3dbc('0x49')](_0x3ac3bd['body'],{})[_0x3dbc('0x28')](respondWithResult(_0x17febe,0xc9))['catch'](handleError(_0x17febe,null));};exports[_0x3dbc('0x4a')]=function(_0x5d2e29,_0xf4cec9){var _0xd89e96={'where':{'id':_0x5d2e29[_0x3dbc('0x4b')]['id']}},_0x4a41bd={};_0x4a41bd[_0x3dbc('0x33')]=_[_0x3dbc('0x36')](db['UserProfile']['rawAttributes']);_0xd89e96[_0x3dbc('0x37')]=_['intersection'](_0x4a41bd[_0x3dbc('0x33')],qs[_0x3dbc('0x39')](_0x5d2e29[_0x3dbc('0x35')][_0x3dbc('0x39')]));_0xd89e96[_0x3dbc('0x37')]=_0xd89e96[_0x3dbc('0x37')][_0x3dbc('0x3a')]?_0xd89e96[_0x3dbc('0x37')]:_0x4a41bd[_0x3dbc('0x33')];if(_0x5d2e29['query'][_0x3dbc('0x44')]){_0xd89e96[_0x3dbc('0x45')]=[{'all':!![]}];}_0xd89e96=_['merge']({},_0xd89e96,_0x5d2e29['options']);return db[_0x3dbc('0x2e')]['find'](_0xd89e96)[_0x3dbc('0x28')](handleEntityNotFound(_0xf4cec9,null))['then'](function(_0x4c6d64){if(_0x4c6d64){var _0x295380=_0x4c6d64[_0x3dbc('0x4c')]({'plain':!![]});_0x295380=qs['omit'](_0x295380,['id','createdAt',_0x3dbc('0x4d'),_0x3dbc('0x4e')]);_0x5d2e29[_0x3dbc('0x4f')]=_[_0x3dbc('0x50')](_0x5d2e29[_0x3dbc('0x4f')],['id',_0x3dbc('0x51'),_0x3dbc('0x4d')]);return db[_0x3dbc('0x52')][_0x3dbc('0x53')](function(_0x441ecd){return db['UserProfile'][_0x3dbc('0x49')](_[_0x3dbc('0x41')](_0x295380,_0x5d2e29['body']),{'include':_0x5d2e29[_0x3dbc('0x35')][_0x3dbc('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x441ecd})[_0x3dbc('0x28')](function(_0x10b8df){var _0x5ef05f=_0x10b8df[_0x3dbc('0x4c')]({'plain':!![]});return db[_0x3dbc('0x54')]['findAll']({'where':{'userProfileId':_0x5d2e29[_0x3dbc('0x4b')]['id']},'raw':!![]})['then'](function(_0x22713b){if(_0x22713b){return BPromise[_0x3dbc('0x55')](_0x22713b,function(_0x131a20){return new BPromise(function(_0x58914b,_0x47c6bb){if(_0x131a20[_0x3dbc('0x56')]===null||_0x131a20['autoAssociation']===0x1)_0x58914b(null);return db[_0x3dbc('0x57')]['findAll']({'where':{'sectionId':_0x131a20['id']},'raw':!![]})[_0x3dbc('0x28')](function(_0x1947d7){var _0x5d7423=_[_0x3dbc('0x34')](_0x1947d7,function(_0x43372e){return qs[_0x3dbc('0x50')](_0x43372e,['id',_0x3dbc('0x51'),_0x3dbc('0x4d'),'sectionId']);});_0x58914b(_0x5d7423);})['catch'](function(_0x38109e){_0x47c6bb(_0x38109e);});})['then'](function(_0x23b930){var _0x47351d=qs[_0x3dbc('0x50')](_0x131a20,['id',_0x3dbc('0x51'),_0x3dbc('0x4d')]);_0x47351d[_0x3dbc('0x58')]=_0x5ef05f['id'];if(_0x23b930)_0x47351d[_0x3dbc('0x59')]=_0x23b930;return _0x47351d;})[_0x3dbc('0x28')](function(_0x2f4aa4){return db['UserProfileSection'][_0x3dbc('0x49')](_0x2f4aa4,{'include':[{'model':db[_0x3dbc('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x441ecd});});})[_0x3dbc('0x28')](function(){return _0x5ef05f;});}});});});}})[_0x3dbc('0x28')](respondWithResult(_0xf4cec9,0xc9))['catch'](handleError(_0xf4cec9,null));};exports[_0x3dbc('0x27')]=function(_0x42e08a,_0x4b30d0){if(_0x42e08a[_0x3dbc('0x4f')]['id']){delete _0x42e08a[_0x3dbc('0x4f')]['id'];}return db[_0x3dbc('0x2e')][_0x3dbc('0x5a')]({'where':{'id':_0x42e08a[_0x3dbc('0x4b')]['id']}})[_0x3dbc('0x28')](handleEntityNotFound(_0x4b30d0,null))[_0x3dbc('0x28')](saveUpdates(_0x42e08a[_0x3dbc('0x4f')],null))[_0x3dbc('0x28')](respondWithResult(_0x4b30d0,null))['catch'](handleError(_0x4b30d0,null));};exports[_0x3dbc('0x29')]=function(_0x169b54,_0x84a167){return db[_0x3dbc('0x2e')][_0x3dbc('0x5a')]({'where':{'id':_0x169b54[_0x3dbc('0x4b')]['id']}})[_0x3dbc('0x28')](handleEntityNotFound(_0x84a167,null))['then'](removeEntity(_0x84a167,null))[_0x3dbc('0x47')](handleError(_0x84a167,null));};exports[_0x3dbc('0x5b')]=function(_0x238490,_0x4c7e34){return db[_0x3dbc('0x2e')][_0x3dbc('0x5b')]()[_0x3dbc('0x28')](respondWithResult(_0x4c7e34,null))['catch'](handleError(_0x4c7e34,null));};exports['addSections']=function(_0x3a8d3f,_0x327e78){var _0x21f10d=_0x3a8d3f[_0x3dbc('0x4f')];return db[_0x3dbc('0x2e')][_0x3dbc('0x5a')]({'where':{'id':_0x3a8d3f[_0x3dbc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x327e78,null))[_0x3dbc('0x28')](function(_0x19263e){if(_0x19263e){return db['sequelize'][_0x3dbc('0x53')](function(_0x4455f5){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x3a8d3f[_0x3dbc('0x4b')]['id'],'sectionId':_['map'](_0x21f10d,function(_0x545c4d){return _0x545c4d['sectionId'];})},'transaction':_0x4455f5})[_0x3dbc('0x28')](function(){var _0x4139e7=_[_0x3dbc('0x34')](_0x21f10d,function(_0x18f395){_0x18f395[_0x3dbc('0x58')]=_0x3a8d3f[_0x3dbc('0x4b')]['id'];return _0x18f395;});var _0x488d22=[];return BPromise[_0x3dbc('0x55')](_0x4139e7,function(_0xb6bfb3){return db[_0x3dbc('0x54')][_0x3dbc('0x49')](_0xb6bfb3,{'include':[{'model':db[_0x3dbc('0x57')],'as':'Resources'}],'raw':!![],'transaction':_0x4455f5})[_0x3dbc('0x28')](function(_0x5ddc31){_0x488d22[_0x3dbc('0x5c')](_0x5ddc31[_0x3dbc('0x4c')]({'plain':!![]}));});})['then'](function(){return _0x488d22;});});});}})[_0x3dbc('0x28')](function(_0x1b6d15){return _0x1b6d15;})['then'](respondWithResult(_0x327e78,null))[_0x3dbc('0x47')](handleError(_0x327e78,null));};exports[_0x3dbc('0x5d')]=function(_0x51b475,_0x38819c){var _0x1797dc;return db[_0x3dbc('0x2e')][_0x3dbc('0x5a')]({'where':{'id':_0x51b475[_0x3dbc('0x4b')]['id']},'attributes':['id','name']})[_0x3dbc('0x28')](handleEntityNotFound(_0x38819c,null))['then'](function(_0x56d554){if(_0x56d554){_0x1797dc=_0x56d554;return db[_0x3dbc('0x54')][_0x3dbc('0x29')]({'where':{'userProfileId':_0x51b475[_0x3dbc('0x4b')]['id'],'sectionId':_0x51b475['query']['ids']}});}})['then'](function(){return _0x1797dc;})['then'](respondWithStatusCode(_0x38819c,null))[_0x3dbc('0x47')](handleError(_0x38819c,null));};exports[_0x3dbc('0x5e')]=function(_0x868088,_0x3046fa){var _0x44e4ae=[];var _0x243ca8=[];return db[_0x3dbc('0x54')][_0x3dbc('0x5f')]({'where':{'userProfileId':_0x868088[_0x3dbc('0x4b')]['id']},'raw':!![]})[_0x3dbc('0x28')](function(_0x321fd0){_0x44e4ae=_['filter'](_0x321fd0,function(_0x4f4de0){return _0x4f4de0[_0x3dbc('0x60')]===0x1;});if(!_['isEmpty'](_0x44e4ae)){return _['map'](_0x44e4ae,function(_0xc70057){return _0xc70057[_0x3dbc('0x61')];});}else{return;}})[_0x3dbc('0x28')](function(_0x10ba64){if(_0x10ba64)_0x243ca8=_0x10ba64;if(_['includes'](_0x243ca8,0x64)){var _0x177805=_[_0x3dbc('0x5a')](_0x44e4ae,{'sectionId':0x64});return hasDefaultDashboard(_0x177805)[_0x3dbc('0x28')](function(_0xf25132){return _[_0x3dbc('0x34')](_0x44e4ae,function(_0x321421){if(_0x321421['sectionId']===0x64){_0x321421[_0x3dbc('0x62')]=_0xf25132;}return _0x321421;});});}else{return;}})[_0x3dbc('0x28')](function(_0x1da505){if(_0x1da505)_0x44e4ae=_0x1da505;if(_[_0x3dbc('0x63')](_0x243ca8,0x3eb)||_[_0x3dbc('0x64')](_0x44e4ae,{'enabled':![],'sectionId':0x3eb})){var _0x7a2855=_[_0x3dbc('0x5a')](_0x44e4ae,{'sectionId':0x3eb});return getCustomDashboards(_0x7a2855)[_0x3dbc('0x28')](function(_0xad0d1f){return _[_0x3dbc('0x34')](_0x44e4ae,function(_0x2ba991){if(_0x2ba991['sectionId']===0x3eb){_0x2ba991[_0x3dbc('0x62')]=_0xad0d1f;}return _0x2ba991;});});}else{return;}})[_0x3dbc('0x28')](function(_0x461d42){if(_0x461d42)_0x44e4ae=_0x461d42;if(_['includes'](_0x243ca8,0x709)||_[_0x3dbc('0x64')](_0x44e4ae,{'enabled':![],'sectionId':0x709})){var _0x1bac90=_['find'](_0x44e4ae,{'sectionId':0x709});return getPlugins(_0x1bac90)['then'](function(_0x5617d9){return _['map'](_0x44e4ae,function(_0x9d5682){if(_0x9d5682[_0x3dbc('0x61')]===0x709){_0x9d5682['subsections']=_0x5617d9;}return _0x9d5682;});});}else{return;}})[_0x3dbc('0x28')](function(_0x5044c0){if(_0x5044c0)_0x44e4ae=_0x5044c0;return _0x44e4ae;})[_0x3dbc('0x28')](respondWithResult(_0x3046fa,null))[_0x3dbc('0x47')](handleError(_0x3046fa,null));};function hasDefaultDashboard(_0x2f9622){var _0x1f2890=[0x65];return new BPromise(function(_0x4cc08b,_0x3c95f3){try{if(_0x2f9622[_0x3dbc('0x56')]){_0x4cc08b(_0x1f2890);}else{return db[_0x3dbc('0x57')][_0x3dbc('0x65')]({'where':{'sectionId':_0x2f9622['id']},'raw':!![]})[_0x3dbc('0x28')](function(_0x45360b){if(_0x45360b){_0x4cc08b(_0x1f2890);}});}}catch(_0x2b336a){_0x3c95f3(_0x2b336a);}});}function getCustomDashboards(_0x13dcb1){var _0x4d1600=[];return new BPromise(function(_0x2e4863,_0x3702e4){try{if(_0x13dcb1[_0x3dbc('0x56')]){return db[_0x3dbc('0x66')][_0x3dbc('0x5f')]({'raw':!![]})[_0x3dbc('0x28')](function(_0x2513b6){_0x2513b6[_0x3dbc('0x67')](function(_0x4a83b7){_0x4d1600[_0x3dbc('0x5c')](_0x4a83b7['id']+0x1869f);});_0x2e4863(_0x4d1600);});}else{return db[_0x3dbc('0x57')][_0x3dbc('0x5f')]({'where':{'sectionId':_0x13dcb1['id']},'raw':!![]})[_0x3dbc('0x28')](function(_0x41de90){_0x41de90[_0x3dbc('0x67')](function(_0xca8564){_0x4d1600[_0x3dbc('0x5c')](_0xca8564[_0x3dbc('0x68')]+0x1869f);});_0x2e4863(_0x4d1600);});}}catch(_0x2159a7){_0x3702e4(_0x2159a7);}});}function getPlugins(_0x2b09c6){var _0x18af8f=[];return new BPromise(function(_0x2bf2fa,_0x8b231d){try{if(_0x2b09c6[_0x3dbc('0x56')]){return db[_0x3dbc('0x69')][_0x3dbc('0x5f')]({'raw':!![]})[_0x3dbc('0x28')](function(_0x49e912){_0x49e912[_0x3dbc('0x67')](function(_0x452517){_0x18af8f['push'](_0x452517['id']+0x15b38);});_0x2bf2fa(_0x18af8f);});}else{return db['UserProfileResource'][_0x3dbc('0x5f')]({'where':{'sectionId':_0x2b09c6['id']},'raw':!![]})[_0x3dbc('0x28')](function(_0x48403a){_0x48403a['forEach'](function(_0x3d457b){_0x18af8f[_0x3dbc('0x5c')](_0x3d457b['resourceId']+0x15b38);});_0x2bf2fa(_0x18af8f);});}}catch(_0x37c856){_0x8b231d(_0x37c856);}});}exports[_0x3dbc('0x6a')]=function(_0x2428f8,_0x400639){return db[_0x3dbc('0x2e')]['find']({'where':{'id':_0x2428f8[_0x3dbc('0x4b')]['id']}})[_0x3dbc('0x28')](handleEntityNotFound(_0x400639,null))[_0x3dbc('0x28')](function(_0x4d763f){if(_0x4d763f){return db[_0x3dbc('0x52')][_0x3dbc('0x53')](function(_0x546ce1){return db[_0x3dbc('0x54')][_0x3dbc('0x5f')]({'where':{'userProfileId':_0x2428f8['params']['id']},'attributes':['id'],'raw':!![]})[_0x3dbc('0x28')](function(_0x3d7089){if(_0x3d7089){return db[_0x3dbc('0x54')][_0x3dbc('0x29')]({'where':{'userProfileId':_0x2428f8['params']['id'],'id':_['map'](_0x3d7089,function(_0x1dc4f3){return _0x1dc4f3['id'];})},'transaction':_0x546ce1});}})['then'](function(_0x6861d8){var _0x2de40c=_['map'](_0x2428f8[_0x3dbc('0x4f')],function(_0x59bc1e){_0x59bc1e[_0x3dbc('0x58')]=_0x2428f8['params']['id'];return _0x59bc1e;});return db[_0x3dbc('0x54')][_0x3dbc('0x6b')](_0x2de40c,{'raw':!![],'transaction':_0x546ce1});})[_0x3dbc('0x28')](function(_0x38d963){var _0x5e1717=_['filter'](_[_0x3dbc('0x34')](_0x38d963,function(_0x2270cf){return _0x2270cf['get']({'plain':!![]});}),{'includeAll':![]});if(_0x5e1717){return db[_0x3dbc('0x54')][_0x3dbc('0x5f')]({'where':{'userProfileId':_0x2428f8[_0x3dbc('0x4b')]['id'],'sectionId':_['map'](_0x5e1717,function(_0x4fc838){return _0x4fc838[_0x3dbc('0x61')];})},'attributes':['id',_0x3dbc('0x61')],'raw':!![]})[_0x3dbc('0x28')](function(_0x29f18c){var _0x22704e=_[_0x3dbc('0x34')](_0x2428f8['body'],function(_0x257c9c){_0x257c9c['userProfileId']=_0x2428f8[_0x3dbc('0x4b')]['id'];return _0x257c9c;});return db[_0x3dbc('0x57')]['bulkCreate'](_0x22704e,{'raw':!![],'transaction':_0x546ce1});});}})[_0x3dbc('0x47')](handleError(_0x400639,null));});}})[_0x3dbc('0x28')](function(_0x41d38a){var _0x39fe89=_[_0x3dbc('0x34')](_0x41d38a,function(_0x4d65c5){return _0x4d65c5[_0x3dbc('0x4c')]({'plain':!![]});});})[_0x3dbc('0x28')](respondWithResult(_0x400639,null))[_0x3dbc('0x47')](handleError(_0x400639,null));};exports[_0x3dbc('0x6c')]=function(_0x55e23d,_0xdbcfc8,_0x1673f1){return db[_0x3dbc('0x2e')][_0x3dbc('0x5a')]({'where':{'id':_0x55e23d['params']['id']}})[_0x3dbc('0x28')](handleEntityNotFound(_0xdbcfc8,null))[_0x3dbc('0x28')](function(_0xe3a0ae){if(_0xe3a0ae){return _0xe3a0ae[_0x3dbc('0x6c')](_0x55e23d['query'][_0x3dbc('0x6d')]);}})[_0x3dbc('0x28')](respondWithStatusCode(_0xdbcfc8,null))[_0x3dbc('0x47')](handleError(_0xdbcfc8,null));};exports[_0x3dbc('0x6e')]=function(_0x123633,_0x45892c){var _0x3b2a68={'raw':![],'where':{}};var _0xe7a658={};var _0x14b722={'count':0x0,'rows':[]};var _0x1f93f5=_0x123633[_0x3dbc('0x35')][_0x3dbc('0x6f')];if(typeof _0x1f93f5===_0x3dbc('0x70')){throw new db[(_0x3dbc('0x71'))][(_0x3dbc('0x72'))]('Unknown\x20section');}var _0x149d16=_0x123633[_0x3dbc('0x35')][_0x3dbc('0x73')]||![];var _0x170508=getQueryModels(_0x1f93f5,_0x149d16);if(typeof _0x170508[_0x3dbc('0x74')]===_0x3dbc('0x70')){throw new db[(_0x3dbc('0x71'))][(_0x3dbc('0x72'))]('Invalid\x20section\x20\x27'+_0x1f93f5+'\x27');}var _0x3181c0=[];if(!_['isEmpty'](_0x170508[_0x3dbc('0x75')])){_0x3181c0=_0x170508[_0x3dbc('0x75')];}else{_0x3181c0=[{'name':_0x1f93f5}];}return db[_0x3dbc('0x2e')][_0x3dbc('0x65')]({'where':{'id':_0x123633[_0x3dbc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45892c,null))['then'](function(_0x4dce85){if(_0x4dce85){var _0xcb2ea=[];for(var _0x15cf6a=0x0;_0x15cf6a<_0x3181c0['length'];_0x15cf6a++){_0xcb2ea[_0x3dbc('0x5c')](db[_0x3dbc('0x54')]['findOne']({'where':{'userProfileId':_0x4dce85['id'],'name':_0x3181c0[_0x15cf6a][_0x3dbc('0x2c')]},'raw':!![]}));}return BPromise[_0x3dbc('0x76')](_0xcb2ea);}})[_0x3dbc('0x28')](function(_0x59eb19){var _0x214a86=_[_0x3dbc('0x43')](_0x59eb19,function(_0x341e22){return _0x341e22?_0x341e22:undefined;});var _0x90d972=_[_0x3dbc('0x43')](_0x3181c0,[_0x3dbc('0x77'),!![]]);var _0x1cc1e4=_[_0x3dbc('0x78')](_0x214a86)&&_[_0x3dbc('0x78')](_0x90d972)?null:_['union'](_0x90d972,_0x214a86);if(_0x1cc1e4){var _0x2fd0e5=[];for(var _0x4b2743=0x0;_0x4b2743<_0x1cc1e4[_0x3dbc('0x3a')];_0x4b2743++){var _0x17ba27=_['find'](_0x3181c0,function(_0x3e6d9f){return _0x1cc1e4[_0x4b2743]?_0x3e6d9f[_0x3dbc('0x2c')]===_0x1cc1e4[_0x4b2743][_0x3dbc('0x2c')]:null;});if(_0x17ba27){if(_0x1cc1e4[_0x4b2743][_0x3dbc('0x77')]){_0x2fd0e5[_0x3dbc('0x5c')](getAllResources(_0x170508[_0x3dbc('0x74')],_0x1cc1e4[_0x4b2743]));}else{if(!_0x1cc1e4[_0x4b2743][_0x3dbc('0x56')]){_0x2fd0e5['push'](getAllowedResources(_0x17ba27,_0x1cc1e4[_0x4b2743],_0x170508['childModel']));}else{if(_0x17ba27[_0x3dbc('0x33')]){_0x2fd0e5['push'](getAllFilteredResources(_0x17ba27,_0x1cc1e4[_0x4b2743]));}}}}}return BPromise[_0x3dbc('0x76')](_0x2fd0e5);}else{return null;}})[_0x3dbc('0x28')](function(_0x34ac96){var _0x52eb03=_0x34ac96;var _0x57ca83=null;if(_0x52eb03){_0x57ca83=_0x52eb03[_0x3dbc('0x3a')]===0x1?_0x52eb03[0x0]:null;}if(_0x57ca83||_0x52eb03){var _0x271ef0=db[_0x170508[_0x3dbc('0x74')]][_0x3dbc('0x2f')];_0xe7a658[_0x3dbc('0x33')]=_[_0x3dbc('0x36')](_0x271ef0);_0xe7a658['query']=_[_0x3dbc('0x36')](_0x123633[_0x3dbc('0x35')]);_0xe7a658[_0x3dbc('0x3f')]=_[_0x3dbc('0x38')](_0xe7a658[_0x3dbc('0x33')],_0xe7a658[_0x3dbc('0x35')]);_0x3b2a68[_0x3dbc('0x37')]=_[_0x3dbc('0x38')](_0xe7a658['model'],qs['fields'](_0x123633[_0x3dbc('0x35')][_0x3dbc('0x39')]));_0x3b2a68['attributes']=_0x3b2a68[_0x3dbc('0x37')][_0x3dbc('0x3a')]?_0x3b2a68[_0x3dbc('0x37')]:_0xe7a658[_0x3dbc('0x33')];if(!_0x123633['query'][_0x3dbc('0x3b')](_0x3dbc('0x79'))){_0x3b2a68[_0x3dbc('0x22')]=qs['limit'](_0x123633['query'][_0x3dbc('0x22')]);_0x3b2a68[_0x3dbc('0x21')]=qs[_0x3dbc('0x21')](_0x123633[_0x3dbc('0x35')][_0x3dbc('0x21')]);}_0x3b2a68[_0x3dbc('0x3c')]=qs['sort'](_0x123633[_0x3dbc('0x35')][_0x3dbc('0x3d')]);_0x3b2a68[_0x3dbc('0x3e')]=qs[_0x3dbc('0x3f')](_[_0x3dbc('0x40')](_0x123633[_0x3dbc('0x35')],_0xe7a658[_0x3dbc('0x3f')]));if(_0x123633[_0x3dbc('0x35')][_0x3dbc('0x43')]){_0x3b2a68[_0x3dbc('0x3e')]=_[_0x3dbc('0x41')](_0x3b2a68['where'],{'$or':_['map'](_0x271ef0,function(_0x3644f9){if(_0x3644f9[_0x3dbc('0x31')][_0x3dbc('0x32')]!==_0x3dbc('0x42')){var _0x19553d={};_0x19553d[_0x3644f9['field']]={'$like':'%'+_0x123633[_0x3dbc('0x35')][_0x3dbc('0x43')]+'%'};return _0x19553d;}})});}var _0x1a2c0a=[];if(_0x57ca83){var _0x41004d=_[_0x3dbc('0x5a')](_0x3181c0,[_0x3dbc('0x2c'),_0x57ca83[_0x3dbc('0x2c')]]);if(_0x41004d[_0x3dbc('0x7a')]){var _0x197394={};if(_0x170508[_0x3dbc('0x74')]===_0x3dbc('0x7b')){_0x197394[_0x41004d[_0x3dbc('0x7c')]]=_[_0x3dbc('0x34')](_0x57ca83[_0x3dbc('0x7d')],'id');}else{_0x197394[_0x41004d[_0x3dbc('0x7c')]]=_0x57ca83['associatedResources'];}_0x1a2c0a[_0x3dbc('0x5c')](_0x197394);}else{_0x3b2a68[_0x3dbc('0x3e')]['id']=_0x57ca83[_0x3dbc('0x7d')];}}else{for(var _0x1c841b=0x0;_0x1c841b<_0x52eb03[_0x3dbc('0x3a')];_0x1c841b++){var _0x41004d=_[_0x3dbc('0x5a')](_0x3181c0,['name',_0x52eb03[_0x1c841b][_0x3dbc('0x2c')]]);if(_0x41004d[_0x3dbc('0x7a')]){var _0x197394={};_0x197394[_0x41004d[_0x3dbc('0x7c')]]=_0x52eb03[_0x1c841b][_0x3dbc('0x7d')];_0x1a2c0a[_0x3dbc('0x5c')](_0x197394);}else{if(!_0x3b2a68[_0x3dbc('0x3e')]['id'])_0x3b2a68['where']['id']=[];_0x52eb03[_0x1c841b][_0x3dbc('0x7d')][_0x3dbc('0x67')](function(_0x4f34e3){_0x3b2a68[_0x3dbc('0x3e')]['id'][_0x3dbc('0x5c')](_0x4f34e3);});}}}if(!_[_0x3dbc('0x78')](_0x1a2c0a)){_0x3b2a68[_0x3dbc('0x3e')]=_[_0x3dbc('0x41')](_0x3b2a68['where'],{'$and':{'$or':_0x1a2c0a}});}_0x3b2a68=_[_0x3dbc('0x41')]({},_0x3b2a68,_0x123633[_0x3dbc('0x48')]);if(_0x57ca83&&!_0x57ca83['autoAssociation']&&_0x170508[_0x3dbc('0x74')]===_0x3dbc('0x7b')){if(_0x123633[_0x3dbc('0x35')][_0x3dbc('0x44')]){_0x3b2a68['include']=[{'all':!![]}];}return db[_0x170508[_0x3dbc('0x74')]][_0x3dbc('0x5f')](_0x3b2a68)[_0x3dbc('0x28')](function(_0x488978){var _0x38d28f=[];_0x488978['forEach'](function(_0x1da3a5){var _0x39698a;switch(_0x1da3a5[_0x3dbc('0x7e')]){case _0x3dbc('0x7f'):_0x39698a=_[_0x3dbc('0x5a')](_0x57ca83[_0x3dbc('0x7d')],function(_0x5e2674){return _0x5e2674['id']===_0x1da3a5[_0x3dbc('0x80')]&&_0x5e2674['type']==='DefaultReports';});break;case _0x3dbc('0x81'):_0x39698a=_[_0x3dbc('0x5a')](_0x57ca83[_0x3dbc('0x7d')],function(_0x138a29){return _0x138a29['id']===_0x1da3a5[_0x3dbc('0x80')]&&_0x138a29[_0x3dbc('0x31')]===_0x3dbc('0x82');});break;}if(_0x39698a)_0x38d28f['push'](_0x1da3a5);});_0x14b722[_0x3dbc('0x20')]=_0x38d28f[_0x3dbc('0x3a')];_0x14b722['rows']=_0x38d28f;return _0x14b722;});}else{return db[_0x170508['childModel']][_0x3dbc('0x20')]({'where':_0x3b2a68['where']})[_0x3dbc('0x28')](function(_0x26ff5f){_0x14b722[_0x3dbc('0x20')]=_0x26ff5f;if(_0x123633[_0x3dbc('0x35')]['includeAll']){if(_0x170508[_0x3dbc('0x74')]===_0x3dbc('0x83')){_0x3b2a68['include']=[{'model':db[_0x3dbc('0x84')],'as':_0x3dbc('0x85'),'attributes':['id',_0x3dbc('0x2c'),'color'],'required':_0x123633['query'][_0x3dbc('0x86')]?!![]:![]},{'model':db[_0x3dbc('0x84')],'as':'ThroughTags','attributes':['id',_0x3dbc('0x2c'),_0x3dbc('0x87')],'through':_0x123633[_0x3dbc('0x35')][_0x3dbc('0x86')]?{'attributes':[],'where':{'TagId':_0x123633[_0x3dbc('0x35')][_0x3dbc('0x86')]||undefined}}:{},'required':_0x123633[_0x3dbc('0x35')]['tag']?!![]:![]}];}else{_0x3b2a68['include']=[{'all':!![]}];}}return db[_0x170508[_0x3dbc('0x74')]]['findAll'](_0x3b2a68);})['then'](function(_0x2bbb3c){_0x14b722[_0x3dbc('0x46')]=_0x2bbb3c;return _0x14b722;});}}else{return _0x14b722;}})[_0x3dbc('0x28')](respondWithFilteredResult(_0x45892c,_0x3b2a68))[_0x3dbc('0x47')](handleError(_0x45892c,null));};function getAllResources(_0xba7d23,_0x59431e){return new BPromise(function(_0x181938,_0xbecc95){if(_0x59431e){var _0x3035ad=_0x59431e[_0x3dbc('0x43')]?{[_0x59431e[_0x3dbc('0x43')][_0x3dbc('0x7a')]]:_0x59431e[_0x3dbc('0x43')][_0x3dbc('0x88')]}:undefined;return db[_0xba7d23][_0x3dbc('0x5f')]({'where':_0x3035ad,'raw':!![]})['then'](function(_0x4b46b6){_0x59431e['associatedResources']=_[_0x3dbc('0x34')](_0x4b46b6,'id');_0x181938(_0x59431e);})['catch'](function(_0x1d07ff){_0xbecc95(_0x1d07ff);});}else{_0x181938(null);}});}function getAllFilteredResources(_0x9588e7,_0xf29603){return new BPromise(function(_0x53fd7e,_0x27e7de){var _0x4dfe30=_0x9588e7[_0x3dbc('0x43')]?{[_0x9588e7[_0x3dbc('0x43')][_0x3dbc('0x7a')]]:_0x9588e7[_0x3dbc('0x43')][_0x3dbc('0x88')]}:undefined;return db[_0x9588e7[_0x3dbc('0x33')]]['findAll']({'where':_0x4dfe30,'raw':!![]})[_0x3dbc('0x28')](function(_0x49d5dd){_0xf29603[_0x3dbc('0x7d')]=_[_0x3dbc('0x34')](_0x49d5dd,function(_0x41d1d1){return _0x41d1d1['name'];});_0x53fd7e(_0xf29603);})['catch'](function(_0x2af002){_0x27e7de(_0x2af002);});});}function getAllowedResources(_0x44f4c2,_0x29f42b,_0x7c30cf){return new BPromise(function(_0x1c5ed8,_0x696df1){if(_0x29f42b){return db[_0x3dbc('0x57')][_0x3dbc('0x5f')]({'where':{'sectionId':_0x29f42b['id']},'raw':!![]})[_0x3dbc('0x28')](function(_0x1ebe45){if(_0x44f4c2[_0x3dbc('0x7a')]&&_0x44f4c2[_0x3dbc('0x7a')]!=='id'){_0x29f42b[_0x3dbc('0x7d')]=_['map'](_0x1ebe45,function(_0x1ef76c){return _0x1ef76c[_0x44f4c2[_0x3dbc('0x7a')]];});}else{if(_0x7c30cf===_0x3dbc('0x7b')){_0x29f42b['associatedResources']=_[_0x3dbc('0x34')](_0x1ebe45,function(_0x2c0674){return{'id':_0x2c0674['resourceId'],'type':_0x2c0674['type']};});}else{_0x29f42b[_0x3dbc('0x7d')]=_[_0x3dbc('0x34')](_0x1ebe45,function(_0x47ab91){return _0x47ab91[_0x3dbc('0x68')];});}}_0x1c5ed8(_0x29f42b);})['catch'](function(_0x2d159c){_0x696df1(_0x2d159c);});}else{_0x1c5ed8(null);}});}function getQueryModels(_0x43359c,_0x2a4253){var _0x330bf2=_0x43359c[_0x3dbc('0x89')]();var _0x5da1b3={'childModel':undefined,'parentSections':[]};switch(_0x330bf2){case _0x3dbc('0x8a'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x8b');break;case _0x3dbc('0x8c'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x8d');break;case _0x3dbc('0x8e'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x8f');_0x5da1b3[_0x3dbc('0x75')]=[{'name':'SquareProjects','field':_0x3dbc('0x2c'),'foreignKey':'projectName'}];break;case'projects':_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x90');break;case _0x3dbc('0x91'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x83');_0x5da1b3[_0x3dbc('0x75')]=[{'name':_0x3dbc('0x92'),'field':'id','foreignKey':_0x3dbc('0x93')}];break;case _0x3dbc('0x94'):_0x5da1b3['childModel']=_0x3dbc('0x95');break;case _0x3dbc('0x96'):_0x5da1b3['childModel']=_0x3dbc('0x97');break;case'globalcustomfields':_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x98');break;case'chatqueues':_0x5da1b3['childModel']=_0x3dbc('0x99');break;case _0x3dbc('0x9a'):_0x5da1b3['childModel']=_0x3dbc('0x9b');break;case _0x3dbc('0x9c'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x9d');break;case _0x3dbc('0x9e'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x9f');break;case _0x3dbc('0xa0'):case _0x3dbc('0xa1'):case _0x3dbc('0xa2'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xa3');break;case _0x3dbc('0xa4'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xa5');break;case _0x3dbc('0xa6'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xa7');break;case _0x3dbc('0xa8'):_0x5da1b3[_0x3dbc('0x74')]='VoiceRecording';_0x5da1b3[_0x3dbc('0x75')]=[{'name':_0x3dbc('0xa9'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':'role','value':[_0x3dbc('0xaa')]}},{'name':_0x3dbc('0xab'),'field':'name','foreignKey':_0x3dbc('0xac'),'model':_0x3dbc('0xad'),'filter':{'field':_0x3dbc('0xae'),'value':[_0x3dbc('0xaf')]}},{'name':_0x3dbc('0xb0'),'field':_0x3dbc('0x2c'),'foreignKey':'queue','model':_0x3dbc('0xb1'),'filter':{'field':_0x3dbc('0x31'),'value':[_0x3dbc('0xb2')]}},{'name':'QueueCampaigns','field':'name','foreignKey':_0x3dbc('0xb3'),'model':_0x3dbc('0xb1'),'filter':{'field':_0x3dbc('0x31'),'value':[_0x3dbc('0xb4')]}}];break;case _0x3dbc('0xb5'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xb6');break;case _0x3dbc('0xb7'):_0x5da1b3['childModel']=_0x3dbc('0xb8');break;case _0x3dbc('0xb9'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xba');break;case _0x3dbc('0xbb'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xbc');break;case _0x3dbc('0xbd'):_0x5da1b3[_0x3dbc('0x74')]='MailQueue';break;case _0x3dbc('0xbe'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xbf');break;case _0x3dbc('0xc0'):_0x5da1b3['childModel']='MailSubstatus';break;case _0x3dbc('0xc1'):_0x5da1b3[_0x3dbc('0x74')]='OpenchannelQueue';break;case _0x3dbc('0xc2'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xc3');break;case _0x3dbc('0xc4'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xc5');break;case _0x3dbc('0xc6'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xc7');break;case _0x3dbc('0xc8'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xc9');break;case _0x3dbc('0xca'):case _0x3dbc('0xcb'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xb1');if(_0x2a4253){_0x5da1b3[_0x3dbc('0x75')]=[{'name':'VoiceQueues'},{'name':'QueueCampaigns'}];}break;case _0x3dbc('0xcc'):case _0x3dbc('0xcd'):case'telephones':_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xad');if(_0x2a4253){_0x5da1b3[_0x3dbc('0x75')]=[{'name':_0x3dbc('0xce'),'filter':{'field':'role','value':['admin',_0x3dbc('0xcf')]},'ignore':!![]},{'name':_0x3dbc('0xa9')},{'name':_0x3dbc('0xab')}];}break;case _0x3dbc('0xd0'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xd1');break;case _0x3dbc('0xd2'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xd3');break;case _0x3dbc('0xd4'):_0x5da1b3[_0x3dbc('0x74')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x5da1b3['childModel']='SugarcrmAccount';break;case _0x3dbc('0xd5'):_0x5da1b3['childModel']=_0x3dbc('0xd6');break;case _0x3dbc('0xd7'):_0x5da1b3['childModel']=_0x3dbc('0xd8');break;case'vtigeraccounts':_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xad');break;case'cannedanswers':_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xd9');break;case _0x3dbc('0xda'):_0x5da1b3[_0x3dbc('0x74')]='Disposition';break;case _0x3dbc('0xdb'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x66');break;case _0x3dbc('0xdc'):_0x5da1b3['childModel']=_0x3dbc('0xdd');break;case _0x3dbc('0xde'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xdf');break;case _0x3dbc('0xe0'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xe1');break;case'sounds':_0x5da1b3[_0x3dbc('0x74')]='Sound';break;case'tags':_0x5da1b3[_0x3dbc('0x74')]='Tag';break;case _0x3dbc('0xe2'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xe3');break;case'triggers':_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xe4');break;case _0x3dbc('0xe5'):_0x5da1b3['childModel']=_0x3dbc('0xe6');break;case _0x3dbc('0xe7'):_0x5da1b3[_0x3dbc('0x74')]='Variable';break;case _0x3dbc('0xe8'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x69');break;case'extractedreports':_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0x7b');_0x5da1b3['parentSections']=[{'name':_0x3dbc('0xe9'),'field':'id','foreignKey':_0x3dbc('0x80')}];break;case _0x3dbc('0xea'):_0x5da1b3[_0x3dbc('0x74')]=_0x3dbc('0xeb');break;default:return _0x5da1b3;}return _0x5da1b3;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 41e123a..150fc21 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 _0x87ea=['save','emit','hook','exports','../../mysqldb','UserProfile'];(function(_0xeb94a4,_0x166c7b){var _0x5a9285=function(_0x5b0677){while(--_0x5b0677){_0xeb94a4['push'](_0xeb94a4['shift']());}};_0x5a9285(++_0x166c7b);}(_0x87ea,0x14e));var _0xa87e=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x87ea[_0x462999];return _0x4b1366;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa87e('0x0'))['db'][_0xa87e('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa87e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1cd493){return function(_0x409e6b,_0x508273,_0x3953c2){UserProfileEvents[_0xa87e('0x3')](_0x1cd493+':'+_0x409e6b['id'],_0x409e6b);UserProfileEvents['emit'](_0x1cd493,_0x409e6b);_0x3953c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xa87e('0x4')](e,emitEvent(event));}}module[_0xa87e('0x5')]=UserProfileEvents; \ No newline at end of file +var _0x2e19=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','events'];(function(_0x47fdad,_0x5f1afa){var _0x308a5a=function(_0x96818f){while(--_0x96818f){_0x47fdad['push'](_0x47fdad['shift']());}};_0x308a5a(++_0x5f1afa);}(_0x2e19,0x8b));var _0x92e1=function(_0x2213fa,_0x459bc2){_0x2213fa=_0x2213fa-0x0;var _0x6ec7f2=_0x2e19[_0x2213fa];return _0x6ec7f2;};'use strict';var EventEmitter=require(_0x92e1('0x0'));var UserProfile=require(_0x92e1('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x92e1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x92e1('0x3'),'afterDestroy':_0x92e1('0x4')};function emitEvent(_0x275338){return function(_0xcb064,_0x53e5dd,_0x275222){UserProfileEvents[_0x92e1('0x5')](_0x275338+':'+_0xcb064['id'],_0xcb064);UserProfileEvents[_0x92e1('0x5')](_0x275338,_0xcb064);_0x275222(null);};}for(var e in events){if(events[_0x92e1('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index d2b2ca3..5e4f9cd 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 _0x7467=['bluebird','request-promise','path','rimraf','./userProfile.attributes','define','user_profiles','util','../../config/logger','api'];(function(_0x349a38,_0x2d6f78){var _0x55521b=function(_0x51b5bb){while(--_0x51b5bb){_0x349a38['push'](_0x349a38['shift']());}};_0x55521b(++_0x2d6f78);}(_0x7467,0x183));var _0x7746=function(_0x5c21df,_0x49e632){_0x5c21df=_0x5c21df-0x0;var _0x35eaa5=_0x7467[_0x5c21df];return _0x35eaa5;};'use strict';var _=require('lodash');var util=require(_0x7746('0x0'));var logger=require(_0x7746('0x1'))(_0x7746('0x2'));var moment=require('moment');var BPromise=require(_0x7746('0x3'));var rp=require(_0x7746('0x4'));var fs=require('fs');var path=require(_0x7746('0x5'));var rimraf=require(_0x7746('0x6'));var config=require('../../config/environment');var attributes=require(_0x7746('0x7'));module['exports']=function(_0x5e7091,_0x3c3e4b){return _0x5e7091[_0x7746('0x8')]('UserProfile',attributes,{'tableName':_0x7746('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80d5=['UserProfile','api','request-promise','path','./userProfile.attributes','exports'];(function(_0x18da77,_0x3976ac){var _0x25c82b=function(_0x1a2a9f){while(--_0x1a2a9f){_0x18da77['push'](_0x18da77['shift']());}};_0x25c82b(++_0x3976ac);}(_0x80d5,0x163));var _0x580d=function(_0x272696,_0x3c1916){_0x272696=_0x272696-0x0;var _0x21b7c6=_0x80d5[_0x272696];return _0x21b7c6;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x580d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x580d('0x1'));var fs=require('fs');var path=require(_0x580d('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x580d('0x3'));module[_0x580d('0x4')]=function(_0x5a230b,_0xf25c5b){return _0x5a230b['define'](_0x580d('0x5'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6be92d1..fe688e1 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 _0x5fc3=['register','request','then','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x2e0206,_0x7882a6){var _0x359f8f=function(_0x24abbb){while(--_0x24abbb){_0x2e0206['push'](_0x2e0206['shift']());}};_0x359f8f(++_0x7882a6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0x5fc3[_0x33080e];return _0x407395;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x35fc('0xa')]=_['defaults'](config[_0x35fc('0xa')],{'host':_0x35fc('0xb'),'port':0x18eb});var socket=require(_0x35fc('0xc'))(new Redis(config[_0x35fc('0xa')]));require(_0x35fc('0xd'))[_0x35fc('0xe')](socket);function respondWithRpcPromise(_0x2051ab,_0x565f95,_0x1083a9){return new BPromise(function(_0x2a1084,_0x4fdca1){return client[_0x35fc('0xf')](_0x2051ab,_0x1083a9)[_0x35fc('0x10')](function(_0x5021d4){logger[_0x35fc('0x11')](_0x35fc('0x12'),_0x565f95,'request\x20sent');logger['debug'](_0x35fc('0x13'),_0x565f95,'request\x20sent',JSON[_0x35fc('0x14')](_0x5021d4));if(_0x5021d4[_0x35fc('0x15')]){if(_0x5021d4[_0x35fc('0x15')][_0x35fc('0x16')]===0x1f4){logger[_0x35fc('0x15')]('UserProfile,\x20%s,\x20%s',_0x565f95,_0x5021d4['error']['message']);return _0x4fdca1(_0x5021d4['error'][_0x35fc('0x17')]);}logger[_0x35fc('0x15')](_0x35fc('0x12'),_0x565f95,_0x5021d4[_0x35fc('0x15')][_0x35fc('0x17')]);return _0x2a1084(_0x5021d4[_0x35fc('0x15')]['message']);}else{logger[_0x35fc('0x11')](_0x35fc('0x12'),_0x565f95,'request\x20sent');_0x2a1084(_0x5021d4[_0x35fc('0x18')][_0x35fc('0x17')]);}})[_0x35fc('0x19')](function(_0x5f56c6){logger[_0x35fc('0x15')](_0x35fc('0x12'),_0x565f95,_0x5f56c6);_0x4fdca1(_0x5f56c6);});});} \ No newline at end of file +var _0xb4c7=['./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost'];(function(_0x1a450a,_0x4dcb72){var _0x4f8ef4=function(_0x44c6ba){while(--_0x44c6ba){_0x1a450a['push'](_0x1a450a['shift']());}};_0x4f8ef4(++_0x4dcb72);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4dc775,_0x1b14ce){_0x4dc775=_0x4dc775-0x0;var _0x2b3632=_0xb4c7[_0x4dc775];return _0x2b3632;};'use strict';var _=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var moment=require(_0x7b4c('0x2'));var BPromise=require(_0x7b4c('0x3'));var rs=require(_0x7b4c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b4c('0x5'))['db'];var utils=require(_0x7b4c('0x6'));var logger=require(_0x7b4c('0x7'))(_0x7b4c('0x8'));var config=require(_0x7b4c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7b4c('0xa')][_0x7b4c('0xb')]({'port':0x232a});config[_0x7b4c('0xc')]=_['defaults'](config[_0x7b4c('0xc')],{'host':_0x7b4c('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7b4c('0xc')]));require(_0x7b4c('0xe'))[_0x7b4c('0xf')](socket);function respondWithRpcPromise(_0x237e28,_0x365225,_0x93d013){return new BPromise(function(_0x1a996f,_0xc62104){return client[_0x7b4c('0x10')](_0x237e28,_0x93d013)[_0x7b4c('0x11')](function(_0x5d5bc3){logger['info'](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));logger[_0x7b4c('0x14')](_0x7b4c('0x15'),_0x365225,_0x7b4c('0x13'),JSON[_0x7b4c('0x16')](_0x5d5bc3));if(_0x5d5bc3[_0x7b4c('0x17')]){if(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x18')]===0x1f4){logger[_0x7b4c('0x17')]('UserProfile,\x20%s,\x20%s',_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0xc62104(_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);}logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x5d5bc3[_0x7b4c('0x17')][_0x7b4c('0x19')]);return _0x1a996f(_0x5d5bc3['error'][_0x7b4c('0x19')]);}else{logger[_0x7b4c('0x1a')](_0x7b4c('0x12'),_0x365225,_0x7b4c('0x13'));_0x1a996f(_0x5d5bc3['result'][_0x7b4c('0x19')]);}})[_0x7b4c('0x1b')](function(_0x32110e){logger[_0x7b4c('0x17')](_0x7b4c('0x12'),_0x365225,_0x32110e);_0xc62104(_0x32110e);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 21ae39c..ecc664e 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 _0x5786=['emit','removeListener','register','userProfile:','./userProfile.events','save','update'];(function(_0x261a67,_0x124a66){var _0x1221a=function(_0x3f851c){while(--_0x3f851c){_0x261a67['push'](_0x261a67['shift']());}};_0x1221a(++_0x124a66);}(_0x5786,0xeb));var _0x6578=function(_0xe495f0,_0x35f7fc){_0xe495f0=_0xe495f0-0x0;var _0x32aaff=_0x5786[_0xe495f0];return _0x32aaff;};'use strict';var UserProfileEvents=require(_0x6578('0x0'));var events=[_0x6578('0x1'),'remove',_0x6578('0x2')];function createListener(_0x3f7f74,_0x3467c7){return function(_0x3acf49){_0x3467c7[_0x6578('0x3')](_0x3f7f74,_0x3acf49);};}function removeListener(_0x2450d8,_0x3ad4df){return function(){UserProfileEvents[_0x6578('0x4')](_0x2450d8,_0x3ad4df);};}exports[_0x6578('0x5')]=function(_0x388676){for(var _0x18dae9=0x0,_0x58db61=events['length'];_0x18dae9<_0x58db61;_0x18dae9++){var _0x54783b=events[_0x18dae9];var _0x25e7d9=createListener(_0x6578('0x6')+_0x54783b,_0x388676);UserProfileEvents['on'](_0x54783b,_0x25e7d9);}}; \ No newline at end of file +var _0xc835=['remove','update','emit','removeListener','register','userProfile:','./userProfile.events','save'];(function(_0x3fcf30,_0xe3a49e){var _0x2ed4b0=function(_0x306e68){while(--_0x306e68){_0x3fcf30['push'](_0x3fcf30['shift']());}};_0x2ed4b0(++_0xe3a49e);}(_0xc835,0x1a6));var _0x5c83=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xc835[_0x58965a];return _0x254efc;};'use strict';var UserProfileEvents=require(_0x5c83('0x0'));var events=[_0x5c83('0x1'),_0x5c83('0x2'),_0x5c83('0x3')];function createListener(_0x47e8af,_0x26e51b){return function(_0x29aa03){_0x26e51b[_0x5c83('0x4')](_0x47e8af,_0x29aa03);};}function removeListener(_0x1fdcf7,_0xded07d){return function(){UserProfileEvents[_0x5c83('0x5')](_0x1fdcf7,_0xded07d);};}exports[_0x5c83('0x6')]=function(_0xd4a7ea){for(var _0x310d01=0x0,_0x3c4a1e=events['length'];_0x310d01<_0x3c4a1e;_0x310d01++){var _0x4ad501=events[_0x310d01];var _0x529752=createListener(_0x5c83('0x7')+_0x4ad501,_0xd4a7ea);UserProfileEvents['on'](_0x4ad501,_0x529752);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 8f232fe..a06ae93 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 _0x9ccf=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update'];(function(_0x5aba61,_0x1c4633){var _0x3ed40b=function(_0x554c0f){while(--_0x554c0f){_0x5aba61['push'](_0x5aba61['shift']());}};_0x3ed40b(++_0x1c4633);}(_0x9ccf,0x10f));var _0xf9cc=function(_0x21b653,_0x4363ee){_0x21b653=_0x21b653-0x0;var _0x160c54=_0x9ccf[_0x21b653];return _0x160c54;};'use strict';var multer=require(_0xf9cc('0x0'));var util=require('util');var path=require(_0xf9cc('0x1'));var timeout=require(_0xf9cc('0x2'));var express=require(_0xf9cc('0x3'));var router=express['Router']();var auth=require(_0xf9cc('0x4'));var interaction=require(_0xf9cc('0x5'));var config=require(_0xf9cc('0x6'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xf9cc('0x7')](),controller['index']);router[_0xf9cc('0x8')](_0xf9cc('0x9'),auth[_0xf9cc('0x7')](),controller[_0xf9cc('0xa')]);router[_0xf9cc('0x8')](_0xf9cc('0xb'),auth['isAuthenticated'](),controller[_0xf9cc('0xc')]);router[_0xf9cc('0xd')]('/',auth[_0xf9cc('0x7')](),controller[_0xf9cc('0xe')]);router[_0xf9cc('0xf')](_0xf9cc('0xb'),auth['isAuthenticated'](),controller[_0xf9cc('0x10')]);router['delete'](_0xf9cc('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xf9cc('0x11')]=router; \ No newline at end of file +var _0xbed3=['/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated'];(function(_0x5165ff,_0x57263a){var _0x48472b=function(_0x2acceb){while(--_0x2acceb){_0x5165ff['push'](_0x5165ff['shift']());}};_0x48472b(++_0x57263a);}(_0xbed3,0x81));var _0x3bed=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbed3[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x3bed('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3bed('0x1'));var express=require(_0x3bed('0x2'));var router=express[_0x3bed('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3bed('0x4'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0x3bed('0x5')]('/',auth[_0x3bed('0x6')](),controller['index']);router[_0x3bed('0x5')](_0x3bed('0x7'),auth[_0x3bed('0x6')](),controller[_0x3bed('0x8')]);router['get'](_0x3bed('0x9'),auth['isAuthenticated'](),controller[_0x3bed('0xa')]);router[_0x3bed('0xb')]('/',auth[_0x3bed('0x6')](),controller[_0x3bed('0xc')]);router[_0x3bed('0xd')]('/:id',auth[_0x3bed('0x6')](),controller[_0x3bed('0xe')]);router['delete'](_0x3bed('0x9'),auth[_0x3bed('0x6')](),controller[_0x3bed('0xf')]);module[_0x3bed('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 19afc0c..11ed881 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 _0x99ed=['STRING','INTEGER','sequelize','exports'];(function(_0x38a86c,_0xbffba4){var _0x7a5e15=function(_0x4f2ee2){while(--_0x4f2ee2){_0x38a86c['push'](_0x38a86c['shift']());}};_0x7a5e15(++_0xbffba4);}(_0x99ed,0x7a));var _0xd99e=function(_0x2d28ff,_0x4d87fa){_0x2d28ff=_0x2d28ff-0x0;var _0x582838=_0x99ed[_0x2d28ff];return _0x582838;};'use strict';var Sequelize=require(_0xd99e('0x0'));module[_0xd99e('0x1')]={'name':{'type':Sequelize[_0xd99e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd99e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd99e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2e8f=['exports','STRING','INTEGER'];(function(_0x15bb5a,_0x2e78ba){var _0x1e5c44=function(_0x9bcdd6){while(--_0x9bcdd6){_0x15bb5a['push'](_0x15bb5a['shift']());}};_0x1e5c44(++_0x2e78ba);}(_0x2e8f,0x7e));var _0xf2e8=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x2e8f[_0x4eafed];return _0x159c85;};'use strict';var Sequelize=require('sequelize');module[_0xf2e8('0x0')]={'name':{'type':Sequelize[_0xf2e8('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xf2e8('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 126a17a..8ea2eae 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 _0xbd5a=['save','update','then','destroy','error','stack','name','send','index','UserProfileResource','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','rawAttributes','keys','options','create','body','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x16d21e,_0x362eab){var _0x45d4e2=function(_0x5bbea9){while(--_0x5bbea9){_0x16d21e['push'](_0x16d21e['shift']());}};_0x45d4e2(++_0x362eab);}(_0xbd5a,0x78));var _0xabd5=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbd5a[_0x23e7c1];return _0x1add43;};'use strict';var pdf=require(_0xabd5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xabd5('0x1'));var zipdir=require(_0xabd5('0x2'));var jsonpatch=require(_0xabd5('0x3'));var rp=require(_0xabd5('0x4'));var moment=require(_0xabd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xabd5('0x6'));var util=require('util');var path=require('path');var sox=require(_0xabd5('0x7'));var csv=require('to-csv');var ejs=require(_0xabd5('0x8'));var fs=require('fs');var _=require(_0xabd5('0x9'));var squel=require(_0xabd5('0xa'));var crypto=require(_0xabd5('0xb'));var jsforce=require(_0xabd5('0xc'));var deskjs=require(_0xabd5('0xd'));var toCsv=require(_0xabd5('0xe'));var querystring=require(_0xabd5('0xf'));var Papa=require(_0xabd5('0x10'));var Redis=require(_0xabd5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xabd5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xabd5('0x13'))(_0xabd5('0x14'));var utils=require(_0xabd5('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4961e0,_0x1f9092){_0x1f9092=_0x1f9092||0xcc;return function(_0x3bb742){if(_0x3bb742){return _0x4961e0[_0xabd5('0x16')](_0x1f9092);}return _0x4961e0['status'](_0x1f9092)[_0xabd5('0x17')]();};}function respondWithResult(_0x218ca4,_0xf37f5d){_0xf37f5d=_0xf37f5d||0xc8;return function(_0x28536c){if(_0x28536c){return _0x218ca4[_0xabd5('0x18')](_0xf37f5d)['json'](_0x28536c);}};}function respondWithFilteredResult(_0x6c35df,_0x39d5e0){return function(_0x1411b3){if(_0x1411b3){var _0x4a903a=_0x1411b3['count'],_0x509ff0=_0x39d5e0[_0xabd5('0x19')],_0x3c27f4=_0x39d5e0['offset']+_0x39d5e0[_0xabd5('0x1a')],_0x537edc;if(_0x3c27f4>=_0x4a903a){_0x3c27f4=_0x4a903a;_0x537edc=0xc8;}else{_0x537edc=0xce;}_0x6c35df[_0xabd5('0x18')](_0x537edc);return _0x6c35df[_0xabd5('0x1b')](_0xabd5('0x1c'),_0x509ff0+'-'+_0x3c27f4+'/'+_0x4a903a)[_0xabd5('0x1d')](_0x1411b3);}return null;};}function patchUpdates(_0x106592){return function(_0x5b1ead){try{jsonpatch[_0xabd5('0x1e')](_0x5b1ead,_0x106592,!![]);}catch(_0x3c1743){return BPromise[_0xabd5('0x1f')](_0x3c1743);}return _0x5b1ead[_0xabd5('0x20')]();};}function saveUpdates(_0x4ca290,_0x198a3c){return function(_0x4c357e){if(_0x4c357e){return _0x4c357e[_0xabd5('0x21')](_0x4ca290)[_0xabd5('0x22')](function(_0x14d95a){return _0x14d95a;});}return null;};}function removeEntity(_0x451286,_0x2f6cef){return function(_0x15730c){if(_0x15730c){return _0x15730c[_0xabd5('0x23')]()['then'](function(){_0x451286[_0xabd5('0x18')](0xcc)[_0xabd5('0x17')]();});}};}function handleEntityNotFound(_0x574c59,_0x5b4b79){return function(_0x520f71){if(!_0x520f71){_0x574c59[_0xabd5('0x16')](0x194);}return _0x520f71;};}function handleError(_0x363fe9,_0x5f4830){_0x5f4830=_0x5f4830||0x1f4;return function(_0x10c25e){logger[_0xabd5('0x24')](_0x10c25e[_0xabd5('0x25')]);if(_0x10c25e[_0xabd5('0x26')]){delete _0x10c25e[_0xabd5('0x26')];}_0x363fe9[_0xabd5('0x18')](_0x5f4830)[_0xabd5('0x27')](_0x10c25e);};}exports[_0xabd5('0x28')]=function(_0xf7069e,_0x354390){var _0x2f0996={},_0x36bb1c={},_0x45c31c={'count':0x0,'rows':[]};var _0x1c00d2=_['map'](db[_0xabd5('0x29')]['rawAttributes'],function(_0x43135a){return{'name':_0x43135a[_0xabd5('0x2a')],'type':_0x43135a['type'][_0xabd5('0x2b')]};});_0x36bb1c[_0xabd5('0x2c')]=_[_0xabd5('0x2d')](_0x1c00d2,'name');_0x36bb1c[_0xabd5('0x2e')]=_['keys'](_0xf7069e[_0xabd5('0x2e')]);_0x36bb1c[_0xabd5('0x2f')]=_[_0xabd5('0x30')](_0x36bb1c[_0xabd5('0x2c')],_0x36bb1c[_0xabd5('0x2e')]);_0x2f0996[_0xabd5('0x31')]=_[_0xabd5('0x30')](_0x36bb1c[_0xabd5('0x2c')],qs[_0xabd5('0x32')](_0xf7069e[_0xabd5('0x2e')]['fields']));_0x2f0996[_0xabd5('0x31')]=_0x2f0996['attributes'][_0xabd5('0x33')]?_0x2f0996[_0xabd5('0x31')]:_0x36bb1c[_0xabd5('0x2c')];if(!_0xf7069e['query'][_0xabd5('0x34')](_0xabd5('0x35'))){_0x2f0996[_0xabd5('0x1a')]=qs[_0xabd5('0x1a')](_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x1a')]);_0x2f0996[_0xabd5('0x19')]=qs[_0xabd5('0x19')](_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x19')]);}_0x2f0996[_0xabd5('0x36')]=qs['sort'](_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x37')]);_0x2f0996[_0xabd5('0x38')]=qs[_0xabd5('0x2f')](_[_0xabd5('0x39')](_0xf7069e[_0xabd5('0x2e')],_0x36bb1c[_0xabd5('0x2f')]));if(_0xf7069e[_0xabd5('0x2e')]['filter']){_0x2f0996[_0xabd5('0x38')]=_[_0xabd5('0x3a')](_0x2f0996['where'],{'$or':_[_0xabd5('0x2d')](_0x1c00d2,function(_0x4bd149){if(_0x4bd149[_0xabd5('0x3b')]!==_0xabd5('0x3c')){var _0x19749f={};_0x19749f[_0x4bd149[_0xabd5('0x26')]]={'$like':'%'+_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x3d')]+'%'};return _0x19749f;}})});}_0x2f0996=_['merge']({},_0x2f0996,_0xf7069e['options']);var _0x27b306={'where':_0x2f0996['where']};return db[_0xabd5('0x29')][_0xabd5('0x3e')](_0x27b306)['then'](function(_0xde0b48){_0x45c31c[_0xabd5('0x3e')]=_0xde0b48;if(_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x3f')]){_0x2f0996[_0xabd5('0x40')]=[{'all':!![]}];}return db[_0xabd5('0x29')][_0xabd5('0x41')](_0x2f0996);})[_0xabd5('0x22')](function(_0x49410f){_0x45c31c[_0xabd5('0x42')]=_0x49410f;return _0x45c31c;})[_0xabd5('0x22')](respondWithFilteredResult(_0x354390,_0x2f0996))[_0xabd5('0x43')](handleError(_0x354390,null));};exports['show']=function(_0x3beca1,_0x589903){var _0x53ee99={'raw':![],'where':{'id':_0x3beca1['params']['id']}},_0x18b9d9={};_0x18b9d9[_0xabd5('0x2c')]=_['keys'](db[_0xabd5('0x29')][_0xabd5('0x44')]);_0x18b9d9[_0xabd5('0x2e')]=_[_0xabd5('0x45')](_0x3beca1['query']);_0x18b9d9['filters']=_[_0xabd5('0x30')](_0x18b9d9[_0xabd5('0x2c')],_0x18b9d9[_0xabd5('0x2e')]);_0x53ee99[_0xabd5('0x31')]=_['intersection'](_0x18b9d9[_0xabd5('0x2c')],qs[_0xabd5('0x32')](_0x3beca1[_0xabd5('0x2e')]['fields']));_0x53ee99['attributes']=_0x53ee99['attributes']['length']?_0x53ee99[_0xabd5('0x31')]:_0x18b9d9[_0xabd5('0x2c')];if(_0x3beca1['query'][_0xabd5('0x3f')]){_0x53ee99[_0xabd5('0x40')]=[{'all':!![]}];}_0x53ee99=_[_0xabd5('0x3a')]({},_0x53ee99,_0x3beca1[_0xabd5('0x46')]);return db[_0xabd5('0x29')]['find'](_0x53ee99)[_0xabd5('0x22')](handleEntityNotFound(_0x589903,null))['then'](respondWithResult(_0x589903,null))[_0xabd5('0x43')](handleError(_0x589903,null));};exports[_0xabd5('0x47')]=function(_0x1232a7,_0x5d01d7){return db['UserProfileResource'][_0xabd5('0x47')](_0x1232a7[_0xabd5('0x48')],{})[_0xabd5('0x22')](respondWithResult(_0x5d01d7,0xc9))[_0xabd5('0x43')](handleError(_0x5d01d7,null));};exports['update']=function(_0x5e9055,_0x1c02c3){if(_0x5e9055[_0xabd5('0x48')]['id']){delete _0x5e9055['body']['id'];}return db[_0xabd5('0x29')][_0xabd5('0x49')]({'where':{'id':_0x5e9055[_0xabd5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c02c3,null))[_0xabd5('0x22')](saveUpdates(_0x5e9055['body'],null))['then'](respondWithResult(_0x1c02c3,null))[_0xabd5('0x43')](handleError(_0x1c02c3,null));};exports['destroy']=function(_0x3fcccd,_0x443732){return db[_0xabd5('0x29')][_0xabd5('0x49')]({'where':{'id':_0x3fcccd[_0xabd5('0x4a')]['id']}})[_0xabd5('0x22')](handleEntityNotFound(_0x443732,null))[_0xabd5('0x22')](removeEntity(_0x443732,null))[_0xabd5('0x43')](handleError(_0x443732,null));};exports[_0xabd5('0x4b')]=function(_0x5271c4,_0x3cc0ea){return db[_0xabd5('0x29')][_0xabd5('0x4b')]()[_0xabd5('0x22')](respondWithResult(_0x3cc0ea,null))[_0xabd5('0x43')](handleError(_0x3cc0ea,null));}; \ No newline at end of file +var _0xc2e2=['util','path','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','update','then','error','name','send','UserProfileResource','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','options','includeAll','findAll','rows','catch','show','include','merge','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x5a3a29,_0x84b551){var _0x17f9b8=function(_0x137866){while(--_0x137866){_0x5a3a29['push'](_0x5a3a29['shift']());}};_0x17f9b8(++_0x84b551);}(_0xc2e2,0x1a4));var _0x2c2e=function(_0x2ebbe5,_0x440ffd){_0x2ebbe5=_0x2ebbe5-0x0;var _0x5c73ad=_0xc2e2[_0x2ebbe5];return _0x5c73ad;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2c2e('0x0'));var rimraf=require(_0x2c2e('0x1'));var zipdir=require(_0x2c2e('0x2'));var jsonpatch=require(_0x2c2e('0x3'));var rp=require(_0x2c2e('0x4'));var moment=require('moment');var BPromise=require(_0x2c2e('0x5'));var Mustache=require('mustache');var util=require(_0x2c2e('0x6'));var path=require(_0x2c2e('0x7'));var sox=require('sox');var csv=require(_0x2c2e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2c2e('0x9'));var squel=require('squel');var crypto=require(_0x2c2e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2c2e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x2c2e('0xc'));var Papa=require(_0x2c2e('0xd'));var Redis=require(_0x2c2e('0xe'));var authService=require(_0x2c2e('0xf'));var qs=require(_0x2c2e('0x10'));var as=require(_0x2c2e('0x11'));var hardwareService=require(_0x2c2e('0x12'));var logger=require(_0x2c2e('0x13'))(_0x2c2e('0x14'));var utils=require(_0x2c2e('0x15'));var config=require('../../config/environment');var db=require(_0x2c2e('0x16'))['db'];function respondWithStatusCode(_0x49569d,_0x27ae90){_0x27ae90=_0x27ae90||0xcc;return function(_0x1efdc9){if(_0x1efdc9){return _0x49569d[_0x2c2e('0x17')](_0x27ae90);}return _0x49569d['status'](_0x27ae90)[_0x2c2e('0x18')]();};}function respondWithResult(_0x55b888,_0x54b988){_0x54b988=_0x54b988||0xc8;return function(_0x2b36e1){if(_0x2b36e1){return _0x55b888['status'](_0x54b988)[_0x2c2e('0x19')](_0x2b36e1);}};}function respondWithFilteredResult(_0x20c29b,_0x12ff44){return function(_0x6d9805){if(_0x6d9805){var _0x398b04=_0x6d9805[_0x2c2e('0x1a')],_0x3f35b7=_0x12ff44[_0x2c2e('0x1b')],_0x22f1e7=_0x12ff44[_0x2c2e('0x1b')]+_0x12ff44[_0x2c2e('0x1c')],_0x59639a;if(_0x22f1e7>=_0x398b04){_0x22f1e7=_0x398b04;_0x59639a=0xc8;}else{_0x59639a=0xce;}_0x20c29b[_0x2c2e('0x1d')](_0x59639a);return _0x20c29b[_0x2c2e('0x1e')](_0x2c2e('0x1f'),_0x3f35b7+'-'+_0x22f1e7+'/'+_0x398b04)[_0x2c2e('0x19')](_0x6d9805);}return null;};}function patchUpdates(_0x169cf3){return function(_0x510d2c){try{jsonpatch['apply'](_0x510d2c,_0x169cf3,!![]);}catch(_0x3e4e0d){return BPromise['reject'](_0x3e4e0d);}return _0x510d2c['save']();};}function saveUpdates(_0x2b5dcc,_0x3d6203){return function(_0x512342){if(_0x512342){return _0x512342[_0x2c2e('0x20')](_0x2b5dcc)[_0x2c2e('0x21')](function(_0x36823b){return _0x36823b;});}return null;};}function removeEntity(_0x1905f2,_0x1e312b){return function(_0x4c927f){if(_0x4c927f){return _0x4c927f['destroy']()[_0x2c2e('0x21')](function(){_0x1905f2[_0x2c2e('0x1d')](0xcc)[_0x2c2e('0x18')]();});}};}function handleEntityNotFound(_0x4ff33e,_0x2024bc){return function(_0x1b2caa){if(!_0x1b2caa){_0x4ff33e[_0x2c2e('0x17')](0x194);}return _0x1b2caa;};}function handleError(_0x325e32,_0x400f57){_0x400f57=_0x400f57||0x1f4;return function(_0x4a36ee){logger[_0x2c2e('0x22')](_0x4a36ee['stack']);if(_0x4a36ee[_0x2c2e('0x23')]){delete _0x4a36ee[_0x2c2e('0x23')];}_0x325e32[_0x2c2e('0x1d')](_0x400f57)[_0x2c2e('0x24')](_0x4a36ee);};}exports['index']=function(_0x16dc60,_0x3f707a){var _0xd619c1={},_0x5d54a1={},_0x17ab44={'count':0x0,'rows':[]};var _0x58e2f1=_['map'](db[_0x2c2e('0x25')][_0x2c2e('0x26')],function(_0x40c3e0){return{'name':_0x40c3e0[_0x2c2e('0x27')],'type':_0x40c3e0['type'][_0x2c2e('0x28')]};});_0x5d54a1[_0x2c2e('0x29')]=_[_0x2c2e('0x2a')](_0x58e2f1,'name');_0x5d54a1[_0x2c2e('0x2b')]=_[_0x2c2e('0x2c')](_0x16dc60[_0x2c2e('0x2b')]);_0x5d54a1[_0x2c2e('0x2d')]=_['intersection'](_0x5d54a1[_0x2c2e('0x29')],_0x5d54a1['query']);_0xd619c1[_0x2c2e('0x2e')]=_[_0x2c2e('0x2f')](_0x5d54a1[_0x2c2e('0x29')],qs[_0x2c2e('0x30')](_0x16dc60[_0x2c2e('0x2b')][_0x2c2e('0x30')]));_0xd619c1[_0x2c2e('0x2e')]=_0xd619c1[_0x2c2e('0x2e')][_0x2c2e('0x31')]?_0xd619c1[_0x2c2e('0x2e')]:_0x5d54a1[_0x2c2e('0x29')];if(!_0x16dc60[_0x2c2e('0x2b')][_0x2c2e('0x32')](_0x2c2e('0x33'))){_0xd619c1[_0x2c2e('0x1c')]=qs[_0x2c2e('0x1c')](_0x16dc60[_0x2c2e('0x2b')][_0x2c2e('0x1c')]);_0xd619c1['offset']=qs['offset'](_0x16dc60['query'][_0x2c2e('0x1b')]);}_0xd619c1[_0x2c2e('0x34')]=qs[_0x2c2e('0x35')](_0x16dc60[_0x2c2e('0x2b')][_0x2c2e('0x35')]);_0xd619c1[_0x2c2e('0x36')]=qs[_0x2c2e('0x2d')](_['pick'](_0x16dc60[_0x2c2e('0x2b')],_0x5d54a1[_0x2c2e('0x2d')]));if(_0x16dc60[_0x2c2e('0x2b')][_0x2c2e('0x37')]){_0xd619c1[_0x2c2e('0x36')]=_['merge'](_0xd619c1[_0x2c2e('0x36')],{'$or':_[_0x2c2e('0x2a')](_0x58e2f1,function(_0x1822dc){if(_0x1822dc[_0x2c2e('0x38')]!=='VIRTUAL'){var _0x3d38ce={};_0x3d38ce[_0x1822dc['name']]={'$like':'%'+_0x16dc60[_0x2c2e('0x2b')]['filter']+'%'};return _0x3d38ce;}})});}_0xd619c1=_['merge']({},_0xd619c1,_0x16dc60[_0x2c2e('0x39')]);var _0x859d9c={'where':_0xd619c1[_0x2c2e('0x36')]};return db[_0x2c2e('0x25')]['count'](_0x859d9c)['then'](function(_0x409d34){_0x17ab44['count']=_0x409d34;if(_0x16dc60[_0x2c2e('0x2b')][_0x2c2e('0x3a')]){_0xd619c1['include']=[{'all':!![]}];}return db['UserProfileResource'][_0x2c2e('0x3b')](_0xd619c1);})[_0x2c2e('0x21')](function(_0x4f7643){_0x17ab44[_0x2c2e('0x3c')]=_0x4f7643;return _0x17ab44;})[_0x2c2e('0x21')](respondWithFilteredResult(_0x3f707a,_0xd619c1))[_0x2c2e('0x3d')](handleError(_0x3f707a,null));};exports[_0x2c2e('0x3e')]=function(_0x340aac,_0x2ee0fa){var _0xa1fe1c={'raw':![],'where':{'id':_0x340aac['params']['id']}},_0x5788c6={};_0x5788c6[_0x2c2e('0x29')]=_[_0x2c2e('0x2c')](db[_0x2c2e('0x25')]['rawAttributes']);_0x5788c6['query']=_[_0x2c2e('0x2c')](_0x340aac[_0x2c2e('0x2b')]);_0x5788c6[_0x2c2e('0x2d')]=_[_0x2c2e('0x2f')](_0x5788c6[_0x2c2e('0x29')],_0x5788c6['query']);_0xa1fe1c[_0x2c2e('0x2e')]=_[_0x2c2e('0x2f')](_0x5788c6[_0x2c2e('0x29')],qs[_0x2c2e('0x30')](_0x340aac[_0x2c2e('0x2b')][_0x2c2e('0x30')]));_0xa1fe1c['attributes']=_0xa1fe1c[_0x2c2e('0x2e')][_0x2c2e('0x31')]?_0xa1fe1c[_0x2c2e('0x2e')]:_0x5788c6[_0x2c2e('0x29')];if(_0x340aac[_0x2c2e('0x2b')][_0x2c2e('0x3a')]){_0xa1fe1c[_0x2c2e('0x3f')]=[{'all':!![]}];}_0xa1fe1c=_[_0x2c2e('0x40')]({},_0xa1fe1c,_0x340aac[_0x2c2e('0x39')]);return db[_0x2c2e('0x25')][_0x2c2e('0x41')](_0xa1fe1c)[_0x2c2e('0x21')](handleEntityNotFound(_0x2ee0fa,null))['then'](respondWithResult(_0x2ee0fa,null))['catch'](handleError(_0x2ee0fa,null));};exports[_0x2c2e('0x42')]=function(_0x3db133,_0x5f59ea){return db[_0x2c2e('0x25')]['create'](_0x3db133['body'],{})[_0x2c2e('0x21')](respondWithResult(_0x5f59ea,0xc9))[_0x2c2e('0x3d')](handleError(_0x5f59ea,null));};exports[_0x2c2e('0x20')]=function(_0x16820e,_0x172e5f){if(_0x16820e[_0x2c2e('0x43')]['id']){delete _0x16820e[_0x2c2e('0x43')]['id'];}return db[_0x2c2e('0x25')]['find']({'where':{'id':_0x16820e[_0x2c2e('0x44')]['id']}})['then'](handleEntityNotFound(_0x172e5f,null))[_0x2c2e('0x21')](saveUpdates(_0x16820e[_0x2c2e('0x43')],null))[_0x2c2e('0x21')](respondWithResult(_0x172e5f,null))[_0x2c2e('0x3d')](handleError(_0x172e5f,null));};exports[_0x2c2e('0x45')]=function(_0x421bed,_0x1a2b2d){return db[_0x2c2e('0x25')][_0x2c2e('0x41')]({'where':{'id':_0x421bed[_0x2c2e('0x44')]['id']}})['then'](handleEntityNotFound(_0x1a2b2d,null))[_0x2c2e('0x21')](removeEntity(_0x1a2b2d,null))[_0x2c2e('0x3d')](handleError(_0x1a2b2d,null));};exports['describe']=function(_0x5cef06,_0x5ca2f6){return db[_0x2c2e('0x25')][_0x2c2e('0x46')]()[_0x2c2e('0x21')](respondWithResult(_0x5ca2f6,null))['catch'](handleError(_0x5ca2f6,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index f8924c9..9441c8e 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 _0xaf53=['exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xaf53,0x1f3));var _0x3af5=function(_0x52ba40,_0x48d1c1){_0x52ba40=_0x52ba40-0x0;var _0x10407f=_0xaf53[_0x52ba40];return _0x10407f;};'use strict';var _=require(_0x3af5('0x0'));var util=require(_0x3af5('0x1'));var logger=require(_0x3af5('0x2'))('api');var moment=require(_0x3af5('0x3'));var BPromise=require(_0x3af5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3af5('0x5'));var rimraf=require(_0x3af5('0x6'));var config=require(_0x3af5('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x3af5('0x8')]=function(_0xc2536,_0x10cdb0){return _0xc2536['define'](_0x3af5('0x9'),attributes,{'tableName':_0x3af5('0xa'),'paranoid':![],'indexes':[{'name':_0x3af5('0xb'),'fields':[_0x3af5('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x38b5=['path','rimraf','../../config/environment','./userProfileResource.attributes','define','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','moment','bluebird','request-promise'];(function(_0x5e137d,_0x7eeb8f){var _0x411618=function(_0x2e2820){while(--_0x2e2820){_0x5e137d['push'](_0x5e137d['shift']());}};_0x411618(++_0x7eeb8f);}(_0x38b5,0x1ad));var _0x538b=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x38b5[_0x40911a];return _0x27e8e3;};'use strict';var _=require(_0x538b('0x0'));var util=require(_0x538b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x538b('0x2'));var BPromise=require(_0x538b('0x3'));var rp=require(_0x538b('0x4'));var fs=require('fs');var path=require(_0x538b('0x5'));var rimraf=require(_0x538b('0x6'));var config=require(_0x538b('0x7'));var attributes=require(_0x538b('0x8'));module['exports']=function(_0x53c9d5,_0x50b4e6){return _0x53c9d5[_0x538b('0x9')](_0x538b('0xa'),attributes,{'tableName':_0x538b('0xb'),'paranoid':![],'indexes':[{'name':_0x538b('0xc'),'fields':['resourceId',_0x538b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index ff8bd30..4b337f4 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 _0x13f7=['stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x32a61b,_0x14e5df){var _0x3ae887=function(_0x26b945){while(--_0x26b945){_0x32a61b['push'](_0x32a61b['shift']());}};_0x3ae887(++_0x14e5df);}(_0x13f7,0x151));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x713f('0x0'));var util=require('util');var moment=require(_0x713f('0x1'));var BPromise=require(_0x713f('0x2'));var rs=require(_0x713f('0x3'));var fs=require('fs');var Redis=require(_0x713f('0x4'));var db=require(_0x713f('0x5'))['db'];var utils=require(_0x713f('0x6'));var logger=require(_0x713f('0x7'))(_0x713f('0x8'));var config=require(_0x713f('0x9'));var jayson=require(_0x713f('0xa'));var client=jayson['client'][_0x713f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x482d42,_0x56594c,_0x23288f){return new BPromise(function(_0x30e97d,_0x5b57c){return client['request'](_0x482d42,_0x23288f)['then'](function(_0x186aa6){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x56594c,_0x713f('0xc'));logger[_0x713f('0xd')](_0x713f('0xe'),_0x56594c,_0x713f('0xc'),JSON[_0x713f('0xf')](_0x186aa6));if(_0x186aa6[_0x713f('0x10')]){if(_0x186aa6[_0x713f('0x10')][_0x713f('0x11')]===0x1f4){logger[_0x713f('0x10')](_0x713f('0x12'),_0x56594c,_0x186aa6[_0x713f('0x10')]['message']);return _0x5b57c(_0x186aa6[_0x713f('0x10')][_0x713f('0x13')]);}logger[_0x713f('0x10')](_0x713f('0x12'),_0x56594c,_0x186aa6[_0x713f('0x10')]['message']);return _0x30e97d(_0x186aa6[_0x713f('0x10')][_0x713f('0x13')]);}else{logger[_0x713f('0x14')](_0x713f('0x12'),_0x56594c,_0x713f('0xc'));_0x30e97d(_0x186aa6[_0x713f('0x15')][_0x713f('0x13')]);}})['catch'](function(_0x262727){logger['error'](_0x713f('0x12'),_0x56594c,_0x262727);_0x5b57c(_0x262727);});});} \ No newline at end of file +var _0xa2bb=['UserProfileResource,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','error'];(function(_0x4feaef,_0x17cafc){var _0x1c7982=function(_0x46ca81){while(--_0x46ca81){_0x4feaef['push'](_0x4feaef['shift']());}};_0x1c7982(++_0x17cafc);}(_0xa2bb,0x123));var _0xba2b=function(_0x1c8dce,_0x2dba92){_0x1c8dce=_0x1c8dce-0x0;var _0x29227d=_0xa2bb[_0x1c8dce];return _0x29227d;};'use strict';var _=require('lodash');var util=require(_0xba2b('0x0'));var moment=require(_0xba2b('0x1'));var BPromise=require(_0xba2b('0x2'));var rs=require(_0xba2b('0x3'));var fs=require('fs');var Redis=require(_0xba2b('0x4'));var db=require(_0xba2b('0x5'))['db'];var utils=require(_0xba2b('0x6'));var logger=require(_0xba2b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xba2b('0x8')][_0xba2b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ce11a,_0x141acf,_0x4d950f){return new BPromise(function(_0x5b2f6f,_0x347acd){return client['request'](_0x1ce11a,_0x4d950f)[_0xba2b('0xa')](function(_0x548354){logger[_0xba2b('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x141acf,_0xba2b('0xc'));logger['debug'](_0xba2b('0xd'),_0x141acf,_0xba2b('0xc'),JSON['stringify'](_0x548354));if(_0x548354[_0xba2b('0xe')]){if(_0x548354[_0xba2b('0xe')]['code']===0x1f4){logger[_0xba2b('0xe')](_0xba2b('0xf'),_0x141acf,_0x548354['error'][_0xba2b('0x10')]);return _0x347acd(_0x548354[_0xba2b('0xe')][_0xba2b('0x10')]);}logger[_0xba2b('0xe')](_0xba2b('0xf'),_0x141acf,_0x548354[_0xba2b('0xe')]['message']);return _0x5b2f6f(_0x548354[_0xba2b('0xe')][_0xba2b('0x10')]);}else{logger[_0xba2b('0xb')]('UserProfileResource,\x20%s,\x20%s',_0x141acf,'request\x20sent');_0x5b2f6f(_0x548354[_0xba2b('0x11')][_0xba2b('0x10')]);}})['catch'](function(_0x626922){logger[_0xba2b('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x141acf,_0x626922);_0x347acd(_0x626922);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index e52ebe6..147ec18 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 _0xefbf=['exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','/:id','post','create','update','delete','destroy'];(function(_0x49d9c0,_0x1ed05a){var _0x59ed04=function(_0xca45f5){while(--_0xca45f5){_0x49d9c0['push'](_0x49d9c0['shift']());}};_0x59ed04(++_0x1ed05a);}(_0xefbf,0xa3));var _0xfefb=function(_0x22a497,_0x27c945){_0x22a497=_0x22a497-0x0;var _0x140f74=_0xefbf[_0x22a497];return _0x140f74;};'use strict';var multer=require(_0xfefb('0x0'));var util=require(_0xfefb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfefb('0x2')]();var auth=require(_0xfefb('0x3'));var interaction=require(_0xfefb('0x4'));var config=require(_0xfefb('0x5'));var controller=require(_0xfefb('0x6'));router[_0xfefb('0x7')]('/',auth['isAuthenticated'](),controller[_0xfefb('0x8')]);router['get'](_0xfefb('0x9'),auth[_0xfefb('0xa')](),controller['describe']);router[_0xfefb('0x7')](_0xfefb('0xb'),auth[_0xfefb('0xa')](),controller['show']);router[_0xfefb('0xc')]('/',auth[_0xfefb('0xa')](),controller[_0xfefb('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfefb('0xe')]);router[_0xfefb('0xf')](_0xfefb('0xb'),auth[_0xfefb('0xa')](),controller[_0xfefb('0x10')]);module[_0xfefb('0x11')]=router; \ No newline at end of file +var _0x087a=['connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/describe','/:id','put','update','exports','multer','util','path'];(function(_0x1d517a,_0x17c82a){var _0x2d8623=function(_0x40d9c0){while(--_0x40d9c0){_0x1d517a['push'](_0x1d517a['shift']());}};_0x2d8623(++_0x17c82a);}(_0x087a,0xde));var _0xa087=function(_0x373480,_0x5ee2d2){_0x373480=_0x373480-0x0;var _0x5c98ba=_0x087a[_0x373480];return _0x5c98ba;};'use strict';var multer=require(_0xa087('0x0'));var util=require(_0xa087('0x1'));var path=require(_0xa087('0x2'));var timeout=require(_0xa087('0x3'));var express=require(_0xa087('0x4'));var router=express[_0xa087('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xa087('0x6'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router['get']('/',auth[_0xa087('0x7')](),controller[_0xa087('0x8')]);router[_0xa087('0x9')](_0xa087('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xa087('0xb'),auth[_0xa087('0x7')](),controller['show']);router['post']('/',auth[_0xa087('0x7')](),controller['create']);router[_0xa087('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xa087('0xd')]);router['delete'](_0xa087('0xb'),auth[_0xa087('0x7')](),controller['destroy']);module[_0xa087('0xe')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 248b3e5..ab5c0ce 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 _0x34ab=['split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x41f816,_0x53f7b2){var _0x5c54f5=function(_0x16e14f){while(--_0x16e14f){_0x41f816['push'](_0x41f816['shift']());}};_0x5c54f5(++_0x53f7b2);}(_0x34ab,0xf1));var _0xb34a=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x34ab[_0x4eafed];return _0x159c85;};'use strict';var Sequelize=require(_0xb34a('0x0'));module[_0xb34a('0x1')]={'name':{'type':Sequelize[_0xb34a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xb34a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x32ef74){this[_0xb34a('0x4')](_0xb34a('0x5'),_0x32ef74?_0x32ef74['join'](''):[]);},'get':function(){return this[_0xb34a('0x6')](_0xb34a('0x5'))?this[_0xb34a('0x6')](_0xb34a('0x5'))[_0xb34a('0x7')](''):[];}}}; \ No newline at end of file +var _0xf9fd=['sequelize','exports','STRING','INTEGER','BOOLEAN','crudPermissions','getDataValue','split'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0xf9fd,0x118));var _0xdf9f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf9fd[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xdf9f('0x0'));module[_0xdf9f('0x1')]={'name':{'type':Sequelize[_0xdf9f('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xdf9f('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xdf9f('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xdf9f('0x2')],'set':function(_0x5473dc){this['setDataValue'](_0xdf9f('0x5'),_0x5473dc?_0x5473dc['join'](''):[]);},'get':function(){return this[_0xdf9f('0x6')](_0xdf9f('0x5'))?this['getDataValue'](_0xdf9f('0x5'))[_0xdf9f('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index b601dc8..e4a1b50 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 _0x5256=['sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','create','body','find','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5256,0x153));var _0x6525=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x5256[_0x2dea24];return _0x309d58;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6525('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6525('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6525('0x2'));var moment=require('moment');var BPromise=require(_0x6525('0x3'));var Mustache=require(_0x6525('0x4'));var util=require(_0x6525('0x5'));var path=require(_0x6525('0x6'));var sox=require('sox');var csv=require(_0x6525('0x7'));var ejs=require(_0x6525('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6525('0x9'));var crypto=require(_0x6525('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6525('0xb'));var toCsv=require(_0x6525('0x7'));var querystring=require('querystring');var Papa=require(_0x6525('0xc'));var Redis=require(_0x6525('0xd'));var authService=require(_0x6525('0xe'));var qs=require(_0x6525('0xf'));var as=require(_0x6525('0x10'));var hardwareService=require(_0x6525('0x11'));var logger=require(_0x6525('0x12'))(_0x6525('0x13'));var utils=require('../../config/utils');var config=require(_0x6525('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8584b5,_0x32ed34){_0x32ed34=_0x32ed34||0xcc;return function(_0x41d5dc){if(_0x41d5dc){return _0x8584b5[_0x6525('0x15')](_0x32ed34);}return _0x8584b5[_0x6525('0x16')](_0x32ed34)['end']();};}function respondWithResult(_0x410d6e,_0x97f329){_0x97f329=_0x97f329||0xc8;return function(_0x597f99){if(_0x597f99){return _0x410d6e[_0x6525('0x16')](_0x97f329)[_0x6525('0x17')](_0x597f99);}};}function respondWithFilteredResult(_0x1d1b2d,_0x1f84ed){return function(_0xc5c63b){if(_0xc5c63b){var _0x33dbc5=_0xc5c63b[_0x6525('0x18')],_0x4e1989=_0x1f84ed[_0x6525('0x19')],_0x5a452a=_0x1f84ed[_0x6525('0x19')]+_0x1f84ed[_0x6525('0x1a')],_0x5dcaa2;if(_0x5a452a>=_0x33dbc5){_0x5a452a=_0x33dbc5;_0x5dcaa2=0xc8;}else{_0x5dcaa2=0xce;}_0x1d1b2d[_0x6525('0x16')](_0x5dcaa2);return _0x1d1b2d[_0x6525('0x1b')](_0x6525('0x1c'),_0x4e1989+'-'+_0x5a452a+'/'+_0x33dbc5)[_0x6525('0x17')](_0xc5c63b);}return null;};}function patchUpdates(_0x16b8ff){return function(_0x4de116){try{jsonpatch[_0x6525('0x1d')](_0x4de116,_0x16b8ff,!![]);}catch(_0x3c36ad){return BPromise[_0x6525('0x1e')](_0x3c36ad);}return _0x4de116[_0x6525('0x1f')]();};}function saveUpdates(_0x3c9fe2,_0xa9d6e6){return function(_0x44618b){if(_0x44618b){return _0x44618b['update'](_0x3c9fe2)[_0x6525('0x20')](function(_0x49398b){return _0x49398b;});}return null;};}function removeEntity(_0x17cff7,_0x335d5c){return function(_0x3fdea8){if(_0x3fdea8){return _0x3fdea8[_0x6525('0x21')]()[_0x6525('0x20')](function(){_0x17cff7[_0x6525('0x16')](0xcc)[_0x6525('0x22')]();});}};}function handleEntityNotFound(_0x5b0552,_0x432150){return function(_0x11629e){if(!_0x11629e){_0x5b0552[_0x6525('0x15')](0x194);}return _0x11629e;};}function handleError(_0x1fa806,_0x512cbf){_0x512cbf=_0x512cbf||0x1f4;return function(_0x487d7c){logger[_0x6525('0x23')](_0x487d7c[_0x6525('0x24')]);if(_0x487d7c[_0x6525('0x25')]){delete _0x487d7c[_0x6525('0x25')];}_0x1fa806['status'](_0x512cbf)[_0x6525('0x26')](_0x487d7c);};}exports['index']=function(_0xa01fc6,_0x32f048){var _0x22fb62={},_0x1abbee={},_0x4407e1={'count':0x0,'rows':[]};var _0x2ea4c=_[_0x6525('0x27')](db[_0x6525('0x28')][_0x6525('0x29')],function(_0x1f438a){return{'name':_0x1f438a[_0x6525('0x2a')],'type':_0x1f438a[_0x6525('0x2b')][_0x6525('0x2c')]};});_0x1abbee[_0x6525('0x2d')]=_[_0x6525('0x27')](_0x2ea4c,'name');_0x1abbee[_0x6525('0x2e')]=_[_0x6525('0x2f')](_0xa01fc6['query']);_0x1abbee[_0x6525('0x30')]=_['intersection'](_0x1abbee[_0x6525('0x2d')],_0x1abbee[_0x6525('0x2e')]);_0x22fb62[_0x6525('0x31')]=_['intersection'](_0x1abbee[_0x6525('0x2d')],qs['fields'](_0xa01fc6[_0x6525('0x2e')][_0x6525('0x32')]));_0x22fb62[_0x6525('0x31')]=_0x22fb62[_0x6525('0x31')][_0x6525('0x33')]?_0x22fb62['attributes']:_0x1abbee[_0x6525('0x2d')];if(!_0xa01fc6[_0x6525('0x2e')][_0x6525('0x34')]('nolimit')){_0x22fb62[_0x6525('0x1a')]=qs['limit'](_0xa01fc6[_0x6525('0x2e')]['limit']);_0x22fb62[_0x6525('0x19')]=qs[_0x6525('0x19')](_0xa01fc6[_0x6525('0x2e')][_0x6525('0x19')]);}_0x22fb62[_0x6525('0x35')]=qs[_0x6525('0x36')](_0xa01fc6['query'][_0x6525('0x36')]);_0x22fb62[_0x6525('0x37')]=qs[_0x6525('0x30')](_[_0x6525('0x38')](_0xa01fc6['query'],_0x1abbee[_0x6525('0x30')]));if(_0xa01fc6['query'][_0x6525('0x39')]){_0x22fb62['where']=_[_0x6525('0x3a')](_0x22fb62[_0x6525('0x37')],{'$or':_['map'](_0x2ea4c,function(_0x3ce920){if(_0x3ce920['type']!==_0x6525('0x3b')){var _0x27f9d6={};_0x27f9d6[_0x3ce920[_0x6525('0x25')]]={'$like':'%'+_0xa01fc6[_0x6525('0x2e')]['filter']+'%'};return _0x27f9d6;}})});}_0x22fb62=_[_0x6525('0x3a')]({},_0x22fb62,_0xa01fc6[_0x6525('0x3c')]);var _0x430cf8={'where':_0x22fb62[_0x6525('0x37')]};return db[_0x6525('0x28')][_0x6525('0x18')](_0x430cf8)[_0x6525('0x20')](function(_0x447800){_0x4407e1[_0x6525('0x18')]=_0x447800;if(_0xa01fc6[_0x6525('0x2e')][_0x6525('0x3d')]){_0x22fb62[_0x6525('0x3e')]=[{'all':!![]}];}return db[_0x6525('0x28')]['findAll'](_0x22fb62);})[_0x6525('0x20')](function(_0x2d0ef3){_0x4407e1[_0x6525('0x3f')]=_0x2d0ef3;return _0x4407e1;})[_0x6525('0x20')](respondWithFilteredResult(_0x32f048,_0x22fb62))[_0x6525('0x40')](handleError(_0x32f048,null));};exports[_0x6525('0x41')]=function(_0x26c99e,_0x5bb876){var _0x3067d3={'raw':![],'where':{'id':_0x26c99e[_0x6525('0x42')]['id']}},_0x534ca0={};_0x534ca0['model']=_['keys'](db[_0x6525('0x28')][_0x6525('0x29')]);_0x534ca0['query']=_[_0x6525('0x2f')](_0x26c99e['query']);_0x534ca0[_0x6525('0x30')]=_['intersection'](_0x534ca0[_0x6525('0x2d')],_0x534ca0['query']);_0x3067d3[_0x6525('0x31')]=_[_0x6525('0x43')](_0x534ca0[_0x6525('0x2d')],qs[_0x6525('0x32')](_0x26c99e[_0x6525('0x2e')][_0x6525('0x32')]));_0x3067d3[_0x6525('0x31')]=_0x3067d3[_0x6525('0x31')][_0x6525('0x33')]?_0x3067d3[_0x6525('0x31')]:_0x534ca0[_0x6525('0x2d')];if(_0x26c99e['query']['includeAll']){_0x3067d3['include']=[{'all':!![]}];}_0x3067d3=_[_0x6525('0x3a')]({},_0x3067d3,_0x26c99e[_0x6525('0x3c')]);return db[_0x6525('0x28')]['find'](_0x3067d3)[_0x6525('0x20')](handleEntityNotFound(_0x5bb876,null))[_0x6525('0x20')](respondWithResult(_0x5bb876,null))[_0x6525('0x40')](handleError(_0x5bb876,null));};exports[_0x6525('0x44')]=function(_0x3c31b8,_0x5bc58a){return db[_0x6525('0x28')][_0x6525('0x44')](_0x3c31b8[_0x6525('0x45')],{})[_0x6525('0x20')](respondWithResult(_0x5bc58a,0xc9))[_0x6525('0x40')](handleError(_0x5bc58a,null));};exports['update']=function(_0x475a1b,_0x1992ad){if(_0x475a1b[_0x6525('0x45')]['id']){delete _0x475a1b[_0x6525('0x45')]['id'];}return db[_0x6525('0x28')][_0x6525('0x46')]({'where':{'id':_0x475a1b[_0x6525('0x42')]['id']}})[_0x6525('0x20')](handleEntityNotFound(_0x1992ad,null))['then'](saveUpdates(_0x475a1b[_0x6525('0x45')],null))[_0x6525('0x20')](respondWithResult(_0x1992ad,null))['catch'](handleError(_0x1992ad,null));};exports[_0x6525('0x21')]=function(_0x34257f,_0x3cebe8){return db[_0x6525('0x28')]['find']({'where':{'id':_0x34257f[_0x6525('0x42')]['id']}})[_0x6525('0x20')](handleEntityNotFound(_0x3cebe8,null))['then'](removeEntity(_0x3cebe8,null))['catch'](handleError(_0x3cebe8,null));};exports['describe']=function(_0x2dfc93,_0x3e81af){return db[_0x6525('0x28')][_0x6525('0x47')]()[_0x6525('0x20')](respondWithResult(_0x3e81af,null))[_0x6525('0x40')](handleError(_0x3e81af,null));}; \ No newline at end of file +var _0x0e4c=['create','update','body','describe','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','stack','name','map','UserProfileSection','rawAttributes','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','params','keys','find'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0e4c,0x19c));var _0xc0e4=function(_0x21a99a,_0x26cc42){_0x21a99a=_0x21a99a-0x0;var _0x350ebc=_0x0e4c[_0x21a99a];return _0x350ebc;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc0e4('0x0'));var rimraf=require(_0xc0e4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc0e4('0x2'));var moment=require(_0xc0e4('0x3'));var BPromise=require(_0xc0e4('0x4'));var Mustache=require('mustache');var util=require(_0xc0e4('0x5'));var path=require('path');var sox=require(_0xc0e4('0x6'));var csv=require(_0xc0e4('0x7'));var ejs=require(_0xc0e4('0x8'));var fs=require('fs');var _=require(_0xc0e4('0x9'));var squel=require(_0xc0e4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc0e4('0xb'));var deskjs=require(_0xc0e4('0xc'));var toCsv=require(_0xc0e4('0x7'));var querystring=require(_0xc0e4('0xd'));var Papa=require(_0xc0e4('0xe'));var Redis=require(_0xc0e4('0xf'));var authService=require(_0xc0e4('0x10'));var qs=require(_0xc0e4('0x11'));var as=require(_0xc0e4('0x12'));var hardwareService=require(_0xc0e4('0x13'));var logger=require(_0xc0e4('0x14'))(_0xc0e4('0x15'));var utils=require(_0xc0e4('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34cb61,_0x23f49a){_0x23f49a=_0x23f49a||0xcc;return function(_0x516d03){if(_0x516d03){return _0x34cb61[_0xc0e4('0x17')](_0x23f49a);}return _0x34cb61['status'](_0x23f49a)[_0xc0e4('0x18')]();};}function respondWithResult(_0x26fe09,_0x188132){_0x188132=_0x188132||0xc8;return function(_0x4c8768){if(_0x4c8768){return _0x26fe09[_0xc0e4('0x19')](_0x188132)[_0xc0e4('0x1a')](_0x4c8768);}};}function respondWithFilteredResult(_0x19661d,_0x5dae8){return function(_0x4cf9b6){if(_0x4cf9b6){var _0xac59ed=_0x4cf9b6[_0xc0e4('0x1b')],_0x39e2ca=_0x5dae8[_0xc0e4('0x1c')],_0x56fbbb=_0x5dae8['offset']+_0x5dae8['limit'],_0x5c6ed6;if(_0x56fbbb>=_0xac59ed){_0x56fbbb=_0xac59ed;_0x5c6ed6=0xc8;}else{_0x5c6ed6=0xce;}_0x19661d['status'](_0x5c6ed6);return _0x19661d[_0xc0e4('0x1d')](_0xc0e4('0x1e'),_0x39e2ca+'-'+_0x56fbbb+'/'+_0xac59ed)[_0xc0e4('0x1a')](_0x4cf9b6);}return null;};}function patchUpdates(_0x58e6d7){return function(_0x9ae268){try{jsonpatch[_0xc0e4('0x1f')](_0x9ae268,_0x58e6d7,!![]);}catch(_0x304ed8){return BPromise['reject'](_0x304ed8);}return _0x9ae268[_0xc0e4('0x20')]();};}function saveUpdates(_0x4ccea7,_0x27d7f7){return function(_0xc81160){if(_0xc81160){return _0xc81160['update'](_0x4ccea7)[_0xc0e4('0x21')](function(_0x5a5b67){return _0x5a5b67;});}return null;};}function removeEntity(_0x4aa95d,_0x5f43c2){return function(_0x1bed2c){if(_0x1bed2c){return _0x1bed2c[_0xc0e4('0x22')]()['then'](function(){_0x4aa95d['status'](0xcc)[_0xc0e4('0x18')]();});}};}function handleEntityNotFound(_0x420a50,_0x3dabc8){return function(_0x1b4328){if(!_0x1b4328){_0x420a50[_0xc0e4('0x17')](0x194);}return _0x1b4328;};}function handleError(_0x5440b2,_0x2d7439){_0x2d7439=_0x2d7439||0x1f4;return function(_0x4ab9e5){logger['error'](_0x4ab9e5[_0xc0e4('0x23')]);if(_0x4ab9e5[_0xc0e4('0x24')]){delete _0x4ab9e5['name'];}_0x5440b2['status'](_0x2d7439)['send'](_0x4ab9e5);};}exports['index']=function(_0x123f94,_0x238153){var _0x3593b1={},_0x1ed654={},_0x3343a7={'count':0x0,'rows':[]};var _0x5295b9=_[_0xc0e4('0x25')](db[_0xc0e4('0x26')][_0xc0e4('0x27')],function(_0x4c4c78){return{'name':_0x4c4c78['fieldName'],'type':_0x4c4c78[_0xc0e4('0x28')]['key']};});_0x1ed654['model']=_[_0xc0e4('0x25')](_0x5295b9,_0xc0e4('0x24'));_0x1ed654[_0xc0e4('0x29')]=_['keys'](_0x123f94[_0xc0e4('0x29')]);_0x1ed654[_0xc0e4('0x2a')]=_[_0xc0e4('0x2b')](_0x1ed654[_0xc0e4('0x2c')],_0x1ed654[_0xc0e4('0x29')]);_0x3593b1['attributes']=_[_0xc0e4('0x2b')](_0x1ed654[_0xc0e4('0x2c')],qs['fields'](_0x123f94[_0xc0e4('0x29')][_0xc0e4('0x2d')]));_0x3593b1[_0xc0e4('0x2e')]=_0x3593b1['attributes'][_0xc0e4('0x2f')]?_0x3593b1[_0xc0e4('0x2e')]:_0x1ed654['model'];if(!_0x123f94[_0xc0e4('0x29')][_0xc0e4('0x30')](_0xc0e4('0x31'))){_0x3593b1[_0xc0e4('0x32')]=qs[_0xc0e4('0x32')](_0x123f94[_0xc0e4('0x29')][_0xc0e4('0x32')]);_0x3593b1[_0xc0e4('0x1c')]=qs[_0xc0e4('0x1c')](_0x123f94[_0xc0e4('0x29')][_0xc0e4('0x1c')]);}_0x3593b1['order']=qs['sort'](_0x123f94['query'][_0xc0e4('0x33')]);_0x3593b1[_0xc0e4('0x34')]=qs[_0xc0e4('0x2a')](_[_0xc0e4('0x35')](_0x123f94[_0xc0e4('0x29')],_0x1ed654[_0xc0e4('0x2a')]));if(_0x123f94[_0xc0e4('0x29')][_0xc0e4('0x36')]){_0x3593b1[_0xc0e4('0x34')]=_[_0xc0e4('0x37')](_0x3593b1[_0xc0e4('0x34')],{'$or':_['map'](_0x5295b9,function(_0x5b8c35){if(_0x5b8c35[_0xc0e4('0x28')]!==_0xc0e4('0x38')){var _0x517402={};_0x517402[_0x5b8c35['name']]={'$like':'%'+_0x123f94[_0xc0e4('0x29')]['filter']+'%'};return _0x517402;}})});}_0x3593b1=_[_0xc0e4('0x37')]({},_0x3593b1,_0x123f94[_0xc0e4('0x39')]);var _0x1036c1={'where':_0x3593b1['where']};return db[_0xc0e4('0x26')][_0xc0e4('0x1b')](_0x1036c1)[_0xc0e4('0x21')](function(_0x14c68d){_0x3343a7[_0xc0e4('0x1b')]=_0x14c68d;if(_0x123f94[_0xc0e4('0x29')][_0xc0e4('0x3a')]){_0x3593b1[_0xc0e4('0x3b')]=[{'all':!![]}];}return db[_0xc0e4('0x26')]['findAll'](_0x3593b1);})['then'](function(_0x4a1293){_0x3343a7['rows']=_0x4a1293;return _0x3343a7;})[_0xc0e4('0x21')](respondWithFilteredResult(_0x238153,_0x3593b1))[_0xc0e4('0x3c')](handleError(_0x238153,null));};exports['show']=function(_0x446355,_0x24cd84){var _0x4c91ea={'raw':![],'where':{'id':_0x446355[_0xc0e4('0x3d')]['id']}},_0x455446={};_0x455446[_0xc0e4('0x2c')]=_[_0xc0e4('0x3e')](db['UserProfileSection'][_0xc0e4('0x27')]);_0x455446[_0xc0e4('0x29')]=_['keys'](_0x446355[_0xc0e4('0x29')]);_0x455446[_0xc0e4('0x2a')]=_[_0xc0e4('0x2b')](_0x455446[_0xc0e4('0x2c')],_0x455446[_0xc0e4('0x29')]);_0x4c91ea[_0xc0e4('0x2e')]=_[_0xc0e4('0x2b')](_0x455446[_0xc0e4('0x2c')],qs[_0xc0e4('0x2d')](_0x446355['query'][_0xc0e4('0x2d')]));_0x4c91ea[_0xc0e4('0x2e')]=_0x4c91ea[_0xc0e4('0x2e')][_0xc0e4('0x2f')]?_0x4c91ea[_0xc0e4('0x2e')]:_0x455446[_0xc0e4('0x2c')];if(_0x446355[_0xc0e4('0x29')][_0xc0e4('0x3a')]){_0x4c91ea[_0xc0e4('0x3b')]=[{'all':!![]}];}_0x4c91ea=_[_0xc0e4('0x37')]({},_0x4c91ea,_0x446355[_0xc0e4('0x39')]);return db[_0xc0e4('0x26')][_0xc0e4('0x3f')](_0x4c91ea)['then'](handleEntityNotFound(_0x24cd84,null))[_0xc0e4('0x21')](respondWithResult(_0x24cd84,null))[_0xc0e4('0x3c')](handleError(_0x24cd84,null));};exports[_0xc0e4('0x40')]=function(_0x1dbc99,_0x5d4abe){return db[_0xc0e4('0x26')][_0xc0e4('0x40')](_0x1dbc99['body'],{})[_0xc0e4('0x21')](respondWithResult(_0x5d4abe,0xc9))[_0xc0e4('0x3c')](handleError(_0x5d4abe,null));};exports[_0xc0e4('0x41')]=function(_0x5f2494,_0x1f5b13){if(_0x5f2494[_0xc0e4('0x42')]['id']){delete _0x5f2494[_0xc0e4('0x42')]['id'];}return db[_0xc0e4('0x26')][_0xc0e4('0x3f')]({'where':{'id':_0x5f2494[_0xc0e4('0x3d')]['id']}})[_0xc0e4('0x21')](handleEntityNotFound(_0x1f5b13,null))[_0xc0e4('0x21')](saveUpdates(_0x5f2494[_0xc0e4('0x42')],null))[_0xc0e4('0x21')](respondWithResult(_0x1f5b13,null))[_0xc0e4('0x3c')](handleError(_0x1f5b13,null));};exports[_0xc0e4('0x22')]=function(_0x1077b3,_0x27dfd1){return db[_0xc0e4('0x26')][_0xc0e4('0x3f')]({'where':{'id':_0x1077b3['params']['id']}})[_0xc0e4('0x21')](handleEntityNotFound(_0x27dfd1,null))['then'](removeEntity(_0x27dfd1,null))[_0xc0e4('0x3c')](handleError(_0x27dfd1,null));};exports['describe']=function(_0x322841,_0x222f82){return db['UserProfileSection'][_0xc0e4('0x43')]()[_0xc0e4('0x21')](respondWithResult(_0x222f82,null))['catch'](handleError(_0x222f82,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index badb460..58fe0c6 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 _0x85f8=['rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','sectionId','lodash','util','bluebird','path'];(function(_0x5ab653,_0x2b8dba){var _0x37b593=function(_0x5f4740){while(--_0x5f4740){_0x5ab653['push'](_0x5ab653['shift']());}};_0x37b593(++_0x2b8dba);}(_0x85f8,0x10f));var _0x885f=function(_0xbbe6d1,_0x45795c){_0xbbe6d1=_0xbbe6d1-0x0;var _0x45356b=_0x85f8[_0xbbe6d1];return _0x45356b;};'use strict';var _=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x885f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x885f('0x3'));var rimraf=require(_0x885f('0x4'));var config=require(_0x885f('0x5'));var attributes=require(_0x885f('0x6'));module[_0x885f('0x7')]=function(_0x2b132c,_0x578126){return _0x2b132c['define'](_0x885f('0x8'),attributes,{'tableName':_0x885f('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x885f('0xa'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4de7=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection'];(function(_0x525629,_0x457064){var _0x2f1b02=function(_0x676a4a){while(--_0x676a4a){_0x525629['push'](_0x525629['shift']());}};_0x2f1b02(++_0x457064);}(_0x4de7,0x1f3));var _0x74de=function(_0x3c1973,_0x57fe38){_0x3c1973=_0x3c1973-0x0;var _0x5c0b5c=_0x4de7[_0x3c1973];return _0x5c0b5c;};'use strict';var _=require(_0x74de('0x0'));var util=require('util');var logger=require(_0x74de('0x1'))(_0x74de('0x2'));var moment=require(_0x74de('0x3'));var BPromise=require(_0x74de('0x4'));var rp=require(_0x74de('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x74de('0x6'));var config=require(_0x74de('0x7'));var attributes=require(_0x74de('0x8'));module['exports']=function(_0x1f418e,_0xba55c8){return _0x1f418e[_0x74de('0x9')](_0x74de('0xa'),attributes,{'tableName':_0x74de('0xb'),'paranoid':![],'indexes':[{'name':_0x74de('0xc'),'fields':[_0x74de('0xd'),_0x74de('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index fbc0f9b..64a35b7 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 _0x7ebb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c1ad0,_0x5c2efb){var _0x22da92=function(_0x104fb5){while(--_0x104fb5){_0x2c1ad0['push'](_0x2c1ad0['shift']());}};_0x22da92(++_0x5c2efb);}(_0x7ebb,0x161));var _0xb7eb=function(_0x3018eb,_0x570c63){_0x3018eb=_0x3018eb-0x0;var _0x23131f=_0x7ebb[_0x3018eb];return _0x23131f;};'use strict';var _=require(_0xb7eb('0x0'));var util=require(_0xb7eb('0x1'));var moment=require(_0xb7eb('0x2'));var BPromise=require(_0xb7eb('0x3'));var rs=require(_0xb7eb('0x4'));var fs=require('fs');var Redis=require(_0xb7eb('0x5'));var db=require(_0xb7eb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7eb('0x7'))(_0xb7eb('0x8'));var config=require(_0xb7eb('0x9'));var jayson=require(_0xb7eb('0xa'));var client=jayson[_0xb7eb('0xb')][_0xb7eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b53b1,_0x1b8cc5,_0x282eb0){return new BPromise(function(_0x3abb1f,_0x542325){return client['request'](_0x2b53b1,_0x282eb0)[_0xb7eb('0xd')](function(_0xb669b9){logger[_0xb7eb('0xe')](_0xb7eb('0xf'),_0x1b8cc5,'request\x20sent');logger[_0xb7eb('0x10')](_0xb7eb('0x11'),_0x1b8cc5,'request\x20sent',JSON[_0xb7eb('0x12')](_0xb669b9));if(_0xb669b9[_0xb7eb('0x13')]){if(_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x14')]===0x1f4){logger[_0xb7eb('0x13')](_0xb7eb('0xf'),_0x1b8cc5,_0xb669b9[_0xb7eb('0x13')]['message']);return _0x542325(_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x15')]);}logger[_0xb7eb('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x1b8cc5,_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x15')]);return _0x3abb1f(_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x15')]);}else{logger['info'](_0xb7eb('0xf'),_0x1b8cc5,'request\x20sent');_0x3abb1f(_0xb669b9[_0xb7eb('0x16')][_0xb7eb('0x15')]);}})[_0xb7eb('0x17')](function(_0x549546){logger[_0xb7eb('0x13')](_0xb7eb('0xf'),_0x1b8cc5,_0x549546);_0x542325(_0x549546);});});} \ No newline at end of file +var _0x865e=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x865e,0x80));var _0xe865=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x865e[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0xe865('0x0'));var util=require('util');var moment=require(_0xe865('0x1'));var BPromise=require('bluebird');var rs=require(_0xe865('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe865('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe865('0x4'));var config=require(_0xe865('0x5'));var jayson=require(_0xe865('0x6'));var client=jayson[_0xe865('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ca62a,_0x4f86e7,_0x40c60b){return new BPromise(function(_0x1634dd,_0x5d830c){return client['request'](_0x2ca62a,_0x40c60b)[_0xe865('0x8')](function(_0x29071b){logger[_0xe865('0x9')](_0xe865('0xa'),_0x4f86e7,_0xe865('0xb'));logger['debug'](_0xe865('0xc'),_0x4f86e7,_0xe865('0xb'),JSON[_0xe865('0xd')](_0x29071b));if(_0x29071b[_0xe865('0xe')]){if(_0x29071b[_0xe865('0xe')]['code']===0x1f4){logger[_0xe865('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x4f86e7,_0x29071b[_0xe865('0xe')]['message']);return _0x5d830c(_0x29071b['error']['message']);}logger['error'](_0xe865('0xa'),_0x4f86e7,_0x29071b['error']['message']);return _0x1634dd(_0x29071b[_0xe865('0xe')][_0xe865('0xf')]);}else{logger[_0xe865('0x9')](_0xe865('0xa'),_0x4f86e7,_0xe865('0xb'));_0x1634dd(_0x29071b['result'][_0xe865('0xf')]);}})[_0xe865('0x10')](function(_0x458cb6){logger[_0xe865('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x4f86e7,_0x458cb6);_0x5d830c(_0x458cb6);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 4e2518c..998a0cc 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 _0xcd91=['../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x22e571,_0x443a32){var _0x5b3f1c=function(_0x52a0ce){while(--_0x52a0ce){_0x22e571['push'](_0x22e571['shift']());}};_0x5b3f1c(++_0x443a32);}(_0xcd91,0x8a));var _0x1cd9=function(_0x128e7e,_0x2f9b63){_0x128e7e=_0x128e7e-0x0;var _0x4ab22e=_0xcd91[_0x128e7e];return _0x4ab22e;};'use strict';var multer=require(_0x1cd9('0x0'));var util=require(_0x1cd9('0x1'));var path=require('path');var timeout=require(_0x1cd9('0x2'));var express=require(_0x1cd9('0x3'));var router=express[_0x1cd9('0x4')]();var auth=require(_0x1cd9('0x5'));var interaction=require(_0x1cd9('0x6'));var config=require(_0x1cd9('0x7'));module[_0x1cd9('0x8')]=router; \ No newline at end of file +var _0x746a=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x2fe689,_0x5794e5){var _0x35ea44=function(_0x51b9d6){while(--_0x51b9d6){_0x2fe689['push'](_0x2fe689['shift']());}};_0x35ea44(++_0x5794e5);}(_0x746a,0x18f));var _0xa746=function(_0x158e0e,_0x24782b){_0x158e0e=_0x158e0e-0x0;var _0x58d14d=_0x746a[_0x158e0e];return _0x58d14d;};'use strict';var multer=require(_0xa746('0x0'));var util=require(_0xa746('0x1'));var path=require(_0xa746('0x2'));var timeout=require('connect-timeout');var express=require(_0xa746('0x3'));var router=express[_0xa746('0x4')]();var auth=require(_0xa746('0x5'));var interaction=require(_0xa746('0x6'));var config=require(_0xa746('0x7'));module[_0xa746('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index b7cc497..4fec404 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 _0xd8b0=['exports','sequelize'];(function(_0xa0d6e8,_0x41e320){var _0x4ba300=function(_0x5ad796){while(--_0x5ad796){_0xa0d6e8['push'](_0xa0d6e8['shift']());}};_0x4ba300(++_0x41e320);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0xa8c436,_0x3913c9){var _0x55b1f3=function(_0xb03a4c){while(--_0xb03a4c){_0xa8c436['push'](_0xa8c436['shift']());}};_0x55b1f3(++_0x3913c9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('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 2d55ac5..a5cea8e 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 _0x7a45=['bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','lodash','util','../../config/logger','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a45,0xc1));var _0x57a4=function(_0x4db607,_0x97e3c2){_0x4db607=_0x4db607-0x0;var _0x49ba1e=_0x7a45[_0x4db607];return _0x49ba1e;};'use strict';var _=require(_0x57a4('0x0'));var util=require(_0x57a4('0x1'));var logger=require(_0x57a4('0x2'))(_0x57a4('0x3'));var moment=require(_0x57a4('0x4'));var BPromise=require(_0x57a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57a4('0x6'));var rimraf=require(_0x57a4('0x7'));var config=require(_0x57a4('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x57a4('0x9')]=function(_0x341c63,_0x5e405f){return _0x341c63['define'](_0x57a4('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2f86=['user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue'];(function(_0x16ea87,_0x378d8b){var _0x6e7b1c=function(_0x26306e){while(--_0x26306e){_0x16ea87['push'](_0x16ea87['shift']());}};_0x6e7b1c(++_0x378d8b);}(_0x2f86,0x105));var _0x62f8=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x2f86[_0x243b2f];return _0xcb3c2d;};'use strict';var _=require(_0x62f8('0x0'));var util=require(_0x62f8('0x1'));var logger=require('../../config/logger')(_0x62f8('0x2'));var moment=require(_0x62f8('0x3'));var BPromise=require(_0x62f8('0x4'));var rp=require(_0x62f8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x62f8('0x6'));var config=require(_0x62f8('0x7'));var attributes=require(_0x62f8('0x8'));module[_0x62f8('0x9')]=function(_0x12e793,_0x58d647){return _0x12e793[_0x62f8('0xa')](_0x62f8('0xb'),attributes,{'tableName':_0x62f8('0xc'),'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 e974994..624f3b2 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 _0x1fb8=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x55df07,_0x476544){var _0x29db38=function(_0x229c70){while(--_0x229c70){_0x55df07['push'](_0x55df07['shift']());}};_0x29db38(++_0x476544);}(_0x1fb8,0x14f));var _0x81fb=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0x1fb8[_0x1ebe2f];return _0xdeb06f;};'use strict';var _=require(_0x81fb('0x0'));var util=require(_0x81fb('0x1'));var moment=require(_0x81fb('0x2'));var BPromise=require(_0x81fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x81fb('0x5'));var logger=require(_0x81fb('0x6'))(_0x81fb('0x7'));var config=require(_0x81fb('0x8'));var jayson=require(_0x81fb('0x9'));var client=jayson[_0x81fb('0xa')][_0x81fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32d500,_0x1453b2,_0x31e389){return new BPromise(function(_0x15cd41,_0x1274ed){return client[_0x81fb('0xc')](_0x32d500,_0x31e389)[_0x81fb('0xd')](function(_0x226e16){logger[_0x81fb('0xe')](_0x81fb('0xf'),_0x1453b2,_0x81fb('0x10'));logger[_0x81fb('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1453b2,_0x81fb('0x10'),JSON[_0x81fb('0x12')](_0x226e16));if(_0x226e16[_0x81fb('0x13')]){if(_0x226e16[_0x81fb('0x13')][_0x81fb('0x14')]===0x1f4){logger[_0x81fb('0x13')](_0x81fb('0xf'),_0x1453b2,_0x226e16['error'][_0x81fb('0x15')]);return _0x1274ed(_0x226e16[_0x81fb('0x13')][_0x81fb('0x15')]);}logger['error'](_0x81fb('0xf'),_0x1453b2,_0x226e16[_0x81fb('0x13')][_0x81fb('0x15')]);return _0x15cd41(_0x226e16['error'][_0x81fb('0x15')]);}else{logger[_0x81fb('0xe')](_0x81fb('0xf'),_0x1453b2,'request\x20sent');_0x15cd41(_0x226e16[_0x81fb('0x16')][_0x81fb('0x15')]);}})['catch'](function(_0x5bb7f0){logger[_0x81fb('0x13')](_0x81fb('0xf'),_0x1453b2,_0x5bb7f0);_0x1274ed(_0x5bb7f0);});});} \ No newline at end of file +var _0xfdfe=['then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request'];(function(_0x7bcc8d,_0x11ac60){var _0x287716=function(_0x1d8f0f){while(--_0x1d8f0f){_0x7bcc8d['push'](_0x7bcc8d['shift']());}};_0x287716(++_0x11ac60);}(_0xfdfe,0x1d8));var _0xefdf=function(_0x1c9326,_0x4f65bd){_0x1c9326=_0x1c9326-0x0;var _0x33e2e4=_0xfdfe[_0x1c9326];return _0x33e2e4;};'use strict';var _=require(_0xefdf('0x0'));var util=require(_0xefdf('0x1'));var moment=require(_0xefdf('0x2'));var BPromise=require('bluebird');var rs=require(_0xefdf('0x3'));var fs=require('fs');var Redis=require(_0xefdf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xefdf('0x5'));var logger=require(_0xefdf('0x6'))(_0xefdf('0x7'));var config=require(_0xefdf('0x8'));var jayson=require(_0xefdf('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57b469,_0x65e074,_0x415871){return new BPromise(function(_0x277f38,_0x48270d){return client[_0xefdf('0xa')](_0x57b469,_0x415871)[_0xefdf('0xb')](function(_0x5bd986){logger[_0xefdf('0xc')](_0xefdf('0xd'),_0x65e074,_0xefdf('0xe'));logger[_0xefdf('0xf')](_0xefdf('0x10'),_0x65e074,'request\x20sent',JSON[_0xefdf('0x11')](_0x5bd986));if(_0x5bd986[_0xefdf('0x12')]){if(_0x5bd986[_0xefdf('0x12')][_0xefdf('0x13')]===0x1f4){logger[_0xefdf('0x12')](_0xefdf('0xd'),_0x65e074,_0x5bd986[_0xefdf('0x12')][_0xefdf('0x14')]);return _0x48270d(_0x5bd986['error']['message']);}logger['error'](_0xefdf('0xd'),_0x65e074,_0x5bd986[_0xefdf('0x12')][_0xefdf('0x14')]);return _0x277f38(_0x5bd986[_0xefdf('0x12')]['message']);}else{logger[_0xefdf('0xc')](_0xefdf('0xd'),_0x65e074,'request\x20sent');_0x277f38(_0x5bd986[_0xefdf('0x15')][_0xefdf('0x14')]);}})[_0xefdf('0x16')](function(_0x11ed02){logger[_0xefdf('0x12')](_0xefdf('0xd'),_0x65e074,_0x11ed02);_0x48270d(_0x11ed02);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 3a091c0..ff4143b 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 _0xe6be=['exports','multer','util','express','Router','../../config/environment'];(function(_0x37c000,_0x29e47a){var _0x3bbe1c=function(_0x3c65fc){while(--_0x3c65fc){_0x37c000['push'](_0x37c000['shift']());}};_0x3bbe1c(++_0x29e47a);}(_0xe6be,0xdf));var _0xee6b=function(_0xf856bd,_0x5adf21){_0xf856bd=_0xf856bd-0x0;var _0xf43a78=_0xe6be[_0xf856bd];return _0xf43a78;};'use strict';var multer=require(_0xee6b('0x0'));var util=require(_0xee6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xee6b('0x2'));var router=express[_0xee6b('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee6b('0x4'));module[_0xee6b('0x5')]=router; \ No newline at end of file +var _0x6d1e=['util','path','express','Router','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d1e,0x16d));var _0xe6d1=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x6d1e[_0x24237f];return _0x48298e;};'use strict';var multer=require(_0xe6d1('0x0'));var util=require(_0xe6d1('0x1'));var path=require(_0xe6d1('0x2'));var timeout=require('connect-timeout');var express=require(_0xe6d1('0x3'));var router=express[_0xe6d1('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0xe6d1('0x5')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 18ffb0c..e79aec8 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 _0xd8b0=['exports','sequelize'];(function(_0x526786,_0x105cbf){var _0x3a512d=function(_0x4efa05){while(--_0x4efa05){_0x526786['push'](_0x526786['shift']());}};_0x3a512d(++_0x105cbf);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('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 e3860c8..9f957dc 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 _0x5178=['rimraf','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x5178,0x171));var _0x8517=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5178[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var logger=require(_0x8517('0x1'))(_0x8517('0x2'));var moment=require(_0x8517('0x3'));var BPromise=require(_0x8517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x8517('0x7')]=function(_0x58ed7e,_0x13ba05){return _0x58ed7e[_0x8517('0x8')](_0x8517('0x9'),attributes,{'tableName':_0x8517('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bc3=['./userVoiceQueue.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x564fd5,_0x158714){var _0x1f6c22=function(_0x1bcfe0){while(--_0x1bcfe0){_0x564fd5['push'](_0x564fd5['shift']());}};_0x1f6c22(++_0x158714);}(_0x4bc3,0x16e));var _0x34bc=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x4bc3[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var fs=require('fs');var path=require(_0x34bc('0x5'));var rimraf=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var attributes=require(_0x34bc('0x8'));module[_0x34bc('0x9')]=function(_0x2cc9c2,_0x4c63a1){return _0x2cc9c2[_0x34bc('0xa')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','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 a0ab41a..eaf1718 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 _0xe4a3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0xe4a3,0x150));var _0x3e4a=function(_0x4fb28b,_0x22fc65){_0x4fb28b=_0x4fb28b-0x0;var _0x46753a=_0xe4a3[_0x4fb28b];return _0x46753a;};'use strict';var _=require(_0x3e4a('0x0'));var util=require(_0x3e4a('0x1'));var moment=require(_0x3e4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e4a('0x4'))['db'];var utils=require(_0x3e4a('0x5'));var logger=require(_0x3e4a('0x6'))(_0x3e4a('0x7'));var config=require(_0x3e4a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aa973,_0x2aa122,_0x2207a8){return new BPromise(function(_0x524721,_0x5748a9){return client[_0x3e4a('0xa')](_0x1aa973,_0x2207a8)[_0x3e4a('0xb')](function(_0x1d400c){logger[_0x3e4a('0xc')](_0x3e4a('0xd'),_0x2aa122,_0x3e4a('0xe'));logger['debug'](_0x3e4a('0xf'),_0x2aa122,_0x3e4a('0xe'),JSON[_0x3e4a('0x10')](_0x1d400c));if(_0x1d400c[_0x3e4a('0x11')]){if(_0x1d400c['error'][_0x3e4a('0x12')]===0x1f4){logger[_0x3e4a('0x11')](_0x3e4a('0xd'),_0x2aa122,_0x1d400c[_0x3e4a('0x11')][_0x3e4a('0x13')]);return _0x5748a9(_0x1d400c[_0x3e4a('0x11')][_0x3e4a('0x13')]);}logger[_0x3e4a('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x2aa122,_0x1d400c[_0x3e4a('0x11')][_0x3e4a('0x13')]);return _0x524721(_0x1d400c['error'][_0x3e4a('0x13')]);}else{logger[_0x3e4a('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x2aa122,_0x3e4a('0xe'));_0x524721(_0x1d400c['result'][_0x3e4a('0x13')]);}})['catch'](function(_0x19807d){logger['error'](_0x3e4a('0xd'),_0x2aa122,_0x19807d);_0x5748a9(_0x19807d);});});} \ No newline at end of file +var _0xe34d=['message','request\x20sent','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s'];(function(_0x52fa48,_0x3c41d8){var _0x311348=function(_0x3e8e14){while(--_0x3e8e14){_0x52fa48['push'](_0x52fa48['shift']());}};_0x311348(++_0x3c41d8);}(_0xe34d,0x16c));var _0xde34=function(_0x1a829a,_0x220b6a){_0x1a829a=_0x1a829a-0x0;var _0x51eb6e=_0xe34d[_0x1a829a];return _0x51eb6e;};'use strict';var _=require(_0xde34('0x0'));var util=require(_0xde34('0x1'));var moment=require('moment');var BPromise=require(_0xde34('0x2'));var rs=require(_0xde34('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xde34('0x4'))['db'];var utils=require(_0xde34('0x5'));var logger=require(_0xde34('0x6'))(_0xde34('0x7'));var config=require(_0xde34('0x8'));var jayson=require(_0xde34('0x9'));var client=jayson[_0xde34('0xa')][_0xde34('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x737fe3,_0x1b4e30,_0x5b2d08){return new BPromise(function(_0x50868,_0x3c6201){return client[_0xde34('0xc')](_0x737fe3,_0x5b2d08)['then'](function(_0x2072fb){logger[_0xde34('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1b4e30,'request\x20sent');logger[_0xde34('0xe')](_0xde34('0xf'),_0x1b4e30,'request\x20sent',JSON[_0xde34('0x10')](_0x2072fb));if(_0x2072fb[_0xde34('0x11')]){if(_0x2072fb[_0xde34('0x11')][_0xde34('0x12')]===0x1f4){logger[_0xde34('0x11')](_0xde34('0x13'),_0x1b4e30,_0x2072fb[_0xde34('0x11')][_0xde34('0x14')]);return _0x3c6201(_0x2072fb[_0xde34('0x11')][_0xde34('0x14')]);}logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x1b4e30,_0x2072fb[_0xde34('0x11')][_0xde34('0x14')]);return _0x50868(_0x2072fb['error'][_0xde34('0x14')]);}else{logger[_0xde34('0xd')]('UserVoiceQueue,\x20%s,\x20%s',_0x1b4e30,_0xde34('0x15'));_0x50868(_0x2072fb[_0xde34('0x16')][_0xde34('0x14')]);}})[_0xde34('0x17')](function(_0x155b48){logger[_0xde34('0x11')](_0xde34('0x13'),_0x1b4e30,_0x155b48);_0x3c6201(_0x155b48);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 54d03a8..7e340c0 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 _0x2c79=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','connect-timeout'];(function(_0x36a073,_0x2ce3ce){var _0xc9762b=function(_0x416bfe){while(--_0x416bfe){_0x36a073['push'](_0x36a073['shift']());}};_0xc9762b(++_0x2ce3ce);}(_0x2c79,0x147));var _0x92c7=function(_0x4befaa,_0xb7fc18){_0x4befaa=_0x4befaa-0x0;var _0xedb6d3=_0x2c79[_0x4befaa];return _0xedb6d3;};'use strict';var multer=require('multer');var util=require(_0x92c7('0x0'));var path=require('path');var timeout=require(_0x92c7('0x1'));var express=require(_0x92c7('0x2'));var router=express['Router']();var auth=require(_0x92c7('0x3'));var interaction=require(_0x92c7('0x4'));var config=require(_0x92c7('0x5'));module[_0x92c7('0x6')]=router; \ No newline at end of file +var _0xfe39=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout'];(function(_0x230b0e,_0x3cc82b){var _0x5d262d=function(_0x143126){while(--_0x143126){_0x230b0e['push'](_0x230b0e['shift']());}};_0x5d262d(++_0x3cc82b);}(_0xfe39,0x8d));var _0x9fe3=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xfe39[_0x25e7cb];return _0x375d92;};'use strict';var multer=require(_0x9fe3('0x0'));var util=require(_0x9fe3('0x1'));var path=require('path');var timeout=require(_0x9fe3('0x2'));var express=require(_0x9fe3('0x3'));var router=express['Router']();var auth=require(_0x9fe3('0x4'));var interaction=require(_0x9fe3('0x5'));var config=require(_0x9fe3('0x6'));module[_0x9fe3('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 669cb5f..56bb9f4 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 _0x1b09=['STRING','Required\x20by\x20Asterisk','INTEGER'];(function(_0x4afc10,_0x3c9189){var _0x1b858a=function(_0x2ce5aa){while(--_0x2ce5aa){_0x4afc10['push'](_0x4afc10['shift']());}};_0x1b858a(++_0x3c9189);}(_0x1b09,0xc1));var _0x91b0=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x1b09[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x91b0('0x0')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x91b0('0x0')},'UserId':{'type':Sequelize[_0x91b0('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x91b0('0x0')},'VoiceQueueId':{'type':Sequelize[_0x91b0('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x91b0('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0x91b0('0x0')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x91b0('0x0')},'paused':{'type':Sequelize[_0x91b0('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xd103=['sequelize','exports','INTEGER','STRING','Required\x20by\x20Asterisk'];(function(_0x3c5753,_0x283dcf){var _0x57a4ae=function(_0x1b8ec0){while(--_0x1b8ec0){_0x3c5753['push'](_0x3c5753['shift']());}};_0x57a4ae(++_0x283dcf);}(_0xd103,0x19f));var _0x3d10=function(_0x276f75,_0x5461b3){_0x276f75=_0x276f75-0x0;var _0x3c6fc7=_0xd103[_0x276f75];return _0x3c6fc7;};'use strict';var Sequelize=require(_0x3d10('0x0'));module[_0x3d10('0x1')]={'uniqueid':{'type':Sequelize[_0x3d10('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x3d10('0x3')],'allowNull':![],'comment':_0x3d10('0x4')},'UserId':{'type':Sequelize[_0x3d10('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x3d10('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x3d10('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x3d10('0x4')},'penalty':{'type':Sequelize[_0x3d10('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x3d10('0x2')](0xb),'defaultValue':0x0,'comment':_0x3d10('0x4')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 822ca5f..a7fc5fc 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 _0xcd56=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x276cc4,_0x6f48a2){var _0x5e491a=function(_0x4c90e0){while(--_0x4c90e0){_0x276cc4['push'](_0x276cc4['shift']());}};_0x5e491a(++_0x6f48a2);}(_0xcd56,0x128));var _0x6cd5=function(_0x3b7927,_0x27c9f4){_0x3b7927=_0x3b7927-0x0;var _0x26f32e=_0xcd56[_0x3b7927];return _0x26f32e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x6cd5('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6cd5('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6cd5('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2373c7){return function(_0x2f77a7,_0x37a1a7,_0xdfa883){UserVoiceQueueRtEvents[_0x6cd5('0x3')](_0x2373c7+':'+_0x2f77a7['id'],_0x2f77a7);UserVoiceQueueRtEvents[_0x6cd5('0x3')](_0x2373c7,_0x2f77a7);_0xdfa883(null);};}for(var e in events){if(events[_0x6cd5('0x4')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x6cd5('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x2926=['UserVoiceQueueRt','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5a9469,_0x192093){var _0x2ba7e0=function(_0x4ebda7){while(--_0x4ebda7){_0x5a9469['push'](_0x5a9469['shift']());}};_0x2ba7e0(++_0x192093);}(_0x2926,0x1b7));var _0x6292=function(_0x46c1d5,_0x5ca335){_0x46c1d5=_0x46c1d5-0x0;var _0x40fe7b=_0x2926[_0x46c1d5];return _0x40fe7b;};'use strict';var EventEmitter=require(_0x6292('0x0'));var UserVoiceQueueRt=require(_0x6292('0x1'))['db'][_0x6292('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6292('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6292('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2398a7){return function(_0x59906a,_0x2ecf74,_0x311848){UserVoiceQueueRtEvents[_0x6292('0x5')](_0x2398a7+':'+_0x59906a['id'],_0x59906a);UserVoiceQueueRtEvents[_0x6292('0x5')](_0x2398a7,_0x59906a);_0x311848(null);};}for(var e in events){if(events[_0x6292('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x6292('0x7')](e,emitEvent(event));}}module[_0x6292('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 6ec334b..a400009 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 _0x1838=['rimraf','../../config/environment','define','UserVoiceQueueRt','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2b522b,_0x15f23e){var _0xcc61ad=function(_0x603c08){while(--_0x603c08){_0x2b522b['push'](_0x2b522b['shift']());}};_0xcc61ad(++_0x15f23e);}(_0x1838,0xb4));var _0x8183=function(_0x5228fe,_0x3a1156){_0x5228fe=_0x5228fe-0x0;var _0x20290b=_0x1838[_0x5228fe];return _0x20290b;};'use strict';var _=require(_0x8183('0x0'));var util=require(_0x8183('0x1'));var logger=require(_0x8183('0x2'))('api');var moment=require(_0x8183('0x3'));var BPromise=require(_0x8183('0x4'));var rp=require(_0x8183('0x5'));var fs=require('fs');var path=require(_0x8183('0x6'));var rimraf=require(_0x8183('0x7'));var config=require(_0x8183('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x48f1b9,_0x666147){return _0x48f1b9[_0x8183('0x9')](_0x8183('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6556=['api','moment','bluebird','path','./userVoiceQueueRt.attributes','exports','lodash','util','../../config/logger'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0x6556,0xf0));var _0x6655=function(_0x1637c2,_0x5bed86){_0x1637c2=_0x1637c2-0x0;var _0x4a61ff=_0x6556[_0x1637c2];return _0x4a61ff;};'use strict';var _=require(_0x6655('0x0'));var util=require(_0x6655('0x1'));var logger=require(_0x6655('0x2'))(_0x6655('0x3'));var moment=require(_0x6655('0x4'));var BPromise=require(_0x6655('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6655('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6655('0x7'));module[_0x6655('0x8')]=function(_0x10e17b,_0x205bee){return _0x10e17b['define']('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 6ba0d83..9e19244 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 _0x56e6=['info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket'];(function(_0xfe26da,_0x5ac1b7){var _0x2abe6e=function(_0x586ea1){while(--_0x586ea1){_0xfe26da['push'](_0xfe26da['shift']());}};_0x2abe6e(++_0x5ac1b7);}(_0x56e6,0x82));var _0x656e=function(_0x2389b0,_0xbdafc2){_0x2389b0=_0x2389b0-0x0;var _0x3b3b42=_0x56e6[_0x2389b0];return _0x3b3b42;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x656e('0x0'));var BPromise=require(_0x656e('0x1'));var rs=require(_0x656e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x656e('0x3'))['db'];var utils=require(_0x656e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x656e('0x5'));var jayson=require(_0x656e('0x6'));var client=jayson[_0x656e('0x7')][_0x656e('0x8')]({'port':0x232a});config['redis']=_[_0x656e('0x9')](config['redis'],{'host':_0x656e('0xa'),'port':0x18eb});var socket=require(_0x656e('0xb'))(new Redis(config[_0x656e('0xc')]));require(_0x656e('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ea779,_0x4c4978,_0x49bd7b){return new BPromise(function(_0x51d65f,_0x1bec9b){return client['request'](_0x1ea779,_0x49bd7b)['then'](function(_0x132813){logger[_0x656e('0xe')](_0x656e('0xf'),_0x4c4978,_0x656e('0x10'));logger[_0x656e('0x11')](_0x656e('0x12'),_0x4c4978,_0x656e('0x10'),JSON[_0x656e('0x13')](_0x132813));if(_0x132813['error']){if(_0x132813[_0x656e('0x14')][_0x656e('0x15')]===0x1f4){logger[_0x656e('0x14')](_0x656e('0xf'),_0x4c4978,_0x132813[_0x656e('0x14')][_0x656e('0x16')]);return _0x1bec9b(_0x132813[_0x656e('0x14')][_0x656e('0x16')]);}logger[_0x656e('0x14')](_0x656e('0xf'),_0x4c4978,_0x132813[_0x656e('0x14')][_0x656e('0x16')]);return _0x51d65f(_0x132813[_0x656e('0x14')]['message']);}else{logger['info'](_0x656e('0xf'),_0x4c4978,_0x656e('0x10'));_0x51d65f(_0x132813['result'][_0x656e('0x16')]);}})[_0x656e('0x17')](function(_0x2ca080){logger[_0x656e('0x14')](_0x656e('0xf'),_0x4c4978,_0x2ca080);_0x1bec9b(_0x2ca080);});});}exports[_0x656e('0x18')]=function(_0x33aff6){var _0xe6d447=this;return new Promise(function(_0xa69993,_0x34e45e){return db[_0x656e('0x19')][_0x656e('0x1a')]({'raw':_0x33aff6[_0x656e('0x1b')]?_0x33aff6[_0x656e('0x1b')][_0x656e('0x1c')]===undefined?!![]:![]:!![],'where':_0x33aff6['options']?_0x33aff6['options'][_0x656e('0x1d')]||null:null,'attributes':[[db[_0x656e('0x1e')]['fn'](_0x656e('0x1f'),db['sequelize']['fn']('IF',db[_0x656e('0x1e')][_0x656e('0x20')](_0x656e('0x21')))),_0x656e('0x22')]]})[_0x656e('0x23')](function(_0x4aeb8e){logger[_0x656e('0xe')](_0x656e('0x18'),_0x33aff6);logger['debug'](_0x656e('0x18'),_0x33aff6,JSON[_0x656e('0x13')](_0x4aeb8e));_0xa69993(_0x4aeb8e);})[_0x656e('0x17')](function(_0x57dbcf){logger[_0x656e('0x14')]('GetVoiceQueueRtPauses',_0x57dbcf[_0x656e('0x16')],_0x33aff6);_0x34e45e(_0xe6d447[_0x656e('0x14')](0x1f4,_0x57dbcf[_0x656e('0x16')]));});});}; \ No newline at end of file +var _0x689b=['request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','GetVoiceQueueRtPauses','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x198446,_0x119c8f){var _0x38d7b7=function(_0x293752){while(--_0x293752){_0x198446['push'](_0x198446['shift']());}};_0x38d7b7(++_0x119c8f);}(_0x689b,0x1b5));var _0xb689=function(_0x180c73,_0x4f853a){_0x180c73=_0x180c73-0x0;var _0x3bc74b=_0x689b[_0x180c73];return _0x3bc74b;};'use strict';var _=require(_0xb689('0x0'));var util=require(_0xb689('0x1'));var moment=require('moment');var BPromise=require(_0xb689('0x2'));var rs=require(_0xb689('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb689('0x4'))['db'];var utils=require(_0xb689('0x5'));var logger=require('../../config/logger')(_0xb689('0x6'));var config=require(_0xb689('0x7'));var jayson=require(_0xb689('0x8'));var client=jayson['client'][_0xb689('0x9')]({'port':0x232a});config[_0xb689('0xa')]=_['defaults'](config[_0xb689('0xa')],{'host':_0xb689('0xb'),'port':0x18eb});var socket=require(_0xb689('0xc'))(new Redis(config[_0xb689('0xa')]));require(_0xb689('0xd'))['register'](socket);function respondWithRpcPromise(_0x592e3d,_0x152ee9,_0x4ce4e2){return new BPromise(function(_0x3382c1,_0x4de0d6){return client[_0xb689('0xe')](_0x592e3d,_0x4ce4e2)[_0xb689('0xf')](function(_0x3138d8){logger[_0xb689('0x10')](_0xb689('0x11'),_0x152ee9,_0xb689('0x12'));logger[_0xb689('0x13')](_0xb689('0x14'),_0x152ee9,_0xb689('0x12'),JSON['stringify'](_0x3138d8));if(_0x3138d8['error']){if(_0x3138d8[_0xb689('0x15')][_0xb689('0x16')]===0x1f4){logger[_0xb689('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x152ee9,_0x3138d8['error'][_0xb689('0x17')]);return _0x4de0d6(_0x3138d8[_0xb689('0x15')]['message']);}logger['error'](_0xb689('0x11'),_0x152ee9,_0x3138d8[_0xb689('0x15')]['message']);return _0x3382c1(_0x3138d8[_0xb689('0x15')]['message']);}else{logger[_0xb689('0x10')](_0xb689('0x11'),_0x152ee9,_0xb689('0x12'));_0x3382c1(_0x3138d8[_0xb689('0x18')]['message']);}})[_0xb689('0x19')](function(_0x887f64){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x152ee9,_0x887f64);_0x4de0d6(_0x887f64);});});}exports['GetVoiceQueueRtPauses']=function(_0x2c4838){var _0x2779ab=this;return new Promise(function(_0x911368,_0x3a7241){return db[_0xb689('0x1a')]['findAll']({'raw':_0x2c4838[_0xb689('0x1b')]?_0x2c4838['options'][_0xb689('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c4838[_0xb689('0x1b')]?_0x2c4838[_0xb689('0x1b')][_0xb689('0x1d')]||null:null,'attributes':[[db[_0xb689('0x1e')]['fn'](_0xb689('0x1f'),db[_0xb689('0x1e')]['fn']('IF',db['sequelize'][_0xb689('0x20')](_0xb689('0x21')))),'outboundQueuePauses']]})[_0xb689('0xf')](function(_0x10cb90){logger[_0xb689('0x10')]('GetVoiceQueueRtPauses',_0x2c4838);logger[_0xb689('0x13')](_0xb689('0x22'),_0x2c4838,JSON['stringify'](_0x10cb90));_0x911368(_0x10cb90);})[_0xb689('0x19')](function(_0x286659){logger[_0xb689('0x15')]('GetVoiceQueueRtPauses',_0x286659[_0xb689('0x17')],_0x2c4838);_0x3a7241(_0x2779ab[_0xb689('0x15')](0x1f4,_0x286659[_0xb689('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 3ce5ad6..08613a4 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 _0x759f=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x759f,0x17a));var _0xf759=function(_0x468c9a,_0x45e9db){_0x468c9a=_0x468c9a-0x0;var _0x1eb11a=_0x759f[_0x468c9a];return _0x1eb11a;};'use strict';var UserVoiceQueueRtEvents=require(_0xf759('0x0'));var events=[_0xf759('0x1'),_0xf759('0x2'),_0xf759('0x3')];function createListener(_0x496ead,_0x5c6bed){return function(_0x17ea83){_0x5c6bed[_0xf759('0x4')](_0x496ead,_0x17ea83);};}function removeListener(_0x37eda1,_0x5ad61a){return function(){UserVoiceQueueRtEvents[_0xf759('0x5')](_0x37eda1,_0x5ad61a);};}exports[_0xf759('0x6')]=function(_0x23c938){for(var _0x6de6fb=0x0,_0x3c0b62=events[_0xf759('0x7')];_0x6de6fb<_0x3c0b62;_0x6de6fb++){var _0x6ef4f0=events[_0x6de6fb];var _0x5e1e06=createListener(_0xf759('0x8')+_0x6ef4f0,_0x23c938);UserVoiceQueueRtEvents['on'](_0x6ef4f0,_0x5e1e06);}}; \ No newline at end of file +var _0x0938=['update','removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x41a1a8,_0x19214b){var _0x2e3157=function(_0x41d468){while(--_0x41d468){_0x41a1a8['push'](_0x41a1a8['shift']());}};_0x2e3157(++_0x19214b);}(_0x0938,0x74));var _0x8093=function(_0x1065a9,_0x951135){_0x1065a9=_0x1065a9-0x0;var _0x2bef4d=_0x0938[_0x1065a9];return _0x2bef4d;};'use strict';var UserVoiceQueueRtEvents=require(_0x8093('0x0'));var events=[_0x8093('0x1'),_0x8093('0x2'),_0x8093('0x3')];function createListener(_0x47837b,_0x3f879d){return function(_0x17abcf){_0x3f879d['emit'](_0x47837b,_0x17abcf);};}function removeListener(_0x4d0fdb,_0x5dca16){return function(){UserVoiceQueueRtEvents[_0x8093('0x4')](_0x4d0fdb,_0x5dca16);};}exports['register']=function(_0x30e767){for(var _0x20a374=0x0,_0x10b6a9=events[_0x8093('0x5')];_0x20a374<_0x10b6a9;_0x20a374++){var _0x4de00f=events[_0x20a374];var _0x3382e4=createListener(_0x8093('0x6')+_0x4de00f,_0x30e767);UserVoiceQueueRtEvents['on'](_0x4de00f,_0x3382e4);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 190fa1a..e2e36b0 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 _0xd8b4=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','destroy'];(function(_0x360085,_0x62f310){var _0x32c97c=function(_0x2763cf){while(--_0x2763cf){_0x360085['push'](_0x360085['shift']());}};_0x32c97c(++_0x62f310);}(_0xd8b4,0x89));var _0x4d8b=function(_0x42858b,_0x4eba05){_0x42858b=_0x42858b-0x0;var _0x731031=_0xd8b4[_0x42858b];return _0x731031;};'use strict';var multer=require(_0x4d8b('0x0'));var util=require(_0x4d8b('0x1'));var path=require('path');var timeout=require(_0x4d8b('0x2'));var express=require(_0x4d8b('0x3'));var router=express[_0x4d8b('0x4')]();var auth=require(_0x4d8b('0x5'));var interaction=require(_0x4d8b('0x6'));var config=require(_0x4d8b('0x7'));var controller=require('./variable.controller');router[_0x4d8b('0x8')]('/',auth[_0x4d8b('0x9')](),controller['index']);router[_0x4d8b('0x8')](_0x4d8b('0xa'),auth[_0x4d8b('0x9')](),controller[_0x4d8b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4d8b('0xc')]);router[_0x4d8b('0xd')](_0x4d8b('0xa'),auth[_0x4d8b('0x9')](),controller[_0x4d8b('0xe')]);router['delete']('/:id',auth[_0x4d8b('0x9')](),controller[_0x4d8b('0xf')]);module[_0x4d8b('0x10')]=router; \ No newline at end of file +var _0xa5bf=['post','create','/:id','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','show'];(function(_0x3a8ec5,_0x378f44){var _0x483caf=function(_0x559670){while(--_0x559670){_0x3a8ec5['push'](_0x3a8ec5['shift']());}};_0x483caf(++_0x378f44);}(_0xa5bf,0xcc));var _0xfa5b=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa5bf[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xfa5b('0x0'));var util=require('util');var path=require(_0xfa5b('0x1'));var timeout=require(_0xfa5b('0x2'));var express=require(_0xfa5b('0x3'));var router=express['Router']();var auth=require(_0xfa5b('0x4'));var interaction=require(_0xfa5b('0x5'));var config=require(_0xfa5b('0x6'));var controller=require(_0xfa5b('0x7'));router[_0xfa5b('0x8')]('/',auth[_0xfa5b('0x9')](),controller[_0xfa5b('0xa')]);router[_0xfa5b('0x8')]('/:id',auth[_0xfa5b('0x9')](),controller[_0xfa5b('0xb')]);router[_0xfa5b('0xc')]('/',auth['isAuthenticated'](),controller[_0xfa5b('0xd')]);router['put'](_0xfa5b('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xfa5b('0xf')]('/:id',auth[_0xfa5b('0x9')](),controller[_0xfa5b('0x10')]);module[_0xfa5b('0x11')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 44ef93f..cd0e693 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 _0xdf70=['STRING','sequelize','exports','name'];(function(_0x544762,_0x13234a){var _0x58df2a=function(_0x255335){while(--_0x255335){_0x544762['push'](_0x544762['shift']());}};_0x58df2a(++_0x13234a);}(_0xdf70,0x165));var _0x0df7=function(_0xd8b2aa,_0x3b5e2c){_0xd8b2aa=_0xd8b2aa-0x0;var _0x5255c5=_0xdf70[_0xd8b2aa];return _0x5255c5;};'use strict';var Sequelize=require(_0x0df7('0x0'));module[_0x0df7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0df7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0df7('0x3')]}}; \ No newline at end of file +var _0xc8da=['name','STRING','exports'];(function(_0x5697b,_0x543a2f){var _0x37ef09=function(_0x214c5f){while(--_0x214c5f){_0x5697b['push'](_0x5697b['shift']());}};_0x37ef09(++_0x543a2f);}(_0xc8da,0x119));var _0xac8d=function(_0x4641e0,_0x585d0a){_0x4641e0=_0x4641e0-0x0;var _0xaade0d=_0xc8da[_0x4641e0];return _0xaade0d;};'use strict';var Sequelize=require('sequelize');module[_0xac8d('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xac8d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xac8d('0x2')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 4898518..db87261 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 _0xaa48=['fields','length','attributes','order','sort','where','pick','filter','options','count','includeAll','include','Variable','findAll','rows','catch','show','params','keys','merge','find','create','user','get','UserProfileSection','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','reject','update','then','destroy','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x21a5bb,_0x2186ea){var _0x54cd3a=function(_0x2cd8b1){while(--_0x2cd8b1){_0x21a5bb['push'](_0x21a5bb['shift']());}};_0x54cd3a(++_0x2186ea);}(_0xaa48,0x15a));var _0x8aa4=function(_0x4bc63a,_0xe16c27){_0x4bc63a=_0x4bc63a-0x0;var _0x548351=_0xaa48[_0x4bc63a];return _0x548351;};'use strict';var pdf=require(_0x8aa4('0x0'));var emlformat=require(_0x8aa4('0x1'));var rimraf=require(_0x8aa4('0x2'));var zipdir=require(_0x8aa4('0x3'));var jsonpatch=require(_0x8aa4('0x4'));var rp=require(_0x8aa4('0x5'));var moment=require(_0x8aa4('0x6'));var BPromise=require(_0x8aa4('0x7'));var Mustache=require(_0x8aa4('0x8'));var util=require(_0x8aa4('0x9'));var path=require(_0x8aa4('0xa'));var sox=require(_0x8aa4('0xb'));var csv=require(_0x8aa4('0xc'));var ejs=require(_0x8aa4('0xd'));var fs=require('fs');var _=require(_0x8aa4('0xe'));var squel=require(_0x8aa4('0xf'));var crypto=require(_0x8aa4('0x10'));var jsforce=require(_0x8aa4('0x11'));var deskjs=require(_0x8aa4('0x12'));var toCsv=require('to-csv');var querystring=require(_0x8aa4('0x13'));var Papa=require(_0x8aa4('0x14'));var Redis=require('ioredis');var authService=require(_0x8aa4('0x15'));var qs=require(_0x8aa4('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8aa4('0x17'));var logger=require(_0x8aa4('0x18'))(_0x8aa4('0x19'));var utils=require(_0x8aa4('0x1a'));var config=require(_0x8aa4('0x1b'));var db=require(_0x8aa4('0x1c'))['db'];function respondWithStatusCode(_0x824014,_0x3dc274){_0x3dc274=_0x3dc274||0xcc;return function(_0x1dc057){if(_0x1dc057){return _0x824014[_0x8aa4('0x1d')](_0x3dc274);}return _0x824014['status'](_0x3dc274)['end']();};}function respondWithResult(_0x3143f7,_0x455a80){_0x455a80=_0x455a80||0xc8;return function(_0xb8ce80){if(_0xb8ce80){return _0x3143f7[_0x8aa4('0x1e')](_0x455a80)[_0x8aa4('0x1f')](_0xb8ce80);}};}function respondWithFilteredResult(_0x406f0e,_0x2b3f62){return function(_0x356df1){if(_0x356df1){var _0x1ae822=_0x356df1['count'],_0xce8df5=_0x2b3f62[_0x8aa4('0x20')],_0x5cca31=_0x2b3f62[_0x8aa4('0x20')]+_0x2b3f62[_0x8aa4('0x21')],_0x5abc5a;if(_0x5cca31>=_0x1ae822){_0x5cca31=_0x1ae822;_0x5abc5a=0xc8;}else{_0x5abc5a=0xce;}_0x406f0e[_0x8aa4('0x1e')](_0x5abc5a);return _0x406f0e['set'](_0x8aa4('0x22'),_0xce8df5+'-'+_0x5cca31+'/'+_0x1ae822)[_0x8aa4('0x1f')](_0x356df1);}return null;};}function patchUpdates(_0x59d3a2){return function(_0x3d6353){try{jsonpatch['apply'](_0x3d6353,_0x59d3a2,!![]);}catch(_0x5e8a77){return BPromise[_0x8aa4('0x23')](_0x5e8a77);}return _0x3d6353['save']();};}function saveUpdates(_0x324d59,_0x2df294){return function(_0x521b69){if(_0x521b69){return _0x521b69[_0x8aa4('0x24')](_0x324d59)[_0x8aa4('0x25')](function(_0x4c45c9){return _0x4c45c9;});}return null;};}function removeEntity(_0x1a514e,_0x2859d1){return function(_0x1c8676){if(_0x1c8676){return _0x1c8676[_0x8aa4('0x26')]()[_0x8aa4('0x25')](function(){var _0x4ecaec=_0x1c8676['get']({'plain':!![]});var _0x4c429f='Variables';return db[_0x8aa4('0x27')]['destroy']({'where':{'type':_0x4c429f,'resourceId':_0x4ecaec['id']}})[_0x8aa4('0x25')](function(){return _0x1c8676;});})[_0x8aa4('0x25')](function(){_0x1a514e[_0x8aa4('0x1e')](0xcc)[_0x8aa4('0x28')]();});}};}function handleEntityNotFound(_0x5b8165,_0x513cb9){return function(_0x30f7d1){if(!_0x30f7d1){_0x5b8165['sendStatus'](0x194);}return _0x30f7d1;};}function handleError(_0x286601,_0x4145ed){_0x4145ed=_0x4145ed||0x1f4;return function(_0x556f5c){logger[_0x8aa4('0x29')](_0x556f5c['stack']);if(_0x556f5c[_0x8aa4('0x2a')]){delete _0x556f5c['name'];}_0x286601[_0x8aa4('0x1e')](_0x4145ed)[_0x8aa4('0x2b')](_0x556f5c);};}exports[_0x8aa4('0x2c')]=function(_0xf88a0e,_0x169ca3){var _0x4ba8b8={},_0x5d4894={},_0x5f1028={'count':0x0,'rows':[]};var _0x2aec56=_[_0x8aa4('0x2d')](db['Variable'][_0x8aa4('0x2e')],function(_0x1f452e){return{'name':_0x1f452e[_0x8aa4('0x2f')],'type':_0x1f452e[_0x8aa4('0x30')][_0x8aa4('0x31')]};});_0x5d4894[_0x8aa4('0x32')]=_['map'](_0x2aec56,_0x8aa4('0x2a'));_0x5d4894['query']=_['keys'](_0xf88a0e[_0x8aa4('0x33')]);_0x5d4894[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],_0x5d4894[_0x8aa4('0x33')]);_0x4ba8b8['attributes']=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],qs[_0x8aa4('0x36')](_0xf88a0e['query']['fields']));_0x4ba8b8['attributes']=_0x4ba8b8['attributes'][_0x8aa4('0x37')]?_0x4ba8b8[_0x8aa4('0x38')]:_0x5d4894[_0x8aa4('0x32')];if(!_0xf88a0e[_0x8aa4('0x33')]['hasOwnProperty']('nolimit')){_0x4ba8b8[_0x8aa4('0x21')]=qs[_0x8aa4('0x21')](_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x21')]);_0x4ba8b8[_0x8aa4('0x20')]=qs['offset'](_0xf88a0e['query'][_0x8aa4('0x20')]);}_0x4ba8b8[_0x8aa4('0x39')]=qs[_0x8aa4('0x3a')](_0xf88a0e['query'][_0x8aa4('0x3a')]);_0x4ba8b8[_0x8aa4('0x3b')]=qs['filters'](_[_0x8aa4('0x3c')](_0xf88a0e[_0x8aa4('0x33')],_0x5d4894[_0x8aa4('0x34')]));if(_0xf88a0e['query'][_0x8aa4('0x3d')]){_0x4ba8b8['where']=_['merge'](_0x4ba8b8[_0x8aa4('0x3b')],{'$or':_['map'](_0x2aec56,function(_0x36b960){if(_0x36b960[_0x8aa4('0x30')]!=='VIRTUAL'){var _0x230b7b={};_0x230b7b[_0x36b960[_0x8aa4('0x2a')]]={'$like':'%'+_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x3d')]+'%'};return _0x230b7b;}})});}_0x4ba8b8=_['merge']({},_0x4ba8b8,_0xf88a0e[_0x8aa4('0x3e')]);var _0xca05c8={'where':_0x4ba8b8[_0x8aa4('0x3b')]};return db['Variable'][_0x8aa4('0x3f')](_0xca05c8)[_0x8aa4('0x25')](function(_0x5013a2){_0x5f1028[_0x8aa4('0x3f')]=_0x5013a2;if(_0xf88a0e['query'][_0x8aa4('0x40')]){_0x4ba8b8[_0x8aa4('0x41')]=[{'all':!![]}];}return db[_0x8aa4('0x42')][_0x8aa4('0x43')](_0x4ba8b8);})[_0x8aa4('0x25')](function(_0x424100){_0x5f1028[_0x8aa4('0x44')]=_0x424100;return _0x5f1028;})[_0x8aa4('0x25')](respondWithFilteredResult(_0x169ca3,_0x4ba8b8))[_0x8aa4('0x45')](handleError(_0x169ca3,null));};exports[_0x8aa4('0x46')]=function(_0x87d3e,_0x228e64){var _0x234325={'raw':!![],'where':{'id':_0x87d3e[_0x8aa4('0x47')]['id']}},_0x521ebe={};_0x521ebe[_0x8aa4('0x32')]=_[_0x8aa4('0x48')](db[_0x8aa4('0x42')][_0x8aa4('0x2e')]);_0x521ebe[_0x8aa4('0x33')]=_[_0x8aa4('0x48')](_0x87d3e['query']);_0x521ebe[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x521ebe[_0x8aa4('0x32')],_0x521ebe['query']);_0x234325['attributes']=_['intersection'](_0x521ebe[_0x8aa4('0x32')],qs['fields'](_0x87d3e[_0x8aa4('0x33')][_0x8aa4('0x36')]));_0x234325[_0x8aa4('0x38')]=_0x234325[_0x8aa4('0x38')][_0x8aa4('0x37')]?_0x234325[_0x8aa4('0x38')]:_0x521ebe[_0x8aa4('0x32')];if(_0x87d3e['query'][_0x8aa4('0x40')]){_0x234325[_0x8aa4('0x41')]=[{'all':!![]}];}_0x234325=_[_0x8aa4('0x49')]({},_0x234325,_0x87d3e[_0x8aa4('0x3e')]);return db[_0x8aa4('0x42')][_0x8aa4('0x4a')](_0x234325)['then'](handleEntityNotFound(_0x228e64,null))[_0x8aa4('0x25')](respondWithResult(_0x228e64,null))[_0x8aa4('0x45')](handleError(_0x228e64,null));};exports['create']=function(_0x436ad7,_0x50eed7){return db[_0x8aa4('0x42')][_0x8aa4('0x4b')](_0x436ad7['body'],{})[_0x8aa4('0x25')](function(_0x370725){var _0x4d193b=_0x436ad7[_0x8aa4('0x4c')][_0x8aa4('0x4d')]({'plain':!![]});if(!_0x4d193b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d193b['role']===_0x8aa4('0x4c')){var _0x2c7958=_0x370725[_0x8aa4('0x4d')]({'plain':!![]});var _0x3fcc7a='Variables';return db[_0x8aa4('0x4e')]['find']({'where':{'name':_0x3fcc7a,'userProfileId':_0x4d193b['userProfileId']},'raw':!![]})[_0x8aa4('0x25')](function(_0x25fd01){if(_0x25fd01&&_0x25fd01['autoAssociation']===0x0){return db[_0x8aa4('0x27')][_0x8aa4('0x4b')]({'name':_0x2c7958['name'],'resourceId':_0x2c7958['id'],'type':_0x25fd01[_0x8aa4('0x2a')],'sectionId':_0x25fd01['id']},{})[_0x8aa4('0x25')](function(){return _0x370725;});}else{return _0x370725;}})[_0x8aa4('0x45')](function(_0x221685){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x221685);throw _0x221685;});}return _0x370725;})[_0x8aa4('0x25')](respondWithResult(_0x50eed7,0xc9))[_0x8aa4('0x45')](handleError(_0x50eed7,null));};exports[_0x8aa4('0x24')]=function(_0x3aff5e,_0x19e3ae){if(_0x3aff5e[_0x8aa4('0x4f')]['id']){delete _0x3aff5e[_0x8aa4('0x4f')]['id'];}return db[_0x8aa4('0x42')][_0x8aa4('0x4a')]({'where':{'id':_0x3aff5e['params']['id']}})[_0x8aa4('0x25')](handleEntityNotFound(_0x19e3ae,null))[_0x8aa4('0x25')](saveUpdates(_0x3aff5e[_0x8aa4('0x4f')],null))['then'](respondWithResult(_0x19e3ae,null))[_0x8aa4('0x45')](handleError(_0x19e3ae,null));};exports[_0x8aa4('0x26')]=function(_0xa021a5,_0x5b0f26){return db['Variable'][_0x8aa4('0x4a')]({'where':{'id':_0xa021a5[_0x8aa4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b0f26,null))[_0x8aa4('0x25')](removeEntity(_0x5b0f26,null))[_0x8aa4('0x45')](handleError(_0x5b0f26,null));}; \ No newline at end of file +var _0x7f21=['moment','mustache','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/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Variable','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','merge','filter','options','count','includeAll','include','show','params','find','create','body','user','role','get','Variables','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x16cb03,_0x43ea58){var _0x10944e=function(_0x27ebaa){while(--_0x27ebaa){_0x16cb03['push'](_0x16cb03['shift']());}};_0x10944e(++_0x43ea58);}(_0x7f21,0x95));var _0x17f2=function(_0x396b20,_0x1c346a){_0x396b20=_0x396b20-0x0;var _0x31a8cc=_0x7f21[_0x396b20];return _0x31a8cc;};'use strict';var pdf=require(_0x17f2('0x0'));var emlformat=require(_0x17f2('0x1'));var rimraf=require(_0x17f2('0x2'));var zipdir=require(_0x17f2('0x3'));var jsonpatch=require(_0x17f2('0x4'));var rp=require('request-promise');var moment=require(_0x17f2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x17f2('0x6'));var util=require('util');var path=require(_0x17f2('0x7'));var sox=require('sox');var csv=require(_0x17f2('0x8'));var ejs=require(_0x17f2('0x9'));var fs=require('fs');var _=require(_0x17f2('0xa'));var squel=require('squel');var crypto=require(_0x17f2('0xb'));var jsforce=require(_0x17f2('0xc'));var deskjs=require(_0x17f2('0xd'));var toCsv=require(_0x17f2('0x8'));var querystring=require(_0x17f2('0xe'));var Papa=require(_0x17f2('0xf'));var Redis=require(_0x17f2('0x10'));var authService=require(_0x17f2('0x11'));var qs=require(_0x17f2('0x12'));var as=require(_0x17f2('0x13'));var hardwareService=require(_0x17f2('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x17f2('0x15'));var db=require(_0x17f2('0x16'))['db'];function respondWithStatusCode(_0x416a37,_0xab7c84){_0xab7c84=_0xab7c84||0xcc;return function(_0x58465d){if(_0x58465d){return _0x416a37['sendStatus'](_0xab7c84);}return _0x416a37[_0x17f2('0x17')](_0xab7c84)[_0x17f2('0x18')]();};}function respondWithResult(_0x18bc97,_0x22f6c2){_0x22f6c2=_0x22f6c2||0xc8;return function(_0x238496){if(_0x238496){return _0x18bc97['status'](_0x22f6c2)[_0x17f2('0x19')](_0x238496);}};}function respondWithFilteredResult(_0x57324c,_0x258347){return function(_0x4becbe){if(_0x4becbe){var _0x337437=_0x4becbe['count'],_0x30d44a=_0x258347[_0x17f2('0x1a')],_0x18f4a9=_0x258347[_0x17f2('0x1a')]+_0x258347['limit'],_0x51e3c2;if(_0x18f4a9>=_0x337437){_0x18f4a9=_0x337437;_0x51e3c2=0xc8;}else{_0x51e3c2=0xce;}_0x57324c[_0x17f2('0x17')](_0x51e3c2);return _0x57324c[_0x17f2('0x1b')](_0x17f2('0x1c'),_0x30d44a+'-'+_0x18f4a9+'/'+_0x337437)['json'](_0x4becbe);}return null;};}function patchUpdates(_0x901911){return function(_0x439e1b){try{jsonpatch[_0x17f2('0x1d')](_0x439e1b,_0x901911,!![]);}catch(_0x5bb421){return BPromise[_0x17f2('0x1e')](_0x5bb421);}return _0x439e1b[_0x17f2('0x1f')]();};}function saveUpdates(_0x3a6526,_0x4dbfe3){return function(_0x247b95){if(_0x247b95){return _0x247b95[_0x17f2('0x20')](_0x3a6526)[_0x17f2('0x21')](function(_0x27b9d1){return _0x27b9d1;});}return null;};}function removeEntity(_0xa6f088,_0x3bc000){return function(_0x1582d7){if(_0x1582d7){return _0x1582d7[_0x17f2('0x22')]()[_0x17f2('0x21')](function(){var _0x5f0408=_0x1582d7['get']({'plain':!![]});var _0x565fe8='Variables';return db[_0x17f2('0x23')][_0x17f2('0x22')]({'where':{'type':_0x565fe8,'resourceId':_0x5f0408['id']}})[_0x17f2('0x21')](function(){return _0x1582d7;});})[_0x17f2('0x21')](function(){_0xa6f088[_0x17f2('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2a55,_0xe1727c){return function(_0x3a945b){if(!_0x3a945b){_0x4f2a55['sendStatus'](0x194);}return _0x3a945b;};}function handleError(_0x1682e0,_0x2a9473){_0x2a9473=_0x2a9473||0x1f4;return function(_0x1281b9){logger[_0x17f2('0x24')](_0x1281b9[_0x17f2('0x25')]);if(_0x1281b9[_0x17f2('0x26')]){delete _0x1281b9[_0x17f2('0x26')];}_0x1682e0[_0x17f2('0x17')](_0x2a9473)[_0x17f2('0x27')](_0x1281b9);};}exports[_0x17f2('0x28')]=function(_0x476fac,_0x46c389){var _0x5b0406={},_0x12bc2e={},_0x5e0cc2={'count':0x0,'rows':[]};var _0x4a4ed5=_[_0x17f2('0x29')](db[_0x17f2('0x2a')]['rawAttributes'],function(_0x512f92){return{'name':_0x512f92[_0x17f2('0x2b')],'type':_0x512f92[_0x17f2('0x2c')][_0x17f2('0x2d')]};});_0x12bc2e[_0x17f2('0x2e')]=_[_0x17f2('0x29')](_0x4a4ed5,_0x17f2('0x26'));_0x12bc2e[_0x17f2('0x2f')]=_[_0x17f2('0x30')](_0x476fac[_0x17f2('0x2f')]);_0x12bc2e[_0x17f2('0x31')]=_[_0x17f2('0x32')](_0x12bc2e['model'],_0x12bc2e[_0x17f2('0x2f')]);_0x5b0406[_0x17f2('0x33')]=_[_0x17f2('0x32')](_0x12bc2e[_0x17f2('0x2e')],qs['fields'](_0x476fac[_0x17f2('0x2f')][_0x17f2('0x34')]));_0x5b0406[_0x17f2('0x33')]=_0x5b0406['attributes'][_0x17f2('0x35')]?_0x5b0406[_0x17f2('0x33')]:_0x12bc2e[_0x17f2('0x2e')];if(!_0x476fac[_0x17f2('0x2f')][_0x17f2('0x36')]('nolimit')){_0x5b0406[_0x17f2('0x37')]=qs[_0x17f2('0x37')](_0x476fac[_0x17f2('0x2f')][_0x17f2('0x37')]);_0x5b0406[_0x17f2('0x1a')]=qs[_0x17f2('0x1a')](_0x476fac[_0x17f2('0x2f')][_0x17f2('0x1a')]);}_0x5b0406['order']=qs[_0x17f2('0x38')](_0x476fac['query'][_0x17f2('0x38')]);_0x5b0406[_0x17f2('0x39')]=qs[_0x17f2('0x31')](_[_0x17f2('0x3a')](_0x476fac[_0x17f2('0x2f')],_0x12bc2e[_0x17f2('0x31')]));if(_0x476fac[_0x17f2('0x2f')]['filter']){_0x5b0406[_0x17f2('0x39')]=_[_0x17f2('0x3b')](_0x5b0406[_0x17f2('0x39')],{'$or':_['map'](_0x4a4ed5,function(_0x1ebfe4){if(_0x1ebfe4[_0x17f2('0x2c')]!=='VIRTUAL'){var _0x1e6b66={};_0x1e6b66[_0x1ebfe4[_0x17f2('0x26')]]={'$like':'%'+_0x476fac[_0x17f2('0x2f')][_0x17f2('0x3c')]+'%'};return _0x1e6b66;}})});}_0x5b0406=_[_0x17f2('0x3b')]({},_0x5b0406,_0x476fac[_0x17f2('0x3d')]);var _0x32585a={'where':_0x5b0406['where']};return db[_0x17f2('0x2a')]['count'](_0x32585a)[_0x17f2('0x21')](function(_0x5d66ae){_0x5e0cc2[_0x17f2('0x3e')]=_0x5d66ae;if(_0x476fac[_0x17f2('0x2f')][_0x17f2('0x3f')]){_0x5b0406[_0x17f2('0x40')]=[{'all':!![]}];}return db[_0x17f2('0x2a')]['findAll'](_0x5b0406);})['then'](function(_0x1c7d4c){_0x5e0cc2['rows']=_0x1c7d4c;return _0x5e0cc2;})[_0x17f2('0x21')](respondWithFilteredResult(_0x46c389,_0x5b0406))['catch'](handleError(_0x46c389,null));};exports[_0x17f2('0x41')]=function(_0xc63e46,_0x3dd422){var _0x134ca9={'raw':!![],'where':{'id':_0xc63e46[_0x17f2('0x42')]['id']}},_0x1b9cc5={};_0x1b9cc5[_0x17f2('0x2e')]=_['keys'](db[_0x17f2('0x2a')]['rawAttributes']);_0x1b9cc5[_0x17f2('0x2f')]=_[_0x17f2('0x30')](_0xc63e46[_0x17f2('0x2f')]);_0x1b9cc5[_0x17f2('0x31')]=_['intersection'](_0x1b9cc5[_0x17f2('0x2e')],_0x1b9cc5[_0x17f2('0x2f')]);_0x134ca9[_0x17f2('0x33')]=_[_0x17f2('0x32')](_0x1b9cc5['model'],qs['fields'](_0xc63e46['query']['fields']));_0x134ca9[_0x17f2('0x33')]=_0x134ca9[_0x17f2('0x33')][_0x17f2('0x35')]?_0x134ca9[_0x17f2('0x33')]:_0x1b9cc5['model'];if(_0xc63e46[_0x17f2('0x2f')][_0x17f2('0x3f')]){_0x134ca9['include']=[{'all':!![]}];}_0x134ca9=_[_0x17f2('0x3b')]({},_0x134ca9,_0xc63e46[_0x17f2('0x3d')]);return db[_0x17f2('0x2a')][_0x17f2('0x43')](_0x134ca9)['then'](handleEntityNotFound(_0x3dd422,null))[_0x17f2('0x21')](respondWithResult(_0x3dd422,null))['catch'](handleError(_0x3dd422,null));};exports['create']=function(_0x44472c,_0x3ef636){return db[_0x17f2('0x2a')][_0x17f2('0x44')](_0x44472c[_0x17f2('0x45')],{})[_0x17f2('0x21')](function(_0x28bd84){var _0x40e62f=_0x44472c[_0x17f2('0x46')]['get']({'plain':!![]});if(!_0x40e62f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40e62f[_0x17f2('0x47')]==='user'){var _0x348985=_0x28bd84[_0x17f2('0x48')]({'plain':!![]});var _0x3d8dc9=_0x17f2('0x49');return db['UserProfileSection'][_0x17f2('0x43')]({'where':{'name':_0x3d8dc9,'userProfileId':_0x40e62f[_0x17f2('0x4a')]},'raw':!![]})['then'](function(_0x7c1781){if(_0x7c1781&&_0x7c1781['autoAssociation']===0x0){return db[_0x17f2('0x23')][_0x17f2('0x44')]({'name':_0x348985[_0x17f2('0x26')],'resourceId':_0x348985['id'],'type':_0x7c1781[_0x17f2('0x26')],'sectionId':_0x7c1781['id']},{})['then'](function(){return _0x28bd84;});}else{return _0x28bd84;}})['catch'](function(_0x2ca66e){logger[_0x17f2('0x24')](_0x17f2('0x4b'),_0x2ca66e);throw _0x2ca66e;});}return _0x28bd84;})[_0x17f2('0x21')](respondWithResult(_0x3ef636,0xc9))[_0x17f2('0x4c')](handleError(_0x3ef636,null));};exports[_0x17f2('0x20')]=function(_0x1d9c46,_0x2a3fe5){if(_0x1d9c46['body']['id']){delete _0x1d9c46['body']['id'];}return db[_0x17f2('0x2a')]['find']({'where':{'id':_0x1d9c46['params']['id']}})[_0x17f2('0x21')](handleEntityNotFound(_0x2a3fe5,null))[_0x17f2('0x21')](saveUpdates(_0x1d9c46[_0x17f2('0x45')],null))[_0x17f2('0x21')](respondWithResult(_0x2a3fe5,null))[_0x17f2('0x4c')](handleError(_0x2a3fe5,null));};exports[_0x17f2('0x22')]=function(_0x200448,_0xf51bf7){return db[_0x17f2('0x2a')][_0x17f2('0x43')]({'where':{'id':_0x200448[_0x17f2('0x42')]['id']}})['then'](handleEntityNotFound(_0xf51bf7,null))[_0x17f2('0x21')](removeEntity(_0xf51bf7,null))[_0x17f2('0x4c')](handleError(_0xf51bf7,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index f7c3a5c..249fc45 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 _0x37a4=['exports','define','Variable','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./variable.attributes'];(function(_0x324a00,_0x2c2198){var _0x4f0894=function(_0x7d5bf3){while(--_0x7d5bf3){_0x324a00['push'](_0x324a00['shift']());}};_0x4f0894(++_0x2c2198);}(_0x37a4,0xcb));var _0x437a=function(_0x2ad4b7,_0x178616){_0x2ad4b7=_0x2ad4b7-0x0;var _0x15f427=_0x37a4[_0x2ad4b7];return _0x15f427;};'use strict';var _=require(_0x437a('0x0'));var util=require('util');var logger=require(_0x437a('0x1'))('api');var moment=require(_0x437a('0x2'));var BPromise=require(_0x437a('0x3'));var rp=require(_0x437a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x437a('0x5'));var attributes=require(_0x437a('0x6'));module[_0x437a('0x7')]=function(_0x1b637a,_0x5f5067){return _0x1b637a[_0x437a('0x8')](_0x437a('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e54=['bluebird','request-promise','path','rimraf','../../config/environment','exports','Variable','lodash','api','moment'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x2e54,0x1dd));var _0x42e5=function(_0x3e5c23,_0xa22023){_0x3e5c23=_0x3e5c23-0x0;var _0xfc9ca3=_0x2e54[_0x3e5c23];return _0xfc9ca3;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x42e5('0x1'));var moment=require(_0x42e5('0x2'));var BPromise=require(_0x42e5('0x3'));var rp=require(_0x42e5('0x4'));var fs=require('fs');var path=require(_0x42e5('0x5'));var rimraf=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var attributes=require('./variable.attributes');module[_0x42e5('0x8')]=function(_0x455f48,_0x38cb1b){return _0x455f48['define'](_0x42e5('0x9'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 366f835..5a9f62c 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 _0x3059=['map','attributes','model','stringify','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Variable','find','options','raw','where','include'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0x3059,0xaf));var _0x9305=function(_0x4a7a8a,_0x2fe609){_0x4a7a8a=_0x4a7a8a-0x0;var _0x321126=_0x3059[_0x4a7a8a];return _0x321126;};'use strict';var _=require(_0x9305('0x0'));var util=require(_0x9305('0x1'));var moment=require(_0x9305('0x2'));var BPromise=require(_0x9305('0x3'));var rs=require(_0x9305('0x4'));var fs=require('fs');var Redis=require(_0x9305('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9305('0x6'));var logger=require(_0x9305('0x7'))(_0x9305('0x8'));var config=require(_0x9305('0x9'));var jayson=require(_0x9305('0xa'));var client=jayson['client'][_0x9305('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x221882,_0x4a70bb,_0xbc279f){return new BPromise(function(_0x5da1cb,_0x44f201){return client['request'](_0x221882,_0xbc279f)[_0x9305('0xc')](function(_0x2eb7c2){logger['info'](_0x9305('0xd'),_0x4a70bb,_0x9305('0xe'));logger[_0x9305('0xf')](_0x9305('0x10'),_0x4a70bb,_0x9305('0xe'),JSON['stringify'](_0x2eb7c2));if(_0x2eb7c2[_0x9305('0x11')]){if(_0x2eb7c2[_0x9305('0x11')][_0x9305('0x12')]===0x1f4){logger[_0x9305('0x11')](_0x9305('0xd'),_0x4a70bb,_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);return _0x44f201(_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);}logger['error'](_0x9305('0xd'),_0x4a70bb,_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);return _0x5da1cb(_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);}else{logger[_0x9305('0x14')](_0x9305('0xd'),_0x4a70bb,_0x9305('0xe'));_0x5da1cb(_0x2eb7c2[_0x9305('0x15')][_0x9305('0x13')]);}})[_0x9305('0x16')](function(_0x581641){logger[_0x9305('0x11')](_0x9305('0xd'),_0x4a70bb,_0x581641);_0x44f201(_0x581641);});});}exports['ShowVariable']=function(_0x3624a5){var _0x588682=this;return new Promise(function(_0x2f5ca0,_0x137315){return db[_0x9305('0x17')][_0x9305('0x18')]({'raw':_0x3624a5['options']?_0x3624a5[_0x9305('0x19')][_0x9305('0x1a')]===undefined?!![]:![]:!![],'where':_0x3624a5[_0x9305('0x19')]?_0x3624a5[_0x9305('0x19')][_0x9305('0x1b')]||null:null,'attributes':_0x3624a5[_0x9305('0x19')]?_0x3624a5['options']['attributes']||null:null,'include':_0x3624a5[_0x9305('0x19')]?_0x3624a5['options'][_0x9305('0x1c')]?_[_0x9305('0x1d')](_0x3624a5[_0x9305('0x19')][_0x9305('0x1c')],function(_0x6b598){return{'model':db[_0x6b598['model']],'as':_0x6b598['as'],'attributes':_0x6b598[_0x9305('0x1e')],'include':_0x6b598['include']?_[_0x9305('0x1d')](_0x6b598[_0x9305('0x1c')],function(_0x1399ce){return{'model':db[_0x1399ce[_0x9305('0x1f')]],'as':_0x1399ce['as'],'attributes':_0x1399ce['attributes'],'include':_0x1399ce[_0x9305('0x1c')]?_[_0x9305('0x1d')](_0x1399ce[_0x9305('0x1c')],function(_0x227382){return{'model':db[_0x227382[_0x9305('0x1f')]],'as':_0x227382['as'],'attributes':_0x227382[_0x9305('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9305('0xc')](function(_0xcadb43){logger[_0x9305('0x14')]('ShowVariable',_0x3624a5);logger[_0x9305('0xf')]('ShowVariable',_0x3624a5,JSON[_0x9305('0x20')](_0xcadb43));_0x2f5ca0(_0xcadb43);})[_0x9305('0x16')](function(_0x21b2f1){logger[_0x9305('0x11')](_0x9305('0x21'),_0x21b2f1[_0x9305('0x13')],_0x3624a5);_0x137315(_0x588682[_0x9305('0x11')](0x1f4,_0x21b2f1[_0x9305('0x13')]));});});}; \ No newline at end of file +var _0xabac=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','Variable','find','options','raw','where','attributes','include','map','model','ShowVariable','stringify','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x5ead5f,_0x4b788e){var _0x1c388c=function(_0x4afa8b){while(--_0x4afa8b){_0x5ead5f['push'](_0x5ead5f['shift']());}};_0x1c388c(++_0x4b788e);}(_0xabac,0x11b));var _0xcaba=function(_0x1102b2,_0x24047b){_0x1102b2=_0x1102b2-0x0;var _0x20833b=_0xabac[_0x1102b2];return _0x20833b;};'use strict';var _=require('lodash');var util=require(_0xcaba('0x0'));var moment=require(_0xcaba('0x1'));var BPromise=require('bluebird');var rs=require(_0xcaba('0x2'));var fs=require('fs');var Redis=require(_0xcaba('0x3'));var db=require(_0xcaba('0x4'))['db'];var utils=require(_0xcaba('0x5'));var logger=require('../../config/logger')(_0xcaba('0x6'));var config=require(_0xcaba('0x7'));var jayson=require(_0xcaba('0x8'));var client=jayson[_0xcaba('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x491cb1,_0x22db0f,_0x50f516){return new BPromise(function(_0x136d5d,_0x488acd){return client[_0xcaba('0xa')](_0x491cb1,_0x50f516)[_0xcaba('0xb')](function(_0x3dadc1){logger[_0xcaba('0xc')](_0xcaba('0xd'),_0x22db0f,_0xcaba('0xe'));logger[_0xcaba('0xf')]('Variable,\x20%s,\x20%s,\x20%s',_0x22db0f,_0xcaba('0xe'),JSON['stringify'](_0x3dadc1));if(_0x3dadc1[_0xcaba('0x10')]){if(_0x3dadc1[_0xcaba('0x10')][_0xcaba('0x11')]===0x1f4){logger[_0xcaba('0x10')](_0xcaba('0xd'),_0x22db0f,_0x3dadc1['error'][_0xcaba('0x12')]);return _0x488acd(_0x3dadc1[_0xcaba('0x10')][_0xcaba('0x12')]);}logger[_0xcaba('0x10')](_0xcaba('0xd'),_0x22db0f,_0x3dadc1[_0xcaba('0x10')][_0xcaba('0x12')]);return _0x136d5d(_0x3dadc1[_0xcaba('0x10')]['message']);}else{logger[_0xcaba('0xc')](_0xcaba('0xd'),_0x22db0f,_0xcaba('0xe'));_0x136d5d(_0x3dadc1[_0xcaba('0x13')][_0xcaba('0x12')]);}})[_0xcaba('0x14')](function(_0x2510f9){logger[_0xcaba('0x10')](_0xcaba('0xd'),_0x22db0f,_0x2510f9);_0x488acd(_0x2510f9);});});}exports['ShowVariable']=function(_0x443a99){var _0x1a0066=this;return new Promise(function(_0x1dc903,_0xc1530c){return db[_0xcaba('0x15')][_0xcaba('0x16')]({'raw':_0x443a99[_0xcaba('0x17')]?_0x443a99['options'][_0xcaba('0x18')]===undefined?!![]:![]:!![],'where':_0x443a99['options']?_0x443a99[_0xcaba('0x17')][_0xcaba('0x19')]||null:null,'attributes':_0x443a99[_0xcaba('0x17')]?_0x443a99[_0xcaba('0x17')][_0xcaba('0x1a')]||null:null,'include':_0x443a99['options']?_0x443a99[_0xcaba('0x17')][_0xcaba('0x1b')]?_[_0xcaba('0x1c')](_0x443a99[_0xcaba('0x17')]['include'],function(_0x20ad8b){return{'model':db[_0x20ad8b[_0xcaba('0x1d')]],'as':_0x20ad8b['as'],'attributes':_0x20ad8b[_0xcaba('0x1a')],'include':_0x20ad8b[_0xcaba('0x1b')]?_[_0xcaba('0x1c')](_0x20ad8b['include'],function(_0x546293){return{'model':db[_0x546293[_0xcaba('0x1d')]],'as':_0x546293['as'],'attributes':_0x546293[_0xcaba('0x1a')],'include':_0x546293[_0xcaba('0x1b')]?_['map'](_0x546293[_0xcaba('0x1b')],function(_0x6424c3){return{'model':db[_0x6424c3[_0xcaba('0x1d')]],'as':_0x6424c3['as'],'attributes':_0x6424c3[_0xcaba('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcaba('0xb')](function(_0x2f6c6e){logger[_0xcaba('0xc')](_0xcaba('0x1e'),_0x443a99);logger['debug']('ShowVariable',_0x443a99,JSON[_0xcaba('0x1f')](_0x2f6c6e));_0x1dc903(_0x2f6c6e);})[_0xcaba('0x14')](function(_0x363dae){logger[_0xcaba('0x10')](_0xcaba('0x1e'),_0x363dae[_0xcaba('0x12')],_0x443a99);_0xc1530c(_0x1a0066['error'](0x1f4,_0x363dae[_0xcaba('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 35429fc..c8c21b7 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 _0xc560=['pull','restart','migrations','exports','express','../../components/auth/service','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x52d238,_0x2a4e74){var _0x35c295=function(_0x32afca){while(--_0x32afca){_0x52d238['push'](_0x52d238['shift']());}};_0x35c295(++_0x2a4e74);}(_0xc560,0x82));var _0x0c56=function(_0x51fba7,_0xc4673c){_0x51fba7=_0x51fba7-0x0;var _0x318faf=_0xc560[_0x51fba7];return _0x318faf;};'use strict';var express=require(_0x0c56('0x0'));var router=express['Router']();var auth=require(_0x0c56('0x1'));var controller=require('./version.controller');router[_0x0c56('0x2')]('/',controller['index']);router['get'](_0x0c56('0x3'),auth[_0x0c56('0x4')](),auth[_0x0c56('0x5')](),controller[_0x0c56('0x6')]);router['get'](_0x0c56('0x7'),auth[_0x0c56('0x4')](),auth[_0x0c56('0x5')](),controller[_0x0c56('0x8')]);router['get'](_0x0c56('0x9'),auth['isAuthenticated'](),auth[_0x0c56('0x5')](),controller[_0x0c56('0xa')]);router[_0x0c56('0x2')]('/restart',auth[_0x0c56('0x4')](),controller[_0x0c56('0xb')]);router[_0x0c56('0x2')]('/migrations',controller[_0x0c56('0xc')]);module[_0x0c56('0xd')]=router; \ No newline at end of file +var _0x7c8e=['/reset','reset','/pull','restart','exports','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7c8e,0x94));var _0xe7c8=function(_0x15de6a,_0xb1b042){_0x15de6a=_0x15de6a-0x0;var _0x66bfc0=_0x7c8e[_0x15de6a];return _0x66bfc0;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xe7c8('0x0'));var controller=require(_0xe7c8('0x1'));router[_0xe7c8('0x2')]('/',controller[_0xe7c8('0x3')]);router[_0xe7c8('0x2')](_0xe7c8('0x4'),auth[_0xe7c8('0x5')](),auth[_0xe7c8('0x6')](),controller[_0xe7c8('0x7')]);router[_0xe7c8('0x2')](_0xe7c8('0x8'),auth['isAuthenticated'](),auth[_0xe7c8('0x6')](),controller[_0xe7c8('0x9')]);router[_0xe7c8('0x2')](_0xe7c8('0xa'),auth[_0xe7c8('0x5')](),auth[_0xe7c8('0x6')](),controller['pull']);router['get']('/restart',auth[_0xe7c8('0x5')](),controller[_0xe7c8('0xb')]);router[_0xe7c8('0x2')]('/migrations',controller['migrations']);module[_0xe7c8('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 5506de4..625dba2 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 _0x543b=['map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','umzug','path','lodash','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','migrations','length','replace','push','sort','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.'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x543b,0x18d));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var Umzug=require(_0xb543('0x0'));var path=require(_0xb543('0x1'));var fs=require('fs');var _=require(_0xb543('0x2'));var pkginfo=require('pkginfo')(module,_0xb543('0x3'));var compareVersions=require(_0xb543('0x4'));var exec=require(_0xb543('0x5'))['exec'];var db=require(_0xb543('0x6'))['db'];var config=require(_0xb543('0x7'));var pm2=require(_0xb543('0x8'));var logger=require(_0xb543('0x9'))(_0xb543('0xa'));var git=require(_0xb543('0xb'))(config[_0xb543('0xc')]);exports[_0xb543('0xd')]=function(_0x21bb48,_0x307a74){var _0x2a2c1f={'current':module[_0xb543('0xe')]['version'],'phonebar':0x2};if(_0x21bb48[_0xb543('0xf')]&&_0x21bb48['query'][_0xb543('0x10')]){return git[_0xb543('0x11')]()[_0xb543('0x12')](function(_0x1243fa,_0x3aa29f){_0x2a2c1f[_0xb543('0x10')]=(_0x1243fa?module['exports'][_0xb543('0x3')]:_0x3aa29f[_0xb543('0x10')])||_0xb543('0x13');return _0x307a74['status'](0xc8)[_0xb543('0x14')](_0x2a2c1f);});}else{return _0x307a74[_0xb543('0x15')](0xc8)[_0xb543('0x14')](_0x2a2c1f);}};exports['fetch']=function(_0x5348ca,_0x175499){return git[_0xb543('0x11')]([_0xb543('0x16'),_0xb543('0x17')],function(_0x4c6b38){if(_0x4c6b38){logger[_0xb543('0x18')](_0x4c6b38);return _0x175499[_0xb543('0x15')](0x1f4)[_0xb543('0x14')](_0x4c6b38);}logger[_0xb543('0x19')]('git\x20fetch');return _0x175499[_0xb543('0x15')](0xc8)['json']({'output':_0xb543('0x1a')});});};exports[_0xb543('0x1b')]=function(_0x473cca,_0x13e268){return git['reset']([_0xb543('0x1c'),_0xb543('0x1d')],function(_0x45cd55){if(_0x45cd55){logger['error'](_0x45cd55);return _0x13e268['status'](0x1f4)[_0xb543('0x14')](_0x45cd55);}logger[_0xb543('0x19')](_0xb543('0x1e'));return _0x13e268[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':_0xb543('0x1f')});});};exports[_0xb543('0x20')]=function(_0x1a4b73,_0x5f250a){exec(_0xb543('0x21'),function(_0x18bcc8,_0xd97ba9,_0xb097ad){logger[_0xb543('0x19')](_0xd97ba9);logger[_0xb543('0x19')](_0xb097ad);if(_0x18bcc8){logger['error'](_0x18bcc8);return _0x5f250a['status'](0x1f4)['json'](_0x18bcc8);}return _0x5f250a['status'](0xc8)[_0xb543('0x14')]({'output':_0xd97ba9});});};exports[_0xb543('0x22')]=function(_0x48a008,_0x5285f4){return pm2[_0xb543('0x22')](_0xb543('0x23'))[_0xb543('0x24')](function(_0x5c5f61){logger[_0xb543('0x19')]('pm2\x20restart\x20motion\x20%s',_0x5c5f61);return _0x5285f4[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':_0xb543('0x25')});})[_0xb543('0x26')](function(_0x27f68f){logger['error'](_0x27f68f);return _0x5285f4[_0xb543('0x15')](0x1f4)['json'](_0x27f68f);});};exports['migrations']=function(_0x185ffc,_0x141f7a){var _0x3cb2ed=fs[_0xb543('0x27')](path[_0xb543('0x28')](config[_0xb543('0xc')],'server',_0xb543('0x29')));var _0x4a6a87=[];for(var _0x376fb6=0x0;_0x376fb6<_0x3cb2ed[_0xb543('0x2a')];_0x376fb6++){var _0x2830a8=_0x3cb2ed[_0x376fb6][_0xb543('0x2b')]('.js','');if(compareVersions(module[_0xb543('0xe')]['version'],_0x2830a8)===-0x1){_0x4a6a87[_0xb543('0x2c')](_0x2830a8);}}if(_0x4a6a87[_0xb543('0x2a')]){var _0x9dc86f=_0x4a6a87[_0xb543('0x2d')](compareVersions);var _0x494bfd=new Umzug({'storage':_0xb543('0x2e'),'storageOptions':{'model':db[_0xb543('0x2f')],'modelName':_0xb543('0x2f'),'columnName':_0xb543('0x3')},'migrations':{'params':[db[_0xb543('0x2e')][_0xb543('0x30')](),db['sequelize'][_0xb543('0x31')],function(){throw new Error(_0xb543('0x32'));}],'path':path[_0xb543('0x28')](config['root'],'server',_0xb543('0x29')),'pattern':/\.js$/}});_0x494bfd['up']({'migrations':_[_0xb543('0x33')](_0x9dc86f,function(_0x4373cd){return _0x4373cd+_0xb543('0x34');})})[_0xb543('0x24')](function(){return _0x141f7a[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':_0xb543('0x35')+module[_0xb543('0xe')]['version']+_0xb543('0x36')+_[_0xb543('0x37')](_0x9dc86f),'migrations':_['join'](_0x9dc86f)});})[_0xb543('0x26')](function(_0x762772){if(_0x762772 instanceof db[_0xb543('0x2e')]['UniqueConstraintError']){return _0x141f7a[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x141f7a[_0xb543('0x15')](0x1f4)[_0xb543('0x14')](_0x762772);}});}else{return _0x141f7a[_0xb543('0x15')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0x5a4f=['Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','lodash','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','root','index','exports','query','latest','fetch','status','json','origin','master','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','info','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','server','migrations','length','replace','.js','sort','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.','map'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5a4f,0x10d));var _0xf5a4=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x5a4f[_0xf50820];return _0x2a9b10;};'use strict';var Umzug=require(_0xf5a4('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xf5a4('0x1'));var pkginfo=require('pkginfo')(module,_0xf5a4('0x2'));var compareVersions=require('compare-versions');var exec=require(_0xf5a4('0x3'))[_0xf5a4('0x4')];var db=require(_0xf5a4('0x5'))['db'];var config=require(_0xf5a4('0x6'));var pm2=require(_0xf5a4('0x7'));var logger=require(_0xf5a4('0x8'))(_0xf5a4('0x9'));var git=require('simple-git')(config[_0xf5a4('0xa')]);exports[_0xf5a4('0xb')]=function(_0x3ef3da,_0x1e7821){var _0x363fd2={'current':module[_0xf5a4('0xc')][_0xf5a4('0x2')],'phonebar':0x2};if(_0x3ef3da[_0xf5a4('0xd')]&&_0x3ef3da[_0xf5a4('0xd')][_0xf5a4('0xe')]){return git[_0xf5a4('0xf')]()['tags'](function(_0x1a9dc4,_0x26a617){_0x363fd2[_0xf5a4('0xe')]=(_0x1a9dc4?module[_0xf5a4('0xc')][_0xf5a4('0x2')]:_0x26a617[_0xf5a4('0xe')])||'2.0.0';return _0x1e7821[_0xf5a4('0x10')](0xc8)[_0xf5a4('0x11')](_0x363fd2);});}else{return _0x1e7821[_0xf5a4('0x10')](0xc8)[_0xf5a4('0x11')](_0x363fd2);}};exports[_0xf5a4('0xf')]=function(_0x3121a7,_0x43055a){return git['fetch']([_0xf5a4('0x12'),_0xf5a4('0x13')],function(_0x3e6229){if(_0x3e6229){logger[_0xf5a4('0x14')](_0x3e6229);return _0x43055a[_0xf5a4('0x10')](0x1f4)[_0xf5a4('0x11')](_0x3e6229);}logger['info'](_0xf5a4('0x15'));return _0x43055a[_0xf5a4('0x10')](0xc8)['json']({'output':_0xf5a4('0x16')});});};exports['reset']=function(_0x4f808d,_0x1aad18){return git[_0xf5a4('0x17')]([_0xf5a4('0x18'),_0xf5a4('0x19')],function(_0x3a7acf){if(_0x3a7acf){logger[_0xf5a4('0x14')](_0x3a7acf);return _0x1aad18[_0xf5a4('0x10')](0x1f4)[_0xf5a4('0x11')](_0x3a7acf);}logger['info'](_0xf5a4('0x1a'));return _0x1aad18[_0xf5a4('0x10')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0xf5a4('0x1b')]=function(_0x289c72,_0x2a3bd5){exec(_0xf5a4('0x1c'),function(_0xe67382,_0x5d577a,_0x544d10){logger[_0xf5a4('0x1d')](_0x5d577a);logger[_0xf5a4('0x1d')](_0x544d10);if(_0xe67382){logger[_0xf5a4('0x14')](_0xe67382);return _0x2a3bd5[_0xf5a4('0x10')](0x1f4)[_0xf5a4('0x11')](_0xe67382);}return _0x2a3bd5[_0xf5a4('0x10')](0xc8)['json']({'output':_0x5d577a});});};exports[_0xf5a4('0x1e')]=function(_0x3655a2,_0x595bf8){return pm2[_0xf5a4('0x1e')]('motion2')[_0xf5a4('0x1f')](function(_0x6a2758){logger[_0xf5a4('0x1d')](_0xf5a4('0x20'),_0x6a2758);return _0x595bf8['status'](0xc8)[_0xf5a4('0x11')]({'output':_0xf5a4('0x21')});})[_0xf5a4('0x22')](function(_0x228b32){logger[_0xf5a4('0x14')](_0x228b32);return _0x595bf8[_0xf5a4('0x10')](0x1f4)[_0xf5a4('0x11')](_0x228b32);});};exports['migrations']=function(_0x3c53cf,_0x3701bd){var _0x2c0ca8=fs[_0xf5a4('0x23')](path[_0xf5a4('0x24')](config['root'],_0xf5a4('0x25'),_0xf5a4('0x26')));var _0x403ca4=[];for(var _0x266a08=0x0;_0x266a08<_0x2c0ca8[_0xf5a4('0x27')];_0x266a08++){var _0x12a363=_0x2c0ca8[_0x266a08][_0xf5a4('0x28')](_0xf5a4('0x29'),'');if(compareVersions(module[_0xf5a4('0xc')]['version'],_0x12a363)===-0x1){_0x403ca4['push'](_0x12a363);}}if(_0x403ca4[_0xf5a4('0x27')]){var _0xa10599=_0x403ca4[_0xf5a4('0x2a')](compareVersions);var _0x43b66c=new Umzug({'storage':_0xf5a4('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0xf5a4('0x2c'),'columnName':_0xf5a4('0x2')},'migrations':{'params':[db[_0xf5a4('0x2b')][_0xf5a4('0x2d')](),db['sequelize'][_0xf5a4('0x2e')],function(){throw new Error(_0xf5a4('0x2f'));}],'path':path[_0xf5a4('0x24')](config['root'],'server',_0xf5a4('0x26')),'pattern':/\.js$/}});_0x43b66c['up']({'migrations':_[_0xf5a4('0x30')](_0xa10599,function(_0x19eaa6){return _0x19eaa6+_0xf5a4('0x29');})})[_0xf5a4('0x1f')](function(){return _0x3701bd[_0xf5a4('0x10')](0xc8)[_0xf5a4('0x11')]({'output':_0xf5a4('0x31')+module[_0xf5a4('0xc')]['version']+_0xf5a4('0x32')+_[_0xf5a4('0x33')](_0xa10599),'migrations':_[_0xf5a4('0x24')](_0xa10599)});})['catch'](function(_0x4269da){if(_0x4269da instanceof db[_0xf5a4('0x2b')]['UniqueConstraintError']){return _0x3701bd[_0xf5a4('0x10')](0xc8)[_0xf5a4('0x11')]({'output':_0xf5a4('0x34')});}else{return _0x3701bd[_0xf5a4('0x10')](0x1f4)[_0xf5a4('0x11')](_0x4269da);}});}else{return _0x3701bd[_0xf5a4('0x10')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index f8aaddd..9086419 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 _0xbff1=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','describe','/:id','show','create','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xbff1,0x199));var _0x1bff=function(_0x29183b,_0x8296f3){_0x29183b=_0x29183b-0x0;var _0x3cdbbf=_0xbff1[_0x29183b];return _0x3cdbbf;};'use strict';var multer=require('multer');var util=require(_0x1bff('0x0'));var path=require('path');var timeout=require(_0x1bff('0x1'));var express=require(_0x1bff('0x2'));var router=express[_0x1bff('0x3')]();var auth=require(_0x1bff('0x4'));var interaction=require(_0x1bff('0x5'));var config=require(_0x1bff('0x6'));var controller=require(_0x1bff('0x7'));router[_0x1bff('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1bff('0x8')]('/describe',auth[_0x1bff('0x9')](),controller[_0x1bff('0xa')]);router['get'](_0x1bff('0xb'),auth[_0x1bff('0x9')](),controller[_0x1bff('0xc')]);router['post']('/',auth[_0x1bff('0x9')](),controller[_0x1bff('0xd')]);router['put'](_0x1bff('0xb'),auth[_0x1bff('0x9')](),controller[_0x1bff('0xe')]);router[_0x1bff('0xf')](_0x1bff('0xb'),auth['isAuthenticated'](),controller[_0x1bff('0x10')]);module[_0x1bff('0x11')]=router; \ No newline at end of file +var _0xeef3=['isAuthenticated','describe','/:id','show','post','put','update','delete','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get'];(function(_0x186c99,_0x474456){var _0xcb907c=function(_0x404377){while(--_0x404377){_0x186c99['push'](_0x186c99['shift']());}};_0xcb907c(++_0x474456);}(_0xeef3,0x1e8));var _0x3eef=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0xeef3[_0x5b34c0];return _0x242bd3;};'use strict';var multer=require('multer');var util=require(_0x3eef('0x0'));var path=require(_0x3eef('0x1'));var timeout=require('connect-timeout');var express=require(_0x3eef('0x2'));var router=express[_0x3eef('0x3')]();var auth=require(_0x3eef('0x4'));var interaction=require(_0x3eef('0x5'));var config=require('../../config/environment');var controller=require(_0x3eef('0x6'));router[_0x3eef('0x7')]('/',auth[_0x3eef('0x8')](),controller['index']);router['get']('/describe',auth[_0x3eef('0x8')](),controller[_0x3eef('0x9')]);router[_0x3eef('0x7')](_0x3eef('0xa'),auth[_0x3eef('0x8')](),controller[_0x3eef('0xb')]);router[_0x3eef('0xc')]('/',auth[_0x3eef('0x8')](),controller['create']);router[_0x3eef('0xd')](_0x3eef('0xa'),auth[_0x3eef('0x8')](),controller[_0x3eef('0xe')]);router[_0x3eef('0xf')]('/:id',auth[_0x3eef('0x8')](),controller['destroy']);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 fcb2bba..07447b5 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 _0xeda8=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xeda8,0x104));var _0x8eda=function(_0x253a48,_0x5dc680){_0x253a48=_0x253a48-0x0;var _0x268cfc=_0xeda8[_0x253a48];return _0x268cfc;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8eda('0x2')]},'calleridnum':{'type':Sequelize[_0x8eda('0x2')]},'calleridname':{'type':Sequelize[_0x8eda('0x2')]},'queue':{'type':Sequelize[_0x8eda('0x2')]},'interface':{'type':Sequelize[_0x8eda('0x2')]},'membername':{'type':Sequelize[_0x8eda('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8eda('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8eda('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8eda('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x8eda('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8eda('0x3')]},'holdtime':{'type':Sequelize[_0x8eda('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8eda('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8eda('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8eda('0x4')]},'agentacw':{'type':Sequelize[_0x8eda('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x8eda('0x4')]},'channelstatedesc':{'type':Sequelize[_0x8eda('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8eda('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8eda('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8eda('0x2')]},'exten':{'type':Sequelize[_0x8eda('0x2')]},'priority':{'type':Sequelize[_0x8eda('0x2')]},'destchannel':{'type':Sequelize[_0x8eda('0x2')]},'destchannelstate':{'type':Sequelize[_0x8eda('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8eda('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8eda('0x2')]},'destcalleridname':{'type':Sequelize[_0x8eda('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8eda('0x2')]},'destaccountcode':{'type':Sequelize[_0x8eda('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8eda('0x2')]},'destpriority':{'type':Sequelize[_0x8eda('0x2')]},'destuniqueid':{'type':Sequelize[_0x8eda('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x8eda('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8eda('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x8eda('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8eda('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7dfd=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x20825b,_0x152e53){var _0xacb7e=function(_0x393218){while(--_0x393218){_0x20825b['push'](_0x20825b['shift']());}};_0xacb7e(++_0x152e53);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'type':{'type':Sequelize[_0xd7df('0x2')]},'uniqueid':{'type':Sequelize[_0xd7df('0x2')]},'calleridnum':{'type':Sequelize[_0xd7df('0x2')]},'calleridname':{'type':Sequelize[_0xd7df('0x2')]},'queue':{'type':Sequelize[_0xd7df('0x2')]},'interface':{'type':Sequelize[_0xd7df('0x2')]},'membername':{'type':Sequelize[_0xd7df('0x2')]},'agentcalledAt':{'type':Sequelize[_0xd7df('0x3')]},'agentconnectAt':{'type':Sequelize[_0xd7df('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xd7df('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xd7df('0x3')]},'agentdumpAt':{'type':Sequelize[_0xd7df('0x3')]},'holdtime':{'type':Sequelize[_0xd7df('0x4')]},'agentcomplete':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd7df('0x4')]},'agentacw':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd7df('0x4')]},'reason':{'type':Sequelize[_0xd7df('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd7df('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'language':{'type':Sequelize[_0xd7df('0x2')]},'accountcode':{'type':Sequelize[_0xd7df('0x2')]},'context':{'type':Sequelize[_0xd7df('0x2')]},'exten':{'type':Sequelize[_0xd7df('0x2')]},'priority':{'type':Sequelize[_0xd7df('0x2')]},'destchannel':{'type':Sequelize[_0xd7df('0x2')]},'destchannelstate':{'type':Sequelize[_0xd7df('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd7df('0x2')]},'destcalleridname':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd7df('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd7df('0x2')]},'destlanguage':{'type':Sequelize[_0xd7df('0x2')]},'destaccountcode':{'type':Sequelize[_0xd7df('0x2')]},'destcontext':{'type':Sequelize[_0xd7df('0x2')]},'destexten':{'type':Sequelize[_0xd7df('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xd7df('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xd7df('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd7df('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd7df('0x2')]},'agententerreason':{'type':Sequelize[_0xd7df('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 7da650d..380818d 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 _0x4e30=['fast-json-patch','request-promise','bluebird','util','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','stack','index','map','VoiceAgentReport','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','show','params','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x55f301,_0x363742){var _0x4a21ee=function(_0x5e7271){while(--_0x5e7271){_0x55f301['push'](_0x55f301['shift']());}};_0x4a21ee(++_0x363742);}(_0x4e30,0x15a));var _0x04e3=function(_0x12ff29,_0x4193d8){_0x12ff29=_0x12ff29-0x0;var _0x46cd52=_0x4e30[_0x12ff29];return _0x46cd52;};'use strict';var pdf=require(_0x04e3('0x0'));var emlformat=require(_0x04e3('0x1'));var rimraf=require(_0x04e3('0x2'));var zipdir=require(_0x04e3('0x3'));var jsonpatch=require(_0x04e3('0x4'));var rp=require(_0x04e3('0x5'));var moment=require('moment');var BPromise=require(_0x04e3('0x6'));var Mustache=require('mustache');var util=require(_0x04e3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x04e3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x04e3('0x9'));var crypto=require(_0x04e3('0xa'));var jsforce=require(_0x04e3('0xb'));var deskjs=require(_0x04e3('0xc'));var toCsv=require(_0x04e3('0x8'));var querystring=require(_0x04e3('0xd'));var Papa=require(_0x04e3('0xe'));var Redis=require(_0x04e3('0xf'));var authService=require(_0x04e3('0x10'));var qs=require(_0x04e3('0x11'));var as=require(_0x04e3('0x12'));var hardwareService=require(_0x04e3('0x13'));var logger=require(_0x04e3('0x14'))(_0x04e3('0x15'));var utils=require(_0x04e3('0x16'));var config=require('../../config/environment');var db=require(_0x04e3('0x17'))['db'];function respondWithStatusCode(_0x3054c2,_0x19f0e0){_0x19f0e0=_0x19f0e0||0xcc;return function(_0x3fb1d7){if(_0x3fb1d7){return _0x3054c2[_0x04e3('0x18')](_0x19f0e0);}return _0x3054c2[_0x04e3('0x19')](_0x19f0e0)[_0x04e3('0x1a')]();};}function respondWithResult(_0x3c0345,_0x27f720){_0x27f720=_0x27f720||0xc8;return function(_0x1fd6ef){if(_0x1fd6ef){return _0x3c0345[_0x04e3('0x19')](_0x27f720)[_0x04e3('0x1b')](_0x1fd6ef);}};}function respondWithFilteredResult(_0x48495e,_0x294d1b){return function(_0x3918d6){if(_0x3918d6){var _0x3a4df6=_0x3918d6[_0x04e3('0x1c')],_0x195d33=_0x294d1b[_0x04e3('0x1d')],_0x15fab9=_0x294d1b['offset']+_0x294d1b[_0x04e3('0x1e')],_0x3636a9;if(_0x15fab9>=_0x3a4df6){_0x15fab9=_0x3a4df6;_0x3636a9=0xc8;}else{_0x3636a9=0xce;}_0x48495e['status'](_0x3636a9);return _0x48495e[_0x04e3('0x1f')]('Content-Range',_0x195d33+'-'+_0x15fab9+'/'+_0x3a4df6)[_0x04e3('0x1b')](_0x3918d6);}return null;};}function patchUpdates(_0x1dc4ae){return function(_0x4cdc67){try{jsonpatch[_0x04e3('0x20')](_0x4cdc67,_0x1dc4ae,!![]);}catch(_0xced87a){return BPromise['reject'](_0xced87a);}return _0x4cdc67[_0x04e3('0x21')]();};}function saveUpdates(_0x4296be,_0x195538){return function(_0x534f9b){if(_0x534f9b){return _0x534f9b[_0x04e3('0x22')](_0x4296be)[_0x04e3('0x23')](function(_0x14a5f6){return _0x14a5f6;});}return null;};}function removeEntity(_0x25d63b,_0x4540c2){return function(_0x47f563){if(_0x47f563){return _0x47f563['destroy']()['then'](function(){_0x25d63b[_0x04e3('0x19')](0xcc)[_0x04e3('0x1a')]();});}};}function handleEntityNotFound(_0x50486b,_0x2ae202){return function(_0x1c7aaa){if(!_0x1c7aaa){_0x50486b[_0x04e3('0x18')](0x194);}return _0x1c7aaa;};}function handleError(_0x564c4a,_0x5df9ac){_0x5df9ac=_0x5df9ac||0x1f4;return function(_0x390ba7){logger['error'](_0x390ba7[_0x04e3('0x24')]);if(_0x390ba7['name']){delete _0x390ba7['name'];}_0x564c4a['status'](_0x5df9ac)['send'](_0x390ba7);};}exports[_0x04e3('0x25')]=function(_0x333842,_0x57d296){var _0x4da898={},_0x2e4d76={},_0x3b7c58={'count':0x0,'rows':[]};var _0x2a40bd=_[_0x04e3('0x26')](db[_0x04e3('0x27')][_0x04e3('0x28')],function(_0x5e31a1){return{'name':_0x5e31a1['fieldName'],'type':_0x5e31a1[_0x04e3('0x29')][_0x04e3('0x2a')]};});_0x2e4d76[_0x04e3('0x2b')]=_[_0x04e3('0x26')](_0x2a40bd,_0x04e3('0x2c'));_0x2e4d76[_0x04e3('0x2d')]=_[_0x04e3('0x2e')](_0x333842[_0x04e3('0x2d')]);_0x2e4d76[_0x04e3('0x2f')]=_[_0x04e3('0x30')](_0x2e4d76[_0x04e3('0x2b')],_0x2e4d76['query']);_0x4da898[_0x04e3('0x31')]=_[_0x04e3('0x30')](_0x2e4d76[_0x04e3('0x2b')],qs['fields'](_0x333842[_0x04e3('0x2d')][_0x04e3('0x32')]));_0x4da898[_0x04e3('0x31')]=_0x4da898[_0x04e3('0x31')][_0x04e3('0x33')]?_0x4da898[_0x04e3('0x31')]:_0x2e4d76['model'];if(!_0x333842['query'][_0x04e3('0x34')](_0x04e3('0x35'))){_0x4da898['limit']=qs['limit'](_0x333842[_0x04e3('0x2d')][_0x04e3('0x1e')]);_0x4da898['offset']=qs[_0x04e3('0x1d')](_0x333842['query'][_0x04e3('0x1d')]);}_0x4da898[_0x04e3('0x36')]=qs[_0x04e3('0x37')](_0x333842['query'][_0x04e3('0x37')]);_0x4da898['where']=qs[_0x04e3('0x2f')](_['pick'](_0x333842[_0x04e3('0x2d')],_0x2e4d76['filters']));if(_0x333842['query'][_0x04e3('0x38')]){_0x4da898[_0x04e3('0x39')]=_[_0x04e3('0x3a')](_0x4da898[_0x04e3('0x39')],{'$or':_[_0x04e3('0x26')](_0x2a40bd,function(_0x4982c0){if(_0x4982c0[_0x04e3('0x29')]!=='VIRTUAL'){var _0x1d0722={};_0x1d0722[_0x4982c0[_0x04e3('0x2c')]]={'$like':'%'+_0x333842['query'][_0x04e3('0x38')]+'%'};return _0x1d0722;}})});}_0x4da898=_[_0x04e3('0x3a')]({},_0x4da898,_0x333842[_0x04e3('0x3b')]);var _0x2e268a={'where':_0x4da898[_0x04e3('0x39')]};return db['VoiceAgentReport'][_0x04e3('0x1c')](_0x2e268a)[_0x04e3('0x23')](function(_0x16e489){_0x3b7c58[_0x04e3('0x1c')]=_0x16e489;if(_0x333842['query'][_0x04e3('0x3c')]){_0x4da898[_0x04e3('0x3d')]=[{'all':!![]}];}return db[_0x04e3('0x27')]['findAll'](_0x4da898);})['then'](function(_0x3d93e2){_0x3b7c58['rows']=_0x3d93e2;return _0x3b7c58;})[_0x04e3('0x23')](respondWithFilteredResult(_0x57d296,_0x4da898))['catch'](handleError(_0x57d296,null));};exports[_0x04e3('0x3e')]=function(_0x17e47c,_0x21f543){var _0x269e03={'raw':![],'where':{'id':_0x17e47c[_0x04e3('0x3f')]['id']}},_0xa17de6={};_0xa17de6[_0x04e3('0x2b')]=_['keys'](db[_0x04e3('0x27')][_0x04e3('0x28')]);_0xa17de6[_0x04e3('0x2d')]=_[_0x04e3('0x2e')](_0x17e47c['query']);_0xa17de6[_0x04e3('0x2f')]=_['intersection'](_0xa17de6[_0x04e3('0x2b')],_0xa17de6['query']);_0x269e03[_0x04e3('0x31')]=_[_0x04e3('0x30')](_0xa17de6[_0x04e3('0x2b')],qs[_0x04e3('0x32')](_0x17e47c[_0x04e3('0x2d')][_0x04e3('0x32')]));_0x269e03[_0x04e3('0x31')]=_0x269e03['attributes'][_0x04e3('0x33')]?_0x269e03['attributes']:_0xa17de6[_0x04e3('0x2b')];if(_0x17e47c['query']['includeAll']){_0x269e03[_0x04e3('0x3d')]=[{'all':!![]}];}_0x269e03=_[_0x04e3('0x3a')]({},_0x269e03,_0x17e47c['options']);return db[_0x04e3('0x27')][_0x04e3('0x40')](_0x269e03)[_0x04e3('0x23')](handleEntityNotFound(_0x21f543,null))[_0x04e3('0x23')](respondWithResult(_0x21f543,null))[_0x04e3('0x41')](handleError(_0x21f543,null));};exports[_0x04e3('0x42')]=function(_0x3a0dd5,_0x9934a3){return db['VoiceAgentReport'][_0x04e3('0x42')](_0x3a0dd5[_0x04e3('0x43')],{})[_0x04e3('0x23')](respondWithResult(_0x9934a3,0xc9))[_0x04e3('0x41')](handleError(_0x9934a3,null));};exports[_0x04e3('0x22')]=function(_0x11c839,_0x13799e){if(_0x11c839[_0x04e3('0x43')]['id']){delete _0x11c839['body']['id'];}return db[_0x04e3('0x27')][_0x04e3('0x40')]({'where':{'id':_0x11c839[_0x04e3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x13799e,null))[_0x04e3('0x23')](saveUpdates(_0x11c839[_0x04e3('0x43')],null))['then'](respondWithResult(_0x13799e,null))['catch'](handleError(_0x13799e,null));};exports[_0x04e3('0x44')]=function(_0x415704,_0x580ce8){return db[_0x04e3('0x27')]['find']({'where':{'id':_0x415704[_0x04e3('0x3f')]['id']}})[_0x04e3('0x23')](handleEntityNotFound(_0x580ce8,null))['then'](removeEntity(_0x580ce8,null))[_0x04e3('0x41')](handleError(_0x580ce8,null));};exports[_0x04e3('0x45')]=function(_0x340874,_0xf78290){return db[_0x04e3('0x27')][_0x04e3('0x45')]()[_0x04e3('0x23')](respondWithResult(_0xf78290,null))[_0x04e3('0x41')](handleError(_0xf78290,null));}; \ No newline at end of file +var _0x61b8=['squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','name','send','VoiceAgentReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','findAll','catch','rawAttributes','include','create','body','find','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x1d9b91,_0x5abd5b){var _0xf534ef=function(_0x352337){while(--_0x352337){_0x1d9b91['push'](_0x1d9b91['shift']());}};_0xf534ef(++_0x5abd5b);}(_0x61b8,0x1f1));var _0x861b=function(_0x35616f,_0x1a64ef){_0x35616f=_0x35616f-0x0;var _0x48dc16=_0x61b8[_0x35616f];return _0x48dc16;};'use strict';var pdf=require(_0x861b('0x0'));var emlformat=require(_0x861b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x861b('0x2'));var jsonpatch=require(_0x861b('0x3'));var rp=require(_0x861b('0x4'));var moment=require(_0x861b('0x5'));var BPromise=require(_0x861b('0x6'));var Mustache=require(_0x861b('0x7'));var util=require(_0x861b('0x8'));var path=require(_0x861b('0x9'));var sox=require(_0x861b('0xa'));var csv=require(_0x861b('0xb'));var ejs=require(_0x861b('0xc'));var fs=require('fs');var _=require(_0x861b('0xd'));var squel=require(_0x861b('0xe'));var crypto=require('crypto');var jsforce=require(_0x861b('0xf'));var deskjs=require(_0x861b('0x10'));var toCsv=require(_0x861b('0xb'));var querystring=require('querystring');var Papa=require(_0x861b('0x11'));var Redis=require(_0x861b('0x12'));var authService=require(_0x861b('0x13'));var qs=require(_0x861b('0x14'));var as=require(_0x861b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x861b('0x16'))(_0x861b('0x17'));var utils=require(_0x861b('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fa380,_0x1d57ad){_0x1d57ad=_0x1d57ad||0xcc;return function(_0x3b112b){if(_0x3b112b){return _0x4fa380['sendStatus'](_0x1d57ad);}return _0x4fa380['status'](_0x1d57ad)[_0x861b('0x19')]();};}function respondWithResult(_0x362ff3,_0x2c8bd6){_0x2c8bd6=_0x2c8bd6||0xc8;return function(_0x2397d1){if(_0x2397d1){return _0x362ff3[_0x861b('0x1a')](_0x2c8bd6)[_0x861b('0x1b')](_0x2397d1);}};}function respondWithFilteredResult(_0x4407bb,_0x1c0df7){return function(_0x3495d9){if(_0x3495d9){var _0x3a91c5=_0x3495d9[_0x861b('0x1c')],_0x616ec4=_0x1c0df7[_0x861b('0x1d')],_0x5b7dfc=_0x1c0df7[_0x861b('0x1d')]+_0x1c0df7[_0x861b('0x1e')],_0x16b04f;if(_0x5b7dfc>=_0x3a91c5){_0x5b7dfc=_0x3a91c5;_0x16b04f=0xc8;}else{_0x16b04f=0xce;}_0x4407bb[_0x861b('0x1a')](_0x16b04f);return _0x4407bb[_0x861b('0x1f')]('Content-Range',_0x616ec4+'-'+_0x5b7dfc+'/'+_0x3a91c5)[_0x861b('0x1b')](_0x3495d9);}return null;};}function patchUpdates(_0x23c8e4){return function(_0x2821c5){try{jsonpatch[_0x861b('0x20')](_0x2821c5,_0x23c8e4,!![]);}catch(_0xa4a661){return BPromise[_0x861b('0x21')](_0xa4a661);}return _0x2821c5[_0x861b('0x22')]();};}function saveUpdates(_0x51974e,_0x1b0142){return function(_0xf69a27){if(_0xf69a27){return _0xf69a27[_0x861b('0x23')](_0x51974e)[_0x861b('0x24')](function(_0xb95319){return _0xb95319;});}return null;};}function removeEntity(_0x35d7c6,_0x356837){return function(_0x254d40){if(_0x254d40){return _0x254d40[_0x861b('0x25')]()['then'](function(){_0x35d7c6[_0x861b('0x1a')](0xcc)[_0x861b('0x19')]();});}};}function handleEntityNotFound(_0x2b9a3c,_0x62cf8f){return function(_0x2ffb1a){if(!_0x2ffb1a){_0x2b9a3c[_0x861b('0x26')](0x194);}return _0x2ffb1a;};}function handleError(_0x248ab4,_0x164701){_0x164701=_0x164701||0x1f4;return function(_0x5f3aa3){logger[_0x861b('0x27')](_0x5f3aa3['stack']);if(_0x5f3aa3[_0x861b('0x28')]){delete _0x5f3aa3[_0x861b('0x28')];}_0x248ab4[_0x861b('0x1a')](_0x164701)[_0x861b('0x29')](_0x5f3aa3);};}exports['index']=function(_0x1f19a2,_0x46eca8){var _0x2b3804={},_0x583754={},_0x4b6c1c={'count':0x0,'rows':[]};var _0x39fe93=_['map'](db[_0x861b('0x2a')]['rawAttributes'],function(_0x24850b){return{'name':_0x24850b[_0x861b('0x2b')],'type':_0x24850b['type'][_0x861b('0x2c')]};});_0x583754[_0x861b('0x2d')]=_['map'](_0x39fe93,_0x861b('0x28'));_0x583754[_0x861b('0x2e')]=_[_0x861b('0x2f')](_0x1f19a2[_0x861b('0x2e')]);_0x583754[_0x861b('0x30')]=_[_0x861b('0x31')](_0x583754[_0x861b('0x2d')],_0x583754['query']);_0x2b3804[_0x861b('0x32')]=_['intersection'](_0x583754[_0x861b('0x2d')],qs[_0x861b('0x33')](_0x1f19a2[_0x861b('0x2e')][_0x861b('0x33')]));_0x2b3804[_0x861b('0x32')]=_0x2b3804[_0x861b('0x32')][_0x861b('0x34')]?_0x2b3804['attributes']:_0x583754[_0x861b('0x2d')];if(!_0x1f19a2[_0x861b('0x2e')][_0x861b('0x35')](_0x861b('0x36'))){_0x2b3804[_0x861b('0x1e')]=qs[_0x861b('0x1e')](_0x1f19a2[_0x861b('0x2e')][_0x861b('0x1e')]);_0x2b3804[_0x861b('0x1d')]=qs[_0x861b('0x1d')](_0x1f19a2[_0x861b('0x2e')]['offset']);}_0x2b3804[_0x861b('0x37')]=qs[_0x861b('0x38')](_0x1f19a2['query'][_0x861b('0x38')]);_0x2b3804[_0x861b('0x39')]=qs[_0x861b('0x30')](_['pick'](_0x1f19a2[_0x861b('0x2e')],_0x583754[_0x861b('0x30')]));if(_0x1f19a2[_0x861b('0x2e')]['filter']){_0x2b3804[_0x861b('0x39')]=_[_0x861b('0x3a')](_0x2b3804[_0x861b('0x39')],{'$or':_[_0x861b('0x3b')](_0x39fe93,function(_0x14f4ca){if(_0x14f4ca['type']!==_0x861b('0x3c')){var _0x5e89f={};_0x5e89f[_0x14f4ca['name']]={'$like':'%'+_0x1f19a2[_0x861b('0x2e')][_0x861b('0x3d')]+'%'};return _0x5e89f;}})});}_0x2b3804=_[_0x861b('0x3a')]({},_0x2b3804,_0x1f19a2[_0x861b('0x3e')]);var _0x407f9e={'where':_0x2b3804[_0x861b('0x39')]};return db[_0x861b('0x2a')]['count'](_0x407f9e)[_0x861b('0x24')](function(_0x1a3986){_0x4b6c1c[_0x861b('0x1c')]=_0x1a3986;if(_0x1f19a2[_0x861b('0x2e')][_0x861b('0x3f')]){_0x2b3804['include']=[{'all':!![]}];}return db['VoiceAgentReport'][_0x861b('0x40')](_0x2b3804);})[_0x861b('0x24')](function(_0x53159d){_0x4b6c1c['rows']=_0x53159d;return _0x4b6c1c;})[_0x861b('0x24')](respondWithFilteredResult(_0x46eca8,_0x2b3804))[_0x861b('0x41')](handleError(_0x46eca8,null));};exports['show']=function(_0x25306b,_0x7419b2){var _0x4e6d11={'raw':![],'where':{'id':_0x25306b['params']['id']}},_0x1ecd36={};_0x1ecd36[_0x861b('0x2d')]=_[_0x861b('0x2f')](db[_0x861b('0x2a')][_0x861b('0x42')]);_0x1ecd36[_0x861b('0x2e')]=_['keys'](_0x25306b[_0x861b('0x2e')]);_0x1ecd36[_0x861b('0x30')]=_[_0x861b('0x31')](_0x1ecd36[_0x861b('0x2d')],_0x1ecd36[_0x861b('0x2e')]);_0x4e6d11[_0x861b('0x32')]=_['intersection'](_0x1ecd36[_0x861b('0x2d')],qs[_0x861b('0x33')](_0x25306b[_0x861b('0x2e')]['fields']));_0x4e6d11['attributes']=_0x4e6d11[_0x861b('0x32')]['length']?_0x4e6d11[_0x861b('0x32')]:_0x1ecd36[_0x861b('0x2d')];if(_0x25306b['query']['includeAll']){_0x4e6d11[_0x861b('0x43')]=[{'all':!![]}];}_0x4e6d11=_['merge']({},_0x4e6d11,_0x25306b['options']);return db[_0x861b('0x2a')]['find'](_0x4e6d11)[_0x861b('0x24')](handleEntityNotFound(_0x7419b2,null))[_0x861b('0x24')](respondWithResult(_0x7419b2,null))[_0x861b('0x41')](handleError(_0x7419b2,null));};exports['create']=function(_0x451f32,_0x3da7ac){return db['VoiceAgentReport'][_0x861b('0x44')](_0x451f32[_0x861b('0x45')],{})[_0x861b('0x24')](respondWithResult(_0x3da7ac,0xc9))['catch'](handleError(_0x3da7ac,null));};exports[_0x861b('0x23')]=function(_0x565b99,_0x2c6ffd){if(_0x565b99[_0x861b('0x45')]['id']){delete _0x565b99[_0x861b('0x45')]['id'];}return db[_0x861b('0x2a')][_0x861b('0x46')]({'where':{'id':_0x565b99[_0x861b('0x47')]['id']}})[_0x861b('0x24')](handleEntityNotFound(_0x2c6ffd,null))[_0x861b('0x24')](saveUpdates(_0x565b99['body'],null))[_0x861b('0x24')](respondWithResult(_0x2c6ffd,null))[_0x861b('0x41')](handleError(_0x2c6ffd,null));};exports[_0x861b('0x25')]=function(_0x55c57d,_0x5f5ae1){return db['VoiceAgentReport']['find']({'where':{'id':_0x55c57d[_0x861b('0x47')]['id']}})[_0x861b('0x24')](handleEntityNotFound(_0x5f5ae1,null))[_0x861b('0x24')](removeEntity(_0x5f5ae1,null))['catch'](handleError(_0x5f5ae1,null));};exports[_0x861b('0x48')]=function(_0x2e0051,_0x5ade5a){return db[_0x861b('0x2a')]['describe']()[_0x861b('0x24')](respondWithResult(_0x5ade5a,null))[_0x861b('0x41')](handleError(_0x5ade5a,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 5402ae5..2f052ce 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 _0x2d39=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x1c2065,_0x4eb07a){var _0x1c94cb=function(_0xde960a){while(--_0xde960a){_0x1c2065['push'](_0x1c2065['shift']());}};_0x1c94cb(++_0x4eb07a);}(_0x2d39,0x11e));var _0x92d3=function(_0x5335bc,_0x3a4061){_0x5335bc=_0x5335bc-0x0;var _0x4ed8ba=_0x2d39[_0x5335bc];return _0x4ed8ba;};'use strict';var _=require(_0x92d3('0x0'));var util=require('util');var logger=require(_0x92d3('0x1'))(_0x92d3('0x2'));var moment=require(_0x92d3('0x3'));var BPromise=require('bluebird');var rp=require(_0x92d3('0x4'));var fs=require('fs');var path=require(_0x92d3('0x5'));var rimraf=require(_0x92d3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x92d3('0x7')]=function(_0x1f97d9,_0x527323){return _0x1f97d9[_0x92d3('0x8')](_0x92d3('0x9'),attributes,{'tableName':_0x92d3('0xa'),'paranoid':![],'indexes':[{'fields':[_0x92d3('0xb'),_0x92d3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb6a6=['../../config/environment','./voiceAgentReport.attributes','exports','define','report_agent','uniqueid','destuniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x7c6825,_0x1c330f){var _0x2e4672=function(_0x413155){while(--_0x413155){_0x7c6825['push'](_0x7c6825['shift']());}};_0x2e4672(++_0x1c330f);}(_0xb6a6,0xe4));var _0x6b6a=function(_0x59f2f1,_0x2848b6){_0x59f2f1=_0x59f2f1-0x0;var _0x2ff23d=_0xb6a6[_0x59f2f1];return _0x2ff23d;};'use strict';var _=require(_0x6b6a('0x0'));var util=require('util');var logger=require(_0x6b6a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x6b6a('0x2'));var rp=require(_0x6b6a('0x3'));var fs=require('fs');var path=require(_0x6b6a('0x4'));var rimraf=require(_0x6b6a('0x5'));var config=require(_0x6b6a('0x6'));var attributes=require(_0x6b6a('0x7'));module[_0x6b6a('0x8')]=function(_0x917e54,_0x48672b){return _0x917e54[_0x6b6a('0x9')]('VoiceAgentReport',attributes,{'tableName':_0x6b6a('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6b6a('0xb'),_0x6b6a('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 aabab78..4a64d5d 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 _0x3a7d=['VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3a7d,0x15d));var _0xd3a7=function(_0x395520,_0x49077b){_0x395520=_0x395520-0x0;var _0x182db1=_0x3a7d[_0x395520];return _0x182db1;};'use strict';var _=require(_0xd3a7('0x0'));var util=require(_0xd3a7('0x1'));var moment=require(_0xd3a7('0x2'));var BPromise=require(_0xd3a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3a7('0x4'));var db=require(_0xd3a7('0x5'))['db'];var utils=require(_0xd3a7('0x6'));var logger=require(_0xd3a7('0x7'))(_0xd3a7('0x8'));var config=require(_0xd3a7('0x9'));var jayson=require(_0xd3a7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9737,_0x24d666,_0x148dfc){return new BPromise(function(_0x12459f,_0x41cd74){return client['request'](_0x1c9737,_0x148dfc)[_0xd3a7('0xb')](function(_0x274e4a){logger['info'](_0xd3a7('0xc'),_0x24d666,'request\x20sent');logger[_0xd3a7('0xd')](_0xd3a7('0xe'),_0x24d666,'request\x20sent',JSON[_0xd3a7('0xf')](_0x274e4a));if(_0x274e4a[_0xd3a7('0x10')]){if(_0x274e4a['error'][_0xd3a7('0x11')]===0x1f4){logger['error'](_0xd3a7('0xc'),_0x24d666,_0x274e4a[_0xd3a7('0x10')][_0xd3a7('0x12')]);return _0x41cd74(_0x274e4a[_0xd3a7('0x10')][_0xd3a7('0x12')]);}logger['error'](_0xd3a7('0xc'),_0x24d666,_0x274e4a[_0xd3a7('0x10')]['message']);return _0x12459f(_0x274e4a[_0xd3a7('0x10')][_0xd3a7('0x12')]);}else{logger[_0xd3a7('0x13')](_0xd3a7('0xc'),_0x24d666,'request\x20sent');_0x12459f(_0x274e4a[_0xd3a7('0x14')][_0xd3a7('0x12')]);}})[_0xd3a7('0x15')](function(_0x33d1f4){logger[_0xd3a7('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x24d666,_0x33d1f4);_0x41cd74(_0x33d1f4);});});}exports[_0xd3a7('0x16')]=function(_0x487d74){var _0x1072d6=this;return new Promise(function(_0x5b2c89,_0x5d26e0){return db[_0xd3a7('0x17')][_0xd3a7('0x18')](_0x487d74[_0xd3a7('0x19')],{'raw':_0x487d74[_0xd3a7('0x1a')]?_0x487d74[_0xd3a7('0x1a')][_0xd3a7('0x1b')]===undefined?!![]:![]:!![]})[_0xd3a7('0xb')](function(_0x4e99bd){logger[_0xd3a7('0x13')](_0xd3a7('0x16'),_0x487d74);logger[_0xd3a7('0xd')](_0xd3a7('0x16'),_0x487d74,JSON[_0xd3a7('0xf')](_0x4e99bd));_0x5b2c89(_0x4e99bd);})[_0xd3a7('0x15')](function(_0x93d478){logger[_0xd3a7('0x10')](_0xd3a7('0x16'),_0x93d478[_0xd3a7('0x12')],_0x487d74);_0x5d26e0(_0x1072d6[_0xd3a7('0x10')](0x1f4,_0x93d478[_0xd3a7('0x12')]));});});};exports[_0xd3a7('0x1c')]=function(_0x4b21b1){var _0x5b75de=this;return new Promise(function(_0x3e4700,_0x5cce61){return db[_0xd3a7('0x17')]['update'](_0x4b21b1['body'],{'raw':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1[_0xd3a7('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1[_0xd3a7('0x1a')][_0xd3a7('0x1d')]||null:null,'attributes':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1['options'][_0xd3a7('0x1e')]||null:null,'limit':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1[_0xd3a7('0x1a')]['limit']||null:null})[_0xd3a7('0xb')](function(_0x4e6082){logger[_0xd3a7('0x13')](_0xd3a7('0x1c'),_0x4b21b1);logger[_0xd3a7('0xd')]('UpdateVoiceAgentReport',_0x4b21b1,JSON[_0xd3a7('0xf')](_0x4e6082));_0x3e4700(_0x4e6082);})[_0xd3a7('0x15')](function(_0x61dc19){logger[_0xd3a7('0x10')](_0xd3a7('0x1c'),_0x61dc19[_0xd3a7('0x12')],_0x4b21b1);_0x5cce61(_0x5b75de['error'](0x1f4,_0x61dc19[_0xd3a7('0x12')]));});});}; \ No newline at end of file +var _0x8b81=['debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateVoiceAgentReport','VoiceAgentReport','options','then','catch','UpdateVoiceAgentReport','update','body','where','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent'];(function(_0x4bc65f,_0x2f12f1){var _0x1a2df3=function(_0x268a3b){while(--_0x268a3b){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x1a2df3(++_0x2f12f1);}(_0x8b81,0x98));var _0x18b8=function(_0x5a889c,_0x1d7328){_0x5a889c=_0x5a889c-0x0;var _0xa9ef9a=_0x8b81[_0x5a889c];return _0xa9ef9a;};'use strict';var _=require(_0x18b8('0x0'));var util=require(_0x18b8('0x1'));var moment=require(_0x18b8('0x2'));var BPromise=require(_0x18b8('0x3'));var rs=require(_0x18b8('0x4'));var fs=require('fs');var Redis=require(_0x18b8('0x5'));var db=require(_0x18b8('0x6'))['db'];var utils=require(_0x18b8('0x7'));var logger=require(_0x18b8('0x8'))(_0x18b8('0x9'));var config=require(_0x18b8('0xa'));var jayson=require(_0x18b8('0xb'));var client=jayson[_0x18b8('0xc')][_0x18b8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x409d45,_0xb4d48d,_0x516cf0){return new BPromise(function(_0x32fec8,_0x11be5b){return client[_0x18b8('0xe')](_0x409d45,_0x516cf0)['then'](function(_0x383a7c){logger[_0x18b8('0xf')](_0x18b8('0x10'),_0xb4d48d,_0x18b8('0x11'));logger[_0x18b8('0x12')](_0x18b8('0x13'),_0xb4d48d,_0x18b8('0x11'),JSON[_0x18b8('0x14')](_0x383a7c));if(_0x383a7c[_0x18b8('0x15')]){if(_0x383a7c[_0x18b8('0x15')][_0x18b8('0x16')]===0x1f4){logger[_0x18b8('0x15')](_0x18b8('0x10'),_0xb4d48d,_0x383a7c[_0x18b8('0x15')][_0x18b8('0x17')]);return _0x11be5b(_0x383a7c['error'][_0x18b8('0x17')]);}logger['error'](_0x18b8('0x10'),_0xb4d48d,_0x383a7c[_0x18b8('0x15')]['message']);return _0x32fec8(_0x383a7c[_0x18b8('0x15')]['message']);}else{logger[_0x18b8('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0xb4d48d,'request\x20sent');_0x32fec8(_0x383a7c['result'][_0x18b8('0x17')]);}})['catch'](function(_0x25d0c7){logger[_0x18b8('0x15')](_0x18b8('0x10'),_0xb4d48d,_0x25d0c7);_0x11be5b(_0x25d0c7);});});}exports[_0x18b8('0x18')]=function(_0x370823){var _0xc942aa=this;return new Promise(function(_0x59f346,_0x50b014){return db[_0x18b8('0x19')]['create'](_0x370823['body'],{'raw':_0x370823[_0x18b8('0x1a')]?_0x370823['options']['raw']===undefined?!![]:![]:!![]})[_0x18b8('0x1b')](function(_0x3b3d8b){logger['info'](_0x18b8('0x18'),_0x370823);logger[_0x18b8('0x12')](_0x18b8('0x18'),_0x370823,JSON['stringify'](_0x3b3d8b));_0x59f346(_0x3b3d8b);})[_0x18b8('0x1c')](function(_0x430312){logger['error']('CreateVoiceAgentReport',_0x430312[_0x18b8('0x17')],_0x370823);_0x50b014(_0xc942aa[_0x18b8('0x15')](0x1f4,_0x430312[_0x18b8('0x17')]));});});};exports[_0x18b8('0x1d')]=function(_0x3ce042){var _0x342659=this;return new Promise(function(_0x36daab,_0x1cbe6c){return db['VoiceAgentReport'][_0x18b8('0x1e')](_0x3ce042[_0x18b8('0x1f')],{'raw':_0x3ce042[_0x18b8('0x1a')]?_0x3ce042[_0x18b8('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ce042[_0x18b8('0x1a')]?_0x3ce042[_0x18b8('0x1a')][_0x18b8('0x20')]||null:null,'attributes':_0x3ce042['options']?_0x3ce042[_0x18b8('0x1a')]['attributes']||null:null,'limit':_0x3ce042[_0x18b8('0x1a')]?_0x3ce042[_0x18b8('0x1a')][_0x18b8('0x21')]||null:null})[_0x18b8('0x1b')](function(_0x4a66a4){logger['info'](_0x18b8('0x1d'),_0x3ce042);logger[_0x18b8('0x12')]('UpdateVoiceAgentReport',_0x3ce042,JSON[_0x18b8('0x14')](_0x4a66a4));_0x36daab(_0x4a66a4);})['catch'](function(_0x3a91b5){logger[_0x18b8('0x15')](_0x18b8('0x1d'),_0x3a91b5[_0x18b8('0x17')],_0x3ce042);_0x1cbe6c(_0x342659[_0x18b8('0x15')](0x1f4,_0x3a91b5[_0x18b8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a49a1e6..24acb95 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 _0x8224=['index','get','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated'];(function(_0x21402b,_0x14b51c){var _0x36c567=function(_0x1a5251){while(--_0x1a5251){_0x21402b['push'](_0x21402b['shift']());}};_0x36c567(++_0x14b51c);}(_0x8224,0x148));var _0x4822=function(_0x141dcc,_0x37e752){_0x141dcc=_0x141dcc-0x0;var _0x1b263f=_0x8224[_0x141dcc];return _0x1b263f;};'use strict';var multer=require(_0x4822('0x0'));var util=require('util');var path=require(_0x4822('0x1'));var timeout=require(_0x4822('0x2'));var express=require(_0x4822('0x3'));var router=express[_0x4822('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4822('0x5'));var config=require('../../config/environment');var controller=require(_0x4822('0x6'));router['get']('/',auth[_0x4822('0x7')](),controller[_0x4822('0x8')]);router[_0x4822('0x9')](_0x4822('0xa'),auth['isAuthenticated'](),controller[_0x4822('0xb')]);router['get']('/:id',auth[_0x4822('0x7')](),controller[_0x4822('0xc')]);router[_0x4822('0xd')]('/',auth[_0x4822('0x7')](),controller[_0x4822('0xe')]);router[_0x4822('0xf')]('/:id',auth[_0x4822('0x7')](),controller[_0x4822('0x10')]);router[_0x4822('0x11')](_0x4822('0x12'),auth[_0x4822('0x7')](),controller[_0x4822('0x13')]);module[_0x4822('0x14')]=router; \ No newline at end of file +var _0xd150=['put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x5f1a8d,_0x54aedc){var _0x215154=function(_0x530574){while(--_0x530574){_0x5f1a8d['push'](_0x5f1a8d['shift']());}};_0x215154(++_0x54aedc);}(_0xd150,0xe0));var _0x0d15=function(_0x4602e0,_0x8d1467){_0x4602e0=_0x4602e0-0x0;var _0x5eedc3=_0xd150[_0x4602e0];return _0x5eedc3;};'use strict';var multer=require(_0x0d15('0x0'));var util=require('util');var path=require(_0x0d15('0x1'));var timeout=require(_0x0d15('0x2'));var express=require(_0x0d15('0x3'));var router=express[_0x0d15('0x4')]();var auth=require(_0x0d15('0x5'));var interaction=require(_0x0d15('0x6'));var config=require(_0x0d15('0x7'));var controller=require(_0x0d15('0x8'));router[_0x0d15('0x9')]('/',auth['isAuthenticated'](),controller[_0x0d15('0xa')]);router['get'](_0x0d15('0xb'),auth[_0x0d15('0xc')](),controller[_0x0d15('0xd')]);router[_0x0d15('0x9')](_0x0d15('0xe'),auth[_0x0d15('0xc')](),controller[_0x0d15('0xf')]);router[_0x0d15('0x10')]('/',auth[_0x0d15('0xc')](),controller[_0x0d15('0x11')]);router[_0x0d15('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x0d15('0x13')]);router[_0x0d15('0x14')](_0x0d15('0xe'),auth[_0x0d15('0xc')](),controller[_0x0d15('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 0ff921d..bc5daf4 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 _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x1e399a,_0x351c59){var _0x539897=function(_0x2986fa){while(--_0x2986fa){_0x1e399a['push'](_0x1e399a['shift']());}};_0x539897(++_0x351c59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file +var _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x7ca5d9,_0x15580f){var _0x1d1a9b=function(_0xbd61d6){while(--_0xbd61d6){_0x7ca5d9['push'](_0x7ca5d9['shift']());}};_0x1d1a9b(++_0x15580f);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index c413633..74dce9a 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 _0x6f79=['body','find','uniqueid','user','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f79,0x16c));var _0x96f7=function(_0xc306cf,_0x439411){_0xc306cf=_0xc306cf-0x0;var _0xae5821=_0x6f79[_0xc306cf];return _0xae5821;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x96f7('0x0'));var rimraf=require(_0x96f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96f7('0x2'));var rp=require('request-promise');var moment=require(_0x96f7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96f7('0x4'));var path=require(_0x96f7('0x5'));var sox=require(_0x96f7('0x6'));var csv=require(_0x96f7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x96f7('0x8'));var squel=require(_0x96f7('0x9'));var crypto=require(_0x96f7('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x96f7('0x7'));var querystring=require(_0x96f7('0xb'));var Papa=require('papaparse');var Redis=require(_0x96f7('0xc'));var authService=require(_0x96f7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x96f7('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96f7('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x96f7('0x10'))['db'];function respondWithStatusCode(_0x1ab54d,_0x17a9dd){_0x17a9dd=_0x17a9dd||0xcc;return function(_0x1c09f1){if(_0x1c09f1){return _0x1ab54d[_0x96f7('0x11')](_0x17a9dd);}return _0x1ab54d['status'](_0x17a9dd)[_0x96f7('0x12')]();};}function respondWithResult(_0x291c74,_0x11479d){_0x11479d=_0x11479d||0xc8;return function(_0x315b16){if(_0x315b16){return _0x291c74[_0x96f7('0x13')](_0x11479d)[_0x96f7('0x14')](_0x315b16);}};}function respondWithFilteredResult(_0x483577,_0x800837){return function(_0x522605){if(_0x522605){var _0x2c79b5=_0x522605[_0x96f7('0x15')],_0x449e1c=_0x800837[_0x96f7('0x16')],_0x2d48cb=_0x800837[_0x96f7('0x16')]+_0x800837[_0x96f7('0x17')],_0x44b28a;if(_0x2d48cb>=_0x2c79b5){_0x2d48cb=_0x2c79b5;_0x44b28a=0xc8;}else{_0x44b28a=0xce;}_0x483577[_0x96f7('0x13')](_0x44b28a);return _0x483577[_0x96f7('0x18')](_0x96f7('0x19'),_0x449e1c+'-'+_0x2d48cb+'/'+_0x2c79b5)[_0x96f7('0x14')](_0x522605);}return null;};}function patchUpdates(_0x5b1fc0){return function(_0xabd44c){try{jsonpatch['apply'](_0xabd44c,_0x5b1fc0,!![]);}catch(_0x26b69e){return BPromise[_0x96f7('0x1a')](_0x26b69e);}return _0xabd44c['save']();};}function saveUpdates(_0x4b5f81,_0x5176fd){return function(_0x57e2e0){if(_0x57e2e0){return _0x57e2e0[_0x96f7('0x1b')](_0x4b5f81)['then'](function(_0x395b1d){return _0x395b1d;});}return null;};}function removeEntity(_0x2035ac,_0x43e134){return function(_0x4d3ed3){if(_0x4d3ed3){return _0x4d3ed3[_0x96f7('0x1c')]()['then'](function(){_0x2035ac[_0x96f7('0x13')](0xcc)[_0x96f7('0x12')]();});}};}function handleEntityNotFound(_0x3b9ae2,_0x120398){return function(_0x29a917){if(!_0x29a917){_0x3b9ae2[_0x96f7('0x11')](0x194);}return _0x29a917;};}function handleError(_0x5ccd4a,_0x21d84e){_0x21d84e=_0x21d84e||0x1f4;return function(_0x5d7f73){logger[_0x96f7('0x1d')](_0x5d7f73[_0x96f7('0x1e')]);if(_0x5d7f73[_0x96f7('0x1f')]){delete _0x5d7f73[_0x96f7('0x1f')];}_0x5ccd4a[_0x96f7('0x13')](_0x21d84e)[_0x96f7('0x20')](_0x5d7f73);};}exports[_0x96f7('0x21')]=function(_0x58576b,_0x2624bb){var _0x4babe5={},_0x28fcba={},_0x50edce={'count':0x0,'rows':[]};var _0x528c63=_[_0x96f7('0x22')](db[_0x96f7('0x23')][_0x96f7('0x24')],function(_0x2c63e0){return{'name':_0x2c63e0['fieldName'],'type':_0x2c63e0['type'][_0x96f7('0x25')]};});_0x28fcba[_0x96f7('0x26')]=_[_0x96f7('0x22')](_0x528c63,_0x96f7('0x1f'));_0x28fcba['query']=_[_0x96f7('0x27')](_0x58576b[_0x96f7('0x28')]);_0x28fcba['filters']=_[_0x96f7('0x29')](_0x28fcba[_0x96f7('0x26')],_0x28fcba[_0x96f7('0x28')]);_0x4babe5[_0x96f7('0x2a')]=_[_0x96f7('0x29')](_0x28fcba[_0x96f7('0x26')],qs[_0x96f7('0x2b')](_0x58576b['query'][_0x96f7('0x2b')]));_0x4babe5['attributes']=_0x4babe5['attributes'][_0x96f7('0x2c')]?_0x4babe5[_0x96f7('0x2a')]:_0x28fcba[_0x96f7('0x26')];if(!_0x58576b[_0x96f7('0x28')][_0x96f7('0x2d')]('nolimit')){_0x4babe5['limit']=qs[_0x96f7('0x17')](_0x58576b['query']['limit']);_0x4babe5[_0x96f7('0x16')]=qs[_0x96f7('0x16')](_0x58576b[_0x96f7('0x28')]['offset']);}_0x4babe5[_0x96f7('0x2e')]=qs[_0x96f7('0x2f')](_0x58576b[_0x96f7('0x28')][_0x96f7('0x2f')]);_0x4babe5['where']=qs[_0x96f7('0x30')](_[_0x96f7('0x31')](_0x58576b[_0x96f7('0x28')],_0x28fcba[_0x96f7('0x30')]));if(_0x58576b[_0x96f7('0x28')][_0x96f7('0x32')]){_0x4babe5[_0x96f7('0x33')]=_['merge'](_0x4babe5[_0x96f7('0x33')],{'$or':_[_0x96f7('0x22')](_0x528c63,function(_0x3d3898){if(_0x3d3898[_0x96f7('0x34')]!==_0x96f7('0x35')){var _0x29bcf1={};_0x29bcf1[_0x3d3898[_0x96f7('0x1f')]]={'$like':'%'+_0x58576b['query'][_0x96f7('0x32')]+'%'};return _0x29bcf1;}})});}_0x4babe5=_[_0x96f7('0x36')]({},_0x4babe5,_0x58576b[_0x96f7('0x37')]);var _0x105f9a={'where':_0x4babe5['where']};return db[_0x96f7('0x23')][_0x96f7('0x15')](_0x105f9a)[_0x96f7('0x38')](function(_0x2c09b3){_0x50edce[_0x96f7('0x15')]=_0x2c09b3;if(_0x58576b[_0x96f7('0x28')][_0x96f7('0x39')]){_0x4babe5[_0x96f7('0x3a')]=[{'attributes':['id',_0x96f7('0x1f'),_0x96f7('0x3b'),_0x96f7('0x3c')],'model':db[_0x96f7('0x3d')],'as':_0x96f7('0x3d')}];}return db[_0x96f7('0x23')][_0x96f7('0x3e')](_0x4babe5);})[_0x96f7('0x38')](function(_0x1d6c1b){_0x50edce[_0x96f7('0x3f')]=_0x1d6c1b;return _0x50edce;})['then'](respondWithFilteredResult(_0x2624bb,_0x4babe5))[_0x96f7('0x40')](handleError(_0x2624bb,null));};exports[_0x96f7('0x41')]=function(_0x14d2a9,_0x5753db){var _0x41e48d={'raw':!![],'where':{'id':_0x14d2a9[_0x96f7('0x42')]['id']}},_0x4ea22b={};_0x4ea22b[_0x96f7('0x26')]=_['keys'](db[_0x96f7('0x23')]['rawAttributes']);_0x4ea22b[_0x96f7('0x28')]=_[_0x96f7('0x27')](_0x14d2a9[_0x96f7('0x28')]);_0x4ea22b[_0x96f7('0x30')]=_[_0x96f7('0x29')](_0x4ea22b['model'],_0x4ea22b[_0x96f7('0x28')]);_0x41e48d['attributes']=_[_0x96f7('0x29')](_0x4ea22b['model'],qs['fields'](_0x14d2a9[_0x96f7('0x28')][_0x96f7('0x2b')]));_0x41e48d[_0x96f7('0x2a')]=_0x41e48d['attributes']['length']?_0x41e48d[_0x96f7('0x2a')]:_0x4ea22b['model'];if(_0x14d2a9[_0x96f7('0x28')][_0x96f7('0x39')]){_0x41e48d[_0x96f7('0x3a')]=[{'all':!![]}];}_0x41e48d=_[_0x96f7('0x36')]({},_0x41e48d,_0x14d2a9[_0x96f7('0x37')]);return db[_0x96f7('0x23')]['find'](_0x41e48d)[_0x96f7('0x38')](handleEntityNotFound(_0x5753db,null))['then'](respondWithResult(_0x5753db,null))[_0x96f7('0x40')](handleError(_0x5753db,null));};exports[_0x96f7('0x43')]=function(_0x5b26ea,_0x124e36){return db['VoiceCallReport'][_0x96f7('0x43')](_0x5b26ea[_0x96f7('0x44')],{})['then'](respondWithResult(_0x124e36,0xc9))[_0x96f7('0x40')](handleError(_0x124e36,null));};exports[_0x96f7('0x1c')]=function(_0x3d9e7d,_0x5685f5){return db[_0x96f7('0x23')][_0x96f7('0x45')]({'where':{'id':_0x3d9e7d[_0x96f7('0x42')]['id']}})[_0x96f7('0x38')](handleEntityNotFound(_0x5685f5,null))[_0x96f7('0x38')](removeEntity(_0x5685f5,null))['catch'](handleError(_0x5685f5,null));};exports['describe']=function(_0x4f2aaa,_0xe2b28a){return db[_0x96f7('0x23')]['describe']()[_0x96f7('0x38')](respondWithResult(_0xe2b28a,null))['catch'](handleError(_0xe2b28a,null));};exports['update']=function(_0x40be2a,_0x27f5c8){if(_0x40be2a['body'][_0x96f7('0x46')]){delete _0x40be2a[_0x96f7('0x44')][_0x96f7('0x46')];}return db['VoiceCallReport'][_0x96f7('0x45')]({'where':{'uniqueid':_0x40be2a['params']['id'],'UserId':{'$or':[null,_0x40be2a[_0x96f7('0x47')]['id']]}}})['then'](handleEntityNotFound(_0x27f5c8,null))[_0x96f7('0x38')](saveUpdates(_0x40be2a[_0x96f7('0x44')],null))[_0x96f7('0x38')](respondWithResult(_0x27f5c8,null))['catch'](handleError(_0x27f5c8,null));}; \ No newline at end of file +var _0x9729=['stack','name','send','map','VoiceCallReport','fieldName','type','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','rawAttributes','intersection','create','body','find','describe','uniqueid','user','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','update','destroy','then','sendStatus','error'];(function(_0x31c5e5,_0x3feb46){var _0x3bf444=function(_0x249a4b){while(--_0x249a4b){_0x31c5e5['push'](_0x31c5e5['shift']());}};_0x3bf444(++_0x3feb46);}(_0x9729,0x16b));var _0x9972=function(_0x5bde3c,_0x4fc666){_0x5bde3c=_0x5bde3c-0x0;var _0x52509d=_0x9729[_0x5bde3c];return _0x52509d;};'use strict';var pdf=require(_0x9972('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9972('0x1'));var zipdir=require(_0x9972('0x2'));var jsonpatch=require(_0x9972('0x3'));var rp=require(_0x9972('0x4'));var moment=require(_0x9972('0x5'));var BPromise=require(_0x9972('0x6'));var Mustache=require(_0x9972('0x7'));var util=require(_0x9972('0x8'));var path=require('path');var sox=require(_0x9972('0x9'));var csv=require(_0x9972('0xa'));var ejs=require(_0x9972('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9972('0xc'));var crypto=require(_0x9972('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9972('0xa'));var querystring=require(_0x9972('0xe'));var Papa=require('papaparse');var Redis=require(_0x9972('0xf'));var authService=require(_0x9972('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9972('0x11'));var hardwareService=require(_0x9972('0x12'));var logger=require(_0x9972('0x13'))(_0x9972('0x14'));var utils=require(_0x9972('0x15'));var config=require(_0x9972('0x16'));var db=require(_0x9972('0x17'))['db'];function respondWithStatusCode(_0x5abeb0,_0x27a8d2){_0x27a8d2=_0x27a8d2||0xcc;return function(_0x2fd1d8){if(_0x2fd1d8){return _0x5abeb0['sendStatus'](_0x27a8d2);}return _0x5abeb0[_0x9972('0x18')](_0x27a8d2)[_0x9972('0x19')]();};}function respondWithResult(_0x707baa,_0x10d088){_0x10d088=_0x10d088||0xc8;return function(_0x54acd3){if(_0x54acd3){return _0x707baa[_0x9972('0x18')](_0x10d088)[_0x9972('0x1a')](_0x54acd3);}};}function respondWithFilteredResult(_0x2e2bb9,_0xf95c18){return function(_0x25d1d6){if(_0x25d1d6){var _0x10239a=_0x25d1d6[_0x9972('0x1b')],_0x288f76=_0xf95c18[_0x9972('0x1c')],_0x4b762a=_0xf95c18[_0x9972('0x1c')]+_0xf95c18['limit'],_0x452c0a;if(_0x4b762a>=_0x10239a){_0x4b762a=_0x10239a;_0x452c0a=0xc8;}else{_0x452c0a=0xce;}_0x2e2bb9['status'](_0x452c0a);return _0x2e2bb9[_0x9972('0x1d')](_0x9972('0x1e'),_0x288f76+'-'+_0x4b762a+'/'+_0x10239a)[_0x9972('0x1a')](_0x25d1d6);}return null;};}function patchUpdates(_0x283e1e){return function(_0x3f09f5){try{jsonpatch[_0x9972('0x1f')](_0x3f09f5,_0x283e1e,!![]);}catch(_0x1ecafb){return BPromise['reject'](_0x1ecafb);}return _0x3f09f5['save']();};}function saveUpdates(_0x83d94c,_0x499634){return function(_0x2aceb3){if(_0x2aceb3){return _0x2aceb3[_0x9972('0x20')](_0x83d94c)['then'](function(_0x784d69){return _0x784d69;});}return null;};}function removeEntity(_0x5cd559,_0x325f58){return function(_0x581025){if(_0x581025){return _0x581025[_0x9972('0x21')]()[_0x9972('0x22')](function(){_0x5cd559['status'](0xcc)[_0x9972('0x19')]();});}};}function handleEntityNotFound(_0x4e0488,_0x25ed9d){return function(_0x4ea0e6){if(!_0x4ea0e6){_0x4e0488[_0x9972('0x23')](0x194);}return _0x4ea0e6;};}function handleError(_0x27130d,_0x333b9b){_0x333b9b=_0x333b9b||0x1f4;return function(_0x3af6d4){logger[_0x9972('0x24')](_0x3af6d4[_0x9972('0x25')]);if(_0x3af6d4[_0x9972('0x26')]){delete _0x3af6d4[_0x9972('0x26')];}_0x27130d[_0x9972('0x18')](_0x333b9b)[_0x9972('0x27')](_0x3af6d4);};}exports['index']=function(_0x500077,_0x31bff7){var _0x51d505={},_0x493a2f={},_0x2590e6={'count':0x0,'rows':[]};var _0x5e6316=_[_0x9972('0x28')](db[_0x9972('0x29')]['rawAttributes'],function(_0x19d575){return{'name':_0x19d575[_0x9972('0x2a')],'type':_0x19d575[_0x9972('0x2b')]['key']};});_0x493a2f['model']=_[_0x9972('0x28')](_0x5e6316,_0x9972('0x26'));_0x493a2f[_0x9972('0x2c')]=_[_0x9972('0x2d')](_0x500077[_0x9972('0x2c')]);_0x493a2f[_0x9972('0x2e')]=_['intersection'](_0x493a2f[_0x9972('0x2f')],_0x493a2f['query']);_0x51d505[_0x9972('0x30')]=_['intersection'](_0x493a2f['model'],qs[_0x9972('0x31')](_0x500077[_0x9972('0x2c')][_0x9972('0x31')]));_0x51d505[_0x9972('0x30')]=_0x51d505[_0x9972('0x30')][_0x9972('0x32')]?_0x51d505['attributes']:_0x493a2f['model'];if(!_0x500077[_0x9972('0x2c')][_0x9972('0x33')](_0x9972('0x34'))){_0x51d505['limit']=qs[_0x9972('0x35')](_0x500077[_0x9972('0x2c')]['limit']);_0x51d505[_0x9972('0x1c')]=qs['offset'](_0x500077[_0x9972('0x2c')][_0x9972('0x1c')]);}_0x51d505[_0x9972('0x36')]=qs[_0x9972('0x37')](_0x500077['query'][_0x9972('0x37')]);_0x51d505['where']=qs[_0x9972('0x2e')](_[_0x9972('0x38')](_0x500077[_0x9972('0x2c')],_0x493a2f[_0x9972('0x2e')]));if(_0x500077[_0x9972('0x2c')][_0x9972('0x39')]){_0x51d505['where']=_['merge'](_0x51d505[_0x9972('0x3a')],{'$or':_[_0x9972('0x28')](_0x5e6316,function(_0x2de237){if(_0x2de237['type']!==_0x9972('0x3b')){var _0x44630a={};_0x44630a[_0x2de237[_0x9972('0x26')]]={'$like':'%'+_0x500077[_0x9972('0x2c')]['filter']+'%'};return _0x44630a;}})});}_0x51d505=_[_0x9972('0x3c')]({},_0x51d505,_0x500077[_0x9972('0x3d')]);var _0x480027={'where':_0x51d505['where']};return db[_0x9972('0x29')][_0x9972('0x1b')](_0x480027)[_0x9972('0x22')](function(_0x23e9d8){_0x2590e6['count']=_0x23e9d8;if(_0x500077[_0x9972('0x2c')][_0x9972('0x3e')]){_0x51d505[_0x9972('0x3f')]=[{'attributes':['id',_0x9972('0x26'),_0x9972('0x40'),_0x9972('0x41')],'model':db[_0x9972('0x42')],'as':'User'}];}return db[_0x9972('0x29')][_0x9972('0x43')](_0x51d505);})[_0x9972('0x22')](function(_0x8ba538){_0x2590e6[_0x9972('0x44')]=_0x8ba538;return _0x2590e6;})[_0x9972('0x22')](respondWithFilteredResult(_0x31bff7,_0x51d505))[_0x9972('0x45')](handleError(_0x31bff7,null));};exports[_0x9972('0x46')]=function(_0x21af12,_0x70b958){var _0x27621a={'raw':!![],'where':{'id':_0x21af12[_0x9972('0x47')]['id']}},_0x333254={};_0x333254[_0x9972('0x2f')]=_['keys'](db[_0x9972('0x29')][_0x9972('0x48')]);_0x333254[_0x9972('0x2c')]=_[_0x9972('0x2d')](_0x21af12['query']);_0x333254['filters']=_[_0x9972('0x49')](_0x333254[_0x9972('0x2f')],_0x333254[_0x9972('0x2c')]);_0x27621a[_0x9972('0x30')]=_[_0x9972('0x49')](_0x333254[_0x9972('0x2f')],qs[_0x9972('0x31')](_0x21af12[_0x9972('0x2c')][_0x9972('0x31')]));_0x27621a[_0x9972('0x30')]=_0x27621a[_0x9972('0x30')][_0x9972('0x32')]?_0x27621a[_0x9972('0x30')]:_0x333254['model'];if(_0x21af12[_0x9972('0x2c')][_0x9972('0x3e')]){_0x27621a[_0x9972('0x3f')]=[{'all':!![]}];}_0x27621a=_[_0x9972('0x3c')]({},_0x27621a,_0x21af12[_0x9972('0x3d')]);return db['VoiceCallReport']['find'](_0x27621a)['then'](handleEntityNotFound(_0x70b958,null))[_0x9972('0x22')](respondWithResult(_0x70b958,null))[_0x9972('0x45')](handleError(_0x70b958,null));};exports[_0x9972('0x4a')]=function(_0x599139,_0x27b9e9){return db[_0x9972('0x29')][_0x9972('0x4a')](_0x599139[_0x9972('0x4b')],{})['then'](respondWithResult(_0x27b9e9,0xc9))[_0x9972('0x45')](handleError(_0x27b9e9,null));};exports[_0x9972('0x21')]=function(_0x1a692b,_0x5440be){return db[_0x9972('0x29')][_0x9972('0x4c')]({'where':{'id':_0x1a692b[_0x9972('0x47')]['id']}})[_0x9972('0x22')](handleEntityNotFound(_0x5440be,null))['then'](removeEntity(_0x5440be,null))[_0x9972('0x45')](handleError(_0x5440be,null));};exports[_0x9972('0x4d')]=function(_0x2244ff,_0x2144c2){return db['VoiceCallReport'][_0x9972('0x4d')]()['then'](respondWithResult(_0x2144c2,null))[_0x9972('0x45')](handleError(_0x2144c2,null));};exports[_0x9972('0x20')]=function(_0x3457fb,_0x55f794){if(_0x3457fb[_0x9972('0x4b')][_0x9972('0x4e')]){delete _0x3457fb[_0x9972('0x4b')][_0x9972('0x4e')];}return db[_0x9972('0x29')][_0x9972('0x4c')]({'where':{'uniqueid':_0x3457fb[_0x9972('0x47')]['id'],'UserId':{'$or':[null,_0x3457fb[_0x9972('0x4f')]['id']]}}})[_0x9972('0x22')](handleEntityNotFound(_0x55f794,null))[_0x9972('0x22')](saveUpdates(_0x3457fb[_0x9972('0x4b')],null))[_0x9972('0x22')](respondWithResult(_0x55f794,null))[_0x9972('0x45')](handleError(_0x55f794,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 806d3ee..1a822df 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 _0x0f94=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','util'];(function(_0x4d04d6,_0x38ae19){var _0x2e937a=function(_0x4961c8){while(--_0x4961c8){_0x4d04d6['push'](_0x4d04d6['shift']());}};_0x2e937a(++_0x38ae19);}(_0x0f94,0x107));var _0x40f9=function(_0xf1041c,_0xee1a77){_0xf1041c=_0xf1041c-0x0;var _0x4e68cf=_0x0f94[_0xf1041c];return _0x4e68cf;};'use strict';var _=require('lodash');var util=require(_0x40f9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x40f9('0x1'));var BPromise=require(_0x40f9('0x2'));var rp=require(_0x40f9('0x3'));var fs=require('fs');var path=require(_0x40f9('0x4'));var rimraf=require(_0x40f9('0x5'));var config=require(_0x40f9('0x6'));var attributes=require(_0x40f9('0x7'));module[_0x40f9('0x8')]=function(_0x46c14f,_0x5e2e36){return _0x46c14f[_0x40f9('0x9')](_0x40f9('0xa'),attributes,{'tableName':_0x40f9('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x14f6=['uniqueid','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x1138c4,_0x841d33){var _0x200cc1=function(_0x2f6d85){while(--_0x2f6d85){_0x1138c4['push'](_0x1138c4['shift']());}};_0x200cc1(++_0x841d33);}(_0x14f6,0x9d));var _0x614f=function(_0x142f65,_0x56d69b){_0x142f65=_0x142f65-0x0;var _0x75e7e9=_0x14f6[_0x142f65];return _0x75e7e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x614f('0x0'))(_0x614f('0x1'));var moment=require(_0x614f('0x2'));var BPromise=require(_0x614f('0x3'));var rp=require(_0x614f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x614f('0x5'));var config=require(_0x614f('0x6'));var attributes=require(_0x614f('0x7'));module[_0x614f('0x8')]=function(_0x4d4cf3,_0xe8d671){return _0x4d4cf3[_0x614f('0x9')](_0x614f('0xa'),attributes,{'tableName':_0x614f('0xb'),'paranoid':![],'indexes':[{'fields':[_0x614f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 627d452..0dd88f4 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 _0x3b95=['map','model','attributes','then','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','limit','include'];(function(_0x418622,_0x161963){var _0x382033=function(_0xa013e){while(--_0xa013e){_0x418622['push'](_0x418622['shift']());}};_0x382033(++_0x161963);}(_0x3b95,0x113));var _0x53b9=function(_0x3f6798,_0x158c1a){_0x3f6798=_0x3f6798-0x0;var _0x575302=_0x3b95[_0x3f6798];return _0x575302;};'use strict';var _=require(_0x53b9('0x0'));var util=require(_0x53b9('0x1'));var moment=require(_0x53b9('0x2'));var BPromise=require(_0x53b9('0x3'));var rs=require(_0x53b9('0x4'));var fs=require('fs');var Redis=require(_0x53b9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x53b9('0x6'));var logger=require('../../config/logger')(_0x53b9('0x7'));var config=require('../../config/environment');var jayson=require(_0x53b9('0x8'));var client=jayson[_0x53b9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd693c4,_0x683dd4,_0x38aa44){return new BPromise(function(_0x556b42,_0x3f1cef){return client[_0x53b9('0xa')](_0xd693c4,_0x38aa44)['then'](function(_0x3c7e8d){logger[_0x53b9('0xb')](_0x53b9('0xc'),_0x683dd4,_0x53b9('0xd'));logger[_0x53b9('0xe')](_0x53b9('0xf'),_0x683dd4,_0x53b9('0xd'),JSON[_0x53b9('0x10')](_0x3c7e8d));if(_0x3c7e8d['error']){if(_0x3c7e8d['error'][_0x53b9('0x11')]===0x1f4){logger[_0x53b9('0x12')](_0x53b9('0xc'),_0x683dd4,_0x3c7e8d[_0x53b9('0x12')]['message']);return _0x3f1cef(_0x3c7e8d[_0x53b9('0x12')][_0x53b9('0x13')]);}logger[_0x53b9('0x12')](_0x53b9('0xc'),_0x683dd4,_0x3c7e8d['error'][_0x53b9('0x13')]);return _0x556b42(_0x3c7e8d[_0x53b9('0x12')][_0x53b9('0x13')]);}else{logger[_0x53b9('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x683dd4,_0x53b9('0xd'));_0x556b42(_0x3c7e8d[_0x53b9('0x14')][_0x53b9('0x13')]);}})[_0x53b9('0x15')](function(_0x10c2ee){logger[_0x53b9('0x12')](_0x53b9('0xc'),_0x683dd4,_0x10c2ee);_0x3f1cef(_0x10c2ee);});});}exports[_0x53b9('0x16')]=function(_0x16955a){var _0x3d6e66=this;return new Promise(function(_0xff6dc1,_0x3380da){return db[_0x53b9('0x17')][_0x53b9('0x18')]({'raw':_0x16955a[_0x53b9('0x19')]?_0x16955a[_0x53b9('0x19')][_0x53b9('0x1a')]===undefined?!![]:![]:!![],'where':_0x16955a[_0x53b9('0x19')]?_0x16955a[_0x53b9('0x19')]['where']||null:null,'attributes':_0x16955a['options']?_0x16955a[_0x53b9('0x19')]['attributes']||null:null,'limit':_0x16955a[_0x53b9('0x19')]?_0x16955a['options'][_0x53b9('0x1b')]||null:null,'include':_0x16955a['options']?_0x16955a['options'][_0x53b9('0x1c')]?_[_0x53b9('0x1d')](_0x16955a[_0x53b9('0x19')][_0x53b9('0x1c')],function(_0x3e2fb4){return{'model':db[_0x3e2fb4[_0x53b9('0x1e')]],'as':_0x3e2fb4['as'],'attributes':_0x3e2fb4[_0x53b9('0x1f')],'include':_0x3e2fb4[_0x53b9('0x1c')]?_[_0x53b9('0x1d')](_0x3e2fb4[_0x53b9('0x1c')],function(_0x280c70){return{'model':db[_0x280c70['model']],'as':_0x280c70['as'],'attributes':_0x280c70[_0x53b9('0x1f')],'include':_0x280c70['include']?_['map'](_0x280c70[_0x53b9('0x1c')],function(_0x12a242){return{'model':db[_0x12a242[_0x53b9('0x1e')]],'as':_0x12a242['as'],'attributes':_0x12a242[_0x53b9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x53b9('0x20')](function(_0x328b6d){logger['info'](_0x53b9('0x16'),_0x16955a);logger[_0x53b9('0xe')](_0x53b9('0x16'),_0x16955a,JSON[_0x53b9('0x10')](_0x328b6d));_0xff6dc1(_0x328b6d);})[_0x53b9('0x15')](function(_0x29d1a1){logger[_0x53b9('0x12')]('GetVoiceCallReport',_0x29d1a1[_0x53b9('0x13')],_0x16955a);_0x3380da(_0x3d6e66['error'](0x1f4,_0x29d1a1[_0x53b9('0x13')]));});});};exports[_0x53b9('0x21')]=function(_0x37d794){var _0x502769=this;return new Promise(function(_0x2210bd,_0x2c91bf){return db[_0x53b9('0x17')][_0x53b9('0x22')](_0x37d794[_0x53b9('0x23')],{'raw':_0x37d794['options']?_0x37d794[_0x53b9('0x19')][_0x53b9('0x1a')]===undefined?!![]:![]:!![]})[_0x53b9('0x20')](function(_0x3749b2){logger[_0x53b9('0xb')](_0x53b9('0x21'),_0x37d794);logger[_0x53b9('0xe')]('CreateVoiceCallReport',_0x37d794,JSON[_0x53b9('0x10')](_0x3749b2));_0x2210bd(_0x3749b2);})[_0x53b9('0x15')](function(_0x4a80b8){logger[_0x53b9('0x12')](_0x53b9('0x21'),_0x4a80b8[_0x53b9('0x13')],_0x37d794);_0x2c91bf(_0x502769[_0x53b9('0x12')](0x1f4,_0x4a80b8['message']));});});};exports['UpdateVoiceCallReport']=function(_0x486299){var _0x8a3878=this;return new Promise(function(_0x167e42,_0x4c297f){return db[_0x53b9('0x17')][_0x53b9('0x24')](_0x486299[_0x53b9('0x23')],{'raw':_0x486299[_0x53b9('0x19')]?_0x486299[_0x53b9('0x19')][_0x53b9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x486299[_0x53b9('0x19')]?_0x486299[_0x53b9('0x19')]['where']||null:null,'attributes':_0x486299[_0x53b9('0x19')]?_0x486299[_0x53b9('0x19')][_0x53b9('0x1f')]||null:null,'limit':_0x486299[_0x53b9('0x19')]?_0x486299['options'][_0x53b9('0x1b')]||null:null})['then'](function(_0x1e8240){logger[_0x53b9('0xb')](_0x53b9('0x25'),_0x486299);logger[_0x53b9('0xe')](_0x53b9('0x25'),_0x486299,JSON['stringify'](_0x1e8240));_0x167e42(_0x1e8240);})['catch'](function(_0x21698c){logger['error']('UpdateVoiceCallReport',_0x21698c[_0x53b9('0x13')],_0x486299);_0x4c297f(_0x8a3878[_0x53b9('0x12')](0x1f4,_0x21698c['message']));});});}; \ No newline at end of file +var _0x991a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','result','catch','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','map','include','model','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','limit','util','moment','bluebird'];(function(_0x46b59f,_0x17e908){var _0x27fb76=function(_0x4e4509){while(--_0x4e4509){_0x46b59f['push'](_0x46b59f['shift']());}};_0x27fb76(++_0x17e908);}(_0x991a,0x14a));var _0xa991=function(_0x86face,_0x57d9fc){_0x86face=_0x86face-0x0;var _0x2d77d4=_0x991a[_0x86face];return _0x2d77d4;};'use strict';var _=require('lodash');var util=require(_0xa991('0x0'));var moment=require(_0xa991('0x1'));var BPromise=require(_0xa991('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa991('0x3'))['db'];var utils=require(_0xa991('0x4'));var logger=require(_0xa991('0x5'))(_0xa991('0x6'));var config=require(_0xa991('0x7'));var jayson=require(_0xa991('0x8'));var client=jayson[_0xa991('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16ac37,_0x249b77,_0x507d3c){return new BPromise(function(_0xb825f7,_0x122317){return client[_0xa991('0xa')](_0x16ac37,_0x507d3c)[_0xa991('0xb')](function(_0x581102){logger[_0xa991('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x249b77,_0xa991('0xd'));logger[_0xa991('0xe')](_0xa991('0xf'),_0x249b77,_0xa991('0xd'),JSON[_0xa991('0x10')](_0x581102));if(_0x581102[_0xa991('0x11')]){if(_0x581102['error'][_0xa991('0x12')]===0x1f4){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x249b77,_0x581102[_0xa991('0x11')]['message']);return _0x122317(_0x581102[_0xa991('0x11')][_0xa991('0x13')]);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x249b77,_0x581102[_0xa991('0x11')][_0xa991('0x13')]);return _0xb825f7(_0x581102['error']['message']);}else{logger[_0xa991('0xc')](_0xa991('0x14'),_0x249b77,'request\x20sent');_0xb825f7(_0x581102[_0xa991('0x15')][_0xa991('0x13')]);}})[_0xa991('0x16')](function(_0x372a65){logger[_0xa991('0x11')](_0xa991('0x14'),_0x249b77,_0x372a65);_0x122317(_0x372a65);});});}exports[_0xa991('0x17')]=function(_0x16af9f){var _0xe67842=this;return new Promise(function(_0x2ca80a,_0x476a7a){return db[_0xa991('0x18')]['findAll']({'raw':_0x16af9f[_0xa991('0x19')]?_0x16af9f[_0xa991('0x19')][_0xa991('0x1a')]===undefined?!![]:![]:!![],'where':_0x16af9f[_0xa991('0x19')]?_0x16af9f[_0xa991('0x19')][_0xa991('0x1b')]||null:null,'attributes':_0x16af9f[_0xa991('0x19')]?_0x16af9f[_0xa991('0x19')][_0xa991('0x1c')]||null:null,'limit':_0x16af9f['options']?_0x16af9f[_0xa991('0x19')]['limit']||null:null,'include':_0x16af9f[_0xa991('0x19')]?_0x16af9f[_0xa991('0x19')]['include']?_[_0xa991('0x1d')](_0x16af9f[_0xa991('0x19')]['include'],function(_0x3e7394){return{'model':db[_0x3e7394['model']],'as':_0x3e7394['as'],'attributes':_0x3e7394[_0xa991('0x1c')],'include':_0x3e7394[_0xa991('0x1e')]?_[_0xa991('0x1d')](_0x3e7394['include'],function(_0x4892b3){return{'model':db[_0x4892b3[_0xa991('0x1f')]],'as':_0x4892b3['as'],'attributes':_0x4892b3[_0xa991('0x1c')],'include':_0x4892b3[_0xa991('0x1e')]?_[_0xa991('0x1d')](_0x4892b3[_0xa991('0x1e')],function(_0x42ca93){return{'model':db[_0x42ca93[_0xa991('0x1f')]],'as':_0x42ca93['as'],'attributes':_0x42ca93[_0xa991('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x31997d){logger[_0xa991('0xc')]('GetVoiceCallReport',_0x16af9f);logger['debug'](_0xa991('0x17'),_0x16af9f,JSON[_0xa991('0x10')](_0x31997d));_0x2ca80a(_0x31997d);})[_0xa991('0x16')](function(_0x2478bb){logger[_0xa991('0x11')](_0xa991('0x17'),_0x2478bb[_0xa991('0x13')],_0x16af9f);_0x476a7a(_0xe67842[_0xa991('0x11')](0x1f4,_0x2478bb[_0xa991('0x13')]));});});};exports[_0xa991('0x20')]=function(_0x239e00){var _0x248333=this;return new Promise(function(_0x551711,_0x5a5d35){return db[_0xa991('0x18')][_0xa991('0x21')](_0x239e00['body'],{'raw':_0x239e00['options']?_0x239e00[_0xa991('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xa991('0xb')](function(_0x49d894){logger['info']('CreateVoiceCallReport',_0x239e00);logger['debug'](_0xa991('0x20'),_0x239e00,JSON['stringify'](_0x49d894));_0x551711(_0x49d894);})[_0xa991('0x16')](function(_0x52ba96){logger[_0xa991('0x11')](_0xa991('0x20'),_0x52ba96[_0xa991('0x13')],_0x239e00);_0x5a5d35(_0x248333[_0xa991('0x11')](0x1f4,_0x52ba96[_0xa991('0x13')]));});});};exports[_0xa991('0x22')]=function(_0x5aa4ab){var _0x12e988=this;return new Promise(function(_0x117f1f,_0x589040){return db['VoiceCallReport'][_0xa991('0x23')](_0x5aa4ab['body'],{'raw':_0x5aa4ab[_0xa991('0x19')]?_0x5aa4ab[_0xa991('0x19')][_0xa991('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aa4ab['options']?_0x5aa4ab['options'][_0xa991('0x1b')]||null:null,'attributes':_0x5aa4ab[_0xa991('0x19')]?_0x5aa4ab['options'][_0xa991('0x1c')]||null:null,'limit':_0x5aa4ab[_0xa991('0x19')]?_0x5aa4ab[_0xa991('0x19')][_0xa991('0x24')]||null:null})[_0xa991('0xb')](function(_0x11539b){logger['info']('UpdateVoiceCallReport',_0x5aa4ab);logger[_0xa991('0xe')](_0xa991('0x22'),_0x5aa4ab,JSON[_0xa991('0x10')](_0x11539b));_0x117f1f(_0x11539b);})[_0xa991('0x16')](function(_0x11d6c8){logger['error'](_0xa991('0x22'),_0x11d6c8['message'],_0x5aa4ab);_0x589040(_0x12e988[_0xa991('0x11')](0x1f4,_0x11d6c8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d2ced52..54b3a15 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 _0xfdcd=['create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xdfdc('0x0'));var path=require(_0xdfdc('0x1'));var timeout=require(_0xdfdc('0x2'));var express=require('express');var router=express[_0xdfdc('0x3')]();var auth=require(_0xdfdc('0x4'));var interaction=require(_0xdfdc('0x5'));var config=require(_0xdfdc('0x6'));var controller=require(_0xdfdc('0x7'));router[_0xdfdc('0x8')]('/',auth[_0xdfdc('0x9')](),controller[_0xdfdc('0xa')]);router[_0xdfdc('0x8')](_0xdfdc('0xb'),auth[_0xdfdc('0x9')](),controller[_0xdfdc('0xc')]);router[_0xdfdc('0xd')]('/',auth['isAuthenticated'](),controller[_0xdfdc('0xe')]);router[_0xdfdc('0xf')]('/:id',auth[_0xdfdc('0x9')](),controller[_0xdfdc('0x10')]);router[_0xdfdc('0x11')](_0xdfdc('0xb'),auth[_0xdfdc('0x9')](),controller['destroy']);module[_0xdfdc('0x12')]=router; \ No newline at end of file +var _0x4f5a=['exports','multer','util','connect-timeout','../../config/environment','./voiceChanSpy.controller','isAuthenticated','show','post','create','/:id','delete','destroy'];(function(_0x4bddda,_0x14caf2){var _0x2d6e63=function(_0x42f8be){while(--_0x42f8be){_0x4bddda['push'](_0x4bddda['shift']());}};_0x2d6e63(++_0x14caf2);}(_0x4f5a,0xaa));var _0xa4f5=function(_0x116b1c,_0x7bf468){_0x116b1c=_0x116b1c-0x0;var _0x5c792d=_0x4f5a[_0x116b1c];return _0x5c792d;};'use strict';var multer=require(_0xa4f5('0x0'));var util=require(_0xa4f5('0x1'));var path=require('path');var timeout=require(_0xa4f5('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa4f5('0x3'));var controller=require(_0xa4f5('0x4'));router['get']('/',auth[_0xa4f5('0x5')](),controller['index']);router['get']('/:id',auth[_0xa4f5('0x5')](),controller[_0xa4f5('0x6')]);router[_0xa4f5('0x7')]('/',auth[_0xa4f5('0x5')](),controller[_0xa4f5('0x8')]);router['put'](_0xa4f5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xa4f5('0xa')]('/:id',auth[_0xa4f5('0x5')](),controller[_0xa4f5('0xb')]);module[_0xa4f5('0xc')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index debaf81..9898cee 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 _0x403e=['split','BOOLEAN','exports','STRING','name','setDataValue','join','options'];(function(_0x99d3bf,_0x4049ae){var _0x2831c0=function(_0x1a7c74){while(--_0x1a7c74){_0x99d3bf['push'](_0x99d3bf['shift']());}};_0x2831c0(++_0x4049ae);}(_0x403e,0x1ea));var _0xe403=function(_0x383085,_0x35a491){_0x383085=_0x383085-0x0;var _0xf44f6a=_0x403e[_0x383085];return _0xf44f6a;};'use strict';var Sequelize=require('sequelize');module[_0xe403('0x0')]={'name':{'type':Sequelize[_0xe403('0x1')]},'prefix':{'type':Sequelize[_0xe403('0x1')],'unique':_0xe403('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xe403('0x1')],'set':function(_0x300980){this[_0xe403('0x3')]('options',_0x300980?_0x300980[_0xe403('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xe403('0x5'))?this['getDataValue']('options')[_0xe403('0x6')](''):[];}},'auth':{'type':Sequelize[_0xe403('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xe403('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe403('0x1')]},'description':{'type':Sequelize[_0xe403('0x1')]}}; \ No newline at end of file +var _0x1e92=['STRING','name','setDataValue','join','getDataValue','options','split','BOOLEAN','exports'];(function(_0x272d1a,_0x19e840){var _0x2dfa22=function(_0x5938e9){while(--_0x5938e9){_0x272d1a['push'](_0x272d1a['shift']());}};_0x2dfa22(++_0x19e840);}(_0x1e92,0x19d));var _0x21e9=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x1e92[_0x51c819];return _0x15c5d2;};'use strict';var Sequelize=require('sequelize');module[_0x21e9('0x0')]={'name':{'type':Sequelize[_0x21e9('0x1')]},'prefix':{'type':Sequelize[_0x21e9('0x1')],'unique':_0x21e9('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x3ac032){this[_0x21e9('0x3')]('options',_0x3ac032?_0x3ac032[_0x21e9('0x4')](''):[]);},'get':function(){return this[_0x21e9('0x5')](_0x21e9('0x6'))?this[_0x21e9('0x5')]('options')[_0x21e9('0x7')](''):[];}},'auth':{'type':Sequelize[_0x21e9('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x21e9('0x1')]},'record':{'type':Sequelize[_0x21e9('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x21e9('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 2cff9ca..82ab28b 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 _0x8d37=['zip-dir','request-promise','util','sox','ejs','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/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','reject','save','update','destroy','then','get','ChanSpies','error','name','send','index','map','VoiceChanSpy','type','key','query','keys','intersection','model','attributes','length','nolimit','limit','offset','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','fields','includeAll','create','body','role','user','UserProfileSection','find','userProfileId','UserProfileResource','html-pdf'];(function(_0x54c46f,_0x1907bd){var _0x337b33=function(_0x37fe40){while(--_0x37fe40){_0x54c46f['push'](_0x54c46f['shift']());}};_0x337b33(++_0x1907bd);}(_0x8d37,0x137));var _0x78d3=function(_0x5ba8a1,_0x12bba8){_0x5ba8a1=_0x5ba8a1-0x0;var _0x51c1e1=_0x8d37[_0x5ba8a1];return _0x51c1e1;};'use strict';var pdf=require(_0x78d3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x78d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x78d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x78d3('0x3'));var path=require('path');var sox=require(_0x78d3('0x4'));var csv=require('to-csv');var ejs=require(_0x78d3('0x5'));var fs=require('fs');var _=require(_0x78d3('0x6'));var squel=require(_0x78d3('0x7'));var crypto=require('crypto');var jsforce=require(_0x78d3('0x8'));var deskjs=require(_0x78d3('0x9'));var toCsv=require(_0x78d3('0xa'));var querystring=require(_0x78d3('0xb'));var Papa=require(_0x78d3('0xc'));var Redis=require(_0x78d3('0xd'));var authService=require(_0x78d3('0xe'));var qs=require(_0x78d3('0xf'));var as=require(_0x78d3('0x10'));var hardwareService=require(_0x78d3('0x11'));var logger=require(_0x78d3('0x12'))(_0x78d3('0x13'));var utils=require('../../config/utils');var config=require(_0x78d3('0x14'));var db=require(_0x78d3('0x15'))['db'];function respondWithStatusCode(_0x10da7d,_0x38f968){_0x38f968=_0x38f968||0xcc;return function(_0x47ca10){if(_0x47ca10){return _0x10da7d[_0x78d3('0x16')](_0x38f968);}return _0x10da7d[_0x78d3('0x17')](_0x38f968)[_0x78d3('0x18')]();};}function respondWithResult(_0x3c10e0,_0x161137){_0x161137=_0x161137||0xc8;return function(_0x23ff2e){if(_0x23ff2e){return _0x3c10e0[_0x78d3('0x17')](_0x161137)[_0x78d3('0x19')](_0x23ff2e);}};}function respondWithFilteredResult(_0x492504,_0x41bdd9){return function(_0x2bc410){if(_0x2bc410){var _0x5c29b1=_0x2bc410[_0x78d3('0x1a')],_0x761588=_0x41bdd9['offset'],_0x45ef2e=_0x41bdd9['offset']+_0x41bdd9['limit'],_0x79e397;if(_0x45ef2e>=_0x5c29b1){_0x45ef2e=_0x5c29b1;_0x79e397=0xc8;}else{_0x79e397=0xce;}_0x492504[_0x78d3('0x17')](_0x79e397);return _0x492504[_0x78d3('0x1b')](_0x78d3('0x1c'),_0x761588+'-'+_0x45ef2e+'/'+_0x5c29b1)[_0x78d3('0x19')](_0x2bc410);}return null;};}function patchUpdates(_0x2f9473){return function(_0x359ce9){try{jsonpatch['apply'](_0x359ce9,_0x2f9473,!![]);}catch(_0x2bd426){return BPromise[_0x78d3('0x1d')](_0x2bd426);}return _0x359ce9[_0x78d3('0x1e')]();};}function saveUpdates(_0x26c70a,_0x412819){return function(_0x2dd977){if(_0x2dd977){return _0x2dd977[_0x78d3('0x1f')](_0x26c70a)['then'](function(_0x4daff4){return _0x4daff4;});}return null;};}function removeEntity(_0x415d7c,_0x5d392a){return function(_0x117466){if(_0x117466){return _0x117466[_0x78d3('0x20')]()[_0x78d3('0x21')](function(){var _0x520e22=_0x117466[_0x78d3('0x22')]({'plain':!![]});var _0x260fb1=_0x78d3('0x23');return db['UserProfileResource'][_0x78d3('0x20')]({'where':{'type':_0x260fb1,'resourceId':_0x520e22['id']}})[_0x78d3('0x21')](function(){return _0x117466;});})[_0x78d3('0x21')](function(){_0x415d7c[_0x78d3('0x17')](0xcc)[_0x78d3('0x18')]();});}};}function handleEntityNotFound(_0x2ca1f0,_0x28fa57){return function(_0x20bd23){if(!_0x20bd23){_0x2ca1f0['sendStatus'](0x194);}return _0x20bd23;};}function handleError(_0x333645,_0x22c5fe){_0x22c5fe=_0x22c5fe||0x1f4;return function(_0x3b8381){logger[_0x78d3('0x24')](_0x3b8381['stack']);if(_0x3b8381[_0x78d3('0x25')]){delete _0x3b8381[_0x78d3('0x25')];}_0x333645[_0x78d3('0x17')](_0x22c5fe)[_0x78d3('0x26')](_0x3b8381);};}exports[_0x78d3('0x27')]=function(_0x5b31ee,_0x3d29f3){var _0x3f818b={},_0x23743f={},_0x41b6f9={'count':0x0,'rows':[]};var _0x5580fc=_[_0x78d3('0x28')](db[_0x78d3('0x29')]['rawAttributes'],function(_0x6b3fa1){return{'name':_0x6b3fa1['fieldName'],'type':_0x6b3fa1[_0x78d3('0x2a')][_0x78d3('0x2b')]};});_0x23743f['model']=_[_0x78d3('0x28')](_0x5580fc,_0x78d3('0x25'));_0x23743f[_0x78d3('0x2c')]=_[_0x78d3('0x2d')](_0x5b31ee[_0x78d3('0x2c')]);_0x23743f['filters']=_[_0x78d3('0x2e')](_0x23743f[_0x78d3('0x2f')],_0x23743f[_0x78d3('0x2c')]);_0x3f818b[_0x78d3('0x30')]=_[_0x78d3('0x2e')](_0x23743f[_0x78d3('0x2f')],qs['fields'](_0x5b31ee[_0x78d3('0x2c')]['fields']));_0x3f818b[_0x78d3('0x30')]=_0x3f818b['attributes'][_0x78d3('0x31')]?_0x3f818b[_0x78d3('0x30')]:_0x23743f['model'];if(!_0x5b31ee[_0x78d3('0x2c')]['hasOwnProperty'](_0x78d3('0x32'))){_0x3f818b['limit']=qs['limit'](_0x5b31ee['query'][_0x78d3('0x33')]);_0x3f818b['offset']=qs[_0x78d3('0x34')](_0x5b31ee[_0x78d3('0x2c')]['offset']);}_0x3f818b[_0x78d3('0x35')]=qs['sort'](_0x5b31ee['query'][_0x78d3('0x36')]);_0x3f818b['where']=qs['filters'](_[_0x78d3('0x37')](_0x5b31ee[_0x78d3('0x2c')],_0x23743f[_0x78d3('0x38')]));if(_0x5b31ee['query'][_0x78d3('0x39')]){_0x3f818b[_0x78d3('0x3a')]=_[_0x78d3('0x3b')](_0x3f818b['where'],{'$or':_[_0x78d3('0x28')](_0x5580fc,function(_0x5772a7){if(_0x5772a7['type']!==_0x78d3('0x3c')){var _0x510c33={};_0x510c33[_0x5772a7[_0x78d3('0x25')]]={'$like':'%'+_0x5b31ee['query'][_0x78d3('0x39')]+'%'};return _0x510c33;}})});}_0x3f818b=_['merge']({},_0x3f818b,_0x5b31ee[_0x78d3('0x3d')]);var _0x1dd839={'where':_0x3f818b['where']};return db[_0x78d3('0x29')][_0x78d3('0x1a')](_0x1dd839)[_0x78d3('0x21')](function(_0x518474){_0x41b6f9[_0x78d3('0x1a')]=_0x518474;if(_0x5b31ee['query']['includeAll']){_0x3f818b[_0x78d3('0x3e')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x3f818b);})[_0x78d3('0x21')](function(_0x5eff26){_0x41b6f9[_0x78d3('0x3f')]=_0x5eff26;return _0x41b6f9;})['then'](respondWithFilteredResult(_0x3d29f3,_0x3f818b))[_0x78d3('0x40')](handleError(_0x3d29f3,null));};exports[_0x78d3('0x41')]=function(_0x241e3a,_0x12bc01){var _0xcf7ce8={'raw':![],'where':{'id':_0x241e3a[_0x78d3('0x42')]['id']}},_0x5aeced={};_0x5aeced[_0x78d3('0x2f')]=_['keys'](db[_0x78d3('0x29')][_0x78d3('0x43')]);_0x5aeced['query']=_[_0x78d3('0x2d')](_0x241e3a[_0x78d3('0x2c')]);_0x5aeced[_0x78d3('0x38')]=_['intersection'](_0x5aeced[_0x78d3('0x2f')],_0x5aeced[_0x78d3('0x2c')]);_0xcf7ce8[_0x78d3('0x30')]=_[_0x78d3('0x2e')](_0x5aeced[_0x78d3('0x2f')],qs[_0x78d3('0x44')](_0x241e3a['query'][_0x78d3('0x44')]));_0xcf7ce8['attributes']=_0xcf7ce8[_0x78d3('0x30')][_0x78d3('0x31')]?_0xcf7ce8[_0x78d3('0x30')]:_0x5aeced[_0x78d3('0x2f')];if(_0x241e3a[_0x78d3('0x2c')][_0x78d3('0x45')]){_0xcf7ce8[_0x78d3('0x3e')]=[{'all':!![]}];}_0xcf7ce8=_['merge']({},_0xcf7ce8,_0x241e3a[_0x78d3('0x3d')]);return db['VoiceChanSpy']['find'](_0xcf7ce8)[_0x78d3('0x21')](handleEntityNotFound(_0x12bc01,null))[_0x78d3('0x21')](respondWithResult(_0x12bc01,null))[_0x78d3('0x40')](handleError(_0x12bc01,null));};exports[_0x78d3('0x46')]=function(_0x5370c3,_0x3f3bd7){return db['VoiceChanSpy'][_0x78d3('0x46')](_0x5370c3[_0x78d3('0x47')],{})['then'](function(_0x368a65){var _0x198b47=_0x5370c3['user'][_0x78d3('0x22')]({'plain':!![]});if(!_0x198b47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x198b47[_0x78d3('0x48')]===_0x78d3('0x49')){var _0x1ca6fd=_0x368a65[_0x78d3('0x22')]({'plain':!![]});var _0x5b1301='ChanSpies';return db[_0x78d3('0x4a')][_0x78d3('0x4b')]({'where':{'name':_0x5b1301,'userProfileId':_0x198b47[_0x78d3('0x4c')]},'raw':!![]})[_0x78d3('0x21')](function(_0x131853){if(_0x131853&&_0x131853['autoAssociation']===0x0){return db[_0x78d3('0x4d')][_0x78d3('0x46')]({'name':_0x1ca6fd[_0x78d3('0x25')],'resourceId':_0x1ca6fd['id'],'type':_0x131853[_0x78d3('0x25')],'sectionId':_0x131853['id']},{})[_0x78d3('0x21')](function(){return _0x368a65;});}else{return _0x368a65;}})['catch'](function(_0x1168e6){logger[_0x78d3('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1168e6);throw _0x1168e6;});}return _0x368a65;})['then'](respondWithResult(_0x3f3bd7,0xc9))[_0x78d3('0x40')](handleError(_0x3f3bd7,null));};exports[_0x78d3('0x1f')]=function(_0x2ad2aa,_0x4f8338){if(_0x2ad2aa['body']['id']){delete _0x2ad2aa['body']['id'];}return db[_0x78d3('0x29')][_0x78d3('0x4b')]({'where':{'id':_0x2ad2aa[_0x78d3('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f8338,null))[_0x78d3('0x21')](saveUpdates(_0x2ad2aa[_0x78d3('0x47')],null))[_0x78d3('0x21')](respondWithResult(_0x4f8338,null))[_0x78d3('0x40')](handleError(_0x4f8338,null));};exports[_0x78d3('0x20')]=function(_0x58faf4,_0x3e143d){return db[_0x78d3('0x29')][_0x78d3('0x4b')]({'where':{'id':_0x58faf4[_0x78d3('0x42')]['id']}})[_0x78d3('0x21')](handleEntityNotFound(_0x3e143d,null))[_0x78d3('0x21')](removeEntity(_0x3e143d,null))[_0x78d3('0x40')](handleError(_0x3e143d,null));}; \ No newline at end of file +var _0xaf1a=['options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','ChanSpies','UserProfileResource','error','name','send','index','VoiceChanSpy','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','map','include','findAll','catch','params','rawAttributes'];(function(_0x309fa9,_0x3b8e6b){var _0x590713=function(_0x3bc2dd){while(--_0x3bc2dd){_0x309fa9['push'](_0x309fa9['shift']());}};_0x590713(++_0x3b8e6b);}(_0xaf1a,0xfb));var _0xaaf1=function(_0x37180b,_0xbfdc47){_0x37180b=_0x37180b-0x0;var _0x594868=_0xaf1a[_0x37180b];return _0x594868;};'use strict';var pdf=require(_0xaaf1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaaf1('0x1'));var zipdir=require(_0xaaf1('0x2'));var jsonpatch=require(_0xaaf1('0x3'));var rp=require(_0xaaf1('0x4'));var moment=require('moment');var BPromise=require(_0xaaf1('0x5'));var Mustache=require(_0xaaf1('0x6'));var util=require(_0xaaf1('0x7'));var path=require(_0xaaf1('0x8'));var sox=require(_0xaaf1('0x9'));var csv=require('to-csv');var ejs=require(_0xaaf1('0xa'));var fs=require('fs');var _=require(_0xaaf1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xaaf1('0xc'));var deskjs=require(_0xaaf1('0xd'));var toCsv=require(_0xaaf1('0xe'));var querystring=require(_0xaaf1('0xf'));var Papa=require('papaparse');var Redis=require(_0xaaf1('0x10'));var authService=require(_0xaaf1('0x11'));var qs=require(_0xaaf1('0x12'));var as=require(_0xaaf1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaaf1('0x14'))(_0xaaf1('0x15'));var utils=require(_0xaaf1('0x16'));var config=require(_0xaaf1('0x17'));var db=require(_0xaaf1('0x18'))['db'];function respondWithStatusCode(_0x37d004,_0x4d05d7){_0x4d05d7=_0x4d05d7||0xcc;return function(_0x45c1c1){if(_0x45c1c1){return _0x37d004[_0xaaf1('0x19')](_0x4d05d7);}return _0x37d004[_0xaaf1('0x1a')](_0x4d05d7)[_0xaaf1('0x1b')]();};}function respondWithResult(_0x1eccdd,_0x1bbb0f){_0x1bbb0f=_0x1bbb0f||0xc8;return function(_0x2728ac){if(_0x2728ac){return _0x1eccdd['status'](_0x1bbb0f)['json'](_0x2728ac);}};}function respondWithFilteredResult(_0x30c67f,_0x54cb8e){return function(_0x4c9434){if(_0x4c9434){var _0x420621=_0x4c9434[_0xaaf1('0x1c')],_0x39d1a9=_0x54cb8e[_0xaaf1('0x1d')],_0x30fba4=_0x54cb8e[_0xaaf1('0x1d')]+_0x54cb8e[_0xaaf1('0x1e')],_0x54df92;if(_0x30fba4>=_0x420621){_0x30fba4=_0x420621;_0x54df92=0xc8;}else{_0x54df92=0xce;}_0x30c67f[_0xaaf1('0x1a')](_0x54df92);return _0x30c67f[_0xaaf1('0x1f')](_0xaaf1('0x20'),_0x39d1a9+'-'+_0x30fba4+'/'+_0x420621)['json'](_0x4c9434);}return null;};}function patchUpdates(_0x2defd4){return function(_0x85bbc3){try{jsonpatch['apply'](_0x85bbc3,_0x2defd4,!![]);}catch(_0x55a517){return BPromise[_0xaaf1('0x21')](_0x55a517);}return _0x85bbc3[_0xaaf1('0x22')]();};}function saveUpdates(_0x72351d,_0x413555){return function(_0x5317bb){if(_0x5317bb){return _0x5317bb[_0xaaf1('0x23')](_0x72351d)[_0xaaf1('0x24')](function(_0x4d36e9){return _0x4d36e9;});}return null;};}function removeEntity(_0x442dde,_0x1e65e8){return function(_0x478248){if(_0x478248){return _0x478248[_0xaaf1('0x25')]()[_0xaaf1('0x24')](function(){var _0x38255e=_0x478248['get']({'plain':!![]});var _0x34443d=_0xaaf1('0x26');return db[_0xaaf1('0x27')][_0xaaf1('0x25')]({'where':{'type':_0x34443d,'resourceId':_0x38255e['id']}})[_0xaaf1('0x24')](function(){return _0x478248;});})[_0xaaf1('0x24')](function(){_0x442dde[_0xaaf1('0x1a')](0xcc)[_0xaaf1('0x1b')]();});}};}function handleEntityNotFound(_0x41ae6f,_0x984ba8){return function(_0x493101){if(!_0x493101){_0x41ae6f[_0xaaf1('0x19')](0x194);}return _0x493101;};}function handleError(_0x5f869e,_0x297544){_0x297544=_0x297544||0x1f4;return function(_0x173322){logger[_0xaaf1('0x28')](_0x173322['stack']);if(_0x173322[_0xaaf1('0x29')]){delete _0x173322[_0xaaf1('0x29')];}_0x5f869e[_0xaaf1('0x1a')](_0x297544)[_0xaaf1('0x2a')](_0x173322);};}exports[_0xaaf1('0x2b')]=function(_0x48cc5c,_0x3d9dad){var _0x51b6bc={},_0x283e18={},_0x4e7935={'count':0x0,'rows':[]};var _0x3a9398=_['map'](db[_0xaaf1('0x2c')]['rawAttributes'],function(_0xb649ec){return{'name':_0xb649ec['fieldName'],'type':_0xb649ec[_0xaaf1('0x2d')][_0xaaf1('0x2e')]};});_0x283e18[_0xaaf1('0x2f')]=_['map'](_0x3a9398,'name');_0x283e18[_0xaaf1('0x30')]=_[_0xaaf1('0x31')](_0x48cc5c[_0xaaf1('0x30')]);_0x283e18[_0xaaf1('0x32')]=_[_0xaaf1('0x33')](_0x283e18[_0xaaf1('0x2f')],_0x283e18['query']);_0x51b6bc[_0xaaf1('0x34')]=_[_0xaaf1('0x33')](_0x283e18[_0xaaf1('0x2f')],qs[_0xaaf1('0x35')](_0x48cc5c[_0xaaf1('0x30')][_0xaaf1('0x35')]));_0x51b6bc[_0xaaf1('0x34')]=_0x51b6bc[_0xaaf1('0x34')][_0xaaf1('0x36')]?_0x51b6bc[_0xaaf1('0x34')]:_0x283e18[_0xaaf1('0x2f')];if(!_0x48cc5c[_0xaaf1('0x30')][_0xaaf1('0x37')](_0xaaf1('0x38'))){_0x51b6bc['limit']=qs[_0xaaf1('0x1e')](_0x48cc5c[_0xaaf1('0x30')][_0xaaf1('0x1e')]);_0x51b6bc['offset']=qs[_0xaaf1('0x1d')](_0x48cc5c[_0xaaf1('0x30')]['offset']);}_0x51b6bc[_0xaaf1('0x39')]=qs[_0xaaf1('0x3a')](_0x48cc5c[_0xaaf1('0x30')]['sort']);_0x51b6bc['where']=qs[_0xaaf1('0x32')](_[_0xaaf1('0x3b')](_0x48cc5c[_0xaaf1('0x30')],_0x283e18['filters']));if(_0x48cc5c['query'][_0xaaf1('0x3c')]){_0x51b6bc['where']=_[_0xaaf1('0x3d')](_0x51b6bc[_0xaaf1('0x3e')],{'$or':_[_0xaaf1('0x3f')](_0x3a9398,function(_0xd0ba69){if(_0xd0ba69[_0xaaf1('0x2d')]!=='VIRTUAL'){var _0x1e909d={};_0x1e909d[_0xd0ba69[_0xaaf1('0x29')]]={'$like':'%'+_0x48cc5c[_0xaaf1('0x30')][_0xaaf1('0x3c')]+'%'};return _0x1e909d;}})});}_0x51b6bc=_['merge']({},_0x51b6bc,_0x48cc5c['options']);var _0x121981={'where':_0x51b6bc[_0xaaf1('0x3e')]};return db[_0xaaf1('0x2c')][_0xaaf1('0x1c')](_0x121981)[_0xaaf1('0x24')](function(_0x12f839){_0x4e7935[_0xaaf1('0x1c')]=_0x12f839;if(_0x48cc5c[_0xaaf1('0x30')]['includeAll']){_0x51b6bc[_0xaaf1('0x40')]=[{'all':!![]}];}return db[_0xaaf1('0x2c')][_0xaaf1('0x41')](_0x51b6bc);})[_0xaaf1('0x24')](function(_0x37a805){_0x4e7935['rows']=_0x37a805;return _0x4e7935;})['then'](respondWithFilteredResult(_0x3d9dad,_0x51b6bc))[_0xaaf1('0x42')](handleError(_0x3d9dad,null));};exports['show']=function(_0x3d08a7,_0x3d3357){var _0x28c0f6={'raw':![],'where':{'id':_0x3d08a7[_0xaaf1('0x43')]['id']}},_0x351317={};_0x351317[_0xaaf1('0x2f')]=_['keys'](db['VoiceChanSpy'][_0xaaf1('0x44')]);_0x351317[_0xaaf1('0x30')]=_[_0xaaf1('0x31')](_0x3d08a7['query']);_0x351317['filters']=_[_0xaaf1('0x33')](_0x351317[_0xaaf1('0x2f')],_0x351317['query']);_0x28c0f6[_0xaaf1('0x34')]=_[_0xaaf1('0x33')](_0x351317[_0xaaf1('0x2f')],qs[_0xaaf1('0x35')](_0x3d08a7[_0xaaf1('0x30')][_0xaaf1('0x35')]));_0x28c0f6[_0xaaf1('0x34')]=_0x28c0f6[_0xaaf1('0x34')][_0xaaf1('0x36')]?_0x28c0f6[_0xaaf1('0x34')]:_0x351317[_0xaaf1('0x2f')];if(_0x3d08a7['query']['includeAll']){_0x28c0f6['include']=[{'all':!![]}];}_0x28c0f6=_[_0xaaf1('0x3d')]({},_0x28c0f6,_0x3d08a7[_0xaaf1('0x45')]);return db[_0xaaf1('0x2c')][_0xaaf1('0x46')](_0x28c0f6)['then'](handleEntityNotFound(_0x3d3357,null))['then'](respondWithResult(_0x3d3357,null))[_0xaaf1('0x42')](handleError(_0x3d3357,null));};exports[_0xaaf1('0x47')]=function(_0x2df08d,_0x3da914){return db[_0xaaf1('0x2c')]['create'](_0x2df08d[_0xaaf1('0x48')],{})['then'](function(_0x41d9c4){var _0x407825=_0x2df08d[_0xaaf1('0x49')][_0xaaf1('0x4a')]({'plain':!![]});if(!_0x407825)throw new Error(_0xaaf1('0x4b'));if(_0x407825[_0xaaf1('0x4c')]===_0xaaf1('0x49')){var _0x582f14=_0x41d9c4[_0xaaf1('0x4a')]({'plain':!![]});var _0x15de89='ChanSpies';return db[_0xaaf1('0x4d')][_0xaaf1('0x46')]({'where':{'name':_0x15de89,'userProfileId':_0x407825[_0xaaf1('0x4e')]},'raw':!![]})[_0xaaf1('0x24')](function(_0x176624){if(_0x176624&&_0x176624[_0xaaf1('0x4f')]===0x0){return db[_0xaaf1('0x27')]['create']({'name':_0x582f14[_0xaaf1('0x29')],'resourceId':_0x582f14['id'],'type':_0x176624[_0xaaf1('0x29')],'sectionId':_0x176624['id']},{})[_0xaaf1('0x24')](function(){return _0x41d9c4;});}else{return _0x41d9c4;}})['catch'](function(_0xfc2e9c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfc2e9c);throw _0xfc2e9c;});}return _0x41d9c4;})[_0xaaf1('0x24')](respondWithResult(_0x3da914,0xc9))[_0xaaf1('0x42')](handleError(_0x3da914,null));};exports[_0xaaf1('0x23')]=function(_0x35174b,_0x5dd6be){if(_0x35174b['body']['id']){delete _0x35174b[_0xaaf1('0x48')]['id'];}return db[_0xaaf1('0x2c')]['find']({'where':{'id':_0x35174b[_0xaaf1('0x43')]['id']}})[_0xaaf1('0x24')](handleEntityNotFound(_0x5dd6be,null))[_0xaaf1('0x24')](saveUpdates(_0x35174b[_0xaaf1('0x48')],null))[_0xaaf1('0x24')](respondWithResult(_0x5dd6be,null))[_0xaaf1('0x42')](handleError(_0x5dd6be,null));};exports[_0xaaf1('0x25')]=function(_0x31f542,_0x2fa82d){return db[_0xaaf1('0x2c')]['find']({'where':{'id':_0x31f542[_0xaaf1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2fa82d,null))['then'](removeEntity(_0x2fa82d,null))['catch'](handleError(_0x2fa82d,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index b66e6e9..6eda5e6 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 _0x3adc=['format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','from-sip'];(function(_0x468015,_0x15d387){var _0x3f92ad=function(_0x3b0a6f){while(--_0x3b0a6f){_0x468015['push'](_0x468015['shift']());}};_0x3f92ad(++_0x15d387);}(_0x3adc,0x1ba));var _0xc3ad=function(_0x5012d5,_0xfa431){_0x5012d5=_0x5012d5-0x0;var _0x3c9dad=_0x3adc[_0x5012d5];return _0x3c9dad;};'use strict';var _=require(_0xc3ad('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3fd78b,_0x5ac351,_0x79cf1f){var _0x2485f6=0x1;var _0x4674b8=[];var _0x59c61a={'context':_0x5ac351['context']||_0xc3ad('0x1'),'exten':util[_0xc3ad('0x2')](_0xc3ad('0x3'),_0x3fd78b[_0xc3ad('0x4')],_0x79cf1f),'type':_0xc3ad('0x5'),'isApp':![],'ChanSpyId':_0x3fd78b['id'],'UserId':_0x5ac351['id']};_0x4674b8[_0xc3ad('0x6')](_[_0xc3ad('0x7')]({'app':'Set','appdata':util['format'](_0xc3ad('0x8'),_0xc3ad('0x9')),'priority':_0x2485f6++},_0x59c61a));if(_0x3fd78b[_0xc3ad('0xa')]){_0x4674b8['push'](_[_0xc3ad('0x7')]({'app':_0xc3ad('0xb'),'appdata':util[_0xc3ad('0x2')](_0xc3ad('0xc'),_0x3fd78b[_0xc3ad('0xd')]),'priority':_0x2485f6++},_0x59c61a));}if(_0x3fd78b[_0xc3ad('0xe')]){_0x4674b8['push'](_[_0xc3ad('0x7')]({'app':_0xc3ad('0xf'),'appdata':_0x3fd78b[_0xc3ad('0x10')],'priority':_0x2485f6++},_0x59c61a));}_0x4674b8[_0xc3ad('0x6')](_[_0xc3ad('0x7')]({'app':_0xc3ad('0x11'),'appdata':util[_0xc3ad('0x2')](_0xc3ad('0x12'),_0x5ac351[_0xc3ad('0x13')],_0x3fd78b[_0xc3ad('0x14')]?_0x3fd78b[_0xc3ad('0x14')][_0xc3ad('0x15')](''):''),'priority':_0x2485f6++},_0x59c61a));if(_0x3fd78b[_0xc3ad('0xa')]){_0x4674b8[_0xc3ad('0x6')](_[_0xc3ad('0x7')]({'app':_0xc3ad('0x16'),'priority':_0x2485f6++},_0x59c61a));}return _0x4674b8;};var getChanSpyApplications=function(_0x22140a,_0x439222){var _0x56f88f=[];for(var _0x3e71f2=0x0,_0x35a354=0x1;_0x3e71f2<_0x439222[_0xc3ad('0x17')];_0x3e71f2++,_0x35a354=0x1){_0x56f88f=_0x56f88f[_0xc3ad('0x18')](getUserApplications(_0x22140a,_0x439222[_0x3e71f2],_0x439222[_0x3e71f2][_0xc3ad('0x19')]));if(_0x439222[_0x3e71f2]['internal']!=_0x439222[_0x3e71f2][_0xc3ad('0x13')]){_0x56f88f=_0x56f88f['concat'](getUserApplications(_0x22140a,_0x439222[_0x3e71f2],_0x439222[_0x3e71f2][_0xc3ad('0x13')]));}}return _0x56f88f;};var getChanSpyPromise=function(_0x271253,_0x50b289){return new BPromise(function(_0x3a2794,_0x4b2545){return _0x271253[_0xc3ad('0x1a')][_0xc3ad('0x1b')]({'attributes':['id',_0xc3ad('0x13'),_0xc3ad('0x19')],'where':{'role':_0xc3ad('0x1c'),'chanspy':!![]},'raw':!![]})[_0xc3ad('0x1d')](function(_0x46e459){if(_0x46e459){return _0x3a2794(getChanSpyApplications(_0x50b289,_0x46e459));}return _0x3a2794([]);})[_0xc3ad('0x1e')](function(_0x589e6f){_0x4b2545(_0x589e6f);});});};module[_0xc3ad('0x1f')]=function(_0x538f71,_0x439c7b){var _0x5671aa=_0x538f71['models'];return _0x538f71['define'](_0xc3ad('0x20'),attributes,{'tableName':_0xc3ad('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2045b6,_0x9723f8,_0x8a3457){return getChanSpyPromise(_0x5671aa,_0x2045b6)[_0xc3ad('0x1d')](function(_0x4a72dc){if(_0x4a72dc&&_0x4a72dc['length']){return _0x5671aa[_0xc3ad('0x22')][_0xc3ad('0x23')](_0x4a72dc);}})[_0xc3ad('0x1d')](function(){_0x8a3457();})[_0xc3ad('0x1e')](function(_0x17ed2e){_0x8a3457(_0x17ed2e);});},'afterUpdate':function(_0x557b14,_0x1a1ec0,_0x1f2b3d){return _0x5671aa[_0xc3ad('0x22')]['destroy']({'where':{'ChanSpyId':_0x557b14['id']}})[_0xc3ad('0x1d')](function(){return getChanSpyPromise(_0x5671aa,_0x557b14);})[_0xc3ad('0x1d')](function(_0x3d4174){if(_0x3d4174&&_0x3d4174['length']){return _0x5671aa[_0xc3ad('0x22')]['bulkCreate'](_0x3d4174);}})[_0xc3ad('0x1d')](function(){_0x1f2b3d();})['catch'](function(_0x28acc5){_0x1f2b3d(_0x28acc5);});},'afterDestroy':function(_0x22c388,_0x30acfe,_0x4901d){return _0x5671aa[_0xc3ad('0x22')][_0xc3ad('0x24')]({'where':{'ChanSpyId':_0x22c388['id']}})[_0xc3ad('0x1d')](function(){_0x4901d();})[_0xc3ad('0x1e')](function(_0x2fe780){_0x4901d(_0x2fe780);});}}});}; \ No newline at end of file +var _0x3675=['then','length','bulkCreate','VoiceExtension','destroy','util','./voiceChanSpy.attributes','context','format','prefix','system','push','merge','Set','chanspy','record','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','ChanSpy','name','join','StopMixMonitor','concat','internal','User','agent','catch','define','voice_chanspy'];(function(_0x2178e6,_0x22f2c6){var _0x4556ca=function(_0x5eb49b){while(--_0x5eb49b){_0x2178e6['push'](_0x2178e6['shift']());}};_0x4556ca(++_0x22f2c6);}(_0x3675,0xfd));var _0x5367=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x3675[_0x99868f];return _0x27a71b;};'use strict';var _=require('lodash');var util=require(_0x5367('0x0'));var BPromise=require('bluebird');var attributes=require(_0x5367('0x1'));var getUserApplications=function(_0x191645,_0x139983,_0x2b220e){var _0x33f4bd=0x1;var _0x259f0f=[];var _0x326e10={'context':_0x139983[_0x5367('0x2')]||'from-sip','exten':util[_0x5367('0x3')]('%s%s',_0x191645[_0x5367('0x4')],_0x2b220e),'type':_0x5367('0x5'),'isApp':![],'ChanSpyId':_0x191645['id'],'UserId':_0x139983['id']};_0x259f0f[_0x5367('0x6')](_[_0x5367('0x7')]({'app':_0x5367('0x8'),'appdata':util['format']('CDR(type)=%s',_0x5367('0x9')),'priority':_0x33f4bd++},_0x326e10));if(_0x191645[_0x5367('0xa')]){_0x259f0f['push'](_['merge']({'app':'MixMonitor','appdata':util['format'](_0x5367('0xb'),_0x191645[_0x5367('0xc')]),'priority':_0x33f4bd++},_0x326e10));}if(_0x191645[_0x5367('0xd')]){_0x259f0f[_0x5367('0x6')](_[_0x5367('0x7')]({'app':_0x5367('0xe'),'appdata':_0x191645['password'],'priority':_0x33f4bd++},_0x326e10));}_0x259f0f[_0x5367('0x6')](_[_0x5367('0x7')]({'app':_0x5367('0xf'),'appdata':util[_0x5367('0x3')]('SIP/%s,%s',_0x139983[_0x5367('0x10')],_0x191645['options']?_0x191645['options'][_0x5367('0x11')](''):''),'priority':_0x33f4bd++},_0x326e10));if(_0x191645[_0x5367('0xa')]){_0x259f0f[_0x5367('0x6')](_[_0x5367('0x7')]({'app':_0x5367('0x12'),'priority':_0x33f4bd++},_0x326e10));}return _0x259f0f;};var getChanSpyApplications=function(_0x58c397,_0x443e0e){var _0x592373=[];for(var _0x155953=0x0,_0x5bea36=0x1;_0x155953<_0x443e0e['length'];_0x155953++,_0x5bea36=0x1){_0x592373=_0x592373[_0x5367('0x13')](getUserApplications(_0x58c397,_0x443e0e[_0x155953],_0x443e0e[_0x155953][_0x5367('0x14')]));if(_0x443e0e[_0x155953][_0x5367('0x14')]!=_0x443e0e[_0x155953]['name']){_0x592373=_0x592373['concat'](getUserApplications(_0x58c397,_0x443e0e[_0x155953],_0x443e0e[_0x155953]['name']));}}return _0x592373;};var getChanSpyPromise=function(_0xd5b5fa,_0x1c1e01){return new BPromise(function(_0x394fd4,_0x49c38){return _0xd5b5fa[_0x5367('0x15')]['findAll']({'attributes':['id','name','internal'],'where':{'role':_0x5367('0x16'),'chanspy':!![]},'raw':!![]})['then'](function(_0x3a245c){if(_0x3a245c){return _0x394fd4(getChanSpyApplications(_0x1c1e01,_0x3a245c));}return _0x394fd4([]);})[_0x5367('0x17')](function(_0x142dc0){_0x49c38(_0x142dc0);});});};module['exports']=function(_0x5be752,_0x5dc53c){var _0x3c6016=_0x5be752['models'];return _0x5be752[_0x5367('0x18')]('VoiceChanSpy',attributes,{'tableName':_0x5367('0x19'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x49138e,_0x10e70f,_0x3410cb){return getChanSpyPromise(_0x3c6016,_0x49138e)[_0x5367('0x1a')](function(_0x3eb10c){if(_0x3eb10c&&_0x3eb10c[_0x5367('0x1b')]){return _0x3c6016['VoiceExtension'][_0x5367('0x1c')](_0x3eb10c);}})[_0x5367('0x1a')](function(){_0x3410cb();})['catch'](function(_0x3fb78e){_0x3410cb(_0x3fb78e);});},'afterUpdate':function(_0x133a74,_0x1e19bd,_0x2c4379){return _0x3c6016[_0x5367('0x1d')][_0x5367('0x1e')]({'where':{'ChanSpyId':_0x133a74['id']}})[_0x5367('0x1a')](function(){return getChanSpyPromise(_0x3c6016,_0x133a74);})['then'](function(_0x497414){if(_0x497414&&_0x497414[_0x5367('0x1b')]){return _0x3c6016[_0x5367('0x1d')]['bulkCreate'](_0x497414);}})[_0x5367('0x1a')](function(){_0x2c4379();})['catch'](function(_0x51c62e){_0x2c4379(_0x51c62e);});},'afterDestroy':function(_0x4caf68,_0xd14112,_0xc32dd9){return _0x3c6016['VoiceExtension'][_0x5367('0x1e')]({'where':{'ChanSpyId':_0x4caf68['id']}})['then'](function(){_0xc32dd9();})['catch'](function(_0x1fb89f){_0xc32dd9(_0x1fb89f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 1dffeac..cc048df 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 _0xb6da=['message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3d19e2,_0x3abf7a){var _0x590ff9=function(_0x5d2891){while(--_0x5d2891){_0x3d19e2['push'](_0x3d19e2['shift']());}};_0x590ff9(++_0x3abf7a);}(_0xb6da,0xff));var _0xab6d=function(_0x3d2850,_0x4620ff){_0x3d2850=_0x3d2850-0x0;var _0x4daed8=_0xb6da[_0x3d2850];return _0x4daed8;};'use strict';var _=require(_0xab6d('0x0'));var util=require(_0xab6d('0x1'));var moment=require(_0xab6d('0x2'));var BPromise=require('bluebird');var rs=require(_0xab6d('0x3'));var fs=require('fs');var Redis=require(_0xab6d('0x4'));var db=require(_0xab6d('0x5'))['db'];var utils=require(_0xab6d('0x6'));var logger=require('../../config/logger')(_0xab6d('0x7'));var config=require(_0xab6d('0x8'));var jayson=require(_0xab6d('0x9'));var client=jayson[_0xab6d('0xa')][_0xab6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d8273,_0x3796a2,_0x3c3545){return new BPromise(function(_0x228409,_0x58bc28){return client['request'](_0x3d8273,_0x3c3545)[_0xab6d('0xc')](function(_0x3b52bc){logger['info'](_0xab6d('0xd'),_0x3796a2,'request\x20sent');logger[_0xab6d('0xe')](_0xab6d('0xf'),_0x3796a2,_0xab6d('0x10'),JSON['stringify'](_0x3b52bc));if(_0x3b52bc[_0xab6d('0x11')]){if(_0x3b52bc[_0xab6d('0x11')]['code']===0x1f4){logger[_0xab6d('0x11')](_0xab6d('0xd'),_0x3796a2,_0x3b52bc[_0xab6d('0x11')][_0xab6d('0x12')]);return _0x58bc28(_0x3b52bc['error'][_0xab6d('0x12')]);}logger[_0xab6d('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x3796a2,_0x3b52bc[_0xab6d('0x11')][_0xab6d('0x12')]);return _0x228409(_0x3b52bc[_0xab6d('0x11')][_0xab6d('0x12')]);}else{logger[_0xab6d('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x3796a2,_0xab6d('0x10'));_0x228409(_0x3b52bc['result']['message']);}})[_0xab6d('0x14')](function(_0x23c9df){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x3796a2,_0x23c9df);_0x58bc28(_0x23c9df);});});} \ No newline at end of file +var _0x64d7=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent'];(function(_0x3b0da6,_0x6f1523){var _0x42e0ac=function(_0x5416ff){while(--_0x5416ff){_0x3b0da6['push'](_0x3b0da6['shift']());}};_0x42e0ac(++_0x6f1523);}(_0x64d7,0x177));var _0x764d=function(_0x484bf4,_0x2b975c){_0x484bf4=_0x484bf4-0x0;var _0x31c683=_0x64d7[_0x484bf4];return _0x31c683;};'use strict';var _=require(_0x764d('0x0'));var util=require(_0x764d('0x1'));var moment=require(_0x764d('0x2'));var BPromise=require(_0x764d('0x3'));var rs=require(_0x764d('0x4'));var fs=require('fs');var Redis=require(_0x764d('0x5'));var db=require(_0x764d('0x6'))['db'];var utils=require(_0x764d('0x7'));var logger=require(_0x764d('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x764d('0x9'));var client=jayson[_0x764d('0xa')][_0x764d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b3b27,_0x37f92c,_0x135075){return new BPromise(function(_0x306f7c,_0x55c6c9){return client[_0x764d('0xc')](_0x4b3b27,_0x135075)['then'](function(_0x338fef){logger[_0x764d('0xd')](_0x764d('0xe'),_0x37f92c,_0x764d('0xf'));logger[_0x764d('0x10')](_0x764d('0x11'),_0x37f92c,_0x764d('0xf'),JSON[_0x764d('0x12')](_0x338fef));if(_0x338fef[_0x764d('0x13')]){if(_0x338fef[_0x764d('0x13')][_0x764d('0x14')]===0x1f4){logger[_0x764d('0x13')](_0x764d('0xe'),_0x37f92c,_0x338fef[_0x764d('0x13')]['message']);return _0x55c6c9(_0x338fef[_0x764d('0x13')][_0x764d('0x15')]);}logger['error'](_0x764d('0xe'),_0x37f92c,_0x338fef[_0x764d('0x13')][_0x764d('0x15')]);return _0x306f7c(_0x338fef[_0x764d('0x13')][_0x764d('0x15')]);}else{logger['info'](_0x764d('0xe'),_0x37f92c,_0x764d('0xf'));_0x306f7c(_0x338fef[_0x764d('0x16')][_0x764d('0x15')]);}})['catch'](function(_0x43d221){logger[_0x764d('0x13')](_0x764d('0xe'),_0x37f92c,_0x43d221);_0x55c6c9(_0x43d221);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index b2f3d8c..f9db29f 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 _0xa0f1=['../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x3c8297,_0x19e50d){var _0x47dbd7=function(_0x1c3d0a){while(--_0x1c3d0a){_0x3c8297['push'](_0x3c8297['shift']());}};_0x47dbd7(++_0x19e50d);}(_0xa0f1,0x93));var _0x1a0f=function(_0x273499,_0x4164df){_0x273499=_0x273499-0x0;var _0x30f7df=_0xa0f1[_0x273499];return _0x30f7df;};'use strict';var multer=require('multer');var util=require(_0x1a0f('0x0'));var path=require(_0x1a0f('0x1'));var timeout=require('connect-timeout');var express=require(_0x1a0f('0x2'));var router=express[_0x1a0f('0x3')]();var auth=require(_0x1a0f('0x4'));var interaction=require(_0x1a0f('0x5'));var config=require(_0x1a0f('0x6'));var controller=require(_0x1a0f('0x7'));router[_0x1a0f('0x8')]('/',auth['isAuthenticated'](),controller[_0x1a0f('0x9')]);router[_0x1a0f('0x8')]('/:id',auth[_0x1a0f('0xa')](),controller[_0x1a0f('0xb')]);router[_0x1a0f('0xc')]('/',auth[_0x1a0f('0xa')](),controller[_0x1a0f('0xd')]);router[_0x1a0f('0xe')](_0x1a0f('0xf'),auth[_0x1a0f('0xa')](),controller[_0x1a0f('0x10')]);router['delete'](_0x1a0f('0xf'),auth[_0x1a0f('0xa')](),controller[_0x1a0f('0x11')]);module[_0x1a0f('0x12')]=router; \ No newline at end of file +var _0x6674=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0xfe4c8c,_0x5c6a1b){var _0xde1ce0=function(_0x759f2f){while(--_0x759f2f){_0xfe4c8c['push'](_0xfe4c8c['shift']());}};_0xde1ce0(++_0x5c6a1b);}(_0x6674,0x137));var _0x4667=function(_0x4d8cc1,_0x238f98){_0x4d8cc1=_0x4d8cc1-0x0;var _0x9935a8=_0x6674[_0x4d8cc1];return _0x9935a8;};'use strict';var multer=require(_0x4667('0x0'));var util=require(_0x4667('0x1'));var path=require(_0x4667('0x2'));var timeout=require(_0x4667('0x3'));var express=require(_0x4667('0x4'));var router=express[_0x4667('0x5')]();var auth=require(_0x4667('0x6'));var interaction=require(_0x4667('0x7'));var config=require(_0x4667('0x8'));var controller=require(_0x4667('0x9'));router[_0x4667('0xa')]('/',auth['isAuthenticated'](),controller[_0x4667('0xb')]);router[_0x4667('0xa')](_0x4667('0xc'),auth[_0x4667('0xd')](),controller[_0x4667('0xe')]);router[_0x4667('0xf')]('/',auth[_0x4667('0xd')](),controller[_0x4667('0x10')]);router[_0x4667('0x11')]('/:id',auth[_0x4667('0xd')](),controller[_0x4667('0x12')]);router[_0x4667('0x13')](_0x4667('0xc'),auth['isAuthenticated'](),controller[_0x4667('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index ccd48b3..615196b 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 _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0xa22574,_0x42d649){var _0x2d2d5a=function(_0x10ab82){while(--_0x10ab82){_0xa22574['push'](_0xa22574['shift']());}};_0x2d2d5a(++_0x42d649);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x4e1cb2,_0x33926a){var _0x566125=function(_0x143852){while(--_0x143852){_0x4e1cb2['push'](_0x4e1cb2['shift']());}};_0x566125(++_0x33926a);}(_0x34e8,0x12c));var _0x834e=function(_0x38c121,_0x266c27){_0x38c121=_0x38c121-0x0;var _0xf0ab8b=_0x34e8[_0x38c121];return _0xf0ab8b;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 6f4cf3a..5adc40d 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 _0x1537=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceContext','includeAll','include','rows','show','params','filters','find','create','body','findAll','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user'];(function(_0x1d2604,_0x4b4045){var _0x1e81fd=function(_0x3ab7b8){while(--_0x3ab7b8){_0x1d2604['push'](_0x1d2604['shift']());}};_0x1e81fd(++_0x4b4045);}(_0x1537,0x147));var _0x7153=function(_0x213810,_0x31d454){_0x213810=_0x213810-0x0;var _0x5d8bc2=_0x1537[_0x213810];return _0x5d8bc2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7153('0x0'));var rimraf=require(_0x7153('0x1'));var zipdir=require(_0x7153('0x2'));var jsonpatch=require(_0x7153('0x3'));var rp=require(_0x7153('0x4'));var moment=require(_0x7153('0x5'));var BPromise=require(_0x7153('0x6'));var Mustache=require('mustache');var util=require(_0x7153('0x7'));var path=require('path');var sox=require(_0x7153('0x8'));var csv=require(_0x7153('0x9'));var ejs=require(_0x7153('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7153('0xb'));var crypto=require(_0x7153('0xc'));var jsforce=require(_0x7153('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7153('0x9'));var querystring=require(_0x7153('0xe'));var Papa=require(_0x7153('0xf'));var Redis=require('ioredis');var authService=require(_0x7153('0x10'));var qs=require(_0x7153('0x11'));var as=require(_0x7153('0x12'));var hardwareService=require(_0x7153('0x13'));var logger=require(_0x7153('0x14'))(_0x7153('0x15'));var utils=require(_0x7153('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x7153('0x17'));var client=jayson[_0x7153('0x18')][_0x7153('0x19')]({'port':0x232a});function checkPasswordPattern(_0x540a2a,_0x2b519b,_0x5536a1){if(_0x5536a1){var _0x4adb34=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4adb34[_0x7153('0x1a')](_0x2b519b)){return _0x540a2a;}else{throw new db[(_0x7153('0x1b'))][(_0x7153('0x1c'))](_0x7153('0x1d'));}}else{return _0x540a2a;}}function respondWithRpcPromise(_0x5a5094,_0x5b1298,_0x3b3df4,_0x5c7085){return new BPromise(function(_0x2a50d4,_0x525dac){var _0x5843ea=_0x5c7085||client;return _0x5843ea[_0x7153('0x1e')](_0x5a5094,_0x3b3df4)[_0x7153('0x1f')](function(_0x1979a4){logger['info'](_0x7153('0x20'),_0x5b1298,_0x7153('0x21'));logger[_0x7153('0x22')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5b1298,'request\x20sent',JSON[_0x7153('0x23')](_0x1979a4));if(_0x1979a4['error']){if(_0x1979a4[_0x7153('0x24')][_0x7153('0x25')]===0x1f4){logger['error'](_0x7153('0x20'),_0x5b1298,_0x1979a4[_0x7153('0x24')]['message']);return _0x525dac(_0x1979a4[_0x7153('0x24')][_0x7153('0x26')]);}logger[_0x7153('0x24')](_0x7153('0x20'),_0x5b1298,_0x1979a4['error'][_0x7153('0x26')]);return _0x2a50d4(_0x1979a4['error'][_0x7153('0x26')]);}else{logger['info'](_0x7153('0x20'),_0x5b1298,'request\x20sent');_0x2a50d4(_0x1979a4[_0x7153('0x27')]['message']);}})[_0x7153('0x28')](function(_0x34d970){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b1298,_0x34d970);_0x525dac(_0x34d970);});});}function respondWithStatusCode(_0x5a3525,_0x8b1883){_0x8b1883=_0x8b1883||0xcc;return function(_0x4c51f6){if(_0x4c51f6){return _0x5a3525['sendStatus'](_0x8b1883);}return _0x5a3525['status'](_0x8b1883)[_0x7153('0x29')]();};}function respondWithResult(_0x10f271,_0x33a249){_0x33a249=_0x33a249||0xc8;return function(_0xa4622b){if(_0xa4622b){return _0x10f271[_0x7153('0x2a')](_0x33a249)[_0x7153('0x2b')](_0xa4622b);}};}function respondWithFilteredResult(_0x1f0538,_0x9372a2){return function(_0x1207d5){if(_0x1207d5){var _0x363fda=_0x1207d5[_0x7153('0x2c')],_0x2610a8=_0x9372a2[_0x7153('0x2d')],_0x2b6c0a=_0x9372a2[_0x7153('0x2d')]+_0x9372a2[_0x7153('0x2e')],_0x20bbfb;if(_0x2b6c0a>=_0x363fda){_0x2b6c0a=_0x363fda;_0x20bbfb=0xc8;}else{_0x20bbfb=0xce;}_0x1f0538[_0x7153('0x2a')](_0x20bbfb);return _0x1f0538[_0x7153('0x2f')](_0x7153('0x30'),_0x2610a8+'-'+_0x2b6c0a+'/'+_0x363fda)[_0x7153('0x2b')](_0x1207d5);}return null;};}function patchUpdates(_0x3acfc6){return function(_0x4d29de){try{jsonpatch['apply'](_0x4d29de,_0x3acfc6,!![]);}catch(_0x3b5627){return BPromise['reject'](_0x3b5627);}return _0x4d29de[_0x7153('0x31')]();};}function saveUpdates(_0x2c14d9,_0x8d278d){return function(_0x54b8c1){if(_0x54b8c1){return _0x54b8c1[_0x7153('0x32')](_0x2c14d9)[_0x7153('0x1f')](function(_0x3c715a){return _0x3c715a;});}return null;};}function removeEntity(_0x10796d,_0x3be5a8){return function(_0x215bed){if(_0x215bed){return _0x215bed[_0x7153('0x33')]()[_0x7153('0x1f')](function(){var _0x460404=_0x215bed[_0x7153('0x34')]({'plain':!![]});var _0xa9824d=_0x7153('0x35');return db[_0x7153('0x36')]['destroy']({'where':{'type':_0xa9824d,'resourceId':_0x460404['id']}})['then'](function(){return _0x215bed;});})[_0x7153('0x1f')](function(){_0x10796d[_0x7153('0x2a')](0xcc)[_0x7153('0x29')]();});}};}function handleEntityNotFound(_0x273bdf,_0x5ccd6d){return function(_0x3988c0){if(!_0x3988c0){_0x273bdf[_0x7153('0x37')](0x194);}return _0x3988c0;};}function handleError(_0x5a2489,_0x129dbc){_0x129dbc=_0x129dbc||0x1f4;return function(_0x5b51f6){logger['error'](_0x5b51f6[_0x7153('0x38')]);if(_0x5b51f6['name']){delete _0x5b51f6['name'];}_0x5a2489[_0x7153('0x2a')](_0x129dbc)[_0x7153('0x39')](_0x5b51f6);};}exports[_0x7153('0x3a')]=function(_0x5a5cd9,_0x15c56b){var _0x44bb61={},_0x1826d9={},_0x371265={'count':0x0,'rows':[]};var _0x521658=_[_0x7153('0x3b')](db['VoiceContext'][_0x7153('0x3c')],function(_0x1294f5){return{'name':_0x1294f5[_0x7153('0x3d')],'type':_0x1294f5[_0x7153('0x3e')][_0x7153('0x3f')]};});_0x1826d9[_0x7153('0x40')]=_[_0x7153('0x3b')](_0x521658,_0x7153('0x41'));_0x1826d9[_0x7153('0x42')]=_[_0x7153('0x43')](_0x5a5cd9[_0x7153('0x42')]);_0x1826d9['filters']=_['intersection'](_0x1826d9[_0x7153('0x40')],_0x1826d9[_0x7153('0x42')]);_0x44bb61[_0x7153('0x44')]=_[_0x7153('0x45')](_0x1826d9[_0x7153('0x40')],qs[_0x7153('0x46')](_0x5a5cd9['query']['fields']));_0x44bb61[_0x7153('0x44')]=_0x44bb61[_0x7153('0x44')][_0x7153('0x47')]?_0x44bb61['attributes']:_0x1826d9['model'];if(!_0x5a5cd9[_0x7153('0x42')]['hasOwnProperty'](_0x7153('0x48'))){_0x44bb61[_0x7153('0x2e')]=qs[_0x7153('0x2e')](_0x5a5cd9[_0x7153('0x42')][_0x7153('0x2e')]);_0x44bb61[_0x7153('0x2d')]=qs[_0x7153('0x2d')](_0x5a5cd9[_0x7153('0x42')][_0x7153('0x2d')]);}_0x44bb61[_0x7153('0x49')]=qs[_0x7153('0x4a')](_0x5a5cd9['query'][_0x7153('0x4a')]);_0x44bb61['where']=qs['filters'](_[_0x7153('0x4b')](_0x5a5cd9['query'],_0x1826d9['filters']));if(_0x5a5cd9[_0x7153('0x42')][_0x7153('0x4c')]){_0x44bb61[_0x7153('0x4d')]=_['merge'](_0x44bb61[_0x7153('0x4d')],{'$or':_[_0x7153('0x3b')](_0x521658,function(_0x496877){if(_0x496877[_0x7153('0x3e')]!==_0x7153('0x4e')){var _0x56296e={};_0x56296e[_0x496877[_0x7153('0x41')]]={'$like':'%'+_0x5a5cd9['query'][_0x7153('0x4c')]+'%'};return _0x56296e;}})});}_0x44bb61=_[_0x7153('0x4f')]({},_0x44bb61,_0x5a5cd9[_0x7153('0x50')]);var _0x4e061e={'where':_0x44bb61[_0x7153('0x4d')]};return db[_0x7153('0x51')][_0x7153('0x2c')](_0x4e061e)[_0x7153('0x1f')](function(_0x9a72a5){_0x371265['count']=_0x9a72a5;if(_0x5a5cd9['query'][_0x7153('0x52')]){_0x44bb61[_0x7153('0x53')]=[{'all':!![]}];}return db[_0x7153('0x51')]['findAll'](_0x44bb61);})[_0x7153('0x1f')](function(_0x243aea){_0x371265[_0x7153('0x54')]=_0x243aea;return _0x371265;})[_0x7153('0x1f')](respondWithFilteredResult(_0x15c56b,_0x44bb61))['catch'](handleError(_0x15c56b,null));};exports[_0x7153('0x55')]=function(_0x12dd06,_0x5a190c){var _0x46b9ce={'raw':![],'where':{'id':_0x12dd06[_0x7153('0x56')]['id']}},_0x2960c1={};_0x2960c1[_0x7153('0x40')]=_[_0x7153('0x43')](db[_0x7153('0x51')][_0x7153('0x3c')]);_0x2960c1['query']=_[_0x7153('0x43')](_0x12dd06[_0x7153('0x42')]);_0x2960c1[_0x7153('0x57')]=_[_0x7153('0x45')](_0x2960c1[_0x7153('0x40')],_0x2960c1['query']);_0x46b9ce[_0x7153('0x44')]=_[_0x7153('0x45')](_0x2960c1[_0x7153('0x40')],qs[_0x7153('0x46')](_0x12dd06[_0x7153('0x42')]['fields']));_0x46b9ce[_0x7153('0x44')]=_0x46b9ce[_0x7153('0x44')][_0x7153('0x47')]?_0x46b9ce[_0x7153('0x44')]:_0x2960c1[_0x7153('0x40')];if(_0x12dd06[_0x7153('0x42')][_0x7153('0x52')]){_0x46b9ce[_0x7153('0x53')]=[{'all':!![]}];}_0x46b9ce=_[_0x7153('0x4f')]({},_0x46b9ce,_0x12dd06[_0x7153('0x50')]);return db[_0x7153('0x51')][_0x7153('0x58')](_0x46b9ce)['then'](handleEntityNotFound(_0x5a190c,null))[_0x7153('0x1f')](respondWithResult(_0x5a190c,null))[_0x7153('0x28')](handleError(_0x5a190c,null));};exports[_0x7153('0x59')]=function(_0x1bf032,_0x480ded,_0x5e4246){var _0x422f31;return db[_0x7153('0x51')]['create'](_0x1bf032[_0x7153('0x5a')],{'raw':!![]})[_0x7153('0x1f')](function(_0x31106f){_0x422f31=_0x31106f;return db['VoiceContext'][_0x7153('0x5b')]({'raw':!![]});})[_0x7153('0x1f')](function(_0x4e93ed){var _0x27cce0=fs[_0x7153('0x5c')](path['join'](config['root'],_0x7153('0x5d')),_0x7153('0x5e'));var _0x12d09c=ejs[_0x7153('0x5f')](_0x27cce0,{'contexts':_0x4e93ed||[]});fs[_0x7153('0x60')](_0x7153('0x61'),_0x12d09c);})[_0x7153('0x1f')](function(){return respondWithRpcPromise(_0x7153('0x62'),_0x7153('0x59'),{'module':_0x7153('0x63')});})[_0x7153('0x1f')](function(){var _0x5e5d56=_0x1bf032[_0x7153('0x64')]['get']({'plain':!![]});if(!_0x5e5d56)throw new Error(_0x7153('0x65'));if(_0x5e5d56[_0x7153('0x66')]===_0x7153('0x64')){var _0x1a243c=_0x422f31['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x7153('0x35'),'userProfileId':_0x5e5d56['userProfileId']},'raw':!![]})[_0x7153('0x1f')](function(_0x34a85b){if(_0x34a85b&&_0x34a85b[_0x7153('0x67')]===0x0){return db[_0x7153('0x36')]['create']({'name':_0x1a243c[_0x7153('0x41')],'resourceId':_0x1a243c['id'],'type':_0x34a85b['name'],'sectionId':_0x34a85b['id']},{})[_0x7153('0x1f')](function(){return _0x422f31;});}else{return _0x422f31;}})[_0x7153('0x28')](function(_0x490ead){logger['error'](_0x7153('0x68'),_0x490ead);throw _0x490ead;});}return _0x422f31;})[_0x7153('0x1f')](respondWithResult(_0x480ded,0xc9))[_0x7153('0x28')](handleError(_0x480ded,null));};exports[_0x7153('0x32')]=function(_0x585f9b,_0x109c42,_0x287843){var _0xa6edac;return db['VoiceContext'][_0x7153('0x58')]({'where':{'id':_0x585f9b['params']['id']}})[_0x7153('0x1f')](handleEntityNotFound(_0x109c42,null))[_0x7153('0x1f')](saveUpdates(_0x585f9b[_0x7153('0x5a')],null))[_0x7153('0x1f')](function(_0x40ec43){if(_0x40ec43){_0xa6edac=_0x40ec43;return db[_0x7153('0x51')][_0x7153('0x5b')]({'raw':!![]});}})['then'](function(_0x100515){var _0x42302b=fs[_0x7153('0x5c')](path[_0x7153('0x69')](config['root'],_0x7153('0x5d')),_0x7153('0x5e'));var _0x213634=ejs['render'](_0x42302b,{'contexts':_0x100515||[]});fs['writeFileSync'](_0x7153('0x61'),_0x213634);})['then'](function(){return respondWithRpcPromise(_0x7153('0x62'),'update',{'module':_0x7153('0x63')});})['then'](function(){return _0xa6edac;})[_0x7153('0x1f')](respondWithResult(_0x109c42,null))['catch'](handleError(_0x109c42,null));};exports[_0x7153('0x33')]=function(_0x1d80cd,_0x127946,_0x4bb0b1){var _0x5155ab;return db[_0x7153('0x51')][_0x7153('0x58')]({'where':{'id':_0x1d80cd[_0x7153('0x56')]['id']}})[_0x7153('0x1f')](handleEntityNotFound(_0x127946,null))[_0x7153('0x1f')](removeEntity(_0x127946,null))[_0x7153('0x1f')](function(){return db[_0x7153('0x51')][_0x7153('0x5b')]({'raw':!![]});})[_0x7153('0x1f')](function(_0xdb2bd8){var _0x4d427e=fs[_0x7153('0x5c')](path[_0x7153('0x69')](config[_0x7153('0x6a')],_0x7153('0x5d')),_0x7153('0x5e'));var _0x3a871d=ejs[_0x7153('0x5f')](_0x4d427e,{'contexts':_0xdb2bd8});fs[_0x7153('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3a871d);return respondWithRpcPromise(_0x7153('0x62'),_0x7153('0x33'),{'module':_0x7153('0x63')});})[_0x7153('0x28')](handleError(_0x127946,null));}; \ No newline at end of file +var _0xdab2=['http','test','Sequelize','ValidationError','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','Contexts','UserProfileResource','destroy','stack','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filters','filter','where','merge','options','VoiceContext','count','includeAll','findAll','rows','show','params','include','find','create','body','server/files/templates/context.ejs','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','get','role','UserProfileSection','userProfileId','name','join','root','utf8','readFileSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise'];(function(_0x589107,_0x406b48){var _0x45b67c=function(_0x3be711){while(--_0x3be711){_0x589107['push'](_0x589107['shift']());}};_0x45b67c(++_0x406b48);}(_0xdab2,0xb0));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2dab('0x0'));var emlformat=require(_0x2dab('0x1'));var rimraf=require(_0x2dab('0x2'));var zipdir=require(_0x2dab('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2dab('0x4'));var moment=require('moment');var BPromise=require(_0x2dab('0x5'));var Mustache=require(_0x2dab('0x6'));var util=require(_0x2dab('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x2dab('0x8'));var ejs=require(_0x2dab('0x9'));var fs=require('fs');var _=require(_0x2dab('0xa'));var squel=require('squel');var crypto=require(_0x2dab('0xb'));var jsforce=require(_0x2dab('0xc'));var deskjs=require(_0x2dab('0xd'));var toCsv=require(_0x2dab('0x8'));var querystring=require(_0x2dab('0xe'));var Papa=require('papaparse');var Redis=require(_0x2dab('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2dab('0x10'));var hardwareService=require(_0x2dab('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x2dab('0x12'));var config=require(_0x2dab('0x13'));var db=require(_0x2dab('0x14'))['db'];var jayson=require(_0x2dab('0x15'));var client=jayson['client'][_0x2dab('0x16')]({'port':0x232a});function checkPasswordPattern(_0x8d632b,_0x311611,_0x549051){if(_0x549051){var _0x2a87d7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a87d7[_0x2dab('0x17')](_0x311611)){return _0x8d632b;}else{throw new db[(_0x2dab('0x18'))][(_0x2dab('0x19'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x8d632b;}}function respondWithRpcPromise(_0x40200b,_0x17b5de,_0x3eeb3e,_0x2bd558){return new BPromise(function(_0x2e341d,_0x24b6bd){var _0x1d599a=_0x2bd558||client;return _0x1d599a[_0x2dab('0x1a')](_0x40200b,_0x3eeb3e)[_0x2dab('0x1b')](function(_0xc043e5){logger[_0x2dab('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x17b5de,_0x2dab('0x1d'));logger[_0x2dab('0x1e')](_0x2dab('0x1f'),_0x17b5de,_0x2dab('0x1d'),JSON[_0x2dab('0x20')](_0xc043e5));if(_0xc043e5[_0x2dab('0x21')]){if(_0xc043e5[_0x2dab('0x21')][_0x2dab('0x22')]===0x1f4){logger[_0x2dab('0x21')](_0x2dab('0x23'),_0x17b5de,_0xc043e5[_0x2dab('0x21')][_0x2dab('0x24')]);return _0x24b6bd(_0xc043e5[_0x2dab('0x21')]['message']);}logger[_0x2dab('0x21')]('VoiceContext,\x20%s,\x20%s',_0x17b5de,_0xc043e5[_0x2dab('0x21')][_0x2dab('0x24')]);return _0x2e341d(_0xc043e5[_0x2dab('0x21')]['message']);}else{logger[_0x2dab('0x1c')](_0x2dab('0x23'),_0x17b5de,_0x2dab('0x1d'));_0x2e341d(_0xc043e5[_0x2dab('0x25')][_0x2dab('0x24')]);}})[_0x2dab('0x26')](function(_0x48f709){logger[_0x2dab('0x21')](_0x2dab('0x23'),_0x17b5de,_0x48f709);_0x24b6bd(_0x48f709);});});}function respondWithStatusCode(_0x5dfbc9,_0x2bcd4a){_0x2bcd4a=_0x2bcd4a||0xcc;return function(_0x1816c4){if(_0x1816c4){return _0x5dfbc9[_0x2dab('0x27')](_0x2bcd4a);}return _0x5dfbc9[_0x2dab('0x28')](_0x2bcd4a)[_0x2dab('0x29')]();};}function respondWithResult(_0x32614e,_0x2afa07){_0x2afa07=_0x2afa07||0xc8;return function(_0x35216a){if(_0x35216a){return _0x32614e[_0x2dab('0x28')](_0x2afa07)[_0x2dab('0x2a')](_0x35216a);}};}function respondWithFilteredResult(_0x38a511,_0xcccca9){return function(_0x1dd5c9){if(_0x1dd5c9){var _0x42ebcf=_0x1dd5c9['count'],_0x31254a=_0xcccca9['offset'],_0x2f1886=_0xcccca9[_0x2dab('0x2b')]+_0xcccca9[_0x2dab('0x2c')],_0x16bbcd;if(_0x2f1886>=_0x42ebcf){_0x2f1886=_0x42ebcf;_0x16bbcd=0xc8;}else{_0x16bbcd=0xce;}_0x38a511[_0x2dab('0x28')](_0x16bbcd);return _0x38a511[_0x2dab('0x2d')](_0x2dab('0x2e'),_0x31254a+'-'+_0x2f1886+'/'+_0x42ebcf)[_0x2dab('0x2a')](_0x1dd5c9);}return null;};}function patchUpdates(_0x509bc2){return function(_0x565275){try{jsonpatch[_0x2dab('0x2f')](_0x565275,_0x509bc2,!![]);}catch(_0x37cbd8){return BPromise['reject'](_0x37cbd8);}return _0x565275[_0x2dab('0x30')]();};}function saveUpdates(_0x573532,_0x977890){return function(_0x470b2f){if(_0x470b2f){return _0x470b2f[_0x2dab('0x31')](_0x573532)[_0x2dab('0x1b')](function(_0x4edde7){return _0x4edde7;});}return null;};}function removeEntity(_0x1876aa,_0x5d6c16){return function(_0xe9bf49){if(_0xe9bf49){return _0xe9bf49['destroy']()[_0x2dab('0x1b')](function(){var _0x2589b6=_0xe9bf49['get']({'plain':!![]});var _0x422c53=_0x2dab('0x32');return db[_0x2dab('0x33')][_0x2dab('0x34')]({'where':{'type':_0x422c53,'resourceId':_0x2589b6['id']}})[_0x2dab('0x1b')](function(){return _0xe9bf49;});})['then'](function(){_0x1876aa[_0x2dab('0x28')](0xcc)[_0x2dab('0x29')]();});}};}function handleEntityNotFound(_0x291c50,_0x1c4294){return function(_0x5d53a3){if(!_0x5d53a3){_0x291c50[_0x2dab('0x27')](0x194);}return _0x5d53a3;};}function handleError(_0x36d4aa,_0x5d4a49){_0x5d4a49=_0x5d4a49||0x1f4;return function(_0x250850){logger[_0x2dab('0x21')](_0x250850[_0x2dab('0x35')]);if(_0x250850['name']){delete _0x250850['name'];}_0x36d4aa['status'](_0x5d4a49)['send'](_0x250850);};}exports['index']=function(_0x3de351,_0x270e7d){var _0x570878={},_0x53df88={},_0x1ffd22={'count':0x0,'rows':[]};var _0x6ba9a=_[_0x2dab('0x36')](db['VoiceContext'][_0x2dab('0x37')],function(_0xce17a3){return{'name':_0xce17a3[_0x2dab('0x38')],'type':_0xce17a3[_0x2dab('0x39')]['key']};});_0x53df88[_0x2dab('0x3a')]=_['map'](_0x6ba9a,'name');_0x53df88[_0x2dab('0x3b')]=_[_0x2dab('0x3c')](_0x3de351[_0x2dab('0x3b')]);_0x53df88['filters']=_[_0x2dab('0x3d')](_0x53df88['model'],_0x53df88['query']);_0x570878[_0x2dab('0x3e')]=_[_0x2dab('0x3d')](_0x53df88[_0x2dab('0x3a')],qs[_0x2dab('0x3f')](_0x3de351[_0x2dab('0x3b')]['fields']));_0x570878[_0x2dab('0x3e')]=_0x570878[_0x2dab('0x3e')]['length']?_0x570878[_0x2dab('0x3e')]:_0x53df88[_0x2dab('0x3a')];if(!_0x3de351[_0x2dab('0x3b')][_0x2dab('0x40')]('nolimit')){_0x570878[_0x2dab('0x2c')]=qs[_0x2dab('0x2c')](_0x3de351['query'][_0x2dab('0x2c')]);_0x570878[_0x2dab('0x2b')]=qs[_0x2dab('0x2b')](_0x3de351[_0x2dab('0x3b')][_0x2dab('0x2b')]);}_0x570878[_0x2dab('0x41')]=qs[_0x2dab('0x42')](_0x3de351[_0x2dab('0x3b')][_0x2dab('0x42')]);_0x570878['where']=qs['filters'](_[_0x2dab('0x43')](_0x3de351[_0x2dab('0x3b')],_0x53df88[_0x2dab('0x44')]));if(_0x3de351[_0x2dab('0x3b')][_0x2dab('0x45')]){_0x570878[_0x2dab('0x46')]=_[_0x2dab('0x47')](_0x570878[_0x2dab('0x46')],{'$or':_['map'](_0x6ba9a,function(_0x515ffa){if(_0x515ffa[_0x2dab('0x39')]!=='VIRTUAL'){var _0x5077df={};_0x5077df[_0x515ffa['name']]={'$like':'%'+_0x3de351[_0x2dab('0x3b')]['filter']+'%'};return _0x5077df;}})});}_0x570878=_[_0x2dab('0x47')]({},_0x570878,_0x3de351[_0x2dab('0x48')]);var _0x5cc008={'where':_0x570878[_0x2dab('0x46')]};return db[_0x2dab('0x49')][_0x2dab('0x4a')](_0x5cc008)[_0x2dab('0x1b')](function(_0x433279){_0x1ffd22[_0x2dab('0x4a')]=_0x433279;if(_0x3de351[_0x2dab('0x3b')][_0x2dab('0x4b')]){_0x570878['include']=[{'all':!![]}];}return db[_0x2dab('0x49')][_0x2dab('0x4c')](_0x570878);})[_0x2dab('0x1b')](function(_0x4933ce){_0x1ffd22[_0x2dab('0x4d')]=_0x4933ce;return _0x1ffd22;})[_0x2dab('0x1b')](respondWithFilteredResult(_0x270e7d,_0x570878))[_0x2dab('0x26')](handleError(_0x270e7d,null));};exports[_0x2dab('0x4e')]=function(_0x5b2793,_0x3c7dc7){var _0x1819c3={'raw':![],'where':{'id':_0x5b2793[_0x2dab('0x4f')]['id']}},_0x2a9eab={};_0x2a9eab[_0x2dab('0x3a')]=_[_0x2dab('0x3c')](db[_0x2dab('0x49')][_0x2dab('0x37')]);_0x2a9eab['query']=_[_0x2dab('0x3c')](_0x5b2793[_0x2dab('0x3b')]);_0x2a9eab[_0x2dab('0x44')]=_['intersection'](_0x2a9eab[_0x2dab('0x3a')],_0x2a9eab[_0x2dab('0x3b')]);_0x1819c3[_0x2dab('0x3e')]=_[_0x2dab('0x3d')](_0x2a9eab[_0x2dab('0x3a')],qs['fields'](_0x5b2793[_0x2dab('0x3b')][_0x2dab('0x3f')]));_0x1819c3[_0x2dab('0x3e')]=_0x1819c3[_0x2dab('0x3e')]['length']?_0x1819c3[_0x2dab('0x3e')]:_0x2a9eab[_0x2dab('0x3a')];if(_0x5b2793[_0x2dab('0x3b')][_0x2dab('0x4b')]){_0x1819c3[_0x2dab('0x50')]=[{'all':!![]}];}_0x1819c3=_[_0x2dab('0x47')]({},_0x1819c3,_0x5b2793[_0x2dab('0x48')]);return db[_0x2dab('0x49')][_0x2dab('0x51')](_0x1819c3)['then'](handleEntityNotFound(_0x3c7dc7,null))[_0x2dab('0x1b')](respondWithResult(_0x3c7dc7,null))[_0x2dab('0x26')](handleError(_0x3c7dc7,null));};exports[_0x2dab('0x52')]=function(_0x33cb44,_0x4296fe,_0x38425d){var _0x5e2976;return db[_0x2dab('0x49')]['create'](_0x33cb44[_0x2dab('0x53')],{'raw':!![]})[_0x2dab('0x1b')](function(_0x4e97bd){_0x5e2976=_0x4e97bd;return db[_0x2dab('0x49')][_0x2dab('0x4c')]({'raw':!![]});})[_0x2dab('0x1b')](function(_0x364819){var _0x28c7fa=fs['readFileSync'](path['join'](config['root'],_0x2dab('0x54')),'utf8');var _0x25655f=ejs['render'](_0x28c7fa,{'contexts':_0x364819||[]});fs[_0x2dab('0x55')](_0x2dab('0x56'),_0x25655f);})[_0x2dab('0x1b')](function(){return respondWithRpcPromise(_0x2dab('0x57'),_0x2dab('0x52'),{'module':_0x2dab('0x58')});})['then'](function(){var _0xe5f49d=_0x33cb44[_0x2dab('0x59')][_0x2dab('0x5a')]({'plain':!![]});if(!_0xe5f49d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe5f49d[_0x2dab('0x5b')]===_0x2dab('0x59')){var _0xbd88bc=_0x5e2976[_0x2dab('0x5a')]({'plain':!![]});return db[_0x2dab('0x5c')][_0x2dab('0x51')]({'where':{'name':_0x2dab('0x32'),'userProfileId':_0xe5f49d[_0x2dab('0x5d')]},'raw':!![]})['then'](function(_0x28b880){if(_0x28b880&&_0x28b880['autoAssociation']===0x0){return db[_0x2dab('0x33')][_0x2dab('0x52')]({'name':_0xbd88bc[_0x2dab('0x5e')],'resourceId':_0xbd88bc['id'],'type':_0x28b880[_0x2dab('0x5e')],'sectionId':_0x28b880['id']},{})[_0x2dab('0x1b')](function(){return _0x5e2976;});}else{return _0x5e2976;}})['catch'](function(_0xd3a4e1){logger[_0x2dab('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd3a4e1);throw _0xd3a4e1;});}return _0x5e2976;})['then'](respondWithResult(_0x4296fe,0xc9))[_0x2dab('0x26')](handleError(_0x4296fe,null));};exports[_0x2dab('0x31')]=function(_0x18e738,_0xc74bf0,_0x52a25){var _0x467666;return db[_0x2dab('0x49')][_0x2dab('0x51')]({'where':{'id':_0x18e738['params']['id']}})[_0x2dab('0x1b')](handleEntityNotFound(_0xc74bf0,null))[_0x2dab('0x1b')](saveUpdates(_0x18e738[_0x2dab('0x53')],null))[_0x2dab('0x1b')](function(_0x2caa62){if(_0x2caa62){_0x467666=_0x2caa62;return db[_0x2dab('0x49')][_0x2dab('0x4c')]({'raw':!![]});}})[_0x2dab('0x1b')](function(_0x5e032a){var _0x545be1=fs['readFileSync'](path[_0x2dab('0x5f')](config[_0x2dab('0x60')],'server/files/templates/context.ejs'),_0x2dab('0x61'));var _0x467a99=ejs['render'](_0x545be1,{'contexts':_0x5e032a||[]});fs[_0x2dab('0x55')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x467a99);})[_0x2dab('0x1b')](function(){return respondWithRpcPromise('Reload','update',{'module':_0x2dab('0x58')});})['then'](function(){return _0x467666;})[_0x2dab('0x1b')](respondWithResult(_0xc74bf0,null))['catch'](handleError(_0xc74bf0,null));};exports[_0x2dab('0x34')]=function(_0x26fd56,_0x266151,_0x2b6e55){var _0x545d5c;return db[_0x2dab('0x49')][_0x2dab('0x51')]({'where':{'id':_0x26fd56[_0x2dab('0x4f')]['id']}})[_0x2dab('0x1b')](handleEntityNotFound(_0x266151,null))['then'](removeEntity(_0x266151,null))[_0x2dab('0x1b')](function(){return db[_0x2dab('0x49')][_0x2dab('0x4c')]({'raw':!![]});})['then'](function(_0x955351){var _0x4fcf7d=fs[_0x2dab('0x62')](path[_0x2dab('0x5f')](config[_0x2dab('0x60')],'server/files/templates/context.ejs'),'utf8');var _0x7cc6d3=ejs['render'](_0x4fcf7d,{'contexts':_0x955351});fs[_0x2dab('0x55')](_0x2dab('0x56'),_0x7cc6d3);return respondWithRpcPromise(_0x2dab('0x57'),_0x2dab('0x34'),{'module':_0x2dab('0x58')});})['catch'](handleError(_0x266151,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 2a5ed4a..46c16d8 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 _0x6e67=['../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x270a29,_0x3088cc){var _0x5959b5=function(_0x3f1352){while(--_0x3f1352){_0x270a29['push'](_0x270a29['shift']());}};_0x5959b5(++_0x3088cc);}(_0x6e67,0x144));var _0x76e6=function(_0x33e9b5,_0x36fbf1){_0x33e9b5=_0x33e9b5-0x0;var _0x3244c0=_0x6e67[_0x33e9b5];return _0x3244c0;};'use strict';var _=require(_0x76e6('0x0'));var util=require('util');var logger=require(_0x76e6('0x1'))(_0x76e6('0x2'));var moment=require('moment');var BPromise=require(_0x76e6('0x3'));var rp=require(_0x76e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76e6('0x5'));var config=require(_0x76e6('0x6'));var attributes=require(_0x76e6('0x7'));module['exports']=function(_0x14cbb2,_0x39250e){return _0x14cbb2[_0x76e6('0x8')](_0x76e6('0x9'),attributes,{'tableName':_0x76e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x019f=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash'];(function(_0x3e9fdd,_0xb15aec){var _0x483704=function(_0x977486){while(--_0x977486){_0x3e9fdd['push'](_0x3e9fdd['shift']());}};_0x483704(++_0xb15aec);}(_0x019f,0xcb));var _0xf019=function(_0x5b5947,_0x11623c){_0x5b5947=_0x5b5947-0x0;var _0x7623e0=_0x019f[_0x5b5947];return _0x7623e0;};'use strict';var _=require(_0xf019('0x0'));var util=require(_0xf019('0x1'));var logger=require(_0xf019('0x2'))('api');var moment=require('moment');var BPromise=require(_0xf019('0x3'));var rp=require(_0xf019('0x4'));var fs=require('fs');var path=require(_0xf019('0x5'));var rimraf=require(_0xf019('0x6'));var config=require(_0xf019('0x7'));var attributes=require(_0xf019('0x8'));module['exports']=function(_0x4acdf2,_0x4429d8){return _0x4acdf2[_0xf019('0x9')](_0xf019('0xa'),attributes,{'tableName':_0xf019('0xb'),'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 ddf1064..2e730dd 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 _0xbc11=['../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xbc11,0x185));var _0x1bc1=function(_0x56cd73,_0x418099){_0x56cd73=_0x56cd73-0x0;var _0x1ea9ef=_0xbc11[_0x56cd73];return _0x1ea9ef;};'use strict';var _=require(_0x1bc1('0x0'));var util=require(_0x1bc1('0x1'));var moment=require(_0x1bc1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bc1('0x3'));var db=require(_0x1bc1('0x4'))['db'];var utils=require(_0x1bc1('0x5'));var logger=require(_0x1bc1('0x6'))('rpc');var config=require(_0x1bc1('0x7'));var jayson=require(_0x1bc1('0x8'));var client=jayson[_0x1bc1('0x9')][_0x1bc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9f4347,_0x334f80,_0x1af27b){return new BPromise(function(_0x12309b,_0x28fb63){return client['request'](_0x9f4347,_0x1af27b)[_0x1bc1('0xb')](function(_0x210616){logger[_0x1bc1('0xc')](_0x1bc1('0xd'),_0x334f80,_0x1bc1('0xe'));logger[_0x1bc1('0xf')](_0x1bc1('0x10'),_0x334f80,_0x1bc1('0xe'),JSON[_0x1bc1('0x11')](_0x210616));if(_0x210616[_0x1bc1('0x12')]){if(_0x210616[_0x1bc1('0x12')]['code']===0x1f4){logger['error'](_0x1bc1('0xd'),_0x334f80,_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);return _0x28fb63(_0x210616['error'][_0x1bc1('0x13')]);}logger[_0x1bc1('0x12')](_0x1bc1('0xd'),_0x334f80,_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);return _0x12309b(_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);}else{logger[_0x1bc1('0xc')](_0x1bc1('0xd'),_0x334f80,_0x1bc1('0xe'));_0x12309b(_0x210616[_0x1bc1('0x14')][_0x1bc1('0x13')]);}})[_0x1bc1('0x15')](function(_0x4293ff){logger[_0x1bc1('0x12')](_0x1bc1('0xd'),_0x334f80,_0x4293ff);_0x28fb63(_0x4293ff);});});} \ No newline at end of file +var _0xa852=['VoiceContext,\x20%s,\x20%s,\x20%s','error','code','VoiceContext,\x20%s,\x20%s','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa852,0x1bc));var _0x2a85=function(_0xc9e103,_0x24a7ce){_0xc9e103=_0xc9e103-0x0;var _0x493511=_0xa852[_0xc9e103];return _0x493511;};'use strict';var _=require(_0x2a85('0x0'));var util=require(_0x2a85('0x1'));var moment=require(_0x2a85('0x2'));var BPromise=require(_0x2a85('0x3'));var rs=require(_0x2a85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a85('0x5'))['db'];var utils=require(_0x2a85('0x6'));var logger=require(_0x2a85('0x7'))(_0x2a85('0x8'));var config=require(_0x2a85('0x9'));var jayson=require(_0x2a85('0xa'));var client=jayson[_0x2a85('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b5fa3,_0x21a650,_0xcf48e9){return new BPromise(function(_0xe115e2,_0x4da79c){return client[_0x2a85('0xc')](_0x4b5fa3,_0xcf48e9)[_0x2a85('0xd')](function(_0x36cec0){logger[_0x2a85('0xe')]('VoiceContext,\x20%s,\x20%s',_0x21a650,'request\x20sent');logger[_0x2a85('0xf')](_0x2a85('0x10'),_0x21a650,'request\x20sent',JSON['stringify'](_0x36cec0));if(_0x36cec0[_0x2a85('0x11')]){if(_0x36cec0[_0x2a85('0x11')][_0x2a85('0x12')]===0x1f4){logger['error'](_0x2a85('0x13'),_0x21a650,_0x36cec0[_0x2a85('0x11')][_0x2a85('0x14')]);return _0x4da79c(_0x36cec0[_0x2a85('0x11')][_0x2a85('0x14')]);}logger[_0x2a85('0x11')](_0x2a85('0x13'),_0x21a650,_0x36cec0[_0x2a85('0x11')][_0x2a85('0x14')]);return _0xe115e2(_0x36cec0[_0x2a85('0x11')][_0x2a85('0x14')]);}else{logger[_0x2a85('0xe')](_0x2a85('0x13'),_0x21a650,_0x2a85('0x15'));_0xe115e2(_0x36cec0[_0x2a85('0x16')]['message']);}})['catch'](function(_0x12b12b){logger[_0x2a85('0x11')](_0x2a85('0x13'),_0x21a650,_0x12b12b);_0x4da79c(_0x12b12b);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 4d3cf61..251e540 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 _0xda72=['/describe','isAuthenticated','/:id','show','post','create','put','update','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda72,0x139));var _0x2da7=function(_0x547f86,_0x8b22f){_0x547f86=_0x547f86-0x0;var _0xe7919f=_0xda72[_0x547f86];return _0xe7919f;};'use strict';var multer=require(_0x2da7('0x0'));var util=require('util');var path=require(_0x2da7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x2da7('0x2'));var interaction=require(_0x2da7('0x3'));var config=require(_0x2da7('0x4'));var controller=require(_0x2da7('0x5'));router[_0x2da7('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2da7('0x6')](_0x2da7('0x7'),auth[_0x2da7('0x8')](),controller['describe']);router['get'](_0x2da7('0x9'),auth['isAuthenticated'](),controller[_0x2da7('0xa')]);router[_0x2da7('0xb')]('/',auth[_0x2da7('0x8')](),controller[_0x2da7('0xc')]);router[_0x2da7('0xd')](_0x2da7('0x9'),auth[_0x2da7('0x8')](),controller[_0x2da7('0xe')]);router['delete']('/:id',auth[_0x2da7('0x8')](),controller['destroy']);module[_0x2da7('0xf')]=router; \ No newline at end of file +var _0x881b=['./voiceDialReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x396d1a,_0x447274){var _0x1a7e4d=function(_0x5a8937){while(--_0x5a8937){_0x396d1a['push'](_0x396d1a['shift']());}};_0x1a7e4d(++_0x447274);}(_0x881b,0x1e0));var _0xb881=function(_0x37321d,_0x59efe1){_0x37321d=_0x37321d-0x0;var _0x360996=_0x881b[_0x37321d];return _0x360996;};'use strict';var multer=require(_0xb881('0x0'));var util=require(_0xb881('0x1'));var path=require(_0xb881('0x2'));var timeout=require(_0xb881('0x3'));var express=require(_0xb881('0x4'));var router=express[_0xb881('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb881('0x6'));router[_0xb881('0x7')]('/',auth[_0xb881('0x8')](),controller['index']);router[_0xb881('0x7')](_0xb881('0x9'),auth[_0xb881('0x8')](),controller['describe']);router[_0xb881('0x7')](_0xb881('0xa'),auth[_0xb881('0x8')](),controller[_0xb881('0xb')]);router[_0xb881('0xc')]('/',auth['isAuthenticated'](),controller[_0xb881('0xd')]);router[_0xb881('0xe')](_0xb881('0xa'),auth[_0xb881('0x8')](),controller[_0xb881('0xf')]);router['delete']('/:id',auth[_0xb881('0x8')](),controller[_0xb881('0x10')]);module[_0xb881('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index cdad915..f53bd16 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 _0x6509=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x6509,0x130));var _0x9650=function(_0x3a6194,_0x4574e2){_0x3a6194=_0x3a6194-0x0;var _0x298116=_0x6509[_0x3a6194];return _0x298116;};'use strict';var Sequelize=require(_0x9650('0x0'));module['exports']={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9650('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9650('0x1')]},'calleridname':{'type':Sequelize[_0x9650('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9650('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9650('0x1')]},'context':{'type':Sequelize[_0x9650('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9650('0x2')]},'uniqueid':{'type':Sequelize[_0x9650('0x1')]},'linkedid':{'type':Sequelize[_0x9650('0x1')]},'destchannel':{'type':Sequelize[_0x9650('0x1')]},'destchannelstate':{'type':Sequelize[_0x9650('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9650('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9650('0x1')]},'destcalleridname':{'type':Sequelize[_0x9650('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9650('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9650('0x1')]},'destlanguage':{'type':Sequelize[_0x9650('0x1')]},'destaccountcode':{'type':Sequelize[_0x9650('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9650('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9650('0x1')]},'dialstring':{'type':Sequelize[_0x9650('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9650('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9650('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x9650('0x4')},'routeId':{'type':Sequelize[_0x9650('0x2')]},'duration':{'type':Sequelize[_0x9650('0x2')]},'holdtime':{'type':Sequelize[_0x9650('0x2')]},'billableseconds':{'type':Sequelize[_0x9650('0x2')]}}; \ No newline at end of file +var _0xe817=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0x25662e,_0x4cec68){var _0x59b7bc=function(_0xafb159){while(--_0xafb159){_0x25662e['push'](_0x25662e['shift']());}};_0x59b7bc(++_0x4cec68);}(_0xe817,0x18e));var _0x7e81=function(_0xb3b609,_0x32de47){_0xb3b609=_0xb3b609-0x0;var _0x14fd01=_0xe817[_0xb3b609];return _0x14fd01;};'use strict';var Sequelize=require(_0x7e81('0x0'));module[_0x7e81('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x7e81('0x2')]},'channelstate':{'type':Sequelize[_0x7e81('0x3')]},'channelstatedesc':{'type':Sequelize[_0x7e81('0x2')]},'calleridnum':{'type':Sequelize[_0x7e81('0x2')]},'calleridname':{'type':Sequelize[_0x7e81('0x2')]},'connectedlinenum':{'type':Sequelize[_0x7e81('0x2')]},'connectedlinename':{'type':Sequelize[_0x7e81('0x2')]},'language':{'type':Sequelize[_0x7e81('0x2')]},'accountcode':{'type':Sequelize[_0x7e81('0x2')]},'context':{'type':Sequelize[_0x7e81('0x2')]},'exten':{'type':Sequelize[_0x7e81('0x2')]},'priority':{'type':Sequelize[_0x7e81('0x3')]},'uniqueid':{'type':Sequelize[_0x7e81('0x2')]},'linkedid':{'type':Sequelize[_0x7e81('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x7e81('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x7e81('0x2')]},'destcalleridname':{'type':Sequelize[_0x7e81('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x7e81('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x7e81('0x2')]},'destcontext':{'type':Sequelize[_0x7e81('0x2')]},'destexten':{'type':Sequelize[_0x7e81('0x2')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x7e81('0x2')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x7e81('0x2')]},'dialstatus':{'type':Sequelize[_0x7e81('0x2')]},'starttime':{'type':Sequelize[_0x7e81('0x4')]},'answertime':{'type':Sequelize[_0x7e81('0x4')]},'endtime':{'type':Sequelize[_0x7e81('0x4')]},'lastevent':{'type':Sequelize[_0x7e81('0x2')],'comment':_0x7e81('0x5')},'routeId':{'type':Sequelize[_0x7e81('0x3')]},'duration':{'type':Sequelize[_0x7e81('0x3')]},'holdtime':{'type':Sequelize[_0x7e81('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 2ba9094..336a59d 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 _0x93fd=['sox','ejs','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','model','length','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x39bbb1,_0x5bd14b){var _0x372649=function(_0x45c801){while(--_0x45c801){_0x39bbb1['push'](_0x39bbb1['shift']());}};_0x372649(++_0x5bd14b);}(_0x93fd,0x11c));var _0xd93f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93fd[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0xd93f('0x0'));var emlformat=require(_0xd93f('0x1'));var rimraf=require(_0xd93f('0x2'));var zipdir=require(_0xd93f('0x3'));var jsonpatch=require(_0xd93f('0x4'));var rp=require(_0xd93f('0x5'));var moment=require(_0xd93f('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd93f('0x7'));var path=require('path');var sox=require(_0xd93f('0x8'));var csv=require('to-csv');var ejs=require(_0xd93f('0x9'));var fs=require('fs');var _=require(_0xd93f('0xa'));var squel=require('squel');var crypto=require(_0xd93f('0xb'));var jsforce=require(_0xd93f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd93f('0xd'));var querystring=require(_0xd93f('0xe'));var Papa=require('papaparse');var Redis=require(_0xd93f('0xf'));var authService=require(_0xd93f('0x10'));var qs=require(_0xd93f('0x11'));var as=require(_0xd93f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd93f('0x13'));var config=require('../../config/environment');var db=require(_0xd93f('0x14'))['db'];function respondWithStatusCode(_0x11fa99,_0x44547f){_0x44547f=_0x44547f||0xcc;return function(_0x1b4d3f){if(_0x1b4d3f){return _0x11fa99[_0xd93f('0x15')](_0x44547f);}return _0x11fa99[_0xd93f('0x16')](_0x44547f)[_0xd93f('0x17')]();};}function respondWithResult(_0x38da4f,_0x58df28){_0x58df28=_0x58df28||0xc8;return function(_0x3dafcf){if(_0x3dafcf){return _0x38da4f[_0xd93f('0x16')](_0x58df28)[_0xd93f('0x18')](_0x3dafcf);}};}function respondWithFilteredResult(_0x1c526c,_0x4a488f){return function(_0x502efd){if(_0x502efd){var _0x21739d=_0x502efd[_0xd93f('0x19')],_0x58562e=_0x4a488f[_0xd93f('0x1a')],_0x2f0100=_0x4a488f[_0xd93f('0x1a')]+_0x4a488f[_0xd93f('0x1b')],_0x25b598;if(_0x2f0100>=_0x21739d){_0x2f0100=_0x21739d;_0x25b598=0xc8;}else{_0x25b598=0xce;}_0x1c526c[_0xd93f('0x16')](_0x25b598);return _0x1c526c[_0xd93f('0x1c')](_0xd93f('0x1d'),_0x58562e+'-'+_0x2f0100+'/'+_0x21739d)[_0xd93f('0x18')](_0x502efd);}return null;};}function patchUpdates(_0x55af58){return function(_0x34dda3){try{jsonpatch[_0xd93f('0x1e')](_0x34dda3,_0x55af58,!![]);}catch(_0x4a147e){return BPromise[_0xd93f('0x1f')](_0x4a147e);}return _0x34dda3[_0xd93f('0x20')]();};}function saveUpdates(_0x3f1987,_0x1ca8fc){return function(_0xde59c6){if(_0xde59c6){return _0xde59c6[_0xd93f('0x21')](_0x3f1987)['then'](function(_0x49eae2){return _0x49eae2;});}return null;};}function removeEntity(_0x1745bb,_0x575a7a){return function(_0x29dd88){if(_0x29dd88){return _0x29dd88[_0xd93f('0x22')]()[_0xd93f('0x23')](function(){_0x1745bb[_0xd93f('0x16')](0xcc)[_0xd93f('0x17')]();});}};}function handleEntityNotFound(_0x38e691,_0x598eb4){return function(_0x5d358e){if(!_0x5d358e){_0x38e691['sendStatus'](0x194);}return _0x5d358e;};}function handleError(_0x4f192e,_0x4ba260){_0x4ba260=_0x4ba260||0x1f4;return function(_0x5af204){logger[_0xd93f('0x24')](_0x5af204[_0xd93f('0x25')]);if(_0x5af204[_0xd93f('0x26')]){delete _0x5af204[_0xd93f('0x26')];}_0x4f192e['status'](_0x4ba260)[_0xd93f('0x27')](_0x5af204);};}exports[_0xd93f('0x28')]=function(_0x58d784,_0x1dd799){var _0x203158={},_0x56ea7b={},_0x2ed61d={'count':0x0,'rows':[]};var _0x2a15de=_[_0xd93f('0x29')](db[_0xd93f('0x2a')][_0xd93f('0x2b')],function(_0x12c701){return{'name':_0x12c701[_0xd93f('0x2c')],'type':_0x12c701[_0xd93f('0x2d')][_0xd93f('0x2e')]};});_0x56ea7b['model']=_[_0xd93f('0x29')](_0x2a15de,_0xd93f('0x26'));_0x56ea7b['query']=_['keys'](_0x58d784[_0xd93f('0x2f')]);_0x56ea7b[_0xd93f('0x30')]=_[_0xd93f('0x31')](_0x56ea7b['model'],_0x56ea7b[_0xd93f('0x2f')]);_0x203158[_0xd93f('0x32')]=_[_0xd93f('0x31')](_0x56ea7b['model'],qs[_0xd93f('0x33')](_0x58d784[_0xd93f('0x2f')][_0xd93f('0x33')]));_0x203158[_0xd93f('0x32')]=_0x203158[_0xd93f('0x32')]['length']?_0x203158['attributes']:_0x56ea7b['model'];if(!_0x58d784[_0xd93f('0x2f')]['hasOwnProperty'](_0xd93f('0x34'))){_0x203158[_0xd93f('0x1b')]=qs[_0xd93f('0x1b')](_0x58d784[_0xd93f('0x2f')]['limit']);_0x203158[_0xd93f('0x1a')]=qs[_0xd93f('0x1a')](_0x58d784[_0xd93f('0x2f')][_0xd93f('0x1a')]);}_0x203158['order']=qs[_0xd93f('0x35')](_0x58d784[_0xd93f('0x2f')][_0xd93f('0x35')]);_0x203158[_0xd93f('0x36')]=qs[_0xd93f('0x30')](_[_0xd93f('0x37')](_0x58d784['query'],_0x56ea7b[_0xd93f('0x30')]));if(_0x58d784[_0xd93f('0x2f')]['filter']){_0x203158['where']=_[_0xd93f('0x38')](_0x203158[_0xd93f('0x36')],{'$or':_[_0xd93f('0x29')](_0x2a15de,function(_0x11e260){if(_0x11e260[_0xd93f('0x2d')]!==_0xd93f('0x39')){var _0x32b698={};_0x32b698[_0x11e260[_0xd93f('0x26')]]={'$like':'%'+_0x58d784['query']['filter']+'%'};return _0x32b698;}})});}_0x203158=_['merge']({},_0x203158,_0x58d784[_0xd93f('0x3a')]);var _0x16f042={'where':_0x203158[_0xd93f('0x36')]};return db['VoiceDialReport'][_0xd93f('0x19')](_0x16f042)[_0xd93f('0x23')](function(_0x4206af){_0x2ed61d[_0xd93f('0x19')]=_0x4206af;if(_0x58d784[_0xd93f('0x2f')][_0xd93f('0x3b')]){_0x203158['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0xd93f('0x3c')](_0x203158);})[_0xd93f('0x23')](function(_0x416310){_0x2ed61d[_0xd93f('0x3d')]=_0x416310;return _0x2ed61d;})['then'](respondWithFilteredResult(_0x1dd799,_0x203158))[_0xd93f('0x3e')](handleError(_0x1dd799,null));};exports[_0xd93f('0x3f')]=function(_0x549749,_0xd3ceed){var _0x40fb5a={'raw':!![],'where':{'id':_0x549749[_0xd93f('0x40')]['id']}},_0x966c06={};_0x966c06['model']=_[_0xd93f('0x41')](db['VoiceDialReport']['rawAttributes']);_0x966c06['query']=_[_0xd93f('0x41')](_0x549749[_0xd93f('0x2f')]);_0x966c06[_0xd93f('0x30')]=_['intersection'](_0x966c06[_0xd93f('0x42')],_0x966c06[_0xd93f('0x2f')]);_0x40fb5a[_0xd93f('0x32')]=_[_0xd93f('0x31')](_0x966c06[_0xd93f('0x42')],qs[_0xd93f('0x33')](_0x549749[_0xd93f('0x2f')]['fields']));_0x40fb5a[_0xd93f('0x32')]=_0x40fb5a[_0xd93f('0x32')][_0xd93f('0x43')]?_0x40fb5a['attributes']:_0x966c06[_0xd93f('0x42')];if(_0x549749[_0xd93f('0x2f')][_0xd93f('0x3b')]){_0x40fb5a[_0xd93f('0x44')]=[{'all':!![]}];}_0x40fb5a=_[_0xd93f('0x38')]({},_0x40fb5a,_0x549749[_0xd93f('0x3a')]);return db[_0xd93f('0x2a')][_0xd93f('0x45')](_0x40fb5a)[_0xd93f('0x23')](handleEntityNotFound(_0xd3ceed,null))[_0xd93f('0x23')](respondWithResult(_0xd3ceed,null))[_0xd93f('0x3e')](handleError(_0xd3ceed,null));};exports[_0xd93f('0x46')]=function(_0xc54bef,_0xab6dcd){return db[_0xd93f('0x2a')]['create'](_0xc54bef[_0xd93f('0x47')],{})[_0xd93f('0x23')](respondWithResult(_0xab6dcd,0xc9))['catch'](handleError(_0xab6dcd,null));};exports['update']=function(_0x566e43,_0x3299fe){if(_0x566e43[_0xd93f('0x47')]['id']){delete _0x566e43[_0xd93f('0x47')]['id'];}return db[_0xd93f('0x2a')][_0xd93f('0x45')]({'where':{'id':_0x566e43[_0xd93f('0x40')]['id']}})[_0xd93f('0x23')](handleEntityNotFound(_0x3299fe,null))[_0xd93f('0x23')](saveUpdates(_0x566e43[_0xd93f('0x47')],null))['then'](respondWithResult(_0x3299fe,null))['catch'](handleError(_0x3299fe,null));};exports[_0xd93f('0x22')]=function(_0x35d958,_0x353819){return db[_0xd93f('0x2a')]['find']({'where':{'id':_0x35d958[_0xd93f('0x40')]['id']}})[_0xd93f('0x23')](handleEntityNotFound(_0x353819,null))[_0xd93f('0x23')](removeEntity(_0x353819,null))[_0xd93f('0x3e')](handleError(_0x353819,null));};exports[_0xd93f('0x48')]=function(_0x1fe553,_0xfe1b4a){return db[_0xd93f('0x2a')][_0xd93f('0x48')]()[_0xd93f('0x23')](respondWithResult(_0xfe1b4a,null))[_0xd93f('0x3e')](handleError(_0xfe1b4a,null));}; \ No newline at end of file +var _0x5a16=['fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','end','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x5a16,0x135));var _0x65a1=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x5a16[_0x178e48];return _0x440d7e;};'use strict';var pdf=require(_0x65a1('0x0'));var emlformat=require(_0x65a1('0x1'));var rimraf=require(_0x65a1('0x2'));var zipdir=require(_0x65a1('0x3'));var jsonpatch=require(_0x65a1('0x4'));var rp=require(_0x65a1('0x5'));var moment=require(_0x65a1('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x65a1('0x7'));var sox=require(_0x65a1('0x8'));var csv=require(_0x65a1('0x9'));var ejs=require(_0x65a1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65a1('0xb'));var crypto=require(_0x65a1('0xc'));var jsforce=require(_0x65a1('0xd'));var deskjs=require(_0x65a1('0xe'));var toCsv=require(_0x65a1('0x9'));var querystring=require('querystring');var Papa=require(_0x65a1('0xf'));var Redis=require(_0x65a1('0x10'));var authService=require(_0x65a1('0x11'));var qs=require(_0x65a1('0x12'));var as=require(_0x65a1('0x13'));var hardwareService=require(_0x65a1('0x14'));var logger=require(_0x65a1('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65a1('0x16'))['db'];function respondWithStatusCode(_0x41bc16,_0x44f2b0){_0x44f2b0=_0x44f2b0||0xcc;return function(_0x451c4e){if(_0x451c4e){return _0x41bc16['sendStatus'](_0x44f2b0);}return _0x41bc16['status'](_0x44f2b0)[_0x65a1('0x17')]();};}function respondWithResult(_0x20e089,_0x335613){_0x335613=_0x335613||0xc8;return function(_0x45addd){if(_0x45addd){return _0x20e089[_0x65a1('0x18')](_0x335613)['json'](_0x45addd);}};}function respondWithFilteredResult(_0x1df7ca,_0x4f5962){return function(_0x4fe0de){if(_0x4fe0de){var _0x11859e=_0x4fe0de[_0x65a1('0x19')],_0x5cd9e9=_0x4f5962[_0x65a1('0x1a')],_0x1a32a0=_0x4f5962[_0x65a1('0x1a')]+_0x4f5962[_0x65a1('0x1b')],_0x39ebf0;if(_0x1a32a0>=_0x11859e){_0x1a32a0=_0x11859e;_0x39ebf0=0xc8;}else{_0x39ebf0=0xce;}_0x1df7ca[_0x65a1('0x18')](_0x39ebf0);return _0x1df7ca[_0x65a1('0x1c')](_0x65a1('0x1d'),_0x5cd9e9+'-'+_0x1a32a0+'/'+_0x11859e)['json'](_0x4fe0de);}return null;};}function patchUpdates(_0x547ada){return function(_0x48bcf2){try{jsonpatch['apply'](_0x48bcf2,_0x547ada,!![]);}catch(_0x262759){return BPromise[_0x65a1('0x1e')](_0x262759);}return _0x48bcf2[_0x65a1('0x1f')]();};}function saveUpdates(_0x343519,_0x4d799){return function(_0x19298a){if(_0x19298a){return _0x19298a[_0x65a1('0x20')](_0x343519)[_0x65a1('0x21')](function(_0x2cd88d){return _0x2cd88d;});}return null;};}function removeEntity(_0x1f864a,_0x45059e){return function(_0x1ceb31){if(_0x1ceb31){return _0x1ceb31[_0x65a1('0x22')]()[_0x65a1('0x21')](function(){_0x1f864a[_0x65a1('0x18')](0xcc)[_0x65a1('0x17')]();});}};}function handleEntityNotFound(_0x335f41,_0x14d9e5){return function(_0x4d196a){if(!_0x4d196a){_0x335f41['sendStatus'](0x194);}return _0x4d196a;};}function handleError(_0x4c2a21,_0x40b567){_0x40b567=_0x40b567||0x1f4;return function(_0x8b7cd1){logger[_0x65a1('0x23')](_0x8b7cd1[_0x65a1('0x24')]);if(_0x8b7cd1[_0x65a1('0x25')]){delete _0x8b7cd1[_0x65a1('0x25')];}_0x4c2a21['status'](_0x40b567)['send'](_0x8b7cd1);};}exports[_0x65a1('0x26')]=function(_0x57299e,_0x42c92e){var _0x127615={},_0x2ee68f={},_0x5b6920={'count':0x0,'rows':[]};var _0x2dbc7f=_[_0x65a1('0x27')](db[_0x65a1('0x28')][_0x65a1('0x29')],function(_0x201880){return{'name':_0x201880[_0x65a1('0x2a')],'type':_0x201880[_0x65a1('0x2b')][_0x65a1('0x2c')]};});_0x2ee68f[_0x65a1('0x2d')]=_[_0x65a1('0x27')](_0x2dbc7f,_0x65a1('0x25'));_0x2ee68f['query']=_[_0x65a1('0x2e')](_0x57299e[_0x65a1('0x2f')]);_0x2ee68f[_0x65a1('0x30')]=_[_0x65a1('0x31')](_0x2ee68f[_0x65a1('0x2d')],_0x2ee68f[_0x65a1('0x2f')]);_0x127615[_0x65a1('0x32')]=_['intersection'](_0x2ee68f[_0x65a1('0x2d')],qs['fields'](_0x57299e['query'][_0x65a1('0x33')]));_0x127615['attributes']=_0x127615[_0x65a1('0x32')][_0x65a1('0x34')]?_0x127615[_0x65a1('0x32')]:_0x2ee68f['model'];if(!_0x57299e['query']['hasOwnProperty'](_0x65a1('0x35'))){_0x127615[_0x65a1('0x1b')]=qs[_0x65a1('0x1b')](_0x57299e['query'][_0x65a1('0x1b')]);_0x127615[_0x65a1('0x1a')]=qs[_0x65a1('0x1a')](_0x57299e[_0x65a1('0x2f')][_0x65a1('0x1a')]);}_0x127615[_0x65a1('0x36')]=qs['sort'](_0x57299e[_0x65a1('0x2f')][_0x65a1('0x37')]);_0x127615[_0x65a1('0x38')]=qs[_0x65a1('0x30')](_[_0x65a1('0x39')](_0x57299e[_0x65a1('0x2f')],_0x2ee68f[_0x65a1('0x30')]));if(_0x57299e[_0x65a1('0x2f')][_0x65a1('0x3a')]){_0x127615['where']=_[_0x65a1('0x3b')](_0x127615[_0x65a1('0x38')],{'$or':_[_0x65a1('0x27')](_0x2dbc7f,function(_0x51a520){if(_0x51a520[_0x65a1('0x2b')]!=='VIRTUAL'){var _0x3beb32={};_0x3beb32[_0x51a520[_0x65a1('0x25')]]={'$like':'%'+_0x57299e[_0x65a1('0x2f')]['filter']+'%'};return _0x3beb32;}})});}_0x127615=_[_0x65a1('0x3b')]({},_0x127615,_0x57299e[_0x65a1('0x3c')]);var _0xd06e71={'where':_0x127615[_0x65a1('0x38')]};return db[_0x65a1('0x28')][_0x65a1('0x19')](_0xd06e71)[_0x65a1('0x21')](function(_0x4e47f1){_0x5b6920['count']=_0x4e47f1;if(_0x57299e['query'][_0x65a1('0x3d')]){_0x127615[_0x65a1('0x3e')]=[{'all':!![]}];}return db[_0x65a1('0x28')][_0x65a1('0x3f')](_0x127615);})[_0x65a1('0x21')](function(_0x14872c){_0x5b6920[_0x65a1('0x40')]=_0x14872c;return _0x5b6920;})['then'](respondWithFilteredResult(_0x42c92e,_0x127615))[_0x65a1('0x41')](handleError(_0x42c92e,null));};exports[_0x65a1('0x42')]=function(_0x3b524f,_0x443860){var _0x27ac39={'raw':!![],'where':{'id':_0x3b524f[_0x65a1('0x43')]['id']}},_0xabda30={};_0xabda30[_0x65a1('0x2d')]=_[_0x65a1('0x2e')](db[_0x65a1('0x28')][_0x65a1('0x29')]);_0xabda30[_0x65a1('0x2f')]=_['keys'](_0x3b524f[_0x65a1('0x2f')]);_0xabda30[_0x65a1('0x30')]=_['intersection'](_0xabda30[_0x65a1('0x2d')],_0xabda30[_0x65a1('0x2f')]);_0x27ac39[_0x65a1('0x32')]=_[_0x65a1('0x31')](_0xabda30['model'],qs[_0x65a1('0x33')](_0x3b524f[_0x65a1('0x2f')]['fields']));_0x27ac39['attributes']=_0x27ac39['attributes'][_0x65a1('0x34')]?_0x27ac39[_0x65a1('0x32')]:_0xabda30[_0x65a1('0x2d')];if(_0x3b524f[_0x65a1('0x2f')][_0x65a1('0x3d')]){_0x27ac39[_0x65a1('0x3e')]=[{'all':!![]}];}_0x27ac39=_[_0x65a1('0x3b')]({},_0x27ac39,_0x3b524f[_0x65a1('0x3c')]);return db[_0x65a1('0x28')]['find'](_0x27ac39)[_0x65a1('0x21')](handleEntityNotFound(_0x443860,null))[_0x65a1('0x21')](respondWithResult(_0x443860,null))['catch'](handleError(_0x443860,null));};exports[_0x65a1('0x44')]=function(_0x3a1851,_0x44fffc){return db[_0x65a1('0x28')]['create'](_0x3a1851[_0x65a1('0x45')],{})[_0x65a1('0x21')](respondWithResult(_0x44fffc,0xc9))[_0x65a1('0x41')](handleError(_0x44fffc,null));};exports[_0x65a1('0x20')]=function(_0x1cbefa,_0x2ecb30){if(_0x1cbefa['body']['id']){delete _0x1cbefa[_0x65a1('0x45')]['id'];}return db[_0x65a1('0x28')][_0x65a1('0x46')]({'where':{'id':_0x1cbefa[_0x65a1('0x43')]['id']}})[_0x65a1('0x21')](handleEntityNotFound(_0x2ecb30,null))['then'](saveUpdates(_0x1cbefa['body'],null))[_0x65a1('0x21')](respondWithResult(_0x2ecb30,null))['catch'](handleError(_0x2ecb30,null));};exports[_0x65a1('0x22')]=function(_0x214541,_0x1364fa){return db[_0x65a1('0x28')][_0x65a1('0x46')]({'where':{'id':_0x214541[_0x65a1('0x43')]['id']}})[_0x65a1('0x21')](handleEntityNotFound(_0x1364fa,null))[_0x65a1('0x21')](removeEntity(_0x1364fa,null))['catch'](handleError(_0x1364fa,null));};exports[_0x65a1('0x47')]=function(_0x55c03e,_0xc3e908){return db[_0x65a1('0x28')]['describe']()[_0x65a1('0x21')](respondWithResult(_0xc3e908,null))['catch'](handleError(_0xc3e908,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c245a44..82f4a1c 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 _0x8808=['report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceDialReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8808,0x72));var _0x8880=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8808[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x8880('0x0'));var util=require(_0x8880('0x1'));var logger=require(_0x8880('0x2'))('api');var moment=require(_0x8880('0x3'));var BPromise=require(_0x8880('0x4'));var rp=require(_0x8880('0x5'));var fs=require('fs');var path=require(_0x8880('0x6'));var rimraf=require(_0x8880('0x7'));var config=require(_0x8880('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x8880('0x9')]=function(_0x45a12e,_0xebb0a6){return _0x45a12e[_0x8880('0xa')](_0x8880('0xb'),attributes,{'tableName':_0x8880('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8880('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x240b=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','uniqueid'];(function(_0x2b292f,_0x38ec70){var _0x243207=function(_0x27a78c){while(--_0x27a78c){_0x2b292f['push'](_0x2b292f['shift']());}};_0x243207(++_0x38ec70);}(_0x240b,0xc8));var _0xb240=function(_0x2057ad,_0x960177){_0x2057ad=_0x2057ad-0x0;var _0x27598c=_0x240b[_0x2057ad];return _0x27598c;};'use strict';var _=require('lodash');var util=require(_0xb240('0x0'));var logger=require('../../config/logger')(_0xb240('0x1'));var moment=require(_0xb240('0x2'));var BPromise=require(_0xb240('0x3'));var rp=require(_0xb240('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb240('0x5'));var config=require(_0xb240('0x6'));var attributes=require(_0xb240('0x7'));module[_0xb240('0x8')]=function(_0x1c9a88,_0x3e5e03){return _0x1c9a88['define']('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xb240('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 14b5c71..8c7fa22 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 _0xf2cb=['client','http','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','then','VoiceDialReport','update','where','attributes','limit','UpdateVoiceDialReport','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xf2cb,0x130));var _0xbf2c=function(_0x35b04d,_0x3cbec5){_0x35b04d=_0x35b04d-0x0;var _0x289c51=_0xf2cb[_0x35b04d];return _0x289c51;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});}exports[_0xbf2c('0x13')]=function(_0x1df2ab){var _0x298329=this;return new Promise(function(_0x32a44d,_0x266035){return db['VoiceDialReport'][_0xbf2c('0x14')](_0x1df2ab[_0xbf2c('0x15')],{'raw':_0x1df2ab[_0xbf2c('0x16')]?_0x1df2ab[_0xbf2c('0x16')][_0xbf2c('0x17')]===undefined?!![]:![]:!![]})[_0xbf2c('0x18')](function(_0x426724){logger['info'](_0xbf2c('0x13'),_0x1df2ab);logger[_0xbf2c('0xa')](_0xbf2c('0x13'),_0x1df2ab,JSON[_0xbf2c('0xd')](_0x426724));_0x32a44d(_0x426724);})['catch'](function(_0x2bc2ad){logger[_0xbf2c('0xe')]('CreateVoiceDialReport',_0x2bc2ad[_0xbf2c('0x10')],_0x1df2ab);_0x266035(_0x298329[_0xbf2c('0xe')](0x1f4,_0x2bc2ad[_0xbf2c('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x5de1f2){var _0x31b070=this;return new Promise(function(_0x3c546d,_0xae9c7){return db[_0xbf2c('0x19')][_0xbf2c('0x1a')](_0x5de1f2[_0xbf2c('0x15')],{'raw':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2[_0xbf2c('0x16')][_0xbf2c('0x1b')]||null:null,'attributes':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2[_0xbf2c('0x16')][_0xbf2c('0x1c')]||null:null,'limit':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2[_0xbf2c('0x16')][_0xbf2c('0x1d')]||null:null})['then'](function(_0x3aeda1){logger['info'](_0xbf2c('0x1e'),_0x5de1f2);logger[_0xbf2c('0xa')](_0xbf2c('0x1e'),_0x5de1f2,JSON[_0xbf2c('0xd')](_0x3aeda1));_0x3c546d(_0x3aeda1);})[_0xbf2c('0x12')](function(_0x502943){logger[_0xbf2c('0xe')](_0xbf2c('0x1e'),_0x502943[_0xbf2c('0x10')],_0x5de1f2);_0xae9c7(_0x31b070[_0xbf2c('0xe')](0x1f4,_0x502943[_0xbf2c('0x10')]));});});}; \ No newline at end of file +var _0x5620=['CreateVoiceDialReport','create','body','options','raw','then','VoiceDialReport','where','attributes','limit','UpdateVoiceDialReport','lodash','moment','bluebird','../../config/utils','rpc','jayson/promise','client','http','request','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5620,0xbf));var _0x0562=function(_0x33be9d,_0x41618e){_0x33be9d=_0x33be9d-0x0;var _0x4a9267=_0x5620[_0x33be9d];return _0x4a9267;};'use strict';var _=require(_0x0562('0x0'));var util=require('util');var moment=require(_0x0562('0x1'));var BPromise=require(_0x0562('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0562('0x3'));var logger=require('../../config/logger')(_0x0562('0x4'));var config=require('../../config/environment');var jayson=require(_0x0562('0x5'));var client=jayson[_0x0562('0x6')][_0x0562('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x24b8d1,_0x1f218c,_0x126c04){return new BPromise(function(_0x5f47ba,_0x55e78c){return client[_0x0562('0x8')](_0x24b8d1,_0x126c04)['then'](function(_0x2a4ad9){logger[_0x0562('0x9')](_0x0562('0xa'),_0x1f218c,_0x0562('0xb'));logger[_0x0562('0xc')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1f218c,_0x0562('0xb'),JSON[_0x0562('0xd')](_0x2a4ad9));if(_0x2a4ad9[_0x0562('0xe')]){if(_0x2a4ad9[_0x0562('0xe')][_0x0562('0xf')]===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x1f218c,_0x2a4ad9[_0x0562('0xe')][_0x0562('0x10')]);return _0x55e78c(_0x2a4ad9[_0x0562('0xe')][_0x0562('0x10')]);}logger['error'](_0x0562('0xa'),_0x1f218c,_0x2a4ad9[_0x0562('0xe')][_0x0562('0x10')]);return _0x5f47ba(_0x2a4ad9[_0x0562('0xe')]['message']);}else{logger[_0x0562('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x1f218c,_0x0562('0xb'));_0x5f47ba(_0x2a4ad9[_0x0562('0x11')]['message']);}})[_0x0562('0x12')](function(_0x4ea063){logger[_0x0562('0xe')](_0x0562('0xa'),_0x1f218c,_0x4ea063);_0x55e78c(_0x4ea063);});});}exports[_0x0562('0x13')]=function(_0x554527){var _0x9dfcb6=this;return new Promise(function(_0x5d6341,_0x13cda0){return db['VoiceDialReport'][_0x0562('0x14')](_0x554527[_0x0562('0x15')],{'raw':_0x554527['options']?_0x554527[_0x0562('0x16')][_0x0562('0x17')]===undefined?!![]:![]:!![]})[_0x0562('0x18')](function(_0x90626d){logger['info'](_0x0562('0x13'),_0x554527);logger['debug']('CreateVoiceDialReport',_0x554527,JSON['stringify'](_0x90626d));_0x5d6341(_0x90626d);})['catch'](function(_0x35f245){logger[_0x0562('0xe')](_0x0562('0x13'),_0x35f245[_0x0562('0x10')],_0x554527);_0x13cda0(_0x9dfcb6[_0x0562('0xe')](0x1f4,_0x35f245['message']));});});};exports['UpdateVoiceDialReport']=function(_0x3e06ab){var _0x18a12d=this;return new Promise(function(_0x3fd020,_0x3eb41c){return db[_0x0562('0x19')]['update'](_0x3e06ab[_0x0562('0x15')],{'raw':_0x3e06ab[_0x0562('0x16')]?_0x3e06ab[_0x0562('0x16')][_0x0562('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e06ab[_0x0562('0x16')]?_0x3e06ab[_0x0562('0x16')][_0x0562('0x1a')]||null:null,'attributes':_0x3e06ab[_0x0562('0x16')]?_0x3e06ab[_0x0562('0x16')][_0x0562('0x1b')]||null:null,'limit':_0x3e06ab[_0x0562('0x16')]?_0x3e06ab['options'][_0x0562('0x1c')]||null:null})[_0x0562('0x18')](function(_0x1acaff){logger[_0x0562('0x9')]('UpdateVoiceDialReport',_0x3e06ab);logger['debug']('UpdateVoiceDialReport',_0x3e06ab,JSON['stringify'](_0x1acaff));_0x3fd020(_0x1acaff);})[_0x0562('0x12')](function(_0x4b1ad1){logger[_0x0562('0xe')](_0x0562('0x1d'),_0x4b1ad1[_0x0562('0x10')],_0x3e06ab);_0x3eb41c(_0x18a12d[_0x0562('0xe')](0x1f4,_0x4b1ad1[_0x0562('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index f54ae9f..b339abf 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 _0x929e=['isAuthenticated','/:id','show','post','/:id/applications','addApplications','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x99ecda,_0x4de2a8){var _0x5bd43f=function(_0x400277){while(--_0x400277){_0x99ecda['push'](_0x99ecda['shift']());}};_0x5bd43f(++_0x4de2a8);}(_0x929e,0xe5));var _0xe929=function(_0x3fcaba,_0x32df55){_0x3fcaba=_0x3fcaba-0x0;var _0x54ebf8=_0x929e[_0x3fcaba];return _0x54ebf8;};'use strict';var multer=require(_0xe929('0x0'));var util=require('util');var path=require(_0xe929('0x1'));var timeout=require(_0xe929('0x2'));var express=require(_0xe929('0x3'));var router=express[_0xe929('0x4')]();var auth=require(_0xe929('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe929('0x6'));var controller=require(_0xe929('0x7'));router[_0xe929('0x8')]('/',auth[_0xe929('0x9')](),controller['index']);router[_0xe929('0x8')](_0xe929('0xa'),auth[_0xe929('0x9')](),controller[_0xe929('0xb')]);router[_0xe929('0xc')]('/',auth[_0xe929('0x9')](),controller['create']);router['post'](_0xe929('0xd'),auth['isAuthenticated'](),controller[_0xe929('0xe')]);router['put'](_0xe929('0xa'),auth[_0xe929('0x9')](),controller['update']);router[_0xe929('0xf')](_0xe929('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xe929('0x10')]=router; \ No newline at end of file +var _0x55f6=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','put','update','delete','exports','path'];(function(_0x10cd9d,_0x3d2036){var _0x4a497b=function(_0x3cbcaa){while(--_0x3cbcaa){_0x10cd9d['push'](_0x10cd9d['shift']());}};_0x4a497b(++_0x3d2036);}(_0x55f6,0xaa));var _0x655f=function(_0x7f1086,_0x434356){_0x7f1086=_0x7f1086-0x0;var _0x358a47=_0x55f6[_0x7f1086];return _0x358a47;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x655f('0x0'));var timeout=require(_0x655f('0x1'));var express=require(_0x655f('0x2'));var router=express[_0x655f('0x3')]();var auth=require(_0x655f('0x4'));var interaction=require(_0x655f('0x5'));var config=require(_0x655f('0x6'));var controller=require('./voiceExtension.controller');router[_0x655f('0x7')]('/',auth[_0x655f('0x8')](),controller[_0x655f('0x9')]);router[_0x655f('0x7')](_0x655f('0xa'),auth[_0x655f('0x8')](),controller[_0x655f('0xb')]);router[_0x655f('0xc')]('/',auth[_0x655f('0x8')](),controller[_0x655f('0xd')]);router[_0x655f('0xc')](_0x655f('0xe'),auth[_0x655f('0x8')](),controller['addApplications']);router[_0x655f('0xf')](_0x655f('0xa'),auth[_0x655f('0x8')](),controller[_0x655f('0x10')]);router[_0x655f('0x11')](_0x655f('0xa'),auth[_0x655f('0x8')](),controller['destroy']);module[_0x655f('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 e20e57f..3be405c 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 _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x586dfd,_0x1df155){var _0x1f91c5=function(_0x4369fb){while(--_0x4369fb){_0x586dfd['push'](_0x586dfd['shift']());}};_0x1f91c5(++_0x1df155);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x1b5c12,_0x41169d){var _0xab4156=function(_0x43e1f4){while(--_0x43e1f4){_0x1b5c12['push'](_0x1b5c12['shift']());}};_0xab4156(++_0x41169d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index f262eb3..df2a415 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 _0x717b=['cast(priority\x20as\x20unsigned)','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','VIRTUAL','merge','options','VoiceExtension','count','includeAll','include','findAll','show','params','length','catch','create','startsWith','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','context','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate'];(function(_0x4d40d7,_0x1d2899){var _0x2f11a2=function(_0x2acfb9){while(--_0x2acfb9){_0x4d40d7['push'](_0x4d40d7['shift']());}};_0x2f11a2(++_0x1d2899);}(_0x717b,0x6a));var _0xb717=function(_0x4ea3fd,_0x256234){_0x4ea3fd=_0x4ea3fd-0x0;var _0x229d56=_0x717b[_0x4ea3fd];return _0x229d56;};'use strict';var pdf=require(_0xb717('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb717('0x1'));var zipdir=require(_0xb717('0x2'));var jsonpatch=require(_0xb717('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb717('0x4'));var Mustache=require(_0xb717('0x5'));var util=require(_0xb717('0x6'));var path=require(_0xb717('0x7'));var sox=require(_0xb717('0x8'));var csv=require('to-csv');var ejs=require(_0xb717('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb717('0xa'));var jsforce=require(_0xb717('0xb'));var deskjs=require(_0xb717('0xc'));var toCsv=require(_0xb717('0xd'));var querystring=require(_0xb717('0xe'));var Papa=require(_0xb717('0xf'));var Redis=require('ioredis');var authService=require(_0xb717('0x10'));var qs=require(_0xb717('0x11'));var as=require(_0xb717('0x12'));var hardwareService=require(_0xb717('0x13'));var logger=require(_0xb717('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb717('0x15'));var db=require('../../mysqldb')['db'];config[_0xb717('0x16')]=_[_0xb717('0x17')](config[_0xb717('0x16')],{'host':_0xb717('0x18'),'port':0x18eb});var socket=require(_0xb717('0x19'))(new Redis(config['redis']));require(_0xb717('0x1a'))['register'](socket);function respondWithStatusCode(_0x44ea29,_0x22aa27){_0x22aa27=_0x22aa27||0xcc;return function(_0x536976){if(_0x536976){return _0x44ea29[_0xb717('0x1b')](_0x22aa27);}return _0x44ea29[_0xb717('0x1c')](_0x22aa27)[_0xb717('0x1d')]();};}function respondWithResult(_0x1c950a,_0xde5735){_0xde5735=_0xde5735||0xc8;return function(_0x8ee479){if(_0x8ee479){return _0x1c950a[_0xb717('0x1c')](_0xde5735)['json'](_0x8ee479);}};}function respondWithFilteredResult(_0x3f092a,_0x83cb90){return function(_0x2cc3af){if(_0x2cc3af){var _0x4e5161=_0x2cc3af['count'],_0x29f7e5=_0x83cb90[_0xb717('0x1e')],_0x537d89=_0x83cb90[_0xb717('0x1e')]+_0x83cb90[_0xb717('0x1f')],_0x30e123;if(_0x537d89>=_0x4e5161){_0x537d89=_0x4e5161;_0x30e123=0xc8;}else{_0x30e123=0xce;}_0x3f092a['status'](_0x30e123);return _0x3f092a[_0xb717('0x20')]('Content-Range',_0x29f7e5+'-'+_0x537d89+'/'+_0x4e5161)[_0xb717('0x21')](_0x2cc3af);}return null;};}function patchUpdates(_0x11fb72){return function(_0x4e4515){try{jsonpatch[_0xb717('0x22')](_0x4e4515,_0x11fb72,!![]);}catch(_0x361e9c){return BPromise[_0xb717('0x23')](_0x361e9c);}return _0x4e4515[_0xb717('0x24')]();};}function saveUpdates(_0x427674,_0x4e3207){return function(_0x454555){if(_0x454555){return _0x454555[_0xb717('0x25')](_0x427674)['then'](function(_0x8fdd0c){return _0x8fdd0c;});}return null;};}function removeEntity(_0x4abcbc,_0x22341b){return function(_0x2e2b2d){if(_0x2e2b2d){return _0x2e2b2d[_0xb717('0x26')]()[_0xb717('0x27')](function(){var _0x57d2e8=_0x2e2b2d[_0xb717('0x28')]({'plain':!![]});var _0x5e8470=[{'name':_0xb717('0x29'),'value':'inbound','ignore':![]},{'name':_0xb717('0x2a'),'value':_0xb717('0x2b'),'ignore':![]},{'name':_0xb717('0x2c'),'value':_0xb717('0x2d'),'ignore':![]}];var _0x5999fd=_(_0x5e8470)[_0xb717('0x2e')](_0xb717('0x2f'))[_0xb717('0x30')](_0xb717('0x31'))[_0xb717('0x31')]();if(_[_0xb717('0x32')](_0x5999fd,_0x57d2e8[_0xb717('0x33')])){return;}var _0x4d80f0=_[_0xb717('0x34')](_0x5e8470,['value',_0x57d2e8[_0xb717('0x33')]])['name'];return db[_0xb717('0x35')][_0xb717('0x26')]({'where':{'type':_0x4d80f0,'resourceId':_0x57d2e8['id']}})['then'](function(){return _0x2e2b2d;});})[_0xb717('0x27')](function(){_0x4abcbc[_0xb717('0x1c')](0xcc)[_0xb717('0x1d')]();});}};}function handleEntityNotFound(_0xcd7836,_0x439443){return function(_0x10a01e){if(!_0x10a01e){_0xcd7836[_0xb717('0x1b')](0x194);}return _0x10a01e;};}function handleError(_0x3f518a,_0x3befad){_0x3befad=_0x3befad||0x1f4;return function(_0x3355b5){logger[_0xb717('0x36')](_0x3355b5[_0xb717('0x37')]);if(_0x3355b5['name']){delete _0x3355b5[_0xb717('0x38')];}_0x3f518a[_0xb717('0x1c')](_0x3befad)['send'](_0x3355b5);};}exports[_0xb717('0x39')]=function(_0x3ff5e3,_0x41dcae){var _0x536c42={},_0x1d90b9={},_0x21d146={'count':0x0,'rows':[]};var _0x527d30=_[_0xb717('0x30')](db['VoiceExtension'][_0xb717('0x3a')],function(_0x4f6cde){return{'name':_0x4f6cde[_0xb717('0x3b')],'type':_0x4f6cde[_0xb717('0x33')][_0xb717('0x3c')]};});_0x1d90b9[_0xb717('0x3d')]=_['map'](_0x527d30,_0xb717('0x38'));_0x1d90b9[_0xb717('0x3e')]=_[_0xb717('0x3f')](_0x3ff5e3[_0xb717('0x3e')]);_0x1d90b9[_0xb717('0x40')]=_[_0xb717('0x41')](_0x1d90b9[_0xb717('0x3d')],_0x1d90b9[_0xb717('0x3e')]);_0x536c42['attributes']=_[_0xb717('0x41')](_0x1d90b9['model'],qs[_0xb717('0x42')](_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x42')]));_0x536c42[_0xb717('0x43')]=_0x536c42['attributes']['length']?_0x536c42[_0xb717('0x43')]:_0x1d90b9[_0xb717('0x3d')];if(!_0x3ff5e3[_0xb717('0x3e')]['hasOwnProperty'](_0xb717('0x44'))){_0x536c42[_0xb717('0x1f')]=qs['limit'](_0x3ff5e3['query'][_0xb717('0x1f')]);_0x536c42['offset']=qs[_0xb717('0x1e')](_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x1e')]);}_0x536c42['order']=qs[_0xb717('0x45')](_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x45')]);_0x536c42[_0xb717('0x46')]=qs[_0xb717('0x40')](_[_0xb717('0x47')](_0x3ff5e3['query'],_0x1d90b9['filters']));if(_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x2e')]){_0x536c42[_0xb717('0x46')]=_['merge'](_0x536c42[_0xb717('0x46')],{'$or':_[_0xb717('0x30')](_0x527d30,function(_0x5814e9){if(_0x5814e9[_0xb717('0x33')]!==_0xb717('0x48')){var _0x55159f={};_0x55159f[_0x5814e9[_0xb717('0x38')]]={'$like':'%'+_0x3ff5e3['query'][_0xb717('0x2e')]+'%'};return _0x55159f;}})});}_0x536c42=_[_0xb717('0x49')]({},_0x536c42,_0x3ff5e3[_0xb717('0x4a')]);var _0x64715b={'where':_0x536c42['where']};return db[_0xb717('0x4b')][_0xb717('0x4c')](_0x64715b)[_0xb717('0x27')](function(_0x1a0e4f){_0x21d146['count']=_0x1a0e4f;if(_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x4d')]){_0x536c42[_0xb717('0x4e')]=[{'all':!![]}];}return db[_0xb717('0x4b')][_0xb717('0x4f')](_0x536c42);})[_0xb717('0x27')](function(_0x4a08cf){_0x21d146['rows']=_0x4a08cf;return _0x21d146;})[_0xb717('0x27')](respondWithFilteredResult(_0x41dcae,_0x536c42))['catch'](handleError(_0x41dcae,null));};exports[_0xb717('0x50')]=function(_0x4807b6,_0x5e01f5){var _0x542b5b={'raw':![],'where':{'id':_0x4807b6[_0xb717('0x51')]['id']}},_0x1fe2a2={};_0x1fe2a2[_0xb717('0x3d')]=_[_0xb717('0x3f')](db[_0xb717('0x4b')][_0xb717('0x3a')]);_0x1fe2a2[_0xb717('0x3e')]=_[_0xb717('0x3f')](_0x4807b6['query']);_0x1fe2a2[_0xb717('0x40')]=_[_0xb717('0x41')](_0x1fe2a2[_0xb717('0x3d')],_0x1fe2a2[_0xb717('0x3e')]);_0x542b5b[_0xb717('0x43')]=_[_0xb717('0x41')](_0x1fe2a2[_0xb717('0x3d')],qs[_0xb717('0x42')](_0x4807b6['query'][_0xb717('0x42')]));_0x542b5b['attributes']=_0x542b5b[_0xb717('0x43')][_0xb717('0x52')]?_0x542b5b[_0xb717('0x43')]:_0x1fe2a2['model'];if(_0x4807b6['query']['includeAll']){_0x542b5b[_0xb717('0x4e')]=[{'all':!![]}];}_0x542b5b=_[_0xb717('0x49')]({},_0x542b5b,_0x4807b6[_0xb717('0x4a')]);return db[_0xb717('0x4b')]['find'](_0x542b5b)[_0xb717('0x27')](handleEntityNotFound(_0x5e01f5,null))[_0xb717('0x27')](respondWithResult(_0x5e01f5,null))[_0xb717('0x53')](handleError(_0x5e01f5,null));};exports[_0xb717('0x26')]=function(_0x22f245,_0x4d5fa6){return db[_0xb717('0x4b')][_0xb717('0x34')]({'where':{'id':_0x22f245[_0xb717('0x51')]['id']}})[_0xb717('0x27')](handleEntityNotFound(_0x4d5fa6,null))[_0xb717('0x27')](removeEntity(_0x4d5fa6,null))[_0xb717('0x53')](handleError(_0x4d5fa6,null));};exports[_0xb717('0x54')]=function(_0x1158ee,_0x197cad){if(_0x1158ee['body'][_0xb717('0x33')]===_0xb717('0x2b')&&!_[_0xb717('0x55')](_0x1158ee[_0xb717('0x56')]['exten'],'_')){_0x1158ee[_0xb717('0x56')][_0xb717('0x57')]='_'[_0xb717('0x58')](_0x1158ee['body'][_0xb717('0x57')]);}return db[_0xb717('0x4b')]['create'](_0x1158ee[_0xb717('0x56')],{'raw':![]})[_0xb717('0x27')](function(_0x58b4c9){var _0x4b0bfe=_0x1158ee['user'][_0xb717('0x28')]({'plain':!![]});if(!_0x4b0bfe)throw new Error(_0xb717('0x59'));if(_0x4b0bfe[_0xb717('0x5a')]==='user'){var _0x457ed3=_0x58b4c9[_0xb717('0x28')]({'plain':!![]});var _0x3c82e6=[{'name':_0xb717('0x29'),'value':_0xb717('0x5b')},{'name':_0xb717('0x2a'),'value':'outbound'},{'name':_0xb717('0x2c'),'value':'internal'}];var _0x1f15b2=_[_0xb717('0x34')](_0x3c82e6,[_0xb717('0x31'),_0x457ed3[_0xb717('0x33')]])[_0xb717('0x38')];return db[_0xb717('0x5c')][_0xb717('0x34')]({'where':{'name':_0x1f15b2,'userProfileId':_0x4b0bfe['userProfileId']},'raw':!![]})[_0xb717('0x27')](function(_0x2300c2){if(_0x2300c2&&_0x2300c2['autoAssociation']===0x0){return db['UserProfileResource'][_0xb717('0x54')]({'name':_0x457ed3[_0xb717('0x38')],'resourceId':_0x457ed3['id'],'type':_0x2300c2[_0xb717('0x38')],'sectionId':_0x2300c2['id']},{})['then'](function(){return _0x58b4c9;});}else{return _0x58b4c9;}})[_0xb717('0x53')](function(_0x614cbd){logger[_0xb717('0x36')](_0xb717('0x5d'),_0x614cbd);throw _0x614cbd;});}return _0x58b4c9;})[_0xb717('0x27')](respondWithResult(_0x197cad,0xc9))[_0xb717('0x53')](handleError(_0x197cad,null));};exports[_0xb717('0x25')]=function(_0x41b751,_0x64ffa2){if(_0x41b751[_0xb717('0x56')]['id']){delete _0x41b751['body']['id'];}return db[_0xb717('0x4b')][_0xb717('0x34')]({'where':{'id':_0x41b751[_0xb717('0x51')]['id']}})[_0xb717('0x27')](handleEntityNotFound(_0x64ffa2,null))[_0xb717('0x27')](function(_0x81c83b){if(_0x81c83b){return db[_0xb717('0x4b')][_0xb717('0x25')](_[_0xb717('0x47')](_0x41b751[_0xb717('0x56')],['exten','context',_0xb717('0x5e'),_0xb717('0x5f'),_0xb717('0x60'),_0xb717('0x61')]),{'where':{'context':_0x81c83b[_0xb717('0x62')],'exten':_0x81c83b['exten']},'individualHooks':!![]})[_0xb717('0x27')](function(_0x5efe03){return _0x5efe03;});}return null;})[_0xb717('0x27')](respondWithStatusCode(_0x64ffa2,null))[_0xb717('0x53')](handleError(_0x64ffa2,null));};exports['addApplications']=function(_0x35a900,_0x2f3374,_0x12fcd1){return db[_0xb717('0x4b')][_0xb717('0x63')]({'where':{'id':_0x35a900[_0xb717('0x51')]['id']}})['then'](handleEntityNotFound(_0x2f3374,null))[_0xb717('0x27')](function(_0x217073){if(_0x217073){return db[_0xb717('0x64')][_0xb717('0x65')](function(_0x471c80){return db['VoiceExtension'][_0xb717('0x26')]({'where':{'VoiceExtensionId':_0x35a900[_0xb717('0x51')]['id']},'transaction':_0x471c80})[_0xb717('0x27')](function(_0x17ed4c){var _0x48ce28=_[_0xb717('0x30')](_0x35a900['body'],function(_0x15d9be){_0x15d9be[_0xb717('0x66')]=_0x35a900[_0xb717('0x51')]['id'];return _0x15d9be;});return db[_0xb717('0x4b')][_0xb717('0x67')](_0x48ce28,{'transaction':_0x471c80});});})[_0xb717('0x27')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x35a900[_0xb717('0x51')]['id']},'order':_0xb717('0x68')});});}})[_0xb717('0x27')](respondWithResult(_0x2f3374,null))[_0xb717('0x53')](handleError(_0x2f3374,null));}; \ No newline at end of file +var _0x83dd=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','offset','limit','Content-Range','save','destroy','then','get','InboundRoutes','OutboundRoutes','internal','filter','map','value','includes','type','find','name','UserProfileResource','error','stack','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','VIRTUAL','merge','count','includeAll','include','catch','show','options','params','create','body','outbound','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','inbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x83dd,0x18f));var _0xd83d=function(_0x3643e0,_0x1d0941){_0x3643e0=_0x3643e0-0x0;var _0x256cd1=_0x83dd[_0x3643e0];return _0x256cd1;};'use strict';var pdf=require(_0xd83d('0x0'));var emlformat=require(_0xd83d('0x1'));var rimraf=require(_0xd83d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd83d('0x3'));var rp=require(_0xd83d('0x4'));var moment=require(_0xd83d('0x5'));var BPromise=require(_0xd83d('0x6'));var Mustache=require(_0xd83d('0x7'));var util=require(_0xd83d('0x8'));var path=require(_0xd83d('0x9'));var sox=require('sox');var csv=require(_0xd83d('0xa'));var ejs=require(_0xd83d('0xb'));var fs=require('fs');var _=require(_0xd83d('0xc'));var squel=require('squel');var crypto=require(_0xd83d('0xd'));var jsforce=require(_0xd83d('0xe'));var deskjs=require(_0xd83d('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd83d('0x10'));var Papa=require(_0xd83d('0x11'));var Redis=require(_0xd83d('0x12'));var authService=require(_0xd83d('0x13'));var qs=require(_0xd83d('0x14'));var as=require(_0xd83d('0x15'));var hardwareService=require(_0xd83d('0x16'));var logger=require(_0xd83d('0x17'))(_0xd83d('0x18'));var utils=require('../../config/utils');var config=require(_0xd83d('0x19'));var db=require(_0xd83d('0x1a'))['db'];config[_0xd83d('0x1b')]=_[_0xd83d('0x1c')](config[_0xd83d('0x1b')],{'host':_0xd83d('0x1d'),'port':0x18eb});var socket=require(_0xd83d('0x1e'))(new Redis(config[_0xd83d('0x1b')]));require('./voiceExtension.socket')[_0xd83d('0x1f')](socket);function respondWithStatusCode(_0x5961fd,_0x21ab70){_0x21ab70=_0x21ab70||0xcc;return function(_0x2b9c5e){if(_0x2b9c5e){return _0x5961fd[_0xd83d('0x20')](_0x21ab70);}return _0x5961fd[_0xd83d('0x21')](_0x21ab70)['end']();};}function respondWithResult(_0x4c8fdb,_0x31ad6b){_0x31ad6b=_0x31ad6b||0xc8;return function(_0x2e35d9){if(_0x2e35d9){return _0x4c8fdb[_0xd83d('0x21')](_0x31ad6b)[_0xd83d('0x22')](_0x2e35d9);}};}function respondWithFilteredResult(_0x399aaa,_0x4991bc){return function(_0x1577f2){if(_0x1577f2){var _0x7e930e=_0x1577f2['count'],_0x138534=_0x4991bc[_0xd83d('0x23')],_0x29c66f=_0x4991bc[_0xd83d('0x23')]+_0x4991bc[_0xd83d('0x24')],_0x4fb427;if(_0x29c66f>=_0x7e930e){_0x29c66f=_0x7e930e;_0x4fb427=0xc8;}else{_0x4fb427=0xce;}_0x399aaa[_0xd83d('0x21')](_0x4fb427);return _0x399aaa['set'](_0xd83d('0x25'),_0x138534+'-'+_0x29c66f+'/'+_0x7e930e)[_0xd83d('0x22')](_0x1577f2);}return null;};}function patchUpdates(_0x520ab4){return function(_0x179447){try{jsonpatch['apply'](_0x179447,_0x520ab4,!![]);}catch(_0x34dc69){return BPromise['reject'](_0x34dc69);}return _0x179447[_0xd83d('0x26')]();};}function saveUpdates(_0x11735b,_0x1f1052){return function(_0x3250cc){if(_0x3250cc){return _0x3250cc['update'](_0x11735b)['then'](function(_0x22480d){return _0x22480d;});}return null;};}function removeEntity(_0x3b4f04,_0x23e7b8){return function(_0x26fd64){if(_0x26fd64){return _0x26fd64[_0xd83d('0x27')]()[_0xd83d('0x28')](function(){var _0x5764a0=_0x26fd64[_0xd83d('0x29')]({'plain':!![]});var _0x56d19a=[{'name':_0xd83d('0x2a'),'value':'inbound','ignore':![]},{'name':_0xd83d('0x2b'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0xd83d('0x2c'),'ignore':![]}];var _0x2f85aa=_(_0x56d19a)[_0xd83d('0x2d')]('ignore')[_0xd83d('0x2e')](_0xd83d('0x2f'))['value']();if(_[_0xd83d('0x30')](_0x2f85aa,_0x5764a0[_0xd83d('0x31')])){return;}var _0x46e5c8=_[_0xd83d('0x32')](_0x56d19a,[_0xd83d('0x2f'),_0x5764a0[_0xd83d('0x31')]])[_0xd83d('0x33')];return db[_0xd83d('0x34')][_0xd83d('0x27')]({'where':{'type':_0x46e5c8,'resourceId':_0x5764a0['id']}})[_0xd83d('0x28')](function(){return _0x26fd64;});})[_0xd83d('0x28')](function(){_0x3b4f04[_0xd83d('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d9fc0,_0x1b1372){return function(_0x4e1ab0){if(!_0x4e1ab0){_0x1d9fc0[_0xd83d('0x20')](0x194);}return _0x4e1ab0;};}function handleError(_0x229217,_0x15d060){_0x15d060=_0x15d060||0x1f4;return function(_0x2b42f3){logger[_0xd83d('0x35')](_0x2b42f3[_0xd83d('0x36')]);if(_0x2b42f3[_0xd83d('0x33')]){delete _0x2b42f3[_0xd83d('0x33')];}_0x229217[_0xd83d('0x21')](_0x15d060)['send'](_0x2b42f3);};}exports[_0xd83d('0x37')]=function(_0x3103ff,_0x41a766){var _0x32018c={},_0x3139b0={},_0x1d9081={'count':0x0,'rows':[]};var _0x4b5dde=_[_0xd83d('0x2e')](db[_0xd83d('0x38')][_0xd83d('0x39')],function(_0x5f02ce){return{'name':_0x5f02ce[_0xd83d('0x3a')],'type':_0x5f02ce[_0xd83d('0x31')][_0xd83d('0x3b')]};});_0x3139b0[_0xd83d('0x3c')]=_['map'](_0x4b5dde,'name');_0x3139b0[_0xd83d('0x3d')]=_[_0xd83d('0x3e')](_0x3103ff['query']);_0x3139b0['filters']=_[_0xd83d('0x3f')](_0x3139b0[_0xd83d('0x3c')],_0x3139b0[_0xd83d('0x3d')]);_0x32018c[_0xd83d('0x40')]=_['intersection'](_0x3139b0[_0xd83d('0x3c')],qs[_0xd83d('0x41')](_0x3103ff[_0xd83d('0x3d')][_0xd83d('0x41')]));_0x32018c[_0xd83d('0x40')]=_0x32018c[_0xd83d('0x40')][_0xd83d('0x42')]?_0x32018c[_0xd83d('0x40')]:_0x3139b0[_0xd83d('0x3c')];if(!_0x3103ff[_0xd83d('0x3d')]['hasOwnProperty'](_0xd83d('0x43'))){_0x32018c[_0xd83d('0x24')]=qs[_0xd83d('0x24')](_0x3103ff[_0xd83d('0x3d')][_0xd83d('0x24')]);_0x32018c[_0xd83d('0x23')]=qs['offset'](_0x3103ff[_0xd83d('0x3d')][_0xd83d('0x23')]);}_0x32018c[_0xd83d('0x44')]=qs[_0xd83d('0x45')](_0x3103ff[_0xd83d('0x3d')]['sort']);_0x32018c[_0xd83d('0x46')]=qs[_0xd83d('0x47')](_['pick'](_0x3103ff[_0xd83d('0x3d')],_0x3139b0['filters']));if(_0x3103ff[_0xd83d('0x3d')][_0xd83d('0x2d')]){_0x32018c[_0xd83d('0x46')]=_['merge'](_0x32018c[_0xd83d('0x46')],{'$or':_[_0xd83d('0x2e')](_0x4b5dde,function(_0x43d01f){if(_0x43d01f[_0xd83d('0x31')]!==_0xd83d('0x48')){var _0x4ee625={};_0x4ee625[_0x43d01f[_0xd83d('0x33')]]={'$like':'%'+_0x3103ff['query'][_0xd83d('0x2d')]+'%'};return _0x4ee625;}})});}_0x32018c=_[_0xd83d('0x49')]({},_0x32018c,_0x3103ff['options']);var _0x5d7b22={'where':_0x32018c['where']};return db[_0xd83d('0x38')][_0xd83d('0x4a')](_0x5d7b22)[_0xd83d('0x28')](function(_0x37b4ca){_0x1d9081['count']=_0x37b4ca;if(_0x3103ff['query'][_0xd83d('0x4b')]){_0x32018c[_0xd83d('0x4c')]=[{'all':!![]}];}return db[_0xd83d('0x38')]['findAll'](_0x32018c);})[_0xd83d('0x28')](function(_0x4ce731){_0x1d9081['rows']=_0x4ce731;return _0x1d9081;})[_0xd83d('0x28')](respondWithFilteredResult(_0x41a766,_0x32018c))[_0xd83d('0x4d')](handleError(_0x41a766,null));};exports[_0xd83d('0x4e')]=function(_0x4a9009,_0x29b5d8){var _0x563ba6={'raw':![],'where':{'id':_0x4a9009['params']['id']}},_0xf0af93={};_0xf0af93[_0xd83d('0x3c')]=_[_0xd83d('0x3e')](db[_0xd83d('0x38')]['rawAttributes']);_0xf0af93[_0xd83d('0x3d')]=_[_0xd83d('0x3e')](_0x4a9009[_0xd83d('0x3d')]);_0xf0af93[_0xd83d('0x47')]=_[_0xd83d('0x3f')](_0xf0af93['model'],_0xf0af93[_0xd83d('0x3d')]);_0x563ba6['attributes']=_[_0xd83d('0x3f')](_0xf0af93[_0xd83d('0x3c')],qs[_0xd83d('0x41')](_0x4a9009[_0xd83d('0x3d')][_0xd83d('0x41')]));_0x563ba6[_0xd83d('0x40')]=_0x563ba6[_0xd83d('0x40')]['length']?_0x563ba6[_0xd83d('0x40')]:_0xf0af93[_0xd83d('0x3c')];if(_0x4a9009['query'][_0xd83d('0x4b')]){_0x563ba6[_0xd83d('0x4c')]=[{'all':!![]}];}_0x563ba6=_['merge']({},_0x563ba6,_0x4a9009[_0xd83d('0x4f')]);return db[_0xd83d('0x38')][_0xd83d('0x32')](_0x563ba6)[_0xd83d('0x28')](handleEntityNotFound(_0x29b5d8,null))['then'](respondWithResult(_0x29b5d8,null))[_0xd83d('0x4d')](handleError(_0x29b5d8,null));};exports['destroy']=function(_0x92dc5a,_0x3bbeaf){return db[_0xd83d('0x38')][_0xd83d('0x32')]({'where':{'id':_0x92dc5a[_0xd83d('0x50')]['id']}})[_0xd83d('0x28')](handleEntityNotFound(_0x3bbeaf,null))[_0xd83d('0x28')](removeEntity(_0x3bbeaf,null))[_0xd83d('0x4d')](handleError(_0x3bbeaf,null));};exports[_0xd83d('0x51')]=function(_0x2bd1b0,_0x552f57){if(_0x2bd1b0[_0xd83d('0x52')]['type']===_0xd83d('0x53')&&!_[_0xd83d('0x54')](_0x2bd1b0['body'][_0xd83d('0x55')],'_')){_0x2bd1b0[_0xd83d('0x52')][_0xd83d('0x55')]='_'[_0xd83d('0x56')](_0x2bd1b0[_0xd83d('0x52')][_0xd83d('0x55')]);}return db[_0xd83d('0x38')][_0xd83d('0x51')](_0x2bd1b0[_0xd83d('0x52')],{'raw':![]})['then'](function(_0x30d364){var _0x42dbcb=_0x2bd1b0['user'][_0xd83d('0x29')]({'plain':!![]});if(!_0x42dbcb)throw new Error(_0xd83d('0x57'));if(_0x42dbcb['role']===_0xd83d('0x58')){var _0x43f059=_0x30d364[_0xd83d('0x29')]({'plain':!![]});var _0x18fcb0=[{'name':'InboundRoutes','value':_0xd83d('0x59')},{'name':_0xd83d('0x2b'),'value':_0xd83d('0x53')},{'name':'InternalRoutes','value':_0xd83d('0x2c')}];var _0x41c069=_['find'](_0x18fcb0,[_0xd83d('0x2f'),_0x43f059['type']])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x41c069,'userProfileId':_0x42dbcb['userProfileId']},'raw':!![]})['then'](function(_0x324843){if(_0x324843&&_0x324843[_0xd83d('0x5a')]===0x0){return db[_0xd83d('0x34')][_0xd83d('0x51')]({'name':_0x43f059[_0xd83d('0x33')],'resourceId':_0x43f059['id'],'type':_0x324843['name'],'sectionId':_0x324843['id']},{})[_0xd83d('0x28')](function(){return _0x30d364;});}else{return _0x30d364;}})[_0xd83d('0x4d')](function(_0x1e8c2d){logger[_0xd83d('0x35')](_0xd83d('0x5b'),_0x1e8c2d);throw _0x1e8c2d;});}return _0x30d364;})['then'](respondWithResult(_0x552f57,0xc9))[_0xd83d('0x4d')](handleError(_0x552f57,null));};exports[_0xd83d('0x5c')]=function(_0x2cc6fb,_0x358e83){if(_0x2cc6fb['body']['id']){delete _0x2cc6fb[_0xd83d('0x52')]['id'];}return db[_0xd83d('0x38')][_0xd83d('0x32')]({'where':{'id':_0x2cc6fb[_0xd83d('0x50')]['id']}})[_0xd83d('0x28')](handleEntityNotFound(_0x358e83,null))['then'](function(_0x417482){if(_0x417482){return db[_0xd83d('0x38')][_0xd83d('0x5c')](_[_0xd83d('0x5d')](_0x2cc6fb[_0xd83d('0x52')],[_0xd83d('0x55'),_0xd83d('0x5e'),_0xd83d('0x5f'),_0xd83d('0x60'),_0xd83d('0x61'),_0xd83d('0x62')]),{'where':{'context':_0x417482[_0xd83d('0x5e')],'exten':_0x417482[_0xd83d('0x55')]},'individualHooks':!![]})['then'](function(_0x2996c6){return _0x2996c6;});}return null;})[_0xd83d('0x28')](respondWithStatusCode(_0x358e83,null))[_0xd83d('0x4d')](handleError(_0x358e83,null));};exports[_0xd83d('0x63')]=function(_0x46216e,_0x13010d,_0x16b996){return db['VoiceExtension'][_0xd83d('0x64')]({'where':{'id':_0x46216e[_0xd83d('0x50')]['id']}})[_0xd83d('0x28')](handleEntityNotFound(_0x13010d,null))['then'](function(_0x5adeb2){if(_0x5adeb2){return db['sequelize'][_0xd83d('0x65')](function(_0x5ebd50){return db[_0xd83d('0x38')][_0xd83d('0x27')]({'where':{'VoiceExtensionId':_0x46216e[_0xd83d('0x50')]['id']},'transaction':_0x5ebd50})[_0xd83d('0x28')](function(_0x4deb98){var _0x1e9d26=_['map'](_0x46216e[_0xd83d('0x52')],function(_0x5c33f8){_0x5c33f8[_0xd83d('0x66')]=_0x46216e[_0xd83d('0x50')]['id'];return _0x5c33f8;});return db[_0xd83d('0x38')][_0xd83d('0x67')](_0x1e9d26,{'transaction':_0x5ebd50});});})[_0xd83d('0x28')](function(){return db['VoiceExtension'][_0xd83d('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x46216e[_0xd83d('0x50')]['id']},'order':_0xd83d('0x69')});});}})[_0xd83d('0x28')](respondWithResult(_0x13010d,null))[_0xd83d('0x4d')](handleError(_0x13010d,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index e734ece..0b03267 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 _0xbdc2=['events','../../mysqldb','VoiceExtension','setMaxListeners','remove','emit','hook','exports'];(function(_0x9199fd,_0x30f6a0){var _0x38b519=function(_0x20c5d2){while(--_0x20c5d2){_0x9199fd['push'](_0x9199fd['shift']());}};_0x38b519(++_0x30f6a0);}(_0xbdc2,0x148));var _0x2bdc=function(_0x40378a,_0x52309f){_0x40378a=_0x40378a-0x0;var _0x50fcb9=_0xbdc2[_0x40378a];return _0x50fcb9;};'use strict';var EventEmitter=require(_0x2bdc('0x0'));var VoiceExtension=require(_0x2bdc('0x1'))['db'][_0x2bdc('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2bdc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2bdc('0x4')};function emitEvent(_0x1d9116){return function(_0x522434,_0x1855bd,_0x378db8){VoiceExtensionEvents['emit'](_0x1d9116+':'+_0x522434['id'],_0x522434);VoiceExtensionEvents[_0x2bdc('0x5')](_0x1d9116,_0x522434);_0x378db8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x2bdc('0x6')](e,emitEvent(event));}}module[_0x2bdc('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xbb94=['emit','hasOwnProperty','hook','exports','events','save','remove'];(function(_0x684ef0,_0x5c1b30){var _0x207263=function(_0x5f0798){while(--_0x5f0798){_0x684ef0['push'](_0x684ef0['shift']());}};_0x207263(++_0x5c1b30);}(_0xbb94,0xa5));var _0x4bb9=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbb94[_0x3ab51d];return _0x29a04e;};'use strict';var EventEmitter=require(_0x4bb9('0x0'));var VoiceExtension=require('../../mysqldb')['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4bb9('0x1'),'afterUpdate':'update','afterDestroy':_0x4bb9('0x2')};function emitEvent(_0x5874f0){return function(_0x3c1f2d,_0x2480b3,_0x380967){VoiceExtensionEvents[_0x4bb9('0x3')](_0x5874f0+':'+_0x3c1f2d['id'],_0x3c1f2d);VoiceExtensionEvents[_0x4bb9('0x3')](_0x5874f0,_0x3c1f2d);_0x380967(null);};}for(var e in events){if(events[_0x4bb9('0x4')](e)){var event=events[e];VoiceExtension[_0x4bb9('0x5')](e,emitEvent(event));}}module[_0x4bb9('0x6')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 3c7e119..54a6884 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 _0xd3d7=['moment','bluebird','path','rimraf','../../config/environment','define','voice_extensions','util','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd3d7,0x18a));var _0x7d3d=function(_0x4ca9ef,_0x17f94b){_0x4ca9ef=_0x4ca9ef-0x0;var _0x4d0618=_0xd3d7[_0x4ca9ef];return _0x4d0618;};'use strict';var _=require('lodash');var util=require(_0x7d3d('0x0'));var logger=require('../../config/logger')(_0x7d3d('0x1'));var moment=require(_0x7d3d('0x2'));var BPromise=require(_0x7d3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d3d('0x4'));var rimraf=require(_0x7d3d('0x5'));var config=require(_0x7d3d('0x6'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x5c2da3,_0x415bdf){return _0x5c2da3[_0x7d3d('0x7')]('VoiceExtension',attributes,{'tableName':_0x7d3d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x311f=['define','VoiceExtension','voice_extensions','lodash','util','moment','bluebird','request-promise','path','rimraf','./voiceExtension.attributes'];(function(_0x14e79f,_0x57fee7){var _0x1e00a8=function(_0x2bdc22){while(--_0x2bdc22){_0x14e79f['push'](_0x14e79f['shift']());}};_0x1e00a8(++_0x57fee7);}(_0x311f,0x116));var _0xf311=function(_0xfe0d96,_0x595dd0){_0xfe0d96=_0xfe0d96-0x0;var _0x4ffd30=_0x311f[_0xfe0d96];return _0x4ffd30;};'use strict';var _=require(_0xf311('0x0'));var util=require(_0xf311('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf311('0x2'));var BPromise=require(_0xf311('0x3'));var rp=require(_0xf311('0x4'));var fs=require('fs');var path=require(_0xf311('0x5'));var rimraf=require(_0xf311('0x6'));var config=require('../../config/environment');var attributes=require(_0xf311('0x7'));module['exports']=function(_0x217411,_0x51be04){return _0x217411[_0xf311('0x8')](_0xf311('0x9'),attributes,{'tableName':_0xf311('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 027ac2f..3a8a7f2 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 _0x5f46=['include','map','model','debug','stringify','lodash','util','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','findAll','options','raw','attributes','limit'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x5f46,0x105));var _0x65f4=function(_0x8e5a76,_0x1b3de2){_0x8e5a76=_0x8e5a76-0x0;var _0x22d091=_0x5f46[_0x8e5a76];return _0x22d091;};'use strict';var _=require(_0x65f4('0x0'));var util=require(_0x65f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65f4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x65f4('0x3'));var logger=require(_0x65f4('0x4'))('rpc');var config=require(_0x65f4('0x5'));var jayson=require(_0x65f4('0x6'));var client=jayson['client'][_0x65f4('0x7')]({'port':0x232a});config[_0x65f4('0x8')]=_[_0x65f4('0x9')](config[_0x65f4('0x8')],{'host':_0x65f4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f4('0x8')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x5beefb,_0x383973,_0x167e2c){return new BPromise(function(_0x2ca8f9,_0x30f70e){return client['request'](_0x5beefb,_0x167e2c)[_0x65f4('0xb')](function(_0x4cd16f){logger[_0x65f4('0xc')](_0x65f4('0xd'),_0x383973,_0x65f4('0xe'));logger['debug'](_0x65f4('0xf'),_0x383973,_0x65f4('0xe'),JSON['stringify'](_0x4cd16f));if(_0x4cd16f[_0x65f4('0x10')]){if(_0x4cd16f['error'][_0x65f4('0x11')]===0x1f4){logger[_0x65f4('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x383973,_0x4cd16f[_0x65f4('0x10')][_0x65f4('0x12')]);return _0x30f70e(_0x4cd16f['error']['message']);}logger['error'](_0x65f4('0xd'),_0x383973,_0x4cd16f['error']['message']);return _0x2ca8f9(_0x4cd16f[_0x65f4('0x10')][_0x65f4('0x12')]);}else{logger[_0x65f4('0xc')]('VoiceExtension,\x20%s,\x20%s',_0x383973,_0x65f4('0xe'));_0x2ca8f9(_0x4cd16f[_0x65f4('0x13')][_0x65f4('0x12')]);}})[_0x65f4('0x14')](function(_0x455200){logger[_0x65f4('0x10')](_0x65f4('0xd'),_0x383973,_0x455200);_0x30f70e(_0x455200);});});}exports[_0x65f4('0x15')]=function(_0x534d23){var _0xbe6d31=this;return new Promise(function(_0x289294,_0x50fb54){return db['VoiceExtension'][_0x65f4('0x16')]({'raw':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')][_0x65f4('0x18')]===undefined?!![]:![]:!![],'where':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')]['where']||null:null,'attributes':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')][_0x65f4('0x19')]||null:null,'limit':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')][_0x65f4('0x1a')]||null:null,'include':_0x534d23['options']?_0x534d23['options'][_0x65f4('0x1b')]?_[_0x65f4('0x1c')](_0x534d23['options']['include'],function(_0x441df0){return{'model':db[_0x441df0['model']],'as':_0x441df0['as'],'attributes':_0x441df0['attributes'],'include':_0x441df0[_0x65f4('0x1b')]?_[_0x65f4('0x1c')](_0x441df0[_0x65f4('0x1b')],function(_0x54b611){return{'model':db[_0x54b611[_0x65f4('0x1d')]],'as':_0x54b611['as'],'attributes':_0x54b611[_0x65f4('0x19')],'include':_0x54b611[_0x65f4('0x1b')]?_[_0x65f4('0x1c')](_0x54b611[_0x65f4('0x1b')],function(_0x13d7ea){return{'model':db[_0x13d7ea['model']],'as':_0x13d7ea['as'],'attributes':_0x13d7ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f4('0xb')](function(_0x1d4424){logger[_0x65f4('0xc')](_0x65f4('0x15'),_0x534d23);logger[_0x65f4('0x1e')](_0x65f4('0x15'),_0x534d23,JSON[_0x65f4('0x1f')](_0x1d4424));_0x289294(_0x1d4424);})[_0x65f4('0x14')](function(_0x21ecae){logger[_0x65f4('0x10')](_0x65f4('0x15'),_0x21ecae[_0x65f4('0x12')],_0x534d23);_0x50fb54(_0xbe6d31[_0x65f4('0x10')](0x1f4,_0x21ecae[_0x65f4('0x12')]));});});}; \ No newline at end of file +var _0x9884=['include','model','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','map'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x9884,0x1ef));var _0x4988=function(_0x535a51,_0x2d278c){_0x535a51=_0x535a51-0x0;var _0x20d72d=_0x9884[_0x535a51];return _0x20d72d;};'use strict';var _=require(_0x4988('0x0'));var util=require(_0x4988('0x1'));var moment=require('moment');var BPromise=require(_0x4988('0x2'));var rs=require(_0x4988('0x3'));var fs=require('fs');var Redis=require(_0x4988('0x4'));var db=require(_0x4988('0x5'))['db'];var utils=require(_0x4988('0x6'));var logger=require('../../config/logger')(_0x4988('0x7'));var config=require(_0x4988('0x8'));var jayson=require(_0x4988('0x9'));var client=jayson[_0x4988('0xa')][_0x4988('0xb')]({'port':0x232a});config['redis']=_[_0x4988('0xc')](config[_0x4988('0xd')],{'host':_0x4988('0xe'),'port':0x18eb});var socket=require(_0x4988('0xf'))(new Redis(config['redis']));require(_0x4988('0x10'))[_0x4988('0x11')](socket);function respondWithRpcPromise(_0x4c2b44,_0x54506a,_0x1ed508){return new BPromise(function(_0x32572c,_0x1f4d2c){return client[_0x4988('0x12')](_0x4c2b44,_0x1ed508)[_0x4988('0x13')](function(_0x1bf040){logger['info'](_0x4988('0x14'),_0x54506a,_0x4988('0x15'));logger[_0x4988('0x16')](_0x4988('0x17'),_0x54506a,_0x4988('0x15'),JSON[_0x4988('0x18')](_0x1bf040));if(_0x1bf040[_0x4988('0x19')]){if(_0x1bf040[_0x4988('0x19')][_0x4988('0x1a')]===0x1f4){logger[_0x4988('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x54506a,_0x1bf040['error'][_0x4988('0x1b')]);return _0x1f4d2c(_0x1bf040[_0x4988('0x19')][_0x4988('0x1b')]);}logger[_0x4988('0x19')](_0x4988('0x14'),_0x54506a,_0x1bf040[_0x4988('0x19')][_0x4988('0x1b')]);return _0x32572c(_0x1bf040[_0x4988('0x19')][_0x4988('0x1b')]);}else{logger['info'](_0x4988('0x14'),_0x54506a,_0x4988('0x15'));_0x32572c(_0x1bf040[_0x4988('0x1c')][_0x4988('0x1b')]);}})[_0x4988('0x1d')](function(_0x192a37){logger[_0x4988('0x19')](_0x4988('0x14'),_0x54506a,_0x192a37);_0x1f4d2c(_0x192a37);});});}exports[_0x4988('0x1e')]=function(_0x4d6cec){var _0x30a599=this;return new Promise(function(_0x35dcf6,_0x4493cf){return db[_0x4988('0x1f')]['findAll']({'raw':_0x4d6cec[_0x4988('0x20')]?_0x4d6cec[_0x4988('0x20')][_0x4988('0x21')]===undefined?!![]:![]:!![],'where':_0x4d6cec['options']?_0x4d6cec['options'][_0x4988('0x22')]||null:null,'attributes':_0x4d6cec[_0x4988('0x20')]?_0x4d6cec[_0x4988('0x20')][_0x4988('0x23')]||null:null,'limit':_0x4d6cec[_0x4988('0x20')]?_0x4d6cec[_0x4988('0x20')][_0x4988('0x24')]||null:null,'include':_0x4d6cec[_0x4988('0x20')]?_0x4d6cec[_0x4988('0x20')]['include']?_[_0x4988('0x25')](_0x4d6cec[_0x4988('0x20')]['include'],function(_0x1e440e){return{'model':db[_0x1e440e['model']],'as':_0x1e440e['as'],'attributes':_0x1e440e['attributes'],'include':_0x1e440e[_0x4988('0x26')]?_[_0x4988('0x25')](_0x1e440e[_0x4988('0x26')],function(_0x2f03f8){return{'model':db[_0x2f03f8['model']],'as':_0x2f03f8['as'],'attributes':_0x2f03f8[_0x4988('0x23')],'include':_0x2f03f8['include']?_[_0x4988('0x25')](_0x2f03f8[_0x4988('0x26')],function(_0x2ad9ee){return{'model':db[_0x2ad9ee[_0x4988('0x27')]],'as':_0x2ad9ee['as'],'attributes':_0x2ad9ee[_0x4988('0x23')]};}):[]};}):[]};}):[]:[]})[_0x4988('0x13')](function(_0x3b5493){logger[_0x4988('0x28')]('GetVoiceExtension',_0x4d6cec);logger['debug'](_0x4988('0x1e'),_0x4d6cec,JSON[_0x4988('0x18')](_0x3b5493));_0x35dcf6(_0x3b5493);})['catch'](function(_0x526aad){logger[_0x4988('0x19')](_0x4988('0x1e'),_0x526aad[_0x4988('0x1b')],_0x4d6cec);_0x4493cf(_0x30a599[_0x4988('0x19')](0x1f4,_0x526aad[_0x4988('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index f764388..0791594 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 _0x22c2=['update','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x3c3e8e,_0x3a9f14){var _0x224ee1=function(_0x4c8792){while(--_0x4c8792){_0x3c3e8e['push'](_0x3c3e8e['shift']());}};_0x224ee1(++_0x3a9f14);}(_0x22c2,0xa5));var _0x222c=function(_0x4bd5a1,_0x14b47f){_0x4bd5a1=_0x4bd5a1-0x0;var _0xa5445=_0x22c2[_0x4bd5a1];return _0xa5445;};'use strict';var VoiceExtensionEvents=require(_0x222c('0x0'));var events=[_0x222c('0x1'),_0x222c('0x2'),_0x222c('0x3')];function createListener(_0x5f1ed0,_0x1fa476){return function(_0x5d1fb3){_0x1fa476['emit'](_0x5f1ed0,_0x5d1fb3);};}function removeListener(_0x42bde6,_0x330254){return function(){VoiceExtensionEvents['removeListener'](_0x42bde6,_0x330254);};}exports[_0x222c('0x4')]=function(_0x71e240){for(var _0x2ce7f1=0x0,_0x371dc6=events[_0x222c('0x5')];_0x2ce7f1<_0x371dc6;_0x2ce7f1++){var _0x3f72f4=events[_0x2ce7f1];var _0x5a28cb=createListener(_0x222c('0x6')+_0x3f72f4,_0x71e240);VoiceExtensionEvents['on'](_0x3f72f4,_0x5a28cb);}}; \ No newline at end of file +var _0xe93f=['removeListener','register','length','voiceExtension:','save','remove','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe93f,0x193));var _0xfe93=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe93f[_0x3dd15e];return _0x231fd0;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0xfe93('0x0'),_0xfe93('0x1'),_0xfe93('0x2')];function createListener(_0x515f1f,_0x12f1d3){return function(_0x78fd31){_0x12f1d3['emit'](_0x515f1f,_0x78fd31);};}function removeListener(_0x4df912,_0x16432d){return function(){VoiceExtensionEvents[_0xfe93('0x3')](_0x4df912,_0x16432d);};}exports[_0xfe93('0x4')]=function(_0x17c1e0){for(var _0x4c060d=0x0,_0x494764=events[_0xfe93('0x5')];_0x4c060d<_0x494764;_0x4c060d++){var _0x3e9d1f=events[_0x4c060d];var _0x302ca3=createListener(_0xfe93('0x6')+_0x3e9d1f,_0x17c1e0);VoiceExtensionEvents['on'](_0x3e9d1f,_0x302ca3);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index e3ea507..09666c4 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 _0x9045=['show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x251ab0,_0x46e532){var _0x11848c=function(_0x78e3a2){while(--_0x78e3a2){_0x251ab0['push'](_0x251ab0['shift']());}};_0x11848c(++_0x46e532);}(_0x9045,0x119));var _0x5904=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x9045[_0x134c2e];return _0x2825db;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5904('0x0'));var timeout=require(_0x5904('0x1'));var express=require(_0x5904('0x2'));var router=express[_0x5904('0x3')]();var auth=require(_0x5904('0x4'));var interaction=require(_0x5904('0x5'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x5904('0x6')]('/',auth[_0x5904('0x7')](),controller['index']);router[_0x5904('0x6')]('/:id',auth[_0x5904('0x7')](),controller[_0x5904('0x8')]);router['get']('/:id/messages',auth[_0x5904('0x7')](),controller['getMessages']);router[_0x5904('0x9')]('/',auth[_0x5904('0x7')](),controller[_0x5904('0xa')]);router[_0x5904('0xb')](_0x5904('0xc'),auth[_0x5904('0x7')](),controller[_0x5904('0xd')]);router[_0x5904('0xe')](_0x5904('0xc'),auth[_0x5904('0x7')](),controller[_0x5904('0xf')]);module[_0x5904('0x10')]=router; \ No newline at end of file +var _0x3f48=['update','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','./voiceMail.controller','isAuthenticated','index','/:id','get','/:id/messages','getMessages','create','put'];(function(_0x5e6f23,_0x34c4f8){var _0x433acd=function(_0x15a6f9){while(--_0x15a6f9){_0x5e6f23['push'](_0x5e6f23['shift']());}};_0x433acd(++_0x34c4f8);}(_0x3f48,0x18f));var _0x83f4=function(_0x2dfb1c,_0x1a574d){_0x2dfb1c=_0x2dfb1c-0x0;var _0x225a56=_0x3f48[_0x2dfb1c];return _0x225a56;};'use strict';var multer=require(_0x83f4('0x0'));var util=require(_0x83f4('0x1'));var path=require(_0x83f4('0x2'));var timeout=require('connect-timeout');var express=require(_0x83f4('0x3'));var router=express[_0x83f4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x83f4('0x5'));var config=require('../../config/environment');var controller=require(_0x83f4('0x6'));router['get']('/',auth[_0x83f4('0x7')](),controller[_0x83f4('0x8')]);router['get'](_0x83f4('0x9'),auth[_0x83f4('0x7')](),controller['show']);router[_0x83f4('0xa')](_0x83f4('0xb'),auth['isAuthenticated'](),controller[_0x83f4('0xc')]);router['post']('/',auth[_0x83f4('0x7')](),controller[_0x83f4('0xd')]);router[_0x83f4('0xe')]('/:id',auth[_0x83f4('0x7')](),controller[_0x83f4('0xf')]);router['delete']('/:id',auth[_0x83f4('0x7')](),controller[_0x83f4('0x10')]);module[_0x83f4('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 8ccf806..1fff19f 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 _0x4213=['trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x4a3559,_0x42c32e){var _0xd8982e=function(_0x324cc2){while(--_0x324cc2){_0x4a3559['push'](_0x4a3559['shift']());}};_0xd8982e(++_0x42c32e);}(_0x4213,0x77));var _0x3421=function(_0x32320a,_0x5b9b6f){_0x32320a=_0x32320a-0x0;var _0x505d3e=_0x4213[_0x32320a];return _0x505d3e;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'customer_id':{'type':Sequelize[_0x3421('0x2')]},'context':{'type':Sequelize[_0x3421('0x2')],'defaultValue':_0x3421('0x3'),'unique':_0x3421('0x4')},'mailbox':{'type':Sequelize[_0x3421('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x3421('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3421('0x2')],'validate':{'isEmail':!![]},'set':function(_0xfe969c){this[_0x3421('0x5')](_0x3421('0x6'),typeof _0xfe969c==='string'&&_0xfe969c[_0x3421('0x7')]()?_0xfe969c[_0x3421('0x7')]():null);}},'pager':{'type':Sequelize[_0x3421('0x2')]},'tz':{'type':Sequelize[_0x3421('0x2')],'defaultValue':_0x3421('0x8')},'attach':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x3421('0x2')]},'callback':{'type':Sequelize[_0x3421('0x2')]},'review':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3421('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3421('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':_0x3421('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x3421('0x2')]},'emailbody':{'type':Sequelize[_0x3421('0x2')]},'maxsecs':{'type':Sequelize[_0x3421('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3421('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3421('0xd')],'get':function(){return this[_0x3421('0xe')](_0x3421('0xf'))+_0x3421('0x10')+this[_0x3421('0xe')](_0x3421('0x11'));}}}; \ No newline at end of file +var _0x9348=['exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','VIRTUAL','fullname','\x20-\x20','getDataValue','mailbox','sequelize'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9348,0x10d));var _0x8934=function(_0x4d0296,_0x4a7336){_0x4d0296=_0x4d0296-0x0;var _0x431efe=_0x9348[_0x4d0296];return _0x431efe;};'use strict';var Sequelize=require(_0x8934('0x0'));module[_0x8934('0x1')]={'customer_id':{'type':Sequelize[_0x8934('0x2')]},'context':{'type':Sequelize[_0x8934('0x2')],'defaultValue':_0x8934('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize[_0x8934('0x2')],'defaultValue':'','allowNull':![],'unique':_0x8934('0x4')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x8934('0x2')]},'email':{'type':Sequelize[_0x8934('0x2')],'validate':{'isEmail':!![]},'set':function(_0xefbef9){this[_0x8934('0x5')](_0x8934('0x6'),typeof _0xefbef9===_0x8934('0x7')&&_0xefbef9['trim']()?_0xefbef9[_0x8934('0x8')]():null);}},'pager':{'type':Sequelize[_0x8934('0x2')]},'tz':{'type':Sequelize[_0x8934('0x2')],'defaultValue':'central'},'attach':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x8934('0x9')]('yes','no'),'defaultValue':_0x8934('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x8934('0x2')]},'callback':{'type':Sequelize[_0x8934('0x2')]},'review':{'type':Sequelize[_0x8934('0x9')](_0x8934('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x8934('0x9')](_0x8934('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x8934('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x8934('0x9')](_0x8934('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x8934('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x8934('0x9')](_0x8934('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x8934('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x8934('0x9')](_0x8934('0xa'),'no'),'defaultValue':_0x8934('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x8934('0x9')](_0x8934('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x8934('0x9')](_0x8934('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x8934('0x9')]('yes','no'),'defaultValue':_0x8934('0xa'),'allowNull':![]},'stamp':{'type':_0x8934('0xc')},'emailsubject':{'type':Sequelize[_0x8934('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x8934('0xd')],'get':function(){return this['getDataValue'](_0x8934('0xe'))+_0x8934('0xf')+this[_0x8934('0x10')](_0x8934('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index ca1c8da..6183b10 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 _0xda51=['VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Voicemails','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','error','stack','name','send','index','map'];(function(_0x39e33f,_0x1b9dd9){var _0x4eefe1=function(_0x8378f4){while(--_0x8378f4){_0x39e33f['push'](_0x39e33f['shift']());}};_0x4eefe1(++_0x1b9dd9);}(_0xda51,0x7f));var _0x1da5=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xda51[_0x235482];return _0x5f5bea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1da5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1da5('0x1'));var BPromise=require(_0x1da5('0x2'));var Mustache=require(_0x1da5('0x3'));var util=require(_0x1da5('0x4'));var path=require(_0x1da5('0x5'));var sox=require(_0x1da5('0x6'));var csv=require(_0x1da5('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1da5('0x8'));var squel=require('squel');var crypto=require(_0x1da5('0x9'));var jsforce=require(_0x1da5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1da5('0x7'));var querystring=require(_0x1da5('0xb'));var Papa=require(_0x1da5('0xc'));var Redis=require(_0x1da5('0xd'));var authService=require(_0x1da5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1da5('0xf'));var hardwareService=require(_0x1da5('0x10'));var logger=require(_0x1da5('0x11'))(_0x1da5('0x12'));var utils=require(_0x1da5('0x13'));var config=require(_0x1da5('0x14'));var db=require(_0x1da5('0x15'))['db'];function respondWithStatusCode(_0xbb62f3,_0x2310b4){_0x2310b4=_0x2310b4||0xcc;return function(_0x4fa2a6){if(_0x4fa2a6){return _0xbb62f3[_0x1da5('0x16')](_0x2310b4);}return _0xbb62f3['status'](_0x2310b4)[_0x1da5('0x17')]();};}function respondWithResult(_0x57d66c,_0x4bcdaa){_0x4bcdaa=_0x4bcdaa||0xc8;return function(_0x158019){if(_0x158019){return _0x57d66c[_0x1da5('0x18')](_0x4bcdaa)[_0x1da5('0x19')](_0x158019);}};}function respondWithFilteredResult(_0x4acd07,_0xd5f69f){return function(_0x29d734){if(_0x29d734){var _0x2087ed=_0x29d734[_0x1da5('0x1a')],_0x260f60=_0xd5f69f[_0x1da5('0x1b')],_0x4e84b4=_0xd5f69f[_0x1da5('0x1b')]+_0xd5f69f[_0x1da5('0x1c')],_0x1419d9;if(_0x4e84b4>=_0x2087ed){_0x4e84b4=_0x2087ed;_0x1419d9=0xc8;}else{_0x1419d9=0xce;}_0x4acd07['status'](_0x1419d9);return _0x4acd07['set'](_0x1da5('0x1d'),_0x260f60+'-'+_0x4e84b4+'/'+_0x2087ed)[_0x1da5('0x19')](_0x29d734);}return null;};}function patchUpdates(_0xe4fa88){return function(_0x42c065){try{jsonpatch[_0x1da5('0x1e')](_0x42c065,_0xe4fa88,!![]);}catch(_0x2777fa){return BPromise['reject'](_0x2777fa);}return _0x42c065['save']();};}function saveUpdates(_0x3b20cd,_0x3a6357){return function(_0x2ada51){if(_0x2ada51){return _0x2ada51[_0x1da5('0x1f')](_0x3b20cd)[_0x1da5('0x20')](function(_0x59856c){return _0x59856c;});}return null;};}function removeEntity(_0xdcebc0,_0x4b6fb1){return function(_0x373fe1){if(_0x373fe1){return _0x373fe1[_0x1da5('0x21')]()['then'](function(){var _0x4850c4=_0x373fe1[_0x1da5('0x22')]({'plain':!![]});var _0x5468fc='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5468fc,'resourceId':_0x4850c4['id']}})[_0x1da5('0x20')](function(){return _0x373fe1;});})[_0x1da5('0x20')](function(){_0xdcebc0[_0x1da5('0x18')](0xcc)[_0x1da5('0x17')]();});}};}function handleEntityNotFound(_0x85ad64,_0xa6934f){return function(_0x590a52){if(!_0x590a52){_0x85ad64[_0x1da5('0x16')](0x194);}return _0x590a52;};}function handleError(_0x34beb2,_0xebdb98){_0xebdb98=_0xebdb98||0x1f4;return function(_0x256da1){logger[_0x1da5('0x23')](_0x256da1[_0x1da5('0x24')]);if(_0x256da1[_0x1da5('0x25')]){delete _0x256da1[_0x1da5('0x25')];}_0x34beb2[_0x1da5('0x18')](_0xebdb98)[_0x1da5('0x26')](_0x256da1);};}exports[_0x1da5('0x27')]=function(_0x36db1f,_0x25ac42){var _0x15621e={},_0x25c8f0={},_0x44a90b={'count':0x0,'rows':[]};var _0x5d2931=_[_0x1da5('0x28')](db[_0x1da5('0x29')][_0x1da5('0x2a')],function(_0x253759){return{'name':_0x253759[_0x1da5('0x2b')],'type':_0x253759[_0x1da5('0x2c')][_0x1da5('0x2d')]};});_0x25c8f0[_0x1da5('0x2e')]=_[_0x1da5('0x28')](_0x5d2931,_0x1da5('0x25'));_0x25c8f0[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x36db1f[_0x1da5('0x2f')]);_0x25c8f0[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x25c8f0['model'],_0x25c8f0['query']);_0x15621e[_0x1da5('0x33')]=_[_0x1da5('0x32')](_0x25c8f0['model'],qs['fields'](_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x34')]));_0x15621e[_0x1da5('0x33')]=_0x15621e['attributes'][_0x1da5('0x35')]?_0x15621e[_0x1da5('0x33')]:_0x25c8f0['model'];if(!_0x36db1f['query']['hasOwnProperty'](_0x1da5('0x36'))){_0x15621e[_0x1da5('0x1c')]=qs[_0x1da5('0x1c')](_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x1c')]);_0x15621e[_0x1da5('0x1b')]=qs[_0x1da5('0x1b')](_0x36db1f['query'][_0x1da5('0x1b')]);}_0x15621e[_0x1da5('0x37')]=qs[_0x1da5('0x38')](_0x36db1f['query'][_0x1da5('0x38')]);_0x15621e[_0x1da5('0x39')]=qs[_0x1da5('0x31')](_[_0x1da5('0x3a')](_0x36db1f['query'],_0x25c8f0[_0x1da5('0x31')]));if(_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x3b')]){_0x15621e[_0x1da5('0x39')]=_[_0x1da5('0x3c')](_0x15621e[_0x1da5('0x39')],{'$or':_[_0x1da5('0x28')](_0x5d2931,function(_0x66b34f){if(_0x66b34f[_0x1da5('0x2c')]!==_0x1da5('0x3d')){var _0x4eb34d={};_0x4eb34d[_0x66b34f['name']]={'$like':'%'+_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x3b')]+'%'};return _0x4eb34d;}})});}_0x15621e=_['merge']({},_0x15621e,_0x36db1f[_0x1da5('0x3e')]);var _0x5d5f4c={'where':_0x15621e[_0x1da5('0x39')]};return db['VoiceMail'][_0x1da5('0x1a')](_0x5d5f4c)[_0x1da5('0x20')](function(_0x4a7d38){_0x44a90b['count']=_0x4a7d38;if(_0x36db1f['query'][_0x1da5('0x3f')]){_0x15621e[_0x1da5('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x1da5('0x41')](_0x15621e);})[_0x1da5('0x20')](function(_0x3d0d87){_0x44a90b['rows']=_0x3d0d87;return _0x44a90b;})[_0x1da5('0x20')](respondWithFilteredResult(_0x25ac42,_0x15621e))[_0x1da5('0x42')](handleError(_0x25ac42,null));};exports['show']=function(_0x597af2,_0x2c2f39){var _0x496242={'raw':!![],'where':{'id':_0x597af2[_0x1da5('0x43')]['id']}},_0x53156f={};_0x53156f[_0x1da5('0x2e')]=_[_0x1da5('0x30')](db[_0x1da5('0x29')][_0x1da5('0x2a')]);_0x53156f[_0x1da5('0x2f')]=_['keys'](_0x597af2[_0x1da5('0x2f')]);_0x53156f[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x53156f[_0x1da5('0x2e')],_0x53156f['query']);_0x496242[_0x1da5('0x33')]=_[_0x1da5('0x32')](_0x53156f['model'],qs['fields'](_0x597af2['query'][_0x1da5('0x34')]));_0x496242[_0x1da5('0x33')]=_0x496242['attributes']['length']?_0x496242['attributes']:_0x53156f[_0x1da5('0x2e')];if(_0x597af2[_0x1da5('0x2f')][_0x1da5('0x3f')]){_0x496242[_0x1da5('0x40')]=[{'all':!![]}];}_0x496242=_[_0x1da5('0x3c')]({},_0x496242,_0x597af2['options']);return db[_0x1da5('0x29')][_0x1da5('0x44')](_0x496242)['then'](handleEntityNotFound(_0x2c2f39,null))[_0x1da5('0x20')](respondWithResult(_0x2c2f39,null))[_0x1da5('0x42')](handleError(_0x2c2f39,null));};exports[_0x1da5('0x45')]=function(_0x27c778,_0x1881de){return db[_0x1da5('0x29')]['create'](_0x27c778['body'],{})[_0x1da5('0x20')](function(_0x4d1553){var _0x28c4bc=_0x27c778['user']['get']({'plain':!![]});if(!_0x28c4bc)throw new Error(_0x1da5('0x46'));if(_0x28c4bc[_0x1da5('0x47')]===_0x1da5('0x48')){var _0x232a03=_0x4d1553[_0x1da5('0x22')]({'plain':!![]});var _0x2754d2=_0x1da5('0x49');return db['UserProfileSection'][_0x1da5('0x44')]({'where':{'name':_0x2754d2,'userProfileId':_0x28c4bc['userProfileId']},'raw':!![]})[_0x1da5('0x20')](function(_0x1dcbda){if(_0x1dcbda&&_0x1dcbda[_0x1da5('0x4a')]===0x0){return db[_0x1da5('0x4b')][_0x1da5('0x45')]({'name':_0x232a03[_0x1da5('0x25')],'resourceId':_0x232a03['id'],'type':_0x1dcbda[_0x1da5('0x25')],'sectionId':_0x1dcbda['id']},{})[_0x1da5('0x20')](function(){return _0x4d1553;});}else{return _0x4d1553;}})[_0x1da5('0x42')](function(_0x8120d7){logger[_0x1da5('0x23')](_0x1da5('0x4c'),_0x8120d7);throw _0x8120d7;});}return _0x4d1553;})[_0x1da5('0x20')](respondWithResult(_0x1881de,0xc9))[_0x1da5('0x42')](handleError(_0x1881de,null));};exports['update']=function(_0x562a42,_0x18b0c8){if(_0x562a42[_0x1da5('0x4d')]['id']){delete _0x562a42['body']['id'];}return db[_0x1da5('0x29')][_0x1da5('0x44')]({'where':{'id':_0x562a42[_0x1da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x18b0c8,null))[_0x1da5('0x20')](saveUpdates(_0x562a42[_0x1da5('0x4d')],null))[_0x1da5('0x20')](respondWithResult(_0x18b0c8,null))['catch'](handleError(_0x18b0c8,null));};exports['destroy']=function(_0x13a774,_0x526d90){return db['VoiceMail'][_0x1da5('0x44')]({'where':{'id':_0x13a774[_0x1da5('0x43')]['id']}})[_0x1da5('0x20')](handleEntityNotFound(_0x526d90,null))[_0x1da5('0x20')](removeEntity(_0x526d90,null))['catch'](handleError(_0x526d90,null));};exports[_0x1da5('0x4e')]=function(_0x5a632a,_0x306386,_0x9e3eef){return db['VoiceMail'][_0x1da5('0x4f')]({'where':{'id':_0x5a632a[_0x1da5('0x43')]['id']}})[_0x1da5('0x20')](handleEntityNotFound(_0x306386,null))[_0x1da5('0x20')](function(_0x462309){var _0x8de4ff;var _0x3d48ff={},_0x177930={};_0x177930['model']=_['keys'](db[_0x1da5('0x50')][_0x1da5('0x2a')]);_0x177930[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x5a632a['query']);_0x177930[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x177930[_0x1da5('0x2e')],_0x177930['query']);_0x3d48ff[_0x1da5('0x33')]=_[_0x1da5('0x32')](_0x177930[_0x1da5('0x2e')],qs['fields'](_0x5a632a['query']['fields']));_0x3d48ff['attributes']=_0x3d48ff[_0x1da5('0x33')]['length']?_0x3d48ff[_0x1da5('0x33')]:_0x177930['model'];if(!_0x5a632a[_0x1da5('0x2f')][_0x1da5('0x51')](_0x1da5('0x36'))){_0x3d48ff['limit']=qs['limit'](_0x5a632a[_0x1da5('0x2f')]['limit']);_0x3d48ff[_0x1da5('0x1b')]=qs[_0x1da5('0x1b')](_0x5a632a[_0x1da5('0x2f')][_0x1da5('0x1b')]);}_0x3d48ff['order']=qs['sort'](_0x5a632a[_0x1da5('0x2f')]['sort']);_0x3d48ff['where']=qs['filters'](_[_0x1da5('0x3a')](_0x5a632a[_0x1da5('0x2f')],_0x177930[_0x1da5('0x31')]));if(_0x5a632a[_0x1da5('0x2f')]['filter']){_0x3d48ff[_0x1da5('0x39')]=_[_0x1da5('0x3c')](_0x3d48ff[_0x1da5('0x39')],{'$or':_[_0x1da5('0x28')](_0x3d48ff[_0x1da5('0x33')],function(_0x3c358a){var _0x1775be={};_0x1775be[_0x3c358a]={'$like':'%'+_0x5a632a[_0x1da5('0x2f')]['filter']+'%'};return _0x1775be;})});}_0x3d48ff[_0x1da5('0x39')]=_[_0x1da5('0x3c')](_0x3d48ff['where'],{'mailboxuser':_0x462309[_0x1da5('0x52')]});_0x3d48ff=_[_0x1da5('0x3c')]({},_0x3d48ff,_0x5a632a[_0x1da5('0x3e')]);return db['VoiceMailMessage'][_0x1da5('0x53')](_0x3d48ff)['then'](respondWithFilteredResult(_0x306386,_0x3d48ff));})[_0x1da5('0x42')](handleError(_0x306386,null));}; \ No newline at end of file +var _0x8847=['getMessages','findOne','order','pick','mailbox','VoiceMailMessage','findAndCountAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','update','destroy','then','get','Voicemails','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','VoiceMail','options','find','create','body','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x5be9f0,_0x1955da){var _0xd0bc91=function(_0x7ba35){while(--_0x7ba35){_0x5be9f0['push'](_0x5be9f0['shift']());}};_0xd0bc91(++_0x1955da);}(_0x8847,0x100));var _0x7884=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x8847[_0x36ed48];return _0x51c63a;};'use strict';var pdf=require(_0x7884('0x0'));var emlformat=require(_0x7884('0x1'));var rimraf=require(_0x7884('0x2'));var zipdir=require(_0x7884('0x3'));var jsonpatch=require(_0x7884('0x4'));var rp=require('request-promise');var moment=require(_0x7884('0x5'));var BPromise=require(_0x7884('0x6'));var Mustache=require(_0x7884('0x7'));var util=require(_0x7884('0x8'));var path=require('path');var sox=require(_0x7884('0x9'));var csv=require(_0x7884('0xa'));var ejs=require(_0x7884('0xb'));var fs=require('fs');var _=require(_0x7884('0xc'));var squel=require('squel');var crypto=require(_0x7884('0xd'));var jsforce=require(_0x7884('0xe'));var deskjs=require(_0x7884('0xf'));var toCsv=require(_0x7884('0xa'));var querystring=require(_0x7884('0x10'));var Papa=require(_0x7884('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7884('0x12'));var as=require(_0x7884('0x13'));var hardwareService=require(_0x7884('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7884('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa94534,_0x444a4f){_0x444a4f=_0x444a4f||0xcc;return function(_0x3bd461){if(_0x3bd461){return _0xa94534[_0x7884('0x16')](_0x444a4f);}return _0xa94534[_0x7884('0x17')](_0x444a4f)[_0x7884('0x18')]();};}function respondWithResult(_0x3a2ae6,_0x2c1681){_0x2c1681=_0x2c1681||0xc8;return function(_0xf008ef){if(_0xf008ef){return _0x3a2ae6[_0x7884('0x17')](_0x2c1681)[_0x7884('0x19')](_0xf008ef);}};}function respondWithFilteredResult(_0x1b0438,_0x398fce){return function(_0x2bc0f3){if(_0x2bc0f3){var _0x468482=_0x2bc0f3[_0x7884('0x1a')],_0x32d098=_0x398fce[_0x7884('0x1b')],_0x37fc72=_0x398fce['offset']+_0x398fce[_0x7884('0x1c')],_0x404f2a;if(_0x37fc72>=_0x468482){_0x37fc72=_0x468482;_0x404f2a=0xc8;}else{_0x404f2a=0xce;}_0x1b0438[_0x7884('0x17')](_0x404f2a);return _0x1b0438[_0x7884('0x1d')]('Content-Range',_0x32d098+'-'+_0x37fc72+'/'+_0x468482)[_0x7884('0x19')](_0x2bc0f3);}return null;};}function patchUpdates(_0x5a2b37){return function(_0x30058e){try{jsonpatch['apply'](_0x30058e,_0x5a2b37,!![]);}catch(_0x519bd0){return BPromise['reject'](_0x519bd0);}return _0x30058e['save']();};}function saveUpdates(_0x146379,_0x2ddc16){return function(_0x2fb021){if(_0x2fb021){return _0x2fb021[_0x7884('0x1e')](_0x146379)['then'](function(_0x1feebc){return _0x1feebc;});}return null;};}function removeEntity(_0x528d71,_0x10e763){return function(_0x4f8e79){if(_0x4f8e79){return _0x4f8e79[_0x7884('0x1f')]()[_0x7884('0x20')](function(){var _0x43504a=_0x4f8e79[_0x7884('0x21')]({'plain':!![]});var _0x1cd209=_0x7884('0x22');return db[_0x7884('0x23')][_0x7884('0x1f')]({'where':{'type':_0x1cd209,'resourceId':_0x43504a['id']}})[_0x7884('0x20')](function(){return _0x4f8e79;});})['then'](function(){_0x528d71[_0x7884('0x17')](0xcc)[_0x7884('0x18')]();});}};}function handleEntityNotFound(_0x1f6c41,_0x206c49){return function(_0x1a9901){if(!_0x1a9901){_0x1f6c41[_0x7884('0x16')](0x194);}return _0x1a9901;};}function handleError(_0x381418,_0x536e67){_0x536e67=_0x536e67||0x1f4;return function(_0x1687de){logger[_0x7884('0x24')](_0x1687de[_0x7884('0x25')]);if(_0x1687de['name']){delete _0x1687de[_0x7884('0x26')];}_0x381418[_0x7884('0x17')](_0x536e67)[_0x7884('0x27')](_0x1687de);};}exports['index']=function(_0x2d3c94,_0x4e2c43){var _0xfdf4b2={},_0x1cbd0e={},_0x1fb6d1={'count':0x0,'rows':[]};var _0x22b139=_[_0x7884('0x28')](db['VoiceMail'][_0x7884('0x29')],function(_0x132506){return{'name':_0x132506[_0x7884('0x2a')],'type':_0x132506['type'][_0x7884('0x2b')]};});_0x1cbd0e['model']=_['map'](_0x22b139,'name');_0x1cbd0e[_0x7884('0x2c')]=_['keys'](_0x2d3c94[_0x7884('0x2c')]);_0x1cbd0e[_0x7884('0x2d')]=_[_0x7884('0x2e')](_0x1cbd0e[_0x7884('0x2f')],_0x1cbd0e[_0x7884('0x2c')]);_0xfdf4b2[_0x7884('0x30')]=_['intersection'](_0x1cbd0e[_0x7884('0x2f')],qs[_0x7884('0x31')](_0x2d3c94[_0x7884('0x2c')][_0x7884('0x31')]));_0xfdf4b2[_0x7884('0x30')]=_0xfdf4b2[_0x7884('0x30')][_0x7884('0x32')]?_0xfdf4b2[_0x7884('0x30')]:_0x1cbd0e[_0x7884('0x2f')];if(!_0x2d3c94[_0x7884('0x2c')][_0x7884('0x33')](_0x7884('0x34'))){_0xfdf4b2[_0x7884('0x1c')]=qs['limit'](_0x2d3c94[_0x7884('0x2c')]['limit']);_0xfdf4b2['offset']=qs[_0x7884('0x1b')](_0x2d3c94[_0x7884('0x2c')][_0x7884('0x1b')]);}_0xfdf4b2['order']=qs[_0x7884('0x35')](_0x2d3c94['query'][_0x7884('0x35')]);_0xfdf4b2[_0x7884('0x36')]=qs[_0x7884('0x2d')](_['pick'](_0x2d3c94[_0x7884('0x2c')],_0x1cbd0e[_0x7884('0x2d')]));if(_0x2d3c94[_0x7884('0x2c')][_0x7884('0x37')]){_0xfdf4b2[_0x7884('0x36')]=_[_0x7884('0x38')](_0xfdf4b2[_0x7884('0x36')],{'$or':_['map'](_0x22b139,function(_0x2cb45e){if(_0x2cb45e[_0x7884('0x39')]!==_0x7884('0x3a')){var _0x2b69b8={};_0x2b69b8[_0x2cb45e[_0x7884('0x26')]]={'$like':'%'+_0x2d3c94['query'][_0x7884('0x37')]+'%'};return _0x2b69b8;}})});}_0xfdf4b2=_[_0x7884('0x38')]({},_0xfdf4b2,_0x2d3c94['options']);var _0x2727e7={'where':_0xfdf4b2[_0x7884('0x36')]};return db['VoiceMail'][_0x7884('0x1a')](_0x2727e7)['then'](function(_0x919404){_0x1fb6d1[_0x7884('0x1a')]=_0x919404;if(_0x2d3c94[_0x7884('0x2c')][_0x7884('0x3b')]){_0xfdf4b2[_0x7884('0x3c')]=[{'all':!![]}];}return db['VoiceMail'][_0x7884('0x3d')](_0xfdf4b2);})[_0x7884('0x20')](function(_0x40122a){_0x1fb6d1[_0x7884('0x3e')]=_0x40122a;return _0x1fb6d1;})[_0x7884('0x20')](respondWithFilteredResult(_0x4e2c43,_0xfdf4b2))[_0x7884('0x3f')](handleError(_0x4e2c43,null));};exports[_0x7884('0x40')]=function(_0x3cfd55,_0xefa731){var _0x433876={'raw':!![],'where':{'id':_0x3cfd55[_0x7884('0x41')]['id']}},_0x3b2481={};_0x3b2481[_0x7884('0x2f')]=_[_0x7884('0x42')](db[_0x7884('0x43')][_0x7884('0x29')]);_0x3b2481[_0x7884('0x2c')]=_['keys'](_0x3cfd55['query']);_0x3b2481[_0x7884('0x2d')]=_[_0x7884('0x2e')](_0x3b2481[_0x7884('0x2f')],_0x3b2481[_0x7884('0x2c')]);_0x433876[_0x7884('0x30')]=_[_0x7884('0x2e')](_0x3b2481[_0x7884('0x2f')],qs[_0x7884('0x31')](_0x3cfd55[_0x7884('0x2c')][_0x7884('0x31')]));_0x433876[_0x7884('0x30')]=_0x433876[_0x7884('0x30')]['length']?_0x433876[_0x7884('0x30')]:_0x3b2481[_0x7884('0x2f')];if(_0x3cfd55['query'][_0x7884('0x3b')]){_0x433876['include']=[{'all':!![]}];}_0x433876=_[_0x7884('0x38')]({},_0x433876,_0x3cfd55[_0x7884('0x44')]);return db[_0x7884('0x43')][_0x7884('0x45')](_0x433876)[_0x7884('0x20')](handleEntityNotFound(_0xefa731,null))[_0x7884('0x20')](respondWithResult(_0xefa731,null))[_0x7884('0x3f')](handleError(_0xefa731,null));};exports[_0x7884('0x46')]=function(_0x388a38,_0x5c1361){return db['VoiceMail'][_0x7884('0x46')](_0x388a38[_0x7884('0x47')],{})[_0x7884('0x20')](function(_0x2b14e0){var _0x32aa5e=_0x388a38['user'][_0x7884('0x21')]({'plain':!![]});if(!_0x32aa5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32aa5e[_0x7884('0x48')]==='user'){var _0x360b8b=_0x2b14e0[_0x7884('0x21')]({'plain':!![]});var _0x45a46d=_0x7884('0x22');return db[_0x7884('0x49')]['find']({'where':{'name':_0x45a46d,'userProfileId':_0x32aa5e[_0x7884('0x4a')]},'raw':!![]})[_0x7884('0x20')](function(_0x5e0fb3){if(_0x5e0fb3&&_0x5e0fb3['autoAssociation']===0x0){return db[_0x7884('0x23')][_0x7884('0x46')]({'name':_0x360b8b[_0x7884('0x26')],'resourceId':_0x360b8b['id'],'type':_0x5e0fb3[_0x7884('0x26')],'sectionId':_0x5e0fb3['id']},{})[_0x7884('0x20')](function(){return _0x2b14e0;});}else{return _0x2b14e0;}})[_0x7884('0x3f')](function(_0x4ef9a2){logger[_0x7884('0x24')](_0x7884('0x4b'),_0x4ef9a2);throw _0x4ef9a2;});}return _0x2b14e0;})['then'](respondWithResult(_0x5c1361,0xc9))[_0x7884('0x3f')](handleError(_0x5c1361,null));};exports[_0x7884('0x1e')]=function(_0x42c8a9,_0xd876e9){if(_0x42c8a9['body']['id']){delete _0x42c8a9['body']['id'];}return db[_0x7884('0x43')][_0x7884('0x45')]({'where':{'id':_0x42c8a9[_0x7884('0x41')]['id']}})[_0x7884('0x20')](handleEntityNotFound(_0xd876e9,null))['then'](saveUpdates(_0x42c8a9['body'],null))[_0x7884('0x20')](respondWithResult(_0xd876e9,null))['catch'](handleError(_0xd876e9,null));};exports['destroy']=function(_0x5bcc5f,_0x212c13){return db[_0x7884('0x43')][_0x7884('0x45')]({'where':{'id':_0x5bcc5f[_0x7884('0x41')]['id']}})['then'](handleEntityNotFound(_0x212c13,null))[_0x7884('0x20')](removeEntity(_0x212c13,null))[_0x7884('0x3f')](handleError(_0x212c13,null));};exports[_0x7884('0x4c')]=function(_0xe93612,_0x105337,_0x489131){return db[_0x7884('0x43')][_0x7884('0x4d')]({'where':{'id':_0xe93612[_0x7884('0x41')]['id']}})[_0x7884('0x20')](handleEntityNotFound(_0x105337,null))[_0x7884('0x20')](function(_0x175c10){var _0x307bfb;var _0x4ef7f5={},_0x35b14d={};_0x35b14d['model']=_['keys'](db['VoiceMailMessage'][_0x7884('0x29')]);_0x35b14d[_0x7884('0x2c')]=_[_0x7884('0x42')](_0xe93612[_0x7884('0x2c')]);_0x35b14d[_0x7884('0x2d')]=_['intersection'](_0x35b14d[_0x7884('0x2f')],_0x35b14d[_0x7884('0x2c')]);_0x4ef7f5[_0x7884('0x30')]=_['intersection'](_0x35b14d[_0x7884('0x2f')],qs[_0x7884('0x31')](_0xe93612['query'][_0x7884('0x31')]));_0x4ef7f5[_0x7884('0x30')]=_0x4ef7f5[_0x7884('0x30')][_0x7884('0x32')]?_0x4ef7f5[_0x7884('0x30')]:_0x35b14d[_0x7884('0x2f')];if(!_0xe93612['query']['hasOwnProperty']('nolimit')){_0x4ef7f5[_0x7884('0x1c')]=qs['limit'](_0xe93612['query'][_0x7884('0x1c')]);_0x4ef7f5[_0x7884('0x1b')]=qs[_0x7884('0x1b')](_0xe93612[_0x7884('0x2c')][_0x7884('0x1b')]);}_0x4ef7f5[_0x7884('0x4e')]=qs[_0x7884('0x35')](_0xe93612[_0x7884('0x2c')][_0x7884('0x35')]);_0x4ef7f5[_0x7884('0x36')]=qs[_0x7884('0x2d')](_[_0x7884('0x4f')](_0xe93612['query'],_0x35b14d['filters']));if(_0xe93612['query'][_0x7884('0x37')]){_0x4ef7f5['where']=_['merge'](_0x4ef7f5[_0x7884('0x36')],{'$or':_[_0x7884('0x28')](_0x4ef7f5[_0x7884('0x30')],function(_0x22ae59){var _0x47bc51={};_0x47bc51[_0x22ae59]={'$like':'%'+_0xe93612[_0x7884('0x2c')][_0x7884('0x37')]+'%'};return _0x47bc51;})});}_0x4ef7f5[_0x7884('0x36')]=_['merge'](_0x4ef7f5[_0x7884('0x36')],{'mailboxuser':_0x175c10[_0x7884('0x50')]});_0x4ef7f5=_[_0x7884('0x38')]({},_0x4ef7f5,_0xe93612['options']);return db[_0x7884('0x51')][_0x7884('0x52')](_0x4ef7f5)[_0x7884('0x20')](respondWithFilteredResult(_0x105337,_0x4ef7f5));})[_0x7884('0x3f')](handleError(_0x105337,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index a313e2a..6e35043 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 _0xdb1c=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0xe12eb4,_0x3abf24){var _0xce090a=function(_0x1b97d4){while(--_0x1b97d4){_0xe12eb4['push'](_0xe12eb4['shift']());}};_0xce090a(++_0x3abf24);}(_0xdb1c,0xcf));var _0xcdb1=function(_0x399388,_0x378aeb){_0x399388=_0x399388-0x0;var _0x41b8a2=_0xdb1c[_0x399388];return _0x41b8a2;};'use strict';var _=require(_0xcdb1('0x0'));var util=require(_0xcdb1('0x1'));var logger=require(_0xcdb1('0x2'))(_0xcdb1('0x3'));var moment=require(_0xcdb1('0x4'));var BPromise=require(_0xcdb1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdb1('0x6'));var rimraf=require(_0xcdb1('0x7'));var config=require(_0xcdb1('0x8'));var attributes=require(_0xcdb1('0x9'));module[_0xcdb1('0xa')]=function(_0x2c691d,_0x575070){return _0x2c691d['define'](_0xcdb1('0xb'),attributes,{'tableName':_0xcdb1('0xc'),'paranoid':![],'indexes':[{'name':_0xcdb1('0xd'),'fields':[_0xcdb1('0xe'),_0xcdb1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe3ef=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','lodash','util','api'];(function(_0x414cf2,_0x2136dd){var _0x27c0dc=function(_0x46062d){while(--_0x46062d){_0x414cf2['push'](_0x414cf2['shift']());}};_0x27c0dc(++_0x2136dd);}(_0xe3ef,0x65));var _0xfe3e=function(_0x4b1bc5,_0x27696d){_0x4b1bc5=_0x4b1bc5-0x0;var _0x74fdeb=_0xe3ef[_0x4b1bc5];return _0x74fdeb;};'use strict';var _=require(_0xfe3e('0x0'));var util=require(_0xfe3e('0x1'));var logger=require('../../config/logger')(_0xfe3e('0x2'));var moment=require(_0xfe3e('0x3'));var BPromise=require(_0xfe3e('0x4'));var rp=require(_0xfe3e('0x5'));var fs=require('fs');var path=require(_0xfe3e('0x6'));var rimraf=require(_0xfe3e('0x7'));var config=require(_0xfe3e('0x8'));var attributes=require(_0xfe3e('0x9'));module[_0xfe3e('0xa')]=function(_0x1d1b87,_0x18b6a8){return _0x1d1b87[_0xfe3e('0xb')](_0xfe3e('0xc'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index a2b3772..1b8d9b5 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 _0x2cce=['error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b8155,_0x5b8da6){var _0x45e128=function(_0x51252f){while(--_0x51252f){_0x2b8155['push'](_0x2b8155['shift']());}};_0x45e128(++_0x5b8da6);}(_0x2cce,0x122));var _0xe2cc=function(_0x807084,_0x31be85){_0x807084=_0x807084-0x0;var _0x15f389=_0x2cce[_0x807084];return _0x15f389;};'use strict';var _=require(_0xe2cc('0x0'));var util=require(_0xe2cc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2cc('0x2'))['db'];var utils=require(_0xe2cc('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xe2cc('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe2cc('0x5')][_0xe2cc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46667e,_0x124e58,_0x1cb27d){return new BPromise(function(_0x5f2225,_0x879c2c){return client[_0xe2cc('0x7')](_0x46667e,_0x1cb27d)[_0xe2cc('0x8')](function(_0x1c623b){logger[_0xe2cc('0x9')](_0xe2cc('0xa'),_0x124e58,_0xe2cc('0xb'));logger['debug'](_0xe2cc('0xc'),_0x124e58,_0xe2cc('0xb'),JSON[_0xe2cc('0xd')](_0x1c623b));if(_0x1c623b[_0xe2cc('0xe')]){if(_0x1c623b['error'][_0xe2cc('0xf')]===0x1f4){logger[_0xe2cc('0xe')](_0xe2cc('0xa'),_0x124e58,_0x1c623b['error']['message']);return _0x879c2c(_0x1c623b[_0xe2cc('0xe')][_0xe2cc('0x10')]);}logger[_0xe2cc('0xe')]('VoiceMail,\x20%s,\x20%s',_0x124e58,_0x1c623b[_0xe2cc('0xe')]['message']);return _0x5f2225(_0x1c623b[_0xe2cc('0xe')][_0xe2cc('0x10')]);}else{logger[_0xe2cc('0x9')]('VoiceMail,\x20%s,\x20%s',_0x124e58,_0xe2cc('0xb'));_0x5f2225(_0x1c623b[_0xe2cc('0x11')][_0xe2cc('0x10')]);}})[_0xe2cc('0x12')](function(_0x5d6310){logger[_0xe2cc('0xe')](_0xe2cc('0xa'),_0x124e58,_0x5d6310);_0x879c2c(_0x5d6310);});});} \ No newline at end of file +var _0x571d=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x7436bb,_0x27792a){var _0x47a457=function(_0x3b8cd0){while(--_0x3b8cd0){_0x7436bb['push'](_0x7436bb['shift']());}};_0x47a457(++_0x27792a);}(_0x571d,0x1c9));var _0xd571=function(_0x44bff6,_0x43e44){_0x44bff6=_0x44bff6-0x0;var _0x1d1ba5=_0x571d[_0x44bff6];return _0x1d1ba5;};'use strict';var _=require(_0xd571('0x0'));var util=require(_0xd571('0x1'));var moment=require(_0xd571('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd571('0x3'));var db=require(_0xd571('0x4'))['db'];var utils=require(_0xd571('0x5'));var logger=require(_0xd571('0x6'))(_0xd571('0x7'));var config=require('../../config/environment');var jayson=require(_0xd571('0x8'));var client=jayson[_0xd571('0x9')][_0xd571('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d35ec,_0x865b22,_0x307ba1){return new BPromise(function(_0xa27e5f,_0x532857){return client[_0xd571('0xb')](_0x5d35ec,_0x307ba1)[_0xd571('0xc')](function(_0xa04628){logger[_0xd571('0xd')](_0xd571('0xe'),_0x865b22,'request\x20sent');logger[_0xd571('0xf')](_0xd571('0x10'),_0x865b22,_0xd571('0x11'),JSON[_0xd571('0x12')](_0xa04628));if(_0xa04628[_0xd571('0x13')]){if(_0xa04628[_0xd571('0x13')][_0xd571('0x14')]===0x1f4){logger[_0xd571('0x13')](_0xd571('0xe'),_0x865b22,_0xa04628['error'][_0xd571('0x15')]);return _0x532857(_0xa04628[_0xd571('0x13')][_0xd571('0x15')]);}logger[_0xd571('0x13')](_0xd571('0xe'),_0x865b22,_0xa04628[_0xd571('0x13')][_0xd571('0x15')]);return _0xa27e5f(_0xa04628['error'][_0xd571('0x15')]);}else{logger[_0xd571('0xd')](_0xd571('0xe'),_0x865b22,'request\x20sent');_0xa27e5f(_0xa04628[_0xd571('0x16')][_0xd571('0x15')]);}})[_0xd571('0x17')](function(_0xc736b8){logger[_0xd571('0x13')](_0xd571('0xe'),_0x865b22,_0xc736b8);_0x532857(_0xc736b8);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index f61a560..e5fa06c 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 _0x7da7=['get','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','show'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7da7,0x10d));var _0x77da=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0x7da7[_0x330141];return _0x1b68a2;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0xd')]);router['post']('/',auth[_0x77da('0x7')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0x10')]);router[_0x77da('0x11')](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0x12')]);module[_0x77da('0x13')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','destroy','exports','multer','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x814b,0x1a2));var _0xb814=function(_0x42e25e,_0x46cfd1){_0x42e25e=_0x42e25e-0x0;var _0x1ed3a6=_0x814b[_0x42e25e];return _0x1ed3a6;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('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 47fd278..e4e08f8 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 _0x0443=['TIMESTAMP','sequelize','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x59be40,_0x5e8fbe){var _0x3f3284=function(_0x206894){while(--_0x206894){_0x59be40['push'](_0x59be40['shift']());}};_0x3f3284(++_0x5e8fbe);}(_0x0443,0x8d));var _0x3044=function(_0x458aa2,_0x2cc770){_0x458aa2=_0x458aa2-0x0;var _0x60b0a9=_0x0443[_0x458aa2];return _0x60b0a9;};'use strict';var Sequelize=require(_0x3044('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2a535b){return this[_0x3044('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x3044('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x3044('0x4')](_0x3044('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'stamp':{'type':_0x3044('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xbdc8=['TIMESTAMP','sequelize','exports','INTEGER','STRING'];(function(_0x4ee678,_0x1cc688){var _0x164b40=function(_0x4a0d29){while(--_0x4a0d29){_0x4ee678['push'](_0x4ee678['shift']());}};_0x164b40(++_0x1cc688);}(_0xbdc8,0x74));var _0x8bdc=function(_0x1ee0c1,_0x87b9c5){_0x1ee0c1=_0x1ee0c1-0x0;var _0x1a1e59=_0xbdc8[_0x1ee0c1];return _0x1a1e59;};'use strict';var Sequelize=require(_0x8bdc('0x0'));module[_0x8bdc('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3b99e4){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x8bdc('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x8bdc('0x3')],'defaultValue':''},'stamp':{'type':_0x8bdc('0x4'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 2dc2bcb..cb84c9a 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 _0xd67b=['../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','VoiceMailMessage','count','include','rows','catch','params','keys','rawAttributes','includeAll','options','create','body','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xd67b,0x133));var _0xbd67=function(_0x2215a3,_0x178b23){_0x2215a3=_0x2215a3-0x0;var _0x44ad6a=_0xd67b[_0x2215a3];return _0x44ad6a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd67('0x1'));var jsonpatch=require(_0xbd67('0x2'));var rp=require(_0xbd67('0x3'));var moment=require('moment');var BPromise=require(_0xbd67('0x4'));var Mustache=require('mustache');var util=require(_0xbd67('0x5'));var path=require('path');var sox=require(_0xbd67('0x6'));var csv=require(_0xbd67('0x7'));var ejs=require(_0xbd67('0x8'));var fs=require('fs');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('0x7'));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 db=require(_0xbd67('0x16'))['db'];function respondWithStatusCode(_0x137b8c,_0xb05237){_0xb05237=_0xb05237||0xcc;return function(_0x3621ad){if(_0x3621ad){return _0x137b8c[_0xbd67('0x17')](_0xb05237);}return _0x137b8c[_0xbd67('0x18')](_0xb05237)[_0xbd67('0x19')]();};}function respondWithResult(_0x4c078c,_0xbe923c){_0xbe923c=_0xbe923c||0xc8;return function(_0x46d881){if(_0x46d881){return _0x4c078c[_0xbd67('0x18')](_0xbe923c)[_0xbd67('0x1a')](_0x46d881);}};}function respondWithFilteredResult(_0x84bdf1,_0x23b626){return function(_0x44c025){if(_0x44c025){var _0xbdd027=_0x44c025['count'],_0xa45c76=_0x23b626[_0xbd67('0x1b')],_0x140df9=_0x23b626[_0xbd67('0x1b')]+_0x23b626[_0xbd67('0x1c')],_0x591de9;if(_0x140df9>=_0xbdd027){_0x140df9=_0xbdd027;_0x591de9=0xc8;}else{_0x591de9=0xce;}_0x84bdf1['status'](_0x591de9);return _0x84bdf1[_0xbd67('0x1d')](_0xbd67('0x1e'),_0xa45c76+'-'+_0x140df9+'/'+_0xbdd027)[_0xbd67('0x1a')](_0x44c025);}return null;};}function patchUpdates(_0x4b764f){return function(_0x5906a2){try{jsonpatch['apply'](_0x5906a2,_0x4b764f,!![]);}catch(_0x1f9193){return BPromise[_0xbd67('0x1f')](_0x1f9193);}return _0x5906a2[_0xbd67('0x20')]();};}function saveUpdates(_0x5e42c7,_0x3c4102){return function(_0x40ec96){if(_0x40ec96){return _0x40ec96[_0xbd67('0x21')](_0x5e42c7)[_0xbd67('0x22')](function(_0x419a6a){return _0x419a6a;});}return null;};}function removeEntity(_0x4576c4,_0x5a95b6){return function(_0x3ee2f1){if(_0x3ee2f1){return _0x3ee2f1[_0xbd67('0x23')]()[_0xbd67('0x22')](function(){_0x4576c4[_0xbd67('0x18')](0xcc)[_0xbd67('0x19')]();});}};}function handleEntityNotFound(_0x33fd8c,_0x46c519){return function(_0x922df8){if(!_0x922df8){_0x33fd8c[_0xbd67('0x17')](0x194);}return _0x922df8;};}function handleError(_0x36f7c8,_0x46b7ff){_0x46b7ff=_0x46b7ff||0x1f4;return function(_0x57602d){logger[_0xbd67('0x24')](_0x57602d['stack']);if(_0x57602d[_0xbd67('0x25')]){delete _0x57602d[_0xbd67('0x25')];}_0x36f7c8[_0xbd67('0x18')](_0x46b7ff)['send'](_0x57602d);};}exports[_0xbd67('0x26')]=function(_0x410baa,_0x4dfa19){var _0x3a062e={},_0x1b3253={},_0x374f1b={'count':0x0,'rows':[]};var _0x1c66ae=_[_0xbd67('0x27')](db['VoiceMailMessage']['rawAttributes'],function(_0x41856b){return{'name':_0x41856b[_0xbd67('0x28')],'type':_0x41856b[_0xbd67('0x29')][_0xbd67('0x2a')]};});_0x1b3253[_0xbd67('0x2b')]=_[_0xbd67('0x2c')](_[_0xbd67('0x27')](_0x1c66ae,_0xbd67('0x25')),[_0xbd67('0x25')]);_0x1b3253[_0xbd67('0x2d')]=_['keys'](_0x410baa['query']);_0x1b3253[_0xbd67('0x2e')]=_[_0xbd67('0x2f')](_0x1b3253[_0xbd67('0x2b')],_0x1b3253['query']);_0x3a062e[_0xbd67('0x30')]=_[_0xbd67('0x2f')](_0x1b3253[_0xbd67('0x2b')],qs[_0xbd67('0x31')](_0x410baa['query']['fields']));_0x3a062e['attributes']=_0x3a062e[_0xbd67('0x30')][_0xbd67('0x32')]?_0x3a062e[_0xbd67('0x30')]:_0x1b3253['model'];if(!_0x410baa['query'][_0xbd67('0x33')](_0xbd67('0x34'))){_0x3a062e[_0xbd67('0x1c')]=qs[_0xbd67('0x1c')](_0x410baa[_0xbd67('0x2d')][_0xbd67('0x1c')]);_0x3a062e['offset']=qs[_0xbd67('0x1b')](_0x410baa[_0xbd67('0x2d')][_0xbd67('0x1b')]);}_0x3a062e['order']=qs[_0xbd67('0x35')](_0x410baa['query'][_0xbd67('0x35')]);_0x3a062e[_0xbd67('0x36')]=qs['filters'](_[_0xbd67('0x37')](_0x410baa[_0xbd67('0x2d')],_0x1b3253[_0xbd67('0x2e')]));if(_0x410baa[_0xbd67('0x2d')][_0xbd67('0x38')]){_0x3a062e[_0xbd67('0x36')]=_['merge'](_0x3a062e[_0xbd67('0x36')],{'$or':_[_0xbd67('0x27')](_0x1c66ae,function(_0x9f2bd1){if(_0x9f2bd1[_0xbd67('0x29')]!==_0xbd67('0x39')){var _0x56e35d={};_0x56e35d[_0x9f2bd1['name']]={'$like':'%'+_0x410baa[_0xbd67('0x2d')][_0xbd67('0x38')]+'%'};return _0x56e35d;}})});}_0x3a062e=_[_0xbd67('0x3a')]({},_0x3a062e,_0x410baa['options']);var _0x378cb3={'where':_0x3a062e[_0xbd67('0x36')]};return db[_0xbd67('0x3b')][_0xbd67('0x3c')](_0x378cb3)['then'](function(_0x577986){_0x374f1b['count']=_0x577986;if(_0x410baa['query']['includeAll']){_0x3a062e[_0xbd67('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x3a062e);})['then'](function(_0x13853f){_0x374f1b[_0xbd67('0x3e')]=_0x13853f;return _0x374f1b;})[_0xbd67('0x22')](respondWithFilteredResult(_0x4dfa19,_0x3a062e))[_0xbd67('0x3f')](handleError(_0x4dfa19,null));};exports['show']=function(_0x41f158,_0x43caa9){var _0x3f69c5={'raw':!![],'where':{'id':_0x41f158[_0xbd67('0x40')]['id']}},_0x79684a={};_0x79684a[_0xbd67('0x2b')]=_[_0xbd67('0x41')](db['VoiceMailMessage'][_0xbd67('0x42')]);_0x79684a['query']=_[_0xbd67('0x41')](_0x41f158[_0xbd67('0x2d')]);_0x79684a[_0xbd67('0x2e')]=_[_0xbd67('0x2f')](_0x79684a[_0xbd67('0x2b')],_0x79684a[_0xbd67('0x2d')]);_0x3f69c5[_0xbd67('0x30')]=_[_0xbd67('0x2f')](_0x79684a['model'],qs[_0xbd67('0x31')](_0x41f158[_0xbd67('0x2d')]['fields']));_0x3f69c5[_0xbd67('0x30')]=_0x3f69c5[_0xbd67('0x30')][_0xbd67('0x32')]?_0x3f69c5['attributes']:_0x79684a['model'];if(_0x41f158[_0xbd67('0x2d')][_0xbd67('0x43')]){_0x3f69c5[_0xbd67('0x3d')]=[{'all':!![]}];}_0x3f69c5=_['merge']({},_0x3f69c5,_0x41f158[_0xbd67('0x44')]);return db[_0xbd67('0x3b')]['find'](_0x3f69c5)['then'](handleEntityNotFound(_0x43caa9,null))['then'](respondWithResult(_0x43caa9,null))['catch'](handleError(_0x43caa9,null));};exports[_0xbd67('0x45')]=function(_0xb4e252,_0x1b120a){return db[_0xbd67('0x3b')][_0xbd67('0x45')](_0xb4e252['body'],{})[_0xbd67('0x22')](respondWithResult(_0x1b120a,0xc9))[_0xbd67('0x3f')](handleError(_0x1b120a,null));};exports['update']=function(_0x29199b,_0x2cd9bc){if(_0x29199b[_0xbd67('0x46')]['id']){delete _0x29199b[_0xbd67('0x46')]['id'];}return db[_0xbd67('0x3b')]['find']({'where':{'id':_0x29199b[_0xbd67('0x40')]['id']}})['then'](handleEntityNotFound(_0x2cd9bc,null))[_0xbd67('0x22')](saveUpdates(_0x29199b[_0xbd67('0x46')],null))['then'](respondWithResult(_0x2cd9bc,null))[_0xbd67('0x3f')](handleError(_0x2cd9bc,null));};exports[_0xbd67('0x23')]=function(_0x1428f3,_0x5af027){return db[_0xbd67('0x3b')][_0xbd67('0x47')]({'where':{'id':_0x1428f3[_0xbd67('0x40')]['id']}})[_0xbd67('0x22')](handleEntityNotFound(_0x5af027,null))[_0xbd67('0x22')](removeEntity(_0x5af027,null))[_0xbd67('0x3f')](handleError(_0x5af027,null));};exports[_0xbd67('0x48')]=function(_0x565b13,_0x5d2e0a,_0x12943f){return db[_0xbd67('0x3b')][_0xbd67('0x47')]({'where':{'id':_0x565b13[_0xbd67('0x40')]['id']},'attributes':['id',_0xbd67('0x49'),'msg_id']})['then'](handleEntityNotFound(_0x5d2e0a,null))[_0xbd67('0x22')](function(_0x2d3ff3){if(_0x2d3ff3){if(!_0x2d3ff3[_0xbd67('0x49')]){throw new db[(_0xbd67('0x4a'))][(_0xbd67('0x4b'))](_0xbd67('0x4c'));}var _0x138978={'Content-Type':_0xbd67('0x4d'),'Content-Disposition':_0xbd67('0x4e')};if(_0x2d3ff3[_0xbd67('0x4f')]){_0x138978['Content-Disposition']='attachment;\x20filename=\x22'+_0x2d3ff3[_0xbd67('0x4f')]+'.wav\x22';}_0x5d2e0a[_0xbd67('0x1d')](_0x138978);return _0x5d2e0a[_0xbd67('0x50')](new Buffer(_0x2d3ff3[_0xbd67('0x49')]));}})[_0xbd67('0x3f')](handleError(_0x5d2e0a,null));}; \ No newline at end of file +var _0xc978=['query','keys','filters','attributes','intersection','fields','length','model','nolimit','order','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','destroy','download','recording','msg_id','Sequelize','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','sendStatus','name','VoiceMailMessage','type','key','differenceBy'];(function(_0x589cec,_0x8ebb1e){var _0x51ff82=function(_0x1ba16b){while(--_0x1ba16b){_0x589cec['push'](_0x589cec['shift']());}};_0x51ff82(++_0x8ebb1e);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x8c97('0x0'));var emlformat=require(_0x8c97('0x1'));var rimraf=require(_0x8c97('0x2'));var zipdir=require(_0x8c97('0x3'));var jsonpatch=require(_0x8c97('0x4'));var rp=require(_0x8c97('0x5'));var moment=require('moment');var BPromise=require(_0x8c97('0x6'));var Mustache=require(_0x8c97('0x7'));var util=require(_0x8c97('0x8'));var path=require(_0x8c97('0x9'));var sox=require(_0x8c97('0xa'));var csv=require(_0x8c97('0xb'));var ejs=require(_0x8c97('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8c97('0xd'));var crypto=require(_0x8c97('0xe'));var jsforce=require(_0x8c97('0xf'));var deskjs=require(_0x8c97('0x10'));var toCsv=require(_0x8c97('0xb'));var querystring=require(_0x8c97('0x11'));var Papa=require(_0x8c97('0x12'));var Redis=require('ioredis');var authService=require(_0x8c97('0x13'));var qs=require(_0x8c97('0x14'));var as=require(_0x8c97('0x15'));var hardwareService=require(_0x8c97('0x16'));var logger=require(_0x8c97('0x17'))(_0x8c97('0x18'));var utils=require(_0x8c97('0x19'));var config=require(_0x8c97('0x1a'));var db=require(_0x8c97('0x1b'))['db'];function respondWithStatusCode(_0x5cf392,_0x44611a){_0x44611a=_0x44611a||0xcc;return function(_0x346274){if(_0x346274){return _0x5cf392['sendStatus'](_0x44611a);}return _0x5cf392[_0x8c97('0x1c')](_0x44611a)[_0x8c97('0x1d')]();};}function respondWithResult(_0x4c6227,_0x3b179a){_0x3b179a=_0x3b179a||0xc8;return function(_0x4ec9cb){if(_0x4ec9cb){return _0x4c6227['status'](_0x3b179a)['json'](_0x4ec9cb);}};}function respondWithFilteredResult(_0x2d9aae,_0xab3812){return function(_0x17065f){if(_0x17065f){var _0xd0e5aa=_0x17065f[_0x8c97('0x1e')],_0x24a2a5=_0xab3812[_0x8c97('0x1f')],_0x29767b=_0xab3812['offset']+_0xab3812[_0x8c97('0x20')],_0x1ea67f;if(_0x29767b>=_0xd0e5aa){_0x29767b=_0xd0e5aa;_0x1ea67f=0xc8;}else{_0x1ea67f=0xce;}_0x2d9aae[_0x8c97('0x1c')](_0x1ea67f);return _0x2d9aae[_0x8c97('0x21')](_0x8c97('0x22'),_0x24a2a5+'-'+_0x29767b+'/'+_0xd0e5aa)[_0x8c97('0x23')](_0x17065f);}return null;};}function patchUpdates(_0x1445db){return function(_0xb502e7){try{jsonpatch[_0x8c97('0x24')](_0xb502e7,_0x1445db,!![]);}catch(_0x9ea046){return BPromise[_0x8c97('0x25')](_0x9ea046);}return _0xb502e7[_0x8c97('0x26')]();};}function saveUpdates(_0xb55f9b,_0x292ab2){return function(_0x16e3c4){if(_0x16e3c4){return _0x16e3c4[_0x8c97('0x27')](_0xb55f9b)[_0x8c97('0x28')](function(_0x57a266){return _0x57a266;});}return null;};}function removeEntity(_0x33a9a8,_0x29b396){return function(_0x3957d0){if(_0x3957d0){return _0x3957d0['destroy']()['then'](function(){_0x33a9a8[_0x8c97('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41d276,_0x1f2dd5){return function(_0x24cd2a){if(!_0x24cd2a){_0x41d276[_0x8c97('0x29')](0x194);}return _0x24cd2a;};}function handleError(_0x354251,_0x42464a){_0x42464a=_0x42464a||0x1f4;return function(_0x18c81a){logger['error'](_0x18c81a['stack']);if(_0x18c81a[_0x8c97('0x2a')]){delete _0x18c81a[_0x8c97('0x2a')];}_0x354251[_0x8c97('0x1c')](_0x42464a)['send'](_0x18c81a);};}exports['index']=function(_0x25ef83,_0x37986d){var _0x34095={},_0x1609de={},_0x34f8be={'count':0x0,'rows':[]};var _0x248f0b=_['map'](db[_0x8c97('0x2b')]['rawAttributes'],function(_0x2e8b90){return{'name':_0x2e8b90['fieldName'],'type':_0x2e8b90[_0x8c97('0x2c')][_0x8c97('0x2d')]};});_0x1609de['model']=_[_0x8c97('0x2e')](_['map'](_0x248f0b,_0x8c97('0x2a')),[_0x8c97('0x2a')]);_0x1609de[_0x8c97('0x2f')]=_[_0x8c97('0x30')](_0x25ef83[_0x8c97('0x2f')]);_0x1609de[_0x8c97('0x31')]=_['intersection'](_0x1609de['model'],_0x1609de[_0x8c97('0x2f')]);_0x34095[_0x8c97('0x32')]=_[_0x8c97('0x33')](_0x1609de['model'],qs[_0x8c97('0x34')](_0x25ef83['query']['fields']));_0x34095[_0x8c97('0x32')]=_0x34095[_0x8c97('0x32')][_0x8c97('0x35')]?_0x34095[_0x8c97('0x32')]:_0x1609de[_0x8c97('0x36')];if(!_0x25ef83[_0x8c97('0x2f')]['hasOwnProperty'](_0x8c97('0x37'))){_0x34095[_0x8c97('0x20')]=qs[_0x8c97('0x20')](_0x25ef83[_0x8c97('0x2f')][_0x8c97('0x20')]);_0x34095[_0x8c97('0x1f')]=qs[_0x8c97('0x1f')](_0x25ef83[_0x8c97('0x2f')]['offset']);}_0x34095[_0x8c97('0x38')]=qs[_0x8c97('0x39')](_0x25ef83[_0x8c97('0x2f')][_0x8c97('0x39')]);_0x34095[_0x8c97('0x3a')]=qs[_0x8c97('0x31')](_['pick'](_0x25ef83[_0x8c97('0x2f')],_0x1609de[_0x8c97('0x31')]));if(_0x25ef83[_0x8c97('0x2f')][_0x8c97('0x3b')]){_0x34095[_0x8c97('0x3a')]=_[_0x8c97('0x3c')](_0x34095[_0x8c97('0x3a')],{'$or':_[_0x8c97('0x3d')](_0x248f0b,function(_0x42a502){if(_0x42a502['type']!==_0x8c97('0x3e')){var _0x3bcce3={};_0x3bcce3[_0x42a502[_0x8c97('0x2a')]]={'$like':'%'+_0x25ef83[_0x8c97('0x2f')][_0x8c97('0x3b')]+'%'};return _0x3bcce3;}})});}_0x34095=_[_0x8c97('0x3c')]({},_0x34095,_0x25ef83['options']);var _0x20b9c3={'where':_0x34095[_0x8c97('0x3a')]};return db[_0x8c97('0x2b')][_0x8c97('0x1e')](_0x20b9c3)[_0x8c97('0x28')](function(_0x4374c5){_0x34f8be[_0x8c97('0x1e')]=_0x4374c5;if(_0x25ef83[_0x8c97('0x2f')][_0x8c97('0x3f')]){_0x34095[_0x8c97('0x40')]=[{'all':!![]}];}return db[_0x8c97('0x2b')][_0x8c97('0x41')](_0x34095);})[_0x8c97('0x28')](function(_0x3cab0e){_0x34f8be[_0x8c97('0x42')]=_0x3cab0e;return _0x34f8be;})[_0x8c97('0x28')](respondWithFilteredResult(_0x37986d,_0x34095))[_0x8c97('0x43')](handleError(_0x37986d,null));};exports[_0x8c97('0x44')]=function(_0x122489,_0x100a85){var _0x4cf496={'raw':!![],'where':{'id':_0x122489[_0x8c97('0x45')]['id']}},_0x111e5b={};_0x111e5b[_0x8c97('0x36')]=_[_0x8c97('0x30')](db[_0x8c97('0x2b')][_0x8c97('0x46')]);_0x111e5b['query']=_[_0x8c97('0x30')](_0x122489[_0x8c97('0x2f')]);_0x111e5b[_0x8c97('0x31')]=_[_0x8c97('0x33')](_0x111e5b[_0x8c97('0x36')],_0x111e5b[_0x8c97('0x2f')]);_0x4cf496[_0x8c97('0x32')]=_[_0x8c97('0x33')](_0x111e5b[_0x8c97('0x36')],qs['fields'](_0x122489[_0x8c97('0x2f')][_0x8c97('0x34')]));_0x4cf496[_0x8c97('0x32')]=_0x4cf496[_0x8c97('0x32')][_0x8c97('0x35')]?_0x4cf496['attributes']:_0x111e5b['model'];if(_0x122489[_0x8c97('0x2f')]['includeAll']){_0x4cf496[_0x8c97('0x40')]=[{'all':!![]}];}_0x4cf496=_[_0x8c97('0x3c')]({},_0x4cf496,_0x122489['options']);return db[_0x8c97('0x2b')][_0x8c97('0x47')](_0x4cf496)['then'](handleEntityNotFound(_0x100a85,null))['then'](respondWithResult(_0x100a85,null))[_0x8c97('0x43')](handleError(_0x100a85,null));};exports[_0x8c97('0x48')]=function(_0x52e2bf,_0x52f6bb){return db['VoiceMailMessage'][_0x8c97('0x48')](_0x52e2bf['body'],{})['then'](respondWithResult(_0x52f6bb,0xc9))[_0x8c97('0x43')](handleError(_0x52f6bb,null));};exports[_0x8c97('0x27')]=function(_0x33ed93,_0x1a185c){if(_0x33ed93[_0x8c97('0x49')]['id']){delete _0x33ed93[_0x8c97('0x49')]['id'];}return db['VoiceMailMessage'][_0x8c97('0x47')]({'where':{'id':_0x33ed93[_0x8c97('0x45')]['id']}})[_0x8c97('0x28')](handleEntityNotFound(_0x1a185c,null))[_0x8c97('0x28')](saveUpdates(_0x33ed93[_0x8c97('0x49')],null))[_0x8c97('0x28')](respondWithResult(_0x1a185c,null))[_0x8c97('0x43')](handleError(_0x1a185c,null));};exports[_0x8c97('0x4a')]=function(_0x460261,_0x1147f9){return db[_0x8c97('0x2b')][_0x8c97('0x47')]({'where':{'id':_0x460261[_0x8c97('0x45')]['id']}})['then'](handleEntityNotFound(_0x1147f9,null))[_0x8c97('0x28')](removeEntity(_0x1147f9,null))[_0x8c97('0x43')](handleError(_0x1147f9,null));};exports[_0x8c97('0x4b')]=function(_0x22185d,_0x1252e1,_0xa489fc){return db[_0x8c97('0x2b')][_0x8c97('0x47')]({'where':{'id':_0x22185d[_0x8c97('0x45')]['id']},'attributes':['id',_0x8c97('0x4c'),_0x8c97('0x4d')]})[_0x8c97('0x28')](handleEntityNotFound(_0x1252e1,null))['then'](function(_0x461bc9){if(_0x461bc9){if(!_0x461bc9[_0x8c97('0x4c')]){throw new db[(_0x8c97('0x4e'))]['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x36153f={'Content-Type':'audio/wav','Content-Disposition':_0x8c97('0x4f')};if(_0x461bc9[_0x8c97('0x4d')]){_0x36153f[_0x8c97('0x50')]=_0x8c97('0x51')+_0x461bc9[_0x8c97('0x4d')]+_0x8c97('0x52');}_0x1252e1[_0x8c97('0x21')](_0x36153f);return _0x1252e1[_0x8c97('0x53')](new Buffer(_0x461bc9['recording']));}})[_0x8c97('0x43')](handleError(_0x1252e1,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c61f3ad..d29860a 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 _0xc691=['../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x23b8c2,_0x33852c){var _0x4554e3=function(_0xc3d096){while(--_0xc3d096){_0x23b8c2['push'](_0x23b8c2['shift']());}};_0x4554e3(++_0x33852c);}(_0xc691,0x66));var _0x1c69=function(_0x10e8c9,_0x2b8a19){_0x10e8c9=_0x10e8c9-0x0;var _0x4663cd=_0xc691[_0x10e8c9];return _0x4663cd;};'use strict';var _=require(_0x1c69('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1c69('0x1'));var BPromise=require(_0x1c69('0x2'));var rp=require(_0x1c69('0x3'));var fs=require('fs');var path=require(_0x1c69('0x4'));var rimraf=require(_0x1c69('0x5'));var config=require(_0x1c69('0x6'));var attributes=require(_0x1c69('0x7'));module[_0x1c69('0x8')]=function(_0x424454,_0x2fe0c0){return _0x424454['define'](_0x1c69('0x9'),attributes,{'tableName':_0x1c69('0xa'),'paranoid':![],'indexes':[{'name':_0x1c69('0xb'),'fields':[_0x1c69('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x69f0=['bluebird','request-promise','rimraf','exports','VoiceMailMessage','dir','lodash','util','../../config/logger','api'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x69f0,0x11e));var _0x069f=function(_0x1d5b19,_0x18702c){_0x1d5b19=_0x1d5b19-0x0;var _0x1b9f77=_0x69f0[_0x1d5b19];return _0x1b9f77;};'use strict';var _=require(_0x069f('0x0'));var util=require(_0x069f('0x1'));var logger=require(_0x069f('0x2'))(_0x069f('0x3'));var moment=require('moment');var BPromise=require(_0x069f('0x4'));var rp=require(_0x069f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x069f('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0x069f('0x7')]=function(_0x35ef46,_0x2576bd){return _0x35ef46['define'](_0x069f('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x069f('0x9'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 93d888d..9e4bb57 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 _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1129cb,_0x41d22c){var _0x2bc37f=function(_0x44c1fa){while(--_0x44c1fa){_0x1129cb['push'](_0x1129cb['shift']());}};_0x2bc37f(++_0x41d22c);}(_0x57ca,0x108));var _0xa57c=function(_0x576b62,_0xdb7704){_0x576b62=_0x576b62-0x0;var _0x595648=_0x57ca[_0x576b62];return _0x595648;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x46df80,_0x1fd008){var _0x55f0da=function(_0x597403){while(--_0x597403){_0x46df80['push'](_0x46df80['shift']());}};_0x55f0da(++_0x1fd008);}(_0x5f66,0x1a0));var _0x65f6=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5f66[_0xefd519];return _0x4bb882;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 6ced12e..6314d6b 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 _0x81d9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/sounds','post','create','addSound','put','/:id','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util'];(function(_0x3c0854,_0x217946){var _0x1f0b34=function(_0x153769){while(--_0x153769){_0x3c0854['push'](_0x3c0854['shift']());}};_0x1f0b34(++_0x217946);}(_0x81d9,0x1e1));var _0x981d=function(_0x1b4b1f,_0x4462b6){_0x1b4b1f=_0x1b4b1f-0x0;var _0x108025=_0x81d9[_0x1b4b1f];return _0x108025;};'use strict';var multer=require(_0x981d('0x0'));var util=require(_0x981d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x981d('0x2'));var router=express[_0x981d('0x3')]();var auth=require(_0x981d('0x4'));var interaction=require(_0x981d('0x5'));var config=require(_0x981d('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x981d('0x7')]('/',auth[_0x981d('0x8')](),controller[_0x981d('0x9')]);router[_0x981d('0x7')]('/:id',auth[_0x981d('0x8')](),controller[_0x981d('0xa')]);router['get'](_0x981d('0xb'),auth[_0x981d('0x8')](),controller['getSounds']);router[_0x981d('0xc')]('/',auth[_0x981d('0x8')](),controller[_0x981d('0xd')]);router[_0x981d('0xc')](_0x981d('0xb'),auth['isAuthenticated'](),controller[_0x981d('0xe')]);router[_0x981d('0xf')](_0x981d('0x10'),auth[_0x981d('0x8')](),controller[_0x981d('0x11')]);router['delete'](_0x981d('0x10'),auth['isAuthenticated'](),controller[_0x981d('0x12')]);router[_0x981d('0x13')](_0x981d('0x14'),auth['isAuthenticated'](),controller[_0x981d('0x15')]);module[_0x981d('0x16')]=router; \ No newline at end of file +var _0xa7c8=['isAuthenticated','index','show','/:id/sounds','getSounds','post','addSound','put','update','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa7c8,0x114));var _0x8a7c=function(_0x577f6b,_0x2b6d7b){_0x577f6b=_0x577f6b-0x0;var _0x138470=_0xa7c8[_0x577f6b];return _0x138470;};'use strict';var multer=require(_0x8a7c('0x0'));var util=require(_0x8a7c('0x1'));var path=require(_0x8a7c('0x2'));var timeout=require(_0x8a7c('0x3'));var express=require(_0x8a7c('0x4'));var router=express[_0x8a7c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x8a7c('0x6'));var config=require(_0x8a7c('0x7'));var controller=require(_0x8a7c('0x8'));router[_0x8a7c('0x9')]('/',auth[_0x8a7c('0xa')](),controller[_0x8a7c('0xb')]);router[_0x8a7c('0x9')]('/:id',auth[_0x8a7c('0xa')](),controller[_0x8a7c('0xc')]);router[_0x8a7c('0x9')](_0x8a7c('0xd'),auth[_0x8a7c('0xa')](),controller[_0x8a7c('0xe')]);router[_0x8a7c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8a7c('0xf')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x8a7c('0x10')]);router[_0x8a7c('0x11')]('/:id',auth[_0x8a7c('0xa')](),controller[_0x8a7c('0x12')]);router['delete']('/:id',auth[_0x8a7c('0xa')](),controller[_0x8a7c('0x13')]);router['delete'](_0x8a7c('0x14'),auth[_0x8a7c('0xa')](),controller['removeSound']);module[_0x8a7c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 689eaff..fd34905 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 _0x3491=['quietmp3nb','mp3','files','STRING','TIMESTAMP','BOOLEAN','sequelize','exports','ENUM','custom','mp3nb'];(function(_0x2fc578,_0x3776cd){var _0x58cb66=function(_0x55ddca){while(--_0x55ddca){_0x2fc578['push'](_0x2fc578['shift']());}};_0x58cb66(++_0x3776cd);}(_0x3491,0x17c));var _0x1349=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3491[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x1349('0x0'));module[_0x1349('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1349('0x2')](_0x1349('0x3'),'files',_0x1349('0x4'),_0x1349('0x5'),'quietmp3',_0x1349('0x6')),'allowNull':!![],'defaultValue':_0x1349('0x7')},'directory':{'type':Sequelize[_0x1349('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x1349('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1349('0x8')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x1349('0x9')},'defaultEntry':{'type':Sequelize[_0x1349('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xccfd=['ENUM','files','mp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','exports','STRING','name'];(function(_0x472302,_0x57e6ac){var _0xff6e3f=function(_0x1054ae){while(--_0x1054ae){_0x472302['push'](_0x472302['shift']());}};_0xff6e3f(++_0x57e6ac);}(_0xccfd,0x131));var _0xdccf=function(_0x15462b,_0x4fcf41){_0x15462b=_0x15462b-0x0;var _0x2295fe=_0xccfd[_0x15462b];return _0x2295fe;};'use strict';var Sequelize=require('sequelize');module[_0xdccf('0x0')]={'name':{'type':Sequelize[_0xdccf('0x1')],'allowNull':![],'unique':_0xdccf('0x2')},'mode':{'type':Sequelize[_0xdccf('0x3')]('custom',_0xdccf('0x4'),_0xdccf('0x5'),'quietmp3nb',_0xdccf('0x6'),_0xdccf('0x7')),'allowNull':!![],'defaultValue':_0xdccf('0x4')},'directory':{'type':Sequelize[_0xdccf('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0xdccf('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xdccf('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xdccf('0x1')],'allowNull':!![],'defaultValue':_0xdccf('0x8')},'format':{'type':Sequelize[_0xdccf('0x1')],'allowNull':!![]},'stamp':{'type':_0xdccf('0x9')},'defaultEntry':{'type':Sequelize[_0xdccf('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index dec6c04..fb0689f 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 _0x6cef=['hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','MusicOnHolds','UserProfileResource','then','end','stack','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','name','filter','merge','options','include','rows','catch','show','params','intersection','includeAll','find','body','create','sequelize','transaction','mode','directory','join','server/files/moh','files','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','root','server/files/sounds/converted','%s.%s','basename','format','symlinkSync','removeSound','findOne','id2','createdAt','getSounds'];(function(_0x159e18,_0x4feb91){var _0x7ac077=function(_0x39565a){while(--_0x39565a){_0x159e18['push'](_0x159e18['shift']());}};_0x7ac077(++_0x4feb91);}(_0x6cef,0x75));var _0xf6ce=function(_0x14d992,_0xa6ea84){_0x14d992=_0x14d992-0x0;var _0x10a29f=_0x6cef[_0x14d992];return _0x10a29f;};'use strict';var pdf=require(_0xf6ce('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf6ce('0x1'));var zipdir=require(_0xf6ce('0x2'));var jsonpatch=require(_0xf6ce('0x3'));var rp=require(_0xf6ce('0x4'));var moment=require(_0xf6ce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf6ce('0x6'));var util=require(_0xf6ce('0x7'));var path=require(_0xf6ce('0x8'));var sox=require(_0xf6ce('0x9'));var csv=require('to-csv');var ejs=require(_0xf6ce('0xa'));var fs=require('fs');var _=require(_0xf6ce('0xb'));var squel=require(_0xf6ce('0xc'));var crypto=require(_0xf6ce('0xd'));var jsforce=require(_0xf6ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf6ce('0xf'));var querystring=require(_0xf6ce('0x10'));var Papa=require(_0xf6ce('0x11'));var Redis=require(_0xf6ce('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf6ce('0x13'));var as=require(_0xf6ce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6ce('0x15'))(_0xf6ce('0x16'));var utils=require(_0xf6ce('0x17'));var config=require('../../config/environment');var db=require(_0xf6ce('0x18'))['db'];function respondWithStatusCode(_0x380cea,_0x4fad3f){_0x4fad3f=_0x4fad3f||0xcc;return function(_0x3f9742){if(_0x3f9742){return _0x380cea[_0xf6ce('0x19')](_0x4fad3f);}return _0x380cea[_0xf6ce('0x1a')](_0x4fad3f)['end']();};}function respondWithResult(_0x5268de,_0x4664ca){_0x4664ca=_0x4664ca||0xc8;return function(_0x245ff8){if(_0x245ff8){return _0x5268de[_0xf6ce('0x1a')](_0x4664ca)[_0xf6ce('0x1b')](_0x245ff8);}};}function respondWithFilteredResult(_0x124d04,_0x413835){return function(_0x3411b4){if(_0x3411b4){var _0x317337=_0x3411b4[_0xf6ce('0x1c')],_0xa198e4=_0x413835[_0xf6ce('0x1d')],_0x57c270=_0x413835[_0xf6ce('0x1d')]+_0x413835[_0xf6ce('0x1e')],_0x13f36d;if(_0x57c270>=_0x317337){_0x57c270=_0x317337;_0x13f36d=0xc8;}else{_0x13f36d=0xce;}_0x124d04[_0xf6ce('0x1a')](_0x13f36d);return _0x124d04[_0xf6ce('0x1f')]('Content-Range',_0xa198e4+'-'+_0x57c270+'/'+_0x317337)[_0xf6ce('0x1b')](_0x3411b4);}return null;};}function patchUpdates(_0x547e76){return function(_0x5a365a){try{jsonpatch[_0xf6ce('0x20')](_0x5a365a,_0x547e76,!![]);}catch(_0x11adf9){return BPromise[_0xf6ce('0x21')](_0x11adf9);}return _0x5a365a[_0xf6ce('0x22')]();};}function saveUpdates(_0x8c8772,_0x563547){return function(_0x21ec47){if(_0x21ec47){return _0x21ec47[_0xf6ce('0x23')](_0x8c8772)['then'](function(_0xf444c){return _0xf444c;});}return null;};}function removeEntity(_0x128605,_0x62814){return function(_0x11e631){if(_0x11e631){return _0x11e631[_0xf6ce('0x24')]()['then'](function(){var _0x3daf57=_0x11e631['get']({'plain':!![]});var _0x2930a1=_0xf6ce('0x25');return db[_0xf6ce('0x26')]['destroy']({'where':{'type':_0x2930a1,'resourceId':_0x3daf57['id']}})['then'](function(){return _0x11e631;});})[_0xf6ce('0x27')](function(){_0x128605[_0xf6ce('0x1a')](0xcc)[_0xf6ce('0x28')]();});}};}function handleEntityNotFound(_0x1d1ca5,_0x315144){return function(_0x18e06c){if(!_0x18e06c){_0x1d1ca5[_0xf6ce('0x19')](0x194);}return _0x18e06c;};}function handleError(_0x1f2208,_0x4db357){_0x4db357=_0x4db357||0x1f4;return function(_0x560de0){logger['error'](_0x560de0[_0xf6ce('0x29')]);if(_0x560de0['name']){delete _0x560de0['name'];}_0x1f2208[_0xf6ce('0x1a')](_0x4db357)[_0xf6ce('0x2a')](_0x560de0);};}exports[_0xf6ce('0x2b')]=function(_0x388b9d,_0x437e6c){var _0xe4ba4d={},_0x25cea6={},_0x38719d={'count':0x0,'rows':[]};var _0x3c038b=_['map'](db[_0xf6ce('0x2c')][_0xf6ce('0x2d')],function(_0x12d9d7){return{'name':_0x12d9d7[_0xf6ce('0x2e')],'type':_0x12d9d7[_0xf6ce('0x2f')][_0xf6ce('0x30')]};});_0x25cea6[_0xf6ce('0x31')]=_[_0xf6ce('0x32')](_0x3c038b,'name');_0x25cea6[_0xf6ce('0x33')]=_[_0xf6ce('0x34')](_0x388b9d[_0xf6ce('0x33')]);_0x25cea6[_0xf6ce('0x35')]=_['intersection'](_0x25cea6['model'],_0x25cea6[_0xf6ce('0x33')]);_0xe4ba4d[_0xf6ce('0x36')]=_['intersection'](_0x25cea6[_0xf6ce('0x31')],qs[_0xf6ce('0x37')](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x37')]));_0xe4ba4d[_0xf6ce('0x36')]=_0xe4ba4d[_0xf6ce('0x36')][_0xf6ce('0x38')]?_0xe4ba4d[_0xf6ce('0x36')]:_0x25cea6['model'];if(!_0x388b9d[_0xf6ce('0x33')]['hasOwnProperty'](_0xf6ce('0x39'))){_0xe4ba4d[_0xf6ce('0x1e')]=qs[_0xf6ce('0x1e')](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x1e')]);_0xe4ba4d[_0xf6ce('0x1d')]=qs['offset'](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x1d')]);}_0xe4ba4d[_0xf6ce('0x3a')]=qs[_0xf6ce('0x3b')](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x3b')]);_0xe4ba4d[_0xf6ce('0x3c')]=qs[_0xf6ce('0x35')](_[_0xf6ce('0x3d')](_0x388b9d[_0xf6ce('0x33')],_0x25cea6[_0xf6ce('0x35')]));if(_0x388b9d['query']['filter']){_0xe4ba4d[_0xf6ce('0x3c')]=_['merge'](_0xe4ba4d['where'],{'$or':_[_0xf6ce('0x32')](_0x3c038b,function(_0x2a6708){if(_0x2a6708[_0xf6ce('0x2f')]!=='VIRTUAL'){var _0x2a6331={};_0x2a6331[_0x2a6708[_0xf6ce('0x3e')]]={'$like':'%'+_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x3f')]+'%'};return _0x2a6331;}})});}_0xe4ba4d=_[_0xf6ce('0x40')]({},_0xe4ba4d,_0x388b9d[_0xf6ce('0x41')]);var _0x310849={'where':_0xe4ba4d['where']};return db[_0xf6ce('0x2c')][_0xf6ce('0x1c')](_0x310849)['then'](function(_0x2cd4df){_0x38719d[_0xf6ce('0x1c')]=_0x2cd4df;if(_0x388b9d[_0xf6ce('0x33')]['includeAll']){_0xe4ba4d[_0xf6ce('0x42')]=[{'all':!![]}];}return db[_0xf6ce('0x2c')]['findAll'](_0xe4ba4d);})[_0xf6ce('0x27')](function(_0x22746d){_0x38719d[_0xf6ce('0x43')]=_0x22746d;return _0x38719d;})[_0xf6ce('0x27')](respondWithFilteredResult(_0x437e6c,_0xe4ba4d))[_0xf6ce('0x44')](handleError(_0x437e6c,null));};exports[_0xf6ce('0x45')]=function(_0x432cdb,_0x26c738){var _0x51c36c={'raw':![],'where':{'id':_0x432cdb[_0xf6ce('0x46')]['id']}},_0x4f02a9={};_0x4f02a9[_0xf6ce('0x31')]=_['keys'](db[_0xf6ce('0x2c')][_0xf6ce('0x2d')]);_0x4f02a9[_0xf6ce('0x33')]=_[_0xf6ce('0x34')](_0x432cdb[_0xf6ce('0x33')]);_0x4f02a9[_0xf6ce('0x35')]=_['intersection'](_0x4f02a9[_0xf6ce('0x31')],_0x4f02a9[_0xf6ce('0x33')]);_0x51c36c[_0xf6ce('0x36')]=_[_0xf6ce('0x47')](_0x4f02a9[_0xf6ce('0x31')],qs[_0xf6ce('0x37')](_0x432cdb['query'][_0xf6ce('0x37')]));_0x51c36c[_0xf6ce('0x36')]=_0x51c36c[_0xf6ce('0x36')][_0xf6ce('0x38')]?_0x51c36c[_0xf6ce('0x36')]:_0x4f02a9['model'];if(_0x432cdb[_0xf6ce('0x33')][_0xf6ce('0x48')]){_0x51c36c['include']=[{'all':!![]}];}_0x51c36c=_[_0xf6ce('0x40')]({},_0x51c36c,_0x432cdb['options']);return db['VoiceMusicOnHold'][_0xf6ce('0x49')](_0x51c36c)['then'](handleEntityNotFound(_0x26c738,null))['then'](respondWithResult(_0x26c738,null))['catch'](handleError(_0x26c738,null));};exports[_0xf6ce('0x23')]=function(_0x402169,_0x52e1cc){if(_0x402169['body']['id']){delete _0x402169['body']['id'];}return db[_0xf6ce('0x2c')][_0xf6ce('0x49')]({'where':{'id':_0x402169[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](handleEntityNotFound(_0x52e1cc,null))['then'](saveUpdates(_0x402169[_0xf6ce('0x4a')],null))['then'](respondWithResult(_0x52e1cc,null))[_0xf6ce('0x44')](handleError(_0x52e1cc,null));};exports[_0xf6ce('0x4b')]=function(_0xb50110,_0x368df4,_0x3e7368){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x47db75){if(_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x4e')]==='files'){_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x4f')]=path[_0xf6ce('0x50')](config['root'],_0xf6ce('0x51'),_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x3e')]);}return db[_0xf6ce('0x2c')][_0xf6ce('0x4b')](_0xb50110['body'],{'transaction':_0x47db75})[_0xf6ce('0x27')](function(_0x18e14e){if(_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x4e')]===_0xf6ce('0x52')){fs[_0xf6ce('0x53')](_0x18e14e['directory'],parseInt(_0xf6ce('0x54'),0x8));}var _0x39e152=_0xb50110[_0xf6ce('0x55')][_0xf6ce('0x56')]({'plain':!![]});if(!_0x39e152)throw new Error(_0xf6ce('0x57'));if(_0x39e152[_0xf6ce('0x58')]==='user'){var _0x18bf80=_0x18e14e['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf6ce('0x25'),'userProfileId':_0x39e152[_0xf6ce('0x59')]},'raw':!![]})[_0xf6ce('0x27')](function(_0x1612ae){if(_0x1612ae&&_0x1612ae[_0xf6ce('0x5a')]===0x0){return db[_0xf6ce('0x26')][_0xf6ce('0x4b')]({'name':_0x18bf80[_0xf6ce('0x3e')],'resourceId':_0x18bf80['id'],'type':_0x1612ae[_0xf6ce('0x3e')],'sectionId':_0x1612ae['id']},{})[_0xf6ce('0x27')](function(){return _0x18e14e;});}else{return _0x18e14e;}})[_0xf6ce('0x44')](function(_0x2ca0a0){logger[_0xf6ce('0x5b')](_0xf6ce('0x5c'),_0x2ca0a0);});}return _0x18e14e;});})[_0xf6ce('0x27')](respondWithResult(_0x368df4,0xc9))[_0xf6ce('0x44')](handleError(_0x368df4,null));};exports['destroy']=function(_0x4113e1,_0x20aab1,_0x2a8285){var _0x4eb6dd;return db[_0xf6ce('0x2c')][_0xf6ce('0x49')]({'where':{'id':_0x4113e1[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](function(_0x294c6f){if(_0x294c6f){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x7dbad1){return _0x294c6f[_0xf6ce('0x24')]({'transaction':_0x7dbad1,'raw':!![]})[_0xf6ce('0x27')](function(_0x4582cb){if(_0x4582cb[_0xf6ce('0x4f')]){fs[_0xf6ce('0x5d')](_0x4582cb['directory'])[_0xf6ce('0x5e')](function(_0x25f6bb){fs[_0xf6ce('0x5f')](path[_0xf6ce('0x50')](_0x4582cb[_0xf6ce('0x4f')],_0x25f6bb));});fs[_0xf6ce('0x60')](_0x4582cb[_0xf6ce('0x4f')]);}return _0x4582cb;});})[_0xf6ce('0x44')](function(_0x3216da){throw new db[(_0xf6ce('0x61'))][(_0xf6ce('0x62'))](_0x3216da[_0xf6ce('0x63')]);});}})[_0xf6ce('0x27')](handleEntityNotFound(_0x20aab1,null))[_0xf6ce('0x27')](removeEntity(_0x20aab1,null))['catch'](handleError(_0x20aab1,null));};exports[_0xf6ce('0x64')]=function(_0x3f6731,_0x92c9b5,_0x58703e){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x418b17){var _0x218de8;return db[_0xf6ce('0x2c')][_0xf6ce('0x49')]({'where':{'id':_0x3f6731[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](function(_0x17af32){if(_0x17af32){_0x218de8=_0x17af32;return _0x17af32[_0xf6ce('0x64')](_0x3f6731[_0xf6ce('0x4a')]['id'],{'transaction':_0x418b17});}})[_0xf6ce('0x27')](function(_0x264adc){if(_0x264adc){return db[_0xf6ce('0x65')]['findOne']({'where':{'id':_0x3f6731['body']['id']},'attributes':['id','name',_0xf6ce('0x66'),_0xf6ce('0x67'),'createdAt'],'raw':!![]});}})['then'](function(_0x872141){if(_0x872141){var _0x5df869=path['join'](config[_0xf6ce('0x68')],_0xf6ce('0x69'),util['format'](_0xf6ce('0x6a'),path[_0xf6ce('0x6b')](_0x872141[_0xf6ce('0x66')],path['extname'](_0x872141[_0xf6ce('0x66')])),_0x872141[_0xf6ce('0x67')]));var _0x57e939=path[_0xf6ce('0x50')](config[_0xf6ce('0x68')],_0xf6ce('0x51'),_0x218de8['name'],util[_0xf6ce('0x6c')](_0xf6ce('0x6a'),_0x872141[_0xf6ce('0x3e')],_0x872141[_0xf6ce('0x67')]));fs[_0xf6ce('0x6d')](_0x5df869,_0x57e939);return _0x872141;}})[_0xf6ce('0x44')](function(_0xb2455e){throw new db['Sequelize']['ValidationError'](_0xb2455e[_0xf6ce('0x63')]);});})[_0xf6ce('0x27')](handleEntityNotFound(_0x92c9b5,null))[_0xf6ce('0x27')](respondWithResult(_0x92c9b5,0xc9))['catch'](handleError(_0x92c9b5,null));};exports[_0xf6ce('0x6e')]=function(_0x4f556d,_0x3ff236,_0x297e5a){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x6b536b){var _0x2aa3e6;return db[_0xf6ce('0x2c')][_0xf6ce('0x6f')]({'where':{'id':_0x4f556d[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](handleEntityNotFound(_0x3ff236,null))['then'](function(_0x3ba575){if(_0x3ba575){_0x2aa3e6=_0x3ba575;return _0x3ba575[_0xf6ce('0x6e')](_0x4f556d[_0xf6ce('0x46')][_0xf6ce('0x70')]);}})[_0xf6ce('0x27')](function(_0x14642c){if(_0x14642c){return db[_0xf6ce('0x65')][_0xf6ce('0x6f')]({'where':{'id':_0x4f556d[_0xf6ce('0x46')]['id2']},'attributes':['id',_0xf6ce('0x3e'),'save_name',_0xf6ce('0x67'),_0xf6ce('0x71')],'raw':!![]});}})[_0xf6ce('0x27')](function(_0x101971){if(_0x101971){fs[_0xf6ce('0x5f')](path[_0xf6ce('0x50')](_0x2aa3e6[_0xf6ce('0x4f')],util[_0xf6ce('0x6c')](_0xf6ce('0x6a'),_0x101971[_0xf6ce('0x3e')],_0x101971['converted_format'])));return _0x101971;}})[_0xf6ce('0x44')](function(_0x4a1b20){throw new db[(_0xf6ce('0x61'))][(_0xf6ce('0x62'))](_0x4a1b20['message']);});})['then'](handleEntityNotFound(_0x3ff236,null))[_0xf6ce('0x27')](respondWithStatusCode(_0x3ff236,0xcc))[_0xf6ce('0x44')](handleError(_0x3ff236,null));};exports[_0xf6ce('0x72')]=function(_0x1da672,_0x1b3afa,_0x29573a){var _0x5bc717={};var _0xcefb9d={};var _0xa9c538;var _0x5c5d50;return db[_0xf6ce('0x2c')][_0xf6ce('0x6f')]({'where':{'id':_0x1da672['params']['id']}})['then'](handleEntityNotFound(_0x1b3afa,null))[_0xf6ce('0x27')](function(_0x237810){if(_0x237810){_0xa9c538=_0x237810;_0xcefb9d[_0xf6ce('0x31')]=_['keys'](db['Sound'][_0xf6ce('0x2d')]);_0xcefb9d[_0xf6ce('0x33')]=_[_0xf6ce('0x34')](_0x1da672[_0xf6ce('0x33')]);_0xcefb9d[_0xf6ce('0x35')]=_['intersection'](_0xcefb9d['model'],_0xcefb9d['query']);_0x5bc717[_0xf6ce('0x36')]=_[_0xf6ce('0x47')](_0xcefb9d[_0xf6ce('0x31')],qs[_0xf6ce('0x37')](_0x1da672[_0xf6ce('0x33')][_0xf6ce('0x37')]));_0x5bc717[_0xf6ce('0x36')]=_0x5bc717['attributes'][_0xf6ce('0x38')]?_0x5bc717['attributes']:_0xcefb9d['model'];_0x5bc717[_0xf6ce('0x3a')]=qs[_0xf6ce('0x3b')](_0x1da672[_0xf6ce('0x33')][_0xf6ce('0x3b')]);_0x5bc717['where']=qs['filters'](_[_0xf6ce('0x3d')](_0x1da672[_0xf6ce('0x33')],_0xcefb9d[_0xf6ce('0x35')]));if(_0x1da672[_0xf6ce('0x33')]['filter']){_0x5bc717[_0xf6ce('0x3c')]=_['merge'](_0x5bc717['where'],{'$or':_[_0xf6ce('0x32')](_0x5bc717[_0xf6ce('0x36')],function(_0xc7d08){var _0x125cda={};_0x125cda[_0xc7d08]={'$like':'%'+_0x1da672['query'][_0xf6ce('0x3f')]+'%'};return _0x125cda;})});}_0x5bc717=_[_0xf6ce('0x40')]({},_0x5bc717,_0x1da672[_0xf6ce('0x41')]);return _0xa9c538[_0xf6ce('0x72')](_0x5bc717);}})[_0xf6ce('0x27')](function(_0x43a54c){if(_0x43a54c){_0x5c5d50=_0x43a54c[_0xf6ce('0x38')];if(!_0x1da672[_0xf6ce('0x33')][_0xf6ce('0x73')](_0xf6ce('0x39'))){_0x5bc717[_0xf6ce('0x1e')]=qs[_0xf6ce('0x1e')](_0x1da672['query'][_0xf6ce('0x1e')]);_0x5bc717[_0xf6ce('0x1d')]=qs[_0xf6ce('0x1d')](_0x1da672['query'][_0xf6ce('0x1d')]);}return _0xa9c538[_0xf6ce('0x72')](_0x5bc717);}})['then'](function(_0x12d0c0){if(_0x12d0c0){return _0x12d0c0?{'count':_0x5c5d50,'rows':_0x12d0c0}:null;}})[_0xf6ce('0x27')](respondWithResult(_0x1b3afa,null))['catch'](handleError(_0x1b3afa,null));}; \ No newline at end of file +var _0xab69=['send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','catch','show','params','length','body','create','transaction','mode','files','directory','mkdirSync','user','role','get','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','unlinkSync','join','rmdirSync','ValidationError','message','find','addSound','Sound','findOne','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','save_name','extname','converted_format','server/files/moh','symlinkSync','Sequelize','removeSound','id2','options','nolimit','getSounds','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','count','offset','limit','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name'];(function(_0xdf5d0d,_0x363383){var _0x5a7a8f=function(_0x31c40f){while(--_0x31c40f){_0xdf5d0d['push'](_0xdf5d0d['shift']());}};_0x5a7a8f(++_0x363383);}(_0xab69,0xaf));var _0x9ab6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xab69[_0x21a9d9];return _0x46adce;};'use strict';var pdf=require(_0x9ab6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ab6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ab6('0x2'));var rp=require(_0x9ab6('0x3'));var moment=require(_0x9ab6('0x4'));var BPromise=require(_0x9ab6('0x5'));var Mustache=require(_0x9ab6('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9ab6('0x7'));var csv=require(_0x9ab6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9ab6('0x9'));var squel=require(_0x9ab6('0xa'));var crypto=require(_0x9ab6('0xb'));var jsforce=require(_0x9ab6('0xc'));var deskjs=require(_0x9ab6('0xd'));var toCsv=require(_0x9ab6('0x8'));var querystring=require(_0x9ab6('0xe'));var Papa=require('papaparse');var Redis=require(_0x9ab6('0xf'));var authService=require(_0x9ab6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9ab6('0x11'));var hardwareService=require(_0x9ab6('0x12'));var logger=require(_0x9ab6('0x13'))('api');var utils=require(_0x9ab6('0x14'));var config=require('../../config/environment');var db=require(_0x9ab6('0x15'))['db'];function respondWithStatusCode(_0x493aa2,_0x19a982){_0x19a982=_0x19a982||0xcc;return function(_0x33e475){if(_0x33e475){return _0x493aa2[_0x9ab6('0x16')](_0x19a982);}return _0x493aa2['status'](_0x19a982)['end']();};}function respondWithResult(_0x5eb1f1,_0x32adf0){_0x32adf0=_0x32adf0||0xc8;return function(_0x54b254){if(_0x54b254){return _0x5eb1f1[_0x9ab6('0x17')](_0x32adf0)['json'](_0x54b254);}};}function respondWithFilteredResult(_0x497abd,_0x59f14d){return function(_0x143849){if(_0x143849){var _0x242b21=_0x143849[_0x9ab6('0x18')],_0xda741a=_0x59f14d[_0x9ab6('0x19')],_0x2e981e=_0x59f14d[_0x9ab6('0x19')]+_0x59f14d[_0x9ab6('0x1a')],_0x2992fc;if(_0x2e981e>=_0x242b21){_0x2e981e=_0x242b21;_0x2992fc=0xc8;}else{_0x2992fc=0xce;}_0x497abd[_0x9ab6('0x17')](_0x2992fc);return _0x497abd['set']('Content-Range',_0xda741a+'-'+_0x2e981e+'/'+_0x242b21)['json'](_0x143849);}return null;};}function patchUpdates(_0x174687){return function(_0xa2683d){try{jsonpatch[_0x9ab6('0x1b')](_0xa2683d,_0x174687,!![]);}catch(_0xc493b4){return BPromise[_0x9ab6('0x1c')](_0xc493b4);}return _0xa2683d[_0x9ab6('0x1d')]();};}function saveUpdates(_0x56a3b1,_0x286727){return function(_0x1a6f26){if(_0x1a6f26){return _0x1a6f26[_0x9ab6('0x1e')](_0x56a3b1)['then'](function(_0x465f91){return _0x465f91;});}return null;};}function removeEntity(_0x3d9882,_0x43b209){return function(_0x566cce){if(_0x566cce){return _0x566cce[_0x9ab6('0x1f')]()[_0x9ab6('0x20')](function(){var _0x52eb68=_0x566cce['get']({'plain':!![]});var _0x3fc0de='MusicOnHolds';return db[_0x9ab6('0x21')][_0x9ab6('0x1f')]({'where':{'type':_0x3fc0de,'resourceId':_0x52eb68['id']}})[_0x9ab6('0x20')](function(){return _0x566cce;});})['then'](function(){_0x3d9882[_0x9ab6('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x537a70,_0x4ebb7c){return function(_0x42e135){if(!_0x42e135){_0x537a70[_0x9ab6('0x16')](0x194);}return _0x42e135;};}function handleError(_0x40e262,_0x33c758){_0x33c758=_0x33c758||0x1f4;return function(_0x1439a2){logger[_0x9ab6('0x22')](_0x1439a2[_0x9ab6('0x23')]);if(_0x1439a2[_0x9ab6('0x24')]){delete _0x1439a2[_0x9ab6('0x24')];}_0x40e262['status'](_0x33c758)[_0x9ab6('0x25')](_0x1439a2);};}exports[_0x9ab6('0x26')]=function(_0x4e4dbd,_0x77ce01){var _0x15a8ee={},_0x17d3c8={},_0x1ebed6={'count':0x0,'rows':[]};var _0x135b83=_[_0x9ab6('0x27')](db[_0x9ab6('0x28')][_0x9ab6('0x29')],function(_0x33ab15){return{'name':_0x33ab15[_0x9ab6('0x2a')],'type':_0x33ab15['type']['key']};});_0x17d3c8['model']=_[_0x9ab6('0x27')](_0x135b83,'name');_0x17d3c8[_0x9ab6('0x2b')]=_[_0x9ab6('0x2c')](_0x4e4dbd['query']);_0x17d3c8[_0x9ab6('0x2d')]=_['intersection'](_0x17d3c8[_0x9ab6('0x2e')],_0x17d3c8[_0x9ab6('0x2b')]);_0x15a8ee[_0x9ab6('0x2f')]=_[_0x9ab6('0x30')](_0x17d3c8[_0x9ab6('0x2e')],qs[_0x9ab6('0x31')](_0x4e4dbd[_0x9ab6('0x2b')][_0x9ab6('0x31')]));_0x15a8ee['attributes']=_0x15a8ee[_0x9ab6('0x2f')]['length']?_0x15a8ee[_0x9ab6('0x2f')]:_0x17d3c8[_0x9ab6('0x2e')];if(!_0x4e4dbd[_0x9ab6('0x2b')][_0x9ab6('0x32')]('nolimit')){_0x15a8ee[_0x9ab6('0x1a')]=qs[_0x9ab6('0x1a')](_0x4e4dbd[_0x9ab6('0x2b')]['limit']);_0x15a8ee[_0x9ab6('0x19')]=qs[_0x9ab6('0x19')](_0x4e4dbd[_0x9ab6('0x2b')][_0x9ab6('0x19')]);}_0x15a8ee[_0x9ab6('0x33')]=qs[_0x9ab6('0x34')](_0x4e4dbd[_0x9ab6('0x2b')][_0x9ab6('0x34')]);_0x15a8ee[_0x9ab6('0x35')]=qs[_0x9ab6('0x2d')](_[_0x9ab6('0x36')](_0x4e4dbd['query'],_0x17d3c8[_0x9ab6('0x2d')]));if(_0x4e4dbd[_0x9ab6('0x2b')][_0x9ab6('0x37')]){_0x15a8ee['where']=_['merge'](_0x15a8ee['where'],{'$or':_[_0x9ab6('0x27')](_0x135b83,function(_0x252651){if(_0x252651['type']!==_0x9ab6('0x38')){var _0xd5bd8c={};_0xd5bd8c[_0x252651['name']]={'$like':'%'+_0x4e4dbd[_0x9ab6('0x2b')][_0x9ab6('0x37')]+'%'};return _0xd5bd8c;}})});}_0x15a8ee=_[_0x9ab6('0x39')]({},_0x15a8ee,_0x4e4dbd['options']);var _0x538d28={'where':_0x15a8ee[_0x9ab6('0x35')]};return db['VoiceMusicOnHold']['count'](_0x538d28)[_0x9ab6('0x20')](function(_0x4ee379){_0x1ebed6[_0x9ab6('0x18')]=_0x4ee379;if(_0x4e4dbd['query'][_0x9ab6('0x3a')]){_0x15a8ee['include']=[{'all':!![]}];}return db[_0x9ab6('0x28')]['findAll'](_0x15a8ee);})[_0x9ab6('0x20')](function(_0x33d932){_0x1ebed6['rows']=_0x33d932;return _0x1ebed6;})[_0x9ab6('0x20')](respondWithFilteredResult(_0x77ce01,_0x15a8ee))[_0x9ab6('0x3b')](handleError(_0x77ce01,null));};exports[_0x9ab6('0x3c')]=function(_0x38b052,_0x4254e6){var _0x112be1={'raw':![],'where':{'id':_0x38b052[_0x9ab6('0x3d')]['id']}},_0x215b0c={};_0x215b0c[_0x9ab6('0x2e')]=_[_0x9ab6('0x2c')](db[_0x9ab6('0x28')]['rawAttributes']);_0x215b0c[_0x9ab6('0x2b')]=_[_0x9ab6('0x2c')](_0x38b052['query']);_0x215b0c['filters']=_[_0x9ab6('0x30')](_0x215b0c[_0x9ab6('0x2e')],_0x215b0c[_0x9ab6('0x2b')]);_0x112be1[_0x9ab6('0x2f')]=_['intersection'](_0x215b0c[_0x9ab6('0x2e')],qs['fields'](_0x38b052['query'][_0x9ab6('0x31')]));_0x112be1['attributes']=_0x112be1[_0x9ab6('0x2f')][_0x9ab6('0x3e')]?_0x112be1[_0x9ab6('0x2f')]:_0x215b0c[_0x9ab6('0x2e')];if(_0x38b052[_0x9ab6('0x2b')][_0x9ab6('0x3a')]){_0x112be1['include']=[{'all':!![]}];}_0x112be1=_[_0x9ab6('0x39')]({},_0x112be1,_0x38b052['options']);return db[_0x9ab6('0x28')]['find'](_0x112be1)[_0x9ab6('0x20')](handleEntityNotFound(_0x4254e6,null))[_0x9ab6('0x20')](respondWithResult(_0x4254e6,null))[_0x9ab6('0x3b')](handleError(_0x4254e6,null));};exports[_0x9ab6('0x1e')]=function(_0xfdad,_0x7d4a33){if(_0xfdad['body']['id']){delete _0xfdad[_0x9ab6('0x3f')]['id'];}return db[_0x9ab6('0x28')]['find']({'where':{'id':_0xfdad[_0x9ab6('0x3d')]['id']}})[_0x9ab6('0x20')](handleEntityNotFound(_0x7d4a33,null))[_0x9ab6('0x20')](saveUpdates(_0xfdad[_0x9ab6('0x3f')],null))[_0x9ab6('0x20')](respondWithResult(_0x7d4a33,null))[_0x9ab6('0x3b')](handleError(_0x7d4a33,null));};exports[_0x9ab6('0x40')]=function(_0x560910,_0x21c677,_0x42eea9){return db['sequelize'][_0x9ab6('0x41')](function(_0x23defe){if(_0x560910[_0x9ab6('0x3f')][_0x9ab6('0x42')]===_0x9ab6('0x43')){_0x560910[_0x9ab6('0x3f')][_0x9ab6('0x44')]=path['join'](config['root'],'server/files/moh',_0x560910[_0x9ab6('0x3f')][_0x9ab6('0x24')]);}return db[_0x9ab6('0x28')][_0x9ab6('0x40')](_0x560910[_0x9ab6('0x3f')],{'transaction':_0x23defe})['then'](function(_0x39da90){if(_0x560910[_0x9ab6('0x3f')]['mode']===_0x9ab6('0x43')){fs[_0x9ab6('0x45')](_0x39da90['directory'],parseInt('0777',0x8));}var _0x3791df=_0x560910[_0x9ab6('0x46')]['get']({'plain':!![]});if(!_0x3791df)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3791df[_0x9ab6('0x47')]===_0x9ab6('0x46')){var _0x186197=_0x39da90[_0x9ab6('0x48')]({'plain':!![]});return db[_0x9ab6('0x49')]['find']({'where':{'name':_0x9ab6('0x4a'),'userProfileId':_0x3791df[_0x9ab6('0x4b')]},'raw':!![]})['then'](function(_0x5e2137){if(_0x5e2137&&_0x5e2137[_0x9ab6('0x4c')]===0x0){return db['UserProfileResource'][_0x9ab6('0x40')]({'name':_0x186197[_0x9ab6('0x24')],'resourceId':_0x186197['id'],'type':_0x5e2137[_0x9ab6('0x24')],'sectionId':_0x5e2137['id']},{})[_0x9ab6('0x20')](function(){return _0x39da90;});}else{return _0x39da90;}})['catch'](function(_0xaaee79){logger[_0x9ab6('0x22')](_0x9ab6('0x4d'),_0xaaee79);});}return _0x39da90;});})[_0x9ab6('0x20')](respondWithResult(_0x21c677,0xc9))[_0x9ab6('0x3b')](handleError(_0x21c677,null));};exports[_0x9ab6('0x1f')]=function(_0x36c820,_0x4bc75a,_0xa5540f){var _0x31c65b;return db[_0x9ab6('0x28')]['find']({'where':{'id':_0x36c820[_0x9ab6('0x3d')]['id']}})[_0x9ab6('0x20')](function(_0x5dbab6){if(_0x5dbab6){return db[_0x9ab6('0x4e')][_0x9ab6('0x41')](function(_0x13507a){return _0x5dbab6[_0x9ab6('0x1f')]({'transaction':_0x13507a,'raw':!![]})[_0x9ab6('0x20')](function(_0x5dbeaa){if(_0x5dbeaa['directory']){fs[_0x9ab6('0x4f')](_0x5dbeaa['directory'])['forEach'](function(_0x363ba6){fs[_0x9ab6('0x50')](path[_0x9ab6('0x51')](_0x5dbeaa[_0x9ab6('0x44')],_0x363ba6));});fs[_0x9ab6('0x52')](_0x5dbeaa[_0x9ab6('0x44')]);}return _0x5dbeaa;});})[_0x9ab6('0x3b')](function(_0x3d6690){throw new db['Sequelize'][(_0x9ab6('0x53'))](_0x3d6690[_0x9ab6('0x54')]);});}})[_0x9ab6('0x20')](handleEntityNotFound(_0x4bc75a,null))['then'](removeEntity(_0x4bc75a,null))[_0x9ab6('0x3b')](handleError(_0x4bc75a,null));};exports['addSound']=function(_0x470617,_0x449bcc,_0x45a052){return db[_0x9ab6('0x4e')][_0x9ab6('0x41')](function(_0x2f96c9){var _0x775b5f;return db[_0x9ab6('0x28')][_0x9ab6('0x55')]({'where':{'id':_0x470617[_0x9ab6('0x3d')]['id']}})[_0x9ab6('0x20')](function(_0x269b5a){if(_0x269b5a){_0x775b5f=_0x269b5a;return _0x269b5a[_0x9ab6('0x56')](_0x470617[_0x9ab6('0x3f')]['id'],{'transaction':_0x2f96c9});}})[_0x9ab6('0x20')](function(_0x3b2f71){if(_0x3b2f71){return db[_0x9ab6('0x57')][_0x9ab6('0x58')]({'where':{'id':_0x470617['body']['id']},'attributes':['id',_0x9ab6('0x24'),'save_name','converted_format',_0x9ab6('0x59')],'raw':!![]});}})[_0x9ab6('0x20')](function(_0x2f6488){if(_0x2f6488){var _0x4ce67a=path[_0x9ab6('0x51')](config[_0x9ab6('0x5a')],_0x9ab6('0x5b'),util[_0x9ab6('0x5c')](_0x9ab6('0x5d'),path[_0x9ab6('0x5e')](_0x2f6488[_0x9ab6('0x5f')],path[_0x9ab6('0x60')](_0x2f6488[_0x9ab6('0x5f')])),_0x2f6488[_0x9ab6('0x61')]));var _0x3ff4ba=path[_0x9ab6('0x51')](config[_0x9ab6('0x5a')],_0x9ab6('0x62'),_0x775b5f['name'],util[_0x9ab6('0x5c')]('%s.%s',_0x2f6488[_0x9ab6('0x24')],_0x2f6488[_0x9ab6('0x61')]));fs[_0x9ab6('0x63')](_0x4ce67a,_0x3ff4ba);return _0x2f6488;}})[_0x9ab6('0x3b')](function(_0x382652){throw new db[(_0x9ab6('0x64'))][(_0x9ab6('0x53'))](_0x382652['message']);});})[_0x9ab6('0x20')](handleEntityNotFound(_0x449bcc,null))[_0x9ab6('0x20')](respondWithResult(_0x449bcc,0xc9))[_0x9ab6('0x3b')](handleError(_0x449bcc,null));};exports[_0x9ab6('0x65')]=function(_0x1c9902,_0x13e5b4,_0x430530){return db[_0x9ab6('0x4e')]['transaction'](function(_0x23bf4d){var _0x364c53;return db['VoiceMusicOnHold'][_0x9ab6('0x58')]({'where':{'id':_0x1c9902['params']['id']}})['then'](handleEntityNotFound(_0x13e5b4,null))[_0x9ab6('0x20')](function(_0x346441){if(_0x346441){_0x364c53=_0x346441;return _0x346441[_0x9ab6('0x65')](_0x1c9902[_0x9ab6('0x3d')][_0x9ab6('0x66')]);}})['then'](function(_0x201b12){if(_0x201b12){return db['Sound']['findOne']({'where':{'id':_0x1c9902[_0x9ab6('0x3d')]['id2']},'attributes':['id',_0x9ab6('0x24'),_0x9ab6('0x5f'),_0x9ab6('0x61'),_0x9ab6('0x59')],'raw':!![]});}})[_0x9ab6('0x20')](function(_0x2e3a11){if(_0x2e3a11){fs[_0x9ab6('0x50')](path[_0x9ab6('0x51')](_0x364c53[_0x9ab6('0x44')],util[_0x9ab6('0x5c')](_0x9ab6('0x5d'),_0x2e3a11[_0x9ab6('0x24')],_0x2e3a11[_0x9ab6('0x61')])));return _0x2e3a11;}})[_0x9ab6('0x3b')](function(_0x6abd33){throw new db['Sequelize'][(_0x9ab6('0x53'))](_0x6abd33[_0x9ab6('0x54')]);});})[_0x9ab6('0x20')](handleEntityNotFound(_0x13e5b4,null))[_0x9ab6('0x20')](respondWithStatusCode(_0x13e5b4,0xcc))['catch'](handleError(_0x13e5b4,null));};exports['getSounds']=function(_0x4f1fba,_0x748818,_0x57b88c){var _0x276ead={};var _0x236be5={};var _0x322b30;var _0x43b09e;return db[_0x9ab6('0x28')][_0x9ab6('0x58')]({'where':{'id':_0x4f1fba[_0x9ab6('0x3d')]['id']}})[_0x9ab6('0x20')](handleEntityNotFound(_0x748818,null))[_0x9ab6('0x20')](function(_0x265c1f){if(_0x265c1f){_0x322b30=_0x265c1f;_0x236be5[_0x9ab6('0x2e')]=_[_0x9ab6('0x2c')](db[_0x9ab6('0x57')]['rawAttributes']);_0x236be5[_0x9ab6('0x2b')]=_[_0x9ab6('0x2c')](_0x4f1fba[_0x9ab6('0x2b')]);_0x236be5[_0x9ab6('0x2d')]=_[_0x9ab6('0x30')](_0x236be5[_0x9ab6('0x2e')],_0x236be5[_0x9ab6('0x2b')]);_0x276ead[_0x9ab6('0x2f')]=_[_0x9ab6('0x30')](_0x236be5[_0x9ab6('0x2e')],qs['fields'](_0x4f1fba[_0x9ab6('0x2b')][_0x9ab6('0x31')]));_0x276ead['attributes']=_0x276ead[_0x9ab6('0x2f')][_0x9ab6('0x3e')]?_0x276ead[_0x9ab6('0x2f')]:_0x236be5[_0x9ab6('0x2e')];_0x276ead[_0x9ab6('0x33')]=qs[_0x9ab6('0x34')](_0x4f1fba[_0x9ab6('0x2b')][_0x9ab6('0x34')]);_0x276ead[_0x9ab6('0x35')]=qs[_0x9ab6('0x2d')](_[_0x9ab6('0x36')](_0x4f1fba[_0x9ab6('0x2b')],_0x236be5[_0x9ab6('0x2d')]));if(_0x4f1fba['query'][_0x9ab6('0x37')]){_0x276ead[_0x9ab6('0x35')]=_['merge'](_0x276ead[_0x9ab6('0x35')],{'$or':_['map'](_0x276ead[_0x9ab6('0x2f')],function(_0x4b74ee){var _0x1ac2e2={};_0x1ac2e2[_0x4b74ee]={'$like':'%'+_0x4f1fba[_0x9ab6('0x2b')][_0x9ab6('0x37')]+'%'};return _0x1ac2e2;})});}_0x276ead=_[_0x9ab6('0x39')]({},_0x276ead,_0x4f1fba[_0x9ab6('0x67')]);return _0x322b30['getSounds'](_0x276ead);}})[_0x9ab6('0x20')](function(_0x31ef4b){if(_0x31ef4b){_0x43b09e=_0x31ef4b[_0x9ab6('0x3e')];if(!_0x4f1fba[_0x9ab6('0x2b')][_0x9ab6('0x32')](_0x9ab6('0x68'))){_0x276ead[_0x9ab6('0x1a')]=qs[_0x9ab6('0x1a')](_0x4f1fba[_0x9ab6('0x2b')][_0x9ab6('0x1a')]);_0x276ead[_0x9ab6('0x19')]=qs['offset'](_0x4f1fba[_0x9ab6('0x2b')][_0x9ab6('0x19')]);}return _0x322b30[_0x9ab6('0x69')](_0x276ead);}})['then'](function(_0x475768){if(_0x475768){return _0x475768?{'count':_0x43b09e,'rows':_0x475768}:null;}})[_0x9ab6('0x20')](respondWithResult(_0x748818,null))[_0x9ab6('0x3b')](handleError(_0x748818,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index e2bd786..279f19c 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 _0x3351=['VoiceMusicOnHold','voice_musiconhold','util','api','moment','bluebird','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x53e80b,_0x362bf5){var _0x54c3ae=function(_0x230758){while(--_0x230758){_0x53e80b['push'](_0x53e80b['shift']());}};_0x54c3ae(++_0x362bf5);}(_0x3351,0xa2));var _0x1335=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3351[_0x3054be];return _0x3df150;};'use strict';var _=require('lodash');var util=require(_0x1335('0x0'));var logger=require('../../config/logger')(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require(_0x1335('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1335('0x4'));var attributes=require(_0x1335('0x5'));module['exports']=function(_0x522914,_0xd715e6){return _0x522914['define'](_0x1335('0x6'),attributes,{'tableName':_0x1335('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6625=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x3f0a6c,_0x39efa2){var _0x4e5acc=function(_0x11b7ba){while(--_0x11b7ba){_0x3f0a6c['push'](_0x3f0a6c['shift']());}};_0x4e5acc(++_0x39efa2);}(_0x6625,0x9c));var _0x5662=function(_0x555955,_0x18211c){_0x555955=_0x555955-0x0;var _0x3f8848=_0x6625[_0x555955];return _0x3f8848;};'use strict';var _=require(_0x5662('0x0'));var util=require(_0x5662('0x1'));var logger=require(_0x5662('0x2'))(_0x5662('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5662('0x4'));var fs=require('fs');var path=require(_0x5662('0x5'));var rimraf=require(_0x5662('0x6'));var config=require(_0x5662('0x7'));var attributes=require(_0x5662('0x8'));module[_0x5662('0x9')]=function(_0x29e096,_0x377e10){return _0x29e096[_0x5662('0xa')](_0x5662('0xb'),attributes,{'tableName':_0x5662('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 5822e45..ca536fc 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 _0x20f9=['error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x516ccc,_0x12deb7){var _0x527923=function(_0x3b6b31){while(--_0x3b6b31){_0x516ccc['push'](_0x516ccc['shift']());}};_0x527923(++_0x12deb7);}(_0x20f9,0x13e));var _0x920f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x20f9[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x920f('0x0'));var util=require(_0x920f('0x1'));var moment=require(_0x920f('0x2'));var BPromise=require(_0x920f('0x3'));var rs=require(_0x920f('0x4'));var fs=require('fs');var Redis=require(_0x920f('0x5'));var db=require(_0x920f('0x6'))['db'];var utils=require(_0x920f('0x7'));var logger=require(_0x920f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x920f('0x9'));var client=jayson[_0x920f('0xa')][_0x920f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a28c6,_0x5eea6b,_0x19083f){return new BPromise(function(_0x928040,_0x1c0afd){return client[_0x920f('0xc')](_0x2a28c6,_0x19083f)['then'](function(_0x2dca68){logger[_0x920f('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5eea6b,_0x920f('0xe'));logger[_0x920f('0xf')](_0x920f('0x10'),_0x5eea6b,_0x920f('0xe'),JSON[_0x920f('0x11')](_0x2dca68));if(_0x2dca68[_0x920f('0x12')]){if(_0x2dca68[_0x920f('0x12')][_0x920f('0x13')]===0x1f4){logger[_0x920f('0x12')](_0x920f('0x14'),_0x5eea6b,_0x2dca68[_0x920f('0x12')]['message']);return _0x1c0afd(_0x2dca68['error'][_0x920f('0x15')]);}logger[_0x920f('0x12')](_0x920f('0x14'),_0x5eea6b,_0x2dca68['error']['message']);return _0x928040(_0x2dca68['error'][_0x920f('0x15')]);}else{logger[_0x920f('0xd')](_0x920f('0x14'),_0x5eea6b,_0x920f('0xe'));_0x928040(_0x2dca68[_0x920f('0x16')][_0x920f('0x15')]);}})[_0x920f('0x17')](function(_0x5a979b){logger['error'](_0x920f('0x14'),_0x5eea6b,_0x5a979b);_0x1c0afd(_0x5a979b);});});} \ No newline at end of file +var _0xe3f3=['../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe3f3,0x1b4));var _0x3e3f=function(_0x56916d,_0x37b935){_0x56916d=_0x56916d-0x0;var _0x2b7f1f=_0xe3f3[_0x56916d];return _0x2b7f1f;};'use strict';var _=require(_0x3e3f('0x0'));var util=require(_0x3e3f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e3f('0x2'));var db=require(_0x3e3f('0x3'))['db'];var utils=require(_0x3e3f('0x4'));var logger=require(_0x3e3f('0x5'))(_0x3e3f('0x6'));var config=require(_0x3e3f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3e3f('0x8')][_0x3e3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5437da,_0xc512e7,_0x541720){return new BPromise(function(_0x69f505,_0x2aa3ad){return client[_0x3e3f('0xa')](_0x5437da,_0x541720)[_0x3e3f('0xb')](function(_0x23941e){logger[_0x3e3f('0xc')](_0x3e3f('0xd'),_0xc512e7,_0x3e3f('0xe'));logger[_0x3e3f('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xc512e7,_0x3e3f('0xe'),JSON[_0x3e3f('0x10')](_0x23941e));if(_0x23941e[_0x3e3f('0x11')]){if(_0x23941e[_0x3e3f('0x11')][_0x3e3f('0x12')]===0x1f4){logger[_0x3e3f('0x11')](_0x3e3f('0xd'),_0xc512e7,_0x23941e[_0x3e3f('0x11')][_0x3e3f('0x13')]);return _0x2aa3ad(_0x23941e[_0x3e3f('0x11')][_0x3e3f('0x13')]);}logger['error'](_0x3e3f('0xd'),_0xc512e7,_0x23941e[_0x3e3f('0x11')]['message']);return _0x69f505(_0x23941e['error'][_0x3e3f('0x13')]);}else{logger[_0x3e3f('0xc')](_0x3e3f('0xd'),_0xc512e7,'request\x20sent');_0x69f505(_0x23941e[_0x3e3f('0x14')][_0x3e3f('0x13')]);}})['catch'](function(_0x414e10){logger[_0x3e3f('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xc512e7,_0x414e10);_0x2aa3ad(_0x414e10);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index fb5b903..297e733 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 _0x1314=['isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents','post','update','destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x2186eb,_0x509691){var _0x2fb045=function(_0x19749a){while(--_0x19749a){_0x2186eb['push'](_0x2186eb['shift']());}};_0x2fb045(++_0x509691);}(_0x1314,0xdc));var _0x4131=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x1314[_0x87239];return _0x53af1e;};'use strict';var multer=require('multer');var util=require(_0x4131('0x0'));var path=require(_0x4131('0x1'));var timeout=require(_0x4131('0x2'));var express=require(_0x4131('0x3'));var router=express[_0x4131('0x4')]();var auth=require(_0x4131('0x5'));var interaction=require(_0x4131('0x6'));var config=require(_0x4131('0x7'));var controller=require(_0x4131('0x8'));router[_0x4131('0x9')]('/',auth[_0x4131('0xa')](),controller['index']);router[_0x4131('0x9')](_0x4131('0xb'),auth['isAuthenticated'](),controller[_0x4131('0xc')]);router['get'](_0x4131('0xd'),auth[_0x4131('0xa')](),controller[_0x4131('0xe')]);router[_0x4131('0x9')](_0x4131('0xf'),auth[_0x4131('0xa')](),controller[_0x4131('0x10')]);router[_0x4131('0x11')]('/',auth[_0x4131('0xa')](),controller['create']);router[_0x4131('0x11')](_0x4131('0xf'),auth[_0x4131('0xa')](),controller['addAgents']);router['put'](_0x4131('0xd'),auth[_0x4131('0xa')](),controller[_0x4131('0x12')]);router['delete'](_0x4131('0xd'),auth[_0x4131('0xa')](),controller[_0x4131('0x13')]);router[_0x4131('0x14')](_0x4131('0xf'),auth[_0x4131('0xa')](),controller[_0x4131('0x15')]);module[_0x4131('0x16')]=router; \ No newline at end of file +var _0x1eae=['util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/users','create','addAgents','put','update','delete','destroy','removeAgents','exports'];(function(_0x20258b,_0x1885de){var _0x4878df=function(_0x7d37ff){while(--_0x7d37ff){_0x20258b['push'](_0x20258b['shift']());}};_0x4878df(++_0x1885de);}(_0x1eae,0x19e));var _0xe1ea=function(_0x512970,_0x37319e){_0x512970=_0x512970-0x0;var _0x356f77=_0x1eae[_0x512970];return _0x356f77;};'use strict';var multer=require('multer');var util=require(_0xe1ea('0x0'));var path=require('path');var timeout=require(_0xe1ea('0x1'));var express=require(_0xe1ea('0x2'));var router=express[_0xe1ea('0x3')]();var auth=require(_0xe1ea('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe1ea('0x5'));var controller=require(_0xe1ea('0x6'));router['get']('/',auth[_0xe1ea('0x7')](),controller[_0xe1ea('0x8')]);router[_0xe1ea('0x9')](_0xe1ea('0xa'),auth['isAuthenticated'](),controller[_0xe1ea('0xb')]);router[_0xe1ea('0x9')](_0xe1ea('0xc'),auth['isAuthenticated'](),controller[_0xe1ea('0xd')]);router[_0xe1ea('0x9')](_0xe1ea('0xe'),auth[_0xe1ea('0x7')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xe1ea('0xf')]);router['post'](_0xe1ea('0xe'),auth['isAuthenticated'](),controller[_0xe1ea('0x10')]);router[_0xe1ea('0x11')](_0xe1ea('0xc'),auth[_0xe1ea('0x7')](),controller[_0xe1ea('0x12')]);router[_0xe1ea('0x13')](_0xe1ea('0xc'),auth['isAuthenticated'](),controller[_0xe1ea('0x14')]);router[_0xe1ea('0x13')]('/:id/users',auth[_0xe1ea('0x7')](),controller[_0xe1ea('0x15')]);module[_0xe1ea('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index a700a1b..2fc9f8c 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 _0x2c8d=['INTEGER','exports','STRING','name','VIRTUAL','getDataValue'];(function(_0x1c20ec,_0x593fe9){var _0x4a8d83=function(_0x3f1854){while(--_0x3f1854){_0x1c20ec['push'](_0x1c20ec['shift']());}};_0x4a8d83(++_0x593fe9);}(_0x2c8d,0x181));var _0xd2c8=function(_0x10d43d,_0x30914e){_0x10d43d=_0x10d43d-0x0;var _0x4b2771=_0x2c8d[_0x10d43d];return _0x4b2771;};'use strict';var Sequelize=require('sequelize');module[_0xd2c8('0x0')]={'name':{'type':Sequelize[_0xd2c8('0x1')],'allowNull':![],'unique':_0xd2c8('0x2')},'prefix':{'type':Sequelize[_0xd2c8('0x3')],'get':function(_0x34519a){return'system-'+this[_0xd2c8('0x4')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xd2c8('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xd2c8('0x5')]}}; \ No newline at end of file +var _0x1cf3=['getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x5ef41f,_0x5c65fd){var _0x5542f4=function(_0x16ba60){while(--_0x16ba60){_0x5ef41f['push'](_0x5ef41f['shift']());}};_0x5542f4(++_0x5c65fd);}(_0x1cf3,0x1be));var _0x31cf=function(_0x58ac8e,_0xa67e64){_0x58ac8e=_0x58ac8e-0x0;var _0x44bdd9=_0x1cf3[_0x58ac8e];return _0x44bdd9;};'use strict';var Sequelize=require(_0x31cf('0x0'));module[_0x31cf('0x1')]={'name':{'type':Sequelize[_0x31cf('0x2')],'allowNull':![],'unique':_0x31cf('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x20aa57){return'system-'+this[_0x31cf('0x4')](_0x31cf('0x3'))+'-';}},'description':{'type':Sequelize[_0x31cf('0x2')]},'callerIdAll':{'type':Sequelize[_0x31cf('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x31cf('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index eaaa65a..2980bbf 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 _0xf16d=['Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','body','system-','transaction','findById','ids','omit','spread','emit','userVoicePrefix:save','userVoicePrefix:remove','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','keys','find','catch','describe','create','get','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','NoOp'];(function(_0x2023e1,_0xeca985){var _0x1fe133=function(_0x526d5f){while(--_0x526d5f){_0x2023e1['push'](_0x2023e1['shift']());}};_0x1fe133(++_0xeca985);}(_0xf16d,0x98));var _0xdf16=function(_0x400fee,_0x3a65d7){_0x400fee=_0x400fee-0x0;var _0x4e1aa7=_0xf16d[_0x400fee];return _0x4e1aa7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdf16('0x0'));var rimraf=require(_0xdf16('0x1'));var zipdir=require(_0xdf16('0x2'));var jsonpatch=require(_0xdf16('0x3'));var rp=require('request-promise');var moment=require(_0xdf16('0x4'));var BPromise=require(_0xdf16('0x5'));var Mustache=require('mustache');var util=require(_0xdf16('0x6'));var path=require('path');var sox=require(_0xdf16('0x7'));var csv=require(_0xdf16('0x8'));var ejs=require(_0xdf16('0x9'));var fs=require('fs');var _=require(_0xdf16('0xa'));var squel=require(_0xdf16('0xb'));var crypto=require(_0xdf16('0xc'));var jsforce=require(_0xdf16('0xd'));var deskjs=require(_0xdf16('0xe'));var toCsv=require(_0xdf16('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf16('0xf'));var authService=require(_0xdf16('0x10'));var qs=require(_0xdf16('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf16('0x12'));var utils=require(_0xdf16('0x13'));var config=require(_0xdf16('0x14'));var db=require(_0xdf16('0x15'))['db'];config[_0xdf16('0x16')]=_[_0xdf16('0x17')](config[_0xdf16('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf16('0x18'))(new Redis(config['redis']));require(_0xdf16('0x19'))[_0xdf16('0x1a')](socket);function respondWithStatusCode(_0x38aa3d,_0x1e1887){_0x1e1887=_0x1e1887||0xcc;return function(_0x2319c0){if(_0x2319c0){return _0x38aa3d[_0xdf16('0x1b')](_0x1e1887);}return _0x38aa3d['status'](_0x1e1887)[_0xdf16('0x1c')]();};}function respondWithResult(_0xd04349,_0x39c44a){_0x39c44a=_0x39c44a||0xc8;return function(_0x30cf33){if(_0x30cf33){return _0xd04349[_0xdf16('0x1d')](_0x39c44a)[_0xdf16('0x1e')](_0x30cf33);}};}function respondWithFilteredResult(_0x2d72ab,_0x2f3486){return function(_0x109ca8){if(_0x109ca8){var _0x91f724=_0x109ca8['count'],_0x390653=_0x2f3486[_0xdf16('0x1f')],_0x4434fd=_0x2f3486[_0xdf16('0x1f')]+_0x2f3486[_0xdf16('0x20')],_0x292018;if(_0x4434fd>=_0x91f724){_0x4434fd=_0x91f724;_0x292018=0xc8;}else{_0x292018=0xce;}_0x2d72ab[_0xdf16('0x1d')](_0x292018);return _0x2d72ab['set'](_0xdf16('0x21'),_0x390653+'-'+_0x4434fd+'/'+_0x91f724)[_0xdf16('0x1e')](_0x109ca8);}return null;};}function patchUpdates(_0x171d00){return function(_0x5d296d){try{jsonpatch[_0xdf16('0x22')](_0x5d296d,_0x171d00,!![]);}catch(_0x6b249e){return BPromise[_0xdf16('0x23')](_0x6b249e);}return _0x5d296d[_0xdf16('0x24')]();};}function saveUpdates(_0x386b2a,_0x258767){return function(_0x435103){if(_0x435103){return _0x435103[_0xdf16('0x25')](_0x386b2a)[_0xdf16('0x26')](function(_0x1f51c1){return _0x1f51c1;});}return null;};}function removeEntity(_0x9fbe29,_0x397ae1){return function(_0x4c3826){if(_0x4c3826){return _0x4c3826[_0xdf16('0x27')]()[_0xdf16('0x26')](function(){var _0x1747f8=_0x4c3826['get']({'plain':!![]});var _0x346f83=_0xdf16('0x28');return db[_0xdf16('0x29')][_0xdf16('0x27')]({'where':{'type':_0x346f83,'resourceId':_0x1747f8['id']}})[_0xdf16('0x26')](function(){return _0x4c3826;});})['then'](function(){_0x9fbe29['status'](0xcc)[_0xdf16('0x1c')]();});}};}function handleEntityNotFound(_0x237e07,_0x4d715a){return function(_0x13ecfb){if(!_0x13ecfb){_0x237e07['sendStatus'](0x194);}return _0x13ecfb;};}function handleError(_0x298608,_0xc48b7d){_0xc48b7d=_0xc48b7d||0x1f4;return function(_0x5edac8){logger[_0xdf16('0x2a')](_0x5edac8[_0xdf16('0x2b')]);if(_0x5edac8['name']){delete _0x5edac8[_0xdf16('0x2c')];}_0x298608[_0xdf16('0x1d')](_0xc48b7d)['send'](_0x5edac8);};}exports[_0xdf16('0x2d')]=function(_0x21b968,_0xc394e6){var _0x56524d={},_0x2f745e={},_0x477d66={'count':0x0,'rows':[]};var _0x1409f1=_['map'](db[_0xdf16('0x2e')][_0xdf16('0x2f')],function(_0x280cda){return{'name':_0x280cda[_0xdf16('0x30')],'type':_0x280cda[_0xdf16('0x31')][_0xdf16('0x32')]};});_0x2f745e['model']=_[_0xdf16('0x33')](_0x1409f1,_0xdf16('0x2c'));_0x2f745e['query']=_['keys'](_0x21b968[_0xdf16('0x34')]);_0x2f745e[_0xdf16('0x35')]=_['intersection'](_0x2f745e[_0xdf16('0x36')],_0x2f745e[_0xdf16('0x34')]);_0x56524d[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x2f745e['model'],qs[_0xdf16('0x39')](_0x21b968[_0xdf16('0x34')][_0xdf16('0x39')]));_0x56524d[_0xdf16('0x37')]=_0x56524d[_0xdf16('0x37')][_0xdf16('0x3a')]?_0x56524d[_0xdf16('0x37')]:_0x2f745e[_0xdf16('0x36')];if(!_0x21b968[_0xdf16('0x34')][_0xdf16('0x3b')](_0xdf16('0x3c'))){_0x56524d['limit']=qs['limit'](_0x21b968[_0xdf16('0x34')]['limit']);_0x56524d['offset']=qs['offset'](_0x21b968['query']['offset']);}_0x56524d[_0xdf16('0x3d')]=qs[_0xdf16('0x3e')](_0x21b968[_0xdf16('0x34')]['sort']);_0x56524d[_0xdf16('0x3f')]=qs[_0xdf16('0x35')](_[_0xdf16('0x40')](_0x21b968['query'],_0x2f745e['filters']));if(_0x21b968['query']['filter']){_0x56524d[_0xdf16('0x3f')]=_[_0xdf16('0x41')](_0x56524d[_0xdf16('0x3f')],{'$or':_['map'](_0x1409f1,function(_0x25cc03){if(_0x25cc03[_0xdf16('0x31')]!==_0xdf16('0x42')){var _0x4d83b6={};_0x4d83b6[_0x25cc03[_0xdf16('0x2c')]]={'$like':'%'+_0x21b968[_0xdf16('0x34')][_0xdf16('0x43')]+'%'};return _0x4d83b6;}})});}_0x56524d=_[_0xdf16('0x41')]({},_0x56524d,_0x21b968[_0xdf16('0x44')]);var _0x1d8214={'where':_0x56524d['where']};return db['VoicePrefix'][_0xdf16('0x45')](_0x1d8214)[_0xdf16('0x26')](function(_0x49a71a){_0x477d66[_0xdf16('0x45')]=_0x49a71a;if(_0x21b968[_0xdf16('0x34')][_0xdf16('0x46')]){_0x56524d[_0xdf16('0x47')]=[{'all':!![]}];}return db[_0xdf16('0x2e')][_0xdf16('0x48')](_0x56524d);})[_0xdf16('0x26')](function(_0x222c18){_0x477d66[_0xdf16('0x49')]=_0x222c18;return _0x477d66;})[_0xdf16('0x26')](respondWithFilteredResult(_0xc394e6,_0x56524d))['catch'](handleError(_0xc394e6,null));};exports[_0xdf16('0x4a')]=function(_0x10baa1,_0x1352b3){var _0x57cb2e={'raw':![],'where':{'id':_0x10baa1[_0xdf16('0x4b')]['id']}},_0x4d0185={};_0x4d0185[_0xdf16('0x36')]=_['keys'](db[_0xdf16('0x2e')]['rawAttributes']);_0x4d0185[_0xdf16('0x34')]=_[_0xdf16('0x4c')](_0x10baa1['query']);_0x4d0185[_0xdf16('0x35')]=_[_0xdf16('0x38')](_0x4d0185[_0xdf16('0x36')],_0x4d0185[_0xdf16('0x34')]);_0x57cb2e[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x4d0185['model'],qs['fields'](_0x10baa1[_0xdf16('0x34')][_0xdf16('0x39')]));_0x57cb2e[_0xdf16('0x37')]=_0x57cb2e[_0xdf16('0x37')][_0xdf16('0x3a')]?_0x57cb2e[_0xdf16('0x37')]:_0x4d0185[_0xdf16('0x36')];if(_0x10baa1['query']['includeAll']){_0x57cb2e[_0xdf16('0x47')]=[{'all':!![]}];}_0x57cb2e=_['merge']({},_0x57cb2e,_0x10baa1[_0xdf16('0x44')]);return db['VoicePrefix'][_0xdf16('0x4d')](_0x57cb2e)['then'](handleEntityNotFound(_0x1352b3,null))[_0xdf16('0x26')](respondWithResult(_0x1352b3,null))[_0xdf16('0x4e')](handleError(_0x1352b3,null));};exports[_0xdf16('0x27')]=function(_0x303668,_0x23c482){return db[_0xdf16('0x2e')][_0xdf16('0x4d')]({'where':{'id':_0x303668['params']['id']}})[_0xdf16('0x26')](handleEntityNotFound(_0x23c482,null))[_0xdf16('0x26')](removeEntity(_0x23c482,null))[_0xdf16('0x4e')](handleError(_0x23c482,null));};exports['describe']=function(_0x45325d,_0x2db738){return db[_0xdf16('0x2e')][_0xdf16('0x4f')]()['then'](respondWithResult(_0x2db738,null))[_0xdf16('0x4e')](handleError(_0x2db738,null));};exports[_0xdf16('0x50')]=function(_0x4831e5,_0x4b3e58){var _0x1dfe22;return db['sequelize']['transaction'](function(_0x12b8d1){return db['VoicePrefix'][_0xdf16('0x50')](_0x4831e5['body'],{'transaction':_0x12b8d1})[_0xdf16('0x26')](function(_0x4c6bfe){_0x1dfe22=_0x4c6bfe[_0xdf16('0x51')]({'plain':!![]});return db['VoiceExtension'][_0xdf16('0x4d')]({'where':{'id':_0x1dfe22[_0xdf16('0x52')]},'raw':!![]})[_0xdf16('0x26')](function(_0x3c0e94){return createVoicePrefixExtensions(_0x1dfe22,_0x3c0e94,_0x12b8d1);});});})[_0xdf16('0x26')](function(){var _0x45937d=_0x4831e5[_0xdf16('0x53')][_0xdf16('0x51')]({'plain':!![]});if(!_0x45937d)throw new Error(_0xdf16('0x54'));if(_0x45937d[_0xdf16('0x55')]==='user'){var _0x399c03=_0x1dfe22;return db[_0xdf16('0x56')][_0xdf16('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0x45937d[_0xdf16('0x57')]},'raw':!![]})[_0xdf16('0x26')](function(_0x1922d2){if(_0x1922d2&&_0x1922d2['autoAssociation']===0x0){return db[_0xdf16('0x29')][_0xdf16('0x50')]({'name':_0x399c03[_0xdf16('0x2c')],'resourceId':_0x399c03['id'],'type':_0x1922d2[_0xdf16('0x2c')],'sectionId':_0x1922d2['id']},{})[_0xdf16('0x26')](function(){return _0x1dfe22;});}else{return _0x1dfe22;}})['catch'](function(_0x4f7271){logger[_0xdf16('0x2a')](_0xdf16('0x58'),_0x4f7271);throw _0x4f7271;});}return _0x1dfe22;})[_0xdf16('0x26')](respondWithResult(_0x4b3e58,null))[_0xdf16('0x4e')](handleError(_0x4b3e58,null));};function Extension(_0x4b9a5c,_0x39c4c3,_0x49ea00,_0x53f6f9){this[_0xdf16('0x59')]=_0xdf16('0x5a');this[_0xdf16('0x5b')]=_0x4b9a5c;this[_0xdf16('0x5c')]=_0x49ea00;this[_0xdf16('0x31')]=_0xdf16('0x5d');this['description']=_0xdf16('0x5e');this[_0xdf16('0x5f')]=_0x39c4c3;this[_0xdf16('0x60')]=_0x53f6f9;}function createVoicePrefixExtensions(_0x45e629,_0x4ce94e,_0x564d57){return new BPromise(function(_0x488d4c,_0x1c0bf3){var _0x1b4b96=new Extension(formatPrefixName(_0x45e629['prefix']),0x1,_0xdf16('0x61'),_0xdf16('0x62'));_0x1b4b96['VoicePrefixId']=_0x45e629['id'];return db[_0xdf16('0x63')][_0xdf16('0x50')](_0x1b4b96,{'transaction':_0x564d57})['then'](function(_0x31e36e){var _0x390d98=_0x31e36e[_0xdf16('0x51')]({'plain':!![]});var _0x5a7114=_[_0xdf16('0x33')](addVoicePrefixExtensions(_0x45e629,_0x4ce94e),function(_0x2138af){_0x2138af[_0xdf16('0x52')]=_0x390d98['id'];_0x2138af[_0xdf16('0x64')]=_0x45e629['id'];return _0x2138af;});return db[_0xdf16('0x63')][_0xdf16('0x65')](_0x5a7114,{'transaction':_0x564d57})[_0xdf16('0x26')](function(_0x3d42b9){if(!_0x3d42b9){return _0x1c0bf3(_0xdf16('0x66'));}else{return _0x488d4c(_0x3d42b9);}})[_0xdf16('0x4e')](function(_0x538f58){return _0x1c0bf3(_0x538f58);});});;});};function addVoicePrefixExtensions(_0x25e946,_0x519b71){var _0x1dad3f=[];var _0x592b8e=formatPrefixName(_0x25e946[_0xdf16('0x67')]);_0x1dad3f[_0xdf16('0x68')](new Extension(_0x592b8e,0x2,_0xdf16('0x69'),_0xdf16('0x6a')+_0x25e946[_0xdf16('0x2c')]));if(_0x25e946[_0xdf16('0x6b')]){_0x1dad3f[_0xdf16('0x68')](new Extension(_0x592b8e,0x3,_0xdf16('0x69'),_0xdf16('0x6c')+_0x25e946[_0xdf16('0x6b')]));}else{_0x1dad3f['push'](new Extension(_0x592b8e,0x3,'NoOp',_0xdf16('0x6d')));}_0x1dad3f[_0xdf16('0x68')](new Extension(_0x592b8e,0x4,_0xdf16('0x6e'),_0x519b71[_0xdf16('0x59')]+','+'${EXTEN:'+(0x8+_0x25e946[_0xdf16('0x2c')]['length'])+'}'+','+0x1));return _0x1dad3f;}function formatPrefixName(_0x53fa77){var _0xf26f7f='_';for(var _0x49d826=0x0;_0x49d826<_0x53fa77[_0xdf16('0x3a')];_0x49d826++){if(_0x53fa77['charAt'](_0x49d826)=='-'){_0xf26f7f+=_0x53fa77[_0xdf16('0x6f')](_0x49d826);}else{_0xf26f7f+='['+_0x53fa77[_0xdf16('0x6f')](_0x49d826)+']';}}_0xf26f7f+='.';return _0xf26f7f;}exports[_0xdf16('0x25')]=function(_0x485a16,_0x98027a,_0x3ab2c6){var _0x26a477=_0x485a16[_0xdf16('0x70')];_0x26a477[_0xdf16('0x67')]=_0xdf16('0x71')+_0x26a477[_0xdf16('0x2c')]+'-';return db['sequelize'][_0xdf16('0x72')](function(_0x3bc5a9){return db['VoicePrefix'][_0xdf16('0x25')](_0x26a477,{'where':{'id':_0x26a477['id']},'transaction':_0x3bc5a9})[_0xdf16('0x26')](function(){return db['VoiceExtension'][_0xdf16('0x27')]({'where':{'VoicePrefixId':_0x26a477['id']},'transaction':_0x3bc5a9})['then'](function(){return db[_0xdf16('0x63')][_0xdf16('0x4d')]({'where':{'id':_0x26a477[_0xdf16('0x52')]},'raw':!![]})[_0xdf16('0x26')](function(_0x5813ac){return createVoicePrefixExtensions(_0x26a477,_0x5813ac,_0x3bc5a9);});});});})['then'](function(){return db['VoicePrefix'][_0xdf16('0x73')](_0x26a477['id']);})['then'](respondWithResult(_0x98027a,null))[_0xdf16('0x4e')](handleError(_0x98027a,null));};exports['addAgents']=function(_0x362668,_0x10c6b1,_0x10a869){return db[_0xdf16('0x2e')][_0xdf16('0x4d')]({'where':{'id':_0x362668['params']['id']}})[_0xdf16('0x26')](handleEntityNotFound(_0x10c6b1,null))[_0xdf16('0x26')](function(_0x5e451f){if(_0x5e451f){return _0x5e451f['addAgents'](_0x362668['body'][_0xdf16('0x74')],_[_0xdf16('0x75')](_0x362668[_0xdf16('0x70')],['ids','id'])||{})[_0xdf16('0x76')](function(_0x1898a7){for(var _0x720da7=0x0;_0x720da7<_0x362668[_0xdf16('0x70')][_0xdf16('0x74')]['length'];_0x720da7+=0x1){socket[_0xdf16('0x77')](_0xdf16('0x78'),{'UserId':_0x362668[_0xdf16('0x70')][_0xdf16('0x74')][_0x720da7],'VoicePrefixId':_0x362668[_0xdf16('0x4b')]['id']});}return _0x1898a7;});}})[_0xdf16('0x26')](respondWithResult(_0x10c6b1,null))['catch'](handleError(_0x10c6b1,null));};exports['removeAgents']=function(_0x45d221,_0x262783,_0x4527cc){return db['VoicePrefix']['find']({'where':{'id':_0x45d221[_0xdf16('0x4b')]['id']}})['then'](handleEntityNotFound(_0x262783,null))[_0xdf16('0x26')](function(_0x23f4bf){if(_0x23f4bf){return _0x23f4bf['removeAgents'](_0x45d221[_0xdf16('0x34')][_0xdf16('0x74')])[_0xdf16('0x26')](function(){if(_['isArray'](_0x45d221[_0xdf16('0x34')][_0xdf16('0x74')])){for(var _0x4572ed=0x0;_0x4572ed<_0x45d221[_0xdf16('0x34')][_0xdf16('0x74')][_0xdf16('0x3a')];_0x4572ed+=0x1){socket[_0xdf16('0x77')](_0xdf16('0x79'),{'UserId':Number(_0x45d221['query'][_0xdf16('0x74')][_0x4572ed]),'VoicePrefixId':Number(_0x45d221[_0xdf16('0x4b')]['id'])});}}else{socket[_0xdf16('0x77')](_0xdf16('0x79'),{'UserId':Number(_0x45d221['query'][_0xdf16('0x74')]),'VoicePrefixId':Number(_0x45d221['params']['id'])});}});}})['then'](respondWithStatusCode(_0x262783,null))[_0xdf16('0x4e')](handleError(_0x262783,null));};exports[_0xdf16('0x7a')]=function(_0x7333af,_0x1590a5,_0x1b0eaa){var _0x38f53c={};var _0x529d55={};var _0x3df5cc;var _0x18c0d0;return db['VoicePrefix'][_0xdf16('0x7b')]({'where':{'id':_0x7333af[_0xdf16('0x4b')]['id']}})[_0xdf16('0x26')](handleEntityNotFound(_0x1590a5,null))[_0xdf16('0x26')](function(_0x486c2b){if(_0x486c2b){_0x3df5cc=_0x486c2b;_0x529d55[_0xdf16('0x36')]=_['keys'](db[_0xdf16('0x7c')][_0xdf16('0x2f')]);_0x529d55[_0xdf16('0x34')]=_['keys'](_0x7333af[_0xdf16('0x34')]);_0x529d55[_0xdf16('0x35')]=_['intersection'](_0x529d55[_0xdf16('0x36')],_0x529d55[_0xdf16('0x34')]);_0x38f53c[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x529d55[_0xdf16('0x36')],qs[_0xdf16('0x39')](_0x7333af['query'][_0xdf16('0x39')]));_0x38f53c['attributes']=_0x38f53c['attributes']['length']?_0x38f53c['attributes']:_0x529d55[_0xdf16('0x36')];_0x38f53c['order']=qs[_0xdf16('0x3e')](_0x7333af[_0xdf16('0x34')]['sort']);_0x38f53c[_0xdf16('0x3f')]=qs[_0xdf16('0x35')](_[_0xdf16('0x40')](_0x7333af[_0xdf16('0x34')],_0x529d55[_0xdf16('0x35')]));if(_0x7333af['query'][_0xdf16('0x43')]){_0x38f53c['where']=_[_0xdf16('0x41')](_0x38f53c[_0xdf16('0x3f')],{'$or':_['map'](_0x38f53c[_0xdf16('0x37')],function(_0x3306b4){var _0x5edeca={};_0x5edeca[_0x3306b4]={'$like':'%'+_0x7333af[_0xdf16('0x34')][_0xdf16('0x43')]+'%'};return _0x5edeca;})});}_0x38f53c=_[_0xdf16('0x41')]({},_0x38f53c,_0x7333af[_0xdf16('0x44')]);return _0x3df5cc[_0xdf16('0x7a')](_0x38f53c);}})[_0xdf16('0x26')](function(_0x177b48){if(_0x177b48){_0x18c0d0=_0x177b48[_0xdf16('0x3a')];if(!_0x7333af[_0xdf16('0x34')][_0xdf16('0x3b')](_0xdf16('0x3c'))){_0x38f53c['limit']=qs[_0xdf16('0x20')](_0x7333af[_0xdf16('0x34')]['limit']);_0x38f53c[_0xdf16('0x1f')]=qs[_0xdf16('0x1f')](_0x7333af[_0xdf16('0x34')]['offset']);}return _0x3df5cc[_0xdf16('0x7a')](_0x38f53c);}})[_0xdf16('0x26')](function(_0x423d84){if(_0x423d84){return _0x423d84?{'count':_0x18c0d0,'rows':_0x423d84}:null;}})['then'](respondWithResult(_0x1590a5,null))['catch'](handleError(_0x1590a5,null));}; \ No newline at end of file +var _0x287f=['emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','User','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','get','VoicePrefixes','sendStatus','error','stack','name','send','index','map','VoicePrefix','type','key','model','query','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','findAll','catch','show','keys','rawAttributes','intersection','includeAll','include','find','params','describe','create','sequelize','transaction','body','VoiceExtension','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','context','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtensionId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','update','destroy','findById','addAgents','ids','spread'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x287f,0x175));var _0xf287=function(_0x269bc2,_0x32ebfd){_0x269bc2=_0x269bc2-0x0;var _0x44cba3=_0x287f[_0x269bc2];return _0x44cba3;};'use strict';var pdf=require(_0xf287('0x0'));var emlformat=require(_0xf287('0x1'));var rimraf=require(_0xf287('0x2'));var zipdir=require(_0xf287('0x3'));var jsonpatch=require(_0xf287('0x4'));var rp=require(_0xf287('0x5'));var moment=require(_0xf287('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf287('0x7'));var path=require(_0xf287('0x8'));var sox=require(_0xf287('0x9'));var csv=require(_0xf287('0xa'));var ejs=require(_0xf287('0xb'));var fs=require('fs');var _=require(_0xf287('0xc'));var squel=require(_0xf287('0xd'));var crypto=require(_0xf287('0xe'));var jsforce=require(_0xf287('0xf'));var deskjs=require(_0xf287('0x10'));var toCsv=require(_0xf287('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf287('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf287('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf287('0x13'));var logger=require(_0xf287('0x14'))(_0xf287('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf287('0x16'))['db'];config[_0xf287('0x17')]=_[_0xf287('0x18')](config[_0xf287('0x17')],{'host':_0xf287('0x19'),'port':0x18eb});var socket=require(_0xf287('0x1a'))(new Redis(config['redis']));require(_0xf287('0x1b'))['register'](socket);function respondWithStatusCode(_0x3e7d1d,_0xefc28f){_0xefc28f=_0xefc28f||0xcc;return function(_0xf1bfe4){if(_0xf1bfe4){return _0x3e7d1d['sendStatus'](_0xefc28f);}return _0x3e7d1d[_0xf287('0x1c')](_0xefc28f)[_0xf287('0x1d')]();};}function respondWithResult(_0x34080a,_0x231653){_0x231653=_0x231653||0xc8;return function(_0x2b064b){if(_0x2b064b){return _0x34080a[_0xf287('0x1c')](_0x231653)[_0xf287('0x1e')](_0x2b064b);}};}function respondWithFilteredResult(_0x47f97d,_0x31b55f){return function(_0x432068){if(_0x432068){var _0x2a6360=_0x432068[_0xf287('0x1f')],_0x7f7a77=_0x31b55f[_0xf287('0x20')],_0x37a485=_0x31b55f['offset']+_0x31b55f[_0xf287('0x21')],_0x3d4d9b;if(_0x37a485>=_0x2a6360){_0x37a485=_0x2a6360;_0x3d4d9b=0xc8;}else{_0x3d4d9b=0xce;}_0x47f97d['status'](_0x3d4d9b);return _0x47f97d[_0xf287('0x22')](_0xf287('0x23'),_0x7f7a77+'-'+_0x37a485+'/'+_0x2a6360)[_0xf287('0x1e')](_0x432068);}return null;};}function patchUpdates(_0x32bded){return function(_0x360b2d){try{jsonpatch[_0xf287('0x24')](_0x360b2d,_0x32bded,!![]);}catch(_0x59800d){return BPromise[_0xf287('0x25')](_0x59800d);}return _0x360b2d[_0xf287('0x26')]();};}function saveUpdates(_0x560045,_0x346ff0){return function(_0xc6619d){if(_0xc6619d){return _0xc6619d['update'](_0x560045)['then'](function(_0x218ef5){return _0x218ef5;});}return null;};}function removeEntity(_0x30d365,_0x538109){return function(_0x1fbe9d){if(_0x1fbe9d){return _0x1fbe9d['destroy']()[_0xf287('0x27')](function(){var _0x1cccbf=_0x1fbe9d[_0xf287('0x28')]({'plain':!![]});var _0x1c86a1=_0xf287('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x1c86a1,'resourceId':_0x1cccbf['id']}})['then'](function(){return _0x1fbe9d;});})[_0xf287('0x27')](function(){_0x30d365[_0xf287('0x1c')](0xcc)[_0xf287('0x1d')]();});}};}function handleEntityNotFound(_0x5abebd,_0xdf85f6){return function(_0x5a6dee){if(!_0x5a6dee){_0x5abebd[_0xf287('0x2a')](0x194);}return _0x5a6dee;};}function handleError(_0x13f317,_0xf63b17){_0xf63b17=_0xf63b17||0x1f4;return function(_0x47848d){logger[_0xf287('0x2b')](_0x47848d[_0xf287('0x2c')]);if(_0x47848d[_0xf287('0x2d')]){delete _0x47848d[_0xf287('0x2d')];}_0x13f317[_0xf287('0x1c')](_0xf63b17)[_0xf287('0x2e')](_0x47848d);};}exports[_0xf287('0x2f')]=function(_0x2cab66,_0x440abd){var _0x2131d3={},_0x491287={},_0xbacc60={'count':0x0,'rows':[]};var _0x2947a3=_[_0xf287('0x30')](db[_0xf287('0x31')]['rawAttributes'],function(_0x56420f){return{'name':_0x56420f['fieldName'],'type':_0x56420f[_0xf287('0x32')][_0xf287('0x33')]};});_0x491287[_0xf287('0x34')]=_[_0xf287('0x30')](_0x2947a3,'name');_0x491287[_0xf287('0x35')]=_['keys'](_0x2cab66[_0xf287('0x35')]);_0x491287['filters']=_['intersection'](_0x491287[_0xf287('0x34')],_0x491287[_0xf287('0x35')]);_0x2131d3[_0xf287('0x36')]=_['intersection'](_0x491287[_0xf287('0x34')],qs[_0xf287('0x37')](_0x2cab66[_0xf287('0x35')][_0xf287('0x37')]));_0x2131d3[_0xf287('0x36')]=_0x2131d3['attributes'][_0xf287('0x38')]?_0x2131d3[_0xf287('0x36')]:_0x491287[_0xf287('0x34')];if(!_0x2cab66['query']['hasOwnProperty']('nolimit')){_0x2131d3['limit']=qs[_0xf287('0x21')](_0x2cab66[_0xf287('0x35')]['limit']);_0x2131d3[_0xf287('0x20')]=qs[_0xf287('0x20')](_0x2cab66['query'][_0xf287('0x20')]);}_0x2131d3[_0xf287('0x39')]=qs[_0xf287('0x3a')](_0x2cab66['query']['sort']);_0x2131d3[_0xf287('0x3b')]=qs[_0xf287('0x3c')](_[_0xf287('0x3d')](_0x2cab66[_0xf287('0x35')],_0x491287[_0xf287('0x3c')]));if(_0x2cab66[_0xf287('0x35')]['filter']){_0x2131d3[_0xf287('0x3b')]=_[_0xf287('0x3e')](_0x2131d3[_0xf287('0x3b')],{'$or':_[_0xf287('0x30')](_0x2947a3,function(_0x3d949c){if(_0x3d949c[_0xf287('0x32')]!==_0xf287('0x3f')){var _0x2a92b9={};_0x2a92b9[_0x3d949c[_0xf287('0x2d')]]={'$like':'%'+_0x2cab66[_0xf287('0x35')][_0xf287('0x40')]+'%'};return _0x2a92b9;}})});}_0x2131d3=_[_0xf287('0x3e')]({},_0x2131d3,_0x2cab66[_0xf287('0x41')]);var _0x5bcf31={'where':_0x2131d3[_0xf287('0x3b')]};return db[_0xf287('0x31')]['count'](_0x5bcf31)['then'](function(_0x100b82){_0xbacc60[_0xf287('0x1f')]=_0x100b82;if(_0x2cab66[_0xf287('0x35')]['includeAll']){_0x2131d3['include']=[{'all':!![]}];}return db['VoicePrefix'][_0xf287('0x42')](_0x2131d3);})[_0xf287('0x27')](function(_0x2eb6c6){_0xbacc60['rows']=_0x2eb6c6;return _0xbacc60;})['then'](respondWithFilteredResult(_0x440abd,_0x2131d3))[_0xf287('0x43')](handleError(_0x440abd,null));};exports[_0xf287('0x44')]=function(_0x58ae21,_0x21e58f){var _0x43e99c={'raw':![],'where':{'id':_0x58ae21['params']['id']}},_0x3a165b={};_0x3a165b[_0xf287('0x34')]=_[_0xf287('0x45')](db[_0xf287('0x31')][_0xf287('0x46')]);_0x3a165b[_0xf287('0x35')]=_[_0xf287('0x45')](_0x58ae21['query']);_0x3a165b[_0xf287('0x3c')]=_[_0xf287('0x47')](_0x3a165b[_0xf287('0x34')],_0x3a165b[_0xf287('0x35')]);_0x43e99c[_0xf287('0x36')]=_[_0xf287('0x47')](_0x3a165b[_0xf287('0x34')],qs[_0xf287('0x37')](_0x58ae21[_0xf287('0x35')]['fields']));_0x43e99c[_0xf287('0x36')]=_0x43e99c[_0xf287('0x36')][_0xf287('0x38')]?_0x43e99c[_0xf287('0x36')]:_0x3a165b[_0xf287('0x34')];if(_0x58ae21[_0xf287('0x35')][_0xf287('0x48')]){_0x43e99c[_0xf287('0x49')]=[{'all':!![]}];}_0x43e99c=_['merge']({},_0x43e99c,_0x58ae21[_0xf287('0x41')]);return db[_0xf287('0x31')][_0xf287('0x4a')](_0x43e99c)[_0xf287('0x27')](handleEntityNotFound(_0x21e58f,null))[_0xf287('0x27')](respondWithResult(_0x21e58f,null))['catch'](handleError(_0x21e58f,null));};exports['destroy']=function(_0x5aaed7,_0x55d8c3){return db[_0xf287('0x31')]['find']({'where':{'id':_0x5aaed7[_0xf287('0x4b')]['id']}})['then'](handleEntityNotFound(_0x55d8c3,null))['then'](removeEntity(_0x55d8c3,null))[_0xf287('0x43')](handleError(_0x55d8c3,null));};exports[_0xf287('0x4c')]=function(_0x3c8b2c,_0x11c6a){return db[_0xf287('0x31')][_0xf287('0x4c')]()[_0xf287('0x27')](respondWithResult(_0x11c6a,null))['catch'](handleError(_0x11c6a,null));};exports[_0xf287('0x4d')]=function(_0x405dfc,_0x3b33f8){var _0x3878f8;return db[_0xf287('0x4e')][_0xf287('0x4f')](function(_0x3fd5f0){return db['VoicePrefix'][_0xf287('0x4d')](_0x405dfc[_0xf287('0x50')],{'transaction':_0x3fd5f0})[_0xf287('0x27')](function(_0x3c3f44){_0x3878f8=_0x3c3f44[_0xf287('0x28')]({'plain':!![]});return db[_0xf287('0x51')]['find']({'where':{'id':_0x3878f8['VoiceExtensionId']},'raw':!![]})[_0xf287('0x27')](function(_0x16cdd3){return createVoicePrefixExtensions(_0x3878f8,_0x16cdd3,_0x3fd5f0);});});})[_0xf287('0x27')](function(){var _0x59faba=_0x405dfc[_0xf287('0x52')]['get']({'plain':!![]});if(!_0x59faba)throw new Error(_0xf287('0x53'));if(_0x59faba[_0xf287('0x54')]===_0xf287('0x52')){var _0x362a3e=_0x3878f8;return db['UserProfileSection'][_0xf287('0x4a')]({'where':{'name':_0xf287('0x29'),'userProfileId':_0x59faba[_0xf287('0x55')]},'raw':!![]})['then'](function(_0xe80fb){if(_0xe80fb&&_0xe80fb['autoAssociation']===0x0){return db[_0xf287('0x56')]['create']({'name':_0x362a3e[_0xf287('0x2d')],'resourceId':_0x362a3e['id'],'type':_0xe80fb[_0xf287('0x2d')],'sectionId':_0xe80fb['id']},{})[_0xf287('0x27')](function(){return _0x3878f8;});}else{return _0x3878f8;}})[_0xf287('0x43')](function(_0x217835){logger[_0xf287('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x217835);throw _0x217835;});}return _0x3878f8;})['then'](respondWithResult(_0x3b33f8,null))[_0xf287('0x43')](handleError(_0x3b33f8,null));};function Extension(_0x3eb255,_0x237c74,_0x441566,_0x3f9c6a){this[_0xf287('0x57')]='from-sip';this[_0xf287('0x58')]=_0x3eb255;this[_0xf287('0x59')]=_0x441566;this[_0xf287('0x32')]='system';this[_0xf287('0x5a')]=_0xf287('0x5b');this[_0xf287('0x5c')]=_0x237c74;this[_0xf287('0x5d')]=_0x3f9c6a;}function createVoicePrefixExtensions(_0x348979,_0x341f4b,_0x2add40){return new BPromise(function(_0x36eae1,_0x55d33c){var _0x5cac76=new Extension(formatPrefixName(_0x348979[_0xf287('0x5e')]),0x1,_0xf287('0x5f'),_0xf287('0x60'));_0x5cac76[_0xf287('0x61')]=_0x348979['id'];return db['VoiceExtension'][_0xf287('0x4d')](_0x5cac76,{'transaction':_0x2add40})[_0xf287('0x27')](function(_0x1ace21){var _0x26d507=_0x1ace21[_0xf287('0x28')]({'plain':!![]});var _0x2cabd2=_[_0xf287('0x30')](addVoicePrefixExtensions(_0x348979,_0x341f4b),function(_0x40076b){_0x40076b[_0xf287('0x62')]=_0x26d507['id'];_0x40076b[_0xf287('0x61')]=_0x348979['id'];return _0x40076b;});return db['VoiceExtension']['bulkCreate'](_0x2cabd2,{'transaction':_0x2add40})[_0xf287('0x27')](function(_0x4fb07a){if(!_0x4fb07a){return _0x55d33c(_0xf287('0x63'));}else{return _0x36eae1(_0x4fb07a);}})['catch'](function(_0x191456){return _0x55d33c(_0x191456);});});;});};function addVoicePrefixExtensions(_0x51a060,_0x3b5542){var _0x178a4d=[];var _0x332803=formatPrefixName(_0x51a060['prefix']);_0x178a4d[_0xf287('0x64')](new Extension(_0x332803,0x2,_0xf287('0x65'),_0xf287('0x66')+_0x51a060[_0xf287('0x2d')]));if(_0x51a060['callerIdAll']){_0x178a4d[_0xf287('0x64')](new Extension(_0x332803,0x3,'Set',_0xf287('0x67')+_0x51a060[_0xf287('0x68')]));}else{_0x178a4d['push'](new Extension(_0x332803,0x3,'NoOp',_0xf287('0x69')));}_0x178a4d[_0xf287('0x64')](new Extension(_0x332803,0x4,_0xf287('0x6a'),_0x3b5542[_0xf287('0x57')]+','+_0xf287('0x6b')+(0x8+_0x51a060['name'][_0xf287('0x38')])+'}'+','+0x1));return _0x178a4d;}function formatPrefixName(_0xf23d69){var _0x51bc59='_';for(var _0x44db13=0x0;_0x44db13<_0xf23d69[_0xf287('0x38')];_0x44db13++){if(_0xf23d69['charAt'](_0x44db13)=='-'){_0x51bc59+=_0xf23d69[_0xf287('0x6c')](_0x44db13);}else{_0x51bc59+='['+_0xf23d69['charAt'](_0x44db13)+']';}}_0x51bc59+='.';return _0x51bc59;}exports['update']=function(_0x3af358,_0x4b2cc8,_0x242800){var _0x34e7d4=_0x3af358[_0xf287('0x50')];_0x34e7d4['prefix']='system-'+_0x34e7d4[_0xf287('0x2d')]+'-';return db[_0xf287('0x4e')][_0xf287('0x4f')](function(_0x5e57dd){return db[_0xf287('0x31')][_0xf287('0x6d')](_0x34e7d4,{'where':{'id':_0x34e7d4['id']},'transaction':_0x5e57dd})['then'](function(){return db[_0xf287('0x51')][_0xf287('0x6e')]({'where':{'VoicePrefixId':_0x34e7d4['id']},'transaction':_0x5e57dd})[_0xf287('0x27')](function(){return db['VoiceExtension']['find']({'where':{'id':_0x34e7d4['VoiceExtensionId']},'raw':!![]})[_0xf287('0x27')](function(_0x47d9be){return createVoicePrefixExtensions(_0x34e7d4,_0x47d9be,_0x5e57dd);});});});})[_0xf287('0x27')](function(){return db[_0xf287('0x31')][_0xf287('0x6f')](_0x34e7d4['id']);})['then'](respondWithResult(_0x4b2cc8,null))['catch'](handleError(_0x4b2cc8,null));};exports['addAgents']=function(_0x56b13d,_0x388682,_0x345f51){return db[_0xf287('0x31')]['find']({'where':{'id':_0x56b13d[_0xf287('0x4b')]['id']}})[_0xf287('0x27')](handleEntityNotFound(_0x388682,null))['then'](function(_0x528e60){if(_0x528e60){return _0x528e60[_0xf287('0x70')](_0x56b13d[_0xf287('0x50')][_0xf287('0x71')],_['omit'](_0x56b13d['body'],[_0xf287('0x71'),'id'])||{})[_0xf287('0x72')](function(_0x1a4a76){for(var _0x293cc6=0x0;_0x293cc6<_0x56b13d[_0xf287('0x50')][_0xf287('0x71')][_0xf287('0x38')];_0x293cc6+=0x1){socket[_0xf287('0x73')](_0xf287('0x74'),{'UserId':_0x56b13d[_0xf287('0x50')]['ids'][_0x293cc6],'VoicePrefixId':_0x56b13d[_0xf287('0x4b')]['id']});}return _0x1a4a76;});}})[_0xf287('0x27')](respondWithResult(_0x388682,null))[_0xf287('0x43')](handleError(_0x388682,null));};exports[_0xf287('0x75')]=function(_0x261b51,_0x5b20cb,_0xfc78af){return db[_0xf287('0x31')][_0xf287('0x4a')]({'where':{'id':_0x261b51[_0xf287('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5b20cb,null))[_0xf287('0x27')](function(_0x1324f2){if(_0x1324f2){return _0x1324f2[_0xf287('0x75')](_0x261b51['query'][_0xf287('0x71')])['then'](function(){if(_[_0xf287('0x76')](_0x261b51['query'][_0xf287('0x71')])){for(var _0xc09052=0x0;_0xc09052<_0x261b51[_0xf287('0x35')][_0xf287('0x71')][_0xf287('0x38')];_0xc09052+=0x1){socket[_0xf287('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x261b51[_0xf287('0x35')][_0xf287('0x71')][_0xc09052]),'VoicePrefixId':Number(_0x261b51[_0xf287('0x4b')]['id'])});}}else{socket[_0xf287('0x73')](_0xf287('0x77'),{'UserId':Number(_0x261b51[_0xf287('0x35')][_0xf287('0x71')]),'VoicePrefixId':Number(_0x261b51[_0xf287('0x4b')]['id'])});}});}})[_0xf287('0x27')](respondWithStatusCode(_0x5b20cb,null))[_0xf287('0x43')](handleError(_0x5b20cb,null));};exports['getAgents']=function(_0x462eec,_0x36479a,_0x32ab10){var _0x5f5100={};var _0x4d9050={};var _0x2aae91;var _0x372be5;return db[_0xf287('0x31')]['findOne']({'where':{'id':_0x462eec[_0xf287('0x4b')]['id']}})[_0xf287('0x27')](handleEntityNotFound(_0x36479a,null))[_0xf287('0x27')](function(_0x415a95){if(_0x415a95){_0x2aae91=_0x415a95;_0x4d9050[_0xf287('0x34')]=_[_0xf287('0x45')](db[_0xf287('0x78')][_0xf287('0x46')]);_0x4d9050[_0xf287('0x35')]=_[_0xf287('0x45')](_0x462eec[_0xf287('0x35')]);_0x4d9050[_0xf287('0x3c')]=_[_0xf287('0x47')](_0x4d9050[_0xf287('0x34')],_0x4d9050['query']);_0x5f5100[_0xf287('0x36')]=_[_0xf287('0x47')](_0x4d9050[_0xf287('0x34')],qs['fields'](_0x462eec['query'][_0xf287('0x37')]));_0x5f5100[_0xf287('0x36')]=_0x5f5100[_0xf287('0x36')]['length']?_0x5f5100['attributes']:_0x4d9050[_0xf287('0x34')];_0x5f5100[_0xf287('0x39')]=qs['sort'](_0x462eec[_0xf287('0x35')][_0xf287('0x3a')]);_0x5f5100[_0xf287('0x3b')]=qs[_0xf287('0x3c')](_[_0xf287('0x3d')](_0x462eec['query'],_0x4d9050[_0xf287('0x3c')]));if(_0x462eec[_0xf287('0x35')][_0xf287('0x40')]){_0x5f5100[_0xf287('0x3b')]=_[_0xf287('0x3e')](_0x5f5100[_0xf287('0x3b')],{'$or':_['map'](_0x5f5100['attributes'],function(_0x44a59b){var _0x5d49f3={};_0x5d49f3[_0x44a59b]={'$like':'%'+_0x462eec[_0xf287('0x35')][_0xf287('0x40')]+'%'};return _0x5d49f3;})});}_0x5f5100=_[_0xf287('0x3e')]({},_0x5f5100,_0x462eec[_0xf287('0x41')]);return _0x2aae91[_0xf287('0x79')](_0x5f5100);}})[_0xf287('0x27')](function(_0x15f1ca){if(_0x15f1ca){_0x372be5=_0x15f1ca[_0xf287('0x38')];if(!_0x462eec[_0xf287('0x35')]['hasOwnProperty']('nolimit')){_0x5f5100[_0xf287('0x21')]=qs[_0xf287('0x21')](_0x462eec[_0xf287('0x35')]['limit']);_0x5f5100['offset']=qs['offset'](_0x462eec['query'][_0xf287('0x20')]);}return _0x2aae91[_0xf287('0x79')](_0x5f5100);}})[_0xf287('0x27')](function(_0x204403){if(_0x204403){return _0x204403?{'count':_0x372be5,'rows':_0x204403}:null;}})['then'](respondWithResult(_0x36479a,null))[_0xf287('0x43')](handleError(_0x36479a,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 1a69b3b..9d493ce 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 _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x51b0c8,_0x5070ca){var _0x305ea0=function(_0x5bccd8){while(--_0x5bccd8){_0x51b0c8['push'](_0x51b0c8['shift']());}};_0x305ea0(++_0x5070ca);}(_0x008c,0x188));var _0xc008=function(_0x1e8bcb,_0x474a81){_0x1e8bcb=_0x1e8bcb-0x0;var _0x212080=_0x008c[_0x1e8bcb];return _0x212080;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xa9e0=['hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var EventEmitter=require(_0x0a9e('0x0'));var VoicePrefix=require(_0x0a9e('0x1'))['db'][_0x0a9e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0a9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x333808){return function(_0x432180,_0x2ab90b,_0x991246){VoicePrefixEvents[_0x0a9e('0x4')](_0x333808+':'+_0x432180['id'],_0x432180);VoicePrefixEvents['emit'](_0x333808,_0x432180);_0x991246(null);};}for(var e in events){if(events[_0x0a9e('0x5')](e)){var event=events[e];VoicePrefix[_0x0a9e('0x6')](e,emitEvent(event));}}module[_0x0a9e('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index d4a0fbd..456ce8f 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 _0x0c3c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0c3c,0xee));var _0xc0c3=function(_0x34e4a0,_0x1fd446){_0x34e4a0=_0x34e4a0-0x0;var _0x3ead3e=_0x0c3c[_0x34e4a0];return _0x3ead3e;};'use strict';var _=require('lodash');var util=require(_0xc0c3('0x0'));var logger=require(_0xc0c3('0x1'))(_0xc0c3('0x2'));var moment=require(_0xc0c3('0x3'));var BPromise=require(_0xc0c3('0x4'));var rp=require(_0xc0c3('0x5'));var fs=require('fs');var path=require(_0xc0c3('0x6'));var rimraf=require(_0xc0c3('0x7'));var config=require(_0xc0c3('0x8'));var attributes=require(_0xc0c3('0x9'));module[_0xc0c3('0xa')]=function(_0x16140d,_0x54b60a){return _0x16140d[_0xc0c3('0xb')](_0xc0c3('0xc'),attributes,{'tableName':_0xc0c3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e7b=['bluebird','request-promise','../../config/environment','./voicePrefix.attributes','exports','VoicePrefix','lodash','util','../../config/logger','api','moment'];(function(_0x285331,_0x5c8497){var _0x5c98f7=function(_0x26bc15){while(--_0x26bc15){_0x285331['push'](_0x285331['shift']());}};_0x5c98f7(++_0x5c8497);}(_0x0e7b,0x166));var _0xb0e7=function(_0x518a06,_0x42f3c3){_0x518a06=_0x518a06-0x0;var _0x1b4872=_0x0e7b[_0x518a06];return _0x1b4872;};'use strict';var _=require(_0xb0e7('0x0'));var util=require(_0xb0e7('0x1'));var logger=require(_0xb0e7('0x2'))(_0xb0e7('0x3'));var moment=require(_0xb0e7('0x4'));var BPromise=require(_0xb0e7('0x5'));var rp=require(_0xb0e7('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb0e7('0x7'));var attributes=require(_0xb0e7('0x8'));module[_0xb0e7('0x9')]=function(_0x247c26,_0x3238f7){return _0x247c26['define'](_0xb0e7('0xa'),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 4d9d378..e6226dd 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 _0xaa37=['VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./voicePrefix.socket','request','info'];(function(_0x53c1ab,_0x441500){var _0x5aedf3=function(_0xdb5212){while(--_0xdb5212){_0x53c1ab['push'](_0x53c1ab['shift']());}};_0x5aedf3(++_0x441500);}(_0xaa37,0x10d));var _0x7aa3=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xaa37[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var moment=require('moment');var BPromise=require(_0x7aa3('0x2'));var rs=require(_0x7aa3('0x3'));var fs=require('fs');var Redis=require(_0x7aa3('0x4'));var db=require(_0x7aa3('0x5'))['db'];var utils=require(_0x7aa3('0x6'));var logger=require(_0x7aa3('0x7'))(_0x7aa3('0x8'));var config=require(_0x7aa3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7aa3('0xa')]({'port':0x232a});config[_0x7aa3('0xb')]=_[_0x7aa3('0xc')](config['redis'],{'host':_0x7aa3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7aa3('0xe'))['register'](socket);function respondWithRpcPromise(_0x5a278b,_0x222ae5,_0x1b39f4){return new BPromise(function(_0x2130c8,_0x1c650d){return client[_0x7aa3('0xf')](_0x5a278b,_0x1b39f4)['then'](function(_0x36f687){logger[_0x7aa3('0x10')](_0x7aa3('0x11'),_0x222ae5,'request\x20sent');logger[_0x7aa3('0x12')](_0x7aa3('0x13'),_0x222ae5,_0x7aa3('0x14'),JSON[_0x7aa3('0x15')](_0x36f687));if(_0x36f687[_0x7aa3('0x16')]){if(_0x36f687[_0x7aa3('0x16')]['code']===0x1f4){logger[_0x7aa3('0x16')](_0x7aa3('0x11'),_0x222ae5,_0x36f687[_0x7aa3('0x16')][_0x7aa3('0x17')]);return _0x1c650d(_0x36f687[_0x7aa3('0x16')]['message']);}logger[_0x7aa3('0x16')](_0x7aa3('0x11'),_0x222ae5,_0x36f687[_0x7aa3('0x16')][_0x7aa3('0x17')]);return _0x2130c8(_0x36f687[_0x7aa3('0x16')][_0x7aa3('0x17')]);}else{logger[_0x7aa3('0x10')](_0x7aa3('0x11'),_0x222ae5,'request\x20sent');_0x2130c8(_0x36f687[_0x7aa3('0x18')][_0x7aa3('0x17')]);}})[_0x7aa3('0x19')](function(_0x29f76e){logger['error'](_0x7aa3('0x11'),_0x222ae5,_0x29f76e);_0x1c650d(_0x29f76e);});});} \ No newline at end of file +var _0x194e=['../../config/environment','jayson/promise','client','http','redis','defaults','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc'];(function(_0x40921f,_0x3823f7){var _0x270c6c=function(_0x3eeb58){while(--_0x3eeb58){_0x40921f['push'](_0x40921f['shift']());}};_0x270c6c(++_0x3823f7);}(_0x194e,0x1a2));var _0xe194=function(_0x383d10,_0x124787){_0x383d10=_0x383d10-0x0;var _0x1bcdcb=_0x194e[_0x383d10];return _0x1bcdcb;};'use strict';var _=require(_0xe194('0x0'));var util=require(_0xe194('0x1'));var moment=require(_0xe194('0x2'));var BPromise=require(_0xe194('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe194('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe194('0x5'))(_0xe194('0x6'));var config=require(_0xe194('0x7'));var jayson=require(_0xe194('0x8'));var client=jayson[_0xe194('0x9')][_0xe194('0xa')]({'port':0x232a});config[_0xe194('0xb')]=_[_0xe194('0xc')](config[_0xe194('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe194('0xd'))[_0xe194('0xe')](socket);function respondWithRpcPromise(_0x1ba27a,_0x3f77ed,_0x17408b){return new BPromise(function(_0x2a3c5c,_0x4ed35d){return client[_0xe194('0xf')](_0x1ba27a,_0x17408b)[_0xe194('0x10')](function(_0x4b2c78){logger[_0xe194('0x11')](_0xe194('0x12'),_0x3f77ed,_0xe194('0x13'));logger[_0xe194('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x3f77ed,'request\x20sent',JSON['stringify'](_0x4b2c78));if(_0x4b2c78[_0xe194('0x15')]){if(_0x4b2c78[_0xe194('0x15')]['code']===0x1f4){logger[_0xe194('0x15')](_0xe194('0x12'),_0x3f77ed,_0x4b2c78['error'][_0xe194('0x16')]);return _0x4ed35d(_0x4b2c78[_0xe194('0x15')][_0xe194('0x16')]);}logger[_0xe194('0x15')](_0xe194('0x12'),_0x3f77ed,_0x4b2c78[_0xe194('0x15')]['message']);return _0x2a3c5c(_0x4b2c78[_0xe194('0x15')][_0xe194('0x16')]);}else{logger[_0xe194('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x3f77ed,'request\x20sent');_0x2a3c5c(_0x4b2c78[_0xe194('0x17')][_0xe194('0x16')]);}})[_0xe194('0x18')](function(_0xd2e06f){logger[_0xe194('0x15')](_0xe194('0x12'),_0x3f77ed,_0xd2e06f);_0x4ed35d(_0xd2e06f);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index aa65d19..1dfca5e 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 _0xff67=['voicePrefix:','./voicePrefix.events','save','emit','removeListener','register','length'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xff67,0x9b));var _0x7ff6=function(_0x15bb23,_0x420d9f){_0x15bb23=_0x15bb23-0x0;var _0x495cb2=_0xff67[_0x15bb23];return _0x495cb2;};'use strict';var VoicePrefixEvents=require(_0x7ff6('0x0'));var events=[_0x7ff6('0x1'),'remove','update'];function createListener(_0x4b09d0,_0x382da1){return function(_0x2974be){_0x382da1[_0x7ff6('0x2')](_0x4b09d0,_0x2974be);};}function removeListener(_0x1c41e6,_0x33ee2c){return function(){VoicePrefixEvents[_0x7ff6('0x3')](_0x1c41e6,_0x33ee2c);};}exports[_0x7ff6('0x4')]=function(_0x3e6acf){for(var _0x1adfff=0x0,_0x37a29d=events[_0x7ff6('0x5')];_0x1adfff<_0x37a29d;_0x1adfff++){var _0x1d7923=events[_0x1adfff];var _0x3c8e6a=createListener(_0x7ff6('0x6')+_0x1d7923,_0x3e6acf);VoicePrefixEvents['on'](_0x1d7923,_0x3c8e6a);}}; \ No newline at end of file +var _0xc4d1=['emit','removeListener','length','voicePrefix:','./voicePrefix.events','save','remove'];(function(_0x5beb32,_0x1112f4){var _0x28b56c=function(_0x3ff3f9){while(--_0x3ff3f9){_0x5beb32['push'](_0x5beb32['shift']());}};_0x28b56c(++_0x1112f4);}(_0xc4d1,0xac));var _0x1c4d=function(_0x1da811,_0x2e30db){_0x1da811=_0x1da811-0x0;var _0x53858b=_0xc4d1[_0x1da811];return _0x53858b;};'use strict';var VoicePrefixEvents=require(_0x1c4d('0x0'));var events=[_0x1c4d('0x1'),_0x1c4d('0x2'),'update'];function createListener(_0x4c1e5f,_0x332b86){return function(_0x25a02f){_0x332b86[_0x1c4d('0x3')](_0x4c1e5f,_0x25a02f);};}function removeListener(_0x31605c,_0x1dda82){return function(){VoicePrefixEvents[_0x1c4d('0x4')](_0x31605c,_0x1dda82);};}exports['register']=function(_0x4e47eb){for(var _0x10d207=0x0,_0x514c6f=events[_0x1c4d('0x5')];_0x10d207<_0x514c6f;_0x10d207++){var _0xa5c4eb=events[_0x10d207];var _0x53205f=createListener(_0x1c4d('0x6')+_0xa5c4eb,_0x4e47eb);VoicePrefixEvents['on'](_0xa5c4eb,_0x53205f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index e8a4172..e5fc3aa 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 _0x7d45=['addAgents','/:id/blacklists','put','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','getHoppers','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','/:id/clone','/:id/users'];(function(_0x4fa665,_0x1ae12a){var _0x62ccff=function(_0x4f0bb8){while(--_0x4f0bb8){_0x4fa665['push'](_0x4fa665['shift']());}};_0x62ccff(++_0x1ae12a);}(_0x7d45,0x11a));var _0x57d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7d45[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x57d4('0x0'));var util=require(_0x57d4('0x1'));var path=require('path');var timeout=require(_0x57d4('0x2'));var express=require('express');var router=express[_0x57d4('0x3')]();var auth=require(_0x57d4('0x4'));var interaction=require(_0x57d4('0x5'));var config=require(_0x57d4('0x6'));var controller=require(_0x57d4('0x7'));router[_0x57d4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x57d4('0x9'),auth[_0x57d4('0xa')](),controller['show']);router[_0x57d4('0x8')]('/:id/hoppers',auth[_0x57d4('0xa')](),controller[_0x57d4('0xb')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x57d4('0x8')]('/:id/hopper_finals',auth[_0x57d4('0xa')](),controller[_0x57d4('0xc')]);router[_0x57d4('0x8')](_0x57d4('0xd'),auth[_0x57d4('0xa')](),controller['getHopperBlacks']);router[_0x57d4('0x8')](_0x57d4('0xe'),auth[_0x57d4('0xa')](),controller[_0x57d4('0xf')]);router[_0x57d4('0x8')]('/:id/users',auth[_0x57d4('0xa')](),controller[_0x57d4('0x10')]);router['get'](_0x57d4('0x11'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x12')]);router[_0x57d4('0x8')](_0x57d4('0x13'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x14')]);router['get']('/:id/blacklists',auth[_0x57d4('0xa')](),controller['getBlackLists']);router['post']('/',auth[_0x57d4('0xa')](),controller['create']);router[_0x57d4('0x15')](_0x57d4('0x16'),auth[_0x57d4('0xa')](),controller['clone']);router[_0x57d4('0x15')](_0x57d4('0xe'),auth[_0x57d4('0xa')](),controller['addTeams']);router['post'](_0x57d4('0x17'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x18')]);router[_0x57d4('0x15')](_0x57d4('0x13'),auth['isAuthenticated'](),controller['addLists']);router[_0x57d4('0x15')](_0x57d4('0x19'),auth[_0x57d4('0xa')](),controller['addBlackLists']);router[_0x57d4('0x1a')](_0x57d4('0x9'),auth[_0x57d4('0xa')](),controller['update']);router['delete']('/:id',auth[_0x57d4('0xa')](),controller[_0x57d4('0x1b')]);router[_0x57d4('0x1c')](_0x57d4('0xe'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x1d')]);router['delete'](_0x57d4('0x17'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x1e')]);router[_0x57d4('0x1c')](_0x57d4('0x13'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x1f')]);router['delete'](_0x57d4('0x19'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x20')]);module[_0x57d4('0x21')]=router; \ No newline at end of file +var _0x4a87=['isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getAgents','getMembers','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/users','/:id/lists','addLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceQueue.controller','get'];(function(_0x46ccc5,_0x1b0a8d){var _0xa8e6f7=function(_0x5c47ea){while(--_0x5c47ea){_0x46ccc5['push'](_0x46ccc5['shift']());}};_0xa8e6f7(++_0x1b0a8d);}(_0x4a87,0x1e5));var _0x74a8=function(_0x4c609c,_0x5ed023){_0x4c609c=_0x4c609c-0x0;var _0x37a869=_0x4a87[_0x4c609c];return _0x37a869;};'use strict';var multer=require(_0x74a8('0x0'));var util=require('util');var path=require(_0x74a8('0x1'));var timeout=require(_0x74a8('0x2'));var express=require(_0x74a8('0x3'));var router=express[_0x74a8('0x4')]();var auth=require(_0x74a8('0x5'));var interaction=require(_0x74a8('0x6'));var config=require('../../config/environment');var controller=require(_0x74a8('0x7'));router[_0x74a8('0x8')]('/',auth[_0x74a8('0x9')](),controller[_0x74a8('0xa')]);router[_0x74a8('0x8')](_0x74a8('0xb'),auth[_0x74a8('0x9')](),controller['show']);router[_0x74a8('0x8')](_0x74a8('0xc'),auth[_0x74a8('0x9')](),controller[_0x74a8('0xd')]);router[_0x74a8('0x8')](_0x74a8('0xe'),auth['isAuthenticated'](),controller[_0x74a8('0xf')]);router[_0x74a8('0x8')](_0x74a8('0x10'),auth[_0x74a8('0x9')](),controller[_0x74a8('0x11')]);router[_0x74a8('0x8')](_0x74a8('0x12'),auth['isAuthenticated'](),controller[_0x74a8('0x13')]);router[_0x74a8('0x8')](_0x74a8('0x14'),auth['isAuthenticated'](),controller['getTeams']);router[_0x74a8('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x74a8('0x15')]);router[_0x74a8('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x74a8('0x16')]);router[_0x74a8('0x8')]('/:id/lists',auth['isAuthenticated'](),controller['getLists']);router[_0x74a8('0x8')](_0x74a8('0x17'),auth[_0x74a8('0x9')](),controller[_0x74a8('0x18')]);router[_0x74a8('0x19')]('/',auth[_0x74a8('0x9')](),controller[_0x74a8('0x1a')]);router[_0x74a8('0x19')](_0x74a8('0x1b'),auth[_0x74a8('0x9')](),controller[_0x74a8('0x1c')]);router[_0x74a8('0x19')]('/:id/teams',auth[_0x74a8('0x9')](),controller['addTeams']);router[_0x74a8('0x19')](_0x74a8('0x1d'),auth[_0x74a8('0x9')](),controller['addAgents']);router['post'](_0x74a8('0x1e'),auth[_0x74a8('0x9')](),controller[_0x74a8('0x1f')]);router[_0x74a8('0x19')](_0x74a8('0x17'),auth[_0x74a8('0x9')](),controller['addBlackLists']);router[_0x74a8('0x20')](_0x74a8('0xb'),auth['isAuthenticated'](),controller[_0x74a8('0x21')]);router[_0x74a8('0x22')](_0x74a8('0xb'),auth['isAuthenticated'](),controller[_0x74a8('0x23')]);router['delete'](_0x74a8('0x14'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x74a8('0x22')](_0x74a8('0x1d'),auth[_0x74a8('0x9')](),controller['removeAgents']);router[_0x74a8('0x22')](_0x74a8('0x1e'),auth['isAuthenticated'](),controller[_0x74a8('0x24')]);router[_0x74a8('0x22')](_0x74a8('0x17'),auth[_0x74a8('0x9')](),controller[_0x74a8('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index a9ac07f..182734c 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 _0x224f=['periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','outbound','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','setDataValue','strategy','getDataValue','type','dialMethod','inbound','booked','roundrobin','progressive','predictive','power','INTEGER','yes','ENUM','all'];(function(_0x2e1ff8,_0x595548){var _0x4a0d9d=function(_0xf7e2e2){while(--_0xf7e2e2){_0x2e1ff8['push'](_0x2e1ff8['shift']());}};_0x4a0d9d(++_0x595548);}(_0x224f,0x155));var _0xf224=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x224f[_0x47568e];return _0x33815b;};'use strict';var Sequelize=require('sequelize');module[_0xf224('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf224('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xf224('0x2')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xf224('0x3')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xf224('0x4'),_0xf224('0x5'),_0xf224('0x6'),_0xf224('0x7'),_0xf224('0x8'),'linear','wrandom','rrordered'),'allowNull':![],'defaultValue':_0xf224('0x4'),'set':function(_0x28ba3a){this[_0xf224('0x9')](_0xf224('0xa'),_0x28ba3a?_0x28ba3a:'rrmemory');},'get':function(){var _0x383255=this[_0xf224('0xb')](_0xf224('0xc'));var _0x3af728=this[_0xf224('0xb')](_0xf224('0xd'));var _0x98b33c=this[_0xf224('0xb')]('strategy');if(_0x383255===_0xf224('0xe')){return _0x98b33c;}if(_0x3af728==='booked'&&_0x98b33c===_0xf224('0x8')||_0x3af728===_0xf224('0xf')&&_0x98b33c===_0xf224('0x10')){return _0x98b33c;}if(_0x3af728===_0xf224('0x11')||_0x3af728===_0xf224('0x12')||_0x3af728===_0xf224('0x13')){return _0x98b33c;}return null;}},'servicelevel':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf224('0x14')](0xb)},'timeout':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':_0xf224('0x15')},'autopause':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no',_0xf224('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xf224('0x16')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf224('0x16')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf224('0x16')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf224('0x3')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf224('0x3')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':_0xf224('0x15')},'announce_holdtime':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xf224('0x16')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xf224('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf224('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf224('0x3')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf224('0x3')]},'queue_youarenext':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf224('0x3')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf224('0x3')]},'queue_quantity1':{'type':Sequelize[_0xf224('0x3')]},'queue_quantity2':{'type':Sequelize[_0xf224('0x3')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x7bd15b){this[_0xf224('0x9')](_0xf224('0x18'),_0x7bd15b?_0x7bd15b[_0xf224('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0xf224('0x18'))?this[_0xf224('0xb')](_0xf224('0x18'))[_0xf224('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'yes','set':function(_0x518848){this[_0xf224('0x9')](_0xf224('0x1b'),_0x518848?_0x518848[_0xf224('0x19')](','):[]);},'get':function(){return this[_0xf224('0xb')](_0xf224('0x1b'))?this[_0xf224('0xb')](_0xf224('0x1b'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'no','set':function(_0x5b0b85){this['setDataValue'](_0xf224('0x1c'),_0x5b0b85?_0x5b0b85[_0xf224('0x19')](','):[]);},'get':function(){return this[_0xf224('0xb')](_0xf224('0x1c'))?this[_0xf224('0xb')]('leavewhenempty')[_0xf224('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf224('0x3')]},'description':{'type':Sequelize[_0xf224('0x3')]},'acw':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':0x0,'set':function(_0x4c4309){this[_0xf224('0x9')](_0xf224('0x1e'),_0x4c4309);if(_0x4c4309){if(this[_0xf224('0xb')](_0xf224('0x1f'))<0x2){this[_0xf224('0x9')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf224('0x20')},'dialMethod':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x21'),'progressive',_0xf224('0x13'),_0xf224('0x12'),_0xf224('0xf')),'defaultValue':_0xf224('0x11'),'comment':_0xf224('0x22')},'dialLimitChannel':{'type':Sequelize[_0xf224('0x14')](0x4)[_0xf224('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf224('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xf224('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf224('0x25')},'dialPowerLevel':{'type':Sequelize[_0xf224('0x26')](0x2)[_0xf224('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x27'),_0xf224('0x28')),'defaultValue':_0xf224('0x28'),'comment':_0xf224('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf224('0x26')](0x2)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf224('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xf224('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf224('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf224('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xf224('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf224('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'tTxX','comment':_0xf224('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xf224('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf224('0x14')](0x3)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf224('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf224('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf224('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf224('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf224('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf224('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf224('0x33')},'dialTimezone':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf224('0x3')],'defaultValue':_0xf224('0x34')},'dialPrefix':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf224('0x16')]('always',_0xf224('0x35'),'onlyIfOpen'),'defaultValue':_0xf224('0x36')},'dialAMDActive':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':0x0,'comment':_0xf224('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf224('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf224('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf224('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf224('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf224('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf224('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf224('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf224('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf224('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xf224('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':0x0,'comment':_0xf224('0x40')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf224('0x41'),_0xf224('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xf224('0x3')],'comment':_0xf224('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf224('0x14')](0x3)[_0xf224('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf224('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf224('0x44')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf224('0x14')],'allowNull':!![],'comment':_0xf224('0x45')},'mandatoryDisposition':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':![],'comment':_0xf224('0x46'),'set':function(_0x18a3fc){if(!_0x18a3fc)this[_0xf224('0x9')](_0xf224('0x47'),null);this[_0xf224('0x9')](_0xf224('0x48'),_0x18a3fc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf224('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf224('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xb162=['Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\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)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Cut\x20Digit\x20(min:1,\x20max:15)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','name','ENUM','inbound','outbound','STRING','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','booked','progressive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','preview','Dial\x20Method.','UNSIGNED','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb162,0xe2));var _0x2b16=function(_0x27939f,_0x5d54f9){_0x27939f=_0x27939f-0x0;var _0x23d9e4=_0xb162[_0x27939f];return _0x23d9e4;};'use strict';var Sequelize=require(_0x2b16('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2b16('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x3'),_0x2b16('0x4')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':_0x2b16('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x2b16('0x2')]('rr',_0x2b16('0x7'),_0x2b16('0x8'),_0x2b16('0x9'),_0x2b16('0xa'),'rrmemory',_0x2b16('0xb'),_0x2b16('0xc'),_0x2b16('0xd')),'allowNull':![],'defaultValue':_0x2b16('0x7'),'set':function(_0x26c178){this[_0x2b16('0xe')](_0x2b16('0xf'),_0x26c178?_0x26c178:_0x2b16('0x10'));},'get':function(){var _0x30bdfb=this[_0x2b16('0x11')](_0x2b16('0x12'));var _0x163f84=this[_0x2b16('0x11')]('dialMethod');var _0x2351aa=this[_0x2b16('0x11')]('strategy');if(_0x30bdfb===_0x2b16('0x3')){return _0x2351aa;}if(_0x163f84===_0x2b16('0x13')&&_0x2351aa===_0x2b16('0x10')||_0x163f84===_0x2b16('0x13')&&_0x2351aa==='roundrobin'){return _0x2351aa;}if(_0x163f84===_0x2b16('0x14')||_0x163f84==='predictive'||_0x163f84===_0x2b16('0x15')){return _0x2351aa;}return null;}},'servicelevel':{'type':Sequelize[_0x2b16('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2b16('0x16')](0xb)},'timeout':{'type':Sequelize[_0x2b16('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x2b16('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2b16('0x5')]},'weight':{'type':Sequelize[_0x2b16('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2b16('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x2b16('0x17'),'no'),'defaultValue':_0x2b16('0x17')},'autopause':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no',_0x2b16('0x18')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x2b16('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x2b16('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2b16('0x2')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2b16('0x5')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x2b16('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no'),'defaultValue':_0x2b16('0x17')},'announce_holdtime':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no',_0x2b16('0x19')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x2b16('0x17'),'no')},'announce_position_limit':{'type':Sequelize[_0x2b16('0x16')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2b16('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2b16('0x5')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x2b16('0x5')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x2b16('0x5')]},'queue_quantity2':{'type':Sequelize[_0x2b16('0x5')]},'queue_periodic_announce':{'type':Sequelize[_0x2b16('0x5')]},'queue_less_than':{'type':Sequelize[_0x2b16('0x5')]},'periodic_announce':{'type':Sequelize[_0x2b16('0x1a')],'set':function(_0x3745f1){this[_0x2b16('0xe')](_0x2b16('0x1b'),_0x3745f1?_0x3745f1[_0x2b16('0x1c')](','):[]);},'get':function(){return this['getDataValue'](_0x2b16('0x1b'))?this[_0x2b16('0x11')](_0x2b16('0x1b'))[_0x2b16('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':'yes','set':function(_0x5affbc){this[_0x2b16('0xe')]('joinempty',_0x5affbc?_0x5affbc[_0x2b16('0x1c')](','):[]);},'get':function(){return this[_0x2b16('0x11')](_0x2b16('0x1e'))?this[_0x2b16('0x11')](_0x2b16('0x1e'))[_0x2b16('0x1d')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x95e0a5){this[_0x2b16('0xe')](_0x2b16('0x1f'),_0x95e0a5?_0x95e0a5[_0x2b16('0x1c')](','):[]);},'get':function(){return this[_0x2b16('0x11')]('leavewhenempty')?this['getDataValue'](_0x2b16('0x1f'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x2b16('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x17'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2b16('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x2b16('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2b16('0x5')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x2b16('0x20')],'defaultValue':0x0,'set':function(_0x2a16c9){this[_0x2b16('0xe')](_0x2b16('0x21'),_0x2a16c9);if(_0x2a16c9){if(this[_0x2b16('0x11')](_0x2b16('0x22'))<0x2){this[_0x2b16('0xe')](_0x2b16('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x23'),_0x2b16('0x14'),'power','predictive',_0x2b16('0x13')),'defaultValue':_0x2b16('0x14'),'comment':_0x2b16('0x24')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x2b16('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x2b16('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0x2b16('0x26')](0x2)[_0x2b16('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2b16('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x2b16('0x2')](_0x2b16('0x28'),'dropRate'),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2b16('0x26')](0x2)[_0x2b16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2b16('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2b16('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2b16('0x2b')},'dialQueueOptions':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':_0x2b16('0x2c'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2b16('0x2d')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2b16('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2b16('0x16')](0x5)[_0x2b16('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2b16('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2b16('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2b16('0x16')](0x5)[_0x2b16('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2b16('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2b16('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x2b16('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2b16('0x16')](0x5)[_0x2b16('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0x2b16('0x5')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x2b16('0x2')]('always',_0x2b16('0x33'),_0x2b16('0x34')),'defaultValue':_0x2b16('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2b16('0x36')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2b16('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x2b16('0x16')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2b16('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2b16('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2b16('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2b16('0x16')](0x9)[_0x2b16('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2b16('0x39')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2b16('0x16')](0x9)[_0x2b16('0x25')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2b16('0x16')](0x9)[_0x2b16('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2b16('0x3a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2b16('0x16')](0x5)[_0x2b16('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2b16('0x16')](0x9)[_0x2b16('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2b16('0x3b')},'dialRecallMeTimeout':{'type':Sequelize[_0x2b16('0x16')](0x5)[_0x2b16('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0x2b16('0x20')],'defaultValue':0x0,'comment':_0x2b16('0x3c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x2b16('0x3d'),'ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x2b16('0x5')],'comment':_0x2b16('0x3e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2b16('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2b16('0x3f')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b16('0x16')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x2b16('0x20')],'defaultValue':![],'comment':_0x2b16('0x40'),'set':function(_0x2aa903){if(!_0x2aa903)this[_0x2b16('0xe')](_0x2b16('0x41'),null);this[_0x2b16('0xe')](_0x2b16('0x42'),_0x2aa903);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2b16('0x16')](0x3)[_0x2b16('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 1d44117..11f756d 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 _0xbd6f=['show','params','rawAttributes','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','findOne','CmHopper','order','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','UserVoiceQueue','each','upsert','isNil','format','SIP/%s','emit','ids','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','TeamId','all','removeTeams','isEmpty','UserVoiceQueueRt','addAgents','userVoiceQueue:save','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','updatedAt','select','NOW()','ListId','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','cm_hopper','onlyIfOpen','into','cm_contacts','ListId\x20=\x20?','removeLists','getBlackLists','CmList','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','count','offset','limit','set','json','reject','update','then','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','index','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x138d08,_0x199136){var _0x252fa7=function(_0x40e5f0){while(--_0x40e5f0){_0x138d08['push'](_0x138d08['shift']());}};_0x252fa7(++_0x199136);}(_0xbd6f,0x1d9));var _0xfbd6=function(_0x256773,_0x598214){_0x256773=_0x256773-0x0;var _0xc0a4bb=_0xbd6f[_0x256773];return _0xc0a4bb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfbd6('0x0'));var rimraf=require(_0xfbd6('0x1'));var zipdir=require(_0xfbd6('0x2'));var jsonpatch=require(_0xfbd6('0x3'));var rp=require(_0xfbd6('0x4'));var moment=require(_0xfbd6('0x5'));var BPromise=require(_0xfbd6('0x6'));var Mustache=require(_0xfbd6('0x7'));var util=require('util');var path=require(_0xfbd6('0x8'));var sox=require(_0xfbd6('0x9'));var csv=require('to-csv');var ejs=require(_0xfbd6('0xa'));var fs=require('fs');var _=require(_0xfbd6('0xb'));var squel=require(_0xfbd6('0xc'));var crypto=require(_0xfbd6('0xd'));var jsforce=require(_0xfbd6('0xe'));var deskjs=require(_0xfbd6('0xf'));var toCsv=require(_0xfbd6('0x10'));var querystring=require(_0xfbd6('0x11'));var Papa=require(_0xfbd6('0x12'));var Redis=require(_0xfbd6('0x13'));var authService=require(_0xfbd6('0x14'));var qs=require(_0xfbd6('0x15'));var as=require(_0xfbd6('0x16'));var hardwareService=require(_0xfbd6('0x17'));var logger=require('../../config/logger')(_0xfbd6('0x18'));var utils=require(_0xfbd6('0x19'));var config=require(_0xfbd6('0x1a'));var db=require(_0xfbd6('0x1b'))['db'];config[_0xfbd6('0x1c')]=_[_0xfbd6('0x1d')](config[_0xfbd6('0x1c')],{'host':_0xfbd6('0x1e'),'port':0x18eb});var socket=require(_0xfbd6('0x1f'))(new Redis(config[_0xfbd6('0x1c')]));require(_0xfbd6('0x20'))[_0xfbd6('0x21')](socket);function respondWithStatusCode(_0x282fdf,_0x405310){_0x405310=_0x405310||0xcc;return function(_0x1b75c7){if(_0x1b75c7){return _0x282fdf[_0xfbd6('0x22')](_0x405310);}return _0x282fdf['status'](_0x405310)[_0xfbd6('0x23')]();};}function respondWithResult(_0x638fbb,_0x11deab){_0x11deab=_0x11deab||0xc8;return function(_0x5c55f5){if(_0x5c55f5){return _0x638fbb[_0xfbd6('0x24')](_0x11deab)['json'](_0x5c55f5);}};}function respondWithFilteredResult(_0x572f31,_0x2c60fc){return function(_0x3906c3){if(_0x3906c3){var _0x3dfd59=_0x3906c3[_0xfbd6('0x25')],_0x310c6d=_0x2c60fc['offset'],_0x5373e1=_0x2c60fc[_0xfbd6('0x26')]+_0x2c60fc[_0xfbd6('0x27')],_0x3eda5b;if(_0x5373e1>=_0x3dfd59){_0x5373e1=_0x3dfd59;_0x3eda5b=0xc8;}else{_0x3eda5b=0xce;}_0x572f31['status'](_0x3eda5b);return _0x572f31[_0xfbd6('0x28')]('Content-Range',_0x310c6d+'-'+_0x5373e1+'/'+_0x3dfd59)[_0xfbd6('0x29')](_0x3906c3);}return null;};}function patchUpdates(_0x223781){return function(_0x23dd3b){try{jsonpatch['apply'](_0x23dd3b,_0x223781,!![]);}catch(_0x1bdec0){return BPromise[_0xfbd6('0x2a')](_0x1bdec0);}return _0x23dd3b['save']();};}function saveUpdates(_0x5acb61,_0x4a6d7d){return function(_0x3a411e){if(_0x3a411e){return _0x3a411e[_0xfbd6('0x2b')](_0x5acb61)['then'](function(_0x22c098){return _0x22c098;});}return null;};}function removeEntity(_0x2bd254,_0xe8467b){return function(_0x3921ae){if(_0x3921ae){return _0x3921ae['destroy']()[_0xfbd6('0x2c')](function(){var _0x46236d=_0x3921ae['get']({'plain':!![]});var _0x4772f2=[{'name':_0xfbd6('0x2d'),'value':'inbound','ignore':![]},{'name':_0xfbd6('0x2e'),'value':_0xfbd6('0x2f'),'ignore':![]}];var _0x2156d7=_(_0x4772f2)[_0xfbd6('0x30')](_0xfbd6('0x31'))[_0xfbd6('0x32')](_0xfbd6('0x33'))[_0xfbd6('0x33')]();if(_[_0xfbd6('0x34')](_0x2156d7,_0x46236d[_0xfbd6('0x35')])){return;}var _0x209733=_[_0xfbd6('0x36')](_0x4772f2,[_0xfbd6('0x33'),_0x46236d[_0xfbd6('0x35')]])['name'];return db[_0xfbd6('0x37')]['destroy']({'where':{'type':_0x209733,'resourceId':_0x46236d['id']}})[_0xfbd6('0x2c')](function(){return _0x3921ae;});})[_0xfbd6('0x2c')](function(){_0x2bd254[_0xfbd6('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353ea2,_0x169d11){return function(_0x4e47b9){if(!_0x4e47b9){_0x353ea2[_0xfbd6('0x22')](0x194);}return _0x4e47b9;};}function handleError(_0x429fb4,_0x166036){_0x166036=_0x166036||0x1f4;return function(_0x555a51){logger[_0xfbd6('0x38')](_0x555a51[_0xfbd6('0x39')]);if(_0x555a51['name']){delete _0x555a51[_0xfbd6('0x3a')];}_0x429fb4['status'](_0x166036)['send'](_0x555a51);};}exports[_0xfbd6('0x3b')]=function(_0x5064ee,_0x1323d6){var _0x425a57={},_0x24477c={},_0x4b2d2b={'count':0x0,'rows':[]};var _0x3ce2e7=_[_0xfbd6('0x32')](db[_0xfbd6('0x3c')]['rawAttributes'],function(_0x252691){return{'name':_0x252691[_0xfbd6('0x3d')],'type':_0x252691['type'][_0xfbd6('0x3e')]};});_0x24477c[_0xfbd6('0x3f')]=_[_0xfbd6('0x32')](_0x3ce2e7,_0xfbd6('0x3a'));_0x24477c[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x5064ee[_0xfbd6('0x40')]);_0x24477c[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x24477c[_0xfbd6('0x3f')],_0x24477c[_0xfbd6('0x40')]);_0x425a57['attributes']=_[_0xfbd6('0x43')](_0x24477c[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x425a57[_0xfbd6('0x45')]=_0x425a57['attributes']['length']?_0x425a57[_0xfbd6('0x45')]:_0x24477c[_0xfbd6('0x3f')];if(!_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x425a57[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x5064ee['query'][_0xfbd6('0x27')]);_0x425a57[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x26')]);}_0x425a57['order']=qs['sort'](_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x425a57[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_['pick'](_0x5064ee[_0xfbd6('0x40')],_0x24477c[_0xfbd6('0x42')]));if(_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x425a57[_0xfbd6('0x49')]=_['merge'](_0x425a57[_0xfbd6('0x49')],{'$or':_['map'](_0x3ce2e7,function(_0xed728c){if(_0xed728c[_0xfbd6('0x35')]!==_0xfbd6('0x4a')){var _0x42c384={};_0x42c384[_0xed728c['name']]={'$like':'%'+_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x42c384;}})});}_0x425a57=_[_0xfbd6('0x4b')]({},_0x425a57,_0x5064ee[_0xfbd6('0x4c')]);var _0x27b8b0={'where':_0x425a57[_0xfbd6('0x49')]};return db[_0xfbd6('0x3c')][_0xfbd6('0x25')](_0x27b8b0)[_0xfbd6('0x2c')](function(_0x480b4c){_0x4b2d2b[_0xfbd6('0x25')]=_0x480b4c;if(_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x425a57[_0xfbd6('0x4e')]=[{'all':!![]}];}return db[_0xfbd6('0x3c')][_0xfbd6('0x4f')](_0x425a57);})[_0xfbd6('0x2c')](function(_0x5b8d45){_0x4b2d2b[_0xfbd6('0x50')]=_0x5b8d45;return _0x4b2d2b;})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x1323d6,_0x425a57))[_0xfbd6('0x51')](handleError(_0x1323d6,null));};exports[_0xfbd6('0x52')]=function(_0x117572,_0x49e2fa){var _0x3646b0={'raw':![],'where':{'id':_0x117572[_0xfbd6('0x53')]['id']}},_0x33a354={};_0x33a354[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0x3c')][_0xfbd6('0x54')]);_0x33a354[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x117572['query']);_0x33a354[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x33a354[_0xfbd6('0x3f')],_0x33a354[_0xfbd6('0x40')]);_0x3646b0['attributes']=_[_0xfbd6('0x43')](_0x33a354[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x117572[_0xfbd6('0x40')]['fields']));_0x3646b0[_0xfbd6('0x45')]=_0x3646b0[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x3646b0[_0xfbd6('0x45')]:_0x33a354['model'];if(_0x117572[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x3646b0['include']=[{'all':!![]}];}_0x3646b0=_[_0xfbd6('0x4b')]({},_0x3646b0,_0x117572['options']);return db[_0xfbd6('0x3c')][_0xfbd6('0x36')](_0x3646b0)['then'](handleEntityNotFound(_0x49e2fa,null))[_0xfbd6('0x2c')](respondWithResult(_0x49e2fa,null))[_0xfbd6('0x51')](handleError(_0x49e2fa,null));};exports[_0xfbd6('0x56')]=function(_0x8f32fe,_0x11bea5){return db[_0xfbd6('0x3c')][_0xfbd6('0x56')](_0x8f32fe[_0xfbd6('0x57')],{})['then'](function(_0x5230a9){var _0x70013f=_0x8f32fe[_0xfbd6('0x58')][_0xfbd6('0x59')]({'plain':!![]});if(!_0x70013f)throw new Error(_0xfbd6('0x5a'));if(_0x70013f[_0xfbd6('0x5b')]==='user'){var _0x58c826=_0x5230a9[_0xfbd6('0x59')]({'plain':!![]});var _0x5e8af5=[{'name':_0xfbd6('0x2d'),'value':_0xfbd6('0x5c')},{'name':_0xfbd6('0x2e'),'value':_0xfbd6('0x2f')}];var _0x8e982e=_[_0xfbd6('0x36')](_0x5e8af5,[_0xfbd6('0x33'),_0x58c826[_0xfbd6('0x35')]])[_0xfbd6('0x3a')];return db[_0xfbd6('0x5d')][_0xfbd6('0x36')]({'where':{'name':_0x8e982e,'userProfileId':_0x70013f[_0xfbd6('0x5e')]},'raw':!![]})[_0xfbd6('0x2c')](function(_0x259891){if(_0x259891&&_0x259891[_0xfbd6('0x5f')]===0x0){return db[_0xfbd6('0x37')][_0xfbd6('0x56')]({'name':_0x58c826[_0xfbd6('0x3a')],'resourceId':_0x58c826['id'],'type':_0x259891[_0xfbd6('0x3a')],'sectionId':_0x259891['id']},{})[_0xfbd6('0x2c')](function(){return _0x5230a9;});}else{return _0x5230a9;}})['catch'](function(_0x4d92ed){logger[_0xfbd6('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d92ed);throw _0x4d92ed;});}return _0x5230a9;})[_0xfbd6('0x2c')](respondWithResult(_0x11bea5,0xc9))['catch'](handleError(_0x11bea5,null));};exports[_0xfbd6('0x60')]=function(_0x32ef2c,_0x4bfa3f){var _0x54c416={'where':{'id':_0x32ef2c[_0xfbd6('0x53')]['id']}},_0x2ac9e9={};_0x2ac9e9[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db['VoiceQueue'][_0xfbd6('0x54')]);_0x54c416[_0xfbd6('0x45')]=_[_0xfbd6('0x43')](_0x2ac9e9[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x32ef2c[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x54c416[_0xfbd6('0x45')]=_0x54c416['attributes'][_0xfbd6('0x55')]?_0x54c416['attributes']:_0x2ac9e9[_0xfbd6('0x3f')];if(_0x32ef2c[_0xfbd6('0x40')]['includeAll']){_0x54c416['include']=[{'all':!![]}];}_0x54c416=_[_0xfbd6('0x4b')]({},_0x54c416,_0x32ef2c[_0xfbd6('0x4c')]);return db['VoiceQueue'][_0xfbd6('0x36')](_0x54c416)['then'](handleEntityNotFound(_0x4bfa3f,null))['then'](function(_0x40663b){if(_0x40663b){var _0x3409b3=_0x40663b['get']({'plain':!![]});_0x3409b3=qs[_0xfbd6('0x61')](_0x3409b3,['id','createdAt','updatedAt']);_0x32ef2c[_0xfbd6('0x57')]=_['omit'](_0x32ef2c['body'],['id',_0xfbd6('0x62'),'updatedAt']);return db[_0xfbd6('0x3c')][_0xfbd6('0x56')](_[_0xfbd6('0x4b')](_0x3409b3,_0x32ef2c[_0xfbd6('0x57')]),{'include':_0x32ef2c[_0xfbd6('0x40')][_0xfbd6('0x4d')]?[{'all':!![]}]:undefined})[_0xfbd6('0x2c')](function(_0x564502){var _0x2dba05=_0x32ef2c[_0xfbd6('0x58')][_0xfbd6('0x59')]({'plain':!![]});if(!_0x2dba05)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dba05[_0xfbd6('0x5b')]==='user'){var _0x566679=_0x564502['get']({'plain':!![]});var _0x21e9ff=[{'name':_0xfbd6('0x2d'),'value':_0xfbd6('0x5c')},{'name':_0xfbd6('0x2e'),'value':_0xfbd6('0x2f')}];var _0x2c5282=_[_0xfbd6('0x36')](_0x21e9ff,[_0xfbd6('0x33'),_0x566679[_0xfbd6('0x35')]])[_0xfbd6('0x3a')];return db[_0xfbd6('0x5d')][_0xfbd6('0x36')]({'where':{'name':_0x2c5282,'userProfileId':_0x2dba05[_0xfbd6('0x5e')]},'raw':!![]})[_0xfbd6('0x2c')](function(_0x576df3){if(_0x576df3&&_0x576df3[_0xfbd6('0x5f')]===0x0){return db[_0xfbd6('0x37')][_0xfbd6('0x56')]({'name':_0x566679[_0xfbd6('0x3a')],'resourceId':_0x566679['id'],'type':_0x576df3['name'],'sectionId':_0x576df3['id']},{})[_0xfbd6('0x2c')](function(){return _0x564502;});}else{return _0x564502;}})[_0xfbd6('0x51')](function(_0x36dd4c){logger[_0xfbd6('0x38')](_0xfbd6('0x63'),_0x36dd4c);throw _0x36dd4c;});}return _0x564502;});}})[_0xfbd6('0x2c')](respondWithResult(_0x4bfa3f,0xc9))['catch'](handleError(_0x4bfa3f,null));};exports['update']=function(_0x5e550b,_0x38d22e){if(_0x5e550b[_0xfbd6('0x57')]['id']){delete _0x5e550b[_0xfbd6('0x57')]['id'];}return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x5e550b[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x38d22e,null))[_0xfbd6('0x2c')](saveUpdates(_0x5e550b[_0xfbd6('0x57')],null))['then'](respondWithResult(_0x38d22e,null))[_0xfbd6('0x51')](handleError(_0x38d22e,null));};exports[_0xfbd6('0x64')]=function(_0x5039ba,_0x15f7a5){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x5039ba[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x15f7a5,null))[_0xfbd6('0x2c')](removeEntity(_0x15f7a5,null))[_0xfbd6('0x51')](handleError(_0x15f7a5,null));};exports[_0xfbd6('0x65')]=function(_0x4cc954,_0xd214e6,_0x120f09){var _0x32f318={'raw':![],'where':{}};var _0x43d55c={};var _0x3d00ff={'count':0x0,'rows':[]};return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x4cc954[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0xd214e6,null))[_0xfbd6('0x2c')](function(_0x4987aa){if(_0x4987aa){_0x43d55c[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0x67')][_0xfbd6('0x54')]);_0x43d55c[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x4cc954[_0xfbd6('0x40')]);_0x43d55c[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x43d55c[_0xfbd6('0x3f')],_0x43d55c[_0xfbd6('0x40')]);_0x32f318[_0xfbd6('0x45')]=_['intersection'](_0x43d55c[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x4cc954[_0xfbd6('0x40')]['fields']));_0x32f318[_0xfbd6('0x45')]=_0x32f318[_0xfbd6('0x45')]['length']?_0x32f318[_0xfbd6('0x45')]:_0x43d55c[_0xfbd6('0x3f')];if(!_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x32f318[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x32f318[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x26')]);}_0x32f318[_0xfbd6('0x68')]=qs['sort'](_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x32f318[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x4cc954[_0xfbd6('0x40')],_0x43d55c[_0xfbd6('0x42')]));_0x32f318[_0xfbd6('0x49')][_0xfbd6('0x6a')]=_0x4987aa['id'];if(_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x32f318['where']=_[_0xfbd6('0x4b')](_0x32f318[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x32f318[_0xfbd6('0x45')],function(_0x3c5dd3){var _0x4a6a48={};_0x4a6a48[_0x3c5dd3]={'$like':'%'+_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x4a6a48;})});}_0x32f318=_['merge']({},_0x32f318,_0x4cc954[_0xfbd6('0x4c')]);return db['CmHopper'][_0xfbd6('0x25')]({'where':_0x32f318[_0xfbd6('0x49')]})['then'](function(_0x59d53c){_0x3d00ff[_0xfbd6('0x25')]=_0x59d53c;if(_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x32f318[_0xfbd6('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xfbd6('0x4f')](_0x32f318);})[_0xfbd6('0x2c')](function(_0x38a7a6){_0x3d00ff['rows']=_0x38a7a6;return _0x3d00ff;});}})['then'](respondWithFilteredResult(_0xd214e6,_0x32f318))[_0xfbd6('0x51')](handleError(_0xd214e6,null));};exports[_0xfbd6('0x6b')]=function(_0x30711b,_0x1382b3,_0x420971){var _0x1d24bc={'raw':!![],'where':{}};var _0x1a5c99={};var _0x3ab3c6={'count':0x0,'rows':[]};return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x30711b[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x1382b3,null))[_0xfbd6('0x2c')](function(_0xcca29){if(_0xcca29){_0x1a5c99[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x6c')]['rawAttributes']);_0x1a5c99['query']=_['keys'](_0x30711b[_0xfbd6('0x40')]);_0x1a5c99[_0xfbd6('0x42')]=_['intersection'](_0x1a5c99[_0xfbd6('0x3f')],_0x1a5c99[_0xfbd6('0x40')]);_0x1d24bc['attributes']=_[_0xfbd6('0x43')](_0x1a5c99[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x30711b[_0xfbd6('0x40')]['fields']));_0x1d24bc[_0xfbd6('0x45')]=_0x1d24bc[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x1d24bc[_0xfbd6('0x45')]:_0x1a5c99[_0xfbd6('0x3f')];if(!_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x1d24bc[_0xfbd6('0x27')]=qs['limit'](_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x1d24bc[_0xfbd6('0x26')]=qs['offset'](_0x30711b[_0xfbd6('0x40')]['offset']);}_0x1d24bc[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x1d24bc['where']=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x30711b[_0xfbd6('0x40')],_0x1a5c99[_0xfbd6('0x42')]));_0x1d24bc[_0xfbd6('0x49')][_0xfbd6('0x6a')]=_0xcca29['id'];if(_0x30711b[_0xfbd6('0x40')]['filter']){_0x1d24bc[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x1d24bc[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x1d24bc[_0xfbd6('0x45')],function(_0x5d5f6b){var _0xd6795={};_0xd6795[_0x5d5f6b]={'$like':'%'+_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0xd6795;})});}_0x1d24bc=_[_0xfbd6('0x4b')]({},_0x1d24bc,_0x30711b[_0xfbd6('0x4c')]);return db[_0xfbd6('0x6c')]['count']({'where':_0x1d24bc[_0xfbd6('0x49')]})[_0xfbd6('0x2c')](function(_0x284917){_0x3ab3c6[_0xfbd6('0x25')]=_0x284917;if(_0x30711b['query'][_0xfbd6('0x4d')]){_0x1d24bc[_0xfbd6('0x4e')]=[{'all':!![]}];}return db[_0xfbd6('0x6c')][_0xfbd6('0x4f')](_0x1d24bc);})[_0xfbd6('0x2c')](function(_0x7e5927){_0x3ab3c6[_0xfbd6('0x50')]=_0x7e5927;return _0x3ab3c6;});}})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x1382b3,_0x1d24bc))['catch'](handleError(_0x1382b3,null));};exports[_0xfbd6('0x6d')]=function(_0x308a08,_0x4c2bcf,_0x4735e0){var _0x440de8={'raw':!![],'where':{}};var _0xe7a8ed={};var _0x5e3661={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfbd6('0x66')]({'where':{'id':_0x308a08[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x4c2bcf,null))[_0xfbd6('0x2c')](function(_0x372cd5){if(_0x372cd5){_0xe7a8ed[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x6e')][_0xfbd6('0x54')]);_0xe7a8ed[_0xfbd6('0x40')]=_['keys'](_0x308a08['query']);_0xe7a8ed[_0xfbd6('0x42')]=_['intersection'](_0xe7a8ed[_0xfbd6('0x3f')],_0xe7a8ed[_0xfbd6('0x40')]);_0x440de8[_0xfbd6('0x45')]=_['intersection'](_0xe7a8ed[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x308a08['query']['fields']));_0x440de8[_0xfbd6('0x45')]=_0x440de8[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x440de8['attributes']:_0xe7a8ed[_0xfbd6('0x3f')];if(!_0x308a08[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x440de8['limit']=qs['limit'](_0x308a08[_0xfbd6('0x40')]['limit']);_0x440de8['offset']=qs[_0xfbd6('0x26')](_0x308a08['query']['offset']);}_0x440de8['order']=qs[_0xfbd6('0x48')](_0x308a08['query']['sort']);_0x440de8[_0xfbd6('0x49')]=qs['filters'](_['pick'](_0x308a08['query'],_0xe7a8ed[_0xfbd6('0x42')]));_0x440de8[_0xfbd6('0x49')][_0xfbd6('0x6a')]=_0x372cd5['id'];if(_0x308a08['query'][_0xfbd6('0x30')]){_0x440de8[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x440de8[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x440de8[_0xfbd6('0x45')],function(_0x4d53ec){var _0x55a880={};_0x55a880[_0x4d53ec]={'$like':'%'+_0x308a08[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x55a880;})});}_0x440de8=_[_0xfbd6('0x4b')]({},_0x440de8,_0x308a08[_0xfbd6('0x4c')]);return db[_0xfbd6('0x6e')]['count']({'where':_0x440de8[_0xfbd6('0x49')]})[_0xfbd6('0x2c')](function(_0xa5219c){_0x5e3661['count']=_0xa5219c;if(_0x308a08[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x440de8[_0xfbd6('0x4e')]=[{'all':!![]}];}return db[_0xfbd6('0x6e')]['findAll'](_0x440de8);})[_0xfbd6('0x2c')](function(_0x3efb06){_0x5e3661[_0xfbd6('0x50')]=_0x3efb06;return _0x5e3661;});}})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x4c2bcf,_0x440de8))['catch'](handleError(_0x4c2bcf,null));};exports[_0xfbd6('0x6f')]=function(_0xf06339,_0x4e4c1b,_0x3d5d86){var _0x164472={'raw':!![],'where':{}};var _0x2327e4={};var _0x4eaf78={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfbd6('0x66')]({'where':{'id':_0xf06339[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x4e4c1b,null))['then'](function(_0x42cffe){if(_0x42cffe){_0x2327e4[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x70')]['rawAttributes']);_0x2327e4[_0xfbd6('0x40')]=_['keys'](_0xf06339['query']);_0x2327e4[_0xfbd6('0x42')]=_['intersection'](_0x2327e4[_0xfbd6('0x3f')],_0x2327e4[_0xfbd6('0x40')]);_0x164472['attributes']=_[_0xfbd6('0x43')](_0x2327e4[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0xf06339[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x164472[_0xfbd6('0x45')]=_0x164472[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x164472[_0xfbd6('0x45')]:_0x2327e4[_0xfbd6('0x3f')];if(!_0xf06339['query'][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x164472[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0xf06339['query'][_0xfbd6('0x27')]);_0x164472[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0xf06339['query'][_0xfbd6('0x26')]);}_0x164472['order']=qs[_0xfbd6('0x48')](_0xf06339[_0xfbd6('0x40')]['sort']);_0x164472[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0xf06339[_0xfbd6('0x40')],_0x2327e4[_0xfbd6('0x42')]));_0x164472['where']['VoiceQueueId']=_0x42cffe['id'];if(_0xf06339[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x164472[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x164472[_0xfbd6('0x49')],{'$or':_['map'](_0x164472['attributes'],function(_0x4ffb10){var _0x4c7863={};_0x4c7863[_0x4ffb10]={'$like':'%'+_0xf06339[_0xfbd6('0x40')]['filter']+'%'};return _0x4c7863;})});}_0x164472=_[_0xfbd6('0x4b')]({},_0x164472,_0xf06339[_0xfbd6('0x4c')]);return db[_0xfbd6('0x70')][_0xfbd6('0x25')]({'where':_0x164472[_0xfbd6('0x49')]})['then'](function(_0xd01eb6){_0x4eaf78['count']=_0xd01eb6;if(_0xf06339['query'][_0xfbd6('0x4d')]){_0x164472['include']=[{'all':!![]}];}return db[_0xfbd6('0x70')]['findAll'](_0x164472);})[_0xfbd6('0x2c')](function(_0x45c444){_0x4eaf78[_0xfbd6('0x50')]=_0x45c444;return _0x4eaf78;});}})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x4e4c1b,_0x164472))['catch'](handleError(_0x4e4c1b,null));};exports['getTeams']=function(_0x4dc855,_0x43a7e2,_0x14d5f0){var _0x3472e8={};var _0x3dbcb8={};var _0x578b1e;var _0x1266de;return db[_0xfbd6('0x3c')]['findOne']({'where':{'id':_0x4dc855['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x43a7e2,null))[_0xfbd6('0x2c')](function(_0x37cf14){if(_0x37cf14){_0x578b1e=_0x37cf14;_0x3dbcb8[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x71')][_0xfbd6('0x54')]);_0x3dbcb8[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x4dc855[_0xfbd6('0x40')]);_0x3dbcb8[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x3dbcb8[_0xfbd6('0x3f')],_0x3dbcb8[_0xfbd6('0x40')]);_0x3472e8[_0xfbd6('0x45')]=_[_0xfbd6('0x43')](_0x3dbcb8[_0xfbd6('0x3f')],qs['fields'](_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x3472e8[_0xfbd6('0x45')]=_0x3472e8[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x3472e8[_0xfbd6('0x45')]:_0x3dbcb8[_0xfbd6('0x3f')];_0x3472e8[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x4dc855[_0xfbd6('0x40')]['sort']);_0x3472e8[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x4dc855[_0xfbd6('0x40')],_0x3dbcb8[_0xfbd6('0x42')]));if(_0x4dc855['query'][_0xfbd6('0x30')]){_0x3472e8[_0xfbd6('0x49')]=_['merge'](_0x3472e8['where'],{'$or':_['map'](_0x3472e8[_0xfbd6('0x45')],function(_0x314ec4){var _0x8e7056={};_0x8e7056[_0x314ec4]={'$like':'%'+_0x4dc855[_0xfbd6('0x40')]['filter']+'%'};return _0x8e7056;})});}_0x3472e8=_[_0xfbd6('0x4b')]({},_0x3472e8,_0x4dc855[_0xfbd6('0x4c')]);return _0x578b1e['getTeams'](_0x3472e8);}})[_0xfbd6('0x2c')](function(_0x2125ef){if(_0x2125ef){_0x1266de=_0x2125ef['length'];if(!_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x3472e8[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x3472e8['offset']=qs[_0xfbd6('0x26')](_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x578b1e['getTeams'](_0x3472e8);}})[_0xfbd6('0x2c')](function(_0x5bc290){if(_0x5bc290){return _0x5bc290?{'count':_0x1266de,'rows':_0x5bc290}:null;}})[_0xfbd6('0x2c')](respondWithResult(_0x43a7e2,null))[_0xfbd6('0x51')](handleError(_0x43a7e2,null));};exports[_0xfbd6('0x72')]=function(_0x6a76b3,_0x4b21b9,_0x3dfe81){var _0x44ba94=_0x6a76b3[_0xfbd6('0x57')][_0xfbd6('0x73')];var _0x51c0dd=_[_0xfbd6('0x32')](_0x44ba94,'id');return db[_0xfbd6('0x71')][_0xfbd6('0x4f')]({'where':{'id':_0x51c0dd},'attributes':['id'],'include':[{'model':db[_0xfbd6('0x74')],'as':'Agents','attributes':['id',_0xfbd6('0x3a'),_0xfbd6('0x75'),_0xfbd6('0x76'),_0xfbd6('0x77')],'raw':!![]}]})[_0xfbd6('0x2c')](function(_0x49f6df){if(_0x49f6df){var _0x2664e2=_[_0xfbd6('0x78')](_0x49f6df,function(_0x28b311){var _0x53e0da=_0x28b311[_0xfbd6('0x59')]({'plain':!![]});_0x53e0da[_0xfbd6('0x79')][_0xfbd6('0x7a')](function(_0x518729){_0x518729[_0xfbd6('0x7b')]=_[_0xfbd6('0x36')](_0x44ba94,{'id':_0x53e0da['id']})[_0xfbd6('0x7b')];});return _0x53e0da['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x6a76b3[_0xfbd6('0x53')]['id']}})['then'](function(_0x2f9fe1){return db[_0xfbd6('0x7c')][_0xfbd6('0x7d')](function(_0x31c321){return _0x2f9fe1['addTeams'](_0x51c0dd,{'transaction':_0x31c321})[_0xfbd6('0x2c')](function(){return BPromise['each'](_0x2664e2,function(_0x5989ee){return db[_0xfbd6('0x7e')]['findOrCreate']({'where':{'UserId':_0x5989ee['id'],'VoiceQueueId':_0x6a76b3[_0xfbd6('0x53')]['id']},'defaults':{'penalty':_0x5989ee['penalty']},'transaction':_0x31c321});});})[_0xfbd6('0x2c')](function(){return BPromise[_0xfbd6('0x7f')](_[_0xfbd6('0x30')](_0x2664e2,{'online':!![]}),function(_0x57890c){return db['UserVoiceQueueRt'][_0xfbd6('0x80')]({'membername':_0x57890c[_0xfbd6('0x3a')],'UserId':_0x57890c['id'],'queue_name':_0x2f9fe1['name'],'VoiceQueueId':_0x2f9fe1['id'],'interface':_[_0xfbd6('0x81')](_0x57890c[_0xfbd6('0x77')])?util[_0xfbd6('0x82')](_0xfbd6('0x83'),_0x57890c['name']):_0x57890c[_0xfbd6('0x77')],'paused':_0x57890c[_0xfbd6('0x76')]||![],'penalty':_0x57890c[_0xfbd6('0x7b')]},{'transaction':_0x31c321});});})[_0xfbd6('0x2c')](function(){_0x2664e2[_0xfbd6('0x7a')](function(_0x4e4ddd){socket[_0xfbd6('0x84')]('userVoiceQueue:save',{'UserId':_0x4e4ddd['id'],'VoiceQueueId':_0x2f9fe1['id']});});});});});}})[_0xfbd6('0x2c')](respondWithStatusCode(_0x4b21b9,null))[_0xfbd6('0x51')](handleError(_0x4b21b9,null));};exports['removeTeams']=function(_0x56a05e,_0x1702c5,_0x485830){return db['Team']['findAll']({'where':{'id':_0x56a05e[_0xfbd6('0x40')][_0xfbd6('0x85')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfbd6('0x2c')](handleEntityNotFound(_0x1702c5,null))[_0xfbd6('0x2c')](function(_0x20de16){var _0x39842a=_['map'](_0x20de16,'id');var _0x305e24=[];var _0x338c2e=[];var _0x3b2be1=squel['select']();_0x3b2be1[_0xfbd6('0x86')](_0xfbd6('0x87'))[_0xfbd6('0x88')](_0xfbd6('0x89'),'tq')[_0xfbd6('0x8a')]('user_has_teams','ut',_0xfbd6('0x8b'))['where']('VoiceQueueId\x20=\x20?',_0x56a05e[_0xfbd6('0x53')]['id']);for(var _0x1c79e1=0x0;_0x1c79e1<_0x20de16['length'];_0x1c79e1+=0x1){let _0x153b7c=_0x20de16[_0x1c79e1];for(var _0x205345=0x0;_0x205345<_0x153b7c[_0xfbd6('0x79')]['length'];_0x205345+=0x1){let _0x22a27b=_0x153b7c[_0xfbd6('0x79')][_0x205345];var _0x4f1b35=_0x3b2be1[_0xfbd6('0x60')]();_0x4f1b35[_0xfbd6('0x49')]('ut.UserId\x20=\x20?',_0x22a27b['id']);_0x338c2e[_0xfbd6('0x8c')](db[_0xfbd6('0x7c')][_0xfbd6('0x40')](_0x4f1b35[_0xfbd6('0x8d')](),{'type':db['sequelize']['QueryTypes'][_0xfbd6('0x8e')]})[_0xfbd6('0x2c')](function(_0x5b4ea2){if(_0x5b4ea2[_0xfbd6('0x55')]===0x1){return _0x22a27b['id'];}else{var _0x2c98bb=_[_0xfbd6('0x8f')](_[_0xfbd6('0x32')](_0x5b4ea2,_0xfbd6('0x90')),function(_0x137874){return _[_0xfbd6('0x34')](_0x39842a,_0x137874);});if(_0x2c98bb){return _0x22a27b['id'];}}}));}}return BPromise[_0xfbd6('0x91')](_0x338c2e)[_0xfbd6('0x2c')](function(_0x12ebec){_0x305e24=_(_0x305e24)['union'](_0x12ebec)['compact']()['value']();return db['VoiceQueue']['find']({'where':{'id':_0x56a05e[_0xfbd6('0x53')]['id']}})['then'](function(_0x45287f){return db[_0xfbd6('0x7c')][_0xfbd6('0x7d')](function(_0x574d6b){return _0x45287f[_0xfbd6('0x92')](_0x56a05e[_0xfbd6('0x40')][_0xfbd6('0x85')],{'transaction':_0x574d6b})[_0xfbd6('0x2c')](function(){if(!_[_0xfbd6('0x93')](_0x305e24)){return _0x45287f['removeAgents'](_0x305e24,{'transaction':_0x574d6b})[_0xfbd6('0x2c')](function(){return db[_0xfbd6('0x94')][_0xfbd6('0x64')]({'where':{'VoiceQueueId':_0x56a05e['params']['id'],'UserId':_0x305e24},'transaction':_0x574d6b});});}})['then'](function(){_0x305e24[_0xfbd6('0x7a')](function(_0x4e3f88){socket[_0xfbd6('0x84')]('userVoiceQueue:remove',{'UserId':_0x4e3f88,'VoiceQueueId':_0x45287f['id']});});});});});});})[_0xfbd6('0x2c')](respondWithStatusCode(_0x1702c5,null))[_0xfbd6('0x51')](handleError(_0x1702c5,null));};exports[_0xfbd6('0x95')]=function(_0x1ea0ae,_0x14aea8,_0x5c3cd4){var _0x222814,_0x34dcc6;return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x1ea0ae[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x14aea8,null))['then'](function(_0x29853b){if(_0x29853b){_0x34dcc6=_0x29853b;return _0x29853b[_0xfbd6('0x95')](_0x1ea0ae[_0xfbd6('0x57')][_0xfbd6('0x85')],_[_0xfbd6('0x61')](_0x1ea0ae['body'],[_0xfbd6('0x85'),'id'])||{})['spread'](function(_0x332544){for(var _0x49c825=0x0;_0x49c825<_0x1ea0ae[_0xfbd6('0x57')][_0xfbd6('0x85')]['length'];_0x49c825+=0x1){socket['emit'](_0xfbd6('0x96'),{'UserId':_0x1ea0ae['body'][_0xfbd6('0x85')][_0x49c825],'VoiceQueueId':_0x1ea0ae['params']['id']});}return _0x332544;});}})[_0xfbd6('0x2c')](function(_0x35fc56){_0x222814=_0x35fc56||[];if(_0x34dcc6){return db[_0xfbd6('0x74')][_0xfbd6('0x4f')]({'where':{'id':_0x1ea0ae['body'][_0xfbd6('0x85')]},'attributes':['id',_0xfbd6('0x3a'),_0xfbd6('0x75'),_0xfbd6('0x76'),'interface'],'raw':!![]});}})[_0xfbd6('0x2c')](function(_0x1f6b47){if(!_[_0xfbd6('0x93')](_0x1f6b47)){var _0x3e1854=[];for(var _0x463164=0x0;_0x463164<_0x1f6b47[_0xfbd6('0x55')];_0x463164++){if(_0x1f6b47[_0x463164][_0xfbd6('0x75')]){_0x3e1854[_0xfbd6('0x8c')](db[_0xfbd6('0x94')][_0xfbd6('0x80')]({'membername':_0x1f6b47[_0x463164][_0xfbd6('0x3a')],'UserId':_0x1f6b47[_0x463164]['id'],'queue_name':_0x34dcc6[_0xfbd6('0x3a')],'VoiceQueueId':_0x34dcc6['id'],'interface':_[_0xfbd6('0x81')](_0x1f6b47[_0x463164][_0xfbd6('0x77')])?util[_0xfbd6('0x82')](_0xfbd6('0x83'),_0x1f6b47[_0x463164]['name']):_0x1f6b47[_0x463164]['interface'],'paused':_0x1f6b47[_0x463164][_0xfbd6('0x76')]||![],'penalty':_0x1ea0ae['body'][_0xfbd6('0x7b')]||0x0}));}}return BPromise['all'](_0x3e1854);}})[_0xfbd6('0x2c')](function(){return _0x222814;})[_0xfbd6('0x2c')](respondWithResult(_0x14aea8,null))[_0xfbd6('0x51')](handleError(_0x14aea8,null));};exports[_0xfbd6('0x97')]=function(_0x24bfd4,_0x2bc3f8,_0x1f6956){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x24bfd4['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x2bc3f8,null))[_0xfbd6('0x2c')](function(_0x411b4a){if(_0x411b4a){return _0x411b4a[_0xfbd6('0x97')](_0x24bfd4['query'][_0xfbd6('0x85')])[_0xfbd6('0x2c')](function(){if(_[_0xfbd6('0x98')](_0x24bfd4[_0xfbd6('0x40')][_0xfbd6('0x85')])){for(var _0x307622=0x0;_0x307622<_0x24bfd4[_0xfbd6('0x40')][_0xfbd6('0x85')][_0xfbd6('0x55')];_0x307622+=0x1){socket[_0xfbd6('0x84')]('userVoiceQueue:remove',{'UserId':Number(_0x24bfd4['query'][_0xfbd6('0x85')][_0x307622]),'VoiceQueueId':Number(_0x24bfd4['params']['id'])});}}else{socket[_0xfbd6('0x84')]('userVoiceQueue:remove',{'UserId':Number(_0x24bfd4[_0xfbd6('0x40')][_0xfbd6('0x85')]),'VoiceQueueId':Number(_0x24bfd4[_0xfbd6('0x53')]['id'])});}});}})[_0xfbd6('0x2c')](function(_0x540eae){return db[_0xfbd6('0x94')][_0xfbd6('0x64')]({'where':{'VoiceQueueId':_0x24bfd4[_0xfbd6('0x53')]['id'],'UserId':_0x24bfd4[_0xfbd6('0x40')]['ids']}})[_0xfbd6('0x2c')](function(){return _0x540eae;});})['then'](respondWithStatusCode(_0x2bc3f8,null))[_0xfbd6('0x51')](handleError(_0x2bc3f8,null));};exports[_0xfbd6('0x99')]=function(_0x34dc1b,_0x56ab9c,_0x1155f4){var _0x38cfd6={};var _0x5ca20f={};var _0x57958c;var _0x78d8e;return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x34dc1b[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x56ab9c,null))['then'](function(_0x53d6ec){if(_0x53d6ec){_0x57958c=_0x53d6ec;_0x5ca20f[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x74')]['rawAttributes']);_0x5ca20f[_0xfbd6('0x40')]=_['keys'](_0x34dc1b[_0xfbd6('0x40')]);_0x5ca20f[_0xfbd6('0x42')]=_['intersection'](_0x5ca20f['model'],_0x5ca20f[_0xfbd6('0x40')]);_0x38cfd6['attributes']=_[_0xfbd6('0x43')](_0x5ca20f[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x34dc1b['query'][_0xfbd6('0x44')]));_0x38cfd6['attributes']=_0x38cfd6[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x38cfd6[_0xfbd6('0x45')]:_0x5ca20f['model'];_0x38cfd6[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x34dc1b[_0xfbd6('0x40')]['sort']);_0x38cfd6[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x34dc1b[_0xfbd6('0x40')],_0x5ca20f[_0xfbd6('0x42')]));if(_0x34dc1b['query'][_0xfbd6('0x30')]){_0x38cfd6['where']=_[_0xfbd6('0x4b')](_0x38cfd6['where'],{'$or':_[_0xfbd6('0x32')](_0x38cfd6[_0xfbd6('0x45')],function(_0x165707){var _0x337f61={};_0x337f61[_0x165707]={'$like':'%'+_0x34dc1b[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x337f61;})});}_0x38cfd6=_['merge']({},_0x38cfd6,_0x34dc1b[_0xfbd6('0x4c')]);return _0x57958c['getAgents'](_0x38cfd6);}})[_0xfbd6('0x2c')](function(_0x3da7b7){if(_0x3da7b7){_0x78d8e=_0x3da7b7['length'];if(!_0x34dc1b[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x38cfd6[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x34dc1b['query']['limit']);_0x38cfd6[_0xfbd6('0x26')]=qs['offset'](_0x34dc1b[_0xfbd6('0x40')]['offset']);}return _0x57958c[_0xfbd6('0x99')](_0x38cfd6);}})[_0xfbd6('0x2c')](function(_0x30bbf5){if(_0x30bbf5){return _0x30bbf5?{'count':_0x78d8e,'rows':_0x30bbf5}:null;}})[_0xfbd6('0x2c')](respondWithResult(_0x56ab9c,null))['catch'](handleError(_0x56ab9c,null));};exports[_0xfbd6('0x9a')]=function(_0x5c8a22,_0x44e67e,_0x398e21){var _0x43d3c6={};var _0x395860={};var _0x5308bc;var _0x280372;return db['VoiceQueue']['findOne']({'where':{'id':_0x5c8a22[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x44e67e,null))[_0xfbd6('0x2c')](function(_0x45b3b6){if(_0x45b3b6){_0x5308bc=_0x45b3b6;_0x395860[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0x94')]['rawAttributes']);_0x395860[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x5c8a22[_0xfbd6('0x40')]);_0x395860['filters']=_['intersection'](_0x395860[_0xfbd6('0x3f')],_0x395860['query']);_0x43d3c6[_0xfbd6('0x45')]=_[_0xfbd6('0x43')](_0x395860['model'],qs['fields'](_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x43d3c6[_0xfbd6('0x45')]=_0x43d3c6['attributes'][_0xfbd6('0x55')]?_0x43d3c6[_0xfbd6('0x45')]:_0x395860[_0xfbd6('0x3f')];_0x43d3c6['order']=qs[_0xfbd6('0x48')](_0x5c8a22['query'][_0xfbd6('0x48')]);_0x43d3c6[_0xfbd6('0x49')]=qs['filters'](_[_0xfbd6('0x69')](_0x5c8a22[_0xfbd6('0x40')],_0x395860['filters']));if(_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x43d3c6[_0xfbd6('0x49')]=_['merge'](_0x43d3c6['where'],{'$or':_[_0xfbd6('0x32')](_0x43d3c6[_0xfbd6('0x45')],function(_0x167dcc){var _0x43c789={};_0x43c789[_0x167dcc]={'$like':'%'+_0x5c8a22['query']['filter']+'%'};return _0x43c789;})});}_0x43d3c6=_[_0xfbd6('0x4b')]({},_0x43d3c6,_0x5c8a22[_0xfbd6('0x4c')]);return _0x5308bc['getMembers'](_0x43d3c6);}})[_0xfbd6('0x2c')](function(_0x1ec0d1){if(_0x1ec0d1){_0x280372=_0x1ec0d1['length'];if(!_0x5c8a22[_0xfbd6('0x40')]['hasOwnProperty']('nolimit')){_0x43d3c6[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x43d3c6['offset']=qs['offset'](_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x5308bc[_0xfbd6('0x9a')](_0x43d3c6);}})['then'](function(_0x5e6fc2){return _0x5e6fc2?{'count':_0x280372,'rows':_0x5e6fc2}:null;})['then'](respondWithResult(_0x44e67e,null))['catch'](handleError(_0x44e67e,null));};exports[_0xfbd6('0x9b')]=function(_0x5012e6,_0x24b0d6,_0x4057cb){var _0x1ebfe3={};var _0x1cbb69={};var _0x4730d1;var _0x5eebc7;return db['VoiceQueue'][_0xfbd6('0x66')]({'where':{'id':_0x5012e6[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x24b0d6,null))[_0xfbd6('0x2c')](function(_0x5a899a){if(_0x5a899a){_0x4730d1=_0x5a899a;_0x1cbb69[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db['CmList'][_0xfbd6('0x54')]);_0x1cbb69[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x5012e6[_0xfbd6('0x40')]);_0x1cbb69[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x1cbb69['model'],_0x1cbb69[_0xfbd6('0x40')]);_0x1ebfe3['attributes']=_['intersection'](_0x1cbb69[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x5012e6['query']['fields']));_0x1ebfe3[_0xfbd6('0x45')]=_0x1ebfe3['attributes'][_0xfbd6('0x55')]?_0x1ebfe3['attributes']:_0x1cbb69['model'];_0x1ebfe3[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x5012e6['query'][_0xfbd6('0x48')]);_0x1ebfe3[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x5012e6['query'],_0x1cbb69[_0xfbd6('0x42')]));if(_0x5012e6['query'][_0xfbd6('0x30')]){_0x1ebfe3['where']=_['merge'](_0x1ebfe3['where'],{'$or':_[_0xfbd6('0x32')](_0x1ebfe3[_0xfbd6('0x45')],function(_0x2448ce){var _0x5a059a={};_0x5a059a[_0x2448ce]={'$like':'%'+_0x5012e6[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x5a059a;})});}_0x1ebfe3=_['merge']({},_0x1ebfe3,_0x5012e6[_0xfbd6('0x4c')]);return _0x4730d1[_0xfbd6('0x9b')](_0x1ebfe3);}})[_0xfbd6('0x2c')](function(_0x5622d6){if(_0x5622d6){_0x5eebc7=_0x5622d6[_0xfbd6('0x55')];if(!_0x5012e6[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x1ebfe3[_0xfbd6('0x27')]=qs['limit'](_0x5012e6[_0xfbd6('0x40')]['limit']);_0x1ebfe3[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0x5012e6[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x4730d1['getLists'](_0x1ebfe3);}})[_0xfbd6('0x2c')](function(_0x18269c){if(_0x18269c){return _0x18269c?{'count':_0x5eebc7,'rows':_0x18269c}:null;}})['then'](respondWithResult(_0x24b0d6,null))['catch'](handleError(_0x24b0d6,null));};exports[_0xfbd6('0x9c')]=function(_0x57a868,_0x2127f7,_0x2f6aa9){var _0x14fb01,_0xb23d34;return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x57a868['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x2127f7,null))[_0xfbd6('0x2c')](function(_0x54957c){if(_0x54957c){_0xb23d34=_0x54957c;return _0x54957c[_0xfbd6('0x9c')](_0x57a868['body']['ids'],_[_0xfbd6('0x61')](_0x57a868[_0xfbd6('0x57')],[_0xfbd6('0x85'),'id'])||{});}return null;})[_0xfbd6('0x9d')](function(_0x432a80){var _0x5d54d3;_0x14fb01=_0x432a80||[];var _0x35be07=[];if(_0x432a80){for(var _0x523b05=0x0;_0x523b05<_0x432a80[_0xfbd6('0x55')];_0x523b05+=0x1){var _0x25bd0c=_0x432a80[_0x523b05]['get']({'plain':!![]});_0xb23d34[_0xfbd6('0x9e')]=_0x57a868[_0xfbd6('0x57')][_0xfbd6('0x9e')]?_0x57a868[_0xfbd6('0x57')]['dialCheckDuplicateType']:_0xb23d34['dialCheckDuplicateType'];switch(_0xb23d34[_0xfbd6('0x9e')]){case _0xfbd6('0x9f'):_0x5d54d3=squel[_0xfbd6('0xa0')]()['into']('cm_hopper')[_0xfbd6('0xa1')]([_0xfbd6('0xa2'),_0xfbd6('0xa3'),_0xfbd6('0xa4'),'ListId','VoiceQueueId',_0xfbd6('0x62'),_0xfbd6('0xa5')],squel[_0xfbd6('0xa6')]()[_0xfbd6('0x86')](_0xfbd6('0xa2'),'phone')[_0xfbd6('0x86')](_0xfbd6('0xa7'),'scheduledAt')[_0xfbd6('0x86')]('id','ContactId')[_0xfbd6('0x86')](_0x25bd0c['CmListId'][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))['field'](_0x57a868['params']['id'][_0xfbd6('0x8d')](),_0xfbd6('0x6a'))[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0x62'))[_0xfbd6('0x86')]('NOW()','updatedAt')[_0xfbd6('0x88')]('cm_contacts')['where'](_0xfbd6('0xa9'))[_0xfbd6('0x49')]('ListId\x20=\x20?',_0x25bd0c[_0xfbd6('0xaa')][_0xfbd6('0x8d')]())[_0xfbd6('0x49')](_0xfbd6('0xab'))[_0xfbd6('0x49')](_0xfbd6('0xac'),squel[_0xfbd6('0xa6')]()[_0xfbd6('0x86')](_0xfbd6('0xad'))[_0xfbd6('0x88')](_0xfbd6('0xae'))['where'](_0xfbd6('0xaf'),_0x57a868['params']['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xfbd6('0x86')]('COALESCE(phone,\x27\x27)')[_0xfbd6('0x88')](_0xfbd6('0xb0'))['where'](_0xfbd6('0xaf'),_0x57a868[_0xfbd6('0x53')]['id']['toString']())))[_0xfbd6('0x8d')]();break;case _0xfbd6('0xb1'):_0x5d54d3=squel[_0xfbd6('0xa0')]()[_0xfbd6('0xb2')](_0xfbd6('0xb0'))['fromQuery']([_0xfbd6('0xa2'),'scheduledAt',_0xfbd6('0xa4'),_0xfbd6('0xa8'),'VoiceQueueId',_0xfbd6('0x62'),_0xfbd6('0xa5')],squel['select']()[_0xfbd6('0x86')]('phone',_0xfbd6('0xa2'))[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0xa3'))[_0xfbd6('0x86')]('id',_0xfbd6('0xa4'))[_0xfbd6('0x86')](_0x25bd0c[_0xfbd6('0xaa')][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))[_0xfbd6('0x86')](_0x57a868[_0xfbd6('0x53')]['id'][_0xfbd6('0x8d')](),'VoiceQueueId')[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0x62'))[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0xa5'))[_0xfbd6('0x88')](_0xfbd6('0xb3'))[_0xfbd6('0x49')]('deletedAt\x20IS\x20NULL')[_0xfbd6('0x49')]('ListId\x20=\x20?',_0x25bd0c[_0xfbd6('0xaa')][_0xfbd6('0x8d')]())[_0xfbd6('0x49')](_0xfbd6('0xab'))[_0xfbd6('0x49')](_0xfbd6('0xac'),squel[_0xfbd6('0xa6')]()[_0xfbd6('0x86')]('COALESCE(phone,\x27\x27)')[_0xfbd6('0x88')](_0xfbd6('0xb0'))['where']('VoiceQueueId\x20=\x20?',_0x57a868[_0xfbd6('0x53')]['id'][_0xfbd6('0x8d')]())))[_0xfbd6('0x8d')]();break;default:_0x5d54d3=squel[_0xfbd6('0xa0')]()[_0xfbd6('0xb2')](_0xfbd6('0xb0'))[_0xfbd6('0xa1')]([_0xfbd6('0xa2'),_0xfbd6('0xa3'),'ContactId','ListId','VoiceQueueId',_0xfbd6('0x62'),_0xfbd6('0xa5')],squel['select']()[_0xfbd6('0x86')]('phone',_0xfbd6('0xa2'))['field'](_0xfbd6('0xa7'),_0xfbd6('0xa3'))[_0xfbd6('0x86')]('id','ContactId')[_0xfbd6('0x86')](_0x25bd0c['CmListId'][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))[_0xfbd6('0x86')](_0x57a868[_0xfbd6('0x53')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xfbd6('0x62'))[_0xfbd6('0x86')]('NOW()','updatedAt')[_0xfbd6('0x88')](_0xfbd6('0xb3'))[_0xfbd6('0x49')](_0xfbd6('0xa9'))[_0xfbd6('0x49')](_0xfbd6('0xb4'),_0x25bd0c[_0xfbd6('0xaa')]['toString']())[_0xfbd6('0x49')](_0xfbd6('0xab')))[_0xfbd6('0x8d')]();}_0x35be07[_0xfbd6('0x8c')](db[_0xfbd6('0x7c')][_0xfbd6('0x40')](_0x5d54d3));}return BPromise[_0xfbd6('0x91')](_0x35be07);}})[_0xfbd6('0x2c')](function(){return _0x14fb01;})[_0xfbd6('0x2c')](respondWithResult(_0x2127f7,null))[_0xfbd6('0x51')](handleError(_0x2127f7,null));};exports[_0xfbd6('0xb5')]=function(_0x5f211d,_0x195ff2,_0x1cc911){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x5f211d[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x195ff2,null))[_0xfbd6('0x2c')](function(_0x360be9){if(_0x360be9){return _0x360be9[_0xfbd6('0xb5')](_0x5f211d[_0xfbd6('0x40')][_0xfbd6('0x85')]);}})[_0xfbd6('0x2c')](function(_0x4d4160){if(_0x4d4160){return db[_0xfbd6('0x67')][_0xfbd6('0x64')]({'where':{'ListId':_0x5f211d[_0xfbd6('0x40')]['ids'],'VoiceQueueId':_0x5f211d[_0xfbd6('0x53')]['id']}})['then'](function(){return _0x4d4160;});}})[_0xfbd6('0x2c')](respondWithStatusCode(_0x195ff2,null))[_0xfbd6('0x51')](handleError(_0x195ff2,null));};exports[_0xfbd6('0xb6')]=function(_0x1f83c7,_0x252658,_0x1f36fc){var _0x173f15={};var _0x2da8f6={};var _0x967ff8;var _0x4c0700;return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x1f83c7[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x252658,null))['then'](function(_0x3bbffa){if(_0x3bbffa){_0x967ff8=_0x3bbffa;_0x2da8f6[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0xb7')][_0xfbd6('0x54')]);_0x2da8f6[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x1f83c7[_0xfbd6('0x40')]);_0x2da8f6['filters']=_[_0xfbd6('0x43')](_0x2da8f6[_0xfbd6('0x3f')],_0x2da8f6['query']);_0x173f15['attributes']=_[_0xfbd6('0x43')](_0x2da8f6[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x1f83c7[_0xfbd6('0x40')]['fields']));_0x173f15[_0xfbd6('0x45')]=_0x173f15[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x173f15[_0xfbd6('0x45')]:_0x2da8f6['model'];_0x173f15[_0xfbd6('0x68')]=qs['sort'](_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x173f15['where']=qs['filters'](_[_0xfbd6('0x69')](_0x1f83c7[_0xfbd6('0x40')],_0x2da8f6[_0xfbd6('0x42')]));if(_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x173f15[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x173f15[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x173f15['attributes'],function(_0x305605){var _0x5bb02e={};_0x5bb02e[_0x305605]={'$like':'%'+_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x5bb02e;})});}_0x173f15=_['merge']({},_0x173f15,_0x1f83c7['options']);return _0x967ff8['getBlackLists'](_0x173f15);}})[_0xfbd6('0x2c')](function(_0x160a81){if(_0x160a81){_0x4c0700=_0x160a81[_0xfbd6('0x55')];if(!_0x1f83c7[_0xfbd6('0x40')]['hasOwnProperty'](_0xfbd6('0x47'))){_0x173f15[_0xfbd6('0x27')]=qs['limit'](_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x173f15[_0xfbd6('0x26')]=qs['offset'](_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x967ff8[_0xfbd6('0xb6')](_0x173f15);}})['then'](function(_0x306c7c){if(_0x306c7c){return _0x306c7c?{'count':_0x4c0700,'rows':_0x306c7c}:null;}})[_0xfbd6('0x2c')](respondWithResult(_0x252658,null))[_0xfbd6('0x51')](handleError(_0x252658,null));};exports['addBlackLists']=function(_0x3b0258,_0x28d0a6,_0x1abc3b){var _0x410a25,_0xfad77b;return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x3b0258[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x28d0a6,null))[_0xfbd6('0x2c')](function(_0x1aa5ec){if(_0x1aa5ec){_0xfad77b=_0x1aa5ec;return _0x1aa5ec['addBlackLists'](_0x3b0258['body'][_0xfbd6('0x85')],_[_0xfbd6('0x61')](_0x3b0258['body'],[_0xfbd6('0x85'),'id'])||{});}return null;})[_0xfbd6('0x9d')](function(_0x3731d4){var _0x49318d;_0x410a25=_0x3731d4||[];var _0x1ed20c=[];if(_0x3731d4){for(var _0x1d369a=0x0;_0x1d369a<_0x3731d4[_0xfbd6('0x55')];_0x1d369a+=0x1){var _0x33dd94=_0x3731d4[_0x1d369a][_0xfbd6('0x59')]({'plain':!![]});_0x49318d=squel['insert']()[_0xfbd6('0xb2')]('cm_hopper_black')[_0xfbd6('0xa1')](['phone',_0xfbd6('0xa4'),'ListId',_0xfbd6('0x6a'),'createdAt',_0xfbd6('0xa5')],squel['select']()[_0xfbd6('0x86')]('phone',_0xfbd6('0xa2'))[_0xfbd6('0x86')]('id',_0xfbd6('0xa4'))[_0xfbd6('0x86')](_0x33dd94['CmListId'][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))[_0xfbd6('0x86')](_0x3b0258['params']['id'][_0xfbd6('0x8d')](),'VoiceQueueId')['field']('NOW()',_0xfbd6('0x62'))['field']('NOW()',_0xfbd6('0xa5'))['from']('cm_contacts')[_0xfbd6('0x49')](_0xfbd6('0xa9'))[_0xfbd6('0x49')](_0xfbd6('0xb4'),_0x33dd94[_0xfbd6('0xaa')][_0xfbd6('0x8d')]())[_0xfbd6('0x49')](_0xfbd6('0xab')))['toString']();_0x1ed20c[_0xfbd6('0x8c')](db[_0xfbd6('0x7c')][_0xfbd6('0x40')](_0x49318d));}return BPromise[_0xfbd6('0x91')](_0x1ed20c);}})['then'](function(){return _0x410a25;})[_0xfbd6('0x2c')](respondWithResult(_0x28d0a6,null))['catch'](handleError(_0x28d0a6,null));};exports[_0xfbd6('0xb8')]=function(_0x29378b,_0x4cf8f8,_0x282efd){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x29378b['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x4cf8f8,null))[_0xfbd6('0x2c')](function(_0x56ebb1){if(_0x56ebb1){return _0x56ebb1['removeBlackLists'](_0x29378b[_0xfbd6('0x40')]['ids']);}})[_0xfbd6('0x2c')](function(_0x205072){if(_0x205072){return db[_0xfbd6('0x70')][_0xfbd6('0x64')]({'where':{'ListId':_0x29378b[_0xfbd6('0x40')]['ids'],'VoiceQueueId':_0x29378b[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](function(){return _0x205072;});}})['then'](respondWithStatusCode(_0x4cf8f8,null))['catch'](handleError(_0x4cf8f8,null));}; \ No newline at end of file +var _0x9a8e=['intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','pick','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','create','body','role','user','QueueCampaigns','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','getHoppers','sort','CmHopper','getHopperHistories','findOne','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','User','Agents','voicePause','flatMap','forEach','penalty','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','interface','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','all','union','transaction','isEmpty','removeAgents','emit','addAgents','spread','userVoiceQueue:save','online','format','SIP/%s','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','fromQuery','scheduledAt','ListId','phone','NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','cm_hopper','onlyIfOpen','into','removeLists','addBlackLists','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./voiceQueue.socket','status','end','json','count','offset','limit','set','Content-Range','reject','update','destroy','then','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','sendStatus','error','stack','name','send','index','VoiceQueue','fieldName','key','query','keys','filters'];(function(_0x168af2,_0x6a246){var _0x5dba52=function(_0xb447af){while(--_0xb447af){_0x168af2['push'](_0x168af2['shift']());}};_0x5dba52(++_0x6a246);}(_0x9a8e,0x12e));var _0xe9a8=function(_0x300eed,_0x5a18e5){_0x300eed=_0x300eed-0x0;var _0x5972f1=_0x9a8e[_0x300eed];return _0x5972f1;};'use strict';var pdf=require(_0xe9a8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe9a8('0x1'));var zipdir=require(_0xe9a8('0x2'));var jsonpatch=require(_0xe9a8('0x3'));var rp=require(_0xe9a8('0x4'));var moment=require(_0xe9a8('0x5'));var BPromise=require(_0xe9a8('0x6'));var Mustache=require('mustache');var util=require(_0xe9a8('0x7'));var path=require('path');var sox=require(_0xe9a8('0x8'));var csv=require(_0xe9a8('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xe9a8('0xa'));var crypto=require(_0xe9a8('0xb'));var jsforce=require(_0xe9a8('0xc'));var deskjs=require(_0xe9a8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe9a8('0xe'));var Redis=require(_0xe9a8('0xf'));var authService=require(_0xe9a8('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe9a8('0x11'));var logger=require(_0xe9a8('0x12'))(_0xe9a8('0x13'));var utils=require(_0xe9a8('0x14'));var config=require('../../config/environment');var db=require(_0xe9a8('0x15'))['db'];config['redis']=_['defaults'](config[_0xe9a8('0x16')],{'host':_0xe9a8('0x17'),'port':0x18eb});var socket=require(_0xe9a8('0x18'))(new Redis(config[_0xe9a8('0x16')]));require(_0xe9a8('0x19'))['register'](socket);function respondWithStatusCode(_0x562319,_0x58a128){_0x58a128=_0x58a128||0xcc;return function(_0xa65ed5){if(_0xa65ed5){return _0x562319['sendStatus'](_0x58a128);}return _0x562319[_0xe9a8('0x1a')](_0x58a128)[_0xe9a8('0x1b')]();};}function respondWithResult(_0x4ff828,_0x4d522c){_0x4d522c=_0x4d522c||0xc8;return function(_0x5185a1){if(_0x5185a1){return _0x4ff828['status'](_0x4d522c)[_0xe9a8('0x1c')](_0x5185a1);}};}function respondWithFilteredResult(_0x3b6229,_0x326985){return function(_0x4401bb){if(_0x4401bb){var _0xe4ad1e=_0x4401bb[_0xe9a8('0x1d')],_0x428e9a=_0x326985[_0xe9a8('0x1e')],_0x27e13b=_0x326985[_0xe9a8('0x1e')]+_0x326985[_0xe9a8('0x1f')],_0x560740;if(_0x27e13b>=_0xe4ad1e){_0x27e13b=_0xe4ad1e;_0x560740=0xc8;}else{_0x560740=0xce;}_0x3b6229['status'](_0x560740);return _0x3b6229[_0xe9a8('0x20')](_0xe9a8('0x21'),_0x428e9a+'-'+_0x27e13b+'/'+_0xe4ad1e)[_0xe9a8('0x1c')](_0x4401bb);}return null;};}function patchUpdates(_0x5f4e4a){return function(_0x303067){try{jsonpatch['apply'](_0x303067,_0x5f4e4a,!![]);}catch(_0x25bacc){return BPromise[_0xe9a8('0x22')](_0x25bacc);}return _0x303067['save']();};}function saveUpdates(_0x503e22,_0x2391df){return function(_0x4f28d6){if(_0x4f28d6){return _0x4f28d6[_0xe9a8('0x23')](_0x503e22)['then'](function(_0x12425a){return _0x12425a;});}return null;};}function removeEntity(_0x294144,_0xd66e70){return function(_0x57b434){if(_0x57b434){return _0x57b434[_0xe9a8('0x24')]()[_0xe9a8('0x25')](function(){var _0x1f0e72=_0x57b434[_0xe9a8('0x26')]({'plain':!![]});var _0x281e3a=[{'name':_0xe9a8('0x27'),'value':_0xe9a8('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xe9a8('0x29'),'ignore':![]}];var _0xaccb24=_(_0x281e3a)[_0xe9a8('0x2a')](_0xe9a8('0x2b'))[_0xe9a8('0x2c')](_0xe9a8('0x2d'))[_0xe9a8('0x2d')]();if(_[_0xe9a8('0x2e')](_0xaccb24,_0x1f0e72[_0xe9a8('0x2f')])){return;}var _0x16357a=_[_0xe9a8('0x30')](_0x281e3a,['value',_0x1f0e72[_0xe9a8('0x2f')]])['name'];return db[_0xe9a8('0x31')][_0xe9a8('0x24')]({'where':{'type':_0x16357a,'resourceId':_0x1f0e72['id']}})[_0xe9a8('0x25')](function(){return _0x57b434;});})[_0xe9a8('0x25')](function(){_0x294144[_0xe9a8('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22aa61,_0x5778ff){return function(_0x76923c){if(!_0x76923c){_0x22aa61[_0xe9a8('0x32')](0x194);}return _0x76923c;};}function handleError(_0x2cf7e9,_0xaf7731){_0xaf7731=_0xaf7731||0x1f4;return function(_0x389a0b){logger[_0xe9a8('0x33')](_0x389a0b[_0xe9a8('0x34')]);if(_0x389a0b[_0xe9a8('0x35')]){delete _0x389a0b[_0xe9a8('0x35')];}_0x2cf7e9[_0xe9a8('0x1a')](_0xaf7731)[_0xe9a8('0x36')](_0x389a0b);};}exports[_0xe9a8('0x37')]=function(_0x18bd17,_0x4c40b1){var _0x39b69c={},_0x20ac76={},_0x838c95={'count':0x0,'rows':[]};var _0x3db959=_[_0xe9a8('0x2c')](db[_0xe9a8('0x38')]['rawAttributes'],function(_0xb04ac4){return{'name':_0xb04ac4[_0xe9a8('0x39')],'type':_0xb04ac4['type'][_0xe9a8('0x3a')]};});_0x20ac76['model']=_[_0xe9a8('0x2c')](_0x3db959,_0xe9a8('0x35'));_0x20ac76[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0x18bd17['query']);_0x20ac76[_0xe9a8('0x3d')]=_[_0xe9a8('0x3e')](_0x20ac76[_0xe9a8('0x3f')],_0x20ac76[_0xe9a8('0x3b')]);_0x39b69c['attributes']=_['intersection'](_0x20ac76[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x18bd17[_0xe9a8('0x3b')][_0xe9a8('0x40')]));_0x39b69c[_0xe9a8('0x41')]=_0x39b69c[_0xe9a8('0x41')][_0xe9a8('0x42')]?_0x39b69c[_0xe9a8('0x41')]:_0x20ac76['model'];if(!_0x18bd17['query'][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0x39b69c['limit']=qs[_0xe9a8('0x1f')](_0x18bd17[_0xe9a8('0x3b')][_0xe9a8('0x1f')]);_0x39b69c['offset']=qs['offset'](_0x18bd17[_0xe9a8('0x3b')]['offset']);}_0x39b69c[_0xe9a8('0x45')]=qs['sort'](_0x18bd17['query']['sort']);_0x39b69c['where']=qs[_0xe9a8('0x3d')](_[_0xe9a8('0x46')](_0x18bd17[_0xe9a8('0x3b')],_0x20ac76['filters']));if(_0x18bd17[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0x39b69c[_0xe9a8('0x47')]=_['merge'](_0x39b69c[_0xe9a8('0x47')],{'$or':_[_0xe9a8('0x2c')](_0x3db959,function(_0x2b54ad){if(_0x2b54ad['type']!==_0xe9a8('0x48')){var _0x8aebc4={};_0x8aebc4[_0x2b54ad[_0xe9a8('0x35')]]={'$like':'%'+_0x18bd17[_0xe9a8('0x3b')][_0xe9a8('0x2a')]+'%'};return _0x8aebc4;}})});}_0x39b69c=_[_0xe9a8('0x49')]({},_0x39b69c,_0x18bd17[_0xe9a8('0x4a')]);var _0x1ab768={'where':_0x39b69c[_0xe9a8('0x47')]};return db[_0xe9a8('0x38')][_0xe9a8('0x1d')](_0x1ab768)[_0xe9a8('0x25')](function(_0x3a4af5){_0x838c95[_0xe9a8('0x1d')]=_0x3a4af5;if(_0x18bd17[_0xe9a8('0x3b')][_0xe9a8('0x4b')]){_0x39b69c[_0xe9a8('0x4c')]=[{'all':!![]}];}return db['VoiceQueue'][_0xe9a8('0x4d')](_0x39b69c);})[_0xe9a8('0x25')](function(_0x3eec20){_0x838c95[_0xe9a8('0x4e')]=_0x3eec20;return _0x838c95;})[_0xe9a8('0x25')](respondWithFilteredResult(_0x4c40b1,_0x39b69c))['catch'](handleError(_0x4c40b1,null));};exports[_0xe9a8('0x4f')]=function(_0x439d85,_0x40dc74){var _0x4a8da1={'raw':![],'where':{'id':_0x439d85['params']['id']}},_0x49675b={};_0x49675b[_0xe9a8('0x3f')]=_['keys'](db[_0xe9a8('0x38')][_0xe9a8('0x50')]);_0x49675b[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0x439d85['query']);_0x49675b['filters']=_[_0xe9a8('0x3e')](_0x49675b[_0xe9a8('0x3f')],_0x49675b['query']);_0x4a8da1['attributes']=_[_0xe9a8('0x3e')](_0x49675b[_0xe9a8('0x3f')],qs['fields'](_0x439d85[_0xe9a8('0x3b')]['fields']));_0x4a8da1[_0xe9a8('0x41')]=_0x4a8da1[_0xe9a8('0x41')]['length']?_0x4a8da1['attributes']:_0x49675b[_0xe9a8('0x3f')];if(_0x439d85['query'][_0xe9a8('0x4b')]){_0x4a8da1[_0xe9a8('0x4c')]=[{'all':!![]}];}_0x4a8da1=_['merge']({},_0x4a8da1,_0x439d85[_0xe9a8('0x4a')]);return db[_0xe9a8('0x38')]['find'](_0x4a8da1)['then'](handleEntityNotFound(_0x40dc74,null))['then'](respondWithResult(_0x40dc74,null))['catch'](handleError(_0x40dc74,null));};exports['create']=function(_0x49c90c,_0x5c18cf){return db[_0xe9a8('0x38')][_0xe9a8('0x51')](_0x49c90c[_0xe9a8('0x52')],{})[_0xe9a8('0x25')](function(_0x56628f){var _0x425def=_0x49c90c['user'][_0xe9a8('0x26')]({'plain':!![]});if(!_0x425def)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x425def[_0xe9a8('0x53')]===_0xe9a8('0x54')){var _0x49bbb3=_0x56628f[_0xe9a8('0x26')]({'plain':!![]});var _0x508edf=[{'name':_0xe9a8('0x27'),'value':_0xe9a8('0x28')},{'name':_0xe9a8('0x55'),'value':_0xe9a8('0x29')}];var _0x49f4c2=_[_0xe9a8('0x30')](_0x508edf,[_0xe9a8('0x2d'),_0x49bbb3['type']])[_0xe9a8('0x35')];return db[_0xe9a8('0x56')][_0xe9a8('0x30')]({'where':{'name':_0x49f4c2,'userProfileId':_0x425def[_0xe9a8('0x57')]},'raw':!![]})['then'](function(_0x40e8a5){if(_0x40e8a5&&_0x40e8a5[_0xe9a8('0x58')]===0x0){return db[_0xe9a8('0x31')][_0xe9a8('0x51')]({'name':_0x49bbb3[_0xe9a8('0x35')],'resourceId':_0x49bbb3['id'],'type':_0x40e8a5[_0xe9a8('0x35')],'sectionId':_0x40e8a5['id']},{})[_0xe9a8('0x25')](function(){return _0x56628f;});}else{return _0x56628f;}})[_0xe9a8('0x59')](function(_0x3782c6){logger[_0xe9a8('0x33')](_0xe9a8('0x5a'),_0x3782c6);throw _0x3782c6;});}return _0x56628f;})[_0xe9a8('0x25')](respondWithResult(_0x5c18cf,0xc9))[_0xe9a8('0x59')](handleError(_0x5c18cf,null));};exports['clone']=function(_0x3acc06,_0x4d0c0f){var _0x532ca0={'where':{'id':_0x3acc06[_0xe9a8('0x5b')]['id']}},_0x4ab636={};_0x4ab636['model']=_[_0xe9a8('0x3c')](db[_0xe9a8('0x38')]['rawAttributes']);_0x532ca0[_0xe9a8('0x41')]=_['intersection'](_0x4ab636[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x3acc06['query'][_0xe9a8('0x40')]));_0x532ca0[_0xe9a8('0x41')]=_0x532ca0['attributes'][_0xe9a8('0x42')]?_0x532ca0['attributes']:_0x4ab636[_0xe9a8('0x3f')];if(_0x3acc06[_0xe9a8('0x3b')][_0xe9a8('0x4b')]){_0x532ca0[_0xe9a8('0x4c')]=[{'all':!![]}];}_0x532ca0=_[_0xe9a8('0x49')]({},_0x532ca0,_0x3acc06[_0xe9a8('0x4a')]);return db['VoiceQueue'][_0xe9a8('0x30')](_0x532ca0)[_0xe9a8('0x25')](handleEntityNotFound(_0x4d0c0f,null))[_0xe9a8('0x25')](function(_0x407554){if(_0x407554){var _0x5da5ca=_0x407554['get']({'plain':!![]});_0x5da5ca=qs[_0xe9a8('0x5c')](_0x5da5ca,['id',_0xe9a8('0x5d'),_0xe9a8('0x5e')]);_0x3acc06[_0xe9a8('0x52')]=_['omit'](_0x3acc06[_0xe9a8('0x52')],['id','createdAt','updatedAt']);return db[_0xe9a8('0x38')][_0xe9a8('0x51')](_[_0xe9a8('0x49')](_0x5da5ca,_0x3acc06['body']),{'include':_0x3acc06[_0xe9a8('0x3b')][_0xe9a8('0x4b')]?[{'all':!![]}]:undefined})['then'](function(_0x1ce15b){var _0x3fa50a=_0x3acc06[_0xe9a8('0x54')][_0xe9a8('0x26')]({'plain':!![]});if(!_0x3fa50a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fa50a[_0xe9a8('0x53')]==='user'){var _0x2408c0=_0x1ce15b[_0xe9a8('0x26')]({'plain':!![]});var _0x2ef714=[{'name':_0xe9a8('0x27'),'value':_0xe9a8('0x28')},{'name':'QueueCampaigns','value':_0xe9a8('0x29')}];var _0x2f2c9e=_[_0xe9a8('0x30')](_0x2ef714,[_0xe9a8('0x2d'),_0x2408c0[_0xe9a8('0x2f')]])[_0xe9a8('0x35')];return db[_0xe9a8('0x56')][_0xe9a8('0x30')]({'where':{'name':_0x2f2c9e,'userProfileId':_0x3fa50a[_0xe9a8('0x57')]},'raw':!![]})['then'](function(_0x5815e5){if(_0x5815e5&&_0x5815e5['autoAssociation']===0x0){return db['UserProfileResource'][_0xe9a8('0x51')]({'name':_0x2408c0[_0xe9a8('0x35')],'resourceId':_0x2408c0['id'],'type':_0x5815e5[_0xe9a8('0x35')],'sectionId':_0x5815e5['id']},{})[_0xe9a8('0x25')](function(){return _0x1ce15b;});}else{return _0x1ce15b;}})[_0xe9a8('0x59')](function(_0x43a3b3){logger['error'](_0xe9a8('0x5a'),_0x43a3b3);throw _0x43a3b3;});}return _0x1ce15b;});}})[_0xe9a8('0x25')](respondWithResult(_0x4d0c0f,0xc9))[_0xe9a8('0x59')](handleError(_0x4d0c0f,null));};exports[_0xe9a8('0x23')]=function(_0x291866,_0x4581da){if(_0x291866[_0xe9a8('0x52')]['id']){delete _0x291866['body']['id'];}return db[_0xe9a8('0x38')][_0xe9a8('0x30')]({'where':{'id':_0x291866[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x4581da,null))[_0xe9a8('0x25')](saveUpdates(_0x291866['body'],null))[_0xe9a8('0x25')](respondWithResult(_0x4581da,null))[_0xe9a8('0x59')](handleError(_0x4581da,null));};exports[_0xe9a8('0x24')]=function(_0x1f462a,_0xd52740){return db[_0xe9a8('0x38')][_0xe9a8('0x30')]({'where':{'id':_0x1f462a[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0xd52740,null))[_0xe9a8('0x25')](removeEntity(_0xd52740,null))[_0xe9a8('0x59')](handleError(_0xd52740,null));};exports[_0xe9a8('0x5f')]=function(_0x19db34,_0x2dc2f5,_0x30e00b){var _0x3a359e={'raw':![],'where':{}};var _0x2cd02a={};var _0x15d56e={'count':0x0,'rows':[]};return db[_0xe9a8('0x38')]['findOne']({'where':{'id':_0x19db34[_0xe9a8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2dc2f5,null))[_0xe9a8('0x25')](function(_0x44a21a){if(_0x44a21a){_0x2cd02a['model']=_['keys'](db['CmHopper'][_0xe9a8('0x50')]);_0x2cd02a[_0xe9a8('0x3b')]=_['keys'](_0x19db34[_0xe9a8('0x3b')]);_0x2cd02a['filters']=_[_0xe9a8('0x3e')](_0x2cd02a[_0xe9a8('0x3f')],_0x2cd02a[_0xe9a8('0x3b')]);_0x3a359e[_0xe9a8('0x41')]=_[_0xe9a8('0x3e')](_0x2cd02a['model'],qs[_0xe9a8('0x40')](_0x19db34[_0xe9a8('0x3b')][_0xe9a8('0x40')]));_0x3a359e['attributes']=_0x3a359e[_0xe9a8('0x41')][_0xe9a8('0x42')]?_0x3a359e[_0xe9a8('0x41')]:_0x2cd02a[_0xe9a8('0x3f')];if(!_0x19db34['query'][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0x3a359e['limit']=qs['limit'](_0x19db34[_0xe9a8('0x3b')][_0xe9a8('0x1f')]);_0x3a359e['offset']=qs[_0xe9a8('0x1e')](_0x19db34[_0xe9a8('0x3b')][_0xe9a8('0x1e')]);}_0x3a359e[_0xe9a8('0x45')]=qs['sort'](_0x19db34[_0xe9a8('0x3b')][_0xe9a8('0x60')]);_0x3a359e['where']=qs[_0xe9a8('0x3d')](_[_0xe9a8('0x46')](_0x19db34['query'],_0x2cd02a['filters']));_0x3a359e['where']['VoiceQueueId']=_0x44a21a['id'];if(_0x19db34[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0x3a359e[_0xe9a8('0x47')]=_['merge'](_0x3a359e['where'],{'$or':_[_0xe9a8('0x2c')](_0x3a359e[_0xe9a8('0x41')],function(_0x17aa63){var _0x26e290={};_0x26e290[_0x17aa63]={'$like':'%'+_0x19db34['query'][_0xe9a8('0x2a')]+'%'};return _0x26e290;})});}_0x3a359e=_[_0xe9a8('0x49')]({},_0x3a359e,_0x19db34[_0xe9a8('0x4a')]);return db[_0xe9a8('0x61')][_0xe9a8('0x1d')]({'where':_0x3a359e[_0xe9a8('0x47')]})[_0xe9a8('0x25')](function(_0x5399b3){_0x15d56e[_0xe9a8('0x1d')]=_0x5399b3;if(_0x19db34[_0xe9a8('0x3b')][_0xe9a8('0x4b')]){_0x3a359e['include']=[{'all':!![]}];}return db[_0xe9a8('0x61')][_0xe9a8('0x4d')](_0x3a359e);})[_0xe9a8('0x25')](function(_0x330c5b){_0x15d56e['rows']=_0x330c5b;return _0x15d56e;});}})[_0xe9a8('0x25')](respondWithFilteredResult(_0x2dc2f5,_0x3a359e))[_0xe9a8('0x59')](handleError(_0x2dc2f5,null));};exports[_0xe9a8('0x62')]=function(_0x101220,_0x1fa582,_0x460484){var _0x59d09c={'raw':!![],'where':{}};var _0x3e558b={};var _0x26da03={'count':0x0,'rows':[]};return db[_0xe9a8('0x38')][_0xe9a8('0x63')]({'where':{'id':_0x101220['params']['id']}})['then'](handleEntityNotFound(_0x1fa582,null))[_0xe9a8('0x25')](function(_0x1e4ad1){if(_0x1e4ad1){_0x3e558b[_0xe9a8('0x3f')]=_['keys'](db[_0xe9a8('0x64')][_0xe9a8('0x50')]);_0x3e558b[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0x101220[_0xe9a8('0x3b')]);_0x3e558b['filters']=_['intersection'](_0x3e558b[_0xe9a8('0x3f')],_0x3e558b[_0xe9a8('0x3b')]);_0x59d09c[_0xe9a8('0x41')]=_[_0xe9a8('0x3e')](_0x3e558b[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x101220[_0xe9a8('0x3b')][_0xe9a8('0x40')]));_0x59d09c['attributes']=_0x59d09c[_0xe9a8('0x41')]['length']?_0x59d09c[_0xe9a8('0x41')]:_0x3e558b[_0xe9a8('0x3f')];if(!_0x101220[_0xe9a8('0x3b')][_0xe9a8('0x43')]('nolimit')){_0x59d09c['limit']=qs[_0xe9a8('0x1f')](_0x101220[_0xe9a8('0x3b')]['limit']);_0x59d09c[_0xe9a8('0x1e')]=qs['offset'](_0x101220[_0xe9a8('0x3b')][_0xe9a8('0x1e')]);}_0x59d09c[_0xe9a8('0x45')]=qs[_0xe9a8('0x60')](_0x101220['query'][_0xe9a8('0x60')]);_0x59d09c[_0xe9a8('0x47')]=qs[_0xe9a8('0x3d')](_[_0xe9a8('0x46')](_0x101220[_0xe9a8('0x3b')],_0x3e558b['filters']));_0x59d09c[_0xe9a8('0x47')][_0xe9a8('0x65')]=_0x1e4ad1['id'];if(_0x101220[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0x59d09c[_0xe9a8('0x47')]=_[_0xe9a8('0x49')](_0x59d09c[_0xe9a8('0x47')],{'$or':_[_0xe9a8('0x2c')](_0x59d09c[_0xe9a8('0x41')],function(_0x2ad01a){var _0x52ccc4={};_0x52ccc4[_0x2ad01a]={'$like':'%'+_0x101220[_0xe9a8('0x3b')][_0xe9a8('0x2a')]+'%'};return _0x52ccc4;})});}_0x59d09c=_[_0xe9a8('0x49')]({},_0x59d09c,_0x101220[_0xe9a8('0x4a')]);return db[_0xe9a8('0x64')][_0xe9a8('0x1d')]({'where':_0x59d09c[_0xe9a8('0x47')]})[_0xe9a8('0x25')](function(_0x2cfac3){_0x26da03[_0xe9a8('0x1d')]=_0x2cfac3;if(_0x101220[_0xe9a8('0x3b')][_0xe9a8('0x4b')]){_0x59d09c[_0xe9a8('0x4c')]=[{'all':!![]}];}return db[_0xe9a8('0x64')][_0xe9a8('0x4d')](_0x59d09c);})[_0xe9a8('0x25')](function(_0x303f7b){_0x26da03['rows']=_0x303f7b;return _0x26da03;});}})[_0xe9a8('0x25')](respondWithFilteredResult(_0x1fa582,_0x59d09c))[_0xe9a8('0x59')](handleError(_0x1fa582,null));};exports[_0xe9a8('0x66')]=function(_0x1b94ed,_0x2258f3,_0x31ca60){var _0x5a417a={'raw':!![],'where':{}};var _0x454c46={};var _0x1d5ec7={'count':0x0,'rows':[]};return db[_0xe9a8('0x38')][_0xe9a8('0x63')]({'where':{'id':_0x1b94ed['params']['id']}})['then'](handleEntityNotFound(_0x2258f3,null))[_0xe9a8('0x25')](function(_0x1667d4){if(_0x1667d4){_0x454c46['model']=_[_0xe9a8('0x3c')](db[_0xe9a8('0x67')]['rawAttributes']);_0x454c46[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0x1b94ed['query']);_0x454c46['filters']=_[_0xe9a8('0x3e')](_0x454c46[_0xe9a8('0x3f')],_0x454c46['query']);_0x5a417a[_0xe9a8('0x41')]=_[_0xe9a8('0x3e')](_0x454c46['model'],qs[_0xe9a8('0x40')](_0x1b94ed[_0xe9a8('0x3b')]['fields']));_0x5a417a[_0xe9a8('0x41')]=_0x5a417a[_0xe9a8('0x41')][_0xe9a8('0x42')]?_0x5a417a[_0xe9a8('0x41')]:_0x454c46[_0xe9a8('0x3f')];if(!_0x1b94ed['query'][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0x5a417a['limit']=qs['limit'](_0x1b94ed[_0xe9a8('0x3b')][_0xe9a8('0x1f')]);_0x5a417a[_0xe9a8('0x1e')]=qs[_0xe9a8('0x1e')](_0x1b94ed[_0xe9a8('0x3b')]['offset']);}_0x5a417a['order']=qs['sort'](_0x1b94ed[_0xe9a8('0x3b')]['sort']);_0x5a417a[_0xe9a8('0x47')]=qs[_0xe9a8('0x3d')](_[_0xe9a8('0x46')](_0x1b94ed[_0xe9a8('0x3b')],_0x454c46[_0xe9a8('0x3d')]));_0x5a417a[_0xe9a8('0x47')][_0xe9a8('0x65')]=_0x1667d4['id'];if(_0x1b94ed[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0x5a417a[_0xe9a8('0x47')]=_[_0xe9a8('0x49')](_0x5a417a[_0xe9a8('0x47')],{'$or':_['map'](_0x5a417a[_0xe9a8('0x41')],function(_0x4c1548){var _0x198488={};_0x198488[_0x4c1548]={'$like':'%'+_0x1b94ed[_0xe9a8('0x3b')]['filter']+'%'};return _0x198488;})});}_0x5a417a=_[_0xe9a8('0x49')]({},_0x5a417a,_0x1b94ed['options']);return db[_0xe9a8('0x67')][_0xe9a8('0x1d')]({'where':_0x5a417a[_0xe9a8('0x47')]})[_0xe9a8('0x25')](function(_0x37e74d){_0x1d5ec7[_0xe9a8('0x1d')]=_0x37e74d;if(_0x1b94ed[_0xe9a8('0x3b')][_0xe9a8('0x4b')]){_0x5a417a['include']=[{'all':!![]}];}return db[_0xe9a8('0x67')][_0xe9a8('0x4d')](_0x5a417a);})[_0xe9a8('0x25')](function(_0x1ac8f9){_0x1d5ec7[_0xe9a8('0x4e')]=_0x1ac8f9;return _0x1d5ec7;});}})['then'](respondWithFilteredResult(_0x2258f3,_0x5a417a))[_0xe9a8('0x59')](handleError(_0x2258f3,null));};exports[_0xe9a8('0x68')]=function(_0x57ee08,_0x380665,_0x2e1d71){var _0x1a554b={'raw':!![],'where':{}};var _0xd1ff4f={};var _0x50cd39={'count':0x0,'rows':[]};return db[_0xe9a8('0x38')][_0xe9a8('0x63')]({'where':{'id':_0x57ee08[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x380665,null))['then'](function(_0x109185){if(_0x109185){_0xd1ff4f[_0xe9a8('0x3f')]=_[_0xe9a8('0x3c')](db[_0xe9a8('0x69')][_0xe9a8('0x50')]);_0xd1ff4f['query']=_[_0xe9a8('0x3c')](_0x57ee08[_0xe9a8('0x3b')]);_0xd1ff4f['filters']=_[_0xe9a8('0x3e')](_0xd1ff4f[_0xe9a8('0x3f')],_0xd1ff4f[_0xe9a8('0x3b')]);_0x1a554b[_0xe9a8('0x41')]=_['intersection'](_0xd1ff4f[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x57ee08[_0xe9a8('0x3b')]['fields']));_0x1a554b['attributes']=_0x1a554b['attributes']['length']?_0x1a554b['attributes']:_0xd1ff4f[_0xe9a8('0x3f')];if(!_0x57ee08[_0xe9a8('0x3b')][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0x1a554b[_0xe9a8('0x1f')]=qs[_0xe9a8('0x1f')](_0x57ee08[_0xe9a8('0x3b')]['limit']);_0x1a554b[_0xe9a8('0x1e')]=qs[_0xe9a8('0x1e')](_0x57ee08[_0xe9a8('0x3b')][_0xe9a8('0x1e')]);}_0x1a554b[_0xe9a8('0x45')]=qs[_0xe9a8('0x60')](_0x57ee08[_0xe9a8('0x3b')][_0xe9a8('0x60')]);_0x1a554b['where']=qs[_0xe9a8('0x3d')](_[_0xe9a8('0x46')](_0x57ee08['query'],_0xd1ff4f['filters']));_0x1a554b[_0xe9a8('0x47')]['VoiceQueueId']=_0x109185['id'];if(_0x57ee08[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0x1a554b[_0xe9a8('0x47')]=_[_0xe9a8('0x49')](_0x1a554b[_0xe9a8('0x47')],{'$or':_['map'](_0x1a554b[_0xe9a8('0x41')],function(_0x569c0f){var _0x293657={};_0x293657[_0x569c0f]={'$like':'%'+_0x57ee08[_0xe9a8('0x3b')][_0xe9a8('0x2a')]+'%'};return _0x293657;})});}_0x1a554b=_['merge']({},_0x1a554b,_0x57ee08[_0xe9a8('0x4a')]);return db['CmHopperBlack'][_0xe9a8('0x1d')]({'where':_0x1a554b[_0xe9a8('0x47')]})['then'](function(_0x905c68){_0x50cd39[_0xe9a8('0x1d')]=_0x905c68;if(_0x57ee08[_0xe9a8('0x3b')][_0xe9a8('0x4b')]){_0x1a554b[_0xe9a8('0x4c')]=[{'all':!![]}];}return db[_0xe9a8('0x69')][_0xe9a8('0x4d')](_0x1a554b);})['then'](function(_0x2adfd5){_0x50cd39['rows']=_0x2adfd5;return _0x50cd39;});}})['then'](respondWithFilteredResult(_0x380665,_0x1a554b))['catch'](handleError(_0x380665,null));};exports['getTeams']=function(_0x175ba7,_0x503e92,_0x51d8f8){var _0x112362={};var _0x444969={};var _0x1c9ff3;var _0x3a0456;return db['VoiceQueue'][_0xe9a8('0x63')]({'where':{'id':_0x175ba7[_0xe9a8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x503e92,null))[_0xe9a8('0x25')](function(_0x1bddfd){if(_0x1bddfd){_0x1c9ff3=_0x1bddfd;_0x444969[_0xe9a8('0x3f')]=_[_0xe9a8('0x3c')](db[_0xe9a8('0x6a')][_0xe9a8('0x50')]);_0x444969[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0x175ba7['query']);_0x444969[_0xe9a8('0x3d')]=_['intersection'](_0x444969[_0xe9a8('0x3f')],_0x444969['query']);_0x112362['attributes']=_[_0xe9a8('0x3e')](_0x444969[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x175ba7['query']['fields']));_0x112362[_0xe9a8('0x41')]=_0x112362[_0xe9a8('0x41')][_0xe9a8('0x42')]?_0x112362['attributes']:_0x444969[_0xe9a8('0x3f')];_0x112362[_0xe9a8('0x45')]=qs[_0xe9a8('0x60')](_0x175ba7[_0xe9a8('0x3b')]['sort']);_0x112362['where']=qs[_0xe9a8('0x3d')](_[_0xe9a8('0x46')](_0x175ba7['query'],_0x444969[_0xe9a8('0x3d')]));if(_0x175ba7[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0x112362[_0xe9a8('0x47')]=_[_0xe9a8('0x49')](_0x112362[_0xe9a8('0x47')],{'$or':_[_0xe9a8('0x2c')](_0x112362[_0xe9a8('0x41')],function(_0x282de6){var _0x218c75={};_0x218c75[_0x282de6]={'$like':'%'+_0x175ba7[_0xe9a8('0x3b')][_0xe9a8('0x2a')]+'%'};return _0x218c75;})});}_0x112362=_[_0xe9a8('0x49')]({},_0x112362,_0x175ba7[_0xe9a8('0x4a')]);return _0x1c9ff3[_0xe9a8('0x6b')](_0x112362);}})['then'](function(_0x34f798){if(_0x34f798){_0x3a0456=_0x34f798[_0xe9a8('0x42')];if(!_0x175ba7[_0xe9a8('0x3b')][_0xe9a8('0x43')]('nolimit')){_0x112362[_0xe9a8('0x1f')]=qs[_0xe9a8('0x1f')](_0x175ba7[_0xe9a8('0x3b')][_0xe9a8('0x1f')]);_0x112362[_0xe9a8('0x1e')]=qs[_0xe9a8('0x1e')](_0x175ba7[_0xe9a8('0x3b')][_0xe9a8('0x1e')]);}return _0x1c9ff3[_0xe9a8('0x6b')](_0x112362);}})['then'](function(_0x1d438f){if(_0x1d438f){return _0x1d438f?{'count':_0x3a0456,'rows':_0x1d438f}:null;}})[_0xe9a8('0x25')](respondWithResult(_0x503e92,null))[_0xe9a8('0x59')](handleError(_0x503e92,null));};exports[_0xe9a8('0x6c')]=function(_0x39b231,_0xb1547e,_0x46c259){var _0x4c1067=_0x39b231[_0xe9a8('0x52')]['teams'];var _0x238e7b=_[_0xe9a8('0x2c')](_0x4c1067,'id');return db[_0xe9a8('0x6a')][_0xe9a8('0x4d')]({'where':{'id':_0x238e7b},'attributes':['id'],'include':[{'model':db[_0xe9a8('0x6d')],'as':_0xe9a8('0x6e'),'attributes':['id','name','online',_0xe9a8('0x6f'),'interface'],'raw':!![]}]})[_0xe9a8('0x25')](function(_0x4c2cf4){if(_0x4c2cf4){var _0x543ed2=_[_0xe9a8('0x70')](_0x4c2cf4,function(_0x5d2835){var _0x56201c=_0x5d2835[_0xe9a8('0x26')]({'plain':!![]});_0x56201c['Agents'][_0xe9a8('0x71')](function(_0x1ffa5a){_0x1ffa5a[_0xe9a8('0x72')]=_[_0xe9a8('0x30')](_0x4c1067,{'id':_0x56201c['id']})['penalty'];});return _0x56201c['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x39b231['params']['id']}})['then'](function(_0x17540d){return db['sequelize']['transaction'](function(_0x3d3605){return _0x17540d['addTeams'](_0x238e7b,{'transaction':_0x3d3605})[_0xe9a8('0x25')](function(){return BPromise[_0xe9a8('0x73')](_0x543ed2,function(_0x393253){return db[_0xe9a8('0x74')][_0xe9a8('0x75')]({'where':{'UserId':_0x393253['id'],'VoiceQueueId':_0x39b231[_0xe9a8('0x5b')]['id']},'defaults':{'penalty':_0x393253[_0xe9a8('0x72')]},'transaction':_0x3d3605});});})[_0xe9a8('0x25')](function(){return BPromise[_0xe9a8('0x73')](_[_0xe9a8('0x2a')](_0x543ed2,{'online':!![]}),function(_0x490571){return db[_0xe9a8('0x76')][_0xe9a8('0x77')]({'membername':_0x490571[_0xe9a8('0x35')],'UserId':_0x490571['id'],'queue_name':_0x17540d['name'],'VoiceQueueId':_0x17540d['id'],'interface':_[_0xe9a8('0x78')](_0x490571[_0xe9a8('0x79')])?util['format']('SIP/%s',_0x490571[_0xe9a8('0x35')]):_0x490571['interface'],'paused':_0x490571[_0xe9a8('0x6f')]||![],'penalty':_0x490571[_0xe9a8('0x72')]},{'transaction':_0x3d3605});});})[_0xe9a8('0x25')](function(){_0x543ed2[_0xe9a8('0x71')](function(_0x5dbc0b){socket['emit']('userVoiceQueue:save',{'UserId':_0x5dbc0b['id'],'VoiceQueueId':_0x17540d['id']});});});});});}})['then'](respondWithStatusCode(_0xb1547e,null))[_0xe9a8('0x59')](handleError(_0xb1547e,null));};exports[_0xe9a8('0x7a')]=function(_0xdb418d,_0x314c53,_0x106910){return db[_0xe9a8('0x6a')]['findAll']({'where':{'id':_0xdb418d['query'][_0xe9a8('0x7b')]},'attributes':['id'],'include':[{'model':db[_0xe9a8('0x6d')],'as':_0xe9a8('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xe9a8('0x25')](handleEntityNotFound(_0x314c53,null))['then'](function(_0x3adeeb){var _0x145b8b=_[_0xe9a8('0x2c')](_0x3adeeb,'id');var _0x495eb1=[];var _0x210b6f=[];var _0x34a78c=squel[_0xe9a8('0x7c')]();_0x34a78c[_0xe9a8('0x7d')](_0xe9a8('0x7e'))[_0xe9a8('0x7f')](_0xe9a8('0x80'),'tq')['join']('user_has_teams','ut',_0xe9a8('0x81'))[_0xe9a8('0x47')]('VoiceQueueId\x20=\x20?',_0xdb418d['params']['id']);for(var _0x35b029=0x0;_0x35b029<_0x3adeeb[_0xe9a8('0x42')];_0x35b029+=0x1){let _0x2fb34a=_0x3adeeb[_0x35b029];for(var _0x23ff0f=0x0;_0x23ff0f<_0x2fb34a[_0xe9a8('0x6e')]['length'];_0x23ff0f+=0x1){let _0x11e992=_0x2fb34a[_0xe9a8('0x6e')][_0x23ff0f];var _0x3e151b=_0x34a78c[_0xe9a8('0x82')]();_0x3e151b[_0xe9a8('0x47')](_0xe9a8('0x83'),_0x11e992['id']);_0x210b6f[_0xe9a8('0x84')](db[_0xe9a8('0x85')]['query'](_0x3e151b[_0xe9a8('0x86')](),{'type':db[_0xe9a8('0x85')][_0xe9a8('0x87')]['SELECT']})[_0xe9a8('0x25')](function(_0x19d622){if(_0x19d622[_0xe9a8('0x42')]===0x1){return _0x11e992['id'];}else{var _0x1cb32b=_[_0xe9a8('0x88')](_[_0xe9a8('0x2c')](_0x19d622,_0xe9a8('0x89')),function(_0x5683b3){return _[_0xe9a8('0x2e')](_0x145b8b,_0x5683b3);});if(_0x1cb32b){return _0x11e992['id'];}}}));}}return BPromise[_0xe9a8('0x8a')](_0x210b6f)[_0xe9a8('0x25')](function(_0x54fda3){_0x495eb1=_(_0x495eb1)[_0xe9a8('0x8b')](_0x54fda3)['compact']()[_0xe9a8('0x2d')]();return db[_0xe9a8('0x38')][_0xe9a8('0x30')]({'where':{'id':_0xdb418d[_0xe9a8('0x5b')]['id']}})['then'](function(_0x2c5526){return db[_0xe9a8('0x85')][_0xe9a8('0x8c')](function(_0x33e53d){return _0x2c5526[_0xe9a8('0x7a')](_0xdb418d[_0xe9a8('0x3b')][_0xe9a8('0x7b')],{'transaction':_0x33e53d})['then'](function(){if(!_[_0xe9a8('0x8d')](_0x495eb1)){return _0x2c5526[_0xe9a8('0x8e')](_0x495eb1,{'transaction':_0x33e53d})[_0xe9a8('0x25')](function(){return db['UserVoiceQueueRt'][_0xe9a8('0x24')]({'where':{'VoiceQueueId':_0xdb418d['params']['id'],'UserId':_0x495eb1},'transaction':_0x33e53d});});}})[_0xe9a8('0x25')](function(){_0x495eb1[_0xe9a8('0x71')](function(_0x3031f6){socket[_0xe9a8('0x8f')]('userVoiceQueue:remove',{'UserId':_0x3031f6,'VoiceQueueId':_0x2c5526['id']});});});});});});})[_0xe9a8('0x25')](respondWithStatusCode(_0x314c53,null))[_0xe9a8('0x59')](handleError(_0x314c53,null));};exports[_0xe9a8('0x90')]=function(_0x12b9eb,_0x2d01ad,_0x40fb13){var _0x3a456e,_0x32ff31;return db[_0xe9a8('0x38')]['find']({'where':{'id':_0x12b9eb[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x2d01ad,null))[_0xe9a8('0x25')](function(_0x1fa5d0){if(_0x1fa5d0){_0x32ff31=_0x1fa5d0;return _0x1fa5d0[_0xe9a8('0x90')](_0x12b9eb[_0xe9a8('0x52')][_0xe9a8('0x7b')],_[_0xe9a8('0x5c')](_0x12b9eb[_0xe9a8('0x52')],[_0xe9a8('0x7b'),'id'])||{})[_0xe9a8('0x91')](function(_0xbba4ff){for(var _0x22df6d=0x0;_0x22df6d<_0x12b9eb[_0xe9a8('0x52')][_0xe9a8('0x7b')]['length'];_0x22df6d+=0x1){socket['emit'](_0xe9a8('0x92'),{'UserId':_0x12b9eb[_0xe9a8('0x52')][_0xe9a8('0x7b')][_0x22df6d],'VoiceQueueId':_0x12b9eb[_0xe9a8('0x5b')]['id']});}return _0xbba4ff;});}})[_0xe9a8('0x25')](function(_0x433e45){_0x3a456e=_0x433e45||[];if(_0x32ff31){return db[_0xe9a8('0x6d')][_0xe9a8('0x4d')]({'where':{'id':_0x12b9eb[_0xe9a8('0x52')][_0xe9a8('0x7b')]},'attributes':['id',_0xe9a8('0x35'),'online',_0xe9a8('0x6f'),'interface'],'raw':!![]});}})[_0xe9a8('0x25')](function(_0x34c961){if(!_[_0xe9a8('0x8d')](_0x34c961)){var _0x556f29=[];for(var _0x3f4444=0x0;_0x3f4444<_0x34c961['length'];_0x3f4444++){if(_0x34c961[_0x3f4444][_0xe9a8('0x93')]){_0x556f29[_0xe9a8('0x84')](db[_0xe9a8('0x76')][_0xe9a8('0x77')]({'membername':_0x34c961[_0x3f4444][_0xe9a8('0x35')],'UserId':_0x34c961[_0x3f4444]['id'],'queue_name':_0x32ff31[_0xe9a8('0x35')],'VoiceQueueId':_0x32ff31['id'],'interface':_[_0xe9a8('0x78')](_0x34c961[_0x3f4444][_0xe9a8('0x79')])?util[_0xe9a8('0x94')](_0xe9a8('0x95'),_0x34c961[_0x3f4444][_0xe9a8('0x35')]):_0x34c961[_0x3f4444][_0xe9a8('0x79')],'paused':_0x34c961[_0x3f4444][_0xe9a8('0x6f')]||![],'penalty':_0x12b9eb['body'][_0xe9a8('0x72')]||0x0}));}}return BPromise[_0xe9a8('0x8a')](_0x556f29);}})[_0xe9a8('0x25')](function(){return _0x3a456e;})[_0xe9a8('0x25')](respondWithResult(_0x2d01ad,null))['catch'](handleError(_0x2d01ad,null));};exports[_0xe9a8('0x8e')]=function(_0x3676ba,_0x16b2ef,_0x39c726){return db[_0xe9a8('0x38')]['find']({'where':{'id':_0x3676ba[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x16b2ef,null))['then'](function(_0x12ecc1){if(_0x12ecc1){return _0x12ecc1['removeAgents'](_0x3676ba[_0xe9a8('0x3b')][_0xe9a8('0x7b')])[_0xe9a8('0x25')](function(){if(_[_0xe9a8('0x96')](_0x3676ba[_0xe9a8('0x3b')][_0xe9a8('0x7b')])){for(var _0x36821c=0x0;_0x36821c<_0x3676ba[_0xe9a8('0x3b')]['ids'][_0xe9a8('0x42')];_0x36821c+=0x1){socket[_0xe9a8('0x8f')](_0xe9a8('0x97'),{'UserId':Number(_0x3676ba[_0xe9a8('0x3b')][_0xe9a8('0x7b')][_0x36821c]),'VoiceQueueId':Number(_0x3676ba[_0xe9a8('0x5b')]['id'])});}}else{socket[_0xe9a8('0x8f')](_0xe9a8('0x97'),{'UserId':Number(_0x3676ba[_0xe9a8('0x3b')][_0xe9a8('0x7b')]),'VoiceQueueId':Number(_0x3676ba['params']['id'])});}});}})[_0xe9a8('0x25')](function(_0x4a92c5){return db[_0xe9a8('0x76')][_0xe9a8('0x24')]({'where':{'VoiceQueueId':_0x3676ba[_0xe9a8('0x5b')]['id'],'UserId':_0x3676ba['query'][_0xe9a8('0x7b')]}})[_0xe9a8('0x25')](function(){return _0x4a92c5;});})[_0xe9a8('0x25')](respondWithStatusCode(_0x16b2ef,null))[_0xe9a8('0x59')](handleError(_0x16b2ef,null));};exports[_0xe9a8('0x98')]=function(_0x4aa21d,_0x3d202a,_0x100093){var _0x2e162b={};var _0xd76678={};var _0x4a9914;var _0x1cd6be;return db['VoiceQueue'][_0xe9a8('0x63')]({'where':{'id':_0x4aa21d[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x3d202a,null))[_0xe9a8('0x25')](function(_0x431c4d){if(_0x431c4d){_0x4a9914=_0x431c4d;_0xd76678[_0xe9a8('0x3f')]=_[_0xe9a8('0x3c')](db[_0xe9a8('0x6d')][_0xe9a8('0x50')]);_0xd76678[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0x4aa21d[_0xe9a8('0x3b')]);_0xd76678['filters']=_[_0xe9a8('0x3e')](_0xd76678[_0xe9a8('0x3f')],_0xd76678[_0xe9a8('0x3b')]);_0x2e162b[_0xe9a8('0x41')]=_[_0xe9a8('0x3e')](_0xd76678[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x4aa21d[_0xe9a8('0x3b')]['fields']));_0x2e162b[_0xe9a8('0x41')]=_0x2e162b[_0xe9a8('0x41')][_0xe9a8('0x42')]?_0x2e162b[_0xe9a8('0x41')]:_0xd76678[_0xe9a8('0x3f')];_0x2e162b['order']=qs[_0xe9a8('0x60')](_0x4aa21d['query'][_0xe9a8('0x60')]);_0x2e162b['where']=qs[_0xe9a8('0x3d')](_['pick'](_0x4aa21d[_0xe9a8('0x3b')],_0xd76678['filters']));if(_0x4aa21d[_0xe9a8('0x3b')]['filter']){_0x2e162b['where']=_[_0xe9a8('0x49')](_0x2e162b[_0xe9a8('0x47')],{'$or':_[_0xe9a8('0x2c')](_0x2e162b[_0xe9a8('0x41')],function(_0x424350){var _0x2b8fb9={};_0x2b8fb9[_0x424350]={'$like':'%'+_0x4aa21d['query'][_0xe9a8('0x2a')]+'%'};return _0x2b8fb9;})});}_0x2e162b=_[_0xe9a8('0x49')]({},_0x2e162b,_0x4aa21d[_0xe9a8('0x4a')]);return _0x4a9914['getAgents'](_0x2e162b);}})['then'](function(_0x180507){if(_0x180507){_0x1cd6be=_0x180507[_0xe9a8('0x42')];if(!_0x4aa21d['query'][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0x2e162b['limit']=qs[_0xe9a8('0x1f')](_0x4aa21d['query'][_0xe9a8('0x1f')]);_0x2e162b['offset']=qs[_0xe9a8('0x1e')](_0x4aa21d['query'][_0xe9a8('0x1e')]);}return _0x4a9914[_0xe9a8('0x98')](_0x2e162b);}})['then'](function(_0x51ee6d){if(_0x51ee6d){return _0x51ee6d?{'count':_0x1cd6be,'rows':_0x51ee6d}:null;}})[_0xe9a8('0x25')](respondWithResult(_0x3d202a,null))[_0xe9a8('0x59')](handleError(_0x3d202a,null));};exports[_0xe9a8('0x99')]=function(_0xde22cc,_0x40b6f9,_0x3d3df1){var _0x5bdcef={};var _0x5d0e9a={};var _0xaa67b0;var _0x564792;return db[_0xe9a8('0x38')][_0xe9a8('0x63')]({'where':{'id':_0xde22cc[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x40b6f9,null))[_0xe9a8('0x25')](function(_0x199e3f){if(_0x199e3f){_0xaa67b0=_0x199e3f;_0x5d0e9a[_0xe9a8('0x3f')]=_[_0xe9a8('0x3c')](db[_0xe9a8('0x76')][_0xe9a8('0x50')]);_0x5d0e9a[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0xde22cc[_0xe9a8('0x3b')]);_0x5d0e9a['filters']=_[_0xe9a8('0x3e')](_0x5d0e9a[_0xe9a8('0x3f')],_0x5d0e9a[_0xe9a8('0x3b')]);_0x5bdcef[_0xe9a8('0x41')]=_[_0xe9a8('0x3e')](_0x5d0e9a[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0xde22cc['query']['fields']));_0x5bdcef[_0xe9a8('0x41')]=_0x5bdcef['attributes'][_0xe9a8('0x42')]?_0x5bdcef[_0xe9a8('0x41')]:_0x5d0e9a['model'];_0x5bdcef[_0xe9a8('0x45')]=qs[_0xe9a8('0x60')](_0xde22cc[_0xe9a8('0x3b')][_0xe9a8('0x60')]);_0x5bdcef['where']=qs['filters'](_[_0xe9a8('0x46')](_0xde22cc['query'],_0x5d0e9a[_0xe9a8('0x3d')]));if(_0xde22cc[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0x5bdcef[_0xe9a8('0x47')]=_[_0xe9a8('0x49')](_0x5bdcef[_0xe9a8('0x47')],{'$or':_[_0xe9a8('0x2c')](_0x5bdcef[_0xe9a8('0x41')],function(_0x3fadab){var _0x4cd167={};_0x4cd167[_0x3fadab]={'$like':'%'+_0xde22cc[_0xe9a8('0x3b')][_0xe9a8('0x2a')]+'%'};return _0x4cd167;})});}_0x5bdcef=_['merge']({},_0x5bdcef,_0xde22cc[_0xe9a8('0x4a')]);return _0xaa67b0['getMembers'](_0x5bdcef);}})[_0xe9a8('0x25')](function(_0x52fe4){if(_0x52fe4){_0x564792=_0x52fe4[_0xe9a8('0x42')];if(!_0xde22cc['query'][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0x5bdcef[_0xe9a8('0x1f')]=qs[_0xe9a8('0x1f')](_0xde22cc[_0xe9a8('0x3b')][_0xe9a8('0x1f')]);_0x5bdcef[_0xe9a8('0x1e')]=qs[_0xe9a8('0x1e')](_0xde22cc[_0xe9a8('0x3b')][_0xe9a8('0x1e')]);}return _0xaa67b0[_0xe9a8('0x99')](_0x5bdcef);}})[_0xe9a8('0x25')](function(_0x3a418b){return _0x3a418b?{'count':_0x564792,'rows':_0x3a418b}:null;})[_0xe9a8('0x25')](respondWithResult(_0x40b6f9,null))[_0xe9a8('0x59')](handleError(_0x40b6f9,null));};exports[_0xe9a8('0x9a')]=function(_0x1cc0b1,_0x207606,_0x14efd6){var _0x47b17b={};var _0x4bfbad={};var _0x2d3e14;var _0x4234a8;return db[_0xe9a8('0x38')][_0xe9a8('0x63')]({'where':{'id':_0x1cc0b1[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x207606,null))[_0xe9a8('0x25')](function(_0x2e5798){if(_0x2e5798){_0x2d3e14=_0x2e5798;_0x4bfbad[_0xe9a8('0x3f')]=_[_0xe9a8('0x3c')](db[_0xe9a8('0x9b')][_0xe9a8('0x50')]);_0x4bfbad['query']=_[_0xe9a8('0x3c')](_0x1cc0b1['query']);_0x4bfbad[_0xe9a8('0x3d')]=_[_0xe9a8('0x3e')](_0x4bfbad[_0xe9a8('0x3f')],_0x4bfbad['query']);_0x47b17b[_0xe9a8('0x41')]=_[_0xe9a8('0x3e')](_0x4bfbad[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x1cc0b1[_0xe9a8('0x3b')][_0xe9a8('0x40')]));_0x47b17b[_0xe9a8('0x41')]=_0x47b17b[_0xe9a8('0x41')][_0xe9a8('0x42')]?_0x47b17b[_0xe9a8('0x41')]:_0x4bfbad[_0xe9a8('0x3f')];_0x47b17b[_0xe9a8('0x45')]=qs[_0xe9a8('0x60')](_0x1cc0b1[_0xe9a8('0x3b')][_0xe9a8('0x60')]);_0x47b17b[_0xe9a8('0x47')]=qs[_0xe9a8('0x3d')](_[_0xe9a8('0x46')](_0x1cc0b1[_0xe9a8('0x3b')],_0x4bfbad[_0xe9a8('0x3d')]));if(_0x1cc0b1['query'][_0xe9a8('0x2a')]){_0x47b17b[_0xe9a8('0x47')]=_[_0xe9a8('0x49')](_0x47b17b[_0xe9a8('0x47')],{'$or':_['map'](_0x47b17b[_0xe9a8('0x41')],function(_0x1b1151){var _0xf73df7={};_0xf73df7[_0x1b1151]={'$like':'%'+_0x1cc0b1[_0xe9a8('0x3b')][_0xe9a8('0x2a')]+'%'};return _0xf73df7;})});}_0x47b17b=_['merge']({},_0x47b17b,_0x1cc0b1[_0xe9a8('0x4a')]);return _0x2d3e14['getLists'](_0x47b17b);}})['then'](function(_0x557cc6){if(_0x557cc6){_0x4234a8=_0x557cc6[_0xe9a8('0x42')];if(!_0x1cc0b1[_0xe9a8('0x3b')][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0x47b17b['limit']=qs[_0xe9a8('0x1f')](_0x1cc0b1[_0xe9a8('0x3b')][_0xe9a8('0x1f')]);_0x47b17b['offset']=qs[_0xe9a8('0x1e')](_0x1cc0b1['query']['offset']);}return _0x2d3e14[_0xe9a8('0x9a')](_0x47b17b);}})['then'](function(_0x289e46){if(_0x289e46){return _0x289e46?{'count':_0x4234a8,'rows':_0x289e46}:null;}})[_0xe9a8('0x25')](respondWithResult(_0x207606,null))[_0xe9a8('0x59')](handleError(_0x207606,null));};exports['addLists']=function(_0x9f4c5a,_0xb76105,_0x1c752b){var _0x84acf3,_0x2ddfa0;return db[_0xe9a8('0x38')][_0xe9a8('0x30')]({'where':{'id':_0x9f4c5a[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0xb76105,null))[_0xe9a8('0x25')](function(_0x5d9468){if(_0x5d9468){_0x2ddfa0=_0x5d9468;return _0x5d9468[_0xe9a8('0x9c')](_0x9f4c5a[_0xe9a8('0x52')][_0xe9a8('0x7b')],_[_0xe9a8('0x5c')](_0x9f4c5a[_0xe9a8('0x52')],['ids','id'])||{});}return null;})['spread'](function(_0x558f9e){var _0x4692ec;_0x84acf3=_0x558f9e||[];var _0x455d3c=[];if(_0x558f9e){for(var _0x4f488c=0x0;_0x4f488c<_0x558f9e[_0xe9a8('0x42')];_0x4f488c+=0x1){var _0x1a73c4=_0x558f9e[_0x4f488c][_0xe9a8('0x26')]({'plain':!![]});_0x2ddfa0[_0xe9a8('0x9d')]=_0x9f4c5a[_0xe9a8('0x52')][_0xe9a8('0x9d')]?_0x9f4c5a[_0xe9a8('0x52')][_0xe9a8('0x9d')]:_0x2ddfa0[_0xe9a8('0x9d')];switch(_0x2ddfa0['dialCheckDuplicateType']){case _0xe9a8('0x9e'):_0x4692ec=squel[_0xe9a8('0x9f')]()['into']('cm_hopper')[_0xe9a8('0xa0')](['phone',_0xe9a8('0xa1'),'ContactId',_0xe9a8('0xa2'),'VoiceQueueId',_0xe9a8('0x5d'),_0xe9a8('0x5e')],squel['select']()['field']('phone',_0xe9a8('0xa3'))[_0xe9a8('0x7d')](_0xe9a8('0xa4'),_0xe9a8('0xa1'))['field']('id',_0xe9a8('0xa5'))[_0xe9a8('0x7d')](_0x1a73c4[_0xe9a8('0xa6')][_0xe9a8('0x86')](),_0xe9a8('0xa2'))[_0xe9a8('0x7d')](_0x9f4c5a[_0xe9a8('0x5b')]['id'][_0xe9a8('0x86')](),_0xe9a8('0x65'))[_0xe9a8('0x7d')](_0xe9a8('0xa4'),'createdAt')[_0xe9a8('0x7d')]('NOW()',_0xe9a8('0x5e'))['from'](_0xe9a8('0xa7'))['where'](_0xe9a8('0xa8'))[_0xe9a8('0x47')](_0xe9a8('0xa9'),_0x1a73c4[_0xe9a8('0xa6')]['toString']())[_0xe9a8('0x47')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xe9a8('0xaa'),squel[_0xe9a8('0x7c')]()[_0xe9a8('0x7d')](_0xe9a8('0xab'))[_0xe9a8('0x7f')](_0xe9a8('0xac'))[_0xe9a8('0x47')](_0xe9a8('0xad'),_0x9f4c5a['params']['id'][_0xe9a8('0x86')]()))[_0xe9a8('0x47')]('phone\x20NOT\x20IN\x20(?)',squel[_0xe9a8('0x7c')]()[_0xe9a8('0x7d')]('COALESCE(phone,\x27\x27)')[_0xe9a8('0x7f')](_0xe9a8('0xae'))[_0xe9a8('0x47')]('VoiceQueueId\x20=\x20?',_0x9f4c5a[_0xe9a8('0x5b')]['id'][_0xe9a8('0x86')]())))[_0xe9a8('0x86')]();break;case _0xe9a8('0xaf'):_0x4692ec=squel[_0xe9a8('0x9f')]()[_0xe9a8('0xb0')](_0xe9a8('0xae'))[_0xe9a8('0xa0')](['phone','scheduledAt','ContactId','ListId','VoiceQueueId',_0xe9a8('0x5d'),_0xe9a8('0x5e')],squel[_0xe9a8('0x7c')]()['field']('phone','phone')['field'](_0xe9a8('0xa4'),'scheduledAt')[_0xe9a8('0x7d')]('id',_0xe9a8('0xa5'))[_0xe9a8('0x7d')](_0x1a73c4[_0xe9a8('0xa6')][_0xe9a8('0x86')](),'ListId')[_0xe9a8('0x7d')](_0x9f4c5a[_0xe9a8('0x5b')]['id']['toString'](),_0xe9a8('0x65'))[_0xe9a8('0x7d')](_0xe9a8('0xa4'),_0xe9a8('0x5d'))[_0xe9a8('0x7d')]('NOW()',_0xe9a8('0x5e'))[_0xe9a8('0x7f')]('cm_contacts')[_0xe9a8('0x47')](_0xe9a8('0xa8'))[_0xe9a8('0x47')]('ListId\x20=\x20?',_0x1a73c4[_0xe9a8('0xa6')][_0xe9a8('0x86')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xe9a8('0x47')](_0xe9a8('0xaa'),squel[_0xe9a8('0x7c')]()[_0xe9a8('0x7d')]('COALESCE(phone,\x27\x27)')[_0xe9a8('0x7f')](_0xe9a8('0xae'))[_0xe9a8('0x47')](_0xe9a8('0xad'),_0x9f4c5a[_0xe9a8('0x5b')]['id'][_0xe9a8('0x86')]())))[_0xe9a8('0x86')]();break;default:_0x4692ec=squel[_0xe9a8('0x9f')]()[_0xe9a8('0xb0')]('cm_hopper')['fromQuery']([_0xe9a8('0xa3'),_0xe9a8('0xa1'),_0xe9a8('0xa5'),'ListId',_0xe9a8('0x65'),_0xe9a8('0x5d'),_0xe9a8('0x5e')],squel[_0xe9a8('0x7c')]()['field'](_0xe9a8('0xa3'),'phone')['field'](_0xe9a8('0xa4'),_0xe9a8('0xa1'))[_0xe9a8('0x7d')]('id',_0xe9a8('0xa5'))['field'](_0x1a73c4[_0xe9a8('0xa6')][_0xe9a8('0x86')](),_0xe9a8('0xa2'))[_0xe9a8('0x7d')](_0x9f4c5a[_0xe9a8('0x5b')]['id']['toString'](),'VoiceQueueId')[_0xe9a8('0x7d')](_0xe9a8('0xa4'),'createdAt')[_0xe9a8('0x7d')]('NOW()',_0xe9a8('0x5e'))[_0xe9a8('0x7f')](_0xe9a8('0xa7'))[_0xe9a8('0x47')](_0xe9a8('0xa8'))['where'](_0xe9a8('0xa9'),_0x1a73c4['CmListId'][_0xe9a8('0x86')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xe9a8('0x86')]();}_0x455d3c[_0xe9a8('0x84')](db['sequelize'][_0xe9a8('0x3b')](_0x4692ec));}return BPromise[_0xe9a8('0x8a')](_0x455d3c);}})['then'](function(){return _0x84acf3;})['then'](respondWithResult(_0xb76105,null))['catch'](handleError(_0xb76105,null));};exports['removeLists']=function(_0x6939f0,_0x272308,_0x13f22c){return db[_0xe9a8('0x38')][_0xe9a8('0x30')]({'where':{'id':_0x6939f0[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0x272308,null))[_0xe9a8('0x25')](function(_0x190c6c){if(_0x190c6c){return _0x190c6c[_0xe9a8('0xb1')](_0x6939f0[_0xe9a8('0x3b')][_0xe9a8('0x7b')]);}})[_0xe9a8('0x25')](function(_0x345727){if(_0x345727){return db[_0xe9a8('0x61')][_0xe9a8('0x24')]({'where':{'ListId':_0x6939f0[_0xe9a8('0x3b')][_0xe9a8('0x7b')],'VoiceQueueId':_0x6939f0[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](function(){return _0x345727;});}})['then'](respondWithStatusCode(_0x272308,null))['catch'](handleError(_0x272308,null));};exports['getBlackLists']=function(_0x418060,_0x5db9b9,_0x4c0b5c){var _0xfcd689={};var _0x3966c5={};var _0x277453;var _0x3e7c59;return db[_0xe9a8('0x38')][_0xe9a8('0x63')]({'where':{'id':_0x418060[_0xe9a8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5db9b9,null))['then'](function(_0x227682){if(_0x227682){_0x277453=_0x227682;_0x3966c5[_0xe9a8('0x3f')]=_[_0xe9a8('0x3c')](db[_0xe9a8('0x9b')][_0xe9a8('0x50')]);_0x3966c5[_0xe9a8('0x3b')]=_[_0xe9a8('0x3c')](_0x418060['query']);_0x3966c5[_0xe9a8('0x3d')]=_[_0xe9a8('0x3e')](_0x3966c5[_0xe9a8('0x3f')],_0x3966c5['query']);_0xfcd689['attributes']=_[_0xe9a8('0x3e')](_0x3966c5[_0xe9a8('0x3f')],qs[_0xe9a8('0x40')](_0x418060[_0xe9a8('0x3b')][_0xe9a8('0x40')]));_0xfcd689[_0xe9a8('0x41')]=_0xfcd689[_0xe9a8('0x41')][_0xe9a8('0x42')]?_0xfcd689[_0xe9a8('0x41')]:_0x3966c5[_0xe9a8('0x3f')];_0xfcd689[_0xe9a8('0x45')]=qs['sort'](_0x418060[_0xe9a8('0x3b')]['sort']);_0xfcd689[_0xe9a8('0x47')]=qs[_0xe9a8('0x3d')](_['pick'](_0x418060[_0xe9a8('0x3b')],_0x3966c5[_0xe9a8('0x3d')]));if(_0x418060[_0xe9a8('0x3b')][_0xe9a8('0x2a')]){_0xfcd689[_0xe9a8('0x47')]=_[_0xe9a8('0x49')](_0xfcd689[_0xe9a8('0x47')],{'$or':_[_0xe9a8('0x2c')](_0xfcd689['attributes'],function(_0x47311c){var _0x28678b={};_0x28678b[_0x47311c]={'$like':'%'+_0x418060[_0xe9a8('0x3b')]['filter']+'%'};return _0x28678b;})});}_0xfcd689=_[_0xe9a8('0x49')]({},_0xfcd689,_0x418060['options']);return _0x277453['getBlackLists'](_0xfcd689);}})['then'](function(_0x4cb7db){if(_0x4cb7db){_0x3e7c59=_0x4cb7db[_0xe9a8('0x42')];if(!_0x418060[_0xe9a8('0x3b')][_0xe9a8('0x43')](_0xe9a8('0x44'))){_0xfcd689[_0xe9a8('0x1f')]=qs[_0xe9a8('0x1f')](_0x418060['query'][_0xe9a8('0x1f')]);_0xfcd689[_0xe9a8('0x1e')]=qs[_0xe9a8('0x1e')](_0x418060['query'][_0xe9a8('0x1e')]);}return _0x277453['getBlackLists'](_0xfcd689);}})[_0xe9a8('0x25')](function(_0xef1be8){if(_0xef1be8){return _0xef1be8?{'count':_0x3e7c59,'rows':_0xef1be8}:null;}})[_0xe9a8('0x25')](respondWithResult(_0x5db9b9,null))[_0xe9a8('0x59')](handleError(_0x5db9b9,null));};exports[_0xe9a8('0xb2')]=function(_0x180384,_0xa281b1,_0x4ab696){var _0x28e71c,_0x3880aa;return db[_0xe9a8('0x38')][_0xe9a8('0x30')]({'where':{'id':_0x180384[_0xe9a8('0x5b')]['id']}})[_0xe9a8('0x25')](handleEntityNotFound(_0xa281b1,null))[_0xe9a8('0x25')](function(_0x411d35){if(_0x411d35){_0x3880aa=_0x411d35;return _0x411d35[_0xe9a8('0xb2')](_0x180384[_0xe9a8('0x52')][_0xe9a8('0x7b')],_[_0xe9a8('0x5c')](_0x180384[_0xe9a8('0x52')],[_0xe9a8('0x7b'),'id'])||{});}return null;})[_0xe9a8('0x91')](function(_0x43ca18){var _0x2a7c36;_0x28e71c=_0x43ca18||[];var _0x327e4e=[];if(_0x43ca18){for(var _0x52982c=0x0;_0x52982c<_0x43ca18[_0xe9a8('0x42')];_0x52982c+=0x1){var _0x68e727=_0x43ca18[_0x52982c][_0xe9a8('0x26')]({'plain':!![]});_0x2a7c36=squel[_0xe9a8('0x9f')]()['into'](_0xe9a8('0xb3'))[_0xe9a8('0xa0')]([_0xe9a8('0xa3'),_0xe9a8('0xa5'),_0xe9a8('0xa2'),_0xe9a8('0x65'),'createdAt',_0xe9a8('0x5e')],squel[_0xe9a8('0x7c')]()[_0xe9a8('0x7d')](_0xe9a8('0xa3'),'phone')[_0xe9a8('0x7d')]('id',_0xe9a8('0xa5'))[_0xe9a8('0x7d')](_0x68e727[_0xe9a8('0xa6')][_0xe9a8('0x86')](),_0xe9a8('0xa2'))[_0xe9a8('0x7d')](_0x180384[_0xe9a8('0x5b')]['id'][_0xe9a8('0x86')](),'VoiceQueueId')['field'](_0xe9a8('0xa4'),_0xe9a8('0x5d'))[_0xe9a8('0x7d')](_0xe9a8('0xa4'),'updatedAt')['from'](_0xe9a8('0xa7'))[_0xe9a8('0x47')](_0xe9a8('0xa8'))[_0xe9a8('0x47')](_0xe9a8('0xa9'),_0x68e727[_0xe9a8('0xa6')][_0xe9a8('0x86')]())[_0xe9a8('0x47')](_0xe9a8('0xb4')))['toString']();_0x327e4e[_0xe9a8('0x84')](db[_0xe9a8('0x85')][_0xe9a8('0x3b')](_0x2a7c36));}return BPromise[_0xe9a8('0x8a')](_0x327e4e);}})['then'](function(){return _0x28e71c;})[_0xe9a8('0x25')](respondWithResult(_0xa281b1,null))[_0xe9a8('0x59')](handleError(_0xa281b1,null));};exports[_0xe9a8('0xb5')]=function(_0xca6a9,_0x5ec04d,_0x1dbf6c){return db['VoiceQueue'][_0xe9a8('0x30')]({'where':{'id':_0xca6a9[_0xe9a8('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ec04d,null))['then'](function(_0x242745){if(_0x242745){return _0x242745[_0xe9a8('0xb5')](_0xca6a9[_0xe9a8('0x3b')][_0xe9a8('0x7b')]);}})[_0xe9a8('0x25')](function(_0x3bbc5b){if(_0x3bbc5b){return db['CmHopperBlack'][_0xe9a8('0x24')]({'where':{'ListId':_0xca6a9[_0xe9a8('0x3b')][_0xe9a8('0x7b')],'VoiceQueueId':_0xca6a9['params']['id']}})['then'](function(){return _0x3bbc5b;});}})[_0xe9a8('0x25')](respondWithStatusCode(_0x5ec04d,null))[_0xe9a8('0x59')](handleError(_0x5ec04d,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0643ab1..e03940f 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 _0xa56f=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa56f,0x129));var _0xfa56=function(_0x3edae7,_0x5b76a6){_0x3edae7=_0x3edae7-0x0;var _0x3a10df=_0xa56f[_0x3edae7];return _0x3a10df;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xfa56('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xfa56('0x1')](0x0);var events={'afterCreate':_0xfa56('0x2'),'afterUpdate':_0xfa56('0x3'),'afterDestroy':_0xfa56('0x4')};function emitEvent(_0x258a0b){return function(_0x299a1b,_0x2bd4fc,_0x428a2f){VoiceQueueEvents[_0xfa56('0x5')](_0x258a0b+':'+_0x299a1b['id'],_0x299a1b);VoiceQueueEvents[_0xfa56('0x5')](_0x258a0b,_0x299a1b);_0x428a2f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xfa56('0x6')](e,emitEvent(event));}}module[_0xfa56('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x20a2=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1ed611,_0xd4ba7f){var _0xe75fee=function(_0x5ccb62){while(--_0x5ccb62){_0x1ed611['push'](_0x1ed611['shift']());}};_0xe75fee(++_0xd4ba7f);}(_0x20a2,0xa5));var _0x220a=function(_0x21929f,_0xb96182){_0x21929f=_0x21929f-0x0;var _0x1a6077=_0x20a2[_0x21929f];return _0x1a6077;};'use strict';var EventEmitter=require(_0x220a('0x0'));var VoiceQueue=require(_0x220a('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x220a('0x2')](0x0);var events={'afterCreate':_0x220a('0x3'),'afterUpdate':_0x220a('0x4'),'afterDestroy':_0x220a('0x5')};function emitEvent(_0x54bb9c){return function(_0x104167,_0x40559a,_0x5bee1a){VoiceQueueEvents[_0x220a('0x6')](_0x54bb9c+':'+_0x104167['id'],_0x104167);VoiceQueueEvents[_0x220a('0x6')](_0x54bb9c,_0x104167);_0x5bee1a(null);};}for(var e in events){if(events[_0x220a('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x220a('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 480df5d..015cfaf 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 _0x78ac=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue','voice_queues','util','api','moment'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x78ac,0x1a1));var _0xc78a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x78ac[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0xc78a('0x0'));var logger=require('../../config/logger')(_0xc78a('0x1'));var moment=require(_0xc78a('0x2'));var BPromise=require(_0xc78a('0x3'));var rp=require(_0xc78a('0x4'));var fs=require('fs');var path=require(_0xc78a('0x5'));var rimraf=require(_0xc78a('0x6'));var config=require(_0xc78a('0x7'));var attributes=require(_0xc78a('0x8'));module[_0xc78a('0x9')]=function(_0xf4bcdc,_0x453222){return _0xf4bcdc['define'](_0xc78a('0xa'),attributes,{'tableName':_0xc78a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9ea=['api','moment','path','rimraf','../../config/environment','exports','define','VoiceQueue','lodash','util','../../config/logger'];(function(_0x13c681,_0x4dc140){var _0x43293d=function(_0x478f93){while(--_0x478f93){_0x13c681['push'](_0x13c681['shift']());}};_0x43293d(++_0x4dc140);}(_0xe9ea,0x189));var _0xae9e=function(_0x1be59b,_0x25ae6e){_0x1be59b=_0x1be59b-0x0;var _0x484314=_0xe9ea[_0x1be59b];return _0x484314;};'use strict';var _=require(_0xae9e('0x0'));var util=require(_0xae9e('0x1'));var logger=require(_0xae9e('0x2'))(_0xae9e('0x3'));var moment=require(_0xae9e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xae9e('0x5'));var rimraf=require(_0xae9e('0x6'));var config=require(_0xae9e('0x7'));var attributes=require('./voiceQueue.attributes');module[_0xae9e('0x8')]=function(_0x5be9c5,_0x151f8b){return _0x5be9c5[_0xae9e('0x9')](_0xae9e('0xa'),attributes,{'tableName':'voice_queues','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 8cc7098..8de6dbf 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 _0xbd73=['where','limit','map','include','attributes','model','catch','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceQueue','VoiceQueue','findAll','options','raw'];(function(_0x4dd1ff,_0x148c27){var _0x1a039e=function(_0x2453d3){while(--_0x2453d3){_0x4dd1ff['push'](_0x4dd1ff['shift']());}};_0x1a039e(++_0x148c27);}(_0xbd73,0x1cc));var _0x3bd7=function(_0x2b9a6e,_0x42f50b){_0x2b9a6e=_0x2b9a6e-0x0;var _0x56a226=_0xbd73[_0x2b9a6e];return _0x56a226;};'use strict';var _=require(_0x3bd7('0x0'));var util=require(_0x3bd7('0x1'));var moment=require(_0x3bd7('0x2'));var BPromise=require(_0x3bd7('0x3'));var rs=require(_0x3bd7('0x4'));var fs=require('fs');var Redis=require(_0x3bd7('0x5'));var db=require(_0x3bd7('0x6'))['db'];var utils=require(_0x3bd7('0x7'));var logger=require('../../config/logger')(_0x3bd7('0x8'));var config=require(_0x3bd7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3bd7('0xa')][_0x3bd7('0xb')]({'port':0x232a});config[_0x3bd7('0xc')]=_[_0x3bd7('0xd')](config[_0x3bd7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3bd7('0xe'))(new Redis(config[_0x3bd7('0xc')]));require(_0x3bd7('0xf'))[_0x3bd7('0x10')](socket);function respondWithRpcPromise(_0xcc8d09,_0x426ed4,_0x190673){return new BPromise(function(_0xf548b7,_0x13e2be){return client[_0x3bd7('0x11')](_0xcc8d09,_0x190673)[_0x3bd7('0x12')](function(_0x1ce976){logger[_0x3bd7('0x13')](_0x3bd7('0x14'),_0x426ed4,_0x3bd7('0x15'));logger[_0x3bd7('0x16')](_0x3bd7('0x17'),_0x426ed4,_0x3bd7('0x15'),JSON[_0x3bd7('0x18')](_0x1ce976));if(_0x1ce976[_0x3bd7('0x19')]){if(_0x1ce976[_0x3bd7('0x19')]['code']===0x1f4){logger[_0x3bd7('0x19')](_0x3bd7('0x14'),_0x426ed4,_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);return _0x13e2be(_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);}logger['error'](_0x3bd7('0x14'),_0x426ed4,_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);return _0xf548b7(_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);}else{logger[_0x3bd7('0x13')](_0x3bd7('0x14'),_0x426ed4,_0x3bd7('0x15'));_0xf548b7(_0x1ce976['result'][_0x3bd7('0x1a')]);}})['catch'](function(_0x2f0f21){logger[_0x3bd7('0x19')](_0x3bd7('0x14'),_0x426ed4,_0x2f0f21);_0x13e2be(_0x2f0f21);});});}exports[_0x3bd7('0x1b')]=function(_0x46659d){var _0x45e488=this;return new Promise(function(_0x2727c0,_0x3f3cc2){return db[_0x3bd7('0x1c')][_0x3bd7('0x1d')]({'raw':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x1f')]===undefined?!![]:![]:!![],'where':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x20')]||null:null,'attributes':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')]['attributes']||null:null,'limit':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x21')]||null:null,'include':_0x46659d['options']?_0x46659d[_0x3bd7('0x1e')]['include']?_[_0x3bd7('0x22')](_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x23')],function(_0x22b3b2){return{'model':db[_0x22b3b2['model']],'as':_0x22b3b2['as'],'attributes':_0x22b3b2[_0x3bd7('0x24')],'include':_0x22b3b2[_0x3bd7('0x23')]?_[_0x3bd7('0x22')](_0x22b3b2[_0x3bd7('0x23')],function(_0x3012d9){return{'model':db[_0x3012d9[_0x3bd7('0x25')]],'as':_0x3012d9['as'],'attributes':_0x3012d9[_0x3bd7('0x24')],'include':_0x3012d9['include']?_[_0x3bd7('0x22')](_0x3012d9[_0x3bd7('0x23')],function(_0x52f0f4){return{'model':db[_0x52f0f4[_0x3bd7('0x25')]],'as':_0x52f0f4['as'],'attributes':_0x52f0f4['attributes']};}):[]};}):[]};}):[]:[]})[_0x3bd7('0x12')](function(_0x1ad6f0){logger[_0x3bd7('0x13')](_0x3bd7('0x1b'),_0x46659d);logger[_0x3bd7('0x16')](_0x3bd7('0x1b'),_0x46659d,JSON[_0x3bd7('0x18')](_0x1ad6f0));_0x2727c0(_0x1ad6f0);})[_0x3bd7('0x26')](function(_0x3d27f9){logger['error'](_0x3bd7('0x1b'),_0x3d27f9['message'],_0x46659d);_0x3f3cc2(_0x45e488[_0x3bd7('0x19')](0x1f4,_0x3d27f9[_0x3bd7('0x1a')]));});});};exports[_0x3bd7('0x27')]=function(_0x41946d){var _0x45b0c3=this;return new Promise(function(_0x127f8c,_0x5ae742){return db[_0x3bd7('0x1c')][_0x3bd7('0x28')]({'raw':_0x41946d[_0x3bd7('0x1e')]?_0x41946d[_0x3bd7('0x1e')][_0x3bd7('0x1f')]===undefined?!![]:![]:!![],'where':_0x41946d[_0x3bd7('0x1e')]?_0x41946d['options'][_0x3bd7('0x20')]||null:null,'attributes':_0x41946d[_0x3bd7('0x1e')]?_0x41946d[_0x3bd7('0x1e')][_0x3bd7('0x24')]||null:null,'include':_0x41946d[_0x3bd7('0x1e')]?_0x41946d['options'][_0x3bd7('0x23')]?_[_0x3bd7('0x22')](_0x41946d['options'][_0x3bd7('0x23')],function(_0x2a2b34){return{'model':db[_0x2a2b34[_0x3bd7('0x25')]],'as':_0x2a2b34['as'],'attributes':_0x2a2b34[_0x3bd7('0x24')],'include':_0x2a2b34['include']?_[_0x3bd7('0x22')](_0x2a2b34[_0x3bd7('0x23')],function(_0x423206){return{'model':db[_0x423206['model']],'as':_0x423206['as'],'attributes':_0x423206['attributes'],'include':_0x423206[_0x3bd7('0x23')]?_[_0x3bd7('0x22')](_0x423206[_0x3bd7('0x23')],function(_0x18bf64){return{'model':db[_0x18bf64[_0x3bd7('0x25')]],'as':_0x18bf64['as'],'attributes':_0x18bf64[_0x3bd7('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f4948){logger[_0x3bd7('0x13')]('ShowVoiceQueue',_0x41946d);logger[_0x3bd7('0x16')]('ShowVoiceQueue',_0x41946d,JSON[_0x3bd7('0x18')](_0x1f4948));_0x127f8c(_0x1f4948);})[_0x3bd7('0x26')](function(_0x427ce8){logger[_0x3bd7('0x19')](_0x3bd7('0x27'),_0x427ce8[_0x3bd7('0x1a')],_0x41946d);_0x5ae742(_0x45b0c3['error'](0x1f4,_0x427ce8['message']));});});}; \ No newline at end of file +var _0x5518=['map','model','then','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','./voiceQueue.socket','register','info','request\x20sent','debug','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','attributes','include'];(function(_0x107995,_0x42fb77){var _0xa09073=function(_0x581ba7){while(--_0x581ba7){_0x107995['push'](_0x107995['shift']());}};_0xa09073(++_0x42fb77);}(_0x5518,0x1b2));var _0x8551=function(_0x1fe134,_0x416ba9){_0x1fe134=_0x1fe134-0x0;var _0x2e6942=_0x5518[_0x1fe134];return _0x2e6942;};'use strict';var _=require(_0x8551('0x0'));var util=require(_0x8551('0x1'));var moment=require(_0x8551('0x2'));var BPromise=require(_0x8551('0x3'));var rs=require(_0x8551('0x4'));var fs=require('fs');var Redis=require(_0x8551('0x5'));var db=require(_0x8551('0x6'))['db'];var utils=require(_0x8551('0x7'));var logger=require(_0x8551('0x8'))('rpc');var config=require(_0x8551('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8551('0xa')][_0x8551('0xb')]({'port':0x232a});config[_0x8551('0xc')]=_['defaults'](config[_0x8551('0xc')],{'host':_0x8551('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8551('0xe'))[_0x8551('0xf')](socket);function respondWithRpcPromise(_0x25b726,_0x3dd86e,_0xe7f22a){return new BPromise(function(_0x38f77d,_0x37b781){return client['request'](_0x25b726,_0xe7f22a)['then'](function(_0x10c85e){logger[_0x8551('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x3dd86e,_0x8551('0x11'));logger[_0x8551('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x3dd86e,_0x8551('0x11'),JSON[_0x8551('0x13')](_0x10c85e));if(_0x10c85e[_0x8551('0x14')]){if(_0x10c85e['error'][_0x8551('0x15')]===0x1f4){logger[_0x8551('0x14')](_0x8551('0x16'),_0x3dd86e,_0x10c85e[_0x8551('0x14')][_0x8551('0x17')]);return _0x37b781(_0x10c85e[_0x8551('0x14')][_0x8551('0x17')]);}logger['error'](_0x8551('0x16'),_0x3dd86e,_0x10c85e['error'][_0x8551('0x17')]);return _0x38f77d(_0x10c85e['error'][_0x8551('0x17')]);}else{logger[_0x8551('0x10')]('VoiceQueue,\x20%s,\x20%s',_0x3dd86e,_0x8551('0x11'));_0x38f77d(_0x10c85e[_0x8551('0x18')][_0x8551('0x17')]);}})[_0x8551('0x19')](function(_0x3d6ceb){logger[_0x8551('0x14')](_0x8551('0x16'),_0x3dd86e,_0x3d6ceb);_0x37b781(_0x3d6ceb);});});}exports[_0x8551('0x1a')]=function(_0x1de1cb){var _0x291d79=this;return new Promise(function(_0xf1f50c,_0x1b6542){return db[_0x8551('0x1b')][_0x8551('0x1c')]({'raw':_0x1de1cb[_0x8551('0x1d')]?_0x1de1cb[_0x8551('0x1d')][_0x8551('0x1e')]===undefined?!![]:![]:!![],'where':_0x1de1cb[_0x8551('0x1d')]?_0x1de1cb['options'][_0x8551('0x1f')]||null:null,'attributes':_0x1de1cb[_0x8551('0x1d')]?_0x1de1cb[_0x8551('0x1d')][_0x8551('0x20')]||null:null,'limit':_0x1de1cb[_0x8551('0x1d')]?_0x1de1cb[_0x8551('0x1d')]['limit']||null:null,'include':_0x1de1cb['options']?_0x1de1cb[_0x8551('0x1d')][_0x8551('0x21')]?_[_0x8551('0x22')](_0x1de1cb[_0x8551('0x1d')][_0x8551('0x21')],function(_0x537816){return{'model':db[_0x537816[_0x8551('0x23')]],'as':_0x537816['as'],'attributes':_0x537816[_0x8551('0x20')],'include':_0x537816[_0x8551('0x21')]?_[_0x8551('0x22')](_0x537816['include'],function(_0x45aba6){return{'model':db[_0x45aba6[_0x8551('0x23')]],'as':_0x45aba6['as'],'attributes':_0x45aba6['attributes'],'include':_0x45aba6[_0x8551('0x21')]?_['map'](_0x45aba6[_0x8551('0x21')],function(_0x24f804){return{'model':db[_0x24f804['model']],'as':_0x24f804['as'],'attributes':_0x24f804[_0x8551('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8551('0x24')](function(_0x41bfc2){logger[_0x8551('0x10')](_0x8551('0x1a'),_0x1de1cb);logger[_0x8551('0x12')](_0x8551('0x1a'),_0x1de1cb,JSON['stringify'](_0x41bfc2));_0xf1f50c(_0x41bfc2);})[_0x8551('0x19')](function(_0x37d86e){logger['error'](_0x8551('0x1a'),_0x37d86e[_0x8551('0x17')],_0x1de1cb);_0x1b6542(_0x291d79[_0x8551('0x14')](0x1f4,_0x37d86e[_0x8551('0x17')]));});});};exports[_0x8551('0x25')]=function(_0x1031ec){var _0x1964b3=this;return new Promise(function(_0x5a0360,_0x2f4d15){return db['VoiceQueue'][_0x8551('0x26')]({'raw':_0x1031ec[_0x8551('0x1d')]?_0x1031ec['options'][_0x8551('0x1e')]===undefined?!![]:![]:!![],'where':_0x1031ec['options']?_0x1031ec[_0x8551('0x1d')][_0x8551('0x1f')]||null:null,'attributes':_0x1031ec[_0x8551('0x1d')]?_0x1031ec[_0x8551('0x1d')][_0x8551('0x20')]||null:null,'include':_0x1031ec['options']?_0x1031ec[_0x8551('0x1d')][_0x8551('0x21')]?_[_0x8551('0x22')](_0x1031ec[_0x8551('0x1d')][_0x8551('0x21')],function(_0xf21158){return{'model':db[_0xf21158[_0x8551('0x23')]],'as':_0xf21158['as'],'attributes':_0xf21158[_0x8551('0x20')],'include':_0xf21158[_0x8551('0x21')]?_[_0x8551('0x22')](_0xf21158[_0x8551('0x21')],function(_0x44b3f3){return{'model':db[_0x44b3f3[_0x8551('0x23')]],'as':_0x44b3f3['as'],'attributes':_0x44b3f3['attributes'],'include':_0x44b3f3[_0x8551('0x21')]?_[_0x8551('0x22')](_0x44b3f3['include'],function(_0x3c3639){return{'model':db[_0x3c3639[_0x8551('0x23')]],'as':_0x3c3639['as'],'attributes':_0x3c3639[_0x8551('0x20')]};}):[]};}):[]};}):[]:[]})[_0x8551('0x24')](function(_0x143b8e){logger['info'](_0x8551('0x25'),_0x1031ec);logger['debug']('ShowVoiceQueue',_0x1031ec,JSON[_0x8551('0x13')](_0x143b8e));_0x5a0360(_0x143b8e);})[_0x8551('0x19')](function(_0x554414){logger['error'](_0x8551('0x25'),_0x554414[_0x8551('0x17')],_0x1031ec);_0x2f4d15(_0x1964b3[_0x8551('0x14')](0x1f4,_0x554414['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 63329fe..fd7ce7f 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 _0xff83=['emit','voiceQueue:','save','remove','update'];(function(_0x1b26ac,_0x5ea577){var _0x2d88ec=function(_0x4d6110){while(--_0x4d6110){_0x1b26ac['push'](_0x1b26ac['shift']());}};_0x2d88ec(++_0x5ea577);}(_0xff83,0x98));var _0x3ff8=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xff83[_0x481bf7];return _0x461787;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x3ff8('0x0'),_0x3ff8('0x1'),_0x3ff8('0x2')];function createListener(_0x3280af,_0x4d8bb8){return function(_0x4db20d){_0x4d8bb8[_0x3ff8('0x3')](_0x3280af,_0x4db20d);};}function removeListener(_0x173f67,_0x3b185d){return function(){VoiceQueueEvents['removeListener'](_0x173f67,_0x3b185d);};}exports['register']=function(_0x163c8c){for(var _0x533bba=0x0,_0x49f70f=events['length'];_0x533bba<_0x49f70f;_0x533bba++){var _0x65158c=events[_0x533bba];var _0x184b3f=createListener(_0x3ff8('0x4')+_0x65158c,_0x163c8c);VoiceQueueEvents['on'](_0x65158c,_0x184b3f);}}; \ No newline at end of file +var _0x45ba=['remove','update','removeListener','length','./voiceQueue.events','save'];(function(_0x18ea8a,_0x32f09f){var _0x19c99a=function(_0x21d8d6){while(--_0x21d8d6){_0x18ea8a['push'](_0x18ea8a['shift']());}};_0x19c99a(++_0x32f09f);}(_0x45ba,0x1c0));var _0xa45b=function(_0x2b77fc,_0x28643c){_0x2b77fc=_0x2b77fc-0x0;var _0x247bc7=_0x45ba[_0x2b77fc];return _0x247bc7;};'use strict';var VoiceQueueEvents=require(_0xa45b('0x0'));var events=[_0xa45b('0x1'),_0xa45b('0x2'),_0xa45b('0x3')];function createListener(_0x2660c6,_0x44f6c6){return function(_0x3f6632){_0x44f6c6['emit'](_0x2660c6,_0x3f6632);};}function removeListener(_0x11a269,_0x247c10){return function(){VoiceQueueEvents[_0xa45b('0x4')](_0x11a269,_0x247c10);};}exports['register']=function(_0x562491){for(var _0x17110b=0x0,_0x58a328=events[_0xa45b('0x5')];_0x17110b<_0x58a328;_0x17110b++){var _0x3d68b2=events[_0x17110b];var _0x56d380=createListener('voiceQueue:'+_0x3d68b2,_0x562491);VoiceQueueEvents['on'](_0x3d68b2,_0x56d380);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 96ed3c3..625c27a 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 _0x8c46=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','/:id','create','update','delete','destroy','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45671d,_0x47d846){var _0x534397=function(_0x337e31){while(--_0x337e31){_0x45671d['push'](_0x45671d['shift']());}};_0x534397(++_0x47d846);}(_0x8c46,0x171));var _0x68c4=function(_0x5af86d,_0xca3ea3){_0x5af86d=_0x5af86d-0x0;var _0x1b9d05=_0x8c46[_0x5af86d];return _0x1b9d05;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x68c4('0x2'));var interaction=require(_0x68c4('0x3'));var config=require(_0x68c4('0x4'));var controller=require(_0x68c4('0x5'));router[_0x68c4('0x6')]('/',auth[_0x68c4('0x7')](),controller[_0x68c4('0x8')]);router[_0x68c4('0x6')](_0x68c4('0x9'),auth[_0x68c4('0x7')](),controller['describe']);router[_0x68c4('0x6')](_0x68c4('0xa'),auth[_0x68c4('0x7')](),controller['getVoiceQueuesReport']);router[_0x68c4('0x6')](_0x68c4('0xb'),auth[_0x68c4('0x7')](),controller['show']);router['post']('/',auth[_0x68c4('0x7')](),controller[_0x68c4('0xc')]);router['put']('/:id',auth[_0x68c4('0x7')](),controller[_0x68c4('0xd')]);router[_0x68c4('0xe')]('/:id',auth[_0x68c4('0x7')](),controller[_0x68c4('0xf')]);module[_0x68c4('0x10')]=router; \ No newline at end of file +var _0x07e8=['describe','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','./voiceQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x2e882c,_0x5a73d9){var _0x4140ed=function(_0x5421d6){while(--_0x5421d6){_0x2e882c['push'](_0x2e882c['shift']());}};_0x4140ed(++_0x5a73d9);}(_0x07e8,0x10f));var _0x807e=function(_0x505ead,_0x2b42da){_0x505ead=_0x505ead-0x0;var _0xa4ad94=_0x07e8[_0x505ead];return _0xa4ad94;};'use strict';var multer=require(_0x807e('0x0'));var util=require(_0x807e('0x1'));var path=require(_0x807e('0x2'));var timeout=require('connect-timeout');var express=require(_0x807e('0x3'));var router=express['Router']();var auth=require(_0x807e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x807e('0x5'));router[_0x807e('0x6')]('/',auth[_0x807e('0x7')](),controller['index']);router[_0x807e('0x6')](_0x807e('0x8'),auth[_0x807e('0x7')](),controller[_0x807e('0x9')]);router[_0x807e('0x6')]('/index',auth[_0x807e('0x7')](),controller[_0x807e('0xa')]);router[_0x807e('0x6')](_0x807e('0xb'),auth[_0x807e('0x7')](),controller[_0x807e('0xc')]);router[_0x807e('0xd')]('/',auth[_0x807e('0x7')](),controller[_0x807e('0xe')]);router[_0x807e('0xf')](_0x807e('0xb'),auth[_0x807e('0x7')](),controller[_0x807e('0x10')]);router[_0x807e('0x11')]('/:id',auth[_0x807e('0x7')](),controller[_0x807e('0x12')]);module[_0x807e('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 36a64ef..b553b3c 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 _0x0b6b=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b6b,0x125));var _0xb0b6=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x0b6b[_0x3e0b8f];return _0x22f742;};'use strict';var Sequelize=require(_0xb0b6('0x0'));var moment=require('moment');module[_0xb0b6('0x1')]={'type':{'type':Sequelize[_0xb0b6('0x2')]},'uniqueid':{'type':Sequelize[_0xb0b6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb0b6('0x2')]},'queue':{'type':Sequelize[_0xb0b6('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xb0b6('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xb0b6('0x3')],'set':function(_0x595b26){var _0x2910cf=moment(_0x595b26);var _0x43f31d=moment(this[_0xb0b6('0x4')](_0xb0b6('0x5')))['format'](_0xb0b6('0x6'));var _0x398846=_0x2910cf[_0xb0b6('0x7')](_0x43f31d,_0xb0b6('0x8'));this[_0xb0b6('0x9')](_0xb0b6('0xa'),_0x595b26);this[_0xb0b6('0x9')](_0xb0b6('0xb'),_0x398846||null);}},'position':{'type':Sequelize[_0xb0b6('0xc')]},'count':{'type':Sequelize[_0xb0b6('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb0b6('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xb0b6('0x2')],'comment':_0xb0b6('0xe')},'originalposition':{'type':Sequelize[_0xb0b6('0xc')]},'channel':{'type':Sequelize[_0xb0b6('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb0b6('0x2')]},'accountcode':{'type':Sequelize[_0xb0b6('0x2')]},'context':{'type':Sequelize[_0xb0b6('0x2')]},'exten':{'type':Sequelize[_0xb0b6('0x2')]},'priority':{'type':Sequelize[_0xb0b6('0x2')]},'holdtime':{'type':Sequelize[_0xb0b6('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb0b6('0x2')],'comment':_0xb0b6('0xf')},'transferexten':{'type':Sequelize[_0xb0b6('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xb0b6('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x097b=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','diff','seconds','setDataValue'];(function(_0x1e1020,_0xd64a27){var _0x464719=function(_0x376ffa){while(--_0x376ffa){_0x1e1020['push'](_0x1e1020['shift']());}};_0x464719(++_0xd64a27);}(_0x097b,0x147));var _0xb097=function(_0x5f2f96,_0x251343){_0x5f2f96=_0x5f2f96-0x0;var _0x1d6045=_0x097b[_0x5f2f96];return _0x1d6045;};'use strict';var Sequelize=require(_0xb097('0x0'));var moment=require(_0xb097('0x1'));module[_0xb097('0x2')]={'type':{'type':Sequelize[_0xb097('0x3')]},'uniqueid':{'type':Sequelize[_0xb097('0x3')]},'calleridnum':{'type':Sequelize[_0xb097('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xb097('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0xb097('0x4')],'set':function(_0xc2fc0a){var _0x54d732=moment(_0xc2fc0a);var _0x2ea325=moment(this[_0xb097('0x5')]('queuecallerjoinAt'))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x3b0d69=_0x54d732[_0xb097('0x6')](_0x2ea325,_0xb097('0x7'));this[_0xb097('0x8')]('queuecallerleaveAt',_0xc2fc0a);this[_0xb097('0x8')](_0xb097('0x9'),_0x3b0d69||null);}},'position':{'type':Sequelize[_0xb097('0xa')]},'count':{'type':Sequelize[_0xb097('0xa')]},'queuecallerabandon':{'type':Sequelize[_0xb097('0xb')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xb097('0xb')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb097('0x4')]},'queuecallerexit':{'type':Sequelize[_0xb097('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb097('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xb097('0xc')},'originalposition':{'type':Sequelize[_0xb097('0xa')]},'channel':{'type':Sequelize[_0xb097('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb097('0x3')]},'accountcode':{'type':Sequelize[_0xb097('0x3')]},'context':{'type':Sequelize[_0xb097('0x3')]},'exten':{'type':Sequelize[_0xb097('0x3')]},'priority':{'type':Sequelize[_0xb097('0x3')]},'holdtime':{'type':Sequelize[_0xb097('0xa')]},'mohtime':{'type':Sequelize[_0xb097('0xa')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb097('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xb097('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb097('0x3')],'comment':_0xb097('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb097('0x3')]},'disposition':{'type':Sequelize[_0xb097('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0xb097('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 73a0546..23a73bb 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 _0x66fa=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','includeAll','include','findAll','rows','show','params','intersection','options','find','catch','create','body','getVoiceQueuesReport','pick','filter','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x66fa,0x117));var _0xa66f=function(_0x484b23,_0x4178ca){_0x484b23=_0x484b23-0x0;var _0x68ca36=_0x66fa[_0x484b23];return _0x68ca36;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var moment=require(_0xa66f('0x5'));var BPromise=require(_0xa66f('0x6'));var Mustache=require(_0xa66f('0x7'));var util=require(_0xa66f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var db=require(_0xa66f('0x14'))['db'];config['redis']=_[_0xa66f('0x15')](config[_0xa66f('0x16')],{'host':_0xa66f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa66f('0x18'))['register'](socket);function respondWithStatusCode(_0x528427,_0x5a7b16){_0x5a7b16=_0x5a7b16||0xcc;return function(_0x3ac0ac){if(_0x3ac0ac){return _0x528427[_0xa66f('0x19')](_0x5a7b16);}return _0x528427[_0xa66f('0x1a')](_0x5a7b16)[_0xa66f('0x1b')]();};}function respondWithResult(_0xd348f9,_0x567d4f){_0x567d4f=_0x567d4f||0xc8;return function(_0x5510dc){if(_0x5510dc){return _0xd348f9[_0xa66f('0x1a')](_0x567d4f)[_0xa66f('0x1c')](_0x5510dc);}};}function respondWithFilteredResult(_0x295acf,_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){var _0x1cbe64=_0x5c67f5[_0xa66f('0x1d')],_0x55b59d=_0x403f4d[_0xa66f('0x1e')],_0x4a28d4=_0x403f4d[_0xa66f('0x1e')]+_0x403f4d[_0xa66f('0x1f')],_0x2f9da2;if(_0x4a28d4>=_0x1cbe64){_0x4a28d4=_0x1cbe64;_0x2f9da2=0xc8;}else{_0x2f9da2=0xce;}_0x295acf[_0xa66f('0x1a')](_0x2f9da2);return _0x295acf[_0xa66f('0x20')](_0xa66f('0x21'),_0x55b59d+'-'+_0x4a28d4+'/'+_0x1cbe64)[_0xa66f('0x1c')](_0x5c67f5);}return null;};}function patchUpdates(_0x2d9602){return function(_0x235b61){try{jsonpatch[_0xa66f('0x22')](_0x235b61,_0x2d9602,!![]);}catch(_0x3c4eb1){return BPromise[_0xa66f('0x23')](_0x3c4eb1);}return _0x235b61[_0xa66f('0x24')]();};}function saveUpdates(_0x5cd613,_0x27f570){return function(_0xc5c82e){if(_0xc5c82e){return _0xc5c82e[_0xa66f('0x25')](_0x5cd613)[_0xa66f('0x26')](function(_0x5cbd82){return _0x5cbd82;});}return null;};}function removeEntity(_0x337602,_0x473822){return function(_0x209f4d){if(_0x209f4d){return _0x209f4d[_0xa66f('0x27')]()['then'](function(){_0x337602['status'](0xcc)[_0xa66f('0x1b')]();});}};}function handleEntityNotFound(_0x598942,_0x3a3e4f){return function(_0xc661f2){if(!_0xc661f2){_0x598942[_0xa66f('0x19')](0x194);}return _0xc661f2;};}function handleError(_0x57da7f,_0x4683c7){_0x4683c7=_0x4683c7||0x1f4;return function(_0x1c2903){logger[_0xa66f('0x28')](_0x1c2903[_0xa66f('0x29')]);if(_0x1c2903[_0xa66f('0x2a')]){delete _0x1c2903[_0xa66f('0x2a')];}_0x57da7f[_0xa66f('0x1a')](_0x4683c7)[_0xa66f('0x2b')](_0x1c2903);};}exports[_0xa66f('0x2c')]=function(_0x117d03,_0x45f71c){var _0x63650b={},_0x42b966={},_0xeeb22e={'count':0x0,'rows':[]};var _0x49f615=_['map'](db[_0xa66f('0x2d')][_0xa66f('0x2e')],function(_0x55f309){return{'name':_0x55f309[_0xa66f('0x2f')],'type':_0x55f309[_0xa66f('0x30')]['key']};});_0x42b966[_0xa66f('0x31')]=_[_0xa66f('0x32')](_0x49f615,_0xa66f('0x2a'));_0x42b966[_0xa66f('0x33')]=_[_0xa66f('0x34')](_0x117d03['query']);_0x42b966[_0xa66f('0x35')]=_['intersection'](_0x42b966[_0xa66f('0x31')],_0x42b966[_0xa66f('0x33')]);_0x63650b[_0xa66f('0x36')]=_['intersection'](_0x42b966[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x117d03['query'][_0xa66f('0x37')]));_0x63650b[_0xa66f('0x36')]=_0x63650b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x63650b[_0xa66f('0x36')]:_0x42b966[_0xa66f('0x31')];if(!_0x117d03[_0xa66f('0x33')][_0xa66f('0x39')](_0xa66f('0x3a'))){_0x63650b[_0xa66f('0x1f')]=qs['limit'](_0x117d03[_0xa66f('0x33')]['limit']);_0x63650b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x63650b[_0xa66f('0x3b')]=qs[_0xa66f('0x3c')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x63650b['where']=qs[_0xa66f('0x35')](_['pick'](_0x117d03[_0xa66f('0x33')],_0x42b966[_0xa66f('0x35')]));if(_0x117d03[_0xa66f('0x33')]['filter']){_0x63650b['where']=_[_0xa66f('0x3d')](_0x63650b[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x32')](_0x49f615,function(_0x1f5a5f){if(_0x1f5a5f[_0xa66f('0x30')]!=='VIRTUAL'){var _0x5cb0a9={};_0x5cb0a9[_0x1f5a5f['name']]={'$like':'%'+_0x117d03[_0xa66f('0x33')]['filter']+'%'};return _0x5cb0a9;}})});}_0x63650b=_['merge']({},_0x63650b,_0x117d03['options']);var _0x5fdc3e={'where':_0x63650b['where']};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x5fdc3e)[_0xa66f('0x26')](function(_0x1647a0){_0xeeb22e[_0xa66f('0x1d')]=_0x1647a0;if(_0x117d03[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x63650b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x63650b);})[_0xa66f('0x26')](function(_0x93f6ff){_0xeeb22e[_0xa66f('0x42')]=_0x93f6ff;return _0xeeb22e;})[_0xa66f('0x26')](respondWithFilteredResult(_0x45f71c,_0x63650b))['catch'](handleError(_0x45f71c,null));};exports[_0xa66f('0x43')]=function(_0x25c2cb,_0x58c1f2){var _0x248587={'raw':![],'where':{'id':_0x25c2cb[_0xa66f('0x44')]['id']}},_0x4b6e6b={};_0x4b6e6b[_0xa66f('0x31')]=_['keys'](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0x4b6e6b[_0xa66f('0x33')]=_['keys'](_0x25c2cb[_0xa66f('0x33')]);_0x4b6e6b['filters']=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],_0x4b6e6b[_0xa66f('0x33')]);_0x248587[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x25c2cb['query'][_0xa66f('0x37')]));_0x248587[_0xa66f('0x36')]=_0x248587[_0xa66f('0x36')][_0xa66f('0x38')]?_0x248587[_0xa66f('0x36')]:_0x4b6e6b['model'];if(_0x25c2cb['query'][_0xa66f('0x3f')]){_0x248587[_0xa66f('0x40')]=[{'all':!![]}];}_0x248587=_[_0xa66f('0x3d')]({},_0x248587,_0x25c2cb[_0xa66f('0x46')]);return db[_0xa66f('0x2d')][_0xa66f('0x47')](_0x248587)['then'](handleEntityNotFound(_0x58c1f2,null))[_0xa66f('0x26')](respondWithResult(_0x58c1f2,null))[_0xa66f('0x48')](handleError(_0x58c1f2,null));};exports[_0xa66f('0x49')]=function(_0x5651e9,_0x57c8a0){return db[_0xa66f('0x2d')][_0xa66f('0x49')](_0x5651e9[_0xa66f('0x4a')],{})['then'](respondWithResult(_0x57c8a0,0xc9))['catch'](handleError(_0x57c8a0,null));};exports['update']=function(_0x19e7ce,_0x35e477){if(_0x19e7ce[_0xa66f('0x4a')]['id']){delete _0x19e7ce[_0xa66f('0x4a')]['id'];}return db[_0xa66f('0x2d')][_0xa66f('0x47')]({'where':{'id':_0x19e7ce[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x35e477,null))['then'](saveUpdates(_0x19e7ce[_0xa66f('0x4a')],null))[_0xa66f('0x26')](respondWithResult(_0x35e477,null))[_0xa66f('0x48')](handleError(_0x35e477,null));};exports[_0xa66f('0x27')]=function(_0x11597b,_0x33cdc7){return db['VoiceQueueReport'][_0xa66f('0x47')]({'where':{'id':_0x11597b[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x33cdc7,null))[_0xa66f('0x26')](removeEntity(_0x33cdc7,null))[_0xa66f('0x48')](handleError(_0x33cdc7,null));};exports['describe']=function(_0x389b9a,_0x50e0cd){return db[_0xa66f('0x2d')]['describe']()['then'](respondWithResult(_0x50e0cd,null))[_0xa66f('0x48')](handleError(_0x50e0cd,null));};exports[_0xa66f('0x4b')]=function(_0x12271d,_0x2c79df){var _0x35ed5b={},_0xe97cf4={},_0x53a62f={'count':0x0,'rows':[]};_0xe97cf4[_0xa66f('0x31')]=_[_0xa66f('0x34')](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0xe97cf4['query']=_[_0xa66f('0x34')](_0x12271d['query']);_0xe97cf4[_0xa66f('0x35')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],_0xe97cf4[_0xa66f('0x33')]);_0x35ed5b[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],qs['fields'](_0x12271d[_0xa66f('0x33')][_0xa66f('0x37')]));_0x35ed5b[_0xa66f('0x36')]=_0x35ed5b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x35ed5b[_0xa66f('0x36')]:_0xe97cf4[_0xa66f('0x31')];if(!_0x12271d[_0xa66f('0x33')][_0xa66f('0x39')]('nolimit')){_0x35ed5b['limit']=qs[_0xa66f('0x1f')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1f')]);_0x35ed5b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x35ed5b['order']=qs[_0xa66f('0x3c')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x35ed5b[_0xa66f('0x3e')]=qs['filters'](_[_0xa66f('0x4c')](_0x12271d[_0xa66f('0x33')],_0xe97cf4[_0xa66f('0x35')]));if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]){_0x35ed5b[_0xa66f('0x3e')]=_['merge'](_0x35ed5b['where'],{'$or':_[_0xa66f('0x32')](_0x35ed5b[_0xa66f('0x36')],function(_0x174aad){var _0x52edb3={};_0x52edb3[_0x174aad]={'$like':'%'+_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]+'%'};return _0x52edb3;})});}_0x35ed5b=_[_0xa66f('0x3d')]({},_0x35ed5b,_0x12271d[_0xa66f('0x46')]);var _0x17b2cf={'where':_0x35ed5b[_0xa66f('0x3e')]};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x17b2cf)[_0xa66f('0x26')](function(_0x5d4299){_0x53a62f[_0xa66f('0x1d')]=_0x5d4299;if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x35ed5b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x35ed5b);})[_0xa66f('0x26')](function(_0x3b38ad){_0x53a62f['rows']=_0x3b38ad;return _0x53a62f;})['then'](respondWithFilteredResult(_0x2c79df,_0x35ed5b,_0xa66f('0x4b')))[_0xa66f('0x48')](handleError(_0x2c79df,null,_0xa66f('0x4b')));}; \ No newline at end of file +var _0x0295=['offset','Content-Range','reject','update','then','error','stack','name','send','VoiceQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','pick','options','getVoiceQueuesReport','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','./voiceQueueReport.socket','register','sendStatus','status','end','json','count'];(function(_0x45aef9,_0x12ab1f){var _0x678851=function(_0x8f59f2){while(--_0x8f59f2){_0x45aef9['push'](_0x45aef9['shift']());}};_0x678851(++_0x12ab1f);}(_0x0295,0x1f0));var _0x5029=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0x0295[_0x75ce5b];return _0x22195e;};'use strict';var pdf=require(_0x5029('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5029('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5029('0x2'));var BPromise=require(_0x5029('0x3'));var Mustache=require(_0x5029('0x4'));var util=require(_0x5029('0x5'));var path=require(_0x5029('0x6'));var sox=require(_0x5029('0x7'));var csv=require(_0x5029('0x8'));var ejs=require(_0x5029('0x9'));var fs=require('fs');var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var db=require('../../mysqldb')['db'];config[_0x5029('0x14')]=_[_0x5029('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5029('0x16'))[_0x5029('0x17')](socket);function respondWithStatusCode(_0x12c237,_0x434630){_0x434630=_0x434630||0xcc;return function(_0x2c0b33){if(_0x2c0b33){return _0x12c237[_0x5029('0x18')](_0x434630);}return _0x12c237[_0x5029('0x19')](_0x434630)[_0x5029('0x1a')]();};}function respondWithResult(_0x10bf55,_0x326923){_0x326923=_0x326923||0xc8;return function(_0x457c73){if(_0x457c73){return _0x10bf55[_0x5029('0x19')](_0x326923)[_0x5029('0x1b')](_0x457c73);}};}function respondWithFilteredResult(_0x2c273c,_0x343918){return function(_0x4f7ab4){if(_0x4f7ab4){var _0x1ed567=_0x4f7ab4[_0x5029('0x1c')],_0x31a155=_0x343918[_0x5029('0x1d')],_0x35de81=_0x343918[_0x5029('0x1d')]+_0x343918['limit'],_0x4902f3;if(_0x35de81>=_0x1ed567){_0x35de81=_0x1ed567;_0x4902f3=0xc8;}else{_0x4902f3=0xce;}_0x2c273c[_0x5029('0x19')](_0x4902f3);return _0x2c273c['set'](_0x5029('0x1e'),_0x31a155+'-'+_0x35de81+'/'+_0x1ed567)[_0x5029('0x1b')](_0x4f7ab4);}return null;};}function patchUpdates(_0x2710aa){return function(_0x3cf0fb){try{jsonpatch['apply'](_0x3cf0fb,_0x2710aa,!![]);}catch(_0x47ecca){return BPromise[_0x5029('0x1f')](_0x47ecca);}return _0x3cf0fb['save']();};}function saveUpdates(_0x3f657d,_0x853a34){return function(_0x1eb228){if(_0x1eb228){return _0x1eb228[_0x5029('0x20')](_0x3f657d)[_0x5029('0x21')](function(_0x3a3e52){return _0x3a3e52;});}return null;};}function removeEntity(_0x125c26,_0x356dac){return function(_0x3e857d){if(_0x3e857d){return _0x3e857d['destroy']()['then'](function(){_0x125c26['status'](0xcc)[_0x5029('0x1a')]();});}};}function handleEntityNotFound(_0x45666c,_0x51093c){return function(_0x5727e9){if(!_0x5727e9){_0x45666c[_0x5029('0x18')](0x194);}return _0x5727e9;};}function handleError(_0x1e7e61,_0x36d810){_0x36d810=_0x36d810||0x1f4;return function(_0x5527fc){logger[_0x5029('0x22')](_0x5527fc[_0x5029('0x23')]);if(_0x5527fc['name']){delete _0x5527fc[_0x5029('0x24')];}_0x1e7e61[_0x5029('0x19')](_0x36d810)[_0x5029('0x25')](_0x5527fc);};}exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={},_0x4b6f92={},_0x2cedf6={'count':0x0,'rows':[]};var _0x2bb398=_['map'](db[_0x5029('0x26')][_0x5029('0x27')],function(_0x4434ff){return{'name':_0x4434ff[_0x5029('0x28')],'type':_0x4434ff[_0x5029('0x29')][_0x5029('0x2a')]};});_0x4b6f92[_0x5029('0x2b')]=_[_0x5029('0x2c')](_0x2bb398,_0x5029('0x24'));_0x4b6f92[_0x5029('0x2d')]=_[_0x5029('0x2e')](_0x32da06[_0x5029('0x2d')]);_0x4b6f92['filters']=_[_0x5029('0x2f')](_0x4b6f92['model'],_0x4b6f92[_0x5029('0x2d')]);_0xe5313e['attributes']=_['intersection'](_0x4b6f92[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x32da06[_0x5029('0x2d')]['fields']));_0xe5313e[_0x5029('0x31')]=_0xe5313e[_0x5029('0x31')][_0x5029('0x32')]?_0xe5313e[_0x5029('0x31')]:_0x4b6f92[_0x5029('0x2b')];if(!_0x32da06[_0x5029('0x2d')][_0x5029('0x33')](_0x5029('0x34'))){_0xe5313e[_0x5029('0x35')]=qs['limit'](_0x32da06[_0x5029('0x2d')][_0x5029('0x35')]);_0xe5313e[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x32da06['query'][_0x5029('0x1d')]);}_0xe5313e[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x32da06['query']['sort']);_0xe5313e[_0x5029('0x38')]=qs[_0x5029('0x39')](_['pick'](_0x32da06['query'],_0x4b6f92[_0x5029('0x39')]));if(_0x32da06[_0x5029('0x2d')][_0x5029('0x3a')]){_0xe5313e[_0x5029('0x38')]=_[_0x5029('0x3b')](_0xe5313e[_0x5029('0x38')],{'$or':_[_0x5029('0x2c')](_0x2bb398,function(_0x2f13b1){if(_0x2f13b1[_0x5029('0x29')]!==_0x5029('0x3c')){var _0x3e5b67={};_0x3e5b67[_0x2f13b1[_0x5029('0x24')]]={'$like':'%'+_0x32da06[_0x5029('0x2d')][_0x5029('0x3a')]+'%'};return _0x3e5b67;}})});}_0xe5313e=_['merge']({},_0xe5313e,_0x32da06['options']);var _0x73797c={'where':_0xe5313e[_0x5029('0x38')]};return db[_0x5029('0x26')]['count'](_0x73797c)[_0x5029('0x21')](function(_0x39b216){_0x2cedf6['count']=_0x39b216;if(_0x32da06[_0x5029('0x2d')]['includeAll']){_0xe5313e[_0x5029('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5029('0x3e')](_0xe5313e);})[_0x5029('0x21')](function(_0x24a18d){_0x2cedf6[_0x5029('0x3f')]=_0x24a18d;return _0x2cedf6;})[_0x5029('0x21')](respondWithFilteredResult(_0x251f99,_0xe5313e))[_0x5029('0x40')](handleError(_0x251f99,null));};exports[_0x5029('0x41')]=function(_0x1021ea,_0x2ae047){var _0x5a3e4d={'raw':![],'where':{'id':_0x1021ea[_0x5029('0x42')]['id']}},_0x103dfb={};_0x103dfb[_0x5029('0x2b')]=_[_0x5029('0x2e')](db[_0x5029('0x26')][_0x5029('0x27')]);_0x103dfb['query']=_[_0x5029('0x2e')](_0x1021ea[_0x5029('0x2d')]);_0x103dfb[_0x5029('0x39')]=_[_0x5029('0x2f')](_0x103dfb[_0x5029('0x2b')],_0x103dfb['query']);_0x5a3e4d[_0x5029('0x31')]=_[_0x5029('0x2f')](_0x103dfb[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x1021ea[_0x5029('0x2d')][_0x5029('0x30')]));_0x5a3e4d[_0x5029('0x31')]=_0x5a3e4d[_0x5029('0x31')][_0x5029('0x32')]?_0x5a3e4d['attributes']:_0x103dfb[_0x5029('0x2b')];if(_0x1021ea[_0x5029('0x2d')][_0x5029('0x43')]){_0x5a3e4d[_0x5029('0x3d')]=[{'all':!![]}];}_0x5a3e4d=_['merge']({},_0x5a3e4d,_0x1021ea['options']);return db[_0x5029('0x26')][_0x5029('0x44')](_0x5a3e4d)[_0x5029('0x21')](handleEntityNotFound(_0x2ae047,null))[_0x5029('0x21')](respondWithResult(_0x2ae047,null))[_0x5029('0x40')](handleError(_0x2ae047,null));};exports[_0x5029('0x45')]=function(_0x2bb7fc,_0x19a6ca){return db[_0x5029('0x26')][_0x5029('0x45')](_0x2bb7fc[_0x5029('0x46')],{})[_0x5029('0x21')](respondWithResult(_0x19a6ca,0xc9))[_0x5029('0x40')](handleError(_0x19a6ca,null));};exports[_0x5029('0x20')]=function(_0x3168bd,_0x175cc0){if(_0x3168bd[_0x5029('0x46')]['id']){delete _0x3168bd[_0x5029('0x46')]['id'];}return db[_0x5029('0x26')][_0x5029('0x44')]({'where':{'id':_0x3168bd[_0x5029('0x42')]['id']}})['then'](handleEntityNotFound(_0x175cc0,null))[_0x5029('0x21')](saveUpdates(_0x3168bd['body'],null))[_0x5029('0x21')](respondWithResult(_0x175cc0,null))[_0x5029('0x40')](handleError(_0x175cc0,null));};exports['destroy']=function(_0x5343c6,_0x319bff){return db['VoiceQueueReport']['find']({'where':{'id':_0x5343c6[_0x5029('0x42')]['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x319bff,null))[_0x5029('0x21')](removeEntity(_0x319bff,null))['catch'](handleError(_0x319bff,null));};exports['describe']=function(_0x1510bb,_0x3d4e9a){return db['VoiceQueueReport'][_0x5029('0x47')]()['then'](respondWithResult(_0x3d4e9a,null))[_0x5029('0x40')](handleError(_0x3d4e9a,null));};exports['getVoiceQueuesReport']=function(_0x2340b0,_0x27e1c0){var _0x358c8a={},_0x6d03b2={},_0x42609={'count':0x0,'rows':[]};_0x6d03b2[_0x5029('0x2b')]=_[_0x5029('0x2e')](db[_0x5029('0x26')]['rawAttributes']);_0x6d03b2[_0x5029('0x2d')]=_['keys'](_0x2340b0[_0x5029('0x2d')]);_0x6d03b2[_0x5029('0x39')]=_['intersection'](_0x6d03b2[_0x5029('0x2b')],_0x6d03b2['query']);_0x358c8a['attributes']=_['intersection'](_0x6d03b2[_0x5029('0x2b')],qs['fields'](_0x2340b0[_0x5029('0x2d')][_0x5029('0x30')]));_0x358c8a[_0x5029('0x31')]=_0x358c8a['attributes'][_0x5029('0x32')]?_0x358c8a['attributes']:_0x6d03b2['model'];if(!_0x2340b0[_0x5029('0x2d')][_0x5029('0x33')](_0x5029('0x34'))){_0x358c8a[_0x5029('0x35')]=qs[_0x5029('0x35')](_0x2340b0['query'][_0x5029('0x35')]);_0x358c8a[_0x5029('0x1d')]=qs[_0x5029('0x1d')](_0x2340b0[_0x5029('0x2d')]['offset']);}_0x358c8a[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x2340b0['query']['sort']);_0x358c8a[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x48')](_0x2340b0[_0x5029('0x2d')],_0x6d03b2['filters']));if(_0x2340b0[_0x5029('0x2d')][_0x5029('0x3a')]){_0x358c8a[_0x5029('0x38')]=_[_0x5029('0x3b')](_0x358c8a[_0x5029('0x38')],{'$or':_[_0x5029('0x2c')](_0x358c8a['attributes'],function(_0x560324){var _0x4314c0={};_0x4314c0[_0x560324]={'$like':'%'+_0x2340b0[_0x5029('0x2d')][_0x5029('0x3a')]+'%'};return _0x4314c0;})});}_0x358c8a=_['merge']({},_0x358c8a,_0x2340b0[_0x5029('0x49')]);var _0x2d439a={'where':_0x358c8a[_0x5029('0x38')]};return db[_0x5029('0x26')][_0x5029('0x1c')](_0x2d439a)['then'](function(_0x2ec5d0){_0x42609[_0x5029('0x1c')]=_0x2ec5d0;if(_0x2340b0[_0x5029('0x2d')]['includeAll']){_0x358c8a[_0x5029('0x3d')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5029('0x3e')](_0x358c8a);})['then'](function(_0xff558b){_0x42609[_0x5029('0x3f')]=_0xff558b;return _0x42609;})[_0x5029('0x21')](respondWithFilteredResult(_0x27e1c0,_0x358c8a,_0x5029('0x4a')))[_0x5029('0x40')](handleError(_0x27e1c0,null,_0x5029('0x4a')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index f531b1e..579fa35 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 _0x088c=['VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x13825a,_0x2af56e){var _0x14879c=function(_0x4deb76){while(--_0x4deb76){_0x13825a['push'](_0x13825a['shift']());}};_0x14879c(++_0x2af56e);}(_0x088c,0x1c1));var _0xc088=function(_0x347dff,_0x162d0b){_0x347dff=_0x347dff-0x0;var _0xcc0a3d=_0x088c[_0x347dff];return _0xcc0a3d;};'use strict';var EventEmitter=require(_0xc088('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xc088('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc088('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc088('0x3'),'afterDestroy':_0xc088('0x4')};function emitEvent(_0x19972f){return function(_0x4e8cca,_0x287940,_0x1d830e){VoiceQueueReportEvents[_0xc088('0x5')](_0x19972f+':'+_0x4e8cca['id'],_0x4e8cca);VoiceQueueReportEvents[_0xc088('0x5')](_0x19972f,_0x4e8cca);_0x1d830e(null);};}for(var e in events){if(events[_0xc088('0x6')](e)){var event=events[e];VoiceQueueReport[_0xc088('0x7')](e,emitEvent(event));}}module[_0xc088('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xad3b=['setMaxListeners','save','remove','hasOwnProperty','exports','../../mysqldb','VoiceQueueReport'];(function(_0x54cc15,_0x42d875){var _0x2b2054=function(_0x1201b4){while(--_0x1201b4){_0x54cc15['push'](_0x54cc15['shift']());}};_0x2b2054(++_0x42d875);}(_0xad3b,0xec));var _0xbad3=function(_0x414658,_0x32591f){_0x414658=_0x414658-0x0;var _0x3f33b8=_0xad3b[_0x414658];return _0x3f33b8;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xbad3('0x0'))['db'][_0xbad3('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbad3('0x2')](0x0);var events={'afterCreate':_0xbad3('0x3'),'afterUpdate':'update','afterDestroy':_0xbad3('0x4')};function emitEvent(_0x42acd7){return function(_0x30aa9f,_0x340163,_0x2f6abb){VoiceQueueReportEvents['emit'](_0x42acd7+':'+_0x30aa9f['id'],_0x30aa9f);VoiceQueueReportEvents['emit'](_0x42acd7,_0x30aa9f);_0x2f6abb(null);};}for(var e in events){if(events[_0xbad3('0x5')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xbad3('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index acd50ac..c708026 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 _0x757a=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x206a49,_0x5b0161){var _0xbf0486=function(_0x36b744){while(--_0x36b744){_0x206a49['push'](_0x206a49['shift']());}};_0xbf0486(++_0x5b0161);}(_0x757a,0xde));var _0xa757=function(_0xc3c76f,_0x18de01){_0xc3c76f=_0xc3c76f-0x0;var _0x2ce254=_0x757a[_0xc3c76f];return _0x2ce254;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('VoiceQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa757('0xa')]},{'fields':[_0xa757('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb10b=['define','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x29ecbc,_0x2929d9){var _0x5709b0=function(_0x277721){while(--_0x277721){_0x29ecbc['push'](_0x29ecbc['shift']());}};_0x5709b0(++_0x2929d9);}(_0xb10b,0x12a));var _0xbb10=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0xb10b[_0x2181fc];return _0x315da1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbb10('0xc')]},{'fields':[_0xbb10('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index eb5b966..f5a45ce 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 _0xa21f=['stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','create','body','debug','UpdateVoiceQueueReport','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa21f,0x6b));var _0xfa21=function(_0x462513,_0x91df8d){_0x462513=_0x462513-0x0;var _0x28926f=_0xa21f[_0x462513];return _0x28926f;};'use strict';var _=require(_0xfa21('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa21('0x1'));var rs=require(_0xfa21('0x2'));var fs=require('fs');var Redis=require(_0xfa21('0x3'));var db=require(_0xfa21('0x4'))['db'];var utils=require(_0xfa21('0x5'));var logger=require(_0xfa21('0x6'))(_0xfa21('0x7'));var config=require(_0xfa21('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfa21('0x9')][_0xfa21('0xa')]({'port':0x232a});config[_0xfa21('0xb')]=_['defaults'](config[_0xfa21('0xb')],{'host':_0xfa21('0xc'),'port':0x18eb});var socket=require(_0xfa21('0xd'))(new Redis(config['redis']));require(_0xfa21('0xe'))[_0xfa21('0xf')](socket);function respondWithRpcPromise(_0x20dfde,_0x112221,_0x5b5ecf){return new BPromise(function(_0x13b95e,_0x5d12c3){return client[_0xfa21('0x10')](_0x20dfde,_0x5b5ecf)[_0xfa21('0x11')](function(_0x1f4b98){logger[_0xfa21('0x12')](_0xfa21('0x13'),_0x112221,_0xfa21('0x14'));logger['debug'](_0xfa21('0x15'),_0x112221,'request\x20sent',JSON[_0xfa21('0x16')](_0x1f4b98));if(_0x1f4b98[_0xfa21('0x17')]){if(_0x1f4b98[_0xfa21('0x17')]['code']===0x1f4){logger[_0xfa21('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x112221,_0x1f4b98[_0xfa21('0x17')][_0xfa21('0x18')]);return _0x5d12c3(_0x1f4b98[_0xfa21('0x17')][_0xfa21('0x18')]);}logger['error'](_0xfa21('0x13'),_0x112221,_0x1f4b98[_0xfa21('0x17')]['message']);return _0x13b95e(_0x1f4b98[_0xfa21('0x17')]['message']);}else{logger[_0xfa21('0x12')](_0xfa21('0x13'),_0x112221,_0xfa21('0x14'));_0x13b95e(_0x1f4b98[_0xfa21('0x19')][_0xfa21('0x18')]);}})[_0xfa21('0x1a')](function(_0x26f087){logger[_0xfa21('0x17')](_0xfa21('0x13'),_0x112221,_0x26f087);_0x5d12c3(_0x26f087);});});}exports[_0xfa21('0x1b')]=function(_0x79cd77){var _0x362e7f=this;return new Promise(function(_0x514fc6,_0x574d0c){return db[_0xfa21('0x1c')][_0xfa21('0x1d')]({'raw':_0x79cd77[_0xfa21('0x1e')]?_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x1f')]===undefined?!![]:![]:!![],'where':_0x79cd77['options']?_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x20')]||null:null,'attributes':_0x79cd77[_0xfa21('0x1e')]?_0x79cd77['options'][_0xfa21('0x21')]||null:null,'limit':_0x79cd77['options']?_0x79cd77['options']['limit']||null:null,'include':_0x79cd77[_0xfa21('0x1e')]?_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x22')]?_[_0xfa21('0x23')](_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x22')],function(_0x3e7798){return{'model':db[_0x3e7798[_0xfa21('0x24')]],'as':_0x3e7798['as'],'attributes':_0x3e7798['attributes'],'include':_0x3e7798[_0xfa21('0x22')]?_[_0xfa21('0x23')](_0x3e7798[_0xfa21('0x22')],function(_0x342af2){return{'model':db[_0x342af2[_0xfa21('0x24')]],'as':_0x342af2['as'],'attributes':_0x342af2['attributes'],'include':_0x342af2[_0xfa21('0x22')]?_[_0xfa21('0x23')](_0x342af2[_0xfa21('0x22')],function(_0xd5238){return{'model':db[_0xd5238[_0xfa21('0x24')]],'as':_0xd5238['as'],'attributes':_0xd5238[_0xfa21('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfa21('0x11')](function(_0x45de85){logger['info'](_0xfa21('0x1b'),_0x79cd77);logger['debug'](_0xfa21('0x1b'),_0x79cd77,JSON[_0xfa21('0x16')](_0x45de85));_0x514fc6(_0x45de85);})['catch'](function(_0x3dad0e){logger['error'](_0xfa21('0x1b'),_0x3dad0e['message'],_0x79cd77);_0x574d0c(_0x362e7f['error'](0x1f4,_0x3dad0e[_0xfa21('0x18')]));});});};exports[_0xfa21('0x25')]=function(_0x3a7ae7){var _0x345661=this;return new Promise(function(_0x331b8a,_0x500129){return db[_0xfa21('0x1c')][_0xfa21('0x26')](_0x3a7ae7[_0xfa21('0x27')],{'raw':_0x3a7ae7[_0xfa21('0x1e')]?_0x3a7ae7[_0xfa21('0x1e')][_0xfa21('0x1f')]===undefined?!![]:![]:!![]})[_0xfa21('0x11')](function(_0x80620e){logger[_0xfa21('0x12')](_0xfa21('0x25'),_0x3a7ae7);logger[_0xfa21('0x28')](_0xfa21('0x25'),_0x3a7ae7,JSON[_0xfa21('0x16')](_0x80620e));_0x331b8a(_0x80620e);})['catch'](function(_0x4beca5){logger[_0xfa21('0x17')](_0xfa21('0x25'),_0x4beca5['message'],_0x3a7ae7);_0x500129(_0x345661[_0xfa21('0x17')](0x1f4,_0x4beca5[_0xfa21('0x18')]));});});};exports[_0xfa21('0x29')]=function(_0x5a7317){var _0x2d4fd0=this;return new Promise(function(_0x398e98,_0x2ad8d5){return db['VoiceQueueReport']['update'](_0x5a7317['body'],{'raw':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317[_0xfa21('0x1e')][_0xfa21('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317['options'][_0xfa21('0x20')]||null:null,'attributes':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317['options'][_0xfa21('0x21')]||null:null,'limit':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317[_0xfa21('0x1e')][_0xfa21('0x2a')]||null:null})[_0xfa21('0x11')](function(_0x95066f){logger['info'](_0xfa21('0x29'),_0x5a7317);logger[_0xfa21('0x28')](_0xfa21('0x29'),_0x5a7317,JSON[_0xfa21('0x16')](_0x95066f));_0x398e98(_0x95066f);})[_0xfa21('0x1a')](function(_0x435d49){logger[_0xfa21('0x17')](_0xfa21('0x29'),_0x435d49[_0xfa21('0x18')],_0x5a7317);_0x2ad8d5(_0x2d4fd0[_0xfa21('0x17')](0x1f4,_0x435d49[_0xfa21('0x18')]));});});}; \ No newline at end of file +var _0x0963=['create','body','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','stringify','error','code','message','VoiceQueueReport,\x20%s,\x20%s','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','limit','include','map','model','attributes','CreateVoiceQueueReport'];(function(_0x28fbdd,_0x7d41d4){var _0xceadc3=function(_0x10c89b){while(--_0x10c89b){_0x28fbdd['push'](_0x28fbdd['shift']());}};_0xceadc3(++_0x7d41d4);}(_0x0963,0x1d0));var _0x3096=function(_0x10a622,_0x1804be){_0x10a622=_0x10a622-0x0;var _0x707210=_0x0963[_0x10a622];return _0x707210;};'use strict';var _=require(_0x3096('0x0'));var util=require(_0x3096('0x1'));var moment=require(_0x3096('0x2'));var BPromise=require(_0x3096('0x3'));var rs=require(_0x3096('0x4'));var fs=require('fs');var Redis=require(_0x3096('0x5'));var db=require(_0x3096('0x6'))['db'];var utils=require(_0x3096('0x7'));var logger=require(_0x3096('0x8'))(_0x3096('0x9'));var config=require(_0x3096('0xa'));var jayson=require(_0x3096('0xb'));var client=jayson['client'][_0x3096('0xc')]({'port':0x232a});config[_0x3096('0xd')]=_[_0x3096('0xe')](config[_0x3096('0xd')],{'host':_0x3096('0xf'),'port':0x18eb});var socket=require(_0x3096('0x10'))(new Redis(config[_0x3096('0xd')]));require('./voiceQueueReport.socket')[_0x3096('0x11')](socket);function respondWithRpcPromise(_0x584e15,_0x26cf30,_0x1b6f21){return new BPromise(function(_0x23a63c,_0x50eb7d){return client[_0x3096('0x12')](_0x584e15,_0x1b6f21)[_0x3096('0x13')](function(_0x34795f){logger[_0x3096('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x26cf30,_0x3096('0x15'));logger[_0x3096('0x16')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x26cf30,'request\x20sent',JSON[_0x3096('0x17')](_0x34795f));if(_0x34795f[_0x3096('0x18')]){if(_0x34795f[_0x3096('0x18')][_0x3096('0x19')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x26cf30,_0x34795f['error']['message']);return _0x50eb7d(_0x34795f['error'][_0x3096('0x1a')]);}logger[_0x3096('0x18')](_0x3096('0x1b'),_0x26cf30,_0x34795f['error'][_0x3096('0x1a')]);return _0x23a63c(_0x34795f[_0x3096('0x18')][_0x3096('0x1a')]);}else{logger['info'](_0x3096('0x1b'),_0x26cf30,'request\x20sent');_0x23a63c(_0x34795f[_0x3096('0x1c')]['message']);}})[_0x3096('0x1d')](function(_0x4cd679){logger[_0x3096('0x18')](_0x3096('0x1b'),_0x26cf30,_0x4cd679);_0x50eb7d(_0x4cd679);});});}exports[_0x3096('0x1e')]=function(_0x1ea8fa){var _0x23a57a=this;return new Promise(function(_0x3e8ba1,_0x447c19){return db[_0x3096('0x1f')][_0x3096('0x20')]({'raw':_0x1ea8fa['options']?_0x1ea8fa[_0x3096('0x21')][_0x3096('0x22')]===undefined?!![]:![]:!![],'where':_0x1ea8fa[_0x3096('0x21')]?_0x1ea8fa['options'][_0x3096('0x23')]||null:null,'attributes':_0x1ea8fa[_0x3096('0x21')]?_0x1ea8fa[_0x3096('0x21')]['attributes']||null:null,'limit':_0x1ea8fa[_0x3096('0x21')]?_0x1ea8fa[_0x3096('0x21')][_0x3096('0x24')]||null:null,'include':_0x1ea8fa[_0x3096('0x21')]?_0x1ea8fa[_0x3096('0x21')][_0x3096('0x25')]?_[_0x3096('0x26')](_0x1ea8fa[_0x3096('0x21')][_0x3096('0x25')],function(_0x41d5d4){return{'model':db[_0x41d5d4[_0x3096('0x27')]],'as':_0x41d5d4['as'],'attributes':_0x41d5d4['attributes'],'include':_0x41d5d4[_0x3096('0x25')]?_[_0x3096('0x26')](_0x41d5d4[_0x3096('0x25')],function(_0x5d20dc){return{'model':db[_0x5d20dc[_0x3096('0x27')]],'as':_0x5d20dc['as'],'attributes':_0x5d20dc[_0x3096('0x28')],'include':_0x5d20dc[_0x3096('0x25')]?_[_0x3096('0x26')](_0x5d20dc[_0x3096('0x25')],function(_0x48b117){return{'model':db[_0x48b117[_0x3096('0x27')]],'as':_0x48b117['as'],'attributes':_0x48b117[_0x3096('0x28')]};}):[]};}):[]};}):[]:[]})[_0x3096('0x13')](function(_0x3ea5a4){logger[_0x3096('0x14')](_0x3096('0x1e'),_0x1ea8fa);logger['debug']('GetVoiceQueueReport',_0x1ea8fa,JSON[_0x3096('0x17')](_0x3ea5a4));_0x3e8ba1(_0x3ea5a4);})[_0x3096('0x1d')](function(_0x36d7d9){logger[_0x3096('0x18')](_0x3096('0x1e'),_0x36d7d9[_0x3096('0x1a')],_0x1ea8fa);_0x447c19(_0x23a57a[_0x3096('0x18')](0x1f4,_0x36d7d9[_0x3096('0x1a')]));});});};exports[_0x3096('0x29')]=function(_0x28fbad){var _0x54bef1=this;return new Promise(function(_0x2dcd83,_0x3e00c1){return db['VoiceQueueReport'][_0x3096('0x2a')](_0x28fbad[_0x3096('0x2b')],{'raw':_0x28fbad['options']?_0x28fbad['options'][_0x3096('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x2fd288){logger[_0x3096('0x14')](_0x3096('0x29'),_0x28fbad);logger[_0x3096('0x16')](_0x3096('0x29'),_0x28fbad,JSON[_0x3096('0x17')](_0x2fd288));_0x2dcd83(_0x2fd288);})[_0x3096('0x1d')](function(_0x531a07){logger[_0x3096('0x18')](_0x3096('0x29'),_0x531a07[_0x3096('0x1a')],_0x28fbad);_0x3e00c1(_0x54bef1[_0x3096('0x18')](0x1f4,_0x531a07[_0x3096('0x1a')]));});});};exports[_0x3096('0x2c')]=function(_0x2b438f){var _0x30c1f3=this;return new Promise(function(_0x3d2b8a,_0x3ff9d9){return db[_0x3096('0x1f')][_0x3096('0x2d')](_0x2b438f['body'],{'raw':_0x2b438f[_0x3096('0x21')]?_0x2b438f[_0x3096('0x21')][_0x3096('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b438f[_0x3096('0x21')]?_0x2b438f[_0x3096('0x21')]['where']||null:null,'attributes':_0x2b438f['options']?_0x2b438f[_0x3096('0x21')]['attributes']||null:null,'limit':_0x2b438f['options']?_0x2b438f[_0x3096('0x21')][_0x3096('0x24')]||null:null})[_0x3096('0x13')](function(_0x4d639c){logger[_0x3096('0x14')](_0x3096('0x2c'),_0x2b438f);logger[_0x3096('0x16')](_0x3096('0x2c'),_0x2b438f,JSON['stringify'](_0x4d639c));_0x3d2b8a(_0x4d639c);})['catch'](function(_0x552586){logger[_0x3096('0x18')](_0x3096('0x2c'),_0x552586['message'],_0x2b438f);_0x3ff9d9(_0x30c1f3[_0x3096('0x18')](0x1f4,_0x552586['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 88db424..d0c7a08 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 _0x3951=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','emit'];(function(_0x7bf708,_0x4dbd40){var _0x2be0c8=function(_0x5346c0){while(--_0x5346c0){_0x7bf708['push'](_0x7bf708['shift']());}};_0x2be0c8(++_0x4dbd40);}(_0x3951,0xdd));var _0x1395=function(_0x32f777,_0x464323){_0x32f777=_0x32f777-0x0;var _0x190429=_0x3951[_0x32f777];return _0x190429;};'use strict';var VoiceQueueReportEvents=require(_0x1395('0x0'));var events=['save',_0x1395('0x1'),'update'];function createListener(_0x249d81,_0x3e2100){return function(_0x1804e6){_0x3e2100[_0x1395('0x2')](_0x249d81,_0x1804e6);};}function removeListener(_0x1b4a93,_0x570f2b){return function(){VoiceQueueReportEvents[_0x1395('0x3')](_0x1b4a93,_0x570f2b);};}exports[_0x1395('0x4')]=function(_0xafe7b8){for(var _0x2d7393=0x0,_0x4d147c=events[_0x1395('0x5')];_0x2d7393<_0x4d147c;_0x2d7393++){var _0x1c1535=events[_0x2d7393];var _0x9ee81e=createListener(_0x1395('0x6')+_0x1c1535,_0xafe7b8);VoiceQueueReportEvents['on'](_0x1c1535,_0x9ee81e);}}; \ No newline at end of file +var _0xb31e=['save','remove','update','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x59c18b,_0x48fe75){var _0x192b7e=function(_0x19b43e){while(--_0x19b43e){_0x59c18b['push'](_0x59c18b['shift']());}};_0x192b7e(++_0x48fe75);}(_0xb31e,0x6f));var _0xeb31=function(_0x3fecb7,_0x35eba0){_0x3fecb7=_0x3fecb7-0x0;var _0x563d3c=_0xb31e[_0x3fecb7];return _0x563d3c;};'use strict';var VoiceQueueReportEvents=require(_0xeb31('0x0'));var events=[_0xeb31('0x1'),_0xeb31('0x2'),_0xeb31('0x3')];function createListener(_0x1bfbc2,_0x52a657){return function(_0x58aa4e){_0x52a657['emit'](_0x1bfbc2,_0x58aa4e);};}function removeListener(_0x2105eb,_0x267787){return function(){VoiceQueueReportEvents['removeListener'](_0x2105eb,_0x267787);};}exports[_0xeb31('0x4')]=function(_0x427004){for(var _0x2f05fa=0x0,_0x3e5ccd=events[_0xeb31('0x5')];_0x2f05fa<_0x3e5ccd;_0x2f05fa++){var _0x3d52a6=events[_0x2f05fa];var _0x3a2b4a=createListener(_0xeb31('0x6')+_0x3d52a6,_0x427004);VoiceQueueReportEvents['on'](_0x3d52a6,_0x3a2b4a);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 779b3b0..f501c77 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 _0x0a41=['post','put','isAuthenticated','update','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','get','/:id','show'];(function(_0x36c104,_0x5631f9){var _0x34284a=function(_0x16edc7){while(--_0x16edc7){_0x36c104['push'](_0x36c104['shift']());}};_0x34284a(++_0x5631f9);}(_0x0a41,0xe6));var _0x10a4=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x0a41[_0x16938f];return _0x5c66e9;};'use strict';var multer=require('multer');var util=require(_0x10a4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10a4('0x1'));var router=express[_0x10a4('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x10a4('0x3'));var config=require(_0x10a4('0x4'));var controller=require('./voiceQueuesLog.controller');router[_0x10a4('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x10a4('0x5')](_0x10a4('0x6'),auth['isAuthenticated'](),controller[_0x10a4('0x7')]);router[_0x10a4('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x10a4('0x9')](_0x10a4('0x6'),auth[_0x10a4('0xa')](),controller[_0x10a4('0xb')]);router['delete'](_0x10a4('0x6'),auth[_0x10a4('0xa')](),controller[_0x10a4('0xc')]);module[_0x10a4('0xd')]=router; \ No newline at end of file +var _0x07b1=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','destroy'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0x07b1,0x1a9));var _0x107b=function(_0x45d598,_0x3a4750){_0x45d598=_0x45d598-0x0;var _0x5dbe8c=_0x07b1[_0x45d598];return _0x5dbe8c;};'use strict';var multer=require(_0x107b('0x0'));var util=require('util');var path=require(_0x107b('0x1'));var timeout=require(_0x107b('0x2'));var express=require(_0x107b('0x3'));var router=express[_0x107b('0x4')]();var auth=require(_0x107b('0x5'));var interaction=require(_0x107b('0x6'));var config=require(_0x107b('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x107b('0x8')]('/',auth[_0x107b('0x9')](),controller['index']);router['get'](_0x107b('0xa'),auth[_0x107b('0x9')](),controller[_0x107b('0xb')]);router[_0x107b('0xc')]('/',auth[_0x107b('0x9')](),controller[_0x107b('0xd')]);router[_0x107b('0xe')](_0x107b('0xa'),auth[_0x107b('0x9')](),controller[_0x107b('0xf')]);router['delete']('/:id',auth[_0x107b('0x9')](),controller[_0x107b('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index cfdfa9c..752195a 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 _0xcbff=['format','YYYY-MM-DD\x20HH:mm:ss','moment','STRING','DATE'];(function(_0x46f5fd,_0x4f0f91){var _0x5d5905=function(_0x57a8bc){while(--_0x57a8bc){_0x46f5fd['push'](_0x46f5fd['shift']());}};_0x5d5905(++_0x4f0f91);}(_0xcbff,0x188));var _0xfcbf=function(_0x360b7a,_0x386e69){_0x360b7a=_0x360b7a-0x0;var _0x466f7a=_0xcbff[_0x360b7a];return _0x466f7a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfcbf('0x0'));module['exports']={'time':{'type':Sequelize[_0xfcbf('0x1')]},'callid':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfcbf('0x2')],'allowNull':![],'defaultValue':moment()[_0xfcbf('0x3')](_0xfcbf('0x4'))}}; \ No newline at end of file +var _0x2fcd=['STRING','DATE','format','YYYY-MM-DD\x20HH:mm:ss','exports'];(function(_0x230278,_0x292a1c){var _0x4e5374=function(_0x3f4bfa){while(--_0x3f4bfa){_0x230278['push'](_0x230278['shift']());}};_0x4e5374(++_0x292a1c);}(_0x2fcd,0x108));var _0xd2fc=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2fcd[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xd2fc('0x0')]={'time':{'type':Sequelize[_0xd2fc('0x1')]},'callid':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xd2fc('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xd2fc('0x2')],'allowNull':![],'defaultValue':moment()[_0xd2fc('0x3')](_0xd2fc('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index f8dce88..d62bc44 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 _0xd5fa=['map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','length','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','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','end','status','json','count','offset','limit','set','apply','save','update','then','error','stack','name','send','index'];(function(_0x3ca5db,_0x1f2570){var _0x1c479d=function(_0xafdf25){while(--_0xafdf25){_0x3ca5db['push'](_0x3ca5db['shift']());}};_0x1c479d(++_0x1f2570);}(_0xd5fa,0x14a));var _0xad5f=function(_0x7da73d,_0x4920ce){_0x7da73d=_0x7da73d-0x0;var _0x1304b5=_0xd5fa[_0x7da73d];return _0x1304b5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xad5f('0x0'));var rimraf=require(_0xad5f('0x1'));var zipdir=require(_0xad5f('0x2'));var jsonpatch=require(_0xad5f('0x3'));var rp=require('request-promise');var moment=require(_0xad5f('0x4'));var BPromise=require(_0xad5f('0x5'));var Mustache=require(_0xad5f('0x6'));var util=require(_0xad5f('0x7'));var path=require(_0xad5f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xad5f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xad5f('0xa'));var jsforce=require(_0xad5f('0xb'));var deskjs=require(_0xad5f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xad5f('0xd'));var Papa=require(_0xad5f('0xe'));var Redis=require(_0xad5f('0xf'));var authService=require(_0xad5f('0x10'));var qs=require(_0xad5f('0x11'));var as=require(_0xad5f('0x12'));var hardwareService=require(_0xad5f('0x13'));var logger=require(_0xad5f('0x14'))(_0xad5f('0x15'));var utils=require(_0xad5f('0x16'));var config=require(_0xad5f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cd6f9,_0x857ac3){_0x857ac3=_0x857ac3||0xcc;return function(_0x50a283){if(_0x50a283){return _0x2cd6f9['sendStatus'](_0x857ac3);}return _0x2cd6f9['status'](_0x857ac3)[_0xad5f('0x18')]();};}function respondWithResult(_0x41c41c,_0x11c55a){_0x11c55a=_0x11c55a||0xc8;return function(_0xf6170f){if(_0xf6170f){return _0x41c41c[_0xad5f('0x19')](_0x11c55a)[_0xad5f('0x1a')](_0xf6170f);}};}function respondWithFilteredResult(_0x191dd7,_0x3cc578){return function(_0x48e653){if(_0x48e653){var _0x4d07b8=_0x48e653[_0xad5f('0x1b')],_0x7dd395=_0x3cc578['offset'],_0x140cfd=_0x3cc578[_0xad5f('0x1c')]+_0x3cc578[_0xad5f('0x1d')],_0x522ba2;if(_0x140cfd>=_0x4d07b8){_0x140cfd=_0x4d07b8;_0x522ba2=0xc8;}else{_0x522ba2=0xce;}_0x191dd7[_0xad5f('0x19')](_0x522ba2);return _0x191dd7[_0xad5f('0x1e')]('Content-Range',_0x7dd395+'-'+_0x140cfd+'/'+_0x4d07b8)[_0xad5f('0x1a')](_0x48e653);}return null;};}function patchUpdates(_0x50d7e1){return function(_0x5b3720){try{jsonpatch[_0xad5f('0x1f')](_0x5b3720,_0x50d7e1,!![]);}catch(_0x4f5588){return BPromise['reject'](_0x4f5588);}return _0x5b3720[_0xad5f('0x20')]();};}function saveUpdates(_0x38c052,_0x5277fa){return function(_0x12ab75){if(_0x12ab75){return _0x12ab75[_0xad5f('0x21')](_0x38c052)[_0xad5f('0x22')](function(_0x4e4ec2){return _0x4e4ec2;});}return null;};}function removeEntity(_0x5163e6,_0x492ffa){return function(_0x2271ca){if(_0x2271ca){return _0x2271ca['destroy']()[_0xad5f('0x22')](function(){_0x5163e6[_0xad5f('0x19')](0xcc)[_0xad5f('0x18')]();});}};}function handleEntityNotFound(_0x3196d9,_0x99525d){return function(_0x2b6d33){if(!_0x2b6d33){_0x3196d9['sendStatus'](0x194);}return _0x2b6d33;};}function handleError(_0x4a5313,_0xa407ef){_0xa407ef=_0xa407ef||0x1f4;return function(_0x557a9b){logger[_0xad5f('0x23')](_0x557a9b[_0xad5f('0x24')]);if(_0x557a9b['name']){delete _0x557a9b[_0xad5f('0x25')];}_0x4a5313[_0xad5f('0x19')](_0xa407ef)[_0xad5f('0x26')](_0x557a9b);};}exports[_0xad5f('0x27')]=function(_0x462731,_0x4bac30){var _0x161c35={},_0x3b3196={},_0xd2735c={'count':0x0,'rows':[]};var _0x55063b=_[_0xad5f('0x28')](db[_0xad5f('0x29')][_0xad5f('0x2a')],function(_0x2d6f29){return{'name':_0x2d6f29[_0xad5f('0x2b')],'type':_0x2d6f29[_0xad5f('0x2c')][_0xad5f('0x2d')]};});_0x3b3196[_0xad5f('0x2e')]=_['map'](_0x55063b,_0xad5f('0x25'));_0x3b3196[_0xad5f('0x2f')]=_[_0xad5f('0x30')](_0x462731[_0xad5f('0x2f')]);_0x3b3196[_0xad5f('0x31')]=_[_0xad5f('0x32')](_0x3b3196[_0xad5f('0x2e')],_0x3b3196[_0xad5f('0x2f')]);_0x161c35[_0xad5f('0x33')]=_['intersection'](_0x3b3196[_0xad5f('0x2e')],qs[_0xad5f('0x34')](_0x462731[_0xad5f('0x2f')][_0xad5f('0x34')]));_0x161c35[_0xad5f('0x33')]=_0x161c35['attributes']['length']?_0x161c35[_0xad5f('0x33')]:_0x3b3196[_0xad5f('0x2e')];if(!_0x462731['query'][_0xad5f('0x35')](_0xad5f('0x36'))){_0x161c35['limit']=qs['limit'](_0x462731[_0xad5f('0x2f')][_0xad5f('0x1d')]);_0x161c35[_0xad5f('0x1c')]=qs['offset'](_0x462731[_0xad5f('0x2f')]['offset']);}_0x161c35[_0xad5f('0x37')]=qs[_0xad5f('0x38')](_0x462731[_0xad5f('0x2f')][_0xad5f('0x38')]);_0x161c35[_0xad5f('0x39')]=qs[_0xad5f('0x31')](_[_0xad5f('0x3a')](_0x462731['query'],_0x3b3196[_0xad5f('0x31')]));if(_0x462731[_0xad5f('0x2f')][_0xad5f('0x3b')]){_0x161c35[_0xad5f('0x39')]=_[_0xad5f('0x3c')](_0x161c35[_0xad5f('0x39')],{'$or':_[_0xad5f('0x28')](_0x55063b,function(_0x322f73){if(_0x322f73[_0xad5f('0x2c')]!==_0xad5f('0x3d')){var _0x39834f={};_0x39834f[_0x322f73[_0xad5f('0x25')]]={'$like':'%'+_0x462731['query']['filter']+'%'};return _0x39834f;}})});}_0x161c35=_[_0xad5f('0x3c')]({},_0x161c35,_0x462731['options']);var _0x2ead16={'where':_0x161c35[_0xad5f('0x39')]};return db['VoiceQueuesLog'][_0xad5f('0x1b')](_0x2ead16)['then'](function(_0x13e9ab){_0xd2735c['count']=_0x13e9ab;if(_0x462731['query'][_0xad5f('0x3e')]){_0x161c35['include']=[{'all':!![]}];}return db[_0xad5f('0x29')][_0xad5f('0x3f')](_0x161c35);})[_0xad5f('0x22')](function(_0x2b4e08){_0xd2735c['rows']=_0x2b4e08;return _0xd2735c;})['then'](respondWithFilteredResult(_0x4bac30,_0x161c35))[_0xad5f('0x40')](handleError(_0x4bac30,null));};exports[_0xad5f('0x41')]=function(_0x12fd40,_0x4c64f7){var _0x16d1ed={'raw':!![],'where':{'id':_0x12fd40[_0xad5f('0x42')]['id']}},_0x5a9957={};_0x5a9957['model']=_[_0xad5f('0x30')](db['VoiceQueuesLog']['rawAttributes']);_0x5a9957[_0xad5f('0x2f')]=_[_0xad5f('0x30')](_0x12fd40['query']);_0x5a9957[_0xad5f('0x31')]=_[_0xad5f('0x32')](_0x5a9957[_0xad5f('0x2e')],_0x5a9957[_0xad5f('0x2f')]);_0x16d1ed[_0xad5f('0x33')]=_[_0xad5f('0x32')](_0x5a9957[_0xad5f('0x2e')],qs['fields'](_0x12fd40[_0xad5f('0x2f')][_0xad5f('0x34')]));_0x16d1ed['attributes']=_0x16d1ed[_0xad5f('0x33')][_0xad5f('0x43')]?_0x16d1ed['attributes']:_0x5a9957[_0xad5f('0x2e')];if(_0x12fd40[_0xad5f('0x2f')][_0xad5f('0x3e')]){_0x16d1ed[_0xad5f('0x44')]=[{'all':!![]}];}_0x16d1ed=_[_0xad5f('0x3c')]({},_0x16d1ed,_0x12fd40[_0xad5f('0x45')]);return db[_0xad5f('0x29')][_0xad5f('0x46')](_0x16d1ed)[_0xad5f('0x22')](handleEntityNotFound(_0x4c64f7,null))[_0xad5f('0x22')](respondWithResult(_0x4c64f7,null))[_0xad5f('0x40')](handleError(_0x4c64f7,null));};exports[_0xad5f('0x47')]=function(_0x139e49,_0xce1ad6){return db[_0xad5f('0x29')]['create'](_0x139e49[_0xad5f('0x48')],{})[_0xad5f('0x22')](respondWithResult(_0xce1ad6,0xc9))[_0xad5f('0x40')](handleError(_0xce1ad6,null));};exports[_0xad5f('0x21')]=function(_0x556944,_0x3d19b9){if(_0x556944[_0xad5f('0x48')]['id']){delete _0x556944[_0xad5f('0x48')]['id'];}return db[_0xad5f('0x29')][_0xad5f('0x46')]({'where':{'id':_0x556944[_0xad5f('0x42')]['id']}})[_0xad5f('0x22')](handleEntityNotFound(_0x3d19b9,null))[_0xad5f('0x22')](saveUpdates(_0x556944[_0xad5f('0x48')],null))[_0xad5f('0x22')](respondWithResult(_0x3d19b9,null))[_0xad5f('0x40')](handleError(_0x3d19b9,null));};exports[_0xad5f('0x49')]=function(_0x392e3f,_0x10e33f){return db['VoiceQueuesLog'][_0xad5f('0x46')]({'where':{'id':_0x392e3f[_0xad5f('0x42')]['id']}})[_0xad5f('0x22')](handleEntityNotFound(_0x10e33f,null))[_0xad5f('0x22')](removeEntity(_0x10e33f,null))['catch'](handleError(_0x10e33f,null));}; \ No newline at end of file +var _0x13bf=['body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','keys','filters','model','query','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x13bf,0xe0));var _0xf13b=function(_0x465dee,_0x31471c){_0x465dee=_0x465dee-0x0;var _0xb6eb95=_0x13bf[_0x465dee];return _0xb6eb95;};'use strict';var pdf=require(_0xf13b('0x0'));var emlformat=require(_0xf13b('0x1'));var rimraf=require(_0xf13b('0x2'));var zipdir=require(_0xf13b('0x3'));var jsonpatch=require(_0xf13b('0x4'));var rp=require(_0xf13b('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf13b('0x6'));var util=require('util');var path=require(_0xf13b('0x7'));var sox=require(_0xf13b('0x8'));var csv=require('to-csv');var ejs=require(_0xf13b('0x9'));var fs=require('fs');var _=require(_0xf13b('0xa'));var squel=require(_0xf13b('0xb'));var crypto=require(_0xf13b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf13b('0xd'));var toCsv=require(_0xf13b('0xe'));var querystring=require(_0xf13b('0xf'));var Papa=require(_0xf13b('0x10'));var Redis=require(_0xf13b('0x11'));var authService=require(_0xf13b('0x12'));var qs=require(_0xf13b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf13b('0x14'))('api');var utils=require(_0xf13b('0x15'));var config=require(_0xf13b('0x16'));var db=require(_0xf13b('0x17'))['db'];function respondWithStatusCode(_0x52d89b,_0x412555){_0x412555=_0x412555||0xcc;return function(_0x13ac70){if(_0x13ac70){return _0x52d89b[_0xf13b('0x18')](_0x412555);}return _0x52d89b[_0xf13b('0x19')](_0x412555)['end']();};}function respondWithResult(_0x1c1be4,_0x5409db){_0x5409db=_0x5409db||0xc8;return function(_0x2dc6ec){if(_0x2dc6ec){return _0x1c1be4[_0xf13b('0x19')](_0x5409db)[_0xf13b('0x1a')](_0x2dc6ec);}};}function respondWithFilteredResult(_0x13220f,_0xb1df61){return function(_0x1bf452){if(_0x1bf452){var _0x1e265b=_0x1bf452[_0xf13b('0x1b')],_0x218457=_0xb1df61[_0xf13b('0x1c')],_0x367684=_0xb1df61[_0xf13b('0x1c')]+_0xb1df61[_0xf13b('0x1d')],_0x1af72d;if(_0x367684>=_0x1e265b){_0x367684=_0x1e265b;_0x1af72d=0xc8;}else{_0x1af72d=0xce;}_0x13220f[_0xf13b('0x19')](_0x1af72d);return _0x13220f[_0xf13b('0x1e')](_0xf13b('0x1f'),_0x218457+'-'+_0x367684+'/'+_0x1e265b)[_0xf13b('0x1a')](_0x1bf452);}return null;};}function patchUpdates(_0x1ea091){return function(_0x13a6d6){try{jsonpatch[_0xf13b('0x20')](_0x13a6d6,_0x1ea091,!![]);}catch(_0x3540f6){return BPromise['reject'](_0x3540f6);}return _0x13a6d6[_0xf13b('0x21')]();};}function saveUpdates(_0x4e5f0a,_0x55c722){return function(_0x389ff6){if(_0x389ff6){return _0x389ff6['update'](_0x4e5f0a)[_0xf13b('0x22')](function(_0x553ece){return _0x553ece;});}return null;};}function removeEntity(_0x1859ef,_0x17d215){return function(_0x1e1f68){if(_0x1e1f68){return _0x1e1f68[_0xf13b('0x23')]()[_0xf13b('0x22')](function(){_0x1859ef[_0xf13b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf199c3,_0x1fbc79){return function(_0xe90229){if(!_0xe90229){_0xf199c3[_0xf13b('0x18')](0x194);}return _0xe90229;};}function handleError(_0x4158f2,_0x2b30e9){_0x2b30e9=_0x2b30e9||0x1f4;return function(_0x424cd4){logger[_0xf13b('0x24')](_0x424cd4[_0xf13b('0x25')]);if(_0x424cd4[_0xf13b('0x26')]){delete _0x424cd4[_0xf13b('0x26')];}_0x4158f2[_0xf13b('0x19')](_0x2b30e9)['send'](_0x424cd4);};}exports[_0xf13b('0x27')]=function(_0x4d9412,_0x25c238){var _0x5a3ce4={},_0x2fe33a={},_0x1f27ac={'count':0x0,'rows':[]};var _0x194d2b=_['map'](db[_0xf13b('0x28')][_0xf13b('0x29')],function(_0x105bdf){return{'name':_0x105bdf[_0xf13b('0x2a')],'type':_0x105bdf[_0xf13b('0x2b')][_0xf13b('0x2c')]};});_0x2fe33a['model']=_['map'](_0x194d2b,_0xf13b('0x26'));_0x2fe33a['query']=_[_0xf13b('0x2d')](_0x4d9412['query']);_0x2fe33a[_0xf13b('0x2e')]=_['intersection'](_0x2fe33a[_0xf13b('0x2f')],_0x2fe33a[_0xf13b('0x30')]);_0x5a3ce4[_0xf13b('0x31')]=_['intersection'](_0x2fe33a[_0xf13b('0x2f')],qs[_0xf13b('0x32')](_0x4d9412[_0xf13b('0x30')]['fields']));_0x5a3ce4['attributes']=_0x5a3ce4[_0xf13b('0x31')][_0xf13b('0x33')]?_0x5a3ce4[_0xf13b('0x31')]:_0x2fe33a[_0xf13b('0x2f')];if(!_0x4d9412[_0xf13b('0x30')]['hasOwnProperty'](_0xf13b('0x34'))){_0x5a3ce4['limit']=qs['limit'](_0x4d9412[_0xf13b('0x30')][_0xf13b('0x1d')]);_0x5a3ce4[_0xf13b('0x1c')]=qs[_0xf13b('0x1c')](_0x4d9412[_0xf13b('0x30')][_0xf13b('0x1c')]);}_0x5a3ce4[_0xf13b('0x35')]=qs['sort'](_0x4d9412[_0xf13b('0x30')][_0xf13b('0x36')]);_0x5a3ce4[_0xf13b('0x37')]=qs[_0xf13b('0x2e')](_[_0xf13b('0x38')](_0x4d9412[_0xf13b('0x30')],_0x2fe33a['filters']));if(_0x4d9412[_0xf13b('0x30')][_0xf13b('0x39')]){_0x5a3ce4['where']=_[_0xf13b('0x3a')](_0x5a3ce4[_0xf13b('0x37')],{'$or':_[_0xf13b('0x3b')](_0x194d2b,function(_0x86810){if(_0x86810[_0xf13b('0x2b')]!==_0xf13b('0x3c')){var _0x314803={};_0x314803[_0x86810[_0xf13b('0x26')]]={'$like':'%'+_0x4d9412[_0xf13b('0x30')][_0xf13b('0x39')]+'%'};return _0x314803;}})});}_0x5a3ce4=_[_0xf13b('0x3a')]({},_0x5a3ce4,_0x4d9412[_0xf13b('0x3d')]);var _0x1de819={'where':_0x5a3ce4['where']};return db[_0xf13b('0x28')]['count'](_0x1de819)[_0xf13b('0x22')](function(_0x219a28){_0x1f27ac[_0xf13b('0x1b')]=_0x219a28;if(_0x4d9412['query'][_0xf13b('0x3e')]){_0x5a3ce4['include']=[{'all':!![]}];}return db[_0xf13b('0x28')][_0xf13b('0x3f')](_0x5a3ce4);})['then'](function(_0x14a6d8){_0x1f27ac[_0xf13b('0x40')]=_0x14a6d8;return _0x1f27ac;})[_0xf13b('0x22')](respondWithFilteredResult(_0x25c238,_0x5a3ce4))[_0xf13b('0x41')](handleError(_0x25c238,null));};exports[_0xf13b('0x42')]=function(_0x2432c7,_0x35751f){var _0x49700={'raw':!![],'where':{'id':_0x2432c7[_0xf13b('0x43')]['id']}},_0x23fa9d={};_0x23fa9d[_0xf13b('0x2f')]=_[_0xf13b('0x2d')](db[_0xf13b('0x28')]['rawAttributes']);_0x23fa9d[_0xf13b('0x30')]=_[_0xf13b('0x2d')](_0x2432c7[_0xf13b('0x30')]);_0x23fa9d['filters']=_[_0xf13b('0x44')](_0x23fa9d['model'],_0x23fa9d[_0xf13b('0x30')]);_0x49700['attributes']=_['intersection'](_0x23fa9d[_0xf13b('0x2f')],qs[_0xf13b('0x32')](_0x2432c7[_0xf13b('0x30')][_0xf13b('0x32')]));_0x49700[_0xf13b('0x31')]=_0x49700[_0xf13b('0x31')][_0xf13b('0x33')]?_0x49700[_0xf13b('0x31')]:_0x23fa9d[_0xf13b('0x2f')];if(_0x2432c7[_0xf13b('0x30')][_0xf13b('0x3e')]){_0x49700[_0xf13b('0x45')]=[{'all':!![]}];}_0x49700=_[_0xf13b('0x3a')]({},_0x49700,_0x2432c7[_0xf13b('0x3d')]);return db[_0xf13b('0x28')][_0xf13b('0x46')](_0x49700)[_0xf13b('0x22')](handleEntityNotFound(_0x35751f,null))['then'](respondWithResult(_0x35751f,null))[_0xf13b('0x41')](handleError(_0x35751f,null));};exports[_0xf13b('0x47')]=function(_0x1fe555,_0xeb6051){return db[_0xf13b('0x28')][_0xf13b('0x47')](_0x1fe555[_0xf13b('0x48')],{})[_0xf13b('0x22')](respondWithResult(_0xeb6051,0xc9))[_0xf13b('0x41')](handleError(_0xeb6051,null));};exports[_0xf13b('0x49')]=function(_0x17ea9b,_0x440227){if(_0x17ea9b[_0xf13b('0x48')]['id']){delete _0x17ea9b[_0xf13b('0x48')]['id'];}return db[_0xf13b('0x28')]['find']({'where':{'id':_0x17ea9b[_0xf13b('0x43')]['id']}})[_0xf13b('0x22')](handleEntityNotFound(_0x440227,null))[_0xf13b('0x22')](saveUpdates(_0x17ea9b[_0xf13b('0x48')],null))['then'](respondWithResult(_0x440227,null))[_0xf13b('0x41')](handleError(_0x440227,null));};exports[_0xf13b('0x23')]=function(_0x5e02a1,_0x48954e){return db[_0xf13b('0x28')][_0xf13b('0x46')]({'where':{'id':_0x5e02a1[_0xf13b('0x43')]['id']}})[_0xf13b('0x22')](handleEntityNotFound(_0x48954e,null))[_0xf13b('0x22')](removeEntity(_0x48954e,null))[_0xf13b('0x41')](handleError(_0x48954e,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 8ac4826..7260c4c 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 _0x5510=['rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x5510,0xf9));var _0x0551=function(_0x584d37,_0x13fb20){_0x584d37=_0x584d37-0x0;var _0x1a1dbf=_0x5510[_0x584d37];return _0x1a1dbf;};'use strict';var _=require(_0x0551('0x0'));var util=require(_0x0551('0x1'));var logger=require(_0x0551('0x2'))(_0x0551('0x3'));var moment=require(_0x0551('0x4'));var BPromise=require(_0x0551('0x5'));var rp=require(_0x0551('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0551('0x7'));var config=require(_0x0551('0x8'));var attributes=require(_0x0551('0x9'));module['exports']=function(_0x2368fc,_0x2a55ff){return _0x2368fc[_0x0551('0xa')](_0x0551('0xb'),attributes,{'tableName':_0x0551('0xc'),'paranoid':![],'indexes':[{'name':_0x0551('0xd'),'fields':[_0x0551('0xe'),_0x0551('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x0f71=['VoiceQueuesLog','voice_queues_log','dtm','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x0f71,0xb9));var _0x10f7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0f71[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x10f7('0x0'));var util=require(_0x10f7('0x1'));var logger=require(_0x10f7('0x2'))(_0x10f7('0x3'));var moment=require('moment');var BPromise=require(_0x10f7('0x4'));var rp=require(_0x10f7('0x5'));var fs=require('fs');var path=require(_0x10f7('0x6'));var rimraf=require(_0x10f7('0x7'));var config=require(_0x10f7('0x8'));var attributes=require(_0x10f7('0x9'));module[_0x10f7('0xa')]=function(_0x33248a,_0x142cd2){return _0x33248a['define'](_0x10f7('0xb'),attributes,{'tableName':_0x10f7('0xc'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event',_0x10f7('0xd')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 403b3ca..73e19c2 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 _0xc900=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc900,0xb3));var _0x0c90=function(_0x4acdde,_0x537e33){_0x4acdde=_0x4acdde-0x0;var _0x237c97=_0xc900[_0x4acdde];return _0x237c97;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c90('0x0'));var BPromise=require(_0x0c90('0x1'));var rs=require(_0x0c90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c90('0x3'))['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require(_0x0c90('0x6'));var jayson=require(_0x0c90('0x7'));var client=jayson[_0x0c90('0x8')][_0x0c90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x302ab1,_0x5b1a5c,_0x24e5be){return new BPromise(function(_0x1c1996,_0x23daed){return client[_0x0c90('0xa')](_0x302ab1,_0x24e5be)[_0x0c90('0xb')](function(_0x3d0f49){logger[_0x0c90('0xc')](_0x0c90('0xd'),_0x5b1a5c,_0x0c90('0xe'));logger[_0x0c90('0xf')](_0x0c90('0x10'),_0x5b1a5c,_0x0c90('0xe'),JSON[_0x0c90('0x11')](_0x3d0f49));if(_0x3d0f49['error']){if(_0x3d0f49[_0x0c90('0x12')]['code']===0x1f4){logger[_0x0c90('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5b1a5c,_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);return _0x23daed(_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);}logger[_0x0c90('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5b1a5c,_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);return _0x1c1996(_0x3d0f49['error'][_0x0c90('0x13')]);}else{logger[_0x0c90('0xc')](_0x0c90('0xd'),_0x5b1a5c,'request\x20sent');_0x1c1996(_0x3d0f49['result'][_0x0c90('0x13')]);}})[_0x0c90('0x14')](function(_0x2b8135){logger[_0x0c90('0x12')](_0x0c90('0xd'),_0x5b1a5c,_0x2b8135);_0x23daed(_0x2b8135);});});} \ No newline at end of file +var _0x9f4d=['debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent'];(function(_0x175ec9,_0x5d8b37){var _0x30dbb6=function(_0x370ccc){while(--_0x370ccc){_0x175ec9['push'](_0x175ec9['shift']());}};_0x30dbb6(++_0x5d8b37);}(_0x9f4d,0xb0));var _0xd9f4=function(_0x4f8d61,_0x29eff0){_0x4f8d61=_0x4f8d61-0x0;var _0x3bc078=_0x9f4d[_0x4f8d61];return _0x3bc078;};'use strict';var _=require(_0xd9f4('0x0'));var util=require(_0xd9f4('0x1'));var moment=require(_0xd9f4('0x2'));var BPromise=require(_0xd9f4('0x3'));var rs=require(_0xd9f4('0x4'));var fs=require('fs');var Redis=require(_0xd9f4('0x5'));var db=require(_0xd9f4('0x6'))['db'];var utils=require(_0xd9f4('0x7'));var logger=require(_0xd9f4('0x8'))('rpc');var config=require(_0xd9f4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd9f4('0xa')][_0xd9f4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cc036,_0x366b9d,_0x5cf448){return new BPromise(function(_0x6b13b5,_0x18305f){return client['request'](_0x2cc036,_0x5cf448)[_0xd9f4('0xc')](function(_0x47d52f){logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));logger[_0xd9f4('0x10')](_0xd9f4('0x11'),_0x366b9d,'request\x20sent',JSON[_0xd9f4('0x12')](_0x47d52f));if(_0x47d52f[_0xd9f4('0x13')]){if(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x14')]===0x1f4){logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x18305f(_0x47d52f['error'][_0xd9f4('0x15')]);}logger[_0xd9f4('0x13')](_0xd9f4('0xe'),_0x366b9d,_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);return _0x6b13b5(_0x47d52f[_0xd9f4('0x13')][_0xd9f4('0x15')]);}else{logger[_0xd9f4('0xd')](_0xd9f4('0xe'),_0x366b9d,_0xd9f4('0xf'));_0x6b13b5(_0x47d52f[_0xd9f4('0x16')][_0xd9f4('0x15')]);}})[_0xd9f4('0x17')](function(_0x5e7da1){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x366b9d,_0x5e7da1);_0x18305f(_0x5e7da1);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 018664b..963756a 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 _0x9942=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','download','create'];(function(_0x2a6501,_0x9c5a0e){var _0x34d3ae=function(_0x204c8b){while(--_0x204c8b){_0x2a6501['push'](_0x2a6501['shift']());}};_0x34d3ae(++_0x9c5a0e);}(_0x9942,0x1cf));var _0x2994=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x9942[_0x1e6db3];return _0x1de886;};'use strict';var multer=require(_0x2994('0x0'));var util=require(_0x2994('0x1'));var path=require(_0x2994('0x2'));var timeout=require(_0x2994('0x3'));var express=require(_0x2994('0x4'));var router=express[_0x2994('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2994('0x6'));var config=require(_0x2994('0x7'));var controller=require(_0x2994('0x8'));router[_0x2994('0x9')]('/',auth['isAuthenticated'](),controller[_0x2994('0xa')]);router[_0x2994('0x9')](_0x2994('0xb'),auth[_0x2994('0xc')](),controller[_0x2994('0xd')]);router[_0x2994('0x9')](_0x2994('0xe'),auth[_0x2994('0xc')](),controller['show']);router[_0x2994('0x9')]('/:id/download',auth[_0x2994('0xc')](),controller[_0x2994('0xf')]);router['get']('/:id/downloads',controller['downloads']);router['post']('/',auth[_0x2994('0xc')](),controller[_0x2994('0x10')]);router['put'](_0x2994('0xe'),auth[_0x2994('0xc')](),controller[_0x2994('0x11')]);router[_0x2994('0x12')](_0x2994('0xe'),auth[_0x2994('0xc')](),controller[_0x2994('0x13')]);module['exports']=router; \ No newline at end of file +var _0x135b=['connect-timeout','express','Router','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','show','/:id/download','download','/:id/downloads','downloads','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x2b760e,_0x155617){var _0x595585=function(_0x4feb89){while(--_0x4feb89){_0x2b760e['push'](_0x2b760e['shift']());}};_0x595585(++_0x155617);}(_0x135b,0x1a6));var _0xb135=function(_0x39e58f,_0xf91bc5){_0x39e58f=_0x39e58f-0x0;var _0x541ec7=_0x135b[_0x39e58f];return _0x541ec7;};'use strict';var multer=require(_0xb135('0x0'));var util=require(_0xb135('0x1'));var path=require(_0xb135('0x2'));var timeout=require(_0xb135('0x3'));var express=require(_0xb135('0x4'));var router=express[_0xb135('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb135('0x6'));var controller=require(_0xb135('0x7'));router[_0xb135('0x8')]('/',auth[_0xb135('0x9')](),controller[_0xb135('0xa')]);router[_0xb135('0x8')](_0xb135('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xb135('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb135('0xc')]);router['get'](_0xb135('0xd'),auth[_0xb135('0x9')](),controller[_0xb135('0xe')]);router[_0xb135('0x8')](_0xb135('0xf'),controller[_0xb135('0x10')]);router[_0xb135('0x11')]('/',auth['isAuthenticated'](),controller[_0xb135('0x12')]);router[_0xb135('0x13')](_0xb135('0x14'),auth[_0xb135('0x9')](),controller[_0xb135('0x15')]);router[_0xb135('0x16')]('/:id',auth[_0xb135('0x9')](),controller[_0xb135('0x17')]);module[_0xb135('0x18')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index caf6be4..6023053 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 _0xb1e4=['sequelize','path','exports','VIRTUAL','value','extname','STRING','setDataValue','channel','membername','split','INTEGER','getDataValue','createdAt','toString','DATE','MM-DD-YYYY\x20HH:mm'];(function(_0x548500,_0x25424b){var _0x4df2d7=function(_0x4476fa){while(--_0x4476fa){_0x548500['push'](_0x548500['shift']());}};_0x4df2d7(++_0x25424b);}(_0xb1e4,0xcc));var _0x4b1e=function(_0x47a717,_0x6e137e){_0x47a717=_0x47a717-0x0;var _0x20d8e5=_0xb1e4[_0x47a717];return _0x20d8e5;};'use strict';var Sequelize=require(_0x4b1e('0x0'));var moment=require('moment');var path=require(_0x4b1e('0x1'));module[_0x4b1e('0x2')]={'format':{'type':Sequelize[_0x4b1e('0x3')],'get':function(){return this['getDataValue'](_0x4b1e('0x4'))?path[_0x4b1e('0x5')](this['getDataValue'](_0x4b1e('0x4'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4b1e('0x6')],'set':function(_0x30e56e){if(_0x30e56e){this[_0x4b1e('0x7')](_0x4b1e('0x8'),_0x30e56e);this[_0x4b1e('0x7')](_0x4b1e('0x9'),_0x30e56e[_0x4b1e('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x4b1e('0x6')]},'calleridnum':{'type':Sequelize[_0x4b1e('0x6')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4b1e('0x6')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4b1e('0x6')]},'context':{'type':Sequelize[_0x4b1e('0x6')]},'exten':{'type':Sequelize[_0x4b1e('0x6')]},'value':{'type':Sequelize[_0x4b1e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x4b1e('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x4b1e('0x6')]},'userDisposition':{'type':Sequelize[_0x4b1e('0x6')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4b1e('0xc')](_0x4b1e('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x4b1e('0xe')]();}},'updatedAt':{'type':Sequelize[_0x4b1e('0xf')],'get':function(){return moment(this['getDataValue']('updatedAt'))['format'](_0x4b1e('0x10'))['toString']();}}}; \ No newline at end of file +var _0xae28=['DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','setDataValue','channel','membername','split','INTEGER'];(function(_0xd8d138,_0x2c83ec){var _0x1a618b=function(_0x4b7004){while(--_0x4b7004){_0xd8d138['push'](_0xd8d138['shift']());}};_0x1a618b(++_0x2c83ec);}(_0xae28,0xa7));var _0x8ae2=function(_0x395d18,_0x4e766e){_0x395d18=_0x395d18-0x0;var _0x5366af=_0xae28[_0x395d18];return _0x5366af;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8ae2('0x0'));var path=require(_0x8ae2('0x1'));module[_0x8ae2('0x2')]={'format':{'type':Sequelize[_0x8ae2('0x3')],'get':function(){return this[_0x8ae2('0x4')](_0x8ae2('0x5'))?path[_0x8ae2('0x6')](this[_0x8ae2('0x4')](_0x8ae2('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x8ae2('0x7')]},'channel':{'type':Sequelize[_0x8ae2('0x7')],'set':function(_0xf1e2a0){if(_0xf1e2a0){this[_0x8ae2('0x8')](_0x8ae2('0x9'),_0xf1e2a0);this[_0x8ae2('0x8')](_0x8ae2('0xa'),_0xf1e2a0[_0x8ae2('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x8ae2('0x7')]},'calleridnum':{'type':Sequelize[_0x8ae2('0x7')]},'calleridname':{'type':Sequelize[_0x8ae2('0x7')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8ae2('0x7')]},'accountcode':{'type':Sequelize[_0x8ae2('0x7')]},'context':{'type':Sequelize[_0x8ae2('0x7')]},'exten':{'type':Sequelize[_0x8ae2('0x7')]},'value':{'type':Sequelize[_0x8ae2('0x7')]},'type':{'type':Sequelize[_0x8ae2('0x7')]},'rating':{'type':Sequelize[_0x8ae2('0xc')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x8ae2('0x7')]},'createdAt':{'type':Sequelize[_0x8ae2('0xd')],'get':function(){return moment(this['getDataValue'](_0x8ae2('0xe')))[_0x8ae2('0xf')](_0x8ae2('0x10'))['toString']();}},'updatedAt':{'type':Sequelize[_0x8ae2('0xd')],'get':function(){return moment(this[_0x8ae2('0x4')]('updatedAt'))[_0x8ae2('0xf')](_0x8ae2('0x10'))[_0x8ae2('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index ce60a4b..8e12d63 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 _0xd7d1=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','VoiceRecording','includeAll','findAll','show','include','find','create','body','catch','params','describe','download','../../components/encryptor','type','uniqueid','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','value','ValidationError','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','stack','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x21c41a,_0x180241){var _0x2968d4=function(_0x18b986){while(--_0x18b986){_0x21c41a['push'](_0x21c41a['shift']());}};_0x2968d4(++_0x180241);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x4cb14e,_0xa4dd11){_0x4cb14e=_0x4cb14e-0x0;var _0x573a58=_0xd7d1[_0x4cb14e];return _0x573a58;};'use strict';var pdf=require(_0x1d7d('0x0'));var emlformat=require(_0x1d7d('0x1'));var rimraf=require(_0x1d7d('0x2'));var zipdir=require(_0x1d7d('0x3'));var jsonpatch=require(_0x1d7d('0x4'));var rp=require(_0x1d7d('0x5'));var moment=require(_0x1d7d('0x6'));var BPromise=require(_0x1d7d('0x7'));var Mustache=require(_0x1d7d('0x8'));var util=require(_0x1d7d('0x9'));var path=require(_0x1d7d('0xa'));var sox=require(_0x1d7d('0xb'));var csv=require(_0x1d7d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xc'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var db=require(_0x1d7d('0x1b'))['db'];function respondWithStatusCode(_0x5c7445,_0x11b83f){_0x11b83f=_0x11b83f||0xcc;return function(_0x5ae1c9){if(_0x5ae1c9){return _0x5c7445['sendStatus'](_0x11b83f);}return _0x5c7445[_0x1d7d('0x1c')](_0x11b83f)[_0x1d7d('0x1d')]();};}function respondWithResult(_0x5dd438,_0x55dba7){_0x55dba7=_0x55dba7||0xc8;return function(_0x1d3822){if(_0x1d3822){return _0x5dd438[_0x1d7d('0x1c')](_0x55dba7)[_0x1d7d('0x1e')](_0x1d3822);}};}function respondWithFilteredResult(_0x183fc6,_0xeb05b3){return function(_0x53423f){if(_0x53423f){var _0x28adf3=_0x53423f[_0x1d7d('0x1f')],_0x1de6cc=_0xeb05b3[_0x1d7d('0x20')],_0x51cbca=_0xeb05b3[_0x1d7d('0x20')]+_0xeb05b3[_0x1d7d('0x21')],_0xb90a8c;if(_0x51cbca>=_0x28adf3){_0x51cbca=_0x28adf3;_0xb90a8c=0xc8;}else{_0xb90a8c=0xce;}_0x183fc6['status'](_0xb90a8c);return _0x183fc6[_0x1d7d('0x22')](_0x1d7d('0x23'),_0x1de6cc+'-'+_0x51cbca+'/'+_0x28adf3)['json'](_0x53423f);}return null;};}function patchUpdates(_0x495212){return function(_0x2406dd){try{jsonpatch[_0x1d7d('0x24')](_0x2406dd,_0x495212,!![]);}catch(_0x2a9f2b){return BPromise[_0x1d7d('0x25')](_0x2a9f2b);}return _0x2406dd[_0x1d7d('0x26')]();};}function saveUpdates(_0x275d3c,_0x54d401){return function(_0x225f85){if(_0x225f85){return _0x225f85[_0x1d7d('0x27')](_0x275d3c)[_0x1d7d('0x28')](function(_0x5692d9){return _0x5692d9;});}return null;};}function removeEntity(_0x29caf4,_0x12c54b){return function(_0x4a1cdc){if(_0x4a1cdc){return _0x4a1cdc['destroy']()[_0x1d7d('0x28')](function(){_0x29caf4[_0x1d7d('0x1c')](0xcc)[_0x1d7d('0x1d')]();});}};}function handleEntityNotFound(_0x5097b8,_0x377653){return function(_0x106376){if(!_0x106376){_0x5097b8[_0x1d7d('0x29')](0x194);}return _0x106376;};}function handleError(_0x21e59,_0x4fa346){_0x4fa346=_0x4fa346||0x1f4;return function(_0x233463){logger[_0x1d7d('0x2a')](_0x233463['stack']);if(_0x233463['name']){delete _0x233463[_0x1d7d('0x2b')];}_0x21e59['status'](_0x4fa346)[_0x1d7d('0x2c')](_0x233463);};}exports[_0x1d7d('0x2d')]=function(_0x3bc6e8,_0x22c40d){var _0x465938={},_0x59f827={},_0x1c2616={'count':0x0,'rows':[]};var _0x98c1ad=_[_0x1d7d('0x2e')](db['VoiceRecording'][_0x1d7d('0x2f')],function(_0x1a935a){return{'name':_0x1a935a[_0x1d7d('0x30')],'type':_0x1a935a['type']['key']};});_0x59f827['model']=_[_0x1d7d('0x31')](_[_0x1d7d('0x2e')](_0x98c1ad,'name'),[_0x1d7d('0x32')]);_0x59f827[_0x1d7d('0x33')]=_[_0x1d7d('0x34')](_0x3bc6e8[_0x1d7d('0x33')]);_0x59f827[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x59f827[_0x1d7d('0x37')],_0x59f827[_0x1d7d('0x33')]);_0x465938[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0x59f827['model'],qs['fields'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x39')]));_0x465938[_0x1d7d('0x38')]=_0x465938[_0x1d7d('0x38')][_0x1d7d('0x3a')]?_0x465938[_0x1d7d('0x38')]:_0x59f827[_0x1d7d('0x37')];if(!_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3b')]('nolimit')){_0x465938[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x21')]);_0x465938['offset']=qs['offset'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x20')]);}_0x465938['order']=qs[_0x1d7d('0x3c')](_0x3bc6e8[_0x1d7d('0x33')]['sort']);_0x465938['where']=qs[_0x1d7d('0x35')](_[_0x1d7d('0x3d')](_0x3bc6e8[_0x1d7d('0x33')],_0x59f827[_0x1d7d('0x35')]));if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3e')]){_0x465938[_0x1d7d('0x3f')]=_[_0x1d7d('0x40')](_0x465938[_0x1d7d('0x3f')],{'$or':_[_0x1d7d('0x2e')](_0x98c1ad,function(_0x4fcdcc){if(_0x4fcdcc['type']!=='VIRTUAL'){var _0x5cab41={};_0x5cab41[_0x4fcdcc[_0x1d7d('0x2b')]]={'$like':'%'+_0x3bc6e8['query'][_0x1d7d('0x3e')]+'%'};return _0x5cab41;}})});}_0x465938=_[_0x1d7d('0x40')]({},_0x465938,_0x3bc6e8[_0x1d7d('0x41')]);var _0x515199={'where':_0x465938[_0x1d7d('0x3f')]};return db[_0x1d7d('0x42')][_0x1d7d('0x1f')](_0x515199)['then'](function(_0x1a6a8c){_0x1c2616[_0x1d7d('0x1f')]=_0x1a6a8c;if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x465938['include']=[{'all':!![]}];}return db[_0x1d7d('0x42')][_0x1d7d('0x44')](_0x465938);})[_0x1d7d('0x28')](function(_0x456d51){_0x1c2616['rows']=_0x456d51;return _0x1c2616;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x22c40d,_0x465938))['catch'](handleError(_0x22c40d,null));};exports[_0x1d7d('0x45')]=function(_0x31b850,_0x671580){var _0x1106d1={'raw':![],'where':{'id':_0x31b850['params']['id']}},_0xf667a1={};_0xf667a1['model']=_[_0x1d7d('0x34')](db[_0x1d7d('0x42')][_0x1d7d('0x2f')]);_0xf667a1['query']=_['keys'](_0x31b850[_0x1d7d('0x33')]);_0xf667a1['filters']=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],_0xf667a1[_0x1d7d('0x33')]);_0x1106d1[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],qs[_0x1d7d('0x39')](_0x31b850['query'][_0x1d7d('0x39')]));_0x1106d1[_0x1d7d('0x38')]=_0x1106d1['attributes'][_0x1d7d('0x3a')]?_0x1106d1[_0x1d7d('0x38')]:_0xf667a1[_0x1d7d('0x37')];if(_0x31b850[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x1106d1[_0x1d7d('0x46')]=[{'all':!![]}];}_0x1106d1=_[_0x1d7d('0x40')]({},_0x1106d1,_0x31b850[_0x1d7d('0x41')]);return db[_0x1d7d('0x42')][_0x1d7d('0x47')](_0x1106d1)[_0x1d7d('0x28')](handleEntityNotFound(_0x671580,null))[_0x1d7d('0x28')](respondWithResult(_0x671580,null))['catch'](handleError(_0x671580,null));};exports[_0x1d7d('0x48')]=function(_0x5904e0,_0xbfe60){return db['VoiceRecording'][_0x1d7d('0x48')](_0x5904e0[_0x1d7d('0x49')],{})[_0x1d7d('0x28')](respondWithResult(_0xbfe60,0xc9))[_0x1d7d('0x4a')](handleError(_0xbfe60,null));};exports['update']=function(_0x2dbb61,_0x5535d4){if(_0x2dbb61['body']['id']){delete _0x2dbb61[_0x1d7d('0x49')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x2dbb61[_0x1d7d('0x4b')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x5535d4,null))['then'](saveUpdates(_0x2dbb61[_0x1d7d('0x49')],null))[_0x1d7d('0x28')](respondWithResult(_0x5535d4,null))['catch'](handleError(_0x5535d4,null));};exports[_0x1d7d('0x4c')]=function(_0x2b9faa,_0xa64dbe){return db[_0x1d7d('0x42')]['describe']()['then'](respondWithResult(_0xa64dbe,null))[_0x1d7d('0x4a')](handleError(_0xa64dbe,null));};exports[_0x1d7d('0x4d')]=function(_0x35ff5d,_0x3938d0,_0x3cc5b7){var _0x550c9f=require(_0x1d7d('0x4e'));var _0x24e0b7=![];var _0x344b66={};if(_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]===_0x1d7d('0x50')){_0x344b66[_0x1d7d('0x50')]=_0x35ff5d['params']['id'];}else{_0x344b66['id']=_0x35ff5d[_0x1d7d('0x4b')]['id'];}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x344b66,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3938d0,null))[_0x1d7d('0x28')](function(_0x2d4cc3){if(_0x2d4cc3){var _0x3f5434=_0x2d4cc3['value'];var _0x7f41e=util[_0x1d7d('0x32')]('%s.cypher',_0x3f5434);if(fs[_0x1d7d('0x51')](_0x7f41e)){_0x24e0b7=!![];return _0x550c9f[_0x1d7d('0x52')](_0x7f41e,_0x3f5434,config[_0x1d7d('0x53')][_0x1d7d('0x54')])['then'](function(){return _0x2d4cc3;});}return _0x2d4cc3;}})[_0x1d7d('0x28')](function(_0x202af4){if(_0x202af4){var _0x4ba6ec=_0x202af4['value'];if(!fs[_0x1d7d('0x51')](_0x4ba6ec)){throw new db[(_0x1d7d('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x202af4[_0x1d7d('0x56')]){return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,_0x202af4[_0x1d7d('0x56')]+path[_0x1d7d('0x57')](_0x4ba6ec),function(){if(_0x24e0b7){fs['unlink'](_0x4ba6ec);}});}else{return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,function(_0x4b7a81){if(_0x24e0b7){fs[_0x1d7d('0x58')](_0x4ba6ec);}});}}})[_0x1d7d('0x4a')](function(_0x14078d){if(_0x14078d[_0x1d7d('0x59')]==='VoiceRecording\x20not\x20found'){_0x3938d0[_0x1d7d('0x1c')](0x194)[_0x1d7d('0x2c')](_0x1d7d('0x5a'));}else{return handleError(_0x3938d0,null);}});};exports[_0x1d7d('0x5b')]=function(_0x28ec14,_0x1cafd4,_0x17a365){var _0x2bd2a0=require(_0x1d7d('0x4e'));var _0x17c967=![];var _0x44a187={'$and':[db[_0x1d7d('0x5c')][_0x1d7d('0x3f')](db[_0x1d7d('0x5c')]['fn'](_0x1d7d('0x5d'),db['sequelize'][_0x1d7d('0x5e')]('uniqueid')),_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x5f')])]};if(_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]==='uniqueid'){_0x44a187[_0x1d7d('0x60')][_0x1d7d('0x61')]({'uniqueid':_0x28ec14['params']['id']});}else{_0x44a187[_0x1d7d('0x60')]['push']({'id':_0x28ec14[_0x1d7d('0x4b')]['id']});}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x44a187,'attributes':['id',_0x1d7d('0x62')],'raw':!![]})[_0x1d7d('0x28')](handleEntityNotFound(_0x1cafd4,null))[_0x1d7d('0x28')](function(_0x516aa0){if(_0x516aa0){var _0x3768a7=util[_0x1d7d('0x32')]('%s.cypher',_0x516aa0[_0x1d7d('0x62')]);if(fs[_0x1d7d('0x51')](_0x3768a7)){_0x17c967=!![];return _0x2bd2a0[_0x1d7d('0x52')](_0x3768a7,_0x516aa0['value'],config[_0x1d7d('0x53')][_0x1d7d('0x54')])[_0x1d7d('0x28')](function(){return _0x516aa0;});}return _0x516aa0;}})[_0x1d7d('0x28')](function(_0x5f15b7){if(_0x5f15b7){if(!fs[_0x1d7d('0x51')](_0x5f15b7[_0x1d7d('0x62')])){throw new db[(_0x1d7d('0x55'))][(_0x1d7d('0x63'))](_0x1d7d('0x64'));}if(_0x5f15b7['filename']){return _0x1cafd4[_0x1d7d('0x4d')](_0x5f15b7[_0x1d7d('0x62')],_0x5f15b7['filename']+path[_0x1d7d('0x57')](_0x5f15b7[_0x1d7d('0x62')]),function(){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}else{return _0x1cafd4['download'](_0x5f15b7[_0x1d7d('0x62')],function(_0x4a3159){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}}})[_0x1d7d('0x4a')](handleError(_0x1cafd4,null));};exports['destroy']=function(_0x4de5ee,_0x3818f4){return db[_0x1d7d('0x42')]['find']({'where':{'id':_0x4de5ee[_0x1d7d('0x4b')]['id']}})['then'](function(_0x6e9ee6){if(!_0x6e9ee6)throw new ReferenceError(_0x1d7d('0x65'));return _0x6e9ee6;})[_0x1d7d('0x28')](function(_0x446d39){var _0x30cf98=_0x446d39[_0x1d7d('0x62')];logger[_0x1d7d('0x66')](_0x1d7d('0x67'),_0x30cf98);if(!_[_0x1d7d('0x68')](_0x446d39[_0x1d7d('0x62')])&&fs[_0x1d7d('0x51')](_0x30cf98)){logger['info']('File:\x20\x22'+_0x30cf98+_0x1d7d('0x69'));fs[_0x1d7d('0x6a')](_0x30cf98);}_0x30cf98=_0x30cf98+_0x1d7d('0x6b');if(!_['isNil'](_0x446d39[_0x1d7d('0x62')])&&fs['existsSync'](_0x30cf98)){logger[_0x1d7d('0x66')](_0x1d7d('0x6c')+_0x30cf98+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1d7d('0x6a')](_0x30cf98);}return _0x446d39;})[_0x1d7d('0x28')](function(_0x4a8f1f){if(!_0x4a8f1f)throw new InternalError();return _0x4a8f1f[_0x1d7d('0x6d')]();})[_0x1d7d('0x28')](function(){_0x3818f4[_0x1d7d('0x1c')](0xcc)['end']();})['catch'](function(_0x2f774f){var _0x87e6aa=0x1f4;if(e instanceof ReferenceError){_0x87e6aa=0x194;}else if(e instanceof InternalError){_0x87e6aa=0x1f4;}logger['error'](_0x2f774f[_0x1d7d('0x6e')]);if(_0x2f774f[_0x1d7d('0x2b')]){delete _0x2f774f[_0x1d7d('0x2b')];}_0x3818f4[_0x1d7d('0x1c')](_0x87e6aa)['send'](_0x2f774f);});}; \ No newline at end of file +var _0x2032=['unlinkSync','.cypher','end','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','error','stack','name','send','map','VoiceRecording','rawAttributes','type','key','model','differenceBy','format','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','then','include','findAll','show','params','length','includeAll','merge','options','find','catch','create','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','downloads','sequelize','MD5','token','$and','push','download','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2032,0xd9));var _0x2203=function(_0x3f34a7,_0x37483d){_0x3f34a7=_0x3f34a7-0x0;var _0x2fe3e2=_0x2032[_0x3f34a7];return _0x2fe3e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2203('0x0'));var rimraf=require(_0x2203('0x1'));var zipdir=require(_0x2203('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2203('0x3'));var moment=require(_0x2203('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2203('0x5'));var util=require(_0x2203('0x6'));var path=require(_0x2203('0x7'));var sox=require(_0x2203('0x8'));var csv=require(_0x2203('0x9'));var ejs=require(_0x2203('0xa'));var fs=require('fs');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 db=require(_0x2203('0x16'))['db'];function respondWithStatusCode(_0x1abb51,_0x4b9376){_0x4b9376=_0x4b9376||0xcc;return function(_0x583bc7){if(_0x583bc7){return _0x1abb51['sendStatus'](_0x4b9376);}return _0x1abb51['status'](_0x4b9376)['end']();};}function respondWithResult(_0x238772,_0x538b30){_0x538b30=_0x538b30||0xc8;return function(_0x592e47){if(_0x592e47){return _0x238772[_0x2203('0x17')](_0x538b30)[_0x2203('0x18')](_0x592e47);}};}function respondWithFilteredResult(_0x1c1ead,_0x41af85){return function(_0x226209){if(_0x226209){var _0x3fe0a8=_0x226209[_0x2203('0x19')],_0x2c36e6=_0x41af85['offset'],_0x2c085c=_0x41af85[_0x2203('0x1a')]+_0x41af85[_0x2203('0x1b')],_0xdf9d0b;if(_0x2c085c>=_0x3fe0a8){_0x2c085c=_0x3fe0a8;_0xdf9d0b=0xc8;}else{_0xdf9d0b=0xce;}_0x1c1ead['status'](_0xdf9d0b);return _0x1c1ead[_0x2203('0x1c')](_0x2203('0x1d'),_0x2c36e6+'-'+_0x2c085c+'/'+_0x3fe0a8)['json'](_0x226209);}return null;};}function patchUpdates(_0x30c6f7){return function(_0x5ee83c){try{jsonpatch[_0x2203('0x1e')](_0x5ee83c,_0x30c6f7,!![]);}catch(_0x310b8c){return BPromise[_0x2203('0x1f')](_0x310b8c);}return _0x5ee83c[_0x2203('0x20')]();};}function saveUpdates(_0x15cb1a,_0x449039){return function(_0x538c23){if(_0x538c23){return _0x538c23[_0x2203('0x21')](_0x15cb1a)['then'](function(_0x5ac866){return _0x5ac866;});}return null;};}function removeEntity(_0x15f543,_0x496d82){return function(_0x3b8ef9){if(_0x3b8ef9){return _0x3b8ef9[_0x2203('0x22')]()['then'](function(){_0x15f543[_0x2203('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c8da9,_0x226374){return function(_0x2718f5){if(!_0x2718f5){_0x5c8da9[_0x2203('0x23')](0x194);}return _0x2718f5;};}function handleError(_0xfd0970,_0x1244f4){_0x1244f4=_0x1244f4||0x1f4;return function(_0x3114ef){logger[_0x2203('0x24')](_0x3114ef[_0x2203('0x25')]);if(_0x3114ef['name']){delete _0x3114ef[_0x2203('0x26')];}_0xfd0970[_0x2203('0x17')](_0x1244f4)[_0x2203('0x27')](_0x3114ef);};}exports['index']=function(_0xb2071b,_0x1cec17){var _0x5c5fd3={},_0xd6e109={},_0xd91f5d={'count':0x0,'rows':[]};var _0x1c6a77=_[_0x2203('0x28')](db[_0x2203('0x29')][_0x2203('0x2a')],function(_0x9c53f){return{'name':_0x9c53f['fieldName'],'type':_0x9c53f[_0x2203('0x2b')][_0x2203('0x2c')]};});_0xd6e109[_0x2203('0x2d')]=_[_0x2203('0x2e')](_['map'](_0x1c6a77,_0x2203('0x26')),[_0x2203('0x2f')]);_0xd6e109[_0x2203('0x30')]=_[_0x2203('0x31')](_0xb2071b['query']);_0xd6e109[_0x2203('0x32')]=_[_0x2203('0x33')](_0xd6e109['model'],_0xd6e109['query']);_0x5c5fd3[_0x2203('0x34')]=_['intersection'](_0xd6e109['model'],qs[_0x2203('0x35')](_0xb2071b[_0x2203('0x30')][_0x2203('0x35')]));_0x5c5fd3[_0x2203('0x34')]=_0x5c5fd3[_0x2203('0x34')]['length']?_0x5c5fd3[_0x2203('0x34')]:_0xd6e109[_0x2203('0x2d')];if(!_0xb2071b['query'][_0x2203('0x36')](_0x2203('0x37'))){_0x5c5fd3[_0x2203('0x1b')]=qs[_0x2203('0x1b')](_0xb2071b[_0x2203('0x30')][_0x2203('0x1b')]);_0x5c5fd3[_0x2203('0x1a')]=qs[_0x2203('0x1a')](_0xb2071b[_0x2203('0x30')]['offset']);}_0x5c5fd3[_0x2203('0x38')]=qs[_0x2203('0x39')](_0xb2071b['query']['sort']);_0x5c5fd3[_0x2203('0x3a')]=qs['filters'](_[_0x2203('0x3b')](_0xb2071b[_0x2203('0x30')],_0xd6e109[_0x2203('0x32')]));if(_0xb2071b['query']['filter']){_0x5c5fd3[_0x2203('0x3a')]=_['merge'](_0x5c5fd3[_0x2203('0x3a')],{'$or':_['map'](_0x1c6a77,function(_0x11451e){if(_0x11451e['type']!==_0x2203('0x3c')){var _0x13ed9e={};_0x13ed9e[_0x11451e[_0x2203('0x26')]]={'$like':'%'+_0xb2071b[_0x2203('0x30')][_0x2203('0x3d')]+'%'};return _0x13ed9e;}})});}_0x5c5fd3=_['merge']({},_0x5c5fd3,_0xb2071b['options']);var _0x4c0e9e={'where':_0x5c5fd3[_0x2203('0x3a')]};return db[_0x2203('0x29')][_0x2203('0x19')](_0x4c0e9e)[_0x2203('0x3e')](function(_0x3283fb){_0xd91f5d[_0x2203('0x19')]=_0x3283fb;if(_0xb2071b[_0x2203('0x30')]['includeAll']){_0x5c5fd3[_0x2203('0x3f')]=[{'all':!![]}];}return db[_0x2203('0x29')][_0x2203('0x40')](_0x5c5fd3);})[_0x2203('0x3e')](function(_0x493d12){_0xd91f5d['rows']=_0x493d12;return _0xd91f5d;})[_0x2203('0x3e')](respondWithFilteredResult(_0x1cec17,_0x5c5fd3))['catch'](handleError(_0x1cec17,null));};exports[_0x2203('0x41')]=function(_0x446209,_0x132091){var _0x548e06={'raw':![],'where':{'id':_0x446209[_0x2203('0x42')]['id']}},_0x5bba52={};_0x5bba52[_0x2203('0x2d')]=_[_0x2203('0x31')](db[_0x2203('0x29')][_0x2203('0x2a')]);_0x5bba52[_0x2203('0x30')]=_['keys'](_0x446209[_0x2203('0x30')]);_0x5bba52[_0x2203('0x32')]=_[_0x2203('0x33')](_0x5bba52[_0x2203('0x2d')],_0x5bba52[_0x2203('0x30')]);_0x548e06[_0x2203('0x34')]=_[_0x2203('0x33')](_0x5bba52[_0x2203('0x2d')],qs[_0x2203('0x35')](_0x446209[_0x2203('0x30')]['fields']));_0x548e06[_0x2203('0x34')]=_0x548e06[_0x2203('0x34')][_0x2203('0x43')]?_0x548e06[_0x2203('0x34')]:_0x5bba52['model'];if(_0x446209['query'][_0x2203('0x44')]){_0x548e06['include']=[{'all':!![]}];}_0x548e06=_[_0x2203('0x45')]({},_0x548e06,_0x446209[_0x2203('0x46')]);return db[_0x2203('0x29')][_0x2203('0x47')](_0x548e06)['then'](handleEntityNotFound(_0x132091,null))[_0x2203('0x3e')](respondWithResult(_0x132091,null))[_0x2203('0x48')](handleError(_0x132091,null));};exports['create']=function(_0x29bd91,_0x381b3e){return db[_0x2203('0x29')][_0x2203('0x49')](_0x29bd91['body'],{})['then'](respondWithResult(_0x381b3e,0xc9))[_0x2203('0x48')](handleError(_0x381b3e,null));};exports['update']=function(_0x543fde,_0x450082){if(_0x543fde[_0x2203('0x4a')]['id']){delete _0x543fde[_0x2203('0x4a')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x543fde[_0x2203('0x42')]['id']}})[_0x2203('0x3e')](handleEntityNotFound(_0x450082,null))[_0x2203('0x3e')](saveUpdates(_0x543fde[_0x2203('0x4a')],null))[_0x2203('0x3e')](respondWithResult(_0x450082,null))[_0x2203('0x48')](handleError(_0x450082,null));};exports['describe']=function(_0x747dce,_0x557659){return db[_0x2203('0x29')][_0x2203('0x4b')]()[_0x2203('0x3e')](respondWithResult(_0x557659,null))[_0x2203('0x48')](handleError(_0x557659,null));};exports['download']=function(_0x506795,_0x30d503,_0x1f772d){var _0x126aad=require(_0x2203('0x4c'));var _0x559370=![];var _0x4de47a={};if(_0x506795['query'][_0x2203('0x2b')]&&_0x506795[_0x2203('0x30')]['type']===_0x2203('0x4d')){_0x4de47a[_0x2203('0x4d')]=_0x506795['params']['id'];}else{_0x4de47a['id']=_0x506795[_0x2203('0x42')]['id'];}return db[_0x2203('0x29')][_0x2203('0x47')]({'where':_0x4de47a,'attributes':['id',_0x2203('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x30d503,null))[_0x2203('0x3e')](function(_0x5268d6){if(_0x5268d6){var _0x3858f0=_0x5268d6[_0x2203('0x4e')];var _0x4ee8cf=util[_0x2203('0x2f')](_0x2203('0x4f'),_0x3858f0);if(fs[_0x2203('0x50')](_0x4ee8cf)){_0x559370=!![];return _0x126aad[_0x2203('0x51')](_0x4ee8cf,_0x3858f0,config[_0x2203('0x52')][_0x2203('0x53')])['then'](function(){return _0x5268d6;});}return _0x5268d6;}})['then'](function(_0x2f2537){if(_0x2f2537){var _0x524356=_0x2f2537['value'];if(!fs[_0x2203('0x50')](_0x524356)){throw new db[(_0x2203('0x54'))][(_0x2203('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x2f2537[_0x2203('0x56')]){return _0x30d503['download'](_0x524356,_0x2f2537['filename']+path[_0x2203('0x57')](_0x524356),function(){if(_0x559370){fs['unlink'](_0x524356);}});}else{return _0x30d503['download'](_0x524356,function(_0x5efc59){if(_0x559370){fs[_0x2203('0x58')](_0x524356);}});}}})[_0x2203('0x48')](function(_0x367122){if(_0x367122[_0x2203('0x59')]===_0x2203('0x5a')){_0x30d503[_0x2203('0x17')](0x194)[_0x2203('0x27')](_0x2203('0x5b'));}else{return handleError(_0x30d503,null);}});};exports[_0x2203('0x5c')]=function(_0x216641,_0x384a59,_0x10d88b){var _0x58ff57=require('../../components/encryptor');var _0x2cd752=![];var _0x43d8c0={'$and':[db[_0x2203('0x5d')][_0x2203('0x3a')](db[_0x2203('0x5d')]['fn'](_0x2203('0x5e'),db['sequelize']['col'](_0x2203('0x4d'))),_0x216641[_0x2203('0x30')][_0x2203('0x5f')])]};if(_0x216641[_0x2203('0x30')][_0x2203('0x2b')]&&_0x216641[_0x2203('0x30')][_0x2203('0x2b')]===_0x2203('0x4d')){_0x43d8c0[_0x2203('0x60')][_0x2203('0x61')]({'uniqueid':_0x216641[_0x2203('0x42')]['id']});}else{_0x43d8c0['$and'][_0x2203('0x61')]({'id':_0x216641[_0x2203('0x42')]['id']});}return db[_0x2203('0x29')][_0x2203('0x47')]({'where':_0x43d8c0,'attributes':['id',_0x2203('0x4e')],'raw':!![]})[_0x2203('0x3e')](handleEntityNotFound(_0x384a59,null))[_0x2203('0x3e')](function(_0x544756){if(_0x544756){var _0x286121=util[_0x2203('0x2f')](_0x2203('0x4f'),_0x544756[_0x2203('0x4e')]);if(fs[_0x2203('0x50')](_0x286121)){_0x2cd752=!![];return _0x58ff57[_0x2203('0x51')](_0x286121,_0x544756[_0x2203('0x4e')],config[_0x2203('0x52')][_0x2203('0x53')])[_0x2203('0x3e')](function(){return _0x544756;});}return _0x544756;}})[_0x2203('0x3e')](function(_0x2015b1){if(_0x2015b1){if(!fs['existsSync'](_0x2015b1[_0x2203('0x4e')])){throw new db[(_0x2203('0x54'))][(_0x2203('0x55'))]('VoiceRecording\x20not\x20found');}if(_0x2015b1[_0x2203('0x56')]){return _0x384a59[_0x2203('0x62')](_0x2015b1[_0x2203('0x4e')],_0x2015b1[_0x2203('0x56')]+path[_0x2203('0x57')](_0x2015b1['value']),function(){if(_0x2cd752){fs[_0x2203('0x58')](_0x2015b1[_0x2203('0x4e')]);}});}else{return _0x384a59[_0x2203('0x62')](_0x2015b1['value'],function(_0x5507b6){if(_0x2cd752){fs['unlink'](_0x2015b1['value']);}});}}})['catch'](handleError(_0x384a59,null));};exports[_0x2203('0x22')]=function(_0xbc9f88,_0x27dd95){return db[_0x2203('0x29')][_0x2203('0x47')]({'where':{'id':_0xbc9f88[_0x2203('0x42')]['id']}})[_0x2203('0x3e')](function(_0x44bea0){if(!_0x44bea0)throw new ReferenceError('Entity\x20not\x20found');return _0x44bea0;})['then'](function(_0xb54e51){var _0x8f8648=_0xb54e51[_0x2203('0x4e')];logger[_0x2203('0x63')](_0x2203('0x64'),_0x8f8648);if(!_[_0x2203('0x65')](_0xb54e51[_0x2203('0x4e')])&&fs[_0x2203('0x50')](_0x8f8648)){logger[_0x2203('0x63')](_0x2203('0x66')+_0x8f8648+_0x2203('0x67'));fs[_0x2203('0x68')](_0x8f8648);}_0x8f8648=_0x8f8648+_0x2203('0x69');if(!_[_0x2203('0x65')](_0xb54e51[_0x2203('0x4e')])&&fs[_0x2203('0x50')](_0x8f8648)){logger[_0x2203('0x63')](_0x2203('0x66')+_0x8f8648+_0x2203('0x67'));fs['unlinkSync'](_0x8f8648);}return _0xb54e51;})[_0x2203('0x3e')](function(_0x5f4b14){if(!_0x5f4b14)throw new InternalError();return _0x5f4b14[_0x2203('0x22')]();})['then'](function(){_0x27dd95[_0x2203('0x17')](0xcc)[_0x2203('0x6a')]();})[_0x2203('0x48')](function(_0x2f3522){var _0x29c37d=0x1f4;if(e instanceof ReferenceError){_0x29c37d=0x194;}else if(e instanceof InternalError){_0x29c37d=0x1f4;}logger[_0x2203('0x24')](_0x2f3522[_0x2203('0x25')]);if(_0x2f3522[_0x2203('0x26')]){delete _0x2f3522['name'];}_0x27dd95['status'](_0x29c37d)[_0x2203('0x27')](_0x2f3522);});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index c4945a0..6b0932d 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 _0x62d6=['voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording'];(function(_0x3f146c,_0x42e0dc){var _0x407f72=function(_0x42ada8){while(--_0x42ada8){_0x3f146c['push'](_0x3f146c['shift']());}};_0x407f72(++_0x42e0dc);}(_0x62d6,0xce));var _0x662d=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x62d6[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0x662d('0x0'));var logger=require(_0x662d('0x1'))(_0x662d('0x2'));var moment=require(_0x662d('0x3'));var BPromise=require(_0x662d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x662d('0x5'));var rimraf=require('rimraf');var config=require(_0x662d('0x6'));var attributes=require(_0x662d('0x7'));module[_0x662d('0x8')]=function(_0xff30d4,_0x432fce){return _0xff30d4['define'](_0x662d('0x9'),attributes,{'tableName':_0x662d('0xa'),'paranoid':![],'indexes':[{'name':_0x662d('0xb'),'fields':[_0x662d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x26a3=['VoiceRecording','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define'];(function(_0x3382d0,_0x3511c5){var _0x1cd7f1=function(_0x212840){while(--_0x212840){_0x3382d0['push'](_0x3382d0['shift']());}};_0x1cd7f1(++_0x3511c5);}(_0x26a3,0x6d));var _0x326a=function(_0x281f19,_0x2ef361){_0x281f19=_0x281f19-0x0;var _0x5f58fb=_0x26a3[_0x281f19];return _0x5f58fb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x326a('0x0'))(_0x326a('0x1'));var moment=require(_0x326a('0x2'));var BPromise=require(_0x326a('0x3'));var rp=require(_0x326a('0x4'));var fs=require('fs');var path=require(_0x326a('0x5'));var rimraf=require(_0x326a('0x6'));var config=require(_0x326a('0x7'));var attributes=require(_0x326a('0x8'));module[_0x326a('0x9')]=function(_0x426a7d,_0x4f9054){return _0x426a7d[_0x326a('0xa')](_0x326a('0xb'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index a43a0a4..1348102 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 _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x722d30,_0x1633a3){var _0x22b826=function(_0x2fc0e0){while(--_0x2fc0e0){_0x722d30['push'](_0x722d30['shift']());}};_0x22b826(++_0x1633a3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 7ffb0cc..6c01f74 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 _0x71ab=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x243aca,_0x272cb3){var _0x4a586d=function(_0x388d8b){while(--_0x388d8b){_0x243aca['push'](_0x243aca['shift']());}};_0x4a586d(++_0x272cb3);}(_0x71ab,0x64));var _0xb71a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x71ab[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller['update']);router[_0xb71a('0xf')]('/:id',auth[_0xb71a('0x8')](),controller[_0xb71a('0x10')]);module[_0xb71a('0x11')]=router; \ No newline at end of file +var _0x46ed=['multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports'];(function(_0xf715d6,_0x3eb3af){var _0x467c46=function(_0x2f6327){while(--_0x2f6327){_0xf715d6['push'](_0xf715d6['shift']());}};_0x467c46(++_0x3eb3af);}(_0x46ed,0x168));var _0xd46e=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x46ed[_0x51020b];return _0x371e47;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd46e('0x5'));var config=require(_0xd46e('0x6'));var controller=require('./voiceTransferReport.controller');router[_0xd46e('0x7')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0x9')]);router[_0xd46e('0x7')](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0xb')]);router[_0xd46e('0xc')]('/',auth[_0xd46e('0x8')](),controller[_0xd46e('0xd')]);router[_0xd46e('0xe')]('/:id',auth[_0xd46e('0x8')](),controller[_0xd46e('0xf')]);router['delete'](_0xd46e('0xa'),auth[_0xd46e('0x8')](),controller[_0xd46e('0x10')]);module[_0xd46e('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c258122..b5aaf2e 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 _0x7348=['attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x2f7679,_0x1bb5f4){var _0x37e575=function(_0x1944dd){while(--_0x1944dd){_0x2f7679['push'](_0x2f7679['shift']());}};_0x37e575(++_0x1bb5f4);}(_0x7348,0x81));var _0x8734=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7348[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x8734('0x0'));var moment=require(_0x8734('0x1'));module['exports']={'type':{'type':Sequelize[_0x8734('0x2')]('blind',_0x8734('0x3'))},'result':{'type':Sequelize[_0x8734('0x4')]},'transfererchannel':{'type':Sequelize[_0x8734('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x8734('0x4')]},'transferercalleridname':{'type':Sequelize[_0x8734('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x8734('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x8734('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x8734('0x4')]},'transfereechannel':{'type':Sequelize[_0x8734('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x8734('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8734('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8734('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x8734('0x4')]},'transfereecontext':{'type':Sequelize[_0x8734('0x4')]},'transfereeexten':{'type':Sequelize[_0x8734('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x8734('0x5'),'No')},'context':{'type':Sequelize[_0x8734('0x4')]},'extension':{'type':Sequelize[_0x8734('0x4')]}}; \ No newline at end of file +var _0x8b07=['attended','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x582f72,_0x886d8){var _0x4cd5fe=function(_0x4ac1c7){while(--_0x4ac1c7){_0x582f72['push'](_0x582f72['shift']());}};_0x4cd5fe(++_0x886d8);}(_0x8b07,0x1c3));var _0x78b0=function(_0x26d78c,_0x43ae6c){_0x26d78c=_0x26d78c-0x0;var _0x2fbf65=_0x8b07[_0x26d78c];return _0x2fbf65;};'use strict';var Sequelize=require(_0x78b0('0x0'));var moment=require(_0x78b0('0x1'));module[_0x78b0('0x2')]={'type':{'type':Sequelize[_0x78b0('0x3')]('blind',_0x78b0('0x4'))},'result':{'type':Sequelize[_0x78b0('0x5')]},'transfererchannel':{'type':Sequelize[_0x78b0('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x78b0('0x5')]},'transferercalleridname':{'type':Sequelize[_0x78b0('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x78b0('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x78b0('0x5')]},'transferercontext':{'type':Sequelize[_0x78b0('0x5')]},'transfererexten':{'type':Sequelize[_0x78b0('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x78b0('0x5')]},'transfereechannel':{'type':Sequelize[_0x78b0('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x78b0('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x78b0('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x78b0('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x78b0('0x5')]},'transfereecontext':{'type':Sequelize[_0x78b0('0x5')]},'transfereeexten':{'type':Sequelize[_0x78b0('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x78b0('0x5')]},'isexternal':{'type':Sequelize[_0x78b0('0x3')](_0x78b0('0x6'),'No')},'context':{'type':Sequelize[_0x78b0('0x5')]},'extension':{'type':Sequelize[_0x78b0('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index af14aab..b45481e 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 _0x0713=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x4e6be9,_0x318bd5){var _0x27b3c2=function(_0x51355c){while(--_0x51355c){_0x4e6be9['push'](_0x4e6be9['shift']());}};_0x27b3c2(++_0x318bd5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={},_0x163604={},_0x950fde={'count':0x0,'rows':[]};var _0x3fa3b8=_[_0x3071('0x2d')](db[_0x3071('0x2e')][_0x3071('0x2f')],function(_0x32f1b4){return{'name':_0x32f1b4[_0x3071('0x30')],'type':_0x32f1b4[_0x3071('0x31')]['key']};});_0x163604['model']=_[_0x3071('0x2d')](_0x3fa3b8,_0x3071('0x2a'));_0x163604[_0x3071('0x32')]=_[_0x3071('0x33')](_0x4d5c4b[_0x3071('0x32')]);_0x163604[_0x3071('0x34')]=_[_0x3071('0x35')](_0x163604[_0x3071('0x36')],_0x163604['query']);_0x28792d['attributes']=_['intersection'](_0x163604[_0x3071('0x36')],qs[_0x3071('0x37')](_0x4d5c4b['query'][_0x3071('0x37')]));_0x28792d[_0x3071('0x38')]=_0x28792d[_0x3071('0x38')][_0x3071('0x39')]?_0x28792d['attributes']:_0x163604[_0x3071('0x36')];if(!_0x4d5c4b[_0x3071('0x32')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x28792d[_0x3071('0x1f')]=qs[_0x3071('0x1f')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x1f')]);_0x28792d['offset']=qs[_0x3071('0x1e')](_0x4d5c4b['query']['offset']);}_0x28792d[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x4d5c4b['query'][_0x3071('0x3d')]);_0x28792d[_0x3071('0x3e')]=qs[_0x3071('0x34')](_[_0x3071('0x3f')](_0x4d5c4b[_0x3071('0x32')],_0x163604[_0x3071('0x34')]));if(_0x4d5c4b['query'][_0x3071('0x40')]){_0x28792d[_0x3071('0x3e')]=_['merge'](_0x28792d[_0x3071('0x3e')],{'$or':_['map'](_0x3fa3b8,function(_0x28f855){if(_0x28f855[_0x3071('0x31')]!=='VIRTUAL'){var _0x593c99={};_0x593c99[_0x28f855[_0x3071('0x2a')]]={'$like':'%'+_0x4d5c4b[_0x3071('0x32')][_0x3071('0x40')]+'%'};return _0x593c99;}})});}_0x28792d=_['merge']({},_0x28792d,_0x4d5c4b[_0x3071('0x41')]);var _0x534a77={'where':_0x28792d[_0x3071('0x3e')]};return db['VoiceTransferReport'][_0x3071('0x1d')](_0x534a77)[_0x3071('0x26')](function(_0x1fcc52){_0x950fde[_0x3071('0x1d')]=_0x1fcc52;if(_0x4d5c4b[_0x3071('0x32')]['includeAll']){_0x28792d['include']=[{'all':!![]}];}return db[_0x3071('0x2e')][_0x3071('0x42')](_0x28792d);})[_0x3071('0x26')](function(_0x1f69a6){_0x950fde['rows']=_0x1f69a6;return _0x950fde;})[_0x3071('0x26')](respondWithFilteredResult(_0x4fb1ca,_0x28792d))[_0x3071('0x43')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x44')]=function(_0x25c29f,_0x277104){var _0xb9a4b8={'raw':!![],'where':{'id':_0x25c29f[_0x3071('0x45')]['id']}},_0x56a9d8={};_0x56a9d8['model']=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x56a9d8[_0x3071('0x32')]=_[_0x3071('0x33')](_0x25c29f[_0x3071('0x32')]);_0x56a9d8[_0x3071('0x34')]=_[_0x3071('0x35')](_0x56a9d8[_0x3071('0x36')],_0x56a9d8[_0x3071('0x32')]);_0xb9a4b8[_0x3071('0x38')]=_['intersection'](_0x56a9d8[_0x3071('0x36')],qs[_0x3071('0x37')](_0x25c29f[_0x3071('0x32')][_0x3071('0x37')]));_0xb9a4b8[_0x3071('0x38')]=_0xb9a4b8['attributes']['length']?_0xb9a4b8[_0x3071('0x38')]:_0x56a9d8[_0x3071('0x36')];if(_0x25c29f[_0x3071('0x32')][_0x3071('0x46')]){_0xb9a4b8[_0x3071('0x47')]=[{'all':!![]}];}_0xb9a4b8=_['merge']({},_0xb9a4b8,_0x25c29f[_0x3071('0x41')]);return db['VoiceTransferReport'][_0x3071('0x48')](_0xb9a4b8)['then'](handleEntityNotFound(_0x277104,null))['then'](respondWithResult(_0x277104,null))[_0x3071('0x43')](handleError(_0x277104,null));};exports['create']=function(_0x1862ea,_0x5a0a69){return db[_0x3071('0x2e')][_0x3071('0x49')](_0x1862ea[_0x3071('0x4a')],{})[_0x3071('0x26')](respondWithResult(_0x5a0a69,0xc9))['catch'](handleError(_0x5a0a69,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){if(_0x575c12['body']['id']){delete _0x575c12[_0x3071('0x4a')]['id'];}return db[_0x3071('0x2e')]['find']({'where':{'id':_0x575c12[_0x3071('0x45')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0xd273ec,null))[_0x3071('0x26')](saveUpdates(_0x575c12[_0x3071('0x4a')],null))[_0x3071('0x26')](respondWithResult(_0xd273ec,null))[_0x3071('0x43')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x577060,_0x2c6e4c){return db[_0x3071('0x2e')][_0x3071('0x48')]({'where':{'id':_0x577060[_0x3071('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c6e4c,null))[_0x3071('0x26')](removeEntity(_0x2c6e4c,null))[_0x3071('0x43')](handleError(_0x2c6e4c,null));}; \ No newline at end of file +var _0x087b=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','send','index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','catch','show','intersection','find','create','body','params','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x189603,_0x25d0ea){var _0x455dc5=function(_0x421bc3){while(--_0x421bc3){_0x189603['push'](_0x189603['shift']());}};_0x455dc5(++_0x25d0ea);}(_0x087b,0x11a));var _0xb087=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x087b[_0x5f0089];return _0x193892;};'use strict';var pdf=require(_0xb087('0x0'));var emlformat=require(_0xb087('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb087('0x2'));var rp=require('request-promise');var moment=require(_0xb087('0x3'));var BPromise=require(_0xb087('0x4'));var Mustache=require(_0xb087('0x5'));var util=require(_0xb087('0x6'));var path=require(_0xb087('0x7'));var sox=require(_0xb087('0x8'));var csv=require(_0xb087('0x9'));var ejs=require(_0xb087('0xa'));var fs=require('fs');var _=require(_0xb087('0xb'));var squel=require(_0xb087('0xc'));var crypto=require(_0xb087('0xd'));var jsforce=require(_0xb087('0xe'));var deskjs=require(_0xb087('0xf'));var toCsv=require(_0xb087('0x9'));var querystring=require(_0xb087('0x10'));var Papa=require(_0xb087('0x11'));var Redis=require(_0xb087('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb087('0x13'));var as=require(_0xb087('0x14'));var hardwareService=require(_0xb087('0x15'));var logger=require(_0xb087('0x16'))(_0xb087('0x17'));var utils=require(_0xb087('0x18'));var config=require(_0xb087('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x189e2b,_0x31f977){_0x31f977=_0x31f977||0xcc;return function(_0x323656){if(_0x323656){return _0x189e2b['sendStatus'](_0x31f977);}return _0x189e2b[_0xb087('0x1a')](_0x31f977)[_0xb087('0x1b')]();};}function respondWithResult(_0x43f136,_0x46410b){_0x46410b=_0x46410b||0xc8;return function(_0x11784c){if(_0x11784c){return _0x43f136[_0xb087('0x1a')](_0x46410b)[_0xb087('0x1c')](_0x11784c);}};}function respondWithFilteredResult(_0x5147e3,_0x24e1a3){return function(_0x16d0b7){if(_0x16d0b7){var _0x5193a4=_0x16d0b7[_0xb087('0x1d')],_0x43e576=_0x24e1a3[_0xb087('0x1e')],_0x412b48=_0x24e1a3[_0xb087('0x1e')]+_0x24e1a3['limit'],_0x597478;if(_0x412b48>=_0x5193a4){_0x412b48=_0x5193a4;_0x597478=0xc8;}else{_0x597478=0xce;}_0x5147e3[_0xb087('0x1a')](_0x597478);return _0x5147e3[_0xb087('0x1f')](_0xb087('0x20'),_0x43e576+'-'+_0x412b48+'/'+_0x5193a4)[_0xb087('0x1c')](_0x16d0b7);}return null;};}function patchUpdates(_0x4e333b){return function(_0x13d534){try{jsonpatch[_0xb087('0x21')](_0x13d534,_0x4e333b,!![]);}catch(_0x10bb5b){return BPromise[_0xb087('0x22')](_0x10bb5b);}return _0x13d534['save']();};}function saveUpdates(_0x5aeab1,_0x5ea3dc){return function(_0x49450a){if(_0x49450a){return _0x49450a[_0xb087('0x23')](_0x5aeab1)[_0xb087('0x24')](function(_0x3d0f57){return _0x3d0f57;});}return null;};}function removeEntity(_0x1f3c0e,_0x1fb765){return function(_0x258b4c){if(_0x258b4c){return _0x258b4c[_0xb087('0x25')]()['then'](function(){_0x1f3c0e[_0xb087('0x1a')](0xcc)[_0xb087('0x1b')]();});}};}function handleEntityNotFound(_0x1de654,_0x1cfb3e){return function(_0x3ad74e){if(!_0x3ad74e){_0x1de654['sendStatus'](0x194);}return _0x3ad74e;};}function handleError(_0x183eab,_0xdd4216){_0xdd4216=_0xdd4216||0x1f4;return function(_0x502438){logger['error'](_0x502438['stack']);if(_0x502438['name']){delete _0x502438['name'];}_0x183eab[_0xb087('0x1a')](_0xdd4216)[_0xb087('0x26')](_0x502438);};}exports[_0xb087('0x27')]=function(_0x3ca2df,_0xd9ec66){var _0xb72173={},_0xf3f41f={},_0x35a52c={'count':0x0,'rows':[]};var _0x6cfb22=_[_0xb087('0x28')](db[_0xb087('0x29')][_0xb087('0x2a')],function(_0xb0baf6){return{'name':_0xb0baf6[_0xb087('0x2b')],'type':_0xb0baf6['type'][_0xb087('0x2c')]};});_0xf3f41f[_0xb087('0x2d')]=_[_0xb087('0x28')](_0x6cfb22,_0xb087('0x2e'));_0xf3f41f[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x3ca2df[_0xb087('0x2f')]);_0xf3f41f[_0xb087('0x31')]=_['intersection'](_0xf3f41f['model'],_0xf3f41f[_0xb087('0x2f')]);_0xb72173[_0xb087('0x32')]=_['intersection'](_0xf3f41f[_0xb087('0x2d')],qs[_0xb087('0x33')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x33')]));_0xb72173[_0xb087('0x32')]=_0xb72173[_0xb087('0x32')][_0xb087('0x34')]?_0xb72173[_0xb087('0x32')]:_0xf3f41f[_0xb087('0x2d')];if(!_0x3ca2df[_0xb087('0x2f')][_0xb087('0x35')](_0xb087('0x36'))){_0xb72173['limit']=qs[_0xb087('0x37')](_0x3ca2df['query'][_0xb087('0x37')]);_0xb72173[_0xb087('0x1e')]=qs[_0xb087('0x1e')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x1e')]);}_0xb72173[_0xb087('0x38')]=qs[_0xb087('0x39')](_0x3ca2df[_0xb087('0x2f')][_0xb087('0x39')]);_0xb72173['where']=qs['filters'](_[_0xb087('0x3a')](_0x3ca2df[_0xb087('0x2f')],_0xf3f41f[_0xb087('0x31')]));if(_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]){_0xb72173['where']=_[_0xb087('0x3c')](_0xb72173[_0xb087('0x3d')],{'$or':_['map'](_0x6cfb22,function(_0x480e22){if(_0x480e22[_0xb087('0x3e')]!==_0xb087('0x3f')){var _0x130ee9={};_0x130ee9[_0x480e22['name']]={'$like':'%'+_0x3ca2df[_0xb087('0x2f')][_0xb087('0x3b')]+'%'};return _0x130ee9;}})});}_0xb72173=_[_0xb087('0x3c')]({},_0xb72173,_0x3ca2df[_0xb087('0x40')]);var _0x3c8f51={'where':_0xb72173['where']};return db[_0xb087('0x29')]['count'](_0x3c8f51)[_0xb087('0x24')](function(_0x5a582d){_0x35a52c[_0xb087('0x1d')]=_0x5a582d;if(_0x3ca2df[_0xb087('0x2f')]['includeAll']){_0xb72173[_0xb087('0x41')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0xb087('0x42')](_0xb72173);})['then'](function(_0x2d2c74){_0x35a52c[_0xb087('0x43')]=_0x2d2c74;return _0x35a52c;})[_0xb087('0x24')](respondWithFilteredResult(_0xd9ec66,_0xb72173))[_0xb087('0x44')](handleError(_0xd9ec66,null));};exports[_0xb087('0x45')]=function(_0x2a4787,_0x35d010){var _0x5e7690={'raw':!![],'where':{'id':_0x2a4787['params']['id']}},_0x1625f6={};_0x1625f6[_0xb087('0x2d')]=_[_0xb087('0x30')](db['VoiceTransferReport'][_0xb087('0x2a')]);_0x1625f6[_0xb087('0x2f')]=_[_0xb087('0x30')](_0x2a4787['query']);_0x1625f6[_0xb087('0x31')]=_['intersection'](_0x1625f6[_0xb087('0x2d')],_0x1625f6[_0xb087('0x2f')]);_0x5e7690['attributes']=_[_0xb087('0x46')](_0x1625f6[_0xb087('0x2d')],qs['fields'](_0x2a4787[_0xb087('0x2f')][_0xb087('0x33')]));_0x5e7690['attributes']=_0x5e7690[_0xb087('0x32')][_0xb087('0x34')]?_0x5e7690[_0xb087('0x32')]:_0x1625f6[_0xb087('0x2d')];if(_0x2a4787['query']['includeAll']){_0x5e7690[_0xb087('0x41')]=[{'all':!![]}];}_0x5e7690=_[_0xb087('0x3c')]({},_0x5e7690,_0x2a4787[_0xb087('0x40')]);return db[_0xb087('0x29')][_0xb087('0x47')](_0x5e7690)[_0xb087('0x24')](handleEntityNotFound(_0x35d010,null))['then'](respondWithResult(_0x35d010,null))['catch'](handleError(_0x35d010,null));};exports[_0xb087('0x48')]=function(_0x520acc,_0x3a405b){return db[_0xb087('0x29')][_0xb087('0x48')](_0x520acc[_0xb087('0x49')],{})['then'](respondWithResult(_0x3a405b,0xc9))[_0xb087('0x44')](handleError(_0x3a405b,null));};exports['update']=function(_0x2fe8a0,_0x73413b){if(_0x2fe8a0[_0xb087('0x49')]['id']){delete _0x2fe8a0[_0xb087('0x49')]['id'];}return db[_0xb087('0x29')]['find']({'where':{'id':_0x2fe8a0[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x73413b,null))[_0xb087('0x24')](saveUpdates(_0x2fe8a0['body'],null))[_0xb087('0x24')](respondWithResult(_0x73413b,null))['catch'](handleError(_0x73413b,null));};exports['destroy']=function(_0x1c9f8f,_0x341665){return db['VoiceTransferReport'][_0xb087('0x47')]({'where':{'id':_0x1c9f8f[_0xb087('0x4a')]['id']}})[_0xb087('0x24')](handleEntityNotFound(_0x341665,null))['then'](removeEntity(_0x341665,null))['catch'](handleError(_0x341665,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 2f561e8..b629e34 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 _0x594e=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','../../config/logger','moment'];(function(_0x14184f,_0x490bcb){var _0x2bf788=function(_0x5aac29){while(--_0x5aac29){_0x14184f['push'](_0x14184f['shift']());}};_0x2bf788(++_0x490bcb);}(_0x594e,0x11e));var _0xe594=function(_0x10be92,_0x53339e){_0x10be92=_0x10be92-0x0;var _0x555fbc=_0x594e[_0x10be92];return _0x555fbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe594('0x0'))('api');var moment=require(_0xe594('0x1'));var BPromise=require('bluebird');var rp=require(_0xe594('0x2'));var fs=require('fs');var path=require(_0xe594('0x3'));var rimraf=require(_0xe594('0x4'));var config=require(_0xe594('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0xe594('0x6')]=function(_0x48c301,_0x4b17bb){return _0x48c301[_0xe594('0x7')](_0xe594('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaed4=['moment','bluebird','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','../../config/logger','api'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xaed4,0xf4));var _0x4aed=function(_0x29afc6,_0x37118f){_0x29afc6=_0x29afc6-0x0;var _0x23fb71=_0xaed4[_0x29afc6];return _0x23fb71;};'use strict';var _=require(_0x4aed('0x0'));var util=require('util');var logger=require(_0x4aed('0x1'))(_0x4aed('0x2'));var moment=require(_0x4aed('0x3'));var BPromise=require(_0x4aed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4aed('0x5'));var rimraf=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var attributes=require(_0x4aed('0x8'));module[_0x4aed('0x9')]=function(_0x4ed9ed,_0x33cb6b){return _0x4ed9ed[_0x4aed('0xa')](_0x4aed('0xb'),attributes,{'tableName':_0x4aed('0xc'),'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 1ab5d60..6cbc0d8 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 _0x3f74=['message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f74,0xe9));var _0x43f7=function(_0x1ec709,_0x1868c2){_0x1ec709=_0x1ec709-0x0;var _0x1f9db0=_0x3f74[_0x1ec709];return _0x1f9db0;};'use strict';var _=require(_0x43f7('0x0'));var util=require(_0x43f7('0x1'));var moment=require('moment');var BPromise=require(_0x43f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x43f7('0x4'));var logger=require(_0x43f7('0x5'))(_0x43f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x43f7('0x7'));var client=jayson[_0x43f7('0x8')][_0x43f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x883ae,_0x460140,_0x351a70){return new BPromise(function(_0x93f2,_0x2cb703){return client[_0x43f7('0xa')](_0x883ae,_0x351a70)[_0x43f7('0xb')](function(_0x3fae6a){logger[_0x43f7('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x460140,_0x43f7('0xd'));logger[_0x43f7('0xe')](_0x43f7('0xf'),_0x460140,_0x43f7('0xd'),JSON[_0x43f7('0x10')](_0x3fae6a));if(_0x3fae6a[_0x43f7('0x11')]){if(_0x3fae6a['error']['code']===0x1f4){logger[_0x43f7('0x11')](_0x43f7('0x12'),_0x460140,_0x3fae6a[_0x43f7('0x11')][_0x43f7('0x13')]);return _0x2cb703(_0x3fae6a[_0x43f7('0x11')][_0x43f7('0x13')]);}logger[_0x43f7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x460140,_0x3fae6a['error'][_0x43f7('0x13')]);return _0x93f2(_0x3fae6a['error'][_0x43f7('0x13')]);}else{logger[_0x43f7('0xc')](_0x43f7('0x12'),_0x460140,_0x43f7('0xd'));_0x93f2(_0x3fae6a[_0x43f7('0x14')][_0x43f7('0x13')]);}})[_0x43f7('0x15')](function(_0x3a7098){logger[_0x43f7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x460140,_0x3a7098);_0x2cb703(_0x3a7098);});});}exports['CreateVoiceTransferReport']=function(_0x5eb7f3){var _0x1809c8=this;return new Promise(function(_0x101eb7,_0x160b31){return db[_0x43f7('0x16')][_0x43f7('0x17')](_0x5eb7f3[_0x43f7('0x18')],{'raw':_0x5eb7f3[_0x43f7('0x19')]?_0x5eb7f3[_0x43f7('0x19')][_0x43f7('0x1a')]===undefined?!![]:![]:!![]})[_0x43f7('0xb')](function(_0x2ed7ee){logger[_0x43f7('0xc')](_0x43f7('0x1b'),_0x5eb7f3);logger[_0x43f7('0xe')]('CreateVoiceTransferReport',_0x5eb7f3,JSON[_0x43f7('0x10')](_0x2ed7ee));_0x101eb7(_0x2ed7ee);})[_0x43f7('0x15')](function(_0x3e831e){logger['error']('CreateVoiceTransferReport',_0x3e831e['message'],_0x5eb7f3);_0x160b31(_0x1809c8[_0x43f7('0x11')](0x1f4,_0x3e831e['message']));});});}; \ No newline at end of file +var _0x2263=['stringify','error','code','message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xf4ec85,_0x33c732){var _0x3ab92d=function(_0x1a21d6){while(--_0x1a21d6){_0xf4ec85['push'](_0xf4ec85['shift']());}};_0x3ab92d(++_0x33c732);}(_0x2263,0xd0));var _0x3226=function(_0x385eb1,_0x497a94){_0x385eb1=_0x385eb1-0x0;var _0x5d40eb=_0x2263[_0x385eb1];return _0x5d40eb;};'use strict';var _=require(_0x3226('0x0'));var util=require(_0x3226('0x1'));var moment=require(_0x3226('0x2'));var BPromise=require('bluebird');var rs=require(_0x3226('0x3'));var fs=require('fs');var Redis=require(_0x3226('0x4'));var db=require(_0x3226('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3226('0x6'))('rpc');var config=require(_0x3226('0x7'));var jayson=require(_0x3226('0x8'));var client=jayson[_0x3226('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20c4f0,_0x2c598d,_0x2dca5e){return new BPromise(function(_0x208e55,_0x18681e){return client[_0x3226('0xa')](_0x20c4f0,_0x2dca5e)[_0x3226('0xb')](function(_0x2cf27d){logger[_0x3226('0xc')](_0x3226('0xd'),_0x2c598d,_0x3226('0xe'));logger[_0x3226('0xf')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x2c598d,_0x3226('0xe'),JSON[_0x3226('0x10')](_0x2cf27d));if(_0x2cf27d[_0x3226('0x11')]){if(_0x2cf27d['error'][_0x3226('0x12')]===0x1f4){logger[_0x3226('0x11')](_0x3226('0xd'),_0x2c598d,_0x2cf27d[_0x3226('0x11')]['message']);return _0x18681e(_0x2cf27d['error'][_0x3226('0x13')]);}logger['error'](_0x3226('0xd'),_0x2c598d,_0x2cf27d[_0x3226('0x11')]['message']);return _0x208e55(_0x2cf27d[_0x3226('0x11')][_0x3226('0x13')]);}else{logger['info'](_0x3226('0xd'),_0x2c598d,'request\x20sent');_0x208e55(_0x2cf27d[_0x3226('0x14')][_0x3226('0x13')]);}})[_0x3226('0x15')](function(_0x20c63a){logger[_0x3226('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2c598d,_0x20c63a);_0x18681e(_0x20c63a);});});}exports['CreateVoiceTransferReport']=function(_0x167e37){var _0x3f4337=this;return new Promise(function(_0x3c1cf4,_0x3090e4){return db[_0x3226('0x16')][_0x3226('0x17')](_0x167e37[_0x3226('0x18')],{'raw':_0x167e37[_0x3226('0x19')]?_0x167e37['options'][_0x3226('0x1a')]===undefined?!![]:![]:!![]})[_0x3226('0xb')](function(_0x1e7522){logger[_0x3226('0xc')](_0x3226('0x1b'),_0x167e37);logger[_0x3226('0xf')](_0x3226('0x1b'),_0x167e37,JSON[_0x3226('0x10')](_0x1e7522));_0x3c1cf4(_0x1e7522);})['catch'](function(_0x10210e){logger[_0x3226('0x11')](_0x3226('0x1b'),_0x10210e[_0x3226('0x13')],_0x167e37);_0x3090e4(_0x3f4337[_0x3226('0x11')](0x1f4,_0x10210e[_0x3226('0x13')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 4202db6..b811756 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x50f8=['./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','then','listen','start','info','map','filter','online','join','name','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x882034,_0x39adb1){var _0x149529=function(_0x29ab79){while(--_0x29ab79){_0x882034['push'](_0x882034['shift']());}};_0x149529(++_0x39adb1);}(_0x50f8,0x138));var _0x850f=function(_0x1d2161,_0xbad001){_0x1d2161=_0x1d2161-0x0;var _0xa9b918=_0x50f8[_0x1d2161];return _0xa9b918;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x850f('0x0'));var config=require(_0x850f('0x1'));var logger=require(_0x850f('0x2'))(_0x850f('0x3'));var pm2=require(_0x850f('0x4'));var pm2Config=require(_0x850f('0x5'));var schedule=require(_0x850f('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0x850f('0x7')]['sync']()[_0x850f('0x8')](function(){return rpc[_0x850f('0x9')]();})[_0x850f('0x8')](function(_0x5153c8){logger['info'](_0x5153c8);return chat[_0x850f('0xa')]();})[_0x850f('0x8')](function(){return schedule['start']();})[_0x850f('0x8')](function(_0x5a29a2){logger[_0x850f('0xb')](_0x5a29a2);return pm2[_0x850f('0xa')](pm2Config);})[_0x850f('0x8')](function(_0x290849){logger['info']('Online\x20apps:',_[_0x850f('0xc')](_[_0x850f('0xd')](_0x290849,{'status':_0x850f('0xe')}),'name')[_0x850f('0xf')]());logger[_0x850f('0xb')]('Offline\x20apps:',_[_0x850f('0xc')](_['filter'](_0x290849,function(_0x5d5d36){return _0x5d5d36['status']!=='online';}),_0x850f('0x10'))[_0x850f('0xf')]()||'None');config[_0x850f('0x11')]&&require(_0x850f('0x12'))[_0x850f('0x13')]();require('./config/license')[_0x850f('0x13')]();})[_0x850f('0x14')](function(_0x52d474){logger[_0x850f('0x15')](_0x850f('0x16'),_0x52d474);process[_0x850f('0x17')](0x1);});}main(); \ No newline at end of file +var _0x15aa=['app','./config/pm2','./config/schedule','./config/schedule/chat','sequelize','sync','listen','info','start','then','Online\x20apps:','map','filter','name','join','Offline\x20apps:','online','seedDB','./config/seedDB','default','./config/license','catch','error','lodash','./rpc','./config/logger'];(function(_0x42364a,_0x1ec018){var _0x10c65a=function(_0x4a8c88){while(--_0x4a8c88){_0x42364a['push'](_0x42364a['shift']());}};_0x10c65a(++_0x1ec018);}(_0x15aa,0x1eb));var _0xa15a=function(_0x28c9d6,_0x1f0540){_0x28c9d6=_0x28c9d6-0x0;var _0x52bb3c=_0x15aa[_0x28c9d6];return _0x52bb3c;};'use strict';var _=require(_0xa15a('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xa15a('0x1'));var config=require('./config/environment');var logger=require(_0xa15a('0x2'))(_0xa15a('0x3'));var pm2=require(_0xa15a('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xa15a('0x5'));var chat=require(_0xa15a('0x6'));function main(){return mysqldb['db'][_0xa15a('0x7')][_0xa15a('0x8')]()['then'](function(){return rpc[_0xa15a('0x9')]();})['then'](function(_0x1ba093){logger[_0xa15a('0xa')](_0x1ba093);return chat[_0xa15a('0xb')]();})[_0xa15a('0xc')](function(){return schedule[_0xa15a('0xb')]();})[_0xa15a('0xc')](function(_0x198f63){logger[_0xa15a('0xa')](_0x198f63);return pm2['start'](pm2Config);})[_0xa15a('0xc')](function(_0x342d15){logger[_0xa15a('0xa')](_0xa15a('0xd'),_[_0xa15a('0xe')](_[_0xa15a('0xf')](_0x342d15,{'status':'online'}),_0xa15a('0x10'))[_0xa15a('0x11')]());logger[_0xa15a('0xa')](_0xa15a('0x12'),_[_0xa15a('0xe')](_[_0xa15a('0xf')](_0x342d15,function(_0x55beee){return _0x55beee['status']!==_0xa15a('0x13');}),_0xa15a('0x10'))[_0xa15a('0x11')]()||'None');config[_0xa15a('0x14')]&&require(_0xa15a('0x15'))[_0xa15a('0x16')]();require(_0xa15a('0x17'))['default']();})[_0xa15a('0x18')](function(_0xb75df){logger[_0xa15a('0x19')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xb75df);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 92b572d..db413ce 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 _0x6ec2=['../../config/license/util','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','payload','options','randomBytes','hex','now','toString','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','secrets','session','fullname','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','use','ChatInteraction','findOne','then','closed','unmanaged','json','disposition','Unmanaged.','Forbidden.','isAuthenticated','headers','authorization','startsWith','Basic','User','find','name','Wrong\x20credentials.','user','catch','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','apiKeyNonce','nonce','status','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate'];(function(_0x15a033,_0x379888){var _0x44b426=function(_0x3d1309){while(--_0x3d1309){_0x15a033['push'](_0x15a033['shift']());}};_0x44b426(++_0x379888);}(_0x6ec2,0x78));var _0x26ec=function(_0x4ca390,_0x391936){_0x4ca390=_0x4ca390-0x0;var _0x48f93f=_0x6ec2[_0x4ca390];return _0x48f93f;};'use strict';var db=require(_0x26ec('0x0'))['db'];var config=require(_0x26ec('0x1'));var hardwareConf=require(_0x26ec('0x2'));var _=require(_0x26ec('0x3'));var jwt=require(_0x26ec('0x4'));var expressJwt=require(_0x26ec('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x26ec('0x6'));var crypto=require(_0x26ec('0x7'));var BPromise=require(_0x26ec('0x8'));var validateJwt=expressJwt({'secret':config[_0x26ec('0x9')][_0x26ec('0xa')]});var userAttributes=['id','role',_0x26ec('0xb'),'name','internal',_0x26ec('0xc'),_0x26ec('0xd'),_0x26ec('0xe'),'md5secret',_0x26ec('0xf'),'chatPause',_0x26ec('0x10'),_0x26ec('0x11'),_0x26ec('0x12'),_0x26ec('0x13'),_0x26ec('0x14'),_0x26ec('0x15'),_0x26ec('0x16'),_0x26ec('0x17'),_0x26ec('0x18'),_0x26ec('0x19'),'passwordResetAt','alias',_0x26ec('0x1a'),_0x26ec('0x1b'),_0x26ec('0x1c'),_0x26ec('0x1d'),_0x26ec('0x1e'),_0x26ec('0x1f'),_0x26ec('0x20'),'phoneBarRemoteControl',_0x26ec('0x21'),_0x26ec('0x22'),_0x26ec('0x23'),_0x26ec('0x24')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x26ec('0x25')](function(_0x127385,_0x4bdced,_0x20c407){if(_0x127385['user']){_0x20c407();}else{return db[_0x26ec('0x26')][_0x26ec('0x27')]({'where':{'id':_0x127385['params']['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x26ec('0x28')](function(_0x38516d){if(_0x38516d&&_0x38516d[_0x26ec('0x29')]){return _0x4bdced['status'](_0x38516d['disposition']===_0x26ec('0x2a')?0x195:0x193)[_0x26ec('0x2b')]({'message':_0x38516d[_0x26ec('0x2c')]===_0x26ec('0x2a')?_0x26ec('0x2d'):_0x26ec('0x2e')});}else{_0x20c407();}})['catch'](function(_0x14080d){_0x20c407(_0x14080d);});}});};exports[_0x26ec('0x2f')]=function isAuthenticated(_0x2a9e82){return compose()[_0x26ec('0x25')](function(_0x2bcf3c,_0x510300,_0x5202e6){if(_0x2bcf3c[_0x26ec('0x30')][_0x26ec('0x31')]){if(_[_0x26ec('0x32')](_0x2bcf3c['headers']['authorization'],_0x26ec('0x33'))){var _0xaf6c39=basicAuth(_0x2bcf3c);db[_0x26ec('0x34')][_0x26ec('0x35')]({'where':{'name':_0xaf6c39[_0x26ec('0x36')]}})[_0x26ec('0x28')](function(_0x439f78){if(!_0x439f78||!_0x439f78['authenticate'](_0xaf6c39['pass'])){return _0x510300['status'](0x191)[_0x26ec('0x2b')]({'message':_0x26ec('0x37')});}_0x2bcf3c[_0x26ec('0x38')]={'id':_0x439f78['id']};_0x5202e6();})[_0x26ec('0x39')](function(_0x19e0fc){_0x5202e6(_0x19e0fc);});}else if(_[_0x26ec('0x32')](_0x2bcf3c[_0x26ec('0x30')]['authorization'],_0x26ec('0x3a'))){validateJwt(_0x2bcf3c,_0x510300,_0x5202e6);}else{if(_0x2a9e82){_0x5202e6();}else{return _0x510300['status'](0x193)[_0x26ec('0x2b')]({'message':_0x26ec('0x3b')});}}}else if(_0x2bcf3c['query'][_0x26ec('0x3c')]){var _0x2d30e6={'audience':hardwareConf[_0x26ec('0x3d')](),'issuer':hardwareConf[_0x26ec('0x3d')]()};verifyJwt(_0x2bcf3c[_0x26ec('0x3e')][_0x26ec('0x3c')],_0x2d30e6)['then'](function(_0x2313b2){return db['User'][_0x26ec('0x35')]({'where':{'id':_0x2313b2['sub']}})[_0x26ec('0x28')](function(_0x3ce472){if(!_0x3ce472||!_['isEqual'](_0x3ce472[_0x26ec('0x3f')],_0x2313b2[_0x26ec('0x40')])){return _0x510300[_0x26ec('0x41')](0x193)[_0x26ec('0x2b')]({'message':_0x26ec('0x42')});}_0x2bcf3c[_0x26ec('0x38')]={'id':_0x3ce472['id']};_0x5202e6();});})['catch'](function(_0x5bf0b8){_0x5202e6(_0x5bf0b8);});}else if(_0x2a9e82){_0x5202e6();}else{return _0x510300['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x26ec('0x25')](function(_0x2543a6,_0x2737c6,_0x27652d){if(_0x2543a6[_0x26ec('0x38')]){db['User'][_0x26ec('0x35')]({'where':{'id':_0x2543a6[_0x26ec('0x38')]['id']},'attributes':userAttributes})[_0x26ec('0x28')](function(_0x1044e5){if(!_0x1044e5){return _0x2737c6[_0x26ec('0x41')](0x194)['json']({'message':_0x26ec('0x43')});}_0x2543a6[_0x26ec('0x38')]=_0x1044e5;_0x27652d();})[_0x26ec('0x39')](function(_0x18a226){_0x27652d(_0x18a226);});}else if(_0x2a9e82){_0x27652d();}else{return _0x2737c6[_0x26ec('0x41')](0x194)[_0x26ec('0x2b')]({'message':_0x26ec('0x44')});}});};exports[_0x26ec('0x45')]=function canUpdate(){return compose()[_0x26ec('0x25')](function(_0x16c0ee,_0x48d7cf,_0x4e026e){return require(_0x26ec('0x46'))[_0x26ec('0x47')]()['then'](function(_0x32d570){if(_0x32d570['update']){_0x4e026e();}else{return _0x48d7cf[_0x26ec('0x41')](0x193)[_0x26ec('0x2b')]({'message':_0x26ec('0x48')});}})[_0x26ec('0x39')](function(_0x2a0c92){_0x4e026e(_0x2a0c92);});});};exports[_0x26ec('0x49')]=function(_0x4ccb64,_0x2a5e2d,_0x3441f4){_0x4ccb64[_0x26ec('0x49')]=!![];return _0x3441f4();};exports[_0x26ec('0x4a')]=function signToken(_0x1bbc5b){return signJwt(_0x1bbc5b);};exports[_0x26ec('0x4b')]=function(_0x440ed3,_0x319a45){if(!_0x440ed3[_0x26ec('0x38')]){return _0x319a45[_0x26ec('0x41')](0x194)[_0x26ec('0x2b')]({'message':_0x26ec('0x4c')});}var _0x218301={'payload':{'id':_0x440ed3[_0x26ec('0x38')]['id'],'role':_0x440ed3[_0x26ec('0x38')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x218301)[_0x26ec('0x28')](function(_0x39091c){_0x319a45[_0x26ec('0x4d')](_0x26ec('0x4e'),_0x39091c);_0x319a45[_0x26ec('0x4f')](_0x26ec('0x50'));})['catch'](function(_0x547f11){return _0x319a45[_0x26ec('0x41')](0x1f4)['send'](_0x547f11);});};exports[_0x26ec('0x51')]=function(_0x468da1){if(_[_0x26ec('0x52')](_0x468da1[_0x26ec('0x3f')])||_[_0x26ec('0x52')](_0x468da1[_0x26ec('0x53')])){return null;}else{return createJwt(_0x468da1);}};exports[_0x26ec('0x54')]=function(_0xfc8267){_0xfc8267['apiKeyNonce']=generateNonce();_0xfc8267[_0x26ec('0x53')]=generateIssuedAt();return createJwt(_0xfc8267);};exports[_0x26ec('0x55')]=function(_0x453483,_0x4fd208){var _0x3d077f=_0x453483[_0x26ec('0x3e')][_0x26ec('0x3c')];if(_0x3d077f){var _0x414370={'nonce':_0x4fd208[_0x26ec('0x3f')],'iat':_0x4fd208[_0x26ec('0x53')],'audience':hardwareConf[_0x26ec('0x3d')](),'issuer':hardwareConf[_0x26ec('0x3d')]()};return verifyJwt(_0x3d077f,_0x414370)[_0x26ec('0x28')](function(){return generateApiKey(_0x4fd208);});}else{throw{'message':_0x26ec('0x56')};}};function signJwt(_0x211947){var _0x14c567=BPromise[_0x26ec('0x57')](jwt[_0x26ec('0x58')],{'context':jwt});var _0x581a0e=_0x211947['secret']||config[_0x26ec('0x9')]['session'];return new BPromise(function(_0x4f873e,_0x1350d0){_0x14c567(_0x211947[_0x26ec('0x59')],_0x581a0e,_0x211947[_0x26ec('0x5a')])['then'](function(_0x4a5ce1){_0x4f873e(_0x4a5ce1);})['catch'](function(_0x534a11){_0x1350d0(_0x534a11);});});}function verifyJwt(_0x3faf2b,_0x583a22,_0x25c124){var _0x1220da=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x1432ed=_0x25c124||config[_0x26ec('0x9')]['session'];return new BPromise(function(_0x45673f,_0x12f463){_0x1220da(_0x3faf2b,_0x1432ed,_0x583a22)['then'](function(_0x52f786){_0x45673f(_0x52f786);})[_0x26ec('0x39')](function(_0x125459){_0x12f463(_0x125459);});});}function generateNonce(){return crypto[_0x26ec('0x5b')](0x10)['toString'](_0x26ec('0x5c'));}function generateIssuedAt(){return Math['floor'](Date[_0x26ec('0x5d')]()/0x3e8)[_0x26ec('0x5e')]();}function createJwt(_0x2af53a){var _0x4750a2={'payload':{'iat':_0x2af53a[_0x26ec('0x53')],'nonce':_0x2af53a[_0x26ec('0x3f')]},'options':{'algorithm':'HS512','subject':_0x2af53a['id'][_0x26ec('0x5e')](),'issuer':hardwareConf[_0x26ec('0x3d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x4750a2)[_0x26ec('0x28')](function(_0x2a69b4){return{'iat':_0x2af53a['apiKeyIat'],'nonce':_0x2af53a[_0x26ec('0x3f')],'token':_0x2a69b4};});} \ No newline at end of file +var _0xba18=['query','apikey','getUuid','find','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unknown\x20authorization\x20format','User','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','update','Forbidden','isMiddleware','signToken','cookie','motion.token','redirect','send','retrieveApiKey','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','payload','options','toString','hex','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','bluebird','secrets','session','role','fullname','name','email','userpic','chatPause','mailPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','closed','disposition','status','unmanaged','json','Forbidden.','catch','headers','authorization','startsWith','Basic','then','authenticate','pass','Wrong\x20credentials.','Bearer'];(function(_0x392b36,_0x13a967){var _0x4064bf=function(_0x109804){while(--_0x109804){_0x392b36['push'](_0x392b36['shift']());}};_0x4064bf(++_0x13a967);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var db=require(_0x8ba1('0x0'))['db'];var config=require(_0x8ba1('0x1'));var hardwareConf=require(_0x8ba1('0x2'));var _=require(_0x8ba1('0x3'));var jwt=require(_0x8ba1('0x4'));var expressJwt=require(_0x8ba1('0x5'));var compose=require(_0x8ba1('0x6'));var basicAuth=require(_0x8ba1('0x7'));var crypto=require('crypto');var BPromise=require(_0x8ba1('0x8'));var validateJwt=expressJwt({'secret':config[_0x8ba1('0x9')][_0x8ba1('0xa')]});var userAttributes=['id',_0x8ba1('0xb'),_0x8ba1('0xc'),_0x8ba1('0xd'),'internal',_0x8ba1('0xe'),_0x8ba1('0xf'),'permissions','md5secret','voicePause',_0x8ba1('0x10'),_0x8ba1('0x11'),'faxPause',_0x8ba1('0x12'),_0x8ba1('0x13'),_0x8ba1('0x14'),_0x8ba1('0x15'),_0x8ba1('0x16'),'lastPauseAt',_0x8ba1('0x17'),_0x8ba1('0x18'),_0x8ba1('0x19'),_0x8ba1('0x1a'),_0x8ba1('0x1b'),_0x8ba1('0x1c'),'phoneBarEnableRecording',_0x8ba1('0x1d'),_0x8ba1('0x1e'),_0x8ba1('0x1f'),_0x8ba1('0x20'),'phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk',_0x8ba1('0x21'),_0x8ba1('0x22')];exports[_0x8ba1('0x23')]=function(){return this[_0x8ba1('0x24')](!![])[_0x8ba1('0x25')](function(_0x3880aa,_0x107846,_0x14d73b){if(_0x3880aa[_0x8ba1('0x26')]){_0x14d73b();}else{return db[_0x8ba1('0x27')]['findOne']({'where':{'id':_0x3880aa['params']['id']},'attributes':['id',_0x8ba1('0x28'),_0x8ba1('0x29')],'raw':!![]})['then'](function(_0xd8bda0){if(_0xd8bda0&&_0xd8bda0[_0x8ba1('0x28')]){return _0x107846[_0x8ba1('0x2a')](_0xd8bda0[_0x8ba1('0x29')]===_0x8ba1('0x2b')?0x195:0x193)[_0x8ba1('0x2c')]({'message':_0xd8bda0['disposition']===_0x8ba1('0x2b')?'Unmanaged.':_0x8ba1('0x2d')});}else{_0x14d73b();}})[_0x8ba1('0x2e')](function(_0x121cc4){_0x14d73b(_0x121cc4);});}});};exports[_0x8ba1('0x24')]=function isAuthenticated(_0x4e66e1){return compose()[_0x8ba1('0x25')](function(_0x25b65c,_0x3e1e64,_0x38a2de){if(_0x25b65c[_0x8ba1('0x2f')][_0x8ba1('0x30')]){if(_[_0x8ba1('0x31')](_0x25b65c[_0x8ba1('0x2f')][_0x8ba1('0x30')],_0x8ba1('0x32'))){var _0x3b205c=basicAuth(_0x25b65c);db['User']['find']({'where':{'name':_0x3b205c[_0x8ba1('0xd')]}})[_0x8ba1('0x33')](function(_0x56aef2){if(!_0x56aef2||!_0x56aef2[_0x8ba1('0x34')](_0x3b205c[_0x8ba1('0x35')])){return _0x3e1e64[_0x8ba1('0x2a')](0x191)[_0x8ba1('0x2c')]({'message':_0x8ba1('0x36')});}_0x25b65c[_0x8ba1('0x26')]={'id':_0x56aef2['id']};_0x38a2de();})[_0x8ba1('0x2e')](function(_0x26288a){_0x38a2de(_0x26288a);});}else if(_[_0x8ba1('0x31')](_0x25b65c[_0x8ba1('0x2f')][_0x8ba1('0x30')],_0x8ba1('0x37'))){validateJwt(_0x25b65c,_0x3e1e64,_0x38a2de);}else{if(_0x4e66e1){_0x38a2de();}else{return _0x3e1e64[_0x8ba1('0x2a')](0x193)[_0x8ba1('0x2c')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x25b65c[_0x8ba1('0x38')][_0x8ba1('0x39')]){var _0x22059f={'audience':hardwareConf[_0x8ba1('0x3a')](),'issuer':hardwareConf[_0x8ba1('0x3a')]()};verifyJwt(_0x25b65c[_0x8ba1('0x38')]['apikey'],_0x22059f)[_0x8ba1('0x33')](function(_0x2af152){return db['User'][_0x8ba1('0x3b')]({'where':{'id':_0x2af152['sub']}})[_0x8ba1('0x33')](function(_0x18db21){if(!_0x18db21||!_['isEqual'](_0x18db21[_0x8ba1('0x3c')],_0x2af152[_0x8ba1('0x3d')])){return _0x3e1e64[_0x8ba1('0x2a')](0x193)[_0x8ba1('0x2c')]({'message':_0x8ba1('0x3e')});}_0x25b65c['user']={'id':_0x18db21['id']};_0x38a2de();});})[_0x8ba1('0x2e')](function(_0x174528){_0x38a2de(_0x174528);});}else if(_0x4e66e1){_0x38a2de();}else{return _0x3e1e64[_0x8ba1('0x2a')](0x193)[_0x8ba1('0x2c')]({'message':_0x8ba1('0x3f')});}})[_0x8ba1('0x25')](function(_0x232b5f,_0x3303fe,_0x5a7d65){if(_0x232b5f[_0x8ba1('0x26')]){db[_0x8ba1('0x40')][_0x8ba1('0x3b')]({'where':{'id':_0x232b5f[_0x8ba1('0x26')]['id']},'attributes':userAttributes})[_0x8ba1('0x33')](function(_0x15d93e){if(!_0x15d93e){return _0x3303fe[_0x8ba1('0x2a')](0x194)[_0x8ba1('0x2c')]({'message':_0x8ba1('0x41')});}_0x232b5f[_0x8ba1('0x26')]=_0x15d93e;_0x5a7d65();})['catch'](function(_0xc79922){_0x5a7d65(_0xc79922);});}else if(_0x4e66e1){_0x5a7d65();}else{return _0x3303fe[_0x8ba1('0x2a')](0x194)[_0x8ba1('0x2c')]({'message':_0x8ba1('0x42')});}});};exports[_0x8ba1('0x43')]=function canUpdate(){return compose()[_0x8ba1('0x25')](function(_0x3034aa,_0x2db01a,_0x136318){return require(_0x8ba1('0x44'))['getLicense']()['then'](function(_0x11ce52){if(_0x11ce52[_0x8ba1('0x45')]){_0x136318();}else{return _0x2db01a[_0x8ba1('0x2a')](0x193)[_0x8ba1('0x2c')]({'message':_0x8ba1('0x46')});}})[_0x8ba1('0x2e')](function(_0x414412){_0x136318(_0x414412);});});};exports[_0x8ba1('0x47')]=function(_0x2506f0,_0x2305ff,_0x2f4ac4){_0x2506f0[_0x8ba1('0x47')]=!![];return _0x2f4ac4();};exports[_0x8ba1('0x48')]=function signToken(_0x2a4cd8){return signJwt(_0x2a4cd8);};exports['setTokenCookie']=function(_0xf8c3b,_0x45e09d){if(!_0xf8c3b[_0x8ba1('0x26')]){return _0x45e09d[_0x8ba1('0x2a')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x2ac7bc={'payload':{'id':_0xf8c3b[_0x8ba1('0x26')]['id'],'role':_0xf8c3b[_0x8ba1('0x26')][_0x8ba1('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x2ac7bc)[_0x8ba1('0x33')](function(_0x5e10d1){_0x45e09d[_0x8ba1('0x49')](_0x8ba1('0x4a'),_0x5e10d1);_0x45e09d[_0x8ba1('0x4b')]('/dashboards/general');})[_0x8ba1('0x2e')](function(_0x4374db){return _0x45e09d[_0x8ba1('0x2a')](0x1f4)[_0x8ba1('0x4c')](_0x4374db);});};exports[_0x8ba1('0x4d')]=function(_0x3bb4dc){if(_['isNil'](_0x3bb4dc[_0x8ba1('0x3c')])||_['isNil'](_0x3bb4dc[_0x8ba1('0x4e')])){return null;}else{return createJwt(_0x3bb4dc);}};exports[_0x8ba1('0x4f')]=function(_0x3ce6f7){_0x3ce6f7[_0x8ba1('0x3c')]=generateNonce();_0x3ce6f7[_0x8ba1('0x4e')]=generateIssuedAt();return createJwt(_0x3ce6f7);};exports[_0x8ba1('0x50')]=function(_0x4bdce0,_0x17982d){var _0x3cedf4=_0x4bdce0['query']['apikey'];if(_0x3cedf4){var _0x25200b={'nonce':_0x17982d[_0x8ba1('0x3c')],'iat':_0x17982d[_0x8ba1('0x4e')],'audience':hardwareConf[_0x8ba1('0x3a')](),'issuer':hardwareConf[_0x8ba1('0x3a')]()};return verifyJwt(_0x3cedf4,_0x25200b)[_0x8ba1('0x33')](function(){return generateApiKey(_0x17982d);});}else{throw{'message':_0x8ba1('0x51')};}};function signJwt(_0x2061df){var _0x225653=BPromise[_0x8ba1('0x52')](jwt[_0x8ba1('0x53')],{'context':jwt});var _0x144073=_0x2061df[_0x8ba1('0x54')]||config['secrets'][_0x8ba1('0xa')];return new BPromise(function(_0x3bb667,_0x1405a2){_0x225653(_0x2061df[_0x8ba1('0x55')],_0x144073,_0x2061df[_0x8ba1('0x56')])[_0x8ba1('0x33')](function(_0x353eef){_0x3bb667(_0x353eef);})[_0x8ba1('0x2e')](function(_0x475311){_0x1405a2(_0x475311);});});}function verifyJwt(_0xd1ec48,_0xae04af,_0x1e7f4b){var _0x35772c=BPromise[_0x8ba1('0x52')](jwt['verify'],{'context':jwt});var _0x1c18d7=_0x1e7f4b||config[_0x8ba1('0x9')]['session'];return new BPromise(function(_0x356f18,_0x2c8569){_0x35772c(_0xd1ec48,_0x1c18d7,_0xae04af)[_0x8ba1('0x33')](function(_0x210977){_0x356f18(_0x210977);})[_0x8ba1('0x2e')](function(_0x5304c4){_0x2c8569(_0x5304c4);});});}function generateNonce(){return crypto['randomBytes'](0x10)[_0x8ba1('0x57')](_0x8ba1('0x58'));}function generateIssuedAt(){return Math['floor'](Date[_0x8ba1('0x59')]()/0x3e8)[_0x8ba1('0x57')]();}function createJwt(_0x391f3e){var _0x4d93b2={'payload':{'iat':_0x391f3e[_0x8ba1('0x4e')],'nonce':_0x391f3e[_0x8ba1('0x3c')]},'options':{'algorithm':_0x8ba1('0x5a'),'subject':_0x391f3e['id']['toString'](),'issuer':hardwareConf[_0x8ba1('0x3a')](),'audience':hardwareConf[_0x8ba1('0x3a')]()}};return signJwt(_0x4d93b2)[_0x8ba1('0x33')](function(_0x235f3b){return{'iat':_0x391f3e['apiKeyIat'],'nonce':_0x391f3e[_0x8ba1('0x3c')],'token':_0x235f3b};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 2a4885e..cbed9d6 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 _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x4b8071,_0x537bd9){var _0x5ea495=function(_0x3b5647){while(--_0x3b5647){_0x4b8071['push'](_0x4b8071['shift']());}};_0x5ea495(++_0x537bd9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});}; \ No newline at end of file +var _0xcb91=['unlink','createReadStream','createWriteStream','createDecipher','update','aes192','hasOwnProperty','createCipher','algorithm','data','binary','write','end','final','close'];(function(_0x37f4a4,_0x2a881d){var _0x391401=function(_0x14723f){while(--_0x14723f){_0x37f4a4['push'](_0x37f4a4['shift']());}};_0x391401(++_0x2a881d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xcb91[_0x1573ea];return _0x51c0e2;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x1cb9('0x0')};function combineOptions(_0xe4a5bf){var _0x17d4ec={};for(var _0x22c4b8 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x22c4b8)){_0x17d4ec[_0x22c4b8]=defaultOptions[_0x22c4b8];}}if(_0xe4a5bf){for(var _0x8c392f in _0xe4a5bf){if(_0xe4a5bf[_0x1cb9('0x1')](_0x8c392f)){_0x17d4ec[_0x8c392f]=_0xe4a5bf[_0x8c392f];}}}return _0x17d4ec;}exports['encryptFile']=function(_0x13d5fd,_0x1b26cd,_0x53ffbd,_0x226b69){return new BPromise(function(_0x3f7deb,_0x4ffe20){_0x226b69=combineOptions(_0x226b69);var _0x38737d=new Buffer(_0x53ffbd);var _0x12567c=fs['createReadStream'](_0x13d5fd);var _0x3ae0f1=fs['createWriteStream'](_0x1b26cd);var _0x567139=crypto[_0x1cb9('0x2')](_0x226b69[_0x1cb9('0x3')],_0x38737d);_0x12567c['on'](_0x1cb9('0x4'),function(_0x1f0eca){var _0x2fc627=new Buffer(_0x567139['update'](_0x1f0eca),_0x1cb9('0x5'));_0x3ae0f1[_0x1cb9('0x6')](_0x2fc627);});_0x12567c['on'](_0x1cb9('0x7'),function(){try{var _0x3fdd83=new Buffer(_0x567139[_0x1cb9('0x8')]('binary'),'binary');_0x3ae0f1['write'](_0x3fdd83);_0x3ae0f1[_0x1cb9('0x7')]();_0x3ae0f1['on'](_0x1cb9('0x9'),function(){return _0x3f7deb(_0x1b26cd);});}catch(_0x384496){fs[_0x1cb9('0xa')](_0x1b26cd);return _0x4ffe20(_0x384496);}});});};exports['decryptFile']=function(_0x397727,_0x6ef389,_0x1b3cd7,_0x8dfa55){return new BPromise(function(_0x3e2d11,_0x5806d8){_0x8dfa55=combineOptions(_0x8dfa55);var _0x5572cb=new Buffer(_0x1b3cd7);var _0xd446a3=fs[_0x1cb9('0xb')](_0x397727);var _0x3904b7=fs[_0x1cb9('0xc')](_0x6ef389);var _0x3e21e0=crypto[_0x1cb9('0xd')](_0x8dfa55[_0x1cb9('0x3')],_0x5572cb);_0xd446a3['on']('data',function(_0x479d43){var _0x1b2fa6=new Buffer(_0x3e21e0[_0x1cb9('0xe')](_0x479d43),_0x1cb9('0x5'));_0x3904b7[_0x1cb9('0x6')](_0x1b2fa6);});_0xd446a3['on'](_0x1cb9('0x7'),function(){try{var _0x4014de=new Buffer(_0x3e21e0[_0x1cb9('0x8')]('binary'),'binary');_0x3904b7[_0x1cb9('0x6')](_0x4014de);_0x3904b7['end']();_0x3904b7['on'](_0x1cb9('0x9'),function(){return _0x3e2d11(_0x6ef389);});}catch(_0x2265ea){fs['unlink'](_0x6ef389);return _0x5806d8(_0x2265ea);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 4b83327..ace6d52 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 _0x668b=['SELECT','num','Empty','push','dirname','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','%s.%s','zip','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes'];(function(_0x2d1f88,_0xe12751){var _0x1183d2=function(_0x386e38){while(--_0x386e38){_0x2d1f88['push'](_0x2d1f88['shift']());}};_0x1183d2(++_0xe12751);}(_0x668b,0x140));var _0xb668=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x668b[_0x25bea7];return _0x175952;};'use strict';var util=require(_0xb668('0x0'));var path=require(_0xb668('0x1'));var _=require('lodash');var csv=require(_0xb668('0x2'));var fs=require('fs');var BPromise=require(_0xb668('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xb668('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb668('0x5'))[_0xb668('0x6')];var logger=require(_0xb668('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb668('0x8')][0x2]);var QUERY=process[_0xb668('0x8')][0x3];var PATH=process[_0xb668('0x8')][0x4];function analyticExtractedReport(_0x2778e9,_0x20b749){var _0x3f01bc={'status':_0x2778e9};var _0x517fc5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x20b749){_0x3f01bc[_0xb668('0x9')]=_0x20b749;}return db[_0xb668('0xa')][_0xb668('0xb')](_0x3f01bc,_0x517fc5);}function main(){var _0x16d50d=0x1388;var _0x39b79c;logger[_0xb668('0xc')](util[_0xb668('0xd')](_0xb668('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xb668('0xf')][_0xb668('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb668('0x11'),_0xb668('0x12')]})[_0xb668('0x13')](function(_0x167057){if(_0x167057){_0x39b79c=_0x167057;_0x16d50d=_0x39b79c[_0xb668('0x12')]||0x1388;}})[_0xb668('0x13')](function(){return dbH[_0xb668('0x14')][_0xb668('0x15')](util[_0xb668('0xd')](_0xb668('0x16'),QUERY),{'type':dbH[_0xb668('0x14')][_0xb668('0x17')][_0xb668('0x18')]});})[_0xb668('0x13')](function(_0x1ca6e7){if(!_0x1ca6e7[0x0][_0xb668('0x19')]){return analyticExtractedReport(_0xb668('0x1a'));}var _0x4a755b=[];var _0xd3e39f=0x0;var _0x27bbfa=!![];if(_0x1ca6e7&&_0x1ca6e7['length']){var _0x13ee71=_0x1ca6e7[0x0]['num']%(_0xd3e39f+_0x16d50d);if(_0x39b79c[_0xb668('0x11')]){for(;_0x27bbfa;_0xd3e39f+=_0x16d50d,_0x13ee71=_0x1ca6e7[0x0][_0xb668('0x19')]%(_0xd3e39f+_0x16d50d)){if(_0x13ee71==0x0||_0x13ee71==_0x1ca6e7[0x0]['num']){_0x27bbfa=![];}_0x4a755b[_0xb668('0x1b')](dbH[_0xb668('0x14')]['query'](util[_0xb668('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x16d50d,_0xd3e39f),{'type':dbH[_0xb668('0x14')][_0xb668('0x17')][_0xb668('0x18')]}));}}else{_0x4a755b[_0xb668('0x1b')](dbH['sequelize'][_0xb668('0x15')](QUERY,{'type':dbH[_0xb668('0x14')][_0xb668('0x17')]['SELECT']}));}}var _0x5a2f74=path[_0xb668('0x1c')](PATH);var _0x1e5620=path['basename'](PATH,_0xb668('0x1d'));var _0x4bf863=_0x39b79c[_0xb668('0x11')]&&_0x4a755b['length']>0x1;var _0x3f4745=[];if(!fs[_0xb668('0x1e')](path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620))&&_0x4bf863){fs[_0xb668('0x20')](path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620));}return BPromise[_0xb668('0x21')](_0x4a755b,function(_0x4d4bf8){_0x3f4745[_0xb668('0x1b')](_0x4d4bf8);})[_0xb668('0x13')](function(){for(var _0x2ab8c2=0x0;_0x2ab8c2<_0x3f4745['length'];_0x2ab8c2+=0x1){var _0x5e0cee;var _0xe62fce=_0x3f4745[_0x2ab8c2];if(_0x4bf863){_0x5e0cee=path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620,util[_0xb668('0xd')]('%s%d.%s',_0x1e5620,_0x2ab8c2,_0xb668('0x22')));}else{_0x5e0cee=path[_0xb668('0x1f')](_0x5a2f74,util[_0xb668('0xd')]('%s.%s',_0x1e5620,'csv'));}fs[_0xb668('0x23')](_0x5e0cee,csv(_0xe62fce));}})[_0xb668('0x13')](function(){if(_0x4bf863){zipdir(path['join'](_0x5a2f74,_0x1e5620),{'saveTo':path[_0xb668('0x1f')](_0x5a2f74,util[_0xb668('0xd')](_0xb668('0x24'),_0x1e5620,_0xb668('0x25')))},function(_0x256a8,_0x5f36b5){});rimraf(path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620),function(){});}})[_0xb668('0x13')](function(){logger['info'](util[_0xb668('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb668('0x26')));return analyticExtractedReport(_0xb668('0x27'),_0x4bf863?util[_0xb668('0xd')](_0xb668('0x24'),_0x1e5620,_0x4bf863?_0xb668('0x25'):_0xb668('0x22')):null);});})[_0xb668('0x28')](function(_0x3d4bd8){logger[_0xb668('0xc')](util['format'](_0xb668('0x29'),EXTRACTED_REPORT_ID,_0xb668('0x26')),util[_0xb668('0x2a')](_0x3d4bd8,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xfd28=['%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','format','CSV','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','length','existsSync','join','mkdirSync','each','csv','writeFileSync'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xfd28,0x148));var _0x8fd2=function(_0x31172e,_0xa59e5){_0x31172e=_0x31172e-0x0;var _0x414ada=_0xfd28[_0x31172e];return _0x414ada;};'use strict';var util=require('util');var path=require(_0x8fd2('0x0'));var _=require(_0x8fd2('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x8fd2('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x8fd2('0x3'));var db=require(_0x8fd2('0x4'))['db'];var dbH=require(_0x8fd2('0x4'))['dbH'];var logger=require(_0x8fd2('0x5'))(_0x8fd2('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x8fd2('0x7')][0x2]);var QUERY=process[_0x8fd2('0x7')][0x3];var PATH=process[_0x8fd2('0x7')][0x4];function analyticExtractedReport(_0x4bdc1a,_0x53d938){var _0x10fccf={'status':_0x4bdc1a};var _0x466c3d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x53d938){_0x10fccf[_0x8fd2('0x8')]=_0x53d938;}return db['AnalyticExtractedReport'][_0x8fd2('0x9')](_0x10fccf,_0x466c3d);}function main(){var _0x49ca87=0x1388;var _0x2842f3;logger['info'](util[_0x8fd2('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8fd2('0xb')));return db['Setting'][_0x8fd2('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8fd2('0xd')]})[_0x8fd2('0xe')](function(_0xfd78d){if(_0xfd78d){_0x2842f3=_0xfd78d;_0x49ca87=_0x2842f3[_0x8fd2('0xd')]||0x1388;}})[_0x8fd2('0xe')](function(){return dbH[_0x8fd2('0xf')][_0x8fd2('0x10')](util[_0x8fd2('0xa')](_0x8fd2('0x11'),QUERY),{'type':dbH[_0x8fd2('0xf')][_0x8fd2('0x12')][_0x8fd2('0x13')]});})[_0x8fd2('0xe')](function(_0x40712c){if(!_0x40712c[0x0][_0x8fd2('0x14')]){return analyticExtractedReport('Empty');}var _0x20daca=[];var _0x5ef478=0x0;var _0x4f0b17=!![];if(_0x40712c&&_0x40712c['length']){var _0x3b79f3=_0x40712c[0x0][_0x8fd2('0x14')]%(_0x5ef478+_0x49ca87);if(_0x2842f3[_0x8fd2('0x15')]){for(;_0x4f0b17;_0x5ef478+=_0x49ca87,_0x3b79f3=_0x40712c[0x0][_0x8fd2('0x14')]%(_0x5ef478+_0x49ca87)){if(_0x3b79f3==0x0||_0x3b79f3==_0x40712c[0x0]['num']){_0x4f0b17=![];}_0x20daca[_0x8fd2('0x16')](dbH[_0x8fd2('0xf')][_0x8fd2('0x10')](util[_0x8fd2('0xa')](_0x8fd2('0x17'),QUERY,_0x49ca87,_0x5ef478),{'type':dbH['sequelize']['QueryTypes'][_0x8fd2('0x13')]}));}}else{_0x20daca['push'](dbH[_0x8fd2('0xf')]['query'](QUERY,{'type':dbH[_0x8fd2('0xf')][_0x8fd2('0x12')]['SELECT']}));}}var _0x122b60=path['dirname'](PATH);var _0xd3981f=path[_0x8fd2('0x18')](PATH,'.csv');var _0x1c925c=_0x2842f3[_0x8fd2('0x15')]&&_0x20daca[_0x8fd2('0x19')]>0x1;var _0x490ea5=[];if(!fs[_0x8fd2('0x1a')](path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f))&&_0x1c925c){fs[_0x8fd2('0x1c')](path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f));}return BPromise[_0x8fd2('0x1d')](_0x20daca,function(_0x25db4e){_0x490ea5[_0x8fd2('0x16')](_0x25db4e);})[_0x8fd2('0xe')](function(){for(var _0x1456b4=0x0;_0x1456b4<_0x490ea5[_0x8fd2('0x19')];_0x1456b4+=0x1){var _0x3392fb;var _0x1f3237=_0x490ea5[_0x1456b4];if(_0x1c925c){_0x3392fb=path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f,util['format']('%s%d.%s',_0xd3981f,_0x1456b4,_0x8fd2('0x1e')));}else{_0x3392fb=path[_0x8fd2('0x1b')](_0x122b60,util[_0x8fd2('0xa')]('%s.%s',_0xd3981f,_0x8fd2('0x1e')));}fs[_0x8fd2('0x1f')](_0x3392fb,csv(_0x1f3237));}})[_0x8fd2('0xe')](function(){if(_0x1c925c){zipdir(path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f),{'saveTo':path[_0x8fd2('0x1b')](_0x122b60,util[_0x8fd2('0xa')](_0x8fd2('0x20'),_0xd3981f,'zip'))},function(_0xe76676,_0x13c9b9){});rimraf(path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f),function(){});}})[_0x8fd2('0xe')](function(){logger[_0x8fd2('0x21')](util[_0x8fd2('0xa')](_0x8fd2('0x22'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1c925c?util['format'](_0x8fd2('0x20'),_0xd3981f,_0x1c925c?_0x8fd2('0x23'):_0x8fd2('0x1e')):null);});})[_0x8fd2('0x24')](function(_0x5a0b3b){logger['info'](util[_0x8fd2('0xa')](_0x8fd2('0x25'),EXTRACTED_REPORT_ID,_0x8fd2('0xb')),util[_0x8fd2('0x26')](_0x5a0b3b,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x8fd2('0x27'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c01fd7c..d1edd8e 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 _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x7491b9,_0x98f964){var _0x2777d0=function(_0xc9c91a){while(--_0xc9c91a){_0x7491b9['push'](_0x7491b9['shift']());}};_0x2777d0(++_0x98f964);}(_0xb10b,0x12a));var _0xbb10=function(_0x529185,_0x5f5ef5){_0x529185=_0x529185-0x0;var _0x541314=_0xb10b[_0x529185];return _0x541314;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file +var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x525359,_0x4d8b71){var _0xe77b3c=function(_0x2a6418){while(--_0x2a6418){_0x525359['push'](_0x525359['shift']());}};_0xe77b3c(++_0x4d8b71);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 5ee382f..662188e 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 _0xca7e=['num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.xlsx','join','each','%s%d.%s','xlsx','%s.%s','zip','info','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','util','lodash','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x4033f5,_0x15abf8){var _0x3e2c3d=function(_0x50e534){while(--_0x50e534){_0x4033f5['push'](_0x4033f5['shift']());}};_0x3e2c3d(++_0x15abf8);}(_0xca7e,0xde));var _0xeca7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xca7e[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0xeca7('0x0'));var path=require('path');var _=require(_0xeca7('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xeca7('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xeca7('0x3'))['db'];var dbH=require(_0xeca7('0x3'))[_0xeca7('0x4')];var logger=require(_0xeca7('0x5'))(_0xeca7('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xeca7('0x7')][0x2]);var QUERY=process[_0xeca7('0x7')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x2ac6ad,_0x45e11c){var _0x102f58={'status':_0x2ac6ad};var _0x4065a3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45e11c){_0x102f58['savename']=_0x45e11c;}return db['AnalyticExtractedReport']['update'](_0x102f58,_0x4065a3);}function main(){var _0x27d0fa=0x1388;var _0x2e9489;logger['info'](util[_0xeca7('0x8')](_0xeca7('0x9'),EXTRACTED_REPORT_ID,_0xeca7('0xa')));return db['Setting'][_0xeca7('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeca7('0xc'),_0xeca7('0xd')]})[_0xeca7('0xe')](function(_0x57cfc5){if(_0x57cfc5){_0x2e9489=_0x57cfc5;_0x27d0fa=_0x2e9489[_0xeca7('0xd')]||0x1388;}})[_0xeca7('0xe')](function(){return dbH[_0xeca7('0xf')][_0xeca7('0x10')](util['format'](_0xeca7('0x11'),QUERY),{'type':dbH[_0xeca7('0xf')]['QueryTypes']['SELECT']});})[_0xeca7('0xe')](function(_0x55e471){if(!_0x55e471[0x0][_0xeca7('0x12')]){return analyticExtractedReport('Empty');}var _0x107077=[];var _0x3f896f=0x0;var _0x2d47be=!![];if(_0x2e9489[_0xeca7('0xc')]){if(_0x55e471&&_0x55e471[_0xeca7('0x13')]){var _0x42f09d=_0x55e471[0x0]['num']%(_0x3f896f+_0x27d0fa);for(;_0x2d47be;_0x3f896f+=_0x27d0fa,_0x42f09d=_0x55e471[0x0]['num']%(_0x3f896f+_0x27d0fa)){if(_0x42f09d==0x0||_0x42f09d==_0x55e471[0x0][_0xeca7('0x12')]){_0x2d47be=![];}_0x107077[_0xeca7('0x14')](dbH[_0xeca7('0xf')]['query'](util[_0xeca7('0x8')](_0xeca7('0x15'),QUERY,_0x27d0fa,_0x3f896f),{'type':dbH['sequelize'][_0xeca7('0x16')][_0xeca7('0x17')]}));}}}else{_0x107077[_0xeca7('0x14')](dbH[_0xeca7('0xf')]['query'](QUERY,{'type':dbH[_0xeca7('0xf')][_0xeca7('0x16')][_0xeca7('0x17')]}));}var _0x52b997=path[_0xeca7('0x18')](PATH);var _0x4b77f2=path[_0xeca7('0x19')](PATH,_0xeca7('0x1a'));var _0x28ad8d=_0x2e9489[_0xeca7('0xc')]&&_0x107077[_0xeca7('0x13')]>0x1;var _0x5c9795=[];if(!fs['existsSync'](path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2))&&_0x28ad8d){fs['mkdirSync'](path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2));}return BPromise[_0xeca7('0x1c')](_0x107077,function(_0x195fed){_0x5c9795[_0xeca7('0x14')](_0x195fed);})[_0xeca7('0xe')](function(){for(var _0x299a95=0x0;_0x299a95<_0x5c9795[_0xeca7('0x13')];_0x299a95+=0x1){var _0x472ef2;var _0x328abf=_0x5c9795[_0x299a95];if(_0x28ad8d){_0x472ef2=path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2,util[_0xeca7('0x8')](_0xeca7('0x1d'),_0x4b77f2,_0x299a95,_0xeca7('0x1e')));}else{_0x472ef2=path['join'](_0x52b997,util['format'](_0xeca7('0x1f'),_0x4b77f2,_0xeca7('0x1e')));}fs['writeFileSync'](_0x472ef2,json2xls(_0x328abf),'binary');}})[_0xeca7('0xe')](function(){if(_0x28ad8d){zipdir(path['join'](_0x52b997,_0x4b77f2),{'saveTo':path['join'](_0x52b997,util[_0xeca7('0x8')](_0xeca7('0x1f'),_0x4b77f2,_0xeca7('0x20')))},function(_0x3e78d0,_0x2c77c5){});rimraf(path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2),function(){});}})[_0xeca7('0xe')](function(){logger[_0xeca7('0x21')](util[_0xeca7('0x8')](_0xeca7('0x22'),EXTRACTED_REPORT_ID,_0xeca7('0xa')));return analyticExtractedReport(_0xeca7('0x23'),_0x28ad8d?util[_0xeca7('0x8')]('%s.%s',_0x4b77f2,_0x28ad8d?_0xeca7('0x20'):_0xeca7('0x1e')):null);});})[_0xeca7('0x24')](function(_0x5d4176){logger[_0xeca7('0x21')](util[_0xeca7('0x8')](_0xeca7('0x25'),EXTRACTED_REPORT_ID,_0xeca7('0xa')),util[_0xeca7('0x26')](_0x5d4176,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xeca7('0x27'));});}main(); \ No newline at end of file +var _0x4d68=['Empty','num','query','%s\x20limit\x20%d\x20OFFSET\x20%d','push','dirname','.xlsx','length','join','mkdirSync','each','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','inspect','util','path','lodash','json2xls','bluebird','zip-dir','../../mysqldb','dbH','analytics','argv','savename','update','info','format','Setting','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT'];(function(_0x469d7b,_0x8bd123){var _0x4eb5d0=function(_0x10523d){while(--_0x10523d){_0x469d7b['push'](_0x469d7b['shift']());}};_0x4eb5d0(++_0x8bd123);}(_0x4d68,0x1c3));var _0x84d6=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x4d68[_0x4c7b20];return _0x4872bd;};'use strict';var util=require(_0x84d6('0x0'));var path=require(_0x84d6('0x1'));var _=require(_0x84d6('0x2'));var fs=require('fs');var json2xls=require(_0x84d6('0x3'));var BPromise=require(_0x84d6('0x4'));var zipdir=require(_0x84d6('0x5'));var rimraf=require('rimraf');var db=require(_0x84d6('0x6'))['db'];var dbH=require('../../mysqldb')[_0x84d6('0x7')];var logger=require('../../config/logger')(_0x84d6('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x84d6('0x9')][0x2]);var QUERY=process[_0x84d6('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x561dd8,_0x218daf){var _0xa64ed3={'status':_0x561dd8};var _0x260859={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x218daf){_0xa64ed3[_0x84d6('0xa')]=_0x218daf;}return db['AnalyticExtractedReport'][_0x84d6('0xb')](_0xa64ed3,_0x260859);}function main(){var _0x5365c9=0x1388;var _0x2fb185;logger[_0x84d6('0xc')](util[_0x84d6('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db[_0x84d6('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x84d6('0xf'),_0x84d6('0x10')]})[_0x84d6('0x11')](function(_0x19e7a9){if(_0x19e7a9){_0x2fb185=_0x19e7a9;_0x5365c9=_0x2fb185[_0x84d6('0x10')]||0x1388;}})['then'](function(){return dbH[_0x84d6('0x12')]['query'](util[_0x84d6('0xd')](_0x84d6('0x13'),QUERY),{'type':dbH[_0x84d6('0x12')][_0x84d6('0x14')][_0x84d6('0x15')]});})[_0x84d6('0x11')](function(_0x957ae6){if(!_0x957ae6[0x0]['num']){return analyticExtractedReport(_0x84d6('0x16'));}var _0x41e128=[];var _0x575d46=0x0;var _0x29d2d1=!![];if(_0x2fb185[_0x84d6('0xf')]){if(_0x957ae6&&_0x957ae6['length']){var _0x1dd975=_0x957ae6[0x0][_0x84d6('0x17')]%(_0x575d46+_0x5365c9);for(;_0x29d2d1;_0x575d46+=_0x5365c9,_0x1dd975=_0x957ae6[0x0]['num']%(_0x575d46+_0x5365c9)){if(_0x1dd975==0x0||_0x1dd975==_0x957ae6[0x0][_0x84d6('0x17')]){_0x29d2d1=![];}_0x41e128['push'](dbH[_0x84d6('0x12')][_0x84d6('0x18')](util[_0x84d6('0xd')](_0x84d6('0x19'),QUERY,_0x5365c9,_0x575d46),{'type':dbH[_0x84d6('0x12')]['QueryTypes'][_0x84d6('0x15')]}));}}}else{_0x41e128[_0x84d6('0x1a')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x84d6('0x12')]['QueryTypes']['SELECT']}));}var _0x1aa38c=path[_0x84d6('0x1b')](PATH);var _0x24c8fb=path['basename'](PATH,_0x84d6('0x1c'));var _0x49902e=_0x2fb185['split']&&_0x41e128[_0x84d6('0x1d')]>0x1;var _0x1b86f2=[];if(!fs['existsSync'](path[_0x84d6('0x1e')](_0x1aa38c,_0x24c8fb))&&_0x49902e){fs[_0x84d6('0x1f')](path[_0x84d6('0x1e')](_0x1aa38c,_0x24c8fb));}return BPromise[_0x84d6('0x20')](_0x41e128,function(_0x5deaa5){_0x1b86f2[_0x84d6('0x1a')](_0x5deaa5);})['then'](function(){for(var _0x3ff67a=0x0;_0x3ff67a<_0x1b86f2[_0x84d6('0x1d')];_0x3ff67a+=0x1){var _0x548ba5;var _0x500a81=_0x1b86f2[_0x3ff67a];if(_0x49902e){_0x548ba5=path[_0x84d6('0x1e')](_0x1aa38c,_0x24c8fb,util['format']('%s%d.%s',_0x24c8fb,_0x3ff67a,_0x84d6('0x21')));}else{_0x548ba5=path['join'](_0x1aa38c,util[_0x84d6('0xd')]('%s.%s',_0x24c8fb,_0x84d6('0x21')));}fs[_0x84d6('0x22')](_0x548ba5,json2xls(_0x500a81),_0x84d6('0x23'));}})[_0x84d6('0x11')](function(){if(_0x49902e){zipdir(path[_0x84d6('0x1e')](_0x1aa38c,_0x24c8fb),{'saveTo':path[_0x84d6('0x1e')](_0x1aa38c,util[_0x84d6('0xd')](_0x84d6('0x24'),_0x24c8fb,_0x84d6('0x25')))},function(_0x1ebff2,_0x20c27b){});rimraf(path[_0x84d6('0x1e')](_0x1aa38c,_0x24c8fb),function(){});}})['then'](function(){logger[_0x84d6('0xc')](util[_0x84d6('0xd')](_0x84d6('0x26'),EXTRACTED_REPORT_ID,_0x84d6('0x27')));return analyticExtractedReport(_0x84d6('0x28'),_0x49902e?util[_0x84d6('0xd')](_0x84d6('0x24'),_0x24c8fb,_0x49902e?_0x84d6('0x25'):'xlsx'):null);});})[_0x84d6('0x29')](function(_0x599045){logger[_0x84d6('0xc')](util[_0x84d6('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x84d6('0x27')),util[_0x84d6('0x2a')](_0x599045,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index ff2a83e..ba88660 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 _0xdfe0=['Set','format','CDR(type)=%s','type','context','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','VoiceExtensionId','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find'];(function(_0x5ba234,_0x4f4256){var _0x446195=function(_0x18482d){while(--_0x18482d){_0x5ba234['push'](_0x5ba234['shift']());}};_0x446195(++_0x4f4256);}(_0xdfe0,0xce));var _0x0dfe=function(_0x2c9847,_0x357d88){_0x2c9847=_0x2c9847-0x0;var _0x43b41f=_0xdfe0[_0x2c9847];return _0x43b41f;};'use strict';var _=require(_0x0dfe('0x0'));var util=require(_0x0dfe('0x1'));function rewrite(_0x52f7f7,_0x3bf52c){var _0x42fe94=this;return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x3')][_0x0dfe('0x4')]({'raw':!![]})[_0x0dfe('0x5')](function(_0x599acd){_0x42fe94[_0x0dfe('0x6')]=_0x599acd;return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')][_0x0dfe('0x4')]({'where':{'IntervalId':_0x3bf52c[_0x0dfe('0x8')]},'raw':!![]});})['then'](function(_0x22c92b){return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')][_0x0dfe('0x4')]({'where':{'exten':{'$in':_[_0x0dfe('0x9')](_[_0x0dfe('0xa')](_0x22c92b,_0x0dfe('0xb')))}},'order':[{'raw':_0x0dfe('0xc')}],'raw':!![]});})[_0x0dfe('0x5')](function(_0x4d1a97){var _0x218c4d=_[_0x0dfe('0xd')](_0x4d1a97,{'priority':'1'});var _0x3f5015=_[_0x0dfe('0xd')](_0x4d1a97,{'isApp':0x1});var _0x1da194=_[_0x0dfe('0xe')](_0x3f5015,_0x0dfe('0xb'));var _0x4ab3ac=[_0x0dfe('0xf'),_0x0dfe('0x10')];var _0x27565c=[];var _0x7fe1e6=[];for(var _0x589f73 in _0x1da194){if(_0x1da194[_0x0dfe('0x11')](_0x589f73)){_0x42fe94[_0x0dfe('0x12')]=0x2;_0x42fe94[_0x0dfe('0x13')]=[];_0x42fe94[_0x0dfe('0x14')]=_[_0x0dfe('0x15')](_0x218c4d,{'exten':_0x1da194[_0x589f73][0x0]['exten']});_0x42fe94[_0x0dfe('0x13')]['push']({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x16'),'appdata':util[_0x0dfe('0x17')](_0x0dfe('0x18'),_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')]),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0]['exten'],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});if(_0x1da194[_0x589f73][0x0]['type']===_0x0dfe('0x1b')){if(_0x42fe94[_0x0dfe('0x14')]){_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x1d')+(_0x42fe94[_0x0dfe('0x14')][_0x0dfe('0x1e')]?_0x0dfe('0x1f')+_0x42fe94[_0x0dfe('0x14')][_0x0dfe('0x1e')]+'}':'${EXTEN}'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});}_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x21')+_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')],'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0]['exten'],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});var _0x4b385c=_0x42fe94[_0x0dfe('0x12')]++;_0x42fe94[_0x0dfe('0x13')]['push']({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x22'),'appdata':_0x0dfe('0x23')+(_0x4b385c+0x2)+_0x0dfe('0x24')+(_0x4b385c+0x1)+')','context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x4b385c,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});if(_0x42fe94[_0x0dfe('0x14')]){_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x42fe94[_0x0dfe('0x14')]['cutdigits']?_0x0dfe('0x25')+_0x42fe94[_0x0dfe('0x14')][_0x0dfe('0x1e')]+'}':'CDR(prefix)=noprefix','context':_0x1da194[_0x589f73][0x0]['context'],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});}_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':'Set','appdata':_0x0dfe('0x26')+_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')],'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});if(_0x42fe94[_0x0dfe('0x14')]&&_0x42fe94[_0x0dfe('0x14')]['hasOwnProperty'](_0x0dfe('0x27'))&&_0x42fe94[_0x0dfe('0x14')]['recordingFormat']!==_0x0dfe('0x28')){_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x29'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x2a')+_0x42fe94['extension'][_0x0dfe('0x27')]||_0x0dfe('0x2b'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});}}_0x42fe94['extensions'][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x2c'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});_0x42fe94['extensions'][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1da194[_0x589f73][0x0]['context'],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x2d'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});for(var _0x92bded=0x0,_0x119a13=0x0;_0x92bded<_0x1da194[_0x589f73][_0x0dfe('0x2e')];_0x92bded+=0x1,_0x119a13=0x0){var _0x4a836d=_0x1da194[_0x589f73][_0x92bded];if(_0x4a836d[_0x0dfe('0x19')]){_0x4a836d['type']=_0x4a836d['type']['toLowerCase']();}var _0x9092c0=[];var _0xd71359=[];delete _0x4a836d['id'];delete _0x4a836d[_0x0dfe('0x2f')];delete _0x4a836d[_0x0dfe('0x30')];var _0x12816b=_0x4a836d[_0x0dfe('0x31')]!==_0x0dfe('0x32')?[_0x4a836d['interval']]:_0x4a836d[_0x0dfe('0x8')]?_['map'](_[_0x0dfe('0xd')](_0x42fe94[_0x0dfe('0x6')],{'IntervalId':_0x4a836d['IntervalId']}),'interval'):[];if(_0x4a836d[_0x0dfe('0x11')](_0x0dfe('0x33'))){if(_0x4a836d[_0x0dfe('0x33')]&&_0x4a836d['tag']!=='--'){_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x34')+_0x4a836d[_0x0dfe('0x33')],'context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d['exten'],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d[_0x0dfe('0x20')]});}}if(_0x4a836d['type']===_0x0dfe('0x1b')&&_0x4a836d[_0x0dfe('0x11')]('callerID')){if(_0x4a836d['callerID']){_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':'ExecIf','appdata':_0x0dfe('0x35')+_0x4a836d[_0x0dfe('0x36')]+')','context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d[_0x0dfe('0x20')]});}else{_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x22'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});}}if(_0x4a836d[_0x0dfe('0x11')](_0x0dfe('0x37'))){if(_0x4ab3ac[_0x0dfe('0x38')](_0x4a836d[_0x0dfe('0x39')][_0x0dfe('0x3a')]())>=0x0&&_0x4a836d[_0x0dfe('0x3b')]!==_0x0dfe('0x3c')){if(_0x4a836d['answer']){_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d['type'],'app':_0x0dfe('0x22'),'appdata':_0x0dfe('0x3d'),'context':_0x4a836d['context'],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x3e'),'context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});}else{_0x9092c0['push']({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x22'),'appdata':_0x0dfe('0x3f'),'context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});_0x9092c0['push']({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d[_0x0dfe('0x20')]});}}}for(var _0x23e21e=0x0;_0x23e21e<_0x12816b[_0x0dfe('0x2e')];_0x23e21e+=0x1){var _0x4209e5=_0x42fe94[_0x0dfe('0x12')]+_0x12816b['length'];var _0xf06c62=_0x23e21e===_0x12816b['length']-0x1?_0x42fe94[_0x0dfe('0x12')]+_0x9092c0[_0x0dfe('0x2e')]+_0xd71359[_0x0dfe('0x2e')]+0x2:_0x42fe94[_0x0dfe('0x12')]+_0x23e21e+0x1;_0x9092c0[_0x0dfe('0x40')](_0x23e21e,0x0,{'type':_0x4a836d['type'],'app':_0x0dfe('0x41'),'appdata':_0x12816b[_0x23e21e]+'?'+_0x4a836d['context']+_0x0dfe('0x42')+_0x4209e5+':'+_0x4a836d['context']+_0x0dfe('0x42')+_0xf06c62,'exten':_0x4a836d['exten'],'context':_0x4a836d['context'],'priority':_0x42fe94[_0x0dfe('0x12')]+_0x23e21e,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});}_0x4a836d['priority']=_0x9092c0[_0x0dfe('0x2e')]?_['last'](_0x9092c0)['priority']+0x1:_0x42fe94[_0x0dfe('0x12')];_0x42fe94['priority']=(_0xd71359[_0x0dfe('0x2e')]?_[_0x0dfe('0x43')](_0xd71359)[_0x0dfe('0x12')]:_0x4a836d[_0x0dfe('0x12')])+0x1;_0x42fe94[_0x0dfe('0x13')]=_[_0x0dfe('0x44')](_0x42fe94[_0x0dfe('0x13')],_0x9092c0,[_0x4a836d],_0xd71359);}_0x42fe94[_0x0dfe('0x13')]['push']({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x45'),'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'priority':_0x42fe94[_0x0dfe('0x12')],'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});_0x27565c[_0x0dfe('0x1c')](_0x1da194[_0x589f73][0x0]['VoiceExtensionId']);_0x7fe1e6=_[_0x0dfe('0x44')](_0x7fe1e6,_0x42fe94[_0x0dfe('0x13')]);}}return _0x52f7f7[_0x0dfe('0x46')](function(_0x5328f1){return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x27565c}},'transaction':_0x5328f1})[_0x0dfe('0x5')](function(_0x36d72e){return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')][_0x0dfe('0x47')](_[_0x0dfe('0x48')](_0x7fe1e6,_0x0dfe('0x12')),{'transaction':_0x5328f1});});});})[_0x0dfe('0x49')](function(_0x3ee19f){console[_0x0dfe('0x4a')](_0x3ee19f);});}exports[_0x0dfe('0x4b')]=rewrite; \ No newline at end of file +var _0xf7c3=['VoiceExtension','IntervalId','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','extensions','extension','find','type','Set','context','priority','VoiceExtensionId','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','interval','*,*,*,*','map','intervals','tag','outbound','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)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','error','lodash','util','models','findAll','then'];(function(_0xd1887,_0x982797){var _0x13617a=function(_0x4311d0){while(--_0x4311d0){_0xd1887['push'](_0xd1887['shift']());}};_0x13617a(++_0x982797);}(_0xf7c3,0x154));var _0x3f7c=function(_0x305a91,_0x45bc65){_0x305a91=_0x305a91-0x0;var _0x2c32e4=_0xf7c3[_0x305a91];return _0x2c32e4;};'use strict';var _=require(_0x3f7c('0x0'));var util=require(_0x3f7c('0x1'));function rewrite(_0xcd57bb,_0x3181b6){var _0x5b5a6b=this;return _0xcd57bb[_0x3f7c('0x2')]['Interval'][_0x3f7c('0x3')]({'raw':!![]})[_0x3f7c('0x4')](function(_0x46708e){_0x5b5a6b['intervals']=_0x46708e;return _0xcd57bb[_0x3f7c('0x2')][_0x3f7c('0x5')]['findAll']({'where':{'IntervalId':_0x3181b6[_0x3f7c('0x6')]},'raw':!![]});})['then'](function(_0x3c23a2){return _0xcd57bb['models'][_0x3f7c('0x5')][_0x3f7c('0x3')]({'where':{'exten':{'$in':_[_0x3f7c('0x7')](_['map'](_0x3c23a2,_0x3f7c('0x8')))}},'order':[{'raw':_0x3f7c('0x9')}],'raw':!![]});})[_0x3f7c('0x4')](function(_0x1f96e4){var _0x5b4eda=_['filter'](_0x1f96e4,{'priority':'1'});var _0x459e1d=_[_0x3f7c('0xa')](_0x1f96e4,{'isApp':0x1});var _0x58c8ca=_[_0x3f7c('0xb')](_0x459e1d,_0x3f7c('0x8'));var _0x376518=[_0x3f7c('0xc'),'playback'];var _0x1c0f0c=[];var _0x23434a=[];for(var _0x587981 in _0x58c8ca){if(_0x58c8ca['hasOwnProperty'](_0x587981)){_0x5b5a6b['priority']=0x2;_0x5b5a6b[_0x3f7c('0xd')]=[];_0x5b5a6b[_0x3f7c('0xe')]=_[_0x3f7c('0xf')](_0x5b4eda,{'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')]});_0x5b5a6b[_0x3f7c('0xd')]['push']({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':util['format']('CDR(type)=%s',_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')]),'context':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x12')],'exten':_0x58c8ca[_0x587981][0x0]['exten'],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});if(_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')]==='outbound'){if(_0x5b5a6b[_0x3f7c('0xe')]){_0x5b5a6b[_0x3f7c('0xd')][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0]['type'],'app':_0x3f7c('0x11'),'appdata':_0x3f7c('0x16')+(_0x5b5a6b['extension'][_0x3f7c('0x17')]?_0x3f7c('0x18')+_0x5b5a6b[_0x3f7c('0xe')][_0x3f7c('0x17')]+'}':_0x3f7c('0x19')),'context':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x12')],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});}_0x5b5a6b[_0x3f7c('0xd')]['push']({'type':_0x58c8ca[_0x587981][0x0]['type'],'app':_0x3f7c('0x11'),'appdata':_0x3f7c('0x1a')+_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')],'context':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x12')],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});var _0x472007=_0x5b5a6b[_0x3f7c('0x13')]++;_0x5b5a6b[_0x3f7c('0xd')][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x1b'),'appdata':_0x3f7c('0x1c')+(_0x472007+0x2)+_0x3f7c('0x1d')+(_0x472007+0x1)+')','context':_0x58c8ca[_0x587981][0x0]['context'],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x472007,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});if(_0x5b5a6b[_0x3f7c('0xe')]){_0x5b5a6b['extensions'][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':_0x5b5a6b[_0x3f7c('0xe')][_0x3f7c('0x17')]?_0x3f7c('0x1e')+_0x5b5a6b[_0x3f7c('0xe')][_0x3f7c('0x17')]+'}':_0x3f7c('0x1f'),'context':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x12')],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});}_0x5b5a6b['extensions'][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':_0x3f7c('0x20')+_0x58c8ca[_0x587981][0x0]['VoiceExtensionId'],'context':_0x58c8ca[_0x587981][0x0]['context'],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b['priority']++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});if(_0x5b5a6b[_0x3f7c('0xe')]&&_0x5b5a6b[_0x3f7c('0xe')][_0x3f7c('0x21')](_0x3f7c('0x22'))&&_0x5b5a6b[_0x3f7c('0xe')][_0x3f7c('0x22')]!==_0x3f7c('0x23')){_0x5b5a6b[_0x3f7c('0xd')][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0]['type'],'app':_0x3f7c('0x11'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x58c8ca[_0x587981][0x0]['context'],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0]['VoiceExtensionId']});_0x5b5a6b['extensions'][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':_0x3f7c('0x24')+_0x5b5a6b[_0x3f7c('0xe')]['recordingFormat']||_0x3f7c('0x25'),'context':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x12')],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});}}_0x5b5a6b[_0x3f7c('0xd')][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0]['type'],'app':'Set','appdata':_0x3f7c('0x26'),'context':_0x58c8ca[_0x587981][0x0]['context'],'exten':_0x58c8ca[_0x587981][0x0]['exten'],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});_0x5b5a6b['extensions'][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':_0x3f7c('0x27'),'context':_0x58c8ca[_0x587981][0x0]['context'],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b['priority']++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});_0x5b5a6b[_0x3f7c('0xd')]['push']({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':_0x3f7c('0x28'),'context':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x12')],'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'priority':_0x5b5a6b[_0x3f7c('0x13')]++,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});for(var _0x1ad666=0x0,_0x3036f5=0x0;_0x1ad666<_0x58c8ca[_0x587981][_0x3f7c('0x29')];_0x1ad666+=0x1,_0x3036f5=0x0){var _0x2d71d8=_0x58c8ca[_0x587981][_0x1ad666];if(_0x2d71d8['type']){_0x2d71d8[_0x3f7c('0x10')]=_0x2d71d8[_0x3f7c('0x10')]['toLowerCase']();}var _0x46e434=[];var _0x593f75=[];delete _0x2d71d8['id'];delete _0x2d71d8[_0x3f7c('0x2a')];delete _0x2d71d8['updatedAt'];var _0x11d17c=_0x2d71d8[_0x3f7c('0x2b')]!==_0x3f7c('0x2c')?[_0x2d71d8['interval']]:_0x2d71d8[_0x3f7c('0x6')]?_[_0x3f7c('0x2d')](_[_0x3f7c('0xa')](_0x5b5a6b[_0x3f7c('0x2e')],{'IntervalId':_0x2d71d8[_0x3f7c('0x6')]}),_0x3f7c('0x2b')):[];if(_0x2d71d8[_0x3f7c('0x21')](_0x3f7c('0x2f'))){if(_0x2d71d8[_0x3f7c('0x2f')]&&_0x2d71d8['tag']!=='--'){_0x46e434[_0x3f7c('0x15')]({'type':_0x2d71d8[_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':'CDR(tag)='+_0x2d71d8['tag'],'context':_0x2d71d8[_0x3f7c('0x12')],'exten':_0x2d71d8[_0x3f7c('0x8')],'priority':_0x11d17c[_0x3f7c('0x29')]+_0x5b5a6b[_0x3f7c('0x13')]+_0x3036f5++,'VoiceExtensionId':_0x2d71d8[_0x3f7c('0x14')]});}}if(_0x2d71d8[_0x3f7c('0x10')]===_0x3f7c('0x30')&&_0x2d71d8[_0x3f7c('0x21')](_0x3f7c('0x31'))){if(_0x2d71d8[_0x3f7c('0x31')]){_0x46e434['push']({'type':_0x2d71d8['type'],'app':'ExecIf','appdata':_0x3f7c('0x32')+_0x2d71d8['callerID']+')','context':_0x2d71d8['context'],'exten':_0x2d71d8['exten'],'priority':_0x11d17c[_0x3f7c('0x29')]+_0x5b5a6b['priority']+_0x3036f5++,'VoiceExtensionId':_0x2d71d8[_0x3f7c('0x14')]});}else{_0x46e434[_0x3f7c('0x15')]({'type':_0x2d71d8[_0x3f7c('0x10')],'app':_0x3f7c('0x1b'),'appdata':_0x3f7c('0x33'),'context':_0x2d71d8[_0x3f7c('0x12')],'exten':_0x2d71d8['exten'],'priority':_0x11d17c[_0x3f7c('0x29')]+_0x5b5a6b[_0x3f7c('0x13')]+_0x3036f5++,'VoiceExtensionId':_0x2d71d8[_0x3f7c('0x14')]});}}if(_0x2d71d8[_0x3f7c('0x21')]('answer')){if(_0x376518[_0x3f7c('0x34')](_0x2d71d8[_0x3f7c('0x35')]['toLowerCase']())>=0x0&&_0x2d71d8[_0x3f7c('0x36')]!==_0x3f7c('0x37')){if(_0x2d71d8[_0x3f7c('0x38')]){_0x46e434['push']({'type':_0x2d71d8[_0x3f7c('0x10')],'app':_0x3f7c('0x1b'),'appdata':_0x3f7c('0x39'),'context':_0x2d71d8[_0x3f7c('0x12')],'exten':_0x2d71d8['exten'],'priority':_0x11d17c[_0x3f7c('0x29')]+_0x5b5a6b[_0x3f7c('0x13')]+_0x3036f5++,'VoiceExtensionId':_0x2d71d8[_0x3f7c('0x14')]});_0x46e434['push']({'type':_0x2d71d8[_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':_0x3f7c('0x3a'),'context':_0x2d71d8[_0x3f7c('0x12')],'exten':_0x2d71d8[_0x3f7c('0x8')],'priority':_0x11d17c[_0x3f7c('0x29')]+_0x5b5a6b['priority']+_0x3036f5++,'VoiceExtensionId':_0x2d71d8['VoiceExtensionId']});}else{_0x46e434[_0x3f7c('0x15')]({'type':_0x2d71d8[_0x3f7c('0x10')],'app':_0x3f7c('0x1b'),'appdata':_0x3f7c('0x3b'),'context':_0x2d71d8['context'],'exten':_0x2d71d8['exten'],'priority':_0x11d17c[_0x3f7c('0x29')]+_0x5b5a6b[_0x3f7c('0x13')]+_0x3036f5++,'VoiceExtensionId':_0x2d71d8['VoiceExtensionId']});_0x46e434['push']({'type':_0x2d71d8[_0x3f7c('0x10')],'app':_0x3f7c('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x2d71d8[_0x3f7c('0x12')],'exten':_0x2d71d8[_0x3f7c('0x8')],'priority':_0x11d17c[_0x3f7c('0x29')]+_0x5b5a6b[_0x3f7c('0x13')]+_0x3036f5++,'VoiceExtensionId':_0x2d71d8[_0x3f7c('0x14')]});}}}for(var _0x1f0d5c=0x0;_0x1f0d5c<_0x11d17c[_0x3f7c('0x29')];_0x1f0d5c+=0x1){var _0x272e1f=_0x5b5a6b[_0x3f7c('0x13')]+_0x11d17c[_0x3f7c('0x29')];var _0x1e33a8=_0x1f0d5c===_0x11d17c['length']-0x1?_0x5b5a6b[_0x3f7c('0x13')]+_0x46e434[_0x3f7c('0x29')]+_0x593f75[_0x3f7c('0x29')]+0x2:_0x5b5a6b[_0x3f7c('0x13')]+_0x1f0d5c+0x1;_0x46e434['splice'](_0x1f0d5c,0x0,{'type':_0x2d71d8['type'],'app':'GotoIfTime','appdata':_0x11d17c[_0x1f0d5c]+'?'+_0x2d71d8['context']+_0x3f7c('0x3c')+_0x272e1f+':'+_0x2d71d8[_0x3f7c('0x12')]+_0x3f7c('0x3c')+_0x1e33a8,'exten':_0x2d71d8[_0x3f7c('0x8')],'context':_0x2d71d8[_0x3f7c('0x12')],'priority':_0x5b5a6b[_0x3f7c('0x13')]+_0x1f0d5c,'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});}_0x2d71d8[_0x3f7c('0x13')]=_0x46e434[_0x3f7c('0x29')]?_[_0x3f7c('0x3d')](_0x46e434)['priority']+0x1:_0x5b5a6b[_0x3f7c('0x13')];_0x5b5a6b[_0x3f7c('0x13')]=(_0x593f75[_0x3f7c('0x29')]?_[_0x3f7c('0x3d')](_0x593f75)[_0x3f7c('0x13')]:_0x2d71d8['priority'])+0x1;_0x5b5a6b[_0x3f7c('0xd')]=_[_0x3f7c('0x3e')](_0x5b5a6b[_0x3f7c('0xd')],_0x46e434,[_0x2d71d8],_0x593f75);}_0x5b5a6b[_0x3f7c('0xd')][_0x3f7c('0x15')]({'type':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x10')],'app':_0x3f7c('0x3f'),'exten':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x8')],'context':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x12')],'priority':_0x5b5a6b['priority'],'VoiceExtensionId':_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]});_0x1c0f0c[_0x3f7c('0x15')](_0x58c8ca[_0x587981][0x0][_0x3f7c('0x14')]);_0x23434a=_[_0x3f7c('0x3e')](_0x23434a,_0x5b5a6b[_0x3f7c('0xd')]);}}return _0xcd57bb[_0x3f7c('0x40')](function(_0x1ef2c9){return _0xcd57bb['models'][_0x3f7c('0x5')][_0x3f7c('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x1c0f0c}},'transaction':_0x1ef2c9})[_0x3f7c('0x4')](function(_0x102869){return _0xcd57bb[_0x3f7c('0x2')][_0x3f7c('0x5')][_0x3f7c('0x42')](_[_0x3f7c('0x43')](_0x23434a,_0x3f7c('0x13')),{'transaction':_0x1ef2c9});});});})['catch'](function(_0x5a94c5){console[_0x3f7c('0x44')](_0x5a94c5);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 6434891..62da41c 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 _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file +var _0xb7e7=['birthDate','YYYY-MM-DD','isValid','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','Duplicate\x20Contact','CmContact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','insert','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','toString','NOW()','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','ContactId','cm_contacts','where','str','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','get','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','createReadStream','parse','duplicate','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','papaparse','../../../mysqldb','../../../config/logger','api','redis','localhost','socket.io-emitter','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','error','contact','index','test','isNil','errors','length','map','join','data','phone','phone\x20not\x20specified!'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb7e7,0x121));var _0x7b7e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb7e7[_0x3947c9];return _0x2e7871;};'use strict';var BPromise=require(_0x7b7e('0x0'));var util=require('util');var _=require(_0x7b7e('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x7b7e('0x2'));var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var config=require('../../../config/environment');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));config[_0x7b7e('0x6')]=_['defaults'](config['redis'],{'host':_0x7b7e('0x7'),'port':0x18eb});var socket=require(_0x7b7e('0x8'))(new Redis(config[_0x7b7e('0x6')]));require('../../../api/cmContact/cmContact.socket')[_0x7b7e('0x9')](socket);try{if(!process[_0x7b7e('0xa')][0x2]||process[_0x7b7e('0xa')][0x2]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x2]===_0x7b7e('0xc')){throw new Error(_0x7b7e('0xd'));}var FILEPATH=process['argv'][0x2];if(!process[_0x7b7e('0xa')][0x3]||process[_0x7b7e('0xa')][0x3]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x3]===_0x7b7e('0xc')||!process[_0x7b7e('0xa')][0x4]||process[_0x7b7e('0xa')][0x4]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x4]==='null'){throw new Error(_0x7b7e('0xe'));}var FIELDS=_[_0x7b7e('0xf')](process['argv'][0x3][_0x7b7e('0x10')](','),process['argv'][0x4]['split'](','));if(!process[_0x7b7e('0xa')][0x5]||process[_0x7b7e('0xa')][0x5]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x5]===_0x7b7e('0xc')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x7b7e('0xa')][0x6]&&process[_0x7b7e('0xa')][0x6]!==_0x7b7e('0xb')&&process[_0x7b7e('0xa')][0x6]!==_0x7b7e('0xc')?process[_0x7b7e('0xa')][0x6]:null;var DUPLICATES=process[_0x7b7e('0xa')][0x7]&&process[_0x7b7e('0xa')][0x7]!==_0x7b7e('0xb')&&process[_0x7b7e('0xa')][0x7]!==_0x7b7e('0xc')?process[_0x7b7e('0xa')][0x7]:null;if(!process[_0x7b7e('0xa')][0x8]||process[_0x7b7e('0xa')][0x8]===_0x7b7e('0xb')||process[_0x7b7e('0xa')][0x8]===_0x7b7e('0xc')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x7b7e('0xa')][0x8];}catch(_0x43db4f){logger[_0x7b7e('0x11')](_0x43db4f);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(_0x4c0647,_0x313122,_0xbf0cb3,_0x14243b){var _0x200156={'message':_0x313122};_0x200156[_0x4c0647]=!![];if(_0xbf0cb3){_0x200156[_0x7b7e('0x12')]=_0xbf0cb3;}if(_0x14243b){_0x200156[_0x7b7e('0x13')]=_0x14243b;}return _0x200156;}function isEmail(_0x28bf43){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))*$/[_0x7b7e('0x14')](_0x28bf43);}function checkRow(_0x53bbb3,_0x5d6215,_0x4a836a){return new BPromise(function(_0x26ee14,_0x22598e){if(_[_0x7b7e('0x15')](_0x53bbb3)){return _0x22598e(handleCheckRowError('error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x4a836a));}if(_0x53bbb3['errors']&&_0x53bbb3[_0x7b7e('0x16')][_0x7b7e('0x17')]){var _0x16a3c7=_[_0x7b7e('0x18')](_0x53bbb3[_0x7b7e('0x16')],'message')[_0x7b7e('0x19')](';');return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x16a3c7,null,_0x4a836a));}var _0x4c46b8={};for(var _0x57b9da in FIELDS){if(FIELDS['hasOwnProperty'](_0x57b9da)&&FIELDS[_0x57b9da]){_0x4c46b8[_0x57b9da]=_0x53bbb3[_0x7b7e('0x1a')][0x0][FIELDS[_0x57b9da]]||_0x53bbb3[_0x7b7e('0x1a')][0x0]['\ufeff'+FIELDS[_0x57b9da]];}}if(!_0x4c46b8['firstName']){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),'firstName\x20not\x20specified!',null,_0x4a836a));}if(!_0x4c46b8[_0x7b7e('0x1b')]){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x1c'),null,_0x4a836a));}if(_0x4c46b8['birthDate']){var _0x3960b8=moment(_0x4c46b8[_0x7b7e('0x1d')],_0x7b7e('0x1e'));if(!_0x3960b8[_0x7b7e('0x1f')]()){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4a836a));}}if(_0x4c46b8[_0x7b7e('0x20')]){if(!isEmail(_0x4c46b8['email'])){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x21'),null,_0x4a836a));}}_0x4c46b8[_0x7b7e('0x22')]=LISTID;_0x4c46b8[_0x7b7e('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7b7e('0x17')]&&_0x5d6215){var _0x247ea0={};for(var _0x29cb58=0x0,_0x4bfe7f=DUPLICATES['length'];_0x29cb58<_0x4bfe7f;_0x29cb58+=0x1){_0x247ea0[DUPLICATES[_0x29cb58]]=_0x4c46b8[DUPLICATES[_0x29cb58]];}var _0xebcdbc=_[_0x7b7e('0x24')](_0x5d6215,_0x247ea0);if(_0xebcdbc){return _0x22598e(handleCheckRowError('duplicate',_0x7b7e('0x25'),_0xebcdbc,_0x4a836a));}}return db[_0x7b7e('0x26')][_0x7b7e('0x27')](_0x4c46b8,{'raw':!![],'hooks':![],'fields':_['keys'](_0x4c46b8)})[_0x7b7e('0x28')](function(_0x256908){if(DUPLICATES&&DUPLICATES[_0x7b7e('0x17')]&&_0x5d6215){_0x5d6215[_0x7b7e('0x29')](_[_0x7b7e('0x2a')](_0x4c46b8,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x256908['id'];return _0x26ee14();})[_0x7b7e('0x2b')](function(_0x3e8cf4){return _0x22598e(handleCheckRowError(_0x7b7e('0x11'),_0x7b7e('0x2c')+(_0x3e8cf4[_0x7b7e('0x2d')]||JSON[_0x7b7e('0x2e')](_0x3e8cf4)),null,_0x4a836a));});});}function checkHopper(){function _0x2d0620(){return function(_0x442366){logger[_0x7b7e('0x11')](_0x7b7e('0x2f'),_0x7b7e('0x30'),util['inspect'](_0x442366,{'showHidden':![],'depth':null}));};}var _0x8c80d5=function(_0x156dca,_0xb20532){var _0x242609=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x33'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x35'),'ContactId',_0x7b7e('0x22'),_0xb20532,_0x7b7e('0x36'),_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field'](_0x7b7e('0x1b'),_0x7b7e('0x1b'))[_0x7b7e('0x39')]('NOW()','scheduledAt')[_0x7b7e('0x39')]('id','ContactId')[_0x7b7e('0x39')](LISTID[_0x7b7e('0x3a')](),'ListId')[_0x7b7e('0x39')](_0x156dca['id'][_0x7b7e('0x3a')](),_0xb20532)[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x36'))[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')]('cm_contacts')['where'](_0x7b7e('0x3d'))['where'](_0x7b7e('0x3e'),LISTID['toString']())['where'](_0x7b7e('0x3f'))['where'](_0x7b7e('0x40'),squel['select']()[_0x7b7e('0x39')](_0x7b7e('0x1b'))[_0x7b7e('0x3c')](_0x7b7e('0x33'))['where'](_0xb20532+_0x7b7e('0x41'),_0x156dca['id'][_0x7b7e('0x3a')]())))[_0x7b7e('0x3a')]();return _0x242609;};var _0x37895a=function(_0x3e4f21,_0xccdfc7){var _0x5e8572=squel['insert']()['into'](_0x7b7e('0x33'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x35'),_0x7b7e('0x42'),_0x7b7e('0x22'),_0xccdfc7,'createdAt',_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field']('phone',_0x7b7e('0x1b'))[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x35'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))['field'](LISTID[_0x7b7e('0x3a')](),'ListId')[_0x7b7e('0x39')](_0x3e4f21['id'][_0x7b7e('0x3a')](),_0xccdfc7)[_0x7b7e('0x39')](_0x7b7e('0x3b'),'createdAt')[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')](_0x7b7e('0x43'))['where'](_0x7b7e('0x3d'))[_0x7b7e('0x44')](_0x7b7e('0x3e'),LISTID[_0x7b7e('0x3a')]())[_0x7b7e('0x44')]('id\x20IN\x20?',squel[_0x7b7e('0x45')](hopperContacts))[_0x7b7e('0x44')](_0x7b7e('0x3f'))[_0x7b7e('0x44')](_0x7b7e('0x40'),squel[_0x7b7e('0x38')]()[_0x7b7e('0x39')]('calleridnum')[_0x7b7e('0x3c')]('cm_hopper_final')[_0x7b7e('0x44')](_0xccdfc7+_0x7b7e('0x41'),_0x3e4f21['id']['toString']()))[_0x7b7e('0x44')](_0x7b7e('0x40'),squel[_0x7b7e('0x38')]()[_0x7b7e('0x39')](_0x7b7e('0x1b'))[_0x7b7e('0x3c')](_0x7b7e('0x33'))['where'](_0xccdfc7+_0x7b7e('0x41'),_0x3e4f21['id'][_0x7b7e('0x3a')]())))[_0x7b7e('0x3a')]();return _0x5e8572;};function _0x24481a(_0x5b9ab5,_0x527403){var _0x5bdf1d=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x33'))['fromQuery'](['phone',_0x7b7e('0x35'),_0x7b7e('0x42'),'ListId',_0x527403,_0x7b7e('0x36'),_0x7b7e('0x37')],squel[_0x7b7e('0x38')]()['field'](_0x7b7e('0x1b'),_0x7b7e('0x1b'))['field'](_0x7b7e('0x3b'),_0x7b7e('0x35'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))[_0x7b7e('0x39')](LISTID[_0x7b7e('0x3a')](),_0x7b7e('0x22'))[_0x7b7e('0x39')](_0x5b9ab5['id'][_0x7b7e('0x3a')](),_0x527403)['field'](_0x7b7e('0x3b'),_0x7b7e('0x36'))['field'](_0x7b7e('0x3b'),_0x7b7e('0x37'))[_0x7b7e('0x3c')]('cm_contacts')[_0x7b7e('0x44')]('deletedAt\x20IS\x20NULL')[_0x7b7e('0x44')](_0x7b7e('0x3e'),LISTID['toString']())[_0x7b7e('0x44')](_0x7b7e('0x46'),squel['str'](hopperContacts))[_0x7b7e('0x44')](_0x7b7e('0x3f')))[_0x7b7e('0x3a')]();return _0x5bdf1d;}function _0x3b1adb(_0x5eb32c,_0x101896){var _0x73904d=squel[_0x7b7e('0x31')]()[_0x7b7e('0x32')](_0x7b7e('0x47'))[_0x7b7e('0x34')]([_0x7b7e('0x1b'),_0x7b7e('0x42'),_0x7b7e('0x22'),_0x101896,_0x7b7e('0x36'),'updatedAt'],squel[_0x7b7e('0x38')]()['field']('phone',_0x7b7e('0x1b'))[_0x7b7e('0x39')]('id',_0x7b7e('0x42'))[_0x7b7e('0x39')](LISTID['toString'](),_0x7b7e('0x22'))[_0x7b7e('0x39')](_0x5eb32c['id'][_0x7b7e('0x3a')](),_0x101896)[_0x7b7e('0x39')](_0x7b7e('0x3b'),_0x7b7e('0x36'))['field'](_0x7b7e('0x3b'),'updatedAt')['from'](_0x7b7e('0x43'))['where'](_0x7b7e('0x3d'))['where'](_0x7b7e('0x3e'),LISTID[_0x7b7e('0x3a')]())['where'](_0x7b7e('0x46'),squel[_0x7b7e('0x45')](hopperContacts))['where'](_0x7b7e('0x3f')))[_0x7b7e('0x3a')]();return _0x73904d;}return db[_0x7b7e('0x48')][_0x7b7e('0x49')]({'where':{'type':_0x7b7e('0x4a')},'attributes':['id',_0x7b7e('0x4b')],'include':[{'model':db[_0x7b7e('0x4c')],'as':_0x7b7e('0x4d'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x17e5ba){var _0x589b02=[];if(_0x17e5ba){var _0x59ecf9;for(var _0x34e7df=0x0,_0x46ac1f;_0x34e7df<_0x17e5ba[_0x7b7e('0x17')];_0x34e7df+=0x1){_0x46ac1f=_0x17e5ba[_0x34e7df][_0x7b7e('0x4e')]({'plain':!![]});switch(_0x46ac1f[_0x7b7e('0x4b')]){case _0x7b7e('0x4f'):_0x589b02[_0x7b7e('0x29')](db['sequelize'][_0x7b7e('0x50')](_0x37895a(_0x46ac1f,_0x7b7e('0x51')))['then'](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;case _0x7b7e('0x52'):_0x589b02[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x8c80d5(_0x46ac1f,_0x7b7e('0x51')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;default:_0x589b02[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x24481a(_0x46ac1f,'VoiceQueueId'))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}}return _0x589b02;})[_0x7b7e('0x54')]()[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x48')][_0x7b7e('0x49')]({'where':{'type':_0x7b7e('0x4a')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x7b7e('0x55'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x1eb5ce){var _0x49f0a4=[];if(_0x1eb5ce){var _0x1d6aa4;for(var _0x195ae2=0x0,_0x381ee6;_0x195ae2<_0x1eb5ce[_0x7b7e('0x17')];_0x195ae2+=0x1){_0x381ee6=_0x1eb5ce[_0x195ae2][_0x7b7e('0x4e')]({'plain':!![]});_0x49f0a4['push'](db['sequelize']['query'](_0x3b1adb(_0x381ee6,_0x7b7e('0x51')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}return _0x49f0a4;})['all']();})[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x56')][_0x7b7e('0x49')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x7b7e('0x4c')],'as':_0x7b7e('0x4d'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x34a06c){var _0x538c5f=[];if(_0x34a06c){for(var _0x315923=0x0,_0x40b4ae;_0x315923<_0x34a06c[_0x7b7e('0x17')];_0x315923+=0x1){_0x40b4ae=_0x34a06c[_0x315923][_0x7b7e('0x4e')]({'plain':!![]});switch(_0x40b4ae['dialCheckDuplicateType']){case'always':_0x538c5f[_0x7b7e('0x29')](db['sequelize'][_0x7b7e('0x50')](_0x37895a(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;case'onlyIfOpen':_0x538c5f[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x8c80d5(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));break;default:_0x538c5f[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x24481a(_0x40b4ae,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})[_0x7b7e('0x2b')](_0x2d0620()));}}}return _0x538c5f;})[_0x7b7e('0x54')]();})[_0x7b7e('0x28')](function(){return db[_0x7b7e('0x56')][_0x7b7e('0x49')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x7b7e('0x55'),'where':{'id':LISTID}}]})[_0x7b7e('0x28')](function(_0x1d9e08){var _0xa03d7a=[];if(_0x1d9e08){for(var _0x10c35e=0x0,_0x302462;_0x10c35e<_0x1d9e08[_0x7b7e('0x17')];_0x10c35e+=0x1){_0x302462=_0x1d9e08[_0x10c35e]['get']({'plain':!![]});_0xa03d7a[_0x7b7e('0x29')](db[_0x7b7e('0x53')][_0x7b7e('0x50')](_0x3b1adb(_0x302462,_0x7b7e('0x57')))[_0x7b7e('0x28')](function(){})['catch'](_0x2d0620()));}}return _0xa03d7a;})['all']();})[_0x7b7e('0x2b')](function(_0x110f2b){logger[_0x7b7e('0x11')](_0x7b7e('0x58'),_0x7b7e('0x59'),_0x110f2b[_0x7b7e('0x2d')]);});}var processPromises=function(_0x2c65b8){return BPromise[_0x7b7e('0x54')](promises)[_0x7b7e('0x28')](function(_0x850d0f){})['catch'](function(_0x27402a){logger[_0x7b7e('0x11')](_0x7b7e('0x5a'),JSON[_0x7b7e('0x2e')](_0x27402a));})[_0x7b7e('0x5b')](function(){socket[_0x7b7e('0x5c')](_0x7b7e('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x2c65b8){return _0x2c65b8['resume']();}});};var endCsv=function(){return BPromise[_0x7b7e('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})[_0x7b7e('0x28')](function(){socket[_0x7b7e('0x5c')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7b7e('0x5f')](FILEPATH);}catch(_0x38fd40){logger[_0x7b7e('0x11')](_0x7b7e('0x60'),JSON[_0x7b7e('0x2e')](_0x38fd40));}finally{process['exit'](0x0);}});};process['on'](_0x7b7e('0x61'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x7b7e('0x5e')]()[_0x7b7e('0x28')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7b7e('0x10')](',');return db[_0x7b7e('0x26')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7b7e('0x28')](function(_0x5cedd4){var _0x25233a=fs[_0x7b7e('0x62')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7b7e('0x63')](_0x25233a,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1e71ab,_0x11d615){total+=0x1;var _0x3afd15=total;promises[_0x7b7e('0x29')](checkRow(_0x1e71ab,_0x5cedd4,_0x3afd15)['then'](function(){success+=0x1;})[_0x7b7e('0x2b')](function(_0x30eeee){if(_0x30eeee['error']){errors+=0x1;delete _0x30eeee[_0x7b7e('0x11')];}else if(_0x30eeee[_0x7b7e('0x64')]){duplicates+=0x1;delete _0x30eeee[_0x7b7e('0x64')];}rows[_0x7b7e('0x29')](_0x30eeee);}));if(total%0xc8===0x0){_0x11d615[_0x7b7e('0x65')]();return processPromises(_0x11d615);}},'complete':function(){return processPromises()[_0x7b7e('0x28')](function(){logger[_0x7b7e('0x66')](_0x7b7e('0x67'));endCsv();});},'error':function(_0x41e2b5,_0x97232d){logger[_0x7b7e('0x66')](_0x7b7e('0x68'),JSON[_0x7b7e('0x2e')](_0x41e2b5));endCsv();}});})[_0x7b7e('0x2b')](function(_0x12d0cb){logger[_0x7b7e('0x11')](_0x7b7e('0x69'),JSON[_0x7b7e('0x2e')](_0x12d0cb));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 726ea28..af16a98 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 _0x4837=['select','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','fromQuery','createdAt','fields','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','insert',')\x20NOT\x20IN\x20?','min_id','error','message','exit','push','code','info','sequelize','query','spread','catch','main','stringify','send','start','binding','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','length','rows','data','hasOwnProperty','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','SystemRow','appendFileSync','errors','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns','finish','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','import','redis','defaults','localhost','format','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper','scheduledat','ContactId','ListId','updatedAt','recallme'];(function(_0x285d8c,_0x2c46a3){var _0x141935=function(_0x586ff2){while(--_0x586ff2){_0x285d8c['push'](_0x285d8c['shift']());}};_0x141935(++_0x2c46a3);}(_0x4837,0x155));var _0x7483=function(_0xe77c8,_0x59982e){_0xe77c8=_0xe77c8-0x0;var _0x501367=_0x4837[_0xe77c8];return _0x501367;};'use strict';var fs=require('fs');var path=require(_0x7483('0x0'));var _=require(_0x7483('0x1'));var Papa=require(_0x7483('0x2'));var util=require('util');var BPromise=require(_0x7483('0x3'));var moment=require('moment');var squel=require(_0x7483('0x4'));var Redis=require(_0x7483('0x5'));var db=require(_0x7483('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x7483('0x7'));config[_0x7483('0x8')]=_[_0x7483('0x9')](config['redis'],{'host':_0x7483('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7483('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x7483('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x104b46){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))*$/[_0x7483('0xc')](_0x104b46);}function selectNotIn(_0x2bc502,_0x421a89,_0x5efea2,_0x54b0ab,_0x321489){return squel['select']()[_0x7483('0xd')](_0x7483('0xe'))[_0x7483('0xf')](_0x54b0ab)[_0x7483('0x10')](_0x421a89,null,_0x421a89+_0x7483('0x11')+_0x54b0ab+'.'+_0x5efea2)[_0x7483('0x12')](_0x54b0ab+'.'+_0x5efea2+_0x7483('0x13')+_0x2bc502+'.'+_0x5efea2)[_0x7483('0x12')](_0x421a89+_0x7483('0x14')+_0x321489[_0x7483('0x10')]()+')');}function insertCmHopper(_0x5079d2,_0x2e5992,_0x3d260d,_0x31144e,_0x4fe8a2){var _0x2664b7=[_0x7483('0x15'),'cm_contacts.scheduledat',_0x7483('0x16'),'cm_contacts.ListId',_0x2e5992+'.'+_0x31144e,_0x7483('0x17'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x4fe8a2+'\x22'];return squel['insert']()[_0x7483('0x18')](_0x7483('0x19'))['fromQuery'](['phone',_0x7483('0x1a'),_0x7483('0x1b'),_0x7483('0x1c'),_0x31144e,'createdAt',_0x7483('0x1d'),'priority','UserId',_0x7483('0x1e')],squel[_0x7483('0x1f')]()['fields'](_0x2664b7)[_0x7483('0xf')](_0x2e5992)[_0x7483('0x10')](_0x7483('0x20'),null,_0x7483('0x21')+_0x2e5992+_0x7483('0x22'))['join'](_0x3d260d,null,_0x3d260d+_0x7483('0x11')+_0x2e5992+'.'+_0x31144e)[_0x7483('0x12')](_0x2e5992+_0x7483('0x23'),_0x5079d2)['where'](_0x7483('0x24'),NOW)[_0x7483('0x12')](_0x7483('0x25'),selectNotIn(_0x2e5992,_0x3d260d,_0x31144e,_0x7483('0x19'),[_0x7483('0x26'),_0x7483('0x27')]))[_0x7483('0x12')](_0x7483('0x25'),selectNotIn(_0x2e5992,_0x3d260d,_0x31144e,_0x7483('0x19'),[_0x7483('0x26')])))[_0x7483('0x28')]();}function insertCmHopperBlack(_0x14a9a8,_0x28ae24,_0x31460d,_0x4e5c1){var _0x5e6307=[_0x7483('0x15'),_0x7483('0x16'),_0x7483('0x29'),_0x28ae24+'.'+_0x4e5c1,_0x7483('0x17'),_0x7483('0x2a')];return squel['insert']()[_0x7483('0x18')](_0x7483('0x2b'))[_0x7483('0x2c')]([_0x7483('0xe'),_0x7483('0x1b'),_0x7483('0x1c'),_0x4e5c1,_0x7483('0x2d'),_0x7483('0x1d')],squel['select']()[_0x7483('0x2e')](_0x5e6307)['from'](_0x28ae24)['join'](_0x7483('0x20'),null,_0x7483('0x21')+_0x28ae24+_0x7483('0x22'))['join'](_0x31460d,null,_0x31460d+'.id\x20=\x20'+_0x28ae24+'.'+_0x4e5c1)[_0x7483('0x12')](_0x28ae24+_0x7483('0x23'),_0x14a9a8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x7483('0x12')](_0x7483('0x25'),squel[_0x7483('0x1f')]()[_0x7483('0xd')](_0x7483('0xe'))[_0x7483('0xf')](_0x7483('0x2b'))[_0x7483('0x12')](_0x7483('0x2f'),_0x14a9a8)['where'](_0x4e5c1+_0x7483('0x30'),_0x28ae24+'.'+_0x4e5c1)))[_0x7483('0x28')]();}function insertCmContact(_0x1b6813,_0x2b9930,_0x28d132,_0x3ae7b2){var _0x30050e=_[_0x7483('0x31')](_[_0x7483('0x32')](_0x3ae7b2),[_0x7483('0x1c'),_0x7483('0x33'),_0x7483('0x2d'),_0x7483('0x1d')]);return squel[_0x7483('0x34')]()[_0x7483('0x18')](_0x7483('0x20'))[_0x7483('0x2c')](_0x30050e,squel[_0x7483('0x1f')]()['fields'](_0x30050e)[_0x7483('0xf')](_0x2b9930)[_0x7483('0x12')]('('+_0x28d132['join'](',')+_0x7483('0x35'),squel[_0x7483('0x1f')]()[_0x7483('0x2e')](_0x28d132)[_0x7483('0xf')](_0x7483('0x20'))[_0x7483('0x12')](_0x7483('0x2f'),_0x1b6813))[_0x7483('0x12')]('id\x20IN\x20?',squel[_0x7483('0x1f')]()[_0x7483('0xd')]('MIN(id)',_0x7483('0x36'))['from'](_0x2b9930)['group'](_0x28d132['join'](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2097f5){logger[_0x7483('0x37')](_0x2097f5[_0x7483('0x38')]);process[_0x7483('0x39')](0x1);}function handleError(_0x1fcd03,_0x4129dc){stats['errors'][_0x7483('0x3a')]({'name':_0x4129dc[_0x7483('0x3b')],'message':_0x4129dc[_0x7483('0x38')],'row':_0x1fcd03});}function handleQuery(_0x72dccf){logger[_0x7483('0x3c')](_0x72dccf);return db[_0x7483('0x3d')][_0x7483('0x3e')](_0x72dccf)[_0x7483('0x3f')](function(_0x31065b){results[_0x7483('0x3a')](_0x31065b);})[_0x7483('0x40')](function(_0x300a0c){logger['error'](_0x300a0c[_0x7483('0x38')]);});}function main(_0x26bbeb,_0x9afa40,_0x40243b,_0x355c60){logger['info'](_0x7483('0x41'),_0x26bbeb,JSON[_0x7483('0x42')](_0x9afa40));process[_0x7483('0x43')](_0x7483('0x44'));var _0x14224f=_0x9afa40[_0x7483('0x45')];var _0x222e70=_0x9afa40['socket_timestamp'];var _0x21ff64=path[_0x7483('0x10')](config[_0x7483('0x46')],_0x7483('0x47'),_0x222e70+_0x7483('0x48'));var _0x1bfbf0=_[_0x7483('0x32')](_0x14224f)[_0x7483('0x10')]();logger['info']('header',_0x1bfbf0);fs[_0x7483('0x49')](_0x21ff64,_0x1bfbf0+'\x0a');Papa[_0x7483('0x4a')](fs[_0x7483('0x4b')](_0x26bbeb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x49b8a7,_0x53c150){try{for(var _0x7da62f=0x0,_0x4a0a0e=[];_0x7da62f<_0x49b8a7['data'][_0x7483('0x4c')];_0x7da62f++){stats[_0x7483('0x4d')]+=0x1;if(_0x49b8a7['errors'][_0x7da62f]){handleError(_0x49b8a7[_0x7483('0x4e')][_0x7da62f],_0x49b8a7['errors'][_0x7da62f]);}else{var _0x113b5e=[];for(var _0xca95f8 in _0x14224f){if(_0x14224f[_0x7483('0x4f')](_0xca95f8)){if(_0x49b8a7[_0x7483('0x4e')][_0x7da62f][_0x14224f[_0xca95f8]]){var _0x47eb7f=_['trim'](_0x49b8a7[_0x7483('0x4e')][_0x7da62f][_0x14224f[_0xca95f8]][_0x7483('0x50')](/"/g,'\x27'));switch(_0xca95f8){case _0x7483('0x1a'):var _0x43a941=moment(_0x47eb7f,_0x7483('0x51'),!![]);if(_0x43a941[_0x7483('0x52')]()){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}else{_0x113b5e[_0x7483('0x3a')](_0x7483('0x53'));}break;case _0x7483('0x54'):var _0x2321d1=parseInt(_0x47eb7f);_0x47eb7f=_[_0x7483('0x55')](_0x2321d1)||_0x2321d1<0x0||_0x2321d1>0x4?_0x355c60?0x3:0x2:_0x2321d1;_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');break;case'UserId':var _0x2f6a9c=parseInt(_0x47eb7f);if(_[_0x7483('0x56')](_0x2f6a9c)&&_['includes'](_0x40243b,_0x2f6a9c)){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x2f6a9c+'\x22');}else{_0x113b5e[_0x7483('0x3a')](_0x7483('0x57'));}break;case _0x7483('0x58'):if(isEmail(_0x47eb7f)){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}else{_0x113b5e[_0x7483('0x3a')]('email\x20wrong\x20format');}break;case _0x7483('0x59'):var _0x5adfa7=moment(_0x47eb7f,_0x7483('0x5a'),!![]);if(_0x5adfa7[_0x7483('0x52')]()){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}else{_0x113b5e[_0x7483('0x3a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}}else{switch(_0xca95f8){case'firstName':case _0x7483('0xe'):_0x113b5e[_0x7483('0x3a')](_0xca95f8+_0x7483('0x5b'));break;default:_0x4a0a0e[_0x7483('0x3a')]('\x22\x22');}}}}if(_0x113b5e[_0x7483('0x4c')]){handleError(_0x49b8a7['data'][_0x7da62f],{'code':_0x7483('0x5c'),'message':_0x113b5e[_0x7483('0x10')]()});}else{fs[_0x7483('0x5d')](_0x21ff64,_0x4a0a0e['join']()+'\x0a');}_0x4a0a0e=[];}if(!(stats[_0x7483('0x4d')]%0xc8)){socket['emit']('contact:import:'+_0x222e70,stats);stats[_0x7483('0x5e')]=[];}}if(stopped){logger[_0x7483('0x3c')]('Abort\x20parser');_0x53c150[_0x7483('0x5f')]();}}catch(_0x3cae2a){handleError(_0x49b8a7[_0x7483('0x4e')][_0x7da62f],{'code':'SystemError','message':_0x3cae2a[_0x7483('0x38')]});logger[_0x7483('0x37')](_0x7483('0x60'),_0x3cae2a[_0x7483('0x38')]);}},'complete':function(){try{var _0x54216c=[];var _0x51de72=_0x7483('0x20');if(_0x9afa40[_0x7483('0x61')]&&_0x9afa40[_0x7483('0x61')][_0x7483('0x4c')]){_0x51de72=_0x7483('0x62')+_0x222e70;_0x54216c[_0x7483('0x3a')](_0x7483('0x63')+_0x51de72+_0x7483('0x64'));}var _0xcd17ee=util[_0x7483('0xb')](_0x7483('0x65'),_0x21ff64,_0x51de72,_0x1bfbf0,_0x9afa40[_0x7483('0x1c')],_0x9afa40[_0x7483('0x33')]||null,NOW,NOW);if(_['isNil'](_0x14224f['scheduledat'])){_0xcd17ee+=_0x7483('0x66');}_0x54216c[_0x7483('0x3a')](_0xcd17ee);if(_0x9afa40[_0x7483('0x61')]&&_0x9afa40['duplicates']['length']){_0x54216c[_0x7483('0x3a')](insertCmContact(_0x9afa40['ListId'],_0x51de72,_0x9afa40[_0x7483('0x61')],_0x14224f));_0x54216c[_0x7483('0x3a')](_0x7483('0x67')+_0x51de72+';');}_0x54216c[_0x7483('0x3a')](insertCmHopper(_0x9afa40['ListId'],_0x7483('0x68'),'voice_queues',_0x7483('0x69'),_0x355c60));_0x54216c[_0x7483('0x3a')](insertCmHopperBlack(_0x9afa40[_0x7483('0x1c')],'voice_queues_has_cm_blacklists','voice_queues',_0x7483('0x69')));_0x54216c[_0x7483('0x3a')](insertCmHopper(_0x9afa40[_0x7483('0x1c')],_0x7483('0x6a'),'campaigns',_0x7483('0x6b'),_0x355c60));_0x54216c[_0x7483('0x3a')](insertCmHopperBlack(_0x9afa40[_0x7483('0x1c')],'campaigns_has_cm_blacklists',_0x7483('0x6c'),_0x7483('0x6b')));BPromise['each'](_0x54216c,handleQuery)['then'](function(_0x4269ce){stats[_0x7483('0x6d')]=!![];stats[_0x7483('0x6e')]=_0x9afa40['duplicates']&&_0x9afa40[_0x7483('0x61')][_0x7483('0x4c')]?results[0x2][_0x7483('0x6e')]:results[0x0][_0x7483('0x6e')];socket[_0x7483('0x6f')](_0x7483('0x70')+_0x222e70,stats);fs[_0x7483('0x71')](_0x26bbeb);fs[_0x7483('0x71')](_0x21ff64);process['exit'](0x0);})['catch'](function(_0x297149){logger[_0x7483('0x37')](_0x297149['message']);process['exit'](0x1);});}catch(_0xb7338){logger[_0x7483('0x37')](_0x7483('0x72'),_0xb7338[_0x7483('0x38')]);process[_0x7483('0x39')](0x1);}},'error':function(_0x127b8b,_0x4deb46,_0x4a828b,_0x175019){throw new Error(_0x175019);}});}function validate(){if(process[_0x7483('0x73')]&&process[_0x7483('0x73')]['length']<0x4){throw new Error(_0x7483('0x74'));}var _0x5d9a10=path[_0x7483('0x10')](config[_0x7483('0x46')],_0x7483('0x47'),process[_0x7483('0x73')][0x2]);if(!fs['existsSync'](_0x5d9a10)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x5af5fa={};try{_0x5af5fa=JSON[_0x7483('0x4a')](process[_0x7483('0x73')][0x3]);if(!_0x5af5fa['binding']){throw new Error(_0x7483('0x75'));}if(!_0x5af5fa['binding'][_0x7483('0xe')]){throw new Error(_0x7483('0x76'));}if(!_0x5af5fa[_0x7483('0x45')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x361827=0x0;if(_0x5af5fa[_0x7483('0x45')][_0x7483('0x77')]){_0x361827=0x1;}if(!_0x5af5fa[_0x7483('0x1c')]){throw new Error(_0x7483('0x78'));}}catch(_0x36b03b){throw new Error('body\x20id\x20mandatory');}var _0x2179bd=[];try{_0x2179bd=_[_0x7483('0x79')](JSON[_0x7483('0x4a')](process[_0x7483('0x73')][0x4]),'id');}catch(_0x6dfb8){logger[_0x7483('0x3c')](_0x7483('0x7a'));}main(_0x5d9a10,_0x5af5fa,_0x2179bd,_0x361827);}validate();process['on'](_0x7483('0x7b'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0x74cc=['finish','affectedRows','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','util','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','redis','localhost','socket.io-emitter','format','test','from','join','.id\x20=\x20','where','\x20=\x20','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_hopper_black','createdAt','updatedAt','select','field','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','insert',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','info','Received\x20SIGINT','error','message','exit','errors','code','spread','push','catch','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','header','writeFileSync','parse','rows','data','hasOwnProperty','trim','replace','YYYY-MM-DD\x20HH:mm:ss','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','length','SystemRow','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','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','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','CampaignId','each'];(function(_0x726077,_0x3e2a53){var _0x2a65cc=function(_0x31b9b3){while(--_0x31b9b3){_0x726077['push'](_0x726077['shift']());}};_0x2a65cc(++_0x3e2a53);}(_0x74cc,0x121));var _0xc74c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x74cc[_0x502c7d];return _0x30b7ed;};'use strict';var fs=require('fs');var path=require(_0xc74c('0x0'));var _=require(_0xc74c('0x1'));var Papa=require(_0xc74c('0x2'));var util=require(_0xc74c('0x3'));var BPromise=require(_0xc74c('0x4'));var moment=require(_0xc74c('0x5'));var squel=require(_0xc74c('0x6'));var Redis=require('ioredis');var db=require(_0xc74c('0x7'))['db'];var config=require(_0xc74c('0x8'));var logger=require(_0xc74c('0x9'))(_0xc74c('0xa'));config['redis']=_[_0xc74c('0xb')](config[_0xc74c('0xc')],{'host':_0xc74c('0xd'),'port':0x18eb});var socket=require(_0xc74c('0xe'))(new Redis(config[_0xc74c('0xc')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xc74c('0xf')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x478e4b){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))*$/[_0xc74c('0x10')](_0x478e4b);}function selectNotIn(_0x354d51,_0x1b4143,_0x15e963,_0x512a8f,_0x20d78a){return squel['select']()['field']('phone')[_0xc74c('0x11')](_0x512a8f)[_0xc74c('0x12')](_0x1b4143,null,_0x1b4143+_0xc74c('0x13')+_0x512a8f+'.'+_0x15e963)[_0xc74c('0x14')](_0x512a8f+'.'+_0x15e963+_0xc74c('0x15')+_0x354d51+'.'+_0x15e963)[_0xc74c('0x14')](_0x1b4143+'.dialCheckDuplicateType\x20IN\x20('+_0x20d78a[_0xc74c('0x12')]()+')');}function insertCmHopper(_0x9a7416,_0x322620,_0x2901da,_0x5c0d15,_0x1cabbe){var _0x4c3ff3=[_0xc74c('0x16'),_0xc74c('0x17'),_0xc74c('0x18'),'cm_contacts.ListId',_0x322620+'.'+_0x5c0d15,_0xc74c('0x19'),_0xc74c('0x1a'),'cm_contacts.priority',_0xc74c('0x1b'),'\x22'+_0x1cabbe+'\x22'];return squel['insert']()[_0xc74c('0x1c')](_0xc74c('0x1d'))[_0xc74c('0x1e')]([_0xc74c('0x1f'),_0xc74c('0x20'),_0xc74c('0x21'),_0xc74c('0x22'),_0x5c0d15,'createdAt','updatedAt',_0xc74c('0x23'),_0xc74c('0x24'),_0xc74c('0x25')],squel['select']()[_0xc74c('0x26')](_0x4c3ff3)['from'](_0x322620)['join'](_0xc74c('0x27'),null,_0xc74c('0x28')+_0x322620+_0xc74c('0x29'))[_0xc74c('0x12')](_0x2901da,null,_0x2901da+'.id\x20=\x20'+_0x322620+'.'+_0x5c0d15)[_0xc74c('0x14')](_0x322620+_0xc74c('0x2a'),_0x9a7416)['where'](_0xc74c('0x2b'),NOW)['where'](_0xc74c('0x2c'),selectNotIn(_0x322620,_0x2901da,_0x5c0d15,_0xc74c('0x1d'),[_0xc74c('0x2d'),_0xc74c('0x2e')]))[_0xc74c('0x14')](_0xc74c('0x2c'),selectNotIn(_0x322620,_0x2901da,_0x5c0d15,_0xc74c('0x1d'),['\x22always\x22'])))[_0xc74c('0x2f')]();}function insertCmHopperBlack(_0xc72271,_0x5f5bdc,_0x22bb0e,_0x558d3e){var _0xb5ca1f=[_0xc74c('0x16'),_0xc74c('0x18'),_0xc74c('0x30'),_0x5f5bdc+'.'+_0x558d3e,_0xc74c('0x19'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0xc74c('0x31'))[_0xc74c('0x1e')]([_0xc74c('0x1f'),_0xc74c('0x21'),_0xc74c('0x22'),_0x558d3e,_0xc74c('0x32'),_0xc74c('0x33')],squel[_0xc74c('0x34')]()[_0xc74c('0x26')](_0xb5ca1f)['from'](_0x5f5bdc)[_0xc74c('0x12')]('cm_contacts',null,_0xc74c('0x28')+_0x5f5bdc+'.CmListId')[_0xc74c('0x12')](_0x22bb0e,null,_0x22bb0e+_0xc74c('0x13')+_0x5f5bdc+'.'+_0x558d3e)[_0xc74c('0x14')](_0x5f5bdc+_0xc74c('0x2a'),_0xc72271)[_0xc74c('0x14')](_0xc74c('0x2b'),NOW)[_0xc74c('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xc74c('0x34')]()[_0xc74c('0x35')]('phone')[_0xc74c('0x11')](_0xc74c('0x31'))['where'](_0xc74c('0x36'),_0xc72271)['where'](_0x558d3e+_0xc74c('0x37'),_0x5f5bdc+'.'+_0x558d3e)))['toString']();}function insertCmContact(_0x5df2bf,_0xc200fb,_0x2ad18a,_0x5a5860){var _0x525b05=_[_0xc74c('0x38')](_[_0xc74c('0x39')](_0x5a5860),[_0xc74c('0x22'),_0xc74c('0x3a'),_0xc74c('0x32'),_0xc74c('0x33')]);return squel[_0xc74c('0x3b')]()[_0xc74c('0x1c')]('cm_contacts')['fromQuery'](_0x525b05,squel[_0xc74c('0x34')]()[_0xc74c('0x26')](_0x525b05)[_0xc74c('0x11')](_0xc200fb)[_0xc74c('0x14')]('('+_0x2ad18a[_0xc74c('0x12')](',')+_0xc74c('0x3c'),squel[_0xc74c('0x34')]()[_0xc74c('0x26')](_0x2ad18a)[_0xc74c('0x11')](_0xc74c('0x27'))[_0xc74c('0x14')](_0xc74c('0x36'),_0x5df2bf))[_0xc74c('0x14')](_0xc74c('0x3d'),squel['select']()[_0xc74c('0x35')]('MIN(id)',_0xc74c('0x3e'))[_0xc74c('0x11')](_0xc200fb)['group'](_0x2ad18a['join'](','))))[_0xc74c('0x2f')]();}function handleStop(){logger[_0xc74c('0x3f')](_0xc74c('0x40'));stopped=!![];}function handleUncaughtException(_0x182bc4){logger[_0xc74c('0x41')](_0x182bc4[_0xc74c('0x42')]);process[_0xc74c('0x43')](0x1);}function handleError(_0x21f46b,_0x1401de){stats[_0xc74c('0x44')]['push']({'name':_0x1401de[_0xc74c('0x45')],'message':_0x1401de[_0xc74c('0x42')],'row':_0x21f46b});}function handleQuery(_0x172365){logger['info'](_0x172365);return db['sequelize']['query'](_0x172365)[_0xc74c('0x46')](function(_0x533d9d){results[_0xc74c('0x47')](_0x533d9d);})[_0xc74c('0x48')](function(_0x2d1e9a){logger['error'](_0x2d1e9a[_0xc74c('0x42')]);});}function main(_0x275e58,_0x5a7e92,_0x9221d6,_0x26e277){logger[_0xc74c('0x3f')](_0xc74c('0x49'),_0x275e58,JSON[_0xc74c('0x4a')](_0x5a7e92));process[_0xc74c('0x4b')](_0xc74c('0x4c'));var _0x79b328=_0x5a7e92[_0xc74c('0x4d')];var _0x7ace=_0x5a7e92[_0xc74c('0x4e')];var _0x58149a=path[_0xc74c('0x12')](config[_0xc74c('0x4f')],_0xc74c('0x50'),_0x7ace+'.csv');var _0x3eac93=_[_0xc74c('0x39')](_0x79b328)['join']();logger[_0xc74c('0x3f')](_0xc74c('0x51'),_0x3eac93);fs[_0xc74c('0x52')](_0x58149a,_0x3eac93+'\x0a');Papa[_0xc74c('0x53')](fs['createReadStream'](_0x275e58),{'header':!![],'skipEmptyLines':!![],'step':function(_0x364fb1,_0x49e32f){try{for(var _0x417d6f=0x0,_0x54e9ae=[];_0x417d6f<_0x364fb1['data']['length'];_0x417d6f++){stats[_0xc74c('0x54')]+=0x1;if(_0x364fb1[_0xc74c('0x44')][_0x417d6f]){handleError(_0x364fb1[_0xc74c('0x55')][_0x417d6f],_0x364fb1[_0xc74c('0x44')][_0x417d6f]);}else{var _0x42530b=[];for(var _0x393c71 in _0x79b328){if(_0x79b328[_0xc74c('0x56')](_0x393c71)){if(_0x364fb1[_0xc74c('0x55')][_0x417d6f][_0x79b328[_0x393c71]]){var _0x33a157=_[_0xc74c('0x57')](_0x364fb1[_0xc74c('0x55')][_0x417d6f][_0x79b328[_0x393c71]][_0xc74c('0x58')](/"/g,'\x27'));switch(_0x393c71){case _0xc74c('0x20'):var _0x41282a=moment(_0x33a157,_0xc74c('0x59'),!![]);if(_0x41282a['isValid']()){_0x54e9ae[_0xc74c('0x47')]('\x22'+_0x33a157+'\x22');}else{_0x42530b[_0xc74c('0x47')](_0xc74c('0x5a'));}break;case _0xc74c('0x23'):var _0x3136e9=parseInt(_0x33a157);_0x33a157=_[_0xc74c('0x5b')](_0x3136e9)||_0x3136e9<0x0||_0x3136e9>0x4?_0x26e277?0x3:0x2:_0x3136e9;_0x54e9ae[_0xc74c('0x47')]('\x22'+_0x33a157+'\x22');break;case _0xc74c('0x24'):var _0x42c476=parseInt(_0x33a157);if(_[_0xc74c('0x5c')](_0x42c476)&&_[_0xc74c('0x5d')](_0x9221d6,_0x42c476)){_0x54e9ae[_0xc74c('0x47')]('\x22'+_0x42c476+'\x22');}else{_0x42530b[_0xc74c('0x47')](_0xc74c('0x5e'));}break;case _0xc74c('0x5f'):if(isEmail(_0x33a157)){_0x54e9ae[_0xc74c('0x47')]('\x22'+_0x33a157+'\x22');}else{_0x42530b[_0xc74c('0x47')](_0xc74c('0x60'));}break;case _0xc74c('0x61'):var _0x2b2bd5=moment(_0x33a157,_0xc74c('0x62'),!![]);if(_0x2b2bd5[_0xc74c('0x63')]()){_0x54e9ae[_0xc74c('0x47')]('\x22'+_0x33a157+'\x22');}else{_0x42530b[_0xc74c('0x47')](_0xc74c('0x64'));}break;default:_0x54e9ae[_0xc74c('0x47')]('\x22'+_0x33a157+'\x22');}}else{switch(_0x393c71){case _0xc74c('0x65'):case _0xc74c('0x1f'):_0x42530b['push'](_0x393c71+_0xc74c('0x66'));break;default:_0x54e9ae[_0xc74c('0x47')]('\x22\x22');}}}}if(_0x42530b[_0xc74c('0x67')]){handleError(_0x364fb1[_0xc74c('0x55')][_0x417d6f],{'code':_0xc74c('0x68'),'message':_0x42530b[_0xc74c('0x12')]()});}else{fs['appendFileSync'](_0x58149a,_0x54e9ae[_0xc74c('0x12')]()+'\x0a');}_0x54e9ae=[];}if(!(stats[_0xc74c('0x54')]%0xc8)){socket[_0xc74c('0x69')](_0xc74c('0x6a')+_0x7ace,stats);stats[_0xc74c('0x44')]=[];}}if(stopped){logger[_0xc74c('0x3f')](_0xc74c('0x6b'));_0x49e32f['abort']();}}catch(_0x47e9ae){handleError(_0x364fb1['data'][_0x417d6f],{'code':_0xc74c('0x6c'),'message':_0x47e9ae['message']});logger[_0xc74c('0x41')](_0xc74c('0x6d'),_0x47e9ae[_0xc74c('0x42')]);}},'complete':function(){try{var _0x210685=[];var _0x227e0c='cm_contacts';if(_0x5a7e92['duplicates']&&_0x5a7e92[_0xc74c('0x6e')][_0xc74c('0x67')]){_0x227e0c='cm_contacts_'+_0x7ace;_0x210685['push'](_0xc74c('0x6f')+_0x227e0c+_0xc74c('0x70'));}var _0x3e5459=util[_0xc74c('0xf')](_0xc74c('0x71'),_0x58149a,_0x227e0c,_0x3eac93,_0x5a7e92[_0xc74c('0x22')],_0x5a7e92[_0xc74c('0x3a')]||null,NOW,NOW);if(_[_0xc74c('0x72')](_0x79b328['scheduledat'])){_0x3e5459+=_0xc74c('0x73');}_0x210685[_0xc74c('0x47')](_0x3e5459);if(_0x5a7e92['duplicates']&&_0x5a7e92['duplicates'][_0xc74c('0x67')]){_0x210685[_0xc74c('0x47')](insertCmContact(_0x5a7e92[_0xc74c('0x22')],_0x227e0c,_0x5a7e92[_0xc74c('0x6e')],_0x79b328));_0x210685[_0xc74c('0x47')](_0xc74c('0x74')+_0x227e0c+';');}_0x210685[_0xc74c('0x47')](insertCmHopper(_0x5a7e92['ListId'],_0xc74c('0x75'),_0xc74c('0x76'),_0xc74c('0x77'),_0x26e277));_0x210685[_0xc74c('0x47')](insertCmHopperBlack(_0x5a7e92[_0xc74c('0x22')],_0xc74c('0x78'),'voice_queues',_0xc74c('0x77')));_0x210685[_0xc74c('0x47')](insertCmHopper(_0x5a7e92[_0xc74c('0x22')],'campaigns_has_cm_lists',_0xc74c('0x79'),'CampaignId',_0x26e277));_0x210685[_0xc74c('0x47')](insertCmHopperBlack(_0x5a7e92['ListId'],_0xc74c('0x7a'),_0xc74c('0x79'),_0xc74c('0x7b')));BPromise[_0xc74c('0x7c')](_0x210685,handleQuery)['then'](function(_0x216447){stats[_0xc74c('0x7d')]=!![];stats['affectedRows']=_0x5a7e92[_0xc74c('0x6e')]&&_0x5a7e92[_0xc74c('0x6e')][_0xc74c('0x67')]?results[0x2][_0xc74c('0x7e')]:results[0x0][_0xc74c('0x7e')];socket[_0xc74c('0x69')](_0xc74c('0x6a')+_0x7ace,stats);fs[_0xc74c('0x7f')](_0x275e58);fs['unlink'](_0x58149a);process[_0xc74c('0x43')](0x0);})[_0xc74c('0x48')](function(_0x24fe88){logger[_0xc74c('0x41')](_0x24fe88[_0xc74c('0x42')]);process[_0xc74c('0x43')](0x1);});}catch(_0x8df3f3){logger[_0xc74c('0x41')]('complete',_0x8df3f3[_0xc74c('0x42')]);process[_0xc74c('0x43')](0x1);}},'error':function(_0x1f98cb,_0x4304a0,_0x512c09,_0x2d9be3){throw new Error(_0x2d9be3);}});}function validate(){if(process[_0xc74c('0x80')]&&process[_0xc74c('0x80')]['length']<0x4){throw new Error(_0xc74c('0x81'));}var _0x2cc033=path[_0xc74c('0x12')](config['root'],_0xc74c('0x50'),process[_0xc74c('0x80')][0x2]);if(!fs['existsSync'](_0x2cc033)){throw new Error(_0xc74c('0x82'));}var _0x29ce2f={};try{_0x29ce2f=JSON['parse'](process[_0xc74c('0x80')][0x3]);if(!_0x29ce2f['binding']){throw new Error(_0xc74c('0x83'));}if(!_0x29ce2f[_0xc74c('0x4d')][_0xc74c('0x1f')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x29ce2f[_0xc74c('0x4d')][_0xc74c('0x65')]){throw new Error('firstName\x20is\x20mandatory');}var _0x224221=0x0;if(_0x29ce2f[_0xc74c('0x4d')][_0xc74c('0x24')]){_0x224221=0x1;}if(!_0x29ce2f[_0xc74c('0x22')]){throw new Error(_0xc74c('0x84'));}}catch(_0x408633){throw new Error(_0xc74c('0x85'));}var _0x51e509=[];try{_0x51e509=_[_0xc74c('0x86')](JSON[_0xc74c('0x53')](process[_0xc74c('0x80')][0x4]),'id');}catch(_0x479630){logger[_0xc74c('0x3f')](_0xc74c('0x87'));}main(_0x2cc033,_0x29ce2f,_0x51e509,_0x224221);}validate();process['on'](_0xc74c('0x88'),handleStop);process['on'](_0xc74c('0x89'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index fabb911..1a0d60e 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 _0x1c9a=['holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time'];(function(_0x3a0633,_0x120c59){var _0x58341e=function(_0x1ecb29){while(--_0x1ecb29){_0x3a0633['push'](_0x3a0633['shift']());}};_0x58341e(++_0x120c59);}(_0x1c9a,0x98));var _0xa1c9=function(_0x4c1368,_0x354217){_0x4c1368=_0x4c1368-0x0;var _0x77865f=_0x1c9a[_0x4c1368];return _0x77865f;};'use strict';exports[_0xa1c9('0x0')]=function(_0x4ce538,_0x470dcd){var _0x5c45c5=[{'type':_0xa1c9('0x1'),'content':_0xa1c9('0x2'),'variableName':null}];switch(_0x4ce538[_0xa1c9('0x3')]()){case'voice':switch(_0x470dcd[_0xa1c9('0x3')]()){case _0xa1c9('0x4'):_0x5c45c5[_0xa1c9('0x5')]({'type':_0xa1c9('0x6'),'content':'','variableName':'queue'});_0x5c45c5[_0xa1c9('0x5')]({'type':'variable','content':'','variableName':_0xa1c9('0x7')});break;case _0xa1c9('0x8'):_0x5c45c5[_0xa1c9('0x5')]({'type':'string','content':_0xa1c9('0x9'),'variableName':null});_0x5c45c5[_0xa1c9('0x5')]({'type':_0xa1c9('0x6'),'content':'','variableName':_0xa1c9('0xa')});break;}}return _0x5c45c5;};exports['getDescriptions']=function(_0x27b020,_0x4437f2){var _0x29e24a=[];switch(_0x27b020[_0xa1c9('0x3')]()){case _0xa1c9('0xb'):switch(_0x4437f2[_0xa1c9('0x3')]()){case _0xa1c9('0x4'):_0x29e24a=[{'type':_0xa1c9('0x1'),'content':_0xa1c9('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':'Caller\x20Number','keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x7')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0xe'),'keyType':_0xa1c9('0x6'),'variableName':'calleridname'},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0xf'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x10')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x11'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x12')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x13'),'keyType':'variable','variableName':_0xa1c9('0x14')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x15'),'keyType':'variable','variableName':_0xa1c9('0x16')},{'type':'string','content':_0xa1c9('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x18'),'keyType':'variable','variableName':_0xa1c9('0x19')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x1a'),'keyType':'variable','variableName':_0xa1c9('0xa')},{'type':_0xa1c9('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x1b'),'keyType':_0xa1c9('0x6'),'variableName':'agentcalledAt'},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x1c'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x1d')},{'type':_0xa1c9('0xd'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0xa1c9('0x1e')},{'type':'keyValue','content':'','key':_0xa1c9('0x1f'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x20')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x21'),'keyType':'variable','variableName':_0xa1c9('0x22')}];break;case _0xa1c9('0x8'):_0x29e24a=[{'type':_0xa1c9('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x23'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x24'),'keyType':'variable','keyContent':'','variableName':_0xa1c9('0x25')},{'type':'keyValue','content':'','key':_0xa1c9('0x13'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x14')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x15'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x26')},{'type':_0xa1c9('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0xa1c9('0x27'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x28')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x29'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0xa1c9('0x2a'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x2b')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x2c'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x2d')}];break;}}return _0x29e24a;}; \ No newline at end of file +var _0x4bde=['Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','Talk\x20Time','talktime','Member\x20Name','membername','Date','starttime','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','endtime','Duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','outbound','Outbound\x20Call','***\x20Call\x20Info\x20***','Caller\x20Number','calleridnum','Caller\x20Name','calleridname','keyValue','Call\x20To','destexten','Queue','UniqueId','uniqueid','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','destcalleridnum'];(function(_0x179c4a,_0x10eb06){var _0x5d1879=function(_0x1f1dcd){while(--_0x1f1dcd){_0x179c4a['push'](_0x179c4a['shift']());}};_0x5d1879(++_0x10eb06);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x5b6a8e,_0x3bb4f4){_0x5b6a8e=_0x5b6a8e-0x0;var _0x243f07=_0x4bde[_0x5b6a8e];return _0x243f07;};'use strict';exports[_0xe4bd('0x0')]=function(_0x14c90d,_0x611407){var _0x51c1d8=[{'type':_0xe4bd('0x1'),'content':_0xe4bd('0x2'),'variableName':null}];switch(_0x14c90d[_0xe4bd('0x3')]()){case _0xe4bd('0x4'):switch(_0x611407['toLowerCase']()){case _0xe4bd('0x5'):_0x51c1d8[_0xe4bd('0x6')]({'type':_0xe4bd('0x7'),'content':'','variableName':_0xe4bd('0x8')});_0x51c1d8[_0xe4bd('0x6')]({'type':_0xe4bd('0x7'),'content':'','variableName':'calleridnum'});break;case _0xe4bd('0x9'):_0x51c1d8[_0xe4bd('0x6')]({'type':_0xe4bd('0x1'),'content':_0xe4bd('0xa'),'variableName':null});_0x51c1d8[_0xe4bd('0x6')]({'type':_0xe4bd('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x51c1d8;};exports['getDescriptions']=function(_0x5a32c3,_0x3834ea){var _0x308e01=[];switch(_0x5a32c3[_0xe4bd('0x3')]()){case'voice':switch(_0x3834ea[_0xe4bd('0x3')]()){case _0xe4bd('0x5'):_0x308e01=[{'type':_0xe4bd('0x1'),'content':_0xe4bd('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xe4bd('0xc'),'keyType':'variable','variableName':_0xe4bd('0xd')},{'type':'keyValue','content':'','key':_0xe4bd('0xe'),'keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0xf')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x11'),'keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x12')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x13'),'keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x8')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x14'),'keyType':'variable','variableName':_0xe4bd('0x15')},{'type':_0xe4bd('0x10'),'content':'','key':'Date','keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x16')},{'type':'string','content':_0xe4bd('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x18')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x19'),'keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x1a')},{'type':_0xe4bd('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x1b'),'keyType':'variable','variableName':_0xe4bd('0x16')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x1c'),'keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x1d')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x1e'),'keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x1f')},{'type':'keyValue','content':'','key':_0xe4bd('0x20'),'keyType':_0xe4bd('0x7'),'variableName':'holdtime'},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x21'),'keyType':_0xe4bd('0x7'),'variableName':_0xe4bd('0x22')}];break;case _0xe4bd('0x9'):_0x308e01=[{'type':_0xe4bd('0x1'),'content':_0xe4bd('0xb'),'variableName':null},{'type':_0xe4bd('0x10'),'content':'','key':'Called\x20Number','keyType':_0xe4bd('0x7'),'keyContent':'','variableName':_0xe4bd('0x1a')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x23'),'keyType':_0xe4bd('0x7'),'keyContent':'','variableName':_0xe4bd('0x24')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x14'),'keyType':'variable','keyContent':'','variableName':_0xe4bd('0x15')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x25'),'keyType':_0xe4bd('0x7'),'keyContent':'','variableName':_0xe4bd('0x26')},{'type':_0xe4bd('0x1'),'content':_0xe4bd('0x27')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x28'),'keyType':_0xe4bd('0x7'),'keyContent':'','variableName':_0xe4bd('0x29')},{'type':_0xe4bd('0x10'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xe4bd('0x2a')},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x2b'),'keyType':_0xe4bd('0x7'),'keyContent':'','variableName':'duration'},{'type':_0xe4bd('0x10'),'content':'','key':_0xe4bd('0x2c'),'keyType':_0xe4bd('0x7'),'keyContent':'','variableName':_0xe4bd('0x2d')}];break;}}return _0x308e01;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 12de4b1..477e5d5 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 _0xa0e1=['clone','body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','name','role','stringify','null','Interaction','findOne','then','update','info'];(function(_0x1e1c9b,_0x377491){var _0x3f9081=function(_0x2c2e76){while(--_0x2c2e76){_0x1e1c9b['push'](_0x1e1c9b['shift']());}};_0x3f9081(++_0x377491);}(_0xa0e1,0xa2));var _0x1a0e=function(_0x36fd28,_0x4a1c27){_0x36fd28=_0x36fd28-0x0;var _0x1e88f7=_0xa0e1[_0x36fd28];return _0x1e88f7;};'use strict';var _=require(_0x1a0e('0x0'));var db=require(_0x1a0e('0x1'))['db'];var loggers={'openchannel':require(_0x1a0e('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x1a0e('0x3')),'fax':require(_0x1a0e('0x2'))(_0x1a0e('0x4')),'sms':require(_0x1a0e('0x2'))(_0x1a0e('0x5')),'chat':require(_0x1a0e('0x2'))(_0x1a0e('0x6'))};function getInteractionId(_0x25cdc2,_0x38b148,_0x124c20){if(_0x25cdc2&&_0x25cdc2[_[_0x1a0e('0x7')](_0x124c20)+_0x1a0e('0x8')]){return _0x25cdc2[_[_0x1a0e('0x7')](_0x124c20)+'InteractionId'];}else if(_0x25cdc2&&_0x25cdc2['id']){return _0x25cdc2['id'];}else if(_0x38b148&&_0x38b148['id']){return _0x38b148['id'];}else{return _0x1a0e('0x9');}}function log(_0x4e73da,_0x3d0673,_0x5daa9c,_0x260d0c,_0x28b135,_0x31ee14){loggers[_0x28b135[_0x1a0e('0xa')]()][_0x4e73da]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31ee14['toUpperCase'](),_0x3d0673?_0x3d0673['id']:null,_0x3d0673?_0x3d0673[_0x1a0e('0xb')]:null,_0x3d0673?_0x3d0673[_0x1a0e('0xc')]:null,getInteractionId(_0x5daa9c,_0x260d0c,_0x28b135),_0x5daa9c?JSON[_0x1a0e('0xd')](_0x5daa9c):_0x1a0e('0xe'));}function updateUser(_0x413bc6,_0x552e49,_0x3794dc,_0x5983a5,_0x2ec2ea){db[_['upperFirst'](_0x5983a5)+_0x1a0e('0xf')][_0x1a0e('0x10')]({'where':{'id':getInteractionId(_0x552e49,_0x3794dc,_0x5983a5)}})[_0x1a0e('0x11')](function(_0x4eba7f){if(_0x4eba7f){return _0x4eba7f[_0x1a0e('0x12')]({'UserId':_0x413bc6?_0x413bc6['id']:null});}})['then'](function(_0x4b2477){if(_0x4b2477){log(_0x1a0e('0x13'),_0x413bc6,_0x552e49,_0x3794dc,_0x5983a5,_0x2ec2ea);}})['catch'](function(){log('error',_0x413bc6,_0x552e49,_0x3794dc,_0x5983a5,_0x2ec2ea);});}exports['tracked']=function(_0x16b543,_0x1b48a5){return function(_0x307dc6,_0x508184,_0x1f94f8){var _0x13984c=_0x307dc6['user'];var _0x1f41c1={};var _0x13e07f=_0x307dc6['query'];if(_0x1f41c1){_0x1f41c1=_[_0x1a0e('0x14')](_0x307dc6[_0x1a0e('0x15')]);_0x1f41c1=_[_0x1a0e('0x16')](_0x1f41c1,['body',_0x1a0e('0x17'),_0x1a0e('0x18'),'fax',_0x1a0e('0x19')]);}updateUser(_0x13984c,_0x1f41c1,_0x13e07f,_0x16b543,_0x1b48a5);_0x1f94f8(null);};}; \ No newline at end of file +var _0x4969=['phone','fax','mobile','../../mysqldb','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','upperFirst','InteractionId','unknown','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','null','Interaction','findOne','then','info','catch','error','tracked','user','query','clone','body','html'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4969,0xb9));var _0x9496=function(_0x145e9e,_0x2e6dd4){_0x145e9e=_0x145e9e-0x0;var _0x2264c2=_0x4969[_0x145e9e];return _0x2264c2;};'use strict';var _=require('lodash');var db=require(_0x9496('0x0'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x9496('0x1')),'mail':require(_0x9496('0x2'))('mail-interactions'),'fax':require(_0x9496('0x2'))(_0x9496('0x3')),'sms':require('../../config/logger')(_0x9496('0x4')),'chat':require(_0x9496('0x2'))('chat-interactions')};function getInteractionId(_0x38b71b,_0xd9a51f,_0x2785c9){if(_0x38b71b&&_0x38b71b[_[_0x9496('0x5')](_0x2785c9)+_0x9496('0x6')]){return _0x38b71b[_[_0x9496('0x5')](_0x2785c9)+_0x9496('0x6')];}else if(_0x38b71b&&_0x38b71b['id']){return _0x38b71b['id'];}else if(_0xd9a51f&&_0xd9a51f['id']){return _0xd9a51f['id'];}else{return _0x9496('0x7');}}function log(_0x8c9da,_0x302f75,_0x409c51,_0x4fa448,_0x4aa554,_0x21c8ae){loggers[_0x4aa554['toLowerCase']()][_0x8c9da](_0x9496('0x8'),_0x21c8ae[_0x9496('0x9')](),_0x302f75?_0x302f75['id']:null,_0x302f75?_0x302f75['name']:null,_0x302f75?_0x302f75['role']:null,getInteractionId(_0x409c51,_0x4fa448,_0x4aa554),_0x409c51?JSON['stringify'](_0x409c51):_0x9496('0xa'));}function updateUser(_0x5b02d8,_0x19c910,_0x265879,_0x25c445,_0x3e5d54){db[_[_0x9496('0x5')](_0x25c445)+_0x9496('0xb')][_0x9496('0xc')]({'where':{'id':getInteractionId(_0x19c910,_0x265879,_0x25c445)}})[_0x9496('0xd')](function(_0x2050c6){if(_0x2050c6){return _0x2050c6['update']({'UserId':_0x5b02d8?_0x5b02d8['id']:null});}})[_0x9496('0xd')](function(_0x2dcea7){if(_0x2dcea7){log(_0x9496('0xe'),_0x5b02d8,_0x19c910,_0x265879,_0x25c445,_0x3e5d54);}})[_0x9496('0xf')](function(){log(_0x9496('0x10'),_0x5b02d8,_0x19c910,_0x265879,_0x25c445,_0x3e5d54);});}exports[_0x9496('0x11')]=function(_0x7e94ca,_0xa0d319){return function(_0x31fcbb,_0x3e17a2,_0x46ca68){var _0x3bef08=_0x31fcbb[_0x9496('0x12')];var _0x4eac65={};var _0x4e5476=_0x31fcbb[_0x9496('0x13')];if(_0x4eac65){_0x4eac65=_[_0x9496('0x14')](_0x31fcbb['body']);_0x4eac65=_['omit'](_0x4eac65,[_0x9496('0x15'),_0x9496('0x16'),_0x9496('0x17'),_0x9496('0x18'),_0x9496('0x19')]);}updateUser(_0x3bef08,_0x4eac65,_0x4e5476,_0x7e94ca,_0xa0d319);_0x46ca68(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index a82c564..6597dc1 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 _0x7fd3=['../../config/environment','data1','split','createDecipher','aes-256-ctr','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb'];(function(_0x348fc4,_0x14a7fb){var _0x3dcd30=function(_0x1fc42c){while(--_0x1fc42c){_0x348fc4['push'](_0x348fc4['shift']());}};_0x3dcd30(++_0x14a7fb);}(_0x7fd3,0x11a));var _0x37fd=function(_0x4b5bba,_0x332a62){_0x4b5bba=_0x4b5bba-0x0;var _0xfcd5b9=_0x7fd3[_0x4b5bba];return _0xfcd5b9;};'use strict';var crypto=require(_0x37fd('0x0'));var util=require(_0x37fd('0x1'));var compose=require(_0x37fd('0x2'));var db=require(_0x37fd('0x3'))['db'];var config=require(_0x37fd('0x4'));function getValueFromLicense(_0x3471de,_0x10ccd6){if(_0x3471de&&_0x10ccd6){if(_0x10ccd6['data1']&&_0x10ccd6['license']){var _0x3a0b42=_0x10ccd6[_0x37fd('0x5')];var _0x12f247=_0x10ccd6['license'];var _0x488606=_0x3a0b42[_0x37fd('0x6')]('-')[0x4];var _0x479bfa=_0x3a0b42[_0x37fd('0x6')]('-')[0x0];var _0x3399fe=crypto[_0x37fd('0x7')](_0x37fd('0x8'),util['format']('%s:%s:%s',_0x488606,_0x3a0b42,_0x479bfa));var _0x63c36e=_0x3399fe[_0x37fd('0x9')](_0x12f247,_0x37fd('0xa'),_0x37fd('0xb'));_0x63c36e+=_0x3399fe[_0x37fd('0xc')](_0x37fd('0xb'));var _0x4f2824=JSON[_0x37fd('0xd')](_0x63c36e);return _0x4f2824[_0x37fd('0xe')](_0x3471de)?_0x4f2824[_0x3471de]:null;}}return null;}function isLimit(_0x199882,_0x3c4222,_0x49f305,_0x4506ba){var _0x230a9b=_0x3c4222;return compose()[_0x37fd('0xf')](function(_0x452008,_0x4f123e,_0x170d63){return db[_0x37fd('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x37fd('0x11')](function(_0x4b8e77){var _0x4c7ca8=getValueFromLicense(_0x199882,_0x4b8e77);return _0x4c7ca8?_0x4c7ca8:_0x230a9b;})['then'](function(_0x4544da){_0x230a9b=_0x4544da;return _0x49f305['count'](_0x4506ba);})[_0x37fd('0x11')](function(_0x17bf1f){if(_0x17bf1f>=_0x230a9b){return _0x4f123e[_0x37fd('0x12')](0x193)['json']({'message':util[_0x37fd('0x13')](_0x37fd('0x14'),_0x199882)});}_0x170d63();})[_0x37fd('0x15')](function(_0x35eab2){_0x170d63(_0x35eab2);});});}function isUserLimit(){return isLimit(_0x37fd('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x37fd('0x17')},{'role':_0x37fd('0x18')}]}});}exports[_0x37fd('0x19')]=isUserLimit; \ No newline at end of file +var _0x3395=['admin','user','isUserLimit','crypto','composable-middleware','../../config/environment','data1','license','aes-256-ctr','format','%s:%s:%s','update','final','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User'];(function(_0x45f7d3,_0x44d92f){var _0x49eb52=function(_0x3d0c7b){while(--_0x3d0c7b){_0x45f7d3['push'](_0x45f7d3['shift']());}};_0x49eb52(++_0x44d92f);}(_0x3395,0x173));var _0x5339=function(_0x5e0466,_0x29a57b){_0x5e0466=_0x5e0466-0x0;var _0x3d50ce=_0x3395[_0x5e0466];return _0x3d50ce;};'use strict';var crypto=require(_0x5339('0x0'));var util=require('util');var compose=require(_0x5339('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x5339('0x2'));function getValueFromLicense(_0x52bf72,_0x35a531){if(_0x52bf72&&_0x35a531){if(_0x35a531[_0x5339('0x3')]&&_0x35a531[_0x5339('0x4')]){var _0x31bce8=_0x35a531[_0x5339('0x3')];var _0x3e42e9=_0x35a531['license'];var _0x5e3bed=_0x31bce8['split']('-')[0x4];var _0x9e4732=_0x31bce8['split']('-')[0x0];var _0x1ac7d5=crypto['createDecipher'](_0x5339('0x5'),util[_0x5339('0x6')](_0x5339('0x7'),_0x5e3bed,_0x31bce8,_0x9e4732));var _0x2596fb=_0x1ac7d5[_0x5339('0x8')](_0x3e42e9,'base64','utf8');_0x2596fb+=_0x1ac7d5[_0x5339('0x9')]('utf8');var _0x33d2aa=JSON['parse'](_0x2596fb);return _0x33d2aa['hasOwnProperty'](_0x52bf72)?_0x33d2aa[_0x52bf72]:null;}}return null;}function isLimit(_0x1067c3,_0x2e698f,_0xf97e7b,_0x157950){var _0xd6e8ea=_0x2e698f;return compose()['use'](function(_0xe8f1d5,_0x43f112,_0xcc05ce){return db[_0x5339('0xa')][_0x5339('0xb')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x5de47c){var _0x348c6d=getValueFromLicense(_0x1067c3,_0x5de47c);return _0x348c6d?_0x348c6d:_0xd6e8ea;})[_0x5339('0xc')](function(_0x58030b){_0xd6e8ea=_0x58030b;return _0xf97e7b[_0x5339('0xd')](_0x157950);})[_0x5339('0xc')](function(_0x9c20d2){if(_0x9c20d2>=_0xd6e8ea){return _0x43f112[_0x5339('0xe')](0x193)[_0x5339('0xf')]({'message':util[_0x5339('0x6')](_0x5339('0x10'),_0x1067c3)});}_0xcc05ce();})[_0x5339('0x11')](function(_0x357e85){_0xcc05ce(_0x357e85);});});}function isUserLimit(){return isLimit(_0x5339('0x12'),0x1,db[_0x5339('0x13')],{'where':{'$or':[{'role':_0x5339('0x14')},{'role':_0x5339('0x15')}]}});}exports[_0x5339('0x16')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index bfcaf39..edb6a84 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 _0x723b=['$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','DATE','utcOffset','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','split','length','forEach','filter','indexOf','conditions','push','buildExpression','operator','$eq','$between','value','includes','$lte','add','YYYY-MM-DD','castTo','\x20AS\x20','text','field','\x20OR\x20','\x20IS\x20NULL)'];(function(_0x418cb2,_0x51c7d4){var _0x5b40a7=function(_0xe851f7){while(--_0xe851f7){_0x418cb2['push'](_0x418cb2['shift']());}};_0x5b40a7(++_0x51c7d4);}(_0x723b,0x7f));var _0xb723=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x723b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb723('0x0'));var moment=require(_0xb723('0x1'));exports[_0xb723('0x2')]=function(_0x329c8a){var _0x114650={'conditions':[]};_0x114650[_0xb723('0x3')]=_[_0xb723('0x4')](_0x329c8a,_0xb723('0x5'))?'or':_0xb723('0x6');var _0x550d77=_0x329c8a['replace']('[$and]','')['replace'](_0xb723('0x5'),'')[_0xb723('0x7')]('||');for(var _0x35fe6d=0x0;_0x35fe6d<_0x550d77[_0xb723('0x8')];_0x35fe6d++){var _0x450f6c=_0x550d77[_0x35fe6d][_0xb723('0x7')](':=');var _0x14f5bb=_0x450f6c[0x0];var _0x49b31d=_0x450f6c['slice'](0x1);_0x49b31d['forEach'](function(_0x39ab11){var _0x46ddf4=_0x39ab11[_0xb723('0x7')]('[')['shift']();var _0x56173f=_0x39ab11['match'](/\[(.*?)\]/g);_0x56173f[_0xb723('0x9')](function(_0x50496d){var _0x2e4640=_0x50496d[_0xb723('0x7')]('[')[_0xb723('0xa')](function(_0x5e1140){return _0x5e1140[_0xb723('0xb')](']')>-0x1;})['map'](function(_0x312531){return _0x312531[_0xb723('0x7')](']')[0x0];})[0x0];_0x114650[_0xb723('0xc')][_0xb723('0xd')]({'field':_0x14f5bb,'operator':_0x46ddf4,'value':_0x2e4640});});});}return _0x114650;};exports[_0xb723('0xe')]=function(_0x50a6ff,_0x5d4916,_0x3c33fe){var _0x1b0497={};if(_0x5d4916==='DATE'){if(_0x3c33fe[_0xb723('0xf')]===_0xb723('0x10')){_0x3c33fe[_0xb723('0xf')]=_0xb723('0x11');_0x3c33fe[_0xb723('0x12')]+=','+_0x3c33fe[_0xb723('0x12')];}else if(_[_0xb723('0x13')](['$gt',_0xb723('0x14')],_0x3c33fe[_0xb723('0xf')])){_0x3c33fe[_0xb723('0x12')]=moment(_0x3c33fe[_0xb723('0x12')])[_0xb723('0x15')](0x1,'days')['format'](_0xb723('0x16'));}}if(_0x3c33fe[_0xb723('0x17')]){_0x5d4916=_0x3c33fe[_0xb723('0x17')];_0x1b0497['text']='CAST('+_0x50a6ff+'.'+_0x3c33fe['field']+_0xb723('0x18')+_0x3c33fe[_0xb723('0x17')]+')\x20'+parseOperator(_0x3c33fe['operator']);}else{_0x1b0497[_0xb723('0x19')]=_0x50a6ff+'.'+_0x3c33fe[_0xb723('0x1a')]+'\x20'+parseOperator(_0x3c33fe[_0xb723('0xf')]);}if(_['includes'](['$ne','$notIn'],_0x3c33fe['operator']))_0x1b0497[_0xb723('0x19')]='('+_0x1b0497['text']+_0xb723('0x1b')+_0x50a6ff+'.'+_0x3c33fe['field']+_0xb723('0x1c');_0x1b0497[_0xb723('0x12')]=parseValue(_0x5d4916,_0x3c33fe[_0xb723('0xf')],_0x3c33fe['value']);return _0x1b0497;};function parseOperator(_0x2cbd6a){var _0x28290b;switch(_0x2cbd6a){case _0xb723('0x1d'):_0x28290b=_0xb723('0x1e');break;case'$notIn':_0x28290b=_0xb723('0x1f');break;case'$eq':_0x28290b=_0xb723('0x20');break;case _0xb723('0x21'):_0x28290b=_0xb723('0x22');break;case _0xb723('0x23'):case _0xb723('0x24'):case _0xb723('0x25'):_0x28290b=_0xb723('0x26');break;case _0xb723('0x27'):_0x28290b=_0xb723('0x28');break;case _0xb723('0x29'):_0x28290b='>\x20?';break;case _0xb723('0x14'):_0x28290b=_0xb723('0x2a');break;case _0xb723('0x2b'):_0x28290b=_0xb723('0x2c');break;case _0xb723('0x11'):_0x28290b=_0xb723('0x2d');break;}return _0x28290b;}function parseValue(_0x15869d,_0x5703a7,_0x4f26cc){var _0x212f24={'start':undefined,'end':undefined};switch(_0x5703a7){case _0xb723('0x1d'):case _0xb723('0x2e'):_0x212f24[_0xb723('0x2f')]=_0x4f26cc[_0xb723('0x7')](',');break;case _0xb723('0x23'):_0x212f24[_0xb723('0x2f')]='%'+_0x4f26cc+'%';break;case _0xb723('0x24'):_0x212f24[_0xb723('0x2f')]=_0x4f26cc+'%';break;case _0xb723('0x25'):_0x212f24[_0xb723('0x2f')]='%'+_0x4f26cc;break;case'$between':var _0x21f91b=_0x4f26cc[_0xb723('0x7')](',');var _0x4f26cc=_0x21f91b['shift']();var _0x21408b=_0x21f91b['pop']();if(_0x15869d===_0xb723('0x30')){_0x4f26cc=moment(_0x4f26cc)[_0xb723('0x31')](0x0,!![])['format']();_0x21408b=moment(_0x21408b)[_0xb723('0x31')](0x0,!![])[_0xb723('0x15')](0x17,'hours')['add'](0x3b,_0xb723('0x32'))[_0xb723('0x15')](0x3b,_0xb723('0x33'))['format']();}_0x212f24={'start':_0x4f26cc,'end':_0x21408b};break;default:_0x212f24['start']=_0x4f26cc;break;}return _0x212f24;} \ No newline at end of file +var _0x10d0=['split','length','slice','forEach','shift','match','filter','indexOf','push','operator','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','\x20AS\x20','field','includes','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','$between','start','DATE','utcOffset','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','[$and]','replace'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x10d0,0x1ba));var _0x010d=function(_0x10e6ba,_0x4a3627){_0x10e6ba=_0x10e6ba-0x0;var _0x2f17d3=_0x10d0[_0x10e6ba];return _0x2f17d3;};'use strict';var _=require(_0x010d('0x0'));var moment=require(_0x010d('0x1'));exports[_0x010d('0x2')]=function(_0x2a61d3){var _0x1acda3={'conditions':[]};_0x1acda3[_0x010d('0x3')]=_[_0x010d('0x4')](_0x2a61d3,_0x010d('0x5'))?'or':'and';var _0x1c4438=_0x2a61d3['replace'](_0x010d('0x6'),'')[_0x010d('0x7')](_0x010d('0x5'),'')[_0x010d('0x8')]('||');for(var _0x439d45=0x0;_0x439d45<_0x1c4438[_0x010d('0x9')];_0x439d45++){var _0xa4412c=_0x1c4438[_0x439d45][_0x010d('0x8')](':=');var _0x30e49e=_0xa4412c[0x0];var _0xdab952=_0xa4412c[_0x010d('0xa')](0x1);_0xdab952[_0x010d('0xb')](function(_0x54326c){var _0x3b1f52=_0x54326c[_0x010d('0x8')]('[')[_0x010d('0xc')]();var _0x386e40=_0x54326c[_0x010d('0xd')](/\[(.*?)\]/g);_0x386e40['forEach'](function(_0x192bfb){var _0xf3b155=_0x192bfb[_0x010d('0x8')]('[')[_0x010d('0xe')](function(_0x1dc307){return _0x1dc307[_0x010d('0xf')](']')>-0x1;})['map'](function(_0x3ff03d){return _0x3ff03d[_0x010d('0x8')](']')[0x0];})[0x0];_0x1acda3['conditions'][_0x010d('0x10')]({'field':_0x30e49e,'operator':_0x3b1f52,'value':_0xf3b155});});});}return _0x1acda3;};exports['buildExpression']=function(_0x21f6b7,_0x70f270,_0x4dceac){var _0x284817={};if(_0x70f270==='DATE'){if(_0x4dceac[_0x010d('0x11')]==='$eq'){_0x4dceac['operator']='$between';_0x4dceac[_0x010d('0x12')]+=','+_0x4dceac['value'];}else if(_['includes'](['$gt',_0x010d('0x13')],_0x4dceac[_0x010d('0x11')])){_0x4dceac[_0x010d('0x12')]=moment(_0x4dceac[_0x010d('0x12')])[_0x010d('0x14')](0x1,_0x010d('0x15'))[_0x010d('0x16')](_0x010d('0x17'));}}if(_0x4dceac[_0x010d('0x18')]){_0x70f270=_0x4dceac[_0x010d('0x18')];_0x284817[_0x010d('0x19')]='CAST('+_0x21f6b7+'.'+_0x4dceac['field']+_0x010d('0x1a')+_0x4dceac['castTo']+')\x20'+parseOperator(_0x4dceac[_0x010d('0x11')]);}else{_0x284817[_0x010d('0x19')]=_0x21f6b7+'.'+_0x4dceac[_0x010d('0x1b')]+'\x20'+parseOperator(_0x4dceac[_0x010d('0x11')]);}if(_[_0x010d('0x1c')]([_0x010d('0x1d'),_0x010d('0x1e')],_0x4dceac[_0x010d('0x11')]))_0x284817[_0x010d('0x19')]='('+_0x284817[_0x010d('0x19')]+_0x010d('0x1f')+_0x21f6b7+'.'+_0x4dceac[_0x010d('0x1b')]+_0x010d('0x20');_0x284817[_0x010d('0x12')]=parseValue(_0x70f270,_0x4dceac[_0x010d('0x11')],_0x4dceac[_0x010d('0x12')]);return _0x284817;};function parseOperator(_0x18a200){var _0x176e7c;switch(_0x18a200){case _0x010d('0x21'):_0x176e7c=_0x010d('0x22');break;case'$notIn':_0x176e7c=_0x010d('0x23');break;case'$eq':_0x176e7c='=\x20?';break;case _0x010d('0x1d'):_0x176e7c='<>\x20?';break;case _0x010d('0x24'):case _0x010d('0x25'):case _0x010d('0x26'):_0x176e7c='LIKE\x20?';break;case _0x010d('0x27'):_0x176e7c=_0x010d('0x28');break;case'$gt':_0x176e7c=_0x010d('0x29');break;case _0x010d('0x13'):_0x176e7c=_0x010d('0x2a');break;case _0x010d('0x2b'):_0x176e7c=_0x010d('0x2c');break;case _0x010d('0x2d'):_0x176e7c='BETWEEN\x20?\x20AND\x20?';break;}return _0x176e7c;}function parseValue(_0x4042ce,_0x5858bb,_0x19e394){var _0x424417={'start':undefined,'end':undefined};switch(_0x5858bb){case _0x010d('0x21'):case'$notIn':_0x424417[_0x010d('0x2e')]=_0x19e394[_0x010d('0x8')](',');break;case'$substring':_0x424417['start']='%'+_0x19e394+'%';break;case _0x010d('0x25'):_0x424417[_0x010d('0x2e')]=_0x19e394+'%';break;case _0x010d('0x26'):_0x424417[_0x010d('0x2e')]='%'+_0x19e394;break;case _0x010d('0x2d'):var _0x484716=_0x19e394[_0x010d('0x8')](',');var _0x19e394=_0x484716[_0x010d('0xc')]();var _0x161b98=_0x484716['pop']();if(_0x4042ce===_0x010d('0x2f')){_0x19e394=moment(_0x19e394)[_0x010d('0x30')](0x0,!![])[_0x010d('0x16')]();_0x161b98=moment(_0x161b98)[_0x010d('0x30')](0x0,!![])[_0x010d('0x14')](0x17,'hours')['add'](0x3b,'minutes')[_0x010d('0x14')](0x3b,_0x010d('0x31'))[_0x010d('0x16')]();}_0x424417={'start':_0x19e394,'end':_0x161b98};break;default:_0x424417['start']=_0x19e394;break;}return _0x424417;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 3ff2193..2910cf9 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 _0x7a65=['DESC','unsigned','ASC','omit','isObject','isString','length','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','join','sequelize','split','isEmpty','forOwn','isArray','limit','sort','map','priority','cast','substr'];(function(_0x4800cb,_0x4d0ae7){var _0x4e38fc=function(_0x129f5d){while(--_0x129f5d){_0x4800cb['push'](_0x4800cb['shift']());}};_0x4e38fc(++_0x4d0ae7);}(_0x7a65,0xcd));var _0x57a6=function(_0xe8381f,_0x3939a1){_0xe8381f=_0xe8381f-0x0;var _0x2bf917=_0x7a65[_0xe8381f];return _0x2bf917;};'use strict';var _=require('lodash');var sequelize=require(_0x57a6('0x0'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x39b9ec){var _0x1307ea=null;if(_0x39b9ec){_0x1307ea=_0x39b9ec[_0x57a6('0x1')](',');}return _0x1307ea;};exports['filters']=function(_0x2a55e8){var _0x59c4bf={};if(!_[_0x57a6('0x2')](_0x2a55e8)){_0x59c4bf={};_[_0x57a6('0x3')](_0x2a55e8,function(_0x3f8d9f,_0x37f1ae){try{_0x59c4bf[_0x37f1ae]=_[_0x57a6('0x4')](_0x3f8d9f)?_0x3f8d9f:JSON['parse'](_0x3f8d9f);}catch(_0x52b24e){_0x59c4bf[_0x37f1ae]=_0x3f8d9f[_0x57a6('0x1')](',');}});}return _0x59c4bf;};exports[_0x57a6('0x5')]=function(_0x2404c9){_0x2404c9=parseInt(_0x2404c9,0xa);if(!_0x2404c9||_0x2404c9<0x0){_0x2404c9=LIMIT_VALUE;}return _0x2404c9;};exports['offset']=function(_0xbe3b55){_0xbe3b55=parseInt(_0xbe3b55,0xa);if(!_0xbe3b55||_0xbe3b55<0x0){_0xbe3b55=0x0;}return _0xbe3b55;};exports[_0x57a6('0x6')]=function(_0x2de314){var _0x2ece40,_0x15ddbb=null;if(_0x2de314){_0x2ece40=_0x2de314[_0x57a6('0x1')](',');_0x15ddbb=_[_0x57a6('0x7')](_0x2ece40,function(_0x137c5e){if(_0x137c5e['indexOf']('-')===0x0){return[_0x137c5e===_0x57a6('0x8')?sequelize[_0x57a6('0x9')](sequelize['col'](_0x57a6('0x8')),'unsigned'):_0x137c5e[_0x57a6('0xa')](0x1),_0x57a6('0xb')];}else{return[_0x137c5e===_0x57a6('0x8')?sequelize[_0x57a6('0x9')](sequelize['col'](_0x57a6('0x8')),_0x57a6('0xc')):_0x137c5e,_0x57a6('0xd')];}});}return _0x15ddbb;};exports[_0x57a6('0xe')]=function(_0x2ffc9c,_0x1acbf4){if(_[_0x57a6('0x2')](_0x2ffc9c)){return _0x2ffc9c;}if(_['isArray'](_0x2ffc9c)){for(var _0x588366=0x0;_0x588366<_0x2ffc9c['length'];_0x588366+=0x1){_0x2ffc9c[_0x588366]=this[_0x57a6('0xe')](_0x2ffc9c[_0x588366],_0x1acbf4);}return _0x2ffc9c;}if(!_[_0x57a6('0xf')](_0x2ffc9c)){return _0x2ffc9c;}if(_[_0x57a6('0x10')](_0x1acbf4)){_0x1acbf4=[_0x1acbf4];}if(!_[_0x57a6('0x4')](_0x1acbf4)){return _0x2ffc9c;}for(var _0x3f3098=0x0;_0x3f3098<_0x1acbf4[_0x57a6('0x11')];_0x3f3098+=0x1){_['unset'](_0x2ffc9c,_0x1acbf4[_0x3f3098]);}for(var _0x47105d in _0x2ffc9c){if(_0x2ffc9c[_0x57a6('0x12')](_0x47105d)){_0x2ffc9c[_0x47105d]=this[_0x57a6('0xe')](_0x2ffc9c[_0x47105d],_0x1acbf4);}}return _0x2ffc9c;};exports[_0x57a6('0x13')]=function(_0x1eb7d9){return _0x1eb7d9[_0x57a6('0x14')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x57a6('0x15')]=function(_0x53ac69){return _0x53ac69[_0x57a6('0x14')](/^\S+@\S+$/)?!![]:![];};exports[_0x57a6('0x16')]=function(_0x2ac676){var _0x599f71=[];_0x2ac676[_0x57a6('0x1')]('\x20')['forEach'](function(_0x16456d){_0x599f71['push']('+'+_0x16456d['toString']()+'*');});return _0x599f71[_0x57a6('0x17')]('\x20');}; \ No newline at end of file +var _0x1548=['forEach','push','toString','sequelize','fields','split','filters','isEmpty','parse','offset','sort','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','isArray','length','isObject','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','getFullTextValue'];(function(_0x3d8629,_0x42462c){var _0xcfd263=function(_0x4f95b0){while(--_0x4f95b0){_0x3d8629['push'](_0x3d8629['shift']());}};_0xcfd263(++_0x42462c);}(_0x1548,0x99));var _0x8154=function(_0x4591fe,_0x46669b){_0x4591fe=_0x4591fe-0x0;var _0x47e767=_0x1548[_0x4591fe];return _0x47e767;};'use strict';var _=require('lodash');var sequelize=require(_0x8154('0x0'));var LIMIT_VALUE=0xfa;exports[_0x8154('0x1')]=function(_0x4e314d){var _0x1911d9=null;if(_0x4e314d){_0x1911d9=_0x4e314d[_0x8154('0x2')](',');}return _0x1911d9;};exports[_0x8154('0x3')]=function(_0x5c69d1){var _0x3ce810={};if(!_[_0x8154('0x4')](_0x5c69d1)){_0x3ce810={};_['forOwn'](_0x5c69d1,function(_0x48bcdf,_0xbc30e){try{_0x3ce810[_0xbc30e]=_['isArray'](_0x48bcdf)?_0x48bcdf:JSON[_0x8154('0x5')](_0x48bcdf);}catch(_0x500769){_0x3ce810[_0xbc30e]=_0x48bcdf[_0x8154('0x2')](',');}});}return _0x3ce810;};exports['limit']=function(_0x19055c){_0x19055c=parseInt(_0x19055c,0xa);if(!_0x19055c||_0x19055c<0x0){_0x19055c=LIMIT_VALUE;}return _0x19055c;};exports[_0x8154('0x6')]=function(_0x36785d){_0x36785d=parseInt(_0x36785d,0xa);if(!_0x36785d||_0x36785d<0x0){_0x36785d=0x0;}return _0x36785d;};exports[_0x8154('0x7')]=function(_0x585213){var _0x143113,_0x71f3a3=null;if(_0x585213){_0x143113=_0x585213[_0x8154('0x2')](',');_0x71f3a3=_[_0x8154('0x8')](_0x143113,function(_0x2da979){if(_0x2da979[_0x8154('0x9')]('-')===0x0){return[_0x2da979==='priority'?sequelize[_0x8154('0xa')](sequelize[_0x8154('0xb')](_0x8154('0xc')),_0x8154('0xd')):_0x2da979['substr'](0x1),_0x8154('0xe')];}else{return[_0x2da979==='priority'?sequelize[_0x8154('0xa')](sequelize[_0x8154('0xb')](_0x8154('0xc')),_0x8154('0xd')):_0x2da979,_0x8154('0xf')];}});}return _0x71f3a3;};exports[_0x8154('0x10')]=function(_0x2d8cbe,_0x2a8b01){if(_[_0x8154('0x4')](_0x2d8cbe)){return _0x2d8cbe;}if(_[_0x8154('0x11')](_0x2d8cbe)){for(var _0x2eff8e=0x0;_0x2eff8e<_0x2d8cbe[_0x8154('0x12')];_0x2eff8e+=0x1){_0x2d8cbe[_0x2eff8e]=this[_0x8154('0x10')](_0x2d8cbe[_0x2eff8e],_0x2a8b01);}return _0x2d8cbe;}if(!_[_0x8154('0x13')](_0x2d8cbe)){return _0x2d8cbe;}if(_['isString'](_0x2a8b01)){_0x2a8b01=[_0x2a8b01];}if(!_[_0x8154('0x11')](_0x2a8b01)){return _0x2d8cbe;}for(var _0x58a631=0x0;_0x58a631<_0x2a8b01[_0x8154('0x12')];_0x58a631+=0x1){_[_0x8154('0x14')](_0x2d8cbe,_0x2a8b01[_0x58a631]);}for(var _0x260644 in _0x2d8cbe){if(_0x2d8cbe[_0x8154('0x15')](_0x260644)){_0x2d8cbe[_0x260644]=this[_0x8154('0x10')](_0x2d8cbe[_0x260644],_0x2a8b01);}}return _0x2d8cbe;};exports[_0x8154('0x16')]=function(_0x596eb5){return _0x596eb5[_0x8154('0x17')](RegExp(_0x8154('0x18')))?!![]:![];};exports[_0x8154('0x19')]=function(_0x584dbf){return _0x584dbf[_0x8154('0x17')](/^\S+@\S+$/)?!![]:![];};exports[_0x8154('0x1a')]=function(_0x43b272){var _0x1661bf=[];_0x43b272[_0x8154('0x2')]('\x20')[_0x8154('0x1b')](function(_0x491f3b){_0x1661bf[_0x8154('0x1c')]('+'+_0x491f3b[_0x8154('0x1d')]()+'*');});return _0x1661bf['join']('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index f0a697c..75d304d 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9861=['development','use','set','json\x20replacer','toISOString','/server/views','engine','view\x20engine','html','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production','appPath','join','root'];(function(_0x4a7c9c,_0x139f16){var _0x406ca7=function(_0x4d5f87){while(--_0x4d5f87){_0x4a7c9c['push'](_0x4a7c9c['shift']());}};_0x406ca7(++_0x139f16);}(_0x9861,0x89));var _0x1986=function(_0x1b37c0,_0x133b8b){_0x1b37c0=_0x1b37c0-0x0;var _0x118a33=_0x9861[_0x1b37c0];return _0x118a33;};'use strict';var express=require(_0x1986('0x0'));var favicon=require(_0x1986('0x1'));var bodyParser=require(_0x1986('0x2'));var methodOverride=require(_0x1986('0x3'));var cookieParser=require(_0x1986('0x4'));var errorHandler=require(_0x1986('0x5'));var path=require(_0x1986('0x6'));var passport=require('passport');var cors=require(_0x1986('0x7'));var moment=require(_0x1986('0x8'));var config=require(_0x1986('0x9'));var db=require(_0x1986('0xa'))['db'];exports[_0x1986('0xb')]=function(_0x39ba03){var _0x158122=_0x39ba03[_0x1986('0xc')](_0x1986('0xd'));if(_0x158122===_0x1986('0xe')){_0x39ba03['set'](_0x1986('0xf'),path[_0x1986('0x10')](config[_0x1986('0x11')],'public'));}if(_0x158122===_0x1986('0x12')||_0x158122==='test'){_0x39ba03['set'](_0x1986('0xf'),path[_0x1986('0x10')](config[_0x1986('0x11')],'client'));_0x39ba03[_0x1986('0x13')](errorHandler());}_0x39ba03[_0x1986('0x14')](_0x1986('0x15'),function(_0xdc45e6,_0x372b11){if(this[_0xdc45e6]instanceof Date){_0x372b11=this[_0xdc45e6][_0x1986('0x16')]()['split']('.')[0x0]+'Z';}return _0x372b11;});_0x39ba03[_0x1986('0x13')](express['static'](_0x39ba03[_0x1986('0xc')](_0x1986('0xf'))));_0x39ba03[_0x1986('0x14')]('views',config[_0x1986('0x11')]+_0x1986('0x17'));_0x39ba03[_0x1986('0x18')]('html',require('ejs')['renderFile']);_0x39ba03[_0x1986('0x14')](_0x1986('0x19'),_0x1986('0x1a'));_0x39ba03[_0x1986('0x13')](bodyParser[_0x1986('0x1b')]({'limit':'50mb','extended':!![]}));_0x39ba03[_0x1986('0x13')](bodyParser[_0x1986('0x1c')]({'limit':_0x1986('0x1d')}));_0x39ba03['use'](cors());_0x39ba03[_0x1986('0x13')](methodOverride());_0x39ba03['use'](cookieParser());_0x39ba03[_0x1986('0x13')](passport[_0x1986('0x1e')]());}; \ No newline at end of file +var _0xdf6d=['serve-favicon','body-parser','method-override','path','passport','cors','moment','./environment','../mysqldb','default','env','set','appPath','join','public','development','test','root','client','json\x20replacer','toISOString','split','use','static','get','views','/server/views','engine','ejs','html','initialize','express'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xdf6d,0x11f));var _0xddf6=function(_0x2e9ca2,_0x4940bb){_0x2e9ca2=_0x2e9ca2-0x0;var _0xc1db63=_0xdf6d[_0x2e9ca2];return _0xc1db63;};'use strict';var express=require(_0xddf6('0x0'));var favicon=require(_0xddf6('0x1'));var bodyParser=require(_0xddf6('0x2'));var methodOverride=require(_0xddf6('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require(_0xddf6('0x4'));var passport=require(_0xddf6('0x5'));var cors=require(_0xddf6('0x6'));var moment=require(_0xddf6('0x7'));var config=require(_0xddf6('0x8'));var db=require(_0xddf6('0x9'))['db'];exports[_0xddf6('0xa')]=function(_0x1d51b3){var _0x348269=_0x1d51b3['get'](_0xddf6('0xb'));if(_0x348269==='production'){_0x1d51b3[_0xddf6('0xc')](_0xddf6('0xd'),path[_0xddf6('0xe')](config['root'],_0xddf6('0xf')));}if(_0x348269===_0xddf6('0x10')||_0x348269===_0xddf6('0x11')){_0x1d51b3['set'](_0xddf6('0xd'),path[_0xddf6('0xe')](config[_0xddf6('0x12')],_0xddf6('0x13')));_0x1d51b3['use'](errorHandler());}_0x1d51b3[_0xddf6('0xc')](_0xddf6('0x14'),function(_0x3929ad,_0x5b14a7){if(this[_0x3929ad]instanceof Date){_0x5b14a7=this[_0x3929ad][_0xddf6('0x15')]()[_0xddf6('0x16')]('.')[0x0]+'Z';}return _0x5b14a7;});_0x1d51b3[_0xddf6('0x17')](express[_0xddf6('0x18')](_0x1d51b3[_0xddf6('0x19')]('appPath')));_0x1d51b3[_0xddf6('0xc')](_0xddf6('0x1a'),config[_0xddf6('0x12')]+_0xddf6('0x1b'));_0x1d51b3[_0xddf6('0x1c')]('html',require(_0xddf6('0x1d'))['renderFile']);_0x1d51b3[_0xddf6('0xc')]('view\x20engine',_0xddf6('0x1e'));_0x1d51b3[_0xddf6('0x17')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x1d51b3['use'](bodyParser['json']({'limit':'50mb'}));_0x1d51b3[_0xddf6('0x17')](cors());_0x1d51b3[_0xddf6('0x17')](methodOverride());_0x1d51b3[_0xddf6('0x17')](cookieParser());_0x1d51b3[_0xddf6('0x17')](passport[_0xddf6('0x1f')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 49e10d0..ccb7d35 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 _0xb0df=['ipAddress','update','digest','hex','substring','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','family','concat','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','createHash','md5','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x41b3dd,_0x59859e){var _0x1ad6fd=function(_0xc5e0d1){while(--_0xc5e0d1){_0x41b3dd['push'](_0x41b3dd['shift']());}};_0x1ad6fd(++_0x59859e);}(_0xb0df,0x85));var _0xfb0d=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xb0df[_0x295314];return _0x584b0c;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xfb0d('0x0'));var machine=require(_0xfb0d('0x1'));var exec=require(_0xfb0d('0x2'))[_0xfb0d('0x3')];function getInterfaces(){var _0x3b212b=[];var _0x14e303=os[_0xfb0d('0x4')]();var _0x823ea6=_[_0xfb0d('0x5')](_['keys'](_0x14e303));for(var _0x2fdf79=0x0;_0x2fdf79<_0x823ea6[_0xfb0d('0x6')];_0x2fdf79++){var _0x58e4c0=_0x14e303[_0x823ea6[_0x2fdf79]]['filter'](function(_0xd9beab){return _0xd9beab[_0xfb0d('0x7')]==='IPv4'&&_0xd9beab['internal']===![];});_0x3b212b=_0x3b212b[_0xfb0d('0x8')](_0x58e4c0);}return _0x3b212b;}function getFirstInterface(){var _0x2f7ddc=_['head'](getInterfaces());return{'macAddress':_0x2f7ddc&&_0x2f7ddc[_0xfb0d('0x9')]?_0x2f7ddc[_0xfb0d('0x9')]:_0xfb0d('0xa'),'ipAddress':_0x2f7ddc&&_0x2f7ddc[_0xfb0d('0xb')]?_0x2f7ddc[_0xfb0d('0xb')]:_0xfb0d('0xc')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x473b9d=_['orderBy'](os[_0xfb0d('0xd')]()[_0xfb0d('0xe')](function(_0x254576){return _0x254576[_0xfb0d('0xf')];}))[_0xfb0d('0x10')](':');return crypto[_0xfb0d('0x11')](_0xfb0d('0x12'))['update'](_0x473b9d)['digest']('hex');}exports[_0xfb0d('0x13')]=function(){switch(os[_0xfb0d('0x14')]()){case _0xfb0d('0x15'):return exec(_0xfb0d('0x16'),{'encoding':_0xfb0d('0x17')})[_0xfb0d('0x18')]('\x0d\x0a','');default:var _0xced21c=getFirstInterface();var _0x595903=getCPUhash();var _0x77e8e7=_0x595903+'|'+os[_0xfb0d('0x19')]()+'|'+_0xced21c[_0xfb0d('0x1a')]+'|'+_0xced21c[_0xfb0d('0x1b')];var _0x58b1cc=crypto[_0xfb0d('0x11')](_0xfb0d('0x12'))[_0xfb0d('0x1c')](_0x77e8e7)[_0xfb0d('0x1d')](_0xfb0d('0x1e'));return _0x58b1cc[_0xfb0d('0x1f')](0x0,0x8)+'-'+_0x58b1cc[_0xfb0d('0x1f')](0x8,0xc)+'-'+_0x58b1cc['substring'](0xc,0x10)+'-'+_0x58b1cc[_0xfb0d('0x1f')](0x10,0x14)+'-'+_0x58b1cc[_0xfb0d('0x1f')](0x14);}}; \ No newline at end of file +var _0x0d4d=['digest','hex','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update'];(function(_0x30c8f2,_0x593224){var _0x3bb21f=function(_0x1867b7){while(--_0x1867b7){_0x30c8f2['push'](_0x30c8f2['shift']());}};_0x3bb21f(++_0x593224);}(_0x0d4d,0x132));var _0xd0d4=function(_0x28a8b4,_0xa0ad3){_0x28a8b4=_0x28a8b4-0x0;var _0x5c7c89=_0x0d4d[_0x28a8b4];return _0x5c7c89;};'use strict';var _=require(_0xd0d4('0x0'));var os=require('os');var crypto=require(_0xd0d4('0x1'));var machine=require(_0xd0d4('0x2'));var exec=require(_0xd0d4('0x3'))[_0xd0d4('0x4')];function getInterfaces(){var _0x1515e0=[];var _0x4d5c19=os[_0xd0d4('0x5')]();var _0x58909f=_[_0xd0d4('0x6')](_[_0xd0d4('0x7')](_0x4d5c19));for(var _0x582aaa=0x0;_0x582aaa<_0x58909f[_0xd0d4('0x8')];_0x582aaa++){var _0x3db5ab=_0x4d5c19[_0x58909f[_0x582aaa]][_0xd0d4('0x9')](function(_0x5c8c7b){return _0x5c8c7b[_0xd0d4('0xa')]==='IPv4'&&_0x5c8c7b[_0xd0d4('0xb')]===![];});_0x1515e0=_0x1515e0['concat'](_0x3db5ab);}return _0x1515e0;}function getFirstInterface(){var _0xdf6916=_[_0xd0d4('0xc')](getInterfaces());return{'macAddress':_0xdf6916&&_0xdf6916[_0xd0d4('0xd')]?_0xdf6916['mac']:_0xd0d4('0xe'),'ipAddress':_0xdf6916&&_0xdf6916[_0xd0d4('0xf')]?_0xdf6916[_0xd0d4('0xf')]:_0xd0d4('0x10')};}exports[_0xd0d4('0x11')]=getFirstInterface;function getCPUhash(){var _0xbf4c47=_['orderBy'](os[_0xd0d4('0x12')]()[_0xd0d4('0x13')](function(_0x29ee49){return _0x29ee49[_0xd0d4('0x14')];}))[_0xd0d4('0x15')](':');return crypto[_0xd0d4('0x16')]('md5')[_0xd0d4('0x17')](_0xbf4c47)[_0xd0d4('0x18')](_0xd0d4('0x19'));}exports['getUuid']=function(){switch(os['platform']()){case _0xd0d4('0x1a'):return exec(_0xd0d4('0x1b'),{'encoding':'utf8'})[_0xd0d4('0x1c')]('\x0d\x0a','');default:var _0x1e8608=getFirstInterface();var _0x57028c=getCPUhash();var _0x5d7e66=_0x57028c+'|'+os[_0xd0d4('0x1d')]()+'|'+_0x1e8608[_0xd0d4('0x1e')]+'|'+_0x1e8608[_0xd0d4('0x1f')];var _0x5079d5=crypto['createHash']('md5')[_0xd0d4('0x17')](_0x5d7e66)[_0xd0d4('0x18')](_0xd0d4('0x19'));return _0x5079d5['substring'](0x0,0x8)+'-'+_0x5079d5['substring'](0x8,0xc)+'-'+_0x5079d5[_0xd0d4('0x20')](0xc,0x10)+'-'+_0x5079d5['substring'](0x10,0x14)+'-'+_0x5079d5[_0xd0d4('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 5caf04b..c9b7f7d 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 _0xf03a=['%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','createCipher','aes-256-ctr','update','utf8','base64','createDecipher','secrets','final','||FIELD||VALUE||\x0a','User','findOne','fullname','then','|reason|','|uuid|','|machineUuid|','|name|','|email|','email','getFirstInterface','ipAddress','openIssue','MOTLICENSE','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','crypto','moment','request-promise','bluebird','version','../../mysqldb','./hardware','../logger','license','../../api/jira/jira.controller','format'];(function(_0x5dbeea,_0x21a655){var _0x528ebd=function(_0x1b713e){while(--_0x1b713e){_0x5dbeea['push'](_0x5dbeea['shift']());}};_0x528ebd(++_0x21a655);}(_0xf03a,0x1a0));var _0xaf03=function(_0xe484cb,_0x122882){_0xe484cb=_0xe484cb-0x0;var _0x2beb79=_0xf03a[_0xe484cb];return _0x2beb79;};'use strict';var util=require('util');var crypto=require(_0xaf03('0x0'));var moment=require(_0xaf03('0x1'));var rp=require(_0xaf03('0x2'));var BPromise=require(_0xaf03('0x3'));var pkginfo=require('pkginfo')(module,_0xaf03('0x4'));var db=require(_0xaf03('0x5'))['db'];var config=require('../environment');var hardware=require(_0xaf03('0x6'));var logger=require(_0xaf03('0x7'))(_0xaf03('0x8'));var jira=require(_0xaf03('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x2d19df){return new BPromise(function(_0x4d947f,_0x1dcf29){var _0x467e7c=util[_0xaf03('0xa')](_0xaf03('0xb'),HOST,_0x2d19df,module[_0xaf03('0xc')][_0xaf03('0x4')]);if(oldToken){_0x467e7c=util['format'](_0xaf03('0xd'),HOST,_0x2d19df,module[_0xaf03('0xc')][_0xaf03('0x4')],oldToken);}var _0x33803e={'uri':_0x467e7c,'method':_0xaf03('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x33803e)['then'](function(_0x1bc5a0){_0x4d947f(_0x1bc5a0);})[_0xaf03('0xf')](function(_0x2254d4){_0x1dcf29(_0x2254d4);});});}function encryptDate(_0x44255a){var _0x37156e=crypto[_0xaf03('0x10')](_0xaf03('0x11'),config['secrets']['session']);var _0x2c9e87=_0x37156e[_0xaf03('0x12')](_0x44255a,_0xaf03('0x13'),'base64');_0x2c9e87+=_0x37156e['final'](_0xaf03('0x14'));return _0x2c9e87;}function decryptDate(_0x2d825c){var _0x38ca61=crypto[_0xaf03('0x15')](_0xaf03('0x11'),config[_0xaf03('0x16')]['session']);var _0xcdc24=_0x38ca61[_0xaf03('0x12')](_0x2d825c,_0xaf03('0x14'),_0xaf03('0x13'));_0xcdc24+=_0x38ca61[_0xaf03('0x17')](_0xaf03('0x13'));return _0xcdc24;}function sendJiraAlert(_0x5cede9,_0x4c6323,_0x1e3508){var _0xe4690a=_0xaf03('0x18');return db[_0xaf03('0x19')][_0xaf03('0x1a')]({'where':{'role':'admin'},'attributes':[_0xaf03('0x1b'),'email'],'raw':!![]})[_0xaf03('0x1c')](function(_0x23f9b7){ADMIN=_0x23f9b7;_0xe4690a+=_0xaf03('0x1d')+_0x1e3508+'|\x0a';_0xe4690a+=_0xaf03('0x1e')+_0x5cede9+'|\x0a';_0xe4690a+=_0xaf03('0x1f')+_0x4c6323+'|\x0a';_0xe4690a+=_0xaf03('0x20')+ADMIN[_0xaf03('0x1b')]+'|\x0a';_0xe4690a+=_0xaf03('0x21')+ADMIN[_0xaf03('0x22')]+'|\x0a';return _0xe4690a;})[_0xaf03('0x1c')](function(_0x1e8cac){var _0x49cb83=hardware[_0xaf03('0x23')]()[_0xaf03('0x24')];return jira[_0xaf03('0x25')]({'key':_0xaf03('0x26'),'summary':'Motion\x20License\x20Alert','description':_0x1e8cac,'issuetype':'Alert','oldToken':_0x5cede9,'newToken':_0x4c6323,'email':ADMIN[_0xaf03('0x22')],'name':ADMIN[_0xaf03('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x49cb83});});}function manageLicense(_0x4db61b,_0x245ad7){var _0xec24e2=_0x245ad7[_0xaf03('0x27')]({'plain':!![]});httpRequest(_0x4db61b)[_0xaf03('0x1c')](function(_0x25115f){if(oldToken){oldToken=undefined;}if(_0x25115f[_0xaf03('0x28')]){if(!_0xec24e2['license']&&_0xec24e2['license']!=_0x25115f[_0xaf03('0x8')]||_0xec24e2[_0xaf03('0x8')]&&_0xec24e2[_0xaf03('0x29')]){logger[_0xaf03('0x2a')](_0xaf03('0x2b'));}if(_0xec24e2[_0xaf03('0x8')]&&!_0xec24e2[_0xaf03('0x29')]&&_0xec24e2[_0xaf03('0x8')]!=_0x25115f[_0xaf03('0x8')]){logger[_0xaf03('0x2a')](_0xaf03('0x2c'));}if(_0xec24e2[_0xaf03('0x8')]&&!_0xec24e2[_0xaf03('0x29')]&&_0xec24e2['license']==_0x25115f[_0xaf03('0x8')]){return _0x245ad7;}return _0x245ad7[_0xaf03('0x12')]({'data1':_0x4db61b,'data2':null,'license':_0x25115f['license']});}else{if(_0x25115f[_0xaf03('0x8')]||_0xec24e2['license']){if(!_0xec24e2[_0xaf03('0x29')]){if(_0xec24e2[_0xaf03('0x2d')]==_0x4db61b){GRAY_PERIOD_REASON=_0xaf03('0x2e');logger[_0xaf03('0x2a')](_0xaf03('0x2f'));}else{GRAY_PERIOD_REASON=_0xaf03('0x30');oldToken=_0xec24e2['data1'];logger[_0xaf03('0x2a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xec24e2[_0xaf03('0x2d')],_0x4db61b);}sendJiraAlert(_0xec24e2[_0xaf03('0x2d')],_0x25115f[_0xaf03('0x31')],GRAY_PERIOD_REASON);logger[_0xaf03('0x2a')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xaf03('0x32')));return _0x245ad7[_0xaf03('0x12')]({'data2':encryptDate(moment()[_0xaf03('0xa')](_0xaf03('0x32')))});}else{if(moment()['diff'](decryptDate(_0xec24e2[_0xaf03('0x29')]),_0xaf03('0x33'))>DAYS){logger[_0xaf03('0x2a')](_0xaf03('0x34'),moment()['format'](_0xaf03('0x32')));return _0x245ad7['update']({'data1':_0x4db61b,'data2':null,'license':null});}}}else{if(_0xec24e2[_0xaf03('0x2d')]!=_0x4db61b){logger[_0xaf03('0x2a')](_0xaf03('0x35'),_0xec24e2[_0xaf03('0x2d')],_0x4db61b);return _0x245ad7[_0xaf03('0x12')]({'data1':_0x4db61b,'data2':null,'license':null});}}}return _0x245ad7;})[_0xaf03('0x1c')](function(_0x3b8398){_0x245ad7=_0x3b8398;})[_0xaf03('0xf')](function(_0x157d76){logger['error'](_0x157d76[_0xaf03('0x36')]);})[_0xaf03('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0xaf03('0x38')](),_0x245ad7);},TIME);});}function defaultLicense(){var _0x3332cb=hardware[_0xaf03('0x38')]();if(_0x3332cb){return db['License'][_0xaf03('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x3332cb}})['spread'](function(_0xe5df11,_0x477b31){logger[_0xaf03('0x2a')](_0xaf03('0x3a'),_0x3332cb);manageLicense(_0x3332cb,_0xe5df11);})['catch'](function(_0x2d4e2c){logger[_0xaf03('0x3b')](_0x2d4e2c[_0xaf03('0x36')]);});}}exports[_0xaf03('0x3c')]=defaultLicense; \ No newline at end of file +var _0xbd0a=['error','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','version','../../mysqldb','../environment','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','createCipher','secrets','update','createDecipher','aes-256-ctr','session','base64','final','||FIELD||VALUE||\x0a','findOne','admin','then','|uuid|','|machineUuid|','|name|','fullname','email','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','data1','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s'];(function(_0x3a3c3d,_0x3b8542){var _0xf3142f=function(_0x479bb0){while(--_0x479bb0){_0x3a3c3d['push'](_0x3a3c3d['shift']());}};_0xf3142f(++_0x3b8542);}(_0xbd0a,0x1b9));var _0xabd0=function(_0x166fcc,_0x2065e9){_0x166fcc=_0x166fcc-0x0;var _0x21c257=_0xbd0a[_0x166fcc];return _0x21c257;};'use strict';var util=require(_0xabd0('0x0'));var crypto=require('crypto');var moment=require(_0xabd0('0x1'));var rp=require('request-promise');var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xabd0('0x2'));var db=require(_0xabd0('0x3'))['db'];var config=require(_0xabd0('0x4'));var hardware=require(_0xabd0('0x5'));var logger=require(_0xabd0('0x6'))(_0xabd0('0x7'));var jira=require(_0xabd0('0x8'));var HOST=_0xabd0('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0xe18a18){return new BPromise(function(_0x4ac4ad,_0xf44097){var _0xb60e77=util[_0xabd0('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0xe18a18,module[_0xabd0('0xb')]['version']);if(oldToken){_0xb60e77=util[_0xabd0('0xa')](_0xabd0('0xc'),HOST,_0xe18a18,module[_0xabd0('0xb')][_0xabd0('0x2')],oldToken);}var _0x50fc2d={'uri':_0xb60e77,'method':_0xabd0('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x50fc2d)['then'](function(_0x1b78e2){_0x4ac4ad(_0x1b78e2);})[_0xabd0('0xe')](function(_0x1ad151){_0xf44097(_0x1ad151);});});}function encryptDate(_0x14a91b){var _0x3bf33=crypto[_0xabd0('0xf')]('aes-256-ctr',config[_0xabd0('0x10')]['session']);var _0x3586cf=_0x3bf33[_0xabd0('0x11')](_0x14a91b,'utf8','base64');_0x3586cf+=_0x3bf33['final']('base64');return _0x3586cf;}function decryptDate(_0x679d0b){var _0x26d8fd=crypto[_0xabd0('0x12')](_0xabd0('0x13'),config[_0xabd0('0x10')][_0xabd0('0x14')]);var _0x389e1e=_0x26d8fd[_0xabd0('0x11')](_0x679d0b,_0xabd0('0x15'),'utf8');_0x389e1e+=_0x26d8fd[_0xabd0('0x16')]('utf8');return _0x389e1e;}function sendJiraAlert(_0x579dcd,_0x2bbc18,_0x391988){var _0x3c5886=_0xabd0('0x17');return db['User'][_0xabd0('0x18')]({'where':{'role':_0xabd0('0x19')},'attributes':['fullname','email'],'raw':!![]})[_0xabd0('0x1a')](function(_0x29a6f0){ADMIN=_0x29a6f0;_0x3c5886+='|reason|'+_0x391988+'|\x0a';_0x3c5886+=_0xabd0('0x1b')+_0x579dcd+'|\x0a';_0x3c5886+=_0xabd0('0x1c')+_0x2bbc18+'|\x0a';_0x3c5886+=_0xabd0('0x1d')+ADMIN[_0xabd0('0x1e')]+'|\x0a';_0x3c5886+='|email|'+ADMIN[_0xabd0('0x1f')]+'|\x0a';return _0x3c5886;})[_0xabd0('0x1a')](function(_0x3376bc){var _0x462420=hardware[_0xabd0('0x20')]()[_0xabd0('0x21')];return jira[_0xabd0('0x22')]({'key':_0xabd0('0x23'),'summary':_0xabd0('0x24'),'description':_0x3376bc,'issuetype':_0xabd0('0x25'),'oldToken':_0x579dcd,'newToken':_0x2bbc18,'email':ADMIN['email'],'name':ADMIN[_0xabd0('0x1e')],'reason':GRAY_PERIOD_REASON,'ip':_0x462420});});}function manageLicense(_0x2699c4,_0x30739e){var _0x3e0dd2=_0x30739e[_0xabd0('0x26')]({'plain':!![]});httpRequest(_0x2699c4)[_0xabd0('0x1a')](function(_0x2be0a1){if(oldToken){oldToken=undefined;}if(_0x2be0a1[_0xabd0('0x27')]){if(!_0x3e0dd2[_0xabd0('0x7')]&&_0x3e0dd2[_0xabd0('0x7')]!=_0x2be0a1[_0xabd0('0x7')]||_0x3e0dd2[_0xabd0('0x7')]&&_0x3e0dd2[_0xabd0('0x28')]){logger[_0xabd0('0x29')](_0xabd0('0x2a'));}if(_0x3e0dd2[_0xabd0('0x7')]&&!_0x3e0dd2['data2']&&_0x3e0dd2[_0xabd0('0x7')]!=_0x2be0a1[_0xabd0('0x7')]){logger[_0xabd0('0x29')](_0xabd0('0x2b'));}if(_0x3e0dd2['license']&&!_0x3e0dd2[_0xabd0('0x28')]&&_0x3e0dd2[_0xabd0('0x7')]==_0x2be0a1[_0xabd0('0x7')]){return _0x30739e;}return _0x30739e['update']({'data1':_0x2699c4,'data2':null,'license':_0x2be0a1[_0xabd0('0x7')]});}else{if(_0x2be0a1[_0xabd0('0x7')]||_0x3e0dd2['license']){if(!_0x3e0dd2[_0xabd0('0x28')]){if(_0x3e0dd2['data1']==_0x2699c4){GRAY_PERIOD_REASON=_0xabd0('0x2c');logger[_0xabd0('0x29')](_0xabd0('0x2d'));}else{GRAY_PERIOD_REASON=_0xabd0('0x2e');oldToken=_0x3e0dd2[_0xabd0('0x2f')];logger[_0xabd0('0x29')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3e0dd2[_0xabd0('0x2f')],_0x2699c4);}sendJiraAlert(_0x3e0dd2[_0xabd0('0x2f')],_0x2be0a1[_0xabd0('0x30')],GRAY_PERIOD_REASON);logger[_0xabd0('0x29')](_0xabd0('0x31'),GRAY_PERIOD_REASON[_0xabd0('0x32')](),moment()[_0xabd0('0xa')](_0xabd0('0x33')));return _0x30739e[_0xabd0('0x11')]({'data2':encryptDate(moment()[_0xabd0('0xa')](_0xabd0('0x33')))});}else{if(moment()[_0xabd0('0x34')](decryptDate(_0x3e0dd2[_0xabd0('0x28')]),_0xabd0('0x35'))>DAYS){logger[_0xabd0('0x29')]('DEMO\x20START\x20AT\x20%s',moment()['format']('YYYY-MM-DD\x20HH:mm'));return _0x30739e[_0xabd0('0x11')]({'data1':_0x2699c4,'data2':null,'license':null});}}}else{if(_0x3e0dd2[_0xabd0('0x2f')]!=_0x2699c4){logger[_0xabd0('0x29')](_0xabd0('0x36'),_0x3e0dd2[_0xabd0('0x2f')],_0x2699c4);return _0x30739e['update']({'data1':_0x2699c4,'data2':null,'license':null});}}}return _0x30739e;})['then'](function(_0x4d11bc){_0x30739e=_0x4d11bc;})[_0xabd0('0xe')](function(_0x4ccffa){logger[_0xabd0('0x37')](_0x4ccffa[_0xabd0('0x38')]);})[_0xabd0('0x39')](function(){setTimeout(function(){manageLicense(hardware[_0xabd0('0x3a')](),_0x30739e);},TIME);});}function defaultLicense(){var _0x316cff=hardware[_0xabd0('0x3a')]();if(_0x316cff){return db[_0xabd0('0x3b')][_0xabd0('0x3c')]({'where':{'id':0x1},'defaults':{'data1':_0x316cff}})['spread'](function(_0x4732d5,_0x592de0){logger['info'](_0xabd0('0x3d'),_0x316cff);manageLicense(_0x316cff,_0x4732d5);})[_0xabd0('0xe')](function(_0xea7d59){logger[_0xabd0('0x37')](_0xea7d59[_0xabd0('0x38')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 98edaa4..01b64be 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 _0x2b7c=['session','final','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','Breaking\x20license','data1','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','defaults','then','checkLicense','crypto','util','lodash','./hardware','../environment','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','uuid','getUuid'];(function(_0x13aa21,_0x504ec8){var _0x1deac3=function(_0x2f2437){while(--_0x2f2437){_0x13aa21['push'](_0x13aa21['shift']());}};_0x1deac3(++_0x504ec8);}(_0x2b7c,0x1e8));var _0xc2b7=function(_0x45b82c,_0x355863){_0x45b82c=_0x45b82c-0x0;var _0x49ed33=_0x2b7c[_0x45b82c];return _0x49ed33;};'use strict';var crypto=require(_0xc2b7('0x0'));var util=require(_0xc2b7('0x1'));var _=require(_0xc2b7('0x2'));var moment=require('moment');var hardware=require(_0xc2b7('0x3'));var config=require(_0xc2b7('0x4'));var db=require(_0xc2b7('0x5'))['db'];function checkLicense(_0x20885b,_0x2533eb){if(_0x20885b){try{var _0x52fad1=_0x2533eb||_0x20885b['license'];if(_[_0xc2b7('0x6')](_0x52fad1)){throw new Error(_0xc2b7('0x7'));}var _0x326e76=_0x20885b['data1'];var _0x2f430a=_0x20885b['data2'];var _0x165a73=_0x326e76[_0xc2b7('0x8')]('-')[0x4];var _0x37c65e=_0x326e76[_0xc2b7('0x8')]('-')[0x0];var _0xe6019d=crypto[_0xc2b7('0x9')](_0xc2b7('0xa'),util[_0xc2b7('0xb')](_0xc2b7('0xc'),_0x165a73,_0x326e76,_0x37c65e));var _0x4016e8=_0xe6019d[_0xc2b7('0xd')](_0x52fad1,_0xc2b7('0xe'),_0xc2b7('0xf'));_0x4016e8+=_0xe6019d['final'](_0xc2b7('0xf'));var _0x295aa6=JSON[_0xc2b7('0x10')](_0x4016e8);_0x295aa6['demo']=![];_0x295aa6[_0xc2b7('0x11')]=_0x326e76;_0x295aa6['machineUuid']=hardware[_0xc2b7('0x12')]();if(_0x2f430a){var _0x1d7177=crypto[_0xc2b7('0x9')](_0xc2b7('0xa'),config['secrets'][_0xc2b7('0x13')]);var _0x3858cc=_0x1d7177['update'](_0x2f430a,_0xc2b7('0xe'),_0xc2b7('0xf'));_0x3858cc+=_0x1d7177[_0xc2b7('0x14')](_0xc2b7('0xf'));_0x295aa6[_0xc2b7('0x15')]=_0x3858cc;_0x295aa6[_0xc2b7('0x16')]=moment(_0x3858cc)[_0xc2b7('0x17')](0x7,_0xc2b7('0x18'))[_0xc2b7('0xb')]();_0x295aa6[_0xc2b7('0x19')]=_0x295aa6[_0xc2b7('0x11')]!=_0x295aa6[_0xc2b7('0x1a')]?_0xc2b7('0x1b'):_0xc2b7('0x1c');}return _0x295aa6;}catch(_0x455cf0){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc2b7('0x1d'),'uuid':_0x20885b[_0xc2b7('0x1e')],'machineUuid':hardware['getUuid'](),'message':_0x455cf0[_0xc2b7('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc2b7('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc2b7('0x21'),'uuid':_0x20885b['data1'],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xc2b7('0x22')]=function(_0x583ceb){return db[_0xc2b7('0x23')]['find'](_[_0xc2b7('0x24')](_0x583ceb,{'raw':!![],'where':{'id':0x1}}))[_0xc2b7('0x25')](function(_0xe66307){return checkLicense(_0xe66307,null);});};exports[_0xc2b7('0x26')]=checkLicense; \ No newline at end of file +var _0x52bd=['grayReason','changed','2027-01-01T00:00:00.000Z','Breaking\x20license','Demo\x20license','getLicense','find','defaults','then','crypto','util','moment','../environment','../../mysqldb','license','isEmpty','data1','split','createDecipher','format','%s:%s:%s','update','base64','utf8','parse','uuid','machineUuid','getUuid','aes-256-ctr','secrets','session','gray','deadline','add'];(function(_0x1d49b8,_0x3b18af){var _0x59c258=function(_0x4443f5){while(--_0x4443f5){_0x1d49b8['push'](_0x1d49b8['shift']());}};_0x59c258(++_0x3b18af);}(_0x52bd,0xb3));var _0xd52b=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x52bd[_0xa1e3e3];return _0xc980e9;};'use strict';var crypto=require(_0xd52b('0x0'));var util=require(_0xd52b('0x1'));var _=require('lodash');var moment=require(_0xd52b('0x2'));var hardware=require('./hardware');var config=require(_0xd52b('0x3'));var db=require(_0xd52b('0x4'))['db'];function checkLicense(_0x314a9d,_0x3757da){if(_0x314a9d){try{var _0x2c1a86=_0x3757da||_0x314a9d[_0xd52b('0x5')];if(_[_0xd52b('0x6')](_0x2c1a86)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x2f715b=_0x314a9d[_0xd52b('0x7')];var _0x40dc94=_0x314a9d['data2'];var _0x3530ff=_0x2f715b[_0xd52b('0x8')]('-')[0x4];var _0x107ef5=_0x2f715b[_0xd52b('0x8')]('-')[0x0];var _0x5562e1=crypto[_0xd52b('0x9')]('aes-256-ctr',util[_0xd52b('0xa')](_0xd52b('0xb'),_0x3530ff,_0x2f715b,_0x107ef5));var _0x193890=_0x5562e1[_0xd52b('0xc')](_0x2c1a86,_0xd52b('0xd'),_0xd52b('0xe'));_0x193890+=_0x5562e1['final'](_0xd52b('0xe'));var _0x69140a=JSON[_0xd52b('0xf')](_0x193890);_0x69140a['demo']=![];_0x69140a[_0xd52b('0x10')]=_0x2f715b;_0x69140a[_0xd52b('0x11')]=hardware[_0xd52b('0x12')]();if(_0x40dc94){var _0x3575db=crypto['createDecipher'](_0xd52b('0x13'),config[_0xd52b('0x14')][_0xd52b('0x15')]);var _0xf981f1=_0x3575db['update'](_0x40dc94,_0xd52b('0xd'),_0xd52b('0xe'));_0xf981f1+=_0x3575db['final'](_0xd52b('0xe'));_0x69140a[_0xd52b('0x16')]=_0xf981f1;_0x69140a[_0xd52b('0x17')]=moment(_0xf981f1)[_0xd52b('0x18')](0x7,'days')['format']();_0x69140a[_0xd52b('0x19')]=_0x69140a[_0xd52b('0x10')]!=_0x69140a[_0xd52b('0x11')]?_0xd52b('0x1a'):'disabled';}return _0x69140a;}catch(_0x4ca180){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd52b('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xd52b('0x1c'),'uuid':_0x314a9d[_0xd52b('0x7')],'machineUuid':hardware[_0xd52b('0x12')](),'message':_0x4ca180['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd52b('0x1d'),'uuid':_0x314a9d[_0xd52b('0x7')],'machineUuid':hardware[_0xd52b('0x12')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xd52b('0x1e')]=function(_0x19e664){return db['License'][_0xd52b('0x1f')](_[_0xd52b('0x20')](_0x19e664,{'raw':!![],'where':{'id':0x1}}))[_0xd52b('0x21')](function(_0x65d6fa){return checkLicense(_0x65d6fa,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 710fd23..658dc4f 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 _0x793b=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x793b,0x189));var _0xb793=function(_0x3065c7,_0xf6b6dc){_0x3065c7=_0x3065c7-0x0;var _0x114385=_0x793b[_0x3065c7];return _0x114385;};'use strict';module[_0xb793('0x0')]={'DOMAIN':_0xb793('0x1'),'SESSION_SECRET':_0xb793('0x2'),'GOOGLE_ID':_0xb793('0x3'),'GOOGLE_SECRET':_0xb793('0x4'),'DEBUG':''}; \ No newline at end of file +var _0xc859=['myappanuglar-secret','app-id','secret','http://localhost:9000'];(function(_0x333fc8,_0x2b292c){var _0x432439=function(_0x5501b6){while(--_0x5501b6){_0x333fc8['push'](_0x333fc8['shift']());}};_0x432439(++_0x2b292c);}(_0xc859,0x17b));var _0x9c85=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xc859[_0x54d4fe];return _0x1ab5bb;};'use strict';module['exports']={'DOMAIN':_0x9c85('0x0'),'SESSION_SECRET':_0x9c85('0x1'),'GOOGLE_ID':_0x9c85('0x2'),'GOOGLE_SECRET':_0x9c85('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index b9d19f8..5926c83 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b36=['xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','message','exports','Logger','transports','%s-%s','error','File','info','Console','debugLevel','moment','winston','util','path','join','/var'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b36,0x1ee));var _0x63b3=function(_0x532924,_0x4d337a){_0x532924=_0x532924-0x0;var _0x5ae118=_0x3b36[_0x532924];return _0x5ae118;};'use strict';var moment=require(_0x63b3('0x0'));var winston=require(_0x63b3('0x1'));var util=require(_0x63b3('0x2'));var path=require(_0x63b3('0x3'));var debugLevel='INFO';function filename(_0x53f2bb,_0x11e8f3){return path[_0x63b3('0x4')](_0x63b3('0x5'),'log',_0x63b3('0x6'),util['format']('%s-%s.log',_0x53f2bb,_0x11e8f3));}function formatter(_0x401b59,_0x264013){return util[_0x63b3('0x7')](_0x63b3('0x8'),moment()[_0x63b3('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x264013[_0x63b3('0x9')]['toUpperCase'](),_0x401b59,_0x264013[_0x63b3('0xa')]);}module[_0x63b3('0xb')]=function(_0x5242e9){return new winston[(_0x63b3('0xc'))]({'transports':[new winston[(_0x63b3('0xd'))]['File']({'name':util[_0x63b3('0x7')](_0x63b3('0xe'),_0x5242e9,'error'),'filename':filename(_0x5242e9,_0x63b3('0xf')),'level':_0x63b3('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10311d){return formatter(_0x5242e9,_0x10311d);}}),new winston['transports'][(_0x63b3('0x10'))]({'name':util[_0x63b3('0x7')](_0x63b3('0xe'),_0x5242e9,_0x63b3('0x11')),'filename':filename(_0x5242e9,_0x63b3('0x11')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x158c42){return formatter(_0x5242e9,_0x158c42);}}),new winston['transports'][(_0x63b3('0x12'))]({'level':process['env'][_0x63b3('0x13')]||debugLevel,'json':![],'formatter':function(_0x31b452){return formatter(_0x5242e9,_0x31b452);}})]});}; \ No newline at end of file +var _0x9412=['error','%s-%s','info','Console','env','moment','winston','util','path','INFO','log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','message','Logger','transports','File'];(function(_0x2f7e15,_0x6e0949){var _0xbf1bf1=function(_0x538ea3){while(--_0x538ea3){_0x2f7e15['push'](_0x2f7e15['shift']());}};_0xbf1bf1(++_0x6e0949);}(_0x9412,0x1e0));var _0x2941=function(_0x29c50a,_0x30dcd2){_0x29c50a=_0x29c50a-0x0;var _0x162737=_0x9412[_0x29c50a];return _0x162737;};'use strict';var moment=require(_0x2941('0x0'));var winston=require(_0x2941('0x1'));var util=require(_0x2941('0x2'));var path=require(_0x2941('0x3'));var debugLevel=_0x2941('0x4');function filename(_0x5536d8,_0xe351c1){return path['join']('/var',_0x2941('0x5'),'xcally',util[_0x2941('0x6')]('%s-%s.log',_0x5536d8,_0xe351c1));}function formatter(_0x34e163,_0x14f110){return util[_0x2941('0x6')](_0x2941('0x7'),moment()[_0x2941('0x6')](_0x2941('0x8')),_0x14f110[_0x2941('0x9')]['toUpperCase'](),_0x34e163,_0x14f110[_0x2941('0xa')]);}module['exports']=function(_0x1e6da9){return new winston[(_0x2941('0xb'))]({'transports':[new winston[(_0x2941('0xc'))][(_0x2941('0xd'))]({'name':util['format']('%s-%s',_0x1e6da9,_0x2941('0xe')),'filename':filename(_0x1e6da9,_0x2941('0xe')),'level':_0x2941('0xe'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3bcd1b){return formatter(_0x1e6da9,_0x3bcd1b);}}),new winston[(_0x2941('0xc'))][(_0x2941('0xd'))]({'name':util[_0x2941('0x6')](_0x2941('0xf'),_0x1e6da9,_0x2941('0x10')),'filename':filename(_0x1e6da9,_0x2941('0x10')),'level':_0x2941('0x10'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5552ee){return formatter(_0x1e6da9,_0x5552ee);}}),new winston['transports'][(_0x2941('0x11'))]({'level':process[_0x2941('0x12')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0xdbaa6a){return formatter(_0x1e6da9,_0xdbaa6a);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 51cf1ae..0a7ff7e 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 _0xf0a4=['xdr','../../services/xdr/index.js','../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js'];(function(_0xb31aab,_0x5c6059){var _0xbd9146=function(_0x1ae8a8){while(--_0x1ae8a8){_0xb31aab['push'](_0xb31aab['shift']());}};_0xbd9146(++_0x5c6059);}(_0xf0a4,0x1c4));var _0x4f0a=function(_0x3cbee3,_0x19d02f){_0x3cbee3=_0x3cbee3-0x0;var _0x42cd84=_0xf0a4[_0x3cbee3];return _0x42cd84;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x4f0a('0x0'))},{'name':_0x4f0a('0x1'),'script':path[_0x4f0a('0x2')](__dirname,_0x4f0a('0x3'))},{'name':_0x4f0a('0x4'),'script':path['join'](__dirname,_0x4f0a('0x5'))},{'name':'email','script':path[_0x4f0a('0x2')](__dirname,_0x4f0a('0x6'))},{'name':'routing','script':path[_0x4f0a('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x4f0a('0x7'),'script':path['join'](__dirname,_0x4f0a('0x8'))}]};module['exports']=config; \ No newline at end of file +var _0x707d=['exports','express','join','../../services/express/index.js','ami','../../services/agi/index.js','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js'];(function(_0x261d71,_0x38163a){var _0x1f6db9=function(_0x19f36b){while(--_0x19f36b){_0x261d71['push'](_0x261d71['shift']());}};_0x1f6db9(++_0x38163a);}(_0x707d,0x12d));var _0xd707=function(_0xbba459,_0x17f354){_0xbba459=_0xbba459-0x0;var _0x4b5831=_0x707d[_0xbba459];return _0x4b5831;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xd707('0x0'),'script':path[_0xd707('0x1')](__dirname,_0xd707('0x2'))},{'name':_0xd707('0x3'),'script':path['join'](__dirname,'../../services/ami/index.js')},{'name':'agi','script':path[_0xd707('0x1')](__dirname,_0xd707('0x4'))},{'name':'email','script':path[_0xd707('0x1')](__dirname,_0xd707('0x5'))},{'name':_0xd707('0x6'),'script':path['join'](__dirname,_0xd707('0x7'))},{'name':'xdr','script':path['join'](__dirname,_0xd707('0x8'))}]};module[_0xd707('0x9')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7753b77..8e6b163 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 _0x09da=['connected','then','start','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connect'];(function(_0x288aca,_0x5cf0a2){var _0x33dda2=function(_0xc779da){while(--_0xc779da){_0x288aca['push'](_0x288aca['shift']());}};_0x33dda2(++_0x5cf0a2);}(_0x09da,0xf4));var _0xa09d=function(_0x208dd6,_0x5692bc){_0x208dd6=_0x208dd6-0x0;var _0x23b269=_0x09da[_0x208dd6];return _0x23b269;};'use strict';var pm2=require('pm2');var BPromise=require(_0xa09d('0x0'));var config=require(_0xa09d('0x1'));function connect(){return new BPromise(function(_0x14b512,_0x3f871b){return pm2[_0xa09d('0x2')](function(_0x1e4d24){if(_0x1e4d24){return _0x3f871b(_0x1e4d24);}return _0x14b512(_0xa09d('0x3'));});});};exports['start']=function(_0x2a4f75){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x514e1e,_0x45cf7e){return pm2[_0xa09d('0x5')](_0x2a4f75,function(_0x3019ef,_0x3fa6d8){if(_0x3019ef){return _0x45cf7e(_0x3019ef);}pm2['disconnect']();return _0x514e1e(_0x3fa6d8);});});});};exports['stop']=function(_0x3ce547){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x53b24d,_0x2989ce){return pm2['stop'](_0x3ce547,function(_0x1626e0,_0x11b37c){if(_0x1626e0){return _0x2989ce(_0x1626e0);}pm2[_0xa09d('0x6')]();return _0x53b24d(_0x11b37c);});});});};exports[_0xa09d('0x7')]=function(_0x39e8ee){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x14dab8,_0x4fe3b8){return pm2[_0xa09d('0x7')](_0x39e8ee,function(_0x1b082c,_0x4552d9){if(_0x1b082c){return _0x4fe3b8(_0x1b082c);}pm2[_0xa09d('0x6')]();return _0x14dab8(_0x4552d9);});});});};exports['list']=function(){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x3cde94,_0x5a941d){return pm2[_0xa09d('0x8')](function(_0x468a5a,_0x19481e){if(_0x468a5a){return _0x5a941d(_0x468a5a);}pm2['disconnect']();return _0x3cde94(_0x19481e);});});});};exports['describe']=function(_0x550463){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x13d0e6,_0x294eb1){return pm2[_0xa09d('0x9')](_0x550463,function(_0x5540d2,_0x4c0fc9){if(_0x5540d2){return _0x294eb1(_0x5540d2);}pm2[_0xa09d('0x6')]();return _0x13d0e6(_0x4c0fc9);});});});};exports[_0xa09d('0xa')]=function(_0x194899){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x7a8c07,_0x5a6754){return pm2[_0xa09d('0xa')](_0x194899,function(_0x968da7,_0x300788){if(_0x968da7){return _0x5a6754(_0x968da7);}pm2[_0xa09d('0x6')]();return _0x7a8c07(_0x300788);});});});};exports[_0xa09d('0xb')]=function(){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x4414d7,_0x27f5b0){return pm2[_0xa09d('0xb')](function(_0x3d34ed){if(_0x3d34ed){return _0x27f5b0(_0x3d34ed);}return _0x4414d7(_0xa09d('0xc'));});});});}; \ No newline at end of file +var _0x0845=['stop','restart','list','describe','delete','dump','saved','pm2','connect','connected','start','then','disconnect'];(function(_0x146517,_0x5881b9){var _0x430190=function(_0x34b30b){while(--_0x34b30b){_0x146517['push'](_0x146517['shift']());}};_0x430190(++_0x5881b9);}(_0x0845,0x125));var _0x5084=function(_0x28ce70,_0x25e62b){_0x28ce70=_0x28ce70-0x0;var _0x54c7ba=_0x0845[_0x28ce70];return _0x54c7ba;};'use strict';var pm2=require(_0x5084('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x29719a,_0x321a97){return pm2[_0x5084('0x1')](function(_0x5954ea){if(_0x5954ea){return _0x321a97(_0x5954ea);}return _0x29719a(_0x5084('0x2'));});});};exports[_0x5084('0x3')]=function(_0x4ec3e3){return connect()[_0x5084('0x4')](function(){return new BPromise(function(_0x15b9e4,_0x28f869){return pm2['start'](_0x4ec3e3,function(_0x5f3d8f,_0x5a999b){if(_0x5f3d8f){return _0x28f869(_0x5f3d8f);}pm2[_0x5084('0x5')]();return _0x15b9e4(_0x5a999b);});});});};exports[_0x5084('0x6')]=function(_0x14e571){return connect()['then'](function(){return new BPromise(function(_0x4fc992,_0xbbddf0){return pm2[_0x5084('0x6')](_0x14e571,function(_0x10b6e2,_0x5cdf85){if(_0x10b6e2){return _0xbbddf0(_0x10b6e2);}pm2[_0x5084('0x5')]();return _0x4fc992(_0x5cdf85);});});});};exports[_0x5084('0x7')]=function(_0x36b4c9){return connect()['then'](function(){return new BPromise(function(_0x4ad743,_0x1d650c){return pm2[_0x5084('0x7')](_0x36b4c9,function(_0x3482c3,_0x1bc737){if(_0x3482c3){return _0x1d650c(_0x3482c3);}pm2[_0x5084('0x5')]();return _0x4ad743(_0x1bc737);});});});};exports[_0x5084('0x8')]=function(){return connect()[_0x5084('0x4')](function(){return new BPromise(function(_0x168211,_0x5ecae8){return pm2[_0x5084('0x8')](function(_0x2b92d9,_0x3c48e5){if(_0x2b92d9){return _0x5ecae8(_0x2b92d9);}pm2['disconnect']();return _0x168211(_0x3c48e5);});});});};exports[_0x5084('0x9')]=function(_0xd4ff23){return connect()[_0x5084('0x4')](function(){return new BPromise(function(_0x263642,_0x4918e2){return pm2[_0x5084('0x9')](_0xd4ff23,function(_0x5a6c06,_0x326ca0){if(_0x5a6c06){return _0x4918e2(_0x5a6c06);}pm2[_0x5084('0x5')]();return _0x263642(_0x326ca0);});});});};exports[_0x5084('0xa')]=function(_0x5a3909){return connect()[_0x5084('0x4')](function(){return new BPromise(function(_0x425c46,_0x369fb5){return pm2[_0x5084('0xa')](_0x5a3909,function(_0x13e504,_0x20cdf4){if(_0x13e504){return _0x369fb5(_0x13e504);}pm2[_0x5084('0x5')]();return _0x425c46(_0x20cdf4);});});});};exports[_0x5084('0xb')]=function(){return connect()[_0x5084('0x4')](function(){return new BPromise(function(_0x76ce60,_0x146e22){return pm2[_0x5084('0xb')](function(_0xa92a15){if(_0xa92a15){return _0x146e22(_0xa92a15);}return _0x76ce60(_0x5084('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index f449fc5..fd4e76f 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 _0xf575=['map','length','emit','chatInteraction:update','catch','start','lodash','../../mysqldb','../../config/environment','redis','defaults','socket.io-emitter','Setting','find','ChatInteraction','lastMsgAt','subtract','chatTimeout','then','update','system','format'];(function(_0x79aa02,_0x124f80){var _0x341211=function(_0x245428){while(--_0x245428){_0x79aa02['push'](_0x79aa02['shift']());}};_0x341211(++_0x124f80);}(_0xf575,0x17c));var _0x5f57=function(_0x2b587a,_0x1ef432){_0x2b587a=_0x2b587a-0x0;var _0x28378a=_0xf575[_0x2b587a];return _0x28378a;};'use strict';var _=require(_0x5f57('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require(_0x5f57('0x1'))['db'];var config=require(_0x5f57('0x2'));config[_0x5f57('0x3')]=_[_0x5f57('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5f57('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x28ac3f=0x0;var _0x47ba09=[];return db[_0x5f57('0x6')][_0x5f57('0x7')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x1496bb){_0x28ac3f=_0x1496bb['chatTimeout'];if(_0x28ac3f){return db[_0x5f57('0x8')]['findAll']({'raw':!![],'attributes':['id',_0x5f57('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5f57('0xa')](_0x1496bb[_0x5f57('0xb')],'minutes')}}});}else{return[];}})[_0x5f57('0xc')](function(_0x5b9fdb){_0x47ba09=_0x5b9fdb;if(_0x28ac3f){return db[_0x5f57('0x8')][_0x5f57('0xd')]({'closeReason':_0x5f57('0xe'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x5f57('0xf')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0x5f57('0x10')](_0x47ba09||[],'id')}});}})[_0x5f57('0xc')](function(_0x1349b7){for(var _0x9d8e6e=0x0;_0x9d8e6e<_0x47ba09[_0x5f57('0x11')];_0x9d8e6e++){io[_0x5f57('0x12')](_0x5f57('0x13'),{'id':_0x47ba09[_0x9d8e6e]['id'],'closed':!![]});}})[_0x5f57('0x14')](function(_0x30b464){console['error'](_0x30b464);});}exports[_0x5f57('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc745=['moment','ioredis','../../mysqldb','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map','length','chatInteraction:update','catch','error','start','lodash'];(function(_0xf2bc13,_0x18e3bf){var _0x487df8=function(_0xb694a0){while(--_0xb694a0){_0xf2bc13['push'](_0xf2bc13['shift']());}};_0x487df8(++_0x18e3bf);}(_0xc745,0x11d));var _0x5c74=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc745[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x5c74('0x0'));var moment=require(_0x5c74('0x1'));var Redis=require(_0x5c74('0x2'));var db=require(_0x5c74('0x3'))['db'];var config=require('../../config/environment');config[_0x5c74('0x4')]=_[_0x5c74('0x5')](config[_0x5c74('0x4')],{'host':_0x5c74('0x6'),'port':0x18eb});var io=require(_0x5c74('0x7'))(new Redis(config[_0x5c74('0x4')]));function closeInteractions(){var _0x3b6f01=0x0;var _0x491418=[];return db['Setting'][_0x5c74('0x8')]({'raw':!![],'attributes':['id',_0x5c74('0x9')],'where':{'id':0x1}})[_0x5c74('0xa')](function(_0x42a2e1){_0x3b6f01=_0x42a2e1['chatTimeout'];if(_0x3b6f01){return db[_0x5c74('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x5c74('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5c74('0xd')](_0x42a2e1[_0x5c74('0x9')],_0x5c74('0xe'))}}});}else{return[];}})['then'](function(_0x266634){_0x491418=_0x266634;if(_0x3b6f01){return db['ChatInteraction'][_0x5c74('0xf')]({'closeReason':_0x5c74('0x10'),'disposition':_0x5c74('0x11'),'closed':!![],'closedAt':moment()[_0x5c74('0x12')](_0x5c74('0x13'))},{'where':{'id':_[_0x5c74('0x14')](_0x491418||[],'id')}});}})[_0x5c74('0xa')](function(_0x4091c1){for(var _0x106917=0x0;_0x106917<_0x491418[_0x5c74('0x15')];_0x106917++){io['emit'](_0x5c74('0x16'),{'id':_0x491418[_0x106917]['id'],'closed':!![]});}})[_0x5c74('0x17')](function(_0x4d6609){console[_0x5c74('0x18')](_0x4d6609);});}exports[_0x5c74('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 4eaced3..4a0fb03 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 _0x96fd=['isBetween','startAt','add','start','add\x20cron','stop\x20cron','endAt','update','update\x20cron','catch','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','status','Sent','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','data','isNil','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron'];(function(_0x1bad0e,_0x52ce5c){var _0x970cd5=function(_0x2ce74c){while(--_0x2ce74c){_0x1bad0e['push'](_0x1bad0e['shift']());}};_0x970cd5(++_0x52ce5c);}(_0x96fd,0x65));var _0xd96f=function(_0x1402bc,_0x3755cf){_0x1402bc=_0x1402bc-0x0;var _0x32bd61=_0x96fd[_0x1402bc];return _0x32bd61;};'use strict';var fs=require('fs');var util=require(_0xd96f('0x0'));var path=require(_0xd96f('0x1'));var _=require(_0xd96f('0x2'));var moment=require(_0xd96f('0x3'));var CronJobManager=require(_0xd96f('0x4'));var jayson=require(_0xd96f('0x5'));var BPromise=require(_0xd96f('0x6'));var logger=require(_0xd96f('0x7'))(_0xd96f('0x8'));var db=require(_0xd96f('0x9'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xd96f('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26769d,_0x5c8ed4){return function(){logger['info'](_0xd96f('0xb'),_0x26769d[_0xd96f('0xc')]);var _0x40fc9d=!![];var _0x19e56c={'tls':{'rejectUnauthorized':![]}};if(_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0xf')]){_0x19e56c[_0xd96f('0xf')]=_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0xf')];}else{_0x19e56c[_0xd96f('0x10')]=_0x26769d['MailAccount'][_0xd96f('0xe')][_0xd96f('0x10')];_0x19e56c[_0xd96f('0x11')]=_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x11')];_0x19e56c[_0xd96f('0x12')]=_0x26769d['MailAccount'][_0xd96f('0xe')][_0xd96f('0x12')];}if(_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x13')]){_0x19e56c['auth']={'user':_0x26769d['MailAccount'][_0xd96f('0xe')]['user'],'pass':_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x14')]};}var _0x332db4={'account':_0x19e56c,'message':{'from':util[_0xd96f('0x15')](_0xd96f('0x16'),_0x26769d[_0xd96f('0xd')][_0xd96f('0x17')],_0x26769d['MailAccount'][_0xd96f('0xc')]||_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x18')]),'to':_0x26769d['email'],'cc':_0x26769d['cc'],'bcc':_0x26769d[_0xd96f('0x19')],'subject':util[_0xd96f('0x15')](_0xd96f('0x1a'),_0x5c8ed4[_0xd96f('0x17')],_0x26769d[_0xd96f('0x1b')],_0x26769d['subtractUnit'])}};var _0x5e63a7=path[_0xd96f('0x1c')](__dirname,_0xd96f('0x1d'));var _0x2d4427=_0x5c8ed4[_0xd96f('0x1e')];var _0x525ad2=util[_0xd96f('0x15')](_0xd96f('0x1f'),path[_0xd96f('0x20')](_0x5c8ed4['savename'],path['extname'](_0x5c8ed4[_0xd96f('0x1e')])),_0xd96f('0x21'));var _0x3c6ea5=path[_0xd96f('0x1c')](_0x5e63a7,_0x2d4427);var _0x364bec=path[_0xd96f('0x1c')](_0x5e63a7,_0x525ad2);if(fs[_0xd96f('0x22')](_0x3c6ea5)){_0x5c8ed4[_0xd96f('0x23')]=_0xd96f('0x24');_0x332db4[_0xd96f('0x25')]['attachments']=[{'filename':_0x2d4427,'path':_0x3c6ea5}];_0x332db4[_0xd96f('0x25')][_0xd96f('0x26')]=util[_0xd96f('0x15')](_0xd96f('0x27'),JSON[_0xd96f('0x28')](_0x5c8ed4,null,0x2));}else if(fs['existsSync'](_0x364bec)){_0x5c8ed4[_0xd96f('0x23')]=_0xd96f('0x24');_0x332db4[_0xd96f('0x25')]['attachments']=[{'filename':_0x525ad2,'path':_0x364bec}];}else{_0x332db4[_0xd96f('0x25')]['text']=_0xd96f('0x29');if(!_0x26769d[_0xd96f('0x2a')]){_0x40fc9d=![];logger[_0xd96f('0x2b')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x40fc9d){return client[_0xd96f('0x2c')](_0xd96f('0x2d'),_0x332db4)[_0xd96f('0x2e')](function(_0x2a4b3d){if(_0x2a4b3d[_0xd96f('0x2f')]){return logger['error'](_0xd96f('0x30'),JSON['stringify'](_0x2a4b3d));}return logger[_0xd96f('0x2b')]('email\x20sent');})['catch'](function(_0x578e06){return logger[_0xd96f('0x2f')]('error\x20mail',JSON[_0xd96f('0x28')](_0x578e06));});}};}function handleError(){return function(_0x58d444){return logger[_0xd96f('0x2f')](JSON[_0xd96f('0x28')](_0x58d444));};}function handleResult(_0x1aa0c4){return function(_0x288fe0){logger[_0xd96f('0x2b')](_0xd96f('0x31'),JSON[_0xd96f('0x28')](_0x288fe0));if(_0x1aa0c4[_0xd96f('0xd')]&&_0x1aa0c4[_0xd96f('0xd')][_0xd96f('0xe')]&&!_[_0xd96f('0x32')](_0x1aa0c4[_0xd96f('0xc')])){setTimeout(handleSendEmail(_0x1aa0c4,_0x288fe0),0x3c*0x3e8);}};}function handleJob(_0x3a08fc){return function(){try{if(_[_0xd96f('0x32')](_0x3a08fc[_0xd96f('0x1b')])){return logger[_0xd96f('0x2b')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd96f('0x32')](_0x3a08fc['subtractUnit'])){return logger[_0xd96f('0x2b')]('subtractUnit\x20null\x20or\x20undefined');}var _0x238b7a={'startDate':moment()[_0xd96f('0x33')](_0x3a08fc[_0xd96f('0x1b')],_0x3a08fc[_0xd96f('0x34')])['format'](_0xd96f('0x35')),'endDate':moment()['format'](_0xd96f('0x35')),'type':_0xd96f('0x36'),'output':_0x3a08fc[_0xd96f('0x37')],'name':_0x3a08fc[_0xd96f('0x17')]};if(!_[_0xd96f('0x32')](_0x3a08fc[_0xd96f('0x38')])){logger[_0xd96f('0x2b')]('exec\x20defaul\x20report\x20id:%s',_0x3a08fc[_0xd96f('0x38')]);return analyticDefaultReportController[_0xd96f('0x39')]({'id':_0x3a08fc[_0xd96f('0x38')]},_0x238b7a)[_0xd96f('0x2e')](handleResult(_0x3a08fc))['catch'](handleError());}if(!_['isNil'](_0x3a08fc[_0xd96f('0x3a')])){logger[_0xd96f('0x2b')](_0xd96f('0x3b'),_0x3a08fc[_0xd96f('0x3a')]);return analyticCustomReportController[_0xd96f('0x39')]({'id':_0x3a08fc[_0xd96f('0x3a')]},_0x238b7a)['then'](handleResult(_0x3a08fc))['catch'](handleError());}}catch(_0x45b0b1){logger[_0xd96f('0x2f')](JSON[_0xd96f('0x28')](_0x45b0b1));}return logger['info'](_0xd96f('0x3c'));};}function getJobs(_0x1316b7){var _0x5c8076={};if(_0x1316b7){_0x5c8076['id']=_0x1316b7;}return db['Schedule'][_0xd96f('0x3d')]({'where':_0x5c8076,'include':[{'model':db[_0xd96f('0xd')],'attributes':['id',_0xd96f('0x17'),_0xd96f('0xc')],'include':[{'model':db[_0xd96f('0x3e')],'as':'Smtp'}]}]})[_0xd96f('0x2e')](function(_0x4e9aa6){var _0x8cef0a=_['keys'](manager[_0xd96f('0x3f')]);var _0x1aedb3=_[_0xd96f('0x40')](_0x4e9aa6,function(_0x275b79){return _0x275b79['id'][_0xd96f('0x41')]();});var _0x35e33f=_[_0xd96f('0x42')](_0x4e9aa6,function(_0x50d998){return _0x50d998['id'][_0xd96f('0x41')]();});var _0x420e3f=_0x1316b7?_0x1aedb3:_[_0xd96f('0x43')](_0x1aedb3,_0x8cef0a);var _0x3cbf82=_[_0xd96f('0x44')](_0x1aedb3,_0x8cef0a);var _0x200bde=_[_0xd96f('0x43')](_0x8cef0a,_0x1aedb3);var _0x4d820f;var _0x1dcdd8;for(_0x4d820f=0x0;_0x4d820f<_0x200bde[_0xd96f('0x45')]&&!_0x1316b7;_0x4d820f+=0x1){_0x1dcdd8=_0x200bde[_0x4d820f][_0xd96f('0x41')]();if(manager[_0xd96f('0x46')](_0x1dcdd8)){manager[_0xd96f('0x47')](_0x1dcdd8);manager[_0xd96f('0x48')](_0x1dcdd8);logger['info'](_0xd96f('0x49'),_0x1dcdd8);}}logger[_0xd96f('0x2b')](_0xd96f('0x4a'),JSON[_0xd96f('0x28')](_0x420e3f));for(_0x4d820f=0x0;_0x4d820f<_0x420e3f[_0xd96f('0x45')];_0x4d820f+=0x1){_0x1dcdd8=_0x420e3f[_0x4d820f][_0xd96f('0x41')]();logger[_0xd96f('0x2b')](_0xd96f('0x4b'),_0x1dcdd8);if(_0x1316b7){logger['info'](_0xd96f('0x4c'),_0x1316b7);logger['info'](JSON[_0xd96f('0x28')](_0x35e33f[_0x1dcdd8]));BPromise[_0xd96f('0x4d')]()['then'](handleJob(_0x35e33f[_0x1dcdd8]));logger[_0xd96f('0x2b')]('run\x20job',_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8]['cron']);}else if(_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]&&_0x35e33f[_0x1dcdd8]['active']&&moment()[_0xd96f('0x4f')](_0x35e33f[_0x1dcdd8][_0xd96f('0x50')],_0x35e33f[_0x1dcdd8]['endAt'])){manager[_0xd96f('0x51')](_0x1dcdd8,_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')],handleJob(_0x35e33f[_0x1dcdd8]));manager[_0xd96f('0x52')](_0x1dcdd8);logger[_0xd96f('0x2b')](_0xd96f('0x53'),_0x35e33f[_0x1dcdd8]['name'],_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]);}else if(manager['exists'](_0x1dcdd8)){manager[_0xd96f('0x47')](_0x1dcdd8);manager[_0xd96f('0x48')](_0x1dcdd8);logger['info'](_0xd96f('0x54'),_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8]['cron']);}}for(_0x4d820f=0x0,_0x1dcdd8;_0x4d820f<_0x3cbf82[_0xd96f('0x45')]&&!_0x1316b7;_0x4d820f+=0x1){_0x1dcdd8=_0x3cbf82[_0x4d820f][_0xd96f('0x41')]();if(manager[_0xd96f('0x46')](_0x1dcdd8)){if(_0x35e33f[_0x1dcdd8]['cron']&&_0x35e33f[_0x1dcdd8]['active']&&moment()['isBetween'](_0x35e33f[_0x1dcdd8][_0xd96f('0x50')],_0x35e33f[_0x1dcdd8][_0xd96f('0x55')])){manager[_0xd96f('0x56')](_0x1dcdd8,_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')],handleJob(_0x35e33f[_0x1dcdd8]));logger[_0xd96f('0x2b')](_0xd96f('0x57'),_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]);}else{manager[_0xd96f('0x47')](_0x1dcdd8);manager[_0xd96f('0x48')](_0x1dcdd8);logger[_0xd96f('0x2b')](_0xd96f('0x54'),_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]);}}}})[_0xd96f('0x58')](function(_0x4dad88){logger[_0xd96f('0x2f')](JSON[_0xd96f('0x28')](_0x4dad88));});}exports[_0xd96f('0x59')]=function(_0xec0b8){return getJobs(_0xec0b8);};exports[_0xd96f('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x1eaa=['join','../../files/reports','savename','%s.%s','extname','zip','existsSync','status','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','Sent','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','then','no\x20report\x20id','Schedule','jobs','map','toString','keyBy','deleteJob','toRun','length','index','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','add\x20cron','exists','stop\x20cron','isBetween','update','update\x20cron','stop','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','email','Smtp','service','MailAccount','host','port','authentication','auth','user','pass','format','name','bcc','subtractNumber'];(function(_0x1eaaf2,_0x21d89e){var _0x2341a7=function(_0x4977ed){while(--_0x4977ed){_0x1eaaf2['push'](_0x1eaaf2['shift']());}};_0x2341a7(++_0x21d89e);}(_0x1eaa,0xe1));var _0xa1ea=function(_0x4089a5,_0x38b11f){_0x4089a5=_0x4089a5-0x0;var _0x1d347b=_0x1eaa[_0x4089a5];return _0x1d347b;};'use strict';var fs=require('fs');var util=require(_0xa1ea('0x0'));var path=require('path');var _=require(_0xa1ea('0x1'));var moment=require(_0xa1ea('0x2'));var CronJobManager=require(_0xa1ea('0x3'));var jayson=require(_0xa1ea('0x4'));var BPromise=require(_0xa1ea('0x5'));var logger=require(_0xa1ea('0x6'))('schedule');var db=require(_0xa1ea('0x7'))['db'];var analyticCustomReportController=require(_0xa1ea('0x8'));var analyticDefaultReportController=require(_0xa1ea('0x9'));var client=jayson[_0xa1ea('0xa')][_0xa1ea('0xb')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2f94d0,_0x4db9f2){return function(){logger[_0xa1ea('0xc')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x2f94d0[_0xa1ea('0xd')]);var _0x186f3b=!![];var _0x6a1ef5={'tls':{'rejectUnauthorized':![]}};if(_0x2f94d0['MailAccount'][_0xa1ea('0xe')][_0xa1ea('0xf')]){_0x6a1ef5[_0xa1ea('0xf')]=_0x2f94d0[_0xa1ea('0x10')]['Smtp']['service'];}else{_0x6a1ef5[_0xa1ea('0x11')]=_0x2f94d0[_0xa1ea('0x10')][_0xa1ea('0xe')][_0xa1ea('0x11')];_0x6a1ef5[_0xa1ea('0x12')]=_0x2f94d0[_0xa1ea('0x10')][_0xa1ea('0xe')][_0xa1ea('0x12')];_0x6a1ef5['secure']=_0x2f94d0['MailAccount'][_0xa1ea('0xe')]['secure'];}if(_0x2f94d0[_0xa1ea('0x10')][_0xa1ea('0xe')][_0xa1ea('0x13')]){_0x6a1ef5[_0xa1ea('0x14')]={'user':_0x2f94d0[_0xa1ea('0x10')][_0xa1ea('0xe')][_0xa1ea('0x15')],'pass':_0x2f94d0['MailAccount'][_0xa1ea('0xe')][_0xa1ea('0x16')]};}var _0x2792d4={'account':_0x6a1ef5,'message':{'from':util[_0xa1ea('0x17')]('\x22%s\x22\x20<%s>',_0x2f94d0['MailAccount'][_0xa1ea('0x18')],_0x2f94d0[_0xa1ea('0x10')][_0xa1ea('0xd')]||_0x2f94d0[_0xa1ea('0x10')][_0xa1ea('0xe')][_0xa1ea('0x15')]),'to':_0x2f94d0['email'],'cc':_0x2f94d0['cc'],'bcc':_0x2f94d0[_0xa1ea('0x19')],'subject':util[_0xa1ea('0x17')]('Report\x20%s\x20last\x20%s\x20%s',_0x4db9f2['name'],_0x2f94d0[_0xa1ea('0x1a')],_0x2f94d0['subtractUnit'])}};var _0x88154c=path[_0xa1ea('0x1b')](__dirname,_0xa1ea('0x1c'));var _0xeedaad=_0x4db9f2[_0xa1ea('0x1d')];var _0x5d7d1e=util[_0xa1ea('0x17')](_0xa1ea('0x1e'),path['basename'](_0x4db9f2[_0xa1ea('0x1d')],path[_0xa1ea('0x1f')](_0x4db9f2[_0xa1ea('0x1d')])),_0xa1ea('0x20'));var _0x8b4222=path[_0xa1ea('0x1b')](_0x88154c,_0xeedaad);var _0x50125a=path['join'](_0x88154c,_0x5d7d1e);if(fs[_0xa1ea('0x21')](_0x8b4222)){_0x4db9f2[_0xa1ea('0x22')]='Sent';_0x2792d4[_0xa1ea('0x23')][_0xa1ea('0x24')]=[{'filename':_0xeedaad,'path':_0x8b4222}];_0x2792d4['message']['text']=util[_0xa1ea('0x17')](_0xa1ea('0x25'),JSON['stringify'](_0x4db9f2,null,0x2));}else if(fs['existsSync'](_0x50125a)){_0x4db9f2[_0xa1ea('0x22')]=_0xa1ea('0x26');_0x2792d4['message']['attachments']=[{'filename':_0x5d7d1e,'path':_0x50125a}];}else{_0x2792d4[_0xa1ea('0x23')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x2f94d0[_0xa1ea('0x27')]){_0x186f3b=![];logger[_0xa1ea('0xc')](_0xa1ea('0x28'));}}if(_0x186f3b){return client[_0xa1ea('0x29')](_0xa1ea('0x2a'),_0x2792d4)['then'](function(_0x4f0676){if(_0x4f0676['error']){return logger[_0xa1ea('0x2b')]('error\x20mail',JSON[_0xa1ea('0x2c')](_0x4f0676));}return logger['info']('email\x20sent');})[_0xa1ea('0x2d')](function(_0x57e2b4){return logger[_0xa1ea('0x2b')]('error\x20mail',JSON[_0xa1ea('0x2c')](_0x57e2b4));});}};}function handleError(){return function(_0xdbdaa1){return logger[_0xa1ea('0x2b')](JSON[_0xa1ea('0x2c')](_0xdbdaa1));};}function handleResult(_0x8a3ee3){return function(_0x41ae6f){logger[_0xa1ea('0xc')](_0xa1ea('0x2e'),JSON['stringify'](_0x41ae6f));if(_0x8a3ee3['MailAccount']&&_0x8a3ee3['MailAccount'][_0xa1ea('0xe')]&&!_[_0xa1ea('0x2f')](_0x8a3ee3[_0xa1ea('0xd')])){setTimeout(handleSendEmail(_0x8a3ee3,_0x41ae6f),0x3c*0x3e8);}};}function handleJob(_0x4430e5){return function(){try{if(_[_0xa1ea('0x2f')](_0x4430e5[_0xa1ea('0x1a')])){return logger[_0xa1ea('0xc')](_0xa1ea('0x30'));}if(_[_0xa1ea('0x2f')](_0x4430e5[_0xa1ea('0x31')])){return logger['info'](_0xa1ea('0x32'));}var _0x458e16={'startDate':moment()[_0xa1ea('0x33')](_0x4430e5[_0xa1ea('0x1a')],_0x4430e5[_0xa1ea('0x31')])[_0xa1ea('0x17')](_0xa1ea('0x34')),'endDate':moment()[_0xa1ea('0x17')](_0xa1ea('0x34')),'type':_0xa1ea('0x35'),'output':_0x4430e5[_0xa1ea('0x36')],'name':_0x4430e5['name']};if(!_[_0xa1ea('0x2f')](_0x4430e5[_0xa1ea('0x37')])){logger[_0xa1ea('0xc')]('exec\x20defaul\x20report\x20id:%s',_0x4430e5['DefaultReportId']);return analyticDefaultReportController[_0xa1ea('0x38')]({'id':_0x4430e5[_0xa1ea('0x37')]},_0x458e16)['then'](handleResult(_0x4430e5))['catch'](handleError());}if(!_[_0xa1ea('0x2f')](_0x4430e5[_0xa1ea('0x39')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x4430e5['CustomReportId']);return analyticCustomReportController[_0xa1ea('0x38')]({'id':_0x4430e5[_0xa1ea('0x39')]},_0x458e16)[_0xa1ea('0x3a')](handleResult(_0x4430e5))['catch'](handleError());}}catch(_0x3ff19d){logger['error'](JSON[_0xa1ea('0x2c')](_0x3ff19d));}return logger['info'](_0xa1ea('0x3b'));};}function getJobs(_0x2fefd6){var _0x23842b={};if(_0x2fefd6){_0x23842b['id']=_0x2fefd6;}return db[_0xa1ea('0x3c')]['findAll']({'where':_0x23842b,'include':[{'model':db[_0xa1ea('0x10')],'attributes':['id',_0xa1ea('0x18'),_0xa1ea('0xd')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})['then'](function(_0x4764cf){var _0x14c29b=_['keys'](manager[_0xa1ea('0x3d')]);var _0x36663b=_[_0xa1ea('0x3e')](_0x4764cf,function(_0x4cb630){return _0x4cb630['id'][_0xa1ea('0x3f')]();});var _0x11eab3=_[_0xa1ea('0x40')](_0x4764cf,function(_0x4ef11d){return _0x4ef11d['id']['toString']();});var _0x42f471=_0x2fefd6?_0x36663b:_['difference'](_0x36663b,_0x14c29b);var _0x2a6ec9=_['intersection'](_0x36663b,_0x14c29b);var _0x31f121=_['difference'](_0x14c29b,_0x36663b);var _0x32001d;var _0x55ed65;for(_0x32001d=0x0;_0x32001d<_0x31f121['length']&&!_0x2fefd6;_0x32001d+=0x1){_0x55ed65=_0x31f121[_0x32001d]['toString']();if(manager['exists'](_0x55ed65)){manager['stop'](_0x55ed65);manager[_0xa1ea('0x41')](_0x55ed65);logger[_0xa1ea('0xc')]('delete\x20cron',_0x55ed65);}}logger[_0xa1ea('0xc')](_0xa1ea('0x42'),JSON[_0xa1ea('0x2c')](_0x42f471));for(_0x32001d=0x0;_0x32001d<_0x42f471[_0xa1ea('0x43')];_0x32001d+=0x1){_0x55ed65=_0x42f471[_0x32001d][_0xa1ea('0x3f')]();logger[_0xa1ea('0xc')](_0xa1ea('0x44'),_0x55ed65);if(_0x2fefd6){logger[_0xa1ea('0xc')](_0xa1ea('0x45'),_0x2fefd6);logger[_0xa1ea('0xc')](JSON[_0xa1ea('0x2c')](_0x11eab3[_0x55ed65]));BPromise[_0xa1ea('0x46')]()[_0xa1ea('0x3a')](handleJob(_0x11eab3[_0x55ed65]));logger['info'](_0xa1ea('0x47'),_0x11eab3[_0x55ed65][_0xa1ea('0x18')],_0x11eab3[_0x55ed65][_0xa1ea('0x48')]);}else if(_0x11eab3[_0x55ed65][_0xa1ea('0x48')]&&_0x11eab3[_0x55ed65][_0xa1ea('0x49')]&&moment()['isBetween'](_0x11eab3[_0x55ed65][_0xa1ea('0x4a')],_0x11eab3[_0x55ed65][_0xa1ea('0x4b')])){manager[_0xa1ea('0x4c')](_0x55ed65,_0x11eab3[_0x55ed65][_0xa1ea('0x48')],handleJob(_0x11eab3[_0x55ed65]));manager['start'](_0x55ed65);logger[_0xa1ea('0xc')](_0xa1ea('0x4d'),_0x11eab3[_0x55ed65][_0xa1ea('0x18')],_0x11eab3[_0x55ed65][_0xa1ea('0x48')]);}else if(manager[_0xa1ea('0x4e')](_0x55ed65)){manager['stop'](_0x55ed65);manager[_0xa1ea('0x41')](_0x55ed65);logger['info'](_0xa1ea('0x4f'),_0x11eab3[_0x55ed65][_0xa1ea('0x18')],_0x11eab3[_0x55ed65][_0xa1ea('0x48')]);}}for(_0x32001d=0x0,_0x55ed65;_0x32001d<_0x2a6ec9[_0xa1ea('0x43')]&&!_0x2fefd6;_0x32001d+=0x1){_0x55ed65=_0x2a6ec9[_0x32001d][_0xa1ea('0x3f')]();if(manager[_0xa1ea('0x4e')](_0x55ed65)){if(_0x11eab3[_0x55ed65][_0xa1ea('0x48')]&&_0x11eab3[_0x55ed65][_0xa1ea('0x49')]&&moment()[_0xa1ea('0x50')](_0x11eab3[_0x55ed65][_0xa1ea('0x4a')],_0x11eab3[_0x55ed65][_0xa1ea('0x4b')])){manager[_0xa1ea('0x51')](_0x55ed65,_0x11eab3[_0x55ed65][_0xa1ea('0x48')],handleJob(_0x11eab3[_0x55ed65]));logger[_0xa1ea('0xc')](_0xa1ea('0x52'),_0x11eab3[_0x55ed65][_0xa1ea('0x18')],_0x11eab3[_0x55ed65][_0xa1ea('0x48')]);}else{manager[_0xa1ea('0x53')](_0x55ed65);manager[_0xa1ea('0x41')](_0x55ed65);logger[_0xa1ea('0xc')](_0xa1ea('0x4f'),_0x11eab3[_0x55ed65][_0xa1ea('0x18')],_0x11eab3[_0x55ed65][_0xa1ea('0x48')]);}}}})[_0xa1ea('0x2d')](function(_0x45030c){logger[_0xa1ea('0x2b')](JSON['stringify'](_0x45030c));});}exports['run']=function(_0x29b964){return getJobs(_0x29b964);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 6f169ea..4fd3bdd 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1282=['bulkCreate','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','CmContact','destroy','then','log','finished\x20populating','CmHopper'];(function(_0x59b67f,_0x5a10e2){var _0x15c336=function(_0xe8d63b){while(--_0xe8d63b){_0x59b67f['push'](_0x59b67f['shift']());}};_0x15c336(++_0x5a10e2);}(_0x1282,0x158));var _0x2128=function(_0x5e3d99,_0x35247a){_0x5e3d99=_0x5e3d99-0x0;var _0x1746c2=_0x1282[_0x5e3d99];return _0x1746c2;};'use strict';var util=require(_0x2128('0x0'));var db=require(_0x2128('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2128('0x2')]({'id':i,'firstName':_0x2128('0x3')+i,'lastName':_0x2128('0x4')+i,'phone':0xf879fb460+i,'email':_0x2128('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x2128('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2128('0x6')](),'updatedAt':Date[_0x2128('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2128('0x2')]({'id':i,'firstName':_0x2128('0x3')+i,'lastName':_0x2128('0x4')+i,'phone':0xf879fb460+i,'email':_0x2128('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x2128('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2128('0x6')](),'updatedAt':Date[_0x2128('0x6')]()});}db[_0x2128('0x7')][_0x2128('0x8')]({'where':{}})[_0x2128('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x2128('0x9')](function(){console[_0x2128('0xa')](_0x2128('0xb'),'contacts1');return db['CmHopper'][_0x2128('0x8')]({'where':{}});})[_0x2128('0x9')](function(){return db[_0x2128('0xc')][_0x2128('0xd')](hopper);})['then'](function(){console[_0x2128('0xa')](_0x2128('0xb'),'hopper1');return db[_0x2128('0x7')][_0x2128('0xd')](contacts2);})['then'](function(){console[_0x2128('0xa')](_0x2128('0xb'),_0x2128('0xe'));return db[_0x2128('0xc')][_0x2128('0xd')](hopper2);})[_0x2128('0x9')](function(){console[_0x2128('0xa')](_0x2128('0xb'),_0x2128('0xf'));})[_0x2128('0x10')](function(_0x3dc66f){console[_0x2128('0xa')](_0x3dc66f);}); \ No newline at end of file +var _0x0669=['Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','then','CmContact','log','finished\x20populating','CmHopper','contacts2','bulkCreate','hopper2','catch','../mysqldb','push'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x0669,0x1ae));var _0x9066=function(_0x4838df,_0x1e8c8d){_0x4838df=_0x4838df-0x0;var _0x1a41b3=_0x0669[_0x4838df];return _0x1a41b3;};'use strict';var util=require('util');var db=require(_0x9066('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9066('0x1')]({'id':i,'firstName':_0x9066('0x2')+i,'lastName':_0x9066('0x3')+i,'phone':0xf879fb460+i,'email':_0x9066('0x4')+i+_0x9066('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9066('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x9066('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x9066('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9066('0x3')+i,'phone':0xf879fb460+i,'email':_0x9066('0x4')+i+_0x9066('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9066('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x9066('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9066('0x6')](),'updatedAt':Date['now']()});}db['CmContact']['destroy']({'where':{}})[_0x9066('0x7')](function(){return db[_0x9066('0x8')]['bulkCreate'](contacts);})[_0x9066('0x7')](function(){console[_0x9066('0x9')](_0x9066('0xa'),'contacts1');return db[_0x9066('0xb')]['destroy']({'where':{}});})['then'](function(){return db[_0x9066('0xb')]['bulkCreate'](hopper);})[_0x9066('0x7')](function(){console[_0x9066('0x9')](_0x9066('0xa'),'hopper1');return db['CmContact']['bulkCreate'](contacts2);})[_0x9066('0x7')](function(){console[_0x9066('0x9')](_0x9066('0xa'),_0x9066('0xc'));return db[_0x9066('0xb')][_0x9066('0xd')](hopper2);})[_0x9066('0x7')](function(){console[_0x9066('0x9')](_0x9066('0xa'),_0x9066('0xe'));})[_0x9066('0xf')](function(_0xcd15fd){console[_0x9066('0x9')](_0xcd15fd);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 5b70477..9b000b8 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd1f2=['format','agent','%s%s','friend','udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push'];(function(_0x239826,_0x1d884a){var _0x251972=function(_0x25736b){while(--_0x25736b){_0x239826['push'](_0x239826['shift']());}};_0x251972(++_0x1d884a);}(_0xd1f2,0x7c));var _0x2d1f=function(_0xfb0ac9,_0x299fc2){_0xfb0ac9=_0xfb0ac9-0x0;var _0x367369=_0xd1f2[_0xfb0ac9];return _0x367369;};'use strict';var util=require('util');var db=require(_0x2d1f('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x2d1f('0x1')]({'name':util[_0x2d1f('0x2')]('%s%s',_0x2d1f('0x3'),i),'fullname':util['format'](_0x2d1f('0x4'),_0x2d1f('0x3'),i),'email':util[_0x2d1f('0x2')]('%s%s@xcally.com','agent',i),'role':_0x2d1f('0x3'),'password':'password','internal':0xfa0+i,'type':_0x2d1f('0x5'),'transport':[_0x2d1f('0x6'),'ws','wss'],'disallow':[_0x2d1f('0x7')],'allow':[_0x2d1f('0x8')],'defaultuser':util[_0x2d1f('0x2')](_0x2d1f('0x4'),_0x2d1f('0x3'),i),'encryption':_0x2d1f('0x9'),'avpf':_0x2d1f('0x9'),'force_avp':'yes','icesupport':_0x2d1f('0x9'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x2d1f('0xa'),'dtlssetup':'actpass','callerid':util[_0x2d1f('0x2')](_0x2d1f('0xb'),util[_0x2d1f('0x2')]('%s%s',_0x2d1f('0x3'),i),0xfa0+i)});}db[_0x2d1f('0xc')][_0x2d1f('0xd')](users)[_0x2d1f('0xe')](function(){console[_0x2d1f('0xf')](_0x2d1f('0x10'));})[_0x2d1f('0x11')](function(_0x1d73a3){console['log'](_0x1d73a3);}); \ No newline at end of file +var _0x1187=['%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/private/motion.key','User','bulkCreate','then','log','add\x20user','catch','util','push','%s%s','agent','format'];(function(_0x33a4df,_0x55693e){var _0x1c894d=function(_0x3bfd55){while(--_0x3bfd55){_0x33a4df['push'](_0x33a4df['shift']());}};_0x1c894d(++_0x55693e);}(_0x1187,0x127));var _0x7118=function(_0x5da6d9,_0x1f7da5){_0x5da6d9=_0x5da6d9-0x0;var _0x378ae0=_0x1187[_0x5da6d9];return _0x378ae0;};'use strict';var util=require(_0x7118('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x7118('0x1')]({'name':util['format'](_0x7118('0x2'),_0x7118('0x3'),i),'fullname':util['format']('%s%s',_0x7118('0x3'),i),'email':util[_0x7118('0x4')](_0x7118('0x5'),'agent',i),'role':_0x7118('0x3'),'password':_0x7118('0x6'),'internal':0xfa0+i,'type':_0x7118('0x7'),'transport':[_0x7118('0x8'),'ws',_0x7118('0x9')],'disallow':[_0x7118('0xa')],'allow':[_0x7118('0xb')],'defaultuser':util[_0x7118('0x4')](_0x7118('0x2'),_0x7118('0x3'),i),'encryption':_0x7118('0xc'),'avpf':_0x7118('0xc'),'force_avp':_0x7118('0xc'),'icesupport':'yes','dtlsenable':_0x7118('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x7118('0xd'),'dtlssetup':'actpass','callerid':util['format']('\x22%s\x22\x20<%s>',util[_0x7118('0x4')](_0x7118('0x2'),_0x7118('0x3'),i),0xfa0+i)});}db[_0x7118('0xe')][_0x7118('0xf')](users)[_0x7118('0x10')](function(){console[_0x7118('0x11')](_0x7118('0x12'));})[_0x7118('0x13')](function(_0xc30e98){console[_0x7118('0x11')](_0xc30e98);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 6381a6a..d5721f8 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x46c5=['../mysqldb','./environment','name','Agents','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','role','where','type','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','MailQueue','Trunk','user','FaxQueue','SmsQueues','agent','getVoiceQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','all','length','chat','fax','sms','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','connection','address','remoteAddress','request','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash'];(function(_0x334dea,_0x19e936){var _0x3c2664=function(_0x2ab4bc){while(--_0x2ab4bc){_0x334dea['push'](_0x334dea['shift']());}};_0x3c2664(++_0x19e936);}(_0x46c5,0x153));var _0x546c=function(_0x2589f2,_0xfca91c){_0x2589f2=_0x2589f2-0x0;var _0x66d863=_0x46c5[_0x2589f2];return _0x66d863;};'use strict';var _=require(_0x546c('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x546c('0x1'))['db'];var config=require(_0x546c('0x2'));var queryQueues={'attributes':['id',_0x546c('0x3')],'include':[{'as':_0x546c('0x4'),'model':db['User'],'attributes':['id',_0x546c('0x3'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x546c('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x546c('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x546c('0x3'),'type'],'where':{'type':_0x546c('0x5')}};function getAssociatedResources(_0x189ca7,_0x118e92,_0x21b5d5){return db['UserProfileSection'][_0x546c('0x6')]({'where':{'name':_0x189ca7,'userProfileId':_0x118e92},'raw':!![]})[_0x546c('0x7')](function(_0x4e5fbd){if(_0x4e5fbd){if(_0x4e5fbd[_0x546c('0x8')]){switch(_0x189ca7){case _0x546c('0x9'):case _0x546c('0xa'):case _0x546c('0xb'):case'SmsQueues':case _0x546c('0xc'):case _0x546c('0xd'):return db[_0x21b5d5][_0x546c('0xe')](queryQueues);case _0x546c('0xf'):return db[_0x21b5d5]['findAll'](queryTelephones);case _0x546c('0x10'):return db[_0x21b5d5][_0x546c('0xe')](queryTrunks);case _0x546c('0x11'):return db[_0x21b5d5]['findAll'](queryCampaigns);}}else{return db[_0x546c('0x12')][_0x546c('0xe')]({'attributes':[_0x546c('0x13')],'where':{'sectionId':_0x4e5fbd['id']},'raw':!![]})['then'](function(_0x454ae9){if(_0x454ae9){var _0x5983d0={'where':{'id':_[_0x546c('0x14')](_0x454ae9,'resourceId')},'raw':!![]};switch(_0x21b5d5){case _0x546c('0x15'):_0x5983d0['where'][_0x546c('0x16')]='telephone';break;case'Campaign':_0x5983d0[_0x546c('0x17')][_0x546c('0x18')]=_0x546c('0x5');break;}return db[_0x21b5d5]['findAll'](_0x5983d0);}else{return[];}});}}else{return[];}})['then'](function(_0x5ad804){return _0x5ad804;});}function joinOrLeaveQueues(_0x2928d3,_0x182193,_0x35c4b9,_0x560c54){_0x2928d3[_0x182193](util[_0x546c('0x19')]('%s:queue:%s',_0x35c4b9,_0x560c54[_0x546c('0x3')]));if(_0x560c54[_0x546c('0x4')]){for(var _0x542fa4=0x0;_0x542fa4<_0x560c54[_0x546c('0x4')]['length'];_0x542fa4+=0x1){_0x2928d3[_0x182193](util[_0x546c('0x19')](_0x546c('0x1a'),_0x560c54[_0x546c('0x4')][_0x542fa4][_0x546c('0x3')]));}}}function joinOrLeave(_0x26e150,_0x1aa55c,_0x240db3){var _0x106bb4;if(_0x26e150[_0x546c('0x1b')][_0x546c('0x1c')]['id']){db[_0x546c('0x15')][_0x546c('0x1d')]({'attributes':['id','name',_0x546c('0x16'),_0x546c('0x1e')],'where':{'id':_0x26e150[_0x546c('0x1b')][_0x546c('0x1c')]['id']},'include':[{'model':db[_0x546c('0x1f')],'as':_0x546c('0x20'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x546c('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x546c('0x22')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x546c('0x23')],'as':_0x546c('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x56bc63){if(_0x56bc63){_0x106bb4=_0x56bc63;_0x26e150[_0x1aa55c](util['format'](_0x546c('0x1a'),_0x56bc63[_0x546c('0x3')]));var _0x189dd5=[];switch(_0x56bc63[_0x546c('0x16')]){case _0x546c('0x25'):_0x26e150[_0x1aa55c](_0x546c('0x26'));_0x26e150[_0x1aa55c](_0x546c('0x27'));if(queryQueues[_0x546c('0x28')](_0x546c('0x29'))){delete queryQueues[_0x546c('0x29')];}_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2b')][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2c')][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db['FaxQueue']['findAll'](queryQueues));_0x189dd5['push'](db['SmsQueue'][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2d')][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db['OpenchannelQueue'][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x15')]['findAll'](queryTelephones));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2e')][_0x546c('0xe')](queryTrunks));_0x189dd5[_0x546c('0x2a')](db['Campaign'][_0x546c('0xe')](queryCampaigns));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x15')]['findAll'](queryAgents));break;case _0x546c('0x2f'):_0x26e150[_0x1aa55c](_0x546c('0x26'));_0x26e150[_0x1aa55c](_0x546c('0x27'));_0x189dd5[_0x546c('0x2a')](getAssociatedResources('VoiceQueues',_0x56bc63[_0x546c('0x1e')],_0x546c('0x2b')));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0xa'),_0x56bc63[_0x546c('0x1e')],'ChatQueue'));_0x189dd5['push'](getAssociatedResources('FaxQueues',_0x56bc63[_0x546c('0x1e')],_0x546c('0x30')));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0x31'),_0x56bc63[_0x546c('0x1e')],'SmsQueue'));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0xc'),_0x56bc63['userProfileId'],_0x546c('0x2d')));_0x189dd5['push'](getAssociatedResources(_0x546c('0xd'),_0x56bc63[_0x546c('0x1e')],'OpenchannelQueue'));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0xf'),_0x56bc63['userProfileId'],_0x546c('0x15')));_0x189dd5['push'](getAssociatedResources(_0x546c('0x10'),_0x56bc63[_0x546c('0x1e')],_0x546c('0x2e')));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0x11'),_0x56bc63['userProfileId'],'Campaign'));_0x189dd5[_0x546c('0x2a')](db['User'][_0x546c('0xe')](queryAgents));break;case _0x546c('0x32'):_0x26e150[_0x1aa55c](_0x546c('0x26'));_0x26e150[_0x1aa55c]('voice:outbound');_0x189dd5[_0x546c('0x2a')](_0x56bc63[_0x546c('0x33')]({'attributes':['id',_0x546c('0x3')]}));_0x189dd5['push'](_0x56bc63[_0x546c('0x34')]({'attributes':['id',_0x546c('0x3')]}));_0x189dd5[_0x546c('0x2a')](_0x56bc63[_0x546c('0x35')]({'attributes':['id',_0x546c('0x3')]}));_0x189dd5[_0x546c('0x2a')](_0x56bc63['getSmsQueues']({'attributes':['id','name']}));_0x189dd5[_0x546c('0x2a')](_0x56bc63['getMailQueues']({'attributes':['id','name']}));_0x189dd5['push'](_0x56bc63[_0x546c('0x36')]({'attributes':['id','name']}));break;}return BPromise[_0x546c('0x37')](_0x189dd5);}})['then'](function(_0x4aa04b){if(_0x4aa04b&&_0x4aa04b[_0x546c('0x38')]){for(var _0x1b1d69=0x0;_0x1b1d69<_0x4aa04b['length'];_0x1b1d69+=0x1){for(var _0xdc0f5=0x0;_0xdc0f5<_0x4aa04b[_0x1b1d69][_0x546c('0x38')];_0xdc0f5+=0x1){switch(_0x1b1d69){case 0x0:joinOrLeaveQueues(_0x26e150,_0x1aa55c,'voice',_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x1:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x39'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x2:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x3a'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x3:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x3b'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x4:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x3c'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x5:joinOrLeaveQueues(_0x26e150,_0x1aa55c,'openchannel',_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x6:_0x26e150[_0x1aa55c](util['format'](_0x546c('0x3d'),_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;case 0x7:_0x26e150[_0x1aa55c](util[_0x546c('0x19')](_0x546c('0x3e'),_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;case 0x8:_0x26e150[_0x1aa55c](util[_0x546c('0x19')]('campaign:%s:%s',_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x18')],_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;case 0x9:_0x26e150[_0x1aa55c](util[_0x546c('0x19')](_0x546c('0x1a'),_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;}}}}})['then'](function(){if(_0x1aa55c===_0x546c('0x3f')){var _0x22151c=_[_0x546c('0x14')](_0x106bb4[_0x546c('0x20')],'id');return _0x106bb4[_0x546c('0x40')](_0x22151c)[_0x546c('0x7')](function(){for(var _0x4e4f7d=0x0;_0x4e4f7d<_0x22151c[_0x546c('0x38')];_0x4e4f7d+=0x1){_0x240db3[_0x546c('0x41')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x22151c[_0x4e4f7d]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c==='leave'){var _0x1fcca5=_['map'](_0x106bb4[_0x546c('0x21')],'id');return _0x106bb4[_0x546c('0x42')](_0x1fcca5)[_0x546c('0x7')](function(){for(var _0x44343c=0x0;_0x44343c<_0x1fcca5['length'];_0x44343c+=0x1){_0x240db3[_0x546c('0x41')](_0x546c('0x43'),{'MailInteractionId':Number(_0x1fcca5[_0x44343c]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c==='leave'){var _0xef6f0f=_[_0x546c('0x14')](_0x106bb4['FaxInteractions'],'id');return _0x106bb4[_0x546c('0x44')](_0xef6f0f)[_0x546c('0x7')](function(){for(var _0x3e67ab=0x0;_0x3e67ab<_0xef6f0f[_0x546c('0x38')];_0x3e67ab+=0x1){_0x240db3[_0x546c('0x41')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xef6f0f[_0x3e67ab]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c===_0x546c('0x3f')){var _0x5b567d=_[_0x546c('0x14')](_0x106bb4[_0x546c('0x24')],'id');return _0x106bb4['removeSmsInteractions'](_0x5b567d)[_0x546c('0x7')](function(){for(var _0x3fc8c1=0x0;_0x3fc8c1<_0x5b567d['length'];_0x3fc8c1+=0x1){_0x240db3[_0x546c('0x41')](_0x546c('0x45'),{'SmsInteractionId':Number(_0x5b567d[_0x3fc8c1]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c===_0x546c('0x3f')){var _0x222600=_[_0x546c('0x14')](_0x106bb4[_0x546c('0x46')],'id');return _0x106bb4[_0x546c('0x47')](_0x222600)[_0x546c('0x7')](function(){for(var _0x3cf7e7=0x0;_0x3cf7e7<_0x222600[_0x546c('0x38')];_0x3cf7e7+=0x1){_0x240db3['emit'](_0x546c('0x48'),{'OpenchannelInteractionId':Number(_0x222600[_0x3cf7e7]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x49')](function(_0x1baa69){_0x26e150[_0x546c('0x4a')](_0x1baa69);});}}function onDisconnect(_0x58a242,_0x359c2e){joinOrLeave(_0x58a242,_0x546c('0x3f'),_0x359c2e);}function onConnect(_0x43038f){joinOrLeave(_0x43038f,'join');}exports[_0x546c('0x4b')]=function(_0x144b41){_0x144b41['on'](_0x546c('0x4c'),function(_0x5de43c){_0x5de43c['setMaxListeners'](0x0);_0x5de43c[_0x546c('0x4d')]=_0x5de43c['request']['connection'][_0x546c('0x4e')]+':'+_0x5de43c[_0x546c('0x4f')][_0x546c('0x4c')][_0x546c('0x50')];_0x5de43c['connectedAt']=new Date();_0x5de43c['log']=function(_0x56d94f){console['log'](_0x546c('0x51')+_0x5de43c[_0x546c('0x52')][_0x546c('0x3')]+'['+_0x5de43c[_0x546c('0x4d')]+']',_0x56d94f);};_0x5de43c['on'](_0x546c('0x53'),function(){onDisconnect(_0x5de43c,_0x144b41);_0x5de43c[_0x546c('0x4a')](_0x546c('0x54'));});onConnect(_0x5de43c);_0x5de43c[_0x546c('0x4a')]('CONNECTED');});}; \ No newline at end of file +var _0xb617=['user_has_chat_interactions:remove','map','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','leave','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','connection','setMaxListeners','remoteAddress','request','connectedAt','SocketIO\x20','address','DISCONNECTED','lodash','util','bluebird','../mysqldb','./environment','Agents','User','name','role','agent','telephone','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','FaxQueues','MailQueues','OpenchannelQueues','Telephones','findAll','Trunks','IvrCampaigns','resourceId','where','Campaign','type','format','%s:queue:%s','length','user:%s','handshake','query','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteraction','OpenchannelInteraction','OpenchannelInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','OpenchannelQueue','user','ChatQueues','SmsQueues','SmsQueue','MailQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','trunk:%s','removeChatInteractions','emit'];(function(_0x4629ed,_0x59ef85){var _0x52ca04=function(_0x59dc63){while(--_0x59dc63){_0x4629ed['push'](_0x4629ed['shift']());}};_0x52ca04(++_0x59ef85);}(_0xb617,0x74));var _0x7b61=function(_0x511693,_0x4441a1){_0x511693=_0x511693-0x0;var _0x19fec4=_0xb617[_0x511693];return _0x19fec4;};'use strict';var _=require(_0x7b61('0x0'));var util=require(_0x7b61('0x1'));var BPromise=require(_0x7b61('0x2'));var db=require(_0x7b61('0x3'))['db'];var config=require(_0x7b61('0x4'));var queryQueues={'attributes':['id','name'],'include':[{'as':_0x7b61('0x5'),'model':db[_0x7b61('0x6')],'attributes':['id',_0x7b61('0x7'),_0x7b61('0x8')],'raw':!![],'where':{'role':_0x7b61('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7b61('0xa')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7b61('0x7')]};var queryAgents={'raw':!![],'attributes':['id',_0x7b61('0x7')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7b61('0x7'),'type'],'where':{'type':_0x7b61('0xb')}};function getAssociatedResources(_0x369cd7,_0x19e3b9,_0x5494d9){return db[_0x7b61('0xc')]['findOne']({'where':{'name':_0x369cd7,'userProfileId':_0x19e3b9},'raw':!![]})[_0x7b61('0xd')](function(_0x38450b){if(_0x38450b){if(_0x38450b[_0x7b61('0xe')]){switch(_0x369cd7){case _0x7b61('0xf'):case'ChatQueues':case _0x7b61('0x10'):case'SmsQueues':case _0x7b61('0x11'):case _0x7b61('0x12'):return db[_0x5494d9]['findAll'](queryQueues);case _0x7b61('0x13'):return db[_0x5494d9][_0x7b61('0x14')](queryTelephones);case _0x7b61('0x15'):return db[_0x5494d9][_0x7b61('0x14')](queryTrunks);case _0x7b61('0x16'):return db[_0x5494d9]['findAll'](queryCampaigns);}}else{return db['UserProfileResource'][_0x7b61('0x14')]({'attributes':[_0x7b61('0x17')],'where':{'sectionId':_0x38450b['id']},'raw':!![]})['then'](function(_0x307f63){if(_0x307f63){var _0x170b9b={'where':{'id':_['map'](_0x307f63,_0x7b61('0x17'))},'raw':!![]};switch(_0x5494d9){case _0x7b61('0x6'):_0x170b9b[_0x7b61('0x18')]['role']='telephone';break;case _0x7b61('0x19'):_0x170b9b[_0x7b61('0x18')][_0x7b61('0x1a')]=_0x7b61('0xb');break;}return db[_0x5494d9][_0x7b61('0x14')](_0x170b9b);}else{return[];}});}}else{return[];}})['then'](function(_0x28adaf){return _0x28adaf;});}function joinOrLeaveQueues(_0x38a022,_0x2f4b54,_0xc76e0,_0x4aeb4c){_0x38a022[_0x2f4b54](util[_0x7b61('0x1b')](_0x7b61('0x1c'),_0xc76e0,_0x4aeb4c['name']));if(_0x4aeb4c['Agents']){for(var _0x1406c9=0x0;_0x1406c9<_0x4aeb4c['Agents'][_0x7b61('0x1d')];_0x1406c9+=0x1){_0x38a022[_0x2f4b54](util[_0x7b61('0x1b')](_0x7b61('0x1e'),_0x4aeb4c['Agents'][_0x1406c9][_0x7b61('0x7')]));}}}function joinOrLeave(_0x40d740,_0x24642f,_0x33a365){var _0x5a8d96;if(_0x40d740[_0x7b61('0x1f')][_0x7b61('0x20')]['id']){db[_0x7b61('0x6')]['find']({'attributes':['id',_0x7b61('0x7'),_0x7b61('0x8'),_0x7b61('0x21')],'where':{'id':_0x40d740[_0x7b61('0x1f')][_0x7b61('0x20')]['id']},'include':[{'model':db[_0x7b61('0x22')],'as':_0x7b61('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7b61('0x24')],'as':_0x7b61('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x7b61('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x7b61('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7b61('0x28')],'as':_0x7b61('0x29'),'attributes':['id'],'raw':!![]}]})[_0x7b61('0xd')](function(_0x445baa){if(_0x445baa){_0x5a8d96=_0x445baa;_0x40d740[_0x24642f](util[_0x7b61('0x1b')]('user:%s',_0x445baa['name']));var _0x541a64=[];switch(_0x445baa[_0x7b61('0x8')]){case _0x7b61('0x2a'):_0x40d740[_0x24642f](_0x7b61('0x2b'));_0x40d740[_0x24642f](_0x7b61('0x2c'));if(queryQueues[_0x7b61('0x2d')](_0x7b61('0x2e'))){delete queryQueues['include'];}_0x541a64[_0x7b61('0x2f')](db[_0x7b61('0x30')][_0x7b61('0x14')](queryQueues));_0x541a64[_0x7b61('0x2f')](db[_0x7b61('0x31')][_0x7b61('0x14')](queryQueues));_0x541a64[_0x7b61('0x2f')](db[_0x7b61('0x32')][_0x7b61('0x14')](queryQueues));_0x541a64[_0x7b61('0x2f')](db['SmsQueue'][_0x7b61('0x14')](queryQueues));_0x541a64['push'](db['MailQueue'][_0x7b61('0x14')](queryQueues));_0x541a64['push'](db[_0x7b61('0x33')][_0x7b61('0x14')](queryQueues));_0x541a64[_0x7b61('0x2f')](db[_0x7b61('0x6')][_0x7b61('0x14')](queryTelephones));_0x541a64[_0x7b61('0x2f')](db['Trunk']['findAll'](queryTrunks));_0x541a64[_0x7b61('0x2f')](db[_0x7b61('0x19')]['findAll'](queryCampaigns));_0x541a64[_0x7b61('0x2f')](db['User'][_0x7b61('0x14')](queryAgents));break;case _0x7b61('0x34'):_0x40d740[_0x24642f](_0x7b61('0x2b'));_0x40d740[_0x24642f](_0x7b61('0x2c'));_0x541a64['push'](getAssociatedResources(_0x7b61('0xf'),_0x445baa['userProfileId'],_0x7b61('0x30')));_0x541a64[_0x7b61('0x2f')](getAssociatedResources(_0x7b61('0x35'),_0x445baa[_0x7b61('0x21')],_0x7b61('0x31')));_0x541a64[_0x7b61('0x2f')](getAssociatedResources(_0x7b61('0x10'),_0x445baa[_0x7b61('0x21')],_0x7b61('0x32')));_0x541a64['push'](getAssociatedResources(_0x7b61('0x36'),_0x445baa[_0x7b61('0x21')],_0x7b61('0x37')));_0x541a64[_0x7b61('0x2f')](getAssociatedResources(_0x7b61('0x11'),_0x445baa['userProfileId'],_0x7b61('0x38')));_0x541a64[_0x7b61('0x2f')](getAssociatedResources(_0x7b61('0x12'),_0x445baa[_0x7b61('0x21')],_0x7b61('0x33')));_0x541a64[_0x7b61('0x2f')](getAssociatedResources('Telephones',_0x445baa[_0x7b61('0x21')],_0x7b61('0x6')));_0x541a64[_0x7b61('0x2f')](getAssociatedResources(_0x7b61('0x15'),_0x445baa['userProfileId'],'Trunk'));_0x541a64[_0x7b61('0x2f')](getAssociatedResources(_0x7b61('0x16'),_0x445baa[_0x7b61('0x21')],'Campaign'));_0x541a64[_0x7b61('0x2f')](db[_0x7b61('0x6')]['findAll'](queryAgents));break;case'agent':_0x40d740[_0x24642f](_0x7b61('0x2b'));_0x40d740[_0x24642f](_0x7b61('0x2c'));_0x541a64[_0x7b61('0x2f')](_0x445baa[_0x7b61('0x39')]({'attributes':['id','name']}));_0x541a64['push'](_0x445baa[_0x7b61('0x3a')]({'attributes':['id',_0x7b61('0x7')]}));_0x541a64['push'](_0x445baa[_0x7b61('0x3b')]({'attributes':['id',_0x7b61('0x7')]}));_0x541a64[_0x7b61('0x2f')](_0x445baa[_0x7b61('0x3c')]({'attributes':['id',_0x7b61('0x7')]}));_0x541a64['push'](_0x445baa[_0x7b61('0x3d')]({'attributes':['id',_0x7b61('0x7')]}));_0x541a64[_0x7b61('0x2f')](_0x445baa[_0x7b61('0x3e')]({'attributes':['id','name']}));break;}return BPromise[_0x7b61('0x3f')](_0x541a64);}})['then'](function(_0x58f1df){if(_0x58f1df&&_0x58f1df[_0x7b61('0x1d')]){for(var _0x28b29f=0x0;_0x28b29f<_0x58f1df[_0x7b61('0x1d')];_0x28b29f+=0x1){for(var _0x1d6575=0x0;_0x1d6575<_0x58f1df[_0x28b29f][_0x7b61('0x1d')];_0x1d6575+=0x1){switch(_0x28b29f){case 0x0:joinOrLeaveQueues(_0x40d740,_0x24642f,_0x7b61('0x40'),_0x58f1df[_0x28b29f][_0x1d6575]);break;case 0x1:joinOrLeaveQueues(_0x40d740,_0x24642f,_0x7b61('0x41'),_0x58f1df[_0x28b29f][_0x1d6575]);break;case 0x2:joinOrLeaveQueues(_0x40d740,_0x24642f,_0x7b61('0x42'),_0x58f1df[_0x28b29f][_0x1d6575]);break;case 0x3:joinOrLeaveQueues(_0x40d740,_0x24642f,_0x7b61('0x43'),_0x58f1df[_0x28b29f][_0x1d6575]);break;case 0x4:joinOrLeaveQueues(_0x40d740,_0x24642f,_0x7b61('0x44'),_0x58f1df[_0x28b29f][_0x1d6575]);break;case 0x5:joinOrLeaveQueues(_0x40d740,_0x24642f,_0x7b61('0x45'),_0x58f1df[_0x28b29f][_0x1d6575]);break;case 0x6:_0x40d740[_0x24642f](util[_0x7b61('0x1b')](_0x7b61('0x46'),_0x58f1df[_0x28b29f][_0x1d6575]['name']));break;case 0x7:_0x40d740[_0x24642f](util[_0x7b61('0x1b')](_0x7b61('0x47'),_0x58f1df[_0x28b29f][_0x1d6575][_0x7b61('0x7')]));break;case 0x8:_0x40d740[_0x24642f](util['format']('campaign:%s:%s',_0x58f1df[_0x28b29f][_0x1d6575][_0x7b61('0x1a')],_0x58f1df[_0x28b29f][_0x1d6575]['name']));break;case 0x9:_0x40d740[_0x24642f](util[_0x7b61('0x1b')](_0x7b61('0x1e'),_0x58f1df[_0x28b29f][_0x1d6575][_0x7b61('0x7')]));break;}}}}})[_0x7b61('0xd')](function(){if(_0x24642f==='leave'){var _0x4b93b1=_['map'](_0x5a8d96[_0x7b61('0x23')],'id');return _0x5a8d96[_0x7b61('0x48')](_0x4b93b1)[_0x7b61('0xd')](function(){for(var _0x4c7985=0x0;_0x4c7985<_0x4b93b1['length'];_0x4c7985+=0x1){_0x33a365[_0x7b61('0x49')](_0x7b61('0x4a'),{'ChatInteractionId':Number(_0x4b93b1[_0x4c7985]),'UserId':Number(_0x5a8d96['id'])});}});}})[_0x7b61('0xd')](function(){if(_0x24642f==='leave'){var _0x3e6f28=_[_0x7b61('0x4b')](_0x5a8d96['MailInteractions'],'id');return _0x5a8d96[_0x7b61('0x4c')](_0x3e6f28)['then'](function(){for(var _0x1c46da=0x0;_0x1c46da<_0x3e6f28[_0x7b61('0x1d')];_0x1c46da+=0x1){_0x33a365['emit'](_0x7b61('0x4d'),{'MailInteractionId':Number(_0x3e6f28[_0x1c46da]),'UserId':Number(_0x5a8d96['id'])});}});}})[_0x7b61('0xd')](function(){if(_0x24642f==='leave'){var _0x41d353=_[_0x7b61('0x4b')](_0x5a8d96['FaxInteractions'],'id');return _0x5a8d96[_0x7b61('0x4e')](_0x41d353)[_0x7b61('0xd')](function(){for(var _0x323c9b=0x0;_0x323c9b<_0x41d353[_0x7b61('0x1d')];_0x323c9b+=0x1){_0x33a365[_0x7b61('0x49')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x41d353[_0x323c9b]),'UserId':Number(_0x5a8d96['id'])});}});}})[_0x7b61('0xd')](function(){if(_0x24642f===_0x7b61('0x4f')){var _0x2d5b68=_[_0x7b61('0x4b')](_0x5a8d96['SmsInteractions'],'id');return _0x5a8d96['removeSmsInteractions'](_0x2d5b68)[_0x7b61('0xd')](function(){for(var _0x42b65c=0x0;_0x42b65c<_0x2d5b68[_0x7b61('0x1d')];_0x42b65c+=0x1){_0x33a365['emit'](_0x7b61('0x50'),{'SmsInteractionId':Number(_0x2d5b68[_0x42b65c]),'UserId':Number(_0x5a8d96['id'])});}});}})[_0x7b61('0xd')](function(){if(_0x24642f==='leave'){var _0x410ff9=_[_0x7b61('0x4b')](_0x5a8d96[_0x7b61('0x29')],'id');return _0x5a8d96[_0x7b61('0x51')](_0x410ff9)[_0x7b61('0xd')](function(){for(var _0x3887d7=0x0;_0x3887d7<_0x410ff9[_0x7b61('0x1d')];_0x3887d7+=0x1){_0x33a365[_0x7b61('0x49')](_0x7b61('0x52'),{'OpenchannelInteractionId':Number(_0x410ff9[_0x3887d7]),'UserId':Number(_0x5a8d96['id'])});}});}})[_0x7b61('0x53')](function(_0x36e0d0){_0x40d740[_0x7b61('0x54')](_0x36e0d0);});}}function onDisconnect(_0x4b7c0a,_0x590413){joinOrLeave(_0x4b7c0a,_0x7b61('0x4f'),_0x590413);}function onConnect(_0x5e65af){joinOrLeave(_0x5e65af,_0x7b61('0x55'));}exports[_0x7b61('0x56')]=function(_0x4a2515){_0x4a2515['on'](_0x7b61('0x57'),function(_0x581cbc){_0x581cbc[_0x7b61('0x58')](0x0);_0x581cbc['address']=_0x581cbc['request'][_0x7b61('0x57')][_0x7b61('0x59')]+':'+_0x581cbc[_0x7b61('0x5a')][_0x7b61('0x57')]['remotePort'];_0x581cbc[_0x7b61('0x5b')]=new Date();_0x581cbc[_0x7b61('0x54')]=function(_0x3b7e00){console[_0x7b61('0x54')](_0x7b61('0x5c')+_0x581cbc['nsp']['name']+'['+_0x581cbc[_0x7b61('0x5d')]+']',_0x3b7e00);};_0x581cbc['on']('disconnect',function(){onDisconnect(_0x581cbc,_0x4a2515);_0x581cbc[_0x7b61('0x54')](_0x7b61('0x5e'));});onConnect(_0x581cbc);_0x581cbc[_0x7b61('0x54')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 4e93d96..035464a 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 _0x4bb6=['format','SIP/%s','name','incomingmessage','catch','outgoingmessage','opened','changed','closed','User','find','interface','default','model','callback','toLowerCase','condition','../../mysqldb','jayson/promise','../logger','triggers','http','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','Sms','SmsInteraction','newinteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','OpenchannelInteraction','Openchannel','OpenchannelMessage','EventManager','then','info','Trigger,\x20%s','error','get','channel','event','direction','UserId'];(function(_0xa27c52,_0xe23f1a){var _0x3c47c6=function(_0x161013){while(--_0x161013){_0xa27c52['push'](_0xa27c52['shift']());}};_0x3c47c6(++_0xe23f1a);}(_0x4bb6,0x1a9));var _0x64bb=function(_0x1d382f,_0x317ab2){_0x1d382f=_0x1d382f-0x0;var _0x5ed042=_0x4bb6[_0x1d382f];return _0x5ed042;};'use strict';var util=require('util');var db=require(_0x64bb('0x0'))['db'];var jayson=require(_0x64bb('0x1'));var logger=require(_0x64bb('0x2'))(_0x64bb('0x3'));var client=jayson['client'][_0x64bb('0x4')]({'port':0x232a});var triggers=[{'channel':_0x64bb('0x5'),'model':_0x64bb('0x6'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x64bb('0x5'),'model':_0x64bb('0x6'),'event':_0x64bb('0x7'),'condition':_0x64bb('0x8'),'callback':afterUpdate},{'channel':_0x64bb('0x5'),'model':_0x64bb('0x9'),'event':_0x64bb('0xa'),'condition':_0x64bb('0xb'),'callback':afterCreateMessage},{'channel':_0x64bb('0xc'),'model':_0x64bb('0xd'),'event':_0x64bb('0xa'),'condition':_0x64bb('0xe'),'callback':afterCreate},{'channel':_0x64bb('0xc'),'model':_0x64bb('0xd'),'event':'afterUpdate','condition':_0x64bb('0x8'),'callback':afterUpdate},{'channel':'Sms','model':_0x64bb('0xf'),'event':_0x64bb('0xa'),'condition':_0x64bb('0xb'),'callback':afterCreateMessage},{'channel':_0x64bb('0x10'),'model':_0x64bb('0x11'),'event':_0x64bb('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x64bb('0x10'),'model':_0x64bb('0x11'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x64bb('0x12'),'event':_0x64bb('0xa'),'condition':_0x64bb('0xb'),'callback':afterCreateMessage},{'channel':_0x64bb('0x13'),'model':_0x64bb('0x14'),'event':'afterCreate','condition':_0x64bb('0xe'),'callback':afterCreate},{'channel':_0x64bb('0x13'),'model':_0x64bb('0x14'),'event':_0x64bb('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x64bb('0x13'),'model':'MailMessage','event':'afterCreate','condition':_0x64bb('0xb'),'callback':afterCreateMessage},{'channel':'Openchannel','model':_0x64bb('0x15'),'event':_0x64bb('0xa'),'condition':_0x64bb('0xe'),'callback':afterCreate},{'channel':_0x64bb('0x16'),'model':_0x64bb('0x15'),'event':_0x64bb('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0x64bb('0x17'),'event':_0x64bb('0xa'),'condition':_0x64bb('0xb'),'callback':afterCreateMessage}];function request(_0x271b95){return client['request'](_0x64bb('0x18'),_0x271b95)[_0x64bb('0x19')](function(_0x4f7107){logger[_0x64bb('0x1a')](_0x64bb('0x1b'),'EventManager',_0x4f7107);if(_0x4f7107['error']){if(_0x4f7107[_0x64bb('0x1c')]['code']===0x1f4){logger[_0x64bb('0x1c')](_0x64bb('0x1b'),'EventManager',_0x4f7107[_0x64bb('0x1c')]);}}})['catch'](function(_0x7f4447){logger['error'](_0x64bb('0x1b'),'EventManager',_0x7f4447);});}function afterCreateMessage(_0x4bb3a6,_0x2f5687){return function(_0x4bae1e,_0x3e5e49){_0x4bae1e=_0x4bae1e[_0x64bb('0x1d')]({'plain':!![]});_0x4bae1e[_0x64bb('0x1e')]=_0x4bb3a6;_0x4bae1e[_0x64bb('0x1f')]=_0x4bae1e[_0x64bb('0x20')];if(_0x4bae1e[_0x64bb('0x21')]){return db['User']['find']({'where':{'id':_0x4bae1e['UserId']},'attributes':['id','name'],'raw':!![]})[_0x64bb('0x19')](function(_0x512cf9){_0x4bae1e['interface']=util[_0x64bb('0x22')](_0x64bb('0x23'),_0x512cf9[_0x64bb('0x24')]);_0x4bae1e['channel']=_0x4bb3a6;return request({'event':_0x64bb('0x25'),'message':_0x4bae1e});})[_0x64bb('0x26')](function(_0x333f56){console['error'](_0x333f56);});}else{return request({'event':_0x64bb('0x27'),'message':_0x4bae1e});}};}function afterCreate(_0x5b92d2,_0x28f396){return function(_0x42595c,_0xd340d0){_0x42595c=_0x42595c[_0x64bb('0x1d')]({'plain':!![]});_0x42595c[_0x64bb('0x1e')]=_0x5b92d2;_0x42595c['event']=_0x64bb('0x28');return request({'event':_0x28f396,'message':_0x42595c});};}function afterUpdate(_0x18bb2b,_0x5552d6){return function(_0x71f33f,_0x501c01){if(_0x71f33f[_0x64bb('0x29')](_0x64bb('0x2a'))&&_0x71f33f['closed']){_0x71f33f=_0x71f33f[_0x64bb('0x1d')]({'plain':!![]});_0x71f33f[_0x64bb('0x1e')]=_0x18bb2b;_0x71f33f[_0x64bb('0x1f')]=_0x64bb('0x2a');if(_0x71f33f['UserId']){return db[_0x64bb('0x2b')][_0x64bb('0x2c')]({'where':{'id':_0x71f33f[_0x64bb('0x21')]},'attributes':['id','name'],'raw':!![]})[_0x64bb('0x19')](function(_0x1e2928){_0x71f33f[_0x64bb('0x2d')]=util['format'](_0x64bb('0x23'),_0x1e2928[_0x64bb('0x24')]);return request({'event':_0x5552d6,'message':_0x71f33f});})[_0x64bb('0x26')](function(_0x12966b){console[_0x64bb('0x1c')](_0x12966b);});}else{return request({'event':_0x5552d6,'message':_0x71f33f});}}};}exports[_0x64bb('0x2e')]=function(){for(var _0x7a5ff6=0x0;_0x7a5ff6=_0x41d8d4['agents']){throw Error(_0x5c7f('0x12'));}_0x47dcd9(_0x4e16a0);})['catch'](function(_0xfb896c){_0x2a56f6(_0xfb896c);});});}; \ No newline at end of file +var _0x9d88=['./license/util','voice','mail','chat','fax','sms','isValidChannel','toLowerCase','includes','isUndefined','blockedAt','updateAttributes','role','User','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x9d88,0x156));var _0x89d8=function(_0x4b2c4e,_0x3e9d91){_0x4b2c4e=_0x4b2c4e-0x0;var _0x46812a=_0x9d88[_0x4b2c4e];return _0x46812a;};'use strict';var _=require(_0x89d8('0x0'));var BPromise=require(_0x89d8('0x1'));var db=require(_0x89d8('0x2'))['db'];var util=require(_0x89d8('0x3'));var channels=[_0x89d8('0x4'),_0x89d8('0x5'),_0x89d8('0x6'),_0x89d8('0x7'),_0x89d8('0x8'),'openchannel'];exports['getChannels']=function(){return channels;};exports[_0x89d8('0x9')]=function(_0x446964){_0x446964=_0x446964[_0x89d8('0xa')]();return _[_0x89d8('0xb')](channels,_0x446964);};exports['clearBlockUser']=function(_0x55c28e,_0x25b492,_0x6aed31,_0x40c12c){var _0x138f55={'loginAttempts':_0x25b492,'blocked':_0x6aed31};if(!_[_0x89d8('0xc')](_0x40c12c)){_0x138f55[_0x89d8('0xd')]=_0x40c12c;}return _0x55c28e[_0x89d8('0xe')](_0x138f55);};exports['getLicense']=function(_0x1fa531){return new BPromise(function(_0xa227b5,_0x54125c){var _0x16442e=0x0;if(_0x1fa531[_0x89d8('0xf')]!=='agent'){_0xa227b5(_0x1fa531);}db[_0x89d8('0x10')][_0x89d8('0x11')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1fa531['id']}}})[_0x89d8('0x12')](function(_0x47fa8f){_0x16442e=_0x47fa8f;return util[_0x89d8('0x13')]();})[_0x89d8('0x12')](function(_0x66dcdb){if(_0x66dcdb&&_0x66dcdb[_0x89d8('0x14')]&&_0x16442e>=_0x66dcdb['agents']){throw Error(_0x89d8('0x15'));}_0xa227b5(_0x1fa531);})[_0x89d8('0x16')](function(_0x1b2735){_0x54125c(_0x1b2735);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index d60dae3..a413c16 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd17=['404','status','json','send','exports'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0xfd17,0xbd));var _0x7fd1=function(_0x1d5458,_0x3acf09){_0x1d5458=_0x1d5458-0x0;var _0x9bf6f=_0xfd17[_0x1d5458];return _0x9bf6f;};'use strict';module[_0x7fd1('0x0')][0x194]=function pageNotFound(_0x52b07b,_0x4443a5){var _0x9a4142=_0x7fd1('0x1');var _0x63f83f=0x194;var _0x5172b2={'status':_0x63f83f};_0x4443a5[_0x7fd1('0x2')](_0x5172b2[_0x7fd1('0x2')]);_0x4443a5['render'](_0x9a4142,{},function(_0x1539b7,_0x42f63f){if(_0x1539b7){return _0x4443a5[_0x7fd1('0x2')](_0x5172b2[_0x7fd1('0x2')])[_0x7fd1('0x3')](_0x5172b2);}_0x4443a5[_0x7fd1('0x4')](_0x42f63f);});}; \ No newline at end of file +var _0x8eda=['status','render','json','send','exports','404'];(function(_0x201755,_0x4ae02f){var _0x5bdd2b=function(_0x215835){while(--_0x215835){_0x201755['push'](_0x201755['shift']());}};_0x5bdd2b(++_0x4ae02f);}(_0x8eda,0x1f0));var _0xa8ed=function(_0x31ed53,_0x27e8ff){_0x31ed53=_0x31ed53-0x0;var _0x105dd6=_0x8eda[_0x31ed53];return _0x105dd6;};'use strict';module[_0xa8ed('0x0')][0x194]=function pageNotFound(_0xf7af7d,_0x10fcd2){var _0x51ce0f=_0xa8ed('0x1');var _0x15697b=0x194;var _0x596f36={'status':_0x15697b};_0x10fcd2['status'](_0x596f36[_0xa8ed('0x2')]);_0x10fcd2[_0xa8ed('0x3')](_0x51ce0f,{},function(_0xcbb548,_0x12ae70){if(_0xcbb548){return _0x10fcd2['status'](_0x596f36[_0xa8ed('0x2')])[_0xa8ed('0x4')](_0x596f36);}_0x10fcd2[_0xa8ed('0x5')](_0x12ae70);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 835f677..29bb51f 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9828=['../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','userProfileId','chat_group_has_users','belongsToMany','CmContact','Contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','FaxInteraction','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueue','FaxQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','VoiceMusicOnHold','moh_has_sounds','UserVoiceQueueRt','Members','Hoppers','VoiceQueueId','CmHopperFinal','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','belongsTo','TrunkBackup','IntervalId','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','UserVoiceQueue','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','hasOne','Imap','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','MailInteractionId','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','Interaction','Account','restrict','TagId','DashboardItem','FaxAccountId','FaxQueue','Tag','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','CannedAnswer','SmsInteractionId','Tags','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','ChatQueue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','CompanyId','Company','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','Any','OneAny','Action','Actions','Intervals','MailApplications','ChatApplications','Schedule','AnalyticDefaultReport','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','DeskAccount','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','ServicenowField','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyProject','ProjectId','team_has_mail_queues','MailQueues','ChatQueues','SmsQueues','TrunkId','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromUserId','ToChatQueueId','ToFaxQueueId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','sectionId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','name','utf8','sequelizeHistory','xC@LL1234','utf8mb4','utf8_general_ci','username','password','options','database','User','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../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/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatQueue/chatQueue.model','ChatGroup','../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','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport'];(function(_0x3fa075,_0xa7d491){var _0x39bc92=function(_0x10b86b){while(--_0x10b86b){_0x3fa075['push'](_0x3fa075['shift']());}};_0x39bc92(++_0xa7d491);}(_0x9828,0xef));var _0x8982=function(_0x2c3ed2,_0x46d8cc){_0x2c3ed2=_0x2c3ed2-0x0;var _0x1fd82b=_0x9828[_0x2c3ed2];return _0x1fd82b;};'use strict';var path=require('path');var config=require(_0x8982('0x0'));var Sequelize=require(_0x8982('0x1'));var _=require(_0x8982('0x2'));var jstz=require(_0x8982('0x3'));var timezone=jstz[_0x8982('0x4')]();config[_0x8982('0x1')]=_[_0x8982('0x5')](config[_0x8982('0x1')],{'database':_0x8982('0x6'),'username':_0x8982('0x7'),'password':'xC@LL1234','options':{'host':_0x8982('0x8'),'port':0xcea,'dialect':_0x8982('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8982('0xa')](),'define':{'charset':_0x8982('0xb'),'collate':'utf8_general_ci'}}});config[_0x8982('0xc')]=_[_0x8982('0x5')](config['sequelizeHistory'],{'database':_0x8982('0x6'),'username':_0x8982('0x7'),'password':_0x8982('0xd'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8982('0x9'),'dialectOptions':{'charset':_0x8982('0xe')},'logging':![],'timezone':timezone[_0x8982('0xa')](),'define':{'charset':'utf8','collate':_0x8982('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8982('0x1')]['database'],config[_0x8982('0x1')][_0x8982('0x10')],config['sequelize'][_0x8982('0x11')],config['sequelize'][_0x8982('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8982('0xc')][_0x8982('0x13')],config[_0x8982('0xc')]['username'],config[_0x8982('0xc')][_0x8982('0x11')],config[_0x8982('0xc')][_0x8982('0x12')])};db[_0x8982('0x14')]=db['sequelize'][_0x8982('0x15')]('../api/user/user.model');db[_0x8982('0x16')]=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db['sequelize'][_0x8982('0x15')](_0x8982('0x17'));db['VoiceExtension']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db['sequelize'][_0x8982('0x15')](_0x8982('0x18'));db[_0x8982('0x19')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x1a'));db[_0x8982('0x1b')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0x8982('0x1c')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x1d'));db[_0x8982('0x1e')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x1f'));db[_0x8982('0x20')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x21'));db[_0x8982('0x22')]=db[_0x8982('0x1')]['import'](_0x8982('0x23'));db[_0x8982('0x24')]=db[_0x8982('0x1')]['import'](_0x8982('0x25'));db[_0x8982('0x26')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x27'));db[_0x8982('0x28')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x29'));db[_0x8982('0x2a')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/memberReport/memberReport.model');db[_0x8982('0x2b')]=db[_0x8982('0x1')]['import'](_0x8982('0x2c'));db[_0x8982('0x2d')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x2e'));db['UserVoiceQueueRt']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x2f'));db[_0x8982('0x30')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x31'));db[_0x8982('0x32')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x33'));db[_0x8982('0x34')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x35'));db[_0x8982('0x36')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x37'));db[_0x8982('0x38')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x39'));db['MailServerIn']=db['sequelize']['import'](_0x8982('0x3a'));db[_0x8982('0x3b')]=db[_0x8982('0x1')]['import'](_0x8982('0x3c'));db[_0x8982('0x3d')]=db[_0x8982('0x1')]['import'](_0x8982('0x3e'));db['MailQueue']=db[_0x8982('0x1')]['import'](_0x8982('0x3f'));db['MailSubstatus']=db[_0x8982('0x1')]['import'](_0x8982('0x40'));db[_0x8982('0x41')]=db[_0x8982('0x1')]['import'](_0x8982('0x42'));db[_0x8982('0x43')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x44'));db[_0x8982('0x45')]=db[_0x8982('0x1')]['import'](_0x8982('0x46'));db[_0x8982('0x47')]=db[_0x8982('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x8982('0x48')]=db['sequelize']['import'](_0x8982('0x49'));db['DashboardItem']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x4a'));db['FaxAccount']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x4b'));db[_0x8982('0x4c')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x4d'));db['FaxInteraction']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x4e'));db[_0x8982('0x4f')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x50'));db['FaxQueue']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x51'));db[_0x8982('0x52')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x53'));db[_0x8982('0x54')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/smsAccount/smsAccount.model');db[_0x8982('0x55')]=db[_0x8982('0x1')]['import']('../api/smsApplication/smsApplication.model');db[_0x8982('0x56')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x57'));db[_0x8982('0x58')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x59'));db[_0x8982('0x5a')]=db[_0x8982('0x1')]['import'](_0x8982('0x5b'));db[_0x8982('0x5c')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x5d'));db[_0x8982('0x5e')]=db['sequelize']['import'](_0x8982('0x5f'));db[_0x8982('0x60')]=db[_0x8982('0x1')]['import'](_0x8982('0x61'));db[_0x8982('0x62')]=db[_0x8982('0x1')]['import'](_0x8982('0x63'));db[_0x8982('0x64')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x65'));db[_0x8982('0x66')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x67'));db['OpenchannelQueueReport']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x68'));db[_0x8982('0x69')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x6a'));db[_0x8982('0x6b')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/chatMessage/chatMessage.model');db[_0x8982('0x6c')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x6d'));db[_0x8982('0x6e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x6f'));db[_0x8982('0x70')]=db[_0x8982('0x1')]['import'](_0x8982('0x71'));db[_0x8982('0x72')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x73'));db['CmContact']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x74'));db[_0x8982('0x75')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x76'));db[_0x8982('0x77')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x78'));db['CmHopperFinal']=db['sequelize'][_0x8982('0x15')](_0x8982('0x79'));db[_0x8982('0x7a')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x7b'));db[_0x8982('0x7c')]=db[_0x8982('0x1')]['import'](_0x8982('0x7d'));db[_0x8982('0x7e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x7f'));db['Action']=db[_0x8982('0x1')]['import'](_0x8982('0x80'));db[_0x8982('0x81')]=db[_0x8982('0x1')]['import'](_0x8982('0x82'));db['CannedAnswer']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0x8982('0x83')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x84'));db[_0x8982('0x85')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/condition/condition.model');db[_0x8982('0x86')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/interval/interval.model');db[_0x8982('0x87')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x88'));db[_0x8982('0x89')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x8a'));db[_0x8982('0x8b')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x8c'));db['Schedule']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x8d'));db[_0x8982('0x8e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x8f'));db['Tag']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x90'));db[_0x8982('0x91')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x92'));db[_0x8982('0x93')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x94'));db[_0x8982('0x95')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x96'));db[_0x8982('0x97')]=db['sequelize']['import'](_0x8982('0x98'));db['IntegrationReport']=db[_0x8982('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0x8982('0x99')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x9a'));db['AnalyticDefaultReport']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x9b'));db[_0x8982('0x9c')]=db['sequelize']['import'](_0x8982('0x9d'));db[_0x8982('0x9e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x9f'));db[_0x8982('0xa0')]=db[_0x8982('0x1')]['import'](_0x8982('0xa1'));db[_0x8982('0xa2')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa3'));db[_0x8982('0xa4')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa5'));db[_0x8982('0xa6')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa7'));db[_0x8982('0xa8')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa9'));db[_0x8982('0xaa')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xab'));db[_0x8982('0xac')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xad'));db[_0x8982('0xae')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xaf'));db['DeskAccount']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xb0'));db[_0x8982('0xb1')]=db['sequelize']['import'](_0x8982('0xb2'));db[_0x8982('0xb3')]=db[_0x8982('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0x8982('0xb4')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xb5'));db[_0x8982('0xb6')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xb7'));db['ZohoField']=db['sequelize'][_0x8982('0x15')](_0x8982('0xb8'));db[_0x8982('0xb9')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xba'));db[_0x8982('0xbb')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xbc'));db[_0x8982('0xbd')]=db[_0x8982('0x1')]['import'](_0x8982('0xbe'));db[_0x8982('0xbf')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xc0'));db[_0x8982('0xc1')]=db[_0x8982('0x1')]['import'](_0x8982('0xc2'));db['FreshdeskField']=db['sequelize']['import'](_0x8982('0xc3'));db[_0x8982('0xc4')]=db[_0x8982('0x1')]['import'](_0x8982('0xc5'));db[_0x8982('0xc6')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xc7'));db['VtigerField']=db[_0x8982('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x8982('0xc8')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xc9'));db[_0x8982('0xca')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xcb'));db['ServicenowField']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xcc'));db[_0x8982('0xcd')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xce'));db[_0x8982('0xcf')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x8982('0xd0')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8982('0xd1')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x8982('0x1')]['import'](_0x8982('0xd2'));db[_0x8982('0xd3')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xd4'));db['Integration']=db['sequelize'][_0x8982('0x15')]('../api/integration/integration.model');db['Network']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xd5'));db[_0x8982('0xd6')]=db[_0x8982('0x1')]['import'](_0x8982('0xd7'));db[_0x8982('0xd8')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xd9'));db[_0x8982('0xda')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xdb'));db['JscriptyQuestionReport']=db[_0x8982('0x1')]['import'](_0x8982('0xdc'));db['JscriptySessionReport']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xdd'));db[_0x8982('0xde')]=db['sequelize']['import'](_0x8982('0xdf'));db[_0x8982('0xe0')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xe1'));db[_0x8982('0xe2')]=db[_0x8982('0x1')]['import'](_0x8982('0xe3'));db['JscriptyProject']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/jscriptyProject/jscriptyProject.model');db[_0x8982('0xe4')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xe5'));db['SquareOdbc']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xe6'));db[_0x8982('0xe7')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xe8'));db[_0x8982('0xe9')]=db[_0x8982('0x1')]['import'](_0x8982('0xea'));db[_0x8982('0xeb')]=db[_0x8982('0x1')]['import'](_0x8982('0xec'));db[_0x8982('0xed')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xee'));db[_0x8982('0xef')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xf0'));db['Campaign']=db[_0x8982('0x1')]['import'](_0x8982('0xf1'));db[_0x8982('0xf2')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/migration/migration.model');db['Attachment']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xf3'));db[_0x8982('0xf4')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xf5'));db[_0x8982('0xf6')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0x8982('0xf7')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0x8982('0xf8')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0x8982('0xf9')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x8982('0xfa')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xfb'));db[_0x8982('0xfc')]=db[_0x8982('0x1')]['import']('../api/cmList/cmList.model');db[_0x8982('0xfd')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xfe'));db[_0x8982('0xff')]=db[_0x8982('0x1')]['import']('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x100'));db['UserProfileResource']=db[_0x8982('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0x8982('0x14')]['hasOne'](db[_0x8982('0x1e')],{'as':_0x8982('0x1e'),'onDelete':_0x8982('0x101'),'foreignKey':'UserId'});db[_0x8982('0x14')][_0x8982('0x102')](db['VoiceRecording'],{'as':_0x8982('0x103'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db['UserVoiceQueueRt'],{'as':_0x8982('0x105'),'foreignKey':'UserId'});db[_0x8982('0x14')]['hasMany'](db[_0x8982('0x106')],{'as':_0x8982('0x107'),'onDelete':_0x8982('0x101'),'hooks':!![]});db[_0x8982('0x14')][_0x8982('0x102')](db['CmHopperFinal'],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x109'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x7c')],{'as':_0x8982('0x7c'),'foreignKey':_0x8982('0x104')});db['User'][_0x8982('0x102')](db[_0x8982('0x60')],{'as':_0x8982('0x10a'),'foreignKey':_0x8982('0x104')});db['User'][_0x8982('0x102')](db[_0x8982('0x69')],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x56')],{'as':_0x8982('0x10b'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db['FaxInteraction'],{'as':_0x8982('0x10c'),'foreignKey':'UserId'});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x41')],{'as':_0x8982('0x10d'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')]['belongsTo'](db[_0x8982('0xff')],{'as':_0x8982('0xff'),'foreignKey':_0x8982('0x10e')});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x6e')],{'as':'Groups','through':_0x8982('0x10f')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x111')],{'as':_0x8982('0x112'),'through':'cm_user_has_contacts'});db['User'][_0x8982('0x110')](db['CmList'],{'as':'Lists','through':_0x8982('0x113')});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0xed')],{'through':_0x8982('0x114')});db[_0x8982('0x14')][_0x8982('0x110')](db['MailInteraction'],{'as':_0x8982('0x10d'),'through':_0x8982('0x115')});db['User'][_0x8982('0x110')](db[_0x8982('0x69')],{'as':_0x8982('0x116'),'through':'user_has_chat_interactions'});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x117')],{'as':_0x8982('0x10c'),'through':_0x8982('0x118')});db['User'][_0x8982('0x110')](db[_0x8982('0x56')],{'as':'SmsInteractions','through':_0x8982('0x119')});db[_0x8982('0x14')][_0x8982('0x110')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x19')],{'as':_0x8982('0x11a'),'through':'UserVoiceQueue','required':![]});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x11b')],{'as':'MailQueues','through':_0x8982('0x32'),'required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db['ChatQueue'],{'as':'ChatQueues','through':_0x8982('0x30'),'required':![],'hooks':!![]});db[_0x8982('0x14')]['belongsToMany'](db['FaxQueue'],{'as':_0x8982('0x11c'),'through':_0x8982('0x34'),'required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x5a')],{'as':'SmsQueues','through':_0x8982('0x36'),'required':![]});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x64')],{'as':_0x8982('0x11d'),'through':'UserOpenchannelQueue','required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0xfc')],{'through':'cm_user_has_lists'});db['User'][_0x8982('0x110')](db[_0x8982('0xfd')],{'as':_0x8982('0x11e'),'through':_0x8982('0x11f'),'required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x66')],{'as':_0x8982('0x120'),'through':_0x8982('0x121')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x122')],{'as':_0x8982('0x123'),'through':_0x8982('0x124')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x3d')],{'as':_0x8982('0x125'),'through':_0x8982('0x126')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x5c')],{'as':_0x8982('0x127'),'through':_0x8982('0x128')});db[_0x8982('0x14')]['belongsToMany'](db['SmsAccount'],{'as':'SmsAccounts','through':_0x8982('0x129')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0xe7')],{'as':_0x8982('0x12a'),'through':_0x8982('0x12b')});db['VoiceChanSpy'][_0x8982('0x102')](db[_0x8982('0x106')],{'as':_0x8982('0x12c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x12d')});db[_0x8982('0x12e')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x8982('0x101')});db[_0x8982('0x106')]['hasMany'](db[_0x8982('0x106')],{'as':_0x8982('0x12f'),'onDelete':'cascade'});db[_0x8982('0x130')][_0x8982('0x110')](db[_0x8982('0x8e')],{'as':'Sounds','through':_0x8982('0x131')});db['VoiceQueue']['hasMany'](db[_0x8982('0x132')],{'as':_0x8982('0x133'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x8982('0x102')](db['CmHopper'],{'as':_0x8982('0x134'),'foreignKey':_0x8982('0x135')});db[_0x8982('0x19')]['hasMany'](db[_0x8982('0x136')],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x135')});db[_0x8982('0x19')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x137'),'foreignKey':'VoiceQueueId'});db[_0x8982('0x19')]['hasMany'](db[_0x8982('0x7c')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x8982('0x19')]['hasMany'](db['CmHopperBlack'],{'as':_0x8982('0x138'),'foreignKey':_0x8982('0x135')});db[_0x8982('0x19')][_0x8982('0x102')](db[_0x8982('0x139')],{'as':_0x8982('0x13a'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x8982('0x13b')](db['Trunk'],{'as':_0x8982('0x2b'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0x8982('0x13b')](db['Trunk'],{'as':_0x8982('0x13c'),'foreignKey':'TrunkBackupId'});db['VoiceQueue']['belongsTo'](db[_0x8982('0x86')],{'as':'Interval','foreignKey':_0x8982('0x13d')});db[_0x8982('0x19')][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x8982('0x13e')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0xfc')],{'as':_0x8982('0x13f'),'through':_0x8982('0x140')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x142')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0xed')],{'as':_0x8982('0x143'),'through':_0x8982('0x144')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0xfc')],{'as':_0x8982('0x145'),'through':_0x8982('0x146')});db[_0x8982('0x1b')][_0x8982('0x13b')](db['User'],{'as':'User','foreignKey':_0x8982('0x104')});db[_0x8982('0x1c')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14'),'foreignKey':'UserId'});db[_0x8982('0x1e')]['hasMany'](db[_0x8982('0x20')],{'as':_0x8982('0x147'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x148'),'sourceKey':_0x8982('0x149')});db['VoiceMailMessage'][_0x8982('0x13b')](db[_0x8982('0x1e')],{'foreignKey':_0x8982('0x148'),'targetKey':_0x8982('0x149')});db['VoiceCallReport'][_0x8982('0x102')](db[_0x8982('0x28')],{'as':_0x8982('0x14a'),'foreignKey':_0x8982('0x14b'),'constraints':![]});db[_0x8982('0x22')]['hasMany'](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x8982('0x14b'),'constraints':![]});db[_0x8982('0x22')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x22')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x14e')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'as':_0x8982('0x3d'),'foreignKey':_0x8982('0x14f')});db[_0x8982('0x3b')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'as':_0x8982('0x3d'),'foreignKey':_0x8982('0x14f')});db[_0x8982('0x3d')][_0x8982('0x150')](db[_0x8982('0x14e')],{'as':_0x8982('0x151'),'onDelete':_0x8982('0x101')});db[_0x8982('0x3d')][_0x8982('0x150')](db[_0x8982('0x3b')],{'as':'Smtp','onDelete':'cascade'});db['MailAccount']['hasMany'](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x14f')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0x8982('0x153'),'foreignKey':'MailAccountId'});db[_0x8982('0x3d')][_0x8982('0x102')](db[_0x8982('0x43')],{'as':_0x8982('0x147'),'foreignKey':_0x8982('0x14f')});db[_0x8982('0x3d')][_0x8982('0x102')](db[_0x8982('0x41')],{'as':_0x8982('0x154')});db[_0x8982('0x3d')]['hasMany'](db[_0x8982('0x45')],{'as':_0x8982('0x12f')});db[_0x8982('0x3d')]['belongsTo'](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0x3d')]['belongsTo'](db['Template'],{'as':_0x8982('0x91'),'foreignKey':_0x8982('0x157')});db[_0x8982('0x3d')][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x3d')]['belongsToMany'](db[_0x8982('0x14')],{'as':'Agents','through':_0x8982('0x126')});db[_0x8982('0x11b')]['belongsToMany'](db['User'],{'as':_0x8982('0x141'),'through':_0x8982('0x32')});db['MailQueue']['belongsToMany'](db['Team'],{'through':'team_has_mail_queues','as':_0x8982('0x143')});db[_0x8982('0x41')][_0x8982('0x102')](db[_0x8982('0x43')],{'as':_0x8982('0x147'),'onDelete':'cascade','foreignKey':_0x8982('0x159')});db[_0x8982('0x41')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'as':'Account','foreignKey':_0x8982('0x14f')});db['MailInteraction'][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0x41')]['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x41')][_0x8982('0x110')](db['Tag'],{'through':'mail_interaction_has_tags','as':'Tags'});db['MailInteraction'][_0x8982('0x110')](db['Tag'],{'through':_0x8982('0x15b'),'as':_0x8982('0x15c')});db['MailInteraction'][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':_0x8982('0x115'),'foreignKey':'MailInteractionId'});db[_0x8982('0x43')][_0x8982('0x102')](db[_0x8982('0x15e')],{'as':_0x8982('0x15f'),'onDelete':_0x8982('0x101')});db['MailMessage'][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14')});db[_0x8982('0x43')][_0x8982('0x13b')](db['CmContact'],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14c')});db[_0x8982('0x43')][_0x8982('0x13b')](db[_0x8982('0x41')],{'as':_0x8982('0x160'),'foreignKey':_0x8982('0x159')});db[_0x8982('0x43')][_0x8982('0x13b')](db['MailAccount'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x14f')});db['MailApplication'][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x45')][_0x8982('0x13b')](db[_0x8982('0x11b')],{'onDelete':_0x8982('0x162')});db['MailApplication'][_0x8982('0x13b')](db['MailAccount'],{'onDelete':'restrict'});db[_0x8982('0x45')][_0x8982('0x13b')](db[_0x8982('0x86')],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x13d')});db[_0x8982('0x45')][_0x8982('0x13b')](db['Tag'],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x163')});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':'List','foreignKey':_0x8982('0x156')});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0x41')],{});db['MailQueueReport']['belongsTo'](db['MailMessage'],{});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0x14')],{});db[_0x8982('0x47')]['belongsTo'](db[_0x8982('0x11b')],{});db['Dashboard']['hasMany'](db[_0x8982('0x164')],{'as':'Items','onDelete':'cascade'});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x165')});db['FaxAccount'][_0x8982('0x102')](db['CannedAnswer'],{'as':_0x8982('0x153'),'foreignKey':_0x8982('0x165')});db[_0x8982('0x122')][_0x8982('0x102')](db['FaxInteraction'],{'as':_0x8982('0x154')});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x4c')],{'as':_0x8982('0x12f')});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x106')],{'as':'Exntensions','onDelete':_0x8982('0x101')});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x4f')],{'as':_0x8982('0x147')});db[_0x8982('0x122')][_0x8982('0x13b')](db['Trunk'],{'as':_0x8982('0x2b')});db[_0x8982('0x122')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0x122')]['belongsTo'](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8982('0x122')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x124')});db[_0x8982('0x4c')][_0x8982('0x13b')](db['User'],{'onDelete':_0x8982('0x162')});db[_0x8982('0x4c')][_0x8982('0x13b')](db[_0x8982('0x166')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x4c')][_0x8982('0x13b')](db[_0x8982('0x122')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x4c')][_0x8982('0x13b')](db[_0x8982('0x167')],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x163')});db[_0x8982('0x117')]['hasMany'](db[_0x8982('0x4f')],{'as':_0x8982('0x147'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x168')});db[_0x8982('0x117')][_0x8982('0x13b')](db[_0x8982('0x122')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x165')});db[_0x8982('0x117')][_0x8982('0x13b')](db['CmContact'],{'as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0x117')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0x8982('0x117')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x8982('0x117')]['belongsToMany'](db['Tag'],{'through':_0x8982('0x169'),'as':_0x8982('0x15c')});db[_0x8982('0x117')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':_0x8982('0x118'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14')});db[_0x8982('0x4f')][_0x8982('0x13b')](db[_0x8982('0x117')],{'as':_0x8982('0x160'),'foreignKey':'FaxInteractionId'});db[_0x8982('0x4f')][_0x8982('0x13b')](db['CmContact'],{'onDelete':_0x8982('0x101'),'as':'Contact'});db['FaxMessage'][_0x8982('0x13b')](db[_0x8982('0x15e')],{'as':_0x8982('0x15e'),'foreignKey':_0x8982('0x16a')});db[_0x8982('0x4f')]['belongsTo'](db['FaxAccount'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x165')});db[_0x8982('0x166')]['belongsToMany'](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':'UserFaxQueue'});db['FaxQueue'][_0x8982('0x110')](db['Team'],{'through':_0x8982('0x16b'),'as':_0x8982('0x143')});db[_0x8982('0x52')][_0x8982('0x13b')](db[_0x8982('0x122')],{});db[_0x8982('0x52')]['belongsTo'](db['CmList'],{'as':_0x8982('0x155'),'foreignKey':'ListId'});db[_0x8982('0x52')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x52')][_0x8982('0x13b')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x8982('0x13b')](db[_0x8982('0x4f')],{});db[_0x8982('0x52')][_0x8982('0x13b')](db['User'],{});db[_0x8982('0x52')][_0x8982('0x13b')](db['FaxQueue'],{});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x16c')});db['SmsAccount']['hasMany'](db[_0x8982('0x16d')],{'as':_0x8982('0x153'),'foreignKey':_0x8982('0x16c')});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x58')],{'as':_0x8982('0x147'),'foreignKey':_0x8982('0x16c')});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x56')],{'as':'Interactions'});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x55')],{'as':_0x8982('0x12f')});db[_0x8982('0x54')][_0x8982('0x13b')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x8982('0x54')]['belongsTo'](db['Pause'],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x54')][_0x8982('0x110')](db['User'],{'as':_0x8982('0x141'),'through':_0x8982('0x129')});db[_0x8982('0x55')][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x162')});db['SmsApplication'][_0x8982('0x13b')](db['SmsQueue'],{'onDelete':'restrict'});db[_0x8982('0x55')][_0x8982('0x13b')](db[_0x8982('0x54')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x55')]['belongsTo'](db['Interval'],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x13d')});db[_0x8982('0x55')][_0x8982('0x13b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x8982('0x163')});db[_0x8982('0x56')][_0x8982('0x102')](db[_0x8982('0x58')],{'as':_0x8982('0x147'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x16e')});db[_0x8982('0x56')][_0x8982('0x13b')](db[_0x8982('0x54')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x16c')});db['SmsInteraction'][_0x8982('0x13b')](db['CmContact'],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x56')]['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x56')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':'sms_interaction_has_tags','as':_0x8982('0x16f')});db[_0x8982('0x56')][_0x8982('0x110')](db['Tag'],{'through':_0x8982('0x170'),'as':_0x8982('0x15c')});db[_0x8982('0x56')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':_0x8982('0x119'),'foreignKey':_0x8982('0x16e')});db[_0x8982('0x58')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14')});db[_0x8982('0x58')][_0x8982('0x13b')](db[_0x8982('0x111')],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14c')});db[_0x8982('0x58')][_0x8982('0x13b')](db[_0x8982('0x56')],{'onDelete':'cascade','as':_0x8982('0x160'),'foreignKey':'SmsInteractionId'});db[_0x8982('0x58')][_0x8982('0x13b')](db['SmsAccount'],{'as':_0x8982('0x161'),'foreignKey':'SmsAccountId'});db[_0x8982('0x5a')][_0x8982('0x110')](db['User'],{'as':_0x8982('0x141'),'through':_0x8982('0x36'),'foreignKey':_0x8982('0x171')});db[_0x8982('0x5a')][_0x8982('0x110')](db[_0x8982('0xed')],{'through':_0x8982('0x172'),'as':_0x8982('0x143')});db['OpenchannelAccount']['hasMany'](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0x8982('0x5c')][_0x8982('0x102')](db[_0x8982('0x16d')],{'as':_0x8982('0x153'),'foreignKey':'OpenchannelAccountId'});db[_0x8982('0x5c')][_0x8982('0x102')](db[_0x8982('0x60')],{'as':_0x8982('0x154'),'foreignKey':_0x8982('0x173')});db[_0x8982('0x5c')][_0x8982('0x102')](db[_0x8982('0x62')],{'as':_0x8982('0x147'),'foreignKey':_0x8982('0x173')});db[_0x8982('0x5c')][_0x8982('0x102')](db['OpenchannelApplication'],{'as':_0x8982('0x12f'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x8982('0x13b')](db['CmList'],{'as':'List','foreignKey':_0x8982('0x156')});db[_0x8982('0x5c')][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x5c')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x128')});db[_0x8982('0x5e')]['belongsTo'](db[_0x8982('0x14')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x5e')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x8982('0x174')});db[_0x8982('0x5e')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x173')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':_0x8982('0x162'),'foreignKey':'IntervalId'});db[_0x8982('0x5e')]['belongsTo'](db[_0x8982('0x167')],{'onDelete':'restrict','foreignKey':_0x8982('0x163')});db['OpenchannelInteraction'][_0x8982('0x102')](db[_0x8982('0x62')],{'as':_0x8982('0x147'),'onDelete':'cascade','foreignKey':_0x8982('0x175')});db[_0x8982('0x60')][_0x8982('0x13b')](db[_0x8982('0x5c')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x173')});db[_0x8982('0x60')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x60')][_0x8982('0x13b')](db['User'],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x60')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x176'),'as':_0x8982('0x16f')});db[_0x8982('0x60')][_0x8982('0x110')](db['Tag'],{'through':_0x8982('0x176'),'as':'ThroughTags'});db[_0x8982('0x60')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':'Users','through':_0x8982('0x177'),'foreignKey':_0x8982('0x175')});db[_0x8982('0x62')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x8982('0x14')});db[_0x8982('0x62')][_0x8982('0x13b')](db['CmContact'],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14c')});db[_0x8982('0x62')][_0x8982('0x13b')](db[_0x8982('0x60')],{'onDelete':'cascade','as':_0x8982('0x160'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x8982('0x13b')](db['Attachment'],{'as':'Attachment','foreignKey':_0x8982('0x16a')});db[_0x8982('0x62')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x173')});db['OpenchannelQueue']['belongsToMany'](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x38'),'foreignKey':'OpenchannelQueueId'});db[_0x8982('0x64')][_0x8982('0x110')](db[_0x8982('0xed')],{'through':_0x8982('0x178'),'as':'Teams'});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x179')});db['ChatWebsite']['hasMany'](db[_0x8982('0x16d')],{'as':'Answers','foreignKey':_0x8982('0x179')});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x70')],{'as':_0x8982('0x17a')});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x69')],{'as':'Interactions'});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x17b')],{'as':'Applications'});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x6b')],{'as':_0x8982('0x147')});db[_0x8982('0x66')][_0x8982('0x13b')](db['CmList'],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0x66')]['belongsTo'](db[_0x8982('0x86')],{'as':_0x8982('0x86'),'foreignKey':_0x8982('0x13d')});db['ChatWebsite'][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x66')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x121')});db[_0x8982('0x17c')]['belongsTo'](db[_0x8982('0x5c')],{});db['OpenchannelQueueReport'][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':'List','foreignKey':'ListId'});db[_0x8982('0x17c')]['belongsTo'](db['CmContact'],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x17c')][_0x8982('0x13b')](db[_0x8982('0x60')],{});db[_0x8982('0x17c')]['belongsTo'](db[_0x8982('0x62')],{});db[_0x8982('0x17c')][_0x8982('0x13b')](db['User'],{});db[_0x8982('0x17c')][_0x8982('0x13b')](db[_0x8982('0x64')],{});db[_0x8982('0x17b')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x17d'),'foreignKey':'UserId','onDelete':_0x8982('0x162')});db[_0x8982('0x17b')]['belongsTo'](db[_0x8982('0x17e')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x8982('0x162')});db[_0x8982('0x17b')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x17f'),'foreignKey':_0x8982('0x179'),'onDelete':_0x8982('0x162')});db[_0x8982('0x17b')][_0x8982('0x13b')](db[_0x8982('0x167')],{'onDelete':'restrict','foreignKey':_0x8982('0x163')});db[_0x8982('0x69')][_0x8982('0x102')](db[_0x8982('0x6b')],{'as':_0x8982('0x147'),'onDelete':'cascade','foreignKey':_0x8982('0x180')});db[_0x8982('0x69')][_0x8982('0x13b')](db['ChatWebsite'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x69')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db['ChatInteraction']['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':'UserId'});db[_0x8982('0x69')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x181'),'as':'Tags'});db['ChatInteraction'][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x181'),'as':'ThroughTags'});db[_0x8982('0x69')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':'user_has_chat_interactions','foreignKey':_0x8982('0x180')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':'cascade','as':_0x8982('0x14')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x111')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x69')],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x160'),'foreignKey':_0x8982('0x180')});db[_0x8982('0x6b')]['belongsTo'](db[_0x8982('0x15e')],{'as':_0x8982('0x15e'),'foreignKey':_0x8982('0x16a')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x6c')][_0x8982('0x13b')](db[_0x8982('0x111')],{'onDelete':'cascade','as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x6c')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x17e')][_0x8982('0x110')](db['User'],{'as':'Agents','through':_0x8982('0x30'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x8982('0xed')],{'through':_0x8982('0x182'),'as':_0x8982('0x143')});db[_0x8982('0x6e')][_0x8982('0x102')](db[_0x8982('0xd8')],{'as':_0x8982('0x147'),'foreignKey':'ChatGroupId','onDelete':_0x8982('0x101')});db[_0x8982('0x6e')][_0x8982('0x110')](db['User'],{'as':_0x8982('0x133'),'through':_0x8982('0x10f')});db[_0x8982('0x70')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x17f'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x72')][_0x8982('0x102')](db[_0x8982('0x111')],{'as':'Contacts','foreignKey':_0x8982('0x183')});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x75')],{'as':_0x8982('0x134'),'foreignKey':_0x8982('0x14d')});db['CmContact']['hasMany'](db[_0x8982('0x136')],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x14d')});db['CmContact'][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':'HopperHistories','foreignKey':_0x8982('0x14d')});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x7c')],{'as':_0x8982('0x7c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x111')]['hasMany'](db[_0x8982('0x139')],{'as':_0x8982('0x13a'),'foreignKey':'ContactId'});db[_0x8982('0x111')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x8982('0x10a'),'foreignKey':_0x8982('0x14d'),'onDelete':'restrict'});db[_0x8982('0x111')][_0x8982('0x102')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x8982('0x14d'),'onDelete':'restrict'});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x56')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x8982('0x162')});db[_0x8982('0x111')][_0x8982('0x102')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x8982('0x14d'),'onDelete':_0x8982('0x162')});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x41')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x8982('0x111')][_0x8982('0x13b')](db[_0x8982('0x72')],{'as':_0x8982('0x184'),'foreignKey':'CompanyId'});db[_0x8982('0x111')][_0x8982('0x13b')](db['CmList'],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156'),'onDelete':_0x8982('0x101')});db[_0x8982('0x111')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':'cm_user_has_contacts'});db[_0x8982('0x111')][_0x8982('0x110')](db[_0x8982('0x167')],{'as':_0x8982('0x16f'),'through':_0x8982('0x185')});db['CmContact'][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x185'),'as':_0x8982('0x15c')});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':'ContactId','onDelete':_0x8982('0x101')});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':'ListId','onDelete':_0x8982('0x101')});db[_0x8982('0x75')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':'Agent','foreignKey':'UserId'});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0x19')],{'as':_0x8982('0x186'),'foreignKey':_0x8982('0x135'),'onDelete':_0x8982('0x101')});db[_0x8982('0x75')][_0x8982('0x13b')](db['Campaign'],{'as':_0x8982('0x187'),'foreignKey':_0x8982('0x188'),'onDelete':_0x8982('0x101')});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x189')});db['CmHopperBlack']['belongsTo'](db[_0x8982('0x111')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x8982('0x101')});db[_0x8982('0x77')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':'List','foreignKey':_0x8982('0x156'),'onDelete':'cascade'});db[_0x8982('0x77')][_0x8982('0x13b')](db[_0x8982('0x19')],{'as':_0x8982('0x186'),'foreignKey':_0x8982('0x135'),'onDelete':_0x8982('0x101')});db['CmHopperBlack']['belongsTo'](db[_0x8982('0x187')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x8982('0x101')});db['Automation'][_0x8982('0x102')](db[_0x8982('0x85')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x8982('0x81')][_0x8982('0x102')](db[_0x8982('0x85')],{'as':{'plural':_0x8982('0x18a'),'singular':_0x8982('0x18b')},'foreignKey':'AutomationAnyId','onDelete':_0x8982('0x101'),'hooks':!![]});db['Automation'][_0x8982('0x102')](db[_0x8982('0x18c')],{'as':_0x8982('0x18d'),'foreignKey':'AutomationId','onDelete':_0x8982('0x101'),'hooks':!![]});db[_0x8982('0x86')][_0x8982('0x102')](db['Interval'],{'as':_0x8982('0x18e'),'foreignKey':_0x8982('0x13d'),'onDelete':_0x8982('0x101'),'hooks':!![],'required':![]});db[_0x8982('0x86')]['hasMany'](db[_0x8982('0x106')],{'as':_0x8982('0x107'),'foreignKey':'IntervalId','onDelete':_0x8982('0x162')});db[_0x8982('0x86')][_0x8982('0x102')](db[_0x8982('0x45')],{'as':_0x8982('0x18f'),'foreignKey':_0x8982('0x13d')});db[_0x8982('0x86')][_0x8982('0x102')](db['ChatApplication'],{'as':_0x8982('0x190'),'foreignKey':_0x8982('0x13d')});db['Interval']['hasMany'](db[_0x8982('0x4c')],{'as':'FaxApplications','foreignKey':_0x8982('0x13d')});db['Interval'][_0x8982('0x102')](db[_0x8982('0x55')],{'as':'SmsApplications','foreignKey':_0x8982('0x13d')});db[_0x8982('0x191')]['belongsTo'](db['MailAccount'],{});db[_0x8982('0x191')][_0x8982('0x13b')](db[_0x8982('0x192')],{'foreignKey':'DefaultReportId'});db[_0x8982('0x191')]['belongsTo'](db[_0x8982('0x99')],{'foreignKey':_0x8982('0x193')});db['Sound']['belongsToMany'](db[_0x8982('0x130')],{'as':_0x8982('0x194'),'through':_0x8982('0x131'),'onDelete':_0x8982('0x162')});db[_0x8982('0x167')][_0x8982('0x110')](db[_0x8982('0x111')],{'through':_0x8982('0x185')});db[_0x8982('0x167')][_0x8982('0x110')](db[_0x8982('0x69')],{'through':'chat_interaction_has_tags'});db[_0x8982('0x167')][_0x8982('0x110')](db['MailInteraction'],{'through':_0x8982('0x15b')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db['Tag'][_0x8982('0x110')](db[_0x8982('0x117')],{'through':_0x8982('0x169')});db['Tag'][_0x8982('0x110')](db[_0x8982('0x60')],{'through':_0x8982('0x176')});db[_0x8982('0x93')][_0x8982('0x102')](db[_0x8982('0x85')],{'as':{'plural':_0x8982('0x195'),'singular':_0x8982('0x196')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x8982('0x93')][_0x8982('0x102')](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0x8982('0x197'),'onDelete':_0x8982('0x101'),'hooks':!![]});db[_0x8982('0x93')][_0x8982('0x102')](db['Action'],{'as':_0x8982('0x18d'),'foreignKey':_0x8982('0x198'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x8982('0x102')](db['AnalyticFieldReport'],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x193'),'hooks':!![]});db[_0x8982('0x192')][_0x8982('0x102')](db[_0x8982('0xa0')],{'as':_0x8982('0x199'),'onDelete':'cascade','foreignKey':_0x8982('0x19a')});db[_0x8982('0x9e')]['hasMany'](db[_0x8982('0xa0')],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19b')});db['AnalyticFieldReport']['belongsTo'](db[_0x8982('0x9e')],{'foreignKey':_0x8982('0x19b')});db[_0x8982('0xa4')][_0x8982('0x102')](db['SalesforceConfiguration'],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xa6')][_0x8982('0x102')](db['SalesforceField'],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x8982('0xa6')]['hasMany'](db['SalesforceField'],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xa6')][_0x8982('0x102')](db[_0x8982('0xa8')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8982('0x1a1')});db[_0x8982('0xa6')]['belongsTo'](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x8982('0x19d')});db['SalesforceField'][_0x8982('0x102')](db[_0x8982('0xa8')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0xa8')][_0x8982('0x102')](db[_0x8982('0xa8')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db['SalesforceField']['hasMany'](db[_0x8982('0xa8')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db[_0x8982('0xa8')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8982('0xaa')][_0x8982('0x102')](db[_0x8982('0xac')],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xac')][_0x8982('0x102')](db[_0x8982('0xae')],{'as':_0x8982('0x19e'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a3')});db['SugarcrmConfiguration']['hasMany'](db[_0x8982('0xae')],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xac')][_0x8982('0x102')](db['SugarcrmField'],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xac')][_0x8982('0x13b')](db[_0x8982('0xaa')],{'as':'Account','foreignKey':_0x8982('0x19d')});db[_0x8982('0xae')][_0x8982('0x102')](db['SugarcrmField'],{'as':_0x8982('0x1a2'),'foreignKey':'SubjectId'});db[_0x8982('0xae')][_0x8982('0x102')](db[_0x8982('0xae')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xae')][_0x8982('0x102')](db['SugarcrmField'],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xae')]['belongsTo'](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0x1a7')][_0x8982('0x102')](db['DeskConfiguration'],{'as':_0x8982('0x19c'),'onDelete':'cascade','foreignKey':_0x8982('0x19d')});db['DeskConfiguration'][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xb1')][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xb1')][_0x8982('0x102')](db['DeskField'],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db['DeskConfiguration'][_0x8982('0x13b')](db[_0x8982('0x1a7')],{'as':_0x8982('0x161'),'foreignKey':'AccountId'});db[_0x8982('0xb1')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x1a8')});db[_0x8982('0xb3')][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db['DeskField']['hasMany'](db[_0x8982('0xb3')],{'as':_0x8982('0x1a4'),'foreignKey':'DescriptionId'});db[_0x8982('0xb3')][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db['DeskField'][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':'Variable','foreignKey':_0x8982('0x1a6')});db['ZohoAccount'][_0x8982('0x102')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xb6')][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xb6')][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x19f'),'onDelete':'cascade','foreignKey':_0x8982('0x1a0')});db['ZohoConfiguration'][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xb6')][_0x8982('0x13b')](db[_0x8982('0xb4')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0x1a9')]['hasMany'](db[_0x8982('0x1a9')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1a9')][_0x8982('0x102')](db['ZohoField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8982('0x1a9')][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1a9')][_0x8982('0x13b')](db['Variable'],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xb9')][_0x8982('0x102')](db['ZendeskConfiguration'],{'as':_0x8982('0x19c'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x8982('0xbb')]['hasMany'](db[_0x8982('0xbd')],{'as':_0x8982('0x19e'),'foreignKey':'SubjectId'});db[_0x8982('0xbb')]['hasMany'](db[_0x8982('0xbd')],{'as':_0x8982('0x19f'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x8982('0x102')](db[_0x8982('0xbd')],{'as':_0x8982('0x199'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0x8982('0xb9')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xbb')]['belongsToMany'](db[_0x8982('0x167')],{'through':_0x8982('0x1aa')});db['ZendeskField']['hasMany'](db[_0x8982('0xbd')],{'as':_0x8982('0x1a2'),'foreignKey':'SubjectId'});db[_0x8982('0xbd')][_0x8982('0x102')](db[_0x8982('0xbd')],{'as':_0x8982('0x1a4'),'foreignKey':'DescriptionId'});db[_0x8982('0xbd')][_0x8982('0x102')](db[_0x8982('0xbd')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db['ZendeskField']['belongsTo'](db['Variable'],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xbf')][_0x8982('0x102')](db['FreshdeskConfiguration'],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xc1')][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xc1')][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xc1')]['hasMany'](db['FreshdeskField'],{'as':_0x8982('0x199'),'onDelete':'cascade','foreignKey':_0x8982('0x1a1')});db[_0x8982('0xc1')][_0x8982('0x13b')](db[_0x8982('0xbf')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db['FreshdeskConfiguration'][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x1ac')});db[_0x8982('0x1ab')][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':'Subject','foreignKey':_0x8982('0x1a3')});db['FreshdeskField'][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':_0x8982('0x1a4'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x8982('0x1ab')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1ab')][_0x8982('0x13b')](db['Variable'],{'as':'Variable','foreignKey':_0x8982('0x1a6')});db['VtigerAccount'][_0x8982('0x102')](db[_0x8982('0xc6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x8982('0x19d')});db['VtigerConfiguration'][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x19e'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0xc6')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x19f'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xc6')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x199'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xc6')][_0x8982('0x13b')](db[_0x8982('0xc4')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0x1ad')][_0x8982('0x102')](db['VtigerField'],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1ad')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0x1ad')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1ad')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xc8')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xca')][_0x8982('0x102')](db['ServicenowField'],{'as':_0x8982('0x19e'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0xca')][_0x8982('0x102')](db['ServicenowField'],{'as':_0x8982('0x19f'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xca')][_0x8982('0x102')](db['ServicenowField'],{'as':_0x8982('0x199'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xca')][_0x8982('0x13b')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x8982('0x19d')});db[_0x8982('0x1ae')][_0x8982('0x102')](db[_0x8982('0x1ae')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1ae')][_0x8982('0x102')](db[_0x8982('0x1ae')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0x1ae')]['hasMany'](db[_0x8982('0x1ae')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1ae')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xcd')][_0x8982('0x102')](db[_0x8982('0xcf')],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xcf')]['hasMany'](db[_0x8982('0xd0')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xcf')][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':'Descriptions','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xcf')][_0x8982('0x102')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xcf')][_0x8982('0x13b')](db[_0x8982('0xcd')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xd0')][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':'Subject','foreignKey':_0x8982('0x1a3')});db['Dynamics365Field'][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xd0')][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db['Dynamics365Field'][_0x8982('0x13b')](db['Variable'],{'as':'Variable','foreignKey':_0x8982('0x1a6')});db[_0x8982('0xd1')][_0x8982('0x102')](db[_0x8982('0x1af')],{'as':_0x8982('0x19c'),'onDelete':'cascade','foreignKey':_0x8982('0x19d')});db['FreshsalesConfiguration'][_0x8982('0x102')](db[_0x8982('0xd3')],{'as':_0x8982('0x19e'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1af')][_0x8982('0x102')](db[_0x8982('0xd3')],{'as':_0x8982('0x19f'),'foreignKey':_0x8982('0x1a0')});db['FreshsalesConfiguration'][_0x8982('0x102')](db[_0x8982('0xd3')],{'as':_0x8982('0x199'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1af')][_0x8982('0x13b')](db[_0x8982('0xd1')],{'as':'Account','foreignKey':'AccountId'});db[_0x8982('0xd3')][_0x8982('0x102')](db['FreshsalesField'],{'as':_0x8982('0x1a2'),'foreignKey':'SubjectId'});db[_0x8982('0xd3')]['hasMany'](db['FreshsalesField'],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xd3')][_0x8982('0x102')](db['FreshsalesField'],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xd3')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':'VariableId'});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x66')],{});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0xd6')][_0x8982('0x13b')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x8982('0x13b')](db[_0x8982('0x6b')],{});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x14')],{});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x17e')],{});db[_0x8982('0xd8')][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1b0')});db['ChatInternalMessage'][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1b1')});db[_0x8982('0x139')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8982('0x1b2'),'onDelete':_0x8982('0x101')});db[_0x8982('0x139')][_0x8982('0x102')](db[_0x8982('0xda')],{'foreignKey':'SessionId','onDelete':_0x8982('0x101')});db[_0x8982('0xde')][_0x8982('0x13b')](db['SmsAccount'],{});db[_0x8982('0xde')]['belongsTo'](db[_0x8982('0xfc')],{'as':'List','foreignKey':_0x8982('0x156')});db[_0x8982('0xde')]['belongsTo'](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0xde')][_0x8982('0x13b')](db[_0x8982('0x56')],{});db[_0x8982('0xde')]['belongsTo'](db['SmsMessage'],{});db[_0x8982('0xde')][_0x8982('0x13b')](db[_0x8982('0x14')],{});db[_0x8982('0xde')][_0x8982('0x13b')](db[_0x8982('0x5a')],{});db['JscriptyProject']['hasMany'](db[_0x8982('0x139')],{'foreignKey':'ProjectId'});db[_0x8982('0x1b3')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8982('0x1b4')});db[_0x8982('0x1b3')][_0x8982('0x102')](db[_0x8982('0xda')],{'foreignKey':_0x8982('0x1b4')});db[_0x8982('0xe7')][_0x8982('0x110')](db['User'],{'as':'Users','through':_0x8982('0x12b')});db[_0x8982('0xed')]['belongsToMany'](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':'user_has_teams'});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x19')],{'through':'team_has_voice_queues','as':'VoiceQueues'});db['Team'][_0x8982('0x110')](db[_0x8982('0x11b')],{'through':_0x8982('0x1b5'),'as':_0x8982('0x1b6')});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x17e')],{'through':_0x8982('0x182'),'as':_0x8982('0x1b7')});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x166')],{'through':_0x8982('0x16b'),'as':_0x8982('0x11c')});db['Team'][_0x8982('0x110')](db[_0x8982('0x5a')],{'through':_0x8982('0x172'),'as':_0x8982('0x1b8')});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x64')],{'through':_0x8982('0x178'),'as':_0x8982('0x11d')});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x75')],{'as':_0x8982('0x134'),'foreignKey':_0x8982('0x188')});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x136')],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x188')});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x137'),'foreignKey':'CampaignId'});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x77')],{'as':_0x8982('0x138'),'foreignKey':_0x8982('0x188')});db[_0x8982('0x187')][_0x8982('0x13b')](db[_0x8982('0x2b')],{'as':'Trunk','foreignKey':_0x8982('0x1b9')});db[_0x8982('0x187')]['belongsTo'](db['Trunk'],{'as':_0x8982('0x13c'),'foreignKey':'TrunkBackupId'});db[_0x8982('0x187')]['belongsTo'](db[_0x8982('0x86')],{'as':_0x8982('0x86'),'foreignKey':'IntervalId'});db[_0x8982('0x187')][_0x8982('0x13b')](db[_0x8982('0xe7')],{'as':_0x8982('0xe7'),'foreignKey':_0x8982('0x1ba')});db[_0x8982('0x187')]['belongsToMany'](db['CmList'],{'as':_0x8982('0x13f'),'through':_0x8982('0x1bb')});db[_0x8982('0x187')][_0x8982('0x110')](db['CmList'],{'as':_0x8982('0x145'),'through':'campaigns_has_cm_blacklists'});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x43')],{});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x41')],{});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'foreignKey':'FromMailAccountId','as':_0x8982('0x1bc')});db[_0x8982('0xf6')]['belongsTo'](db[_0x8982('0x14')],{'foreignKey':'FromUserId','as':_0x8982('0x1bd')});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1be'),'as':_0x8982('0x1bf')});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x11b')],{'foreignKey':'ToMailQueueId','as':_0x8982('0x1c0')});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'foreignKey':'ToMailAccountId','as':_0x8982('0x1c1')});db['ChatTransferReport'][_0x8982('0x13b')](db[_0x8982('0x6b')],{});db['ChatTransferReport'][_0x8982('0x13b')](db[_0x8982('0x69')],{});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x66')],{'foreignKey':'FromChatWebsiteId','as':_0x8982('0x1bc')});db[_0x8982('0xf7')]['belongsTo'](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1c2'),'as':'FromAgent'});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':'ToUserId','as':_0x8982('0x1bf')});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x17e')],{'foreignKey':_0x8982('0x1c3'),'as':_0x8982('0x1c0')});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x66')],{'foreignKey':'ToChatWebsiteId','as':_0x8982('0x1c1')});db[_0x8982('0xf8')]['belongsTo'](db[_0x8982('0x4f')],{});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x117')],{});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x122')],{'foreignKey':'FromFaxAccountId','as':_0x8982('0x1bc')});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1be'),'as':_0x8982('0x1bf')});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x166')],{'foreignKey':_0x8982('0x1c4'),'as':_0x8982('0x1c0')});db['FaxTransferReport'][_0x8982('0x13b')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x8982('0xf9')][_0x8982('0x13b')](db['OpenchannelMessage'],{});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x60')],{});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x5c')],{'foreignKey':'FromOpenchannelAccountId','as':_0x8982('0x1bc')});db[_0x8982('0xf9')]['belongsTo'](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1c2'),'as':_0x8982('0x1bd')});db['OpenchannelTransferReport'][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':'ToUserId','as':_0x8982('0x1bf')});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x64')],{'foreignKey':_0x8982('0x1c5'),'as':_0x8982('0x1c0')});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x5c')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x8982('0xfa')][_0x8982('0x13b')](db[_0x8982('0x58')],{});db[_0x8982('0xfa')][_0x8982('0x13b')](db[_0x8982('0x56')],{});db[_0x8982('0xfa')][_0x8982('0x13b')](db[_0x8982('0x54')],{'foreignKey':_0x8982('0x1c6'),'as':_0x8982('0x1bc')});db['SmsTransferReport'][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1c2'),'as':_0x8982('0x1bd')});db['SmsTransferReport'][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1be'),'as':_0x8982('0x1bf')});db['SmsTransferReport'][_0x8982('0x13b')](db['SmsQueue'],{'foreignKey':_0x8982('0x1c7'),'as':'ToQueue'});db['SmsTransferReport'][_0x8982('0x13b')](db[_0x8982('0x54')],{'foreignKey':_0x8982('0x1c8'),'as':_0x8982('0x1c1')});db[_0x8982('0xfc')][_0x8982('0x102')](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x156')});db['CmList']['hasMany'](db[_0x8982('0x7e')],{'as':_0x8982('0x1c9'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xfc')]['hasMany'](db[_0x8982('0x111')],{'as':_0x8982('0x112'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xfc')][_0x8982('0x102')](db['CmHopperFinal'],{'as':_0x8982('0x108'),'foreignKey':'ListId'});db[_0x8982('0xfc')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x109'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xfc')][_0x8982('0x102')](db[_0x8982('0x7c')],{'as':_0x8982('0x7c'),'foreignKey':_0x8982('0x156')});db['CmList'][_0x8982('0x110')](db[_0x8982('0x19')],{'as':_0x8982('0x1ca'),'through':'voice_queues_has_cm_lists'});db[_0x8982('0xfc')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':'Agents','through':_0x8982('0x113')});db['VoicePrefix'][_0x8982('0x102')](db[_0x8982('0x106')],{'as':_0x8982('0x107'),'onDelete':_0x8982('0x162')});db[_0x8982('0xfd')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x11f')});db['UserProfile'][_0x8982('0x102')](db[_0x8982('0x14')],{'as':'Users','foreignKey':_0x8982('0x10e')});db[_0x8982('0xff')]['hasMany'](db[_0x8982('0x1cb')],{'as':'UserProfileSections','foreignKey':_0x8982('0x10e'),'onDelete':_0x8982('0x101')});db[_0x8982('0x1cb')][_0x8982('0x102')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x8982('0x1cc'),'onDelete':_0x8982('0x101')});module[_0x8982('0x1cd')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x6a2e=['../api/cannedAnswer/cannedAnswer.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','VoiceRecording','Recordings','VoiceQueuesRt','hasMany','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteraction','ChatInteractions','SmsInteractions','MailInteraction','MailInteractions','belongsTo','UserProfile','belongsToMany','ChatGroup','Groups','chat_group_has_users','Lists','user_has_teams','user_has_mail_interactions','FaxInteractions','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueue','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','cm_user_has_lists','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','moh_has_sounds','VoiceQueueId','VoiceQueue','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','mailbox','uniqueid','AgentReports','Contact','MailAccountId','Imap','Smtp','Disposition','Dispositions','CannedAnswer','Answers','Interactions','MailApplication','TemplateId','MailInteractionId','Account','ContactId','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachment','restrict','TagId','ListId','Items','FaxAccountId','Exntensions','List','FaxInteractionId','fax_interaction_has_tags','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','SmsMessage','sms_interaction_has_tags','Tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','Agent','Queue','ChatQueueId','Website','chat_interaction_has_tags','user_has_chat_interactions','ChatInteractionId','team_has_chat_queues','ChatGroupId','Members','Contacts','JscriptySessionReport','Company','CompanyId','cm_contact_has_tags','OwnerId','Automation','AutomationAllId','OneAny','Actions','Intervals','Extensions','FaxApplications','SmsApplications','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','AnalyticMetric','Configurations','AccountId','SalesforceConfiguration','SubjectId','DescriptionId','FieldId','Subject','Field','Variable','VariableId','SugarcrmField','SugarcrmConfiguration','Description','DeskField','Descriptions','ZohoField','Subjects','int_zendesk_configuration_has_tags','VtigerConfiguration','VtigerAccount','ServicenowAccount','Dynamics365Field','FreshsalesConfiguration','ChatQueueReport','ToId','JscriptyQuestionReport','SessionId','SmsQueueReport','ProjectId','team_has_mail_queues','team_has_sms_queues','CampaignId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToQueue','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSection','UserProfileSections','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','motion2','utf8mb4','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6a2e,0x14d));var _0xe6a2=function(_0x2528b4,_0x2a97ce){_0x2528b4=_0x2528b4-0x0;var _0x201920=_0x6a2e[_0x2528b4];return _0x201920;};'use strict';var path=require(_0xe6a2('0x0'));var config=require(_0xe6a2('0x1'));var Sequelize=require(_0xe6a2('0x2'));var _=require(_0xe6a2('0x3'));var jstz=require(_0xe6a2('0x4'));var timezone=jstz[_0xe6a2('0x5')]();config['sequelize']=_[_0xe6a2('0x6')](config[_0xe6a2('0x2')],{'database':'motion2','username':_0xe6a2('0x7'),'password':_0xe6a2('0x8'),'options':{'host':_0xe6a2('0x9'),'port':0xcea,'dialect':_0xe6a2('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xe6a2('0xb')](),'define':{'charset':_0xe6a2('0xc'),'collate':_0xe6a2('0xd')}}});config['sequelizeHistory']=_[_0xe6a2('0x6')](config[_0xe6a2('0xe')],{'database':_0xe6a2('0xf'),'username':_0xe6a2('0x7'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0xe6a2('0xa'),'dialectOptions':{'charset':_0xe6a2('0x10')},'logging':![],'timezone':timezone[_0xe6a2('0xb')](),'define':{'charset':_0xe6a2('0xc'),'collate':_0xe6a2('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe6a2('0x2')][_0xe6a2('0x11')],config[_0xe6a2('0x2')][_0xe6a2('0x12')],config[_0xe6a2('0x2')][_0xe6a2('0x13')],config[_0xe6a2('0x2')][_0xe6a2('0x14')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xe6a2('0xe')][_0xe6a2('0x11')],config['sequelizeHistory']['username'],config[_0xe6a2('0xe')][_0xe6a2('0x13')],config[_0xe6a2('0xe')][_0xe6a2('0x14')])};db[_0xe6a2('0x15')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x17'));db[_0xe6a2('0x18')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x19'));db[_0xe6a2('0x1a')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x1b'));db[_0xe6a2('0x1c')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x1d'));db[_0xe6a2('0x1e')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x1f'));db['VoiceQueue']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x20'));db['VoiceRecording']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x21'));db[_0xe6a2('0x22')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x23'));db[_0xe6a2('0x24')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x25'));db[_0xe6a2('0x26')]=db[_0xe6a2('0x2')]['import']('../api/voiceCallReport/voiceCallReport.model');db[_0xe6a2('0x27')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x28'));db[_0xe6a2('0x29')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x2a'));db[_0xe6a2('0x2b')]=db['sequelize']['import'](_0xe6a2('0x2c'));db[_0xe6a2('0x2d')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/memberReport/memberReport.model');db[_0xe6a2('0x2e')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x2f'));db[_0xe6a2('0x30')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xe6a2('0x31')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x32'));db[_0xe6a2('0x33')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x34'));db[_0xe6a2('0x35')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x36'));db['UserMailQueue']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x37'));db[_0xe6a2('0x38')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x39'));db[_0xe6a2('0x3a')]=db['sequelize']['import'](_0xe6a2('0x3b'));db[_0xe6a2('0x3c')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x3d'));db[_0xe6a2('0x3e')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x3f'));db[_0xe6a2('0x40')]=db[_0xe6a2('0x2')]['import']('../api/mailServerOut/mailServerOut.model');db[_0xe6a2('0x41')]=db['sequelize']['import'](_0xe6a2('0x42'));db['MailQueue']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x43'));db[_0xe6a2('0x44')]=db['sequelize'][_0xe6a2('0x16')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/mailInteraction/mailInteraction.model');db[_0xe6a2('0x45')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x46'));db['MailApplication']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x47'));db[_0xe6a2('0x48')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x49'));db[_0xe6a2('0x4a')]=db['sequelize']['import'](_0xe6a2('0x4b'));db[_0xe6a2('0x4c')]=db[_0xe6a2('0x2')]['import']('../api/dashboardItem/dashboardItem.model');db['FaxAccount']=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/faxAccount/faxAccount.model');db[_0xe6a2('0x4d')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x4e'));db[_0xe6a2('0x4f')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x50'));db[_0xe6a2('0x51')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x52'));db[_0xe6a2('0x53')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x54'));db[_0xe6a2('0x55')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x56'));db[_0xe6a2('0x57')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x58'));db[_0xe6a2('0x59')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x5a'));db[_0xe6a2('0x5b')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x5c'));db['SmsMessage']=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x5d'));db[_0xe6a2('0x5e')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x5f'));db['OpenchannelAccount']=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0xe6a2('0x60')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x61'));db[_0xe6a2('0x62')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x63'));db[_0xe6a2('0x64')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x65'));db[_0xe6a2('0x66')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/openchannelQueue/openchannelQueue.model');db[_0xe6a2('0x67')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x68'));db[_0xe6a2('0x69')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x6a'));db[_0xe6a2('0x6b')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x6c'));db['ChatInteraction']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x6d'));db[_0xe6a2('0x6e')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x6f'));db[_0xe6a2('0x70')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x71'));db[_0xe6a2('0x72')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x73'));db['ChatGroup']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x74'));db[_0xe6a2('0x75')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x76'));db[_0xe6a2('0x77')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x78'));db[_0xe6a2('0x79')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x7a'));db[_0xe6a2('0x7b')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x7c'));db[_0xe6a2('0x7d')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x7e'));db[_0xe6a2('0x7f')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x80'));db[_0xe6a2('0x81')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x82'));db[_0xe6a2('0x83')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x84'));db[_0xe6a2('0x85')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x86'));db[_0xe6a2('0x87')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x88'));db['Automation']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x89'));db['CannedAnswer']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x8a'));db['Disposition']=db[_0xe6a2('0x2')]['import']('../api/disposition/disposition.model');db[_0xe6a2('0x8b')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x8c'));db['Interval']=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x8d'));db[_0xe6a2('0x8e')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/pause/pause.model');db[_0xe6a2('0x8f')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x90'));db[_0xe6a2('0x91')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0x92'));db[_0xe6a2('0x93')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x94'));db[_0xe6a2('0x95')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/sound/sound.model');db[_0xe6a2('0x96')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x97'));db[_0xe6a2('0x98')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x99'));db[_0xe6a2('0x9a')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x9b'));db['Variable']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0x9c'));db[_0xe6a2('0x9d')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/integration/integration.model');db[_0xe6a2('0x9e')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/integrationReport/integrationReport.model');db[_0xe6a2('0x9f')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xa0'));db[_0xe6a2('0xa1')]=db['sequelize'][_0xe6a2('0x16')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xe6a2('0xa2')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xa3'));db['AnalyticMetric']=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xa4'));db[_0xe6a2('0xa5')]=db['sequelize']['import'](_0xe6a2('0xa6'));db[_0xe6a2('0xa7')]=db['sequelize'][_0xe6a2('0x16')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xe6a2('0xa8')]=db['sequelize'][_0xe6a2('0x16')]('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xa9'));db[_0xe6a2('0xaa')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xab'));db[_0xe6a2('0xac')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xad'));db[_0xe6a2('0xae')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xaf'));db[_0xe6a2('0xb0')]=db[_0xe6a2('0x2')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/intDeskField/intDeskField.model');db[_0xe6a2('0xb1')]=db[_0xe6a2('0x2')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0xe6a2('0xb2')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xb3'));db['ZohoField']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xb4'));db[_0xe6a2('0xb5')]=db['sequelize']['import'](_0xe6a2('0xb6'));db[_0xe6a2('0xb7')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xb8'));db[_0xe6a2('0xb9')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xba'));db[_0xe6a2('0xbb')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xbc'));db[_0xe6a2('0xbd')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xbe'));db[_0xe6a2('0xbf')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xc0'));db['VtigerAccount']=db[_0xe6a2('0x2')]['import'](_0xe6a2('0xc1'));db['VtigerConfiguration']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xc2'));db[_0xe6a2('0xc3')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xc4'));db['ServicenowAccount']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xc5'));db[_0xe6a2('0xc6')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xc7'));db[_0xe6a2('0xc8')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xc9'));db[_0xe6a2('0xca')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0xe6a2('0xcb')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xcc'));db['Dynamics365Field']=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0xe6a2('0xcd')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0xce'));db['FreshsalesConfiguration']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xcf'));db[_0xe6a2('0xd0')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xd1'));db['Integration']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xd2'));db[_0xe6a2('0xd3')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xd4'));db['ChatQueueReport']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xd5'));db[_0xe6a2('0xd6')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xd7'));db[_0xe6a2('0xd8')]=db['sequelize']['import'](_0xe6a2('0xd9'));db['JscriptyQuestionReport']=db[_0xe6a2('0x2')]['import'](_0xe6a2('0xda'));db['JscriptySessionReport']=db['sequelize'][_0xe6a2('0x16')]('../api/jscriptySessionReport/jscriptySessionReport.model');db['SmsQueueReport']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xdb'));db[_0xe6a2('0xdc')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xdd'));db[_0xe6a2('0xde')]=db['sequelize']['import'](_0xe6a2('0xdf'));db[_0xe6a2('0xe0')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xe1'));db[_0xe6a2('0xe2')]=db['sequelize']['import']('../api/setting/setting.model');db[_0xe6a2('0xe3')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xe4'));db[_0xe6a2('0xe5')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xe6'));db[_0xe6a2('0xe7')]=db[_0xe6a2('0x2')]['import']('../api/squareRecording/squareRecording.model');db['SquareMessage']=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xe8'));db[_0xe6a2('0xe9')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xea'));db[_0xe6a2('0xeb')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xec'));db[_0xe6a2('0xed')]=db['sequelize']['import'](_0xe6a2('0xee'));db[_0xe6a2('0xef')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/migration/migration.model');db['Attachment']=db[_0xe6a2('0x2')]['import'](_0xe6a2('0xf0'));db['Plugin']=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xf1'));db[_0xe6a2('0xf2')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/mailTransferReport/mailTransferReport.model');db[_0xe6a2('0xf3')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xf4'));db[_0xe6a2('0xf5')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')]('../api/faxTransferReport/faxTransferReport.model');db[_0xe6a2('0xf6')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0xf7'));db[_0xe6a2('0xf8')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0xf9'));db[_0xe6a2('0xfa')]=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xfb'));db[_0xe6a2('0xfc')]=db[_0xe6a2('0x2')][_0xe6a2('0x16')](_0xe6a2('0xfd'));db['UserProfile']=db['sequelize']['import']('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize'][_0xe6a2('0x16')](_0xe6a2('0xfe'));db[_0xe6a2('0xff')]=db[_0xe6a2('0x2')]['import'](_0xe6a2('0x100'));db[_0xe6a2('0x15')][_0xe6a2('0x101')](db[_0xe6a2('0x24')],{'as':_0xe6a2('0x24'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x103')});db['User']['hasMany'](db[_0xe6a2('0x104')],{'as':_0xe6a2('0x105'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x15')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xe6a2('0x106'),'foreignKey':_0xe6a2('0x103')});db['User'][_0xe6a2('0x107')](db[_0xe6a2('0x1c')],{'as':'Extensions','onDelete':_0xe6a2('0x102'),'hooks':!![]});db[_0xe6a2('0x15')][_0xe6a2('0x107')](db[_0xe6a2('0x7f')],{'as':_0xe6a2('0x108'),'foreignKey':_0xe6a2('0x103')});db['User'][_0xe6a2('0x107')](db[_0xe6a2('0x81')],{'as':_0xe6a2('0x109'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x15')][_0xe6a2('0x107')](db[_0xe6a2('0x83')],{'as':_0xe6a2('0x83'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x15')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xe6a2('0x10a'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x15')][_0xe6a2('0x107')](db[_0xe6a2('0x10b')],{'as':_0xe6a2('0x10c'),'foreignKey':'UserId'});db[_0xe6a2('0x15')][_0xe6a2('0x107')](db['SmsInteraction'],{'as':_0xe6a2('0x10d'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x15')]['hasMany'](db[_0xe6a2('0x4f')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0xe6a2('0x15')][_0xe6a2('0x107')](db[_0xe6a2('0x10e')],{'as':_0xe6a2('0x10f'),'foreignKey':'UserId'});db[_0xe6a2('0x15')][_0xe6a2('0x110')](db[_0xe6a2('0x111')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db[_0xe6a2('0x113')],{'as':_0xe6a2('0x114'),'through':_0xe6a2('0x115')});db[_0xe6a2('0x15')]['belongsToMany'](db[_0xe6a2('0x79')],{'as':'Contacts','through':'cm_user_has_contacts'});db['User'][_0xe6a2('0x112')](db[_0xe6a2('0xfa')],{'as':_0xe6a2('0x116'),'through':'cm_user_has_lists'});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db['Team'],{'through':_0xe6a2('0x117')});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db['MailInteraction'],{'as':_0xe6a2('0x10f'),'through':_0xe6a2('0x118')});db['User'][_0xe6a2('0x112')](db[_0xe6a2('0x10b')],{'as':_0xe6a2('0x10c'),'through':'user_has_chat_interactions'});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db['FaxInteraction'],{'as':_0xe6a2('0x119'),'through':_0xe6a2('0x11a')});db['User'][_0xe6a2('0x112')](db[_0xe6a2('0x5b')],{'as':_0xe6a2('0x10d'),'through':_0xe6a2('0x11b')});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db['OpenchannelInteraction'],{'as':_0xe6a2('0x10a'),'through':'user_has_openchannel_interactions'});db[_0xe6a2('0x15')]['belongsToMany'](db['VoiceQueue'],{'as':_0xe6a2('0x11c'),'through':_0xe6a2('0x33'),'required':![]});db['User']['belongsToMany'](db[_0xe6a2('0x11d')],{'as':_0xe6a2('0x11e'),'through':_0xe6a2('0x11f'),'required':![]});db['User'][_0xe6a2('0x112')](db[_0xe6a2('0x72')],{'as':_0xe6a2('0x120'),'through':_0xe6a2('0x35'),'required':![],'hooks':!![]});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db[_0xe6a2('0x53')],{'as':_0xe6a2('0x121'),'through':_0xe6a2('0x38'),'required':![]});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db[_0xe6a2('0x5e')],{'as':_0xe6a2('0x122'),'through':'UserSmsQueue','required':![]});db['User']['belongsToMany'](db['OpenchannelQueue'],{'as':_0xe6a2('0x123'),'through':_0xe6a2('0x3c'),'required':![]});db[_0xe6a2('0x15')]['belongsToMany'](db[_0xe6a2('0xfa')],{'through':_0xe6a2('0x124')});db[_0xe6a2('0x15')]['belongsToMany'](db[_0xe6a2('0xfc')],{'as':_0xe6a2('0x125'),'through':_0xe6a2('0x126'),'required':![]});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db[_0xe6a2('0x67')],{'as':_0xe6a2('0x127'),'through':_0xe6a2('0x128')});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db[_0xe6a2('0x129')],{'as':_0xe6a2('0x12a'),'through':_0xe6a2('0x12b')});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db[_0xe6a2('0x41')],{'as':_0xe6a2('0x12c'),'through':_0xe6a2('0x12d')});db[_0xe6a2('0x15')][_0xe6a2('0x112')](db[_0xe6a2('0x12e')],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db['User'][_0xe6a2('0x112')](db[_0xe6a2('0x57')],{'as':_0xe6a2('0x12f'),'through':_0xe6a2('0x130')});db['User'][_0xe6a2('0x112')](db[_0xe6a2('0xe5')],{'as':_0xe6a2('0x131'),'through':_0xe6a2('0x132')});db[_0xe6a2('0x18')][_0xe6a2('0x107')](db['VoiceExtension'],{'as':_0xe6a2('0x133'),'onDelete':'cascade','foreignKey':_0xe6a2('0x134')});db[_0xe6a2('0x1a')][_0xe6a2('0x107')](db[_0xe6a2('0x1c')],{'onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x1c')][_0xe6a2('0x107')](db[_0xe6a2('0x1c')],{'as':_0xe6a2('0x135'),'onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x1e')][_0xe6a2('0x112')](db[_0xe6a2('0x95')],{'as':'Sounds','through':_0xe6a2('0x136')});db['VoiceQueue'][_0xe6a2('0x107')](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0xe6a2('0x137')});db[_0xe6a2('0x138')][_0xe6a2('0x107')](db[_0xe6a2('0x7b')],{'as':'Hoppers','foreignKey':_0xe6a2('0x137')});db[_0xe6a2('0x138')][_0xe6a2('0x107')](db[_0xe6a2('0x7f')],{'as':_0xe6a2('0x108'),'foreignKey':_0xe6a2('0x137')});db[_0xe6a2('0x138')][_0xe6a2('0x107')](db[_0xe6a2('0x81')],{'as':_0xe6a2('0x139'),'foreignKey':_0xe6a2('0x137')});db[_0xe6a2('0x138')][_0xe6a2('0x107')](db[_0xe6a2('0x83')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xe6a2('0x107')](db[_0xe6a2('0x7d')],{'as':_0xe6a2('0x13a'),'foreignKey':'VoiceQueueId'});db[_0xe6a2('0x138')]['hasMany'](db['JscriptySessionReport'],{'as':_0xe6a2('0x13b'),'foreignKey':_0xe6a2('0x137')});db[_0xe6a2('0x138')][_0xe6a2('0x110')](db[_0xe6a2('0x2e')],{'as':_0xe6a2('0x2e'),'foreignKey':_0xe6a2('0x13c')});db[_0xe6a2('0x138')][_0xe6a2('0x110')](db[_0xe6a2('0x2e')],{'as':_0xe6a2('0x13d'),'foreignKey':_0xe6a2('0x13e')});db[_0xe6a2('0x138')]['belongsTo'](db[_0xe6a2('0x13f')],{'as':_0xe6a2('0x13f'),'foreignKey':_0xe6a2('0x140')});db[_0xe6a2('0x138')]['belongsTo'](db['Pause'],{'as':_0xe6a2('0x141'),'foreignKey':_0xe6a2('0x142')});db[_0xe6a2('0x138')]['belongsToMany'](db['CmList'],{'as':_0xe6a2('0x116'),'through':_0xe6a2('0x143')});db[_0xe6a2('0x138')]['belongsToMany'](db['User'],{'as':_0xe6a2('0x144'),'through':_0xe6a2('0x33')});db[_0xe6a2('0x138')][_0xe6a2('0x112')](db[_0xe6a2('0xe9')],{'as':_0xe6a2('0x145'),'through':_0xe6a2('0x146')});db['VoiceQueue'][_0xe6a2('0x112')](db['CmList'],{'as':_0xe6a2('0x147'),'through':_0xe6a2('0x148')});db[_0xe6a2('0x104')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x15'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x22')]['belongsTo'](db[_0xe6a2('0x15')],{'as':'User','foreignKey':'UserId'});db['VoiceMail'][_0xe6a2('0x107')](db[_0xe6a2('0x149')],{'as':_0xe6a2('0x14a'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x14b'),'sourceKey':_0xe6a2('0x14c')});db[_0xe6a2('0x149')][_0xe6a2('0x110')](db[_0xe6a2('0x24')],{'foreignKey':_0xe6a2('0x14b'),'targetKey':_0xe6a2('0x14c')});db[_0xe6a2('0x26')]['hasMany'](db[_0xe6a2('0x2b')],{'as':'QueueCalls','foreignKey':_0xe6a2('0x14d'),'constraints':![]});db[_0xe6a2('0x26')]['hasMany'](db['VoiceAgentReport'],{'as':_0xe6a2('0x14e'),'foreignKey':'uniqueid','constraints':![]});db[_0xe6a2('0x26')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x15'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x26')]['belongsTo'](db['CmContact'],{'as':_0xe6a2('0x14f'),'foreignKey':'ContactId'});db[_0xe6a2('0x3e')][_0xe6a2('0x110')](db['MailAccount'],{'as':_0xe6a2('0x41'),'foreignKey':_0xe6a2('0x150')});db[_0xe6a2('0x40')][_0xe6a2('0x110')](db[_0xe6a2('0x41')],{'as':_0xe6a2('0x41'),'foreignKey':_0xe6a2('0x150')});db['MailAccount']['hasOne'](db[_0xe6a2('0x3e')],{'as':_0xe6a2('0x151'),'onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x41')][_0xe6a2('0x101')](db['MailServerOut'],{'as':_0xe6a2('0x152'),'onDelete':'cascade'});db[_0xe6a2('0x41')][_0xe6a2('0x107')](db[_0xe6a2('0x153')],{'as':_0xe6a2('0x154'),'foreignKey':'MailAccountId'});db[_0xe6a2('0x41')]['hasMany'](db[_0xe6a2('0x155')],{'as':_0xe6a2('0x156'),'foreignKey':'MailAccountId'});db[_0xe6a2('0x41')][_0xe6a2('0x107')](db[_0xe6a2('0x45')],{'as':_0xe6a2('0x14a'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xe6a2('0x107')](db[_0xe6a2('0x10e')],{'as':_0xe6a2('0x157')});db[_0xe6a2('0x41')][_0xe6a2('0x107')](db[_0xe6a2('0x158')],{'as':_0xe6a2('0x135')});db[_0xe6a2('0x41')][_0xe6a2('0x110')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0xe6a2('0x41')][_0xe6a2('0x110')](db[_0xe6a2('0x98')],{'as':_0xe6a2('0x98'),'foreignKey':_0xe6a2('0x159')});db['MailAccount'][_0xe6a2('0x110')](db[_0xe6a2('0x8e')],{'as':_0xe6a2('0x141'),'foreignKey':_0xe6a2('0x142')});db[_0xe6a2('0x41')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x144'),'through':'user_has_mail_accounts'});db[_0xe6a2('0x11d')]['belongsToMany'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x144'),'through':_0xe6a2('0x11f')});db['MailQueue'][_0xe6a2('0x112')](db[_0xe6a2('0xe9')],{'through':'team_has_mail_queues','as':_0xe6a2('0x145')});db[_0xe6a2('0x10e')][_0xe6a2('0x107')](db[_0xe6a2('0x45')],{'as':_0xe6a2('0x14a'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x15a')});db[_0xe6a2('0x10e')][_0xe6a2('0x110')](db[_0xe6a2('0x41')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x150')});db[_0xe6a2('0x10e')]['belongsTo'](db[_0xe6a2('0x79')],{'as':_0xe6a2('0x14f'),'foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x10e')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x15d'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x10e')]['belongsToMany'](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x15e'),'as':'Tags'});db['MailInteraction'][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x15e'),'as':_0xe6a2('0x15f')});db[_0xe6a2('0x10e')]['belongsToMany'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'through':_0xe6a2('0x118'),'foreignKey':_0xe6a2('0x15a')});db[_0xe6a2('0x45')][_0xe6a2('0x107')](db[_0xe6a2('0x161')],{'as':'Attachments','onDelete':'cascade'});db[_0xe6a2('0x45')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':'User'});db[_0xe6a2('0x45')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'onDelete':_0xe6a2('0x102'),'as':'Contact'});db['MailMessage'][_0xe6a2('0x110')](db[_0xe6a2('0x10e')],{'as':'Interaction','foreignKey':_0xe6a2('0x15a')});db[_0xe6a2('0x45')]['belongsTo'](db[_0xe6a2('0x41')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x150')});db[_0xe6a2('0x158')]['belongsTo'](db[_0xe6a2('0x15')],{'onDelete':'restrict'});db[_0xe6a2('0x158')][_0xe6a2('0x110')](db[_0xe6a2('0x11d')],{'onDelete':'restrict'});db[_0xe6a2('0x158')]['belongsTo'](db[_0xe6a2('0x41')],{'onDelete':'restrict'});db['MailApplication'][_0xe6a2('0x110')](db[_0xe6a2('0x13f')],{'onDelete':_0xe6a2('0x162'),'foreignKey':_0xe6a2('0x140')});db['MailApplication'][_0xe6a2('0x110')](db['Tag'],{'onDelete':_0xe6a2('0x162'),'foreignKey':_0xe6a2('0x163')});db[_0xe6a2('0x48')][_0xe6a2('0x110')](db[_0xe6a2('0x41')],{});db[_0xe6a2('0x48')][_0xe6a2('0x110')](db[_0xe6a2('0xfa')],{'as':'List','foreignKey':_0xe6a2('0x164')});db[_0xe6a2('0x48')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':'Contact','foreignKey':_0xe6a2('0x15c')});db['MailQueueReport'][_0xe6a2('0x110')](db[_0xe6a2('0x10e')],{});db[_0xe6a2('0x48')]['belongsTo'](db['MailMessage'],{});db[_0xe6a2('0x48')]['belongsTo'](db[_0xe6a2('0x15')],{});db[_0xe6a2('0x48')][_0xe6a2('0x110')](db['MailQueue'],{});db['Dashboard'][_0xe6a2('0x107')](db[_0xe6a2('0x4c')],{'as':_0xe6a2('0x165'),'onDelete':'cascade'});db[_0xe6a2('0x129')][_0xe6a2('0x107')](db[_0xe6a2('0x153')],{'as':'Dispositions','foreignKey':_0xe6a2('0x166')});db[_0xe6a2('0x129')][_0xe6a2('0x107')](db[_0xe6a2('0x155')],{'as':_0xe6a2('0x156'),'foreignKey':_0xe6a2('0x166')});db[_0xe6a2('0x129')][_0xe6a2('0x107')](db[_0xe6a2('0x4f')],{'as':_0xe6a2('0x157')});db[_0xe6a2('0x129')]['hasMany'](db[_0xe6a2('0x4d')],{'as':_0xe6a2('0x135')});db[_0xe6a2('0x129')][_0xe6a2('0x107')](db[_0xe6a2('0x1c')],{'as':_0xe6a2('0x167'),'onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x129')][_0xe6a2('0x107')](db[_0xe6a2('0x51')],{'as':'Messages'});db['FaxAccount'][_0xe6a2('0x110')](db[_0xe6a2('0x2e')],{'as':_0xe6a2('0x2e')});db[_0xe6a2('0x129')][_0xe6a2('0x110')](db[_0xe6a2('0xfa')],{'as':_0xe6a2('0x168'),'foreignKey':'ListId'});db[_0xe6a2('0x129')][_0xe6a2('0x110')](db[_0xe6a2('0x8e')],{'as':_0xe6a2('0x141'),'foreignKey':_0xe6a2('0x142')});db[_0xe6a2('0x129')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x144'),'through':_0xe6a2('0x12b')});db[_0xe6a2('0x4d')]['belongsTo'](db[_0xe6a2('0x15')],{'onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x4d')][_0xe6a2('0x110')](db[_0xe6a2('0x53')],{'onDelete':'restrict'});db[_0xe6a2('0x4d')][_0xe6a2('0x110')](db[_0xe6a2('0x129')],{'onDelete':_0xe6a2('0x162')});db['FaxApplication'][_0xe6a2('0x110')](db[_0xe6a2('0x96')],{'onDelete':_0xe6a2('0x162'),'foreignKey':_0xe6a2('0x163')});db[_0xe6a2('0x4f')][_0xe6a2('0x107')](db[_0xe6a2('0x51')],{'as':_0xe6a2('0x14a'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x169')});db[_0xe6a2('0x4f')][_0xe6a2('0x110')](db[_0xe6a2('0x129')],{'as':_0xe6a2('0x15b'),'foreignKey':'FaxAccountId'});db[_0xe6a2('0x4f')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':'Contact','foreignKey':'ContactId'});db[_0xe6a2('0x4f')]['belongsTo'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x15d'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x4f')][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x16a'),'as':'Tags'});db[_0xe6a2('0x4f')][_0xe6a2('0x112')](db['Tag'],{'through':_0xe6a2('0x16a'),'as':_0xe6a2('0x15f')});db[_0xe6a2('0x4f')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'through':_0xe6a2('0x11a'),'foreignKey':'FaxInteractionId'});db[_0xe6a2('0x51')]['belongsTo'](db['User'],{'onDelete':_0xe6a2('0x102'),'as':_0xe6a2('0x15')});db[_0xe6a2('0x51')][_0xe6a2('0x110')](db[_0xe6a2('0x4f')],{'as':_0xe6a2('0x16b'),'foreignKey':_0xe6a2('0x169')});db[_0xe6a2('0x51')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'onDelete':_0xe6a2('0x102'),'as':'Contact'});db[_0xe6a2('0x51')][_0xe6a2('0x110')](db[_0xe6a2('0x161')],{'as':_0xe6a2('0x161'),'foreignKey':_0xe6a2('0x16c')});db[_0xe6a2('0x51')]['belongsTo'](db[_0xe6a2('0x129')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x166')});db[_0xe6a2('0x53')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':'Agents','through':_0xe6a2('0x38')});db[_0xe6a2('0x53')][_0xe6a2('0x112')](db[_0xe6a2('0xe9')],{'through':_0xe6a2('0x16d'),'as':_0xe6a2('0x145')});db[_0xe6a2('0x55')][_0xe6a2('0x110')](db[_0xe6a2('0x129')],{});db[_0xe6a2('0x55')]['belongsTo'](db[_0xe6a2('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0xe6a2('0x55')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':'Contact','foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x55')][_0xe6a2('0x110')](db[_0xe6a2('0x4f')],{});db['FaxQueueReport'][_0xe6a2('0x110')](db['FaxMessage'],{});db[_0xe6a2('0x55')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{});db[_0xe6a2('0x55')][_0xe6a2('0x110')](db['FaxQueue'],{});db[_0xe6a2('0x57')][_0xe6a2('0x107')](db['Disposition'],{'as':_0xe6a2('0x154'),'foreignKey':'SmsAccountId'});db[_0xe6a2('0x57')][_0xe6a2('0x107')](db['CannedAnswer'],{'as':_0xe6a2('0x156'),'foreignKey':_0xe6a2('0x16e')});db[_0xe6a2('0x57')][_0xe6a2('0x107')](db[_0xe6a2('0x16f')],{'as':_0xe6a2('0x14a'),'foreignKey':_0xe6a2('0x16e')});db[_0xe6a2('0x57')][_0xe6a2('0x107')](db[_0xe6a2('0x5b')],{'as':'Interactions'});db[_0xe6a2('0x57')][_0xe6a2('0x107')](db['SmsApplication'],{'as':'Applications'});db[_0xe6a2('0x57')]['belongsTo'](db['CmList'],{'as':_0xe6a2('0x168'),'foreignKey':_0xe6a2('0x164')});db[_0xe6a2('0x57')][_0xe6a2('0x110')](db[_0xe6a2('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':_0xe6a2('0x142')});db[_0xe6a2('0x57')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':'Agents','through':_0xe6a2('0x130')});db[_0xe6a2('0x59')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x59')][_0xe6a2('0x110')](db[_0xe6a2('0x5e')],{'onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x59')][_0xe6a2('0x110')](db[_0xe6a2('0x57')],{'onDelete':_0xe6a2('0x162')});db['SmsApplication'][_0xe6a2('0x110')](db[_0xe6a2('0x13f')],{'onDelete':_0xe6a2('0x162'),'foreignKey':'IntervalId'});db['SmsApplication']['belongsTo'](db[_0xe6a2('0x96')],{'onDelete':_0xe6a2('0x162'),'foreignKey':'TagId'});db[_0xe6a2('0x5b')]['hasMany'](db[_0xe6a2('0x16f')],{'as':'Messages','onDelete':_0xe6a2('0x102'),'foreignKey':'SmsInteractionId'});db[_0xe6a2('0x5b')][_0xe6a2('0x110')](db[_0xe6a2('0x57')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x16e')});db['SmsInteraction'][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':_0xe6a2('0x14f'),'foreignKey':_0xe6a2('0x15c')});db['SmsInteraction'][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x15d'),'foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x5b')][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x170'),'as':_0xe6a2('0x171')});db[_0xe6a2('0x5b')][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x170'),'as':_0xe6a2('0x15f')});db['SmsInteraction'][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'through':_0xe6a2('0x11b'),'foreignKey':_0xe6a2('0x172')});db[_0xe6a2('0x16f')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x15')});db[_0xe6a2('0x16f')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'onDelete':_0xe6a2('0x102'),'as':_0xe6a2('0x14f')});db[_0xe6a2('0x16f')][_0xe6a2('0x110')](db[_0xe6a2('0x5b')],{'onDelete':_0xe6a2('0x102'),'as':_0xe6a2('0x16b'),'foreignKey':_0xe6a2('0x172')});db[_0xe6a2('0x16f')]['belongsTo'](db[_0xe6a2('0x57')],{'as':'Account','foreignKey':_0xe6a2('0x16e')});db[_0xe6a2('0x5e')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x144'),'through':_0xe6a2('0x3a'),'foreignKey':_0xe6a2('0x173')});db['SmsQueue'][_0xe6a2('0x112')](db[_0xe6a2('0xe9')],{'through':'team_has_sms_queues','as':_0xe6a2('0x145')});db[_0xe6a2('0x12e')][_0xe6a2('0x107')](db[_0xe6a2('0x153')],{'as':_0xe6a2('0x154'),'foreignKey':'OpenchannelAccountId'});db[_0xe6a2('0x12e')]['hasMany'](db['CannedAnswer'],{'as':_0xe6a2('0x156'),'foreignKey':_0xe6a2('0x174')});db[_0xe6a2('0x12e')][_0xe6a2('0x107')](db[_0xe6a2('0x62')],{'as':_0xe6a2('0x157'),'foreignKey':_0xe6a2('0x174')});db[_0xe6a2('0x12e')][_0xe6a2('0x107')](db['OpenchannelMessage'],{'as':_0xe6a2('0x14a'),'foreignKey':'OpenchannelAccountId'});db[_0xe6a2('0x12e')][_0xe6a2('0x107')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':_0xe6a2('0x174')});db[_0xe6a2('0x12e')]['belongsTo'](db[_0xe6a2('0xfa')],{'as':_0xe6a2('0x168'),'foreignKey':_0xe6a2('0x164')});db['OpenchannelAccount'][_0xe6a2('0x110')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xe6a2('0x142')});db['OpenchannelAccount'][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':'Agents','through':_0xe6a2('0x175')});db[_0xe6a2('0x60')][_0xe6a2('0x110')](db['User'],{'onDelete':_0xe6a2('0x162')});db['OpenchannelApplication']['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xe6a2('0x162'),'foreignKey':_0xe6a2('0x176')});db[_0xe6a2('0x60')][_0xe6a2('0x110')](db[_0xe6a2('0x12e')],{'onDelete':_0xe6a2('0x162'),'foreignKey':_0xe6a2('0x174')});db[_0xe6a2('0x60')][_0xe6a2('0x110')](db[_0xe6a2('0x13f')],{'onDelete':_0xe6a2('0x162'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xe6a2('0x110')](db[_0xe6a2('0x96')],{'onDelete':_0xe6a2('0x162'),'foreignKey':_0xe6a2('0x163')});db['OpenchannelInteraction']['hasMany'](db[_0xe6a2('0x64')],{'as':_0xe6a2('0x14a'),'onDelete':_0xe6a2('0x102'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction'][_0xe6a2('0x110')](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xe6a2('0x174')});db[_0xe6a2('0x62')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':_0xe6a2('0x14f'),'foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x62')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':'Owner','foreignKey':_0xe6a2('0x103')});db[_0xe6a2('0x62')][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x177'),'as':_0xe6a2('0x171')});db['OpenchannelInteraction']['belongsToMany'](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x177'),'as':_0xe6a2('0x15f')});db[_0xe6a2('0x62')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'through':'user_has_openchannel_interactions','foreignKey':_0xe6a2('0x178')});db[_0xe6a2('0x64')][_0xe6a2('0x110')](db['User'],{'onDelete':_0xe6a2('0x102'),'as':_0xe6a2('0x15')});db[_0xe6a2('0x64')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':_0xe6a2('0x14f')});db[_0xe6a2('0x64')]['belongsTo'](db[_0xe6a2('0x62')],{'onDelete':'cascade','as':_0xe6a2('0x16b'),'foreignKey':'OpenchannelInteractionId'});db[_0xe6a2('0x64')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xe6a2('0x16c')});db[_0xe6a2('0x64')][_0xe6a2('0x110')](db[_0xe6a2('0x12e')],{'as':_0xe6a2('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0xe6a2('0x66')][_0xe6a2('0x112')](db['User'],{'as':_0xe6a2('0x144'),'through':'UserOpenchannelQueue','foreignKey':_0xe6a2('0x176')});db[_0xe6a2('0x66')][_0xe6a2('0x112')](db[_0xe6a2('0xe9')],{'through':_0xe6a2('0x179'),'as':_0xe6a2('0x145')});db[_0xe6a2('0x67')][_0xe6a2('0x107')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xe6a2('0x17a')});db['ChatWebsite'][_0xe6a2('0x107')](db[_0xe6a2('0x155')],{'as':'Answers','foreignKey':_0xe6a2('0x17a')});db[_0xe6a2('0x67')][_0xe6a2('0x107')](db[_0xe6a2('0x75')],{'as':_0xe6a2('0x17b')});db['ChatWebsite']['hasMany'](db[_0xe6a2('0x10b')],{'as':_0xe6a2('0x157')});db[_0xe6a2('0x67')]['hasMany'](db[_0xe6a2('0x6b')],{'as':'Applications'});db[_0xe6a2('0x67')][_0xe6a2('0x107')](db[_0xe6a2('0x6e')],{'as':_0xe6a2('0x14a')});db[_0xe6a2('0x67')]['belongsTo'](db['CmList'],{'as':_0xe6a2('0x168'),'foreignKey':_0xe6a2('0x164')});db[_0xe6a2('0x67')][_0xe6a2('0x110')](db[_0xe6a2('0x13f')],{'as':'Interval','foreignKey':_0xe6a2('0x140')});db[_0xe6a2('0x67')][_0xe6a2('0x110')](db[_0xe6a2('0x8e')],{'as':'mandatoryDispositionPause','foreignKey':_0xe6a2('0x142')});db[_0xe6a2('0x67')][_0xe6a2('0x112')](db['User'],{'as':'Agents','through':_0xe6a2('0x128')});db[_0xe6a2('0x69')]['belongsTo'](db['OpenchannelAccount'],{});db[_0xe6a2('0x69')][_0xe6a2('0x110')](db[_0xe6a2('0xfa')],{'as':'List','foreignKey':'ListId'});db[_0xe6a2('0x69')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':_0xe6a2('0x14f'),'foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x69')][_0xe6a2('0x110')](db[_0xe6a2('0x62')],{});db[_0xe6a2('0x69')][_0xe6a2('0x110')](db[_0xe6a2('0x64')],{});db['OpenchannelQueueReport'][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{});db[_0xe6a2('0x69')]['belongsTo'](db[_0xe6a2('0x66')],{});db[_0xe6a2('0x6b')]['belongsTo'](db['User'],{'as':_0xe6a2('0x17c'),'foreignKey':_0xe6a2('0x103'),'onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x6b')][_0xe6a2('0x110')](db[_0xe6a2('0x72')],{'as':_0xe6a2('0x17d'),'foreignKey':_0xe6a2('0x17e'),'onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x6b')]['belongsTo'](db[_0xe6a2('0x67')],{'as':_0xe6a2('0x17f'),'foreignKey':_0xe6a2('0x17a'),'onDelete':_0xe6a2('0x162')});db['ChatApplication'][_0xe6a2('0x110')](db[_0xe6a2('0x96')],{'onDelete':_0xe6a2('0x162'),'foreignKey':'TagId'});db[_0xe6a2('0x10b')][_0xe6a2('0x107')](db[_0xe6a2('0x6e')],{'as':_0xe6a2('0x14a'),'onDelete':_0xe6a2('0x102'),'foreignKey':'ChatInteractionId'});db[_0xe6a2('0x10b')][_0xe6a2('0x110')](db[_0xe6a2('0x67')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x17a')});db[_0xe6a2('0x10b')]['belongsTo'](db[_0xe6a2('0x79')],{'as':'Contact','foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x10b')][_0xe6a2('0x110')](db['User'],{'as':'Owner','foreignKey':_0xe6a2('0x103')});db['ChatInteraction'][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'through':_0xe6a2('0x180'),'as':_0xe6a2('0x171')});db[_0xe6a2('0x10b')][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'through':'chat_interaction_has_tags','as':_0xe6a2('0x15f')});db[_0xe6a2('0x10b')]['belongsToMany'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'through':_0xe6a2('0x181'),'foreignKey':_0xe6a2('0x182')});db[_0xe6a2('0x6e')]['belongsTo'](db['User'],{'onDelete':'cascade','as':'User'});db['ChatMessage']['belongsTo'](db[_0xe6a2('0x79')],{'onDelete':_0xe6a2('0x102'),'as':_0xe6a2('0x14f'),'foreignKey':_0xe6a2('0x15c')});db['ChatMessage'][_0xe6a2('0x110')](db[_0xe6a2('0x10b')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0xe6a2('0x182')});db[_0xe6a2('0x6e')][_0xe6a2('0x110')](db[_0xe6a2('0x161')],{'as':_0xe6a2('0x161'),'foreignKey':_0xe6a2('0x16c')});db[_0xe6a2('0x6e')][_0xe6a2('0x110')](db[_0xe6a2('0x67')],{'as':'Account','foreignKey':_0xe6a2('0x17a')});db[_0xe6a2('0x70')][_0xe6a2('0x110')](db['CmContact'],{'onDelete':'cascade','as':_0xe6a2('0x14f'),'foreignKey':_0xe6a2('0x15c')});db['ChatOfflineMessage']['belongsTo'](db['ChatWebsite'],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x17a')});db[_0xe6a2('0x72')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':'Agents','through':_0xe6a2('0x35'),'hooks':!![]});db[_0xe6a2('0x72')][_0xe6a2('0x112')](db[_0xe6a2('0xe9')],{'through':_0xe6a2('0x183'),'as':_0xe6a2('0x145')});db['ChatGroup'][_0xe6a2('0x107')](db[_0xe6a2('0xd6')],{'as':_0xe6a2('0x14a'),'foreignKey':_0xe6a2('0x184'),'onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x113')]['belongsToMany'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x185'),'through':_0xe6a2('0x115')});db[_0xe6a2('0x75')][_0xe6a2('0x110')](db['ChatWebsite'],{'as':_0xe6a2('0x17f'),'foreignKey':_0xe6a2('0x17a')});db[_0xe6a2('0x77')][_0xe6a2('0x107')](db['CmContact'],{'as':_0xe6a2('0x186'),'foreignKey':'CompanyId'});db[_0xe6a2('0x79')][_0xe6a2('0x107')](db[_0xe6a2('0x7b')],{'as':'Hoppers','foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x79')][_0xe6a2('0x107')](db[_0xe6a2('0x7f')],{'as':_0xe6a2('0x108'),'foreignKey':_0xe6a2('0x15c')});db['CmContact'][_0xe6a2('0x107')](db['CmHopperHistory'],{'as':_0xe6a2('0x139'),'foreignKey':_0xe6a2('0x15c')});db['CmContact'][_0xe6a2('0x107')](db[_0xe6a2('0x83')],{'as':_0xe6a2('0x83'),'foreignKey':_0xe6a2('0x15c')});db['CmContact']['hasMany'](db[_0xe6a2('0x187')],{'as':_0xe6a2('0x13b'),'foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x79')][_0xe6a2('0x107')](db[_0xe6a2('0x62')],{'as':_0xe6a2('0x10a'),'foreignKey':_0xe6a2('0x15c'),'onDelete':'restrict'});db[_0xe6a2('0x79')]['hasMany'](db[_0xe6a2('0x10b')],{'as':_0xe6a2('0x10c'),'foreignKey':_0xe6a2('0x15c'),'onDelete':_0xe6a2('0x162')});db['CmContact'][_0xe6a2('0x107')](db[_0xe6a2('0x5b')],{'as':_0xe6a2('0x10d'),'foreignKey':_0xe6a2('0x15c'),'onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x79')][_0xe6a2('0x107')](db['FaxInteraction'],{'as':_0xe6a2('0x119'),'foreignKey':_0xe6a2('0x15c'),'onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x79')][_0xe6a2('0x107')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xe6a2('0x79')][_0xe6a2('0x110')](db[_0xe6a2('0x77')],{'as':_0xe6a2('0x188'),'foreignKey':_0xe6a2('0x189')});db[_0xe6a2('0x79')][_0xe6a2('0x110')](db[_0xe6a2('0xfa')],{'as':_0xe6a2('0x168'),'foreignKey':'ListId','onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x79')]['belongsToMany'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'through':'cm_user_has_contacts'});db[_0xe6a2('0x79')][_0xe6a2('0x112')](db[_0xe6a2('0x96')],{'as':_0xe6a2('0x171'),'through':_0xe6a2('0x18a')});db[_0xe6a2('0x79')][_0xe6a2('0x112')](db['Tag'],{'through':_0xe6a2('0x18a'),'as':_0xe6a2('0x15f')});db[_0xe6a2('0x7b')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':'Contact','foreignKey':_0xe6a2('0x15c'),'onDelete':'cascade'});db[_0xe6a2('0x7b')][_0xe6a2('0x110')](db[_0xe6a2('0xfa')],{'as':_0xe6a2('0x168'),'foreignKey':_0xe6a2('0x164'),'onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x7b')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'as':'Agent','foreignKey':_0xe6a2('0x103')});db['CmHopper']['belongsTo'](db[_0xe6a2('0x138')],{'as':_0xe6a2('0x17d'),'foreignKey':_0xe6a2('0x137'),'onDelete':'cascade'});db['CmHopper'][_0xe6a2('0x110')](db[_0xe6a2('0xed')],{'as':_0xe6a2('0xed'),'foreignKey':'CampaignId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x15d'),'foreignKey':_0xe6a2('0x18b')});db['CmHopperBlack']['belongsTo'](db['CmContact'],{'as':_0xe6a2('0x14f'),'foreignKey':'ContactId','onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x7d')][_0xe6a2('0x110')](db[_0xe6a2('0xfa')],{'as':_0xe6a2('0x168'),'foreignKey':'ListId','onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x7d')][_0xe6a2('0x110')](db[_0xe6a2('0x138')],{'as':_0xe6a2('0x17d'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xe6a2('0x7d')][_0xe6a2('0x110')](db[_0xe6a2('0xed')],{'as':_0xe6a2('0xed'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xe6a2('0x18c')][_0xe6a2('0x107')](db[_0xe6a2('0x8b')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xe6a2('0x18d'),'onDelete':_0xe6a2('0x102'),'hooks':!![]});db[_0xe6a2('0x18c')][_0xe6a2('0x107')](db[_0xe6a2('0x8b')],{'as':{'plural':'Any','singular':_0xe6a2('0x18e')},'foreignKey':'AutomationAnyId','onDelete':_0xe6a2('0x102'),'hooks':!![]});db[_0xe6a2('0x18c')]['hasMany'](db[_0xe6a2('0x87')],{'as':_0xe6a2('0x18f'),'foreignKey':'AutomationId','onDelete':_0xe6a2('0x102'),'hooks':!![]});db[_0xe6a2('0x13f')][_0xe6a2('0x107')](db[_0xe6a2('0x13f')],{'as':_0xe6a2('0x190'),'foreignKey':_0xe6a2('0x140'),'onDelete':'cascade','hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0xe6a2('0x1c')],{'as':_0xe6a2('0x191'),'foreignKey':_0xe6a2('0x140'),'onDelete':'restrict'});db[_0xe6a2('0x13f')][_0xe6a2('0x107')](db['MailApplication'],{'as':'MailApplications','foreignKey':'IntervalId'});db[_0xe6a2('0x13f')][_0xe6a2('0x107')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0xe6a2('0x13f')][_0xe6a2('0x107')](db[_0xe6a2('0x4d')],{'as':_0xe6a2('0x192'),'foreignKey':_0xe6a2('0x140')});db[_0xe6a2('0x13f')][_0xe6a2('0x107')](db[_0xe6a2('0x59')],{'as':_0xe6a2('0x193'),'foreignKey':_0xe6a2('0x140')});db['Schedule'][_0xe6a2('0x110')](db[_0xe6a2('0x41')],{});db[_0xe6a2('0x93')][_0xe6a2('0x110')](db[_0xe6a2('0xa1')],{'foreignKey':'DefaultReportId'});db[_0xe6a2('0x93')][_0xe6a2('0x110')](db['AnalyticCustomReport'],{'foreignKey':_0xe6a2('0x194')});db[_0xe6a2('0x95')][_0xe6a2('0x112')](db[_0xe6a2('0x1e')],{'as':_0xe6a2('0x195'),'through':'moh_has_sounds','onDelete':_0xe6a2('0x162')});db[_0xe6a2('0x96')][_0xe6a2('0x112')](db[_0xe6a2('0x79')],{'through':_0xe6a2('0x18a')});db[_0xe6a2('0x96')][_0xe6a2('0x112')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0xe6a2('0x96')][_0xe6a2('0x112')](db['MailInteraction'],{'through':_0xe6a2('0x15e')});db[_0xe6a2('0x96')][_0xe6a2('0x112')](db[_0xe6a2('0x5b')],{'through':_0xe6a2('0x170')});db['Tag']['belongsToMany'](db[_0xe6a2('0x4f')],{'through':_0xe6a2('0x16a')});db['Tag']['belongsToMany'](db[_0xe6a2('0x62')],{'through':_0xe6a2('0x177')});db[_0xe6a2('0x9a')][_0xe6a2('0x107')](db[_0xe6a2('0x8b')],{'as':{'plural':_0xe6a2('0x196'),'singular':_0xe6a2('0x197')},'foreignKey':_0xe6a2('0x198'),'onDelete':'cascade','hooks':!![]});db[_0xe6a2('0x9a')]['hasMany'](db[_0xe6a2('0x8b')],{'as':{'plural':_0xe6a2('0x199'),'singular':_0xe6a2('0x19a')},'foreignKey':_0xe6a2('0x19b'),'onDelete':_0xe6a2('0x102'),'hooks':!![]});db[_0xe6a2('0x9a')][_0xe6a2('0x107')](db[_0xe6a2('0x87')],{'as':'Actions','foreignKey':_0xe6a2('0x19c'),'onDelete':_0xe6a2('0x102'),'hooks':!![]});db[_0xe6a2('0x9f')][_0xe6a2('0x107')](db[_0xe6a2('0xa5')],{'as':'Fields','onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x194'),'hooks':!![]});db['AnalyticDefaultReport'][_0xe6a2('0x107')](db['AnalyticFieldReport'],{'as':_0xe6a2('0x19d'),'onDelete':_0xe6a2('0x102'),'foreignKey':'DefaultReportId'});db['AnalyticMetric']['hasMany'](db[_0xe6a2('0xa5')],{'as':_0xe6a2('0x19d'),'onDelete':_0xe6a2('0x102'),'foreignKey':'MetricId'});db[_0xe6a2('0xa5')][_0xe6a2('0x110')](db[_0xe6a2('0x19e')],{'foreignKey':'MetricId'});db[_0xe6a2('0xa8')][_0xe6a2('0x107')](db['SalesforceConfiguration'],{'as':_0xe6a2('0x19f'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0x1a1')]['hasMany'](db[_0xe6a2('0xaa')],{'as':'Subjects','onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0x1a1')][_0xe6a2('0x107')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0x1a1')]['hasMany'](db['SalesforceField'],{'as':'Fields','onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0x1a1')][_0xe6a2('0x110')](db[_0xe6a2('0xa8')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0xaa')][_0xe6a2('0x107')](db[_0xe6a2('0xaa')],{'as':_0xe6a2('0x1a5'),'foreignKey':_0xe6a2('0x1a2')});db['SalesforceField'][_0xe6a2('0x107')](db[_0xe6a2('0xaa')],{'as':'Description','foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0xaa')]['hasMany'](db['SalesforceField'],{'as':_0xe6a2('0x1a6'),'foreignKey':'FieldId'});db[_0xe6a2('0xaa')]['belongsTo'](db[_0xe6a2('0x1a7')],{'as':'Variable','foreignKey':_0xe6a2('0x1a8')});db['SugarcrmAccount'][_0xe6a2('0x107')](db['SugarcrmConfiguration'],{'as':_0xe6a2('0x19f'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a0')});db['SugarcrmConfiguration']['hasMany'](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a2')});db['SugarcrmConfiguration'][_0xe6a2('0x107')](db[_0xe6a2('0x1a9')],{'as':'Descriptions','onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0x1aa')]['hasMany'](db[_0xe6a2('0x1a9')],{'as':_0xe6a2('0x19d'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0x1aa')][_0xe6a2('0x110')](db[_0xe6a2('0xac')],{'as':'Account','foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0x1a9')]['hasMany'](db[_0xe6a2('0x1a9')],{'as':'Subject','foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0x1a9')][_0xe6a2('0x107')](db[_0xe6a2('0x1a9')],{'as':_0xe6a2('0x1ab'),'foreignKey':'DescriptionId'});db[_0xe6a2('0x1a9')][_0xe6a2('0x107')](db[_0xe6a2('0x1a9')],{'as':_0xe6a2('0x1a6'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0x1a9')][_0xe6a2('0x110')](db[_0xe6a2('0x1a7')],{'as':_0xe6a2('0x1a7'),'foreignKey':'VariableId'});db[_0xe6a2('0xae')]['hasMany'](db[_0xe6a2('0xb0')],{'as':_0xe6a2('0x19f'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0xb0')][_0xe6a2('0x107')](db[_0xe6a2('0x1ac')],{'as':'Subjects','onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xb0')][_0xe6a2('0x107')](db[_0xe6a2('0x1ac')],{'as':_0xe6a2('0x1ad'),'onDelete':'cascade','foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0xb0')][_0xe6a2('0x107')](db[_0xe6a2('0x1ac')],{'as':_0xe6a2('0x19d'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0xb0')][_0xe6a2('0x110')](db[_0xe6a2('0xae')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0xb0')][_0xe6a2('0x112')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db[_0xe6a2('0x1ac')][_0xe6a2('0x107')](db[_0xe6a2('0x1ac')],{'as':_0xe6a2('0x1a5'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0x1ac')][_0xe6a2('0x107')](db['DeskField'],{'as':_0xe6a2('0x1ab'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0x1ac')][_0xe6a2('0x107')](db['DeskField'],{'as':_0xe6a2('0x1a6'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0x1ac')][_0xe6a2('0x110')](db[_0xe6a2('0x1a7')],{'as':_0xe6a2('0x1a7'),'foreignKey':_0xe6a2('0x1a8')});db[_0xe6a2('0xb1')][_0xe6a2('0x107')](db['ZohoConfiguration'],{'as':_0xe6a2('0x19f'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0xb2')][_0xe6a2('0x107')](db[_0xe6a2('0x1ae')],{'as':_0xe6a2('0x1af'),'onDelete':_0xe6a2('0x102'),'foreignKey':'SubjectId'});db['ZohoConfiguration']['hasMany'](db[_0xe6a2('0x1ae')],{'as':_0xe6a2('0x1ad'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0xb2')][_0xe6a2('0x107')](db[_0xe6a2('0x1ae')],{'as':_0xe6a2('0x19d'),'onDelete':_0xe6a2('0x102'),'foreignKey':'FieldId'});db[_0xe6a2('0xb2')][_0xe6a2('0x110')](db['ZohoAccount'],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0x1ae')][_0xe6a2('0x107')](db['ZohoField'],{'as':_0xe6a2('0x1a5'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0x1ae')][_0xe6a2('0x107')](db['ZohoField'],{'as':'Description','foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0x1ae')][_0xe6a2('0x107')](db['ZohoField'],{'as':_0xe6a2('0x1a6'),'foreignKey':'FieldId'});db['ZohoField']['belongsTo'](db[_0xe6a2('0x1a7')],{'as':_0xe6a2('0x1a7'),'foreignKey':_0xe6a2('0x1a8')});db[_0xe6a2('0xb5')][_0xe6a2('0x107')](db['ZendeskConfiguration'],{'as':_0xe6a2('0x19f'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a0')});db['ZendeskConfiguration'][_0xe6a2('0x107')](db[_0xe6a2('0xb9')],{'as':_0xe6a2('0x1af'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xb7')][_0xe6a2('0x107')](db[_0xe6a2('0xb9')],{'as':_0xe6a2('0x1ad'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0xb7')]['hasMany'](db[_0xe6a2('0xb9')],{'as':_0xe6a2('0x19d'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0xb7')]['belongsTo'](db['ZendeskAccount'],{'as':_0xe6a2('0x15b'),'foreignKey':'AccountId'});db[_0xe6a2('0xb7')][_0xe6a2('0x112')](db['Tag'],{'through':_0xe6a2('0x1b0')});db[_0xe6a2('0xb9')][_0xe6a2('0x107')](db[_0xe6a2('0xb9')],{'as':_0xe6a2('0x1a5'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xb9')][_0xe6a2('0x107')](db[_0xe6a2('0xb9')],{'as':'Description','foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0xb9')][_0xe6a2('0x107')](db[_0xe6a2('0xb9')],{'as':_0xe6a2('0x1a6'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0xb9')][_0xe6a2('0x110')](db[_0xe6a2('0x1a7')],{'as':_0xe6a2('0x1a7'),'foreignKey':_0xe6a2('0x1a8')});db[_0xe6a2('0xbb')]['hasMany'](db[_0xe6a2('0xbd')],{'as':_0xe6a2('0x19f'),'onDelete':_0xe6a2('0x102'),'foreignKey':'AccountId'});db[_0xe6a2('0xbd')][_0xe6a2('0x107')](db[_0xe6a2('0xbf')],{'as':_0xe6a2('0x1af'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xbd')][_0xe6a2('0x107')](db[_0xe6a2('0xbf')],{'as':_0xe6a2('0x1ad'),'onDelete':_0xe6a2('0x102'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xe6a2('0x107')](db[_0xe6a2('0xbf')],{'as':_0xe6a2('0x19d'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0xbd')][_0xe6a2('0x110')](db[_0xe6a2('0xbb')],{'as':_0xe6a2('0x15b'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xe6a2('0x112')](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0xe6a2('0xbf')]['hasMany'](db[_0xe6a2('0xbf')],{'as':_0xe6a2('0x1a5'),'foreignKey':'SubjectId'});db['FreshdeskField']['hasMany'](db[_0xe6a2('0xbf')],{'as':_0xe6a2('0x1ab'),'foreignKey':_0xe6a2('0x1a3')});db['FreshdeskField'][_0xe6a2('0x107')](db[_0xe6a2('0xbf')],{'as':_0xe6a2('0x1a6'),'foreignKey':'FieldId'});db[_0xe6a2('0xbf')][_0xe6a2('0x110')](db[_0xe6a2('0x1a7')],{'as':'Variable','foreignKey':_0xe6a2('0x1a8')});db['VtigerAccount'][_0xe6a2('0x107')](db[_0xe6a2('0x1b1')],{'as':_0xe6a2('0x19f'),'onDelete':'cascade','foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0x1b1')][_0xe6a2('0x107')](db['VtigerField'],{'as':_0xe6a2('0x1af'),'foreignKey':_0xe6a2('0x1a2')});db['VtigerConfiguration'][_0xe6a2('0x107')](db[_0xe6a2('0xc3')],{'as':_0xe6a2('0x1ad'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0x1b1')][_0xe6a2('0x107')](db[_0xe6a2('0xc3')],{'as':_0xe6a2('0x19d'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0x1b1')][_0xe6a2('0x110')](db[_0xe6a2('0x1b2')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0xc3')][_0xe6a2('0x107')](db['VtigerField'],{'as':_0xe6a2('0x1a5'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xc3')][_0xe6a2('0x107')](db[_0xe6a2('0xc3')],{'as':_0xe6a2('0x1ab'),'foreignKey':_0xe6a2('0x1a3')});db['VtigerField'][_0xe6a2('0x107')](db['VtigerField'],{'as':_0xe6a2('0x1a6'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0xc3')][_0xe6a2('0x110')](db[_0xe6a2('0x1a7')],{'as':'Variable','foreignKey':'VariableId'});db['ServicenowAccount']['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xe6a2('0x102'),'foreignKey':'AccountId'});db['ServicenowConfiguration']['hasMany'](db[_0xe6a2('0xc8')],{'as':_0xe6a2('0x1af'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xc6')][_0xe6a2('0x107')](db['ServicenowField'],{'as':_0xe6a2('0x1ad'),'foreignKey':'DescriptionId'});db[_0xe6a2('0xc6')]['hasMany'](db['ServicenowField'],{'as':_0xe6a2('0x19d'),'foreignKey':_0xe6a2('0x1a4')});db['ServicenowConfiguration'][_0xe6a2('0x110')](db[_0xe6a2('0x1b3')],{'as':'Account','foreignKey':_0xe6a2('0x1a0')});db['ServicenowField']['hasMany'](db[_0xe6a2('0xc8')],{'as':_0xe6a2('0x1a5'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xc8')][_0xe6a2('0x107')](db[_0xe6a2('0xc8')],{'as':_0xe6a2('0x1ab'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xe6a2('0x107')](db[_0xe6a2('0xc8')],{'as':'Field','foreignKey':_0xe6a2('0x1a4')});db['ServicenowField'][_0xe6a2('0x110')](db[_0xe6a2('0x1a7')],{'as':_0xe6a2('0x1a7'),'foreignKey':_0xe6a2('0x1a8')});db[_0xe6a2('0xca')][_0xe6a2('0x107')](db[_0xe6a2('0xcb')],{'as':_0xe6a2('0x19f'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0xcb')]['hasMany'](db[_0xe6a2('0x1b4')],{'as':_0xe6a2('0x1af'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xcb')][_0xe6a2('0x107')](db['Dynamics365Field'],{'as':_0xe6a2('0x1ad'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0xcb')][_0xe6a2('0x107')](db['Dynamics365Field'],{'as':_0xe6a2('0x19d'),'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0xcb')]['belongsTo'](db[_0xe6a2('0xca')],{'as':_0xe6a2('0x15b'),'foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0x1b4')][_0xe6a2('0x107')](db[_0xe6a2('0x1b4')],{'as':'Subject','foreignKey':_0xe6a2('0x1a2')});db['Dynamics365Field'][_0xe6a2('0x107')](db[_0xe6a2('0x1b4')],{'as':_0xe6a2('0x1ab'),'foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0x1b4')][_0xe6a2('0x107')](db[_0xe6a2('0x1b4')],{'as':_0xe6a2('0x1a6'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0x1b4')]['belongsTo'](db['Variable'],{'as':_0xe6a2('0x1a7'),'foreignKey':'VariableId'});db[_0xe6a2('0xcd')][_0xe6a2('0x107')](db[_0xe6a2('0x1b5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0x1b5')][_0xe6a2('0x107')](db['FreshsalesField'],{'as':_0xe6a2('0x1af'),'foreignKey':'SubjectId'});db['FreshsalesConfiguration'][_0xe6a2('0x107')](db[_0xe6a2('0xd0')],{'as':_0xe6a2('0x1ad'),'foreignKey':_0xe6a2('0x1a3')});db['FreshsalesConfiguration'][_0xe6a2('0x107')](db[_0xe6a2('0xd0')],{'as':'Fields','foreignKey':'FieldId'});db[_0xe6a2('0x1b5')]['belongsTo'](db[_0xe6a2('0xcd')],{'as':'Account','foreignKey':_0xe6a2('0x1a0')});db[_0xe6a2('0xd0')]['hasMany'](db[_0xe6a2('0xd0')],{'as':'Subject','foreignKey':_0xe6a2('0x1a2')});db[_0xe6a2('0xd0')][_0xe6a2('0x107')](db[_0xe6a2('0xd0')],{'as':'Description','foreignKey':_0xe6a2('0x1a3')});db[_0xe6a2('0xd0')][_0xe6a2('0x107')](db[_0xe6a2('0xd0')],{'as':_0xe6a2('0x1a6'),'foreignKey':_0xe6a2('0x1a4')});db[_0xe6a2('0xd0')][_0xe6a2('0x110')](db[_0xe6a2('0x1a7')],{'as':_0xe6a2('0x1a7'),'foreignKey':_0xe6a2('0x1a8')});db[_0xe6a2('0x1b6')][_0xe6a2('0x110')](db[_0xe6a2('0x67')],{});db['ChatQueueReport'][_0xe6a2('0x110')](db['CmList'],{'as':_0xe6a2('0x168'),'foreignKey':_0xe6a2('0x164')});db[_0xe6a2('0x1b6')][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':_0xe6a2('0x14f'),'foreignKey':_0xe6a2('0x15c')});db[_0xe6a2('0x1b6')][_0xe6a2('0x110')](db[_0xe6a2('0x10b')],{});db[_0xe6a2('0x1b6')][_0xe6a2('0x110')](db[_0xe6a2('0x6e')],{});db[_0xe6a2('0x1b6')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{});db[_0xe6a2('0x1b6')][_0xe6a2('0x110')](db[_0xe6a2('0x72')],{});db['ChatInternalMessage'][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'onDelete':_0xe6a2('0x102'),'foreignKey':'FromId'});db[_0xe6a2('0xd6')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'onDelete':_0xe6a2('0x102'),'foreignKey':_0xe6a2('0x1b7')});db['JscriptySessionReport'][_0xe6a2('0x107')](db[_0xe6a2('0x1b8')],{'foreignKey':_0xe6a2('0x1b9'),'onDelete':_0xe6a2('0x102')});db['JscriptySessionReport'][_0xe6a2('0x107')](db[_0xe6a2('0xd8')],{'foreignKey':_0xe6a2('0x1b9'),'onDelete':'cascade'});db['SmsQueueReport'][_0xe6a2('0x110')](db['SmsAccount'],{});db[_0xe6a2('0x1ba')][_0xe6a2('0x110')](db['CmList'],{'as':_0xe6a2('0x168'),'foreignKey':'ListId'});db['SmsQueueReport'][_0xe6a2('0x110')](db[_0xe6a2('0x79')],{'as':_0xe6a2('0x14f'),'foreignKey':'ContactId'});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0xe6a2('0x1ba')][_0xe6a2('0x110')](db[_0xe6a2('0x16f')],{});db[_0xe6a2('0x1ba')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{});db[_0xe6a2('0x1ba')][_0xe6a2('0x110')](db[_0xe6a2('0x5e')],{});db[_0xe6a2('0xe0')][_0xe6a2('0x107')](db[_0xe6a2('0x187')],{'foreignKey':_0xe6a2('0x1bb')});db[_0xe6a2('0xe0')][_0xe6a2('0x107')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xe6a2('0xe0')][_0xe6a2('0x107')](db[_0xe6a2('0xd8')],{'foreignKey':_0xe6a2('0x1bb')});db[_0xe6a2('0xe5')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'through':_0xe6a2('0x132')});db['Team'][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x144'),'through':_0xe6a2('0x117')});db[_0xe6a2('0xe9')]['belongsToMany'](db[_0xe6a2('0x138')],{'through':_0xe6a2('0x146'),'as':_0xe6a2('0x11c')});db[_0xe6a2('0xe9')][_0xe6a2('0x112')](db['MailQueue'],{'through':_0xe6a2('0x1bc'),'as':_0xe6a2('0x11e')});db[_0xe6a2('0xe9')][_0xe6a2('0x112')](db['ChatQueue'],{'through':_0xe6a2('0x183'),'as':_0xe6a2('0x120')});db[_0xe6a2('0xe9')][_0xe6a2('0x112')](db[_0xe6a2('0x53')],{'through':_0xe6a2('0x16d'),'as':_0xe6a2('0x121')});db[_0xe6a2('0xe9')][_0xe6a2('0x112')](db[_0xe6a2('0x5e')],{'through':_0xe6a2('0x1bd'),'as':'SmsQueues'});db[_0xe6a2('0xe9')][_0xe6a2('0x112')](db[_0xe6a2('0x66')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0xe6a2('0xed')][_0xe6a2('0x107')](db[_0xe6a2('0x7b')],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0xe6a2('0xed')][_0xe6a2('0x107')](db['CmHopperFinal'],{'as':_0xe6a2('0x108'),'foreignKey':_0xe6a2('0x1be')});db[_0xe6a2('0xed')][_0xe6a2('0x107')](db[_0xe6a2('0x81')],{'as':_0xe6a2('0x139'),'foreignKey':_0xe6a2('0x1be')});db[_0xe6a2('0xed')]['hasMany'](db[_0xe6a2('0x7d')],{'as':_0xe6a2('0x13a'),'foreignKey':_0xe6a2('0x1be')});db['Campaign'][_0xe6a2('0x110')](db[_0xe6a2('0x2e')],{'as':'Trunk','foreignKey':_0xe6a2('0x13c')});db[_0xe6a2('0xed')][_0xe6a2('0x110')](db[_0xe6a2('0x2e')],{'as':'TrunkBackup','foreignKey':_0xe6a2('0x13e')});db['Campaign'][_0xe6a2('0x110')](db[_0xe6a2('0x13f')],{'as':'Interval','foreignKey':_0xe6a2('0x140')});db[_0xe6a2('0xed')][_0xe6a2('0x110')](db[_0xe6a2('0xe5')],{'as':_0xe6a2('0xe5'),'foreignKey':'SquareProjectId'});db[_0xe6a2('0xed')]['belongsToMany'](db[_0xe6a2('0xfa')],{'as':'Lists','through':_0xe6a2('0x1bf')});db['Campaign'][_0xe6a2('0x112')](db[_0xe6a2('0xfa')],{'as':_0xe6a2('0x147'),'through':_0xe6a2('0x1c0')});db[_0xe6a2('0xf2')]['belongsTo'](db[_0xe6a2('0x45')],{});db[_0xe6a2('0xf2')][_0xe6a2('0x110')](db[_0xe6a2('0x10e')],{});db['MailTransferReport'][_0xe6a2('0x110')](db[_0xe6a2('0x41')],{'foreignKey':'FromMailAccountId','as':_0xe6a2('0x1c1')});db[_0xe6a2('0xf2')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'foreignKey':_0xe6a2('0x1c2'),'as':_0xe6a2('0x1c3')});db[_0xe6a2('0xf2')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'foreignKey':_0xe6a2('0x1c4'),'as':_0xe6a2('0x1c5')});db[_0xe6a2('0xf2')][_0xe6a2('0x110')](db[_0xe6a2('0x11d')],{'foreignKey':_0xe6a2('0x1c6'),'as':'ToQueue'});db[_0xe6a2('0xf2')]['belongsTo'](db['MailAccount'],{'foreignKey':'ToMailAccountId','as':_0xe6a2('0x1c7')});db['ChatTransferReport'][_0xe6a2('0x110')](db[_0xe6a2('0x6e')],{});db[_0xe6a2('0xf3')][_0xe6a2('0x110')](db[_0xe6a2('0x10b')],{});db[_0xe6a2('0xf3')][_0xe6a2('0x110')](db[_0xe6a2('0x67')],{'foreignKey':_0xe6a2('0x1c8'),'as':_0xe6a2('0x1c1')});db[_0xe6a2('0xf3')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'foreignKey':_0xe6a2('0x1c2'),'as':_0xe6a2('0x1c3')});db[_0xe6a2('0xf3')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'foreignKey':_0xe6a2('0x1c4'),'as':_0xe6a2('0x1c5')});db[_0xe6a2('0xf3')][_0xe6a2('0x110')](db[_0xe6a2('0x72')],{'foreignKey':_0xe6a2('0x1c9'),'as':_0xe6a2('0x1ca')});db[_0xe6a2('0xf3')]['belongsTo'](db[_0xe6a2('0x67')],{'foreignKey':'ToChatWebsiteId','as':_0xe6a2('0x1c7')});db[_0xe6a2('0xf5')]['belongsTo'](db['FaxMessage'],{});db[_0xe6a2('0xf5')][_0xe6a2('0x110')](db[_0xe6a2('0x4f')],{});db[_0xe6a2('0xf5')][_0xe6a2('0x110')](db['FaxAccount'],{'foreignKey':_0xe6a2('0x1cb'),'as':_0xe6a2('0x1c1')});db[_0xe6a2('0xf5')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'foreignKey':'FromUserId','as':_0xe6a2('0x1c3')});db['FaxTransferReport']['belongsTo'](db[_0xe6a2('0x15')],{'foreignKey':'ToUserId','as':_0xe6a2('0x1c5')});db[_0xe6a2('0xf5')][_0xe6a2('0x110')](db[_0xe6a2('0x53')],{'foreignKey':'ToFaxQueueId','as':_0xe6a2('0x1ca')});db[_0xe6a2('0xf5')][_0xe6a2('0x110')](db[_0xe6a2('0x129')],{'foreignKey':_0xe6a2('0x1cc'),'as':_0xe6a2('0x1c7')});db[_0xe6a2('0xf6')][_0xe6a2('0x110')](db['OpenchannelMessage'],{});db[_0xe6a2('0xf6')][_0xe6a2('0x110')](db[_0xe6a2('0x62')],{});db[_0xe6a2('0xf6')][_0xe6a2('0x110')](db['OpenchannelAccount'],{'foreignKey':_0xe6a2('0x1cd'),'as':_0xe6a2('0x1c1')});db['OpenchannelTransferReport']['belongsTo'](db[_0xe6a2('0x15')],{'foreignKey':'FromUserId','as':_0xe6a2('0x1c3')});db[_0xe6a2('0xf6')][_0xe6a2('0x110')](db['User'],{'foreignKey':_0xe6a2('0x1c4'),'as':_0xe6a2('0x1c5')});db[_0xe6a2('0xf6')][_0xe6a2('0x110')](db[_0xe6a2('0x66')],{'foreignKey':_0xe6a2('0x1ce'),'as':_0xe6a2('0x1ca')});db[_0xe6a2('0xf6')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':_0xe6a2('0x1cf'),'as':_0xe6a2('0x1c7')});db[_0xe6a2('0xf8')]['belongsTo'](db[_0xe6a2('0x16f')],{});db[_0xe6a2('0xf8')]['belongsTo'](db['SmsInteraction'],{});db[_0xe6a2('0xf8')][_0xe6a2('0x110')](db[_0xe6a2('0x57')],{'foreignKey':'FromSmsAccountId','as':_0xe6a2('0x1c1')});db[_0xe6a2('0xf8')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'foreignKey':_0xe6a2('0x1c2'),'as':'FromAgent'});db[_0xe6a2('0xf8')][_0xe6a2('0x110')](db[_0xe6a2('0x15')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xe6a2('0xf8')]['belongsTo'](db['SmsQueue'],{'foreignKey':_0xe6a2('0x1d0'),'as':_0xe6a2('0x1ca')});db[_0xe6a2('0xf8')][_0xe6a2('0x110')](db[_0xe6a2('0x57')],{'foreignKey':_0xe6a2('0x1d1'),'as':_0xe6a2('0x1c7')});db[_0xe6a2('0xfa')][_0xe6a2('0x107')](db[_0xe6a2('0x153')],{'as':_0xe6a2('0x154'),'foreignKey':_0xe6a2('0x164')});db[_0xe6a2('0xfa')]['hasMany'](db['CmCustomField'],{'as':_0xe6a2('0x1d2'),'foreignKey':'ListId'});db['CmList']['hasMany'](db['CmContact'],{'as':_0xe6a2('0x186'),'onDelete':'cascade','foreignKey':'ListId'});db[_0xe6a2('0xfa')][_0xe6a2('0x107')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ListId'});db['CmList']['hasMany'](db['CmHopperHistory'],{'as':_0xe6a2('0x109'),'foreignKey':_0xe6a2('0x164')});db[_0xe6a2('0xfa')][_0xe6a2('0x107')](db['ReportAgentPreview'],{'as':_0xe6a2('0x83'),'foreignKey':_0xe6a2('0x164')});db['CmList'][_0xe6a2('0x112')](db[_0xe6a2('0x138')],{'as':_0xe6a2('0x1d3'),'through':_0xe6a2('0x143')});db[_0xe6a2('0xfa')]['belongsToMany'](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x144'),'through':_0xe6a2('0x124')});db[_0xe6a2('0xfc')][_0xe6a2('0x107')](db[_0xe6a2('0x1c')],{'as':_0xe6a2('0x191'),'onDelete':'restrict'});db[_0xe6a2('0xfc')][_0xe6a2('0x112')](db[_0xe6a2('0x15')],{'as':'Agents','through':_0xe6a2('0x126')});db[_0xe6a2('0x111')][_0xe6a2('0x107')](db[_0xe6a2('0x15')],{'as':_0xe6a2('0x160'),'foreignKey':_0xe6a2('0x1d4')});db[_0xe6a2('0x111')][_0xe6a2('0x107')](db[_0xe6a2('0x1d5')],{'as':_0xe6a2('0x1d6'),'foreignKey':_0xe6a2('0x1d4'),'onDelete':_0xe6a2('0x102')});db[_0xe6a2('0x1d5')][_0xe6a2('0x107')](db[_0xe6a2('0xff')],{'as':'Resources','foreignKey':'sectionId','onDelete':_0xe6a2('0x102')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 625f73c..fbe78fe 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8832=['/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/version','./api/system','/api/pm2','join','root','/www','static','/demo','/snippet','1.0.16','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','express-winston','./errors','./config/environment','./config/logger','api','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','user','name','role','body','device','statusCode','responseTime','other','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/tag','./api/template'];(function(_0x371484,_0x2f75d3){var _0x5cac56=function(_0x3c5f14){while(--_0x3c5f14){_0x371484['push'](_0x371484['shift']());}};_0x5cac56(++_0x2f75d3);}(_0x8832,0x1a0));var _0x2883=function(_0x5a514b,_0x43c8a5){_0x5a514b=_0x5a514b-0x0;var _0x38a0ad=_0x8832[_0x5a514b];return _0x38a0ad;};'use strict';var path=require(_0x2883('0x0'));var express=require(_0x2883('0x1'));var ewinston=require(_0x2883('0x2'));var util=require('util');var errors=require(_0x2883('0x3'));var config=require(_0x2883('0x4'));var logger=require(_0x2883('0x5'))(_0x2883('0x6'));var authLogger=require('./config/logger')('auth');exports[_0x2883('0x7')]=function(_0x4b484f){_0x4b484f[_0x2883('0x8')](ewinston[_0x2883('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3a2895,_0x25765b){return util[_0x2883('0xa')](_0x2883('0xb'),_0x3a2895[_0x2883('0xc')],_0x3a2895[_0x2883('0xd')][_0x2883('0xe')]?_0x3a2895['headers'][_0x2883('0xe')]:_0x3a2895[_0x2883('0xf')][_0x2883('0x10')]||_0x3a2895['ip'],_0x3a2895[_0x2883('0x11')],_0x25765b['statusCode'],_0x25765b['responseTime'],_0x3a2895[_0x2883('0x12')]?_0x3a2895[_0x2883('0x12')]['id']:null,_0x3a2895[_0x2883('0x12')]?_0x3a2895['user'][_0x2883('0x13')]:null,_0x3a2895['user']?_0x3a2895[_0x2883('0x12')][_0x2883('0x14')]:null);}}));_0x4b484f[_0x2883('0x8')](ewinston[_0x2883('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x26e16b,_0x47f8c2){var _0x382bdf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x26e16b['body']&&_0x26e16b[_0x2883('0x15')][_0x2883('0x16')]&&_0x26e16b[_0x2883('0x15')]['agent_id']){_0x382bdf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x2883('0xa')](_0x382bdf,_0x26e16b[_0x2883('0xc')],_0x26e16b[_0x2883('0xd')]['x-forwarded-for']?_0x26e16b[_0x2883('0xd')]['x-forwarded-for']:_0x26e16b['connection'][_0x2883('0x10')]||_0x26e16b['ip'],_0x26e16b[_0x2883('0x11')],_0x47f8c2[_0x2883('0x17')],_0x47f8c2[_0x2883('0x18')],_0x26e16b[_0x2883('0x12')]?_0x26e16b[_0x2883('0x12')]['id']:null,_0x26e16b[_0x2883('0x12')]?_0x26e16b['user'][_0x2883('0x13')]:null,_0x26e16b[_0x2883('0x12')]?_0x26e16b['user'][_0x2883('0x14')]:null,_0x26e16b[_0x2883('0x15')]&&_0x26e16b['body'][_0x2883('0x16')]?_0x26e16b[_0x2883('0x15')][_0x2883('0x16')]:_0x2883('0x19'),_0x26e16b[_0x2883('0x15')]&&_0x26e16b[_0x2883('0x15')]['agent_id']?_0x26e16b['body']['agent_id']:'',_0x26e16b[_0x2883('0x15')]&&_0x26e16b['body'][_0x2883('0x1a')]?_0x26e16b[_0x2883('0x15')][_0x2883('0x1a')]:'');},'ignoreRoute':function(_0x434aa7){var _0x196333=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x196333[_0x2883('0x1b')](_0x434aa7[_0x2883('0x11')]);}}));_0x4b484f[_0x2883('0x8')](_0x2883('0x1c'),require(_0x2883('0x1d')));_0x4b484f['use']('/api/voice/chanspy',require(_0x2883('0x1e')));_0x4b484f[_0x2883('0x8')](_0x2883('0x1f'),require(_0x2883('0x20')));_0x4b484f[_0x2883('0x8')](_0x2883('0x21'),require('./api/voiceExtension'));_0x4b484f['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x4b484f[_0x2883('0x8')](_0x2883('0x22'),require(_0x2883('0x23')));_0x4b484f[_0x2883('0x8')](_0x2883('0x24'),require(_0x2883('0x25')));_0x4b484f[_0x2883('0x8')](_0x2883('0x26'),require(_0x2883('0x27')));_0x4b484f[_0x2883('0x8')](_0x2883('0x28'),require(_0x2883('0x29')));_0x4b484f[_0x2883('0x8')](_0x2883('0x2a'),require(_0x2883('0x2b')));_0x4b484f[_0x2883('0x8')](_0x2883('0x2c'),require(_0x2883('0x2d')));_0x4b484f['use'](_0x2883('0x2e'),require('./api/voiceDialReport'));_0x4b484f[_0x2883('0x8')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x4b484f[_0x2883('0x8')](_0x2883('0x2f'),require(_0x2883('0x30')));_0x4b484f['use'](_0x2883('0x31'),require(_0x2883('0x32')));_0x4b484f[_0x2883('0x8')](_0x2883('0x33'),require(_0x2883('0x34')));_0x4b484f['use'](_0x2883('0x35'),require(_0x2883('0x36')));_0x4b484f[_0x2883('0x8')](_0x2883('0x37'),require(_0x2883('0x38')));_0x4b484f['use'](_0x2883('0x39'),require(_0x2883('0x3a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x3b'),require(_0x2883('0x3c')));_0x4b484f[_0x2883('0x8')](_0x2883('0x3d'),require(_0x2883('0x3e')));_0x4b484f[_0x2883('0x8')](_0x2883('0x3f'),require(_0x2883('0x40')));_0x4b484f['use'](_0x2883('0x41'),require('./api/mailMessage'));_0x4b484f[_0x2883('0x8')](_0x2883('0x42'),require(_0x2883('0x43')));_0x4b484f[_0x2883('0x8')]('/api/mail/reports/queue',require(_0x2883('0x44')));_0x4b484f[_0x2883('0x8')](_0x2883('0x45'),require('./api/dashboard'));_0x4b484f['use']('/api/dashboards/items',require('./api/dashboardItem'));_0x4b484f['use'](_0x2883('0x46'),require('./api/faxAccount'));_0x4b484f[_0x2883('0x8')](_0x2883('0x47'),require(_0x2883('0x48')));_0x4b484f[_0x2883('0x8')](_0x2883('0x49'),require(_0x2883('0x4a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x4b'),require('./api/faxMessage'));_0x4b484f[_0x2883('0x8')](_0x2883('0x4c'),require(_0x2883('0x4d')));_0x4b484f[_0x2883('0x8')](_0x2883('0x4e'),require(_0x2883('0x4f')));_0x4b484f['use'](_0x2883('0x50'),require(_0x2883('0x51')));_0x4b484f['use'](_0x2883('0x52'),require(_0x2883('0x53')));_0x4b484f['use'](_0x2883('0x54'),require(_0x2883('0x55')));_0x4b484f[_0x2883('0x8')](_0x2883('0x56'),require(_0x2883('0x57')));_0x4b484f[_0x2883('0x8')](_0x2883('0x58'),require(_0x2883('0x59')));_0x4b484f[_0x2883('0x8')](_0x2883('0x5a'),require(_0x2883('0x5b')));_0x4b484f['use'](_0x2883('0x5c'),require(_0x2883('0x5d')));_0x4b484f[_0x2883('0x8')](_0x2883('0x5e'),require('./api/openchannelInteraction'));_0x4b484f[_0x2883('0x8')]('/api/openchannel/messages',require(_0x2883('0x5f')));_0x4b484f[_0x2883('0x8')](_0x2883('0x60'),require(_0x2883('0x61')));_0x4b484f[_0x2883('0x8')](_0x2883('0x62'),require(_0x2883('0x63')));_0x4b484f[_0x2883('0x8')]('/api/openchannel/reports/queue',require(_0x2883('0x64')));_0x4b484f['use'](_0x2883('0x65'),require(_0x2883('0x66')));_0x4b484f['use'](_0x2883('0x67'),require(_0x2883('0x68')));_0x4b484f[_0x2883('0x8')](_0x2883('0x69'),require(_0x2883('0x6a')));_0x4b484f['use'](_0x2883('0x6b'),require(_0x2883('0x6c')));_0x4b484f[_0x2883('0x8')](_0x2883('0x6d'),require(_0x2883('0x6e')));_0x4b484f[_0x2883('0x8')]('/api/chat/groups',require(_0x2883('0x6f')));_0x4b484f[_0x2883('0x8')](_0x2883('0x70'),require('./api/chatProactiveAction'));_0x4b484f['use'](_0x2883('0x71'),require('./api/cmCompany'));_0x4b484f[_0x2883('0x8')](_0x2883('0x72'),require(_0x2883('0x73')));_0x4b484f[_0x2883('0x8')](_0x2883('0x74'),require(_0x2883('0x75')));_0x4b484f[_0x2883('0x8')]('/api/cm/hopper_black',require(_0x2883('0x76')));_0x4b484f['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x4b484f[_0x2883('0x8')](_0x2883('0x77'),require('./api/cmHopperHistory'));_0x4b484f[_0x2883('0x8')](_0x2883('0x78'),require('./api/cmCustomField'));_0x4b484f[_0x2883('0x8')](_0x2883('0x79'),require(_0x2883('0x7a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x7b'),require(_0x2883('0x7c')));_0x4b484f['use']('/api/canned_answers',require(_0x2883('0x7d')));_0x4b484f[_0x2883('0x8')](_0x2883('0x7e'),require(_0x2883('0x7f')));_0x4b484f[_0x2883('0x8')]('/api/conditions',require(_0x2883('0x80')));_0x4b484f[_0x2883('0x8')](_0x2883('0x81'),require(_0x2883('0x82')));_0x4b484f[_0x2883('0x8')](_0x2883('0x83'),require(_0x2883('0x84')));_0x4b484f['use'](_0x2883('0x85'),require(_0x2883('0x86')));_0x4b484f[_0x2883('0x8')](_0x2883('0x87'),require(_0x2883('0x88')));_0x4b484f['use'](_0x2883('0x89'),require(_0x2883('0x8a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x8b'),require('./api/sound'));_0x4b484f[_0x2883('0x8')]('/api/tags',require(_0x2883('0x8c')));_0x4b484f[_0x2883('0x8')]('/api/templates',require(_0x2883('0x8d')));_0x4b484f['use'](_0x2883('0x8e'),require(_0x2883('0x8f')));_0x4b484f['use'](_0x2883('0x90'),require(_0x2883('0x91')));_0x4b484f[_0x2883('0x8')]('/api/integrations',require(_0x2883('0x92')));_0x4b484f[_0x2883('0x8')](_0x2883('0x93'),require('./api/integrationReport'));_0x4b484f[_0x2883('0x8')](_0x2883('0x94'),require(_0x2883('0x95')));_0x4b484f[_0x2883('0x8')](_0x2883('0x96'),require(_0x2883('0x97')));_0x4b484f[_0x2883('0x8')](_0x2883('0x98'),require(_0x2883('0x99')));_0x4b484f[_0x2883('0x8')](_0x2883('0x9a'),require(_0x2883('0x9b')));_0x4b484f[_0x2883('0x8')](_0x2883('0x9c'),require(_0x2883('0x9d')));_0x4b484f['use'](_0x2883('0x9e'),require(_0x2883('0x9f')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa0'),require('./api/intSalesforceAccount'));_0x4b484f['use'](_0x2883('0xa1'),require(_0x2883('0xa2')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa3'),require(_0x2883('0xa4')));_0x4b484f['use'](_0x2883('0xa5'),require(_0x2883('0xa6')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa7'),require(_0x2883('0xa8')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa9'),require(_0x2883('0xaa')));_0x4b484f['use'](_0x2883('0xab'),require(_0x2883('0xac')));_0x4b484f[_0x2883('0x8')](_0x2883('0xad'),require(_0x2883('0xae')));_0x4b484f[_0x2883('0x8')](_0x2883('0xaf'),require(_0x2883('0xb0')));_0x4b484f[_0x2883('0x8')](_0x2883('0xb1'),require(_0x2883('0xb2')));_0x4b484f['use'](_0x2883('0xb3'),require(_0x2883('0xb4')));_0x4b484f[_0x2883('0x8')](_0x2883('0xb5'),require(_0x2883('0xb6')));_0x4b484f[_0x2883('0x8')]('/api/integrations/zendesk/accounts',require(_0x2883('0xb7')));_0x4b484f[_0x2883('0x8')](_0x2883('0xb8'),require(_0x2883('0xb9')));_0x4b484f[_0x2883('0x8')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x4b484f[_0x2883('0x8')]('/api/integrations/freshdesk/accounts',require(_0x2883('0xba')));_0x4b484f['use'](_0x2883('0xbb'),require(_0x2883('0xbc')));_0x4b484f[_0x2883('0x8')](_0x2883('0xbd'),require(_0x2883('0xbe')));_0x4b484f['use'](_0x2883('0xbf'),require(_0x2883('0xc0')));_0x4b484f[_0x2883('0x8')](_0x2883('0xc1'),require('./api/intVtigerConfiguration'));_0x4b484f[_0x2883('0x8')](_0x2883('0xc2'),require(_0x2883('0xc3')));_0x4b484f['use']('/api/integrations/servicenow/accounts',require(_0x2883('0xc4')));_0x4b484f[_0x2883('0x8')](_0x2883('0xc5'),require(_0x2883('0xc6')));_0x4b484f[_0x2883('0x8')](_0x2883('0xc7'),require(_0x2883('0xc8')));_0x4b484f[_0x2883('0x8')]('/api/integrations/dynamics365/accounts',require(_0x2883('0xc9')));_0x4b484f[_0x2883('0x8')](_0x2883('0xca'),require(_0x2883('0xcb')));_0x4b484f[_0x2883('0x8')]('/api/integrations/dynamics365/fields',require(_0x2883('0xcc')));_0x4b484f[_0x2883('0x8')](_0x2883('0xcd'),require('./api/intFreshsalesAccount'));_0x4b484f[_0x2883('0x8')](_0x2883('0xce'),require('./api/intFreshsalesConfiguration'));_0x4b484f[_0x2883('0x8')]('/api/integrations/freshsales/fields',require(_0x2883('0xcf')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd0'),require(_0x2883('0xd1')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd2'),require(_0x2883('0xd3')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd4'),require(_0x2883('0xd5')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd6'),require('./api/jscriptyAnswerReport'));_0x4b484f['use'](_0x2883('0xd7'),require(_0x2883('0xd8')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd9'),require('./api/jscriptySessionReport'));_0x4b484f['use'](_0x2883('0xda'),require(_0x2883('0xdb')));_0x4b484f[_0x2883('0x8')]('/api/square/reports',require(_0x2883('0xdc')));_0x4b484f[_0x2883('0x8')]('/api/square/details/reports',require(_0x2883('0xdd')));_0x4b484f[_0x2883('0x8')](_0x2883('0xde'),require(_0x2883('0xdf')));_0x4b484f[_0x2883('0x8')](_0x2883('0xe0'),require(_0x2883('0xe1')));_0x4b484f[_0x2883('0x8')](_0x2883('0xe2'),require(_0x2883('0xe3')));_0x4b484f[_0x2883('0x8')]('/api/square/projects',require(_0x2883('0xe4')));_0x4b484f['use'](_0x2883('0xe5'),require(_0x2883('0xe6')));_0x4b484f['use'](_0x2883('0xe7'),require(_0x2883('0xe8')));_0x4b484f['use'](_0x2883('0xe9'),require(_0x2883('0xea')));_0x4b484f[_0x2883('0x8')](_0x2883('0xeb'),require(_0x2883('0xec')));_0x4b484f['use'](_0x2883('0xed'),require('./api/campaign'));_0x4b484f[_0x2883('0x8')]('/api/migrations',require(_0x2883('0xee')));_0x4b484f['use']('/api/attachments',require(_0x2883('0xef')));_0x4b484f[_0x2883('0x8')](_0x2883('0xf0'),require(_0x2883('0xf1')));_0x4b484f[_0x2883('0x8')](_0x2883('0xf2'),require(_0x2883('0xf3')));_0x4b484f[_0x2883('0x8')](_0x2883('0xf4'),require('./api/chatTransferReport'));_0x4b484f['use'](_0x2883('0xf5'),require('./api/faxTransferReport'));_0x4b484f['use'](_0x2883('0xf6'),require(_0x2883('0xf7')));_0x4b484f[_0x2883('0x8')]('/api/sms/reports/transfer',require(_0x2883('0xf8')));_0x4b484f[_0x2883('0x8')]('/api/cm/lists',require(_0x2883('0xf9')));_0x4b484f['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x4b484f[_0x2883('0x8')](_0x2883('0xfa'),require(_0x2883('0xfb')));_0x4b484f[_0x2883('0x8')](_0x2883('0xfc'),require('./api/userProfileSection'));_0x4b484f[_0x2883('0x8')]('/api/userProfile/resources',require(_0x2883('0xfd')));_0x4b484f[_0x2883('0x8')](_0x2883('0xfe'),require(_0x2883('0xff')));_0x4b484f['use'](_0x2883('0x100'),require(_0x2883('0x101')));_0x4b484f[_0x2883('0x8')](_0x2883('0x102'),require(_0x2883('0x103')));_0x4b484f['use'](_0x2883('0x104'),require('./api/rpc'));_0x4b484f['use']('/api/version',require(_0x2883('0x105')));_0x4b484f[_0x2883('0x8')]('/api/system',require(_0x2883('0x106')));_0x4b484f['use'](_0x2883('0x107'),require('./api/pm2'));_0x4b484f['use']('/apidoc',express['static'](path[_0x2883('0x108')](config[_0x2883('0x109')],'/apidoc')));_0x4b484f['use'](_0x2883('0x10a'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config[_0x2883('0x109')],_0x2883('0x10a'))));_0x4b484f[_0x2883('0x8')](_0x2883('0x10c'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config['root'],_0x2883('0x10c'))));_0x4b484f['use'](_0x2883('0x10d'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config[_0x2883('0x109')],'snippet',_0x2883('0x10e'))));_0x4b484f[_0x2883('0x8')](_0x2883('0x10f'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config['root'],_0x2883('0x110'))));_0x4b484f[_0x2883('0x111')](_0x2883('0x112'))[_0x2883('0x113')](errors[0x194]);_0x4b484f['route']('/*')[_0x2883('0x113')](function(_0xa9a513,_0x20adbe){_0x20adbe[_0x2883('0x114')](path['resolve'](_0x4b484f[_0x2883('0x113')](_0x2883('0x115'))+_0x2883('0x116')));});}; \ No newline at end of file +var _0xba62=['/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/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/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/tag','/api/templates','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptySessionReport','/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/square/projects','./api/squareProject','./api/squareRecording','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','/api/pm2','./api/pm2','/apidoc','static','join','/www','root','/demo','snippet','1.0.16','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','express','express-winston','./errors','./config/environment','./config/logger','api','auth','default','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','remoteAddress','url','statusCode','responseTime','user','name','role','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','other','agent_name','test','./api/user','/api/voice/chanspy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues'];(function(_0x138a62,_0x548ec9){var _0x3b4acd=function(_0x1d4e9b){while(--_0x1d4e9b){_0x138a62['push'](_0x138a62['shift']());}};_0x3b4acd(++_0x548ec9);}(_0xba62,0xc4));var _0x2ba6=function(_0xc83285,_0x3860f3){_0xc83285=_0xc83285-0x0;var _0x59ef36=_0xba62[_0xc83285];return _0x59ef36;};'use strict';var path=require('path');var express=require(_0x2ba6('0x0'));var ewinston=require(_0x2ba6('0x1'));var util=require('util');var errors=require(_0x2ba6('0x2'));var config=require(_0x2ba6('0x3'));var logger=require(_0x2ba6('0x4'))(_0x2ba6('0x5'));var authLogger=require('./config/logger')(_0x2ba6('0x6'));exports[_0x2ba6('0x7')]=function(_0x38941c){_0x38941c[_0x2ba6('0x8')](ewinston[_0x2ba6('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x259152,_0xca6ad9){return util['format'](_0x2ba6('0xa'),_0x259152[_0x2ba6('0xb')],_0x259152[_0x2ba6('0xc')]['x-forwarded-for']?_0x259152[_0x2ba6('0xc')][_0x2ba6('0xd')]:_0x259152['connection'][_0x2ba6('0xe')]||_0x259152['ip'],_0x259152[_0x2ba6('0xf')],_0xca6ad9[_0x2ba6('0x10')],_0xca6ad9[_0x2ba6('0x11')],_0x259152[_0x2ba6('0x12')]?_0x259152[_0x2ba6('0x12')]['id']:null,_0x259152[_0x2ba6('0x12')]?_0x259152[_0x2ba6('0x12')][_0x2ba6('0x13')]:null,_0x259152[_0x2ba6('0x12')]?_0x259152[_0x2ba6('0x12')][_0x2ba6('0x14')]:null);}}));_0x38941c[_0x2ba6('0x8')](ewinston[_0x2ba6('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x47a134,_0x4a1a99){var _0xc3d345=_0x2ba6('0x15');if(_0x47a134['body']&&_0x47a134['body']['device']&&_0x47a134[_0x2ba6('0x16')][_0x2ba6('0x17')]){_0xc3d345=_0x2ba6('0x18');}return util['format'](_0xc3d345,_0x47a134['method'],_0x47a134[_0x2ba6('0xc')]['x-forwarded-for']?_0x47a134[_0x2ba6('0xc')][_0x2ba6('0xd')]:_0x47a134['connection'][_0x2ba6('0xe')]||_0x47a134['ip'],_0x47a134['url'],_0x4a1a99[_0x2ba6('0x10')],_0x4a1a99['responseTime'],_0x47a134[_0x2ba6('0x12')]?_0x47a134[_0x2ba6('0x12')]['id']:null,_0x47a134[_0x2ba6('0x12')]?_0x47a134[_0x2ba6('0x12')][_0x2ba6('0x13')]:null,_0x47a134[_0x2ba6('0x12')]?_0x47a134[_0x2ba6('0x12')][_0x2ba6('0x14')]:null,_0x47a134[_0x2ba6('0x16')]&&_0x47a134[_0x2ba6('0x16')]['device']?_0x47a134[_0x2ba6('0x16')]['device']:_0x2ba6('0x19'),_0x47a134[_0x2ba6('0x16')]&&_0x47a134[_0x2ba6('0x16')][_0x2ba6('0x17')]?_0x47a134['body']['agent_id']:'',_0x47a134['body']&&_0x47a134[_0x2ba6('0x16')][_0x2ba6('0x1a')]?_0x47a134[_0x2ba6('0x16')][_0x2ba6('0x1a')]:'');},'ignoreRoute':function(_0x38158a){var _0x5a98d1=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5a98d1[_0x2ba6('0x1b')](_0x38158a[_0x2ba6('0xf')]);}}));_0x38941c['use']('/api/users',require(_0x2ba6('0x1c')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x1d'),require('./api/voiceChanSpy'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x1e'),require(_0x2ba6('0x1f')));_0x38941c['use'](_0x2ba6('0x20'),require(_0x2ba6('0x21')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x22'),require('./api/voiceMusicOnHold'));_0x38941c['use'](_0x2ba6('0x23'),require(_0x2ba6('0x24')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x25'),require(_0x2ba6('0x26')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x27'),require(_0x2ba6('0x28')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x29'),require(_0x2ba6('0x2a')));_0x38941c[_0x2ba6('0x8')]('/api/voice/mails/messages',require(_0x2ba6('0x2b')));_0x38941c['use'](_0x2ba6('0x2c'),require(_0x2ba6('0x2d')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x2e'),require(_0x2ba6('0x2f')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x30'),require(_0x2ba6('0x31')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x32'),require(_0x2ba6('0x33')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x34'),require(_0x2ba6('0x35')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x36'),require(_0x2ba6('0x37')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x38'),require(_0x2ba6('0x39')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x3a'),require(_0x2ba6('0x3b')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x3c'),require(_0x2ba6('0x3d')));_0x38941c[_0x2ba6('0x8')]('/api/mail/queues',require('./api/mailQueue'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x3e'),require(_0x2ba6('0x3f')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x40'),require(_0x2ba6('0x41')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x42'),require('./api/mailMessage'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x43'),require('./api/mailApplication'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x44'),require(_0x2ba6('0x45')));_0x38941c[_0x2ba6('0x8')]('/api/dashboards',require(_0x2ba6('0x46')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x47'),require(_0x2ba6('0x48')));_0x38941c['use'](_0x2ba6('0x49'),require(_0x2ba6('0x4a')));_0x38941c['use'](_0x2ba6('0x4b'),require(_0x2ba6('0x4c')));_0x38941c['use'](_0x2ba6('0x4d'),require(_0x2ba6('0x4e')));_0x38941c[_0x2ba6('0x8')]('/api/fax/messages',require(_0x2ba6('0x4f')));_0x38941c['use'](_0x2ba6('0x50'),require('./api/faxQueue'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x51'),require(_0x2ba6('0x52')));_0x38941c['use']('/api/sms/accounts',require(_0x2ba6('0x53')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x54'),require(_0x2ba6('0x55')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x56'),require(_0x2ba6('0x57')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x58'),require(_0x2ba6('0x59')));_0x38941c['use'](_0x2ba6('0x5a'),require(_0x2ba6('0x5b')));_0x38941c[_0x2ba6('0x8')]('/api/openchannel/accounts',require(_0x2ba6('0x5c')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x5d'),require(_0x2ba6('0x5e')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x5f'),require(_0x2ba6('0x60')));_0x38941c[_0x2ba6('0x8')]('/api/openchannel/messages',require('./api/openchannelMessage'));_0x38941c[_0x2ba6('0x8')]('/api/openchannel/queues',require(_0x2ba6('0x61')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x62'),require(_0x2ba6('0x63')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x64'),require(_0x2ba6('0x65')));_0x38941c['use'](_0x2ba6('0x66'),require(_0x2ba6('0x67')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x68'),require('./api/chatInteraction'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x69'),require(_0x2ba6('0x6a')));_0x38941c[_0x2ba6('0x8')]('/api/chat/offline_messages',require(_0x2ba6('0x6b')));_0x38941c['use']('/api/chat/queues',require(_0x2ba6('0x6c')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x6d'),require('./api/chatGroup'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x6e'),require(_0x2ba6('0x6f')));_0x38941c['use'](_0x2ba6('0x70'),require(_0x2ba6('0x71')));_0x38941c['use'](_0x2ba6('0x72'),require(_0x2ba6('0x73')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x74'),require(_0x2ba6('0x75')));_0x38941c['use'](_0x2ba6('0x76'),require(_0x2ba6('0x77')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x78'),require(_0x2ba6('0x79')));_0x38941c['use'](_0x2ba6('0x7a'),require('./api/cmHopperHistory'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x7b'),require(_0x2ba6('0x7c')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x7d'),require(_0x2ba6('0x7e')));_0x38941c['use'](_0x2ba6('0x7f'),require(_0x2ba6('0x80')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x81'),require('./api/cannedAnswer'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x82'),require(_0x2ba6('0x83')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x84'),require(_0x2ba6('0x85')));_0x38941c['use'](_0x2ba6('0x86'),require(_0x2ba6('0x87')));_0x38941c['use']('/api/pauses',require('./api/pause'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x88'),require(_0x2ba6('0x89')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x8a'),require(_0x2ba6('0x8b')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x8c'),require(_0x2ba6('0x8d')));_0x38941c[_0x2ba6('0x8')]('/api/sounds',require(_0x2ba6('0x8e')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x8f'),require(_0x2ba6('0x90')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x91'),require('./api/template'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x92'),require(_0x2ba6('0x93')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x94'),require(_0x2ba6('0x95')));_0x38941c['use']('/api/integrations',require(_0x2ba6('0x96')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x97'),require(_0x2ba6('0x98')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x99'),require(_0x2ba6('0x9a')));_0x38941c[_0x2ba6('0x8')]('/api/analytics/default_reports',require(_0x2ba6('0x9b')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x9c'),require('./api/analyticExtractedReport'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x9d'),require(_0x2ba6('0x9e')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x9f'),require(_0x2ba6('0xa0')));_0x38941c['use']('/api/analytics/tree_reports',require(_0x2ba6('0xa1')));_0x38941c['use'](_0x2ba6('0xa2'),require('./api/intSalesforceAccount'));_0x38941c[_0x2ba6('0x8')]('/api/integrations/salesforce/configurations',require(_0x2ba6('0xa3')));_0x38941c['use'](_0x2ba6('0xa4'),require(_0x2ba6('0xa5')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xa6'),require(_0x2ba6('0xa7')));_0x38941c[_0x2ba6('0x8')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x38941c['use'](_0x2ba6('0xa8'),require(_0x2ba6('0xa9')));_0x38941c[_0x2ba6('0x8')]('/api/integrations/desk/accounts',require(_0x2ba6('0xaa')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xab'),require(_0x2ba6('0xac')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xad'),require(_0x2ba6('0xae')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xaf'),require(_0x2ba6('0xb0')));_0x38941c[_0x2ba6('0x8')]('/api/integrations/zoho/configurations',require(_0x2ba6('0xb1')));_0x38941c['use']('/api/integrations/zoho/fields',require(_0x2ba6('0xb2')));_0x38941c['use'](_0x2ba6('0xb3'),require(_0x2ba6('0xb4')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xb5'),require(_0x2ba6('0xb6')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xb7'),require('./api/intZendeskField'));_0x38941c['use'](_0x2ba6('0xb8'),require(_0x2ba6('0xb9')));_0x38941c[_0x2ba6('0x8')]('/api/integrations/freshdesk/configurations',require('./api/intFreshdeskConfiguration'));_0x38941c[_0x2ba6('0x8')]('/api/integrations/freshdesk/fields',require('./api/intFreshdeskField'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xba'),require(_0x2ba6('0xbb')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xbc'),require('./api/intVtigerConfiguration'));_0x38941c['use'](_0x2ba6('0xbd'),require('./api/intVtigerField'));_0x38941c[_0x2ba6('0x8')]('/api/integrations/servicenow/accounts',require(_0x2ba6('0xbe')));_0x38941c['use'](_0x2ba6('0xbf'),require(_0x2ba6('0xc0')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xc1'),require(_0x2ba6('0xc2')));_0x38941c[_0x2ba6('0x8')]('/api/integrations/dynamics365/accounts',require(_0x2ba6('0xc3')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xc4'),require(_0x2ba6('0xc5')));_0x38941c['use'](_0x2ba6('0xc6'),require(_0x2ba6('0xc7')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xc8'),require(_0x2ba6('0xc9')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xca'),require('./api/intFreshsalesConfiguration'));_0x38941c['use'](_0x2ba6('0xcb'),require(_0x2ba6('0xcc')));_0x38941c[_0x2ba6('0x8')]('/api/networks',require(_0x2ba6('0xcd')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xce'),require('./api/chatQueueReport'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xcf'),require(_0x2ba6('0xd0')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xd1'),require(_0x2ba6('0xd2')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xd3'),require('./api/jscriptyQuestionReport'));_0x38941c['use']('/api/jscripty/sessions/reports',require(_0x2ba6('0xd4')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xd5'),require(_0x2ba6('0xd6')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xd7'),require(_0x2ba6('0xd8')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xd9'),require(_0x2ba6('0xda')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xdb'),require(_0x2ba6('0xdc')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xdd'),require(_0x2ba6('0xde')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xdf'),require('./api/squareOdbc'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xe0'),require(_0x2ba6('0xe1')));_0x38941c[_0x2ba6('0x8')]('/api/square/recordings',require(_0x2ba6('0xe2')));_0x38941c[_0x2ba6('0x8')]('/api/square/messages',require('./api/squareMessage'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xe3'),require(_0x2ba6('0xe4')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xe5'),require(_0x2ba6('0xe6')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xe7'),require(_0x2ba6('0xe8')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xe9'),require('./api/migration'));_0x38941c['use'](_0x2ba6('0xea'),require(_0x2ba6('0xeb')));_0x38941c['use']('/api/plugins',require(_0x2ba6('0xec')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xed'),require(_0x2ba6('0xee')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xef'),require(_0x2ba6('0xf0')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xf1'),require('./api/faxTransferReport'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xf2'),require(_0x2ba6('0xf3')));_0x38941c['use'](_0x2ba6('0xf4'),require('./api/smsTransferReport'));_0x38941c['use'](_0x2ba6('0xf5'),require(_0x2ba6('0xf6')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xf7'),require(_0x2ba6('0xf8')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xf9'),require('./api/userProfile'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xfa'),require(_0x2ba6('0xfb')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xfc'),require('./api/userProfileResource'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0xfd'),require(_0x2ba6('0xfe')));_0x38941c['use'](_0x2ba6('0xff'),require('./api/authGoogle'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x100'),require(_0x2ba6('0x101')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x102'),require(_0x2ba6('0x103')));_0x38941c['use']('/api/version',require('./api/version'));_0x38941c['use'](_0x2ba6('0x104'),require('./api/system'));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x105'),require(_0x2ba6('0x106')));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x107'),express[_0x2ba6('0x108')](path[_0x2ba6('0x109')](config['root'],_0x2ba6('0x107'))));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x10a'),express['static'](path['join'](config[_0x2ba6('0x10b')],_0x2ba6('0x10a'))));_0x38941c[_0x2ba6('0x8')](_0x2ba6('0x10c'),express[_0x2ba6('0x108')](path[_0x2ba6('0x109')](config[_0x2ba6('0x10b')],_0x2ba6('0x10c'))));_0x38941c[_0x2ba6('0x8')]('/snippet',express[_0x2ba6('0x108')](path[_0x2ba6('0x109')](config[_0x2ba6('0x10b')],_0x2ba6('0x10d'),_0x2ba6('0x10e'))));_0x38941c[_0x2ba6('0x8')]('/plugins',express[_0x2ba6('0x108')](path['join'](config['root'],'/server/files/plugins')));_0x38941c[_0x2ba6('0x10f')](_0x2ba6('0x110'))[_0x2ba6('0x111')](errors[0x194]);_0x38941c[_0x2ba6('0x10f')]('/*')[_0x2ba6('0x111')](function(_0x2301b2,_0xc15d6f){_0xc15d6f[_0x2ba6('0x112')](path['resolve'](_0x38941c[_0x2ba6('0x111')](_0x2ba6('0x113'))+_0x2ba6('0x114')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 81ef851..749a22a 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4643=['../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.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/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc'];(function(_0x1b6f60,_0x5d658a){var _0x29018c=function(_0x3e2fa9){while(--_0x3e2fa9){_0x1b6f60['push'](_0x1b6f60['shift']());}};_0x29018c(++_0x5d658a);}(_0x4643,0x1cf));var _0x3464=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4643[_0x51020b];return _0x371e47;};'use strict';var jayson=require(_0x3464('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x3464('0x1'));exports[_0x3464('0x2')]=function(){return new BPromise(function(_0x1259d5,_0x58f7f8){var _0x3ee1df={};_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x4')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x5')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x6')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x7')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x8')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x9')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xa')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xb')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xc')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xd')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xe')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xf')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x10')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x11')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x12')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x13')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x14')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x15')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x16')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x17')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x18')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x19')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1a')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1b')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1c')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/smsInteraction/smsInteraction.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/smsMessage/smsMessage.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/smsQueue/smsQueue.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x1d')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1e')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1f')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x20')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/chatInteraction/chatInteraction.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/chatMessage/chatMessage.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/chatQueue/chatQueue.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/cmContact/cmContact.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x21')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x22')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x23')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x24')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/sound/sound.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x25')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x26')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x27')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x28')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x29')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2a')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2b')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2c')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2d')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2e')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x2f')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x30')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x31')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x32')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/squareProject/squareProject.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/squareRecording/squareRecording.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/squareMessage/squareMessage.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x33')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x34')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x35')));var _0x554314=jayson['server'](_0x3ee1df)[_0x3464('0x36')]();var _0xc7e01c=config[_0x3464('0x37')][_0x3464('0x38')]||config[_0x3464('0x38')]+0x1;var _0x42ec48=config['rpc']['ip']||_0x3464('0x39');_0x554314['on'](_0x3464('0x3a'),function(_0x51affc){return _0x58f7f8(_0x51affc);});_0x554314[_0x3464('0x2')](_0xc7e01c,_0x42ec48,function(){console['log'](_0x3464('0x3b'),_0x42ec48,_0xc7e01c);require(_0x3464('0x3c'))['default']();return _0x1259d5(_0x3464('0x3d')+_0x42ec48+':'+_0xc7e01c);});});}; \ No newline at end of file +var _0x030d=['../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/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','bluebird','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/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc'];(function(_0x1a64f3,_0x59f675){var _0x5043ad=function(_0x393d1){while(--_0x393d1){_0x1a64f3['push'](_0x1a64f3['shift']());}};_0x5043ad(++_0x59f675);}(_0x030d,0xfe));var _0xd030=function(_0x3dacb8,_0x48eab5){_0x3dacb8=_0x3dacb8-0x0;var _0x16d5a0=_0x030d[_0x3dacb8];return _0x16d5a0;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xd030('0x0'));var _=require(_0xd030('0x1'));var config=require(_0xd030('0x2'));exports['listen']=function(){return new BPromise(function(_0x490414,_0x10cea3){var _0x48e806={};_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x4')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x5')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x6')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x7')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x8')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x9')));_0x48e806=_['merge'](_0x48e806,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0xa')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require('../api/memberReport/memberReport.rpc'));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0xb')));_0x48e806=_['merge'](_0x48e806,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0xc')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0xd')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0xe')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0xf')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x10')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x11')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x12')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x13')));_0x48e806=_['merge'](_0x48e806,require('../api/faxApplication/faxApplication.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x14')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x15')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x16')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x17')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x18')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x19')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require('../api/smsMessage/smsMessage.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x1a')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x1b')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x1c')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x1d')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x1e')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x1f')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x20')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x21')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x22')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x23')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x24')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x25')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x26')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x27')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x28')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x29')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x2a')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x2b')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x2c')));_0x48e806=_['merge'](_0x48e806,require('../api/variable/variable.rpc'));_0x48e806=_['merge'](_0x48e806,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x2d')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x2e')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x2f')));_0x48e806=_['merge'](_0x48e806,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x30')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x31')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x32')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x33')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x34')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x35')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x36')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x37')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x38')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x39')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require('../api/squareRecording/squareRecording.rpc'));_0x48e806=_['merge'](_0x48e806,require('../api/squareMessage/squareMessage.rpc'));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x3a')));_0x48e806=_['merge'](_0x48e806,require(_0xd030('0x3b')));_0x48e806=_[_0xd030('0x3')](_0x48e806,require(_0xd030('0x3c')));var _0x23b279=jayson[_0xd030('0x3d')](_0x48e806)[_0xd030('0x3e')]();var _0x19de3b=config[_0xd030('0x3f')][_0xd030('0x40')]||config[_0xd030('0x40')]+0x1;var _0xb22e2f=config['rpc']['ip']||_0xd030('0x41');_0x23b279['on'](_0xd030('0x42'),function(_0x3390fc){return _0x10cea3(_0x3390fc);});_0x23b279[_0xd030('0x43')](_0x19de3b,_0xb22e2f,function(){console[_0xd030('0x44')](_0xd030('0x45'),_0xb22e2f,_0x19de3b);require(_0xd030('0x46'))['default']();return _0x490414(_0xd030('0x47')+_0xb22e2f+':'+_0x19de3b);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index a2ebf43..267eb15 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 _0xcaa2=['command','sync','answer','ANSWER','getData','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','520-Invalid','function','no\x20code','replace','result=','substr','indexOf','startsWith','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','prototype'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0xcaa2,0xfc));var _0x2caa=function(_0x400096,_0x101dc3){_0x400096=_0x400096-0x0;var _0x31755a=_0xcaa2[_0x400096];return _0x31755a;};'use strict';var util=require(_0x2caa('0x0'));var _=require(_0x2caa('0x1'));var EventEmitter=require(_0x2caa('0x2'))[_0x2caa('0x3')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x474804){var _0x18b399=this,_0x5eb6d7=new AGIReply(),_0x302eb3=![],_0x2885ce={};EventEmitter[_0x2caa('0x4')](_0x18b399);_0x474804[_0x2caa('0x5')](_0x2caa('0x6'));_0x474804[_0x2caa('0x7')](0x8*0x3c*0x3c*0x3e8);_0x5eb6d7[_0x2caa('0x5')](_0x2caa('0x6'));_0x5eb6d7['on'](_0x2caa('0x8'),function(_0x5dd958){for(var _0x44bf2d in _0x5dd958){_0x18b399[_0x44bf2d]=_0x5dd958[_0x44bf2d];}_0x18b399[_0x2caa('0x9')](_0x2caa('0xa'));});_0x5eb6d7['on'](_0x2caa('0xb'),function(_0xa84823){if(_0xa84823['toLowerCase']()==_0x2caa('0xc')){_0x18b399[_0x2caa('0x9')](_0x2caa('0xc'));return;}if(_0xa84823[_0x2caa('0xd')](0x0,0xb)==_0x2caa('0xe')){_0x302eb3=!![];}if(_0x302eb3){_0x2885ce['rx']+=_0xa84823+'\x0a';if(_0xa84823['search']('520\x20End\x20of\x20proper')!=-0x1){_0x302eb3=![];}}else{_0x2885ce['rx']=_0xa84823;}if(_0x302eb3){return;}if(typeof _0x2885ce['cb']==_0x2caa('0xf')){var _0x5d03e6=_0x2885ce['rx'][_0x2caa('0xd')](0x0,0x3),_0x41b14d=null,_0x813f1e=null;_0x5d03e6=parseInt(_0x5d03e6);if(isNaN(_0x5d03e6)){_0x2885ce['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2caa('0x10')});return;}if(_0x5d03e6!=0xc8){_0x2885ce['cb'](null,{'code':_0x5d03e6,'result':-0x1,'extra':'KO'});return;}_0x41b14d=_0x2885ce['rx'][_0x2caa('0xd')](0x4)[_0x2caa('0x11')](_0x2caa('0x12'),'');if(_0x41b14d['indexOf']('\x20')!=-0x1){_0x41b14d=_0x41b14d[_0x2caa('0x13')](0x0,_0x41b14d[_0x2caa('0x14')]('\x20'));}if(_[_0x2caa('0x15')](_0x41b14d,'-1')){_0x41b14d=parseInt(_0x41b14d);}_0x813f1e=_0x2885ce['rx']['split']('\x20');if(_0x813f1e[_0x2caa('0x16')]==0x3){_0x813f1e=_0x813f1e[0x2][_0x2caa('0xd')](0x1,_0x813f1e[0x2][_0x2caa('0x16')]-0x1);}else if(_0x813f1e[_0x2caa('0x16')]>0x3){var _0x410a37=/\((.+)\)/;var _0x76c56a=_0x2885ce['rx'][_0x2caa('0x17')](_0x410a37);if(_0x76c56a){_0x813f1e=_0x76c56a[0x1];}else{_0x813f1e=null;}}else{_0x813f1e=null;}_0x2885ce['cb'](null,{'code':_0x5d03e6,'result':_0x41b14d,'extra':_0x813f1e});}});_0x474804['on'](_0x2caa('0x18'),function(_0x38879d){_0x18b399[_0x2caa('0x9')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x38879d['code']));});_0x474804['on'](_0x2caa('0x19'),function(){_0x18b399[_0x2caa('0x9')](_0x2caa('0x19'),new AGIError(_0x2caa('0x1a')));});_0x474804['on'](_0x2caa('0x1b'),function(){_0x18b399[_0x2caa('0x9')](_0x2caa('0x1b'),new AGIError(_0x2caa('0x1c')));_0x474804[_0x2caa('0x1d')]();});_0x474804[_0x2caa('0x1e')](_0x5eb6d7);this['command']=function(_0x242ceb,_0x203f88){var _0x242ceb=_0x242ceb||'',_0x203f88=typeof _0x203f88==_0x2caa('0xf')?_0x203f88:new Function();_0x2885ce={'tx':_0x242ceb,'rx':'','cb':_0x203f88};_0x474804['write'](_0x242ceb+'\x0a');},this[_0x2caa('0x19')]=function(){_0x474804['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x2caa('0x1f')]['sendRequest']=function(_0x1b58c9){return this[_0x2caa('0x20')][_0x2caa('0x21')](this,_0x1b58c9);};AGIChannel['prototype'][_0x2caa('0x22')]=function(){return this['sendRequest'](_0x2caa('0x23'));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x24')]=function(_0x22006a,_0x178591,_0x4ea03f){_0x22006a=_0x22006a===undefined?'beep':_0x22006a;_0x178591=_0x178591===undefined?'5':_0x178591;_0x4ea03f=_0x4ea03f===undefined?'1':_0x4ea03f;return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x27'),_0x22006a,_0x178591*0x3e8,_0x4ea03f));};AGIChannel['prototype'][_0x2caa('0x28')]=function(_0x404f0b){_0x404f0b=_0x404f0b||_0x2caa('0x29');return this[_0x2caa('0x25')](util[_0x2caa('0x26')]('VERBOSE\x20\x22%s\x22',_0x404f0b));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x2a')]=function(_0x175cbe,_0x3b1e1f){if(_[_0x2caa('0x2b')](_0x3b1e1f)){return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x2c'),_0x175cbe,_0x3b1e1f[_0x2caa('0x2d')](',')));}return this['sendRequest'](util[_0x2caa('0x26')](_0x2caa('0x2c'),_0x175cbe,_0x3b1e1f));};AGIChannel[_0x2caa('0x1f')]['setContext']=function(_0x340b0c){return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x2e'),_0x340b0c));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x2f')]=function(_0x5aba0c){return this[_0x2caa('0x25')](util[_0x2caa('0x26')]('SET\x20EXTENSION\x20%s',_0x5aba0c));};AGIChannel['prototype']['setPriority']=function(_0x8e733){return this[_0x2caa('0x25')](util['format'](_0x2caa('0x30'),_0x8e733));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0xc')]=function(){return this[_0x2caa('0x25')](_0x2caa('0x31'));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x32')]=function(_0x60d093,_0x7bd6d4){return this['sendRequest'](util[_0x2caa('0x26')](_0x2caa('0x33'),_0x60d093,_0x7bd6d4?_0x7bd6d4[_0x2caa('0x34')]()[_0x2caa('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x2caa('0x35')]=function(_0x34a41d,_0x11a702){return this[_0x2caa('0x25')](util['format'](_0x2caa('0x36'),_0x34a41d,_0x11a702));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x37')]=function(_0x1cffea,_0x3240d4){return this[_0x2caa('0x25')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x1cffea,_0x3240d4));};AGIChannel['prototype'][_0x2caa('0x38')]=function(_0x2e85d8,_0x4549a1){return this['sendRequest'](util['format'](_0x2caa('0x39'),_0x2e85d8,_0x4549a1));};AGIChannel[_0x2caa('0x1f')]['continueAt']=function(_0x212550,_0x2882b5,_0x54eb46){_0x2882b5=_0x2882b5||this[_0x2caa('0x3a')];_0x54eb46=_0x54eb46||0x1;this['setContext'](_0x212550);this[_0x2caa('0x2f')](_0x2882b5);this['setPriority'](_0x54eb46);return this[_0x2caa('0x28')](util[_0x2caa('0x26')](_0x2caa('0x3b'),_0x212550,_0x2882b5,_0x54eb46));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x3c')]=function(_0x3084c8){return this[_0x2caa('0x25')](util[_0x2caa('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3084c8));};AGIChannel[_0x2caa('0x1f')]['recordFile']=function(_0xeb8f3b,_0x53e7a0,_0x1314b5,_0x1cee84,_0x4dbd01,_0x3edf31){_0x53e7a0=_0x53e7a0||_0x2caa('0x3d');_0x1314b5=_0x1314b5||'';_0x1cee84=_0x1cee84===undefined?-0x1:_0x1cee84==='-1'?-0x1:_0x1cee84*0x3e8;_0x4dbd01=_0x4dbd01===undefined?'':'s='+_0x4dbd01;_0x3edf31=_0x3edf31?_0x2caa('0x3e'):'';return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x3f'),_0xeb8f3b,_0x53e7a0,_0x1314b5,_0x1cee84,_0x3edf31,_0x4dbd01));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x40')]=function(_0xb2e2c0,_0x30b8ff){_0x30b8ff=_0x30b8ff||'';return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x41'),_0xb2e2c0,_0x30b8ff));};AGIChannel[_0x2caa('0x1f')]['agi']=function(_0x428725){return this['exec']('AGI',_0x428725);};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x42')]=function(_0x2853f5){return this[_0x2caa('0x2a')](_0x2caa('0x43'),_0x2853f5);};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x18')]=function(_0x4345ae,_0x29a407){this[_0x2caa('0x28')](util[_0x2caa('0x26')](_0x2caa('0x44'),_0x4345ae['id'],_0x4345ae[_0x2caa('0x45')],_0x29a407));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2caa('0x46')]=AGIChannel; \ No newline at end of file +var _0xd245=['lodash','./reply','./error','call','utf8','setEncoding','headers','emit','ready','line','toLowerCase','hangup','520-Invalid','520\x20End\x20of\x20proper','substring','no\x20code','indexOf','substr','startsWith','split','length','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','exec','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setContext','GOTO\x20%s\x20%s\x20%s','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util'];(function(_0x1f38a6,_0x3b66fb){var _0x3c6005=function(_0x1b0536){while(--_0x1b0536){_0x1f38a6['push'](_0x1f38a6['shift']());}};_0x3c6005(++_0x3b66fb);}(_0xd245,0x9b));var _0x5d24=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xd245[_0x1a72f3];return _0x57ef47;};'use strict';var util=require(_0x5d24('0x0'));var _=require(_0x5d24('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIReply=require(_0x5d24('0x2'));var AGIError=require(_0x5d24('0x3'));function AGIChannel(_0x44126e){var _0x315531=this,_0x50d635=new AGIReply(),_0x13acbf=![],_0xcc60a4={};EventEmitter[_0x5d24('0x4')](_0x315531);_0x44126e['setEncoding'](_0x5d24('0x5'));_0x44126e['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x50d635[_0x5d24('0x6')](_0x5d24('0x5'));_0x50d635['on'](_0x5d24('0x7'),function(_0x1b654c){for(var _0x576478 in _0x1b654c){_0x315531[_0x576478]=_0x1b654c[_0x576478];}_0x315531[_0x5d24('0x8')](_0x5d24('0x9'));});_0x50d635['on'](_0x5d24('0xa'),function(_0x2351e9){if(_0x2351e9[_0x5d24('0xb')]()==_0x5d24('0xc')){_0x315531['emit'](_0x5d24('0xc'));return;}if(_0x2351e9['substring'](0x0,0xb)==_0x5d24('0xd')){_0x13acbf=!![];}if(_0x13acbf){_0xcc60a4['rx']+=_0x2351e9+'\x0a';if(_0x2351e9['search'](_0x5d24('0xe'))!=-0x1){_0x13acbf=![];}}else{_0xcc60a4['rx']=_0x2351e9;}if(_0x13acbf){return;}if(typeof _0xcc60a4['cb']=='function'){var _0x463dd0=_0xcc60a4['rx'][_0x5d24('0xf')](0x0,0x3),_0x3affa5=null,_0x5ac680=null;_0x463dd0=parseInt(_0x463dd0);if(isNaN(_0x463dd0)){_0xcc60a4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5d24('0x10')});return;}if(_0x463dd0!=0xc8){_0xcc60a4['cb'](null,{'code':_0x463dd0,'result':-0x1,'extra':'KO'});return;}_0x3affa5=_0xcc60a4['rx'][_0x5d24('0xf')](0x4)['replace']('result=','');if(_0x3affa5[_0x5d24('0x11')]('\x20')!=-0x1){_0x3affa5=_0x3affa5[_0x5d24('0x12')](0x0,_0x3affa5[_0x5d24('0x11')]('\x20'));}if(_[_0x5d24('0x13')](_0x3affa5,'-1')){_0x3affa5=parseInt(_0x3affa5);}_0x5ac680=_0xcc60a4['rx'][_0x5d24('0x14')]('\x20');if(_0x5ac680['length']==0x3){_0x5ac680=_0x5ac680[0x2][_0x5d24('0xf')](0x1,_0x5ac680[0x2][_0x5d24('0x15')]-0x1);}else if(_0x5ac680['length']>0x3){var _0x4e478c=/\((.+)\)/;var _0x352348=_0xcc60a4['rx']['match'](_0x4e478c);if(_0x352348){_0x5ac680=_0x352348[0x1];}else{_0x5ac680=null;}}else{_0x5ac680=null;}_0xcc60a4['cb'](null,{'code':_0x463dd0,'result':_0x3affa5,'extra':_0x5ac680});}});_0x44126e['on'](_0x5d24('0x16'),function(_0x2b279a){_0x315531[_0x5d24('0x8')]('error',new AGIError(_0x5d24('0x17'),_0x2b279a[_0x5d24('0x18')]));});_0x44126e['on'](_0x5d24('0x19'),function(){_0x315531[_0x5d24('0x8')](_0x5d24('0x19'),new AGIError(_0x5d24('0x1a')));});_0x44126e['on'](_0x5d24('0x1b'),function(){_0x315531[_0x5d24('0x8')](_0x5d24('0x1b'),new AGIError(_0x5d24('0x1c')));_0x44126e[_0x5d24('0x1d')]();});_0x44126e[_0x5d24('0x1e')](_0x50d635);this[_0x5d24('0x1f')]=function(_0x2d417c,_0x476063){var _0x2d417c=_0x2d417c||'',_0x476063=typeof _0x476063==_0x5d24('0x20')?_0x476063:new Function();_0xcc60a4={'tx':_0x2d417c,'rx':'','cb':_0x476063};_0x44126e[_0x5d24('0x21')](_0x2d417c+'\x0a');},this[_0x5d24('0x19')]=function(){_0x44126e[_0x5d24('0x1d')]();};}util[_0x5d24('0x22')](AGIChannel,EventEmitter);AGIChannel[_0x5d24('0x23')][_0x5d24('0x24')]=function(_0x5e0895){return this[_0x5d24('0x1f')][_0x5d24('0x25')](this,_0x5e0895);};AGIChannel[_0x5d24('0x23')]['answer']=function(){return this[_0x5d24('0x24')](_0x5d24('0x26'));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x27')]=function(_0x2fdb1b,_0x463277,_0x91c24c){_0x2fdb1b=_0x2fdb1b===undefined?_0x5d24('0x28'):_0x2fdb1b;_0x463277=_0x463277===undefined?'5':_0x463277;_0x91c24c=_0x91c24c===undefined?'1':_0x91c24c;return this[_0x5d24('0x24')](util['format'](_0x5d24('0x29'),_0x2fdb1b,_0x463277*0x3e8,_0x91c24c));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x2a')]=function(_0x5117e9){_0x5117e9=_0x5117e9||_0x5d24('0x2b');return this[_0x5d24('0x24')](util[_0x5d24('0x2c')]('VERBOSE\x20\x22%s\x22',_0x5117e9));};AGIChannel['prototype'][_0x5d24('0x2d')]=function(_0x3fa65c,_0x273113){if(_['isArray'](_0x273113)){return this[_0x5d24('0x24')](util[_0x5d24('0x2c')](_0x5d24('0x2e'),_0x3fa65c,_0x273113[_0x5d24('0x2f')](',')));}return this[_0x5d24('0x24')](util[_0x5d24('0x2c')](_0x5d24('0x2e'),_0x3fa65c,_0x273113));};AGIChannel[_0x5d24('0x23')]['setContext']=function(_0x559f71){return this['sendRequest'](util[_0x5d24('0x2c')](_0x5d24('0x30'),_0x559f71));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x31')]=function(_0x42294a){return this[_0x5d24('0x24')](util['format'](_0x5d24('0x32'),_0x42294a));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x33')]=function(_0x33131b){return this[_0x5d24('0x24')](util[_0x5d24('0x2c')](_0x5d24('0x34'),_0x33131b));};AGIChannel[_0x5d24('0x23')][_0x5d24('0xc')]=function(){return this['sendRequest'](_0x5d24('0x35'));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x36')]=function(_0xc5e98a,_0x5c0d08){return this[_0x5d24('0x24')](util[_0x5d24('0x2c')](_0x5d24('0x37'),_0xc5e98a,_0x5c0d08?_0x5c0d08[_0x5d24('0x38')]()[_0x5d24('0x39')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x3a')]=function(_0xba9dd9,_0x4e8594){return this[_0x5d24('0x24')](util['format'](_0x5d24('0x3b'),_0xba9dd9,_0x4e8594));};AGIChannel[_0x5d24('0x23')]['sayDigits']=function(_0xc8229a,_0x3d6b30){return this[_0x5d24('0x24')](util['format'](_0x5d24('0x3c'),_0xc8229a,_0x3d6b30));};AGIChannel[_0x5d24('0x23')]['sayPhonetic']=function(_0x2da0ae,_0x2dbbc7){return this['sendRequest'](util[_0x5d24('0x2c')](_0x5d24('0x3d'),_0x2da0ae,_0x2dbbc7));};AGIChannel['prototype'][_0x5d24('0x3e')]=function(_0x2e7758,_0x3b86b0,_0x5990d4){_0x3b86b0=_0x3b86b0||this[_0x5d24('0x3f')];_0x5990d4=_0x5990d4||0x1;this[_0x5d24('0x40')](_0x2e7758);this['setExtension'](_0x3b86b0);this[_0x5d24('0x33')](_0x5990d4);return this[_0x5d24('0x2a')](util['format'](_0x5d24('0x41'),_0x2e7758,_0x3b86b0,_0x5990d4));};AGIChannel['prototype']['getVariable']=function(_0x1cc291){return this[_0x5d24('0x24')](util[_0x5d24('0x2c')]('GET\x20VARIABLE\x20\x22%s\x22',_0x1cc291));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x42')]=function(_0x303522,_0x31bfa8,_0xda57bd,_0x49a78a,_0x496207,_0x27f1fb){_0x31bfa8=_0x31bfa8||_0x5d24('0x43');_0xda57bd=_0xda57bd||'';_0x49a78a=_0x49a78a===undefined?-0x1:_0x49a78a==='-1'?-0x1:_0x49a78a*0x3e8;_0x496207=_0x496207===undefined?'':'s='+_0x496207;_0x27f1fb=_0x27f1fb?_0x5d24('0x44'):'';return this[_0x5d24('0x24')](util[_0x5d24('0x2c')](_0x5d24('0x45'),_0x303522,_0x31bfa8,_0xda57bd,_0x49a78a,_0x27f1fb,_0x496207));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x46')]=function(_0xa9fe,_0x517d96){_0x517d96=_0x517d96||'';return this[_0x5d24('0x24')](util[_0x5d24('0x2c')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0xa9fe,_0x517d96));};AGIChannel[_0x5d24('0x23')][_0x5d24('0x47')]=function(_0x2eb45b){return this[_0x5d24('0x2d')](_0x5d24('0x48'),_0x2eb45b);};AGIChannel[_0x5d24('0x23')][_0x5d24('0x49')]=function(_0x2ceee6){return this[_0x5d24('0x2d')](_0x5d24('0x4a'),_0x2ceee6);};AGIChannel['prototype'][_0x5d24('0x16')]=function(_0x23dc95,_0x1c0069){this[_0x5d24('0x2a')](util[_0x5d24('0x2c')](_0x5d24('0x4b'),_0x23dc95['id'],_0x23dc95[_0x5d24('0x4c')],_0x1c0069));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x5d24('0x4d')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ba06f69..6795d12 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 _0x3b43=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x3b43,0x71));var _0x33b4=function(_0xb9044c,_0x5507c3){_0xb9044c=_0xb9044c-0x0;var _0x18754b=_0x3b43[_0xb9044c];return _0x18754b;};'use strict';var util=require(_0x33b4('0x0'));var error={'E_AGI_UNDEFINED':_0x33b4('0x1'),'E_AGI_ARGUMENT_PORT':_0x33b4('0x2'),'E_AGI_SERVER_ERROR':_0x33b4('0x3'),'E_AGI_SERVER_CLOSE':_0x33b4('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x33b4('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x33b4('0x6'),'E_AGI_SOCKET_CLOSE':_0x33b4('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x33b4('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x33b4('0x9')};function AGIError(_0x53bb1c){var _0x53bb1c=_0x53bb1c||null,_0x7fc5ae=_0x7fc5ae||[],_0x9b3f4d=0x1,_0x2ca486='';if(!error[_0x53bb1c]){_0x53bb1c=_0x33b4('0xa');}_0x7fc5ae[_0x33b4('0xb')](error[_0x53bb1c]);while(arguments[_0x9b3f4d]){_0x7fc5ae[_0x33b4('0xb')](arguments[_0x9b3f4d]);_0x9b3f4d++;}_0x2ca486=util[_0x33b4('0xc')]['apply'](util,_0x7fc5ae);this[_0x33b4('0xd')]=_0x2ca486;this[_0x33b4('0xe')]=_0x53bb1c;}module[_0x33b4('0xf')]=AGIError; \ No newline at end of file +var _0x54f3=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','apply','message'];(function(_0x1e0f48,_0x50829e){var _0x5dd59e=function(_0x177782){while(--_0x177782){_0x1e0f48['push'](_0x1e0f48['shift']());}};_0x5dd59e(++_0x50829e);}(_0x54f3,0x120));var _0x354f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x54f3[_0xfae23b];return _0x200640;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x354f('0x0'),'E_AGI_ARGUMENT_PORT':_0x354f('0x1'),'E_AGI_SERVER_ERROR':_0x354f('0x2'),'E_AGI_SERVER_CLOSE':_0x354f('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x354f('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x354f('0x5'),'E_AGI_SOCKET_TIMEOUT':_0x354f('0x6'),'E_AGI_COMMAND_EMPTY':_0x354f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x234ac6){var _0x234ac6=_0x234ac6||null,_0x1da503=_0x1da503||[],_0x4311ad=0x1,_0x2f111a='';if(!error[_0x234ac6]){_0x234ac6=_0x354f('0x8');}_0x1da503['push'](error[_0x234ac6]);while(arguments[_0x4311ad]){_0x1da503[_0x354f('0x9')](arguments[_0x4311ad]);_0x4311ad++;}_0x2f111a=util['format'][_0x354f('0xa')](util,_0x1da503);this[_0x354f('0xb')]=_0x2f111a;this['name']=_0x234ac6;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index e23773f..df0364a 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 _0x42f4=['agicommand','vswitch','target','default','invalid','traverseBFS','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','exports','lodash','agi','menu','getdigits','getsecretdigits','vertices','addVertex','edges','prototype','addEdge','push','size','relations','numberOfEdges','getVertex','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','split'];(function(_0x2122f,_0x41c9d7){var _0x25924c=function(_0x4adc79){while(--_0x4adc79){_0x2122f['push'](_0x2122f['shift']());}};_0x25924c(++_0x41c9d7);}(_0x42f4,0x19d));var _0x442f=function(_0x1646fa,_0x4e5bd7){_0x1646fa=_0x1646fa-0x0;var _0x5a47a5=_0x42f4[_0x1646fa];return _0x5a47a5;};'use strict';var _=require(_0x442f('0x0'));var logger=require('../../../config/logger')(_0x442f('0x1'));var verticesWithRetry=[_0x442f('0x2'),_0x442f('0x3'),_0x442f('0x4')];var Graph=function(){this[_0x442f('0x5')]={};this['edges']={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x442f('0x6')]=function(_0x26fb18){this['vertices'][_0x26fb18['id']]=_0x26fb18;this[_0x442f('0x7')][_0x26fb18['id']]=[];};Graph[_0x442f('0x8')][_0x442f('0x9')]=function(_0x37dfe7,_0x6c0b4b,_0x476480){this['edges'][_0x37dfe7][_0x442f('0xa')]({'target':_0x6c0b4b,'condition':_0x476480});this['numberOfEdges']+=0x1;};Graph['prototype']['size']=function(){return _[_0x442f('0xb')](this[_0x442f('0x5')]);};Graph[_0x442f('0x8')][_0x442f('0xc')]=function(){return this[_0x442f('0xd')];};Graph[_0x442f('0x8')][_0x442f('0xe')]=function(_0x4780cb){return this[_0x442f('0x5')][_0x4780cb];};Graph[_0x442f('0x8')]['traverseBFS']=function(_0x370d73,_0x2eee5e){if(!this[_0x442f('0x5')][_0x370d73]){return logger[_0x442f('0xf')](_0x442f('0x10'));}var _0x3ce63d=_0x2eee5e(this[_0x442f('0x5')][_0x370d73]);if(!_0x3ce63d){return logger[_0x442f('0xf')](_0x442f('0x11'));}if(this[_0x442f('0x7')][_0x370d73][_0x442f('0x12')]===0x0){return logger[_0x442f('0xf')](_0x442f('0x13'));}for(var _0x2f0ff8=0x0,_0x23fe2e=[],_0x3ff2b1=![];_0x2f0ff8\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','evtHangup','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','target','then','catch','createSquareReport','indexOf','agi_','substring','inspect','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','start','debug','root','stringify','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','lodash','syncho','util','moment','agi','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d'];(function(_0x3a2bd3,_0x25fe87){var _0x51da80=function(_0x5326fb){while(--_0x5326fb){_0x3a2bd3['push'](_0x3a2bd3['shift']());}};_0x51da80(++_0x25fe87);}(_0xb205,0xf0));var _0x5b20=function(_0x136dab,_0x40b383){_0x136dab=_0x136dab-0x0;var _0xc97674=_0xb205[_0x136dab];return _0xc97674;};'use strict';var parser=require(_0x5b20('0x0'));var _=require(_0x5b20('0x1'));var syncho=require(_0x5b20('0x2'));var util=require(_0x5b20('0x3'));var moment=require(_0x5b20('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x5b20('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x5b20('0x6'));var mailRpc=require(_0x5b20('0x7'));var Graph=require('./graph');var Vertices=require(_0x5b20('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5b20('0x5')]=_[_0x5b20('0x9')](config['agi'],{'ip':_0x5b20('0xa'),'port':0x11dd});function connectionHandler(_0x13fb27){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x13fb27);agiHandler(_0x13fb27);}catch(_0x4f19b2){logger[_0x5b20('0xb')](_0x4f19b2[_0x5b20('0xc')]);}});});}function listeningHandler(){console[_0x5b20('0xd')](_0x5b20('0xe'),config[_0x5b20('0x5')][_0x5b20('0xf')]);logger[_0x5b20('0x10')](util['format'](_0x5b20('0x11'),config[_0x5b20('0x5')]['ip'],config[_0x5b20('0x5')]['port']));}function errorHandler(_0x4d5385){if(_0x4d5385&&_0x4d5385[_0x5b20('0x12')]&&_0x4d5385[_0x5b20('0x13')]){logger[_0x5b20('0xb')](util[_0x5b20('0x14')](_0x5b20('0x15'),_0x4d5385['name'],_0x4d5385[_0x5b20('0x13')]));}else{logger[_0x5b20('0xb')](util[_0x5b20('0x14')](_0x5b20('0x16'),_0x4d5385['stack']));}}function closeHandler(){logger['info'](util[_0x5b20('0x14')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x5b20('0x17')],this['callerid'],this[_0x5b20('0x18')],this[_0x5b20('0x19')]));try{createSquareReport(this);}catch(_0x3b9e74){logger['error'](_0x3b9e74[_0x5b20('0xc')]);}}function timeoutHandler(){logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x1a'),this['arg_1'],this[_0x5b20('0x17')],this['callerid'],this[_0x5b20('0x18')],this[_0x5b20('0x19')]));}function hangupHandler(){logger['info'](util[_0x5b20('0x14')](_0x5b20('0x1b'),this[_0x5b20('0x1c')],this['calleridname'],this[_0x5b20('0x1d')],this[_0x5b20('0x18')],this['uniqueid']));this[_0x5b20('0x1e')]=!![];}function getRoot(_0x52e27f){return parser['toJson'](_0x52e27f,{'object':!![]})[_0x5b20('0x1f')]['root'];}function addVertex(_0x4b4076,_0x37ab76,_0x18f555){_0x37ab76[_0x5b20('0x20')]=_0x18f555;if(_0x37ab76[_0x5b20('0x21')](_0x5b20('0x22'))){_0x37ab76[_0x5b20('0x23')]=parseInt(_0x37ab76[_0x5b20('0x22')],0xa);}_0x4b4076[_0x5b20('0x24')](_['omit'](_0x37ab76,_0x5b20('0x25')));}function initGraph(_0x102b05,_0x205c11){var _0x18281d=new Graph();for(var _0x1ea098 in _0x102b05){if(_0x102b05[_0x5b20('0x21')](_0x1ea098)){if(_['isArray'](_0x102b05[_0x1ea098])){for(var _0x16ff2d=0x0;_0x16ff2d<_0x102b05[_0x1ea098]['length'];_0x16ff2d+=0x1){addVertex(_0x18281d,_0x102b05[_0x1ea098][_0x16ff2d],_0x1ea098);}}else{addVertex(_0x18281d,_0x102b05[_0x1ea098],_0x1ea098);}}}for(var _0x444195=0x0;_0x444195<_0x205c11[_0x5b20('0x26')];_0x444195+=0x1){if(_0x205c11[_0x444195][_0x5b20('0x27')]&&_0x205c11[_0x444195]['target']){_0x18281d['addEdge'](_0x205c11[_0x444195][_0x5b20('0x27')],_0x205c11[_0x444195][_0x5b20('0x28')],_0x205c11[_0x444195]['value']);}}return _0x18281d;}function getSquareProject(_0x551224,_0x38351c){rpc['getSquareProject'](_0x551224)[_0x5b20('0x29')](function(_0x13d302){_0x38351c(null,_0x13d302);})[_0x5b20('0x2a')](function(_0x344688){_0x38351c(null,_0x344688);});}function createSquareReport(_0x5549a3,_0x349abc){rpc[_0x5b20('0x2b')](_0x5549a3)[_0x5b20('0x29')](function(_0xf480fd){if(_0x349abc){_0x349abc(null,_0xf480fd);}})['catch'](function(_0x29d17a){if(_0x349abc){_0x349abc(null,_0x29d17a);}});}function setChannelVariables(_0xc9f578){for(var _0x2780dc in _0xc9f578){if(_0xc9f578[_0x5b20('0x21')](_0x2780dc)){if(_0x2780dc[_0x5b20('0x2c')](_0x5b20('0x2d'))===0x0){_0xc9f578[_0x2780dc[_0x5b20('0x2e')](0x4)]=_0xc9f578[_0x2780dc];delete _0xc9f578[_0x2780dc];}}}}function getLogFromObject(_0x310eee){return util[_0x5b20('0x2f')](_0x310eee,{'showHidden':![],'depth':null});}function agiHandler(_0x283e00){var _0x3fd7d4,_0x1e2111,_0x199830,_0x460d43,_0x117d0a;logger['debug']('variables',JSON['stringify'](_0x283e00,null,0x2));logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x30'),_0x283e00[_0x5b20('0x1c')],_0x283e00[_0x5b20('0x17')],_0x283e00['callerid'],_0x283e00[_0x5b20('0x18')],_0x283e00[_0x5b20('0x19')]));_0x283e00['on'](_0x5b20('0xb'),errorHandler);_0x283e00['on'](_0x5b20('0x31'),closeHandler);_0x283e00['on'](_0x5b20('0x32'),timeoutHandler);_0x283e00[_0x5b20('0x1e')]=![];_0x283e00['on'](_0x5b20('0x33'),hangupHandler);var _0x4f117d=getSquareProject['sync'](null,_0x283e00['arg_1']);if(_0x4f117d){if(_0x4f117d[_0x5b20('0x34')]){_0x3fd7d4=getRoot(_0x4f117d[_0x5b20('0x34')]);if(_0x3fd7d4&&_0x3fd7d4[_0x5b20('0x35')]){logger[_0x5b20('0x36')](_0x5b20('0x37'),JSON[_0x5b20('0x38')](_0x3fd7d4,null,0x2));_0x283e00['joinAt']=moment()['format'](_0x5b20('0x39'));_0x1e2111=initGraph(_[_0x5b20('0x3a')](_0x3fd7d4,'mxCell'),_0x3fd7d4[_0x5b20('0x25')]);_0x199830=new Vertices(_0x283e00,rpc,mailRpc);logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x3b'),_0x283e00[_0x5b20('0x1c')],_0x283e00[_0x5b20('0x17')],_0x283e00[_0x5b20('0x1d')],_0x283e00[_0x5b20('0x18')],_0x283e00[_0x5b20('0x19')]));_0x1e2111[_0x5b20('0x3c')](_0x3fd7d4[_0x5b20('0x35')]['id'],function(_0x2efcc7){try{_0x2efcc7=_0x199830['clear'](_0x2efcc7);logger[_0x5b20('0x36')](_0x5b20('0x3d'),JSON[_0x5b20('0x38')](_0x2efcc7,null,0x2));if(_0x2efcc7[_0x5b20('0x20')]===_0x5b20('0x3e')){logger[_0x5b20('0x10')](_0x5b20('0x3f'));_0x283e00[_0x5b20('0x40')]=_0x2efcc7[_0x5b20('0x40')]||_0x283e00[_0x5b20('0x40')];_0x283e00[_0x5b20('0x41')]=_0x2efcc7[_0x5b20('0x41')];_0x283e00[_0x5b20('0x42')]=_0x2efcc7[_0x5b20('0x42')]?_0x2efcc7[_0x5b20('0x42')]-0x1:0x1;return null;}else if(_0x2efcc7&&_0x199830[_0x2efcc7[_0x5b20('0x20')]]){_0x117d0a=_0x199830[_0x2efcc7[_0x5b20('0x20')]](_0x2efcc7);logger[_0x5b20('0x10')](_0x5b20('0x43'),JSON[_0x5b20('0x38')](_0x117d0a,null,0x2));if(_0x117d0a&&_0x117d0a[_0x5b20('0x44')]===AGI_CODE_SUCCESS&&_0x117d0a[_0x5b20('0x45')]!==AGI_RESULT_ERROR&&!_0x283e00[_0x5b20('0x1e')]){logger[_0x5b20('0x36')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return _[_0x5b20('0x46')](_0x117d0a[_0x5b20('0x45')])?null:_0x117d0a['result'][_0x5b20('0x47')]();}else{logger[_0x5b20('0xb')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return null;}}else{logger[_0x5b20('0xb')](_0x5b20('0x48'));return null;}}catch(_0x1ba215){logger[_0x5b20('0xb')](_0x1ba215['stack']);return null;}});if(_0x3fd7d4[_0x5b20('0x49')]){logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x4a'),_0x283e00[_0x5b20('0x1c')],_0x283e00[_0x5b20('0x17')],_0x283e00[_0x5b20('0x1d')],_0x283e00['dnid'],_0x283e00[_0x5b20('0x19')]));_0x1e2111[_0x5b20('0x3c')](_0x3fd7d4['finally']['id'],function(_0x210fff){try{_0x210fff=_0x199830[_0x5b20('0x4b')](_0x210fff);logger['debug'](_0x5b20('0x3d'),JSON[_0x5b20('0x38')](_0x210fff,null,0x2));if(_0x210fff&&_0x199830[_0x210fff[_0x5b20('0x20')]]){_0x117d0a=_0x199830[_0x210fff[_0x5b20('0x20')]](_0x210fff);if(_0x117d0a){logger[_0x5b20('0x36')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return _[_0x5b20('0x46')](_0x117d0a[_0x5b20('0x45')])?null:_0x117d0a['result'][_0x5b20('0x47')]();}else{logger[_0x5b20('0xb')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return null;}}else{logger[_0x5b20('0xb')](_0x5b20('0x48'));return null;}}catch(_0x380d76){logger['error'](_0x380d76[_0x5b20('0xc')]);return null;}});}logger[_0x5b20('0x10')](util['format'](_0x5b20('0x4c'),_0x283e00['arg_1'],_0x283e00[_0x5b20('0x17')],_0x283e00[_0x5b20('0x1d')],_0x283e00[_0x5b20('0x18')],_0x283e00[_0x5b20('0x19')]));logger['info'](util[_0x5b20('0x14')](_0x5b20('0x4d'),_0x283e00[_0x5b20('0x40')],_0x283e00[_0x5b20('0x41')],parseInt(_0x283e00[_0x5b20('0x42')],0xa)+0x1));_0x283e00[_0x5b20('0x4e')](_0x283e00[_0x5b20('0x40')],_0x283e00['extension'],parseInt(_0x283e00['priority'],0xa)+0x1);_0x283e00[_0x5b20('0x31')]();}}else{logger[_0x5b20('0xb')](util[_0x5b20('0x14')]('Project\x20%s\x20not\x20published',_0x283e00[_0x5b20('0x1c')]));_0x283e00[_0x5b20('0x4e')](_0x283e00[_0x5b20('0x40')],_0x283e00['extension'],parseInt(_0x283e00[_0x5b20('0x42')],0xa)+0x1);_0x283e00[_0x5b20('0x31')]();}}else{logger[_0x5b20('0xb')](util['format'](_0x5b20('0x4f'),_0x283e00['arg_1']));_0x283e00[_0x5b20('0x4e')](_0x283e00[_0x5b20('0x40')],_0x283e00[_0x5b20('0x41')],parseInt(_0x283e00[_0x5b20('0x42')],0xa)+0x1);_0x283e00['close']();}}function main(){var _0x106b47;return utilLicense['getLicense']()[_0x5b20('0x29')](function(_0x4e66fd){if(_0x4e66fd){if(_0x4e66fd['voice']){if(_0x4e66fd[_0x5b20('0x50')]&&_0x4e66fd[_0x5b20('0x50')]>0x0){logger[_0x5b20('0x10')](util[_0x5b20('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4e66fd['callysquare']));_0x106b47=_0x4e66fd[_0x5b20('0x50')];}else{logger[_0x5b20('0x10')](_0x5b20('0x51'));}}else{logger[_0x5b20('0x10')](_0x5b20('0x52'));_0x106b47=-0x1;}}})['catch'](function(_0x1dca2a){logger[_0x5b20('0xb')](_0x5b20('0x53'),_0x1dca2a[_0x5b20('0xc')]);})[_0x5b20('0x49')](function(){var _0x2c5e87=require(_0x5b20('0x54'))(config['agi'][_0x5b20('0xf')],config[_0x5b20('0x5')]['ip'],_0x106b47);_0x2c5e87['on'](_0x5b20('0xb'),errorHandler);_0x2c5e87['on']('listening',listeningHandler);_0x2c5e87['on'](_0x5b20('0x55'),connectionHandler);_0x2c5e87['on'](_0x5b20('0x31'),closeHandler);});}main(); \ No newline at end of file +var _0xd67b=['timeout','evtHangup','hangup','sync','production','start','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','traverseBFS','finally','agicommand\x20not\x20found','[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\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','lodash','util','moment','../../config/environment','agi','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','target','value','getSquareProject','then','catch','createSquareReport','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd67b,0x133));var _0xbd67=function(_0x21d5b8,_0x4fce39){_0x21d5b8=_0x21d5b8-0x0;var _0x2a3d90=_0xd67b[_0x21d5b8];return _0x2a3d90;};'use strict';var parser=require('xml2json');var _=require(_0xbd67('0x0'));var syncho=require('syncho');var util=require(_0xbd67('0x1'));var moment=require(_0xbd67('0x2'));var config=require(_0xbd67('0x3'));var logger=require('../../config/logger')(_0xbd67('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0xbd67('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xbd67('0x6'));var Vertices=require(_0xbd67('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xbd67('0x4')]=_[_0xbd67('0x8')](config[_0xbd67('0x4')],{'ip':_0xbd67('0x9'),'port':0x11dd});function connectionHandler(_0x2d4af6){process[_0xbd67('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2d4af6);agiHandler(_0x2d4af6);}catch(_0x1da7f1){logger[_0xbd67('0xb')](_0x1da7f1[_0xbd67('0xc')]);}});});}function listeningHandler(){console[_0xbd67('0xd')](_0xbd67('0xe'),config['agi']['port']);logger[_0xbd67('0xf')](util['format'](_0xbd67('0x10'),config[_0xbd67('0x4')]['ip'],config[_0xbd67('0x4')][_0xbd67('0x11')]));}function errorHandler(_0x137b8c){if(_0x137b8c&&_0x137b8c[_0xbd67('0x12')]&&_0x137b8c[_0xbd67('0x13')]){logger[_0xbd67('0xb')](util[_0xbd67('0x14')](_0xbd67('0x15'),_0x137b8c['name'],_0x137b8c[_0xbd67('0x13')]));}else{logger[_0xbd67('0xb')](util[_0xbd67('0x14')](_0xbd67('0x16'),_0x137b8c[_0xbd67('0xc')]));}}function closeHandler(){logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x17'),this[_0xbd67('0x18')],this[_0xbd67('0x19')],this['callerid'],this['dnid'],this[_0xbd67('0x1a')]));try{createSquareReport(this);}catch(_0x475e36){logger[_0xbd67('0xb')](_0x475e36['stack']);}}function timeoutHandler(){logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x1b'),this['arg_1'],this[_0xbd67('0x19')],this['callerid'],this[_0xbd67('0x1c')],this[_0xbd67('0x1a')]));}function hangupHandler(){logger[_0xbd67('0xf')](util['format'](_0xbd67('0x1d'),this[_0xbd67('0x18')],this[_0xbd67('0x19')],this[_0xbd67('0x1e')],this[_0xbd67('0x1c')],this[_0xbd67('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x3ee2f1){return parser[_0xbd67('0x1f')](_0x3ee2f1,{'object':!![]})[_0xbd67('0x20')][_0xbd67('0x21')];}function addVertex(_0x8a7174,_0x33fd8c,_0x46c519){_0x33fd8c[_0xbd67('0x22')]=_0x46c519;if(_0x33fd8c[_0xbd67('0x23')](_0xbd67('0x24'))){_0x33fd8c[_0xbd67('0x25')]=parseInt(_0x33fd8c['retry'],0xa);}_0x8a7174[_0xbd67('0x26')](_['omit'](_0x33fd8c,_0xbd67('0x27')));}function initGraph(_0x13b8b8,_0x144b89){var _0x4bbee7=new Graph();for(var _0x14f5c3 in _0x13b8b8){if(_0x13b8b8[_0xbd67('0x23')](_0x14f5c3)){if(_['isArray'](_0x13b8b8[_0x14f5c3])){for(var _0x3a062e=0x0;_0x3a062e<_0x13b8b8[_0x14f5c3][_0xbd67('0x28')];_0x3a062e+=0x1){addVertex(_0x4bbee7,_0x13b8b8[_0x14f5c3][_0x3a062e],_0x14f5c3);}}else{addVertex(_0x4bbee7,_0x13b8b8[_0x14f5c3],_0x14f5c3);}}}for(var _0x374f1b=0x0;_0x374f1b<_0x144b89[_0xbd67('0x28')];_0x374f1b+=0x1){if(_0x144b89[_0x374f1b][_0xbd67('0x29')]&&_0x144b89[_0x374f1b]['target']){_0x4bbee7['addEdge'](_0x144b89[_0x374f1b][_0xbd67('0x29')],_0x144b89[_0x374f1b][_0xbd67('0x2a')],_0x144b89[_0x374f1b][_0xbd67('0x2b')]);}}return _0x4bbee7;}function getSquareProject(_0x44eced,_0xc89b90){rpc[_0xbd67('0x2c')](_0x44eced)[_0xbd67('0x2d')](function(_0x2e123e){_0xc89b90(null,_0x2e123e);})[_0xbd67('0x2e')](function(_0x34e5a8){_0xc89b90(null,_0x34e5a8);});}function createSquareReport(_0x5cb0ce,_0x5793ca){rpc[_0xbd67('0x2f')](_0x5cb0ce)[_0xbd67('0x2d')](function(_0x3b58b1){if(_0x5793ca){_0x5793ca(null,_0x3b58b1);}})['catch'](function(_0x1f8865){if(_0x5793ca){_0x5793ca(null,_0x1f8865);}});}function setChannelVariables(_0x15da85){for(var _0xb3f593 in _0x15da85){if(_0x15da85[_0xbd67('0x23')](_0xb3f593)){if(_0xb3f593['indexOf']('agi_')===0x0){_0x15da85[_0xb3f593['substring'](0x4)]=_0x15da85[_0xb3f593];delete _0x15da85[_0xb3f593];}}}}function getLogFromObject(_0xa8be43){return util[_0xbd67('0x30')](_0xa8be43,{'showHidden':![],'depth':null});}function agiHandler(_0x201ae0){var _0x562eeb,_0x50d605,_0x303849,_0x20d887,_0x1bc5ce;logger[_0xbd67('0x31')](_0xbd67('0x32'),JSON[_0xbd67('0x33')](_0x201ae0,null,0x2));logger['info'](util[_0xbd67('0x14')](_0xbd67('0x34'),_0x201ae0[_0xbd67('0x18')],_0x201ae0['calleridname'],_0x201ae0[_0xbd67('0x1e')],_0x201ae0['dnid'],_0x201ae0[_0xbd67('0x1a')]));_0x201ae0['on'](_0xbd67('0xb'),errorHandler);_0x201ae0['on']('close',closeHandler);_0x201ae0['on'](_0xbd67('0x35'),timeoutHandler);_0x201ae0[_0xbd67('0x36')]=![];_0x201ae0['on'](_0xbd67('0x37'),hangupHandler);var _0x31f689=getSquareProject[_0xbd67('0x38')](null,_0x201ae0[_0xbd67('0x18')]);if(_0x31f689){if(_0x31f689['production']){_0x562eeb=getRoot(_0x31f689[_0xbd67('0x39')]);if(_0x562eeb&&_0x562eeb[_0xbd67('0x3a')]){logger[_0xbd67('0x31')](_0xbd67('0x21'),JSON[_0xbd67('0x33')](_0x562eeb,null,0x2));_0x201ae0['joinAt']=moment()['format'](_0xbd67('0x3b'));_0x50d605=initGraph(_[_0xbd67('0x3c')](_0x562eeb,_0xbd67('0x27')),_0x562eeb['mxCell']);_0x303849=new Vertices(_0x201ae0,rpc,mailRpc);logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x3d'),_0x201ae0[_0xbd67('0x18')],_0x201ae0['calleridname'],_0x201ae0['callerid'],_0x201ae0['dnid'],_0x201ae0['uniqueid']));_0x50d605['traverseBFS'](_0x562eeb[_0xbd67('0x3a')]['id'],function(_0x5a6b2d){try{_0x5a6b2d=_0x303849['clear'](_0x5a6b2d);logger['debug'](_0xbd67('0x3e'),JSON[_0xbd67('0x33')](_0x5a6b2d,null,0x2));if(_0x5a6b2d[_0xbd67('0x22')]===_0xbd67('0x3f')){logger['info'](_0xbd67('0x40'));_0x201ae0[_0xbd67('0x41')]=_0x5a6b2d[_0xbd67('0x41')]||_0x201ae0[_0xbd67('0x41')];_0x201ae0[_0xbd67('0x42')]=_0x5a6b2d[_0xbd67('0x42')];_0x201ae0[_0xbd67('0x43')]=_0x5a6b2d['priority']?_0x5a6b2d[_0xbd67('0x43')]-0x1:0x1;return null;}else if(_0x5a6b2d&&_0x303849[_0x5a6b2d['agicommand']]){_0x1bc5ce=_0x303849[_0x5a6b2d[_0xbd67('0x22')]](_0x5a6b2d);logger[_0xbd67('0xf')](_0xbd67('0x44'),JSON[_0xbd67('0x33')](_0x1bc5ce,null,0x2));if(_0x1bc5ce&&_0x1bc5ce[_0xbd67('0x45')]===AGI_CODE_SUCCESS&&_0x1bc5ce[_0xbd67('0x46')]!==AGI_RESULT_ERROR&&!_0x201ae0[_0xbd67('0x36')]){logger[_0xbd67('0x31')]('response',getLogFromObject(_0x1bc5ce));return _[_0xbd67('0x47')](_0x1bc5ce[_0xbd67('0x46')])?null:_0x1bc5ce['result'][_0xbd67('0x48')]();}else{logger[_0xbd67('0xb')](_0xbd67('0x44'),getLogFromObject(_0x1bc5ce));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x46a7eb){logger[_0xbd67('0xb')](_0x46a7eb[_0xbd67('0xc')]);return null;}});if(_0x562eeb['finally']){logger[_0xbd67('0xf')](util[_0xbd67('0x14')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x201ae0['arg_1'],_0x201ae0['calleridname'],_0x201ae0['callerid'],_0x201ae0[_0xbd67('0x1c')],_0x201ae0[_0xbd67('0x1a')]));_0x50d605[_0xbd67('0x49')](_0x562eeb[_0xbd67('0x4a')]['id'],function(_0x196f9c){try{_0x196f9c=_0x303849['clear'](_0x196f9c);logger[_0xbd67('0x31')](_0xbd67('0x3e'),JSON['stringify'](_0x196f9c,null,0x2));if(_0x196f9c&&_0x303849[_0x196f9c[_0xbd67('0x22')]]){_0x1bc5ce=_0x303849[_0x196f9c[_0xbd67('0x22')]](_0x196f9c);if(_0x1bc5ce){logger[_0xbd67('0x31')](_0xbd67('0x44'),getLogFromObject(_0x1bc5ce));return _[_0xbd67('0x47')](_0x1bc5ce['result'])?null:_0x1bc5ce[_0xbd67('0x46')]['toString']();}else{logger[_0xbd67('0xb')](_0xbd67('0x44'),getLogFromObject(_0x1bc5ce));return null;}}else{logger['error'](_0xbd67('0x4b'));return null;}}catch(_0x8f5702){logger[_0xbd67('0xb')](_0x8f5702['stack']);return null;}});}logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x4c'),_0x201ae0[_0xbd67('0x18')],_0x201ae0[_0xbd67('0x19')],_0x201ae0[_0xbd67('0x1e')],_0x201ae0[_0xbd67('0x1c')],_0x201ae0['uniqueid']));logger['info'](util[_0xbd67('0x14')](_0xbd67('0x4d'),_0x201ae0[_0xbd67('0x41')],_0x201ae0[_0xbd67('0x42')],parseInt(_0x201ae0[_0xbd67('0x43')],0xa)+0x1));_0x201ae0['continueAt'](_0x201ae0['context'],_0x201ae0[_0xbd67('0x42')],parseInt(_0x201ae0[_0xbd67('0x43')],0xa)+0x1);_0x201ae0[_0xbd67('0x4e')]();}}else{logger[_0xbd67('0xb')](util[_0xbd67('0x14')](_0xbd67('0x4f'),_0x201ae0[_0xbd67('0x18')]));_0x201ae0[_0xbd67('0x50')](_0x201ae0[_0xbd67('0x41')],_0x201ae0[_0xbd67('0x42')],parseInt(_0x201ae0['priority'],0xa)+0x1);_0x201ae0['close']();}}else{logger[_0xbd67('0xb')](util['format'](_0xbd67('0x51'),_0x201ae0[_0xbd67('0x18')]));_0x201ae0[_0xbd67('0x50')](_0x201ae0[_0xbd67('0x41')],_0x201ae0['extension'],parseInt(_0x201ae0[_0xbd67('0x43')],0xa)+0x1);_0x201ae0[_0xbd67('0x4e')]();}}function main(){var _0xff87f;return utilLicense['getLicense']()[_0xbd67('0x2d')](function(_0x563bd3){if(_0x563bd3){if(_0x563bd3[_0xbd67('0x52')]){if(_0x563bd3[_0xbd67('0x53')]&&_0x563bd3['callysquare']>0x0){logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x54'),_0x563bd3[_0xbd67('0x53')]));_0xff87f=_0x563bd3[_0xbd67('0x53')];}else{logger[_0xbd67('0xf')](_0xbd67('0x55'));}}else{logger[_0xbd67('0xf')](_0xbd67('0x56'));_0xff87f=-0x1;}}})[_0xbd67('0x2e')](function(_0x93a3cb){logger[_0xbd67('0xb')](_0xbd67('0x57'),_0x93a3cb[_0xbd67('0xc')]);})[_0xbd67('0x4a')](function(){var _0x27cef0=require(_0xbd67('0x58'))(config['agi']['port'],config[_0xbd67('0x4')]['ip'],_0xff87f);_0x27cef0['on'](_0xbd67('0xb'),errorHandler);_0x27cef0['on']('listening',listeningHandler);_0x27cef0['on'](_0xbd67('0x59'),connectionHandler);_0x27cef0['on'](_0xbd67('0x4e'),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 e594a86..a624183 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 _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x3eb910,_0x2e03e9){var _0x5ad604=function(_0x3c515c){while(--_0x3c515c){_0x3eb910['push'](_0x3eb910['shift']());}};_0x5ad604(++_0x2e03e9);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x328257,_0x15a652){var _0xedaf42=function(_0x21f81b){while(--_0x21f81b){_0x328257['push'](_0x328257['shift']());}};_0xedaf42(++_0x15a652);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 7c6d697..a718f60 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 _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a8207,_0x576621){_0x1a8207=_0x1a8207-0x0;var _0x4bc774=_0xb10b[_0x1a8207];return _0x4bc774;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0x5f2f=['exports','util','stream','Transform','call','_localBuffer','_inBody','inherits','\x0d\x0a\x0d\x0a','toString','substring','length','split','slice','trim','headers','indexOf','emit','line'];(function(_0xb2ebe5,_0x2f345f){var _0x35db18=function(_0x19c8b7){while(--_0x19c8b7){_0xb2ebe5['push'](_0xb2ebe5['shift']());}};_0x35db18(++_0x2f345f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30cb55,_0x2331bd){_0x30cb55=_0x30cb55-0x0;var _0x128636=_0x5f2f[_0x30cb55];return _0x128636;};'use strict';var util=require(_0xf5f2('0x0'));var Transform=require(_0xf5f2('0x1'))[_0xf5f2('0x2')];function AGIReply(_0x1a7be1){Transform[_0xf5f2('0x3')](this,_0x1a7be1);this[_0xf5f2('0x4')]='';this[_0xf5f2('0x5')]=![];}util[_0xf5f2('0x6')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x1665c7,_0x192215,_0xad7f65){var _0x3eebf6='\x0a',_0x3133bc=['\x0a\x0a',_0xf5f2('0x7')],_0x473100=-0x1,_0x5907aa=-0x1,_0x466882='',_0x46cd9c=0x0,_0x2ec345='',_0x56a69f='';this[_0xf5f2('0x4')]+=_0x1665c7[_0xf5f2('0x8')]();_0x2ec345=this['_localBuffer'];if(!this[_0xf5f2('0x5')]){_0x46cd9c=0x0;while(_0x3133bc[_0x46cd9c]){while((_0x5907aa=_0x2ec345['indexOf'](_0x3133bc[_0x46cd9c]))!=-0x1){_0x466882=_0x3133bc[_0x46cd9c];_0x56a69f=_0x2ec345['substring'](0x0,_0x5907aa);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x5907aa+_0x466882[_0xf5f2('0xa')]);var _0x4b78cd=_0x56a69f[_0xf5f2('0xb')](_0x3eebf6),_0x336f6b=0x0,_0x14b51f={},_0x331482='',_0x3f2997='',_0x59bb6c=-0x1;while(_0x4b78cd[_0x336f6b]){_0x59bb6c=_0x4b78cd[_0x336f6b]['indexOf'](':');if(_0x59bb6c!=-0x1){_0x331482=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](0x0,_0x59bb6c)[_0xf5f2('0xd')]();_0x3f2997=_0x4b78cd[_0x336f6b][_0xf5f2('0xc')](_0x59bb6c+0x1)[_0xf5f2('0xd')]();if(_0x331482[_0xf5f2('0xa')]>0x0){_0x14b51f[_0x331482]=_0x3f2997;}}else{}_0x336f6b++;}this['emit'](_0xf5f2('0xe'),_0x14b51f);this[_0xf5f2('0x5')]=!![];}_0x46cd9c++;}this[_0xf5f2('0x4')]=_0x2ec345;}else{while((_0x473100=_0x2ec345[_0xf5f2('0xf')](_0x3eebf6))!=-0x1){_0x56a69f=_0x2ec345[_0xf5f2('0x9')](0x0,_0x473100);this[_0xf5f2('0x10')](_0xf5f2('0x11'),_0x56a69f);_0x2ec345=_0x2ec345[_0xf5f2('0x9')](_0x473100+_0x3eebf6[_0xf5f2('0xa')]);}this[_0xf5f2('0x4')]=_0x2ec345;}_0xad7f65();};module[_0xf5f2('0x12')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 4ef3660..4fae4dc 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 _0xaac7=['ShowPause','agentLogin','agentPause','PauseUser','LogoutUser','bluebird','moment','lodash','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById'];(function(_0x2f0a8e,_0x442c57){var _0x1267df=function(_0x1f2dd9){while(--_0x1f2dd9){_0x2f0a8e['push'](_0x2f0a8e['shift']());}};_0x1267df(++_0x442c57);}(_0xaac7,0x122));var _0x7aac=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xaac7[_0x2341c6];return _0x54c34d;};'use strict';var BPromise=require(_0x7aac('0x0'));var moment=require(_0x7aac('0x1'));var _=require(_0x7aac('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x7aac('0x3')][_0x7aac('0x4')]({'port':0x2329});function request(_0x2e10a1,_0x2fd20c){return new BPromise(function(_0x436dd3,_0x14db0f){return client[_0x7aac('0x5')](_0x2e10a1,_0x2fd20c)[_0x7aac('0x6')](function(_0x2ad8c3){if(_0x2ad8c3[_0x7aac('0x7')]){return _0x14db0f(_0x2ad8c3[_0x7aac('0x7')][_0x7aac('0x8')]);}else{return _0x436dd3(_0x2ad8c3[_0x7aac('0x9')]);}})['catch'](function(_0x14b28c){return _0x14db0f(_0x14b28c);});});}exports[_0x7aac('0xa')]=function(_0x1c4938){return request(_0x7aac('0xb'),{'options':{'raw':![],'where':{'name':_0x1c4938},'attributes':[_0x7aac('0xc')]}});};exports[_0x7aac('0xd')]=function(_0x29b376){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x29b376},'include':[{'model':_0x7aac('0xe'),'as':_0x7aac('0xf')}],'attributes':['id',_0x7aac('0x10'),_0x7aac('0x11')]}});};exports[_0x7aac('0x12')]=function(_0x564917){return request(_0x7aac('0xb'),{'options':{'where':{'id':_0x564917},'attributes':[_0x7aac('0x10')]}});};exports[_0x7aac('0x13')]=function(_0x3e15c7){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3e15c7},'attributes':[_0x7aac('0x10')]}});};exports[_0x7aac('0x14')]=function(_0x3245bf){return request(_0x7aac('0x15'),{'options':{'where':{'id':_0x3245bf},'attributes':[_0x7aac('0x10')]}});};exports['getSquareOdbcById']=function(_0x16d06f){return request(_0x7aac('0x16'),{'options':{'where':{'id':_0x16d06f},'attributes':[_0x7aac('0x17')]}});};exports[_0x7aac('0x18')]=function(_0x2276b4){return request(_0x7aac('0x19'),{'options':{'where':{'id':_0x2276b4},'attributes':[_0x7aac('0x10')]}});};exports[_0x7aac('0x1a')]=function(_0x19e933){return request(_0x7aac('0x1b'),{'options':{'where':{'id':_0x19e933},'attributes':['name']}});};exports[_0x7aac('0x1c')]=function(_0x524c86){return request(_0x7aac('0x1d'),{'options':{'where':{'id':_0x524c86},'attributes':[_0x7aac('0x1e')]}});};exports[_0x7aac('0x1f')]=function(_0x1a5cf5){return request(_0x7aac('0x20'),{'options':{'raw':![],'where':{'id':_0x1a5cf5},'include':[{'model':'Interval','as':_0x7aac('0x21')}]}});};exports[_0x7aac('0x22')]=function(_0xcbc650){return request(_0x7aac('0x23'),{'options':{'where':{'id':_0xcbc650},'attributes':['id',_0x7aac('0x10')]}});};exports[_0x7aac('0x24')]=function(_0x48bd6e){return request(_0x7aac('0x25'),{'body':_0x48bd6e});};exports[_0x7aac('0x26')]=function(_0x14bb25){return request(_0x7aac('0x27'),{'body':_0x14bb25});};exports[_0x7aac('0x28')]=function(_0x2b1d61){return request(_0x7aac('0x29'),{'body':_['merge'](_0x2b1d61,{'project_name':_0x2b1d61[_0x7aac('0x2a')],'prev_project_name':_0x2b1d61['arg_2']||'','is_subproject':_0x2b1d61['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x7aac('0x2b'))})});};exports[_0x7aac('0x2c')]=function(_0x5712cb){return request('CreateSquareRecording',{'body':_0x5712cb});};exports[_0x7aac('0x2d')]=function(_0xfb9d35){return request(_0x7aac('0x2e'),{'body':_0xfb9d35});};exports[_0x7aac('0x2f')]=function(_0x5eeb8f){return request(_0x7aac('0x30'),{'options':{'raw':![],'where':{'phone':_0x5eeb8f['phone'],'ListId':_0x5eeb8f[_0x7aac('0x31')]}}})[_0x7aac('0x6')](function(_0x56cbca){if(_0x56cbca){return _0x56cbca;}return request(_0x7aac('0x32'),{'body':_0x5eeb8f});});};exports[_0x7aac('0x33')]=function(_0x532584){return request(_0x7aac('0x34'),{'options':{'where':{'id':_0x532584},'attributes':['name']}});};exports[_0x7aac('0x35')]=function(_0x50ef2a,_0x265807){return request('LoginUser',{'body':{'interface':_0x265807},'options':{'where':_0x50ef2a}});};exports[_0x7aac('0x36')]=function(_0xe81689,_0x1eb8bf,_0x52c961){return request(_0x7aac('0x37'),{'body':{'type':_0x1eb8bf,'uniqueid':_0x52c961},'options':{'where':_0xe81689}});};exports['agentUnpause']=function(_0x30eb56){return request('UnpauseUser',{'body':{},'options':{'where':_0x30eb56}});};exports['agentLogout']=function(_0x469e78){return request(_0x7aac('0x38'),{'body':{},'options':{'where':_0x469e78}});}; \ No newline at end of file +var _0xc8ee=['save_name','getIntervalById','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','phone','ListId','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','util','jayson/promise','client','then','error','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','email','getSquareProjectById','ShowSquareProject','name','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getTrunkById','getSoundById'];(function(_0x5444b8,_0x1a3613){var _0x3593a2=function(_0x505882){while(--_0x505882){_0x5444b8['push'](_0x5444b8['shift']());}};_0x3593a2(++_0x1a3613);}(_0xc8ee,0xcb));var _0xec8e=function(_0x9a349b,_0x418d2c){_0x9a349b=_0x9a349b-0x0;var _0x558bb8=_0xc8ee[_0x9a349b];return _0x558bb8;};'use strict';var BPromise=require(_0xec8e('0x0'));var moment=require(_0xec8e('0x1'));var _=require(_0xec8e('0x2'));var util=require(_0xec8e('0x3'));var jayson=require(_0xec8e('0x4'));var client=jayson[_0xec8e('0x5')]['http']({'port':0x2329});function request(_0x2d85af,_0x25a714){return new BPromise(function(_0x35fa4e,_0x3dabcd){return client['request'](_0x2d85af,_0x25a714)[_0xec8e('0x6')](function(_0x265429){if(_0x265429[_0xec8e('0x7')]){return _0x3dabcd(_0x265429[_0xec8e('0x7')][_0xec8e('0x8')]);}else{return _0x35fa4e(_0x265429[_0xec8e('0x9')]);}})[_0xec8e('0xa')](function(_0x127d23){return _0x3dabcd(_0x127d23);});});}exports[_0xec8e('0xb')]=function(_0x175c8a){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x175c8a},'attributes':[_0xec8e('0xc')]}});};exports[_0xec8e('0xd')]=function(_0x37ddf){return request(_0xec8e('0xe'),{'options':{'raw':![],'where':{'id':_0x37ddf},'include':[{'model':_0xec8e('0xf'),'as':_0xec8e('0x10')}],'attributes':['id','name',_0xec8e('0x11')]}});};exports[_0xec8e('0x12')]=function(_0x2f7877){return request(_0xec8e('0x13'),{'options':{'where':{'id':_0x2f7877},'attributes':['name']}});};exports['getVoiceQueueById']=function(_0x440c75){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x440c75},'attributes':[_0xec8e('0x14')]}});};exports[_0xec8e('0x15')]=function(_0xc5ac50){return request(_0xec8e('0x16'),{'options':{'where':{'id':_0xc5ac50},'attributes':[_0xec8e('0x14')]}});};exports[_0xec8e('0x17')]=function(_0x544485){return request(_0xec8e('0x18'),{'options':{'where':{'id':_0x544485},'attributes':[_0xec8e('0x19')]}});};exports[_0xec8e('0x1a')]=function(_0x257c28){return request('ShowUser',{'options':{'where':{'id':_0x257c28},'attributes':[_0xec8e('0x14')]}});};exports[_0xec8e('0x1b')]=function(_0x5a2806){return request('ShowTrunk',{'options':{'where':{'id':_0x5a2806},'attributes':[_0xec8e('0x14')]}});};exports[_0xec8e('0x1c')]=function(_0x471d6f){return request('ShowSound',{'options':{'where':{'id':_0x471d6f},'attributes':[_0xec8e('0x1d')]}});};exports[_0xec8e('0x1e')]=function(_0x4a9463){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4a9463},'include':[{'model':'Interval','as':_0xec8e('0x1f')}]}});};exports[_0xec8e('0x20')]=function(_0xbac02){return request(_0xec8e('0x21'),{'options':{'where':{'id':_0xbac02},'attributes':['id',_0xec8e('0x14')]}});};exports['createSmsMessage']=function(_0x1ae4a3){return request(_0xec8e('0x22'),{'body':_0x1ae4a3});};exports[_0xec8e('0x23')]=function(_0x1a29a6){return request(_0xec8e('0x24'),{'body':_0x1a29a6});};exports[_0xec8e('0x25')]=function(_0x3405dd){return request(_0xec8e('0x26'),{'body':_['merge'](_0x3405dd,{'project_name':_0x3405dd[_0xec8e('0x27')],'prev_project_name':_0x3405dd[_0xec8e('0x28')]||'','is_subproject':_0x3405dd[_0xec8e('0x28')]?!![]:![],'leaveAt':moment()['format'](_0xec8e('0x29'))})});};exports[_0xec8e('0x2a')]=function(_0x2b2a36){return request('CreateSquareRecording',{'body':_0x2b2a36});};exports[_0xec8e('0x2b')]=function(_0x399641){return request(_0xec8e('0x2c'),{'body':_0x399641});};exports[_0xec8e('0x2d')]=function(_0x33ca50){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x33ca50[_0xec8e('0x2e')],'ListId':_0x33ca50[_0xec8e('0x2f')]}}})[_0xec8e('0x6')](function(_0x1d7c7b){if(_0x1d7c7b){return _0x1d7c7b;}return request('CreateCmContact',{'body':_0x33ca50});});};exports[_0xec8e('0x30')]=function(_0x2a7ee0){return request(_0xec8e('0x31'),{'options':{'where':{'id':_0x2a7ee0},'attributes':[_0xec8e('0x14')]}});};exports[_0xec8e('0x32')]=function(_0x28909f,_0x4e0f43){return request(_0xec8e('0x33'),{'body':{'interface':_0x4e0f43},'options':{'where':_0x28909f}});};exports[_0xec8e('0x34')]=function(_0x3ada69,_0x42450e,_0x319ac0){return request(_0xec8e('0x35'),{'body':{'type':_0x42450e,'uniqueid':_0x319ac0},'options':{'where':_0x3ada69}});};exports[_0xec8e('0x36')]=function(_0x3bd2df){return request(_0xec8e('0x37'),{'body':{},'options':{'where':_0x3bd2df}});};exports[_0xec8e('0x38')]=function(_0x18edbb){return request(_0xec8e('0x39'),{'body':{},'options':{'where':_0x18edbb}});}; \ 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 3d5a63d..ea4e741 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 _0xb7c8=['exports','./lex'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5b7ec2,_0x4b6adc){_0x5b7ec2=_0x5b7ec2-0x0;var _0x191f88=_0xb7c8[_0x5b7ec2];return _0x191f88;};var polly=require('./polly');var lex=require(_0x8b7c('0x0'));module[_0x8b7c('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc368=['./lex'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xc368,0x7b));var _0x8c36=function(_0x1f4a62,_0x5ccbb7){_0x1f4a62=_0x1f4a62-0x0;var _0x441ace=_0xc368[_0x1f4a62];return _0x441ace;};var polly=require('./polly');var lex=require(_0x8c36('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index f849cc7..7829df7 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c76=['./lib/api','exports'];(function(_0x5e444b,_0xdad0db){var _0x3e2e8b=function(_0xe94433){while(--_0xe94433){_0x5e444b['push'](_0x5e444b['shift']());}};_0x3e2e8b(++_0xdad0db);}(_0x6c76,0x184));var _0x66c7=function(_0x1568e5,_0x1ba897){_0x1568e5=_0x1568e5-0x0;var _0x492904=_0x6c76[_0x1568e5];return _0x492904;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ No newline at end of file +var _0xd52a=['exports'];(function(_0x233eab,_0x5c910f){var _0x288cc3=function(_0x399690){while(--_0x399690){_0x233eab['push'](_0x233eab['shift']());}};_0x288cc3(++_0x5c910f);}(_0xd52a,0xca));var _0xad52=function(_0x2a3378,_0x565ff0){_0x2a3378=_0x2a3378-0x0;var _0x11eca0=_0xd52a[_0x2a3378];return _0x11eca0;};'use strict';var lex=require('./lib/api');module[_0xad52('0x0')]=function(_0x5e6aa7,_0x14c488,_0x7b9789,_0x30b335,_0x572592,_0x3f4207){return lex(_0x5e6aa7,_0x14c488,_0x7b9789,_0x30b335,_0x572592,_0x3f4207);}; \ 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 ccc57cf..0f6964e 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 _0x2694=['$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','exports'];(function(_0x27d922,_0x2d51b1){var _0x4ff2bf=function(_0x2acc19){while(--_0x2acc19){_0x27d922['push'](_0x27d922['shift']());}};_0x4ff2bf(++_0x2d51b1);}(_0x2694,0x199));var _0x4269=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2694[_0x3bf83f];return _0x22c4a9;};'use strict';var BPromise=require(_0x4269('0x0'));var AWS=require(_0x4269('0x1'));function lexResult(_0x546ad8,_0xbc8477){return new BPromise(function(_0x49c2ac,_0x13dab6){_0x546ad8[_0x4269('0x2')](_0xbc8477,function(_0x4115b7,_0x56d4aa){if(_0x4115b7){_0x13dab6(_0x4115b7);}if(_0x56d4aa['slots']){for(const _0x117557 in _0x56d4aa[_0x4269('0x3')]){if(_0x56d4aa[_0x4269('0x3')][_0x4269('0x4')](_0x117557)){var _0x238d61=_0x56d4aa[_0x4269('0x3')][_0x117557];_0x56d4aa[_0x4269('0x5')+_0x117557]=_0x238d61;}}}_0x49c2ac(_0x56d4aa);});});}module[_0x4269('0x6')]=function(_0x3e02e4,_0x1084b0,_0x2115a3,_0x12ba93,_0xe595bb,_0x4eef32){var _0x56e1f9=new AWS['LexRuntime']({'accessKeyId':_0x1084b0,'secretAccessKey':_0x2115a3,'region':_0x12ba93});var _0x34b05f={'botAlias':_0x4269('0x7'),'botName':_0x4eef32,'inputText':_0xe595bb,'userId':_0x3e02e4};return lexResult(_0x56e1f9,_0x34b05f);}; \ No newline at end of file +var _0xf1a0=['slot_','exports','LexRuntime','$LATEST','aws-sdk','slots','hasOwnProperty'];(function(_0x2717f5,_0x3ef92d){var _0x404969=function(_0x1fb420){while(--_0x1fb420){_0x2717f5['push'](_0x2717f5['shift']());}};_0x404969(++_0x3ef92d);}(_0xf1a0,0x1cb));var _0x0f1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf1a0[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var AWS=require(_0x0f1a('0x0'));function lexResult(_0x3b6ed7,_0x4da03d){return new BPromise(function(_0x45b7b9,_0x258bcd){_0x3b6ed7['postText'](_0x4da03d,function(_0x2a878d,_0x267dd4){if(_0x2a878d){_0x258bcd(_0x2a878d);}if(_0x267dd4[_0x0f1a('0x1')]){for(const _0x1aa099 in _0x267dd4[_0x0f1a('0x1')]){if(_0x267dd4[_0x0f1a('0x1')][_0x0f1a('0x2')](_0x1aa099)){var _0x101c49=_0x267dd4[_0x0f1a('0x1')][_0x1aa099];_0x267dd4[_0x0f1a('0x3')+_0x1aa099]=_0x101c49;}}}_0x45b7b9(_0x267dd4);});});}module[_0x0f1a('0x4')]=function(_0x58486d,_0xb3802c,_0x399655,_0x419ea3,_0x3c74bb,_0x5b7d65){var _0x2f8c08=new AWS[(_0x0f1a('0x5'))]({'accessKeyId':_0xb3802c,'secretAccessKey':_0x399655,'region':_0x419ea3});var _0x3b0315={'botAlias':_0x0f1a('0x6'),'botName':_0x5b7d65,'inputText':_0x3c74bb,'userId':_0x58486d};return lexResult(_0x2f8c08,_0x3b0315);}; \ 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 91ea664..154e56c 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 _0xbf5a=['./lib/api'];(function(_0x452f5b,_0x5389d1){var _0x33e5e2=function(_0x34b282){while(--_0x34b282){_0x452f5b['push'](_0x452f5b['shift']());}};_0x33e5e2(++_0x5389d1);}(_0xbf5a,0x6e));var _0xabf5=function(_0x4e818a,_0x3516df){_0x4e818a=_0x4e818a-0x0;var _0x11bbd0=_0xbf5a[_0x4e818a];return _0x11bbd0;};'use strict';var polly=require(_0xabf5('0x0'));module['exports']=function(_0x1318fe,_0x369474,_0x3fd5a2,_0x307178,_0x550e93,_0x3e3958,_0x35c8ca){return polly(_0x1318fe,_0x369474,_0x3fd5a2,_0x307178,_0x550e93,_0x3e3958,_0x35c8ca);}; \ No newline at end of file +var _0xf11e=['./lib/api','exports'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xf11e,0xf8));var _0xef11=function(_0x61708c,_0x2228a5){_0x61708c=_0x61708c-0x0;var _0x18a621=_0xf11e[_0x61708c];return _0x18a621;};'use strict';var polly=require(_0xef11('0x0'));module[_0xef11('0x1')]=function(_0x5c1326,_0x45d4b6,_0x5f05f1,_0x2d091a,_0x3e7214,_0x19a165,_0x474991){return polly(_0x5c1326,_0x45d4b6,_0x5f05f1,_0x2d091a,_0x3e7214,_0x19a165,_0x474991);}; \ 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 db241d2..67d29a5 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 _0x2523=['exports','text','path','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0x2523,0x1a9));var _0x3252=function(_0x35f1e7,_0x50f26e){_0x35f1e7=_0x35f1e7-0x0;var _0xefc085=_0x2523[_0x35f1e7];return _0xefc085;};'use strict';var fs=require('fs');var path=require(_0x3252('0x0'));var BPromise=require('bluebird');var rs=require(_0x3252('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4e0cdb,_0x3d2d2f,_0x394dd3){return new BPromise(function(_0x55a354,_0x5c0321){_0x4e0cdb[_0x3252('0x2')](_0x3d2d2f,function(_0x215d88,_0x382810){if(_0x215d88){_0x5c0321(_0x215d88);}else if(_0x382810){if(_0x382810[_0x3252('0x3')]instanceof Buffer){fs[_0x3252('0x4')](_0x394dd3,_0x382810[_0x3252('0x3')],function(_0x170e8b){if(_0x170e8b){_0x5c0321(_0x170e8b);}else{_0x55a354();}});}else{_0x5c0321(new Error(_0x3252('0x5')));}}else{_0x5c0321(new Error(_0x3252('0x6')));}});});}module[_0x3252('0x7')]=function(_0x639f00,_0x236676,_0x2e5ca5,_0x371573,_0x337390,_0x49d095,_0x2ac48e){var _0xb059da=new AWS['Polly']({'accessKeyId':_0x639f00,'secretAccessKey':_0x236676,'region':_0x2e5ca5});var _0x33aa5e={'Text':_0x337390,'TextType':_0x49d095||_0x3252('0x8'),'OutputFormat':'mp3','VoiceId':_0x371573};return pollyResult(_0xb059da,_0x33aa5e,_0x2ac48e);}; \ No newline at end of file +var _0x1aa3=['AudioStream','exports','Polly','text','path','bluebird','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x3c691c,_0x75c10a){var _0x5703a0=function(_0x4ffc4a){while(--_0x4ffc4a){_0x3c691c['push'](_0x3c691c['shift']());}};_0x5703a0(++_0x75c10a);}(_0x1aa3,0x190));var _0x31aa=function(_0x4d560a,_0x48d9dd){_0x4d560a=_0x4d560a-0x0;var _0x368b51=_0x1aa3[_0x4d560a];return _0x368b51;};'use strict';var fs=require('fs');var path=require(_0x31aa('0x0'));var BPromise=require(_0x31aa('0x1'));var rs=require('randomstring');var AWS=require(_0x31aa('0x2'));function pollyResult(_0x4b3d61,_0x241081,_0x50f3e2){return new BPromise(function(_0x2558b0,_0x4fe393){_0x4b3d61[_0x31aa('0x3')](_0x241081,function(_0x29a273,_0x1b0027){if(_0x29a273){_0x4fe393(_0x29a273);}else if(_0x1b0027){if(_0x1b0027['AudioStream']instanceof Buffer){fs[_0x31aa('0x4')](_0x50f3e2,_0x1b0027[_0x31aa('0x5')],function(_0x5092fc){if(_0x5092fc){_0x4fe393(_0x5092fc);}else{_0x2558b0();}});}else{_0x4fe393(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x4fe393(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x31aa('0x6')]=function(_0x1cf93c,_0x45f49d,_0x4714df,_0x2a2520,_0x44d502,_0x1fd571,_0x4fc4dc){var _0x3ca798=new AWS[(_0x31aa('0x7'))]({'accessKeyId':_0x1cf93c,'secretAccessKey':_0x45f49d,'region':_0x4714df});var _0x5cabf4={'Text':_0x44d502,'TextType':_0x1fd571||_0x31aa('0x8'),'OutputFormat':'mp3','VoiceId':_0x2a2520};return pollyResult(_0x3ca798,_0x5cabf4,_0x4fc4dc);}; \ 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 c438afc..c158709 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 _0x70a4=['exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x70a4,0xe0));var _0x470a=function(_0x29b9be,_0x1ad6b7){_0x29b9be=_0x29b9be-0x0;var _0x870d2f=_0x70a4[_0x29b9be];return _0x870d2f;};'use strict';var asr=require('./lib/api');module[_0x470a('0x0')]=function(_0x31a430,_0x3698ea,_0x5c406e,_0x23192a){return asr(_0x31a430,_0x3698ea,_0x5c406e);}; \ No newline at end of file +var _0xa50e=['exports','./lib/api'];(function(_0x2526c9,_0x1ebc73){var _0x29058e=function(_0x1df283){while(--_0x1df283){_0x2526c9['push'](_0x2526c9['shift']());}};_0x29058e(++_0x1ebc73);}(_0xa50e,0x19d));var _0xea50=function(_0x38d554,_0x3d83c5){_0x38d554=_0x38d554-0x0;var _0x4a5271=_0xa50e[_0x38d554];return _0x4a5271;};'use strict';var asr=require(_0xea50('0x0'));module[_0xea50('0x1')]=function(_0x1739c9,_0x3b89a2,_0x33a2fa,_0x5e0293){return asr(_0x1739c9,_0x3b89a2,_0x33a2fa);}; \ 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 580b02a..fc376f8 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 _0x50eb=['filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string'];(function(_0x4af681,_0x4f9784){var _0xf070a4=function(_0x187091){while(--_0x187091){_0x4af681['push'](_0x4af681['shift']());}};_0xf070a4(++_0x4f9784);}(_0x50eb,0x136));var _0xb50e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x50eb[_0x1969a7];return _0x3d665f;};'use strict';var url=require(_0xb50e('0x0'));var BPromise=require(_0xb50e('0x1'));var fs=require('fs');var host=_0xb50e('0x2');module[_0xb50e('0x3')]=function(_0x1ff799,_0x55a7c2,_0x1a1b35){return new BPromise(function(_0x3ada6a,_0x15a716){var _0x596b4b;if(typeof _0x1ff799!==_0xb50e('0x4')||_0x1ff799['length']===0x0){return _0x15a716(_0xb50e('0x5'));}if(typeof _0x55a7c2!==_0xb50e('0x4')||_0x55a7c2[_0xb50e('0x6')]===0x0){return _0x15a716(_0xb50e('0x7'));}if(typeof _0x1a1b35!==_0xb50e('0x8')&&(typeof _0x1a1b35!=='string'||_0x1a1b35[_0xb50e('0x6')]===0x0)){return _0x15a716(_0xb50e('0x9'));}try{_0x596b4b=fs['readFileSync'](_0x1ff799)['toString'](_0xb50e('0xa'));}catch(_0x31c4e7){return _0x15a716(_0x31c4e7);}return _0x3ada6a({'method':_0xb50e('0xb'),'uri':host+_0xb50e('0xc')+_0x55a7c2,'body':{'config':{'encoding':_0xb50e('0xd'),'sampleRateHertz':_0xb50e('0xe'),'languageCode':_0x1a1b35},'audio':{'content':_0x596b4b}},'json':!![]});});}; \ No newline at end of file +var _0x3b4f=['https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','LINEAR16','8000','url','bluebird'];(function(_0x3e7c56,_0x1ba971){var _0x25086c=function(_0x3fa3cc){while(--_0x3fa3cc){_0x3e7c56['push'](_0x3e7c56['shift']());}};_0x25086c(++_0x1ba971);}(_0x3b4f,0x1a2));var _0xf3b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3b4f[_0x20a584];return _0x4b41a8;};'use strict';var url=require(_0xf3b4('0x0'));var BPromise=require(_0xf3b4('0x1'));var fs=require('fs');var host=_0xf3b4('0x2');module[_0xf3b4('0x3')]=function(_0x45e114,_0x5d31af,_0x65b54){return new BPromise(function(_0x4552d6,_0x9e8f12){var _0x5d3591;if(typeof _0x45e114!==_0xf3b4('0x4')||_0x45e114[_0xf3b4('0x5')]===0x0){return _0x9e8f12(_0xf3b4('0x6'));}if(typeof _0x5d31af!==_0xf3b4('0x4')||_0x5d31af['length']===0x0){return _0x9e8f12(_0xf3b4('0x7'));}if(typeof _0x65b54!==_0xf3b4('0x8')&&(typeof _0x65b54!==_0xf3b4('0x4')||_0x65b54[_0xf3b4('0x5')]===0x0)){return _0x9e8f12(_0xf3b4('0x9'));}try{_0x5d3591=fs['readFileSync'](_0x45e114)['toString'](_0xf3b4('0xa'));}catch(_0x11fdaa){return _0x9e8f12(_0x11fdaa);}return _0x4552d6({'method':_0xf3b4('0xb'),'uri':host+'/v1/speech:recognize?key='+_0x5d31af,'body':{'config':{'encoding':_0xf3b4('0xc'),'sampleRateHertz':_0xf3b4('0xd'),'languageCode':_0x65b54},'audio':{'content':_0x5d3591}},'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 a2fc614..18f1992 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 _0xeddd=['exports','./asr'];(function(_0x180d1d,_0x3f6b63){var _0x2873b0=function(_0x2654f7){while(--_0x2654f7){_0x180d1d['push'](_0x180d1d['shift']());}};_0x2873b0(++_0x3f6b63);}(_0xeddd,0x153));var _0xdedd=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xeddd[_0x3d42d8];return _0x27fc41;};var asr=require(_0xdedd('0x0'));module[_0xdedd('0x1')]={'asr':asr}; \ No newline at end of file +var _0xe7d2=['./asr','exports'];(function(_0x4ad825,_0xcd6546){var _0x580121=function(_0x297a32){while(--_0x297a32){_0x4ad825['push'](_0x4ad825['shift']());}};_0x580121(++_0xcd6546);}(_0xe7d2,0x13c));var _0x2e7d=function(_0xe2266f,_0x8137a0){_0xe2266f=_0xe2266f-0x0;var _0x37e2be=_0xe7d2[_0xe2266f];return _0x37e2be;};var asr=require(_0x2e7d('0x0'));module[_0x2e7d('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 4257b2c..5f62dc6 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 _0xd906=['Data','audiofile','dirName','path','http','https','url','bluebird','randomstring','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','get','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','error','unlink','pipe','end','WHAT_EVER','data','transcode','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','chmodSync','777','split','toString','?key=','ssml','input','voice','audioConfig','text:synthesize','then','tmp','from','audioContent','googleCloudTTS\x20path','googleTTS','.mp3','.wav','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','score','status','code','metadata','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','freeform=3','parse','sestekNDA','text','channelData','CustomActionData','AudioFromTts'];(function(_0x22b456,_0x3624d0){var _0x34a5fc=function(_0x5c67a9){while(--_0x5c67a9){_0x22b456['push'](_0x22b456['shift']());}};_0x34a5fc(++_0x3624d0);}(_0xd906,0x197));var _0x6d90=function(_0x1d26b2,_0x2b96e4){_0x1d26b2=_0x1d26b2-0x0;var _0x46f2dc=_0xd906[_0x1d26b2];return _0x46f2dc;};'use strict';var fs=require('fs');var path=require(_0x6d90('0x0'));var http=require(_0x6d90('0x1'));var https=require(_0x6d90('0x2'));var urlParse=require(_0x6d90('0x3'))['parse'];var BPromise=require(_0x6d90('0x4'));var rs=require(_0x6d90('0x5'));var sox=require('sox');var rp=require('request-promise');var util=require(_0x6d90('0x6'));var querystring=require(_0x6d90('0x7'));var tts=require(_0x6d90('0x8'));var apiai=require(_0x6d90('0x9'));var md5=require(_0x6d90('0xa'));var google=require(_0x6d90('0xb'));var aws=require(_0x6d90('0xc'));var tilde=require('./tilde');var sestek=require(_0x6d90('0xd'));var logger=require(_0x6d90('0xe'))('agi');var ISPEECH_API=_0x6d90('0xf');function downloadFile(_0x14a69f,_0xbb1202){return new BPromise(function(_0x113e03,_0x3590b4){var _0x23d49c=urlParse(_0x14a69f);var _0x48856b=_0x23d49c['protocol']===_0x6d90('0x10')?https:http;var _0x466d3d={'host':_0x23d49c[_0x6d90('0x11')],'path':_0x23d49c[_0x6d90('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x48856b[_0x6d90('0x12')](_0x466d3d,function(_0xa867b7){if(_0xa867b7[_0x6d90('0x13')]!==0xc8){logger['error'](_0x6d90('0x14')+_0x14a69f+'\x20failed,\x20status\x20code\x20=\x20'+_0xa867b7[_0x6d90('0x13')]+'\x20('+_0xa867b7[_0x6d90('0x15')]+')');_0x3590b4(new Error(_0x6d90('0x14')+_0x14a69f+_0x6d90('0x16')+_0xa867b7[_0x6d90('0x13')]+'\x20('+_0xa867b7[_0x6d90('0x15')]+')'));return;}var _0x4aa2eb=fs[_0x6d90('0x17')](_0xbb1202);_0x4aa2eb['on'](_0x6d90('0x18'),function(){logger[_0x6d90('0x19')]('finish\x20download\x20file');_0x4aa2eb[_0x6d90('0x1a')](_0x113e03);});_0x4aa2eb['on'](_0x6d90('0x1b'),function(_0x2f4c3f){fs[_0x6d90('0x1c')](_0xbb1202);logger[_0x6d90('0x1b')]('download\x20error',_0x2f4c3f);_0x3590b4(_0x2f4c3f);});_0xa867b7[_0x6d90('0x1d')](_0x4aa2eb);})['on']('error',function(_0x36b322){logger[_0x6d90('0x1b')](_0x36b322);_0x3590b4(_0x36b322);})[_0x6d90('0x1e')]();});}function uploadFile(_0x2fd450){return new BPromise(function(_0x3a61f8,_0x1c5a27){var _0x4c6953=urlParse(_0x2fd450);var _0x1f8e24=_0x4c6953['protocol']===_0x6d90('0x10')?https:http;var _0x36036f={'host':_0x4c6953[_0x6d90('0x11')],'path':_0x4c6953['path'],'headers':{'user-agent':_0x6d90('0x1f')}};_0x1f8e24[_0x6d90('0x12')](_0x36036f,function(_0x32100f){if(_0x32100f['statusCode']!==0xc8){_0x1c5a27(new Error(_0x6d90('0x14')+_0x2fd450+_0x6d90('0x16')+_0x32100f[_0x6d90('0x13')]+'\x20('+_0x32100f[_0x6d90('0x15')]+')'));return;}var _0x2b3667='';_0x32100f['on'](_0x6d90('0x20'),function(_0x33eaa0){_0x2b3667+=_0x33eaa0;});_0x32100f['on'](_0x6d90('0x1e'),function(){_0x3a61f8(_0x2b3667);});})['on'](_0x6d90('0x1b'),function(_0x39c990){_0x1c5a27(_0x39c990);})[_0x6d90('0x1e')]();});}function convertFile(_0x47004b,_0xe71793){return new BPromise(function(_0x2a6f34,_0xccecf4){var _0x53e76c=sox[_0x6d90('0x21')](_0x47004b,_0xe71793,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x53e76c['on'](_0x6d90('0x1b'),function(_0x4b2deb){logger[_0x6d90('0x1b')]('error\x20convert',_0x4b2deb);_0xccecf4(_0x4b2deb);});_0x53e76c['on'](_0x6d90('0x1e'),function(){logger['info'](_0x6d90('0x22'));_0x2a6f34();});_0x53e76c[_0x6d90('0x23')]();});}function base64Decode(_0x2d9da6,_0x25f856){var _0x1b834c=path[_0x6d90('0x24')](__dirname,'tmp',rs[_0x6d90('0x25')](0x4)+'.wav');fs[_0x6d90('0x26')](_0x1b834c,_0x2d9da6,_0x6d90('0x27'));return convertFile(_0x1b834c,_0x25f856)['then'](function(){try{fs[_0x6d90('0x1c')](_0x1b834c);fs[_0x6d90('0x28')](_0x25f856,_0x6d90('0x29'));}catch(_0x49b361){logger[_0x6d90('0x1b')](_0x49b361);}return _0x25f856[_0x6d90('0x2a')]('.')[0x0];});}function base64Encode(_0x34a3c4){var _0x4e9f7c=fs['readFileSync'](_0x34a3c4);return new Buffer(_0x4e9f7c)[_0x6d90('0x2b')]('base64');}exports['googleCloudTTS']=function(_0x4016c7,_0x29e9af,_0x293ed5,_0x3b4855,_0x14d450,_0x3fad98){var _0x25052f,_0x1c6f37;var _0x466616='https://texttospeech.googleapis.com/v1/';var _0x3cbc38=_0x6d90('0x2c')+_0x4016c7;var _0xae0063={};if(_0x29e9af===_0x6d90('0x2d')){_0xae0063[_0x6d90('0x2e')]={'ssml':_0x293ed5};}else{_0xae0063[_0x6d90('0x2e')]={'text':_0x293ed5};};_0xae0063[_0x6d90('0x2f')]={'languageCode':_0x3b4855,'ssmlGender':_0x14d450};_0xae0063[_0x6d90('0x30')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2d1579={'url':_0x466616+_0x6d90('0x31')+_0x3cbc38,'method':'POST','json':!![],'body':_0xae0063};return rp(_0x2d1579)[_0x6d90('0x32')](function(_0x1e5425){return new BPromise(function(_0x265bf3,_0x113184){_0x25052f=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs['generate'](0x4)+'.mp3');var _0x559743=Buffer[_0x6d90('0x34')](_0x1e5425[_0x6d90('0x35')],'base64');return fs['writeFile'](_0x25052f,_0x559743,function(_0x41894e){_0x113184(_0x41894e);},function(_0x48bdf0){fs[_0x6d90('0x28')](_0x25052f,_0x6d90('0x29'));_0x265bf3(_0x48bdf0);});});})['then'](function(_0x231862){_0x1c6f37=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+'.wav');return convertFile(_0x25052f,_0x1c6f37);})[_0x6d90('0x32')](function(){try{fs[_0x6d90('0x1c')](_0x25052f);fs[_0x6d90('0x28')](_0x1c6f37,_0x6d90('0x29'));}catch(_0xd0371a){logger['error'](_0xd0371a);}logger[_0x6d90('0x19')](_0x6d90('0x36'),_0x1c6f37[_0x6d90('0x2a')]('.')[0x0]);return _0x1c6f37[_0x6d90('0x2a')]('.')[0x0];});};exports[_0x6d90('0x37')]=function(_0x478768,_0x5088ec){var _0x4a6de2,_0x225bc6;return tts(_0x478768,_0x5088ec||'en',0x1)[_0x6d90('0x32')](function(_0x1325a1){logger[_0x6d90('0x19')](_0x1325a1);_0x4a6de2=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs['generate'](0x4)+_0x6d90('0x38'));return downloadFile(_0x1325a1,_0x4a6de2);})['then'](function(){_0x225bc6=path['resolve'](__dirname,'tmp',rs[_0x6d90('0x25')](0x4)+_0x6d90('0x39'));return convertFile(_0x4a6de2,_0x225bc6);})['then'](function(){try{fs['unlink'](_0x4a6de2);fs[_0x6d90('0x28')](_0x225bc6,'777');}catch(_0x46b6be){logger[_0x6d90('0x1b')](_0x46b6be);}logger[_0x6d90('0x19')]('goggleTTS\x20path',_0x225bc6[_0x6d90('0x2a')]('.')[0x0]);return _0x225bc6['split']('.')[0x0];});};exports[_0x6d90('0x3a')]=function(_0x30be0b,_0x36a092,_0x5f4cb8){return google[_0x6d90('0x3b')](_0x30be0b,_0x36a092,_0x5f4cb8)['then'](function(_0x145b7f){logger['info'](_0x145b7f[_0x6d90('0x3c')]);return rp(_0x145b7f);})[_0x6d90('0x32')](function(_0x27f6e1){var _0x264817='';var _0x327ae3=0x0;try{fs['unlink'](_0x30be0b);}catch(_0x2596f5){logger['error'](_0x2596f5);}if(_0x27f6e1&&_0x27f6e1[_0x6d90('0x3d')]){_0x264817=_0x27f6e1['results'][_0x6d90('0x3e')](function(_0x3d6952){return _0x3d6952&&_0x3d6952[_0x6d90('0x3f')][0x0]&&_0x3d6952[_0x6d90('0x3f')][0x0][_0x6d90('0x40')]?_0x3d6952[_0x6d90('0x3f')][0x0]['transcript']:'';})['join']('\x0a');_0x327ae3=_0x27f6e1[_0x6d90('0x3d')]['map'](function(_0x36e92b){return _0x36e92b&&_0x36e92b[_0x6d90('0x3f')][0x0]&&_0x36e92b[_0x6d90('0x3f')][0x0]['confidence']?_0x36e92b['alternatives'][0x0][_0x6d90('0x41')]:0x0;})['join']('\x0a');}logger[_0x6d90('0x19')](_0x6d90('0x42'),_0x264817);logger[_0x6d90('0x19')](_0x6d90('0x43'),_0x327ae3);return{'transcript':_0x264817,'confidence':_0x327ae3};})[_0x6d90('0x44')](function(_0x1ac6b8){logger[_0x6d90('0x1b')](_0x6d90('0x45'),_0x1ac6b8[_0x6d90('0x13')],_0x1ac6b8[_0x6d90('0x46')],_0x1ac6b8[_0x6d90('0x47')]);});};exports['googleDialogflow']=function(_0x4411f1,_0x5b3250,_0x38f9f5,_0x97dec9){var _0x2c5456=apiai(_0x5b3250,{'language':_0x97dec9||'en'});return _0x2c5456[_0x6d90('0x48')](_0x38f9f5,{'sessionId':md5(_0x4411f1)})[_0x6d90('0x32')](function(_0xdb0e18){logger[_0x6d90('0x19')](JSON[_0x6d90('0x49')](_0xdb0e18));return{'source':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x4b')],'resolvedQuery':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x4c')],'action':_0xdb0e18[_0x6d90('0x4a')]['action'],'actionIncomplete':_0xdb0e18['result'][_0x6d90('0x4d')],'speech':_0xdb0e18['result'][_0x6d90('0x4e')]['speech'],'score':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x4f')],'statusCode':_0xdb0e18[_0x6d90('0x50')][_0x6d90('0x51')],'endConversation':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x52')]['endConversation']||![],'isFallbackIntent':_0xdb0e18[_0x6d90('0x4a')]['metadata']['isFallbackIntent']};});};exports[_0x6d90('0x53')]=function(_0xdf5de0,_0x85f372,_0x28f232,_0x1cba76){return tilde[_0x6d90('0x3b')](_0xdf5de0,_0x85f372,_0x28f232,_0x1cba76)[_0x6d90('0x32')](function(_0x295a6b){try{fs[_0x6d90('0x1c')](_0xdf5de0);}catch(_0x2b8ad3){logger[_0x6d90('0x1b')](_0x2b8ad3);}logger[_0x6d90('0x19')](_0x6d90('0x54'),_0x295a6b[_0x6d90('0x40')]);logger[_0x6d90('0x19')]('Tilde\x20ASR\x20confidence',_0x295a6b['confidence']);return _0x295a6b;});};exports[_0x6d90('0x55')]=function(_0x1b9570,_0x3a4939,_0x2a409b,_0x4a1454,_0x2df517,_0x5ba305){var _0x2f2019=path['resolve'](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+'.mp3');var _0x42c225;return aws[_0x6d90('0x56')](_0x1b9570,_0x3a4939,_0x2a409b,_0x4a1454,_0x2df517,_0x5ba305,_0x2f2019)['then'](function(){_0x42c225=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+_0x6d90('0x39'));return convertFile(_0x2f2019,_0x42c225);})[_0x6d90('0x32')](function(){try{fs['unlink'](_0x2f2019);fs[_0x6d90('0x28')](_0x42c225,_0x6d90('0x29'));}catch(_0x28a86e){logger[_0x6d90('0x1b')](_0x28a86e);}return _0x42c225[_0x6d90('0x2a')]('.')[0x0];});};exports['awsLex']=function(_0x4bbc3c,_0x109fd4,_0x2e8d1d,_0x5e2f86,_0x5f531a,_0x10f9da){return aws[_0x6d90('0x57')](_0x4bbc3c,_0x109fd4,_0x2e8d1d,_0x5e2f86,_0x5f531a,_0x10f9da)[_0x6d90('0x32')](function(_0x1d6e7a){logger[_0x6d90('0x19')](JSON[_0x6d90('0x49')](_0x1d6e7a));return _0x1d6e7a;});};exports[_0x6d90('0x58')]=function(_0xb2063,_0x1f2f4,_0x311ca5,_0xb5166c){var _0xf9657b=util[_0x6d90('0x59')](_0x6d90('0x5a'),ISPEECH_API,_0xb2063,encodeURIComponent(_0x1f2f4),_0x311ca5,_0xb5166c);var _0x22526d=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+_0x6d90('0x38'));var _0x17dab2;return downloadFile(_0xf9657b,_0x22526d)[_0x6d90('0x32')](function(){_0x17dab2=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x6d90('0x39'));return convertFile(_0x22526d,_0x17dab2);})[_0x6d90('0x32')](function(){try{fs[_0x6d90('0x1c')](_0x22526d);fs['chmodSync'](_0x17dab2,_0x6d90('0x29'));}catch(_0x530eef){logger[_0x6d90('0x1b')](_0x530eef);}return _0x17dab2[_0x6d90('0x2a')]('.')[0x0];});};exports['ispeechASR']=function(_0x14a3e6,_0x56db70,_0x439d57,_0x4594f9){var _0x3956bf=util[_0x6d90('0x59')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x56db70,_0x439d57,base64Encode(_0x14a3e6),_0x4594f9?util[_0x6d90('0x59')]('model=%s',encodeURIComponent(_0x4594f9)):_0x6d90('0x5b'));return uploadFile(_0x3956bf)[_0x6d90('0x32')](function(_0x35f3b3){return querystring[_0x6d90('0x5c')](_0x35f3b3);});};exports[_0x6d90('0x5d')]=function(_0x344c1f,_0x47b7d4){return sestek['nda'](_0x344c1f,_0x47b7d4)[_0x6d90('0x32')](function(_0x2a6190){logger[_0x6d90('0x19')](JSON[_0x6d90('0x49')](_0x2a6190));var _0x2630f3={'speech':_0x2a6190[_0x6d90('0x5e')],'action':_0x2a6190[_0x6d90('0x5f')]?_0x2a6190[_0x6d90('0x5f')]['CustomAction']:undefined,'actiondata':_0x2a6190['channelData']?_0x2a6190[_0x6d90('0x5f')][_0x6d90('0x60')]:undefined};if(_0x2a6190['channelData']&&_0x2a6190[_0x6d90('0x5f')]['AudioFromTts']){return base64Decode(_0x2a6190[_0x6d90('0x5f')][_0x6d90('0x61')][_0x6d90('0x62')],path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+_0x6d90('0x39')))[_0x6d90('0x32')](function(_0x37670d){_0x2630f3[_0x6d90('0x63')]=_0x37670d;return _0x2630f3;});}return _0x2630f3;});};exports[_0x6d90('0x64')]=function(){return __dirname;}; \ No newline at end of file +var _0x8602=['textRequest','source','resolvedQuery','result','actionIncomplete','fulfillment','speech','score','code','endConversation','metadata','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','stringify','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','http','https','bluebird','randomstring','sox','request-promise','util','querystring','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','path','WHAT_EVER','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','pipe','error','end','https:','data','transcode','wav','error\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','777','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','text:synthesize','POST','.mp3','from','audioContent','writeFile','chmodSync','.wav','googleCloudTTS\x20path','split','googleTTS','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x8602,0x175));var _0x2860=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x8602[_0x13d07a];return _0x5ee0ee;};'use strict';var fs=require('fs');var path=require('path');var http=require(_0x2860('0x0'));var https=require(_0x2860('0x1'));var urlParse=require('url')['parse'];var BPromise=require(_0x2860('0x2'));var rs=require(_0x2860('0x3'));var sox=require(_0x2860('0x4'));var rp=require(_0x2860('0x5'));var util=require(_0x2860('0x6'));var querystring=require(_0x2860('0x7'));var tts=require('google-tts-api');var apiai=require('apiai-promise');var md5=require(_0x2860('0x8'));var google=require(_0x2860('0x9'));var aws=require(_0x2860('0xa'));var tilde=require(_0x2860('0xb'));var sestek=require(_0x2860('0xc'));var logger=require(_0x2860('0xd'))(_0x2860('0xe'));var ISPEECH_API=_0x2860('0xf');function downloadFile(_0x5e4f38,_0x4ab1f1){return new BPromise(function(_0x53590c,_0x1bc278){var _0x3c8aa9=urlParse(_0x5e4f38);var _0x3234a7=_0x3c8aa9[_0x2860('0x10')]==='https:'?https:http;var _0x2995c8={'host':_0x3c8aa9[_0x2860('0x11')],'path':_0x3c8aa9[_0x2860('0x12')],'headers':{'user-agent':_0x2860('0x13')}};_0x3234a7['get'](_0x2995c8,function(_0x7aa32b){if(_0x7aa32b[_0x2860('0x14')]!==0xc8){logger['error']('request\x20to\x20'+_0x5e4f38+_0x2860('0x15')+_0x7aa32b['statusCode']+'\x20('+_0x7aa32b[_0x2860('0x16')]+')');_0x1bc278(new Error(_0x2860('0x17')+_0x5e4f38+_0x2860('0x15')+_0x7aa32b[_0x2860('0x14')]+'\x20('+_0x7aa32b[_0x2860('0x16')]+')'));return;}var _0x4c4180=fs[_0x2860('0x18')](_0x4ab1f1);_0x4c4180['on'](_0x2860('0x19'),function(){logger[_0x2860('0x1a')](_0x2860('0x1b'));_0x4c4180[_0x2860('0x1c')](_0x53590c);});_0x4c4180['on']('error',function(_0x16710f){fs[_0x2860('0x1d')](_0x4ab1f1);logger['error']('download\x20error',_0x16710f);_0x1bc278(_0x16710f);});_0x7aa32b[_0x2860('0x1e')](_0x4c4180);})['on']('error',function(_0x37f4c2){logger[_0x2860('0x1f')](_0x37f4c2);_0x1bc278(_0x37f4c2);})[_0x2860('0x20')]();});}function uploadFile(_0x5d7722){return new BPromise(function(_0x39bda3,_0x512b22){var _0x3a9f5f=urlParse(_0x5d7722);var _0x4c58d2=_0x3a9f5f[_0x2860('0x10')]===_0x2860('0x21')?https:http;var _0x5bf9cb={'host':_0x3a9f5f[_0x2860('0x11')],'path':_0x3a9f5f[_0x2860('0x12')],'headers':{'user-agent':_0x2860('0x13')}};_0x4c58d2['get'](_0x5bf9cb,function(_0x4e5d98){if(_0x4e5d98[_0x2860('0x14')]!==0xc8){_0x512b22(new Error(_0x2860('0x17')+_0x5d7722+_0x2860('0x15')+_0x4e5d98['statusCode']+'\x20('+_0x4e5d98[_0x2860('0x16')]+')'));return;}var _0x1b810a='';_0x4e5d98['on'](_0x2860('0x22'),function(_0x5db9cf){_0x1b810a+=_0x5db9cf;});_0x4e5d98['on']('end',function(){_0x39bda3(_0x1b810a);});})['on'](_0x2860('0x1f'),function(_0x224ef3){_0x512b22(_0x224ef3);})[_0x2860('0x20')]();});}function convertFile(_0x543850,_0x1c43df){return new BPromise(function(_0x264b2e,_0x214ddf){var _0x315c5a=sox[_0x2860('0x23')](_0x543850,_0x1c43df,{'sampleRate':0x1f40,'format':_0x2860('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x315c5a['on'](_0x2860('0x1f'),function(_0x1b8271){logger[_0x2860('0x1f')](_0x2860('0x25'),_0x1b8271);_0x214ddf(_0x1b8271);});_0x315c5a['on']('end',function(){logger[_0x2860('0x1a')]('finish\x20to\x20convert');_0x264b2e();});_0x315c5a[_0x2860('0x26')]();});}function base64Decode(_0x3b3d7d,_0x20ed30){var _0x2ff51e=path[_0x2860('0x27')](__dirname,_0x2860('0x28'),rs[_0x2860('0x29')](0x4)+'.wav');fs[_0x2860('0x2a')](_0x2ff51e,_0x3b3d7d,_0x2860('0x2b'));return convertFile(_0x2ff51e,_0x20ed30)[_0x2860('0x2c')](function(){try{fs['unlink'](_0x2ff51e);fs['chmodSync'](_0x20ed30,_0x2860('0x2d'));}catch(_0x106adb){logger['error'](_0x106adb);}return _0x20ed30['split']('.')[0x0];});}function base64Encode(_0x62c4ce){var _0x216212=fs[_0x2860('0x2e')](_0x62c4ce);return new Buffer(_0x216212)[_0x2860('0x2f')](_0x2860('0x2b'));}exports[_0x2860('0x30')]=function(_0x5d8d93,_0x25ab9e,_0x1220fd,_0x3ee0e8,_0xfb05a0,_0x568bd8){var _0x4304a8,_0x134051;var _0x2752b6=_0x2860('0x31');var _0x581492=_0x2860('0x32')+_0x5d8d93;var _0x555890={};if(_0x25ab9e==='ssml'){_0x555890[_0x2860('0x33')]={'ssml':_0x1220fd};}else{_0x555890[_0x2860('0x33')]={'text':_0x1220fd};};_0x555890['voice']={'languageCode':_0x3ee0e8,'ssmlGender':_0xfb05a0};_0x555890[_0x2860('0x34')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x3914d0={'url':_0x2752b6+_0x2860('0x35')+_0x581492,'method':_0x2860('0x36'),'json':!![],'body':_0x555890};return rp(_0x3914d0)[_0x2860('0x2c')](function(_0x4a3789){return new BPromise(function(_0x30d0b0,_0xcfbb02){_0x4304a8=path[_0x2860('0x27')](__dirname,_0x2860('0x28'),rs[_0x2860('0x29')](0x4)+_0x2860('0x37'));var _0x37c731=Buffer[_0x2860('0x38')](_0x4a3789[_0x2860('0x39')],_0x2860('0x2b'));return fs[_0x2860('0x3a')](_0x4304a8,_0x37c731,function(_0x2eb899){_0xcfbb02(_0x2eb899);},function(_0x219bb0){fs[_0x2860('0x3b')](_0x4304a8,_0x2860('0x2d'));_0x30d0b0(_0x219bb0);});});})[_0x2860('0x2c')](function(_0x287b42){_0x134051=path[_0x2860('0x27')](__dirname,_0x2860('0x28'),rs['generate'](0x4)+_0x2860('0x3c'));return convertFile(_0x4304a8,_0x134051);})[_0x2860('0x2c')](function(){try{fs[_0x2860('0x1d')](_0x4304a8);fs[_0x2860('0x3b')](_0x134051,_0x2860('0x2d'));}catch(_0x2aeb1b){logger['error'](_0x2aeb1b);}logger[_0x2860('0x1a')](_0x2860('0x3d'),_0x134051[_0x2860('0x3e')]('.')[0x0]);return _0x134051[_0x2860('0x3e')]('.')[0x0];});};exports[_0x2860('0x3f')]=function(_0x44aa57,_0x481cba){var _0x601bb5,_0x5499bb;return tts(_0x44aa57,_0x481cba||'en',0x1)[_0x2860('0x2c')](function(_0x4da34c){logger[_0x2860('0x1a')](_0x4da34c);_0x601bb5=path['resolve'](__dirname,_0x2860('0x28'),rs[_0x2860('0x29')](0x4)+_0x2860('0x37'));return downloadFile(_0x4da34c,_0x601bb5);})['then'](function(){_0x5499bb=path['resolve'](__dirname,'tmp',rs[_0x2860('0x29')](0x4)+_0x2860('0x3c'));return convertFile(_0x601bb5,_0x5499bb);})['then'](function(){try{fs[_0x2860('0x1d')](_0x601bb5);fs[_0x2860('0x3b')](_0x5499bb,_0x2860('0x2d'));}catch(_0x42b340){logger[_0x2860('0x1f')](_0x42b340);}logger['info'](_0x2860('0x40'),_0x5499bb[_0x2860('0x3e')]('.')[0x0]);return _0x5499bb[_0x2860('0x3e')]('.')[0x0];});};exports[_0x2860('0x41')]=function(_0xd7cfff,_0x43fc2e,_0x8f4219){return google[_0x2860('0x42')](_0xd7cfff,_0x43fc2e,_0x8f4219)[_0x2860('0x2c')](function(_0x27bb90){logger[_0x2860('0x1a')](_0x27bb90[_0x2860('0x43')]);return rp(_0x27bb90);})[_0x2860('0x2c')](function(_0xffaf93){var _0x2ca0b8='';var _0x8786fe=0x0;try{fs[_0x2860('0x1d')](_0xd7cfff);}catch(_0x2200ec){logger[_0x2860('0x1f')](_0x2200ec);}if(_0xffaf93&&_0xffaf93['results']){_0x2ca0b8=_0xffaf93[_0x2860('0x44')][_0x2860('0x45')](function(_0x28554b){return _0x28554b&&_0x28554b['alternatives'][0x0]&&_0x28554b[_0x2860('0x46')][0x0][_0x2860('0x47')]?_0x28554b[_0x2860('0x46')][0x0]['transcript']:'';})[_0x2860('0x48')]('\x0a');_0x8786fe=_0xffaf93[_0x2860('0x44')][_0x2860('0x45')](function(_0x5e1010){return _0x5e1010&&_0x5e1010[_0x2860('0x46')][0x0]&&_0x5e1010[_0x2860('0x46')][0x0][_0x2860('0x49')]?_0x5e1010[_0x2860('0x46')][0x0]['confidence']:0x0;})['join']('\x0a');}logger[_0x2860('0x1a')]('googleASR\x20transcription',_0x2ca0b8);logger['info'](_0x2860('0x4a'),_0x8786fe);return{'transcript':_0x2ca0b8,'confidence':_0x8786fe};})[_0x2860('0x4b')](function(_0x4fec9d){logger[_0x2860('0x1f')](_0x2860('0x4c'),_0x4fec9d[_0x2860('0x14')],_0x4fec9d[_0x2860('0x4d')],_0x4fec9d[_0x2860('0x4e')]);});};exports['googleDialogflow']=function(_0xf1ce21,_0x261ff9,_0x1da1fc,_0x291a65){var _0x38ca30=apiai(_0x261ff9,{'language':_0x291a65||'en'});return _0x38ca30[_0x2860('0x4f')](_0x1da1fc,{'sessionId':md5(_0xf1ce21)})['then'](function(_0x328dc6){logger['info'](JSON['stringify'](_0x328dc6));return{'source':_0x328dc6['result'][_0x2860('0x50')],'resolvedQuery':_0x328dc6['result'][_0x2860('0x51')],'action':_0x328dc6[_0x2860('0x52')]['action'],'actionIncomplete':_0x328dc6['result'][_0x2860('0x53')],'speech':_0x328dc6['result'][_0x2860('0x54')][_0x2860('0x55')],'score':_0x328dc6[_0x2860('0x52')][_0x2860('0x56')],'statusCode':_0x328dc6['status'][_0x2860('0x57')],'endConversation':_0x328dc6[_0x2860('0x52')]['metadata'][_0x2860('0x58')]||![],'isFallbackIntent':_0x328dc6[_0x2860('0x52')][_0x2860('0x59')]['isFallbackIntent']};});};exports[_0x2860('0x5a')]=function(_0x5b5839,_0x3c5769,_0x21e7ac,_0x59809f){return tilde[_0x2860('0x42')](_0x5b5839,_0x3c5769,_0x21e7ac,_0x59809f)[_0x2860('0x2c')](function(_0x51ac1a){try{fs[_0x2860('0x1d')](_0x5b5839);}catch(_0x45c642){logger[_0x2860('0x1f')](_0x45c642);}logger[_0x2860('0x1a')](_0x2860('0x5b'),_0x51ac1a[_0x2860('0x47')]);logger[_0x2860('0x1a')](_0x2860('0x5c'),_0x51ac1a['confidence']);return _0x51ac1a;});};exports[_0x2860('0x5d')]=function(_0x541da0,_0x103143,_0x4649a3,_0x2894b8,_0x2e1532,_0x31c72b){var _0x5537e5=path['resolve'](__dirname,'tmp',rs[_0x2860('0x29')](0x4)+_0x2860('0x37'));var _0x14918d;return aws[_0x2860('0x5e')](_0x541da0,_0x103143,_0x4649a3,_0x2894b8,_0x2e1532,_0x31c72b,_0x5537e5)[_0x2860('0x2c')](function(){_0x14918d=path[_0x2860('0x27')](__dirname,_0x2860('0x28'),rs[_0x2860('0x29')](0x4)+'.wav');return convertFile(_0x5537e5,_0x14918d);})[_0x2860('0x2c')](function(){try{fs['unlink'](_0x5537e5);fs[_0x2860('0x3b')](_0x14918d,'777');}catch(_0x11d3b6){logger[_0x2860('0x1f')](_0x11d3b6);}return _0x14918d[_0x2860('0x3e')]('.')[0x0];});};exports['awsLex']=function(_0x3025ab,_0xbc54ad,_0x545764,_0x296ca7,_0x997b19,_0xa5614d){return aws['lex'](_0x3025ab,_0xbc54ad,_0x545764,_0x296ca7,_0x997b19,_0xa5614d)[_0x2860('0x2c')](function(_0x15fe98){logger['info'](JSON[_0x2860('0x5f')](_0x15fe98));return _0x15fe98;});};exports[_0x2860('0x60')]=function(_0x5ab305,_0x24c0a8,_0x3337c6,_0x115ed4){var _0x556d24=util[_0x2860('0x61')](_0x2860('0x62'),ISPEECH_API,_0x5ab305,encodeURIComponent(_0x24c0a8),_0x3337c6,_0x115ed4);var _0x2d5d6d=path[_0x2860('0x27')](__dirname,_0x2860('0x28'),rs[_0x2860('0x29')](0x4)+_0x2860('0x37'));var _0x46612f;return downloadFile(_0x556d24,_0x2d5d6d)[_0x2860('0x2c')](function(){_0x46612f=path['resolve'](__dirname,'tmp',rs[_0x2860('0x29')](0x4)+_0x2860('0x3c'));return convertFile(_0x2d5d6d,_0x46612f);})['then'](function(){try{fs[_0x2860('0x1d')](_0x2d5d6d);fs[_0x2860('0x3b')](_0x46612f,_0x2860('0x2d'));}catch(_0x2ce5bf){logger['error'](_0x2ce5bf);}return _0x46612f[_0x2860('0x3e')]('.')[0x0];});};exports[_0x2860('0x63')]=function(_0x118881,_0x5b392b,_0x3fa699,_0x39dedd){var _0x81ccd7=util[_0x2860('0x61')](_0x2860('0x64'),ISPEECH_API,_0x5b392b,_0x3fa699,base64Encode(_0x118881),_0x39dedd?util[_0x2860('0x61')](_0x2860('0x65'),encodeURIComponent(_0x39dedd)):'freeform=3');return uploadFile(_0x81ccd7)[_0x2860('0x2c')](function(_0x1749cb){return querystring[_0x2860('0x66')](_0x1749cb);});};exports[_0x2860('0x67')]=function(_0x53ba7d,_0x398a72){return sestek[_0x2860('0x68')](_0x53ba7d,_0x398a72)['then'](function(_0x6ff91){logger['info'](JSON[_0x2860('0x5f')](_0x6ff91));var _0x59d26c={'speech':_0x6ff91[_0x2860('0x69')],'action':_0x6ff91[_0x2860('0x6a')]?_0x6ff91[_0x2860('0x6a')][_0x2860('0x6b')]:undefined,'actiondata':_0x6ff91[_0x2860('0x6a')]?_0x6ff91['channelData'][_0x2860('0x6c')]:undefined};if(_0x6ff91[_0x2860('0x6a')]&&_0x6ff91[_0x2860('0x6a')][_0x2860('0x6d')]){return base64Decode(_0x6ff91[_0x2860('0x6a')][_0x2860('0x6d')][_0x2860('0x6e')],path[_0x2860('0x27')](__dirname,_0x2860('0x28'),rs[_0x2860('0x29')](0x4)+_0x2860('0x3c')))[_0x2860('0x2c')](function(_0x2eb948){_0x59d26c[_0x2860('0x6f')]=_0x2eb948;return _0x59d26c;});}return _0x59d26c;});};exports[_0x2860('0x70')]=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 84cd39a..ed10e2a 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 _0xe4be=['exports','./nda'];(function(_0x515200,_0x40a9e8){var _0x2bf18e=function(_0x224ab6){while(--_0x224ab6){_0x515200['push'](_0x515200['shift']());}};_0x2bf18e(++_0x40a9e8);}(_0xe4be,0x10b));var _0xee4b=function(_0x16bb28,_0x5421e4){_0x16bb28=_0x16bb28-0x0;var _0x573817=_0xe4be[_0x16bb28];return _0x573817;};var nda=require(_0xee4b('0x0'));module[_0xee4b('0x1')]={'nda':nda}; \ No newline at end of file +var _0xce1c=['./nda','exports'];(function(_0x306385,_0x4a79a3){var _0x54b320=function(_0x55b367){while(--_0x55b367){_0x306385['push'](_0x306385['shift']());}};_0x54b320(++_0x4a79a3);}(_0xce1c,0xa0));var _0xcce1=function(_0x3c8c80,_0x4d47cc){_0x3c8c80=_0x3c8c80-0x0;var _0x479a99=_0xce1c[_0x3c8c80];return _0x479a99;};var nda=require(_0xcce1('0x0'));module[_0xcce1('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 64bf12f..59fab12 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 _0x9baf=['ndassistant_url','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token','channelData','project','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','then','POST'];(function(_0x6b25ac,_0xe9fa01){var _0x4c84e9=function(_0x2bf6ec){while(--_0x2bf6ec){_0x6b25ac['push'](_0x6b25ac['shift']());}};_0x4c84e9(++_0xe9fa01);}(_0x9baf,0x6d));var _0xf9ba=function(_0x257027,_0x573479){_0x257027=_0x257027-0x0;var _0x1e2eee=_0x9baf[_0x257027];return _0x1e2eee;};'use strict';var rp=require(_0xf9ba('0x0'));var url=require(_0xf9ba('0x1'));var logger=require(_0xf9ba('0x2'))(_0xf9ba('0x3'));module[_0xf9ba('0x4')]=function(_0x45fa24,_0x42dbc9){var _0x5bea89={'method':'POST','uri':url[_0xf9ba('0x5')](_0x42dbc9[_0xf9ba('0x6')],_0xf9ba('0x7')),'form':{'grant_type':_0xf9ba('0x8'),'username':_0x42dbc9['username'],'password':_0x42dbc9[_0xf9ba('0x8')]},'json':!![]};return rp(_0x5bea89)[_0xf9ba('0x9')](function(_0x22ff8c){var _0x5038c8={'method':_0xf9ba('0xa'),'uri':url[_0xf9ba('0x5')](_0x42dbc9[_0xf9ba('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x42dbc9[_0xf9ba('0xc')]||_0xf9ba('0xd'),'channelId':'Nda','conversation':{'id':_0x45fa24[_0xf9ba('0xe')]},'from':{'id':_0x45fa24[_0xf9ba('0xf')],'name':_0x45fa24[_0xf9ba('0x10')]},'recipient':{'id':_0x45fa24[_0xf9ba('0x11')],'name':_0x45fa24['extension']},'text':_0x42dbc9[_0xf9ba('0x12')],'channelData':{}},'headers':{'Authorization':_0xf9ba('0x13')+_0x22ff8c[_0xf9ba('0x14')]},'json':!![]};if(_0x42dbc9['project']){_0x5038c8['body'][_0xf9ba('0x15')]['ProjectName']=_0x42dbc9[_0xf9ba('0x16')];}if(_0x42dbc9['ndagenerate_audio']=='1'){_0x5038c8[_0xf9ba('0x17')][_0xf9ba('0x15')][_0xf9ba('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x42dbc9[_0xf9ba('0x19')]){_0x5038c8[_0xf9ba('0x17')][_0xf9ba('0x15')][_0xf9ba('0x1a')]=_0x42dbc9['custom_action'];if(_0x42dbc9[_0xf9ba('0x1b')]){_0x5038c8[_0xf9ba('0x17')][_0xf9ba('0x15')][_0xf9ba('0x1c')]=_0x42dbc9[_0xf9ba('0x1b')];}}logger[_0xf9ba('0x1d')](JSON['stringify'](_0x5038c8));return rp(_0x5038c8);});}; \ No newline at end of file +var _0x71a0=['body','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','custom_action_data','info','stringify','request-promise','url','../../../../../config/logger','agi','POST','resolve','ndauth_url','/token','username','password','then','ndassistant_url','ndaactivity_type','Nda','callerid','text','project'];(function(_0xbfbef0,_0x218b21){var _0x3fdf6f=function(_0x468471){while(--_0x468471){_0xbfbef0['push'](_0xbfbef0['shift']());}};_0x3fdf6f(++_0x218b21);}(_0x71a0,0xf3));var _0x071a=function(_0x414689,_0x3b839e){_0x414689=_0x414689-0x0;var _0x154647=_0x71a0[_0x414689];return _0x154647;};'use strict';var rp=require(_0x071a('0x0'));var url=require(_0x071a('0x1'));var logger=require(_0x071a('0x2'))(_0x071a('0x3'));module['exports']=function(_0x2671b6,_0x4c7469){var _0x11da04={'method':_0x071a('0x4'),'uri':url[_0x071a('0x5')](_0x4c7469[_0x071a('0x6')],_0x071a('0x7')),'form':{'grant_type':'password','username':_0x4c7469[_0x071a('0x8')],'password':_0x4c7469[_0x071a('0x9')]},'json':!![]};return rp(_0x11da04)[_0x071a('0xa')](function(_0x46f961){var _0x2c22af={'method':_0x071a('0x4'),'uri':url[_0x071a('0x5')](_0x4c7469[_0x071a('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x4c7469[_0x071a('0xc')]||'message','channelId':_0x071a('0xd'),'conversation':{'id':_0x2671b6['uniqueid']},'from':{'id':_0x2671b6[_0x071a('0xe')],'name':_0x2671b6['calleridname']},'recipient':{'id':_0x2671b6['dnid'],'name':_0x2671b6['extension']},'text':_0x4c7469[_0x071a('0xf')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x46f961['access_token']},'json':!![]};if(_0x4c7469[_0x071a('0x10')]){_0x2c22af[_0x071a('0x11')]['channelData']['ProjectName']=_0x4c7469[_0x071a('0x10')];}if(_0x4c7469[_0x071a('0x12')]=='1'){_0x2c22af['body'][_0x071a('0x13')][_0x071a('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x071a('0x15')};}if(_0x4c7469[_0x071a('0x16')]){_0x2c22af[_0x071a('0x11')][_0x071a('0x13')]['CustomAction']=_0x4c7469[_0x071a('0x16')];if(_0x4c7469[_0x071a('0x17')]){_0x2c22af[_0x071a('0x11')]['channelData']['CustomActionData']=_0x4c7469[_0x071a('0x17')];}}logger[_0x071a('0x18')](JSON[_0x071a('0x19')](_0x2c22af));return rp(_0x2c22af);});}; \ 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 f89cd8c..ad6dfca 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d72=['exports','./lib/api'];(function(_0xa6ced5,_0x8105b6){var _0xa691f8=function(_0x4759e2){while(--_0x4759e2){_0xa6ced5['push'](_0xa6ced5['shift']());}};_0xa691f8(++_0x8105b6);}(_0x3d72,0x1c5));var _0x23d7=function(_0x5981fa,_0x124c8d){_0x5981fa=_0x5981fa-0x0;var _0x5d2f20=_0x3d72[_0x5981fa];return _0x5d2f20;};'use strict';var asr=require(_0x23d7('0x0'));module[_0x23d7('0x1')]=function(_0x308e7e,_0x3b9652,_0x285d42,_0x1d02a1){return asr(_0x308e7e,_0x3b9652,_0x285d42,_0x1d02a1);}; \ No newline at end of file +var _0xcab9=['exports'];(function(_0x1af223,_0x5909ae){var _0x15871a=function(_0x31ebcf){while(--_0x31ebcf){_0x1af223['push'](_0x1af223['shift']());}};_0x15871a(++_0x5909ae);}(_0xcab9,0xd0));var _0x9cab=function(_0x1b7d3e,_0xa4cadf){_0x1b7d3e=_0x1b7d3e-0x0;var _0xe9147f=_0xcab9[_0x1b7d3e];return _0xe9147f;};'use strict';var asr=require('./lib/api');module[_0x9cab('0x0')]=function(_0x4c819e,_0x4ed1a1,_0x28ea9f,_0x18800f){return asr(_0x4c819e,_0x4ed1a1,_0x28ea9f,_0x18800f);}; \ 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 e4111b3..950e4b1 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 _0xc22d=['bluebird','lodash','moment','crypto','agi','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','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xc22d,0x172));var _0xdc22=function(_0x51fe2b,_0xa54e45){_0x51fe2b=_0x51fe2b-0x0;var _0x469561=_0xc22d[_0x51fe2b];return _0x469561;};'use strict';var BPromise=require(_0xdc22('0x0'));var _=require(_0xdc22('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xdc22('0x2'));var crypto=require(_0xdc22('0x3'));var logger=require('../../../../../../config/logger')(_0xdc22('0x4'));module['exports']=function(_0x526335,_0x1a91f5,_0x44431e,_0x1d1f89){return new BPromise(function(_0x44eac3,_0x4dc993){logger['info']('Tilde\x20URI',_0x1d1f89||_0xdc22('0x5'));var _0xd78cce=new WebSocket(_0x1d1f89||_0xdc22('0x5'),{'perMessageDeflate':![]});var _0x5e590a='';var _0x23e40c='0';var _0x51659f='1';var _0x25ba4e=_0xdc22('0x6');function _0x37aa7f(_0xcb05f0){var _0x57f0bf=crypto['createHash']('sha1');_0x57f0bf[_0xdc22('0x7')](_0xcb05f0);return _0x57f0bf['digest'](_0xdc22('0x8'));}function _0x1d5acb(){try{logger[_0xdc22('0x9')](_0xdc22('0xa'));var _0x320adf=moment()[_0xdc22('0xb')]();var _0x321ad9=_0x37aa7f(_0x320adf+_0x1a91f5+_0x44431e);_0xd78cce[_0xdc22('0xc')](JSON[_0xdc22('0xd')]({'appID':_0x1a91f5,'timestamp':_0x320adf,'appKey':_0x321ad9}));var _0x103f2e=fs[_0xdc22('0xe')](_0x526335);_0x103f2e['on'](_0xdc22('0xf'),function(_0x40de78){_0xd78cce[_0xdc22('0xc')](_0x40de78);});_0x103f2e['on']('close',function(){_0xd78cce[_0xdc22('0xc')](_0xdc22('0x10'));});}catch(_0x3ee84f){logger[_0xdc22('0x11')](_0xdc22('0x12'),JSON[_0xdc22('0xd')](_0x3ee84f));_0xd78cce[_0xdc22('0x13')]();}}function _0x391e6e(_0x2fa8ac){try{if(_0x2fa8ac){var _0x4a9904=JSON[_0xdc22('0x14')](_0x2fa8ac);switch(_0x4a9904['status']){case 0x0:if(_0x4a9904[_0xdc22('0x15')]){if(_0x4a9904['result']['final']){logger[_0xdc22('0x9')](_0xdc22('0x16'),JSON['stringify'](_0x4a9904[_0xdc22('0x15')][_0xdc22('0x17')]));_0x5e590a=_0x4a9904[_0xdc22('0x15')][_0xdc22('0x17')][0x0][_0xdc22('0x18')];_0x23e40c=_0x4a9904[_0xdc22('0x15')][_0xdc22('0x17')][0x0][_0xdc22('0x19')];_0x51659f='0';_0x25ba4e=_0xdc22('0x1a');_0xd78cce[_0xdc22('0x13')]();}}break;case 0x1:logger[_0xdc22('0x9')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x51659f='1';_0x25ba4e=_0xdc22('0x6');break;case 0x2:logger[_0xdc22('0x9')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x51659f='2';_0x25ba4e=_0xdc22('0x1b');break;case 0x9:logger[_0xdc22('0x9')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x51659f='9';_0x25ba4e='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xdc22('0x1c'));_0x51659f='10';_0x25ba4e='Authentication\x20failed.';break;case 0xb:logger['info'](_0xdc22('0x1d'));_0x51659f='11';_0x25ba4e=_0xdc22('0x1d');}}}catch(_0x5970b6){logger['error'](_0xdc22('0x1e'),JSON[_0xdc22('0xd')](_0x5970b6));_0xd78cce[_0xdc22('0x13')]();}}function _0x1efe94(){logger[_0xdc22('0x9')]('Close\x20Tilde\x20ASR\x20socket');_0x44eac3({'transcript':_0x5e590a,'confidence':_0x23e40c,'status':_0x51659f,'status_message':_0x25ba4e});}function _0x265508(_0x2b8fcf){logger[_0xdc22('0x11')](_0xdc22('0x1f'));if(!_[_0xdc22('0x20')](_0x2b8fcf)){logger[_0xdc22('0x11')](_[_0xdc22('0x21')](_0x2b8fcf)?JSON['stringify'](_0x2b8fcf):_0x2b8fcf);}}_0xd78cce['on'](_0xdc22('0x22'),_0x1d5acb);_0xd78cce['on'](_0xdc22('0x23'),_0x391e6e);_0xd78cce['on'](_0xdc22('0x24'),_0x1efe94);_0xd78cce['on'](_0xdc22('0x11'),_0x265508);});}; \ No newline at end of file +var _0xae3e=['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.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','lodash','moment','crypto','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','unix','send','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','stringify','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x4216b6,_0x74db48){var _0x3ef522=function(_0x3c2625){while(--_0x3c2625){_0x4216b6['push'](_0x4216b6['shift']());}};_0x3ef522(++_0x74db48);}(_0xae3e,0x17e));var _0xeae3=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0xae3e[_0x87506e];return _0x5496a4;};'use strict';var BPromise=require(_0xeae3('0x0'));var _=require(_0xeae3('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xeae3('0x2'));var crypto=require(_0xeae3('0x3'));var logger=require('../../../../../../config/logger')('agi');module[_0xeae3('0x4')]=function(_0x51b469,_0x5d1327,_0x1e3a15,_0xb59b48){return new BPromise(function(_0x28d1b5,_0x9b3ec9){logger[_0xeae3('0x5')](_0xeae3('0x6'),_0xb59b48||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x4273ee=new WebSocket(_0xb59b48||_0xeae3('0x7'),{'perMessageDeflate':![]});var _0x4a6556='';var _0x3978e0='0';var _0x53e51c='1';var _0x5c89ab=_0xeae3('0x8');function _0x40dcf8(_0xa91f9b){var _0x6312ee=crypto[_0xeae3('0x9')](_0xeae3('0xa'));_0x6312ee[_0xeae3('0xb')](_0xa91f9b);return _0x6312ee[_0xeae3('0xc')](_0xeae3('0xd'));}function _0x185805(){try{logger[_0xeae3('0x5')]('Open\x20Tilde\x20ASR\x20socket');var _0x260479=moment()[_0xeae3('0xe')]();var _0x924ca5=_0x40dcf8(_0x260479+_0x5d1327+_0x1e3a15);_0x4273ee[_0xeae3('0xf')](JSON['stringify']({'appID':_0x5d1327,'timestamp':_0x260479,'appKey':_0x924ca5}));var _0x41dec0=fs['createReadStream'](_0x51b469);_0x41dec0['on'](_0xeae3('0x10'),function(_0x158aaa){_0x4273ee[_0xeae3('0xf')](_0x158aaa);});_0x41dec0['on'](_0xeae3('0x11'),function(){_0x4273ee['send'](_0xeae3('0x12'));});}catch(_0x3f5fc4){logger[_0xeae3('0x13')](_0xeae3('0x14'),JSON[_0xeae3('0x15')](_0x3f5fc4));_0x4273ee[_0xeae3('0x16')]();}}function _0x57a5b5(_0x1ab09c){try{if(_0x1ab09c){var _0x4132bb=JSON[_0xeae3('0x17')](_0x1ab09c);switch(_0x4132bb['status']){case 0x0:if(_0x4132bb[_0xeae3('0x18')]){if(_0x4132bb[_0xeae3('0x18')][_0xeae3('0x19')]){logger[_0xeae3('0x5')](_0xeae3('0x1a'),JSON[_0xeae3('0x15')](_0x4132bb['result']['hypotheses']));_0x4a6556=_0x4132bb[_0xeae3('0x18')][_0xeae3('0x1b')][0x0][_0xeae3('0x1c')];_0x3978e0=_0x4132bb[_0xeae3('0x18')][_0xeae3('0x1b')][0x0][_0xeae3('0x1d')];_0x53e51c='0';_0x5c89ab=_0xeae3('0x1e');_0x4273ee[_0xeae3('0x16')]();}}break;case 0x1:logger[_0xeae3('0x5')](_0xeae3('0x8'));_0x53e51c='1';_0x5c89ab=_0xeae3('0x8');break;case 0x2:logger[_0xeae3('0x5')](_0xeae3('0x1f'));_0x53e51c='2';_0x5c89ab='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xeae3('0x5')](_0xeae3('0x20'));_0x53e51c='9';_0x5c89ab='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xeae3('0x5')](_0xeae3('0x21'));_0x53e51c='10';_0x5c89ab=_0xeae3('0x21');break;case 0xb:logger[_0xeae3('0x5')](_0xeae3('0x22'));_0x53e51c='11';_0x5c89ab=_0xeae3('0x22');}}}catch(_0x19db71){logger[_0xeae3('0x13')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xeae3('0x15')](_0x19db71));_0x4273ee[_0xeae3('0x16')]();}}function _0x38ea65(){logger[_0xeae3('0x5')](_0xeae3('0x23'));_0x28d1b5({'transcript':_0x4a6556,'confidence':_0x3978e0,'status':_0x53e51c,'status_message':_0x5c89ab});}function _0xe6a853(_0x7bb9a2){logger[_0xeae3('0x13')](_0xeae3('0x24'));if(!_[_0xeae3('0x25')](_0x7bb9a2)){logger[_0xeae3('0x13')](_[_0xeae3('0x26')](_0x7bb9a2)?JSON['stringify'](_0x7bb9a2):_0x7bb9a2);}}_0x4273ee['on'](_0xeae3('0x27'),_0x185805);_0x4273ee['on'](_0xeae3('0x28'),_0x57a5b5);_0x4273ee['on'](_0xeae3('0x11'),_0x38ea65);_0x4273ee['on'](_0xeae3('0x13'),_0xe6a853);});}; \ 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..da574ce 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 _0xf8e4=['./asr','exports'];(function(_0x2f6915,_0x27305f){var _0x4ea8af=function(_0x2b4935){while(--_0x2b4935){_0x2f6915['push'](_0x2f6915['shift']());}};_0x4ea8af(++_0x27305f);}(_0xf8e4,0xf2));var _0x4f8e=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0xf8e4[_0x2bf888];return _0x3038d6;};var asr=require(_0x4f8e('0x0'));module[_0x4f8e('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 045624e..e882290 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 _0xd691=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','exports','util','net','events','./error','./channel','error','E_AGI_ARGUMENT_PORT','createServer','listen','emit','listening','connection'];(function(_0x249a35,_0x2b5ddc){var _0x2588b5=function(_0x48b0f5){while(--_0x48b0f5){_0x249a35['push'](_0x249a35['shift']());}};_0x2588b5(++_0x2b5ddc);}(_0xd691,0xe6));var _0x1d69=function(_0xb260f8,_0xc008c5){_0xb260f8=_0xb260f8-0x0;var _0x63096d=_0xd691[_0xb260f8];return _0x63096d;};'use strict';var util=require(_0x1d69('0x0'));var net=require(_0x1d69('0x1'));var EventEmitter=require(_0x1d69('0x2'))['EventEmitter'];var AGIError=require(_0x1d69('0x3'));var AGIChannel=require(_0x1d69('0x4'));var AGIServer=function(_0x32502d,_0x3dc1c9,_0x1fbb5e){var _0x2228be=this,_0x32502d=_0x32502d||0x11dd,_0x3dc1c9=_0x3dc1c9||'127.0.0.1',_0xdbf1f2=null,_0x3b36f5=0x0;EventEmitter['call'](_0x2228be);function _0x267da3(){if(!_0x32502d){_0x2228be['emit'](_0x1d69('0x5'),new AGIError(_0x1d69('0x6')));return![];}_0xdbf1f2=net[_0x1d69('0x7')]();_0xdbf1f2[_0x1d69('0x8')](_0x32502d,_0x3dc1c9);_0xdbf1f2['on']('listening',function(){_0x2228be[_0x1d69('0x9')](_0x1d69('0xa'));});_0xdbf1f2['on'](_0x1d69('0xb'),function(_0x2aa023){_0xdbf1f2[_0x1d69('0xc')](function(_0x5d2092,_0x5d1c82){if(_0x5d2092){_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0xd'),_0x5d2092));}else if(_0x1fbb5e&&_0x1fbb5e<0x0){_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0xe')));_0x2aa023[_0x1d69('0xf')]();}else if(_0x1fbb5e&&_0x1fbb5e>0x0&&_0x1fbb5e<_0x5d1c82){_0x3b36f5+=0x1;_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0x10'),_0x3b36f5));_0x2aa023[_0x1d69('0xf')]();}else{var _0x1f4271=new AGIChannel(_0x2aa023);_0x1f4271['on'](_0x1d69('0x11'),function(){_0x2228be['emit']('connection',_0x1f4271);});}});});_0xdbf1f2['on'](_0x1d69('0x5'),function(_0x3fb5d2){_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0xd'),_0x3fb5d2[_0x1d69('0x12')]));});_0xdbf1f2['on']('close',function(){_0x2228be[_0x1d69('0x9')](_0x1d69('0x13'),new AGIError(_0x1d69('0x14')));});}process['nextTick'](function(){_0x267da3();});};util['inherits'](AGIServer,EventEmitter);module[_0x1d69('0x15')]=function(_0x281ab6,_0x1696c4,_0x57bb5d){return new AGIServer(_0x281ab6,_0x1696c4,_0x57bb5d);}; \ No newline at end of file +var _0x0e85=['createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','EventEmitter','./error','call','emit','error','E_AGI_ARGUMENT_PORT'];(function(_0x2b7e89,_0x4e4767){var _0x1d6895=function(_0x12a382){while(--_0x12a382){_0x2b7e89['push'](_0x2b7e89['shift']());}};_0x1d6895(++_0x4e4767);}(_0x0e85,0x7c));var _0x50e8=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0x0e85[_0x42bc91];return _0x3f5507;};'use strict';var util=require(_0x50e8('0x0'));var net=require(_0x50e8('0x1'));var EventEmitter=require('events')[_0x50e8('0x2')];var AGIError=require(_0x50e8('0x3'));var AGIChannel=require('./channel');var AGIServer=function(_0x55cba3,_0x4ce6cd,_0x236cf3){var _0x4e90e7=this,_0x55cba3=_0x55cba3||0x11dd,_0x4ce6cd=_0x4ce6cd||'127.0.0.1',_0xe3151e=null,_0xfde42=0x0;EventEmitter[_0x50e8('0x4')](_0x4e90e7);function _0x108edc(){if(!_0x55cba3){_0x4e90e7[_0x50e8('0x5')](_0x50e8('0x6'),new AGIError(_0x50e8('0x7')));return![];}_0xe3151e=net[_0x50e8('0x8')]();_0xe3151e['listen'](_0x55cba3,_0x4ce6cd);_0xe3151e['on'](_0x50e8('0x9'),function(){_0x4e90e7[_0x50e8('0x5')](_0x50e8('0x9'));});_0xe3151e['on'](_0x50e8('0xa'),function(_0x154b9e){_0xe3151e[_0x50e8('0xb')](function(_0x45dc6f,_0x3d25ea){if(_0x45dc6f){_0x4e90e7['emit']('error',new AGIError(_0x50e8('0xc'),_0x45dc6f));}else if(_0x236cf3&&_0x236cf3<0x0){_0x4e90e7[_0x50e8('0x5')]('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x154b9e[_0x50e8('0xd')]();}else if(_0x236cf3&&_0x236cf3>0x0&&_0x236cf3<_0x3d25ea){_0xfde42+=0x1;_0x4e90e7[_0x50e8('0x5')](_0x50e8('0x6'),new AGIError(_0x50e8('0xe'),_0xfde42));_0x154b9e['destroy']();}else{var _0x18596f=new AGIChannel(_0x154b9e);_0x18596f['on'](_0x50e8('0xf'),function(){_0x4e90e7[_0x50e8('0x5')]('connection',_0x18596f);});}});});_0xe3151e['on']('error',function(_0x30a872){_0x4e90e7[_0x50e8('0x5')](_0x50e8('0x6'),new AGIError(_0x50e8('0xc'),_0x30a872[_0x50e8('0x10')]));});_0xe3151e['on'](_0x50e8('0x11'),function(){_0x4e90e7['emit']('close',new AGIError(_0x50e8('0x12')));});}process[_0x50e8('0x13')](function(){_0x108edc();});};util[_0x50e8('0x14')](AGIServer,EventEmitter);module[_0x50e8('0x15')]=function(_0x5dae4e,_0x90c54c,_0x1a451d){return new AGIServer(_0x5dae4e,_0x90c54c,_0x1a451d);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index bb53417..42c75de 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 _0x9bde=['dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','audiofile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','operation','math\x20%s','isArray','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','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:','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','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','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','shellCommand','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','split','length','replaceAll','getAndSetVariable','result','extra','setVariable','isConfigured','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set'];(function(_0x3c281b,_0x16dabf){var _0x4a7287=function(_0x3c89b9){while(--_0x3c89b9){_0x3c281b['push'](_0x3c281b['shift']());}};_0x4a7287(++_0x16dabf);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3ca371,_0x52f3a3){_0x3ca371=_0x3ca371-0x0;var _0xf66b62=_0x9bde[_0x3ca371];return _0xf66b62;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xe9bd('0x0'));var _=require('lodash');var sh=require(_0xe9bd('0x1'));var odbc=require('odbc')();var rs=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var rp=require(_0xe9bd('0x5'));var logger=require(_0xe9bd('0x6'))(_0xe9bd('0x7'));var config=require(_0xe9bd('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xe9bd('0x9');var recursiveMapAttributes=[_0xe9bd('0xa'),_0xe9bd('0xb')];var verticesWithRetry=[_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe')];var AGIVertices=function(_0x29bc2b,_0xbefddb,_0x439abc){this[_0xe9bd('0xf')]=_0x29bc2b;this['rpc']=_0xbefddb;this['mailRpc']=_0x439abc;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x11')]=function(_0x2601ac,_0x581ab9){this[_0xe9bd('0x12')][_0xe9bd('0x13')](_0x2601ac)[_0xe9bd('0x14')](function(_0x141587){_0x581ab9(null,_0x141587?_0x141587['name']:![]);})[_0xe9bd('0x15')](function(_0x4ac319){_0x581ab9(_0x4ac319);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16')]=function(_0x3435b4,_0x51109f){this['rpc'][_0xe9bd('0x17')](_0x3435b4)[_0xe9bd('0x14')](function(_0x3a9e5f){_0x51109f(null,_0x3a9e5f?_0x3a9e5f[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x389e7b){_0x51109f(_0x389e7b);});};AGIVertices[_0xe9bd('0x10')]['getSquareProject']=function(_0x1d11a0,_0x464a1b){this[_0xe9bd('0x12')]['getSquareProjectById'](_0x1d11a0)[_0xe9bd('0x14')](function(_0x3bae08){_0x464a1b(null,_0x3bae08?_0x3bae08[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5cf674){_0x464a1b(_0x5cf674);});};AGIVertices[_0xe9bd('0x10')]['getSquareOdbc']=function(_0xc6b661,_0x55b869){this[_0xe9bd('0x12')][_0xe9bd('0x19')](_0xc6b661)[_0xe9bd('0x14')](function(_0x3dda13){_0x55b869(null,_0x3dda13?_0x3dda13[_0xe9bd('0x1a')]:![]);})[_0xe9bd('0x15')](function(_0x6593ce){_0x55b869(_0x6593ce);});};AGIVertices['prototype'][_0xe9bd('0x1b')]=function(_0x28cd17,_0x4ecaf5){this[_0xe9bd('0x12')]['getUserById'](_0x28cd17)[_0xe9bd('0x14')](function(_0x1b9cc9){_0x4ecaf5(null,_0x1b9cc9?_0x1b9cc9[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5bc4bf){_0x4ecaf5(_0x5bc4bf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1c')]=function(_0x2c9a57,_0x39b206){this[_0xe9bd('0x12')][_0xe9bd('0x1d')](_0x2c9a57)[_0xe9bd('0x14')](function(_0x43ea90){_0x39b206(null,_0x43ea90?_0x43ea90[_0xe9bd('0x18')]:![]);})['catch'](function(_0x3c211a){_0x39b206(_0x3c211a);});};AGIVertices[_0xe9bd('0x10')]['getSound']=function(_0x3b13b7,_0xc25248){var _0x119672=this;this[_0xe9bd('0x12')][_0xe9bd('0x1e')](_0x3b13b7)[_0xe9bd('0x14')](function(_0x519f48){_0xc25248(null,_0x519f48?_0x119672['getSoundPath'](_0x519f48[_0xe9bd('0x1f')]):![]);})['catch'](function(_0xa45eb0){_0xc25248(_0xa45eb0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x20')]=function(_0x36aa80,_0x4057df){this['rpc']['getMailAccountById'](_0x36aa80)[_0xe9bd('0x14')](function(_0x3b6682){_0x4057df(null,_0x3b6682?_0x3b6682:![]);})[_0xe9bd('0x15')](function(_0x3081f3){_0x4057df(_0x3081f3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x21')]=function(_0x3c31ee,_0x66213a,_0x45703e){this['mailRpc'][_0xe9bd('0x21')](_0x3c31ee,_0x66213a)[_0xe9bd('0x14')](function(){_0x45703e(null);})[_0xe9bd('0x15')](function(_0x5117bc){_0x45703e(_0x5117bc);});};AGIVertices['prototype'][_0xe9bd('0x22')]=function(_0x2e9593,_0x601649){this[_0xe9bd('0x12')][_0xe9bd('0x23')](_0x2e9593)[_0xe9bd('0x14')](function(_0x1e50ac){if(_0x1e50ac){if(_0x1e50ac[_0xe9bd('0x24')]){_0x601649(null,[_0x1e50ac[_0xe9bd('0x25')]]);}else{_0x601649(null,_[_0xe9bd('0x26')](_0x1e50ac[_0xe9bd('0x27')],_0xe9bd('0x25')));}}else{_0x601649(null,![]);}})[_0xe9bd('0x15')](function(_0x199477){_0x601649(_0x199477);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x28')]=function(_0x264ba0){return util[_0xe9bd('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x264ba0);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x2a')]=function(_0x56b4a5,_0x404a7d,_0x264c87){odbc['open'](_0x56b4a5,function(_0x4b1da0){if(_0x4b1da0){logger[_0xe9bd('0x2b')](_0xe9bd('0x2c'),_0x4b1da0);_0x264c87(_0x4b1da0);}else{logger['info'](_0xe9bd('0x2d'));odbc[_0xe9bd('0x2e')](_0x404a7d,function(_0x14927c,_0x5b894a){if(_0x14927c){logger[_0xe9bd('0x2f')]('Error\x20executing\x20query\x20%s',_0x404a7d);_0x264c87(_0x14927c);}else{logger[_0xe9bd('0x2f')](_0xe9bd('0x30'),_0x404a7d);odbc[_0xe9bd('0x31')](function(_0x1366f2){if(_0x1366f2){logger['error'](_0xe9bd('0x32'),_0x1366f2);}_0x264c87(null,_0x5b894a);});}});}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x33')]=function(_0x3f1212,_0x253359){this[_0xe9bd('0x12')][_0xe9bd('0x34')](_0x3f1212)[_0xe9bd('0x14')](function(_0x2b5a71){_0x253359(null,_0x2b5a71?_0x2b5a71:![]);})[_0xe9bd('0x15')](function(_0x4e8565){_0x253359(_0x4e8565);});};AGIVertices['prototype'][_0xe9bd('0x35')]=function(_0x499e13,_0x4608a0){this[_0xe9bd('0x12')][_0xe9bd('0x35')](_0x499e13)['then'](function(_0x1ba613){_0x4608a0(null,_0x1ba613);})[_0xe9bd('0x15')](function(_0x1a2d94){_0x4608a0(_0x1a2d94);});};AGIVertices['prototype'][_0xe9bd('0x36')]=function(_0x3a5703,_0x2b3cd7,_0x388132){this[_0xe9bd('0x12')][_0xe9bd('0x36')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'node':_0x3a5703[_0xe9bd('0x38')],'application':_0x3a5703[_0xe9bd('0x39')],'data':_0x2b3cd7||null,'project_name':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'callerid':this[_0xe9bd('0xf')][_0xe9bd('0x3b')]})[_0xe9bd('0x14')](function(_0x5b70d3){if(_0x388132){_0x388132(null,_0x5b70d3);}})['catch'](function(_0x283e67){if(_0x388132){_0x388132(_0x283e67);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x3c')]=function(_0x58828b,_0x594e80,_0x43cf7d,_0x3f6f22){this[_0xe9bd('0x12')][_0xe9bd('0x3c')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'callerid':this[_0xe9bd('0xf')]['callerid'],'calleridname':this[_0xe9bd('0xf')]['calleridname'],'context':this[_0xe9bd('0xf')][_0xe9bd('0x3d')],'extension':this[_0xe9bd('0xf')][_0xe9bd('0x3e')],'priority':this[_0xe9bd('0xf')]['priority'],'accountcode':this[_0xe9bd('0xf')][_0xe9bd('0x3f')],'dnid':this[_0xe9bd('0xf')]['dnid'],'projectName':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'saveName':_0x594e80,'filename':_0x58828b[_0xe9bd('0x40')]||_0x594e80,'savePath':_0x43cf7d})['then'](function(_0x28d2ea){_0x3f6f22(null,_0x28d2ea);})[_0xe9bd('0x15')](function(_0x2e634d){_0x3f6f22(_0x2e634d);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x41')]=function(_0x579d26,_0x3f4833,_0x4b8ff9){this[_0xe9bd('0x12')][_0xe9bd('0x41')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'body':_0x579d26,'direction':_0x3f4833})[_0xe9bd('0x14')](function(_0x4944e3){if(_0x4b8ff9){_0x4b8ff9(null,_0x4944e3);}})[_0xe9bd('0x15')](function(_0x485e95){if(_0x4b8ff9){_0x4b8ff9(_0x485e95);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x42')]=function(_0x5e08ae,_0x59d5cb){this[_0xe9bd('0x12')]['createCmContact']({'firstName':_[_0xe9bd('0x43')](_0x5e08ae['name'])||_[_0xe9bd('0x44')](_0x5e08ae[_0xe9bd('0x18')])?'callback_'+Math[_0xe9bd('0x45')]():_0x5e08ae['name'],'lastName':_[_0xe9bd('0x43')](_0x5e08ae[_0xe9bd('0x46')])||_[_0xe9bd('0x44')](_0x5e08ae['lastName'])?null:_0x5e08ae[_0xe9bd('0x46')],'phone':_0x5e08ae[_0xe9bd('0x47')],'ListId':_0x5e08ae[_0xe9bd('0x48')],'scheduledAt':_0x5e08ae[_0xe9bd('0x49')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xe9bd('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x5e08ae[_0xe9bd('0x49')][_0xe9bd('0x4b')](),'priority':_0x5e08ae[_0xe9bd('0x4c')]})[_0xe9bd('0x14')](function(_0x159f68){_0x59d5cb(null,_0x159f68);})[_0xe9bd('0x15')](function(_0x373057){_0x59d5cb(_0x373057);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4d')]=function(_0x3be526,_0x1fd5bf){this[_0xe9bd('0x12')]['getPauseById'](_0x3be526)['then'](function(_0x566dd8){_0x1fd5bf(null,_0x566dd8?_0x566dd8[_0xe9bd('0x18')]:![]);})['catch'](function(_0x2c4ca7){_0x1fd5bf(_0x2c4ca7);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4e')]=function(_0x6232e5,_0x1c9328,_0xaf6ffd){var _0x3bb2ba={'role':_0xe9bd('0x4f')};_0x3bb2ba[_0x6232e5]=this[_0xe9bd('0xf')]['callerid'];this[_0xe9bd('0x12')][_0xe9bd('0x4e')](_0x3bb2ba,_0x1c9328,this[_0xe9bd('0xf')][_0xe9bd('0x37')])['then'](function(_0x1c8765){_0xaf6ffd(null,_[_0xe9bd('0x44')](_0x1c8765)?![]:!![]);})[_0xe9bd('0x15')](function(_0x4e05f0){logger[_0xe9bd('0x2b')](_0x4e05f0);_0xaf6ffd(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x50')]=function(_0xfe82f7,_0x4ee26a){var _0x4b3447={'role':_0xe9bd('0x4f')};_0x4b3447[_0xfe82f7]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this[_0xe9bd('0x12')]['agentUnpause'](_0x4b3447)['then'](function(_0x305efa){_0x4ee26a(null,_[_0xe9bd('0x44')](_0x305efa)?![]:!![]);})[_0xe9bd('0x15')](function(_0x3ba881){logger[_0xe9bd('0x2b')](_0x3ba881);_0x4ee26a(null,![]);});};AGIVertices[_0xe9bd('0x10')]['agentLogout']=function(_0x179c8d,_0x5681ab){var _0x27e07c={'role':_0xe9bd('0x4f')};_0x27e07c[_0x179c8d]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this['rpc'][_0xe9bd('0x51')](_0x27e07c)[_0xe9bd('0x14')](function(_0x3b0190){_0x5681ab(null,_['isNil'](_0x3b0190)?![]:!![]);})[_0xe9bd('0x15')](function(_0x1a9d0c){logger[_0xe9bd('0x2b')](_0x1a9d0c);_0x5681ab(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x52')]=function(_0x16b66c,_0x3a626d){var _0x336222={'role':_0xe9bd('0x4f')};_0x336222[_0x16b66c]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];var _0x37d07a=_0x16b66c!='internal'?util[_0xe9bd('0x29')](_0xe9bd('0x53'),'LOCAL',this[_0xe9bd('0xf')][_0xe9bd('0x3b')]):undefined;this['rpc']['agentLogin'](_0x336222,_0x37d07a)[_0xe9bd('0x14')](function(_0x4190f0){_0x3a626d(null,_['isNil'](_0x4190f0)?![]:!![]);})['catch'](function(_0x4a6422){logger[_0xe9bd('0x2b')](_0x4a6422);_0x3a626d(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x4b5bfb,_0x4bcf2b){sh[_0xe9bd('0x54')](_[_0xe9bd('0x55')](_0x4b5bfb),function(_0x2ed5f2,_0x4947b0){var _0x3d4dd1=_0x4947b0[_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'');_0x4bcf2b(null,_0x3d4dd1);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x57')]=function(_0x5dc598,_0x2656e9){scripts[_0xe9bd('0x57')](_0x5dc598[_0xe9bd('0x58')],_0x5dc598['google_cloud_tts_text_type']||'text',_0x5dc598[_0xe9bd('0x59')],_0x5dc598[_0xe9bd('0x5a')]||_0xe9bd('0x5b'),_0x5dc598[_0xe9bd('0x5c')]||_0xe9bd('0x5d'),_0x5dc598[_0xe9bd('0x5e')]||_0xe9bd('0x5f'))[_0xe9bd('0x14')](function(_0x578e85){_0x2656e9(null,_0x578e85);})[_0xe9bd('0x15')](function(_0x35e0ca){_0x2656e9(_0x35e0ca);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x60')]=function(_0x2364fc,_0x5d7257){scripts[_0xe9bd('0x60')](_0x2364fc['text'],_0x2364fc['google_tts_language']||'en',0x1)[_0xe9bd('0x14')](function(_0x4496e3){_0x5d7257(null,_0x4496e3);})['catch'](function(_0x1a6bf9){_0x5d7257(_0x1a6bf9);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x61')]=function(_0x292faf,_0x582cf3){var _0x3c1ab9={'uri':_0x292faf[_0xe9bd('0x62')],'method':_0x292faf['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x292faf[_0xe9bd('0x63')])===_0xe9bd('0x64')&&parseInt(_0x292faf[_0xe9bd('0x63')])>=0x1?parseInt(_0x292faf[_0xe9bd('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xe9bd('0x65')]([_0xe9bd('0x66'),_0xe9bd('0x67')],_0x3c1ab9['method'][_0xe9bd('0x68')]())){try{_0x3c1ab9[_0xe9bd('0x69')]=_0x292faf[_0xe9bd('0xb')]?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xb')]):{};}catch(_0x8f51aa){logger[_0xe9bd('0x2b')](_0xe9bd('0x6b'),_0x8f51aa);}}try{_0x3c1ab9[_0xe9bd('0x6c')]=_0x292faf['rawHeaders']?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xa')]):{};}catch(_0x256890){logger[_0xe9bd('0x2b')](_0xe9bd('0x6d'),_0x256890);}if(_0x292faf[_0xe9bd('0x6e')]){try{var _0x1bad42=require(_0x292faf['computedVariables'])[_0xe9bd('0x6f')](this,_0x3c1ab9);_0x3c1ab9[_0xe9bd('0x70')]=Mustache['render'](_0x292faf[_0xe9bd('0x62')],_0x1bad42,{},['$$','$$']);if(_0x3c1ab9[_0xe9bd('0x6c')]){_0x3c1ab9[_0xe9bd('0x6c')]=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x6c')]),_0x1bad42,{},['$$','$$']));}if(_0x3c1ab9['body']){_0x3c1ab9['body']=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x69')]),_0x1bad42,{},['$$','$$']));}}catch(_0x449175){logger[_0xe9bd('0x2b')](_0xe9bd('0x73'),_0x449175);}}rp(_0x3c1ab9)['then'](function(_0x35390a){var _0x44f47e={'statusCode':_0x35390a[_0xe9bd('0x74')]||0xc8,'statusMessage':_0x35390a[_0xe9bd('0x75')]||'OK','headers':_0x35390a[_0xe9bd('0x6c')]||{},'body':_0x35390a[_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x44f47e);})[_0xe9bd('0x15')](function(_0x4bbeef){var _0x55aacf={'statusCode':_0x4bbeef['statusCode']||0x1f4,'statusMessage':_0x4bbeef[_0xe9bd('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4bbeef['options']['headers']||{},'body':_0x4bbeef[_0xe9bd('0x77')][_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x55aacf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x78')]=function(_0xd8a604,_0x3bc2f2){scripts[_0xe9bd('0x78')](this[_0xe9bd('0xf')][_0xe9bd('0x37')],_0xd8a604['key'],_0xd8a604[_0xe9bd('0x59')],_0xd8a604['dialogflow_language']||'en')[_0xe9bd('0x14')](function(_0x433a98){_0x3bc2f2(null,_0x433a98);})[_0xe9bd('0x15')](function(_0x6fff03){_0x3bc2f2(_0x6fff03);});};AGIVertices[_0xe9bd('0x10')]['sestekNDA']=function(_0x5b14e5,_0x56d4eb){scripts[_0xe9bd('0x79')](this[_0xe9bd('0xf')],_0x5b14e5)['then'](function(_0x3c7875){_0x56d4eb(null,_0x3c7875);})[_0xe9bd('0x15')](function(_0x2bf2f0){_0x56d4eb(_0x2bf2f0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7a')]=function(_0x58c1e5,_0x821505){scripts[_0xe9bd('0x7a')](_0x58c1e5[_0xe9bd('0x7b')],_0x58c1e5[_0xe9bd('0x59')],_0x58c1e5[_0xe9bd('0x7c')]||_0xe9bd('0x5b'),_0x58c1e5[_0xe9bd('0x7d')])[_0xe9bd('0x14')](function(_0x45991e){_0x821505(null,_0x45991e);})[_0xe9bd('0x15')](function(_0x5f24c8){_0x821505(_0x5f24c8);});};AGIVertices['prototype']['ispeechASR']=function(_0x5b5c35,_0x4039c7,_0x2c7ecc){scripts[_0xe9bd('0x7e')](_0x4039c7,_0x5b5c35['key'],_0x5b5c35[_0xe9bd('0x7f')]||_0xe9bd('0x5b'),this['isConfigured'](_0x5b5c35['model'])?_0x5b5c35[_0xe9bd('0x80')]:undefined)[_0xe9bd('0x14')](function(_0x2a4937){_0x2c7ecc(null,_0x2a4937);})[_0xe9bd('0x15')](function(_0x23a145){_0x2c7ecc(_0x23a145);});};AGIVertices['prototype']['awsPolly']=function(_0x499771,_0x223f56){scripts[_0xe9bd('0x81')](_0x499771[_0xe9bd('0x82')],_0x499771[_0xe9bd('0x83')],_0x499771[_0xe9bd('0x84')],_0x499771[_0xe9bd('0x85')]||_0xe9bd('0x86'),_0x499771[_0xe9bd('0x59')],_0x499771[_0xe9bd('0x87')]||_0xe9bd('0x59'))['then'](function(_0xb1203d){_0x223f56(null,_0xb1203d);})['catch'](function(_0x116815){_0x223f56(_0x116815);});};AGIVertices['prototype']['awsLex']=function(_0x423e15,_0x4a6253){scripts[_0xe9bd('0x88')](this['channel'][_0xe9bd('0x37')],_0x423e15[_0xe9bd('0x82')],_0x423e15[_0xe9bd('0x83')],_0x423e15[_0xe9bd('0x89')],_0x423e15[_0xe9bd('0x59')],_0x423e15[_0xe9bd('0x8a')])['then'](function(_0x3b97a0){_0x4a6253(null,_0x3b97a0);})[_0xe9bd('0x15')](function(_0x4ee8a3){_0x4a6253(_0x4ee8a3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8b')]=function(_0x141fe2,_0x59897b,_0x342f9e){scripts[_0xe9bd('0x8b')](_0x59897b,_0x141fe2[_0xe9bd('0x7b')],_0x141fe2[_0xe9bd('0x8c')]||_0xe9bd('0x5b'))['then'](function(_0x45021c){_0x342f9e(null,_0x45021c);})[_0xe9bd('0x15')](function(_0x591c5f){_0x342f9e(_0x591c5f);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8d')]=function(_0x396679,_0x4d9717,_0x50243f){scripts[_0xe9bd('0x8d')](_0x4d9717,_0x396679[_0xe9bd('0x8e')],_0x396679[_0xe9bd('0x8f')],_0x396679[_0xe9bd('0x70')])[_0xe9bd('0x14')](function(_0xb6582b){_0x50243f(null,_0xb6582b);})[_0xe9bd('0x15')](function(_0x56bdcd){_0x50243f(_0x56bdcd);});};AGIVertices[_0xe9bd('0x10')]['clear']=function(_0x33dcf6){var _0x3a2d9f=_[_0xe9bd('0x65')](verticesWithRetry,_0x33dcf6['agicommand'])?_0x33dcf6:_[_0xe9bd('0x90')](_0x33dcf6);for(var _0x4ae8d1 in _0x3a2d9f){if(_0x3a2d9f[_0xe9bd('0x91')](_0x4ae8d1)){if(_0x3a2d9f[_0x4ae8d1]&&_[_0xe9bd('0x92')](_0x3a2d9f[_0x4ae8d1])){if(_[_0xe9bd('0x65')](recursiveMapAttributes,_0x4ae8d1)){_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x93')](_0x3a2d9f[_0x4ae8d1]);}else{_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x94')](_0x3a2d9f[_0x4ae8d1]);}}}}return _0x3a2d9f;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x95')]=function(_0x2abd8f){for(var _0x14db25 in _0x2abd8f){if(_0x2abd8f[_0xe9bd('0x91')](_0x14db25)){if(_[_0xe9bd('0x96')](_0x2abd8f[_0x14db25])){return this['recursiveNodeIndex'](_0x2abd8f[_0x14db25]);}_0x2abd8f[_0x14db25]=this[_0xe9bd('0x94')](_0x2abd8f[_0x14db25]);}}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x97')]=function(_0x5dad5e,_0x97e5b1){for(var _0x16bcce in _0x5dad5e){if(_0x5dad5e['hasOwnProperty'](_0x16bcce)){if(_['isPlainObject'](_0x5dad5e[_0x16bcce])){if(!_['isEmpty'](_0x5dad5e[_0x16bcce])){this['saveRestApiResult'](_0x5dad5e[_0x16bcce],util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce));}}else{if(_0x5dad5e[_0x16bcce]){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce),_0x5dad5e[_0x16bcce]);}}}}};AGIVertices['prototype'][_0xe9bd('0x93')]=function(_0x35894c){try{var _0x3fed2e=JSON[_0xe9bd('0x6a')](_0x35894c);this[_0xe9bd('0x95')](_0x3fed2e);return JSON['stringify'](_0x3fed2e);}catch(_0x1fcc3a){return this[_0xe9bd('0x94')](_0x35894c);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x54ffbd){var _0x4fbbd6=_0x54ffbd[_0xe9bd('0x99')]('{');for(var _0x26b67a=0x1;_0x26b67a<_0x4fbbd6[_0xe9bd('0x9a')];_0x26b67a+=0x1){var _0xae352d=_0x4fbbd6[_0x26b67a]['split']('}');if(_0xae352d['length']>0x1){_0x54ffbd=_0x54ffbd[_0xe9bd('0x9b')]('{'+_0xae352d[0x0]+'}',this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0xae352d[0x0])['extra']||_0xae352d[0x0]);}}if(_0x4fbbd6[_0xe9bd('0x9a')]===0x1){return _0x54ffbd[_0xe9bd('0x4b')]();}return this['replaceAllVariables'](_0x54ffbd);};AGIVertices['prototype'][_0xe9bd('0x9c')]=function(_0x90b3d7,_0x346da7){var _0x3453c3=this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0x90b3d7);if(_0x3453c3[_0xe9bd('0x9d')]===-0x1){return _0x3453c3;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x346da7,_0x3453c3[_0xe9bd('0x9e')]));return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x346da7,_0x3453c3[_0xe9bd('0x9e')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa0')]=function(_0x55f0d3){return _0x55f0d3&&_0x55f0d3!=='0'&&_0x55f0d3!=='-1'&&_0x55f0d3!=='';};AGIVertices[_0xe9bd('0x10')]['maxRetry']=function(_0x13e932){this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x13e932,'-');_0x13e932[_0xe9bd('0xa1')]=_0x13e932['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7')]=function(_0x54a6c6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xa2'),_0x54a6c6[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x7')]([_0x54a6c6[_0xe9bd('0xa3')],_0x54a6c6['args']]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa4')]=function(_0x2d5601){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xa5'),_0x2d5601[_0xe9bd('0x38')]));if(this[_0xe9bd('0xa0')](_0x2d5601[_0xe9bd('0x63')])){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2d5601[_0xe9bd('0x63')]));var _0x2e1c0f=this[_0xe9bd('0xf')]['wait'](_0x2d5601[_0xe9bd('0x63')]);if(_0x2e1c0f['result']===-0x1){return _0x2e1c0f;}}return this['channel']['answer']();};AGIVertices[_0xe9bd('0x10')]['callback']=function(_0x516080){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x516080[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x516080['list_id'])){return this['channel'][_0xe9bd('0x2b')](_0x516080,'no\x20list\x20selected');}_0x516080['scheduledAt']=moment();if(this[_0xe9bd('0xa0')](_0x516080[_0xe9bd('0xa6')])){_0x516080[_0xe9bd('0x49')]=moment()[_0xe9bd('0xa7')](_0x516080[_0xe9bd('0xa6')],_0xe9bd('0xa8'));}if(!this[_0xe9bd('0xa0')](_0x516080['callback_priority'])){_0x516080[_0xe9bd('0x4c')]=0x2;}this['createCmContact']['sync'](this,_0x516080);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xaa'),_0x516080[_0xe9bd('0x47')],_0x516080['list_id'],_0x516080[_0xe9bd('0x49')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xab')]=function(_0x2a4f8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a4f8a[_0xe9bd('0x38')]));var _0x265dba=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]);if(_0x265dba['result']===-0x1){return _0x265dba;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xad'),_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]));};AGIVertices[_0xe9bd('0x10')]['lumenvoxtts']=function(_0x13b95b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xae'),_0x13b95b[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20text\x20configured');}var _0x2fa992='\x22'+_0x13b95b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x77')])){_0x2fa992+=','+_0x13b95b[_0xe9bd('0x77')];}var _0x1bda30=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xaf'),_0x2fa992);if(_0x1bda30['result']===-0x1){return _0x1bda30;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xb0'),_0x2fa992));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xb1')]=function(_0x5bf65b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb2'),_0x5bf65b['label']));if(!this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}var _0x7d2411='\x22'+_0x5bf65b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x77')])){_0x7d2411+=','+_0x5bf65b[_0xe9bd('0x77')];}var _0x5c0b2d=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xaf'),_0x7d2411);if(_0x5c0b2d['result']===-0x1){return _0x5c0b2d;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x7d2411));};AGIVertices['prototype'][_0xe9bd('0xb4')]=function(_0x183071){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb5'),_0x183071[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x183071['grammar'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20grammar\x20configured');}var _0x767a44=_0x183071[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0x183071[_0xe9bd('0x77')])){_0x767a44+=','+_0x183071[_0xe9bd('0x77')];}var _0x142907=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xb7'),_0x767a44);if(_0x142907[_0xe9bd('0x9d')]===-0x1){return _0x142907;}var _0x38ce72=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),_0xe9bd('0xb9'));if(_0x38ce72[_0xe9bd('0x9d')]===-0x1){return _0x38ce72;}var _0x58f68a=this[_0xe9bd('0x9c')](_0xe9bd('0xba'),_0xe9bd('0xbb'));if(_0x58f68a[_0xe9bd('0x9d')]===-0x1){return _0x58f68a;}var _0x217eff=this['getAndSetVariable'](_0xe9bd('0xbc'),_0xe9bd('0xbd'));if(_0x217eff[_0xe9bd('0x9d')]===-0x1){return _0x217eff;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x767a44));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xbf')]=function(_0xab57a8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xc0'),_0xab57a8['label']));if(!this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0xb6')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc1'));}var _0x3541d0=_0xab57a8[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0x77')])){_0x3541d0+=','+_0xab57a8[_0xe9bd('0x77')];}var _0xad2195=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xb7'),_0x3541d0);if(_0xad2195[_0xe9bd('0x9d')]===-0x1){return _0xad2195;}var _0x62dd82=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),'SESTEK_ASR_CONFIDENCE');if(_0x62dd82[_0xe9bd('0x9d')]===-0x1){return _0x62dd82;}var _0x43579b=this[_0xe9bd('0x9c')]('RECOG_INPUT()',_0xe9bd('0xc2'));if(_0x43579b[_0xe9bd('0x9d')]===-0x1){return _0x43579b;}var _0x496640=this['getAndSetVariable']('RECOG_INSTANCE()',_0xe9bd('0xc3'));if(_0x496640[_0xe9bd('0x9d')]===-0x1){return _0x496640;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x3541d0));};AGIVertices['prototype'][_0xe9bd('0xc4')]=function(_0x3445f6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3445f6[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3445f6['odbc_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc5'));}var _0x33d5cb=this['getSquareOdbc']['sync'](this,_0x3445f6['odbc_id']);if(!_0x33d5cb){return this[_0xe9bd('0xf')]['error'](_0x3445f6,_0xe9bd('0xc6'));}if(!this[_0xe9bd('0xa0')](_0x3445f6[_0xe9bd('0x2e')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc7'));}var _0x53b73c=_0x3445f6[_0xe9bd('0x2e')][_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xc8'),_0x53b73c));var _0x25def7=this['getQueryOdbc'][_0xe9bd('0x6f')](this,_0x33d5cb,_0x53b73c);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3445f6,_0x53b73c);if(!this[_0xe9bd('0xa0')](_0x3445f6['variable_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x152070=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3445f6[_0xe9bd('0xca')]);if(!_0x152070){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xcb'));}var _0x3cfa05=this;_0x25def7[_0xe9bd('0xcc')](function(_0x11a03d,_0x4eeb96){Object[_0xe9bd('0xcd')](_0x11a03d)[_0xe9bd('0xcc')](function(_0x571328){_0x3cfa05[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s][%s]',_0x152070,_0x4eeb96,_0x571328),_0x11a03d[_0x571328]);});});this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xce'),_0x152070),_0x25def7['length']);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xcf'),_0x152070));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xd0')]=function(_0x58f73d){logger[_0xe9bd('0xd1')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x58f73d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x58f73d[_0xe9bd('0xd2')])){return this['channel'][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd3'));}var _0x5e60b0=this[_0xe9bd('0x1b')][_0xe9bd('0x6f')](this,_0x58f73d[_0xe9bd('0xd2')]);if(!_0x5e60b0){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd4'));}var _0x1d94e1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xd6'),_0x5e60b0),_0x58f73d[_0xe9bd('0x63')],_0x58f73d[_0xe9bd('0xd7')],_0x58f73d['url']]);if(_0x1d94e1[_0xe9bd('0x9d')]===-0x1){return _0x1d94e1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x470071){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xd9'),_0x470071['label']));if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x59')])){return this['channel']['noop'](_0xe9bd('0xb3'));}this['channel']['bot']=!![];this[_0xe9bd('0x36')](_0x470071);this[_0xe9bd('0x41')](_0x470071[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xdb'),_0x470071[_0xe9bd('0x59')]));var _0xe55ad1=this[_0xe9bd('0x78')][_0xe9bd('0x6f')](this,_0x470071);if(_0xe55ad1){for(var _0x5b44bf in _0xe55ad1){if(_0xe55ad1[_0xe9bd('0x91')](_0x5b44bf)){this['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xdc'),_0x5b44bf[_0xe9bd('0x68')]()),_0xe55ad1[_0x5b44bf]);}}this['createSquareMessage'](_0xe55ad1[_0xe9bd('0xdd')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')]['noop'](util['format'](_0xe9bd('0xdf'),_0xe55ad1[_0xe9bd('0xdd')]));}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x470071,_0xe9bd('0xe0'));};AGIVertices[_0xe9bd('0x10')]['sesteknda']=function(_0x2daedf){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xe1'),_0x2daedf['label']));if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe2')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xe3'));}if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe4')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xe5'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['password'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xe6'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['ndassistant_url'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['bot']=!![];this[_0xe9bd('0x36')](_0x2daedf);this['createSquareMessage'](_0x2daedf[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xe7'),_0x2daedf[_0xe9bd('0x59')]));var _0x103791=this[_0xe9bd('0x79')][_0xe9bd('0x6f')](this,_0x2daedf);if(_0x103791){for(var _0x53a060 in _0x103791){if(_0x103791['hasOwnProperty'](_0x53a060)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xe8'),_0x53a060[_0xe9bd('0x68')]()),_0x103791[_0x53a060]);}}this[_0xe9bd('0x41')](_0x103791[_0xe9bd('0xdd')],_0xe9bd('0xde'));if(_0x103791['audiofile']){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xe9'),_0x103791['audiofile']));var _0x3b32f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x103791['audiofile']);try{fs[_0xe9bd('0xeb')](_0x103791[_0xe9bd('0xec')]+'.wav');}catch(_0x10d9ed){logger[_0xe9bd('0x2b')](_0x10d9ed);}return _0x3b32f7;}else{return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('SestekNDA\x20Result\x20%s',_0x103791[_0xe9bd('0xdd')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x2daedf,_0xe9bd('0xed'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xee')]=function(_0x551853){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0xef'),_0x551853['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('end');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf0')]=function(_0x5a8d1a){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5a8d1a['label']));var _0x3a625d='';if(_0x5a8d1a[_0xe9bd('0xf1')]){if(!this['isConfigured'](_0x5a8d1a['trunk_id'])){return this[_0xe9bd('0xf')]['error'](_0x5a8d1a,_0xe9bd('0xf2'));}else{var _0x447743=parseInt(_0x5a8d1a['trunk_id'],0xa);if(isNaN(_0x447743)){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf1')];}else{_0x3a625d=this[_0xe9bd('0x1c')][_0xe9bd('0x6f')](this,_0x5a8d1a[_0xe9bd('0xf1')]);if(!_0x3a625d){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf3'));}}}}else if(_0x5a8d1a[_0xe9bd('0xf4')]){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf4')];}else{return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf2'));}var _0x430df1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xf5'),_0x3a625d,_0x5a8d1a[_0xe9bd('0x47')]),_0x5a8d1a['timeout'],_0x5a8d1a[_0xe9bd('0xd7')],_0x5a8d1a[_0xe9bd('0x62')]]);if(_0x430df1[_0xe9bd('0x9d')]===-0x1){return _0x430df1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf6')]=function(_0x49e80a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xf7'),_0x49e80a[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xf6'));};AGIVertices[_0xe9bd('0x10')]['getdigits']=function(_0x3e445d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3e445d[_0xe9bd('0x38')]));if(_0x3e445d[_0xe9bd('0xa1')]===0x0){return this['maxRetry'](_0x3e445d);}_0x3e445d['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x3e445d['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xf8'));}var _0x4feba7=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xfa')]);if(!_0x4feba7){return this[_0xe9bd('0xf')]['error'](_0x3e445d,_0xe9bd('0xfb'));}if(!this[_0xe9bd('0xa0')](_0x3e445d[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0xe9bd('0xc9'));}var _0x4d2675=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x4feba7,_0x3e445d[_0xe9bd('0xfd')],_0x3e445d[_0xe9bd('0xfe')]);var _0x458fe0=_0x4d2675[_0xe9bd('0x9d')]?_0x4d2675[_0xe9bd('0x9d')][_0xe9bd('0x4b')]():'';logger['info']('test',JSON[_0xe9bd('0x72')](_0x4d2675));if(_0x4d2675[_0xe9bd('0x9d')]===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);return _0x4d2675;}else if(_0x4d2675[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0[_0xe9bd('0x9a')]>=parseInt(_0x3e445d[_0xe9bd('0xff')])?'x':'i';}else{_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0['length']>=parseInt(_0x3e445d[_0xe9bd('0xff')])&&_0x458fe0[_0xe9bd('0x9a')]<=parseInt(_0x3e445d[_0xe9bd('0xfe')])?'x':'i';}var _0xd98d29=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xca')]);if(!_0xd98d29){return this['channel'][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xd98d29,_0x458fe0);if(this[_0xe9bd('0xa0')](_0x3e445d['hiddendigitsnum'])){var _0x3be5d4=parseInt(_0x3e445d[_0xe9bd('0x100')],0xa);var _0x3fd3fb=rs[_0xe9bd('0x101')]({'charset':'*','length':_0x3be5d4});var _0x333e0e=_0x458fe0['length'];if(_0x333e0e>0x0){if(_0x333e0e>_0x3be5d4){this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,_0x3e445d[_0xe9bd('0x102')]===_0xe9bd('0x103')?_0x3fd3fb+_0x458fe0[_0xe9bd('0x104')](_0x3be5d4):_0x458fe0['substr'](0x0,_0x333e0e-_0x3be5d4)+_0x3fd3fb);}else{this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3e445d,rs[_0xe9bd('0x101')]({'charset':'*','length':_0x333e0e}));}}else{this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,'');}}else{this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);}return _0x4d2675;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xe')]=function(_0x2e3595){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x105'),_0x2e3595[_0xe9bd('0x38')]));return this[_0xe9bd('0xd')](_0x2e3595);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x106')]=function(_0x3b5bca){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x107'),_0x3b5bca[_0xe9bd('0x38')]));this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3b5bca,_0x3b5bca[_0xe9bd('0x108')]);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x109'),_0x3b5bca[_0xe9bd('0x108')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x10a')]=function(_0x52d59e){logger['info'](util[_0xe9bd('0x29')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x52d59e[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x83')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x10b'));}if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10c'),_0x52d59e[_0xe9bd('0x59')]));var _0x1b346d=this['awsPolly'][_0xe9bd('0x6f')](this,_0x52d59e);if(_0x1b346d){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10d'),_0x1b346d));var _0x3e06f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x1b346d);try{fs[_0xe9bd('0xeb')](_0x1b346d+_0xe9bd('0x10e'));}catch(_0x1871eb){logger[_0xe9bd('0x2b')](_0x1871eb);}return _0x3e06f7;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x52d59e,_0xe9bd('0x10f'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x110')]=function(_0x249e3a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x249e3a[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x249e3a[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x249e3a['aws_secret_access_key'])){return this[_0xe9bd('0xf')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x249e3a['aws_bot_name'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x111'));}if(!this['isConfigured'](_0x249e3a[_0xe9bd('0x59')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0x112')]=!![];this['createSquareDetailsReport'](_0x249e3a);this['createSquareMessage'](_0x249e3a[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x113'),_0x249e3a['text']));var _0x7bf3ff=this['awsLex'][_0xe9bd('0x6f')](this,_0x249e3a);if(_0x7bf3ff){for(var _0x1c4e38 in _0x7bf3ff){if(_0x7bf3ff[_0xe9bd('0x91')](_0x1c4e38)&&_['isString'](_0x7bf3ff[_0x1c4e38])){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x114'),_0x1c4e38[_0xe9bd('0x68')]()),_0x7bf3ff[_0x1c4e38]);}}if(_[_0xe9bd('0x44')](_0x7bf3ff[_0xe9bd('0x76')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x115'));}else{this[_0xe9bd('0x41')](_0x7bf3ff[_0xe9bd('0x76')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x116'),_0x7bf3ff[_0xe9bd('0x76')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x249e3a,_0xe9bd('0x117'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x118')]=function(_0x53eb33){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x53eb33[_0xe9bd('0x38')],_0x53eb33[_0xe9bd('0x63')]));if(!this[_0xe9bd('0xa0')](_0x53eb33[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xda'));}var _0x2d7c18=_0xe9bd('0x119');var _0x27c2aa=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0xe8f186=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x27c2aa,_0x2d7c18);var _0x5564d7=!![];if(_0x53eb33[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x5564d7=![];}var _0x3b0650=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x27c2aa,_0x2d7c18,_0x53eb33[_0xe9bd('0x11e')],_0x53eb33[_0xe9bd('0x63')],undefined,_0x5564d7);if(_0x3b0650[_0xe9bd('0x9d')]!==-0x1){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x11f'),_0xe8f186));var _0x10ea33=this['googleASR'][_0xe9bd('0x6f')](this,_0x53eb33,_0xe8f186);if(_0x10ea33){for(var _0x3682d1 in _0x10ea33){if(_0x10ea33[_0xe9bd('0x91')](_0x3682d1)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x120'),_0x3682d1[_0xe9bd('0x68')]()),_0x10ea33[_0x3682d1]);}}return this['channel'][_0xe9bd('0xa9')](util['format']('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x10ea33)));}}return _0x3b0650;};AGIVertices[_0xe9bd('0x10')]['tildeasr']=function(_0x28b74b){logger['info'](util['format'](_0xe9bd('0x121'),_0x28b74b['label']));if(!this[_0xe9bd('0xa0')](_0x28b74b[_0xe9bd('0x8e')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x122'));}if(!this[_0xe9bd('0xa0')](_0x28b74b['appsecret'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x123'));}var _0x51e0b5=_0xe9bd('0x119');var _0x3c0224=util['format'](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0x44af86=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x3c0224,_0x51e0b5);var _0x53a617=!![];if(_0x28b74b['beep']===_0xe9bd('0x11c')){_0x53a617=![];}var _0x5d2b09=this['channel']['recordFile'](_0x3c0224,_0x51e0b5,_0x28b74b[_0xe9bd('0x11e')],_0x28b74b[_0xe9bd('0x63')],undefined,_0x53a617);if(_0x5d2b09[_0xe9bd('0x9d')]!==-0x1){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x124'),_0x44af86));var _0x49077e=this[_0xe9bd('0x8d')][_0xe9bd('0x6f')](this,_0x28b74b,_0x44af86);if(_0x49077e){for(var _0x95d14e in _0x49077e){if(_0x49077e['hasOwnProperty'](_0x95d14e)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('TILDE_ASR_%s',_0x95d14e[_0xe9bd('0x68')]()),_0x49077e[_0x95d14e]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x125'),JSON[_0xe9bd('0x72')](_0x49077e)));}}return _0x5d2b09;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x126')]=function(_0x550ac8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x127'),_0x550ac8[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x128')](_0x550ac8[_0xe9bd('0x3d')],_0x550ac8[_0xe9bd('0x3e')],_0x550ac8[_0xe9bd('0x129')]);};AGIVertices[_0xe9bd('0x10')]['gotoif']=function(_0x1377ec){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x12a'),_0x1377ec['label']));if(!this[_0xe9bd('0xa0')](_0x1377ec[_0xe9bd('0x12b')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1377ec,'no\x20condition\x20configured');}try{var _0x3d7f65=eval(_0x1377ec[_0xe9bd('0x12b')])?_0xe9bd('0x12c'):_0xe9bd('0x12d');this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x12e'),_0x1377ec[_0xe9bd('0x12b')],_0x3d7f65));return{'code':0xc8,'result':_0x3d7f65};}catch(_0x18aee1){return{'code':0xc8,'result':_0xe9bd('0x12d')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x12f')]=function(_0x568937){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x130'),_0x568937[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x568937[_0xe9bd('0x131')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x568937,_0xe9bd('0x132'));}var _0x5ad4a6=this['getIntervals'][_0xe9bd('0x6f')](this,_0x568937['interval_id']);if(!_0x5ad4a6){return this['channel'][_0xe9bd('0x2b')](_0x568937,'no\x20intervals\x20found');}for(var _0x122413=0x0;_0x122413<_0x5ad4a6[_0xe9bd('0x9a')];_0x122413+=0x1){var _0x3e7830=this[_0xe9bd('0xf')][_0xe9bd('0x11')](util[_0xe9bd('0x29')](_0xe9bd('0x133'),_0x5ad4a6[_0x122413]));if(_0x3e7830[_0xe9bd('0x9d')]===-0x1){return _0x3e7830;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0x3e7830[_0xe9bd('0x9e')]));if(_0x3e7830[_0xe9bd('0x9e')]===_0xe9bd('0x12c')){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('IFTIME\x20%s\x20%s',_0x5ad4a6[_0x122413],_0xe9bd('0x12c')));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'true'));return{'code':0xc8,'result':_0xe9bd('0x12c')};}else{logger['info'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0xe9bd('0x12d')));this['channel']['noop'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xe9bd('0x10')]['hangup']=function(_0x3f709e){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x135'),_0x3f709e['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x136')]();};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x137')]=function(_0x13ea8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x13ea8a['label']));if(!this['isConfigured'](_0x13ea8a['key'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}var _0x223d9b=_0xe9bd('0x119');var _0x446fe7=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs['generate'](0x4));var _0x99245c=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x446fe7,_0x223d9b);var _0x34c059=!![];if(_0x13ea8a[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x34c059=![];}var _0x510de3=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x446fe7,_0x223d9b,_0x13ea8a[_0xe9bd('0x11e')],_0x13ea8a[_0xe9bd('0x63')],undefined,_0x34c059);if(_0x510de3['result']!==-0x1){this['channel']['noop'](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x99245c));var _0x47254a=this[_0xe9bd('0x7e')][_0xe9bd('0x6f')](this,_0x13ea8a,_0x99245c);if(_0x47254a){for(var _0xb30c8f in _0x47254a){if(_0x47254a[_0xe9bd('0x91')](_0xb30c8f)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('ISPEECH_ASR_%s',_0xb30c8f[_0xe9bd('0x68')]()),_0x47254a[_0xb30c8f]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x138'),JSON[_0xe9bd('0x72')](_0x47254a)));}}return _0x510de3;};AGIVertices[_0xe9bd('0x10')]['ispeechtts']=function(_0x9766f2){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x139'),_0x9766f2[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13a'),_0x9766f2[_0xe9bd('0x59')]));var _0x293858=this[_0xe9bd('0x7a')][_0xe9bd('0x6f')](this,_0x9766f2);if(_0x293858){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x293858));var _0x3ebd5d=this[_0xe9bd('0xf')]['streamFile'](_0x293858,_0x9766f2[_0xe9bd('0x11e')]);try{fs[_0xe9bd('0xeb')](_0x293858+_0xe9bd('0x10e'));}catch(_0x148989){logger['error'](_0x148989);}return _0x3ebd5d;}return this[_0xe9bd('0xf')]['error'](_0x9766f2,_0xe9bd('0x13b'));};AGIVertices[_0xe9bd('0x10')]['login']=function(_0x143c72){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x143c72[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x143c72[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')]['error'](_0x143c72,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));var _0xe84682=this['agentLogin'][_0xe9bd('0x6f')](this,_0x143c72[_0xe9bd('0x13c')]);if(_0xe84682){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices['prototype'][_0xe9bd('0x142')]=function(_0x4ee2b7){logger['info'](util['format'](_0xe9bd('0x143'),_0x4ee2b7[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x4ee2b7[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x4ee2b7,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));var _0x48af31=this[_0xe9bd('0x51')]['sync'](this,_0x4ee2b7['findBy']);if(_0x48af31){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x145')]=function(_0x47c137){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x47c137[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x47c137[_0xe9bd('0x146')])){return this[_0xe9bd('0xf')]['error'](_0x47c137,'no\x20operation\x20configured');}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x147'),_0x47c137['operation']));var _0x4b0a01=eval(_0x47c137['operation']);if(!this['isConfigured'](_0x47c137[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x253be2=this[_0xe9bd('0x11')]['sync'](this,_0x47c137['variable_id']);if(!_0x253be2){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x47c137,_0xe9bd('0xcb'));}if(_[_0xe9bd('0x148')](_0x4b0a01)){var _0x517e1d=this;_0x4b0a01['forEach'](function(_0x5a8333,_0x3c091e){_0x517e1d['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s]',_0x253be2,_0x3c091e),_0x5a8333);});return this['channel'][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x149'),_0x253be2));}else{return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x253be2,_0x4b0a01);}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xc')]=function(_0x5482ad){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14a'),_0x5482ad[_0xe9bd('0x38')]));if(_0x5482ad[_0xe9bd('0xa1')]===0x0){return this[_0xe9bd('0x14b')](_0x5482ad);}_0x5482ad['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x5482ad['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xf8'));}var _0x2b5eaa=this['getSound'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xfa')]);if(!_0x2b5eaa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,'no\x20file\x20audio\x20found');}var _0xf9e1e2=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x2b5eaa,_0x5482ad['response'],_0x5482ad[_0xe9bd('0x14c')]);var _0x2ce47d=_0xf9e1e2[_0xe9bd('0x9d')];if(_0xf9e1e2['result']===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,'-1');return _0xf9e1e2;}else if(_0xf9e1e2[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0xf9e1e2[_0xe9bd('0x9d')]=_0xf9e1e2[_0xe9bd('0x9d')][_0xe9bd('0x9a')]>0x0?_0xf9e1e2['result']:'t';}else if(_['isEmpty'](_0xf9e1e2[_0xe9bd('0x9d')])){_0xf9e1e2[_0xe9bd('0x9d')]='#';_0x2ce47d='#';}if(!this[_0xe9bd('0xa0')](_0x5482ad['variable_id'])){this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}else{var _0x2e3586=this['getVariable'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xca')]);if(!_0x2e3586){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x2e3586,_0x2ce47d);}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,_0x2ce47d);return _0xf9e1e2;};AGIVertices['prototype']['noop']=function(_0x22dd87){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14d'),_0x22dd87['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0x22dd87[_0xe9bd('0x14e')]||_0x22dd87[_0xe9bd('0x38')]);};AGIVertices[_0xe9bd('0x10')]['pause']=function(_0x39e628){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14f'),_0x39e628['label']));if(!this['isConfigured'](_0x39e628[_0xe9bd('0x13c')])){return this['channel'][_0xe9bd('0x2b')](_0x39e628,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));var _0x5690ee=this[_0xe9bd('0x4d')][_0xe9bd('0x6f')](this,_0x39e628['pause_id']);var _0x5c26b7=this[_0xe9bd('0x4e')][_0xe9bd('0x6f')](this,_0x39e628[_0xe9bd('0x13c')],_0x5690ee);if(_0x5c26b7){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')]['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x150')]=function(_0x43d731){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x151'),_0x43d731[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x43d731[_0xe9bd('0xfa')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xf8'));}var _0xc877fd=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x43d731[_0xe9bd('0xfa')]);if(!_0xc877fd){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xfb'));}var _0x57e43c=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x152'),[_0xc877fd,_0x43d731[_0xe9bd('0xd7')]]);if(_0x57e43c[_0xe9bd('0x9d')]===-0x1){return _0x57e43c;}return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'PLAYBACK',_0xc877fd));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x153')]=function(_0x3cd856){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x154'),_0x3cd856[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3cd856[_0xe9bd('0x155')])){return this[_0xe9bd('0xf')]['error'](_0x3cd856,_0xe9bd('0x156'));}var _0x912dfa='';var _0x1b633b=parseInt(_0x3cd856[_0xe9bd('0x155')],0xa);if(isNaN(_0x1b633b)){_0x912dfa=_0x3cd856[_0xe9bd('0x155')];}else{_0x912dfa=this[_0xe9bd('0x16')]['sync'](this,_0x3cd856[_0xe9bd('0x155')]);if(!_0x912dfa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3cd856,_0xe9bd('0x157'));}}var _0x42d9cb='';if(this[_0xe9bd('0xa0')](_0x3cd856['file_id'])){var _0x1b9aa3=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3cd856[_0xe9bd('0xfa')]);if(_0x1b9aa3){_0x42d9cb=_0x1b9aa3;}}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3cd856,_0x912dfa);if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('x')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='x';}if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('X')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='X';}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x158'),_0x912dfa?_0x912dfa[_0xe9bd('0x159')]():'');var _0xe27daf=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x15a'),[_0x912dfa,_0x3cd856['opts'],_0x3cd856['url'],_0x42d9cb,_0x3cd856['timeout'],_0x3cd856[_0xe9bd('0x7')],_0x3cd856[_0xe9bd('0x15b')],_0x3cd856[_0xe9bd('0x15c')],'',_0x3cd856['position']]);if(_0xe27daf[_0xe9bd('0x9d')]===-0x1){return _0xe27daf;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20%s\x20%s',_0xe9bd('0x15a'),_0x912dfa));};AGIVertices[_0xe9bd('0x10')]['record']=function(_0x13bb4f){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x13bb4f[_0xe9bd('0x38')]));var _0x7adf3a=_0x13bb4f[_0xe9bd('0x15d')]||'wav';var _0x4ca812=util[_0xe9bd('0x29')](_0xe9bd('0x15e'),this['channel'][_0xe9bd('0x37')],rs[_0xe9bd('0x101')](0x5));var _0x3b7324=util[_0xe9bd('0x29')](_0xe9bd('0x15f'),FILES_PATH,_0x4ca812,_0x7adf3a);var _0x126e2e=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,_0x4ca812);this[_0xe9bd('0x3c')][_0xe9bd('0x6f')](this,_0x13bb4f,_0x4ca812,_0x3b7324);this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x160'),_0x4ca812);logger['info'](_0xe9bd('0x161'),_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f[_0xe9bd('0x63')]);return this[_0xe9bd('0xf')]['recordFile'](_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f['timeout'],undefined,!![]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x163')]=function(_0x258d43){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x164'),_0x258d43['label']));if(!this['isConfigured'](_0x258d43[_0xe9bd('0x62')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x165'));}var _0x3a5061=this[_0xe9bd('0x61')]['sync'](this,_0x258d43);logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x166'),util['inspect'](_0x3a5061,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x258d43[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x25cf50=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x258d43[_0xe9bd('0xca')]);if(!_0x25cf50){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x258d43,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x167'),_0x25cf50),_0x3a5061[_0xe9bd('0x74')]?_0x3a5061[_0xe9bd('0x74')]:_0xe9bd('0x168'));this['channel']['setVariable'](util[_0xe9bd('0x29')]('%s_STATUS_MESSAGE',_0x25cf50),_0x3a5061['statusMessage']?_0x3a5061[_0xe9bd('0x75')]:'OK');if(_0x3a5061[_0xe9bd('0x69')]){try{this[_0xe9bd('0x97')](_0x3a5061[_0xe9bd('0x69')],_0x25cf50);}catch(_0x40b617){logger[_0xe9bd('0x2b')](util[_0xe9bd('0x29')](_0xe9bd('0x169'),_0x25cf50));}}return this[_0xe9bd('0xf')]['noop'](util['format']('variable\x20%s\x20set',_0x25cf50));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16a')]=function(_0x4637c3){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x16b'),_0x4637c3['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16c')](_0x4637c3['digits']['replace'](/\s+/g,''),_0x4637c3[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16d')]=function(_0x4e7305){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4e7305['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16e')](_0x4e7305[_0xe9bd('0x64')][_0xe9bd('0x56')](/\s+/g,''),_0x4e7305[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16f')]=function(_0x47e667){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x47e667['label']));return this['channel'][_0xe9bd('0x170')](_0x47e667[_0xe9bd('0x59')],_0x47e667[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x171')]=function(_0x48db15){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x48db15[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x48db15[_0xe9bd('0x172')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x173'));}var _0x430aaf=this[_0xe9bd('0x20')][_0xe9bd('0x6f')](this,_0x48db15[_0xe9bd('0x172')]);if(!_0x430aaf||!_0x430aaf[_0xe9bd('0x174')]){return this['channel'][_0xe9bd('0x2b')](_0x48db15,'no\x20mail\x20account\x20found');}var _0x569660={'from':util[_0xe9bd('0x29')](_0xe9bd('0x175'),_0x430aaf[_0xe9bd('0x18')],_0x430aaf[_0xe9bd('0x176')]||_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')]),'to':_0x48db15['to']||'','cc':_0x48db15['cc']||'','bcc':_0x48db15[_0xe9bd('0x178')]||'','subject':_0x48db15[_0xe9bd('0x179')],'html':_0x48db15['text'],'text':_0x48db15[_0xe9bd('0x59')]};var _0x3c38b5={'tls':{'rejectUnauthorized':![]}};if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17a')]){_0x3c38b5[_0xe9bd('0x17a')]=_0x430aaf[_0xe9bd('0x174')]['service'];}else{_0x3c38b5[_0xe9bd('0x17b')]=_0x430aaf[_0xe9bd('0x174')]['host'];_0x3c38b5[_0xe9bd('0x17c')]=_0x430aaf[_0xe9bd('0x174')]['port'];_0x3c38b5[_0xe9bd('0x17d')]=_0x430aaf['Smtp']['secure'];}if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17e')]){_0x3c38b5[_0xe9bd('0x17f')]={'user':_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')],'pass':_0x430aaf[_0xe9bd('0x174')]['pass']};}if(this['isConfigured'](_0x48db15[_0xe9bd('0x180')])){}logger[_0xe9bd('0xd1')](_0xe9bd('0x181'),JSON[_0xe9bd('0x72')](_0x569660));this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x48db15,_0x48db15['account_id']);this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x182'),_0x430aaf[_0xe9bd('0x18')]));this[_0xe9bd('0x21')][_0xe9bd('0x6f')](this,_0x3c38b5,_0x569660);return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x183'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x184')]=function(_0x42c0d5){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x185'),_0x42c0d5[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x186')]=function(_0x1000d1){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x187'),_0x1000d1[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1000d1[_0xe9bd('0x188')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20sms\x20account\x20configured');}var _0x5504f5=this[_0xe9bd('0x33')]['sync'](this,_0x1000d1[_0xe9bd('0x188')]);if(!_0x5504f5){return this[_0xe9bd('0xf')]['error'](_0x1000d1,_0xe9bd('0x189'));}var _0x19cf5a={'body':_0x1000d1[_0xe9bd('0x18a')],'phone':_0x1000d1['to']||'','SmsAccountId':_0x5504f5['id']};logger['debug']('sendSMS\x20message',JSON[_0xe9bd('0x72')](_0x19cf5a));this[_0xe9bd('0x36')]['sync'](this,_0x1000d1,_0x1000d1[_0xe9bd('0x188')]);this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x18b'),_0x5504f5[_0xe9bd('0x18')]));this[_0xe9bd('0x35')][_0xe9bd('0x6f')](this,_0x19cf5a);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x18c'));};AGIVertices['prototype'][_0xe9bd('0x18d')]=function(_0x312523){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x18e'),_0x312523[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x312523[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')]['error'](_0x312523,'no\x20variable\x20selected');}var _0x447903=this[_0xe9bd('0x11')]['sync'](this,_0x312523['variable_id']);if(!_0x447903){return this['channel'][_0xe9bd('0x2b')](_0x312523,_0xe9bd('0xcb'));}return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x447903,_0x312523[_0xe9bd('0x18f')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x190')]=function(_0x27dc44){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x191'),_0x27dc44[_0xe9bd('0x38')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x192'));if(_0x27dc44['answer']==='yes'){this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('Answer');return this[_0xe9bd('0xf')][_0xe9bd('0xa4')]();}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x193'));};AGIVertices['prototype'][_0xe9bd('0x194')]=function(_0x5d4e3d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x195'),_0x5d4e3d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x5d4e3d[_0xe9bd('0x196')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5d4e3d,_0xe9bd('0x197'));}var _0x5b7666=this[_0xe9bd('0x198')]['sync'](this,_0x5d4e3d[_0xe9bd('0x196')]);if(!this[_0xe9bd('0xa0')](_0x5b7666)){return this['channel']['error'](_0x5d4e3d,util[_0xe9bd('0x29')](_0xe9bd('0x199'),_0x5d4e3d[_0xe9bd('0x196')]));}if(_0x5b7666===this[_0xe9bd('0xf')][_0xe9bd('0x3a')]){return this[_0xe9bd('0xf')]['error'](_0x5d4e3d,_0xe9bd('0x19a'));}this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x5d4e3d,_0x5b7666);var _0xa9de92=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x19b'),util[_0xe9bd('0x29')](_0xe9bd('0x19c'),config[_0xe9bd('0x7')][_0xe9bd('0x17b')]||_0xe9bd('0x19d'),_0x5b7666,this['channel']['arg_1']));if(_0xa9de92[_0xe9bd('0x9d')]===-0x1){return _0xa9de92;}return this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'AGI',_0x5b7666));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x19e')]=function(_0x1b8df2){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1b8df2[_0xe9bd('0x38')]));var _0x4bf6f8=this[_0xe9bd('0x19f')][_0xe9bd('0x6f')](this,_0x1b8df2['command']);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x1b8df2,_0x1b8df2['command']);if(this['isConfigured'](_0x1b8df2['variable_id'])){var _0x347d01=this['getVariable'][_0xe9bd('0x6f')](this,_0x1b8df2[_0xe9bd('0xca')]);if(_0x347d01){this[_0xe9bd('0xf')]['setVariable'](_0x347d01,_0x4bf6f8);return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1b8df2[_0xe9bd('0xa3')],_0x347d01));}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1b8df2['command']));};AGIVertices[_0xe9bd('0x10')]['google_cloud_tts']=function(_0xf82d5f){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xf82d5f[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0xf82d5f[_0xe9bd('0x58')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0xf82d5f[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a0'),_0xf82d5f[_0xe9bd('0x59')]));var _0x27ed51=this[_0xe9bd('0x57')][_0xe9bd('0x6f')](this,_0xf82d5f);if(_0x27ed51){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a1'),_0x27ed51));var _0x3657f3=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x27ed51);try{fs[_0xe9bd('0xeb')](_0x27ed51+'.wav');}catch(_0x502a91){logger['error'](_0x502a91);}return _0x3657f3;}return this['channel'][_0xe9bd('0x2b')](_0xf82d5f,_0xe9bd('0x1a2'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a3')]=function(_0x3bd62c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1a4'),_0x3bd62c['label']));if(!this[_0xe9bd('0xa0')](_0x3bd62c['text'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a5'),_0x3bd62c['text']));var _0x2980b6=this[_0xe9bd('0x60')][_0xe9bd('0x6f')](this,_0x3bd62c);if(_0x2980b6){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a6'),_0x2980b6));var _0x392c36=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x2980b6);try{fs['unlink'](_0x2980b6+_0xe9bd('0x10e'));}catch(_0x2d453b){logger[_0xe9bd('0x2b')](_0x2d453b);}return _0x392c36;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3bd62c,_0xe9bd('0x1a7'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a8')]=function(_0x405b45){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1a9'),_0x405b45['label']));if(!this[_0xe9bd('0xa0')](_0x405b45['findBy'])){return this['channel'][_0xe9bd('0x2b')](_0x405b45,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));var _0x5710b5=this[_0xe9bd('0x50')]['sync'](this,_0x405b45[_0xe9bd('0x13c')]);if(_0x5710b5){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')]['callerid'],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1aa')]=function(_0x981d02){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1ab'),_0x981d02[_0xe9bd('0x38')]));var _0xa800ed=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x1ac'),[_0x981d02['mailbox'],_0x981d02[_0xe9bd('0x77')]]);if(_0xa800ed[_0xe9bd('0x9d')]===-0x1){return _0xa800ed;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'VOICEMAIL',_0x981d02[_0xe9bd('0x1ad')]));};AGIVertices['prototype'][_0xe9bd('0x1ae')]=function(_0x1e869c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1af'),_0x1e869c[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1e869c[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1e869c,'no\x20variable\x20selected');}var _0x2cacd4=this['getVariable'][_0xe9bd('0x6f')](this,_0x1e869c[_0xe9bd('0xca')]);if(!_0x2cacd4){return this['channel']['error'](_0x1e869c,_0xe9bd('0xcb'));}var _0x38abb0=this['channel'][_0xe9bd('0x11')](_0x2cacd4);return{'code':0xc8,'result':_0x38abb0['extra']?_0x38abb0[_0xe9bd('0x9e')]:'-'};};String[_0xe9bd('0x10')][_0xe9bd('0x9b')]=function(_0x23ed69,_0x564c4e){return this['split'](_0x23ed69)[_0xe9bd('0x1b0')](_0x564c4e);};module['exports']=AGIVertices; \ No newline at end of file +var _0x9bde=['dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','audiofile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','operation','math\x20%s','isArray','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','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:','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','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','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','shellCommand','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','split','length','replaceAll','getAndSetVariable','result','extra','setVariable','isConfigured','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set'];(function(_0x16a664,_0x463298){var _0x3892c9=function(_0x2425d9){while(--_0x2425d9){_0x16a664['push'](_0x16a664['shift']());}};_0x3892c9(++_0x463298);}(_0x9bde,0xe1));var _0xe9bd=function(_0x44c6d7,_0x5f24a6){_0x44c6d7=_0x44c6d7-0x0;var _0x370c29=_0x9bde[_0x44c6d7];return _0x370c29;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xe9bd('0x0'));var _=require('lodash');var sh=require(_0xe9bd('0x1'));var odbc=require('odbc')();var rs=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var rp=require(_0xe9bd('0x5'));var logger=require(_0xe9bd('0x6'))(_0xe9bd('0x7'));var config=require(_0xe9bd('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xe9bd('0x9');var recursiveMapAttributes=[_0xe9bd('0xa'),_0xe9bd('0xb')];var verticesWithRetry=[_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe')];var AGIVertices=function(_0x29bc2b,_0xbefddb,_0x439abc){this[_0xe9bd('0xf')]=_0x29bc2b;this['rpc']=_0xbefddb;this['mailRpc']=_0x439abc;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x11')]=function(_0x2601ac,_0x581ab9){this[_0xe9bd('0x12')][_0xe9bd('0x13')](_0x2601ac)[_0xe9bd('0x14')](function(_0x141587){_0x581ab9(null,_0x141587?_0x141587['name']:![]);})[_0xe9bd('0x15')](function(_0x4ac319){_0x581ab9(_0x4ac319);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16')]=function(_0x3435b4,_0x51109f){this['rpc'][_0xe9bd('0x17')](_0x3435b4)[_0xe9bd('0x14')](function(_0x3a9e5f){_0x51109f(null,_0x3a9e5f?_0x3a9e5f[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x389e7b){_0x51109f(_0x389e7b);});};AGIVertices[_0xe9bd('0x10')]['getSquareProject']=function(_0x1d11a0,_0x464a1b){this[_0xe9bd('0x12')]['getSquareProjectById'](_0x1d11a0)[_0xe9bd('0x14')](function(_0x3bae08){_0x464a1b(null,_0x3bae08?_0x3bae08[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5cf674){_0x464a1b(_0x5cf674);});};AGIVertices[_0xe9bd('0x10')]['getSquareOdbc']=function(_0xc6b661,_0x55b869){this[_0xe9bd('0x12')][_0xe9bd('0x19')](_0xc6b661)[_0xe9bd('0x14')](function(_0x3dda13){_0x55b869(null,_0x3dda13?_0x3dda13[_0xe9bd('0x1a')]:![]);})[_0xe9bd('0x15')](function(_0x6593ce){_0x55b869(_0x6593ce);});};AGIVertices['prototype'][_0xe9bd('0x1b')]=function(_0x28cd17,_0x4ecaf5){this[_0xe9bd('0x12')]['getUserById'](_0x28cd17)[_0xe9bd('0x14')](function(_0x1b9cc9){_0x4ecaf5(null,_0x1b9cc9?_0x1b9cc9[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5bc4bf){_0x4ecaf5(_0x5bc4bf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1c')]=function(_0x2c9a57,_0x39b206){this[_0xe9bd('0x12')][_0xe9bd('0x1d')](_0x2c9a57)[_0xe9bd('0x14')](function(_0x43ea90){_0x39b206(null,_0x43ea90?_0x43ea90[_0xe9bd('0x18')]:![]);})['catch'](function(_0x3c211a){_0x39b206(_0x3c211a);});};AGIVertices[_0xe9bd('0x10')]['getSound']=function(_0x3b13b7,_0xc25248){var _0x119672=this;this[_0xe9bd('0x12')][_0xe9bd('0x1e')](_0x3b13b7)[_0xe9bd('0x14')](function(_0x519f48){_0xc25248(null,_0x519f48?_0x119672['getSoundPath'](_0x519f48[_0xe9bd('0x1f')]):![]);})['catch'](function(_0xa45eb0){_0xc25248(_0xa45eb0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x20')]=function(_0x36aa80,_0x4057df){this['rpc']['getMailAccountById'](_0x36aa80)[_0xe9bd('0x14')](function(_0x3b6682){_0x4057df(null,_0x3b6682?_0x3b6682:![]);})[_0xe9bd('0x15')](function(_0x3081f3){_0x4057df(_0x3081f3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x21')]=function(_0x3c31ee,_0x66213a,_0x45703e){this['mailRpc'][_0xe9bd('0x21')](_0x3c31ee,_0x66213a)[_0xe9bd('0x14')](function(){_0x45703e(null);})[_0xe9bd('0x15')](function(_0x5117bc){_0x45703e(_0x5117bc);});};AGIVertices['prototype'][_0xe9bd('0x22')]=function(_0x2e9593,_0x601649){this[_0xe9bd('0x12')][_0xe9bd('0x23')](_0x2e9593)[_0xe9bd('0x14')](function(_0x1e50ac){if(_0x1e50ac){if(_0x1e50ac[_0xe9bd('0x24')]){_0x601649(null,[_0x1e50ac[_0xe9bd('0x25')]]);}else{_0x601649(null,_[_0xe9bd('0x26')](_0x1e50ac[_0xe9bd('0x27')],_0xe9bd('0x25')));}}else{_0x601649(null,![]);}})[_0xe9bd('0x15')](function(_0x199477){_0x601649(_0x199477);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x28')]=function(_0x264ba0){return util[_0xe9bd('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x264ba0);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x2a')]=function(_0x56b4a5,_0x404a7d,_0x264c87){odbc['open'](_0x56b4a5,function(_0x4b1da0){if(_0x4b1da0){logger[_0xe9bd('0x2b')](_0xe9bd('0x2c'),_0x4b1da0);_0x264c87(_0x4b1da0);}else{logger['info'](_0xe9bd('0x2d'));odbc[_0xe9bd('0x2e')](_0x404a7d,function(_0x14927c,_0x5b894a){if(_0x14927c){logger[_0xe9bd('0x2f')]('Error\x20executing\x20query\x20%s',_0x404a7d);_0x264c87(_0x14927c);}else{logger[_0xe9bd('0x2f')](_0xe9bd('0x30'),_0x404a7d);odbc[_0xe9bd('0x31')](function(_0x1366f2){if(_0x1366f2){logger['error'](_0xe9bd('0x32'),_0x1366f2);}_0x264c87(null,_0x5b894a);});}});}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x33')]=function(_0x3f1212,_0x253359){this[_0xe9bd('0x12')][_0xe9bd('0x34')](_0x3f1212)[_0xe9bd('0x14')](function(_0x2b5a71){_0x253359(null,_0x2b5a71?_0x2b5a71:![]);})[_0xe9bd('0x15')](function(_0x4e8565){_0x253359(_0x4e8565);});};AGIVertices['prototype'][_0xe9bd('0x35')]=function(_0x499e13,_0x4608a0){this[_0xe9bd('0x12')][_0xe9bd('0x35')](_0x499e13)['then'](function(_0x1ba613){_0x4608a0(null,_0x1ba613);})[_0xe9bd('0x15')](function(_0x1a2d94){_0x4608a0(_0x1a2d94);});};AGIVertices['prototype'][_0xe9bd('0x36')]=function(_0x3a5703,_0x2b3cd7,_0x388132){this[_0xe9bd('0x12')][_0xe9bd('0x36')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'node':_0x3a5703[_0xe9bd('0x38')],'application':_0x3a5703[_0xe9bd('0x39')],'data':_0x2b3cd7||null,'project_name':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'callerid':this[_0xe9bd('0xf')][_0xe9bd('0x3b')]})[_0xe9bd('0x14')](function(_0x5b70d3){if(_0x388132){_0x388132(null,_0x5b70d3);}})['catch'](function(_0x283e67){if(_0x388132){_0x388132(_0x283e67);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x3c')]=function(_0x58828b,_0x594e80,_0x43cf7d,_0x3f6f22){this[_0xe9bd('0x12')][_0xe9bd('0x3c')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'callerid':this[_0xe9bd('0xf')]['callerid'],'calleridname':this[_0xe9bd('0xf')]['calleridname'],'context':this[_0xe9bd('0xf')][_0xe9bd('0x3d')],'extension':this[_0xe9bd('0xf')][_0xe9bd('0x3e')],'priority':this[_0xe9bd('0xf')]['priority'],'accountcode':this[_0xe9bd('0xf')][_0xe9bd('0x3f')],'dnid':this[_0xe9bd('0xf')]['dnid'],'projectName':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'saveName':_0x594e80,'filename':_0x58828b[_0xe9bd('0x40')]||_0x594e80,'savePath':_0x43cf7d})['then'](function(_0x28d2ea){_0x3f6f22(null,_0x28d2ea);})[_0xe9bd('0x15')](function(_0x2e634d){_0x3f6f22(_0x2e634d);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x41')]=function(_0x579d26,_0x3f4833,_0x4b8ff9){this[_0xe9bd('0x12')][_0xe9bd('0x41')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'body':_0x579d26,'direction':_0x3f4833})[_0xe9bd('0x14')](function(_0x4944e3){if(_0x4b8ff9){_0x4b8ff9(null,_0x4944e3);}})[_0xe9bd('0x15')](function(_0x485e95){if(_0x4b8ff9){_0x4b8ff9(_0x485e95);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x42')]=function(_0x5e08ae,_0x59d5cb){this[_0xe9bd('0x12')]['createCmContact']({'firstName':_[_0xe9bd('0x43')](_0x5e08ae['name'])||_[_0xe9bd('0x44')](_0x5e08ae[_0xe9bd('0x18')])?'callback_'+Math[_0xe9bd('0x45')]():_0x5e08ae['name'],'lastName':_[_0xe9bd('0x43')](_0x5e08ae[_0xe9bd('0x46')])||_[_0xe9bd('0x44')](_0x5e08ae['lastName'])?null:_0x5e08ae[_0xe9bd('0x46')],'phone':_0x5e08ae[_0xe9bd('0x47')],'ListId':_0x5e08ae[_0xe9bd('0x48')],'scheduledAt':_0x5e08ae[_0xe9bd('0x49')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xe9bd('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x5e08ae[_0xe9bd('0x49')][_0xe9bd('0x4b')](),'priority':_0x5e08ae[_0xe9bd('0x4c')]})[_0xe9bd('0x14')](function(_0x159f68){_0x59d5cb(null,_0x159f68);})[_0xe9bd('0x15')](function(_0x373057){_0x59d5cb(_0x373057);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4d')]=function(_0x3be526,_0x1fd5bf){this[_0xe9bd('0x12')]['getPauseById'](_0x3be526)['then'](function(_0x566dd8){_0x1fd5bf(null,_0x566dd8?_0x566dd8[_0xe9bd('0x18')]:![]);})['catch'](function(_0x2c4ca7){_0x1fd5bf(_0x2c4ca7);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4e')]=function(_0x6232e5,_0x1c9328,_0xaf6ffd){var _0x3bb2ba={'role':_0xe9bd('0x4f')};_0x3bb2ba[_0x6232e5]=this[_0xe9bd('0xf')]['callerid'];this[_0xe9bd('0x12')][_0xe9bd('0x4e')](_0x3bb2ba,_0x1c9328,this[_0xe9bd('0xf')][_0xe9bd('0x37')])['then'](function(_0x1c8765){_0xaf6ffd(null,_[_0xe9bd('0x44')](_0x1c8765)?![]:!![]);})[_0xe9bd('0x15')](function(_0x4e05f0){logger[_0xe9bd('0x2b')](_0x4e05f0);_0xaf6ffd(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x50')]=function(_0xfe82f7,_0x4ee26a){var _0x4b3447={'role':_0xe9bd('0x4f')};_0x4b3447[_0xfe82f7]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this[_0xe9bd('0x12')]['agentUnpause'](_0x4b3447)['then'](function(_0x305efa){_0x4ee26a(null,_[_0xe9bd('0x44')](_0x305efa)?![]:!![]);})[_0xe9bd('0x15')](function(_0x3ba881){logger[_0xe9bd('0x2b')](_0x3ba881);_0x4ee26a(null,![]);});};AGIVertices[_0xe9bd('0x10')]['agentLogout']=function(_0x179c8d,_0x5681ab){var _0x27e07c={'role':_0xe9bd('0x4f')};_0x27e07c[_0x179c8d]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this['rpc'][_0xe9bd('0x51')](_0x27e07c)[_0xe9bd('0x14')](function(_0x3b0190){_0x5681ab(null,_['isNil'](_0x3b0190)?![]:!![]);})[_0xe9bd('0x15')](function(_0x1a9d0c){logger[_0xe9bd('0x2b')](_0x1a9d0c);_0x5681ab(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x52')]=function(_0x16b66c,_0x3a626d){var _0x336222={'role':_0xe9bd('0x4f')};_0x336222[_0x16b66c]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];var _0x37d07a=_0x16b66c!='internal'?util[_0xe9bd('0x29')](_0xe9bd('0x53'),'LOCAL',this[_0xe9bd('0xf')][_0xe9bd('0x3b')]):undefined;this['rpc']['agentLogin'](_0x336222,_0x37d07a)[_0xe9bd('0x14')](function(_0x4190f0){_0x3a626d(null,_['isNil'](_0x4190f0)?![]:!![]);})['catch'](function(_0x4a6422){logger[_0xe9bd('0x2b')](_0x4a6422);_0x3a626d(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x4b5bfb,_0x4bcf2b){sh[_0xe9bd('0x54')](_[_0xe9bd('0x55')](_0x4b5bfb),function(_0x2ed5f2,_0x4947b0){var _0x3d4dd1=_0x4947b0[_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'');_0x4bcf2b(null,_0x3d4dd1);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x57')]=function(_0x5dc598,_0x2656e9){scripts[_0xe9bd('0x57')](_0x5dc598[_0xe9bd('0x58')],_0x5dc598['google_cloud_tts_text_type']||'text',_0x5dc598[_0xe9bd('0x59')],_0x5dc598[_0xe9bd('0x5a')]||_0xe9bd('0x5b'),_0x5dc598[_0xe9bd('0x5c')]||_0xe9bd('0x5d'),_0x5dc598[_0xe9bd('0x5e')]||_0xe9bd('0x5f'))[_0xe9bd('0x14')](function(_0x578e85){_0x2656e9(null,_0x578e85);})[_0xe9bd('0x15')](function(_0x35e0ca){_0x2656e9(_0x35e0ca);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x60')]=function(_0x2364fc,_0x5d7257){scripts[_0xe9bd('0x60')](_0x2364fc['text'],_0x2364fc['google_tts_language']||'en',0x1)[_0xe9bd('0x14')](function(_0x4496e3){_0x5d7257(null,_0x4496e3);})['catch'](function(_0x1a6bf9){_0x5d7257(_0x1a6bf9);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x61')]=function(_0x292faf,_0x582cf3){var _0x3c1ab9={'uri':_0x292faf[_0xe9bd('0x62')],'method':_0x292faf['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x292faf[_0xe9bd('0x63')])===_0xe9bd('0x64')&&parseInt(_0x292faf[_0xe9bd('0x63')])>=0x1?parseInt(_0x292faf[_0xe9bd('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xe9bd('0x65')]([_0xe9bd('0x66'),_0xe9bd('0x67')],_0x3c1ab9['method'][_0xe9bd('0x68')]())){try{_0x3c1ab9[_0xe9bd('0x69')]=_0x292faf[_0xe9bd('0xb')]?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xb')]):{};}catch(_0x8f51aa){logger[_0xe9bd('0x2b')](_0xe9bd('0x6b'),_0x8f51aa);}}try{_0x3c1ab9[_0xe9bd('0x6c')]=_0x292faf['rawHeaders']?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xa')]):{};}catch(_0x256890){logger[_0xe9bd('0x2b')](_0xe9bd('0x6d'),_0x256890);}if(_0x292faf[_0xe9bd('0x6e')]){try{var _0x1bad42=require(_0x292faf['computedVariables'])[_0xe9bd('0x6f')](this,_0x3c1ab9);_0x3c1ab9[_0xe9bd('0x70')]=Mustache['render'](_0x292faf[_0xe9bd('0x62')],_0x1bad42,{},['$$','$$']);if(_0x3c1ab9[_0xe9bd('0x6c')]){_0x3c1ab9[_0xe9bd('0x6c')]=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x6c')]),_0x1bad42,{},['$$','$$']));}if(_0x3c1ab9['body']){_0x3c1ab9['body']=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x69')]),_0x1bad42,{},['$$','$$']));}}catch(_0x449175){logger[_0xe9bd('0x2b')](_0xe9bd('0x73'),_0x449175);}}rp(_0x3c1ab9)['then'](function(_0x35390a){var _0x44f47e={'statusCode':_0x35390a[_0xe9bd('0x74')]||0xc8,'statusMessage':_0x35390a[_0xe9bd('0x75')]||'OK','headers':_0x35390a[_0xe9bd('0x6c')]||{},'body':_0x35390a[_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x44f47e);})[_0xe9bd('0x15')](function(_0x4bbeef){var _0x55aacf={'statusCode':_0x4bbeef['statusCode']||0x1f4,'statusMessage':_0x4bbeef[_0xe9bd('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4bbeef['options']['headers']||{},'body':_0x4bbeef[_0xe9bd('0x77')][_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x55aacf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x78')]=function(_0xd8a604,_0x3bc2f2){scripts[_0xe9bd('0x78')](this[_0xe9bd('0xf')][_0xe9bd('0x37')],_0xd8a604['key'],_0xd8a604[_0xe9bd('0x59')],_0xd8a604['dialogflow_language']||'en')[_0xe9bd('0x14')](function(_0x433a98){_0x3bc2f2(null,_0x433a98);})[_0xe9bd('0x15')](function(_0x6fff03){_0x3bc2f2(_0x6fff03);});};AGIVertices[_0xe9bd('0x10')]['sestekNDA']=function(_0x5b14e5,_0x56d4eb){scripts[_0xe9bd('0x79')](this[_0xe9bd('0xf')],_0x5b14e5)['then'](function(_0x3c7875){_0x56d4eb(null,_0x3c7875);})[_0xe9bd('0x15')](function(_0x2bf2f0){_0x56d4eb(_0x2bf2f0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7a')]=function(_0x58c1e5,_0x821505){scripts[_0xe9bd('0x7a')](_0x58c1e5[_0xe9bd('0x7b')],_0x58c1e5[_0xe9bd('0x59')],_0x58c1e5[_0xe9bd('0x7c')]||_0xe9bd('0x5b'),_0x58c1e5[_0xe9bd('0x7d')])[_0xe9bd('0x14')](function(_0x45991e){_0x821505(null,_0x45991e);})[_0xe9bd('0x15')](function(_0x5f24c8){_0x821505(_0x5f24c8);});};AGIVertices['prototype']['ispeechASR']=function(_0x5b5c35,_0x4039c7,_0x2c7ecc){scripts[_0xe9bd('0x7e')](_0x4039c7,_0x5b5c35['key'],_0x5b5c35[_0xe9bd('0x7f')]||_0xe9bd('0x5b'),this['isConfigured'](_0x5b5c35['model'])?_0x5b5c35[_0xe9bd('0x80')]:undefined)[_0xe9bd('0x14')](function(_0x2a4937){_0x2c7ecc(null,_0x2a4937);})[_0xe9bd('0x15')](function(_0x23a145){_0x2c7ecc(_0x23a145);});};AGIVertices['prototype']['awsPolly']=function(_0x499771,_0x223f56){scripts[_0xe9bd('0x81')](_0x499771[_0xe9bd('0x82')],_0x499771[_0xe9bd('0x83')],_0x499771[_0xe9bd('0x84')],_0x499771[_0xe9bd('0x85')]||_0xe9bd('0x86'),_0x499771[_0xe9bd('0x59')],_0x499771[_0xe9bd('0x87')]||_0xe9bd('0x59'))['then'](function(_0xb1203d){_0x223f56(null,_0xb1203d);})['catch'](function(_0x116815){_0x223f56(_0x116815);});};AGIVertices['prototype']['awsLex']=function(_0x423e15,_0x4a6253){scripts[_0xe9bd('0x88')](this['channel'][_0xe9bd('0x37')],_0x423e15[_0xe9bd('0x82')],_0x423e15[_0xe9bd('0x83')],_0x423e15[_0xe9bd('0x89')],_0x423e15[_0xe9bd('0x59')],_0x423e15[_0xe9bd('0x8a')])['then'](function(_0x3b97a0){_0x4a6253(null,_0x3b97a0);})[_0xe9bd('0x15')](function(_0x4ee8a3){_0x4a6253(_0x4ee8a3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8b')]=function(_0x141fe2,_0x59897b,_0x342f9e){scripts[_0xe9bd('0x8b')](_0x59897b,_0x141fe2[_0xe9bd('0x7b')],_0x141fe2[_0xe9bd('0x8c')]||_0xe9bd('0x5b'))['then'](function(_0x45021c){_0x342f9e(null,_0x45021c);})[_0xe9bd('0x15')](function(_0x591c5f){_0x342f9e(_0x591c5f);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8d')]=function(_0x396679,_0x4d9717,_0x50243f){scripts[_0xe9bd('0x8d')](_0x4d9717,_0x396679[_0xe9bd('0x8e')],_0x396679[_0xe9bd('0x8f')],_0x396679[_0xe9bd('0x70')])[_0xe9bd('0x14')](function(_0xb6582b){_0x50243f(null,_0xb6582b);})[_0xe9bd('0x15')](function(_0x56bdcd){_0x50243f(_0x56bdcd);});};AGIVertices[_0xe9bd('0x10')]['clear']=function(_0x33dcf6){var _0x3a2d9f=_[_0xe9bd('0x65')](verticesWithRetry,_0x33dcf6['agicommand'])?_0x33dcf6:_[_0xe9bd('0x90')](_0x33dcf6);for(var _0x4ae8d1 in _0x3a2d9f){if(_0x3a2d9f[_0xe9bd('0x91')](_0x4ae8d1)){if(_0x3a2d9f[_0x4ae8d1]&&_[_0xe9bd('0x92')](_0x3a2d9f[_0x4ae8d1])){if(_[_0xe9bd('0x65')](recursiveMapAttributes,_0x4ae8d1)){_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x93')](_0x3a2d9f[_0x4ae8d1]);}else{_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x94')](_0x3a2d9f[_0x4ae8d1]);}}}}return _0x3a2d9f;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x95')]=function(_0x2abd8f){for(var _0x14db25 in _0x2abd8f){if(_0x2abd8f[_0xe9bd('0x91')](_0x14db25)){if(_[_0xe9bd('0x96')](_0x2abd8f[_0x14db25])){return this['recursiveNodeIndex'](_0x2abd8f[_0x14db25]);}_0x2abd8f[_0x14db25]=this[_0xe9bd('0x94')](_0x2abd8f[_0x14db25]);}}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x97')]=function(_0x5dad5e,_0x97e5b1){for(var _0x16bcce in _0x5dad5e){if(_0x5dad5e['hasOwnProperty'](_0x16bcce)){if(_['isPlainObject'](_0x5dad5e[_0x16bcce])){if(!_['isEmpty'](_0x5dad5e[_0x16bcce])){this['saveRestApiResult'](_0x5dad5e[_0x16bcce],util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce));}}else{if(_0x5dad5e[_0x16bcce]){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce),_0x5dad5e[_0x16bcce]);}}}}};AGIVertices['prototype'][_0xe9bd('0x93')]=function(_0x35894c){try{var _0x3fed2e=JSON[_0xe9bd('0x6a')](_0x35894c);this[_0xe9bd('0x95')](_0x3fed2e);return JSON['stringify'](_0x3fed2e);}catch(_0x1fcc3a){return this[_0xe9bd('0x94')](_0x35894c);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x54ffbd){var _0x4fbbd6=_0x54ffbd[_0xe9bd('0x99')]('{');for(var _0x26b67a=0x1;_0x26b67a<_0x4fbbd6[_0xe9bd('0x9a')];_0x26b67a+=0x1){var _0xae352d=_0x4fbbd6[_0x26b67a]['split']('}');if(_0xae352d['length']>0x1){_0x54ffbd=_0x54ffbd[_0xe9bd('0x9b')]('{'+_0xae352d[0x0]+'}',this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0xae352d[0x0])['extra']||_0xae352d[0x0]);}}if(_0x4fbbd6[_0xe9bd('0x9a')]===0x1){return _0x54ffbd[_0xe9bd('0x4b')]();}return this['replaceAllVariables'](_0x54ffbd);};AGIVertices['prototype'][_0xe9bd('0x9c')]=function(_0x90b3d7,_0x346da7){var _0x3453c3=this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0x90b3d7);if(_0x3453c3[_0xe9bd('0x9d')]===-0x1){return _0x3453c3;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x346da7,_0x3453c3[_0xe9bd('0x9e')]));return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x346da7,_0x3453c3[_0xe9bd('0x9e')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa0')]=function(_0x55f0d3){return _0x55f0d3&&_0x55f0d3!=='0'&&_0x55f0d3!=='-1'&&_0x55f0d3!=='';};AGIVertices[_0xe9bd('0x10')]['maxRetry']=function(_0x13e932){this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x13e932,'-');_0x13e932[_0xe9bd('0xa1')]=_0x13e932['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7')]=function(_0x54a6c6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xa2'),_0x54a6c6[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x7')]([_0x54a6c6[_0xe9bd('0xa3')],_0x54a6c6['args']]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa4')]=function(_0x2d5601){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xa5'),_0x2d5601[_0xe9bd('0x38')]));if(this[_0xe9bd('0xa0')](_0x2d5601[_0xe9bd('0x63')])){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2d5601[_0xe9bd('0x63')]));var _0x2e1c0f=this[_0xe9bd('0xf')]['wait'](_0x2d5601[_0xe9bd('0x63')]);if(_0x2e1c0f['result']===-0x1){return _0x2e1c0f;}}return this['channel']['answer']();};AGIVertices[_0xe9bd('0x10')]['callback']=function(_0x516080){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x516080[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x516080['list_id'])){return this['channel'][_0xe9bd('0x2b')](_0x516080,'no\x20list\x20selected');}_0x516080['scheduledAt']=moment();if(this[_0xe9bd('0xa0')](_0x516080[_0xe9bd('0xa6')])){_0x516080[_0xe9bd('0x49')]=moment()[_0xe9bd('0xa7')](_0x516080[_0xe9bd('0xa6')],_0xe9bd('0xa8'));}if(!this[_0xe9bd('0xa0')](_0x516080['callback_priority'])){_0x516080[_0xe9bd('0x4c')]=0x2;}this['createCmContact']['sync'](this,_0x516080);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xaa'),_0x516080[_0xe9bd('0x47')],_0x516080['list_id'],_0x516080[_0xe9bd('0x49')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xab')]=function(_0x2a4f8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a4f8a[_0xe9bd('0x38')]));var _0x265dba=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]);if(_0x265dba['result']===-0x1){return _0x265dba;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xad'),_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]));};AGIVertices[_0xe9bd('0x10')]['lumenvoxtts']=function(_0x13b95b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xae'),_0x13b95b[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20text\x20configured');}var _0x2fa992='\x22'+_0x13b95b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x77')])){_0x2fa992+=','+_0x13b95b[_0xe9bd('0x77')];}var _0x1bda30=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xaf'),_0x2fa992);if(_0x1bda30['result']===-0x1){return _0x1bda30;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xb0'),_0x2fa992));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xb1')]=function(_0x5bf65b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb2'),_0x5bf65b['label']));if(!this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}var _0x7d2411='\x22'+_0x5bf65b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x77')])){_0x7d2411+=','+_0x5bf65b[_0xe9bd('0x77')];}var _0x5c0b2d=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xaf'),_0x7d2411);if(_0x5c0b2d['result']===-0x1){return _0x5c0b2d;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x7d2411));};AGIVertices['prototype'][_0xe9bd('0xb4')]=function(_0x183071){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb5'),_0x183071[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x183071['grammar'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20grammar\x20configured');}var _0x767a44=_0x183071[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0x183071[_0xe9bd('0x77')])){_0x767a44+=','+_0x183071[_0xe9bd('0x77')];}var _0x142907=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xb7'),_0x767a44);if(_0x142907[_0xe9bd('0x9d')]===-0x1){return _0x142907;}var _0x38ce72=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),_0xe9bd('0xb9'));if(_0x38ce72[_0xe9bd('0x9d')]===-0x1){return _0x38ce72;}var _0x58f68a=this[_0xe9bd('0x9c')](_0xe9bd('0xba'),_0xe9bd('0xbb'));if(_0x58f68a[_0xe9bd('0x9d')]===-0x1){return _0x58f68a;}var _0x217eff=this['getAndSetVariable'](_0xe9bd('0xbc'),_0xe9bd('0xbd'));if(_0x217eff[_0xe9bd('0x9d')]===-0x1){return _0x217eff;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x767a44));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xbf')]=function(_0xab57a8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xc0'),_0xab57a8['label']));if(!this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0xb6')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc1'));}var _0x3541d0=_0xab57a8[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0x77')])){_0x3541d0+=','+_0xab57a8[_0xe9bd('0x77')];}var _0xad2195=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xb7'),_0x3541d0);if(_0xad2195[_0xe9bd('0x9d')]===-0x1){return _0xad2195;}var _0x62dd82=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),'SESTEK_ASR_CONFIDENCE');if(_0x62dd82[_0xe9bd('0x9d')]===-0x1){return _0x62dd82;}var _0x43579b=this[_0xe9bd('0x9c')]('RECOG_INPUT()',_0xe9bd('0xc2'));if(_0x43579b[_0xe9bd('0x9d')]===-0x1){return _0x43579b;}var _0x496640=this['getAndSetVariable']('RECOG_INSTANCE()',_0xe9bd('0xc3'));if(_0x496640[_0xe9bd('0x9d')]===-0x1){return _0x496640;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x3541d0));};AGIVertices['prototype'][_0xe9bd('0xc4')]=function(_0x3445f6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3445f6[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3445f6['odbc_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc5'));}var _0x33d5cb=this['getSquareOdbc']['sync'](this,_0x3445f6['odbc_id']);if(!_0x33d5cb){return this[_0xe9bd('0xf')]['error'](_0x3445f6,_0xe9bd('0xc6'));}if(!this[_0xe9bd('0xa0')](_0x3445f6[_0xe9bd('0x2e')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc7'));}var _0x53b73c=_0x3445f6[_0xe9bd('0x2e')][_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xc8'),_0x53b73c));var _0x25def7=this['getQueryOdbc'][_0xe9bd('0x6f')](this,_0x33d5cb,_0x53b73c);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3445f6,_0x53b73c);if(!this[_0xe9bd('0xa0')](_0x3445f6['variable_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x152070=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3445f6[_0xe9bd('0xca')]);if(!_0x152070){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xcb'));}var _0x3cfa05=this;_0x25def7[_0xe9bd('0xcc')](function(_0x11a03d,_0x4eeb96){Object[_0xe9bd('0xcd')](_0x11a03d)[_0xe9bd('0xcc')](function(_0x571328){_0x3cfa05[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s][%s]',_0x152070,_0x4eeb96,_0x571328),_0x11a03d[_0x571328]);});});this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xce'),_0x152070),_0x25def7['length']);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xcf'),_0x152070));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xd0')]=function(_0x58f73d){logger[_0xe9bd('0xd1')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x58f73d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x58f73d[_0xe9bd('0xd2')])){return this['channel'][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd3'));}var _0x5e60b0=this[_0xe9bd('0x1b')][_0xe9bd('0x6f')](this,_0x58f73d[_0xe9bd('0xd2')]);if(!_0x5e60b0){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd4'));}var _0x1d94e1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xd6'),_0x5e60b0),_0x58f73d[_0xe9bd('0x63')],_0x58f73d[_0xe9bd('0xd7')],_0x58f73d['url']]);if(_0x1d94e1[_0xe9bd('0x9d')]===-0x1){return _0x1d94e1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x470071){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xd9'),_0x470071['label']));if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x59')])){return this['channel']['noop'](_0xe9bd('0xb3'));}this['channel']['bot']=!![];this[_0xe9bd('0x36')](_0x470071);this[_0xe9bd('0x41')](_0x470071[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xdb'),_0x470071[_0xe9bd('0x59')]));var _0xe55ad1=this[_0xe9bd('0x78')][_0xe9bd('0x6f')](this,_0x470071);if(_0xe55ad1){for(var _0x5b44bf in _0xe55ad1){if(_0xe55ad1[_0xe9bd('0x91')](_0x5b44bf)){this['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xdc'),_0x5b44bf[_0xe9bd('0x68')]()),_0xe55ad1[_0x5b44bf]);}}this['createSquareMessage'](_0xe55ad1[_0xe9bd('0xdd')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')]['noop'](util['format'](_0xe9bd('0xdf'),_0xe55ad1[_0xe9bd('0xdd')]));}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x470071,_0xe9bd('0xe0'));};AGIVertices[_0xe9bd('0x10')]['sesteknda']=function(_0x2daedf){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xe1'),_0x2daedf['label']));if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe2')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xe3'));}if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe4')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xe5'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['password'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xe6'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['ndassistant_url'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['bot']=!![];this[_0xe9bd('0x36')](_0x2daedf);this['createSquareMessage'](_0x2daedf[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xe7'),_0x2daedf[_0xe9bd('0x59')]));var _0x103791=this[_0xe9bd('0x79')][_0xe9bd('0x6f')](this,_0x2daedf);if(_0x103791){for(var _0x53a060 in _0x103791){if(_0x103791['hasOwnProperty'](_0x53a060)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xe8'),_0x53a060[_0xe9bd('0x68')]()),_0x103791[_0x53a060]);}}this[_0xe9bd('0x41')](_0x103791[_0xe9bd('0xdd')],_0xe9bd('0xde'));if(_0x103791['audiofile']){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xe9'),_0x103791['audiofile']));var _0x3b32f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x103791['audiofile']);try{fs[_0xe9bd('0xeb')](_0x103791[_0xe9bd('0xec')]+'.wav');}catch(_0x10d9ed){logger[_0xe9bd('0x2b')](_0x10d9ed);}return _0x3b32f7;}else{return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('SestekNDA\x20Result\x20%s',_0x103791[_0xe9bd('0xdd')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x2daedf,_0xe9bd('0xed'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xee')]=function(_0x551853){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0xef'),_0x551853['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('end');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf0')]=function(_0x5a8d1a){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5a8d1a['label']));var _0x3a625d='';if(_0x5a8d1a[_0xe9bd('0xf1')]){if(!this['isConfigured'](_0x5a8d1a['trunk_id'])){return this[_0xe9bd('0xf')]['error'](_0x5a8d1a,_0xe9bd('0xf2'));}else{var _0x447743=parseInt(_0x5a8d1a['trunk_id'],0xa);if(isNaN(_0x447743)){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf1')];}else{_0x3a625d=this[_0xe9bd('0x1c')][_0xe9bd('0x6f')](this,_0x5a8d1a[_0xe9bd('0xf1')]);if(!_0x3a625d){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf3'));}}}}else if(_0x5a8d1a[_0xe9bd('0xf4')]){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf4')];}else{return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf2'));}var _0x430df1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xf5'),_0x3a625d,_0x5a8d1a[_0xe9bd('0x47')]),_0x5a8d1a['timeout'],_0x5a8d1a[_0xe9bd('0xd7')],_0x5a8d1a[_0xe9bd('0x62')]]);if(_0x430df1[_0xe9bd('0x9d')]===-0x1){return _0x430df1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf6')]=function(_0x49e80a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xf7'),_0x49e80a[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xf6'));};AGIVertices[_0xe9bd('0x10')]['getdigits']=function(_0x3e445d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3e445d[_0xe9bd('0x38')]));if(_0x3e445d[_0xe9bd('0xa1')]===0x0){return this['maxRetry'](_0x3e445d);}_0x3e445d['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x3e445d['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xf8'));}var _0x4feba7=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xfa')]);if(!_0x4feba7){return this[_0xe9bd('0xf')]['error'](_0x3e445d,_0xe9bd('0xfb'));}if(!this[_0xe9bd('0xa0')](_0x3e445d[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0xe9bd('0xc9'));}var _0x4d2675=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x4feba7,_0x3e445d[_0xe9bd('0xfd')],_0x3e445d[_0xe9bd('0xfe')]);var _0x458fe0=_0x4d2675[_0xe9bd('0x9d')]?_0x4d2675[_0xe9bd('0x9d')][_0xe9bd('0x4b')]():'';logger['info']('test',JSON[_0xe9bd('0x72')](_0x4d2675));if(_0x4d2675[_0xe9bd('0x9d')]===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);return _0x4d2675;}else if(_0x4d2675[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0[_0xe9bd('0x9a')]>=parseInt(_0x3e445d[_0xe9bd('0xff')])?'x':'i';}else{_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0['length']>=parseInt(_0x3e445d[_0xe9bd('0xff')])&&_0x458fe0[_0xe9bd('0x9a')]<=parseInt(_0x3e445d[_0xe9bd('0xfe')])?'x':'i';}var _0xd98d29=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xca')]);if(!_0xd98d29){return this['channel'][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xd98d29,_0x458fe0);if(this[_0xe9bd('0xa0')](_0x3e445d['hiddendigitsnum'])){var _0x3be5d4=parseInt(_0x3e445d[_0xe9bd('0x100')],0xa);var _0x3fd3fb=rs[_0xe9bd('0x101')]({'charset':'*','length':_0x3be5d4});var _0x333e0e=_0x458fe0['length'];if(_0x333e0e>0x0){if(_0x333e0e>_0x3be5d4){this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,_0x3e445d[_0xe9bd('0x102')]===_0xe9bd('0x103')?_0x3fd3fb+_0x458fe0[_0xe9bd('0x104')](_0x3be5d4):_0x458fe0['substr'](0x0,_0x333e0e-_0x3be5d4)+_0x3fd3fb);}else{this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3e445d,rs[_0xe9bd('0x101')]({'charset':'*','length':_0x333e0e}));}}else{this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,'');}}else{this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);}return _0x4d2675;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xe')]=function(_0x2e3595){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x105'),_0x2e3595[_0xe9bd('0x38')]));return this[_0xe9bd('0xd')](_0x2e3595);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x106')]=function(_0x3b5bca){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x107'),_0x3b5bca[_0xe9bd('0x38')]));this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3b5bca,_0x3b5bca[_0xe9bd('0x108')]);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x109'),_0x3b5bca[_0xe9bd('0x108')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x10a')]=function(_0x52d59e){logger['info'](util[_0xe9bd('0x29')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x52d59e[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x83')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x10b'));}if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10c'),_0x52d59e[_0xe9bd('0x59')]));var _0x1b346d=this['awsPolly'][_0xe9bd('0x6f')](this,_0x52d59e);if(_0x1b346d){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10d'),_0x1b346d));var _0x3e06f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x1b346d);try{fs[_0xe9bd('0xeb')](_0x1b346d+_0xe9bd('0x10e'));}catch(_0x1871eb){logger[_0xe9bd('0x2b')](_0x1871eb);}return _0x3e06f7;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x52d59e,_0xe9bd('0x10f'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x110')]=function(_0x249e3a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x249e3a[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x249e3a[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x249e3a['aws_secret_access_key'])){return this[_0xe9bd('0xf')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x249e3a['aws_bot_name'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x111'));}if(!this['isConfigured'](_0x249e3a[_0xe9bd('0x59')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0x112')]=!![];this['createSquareDetailsReport'](_0x249e3a);this['createSquareMessage'](_0x249e3a[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x113'),_0x249e3a['text']));var _0x7bf3ff=this['awsLex'][_0xe9bd('0x6f')](this,_0x249e3a);if(_0x7bf3ff){for(var _0x1c4e38 in _0x7bf3ff){if(_0x7bf3ff[_0xe9bd('0x91')](_0x1c4e38)&&_['isString'](_0x7bf3ff[_0x1c4e38])){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x114'),_0x1c4e38[_0xe9bd('0x68')]()),_0x7bf3ff[_0x1c4e38]);}}if(_[_0xe9bd('0x44')](_0x7bf3ff[_0xe9bd('0x76')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x115'));}else{this[_0xe9bd('0x41')](_0x7bf3ff[_0xe9bd('0x76')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x116'),_0x7bf3ff[_0xe9bd('0x76')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x249e3a,_0xe9bd('0x117'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x118')]=function(_0x53eb33){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x53eb33[_0xe9bd('0x38')],_0x53eb33[_0xe9bd('0x63')]));if(!this[_0xe9bd('0xa0')](_0x53eb33[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xda'));}var _0x2d7c18=_0xe9bd('0x119');var _0x27c2aa=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0xe8f186=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x27c2aa,_0x2d7c18);var _0x5564d7=!![];if(_0x53eb33[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x5564d7=![];}var _0x3b0650=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x27c2aa,_0x2d7c18,_0x53eb33[_0xe9bd('0x11e')],_0x53eb33[_0xe9bd('0x63')],undefined,_0x5564d7);if(_0x3b0650[_0xe9bd('0x9d')]!==-0x1){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x11f'),_0xe8f186));var _0x10ea33=this['googleASR'][_0xe9bd('0x6f')](this,_0x53eb33,_0xe8f186);if(_0x10ea33){for(var _0x3682d1 in _0x10ea33){if(_0x10ea33[_0xe9bd('0x91')](_0x3682d1)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x120'),_0x3682d1[_0xe9bd('0x68')]()),_0x10ea33[_0x3682d1]);}}return this['channel'][_0xe9bd('0xa9')](util['format']('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x10ea33)));}}return _0x3b0650;};AGIVertices[_0xe9bd('0x10')]['tildeasr']=function(_0x28b74b){logger['info'](util['format'](_0xe9bd('0x121'),_0x28b74b['label']));if(!this[_0xe9bd('0xa0')](_0x28b74b[_0xe9bd('0x8e')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x122'));}if(!this[_0xe9bd('0xa0')](_0x28b74b['appsecret'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x123'));}var _0x51e0b5=_0xe9bd('0x119');var _0x3c0224=util['format'](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0x44af86=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x3c0224,_0x51e0b5);var _0x53a617=!![];if(_0x28b74b['beep']===_0xe9bd('0x11c')){_0x53a617=![];}var _0x5d2b09=this['channel']['recordFile'](_0x3c0224,_0x51e0b5,_0x28b74b[_0xe9bd('0x11e')],_0x28b74b[_0xe9bd('0x63')],undefined,_0x53a617);if(_0x5d2b09[_0xe9bd('0x9d')]!==-0x1){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x124'),_0x44af86));var _0x49077e=this[_0xe9bd('0x8d')][_0xe9bd('0x6f')](this,_0x28b74b,_0x44af86);if(_0x49077e){for(var _0x95d14e in _0x49077e){if(_0x49077e['hasOwnProperty'](_0x95d14e)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('TILDE_ASR_%s',_0x95d14e[_0xe9bd('0x68')]()),_0x49077e[_0x95d14e]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x125'),JSON[_0xe9bd('0x72')](_0x49077e)));}}return _0x5d2b09;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x126')]=function(_0x550ac8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x127'),_0x550ac8[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x128')](_0x550ac8[_0xe9bd('0x3d')],_0x550ac8[_0xe9bd('0x3e')],_0x550ac8[_0xe9bd('0x129')]);};AGIVertices[_0xe9bd('0x10')]['gotoif']=function(_0x1377ec){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x12a'),_0x1377ec['label']));if(!this[_0xe9bd('0xa0')](_0x1377ec[_0xe9bd('0x12b')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1377ec,'no\x20condition\x20configured');}try{var _0x3d7f65=eval(_0x1377ec[_0xe9bd('0x12b')])?_0xe9bd('0x12c'):_0xe9bd('0x12d');this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x12e'),_0x1377ec[_0xe9bd('0x12b')],_0x3d7f65));return{'code':0xc8,'result':_0x3d7f65};}catch(_0x18aee1){return{'code':0xc8,'result':_0xe9bd('0x12d')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x12f')]=function(_0x568937){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x130'),_0x568937[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x568937[_0xe9bd('0x131')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x568937,_0xe9bd('0x132'));}var _0x5ad4a6=this['getIntervals'][_0xe9bd('0x6f')](this,_0x568937['interval_id']);if(!_0x5ad4a6){return this['channel'][_0xe9bd('0x2b')](_0x568937,'no\x20intervals\x20found');}for(var _0x122413=0x0;_0x122413<_0x5ad4a6[_0xe9bd('0x9a')];_0x122413+=0x1){var _0x3e7830=this[_0xe9bd('0xf')][_0xe9bd('0x11')](util[_0xe9bd('0x29')](_0xe9bd('0x133'),_0x5ad4a6[_0x122413]));if(_0x3e7830[_0xe9bd('0x9d')]===-0x1){return _0x3e7830;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0x3e7830[_0xe9bd('0x9e')]));if(_0x3e7830[_0xe9bd('0x9e')]===_0xe9bd('0x12c')){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('IFTIME\x20%s\x20%s',_0x5ad4a6[_0x122413],_0xe9bd('0x12c')));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'true'));return{'code':0xc8,'result':_0xe9bd('0x12c')};}else{logger['info'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0xe9bd('0x12d')));this['channel']['noop'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xe9bd('0x10')]['hangup']=function(_0x3f709e){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x135'),_0x3f709e['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x136')]();};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x137')]=function(_0x13ea8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x13ea8a['label']));if(!this['isConfigured'](_0x13ea8a['key'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}var _0x223d9b=_0xe9bd('0x119');var _0x446fe7=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs['generate'](0x4));var _0x99245c=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x446fe7,_0x223d9b);var _0x34c059=!![];if(_0x13ea8a[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x34c059=![];}var _0x510de3=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x446fe7,_0x223d9b,_0x13ea8a[_0xe9bd('0x11e')],_0x13ea8a[_0xe9bd('0x63')],undefined,_0x34c059);if(_0x510de3['result']!==-0x1){this['channel']['noop'](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x99245c));var _0x47254a=this[_0xe9bd('0x7e')][_0xe9bd('0x6f')](this,_0x13ea8a,_0x99245c);if(_0x47254a){for(var _0xb30c8f in _0x47254a){if(_0x47254a[_0xe9bd('0x91')](_0xb30c8f)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('ISPEECH_ASR_%s',_0xb30c8f[_0xe9bd('0x68')]()),_0x47254a[_0xb30c8f]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x138'),JSON[_0xe9bd('0x72')](_0x47254a)));}}return _0x510de3;};AGIVertices[_0xe9bd('0x10')]['ispeechtts']=function(_0x9766f2){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x139'),_0x9766f2[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13a'),_0x9766f2[_0xe9bd('0x59')]));var _0x293858=this[_0xe9bd('0x7a')][_0xe9bd('0x6f')](this,_0x9766f2);if(_0x293858){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x293858));var _0x3ebd5d=this[_0xe9bd('0xf')]['streamFile'](_0x293858,_0x9766f2[_0xe9bd('0x11e')]);try{fs[_0xe9bd('0xeb')](_0x293858+_0xe9bd('0x10e'));}catch(_0x148989){logger['error'](_0x148989);}return _0x3ebd5d;}return this[_0xe9bd('0xf')]['error'](_0x9766f2,_0xe9bd('0x13b'));};AGIVertices[_0xe9bd('0x10')]['login']=function(_0x143c72){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x143c72[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x143c72[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')]['error'](_0x143c72,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));var _0xe84682=this['agentLogin'][_0xe9bd('0x6f')](this,_0x143c72[_0xe9bd('0x13c')]);if(_0xe84682){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices['prototype'][_0xe9bd('0x142')]=function(_0x4ee2b7){logger['info'](util['format'](_0xe9bd('0x143'),_0x4ee2b7[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x4ee2b7[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x4ee2b7,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));var _0x48af31=this[_0xe9bd('0x51')]['sync'](this,_0x4ee2b7['findBy']);if(_0x48af31){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x145')]=function(_0x47c137){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x47c137[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x47c137[_0xe9bd('0x146')])){return this[_0xe9bd('0xf')]['error'](_0x47c137,'no\x20operation\x20configured');}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x147'),_0x47c137['operation']));var _0x4b0a01=eval(_0x47c137['operation']);if(!this['isConfigured'](_0x47c137[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x253be2=this[_0xe9bd('0x11')]['sync'](this,_0x47c137['variable_id']);if(!_0x253be2){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x47c137,_0xe9bd('0xcb'));}if(_[_0xe9bd('0x148')](_0x4b0a01)){var _0x517e1d=this;_0x4b0a01['forEach'](function(_0x5a8333,_0x3c091e){_0x517e1d['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s]',_0x253be2,_0x3c091e),_0x5a8333);});return this['channel'][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x149'),_0x253be2));}else{return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x253be2,_0x4b0a01);}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xc')]=function(_0x5482ad){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14a'),_0x5482ad[_0xe9bd('0x38')]));if(_0x5482ad[_0xe9bd('0xa1')]===0x0){return this[_0xe9bd('0x14b')](_0x5482ad);}_0x5482ad['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x5482ad['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xf8'));}var _0x2b5eaa=this['getSound'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xfa')]);if(!_0x2b5eaa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,'no\x20file\x20audio\x20found');}var _0xf9e1e2=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x2b5eaa,_0x5482ad['response'],_0x5482ad[_0xe9bd('0x14c')]);var _0x2ce47d=_0xf9e1e2[_0xe9bd('0x9d')];if(_0xf9e1e2['result']===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,'-1');return _0xf9e1e2;}else if(_0xf9e1e2[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0xf9e1e2[_0xe9bd('0x9d')]=_0xf9e1e2[_0xe9bd('0x9d')][_0xe9bd('0x9a')]>0x0?_0xf9e1e2['result']:'t';}else if(_['isEmpty'](_0xf9e1e2[_0xe9bd('0x9d')])){_0xf9e1e2[_0xe9bd('0x9d')]='#';_0x2ce47d='#';}if(!this[_0xe9bd('0xa0')](_0x5482ad['variable_id'])){this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}else{var _0x2e3586=this['getVariable'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xca')]);if(!_0x2e3586){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x2e3586,_0x2ce47d);}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,_0x2ce47d);return _0xf9e1e2;};AGIVertices['prototype']['noop']=function(_0x22dd87){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14d'),_0x22dd87['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0x22dd87[_0xe9bd('0x14e')]||_0x22dd87[_0xe9bd('0x38')]);};AGIVertices[_0xe9bd('0x10')]['pause']=function(_0x39e628){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14f'),_0x39e628['label']));if(!this['isConfigured'](_0x39e628[_0xe9bd('0x13c')])){return this['channel'][_0xe9bd('0x2b')](_0x39e628,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));var _0x5690ee=this[_0xe9bd('0x4d')][_0xe9bd('0x6f')](this,_0x39e628['pause_id']);var _0x5c26b7=this[_0xe9bd('0x4e')][_0xe9bd('0x6f')](this,_0x39e628[_0xe9bd('0x13c')],_0x5690ee);if(_0x5c26b7){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')]['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x150')]=function(_0x43d731){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x151'),_0x43d731[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x43d731[_0xe9bd('0xfa')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xf8'));}var _0xc877fd=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x43d731[_0xe9bd('0xfa')]);if(!_0xc877fd){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xfb'));}var _0x57e43c=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x152'),[_0xc877fd,_0x43d731[_0xe9bd('0xd7')]]);if(_0x57e43c[_0xe9bd('0x9d')]===-0x1){return _0x57e43c;}return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'PLAYBACK',_0xc877fd));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x153')]=function(_0x3cd856){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x154'),_0x3cd856[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3cd856[_0xe9bd('0x155')])){return this[_0xe9bd('0xf')]['error'](_0x3cd856,_0xe9bd('0x156'));}var _0x912dfa='';var _0x1b633b=parseInt(_0x3cd856[_0xe9bd('0x155')],0xa);if(isNaN(_0x1b633b)){_0x912dfa=_0x3cd856[_0xe9bd('0x155')];}else{_0x912dfa=this[_0xe9bd('0x16')]['sync'](this,_0x3cd856[_0xe9bd('0x155')]);if(!_0x912dfa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3cd856,_0xe9bd('0x157'));}}var _0x42d9cb='';if(this[_0xe9bd('0xa0')](_0x3cd856['file_id'])){var _0x1b9aa3=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3cd856[_0xe9bd('0xfa')]);if(_0x1b9aa3){_0x42d9cb=_0x1b9aa3;}}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3cd856,_0x912dfa);if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('x')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='x';}if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('X')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='X';}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x158'),_0x912dfa?_0x912dfa[_0xe9bd('0x159')]():'');var _0xe27daf=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x15a'),[_0x912dfa,_0x3cd856['opts'],_0x3cd856['url'],_0x42d9cb,_0x3cd856['timeout'],_0x3cd856[_0xe9bd('0x7')],_0x3cd856[_0xe9bd('0x15b')],_0x3cd856[_0xe9bd('0x15c')],'',_0x3cd856['position']]);if(_0xe27daf[_0xe9bd('0x9d')]===-0x1){return _0xe27daf;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20%s\x20%s',_0xe9bd('0x15a'),_0x912dfa));};AGIVertices[_0xe9bd('0x10')]['record']=function(_0x13bb4f){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x13bb4f[_0xe9bd('0x38')]));var _0x7adf3a=_0x13bb4f[_0xe9bd('0x15d')]||'wav';var _0x4ca812=util[_0xe9bd('0x29')](_0xe9bd('0x15e'),this['channel'][_0xe9bd('0x37')],rs[_0xe9bd('0x101')](0x5));var _0x3b7324=util[_0xe9bd('0x29')](_0xe9bd('0x15f'),FILES_PATH,_0x4ca812,_0x7adf3a);var _0x126e2e=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,_0x4ca812);this[_0xe9bd('0x3c')][_0xe9bd('0x6f')](this,_0x13bb4f,_0x4ca812,_0x3b7324);this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x160'),_0x4ca812);logger['info'](_0xe9bd('0x161'),_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f[_0xe9bd('0x63')]);return this[_0xe9bd('0xf')]['recordFile'](_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f['timeout'],undefined,!![]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x163')]=function(_0x258d43){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x164'),_0x258d43['label']));if(!this['isConfigured'](_0x258d43[_0xe9bd('0x62')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x165'));}var _0x3a5061=this[_0xe9bd('0x61')]['sync'](this,_0x258d43);logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x166'),util['inspect'](_0x3a5061,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x258d43[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x25cf50=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x258d43[_0xe9bd('0xca')]);if(!_0x25cf50){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x258d43,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x167'),_0x25cf50),_0x3a5061[_0xe9bd('0x74')]?_0x3a5061[_0xe9bd('0x74')]:_0xe9bd('0x168'));this['channel']['setVariable'](util[_0xe9bd('0x29')]('%s_STATUS_MESSAGE',_0x25cf50),_0x3a5061['statusMessage']?_0x3a5061[_0xe9bd('0x75')]:'OK');if(_0x3a5061[_0xe9bd('0x69')]){try{this[_0xe9bd('0x97')](_0x3a5061[_0xe9bd('0x69')],_0x25cf50);}catch(_0x40b617){logger[_0xe9bd('0x2b')](util[_0xe9bd('0x29')](_0xe9bd('0x169'),_0x25cf50));}}return this[_0xe9bd('0xf')]['noop'](util['format']('variable\x20%s\x20set',_0x25cf50));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16a')]=function(_0x4637c3){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x16b'),_0x4637c3['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16c')](_0x4637c3['digits']['replace'](/\s+/g,''),_0x4637c3[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16d')]=function(_0x4e7305){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4e7305['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16e')](_0x4e7305[_0xe9bd('0x64')][_0xe9bd('0x56')](/\s+/g,''),_0x4e7305[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16f')]=function(_0x47e667){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x47e667['label']));return this['channel'][_0xe9bd('0x170')](_0x47e667[_0xe9bd('0x59')],_0x47e667[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x171')]=function(_0x48db15){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x48db15[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x48db15[_0xe9bd('0x172')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x173'));}var _0x430aaf=this[_0xe9bd('0x20')][_0xe9bd('0x6f')](this,_0x48db15[_0xe9bd('0x172')]);if(!_0x430aaf||!_0x430aaf[_0xe9bd('0x174')]){return this['channel'][_0xe9bd('0x2b')](_0x48db15,'no\x20mail\x20account\x20found');}var _0x569660={'from':util[_0xe9bd('0x29')](_0xe9bd('0x175'),_0x430aaf[_0xe9bd('0x18')],_0x430aaf[_0xe9bd('0x176')]||_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')]),'to':_0x48db15['to']||'','cc':_0x48db15['cc']||'','bcc':_0x48db15[_0xe9bd('0x178')]||'','subject':_0x48db15[_0xe9bd('0x179')],'html':_0x48db15['text'],'text':_0x48db15[_0xe9bd('0x59')]};var _0x3c38b5={'tls':{'rejectUnauthorized':![]}};if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17a')]){_0x3c38b5[_0xe9bd('0x17a')]=_0x430aaf[_0xe9bd('0x174')]['service'];}else{_0x3c38b5[_0xe9bd('0x17b')]=_0x430aaf[_0xe9bd('0x174')]['host'];_0x3c38b5[_0xe9bd('0x17c')]=_0x430aaf[_0xe9bd('0x174')]['port'];_0x3c38b5[_0xe9bd('0x17d')]=_0x430aaf['Smtp']['secure'];}if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17e')]){_0x3c38b5[_0xe9bd('0x17f')]={'user':_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')],'pass':_0x430aaf[_0xe9bd('0x174')]['pass']};}if(this['isConfigured'](_0x48db15[_0xe9bd('0x180')])){}logger[_0xe9bd('0xd1')](_0xe9bd('0x181'),JSON[_0xe9bd('0x72')](_0x569660));this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x48db15,_0x48db15['account_id']);this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x182'),_0x430aaf[_0xe9bd('0x18')]));this[_0xe9bd('0x21')][_0xe9bd('0x6f')](this,_0x3c38b5,_0x569660);return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x183'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x184')]=function(_0x42c0d5){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x185'),_0x42c0d5[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x186')]=function(_0x1000d1){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x187'),_0x1000d1[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1000d1[_0xe9bd('0x188')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20sms\x20account\x20configured');}var _0x5504f5=this[_0xe9bd('0x33')]['sync'](this,_0x1000d1[_0xe9bd('0x188')]);if(!_0x5504f5){return this[_0xe9bd('0xf')]['error'](_0x1000d1,_0xe9bd('0x189'));}var _0x19cf5a={'body':_0x1000d1[_0xe9bd('0x18a')],'phone':_0x1000d1['to']||'','SmsAccountId':_0x5504f5['id']};logger['debug']('sendSMS\x20message',JSON[_0xe9bd('0x72')](_0x19cf5a));this[_0xe9bd('0x36')]['sync'](this,_0x1000d1,_0x1000d1[_0xe9bd('0x188')]);this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x18b'),_0x5504f5[_0xe9bd('0x18')]));this[_0xe9bd('0x35')][_0xe9bd('0x6f')](this,_0x19cf5a);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x18c'));};AGIVertices['prototype'][_0xe9bd('0x18d')]=function(_0x312523){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x18e'),_0x312523[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x312523[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')]['error'](_0x312523,'no\x20variable\x20selected');}var _0x447903=this[_0xe9bd('0x11')]['sync'](this,_0x312523['variable_id']);if(!_0x447903){return this['channel'][_0xe9bd('0x2b')](_0x312523,_0xe9bd('0xcb'));}return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x447903,_0x312523[_0xe9bd('0x18f')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x190')]=function(_0x27dc44){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x191'),_0x27dc44[_0xe9bd('0x38')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x192'));if(_0x27dc44['answer']==='yes'){this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('Answer');return this[_0xe9bd('0xf')][_0xe9bd('0xa4')]();}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x193'));};AGIVertices['prototype'][_0xe9bd('0x194')]=function(_0x5d4e3d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x195'),_0x5d4e3d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x5d4e3d[_0xe9bd('0x196')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5d4e3d,_0xe9bd('0x197'));}var _0x5b7666=this[_0xe9bd('0x198')]['sync'](this,_0x5d4e3d[_0xe9bd('0x196')]);if(!this[_0xe9bd('0xa0')](_0x5b7666)){return this['channel']['error'](_0x5d4e3d,util[_0xe9bd('0x29')](_0xe9bd('0x199'),_0x5d4e3d[_0xe9bd('0x196')]));}if(_0x5b7666===this[_0xe9bd('0xf')][_0xe9bd('0x3a')]){return this[_0xe9bd('0xf')]['error'](_0x5d4e3d,_0xe9bd('0x19a'));}this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x5d4e3d,_0x5b7666);var _0xa9de92=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x19b'),util[_0xe9bd('0x29')](_0xe9bd('0x19c'),config[_0xe9bd('0x7')][_0xe9bd('0x17b')]||_0xe9bd('0x19d'),_0x5b7666,this['channel']['arg_1']));if(_0xa9de92[_0xe9bd('0x9d')]===-0x1){return _0xa9de92;}return this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'AGI',_0x5b7666));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x19e')]=function(_0x1b8df2){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1b8df2[_0xe9bd('0x38')]));var _0x4bf6f8=this[_0xe9bd('0x19f')][_0xe9bd('0x6f')](this,_0x1b8df2['command']);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x1b8df2,_0x1b8df2['command']);if(this['isConfigured'](_0x1b8df2['variable_id'])){var _0x347d01=this['getVariable'][_0xe9bd('0x6f')](this,_0x1b8df2[_0xe9bd('0xca')]);if(_0x347d01){this[_0xe9bd('0xf')]['setVariable'](_0x347d01,_0x4bf6f8);return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1b8df2[_0xe9bd('0xa3')],_0x347d01));}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1b8df2['command']));};AGIVertices[_0xe9bd('0x10')]['google_cloud_tts']=function(_0xf82d5f){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xf82d5f[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0xf82d5f[_0xe9bd('0x58')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0xf82d5f[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a0'),_0xf82d5f[_0xe9bd('0x59')]));var _0x27ed51=this[_0xe9bd('0x57')][_0xe9bd('0x6f')](this,_0xf82d5f);if(_0x27ed51){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a1'),_0x27ed51));var _0x3657f3=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x27ed51);try{fs[_0xe9bd('0xeb')](_0x27ed51+'.wav');}catch(_0x502a91){logger['error'](_0x502a91);}return _0x3657f3;}return this['channel'][_0xe9bd('0x2b')](_0xf82d5f,_0xe9bd('0x1a2'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a3')]=function(_0x3bd62c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1a4'),_0x3bd62c['label']));if(!this[_0xe9bd('0xa0')](_0x3bd62c['text'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a5'),_0x3bd62c['text']));var _0x2980b6=this[_0xe9bd('0x60')][_0xe9bd('0x6f')](this,_0x3bd62c);if(_0x2980b6){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a6'),_0x2980b6));var _0x392c36=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x2980b6);try{fs['unlink'](_0x2980b6+_0xe9bd('0x10e'));}catch(_0x2d453b){logger[_0xe9bd('0x2b')](_0x2d453b);}return _0x392c36;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3bd62c,_0xe9bd('0x1a7'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a8')]=function(_0x405b45){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1a9'),_0x405b45['label']));if(!this[_0xe9bd('0xa0')](_0x405b45['findBy'])){return this['channel'][_0xe9bd('0x2b')](_0x405b45,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));var _0x5710b5=this[_0xe9bd('0x50')]['sync'](this,_0x405b45[_0xe9bd('0x13c')]);if(_0x5710b5){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')]['callerid'],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1aa')]=function(_0x981d02){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1ab'),_0x981d02[_0xe9bd('0x38')]));var _0xa800ed=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x1ac'),[_0x981d02['mailbox'],_0x981d02[_0xe9bd('0x77')]]);if(_0xa800ed[_0xe9bd('0x9d')]===-0x1){return _0xa800ed;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'VOICEMAIL',_0x981d02[_0xe9bd('0x1ad')]));};AGIVertices['prototype'][_0xe9bd('0x1ae')]=function(_0x1e869c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1af'),_0x1e869c[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1e869c[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1e869c,'no\x20variable\x20selected');}var _0x2cacd4=this['getVariable'][_0xe9bd('0x6f')](this,_0x1e869c[_0xe9bd('0xca')]);if(!_0x2cacd4){return this['channel']['error'](_0x1e869c,_0xe9bd('0xcb'));}var _0x38abb0=this['channel'][_0xe9bd('0x11')](_0x2cacd4);return{'code':0xc8,'result':_0x38abb0['extra']?_0x38abb0[_0xe9bd('0x9e')]:'-'};};String[_0xe9bd('0x10')][_0xe9bd('0x9b')]=function(_0x23ed69,_0x564c4e){return this['split'](_0x23ed69)[_0xe9bd('0x1b0')](_0x564c4e);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 1286f9d..4af82da 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 _0xe14d=['agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','uniqueid','updateAcw','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','startAcw','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup'];(function(_0x821421,_0x4520c3){var _0x4dbbbe=function(_0x3f1e1f){while(--_0x3f1e1f){_0x821421['push'](_0x821421['shift']());}};_0x4dbbbe(++_0x4520c3);}(_0xe14d,0x1ee));var _0xde14=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xe14d[_0x24061a];return _0x82054e;};'use strict';var util=require(_0xde14('0x0'));var _=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var ami=require(_0xde14('0x3'));var logger=require('../../../config/logger')(_0xde14('0x4'));var RpcUser=require(_0xde14('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1c3e94){this[_0xde14('0x6')]=_0x1c3e94[_0xde14('0x6')];this[_0xde14('0x7')]=_0x1c3e94[_0xde14('0x7')];this[_0xde14('0x8')]=_0x1c3e94['timers'];this['channels']={};ami['on'](_0xde14('0x9'),this[_0xde14('0xa')][_0xde14('0xb')](this));ami['on'](_0xde14('0xc'),this[_0xde14('0xd')][_0xde14('0xb')](this));ami['on'](_0xde14('0xe'),this[_0xde14('0xf')]['bind'](this));ami['on'](_0xde14('0x10'),this[_0xde14('0x11')][_0xde14('0xb')](this));ami['on'](_0xde14('0x12'),this[_0xde14('0x13')][_0xde14('0xb')](this));ami['on'](_0xde14('0x14'),this[_0xde14('0x15')][_0xde14('0xb')](this));ami['on'](_0xde14('0x16'),this[_0xde14('0x17')][_0xde14('0xb')](this));}function getDiff(_0x3521d4){var _0x281c54=moment()[_0xde14('0x18')](0x0);var _0x54c58b=moment(_0x3521d4)['milliseconds'](0x0);return _0x281c54[_0xde14('0x19')](_0x54c58b,_0xde14('0x1a'));}Acw[_0xde14('0x1b')]['startAcw']=function(_0x16aa55){try{var _0x31adb3=this;var _0x257390=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1d')];var _0x1b9d4b=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1e')];var _0x3cc317=this[_0xde14('0x6')][_0x1b9d4b];var _0x590a8b=![];var _0x3f5fcf=_0xde14('0x1f');if(_0x3cc317[_0xde14('0x20')]){if(_0x3cc317[_0xde14('0x21')]['name']){_0x590a8b=!![];_0x3f5fcf=_0x3cc317[_0xde14('0x21')]['name'];}}ami[_0xde14('0x22')]({'action':'QueuePause','interface':_0x257390,'paused':!![],'reason':_0x3f5fcf})[_0xde14('0x23')](function(_0x30fcf1){if(_0x31adb3[_0xde14('0x7')][_0x257390]){return RpcUser[_0xde14('0x24')](_0x31adb3[_0xde14('0x7')][_0x257390]['id'])[_0xde14('0x23')](function(_0x40b648){if(_0x40b648&&!_0x40b648[_0xde14('0x25')]){logger[_0xde14('0x26')](_0xde14('0x27'),_0x16aa55,_0x257390,_0x1b9d4b);var _0x475f2f=_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x28')]&&_0x31adb3['channels'][_0x16aa55][_0xde14('0x29')]?_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x29')]:_0x16aa55;return RpcUser[_0xde14('0x2a')](_0x31adb3[_0xde14('0x7')][_0x257390],_0x3f5fcf,_0x475f2f)[_0xde14('0x23')](function(_0x310d75){if(!_0x590a8b){_0x31adb3[_0xde14('0x8')][_0x257390]={};logger[_0xde14('0x26')](_0xde14('0x2b'),_0x16aa55,_0x31adb3['voiceQueues'][_0x1b9d4b][_0xde14('0x2c')],_0x257390,_0x1b9d4b);_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]=setTimeout(_0x31adb3[_0xde14('0x2e')]['bind'](_0x31adb3,_0x257390),_0x31adb3[_0xde14('0x6')][_0x1b9d4b][_0xde14('0x2c')]*0x3e8);_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']=moment()[_0xde14('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')]=_0x16aa55;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x1e')]=_0x1b9d4b;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x31')]=function(){var _0xae9dca=getDiff(_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']);clearTimeout(_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]);_0x31adb3['timers'][_0x257390][_0xde14('0x2d')]=![];RpcVoiceAgentReport['update']({'acwtime':_0xae9dca},_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')],_0x257390)[_0xde14('0x23')](function(_0x21a916){logger[_0xde14('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x16aa55,_0xae9dca,_0x21a916);})[_0xde14('0x32')](function(_0x57b98b){logger['error'](_0xde14('0x33'),_0x16aa55,_0x57b98b);});delete _0x31adb3[_0xde14('0x8')][_0x257390];};}});}else{logger[_0xde14('0x26')](_0xde14('0x34'),_0x16aa55,_0x257390,_0x1b9d4b);}});}})[_0xde14('0x32')](function(_0xa41c1e){logger[_0xde14('0x35')](_0xde14('0x2b'),_0x16aa55,_0x31adb3[_0xde14('0x6')][_0x1b9d4b]['acwTimeout'],_0x257390,_0x1b9d4b);})['finally'](function(){delete _0x31adb3[_0xde14('0x1c')][_0x16aa55];});}catch(_0x403007){logger[_0xde14('0x35')](_0xde14('0x36'),_0x403007[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x2e')]=function(_0x2b0bc4){try{var _0x2ac7ba=this;if(_0x2ac7ba['timers'][_0x2b0bc4]){_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4]['timer']=![];var _0x4a363c=_0x2ac7ba['timers'][_0x2b0bc4][_0xde14('0x30')];var _0x258759=_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4][_0xde14('0x1e')];var _0x1228d8=_0x2ac7ba[_0xde14('0x6')][_0x258759][_0xde14('0x2c')];logger[_0xde14('0x26')]('[TIMER][STOP][AGENT:%s]',_0x2b0bc4);RpcUser[_0xde14('0x38')](this[_0xde14('0x7')][_0x2b0bc4]);RpcVoiceAgentReport[_0xde14('0x39')]({'acwtime':_0x1228d8,'agentacw':!![]},_0x4a363c,_0x2b0bc4)[_0xde14('0x23')](function(_0x346566){logger[_0xde14('0x26')](_0xde14('0x3a'),_0x4a363c,_0x1228d8,_0x346566);})[_0xde14('0x32')](function(_0x50db0d){logger[_0xde14('0x35')](_0xde14('0x33'),_0x4a363c,_0x50db0d);});}else{logger[_0xde14('0x35')](_0xde14('0x3b'),_0x2b0bc4);if(_0x2ac7ba['timers']){logger['info'](_0xde14('0x3c'),JSON[_0xde14('0x3d')](_0x2ac7ba[_0xde14('0x8')]));}}}catch(_0x171080){logger[_0xde14('0x35')]('[ACW][STOP]\x20%s',_0x171080[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0xa')]=function(_0x595fd5){try{if(this[_0xde14('0x6')][_0x595fd5['queue']]&&(this[_0xde14('0x6')][_0x595fd5['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x595fd5[_0xde14('0x1e')]][_0xde14('0x20')])){if(this[_0xde14('0x7')][_0x595fd5[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x595fd5[_0xde14('0x30')]]={'queue':_0x595fd5['queue'],'interface':_0x595fd5[_0xde14('0x1d')],'destlinkedid':_0x595fd5['destlinkedid']};}}}catch(_0x430b22){logger['error'](_0xde14('0x3e'),_0x430b22[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x17')]=function(_0x40e7ae){try{if(this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]]&&(this[_0xde14('0x6')][_0x40e7ae['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]][_0xde14('0x20')])){if(this['agents'][_0x40e7ae[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x40e7ae[_0xde14('0x30')]]={'queue':_0x40e7ae[_0xde14('0x1e')],'interface':_0x40e7ae[_0xde14('0x1d')]};}}}catch(_0x19e12c){logger['error'](_0xde14('0x3f'),_0x19e12c['message']);}};Acw[_0xde14('0x1b')][_0xde14('0xd')]=function(_0x48a677){try{if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]][_0xde14('0x28')])){logger[_0xde14('0x26')]('[%s][HANGUP:UNIQUEID]',_0x48a677[_0xde14('0x30')]);this['startAcw'](_0x48a677[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]][_0xde14('0x28')])){logger[_0xde14('0x26')](_0xde14('0x42'),_0x48a677[_0xde14('0x41')]);this['startAcw'](_0x48a677[_0xde14('0x41')]);}}catch(_0x1688c6){logger[_0xde14('0x35')](_0xde14('0x43'),_0x1688c6[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0xf')]=function(_0x4dc2e3){try{if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]][_0xde14('0x28')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4dc2e3[_0xde14('0x30')]);this['startAcw'](_0x4dc2e3[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]][_0xde14('0x28')]){logger[_0xde14('0x26')](_0xde14('0x44'),_0x4dc2e3[_0xde14('0x41')]);this['startAcw'](_0x4dc2e3[_0xde14('0x41')]);}}catch(_0x2c972b){logger[_0xde14('0x35')](_0xde14('0x45'),_0x2c972b[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0x13')]=function(_0x58790d){try{if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x47')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x47')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]]){this[_0xde14('0x1c')][_0x58790d['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x58790d[_0xde14('0x4a')]]=this['channels'][_0x58790d['secondtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]];}}else if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4a')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x4a')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]]){this['channels'][_0x58790d[_0xde14('0x4b')]][_0xde14('0x28')]=!![];this[_0xde14('0x1c')][_0x58790d['transfereeuniqueid']]=this[_0xde14('0x1c')][_0x58790d['origtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]];}}}catch(_0x40ab83){logger[_0xde14('0x35')](_0xde14('0x4c'),_0x40ab83[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')]['syncBlindTransfer']=function(_0x3a357a){try{if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4d')]]){logger[_0xde14('0x26')](_0xde14('0x4e'),JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4d')]));this['startAcw'](_0x3a357a['transfereruniqueid']);}else if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4f')]]){logger[_0xde14('0x26')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4f')]));this[_0xde14('0x48')](_0x3a357a[_0xde14('0x4f')]);}}catch(_0x51e8ca){logger['error'](_0xde14('0x50'),_0x51e8ca[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x11')]=function(_0x136c21){try{if(this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]]&&this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]][_0xde14('0x51')]===_0xde14('0x52')){if(this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]]){logger[_0xde14('0x26')](_0xde14('0x53'),_0x136c21[_0xde14('0x30')],_0x136c21[_0xde14('0x1d')],_0x136c21[_0xde14('0x1e')]);return RpcUser[_0xde14('0x2a')](this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]],_0xde14('0x54'),_0x136c21[_0xde14('0x30')]);}}}catch(_0x4809fa){logger[_0xde14('0x35')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4809fa[_0xde14('0x37')]);}};module['exports']=Acw; \ No newline at end of file +var _0x3e74=['acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','message','attended','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','exports','util','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','agentringnoanswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer'];(function(_0x15ea09,_0x2f30ab){var _0x3e9c78=function(_0x15f8ba){while(--_0x15f8ba){_0x15ea09['push'](_0x15ea09['shift']());}};_0x3e9c78(++_0x2f30ab);}(_0x3e74,0x175));var _0x43e7=function(_0x22a074,_0x2467ca){_0x22a074=_0x22a074-0x0;var _0x37032a=_0x3e74[_0x22a074];return _0x37032a;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var moment=require(_0x43e7('0x1'));var ami=require(_0x43e7('0x2'));var logger=require(_0x43e7('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x43e7('0x4'));function Acw(_0x4f9bbe){this[_0x43e7('0x5')]=_0x4f9bbe[_0x43e7('0x5')];this[_0x43e7('0x6')]=_0x4f9bbe[_0x43e7('0x6')];this[_0x43e7('0x7')]=_0x4f9bbe['timers'];this[_0x43e7('0x8')]={};ami['on'](_0x43e7('0x9'),this[_0x43e7('0xa')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xc'),this['syncHangupRequest'][_0x43e7('0xb')](this));ami['on']('hangup',this['syncHangup'][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xd'),this['syncAgentRingNoAnswer'][_0x43e7('0xb')](this));ami['on']('attendedtransfer',this[_0x43e7('0xe')][_0x43e7('0xb')](this));ami['on']('blindtransfer',this[_0x43e7('0xf')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0x10'),this[_0x43e7('0x11')]['bind'](this));}function getDiff(_0x583d85){var _0x2fcb36=moment()[_0x43e7('0x12')](0x0);var _0x44b0bd=moment(_0x583d85)['milliseconds'](0x0);return _0x2fcb36['diff'](_0x44b0bd,_0x43e7('0x13'));}Acw[_0x43e7('0x14')][_0x43e7('0x15')]=function(_0x328445){try{var _0x4de324=this;var _0x5c4eaa=this[_0x43e7('0x8')][_0x328445][_0x43e7('0x16')];var _0x273a32=this['channels'][_0x328445]['queue'];var _0x446986=this[_0x43e7('0x5')][_0x273a32];var _0x9037d3=![];var _0x140657=_0x43e7('0x17');if(_0x446986[_0x43e7('0x18')]){if(_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')]){_0x9037d3=!![];_0x140657=_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')];}}ami[_0x43e7('0x1b')]({'action':_0x43e7('0x1c'),'interface':_0x5c4eaa,'paused':!![],'reason':_0x140657})['then'](function(_0xef1a5a){if(_0x4de324[_0x43e7('0x6')][_0x5c4eaa]){return RpcUser['getAgent'](_0x4de324[_0x43e7('0x6')][_0x5c4eaa]['id'])[_0x43e7('0x1d')](function(_0x3945bb){if(_0x3945bb&&!_0x3945bb[_0x43e7('0x1e')]){logger[_0x43e7('0x1f')](_0x43e7('0x20'),_0x328445,_0x5c4eaa,_0x273a32);var _0x54a9e7=_0x4de324[_0x43e7('0x8')][_0x328445]['attended']&&_0x4de324['channels'][_0x328445][_0x43e7('0x21')]?_0x4de324[_0x43e7('0x8')][_0x328445]['destlinkedid']:_0x328445;return RpcUser[_0x43e7('0x22')](_0x4de324['agents'][_0x5c4eaa],_0x140657,_0x54a9e7)[_0x43e7('0x1d')](function(_0x5c5e67){if(!_0x9037d3){_0x4de324[_0x43e7('0x7')][_0x5c4eaa]={};logger[_0x43e7('0x1f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);_0x4de324['timers'][_0x5c4eaa][_0x43e7('0x24')]=setTimeout(_0x4de324['stopAcw'][_0x43e7('0xb')](_0x4de324,_0x5c4eaa),_0x4de324[_0x43e7('0x5')][_0x273a32][_0x43e7('0x25')]*0x3e8);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['lastPauseAt']=moment()[_0x43e7('0x26')](_0x43e7('0x27'));_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')]=_0x328445;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x29')]=_0x273a32;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2a')]=function(){var _0x3bf475=getDiff(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2b')]);clearTimeout(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x24')]);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['timer']=![];RpcVoiceAgentReport[_0x43e7('0x2c')]({'acwtime':_0x3bf475},_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')],_0x5c4eaa)[_0x43e7('0x1d')](function(_0x4251c8){logger['info'](_0x43e7('0x2d'),_0x328445,_0x3bf475,_0x4251c8);})[_0x43e7('0x2e')](function(_0x30d47e){logger[_0x43e7('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x328445,_0x30d47e);});delete _0x4de324['timers'][_0x5c4eaa];};}});}else{logger['info'](_0x43e7('0x30'),_0x328445,_0x5c4eaa,_0x273a32);}});}})[_0x43e7('0x2e')](function(_0x117c07){logger[_0x43e7('0x2f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);})['finally'](function(){delete _0x4de324['channels'][_0x328445];});}catch(_0x59e5b2){logger['error']('[ACW][START]\x20%s',_0x59e5b2['message']);}};Acw[_0x43e7('0x14')]['stopAcw']=function(_0x2b4bfd){try{var _0x8e9f40=this;if(_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]){_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd][_0x43e7('0x24')]=![];var _0x449803=_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]['uniqueid'];var _0x5332d9=_0x8e9f40['timers'][_0x2b4bfd][_0x43e7('0x29')];var _0xfe70e9=_0x8e9f40[_0x43e7('0x5')][_0x5332d9][_0x43e7('0x25')];logger[_0x43e7('0x1f')](_0x43e7('0x31'),_0x2b4bfd);RpcUser[_0x43e7('0x32')](this[_0x43e7('0x6')][_0x2b4bfd]);RpcVoiceAgentReport['update']({'acwtime':_0xfe70e9,'agentacw':!![]},_0x449803,_0x2b4bfd)[_0x43e7('0x1d')](function(_0x2b0ffe){logger['info'](_0x43e7('0x2d'),_0x449803,_0xfe70e9,_0x2b0ffe);})['catch'](function(_0x44d8e4){logger[_0x43e7('0x2f')](_0x43e7('0x33'),_0x449803,_0x44d8e4);});}else{logger[_0x43e7('0x2f')](_0x43e7('0x34'),_0x2b4bfd);if(_0x8e9f40[_0x43e7('0x7')]){logger['info']('[ACW][TIMERS]',JSON[_0x43e7('0x35')](_0x8e9f40[_0x43e7('0x7')]));}}}catch(_0x44b6ae){logger[_0x43e7('0x2f')](_0x43e7('0x36'),_0x44b6ae['message']);}};Acw[_0x43e7('0x14')][_0x43e7('0xa')]=function(_0x575439){try{if(this[_0x43e7('0x5')][_0x575439['queue']]&&(this[_0x43e7('0x5')][_0x575439['queue']][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x575439[_0x43e7('0x29')]][_0x43e7('0x18')])){if(this['agents'][_0x575439['interface']]){this[_0x43e7('0x8')][_0x575439[_0x43e7('0x28')]]={'queue':_0x575439[_0x43e7('0x29')],'interface':_0x575439[_0x43e7('0x16')],'destlinkedid':_0x575439['destlinkedid']};}}}catch(_0x583047){logger['error'](_0x43e7('0x38'),_0x583047['message']);}};Acw[_0x43e7('0x14')]['syncAgentConnectPreview']=function(_0x5b28db){try{if(this[_0x43e7('0x5')][_0x5b28db['queue']]&&(this[_0x43e7('0x5')][_0x5b28db[_0x43e7('0x29')]][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x5b28db['queue']][_0x43e7('0x18')])){if(this[_0x43e7('0x6')][_0x5b28db[_0x43e7('0x16')]]){this[_0x43e7('0x8')][_0x5b28db[_0x43e7('0x28')]]={'queue':_0x5b28db[_0x43e7('0x29')],'interface':_0x5b28db['interface']};}}}catch(_0x4930a2){logger[_0x43e7('0x2f')](_0x43e7('0x39'),_0x4930a2[_0x43e7('0x3a')]);}};Acw['prototype']['syncHangupRequest']=function(_0x56489b){try{if(this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]]&&_['isUndefined'](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]][_0x43e7('0x3b')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x56489b['uniqueid']);this['startAcw'](_0x56489b[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x56489b['linkedid']]&&_[_0x43e7('0x3c')](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x3d')]][_0x43e7('0x3b')])){logger['info'](_0x43e7('0x3e'),_0x56489b['linkedid']);this['startAcw'](_0x56489b[_0x43e7('0x3d')]);}}catch(_0x12f9ba){logger[_0x43e7('0x2f')](_0x43e7('0x3f'),_0x12f9ba[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0x40')]=function(_0x256ddd){try{if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x28')]]&&this['channels'][_0x256ddd[_0x43e7('0x28')]][_0x43e7('0x3b')]){logger['info'](_0x43e7('0x41'),_0x256ddd['uniqueid']);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x3d')]]&&this[_0x43e7('0x8')][_0x256ddd['linkedid']]['attended']){logger[_0x43e7('0x1f')](_0x43e7('0x42'),_0x256ddd[_0x43e7('0x3d')]);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x3d')]);}}catch(_0x25bb44){logger[_0x43e7('0x2f')](_0x43e7('0x43'),_0x25bb44[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xe')]=function(_0x4ace49){try{if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49['transfereeuniqueid']])){this[_0x43e7('0x15')](_0x4ace49[_0x43e7('0x45')]);if(this[_0x43e7('0x8')][_0x4ace49['secondtransfereruniqueid']]){this['channels'][_0x4ace49[_0x43e7('0x46')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49[_0x43e7('0x47')]]=this['channels'][_0x4ace49['secondtransfereruniqueid']];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x46')]];}}else if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x47')]])){this['startAcw'](_0x4ace49[_0x43e7('0x47')]);if(this[_0x43e7('0x8')][_0x4ace49['origtransfereruniqueid']]){this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49['transfereeuniqueid']]=this['channels'][_0x4ace49[_0x43e7('0x48')]];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]];}}}catch(_0x3a6404){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x3a6404[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xf')]=function(_0x5dd349){try{if(this['channels'][_0x5dd349[_0x43e7('0x49')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4a'),JSON[_0x43e7('0x35')](_0x5dd349[_0x43e7('0x49')]));this[_0x43e7('0x15')](_0x5dd349[_0x43e7('0x49')]);}else if(this[_0x43e7('0x8')][_0x5dd349[_0x43e7('0x4b')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4c'),JSON['stringify'](_0x5dd349['transfererlinkedid']));this[_0x43e7('0x15')](_0x5dd349['transfererlinkedid']);}}catch(_0x501616){logger['error'](_0x43e7('0x4d'),_0x501616[_0x43e7('0x3a')]);}};Acw['prototype'][_0x43e7('0x4e')]=function(_0x135791){try{if(this[_0x43e7('0x5')][_0x135791['queue']]&&this[_0x43e7('0x5')][_0x135791[_0x43e7('0x29')]][_0x43e7('0x4f')]===_0x43e7('0x50')){if(this[_0x43e7('0x6')][_0x135791[_0x43e7('0x16')]]){logger[_0x43e7('0x1f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x135791[_0x43e7('0x28')],_0x135791[_0x43e7('0x16')],_0x135791[_0x43e7('0x29')]);return RpcUser['savePause'](this['agents'][_0x135791[_0x43e7('0x16')]],'Auto-Pause',_0x135791['uniqueid']);}}}catch(_0x1b793d){logger[_0x43e7('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1b793d[_0x43e7('0x3a')]);}};module[_0x43e7('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index ad4b8ce..3e72644 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 _0xcd40=['password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','port','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','exports','bluebird','moment','lodash','ami','../../config/environment','asterisk'];(function(_0x2ec365,_0x5e0fbd){var _0x121c81=function(_0x2194e2){while(--_0x2194e2){_0x2ec365['push'](_0x2ec365['shift']());}};_0x121c81(++_0x5e0fbd);}(_0xcd40,0x150));var _0x0cd4=function(_0x1c53e1,_0x2f11a8){_0x1c53e1=_0x1c53e1-0x0;var _0x1f5b1f=_0xcd40[_0x1c53e1];return _0x1f5b1f;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0cd4('0x0'));var moment=require(_0x0cd4('0x1'));var util=require('util');var _=require(_0x0cd4('0x2'));var logger=require('../../config/logger')(_0x0cd4('0x3'));var config=require(_0x0cd4('0x4'));var ami=new Manager(config[_0x0cd4('0x5')]['port'],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')]['username'],config[_0x0cd4('0x5')][_0x0cd4('0x6')],!![]);ami[_0x0cd4('0x7')]();ami[_0x0cd4('0x8')]=BPromise[_0x0cd4('0x9')](ami[_0x0cd4('0xa')]);function error(_0x474754){logger[_0x0cd4('0xb')](util['format'](_0x0cd4('0xc'),config['asterisk'][_0x0cd4('0xd')],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')],util[_0x0cd4('0xf')](_0x474754,![],null)));}function close(){logger[_0x0cd4('0xb')](util[_0x0cd4('0x10')](_0x0cd4('0x11'),config[_0x0cd4('0x5')][_0x0cd4('0xd')],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')]));}ami[_0x0cd4('0x12')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x13')});};};ami[_0x0cd4('0x14')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x15')});};};ami[_0x0cd4('0x16')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x17')});};};ami[_0x0cd4('0x18')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x19')});};};function connect(_0x10ddd5){logger[_0x0cd4('0x1a')](util[_0x0cd4('0x10')](_0x0cd4('0x1b'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')]));ami[_0x0cd4('0x1c')](_0x0cd4('0xb'),error);ami[_0x0cd4('0x1c')]('close',close);}ami['on'](_0x0cd4('0x1d'),connect);ami['on']('shutdown',function(_0x498170){logger[_0x0cd4('0x1a')](util[_0x0cd4('0x10')](_0x0cd4('0x1e'),config[_0x0cd4('0x5')][_0x0cd4('0xd')],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')],util['inspect'](_0x498170,![],null)));});ami['on'](_0x0cd4('0x1f'),function(_0x12c4ac){logger[_0x0cd4('0x1a')](util[_0x0cd4('0x10')](_0x0cd4('0x20'),config['asterisk'][_0x0cd4('0xd')],config['asterisk']['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')]));return BPromise[_0x0cd4('0x21')]()[_0x0cd4('0x22')](ami[_0x0cd4('0x12')]())['then'](ami[_0x0cd4('0x23')]())[_0x0cd4('0x22')](ami['actionSipPeerStatus']())[_0x0cd4('0x22')](ami[_0x0cd4('0x16')]())[_0x0cd4('0x22')](ami[_0x0cd4('0x18')]())[_0x0cd4('0x24')](function(_0x117f5f){console['log'](_0x117f5f);});});ami['once']('error',error);ami[_0x0cd4('0x1c')]('close',close);module[_0x0cd4('0x25')]=ami; \ No newline at end of file +var _0x1244=['resolve','then','actionDeviceStateList','actionSipPeerStatus','log','exports','asterisk-manager','bluebird','moment','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','action','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','devicestatelist','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','once','error','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x425fa2,_0x5d831e){var _0x21047d=function(_0x3d42d8){while(--_0x3d42d8){_0x425fa2['push'](_0x425fa2['shift']());}};_0x21047d(++_0x5d831e);}(_0x1244,0x1cd));var _0x4124=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x1244[_0x494d1f];return _0x457b6e;};'use strict';var Manager=require(_0x4124('0x0'));var BPromise=require(_0x4124('0x1'));var moment=require(_0x4124('0x2'));var util=require('util');var _=require('lodash');var logger=require(_0x4124('0x3'))(_0x4124('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x4124('0x5')][_0x4124('0x6')],config['asterisk']['ip'],config['asterisk'][_0x4124('0x7')],config['asterisk'][_0x4124('0x8')],!![]);ami[_0x4124('0x9')]();ami[_0x4124('0xa')]=BPromise['promisify'](ami[_0x4124('0xb')]);function error(_0x4c1a01){logger['error'](util[_0x4124('0xc')](_0x4124('0xd'),config[_0x4124('0x5')][_0x4124('0x7')],config['asterisk']['ip'],config[_0x4124('0x5')]['port'],util[_0x4124('0xe')](_0x4c1a01,![],null)));}function close(){logger['error'](util[_0x4124('0xc')](_0x4124('0xf'),config['asterisk'][_0x4124('0x7')],config['asterisk']['ip'],config['asterisk'][_0x4124('0x6')]));}ami[_0x4124('0x10')]=function(){return function(){return ami[_0x4124('0xa')]({'action':_0x4124('0x11')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x4124('0xa')]({'action':_0x4124('0x12')});};};ami['actionSipPeerStatus']=function(){return function(){return ami[_0x4124('0xa')]({'action':'sippeerstatus'});};};ami[_0x4124('0x13')]=function(){return function(){return ami[_0x4124('0xa')]({'action':'queuesummary'});};};ami[_0x4124('0x14')]=function(){return function(){return ami[_0x4124('0xa')]({'action':_0x4124('0x15')});};};function connect(_0xeb75e8){logger[_0x4124('0x16')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk'][_0x4124('0x7')],config[_0x4124('0x5')]['ip'],config[_0x4124('0x5')]['port']));ami[_0x4124('0x17')](_0x4124('0x18'),error);ami['once'](_0x4124('0x19'),close);}ami['on'](_0x4124('0x1a'),connect);ami['on']('shutdown',function(_0x2d0a35){logger[_0x4124('0x16')](util[_0x4124('0xc')](_0x4124('0x1b'),config[_0x4124('0x5')][_0x4124('0x7')],config['asterisk']['ip'],config[_0x4124('0x5')]['port'],util['inspect'](_0x2d0a35,![],null)));});ami['on']('fullybooted',function(_0x2b4881){logger[_0x4124('0x16')](util[_0x4124('0xc')](_0x4124('0x1c'),config[_0x4124('0x5')][_0x4124('0x7')],config[_0x4124('0x5')]['ip'],config[_0x4124('0x5')][_0x4124('0x6')]));return BPromise[_0x4124('0x1d')]()[_0x4124('0x1e')](ami[_0x4124('0x10')]())[_0x4124('0x1e')](ami[_0x4124('0x1f')]())['then'](ami[_0x4124('0x20')]())[_0x4124('0x1e')](ami[_0x4124('0x13')]())[_0x4124('0x1e')](ami[_0x4124('0x14')]())['catch'](function(_0x4421e2){console[_0x4124('0x21')](_0x4421e2);});});ami[_0x4124('0x17')](_0x4124('0x18'),error);ami[_0x4124('0x17')](_0x4124('0x19'),close);module[_0x4124('0x22')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 79a6813..916113d 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 _0xcc04=['result','exports','jayson/promise','../../config/logger','ami','client','request','then','rpc','memberReport','error','message'];(function(_0x24d16b,_0xee5f87){var _0x297480=function(_0x4c1ddd){while(--_0x4c1ddd){_0x24d16b['push'](_0x24d16b['shift']());}};_0x297480(++_0xee5f87);}(_0xcc04,0xda));var _0x4cc0=function(_0x110f07,_0x523a8d){_0x110f07=_0x110f07-0x0;var _0x390dec=_0xcc04[_0x110f07];return _0x390dec;};'use strict';var jayson=require(_0x4cc0('0x0'));var BPromise=require('bluebird');var logger=require(_0x4cc0('0x1'))(_0x4cc0('0x2'));var client=jayson[_0x4cc0('0x3')]['http']({'port':0x2329});client['Request']=function(_0x15b29b,_0x403110){return new BPromise(function(_0x535d3a,_0x10ffcb){return client[_0x4cc0('0x4')](_0x15b29b,_0x403110)[_0x4cc0('0x5')](function(_0x3eef5d){logger['debug'](_0x4cc0('0x6'),_0x4cc0('0x7'),_0x15b29b,_0x403110,_0x3eef5d);if(_0x3eef5d[_0x4cc0('0x8')]){logger[_0x4cc0('0x8')]('rpc',_0x4cc0('0x7'),_0x15b29b,_0x3eef5d['error'][_0x4cc0('0x9')],_0x403110);return _0x10ffcb(_0x3eef5d[_0x4cc0('0x8')][_0x4cc0('0x9')]);}else{return _0x535d3a(_0x3eef5d[_0x4cc0('0xa')]);}})['catch'](function(_0x5508dd){logger[_0x4cc0('0x8')](_0x4cc0('0x6'),_0x4cc0('0x7'),_0x15b29b,_0x5508dd,_0x403110);return _0x10ffcb(_0x5508dd);});});};module[_0x4cc0('0xb')]=client; \ No newline at end of file +var _0x2477=['client','http','Request','request','then','rpc','memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami'];(function(_0x38ac67,_0x2368be){var _0x324a14=function(_0x5c2776){while(--_0x5c2776){_0x38ac67['push'](_0x38ac67['shift']());}};_0x324a14(++_0x2368be);}(_0x2477,0x12c));var _0x7247=function(_0x122e9b,_0x391bf4){_0x122e9b=_0x122e9b-0x0;var _0x22c247=_0x2477[_0x122e9b];return _0x22c247;};'use strict';var jayson=require(_0x7247('0x0'));var BPromise=require(_0x7247('0x1'));var logger=require(_0x7247('0x2'))(_0x7247('0x3'));var client=jayson[_0x7247('0x4')][_0x7247('0x5')]({'port':0x2329});client[_0x7247('0x6')]=function(_0x7924d5,_0x30d308){return new BPromise(function(_0x5de3a3,_0xe0de98){return client[_0x7247('0x7')](_0x7924d5,_0x30d308)[_0x7247('0x8')](function(_0x58be46){logger['debug'](_0x7247('0x9'),_0x7247('0xa'),_0x7924d5,_0x30d308,_0x58be46);if(_0x58be46[_0x7247('0xb')]){logger['error']('rpc','memberReport',_0x7924d5,_0x58be46[_0x7247('0xb')]['message'],_0x30d308);return _0xe0de98(_0x58be46['error'][_0x7247('0xc')]);}else{return _0x5de3a3(_0x58be46[_0x7247('0xd')]);}})[_0x7247('0xe')](function(_0x4138c2){logger[_0x7247('0xb')]('rpc',_0x7247('0xa'),_0x7924d5,_0x4138c2,_0x30d308);return _0xe0de98(_0x4138c2);});});};module[_0x7247('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 4e2158c..c0566fe 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x607b=['moment','isNil','string','uniqueid','name','phone','Contact','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','substring','voiceQueue','dialCutDigit','prototype','queue','exports','util'];(function(_0x4c21ee,_0x217ce3){var _0x34e9dc=function(_0x282e39){while(--_0x282e39){_0x4c21ee['push'](_0x4c21ee['shift']());}};_0x34e9dc(++_0x217ce3);}(_0x607b,0x18f));var _0xb607=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x607b[_0xb0f7c3];return _0x28ea68;};'use strict';var util=require(_0xb607('0x0'));var _=require('lodash');var moment=require(_0xb607('0x1'));function checkNameSurname(_0x2ea542,_0x40f2d7,_0x198cae){var _0x2ffbc7='';if(!_[_0xb607('0x2')](_0x40f2d7)&&_0xb607('0x3')===typeof _0x40f2d7){_0x2ffbc7+=_0x40f2d7;}if(!_[_0xb607('0x2')](_0x198cae)&&'string'===typeof _0x198cae){_0x2ffbc7+='\x20'+_0x198cae;}if(_0x2ffbc7!==''){return _0x2ffbc7;}return _0x2ea542;}function Action(_0x59a66a,_0xc7225a,_0x509054){this['voiceQueue']=_0x59a66a;this[_0xb607('0x4')]=_0x509054||undefined;this[_0xb607('0x5')]=checkNameSurname(_0xc7225a['Contact'][_0xb607('0x6')],_0xc7225a[_0xb607('0x7')][_0xb607('0x8')],_0xc7225a[_0xb607('0x7')]['lastName']);this[_0xb607('0x9')]=_0xc7225a[_0xb607('0x7')][_0xb607('0x6')];this['queue']=_0x59a66a[_0xb607('0x5')];this[_0xb607('0xa')]=_0xc7225a['active']||![];this[_0xb607('0xb')]=_0x59a66a['type'];this[_0xb607('0xc')]=_0x59a66a['dialQueueTimeout']||0x3;this[_0xb607('0xd')]=_0xc7225a[_0xb607('0xd')];this['countbusyretry']=_0xc7225a[_0xb607('0xe')];this[_0xb607('0xf')]=_0xc7225a[_0xb607('0xf')];this[_0xb607('0x10')]=_0xc7225a[_0xb607('0x10')];this[_0xb607('0x11')]=_0xc7225a[_0xb607('0x11')];this[_0xb607('0x12')]=_0xc7225a[_0xb607('0x12')];this[_0xb607('0x13')]=_0xc7225a[_0xb607('0x13')];this[_0xb607('0x14')]=_0xc7225a[_0xb607('0x14')];this[_0xb607('0x15')]=_0xc7225a[_0xb607('0x15')];this[_0xb607('0x16')]=_0xc7225a['id'];this[_0xb607('0x17')]=_0xc7225a[_0xb607('0x7')][_0xb607('0x8')]||'';this[_0xb607('0x18')]=moment()[_0xb607('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb607('0x1a')]=_0xc7225a[_0xb607('0x1a')];this[_0xb607('0x1b')]=_0xc7225a[_0xb607('0x1b')];this[_0xb607('0x1c')]=_0xc7225a[_0xb607('0x1c')];this[_0xb607('0x1d')]=_0xc7225a[_0xb607('0x1d')];this[_0xb607('0x1e')]='';this[_0xb607('0x1f')]='';}Action['prototype'][_0xb607('0x20')]=function(){return util['format'](_0xb607('0x21'),this[_0xb607('0x5')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xb607('0x9')][_0xb607('0x22')](this[_0xb607('0x23')][_0xb607('0x24')]):this['number']);};Action[_0xb607('0x25')]['getQueue']=function(){return this[_0xb607('0x26')];};module[_0xb607('0x27')]=Action; \ No newline at end of file +var _0x50b9=['recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','moment','isNil','string','voiceQueue','uniqueid','name','firstName','Contact','lastName','number','phone','queue','active','type','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat'];(function(_0x9c3681,_0x33099b){var _0x1954a3=function(_0x486593){while(--_0x486593){_0x9c3681['push'](_0x9c3681['shift']());}};_0x1954a3(++_0x33099b);}(_0x50b9,0x171));var _0x950b=function(_0x247064,_0x471718){_0x247064=_0x247064-0x0;var _0x287b72=_0x50b9[_0x247064];return _0x287b72;};'use strict';var util=require(_0x950b('0x0'));var _=require('lodash');var moment=require(_0x950b('0x1'));function checkNameSurname(_0x4b101f,_0x11eddf,_0xaf96fd){var _0x1f5868='';if(!_[_0x950b('0x2')](_0x11eddf)&&_0x950b('0x3')===typeof _0x11eddf){_0x1f5868+=_0x11eddf;}if(!_[_0x950b('0x2')](_0xaf96fd)&&_0x950b('0x3')===typeof _0xaf96fd){_0x1f5868+='\x20'+_0xaf96fd;}if(_0x1f5868!==''){return _0x1f5868;}return _0x4b101f;}function Action(_0x233c06,_0xc9024,_0x56ce3f){this[_0x950b('0x4')]=_0x233c06;this[_0x950b('0x5')]=_0x56ce3f||undefined;this[_0x950b('0x6')]=checkNameSurname(_0xc9024['Contact']['phone'],_0xc9024['Contact'][_0x950b('0x7')],_0xc9024[_0x950b('0x8')][_0x950b('0x9')]);this[_0x950b('0xa')]=_0xc9024[_0x950b('0x8')][_0x950b('0xb')];this[_0x950b('0xc')]=_0x233c06['name'];this[_0x950b('0xd')]=_0xc9024[_0x950b('0xd')]||![];this['type']=_0x233c06[_0x950b('0xe')];this['dialQueueTimeout']=_0x233c06['dialQueueTimeout']||0x3;this[_0x950b('0xf')]=_0xc9024[_0x950b('0xf')];this[_0x950b('0x10')]=_0xc9024[_0x950b('0x10')];this[_0x950b('0x11')]=_0xc9024[_0x950b('0x11')];this[_0x950b('0x12')]=_0xc9024[_0x950b('0x12')];this[_0x950b('0x13')]=_0xc9024[_0x950b('0x13')];this[_0x950b('0x14')]=_0xc9024[_0x950b('0x14')];this[_0x950b('0x15')]=_0xc9024[_0x950b('0x15')];this[_0x950b('0x16')]=_0xc9024[_0x950b('0x16')];this[_0x950b('0x17')]=_0xc9024[_0x950b('0x17')];this['idHopper']=_0xc9024['id'];this[_0x950b('0x18')]=_0xc9024['Contact'][_0x950b('0x7')]||'';this[_0x950b('0x19')]=moment()[_0x950b('0x1a')](_0x950b('0x1b'));this[_0x950b('0x1c')]=_0xc9024[_0x950b('0x1c')];this[_0x950b('0x1d')]=_0xc9024[_0x950b('0x1d')];this[_0x950b('0x1e')]=_0xc9024[_0x950b('0x1e')];this[_0x950b('0x1f')]=_0xc9024[_0x950b('0x1f')];this[_0x950b('0x20')]='';this[_0x950b('0x21')]='';}Action[_0x950b('0x22')][_0x950b('0x23')]=function(){return util[_0x950b('0x1a')](_0x950b('0x24'),this[_0x950b('0x6')],this[_0x950b('0x4')][_0x950b('0x25')]>0x0?this[_0x950b('0xa')]['substring'](this[_0x950b('0x4')][_0x950b('0x25')]):this[_0x950b('0xa')]);};Action[_0x950b('0x22')][_0x950b('0x26')]=function(){return this['queue'];};module[_0x950b('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 288a2d3..09b982b 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ba0=['originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x2fa488,_0x245512){var _0x3c1de5=function(_0x40d6f9){while(--_0x40d6f9){_0x2fa488['push'](_0x2fa488['shift']());}};_0x3c1de5(++_0x245512);}(_0x7ba0,0x1d6));var _0x07ba=function(_0x2adff5,_0x120364){_0x2adff5=_0x2adff5-0x0;var _0x3dfb60=_0x7ba0[_0x2adff5];return _0x3dfb60;};'use strict';var util=require(_0x07ba('0x0'));var _=require(_0x07ba('0x1'));var moment=require('moment');function getSeconds(_0x70098a,_0x1c4818){var _0x16a8f2=moment(_0x70098a)[_0x07ba('0x2')](0x0);var _0x2a183a=moment(_0x1c4818)[_0x07ba('0x2')](0x0);return _0x16a8f2[_0x07ba('0x3')](_0x2a183a,_0x07ba('0x4'));}function AgentComplete(_0xcab0e0,_0x2502dc){this['state']=0x4;this[_0x07ba('0x5')]=_0x07ba('0x6');this[_0x07ba('0x7')]=_0xcab0e0[_0x07ba('0x7')];this['type']=_0xcab0e0[_0x07ba('0x8')];this[_0x07ba('0x9')]=_0xcab0e0[_0x07ba('0x8')]===_0x07ba('0xa')?_0x07ba('0xb'):_0xcab0e0[_0x07ba('0x8')];this[_0x07ba('0xc')]=_0xcab0e0[_0x07ba('0xc')];this[_0x07ba('0xd')]=_0xcab0e0[_0x07ba('0xd')];this[_0x07ba('0xe')]=_0xcab0e0['countnoanswerretry'];this[_0x07ba('0xf')]=_0xcab0e0[_0x07ba('0xc')]+_0xcab0e0['countcongestionretry']+_0xcab0e0[_0x07ba('0xe')];this[_0x07ba('0x10')]=_0x2502dc[_0x07ba('0x10')];this['calleridname']=_0xcab0e0[_0x07ba('0x11')];this['calleridnum']=_0xcab0e0[_0x07ba('0x12')];this[_0x07ba('0x13')]=_0xcab0e0[_0x07ba('0x13')];this[_0x07ba('0x14')]=_0xcab0e0[_0x07ba('0x14')];this[_0x07ba('0x15')]=_0xcab0e0['answertime'];this[_0x07ba('0x16')]=moment()['format'](_0x07ba('0x17'));this[_0x07ba('0x18')]=getSeconds(_0xcab0e0[_0x07ba('0x14')],_0xcab0e0[_0x07ba('0x13')]);this['holdtime']=getSeconds(_0xcab0e0[_0x07ba('0x15')],_0xcab0e0['responsetime']);this[_0x07ba('0x19')]=getSeconds(this[_0x07ba('0x16')],_0xcab0e0[_0x07ba('0x15')]);this[_0x07ba('0xb')]=_0x2502dc[_0x07ba('0xb')];this[_0x07ba('0x1a')]=_0x2502dc[_0x07ba('0x1a')];this['reason']=_0x2502dc['reason'];this['callback']=_0xcab0e0[_0x07ba('0x1b')];this[_0x07ba('0x1c')]=_0xcab0e0[_0x07ba('0x1c')];this[_0x07ba('0x1d')]=_0xcab0e0['callbackat'];this[_0x07ba('0x1e')]=_0xcab0e0[_0x07ba('0x1e')];this[_0x07ba('0x1f')]=_0xcab0e0[_0x07ba('0x1f')];this[_0x07ba('0x20')]=_0xcab0e0[_0x07ba('0x20')];this[_0x07ba('0x21')]=_0xcab0e0[_0x07ba('0x21')];this[_0x07ba('0x22')]=_0xcab0e0[_0x07ba('0x22')];this[_0x07ba('0x23')]=_0xcab0e0['CampaignId'];this[_0x07ba('0x24')]=_0xcab0e0[_0x07ba('0x24')]||'';this[_0x07ba('0x25')]=_0xcab0e0[_0x07ba('0x25')]||'';}module[_0x07ba('0x26')]=AgentComplete; \ No newline at end of file +var _0x8b6f=['name','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','uniqueid','calleridname'];(function(_0x34049b,_0x2a5f1b){var _0x3a82e9=function(_0x19f4ca){while(--_0x19f4ca){_0x34049b['push'](_0x34049b['shift']());}};_0x3a82e9(++_0x2a5f1b);}(_0x8b6f,0xac));var _0xf8b6=function(_0x5497f8,_0x280014){_0x5497f8=_0x5497f8-0x0;var _0x218bd5=_0x8b6f[_0x5497f8];return _0x218bd5;};'use strict';var util=require(_0xf8b6('0x0'));var _=require(_0xf8b6('0x1'));var moment=require(_0xf8b6('0x2'));function getSeconds(_0x303581,_0x1c1716){var _0x58f681=moment(_0x303581)[_0xf8b6('0x3')](0x0);var _0x287303=moment(_0x1c1716)['milliseconds'](0x0);return _0x58f681[_0xf8b6('0x4')](_0x287303,_0xf8b6('0x5'));}function AgentComplete(_0x190b05,_0x30d7d7){this['state']=0x4;this['statedesc']=_0xf8b6('0x6');this[_0xf8b6('0x7')]=_0x190b05[_0xf8b6('0x7')];this[_0xf8b6('0x8')]=_0x190b05[_0xf8b6('0x8')];this[_0xf8b6('0x9')]=_0x190b05[_0xf8b6('0x8')]===_0xf8b6('0xa')?_0xf8b6('0xb'):_0x190b05[_0xf8b6('0x8')];this[_0xf8b6('0xc')]=_0x190b05['countbusyretry'];this['countcongestionretry']=_0x190b05['countcongestionretry'];this['countnoanswerretry']=_0x190b05[_0xf8b6('0xd')];this[_0xf8b6('0xe')]=_0x190b05['countbusyretry']+_0x190b05[_0xf8b6('0xf')]+_0x190b05[_0xf8b6('0xd')];this[_0xf8b6('0x10')]=_0x30d7d7[_0xf8b6('0x10')];this[_0xf8b6('0x11')]=_0x190b05[_0xf8b6('0x12')];this['calleridnum']=_0x190b05['number'];this[_0xf8b6('0x13')]=_0x190b05['starttime'];this['responsetime']=_0x190b05[_0xf8b6('0x14')];this[_0xf8b6('0x15')]=_0x190b05[_0xf8b6('0x15')];this['endtime']=moment()[_0xf8b6('0x16')](_0xf8b6('0x17'));this['ringtime']=getSeconds(_0x190b05[_0xf8b6('0x14')],_0x190b05[_0xf8b6('0x13')]);this[_0xf8b6('0x18')]=getSeconds(_0x190b05[_0xf8b6('0x15')],_0x190b05[_0xf8b6('0x14')]);this['talktime']=getSeconds(this[_0xf8b6('0x19')],_0x190b05[_0xf8b6('0x15')]);this[_0xf8b6('0xb')]=_0x30d7d7['queue'];this[_0xf8b6('0x1a')]=_0x30d7d7[_0xf8b6('0x1a')];this['reason']=_0x30d7d7[_0xf8b6('0x1b')];this[_0xf8b6('0x1c')]=_0x190b05['callback'];this[_0xf8b6('0x1d')]=_0x190b05['callbackuniqueid'];this[_0xf8b6('0x1e')]=_0x190b05['callbackat'];this[_0xf8b6('0x1f')]=_0x190b05[_0xf8b6('0x1f')];this['ContactId']=_0x190b05['ContactId'];this[_0xf8b6('0x20')]=_0x190b05[_0xf8b6('0x20')];this['UserId']=_0x190b05[_0xf8b6('0x21')];this[_0xf8b6('0x22')]=_0x190b05[_0xf8b6('0x22')];this['CampaignId']=_0x190b05[_0xf8b6('0x23')];this['originatecalleridnum']=_0x190b05['originatecalleridnum']||'';this[_0xf8b6('0x24')]=_0x190b05[_0xf8b6('0x24')]||'';}module[_0xf8b6('0x25')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 8fa8727..e466892 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c8f=['calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname'];(function(_0x5ed9e1,_0xce2e8b){var _0x138bda=function(_0x543517){while(--_0x543517){_0x5ed9e1['push'](_0x5ed9e1['shift']());}};_0x138bda(++_0xce2e8b);}(_0x2c8f,0x192));var _0xf2c8=function(_0x573256,_0x198f8d){_0x573256=_0x573256-0x0;var _0x3684ac=_0x2c8f[_0x573256];return _0x3684ac;};'use strict';var util=require('util');var _=require(_0xf2c8('0x0'));var moment=require('moment');function getSeconds(_0x4b64c7,_0x488a77){var _0x3d45c0=moment(_0x4b64c7)[_0xf2c8('0x1')](0x0);var _0x3eb15b=moment(_0x488a77)['milliseconds'](0x0);return _0x3d45c0['diff'](_0x3eb15b,_0xf2c8('0x2'));}function Final(_0x34f179){this[_0xf2c8('0x3')]=_0x34f179[_0xf2c8('0x3')];this[_0xf2c8('0x4')]=_0x34f179['scheduledat'];this[_0xf2c8('0x5')]=_0x34f179[_0xf2c8('0x5')];this[_0xf2c8('0x6')]=_0x34f179[_0xf2c8('0x5')]===_0xf2c8('0x7')?_0xf2c8('0x8'):_0x34f179['type'];this[_0xf2c8('0x9')]=_0x34f179[_0xf2c8('0x9')];this[_0xf2c8('0xa')]=_0x34f179[_0xf2c8('0xa')];this[_0xf2c8('0xb')]=_0x34f179[_0xf2c8('0xb')];this[_0xf2c8('0xc')]=_0x34f179[_0xf2c8('0x9')]+_0x34f179['countcongestionretry']+_0x34f179[_0xf2c8('0xb')];this['queue']=_0x34f179[_0xf2c8('0x8')];this[_0xf2c8('0xd')]=_0x34f179[_0xf2c8('0xd')];this[_0xf2c8('0xe')]=_0x34f179[_0xf2c8('0xe')];this[_0xf2c8('0xf')]=_0x34f179['starttime'];this[_0xf2c8('0x10')]=_0x34f179[_0xf2c8('0x10')];this[_0xf2c8('0x11')]=_0x34f179[_0xf2c8('0x10')];this[_0xf2c8('0x12')]=_0x34f179[_0xf2c8('0x12')]||0x0;this[_0xf2c8('0x13')]=_0x34f179['holdtime']||0x0;this[_0xf2c8('0x14')]=_0x34f179[_0xf2c8('0x14')]||0x0;this[_0xf2c8('0x15')]=_0x34f179[_0xf2c8('0x15')];this[_0xf2c8('0x16')]=_0x34f179['callbackuniqueid'];this['callbackat']=_0x34f179[_0xf2c8('0x17')];this[_0xf2c8('0x18')]=_0x34f179[_0xf2c8('0x18')];this[_0xf2c8('0x19')]=_0x34f179['ContactId'];this[_0xf2c8('0x1a')]=_0x34f179[_0xf2c8('0x1a')];this[_0xf2c8('0x1b')]=_0x34f179['UserId'];this[_0xf2c8('0x1c')]=_0x34f179[_0xf2c8('0x1c')];this['CampaignId']=_0x34f179['CampaignId'];this[_0xf2c8('0x1d')]=_0x34f179[_0xf2c8('0x1d')]||'';this[_0xf2c8('0x1e')]=_0x34f179['originatecalleridname']||'';}module[_0xf2c8('0x1f')]=Final; \ No newline at end of file +var _0x13c5=['UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x15d9ec,_0x1da4f2){var _0x478f91=function(_0x286ce3){while(--_0x286ce3){_0x15d9ec['push'](_0x15d9ec['shift']());}};_0x478f91(++_0x1da4f2);}(_0x13c5,0x7a));var _0x513c=function(_0x5cc515,_0x1f2e8e){_0x5cc515=_0x5cc515-0x0;var _0x498c49=_0x13c5[_0x5cc515];return _0x498c49;};'use strict';var util=require(_0x513c('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x4f900f,_0x5746a1){var _0x5b1058=moment(_0x4f900f)['milliseconds'](0x0);var _0x432ab7=moment(_0x5746a1)['milliseconds'](0x0);return _0x5b1058['diff'](_0x432ab7,_0x513c('0x1'));}function Final(_0x2511a6){this[_0x513c('0x2')]=_0x2511a6[_0x513c('0x2')];this['scheduledat']=_0x2511a6['scheduledat'];this[_0x513c('0x3')]=_0x2511a6[_0x513c('0x3')];this[_0x513c('0x4')]=_0x2511a6[_0x513c('0x3')]===_0x513c('0x5')?_0x513c('0x6'):_0x2511a6[_0x513c('0x3')];this[_0x513c('0x7')]=_0x2511a6['countbusyretry'];this[_0x513c('0x8')]=_0x2511a6[_0x513c('0x8')];this['countnoanswerretry']=_0x2511a6['countnoanswerretry'];this[_0x513c('0x9')]=_0x2511a6[_0x513c('0x7')]+_0x2511a6['countcongestionretry']+_0x2511a6['countnoanswerretry'];this['queue']=_0x2511a6[_0x513c('0x6')];this['calleridname']=_0x2511a6[_0x513c('0xa')];this[_0x513c('0xb')]=_0x2511a6['calleridnum'];this[_0x513c('0xc')]=_0x2511a6[_0x513c('0xc')];this[_0x513c('0xd')]=_0x2511a6[_0x513c('0xd')];this[_0x513c('0xe')]=_0x2511a6['responsetime'];this[_0x513c('0xf')]=_0x2511a6['ringtime']||0x0;this[_0x513c('0x10')]=_0x2511a6[_0x513c('0x10')]||0x0;this[_0x513c('0x11')]=_0x2511a6[_0x513c('0x11')]||0x0;this['callback']=_0x2511a6['callback'];this['callbackuniqueid']=_0x2511a6[_0x513c('0x12')];this[_0x513c('0x13')]=_0x2511a6['callbackat'];this['recallme']=_0x2511a6[_0x513c('0x14')];this[_0x513c('0x15')]=_0x2511a6[_0x513c('0x15')];this[_0x513c('0x16')]=_0x2511a6['ListId'];this[_0x513c('0x17')]=_0x2511a6[_0x513c('0x17')];this[_0x513c('0x18')]=_0x2511a6[_0x513c('0x18')];this[_0x513c('0x19')]=_0x2511a6['CampaignId'];this[_0x513c('0x1a')]=_0x2511a6['originatecalleridnum']||'';this[_0x513c('0x1b')]=_0x2511a6[_0x513c('0x1b')]||'';}module[_0x513c('0x1c')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 2245172..072e171 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x11fe13,_0x3dcbf8){var _0x1c8df3=function(_0x2a0ba8){while(--_0x2a0ba8){_0x11fe13['push'](_0x11fe13['shift']());}};_0x1c8df3(++_0x3dcbf8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x42af74,_0x1fbc36){var _0x53d52d=function(_0x2fac82){while(--_0x2fac82){_0x42af74['push'](_0x42af74['shift']());}};_0x53d52d(++_0x1fbc36);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index b614493..3acaad2 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe6a4=['lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','calleridname','calleridnum','number','starttime','responsetime','holdtime','talktime','callback','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x73c418,_0x17e24f){var _0x1b0a7c=function(_0x5b805b){while(--_0x5b805b){_0x73c418['push'](_0x73c418['shift']());}};_0x1b0a7c(++_0x17e24f);}(_0xe6a4,0x1c2));var _0x4e6a=function(_0x362d03,_0x321ac8){_0x362d03=_0x362d03-0x0;var _0x5ab61d=_0xe6a4[_0x362d03];return _0x5ab61d;};'use strict';var util=require('util');var _=require(_0x4e6a('0x0'));var moment=require('moment');function getSeconds(_0x208b4f,_0x5b6c1d){var _0x1434fb=moment(_0x208b4f)[_0x4e6a('0x1')](0x0);var _0x43ebd7=moment(_0x5b6c1d)[_0x4e6a('0x1')](0x0);return _0x1434fb[_0x4e6a('0x2')](_0x43ebd7,_0x4e6a('0x3'));}function History(_0x12fe08){this[_0x4e6a('0x4')]=_0x12fe08[_0x4e6a('0x4')];this['scheduledat']=_0x12fe08[_0x4e6a('0x5')]||undefined;this[_0x4e6a('0x6')]=_0x12fe08[_0x4e6a('0x6')];this[_0x4e6a('0x7')]=_0x12fe08[_0x4e6a('0x6')]===_0x4e6a('0x8')?_0x4e6a('0x9'):_0x12fe08[_0x4e6a('0x6')];this['countbusyretry']=_0x12fe08['countbusyretry'];this[_0x4e6a('0xa')]=_0x12fe08[_0x4e6a('0xa')];this[_0x4e6a('0xb')]=_0x12fe08[_0x4e6a('0xb')];this['countglobal']=_0x12fe08[_0x4e6a('0xc')]+_0x12fe08['countcongestionretry']+_0x12fe08[_0x4e6a('0xb')];this['queue']=_0x12fe08['queue'];this[_0x4e6a('0xd')]=_0x12fe08['name'];this[_0x4e6a('0xe')]=_0x12fe08[_0x4e6a('0xf')];this[_0x4e6a('0x10')]=_0x12fe08[_0x4e6a('0x10')];this[_0x4e6a('0x11')]=_0x12fe08[_0x4e6a('0x11')];this['endtime']=_0x12fe08[_0x4e6a('0x11')];this['ringtime']=getSeconds(_0x12fe08[_0x4e6a('0x11')],_0x12fe08['starttime']);this[_0x4e6a('0x12')]=0x0;this[_0x4e6a('0x13')]=0x0;this[_0x4e6a('0x14')]=_0x12fe08[_0x4e6a('0x14')];this['callbackuniqueid']=_0x12fe08['callbackuniqueid'];this[_0x4e6a('0x15')]=_0x12fe08[_0x4e6a('0x15')];this[_0x4e6a('0x16')]=_0x12fe08[_0x4e6a('0x16')];this['ContactId']=_0x12fe08[_0x4e6a('0x17')];this['ListId']=_0x12fe08['ListId'];this[_0x4e6a('0x18')]=_0x12fe08[_0x4e6a('0x18')];this['VoiceQueueId']=_0x12fe08[_0x4e6a('0x19')];this[_0x4e6a('0x1a')]=_0x12fe08[_0x4e6a('0x1a')];this['originatecalleridnum']=_0x12fe08[_0x4e6a('0x1b')]||'';this['originatecalleridname']=_0x12fe08[_0x4e6a('0x1c')]||'';}module[_0x4e6a('0x1d')]=History; \ No newline at end of file +var _0x5dcc=['name','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','uniqueid','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x5dcc,0x18b));var _0xc5dc=function(_0x3c5268,_0x3da25b){_0x3c5268=_0x3c5268-0x0;var _0x59a81f=_0x5dcc[_0x3c5268];return _0x59a81f;};'use strict';var util=require(_0xc5dc('0x0'));var _=require(_0xc5dc('0x1'));var moment=require(_0xc5dc('0x2'));function getSeconds(_0x601783,_0x5aceb1){var _0x36d693=moment(_0x601783)[_0xc5dc('0x3')](0x0);var _0x5a330a=moment(_0x5aceb1)['milliseconds'](0x0);return _0x36d693['diff'](_0x5a330a,'seconds');}function History(_0x1af7be){this['uniqueid']=_0x1af7be[_0xc5dc('0x4')];this['scheduledat']=_0x1af7be['scheduledat']||undefined;this['type']=_0x1af7be[_0xc5dc('0x5')];this[_0xc5dc('0x6')]=_0x1af7be['type']==='outbound'?_0xc5dc('0x7'):_0x1af7be['type'];this[_0xc5dc('0x8')]=_0x1af7be[_0xc5dc('0x8')];this[_0xc5dc('0x9')]=_0x1af7be[_0xc5dc('0x9')];this['countnoanswerretry']=_0x1af7be[_0xc5dc('0xa')];this['countglobal']=_0x1af7be[_0xc5dc('0x8')]+_0x1af7be['countcongestionretry']+_0x1af7be[_0xc5dc('0xa')];this[_0xc5dc('0x7')]=_0x1af7be[_0xc5dc('0x7')];this['calleridname']=_0x1af7be[_0xc5dc('0xb')];this[_0xc5dc('0xc')]=_0x1af7be['number'];this[_0xc5dc('0xd')]=_0x1af7be[_0xc5dc('0xd')];this[_0xc5dc('0xe')]=_0x1af7be[_0xc5dc('0xe')];this[_0xc5dc('0xf')]=_0x1af7be[_0xc5dc('0xe')];this[_0xc5dc('0x10')]=getSeconds(_0x1af7be['responsetime'],_0x1af7be['starttime']);this[_0xc5dc('0x11')]=0x0;this[_0xc5dc('0x12')]=0x0;this[_0xc5dc('0x13')]=_0x1af7be[_0xc5dc('0x13')];this[_0xc5dc('0x14')]=_0x1af7be[_0xc5dc('0x14')];this[_0xc5dc('0x15')]=_0x1af7be[_0xc5dc('0x15')];this[_0xc5dc('0x16')]=_0x1af7be['recallme'];this[_0xc5dc('0x17')]=_0x1af7be[_0xc5dc('0x17')];this[_0xc5dc('0x18')]=_0x1af7be[_0xc5dc('0x18')];this['UserId']=_0x1af7be[_0xc5dc('0x19')];this['VoiceQueueId']=_0x1af7be['VoiceQueueId'];this['CampaignId']=_0x1af7be[_0xc5dc('0x1a')];this[_0xc5dc('0x1b')]=_0x1af7be['originatecalleridnum']||'';this[_0xc5dc('0x1c')]=_0x1af7be[_0xc5dc('0x1c')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 97542b5..d592b71 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 _0x8f30=['isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','predictive','booked','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','countglobal','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','RUNNING','[getContactDialer2]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','ioredis','../../../config/environment/','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','./action','./history','./final','./queueCallerAbandon','./hangup','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncQueueMember','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','prototype','[uniqueid]','clearZombieChannels','[actions]','isNil','Action','channel','catch','updateOriginated','queue','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','isTrunkReachable','SIP/%s','status','reachable','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','membername','[syncHangupInAMD][createHistory]','MACHINE','AMD','amd','[syncMachine][createHistory]','[syncMachine]','value','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','queueCallerAbandonCreateState','Abandoned','CALLEREXIT','locked','stateinterface','actionid','queueBooked','push','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','rescheduleContact','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8f30,0xd3));var _0x08f3=function(_0x3fdf76,_0x20a65f){_0x3fdf76=_0x3fdf76-0x0;var _0x294ce7=_0x8f30[_0x3fdf76];return _0x294ce7;};'use strict';var util=require(_0x08f3('0x0'));var _=require(_0x08f3('0x1'));var BPromise=require(_0x08f3('0x2'));var uuid=require('uuid');var moment=require(_0x08f3('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x08f3('0x4'));var config=require(_0x08f3('0x5'));var logger=require(_0x08f3('0x6'))('dialer');var loggerBooked=require(_0x08f3('0x6'))('booked');var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x08f3('0x6'))(_0x08f3('0x7'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x08f3('0x8'));var ami=require(_0x08f3('0x9'));config[_0x08f3('0xa')]=_[_0x08f3('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x08f3('0xc'))(new Redis(config['redis']));var cmHopper=require(_0x08f3('0xd'));var cmHopperFinal=require(_0x08f3('0xe'));var cmHopperHistory=require(_0x08f3('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x08f3('0x10'));var History=require(_0x08f3('0x11'));var Final=require(_0x08f3('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x08f3('0x13'));var Hangup=require(_0x08f3('0x14'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x08f3('0x15');var strategy={'rrmemory':_0x08f3('0x16'),'roundrobin':_0x08f3('0x17')};var Sequence=function(){};Sequence['prototype'][_0x08f3('0x18')]=function(_0x51966a){this[_0x08f3('0x19')]=this['tail']?this['tail'][_0x08f3('0x1a')](_0x51966a):_0x51966a();};function Dialer(_0x29119e,_0x541002){this[_0x08f3('0x1b')]=new Sequence();this[_0x08f3('0x1c')]=_0x541002;this['voiceQueues']=_0x29119e[_0x08f3('0x1d')];this['campaigns']=_0x29119e[_0x08f3('0x1e')];this[_0x08f3('0x1f')]=_0x29119e[_0x08f3('0x1f')];this[_0x08f3('0x20')]=_0x29119e['trunks'];this[_0x08f3('0x21')]=config[_0x08f3('0x21')]||0x2;this['channels']={};this[_0x08f3('0x22')]={};this[_0x08f3('0x23')]={};this[_0x08f3('0x24')]={};this[_0x08f3('0x25')]={};this[_0x08f3('0x26')]={};this[_0x08f3('0x27')]={};this[_0x08f3('0x28')]={};this['queueBooked']={};this[_0x08f3('0x29')]={};ami['on'](_0x08f3('0x2a'),this[_0x08f3('0x2b')]['bind'](this));ami['on'](_0x08f3('0x2c'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x2e'),this[_0x08f3('0x2f')][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x30'),this[_0x08f3('0x8')][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x31'),this[_0x08f3('0x32')][_0x08f3('0x2d')](this));ami['on']('newexten',this[_0x08f3('0x33')][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x34'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0x08f3('0x35')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x08f3('0x2d')](this));this[_0x08f3('0x36')]();this[_0x08f3('0x37')]();}function isNotNull(_0x425f63){return _0x425f63!==null&&!_['isUndefined'](_0x425f63);}function checkIsLoggedIn(_0x599160,_0x3e4bf2){return function(){if(_0x3e4bf2<=0x0){_0x599160[_0x08f3('0x38')]=_0x08f3('0x39');throw _0x599160[_0x08f3('0x3a')]+_0x08f3('0x3b');}};}function isActive(_0x7daa10){return _0x7daa10;}function checkIsActive(_0x50938b,_0x3d7902){return function(){if(!isActive(_0x3d7902)){_0x50938b[_0x08f3('0x38')]=_0x08f3('0x3c');throw _0x50938b[_0x08f3('0x3a')]+_0x08f3('0x3d');}};}function checkInterval(_0x53da47){return function(){if(!isNotNull(_0x53da47['Interval'])){_0x53da47['message']=_0x08f3('0x3e');throw _0x53da47[_0x08f3('0x3a')]+_0x08f3('0x3f');}if(!isNotNull(_0x53da47[_0x08f3('0x40')]['Intervals'])){_0x53da47['message']='INTERVAL_IS_NULL';throw _0x53da47[_0x08f3('0x3a')]+_0x08f3('0x3f');}if(!isNotNull(_['isEmpty'](_0x53da47[_0x08f3('0x40')][_0x08f3('0x41')]))){_0x53da47[_0x08f3('0x38')]=_0x08f3('0x3e');throw _0x53da47[_0x08f3('0x3a')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3eab6a,_0x804a79,_0x9d6fe2){return{'action':_0x3eab6a,'response':_0x804a79,'message':_0x9d6fe2,'stack':_0x9d6fe2};}function myreject(_0x29f2ee){return function(_0x5a4fe1){return _0x29f2ee(msgResponse(_0x08f3('0x42'),_0x08f3('0x43'),JSON[_0x08f3('0x44')](_0x5a4fe1)));};}function getSeconds(_0x3a3a72,_0xa5f07b){var _0x471481=moment(_0x3a3a72)[_0x08f3('0x45')](0x0);var _0x2cdfdc=moment(_0xa5f07b)[_0x08f3('0x45')](0x0);return _0x471481['diff'](_0x2cdfdc,_0x08f3('0x46'));}function emit(_0x10c69d,_0x3e762d,_0x2cd37d){io['to'](_0x10c69d)[_0x08f3('0x47')](_0x3e762d,_0x2cd37d);}function emitVoiceQueueSummary(_0x33b560){if(_0x33b560['type']==='outbound'){var _0x4ce8ec={'id':_0x33b560['id'],'name':_0x33b560['name'],'strategy':_0x33b560['strategy'],'answered':_0x33b560[_0x08f3('0x48')],'available':_0x33b560[_0x08f3('0x49')],'loggedIn':_0x33b560[_0x08f3('0x4a')],'pTalking':_0x33b560[_0x08f3('0x4b')],'sumBillable':_0x33b560['sumBillable'],'sumDuration':_0x33b560[_0x08f3('0x4c')],'sumHoldTime':_0x33b560[_0x08f3('0x4d')]||0x0,'talking':_0x33b560[_0x08f3('0x4e')],'total':_0x33b560[_0x08f3('0x4f')],'type':_0x33b560[_0x08f3('0x50')],'unmanaged':_0x33b560['unmanaged'],'abandoned':_0x33b560[_0x08f3('0x51')],'waiting':_0x33b560[_0x08f3('0x52')],'loggedInDb':_0x33b560[_0x08f3('0x53')],'dialActive':_0x33b560[_0x08f3('0x54')],'dialMethod':_0x33b560[_0x08f3('0x55')],'dialOriginateCallerIdName':_0x33b560[_0x08f3('0x56')],'dialOriginateCallerIdNumber':_0x33b560[_0x08f3('0x57')],'dialOriginateTimeout':_0x33b560['dialOriginateTimeout'],'dialPrefix':_0x33b560['dialPrefix'],'outboundAnswerAgiCallsDay':_0x33b560['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x33b560[_0x08f3('0x58')],'outboundBlacklistCallsDay':_0x33b560['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x33b560['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x33b560[_0x08f3('0x59')],'outboundDropCallsDayACS':_0x33b560[_0x08f3('0x5a')],'outboundDropCallsDayCallersExit':_0x33b560[_0x08f3('0x5b')],'outboundDropCallsDayTimeout':_0x33b560[_0x08f3('0x5c')],'outboundNoAnswerCallsDay':_0x33b560['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x33b560[_0x08f3('0x5d')],'outboundOriginateFailureCallsDay':_0x33b560[_0x08f3('0x5e')],'outboundReCallsDay':_0x33b560[_0x08f3('0x5f')],'outboundRejectCallsDay':_0x33b560[_0x08f3('0x60')],'outboundUnknownCallsDay':_0x33b560[_0x08f3('0x61')],'predictiveIntervalAnsweredCalls':_0x33b560[_0x08f3('0x62')],'predictiveIntervalAvgHoldtime':_0x33b560['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x33b560['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x33b560[_0x08f3('0x63')],'predictiveIntervalDroppedCallsTimeout':_0x33b560[_0x08f3('0x64')],'predictiveIntervalErlangCalls':_0x33b560[_0x08f3('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x33b560['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x33b560[_0x08f3('0x66')],'predictiveIntervalMultiplicativeFactor':_0x33b560[_0x08f3('0x67')],'predictiveIntervalPauses':_0x33b560[_0x08f3('0x68')],'predictiveIntervalAvailable':_0x33b560['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x33b560[_0x08f3('0x69')],'message':_0x33b560[_0x08f3('0x38')],'originated':_0x33b560['originated'],'erlangCalls':_0x33b560['erlangCalls'],'erlangCallToSecond':_0x33b560[_0x08f3('0x6a')],'erlangAbandonmentRate':_0x33b560['erlangAbandonmentRate'],'erlangBusyFactor':_0x33b560[_0x08f3('0x6b')],'startPredictive':_0x33b560[_0x08f3('0x26')],'startProgressive':_0x33b560[_0x08f3('0x27')]};if(_0x33b560[_0x08f3('0x6c')]){_0x4ce8ec[_0x08f3('0x6c')]={'id':_0x33b560[_0x08f3('0x6c')]['id'],'name':_0x33b560[_0x08f3('0x6c')][_0x08f3('0x3a')],'active':_0x33b560[_0x08f3('0x6c')][_0x08f3('0x6d')],'callerid':_0x33b560[_0x08f3('0x6c')][_0x08f3('0x6e')]};}if(_0x33b560[_0x08f3('0x40')]){_0x4ce8ec[_0x08f3('0x40')]={'id':_0x33b560[_0x08f3('0x40')]['id'],'name':_0x33b560[_0x08f3('0x40')][_0x08f3('0x3a')]};}var _0x9552e9=md5(JSON[_0x08f3('0x44')](_0x4ce8ec));if(_0x33b560[_0x08f3('0x6f')]!==_0x9552e9){_0x33b560[_0x08f3('0x6f')]=_0x9552e9;emit(util[_0x08f3('0x70')](_0x08f3('0x71'),_0x4ce8ec[_0x08f3('0x3a')]),_0x08f3('0x72'),_0x4ce8ec);}}}function emitCampaignSummary(_0x357482){if(_0x357482[_0x08f3('0x50')]===_0x08f3('0x73')){emit(util[_0x08f3('0x70')](_0x08f3('0x74'),_0x357482[_0x08f3('0x3a')]),_0x08f3('0x75'),_0x357482);}}function checkGetDataPredictive(_0x2ab1df){if(isNotNull(_0x2ab1df)){if(!_['isEmpty'](_0x2ab1df)){loggerPredictive['info'](_0x08f3('0x76'));loggerPredictive[_0x08f3('0x77')](_0x08f3('0x78'),_0x2ab1df['predictiveIntervalTotalCalls']);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x79'),_0x2ab1df[_0x08f3('0x62')]);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7a'),_0x2ab1df[_0x08f3('0x64')]);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7b'),_0x2ab1df[_0x08f3('0x63')]);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7c'),_0x2ab1df[_0x08f3('0x7d')]);loggerPredictive[_0x08f3('0x77')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ab1df[_0x08f3('0x7e')]);loggerPredictive[_0x08f3('0x77')]('---------------------------');if(_0x2ab1df[_0x08f3('0x69')]>0x0){if(!_['isUndefined'](_0x2ab1df[_0x08f3('0x7e')])&&_0x2ab1df[_0x08f3('0x7e')]>0x0){return!![];}else{loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7f'));}if(!_[_0x08f3('0x80')](_0x2ab1df[_0x08f3('0x7d')])&&_0x2ab1df['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x08f3('0x77')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x08f3('0x77')](_0x08f3('0x81'));}}else{loggerPredictive['info'](_0x08f3('0x82'));}}else{loggerPredictive[_0x08f3('0x77')](_0x08f3('0x82'));}return![];}function mergeDataErlangB(_0x5345b5){return function(_0x24acf1){loggerPredictive[_0x08f3('0x77')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x08f3('0x77')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1[_0x08f3('0x83')]);loggerPredictive['info'](_0x08f3('0x84'),_0x24acf1[_0x08f3('0x6a')]);loggerPredictive[_0x08f3('0x77')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1[_0x08f3('0x6b')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1[_0x08f3('0x85')]);loggerPredictive[_0x08f3('0x77')]('---------------------------');_[_0x08f3('0x86')](_0x5345b5,_0x24acf1);};}function getDiff(_0x2c314e){var _0x37e38b=moment()[_0x08f3('0x45')](0x0);var _0x49f340=moment(_0x2c314e)[_0x08f3('0x45')](0x0);return _0x37e38b['diff'](_0x49f340,_0x08f3('0x46'));}function ifInterval(_0x1fa202,_0x4befc9){if(_[_0x08f3('0x80')](_0x4befc9)){return![];}if(getDiff(_0x4befc9)<_0x1fa202*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x3d8c1a){if(isNotNull(_0x3d8c1a)){if(!_[_0x08f3('0x80')](_0x3d8c1a[_0x08f3('0x27')])){_0x3d8c1a[_0x08f3('0x27')]=undefined;loggerPredictive[_0x08f3('0x77')](_0x3d8c1a[_0x08f3('0x3a')],_0x08f3('0x87'));}if(!_[_0x08f3('0x80')](_0x3d8c1a[_0x08f3('0x26')])){_0x3d8c1a['startPredictive']=undefined;loggerPredictive[_0x08f3('0x77')](_0x3d8c1a[_0x08f3('0x3a')],_0x08f3('0x88'));}if(!_[_0x08f3('0x80')](_0x3d8c1a['handlePredictive'])){clearInterval(_0x3d8c1a[_0x08f3('0x89')]);_0x3d8c1a[_0x08f3('0x89')]=undefined;loggerPredictive['info'](_0x3d8c1a['name'],_0x08f3('0x8a'));}}}function erlangb(_0x34cfa7,_0x549fe5){if(_0x549fe5===0x0){return 0x0;}var _0x3beec8=0x1;for(var _0x404d2e=0x1;_0x404d2e<=_0x549fe5;_0x404d2e+=0x1){_0x3beec8=0x1+_0x3beec8*_0x404d2e/_0x34cfa7;}return 0x1/_0x3beec8;}function isVoiceQueueOutbound(_0x2ffe78){return _0x2ffe78===_0x08f3('0x8b');}function isNotPreview(_0x446ae4){return _0x446ae4!==_0x08f3('0x1c');}function isCampaignIvr(_0x1fad62){return _0x1fad62===_0x08f3('0x73');}function getCallerId(_0x3c44d5,_0x562f63,_0x24ff92){if(!_['isUndefined'](_0x24ff92)&&_0x08f3('0x8c')===typeof _0x24ff92&&!_[_0x08f3('0x8d')](_0x24ff92)){if(!_[_0x08f3('0x80')](_0x562f63)&&_0x08f3('0x8c')===typeof _0x562f63&&!_[_0x08f3('0x8d')](_0x562f63)){return util[_0x08f3('0x70')](_0x08f3('0x8e'),_0x562f63,_0x24ff92);}return util['format'](_0x08f3('0x8e'),_0x24ff92,_0x24ff92);}if(!_['isUndefined'](_0x3c44d5)&&_0x08f3('0x8c')===typeof _0x3c44d5&&!_['isEmpty'](_0x3c44d5)){return _0x3c44d5;}return _0x08f3('0x8f');}function loggerCatchQueueSummary(_0x6d786a,_0x273621){return function(_0x524139){freeVariablesPredictive(_0x273621);emitVoiceQueueSummary(_0x273621);emitCampaignSummary(_0x273621);loggerSyncQueueSummary[_0x08f3('0x90')](_0x6d786a,util['inspect'](_0x524139,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xd5fc83,_0x7ac84e){return function(_0x39ff78){loggerPredictive[_0x08f3('0x90')](_0x7ac84e['name'],_0xd5fc83);loggerPredictive[_0x08f3('0x90')](_0x39ff78['stack']);freeVariablesPredictive(_0x7ac84e);};}function loggerCatch(_0x464129){return function(_0x16bb0a){logger[_0x08f3('0x90')](_0x464129,util[_0x08f3('0x91')](_0x16bb0a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2e2ec4){return _0x2e2ec4&&!_['isUndefined'](_0x2e2ec4)&&_0x2e2ec4[_0x08f3('0x92')]>0x0;}function decremetOriginate(_0x453410){if(!_['isUndefined'](_0x453410)&&_0x453410!==null){if(_0x453410[_0x08f3('0x93')]('originated')){if(_0x453410['originated']>0x0){_0x453410['originated']-=0x1;}else{logger[_0x08f3('0x90')](_0x08f3('0x94'));}}}else{logger['error'](_0x08f3('0x95'));}}function checkContactLowerLimitOriginate(_0x39e8a2,_0xe03f1e,_0x1ddde8){if(_0xe03f1e>_0x1ddde8){for(var _0x56d55c=0x0;_0x56d55c<_0xe03f1e-_0x1ddde8;_0x56d55c+=0x1){decremetOriginate(_0x39e8a2);}}}function loggerGetContactDialer(_0x16fbbb,_0x47a635,_0x1b0ca1){return function(_0x572a89){checkContactLowerLimitOriginate(_0x47a635,_0x1b0ca1,0x0);logger[_0x08f3('0x90')](_0x16fbbb,util[_0x08f3('0x91')](_0x572a89,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x52977d){return function(_0x3f2c68){if(isNotNull(_0x3f2c68)&&isNotNull(_0x3f2c68[0x0])){if(_0x3f2c68[0x0][_0x08f3('0x96')]>0x0){_0x52977d[_0x08f3('0x38')]='RESCHEDULED_CONTACTS';logger[_0x08f3('0x77')](_0x08f3('0x97')+_0x52977d['name'],_0x3f2c68[0x0][_0x08f3('0x96')],_0x08f3('0x98'));}else{_0x52977d[_0x08f3('0x38')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x08f3('0x99')+_0x52977d[_0x08f3('0x3a')]);}}};}function notSendMessagesQueue(_0x2dc178){if(_0x2dc178[_0x08f3('0x9a')]){freeVariablesPredictive(_0x2dc178);if(_0x2dc178['originated']===0x0&&_0x2dc178[_0x08f3('0x4e')]===0x0&&_0x2dc178[_0x08f3('0x52')]===0x0&&(_0x2dc178[_0x08f3('0x4b')]||0x0)===0x0){_0x2dc178[_0x08f3('0x9a')]=![];_0x2dc178[_0x08f3('0x49')]=0x0;_0x2dc178['message']=_0x08f3('0x3c');loggerSyncQueueSummary[_0x08f3('0x90')](_0x08f3('0x9b'),_0x2dc178['name'],_0x08f3('0x9c'));}else{_0x2dc178['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x08f3('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2dc178[_0x08f3('0x3a')],_0x08f3('0x9d'));}emitVoiceQueueSummary(_0x2dc178);}}function notSendMessagesCampaign(_0x4a4bb9){if(_0x4a4bb9[_0x08f3('0x9a')]){if(_0x4a4bb9['originated']===0x0){_0x4a4bb9[_0x08f3('0x9a')]=![];_0x4a4bb9['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x08f3('0x90')](_0x08f3('0x9e'),_0x4a4bb9['name'],'is\x20not\x20active');}else{_0x4a4bb9[_0x08f3('0x38')]=_0x08f3('0x9f');loggerSyncQueueSummary[_0x08f3('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4a4bb9[_0x08f3('0x3a')],_0x08f3('0x9d'));}emitCampaignSummary(_0x4a4bb9);}}function createObjHistory(_0x2cd95d,_0x5e4a9b,_0x2970b7,_0x1b64c5,_0x47f82e){_0x2cd95d[_0x08f3('0x38')]=_0x2970b7;var _0x4e020c=new Action(_0x2cd95d,_0x5e4a9b);var _0x2bccb1=new History(_0x4e020c);_0x2bccb1[_0x08f3('0xa0')]=_0x1b64c5;_0x2bccb1[_0x08f3('0xa1')]=_0x47f82e;_0x2bccb1[_0x08f3('0xa2')]=_0x4e020c[_0x08f3('0xa3')];return _0x2bccb1;}Dialer[_0x08f3('0xa4')]['loopClearZombieChannels']=function(){var _0x151a6f=this;setInterval(function(){_0x151a6f['clearZombieChannels'](_0x151a6f[_0x08f3('0x24')],_0x08f3('0xa5'));_0x151a6f[_0x08f3('0xa6')](_0x151a6f[_0x08f3('0x22')],_0x08f3('0xa7'));},0x32c8);};Dialer[_0x08f3('0xa4')][_0x08f3('0xa6')]=function(_0x3837ed,_0x30f89a){var _0x4fcc41=this;for(var _0x3024b5 in _0x3837ed){if(_0x3837ed['hasOwnProperty'](_0x3024b5)){this[_0x08f3('0x1b')][_0x08f3('0x18')](function(){if(!_[_0x08f3('0xa8')](_0x3837ed[_0x3024b5])){return ami[_0x08f3('0xa9')]({'action':'status','channel':_0x3837ed[_0x3024b5][_0x08f3('0xaa')]})[_0x08f3('0xab')](function(_0x455995){if(_0x455995[_0x08f3('0x38')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3837ed[_0x3024b5]&&_0x3837ed[_0x3024b5]['type']!==_0x08f3('0x73')){_0x4fcc41[_0x08f3('0xac')](_0x4fcc41[_0x08f3('0x1d')][_0x3837ed[_0x3024b5][_0x08f3('0xad')]]);logger[_0x08f3('0x90')]('[Dialer][checkChannel]',_0x30f89a,_0x3024b5,_0x3837ed[_0x3024b5][_0x08f3('0xad')]);delete _0x3837ed[_0x3024b5];}if(_0x3837ed[_0x3024b5]&&_0x3837ed[_0x3024b5]['type']===_0x08f3('0x73')){_0x4fcc41[_0x08f3('0xac')](_0x4fcc41[_0x08f3('0x1e')][_0x3837ed[_0x3024b5][_0x08f3('0xad')]]);logger[_0x08f3('0x90')]('[Dialer][checkChannel][ivr]',_0x30f89a,_0x3024b5,_0x3837ed[_0x3024b5][_0x08f3('0xad')]);delete _0x3837ed[_0x3024b5];}},0x2328);}});}});}}};Dialer[_0x08f3('0xa4')]['countReScheduled']=function(_0x4b6b71){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper[_0x08f3('0xb0')](_0x4b6b71))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb1')));};Dialer[_0x08f3('0xa4')]['checkIsBlackList']=function(_0x4b9d6e){return BPromise[_0x08f3('0xae')]()['then'](cmHopperBlack[_0x08f3('0xb2')](_0x4b9d6e))['catch'](loggerCatch(_0x08f3('0xb3')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x46cfb4){return BPromise[_0x08f3('0xae')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x46cfb4))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb4')));};Dialer['prototype'][_0x08f3('0xb5')]=function(_0x2a20ac){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopperHistory['avgHandleTime'](_0x2a20ac))[_0x08f3('0xab')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x08f3('0xa4')]['rescheduleContact']=function(_0xeed11d){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper['rescheduleContact'](_0xeed11d))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb6')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xb7')]=function(_0x55ceb8,_0x213df5,_0x2bc8b2,_0x3ae511){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper[_0x08f3('0xb7')](_0x55ceb8,_0x213df5,_0x2bc8b2,_0x3ae511))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb8')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xb9')]=function(_0xc338d8,_0x2da9b4,_0x255500){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper['getContactDialerIvr'](_0xc338d8,_0x2da9b4,_0x255500))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb8')));};Dialer[_0x08f3('0xa4')]['getVoiceQueueRtPauses']=function(_0x11fd24){return BPromise['resolve']()[_0x08f3('0xaf')](voiceQueueRt[_0x08f3('0xba')](_0x11fd24))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xbb')));};Dialer['prototype'][_0x08f3('0xbc')]=function(_0x51e162){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper[_0x08f3('0xbc')](_0x51e162))['catch'](loggerCatch(_0x08f3('0xbd')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xbe')]=function(_0x1c0e3a){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopperHistory[_0x08f3('0xbe')](_0x1c0e3a))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xbf')));};Dialer['prototype']['updateOriginated']=function(_0x431197){if(!_[_0x08f3('0x80')](_0x431197)&&_0x431197!==null){if(_0x431197['hasOwnProperty'](_0x08f3('0xc0'))){if(_0x431197[_0x08f3('0xc0')]>0x0){_0x431197[_0x08f3('0xc0')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x08f3('0x90')](_0x08f3('0xc1'));}};Dialer[_0x08f3('0xa4')][_0x08f3('0xc2')]=function(_0x28b17f,_0x5c5556){var _0x4bc201=this;return function(_0x1fdb45){_0x4bc201['updateOriginated'](_0x5c5556);logger[_0x08f3('0x90')](_0x28b17f,util[_0x08f3('0x91')](_0x1fdb45,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x08f3('0xc3')]=function(_0x3203b7,_0x43f456,_0x16bd28){var _0x460d54={'state':0x19,'statedesc':_0x08f3('0xc4')};this[_0x08f3('0xac')](_0x43f456);this[_0x08f3('0xc5')](_[_0x08f3('0x86')](_0x460d54,_[_0x08f3('0xc6')](_0x16bd28,[_0x08f3('0xc7'),_0x08f3('0xc8'),_0x08f3('0xc9'),_0x08f3('0xca'),_0x08f3('0xcb')])),_0x08f3('0xcc'),'[emptyContact]');logger[_0x08f3('0x90')](_0x3203b7);};Dialer['prototype']['isSuccess']=function(_0x43aa21){return _0x43aa21===_0x08f3('0xcd');};Dialer[_0x08f3('0xa4')][_0x08f3('0xce')]=function(_0x2e47a8){return!_['isUndefined'](_0x2e47a8)&&_0x2e47a8&&!_[_0x08f3('0x80')](_0x2e47a8[_0x08f3('0x3a')])&&!_[_0x08f3('0x80')](_0x2e47a8['active'])&&_0x2e47a8[_0x08f3('0x6d')]&&(this[_0x08f3('0x20')][util['format'](_0x08f3('0xcf'),_0x2e47a8[_0x08f3('0x3a')])][_0x08f3('0xd0')]===_0x08f3('0xd1')||this[_0x08f3('0x20')][util[_0x08f3('0x70')](_0x08f3('0xcf'),_0x2e47a8[_0x08f3('0x3a')])]['status']===_0x08f3('0xd2'));};Dialer[_0x08f3('0xa4')][_0x08f3('0xc5')]=function(_0x224428,_0x4ac30f,_0x41e77e){this[_0x08f3('0xbe')](_0x224428)['catch'](loggerCatch(_0x4ac30f));this['moveContactManagedDialer'](_0x224428)[_0x08f3('0xab')](loggerCatch(_0x41e77e));};Dialer[_0x08f3('0xa4')][_0x08f3('0xd3')]=function(_0x5ce0f8){var _0x22fb06=this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];var _0x3ecdcd;if(!_[_0x08f3('0xa8')](_0x5ce0f8)&&!_[_0x08f3('0xa8')](_0x5ce0f8['variable'])&&!_[_0x08f3('0xa8')](_0x5ce0f8[_0x08f3('0xd5')][_0x08f3('0xd6')])&&_0x5ce0f8[_0x08f3('0xd7')]===_0x08f3('0xd8')&&_0x22fb06){if(_0x22fb06[_0x08f3('0x50')]!==_0x08f3('0x73')&&this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0xd9')]&&_0x5ce0f8['value']===_0x08f3('0xda')){delete this['uniqueId'][_0x5ce0f8[_0x08f3('0xd4')]];this['updateOriginated'](this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]]);this['voiceQueues'][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;this[_0x08f3('0x1d')][_0x22fb06['queue']][_0x08f3('0xdb')]+=0x1;_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd[_0x08f3('0xa0')]=0x12;_0x3ecdcd[_0x08f3('0xa1')]='HangupInAMD';_0x3ecdcd[_0x08f3('0xdc')]='AMD';this[_0x08f3('0xc5')](_0x3ecdcd,_0x08f3('0xdd'),'[syncHangupInAMD]');}if(_0x22fb06[_0x08f3('0x50')]!=='ivr'&&this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]]['dialAMDActive']&&_0x5ce0f8['value']===_0x08f3('0xde')){delete this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];this['updateOriginated'](this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]]);this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;this['voiceQueues'][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0xdb')]+=0x1;_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd[_0x08f3('0xa0')]=0x13;_0x3ecdcd['statedesc']='Machine';_0x3ecdcd[_0x08f3('0xdc')]=_0x08f3('0xdf');_0x3ecdcd[_0x08f3('0xe0')]=!![];this[_0x08f3('0xc5')](_0x3ecdcd,_0x08f3('0xe1'),_0x08f3('0xe2'));}if(_0x22fb06[_0x08f3('0x50')]===_0x08f3('0x73')&&this[_0x08f3('0x1e')][_0x22fb06['queue']]['dialAMDActive']&&_0x5ce0f8[_0x08f3('0xe3')]===_0x08f3('0xda')){delete this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1e')][_0x22fb06[_0x08f3('0xad')]]);_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd['state']=0x12;_0x3ecdcd[_0x08f3('0xa1')]=_0x08f3('0xe4');_0x3ecdcd['membername']=_0x08f3('0xdf');this[_0x08f3('0xc5')](_0x3ecdcd,_0x08f3('0xe5'),_0x08f3('0xe6'));}if(_0x22fb06[_0x08f3('0x50')]===_0x08f3('0x73')&&this[_0x08f3('0x1e')][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0xd9')]&&_0x5ce0f8[_0x08f3('0xe3')]===_0x08f3('0xde')){delete this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1e')][_0x22fb06[_0x08f3('0xad')]]);_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd[_0x08f3('0xa0')]=0x13;_0x3ecdcd[_0x08f3('0xa1')]=_0x08f3('0xe7');_0x3ecdcd[_0x08f3('0xdc')]=_0x08f3('0xdf');_0x3ecdcd[_0x08f3('0xe0')]=!![];this[_0x08f3('0xc5')](_0x3ecdcd,'[syncMachineIvr][createHistory]',_0x08f3('0xe8'));}}};Dialer[_0x08f3('0xa4')][_0x08f3('0x32')]=function(_0x19c4ea){var _0x47441b=this[_0x08f3('0x24')][_0x19c4ea[_0x08f3('0xd4')]];var _0x183142=this;var _0x43e264;if(_0x47441b&&_0x47441b[_0x08f3('0x50')]===_0x08f3('0x73')){delete this['uniqueId'][_0x19c4ea[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1e')][_0x47441b[_0x08f3('0xad')]]);this[_0x08f3('0x1e')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0xe9')]+=0x1;_0x43e264=new Hangup(_0x47441b,_0x19c4ea);this[_0x08f3('0xbe')](_0x43e264)[_0x08f3('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x08f3('0xbc')](_0x43e264)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xea')));}if(_0x47441b&&_0x47441b[_0x08f3('0x50')]!==_0x08f3('0x73')&&isNotNull(this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]]['dialQueueProject'])){delete this[_0x08f3('0x24')][_0x19c4ea[_0x08f3('0xd4')]];this['updateOriginated'](this['voiceQueues'][_0x47441b[_0x08f3('0xad')]]);this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;this['voiceQueues'][_0x47441b[_0x08f3('0xad')]][_0x08f3('0xdb')]+=0x1;_0x43e264=new Hangup(_0x47441b,_0x19c4ea);_0x43e264[_0x08f3('0xa0')]=0x10;_0x43e264[_0x08f3('0xa1')]=_0x08f3('0xeb');_0x43e264[_0x08f3('0xdc')]=_0x08f3('0xec');this[_0x08f3('0xbe')](_0x43e264)[_0x08f3('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x08f3('0xbc')](_0x43e264)['catch'](loggerCatch(_0x08f3('0xea')));}if(_0x47441b&&_0x47441b[_0x08f3('0x50')]!=='ivr'&&!isNotNull(this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0xed')])){delete this[_0x08f3('0x24')][_0x19c4ea[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]]);this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0x61')]+=0x1;_0x43e264=new Hangup(_0x47441b,_0x19c4ea);_0x43e264[_0x08f3('0xa0')]=0xc;_0x43e264[_0x08f3('0xa1')]=_0x19c4ea[_0x08f3('0xee')];_0x43e264['membername']='Unknow';this[_0x08f3('0xbe')](_0x43e264)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xef')));this[_0x08f3('0xbc')](_0x43e264)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xea')));}};Dialer[_0x08f3('0xa4')][_0x08f3('0x2f')]=function(_0x4ad637){var _0x4c8cb3=this[_0x08f3('0x24')][_0x4ad637[_0x08f3('0xd4')]];var _0x2baa4e=this;if(this[_0x08f3('0x1d')][_0x4ad637['queue']]){if(_0x4c8cb3&&_0x4c8cb3[_0x08f3('0x50')]!==_0x08f3('0x73')){delete this[_0x08f3('0x24')][_0x4ad637[_0x08f3('0xd4')]];this[_0x08f3('0x1d')][_0x4ad637[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;var _0x2bf1c8=new AgentComplete(_0x4c8cb3,_0x4ad637);if(_0x4ad637[_0x08f3('0xf0')]===_0x08f3('0xf1')){_0x2bf1c8[_0x08f3('0xf2')]=this['voiceQueues'][_0x4ad637[_0x08f3('0xad')]][_0x08f3('0xf3')]&&this[_0x08f3('0x1d')][_0x4ad637[_0x08f3('0xad')]]['dialAgiAfterHangupAgent']?moment()[_0x08f3('0x70')](_0x08f3('0xf4')):undefined;}this['createHistory'](_0x2bf1c8)['catch'](loggerCatch(_0x08f3('0xf5')));this[_0x08f3('0xbc')](_0x2bf1c8)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x08f3('0xa4')][_0x08f3('0x2b')]=function(_0x3aa4a2){if(this[_0x08f3('0x1d')][_0x3aa4a2[_0x08f3('0xad')]]){if(this['uniqueId'][_0x3aa4a2['uniqueid']]&&this[_0x08f3('0x24')][_0x3aa4a2[_0x08f3('0xd4')]]['type']!==_0x08f3('0x73')){this[_0x08f3('0xac')](this[_0x08f3('0x1d')][_0x3aa4a2[_0x08f3('0xad')]]);this[_0x08f3('0x24')][_0x3aa4a2[_0x08f3('0xd4')]]['answertime']=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4ce601){this[_0x08f3('0xbe')](_0x4ce601)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xf5')));this[_0x08f3('0xbc')](_0x4ce601)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xf6')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xf7')]=function(_0x584cbf){var _0x49a7f8=this[_0x08f3('0x24')][_0x584cbf[_0x08f3('0xd4')]];var _0x158a78=this;if(this[_0x08f3('0x1d')][_0x584cbf['queue']]){if(_0x49a7f8&&_0x49a7f8[_0x08f3('0x50')]!==_0x08f3('0x73')){delete this[_0x08f3('0x24')][_0x584cbf[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1d')][_0x584cbf[_0x08f3('0xad')]]);_0x49a7f8['droptime']=moment()['format'](_0x08f3('0xf4'));var _0x4a8bb1=new QueueCallerAbandon(_0x49a7f8,_0x584cbf);if(getSeconds(_0x49a7f8[_0x08f3('0xf8')],_0x49a7f8[_0x08f3('0xf9')])>=_0x49a7f8[_0x08f3('0xfa')]){this[_0x08f3('0x1d')][_0x584cbf['queue']][_0x08f3('0x64')]+=0x1;this['voiceQueues'][_0x584cbf[_0x08f3('0xad')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x08f3('0x1d')][_0x584cbf['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4a8bb1[_0x08f3('0xa0')]=0xa;_0x4a8bb1['statedesc']=_0x08f3('0xfb');_0x4a8bb1[_0x08f3('0xfc')]=_0x08f3('0xfd');_0x4a8bb1[_0x08f3('0xf2')]=this[_0x08f3('0x1d')][_0x584cbf['queue']][_0x08f3('0xf3')]?moment()[_0x08f3('0x70')](_0x08f3('0xf4')):undefined;this[_0x08f3('0xfe')](_0x4a8bb1);}else{this[_0x08f3('0x1d')][_0x584cbf[_0x08f3('0xad')]][_0x08f3('0x63')]+=0x1;this['voiceQueues'][_0x584cbf[_0x08f3('0xad')]][_0x08f3('0x5b')]+=0x1;_0x4a8bb1[_0x08f3('0xa0')]=0xb;_0x4a8bb1[_0x08f3('0xa1')]=_0x08f3('0xff');_0x4a8bb1[_0x08f3('0xfc')]=_0x08f3('0x100');this[_0x08f3('0xfe')](_0x4a8bb1);}}}};Dialer[_0x08f3('0xa4')]['syncNewExten']=function(_0x476935){if(this[_0x08f3('0x22')][_0x476935[_0x08f3('0xd4')]]){this['actions'][_0x476935[_0x08f3('0xd4')]][_0x08f3('0xaa')]=_0x476935[_0x08f3('0xaa')];}if(this[_0x08f3('0x24')][_0x476935[_0x08f3('0xd4')]]){this[_0x08f3('0x24')][_0x476935[_0x08f3('0xd4')]][_0x08f3('0xaa')]=_0x476935[_0x08f3('0xaa')];}};Dialer[_0x08f3('0xa4')][_0x08f3('0x35')]=function(_0x168599){if(strategy[this['voiceQueues'][this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0xad')]]['strategy']]===_0x08f3('0x17')){if(this[_0x08f3('0x22')][_0x168599['actionid']]&&_['isNil'](this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0x101')])&&_0x168599['status']==='1'&&_0x168599['paused']==='0'){if(this[_0x08f3('0x1f')][_0x168599[_0x08f3('0x102')]]){if(!this[_0x08f3('0x1f')][_0x168599['stateinterface']][_0x08f3('0x101')]){this[_0x08f3('0x1f')][_0x168599[_0x08f3('0x102')]]['locked']=!![];this[_0x08f3('0x22')][_0x168599[_0x08f3('0x103')]][_0x08f3('0x101')]=!![];this[_0x08f3('0x22')][_0x168599['actionid']]['stateinterface']=_0x168599[_0x08f3('0x102')];}}}}else if((strategy[this[_0x08f3('0x1d')][this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0xad')]]['strategy']]||_0x08f3('0x16'))==='rrmemory'){if(this[_0x08f3('0x22')][_0x168599['actionid']]){if(this[_0x08f3('0x1f')][_0x168599['stateinterface']]){this['actions'][_0x168599[_0x08f3('0x103')]]['stateinterface']=_0x168599[_0x08f3('0x102')];if(_['isNil'](this['queueBooked'][this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0xad')]])){this[_0x08f3('0x104')][this['actions'][_0x168599['actionid']][_0x08f3('0xad')]]=[];}this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0x168599[_0x08f3('0x103')]]['queue']][_0x08f3('0x105')](_[_0x08f3('0x86')](_['pick'](this['actions'][_0x168599['actionid']],['idHopper',_0x08f3('0x102')]),{'status':_0x168599['status'],'paused':_0x168599['paused']}));}}}};function unlockQueueStatus(_0x301d53,_0x30a369){setTimeout(function(){if(_[_0x08f3('0x80')](_0x301d53[_0x08f3('0x106')])){loggerBooked[_0x08f3('0x90')]('[unlockQueueStatus][undefined]',_0x30a369);}_0x301d53[_0x08f3('0x106')]=!![];loggerBooked['info'](_0x08f3('0x107'),_0x30a369,JSON['stringify'](_[_0x08f3('0xc6')](_0x301d53,[_0x08f3('0x3a'),_0x08f3('0x106')])));},0x1f3);}Dialer['prototype'][_0x08f3('0x108')]=function(_0xaf4c8a){var _0x9f8c50=this;var _0x130f5a=_0x9f8c50[_0x08f3('0x1d')][_0x9f8c50[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]];if(strategy[this[_0x08f3('0x1d')][this['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]['strategy']]===_0x08f3('0x17')){if(this['actions'][_0xaf4c8a['actionid']]&&this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0x102')]){this[_0x08f3('0x1c')][_0x08f3('0x109')](this['actions'][_0xaf4c8a[_0x08f3('0x103')]]['idHopper'],this['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0x102')])[_0x08f3('0xab')](function(_0xe007e){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x08f3('0x91')](_0xe007e,{'showHidden':![],'depth':null}));})[_0x08f3('0x1a')](function(){_0x9f8c50[_0x08f3('0xac')](_0x9f8c50[_0x08f3('0x1d')][_0x9f8c50['actions'][_0xaf4c8a['actionid']][_0x08f3('0xad')]]);_0x9f8c50[_0x08f3('0x1f')][_0x9f8c50['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0x102')]][_0x08f3('0x101')]=![];delete _0x9f8c50[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]];unlockQueueStatus(_0x130f5a);});}else{this[_0x08f3('0xac')](this[_0x08f3('0x1d')][this['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]]['ContactId'],'ListId':this['actions'][_0xaf4c8a['actionid']][_0x08f3('0xc8')],'VoiceQueueId':this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xca')]||undefined,'CampaignId':this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xcb')]||undefined})['catch'](loggerCatch(_0x08f3('0x10a')));delete this['actions'][_0xaf4c8a[_0x08f3('0x103')]];unlockQueueStatus(_0x130f5a);}}else if((strategy[this[_0x08f3('0x1d')][this[_0x08f3('0x22')][_0xaf4c8a['actionid']]['queue']]['strategy']]||_0x08f3('0x16'))===_0x08f3('0x16')){var _0x3e3630;if(this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]]&&!_[_0x08f3('0x8d')](this['queueBooked'][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]])){if(this['queueBookedRR'][_0x9f8c50[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]]){this[_0x08f3('0x29')][_0x9f8c50[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]=this[_0x08f3('0x29')][this[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]]?this[_0x08f3('0x29')][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]:this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]?this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]][_0x08f3('0x10b')]||0x0:0x0;}this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0xaf4c8a['actionid']]['queue']][_0x08f3('0x10b')]=this['queueBookedRR'][this[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]];for(var _0x5e64aa=0x0;_0x5e64aa=0x0?!![]:![];})[_0x08f3('0xab')](myreject(_0x5ba5a3)));}}else{_0x4ebcd6[_0x08f3('0x105')](ami[_0x08f3('0xa9')]({'action':_0x08f3('0x125'),'command':util['format'](_0x08f3('0x126'),_0x1dad60,!_[_0x08f3('0x80')](config[_0x08f3('0x121')][_0x59623f])?_0x59623f:'')})[_0x08f3('0xaf')](function(_0x37dbb3){return _0x37dbb3[_0x08f3('0x128')][_0x08f3('0x129')](_0x08f3('0x12a'))>=0x0?!![]:![];})[_0x08f3('0xab')](myreject(_0x5ba5a3)));}BPromise[_0x08f3('0x12b')](_0x4ebcd6)['then'](function(_0x1aa625){var _0x3922a8=_[_0x08f3('0x12c')](_0x1aa625);if(_0x3922a8){return _0x41c1f(_0x3922a8);}else{_0x377c1f['message']=_0x3bd762?_0x08f3('0x12d'):_0x08f3('0x12e');return _0x5ba5a3(msgResponse(_0x08f3('0x12f'),_0x08f3('0x11f'),_0x08f3('0x130')+_0x3bd762+'\x20'+_0x3cdfee+_0x08f3('0x131')+util[_0x08f3('0x91')](_0x1dad60,{'showHidden':![],'depth':null})+_0x08f3('0x132')+_0x59623f));}})[_0x08f3('0xab')](function(_0x30c73c){return _0x5ba5a3(msgResponse(_0x08f3('0x11e'),'Failure',JSON[_0x08f3('0x44')](_0x30c73c)));});});};Dialer[_0x08f3('0xa4')][_0x08f3('0x133')]=function(_0x104c41){var _0x4bddc9=this;return function(){switch(_0x104c41[_0x08f3('0x55')]){case _0x08f3('0x134'):freeVariablesPredictive(_0x104c41);_0x4bddc9['handlePower'](_0x104c41,0x1);break;case _0x08f3('0x135'):freeVariablesPredictive(_0x104c41);_0x4bddc9[_0x08f3('0x136')](_0x104c41,_0x104c41['dialPowerLevel']);break;case _0x08f3('0x137'):_0x4bddc9['predictive'](_0x104c41);break;case _0x08f3('0x138'):freeVariablesPredictive(_0x104c41);_0x4bddc9[_0x08f3('0x136')](_0x104c41,0x1);break;default:freeVariablesPredictive(_0x104c41);logger[_0x08f3('0x90')]('Queue',_0x104c41[_0x08f3('0x3a')],_0x08f3('0x139'));}};};Dialer['prototype'][_0x08f3('0x13a')]=function(_0x261d89){var _0x21de6e=this;return function(){_0x21de6e[_0x08f3('0x13b')](_0x261d89);};};Dialer['prototype'][_0x08f3('0x8')]=function(_0x521869){var _0x42818f=this;if(isNotPreview(_0x521869[_0x08f3('0x55')])){if(isVoiceQueueOutbound(_0x521869[_0x08f3('0x50')])&&isActive(_0x521869[_0x08f3('0x54')])){_0x521869[_0x08f3('0x9a')]=!![];BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](checkIsLoggedIn(_0x521869,_0x521869[_0x08f3('0x4a')]))[_0x08f3('0xaf')](checkIsActive(_0x521869,_0x521869[_0x08f3('0x54')]))[_0x08f3('0xaf')](checkInterval(_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x13c')](_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x11d')](_0x521869[_0x08f3('0x13d')],_0x521869[_0x08f3('0x13e')],_0x521869[_0x08f3('0x3a')],_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x13f')](_0x521869[_0x08f3('0x40')],_0x521869[_0x08f3('0x13e')],_0x521869[_0x08f3('0x3a')],_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x133')](_0x521869))[_0x08f3('0xab')](loggerCatchQueueSummary(_0x08f3('0x140'),_0x521869));}else{notSendMessagesQueue(_0x521869);}}else{freeVariablesPredictive(_0x521869);}};Dialer['prototype'][_0x08f3('0x119')]=function(){var _0x4731be=this;var _0x11b53f;for(var _0x2315f2 in this[_0x08f3('0x1e')]){if(this['campaigns'][_0x08f3('0x93')](_0x2315f2)){_0x11b53f=this[_0x08f3('0x1e')][_0x2315f2];if(isCampaignIvr(_0x11b53f['type'])&&isActive(_0x11b53f[_0x08f3('0x6d')])){_0x11b53f[_0x08f3('0x9a')]=!![];BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](checkIsActive(_0x11b53f,_0x11b53f[_0x08f3('0x6d')]))[_0x08f3('0xaf')](checkInterval(_0x11b53f))[_0x08f3('0xaf')](_0x4731be['checkIsTrunkReachable'](_0x11b53f))[_0x08f3('0xaf')](_0x4731be[_0x08f3('0x11d')](_0x11b53f[_0x08f3('0x13d')],_0x11b53f['dialTimezone'],_0x11b53f[_0x08f3('0x3a')],_0x11b53f))[_0x08f3('0xaf')](_0x4731be[_0x08f3('0x13f')](_0x11b53f['Interval'],_0x11b53f[_0x08f3('0x13e')],_0x11b53f[_0x08f3('0x3a')],_0x11b53f))[_0x08f3('0xaf')](_0x4731be[_0x08f3('0x13a')](_0x11b53f))[_0x08f3('0xab')](loggerCatchQueueSummary(_0x08f3('0x141'),_0x11b53f));}else{notSendMessagesCampaign(_0x11b53f);}}}};function getCallerIdRandom(_0x299890,_0x2318f6){var _0x1eae10,_0x784926,_0x3a7522;if(_0x2318f6<=0x0){_0x2318f6=0x1;}_0x1eae10=new RegExp(_0x08f3('0x142')+_0x2318f6+'}$');_0x784926=Math['pow'](0xa,_0x2318f6-0x1);_0x3a7522=Math[_0x08f3('0x143')](0xa,_0x2318f6)-0x1;return util['format']('%s',_[_0x08f3('0x144')](_0x299890,_0x1eae10,_[_0x08f3('0x145')](_0x784926,_0x3a7522)));}function extractCalleridName(_0x469314){var _0x414040=_0x469314[_0x08f3('0x146')](/"(.*?)"/);return _0x414040?_0x414040[0x1]:_0x469314;}function extractCalleridNumber(_0x4e7007){var _0x83848a=_0x4e7007[_0x08f3('0x146')](/<(.*?)>/);return _0x83848a?_0x83848a[0x1]:_0x4e7007;}Dialer['prototype']['actionOriginate']=function(_0x1adf27,_0x3a6e68){var _0x6a89c2=this;var _0x1102e5=uuid['v4']();this[_0x08f3('0x22')][_0x1102e5]=new Action(_0x1adf27,_0x3a6e68,_0x1102e5);return new BPromise(function(_0x5741db,_0x55a9a3){if(_[_0x08f3('0x80')](_0x1adf27)&&_0x08f3('0x147')!==typeof _0x1adf27){return _0x55a9a3(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x08f3('0x80')](_0x3a6e68['Contact'][_0x08f3('0x148')])||_0x3a6e68['Contact'][_0x08f3('0x148')]===null){return _0x55a9a3(msgResponse(_0x08f3('0x149'),_0x08f3('0x11f'),_0x08f3('0x14a')));}var _0x156f65={'XMD-CALLERID':_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x14b')](),'XMD-AGI':_0x1adf27[_0x08f3('0xed')]?util[_0x08f3('0x70')](_0x08f3('0x14c'),ipAgi,_0x1adf27[_0x08f3('0xed')]):_0x08f3('0x14d'),'XMD-AGIAFTER':_0x1adf27[_0x08f3('0xf3')]?util[_0x08f3('0x70')](_0x08f3('0x14c'),ipAgi,_0x1adf27[_0x08f3('0xf3')]):_0x08f3('0x14d'),'XMD-QUEUE':_0x1adf27[_0x08f3('0x50')]===_0x08f3('0x8b')?util['format'](_0x08f3('0x14e'),_0x1adf27[_0x08f3('0x3a')],_0x1adf27[_0x08f3('0x14f')]||'',_0x1adf27[_0x08f3('0x150')]?'c':'',_0x1adf27[_0x08f3('0xfa')]||0x3):_0x08f3('0x14d'),'XMD-CONTACTID':_0x3a6e68[_0x08f3('0xc7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x14b')](),'XMD-AMD':_0x1adf27[_0x08f3('0xd9')]?_0x08f3('0x151'):_0x08f3('0x14d'),'XMD-DESTINATION':_0x08f3('0xd8')};if(_0x1adf27[_0x08f3('0xd9')]){_0x156f65['XMD-AMDINITIALSILENCE']=_0x1adf27['dialAMDInitialSilence']||0x9c4;_0x156f65['XMD-AMDGREETING']=_0x1adf27['dialAMDGreeting']||0x5dc;_0x156f65['XMD-AMDAFTERGREETINGSILENCE']=_0x1adf27['dialAMDAfterGreetingSilence']||0x320;_0x156f65[_0x08f3('0x152')]=_0x1adf27[_0x08f3('0x153')]||0x1388;_0x156f65[_0x08f3('0x154')]=_0x1adf27[_0x08f3('0x155')]||0x64;_0x156f65[_0x08f3('0x156')]=_0x1adf27[_0x08f3('0x157')]||0x32;_0x156f65[_0x08f3('0x158')]=_0x1adf27[_0x08f3('0x159')]||0x3;_0x156f65[_0x08f3('0x15a')]=_0x1adf27[_0x08f3('0x15b')]||0x100;_0x156f65[_0x08f3('0x15c')]=_0x1adf27[_0x08f3('0x15d')]||0x1388;}if(_0x1adf27[_0x08f3('0x50')]===_0x08f3('0x8b')){_0x156f65[_0x08f3('0x15e')]=_0x3a6e68[_0x08f3('0xca')];}else{_0x156f65[_0x08f3('0x15f')]=_0x3a6e68['CampaignId'];}for(var _0x7c2fc7 in _0x3a6e68[_0x08f3('0x160')]){if(_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x93')](_0x7c2fc7)){if(isNotNull(_0x3a6e68['Contact'][_0x7c2fc7])&&_0x7c2fc7!=='id'&&_0x7c2fc7!==_0x08f3('0x161')&&_0x7c2fc7!==_0x08f3('0x162')&&_0x7c2fc7!==_0x08f3('0x163')){_0x156f65[util[_0x08f3('0x70')](_0x08f3('0x164'),_0x08f3('0x165'),_['toUpper'](_0x7c2fc7))]=_0x3a6e68[_0x08f3('0x160')][_0x7c2fc7];}}}var _0xd54f06=_0x6a89c2['isTrunkReachable'](_0x1adf27[_0x08f3('0x6c')])?getCallerId(_0x1adf27[_0x08f3('0x6c')][_0x08f3('0x6e')],_0x1adf27[_0x08f3('0x56')],_0x1adf27[_0x08f3('0x166')]>0x0?getCallerIdRandom(_0x1adf27[_0x08f3('0x57')],_0x1adf27['dialRandomLastDigitCallerIdNumber']):_0x1adf27[_0x08f3('0x57')]):getCallerId(_[_0x08f3('0xa8')](_0x1adf27[_0x08f3('0x11a')])?_0x1adf27['Trunk'][_0x08f3('0x6e')]:_0x1adf27[_0x08f3('0x11a')]['callerid'],_0x1adf27[_0x08f3('0x56')],_0x1adf27[_0x08f3('0x166')]>0x0?getCallerIdRandom(_0x1adf27[_0x08f3('0x57')],_0x1adf27[_0x08f3('0x166')]):_0x1adf27[_0x08f3('0x57')]);if(_0xd54f06){_0x156f65[_0x08f3('0x167')]=_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x168')]=extractCalleridName(_0xd54f06);_0x156f65[_0x08f3('0x169')]=_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x16a')]=extractCalleridNumber(_0xd54f06);}return ami[_0x08f3('0xa9')]({'actionid':_0x1102e5,'action':'originate','channel':_0x6a89c2[_0x08f3('0xce')](_0x1adf27[_0x08f3('0x6c')])?util[_0x08f3('0x70')]('SIP/%s/%s%s',_0x1adf27['Trunk'][_0x08f3('0x3a')],isNotNull(_0x1adf27[_0x08f3('0x16b')])?_0x1adf27['dialPrefix']['trim']()||'':'',_0x1adf27[_0x08f3('0x16c')]>0x0?_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')][_0x08f3('0x16d')](_0x1adf27[_0x08f3('0x16c')]):_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')]):util[_0x08f3('0x70')](_0x08f3('0x16e'),_[_0x08f3('0xa8')](_0x1adf27[_0x08f3('0x11a')])?_0x1adf27[_0x08f3('0x6c')][_0x08f3('0x3a')]:_0x1adf27[_0x08f3('0x11a')][_0x08f3('0x3a')],isNotNull(_0x1adf27[_0x08f3('0x16b')])?_0x1adf27['dialPrefix']['trim']()||'':'',_0x1adf27[_0x08f3('0x16c')]>0x0?_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')][_0x08f3('0x16d')](_0x1adf27['dialCutDigit']):_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')]),'callerid':_0xd54f06,'Exten':_0x08f3('0xd8'),'Context':'from-sip','Priority':'1','variable':_0x156f65,'timeout':(_0x1adf27[_0x08f3('0x16f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1102e5})[_0x08f3('0xaf')](function(_0x1dba9b){return _0x5741db(_0x1dba9b);})['catch'](function(_0x2ea19a){_0x1adf27['outboundOriginateFailureCallsDay']+=0x1;var _0xa183d9=new History(_0x6a89c2[_0x08f3('0x22')][_0x1102e5]);logger[_0x08f3('0x90')](util[_0x08f3('0x70')](_0x08f3('0x170'),JSON[_0x08f3('0x44')](_0x2ea19a)));_0xa183d9[_0x08f3('0xa0')]=0xe;_0xa183d9['statedesc']='OriginateError';_0xa183d9[_0x08f3('0xa3')]=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));_0xa183d9[_0x08f3('0xa2')]=_0xa183d9[_0x08f3('0xa3')];_0x6a89c2[_0x08f3('0xbe')](_0xa183d9)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x171')));_0x6a89c2[_0x08f3('0xbc')](_0xa183d9)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x171')))[_0x08f3('0x1a')](function(){delete _0x6a89c2[_0x08f3('0x22')][_0x1102e5];return _0x55a9a3(msgResponse('originate','Error',_0x08f3('0x172')));});});});};Dialer[_0x08f3('0xa4')][_0x08f3('0x173')]=function(_0x2d08ec){var _0x455b00=this['actions'][_0x2d08ec[_0x08f3('0x103')]];var _0x13af73=this;if(_0x455b00){delete this[_0x08f3('0x22')][_0x2d08ec[_0x08f3('0x103')]];_0x455b00[_0x08f3('0xf9')]=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));var _0x2db6c9=_0x455b00[_0x08f3('0x50')]===_0x08f3('0x73')?this[_0x08f3('0x1e')][_0x455b00[_0x08f3('0xad')]]:this[_0x08f3('0x1d')][_0x455b00[_0x08f3('0x174')]()];if(!this[_0x08f3('0x175')](_0x2d08ec[_0x08f3('0x176')])){this[_0x08f3('0xac')](_0x2db6c9);return this['callProgressDetecting'](_0x455b00,_0x2db6c9,_0x2d08ec)['then'](function(_0x2c277f){})[_0x08f3('0xab')](loggerCatch(_0x08f3('0x177')));}else{this[_0x08f3('0x24')][_0x2d08ec[_0x08f3('0xd4')]]=_0x455b00;}}};Dialer[_0x08f3('0xa4')][_0x08f3('0x178')]=function(_0xa6f1bb,_0x39f406,_0x170908){var _0x74c593=new History(_0x39f406);if(_0x74c593['countbusyretry']+_0x74c593[_0x08f3('0x179')]+_0x74c593[_0x08f3('0x17a')]>=_0x170908[_0x08f3('0x17b')]-0x1){return!![];}switch(_0xa6f1bb){case 0x3:if(_0x74c593[_0x08f3('0x17a')]>=_0x170908[_0x08f3('0x17c')]-0x1){return!![];}else{this[_0x08f3('0x116')]({'active':![],'countnoanswerretry':_0x74c593['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x08f3('0x17d')](_0x170908[_0x08f3('0x17e')],_0x08f3('0x17f'))[_0x08f3('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x74c593[_0x08f3('0xc7')],'ListId':_0x74c593[_0x08f3('0xc8')],'VoiceQueueId':_0x74c593['VoiceQueueId']||undefined,'CampaignId':_0x74c593[_0x08f3('0xcb')]||undefined})[_0x08f3('0xab')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x74c593[_0x08f3('0x180')]>=_0x170908[_0x08f3('0x181')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x74c593[_0x08f3('0x180')]+=0x1,'scheduledat':moment()[_0x08f3('0x17d')](_0x170908[_0x08f3('0x182')],_0x08f3('0x17f'))[_0x08f3('0x70')](_0x08f3('0xf4')),'ContactId':_0x74c593[_0x08f3('0xc7')],'ListId':_0x74c593[_0x08f3('0xc8')],'VoiceQueueId':_0x74c593[_0x08f3('0xca')]||undefined,'CampaignId':_0x74c593['CampaignId']||undefined})[_0x08f3('0xab')](loggerCatch(_0x08f3('0x183')));}break;case 0x8:if(_0x74c593[_0x08f3('0x179')]>=_0x170908[_0x08f3('0x184')]-0x1){return!![];}else{this[_0x08f3('0x116')]({'active':![],'countcongestionretry':_0x74c593[_0x08f3('0x179')]+=0x1,'scheduledat':moment()['add'](_0x170908['dialCongestionRetryFrequency'],_0x08f3('0x17f'))[_0x08f3('0x70')](_0x08f3('0xf4')),'ContactId':_0x74c593[_0x08f3('0xc7')],'ListId':_0x74c593[_0x08f3('0xc8')],'VoiceQueueId':_0x74c593[_0x08f3('0xca')]||undefined,'CampaignId':_0x74c593[_0x08f3('0xcb')]||undefined})[_0x08f3('0xab')](loggerCatch(_0x08f3('0x185')));}break;default:return!![];}};Dialer[_0x08f3('0xa4')][_0x08f3('0x186')]=function(_0x35f6cb,_0x5bdddd,_0x485098){var _0x538c4d=this;var _0x2ee5f4=new History(_0x35f6cb);return new BPromise(function(_0x36c890,_0x33b627){if(_[_0x08f3('0x80')](_0x5bdddd)&&'object'!==typeof _0x5bdddd){return _0x33b627(msgResponse(_0x08f3('0x187'),_0x08f3('0x11f'),_0x08f3('0x188')));}if(_['isUndefined'](_0x485098)&&_0x08f3('0x147')!==typeof _0x485098){return _0x33b627(msgResponse(_0x08f3('0x187'),_0x08f3('0x11f'),_0x08f3('0x189')));}switch(_0x485098['reason']){case'0':_0x5bdddd[_0x08f3('0x5d')]+=0x1;_0x2ee5f4['state']=0x0;_0x2ee5f4['statedesc']=_0x08f3('0x18a');_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x18b')));if(_0x538c4d[_0x08f3('0x178')](0x0,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x180')]+_0x2ee5f4['countcongestionretry']+_0x2ee5f4[_0x08f3('0x17a')]>=_0x5bdddd[_0x08f3('0x17b')]){_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x18d'));}else{_0x538c4d['createStateFinal'](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x18d'));}}break;case'3':_0x5bdddd['outboundNoAnswerCallsDay']+=0x1;_0x2ee5f4[_0x08f3('0xa0')]=0x3;_0x2ee5f4[_0x08f3('0xa1')]=_0x08f3('0x18e');_0x2ee5f4[_0x08f3('0x17a')]+=0x1;_0x2ee5f4['countglobal']+=0x1;_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x18f')));if(_0x538c4d['checkRetriveMax'](0x3,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x17a')]>=_0x5bdddd[_0x08f3('0x17c')]){_0x538c4d[_0x08f3('0x190')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x191'));}else{_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x191'));}}break;case'5':_0x5bdddd[_0x08f3('0x192')]+=0x1;_0x2ee5f4[_0x08f3('0xa0')]=0x5;_0x2ee5f4[_0x08f3('0xa1')]=_0x08f3('0x193');_0x2ee5f4[_0x08f3('0x180')]+=0x1;_0x2ee5f4[_0x08f3('0x194')]+=0x1;_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x538c4d['checkRetriveMax'](0x5,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x180')]>=_0x5bdddd[_0x08f3('0x181')]){_0x538c4d[_0x08f3('0x190')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x195'));}else{_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x195'));}}break;case'8':_0x5bdddd[_0x08f3('0x59')]+=0x1;_0x2ee5f4[_0x08f3('0xa0')]=0x8;_0x2ee5f4[_0x08f3('0xa1')]=_0x08f3('0x196');_0x2ee5f4[_0x08f3('0x179')]+=0x1;_0x2ee5f4[_0x08f3('0x194')]+=0x1;_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x197')));if(_0x538c4d[_0x08f3('0x178')](0x8,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4['countcongestionretry']>=_0x5bdddd[_0x08f3('0x184')]){_0x538c4d[_0x08f3('0x190')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x198'));}else{_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x198'));}}break;default:_0x5bdddd[_0x08f3('0x61')]+=0x1;_0x2ee5f4['state']=0xc;_0x2ee5f4[_0x08f3('0xa1')]=_0x485098[_0x08f3('0xf0')];_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x199')));if(_0x538c4d['checkRetriveMax'](_0x485098['reason'],_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x180')]+_0x2ee5f4[_0x08f3('0x179')]+_0x2ee5f4['countnoanswerretry']>=_0x5bdddd[_0x08f3('0x17b')]){_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x485098[_0x08f3('0xf0')]);}else{_0x538c4d['createStateFinal'](_0x2ee5f4,_0x36c890,_0x33b627,_0x485098['reason']);}}}});};Dialer['prototype'][_0x08f3('0x18c')]=function(_0x5ec6d0,_0x2132fc,_0x4b8c2d,_0x80c025){var _0x220ccf=new Final(_0x5ec6d0);_0x220ccf[_0x08f3('0xa0')]=0xf;_0x220ccf[_0x08f3('0xa1')]=_0x08f3('0x19a');this[_0x08f3('0x190')](_0x220ccf,_0x2132fc,_0x4b8c2d,_0x80c025);};Dialer[_0x08f3('0xa4')][_0x08f3('0x190')]=function(_0x13a2b7,_0x51aef8,_0x37bf26,_0x1ef413){this[_0x08f3('0xbc')](_0x13a2b7)[_0x08f3('0xaf')](function(_0x149a22){return _0x51aef8(msgResponse(_0x08f3('0x187'),_0x08f3('0xcd'),_0x1ef413));})['catch'](function(_0x4c3fe5){return _0x37bf26(msgResponse(_0x08f3('0x19b'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x08f3('0xa4')][_0x08f3('0x137')]=function(_0x5ecf40){var _0x2f4497=this;var _0x5328c2=_0x5ecf40['dialPredictiveOptimizationPercentage']/0x64;var _0x313d98=_0x5ecf40[_0x08f3('0x5c')]/(_0x5ecf40[_0x08f3('0x5c')]+_0x5ecf40[_0x08f3('0x58')]);var _0x5f5770=Math[_0x08f3('0x19c')](_0x5ecf40[_0x08f3('0x19d')]*(_0x5ecf40[_0x08f3('0x19e')]/0x64));var _0x1d511b=Math[_0x08f3('0x19c')](_0x5ecf40[_0x08f3('0x19d')]*(_0x5ecf40['predictiveIntervalMinThreshold']/0x64));var _0x500f68=_0x5ecf40[_0x08f3('0x49')]+_0x5ecf40['talking'];var _0x1cc0a1=Math[_0x08f3('0x19f')](_0x5ecf40[_0x08f3('0x83')]*_0x5ecf40[_0x08f3('0x85')]*_0x5ecf40[_0x08f3('0x66')]*_0x5ecf40[_0x08f3('0x67')]);if(_[_0x08f3('0x80')](_0x5ecf40[_0x08f3('0x27')])){if(!_[_0x08f3('0x80')](_0x5ecf40[_0x08f3('0x26')])){_0x5ecf40[_0x08f3('0x26')]=undefined;loggerPredictive[_0x08f3('0x90')](_0x08f3('0x1a0'),_0x08f3('0x1a1'));}if(!_['isUndefined'](_0x5ecf40[_0x08f3('0x89')])){loggerPredictive[_0x08f3('0x90')](_0x08f3('0x1a0'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5ecf40[_0x08f3('0x89')]);_0x5ecf40[_0x08f3('0x89')]=undefined;}_0x5ecf40[_0x08f3('0x27')]=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1a2'),_0x5ecf40[_0x08f3('0x27')]);this[_0x08f3('0x136')](_0x5ecf40,0x1);}else if(ifInterval(_0x5ecf40[_0x08f3('0x1a3')],_0x5ecf40[_0x08f3('0x27')])){this[_0x08f3('0x136')](_0x5ecf40,0x1);loggerPredictiveCalls[_0x08f3('0x77')](_0x08f3('0x1a4'),_0x5ecf40['startProgressive'],_0x5ecf40[_0x08f3('0x3a')]);_0x5ecf40[_0x08f3('0x83')]=0x0;_0x5ecf40[_0x08f3('0x1a5')]=0x0;}else if(_0x5328c2<_0x313d98&&_0x5ecf40[_0x08f3('0x1a6')]===_0x08f3('0x1a7')){freeVariablesPredictive(_0x5ecf40);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1a8'),'Dropped\x20calls\x20day',_0x313d98,_0x08f3('0x27'),_0x5ecf40[_0x08f3('0x3a')]);}else if(_0x1cc0a1<_0x5ecf40[_0x08f3('0x1a5')]&&_0x5ecf40[_0x08f3('0x1a6')]===_0x08f3('0x1a7')){freeVariablesPredictive(_0x5ecf40);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x08f3('0x1a9'),_0x1cc0a1,_0x08f3('0x1aa'),_0x5ecf40[_0x08f3('0x1a5')],'startProgressive',_0x5ecf40[_0x08f3('0x3a')]);}else if(!ifInterval(_0x5ecf40[_0x08f3('0x1a3')],_0x5ecf40['startProgressive'])&&_['isUndefined'](_0x5ecf40[_0x08f3('0x26')])&&!_['isUndefined'](_0x5ecf40[_0x08f3('0x27')])){_0x5ecf40[_0x08f3('0x26')]=moment()[_0x08f3('0x70')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1ab'),_0x5ecf40['startPredictive']);this[_0x08f3('0xb5')](_0x5ecf40[_0x08f3('0x1a3')])[_0x08f3('0xaf')](this[_0x08f3('0x1ac')](_0x5ecf40))[_0x08f3('0xaf')](mergeDataErlangB(_0x5ecf40))[_0x08f3('0xaf')](this[_0x08f3('0x1ad')](_0x5ecf40))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5ecf40));}else if(!ifInterval(_0x5ecf40[_0x08f3('0x1a3')],_0x5ecf40[_0x08f3('0x26')])){_0x5ecf40[_0x08f3('0x1a5')]=0x0;_0x5ecf40['startPredictive']=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1ae'),_0x5ecf40['startPredictive']);clearInterval(_0x5ecf40['handlePredictive']);_0x5ecf40[_0x08f3('0x89')]=undefined;this[_0x08f3('0xb5')](_0x5ecf40[_0x08f3('0x1a3')])[_0x08f3('0xaf')](this[_0x08f3('0x1ac')](_0x5ecf40))[_0x08f3('0xaf')](mergeDataErlangB(_0x5ecf40))['then'](this[_0x08f3('0x1ad')](_0x5ecf40))[_0x08f3('0xab')](loggerCatchPredictive(_0x08f3('0x1af'),_0x5ecf40));}else if(_0x5ecf40['predictiveIntervalAvailable']&&_0x500f68<_0x5ecf40[_0x08f3('0x19d')]-_0x1d511b){freeVariablesPredictive(_0x5ecf40);loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1b0'),_0x500f68,_0x08f3('0x1b1'),_0x5ecf40[_0x08f3('0x19d')],'-',_0x1d511b,'=',_0x5ecf40[_0x08f3('0x19d')]-_0x1d511b,')');}else if(_0x5ecf40[_0x08f3('0x19d')]&&_0x500f68>_0x5ecf40['predictiveIntervalAvailable']+_0x5f5770){freeVariablesPredictive(_0x5ecf40);loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1b0'),_0x500f68,_0x08f3('0x1b2'),_0x5ecf40[_0x08f3('0x19d')],'+',_0x5f5770,'=',_0x5ecf40[_0x08f3('0x19d')]+_0x5f5770,')');}};Dialer[_0x08f3('0xa4')][_0x08f3('0x1ac')]=function(_0x2b9c3a){var _0x1ccee7=this;return function(_0x4e7a07){return new BPromise(function(_0x1840fd,_0x2e0735){_[_0x08f3('0x86')](_0x2b9c3a,_0x4e7a07[0x0]);if(checkGetDataPredictive(_0x4e7a07[0x0])){var _0x453477=_0x2b9c3a[_0x08f3('0x19d')]=_0x2b9c3a['talking']+_0x2b9c3a['available'];var _0xba41a0=_0x2b9c3a[_0x08f3('0x1a3')]*0x3c;var _0x526d95=_0x4e7a07[0x0][_0x08f3('0x7e')]+_0x4e7a07[0x0][_0x08f3('0x7d')];var _0x320cad=(_0x4e7a07[0x0][_0x08f3('0x62')]+_0x4e7a07[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4e7a07[0x0][_0x08f3('0x63')])/_0x4e7a07[0x0][_0x08f3('0x69')];_0x2b9c3a[_0x08f3('0x66')]=_0x320cad>0x0?_0x320cad:0x1;switch(_0x2b9c3a[_0x08f3('0x1a6')]){case _0x08f3('0x1a7'):var _0x117053=_0x2b9c3a[_0x08f3('0x1b3')]/0x64;return _0x1ccee7[_0x08f3('0x1b4')](_0x453477,_0xba41a0,_0x526d95,_0x320cad,_0x117053)[_0x08f3('0xaf')](function(_0x2ec387){return _0x1840fd(_0x2ec387);});case _0x08f3('0x1b5'):var _0x196ad6=_0x2b9c3a[_0x08f3('0x1b3')]/0x64;return _0x1ccee7[_0x08f3('0x1b6')](_0x453477,_0xba41a0,_0x526d95,_0x320cad,_0x196ad6)['then'](function(_0x20aae5){return _0x1840fd(_0x20aae5);});default:return _0x2e0735(msgResponse('[getDataPredictive]',_0x08f3('0x11f'),_0x08f3('0x1b7')));}}else{return _0x2e0735(msgResponse(_0x08f3('0x1b8'),_0x08f3('0x11f'),_0x08f3('0x1b9')));}});};};Dialer[_0x08f3('0xa4')][_0x08f3('0x1ba')]=function(_0x2b9efb){var _0x2bbab8=this;return function(_0x100fb4){return new BPromise(function(_0xa5acc,_0x4549d5){_['merge'](_0x2b9efb,_0x100fb4[0x0]);if(checkGetDataPredictive(_0x100fb4[0x0])){loggerPredictive[_0x08f3('0x77')](JSON[_0x08f3('0x44')](_0x100fb4[0x0]));if(_0x2b9efb[_0x08f3('0x1a6')]==='dropRate'){return _0x2bbab8[_0x08f3('0xba')](_0x2b9efb['id'])[_0x08f3('0xaf')](function(_0x7c7f49){var _0x1e5a44=_0x2b9efb['loggedIn']-_0x7c7f49[0x0][_0x08f3('0x1bb')];var _0x518cad=_0x2b9efb[_0x08f3('0x1a3')]*0x3c;var _0x2ee7d2=_0x100fb4[0x0]['predictiveIntervalAvgTalktime']+_0x100fb4[0x0]['predictiveIntervalAvgHoldtime'];var _0x28e906=(_0x100fb4[0x0][_0x08f3('0x62')]+_0x100fb4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x100fb4[0x0][_0x08f3('0x63')])/_0x100fb4[0x0]['predictiveIntervalTotalCalls'];var _0xa6ce12=_0x2b9efb[_0x08f3('0x1b3')]/0x64;_0x2b9efb[_0x08f3('0x68')]=_0x7c7f49[0x0][_0x08f3('0x1bb')]||0x0;_0x2b9efb[_0x08f3('0x66')]=_0x28e906>0x0?_0x28e906:0x1;return _0x2bbab8[_0x08f3('0x1b4')](_0x1e5a44,_0x518cad,_0x2ee7d2,_0x28e906,_0xa6ce12);})[_0x08f3('0xaf')](function(_0x8d410c){return _0xa5acc(_0x8d410c);})[_0x08f3('0xab')](function(_0x4e2c92){return _0x4549d5(msgResponse(_0x08f3('0x1bc'),'Failure',JSON[_0x08f3('0x44')](_0x4e2c92)));});}if(_0x2b9efb[_0x08f3('0x1a6')]===_0x08f3('0x1b5')){return _0x2bbab8[_0x08f3('0xba')](_0x2b9efb['id'])['then'](function(_0x262f74){var _0x3733ee=_0x2b9efb['loggedIn']-_0x262f74[0x0][_0x08f3('0x1bb')];var _0x2142d4=_0x2b9efb[_0x08f3('0x1a3')]*0x3c;var _0x3adb1e=_0x100fb4[0x0]['predictiveIntervalAvgTalktime']+_0x100fb4[0x0][_0x08f3('0x7d')];var _0xf6d9c4=(_0x100fb4[0x0][_0x08f3('0x62')]+_0x100fb4[0x0][_0x08f3('0x64')]+_0x100fb4[0x0][_0x08f3('0x63')])/_0x100fb4[0x0][_0x08f3('0x69')];var _0x380d90=_0x2b9efb[_0x08f3('0x1b3')]/0x64;_0x2b9efb[_0x08f3('0x68')]=_0x262f74[0x0][_0x08f3('0x1bb')]||0x0;_0x2b9efb[_0x08f3('0x66')]=_0xf6d9c4>0x0?_0xf6d9c4:0x1;return _0x2bbab8['busyFactor'](_0x3733ee,_0x2142d4,_0x3adb1e,_0xf6d9c4,_0x380d90);})[_0x08f3('0xaf')](function(_0x260456){return _0xa5acc(_0x260456);})[_0x08f3('0xab')](function(_0x426e02){return _0x4549d5(msgResponse(_0x08f3('0x1bc'),_0x08f3('0x11f'),JSON['stringify'](_0x426e02)));});}}else{return _0x4549d5(msgResponse(_0x08f3('0x1b8'),_0x08f3('0x11f'),_0x08f3('0x1b9')));}});};};Dialer[_0x08f3('0xa4')]['startMethodPredictive']=function(_0x307d28){var _0x1e0eb4=this;return function(){var _0x519603=0x0;var _0x14344d=Math[_0x08f3('0x19f')](_0x307d28[_0x08f3('0x6a')]*0x3e8);if(_0x14344d>0x0){_0x14344d=_0x14344d<0x64?0x64:_0x14344d;loggerPredictive['info'](_0x307d28[_0x08f3('0x3a')],_0x08f3('0x1bd'),_0x14344d,'milliseconds');_0x307d28[_0x08f3('0x89')]=setInterval(function(){_0x1e0eb4[_0x08f3('0x89')](_0x307d28);loggerPredictiveCalls['info'](_0x08f3('0x1be'),_0x519603+=0x1);},_0x14344d);}else{loggerPredictive[_0x08f3('0x77')](_0x307d28[_0x08f3('0x3a')],_0x08f3('0x1bf'));}};};Dialer[_0x08f3('0xa4')][_0x08f3('0x1c0')]=function(_0x323c1f,_0x553962){var _0x5abe59=this;return function(_0x6095e8){if(_[_0x08f3('0x8d')](_0x6095e8)){if(_[_0x08f3('0xa8')](_0x553962[_0x08f3('0xc9')])||!_0x553962[_0x08f3('0x1c1')]){if(_0x323c1f[_0x08f3('0x55')]===_0x08f3('0x138')){_0x323c1f[_0x08f3('0x106')]=_[_0x08f3('0x80')](_0x323c1f[_0x08f3('0x106')])?!![]:_0x323c1f[_0x08f3('0x106')];var _0x25ce0f=uuid['v4']();_0x5abe59[_0x08f3('0x22')][_0x25ce0f]=new Action(_0x323c1f,_0x553962,_0x25ce0f);loggerBooked['info'](_0x08f3('0x1c2'),_0x25ce0f,_0x08f3('0x1c3'),JSON[_0x08f3('0x44')](_0x323c1f[_0x08f3('0x106')]),_0x08f3('0x1c4'),_0x323c1f['name']);if(_0x323c1f['queueStatusComplete']){_0x323c1f[_0x08f3('0x106')]=![];_0x5abe59[_0x08f3('0x104')][_0x5abe59['actions'][_0x25ce0f]['queue']]=[];ami[_0x08f3('0xa9')]({'actionid':_0x25ce0f,'action':_0x08f3('0x1c5'),'queue':_0x323c1f[_0x08f3('0x3a')]})[_0x08f3('0xab')](function(_0x269aed){_0x5abe59[_0x08f3('0xac')](_0x323c1f);_0x5abe59[_0x08f3('0x116')]({'active':![],'ContactId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f]['ContactId'],'ListId':_0x5abe59['actions'][_0x25ce0f]['ListId'],'VoiceQueueId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xca')]||undefined,'CampaignId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xcb')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5abe59[_0x08f3('0x22')][_0x25ce0f];});}else{loggerBooked[_0x08f3('0x77')](_0x08f3('0x1c6'),JSON['stringify'](_0x323c1f['queueStatusComplete']),_0x08f3('0x1c4'),_0x323c1f[_0x08f3('0x3a')]);_0x5abe59[_0x08f3('0xac')](_0x323c1f);_0x5abe59[_0x08f3('0x116')]({'active':![],'ContactId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xc7')],'ListId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xc8')],'VoiceQueueId':_0x5abe59['actions'][_0x25ce0f]['VoiceQueueId']||undefined,'CampaignId':_0x5abe59['actions'][_0x25ce0f][_0x08f3('0xcb')]||undefined})['catch'](loggerCatch(_0x08f3('0x1c7')));delete _0x5abe59['actions'][_0x25ce0f];}}else{return _0x5abe59[_0x08f3('0x1c8')](_0x323c1f,_0x553962);}}else{if(getDiff(_0x553962[_0x08f3('0x1c9')])<_0x323c1f[_0x08f3('0x1ca')]*0x3c){_0x5abe59['preview'][_0x08f3('0x109')](_0x553962['id'])[_0x08f3('0x1a')](function(){_0x5abe59[_0x08f3('0xac')](_0x323c1f);});}else{_0x323c1f[_0x08f3('0x5f')]+=0x1;_0x5abe59['updateOriginated'](_0x323c1f);if(_0x323c1f[_0x08f3('0x1cb')]){_0x5abe59[_0x08f3('0x116')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x553962[_0x08f3('0xc7')],'ListId':_0x553962[_0x08f3('0xc8')],'VoiceQueueId':_0x553962['VoiceQueueId']||undefined,'CampaignId':_0x553962['CampaignId']||undefined})[_0x08f3('0xab')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5abe59[_0x08f3('0xbe')](createObjHistory(_0x323c1f,_0x553962,_0x08f3('0x1cc'),0x17,_0x08f3('0x1cd')))[_0x08f3('0xab')](loggerCatch(_0x08f3('0x1ce')));}else{_0x5abe59[_0x08f3('0xc5')](createObjHistory(_0x323c1f,_0x553962,_0x08f3('0x1cf'),0x16,'RecallFailedTimeout'),_0x08f3('0x1d0'),_0x08f3('0x1d1'));}}}}else{_0x323c1f[_0x08f3('0x1d2')]+=0x1;_0x5abe59[_0x08f3('0xc5')](createObjHistory(_0x323c1f,_0x553962,_0x08f3('0x1d3'),0xd,_0x08f3('0x1d4')),_0x08f3('0x1d5'),_0x08f3('0x1d6'));throw _0x08f3('0x1d7');}};};Dialer[_0x08f3('0xa4')][_0x08f3('0x13b')]=function(_0x54bf32){var _0x34590a=this;var _0x2b402a=[];var _0x2c0d06=_0x54bf32[_0x08f3('0x1d8')]-_0x54bf32['originated']-_0x54bf32[_0x08f3('0x1d9')];emitCampaignSummary(_0x54bf32);if(_0x2c0d06>0x0){if(_0x2c0d06>this[_0x08f3('0x21')]){_0x2c0d06=this[_0x08f3('0x21')];}_0x54bf32[_0x08f3('0x1d9')]+=_0x2c0d06;this[_0x08f3('0xb9')](_0x54bf32['id'],_0x2c0d06,_0x54bf32[_0x08f3('0x1da')])[_0x08f3('0xaf')](function(_0x5c1cae){_0x54bf32[_0x08f3('0x1d9')]-=_0x2c0d06;_0x54bf32[_0x08f3('0x1d9')]=_0x54bf32[_0x08f3('0x1d9')]>0x0?_0x54bf32[_0x08f3('0x1d9')]:0x0;if(!checkContactEmpty(_0x5c1cae)){_0x54bf32[_0x08f3('0x38')]=_0x08f3('0x1db');logger[_0x08f3('0x77')](_0x08f3('0x1dc')+_0x54bf32[_0x08f3('0x3a')]);}else{_0x54bf32[_0x08f3('0xc0')]+=_0x5c1cae[_0x08f3('0x92')];_0x54bf32[_0x08f3('0x38')]='RUNNING';for(var _0x438cf4=0x0;_0x438cf4<_0x5c1cae['length'];_0x438cf4+=0x1){_0x54bf32[_0x08f3('0x1dd')]+=0x1;if(_[_0x08f3('0xa8')](_0x5c1cae[_0x438cf4])||_[_0x08f3('0xa8')](_0x5c1cae[_0x438cf4][_0x08f3('0x160')])||_[_0x08f3('0xa8')](_0x5c1cae[_0x438cf4][_0x08f3('0x160')][_0x08f3('0x148')])){_0x34590a[_0x08f3('0xc3')](_0x08f3('0x1de'),_0x54bf32,_0x5c1cae[_0x438cf4]);}else{_0x34590a['checkIsBlackListIvr'](_[_0x08f3('0xc6')](_0x5c1cae[_0x438cf4],['CampaignId',_0x08f3('0x1df')]))['then'](_0x34590a[_0x08f3('0x1c0')](_0x54bf32,_0x5c1cae[_0x438cf4]))[_0x08f3('0xab')](_0x34590a[_0x08f3('0xc2')](_0x08f3('0x1e0'),_0x54bf32));}}}})['catch'](loggerGetContactDialer(_0x08f3('0x1e1'),_0x54bf32,_0x2c0d06));}};Dialer['prototype'][_0x08f3('0x136')]=function(_0x5e909a,_0x2827dc){var _0x997937=this;var _0xed0f23=[];var _0x5ca710=_0x2827dc>=0x1?_0x2827dc:0x1;var _0x36274c=[];if(_0x5e909a[_0x08f3('0x55')]===_0x08f3('0x138')){_0x5ca710=0x1;}var _0x3757a1=Math['floor'](_0x5e909a[_0x08f3('0x49')]*_0x5ca710)-_0x5e909a['originated']-_0x5e909a['temp'];emitVoiceQueueSummary(_0x5e909a);if(_0x5e909a[_0x08f3('0x1e2')]>0x0){var _0x4746ef=_0x5e909a[_0x08f3('0x1e2')]-_0x5e909a[_0x08f3('0xc0')]-_0x5e909a[_0x08f3('0x4e')]-_0x5e909a[_0x08f3('0x1d9')]-_0x5e909a[_0x08f3('0x4b')];if(_0x3757a1>_0x4746ef){_0x3757a1=_0x4746ef;}}if(_0x3757a1>0x0){if(_0x5e909a[_0x08f3('0x55')]===_0x08f3('0x138')){_0x3757a1=0x1;}if(_0x3757a1>this[_0x08f3('0x21')]){_0x3757a1=this[_0x08f3('0x21')];}_0x5e909a['temp']+=_0x3757a1;for(var _0x1aba30 in this['agents']){if(this[_0x08f3('0x1f')][_0x08f3('0x93')](_0x1aba30)){if(this['agents'][_0x1aba30][_0x08f3('0xa0')]==='not_inuse'&&this[_0x08f3('0x1f')][_0x1aba30][_0x08f3('0xd0')]==='reachable'){_0xed0f23[_0x08f3('0x105')](this[_0x08f3('0x1f')][_0x1aba30]['id']);}}}this[_0x08f3('0xb7')](_0x5e909a['id'],_0xed0f23,_0x3757a1,_0x5e909a[_0x08f3('0x1da')])[_0x08f3('0xaf')](function(_0x3addd1){_0x5e909a[_0x08f3('0x1d9')]-=_0x3757a1;_0x5e909a['temp']=_0x5e909a[_0x08f3('0x1d9')]>0x0?_0x5e909a[_0x08f3('0x1d9')]:0x0;if(!checkContactEmpty(_0x3addd1)){_0x997937[_0x08f3('0xb0')](_0x5e909a)[_0x08f3('0xaf')](sendMessageReschedule(_0x5e909a))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb1')));}else{_0x5e909a[_0x08f3('0xc0')]+=_0x3addd1[_0x08f3('0x92')];_0x5e909a[_0x08f3('0x38')]=_0x5e909a[_0x08f3('0x55')]===_0x08f3('0x138')?'ACTIVE':_0x08f3('0x1e3');for(var _0xa34851=0x0;_0xa34851<_0x3addd1[_0x08f3('0x92')];_0xa34851+=0x1){if(_[_0x08f3('0xa8')](_0x3addd1[_0xa34851])||_[_0x08f3('0xa8')](_0x3addd1[_0xa34851][_0x08f3('0x160')])||_[_0x08f3('0xa8')](_0x3addd1[_0xa34851][_0x08f3('0x160')][_0x08f3('0x148')])){_0x997937[_0x08f3('0xc3')]('[actionOriginate]\x20',_0x5e909a,_0x3addd1[_0xa34851]);}else{_0x997937[_0x08f3('0xb2')](_[_0x08f3('0xc6')](_0x3addd1[_0xa34851],[_0x08f3('0xca'),_0x08f3('0x1df')]))[_0x08f3('0xaf')](_0x997937[_0x08f3('0x1c0')](_0x5e909a,_0x3addd1[_0xa34851]))[_0x08f3('0xab')](_0x997937[_0x08f3('0xc2')](_0x08f3('0x1de'),_0x5e909a));}}}})[_0x08f3('0xab')](loggerGetContactDialer(_0x08f3('0x1e4'),_0x5e909a,_0x3757a1));}};Dialer[_0x08f3('0xa4')][_0x08f3('0x89')]=function(_0x3e182f){var _0x245593=this;if(_0x3e182f[_0x08f3('0x1e2')]>0x0){var _0x172bf9=_0x3e182f[_0x08f3('0x1e2')]-_0x3e182f[_0x08f3('0xc0')]-_0x3e182f[_0x08f3('0x4e')];if(_0x172bf9>0x0){this[_0x08f3('0x1e5')](_0x3e182f);}else{loggerPredictiveCalls[_0x08f3('0x77')]('[handlePredictive][limitChannel]');}}else{this[_0x08f3('0x1e5')](_0x3e182f);}};Dialer[_0x08f3('0xa4')]['tryOriginatePredictive']=function(_0x3b923c){var _0x204555=this;var _0x428296=[];_0x3b923c['originated']+=0x1;for(var _0x3279d0 in this[_0x08f3('0x1f')]){if(this[_0x08f3('0x1f')]['hasOwnProperty'](_0x3279d0)){if(this[_0x08f3('0x1f')][_0x3279d0][_0x08f3('0xa0')]===_0x08f3('0x1e6')&&this[_0x08f3('0x1f')][_0x3279d0]['status']===_0x08f3('0xd1')){_0x428296['push'](this['agents'][_0x3279d0]['id']);}}}this[_0x08f3('0xb7')](_0x3b923c['id'],_0x428296,0x1,_0x3b923c[_0x08f3('0x1da')])[_0x08f3('0xaf')](function(_0x287bd5){if(!checkContactEmpty(_0x287bd5)){checkContactLowerLimitOriginate(_0x3b923c,0x1,0x0);_0x204555[_0x08f3('0xb0')](_0x3b923c)[_0x08f3('0xaf')](sendMessageReschedule(_0x3b923c))['catch'](loggerCatch(_0x08f3('0xb1')));}else{_0x3b923c[_0x08f3('0x38')]=_0x08f3('0x1e3');if(_['isNil'](_0x287bd5[0x0])||_[_0x08f3('0xa8')](_0x287bd5[0x0]['Contact'])||_['isNil'](_0x287bd5[0x0][_0x08f3('0x160')][_0x08f3('0x148')])){_0x204555[_0x08f3('0xc3')]('[actionOriginate]\x20',_0x3b923c,_0x287bd5[0x0]);}else{_0x204555[_0x08f3('0xb2')](_[_0x08f3('0xc6')](_0x287bd5[0x0],[_0x08f3('0xca'),_0x08f3('0x1df')]))[_0x08f3('0xaf')](_0x204555[_0x08f3('0x1c0')](_0x3b923c,_0x287bd5[0x0]))[_0x08f3('0xab')](_0x204555[_0x08f3('0xc2')](_0x08f3('0x1e7'),_0x3b923c));}}})[_0x08f3('0xab')](loggerGetContactDialer(_0x08f3('0x1e8'),_0x3b923c,0x1));emitVoiceQueueSummary(_0x3b923c);};Dialer[_0x08f3('0xa4')][_0x08f3('0x1b4')]=function(_0x17f35a,_0x105ce9,_0x29d03a,_0x1f7c47,_0x1a6b1a,_0x5954f6){loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1e9'));loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1ea'),_0x17f35a);loggerPredictive[_0x08f3('0x77')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x105ce9);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1eb'),_0x29d03a);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f7c47);loggerPredictive['info'](_0x08f3('0x1ec'),_0x1a6b1a);loggerPredictive[_0x08f3('0x77')]('---------------------------');return new BPromise(function(_0x33380d,_0x5fb7d5){if(_0x17f35a<=0x0||isNaN(_0x17f35a)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),_0x08f3('0x43'),_0x08f3('0x1ee')+_0x17f35a));}if(_0x29d03a<=0x0||isNaN(_0x29d03a)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),'Error','Ts\x20=\x20'+_0x29d03a));}if(_0x1f7c47<=0x0||isNaN(_0x1f7c47)){return _0x5fb7d5(msgResponse('[abandonmentRate]','Error',_0x08f3('0x1ef')+_0x1f7c47));}if(_0x105ce9<=0x0||isNaN(_0x105ce9)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),_0x08f3('0x43'),_0x08f3('0x1f0')+_0x105ce9));}if(_0x1a6b1a<=0x0||isNaN(_0x1a6b1a)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),'Error','Amax\x20=\x20'+_0x1a6b1a));}_0x5954f6=_0x5954f6||0x0;var _0x1da5aa=0x1/_0x29d03a;var _0x5577a5=0x0;var _0x451265=0x0;var _0x32e8aa=0x0;var _0x5c0f3a=0x0;for(var _0x4b844b=0x0;_0x32e8aa<_0x1a6b1a;_0x4b844b+=0x1){_0x451265=_0x4b844b/_0x105ce9;_0x5577a5=(_0x1f7c47*_0x451265+_0x5954f6)/_0x1da5aa;_0x32e8aa=erlangb(_0x5577a5,_0x17f35a);_0x5c0f3a=_0x5577a5/_0x17f35a*(0x1-erlangb(_0x5577a5,_0x17f35a));}return _0x33380d({'erlangCalls':_0x4b844b,'erlangCallToSecond':_0x105ce9/_0x4b844b,'erlangAbandonmentRate':_0x32e8aa,'erlangBusyFactor':_0x5c0f3a});});};Dialer['prototype'][_0x08f3('0x1b6')]=function(_0xe27a2b,_0x192b02,_0x18569a,_0x59649a,_0x25ccb6,_0x121cc1){loggerPredictive[_0x08f3('0x77')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x08f3('0x77')]('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',_0xe27a2b);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1f1'),_0x192b02);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1eb'),_0x18569a);loggerPredictive[_0x08f3('0x77')]('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',_0x59649a);loggerPredictive[_0x08f3('0x77')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25ccb6);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1f2'));return new BPromise(function(_0x31b261,_0x207498){if(_0xe27a2b<=0x0||isNaN(_0xe27a2b)){return _0x207498(msgResponse(_0x08f3('0x1f3'),_0x08f3('0x43'),'m\x20=\x20'+_0xe27a2b));}if(_0x18569a<=0x0||isNaN(_0x18569a)){return _0x207498(msgResponse('[busyFactor]',_0x08f3('0x43'),_0x08f3('0x1f4')+_0x18569a));}if(_0x59649a<=0x0||isNaN(_0x59649a)){return _0x207498(msgResponse(_0x08f3('0x1f3'),_0x08f3('0x43'),_0x08f3('0x1ef')+_0x59649a));}if(_0x192b02<=0x0||isNaN(_0x192b02)){return _0x207498(msgResponse(_0x08f3('0x1f3'),'Error',_0x08f3('0x1f0')+_0x192b02));}if(_0x25ccb6<=0x0||isNaN(_0x25ccb6)){return _0x207498(msgResponse(_0x08f3('0x1f3'),'Error',_0x08f3('0x1f5')+_0x25ccb6));}_0x121cc1=_0x121cc1||0x0;var _0x1473ac=0x1/_0x18569a;var _0x231b4a=0x0;var _0x4faa4a=0x0;var _0x1a99f3=0x0;var _0x53e208=0x0;for(var _0x45d99e=0x0;_0x53e208<_0x25ccb6;_0x45d99e+=0x1){_0x4faa4a=_0x45d99e/_0x192b02;_0x231b4a=(_0x59649a*_0x4faa4a+_0x121cc1)/_0x1473ac;_0x1a99f3=erlangb(_0x231b4a,_0xe27a2b);_0x53e208=_0x231b4a/_0xe27a2b*(0x1-erlangb(_0x231b4a,_0xe27a2b));}return _0x31b261({'erlangCalls':_0x45d99e,'erlangCallToSecond':_0x192b02/_0x45d99e,'erlangAbandonmentRate':_0x1a99f3,'erlangBusyFactor':_0x53e208});});};module[_0x08f3('0x1f6')]=Dialer; \ No newline at end of file +var _0x2c54=['syncOriginateResponse','bind','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangAbandonmentRate','Trunk','active','callerid','stringify','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','NOT_ACTIVE','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','state','statedesc','starttime','prototype','uniqueId','[uniqueid]','clearZombieChannels','hasOwnProperty','enqueue','isNil','Action','status','channel','No\x20such\x20channel','updateOriginated','queue','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','resolve','then','[countReScheduled]\x20','checkIsBlackList','catch','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','rescheduleContact','[rescheduleContact]\x20','getContactDialer','getContactDialerIvr','[getContactDialer]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','xcally-motion-dialer','dialAMDActive','value','HANGUP','uniqueid','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','[syncMachineIvr][createHistory]','[syncMachineIvr]','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','Unknow','reason','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','queueCallerAbandonCreateState','outboundDropCallsDayCallersExit','actions','actionid','locked','paused','stateinterface','queueBooked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','run','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','ContactId','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','isArray','push','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','pow','replace','random','match','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','dialCutDigit','substring','trim','outboundOriginateFailureCallsDay','[originateError]:\x20%s','endtime','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','object','entity\x20is\x20undefine','[callProgressDetecting]','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','countglobal','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','stateGlobal','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','outboundCongestionCallsDay','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','merge','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','[CatchErlangB]','agentBusyFactor','check\x20failure','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','checkContactBlack','UserId','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','countReScheduled','[actionOriginate]\x20','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','util','lodash','bluebird','moment','md5','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','originateresponse'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x2c54,0x1c4));var _0x42c5=function(_0x3fede1,_0x24d8bf){_0x3fede1=_0x3fede1-0x0;var _0x307e77=_0x2c54[_0x3fede1];return _0x307e77;};'use strict';var util=require(_0x42c5('0x0'));var _=require(_0x42c5('0x1'));var BPromise=require(_0x42c5('0x2'));var uuid=require('uuid');var moment=require(_0x42c5('0x3'));var rr=require('rr');var md5=require(_0x42c5('0x4'));var Redis=require('ioredis');var config=require(_0x42c5('0x5'));var logger=require(_0x42c5('0x6'))(_0x42c5('0x7'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x42c5('0x6'))(_0x42c5('0x8'));var loggerPredictiveCalls=require(_0x42c5('0x6'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x42c5('0x6'))(_0x42c5('0x9'));var ami=require(_0x42c5('0xa'));config[_0x42c5('0xb')]=_[_0x42c5('0xc')](config[_0x42c5('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0x42c5('0xd'))(new Redis(config['redis']));var cmHopper=require(_0x42c5('0xe'));var cmHopperFinal=require(_0x42c5('0xf'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x42c5('0x10'));var voiceQueueRt=require(_0x42c5('0x11'));var Action=require(_0x42c5('0x12'));var History=require(_0x42c5('0x13'));var Final=require(_0x42c5('0x14'));var AgentComplete=require(_0x42c5('0x15'));var QueueCallerAbandon=require(_0x42c5('0x16'));var Hangup=require(_0x42c5('0x17'));var ipAgi=process[_0x42c5('0x18')][_0x42c5('0x19')]||_0x42c5('0x1a');var strategy={'rrmemory':_0x42c5('0x1b'),'roundrobin':_0x42c5('0x1c')};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x55ce92){this[_0x42c5('0x1d')]=this[_0x42c5('0x1d')]?this[_0x42c5('0x1d')][_0x42c5('0x1e')](_0x55ce92):_0x55ce92();};function Dialer(_0x273e46,_0xb737a6){this[_0x42c5('0x1f')]=new Sequence();this[_0x42c5('0x20')]=_0xb737a6;this[_0x42c5('0x21')]=_0x273e46[_0x42c5('0x21')];this[_0x42c5('0x22')]=_0x273e46[_0x42c5('0x22')];this['agents']=_0x273e46[_0x42c5('0x23')];this[_0x42c5('0x24')]=_0x273e46[_0x42c5('0x24')];this[_0x42c5('0x25')]=config[_0x42c5('0x25')]||0x2;this[_0x42c5('0x26')]={};this['actions']={};this[_0x42c5('0x27')]={};this['uniqueId']={};this[_0x42c5('0x28')]={};this[_0x42c5('0x29')]={};this[_0x42c5('0x2a')]={};this[_0x42c5('0x2b')]={};this['queueBooked']={};this[_0x42c5('0x2c')]={};ami['on'](_0x42c5('0x2d'),this[_0x42c5('0x2e')]['bind'](this));ami['on'](_0x42c5('0x2f'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x42c5('0x30'),this[_0x42c5('0x31')][_0x42c5('0x32')](this));ami['on'](_0x42c5('0x33'),this[_0x42c5('0x34')][_0x42c5('0x32')](this));ami['on'](_0x42c5('0x35'),this[_0x42c5('0x9')][_0x42c5('0x32')](this));ami['on'](_0x42c5('0x36'),this['syncHangup'][_0x42c5('0x32')](this));ami['on'](_0x42c5('0x37'),this[_0x42c5('0x38')]['bind'](this));ami['on'](_0x42c5('0x39'),this[_0x42c5('0x3a')][_0x42c5('0x32')](this));ami['on'](_0x42c5('0x3b'),this[_0x42c5('0x3c')][_0x42c5('0x32')](this));ami['on']('queuestatuscomplete',this[_0x42c5('0x3d')][_0x42c5('0x32')](this));this[_0x42c5('0x3e')]();this[_0x42c5('0x3f')]();}function isNotNull(_0x556fc3){return _0x556fc3!==null&&!_[_0x42c5('0x40')](_0x556fc3);}function checkIsLoggedIn(_0x21b884,_0x226520){return function(){if(_0x226520<=0x0){_0x21b884[_0x42c5('0x41')]=_0x42c5('0x42');throw _0x21b884[_0x42c5('0x43')]+_0x42c5('0x44');}};}function isActive(_0x4d8964){return _0x4d8964;}function checkIsActive(_0x122e4f,_0x9093d3){return function(){if(!isActive(_0x9093d3)){_0x122e4f[_0x42c5('0x41')]='NOT_ACTIVE';throw _0x122e4f[_0x42c5('0x43')]+_0x42c5('0x45');}};}function checkInterval(_0x5d7c2c){return function(){if(!isNotNull(_0x5d7c2c[_0x42c5('0x46')])){_0x5d7c2c[_0x42c5('0x41')]=_0x42c5('0x47');throw _0x5d7c2c[_0x42c5('0x43')]+_0x42c5('0x48');}if(!isNotNull(_0x5d7c2c['Interval'][_0x42c5('0x49')])){_0x5d7c2c[_0x42c5('0x41')]=_0x42c5('0x47');throw _0x5d7c2c[_0x42c5('0x43')]+_0x42c5('0x48');}if(!isNotNull(_[_0x42c5('0x4a')](_0x5d7c2c[_0x42c5('0x46')][_0x42c5('0x49')]))){_0x5d7c2c[_0x42c5('0x41')]=_0x42c5('0x47');throw _0x5d7c2c['name']+_0x42c5('0x48');}};}function msgResponse(_0x17d998,_0x30312f,_0x19cc6c){return{'action':_0x17d998,'response':_0x30312f,'message':_0x19cc6c,'stack':_0x19cc6c};}function myreject(_0x66f02e){return function(_0x3135a4){return _0x66f02e(msgResponse(_0x42c5('0x4b'),_0x42c5('0x4c'),JSON['stringify'](_0x3135a4)));};}function getSeconds(_0x3380fd,_0x2c16bf){var _0x41b0b0=moment(_0x3380fd)[_0x42c5('0x4d')](0x0);var _0x58e148=moment(_0x2c16bf)['milliseconds'](0x0);return _0x41b0b0[_0x42c5('0x4e')](_0x58e148,'seconds');}function emit(_0x147f5c,_0x10836f,_0x4efe28){io['to'](_0x147f5c)[_0x42c5('0x4f')](_0x10836f,_0x4efe28);}function emitVoiceQueueSummary(_0x1fc399){if(_0x1fc399[_0x42c5('0x50')]===_0x42c5('0x51')){var _0x23d754={'id':_0x1fc399['id'],'name':_0x1fc399['name'],'strategy':_0x1fc399[_0x42c5('0x52')],'answered':_0x1fc399[_0x42c5('0x53')],'available':_0x1fc399[_0x42c5('0x54')],'loggedIn':_0x1fc399[_0x42c5('0x55')],'pTalking':_0x1fc399[_0x42c5('0x56')],'sumBillable':_0x1fc399[_0x42c5('0x57')],'sumDuration':_0x1fc399[_0x42c5('0x58')],'sumHoldTime':_0x1fc399[_0x42c5('0x59')]||0x0,'talking':_0x1fc399[_0x42c5('0x5a')],'total':_0x1fc399[_0x42c5('0x5b')],'type':_0x1fc399['type'],'unmanaged':_0x1fc399[_0x42c5('0x5c')],'abandoned':_0x1fc399[_0x42c5('0x5d')],'waiting':_0x1fc399[_0x42c5('0x5e')],'loggedInDb':_0x1fc399['loggedInDb'],'dialActive':_0x1fc399[_0x42c5('0x5f')],'dialMethod':_0x1fc399[_0x42c5('0x60')],'dialOriginateCallerIdName':_0x1fc399[_0x42c5('0x61')],'dialOriginateCallerIdNumber':_0x1fc399[_0x42c5('0x62')],'dialOriginateTimeout':_0x1fc399[_0x42c5('0x63')],'dialPrefix':_0x1fc399[_0x42c5('0x64')],'outboundAnswerAgiCallsDay':_0x1fc399['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1fc399[_0x42c5('0x65')],'outboundBlacklistCallsDay':_0x1fc399['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x1fc399[_0x42c5('0x66')],'outboundCongestionCallsDay':_0x1fc399['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1fc399[_0x42c5('0x67')],'outboundDropCallsDayCallersExit':_0x1fc399['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1fc399[_0x42c5('0x68')],'outboundNoAnswerCallsDay':_0x1fc399['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x1fc399[_0x42c5('0x69')],'outboundOriginateFailureCallsDay':_0x1fc399['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1fc399['outboundReCallsDay'],'outboundRejectCallsDay':_0x1fc399['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1fc399[_0x42c5('0x6a')],'predictiveIntervalAnsweredCalls':_0x1fc399[_0x42c5('0x6b')],'predictiveIntervalAvgHoldtime':_0x1fc399[_0x42c5('0x6c')],'predictiveIntervalAvgTalktime':_0x1fc399[_0x42c5('0x6d')],'predictiveIntervalDroppedCallsCallersExit':_0x1fc399[_0x42c5('0x6e')],'predictiveIntervalDroppedCallsTimeout':_0x1fc399[_0x42c5('0x6f')],'predictiveIntervalErlangCalls':_0x1fc399[_0x42c5('0x70')],'predictiveIntervalErlangCallsDroppedCalls':_0x1fc399[_0x42c5('0x71')],'predictiveIntervalHitRate':_0x1fc399['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x1fc399['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x1fc399[_0x42c5('0x72')],'predictiveIntervalAvailable':_0x1fc399[_0x42c5('0x73')],'predictiveIntervalTotalCalls':_0x1fc399[_0x42c5('0x74')],'message':_0x1fc399[_0x42c5('0x41')],'originated':_0x1fc399[_0x42c5('0x75')],'erlangCalls':_0x1fc399['erlangCalls'],'erlangCallToSecond':_0x1fc399['erlangCallToSecond'],'erlangAbandonmentRate':_0x1fc399[_0x42c5('0x76')],'erlangBusyFactor':_0x1fc399['erlangBusyFactor'],'startPredictive':_0x1fc399[_0x42c5('0x29')],'startProgressive':_0x1fc399['startProgressive']};if(_0x1fc399[_0x42c5('0x77')]){_0x23d754[_0x42c5('0x77')]={'id':_0x1fc399[_0x42c5('0x77')]['id'],'name':_0x1fc399[_0x42c5('0x77')][_0x42c5('0x43')],'active':_0x1fc399[_0x42c5('0x77')][_0x42c5('0x78')],'callerid':_0x1fc399['Trunk'][_0x42c5('0x79')]};}if(_0x1fc399[_0x42c5('0x46')]){_0x23d754[_0x42c5('0x46')]={'id':_0x1fc399[_0x42c5('0x46')]['id'],'name':_0x1fc399[_0x42c5('0x46')]['name']};}var _0x495fce=md5(JSON[_0x42c5('0x7a')](_0x23d754));if(_0x1fc399[_0x42c5('0x4')]!==_0x495fce){_0x1fc399[_0x42c5('0x4')]=_0x495fce;emit(util[_0x42c5('0x7b')](_0x42c5('0x7c'),_0x23d754[_0x42c5('0x43')]),_0x42c5('0x7d'),_0x23d754);}}}function emitCampaignSummary(_0x21fc6b){if(_0x21fc6b[_0x42c5('0x50')]===_0x42c5('0x7e')){emit(util[_0x42c5('0x7b')](_0x42c5('0x7f'),_0x21fc6b[_0x42c5('0x43')]),_0x42c5('0x80'),_0x21fc6b);}}function checkGetDataPredictive(_0x343955){if(isNotNull(_0x343955)){if(!_['isEmpty'](_0x343955)){loggerPredictive[_0x42c5('0x81')](_0x42c5('0x82'));loggerPredictive[_0x42c5('0x81')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x343955[_0x42c5('0x74')]);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x83'),_0x343955['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x42c5('0x84'),_0x343955[_0x42c5('0x6f')]);loggerPredictive[_0x42c5('0x81')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x343955[_0x42c5('0x6e')]);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x85'),_0x343955['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x86'),_0x343955[_0x42c5('0x6d')]);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x87'));if(_0x343955['predictiveIntervalTotalCalls']>0x0){if(!_[_0x42c5('0x40')](_0x343955[_0x42c5('0x6d')])&&_0x343955[_0x42c5('0x6d')]>0x0){return!![];}else{loggerPredictive[_0x42c5('0x81')](_0x42c5('0x88'));}if(!_[_0x42c5('0x40')](_0x343955[_0x42c5('0x6c')])&&_0x343955[_0x42c5('0x6c')]>0x0){return!![];}else{loggerPredictive[_0x42c5('0x81')](_0x42c5('0x89'));}}else{loggerPredictive[_0x42c5('0x81')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x42c5('0x8a'));}}else{loggerPredictive[_0x42c5('0x81')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x5262f4){return function(_0xcebaa0){loggerPredictive[_0x42c5('0x81')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x42c5('0x81')](_0x42c5('0x8b'),_0xcebaa0[_0x42c5('0x8c')]);loggerPredictive[_0x42c5('0x81')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcebaa0['erlangCallToSecond']);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x8d'),_0xcebaa0[_0x42c5('0x76')]);loggerPredictive['info'](_0x42c5('0x8e'),_0xcebaa0['erlangBusyFactor']);loggerPredictive[_0x42c5('0x81')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xcebaa0[_0x42c5('0x76')]);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x87'));_['merge'](_0x5262f4,_0xcebaa0);};}function getDiff(_0x1c4fc3){var _0xb41a23=moment()['milliseconds'](0x0);var _0x3bb9e3=moment(_0x1c4fc3)[_0x42c5('0x4d')](0x0);return _0xb41a23['diff'](_0x3bb9e3,_0x42c5('0x8f'));}function ifInterval(_0x1b0a8d,_0x4cddd0){if(_['isUndefined'](_0x4cddd0)){return![];}if(getDiff(_0x4cddd0)<_0x1b0a8d*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x13af30){if(isNotNull(_0x13af30)){if(!_[_0x42c5('0x40')](_0x13af30[_0x42c5('0x2a')])){_0x13af30[_0x42c5('0x2a')]=undefined;loggerPredictive['info'](_0x13af30['name'],_0x42c5('0x90'));}if(!_['isUndefined'](_0x13af30['startPredictive'])){_0x13af30[_0x42c5('0x29')]=undefined;loggerPredictive['info'](_0x13af30[_0x42c5('0x43')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x42c5('0x40')](_0x13af30['handlePredictive'])){clearInterval(_0x13af30[_0x42c5('0x91')]);_0x13af30['handlePredictive']=undefined;loggerPredictive[_0x42c5('0x81')](_0x13af30[_0x42c5('0x43')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x1582cd,_0xbafa5){if(_0xbafa5===0x0){return 0x0;}var _0x2fece3=0x1;for(var _0x44fe3f=0x1;_0x44fe3f<=_0xbafa5;_0x44fe3f+=0x1){_0x2fece3=0x1+_0x2fece3*_0x44fe3f/_0x1582cd;}return 0x1/_0x2fece3;}function isVoiceQueueOutbound(_0x79e119){return _0x79e119==='outbound';}function isNotPreview(_0x277e53){return _0x277e53!==_0x42c5('0x20');}function isCampaignIvr(_0x37de75){return _0x37de75==='ivr';}function getCallerId(_0x3d4bf3,_0x18143b,_0x4c64a6){if(!_['isUndefined'](_0x4c64a6)&&'string'===typeof _0x4c64a6&&!_[_0x42c5('0x4a')](_0x4c64a6)){if(!_[_0x42c5('0x40')](_0x18143b)&&_0x42c5('0x92')===typeof _0x18143b&&!_[_0x42c5('0x4a')](_0x18143b)){return util['format']('\x22%s\x22\x20<%s>',_0x18143b,_0x4c64a6);}return util[_0x42c5('0x7b')](_0x42c5('0x93'),_0x4c64a6,_0x4c64a6);}if(!_[_0x42c5('0x40')](_0x3d4bf3)&&_0x42c5('0x92')===typeof _0x3d4bf3&&!_['isEmpty'](_0x3d4bf3)){return _0x3d4bf3;}return _0x42c5('0x94');}function loggerCatchQueueSummary(_0x398407,_0x51731a){return function(_0x215db1){freeVariablesPredictive(_0x51731a);emitVoiceQueueSummary(_0x51731a);emitCampaignSummary(_0x51731a);loggerSyncQueueSummary['error'](_0x398407,util[_0x42c5('0x95')](_0x215db1,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x50e9ab,_0x30554d){return function(_0x3fbdf1){loggerPredictive[_0x42c5('0x96')](_0x30554d['name'],_0x50e9ab);loggerPredictive[_0x42c5('0x96')](_0x3fbdf1[_0x42c5('0x97')]);freeVariablesPredictive(_0x30554d);};}function loggerCatch(_0x1d007e){return function(_0x330300){logger[_0x42c5('0x96')](_0x1d007e,util['inspect'](_0x330300,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x41f0bb){return _0x41f0bb&&!_[_0x42c5('0x40')](_0x41f0bb)&&_0x41f0bb[_0x42c5('0x98')]>0x0;}function decremetOriginate(_0x276817){if(!_[_0x42c5('0x40')](_0x276817)&&_0x276817!==null){if(_0x276817['hasOwnProperty'](_0x42c5('0x75'))){if(_0x276817[_0x42c5('0x75')]>0x0){_0x276817[_0x42c5('0x75')]-=0x1;}else{logger[_0x42c5('0x96')](_0x42c5('0x99'));}}}else{logger['error'](_0x42c5('0x9a'));}}function checkContactLowerLimitOriginate(_0x2df4b1,_0x19e487,_0x287485){if(_0x19e487>_0x287485){for(var _0x3914b7=0x0;_0x3914b7<_0x19e487-_0x287485;_0x3914b7+=0x1){decremetOriginate(_0x2df4b1);}}}function loggerGetContactDialer(_0x35c89d,_0x29790c,_0x5c28b9){return function(_0x5b4701){checkContactLowerLimitOriginate(_0x29790c,_0x5c28b9,0x0);logger[_0x42c5('0x96')](_0x35c89d,util[_0x42c5('0x95')](_0x5b4701,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x527a97){return function(_0x568490){if(isNotNull(_0x568490)&&isNotNull(_0x568490[0x0])){if(_0x568490[0x0][_0x42c5('0x9b')]>0x0){_0x527a97[_0x42c5('0x41')]='RESCHEDULED_CONTACTS';logger['info'](_0x42c5('0x9c')+_0x527a97[_0x42c5('0x43')],_0x568490[0x0][_0x42c5('0x9b')],_0x42c5('0x9d'));}else{_0x527a97[_0x42c5('0x41')]=_0x42c5('0x9e');logger[_0x42c5('0x81')]('[getContactDialer2][Empty]'+_0x527a97[_0x42c5('0x43')]);}}};}function notSendMessagesQueue(_0x1a87d4){if(_0x1a87d4[_0x42c5('0x9f')]){freeVariablesPredictive(_0x1a87d4);if(_0x1a87d4[_0x42c5('0x75')]===0x0&&_0x1a87d4['talking']===0x0&&_0x1a87d4[_0x42c5('0x5e')]===0x0&&(_0x1a87d4[_0x42c5('0x56')]||0x0)===0x0){_0x1a87d4[_0x42c5('0x9f')]=![];_0x1a87d4['available']=0x0;_0x1a87d4['message']=_0x42c5('0xa0');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1a87d4['name'],_0x42c5('0xa1'));}else{_0x1a87d4[_0x42c5('0x41')]=_0x42c5('0xa2');loggerSyncQueueSummary[_0x42c5('0x96')](_0x42c5('0xa3'),_0x1a87d4['name'],'is\x20disactive');}emitVoiceQueueSummary(_0x1a87d4);}}function notSendMessagesCampaign(_0x55b30e){if(_0x55b30e[_0x42c5('0x9f')]){if(_0x55b30e[_0x42c5('0x75')]===0x0){_0x55b30e[_0x42c5('0x9f')]=![];_0x55b30e['message']=_0x42c5('0xa0');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x55b30e[_0x42c5('0x43')],_0x42c5('0xa1'));}else{_0x55b30e[_0x42c5('0x41')]=_0x42c5('0xa2');loggerSyncQueueSummary['error'](_0x42c5('0xa4'),_0x55b30e[_0x42c5('0x43')],_0x42c5('0xa5'));}emitCampaignSummary(_0x55b30e);}}function createObjHistory(_0x203821,_0x3cd4a3,_0x1e4ab4,_0x27895e,_0x205b23){_0x203821['message']=_0x1e4ab4;var _0x5cd5ff=new Action(_0x203821,_0x3cd4a3);var _0x50b072=new History(_0x5cd5ff);_0x50b072[_0x42c5('0xa6')]=_0x27895e;_0x50b072[_0x42c5('0xa7')]=_0x205b23;_0x50b072['endtime']=_0x5cd5ff[_0x42c5('0xa8')];return _0x50b072;}Dialer[_0x42c5('0xa9')][_0x42c5('0x3f')]=function(){var _0x11f94e=this;setInterval(function(){_0x11f94e['clearZombieChannels'](_0x11f94e[_0x42c5('0xaa')],_0x42c5('0xab'));_0x11f94e[_0x42c5('0xac')](_0x11f94e['actions'],'[actions]');},0x32c8);};Dialer['prototype'][_0x42c5('0xac')]=function(_0x185ee4,_0xfa0646){var _0x18d0c7=this;for(var _0x10dde3 in _0x185ee4){if(_0x185ee4[_0x42c5('0xad')](_0x10dde3)){this[_0x42c5('0x1f')][_0x42c5('0xae')](function(){if(!_[_0x42c5('0xaf')](_0x185ee4[_0x10dde3])){return ami[_0x42c5('0xb0')]({'action':_0x42c5('0xb1'),'channel':_0x185ee4[_0x10dde3][_0x42c5('0xb2')]})['catch'](function(_0x40af29){if(_0x40af29[_0x42c5('0x41')]===_0x42c5('0xb3')){setTimeout(function(){if(_0x185ee4[_0x10dde3]&&_0x185ee4[_0x10dde3][_0x42c5('0x50')]!==_0x42c5('0x7e')){_0x18d0c7[_0x42c5('0xb4')](_0x18d0c7[_0x42c5('0x21')][_0x185ee4[_0x10dde3][_0x42c5('0xb5')]]);logger[_0x42c5('0x96')](_0x42c5('0xb6'),_0xfa0646,_0x10dde3,_0x185ee4[_0x10dde3][_0x42c5('0xb5')]);delete _0x185ee4[_0x10dde3];}if(_0x185ee4[_0x10dde3]&&_0x185ee4[_0x10dde3]['type']==='ivr'){_0x18d0c7[_0x42c5('0xb4')](_0x18d0c7['campaigns'][_0x185ee4[_0x10dde3][_0x42c5('0xb5')]]);logger[_0x42c5('0x96')](_0x42c5('0xb7'),_0xfa0646,_0x10dde3,_0x185ee4[_0x10dde3][_0x42c5('0xb5')]);delete _0x185ee4[_0x10dde3];}},0x2328);}});}});}}};Dialer['prototype']['countReScheduled']=function(_0x545388){return BPromise[_0x42c5('0xb8')]()[_0x42c5('0xb9')](cmHopper['countReScheduled'](_0x545388))['catch'](loggerCatch(_0x42c5('0xba')));};Dialer['prototype']['checkIsBlackList']=function(_0x2336bd){return BPromise['resolve']()[_0x42c5('0xb9')](cmHopperBlack[_0x42c5('0xbb')](_0x2336bd))[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xbd')));};Dialer[_0x42c5('0xa9')][_0x42c5('0xbe')]=function(_0x1e49a4){return BPromise[_0x42c5('0xb8')]()['then'](cmHopperBlack[_0x42c5('0xbe')](_0x1e49a4))[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xbf')));};Dialer[_0x42c5('0xa9')][_0x42c5('0xc0')]=function(_0x36014f){return BPromise['resolve']()[_0x42c5('0xb9')](cmHopperHistory['avgHandleTime'](_0x36014f))[_0x42c5('0xbc')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x42c5('0xa9')][_0x42c5('0xc1')]=function(_0x48b39b){return BPromise[_0x42c5('0xb8')]()['then'](cmHopper[_0x42c5('0xc1')](_0x48b39b))['catch'](loggerCatch(_0x42c5('0xc2')));};Dialer[_0x42c5('0xa9')][_0x42c5('0xc3')]=function(_0xf6611d,_0x5b1ec7,_0x5d51c2,_0x41db4e){return BPromise[_0x42c5('0xb8')]()[_0x42c5('0xb9')](cmHopper[_0x42c5('0xc3')](_0xf6611d,_0x5b1ec7,_0x5d51c2,_0x41db4e))[_0x42c5('0xbc')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x42c5('0xa9')][_0x42c5('0xc4')]=function(_0x40a2d0,_0x15b9c8,_0x4906c0){return BPromise[_0x42c5('0xb8')]()[_0x42c5('0xb9')](cmHopper[_0x42c5('0xc4')](_0x40a2d0,_0x15b9c8,_0x4906c0))['catch'](loggerCatch(_0x42c5('0xc5')));};Dialer[_0x42c5('0xa9')][_0x42c5('0xc6')]=function(_0x4010e3){return BPromise[_0x42c5('0xb8')]()[_0x42c5('0xb9')](voiceQueueRt[_0x42c5('0xc6')](_0x4010e3))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x42c5('0xa9')][_0x42c5('0xc7')]=function(_0x52e3c3){return BPromise[_0x42c5('0xb8')]()['then'](cmHopper[_0x42c5('0xc7')](_0x52e3c3))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x42c5('0xa9')][_0x42c5('0xc8')]=function(_0x3a4514){return BPromise[_0x42c5('0xb8')]()[_0x42c5('0xb9')](cmHopperHistory[_0x42c5('0xc8')](_0x3a4514))['catch'](loggerCatch('[createHistory]\x20'));};Dialer[_0x42c5('0xa9')]['updateOriginated']=function(_0xa5e6f1){if(!_[_0x42c5('0x40')](_0xa5e6f1)&&_0xa5e6f1!==null){if(_0xa5e6f1[_0x42c5('0xad')](_0x42c5('0x75'))){if(_0xa5e6f1[_0x42c5('0x75')]>0x0){_0xa5e6f1[_0x42c5('0x75')]-=0x1;}else{logger[_0x42c5('0x96')](_0x42c5('0xc9'));}}}else{logger[_0x42c5('0x96')](_0x42c5('0xca'));}};Dialer[_0x42c5('0xa9')][_0x42c5('0xcb')]=function(_0x3f5ce0,_0x27ab2c){var _0x4a6cbe=this;return function(_0xbbd70){_0x4a6cbe[_0x42c5('0xb4')](_0x27ab2c);logger[_0x42c5('0x96')](_0x3f5ce0,util[_0x42c5('0x95')](_0xbbd70,{'showHidden':![],'depth':null}));};};Dialer[_0x42c5('0xa9')][_0x42c5('0xcc')]=function(_0x333e44,_0x22655a,_0x522964){var _0x1659c4={'state':0x19,'statedesc':'notFound'};this[_0x42c5('0xb4')](_0x22655a);this[_0x42c5('0xcd')](_['merge'](_0x1659c4,_[_0x42c5('0xce')](_0x522964,['ContactId',_0x42c5('0xcf'),'UserId',_0x42c5('0xd0'),_0x42c5('0xd1')])),_0x42c5('0xd2'),'[emptyContact]');logger[_0x42c5('0x96')](_0x333e44);};Dialer['prototype'][_0x42c5('0xd3')]=function(_0x40b87a){return _0x40b87a===_0x42c5('0xd4');};Dialer[_0x42c5('0xa9')][_0x42c5('0xd5')]=function(_0x2a0f11){return!_[_0x42c5('0x40')](_0x2a0f11)&&_0x2a0f11&&!_['isUndefined'](_0x2a0f11[_0x42c5('0x43')])&&!_[_0x42c5('0x40')](_0x2a0f11['active'])&&_0x2a0f11['active']&&(this['trunks'][util[_0x42c5('0x7b')](_0x42c5('0xd6'),_0x2a0f11[_0x42c5('0x43')])][_0x42c5('0xb1')]===_0x42c5('0xd7')||this[_0x42c5('0x24')][util[_0x42c5('0x7b')]('SIP/%s',_0x2a0f11[_0x42c5('0x43')])][_0x42c5('0xb1')]===_0x42c5('0xd8'));};Dialer[_0x42c5('0xa9')][_0x42c5('0xcd')]=function(_0x211a29,_0x171ee9,_0x3925c8){this[_0x42c5('0xc8')](_0x211a29)[_0x42c5('0xbc')](loggerCatch(_0x171ee9));this['moveContactManagedDialer'](_0x211a29)[_0x42c5('0xbc')](loggerCatch(_0x3925c8));};Dialer['prototype']['syncVarSet']=function(_0x98d907){var _0x5e381c=this[_0x42c5('0xaa')][_0x98d907['uniqueid']];var _0x5bcce8;if(!_['isNil'](_0x98d907)&&!_[_0x42c5('0xaf')](_0x98d907[_0x42c5('0xd9')])&&!_[_0x42c5('0xaf')](_0x98d907[_0x42c5('0xd9')]['amdstatus'])&&_0x98d907['exten']===_0x42c5('0xda')&&_0x5e381c){if(_0x5e381c[_0x42c5('0x50')]!==_0x42c5('0x7e')&&this['voiceQueues'][_0x5e381c['queue']][_0x42c5('0xdb')]&&_0x98d907[_0x42c5('0xdc')]===_0x42c5('0xdd')){delete this['uniqueId'][_0x98d907[_0x42c5('0xde')]];this['updateOriginated'](this[_0x42c5('0x21')][_0x5e381c['queue']]);this[_0x42c5('0x21')][_0x5e381c[_0x42c5('0xb5')]][_0x42c5('0x65')]+=0x1;this[_0x42c5('0x21')][_0x5e381c[_0x42c5('0xb5')]][_0x42c5('0xdf')]+=0x1;_0x5bcce8=new Hangup(_0x5e381c,_0x98d907);_0x5bcce8[_0x42c5('0xa6')]=0x12;_0x5bcce8[_0x42c5('0xa7')]=_0x42c5('0xe0');_0x5bcce8[_0x42c5('0xe1')]=_0x42c5('0xe2');this[_0x42c5('0xcd')](_0x5bcce8,_0x42c5('0xe3'),_0x42c5('0xe4'));}if(_0x5e381c[_0x42c5('0x50')]!=='ivr'&&this['voiceQueues'][_0x5e381c[_0x42c5('0xb5')]]['dialAMDActive']&&_0x98d907['value']==='MACHINE'){delete this[_0x42c5('0xaa')][_0x98d907['uniqueid']];this[_0x42c5('0xb4')](this[_0x42c5('0x21')][_0x5e381c[_0x42c5('0xb5')]]);this[_0x42c5('0x21')][_0x5e381c['queue']][_0x42c5('0x65')]+=0x1;this[_0x42c5('0x21')][_0x5e381c[_0x42c5('0xb5')]][_0x42c5('0xdf')]+=0x1;_0x5bcce8=new Hangup(_0x5e381c,_0x98d907);_0x5bcce8[_0x42c5('0xa6')]=0x13;_0x5bcce8[_0x42c5('0xa7')]=_0x42c5('0xe5');_0x5bcce8[_0x42c5('0xe1')]=_0x42c5('0xe2');_0x5bcce8[_0x42c5('0xe6')]=!![];this['saveInDb'](_0x5bcce8,_0x42c5('0xe7'),_0x42c5('0xe8'));}if(_0x5e381c[_0x42c5('0x50')]==='ivr'&&this[_0x42c5('0x22')][_0x5e381c['queue']][_0x42c5('0xdb')]&&_0x98d907['value']==='HANGUP'){delete this[_0x42c5('0xaa')][_0x98d907[_0x42c5('0xde')]];this[_0x42c5('0xb4')](this[_0x42c5('0x22')][_0x5e381c[_0x42c5('0xb5')]]);_0x5bcce8=new Hangup(_0x5e381c,_0x98d907);_0x5bcce8[_0x42c5('0xa6')]=0x12;_0x5bcce8[_0x42c5('0xa7')]=_0x42c5('0xe0');_0x5bcce8['membername']='AMD';this[_0x42c5('0xcd')](_0x5bcce8,_0x42c5('0xe9'),_0x42c5('0xea'));}if(_0x5e381c[_0x42c5('0x50')]===_0x42c5('0x7e')&&this['campaigns'][_0x5e381c['queue']]['dialAMDActive']&&_0x98d907[_0x42c5('0xdc')]===_0x42c5('0xeb')){delete this['uniqueId'][_0x98d907['uniqueid']];this['updateOriginated'](this[_0x42c5('0x22')][_0x5e381c[_0x42c5('0xb5')]]);_0x5bcce8=new Hangup(_0x5e381c,_0x98d907);_0x5bcce8[_0x42c5('0xa6')]=0x13;_0x5bcce8[_0x42c5('0xa7')]=_0x42c5('0xe5');_0x5bcce8['membername']=_0x42c5('0xe2');_0x5bcce8['amd']=!![];this[_0x42c5('0xcd')](_0x5bcce8,_0x42c5('0xec'),_0x42c5('0xed'));}}};Dialer[_0x42c5('0xa9')][_0x42c5('0xee')]=function(_0x5d7b91){var _0x1b966a=this[_0x42c5('0xaa')][_0x5d7b91['uniqueid']];var _0x2698e0=this;var _0x531589;if(_0x1b966a&&_0x1b966a[_0x42c5('0x50')]===_0x42c5('0x7e')){delete this['uniqueId'][_0x5d7b91[_0x42c5('0xde')]];this[_0x42c5('0xb4')](this[_0x42c5('0x22')][_0x1b966a['queue']]);this[_0x42c5('0x22')][_0x1b966a[_0x42c5('0xb5')]][_0x42c5('0xef')]+=0x1;_0x531589=new Hangup(_0x1b966a,_0x5d7b91);this[_0x42c5('0xc8')](_0x531589)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xf0')));this[_0x42c5('0xc7')](_0x531589)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x1b966a&&_0x1b966a[_0x42c5('0x50')]!==_0x42c5('0x7e')&&isNotNull(this['voiceQueues'][_0x1b966a[_0x42c5('0xb5')]][_0x42c5('0xf1')])){delete this[_0x42c5('0xaa')][_0x5d7b91[_0x42c5('0xde')]];this[_0x42c5('0xb4')](this[_0x42c5('0x21')][_0x1b966a['queue']]);this['voiceQueues'][_0x1b966a[_0x42c5('0xb5')]]['outboundAnswerCallsDay']+=0x1;this[_0x42c5('0x21')][_0x1b966a[_0x42c5('0xb5')]][_0x42c5('0xdf')]+=0x1;_0x531589=new Hangup(_0x1b966a,_0x5d7b91);_0x531589[_0x42c5('0xa6')]=0x10;_0x531589[_0x42c5('0xa7')]=_0x42c5('0xf2');_0x531589['membername']=_0x42c5('0xf3');this[_0x42c5('0xc8')](_0x531589)[_0x42c5('0xbc')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x42c5('0xc7')](_0x531589)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xf4')));}if(_0x1b966a&&_0x1b966a[_0x42c5('0x50')]!=='ivr'&&!isNotNull(this[_0x42c5('0x21')][_0x1b966a[_0x42c5('0xb5')]][_0x42c5('0xf1')])){delete this[_0x42c5('0xaa')][_0x5d7b91[_0x42c5('0xde')]];this[_0x42c5('0xb4')](this[_0x42c5('0x21')][_0x1b966a[_0x42c5('0xb5')]]);this[_0x42c5('0x21')][_0x1b966a['queue']][_0x42c5('0x6a')]+=0x1;_0x531589=new Hangup(_0x1b966a,_0x5d7b91);_0x531589[_0x42c5('0xa6')]=0xc;_0x531589['statedesc']=_0x5d7b91[_0x42c5('0xf5')];_0x531589['membername']=_0x42c5('0xf6');this[_0x42c5('0xc8')](_0x531589)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x42c5('0xc7')](_0x531589)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xf4')));}};Dialer['prototype'][_0x42c5('0x34')]=function(_0x31157d){var _0x13e3be=this[_0x42c5('0xaa')][_0x31157d[_0x42c5('0xde')]];var _0x225399=this;if(this[_0x42c5('0x21')][_0x31157d['queue']]){if(_0x13e3be&&_0x13e3be[_0x42c5('0x50')]!=='ivr'){delete this[_0x42c5('0xaa')][_0x31157d[_0x42c5('0xde')]];this[_0x42c5('0x21')][_0x31157d['queue']][_0x42c5('0x65')]+=0x1;var _0x2d9eff=new AgentComplete(_0x13e3be,_0x31157d);if(_0x31157d[_0x42c5('0xf7')]==='agent'){_0x2d9eff[_0x42c5('0xf8')]=this[_0x42c5('0x21')][_0x31157d['queue']][_0x42c5('0xf9')]&&this[_0x42c5('0x21')][_0x31157d[_0x42c5('0xb5')]][_0x42c5('0xfa')]?moment()[_0x42c5('0x7b')](_0x42c5('0xfb')):undefined;}this[_0x42c5('0xc8')](_0x2d9eff)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xfc')));this['moveContactManagedDialer'](_0x2d9eff)['catch'](loggerCatch(_0x42c5('0xfd')));}}};Dialer[_0x42c5('0xa9')][_0x42c5('0x2e')]=function(_0x6dfa95){if(this[_0x42c5('0x21')][_0x6dfa95['queue']]){if(this['uniqueId'][_0x6dfa95[_0x42c5('0xde')]]&&this[_0x42c5('0xaa')][_0x6dfa95[_0x42c5('0xde')]][_0x42c5('0x50')]!==_0x42c5('0x7e')){this['updateOriginated'](this[_0x42c5('0x21')][_0x6dfa95['queue']]);this[_0x42c5('0xaa')][_0x6dfa95[_0x42c5('0xde')]][_0x42c5('0xfe')]=moment()[_0x42c5('0x7b')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x42c5('0xa9')]['queueCallerAbandonCreateState']=function(_0x2e7e08){this[_0x42c5('0xc8')](_0x2e7e08)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xfc')));this[_0x42c5('0xc7')](_0x2e7e08)[_0x42c5('0xbc')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0x42c5('0xff')]=function(_0x17af4d){var _0x511700=this['uniqueId'][_0x17af4d[_0x42c5('0xde')]];var _0x376168=this;if(this[_0x42c5('0x21')][_0x17af4d[_0x42c5('0xb5')]]){if(_0x511700&&_0x511700[_0x42c5('0x50')]!==_0x42c5('0x7e')){delete this[_0x42c5('0xaa')][_0x17af4d['uniqueid']];this[_0x42c5('0xb4')](this[_0x42c5('0x21')][_0x17af4d[_0x42c5('0xb5')]]);_0x511700[_0x42c5('0x100')]=moment()[_0x42c5('0x7b')](_0x42c5('0xfb'));var _0x50139f=new QueueCallerAbandon(_0x511700,_0x17af4d);if(getSeconds(_0x511700[_0x42c5('0x100')],_0x511700[_0x42c5('0x101')])>=_0x511700[_0x42c5('0x102')]){this[_0x42c5('0x21')][_0x17af4d['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x17af4d[_0x42c5('0xb5')]][_0x42c5('0x68')]+=0x1;this[_0x42c5('0x21')][_0x17af4d[_0x42c5('0xb5')]][_0x42c5('0x71')]+=0x1;_0x50139f[_0x42c5('0xa6')]=0xa;_0x50139f[_0x42c5('0xa7')]=_0x42c5('0x103');_0x50139f[_0x42c5('0x104')]='TIMEOUT';_0x50139f[_0x42c5('0xf8')]=this[_0x42c5('0x21')][_0x17af4d[_0x42c5('0xb5')]]['dialQueueProject2']?moment()[_0x42c5('0x7b')](_0x42c5('0xfb')):undefined;this[_0x42c5('0x105')](_0x50139f);}else{this[_0x42c5('0x21')][_0x17af4d['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0x42c5('0x21')][_0x17af4d['queue']][_0x42c5('0x106')]+=0x1;_0x50139f[_0x42c5('0xa6')]=0xb;_0x50139f[_0x42c5('0xa7')]='Abandoned';_0x50139f[_0x42c5('0x104')]='CALLEREXIT';this['queueCallerAbandonCreateState'](_0x50139f);}}}};Dialer['prototype'][_0x42c5('0x38')]=function(_0x4d316b){if(this[_0x42c5('0x107')][_0x4d316b[_0x42c5('0xde')]]){this[_0x42c5('0x107')][_0x4d316b[_0x42c5('0xde')]][_0x42c5('0xb2')]=_0x4d316b[_0x42c5('0xb2')];}if(this[_0x42c5('0xaa')][_0x4d316b[_0x42c5('0xde')]]){this[_0x42c5('0xaa')][_0x4d316b[_0x42c5('0xde')]][_0x42c5('0xb2')]=_0x4d316b['channel'];}};Dialer[_0x42c5('0xa9')][_0x42c5('0x3c')]=function(_0x43631a){if(strategy[this[_0x42c5('0x21')][this['actions'][_0x43631a[_0x42c5('0x108')]][_0x42c5('0xb5')]][_0x42c5('0x52')]]==='roundrobin'){if(this[_0x42c5('0x107')][_0x43631a[_0x42c5('0x108')]]&&_['isNil'](this[_0x42c5('0x107')][_0x43631a[_0x42c5('0x108')]][_0x42c5('0x109')])&&_0x43631a['status']==='1'&&_0x43631a[_0x42c5('0x10a')]==='0'){if(this['agents'][_0x43631a[_0x42c5('0x10b')]]){if(!this[_0x42c5('0x23')][_0x43631a[_0x42c5('0x10b')]]['locked']){this[_0x42c5('0x23')][_0x43631a[_0x42c5('0x10b')]]['locked']=!![];this[_0x42c5('0x107')][_0x43631a['actionid']][_0x42c5('0x109')]=!![];this['actions'][_0x43631a['actionid']]['stateinterface']=_0x43631a[_0x42c5('0x10b')];}}}}else if((strategy[this[_0x42c5('0x21')][this['actions'][_0x43631a[_0x42c5('0x108')]]['queue']][_0x42c5('0x52')]]||'rrmemory')===_0x42c5('0x1b')){if(this[_0x42c5('0x107')][_0x43631a['actionid']]){if(this[_0x42c5('0x23')][_0x43631a[_0x42c5('0x10b')]]){this['actions'][_0x43631a[_0x42c5('0x108')]][_0x42c5('0x10b')]=_0x43631a['stateinterface'];if(_[_0x42c5('0xaf')](this[_0x42c5('0x10c')][this[_0x42c5('0x107')][_0x43631a[_0x42c5('0x108')]]['queue']])){this[_0x42c5('0x10c')][this[_0x42c5('0x107')][_0x43631a[_0x42c5('0x108')]][_0x42c5('0xb5')]]=[];}this[_0x42c5('0x10c')][this['actions'][_0x43631a['actionid']]['queue']]['push'](_['merge'](_[_0x42c5('0xce')](this['actions'][_0x43631a['actionid']],[_0x42c5('0x10d'),_0x42c5('0x10b')]),{'status':_0x43631a[_0x42c5('0xb1')],'paused':_0x43631a['paused']}));}}}};function unlockQueueStatus(_0x3d0722,_0x4c0607){setTimeout(function(){if(_[_0x42c5('0x40')](_0x3d0722[_0x42c5('0x10e')])){loggerBooked[_0x42c5('0x96')](_0x42c5('0x10f'),_0x4c0607);}_0x3d0722[_0x42c5('0x10e')]=!![];loggerBooked[_0x42c5('0x81')]('[booked][unlockQueueStatus]',_0x4c0607,JSON[_0x42c5('0x7a')](_[_0x42c5('0xce')](_0x3d0722,[_0x42c5('0x43'),_0x42c5('0x10e')])));},0x1f3);}Dialer[_0x42c5('0xa9')][_0x42c5('0x3d')]=function(_0xdd5ce9){var _0x13fc2f=this;var _0x250a26=_0x13fc2f[_0x42c5('0x21')][_0x13fc2f[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]];if(strategy[this[_0x42c5('0x21')][this[_0x42c5('0x107')][_0xdd5ce9['actionid']][_0x42c5('0xb5')]][_0x42c5('0x52')]]==='roundrobin'){if(this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]]&&this['actions'][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0x10b')]){this[_0x42c5('0x20')][_0x42c5('0x110')](this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0x10d')],this[_0x42c5('0x107')][_0xdd5ce9['actionid']][_0x42c5('0x10b')])[_0x42c5('0xbc')](function(_0x5efeb0){logger[_0x42c5('0x96')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x42c5('0x95')](_0x5efeb0,{'showHidden':![],'depth':null}));})[_0x42c5('0x1e')](function(){_0x13fc2f['updateOriginated'](_0x13fc2f[_0x42c5('0x21')][_0x13fc2f[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]]);_0x13fc2f[_0x42c5('0x23')][_0x13fc2f[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0x10b')]]['locked']=![];delete _0x13fc2f['actions'][_0xdd5ce9['actionid']];unlockQueueStatus(_0x250a26);});}else{this[_0x42c5('0xb4')](this[_0x42c5('0x21')][this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]]);this[_0x42c5('0xc1')]({'active':![],'ContactId':this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]]['ContactId'],'ListId':this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xcf')],'VoiceQueueId':this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xd0')]||undefined,'CampaignId':this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]]['CampaignId']||undefined})[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x111')));delete this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]];unlockQueueStatus(_0x250a26);}}else if((strategy[this[_0x42c5('0x21')][this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]]['strategy']]||'rrmemory')===_0x42c5('0x1b')){var _0x4704ea;if(this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]]&&!_[_0x42c5('0x4a')](this['queueBooked'][this['actions'][_0xdd5ce9['actionid']][_0x42c5('0xb5')]])){if(this['queueBookedRR'][_0x13fc2f[_0x42c5('0x107')][_0xdd5ce9['actionid']][_0x42c5('0xb5')]]){this[_0x42c5('0x2c')][_0x13fc2f[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]]['queue']]=this[_0x42c5('0x2c')][this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]]?this[_0x42c5('0x2c')][this[_0x42c5('0x107')][_0xdd5ce9['actionid']][_0x42c5('0xb5')]]:this[_0x42c5('0x10c')][this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]]?this[_0x42c5('0x10c')][this[_0x42c5('0x107')][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]][_0x42c5('0x112')]||0x0:0x0;}this[_0x42c5('0x10c')][this['actions'][_0xdd5ce9[_0x42c5('0x108')]][_0x42c5('0xb5')]][_0x42c5('0x112')]=this[_0x42c5('0x2c')][this[_0x42c5('0x107')][_0xdd5ce9['actionid']][_0x42c5('0xb5')]];for(var _0x5bee29=0x0;_0x5bee29=0x0?!![]:![];})[_0x42c5('0xbc')](myreject(_0x40ccc0)));}}else{_0x5bb814[_0x42c5('0x12a')](ami[_0x42c5('0xb0')]({'action':_0x42c5('0x12b'),'command':util[_0x42c5('0x7b')](_0x42c5('0x12c'),_0x193be2,!_[_0x42c5('0x40')](config[_0x42c5('0x127')][_0x447db6])?_0x447db6:'')})[_0x42c5('0xb9')](function(_0x4472e6){return _0x4472e6[_0x42c5('0x12e')]['indexOf'](_0x42c5('0x130'))>=0x0?!![]:![];})[_0x42c5('0xbc')](myreject(_0x40ccc0)));}BPromise[_0x42c5('0x131')](_0x5bb814)[_0x42c5('0xb9')](function(_0x4ad94e){var _0x48b8eb=_[_0x42c5('0x132')](_0x4ad94e);if(_0x48b8eb){return _0x2588d3(_0x48b8eb);}else{_0x4877f5[_0x42c5('0x41')]=_0x4d3a99?'GLOBAL_INTERVAL_IS_OVERTIME':_0x42c5('0x133');return _0x40ccc0(msgResponse(_0x42c5('0x134'),_0x42c5('0x123'),'Global:\x20'+_0x4d3a99+'\x20'+_0x1a0912+_0x42c5('0x135')+util[_0x42c5('0x95')](_0x193be2,{'showHidden':![],'depth':null})+_0x42c5('0x136')+_0x447db6));}})[_0x42c5('0xbc')](function(_0x55749a){return _0x40ccc0(msgResponse('ifTime','Failure',JSON[_0x42c5('0x7a')](_0x55749a)));});});};Dialer[_0x42c5('0xa9')][_0x42c5('0x137')]=function(_0x325b19){var _0x47defb=this;return function(){switch(_0x325b19[_0x42c5('0x60')]){case _0x42c5('0x138'):freeVariablesPredictive(_0x325b19);_0x47defb[_0x42c5('0x139')](_0x325b19,0x1);break;case _0x42c5('0x13a'):freeVariablesPredictive(_0x325b19);_0x47defb[_0x42c5('0x139')](_0x325b19,_0x325b19[_0x42c5('0x13b')]);break;case _0x42c5('0x8'):_0x47defb[_0x42c5('0x8')](_0x325b19);break;case'booked':freeVariablesPredictive(_0x325b19);_0x47defb[_0x42c5('0x139')](_0x325b19,0x1);break;default:freeVariablesPredictive(_0x325b19);logger['error'](_0x42c5('0x13c'),_0x325b19[_0x42c5('0x43')],_0x42c5('0x13d'));}};};Dialer[_0x42c5('0xa9')][_0x42c5('0x13e')]=function(_0x15576e){var _0x6bc478=this;return function(){_0x6bc478[_0x42c5('0x13f')](_0x15576e);};};Dialer[_0x42c5('0xa9')][_0x42c5('0x9')]=function(_0x2b4352){var _0x4e1341=this;if(isNotPreview(_0x2b4352[_0x42c5('0x60')])){if(isVoiceQueueOutbound(_0x2b4352[_0x42c5('0x50')])&&isActive(_0x2b4352[_0x42c5('0x5f')])){_0x2b4352[_0x42c5('0x9f')]=!![];BPromise[_0x42c5('0xb8')]()[_0x42c5('0xb9')](checkIsLoggedIn(_0x2b4352,_0x2b4352['loggedIn']))[_0x42c5('0xb9')](checkIsActive(_0x2b4352,_0x2b4352[_0x42c5('0x5f')]))['then'](checkInterval(_0x2b4352))[_0x42c5('0xb9')](_0x4e1341[_0x42c5('0x11e')](_0x2b4352))[_0x42c5('0xb9')](_0x4e1341[_0x42c5('0x140')](_0x2b4352[_0x42c5('0x141')],_0x2b4352[_0x42c5('0x142')],_0x2b4352[_0x42c5('0x43')],_0x2b4352))[_0x42c5('0xb9')](_0x4e1341[_0x42c5('0x122')](_0x2b4352[_0x42c5('0x46')],_0x2b4352['dialTimezone'],_0x2b4352[_0x42c5('0x43')],_0x2b4352))['then'](_0x4e1341['checkDialMethod'](_0x2b4352))[_0x42c5('0xbc')](loggerCatchQueueSummary(_0x42c5('0x143'),_0x2b4352));}else{notSendMessagesQueue(_0x2b4352);}}else{freeVariablesPredictive(_0x2b4352);}};Dialer[_0x42c5('0xa9')][_0x42c5('0x144')]=function(){var _0x508c56=this;var _0x27e0de;for(var _0x10d1cb in this[_0x42c5('0x22')]){if(this[_0x42c5('0x22')][_0x42c5('0xad')](_0x10d1cb)){_0x27e0de=this[_0x42c5('0x22')][_0x10d1cb];if(isCampaignIvr(_0x27e0de[_0x42c5('0x50')])&&isActive(_0x27e0de[_0x42c5('0x78')])){_0x27e0de[_0x42c5('0x9f')]=!![];BPromise[_0x42c5('0xb8')]()[_0x42c5('0xb9')](checkIsActive(_0x27e0de,_0x27e0de[_0x42c5('0x78')]))[_0x42c5('0xb9')](checkInterval(_0x27e0de))[_0x42c5('0xb9')](_0x508c56['checkIsTrunkReachable'](_0x27e0de))[_0x42c5('0xb9')](_0x508c56['checkIfTime'](_0x27e0de[_0x42c5('0x141')],_0x27e0de['dialTimezone'],_0x27e0de['name'],_0x27e0de))['then'](_0x508c56['checkIfTimeIntervals'](_0x27e0de[_0x42c5('0x46')],_0x27e0de['dialTimezone'],_0x27e0de[_0x42c5('0x43')],_0x27e0de))[_0x42c5('0xb9')](_0x508c56['launchHandleIvr'](_0x27e0de))[_0x42c5('0xbc')](loggerCatchQueueSummary(_0x42c5('0x145'),_0x27e0de));}else{notSendMessagesCampaign(_0x27e0de);}}}};function getCallerIdRandom(_0x1fad06,_0x46d4aa){var _0x8b61cd,_0x27081c,_0x45d52a;if(_0x46d4aa<=0x0){_0x46d4aa=0x1;}_0x8b61cd=new RegExp('\x5cw{0,'+_0x46d4aa+'}$');_0x27081c=Math[_0x42c5('0x146')](0xa,_0x46d4aa-0x1);_0x45d52a=Math[_0x42c5('0x146')](0xa,_0x46d4aa)-0x1;return util[_0x42c5('0x7b')]('%s',_[_0x42c5('0x147')](_0x1fad06,_0x8b61cd,_[_0x42c5('0x148')](_0x27081c,_0x45d52a)));}function extractCalleridName(_0x3e65ec){var _0x23298d=_0x3e65ec[_0x42c5('0x149')](/"(.*?)"/);return _0x23298d?_0x23298d[0x1]:_0x3e65ec;}function extractCalleridNumber(_0x5cb60c){var _0x15d399=_0x5cb60c[_0x42c5('0x149')](/<(.*?)>/);return _0x15d399?_0x15d399[0x1]:_0x5cb60c;}Dialer['prototype']['actionOriginate']=function(_0x27a59a,_0x121c88){var _0x535f27=this;var _0x3c1fda=uuid['v4']();this[_0x42c5('0x107')][_0x3c1fda]=new Action(_0x27a59a,_0x121c88,_0x3c1fda);return new BPromise(function(_0x218e31,_0x242b2a){if(_[_0x42c5('0x40')](_0x27a59a)&&'object'!==typeof _0x27a59a){return _0x242b2a(msgResponse(_0x42c5('0x14a'),_0x42c5('0x123'),_0x42c5('0x14b')));}if(_['isUndefined'](_0x121c88[_0x42c5('0x14c')][_0x42c5('0x14d')])||_0x121c88[_0x42c5('0x14c')][_0x42c5('0x14d')]===null){return _0x242b2a(msgResponse('originate',_0x42c5('0x123'),_0x42c5('0x14e')));}var _0x41ef27={'XMD-CALLERID':_0x535f27[_0x42c5('0x107')][_0x3c1fda][_0x42c5('0x14f')](),'XMD-AGI':_0x27a59a[_0x42c5('0xf1')]?util['format'](_0x42c5('0x150'),ipAgi,_0x27a59a[_0x42c5('0xf1')]):_0x42c5('0x151'),'XMD-AGIAFTER':_0x27a59a[_0x42c5('0xf9')]?util['format'](_0x42c5('0x150'),ipAgi,_0x27a59a['dialQueueProject2']):_0x42c5('0x151'),'XMD-QUEUE':_0x27a59a[_0x42c5('0x50')]===_0x42c5('0x51')?util[_0x42c5('0x7b')](_0x42c5('0x152'),_0x27a59a[_0x42c5('0x43')],_0x27a59a[_0x42c5('0x153')]||'',_0x27a59a['dialAgiAfterHangupAgent']?'c':'',_0x27a59a[_0x42c5('0x102')]||0x3):_0x42c5('0x151'),'XMD-CONTACTID':_0x121c88['ContactId'],'XMD-CDRTYPE':_0x42c5('0x7'),'CALLERID(all)':_0x535f27[_0x42c5('0x107')][_0x3c1fda]['getCaller'](),'XMD-AMD':_0x27a59a['dialAMDActive']?_0x42c5('0x154'):_0x42c5('0x151'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x27a59a[_0x42c5('0xdb')]){_0x41ef27['XMD-AMDINITIALSILENCE']=_0x27a59a[_0x42c5('0x155')]||0x9c4;_0x41ef27[_0x42c5('0x156')]=_0x27a59a[_0x42c5('0x157')]||0x5dc;_0x41ef27['XMD-AMDAFTERGREETINGSILENCE']=_0x27a59a[_0x42c5('0x158')]||0x320;_0x41ef27[_0x42c5('0x159')]=_0x27a59a[_0x42c5('0x15a')]||0x1388;_0x41ef27[_0x42c5('0x15b')]=_0x27a59a[_0x42c5('0x15c')]||0x64;_0x41ef27[_0x42c5('0x15d')]=_0x27a59a[_0x42c5('0x15e')]||0x32;_0x41ef27[_0x42c5('0x15f')]=_0x27a59a['dialAMDMaximumNumberOfWords']||0x3;_0x41ef27[_0x42c5('0x160')]=_0x27a59a[_0x42c5('0x161')]||0x100;_0x41ef27[_0x42c5('0x162')]=_0x27a59a[_0x42c5('0x163')]||0x1388;}if(_0x27a59a[_0x42c5('0x50')]===_0x42c5('0x51')){_0x41ef27[_0x42c5('0x164')]=_0x121c88[_0x42c5('0xd0')];}else{_0x41ef27[_0x42c5('0x165')]=_0x121c88[_0x42c5('0xd1')];}for(var _0x249d0d in _0x121c88[_0x42c5('0x14c')]){if(_0x121c88[_0x42c5('0x14c')]['hasOwnProperty'](_0x249d0d)){if(isNotNull(_0x121c88[_0x42c5('0x14c')][_0x249d0d])&&_0x249d0d!=='id'&&_0x249d0d!==_0x42c5('0x166')&&_0x249d0d!==_0x42c5('0x167')&&_0x249d0d!==_0x42c5('0x168')){_0x41ef27[util[_0x42c5('0x7b')]('%s%s','XMD-',_['toUpper'](_0x249d0d))]=_0x121c88[_0x42c5('0x14c')][_0x249d0d];}}}var _0x2d3817=_0x535f27[_0x42c5('0xd5')](_0x27a59a['Trunk'])?getCallerId(_0x27a59a[_0x42c5('0x77')][_0x42c5('0x79')],_0x27a59a[_0x42c5('0x61')],_0x27a59a[_0x42c5('0x169')]>0x0?getCallerIdRandom(_0x27a59a[_0x42c5('0x62')],_0x27a59a[_0x42c5('0x169')]):_0x27a59a['dialOriginateCallerIdNumber']):getCallerId(_[_0x42c5('0xaf')](_0x27a59a['TrunkBackup'])?_0x27a59a[_0x42c5('0x77')][_0x42c5('0x79')]:_0x27a59a[_0x42c5('0x11f')][_0x42c5('0x79')],_0x27a59a[_0x42c5('0x61')],_0x27a59a[_0x42c5('0x169')]>0x0?getCallerIdRandom(_0x27a59a[_0x42c5('0x62')],_0x27a59a['dialRandomLastDigitCallerIdNumber']):_0x27a59a[_0x42c5('0x62')]);if(_0x2d3817){_0x41ef27[_0x42c5('0x16a')]=_0x535f27[_0x42c5('0x107')][_0x3c1fda][_0x42c5('0x16b')]=extractCalleridName(_0x2d3817);_0x41ef27[_0x42c5('0x16c')]=_0x535f27[_0x42c5('0x107')][_0x3c1fda][_0x42c5('0x16d')]=extractCalleridNumber(_0x2d3817);}return ami[_0x42c5('0xb0')]({'actionid':_0x3c1fda,'action':_0x42c5('0x14a'),'channel':_0x535f27[_0x42c5('0xd5')](_0x27a59a[_0x42c5('0x77')])?util[_0x42c5('0x7b')](_0x42c5('0x16e'),_0x27a59a[_0x42c5('0x77')][_0x42c5('0x43')],isNotNull(_0x27a59a['dialPrefix'])?_0x27a59a[_0x42c5('0x64')]['trim']()||'':'',_0x27a59a[_0x42c5('0x16f')]>0x0?_0x121c88['Contact'][_0x42c5('0x14d')][_0x42c5('0x170')](_0x27a59a[_0x42c5('0x16f')]):_0x121c88[_0x42c5('0x14c')][_0x42c5('0x14d')]):util[_0x42c5('0x7b')](_0x42c5('0x16e'),_[_0x42c5('0xaf')](_0x27a59a[_0x42c5('0x11f')])?_0x27a59a['Trunk'][_0x42c5('0x43')]:_0x27a59a[_0x42c5('0x11f')][_0x42c5('0x43')],isNotNull(_0x27a59a[_0x42c5('0x64')])?_0x27a59a[_0x42c5('0x64')][_0x42c5('0x171')]()||'':'',_0x27a59a[_0x42c5('0x16f')]>0x0?_0x121c88[_0x42c5('0x14c')][_0x42c5('0x14d')][_0x42c5('0x170')](_0x27a59a[_0x42c5('0x16f')]):_0x121c88[_0x42c5('0x14c')][_0x42c5('0x14d')]),'callerid':_0x2d3817,'Exten':_0x42c5('0xda'),'Context':'from-sip','Priority':'1','variable':_0x41ef27,'timeout':(_0x27a59a[_0x42c5('0x63')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3c1fda})[_0x42c5('0xb9')](function(_0x542411){return _0x218e31(_0x542411);})[_0x42c5('0xbc')](function(_0x1eafdd){_0x27a59a[_0x42c5('0x172')]+=0x1;var _0x30e61d=new History(_0x535f27[_0x42c5('0x107')][_0x3c1fda]);logger[_0x42c5('0x96')](util[_0x42c5('0x7b')](_0x42c5('0x173'),JSON[_0x42c5('0x7a')](_0x1eafdd)));_0x30e61d[_0x42c5('0xa6')]=0xe;_0x30e61d['statedesc']='OriginateError';_0x30e61d[_0x42c5('0xa8')]=moment()[_0x42c5('0x7b')](_0x42c5('0xfb'));_0x30e61d[_0x42c5('0x174')]=_0x30e61d[_0x42c5('0xa8')];_0x535f27[_0x42c5('0xc8')](_0x30e61d)[_0x42c5('0xbc')](loggerCatch('[originate][error]'));_0x535f27[_0x42c5('0xc7')](_0x30e61d)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x175')))[_0x42c5('0x1e')](function(){delete _0x535f27[_0x42c5('0x107')][_0x3c1fda];return _0x242b2a(msgResponse(_0x42c5('0x14a'),_0x42c5('0x4c'),_0x42c5('0x176')));});});});};Dialer[_0x42c5('0xa9')][_0x42c5('0x31')]=function(_0x13d0d7){var _0x18b4e6=this[_0x42c5('0x107')][_0x13d0d7[_0x42c5('0x108')]];var _0x44d348=this;if(_0x18b4e6){delete this['actions'][_0x13d0d7[_0x42c5('0x108')]];_0x18b4e6[_0x42c5('0x101')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x188481=_0x18b4e6[_0x42c5('0x50')]===_0x42c5('0x7e')?this[_0x42c5('0x22')][_0x18b4e6[_0x42c5('0xb5')]]:this[_0x42c5('0x21')][_0x18b4e6[_0x42c5('0x177')]()];if(!this['isSuccess'](_0x13d0d7[_0x42c5('0x178')])){this[_0x42c5('0xb4')](_0x188481);return this[_0x42c5('0x179')](_0x18b4e6,_0x188481,_0x13d0d7)[_0x42c5('0xb9')](function(_0x4544a7){})['catch'](loggerCatch('[callProgressDetecting]\x20'));}else{this[_0x42c5('0xaa')][_0x13d0d7[_0x42c5('0xde')]]=_0x18b4e6;}}};Dialer[_0x42c5('0xa9')]['checkRetriveMax']=function(_0x235b8c,_0x1f5bba,_0x4b3394){var _0x5b753b=new History(_0x1f5bba);if(_0x5b753b[_0x42c5('0x17a')]+_0x5b753b[_0x42c5('0x17b')]+_0x5b753b[_0x42c5('0x17c')]>=_0x4b3394[_0x42c5('0x17d')]-0x1){return!![];}switch(_0x235b8c){case 0x3:if(_0x5b753b[_0x42c5('0x17c')]>=_0x4b3394['dialNoAnswerMaxRetry']-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x5b753b['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x42c5('0x17e')](_0x4b3394[_0x42c5('0x17f')],_0x42c5('0x180'))['format'](_0x42c5('0xfb')),'ContactId':_0x5b753b['ContactId'],'ListId':_0x5b753b[_0x42c5('0xcf')],'VoiceQueueId':_0x5b753b[_0x42c5('0xd0')]||undefined,'CampaignId':_0x5b753b[_0x42c5('0xd1')]||undefined})[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x181')));}break;case 0x5:if(_0x5b753b[_0x42c5('0x17a')]>=_0x4b3394['dialBusyMaxRetry']-0x1){return!![];}else{this[_0x42c5('0xc1')]({'active':![],'countbusyretry':_0x5b753b[_0x42c5('0x17a')]+=0x1,'scheduledat':moment()[_0x42c5('0x17e')](_0x4b3394[_0x42c5('0x182')],_0x42c5('0x180'))[_0x42c5('0x7b')](_0x42c5('0xfb')),'ContactId':_0x5b753b['ContactId'],'ListId':_0x5b753b[_0x42c5('0xcf')],'VoiceQueueId':_0x5b753b[_0x42c5('0xd0')]||undefined,'CampaignId':_0x5b753b[_0x42c5('0xd1')]||undefined})['catch'](loggerCatch(_0x42c5('0x183')));}break;case 0x8:if(_0x5b753b[_0x42c5('0x17b')]>=_0x4b3394[_0x42c5('0x184')]-0x1){return!![];}else{this[_0x42c5('0xc1')]({'active':![],'countcongestionretry':_0x5b753b[_0x42c5('0x17b')]+=0x1,'scheduledat':moment()[_0x42c5('0x17e')](_0x4b3394[_0x42c5('0x185')],_0x42c5('0x180'))[_0x42c5('0x7b')](_0x42c5('0xfb')),'ContactId':_0x5b753b[_0x42c5('0x11a')],'ListId':_0x5b753b[_0x42c5('0xcf')],'VoiceQueueId':_0x5b753b['VoiceQueueId']||undefined,'CampaignId':_0x5b753b[_0x42c5('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0x42c5('0xa9')]['callProgressDetecting']=function(_0x3fd8fb,_0x10edf2,_0x44ef9b){var _0x5d6a85=this;var _0x4047bc=new History(_0x3fd8fb);return new BPromise(function(_0x3bb9e4,_0x372ce4){if(_[_0x42c5('0x40')](_0x10edf2)&&_0x42c5('0x186')!==typeof _0x10edf2){return _0x372ce4(msgResponse('[callProgressDetecting]',_0x42c5('0x123'),_0x42c5('0x187')));}if(_[_0x42c5('0x40')](_0x44ef9b)&&'object'!==typeof _0x44ef9b){return _0x372ce4(msgResponse(_0x42c5('0x188'),'Failure','evt\x20is\x20undefine'));}switch(_0x44ef9b[_0x42c5('0xf7')]){case'0':_0x10edf2['outboundNoSuchCallsDay']+=0x1;_0x4047bc[_0x42c5('0xa6')]=0x0;_0x4047bc[_0x42c5('0xa7')]=_0x42c5('0x189');_0x5d6a85[_0x42c5('0xc8')](_0x4047bc)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x18a')));if(_0x5d6a85[_0x42c5('0x18b')](0x0,_0x3fd8fb,_0x10edf2)){if(_0x4047bc[_0x42c5('0x17a')]+_0x4047bc[_0x42c5('0x17b')]+_0x4047bc[_0x42c5('0x17c')]>=_0x10edf2[_0x42c5('0x17d')]){_0x5d6a85['stateGlobal'](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x42c5('0x18c'));}else{_0x5d6a85[_0x42c5('0x18d')](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x42c5('0x18c'));}}break;case'3':_0x10edf2[_0x42c5('0x18e')]+=0x1;_0x4047bc[_0x42c5('0xa6')]=0x3;_0x4047bc[_0x42c5('0xa7')]='NoAnswer';_0x4047bc['countnoanswerretry']+=0x1;_0x4047bc[_0x42c5('0x18f')]+=0x1;_0x5d6a85[_0x42c5('0xc8')](_0x4047bc)[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x190')));if(_0x5d6a85[_0x42c5('0x18b')](0x3,_0x3fd8fb,_0x10edf2)){if(_0x4047bc[_0x42c5('0x17c')]>=_0x10edf2[_0x42c5('0x191')]){_0x5d6a85[_0x42c5('0x18d')](_0x4047bc,_0x3bb9e4,_0x372ce4,'reason\x203\x20ringing\x20no\x20answer');}else{_0x5d6a85[_0x42c5('0x192')](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x42c5('0x193'));}}break;case'5':_0x10edf2[_0x42c5('0x66')]+=0x1;_0x4047bc[_0x42c5('0xa6')]=0x5;_0x4047bc[_0x42c5('0xa7')]='Busy';_0x4047bc[_0x42c5('0x17a')]+=0x1;_0x4047bc[_0x42c5('0x18f')]+=0x1;_0x5d6a85[_0x42c5('0xc8')](_0x4047bc)['catch'](loggerCatch(_0x42c5('0x194')));if(_0x5d6a85['checkRetriveMax'](0x5,_0x3fd8fb,_0x10edf2)){if(_0x4047bc[_0x42c5('0x17a')]>=_0x10edf2[_0x42c5('0x195')]){_0x5d6a85[_0x42c5('0x18d')](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x42c5('0x196'));}else{_0x5d6a85['stateGlobal'](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x42c5('0x196'));}}break;case'8':_0x10edf2[_0x42c5('0x197')]+=0x1;_0x4047bc['state']=0x8;_0x4047bc[_0x42c5('0xa7')]='Congestion';_0x4047bc['countcongestionretry']+=0x1;_0x4047bc[_0x42c5('0x18f')]+=0x1;_0x5d6a85[_0x42c5('0xc8')](_0x4047bc)[_0x42c5('0xbc')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5d6a85[_0x42c5('0x18b')](0x8,_0x3fd8fb,_0x10edf2)){if(_0x4047bc[_0x42c5('0x17b')]>=_0x10edf2['dialCongestionMaxRetry']){_0x5d6a85['createStateFinal'](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x42c5('0x198'));}else{_0x5d6a85[_0x42c5('0x192')](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x42c5('0x198'));}}break;default:_0x10edf2['outboundUnknownCallsDay']+=0x1;_0x4047bc[_0x42c5('0xa6')]=0xc;_0x4047bc[_0x42c5('0xa7')]=_0x44ef9b['reason'];_0x5d6a85[_0x42c5('0xc8')](_0x4047bc)['catch'](loggerCatch(_0x42c5('0x199')));if(_0x5d6a85['checkRetriveMax'](_0x44ef9b[_0x42c5('0xf7')],_0x3fd8fb,_0x10edf2)){if(_0x4047bc[_0x42c5('0x17a')]+_0x4047bc[_0x42c5('0x17b')]+_0x4047bc['countnoanswerretry']>=_0x10edf2[_0x42c5('0x17d')]){_0x5d6a85[_0x42c5('0x192')](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x44ef9b['reason']);}else{_0x5d6a85[_0x42c5('0x18d')](_0x4047bc,_0x3bb9e4,_0x372ce4,_0x44ef9b['reason']);}}}});};Dialer[_0x42c5('0xa9')][_0x42c5('0x192')]=function(_0x27299f,_0x1f6dd3,_0xc2aef8,_0x19aa3b){var _0x2c99ed=new Final(_0x27299f);_0x2c99ed[_0x42c5('0xa6')]=0xf;_0x2c99ed['statedesc']=_0x42c5('0x19a');this[_0x42c5('0x18d')](_0x2c99ed,_0x1f6dd3,_0xc2aef8,_0x19aa3b);};Dialer[_0x42c5('0xa9')]['createStateFinal']=function(_0x5cc8ad,_0x5b36bb,_0x538b0a,_0x2bd5cb){this[_0x42c5('0xc7')](_0x5cc8ad)[_0x42c5('0xb9')](function(_0x2b4958){return _0x5b36bb(msgResponse(_0x42c5('0x188'),_0x42c5('0xd4'),_0x2bd5cb));})[_0x42c5('0xbc')](function(_0x278d9a){return _0x538b0a(msgResponse(_0x42c5('0x19b'),_0x42c5('0x123'),'contact\x20not\x20moved'));});};Dialer['prototype'][_0x42c5('0x8')]=function(_0x5b71d3){var _0x161357=this;var _0x412547=_0x5b71d3['dialPredictiveOptimizationPercentage']/0x64;var _0x3ba917=_0x5b71d3[_0x42c5('0x68')]/(_0x5b71d3[_0x42c5('0x68')]+_0x5b71d3[_0x42c5('0x65')]);var _0x48905d=Math[_0x42c5('0x19c')](_0x5b71d3[_0x42c5('0x73')]*(_0x5b71d3['predictiveIntervalMaxThreshold']/0x64));var _0x495f58=Math[_0x42c5('0x19c')](_0x5b71d3[_0x42c5('0x73')]*(_0x5b71d3[_0x42c5('0x19d')]/0x64));var _0x221989=_0x5b71d3[_0x42c5('0x54')]+_0x5b71d3[_0x42c5('0x5a')];var _0x5608c9=Math[_0x42c5('0x19e')](_0x5b71d3[_0x42c5('0x8c')]*_0x5b71d3['erlangAbandonmentRate']*_0x5b71d3[_0x42c5('0x19f')]*_0x5b71d3[_0x42c5('0x1a0')]);if(_[_0x42c5('0x40')](_0x5b71d3[_0x42c5('0x2a')])){if(!_[_0x42c5('0x40')](_0x5b71d3['startPredictive'])){_0x5b71d3[_0x42c5('0x29')]=undefined;loggerPredictive[_0x42c5('0x96')]('[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0x42c5('0x40')](_0x5b71d3[_0x42c5('0x91')])){loggerPredictive['error'](_0x42c5('0x1a1'),_0x42c5('0x1a2'));clearInterval(_0x5b71d3[_0x42c5('0x91')]);_0x5b71d3['handlePredictive']=undefined;}_0x5b71d3[_0x42c5('0x2a')]=moment()[_0x42c5('0x7b')](_0x42c5('0xfb'));loggerPredictive[_0x42c5('0x81')](_0x5b71d3[_0x42c5('0x43')],_0x42c5('0x1a3'),_0x5b71d3['startProgressive']);this['handlePower'](_0x5b71d3,0x1);}else if(ifInterval(_0x5b71d3[_0x42c5('0x1a4')],_0x5b71d3[_0x42c5('0x2a')])){this[_0x42c5('0x139')](_0x5b71d3,0x1);loggerPredictiveCalls['info'](_0x42c5('0x1a5'),_0x5b71d3['startProgressive'],_0x5b71d3[_0x42c5('0x43')]);_0x5b71d3[_0x42c5('0x8c')]=0x0;_0x5b71d3[_0x42c5('0x71')]=0x0;}else if(_0x412547<_0x3ba917&&_0x5b71d3[_0x42c5('0x1a6')]===_0x42c5('0x1a7')){freeVariablesPredictive(_0x5b71d3);loggerPredictive['info'](_0x42c5('0x1a8'),_0x42c5('0x1a9'),_0x3ba917,_0x42c5('0x2a'),_0x5b71d3[_0x42c5('0x43')]);}else if(_0x5608c9<_0x5b71d3[_0x42c5('0x71')]&&_0x5b71d3[_0x42c5('0x1a6')]==='dropRate'){freeVariablesPredictive(_0x5b71d3);loggerPredictive['info'](_0x42c5('0x1aa'),_0x42c5('0x1ab'),_0x5608c9,'Drop\x20in\x20this\x20interval',_0x5b71d3[_0x42c5('0x71')],'startProgressive',_0x5b71d3[_0x42c5('0x43')]);}else if(!ifInterval(_0x5b71d3[_0x42c5('0x1a4')],_0x5b71d3[_0x42c5('0x2a')])&&_[_0x42c5('0x40')](_0x5b71d3['startPredictive'])&&!_[_0x42c5('0x40')](_0x5b71d3[_0x42c5('0x2a')])){_0x5b71d3[_0x42c5('0x29')]=moment()[_0x42c5('0x7b')](_0x42c5('0xfb'));loggerPredictive[_0x42c5('0x81')](_0x5b71d3[_0x42c5('0x43')],'started\x20in\x20predictive\x20at',_0x5b71d3[_0x42c5('0x29')]);this[_0x42c5('0xc0')](_0x5b71d3[_0x42c5('0x1a4')])[_0x42c5('0xb9')](this[_0x42c5('0x1ac')](_0x5b71d3))[_0x42c5('0xb9')](mergeDataErlangB(_0x5b71d3))['then'](this[_0x42c5('0x1ad')](_0x5b71d3))[_0x42c5('0xbc')](loggerCatchPredictive(_0x42c5('0x1ae'),_0x5b71d3));}else if(!ifInterval(_0x5b71d3['dialPredictiveInterval'],_0x5b71d3[_0x42c5('0x29')])){_0x5b71d3[_0x42c5('0x71')]=0x0;_0x5b71d3[_0x42c5('0x29')]=moment()[_0x42c5('0x7b')](_0x42c5('0xfb'));loggerPredictive['info'](_0x5b71d3[_0x42c5('0x43')],_0x42c5('0x1af'),_0x5b71d3['startPredictive']);clearInterval(_0x5b71d3[_0x42c5('0x91')]);_0x5b71d3['handlePredictive']=undefined;this[_0x42c5('0xc0')](_0x5b71d3['dialPredictiveInterval'])[_0x42c5('0xb9')](this['getDataPredictive'](_0x5b71d3))[_0x42c5('0xb9')](mergeDataErlangB(_0x5b71d3))[_0x42c5('0xb9')](this[_0x42c5('0x1ad')](_0x5b71d3))['catch'](loggerCatchPredictive(_0x42c5('0x1b0'),_0x5b71d3));}else if(_0x5b71d3[_0x42c5('0x73')]&&_0x221989<_0x5b71d3['predictiveIntervalAvailable']-_0x495f58){freeVariablesPredictive(_0x5b71d3);loggerPredictive['info'](_0x5b71d3[_0x42c5('0x43')],_0x42c5('0x1b1'),_0x221989,_0x42c5('0x1b2'),_0x5b71d3[_0x42c5('0x73')],'-',_0x495f58,'=',_0x5b71d3['predictiveIntervalAvailable']-_0x495f58,')');}else if(_0x5b71d3['predictiveIntervalAvailable']&&_0x221989>_0x5b71d3['predictiveIntervalAvailable']+_0x48905d){freeVariablesPredictive(_0x5b71d3);loggerPredictive[_0x42c5('0x81')](_0x5b71d3['name'],_0x42c5('0x1b1'),_0x221989,_0x42c5('0x1b3'),_0x5b71d3[_0x42c5('0x73')],'+',_0x48905d,'=',_0x5b71d3[_0x42c5('0x73')]+_0x48905d,')');}};Dialer[_0x42c5('0xa9')]['getDataPredictive']=function(_0x540943){var _0x11949a=this;return function(_0xae0e56){return new BPromise(function(_0x1d4300,_0x5b28a6){_[_0x42c5('0x1b4')](_0x540943,_0xae0e56[0x0]);if(checkGetDataPredictive(_0xae0e56[0x0])){var _0x2d9cc3=_0x540943[_0x42c5('0x73')]=_0x540943[_0x42c5('0x5a')]+_0x540943[_0x42c5('0x54')];var _0x14fb6f=_0x540943['dialPredictiveInterval']*0x3c;var _0x330ce6=_0xae0e56[0x0][_0x42c5('0x6d')]+_0xae0e56[0x0][_0x42c5('0x6c')];var _0x4e996b=(_0xae0e56[0x0][_0x42c5('0x6b')]+_0xae0e56[0x0][_0x42c5('0x6f')]+_0xae0e56[0x0][_0x42c5('0x6e')])/_0xae0e56[0x0][_0x42c5('0x74')];_0x540943[_0x42c5('0x19f')]=_0x4e996b>0x0?_0x4e996b:0x1;switch(_0x540943[_0x42c5('0x1a6')]){case _0x42c5('0x1a7'):var _0x3afa8f=_0x540943[_0x42c5('0x1b5')]/0x64;return _0x11949a[_0x42c5('0x1b6')](_0x2d9cc3,_0x14fb6f,_0x330ce6,_0x4e996b,_0x3afa8f)[_0x42c5('0xb9')](function(_0x3b1538){return _0x1d4300(_0x3b1538);});case'agentBusyFactor':var _0x41553e=_0x540943[_0x42c5('0x1b5')]/0x64;return _0x11949a[_0x42c5('0x1b7')](_0x2d9cc3,_0x14fb6f,_0x330ce6,_0x4e996b,_0x41553e)[_0x42c5('0xb9')](function(_0x34342e){return _0x1d4300(_0x34342e);});default:return _0x5b28a6(msgResponse(_0x42c5('0x1b8'),_0x42c5('0x123'),_0x42c5('0x1b9')));}}else{return _0x5b28a6(msgResponse('[getDataPredictive]',_0x42c5('0x123'),'check\x20failure'));}});};};Dialer[_0x42c5('0xa9')]['getDataPredictiveOld']=function(_0x344540){var _0x43ad76=this;return function(_0x2acb6e){return new BPromise(function(_0x4919e1,_0x43c882){_[_0x42c5('0x1b4')](_0x344540,_0x2acb6e[0x0]);if(checkGetDataPredictive(_0x2acb6e[0x0])){loggerPredictive['info'](JSON[_0x42c5('0x7a')](_0x2acb6e[0x0]));if(_0x344540[_0x42c5('0x1a6')]==='dropRate'){return _0x43ad76[_0x42c5('0xc6')](_0x344540['id'])[_0x42c5('0xb9')](function(_0x469f7f){var _0x3c093e=_0x344540[_0x42c5('0x55')]-_0x469f7f[0x0][_0x42c5('0x1ba')];var _0x38eaab=_0x344540[_0x42c5('0x1a4')]*0x3c;var _0x2249e8=_0x2acb6e[0x0][_0x42c5('0x6d')]+_0x2acb6e[0x0][_0x42c5('0x6c')];var _0x2966a0=(_0x2acb6e[0x0][_0x42c5('0x6b')]+_0x2acb6e[0x0][_0x42c5('0x6f')]+_0x2acb6e[0x0][_0x42c5('0x6e')])/_0x2acb6e[0x0][_0x42c5('0x74')];var _0x4a1b22=_0x344540[_0x42c5('0x1b5')]/0x64;_0x344540[_0x42c5('0x72')]=_0x469f7f[0x0]['outboundQueuePauses']||0x0;_0x344540[_0x42c5('0x19f')]=_0x2966a0>0x0?_0x2966a0:0x1;return _0x43ad76[_0x42c5('0x1b6')](_0x3c093e,_0x38eaab,_0x2249e8,_0x2966a0,_0x4a1b22);})['then'](function(_0x9283d3){return _0x4919e1(_0x9283d3);})[_0x42c5('0xbc')](function(_0x37517e){return _0x43c882(msgResponse(_0x42c5('0x1bb'),'Failure',JSON[_0x42c5('0x7a')](_0x37517e)));});}if(_0x344540['dialPredictiveOptimization']===_0x42c5('0x1bc')){return _0x43ad76[_0x42c5('0xc6')](_0x344540['id'])[_0x42c5('0xb9')](function(_0x1d4e7a){var _0xfda741=_0x344540['loggedIn']-_0x1d4e7a[0x0]['outboundQueuePauses'];var _0x9512c8=_0x344540[_0x42c5('0x1a4')]*0x3c;var _0xd03bd2=_0x2acb6e[0x0][_0x42c5('0x6d')]+_0x2acb6e[0x0][_0x42c5('0x6c')];var _0x5a5b55=(_0x2acb6e[0x0][_0x42c5('0x6b')]+_0x2acb6e[0x0][_0x42c5('0x6f')]+_0x2acb6e[0x0][_0x42c5('0x6e')])/_0x2acb6e[0x0][_0x42c5('0x74')];var _0x38eb41=_0x344540[_0x42c5('0x1b5')]/0x64;_0x344540[_0x42c5('0x72')]=_0x1d4e7a[0x0][_0x42c5('0x1ba')]||0x0;_0x344540[_0x42c5('0x19f')]=_0x5a5b55>0x0?_0x5a5b55:0x1;return _0x43ad76[_0x42c5('0x1b7')](_0xfda741,_0x9512c8,_0xd03bd2,_0x5a5b55,_0x38eb41);})[_0x42c5('0xb9')](function(_0xe5075a){return _0x4919e1(_0xe5075a);})[_0x42c5('0xbc')](function(_0x42b866){return _0x43c882(msgResponse(_0x42c5('0x1bb'),'Failure',JSON[_0x42c5('0x7a')](_0x42b866)));});}}else{return _0x43c882(msgResponse(_0x42c5('0x1b8'),_0x42c5('0x123'),_0x42c5('0x1bd')));}});};};Dialer['prototype'][_0x42c5('0x1ad')]=function(_0x2cdfe9){var _0x412852=this;return function(){var _0x1d04e8=0x0;var _0x3e7b19=Math['floor'](_0x2cdfe9[_0x42c5('0x1be')]*0x3e8);if(_0x3e7b19>0x0){_0x3e7b19=_0x3e7b19<0x64?0x64:_0x3e7b19;loggerPredictive[_0x42c5('0x81')](_0x2cdfe9[_0x42c5('0x43')],_0x42c5('0x1bf'),_0x3e7b19,_0x42c5('0x4d'));_0x2cdfe9['handlePredictive']=setInterval(function(){_0x412852['handlePredictive'](_0x2cdfe9);loggerPredictiveCalls['info'](_0x42c5('0x1c0'),_0x1d04e8+=0x1);},_0x3e7b19);}else{loggerPredictive[_0x42c5('0x81')](_0x2cdfe9[_0x42c5('0x43')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x42c5('0xa9')][_0x42c5('0x1c1')]=function(_0x284633,_0x50233a){var _0x5b940e=this;return function(_0x426480){if(_['isEmpty'](_0x426480)){if(_[_0x42c5('0xaf')](_0x50233a[_0x42c5('0x1c2')])||!_0x50233a[_0x42c5('0x1c3')]){if(_0x284633[_0x42c5('0x60')]===_0x42c5('0x1c4')){_0x284633[_0x42c5('0x10e')]=_[_0x42c5('0x40')](_0x284633[_0x42c5('0x10e')])?!![]:_0x284633[_0x42c5('0x10e')];var _0x4da029=uuid['v4']();_0x5b940e[_0x42c5('0x107')][_0x4da029]=new Action(_0x284633,_0x50233a,_0x4da029);loggerBooked[_0x42c5('0x81')](_0x42c5('0x1c5'),_0x4da029,_0x42c5('0x1c6'),JSON[_0x42c5('0x7a')](_0x284633[_0x42c5('0x10e')]),_0x42c5('0x1c7'),_0x284633['name']);if(_0x284633[_0x42c5('0x10e')]){_0x284633['queueStatusComplete']=![];_0x5b940e[_0x42c5('0x10c')][_0x5b940e['actions'][_0x4da029]['queue']]=[];ami[_0x42c5('0xb0')]({'actionid':_0x4da029,'action':'queuestatus','queue':_0x284633[_0x42c5('0x43')]})['catch'](function(_0x55fdc6){_0x5b940e['updateOriginated'](_0x284633);_0x5b940e[_0x42c5('0xc1')]({'active':![],'ContactId':_0x5b940e['actions'][_0x4da029][_0x42c5('0x11a')],'ListId':_0x5b940e[_0x42c5('0x107')][_0x4da029][_0x42c5('0xcf')],'VoiceQueueId':_0x5b940e[_0x42c5('0x107')][_0x4da029]['VoiceQueueId']||undefined,'CampaignId':_0x5b940e['actions'][_0x4da029][_0x42c5('0xd1')]||undefined})[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x1c8')));delete _0x5b940e[_0x42c5('0x107')][_0x4da029];});}else{loggerBooked['info'](_0x42c5('0x1c9'),JSON[_0x42c5('0x7a')](_0x284633['queueStatusComplete']),'Queue:\x20',_0x284633['name']);_0x5b940e[_0x42c5('0xb4')](_0x284633);_0x5b940e[_0x42c5('0xc1')]({'active':![],'ContactId':_0x5b940e['actions'][_0x4da029][_0x42c5('0x11a')],'ListId':_0x5b940e[_0x42c5('0x107')][_0x4da029][_0x42c5('0xcf')],'VoiceQueueId':_0x5b940e[_0x42c5('0x107')][_0x4da029][_0x42c5('0xd0')]||undefined,'CampaignId':_0x5b940e[_0x42c5('0x107')][_0x4da029]['CampaignId']||undefined})[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x1c8')));delete _0x5b940e[_0x42c5('0x107')][_0x4da029];}}else{return _0x5b940e['actionOriginate'](_0x284633,_0x50233a);}}else{if(getDiff(_0x50233a[_0x42c5('0x1ca')])<_0x284633[_0x42c5('0x1cb')]*0x3c){_0x5b940e[_0x42c5('0x20')][_0x42c5('0x110')](_0x50233a['id'])[_0x42c5('0x1e')](function(){_0x5b940e[_0x42c5('0xb4')](_0x284633);});}else{_0x284633[_0x42c5('0x1cc')]+=0x1;_0x5b940e[_0x42c5('0xb4')](_0x284633);if(_0x284633[_0x42c5('0x1cd')]){_0x5b940e[_0x42c5('0xc1')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x50233a['ContactId'],'ListId':_0x50233a[_0x42c5('0xcf')],'VoiceQueueId':_0x50233a[_0x42c5('0xd0')]||undefined,'CampaignId':_0x50233a['CampaignId']||undefined})['catch'](loggerCatch(_0x42c5('0x1ce')));_0x5b940e[_0x42c5('0xc8')](createObjHistory(_0x284633,_0x50233a,'RECALLINQUEUE',0x17,_0x42c5('0x1cf')))[_0x42c5('0xbc')](loggerCatch(_0x42c5('0x1d0')));}else{_0x5b940e[_0x42c5('0xcd')](createObjHistory(_0x284633,_0x50233a,_0x42c5('0x1d1'),0x16,_0x42c5('0x1d2')),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x284633[_0x42c5('0x1d3')]+=0x1;_0x5b940e['saveInDb'](createObjHistory(_0x284633,_0x50233a,_0x42c5('0x1d4'),0xd,_0x42c5('0x1d5')),'[Originate][historyBlacklist]',_0x42c5('0x1d6'));throw _0x42c5('0x1d7');}};};Dialer['prototype'][_0x42c5('0x13f')]=function(_0x4a48ea){var _0x24ac53=this;var _0x25b3ac=[];var _0x2fbe35=_0x4a48ea[_0x42c5('0x1d8')]-_0x4a48ea[_0x42c5('0x75')]-_0x4a48ea[_0x42c5('0x1d9')];emitCampaignSummary(_0x4a48ea);if(_0x2fbe35>0x0){if(_0x2fbe35>this[_0x42c5('0x25')]){_0x2fbe35=this[_0x42c5('0x25')];}_0x4a48ea[_0x42c5('0x1d9')]+=_0x2fbe35;this[_0x42c5('0xc4')](_0x4a48ea['id'],_0x2fbe35,_0x4a48ea[_0x42c5('0x1da')])[_0x42c5('0xb9')](function(_0x3c7d14){_0x4a48ea[_0x42c5('0x1d9')]-=_0x2fbe35;_0x4a48ea[_0x42c5('0x1d9')]=_0x4a48ea['temp']>0x0?_0x4a48ea['temp']:0x0;if(!checkContactEmpty(_0x3c7d14)){_0x4a48ea[_0x42c5('0x41')]=_0x42c5('0x9e');logger['info']('[getContactCampaign2][Empty]'+_0x4a48ea[_0x42c5('0x43')]);}else{_0x4a48ea[_0x42c5('0x75')]+=_0x3c7d14[_0x42c5('0x98')];_0x4a48ea[_0x42c5('0x41')]=_0x42c5('0x1db');for(var _0x4b24b3=0x0;_0x4b24b3<_0x3c7d14[_0x42c5('0x98')];_0x4b24b3+=0x1){_0x4a48ea['ivrTotalCallsDays']+=0x1;if(_[_0x42c5('0xaf')](_0x3c7d14[_0x4b24b3])||_[_0x42c5('0xaf')](_0x3c7d14[_0x4b24b3][_0x42c5('0x14c')])||_[_0x42c5('0xaf')](_0x3c7d14[_0x4b24b3]['Contact'][_0x42c5('0x14d')])){_0x24ac53[_0x42c5('0xcc')]('[actionOriginate]\x20',_0x4a48ea,_0x3c7d14[_0x4b24b3]);}else{_0x24ac53['checkIsBlackListIvr'](_[_0x42c5('0xce')](_0x3c7d14[_0x4b24b3],[_0x42c5('0xd1'),_0x42c5('0x1dc')]))[_0x42c5('0xb9')](_0x24ac53[_0x42c5('0x1c1')](_0x4a48ea,_0x3c7d14[_0x4b24b3]))[_0x42c5('0xbc')](_0x24ac53[_0x42c5('0xcb')]('[actionOriginateIvr]\x20',_0x4a48ea));}}}})[_0x42c5('0xbc')](loggerGetContactDialer(_0x42c5('0x1dd'),_0x4a48ea,_0x2fbe35));}};Dialer[_0x42c5('0xa9')][_0x42c5('0x139')]=function(_0x4ea4eb,_0x206b94){var _0x2f0081=this;var _0x525fdf=[];var _0x831269=_0x206b94>=0x1?_0x206b94:0x1;var _0x190779=[];if(_0x4ea4eb['dialMethod']===_0x42c5('0x1c4')){_0x831269=0x1;}var _0x3c33f9=Math[_0x42c5('0x19e')](_0x4ea4eb[_0x42c5('0x54')]*_0x831269)-_0x4ea4eb['originated']-_0x4ea4eb[_0x42c5('0x1d9')];emitVoiceQueueSummary(_0x4ea4eb);if(_0x4ea4eb['dialLimitQueue']>0x0){var _0x204e98=_0x4ea4eb[_0x42c5('0x1de')]-_0x4ea4eb['originated']-_0x4ea4eb[_0x42c5('0x5a')]-_0x4ea4eb[_0x42c5('0x1d9')]-_0x4ea4eb[_0x42c5('0x56')];if(_0x3c33f9>_0x204e98){_0x3c33f9=_0x204e98;}}if(_0x3c33f9>0x0){if(_0x4ea4eb[_0x42c5('0x60')]===_0x42c5('0x1c4')){_0x3c33f9=0x1;}if(_0x3c33f9>this[_0x42c5('0x25')]){_0x3c33f9=this[_0x42c5('0x25')];}_0x4ea4eb[_0x42c5('0x1d9')]+=_0x3c33f9;for(var _0x4fbba8 in this[_0x42c5('0x23')]){if(this[_0x42c5('0x23')]['hasOwnProperty'](_0x4fbba8)){if(this[_0x42c5('0x23')][_0x4fbba8][_0x42c5('0xa6')]===_0x42c5('0x1df')&&this['agents'][_0x4fbba8][_0x42c5('0xb1')]===_0x42c5('0xd7')){_0x525fdf[_0x42c5('0x12a')](this[_0x42c5('0x23')][_0x4fbba8]['id']);}}}this[_0x42c5('0xc3')](_0x4ea4eb['id'],_0x525fdf,_0x3c33f9,_0x4ea4eb[_0x42c5('0x1da')])[_0x42c5('0xb9')](function(_0x2daae3){_0x4ea4eb[_0x42c5('0x1d9')]-=_0x3c33f9;_0x4ea4eb['temp']=_0x4ea4eb[_0x42c5('0x1d9')]>0x0?_0x4ea4eb[_0x42c5('0x1d9')]:0x0;if(!checkContactEmpty(_0x2daae3)){_0x2f0081[_0x42c5('0x1e0')](_0x4ea4eb)[_0x42c5('0xb9')](sendMessageReschedule(_0x4ea4eb))[_0x42c5('0xbc')](loggerCatch(_0x42c5('0xba')));}else{_0x4ea4eb[_0x42c5('0x75')]+=_0x2daae3[_0x42c5('0x98')];_0x4ea4eb['message']=_0x4ea4eb[_0x42c5('0x60')]==='booked'?_0x42c5('0x154'):_0x42c5('0x1db');for(var _0x3f7844=0x0;_0x3f7844<_0x2daae3[_0x42c5('0x98')];_0x3f7844+=0x1){if(_[_0x42c5('0xaf')](_0x2daae3[_0x3f7844])||_[_0x42c5('0xaf')](_0x2daae3[_0x3f7844][_0x42c5('0x14c')])||_[_0x42c5('0xaf')](_0x2daae3[_0x3f7844][_0x42c5('0x14c')][_0x42c5('0x14d')])){_0x2f0081['emptyContact'](_0x42c5('0x1e1'),_0x4ea4eb,_0x2daae3[_0x3f7844]);}else{_0x2f0081[_0x42c5('0xbb')](_[_0x42c5('0xce')](_0x2daae3[_0x3f7844],[_0x42c5('0xd0'),_0x42c5('0x1dc')]))[_0x42c5('0xb9')](_0x2f0081[_0x42c5('0x1c1')](_0x4ea4eb,_0x2daae3[_0x3f7844]))['catch'](_0x2f0081[_0x42c5('0xcb')]('[actionOriginate]\x20',_0x4ea4eb));}}}})['catch'](loggerGetContactDialer(_0x42c5('0x1e2'),_0x4ea4eb,_0x3c33f9));}};Dialer['prototype'][_0x42c5('0x91')]=function(_0x43c516){var _0x5c6002=this;if(_0x43c516[_0x42c5('0x1de')]>0x0){var _0x1f14f4=_0x43c516['dialLimitQueue']-_0x43c516[_0x42c5('0x75')]-_0x43c516[_0x42c5('0x5a')];if(_0x1f14f4>0x0){this[_0x42c5('0x1e3')](_0x43c516);}else{loggerPredictiveCalls[_0x42c5('0x81')](_0x42c5('0x1e4'));}}else{this['tryOriginatePredictive'](_0x43c516);}};Dialer[_0x42c5('0xa9')][_0x42c5('0x1e3')]=function(_0x183e49){var _0x1b351f=this;var _0x5a5939=[];_0x183e49[_0x42c5('0x75')]+=0x1;for(var _0x1498cf in this[_0x42c5('0x23')]){if(this['agents']['hasOwnProperty'](_0x1498cf)){if(this[_0x42c5('0x23')][_0x1498cf][_0x42c5('0xa6')]==='not_inuse'&&this[_0x42c5('0x23')][_0x1498cf][_0x42c5('0xb1')]===_0x42c5('0xd7')){_0x5a5939[_0x42c5('0x12a')](this[_0x42c5('0x23')][_0x1498cf]['id']);}}}this[_0x42c5('0xc3')](_0x183e49['id'],_0x5a5939,0x1,_0x183e49[_0x42c5('0x1da')])[_0x42c5('0xb9')](function(_0x1cf45d){if(!checkContactEmpty(_0x1cf45d)){checkContactLowerLimitOriginate(_0x183e49,0x1,0x0);_0x1b351f['countReScheduled'](_0x183e49)['then'](sendMessageReschedule(_0x183e49))[_0x42c5('0xbc')](loggerCatch('[countReScheduled]\x20'));}else{_0x183e49[_0x42c5('0x41')]=_0x42c5('0x1db');if(_[_0x42c5('0xaf')](_0x1cf45d[0x0])||_[_0x42c5('0xaf')](_0x1cf45d[0x0][_0x42c5('0x14c')])||_[_0x42c5('0xaf')](_0x1cf45d[0x0][_0x42c5('0x14c')][_0x42c5('0x14d')])){_0x1b351f['emptyContact']('[actionOriginate]\x20',_0x183e49,_0x1cf45d[0x0]);}else{_0x1b351f[_0x42c5('0xbb')](_[_0x42c5('0xce')](_0x1cf45d[0x0],[_0x42c5('0xd0'),_0x42c5('0x1dc')]))['then'](_0x1b351f[_0x42c5('0x1c1')](_0x183e49,_0x1cf45d[0x0]))['catch'](_0x1b351f[_0x42c5('0xcb')](_0x42c5('0x1e5'),_0x183e49));}}})[_0x42c5('0xbc')](loggerGetContactDialer(_0x42c5('0x1e6'),_0x183e49,0x1));emitVoiceQueueSummary(_0x183e49);};Dialer[_0x42c5('0xa9')][_0x42c5('0x1b6')]=function(_0x396c87,_0x49ac63,_0x3cfec2,_0x35c4b5,_0x3c10cd,_0x2560c3){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1e7'),_0x396c87);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1e8'),_0x49ac63);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1e9'),_0x3cfec2);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1ea'),_0x35c4b5);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1eb'),_0x3c10cd);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x87'));return new BPromise(function(_0x1c47ad,_0x54f54a){if(_0x396c87<=0x0||isNaN(_0x396c87)){return _0x54f54a(msgResponse(_0x42c5('0x1ec'),'Error','m\x20=\x20'+_0x396c87));}if(_0x3cfec2<=0x0||isNaN(_0x3cfec2)){return _0x54f54a(msgResponse(_0x42c5('0x1ec'),_0x42c5('0x4c'),'Ts\x20=\x20'+_0x3cfec2));}if(_0x35c4b5<=0x0||isNaN(_0x35c4b5)){return _0x54f54a(msgResponse(_0x42c5('0x1ec'),_0x42c5('0x4c'),_0x42c5('0x1ed')+_0x35c4b5));}if(_0x49ac63<=0x0||isNaN(_0x49ac63)){return _0x54f54a(msgResponse(_0x42c5('0x1ec'),'Error',_0x42c5('0x1ee')+_0x49ac63));}if(_0x3c10cd<=0x0||isNaN(_0x3c10cd)){return _0x54f54a(msgResponse(_0x42c5('0x1ec'),_0x42c5('0x4c'),_0x42c5('0x1ef')+_0x3c10cd));}_0x2560c3=_0x2560c3||0x0;var _0x1ae265=0x1/_0x3cfec2;var _0x294d2e=0x0;var _0x52a3d8=0x0;var _0x8bd695=0x0;var _0x58e7cd=0x0;for(var _0xebf3f1=0x0;_0x8bd695<_0x3c10cd;_0xebf3f1+=0x1){_0x52a3d8=_0xebf3f1/_0x49ac63;_0x294d2e=(_0x35c4b5*_0x52a3d8+_0x2560c3)/_0x1ae265;_0x8bd695=erlangb(_0x294d2e,_0x396c87);_0x58e7cd=_0x294d2e/_0x396c87*(0x1-erlangb(_0x294d2e,_0x396c87));}return _0x1c47ad({'erlangCalls':_0xebf3f1,'erlangCallToSecond':_0x49ac63/_0xebf3f1,'erlangAbandonmentRate':_0x8bd695,'erlangBusyFactor':_0x58e7cd});});};Dialer[_0x42c5('0xa9')]['busyFactor']=function(_0x29f17f,_0x4d56b3,_0x353881,_0x2a88a4,_0x1e1beb,_0x35fc84){loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1f0'));loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1e7'),_0x29f17f);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1e8'),_0x4d56b3);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x1e9'),_0x353881);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2a88a4);loggerPredictive['info'](_0x42c5('0x1f1'),_0x1e1beb);loggerPredictive[_0x42c5('0x81')](_0x42c5('0x87'));return new BPromise(function(_0x1b7bd8,_0x2eb863){if(_0x29f17f<=0x0||isNaN(_0x29f17f)){return _0x2eb863(msgResponse(_0x42c5('0x1f2'),_0x42c5('0x4c'),_0x42c5('0x1f3')+_0x29f17f));}if(_0x353881<=0x0||isNaN(_0x353881)){return _0x2eb863(msgResponse('[busyFactor]',_0x42c5('0x4c'),'Ts\x20=\x20'+_0x353881));}if(_0x2a88a4<=0x0||isNaN(_0x2a88a4)){return _0x2eb863(msgResponse(_0x42c5('0x1f2'),'Error','p\x20=\x20'+_0x2a88a4));}if(_0x4d56b3<=0x0||isNaN(_0x4d56b3)){return _0x2eb863(msgResponse('[busyFactor]','Error',_0x42c5('0x1ee')+_0x4d56b3));}if(_0x1e1beb<=0x0||isNaN(_0x1e1beb)){return _0x2eb863(msgResponse('[busyFactor]',_0x42c5('0x4c'),_0x42c5('0x1f4')+_0x1e1beb));}_0x35fc84=_0x35fc84||0x0;var _0x4b7b99=0x1/_0x353881;var _0x3f61eb=0x0;var _0xa6a101=0x0;var _0x14a4e8=0x0;var _0x3a2142=0x0;for(var _0x40b7e8=0x0;_0x3a2142<_0x1e1beb;_0x40b7e8+=0x1){_0xa6a101=_0x40b7e8/_0x4d56b3;_0x3f61eb=(_0x2a88a4*_0xa6a101+_0x35fc84)/_0x4b7b99;_0x14a4e8=erlangb(_0x3f61eb,_0x29f17f);_0x3a2142=_0x3f61eb/_0x29f17f*(0x1-erlangb(_0x3f61eb,_0x29f17f));}return _0x1b7bd8({'erlangCalls':_0x40b7e8,'erlangCallToSecond':_0x4d56b3/_0x40b7e8,'erlangAbandonmentRate':_0x14a4e8,'erlangBusyFactor':_0x3a2142});});};module['exports']=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 47060ac..71e6289 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7974=['exports','util','lodash','moment','milliseconds','diff','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7974,0xe5));var _0x4797=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7974[_0x288f5e];return _0x476cc9;};'use strict';var util=require(_0x4797('0x0'));var _=require(_0x4797('0x1'));var moment=require(_0x4797('0x2'));function getSeconds(_0x27abe1,_0x3876f7){var _0x2cde26=moment(_0x27abe1)[_0x4797('0x3')](0x0);var _0xefa327=moment(_0x3876f7)[_0x4797('0x3')](0x0);return _0x2cde26[_0x4797('0x4')](_0xefa327,'seconds');}function QueueCallerAbandon(_0x5bf646,_0x52f301){this['scheduledat']=_0x5bf646['scheduledat'];this[_0x4797('0x5')]=_0x5bf646['type'];this[_0x4797('0x6')]=_0x5bf646[_0x4797('0x5')]===_0x4797('0x7')?'queue':_0x5bf646['type'];this[_0x4797('0x8')]=_0x5bf646['countbusyretry'];this[_0x4797('0x9')]=_0x5bf646[_0x4797('0x9')];this[_0x4797('0xa')]=_0x5bf646[_0x4797('0xa')];this[_0x4797('0xb')]=_0x5bf646['countbusyretry']+_0x5bf646[_0x4797('0x9')]+_0x5bf646['countnoanswerretry'];this['uniqueid']=_0x52f301[_0x4797('0xc')];this['calleridname']=_0x5bf646[_0x4797('0xd')];this[_0x4797('0xe')]=_0x5bf646[_0x4797('0xf')];this[_0x4797('0x10')]=_0x5bf646[_0x4797('0x10')];this[_0x4797('0x11')]=_0x5bf646[_0x4797('0x11')];this[_0x4797('0x12')]=_0x5bf646[_0x4797('0x12')];this[_0x4797('0x13')]=this[_0x4797('0x12')];this[_0x4797('0x14')]=getSeconds(_0x5bf646[_0x4797('0x11')],_0x5bf646[_0x4797('0x10')]);this[_0x4797('0x15')]=getSeconds(this['droptime'],_0x5bf646[_0x4797('0x11')]);this[_0x4797('0x16')]=0x0;this[_0x4797('0x17')]=_0x52f301[_0x4797('0x17')];this[_0x4797('0x18')]=_0x52f301[_0x4797('0x19')];this[_0x4797('0x1a')]=_0x52f301[_0x4797('0x1a')];this['callback']=_0x5bf646[_0x4797('0x1b')];this[_0x4797('0x1c')]=_0x5bf646[_0x4797('0x1c')];this[_0x4797('0x1d')]=_0x5bf646[_0x4797('0x1d')];this[_0x4797('0x1e')]=_0x5bf646[_0x4797('0x1e')];this[_0x4797('0x1f')]=_0x5bf646[_0x4797('0x1f')];this[_0x4797('0x20')]=_0x5bf646[_0x4797('0x20')];this['UserId']=_0x5bf646['UserId'];this[_0x4797('0x21')]=_0x5bf646['VoiceQueueId'];this[_0x4797('0x22')]=_0x5bf646['CampaignId'];this[_0x4797('0x23')]=_0x5bf646[_0x4797('0x23')]||'';this[_0x4797('0x24')]=_0x5bf646[_0x4797('0x24')]||'';}module[_0x4797('0x25')]=QueueCallerAbandon; \ No newline at end of file +var _0x6b81=['countnoanswerretry','countglobal','uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry'];(function(_0x17e417,_0x51a817){var _0x3081bd=function(_0x950de3){while(--_0x950de3){_0x17e417['push'](_0x17e417['shift']());}};_0x3081bd(++_0x51a817);}(_0x6b81,0x9b));var _0x16b8=function(_0x18c4a8,_0x96c52e){_0x18c4a8=_0x18c4a8-0x0;var _0x189ff1=_0x6b81[_0x18c4a8];return _0x189ff1;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x16b8('0x0'));function getSeconds(_0x14c42,_0x12ebd3){var _0x9ab13a=moment(_0x14c42)[_0x16b8('0x1')](0x0);var _0x474903=moment(_0x12ebd3)['milliseconds'](0x0);return _0x9ab13a[_0x16b8('0x2')](_0x474903,_0x16b8('0x3'));}function QueueCallerAbandon(_0x22e026,_0x5d0df9){this[_0x16b8('0x4')]=_0x22e026[_0x16b8('0x4')];this['type']=_0x22e026[_0x16b8('0x5')];this['campaigntype']=_0x22e026['type']===_0x16b8('0x6')?_0x16b8('0x7'):_0x22e026['type'];this[_0x16b8('0x8')]=_0x22e026[_0x16b8('0x8')];this[_0x16b8('0x9')]=_0x22e026['countcongestionretry'];this[_0x16b8('0xa')]=_0x22e026[_0x16b8('0xa')];this[_0x16b8('0xb')]=_0x22e026[_0x16b8('0x8')]+_0x22e026['countcongestionretry']+_0x22e026[_0x16b8('0xa')];this[_0x16b8('0xc')]=_0x5d0df9[_0x16b8('0xc')];this[_0x16b8('0xd')]=_0x22e026['name'];this[_0x16b8('0xe')]=_0x22e026[_0x16b8('0xf')];this['starttime']=_0x22e026[_0x16b8('0x10')];this[_0x16b8('0x11')]=_0x22e026[_0x16b8('0x11')];this['droptime']=_0x22e026['droptime'];this[_0x16b8('0x12')]=this['droptime'];this[_0x16b8('0x13')]=getSeconds(_0x22e026[_0x16b8('0x11')],_0x22e026[_0x16b8('0x10')]);this['holdtime']=getSeconds(this['droptime'],_0x22e026[_0x16b8('0x11')]);this['talktime']=0x0;this[_0x16b8('0x7')]=_0x5d0df9[_0x16b8('0x7')];this['membername']=_0x5d0df9['connectedlinename'];this['reason']=_0x5d0df9[_0x16b8('0x14')];this[_0x16b8('0x15')]=_0x22e026[_0x16b8('0x15')];this[_0x16b8('0x16')]=_0x22e026['callbackuniqueid'];this[_0x16b8('0x17')]=_0x22e026['callbackat'];this[_0x16b8('0x18')]=_0x22e026[_0x16b8('0x18')];this['ContactId']=_0x22e026[_0x16b8('0x19')];this[_0x16b8('0x1a')]=_0x22e026['ListId'];this[_0x16b8('0x1b')]=_0x22e026[_0x16b8('0x1b')];this[_0x16b8('0x1c')]=_0x22e026['VoiceQueueId'];this[_0x16b8('0x1d')]=_0x22e026[_0x16b8('0x1d')];this['originatecalleridnum']=_0x22e026[_0x16b8('0x1e')]||'';this[_0x16b8('0x1f')]=_0x22e026[_0x16b8('0x1f')]||'';}module[_0x16b8('0x20')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index cc62473..a34f759 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 _0xbc5c=['lodash','moment','uniqueid','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','exports'];(function(_0x355b66,_0x466e97){var _0x344d0b=function(_0x55cc35){while(--_0x55cc35){_0x355b66['push'](_0x355b66['shift']());}};_0x344d0b(++_0x466e97);}(_0xbc5c,0x75));var _0xcbc5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbc5c[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0xcbc5('0x0'));var moment=require(_0xcbc5('0x1'));function Action(_0x1d9419,_0x42daed,_0x45f04d){this[_0xcbc5('0x2')]=_0x1d9419||undefined;this['channel']=util[_0xcbc5('0x3')](_0xcbc5('0x4'),_0x42daed[_0xcbc5('0x5')],_0x42daed[_0xcbc5('0x6')][_0xcbc5('0x7')],_0x45f04d[_0xcbc5('0x8')]);this[_0xcbc5('0x9')]=_0x42daed[_0xcbc5('0x9')];this[_0xcbc5('0xa')]=_0x42daed[_0xcbc5('0xa')];this['path']=_0x45f04d[_0xcbc5('0xb')];this['AttachmentId']=_0x45f04d['AttachmentId'];}module[_0xcbc5('0xc')]=Action; \ No newline at end of file +var _0x4395=['AttachmentId','exports','util','lodash','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path'];(function(_0x720f58,_0x51ad3d){var _0x4a7755=function(_0x21db74){while(--_0x21db74){_0x720f58['push'](_0x720f58['shift']());}};_0x4a7755(++_0x51ad3d);}(_0x4395,0x1f0));var _0x5439=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4395[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x5439('0x0'));var _=require(_0x5439('0x1'));var moment=require('moment');function Action(_0x42d676,_0x322d08,_0x516f3e){this['uniqueid']=_0x42d676||undefined;this['channel']=util[_0x5439('0x2')](_0x5439('0x3'),_0x322d08[_0x5439('0x4')],_0x322d08[_0x5439('0x5')][_0x5439('0x6')],_0x516f3e[_0x5439('0x7')]);this['localstationid']=_0x322d08[_0x5439('0x8')];this[_0x5439('0x9')]=_0x322d08[_0x5439('0x9')];this[_0x5439('0xa')]=_0x516f3e[_0x5439('0xa')];this[_0x5439('0xb')]=_0x516f3e[_0x5439('0xb')];}module[_0x5439('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 61c1cd7..4886f05 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 _0xed9e=['SENDING\x20FAILED','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20path','Is\x20Valid','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','prototype','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','update','SENDING\x20FAILED\x20','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20'];(function(_0x5438d5,_0x5d6671){var _0x35718a=function(_0x3e47bf){while(--_0x3e47bf){_0x5438d5['push'](_0x5438d5['shift']());}};_0x35718a(++_0x5d6671);}(_0xed9e,0x180));var _0xeed9=function(_0x18dce0,_0x12947d){_0x18dce0=_0x18dce0-0x0;var _0x214321=_0xed9e[_0x18dce0];return _0x214321;};'use strict';var util=require('util');var _=require(_0xeed9('0x0'));var BPromise=require(_0xeed9('0x1'));var uuid=require('uuid');var moment=require(_0xeed9('0x2'));var path=require(_0xeed9('0x3'));var tiff2pdf=require(_0xeed9('0x4'));var gs=require(_0xeed9('0x5'));var logger=require(_0xeed9('0x6'))(_0xeed9('0x7'));var ami=require(_0xeed9('0x8'));var rpcDb=require(_0xeed9('0x9'));var Channel=require(_0xeed9('0xa'));var ut=require('./util/util');var Action=require(_0xeed9('0xb'));var faxAccount=require(_0xeed9('0xc'));var attachment=require(_0xeed9('0xd'));var faxMessage=require(_0xeed9('0xe'));function Fax(_0x11fac1){this[_0xeed9('0xf')]={};this['faxAccounts']=_0x11fac1[_0xeed9('0x10')];this[_0xeed9('0x11')]=_0x11fac1[_0xeed9('0x11')];this[_0xeed9('0x12')]={};ami['on'](_0xeed9('0x13'),this[_0xeed9('0x14')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x16'),this[_0xeed9('0x17')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x18'),this[_0xeed9('0x19')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x1a'),this[_0xeed9('0x1b')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x1c'),this[_0xeed9('0x1d')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x1e'),this[_0xeed9('0x1f')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x20'),this['syncHangup']['bind'](this));ami['on']('originateresponse',this[_0xeed9('0x21')][_0xeed9('0x15')](this));}Fax[_0xeed9('0x22')]['syncNewchannel']=function(_0xd24323){if(_0xd24323['context']==='from-voip-provider'){for(var _0x657f28 in this[_0xeed9('0x10')]){if(this['faxAccounts'][_0xeed9('0x23')](_0x657f28)){if(_0xd24323[_0xeed9('0x24')]===this['faxAccounts'][_0x657f28]['localstationid']){this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]={};this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]['channel']=_0xd24323[_0xeed9('0x26')];this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]['id']=this[_0xeed9('0x10')][_0x657f28]['id'];this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]][_0xeed9('0x27')]=this['faxAccounts'][_0x657f28][_0xeed9('0x27')];logger[_0xeed9('0x28')](_0xd24323[_0xeed9('0x25')],_0xeed9('0x29'));}}}}if(this['actions'][_0xd24323[_0xeed9('0x25')]]){this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]={};this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]][_0xeed9('0x26')]=_0xd24323[_0xeed9('0x26')];logger[_0xeed9('0x28')](_0xd24323['uniqueid'],_0xeed9('0x29'));}};Fax[_0xeed9('0x22')][_0xeed9('0x17')]=function(_0x5a4481){if(this[_0xeed9('0xf')][_0x5a4481[_0xeed9('0x25')]]){for(var _0x18d706 in _0x5a4481['variable']){if(_0x5a4481[_0xeed9('0x2a')][_0xeed9('0x23')](_0x18d706)){this['channels'][_0x5a4481[_0xeed9('0x25')]][_0x18d706]=_0x5a4481[_0xeed9('0x2b')];}}}};Fax[_0xeed9('0x22')][_0xeed9('0x19')]=function(_0xdd759d){if(this[_0xeed9('0xf')][_0xdd759d['uniqueid']]){this['channels'][_0xdd759d['uniqueid']]['channelstate']=_0xdd759d[_0xeed9('0x2c')];this['channels'][_0xdd759d[_0xeed9('0x25')]][_0xeed9('0x2d')]=_0xdd759d['channelstatedesc'];}};Fax['prototype'][_0xeed9('0x1b')]=function(_0x4b4a7c){if(this[_0xeed9('0xf')][_0x4b4a7c[_0xeed9('0x25')]]){for(var _0x31974 in _0x4b4a7c[_0xeed9('0x2a')]){if(_0x4b4a7c[_0xeed9('0x2a')]['hasOwnProperty'](_0x31974)){this[_0xeed9('0xf')][_0x4b4a7c[_0xeed9('0x25')]][_0x31974]=_0x4b4a7c['value'];}}}};Fax[_0xeed9('0x22')][_0xeed9('0x1d')]=function(_0x34feab){if(this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]]){this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x2e')]=_0x34feab[_0xeed9('0x2e')];this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x2f')]=_0x34feab['status'];this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x30')]=_0x34feab[_0xeed9('0x30')];this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x31')]=_0x34feab[_0xeed9('0x31')];logger['info'](_0x34feab['uniqueid'],_0xeed9('0x32'));}};Fax[_0xeed9('0x22')][_0xeed9('0x1f')]=function(_0x218d05){var _0x1f894d=this;if(this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]]){var _0xe26e56=this['channels'][_0x218d05[_0xeed9('0x25')]]['id'];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x33')]=_0x218d05[_0xeed9('0x33')];this[_0xeed9('0xf')][_0x218d05['uniqueid']]['pagestransferred']=_0x218d05[_0xeed9('0x34')];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x30')]=_0x218d05[_0xeed9('0x30')];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x35')]=_0x218d05['resolution'];this[_0xeed9('0xf')][_0x218d05['uniqueid']][_0xeed9('0x36')]=_0x218d05['transferrate'];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]]['filename']=_0x218d05[_0xeed9('0x31')];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x37')]=_0x218d05[_0xeed9('0x37')];if(this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x34')]>0x0){tiff2pdf(_0x218d05['filename'],_0xeed9('0x38'),function(_0x261c2c){logger[_0xeed9('0x28')](_0x218d05[_0xeed9('0x25')],_0xeed9('0x39'),_0x261c2c[_0xeed9('0x3a')]);attachment[_0xeed9('0x3b')]({'name':path[_0xeed9('0x3c')](_0x218d05[_0xeed9('0x31')])[_0xeed9('0x27')],'basename':path['parse'](_0x218d05[_0xeed9('0x31')])[_0xeed9('0x27')]+_0xeed9('0x3d'),'type':'application/pdf'})[_0xeed9('0x3e')](function(_0x22df10){faxAccount[_0xeed9('0x3f')](_0xe26e56,{'from':_0x218d05[_0xeed9('0x37')],'mapKey':'fax','body':path[_0xeed9('0x3c')](_0x218d05[_0xeed9('0x31')])[_0xeed9('0x27')]+'.pdf','AttachmentId':_0x22df10['id']})[_0xeed9('0x40')](function(_0x21a721){logger[_0xeed9('0x41')](_0x218d05[_0xeed9('0x25')],_0xeed9('0x42'),JSON[_0xeed9('0x43')](_0x21a721));});})[_0xeed9('0x40')](function(_0x355f20){logger['error'](_0x218d05['uniqueid'],'\x20receiveFax\x20',JSON[_0xeed9('0x43')](_0x355f20));});});}logger[_0xeed9('0x28')](_0x218d05[_0xeed9('0x25')],_0xeed9('0x44'));}};Fax[_0xeed9('0x22')][_0xeed9('0x21')]=function(_0x2f0195){if(this[_0xeed9('0x12')][_0x2f0195[_0xeed9('0x25')]]){_[_0xeed9('0x45')](this[_0xeed9('0xf')][_0x2f0195[_0xeed9('0x25')]],_[_0xeed9('0x46')](_0x2f0195,[_0xeed9('0x47'),'reason']));}};function updateStatus(_0x3fd3d9){if(_0x3fd3d9['AttachmentId']){faxMessage[_0xeed9('0x48')](_0x3fd3d9['AttachmentId'],{'failMessage':_0xeed9('0x49')})['then'](function(_0x4ba872){ut['logger']('[Fax][Message][Error][Updated]',_0x4ba872);})[_0xeed9('0x40')](function(_0x53301e){ut['logger'](_0xeed9('0x4a'),_0x53301e);});}else{ut[_0xeed9('0x4b')](_0xeed9('0x4c'));}}Fax['prototype']['updateStatus']=function(_0x3ec4c6,_0x3e9035,_0xfcd6f4){var _0x1eeeb6=this;var _0x5bf670={};if(_0x3e9035){_0x5bf670={'read':_0x3e9035};}else{_0x5bf670={'failMessage':_0xfcd6f4};}if(this[_0xeed9('0x12')][_0x3ec4c6][_0xeed9('0x4d')]){faxMessage[_0xeed9('0x48')](this[_0xeed9('0x12')][_0x3ec4c6][_0xeed9('0x4d')],_0x5bf670)['then'](function(_0x584c35){ut[_0xeed9('0x4b')](_0xeed9('0x4e'),_0x584c35);})[_0xeed9('0x40')](function(_0x32008c){ut[_0xeed9('0x4b')](_0xeed9('0x4f'),_0x32008c);})[_0xeed9('0x50')](function(){delete _0x1eeeb6[_0xeed9('0xf')][_0x3ec4c6];delete _0x1eeeb6[_0xeed9('0x12')][_0x3ec4c6];});}else{ut[_0xeed9('0x4b')](_0xeed9('0x51'));delete this[_0xeed9('0xf')][_0x3ec4c6];delete this[_0xeed9('0x12')][_0x3ec4c6];}};Fax[_0xeed9('0x22')]['syncHangup']=function(_0x10d3ad){var _0x2ecb7b=this;if(this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]]){if(this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]){this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]]['id']=this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]['id'];this['channels'][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x27')]=this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]['name'];}logger[_0xeed9('0x28')](_0x10d3ad[_0xeed9('0x25')],this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]?'\x20hangup\x20sendFile\x20':_0xeed9('0x52'),JSON[_0xeed9('0x43')](this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]]));if(this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]){if(this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x53')]>0x0&&this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x1c')]===_0xeed9('0x54')){this[_0xeed9('0x55')](_0x10d3ad[_0xeed9('0x25')],!![]);}else{this['updateStatus'](_0x10d3ad[_0xeed9('0x25')],![],this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x56')]?_0xeed9('0x57')+this['channels'][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x56')]:_0xeed9('0x58'));}}}};Fax[_0xeed9('0x22')]['send']=function(_0x5cccdf){var _0x552046=this;return new BPromise(function(_0x14a91a,_0x120b1c){_0x552046[_0xeed9('0x59')](_0x5cccdf,_0x552046[_0xeed9('0x10')][_0x5cccdf['FaxAccountId']])[_0xeed9('0x3e')](function(_0x54a852){ut[_0xeed9('0x4b')]('[Fax][execOriginate][success]',_0x54a852);_0x14a91a(ut[_0xeed9('0x3a')](_0xeed9('0x5a')));})[_0xeed9('0x40')](function(_0x480b52){ut[_0xeed9('0x4b')](_0xeed9('0x5b'),_0x480b52);updateStatus(_0x5cccdf);_0x120b1c(ut[_0xeed9('0x3a')](_0xeed9('0x5c')));});});};Fax[_0xeed9('0x22')][_0xeed9('0x5d')]=function(_0x24199){var _0x21e60a=this;return new BPromise(function(_0x23e529,_0x375d07){var _0x2ec759=_0x21e60a[_0xeed9('0x5e')](_0x21e60a[_0xeed9('0x10')][_0x24199[_0xeed9('0x5f')]][_0xeed9('0x60')],_0x24199);if(_0x2ec759['isValid']){_0x23e529(ut[_0xeed9('0x3a')](_0xeed9('0x61')));}else{_0x375d07(ut[_0xeed9('0x3a')](_0x2ec759[_0xeed9('0x3a')]));}});};function originate(_0xe57c80,_0x36d1ec,_0x536c94){return new BPromise(function(_0x4a2293,_0x4d2799){if(_0x536c94){var _0x5c2ef8=util[_0xeed9('0x62')](_0xeed9('0x63'),path[_0xeed9('0x3c')](_0xe57c80['path'])['name'],_0xe57c80[_0xeed9('0x3')]);gs[_0xeed9('0x64')](_0x5c2ef8)[_0xeed9('0x3e')](function(){_0xe57c80[_0xeed9('0x3')]=util[_0xeed9('0x62')](_0xeed9('0x65'),path[_0xeed9('0x3c')](_0xe57c80[_0xeed9('0x3')])['dir'],path[_0xeed9('0x3c')](_0xe57c80[_0xeed9('0x3')])[_0xeed9('0x27')]);_0x36d1ec[_0xeed9('0x66')]=_0xe57c80['path'];ut[_0xeed9('0x4b')](_0xeed9('0x67'),'');ami['Action'](ut[_0xeed9('0x68')](_0xe57c80,_0x36d1ec))[_0xeed9('0x3e')](function(_0x4833bd){_0x4a2293(_0x4833bd);})[_0xeed9('0x40')](function(_0x2c951e){_0x4d2799(_0x2c951e);});})[_0xeed9('0x40')](function(_0x36e283){_0x4d2799(_0x36e283);});}else{ami[_0xeed9('0x69')](ut[_0xeed9('0x68')](_0xe57c80,_0x36d1ec))[_0xeed9('0x3e')](function(_0x196e34){_0x4a2293(_0x196e34);})[_0xeed9('0x40')](function(_0xfddbd1){_0x4d2799(_0xfddbd1);});}});}Fax[_0xeed9('0x22')]['execOriginate']=function(_0x21360b,_0x306eb7){var _0x1e1779=this;return new BPromise(function(_0x4a20bf,_0x53f784){var _0xd848b5=uuid['v4']();var _0x176756=ut[_0xeed9('0x6a')](_0x21360b,_0x306eb7);_0x1e1779[_0xeed9('0x12')][_0xd848b5]=new Action(_0xd848b5,_0x306eb7,_0x21360b);var _0x187bc5=_0x1e1779[_0xeed9('0x12')][_0xd848b5];if(path[_0xeed9('0x3c')](_0x21360b[_0xeed9('0x3')])['ext']==='.pdf'){originate(_0x187bc5,_0x176756,!![])[_0xeed9('0x3e')](function(_0x9be017){_0x4a20bf(_0x9be017);})['catch'](function(_0x26caad){_0x53f784(_0x26caad);});}else{originate(_0x187bc5,_0x176756,![])[_0xeed9('0x3e')](function(_0xd0688b){_0x4a20bf(_0xd0688b);})[_0xeed9('0x40')](function(_0x1ed1a0){_0x53f784(_0x1ed1a0);});}});};Fax[_0xeed9('0x22')][_0xeed9('0x6b')]=function(_0x1c2e96){return!_[_0xeed9('0x6c')](_0x1c2e96)&&!_['isNil'](_0x1c2e96['name'])&&!_[_0xeed9('0x6c')](_0x1c2e96['active'])&&_0x1c2e96[_0xeed9('0x6d')]&&!_[_0xeed9('0x6c')](this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96[_0xeed9('0x27')])])&&!_[_0xeed9('0x6c')](this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96[_0xeed9('0x27')])]['status'])&&(this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96['name'])]['status']===_0xeed9('0x6f')||this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96['name'])][_0xeed9('0x2f')]===_0xeed9('0x70'));};Fax[_0xeed9('0x22')][_0xeed9('0x5e')]=function(_0xb4a8dc,_0x3d49ec){if(!this[_0xeed9('0x6b')](_0xb4a8dc)){ut[_0xeed9('0x4b')](_0xeed9('0x71'),_[_0xeed9('0x6c')](_0xb4a8dc)?'':_0xb4a8dc['name']+_0xeed9('0x72'));return{'isValid':![],'message':_0xeed9('0x73')};}if(_['isNil'](_0x3d49ec[_0xeed9('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xeed9('0x43')](_0x3d49ec));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xeed9('0x6c')](_0x3d49ec[_0xeed9('0x3')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0xeed9('0x43')](_0x3d49ec));return{'isValid':![],'message':_0xeed9('0x74')};}return{'isValid':!![],'message':_0xeed9('0x75')};};module['exports']=Fax; \ No newline at end of file +var _0x4b93=['catch','error','\x20notify\x20','\x20receiveFax\x20','pick','response','reason','AttachmentId','update','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20faxRiceive\x20','stringify','faxpages','faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','../../../config/logger','fax','../ami','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','newexten','syncNewExten','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify'];(function(_0x4b5a8a,_0x4aea7c){var _0x3835f3=function(_0x2034d5){while(--_0x2034d5){_0x4b5a8a['push'](_0x4b5a8a['shift']());}};_0x3835f3(++_0x4aea7c);}(_0x4b93,0x17c));var _0x34b9=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x4b93[_0x3e112d];return _0x531c31;};'use strict';var util=require(_0x34b9('0x0'));var _=require('lodash');var BPromise=require(_0x34b9('0x1'));var uuid=require(_0x34b9('0x2'));var moment=require('moment');var path=require('path');var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x34b9('0x3'))(_0x34b9('0x4'));var ami=require(_0x34b9('0x5'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x34b9('0x6'));var Action=require('./action');var faxAccount=require(_0x34b9('0x7'));var attachment=require(_0x34b9('0x8'));var faxMessage=require(_0x34b9('0x9'));function Fax(_0x4dc341){this[_0x34b9('0xa')]={};this[_0x34b9('0xb')]=_0x4dc341[_0x34b9('0xb')];this['trunks']=_0x4dc341[_0x34b9('0xc')];this[_0x34b9('0xd')]={};ami['on'](_0x34b9('0xe'),this[_0x34b9('0xf')][_0x34b9('0x10')](this));ami['on'](_0x34b9('0x11'),this[_0x34b9('0x12')][_0x34b9('0x10')](this));ami['on'](_0x34b9('0x13'),this['syncNewState'][_0x34b9('0x10')](this));ami['on'](_0x34b9('0x14'),this[_0x34b9('0x15')][_0x34b9('0x10')](this));ami['on']('faxstatus',this[_0x34b9('0x16')]['bind'](this));ami['on']('receivefax',this[_0x34b9('0x17')][_0x34b9('0x10')](this));ami['on'](_0x34b9('0x18'),this[_0x34b9('0x19')][_0x34b9('0x10')](this));ami['on'](_0x34b9('0x1a'),this[_0x34b9('0x1b')][_0x34b9('0x10')](this));}Fax[_0x34b9('0x1c')][_0x34b9('0xf')]=function(_0x150da5){if(_0x150da5[_0x34b9('0x1d')]===_0x34b9('0x1e')){for(var _0x4db30b in this[_0x34b9('0xb')]){if(this[_0x34b9('0xb')][_0x34b9('0x1f')](_0x4db30b)){if(_0x150da5[_0x34b9('0x20')]===this[_0x34b9('0xb')][_0x4db30b][_0x34b9('0x21')]){this[_0x34b9('0xa')][_0x150da5['uniqueid']]={};this[_0x34b9('0xa')][_0x150da5[_0x34b9('0x22')]]['channel']=_0x150da5[_0x34b9('0x23')];this[_0x34b9('0xa')][_0x150da5['uniqueid']]['id']=this[_0x34b9('0xb')][_0x4db30b]['id'];this[_0x34b9('0xa')][_0x150da5[_0x34b9('0x22')]]['name']=this['faxAccounts'][_0x4db30b][_0x34b9('0x24')];logger[_0x34b9('0x25')](_0x150da5[_0x34b9('0x22')],_0x34b9('0x26'));}}}}if(this[_0x34b9('0xd')][_0x150da5['uniqueid']]){this[_0x34b9('0xa')][_0x150da5[_0x34b9('0x22')]]={};this['channels'][_0x150da5[_0x34b9('0x22')]][_0x34b9('0x23')]=_0x150da5[_0x34b9('0x23')];logger[_0x34b9('0x25')](_0x150da5[_0x34b9('0x22')],_0x34b9('0x26'));}};Fax['prototype'][_0x34b9('0x12')]=function(_0x34fce5){if(this[_0x34b9('0xa')][_0x34fce5['uniqueid']]){for(var _0xe9ab0c in _0x34fce5[_0x34b9('0x27')]){if(_0x34fce5[_0x34b9('0x27')][_0x34b9('0x1f')](_0xe9ab0c)){this[_0x34b9('0xa')][_0x34fce5[_0x34b9('0x22')]][_0xe9ab0c]=_0x34fce5[_0x34b9('0x28')];}}}};Fax[_0x34b9('0x1c')][_0x34b9('0x29')]=function(_0xfd875a){if(this[_0x34b9('0xa')][_0xfd875a['uniqueid']]){this[_0x34b9('0xa')][_0xfd875a['uniqueid']][_0x34b9('0x2a')]=_0xfd875a[_0x34b9('0x2a')];this[_0x34b9('0xa')][_0xfd875a['uniqueid']][_0x34b9('0x2b')]=_0xfd875a[_0x34b9('0x2b')];}};Fax['prototype'][_0x34b9('0x15')]=function(_0x1e9e4c){if(this['channels'][_0x1e9e4c[_0x34b9('0x22')]]){for(var _0x55c80a in _0x1e9e4c[_0x34b9('0x27')]){if(_0x1e9e4c[_0x34b9('0x27')][_0x34b9('0x1f')](_0x55c80a)){this[_0x34b9('0xa')][_0x1e9e4c[_0x34b9('0x22')]][_0x55c80a]=_0x1e9e4c['value'];}}}};Fax[_0x34b9('0x1c')][_0x34b9('0x16')]=function(_0x398748){if(this[_0x34b9('0xa')][_0x398748[_0x34b9('0x22')]]){this[_0x34b9('0xa')][_0x398748[_0x34b9('0x22')]][_0x34b9('0x2c')]=_0x398748[_0x34b9('0x2c')];this[_0x34b9('0xa')][_0x398748[_0x34b9('0x22')]]['status']=_0x398748[_0x34b9('0x2d')];this[_0x34b9('0xa')][_0x398748[_0x34b9('0x22')]][_0x34b9('0x21')]=_0x398748[_0x34b9('0x21')];this[_0x34b9('0xa')][_0x398748['uniqueid']][_0x34b9('0x2e')]=_0x398748[_0x34b9('0x2e')];logger[_0x34b9('0x25')](_0x398748[_0x34b9('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0x34b9('0x1c')][_0x34b9('0x17')]=function(_0x35cfc4){var _0x4b6b68=this;if(this[_0x34b9('0xa')][_0x35cfc4['uniqueid']]){var _0x8d253e=this['channels'][_0x35cfc4[_0x34b9('0x22')]]['id'];this[_0x34b9('0xa')][_0x35cfc4[_0x34b9('0x22')]][_0x34b9('0x2f')]=_0x35cfc4[_0x34b9('0x2f')];this[_0x34b9('0xa')][_0x35cfc4[_0x34b9('0x22')]][_0x34b9('0x30')]=_0x35cfc4['pagestransferred'];this['channels'][_0x35cfc4[_0x34b9('0x22')]]['localstationid']=_0x35cfc4[_0x34b9('0x21')];this['channels'][_0x35cfc4[_0x34b9('0x22')]][_0x34b9('0x31')]=_0x35cfc4[_0x34b9('0x31')];this[_0x34b9('0xa')][_0x35cfc4['uniqueid']][_0x34b9('0x32')]=_0x35cfc4[_0x34b9('0x32')];this[_0x34b9('0xa')][_0x35cfc4[_0x34b9('0x22')]][_0x34b9('0x2e')]=_0x35cfc4[_0x34b9('0x2e')];this['channels'][_0x35cfc4[_0x34b9('0x22')]][_0x34b9('0x33')]=_0x35cfc4[_0x34b9('0x33')];if(this[_0x34b9('0xa')][_0x35cfc4['uniqueid']][_0x34b9('0x30')]>0x0){tiff2pdf(_0x35cfc4[_0x34b9('0x2e')],_0x34b9('0x34'),function(_0x4c01f6){logger[_0x34b9('0x25')](_0x35cfc4[_0x34b9('0x22')],_0x34b9('0x35'),_0x4c01f6[_0x34b9('0x36')]);attachment[_0x34b9('0x37')]({'name':path[_0x34b9('0x38')](_0x35cfc4[_0x34b9('0x2e')])[_0x34b9('0x24')],'basename':path[_0x34b9('0x38')](_0x35cfc4[_0x34b9('0x2e')])['name']+_0x34b9('0x39'),'type':'application/pdf'})[_0x34b9('0x3a')](function(_0x4f34ca){faxAccount[_0x34b9('0x3b')](_0x8d253e,{'from':_0x35cfc4['calleridnum'],'mapKey':_0x34b9('0x4'),'body':path['parse'](_0x35cfc4[_0x34b9('0x2e')])['name']+_0x34b9('0x39'),'AttachmentId':_0x4f34ca['id']})[_0x34b9('0x3c')](function(_0x36e670){logger[_0x34b9('0x3d')](_0x35cfc4[_0x34b9('0x22')],_0x34b9('0x3e'),JSON['stringify'](_0x36e670));});})[_0x34b9('0x3c')](function(_0x33b521){logger[_0x34b9('0x3d')](_0x35cfc4[_0x34b9('0x22')],_0x34b9('0x3f'),JSON['stringify'](_0x33b521));});});}logger[_0x34b9('0x25')](_0x35cfc4[_0x34b9('0x22')],'\x20receiveFax\x20');}};Fax[_0x34b9('0x1c')][_0x34b9('0x1b')]=function(_0x18682a){if(this[_0x34b9('0xd')][_0x18682a[_0x34b9('0x22')]]){_['merge'](this['channels'][_0x18682a[_0x34b9('0x22')]],_[_0x34b9('0x40')](_0x18682a,[_0x34b9('0x41'),_0x34b9('0x42')]));}};function updateStatus(_0x37a866){if(_0x37a866[_0x34b9('0x43')]){faxMessage[_0x34b9('0x44')](_0x37a866[_0x34b9('0x43')],{'failMessage':'SENDING\x20FAILED\x20'})[_0x34b9('0x3a')](function(_0x36291a){ut[_0x34b9('0x45')]('[Fax][Message][Error][Updated]',_0x36291a);})[_0x34b9('0x3c')](function(_0x36d5a8){ut['logger'](_0x34b9('0x46'),_0x36d5a8);});}else{ut[_0x34b9('0x45')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x34b9('0x47')]=function(_0x30607f,_0x7cbfdc,_0x3291db){var _0x35147c=this;var _0x128e37={};if(_0x7cbfdc){_0x128e37={'read':_0x7cbfdc};}else{_0x128e37={'failMessage':_0x3291db};}if(this[_0x34b9('0xd')][_0x30607f][_0x34b9('0x43')]){faxMessage[_0x34b9('0x44')](this['actions'][_0x30607f]['AttachmentId'],_0x128e37)[_0x34b9('0x3a')](function(_0x1886ca){ut[_0x34b9('0x45')]('[Fax][Message][Updated]',_0x1886ca);})[_0x34b9('0x3c')](function(_0x5d849c){ut['logger'](_0x34b9('0x48'),_0x5d849c);})[_0x34b9('0x49')](function(){delete _0x35147c[_0x34b9('0xa')][_0x30607f];delete _0x35147c[_0x34b9('0xd')][_0x30607f];});}else{ut[_0x34b9('0x45')]('[Fax][Message][NoUpdate2]');delete this[_0x34b9('0xa')][_0x30607f];delete this['actions'][_0x30607f];}};Fax[_0x34b9('0x1c')][_0x34b9('0x19')]=function(_0x149bcd){var _0x3e8f48=this;if(this[_0x34b9('0xa')][_0x149bcd['uniqueid']]){if(this[_0x34b9('0xd')][_0x149bcd[_0x34b9('0x22')]]){this[_0x34b9('0xa')][_0x149bcd[_0x34b9('0x22')]]['id']=this[_0x34b9('0xd')][_0x149bcd[_0x34b9('0x22')]]['id'];this['channels'][_0x149bcd[_0x34b9('0x22')]][_0x34b9('0x24')]=this[_0x34b9('0xd')][_0x149bcd[_0x34b9('0x22')]][_0x34b9('0x24')];}logger['info'](_0x149bcd[_0x34b9('0x22')],this[_0x34b9('0xd')][_0x149bcd['uniqueid']]?'\x20hangup\x20sendFile\x20':_0x34b9('0x4a'),JSON[_0x34b9('0x4b')](this[_0x34b9('0xa')][_0x149bcd[_0x34b9('0x22')]]));if(this[_0x34b9('0xd')][_0x149bcd[_0x34b9('0x22')]]){if(this[_0x34b9('0xa')][_0x149bcd[_0x34b9('0x22')]][_0x34b9('0x4c')]>0x0&&this[_0x34b9('0xa')][_0x149bcd['uniqueid']][_0x34b9('0x4d')]===_0x34b9('0x4e')){this[_0x34b9('0x47')](_0x149bcd[_0x34b9('0x22')],!![]);}else{this['updateStatus'](_0x149bcd['uniqueid'],![],this[_0x34b9('0xa')][_0x149bcd[_0x34b9('0x22')]][_0x34b9('0x4f')]?_0x34b9('0x50')+this[_0x34b9('0xa')][_0x149bcd[_0x34b9('0x22')]][_0x34b9('0x4f')]:_0x34b9('0x51'));}}}};Fax[_0x34b9('0x1c')]['send']=function(_0x4ffc37){var _0x455585=this;return new BPromise(function(_0x289c23,_0x120f67){_0x455585[_0x34b9('0x52')](_0x4ffc37,_0x455585[_0x34b9('0xb')][_0x4ffc37[_0x34b9('0x53')]])['then'](function(_0x49782a){ut[_0x34b9('0x45')]('[Fax][execOriginate][success]',_0x49782a);_0x289c23(ut[_0x34b9('0x36')](_0x34b9('0x54')));})[_0x34b9('0x3c')](function(_0x4771cd){ut[_0x34b9('0x45')](_0x34b9('0x55'),_0x4771cd);updateStatus(_0x4ffc37);_0x120f67(ut[_0x34b9('0x36')](_0x34b9('0x56')));});});};Fax['prototype']['checkAfterSend']=function(_0x337600){var _0x3f6ec7=this;return new BPromise(function(_0x3614b1,_0xb60e85){var _0x4240db=_0x3f6ec7[_0x34b9('0x57')](_0x3f6ec7['faxAccounts'][_0x337600['FaxAccountId']]['Trunk'],_0x337600);if(_0x4240db[_0x34b9('0x58')]){_0x3614b1(ut['message'](_0x34b9('0x59')));}else{_0xb60e85(ut[_0x34b9('0x36')](_0x4240db[_0x34b9('0x36')]));}});};function originate(_0x22827f,_0x148140,_0xcfaf68){return new BPromise(function(_0x5d8177,_0x4d082a){if(_0xcfaf68){var _0x5de2ac=util[_0x34b9('0x5a')](_0x34b9('0x5b'),path[_0x34b9('0x38')](_0x22827f['path'])[_0x34b9('0x24')],_0x22827f['path']);gs['execute'](_0x5de2ac)[_0x34b9('0x3a')](function(){_0x22827f[_0x34b9('0x5c')]=util['format']('%s/%s.tif',path['parse'](_0x22827f[_0x34b9('0x5c')])[_0x34b9('0x5d')],path[_0x34b9('0x38')](_0x22827f[_0x34b9('0x5c')])[_0x34b9('0x24')]);_0x148140[_0x34b9('0x5e')]=_0x22827f[_0x34b9('0x5c')];ut[_0x34b9('0x45')](_0x34b9('0x5f'),'');ami[_0x34b9('0x60')](ut[_0x34b9('0x61')](_0x22827f,_0x148140))[_0x34b9('0x3a')](function(_0x1aada9){_0x5d8177(_0x1aada9);})[_0x34b9('0x3c')](function(_0x16a81c){_0x4d082a(_0x16a81c);});})[_0x34b9('0x3c')](function(_0x48c1d6){_0x4d082a(_0x48c1d6);});}else{ami[_0x34b9('0x60')](ut[_0x34b9('0x61')](_0x22827f,_0x148140))['then'](function(_0x23f532){_0x5d8177(_0x23f532);})[_0x34b9('0x3c')](function(_0xab09fe){_0x4d082a(_0xab09fe);});}});}Fax[_0x34b9('0x1c')][_0x34b9('0x52')]=function(_0x3b1b6f,_0x11e089){var _0x280a00=this;return new BPromise(function(_0x36e094,_0x1e8d36){var _0x4bbfc0=uuid['v4']();var _0x38dc63=ut['addVariables'](_0x3b1b6f,_0x11e089);_0x280a00['actions'][_0x4bbfc0]=new Action(_0x4bbfc0,_0x11e089,_0x3b1b6f);var _0x5994d9=_0x280a00[_0x34b9('0xd')][_0x4bbfc0];if(path[_0x34b9('0x38')](_0x3b1b6f[_0x34b9('0x5c')])[_0x34b9('0x62')]===_0x34b9('0x39')){originate(_0x5994d9,_0x38dc63,!![])[_0x34b9('0x3a')](function(_0x50f49e){_0x36e094(_0x50f49e);})['catch'](function(_0x252073){_0x1e8d36(_0x252073);});}else{originate(_0x5994d9,_0x38dc63,![])[_0x34b9('0x3a')](function(_0x55d62a){_0x36e094(_0x55d62a);})[_0x34b9('0x3c')](function(_0x149010){_0x1e8d36(_0x149010);});}});};Fax['prototype'][_0x34b9('0x63')]=function(_0x5498a3){return!_[_0x34b9('0x64')](_0x5498a3)&&!_['isNil'](_0x5498a3[_0x34b9('0x24')])&&!_[_0x34b9('0x64')](_0x5498a3['active'])&&_0x5498a3[_0x34b9('0x65')]&&!_[_0x34b9('0x64')](this[_0x34b9('0xc')][util[_0x34b9('0x5a')](_0x34b9('0x66'),_0x5498a3['name'])])&&!_[_0x34b9('0x64')](this[_0x34b9('0xc')][util[_0x34b9('0x5a')](_0x34b9('0x66'),_0x5498a3['name'])][_0x34b9('0x2d')])&&(this[_0x34b9('0xc')][util['format'](_0x34b9('0x66'),_0x5498a3['name'])][_0x34b9('0x2d')]==='reachable'||this[_0x34b9('0xc')][util[_0x34b9('0x5a')](_0x34b9('0x66'),_0x5498a3[_0x34b9('0x24')])][_0x34b9('0x2d')]==='unmonitored');};Fax[_0x34b9('0x1c')][_0x34b9('0x57')]=function(_0x1850bc,_0xdec543){if(!this[_0x34b9('0x63')](_0x1850bc)){ut[_0x34b9('0x45')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0x34b9('0x64')](_0x1850bc)?'':_0x1850bc['name']+_0x34b9('0x67'));return{'isValid':![],'message':_0x34b9('0x68')};}if(_['isNil'](_0xdec543[_0x34b9('0x4')])){ut[_0x34b9('0x45')](_0x34b9('0x69'),JSON[_0x34b9('0x4b')](_0xdec543));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0xdec543[_0x34b9('0x5c')])){ut[_0x34b9('0x45')](_0x34b9('0x6a'),JSON['stringify'](_0xdec543));return{'isValid':![],'message':_0x34b9('0x6b')};}return{'isValid':!![],'message':_0x34b9('0x6c')};};module[_0x34b9('0x6d')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 617b219..2a71bc4 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 _0x5060=['notify','then','catch','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x3c6115,_0x29a181){var _0x320068=function(_0x144458){while(--_0x144458){_0x3c6115['push'](_0x3c6115['shift']());}};_0x320068(++_0x29a181);}(_0x5060,0x92));var _0x0506=function(_0x37e770,_0x5b327b){_0x37e770=_0x37e770-0x0;var _0x4c92bf=_0x5060[_0x37e770];return _0x4c92bf;};'use strict';var util=require(_0x0506('0x0'));var BPromise=require(_0x0506('0x1'));var logger=require(_0x0506('0x2'))(_0x0506('0x3'));var _=require(_0x0506('0x4'));var faxAccount=require(_0x0506('0x5'));function loggerCatch(_0xe8b1af){return function(_0x42f8a3){logger[_0x0506('0x6')](_0xe8b1af,util[_0x0506('0x7')](_0x42f8a3,{'showHidden':![],'depth':null}));};}exports[_0x0506('0x8')]=function(_0x30e54b,_0x51f48b){return BPromise['resolve']()[_0x0506('0x9')](faxAccount[_0x0506('0x8')](_0x30e54b,_0x51f48b))[_0x0506('0xa')](loggerCatch('[Notify]\x20'));}; \ No newline at end of file +var _0xedf3=['error','inspect','resolve','then','catch','[Notify]\x20','bluebird','../../../config/logger','preview','lodash'];(function(_0x40c1a9,_0x2b26c1){var _0x859fd2=function(_0x153d46){while(--_0x153d46){_0x40c1a9['push'](_0x40c1a9['shift']());}};_0x859fd2(++_0x2b26c1);}(_0xedf3,0x7e));var _0x3edf=function(_0xb6e43,_0x1568fc){_0xb6e43=_0xb6e43-0x0;var _0x47c40f=_0xedf3[_0xb6e43];return _0x47c40f;};'use strict';var util=require('util');var BPromise=require(_0x3edf('0x0'));var logger=require(_0x3edf('0x1'))(_0x3edf('0x2'));var _=require(_0x3edf('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x32336f){return function(_0x1a8b5c){logger[_0x3edf('0x4')](_0x32336f,util[_0x3edf('0x5')](_0x1a8b5c,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x536485,_0x360cfa){return BPromise[_0x3edf('0x6')]()[_0x3edf('0x7')](faxAccount['notify'](_0x536485,_0x360cfa))[_0x3edf('0x8')](loggerCatch(_0x3edf('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 2bf49c2..692cdae 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 _0x1120=['info','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x30a6f4,_0x36ec40){var _0x2b3a92=function(_0x5cbccc){while(--_0x5cbccc){_0x30a6f4['push'](_0x30a6f4['shift']());}};_0x2b3a92(++_0x36ec40);}(_0x1120,0x163));var _0x0112=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x1120[_0x1780f8];return _0x33a410;};'use strict';var util=require('util');var logger=require(_0x0112('0x0'))(_0x0112('0x1'));var BPromise=require(_0x0112('0x2'));var exec=require(_0x0112('0x3'))[_0x0112('0x4')];exports['execute']=function(_0xf3b59d){return new BPromise(function(_0x11c9f0,_0x29e7f5){exec(_0xf3b59d,function(_0x235d3e,_0x1bb3c0,_0x5470d9){logger[_0x0112('0x5')]('Exec\x20gs',_0x1bb3c0);if(_0x235d3e){logger[_0x0112('0x5')]('Exec\x20gs',_0x0112('0x6'),util[_0x0112('0x7')](_0x235d3e,{'showHidden':![],'depth':null}),_0x1bb3c0,_0x5470d9);_0x29e7f5(_0x235d3e);}_0x11c9f0(_0x1bb3c0);});});}; \ No newline at end of file +var _0x198d=['\x20Error\x20:','inspect','util','../../../../config/logger','bluebird','child_process','exec','info','Exec\x20gs'];(function(_0x31f808,_0x5ac9da){var _0xbe9831=function(_0x7b9e60){while(--_0x7b9e60){_0x31f808['push'](_0x31f808['shift']());}};_0xbe9831(++_0x5ac9da);}(_0x198d,0x158));var _0xd198=function(_0x336f21,_0xc2fcbb){_0x336f21=_0x336f21-0x0;var _0x1b61e6=_0x198d[_0x336f21];return _0x1b61e6;};'use strict';var util=require(_0xd198('0x0'));var logger=require(_0xd198('0x1'))('fax');var BPromise=require(_0xd198('0x2'));var exec=require(_0xd198('0x3'))[_0xd198('0x4')];exports['execute']=function(_0x5a6c67){return new BPromise(function(_0x1b76e3,_0x4df92d){exec(_0x5a6c67,function(_0x12ba10,_0x108a1c,_0x57ea06){logger[_0xd198('0x5')]('Exec\x20gs',_0x108a1c);if(_0x12ba10){logger[_0xd198('0x5')](_0xd198('0x6'),_0xd198('0x7'),util[_0xd198('0x8')](_0x12ba10,{'showHidden':![],'depth':null}),_0x108a1c,_0x57ea06);_0x4df92d(_0x12ba10);}_0x1b76e3(_0x108a1c);});});}; \ 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 563e03f..ab57e81 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 _0xfe57=['uniqueid','originate','channel','from-sip','headerinfo','localstationid','util','lodash','fax','message','logger','info','inspect','addVariables','ecm','minrate','format','\x22%s\x22','faxdetect','t38timeout','path'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0xfe57,0x195));var _0x7fe5=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xfe57[_0x3b0731];return _0x4204d7;};'use strict';var util=require(_0x7fe5('0x0'));var _=require(_0x7fe5('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x7fe5('0x2'));exports[_0x7fe5('0x3')]=function(_0xc27f79){return{'message':_0xc27f79};};exports[_0x7fe5('0x4')]=function(_0x89ad5f,_0x1254d2){logger[_0x7fe5('0x5')](_0x89ad5f,util[_0x7fe5('0x6')](_0x1254d2,{'showHidden':![],'depth':null}));};exports[_0x7fe5('0x7')]=function(_0x188cfb,_0xd6146b){var _0x2632de={'XMF-ECM':_0xd6146b[_0x7fe5('0x8')],'XMF-HEADERINFO':_0xd6146b['headerinfo'],'XMF-MINRATE':_0xd6146b[_0x7fe5('0x9')],'XMF-MAXRATE':_0xd6146b['maxrate'],'XMF-MODEM':util[_0x7fe5('0xa')](_0x7fe5('0xb'),_0xd6146b['modem']),'XMF-GATEWAY':_0xd6146b['gateway'],'XMF-FAXDETECT':_0xd6146b[_0x7fe5('0xc')],'XMF-T38TIMEOUT':_0xd6146b[_0x7fe5('0xd')],'XMF-LOCALSTATIONID':_0xd6146b['localstationid'],'XMF-PATH':_0x188cfb[_0x7fe5('0xe')]};return _0x2632de;};exports['variablesAction']=function(_0x48d10b,_0xdb5182){return{'actionid':_0x48d10b[_0x7fe5('0xf')],'action':_0x7fe5('0x10'),'channel':_0x48d10b[_0x7fe5('0x11')],'Exten':'xcally-motion-fax','Context':_0x7fe5('0x12'),'Priority':'1','callerid':util[_0x7fe5('0xa')]('\x22%s\x22\x20<%s>',_0x48d10b[_0x7fe5('0x13')]?_0x48d10b['headerinfo']:'',_0x48d10b[_0x7fe5('0x14')]),'variable':_0xdb5182,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x48d10b[_0x7fe5('0xf')]};}; \ No newline at end of file +var _0x4522=['info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','faxdetect','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','localstationid','moment','../../../../config/logger','fax','logger'];(function(_0x4d60e2,_0x5b1c1f){var _0x152f30=function(_0xd5fb8b){while(--_0xd5fb8b){_0x4d60e2['push'](_0x4d60e2['shift']());}};_0x152f30(++_0x5b1c1f);}(_0x4522,0x1a0));var _0x2452=function(_0x5c0032,_0x5e118a){_0x5c0032=_0x5c0032-0x0;var _0x285939=_0x4522[_0x5c0032];return _0x285939;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x2452('0x0'));var logger=require(_0x2452('0x1'))(_0x2452('0x2'));exports['message']=function(_0x229028){return{'message':_0x229028};};exports[_0x2452('0x3')]=function(_0x35e30a,_0x2f21dc){logger[_0x2452('0x4')](_0x35e30a,util[_0x2452('0x5')](_0x2f21dc,{'showHidden':![],'depth':null}));};exports[_0x2452('0x6')]=function(_0x226578,_0x2f0139){var _0x149807={'XMF-ECM':_0x2f0139[_0x2452('0x7')],'XMF-HEADERINFO':_0x2f0139[_0x2452('0x8')],'XMF-MINRATE':_0x2f0139[_0x2452('0x9')],'XMF-MAXRATE':_0x2f0139[_0x2452('0xa')],'XMF-MODEM':util[_0x2452('0xb')](_0x2452('0xc'),_0x2f0139['modem']),'XMF-GATEWAY':_0x2f0139['gateway'],'XMF-FAXDETECT':_0x2f0139[_0x2452('0xd')],'XMF-T38TIMEOUT':_0x2f0139['t38timeout'],'XMF-LOCALSTATIONID':_0x2f0139['localstationid'],'XMF-PATH':_0x226578[_0x2452('0xe')]};return _0x149807;};exports[_0x2452('0xf')]=function(_0x1086ef,_0x3ad6c9){return{'actionid':_0x1086ef[_0x2452('0x10')],'action':_0x2452('0x11'),'channel':_0x1086ef[_0x2452('0x12')],'Exten':_0x2452('0x13'),'Context':'from-sip','Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x1086ef[_0x2452('0x8')]?_0x1086ef['headerinfo']:'',_0x1086ef[_0x2452('0x14')]),'variable':_0x3ad6c9,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1086ef['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 902bcb4..fed3ded 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 _0xe485=['initTriggers','initTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','log','listen','sync','bluebird','moment','./server','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers'];(function(_0x1ba200,_0x3addf3){var _0x21e559=function(_0x3137f1){while(--_0x3137f1){_0x1ba200['push'](_0x1ba200['shift']());}};_0x21e559(++_0x3addf3);}(_0xe485,0x114));var _0x5e48=function(_0x4e09dc,_0x3386a7){_0x4e09dc=_0x4e09dc-0x0;var _0x14e4bd=_0xe485[_0x4e09dc];return _0x14e4bd;};'use strict';var BPromise=require(_0x5e48('0x0'));var util=require('util');var moment=require(_0x5e48('0x1'));var server=require(_0x5e48('0x2'));var Realtime=require(_0x5e48('0x3'));var Report=require('./report');var Acw=require(_0x5e48('0x4'));var Trigger=require(_0x5e48('0x5'));var Dialer=require('./dialer');var Preview=require(_0x5e48('0x6'));var Fax=require(_0x5e48('0x7'));var user=require(_0x5e48('0x8'));var voiceQueue=require(_0x5e48('0x9'));var voiceQueueReport=require(_0x5e48('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x5e48('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x5e48('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5e48('0xd'));var faxAccount=require(_0x5e48('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x5e48('0xf'));var sugarcrm=require(_0x5e48('0x10'));var freshdesk=require(_0x5e48('0x11'));var desk=require(_0x5e48('0x12'));var zoho=require(_0x5e48('0x13'));var vtiger=require(_0x5e48('0x14'));var freshsales=require(_0x5e48('0x15'));var servicenow=require(_0x5e48('0x16'));var dynamics365=require(_0x5e48('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5e48('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5e48('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5e48('0x19')]()[_0x5e48('0x1a')](user[_0x5e48('0x1b')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x1c')]())[_0x5e48('0x1a')](user['getTelephones']())[_0x5e48('0x1a')](realtime[_0x5e48('0x1d')]())[_0x5e48('0x1a')](trunk[_0x5e48('0x1e')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x1f')]())['then'](voiceQueue[_0x5e48('0x20')]())['then'](realtime['initVoiceQueues']())['then'](trigger[_0x5e48('0x21')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x22')]())[_0x5e48('0x1a')](template['getTemplates']())[_0x5e48('0x1a')](realtime[_0x5e48('0x23')]())[_0x5e48('0x1a')](zendesk[_0x5e48('0x24')]())[_0x5e48('0x1a')](realtime['initZendeskAccounts']())[_0x5e48('0x1a')](salesforce['getSalesforceAccounts']())[_0x5e48('0x1a')](realtime[_0x5e48('0x25')]())[_0x5e48('0x1a')](sugarcrm[_0x5e48('0x26')]())[_0x5e48('0x1a')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x5e48('0x27')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x28')]())[_0x5e48('0x1a')](desk[_0x5e48('0x29')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x2a')]())[_0x5e48('0x1a')](zoho[_0x5e48('0x2b')]())['then'](realtime['initZohoAccounts']())[_0x5e48('0x1a')](vtiger[_0x5e48('0x2c')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x2d')]())['then'](freshsales['getFreshsalesAccounts']())[_0x5e48('0x1a')](realtime[_0x5e48('0x2e')]())['then'](servicenow[_0x5e48('0x2f')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x5e48('0x30')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x31')]())['then'](campaign['getCampaigns']())[_0x5e48('0x1a')](realtime['initCampaigns']())[_0x5e48('0x1a')](voiceExtension[_0x5e48('0x32')]())[_0x5e48('0x1a')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x5e48('0x33')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x34')]())[_0x5e48('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x5e48('0x19')]()[_0x5e48('0x1a')](voiceQueueReport[_0x5e48('0x35')]())[_0x5e48('0x1a')](realtime['initVoiceQueueReports']())[_0x5e48('0x1a')](cmHopperHistory[_0x5e48('0x36')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x37')]())['then'](cmHopperHistory[_0x5e48('0x38')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x39')]())[_0x5e48('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x5e48('0x1a')](realtime['initVoiceCallReports']())[_0x5e48('0x1a')](function(_0x817eff){})[_0x5e48('0x3a')](function(_0x998435){console[_0x5e48('0x3b')](_0x998435);});}function main(){return server[_0x5e48('0x3c')](realtime,preview,fax)[_0x5e48('0x1a')](function(_0x500d40){return initRealtime();})[_0x5e48('0x1a')](function(){return initParams();})[_0x5e48('0x1a')](function(){report[_0x5e48('0x3d')]();setInterval(initRealtime,0x1388);})[_0x5e48('0x3a')](function(_0x3118c1){console[_0x5e48('0x3b')](_0x3118c1);});}main(); \ No newline at end of file +var _0xf08d=['initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','bluebird','util','moment','./server','./report','./acw','./trigger','./dialer','./preview','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','hour','get','resolve','getAgents','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initTriggers','getTemplates','initTemplates','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports'];(function(_0x51e2de,_0x1dcadd){var _0x25f7a3=function(_0x30e430){while(--_0x30e430){_0x51e2de['push'](_0x51e2de['shift']());}};_0x25f7a3(++_0x1dcadd);}(_0xf08d,0x14e));var _0xdf08=function(_0x1edfac,_0x39378a){_0x1edfac=_0x1edfac-0x0;var _0x599ae7=_0xf08d[_0x1edfac];return _0x599ae7;};'use strict';var BPromise=require(_0xdf08('0x0'));var util=require(_0xdf08('0x1'));var moment=require(_0xdf08('0x2'));var server=require(_0xdf08('0x3'));var Realtime=require('./realtime');var Report=require(_0xdf08('0x4'));var Acw=require(_0xdf08('0x5'));var Trigger=require(_0xdf08('0x6'));var Dialer=require(_0xdf08('0x7'));var Preview=require(_0xdf08('0x8'));var Fax=require('./fax');var user=require('./rpc/user');var voiceQueue=require(_0xdf08('0x9'));var voiceQueueReport=require(_0xdf08('0xa'));var voiceCallReport=require(_0xdf08('0xb'));var trunk=require('./rpc/trunk');var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xdf08('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xdf08('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0xdf08('0xe'));var salesforce=require(_0xdf08('0xf'));var sugarcrm=require(_0xdf08('0x10'));var freshdesk=require(_0xdf08('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0xdf08('0x12'));var freshsales=require(_0xdf08('0x13'));var servicenow=require(_0xdf08('0x14'));var dynamics365=require(_0xdf08('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xdf08('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xdf08('0x17')](_0xdf08('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xdf08('0x18')]()['then'](user[_0xdf08('0x19')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x1b')]())[_0xdf08('0x1a')](user[_0xdf08('0x1c')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x1d')]())[_0xdf08('0x1a')](trunk[_0xdf08('0x1e')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x1f')]())[_0xdf08('0x1a')](voiceQueue['getVoiceQueues']())[_0xdf08('0x1a')](realtime[_0xdf08('0x20')]())['then'](trigger['getTriggers']())[_0xdf08('0x1a')](realtime[_0xdf08('0x21')]())[_0xdf08('0x1a')](template[_0xdf08('0x22')]())['then'](realtime[_0xdf08('0x23')]())[_0xdf08('0x1a')](zendesk['getZendeskAccounts']())['then'](realtime['initZendeskAccounts']())['then'](salesforce[_0xdf08('0x24')]())[_0xdf08('0x1a')](realtime['initSalesforceAccounts']())[_0xdf08('0x1a')](sugarcrm[_0xdf08('0x25')]())['then'](realtime[_0xdf08('0x26')]())[_0xdf08('0x1a')](freshdesk[_0xdf08('0x27')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x28')]())['then'](desk[_0xdf08('0x29')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x2a')]())[_0xdf08('0x1a')](zoho[_0xdf08('0x2b')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x2c')]())['then'](vtiger[_0xdf08('0x2d')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x2e')]())[_0xdf08('0x1a')](freshsales[_0xdf08('0x2f')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x30')]())[_0xdf08('0x1a')](servicenow[_0xdf08('0x31')]())['then'](realtime['initServicenowAccounts']())[_0xdf08('0x1a')](dynamics365[_0xdf08('0x32')]())['then'](realtime[_0xdf08('0x33')]())[_0xdf08('0x1a')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())[_0xdf08('0x1a')](voiceExtension[_0xdf08('0x34')]())['then'](realtime[_0xdf08('0x35')]())[_0xdf08('0x1a')](faxAccount[_0xdf08('0x36')]())[_0xdf08('0x1a')](realtime['initFaxAccounts']())['then'](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xdf08('0x1a')](voiceQueueReport[_0xdf08('0x37')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x38')]())[_0xdf08('0x1a')](cmHopperHistory[_0xdf08('0x39')]())[_0xdf08('0x1a')](realtime[_0xdf08('0x3a')]())[_0xdf08('0x1a')](cmHopperHistory['getCampaignHopperHistory']())[_0xdf08('0x1a')](realtime[_0xdf08('0x3b')]())[_0xdf08('0x1a')](voiceCallReport[_0xdf08('0x3c')]())[_0xdf08('0x1a')](realtime['initVoiceCallReports']())[_0xdf08('0x1a')](function(_0x14017a){})[_0xdf08('0x3d')](function(_0x8fbb77){console[_0xdf08('0x3e')](_0x8fbb77);});}function main(){return server[_0xdf08('0x3f')](realtime,preview,fax)[_0xdf08('0x1a')](function(_0x946e29){return initRealtime();})[_0xdf08('0x1a')](function(){return initParams();})[_0xdf08('0x1a')](function(){report[_0xdf08('0x40')]();setInterval(initRealtime,0x1388);})[_0xdf08('0x3d')](function(_0x37f55a){console[_0xdf08('0x3e')](_0x37f55a);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index f879163..f459500 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 _0x902a=['toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x902a,0x87));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa902('0x0'));var util=require(_0xa902('0x1'));var moment=require(_0xa902('0x2'));var md5=require(_0xa902('0x3'));var Redis=require(_0xa902('0x4'));var config=require(_0xa902('0x5'));config[_0xa902('0x6')]=_[_0xa902('0x7')](config[_0xa902('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xa902('0x8'))(new Redis(config['redis']));function Agent(_0x49f119){this['id']=_0x49f119['id']||0x0;this['name']=_0x49f119[_0xa902('0x9')]||'';this[_0xa902('0xa')]=_0x49f119[_0xa902('0xa')]||'';this['accountcode']=_0x49f119[_0xa902('0xb')]||'';this['fullname']=_0x49f119[_0xa902('0xc')]||'';this[_0xa902('0xd')]=_0xa902('0xe');this[_0xa902('0xf')]=0x0;this[_0xa902('0x10')]='unknown';this['address']='';this[_0xa902('0x11')]='';this[_0xa902('0x12')]='';this[_0xa902('0x13')]='';this['online']=_0x49f119[_0xa902('0x14')]||![];this[_0xa902('0x15')]='unknown';this[_0xa902('0x16')]=0x0;this[_0xa902('0x17')]='';this[_0xa902('0x18')]='';this[_0xa902('0x19')]=![];this[_0xa902('0x1a')]=![];this[_0xa902('0x3')]='';}Agent[_0xa902('0x1b')][_0xa902('0x1c')]=function(_0x370535){var _0x3daaf9;if(_0x370535&&_0x370535[_0xa902('0xd')]){_0x3daaf9=_0x370535[_0xa902('0xd')][_0xa902('0x1d')]();switch(_0x3daaf9){case _0xa902('0x1e'):_0x3daaf9=_0xa902('0x1f');break;case _0xa902('0x20'):_0x3daaf9=_0xa902('0x21');break;}}if(_0x3daaf9&&this['voiceStatus']!==_0x3daaf9||_0x370535[_0xa902('0x22')]){this['voiceStatusTime']=_[_0xa902('0x23')](moment()['format']('x'));}if(_0x3daaf9){this[_0xa902('0x15')]=_0x3daaf9;}var _0x55842f={'id':this['id'],'name':this[_0xa902('0x9')],'email':this['email'],'accountcode':this[_0xa902('0xb')],'fullname':this[_0xa902('0xc')],'state':this['state'],'stateTime':this[_0xa902('0xf')],'status':this['status'],'address':this['address'],'online':this[_0xa902('0x14')],'voiceStatus':this[_0xa902('0x15')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xa902('0x17')],'voiceStatusQueue':this[_0xa902('0x18')],'interface':this[_0xa902('0x13')],'onhold':this[_0xa902('0x19')]};var _0x253a5e=md5(JSON[_0xa902('0x24')](_0x55842f));if(this[_0xa902('0x3')]!==_0x253a5e){this[_0xa902('0x3')]=_0x253a5e;io['to'](util['format'](_0xa902('0x25'),_0x55842f['name']))[_0xa902('0x26')](_0xa902('0x27'),_0x55842f);}};module[_0xa902('0x28')]=Agent; \ No newline at end of file +var _0xcdee=['voiceStatusQueue','onhold','prototype','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format','status','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber'];(function(_0xcdac34,_0x43f665){var _0x269d23=function(_0x3f2d6f){while(--_0x3f2d6f){_0xcdac34['push'](_0xcdac34['shift']());}};_0x269d23(++_0x43f665);}(_0xcdee,0x85));var _0xecde=function(_0x224964,_0x20b12d){_0x224964=_0x224964-0x0;var _0x411077=_0xcdee[_0x224964];return _0x411077;};'use strict';var _=require(_0xecde('0x0'));var util=require(_0xecde('0x1'));var moment=require(_0xecde('0x2'));var md5=require(_0xecde('0x3'));var Redis=require(_0xecde('0x4'));var config=require(_0xecde('0x5'));config[_0xecde('0x6')]=_['defaults'](config[_0xecde('0x6')],{'host':_0xecde('0x7'),'port':0x18eb});var io=require(_0xecde('0x8'))(new Redis(config['redis']));function Agent(_0x56c656){this['id']=_0x56c656['id']||0x0;this[_0xecde('0x9')]=_0x56c656['name']||'';this['email']=_0x56c656[_0xecde('0xa')]||'';this[_0xecde('0xb')]=_0x56c656[_0xecde('0xb')]||'';this[_0xecde('0xc')]=_0x56c656[_0xecde('0xc')]||'';this[_0xecde('0xd')]='unknown';this[_0xecde('0xe')]=0x0;this['status']='unknown';this[_0xecde('0xf')]='';this[_0xecde('0x10')]='';this[_0xecde('0x11')]='';this[_0xecde('0x12')]='';this[_0xecde('0x13')]=_0x56c656['online']||![];this[_0xecde('0x14')]='unknown';this[_0xecde('0x15')]=0x0;this[_0xecde('0x16')]='';this[_0xecde('0x17')]='';this[_0xecde('0x18')]=![];this['local']=![];this[_0xecde('0x3')]='';}Agent[_0xecde('0x19')]['updateStatusRealtime']=function(_0x5582e3){var _0x25f3d3;if(_0x5582e3&&_0x5582e3['state']){_0x25f3d3=_0x5582e3[_0xecde('0xd')][_0xecde('0x1a')]();switch(_0x25f3d3){case _0xecde('0x1b'):_0x25f3d3=_0xecde('0x1c');break;case _0xecde('0x1d'):_0x25f3d3='talking';break;}}if(_0x25f3d3&&this[_0xecde('0x14')]!==_0x25f3d3||_0x5582e3[_0xecde('0x1e')]){this['voiceStatusTime']=_[_0xecde('0x1f')](moment()[_0xecde('0x20')]('x'));}if(_0x25f3d3){this[_0xecde('0x14')]=_0x25f3d3;}var _0x4c7c5d={'id':this['id'],'name':this[_0xecde('0x9')],'email':this[_0xecde('0xa')],'accountcode':this[_0xecde('0xb')],'fullname':this[_0xecde('0xc')],'state':this[_0xecde('0xd')],'stateTime':this[_0xecde('0xe')],'status':this[_0xecde('0x21')],'address':this[_0xecde('0xf')],'online':this[_0xecde('0x13')],'voiceStatus':this[_0xecde('0x14')],'voiceStatusTime':this[_0xecde('0x15')],'voiceStatusCallerIdNumber':this[_0xecde('0x16')],'voiceStatusQueue':this[_0xecde('0x17')],'interface':this[_0xecde('0x12')],'onhold':this[_0xecde('0x18')]};var _0x175b1a=md5(JSON[_0xecde('0x22')](_0x4c7c5d));if(this['md5']!==_0x175b1a){this[_0xecde('0x3')]=_0x175b1a;io['to'](util['format'](_0xecde('0x23'),_0x4c7c5d['name']))[_0xecde('0x24')](_0xecde('0x25'),_0x4c7c5d);}};module[_0xecde('0x26')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 4df02e5..131c151 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 _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x2e5a67,_0x37dadb){var _0x1f37b9=function(_0x47a076){while(--_0x47a076){_0x2e5a67['push'](_0x2e5a67['shift']());}};_0x1f37b9(++_0x37dadb);}(_0x757a,0xde));var _0xa757=function(_0x5a3a37,_0x27ec44){_0x5a3a37=_0x5a3a37-0x0;var _0x13d054=_0x757a[_0x5a3a37];return _0x13d054;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file +var _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x17ffac,_0x131aa5){var _0x9c54cf=function(_0x1b097f){while(--_0x1b097f){_0x17ffac['push'](_0x17ffac['shift']());}};_0x9c54cf(++_0x131aa5);}(_0xb10b,0x12a));var _0xbb10=function(_0x334599,_0x4b1cfa){_0x334599=_0x334599-0x0;var _0x4cdff2=_0xb10b[_0x334599];return _0x4cdff2;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 0a418d0..f64423c 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 _0x751c=['context','uniqueid','linkedid','exten','answered','endtime','unmanaged','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitors','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridname','connectedlinename'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x751c,0x69));var _0xc751=function(_0x86ebfc,_0x4484eb){_0x86ebfc=_0x86ebfc-0x0;var _0xd6af20=_0x751c[_0x86ebfc];return _0xd6af20;};'use strict';function Channel(){this[_0xc751('0x0')]=null;this[_0xc751('0x1')]='';this[_0xc751('0x2')]='';this['calleridnum']=0x0;this[_0xc751('0x3')]='';this['connectedlinenum']=undefined;this[_0xc751('0x4')]=undefined;this['accountcode']=0x0;this[_0xc751('0x5')]='';this[_0xc751('0x6')]=0x0;this[_0xc751('0x7')]=0x0;this[_0xc751('0x8')]=0x0;this[_0xc751('0x9')]=![];this['answertime']=null;this[_0xc751('0xa')]=null;this[_0xc751('0xb')]=![];this['abandoned']=![];this[_0xc751('0xc')]='';this[_0xc751('0xd')]='';this['duration']=0x0;this[_0xc751('0xe')]=0x0;this[_0xc751('0xf')]=0x0;this[_0xc751('0x10')]=null;this[_0xc751('0x11')]=null;this[_0xc751('0x12')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0xc751('0x13')]=[];this['transfercalleridnum']=undefined;this[_0xc751('0x14')]=undefined;this['mohtime']=0x0;}module[_0xc751('0x15')]=Channel; \ No newline at end of file +var _0x1678=['queue','monitors','transfercalleridnum','exports','starttime','channel','destinationchannel','calleridnum','calleridname','accountcode','context','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','lastapplication','billableseconds','holdtime','tag','disposition','monitor','monitorFilename'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1678,0x17b));var _0x8167=function(_0x4e2f91,_0x9d067e){_0x4e2f91=_0x4e2f91-0x0;var _0x2f21d7=_0x1678[_0x4e2f91];return _0x2f21d7;};'use strict';function Channel(){this[_0x8167('0x0')]=null;this[_0x8167('0x1')]='';this[_0x8167('0x2')]='';this[_0x8167('0x3')]=0x0;this[_0x8167('0x4')]='';this['connectedlinenum']=undefined;this['connectedlinename']=undefined;this[_0x8167('0x5')]=0x0;this[_0x8167('0x6')]='';this[_0x8167('0x7')]=0x0;this[_0x8167('0x8')]=0x0;this[_0x8167('0x9')]=0x0;this[_0x8167('0xa')]=![];this[_0x8167('0xb')]=null;this['endtime']=null;this[_0x8167('0xc')]=![];this[_0x8167('0xd')]=![];this[_0x8167('0xe')]='';this['lastdata']='';this['duration']=0x0;this[_0x8167('0xf')]=0x0;this[_0x8167('0x10')]=0x0;this['type']=null;this[_0x8167('0x11')]=null;this[_0x8167('0x12')]=null;this[_0x8167('0x13')]=![];this[_0x8167('0x14')]=null;this[_0x8167('0x15')]=null;this[_0x8167('0x16')]=[];this[_0x8167('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this['mohtime']=0x0;}module[_0x8167('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 09ef0cb..67d4198 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 _0x6aa7=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x208d19,_0x530870){var _0x53088c=function(_0x5cc450){while(--_0x5cc450){_0x208d19['push'](_0x208d19['shift']());}};_0x53088c(++_0x530870);}(_0x6aa7,0x178));var _0x76aa=function(_0x5d8921,_0x4606e6){_0x5d8921=_0x5d8921-0x0;var _0x40e2a7=_0x6aa7[_0x5d8921];return _0x40e2a7;};'use strict';function DeskAccount(_0x8de1e4){this['id']=_0x8de1e4['id']||0x0;this['name']=_0x8de1e4[_0x76aa('0x0')]||'';this[_0x76aa('0x1')]=_0x8de1e4[_0x76aa('0x1')]||'';this[_0x76aa('0x2')]=_0x8de1e4['remoteUri']||'';this[_0x76aa('0x3')]=_0x8de1e4[_0x76aa('0x3')]||'';this[_0x76aa('0x4')]=_0x8de1e4['password']||'';this['consumerKey']=_0x8de1e4[_0x76aa('0x5')]||'';this['consumerSecret']=_0x8de1e4[_0x76aa('0x6')]||'';this[_0x76aa('0x7')]=_0x8de1e4[_0x76aa('0x7')]||'';this['tokenSecret']=_0x8de1e4[_0x76aa('0x8')]||'';this[_0x76aa('0x9')]=_0x8de1e4[_0x76aa('0x9')]||'';this['serverUrl']=_0x8de1e4[_0x76aa('0xa')]||'';this[_0x76aa('0xb')]=_0x8de1e4[_0x76aa('0xb')]||{};}module[_0x76aa('0xc')]=DeskAccount; \ No newline at end of file +var _0x9009=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports'];(function(_0x370852,_0x2c7e62){var _0x40cc7e=function(_0x34a439){while(--_0x34a439){_0x370852['push'](_0x370852['shift']());}};_0x40cc7e(++_0x2c7e62);}(_0x9009,0x1d4));var _0x9900=function(_0x6ae32e,_0x5dd0e5){_0x6ae32e=_0x6ae32e-0x0;var _0x399a3b=_0x9009[_0x6ae32e];return _0x399a3b;};'use strict';function DeskAccount(_0x3b99f0){this['id']=_0x3b99f0['id']||0x0;this['name']=_0x3b99f0[_0x9900('0x0')]||'';this[_0x9900('0x1')]=_0x3b99f0['username']||'';this[_0x9900('0x2')]=_0x3b99f0[_0x9900('0x2')]||'';this[_0x9900('0x3')]=_0x3b99f0[_0x9900('0x3')]||'';this['password']=_0x3b99f0[_0x9900('0x4')]||'';this[_0x9900('0x5')]=_0x3b99f0['consumerKey']||'';this['consumerSecret']=_0x3b99f0[_0x9900('0x6')]||'';this[_0x9900('0x7')]=_0x3b99f0['token']||'';this[_0x9900('0x8')]=_0x3b99f0[_0x9900('0x8')]||'';this[_0x9900('0x9')]=_0x3b99f0[_0x9900('0x9')]||'';this['serverUrl']=_0x3b99f0[_0x9900('0xa')]||'';this[_0x9900('0xb')]=_0x3b99f0[_0x9900('0xb')]||{};}module[_0x9900('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 35bf198..b353051 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 _0x4e44=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4e44,0x15e));var _0x44e4=function(_0x2b0c7c,_0x305e32){_0x2b0c7c=_0x2b0c7c-0x0;var _0x1e847a=_0x4e44[_0x2b0c7c];return _0x1e847a;};'use strict';function Dynamics365Account(_0x56b7ff){this['id']=_0x56b7ff['id']||0x0;this[_0x44e4('0x0')]=_0x56b7ff['name']||'';this[_0x44e4('0x1')]=_0x56b7ff[_0x44e4('0x1')]||'';this[_0x44e4('0x2')]=_0x56b7ff[_0x44e4('0x2')]||'';this[_0x44e4('0x3')]=_0x56b7ff[_0x44e4('0x3')]||'';this[_0x44e4('0x4')]=_0x56b7ff[_0x44e4('0x4')]||'';this[_0x44e4('0x5')]=_0x56b7ff['clientId']||'';this[_0x44e4('0x6')]=_0x56b7ff[_0x44e4('0x6')]||{};this[_0x44e4('0x7')]=_0x56b7ff['serverUrl']||'';this[_0x44e4('0x8')]=_0x56b7ff[_0x44e4('0x8')]||{};}module[_0x44e4('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x2085=['username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','name'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x2085,0x86));var _0x5208=function(_0x133fc0,_0x1edda8){_0x133fc0=_0x133fc0-0x0;var _0x4ce619=_0x2085[_0x133fc0];return _0x4ce619;};'use strict';function Dynamics365Account(_0x2769cf){this['id']=_0x2769cf['id']||0x0;this[_0x5208('0x0')]=_0x2769cf[_0x5208('0x0')]||'';this[_0x5208('0x1')]=_0x2769cf[_0x5208('0x1')]||'';this['password']=_0x2769cf[_0x5208('0x2')]||'';this[_0x5208('0x3')]=_0x2769cf[_0x5208('0x3')]||'';this[_0x5208('0x4')]=_0x2769cf[_0x5208('0x4')]||'';this[_0x5208('0x5')]=_0x2769cf[_0x5208('0x5')]||'';this[_0x5208('0x6')]=_0x2769cf[_0x5208('0x6')]||{};this[_0x5208('0x7')]=_0x2769cf['serverUrl']||'';this[_0x5208('0x8')]=_0x2769cf['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 5850958..d9a6bf9 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 _0x8a9a=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x3ef5bb,_0x27e3ac){var _0x59d620=function(_0x46cd45){while(--_0x46cd45){_0x3ef5bb['push'](_0x3ef5bb['shift']());}};_0x59d620(++_0x27e3ac);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8a9a[_0x422905];return _0x33dc6c;};'use strict';function FaxAccount(_0x1a5c9c){this['id']=_0x1a5c9c['id']||0x0;this[_0xa8a9('0x0')]=_0x1a5c9c[_0xa8a9('0x0')]||'';this[_0xa8a9('0x1')]=_0x1a5c9c[_0xa8a9('0x1')];this[_0xa8a9('0x2')]=_0x1a5c9c[_0xa8a9('0x2')];this[_0xa8a9('0x3')]=_0x1a5c9c[_0xa8a9('0x3')];this[_0xa8a9('0x4')]=_0x1a5c9c[_0xa8a9('0x4')];this[_0xa8a9('0x5')]=_0x1a5c9c[_0xa8a9('0x5')]||0x960;this['maxrate']=_0x1a5c9c[_0xa8a9('0x6')]||0x3840;this['modem']=_0x1a5c9c[_0xa8a9('0x7')]||_0xa8a9('0x8');this[_0xa8a9('0x9')]=_0x1a5c9c[_0xa8a9('0x9')]||'no';this[_0xa8a9('0xa')]=_0x1a5c9c['faxdetect']||'no';this[_0xa8a9('0xb')]=_0x1a5c9c[_0xa8a9('0xb')]||0x1388;this['tech']=_0x1a5c9c[_0xa8a9('0xc')]||'SIP';this[_0xa8a9('0xd')]=_0x1a5c9c[_0xa8a9('0xd')]?_0x1a5c9c['Trunk']:undefined;this[_0xa8a9('0xe')]=_0x1a5c9c[_0xa8a9('0xe')];this[_0xa8a9('0xf')]=_0x1a5c9c[_0xa8a9('0xf')];}module[_0xa8a9('0x10')]=FaxAccount; \ No newline at end of file +var _0x5b7c=['tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x5b7c,0x9e));var _0xc5b7=function(_0x108a85,_0x1cfac2){_0x108a85=_0x108a85-0x0;var _0x1bed0c=_0x5b7c[_0x108a85];return _0x1bed0c;};'use strict';function FaxAccount(_0x5a09e3){this['id']=_0x5a09e3['id']||0x0;this[_0xc5b7('0x0')]=_0x5a09e3[_0xc5b7('0x0')]||'';this['description']=_0x5a09e3[_0xc5b7('0x1')];this[_0xc5b7('0x2')]=_0x5a09e3[_0xc5b7('0x2')];this[_0xc5b7('0x3')]=_0x5a09e3[_0xc5b7('0x3')];this['localstationid']=_0x5a09e3[_0xc5b7('0x4')];this[_0xc5b7('0x5')]=_0x5a09e3[_0xc5b7('0x5')]||0x960;this[_0xc5b7('0x6')]=_0x5a09e3[_0xc5b7('0x6')]||0x3840;this[_0xc5b7('0x7')]=_0x5a09e3[_0xc5b7('0x7')]||_0xc5b7('0x8');this[_0xc5b7('0x9')]=_0x5a09e3[_0xc5b7('0x9')]||'no';this[_0xc5b7('0xa')]=_0x5a09e3[_0xc5b7('0xa')]||'no';this[_0xc5b7('0xb')]=_0x5a09e3['t38timeout']||0x1388;this['tech']=_0x5a09e3[_0xc5b7('0xc')]||'SIP';this['Trunk']=_0x5a09e3[_0xc5b7('0xd')]?_0x5a09e3[_0xc5b7('0xd')]:undefined;this[_0xc5b7('0xe')]=_0x5a09e3[_0xc5b7('0xe')];this[_0xc5b7('0xf')]=_0x5a09e3[_0xc5b7('0xf')];}module[_0xc5b7('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 2958d29..4a53d12 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 _0xa879=['name','username','apiKey','token','remoteUri','serverUrl','exports'];(function(_0x323845,_0x2ea430){var _0x13c2c8=function(_0x2fd135){while(--_0x2fd135){_0x323845['push'](_0x323845['shift']());}};_0x13c2c8(++_0x2ea430);}(_0xa879,0x1ab));var _0x9a87=function(_0x36a442,_0x33a941){_0x36a442=_0x36a442-0x0;var _0x28e6e1=_0xa879[_0x36a442];return _0x28e6e1;};'use strict';function FreshdeskAccount(_0x14b452){this['id']=_0x14b452['id']||0x0;this[_0x9a87('0x0')]=_0x14b452[_0x9a87('0x0')]||'';this['username']=_0x14b452[_0x9a87('0x1')]||'';this[_0x9a87('0x2')]=_0x14b452[_0x9a87('0x3')]||'';this[_0x9a87('0x4')]=_0x14b452['remoteUri']||'';this[_0x9a87('0x5')]=_0x14b452[_0x9a87('0x5')]||'';this['Configurations']=_0x14b452['Configurations']||{};}module[_0x9a87('0x6')]=FreshdeskAccount; \ No newline at end of file +var _0xd8a1=['serverUrl','Configurations','name','username','apiKey','remoteUri'];(function(_0x577a2e,_0x3816f0){var _0x3ac138=function(_0x5ba47c){while(--_0x5ba47c){_0x577a2e['push'](_0x577a2e['shift']());}};_0x3ac138(++_0x3816f0);}(_0xd8a1,0x1b8));var _0x1d8a=function(_0x2fa2dd,_0x2298fd){_0x2fa2dd=_0x2fa2dd-0x0;var _0x289213=_0xd8a1[_0x2fa2dd];return _0x289213;};'use strict';function FreshdeskAccount(_0x13b080){this['id']=_0x13b080['id']||0x0;this[_0x1d8a('0x0')]=_0x13b080[_0x1d8a('0x0')]||'';this[_0x1d8a('0x1')]=_0x13b080[_0x1d8a('0x1')]||'';this[_0x1d8a('0x2')]=_0x13b080['token']||'';this[_0x1d8a('0x3')]=_0x13b080['remoteUri']||'';this[_0x1d8a('0x4')]=_0x13b080[_0x1d8a('0x4')]||'';this[_0x1d8a('0x5')]=_0x13b080[_0x1d8a('0x5')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 1e08ac1..d4f9ba9 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 _0xb1ef=['username','apiKey','token','remoteUri','serverUrl','exports','name'];(function(_0x3e5608,_0x8b6979){var _0x4128d3=function(_0x137c60){while(--_0x137c60){_0x3e5608['push'](_0x3e5608['shift']());}};_0x4128d3(++_0x8b6979);}(_0xb1ef,0x156));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';function FreshsalesAccount(_0x36d435){this['id']=_0x36d435['id']||0x0;this[_0xfb1e('0x0')]=_0x36d435[_0xfb1e('0x0')]||'';this[_0xfb1e('0x1')]=_0x36d435[_0xfb1e('0x1')]||'';this[_0xfb1e('0x2')]=_0x36d435[_0xfb1e('0x3')]||'';this[_0xfb1e('0x4')]=_0x36d435[_0xfb1e('0x4')]||'';this[_0xfb1e('0x5')]=_0x36d435[_0xfb1e('0x5')]||'';this['Configurations']=_0x36d435['Configurations']||{};}module[_0xfb1e('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x35d3=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x3b1e36,_0x343134){var _0x3f483b=function(_0x434e9d){while(--_0x434e9d){_0x3b1e36['push'](_0x3b1e36['shift']());}};_0x3f483b(++_0x343134);}(_0x35d3,0xe2));var _0x335d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35d3[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x2c8872){this['id']=_0x2c8872['id']||0x0;this[_0x335d('0x0')]=_0x2c8872[_0x335d('0x0')]||'';this[_0x335d('0x1')]=_0x2c8872[_0x335d('0x1')]||'';this[_0x335d('0x2')]=_0x2c8872[_0x335d('0x3')]||'';this[_0x335d('0x4')]=_0x2c8872[_0x335d('0x4')]||'';this[_0x335d('0x5')]=_0x2c8872['serverUrl']||'';this[_0x335d('0x6')]=_0x2c8872[_0x335d('0x6')]||{};}module[_0x335d('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 d4658a5..3438b78 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 _0x20b0=['priority','holdtime','lastAssignedTo','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten'];(function(_0x26544f,_0x79f614){var _0x2fff64=function(_0x4d1a11){while(--_0x4d1a11){_0x26544f['push'](_0x26544f['shift']());}};_0x2fff64(++_0x79f614);}(_0x20b0,0xb5));var _0x020b=function(_0x1f9fdb,_0x2b822f){_0x1f9fdb=_0x1f9fdb-0x0;var _0xc11135=_0x20b0[_0x1f9fdb];return _0xc11135;};'use strict';function QueueReport(){this[_0x020b('0x0')]=_0x020b('0x1');this['uniqueid']='';this[_0x020b('0x2')]='';this[_0x020b('0x3')]='';this[_0x020b('0x4')]='';this[_0x020b('0x5')]=null;this[_0x020b('0x6')]=null;this[_0x020b('0x7')]=0x1;this[_0x020b('0x8')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x020b('0x9')]=![];this[_0x020b('0xa')]=null;this[_0x020b('0xb')]=![];this[_0x020b('0xc')]=null;this[_0x020b('0xd')]=0x1;this[_0x020b('0xe')]='';this[_0x020b('0xf')]='';this['connectedlinename']='';this[_0x020b('0x10')]='';this[_0x020b('0x11')]='';this[_0x020b('0x12')]='';this[_0x020b('0x13')]='';this[_0x020b('0x14')]=0x0;this['assigned']=![];this[_0x020b('0x15')]='';this[_0x020b('0x16')]=0x0;this[_0x020b('0x17')]={};}module[_0x020b('0x18')]=QueueReport; \ No newline at end of file +var _0xf17d=['queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallerexit'];(function(_0x117f7b,_0x2e1580){var _0x541101=function(_0x205138){while(--_0x205138){_0x117f7b['push'](_0x117f7b['shift']());}};_0x541101(++_0x2e1580);}(_0xf17d,0x175));var _0xdf17=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xf17d[_0x397e5f];return _0x5302b8;};'use strict';function QueueReport(){this[_0xdf17('0x0')]=_0xdf17('0x1');this[_0xdf17('0x2')]='';this[_0xdf17('0x3')]='';this[_0xdf17('0x4')]='';this['queue']='';this[_0xdf17('0x5')]=null;this[_0xdf17('0x6')]=null;this[_0xdf17('0x7')]=0x1;this['count']=0x1;this[_0xdf17('0x8')]=![];this[_0xdf17('0x9')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xdf17('0xa')]=![];this[_0xdf17('0xb')]=null;this['originalposition']=0x1;this[_0xdf17('0xc')]='';this[_0xdf17('0xd')]='';this[_0xdf17('0xe')]='';this[_0xdf17('0xf')]='';this['context']='';this[_0xdf17('0x10')]='';this[_0xdf17('0x11')]='';this[_0xdf17('0x12')]=0x0;this[_0xdf17('0x13')]=![];this[_0xdf17('0x14')]='';this[_0xdf17('0x15')]=0x0;this[_0xdf17('0x16')]={};}module[_0xdf17('0x17')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 3ba5a8c..5ade961 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 _0x451e=['clientSecret','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x2703cf,_0x526b31){var _0x28f18a=function(_0x10e33b){while(--_0x10e33b){_0x2703cf['push'](_0x2703cf['shift']());}};_0x28f18a(++_0x526b31);}(_0x451e,0x1d4));var _0xe451=function(_0x57f9f4,_0x264bb4){_0x57f9f4=_0x57f9f4-0x0;var _0x3cf8ba=_0x451e[_0x57f9f4];return _0x3cf8ba;};'use strict';function SalesforceAccount(_0x4ff87b){this['id']=_0x4ff87b['id']||0x0;this[_0xe451('0x0')]=_0x4ff87b[_0xe451('0x0')]||'';this[_0xe451('0x1')]=_0x4ff87b['username']||'';this[_0xe451('0x2')]=_0x4ff87b[_0xe451('0x2')]||'';this[_0xe451('0x3')]=_0x4ff87b[_0xe451('0x3')]||'';this[_0xe451('0x4')]=_0x4ff87b['clientId']||'';this[_0xe451('0x5')]=_0x4ff87b[_0xe451('0x5')]||'';this['securityToken']=_0x4ff87b['securityToken']||'';this['type']=_0x4ff87b[_0xe451('0x6')]||_0xe451('0x7');this[_0xe451('0x8')]=_0x4ff87b[_0xe451('0x8')]||'';this[_0xe451('0x9')]=_0x4ff87b['Configurations']||{};}module[_0xe451('0xa')]=SalesforceAccount; \ No newline at end of file +var _0x1938=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1938,0x1a0));var _0x8193=function(_0x453b45,_0x557923){_0x453b45=_0x453b45-0x0;var _0x33cf93=_0x1938[_0x453b45];return _0x33cf93;};'use strict';function SalesforceAccount(_0xb7f0d3){this['id']=_0xb7f0d3['id']||0x0;this[_0x8193('0x0')]=_0xb7f0d3['name']||'';this[_0x8193('0x1')]=_0xb7f0d3[_0x8193('0x1')]||'';this[_0x8193('0x2')]=_0xb7f0d3[_0x8193('0x2')]||'';this[_0x8193('0x3')]=_0xb7f0d3['password']||'';this[_0x8193('0x4')]=_0xb7f0d3[_0x8193('0x4')]||'';this['clientSecret']=_0xb7f0d3[_0x8193('0x5')]||'';this[_0x8193('0x6')]=_0xb7f0d3[_0x8193('0x6')]||'';this[_0x8193('0x7')]=_0xb7f0d3[_0x8193('0x7')]||_0x8193('0x8');this[_0x8193('0x9')]=_0xb7f0d3[_0x8193('0x9')]||'';this[_0x8193('0xa')]=_0xb7f0d3[_0x8193('0xa')]||{};}module[_0x8193('0xb')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 98c9da7..2467b76 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 _0xebd0=['serverUrl','Configurations','username','password','remoteUri'];(function(_0x45b4c4,_0x3e041f){var _0x3e688b=function(_0x2aaddb){while(--_0x2aaddb){_0x45b4c4['push'](_0x45b4c4['shift']());}};_0x3e688b(++_0x3e041f);}(_0xebd0,0x13d));var _0x0ebd=function(_0xc4bbf1,_0x199e7d){_0xc4bbf1=_0xc4bbf1-0x0;var _0x59622d=_0xebd0[_0xc4bbf1];return _0x59622d;};'use strict';function ServicenowAccount(_0x2f5999){this['id']=_0x2f5999['id']||0x0;this['name']=_0x2f5999['name']||'';this[_0x0ebd('0x0')]=_0x2f5999['username']||'';this['password']=_0x2f5999[_0x0ebd('0x1')]||'';this[_0x0ebd('0x2')]=_0x2f5999[_0x0ebd('0x2')]||'';this[_0x0ebd('0x3')]=_0x2f5999[_0x0ebd('0x3')]||'';this[_0x0ebd('0x4')]=_0x2f5999[_0x0ebd('0x4')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0xc9ed=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x30890f,_0x4ddead){var _0x25117f=function(_0x4ba7b1){while(--_0x4ba7b1){_0x30890f['push'](_0x30890f['shift']());}};_0x25117f(++_0x4ddead);}(_0xc9ed,0x111));var _0xdc9e=function(_0x237546,_0xa81b26){_0x237546=_0x237546-0x0;var _0x233e29=_0xc9ed[_0x237546];return _0x233e29;};'use strict';function ServicenowAccount(_0x55f425){this['id']=_0x55f425['id']||0x0;this[_0xdc9e('0x0')]=_0x55f425['name']||'';this[_0xdc9e('0x1')]=_0x55f425[_0xdc9e('0x1')]||'';this[_0xdc9e('0x2')]=_0x55f425['password']||'';this[_0xdc9e('0x3')]=_0x55f425['remoteUri']||'';this[_0xdc9e('0x4')]=_0x55f425[_0xdc9e('0x4')]||'';this[_0xdc9e('0x5')]=_0x55f425[_0xdc9e('0x5')]||{};}module[_0xdc9e('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index ab4d73c..b8f1225 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 _0x1cb7=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x92a3d9,_0xcf3970){var _0x56458b=function(_0x36a48c){while(--_0x36a48c){_0x92a3d9['push'](_0x92a3d9['shift']());}};_0x56458b(++_0xcf3970);}(_0x1cb7,0xa7));var _0x71cb=function(_0x1bda25,_0x179798){_0x1bda25=_0x1bda25-0x0;var _0x1725f2=_0x1cb7[_0x1bda25];return _0x1725f2;};'use strict';function SugarcrmAccount(_0x5a71a2){this['id']=_0x5a71a2['id']||0x0;this[_0x71cb('0x0')]=_0x5a71a2[_0x71cb('0x0')]||'';this[_0x71cb('0x1')]=_0x5a71a2[_0x71cb('0x1')]||'';this[_0x71cb('0x2')]=_0x5a71a2[_0x71cb('0x2')]||'';this[_0x71cb('0x3')]=_0x5a71a2[_0x71cb('0x3')]||'';this[_0x71cb('0x4')]=_0x5a71a2[_0x71cb('0x4')]||'';this['Configurations']=_0x5a71a2[_0x71cb('0x5')]||{};}module[_0x71cb('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xe648=['exports','name','username','password','serverUrl'];(function(_0xfabb21,_0x28f65c){var _0x165b39=function(_0x55fe96){while(--_0x55fe96){_0xfabb21['push'](_0xfabb21['shift']());}};_0x165b39(++_0x28f65c);}(_0xe648,0xba));var _0x8e64=function(_0x61baea,_0x1d3ab8){_0x61baea=_0x61baea-0x0;var _0x124d23=_0xe648[_0x61baea];return _0x124d23;};'use strict';function SugarcrmAccount(_0x5bc043){this['id']=_0x5bc043['id']||0x0;this[_0x8e64('0x0')]=_0x5bc043[_0x8e64('0x0')]||'';this['username']=_0x5bc043[_0x8e64('0x1')]||'';this[_0x8e64('0x2')]=_0x5bc043[_0x8e64('0x2')]||'';this['remoteUri']=_0x5bc043['remoteUri']||'';this[_0x8e64('0x3')]=_0x5bc043[_0x8e64('0x3')]||'';this['Configurations']=_0x5bc043['Configurations']||{};}module[_0x8e64('0x4')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 7d3c374..a503289 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 _0xebbc=['exports','name','accountcode','state','unknown','stateTime','address'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xebbc,0x14a));var _0xcebb=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xebbc[_0x4c260a];return _0x17bbdd;};'use strict';function Telephone(_0x1b89f7){this['id']=_0x1b89f7['id']||0x0;this[_0xcebb('0x0')]=_0x1b89f7[_0xcebb('0x0')]||'';this[_0xcebb('0x1')]=_0x1b89f7[_0xcebb('0x1')]||'';this[_0xcebb('0x2')]=_0xcebb('0x3');this[_0xcebb('0x4')]=0x0;this['status']=_0xcebb('0x3');this[_0xcebb('0x5')]='';}module[_0xcebb('0x6')]=Telephone; \ No newline at end of file +var _0xb3b6=['name','accountcode','state','unknown'];(function(_0xb237a6,_0x348a86){var _0x302a26=function(_0x2ac19f){while(--_0x2ac19f){_0xb237a6['push'](_0xb237a6['shift']());}};_0x302a26(++_0x348a86);}(_0xb3b6,0x1e8));var _0x6b3b=function(_0x154c32,_0x253b1d){_0x154c32=_0x154c32-0x0;var _0x2e9d15=_0xb3b6[_0x154c32];return _0x2e9d15;};'use strict';function Telephone(_0x5b337a){this['id']=_0x5b337a['id']||0x0;this['name']=_0x5b337a[_0x6b3b('0x0')]||'';this['accountcode']=_0x5b337a[_0x6b3b('0x1')]||'';this[_0x6b3b('0x2')]=_0x6b3b('0x3');this['stateTime']=0x0;this['status']=_0x6b3b('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 26cff19..40a7bf8 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 _0xaffe=['exports','name','html'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xaffe,0x163));var _0xeaff=function(_0x245f1e,_0x51d8c0){_0x245f1e=_0x245f1e-0x0;var _0x304e41=_0xaffe[_0x245f1e];return _0x304e41;};'use strict';function template(_0x5470ee){this['id']=_0x5470ee['id']||0x0;this[_0xeaff('0x0')]=_0x5470ee[_0xeaff('0x0')]||'';this[_0xeaff('0x1')]=_0x5470ee[_0xeaff('0x1')]||'';}module[_0xeaff('0x2')]=template; \ No newline at end of file +var _0xb2c5=['name','exports'];(function(_0x5e0e4c,_0x152934){var _0x45a3a1=function(_0x2bf758){while(--_0x2bf758){_0x5e0e4c['push'](_0x5e0e4c['shift']());}};_0x45a3a1(++_0x152934);}(_0xb2c5,0x114));var _0x5b2c=function(_0x1ecb71,_0x370253){_0x1ecb71=_0x1ecb71-0x0;var _0x402229=_0xb2c5[_0x1ecb71];return _0x402229;};'use strict';function template(_0x1a4e77){this['id']=_0x1a4e77['id']||0x0;this[_0x5b2c('0x0')]=_0x1a4e77[_0x5b2c('0x0')]||'';this['html']=_0x1a4e77['html']||'';}module[_0x5b2c('0x1')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index b415479..c49f35f 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 _0xf3cd=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x38fee3,_0x4b757f){var _0x328d84=function(_0x4ddb72){while(--_0x4ddb72){_0x38fee3['push'](_0x38fee3['shift']());}};_0x328d84(++_0x4b757f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x129479,_0x256c7e){_0x129479=_0x129479-0x0;var _0x3fa0ce=_0xf3cd[_0x129479];return _0x3fa0ce;};'use strict';function Trigger(_0x13cb67){this['id']=_0x13cb67['id']||0x0;this[_0xdf3c('0x0')]=_0x13cb67[_0xdf3c('0x0')]||'';this[_0xdf3c('0x1')]=_0x13cb67[_0xdf3c('0x1')]||_0xdf3c('0x2');this['status']=_0x13cb67[_0xdf3c('0x3')]||![];this[_0xdf3c('0x4')]=_0x13cb67[_0xdf3c('0x4')]||[];this['AnyConditions']=_0x13cb67[_0xdf3c('0x5')]||[];this[_0xdf3c('0x6')]=_0x13cb67[_0xdf3c('0x6')]||[];}module[_0xdf3c('0x7')]=Trigger; \ No newline at end of file +var _0xedd9=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x2b3099,_0x46ee3a){var _0x4458d2=function(_0x25a4e5){while(--_0x25a4e5){_0x2b3099['push'](_0x2b3099['shift']());}};_0x4458d2(++_0x46ee3a);}(_0xedd9,0xfc));var _0x9edd=function(_0x55bc16,_0x21cb49){_0x55bc16=_0x55bc16-0x0;var _0x2cd7ed=_0xedd9[_0x55bc16];return _0x2cd7ed;};'use strict';function Trigger(_0x265eb8){this['id']=_0x265eb8['id']||0x0;this[_0x9edd('0x0')]=_0x265eb8[_0x9edd('0x0')]||'';this[_0x9edd('0x1')]=_0x265eb8[_0x9edd('0x1')]||_0x9edd('0x2');this[_0x9edd('0x3')]=_0x265eb8[_0x9edd('0x3')]||![];this[_0x9edd('0x4')]=_0x265eb8['AllConditions']||[];this[_0x9edd('0x5')]=_0x265eb8[_0x9edd('0x5')]||[];this[_0x9edd('0x6')]=_0x265eb8[_0x9edd('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 8cc552a..f2832f2 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 _0xa9e8=['name','stateTime','registry','indexOf','host','port','domainport','refresh','stateRegistry','registrationtime','active'];(function(_0xd70344,_0x304eac){var _0x338d4b=function(_0x4d42a8){while(--_0x4d42a8){_0xd70344['push'](_0xd70344['shift']());}};_0x338d4b(++_0x304eac);}(_0xa9e8,0x78));var _0x8a9e=function(_0x19c864,_0x41f87f){_0x19c864=_0x19c864-0x0;var _0x2a39c0=_0xa9e8[_0x19c864];return _0x2a39c0;};'use strict';function Trunk(_0x284109){this['id']=_0x284109['id']||0x0;this[_0x8a9e('0x0')]=_0x284109[_0x8a9e('0x0')]||![];this['name']=_0x284109[_0x8a9e('0x1')]||'';this['state']='unknown';this[_0x8a9e('0x2')]=0x0;this['status']='unknown';this['registry']=_0x284109[_0x8a9e('0x3')]&&_0x284109[_0x8a9e('0x3')][_0x8a9e('0x4')](':')?_0x284109[_0x8a9e('0x3')]['split'](':')[0x0]:'';this[_0x8a9e('0x5')]='';this[_0x8a9e('0x6')]='';this['domain']='';this[_0x8a9e('0x7')]='';this[_0x8a9e('0x8')]='';this[_0x8a9e('0x9')]='unknown';this[_0x8a9e('0xa')]='';this['address']='';}module['exports']=Trunk; \ No newline at end of file +var _0x584a=['host','refresh','stateRegistry','registrationtime','address','exports','active','name','state','unknown','registry','indexOf','split'];(function(_0x7c127b,_0x2471e5){var _0x3fed4d=function(_0x1e9ab1){while(--_0x1e9ab1){_0x7c127b['push'](_0x7c127b['shift']());}};_0x3fed4d(++_0x2471e5);}(_0x584a,0x1c0));var _0xa584=function(_0x446208,_0xb483fb){_0x446208=_0x446208-0x0;var _0xe49563=_0x584a[_0x446208];return _0xe49563;};'use strict';function Trunk(_0x541f57){this['id']=_0x541f57['id']||0x0;this[_0xa584('0x0')]=_0x541f57['active']||![];this[_0xa584('0x1')]=_0x541f57[_0xa584('0x1')]||'';this[_0xa584('0x2')]=_0xa584('0x3');this['stateTime']=0x0;this['status']=_0xa584('0x3');this['registry']=_0x541f57['registry']&&_0x541f57[_0xa584('0x4')][_0xa584('0x5')](':')?_0x541f57['registry'][_0xa584('0x6')](':')[0x0]:'';this[_0xa584('0x7')]='';this['port']='';this['domain']='';this['domainport']='';this[_0xa584('0x8')]='';this[_0xa584('0x9')]=_0xa584('0x3');this[_0xa584('0xa')]='';this[_0xa584('0xb')]='';}module[_0xa584('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 078c508..55638b3 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 _0x7905=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x12bcae,_0x47dc50){var _0x2405c4=function(_0x5d4cf5){while(--_0x5d4cf5){_0x12bcae['push'](_0x12bcae['shift']());}};_0x2405c4(++_0x47dc50);}(_0x7905,0x1a1));var _0x5790=function(_0x479325,_0x398f87){_0x479325=_0x479325-0x0;var _0x201c05=_0x7905[_0x479325];return _0x201c05;};'use strict';function voiceExtension(_0x54940c){this['id']=_0x54940c['id']||0x0;this['exten']=_0x54940c[_0x5790('0x0')]||'';this[_0x5790('0x1')]=_0x54940c[_0x5790('0x1')]||_0x5790('0x2');this[_0x5790('0x3')]=_0x54940c['mandatoryDisposition']||![];}module[_0x5790('0x4')]=voiceExtension; \ No newline at end of file +var _0x08f3=['exten','none'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x08f3,0x14a));var _0x308f=function(_0x4d90f4,_0x47dba5){_0x4d90f4=_0x4d90f4-0x0;var _0x3b26ba=_0x08f3[_0x4d90f4];return _0x3b26ba;};'use strict';function voiceExtension(_0x3393a1){this['id']=_0x3393a1['id']||0x0;this[_0x308f('0x0')]=_0x3393a1[_0x308f('0x0')]||'';this['recordingFormat']=_0x3393a1['recordingFormat']||_0x308f('0x1');this['mandatoryDisposition']=_0x3393a1['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 227aea6..4308b5b 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 _0x0db9=['dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x0db9,0x17a));var _0x90db=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0x0db9[_0x6c0123];return _0x5a87d2;};'use strict';var statusDesc=['unknown',_0x90db('0x0'),'inuse','busy','invalid',_0x90db('0x1'),_0x90db('0x2'),_0x90db('0x3'),'onhold'];var monitorFormat={'wav':_0x90db('0x4'),'wav49':_0x90db('0x5'),'gsm':_0x90db('0x6')};var strategy={'rrmemory':_0x90db('0x7'),'roundrobin':_0x90db('0x8')};function VoiceQueue(_0x52d490){this['id']=_0x52d490['id']||0x0;this['name']=_0x52d490[_0x90db('0x9')]||'';this[_0x90db('0xa')]=_0x52d490[_0x90db('0xa')]||'';this['type']=_0x52d490[_0x90db('0xb')]||_0x90db('0xc');this[_0x90db('0xd')]=0x0;this[_0x90db('0xe')]=0x0;this[_0x90db('0xf')]=0x0;this[_0x90db('0x10')]=0x0;this[_0x90db('0x11')]=0x0;this[_0x90db('0x12')]=0x0;this[_0x90db('0x13')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x90db('0x14')]=0x0;this[_0x90db('0x15')]=0x0;this[_0x90db('0x16')]=_0x52d490[_0x90db('0x16')]||![];this[_0x90db('0x17')]=_0x52d490[_0x90db('0x17')]||0xa;this[_0x90db('0x18')]=_0x52d490[_0x90db('0x18')]||'no';this[_0x90db('0x19')]=!![];this[_0x90db('0x1a')]='';this[_0x90db('0x1b')]=0x0;this['temp']=0x0;this[_0x90db('0x1c')]=_0x52d490[_0x90db('0x1c')]||null;this['dialGlobalInterval']=_0x52d490['dialGlobalInterval']?_0x52d490[_0x90db('0x1d')]:null;this[_0x90db('0x1e')]=_0x52d490['dialActive'];this[_0x90db('0x1f')]=_0x52d490['dialMethod']||_0x90db('0x20');this[_0x90db('0x21')]=_0x52d490[_0x90db('0x21')]||0x0;this[_0x90db('0x22')]=_0x52d490[_0x90db('0x22')]||0x0;this[_0x90db('0x23')]=_0x52d490[_0x90db('0x23')]||0x1;this[_0x90db('0x24')]=_0x52d490[_0x90db('0x24')]||'dropRate';this[_0x90db('0x25')]=_0x52d490[_0x90db('0x25')]||0.03;this[_0x90db('0x26')]=_0x52d490['dialPredictiveInterval']||0x258;this[_0x90db('0x27')]=_0x52d490[_0x90db('0x27')]||_0x90db('0x28');this[_0x90db('0x29')]=_0x52d490[_0x90db('0x29')]||_0x90db('0x28');this[_0x90db('0x2a')]=_0x52d490[_0x90db('0x2a')]||0x1e;this[_0x90db('0x2b')]=_0x52d490[_0x90db('0x2b')]||_0x90db('0x2c');this[_0x90db('0x2d')]=_0x52d490[_0x90db('0x2d')]||0x3;this[_0x90db('0x2e')]=_0x52d490[_0x90db('0x2e')]||undefined;this[_0x90db('0x2f')]=_0x52d490[_0x90db('0x2f')]||0x3;this[_0x90db('0x30')]=_0x52d490[_0x90db('0x30')]||0x96;this[_0x90db('0x31')]=_0x52d490['dialBusyMaxRetry']||0x3;this[_0x90db('0x32')]=_0x52d490['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x52d490['dialNoAnswerMaxRetry']||0x3;this[_0x90db('0x33')]=_0x52d490[_0x90db('0x33')]||0x96;this['dialGlobalMaxRetry']=_0x52d490[_0x90db('0x34')]||0x4;this[_0x90db('0x35')]=_0x52d490[_0x90db('0x35')]?_0x52d490[_0x90db('0x35')]:undefined;this[_0x90db('0x36')]=_0x52d490[_0x90db('0x36')]?_0x52d490[_0x90db('0x36')]:undefined;this[_0x90db('0x37')]=_0x52d490[_0x90db('0x37')]||undefined;this[_0x90db('0x38')]=_0x52d490[_0x90db('0x38')]?_0x52d490[_0x90db('0x38')]:undefined;this[_0x90db('0x39')]=_0x52d490[_0x90db('0x39')]||_0x90db('0x3a');this[_0x90db('0x3b')]=_0x52d490[_0x90db('0x3b')]||undefined;this[_0x90db('0x3c')]=_0x52d490[_0x90db('0x3c')]||undefined;this[_0x90db('0x3d')]=strategy[_0x52d490['strategy']]||_0x90db('0x7');this['queueStatusComplete']=!![];this[_0x90db('0x3e')]=_0x52d490[_0x90db('0x3e')]||![];this['dialAMDInitialSilence']=_0x52d490['dialAMDInitialSilence'];this[_0x90db('0x3f')]=_0x52d490[_0x90db('0x3f')];this[_0x90db('0x40')]=_0x52d490[_0x90db('0x40')];this['dialAMDTotalAnalysisTime']=_0x52d490['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x52d490[_0x90db('0x41')];this[_0x90db('0x42')]=_0x52d490[_0x90db('0x42')];this[_0x90db('0x43')]=_0x52d490[_0x90db('0x43')];this[_0x90db('0x44')]=_0x52d490[_0x90db('0x44')];this[_0x90db('0x45')]=_0x52d490[_0x90db('0x45')];this[_0x90db('0x46')]=0x0;this[_0x90db('0x47')]=0x0;this[_0x90db('0x48')]=_0x52d490[_0x90db('0x48')];this[_0x90db('0x49')]=0x0;this[_0x90db('0x4a')]=0x0;this[_0x90db('0x4b')]=0x0;this[_0x90db('0x4c')]=0x0;this[_0x90db('0x4d')]=0x0;this[_0x90db('0x4e')]=0x0;this[_0x90db('0x4f')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x90db('0x50')]=0x0;this[_0x90db('0x51')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x90db('0x52')]=undefined;this[_0x90db('0x53')]=1.05;this[_0x90db('0x54')]=0x0;this[_0x90db('0x55')]=0x0;this[_0x90db('0x56')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x90db('0x57')]=0x0;this[_0x90db('0x58')]=0x0;this[_0x90db('0x59')]=0x0;this[_0x90db('0x5a')]=0x0;this[_0x90db('0x5b')]=_0x52d490[_0x90db('0x5c')]||0x14;this[_0x90db('0x5d')]=_0x52d490[_0x90db('0x5c')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x90db('0x5e')]=0x0;this[_0x90db('0x5f')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x90db('0x60')]=0x0;this[_0x90db('0x61')]=0x0;this['dialRecallMeTimeout']=_0x52d490[_0x90db('0x62')]||0x1e;this[_0x90db('0x63')]=_0x52d490[_0x90db('0x63')]||![];this['dialQueueProject2']=_0x52d490['dialQueueProject2']||undefined;this[_0x90db('0x64')]=_0x52d490[_0x90db('0x64')]||![];this[_0x90db('0x65')]=_0x52d490[_0x90db('0x65')]||![];this[_0x90db('0xa')]=monitorFormat[_0x52d490[_0x90db('0xa')]]?monitorFormat[_0x52d490[_0x90db('0xa')]]:undefined;this[_0x90db('0x66')]=_0x52d490[_0x90db('0x66')]||![];this[_0x90db('0x67')]=_0x52d490[_0x90db('0x67')]?_0x52d490['mandatoryDispositionPause']:undefined;}module[_0x90db('0x68')]=VoiceQueue; \ No newline at end of file +var _0x57e8=['ringing','ringinuse','onhold','wav49','gsm','rrmemory','name','monitor_format','inbound','talking','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','invalid','unavailable'];(function(_0x5a894b,_0x4a3eb6){var _0x4d6d18=function(_0x5236db){while(--_0x5236db){_0x5a894b['push'](_0x5a894b['shift']());}};_0x4d6d18(++_0x4a3eb6);}(_0x57e8,0x140));var _0x857e=function(_0x2eb487,_0x468e13){_0x2eb487=_0x2eb487-0x0;var _0x2cb8ef=_0x57e8[_0x2eb487];return _0x2cb8ef;};'use strict';var statusDesc=[_0x857e('0x0'),_0x857e('0x1'),'inuse','busy',_0x857e('0x2'),_0x857e('0x3'),_0x857e('0x4'),_0x857e('0x5'),_0x857e('0x6')];var monitorFormat={'wav':'wav','wav49':_0x857e('0x7'),'gsm':_0x857e('0x8')};var strategy={'rrmemory':_0x857e('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x41270e){this['id']=_0x41270e['id']||0x0;this[_0x857e('0xa')]=_0x41270e[_0x857e('0xa')]||'';this[_0x857e('0xb')]=_0x41270e[_0x857e('0xb')]||'';this['type']=_0x41270e['type']||_0x857e('0xc');this['waiting']=0x0;this[_0x857e('0xd')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0x857e('0xe')]=0x0;this[_0x857e('0xf')]=0x0;this[_0x857e('0x10')]=0x0;this[_0x857e('0x11')]=0x0;this[_0x857e('0x12')]=0x0;this[_0x857e('0x13')]=0x0;this[_0x857e('0x14')]=0x0;this['acw']=_0x41270e[_0x857e('0x15')]||![];this[_0x857e('0x16')]=_0x41270e[_0x857e('0x16')]||0xa;this[_0x857e('0x17')]=_0x41270e['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0x857e('0x18')]='';this[_0x857e('0x19')]=0x0;this[_0x857e('0x1a')]=0x0;this[_0x857e('0x1b')]=_0x41270e['dialTimezone']||null;this[_0x857e('0x1c')]=_0x41270e[_0x857e('0x1c')]?_0x41270e[_0x857e('0x1c')]:null;this[_0x857e('0x1d')]=_0x41270e[_0x857e('0x1d')];this[_0x857e('0x1e')]=_0x41270e[_0x857e('0x1e')]||_0x857e('0x1f');this[_0x857e('0x20')]=_0x41270e[_0x857e('0x20')]||0x0;this[_0x857e('0x21')]=_0x41270e['dialLimitQueue']||0x0;this['dialPowerLevel']=_0x41270e[_0x857e('0x22')]||0x1;this[_0x857e('0x23')]=_0x41270e['dialPredictiveOptimization']||'dropRate';this[_0x857e('0x24')]=_0x41270e['dialPredictiveOptimizationPercentage']||0.03;this[_0x857e('0x25')]=_0x41270e['dialPredictiveInterval']||0x258;this[_0x857e('0x26')]=_0x41270e[_0x857e('0x26')]||'anonymous';this[_0x857e('0x27')]=_0x41270e[_0x857e('0x27')]||_0x857e('0x28');this[_0x857e('0x29')]=_0x41270e['dialOriginateTimeout']||0x1e;this['dialQueueOptions']=_0x41270e[_0x857e('0x2a')]||_0x857e('0x2b');this[_0x857e('0x2c')]=_0x41270e[_0x857e('0x2c')]||0x3;this[_0x857e('0x2d')]=_0x41270e[_0x857e('0x2d')]||undefined;this[_0x857e('0x2e')]=_0x41270e[_0x857e('0x2e')]||0x3;this[_0x857e('0x2f')]=_0x41270e[_0x857e('0x2f')]||0x96;this['dialBusyMaxRetry']=_0x41270e[_0x857e('0x30')]||0x3;this['dialBusyRetryFrequency']=_0x41270e[_0x857e('0x31')]||0x96;this[_0x857e('0x32')]=_0x41270e[_0x857e('0x32')]||0x3;this[_0x857e('0x33')]=_0x41270e[_0x857e('0x33')]||0x96;this[_0x857e('0x34')]=_0x41270e['dialGlobalMaxRetry']||0x4;this[_0x857e('0x35')]=_0x41270e[_0x857e('0x35')]?_0x41270e[_0x857e('0x35')]:undefined;this[_0x857e('0x36')]=_0x41270e[_0x857e('0x36')]?_0x41270e[_0x857e('0x36')]:undefined;this[_0x857e('0x37')]=_0x41270e['dialPrefix']||undefined;this[_0x857e('0x38')]=_0x41270e['Interval']?_0x41270e['Interval']:undefined;this[_0x857e('0x39')]=_0x41270e[_0x857e('0x39')]||'DESC';this[_0x857e('0x3a')]=_0x41270e['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x857e('0x3b')]=_0x41270e[_0x857e('0x3b')]||undefined;this[_0x857e('0x3c')]=strategy[_0x41270e[_0x857e('0x3c')]]||'rrmemory';this[_0x857e('0x3d')]=!![];this[_0x857e('0x3e')]=_0x41270e[_0x857e('0x3e')]||![];this[_0x857e('0x3f')]=_0x41270e[_0x857e('0x3f')];this['dialAMDGreeting']=_0x41270e[_0x857e('0x40')];this[_0x857e('0x41')]=_0x41270e[_0x857e('0x41')];this[_0x857e('0x42')]=_0x41270e[_0x857e('0x42')];this[_0x857e('0x43')]=_0x41270e['dialAMDMinWordLength'];this[_0x857e('0x44')]=_0x41270e['dialAMDBetweenWordsSilence'];this[_0x857e('0x45')]=_0x41270e['dialAMDMaximumNumberOfWords'];this[_0x857e('0x46')]=_0x41270e[_0x857e('0x46')];this['dialAMDMaximumWordLength']=_0x41270e['dialAMDMaximumWordLength'];this[_0x857e('0x47')]=0x0;this[_0x857e('0x48')]=0x0;this[_0x857e('0x49')]=_0x41270e['timeout'];this[_0x857e('0x4a')]=0x0;this[_0x857e('0x4b')]=0x0;this[_0x857e('0x4c')]=0x0;this[_0x857e('0x4d')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x857e('0x4e')]=0x0;this[_0x857e('0x4f')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x857e('0x50')]=0x0;this[_0x857e('0x51')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x857e('0x52')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x857e('0x53')]=undefined;this[_0x857e('0x54')]=1.05;this[_0x857e('0x55')]=0x0;this[_0x857e('0x56')]=0x0;this[_0x857e('0x57')]=0x0;this[_0x857e('0x58')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x857e('0x59')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x857e('0x5a')]=0x0;this['predictiveIntervalMaxThreshold']=_0x41270e[_0x857e('0x5b')]||0x14;this[_0x857e('0x5c')]=_0x41270e[_0x857e('0x5b')]||0xa;this[_0x857e('0x5d')]=0x0;this[_0x857e('0x5e')]=0x0;this[_0x857e('0x5f')]=0x1;this[_0x857e('0x60')]=0x0;this[_0x857e('0x61')]=0x0;this[_0x857e('0x62')]=0x0;this[_0x857e('0x63')]=0x0;this['dialRecallMeTimeout']=_0x41270e[_0x857e('0x64')]||0x1e;this[_0x857e('0x65')]=_0x41270e[_0x857e('0x65')]||![];this['dialQueueProject2']=_0x41270e[_0x857e('0x66')]||undefined;this[_0x857e('0x67')]=_0x41270e[_0x857e('0x67')]||![];this[_0x857e('0x68')]=_0x41270e['dialAgiAfterHangupAgent']||![];this[_0x857e('0xb')]=monitorFormat[_0x41270e[_0x857e('0xb')]]?monitorFormat[_0x41270e[_0x857e('0xb')]]:undefined;this[_0x857e('0x69')]=_0x41270e[_0x857e('0x69')]||![];this[_0x857e('0x6a')]=_0x41270e[_0x857e('0x6a')]?_0x41270e['mandatoryDispositionPause']:undefined;}module[_0x857e('0x6b')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index be54de4..e6c33fd 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 _0x6b36=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x162694,_0x515d1c){var _0x48b4a5=function(_0x774faf){while(--_0x774faf){_0x162694['push'](_0x162694['shift']());}};_0x48b4a5(++_0x515d1c);}(_0x6b36,0x1d1));var _0x66b3=function(_0x37c878,_0x296adf){_0x37c878=_0x37c878-0x0;var _0x575efb=_0x6b36[_0x37c878];return _0x575efb;};'use strict';function VtigerAccount(_0xb25dd3){this['id']=_0xb25dd3['id']||0x0;this[_0x66b3('0x0')]=_0xb25dd3['name']||'';this[_0x66b3('0x1')]=_0xb25dd3[_0x66b3('0x1')]||'';this['accessKey']=_0xb25dd3[_0x66b3('0x2')]||'';this[_0x66b3('0x3')]=_0xb25dd3['remoteUri']||'';this['serverUrl']=_0xb25dd3[_0x66b3('0x4')]||'';this[_0x66b3('0x5')]=_0xb25dd3[_0x66b3('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x2f5a=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f5a,0x1e6));var _0xa2f5=function(_0x2484e6,_0x2cbe6c){_0x2484e6=_0x2484e6-0x0;var _0x20efaf=_0x2f5a[_0x2484e6];return _0x20efaf;};'use strict';function VtigerAccount(_0x2740c5){this['id']=_0x2740c5['id']||0x0;this[_0xa2f5('0x0')]=_0x2740c5['name']||'';this[_0xa2f5('0x1')]=_0x2740c5[_0xa2f5('0x1')]||'';this[_0xa2f5('0x2')]=_0x2740c5['accessKey']||'';this[_0xa2f5('0x3')]=_0x2740c5[_0xa2f5('0x3')]||'';this[_0xa2f5('0x4')]=_0x2740c5['serverUrl']||'';this[_0xa2f5('0x5')]=_0x2740c5[_0xa2f5('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index e9921d6..c0af5bf 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 _0x2032=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x2bdf0a,_0x5e63ee){var _0x263558=function(_0x1e3c0b){while(--_0x1e3c0b){_0x2bdf0a['push'](_0x2bdf0a['shift']());}};_0x263558(++_0x5e63ee);}(_0x2032,0xd9));var _0x2203=function(_0x2b6aac,_0x1d9c30){_0x2b6aac=_0x2b6aac-0x0;var _0x36b0ce=_0x2032[_0x2b6aac];return _0x36b0ce;};'use strict';function ZendeskAccount(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['username']||'';this[_0x2203('0x2')]=_0x4d6c97[_0x2203('0x2')]||'';this['token']=_0x4d6c97[_0x2203('0x3')]||'';this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||'';this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||'';this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||_0x2203('0x7');this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')]||'';this[_0x2203('0x9')]=_0x4d6c97['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0xfa4061,_0x47772f){var _0x59fb20=function(_0x41e07b){while(--_0x41e07b){_0xfa4061['push'](_0xfa4061['shift']());}};_0x59fb20(++_0x47772f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2e7b6e,_0x399033){_0x2e7b6e=_0x2e7b6e-0x0;var _0x209ef0=_0x5f2f[_0x2e7b6e];return _0x209ef0;};'use strict';function ZendeskAccount(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||'';this[_0xf5f2('0x2')]=_0x7c86d8[_0xf5f2('0x2')]||'';this[_0xf5f2('0x3')]=_0x7c86d8['token']||'';this['remoteUri']=_0x7c86d8[_0xf5f2('0x4')]||'';this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||'';this[_0xf5f2('0x6')]=_0x7c86d8[_0xf5f2('0x6')]||_0xf5f2('0x7');this['serverUrl']=_0x7c86d8[_0xf5f2('0x8')]||'';this[_0xf5f2('0x9')]=_0x7c86d8[_0xf5f2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 7c244b5..55e1a75 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 _0x081e=['description','host','zone','clientId','clientSecret','serverUrl','refreshToken','Configurations','name'];(function(_0x2a4200,_0x546caf){var _0x4ed041=function(_0x4ea59f){while(--_0x4ea59f){_0x2a4200['push'](_0x2a4200['shift']());}};_0x4ed041(++_0x546caf);}(_0x081e,0xc5));var _0xe081=function(_0x4fd51c,_0x212fca){_0x4fd51c=_0x4fd51c-0x0;var _0xde5b62=_0x081e[_0x4fd51c];return _0xde5b62;};'use strict';function ZohoAccount(_0x1c3794){this['id']=_0x1c3794['id']||0x0;this[_0xe081('0x0')]=_0x1c3794['name']||'';this[_0xe081('0x1')]=_0x1c3794['description']||'';this[_0xe081('0x2')]=_0x1c3794[_0xe081('0x2')]||'';this[_0xe081('0x3')]=_0x1c3794[_0xe081('0x3')]||'';this[_0xe081('0x4')]=_0x1c3794[_0xe081('0x4')]||'';this[_0xe081('0x5')]=_0x1c3794['clientSecret']||'';this[_0xe081('0x6')]=_0x1c3794['serverUrl']||'';this['code']=_0x1c3794['code']||'';this['refreshToken']=_0x1c3794[_0xe081('0x7')]||'';this['Configurations']=_0x1c3794[_0xe081('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x8357=['host','zone','clientSecret','serverUrl','refreshToken','Configurations','exports','name','description'];(function(_0x48c784,_0x52b6fc){var _0x4634d9=function(_0x5c4f16){while(--_0x5c4f16){_0x48c784['push'](_0x48c784['shift']());}};_0x4634d9(++_0x52b6fc);}(_0x8357,0x1e4));var _0x7835=function(_0x4f5529,_0x16ad4b){_0x4f5529=_0x4f5529-0x0;var _0x5dc83c=_0x8357[_0x4f5529];return _0x5dc83c;};'use strict';function ZohoAccount(_0x81d66b){this['id']=_0x81d66b['id']||0x0;this[_0x7835('0x0')]=_0x81d66b[_0x7835('0x0')]||'';this['description']=_0x81d66b[_0x7835('0x1')]||'';this[_0x7835('0x2')]=_0x81d66b[_0x7835('0x2')]||'';this[_0x7835('0x3')]=_0x81d66b[_0x7835('0x3')]||'';this['clientId']=_0x81d66b['clientId']||'';this[_0x7835('0x4')]=_0x81d66b['clientSecret']||'';this[_0x7835('0x5')]=_0x81d66b[_0x7835('0x5')]||'';this['code']=_0x81d66b['code']||'';this[_0x7835('0x6')]=_0x81d66b['refreshToken']||'';this[_0x7835('0x7')]=_0x81d66b[_0x7835('0x7')]||{};}module[_0x7835('0x8')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index fc011b7..6515d90 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 _0xc1b5=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','isNil','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3ab756,_0x46ed1a){var _0x2aff80=function(_0x3e096d){while(--_0x3e096d){_0x3ab756['push'](_0x3ab756['shift']());}};_0x2aff80(++_0x46ed1a);}(_0xc1b5,0x1c6));var _0x5c1b=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xc1b5[_0x27e811];return _0x1627fa;};'use strict';var util=require(_0x5c1b('0x0'));var _=require(_0x5c1b('0x1'));var moment=require('moment');function checkNameSurname(_0x5a7f74,_0x43eef3,_0x3f7b70){var _0x27fc62='';if(!_['isNil'](_0x43eef3)&&'string'===typeof _0x43eef3){_0x27fc62+=_0x43eef3;}if(!_['isNil'](_0x3f7b70)&&_0x5c1b('0x2')===typeof _0x3f7b70){_0x27fc62+='\x20'+_0x3f7b70;}if(_0x27fc62!==''){return _0x27fc62;}return _0x5a7f74;}function Action(_0x2211f1,_0x49328a,_0x28c378,_0x53e4f6,_0x301b88){this[_0x5c1b('0x3')]=_0x28c378||undefined;this[_0x5c1b('0x4')]=_0x2211f1['id'];this[_0x5c1b('0x5')]=_0x49328a['name'];this[_0x5c1b('0x6')]=_0x49328a[_0x5c1b('0x6')];this[_0x5c1b('0x7')]=_0x5c1b('0x5');this[_0x5c1b('0x8')]=![];this[_0x5c1b('0x9')]=_[_0x5c1b('0xa')](_0x2211f1[_0x5c1b('0xb')])?undefined:_0x2211f1[_0x5c1b('0xb')][_0x5c1b('0xc')];this[_0x5c1b('0xd')]=this[_0x5c1b('0x9')]?util[_0x5c1b('0xe')](_0x5c1b('0xf'),this[_0x5c1b('0x9')]):_0x53e4f6||undefined;this[_0x5c1b('0x10')]=checkNameSurname(_0x2211f1['Contact'][_0x5c1b('0x11')],_0x2211f1[_0x5c1b('0x12')]['firstName'],_0x2211f1[_0x5c1b('0x12')][_0x5c1b('0x13')]);this[_0x5c1b('0x14')]=_0x2211f1[_0x5c1b('0x14')]||![];this[_0x5c1b('0x15')]=_0x2211f1[_0x5c1b('0x12')][_0x5c1b('0x11')];this[_0x5c1b('0x16')]=_0x2211f1[_0x5c1b('0x16')];this[_0x5c1b('0x17')]=_0x2211f1[_0x5c1b('0x17')]||0x0;this[_0x5c1b('0x18')]=_0x2211f1['countcongestionretry']||0x0;this[_0x5c1b('0x19')]=_0x2211f1['countnoanswerretry']||0x0;this['countglobal']=(_0x2211f1[_0x5c1b('0x17')]||0x0)+(_0x2211f1[_0x5c1b('0x18')]||0x0)+(_0x2211f1[_0x5c1b('0x19')]||0x0);this[_0x5c1b('0x1a')]=_0x2211f1['callback'];this[_0x5c1b('0x1b')]=_0x2211f1[_0x5c1b('0x1b')];this['callbackat']=_0x2211f1[_0x5c1b('0x1c')];this[_0x5c1b('0x1d')]=_0x2211f1[_0x5c1b('0x1d')];this[_0x5c1b('0x1e')]=_0x2211f1[_0x5c1b('0x1e')];this[_0x5c1b('0x1f')]=_0x2211f1[_0x5c1b('0x1f')];this[_0x5c1b('0x20')]=_[_0x5c1b('0xa')](_0x2211f1[_0x5c1b('0xb')])?_0x2211f1['UserId']:_0x2211f1[_0x5c1b('0xb')]['id'];this[_0x5c1b('0x21')]=_0x2211f1[_0x5c1b('0x21')];this[_0x5c1b('0x22')]='';this['originatecalleridname']='';}Action[_0x5c1b('0x23')][_0x5c1b('0x24')]=function(){return util[_0x5c1b('0xe')](_0x5c1b('0x25'),this['calleridname'],this[_0x5c1b('0x26')]);};module[_0x5c1b('0x27')]=Action; \ No newline at end of file +var _0x2c60=['membername','Agent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','uniqueid','idContact','queue','type','dialAnswer'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x2c60,0x144));var _0x02c6=function(_0x58dc25,_0x49b9d5){_0x58dc25=_0x58dc25-0x0;var _0x21b0a7=_0x2c60[_0x58dc25];return _0x21b0a7;};'use strict';var util=require(_0x02c6('0x0'));var _=require(_0x02c6('0x1'));var moment=require(_0x02c6('0x2'));function checkNameSurname(_0xb04e41,_0x27c528,_0x1c18f3){var _0x301c2d='';if(!_[_0x02c6('0x3')](_0x27c528)&&'string'===typeof _0x27c528){_0x301c2d+=_0x27c528;}if(!_[_0x02c6('0x3')](_0x1c18f3)&&'string'===typeof _0x1c18f3){_0x301c2d+='\x20'+_0x1c18f3;}if(_0x301c2d!==''){return _0x301c2d;}return _0xb04e41;}function Action(_0x2dc33c,_0x316c8c,_0x143aa7,_0x5959bd,_0x375510){this[_0x02c6('0x4')]=_0x143aa7||undefined;this[_0x02c6('0x5')]=_0x2dc33c['id'];this[_0x02c6('0x6')]=_0x316c8c['name'];this[_0x02c6('0x7')]=_0x316c8c[_0x02c6('0x7')];this['campaigntype']=_0x02c6('0x6');this[_0x02c6('0x8')]=![];this[_0x02c6('0x9')]=_[_0x02c6('0x3')](_0x2dc33c['Agent'])?undefined:_0x2dc33c[_0x02c6('0xa')]['name'];this['channelAgent']=this['membername']?util[_0x02c6('0xb')]('SIP/%s',this['membername']):_0x5959bd||undefined;this[_0x02c6('0xc')]=checkNameSurname(_0x2dc33c[_0x02c6('0xd')][_0x02c6('0xe')],_0x2dc33c['Contact'][_0x02c6('0xf')],_0x2dc33c[_0x02c6('0xd')][_0x02c6('0x10')]);this[_0x02c6('0x11')]=_0x2dc33c['active']||![];this[_0x02c6('0x12')]=_0x2dc33c['Contact']['phone'];this[_0x02c6('0x13')]=_0x2dc33c[_0x02c6('0x13')];this[_0x02c6('0x14')]=_0x2dc33c[_0x02c6('0x14')]||0x0;this[_0x02c6('0x15')]=_0x2dc33c[_0x02c6('0x15')]||0x0;this[_0x02c6('0x16')]=_0x2dc33c['countnoanswerretry']||0x0;this[_0x02c6('0x17')]=(_0x2dc33c['countbusyretry']||0x0)+(_0x2dc33c[_0x02c6('0x15')]||0x0)+(_0x2dc33c[_0x02c6('0x16')]||0x0);this[_0x02c6('0x18')]=_0x2dc33c[_0x02c6('0x18')];this[_0x02c6('0x19')]=_0x2dc33c['callbackuniqueid'];this['callbackat']=_0x2dc33c[_0x02c6('0x1a')];this[_0x02c6('0x1b')]=_0x2dc33c['recallme'];this[_0x02c6('0x1c')]=_0x2dc33c['ContactId'];this[_0x02c6('0x1d')]=_0x2dc33c[_0x02c6('0x1d')];this[_0x02c6('0x1e')]=_[_0x02c6('0x3')](_0x2dc33c['Agent'])?_0x2dc33c['UserId']:_0x2dc33c[_0x02c6('0xa')]['id'];this[_0x02c6('0x1f')]=_0x2dc33c[_0x02c6('0x1f')];this[_0x02c6('0x20')]='';this[_0x02c6('0x21')]='';}Action[_0x02c6('0x22')]['getCaller']=function(){return util[_0x02c6('0xb')](_0x02c6('0x23'),this[_0x02c6('0xc')],this['number']);};module[_0x02c6('0x24')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 6bfd26a..3a15394 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 _0xb9d7=['Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','recallMe','getContactRecallMe','length','scheduledat','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','sendMessageOneNotActive','IsNotLoggedIn','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','\x20Queue','custom:agentconnect','buildObj','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','BUSY','Busy','countbusyretry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','unlockContact','idContact','disableContact','outboundUnknownCallsDay','cause-txt','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','then','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','getContactPreview','recallme','validateContact','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','SIP/%s/%s%s','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','dialstatus','addVariable','variables','filterKey','variable','keys','value','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','preview','../ami','./util/util','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','pTalking','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','booked','clearZombieChannels','hasOwnProperty','setMessage','isNil','info','Queue','queue','originated:\x20','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xb9d7,0xbb));var _0x7b9d=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb9d7[_0x49b207];return _0x2dc8fa;};'use strict';var util=require(_0x7b9d('0x0'));var _=require(_0x7b9d('0x1'));var BPromise=require(_0x7b9d('0x2'));var uuid=require(_0x7b9d('0x3'));var moment=require(_0x7b9d('0x4'));var md5=require(_0x7b9d('0x5'));var Redis=require('ioredis');var config=require(_0x7b9d('0x6'));var logger=require('../../../config/logger')(_0x7b9d('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x7b9d('0x8'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0x7b9d('0x9'));config[_0x7b9d('0xa')]=_['defaults'](config['redis'],{'host':_0x7b9d('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7b9d('0xa')]));var Sequence=function(){};Sequence[_0x7b9d('0xc')][_0x7b9d('0xd')]=function(_0x35b499){this[_0x7b9d('0xe')]=this[_0x7b9d('0xe')]?this[_0x7b9d('0xe')][_0x7b9d('0xf')](_0x35b499):_0x35b499();};function Preview(_0x59cf1a){this[_0x7b9d('0x10')]=new Sequence();this[_0x7b9d('0x11')]=_0x59cf1a[_0x7b9d('0x12')];this[_0x7b9d('0x13')]=_0x59cf1a[_0x7b9d('0x13')];this[_0x7b9d('0x14')]={};this[_0x7b9d('0x15')]=_0x59cf1a[_0x7b9d('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x7b9d('0x16'),this[_0x7b9d('0x17')][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x19'),this['syncHangup'][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x1a'),this[_0x7b9d('0x1b')][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x1c'),this[_0x7b9d('0x1d')]['bind'](this));ami['on'](_0x7b9d('0x1e'),this[_0x7b9d('0x1f')][_0x7b9d('0x18')](this));ami['on']('varset',this[_0x7b9d('0x20')][_0x7b9d('0x18')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x21'),this[_0x7b9d('0x22')][_0x7b9d('0x18')](this));this[_0x7b9d('0x23')](this[_0x7b9d('0x11')]);}function emit(_0x2536fb,_0x2e5d78,_0x90194e){io['to'](_0x2536fb)[_0x7b9d('0x24')](_0x2e5d78,_0x90194e);}function emitCampaignPreview(_0x3bc1ef){if(_0x3bc1ef[_0x7b9d('0x25')]===_0x7b9d('0x26')){var _0x7d1e9a={'id':_0x3bc1ef['id'],'name':_0x3bc1ef[_0x7b9d('0x27')],'strategy':_0x3bc1ef['strategy'],'answered':_0x3bc1ef[_0x7b9d('0x28')],'available':_0x3bc1ef[_0x7b9d('0x29')],'loggedIn':_0x3bc1ef['loggedIn'],'pTalking':_0x3bc1ef[_0x7b9d('0x2a')],'sumBillable':_0x3bc1ef['sumBillable'],'sumDuration':_0x3bc1ef[_0x7b9d('0x2b')],'sumHoldTime':_0x3bc1ef[_0x7b9d('0x2c')]||0x0,'talking':_0x3bc1ef[_0x7b9d('0x2d')],'total':_0x3bc1ef['total'],'type':_0x3bc1ef['type'],'unmanaged':_0x3bc1ef[_0x7b9d('0x2e')],'abandoned':_0x3bc1ef['abandoned'],'waiting':_0x3bc1ef[_0x7b9d('0x2f')],'loggedInDb':_0x3bc1ef[_0x7b9d('0x30')],'dialActive':_0x3bc1ef[_0x7b9d('0x31')],'dialMethod':_0x3bc1ef[_0x7b9d('0x32')],'dialOriginateCallerIdName':_0x3bc1ef[_0x7b9d('0x33')],'dialOriginateCallerIdNumber':_0x3bc1ef[_0x7b9d('0x34')],'dialOriginateTimeout':_0x3bc1ef[_0x7b9d('0x35')],'dialPrefix':_0x3bc1ef[_0x7b9d('0x36')],'outboundAnswerAgiCallsDay':_0x3bc1ef[_0x7b9d('0x37')],'outboundAnswerCallsDay':_0x3bc1ef['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3bc1ef[_0x7b9d('0x38')],'outboundBusyCallsDay':_0x3bc1ef[_0x7b9d('0x39')],'outboundCongestionCallsDay':_0x3bc1ef['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3bc1ef[_0x7b9d('0x3a')],'outboundDropCallsDayCallersExit':_0x3bc1ef['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3bc1ef[_0x7b9d('0x3b')],'outboundNoAnswerCallsDay':_0x3bc1ef['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3bc1ef[_0x7b9d('0x3c')],'outboundOriginateFailureCallsDay':_0x3bc1ef[_0x7b9d('0x3d')],'outboundReCallsDay':_0x3bc1ef[_0x7b9d('0x3e')],'outboundRejectCallsDay':_0x3bc1ef[_0x7b9d('0x3f')],'outboundUnknownCallsDay':_0x3bc1ef['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3bc1ef[_0x7b9d('0x40')],'predictiveIntervalAvgHoldtime':_0x3bc1ef[_0x7b9d('0x41')],'predictiveIntervalAvgTalktime':_0x3bc1ef['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3bc1ef[_0x7b9d('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x3bc1ef[_0x7b9d('0x43')],'predictiveIntervalErlangCalls':_0x3bc1ef['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3bc1ef[_0x7b9d('0x44')],'predictiveIntervalHitRate':_0x3bc1ef['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3bc1ef[_0x7b9d('0x45')],'predictiveIntervalPauses':_0x3bc1ef[_0x7b9d('0x46')],'predictiveIntervalAvailable':_0x3bc1ef[_0x7b9d('0x47')],'predictiveIntervalTotalCalls':_0x3bc1ef[_0x7b9d('0x48')],'message':_0x3bc1ef[_0x7b9d('0x49')],'originated':_0x3bc1ef['originated'],'erlangCalls':_0x3bc1ef[_0x7b9d('0x4a')],'erlangCallToSecond':_0x3bc1ef[_0x7b9d('0x4b')],'erlangAbandonmentRate':_0x3bc1ef['erlangAbandonmentRate'],'erlangBusyFactor':_0x3bc1ef[_0x7b9d('0x4c')],'startPredictive':_0x3bc1ef[_0x7b9d('0x4d')],'startProgressive':_0x3bc1ef['startProgressive']};if(_0x3bc1ef[_0x7b9d('0x4e')]){_0x7d1e9a[_0x7b9d('0x4e')]={'id':_0x3bc1ef[_0x7b9d('0x4e')]['id'],'name':_0x3bc1ef[_0x7b9d('0x4e')][_0x7b9d('0x27')],'active':_0x3bc1ef[_0x7b9d('0x4e')][_0x7b9d('0x4f')],'callerid':_0x3bc1ef[_0x7b9d('0x4e')][_0x7b9d('0x50')]};}if(_0x3bc1ef[_0x7b9d('0x51')]){_0x7d1e9a[_0x7b9d('0x51')]={'id':_0x3bc1ef[_0x7b9d('0x51')]['id'],'name':_0x3bc1ef[_0x7b9d('0x51')][_0x7b9d('0x27')]};}var _0x4c7f03=md5(JSON[_0x7b9d('0x52')](_0x7d1e9a));if(_0x3bc1ef['md5']!==_0x4c7f03){_0x3bc1ef[_0x7b9d('0x5')]=_0x4c7f03;emit(util['format'](_0x7b9d('0x53'),_0x7d1e9a[_0x7b9d('0x27')]),_0x7b9d('0x54'),_0x7d1e9a);}}}function emitVoiceQueueChannelRemove(_0x302e7b){logger['info'](_0x7b9d('0x55'),JSON['stringify'](_0x302e7b));emit(util[_0x7b9d('0x56')](_0x7b9d('0x53'),_0x302e7b[_0x7b9d('0x27')]),'voice_queue_channel:remove',_0x302e7b);}function notSendMessagesQueue(_0x17a274){if(_0x17a274['sendMessageOneNotActive']){if(_0x17a274['originated']===0x0&&_0x17a274[_0x7b9d('0x2a')]===0x0){_0x17a274['sendMessageOneNotActive']=![];_0x17a274[_0x7b9d('0x29')]=0x0;_0x17a274[_0x7b9d('0x57')]=0x0;_0x17a274[_0x7b9d('0x49')]=_0x7b9d('0x58');ut[_0x7b9d('0x59')](_0x7b9d('0x5a'),_0x17a274['name']+_0x7b9d('0x5b'));}else{_0x17a274[_0x7b9d('0x49')]=_0x7b9d('0x5c');ut[_0x7b9d('0x59')](_0x7b9d('0x5a'),_0x17a274[_0x7b9d('0x27')]+_0x7b9d('0x5d'));}emitCampaignPreview(_0x17a274);}}Preview[_0x7b9d('0xc')][_0x7b9d('0x23')]=function(){var _0x52b4df=this;setInterval(function(){_0x52b4df[_0x7b9d('0x5e')]();},0x7cf);};Preview[_0x7b9d('0xc')][_0x7b9d('0x5e')]=function(){var _0x4d7fd5=this[_0x7b9d('0x11')];this[_0x7b9d('0x5f')]+=0x1;for(var _0x34b062 in _0x4d7fd5){if(_0x4d7fd5['hasOwnProperty'](_0x34b062)&&(_0x4d7fd5[_0x34b062]['dialMethod']===_0x7b9d('0x7')||_0x4d7fd5[_0x34b062][_0x7b9d('0x32')]===_0x7b9d('0x60'))&&_0x4d7fd5[_0x34b062][_0x7b9d('0x25')]===_0x7b9d('0x26')){if(this[_0x7b9d('0x5f')]>0x7){this[_0x7b9d('0x5f')]=0x0;this[_0x7b9d('0x61')]();}}if(_0x4d7fd5[_0x7b9d('0x62')](_0x34b062)&&_0x4d7fd5[_0x34b062][_0x7b9d('0x32')]===_0x7b9d('0x7')&&_0x4d7fd5[_0x34b062][_0x7b9d('0x25')]==='outbound'){if(_0x4d7fd5[_0x34b062][_0x7b9d('0x31')]){this[_0x7b9d('0x63')](_0x4d7fd5[_0x34b062]);this['recallMe'](_0x4d7fd5[_0x34b062]);}else{notSendMessagesQueue(_0x4d7fd5[_0x34b062]);}}}};Preview[_0x7b9d('0xc')]['clearZombieChannel']=function(_0x50d979){var _0x346426=this;this[_0x7b9d('0x10')][_0x7b9d('0xd')](function(){if(!_[_0x7b9d('0x64')](_0x346426[_0x7b9d('0x14')][_0x50d979])){loggerAction[_0x7b9d('0x65')]('[clearZombieChannels][talking]',_0x50d979,_0x7b9d('0x66'),_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x67')],_0x7b9d('0x68'),JSON[_0x7b9d('0x52')](_0x346426[_0x7b9d('0x11')][_0x346426['actions'][_0x50d979][_0x7b9d('0x67')]][_0x7b9d('0x69')]),_0x7b9d('0x6a'),JSON[_0x7b9d('0x52')](_0x346426[_0x7b9d('0x11')][_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x67')]][_0x7b9d('0x2a')]),JSON['stringify'](_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x6b')]),JSON['stringify'](_[_0x7b9d('0x6c')](_0x346426[_0x7b9d('0x14')][_0x50d979],[_0x7b9d('0x6d'),_0x7b9d('0x6e'),_0x7b9d('0x6f'),_0x7b9d('0x70')])));return ami[_0x7b9d('0x71')]({'action':_0x7b9d('0x72'),'channel':_0x346426['actions'][_0x50d979][_0x7b9d('0x73')]})[_0x7b9d('0x74')](function(_0x3d35d1){if(_0x3d35d1[_0x7b9d('0x49')]===_0x7b9d('0x75')){setTimeout(function(){if(_0x346426[_0x7b9d('0x14')][_0x50d979]){ut[_0x7b9d('0x76')](_0x346426[_0x7b9d('0x11')][_0x346426[_0x7b9d('0x14')][_0x50d979]['queue']],'[clearZombieChannel]');if(_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x6b')]===!![]){ut[_0x7b9d('0x77')](_0x346426[_0x7b9d('0x11')][_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x67')]],_0x7b9d('0x78'));ut['loggerError'](_0x7b9d('0x79')+_0x50d979,_0x346426['actions'][_0x50d979][_0x7b9d('0x67')]);}ut[_0x7b9d('0x7a')](_0x7b9d('0x7b')+_0x50d979,_0x346426['actions'][_0x50d979]['queue']);delete _0x346426[_0x7b9d('0x14')][_0x50d979];}},0x2328);}});}});};Preview[_0x7b9d('0xc')][_0x7b9d('0x61')]=function(){var _0x19725a=this;loggerAction['info'](_0x7b9d('0x7c'),_[_0x7b9d('0x7d')](this[_0x7b9d('0x14')]));for(var _0x4c3461 in this[_0x7b9d('0x14')]){if(_0x19725a[_0x7b9d('0x14')][_0x7b9d('0x62')](_0x4c3461)){_0x19725a[_0x7b9d('0x7e')](_0x4c3461);}}};Preview['prototype'][_0x7b9d('0x7f')]=function(_0x2da35a){var _0x471d7c=this;rpcDb[_0x7b9d('0x80')](_0x2da35a['id'],ut['agentReadyId'](this[_0x7b9d('0x15')]))['then'](function(_0x178c8c){if(!_[_0x7b9d('0x64')](_0x178c8c)){for(var _0x48a91e=0x0;_0x48a91e<_0x178c8c[_0x7b9d('0x81')];_0x48a91e+=0x1){if(ut['getDiff'](_0x178c8c[_0x48a91e][_0x7b9d('0x82')])<_0x2da35a['dialRecallMeTimeout']*0x3c){_0x471d7c[_0x7b9d('0x83')](_0x178c8c[_0x48a91e]['id'])['then'](ut[_0x7b9d('0x84')](_0x7b9d('0x85')))['catch'](ut[_0x7b9d('0x84')](_0x7b9d('0x85')));}else{var _0x22ad12=new Action(_0x178c8c[_0x48a91e],_0x2da35a);_0x22ad12[_0x7b9d('0x86')]=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));_0x2da35a[_0x7b9d('0x3e')]+=0x1;ut[_0x7b9d('0x88')](_0x22ad12,0x17,_0x7b9d('0x89'));if(_0x2da35a['dialRecallInQueue']){rpcDb[_0x7b9d('0x8a')](ut[_0x7b9d('0x8b')](_0x178c8c[_0x48a91e]));rpcDb[_0x7b9d('0x8c')](_0x22ad12,_0x7b9d('0x8d'));}else{ut[_0x7b9d('0x88')](_0x22ad12,0x16,_0x7b9d('0x8e'));rpcDb['createCustomerHistory'](_0x22ad12,_0x7b9d('0x8f'));rpcDb[_0x7b9d('0x90')](_0x22ad12,_0x7b9d('0x8f'));}}}}})[_0x7b9d('0x74')](ut[_0x7b9d('0x84')]('[getContactRecallMe]'));};Preview['prototype'][_0x7b9d('0x63')]=function(_0x5dbbd9){_0x5dbbd9[_0x7b9d('0x91')]=!![];if(ut[_0x7b9d('0x92')](_0x5dbbd9['loggedIn'])){_0x5dbbd9['message']='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x5dbbd9[_0x7b9d('0x31')])){_0x5dbbd9[_0x7b9d('0x49')]=_0x7b9d('0x58');}else if(!this[_0x7b9d('0x93')](_0x5dbbd9['Trunk'])){if(!this[_0x7b9d('0x93')](_0x5dbbd9[_0x7b9d('0x94')])){_0x5dbbd9[_0x7b9d('0x49')]=_0x7b9d('0x95');}else{_0x5dbbd9[_0x7b9d('0x49')]=_0x7b9d('0x96');}}else{_0x5dbbd9['message']=_0x7b9d('0x96');}emitCampaignPreview(_0x5dbbd9);};Preview['prototype'][_0x7b9d('0x97')]=function(_0x1a91fc,_0x147a19,_0x482d66){var _0x53c835=this;var _0x2a2614=this[_0x7b9d('0x14')][_0x147a19];var _0x5036e7=this[_0x7b9d('0x11')][_0x2a2614[_0x7b9d('0x67')]];var _0x1ea42f;if(_0x5036e7){switch(_0x482d66){case'1':_0x5036e7[_0x7b9d('0x3c')]+=0x1;_0x2a2614[_0x7b9d('0x98')]=ut['totalGlobal'](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x0,_0x7b9d('0x99'));rpcDb[_0x7b9d('0x8c')](_0x2a2614,_0x7b9d('0x9a'));if(ut[_0x7b9d('0x9b')](_0x2a2614)>=_0x5036e7[_0x7b9d('0x9c')]){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb[_0x7b9d('0x90')](_0x1ea42f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0x9f'));}delete this[_0x7b9d('0x14')][_0x1a91fc[_0x7b9d('0xa0')]];break;case _0x7b9d('0xa1'):var _0xf97a=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));_0x2a2614[_0x7b9d('0xa2')]=_0xf97a;_0x2a2614['answertime']=_0xf97a;_0x2a2614['dialAnswer']=!![];_0x5036e7[_0x7b9d('0x2a')]+=0x1;logger[_0x7b9d('0x65')]('[syncHangup][talking][increment]',_0x2a2614['uniqueid'],_0x7b9d('0xa3'),_0x5036e7[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x5036e7[_0x7b9d('0x2a')]);ami[_0x7b9d('0x24')](_0x7b9d('0xa4'),ut[_0x7b9d('0xa5')](_0x2a2614,_0x7b9d('0xa6')));if(_0x5036e7['acw']){ami['emit'](_0x7b9d('0xa7'),ut[_0x7b9d('0xa8')](_0x2a2614));}break;case'16':ami['emit'](_0x7b9d('0xa9'),ut['buildObj'](_0x2a2614,'complete'));emitVoiceQueueChannelRemove(ut[_0x7b9d('0xa5')](_0x2a2614,_0x7b9d('0xaa')));_0x5036e7['outboundAnswerCallsDay']+=0x1;_0x5036e7['total']+=0x1;_0x5036e7[_0x7b9d('0x28')]+=0x1;ut['decrementTalkink'](_0x5036e7,_0x7b9d('0xab'));_0x2a2614['countglobal']=ut[_0x7b9d('0x9b')](_0x2a2614);ut['logCustomer'](_0x2a2614,0x4,_0x7b9d('0xac'));rpcDb[_0x7b9d('0x8c')](_0x2a2614,_0x7b9d('0xad'));rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0xae'));rpcDb['crateCustomerReportQueue'](_0x2a2614);_0x5036e7[_0x7b9d('0x2b')]+=_0x2a2614[_0x7b9d('0xaf')];_0x5036e7['sumBillable']+=_0x2a2614[_0x7b9d('0xaf')];logger[_0x7b9d('0x65')]('[syncHangup][talking][decrement]',_0x2a2614['uniqueid'],_0x7b9d('0xa3'),_0x5036e7[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x5036e7[_0x7b9d('0x2a')]);delete this['actions'][_0x1a91fc['linkedid']];break;case _0x7b9d('0xb0'):_0x5036e7[_0x7b9d('0x39')]+=0x1;_0x2a2614['countbusyretry']+=0x1;_0x2a2614['countglobal']=ut[_0x7b9d('0x9b')](_0x2a2614);ut['logCustomer'](_0x2a2614,0x5,_0x7b9d('0xb1'));rpcDb['createCustomerHistory'](_0x2a2614,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x2a2614)>=_0x5036e7['dialGlobalMaxRetry']){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb['createCustomerFinal'](_0x1ea42f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2a2614[_0x7b9d('0xb2')]>=_0x5036e7['dialBusyMaxRetry']){rpcDb[_0x7b9d('0x90')](_0x2a2614,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7b9d('0xb3')](ut[_0x7b9d('0xb4')](_0x2a2614,_0x7b9d('0xb2'),_0x5036e7[_0x7b9d('0xb5')]),_0x2a2614[_0x7b9d('0xb6')],_0x2a2614['activeContact']);}}break;case _0x7b9d('0xb7'):_0x5036e7[_0x7b9d('0xb8')]+=0x1;_0x2a2614[_0x7b9d('0xb9')]+=0x1;_0x2a2614[_0x7b9d('0x98')]=ut['totalGlobal'](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x3,_0x7b9d('0xba'));rpcDb['createCustomerHistory'](_0x2a2614,_0x7b9d('0xbb'));if(ut[_0x7b9d('0x9b')](_0x2a2614)>=_0x5036e7['dialGlobalMaxRetry']){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb[_0x7b9d('0x90')](_0x1ea42f,_0x7b9d('0xbc'));}else{if(_0x2a2614[_0x7b9d('0xb9')]>=_0x5036e7[_0x7b9d('0xbd')]){rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0xbb'));}else{rpcDb[_0x7b9d('0xb3')](ut[_0x7b9d('0xb4')](_0x2a2614,_0x7b9d('0xb9'),_0x5036e7[_0x7b9d('0xbe')]),_0x2a2614[_0x7b9d('0xb6')],_0x2a2614[_0x7b9d('0xbf')]);}}break;case _0x7b9d('0xc0'):_0x5036e7[_0x7b9d('0xc1')]+=0x1;_0x2a2614[_0x7b9d('0xc2')]+=0x1;_0x2a2614['countglobal']=ut[_0x7b9d('0x9b')](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x8,_0x7b9d('0xc3'));rpcDb[_0x7b9d('0x8c')](_0x2a2614,_0x7b9d('0xc4'));if(ut['totalGlobal'](_0x2a2614)>=_0x5036e7[_0x7b9d('0x9c')]){_0x1ea42f=ut['cloneAction'](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb[_0x7b9d('0x90')](_0x1ea42f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2a2614[_0x7b9d('0xc2')]>=_0x5036e7[_0x7b9d('0xc5')]){rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0xc4'));}else{rpcDb[_0x7b9d('0xb3')](ut[_0x7b9d('0xb4')](_0x2a2614,_0x7b9d('0xc2'),_0x5036e7[_0x7b9d('0xb5')]),_0x2a2614[_0x7b9d('0xb6')],_0x2a2614[_0x7b9d('0xbf')]);}}break;case _0x7b9d('0xc6'):_0x5036e7['outboundRejectCallsDay']+=0x1;_0x2a2614['countglobal']=ut['totalGlobal'](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x14,_0x7b9d('0xc7'));rpcDb['createCustomerHistory'](_0x2a2614,'[syncHangupRequest][logAgentReject]');if(_0x2a2614[_0x7b9d('0xb6')]){rpcDb[_0x7b9d('0xc8')](_0x2a2614[_0x7b9d('0xc9')]);}if(_0x2a2614[_0x7b9d('0xbf')]){rpcDb[_0x7b9d('0xca')](_0x2a2614['idContact']);}break;default:if(_0x2a2614['dialAnswer']){ut['decrementTalkink'](_0x5036e7,'[default]');ut[_0x7b9d('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x5036e7['name'],_0x1a91fc);}_0x5036e7[_0x7b9d('0xcb')]+=0x1;_0x2a2614[_0x7b9d('0x98')]=ut[_0x7b9d('0x9b')](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0xc,_0x1a91fc[_0x7b9d('0xcc')]||_0x1a91fc['dialstatus']);rpcDb[_0x7b9d('0x8c')](_0x2a2614,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x2a2614)>=_0x5036e7[_0x7b9d('0x9c')]){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,'Global');rpcDb[_0x7b9d('0x90')](_0x1ea42f,_0x7b9d('0xcd'));}else{rpcDb['createCustomerFinal'](_0x2a2614,_0x7b9d('0xcd'));}delete this[_0x7b9d('0x14')][_0x1a91fc['linkedid']];}if(!(_0x2a2614[_0x7b9d('0x6b')]&&_0x482d66==='16')){ut['updateOriginated'](_0x5036e7,_0x7b9d('0xce'));logger['info'](_0x7b9d('0xcf'),_0x2a2614[_0x7b9d('0xd0')],_0x7b9d('0xa3'),_0x5036e7[_0x7b9d('0x27')],_0x7b9d('0x68'),_0x5036e7['originated']);}if(_0x482d66!==_0x7b9d('0xa1')){delete this[_0x7b9d('0x14')][_0x1a91fc[_0x7b9d('0xa0')]];delete this['actions'][_0x1a91fc[_0x7b9d('0xd1')]];}}};Preview[_0x7b9d('0xc')][_0x7b9d('0xd2')]=function(_0x2fe3c0,_0x7b634e,_0x4527d3){if(_[_0x7b9d('0xd3')](_0x7b634e)&&_0x7b9d('0xd4')!==typeof _0x7b634e){return;}if(_[_0x7b9d('0xd3')](_0x4527d3)&&'object'!==typeof _0x4527d3){return;}switch(_0x4527d3[_0x7b9d('0xd5')]){case'0':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x0,_0x7b9d('0x99'));rpcDb['createAgentHistory'](_0x2fe3c0,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x3,_0x7b9d('0xba'));rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xd8'));break;case'5':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x5,_0x7b9d('0xb1'));rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xd9'));break;case'8':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x8,_0x7b9d('0xc3'));rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xda'));break;case'22':ut['logAgent'](_0x2fe3c0,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x2fe3c0,_0x7b9d('0xdb'));break;default:ut[_0x7b9d('0xd6')](_0x2fe3c0,0xc,_0x4527d3[_0x7b9d('0xd5')]);rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xda'));}ut[_0x7b9d('0x76')](_0x7b634e,_0x7b9d('0xdc'));logger[_0x7b9d('0x65')]('[originated][decrement][callProgressDetectingAgent]',_0x2fe3c0[_0x7b9d('0xd0')],'\x20Queue',_0x7b634e[_0x7b9d('0x27')],_0x7b9d('0x68'),_0x7b634e['originated']);delete this[_0x7b9d('0x14')][_0x2fe3c0['uniqueid']];};Preview[_0x7b9d('0xc')][_0x7b9d('0xdd')]=function(_0x270269,_0x5c25d3,_0x8ca4ed,_0x33c683,_0x3c8262){var _0x32d06e=this;return new BPromise(function(_0xc12863,_0x2eef87){if(_[_0x7b9d('0x64')](_0x5c25d3)||_[_0x7b9d('0x64')](_0x5c25d3[_0x7b9d('0xde')])||_[_0x7b9d('0x64')](_0x5c25d3['Contact'][_0x7b9d('0xdf')])||_[_0x7b9d('0x64')](_0x5c25d3[_0x7b9d('0x6f')])){_0x2eef87(ut[_0x7b9d('0x49')](_0x7b9d('0xe0'),_0x33c683,_0x3c8262));return;}var _0x3f51b3=uuid['v4']();var _0x25109b=_0x32d06e['campaignsPreview'][_0x5c25d3['Queue'][_0x7b9d('0x27')]];var _0xbbea12=_0x8ca4ed?_0x32d06e[_0x7b9d('0x15')][_0x8ca4ed]['id']:undefined;_0x32d06e[_0x7b9d('0x14')][_0x3f51b3]=new Action(_0x5c25d3,_0x25109b,_0x3f51b3,_0x8ca4ed,_0xbbea12);var _0x1f758d=_0x32d06e[_0x7b9d('0x14')][_0x3f51b3];_0x1f758d[_0x7b9d('0xb6')]=_0x33c683;_0x1f758d['activeContact']=_0x3c8262;_0x1f758d[_0x7b9d('0xe1')]=_0x8ca4ed;if(_[_0x7b9d('0xe2')](_0x270269)){_0x32d06e[_0x7b9d('0xe3')](_0x1f758d,_0x25109b,_0x5c25d3,_0x8ca4ed)[_0x7b9d('0xe4')](function(_0x4af8c3){logger[_0x7b9d('0x65')](_0x7b9d('0xe5'),'Queue:\x20'+_0x1f758d[_0x7b9d('0x67')]+_0x7b9d('0xe6')+_0x1f758d['idContact'],JSON['stringify'](_0x4af8c3));ami['emit'](_0x7b9d('0xe7'),ut['buildObj'](_0x1f758d,_0x7b9d('0xe8')));_0xc12863(ut['message']('Calling'));})[_0x7b9d('0x74')](function(_0x5c10d5){ut['logger']('[Preview][execCall][failure]',_0x5c10d5);_0x2eef87(ut['message'](_0x7b9d('0xe9'),_0x33c683,_0x3c8262));});}else{_0x25109b['outboundBlacklistCallsDay']+=0x1;ut[_0x7b9d('0xea')](_0x1f758d);rpcDb['createHistory'](_0x1f758d,_0x7b9d('0xeb'));delete _0x32d06e[_0x7b9d('0x14')][_0x3f51b3];_0x2eef87(ut[_0x7b9d('0x49')](_0x7b9d('0xec'),_0x33c683,_0x3c8262));}});};Preview[_0x7b9d('0xc')][_0x7b9d('0x93')]=function(_0xc6b920){return!_[_0x7b9d('0x64')](_0xc6b920)&&!_[_0x7b9d('0x64')](_0xc6b920[_0x7b9d('0x27')])&&!_[_0x7b9d('0x64')](_0xc6b920['active'])&&_0xc6b920[_0x7b9d('0x4f')]&&!_['isNil'](this['trunks'][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])])&&!_[_0x7b9d('0x64')](this[_0x7b9d('0x13')][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])][_0x7b9d('0x72')])&&(this[_0x7b9d('0x13')][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])][_0x7b9d('0x72')]===_0x7b9d('0xee')||this[_0x7b9d('0x13')][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])][_0x7b9d('0x72')]==='unmonitored');};Preview[_0x7b9d('0xc')]['run']=function(_0x258ade,_0x5af5db){var _0x51dcf5=this;return new BPromise(function(_0x1e6559,_0x4f0eea){_0x51dcf5[_0x7b9d('0xef')](_0x258ade,_0x5af5db)[_0x7b9d('0xe4')](function(_0xa119f7){_0x1e6559(_[_0x7b9d('0x6c')](_0xa119f7,[_0x7b9d('0x49')]));})[_0x7b9d('0x74')](function(_0x3d0aaa){if(_0x3d0aaa['unlock']){rpcDb['unlockContact'](_0x258ade);}if(_0x3d0aaa[_0x7b9d('0x4f')]){rpcDb['disableContact'](_0x258ade);}_0x4f0eea(_[_0x7b9d('0x6c')](_0x3d0aaa,[_0x7b9d('0x49')]));});});};Preview[_0x7b9d('0xc')]['execRun']=function(_0x3b5b55,_0x485006){var _0x2e789a=this;return new BPromise(function(_0x4809d5,_0x2b64ab){var _0x235af4,_0x3159e0;rpcDb[_0x7b9d('0xf0')](_0x3b5b55)[_0x7b9d('0xe4')](function(_0x5ee96d){if(!_[_0x7b9d('0x64')](_0x5ee96d[0x0])){_0x3159e0=_0x5ee96d[0x0][_0x7b9d('0xf1')]?![]:!![];_0x235af4=_0x5ee96d[0x0]['recallme']?!![]:![];_0x235af4=_0x485006?!![]:_0x235af4;}var _0x559c3d=_0x2e789a[_0x7b9d('0xf2')](_0x5ee96d);if(_0x559c3d['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x5ee96d[0x0],[_0x7b9d('0x6f'),'Contact.phone']))[_0x7b9d('0xe4')](function(_0xc48af7){_0x2e789a[_0x7b9d('0xdd')](_0xc48af7,_0x5ee96d[0x0],_0x485006,_0x3159e0,_0x235af4)['then'](function(_0x9ed9a0){_0x4809d5(_0x9ed9a0);})[_0x7b9d('0x74')](function(_0x51651f){_0x2b64ab(_0x51651f);});})[_0x7b9d('0x74')](function(_0x1f644e){ut[_0x7b9d('0x59')](_0x7b9d('0xf3'),_0x1f644e);_0x2b64ab(ut[_0x7b9d('0x49')]('Call\x20unsuccessful',_0x3159e0,_0x235af4));});}else{_0x2b64ab(ut[_0x7b9d('0x49')](_0x559c3d[_0x7b9d('0x49')],_0x3159e0,_0x235af4));}})['catch'](function(_0x3a9cec){ut['logger'](_0x7b9d('0xf4'),_0x3a9cec);_0x2b64ab(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0x7b9d('0xf2')]=function(_0x308190){if(_['isNil'](_0x308190)||_[_0x7b9d('0xe2')](_0x308190)||!_[_0x7b9d('0x64')](_0x308190[0x0][_0x7b9d('0xf5')])&&_[_0x7b9d('0x64')](_0x308190[0x0]['Agent']['name'])){ut[_0x7b9d('0x59')](_0x7b9d('0xf6'),_0x308190);return{'isValid':![],'message':_0x7b9d('0xf7')};}var _0x142696=this[_0x7b9d('0x11')][_0x308190[0x0][_0x7b9d('0x66')][_0x7b9d('0x27')]];_0x142696[_0x7b9d('0x49')]='ACTIVE';if(_[_0x7b9d('0x64')](_0x142696)){ut[_0x7b9d('0x59')](_0x7b9d('0xf8'),_0x142696);return{'isValid':![],'message':_0x7b9d('0xf9')};}if(!this[_0x7b9d('0x93')](_0x142696['Trunk'])){ut[_0x7b9d('0x59')](_0x7b9d('0xfa'),_0x7b9d('0xfb')+_0x142696[_0x7b9d('0x27')]+_0x7b9d('0xfc'));if(!this[_0x7b9d('0x93')](_0x142696[_0x7b9d('0x94')])){ut[_0x7b9d('0x59')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x142696[_0x7b9d('0x27')]+_0x7b9d('0xfd'));return{'isValid':![],'message':_0x7b9d('0xfe')};}}if(!ut[_0x7b9d('0xff')](_0x142696[_0x7b9d('0x31')])){ut['logger'](_0x7b9d('0x100'),_0x142696[_0x7b9d('0x27')]+_0x7b9d('0x101'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x142696[_0x7b9d('0x27')]+_0x7b9d('0x101')};}return{'isValid':!![],'message':_0x7b9d('0x102')};};Preview[_0x7b9d('0xc')][_0x7b9d('0xe3')]=function(_0x13776f,_0x56c46b,_0x3bcc69,_0x1cb910){var _0x1f01d3=this;return new BPromise(function(_0x47a0f1,_0x319509){var _0x1739a6=_0x13776f['uniqueid'];var _0x9c1e72=_0x1f01d3[_0x7b9d('0x93')](_0x56c46b[_0x7b9d('0x4e')])?util[_0x7b9d('0x56')]('SIP/%s/%s%s',_0x56c46b['Trunk'][_0x7b9d('0x27')],_[_0x7b9d('0x64')](_0x56c46b[_0x7b9d('0x36')])?'':_0x56c46b[_0x7b9d('0x36')][_0x7b9d('0x103')]()||'',_0x56c46b[_0x7b9d('0x104')]>0x0?_0x3bcc69[_0x7b9d('0xde')][_0x7b9d('0xdf')]['substring'](_0x56c46b[_0x7b9d('0x104')]):_0x3bcc69['Contact'][_0x7b9d('0xdf')]):util['format'](_0x7b9d('0x105'),_[_0x7b9d('0x64')](_0x56c46b[_0x7b9d('0x94')])?_0x56c46b[_0x7b9d('0x4e')][_0x7b9d('0x27')]:_0x56c46b[_0x7b9d('0x94')][_0x7b9d('0x27')],_['isNil'](_0x56c46b['dialPrefix'])?'':_0x56c46b[_0x7b9d('0x36')][_0x7b9d('0x103')]()||'',_0x56c46b[_0x7b9d('0x104')]>0x0?_0x3bcc69[_0x7b9d('0xde')][_0x7b9d('0xdf')][_0x7b9d('0x106')](_0x56c46b[_0x7b9d('0x104')]):_0x3bcc69[_0x7b9d('0xde')]['phone']);var _0xc9ec4=_0x1f01d3[_0x7b9d('0x93')](_0x56c46b['Trunk'])?ut[_0x7b9d('0x107')](_0x56c46b['Trunk'][_0x7b9d('0x50')],_0x56c46b['dialOriginateCallerIdName'],_0x56c46b[_0x7b9d('0x108')]>0x0?ut[_0x7b9d('0x109')](_0x56c46b[_0x7b9d('0x34')],_0x56c46b[_0x7b9d('0x108')]):_0x56c46b[_0x7b9d('0x34')]):ut['getCallerId'](_[_0x7b9d('0x64')](_0x56c46b['TrunkBackup'])?_0x56c46b['Trunk']['callerid']:_0x56c46b[_0x7b9d('0x94')]['callerid'],_0x56c46b[_0x7b9d('0x33')],_0x56c46b['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x56c46b[_0x7b9d('0x34')],_0x56c46b[_0x7b9d('0x108')]):_0x56c46b['dialOriginateCallerIdNumber']);if(_0xc9ec4){_0x13776f[_0x7b9d('0x10a')]=ut['extractCalleridName'](_0xc9ec4);_0x13776f[_0x7b9d('0x10b')]=ut[_0x7b9d('0x10c')](_0xc9ec4);}var _0xc2c1a8=ut[_0x7b9d('0x10d')](_0x56c46b,_0x3bcc69,_0x9c1e72,_0xc9ec4,_0x1739a6,_0x13776f);_['merge'](_0x13776f,ut[_0x7b9d('0x10e')](_0xc2c1a8));_0x13776f[_0x7b9d('0x86')]=moment()[_0x7b9d('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x7b9d('0x71')](ut[_0x7b9d('0x10f')](_0x13776f,_0x56c46b,_0xc2c1a8,_0x13776f[_0x7b9d('0xbf')],_0x1cb910))[_0x7b9d('0xe4')](function(_0x7783cb){_0x56c46b[_0x7b9d('0x69')]+=0x1;logger[_0x7b9d('0x65')](_0x7b9d('0x110'),_0x1739a6,'\x20Queue',_0x56c46b[_0x7b9d('0x27')],'originated:\x20',_0x56c46b[_0x7b9d('0x69')]);_0x47a0f1(_0x7783cb);})['catch'](function(_0x56567b){ut[_0x7b9d('0xd6')](_0x13776f,0xe,_0x7b9d('0x111'));rpcDb[_0x7b9d('0xd7')](_0x13776f,_0x7b9d('0x112'));_0x319509(_0x56567b);});});};Preview[_0x7b9d('0xc')][_0x7b9d('0x1f')]=function(_0x435e02){if(this['actions'][_0x435e02[_0x7b9d('0xa0')]]){this[_0x7b9d('0x14')][_0x435e02['linkedid']][_0x7b9d('0x73')]=_0x435e02[_0x7b9d('0x73')];}};Preview[_0x7b9d('0xc')][_0x7b9d('0x17')]=function(_0x2efa7a){var _0x5bb828=this;var _0x1a8aa=this[_0x7b9d('0x14')][_0x2efa7a['actionid']];if(_0x1a8aa){if(_0x1a8aa[_0x7b9d('0xe1')]&&this[_0x7b9d('0x15')][_0x1a8aa[_0x7b9d('0xe1')]]){ut[_0x7b9d('0x113')](_0x1a8aa,this[_0x7b9d('0x15')][_0x1a8aa['lookAgent']][_0x7b9d('0x27')],this[_0x7b9d('0x15')][_0x1a8aa[_0x7b9d('0xe1')]]['id']);}var _0x563aa7=_[_0x7b9d('0x114')](_0x1a8aa);_0x563aa7[_0x7b9d('0xa2')]=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));var _0x45824e=_0x5bb828[_0x7b9d('0x11')][_0x1a8aa[_0x7b9d('0x67')]];if(ut[_0x7b9d('0x115')](_0x2efa7a['response'])){if(_0x1a8aa[_0x7b9d('0xb6')]){rpcDb[_0x7b9d('0xc8')](_0x1a8aa[_0x7b9d('0xc9')]);}if(_0x1a8aa[_0x7b9d('0xbf')]){rpcDb[_0x7b9d('0xca')](_0x1a8aa['idContact']);}ami[_0x7b9d('0x24')]('custom:agentringnoanswer',ut[_0x7b9d('0xa5')](_0x1a8aa,_0x7b9d('0x116')));this[_0x7b9d('0xd2')](_0x563aa7,_0x45824e,_0x2efa7a);}else{_0x1a8aa[_0x7b9d('0x86')]=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));ut[_0x7b9d('0xd6')](_0x563aa7,0x4,_0x7b9d('0xac'));rpcDb[_0x7b9d('0xd7')](_0x563aa7,_0x7b9d('0x117'));}}};Preview['prototype']['syncHangup']=function(_0x183d80){var _0x26e7c7=this;var _0x1e52c8=this[_0x7b9d('0x14')][_0x183d80['linkedid']];var _0x4723cb;if(_0x1e52c8){_0x4723cb=this[_0x7b9d('0x11')][_0x1e52c8[_0x7b9d('0x67')]];logger[_0x7b9d('0x65')](_0x7b9d('0x118'),_0x183d80['linkedid'],_0x7b9d('0xa3'),_0x4723cb[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x4723cb['pTalking']);}if(this[_0x7b9d('0x14')][_0x183d80[_0x7b9d('0xa0')]]&&_0x183d80[_0x7b9d('0xa0')]!==_0x183d80[_0x7b9d('0xd0')]){if(_0x183d80[_0x7b9d('0x119')]==='16'&&this[_0x7b9d('0x14')][_0x183d80[_0x7b9d('0xa0')]][_0x7b9d('0x6b')]){this[_0x7b9d('0x97')](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')]);}else if(this['actions'][_0x183d80['linkedid']]['dialAnswer']){logger[_0x7b9d('0x65')](_0x7b9d('0x11a'),_0x183d80['linkedid'],_0x183d80[_0x7b9d('0x119')],_0x7b9d('0xa3'),_0x4723cb[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x4723cb['pTalking']);this['callProgressDetectingCustomer'](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80['cause']);}}else if(_0x1e52c8&&_[_0x7b9d('0x64')](_0x1e52c8[_0x7b9d('0x11b')])&&_0x4723cb['dialQueueProject']&&_0x183d80[_0x7b9d('0xa0')]===_0x183d80['uniqueid']&&_[_0x7b9d('0x64')](_0x183d80[_0x7b9d('0xd5')])&&_0x183d80['cause']==='16'&&_0x183d80[_0x7b9d('0x11c')]==='6'&&_['isUndefined'](_0x1e52c8[_0x7b9d('0x11d')])){if(_0x1e52c8['unlockAgent']){rpcDb[_0x7b9d('0xc8')](_0x1e52c8['idContact']);}if(_0x1e52c8[_0x7b9d('0xbf')]){rpcDb['disableContact'](_0x1e52c8[_0x7b9d('0xc9')]);}_0x183d80['reason']='22';this[_0x7b9d('0xd2')](_0x1e52c8,_0x4723cb,_0x183d80);}else if(_0x1e52c8&&_0x1e52c8['transfer']){if(_0x183d80[_0x7b9d('0x119')]==='16'&&this[_0x7b9d('0x14')][_0x183d80[_0x7b9d('0xa0')]][_0x7b9d('0x6b')]){logger[_0x7b9d('0x65')](_0x7b9d('0x11e'),_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')],_0x7b9d('0xa3'),_0x4723cb['name'],_0x7b9d('0x6a'),_0x4723cb[_0x7b9d('0x2a')]);this[_0x7b9d('0x97')](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')]);}else if(this['actions'][_0x183d80[_0x7b9d('0xa0')]][_0x7b9d('0x6b')]){logger[_0x7b9d('0x65')](_0x7b9d('0x11a'),_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')],_0x7b9d('0xa3'),_0x4723cb[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x4723cb[_0x7b9d('0x2a')]);this[_0x7b9d('0x97')](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80['cause']);}}};Preview[_0x7b9d('0xc')][_0x7b9d('0x1d')]=function(_0x2e4482){if(this[_0x7b9d('0x14')][_0x2e4482[_0x7b9d('0xd1')]]&&_0x2e4482['destlinkedid']!==_0x2e4482['destuniqueid']){this[_0x7b9d('0x97')](_0x2e4482,_0x2e4482[_0x7b9d('0xd1')],_0x2e4482[_0x7b9d('0x11f')]);}};Preview[_0x7b9d('0xc')][_0x7b9d('0x1b')]=function(_0x33f177){if(this[_0x7b9d('0x14')][_0x33f177[_0x7b9d('0xa0')]]&&_0x33f177['linkedid']!==_0x33f177[_0x7b9d('0xd0')]&&!this[_0x7b9d('0x14')][_0x33f177[_0x7b9d('0xa0')]]['dialAnswer']){if(_0x33f177[_0x7b9d('0x119')]==='1'){this[_0x7b9d('0x97')](_0x33f177,_0x33f177[_0x7b9d('0xa0')],_0x33f177[_0x7b9d('0x119')]);}}};Preview[_0x7b9d('0xc')][_0x7b9d('0x120')]=function(_0x33bdfd,_0x19b4dd,_0x282ed2){if(this['actions'][_0x33bdfd]){if(_['isNil'](this['actions'][_0x33bdfd][_0x7b9d('0x121')])){this[_0x7b9d('0x14')][_0x33bdfd][_0x7b9d('0x121')]={};}this[_0x7b9d('0x14')][_0x33bdfd][_0x7b9d('0x121')][_0x19b4dd]=_0x282ed2;}};Preview['prototype']['syncVarSet']=function(_0x18da18){try{if(!_[_0x7b9d('0x64')](_0x18da18)){if(ut[_0x7b9d('0x122')](_['keys'](_0x18da18[_0x7b9d('0x123')])[0x0])){this['addVariable'](_0x18da18[_0x7b9d('0xd0')],_[_0x7b9d('0x124')](_0x18da18[_0x7b9d('0x123')])[0x0],_0x18da18[_0x7b9d('0x125')]);}}}catch(_0x33a432){logger[_0x7b9d('0x126')]('[syncVarSet][Preview]',util[_0x7b9d('0x127')](_0x33a432,{'showHidden':![],'depth':null}));}};Preview[_0x7b9d('0xc')][_0x7b9d('0x128')]=function(_0xf629e4){if(_0xf629e4){if(this['actions'][_0xf629e4[_0x7b9d('0x129')]]){this[_0x7b9d('0x14')][_0xf629e4[_0x7b9d('0x129')]][_0x7b9d('0x11d')]=!![];}}};Preview[_0x7b9d('0xc')][_0x7b9d('0x22')]=function(_0x2935e0){if(_0x2935e0){if(this[_0x7b9d('0x14')][_0x2935e0[_0x7b9d('0x12a')]]){this[_0x7b9d('0x14')][_0x2935e0[_0x7b9d('0x12a')]][_0x7b9d('0x11d')]=!![];}}};module[_0x7b9d('0x12b')]=Preview; \ No newline at end of file +var _0xce20=['sumBillable','BUSY','outboundBusyCallsDay','countbusyretry','Busy','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','rescheduleContact','scheduledAt','unlockAgent','activeContact','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','CANCEL','outboundRejectCallsDay','[syncHangupRequest][logAgentReject]','idContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','originated:\x20','Contact','lookAgent','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','Calling','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','SIP/%s','reachable','unmonitored','execRun','pick','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','Empty\x20Contact','ACTIVE','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','trim','dialCutDigit','phone','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridNumber','addVariables','toLowerVariables','Action','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','syncHangupRequest','addVariable','variables','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','md5','ioredis','../../../config/environment','preview','../../../config/logger','actionPreview','./rpcDb','./action','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','type','outbound','name','strategy','answered','available','pTalking','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','originated','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','clearZombieChannels','hasOwnProperty','setMessage','prototype','clearZombieChannel','info','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','contactId','UserId','VoiceQueueId','status','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','isNil','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','loggedIn','AGENTS_NOT_LOGGED','isActive','TRUNK_IS_NOT_REACHABLE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','emit','buildObj','acw','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime'];(function(_0x4907de,_0x5bbdc6){var _0x482054=function(_0x39ecf6){while(--_0x39ecf6){_0x4907de['push'](_0x4907de['shift']());}};_0x482054(++_0x5bbdc6);}(_0xce20,0x8a));var _0x0ce2=function(_0x231faa,_0x37d1c6){_0x231faa=_0x231faa-0x0;var _0xba0a5d=_0xce20[_0x231faa];return _0xba0a5d;};'use strict';var util=require(_0x0ce2('0x0'));var _=require(_0x0ce2('0x1'));var BPromise=require(_0x0ce2('0x2'));var uuid=require(_0x0ce2('0x3'));var moment=require('moment');var md5=require(_0x0ce2('0x4'));var Redis=require(_0x0ce2('0x5'));var config=require(_0x0ce2('0x6'));var logger=require('../../../config/logger')(_0x0ce2('0x7'));var loggerAction=require(_0x0ce2('0x8'))(_0x0ce2('0x9'));var ami=require('../ami');var rpcDb=require(_0x0ce2('0xa'));var Action=require(_0x0ce2('0xb'));var ut=require('./util/util');config['redis']=_['defaults'](config[_0x0ce2('0xc')],{'host':_0x0ce2('0xd'),'port':0x18eb});var io=require(_0x0ce2('0xe'))(new Redis(config[_0x0ce2('0xc')]));var Sequence=function(){};Sequence['prototype'][_0x0ce2('0xf')]=function(_0x24da70){this[_0x0ce2('0x10')]=this['tail']?this[_0x0ce2('0x10')][_0x0ce2('0x11')](_0x24da70):_0x24da70();};function Preview(_0x198895){this[_0x0ce2('0x12')]=new Sequence();this[_0x0ce2('0x13')]=_0x198895[_0x0ce2('0x14')];this[_0x0ce2('0x15')]=_0x198895[_0x0ce2('0x15')];this[_0x0ce2('0x16')]={};this[_0x0ce2('0x17')]=_0x198895['agents'];this[_0x0ce2('0x18')]=0x0;ami['on']('originateresponse',this[_0x0ce2('0x19')][_0x0ce2('0x1a')](this));ami['on'](_0x0ce2('0x1b'),this[_0x0ce2('0x1c')]['bind'](this));ami['on'](_0x0ce2('0x1d'),this['syncHangupRequest']['bind'](this));ami['on'](_0x0ce2('0x1e'),this['syncDialEnd'][_0x0ce2('0x1a')](this));ami['on'](_0x0ce2('0x1f'),this[_0x0ce2('0x20')][_0x0ce2('0x1a')](this));ami['on'](_0x0ce2('0x21'),this[_0x0ce2('0x22')][_0x0ce2('0x1a')](this));ami['on'](_0x0ce2('0x23'),this[_0x0ce2('0x24')][_0x0ce2('0x1a')](this));ami['on'](_0x0ce2('0x25'),this[_0x0ce2('0x26')][_0x0ce2('0x1a')](this));this[_0x0ce2('0x27')](this['campaignsPreview']);}function emit(_0x40d316,_0x4f015a,_0x5338e0){io['to'](_0x40d316)['emit'](_0x4f015a,_0x5338e0);}function emitCampaignPreview(_0x4b5e62){if(_0x4b5e62[_0x0ce2('0x28')]===_0x0ce2('0x29')){var _0x4e9564={'id':_0x4b5e62['id'],'name':_0x4b5e62[_0x0ce2('0x2a')],'strategy':_0x4b5e62[_0x0ce2('0x2b')],'answered':_0x4b5e62[_0x0ce2('0x2c')],'available':_0x4b5e62[_0x0ce2('0x2d')],'loggedIn':_0x4b5e62['loggedIn'],'pTalking':_0x4b5e62[_0x0ce2('0x2e')],'sumBillable':_0x4b5e62['sumBillable'],'sumDuration':_0x4b5e62[_0x0ce2('0x2f')],'sumHoldTime':_0x4b5e62[_0x0ce2('0x30')]||0x0,'talking':_0x4b5e62['talking'],'total':_0x4b5e62[_0x0ce2('0x31')],'type':_0x4b5e62['type'],'unmanaged':_0x4b5e62[_0x0ce2('0x32')],'abandoned':_0x4b5e62[_0x0ce2('0x33')],'waiting':_0x4b5e62[_0x0ce2('0x34')],'loggedInDb':_0x4b5e62['loggedInDb'],'dialActive':_0x4b5e62[_0x0ce2('0x35')],'dialMethod':_0x4b5e62[_0x0ce2('0x36')],'dialOriginateCallerIdName':_0x4b5e62[_0x0ce2('0x37')],'dialOriginateCallerIdNumber':_0x4b5e62[_0x0ce2('0x38')],'dialOriginateTimeout':_0x4b5e62[_0x0ce2('0x39')],'dialPrefix':_0x4b5e62[_0x0ce2('0x3a')],'outboundAnswerAgiCallsDay':_0x4b5e62['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x4b5e62[_0x0ce2('0x3b')],'outboundBlacklistCallsDay':_0x4b5e62[_0x0ce2('0x3c')],'outboundBusyCallsDay':_0x4b5e62['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x4b5e62[_0x0ce2('0x3d')],'outboundDropCallsDayACS':_0x4b5e62['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4b5e62[_0x0ce2('0x3e')],'outboundDropCallsDayTimeout':_0x4b5e62[_0x0ce2('0x3f')],'outboundNoAnswerCallsDay':_0x4b5e62[_0x0ce2('0x40')],'outboundNoSuchCallsDay':_0x4b5e62[_0x0ce2('0x41')],'outboundOriginateFailureCallsDay':_0x4b5e62['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4b5e62[_0x0ce2('0x42')],'outboundRejectCallsDay':_0x4b5e62['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4b5e62[_0x0ce2('0x43')],'predictiveIntervalAnsweredCalls':_0x4b5e62[_0x0ce2('0x44')],'predictiveIntervalAvgHoldtime':_0x4b5e62['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4b5e62[_0x0ce2('0x45')],'predictiveIntervalDroppedCallsCallersExit':_0x4b5e62['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4b5e62[_0x0ce2('0x46')],'predictiveIntervalErlangCalls':_0x4b5e62['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4b5e62['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x4b5e62[_0x0ce2('0x47')],'predictiveIntervalMultiplicativeFactor':_0x4b5e62[_0x0ce2('0x48')],'predictiveIntervalPauses':_0x4b5e62['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x4b5e62[_0x0ce2('0x49')],'predictiveIntervalTotalCalls':_0x4b5e62[_0x0ce2('0x4a')],'message':_0x4b5e62[_0x0ce2('0x4b')],'originated':_0x4b5e62['originated'],'erlangCalls':_0x4b5e62['erlangCalls'],'erlangCallToSecond':_0x4b5e62[_0x0ce2('0x4c')],'erlangAbandonmentRate':_0x4b5e62[_0x0ce2('0x4d')],'erlangBusyFactor':_0x4b5e62[_0x0ce2('0x4e')],'startPredictive':_0x4b5e62[_0x0ce2('0x4f')],'startProgressive':_0x4b5e62[_0x0ce2('0x50')]};if(_0x4b5e62[_0x0ce2('0x51')]){_0x4e9564[_0x0ce2('0x51')]={'id':_0x4b5e62[_0x0ce2('0x51')]['id'],'name':_0x4b5e62[_0x0ce2('0x51')]['name'],'active':_0x4b5e62[_0x0ce2('0x51')][_0x0ce2('0x52')],'callerid':_0x4b5e62[_0x0ce2('0x51')][_0x0ce2('0x53')]};}if(_0x4b5e62[_0x0ce2('0x54')]){_0x4e9564[_0x0ce2('0x54')]={'id':_0x4b5e62[_0x0ce2('0x54')]['id'],'name':_0x4b5e62[_0x0ce2('0x54')]['name']};}var _0x2fdba8=md5(JSON[_0x0ce2('0x55')](_0x4e9564));if(_0x4b5e62[_0x0ce2('0x4')]!==_0x2fdba8){_0x4b5e62[_0x0ce2('0x4')]=_0x2fdba8;emit(util[_0x0ce2('0x56')](_0x0ce2('0x57'),_0x4e9564[_0x0ce2('0x2a')]),_0x0ce2('0x58'),_0x4e9564);}}}function emitVoiceQueueChannelRemove(_0x4dfde6){logger['info'](_0x0ce2('0x59'),JSON['stringify'](_0x4dfde6));emit(util[_0x0ce2('0x56')](_0x0ce2('0x57'),_0x4dfde6[_0x0ce2('0x2a')]),_0x0ce2('0x5a'),_0x4dfde6);}function notSendMessagesQueue(_0x1c4278){if(_0x1c4278[_0x0ce2('0x5b')]){if(_0x1c4278[_0x0ce2('0x5c')]===0x0&&_0x1c4278[_0x0ce2('0x2e')]===0x0){_0x1c4278[_0x0ce2('0x5b')]=![];_0x1c4278[_0x0ce2('0x2d')]=0x0;_0x1c4278['paused']=0x0;_0x1c4278['message']=_0x0ce2('0x5d');ut[_0x0ce2('0x5e')](_0x0ce2('0x5f'),_0x1c4278[_0x0ce2('0x2a')]+_0x0ce2('0x60'));}else{_0x1c4278[_0x0ce2('0x4b')]='IS_DISACTIVED';ut[_0x0ce2('0x5e')](_0x0ce2('0x5f'),_0x1c4278[_0x0ce2('0x2a')]+_0x0ce2('0x61'));}emitCampaignPreview(_0x1c4278);}}Preview['prototype'][_0x0ce2('0x27')]=function(){var _0x56cb40=this;setInterval(function(){_0x56cb40['syncCampaigns']();},0x7cf);};Preview['prototype'][_0x0ce2('0x62')]=function(){var _0x57116b=this[_0x0ce2('0x13')];this[_0x0ce2('0x18')]+=0x1;for(var _0x42ece3 in _0x57116b){if(_0x57116b['hasOwnProperty'](_0x42ece3)&&(_0x57116b[_0x42ece3]['dialMethod']==='preview'||_0x57116b[_0x42ece3][_0x0ce2('0x36')]==='booked')&&_0x57116b[_0x42ece3]['type']===_0x0ce2('0x29')){if(this[_0x0ce2('0x18')]>0x7){this[_0x0ce2('0x18')]=0x0;this[_0x0ce2('0x63')]();}}if(_0x57116b[_0x0ce2('0x64')](_0x42ece3)&&_0x57116b[_0x42ece3][_0x0ce2('0x36')]===_0x0ce2('0x7')&&_0x57116b[_0x42ece3][_0x0ce2('0x28')]===_0x0ce2('0x29')){if(_0x57116b[_0x42ece3][_0x0ce2('0x35')]){this[_0x0ce2('0x65')](_0x57116b[_0x42ece3]);this['recallMe'](_0x57116b[_0x42ece3]);}else{notSendMessagesQueue(_0x57116b[_0x42ece3]);}}}};Preview[_0x0ce2('0x66')][_0x0ce2('0x67')]=function(_0x160223){var _0x469f02=this;this[_0x0ce2('0x12')][_0x0ce2('0xf')](function(){if(!_['isNil'](_0x469f02[_0x0ce2('0x16')][_0x160223])){loggerAction[_0x0ce2('0x68')](_0x0ce2('0x69'),_0x160223,_0x0ce2('0x6a'),_0x469f02[_0x0ce2('0x16')][_0x160223][_0x0ce2('0x6b')],'originated:\x20',JSON[_0x0ce2('0x55')](_0x469f02[_0x0ce2('0x13')][_0x469f02['actions'][_0x160223]['queue']]['originated']),_0x0ce2('0x6c'),JSON[_0x0ce2('0x55')](_0x469f02['campaignsPreview'][_0x469f02[_0x0ce2('0x16')][_0x160223][_0x0ce2('0x6b')]][_0x0ce2('0x2e')]),JSON['stringify'](_0x469f02['actions'][_0x160223][_0x0ce2('0x6d')]),JSON[_0x0ce2('0x55')](_['pick'](_0x469f02[_0x0ce2('0x16')][_0x160223],[_0x0ce2('0x6e'),_0x0ce2('0x6f'),_0x0ce2('0x70'),'ListId'])));return ami['Action']({'action':_0x0ce2('0x71'),'channel':_0x469f02['actions'][_0x160223][_0x0ce2('0x72')]})[_0x0ce2('0x73')](function(_0x2118a1){if(_0x2118a1[_0x0ce2('0x4b')]===_0x0ce2('0x74')){setTimeout(function(){if(_0x469f02[_0x0ce2('0x16')][_0x160223]){ut[_0x0ce2('0x75')](_0x469f02[_0x0ce2('0x13')][_0x469f02[_0x0ce2('0x16')][_0x160223][_0x0ce2('0x6b')]],_0x0ce2('0x76'));if(_0x469f02['actions'][_0x160223][_0x0ce2('0x6d')]===!![]){ut[_0x0ce2('0x77')](_0x469f02['campaignsPreview'][_0x469f02[_0x0ce2('0x16')][_0x160223][_0x0ce2('0x6b')]],_0x0ce2('0x76'));ut[_0x0ce2('0x78')](_0x0ce2('0x79')+_0x160223,_0x469f02[_0x0ce2('0x16')][_0x160223][_0x0ce2('0x6b')]);}ut[_0x0ce2('0x78')]('[Dialer][checkChannel][Preview]'+_0x160223,_0x469f02[_0x0ce2('0x16')][_0x160223]['queue']);delete _0x469f02[_0x0ce2('0x16')][_0x160223];}},0x2328);}});}});};Preview['prototype']['clearZombieChannels']=function(){var _0x402de7=this;loggerAction[_0x0ce2('0x68')](_0x0ce2('0x7a'),_[_0x0ce2('0x7b')](this[_0x0ce2('0x16')]));for(var _0x1ac967 in this['actions']){if(_0x402de7[_0x0ce2('0x16')][_0x0ce2('0x64')](_0x1ac967)){_0x402de7[_0x0ce2('0x67')](_0x1ac967);}}};Preview[_0x0ce2('0x66')]['recallMe']=function(_0x4bc08f){var _0x5cae6e=this;rpcDb[_0x0ce2('0x7c')](_0x4bc08f['id'],ut[_0x0ce2('0x7d')](this['agents']))[_0x0ce2('0x7e')](function(_0x10016e){if(!_[_0x0ce2('0x7f')](_0x10016e)){for(var _0x187cca=0x0;_0x187cca<_0x10016e['length'];_0x187cca+=0x1){if(ut[_0x0ce2('0x80')](_0x10016e[_0x187cca][_0x0ce2('0x81')])<_0x4bc08f[_0x0ce2('0x82')]*0x3c){_0x5cae6e[_0x0ce2('0x83')](_0x10016e[_0x187cca]['id'])[_0x0ce2('0x7e')](ut['logger2']('[RecallMe]'))[_0x0ce2('0x73')](ut[_0x0ce2('0x84')]('[RecallMe]'));}else{var _0x3076fc=new Action(_0x10016e[_0x187cca],_0x4bc08f);_0x3076fc[_0x0ce2('0x85')]=moment()['format'](_0x0ce2('0x86'));_0x4bc08f['outboundReCallsDay']+=0x1;ut[_0x0ce2('0x87')](_0x3076fc,0x17,'RecallInQueue');if(_0x4bc08f[_0x0ce2('0x88')]){rpcDb[_0x0ce2('0x89')](ut[_0x0ce2('0x8a')](_0x10016e[_0x187cca]));rpcDb[_0x0ce2('0x8b')](_0x3076fc,_0x0ce2('0x8c'));}else{ut[_0x0ce2('0x87')](_0x3076fc,0x16,_0x0ce2('0x8d'));rpcDb['createCustomerHistory'](_0x3076fc,_0x0ce2('0x8e'));rpcDb[_0x0ce2('0x8f')](_0x3076fc,_0x0ce2('0x8e'));}}}}})['catch'](ut['logger2'](_0x0ce2('0x90')));};Preview[_0x0ce2('0x66')][_0x0ce2('0x65')]=function(_0x5ce8dd){_0x5ce8dd['sendMessageOneNotActive']=!![];if(ut[_0x0ce2('0x91')](_0x5ce8dd[_0x0ce2('0x92')])){_0x5ce8dd['message']=_0x0ce2('0x93');}else if(!ut[_0x0ce2('0x94')](_0x5ce8dd[_0x0ce2('0x35')])){_0x5ce8dd[_0x0ce2('0x4b')]=_0x0ce2('0x5d');}else if(!this['isTrunkReachable'](_0x5ce8dd[_0x0ce2('0x51')])){if(!this['isTrunkReachable'](_0x5ce8dd['TrunkBackup'])){_0x5ce8dd[_0x0ce2('0x4b')]=_0x0ce2('0x95');}else{_0x5ce8dd['message']='ACTIVE';}}else{_0x5ce8dd['message']='ACTIVE';}emitCampaignPreview(_0x5ce8dd);};Preview[_0x0ce2('0x66')][_0x0ce2('0x96')]=function(_0x4481cf,_0x2a0b75,_0x1c4069){var _0x545453=this;var _0x4e918f=this['actions'][_0x2a0b75];var _0x4c5cd6=this[_0x0ce2('0x13')][_0x4e918f[_0x0ce2('0x6b')]];var _0x2a1770;if(_0x4c5cd6){switch(_0x1c4069){case'1':_0x4c5cd6[_0x0ce2('0x41')]+=0x1;_0x4e918f[_0x0ce2('0x97')]=ut[_0x0ce2('0x98')](_0x4e918f);ut[_0x0ce2('0x87')](_0x4e918f,0x0,_0x0ce2('0x99'));rpcDb[_0x0ce2('0x8b')](_0x4e918f,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x0ce2('0x98')](_0x4e918f)>=_0x4c5cd6[_0x0ce2('0x9a')]){_0x2a1770=ut[_0x0ce2('0x9b')](_0x4e918f,0xf,_0x0ce2('0x9c'));rpcDb[_0x0ce2('0x8f')](_0x2a1770,_0x0ce2('0x9d'));}else{rpcDb[_0x0ce2('0x8f')](_0x4e918f,_0x0ce2('0x9d'));}delete this[_0x0ce2('0x16')][_0x4481cf[_0x0ce2('0x9e')]];break;case _0x0ce2('0x9f'):var _0x1b7eaa=moment()[_0x0ce2('0x56')](_0x0ce2('0x86'));_0x4e918f['responsetime']=_0x1b7eaa;_0x4e918f[_0x0ce2('0xa0')]=_0x1b7eaa;_0x4e918f[_0x0ce2('0x6d')]=!![];_0x4c5cd6[_0x0ce2('0x2e')]+=0x1;logger[_0x0ce2('0x68')](_0x0ce2('0xa1'),_0x4e918f[_0x0ce2('0xa2')],_0x0ce2('0xa3'),_0x4c5cd6['name'],_0x0ce2('0x6c'),_0x4c5cd6[_0x0ce2('0x2e')]);ami[_0x0ce2('0xa4')]('custom:agentconnect',ut[_0x0ce2('0xa5')](_0x4e918f,'connect'));if(_0x4c5cd6[_0x0ce2('0xa6')]){ami[_0x0ce2('0xa4')]('custom:agentConnectPreview',ut['buildAcw'](_0x4e918f));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x0ce2('0xa5')](_0x4e918f,_0x0ce2('0xa7')));emitVoiceQueueChannelRemove(ut['buildObj'](_0x4e918f,'complete'));_0x4c5cd6['outboundAnswerCallsDay']+=0x1;_0x4c5cd6[_0x0ce2('0x31')]+=0x1;_0x4c5cd6[_0x0ce2('0x2c')]+=0x1;ut[_0x0ce2('0x77')](_0x4c5cd6,_0x0ce2('0xa8'));_0x4e918f[_0x0ce2('0x97')]=ut[_0x0ce2('0x98')](_0x4e918f);ut[_0x0ce2('0x87')](_0x4e918f,0x4,_0x0ce2('0xa9'));rpcDb['createCustomerHistory'](_0x4e918f,'[callProgressDetectingCustomer][logAnswer]');rpcDb['createCustomerFinal'](_0x4e918f,_0x0ce2('0xaa'));rpcDb[_0x0ce2('0xab')](_0x4e918f);_0x4c5cd6[_0x0ce2('0x2f')]+=_0x4e918f[_0x0ce2('0xac')];_0x4c5cd6[_0x0ce2('0xad')]+=_0x4e918f[_0x0ce2('0xac')];logger['info']('[syncHangup][talking][decrement]',_0x4e918f[_0x0ce2('0xa2')],'\x20Queue',_0x4c5cd6[_0x0ce2('0x2a')],'pTalking:\x20',_0x4c5cd6[_0x0ce2('0x2e')]);delete this[_0x0ce2('0x16')][_0x4481cf['linkedid']];break;case _0x0ce2('0xae'):_0x4c5cd6[_0x0ce2('0xaf')]+=0x1;_0x4e918f[_0x0ce2('0xb0')]+=0x1;_0x4e918f[_0x0ce2('0x97')]=ut['totalGlobal'](_0x4e918f);ut[_0x0ce2('0x87')](_0x4e918f,0x5,_0x0ce2('0xb1'));rpcDb[_0x0ce2('0x8b')](_0x4e918f,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x4e918f)>=_0x4c5cd6[_0x0ce2('0x9a')]){_0x2a1770=ut[_0x0ce2('0x9b')](_0x4e918f,0xf,'Global');rpcDb['createCustomerFinal'](_0x2a1770,_0x0ce2('0xb2'));}else{if(_0x4e918f['countbusyretry']>=_0x4c5cd6[_0x0ce2('0xb3')]){rpcDb[_0x0ce2('0x8f')](_0x4e918f,_0x0ce2('0xb4'));}else{rpcDb[_0x0ce2('0xb5')](ut[_0x0ce2('0xb6')](_0x4e918f,_0x0ce2('0xb0'),_0x4c5cd6['dialBusyRetryFrequency']),_0x4e918f[_0x0ce2('0xb7')],_0x4e918f[_0x0ce2('0xb8')]);}}break;case _0x0ce2('0xb9'):_0x4c5cd6['outboundNoAnswerCallsDay']+=0x1;_0x4e918f[_0x0ce2('0xba')]+=0x1;_0x4e918f[_0x0ce2('0x97')]=ut['totalGlobal'](_0x4e918f);ut['logCustomer'](_0x4e918f,0x3,_0x0ce2('0xbb'));rpcDb[_0x0ce2('0x8b')](_0x4e918f,_0x0ce2('0xbc'));if(ut[_0x0ce2('0x98')](_0x4e918f)>=_0x4c5cd6[_0x0ce2('0x9a')]){_0x2a1770=ut[_0x0ce2('0x9b')](_0x4e918f,0xf,_0x0ce2('0x9c'));rpcDb[_0x0ce2('0x8f')](_0x2a1770,_0x0ce2('0xbd'));}else{if(_0x4e918f[_0x0ce2('0xba')]>=_0x4c5cd6[_0x0ce2('0xbe')]){rpcDb[_0x0ce2('0x8f')](_0x4e918f,_0x0ce2('0xbc'));}else{rpcDb[_0x0ce2('0xb5')](ut['scheduledAt'](_0x4e918f,'countnoanswerretry',_0x4c5cd6[_0x0ce2('0xbf')]),_0x4e918f['unlockAgent'],_0x4e918f[_0x0ce2('0xb8')]);}}break;case _0x0ce2('0xc0'):_0x4c5cd6[_0x0ce2('0x3d')]+=0x1;_0x4e918f[_0x0ce2('0xc1')]+=0x1;_0x4e918f['countglobal']=ut[_0x0ce2('0x98')](_0x4e918f);ut[_0x0ce2('0x87')](_0x4e918f,0x8,_0x0ce2('0xc2'));rpcDb[_0x0ce2('0x8b')](_0x4e918f,_0x0ce2('0xc3'));if(ut[_0x0ce2('0x98')](_0x4e918f)>=_0x4c5cd6[_0x0ce2('0x9a')]){_0x2a1770=ut['cloneAction'](_0x4e918f,0xf,_0x0ce2('0x9c'));rpcDb['createCustomerFinal'](_0x2a1770,_0x0ce2('0xc4'));}else{if(_0x4e918f[_0x0ce2('0xc1')]>=_0x4c5cd6['dialCongestionMaxRetry']){rpcDb[_0x0ce2('0x8f')](_0x4e918f,_0x0ce2('0xc3'));}else{rpcDb[_0x0ce2('0xb5')](ut['scheduledAt'](_0x4e918f,_0x0ce2('0xc1'),_0x4c5cd6[_0x0ce2('0xc5')]),_0x4e918f[_0x0ce2('0xb7')],_0x4e918f[_0x0ce2('0xb8')]);}}break;case _0x0ce2('0xc6'):_0x4c5cd6[_0x0ce2('0xc7')]+=0x1;_0x4e918f[_0x0ce2('0x97')]=ut[_0x0ce2('0x98')](_0x4e918f);ut['logCustomer'](_0x4e918f,0x14,'AgentReject');rpcDb[_0x0ce2('0x8b')](_0x4e918f,_0x0ce2('0xc8'));if(_0x4e918f[_0x0ce2('0xb7')]){rpcDb['unlockContact'](_0x4e918f[_0x0ce2('0xc9')]);}if(_0x4e918f[_0x0ce2('0xb8')]){rpcDb[_0x0ce2('0xca')](_0x4e918f[_0x0ce2('0xc9')]);}break;default:if(_0x4e918f[_0x0ce2('0x6d')]){ut[_0x0ce2('0x77')](_0x4c5cd6,'[default]');ut['loggerError'](_0x0ce2('0xcb')+_0x4c5cd6[_0x0ce2('0x2a')],_0x4481cf);}_0x4c5cd6[_0x0ce2('0x43')]+=0x1;_0x4e918f[_0x0ce2('0x97')]=ut['totalGlobal'](_0x4e918f);ut[_0x0ce2('0x87')](_0x4e918f,0xc,_0x4481cf[_0x0ce2('0xcc')]||_0x4481cf[_0x0ce2('0xcd')]);rpcDb['createCustomerHistory'](_0x4e918f,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x0ce2('0x98')](_0x4e918f)>=_0x4c5cd6[_0x0ce2('0x9a')]){_0x2a1770=ut[_0x0ce2('0x9b')](_0x4e918f,0xf,_0x0ce2('0x9c'));rpcDb['createCustomerFinal'](_0x2a1770,_0x0ce2('0xce'));}else{rpcDb[_0x0ce2('0x8f')](_0x4e918f,_0x0ce2('0xce'));}delete this[_0x0ce2('0x16')][_0x4481cf['linkedid']];}if(!(_0x4e918f[_0x0ce2('0x6d')]&&_0x1c4069==='16')){ut[_0x0ce2('0x75')](_0x4c5cd6,_0x0ce2('0xcf'));logger[_0x0ce2('0x68')](_0x0ce2('0xd0'),_0x4e918f[_0x0ce2('0xa2')],_0x0ce2('0xa3'),_0x4c5cd6[_0x0ce2('0x2a')],'originated:\x20',_0x4c5cd6[_0x0ce2('0x5c')]);}if(_0x1c4069!==_0x0ce2('0x9f')){delete this[_0x0ce2('0x16')][_0x4481cf[_0x0ce2('0x9e')]];delete this[_0x0ce2('0x16')][_0x4481cf[_0x0ce2('0xd1')]];}}};Preview[_0x0ce2('0x66')][_0x0ce2('0xd2')]=function(_0x25b2b9,_0x12073c,_0x51292e){if(_[_0x0ce2('0xd3')](_0x12073c)&&'object'!==typeof _0x12073c){return;}if(_[_0x0ce2('0xd3')](_0x51292e)&&_0x0ce2('0xd4')!==typeof _0x51292e){return;}switch(_0x51292e[_0x0ce2('0xd5')]){case'0':ut['logAgent'](_0x25b2b9,0x0,_0x0ce2('0x99'));rpcDb[_0x0ce2('0xd6')](_0x25b2b9,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut['logAgent'](_0x25b2b9,0x3,_0x0ce2('0xbb'));rpcDb['createAgentHistory'](_0x25b2b9,_0x0ce2('0xd7'));break;case'5':ut[_0x0ce2('0xd8')](_0x25b2b9,0x5,_0x0ce2('0xb1'));rpcDb[_0x0ce2('0xd6')](_0x25b2b9,_0x0ce2('0xd9'));break;case'8':ut['logAgent'](_0x25b2b9,0x8,_0x0ce2('0xc2'));rpcDb['createAgentHistory'](_0x25b2b9,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x0ce2('0xd8')](_0x25b2b9,0x16,_0x0ce2('0xda'));rpcDb['createAgentHistory'](_0x25b2b9,_0x0ce2('0xdb'));break;default:ut[_0x0ce2('0xd8')](_0x25b2b9,0xc,_0x51292e[_0x0ce2('0xd5')]);rpcDb[_0x0ce2('0xd6')](_0x25b2b9,_0x0ce2('0xdc'));}ut[_0x0ce2('0x75')](_0x12073c,_0x0ce2('0xdd'));logger[_0x0ce2('0x68')]('[originated][decrement][callProgressDetectingAgent]',_0x25b2b9['uniqueid'],_0x0ce2('0xa3'),_0x12073c[_0x0ce2('0x2a')],_0x0ce2('0xde'),_0x12073c[_0x0ce2('0x5c')]);delete this['actions'][_0x25b2b9['uniqueid']];};Preview[_0x0ce2('0x66')]['checkInBlack']=function(_0x5a25ac,_0x182483,_0x123fa3,_0x321132,_0x1b249a){var _0x55db9d=this;return new BPromise(function(_0x31d3af,_0x3c6151){if(_['isNil'](_0x182483)||_[_0x0ce2('0x7f')](_0x182483[_0x0ce2('0xdf')])||_[_0x0ce2('0x7f')](_0x182483['Contact']['phone'])||_[_0x0ce2('0x7f')](_0x182483[_0x0ce2('0x70')])){_0x3c6151(ut[_0x0ce2('0x4b')]('Contact\x20is\x20undefined',_0x321132,_0x1b249a));return;}var _0x548232=uuid['v4']();var _0x561d58=_0x55db9d[_0x0ce2('0x13')][_0x182483[_0x0ce2('0x6a')]['name']];var _0x38ece8=_0x123fa3?_0x55db9d[_0x0ce2('0x17')][_0x123fa3]['id']:undefined;_0x55db9d['actions'][_0x548232]=new Action(_0x182483,_0x561d58,_0x548232,_0x123fa3,_0x38ece8);var _0x309f6b=_0x55db9d[_0x0ce2('0x16')][_0x548232];_0x309f6b[_0x0ce2('0xb7')]=_0x321132;_0x309f6b[_0x0ce2('0xb8')]=_0x1b249a;_0x309f6b[_0x0ce2('0xe0')]=_0x123fa3;if(_[_0x0ce2('0xe1')](_0x5a25ac)){_0x55db9d[_0x0ce2('0xe2')](_0x309f6b,_0x561d58,_0x182483,_0x123fa3)[_0x0ce2('0x7e')](function(_0x583818){logger['info'](_0x0ce2('0xe3'),_0x0ce2('0xe4')+_0x309f6b[_0x0ce2('0x6b')]+_0x0ce2('0xe5')+_0x309f6b[_0x0ce2('0xc9')],JSON[_0x0ce2('0x55')](_0x583818));ami[_0x0ce2('0xa4')](_0x0ce2('0xe6'),ut[_0x0ce2('0xa5')](_0x309f6b,_0x0ce2('0xe7')));_0x31d3af(ut[_0x0ce2('0x4b')](_0x0ce2('0xe8')));})[_0x0ce2('0x73')](function(_0x384428){ut['logger']('[Preview][execCall][failure]',_0x384428);_0x3c6151(ut['message']('Call\x20failed',_0x321132,_0x1b249a));});}else{_0x561d58['outboundBlacklistCallsDay']+=0x1;ut[_0x0ce2('0xe9')](_0x309f6b);rpcDb[_0x0ce2('0xea')](_0x309f6b,_0x0ce2('0xeb'));delete _0x55db9d[_0x0ce2('0x16')][_0x548232];_0x3c6151(ut['message'](_0x0ce2('0xec'),_0x321132,_0x1b249a));}});};Preview[_0x0ce2('0x66')][_0x0ce2('0xed')]=function(_0x3758b8){return!_[_0x0ce2('0x7f')](_0x3758b8)&&!_[_0x0ce2('0x7f')](_0x3758b8['name'])&&!_[_0x0ce2('0x7f')](_0x3758b8[_0x0ce2('0x52')])&&_0x3758b8['active']&&!_[_0x0ce2('0x7f')](this['trunks'][util['format']('SIP/%s',_0x3758b8[_0x0ce2('0x2a')])])&&!_[_0x0ce2('0x7f')](this[_0x0ce2('0x15')][util[_0x0ce2('0x56')]('SIP/%s',_0x3758b8[_0x0ce2('0x2a')])][_0x0ce2('0x71')])&&(this[_0x0ce2('0x15')][util['format'](_0x0ce2('0xee'),_0x3758b8[_0x0ce2('0x2a')])][_0x0ce2('0x71')]===_0x0ce2('0xef')||this['trunks'][util[_0x0ce2('0x56')]('SIP/%s',_0x3758b8[_0x0ce2('0x2a')])][_0x0ce2('0x71')]===_0x0ce2('0xf0'));};Preview[_0x0ce2('0x66')][_0x0ce2('0x83')]=function(_0x3c195e,_0x291e71){var _0x2367aa=this;return new BPromise(function(_0xe91bb7,_0x3e32d8){_0x2367aa[_0x0ce2('0xf1')](_0x3c195e,_0x291e71)['then'](function(_0x3f4251){_0xe91bb7(_[_0x0ce2('0xf2')](_0x3f4251,[_0x0ce2('0x4b')]));})[_0x0ce2('0x73')](function(_0x1736f3){if(_0x1736f3['unlock']){rpcDb[_0x0ce2('0xf3')](_0x3c195e);}if(_0x1736f3[_0x0ce2('0x52')]){rpcDb[_0x0ce2('0xca')](_0x3c195e);}_0x3e32d8(_['pick'](_0x1736f3,['message']));});});};Preview[_0x0ce2('0x66')]['execRun']=function(_0x523d85,_0x1bd018){var _0x4993e2=this;return new BPromise(function(_0x443698,_0x315d6e){var _0x33609a,_0x56a5a7;rpcDb[_0x0ce2('0xf4')](_0x523d85)[_0x0ce2('0x7e')](function(_0x34f6bd){if(!_[_0x0ce2('0x7f')](_0x34f6bd[0x0])){_0x56a5a7=_0x34f6bd[0x0][_0x0ce2('0xf5')]?![]:!![];_0x33609a=_0x34f6bd[0x0][_0x0ce2('0xf5')]?!![]:![];_0x33609a=_0x1bd018?!![]:_0x33609a;}var _0x19677c=_0x4993e2[_0x0ce2('0xf6')](_0x34f6bd);if(_0x19677c[_0x0ce2('0xf7')]){rpcDb[_0x0ce2('0xf8')](_[_0x0ce2('0xf2')](_0x34f6bd[0x0],['VoiceQueueId',_0x0ce2('0xf9')]))[_0x0ce2('0x7e')](function(_0x5de112){_0x4993e2[_0x0ce2('0xfa')](_0x5de112,_0x34f6bd[0x0],_0x1bd018,_0x56a5a7,_0x33609a)[_0x0ce2('0x7e')](function(_0xb4480){_0x443698(_0xb4480);})['catch'](function(_0x408577){_0x315d6e(_0x408577);});})[_0x0ce2('0x73')](function(_0x531b0d){ut[_0x0ce2('0x5e')]('[Preview][checkIsBlackList]',_0x531b0d);_0x315d6e(ut[_0x0ce2('0x4b')](_0x0ce2('0xfb'),_0x56a5a7,_0x33609a));});}else{_0x315d6e(ut[_0x0ce2('0x4b')](_0x19677c[_0x0ce2('0x4b')],_0x56a5a7,_0x33609a));}})[_0x0ce2('0x73')](function(_0x20529c){ut[_0x0ce2('0x5e')](_0x0ce2('0xfc'),_0x20529c);_0x315d6e(ut[_0x0ce2('0x4b')](_0x0ce2('0xfb'),![],!![]));});});};Preview[_0x0ce2('0x66')][_0x0ce2('0xf6')]=function(_0x455770){if(_[_0x0ce2('0x7f')](_0x455770)||_['isEmpty'](_0x455770)||!_[_0x0ce2('0x7f')](_0x455770[0x0][_0x0ce2('0xfd')])&&_['isNil'](_0x455770[0x0][_0x0ce2('0xfd')][_0x0ce2('0x2a')])){ut[_0x0ce2('0x5e')]('[Preview][validateContact][Empty\x20Contact]',_0x455770);return{'isValid':![],'message':_0x0ce2('0xfe')};}var _0x59d1ba=this[_0x0ce2('0x13')][_0x455770[0x0][_0x0ce2('0x6a')][_0x0ce2('0x2a')]];_0x59d1ba[_0x0ce2('0x4b')]=_0x0ce2('0xff');if(_['isNil'](_0x59d1ba)){ut['logger'](_0x0ce2('0x100'),_0x59d1ba);return{'isValid':![],'message':_0x0ce2('0x101')};}if(!this['isTrunkReachable'](_0x59d1ba['Trunk'])){ut[_0x0ce2('0x5e')](_0x0ce2('0x102'),_0x0ce2('0x103')+_0x59d1ba[_0x0ce2('0x2a')]+_0x0ce2('0x104'));if(!this[_0x0ce2('0xed')](_0x59d1ba[_0x0ce2('0x105')])){ut[_0x0ce2('0x5e')](_0x0ce2('0x102'),_0x59d1ba['name']+_0x0ce2('0x106'));return{'isValid':![],'message':_0x0ce2('0x107')};}}if(!ut[_0x0ce2('0x94')](_0x59d1ba[_0x0ce2('0x35')])){ut[_0x0ce2('0x5e')](_0x0ce2('0x108'),_0x59d1ba[_0x0ce2('0x2a')]+_0x0ce2('0x109'));return{'isValid':![],'message':_0x0ce2('0x103')+_0x59d1ba['name']+_0x0ce2('0x109')};}return{'isValid':!![],'message':_0x0ce2('0x10a')};};Preview[_0x0ce2('0x66')]['execCall']=function(_0x46f805,_0xaa1622,_0x148004,_0x3c921c){var _0x572deb=this;return new BPromise(function(_0x293db3,_0x4a796c){var _0x35b446=_0x46f805[_0x0ce2('0xa2')];var _0x21995d=_0x572deb[_0x0ce2('0xed')](_0xaa1622[_0x0ce2('0x51')])?util[_0x0ce2('0x56')](_0x0ce2('0x10b'),_0xaa1622['Trunk'][_0x0ce2('0x2a')],_[_0x0ce2('0x7f')](_0xaa1622[_0x0ce2('0x3a')])?'':_0xaa1622['dialPrefix'][_0x0ce2('0x10c')]()||'',_0xaa1622[_0x0ce2('0x10d')]>0x0?_0x148004['Contact'][_0x0ce2('0x10e')][_0x0ce2('0x10f')](_0xaa1622[_0x0ce2('0x10d')]):_0x148004[_0x0ce2('0xdf')][_0x0ce2('0x10e')]):util[_0x0ce2('0x56')](_0x0ce2('0x10b'),_[_0x0ce2('0x7f')](_0xaa1622[_0x0ce2('0x105')])?_0xaa1622[_0x0ce2('0x51')][_0x0ce2('0x2a')]:_0xaa1622['TrunkBackup'][_0x0ce2('0x2a')],_['isNil'](_0xaa1622[_0x0ce2('0x3a')])?'':_0xaa1622[_0x0ce2('0x3a')]['trim']()||'',_0xaa1622[_0x0ce2('0x10d')]>0x0?_0x148004[_0x0ce2('0xdf')][_0x0ce2('0x10e')][_0x0ce2('0x10f')](_0xaa1622[_0x0ce2('0x10d')]):_0x148004[_0x0ce2('0xdf')]['phone']);var _0x41be3c=_0x572deb[_0x0ce2('0xed')](_0xaa1622['Trunk'])?ut[_0x0ce2('0x110')](_0xaa1622['Trunk'][_0x0ce2('0x53')],_0xaa1622['dialOriginateCallerIdName'],_0xaa1622['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0xaa1622[_0x0ce2('0x38')],_0xaa1622[_0x0ce2('0x111')]):_0xaa1622[_0x0ce2('0x38')]):ut[_0x0ce2('0x110')](_['isNil'](_0xaa1622[_0x0ce2('0x105')])?_0xaa1622['Trunk'][_0x0ce2('0x53')]:_0xaa1622[_0x0ce2('0x105')][_0x0ce2('0x53')],_0xaa1622[_0x0ce2('0x37')],_0xaa1622['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x0ce2('0x112')](_0xaa1622[_0x0ce2('0x38')],_0xaa1622[_0x0ce2('0x111')]):_0xaa1622['dialOriginateCallerIdNumber']);if(_0x41be3c){_0x46f805[_0x0ce2('0x113')]=ut['extractCalleridName'](_0x41be3c);_0x46f805['originatecalleridnum']=ut[_0x0ce2('0x114')](_0x41be3c);}var _0x4b14c4=ut[_0x0ce2('0x115')](_0xaa1622,_0x148004,_0x21995d,_0x41be3c,_0x35b446,_0x46f805);_['merge'](_0x46f805,ut[_0x0ce2('0x116')](_0x4b14c4));_0x46f805[_0x0ce2('0x85')]=moment()[_0x0ce2('0x56')](_0x0ce2('0x86'));ami[_0x0ce2('0x117')](ut[_0x0ce2('0x118')](_0x46f805,_0xaa1622,_0x4b14c4,_0x46f805['activeContact'],_0x3c921c))[_0x0ce2('0x7e')](function(_0x46e786){_0xaa1622['originated']+=0x1;logger['info'](_0x0ce2('0x119'),_0x35b446,'\x20Queue',_0xaa1622[_0x0ce2('0x2a')],_0x0ce2('0xde'),_0xaa1622['originated']);_0x293db3(_0x46e786);})[_0x0ce2('0x73')](function(_0x2ab050){ut[_0x0ce2('0xd8')](_0x46f805,0xe,_0x0ce2('0x11a'));rpcDb[_0x0ce2('0xd6')](_0x46f805,_0x0ce2('0x11b'));_0x4a796c(_0x2ab050);});});};Preview[_0x0ce2('0x66')]['syncNewExten']=function(_0x4f99a0){if(this[_0x0ce2('0x16')][_0x4f99a0['linkedid']]){this[_0x0ce2('0x16')][_0x4f99a0[_0x0ce2('0x9e')]][_0x0ce2('0x72')]=_0x4f99a0['channel'];}};Preview[_0x0ce2('0x66')]['syncOriginateResponse']=function(_0x1ade84){var _0x4ecac5=this;var _0x4161a3=this[_0x0ce2('0x16')][_0x1ade84[_0x0ce2('0x11c')]];if(_0x4161a3){if(_0x4161a3[_0x0ce2('0xe0')]&&this[_0x0ce2('0x17')][_0x4161a3['lookAgent']]){ut[_0x0ce2('0x11d')](_0x4161a3,this[_0x0ce2('0x17')][_0x4161a3[_0x0ce2('0xe0')]][_0x0ce2('0x2a')],this[_0x0ce2('0x17')][_0x4161a3[_0x0ce2('0xe0')]]['id']);}var _0x655600=_[_0x0ce2('0x11e')](_0x4161a3);_0x655600['responsetime']=moment()[_0x0ce2('0x56')](_0x0ce2('0x86'));var _0x58dcfb=_0x4ecac5[_0x0ce2('0x13')][_0x4161a3[_0x0ce2('0x6b')]];if(ut[_0x0ce2('0x11f')](_0x1ade84[_0x0ce2('0x120')])){if(_0x4161a3[_0x0ce2('0xb7')]){rpcDb['unlockContact'](_0x4161a3[_0x0ce2('0xc9')]);}if(_0x4161a3[_0x0ce2('0xb8')]){rpcDb['disableContact'](_0x4161a3[_0x0ce2('0xc9')]);}ami[_0x0ce2('0xa4')](_0x0ce2('0x121'),ut[_0x0ce2('0xa5')](_0x4161a3,_0x0ce2('0x122')));this[_0x0ce2('0xd2')](_0x655600,_0x58dcfb,_0x1ade84);}else{_0x4161a3[_0x0ce2('0x85')]=moment()[_0x0ce2('0x56')](_0x0ce2('0x86'));ut['logAgent'](_0x655600,0x4,'Answer');rpcDb['createAgentHistory'](_0x655600,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x0ce2('0x66')][_0x0ce2('0x1c')]=function(_0x42b567){var _0x3c8e4d=this;var _0x466452=this[_0x0ce2('0x16')][_0x42b567[_0x0ce2('0x9e')]];var _0x3b5167;if(_0x466452){_0x3b5167=this['campaignsPreview'][_0x466452[_0x0ce2('0x6b')]];logger[_0x0ce2('0x68')](_0x0ce2('0x123'),_0x42b567[_0x0ce2('0x9e')],_0x0ce2('0xa3'),_0x3b5167[_0x0ce2('0x2a')],'pTalking:\x20',_0x3b5167[_0x0ce2('0x2e')]);}if(this['actions'][_0x42b567[_0x0ce2('0x9e')]]&&_0x42b567[_0x0ce2('0x9e')]!==_0x42b567[_0x0ce2('0xa2')]){if(_0x42b567['cause']==='16'&&this[_0x0ce2('0x16')][_0x42b567[_0x0ce2('0x9e')]]['dialAnswer']){this[_0x0ce2('0x96')](_0x42b567,_0x42b567[_0x0ce2('0x9e')],_0x42b567[_0x0ce2('0x124')]);}else if(this['actions'][_0x42b567[_0x0ce2('0x9e')]][_0x0ce2('0x6d')]){logger[_0x0ce2('0x68')](_0x0ce2('0x125'),_0x42b567['linkedid'],_0x42b567[_0x0ce2('0x124')],_0x0ce2('0xa3'),_0x3b5167['name'],_0x0ce2('0x6c'),_0x3b5167[_0x0ce2('0x2e')]);this['callProgressDetectingCustomer'](_0x42b567,_0x42b567['linkedid'],_0x42b567[_0x0ce2('0x124')]);}}else if(_0x466452&&_['isNil'](_0x466452[_0x0ce2('0x126')])&&_0x3b5167[_0x0ce2('0x127')]&&_0x42b567[_0x0ce2('0x9e')]===_0x42b567['uniqueid']&&_[_0x0ce2('0x7f')](_0x42b567[_0x0ce2('0xd5')])&&_0x42b567['cause']==='16'&&_0x42b567['channelstate']==='6'&&_['isUndefined'](_0x466452[_0x0ce2('0x128')])){if(_0x466452['unlockAgent']){rpcDb[_0x0ce2('0xf3')](_0x466452[_0x0ce2('0xc9')]);}if(_0x466452['activeContact']){rpcDb[_0x0ce2('0xca')](_0x466452[_0x0ce2('0xc9')]);}_0x42b567[_0x0ce2('0xd5')]='22';this[_0x0ce2('0xd2')](_0x466452,_0x3b5167,_0x42b567);}else if(_0x466452&&_0x466452['transfer']){if(_0x42b567[_0x0ce2('0x124')]==='16'&&this['actions'][_0x42b567['linkedid']][_0x0ce2('0x6d')]){logger[_0x0ce2('0x68')](_0x0ce2('0x129'),_0x42b567[_0x0ce2('0x9e')],_0x42b567[_0x0ce2('0x124')],'\x20Queue',_0x3b5167['name'],_0x0ce2('0x6c'),_0x3b5167['pTalking']);this['callProgressDetectingCustomer'](_0x42b567,_0x42b567[_0x0ce2('0x9e')],_0x42b567[_0x0ce2('0x124')]);}else if(this[_0x0ce2('0x16')][_0x42b567[_0x0ce2('0x9e')]][_0x0ce2('0x6d')]){logger[_0x0ce2('0x68')](_0x0ce2('0x125'),_0x42b567[_0x0ce2('0x9e')],_0x42b567[_0x0ce2('0x124')],_0x0ce2('0xa3'),_0x3b5167[_0x0ce2('0x2a')],'pTalking:\x20',_0x3b5167[_0x0ce2('0x2e')]);this[_0x0ce2('0x96')](_0x42b567,_0x42b567['linkedid'],_0x42b567[_0x0ce2('0x124')]);}}};Preview[_0x0ce2('0x66')][_0x0ce2('0x12a')]=function(_0x42dd51){if(this[_0x0ce2('0x16')][_0x42dd51[_0x0ce2('0xd1')]]&&_0x42dd51[_0x0ce2('0xd1')]!==_0x42dd51[_0x0ce2('0x12b')]){this['callProgressDetectingCustomer'](_0x42dd51,_0x42dd51[_0x0ce2('0xd1')],_0x42dd51[_0x0ce2('0xcd')]);}};Preview[_0x0ce2('0x66')][_0x0ce2('0x12c')]=function(_0x745e29){if(this[_0x0ce2('0x16')][_0x745e29['linkedid']]&&_0x745e29[_0x0ce2('0x9e')]!==_0x745e29[_0x0ce2('0xa2')]&&!this['actions'][_0x745e29[_0x0ce2('0x9e')]][_0x0ce2('0x6d')]){if(_0x745e29[_0x0ce2('0x124')]==='1'){this[_0x0ce2('0x96')](_0x745e29,_0x745e29[_0x0ce2('0x9e')],_0x745e29['cause']);}}};Preview[_0x0ce2('0x66')][_0x0ce2('0x12d')]=function(_0x28b741,_0x299480,_0x2dfe6f){if(this['actions'][_0x28b741]){if(_[_0x0ce2('0x7f')](this['actions'][_0x28b741]['variables'])){this[_0x0ce2('0x16')][_0x28b741][_0x0ce2('0x12e')]={};}this[_0x0ce2('0x16')][_0x28b741]['variables'][_0x299480]=_0x2dfe6f;}};Preview[_0x0ce2('0x66')][_0x0ce2('0x22')]=function(_0x3b8683){try{if(!_[_0x0ce2('0x7f')](_0x3b8683)){if(ut['filterKey'](_[_0x0ce2('0x12f')](_0x3b8683[_0x0ce2('0x130')])[0x0])){this[_0x0ce2('0x12d')](_0x3b8683[_0x0ce2('0xa2')],_[_0x0ce2('0x12f')](_0x3b8683[_0x0ce2('0x130')])[0x0],_0x3b8683['value']);}}}catch(_0x4223b1){logger[_0x0ce2('0x131')](_0x0ce2('0x132'),util[_0x0ce2('0x133')](_0x4223b1,{'showHidden':![],'depth':null}));}};Preview[_0x0ce2('0x66')]['syncAttendedTransfer']=function(_0x438ec3){if(_0x438ec3){if(this['actions'][_0x438ec3['transfertargetlinkedid']]){this[_0x0ce2('0x16')][_0x438ec3[_0x0ce2('0x134')]][_0x0ce2('0x128')]=!![];}}};Preview[_0x0ce2('0x66')][_0x0ce2('0x26')]=function(_0x4dfc14){if(_0x4dfc14){if(this[_0x0ce2('0x16')][_0x4dfc14[_0x0ce2('0x135')]]){this[_0x0ce2('0x16')][_0x4dfc14[_0x0ce2('0x135')]]['transfer']=!![];}}};module[_0x0ce2('0x136')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 2b23777..87f5521 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 _0x0e85=['countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','active'];(function(_0x3116d2,_0xcedb61){var _0x4721ef=function(_0xd73c59){while(--_0xd73c59){_0x3116d2['push'](_0x3116d2['shift']());}};_0x4721ef(++_0xcedb61);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0e85[_0x5f309e];return _0x487b5e;};'use strict';var util=require(_0x50e8('0x0'));var BPromise=require(_0x50e8('0x1'));var logger=require('../../../config/logger')(_0x50e8('0x2'));var _=require(_0x50e8('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x50e8('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x50e8('0x5'));var voiceQueueReport=require(_0x50e8('0x6'));function loggerCatch(_0xe3151e){return function(_0xfde42){logger['error'](_0xe3151e,util[_0x50e8('0x7')](_0xfde42,{'showHidden':![],'depth':null}));};}function create(_0x108edc){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopperHistory[_0x50e8('0xa')](_0x108edc))[_0x50e8('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x11717c){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](agentReportPreview[_0x50e8('0xa')](_0x11717c))[_0x50e8('0xb')](loggerCatch(_0x50e8('0xc')));}function moveContact(_0x45dc6f){return BPromise[_0x50e8('0x8')]()['then'](cmHopper['moveContactManagedDialer'](_0x45dc6f,!![]))[_0x50e8('0xb')](loggerCatch(_0x50e8('0xd')));}exports['checkIsBlackList']=function(_0x49e02f){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopperBlack[_0x50e8('0xe')](_0x49e02f))[_0x50e8('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x50e8('0xf')]=function(_0x3149d4){return BPromise[_0x50e8('0x8')]()['then'](cmHopper['getContactPreview'](_0x3149d4))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x10')));};exports[_0x50e8('0xa')]=function(_0x291fb7,_0x211731){create(_0x291fb7)[_0x50e8('0xb')](loggerCatch(_0x211731));moveContact(_0x291fb7)['catch'](loggerCatch(_0x211731));};exports['createAgentHistory']=function(_0x441f25,_0xc97063){createAgent(_0x441f25)[_0x50e8('0xb')](loggerCatch(_0xc97063));};exports[_0x50e8('0x11')]=function(_0x5dae4e,_0x90c54c){create(_0x5dae4e)[_0x50e8('0xb')](loggerCatch(_0x90c54c));};exports['createCustomerFinal']=function(_0x415596,_0x55997c){moveContact(_0x415596)[_0x50e8('0xb')](loggerCatch(_0x55997c));};exports[_0x50e8('0x12')]=function(_0xd263d,_0x20f835,_0x46af8e){if(_0x20f835){_0xd263d['UserId']=null;}if(_0x46af8e){_0xd263d[_0x50e8('0x13')]=![];}return BPromise[_0x50e8('0x8')]()['then'](cmHopper[_0x50e8('0x12')](_0xd263d))[_0x50e8('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x50e8('0x14')]=function(_0xe7e56c){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0xe7e56c))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x15')));};exports[_0x50e8('0x16')]=function(_0x371a1f){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopper['unlockContact']({'UserId':null},_0x371a1f,0x1))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x17')));};exports['disableContact']=function(_0x177201){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopper[_0x50e8('0x16')]({'active':![]},_0x177201,0x1))['catch'](loggerCatch(_0x50e8('0x18')));};exports['crateCustomerReportQueue']=function(_0x30fedf){var _0x39c0c6={};_0x39c0c6[_0x50e8('0x19')]=_0x30fedf['type'];_0x39c0c6[_0x50e8('0x1a')]=_0x30fedf[_0x50e8('0x1a')];_0x39c0c6[_0x50e8('0x1b')]=_0x30fedf[_0x50e8('0x1b')];_0x39c0c6[_0x50e8('0x1c')]=_0x30fedf[_0x50e8('0x1c')];_0x39c0c6[_0x50e8('0x1d')]=_0x30fedf['queue'];_0x39c0c6[_0x50e8('0x1e')]=_0x30fedf[_0x50e8('0x1f')];_0x39c0c6['queuecallerleaveAt']=_0x30fedf['answertime'];_0x39c0c6[_0x50e8('0x20')]=0x1;_0x39c0c6[_0x50e8('0x21')]=_0x30fedf[_0x50e8('0x22')];_0x39c0c6['connectedlinename']=_0x30fedf['membername'];_0x39c0c6[_0x50e8('0x23')]=_0x50e8('0x24');_0x39c0c6['exten']=_0x50e8('0x25');_0x39c0c6[_0x50e8('0x26')]=0x0;_0x39c0c6[_0x50e8('0x27')]=0x1;_0x39c0c6[_0x50e8('0x28')]=_0x30fedf['membername'];_0x39c0c6[_0x50e8('0x29')]='COMPLETED';return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](voiceQueueReport[_0x50e8('0x2a')](_0x39c0c6))['catch'](loggerCatch(_0x50e8('0x2b')));};exports[_0x50e8('0x2c')]=function(_0x548f3c,_0x245b45){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopper[_0x50e8('0x2c')](_0x548f3c,_0x245b45))['catch'](loggerCatch(_0x50e8('0x2d')));};exports[_0x50e8('0x2e')]=function(_0x24d3ea){return BPromise[_0x50e8('0x8')]()['then'](cmHopper[_0x50e8('0x12')](_0x24d3ea,!![],!![]))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x2f')));}; \ No newline at end of file +var _0xe5b3=['[moveContactManagedDialer]\x20','checkIsBlackList','createAgentHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','from-sip','exten','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','moveContactManagedDialer'];(function(_0xb1cfc4,_0x167e51){var _0x52194f=function(_0x239433){while(--_0x239433){_0xb1cfc4['push'](_0xb1cfc4['shift']());}};_0x52194f(++_0x167e51);}(_0xe5b3,0x133));var _0x3e5b=function(_0x20d54d,_0x1adc8e){_0x20d54d=_0x20d54d-0x0;var _0x516e8b=_0xe5b3[_0x20d54d];return _0x516e8b;};'use strict';var util=require('util');var BPromise=require(_0x3e5b('0x0'));var logger=require(_0x3e5b('0x1'))(_0x3e5b('0x2'));var _=require(_0x3e5b('0x3'));var cmHopper=require(_0x3e5b('0x4'));var cmHopperFinal=require(_0x3e5b('0x5'));var cmHopperHistory=require(_0x3e5b('0x6'));var cmHopperBlack=require(_0x3e5b('0x7'));var voiceQueueRt=require(_0x3e5b('0x8'));var agentReportPreview=require(_0x3e5b('0x9'));var voiceQueueReport=require(_0x3e5b('0xa'));function loggerCatch(_0x54e1fb){return function(_0x174923){logger[_0x3e5b('0xb')](_0x54e1fb,util['inspect'](_0x174923,{'showHidden':![],'depth':null}));};}function create(_0x41d46f){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopperHistory[_0x3e5b('0xe')](_0x41d46f))['catch'](loggerCatch('[createHistory]\x20'));}function createAgent(_0x1fef54){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](agentReportPreview[_0x3e5b('0xe')](_0x1fef54))[_0x3e5b('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x3be027){return BPromise['resolve']()[_0x3e5b('0xd')](cmHopper[_0x3e5b('0x10')](_0x3be027,!![]))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x11')));}exports[_0x3e5b('0x12')]=function(_0x3c4eb1){return BPromise[_0x3e5b('0xc')]()['then'](cmHopperBlack[_0x3e5b('0x12')](_0x3c4eb1))['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x3754e3){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper['getContactPreview'](_0x3754e3))[_0x3e5b('0xf')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x258d6a,_0x11b41b){create(_0x258d6a)['catch'](loggerCatch(_0x11b41b));moveContact(_0x258d6a)[_0x3e5b('0xf')](loggerCatch(_0x11b41b));};exports[_0x3e5b('0x13')]=function(_0x555002,_0xc56a2a){createAgent(_0x555002)[_0x3e5b('0xf')](loggerCatch(_0xc56a2a));};exports['createCustomerHistory']=function(_0x4b189d,_0x144fa7){create(_0x4b189d)[_0x3e5b('0xf')](loggerCatch(_0x144fa7));};exports[_0x3e5b('0x14')]=function(_0xff4aba,_0x24de5b){moveContact(_0xff4aba)[_0x3e5b('0xf')](loggerCatch(_0x24de5b));};exports[_0x3e5b('0x15')]=function(_0x21fc32,_0x36c988,_0x3d95f3){if(_0x36c988){_0x21fc32[_0x3e5b('0x16')]=null;}if(_0x3d95f3){_0x21fc32[_0x3e5b('0x17')]=![];}return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper['rescheduleContact'](_0x21fc32))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x18')));};exports[_0x3e5b('0x19')]=function(_0x150674){return BPromise['resolve']()[_0x3e5b('0xd')](cmHopper['countReScheduled'](_0x150674))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x1a')));};exports['unlockContact']=function(_0x41b684){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper[_0x3e5b('0x1b')]({'UserId':null},_0x41b684,0x1))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x1c')));};exports[_0x3e5b('0x1d')]=function(_0x2ddf57){return BPromise['resolve']()[_0x3e5b('0xd')](cmHopper['unlockContact']({'active':![]},_0x2ddf57,0x1))[_0x3e5b('0xf')](loggerCatch('[activeContact]\x20'));};exports[_0x3e5b('0x1e')]=function(_0x1f6473){var _0x1296ec={};_0x1296ec[_0x3e5b('0x1f')]=_0x1f6473[_0x3e5b('0x1f')];_0x1296ec[_0x3e5b('0x20')]=_0x1f6473[_0x3e5b('0x20')];_0x1296ec[_0x3e5b('0x21')]=_0x1f6473[_0x3e5b('0x21')];_0x1296ec[_0x3e5b('0x22')]=_0x1f6473[_0x3e5b('0x22')];_0x1296ec['queue']=_0x1f6473[_0x3e5b('0x23')];_0x1296ec[_0x3e5b('0x24')]=_0x1f6473[_0x3e5b('0x25')];_0x1296ec[_0x3e5b('0x26')]=_0x1f6473[_0x3e5b('0x25')];_0x1296ec[_0x3e5b('0x27')]=0x1;_0x1296ec[_0x3e5b('0x28')]=_0x1f6473['endtime'];_0x1296ec[_0x3e5b('0x29')]=_0x1f6473['membername'];_0x1296ec['context']=_0x3e5b('0x2a');_0x1296ec[_0x3e5b('0x2b')]='xcally-motion-preview';_0x1296ec[_0x3e5b('0x2c')]=0x0;_0x1296ec[_0x3e5b('0x2d')]=0x1;_0x1296ec[_0x3e5b('0x2e')]=_0x1f6473[_0x3e5b('0x2f')];_0x1296ec[_0x3e5b('0x30')]=_0x3e5b('0x31');return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](voiceQueueReport[_0x3e5b('0x32')](_0x1296ec))[_0x3e5b('0xf')](loggerCatch(_0x3e5b('0x33')));};exports[_0x3e5b('0x34')]=function(_0x5a75b9,_0x141b7e){return BPromise[_0x3e5b('0xc')]()['then'](cmHopper['getContactRecallMe'](_0x5a75b9,_0x141b7e))[_0x3e5b('0xf')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x3e5b('0x35')]=function(_0x3f68c6){return BPromise[_0x3e5b('0xc')]()[_0x3e5b('0xd')](cmHopper['rescheduleContact'](_0x3f68c6,!![],!![]))[_0x3e5b('0xf')](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 51c4a6e..dd39dff 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 _0xc5dd=['YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','responsetime','endtime','logAgent','starttime','logLookAgent','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','dialAnswer','membername','calleridname','countglobal','callbackuniqueid','callbackat','recallme','ListId','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','statedesc','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','format','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist'];(function(_0x2fab3b,_0x101edc){var _0x4a284c=function(_0x432aa3){while(--_0x432aa3){_0x2fab3b['push'](_0x2fab3b['shift']());}};_0x4a284c(++_0x101edc);}(_0xc5dd,0x170));var _0xdc5d=function(_0x1c9133,_0x35146f){_0x1c9133=_0x1c9133-0x0;var _0x5079fe=_0xc5dd[_0x1c9133];return _0x5079fe;};'use strict';var util=require(_0xdc5d('0x0'));var _=require(_0xdc5d('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xdc5d('0x2')][_0xdc5d('0x3')]||'127.0.0.1';function getSeconds(_0x5de522,_0x1b06d0){var _0x4ad23f=moment(_0x5de522)[_0xdc5d('0x4')](0x0);var _0xd0bcd1=moment(_0x1b06d0)[_0xdc5d('0x4')](0x0);return _0x4ad23f[_0xdc5d('0x5')](_0xd0bcd1,_0xdc5d('0x6'));}exports[_0xdc5d('0x7')]=function(_0x2e4776){return function(_0x17839a){logger[_0xdc5d('0x8')](_0x2e4776,util[_0xdc5d('0x9')](_0x17839a,{'showHidden':![],'depth':null}));};};exports[_0xdc5d('0xa')]=function(_0x31bac4,_0x28bfff){logger[_0xdc5d('0xb')](_0x31bac4,util[_0xdc5d('0x9')](_0x28bfff,{'showHidden':![],'depth':null}));};exports[_0xdc5d('0xc')]=function(_0x241c66,_0x47adb8){logger['error'](_0x241c66,util[_0xdc5d('0x9')](_0x47adb8,{'showHidden':![],'depth':null}));};exports[_0xdc5d('0xd')]=function(_0x4a836d){return function(_0x575963){logger[_0xdc5d('0xb')](_0x4a836d,util[_0xdc5d('0x9')](_0x575963,{'showHidden':![],'depth':null}));};};exports[_0xdc5d('0xe')]=function(_0x310345,_0x3e4b2d,_0x339d4f){return{'message':_0x310345,'unlock':_0x3e4b2d,'active':_0x339d4f};};exports[_0xdc5d('0xf')]=function(_0x349ae9,_0x571888,_0x466815){if(!_[_0xdc5d('0x10')](_0x466815)&&'string'===typeof _0x466815&&!_[_0xdc5d('0x11')](_0x466815)){if(!_[_0xdc5d('0x10')](_0x571888)&&_0xdc5d('0x12')===typeof _0x571888&&!_[_0xdc5d('0x11')](_0x571888)){return util['format'](_0xdc5d('0x13'),_0x571888,_0x466815);}return util['format'](_0xdc5d('0x13'),_0x466815,_0x466815);}if(!_[_0xdc5d('0x10')](_0x349ae9)&&_0xdc5d('0x12')===typeof _0x349ae9&&!_[_0xdc5d('0x11')](_0x349ae9)){return _0x349ae9;}return _0xdc5d('0x14');};exports[_0xdc5d('0x15')]=function(_0x290132){if(_[_0xdc5d('0x16')](_0x290132)){return![];}return _0x290132;};exports[_0xdc5d('0x17')]=function(_0x3d2af5,_0xec9ad3,_0x3d69b7,_0xda849c,_0x47b968,_0x5e03e6){var _0x4c97ad={'XMD-QUEUE':_0xec9ad3[_0xdc5d('0x18')]?_0xec9ad3['Queue'][_0xdc5d('0x19')]:'','XMD-CALLERID':_0xda849c,'XMD-CALLERID-PREVIEW':_0x5e03e6?util[_0xdc5d('0x1a')]('\x22%s\x22\x20<%s>',_0x5e03e6['calleridname'],_0x5e03e6['calleridnum']):_0xda849c,'XMD-DIALID':_0x47b968,'XMD-CONTACTID':_0xec9ad3[_0xdc5d('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xda849c,'XMD-VOICEQUEUEID':_0xec9ad3[_0xdc5d('0x1c')],'XMD-DIALCHANNEL':_0x3d69b7,'XMD-DIALTIMEOUT':_0x3d2af5[_0xdc5d('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xdc5d('0x1a')](_0xdc5d('0x1e'),_0x3d2af5[_0xdc5d('0x1f')]?'g':'',_['isEmpty'](_0x3d2af5[_0xdc5d('0x20')])?'':_0xdc5d('0x21')),'XMD-DIALURL':_0x3d2af5[_0xdc5d('0x22')]||'','XMD-AGI':_0x3d2af5['dialQueueProject']?util[_0xdc5d('0x1a')](_0xdc5d('0x23'),ipAgi,_0x3d2af5['dialQueueProject']):_0xdc5d('0x24'),'XMD-AGIAFTER':_0x3d2af5['dialQueueProject2']?util[_0xdc5d('0x1a')](_0xdc5d('0x23'),ipAgi,_0x3d2af5[_0xdc5d('0x1f')]):_0xdc5d('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x5e03e6?_0x5e03e6[_0xdc5d('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x5e03e6?_0x5e03e6['originatecalleridname']:'','XMD-DESTINATION':_0xdc5d('0x26')};if(!_[_0xdc5d('0x11')](_0x3d2af5[_0xdc5d('0x20')])){_0x4c97ad[util[_0xdc5d('0x1a')]('%s',_0xdc5d('0x27'))]=_0x3d2af5[_0xdc5d('0x20')];_0x4c97ad[util[_0xdc5d('0x1a')]('%s',_0xdc5d('0x28'))]=_0x47b968;}if(_0xec9ad3&&_0xec9ad3['Contact']){for(var _0x246833 in _0xec9ad3[_0xdc5d('0x29')]){if(_0xec9ad3[_0xdc5d('0x29')][_0xdc5d('0x2a')](_0x246833)){if(!_[_0xdc5d('0x16')](_0xec9ad3[_0xdc5d('0x29')][_0x246833])&&_0x246833!=='id'&&_0x246833!==_0xdc5d('0x2b')&&_0x246833!=='createdAt'&&_0x246833!==_0xdc5d('0x2c')){_0x4c97ad[util[_0xdc5d('0x1a')](_0xdc5d('0x2d'),'XMD-',_[_0xdc5d('0x2e')](_0x246833))]=_0xec9ad3[_0xdc5d('0x29')][_0x246833];}}}}return _0x4c97ad;};exports['toLowerVariables']=function(_0x37e745){var _0x5c51ba={};for(var _0x1edbe1 in _0x37e745){if(_0x37e745[_0xdc5d('0x2a')](_0x1edbe1)){_0x5c51ba[util[_0xdc5d('0x1a')]('%s',_[_0xdc5d('0x2f')](_0x1edbe1))]=_0x37e745[_0x1edbe1];}}return{'variables':_0x5c51ba};};exports[_0xdc5d('0x30')]=function(_0x58a1e0,_0x333fdf){if(!_[_0xdc5d('0x16')](_0x58a1e0)){if(_0x58a1e0[_0xdc5d('0x2a')](_0xdc5d('0x31'))){if(_0x58a1e0[_0xdc5d('0x31')]>0x0){_0x58a1e0[_0xdc5d('0x31')]-=0x1;}else{logger[_0xdc5d('0x8')](_0xdc5d('0x32'),_0x333fdf);}}}else{logger[_0xdc5d('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x333fdf);}};exports[_0xdc5d('0x33')]=function(_0x304a50){var _0x26567d=moment()[_0xdc5d('0x1a')](_0xdc5d('0x34'));_0x304a50[_0xdc5d('0x35')]=0xd;_0x304a50['statedesc']=_0xdc5d('0x36');_0x304a50['starttime']=_0x26567d;_0x304a50[_0xdc5d('0x37')]=_0x26567d;_0x304a50[_0xdc5d('0x38')]=_0x26567d;};exports[_0xdc5d('0x39')]=function(_0x29f484,_0x3c1c3a,_0x12dbeb){var _0x497d1a=moment()[_0xdc5d('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');_0x29f484[_0xdc5d('0x35')]=_0x3c1c3a;_0x29f484['statedesc']=_0x12dbeb;_0x29f484[_0xdc5d('0x37')]=_0x497d1a;_0x29f484['ringtime']=getSeconds(_0x29f484[_0xdc5d('0x37')],_0x29f484[_0xdc5d('0x3a')]);};exports[_0xdc5d('0x3b')]=function(_0x2dea54,_0x19c426,_0x3dcae0){_0x2dea54['membername']=_0x19c426;_0x2dea54[_0xdc5d('0x3c')]=_0x3dcae0;};exports[_0xdc5d('0x3d')]=function(_0x37041f,_0x170682,_0x287887){var _0x3f81ee=moment()['format'](_0xdc5d('0x34'));_0x37041f[_0xdc5d('0x35')]=_0x170682;_0x37041f['statedesc']=_0x287887;_0x37041f[_0xdc5d('0x37')]=_0x37041f['responsetime']?_0x37041f['responsetime']:_0x3f81ee;_0x37041f[_0xdc5d('0x38')]=_0x37041f[_0xdc5d('0x38')]?_0x37041f[_0xdc5d('0x38')]:_0x3f81ee;_0x37041f[_0xdc5d('0x3e')]=getSeconds(_0x37041f[_0xdc5d('0x37')]||0x0,_0x37041f['starttime']||0x0);_0x37041f[_0xdc5d('0x3f')]=_0x37041f['answertime']?getSeconds(_0x37041f['endtime'],_0x37041f[_0xdc5d('0x40')]):0x0;};exports[_0xdc5d('0x41')]=function(_0x482522){return _0x482522===_0xdc5d('0x42');};exports[_0xdc5d('0x43')]=function(_0x440c68,_0x36a696,_0x52ed2f,_0x219a28,_0x2745cb){var _0x232ba3=_0x219a28?_0xdc5d('0x44'):_0x440c68['calleridname'];_0x232ba3=_0x2745cb?_0xdc5d('0x45'):_0x232ba3;return{'actionid':_0x440c68[_0xdc5d('0x46')],'action':_0xdc5d('0x47'),'channel':_0x440c68[_0xdc5d('0x48')],'callerid':util['format'](_0xdc5d('0x13'),_0x232ba3,_0x440c68['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x52ed2f,'timeout':(_0x36a696[_0xdc5d('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x440c68[_0xdc5d('0x46')]};};exports[_0xdc5d('0x4a')]=function(_0x2a4784){return _0x2a4784[_0xdc5d('0x4b')]+_0x2a4784[_0xdc5d('0x4c')]+_0x2a4784[_0xdc5d('0x4d')];};exports[_0xdc5d('0x4e')]=function(_0x3fdca1){var _0x253771=_[_0xdc5d('0x4f')](_0x3fdca1);_0x253771[_0xdc5d('0x35')]=0xf;_0x253771['statedesc']=_0xdc5d('0x50');return _0x253771;};exports[_0xdc5d('0x51')]=function(_0xe82b25,_0x24a45a,_0x350b0b){var _0x40b7e1={};_0x40b7e1[_0x24a45a]=_0xe82b25[_0x24a45a];_0x40b7e1[_0xdc5d('0x52')]=![];_0x40b7e1[_0xdc5d('0x53')]=moment()[_0xdc5d('0x54')](_0x350b0b,_0xdc5d('0x55'))[_0xdc5d('0x1a')](_0xdc5d('0x34'));_0x40b7e1[_0xdc5d('0x1b')]=_0xe82b25[_0xdc5d('0x1b')];_0x40b7e1['ListId']=_0xe82b25['ListId'];_0x40b7e1[_0xdc5d('0x1c')]=_0xe82b25['VoiceQueueId']||undefined;return _0x40b7e1;};exports[_0xdc5d('0x56')]=function(_0x2179ce,_0xd6f342){if(!_[_0xdc5d('0x16')](_0x2179ce)){if(_0x2179ce[_0xdc5d('0x57')]>0x0){_0x2179ce['pTalking']-=0x1;}else{logger[_0xdc5d('0x8')](_0xd6f342,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xdc5d('0x8')](_0xd6f342,_0xdc5d('0x58'));}};exports[_0xdc5d('0x59')]=function(_0x36f4ce){if(_0x36f4ce<=0x0){return!![];}return![];};exports['buildObj']=function(_0x2d2d43,_0x5ef713){_0x2d2d43[_0xdc5d('0x5a')]=_0x5ef713;_0x2d2d43[_0xdc5d('0x19')]=_0x2d2d43[_0xdc5d('0x5b')];_0x2d2d43[_0xdc5d('0x5c')]=_0x2d2d43[_0xdc5d('0x48')];return _0x2d2d43;};exports['buildAcw']=function(_0x4529fb){var _0x449fc7={};_0x449fc7[_0xdc5d('0x5b')]=_0x4529fb['queue'];_0x449fc7[_0xdc5d('0x5c')]=_0x4529fb[_0xdc5d('0x48')];_0x449fc7['uniqueid']=_0x4529fb[_0xdc5d('0x46')];return _0x449fc7;};exports[_0xdc5d('0x5d')]=function(_0x3b4139){var _0x1a55bb=[];for(var _0x3783f7 in _0x3b4139){if(_0x3b4139[_0xdc5d('0x2a')](_0x3783f7)){if(!_[_0xdc5d('0x16')](_0x3b4139[_0x3783f7])&&_0x3b4139[_0x3783f7][_0xdc5d('0x35')]===_0xdc5d('0x5e')&&_0x3b4139[_0x3783f7][_0xdc5d('0x5f')]===_0xdc5d('0x60')){_0x1a55bb[_0xdc5d('0x61')](_0x3b4139[_0x3783f7]['id']);}}}return _0x1a55bb;};exports[_0xdc5d('0x62')]=function(_0x288898){var _0x53d679=moment()['milliseconds'](0x0);var _0x54d90a=moment(_0x288898)[_0xdc5d('0x4')](0x0);return _0x53d679[_0xdc5d('0x5')](_0x54d90a,_0xdc5d('0x6'));};exports[_0xdc5d('0x63')]=function(_0x5ac17b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5ac17b[_0xdc5d('0x1b')],'ListId':_0x5ac17b['ListId'],'VoiceQueueId':_0x5ac17b['VoiceQueueId']||undefined,'CampaignId':_0x5ac17b[_0xdc5d('0x64')]||undefined};};exports['filterKey']=function(_0x1fe10a){if(_0x1fe10a===_0xdc5d('0x46')||_0x1fe10a===_0xdc5d('0x65')||_0x1fe10a===_0xdc5d('0x5b')||_0x1fe10a==='type'||_0x1fe10a==='campaigntype'||_0x1fe10a===_0xdc5d('0x66')||_0x1fe10a===_0xdc5d('0x67')||_0x1fe10a==='channelAgent'||_0x1fe10a===_0xdc5d('0x68')||_0x1fe10a===_0xdc5d('0x52')||_0x1fe10a==='calleridnum'||_0x1fe10a===_0xdc5d('0x53')||_0x1fe10a===_0xdc5d('0x4b')||_0x1fe10a==='countcongestionretry'||_0x1fe10a===_0xdc5d('0x4d')||_0x1fe10a===_0xdc5d('0x69')||_0x1fe10a==='callback'||_0x1fe10a===_0xdc5d('0x6a')||_0x1fe10a===_0xdc5d('0x6b')||_0x1fe10a===_0xdc5d('0x6c')||_0x1fe10a===_0xdc5d('0x1b')||_0x1fe10a===_0xdc5d('0x6d')||_0x1fe10a===_0xdc5d('0x3c')||_0x1fe10a==='VoiceQueueId'||_0x1fe10a===_0xdc5d('0x6e')||_0x1fe10a===_0xdc5d('0x6f')||_0x1fe10a==='xmd-queue'||_0x1fe10a==='xmd-phone'||_0x1fe10a===_0xdc5d('0x70')||_0x1fe10a===_0xdc5d('0x71')||_0x1fe10a===_0xdc5d('0x72')||_0x1fe10a===_0xdc5d('0x73')||_0x1fe10a===_0xdc5d('0x74')||_0x1fe10a===_0xdc5d('0x75')||_0x1fe10a==='xmd-contactid'||_0x1fe10a==='xmd-cdrtype'||_0x1fe10a===_0xdc5d('0x76')||_0x1fe10a===_0xdc5d('0x77')||_0x1fe10a===_0xdc5d('0x78')||_0x1fe10a==='rtpaudioqos'||_0x1fe10a===_0xdc5d('0x79')||_0x1fe10a===_0xdc5d('0x7a')||_0x1fe10a===_0xdc5d('0x7b')||_0x1fe10a===_0xdc5d('0x7c')||_0x1fe10a==='rtpaudioqoslossbridged'||_0x1fe10a===_0xdc5d('0x7d')||_0x1fe10a===_0xdc5d('0x7e')||_0x1fe10a===_0xdc5d('0x7f')||_0x1fe10a===_0xdc5d('0x79')||_0x1fe10a===_0xdc5d('0x7a')||_0x1fe10a===_0xdc5d('0x7b')||_0x1fe10a==='rtpaudioqosloss'||_0x1fe10a===_0xdc5d('0x80')||_0x1fe10a===_0xdc5d('0x7d')||_0x1fe10a===_0xdc5d('0x7e')||_0x1fe10a===_0xdc5d('0x81')||_0x1fe10a===_0xdc5d('0x82')||_0x1fe10a===_0xdc5d('0x35')||_0x1fe10a===_0xdc5d('0x83')){return![];}return!![];};exports[_0xdc5d('0x84')]=function(_0x1cd94d,_0x108c7c){var _0x9bcaa4,_0x3dc9ed,_0x12086b;if(_0x108c7c<=0x0){_0x108c7c=0x1;}_0x9bcaa4=new RegExp(_0xdc5d('0x85')+_0x108c7c+'}$');_0x3dc9ed=Math[_0xdc5d('0x86')](0xa,_0x108c7c-0x1);_0x12086b=Math[_0xdc5d('0x86')](0xa,_0x108c7c)-0x1;return util[_0xdc5d('0x1a')]('%s',_[_0xdc5d('0x87')](_0x1cd94d,_0x9bcaa4,_[_0xdc5d('0x88')](_0x3dc9ed,_0x12086b)));};exports[_0xdc5d('0x89')]=function(_0x54d387){var _0x5442e9=_0x54d387[_0xdc5d('0x8a')](/"(.*?)"/);return _0x5442e9?_0x5442e9[0x1]:_0x54d387;};exports[_0xdc5d('0x8b')]=function(_0x230627){var _0x3a98f6=_0x230627[_0xdc5d('0x8a')](/<(.*?)>/);return _0x3a98f6?_0x3a98f6[0x1]:_0x230627;}; \ No newline at end of file +var _0xd9f1=['isFailure','Failure','variablesAction','RECALL','calleridname','BOOKED','originate','channelAgent','from-sip','timeout','uniqueid','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','clone','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','buildAcw','agentReadyId','not_inuse','push','getDiff','createBody','CampaignId','filterKey','idContact','dialAnswer','countglobal','callbackuniqueid','callbackat','recallme','sipcallid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','getCallerIdRandom','pow','random','extractCalleridName','match','util','lodash','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','logger','info','inspect','loggerError','error','logger2','message','getCallerId','isUndefined','string','\x22%s\x22\x20<%s>','format','isEmpty','isActive','isNil','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','starttime','endtime','logAgent','state','logLookAgent','membername','UserId','logCustomer','responsetime','ringtime','talktime'];(function(_0x52e0ee,_0x52f7c1){var _0x32534c=function(_0x535d65){while(--_0x535d65){_0x52e0ee['push'](_0x52e0ee['shift']());}};_0x32534c(++_0x52f7c1);}(_0xd9f1,0x1df));var _0x1d9f=function(_0x5f4a65,_0x2fadcf){_0x5f4a65=_0x5f4a65-0x0;var _0xf87dee=_0xd9f1[_0x5f4a65];return _0xf87dee;};'use strict';var util=require(_0x1d9f('0x0'));var _=require(_0x1d9f('0x1'));var moment=require('moment');var logger=require(_0x1d9f('0x2'))(_0x1d9f('0x3'));var ipAgi=process[_0x1d9f('0x4')][_0x1d9f('0x5')]||_0x1d9f('0x6');function getSeconds(_0x701b7,_0x1f734a){var _0x51b09a=moment(_0x701b7)[_0x1d9f('0x7')](0x0);var _0x3e88d4=moment(_0x1f734a)['milliseconds'](0x0);return _0x51b09a[_0x1d9f('0x8')](_0x3e88d4,_0x1d9f('0x9'));}exports['loggerCatch']=function(_0x38fa55){return function(_0x1a4f13){logger['error'](_0x38fa55,util['inspect'](_0x1a4f13,{'showHidden':![],'depth':null}));};};exports[_0x1d9f('0xa')]=function(_0x3ce3c2,_0x58dac4){logger[_0x1d9f('0xb')](_0x3ce3c2,util[_0x1d9f('0xc')](_0x58dac4,{'showHidden':![],'depth':null}));};exports[_0x1d9f('0xd')]=function(_0x3af9d8,_0x219f06){logger[_0x1d9f('0xe')](_0x3af9d8,util[_0x1d9f('0xc')](_0x219f06,{'showHidden':![],'depth':null}));};exports[_0x1d9f('0xf')]=function(_0x39a54e){return function(_0x34d72d){logger['info'](_0x39a54e,util['inspect'](_0x34d72d,{'showHidden':![],'depth':null}));};};exports[_0x1d9f('0x10')]=function(_0x4d3ada,_0x1dec83,_0x4998ce){return{'message':_0x4d3ada,'unlock':_0x1dec83,'active':_0x4998ce};};exports[_0x1d9f('0x11')]=function(_0xc1d4ec,_0x1b30af,_0x4bc52a){if(!_[_0x1d9f('0x12')](_0x4bc52a)&&'string'===typeof _0x4bc52a&&!_['isEmpty'](_0x4bc52a)){if(!_[_0x1d9f('0x12')](_0x1b30af)&&_0x1d9f('0x13')===typeof _0x1b30af&&!_['isEmpty'](_0x1b30af)){return util['format'](_0x1d9f('0x14'),_0x1b30af,_0x4bc52a);}return util[_0x1d9f('0x15')](_0x1d9f('0x14'),_0x4bc52a,_0x4bc52a);}if(!_[_0x1d9f('0x12')](_0xc1d4ec)&&'string'===typeof _0xc1d4ec&&!_[_0x1d9f('0x16')](_0xc1d4ec)){return _0xc1d4ec;}return'\x22\x22\x20<>';};exports[_0x1d9f('0x17')]=function(_0x5d37ef){if(_[_0x1d9f('0x18')](_0x5d37ef)){return![];}return _0x5d37ef;};exports['addVariables']=function(_0xe8f8bf,_0x3dca69,_0x28a1fd,_0x274ced,_0x2abdda,_0x4fb31c){var _0x2a8733={'XMD-QUEUE':_0x3dca69['Queue']?_0x3dca69[_0x1d9f('0x19')]['name']:'','XMD-CALLERID':_0x274ced,'XMD-CALLERID-PREVIEW':_0x4fb31c?util[_0x1d9f('0x15')]('\x22%s\x22\x20<%s>',_0x4fb31c['calleridname'],_0x4fb31c[_0x1d9f('0x1a')]):_0x274ced,'XMD-DIALID':_0x2abdda,'XMD-CONTACTID':_0x3dca69[_0x1d9f('0x1b')],'XMD-CDRTYPE':_0x1d9f('0x1c'),'CALLERID(all)':_0x274ced,'XMD-VOICEQUEUEID':_0x3dca69[_0x1d9f('0x1d')],'XMD-DIALCHANNEL':_0x28a1fd,'XMD-DIALTIMEOUT':_0xe8f8bf[_0x1d9f('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x1d9f('0x15')](_0x1d9f('0x1f'),_0xe8f8bf[_0x1d9f('0x20')]?'g':'',_['isEmpty'](_0xe8f8bf[_0x1d9f('0x21')])?'':_0x1d9f('0x22')),'XMD-DIALURL':_0xe8f8bf[_0x1d9f('0x23')]||'','XMD-AGI':_0xe8f8bf[_0x1d9f('0x24')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0xe8f8bf[_0x1d9f('0x24')]):_0x1d9f('0x25'),'XMD-AGIAFTER':_0xe8f8bf[_0x1d9f('0x20')]?util[_0x1d9f('0x15')]('\x22agi://%s/square,%s\x22',ipAgi,_0xe8f8bf[_0x1d9f('0x20')]):_0x1d9f('0x25'),'XMD-ORIGINATECALLERIDNUM':_0x4fb31c?_0x4fb31c[_0x1d9f('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x4fb31c?_0x4fb31c[_0x1d9f('0x27')]:'','XMD-DESTINATION':_0x1d9f('0x28')};if(!_[_0x1d9f('0x16')](_0xe8f8bf[_0x1d9f('0x21')])){_0x2a8733[util[_0x1d9f('0x15')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0xe8f8bf['monitor_format'];_0x2a8733[util[_0x1d9f('0x15')]('%s',_0x1d9f('0x29'))]=_0x2abdda;}if(_0x3dca69&&_0x3dca69['Contact']){for(var _0x4710b2 in _0x3dca69[_0x1d9f('0x2a')]){if(_0x3dca69[_0x1d9f('0x2a')][_0x1d9f('0x2b')](_0x4710b2)){if(!_[_0x1d9f('0x18')](_0x3dca69[_0x1d9f('0x2a')][_0x4710b2])&&_0x4710b2!=='id'&&_0x4710b2!==_0x1d9f('0x2c')&&_0x4710b2!=='createdAt'&&_0x4710b2!==_0x1d9f('0x2d')){_0x2a8733[util[_0x1d9f('0x15')](_0x1d9f('0x2e'),_0x1d9f('0x2f'),_[_0x1d9f('0x30')](_0x4710b2))]=_0x3dca69[_0x1d9f('0x2a')][_0x4710b2];}}}}return _0x2a8733;};exports[_0x1d9f('0x31')]=function(_0x4d226a){var _0x2d79f1={};for(var _0x1e8b76 in _0x4d226a){if(_0x4d226a[_0x1d9f('0x2b')](_0x1e8b76)){_0x2d79f1[util[_0x1d9f('0x15')]('%s',_[_0x1d9f('0x32')](_0x1e8b76))]=_0x4d226a[_0x1e8b76];}}return{'variables':_0x2d79f1};};exports[_0x1d9f('0x33')]=function(_0x4f28e3,_0x4fc8c2){if(!_['isNil'](_0x4f28e3)){if(_0x4f28e3['hasOwnProperty'](_0x1d9f('0x34'))){if(_0x4f28e3[_0x1d9f('0x34')]>0x0){_0x4f28e3[_0x1d9f('0x34')]-=0x1;}else{logger[_0x1d9f('0xe')](_0x1d9f('0x35'),_0x4fc8c2);}}}else{logger[_0x1d9f('0xe')](_0x1d9f('0x36'),_0x4fc8c2);}};exports[_0x1d9f('0x37')]=function(_0x41f97f){var _0x56df63=moment()[_0x1d9f('0x15')](_0x1d9f('0x38'));_0x41f97f['state']=0xd;_0x41f97f[_0x1d9f('0x39')]='Blacklist';_0x41f97f[_0x1d9f('0x3a')]=_0x56df63;_0x41f97f['responsetime']=_0x56df63;_0x41f97f[_0x1d9f('0x3b')]=_0x56df63;};exports[_0x1d9f('0x3c')]=function(_0x4a57ad,_0x285b57,_0x28051b){var _0x4ad8bd=moment()[_0x1d9f('0x15')](_0x1d9f('0x38'));_0x4a57ad[_0x1d9f('0x3d')]=_0x285b57;_0x4a57ad[_0x1d9f('0x39')]=_0x28051b;_0x4a57ad['responsetime']=_0x4ad8bd;_0x4a57ad['ringtime']=getSeconds(_0x4a57ad['responsetime'],_0x4a57ad['starttime']);};exports[_0x1d9f('0x3e')]=function(_0x4da9b2,_0x5ce752,_0x3ac428){_0x4da9b2[_0x1d9f('0x3f')]=_0x5ce752;_0x4da9b2[_0x1d9f('0x40')]=_0x3ac428;};exports[_0x1d9f('0x41')]=function(_0x4debd3,_0x276cf8,_0x2fdc8f){var _0x471f60=moment()[_0x1d9f('0x15')](_0x1d9f('0x38'));_0x4debd3[_0x1d9f('0x3d')]=_0x276cf8;_0x4debd3[_0x1d9f('0x39')]=_0x2fdc8f;_0x4debd3[_0x1d9f('0x42')]=_0x4debd3[_0x1d9f('0x42')]?_0x4debd3[_0x1d9f('0x42')]:_0x471f60;_0x4debd3['endtime']=_0x4debd3[_0x1d9f('0x3b')]?_0x4debd3[_0x1d9f('0x3b')]:_0x471f60;_0x4debd3[_0x1d9f('0x43')]=getSeconds(_0x4debd3[_0x1d9f('0x42')]||0x0,_0x4debd3[_0x1d9f('0x3a')]||0x0);_0x4debd3[_0x1d9f('0x44')]=_0x4debd3['answertime']?getSeconds(_0x4debd3[_0x1d9f('0x3b')],_0x4debd3['answertime']):0x0;};exports[_0x1d9f('0x45')]=function(_0xcf8491){return _0xcf8491===_0x1d9f('0x46');};exports[_0x1d9f('0x47')]=function(_0x5b6c3d,_0x1996dd,_0x59a6d6,_0x5711dc,_0x3207dc){var _0x23476e=_0x5711dc?_0x1d9f('0x48'):_0x5b6c3d[_0x1d9f('0x49')];_0x23476e=_0x3207dc?_0x1d9f('0x4a'):_0x23476e;return{'actionid':_0x5b6c3d['uniqueid'],'action':_0x1d9f('0x4b'),'channel':_0x5b6c3d[_0x1d9f('0x4c')],'callerid':util[_0x1d9f('0x15')](_0x1d9f('0x14'),_0x23476e,_0x5b6c3d[_0x1d9f('0x1a')]),'Exten':_0x1d9f('0x28'),'Context':_0x1d9f('0x4d'),'Priority':'1','variable':_0x59a6d6,'timeout':(_0x1996dd[_0x1d9f('0x4e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5b6c3d[_0x1d9f('0x4f')]};};exports[_0x1d9f('0x50')]=function(_0x394117){return _0x394117[_0x1d9f('0x51')]+_0x394117[_0x1d9f('0x52')]+_0x394117[_0x1d9f('0x53')];};exports['cloneAction']=function(_0x14a59c){var _0x4be214=_[_0x1d9f('0x54')](_0x14a59c);_0x4be214[_0x1d9f('0x3d')]=0xf;_0x4be214[_0x1d9f('0x39')]='Global';return _0x4be214;};exports[_0x1d9f('0x55')]=function(_0x1563bd,_0x1a89d2,_0x540355){var _0x4ec9c2={};_0x4ec9c2[_0x1a89d2]=_0x1563bd[_0x1a89d2];_0x4ec9c2[_0x1d9f('0x56')]=![];_0x4ec9c2[_0x1d9f('0x57')]=moment()[_0x1d9f('0x58')](_0x540355,_0x1d9f('0x59'))['format'](_0x1d9f('0x38'));_0x4ec9c2['ContactId']=_0x1563bd['ContactId'];_0x4ec9c2[_0x1d9f('0x5a')]=_0x1563bd[_0x1d9f('0x5a')];_0x4ec9c2['VoiceQueueId']=_0x1563bd[_0x1d9f('0x1d')]||undefined;return _0x4ec9c2;};exports['decrementTalkink']=function(_0x28d473,_0x21d668){if(!_['isNil'](_0x28d473)){if(_0x28d473[_0x1d9f('0x5b')]>0x0){_0x28d473[_0x1d9f('0x5b')]-=0x1;}else{logger[_0x1d9f('0xe')](_0x21d668,_0x1d9f('0x5c'));}}else{logger[_0x1d9f('0xe')](_0x21d668,_0x1d9f('0x5d'));}};exports['IsNotLoggedIn']=function(_0x109f62){if(_0x109f62<=0x0){return!![];}return![];};exports[_0x1d9f('0x5e')]=function(_0x5c3f18,_0x1af346){_0x5c3f18[_0x1d9f('0x5f')]=_0x1af346;_0x5c3f18['name']=_0x5c3f18[_0x1d9f('0x60')];_0x5c3f18['interface']=_0x5c3f18['channelAgent'];return _0x5c3f18;};exports[_0x1d9f('0x61')]=function(_0x1f6610){var _0x4210aa={};_0x4210aa[_0x1d9f('0x60')]=_0x1f6610[_0x1d9f('0x60')];_0x4210aa['interface']=_0x1f6610[_0x1d9f('0x4c')];_0x4210aa[_0x1d9f('0x4f')]=_0x1f6610['uniqueid'];return _0x4210aa;};exports[_0x1d9f('0x62')]=function(_0x57c8c2){var _0x41f021=[];for(var _0x28df71 in _0x57c8c2){if(_0x57c8c2[_0x1d9f('0x2b')](_0x28df71)){if(!_[_0x1d9f('0x18')](_0x57c8c2[_0x28df71])&&_0x57c8c2[_0x28df71]['state']===_0x1d9f('0x63')&&_0x57c8c2[_0x28df71]['status']==='reachable'){_0x41f021[_0x1d9f('0x64')](_0x57c8c2[_0x28df71]['id']);}}}return _0x41f021;};exports[_0x1d9f('0x65')]=function(_0x207641){var _0x2e70d0=moment()[_0x1d9f('0x7')](0x0);var _0x24b23c=moment(_0x207641)['milliseconds'](0x0);return _0x2e70d0[_0x1d9f('0x8')](_0x24b23c,_0x1d9f('0x9'));};exports[_0x1d9f('0x66')]=function(_0x3773bb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x3773bb[_0x1d9f('0x1b')],'ListId':_0x3773bb['ListId'],'VoiceQueueId':_0x3773bb[_0x1d9f('0x1d')]||undefined,'CampaignId':_0x3773bb[_0x1d9f('0x67')]||undefined};};exports[_0x1d9f('0x68')]=function(_0x1ae06c){if(_0x1ae06c===_0x1d9f('0x4f')||_0x1ae06c===_0x1d9f('0x69')||_0x1ae06c===_0x1d9f('0x60')||_0x1ae06c==='type'||_0x1ae06c==='campaigntype'||_0x1ae06c===_0x1d9f('0x6a')||_0x1ae06c===_0x1d9f('0x3f')||_0x1ae06c===_0x1d9f('0x4c')||_0x1ae06c===_0x1d9f('0x49')||_0x1ae06c===_0x1d9f('0x56')||_0x1ae06c===_0x1d9f('0x1a')||_0x1ae06c===_0x1d9f('0x57')||_0x1ae06c===_0x1d9f('0x51')||_0x1ae06c==='countcongestionretry'||_0x1ae06c===_0x1d9f('0x53')||_0x1ae06c===_0x1d9f('0x6b')||_0x1ae06c==='callback'||_0x1ae06c===_0x1d9f('0x6c')||_0x1ae06c===_0x1d9f('0x6d')||_0x1ae06c===_0x1d9f('0x6e')||_0x1ae06c===_0x1d9f('0x1b')||_0x1ae06c==='ListId'||_0x1ae06c===_0x1d9f('0x40')||_0x1ae06c===_0x1d9f('0x1d')||_0x1ae06c===_0x1d9f('0x6f')||_0x1ae06c==='xmd-voicequeueid'||_0x1ae06c==='xmd-queue'||_0x1ae06c===_0x1d9f('0x70')||_0x1ae06c===_0x1d9f('0x71')||_0x1ae06c===_0x1d9f('0x72')||_0x1ae06c===_0x1d9f('0x73')||_0x1ae06c===_0x1d9f('0x74')||_0x1ae06c===_0x1d9f('0x75')||_0x1ae06c===_0x1d9f('0x76')||_0x1ae06c===_0x1d9f('0x77')||_0x1ae06c===_0x1d9f('0x78')||_0x1ae06c===_0x1d9f('0x79')||_0x1ae06c===_0x1d9f('0x7a')||_0x1ae06c===_0x1d9f('0x7b')||_0x1ae06c===_0x1d9f('0x7c')||_0x1ae06c===_0x1d9f('0x7d')||_0x1ae06c===_0x1d9f('0x7e')||_0x1ae06c===_0x1d9f('0x7f')||_0x1ae06c===_0x1d9f('0x80')||_0x1ae06c===_0x1d9f('0x81')||_0x1ae06c===_0x1d9f('0x82')||_0x1ae06c===_0x1d9f('0x83')||_0x1ae06c===_0x1d9f('0x7c')||_0x1ae06c===_0x1d9f('0x7d')||_0x1ae06c===_0x1d9f('0x7e')||_0x1ae06c===_0x1d9f('0x7f')||_0x1ae06c==='rtpaudioqosloss'||_0x1ae06c===_0x1d9f('0x81')||_0x1ae06c==='rtpaudioqosrtt'||_0x1ae06c===_0x1d9f('0x83')||_0x1ae06c==='bridgepeer'||_0x1ae06c==='bridgepvtcallid'||_0x1ae06c===_0x1d9f('0x3d')||_0x1ae06c===_0x1d9f('0x39')){return![];}return!![];};exports[_0x1d9f('0x84')]=function(_0x16ee03,_0x3be9dd){var _0x3cd328,_0x29b18e,_0x3f3738;if(_0x3be9dd<=0x0){_0x3be9dd=0x1;}_0x3cd328=new RegExp('\x5cw{0,'+_0x3be9dd+'}$');_0x29b18e=Math['pow'](0xa,_0x3be9dd-0x1);_0x3f3738=Math[_0x1d9f('0x85')](0xa,_0x3be9dd)-0x1;return util[_0x1d9f('0x15')]('%s',_['replace'](_0x16ee03,_0x3cd328,_[_0x1d9f('0x86')](_0x29b18e,_0x3f3738)));};exports[_0x1d9f('0x87')]=function(_0x3f40dd){var _0x37ac48=_0x3f40dd[_0x1d9f('0x88')](/"(.*?)"/);return _0x37ac48?_0x37ac48[0x1]:_0x3f40dd;};exports['extractCalleridNumber']=function(_0xd29d17){var _0x30eb20=_0xd29d17[_0x1d9f('0x88')](/<(.*?)>/);return _0x30eb20?_0x30eb20[0x1]:_0xd29d17;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c1788ca..2232191 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 _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x138fd1,_0x4509cd){var _0x64ea45=function(_0x173db7){while(--_0x173db7){_0x138fd1['push'](_0x138fd1['shift']());}};_0x64ea45(++_0x4509cd);}(_0x7a54,0x106));var _0x47a5=function(_0x3a2f9d,_0x493113){_0x3a2f9d=_0x3a2f9d-0x0;var _0x34244c=_0x7a54[_0x3a2f9d];return _0x34244c;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x2bb2d1,_0x32af3b){var _0x2d87f0=function(_0x2ac0cb){while(--_0x2ac0cb){_0x2bb2d1['push'](_0x2bb2d1['shift']());}};_0x2d87f0(++_0x32af3b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30b5f2,_0xe3cee){_0x30b5f2=_0x30b5f2-0x0;var _0x5965e9=_0x5f2f[_0x30b5f2];return _0x5965e9;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 4df016b..3c53ec5 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 _0xfd40=['sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','interface','isUndefined','agents','initTelephones','telephones','format','initTrunks','initVoiceQueues','initTriggers','initTemplates','templates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','vtigerAccounts','initFreshsalesAccounts','merge','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/deskAccount','../model/freshsalesAccount','../model/faxAccount','trunks','voiceQueues','triggers','campaigns','outbound','channels','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','SIP/%s','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0xfd40,0xa2));var _0x0fd4=function(_0x5ab854,_0x3e8463){_0x5ab854=_0x5ab854-0x0;var _0xbee85e=_0xfd40[_0x5ab854];return _0xbee85e;};'use strict';var BPromise=require(_0x0fd4('0x0'));var util=require(_0x0fd4('0x1'));var _=require(_0x0fd4('0x2'));var moment=require('moment');var Agent=require(_0x0fd4('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x0fd4('0x4'));var VoiceQueue=require(_0x0fd4('0x5'));var Trigger=require(_0x0fd4('0x6'));var Template=require(_0x0fd4('0x7'));var Campaign=require(_0x0fd4('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x0fd4('0x9'));var SalesforceAccount=require(_0x0fd4('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x0fd4('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x0fd4('0xc'));var FaxAccount=require(_0x0fd4('0xd'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0x0fd4('0xe')]={};this[_0x0fd4('0xf')]={};this[_0x0fd4('0x10')]={};this[_0x0fd4('0x11')]={};this['templates']={};this[_0x0fd4('0x12')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x0fd4('0x13')]={};this[_0x0fd4('0x14')]={};this[_0x0fd4('0x15')]={};this['timers']={};this[_0x0fd4('0x16')]={};this[_0x0fd4('0x17')]={};this['sugarcrmAccounts']={};this[_0x0fd4('0x18')]={};this[_0x0fd4('0x19')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0x0fd4('0x1a')]={};this[_0x0fd4('0x1b')]={};this[_0x0fd4('0x1c')]={};this[_0x0fd4('0x1d')]={};};function freeIsNotKey(_0x6075d7,_0x2fdaf1,_0xda0a18){var _0x3a31b8=_[_0x0fd4('0x1e')](_0x6075d7,function(_0x15e282,_0x446985){return _0x15e282[_0xda0a18];});for(var _0x49c361 in _0x2fdaf1){if(_0x2fdaf1['hasOwnProperty'](_0x49c361)){if(!_0x3a31b8[_0x49c361]){delete _0x2fdaf1[_0x49c361];}}}}function freeIsNotKeySip(_0x477f97,_0x55a136){var _0x1b32f5=_['mapKeys'](_0x477f97,function(_0x503ac8,_0x4b3b1f){return util['format']('SIP/%s',_0x503ac8[_0x0fd4('0x1f')]);});for(var _0x249a4a in _0x55a136){if(_0x55a136[_0x0fd4('0x20')](_0x249a4a)){if(!_0x1b32f5[_0x249a4a]){delete _0x55a136[_0x249a4a];}}}}function freeIsNotKeyAgent(_0x30addc,_0x3bd8e5){var _0x24c869=_['mapKeys'](_0x30addc,function(_0x4854ad,_0x30a2db){var _0x351c56=_['isNil'](_0x4854ad['interface'])?util['format'](_0x0fd4('0x21'),_0x4854ad['name']):_0x4854ad['interface'];return _0x351c56;});for(var _0xa46baa in _0x3bd8e5){if(_0x3bd8e5[_0x0fd4('0x20')](_0xa46baa)){if(!_0x24c869[_0xa46baa]){delete _0x3bd8e5[_0xa46baa];}}}}function clearVoiceCallReports(_0x242178){_0x242178['total']=0x0;_0x242178[_0x0fd4('0x22')]=0x0;_0x242178[_0x0fd4('0x23')]=0x0;_0x242178[_0x0fd4('0x24')]=0x0;_0x242178['sumBillable']=0x0;}function clearCampaigns(_0x355b94){if(!_[_0x0fd4('0x25')](_0x355b94)){for(var _0x5c2e20 in _0x355b94){if(_0x355b94[_0x0fd4('0x20')](_0x5c2e20)){_0x355b94[_0x5c2e20][_0x0fd4('0x26')]=0x0;_0x355b94[_0x5c2e20][_0x0fd4('0x27')]=0x0;}}}}function clearVoiceQueues(_0x37c349){if(!_[_0x0fd4('0x25')](_0x37c349)){for(var _0x24099b in _0x37c349){if(_0x37c349[_0x0fd4('0x20')](_0x24099b)){_0x37c349[_0x24099b][_0x0fd4('0x28')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x22')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x29')]=0x0;_0x37c349[_0x24099b]['abandoned']=0x0;_0x37c349[_0x24099b][_0x0fd4('0x23')]=0x0;_0x37c349[_0x24099b]['sumDuration']=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2a')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2b')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2c')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2d')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2e')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2f')]=0x0;_0x37c349[_0x24099b]['outboundUnknownCallsDay']=0x0;_0x37c349[_0x24099b][_0x0fd4('0x30')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x31')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x32')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x33')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x34')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x35')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2b')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x36')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x37')]=!![];}}}}Realtime[_0x0fd4('0x38')][_0x0fd4('0x39')]=function(_0xae458c,_0x59fca7){for(var _0x453070 in _0x59fca7){if(_0xae458c['hasOwnProperty'](_0x453070)){_0xae458c[_0x453070]=_0x59fca7[_0x453070];}}};Realtime[_0x0fd4('0x38')][_0x0fd4('0x3a')]=function(){var _0x4c84e1=this;return function(_0x7628b9){if(_0x7628b9){freeIsNotKeyAgent(_0x7628b9,_0x4c84e1['agents']);for(var _0x18acd1=0x0,_0x45c3bb={},_0x1acaab={};_0x18acd1<_0x7628b9[_0x0fd4('0x3b')];_0x18acd1+=0x1){_0x45c3bb=_0x7628b9[_0x18acd1];var _0x435c4e=_['isNil'](_0x45c3bb[_0x0fd4('0x3c')])?util['format'](_0x0fd4('0x21'),_0x45c3bb[_0x0fd4('0x1f')]):_0x45c3bb['interface'];if(_[_0x0fd4('0x3d')](_0x4c84e1[_0x0fd4('0x3e')][_0x435c4e])){_0x4c84e1['agents'][_0x435c4e]=new Agent(_0x45c3bb);}else{_0x4c84e1[_0x0fd4('0x39')](_0x4c84e1[_0x0fd4('0x3e')][_0x435c4e],_0x45c3bb);}}}return _0x4c84e1[_0x0fd4('0x3e')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x3f')]=function(){var _0x3ad577=this;return function(_0x3e2581){if(_0x3e2581){freeIsNotKeySip(_0x3e2581,_0x3ad577[_0x0fd4('0x40')]);for(var _0x12e66b=0x0,_0x25b303={},_0x40c607={};_0x12e66b<_0x3e2581[_0x0fd4('0x3b')];_0x12e66b+=0x1){_0x25b303=_0x3e2581[_0x12e66b];if(_[_0x0fd4('0x3d')](_0x3ad577['telephones'][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x25b303[_0x0fd4('0x1f')])])){_0x3ad577[_0x0fd4('0x40')][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x25b303[_0x0fd4('0x1f')])]=new Telephone(_0x25b303);}else{_0x3ad577[_0x0fd4('0x39')](_0x3ad577[_0x0fd4('0x40')][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x25b303[_0x0fd4('0x1f')])],_0x25b303);}}}return _0x3ad577[_0x0fd4('0x40')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x42')]=function(){var _0x4623c1=this;return function(_0x337876){if(_0x337876){freeIsNotKeySip(_0x337876,_0x4623c1[_0x0fd4('0xe')]);for(var _0x371da9=0x0,_0x4ab529={},_0x2bb847={};_0x371da9<_0x337876[_0x0fd4('0x3b')];_0x371da9+=0x1){_0x4ab529=_0x337876[_0x371da9];if(_[_0x0fd4('0x3d')](_0x4623c1['trunks'][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x4ab529[_0x0fd4('0x1f')])])){_0x4623c1['trunks'][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x4ab529[_0x0fd4('0x1f')])]=new Trunk(_0x4ab529);}else{_0x4623c1['mergeFromDatabase'](_0x4623c1[_0x0fd4('0xe')][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x4ab529[_0x0fd4('0x1f')])],_0x4ab529);}}}return _0x4623c1['trunks'];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x43')]=function(){var _0x26d99a=this;return function(_0x3931b3){if(_0x3931b3){freeIsNotKey(_0x3931b3,_0x26d99a['voiceQueues'],'name');for(var _0x2ed906=0x0,_0x52de75={},_0x46977c={};_0x2ed906<_0x3931b3['length'];_0x2ed906+=0x1){_0x52de75=_0x3931b3[_0x2ed906];if(_[_0x0fd4('0x3d')](_0x26d99a[_0x0fd4('0xf')][_0x52de75[_0x0fd4('0x1f')]])){_0x26d99a[_0x0fd4('0xf')][_0x52de75[_0x0fd4('0x1f')]]=new VoiceQueue(_0x52de75);}else{_0x26d99a['mergeFromDatabase'](_0x26d99a[_0x0fd4('0xf')][_0x52de75[_0x0fd4('0x1f')]],_0x52de75);}}}return _0x26d99a[_0x0fd4('0xf')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x44')]=function(){var _0x45a84e=this;return function(_0x7a83ce){if(_0x7a83ce){freeIsNotKey(_0x7a83ce,_0x45a84e[_0x0fd4('0x10')],'id');for(var _0x1aa3d8=0x0,_0x56b346={},_0x40d7f7={};_0x1aa3d8<_0x7a83ce[_0x0fd4('0x3b')];_0x1aa3d8+=0x1){_0x56b346=_0x7a83ce[_0x1aa3d8];if(_[_0x0fd4('0x3d')](_0x45a84e[_0x0fd4('0x10')][_0x56b346['id']])){_0x45a84e[_0x0fd4('0x10')][_0x56b346['id']]=new Trigger(_0x56b346);}else{_0x45a84e[_0x0fd4('0x39')](_0x45a84e[_0x0fd4('0x10')][_0x56b346['id']],_0x56b346);}}}return _0x45a84e[_0x0fd4('0x10')];};};Realtime['prototype'][_0x0fd4('0x45')]=function(){var _0x333415=this;return function(_0x3cfaa3){if(_0x3cfaa3){freeIsNotKey(_0x3cfaa3,_0x333415[_0x0fd4('0x46')],'id');for(var _0x84bdb=0x0,_0x1283b2={},_0x18a339={};_0x84bdb<_0x3cfaa3['length'];_0x84bdb+=0x1){_0x1283b2=_0x3cfaa3[_0x84bdb];if(_[_0x0fd4('0x3d')](_0x333415['templates'][_0x1283b2['id']])){_0x333415[_0x0fd4('0x46')][_0x1283b2['id']]=new Template(_0x1283b2);}else{_0x333415[_0x0fd4('0x39')](_0x333415[_0x0fd4('0x46')][_0x1283b2['id']],_0x1283b2);}}}return _0x333415['templates'];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x1103e2=this;return function(_0x287d02){if(_0x287d02){freeIsNotKey(_0x287d02,_0x1103e2[_0x0fd4('0x16')],'id');for(var _0x3dcc48=0x0,_0x1234bd={},_0x4d5191={};_0x3dcc48<_0x287d02[_0x0fd4('0x3b')];_0x3dcc48+=0x1){_0x1234bd=_0x287d02[_0x3dcc48];if(_[_0x0fd4('0x3d')](_0x1103e2[_0x0fd4('0x16')][_0x1234bd['id']])){_0x1103e2['zendeskAccounts'][_0x1234bd['id']]=new ZendeskAccount(_0x1234bd);}else{_0x1103e2[_0x0fd4('0x39')](_0x1103e2[_0x0fd4('0x16')][_0x1234bd['id']],_0x1234bd);}}}return _0x1103e2[_0x0fd4('0x16')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x47')]=function(){var _0x3c8c84=this;return function(_0x214c9e){if(_0x214c9e){freeIsNotKey(_0x214c9e,_0x3c8c84[_0x0fd4('0x17')],'id');for(var _0x487992=0x0,_0x4b0cee={},_0x100f72={};_0x487992<_0x214c9e['length'];_0x487992+=0x1){_0x4b0cee=_0x214c9e[_0x487992];if(_['isUndefined'](_0x3c8c84[_0x0fd4('0x17')][_0x4b0cee['id']])){_0x3c8c84[_0x0fd4('0x17')][_0x4b0cee['id']]=new SalesforceAccount(_0x4b0cee);}else{_0x3c8c84[_0x0fd4('0x39')](_0x3c8c84[_0x0fd4('0x17')][_0x4b0cee['id']],_0x4b0cee);}}}return _0x3c8c84[_0x0fd4('0x17')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x48')]=function(){var _0x43df1a=this;return function(_0x52ac2b){if(_0x52ac2b){freeIsNotKey(_0x52ac2b,_0x43df1a[_0x0fd4('0x18')],'id');for(var _0x1c5040=0x0,_0x4fc46b={},_0x179894={};_0x1c5040<_0x52ac2b[_0x0fd4('0x3b')];_0x1c5040+=0x1){_0x4fc46b=_0x52ac2b[_0x1c5040];if(_['isUndefined'](_0x43df1a['freshdeskAccounts'][_0x4fc46b['id']])){_0x43df1a[_0x0fd4('0x18')][_0x4fc46b['id']]=new FreshdeskAccount(_0x4fc46b);}else{_0x43df1a['mergeFromDatabase'](_0x43df1a[_0x0fd4('0x18')][_0x4fc46b['id']],_0x4fc46b);}}}return _0x43df1a['freshdeskAccounts'];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x49')]=function(){var _0xe52ac=this;return function(_0x2522d9){if(_0x2522d9){freeIsNotKey(_0x2522d9,_0xe52ac[_0x0fd4('0x19')],'id');for(var _0x5f4f6c=0x0,_0x4d4f71={},_0x29a1a5={};_0x5f4f6c<_0x2522d9[_0x0fd4('0x3b')];_0x5f4f6c+=0x1){_0x4d4f71=_0x2522d9[_0x5f4f6c];if(_[_0x0fd4('0x3d')](_0xe52ac[_0x0fd4('0x19')][_0x4d4f71['id']])){_0xe52ac[_0x0fd4('0x19')][_0x4d4f71['id']]=new ZohoAccount(_0x4d4f71);}else{_0xe52ac[_0x0fd4('0x39')](_0xe52ac[_0x0fd4('0x19')][_0x4d4f71['id']],_0x4d4f71);}}}return _0xe52ac['zohoAccounts'];};};Realtime['prototype'][_0x0fd4('0x4a')]=function(){var _0xb81ccb=this;return function(_0x17746b){if(_0x17746b){freeIsNotKey(_0x17746b,_0xb81ccb[_0x0fd4('0x4b')],'id');for(var _0x9b7bba=0x0,_0x5ed142={},_0x41a4ac={};_0x9b7bba<_0x17746b[_0x0fd4('0x3b')];_0x9b7bba+=0x1){_0x5ed142=_0x17746b[_0x9b7bba];if(_[_0x0fd4('0x3d')](_0xb81ccb[_0x0fd4('0x4b')][_0x5ed142['id']])){_0xb81ccb['deskAccounts'][_0x5ed142['id']]=new DeskAccount(_0x5ed142);}else{_0xb81ccb[_0x0fd4('0x39')](_0xb81ccb[_0x0fd4('0x4b')][_0x5ed142['id']],_0x5ed142);}}}return _0xb81ccb['deskAccounts'];};};Realtime[_0x0fd4('0x38')]['initSugarcrmAccounts']=function(){var _0x1a44b4=this;return function(_0x126b02){if(_0x126b02){freeIsNotKey(_0x126b02,_0x1a44b4[_0x0fd4('0x4c')],'id');for(var _0x279c73=0x0,_0x192a4f={},_0x1dc10e={};_0x279c73<_0x126b02[_0x0fd4('0x3b')];_0x279c73+=0x1){_0x192a4f=_0x126b02[_0x279c73];if(_['isUndefined'](_0x1a44b4[_0x0fd4('0x4c')][_0x192a4f['id']])){_0x1a44b4[_0x0fd4('0x4c')][_0x192a4f['id']]=new SugarcrmAccount(_0x192a4f);}else{_0x1a44b4['mergeFromDatabase'](_0x1a44b4['sugarcrmAccounts'][_0x192a4f['id']],_0x192a4f);}}}return _0x1a44b4[_0x0fd4('0x4c')];};};Realtime[_0x0fd4('0x38')]['initVtigerAccounts']=function(){var _0x53ba54=this;return function(_0xba6629){if(_0xba6629){freeIsNotKey(_0xba6629,_0x53ba54['vtigerAccounts'],'id');for(var _0x1d8185=0x0,_0x47c41a={},_0x10e1c2={};_0x1d8185<_0xba6629[_0x0fd4('0x3b')];_0x1d8185+=0x1){_0x47c41a=_0xba6629[_0x1d8185];if(_['isUndefined'](_0x53ba54[_0x0fd4('0x4d')][_0x47c41a['id']])){_0x53ba54[_0x0fd4('0x4d')][_0x47c41a['id']]=new VtigerAccount(_0x47c41a);}else{_0x53ba54[_0x0fd4('0x39')](_0x53ba54[_0x0fd4('0x4d')][_0x47c41a['id']],_0x47c41a);}}}return _0x53ba54['vtigerAccounts'];};};Realtime[_0x0fd4('0x38')]['initServicenowAccounts']=function(){var _0x35b851=this;return function(_0x3ee5ff){if(_0x3ee5ff){freeIsNotKey(_0x3ee5ff,_0x35b851[_0x0fd4('0x1a')],'id');for(var _0xd64166=0x0,_0x3e4ca3={},_0x1bed9e={};_0xd64166<_0x3ee5ff[_0x0fd4('0x3b')];_0xd64166+=0x1){_0x3e4ca3=_0x3ee5ff[_0xd64166];if(_[_0x0fd4('0x3d')](_0x35b851['servicenowAccounts'][_0x3e4ca3['id']])){_0x35b851[_0x0fd4('0x1a')][_0x3e4ca3['id']]=new ServicenowAccount(_0x3e4ca3);}else{_0x35b851[_0x0fd4('0x39')](_0x35b851[_0x0fd4('0x1a')][_0x3e4ca3['id']],_0x3e4ca3);}}}return _0x35b851['servicenowAccounts'];};};Realtime[_0x0fd4('0x38')]['initDynamics365Accounts']=function(){var _0x5c1242=this;return function(_0x9030b3){if(_0x9030b3){freeIsNotKey(_0x9030b3,_0x5c1242[_0x0fd4('0x1b')],'id');for(var _0x1ae54b=0x0,_0x123d7d={},_0x24440b={};_0x1ae54b<_0x9030b3['length'];_0x1ae54b+=0x1){_0x123d7d=_0x9030b3[_0x1ae54b];if(_[_0x0fd4('0x3d')](_0x5c1242[_0x0fd4('0x1b')][_0x123d7d['id']])){_0x5c1242[_0x0fd4('0x1b')][_0x123d7d['id']]=new Dynamics365Account(_0x123d7d);}else{_0x5c1242[_0x0fd4('0x39')](_0x5c1242[_0x0fd4('0x1b')][_0x123d7d['id']],_0x123d7d);}}}return _0x5c1242[_0x0fd4('0x1b')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x4e')]=function(){var _0x104d84=this;return function(_0xadb280){if(_0xadb280){freeIsNotKey(_0xadb280,_0x104d84['freshsalesAccounts'],'id');for(var _0x506cf5=0x0,_0x374a14={},_0x1703d9={};_0x506cf5<_0xadb280[_0x0fd4('0x3b')];_0x506cf5+=0x1){_0x374a14=_0xadb280[_0x506cf5];if(_[_0x0fd4('0x3d')](_0x104d84[_0x0fd4('0x1c')][_0x374a14['id']])){_0x104d84[_0x0fd4('0x1c')][_0x374a14['id']]=new FreshsalesAccount(_0x374a14);}else{_0x104d84['mergeFromDatabase'](_0x104d84[_0x0fd4('0x1c')][_0x374a14['id']],_0x374a14);}}}return _0x104d84[_0x0fd4('0x1c')];};};Realtime[_0x0fd4('0x38')]['initVoiceQueueHopperHistory']=function(){var _0x347a46=this;return function(_0x4bf012){for(var _0xc17b2c=0x0;_0xc17b2c<_0x4bf012[_0x0fd4('0x3b')];_0xc17b2c+=0x1){_[_0x0fd4('0x4f')](_0x347a46[_0x0fd4('0xf')][_0x4bf012[_0xc17b2c][_0x0fd4('0x1f')]],_0x4bf012[_0xc17b2c]);}return _0x347a46[_0x0fd4('0xf')];};};Realtime[_0x0fd4('0x38')]['initVoiceQueueReports']=function(){var _0x1045c9=this;return function(_0x4b6902){clearVoiceQueues(_0x1045c9['voiceQueues']);if(_0x4b6902){_0x4b6902=_[_0x0fd4('0x50')](_0x4b6902,_0x0fd4('0x51'));for(var _0x5bb9cc in _0x4b6902){if(_0x4b6902[_0x0fd4('0x20')](_0x5bb9cc)){var _0x3c7d62={};for(var _0x504731=0x0;_0x504731<_0x4b6902[_0x5bb9cc]['length'];_0x504731+=0x1){var _0x1a465a=_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x52')];if(_0x1045c9[_0x0fd4('0xf')][_0x1a465a]){if(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x53')]){_0x1045c9['voiceQueues'][_0x1a465a][_0x0fd4('0x29')]+=0x1;}if(_0x4b6902[_0x5bb9cc][_0x504731]['queuecallerabandon']){_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x54')]+=0x1;}_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x23')]+=moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x55')])[_0x0fd4('0x56')](moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x57')]),'seconds')||0x0;if(_0x504731===_0x4b6902[_0x5bb9cc]['length']-0x1){_0x1045c9['voiceQueues'][_0x1a465a][_0x0fd4('0x24')]+=moment(_0x4b6902[_0x5bb9cc][_0x504731]['queuecallercompleteAt']||_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x58')]||_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x59')])['diff'](moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x57')]),_0x0fd4('0x5a'))||0x0;_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x28')]+=0x1;if(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x5b')]){_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x22')]+=0x1;_0x1045c9[_0x0fd4('0xf')][_0x1a465a]['sumBillable']+=moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x5c')])[_0x0fd4('0x56')](moment(_0x4b6902[_0x5bb9cc][_0x504731]['queuecallerleaveAt']),_0x0fd4('0x5a'))||0x0;}}else{_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x24')]+=_0x1045c9['voiceQueues'][_0x1a465a][_0x0fd4('0x23')]||0x0;}}}}}}return _0x1045c9[_0x0fd4('0xf')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x5d')]=function(){var _0x451a18=this;return function(_0x339923){clearVoiceCallReports(_0x451a18[_0x0fd4('0x12')]);if(_0x339923){for(var _0x567037=0x0;_0x567037<_0x339923[_0x0fd4('0x3b')];_0x567037+=0x1){_0x451a18[_0x0fd4('0x12')][_0x0fd4('0x28')]+=0x1;_0x451a18['outbound'][_0x0fd4('0x24')]+=_0x339923[_0x567037][_0x0fd4('0x5e')];if(_0x339923[_0x567037][_0x0fd4('0x5f')]===_0x0fd4('0x60')){_0x451a18[_0x0fd4('0x12')]['answered']+=0x1;_0x451a18[_0x0fd4('0x12')][_0x0fd4('0x23')]+=_0x339923[_0x567037][_0x0fd4('0x5e')]-_0x339923[_0x567037][_0x0fd4('0x61')]||0x0;_0x451a18['outbound']['sumBillable']+=_0x339923[_0x567037][_0x0fd4('0x61')];}}}return _0x451a18[_0x0fd4('0x12')];};};Realtime['prototype'][_0x0fd4('0x62')]=function(){var _0x49b899=this;return function(_0x2378e0){if(_0x2378e0){freeIsNotKey(_0x2378e0,_0x49b899[_0x0fd4('0x11')],_0x0fd4('0x1f'));for(var _0x2a1614=0x0,_0x1254b8={};_0x2a1614<_0x2378e0[_0x0fd4('0x3b')];_0x2a1614+=0x1){_0x1254b8=_0x2378e0[_0x2a1614];if(_[_0x0fd4('0x3d')](_0x49b899[_0x0fd4('0x11')][_0x1254b8[_0x0fd4('0x1f')]])){_0x49b899['campaigns'][_0x1254b8[_0x0fd4('0x1f')]]=new Campaign(_0x1254b8);}else{_0x49b899['mergeFromDatabase'](_0x49b899[_0x0fd4('0x11')][_0x1254b8[_0x0fd4('0x1f')]],_0x1254b8);}}}return _0x49b899['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x5efb70=this;return function(_0x21f567){if(_0x21f567){freeIsNotKey(_0x21f567,_0x5efb70['voiceExtensions'],'id');for(var _0xcdb0d8=0x0,_0x7a30d0={};_0xcdb0d8<_0x21f567[_0x0fd4('0x3b')];_0xcdb0d8+=0x1){_0x7a30d0=_0x21f567[_0xcdb0d8];if(_[_0x0fd4('0x3d')](_0x5efb70[_0x0fd4('0x63')][_0x7a30d0['id']])){_0x5efb70[_0x0fd4('0x63')][_0x7a30d0['id']]=new VoiceExtension(_0x7a30d0);}else{_0x5efb70[_0x0fd4('0x39')](_0x5efb70[_0x0fd4('0x63')][_0x7a30d0['id']],_0x7a30d0);}}}return _0x5efb70[_0x0fd4('0x63')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x64')]=function(){var _0x44c211=this;return function(_0x21e30b){clearCampaigns(_0x44c211[_0x0fd4('0x11')]);for(var _0x581d72=0x0;_0x581d72<_0x21e30b[_0x0fd4('0x3b')];_0x581d72+=0x1){_[_0x0fd4('0x4f')](_0x44c211['campaigns'][_0x21e30b[_0x581d72][_0x0fd4('0x1f')]],_0x21e30b[_0x581d72]);}return _0x44c211[_0x0fd4('0x11')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x65')]=function(){var _0xbf61c2=this;return function(_0x5b08e3){if(_0x5b08e3){freeIsNotKey(_0x5b08e3,_0xbf61c2[_0x0fd4('0x1d')],'id');for(var _0x2e2b87=0x0,_0x1e46b3={},_0x47047c={};_0x2e2b87<_0x5b08e3[_0x0fd4('0x3b')];_0x2e2b87+=0x1){_0x1e46b3=_0x5b08e3[_0x2e2b87];if(_[_0x0fd4('0x3d')](_0xbf61c2[_0x0fd4('0x1d')][_0x1e46b3['id']])){_0xbf61c2[_0x0fd4('0x1d')][_0x1e46b3['id']]=new FaxAccount(_0x1e46b3);}else{_0xbf61c2[_0x0fd4('0x39')](_0xbf61c2[_0x0fd4('0x1d')][_0x1e46b3['id']],_0x1e46b3);}}}return _0xbf61c2['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file +var _0x0fff=['agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','initTriggers','triggers','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initVoiceExtensions','merge','initFaxAccounts','exports','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount'];(function(_0x2735d2,_0x152e29){var _0x44f018=function(_0x3038ef){while(--_0x3038ef){_0x2735d2['push'](_0x2735d2['shift']());}};_0x44f018(++_0x152e29);}(_0x0fff,0x136));var _0xf0ff=function(_0x620305,_0x2401dc){_0x620305=_0x620305-0x0;var _0x240f5c=_0x0fff[_0x620305];return _0x240f5c;};'use strict';var BPromise=require(_0xf0ff('0x0'));var util=require(_0xf0ff('0x1'));var _=require(_0xf0ff('0x2'));var moment=require(_0xf0ff('0x3'));var Agent=require(_0xf0ff('0x4'));var Telephone=require(_0xf0ff('0x5'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xf0ff('0x6'));var Trigger=require('../model/trigger');var Template=require(_0xf0ff('0x7'));var Campaign=require(_0xf0ff('0x8'));var VoiceExtension=require(_0xf0ff('0x9'));var ZendeskAccount=require(_0xf0ff('0xa'));var SalesforceAccount=require(_0xf0ff('0xb'));var FreshdeskAccount=require(_0xf0ff('0xc'));var SugarcrmAccount=require(_0xf0ff('0xd'));var ZohoAccount=require(_0xf0ff('0xe'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf0ff('0xf'));var ServicenowAccount=require(_0xf0ff('0x10'));var Dynamics365Account=require(_0xf0ff('0x11'));var FreshsalesAccount=require(_0xf0ff('0x12'));var FaxAccount=require(_0xf0ff('0x13'));var Realtime=function(){this[_0xf0ff('0x14')]={};this[_0xf0ff('0x15')]={};this[_0xf0ff('0x16')]={};this[_0xf0ff('0x17')]={};this['triggers']={};this[_0xf0ff('0x18')]={};this[_0xf0ff('0x19')]={};this[_0xf0ff('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xf0ff('0x1b')]={};this[_0xf0ff('0x1c')]={};this[_0xf0ff('0x1d')]={};this[_0xf0ff('0x1e')]={};this[_0xf0ff('0x1f')]={};this[_0xf0ff('0x20')]={};this['salesforceAccounts']={};this[_0xf0ff('0x21')]={};this[_0xf0ff('0x22')]={};this[_0xf0ff('0x23')]={};this[_0xf0ff('0x24')]={};this[_0xf0ff('0x25')]={};this[_0xf0ff('0x26')]={};this[_0xf0ff('0x27')]={};this[_0xf0ff('0x28')]={};this[_0xf0ff('0x29')]={};};function freeIsNotKey(_0x4f56ce,_0x1bbd89,_0x2fa21c){var _0x31c244=_[_0xf0ff('0x2a')](_0x4f56ce,function(_0x2fe5a7,_0x9ca82a){return _0x2fe5a7[_0x2fa21c];});for(var _0x3a062e in _0x1bbd89){if(_0x1bbd89[_0xf0ff('0x2b')](_0x3a062e)){if(!_0x31c244[_0x3a062e]){delete _0x1bbd89[_0x3a062e];}}}}function freeIsNotKeySip(_0x55b973,_0x23661f){var _0x20c528=_[_0xf0ff('0x2a')](_0x55b973,function(_0xa6a3a4,_0x4b6471){return util[_0xf0ff('0x2c')](_0xf0ff('0x2d'),_0xa6a3a4[_0xf0ff('0x2e')]);});for(var _0x59899d in _0x23661f){if(_0x23661f[_0xf0ff('0x2b')](_0x59899d)){if(!_0x20c528[_0x59899d]){delete _0x23661f[_0x59899d];}}}}function freeIsNotKeyAgent(_0x1453fc,_0x22c107){var _0x3de097=_[_0xf0ff('0x2a')](_0x1453fc,function(_0x316465,_0x3a3d18){var _0x38fc15=_[_0xf0ff('0x2f')](_0x316465['interface'])?util['format'](_0xf0ff('0x2d'),_0x316465[_0xf0ff('0x2e')]):_0x316465[_0xf0ff('0x30')];return _0x38fc15;});for(var _0xa61752 in _0x22c107){if(_0x22c107[_0xf0ff('0x2b')](_0xa61752)){if(!_0x3de097[_0xa61752]){delete _0x22c107[_0xa61752];}}}}function clearVoiceCallReports(_0x2da8b7){_0x2da8b7[_0xf0ff('0x31')]=0x0;_0x2da8b7[_0xf0ff('0x32')]=0x0;_0x2da8b7[_0xf0ff('0x33')]=0x0;_0x2da8b7['sumDuration']=0x0;_0x2da8b7['sumBillable']=0x0;}function clearCampaigns(_0x177bec){if(!_[_0xf0ff('0x34')](_0x177bec)){for(var _0x5a0229 in _0x177bec){if(_0x177bec[_0xf0ff('0x2b')](_0x5a0229)){_0x177bec[_0x5a0229][_0xf0ff('0x35')]=0x0;_0x177bec[_0x5a0229][_0xf0ff('0x36')]=0x0;}}}}function clearVoiceQueues(_0x2b61bb){if(!_['isEmpty'](_0x2b61bb)){for(var _0x4ef02f in _0x2b61bb){if(_0x2b61bb[_0xf0ff('0x2b')](_0x4ef02f)){_0x2b61bb[_0x4ef02f][_0xf0ff('0x31')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x32')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x37')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x38')]=0x0;_0x2b61bb[_0x4ef02f]['sumHoldTime']=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x39')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x3a')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x3b')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x3c')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x3d')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x3e')]=0x0;_0x2b61bb[_0x4ef02f]['outboundNoSuchCallsDay']=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x3f')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x40')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x41')]=0x0;_0x2b61bb[_0x4ef02f]['outboundBlacklistCallsDay']=0x0;_0x2b61bb[_0x4ef02f]['outboundOriginateFailureCallsDay']=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x42')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x43')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x3b')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x44')]=0x0;_0x2b61bb[_0x4ef02f][_0xf0ff('0x45')]=!![];}}}}Realtime[_0xf0ff('0x46')][_0xf0ff('0x47')]=function(_0x4ea29a,_0x457236){for(var _0x1b5294 in _0x457236){if(_0x4ea29a[_0xf0ff('0x2b')](_0x1b5294)){_0x4ea29a[_0x1b5294]=_0x457236[_0x1b5294];}}};Realtime[_0xf0ff('0x46')][_0xf0ff('0x48')]=function(){var _0x3fb861=this;return function(_0x4453d4){if(_0x4453d4){freeIsNotKeyAgent(_0x4453d4,_0x3fb861['agents']);for(var _0xea23be=0x0,_0x5acbf3={},_0x3ff2e1={};_0xea23be<_0x4453d4[_0xf0ff('0x49')];_0xea23be+=0x1){_0x5acbf3=_0x4453d4[_0xea23be];var _0x37cf19=_['isNil'](_0x5acbf3[_0xf0ff('0x30')])?util[_0xf0ff('0x2c')](_0xf0ff('0x2d'),_0x5acbf3[_0xf0ff('0x2e')]):_0x5acbf3['interface'];if(_[_0xf0ff('0x4a')](_0x3fb861[_0xf0ff('0x14')][_0x37cf19])){_0x3fb861[_0xf0ff('0x14')][_0x37cf19]=new Agent(_0x5acbf3);}else{_0x3fb861[_0xf0ff('0x47')](_0x3fb861[_0xf0ff('0x14')][_0x37cf19],_0x5acbf3);}}}return _0x3fb861[_0xf0ff('0x14')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x4b')]=function(){var _0x5a7c8e=this;return function(_0x28c47e){if(_0x28c47e){freeIsNotKeySip(_0x28c47e,_0x5a7c8e[_0xf0ff('0x15')]);for(var _0x237a33=0x0,_0x36ec98={},_0x3301cf={};_0x237a33<_0x28c47e[_0xf0ff('0x49')];_0x237a33+=0x1){_0x36ec98=_0x28c47e[_0x237a33];if(_[_0xf0ff('0x4a')](_0x5a7c8e[_0xf0ff('0x15')][util[_0xf0ff('0x2c')]('SIP/%s',_0x36ec98['name'])])){_0x5a7c8e[_0xf0ff('0x15')][util[_0xf0ff('0x2c')](_0xf0ff('0x2d'),_0x36ec98[_0xf0ff('0x2e')])]=new Telephone(_0x36ec98);}else{_0x5a7c8e[_0xf0ff('0x47')](_0x5a7c8e[_0xf0ff('0x15')][util[_0xf0ff('0x2c')](_0xf0ff('0x2d'),_0x36ec98[_0xf0ff('0x2e')])],_0x36ec98);}}}return _0x5a7c8e[_0xf0ff('0x15')];};};Realtime[_0xf0ff('0x46')]['initTrunks']=function(){var _0x576bff=this;return function(_0x2409bf){if(_0x2409bf){freeIsNotKeySip(_0x2409bf,_0x576bff[_0xf0ff('0x16')]);for(var _0x55f1be=0x0,_0x3a2567={},_0x12f8f4={};_0x55f1be<_0x2409bf['length'];_0x55f1be+=0x1){_0x3a2567=_0x2409bf[_0x55f1be];if(_['isUndefined'](_0x576bff[_0xf0ff('0x16')][util[_0xf0ff('0x2c')]('SIP/%s',_0x3a2567['name'])])){_0x576bff[_0xf0ff('0x16')][util['format']('SIP/%s',_0x3a2567['name'])]=new Trunk(_0x3a2567);}else{_0x576bff[_0xf0ff('0x47')](_0x576bff[_0xf0ff('0x16')][util[_0xf0ff('0x2c')]('SIP/%s',_0x3a2567[_0xf0ff('0x2e')])],_0x3a2567);}}}return _0x576bff[_0xf0ff('0x16')];};};Realtime[_0xf0ff('0x46')]['initVoiceQueues']=function(){var _0x2a85ec=this;return function(_0x29bf0d){if(_0x29bf0d){freeIsNotKey(_0x29bf0d,_0x2a85ec[_0xf0ff('0x17')],_0xf0ff('0x2e'));for(var _0x5e9c4c=0x0,_0xbe2fae={},_0x303315={};_0x5e9c4c<_0x29bf0d[_0xf0ff('0x49')];_0x5e9c4c+=0x1){_0xbe2fae=_0x29bf0d[_0x5e9c4c];if(_[_0xf0ff('0x4a')](_0x2a85ec[_0xf0ff('0x17')][_0xbe2fae[_0xf0ff('0x2e')]])){_0x2a85ec['voiceQueues'][_0xbe2fae[_0xf0ff('0x2e')]]=new VoiceQueue(_0xbe2fae);}else{_0x2a85ec[_0xf0ff('0x47')](_0x2a85ec[_0xf0ff('0x17')][_0xbe2fae[_0xf0ff('0x2e')]],_0xbe2fae);}}}return _0x2a85ec[_0xf0ff('0x17')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x4c')]=function(){var _0x4abe34=this;return function(_0x21bb6d){if(_0x21bb6d){freeIsNotKey(_0x21bb6d,_0x4abe34[_0xf0ff('0x4d')],'id');for(var _0x7367d1=0x0,_0x45991d={},_0x16401c={};_0x7367d1<_0x21bb6d[_0xf0ff('0x49')];_0x7367d1+=0x1){_0x45991d=_0x21bb6d[_0x7367d1];if(_['isUndefined'](_0x4abe34['triggers'][_0x45991d['id']])){_0x4abe34[_0xf0ff('0x4d')][_0x45991d['id']]=new Trigger(_0x45991d);}else{_0x4abe34['mergeFromDatabase'](_0x4abe34[_0xf0ff('0x4d')][_0x45991d['id']],_0x45991d);}}}return _0x4abe34[_0xf0ff('0x4d')];};};Realtime[_0xf0ff('0x46')]['initTemplates']=function(){var _0x43e3bf=this;return function(_0x3bbee2){if(_0x3bbee2){freeIsNotKey(_0x3bbee2,_0x43e3bf[_0xf0ff('0x19')],'id');for(var _0x57e7bf=0x0,_0x1d2ceb={},_0x30922e={};_0x57e7bf<_0x3bbee2[_0xf0ff('0x49')];_0x57e7bf+=0x1){_0x1d2ceb=_0x3bbee2[_0x57e7bf];if(_[_0xf0ff('0x4a')](_0x43e3bf[_0xf0ff('0x19')][_0x1d2ceb['id']])){_0x43e3bf[_0xf0ff('0x19')][_0x1d2ceb['id']]=new Template(_0x1d2ceb);}else{_0x43e3bf[_0xf0ff('0x47')](_0x43e3bf[_0xf0ff('0x19')][_0x1d2ceb['id']],_0x1d2ceb);}}}return _0x43e3bf['templates'];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x4e')]=function(){var _0x38e57f=this;return function(_0x57487a){if(_0x57487a){freeIsNotKey(_0x57487a,_0x38e57f[_0xf0ff('0x20')],'id');for(var _0x5d143d=0x0,_0x2f748b={},_0x4dac4c={};_0x5d143d<_0x57487a['length'];_0x5d143d+=0x1){_0x2f748b=_0x57487a[_0x5d143d];if(_[_0xf0ff('0x4a')](_0x38e57f['zendeskAccounts'][_0x2f748b['id']])){_0x38e57f['zendeskAccounts'][_0x2f748b['id']]=new ZendeskAccount(_0x2f748b);}else{_0x38e57f['mergeFromDatabase'](_0x38e57f[_0xf0ff('0x20')][_0x2f748b['id']],_0x2f748b);}}}return _0x38e57f[_0xf0ff('0x20')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x4f')]=function(){var _0x25eab3=this;return function(_0x367f21){if(_0x367f21){freeIsNotKey(_0x367f21,_0x25eab3['salesforceAccounts'],'id');for(var _0xe84373=0x0,_0x58437b={},_0x165e6c={};_0xe84373<_0x367f21[_0xf0ff('0x49')];_0xe84373+=0x1){_0x58437b=_0x367f21[_0xe84373];if(_['isUndefined'](_0x25eab3[_0xf0ff('0x50')][_0x58437b['id']])){_0x25eab3[_0xf0ff('0x50')][_0x58437b['id']]=new SalesforceAccount(_0x58437b);}else{_0x25eab3[_0xf0ff('0x47')](_0x25eab3['salesforceAccounts'][_0x58437b['id']],_0x58437b);}}}return _0x25eab3['salesforceAccounts'];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x51')]=function(){var _0x4a07e3=this;return function(_0x3edea0){if(_0x3edea0){freeIsNotKey(_0x3edea0,_0x4a07e3['freshdeskAccounts'],'id');for(var _0x449e3f=0x0,_0x56b8bd={},_0x23233f={};_0x449e3f<_0x3edea0[_0xf0ff('0x49')];_0x449e3f+=0x1){_0x56b8bd=_0x3edea0[_0x449e3f];if(_[_0xf0ff('0x4a')](_0x4a07e3['freshdeskAccounts'][_0x56b8bd['id']])){_0x4a07e3[_0xf0ff('0x22')][_0x56b8bd['id']]=new FreshdeskAccount(_0x56b8bd);}else{_0x4a07e3[_0xf0ff('0x47')](_0x4a07e3[_0xf0ff('0x22')][_0x56b8bd['id']],_0x56b8bd);}}}return _0x4a07e3[_0xf0ff('0x22')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x52')]=function(){var _0x3f3ebe=this;return function(_0x5824ea){if(_0x5824ea){freeIsNotKey(_0x5824ea,_0x3f3ebe['zohoAccounts'],'id');for(var _0x3d670d=0x0,_0x542946={},_0x47ff49={};_0x3d670d<_0x5824ea[_0xf0ff('0x49')];_0x3d670d+=0x1){_0x542946=_0x5824ea[_0x3d670d];if(_[_0xf0ff('0x4a')](_0x3f3ebe[_0xf0ff('0x23')][_0x542946['id']])){_0x3f3ebe[_0xf0ff('0x23')][_0x542946['id']]=new ZohoAccount(_0x542946);}else{_0x3f3ebe['mergeFromDatabase'](_0x3f3ebe[_0xf0ff('0x23')][_0x542946['id']],_0x542946);}}}return _0x3f3ebe[_0xf0ff('0x23')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x53')]=function(){var _0x38b1ec=this;return function(_0x58e3a9){if(_0x58e3a9){freeIsNotKey(_0x58e3a9,_0x38b1ec[_0xf0ff('0x24')],'id');for(var _0x4f0498=0x0,_0xf81e82={},_0x3e75cb={};_0x4f0498<_0x58e3a9['length'];_0x4f0498+=0x1){_0xf81e82=_0x58e3a9[_0x4f0498];if(_[_0xf0ff('0x4a')](_0x38b1ec['deskAccounts'][_0xf81e82['id']])){_0x38b1ec[_0xf0ff('0x24')][_0xf81e82['id']]=new DeskAccount(_0xf81e82);}else{_0x38b1ec[_0xf0ff('0x47')](_0x38b1ec['deskAccounts'][_0xf81e82['id']],_0xf81e82);}}}return _0x38b1ec[_0xf0ff('0x24')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x54')]=function(){var _0x39946b=this;return function(_0x140f86){if(_0x140f86){freeIsNotKey(_0x140f86,_0x39946b[_0xf0ff('0x21')],'id');for(var _0x39b6e1=0x0,_0x40e3b9={},_0x21b3f4={};_0x39b6e1<_0x140f86[_0xf0ff('0x49')];_0x39b6e1+=0x1){_0x40e3b9=_0x140f86[_0x39b6e1];if(_[_0xf0ff('0x4a')](_0x39946b[_0xf0ff('0x21')][_0x40e3b9['id']])){_0x39946b['sugarcrmAccounts'][_0x40e3b9['id']]=new SugarcrmAccount(_0x40e3b9);}else{_0x39946b[_0xf0ff('0x47')](_0x39946b[_0xf0ff('0x21')][_0x40e3b9['id']],_0x40e3b9);}}}return _0x39946b['sugarcrmAccounts'];};};Realtime['prototype']['initVtigerAccounts']=function(){var _0x15ae6a=this;return function(_0xcbf8fb){if(_0xcbf8fb){freeIsNotKey(_0xcbf8fb,_0x15ae6a[_0xf0ff('0x25')],'id');for(var _0x229b47=0x0,_0x4d6200={},_0x26f244={};_0x229b47<_0xcbf8fb[_0xf0ff('0x49')];_0x229b47+=0x1){_0x4d6200=_0xcbf8fb[_0x229b47];if(_[_0xf0ff('0x4a')](_0x15ae6a['vtigerAccounts'][_0x4d6200['id']])){_0x15ae6a['vtigerAccounts'][_0x4d6200['id']]=new VtigerAccount(_0x4d6200);}else{_0x15ae6a['mergeFromDatabase'](_0x15ae6a[_0xf0ff('0x25')][_0x4d6200['id']],_0x4d6200);}}}return _0x15ae6a['vtigerAccounts'];};};Realtime['prototype'][_0xf0ff('0x55')]=function(){var _0x30ad85=this;return function(_0x1b0e31){if(_0x1b0e31){freeIsNotKey(_0x1b0e31,_0x30ad85['servicenowAccounts'],'id');for(var _0x3fc80f=0x0,_0x5da3bb={},_0x830463={};_0x3fc80f<_0x1b0e31[_0xf0ff('0x49')];_0x3fc80f+=0x1){_0x5da3bb=_0x1b0e31[_0x3fc80f];if(_[_0xf0ff('0x4a')](_0x30ad85[_0xf0ff('0x26')][_0x5da3bb['id']])){_0x30ad85[_0xf0ff('0x26')][_0x5da3bb['id']]=new ServicenowAccount(_0x5da3bb);}else{_0x30ad85[_0xf0ff('0x47')](_0x30ad85[_0xf0ff('0x26')][_0x5da3bb['id']],_0x5da3bb);}}}return _0x30ad85[_0xf0ff('0x26')];};};Realtime[_0xf0ff('0x46')]['initDynamics365Accounts']=function(){var _0x489d40=this;return function(_0x4d6e9a){if(_0x4d6e9a){freeIsNotKey(_0x4d6e9a,_0x489d40[_0xf0ff('0x27')],'id');for(var _0x3dcd41=0x0,_0xecb1f={},_0x143c99={};_0x3dcd41<_0x4d6e9a[_0xf0ff('0x49')];_0x3dcd41+=0x1){_0xecb1f=_0x4d6e9a[_0x3dcd41];if(_['isUndefined'](_0x489d40[_0xf0ff('0x27')][_0xecb1f['id']])){_0x489d40['dynamics365Accounts'][_0xecb1f['id']]=new Dynamics365Account(_0xecb1f);}else{_0x489d40[_0xf0ff('0x47')](_0x489d40[_0xf0ff('0x27')][_0xecb1f['id']],_0xecb1f);}}}return _0x489d40['dynamics365Accounts'];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x56')]=function(){var _0x3b6cb4=this;return function(_0x2bc527){if(_0x2bc527){freeIsNotKey(_0x2bc527,_0x3b6cb4['freshsalesAccounts'],'id');for(var _0x27b95f=0x0,_0xf29de3={},_0x504300={};_0x27b95f<_0x2bc527[_0xf0ff('0x49')];_0x27b95f+=0x1){_0xf29de3=_0x2bc527[_0x27b95f];if(_[_0xf0ff('0x4a')](_0x3b6cb4[_0xf0ff('0x28')][_0xf29de3['id']])){_0x3b6cb4[_0xf0ff('0x28')][_0xf29de3['id']]=new FreshsalesAccount(_0xf29de3);}else{_0x3b6cb4['mergeFromDatabase'](_0x3b6cb4['freshsalesAccounts'][_0xf29de3['id']],_0xf29de3);}}}return _0x3b6cb4['freshsalesAccounts'];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x57')]=function(){var _0x33e23f=this;return function(_0x16311d){for(var _0x1aa888=0x0;_0x1aa888<_0x16311d[_0xf0ff('0x49')];_0x1aa888+=0x1){_['merge'](_0x33e23f[_0xf0ff('0x17')][_0x16311d[_0x1aa888]['name']],_0x16311d[_0x1aa888]);}return _0x33e23f[_0xf0ff('0x17')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x58')]=function(){var _0x43ccdc=this;return function(_0x31cb25){clearVoiceQueues(_0x43ccdc[_0xf0ff('0x17')]);if(_0x31cb25){_0x31cb25=_[_0xf0ff('0x59')](_0x31cb25,_0xf0ff('0x5a'));for(var _0x28d3c5 in _0x31cb25){if(_0x31cb25[_0xf0ff('0x2b')](_0x28d3c5)){var _0x4d97e5={};for(var _0x359b2f=0x0;_0x359b2f<_0x31cb25[_0x28d3c5][_0xf0ff('0x49')];_0x359b2f+=0x1){var _0x99abca=_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x5b')];if(_0x43ccdc[_0xf0ff('0x17')][_0x99abca]){if(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x5c')]){_0x43ccdc[_0xf0ff('0x17')][_0x99abca][_0xf0ff('0x37')]+=0x1;}if(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x5d')]){_0x43ccdc[_0xf0ff('0x17')][_0x99abca][_0xf0ff('0x38')]+=0x1;}_0x43ccdc['voiceQueues'][_0x99abca]['sumHoldTime']+=moment(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x5e')])[_0xf0ff('0x5f')](moment(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x60')]),_0xf0ff('0x61'))||0x0;if(_0x359b2f===_0x31cb25[_0x28d3c5][_0xf0ff('0x49')]-0x1){_0x43ccdc[_0xf0ff('0x17')][_0x99abca][_0xf0ff('0x39')]+=moment(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x62')]||_0x31cb25[_0x28d3c5][_0x359b2f]['queuecallerabandonAt']||_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x63')])[_0xf0ff('0x5f')](moment(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x60')]),_0xf0ff('0x61'))||0x0;_0x43ccdc[_0xf0ff('0x17')][_0x99abca][_0xf0ff('0x31')]+=0x1;if(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x64')]){_0x43ccdc[_0xf0ff('0x17')][_0x99abca][_0xf0ff('0x32')]+=0x1;_0x43ccdc[_0xf0ff('0x17')][_0x99abca][_0xf0ff('0x3a')]+=moment(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x62')])[_0xf0ff('0x5f')](moment(_0x31cb25[_0x28d3c5][_0x359b2f][_0xf0ff('0x5e')]),_0xf0ff('0x61'))||0x0;}}else{_0x43ccdc['voiceQueues'][_0x99abca][_0xf0ff('0x39')]+=_0x43ccdc['voiceQueues'][_0x99abca][_0xf0ff('0x33')]||0x0;}}}}}}return _0x43ccdc[_0xf0ff('0x17')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x65')]=function(){var _0x47bd76=this;return function(_0x580ba0){clearVoiceCallReports(_0x47bd76['outbound']);if(_0x580ba0){for(var _0x56e4=0x0;_0x56e4<_0x580ba0[_0xf0ff('0x49')];_0x56e4+=0x1){_0x47bd76[_0xf0ff('0x1a')][_0xf0ff('0x31')]+=0x1;_0x47bd76[_0xf0ff('0x1a')][_0xf0ff('0x39')]+=_0x580ba0[_0x56e4][_0xf0ff('0x66')];if(_0x580ba0[_0x56e4][_0xf0ff('0x67')]===_0xf0ff('0x68')){_0x47bd76['outbound'][_0xf0ff('0x32')]+=0x1;_0x47bd76[_0xf0ff('0x1a')]['sumHoldTime']+=_0x580ba0[_0x56e4]['duration']-_0x580ba0[_0x56e4]['billableseconds']||0x0;_0x47bd76['outbound'][_0xf0ff('0x3a')]+=_0x580ba0[_0x56e4][_0xf0ff('0x69')];}}}return _0x47bd76[_0xf0ff('0x1a')];};};Realtime[_0xf0ff('0x46')]['initCampaigns']=function(){var _0x27ecc8=this;return function(_0x3c831e){if(_0x3c831e){freeIsNotKey(_0x3c831e,_0x27ecc8['campaigns'],'name');for(var _0x1e2eae=0x0,_0x39fba6={};_0x1e2eae<_0x3c831e[_0xf0ff('0x49')];_0x1e2eae+=0x1){_0x39fba6=_0x3c831e[_0x1e2eae];if(_[_0xf0ff('0x4a')](_0x27ecc8['campaigns'][_0x39fba6[_0xf0ff('0x2e')]])){_0x27ecc8[_0xf0ff('0x18')][_0x39fba6[_0xf0ff('0x2e')]]=new Campaign(_0x39fba6);}else{_0x27ecc8[_0xf0ff('0x47')](_0x27ecc8[_0xf0ff('0x18')][_0x39fba6[_0xf0ff('0x2e')]],_0x39fba6);}}}return _0x27ecc8[_0xf0ff('0x18')];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x6a')]=function(){var _0x4e2173=this;return function(_0x3485c3){if(_0x3485c3){freeIsNotKey(_0x3485c3,_0x4e2173['voiceExtensions'],'id');for(var _0x4ff901=0x0,_0x40748c={};_0x4ff901<_0x3485c3[_0xf0ff('0x49')];_0x4ff901+=0x1){_0x40748c=_0x3485c3[_0x4ff901];if(_['isUndefined'](_0x4e2173[_0xf0ff('0x1b')][_0x40748c['id']])){_0x4e2173['voiceExtensions'][_0x40748c['id']]=new VoiceExtension(_0x40748c);}else{_0x4e2173['mergeFromDatabase'](_0x4e2173[_0xf0ff('0x1b')][_0x40748c['id']],_0x40748c);}}}return _0x4e2173[_0xf0ff('0x1b')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0x2df763=this;return function(_0x18486a){clearCampaigns(_0x2df763[_0xf0ff('0x18')]);for(var _0x28dd39=0x0;_0x28dd39<_0x18486a[_0xf0ff('0x49')];_0x28dd39+=0x1){_[_0xf0ff('0x6b')](_0x2df763[_0xf0ff('0x18')][_0x18486a[_0x28dd39][_0xf0ff('0x2e')]],_0x18486a[_0x28dd39]);}return _0x2df763['campaigns'];};};Realtime[_0xf0ff('0x46')][_0xf0ff('0x6c')]=function(){var _0x272820=this;return function(_0x18c838){if(_0x18c838){freeIsNotKey(_0x18c838,_0x272820[_0xf0ff('0x29')],'id');for(var _0x5b6f22=0x0,_0x3661aa={},_0x40b444={};_0x5b6f22<_0x18c838[_0xf0ff('0x49')];_0x5b6f22+=0x1){_0x3661aa=_0x18c838[_0x5b6f22];if(_[_0xf0ff('0x4a')](_0x272820[_0xf0ff('0x29')][_0x3661aa['id']])){_0x272820[_0xf0ff('0x29')][_0x3661aa['id']]=new FaxAccount(_0x3661aa);}else{_0x272820['mergeFromDatabase'](_0x272820[_0xf0ff('0x29')][_0x3661aa['id']],_0x3661aa);}}}return _0x272820[_0xf0ff('0x29')];};};module[_0xf0ff('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 8c8ffa8..db391ca 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 _0x074b=['agents','telephones','prototype','disabled','custom:voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','find','accountcode','name','format','SIP/%s','voiceQueueReport','length','findAgent','connectedlinenum','assigned','interface','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','create','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','startsWith','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','util','../../../config/logger','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceDialReport','./userReport','realtime'];(function(_0x4eebc2,_0x1e0d02){var _0x3eb029=function(_0x12030b){while(--_0x12030b){_0x4eebc2['push'](_0x4eebc2['shift']());}};_0x3eb029(++_0x1e0d02);}(_0x074b,0x132));var _0xb074=function(_0x1f6a8f,_0xbbcdc7){_0x1f6a8f=_0x1f6a8f-0x0;var _0x3f6944=_0x074b[_0x1f6a8f];return _0x3f6944;};'use strict';var BPromise=require('bluebird');var _=require(_0xb074('0x0'));var moment=require(_0xb074('0x1'));var util=require(_0xb074('0x2'));var config=require('../../../config/environment');var logger=require(_0xb074('0x3'))('ami');var ami=require(_0xb074('0x4'));var RpcVoiceAgentReport=require(_0xb074('0x5'));var RpcVoiceCallReport=require(_0xb074('0x6'));var RpcVoiceDialReport=require(_0xb074('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xb074('0x8'));var RpcVoiceRecording=require(_0xb074('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xb074('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xb074('0xb'));var UserReport=require(_0xb074('0xc'));function Report(_0x20e7b0){this[_0xb074('0xd')]=_0x20e7b0;this[_0xb074('0xe')]=_0x20e7b0['agents'];this[_0xb074('0xf')]=_0x20e7b0[_0xb074('0xf')];}Report[_0xb074('0x10')]['sync']=function(_0x51ccb6){var _0x22ddab=new VoiceQueueReport(this[_0xb074('0xd')]);var _0x4ccea1=new VoiceAgentReport(this['realtime']);var _0x2580f9=new VoiceDialReport(this[_0xb074('0xd')]);var _0x329bb8=new VoiceCallReport(this[_0xb074('0xd')]);var _0x51098e=new UserReport(this['realtime']);if(config['xdr']&&config['xdr'][_0xb074('0x11')]){ami['on'](_0xb074('0x12'),this['voiceQueueReport'][_0xb074('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport']['bind'](this));ami['on'](_0xb074('0x14'),this[_0xb074('0x15')]['bind'](this));ami['on'](_0xb074('0x16'),this[_0xb074('0x17')][_0xb074('0x13')](this));ami['on'](_0xb074('0x18'),this[_0xb074('0x19')][_0xb074('0x13')](this));ami['on']('attendedtransfer',this[_0xb074('0x1a')]['bind'](this));}};Report[_0xb074('0x10')]['findAgent']=function(_0x10b6ae){var _0x1fab21=undefined;_0x1fab21=_[_0xb074('0x1b')](this[_0xb074('0xe')],function(_0x584d45){return _0x584d45[_0xb074('0x1c')]==_0x10b6ae||_0x584d45[_0xb074('0x1d')]==_0x10b6ae;});if(_['isNil'](_0x1fab21)){var _0x564481=_[_0xb074('0x1b')](this[_0xb074('0xf')],function(_0x5b5398){return _0x5b5398[_0xb074('0x1c')]==_0x10b6ae||_0x5b5398[_0xb074('0x1d')]==_0x10b6ae;});if(_0x564481){_0x1fab21=_[_0xb074('0x1b')](this[_0xb074('0xe')],function(_0x1b443f){return _0x1b443f['interface']==util[_0xb074('0x1e')](_0xb074('0x1f'),_0x564481[_0xb074('0x1d')]);});}}return _0x1fab21;};Report[_0xb074('0x10')][_0xb074('0x20')]=function(_0xe7ff3f){for(var _0x59ea49=0x0;_0x59ea49<_0xe7ff3f[_0xb074('0x21')];_0x59ea49+=0x1){var _0xbf8f5d=this[_0xb074('0x22')](_0xe7ff3f[_0x59ea49][_0xb074('0x23')]);if(_0xbf8f5d){_0xe7ff3f[_0x59ea49]['accountcode']=_0xbf8f5d['accountcode'];_0xe7ff3f[_0x59ea49][_0xb074('0x24')]=!![];_0xe7ff3f[_0x59ea49]['lastAssignedTo']=_0xbf8f5d[_0xb074('0x1d')];_0xe7ff3f[_0x59ea49][_0xb074('0x25')]=_[_0xb074('0x26')](_0xbf8f5d[_0xb074('0x25')])?util[_0xb074('0x1e')]('SIP/%s',_0xbf8f5d[_0xb074('0x1d')]):_0xbf8f5d[_0xb074('0x25')];if(_0xe7ff3f[_0x59ea49][_0xb074('0x27')]){_0xe7ff3f[_0x59ea49][_0xb074('0x28')]=moment()[_0xb074('0x1e')](_0xb074('0x29'));}if(_0xe7ff3f[_0x59ea49][_0xb074('0x2a')]){_0xe7ff3f[_0x59ea49][_0xb074('0x2b')]=moment()[_0xb074('0x1e')](_0xb074('0x29'));}RpcMemberReport[_0xb074('0x20')](_0xe7ff3f[_0x59ea49]);}RpcVoiceQueueReport['create'](_0xe7ff3f[_0x59ea49]);}};function extractCalleridNumber(_0x1220c0){var _0x1f3d1e=_0x1220c0['match'](/<(.*?)>/);return _0x1f3d1e?_0x1f3d1e[0x1]:_0x1220c0;}Report[_0xb074('0x10')]['voiceCallReport']=function(_0x1aa8ae){_0x1aa8ae[_0xb074('0x2c')]=_0x1aa8ae[_0xb074('0x2c')]||_0x1aa8ae[_0xb074('0x2d')];if(_0x1aa8ae[_0xb074('0x2e')]==_0xb074('0x2f')){_0x1aa8ae[_0xb074('0x30')]=_0xb074('0x31');_0x1aa8ae[_0xb074('0x32')]=_0x1aa8ae[_0xb074('0x31')];if(_0x1aa8ae[_0xb074('0x33')]==_0xb074('0x34')){_0x1aa8ae[_0xb074('0x1c')]='';_0x1aa8ae[_0xb074('0x2c')]=extractCalleridNumber(_0x1aa8ae['callerid']);}else if(_0x1aa8ae[_0xb074('0x33')]==_0xb074('0x35')){if(_0x1aa8ae[_0xb074('0x2c')]==_0xb074('0x36')){_0x1aa8ae[_0xb074('0x2c')]=extractCalleridNumber(_0x1aa8ae[_0xb074('0x37')]);_0x1aa8ae[_0xb074('0x38')]=_0x1aa8ae[_0xb074('0x39')];_0x1aa8ae[_0xb074('0x3a')]=[_0x1aa8ae[_0xb074('0x3b')],_0x1aa8ae[_0xb074('0x3b')]=_0x1aa8ae[_0xb074('0x3a')]][0x0];_0x1aa8ae[_0xb074('0x3c')]=_0x1aa8ae['calleridpreview'];}else{_0x1aa8ae[_0xb074('0x2c')]=_0x1aa8ae[_0xb074('0x38')];_0x1aa8ae['calleridnum']=_0x1aa8ae['originatecalleridnum'];if(_0x1aa8ae[_0xb074('0x3d')]==_0xb074('0x3e')){_0x1aa8ae[_0xb074('0x1c')]=_0x1aa8ae[_0xb074('0x23')];}else{_0x1aa8ae[_0xb074('0x1c')]='';}}}}else{_0x1aa8ae[_0xb074('0x3c')]=util[_0xb074('0x1e')](_0xb074('0x3f'),_0x1aa8ae[_0xb074('0x40')],_0x1aa8ae[_0xb074('0x38')]);}RpcVoiceCallReport[_0xb074('0x41')](_0x1aa8ae);if(_0x1aa8ae[_0xb074('0x42')]){for(var _0x5d28c7=0x0;_0x5d28c7<_0x1aa8ae[_0xb074('0x43')][_0xb074('0x21')];_0x5d28c7+=0x1){_0x1aa8ae[_0xb074('0x44')]=_0x1aa8ae['monitors'][_0x5d28c7]['filename'];_0x1aa8ae[_0xb074('0x45')]=_0x1aa8ae['monitors'][_0x5d28c7][_0xb074('0x45')];if(_0x1aa8ae['exten']=='xcally-motion-preview'){_0x1aa8ae[_0xb074('0x38')]=_0x1aa8ae[_0xb074('0x23')];_0x1aa8ae[_0xb074('0x40')]=_0x1aa8ae[_0xb074('0x46')];_0x1aa8ae['connectedlinenum']=_0x1aa8ae[_0xb074('0x1c')];_0x1aa8ae[_0xb074('0x46')]=_0x1aa8ae[_0xb074('0x47')];_0x1aa8ae['exten']=_0x1aa8ae[_0xb074('0x39')];}else if(_0x1aa8ae[_0xb074('0x2d')]==_0xb074('0x48')){_0x1aa8ae['calleridnum']=_0x1aa8ae[_0xb074('0x2c')];_0x1aa8ae['exten']=_0x1aa8ae[_0xb074('0x39')];}RpcVoiceRecording[_0xb074('0x41')](_0x1aa8ae);}}};Report[_0xb074('0x10')][_0xb074('0x15')]=function(_0xb1b475){if(_['isArray'](_0xb1b475)){_0xb1b475['forEach'](function(_0x2bc3c1){RpcVoiceAgentReport[_0xb074('0x41')](_0x2bc3c1);});}else{RpcVoiceAgentReport[_0xb074('0x41')](_0xb1b475);}};Report[_0xb074('0x10')]['voiceDialReport']=function(_0x29a9cd){RpcVoiceDialReport[_0xb074('0x41')](_0x29a9cd);var _0x35b332=undefined;var _0x25e42c=_0x29a9cd['channel'];if(_[_0xb074('0x49')](_0x25e42c,'Local')){var _0x2562e8=_0x25e42c[_0xb074('0x4a')](_0x25e42c[_0xb074('0x4b')]('/')+0x1,_0x25e42c[_0xb074('0x4b')]('@'));_0x35b332=_['find'](this[_0xb074('0xe')],function(_0x3f20a5){return _0x3f20a5[_0xb074('0x4c')]==_0x2562e8||_0x3f20a5[_0xb074('0x4d')]==_0x2562e8||_0x3f20a5['accountcode']==_0x2562e8;});}else{var _0x2562e8=_0x25e42c[_0xb074('0x4a')](_0x25e42c[_0xb074('0x4b')]('/')+0x1,_0x25e42c[_0xb074('0x4e')]('-'));_0x35b332=this[_0xb074('0x22')](_0x2562e8);}if(_0x35b332){_0x29a9cd[_0xb074('0x25')]=_[_0xb074('0x26')](_0x35b332[_0xb074('0x25')])?util[_0xb074('0x1e')](_0xb074('0x1f'),_0x35b332[_0xb074('0x1d')]):_0x35b332[_0xb074('0x25')];_0x29a9cd[_0xb074('0x47')]=_0x35b332[_0xb074('0x1d')];_0x29a9cd['accountcode']=_0x35b332[_0xb074('0x1c')];RpcMemberReport[_0xb074('0x17')](_0x29a9cd);}};Report[_0xb074('0x10')][_0xb074('0x19')]=function(_0x248cb9){RpcVoiceTransferReport[_0xb074('0x19')](_0x248cb9);};Report[_0xb074('0x10')]['attendedTransfer']=function(_0x4c8edb){RpcVoiceTransferReport['attendedTransfer'](_0x4c8edb);};module[_0xb074('0x4f')]=Report; \ No newline at end of file +var _0x51fe=['./userReport','realtime','agents','telephones','prototype','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','match','destination','type','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','channel','destinationchannel','\x22%s\x22\x20<%s>','create','monitor','monitors','monitorFilename','filename','createdAt','exten','calleridnum','calleridname','connectedlinename','membername','originatecalleridnum','xcally-motion-dialer','forEach','startsWith','Local','substring','indexOf','phone','lastIndexOf','exports','bluebird','lodash','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport'];(function(_0x484166,_0x3068b0){var _0x2dde05=function(_0x79a42b){while(--_0x79a42b){_0x484166['push'](_0x484166['shift']());}};_0x2dde05(++_0x3068b0);}(_0x51fe,0xec));var _0xe51f=function(_0x3964b5,_0x27f9a1){_0x3964b5=_0x3964b5-0x0;var _0x4933cc=_0x51fe[_0x3964b5];return _0x4933cc;};'use strict';var BPromise=require(_0xe51f('0x0'));var _=require(_0xe51f('0x1'));var moment=require('moment');var util=require(_0xe51f('0x2'));var config=require(_0xe51f('0x3'));var logger=require(_0xe51f('0x4'))(_0xe51f('0x5'));var ami=require(_0xe51f('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0xe51f('0x7'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xe51f('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xe51f('0x9'));var RpcVoiceTransferReport=require(_0xe51f('0xa'));var VoiceQueueReport=require(_0xe51f('0xb'));var VoiceCallReport=require(_0xe51f('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xe51f('0xd'));function Report(_0x9c3ce1){this[_0xe51f('0xe')]=_0x9c3ce1;this[_0xe51f('0xf')]=_0x9c3ce1[_0xe51f('0xf')];this['telephones']=_0x9c3ce1[_0xe51f('0x10')];}Report[_0xe51f('0x11')]['sync']=function(_0x3ffa0e){var _0x25abbd=new VoiceQueueReport(this['realtime']);var _0x25fc10=new VoiceAgentReport(this[_0xe51f('0xe')]);var _0x1098cf=new VoiceDialReport(this[_0xe51f('0xe')]);var _0x1f4c12=new VoiceCallReport(this['realtime']);var _0x2c9d24=new UserReport(this['realtime']);if(config[_0xe51f('0x12')]&&config[_0xe51f('0x12')][_0xe51f('0x13')]){ami['on'](_0xe51f('0x14'),this[_0xe51f('0x15')][_0xe51f('0x16')](this));ami['on'](_0xe51f('0x17'),this['voiceCallReport'][_0xe51f('0x16')](this));ami['on'](_0xe51f('0x18'),this[_0xe51f('0x19')]['bind'](this));ami['on'](_0xe51f('0x1a'),this[_0xe51f('0x1b')]['bind'](this));ami['on'](_0xe51f('0x1c'),this[_0xe51f('0x1d')][_0xe51f('0x16')](this));ami['on'](_0xe51f('0x1e'),this[_0xe51f('0x1f')][_0xe51f('0x16')](this));}};Report[_0xe51f('0x11')][_0xe51f('0x20')]=function(_0x4c6f6f){var _0x2c45a6=undefined;_0x2c45a6=_[_0xe51f('0x21')](this['agents'],function(_0x4ffce3){return _0x4ffce3[_0xe51f('0x22')]==_0x4c6f6f||_0x4ffce3['name']==_0x4c6f6f;});if(_[_0xe51f('0x23')](_0x2c45a6)){var _0x3052da=_[_0xe51f('0x21')](this[_0xe51f('0x10')],function(_0x3ef9fc){return _0x3ef9fc[_0xe51f('0x22')]==_0x4c6f6f||_0x3ef9fc[_0xe51f('0x24')]==_0x4c6f6f;});if(_0x3052da){_0x2c45a6=_[_0xe51f('0x21')](this['agents'],function(_0x238a9b){return _0x238a9b['interface']==util[_0xe51f('0x25')](_0xe51f('0x26'),_0x3052da[_0xe51f('0x24')]);});}}return _0x2c45a6;};Report[_0xe51f('0x11')][_0xe51f('0x15')]=function(_0x5aa88){for(var _0x2b63a5=0x0;_0x2b63a5<_0x5aa88[_0xe51f('0x27')];_0x2b63a5+=0x1){var _0x251f04=this[_0xe51f('0x20')](_0x5aa88[_0x2b63a5][_0xe51f('0x28')]);if(_0x251f04){_0x5aa88[_0x2b63a5]['accountcode']=_0x251f04['accountcode'];_0x5aa88[_0x2b63a5][_0xe51f('0x29')]=!![];_0x5aa88[_0x2b63a5][_0xe51f('0x2a')]=_0x251f04[_0xe51f('0x24')];_0x5aa88[_0x2b63a5][_0xe51f('0x2b')]=_[_0xe51f('0x23')](_0x251f04[_0xe51f('0x2b')])?util['format'](_0xe51f('0x26'),_0x251f04[_0xe51f('0x24')]):_0x251f04[_0xe51f('0x2b')];if(_0x5aa88[_0x2b63a5]['queuecallercomplete']){_0x5aa88[_0x2b63a5][_0xe51f('0x2c')]=moment()[_0xe51f('0x25')](_0xe51f('0x2d'));}if(_0x5aa88[_0x2b63a5]['queuecallerexit']){_0x5aa88[_0x2b63a5][_0xe51f('0x2e')]=moment()[_0xe51f('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xe51f('0x15')](_0x5aa88[_0x2b63a5]);}RpcVoiceQueueReport['create'](_0x5aa88[_0x2b63a5]);}};function extractCalleridNumber(_0x1b201b){var _0x3c2eba=_0x1b201b[_0xe51f('0x2f')](/<(.*?)>/);return _0x3c2eba?_0x3c2eba[0x1]:_0x1b201b;}Report[_0xe51f('0x11')]['voiceCallReport']=function(_0x1bed71){_0x1bed71['destination']=_0x1bed71[_0xe51f('0x30')]||_0x1bed71['exten'];if(_0x1bed71[_0xe51f('0x31')]==_0xe51f('0x32')){_0x1bed71[_0xe51f('0x33')]=_0xe51f('0x34');_0x1bed71[_0xe51f('0x35')]=_0x1bed71[_0xe51f('0x34')];if(_0x1bed71[_0xe51f('0x36')]=='from-voip-provider'){_0x1bed71[_0xe51f('0x22')]='';_0x1bed71[_0xe51f('0x30')]=extractCalleridNumber(_0x1bed71[_0xe51f('0x37')]);}else if(_0x1bed71['context']==_0xe51f('0x38')){if(_0x1bed71[_0xe51f('0x30')]==_0xe51f('0x39')){_0x1bed71[_0xe51f('0x30')]=extractCalleridNumber(_0x1bed71[_0xe51f('0x3a')]);_0x1bed71['calleridnum']=_0x1bed71['originatecalleridnum'];_0x1bed71['destinationchannel']=[_0x1bed71[_0xe51f('0x3b')],_0x1bed71[_0xe51f('0x3b')]=_0x1bed71[_0xe51f('0x3c')]][0x0];_0x1bed71[_0xe51f('0x37')]=_0x1bed71['calleridpreview'];}else{_0x1bed71[_0xe51f('0x30')]=_0x1bed71['calleridnum'];_0x1bed71['calleridnum']=_0x1bed71['originatecalleridnum'];if(_0x1bed71['disposition']=='ANSWERED'){_0x1bed71[_0xe51f('0x22')]=_0x1bed71[_0xe51f('0x28')];}else{_0x1bed71[_0xe51f('0x22')]='';}}}}else{_0x1bed71[_0xe51f('0x37')]=util[_0xe51f('0x25')](_0xe51f('0x3d'),_0x1bed71['calleridname'],_0x1bed71['calleridnum']);}RpcVoiceCallReport[_0xe51f('0x3e')](_0x1bed71);if(_0x1bed71[_0xe51f('0x3f')]){for(var _0x4fd0c4=0x0;_0x4fd0c4<_0x1bed71[_0xe51f('0x40')][_0xe51f('0x27')];_0x4fd0c4+=0x1){_0x1bed71[_0xe51f('0x41')]=_0x1bed71['monitors'][_0x4fd0c4][_0xe51f('0x42')];_0x1bed71[_0xe51f('0x43')]=_0x1bed71[_0xe51f('0x40')][_0x4fd0c4]['createdAt'];if(_0x1bed71[_0xe51f('0x44')]=='xcally-motion-preview'){_0x1bed71[_0xe51f('0x45')]=_0x1bed71[_0xe51f('0x28')];_0x1bed71[_0xe51f('0x46')]=_0x1bed71[_0xe51f('0x47')];_0x1bed71[_0xe51f('0x28')]=_0x1bed71[_0xe51f('0x22')];_0x1bed71[_0xe51f('0x47')]=_0x1bed71[_0xe51f('0x48')];_0x1bed71[_0xe51f('0x44')]=_0x1bed71[_0xe51f('0x49')];}else if(_0x1bed71['exten']==_0xe51f('0x4a')){_0x1bed71[_0xe51f('0x45')]=_0x1bed71[_0xe51f('0x30')];_0x1bed71[_0xe51f('0x44')]=_0x1bed71[_0xe51f('0x49')];}RpcVoiceRecording['create'](_0x1bed71);}}};Report[_0xe51f('0x11')][_0xe51f('0x19')]=function(_0x1928f5){if(_['isArray'](_0x1928f5)){_0x1928f5[_0xe51f('0x4b')](function(_0x55a60c){RpcVoiceAgentReport[_0xe51f('0x3e')](_0x55a60c);});}else{RpcVoiceAgentReport[_0xe51f('0x3e')](_0x1928f5);}};Report[_0xe51f('0x11')][_0xe51f('0x1b')]=function(_0x2b37f6){RpcVoiceDialReport[_0xe51f('0x3e')](_0x2b37f6);var _0x587f34=undefined;var _0x392569=_0x2b37f6['channel'];if(_[_0xe51f('0x4c')](_0x392569,_0xe51f('0x4d'))){var _0x8e77f9=_0x392569[_0xe51f('0x4e')](_0x392569[_0xe51f('0x4f')]('/')+0x1,_0x392569[_0xe51f('0x4f')]('@'));_0x587f34=_['find'](this[_0xe51f('0xf')],function(_0x93bab){return _0x93bab['mobile']==_0x8e77f9||_0x93bab[_0xe51f('0x50')]==_0x8e77f9||_0x93bab[_0xe51f('0x22')]==_0x8e77f9;});}else{var _0x8e77f9=_0x392569[_0xe51f('0x4e')](_0x392569['indexOf']('/')+0x1,_0x392569[_0xe51f('0x51')]('-'));_0x587f34=this[_0xe51f('0x20')](_0x8e77f9);}if(_0x587f34){_0x2b37f6[_0xe51f('0x2b')]=_[_0xe51f('0x23')](_0x587f34[_0xe51f('0x2b')])?util[_0xe51f('0x25')](_0xe51f('0x26'),_0x587f34['name']):_0x587f34[_0xe51f('0x2b')];_0x2b37f6[_0xe51f('0x48')]=_0x587f34[_0xe51f('0x24')];_0x2b37f6[_0xe51f('0x22')]=_0x587f34[_0xe51f('0x22')];RpcMemberReport[_0xe51f('0x1b')](_0x2b37f6);}};Report['prototype'][_0xe51f('0x1d')]=function(_0x2b05d6){RpcVoiceTransferReport[_0xe51f('0x1d')](_0x2b05d6);};Report['prototype'][_0xe51f('0x1f')]=function(_0x13851d){RpcVoiceTransferReport[_0xe51f('0x1f')](_0x13851d);};module[_0xe51f('0x52')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index cb306a4..4d590b5 100644 --- a/server/services/ami/report/userReport.js +++ b/server/services/ami/report/userReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc558=['address','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','inspect','prototype','[loopSyncRealTimeShow]','isUndefined','emit','isNotNull','find','username','stateRegistry','merge','event','actionid','state','name','error','device','local','toNumber','format','toLowerCase','updateStatusRealtime','stateTime','telephone:save','trunk:%s','trunk:save','Queue','Local','substring','indexOf','mobile','phone','accountcode','peerstatus','peer','registered','status'];(function(_0xe60703,_0x2429e6){var _0x291521=function(_0xc23e03){while(--_0xc23e03){_0xe60703['push'](_0xe60703['shift']());}};_0x291521(++_0x2429e6);}(_0xc558,0xb9));var _0x8c55=function(_0x1d64cf,_0x4013d9){_0x1d64cf=_0x1d64cf-0x0;var _0x560374=_0xc558[_0x1d64cf];return _0x560374;};'use strict';var _=require(_0x8c55('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8c55('0x1'));var Redis=require(_0x8c55('0x2'));var config=require(_0x8c55('0x3'));var logger=require(_0x8c55('0x4'))(_0x8c55('0x5'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x8c55('0x6')],{'host':_0x8c55('0x7'),'port':0x18eb});var io=require(_0x8c55('0x8'))(new Redis(config[_0x8c55('0x6')]));function UserReport(_0x2b3f04){this[_0x8c55('0x9')]=_0x2b3f04[_0x8c55('0x9')];this[_0x8c55('0xa')]=_0x2b3f04[_0x8c55('0xa')];this[_0x8c55('0xb')]=_0x2b3f04[_0x8c55('0xb')];ami['on'](_0x8c55('0xc'),this[_0x8c55('0xd')][_0x8c55('0xe')](this));ami['on'](_0x8c55('0xf'),this[_0x8c55('0xd')][_0x8c55('0xe')](this));ami['on']('devicestatechange',this[_0x8c55('0x10')][_0x8c55('0xe')](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));this[_0x8c55('0x11')]();return BPromise[_0x8c55('0x12')]()[_0x8c55('0x13')](ami[_0x8c55('0x14')]())[_0x8c55('0x13')](ami[_0x8c55('0x15')]())[_0x8c55('0x13')](ami[_0x8c55('0x16')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5bdd11){return function(_0x2dbdc5){logger['error'](_0x5bdd11,util[_0x8c55('0x17')](_0x2dbdc5,{'showHidden':![],'depth':null}));};}UserReport[_0x8c55('0x18')][_0x8c55('0x11')]=function(){setInterval(function(){BPromise['resolve']()[_0x8c55('0x13')](ami['actionSipShowRegistry']())[_0x8c55('0x13')](ami['actionDeviceStateList']())[_0x8c55('0x13')](ami[_0x8c55('0x16')]())['catch'](loggerCatch(_0x8c55('0x19')));},0x32c8);};UserReport[_0x8c55('0x18')]['isNotNull']=function(_0x379f4d){return _0x379f4d!==null&&!_[_0x8c55('0x1a')](_0x379f4d);};UserReport['prototype'][_0x8c55('0x1b')]=function(_0xc91263,_0x1d878d,_0x58d38f){io['to'](_0xc91263)[_0x8c55('0x1b')](_0x1d878d,_0x58d38f);};UserReport['prototype'][_0x8c55('0xd')]=function(_0x61f74){try{if(this[_0x8c55('0x1c')](_0x61f74)){var _0x4a9a15=_[_0x8c55('0x1d')](this[_0x8c55('0x9')],{'registry':_0x61f74[_0x8c55('0x1e')]});if(_0x4a9a15){_0x61f74[_0x8c55('0x1f')]=_0x61f74['state'];_[_0x8c55('0x20')](_0x4a9a15,_['omit'](_0x61f74,[_0x8c55('0x21'),_0x8c55('0x22'),'username',_0x8c55('0x23')]));this[_0x8c55('0x1b')](util['format']('trunk:%s',_0x4a9a15[_0x8c55('0x24')]),'trunk:save',_0x4a9a15);}}}catch(_0x315aa3){logger[_0x8c55('0x25')]('[syncRegistry][UserReport]',util[_0x8c55('0x17')](_0x315aa3,{'showHidden':![],'depth':null}));}};UserReport[_0x8c55('0x18')][_0x8c55('0x10')]=function(_0x283483){try{if(this[_0x8c55('0x1c')](_0x283483)){if(this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]]){if(!this['agents'][_0x283483[_0x8c55('0x26')]][_0x8c55('0x27')]||_0x283483[_0x8c55('0x23')]['toLowerCase']()=='inuse'){this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]]['local']=![];if(this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]][_0x8c55('0x23')]!==_0x283483['state']['toLowerCase']()){this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]]['stateTime']=_[_0x8c55('0x28')](moment()[_0x8c55('0x29')]('x'));}this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]][_0x8c55('0x23')]=_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]();this[_0x8c55('0xa')][_0x283483['device']][_0x8c55('0x2b')](_0x283483);}}else if(this[_0x8c55('0xb')][_0x283483[_0x8c55('0x26')]]){if(this[_0x8c55('0xb')][_0x283483['device']][_0x8c55('0x23')]!==_0x283483['state'][_0x8c55('0x2a')]()){this['telephones'][_0x283483['device']][_0x8c55('0x2c')]=_['toNumber'](moment()[_0x8c55('0x29')]('x'));}this[_0x8c55('0xb')][_0x283483[_0x8c55('0x26')]][_0x8c55('0x23')]=_0x283483['state']['toLowerCase']();this[_0x8c55('0x1b')](util[_0x8c55('0x29')]('telephone:%s',this[_0x8c55('0xb')][_0x283483['device']][_0x8c55('0x24')]),_0x8c55('0x2d'),this[_0x8c55('0xb')][_0x283483[_0x8c55('0x26')]]);}else if(this['trunks'][_0x283483[_0x8c55('0x26')]]){if(this[_0x8c55('0x9')][_0x283483[_0x8c55('0x26')]]['state']!==_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]()){this['trunks'][_0x283483['device']][_0x8c55('0x2c')]=_[_0x8c55('0x28')](moment()[_0x8c55('0x29')]('x'));}this['trunks'][_0x283483['device']]['state']=_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]();this[_0x8c55('0x1b')](util[_0x8c55('0x29')](_0x8c55('0x2e'),this[_0x8c55('0x9')][_0x283483['device']][_0x8c55('0x24')]),_0x8c55('0x2f'),this[_0x8c55('0x9')][_0x283483[_0x8c55('0x26')]]);}else if(_['startsWith'](_0x283483['device'],_0x8c55('0x30'))){}else if(_['startsWith'](_0x283483[_0x8c55('0x26')],_0x8c55('0x31'))){var _0x8f47d4=_0x283483['device'];var _0x5a66b8=_0x8f47d4[_0x8c55('0x32')](_0x8f47d4[_0x8c55('0x33')]('/')+0x1,_0x8f47d4[_0x8c55('0x33')]('@'));var _0x5cadb0=_[_0x8c55('0x1d')](this[_0x8c55('0xa')],function(_0x43d136){return _0x43d136[_0x8c55('0x34')]==_0x5a66b8||_0x43d136[_0x8c55('0x35')]==_0x5a66b8||_0x43d136[_0x8c55('0x36')]==_0x5a66b8;});if(_0x5cadb0){if(_0x5cadb0[_0x8c55('0x23')]!==_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]()){_0x5cadb0['stateTime']=_[_0x8c55('0x28')](moment()['format']('x'));}_0x5cadb0[_0x8c55('0x23')]=_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]();_0x5cadb0[_0x8c55('0x27')]=!![];_0x5cadb0[_0x8c55('0x2b')](_0x283483);}}else{}}}catch(_0x3cbbe4){logger['error']('[syncDeviceState][UserReport]',util[_0x8c55('0x17')](_0x3cbbe4,{'showHidden':![],'depth':null}));}};UserReport[_0x8c55('0x18')]['syncPeerStatus']=function(_0xb8b1fe){try{if(this[_0x8c55('0x1c')](_0xb8b1fe)&&this['isNotNull'](_0xb8b1fe[_0x8c55('0x37')])){if(this['agents'][_0xb8b1fe[_0x8c55('0x38')]]){if(!this[_0x8c55('0xa')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x27')]||_0xb8b1fe[_0x8c55('0x37')]['toLowerCase']()==_0x8c55('0x39')){this[_0x8c55('0xa')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x27')]=![];this[_0x8c55('0xa')][_0xb8b1fe['peer']][_0x8c55('0x3a')]=_0xb8b1fe[_0x8c55('0x37')]['toLowerCase']();this['agents'][_0xb8b1fe['peer']]['address']=_0xb8b1fe[_0x8c55('0x3b')];this[_0x8c55('0xa')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x2b')](_0xb8b1fe);}}else if(this[_0x8c55('0xb')][_0xb8b1fe[_0x8c55('0x38')]]){this['telephones'][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x3a')]=_0xb8b1fe['peerstatus'][_0x8c55('0x2a')]();this['telephones'][_0xb8b1fe['peer']][_0x8c55('0x3b')]=_0xb8b1fe[_0x8c55('0x3b')];this[_0x8c55('0x1b')](util[_0x8c55('0x29')]('telephone:%s',this['telephones'][_0xb8b1fe['peer']][_0x8c55('0x24')]),'telephone:save',this[_0x8c55('0xb')][_0xb8b1fe[_0x8c55('0x38')]]);}else if(this[_0x8c55('0x9')][_0xb8b1fe[_0x8c55('0x38')]]){this[_0x8c55('0x9')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x3a')]=_0xb8b1fe[_0x8c55('0x37')][_0x8c55('0x2a')]();this[_0x8c55('0x9')][_0xb8b1fe[_0x8c55('0x38')]]['address']=_0xb8b1fe[_0x8c55('0x3b')];this[_0x8c55('0x1b')](util['format'](_0x8c55('0x2e'),this['trunks'][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x24')]),_0x8c55('0x2f'),this['trunks'][_0xb8b1fe[_0x8c55('0x38')]]);}else{}}}catch(_0xa6630a){logger[_0x8c55('0x25')]('[syncPeerStatus][UserReport]',util['inspect'](_0xa6630a,{'showHidden':![],'depth':null}));}};module[_0x8c55('0x3c')]=UserReport; \ No newline at end of file +var _0xa66f=['redis','defaults','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','syncDeviceState','bind','peerstatus','loopSyncRealTimeShow','actionSipShowRegistry','then','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','actionDeviceStateList','isUndefined','emit','find','state','merge','omit','event','actionid','username','format','trunk:save','[syncRegistry][UserReport]','isNotNull','device','local','inuse','toLowerCase','stateTime','updateStatusRealtime','toNumber','telephone:%s','name','telephone:save','trunk:%s','startsWith','Local','substring','indexOf','phone','syncPeerStatus','peer','registered','status','address','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','ami','../ami'];(function(_0x48dd28,_0x56c206){var _0xea6b1e=function(_0x2073b7){while(--_0x2073b7){_0x48dd28['push'](_0x48dd28['shift']());}};_0xea6b1e(++_0x56c206);}(_0xa66f,0x100));var _0xfa66=function(_0x2deb01,_0x4e741c){_0x2deb01=_0x2deb01-0x0;var _0x3920b3=_0xa66f[_0x2deb01];return _0x3920b3;};'use strict';var _=require(_0xfa66('0x0'));var moment=require(_0xfa66('0x1'));var BPromise=require(_0xfa66('0x2'));var util=require(_0xfa66('0x3'));var Redis=require(_0xfa66('0x4'));var config=require(_0xfa66('0x5'));var logger=require('../../../config/logger')(_0xfa66('0x6'));var ami=require(_0xfa66('0x7'));config[_0xfa66('0x8')]=_[_0xfa66('0x9')](config[_0xfa66('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xfa66('0xa'))(new Redis(config['redis']));function UserReport(_0x20c581){this[_0xfa66('0xb')]=_0x20c581['trunks'];this[_0xfa66('0xc')]=_0x20c581[_0xfa66('0xc')];this['telephones']=_0x20c581[_0xfa66('0xd')];ami['on'](_0xfa66('0xe'),this[_0xfa66('0xf')]['bind'](this));ami['on'](_0xfa66('0x10'),this[_0xfa66('0xf')]['bind'](this));ami['on']('devicestatechange',this[_0xfa66('0x11')][_0xfa66('0x12')](this));ami['on'](_0xfa66('0x13'),this['syncPeerStatus'][_0xfa66('0x12')](this));this[_0xfa66('0x14')]();return BPromise['resolve']()['then'](ami[_0xfa66('0x15')]())['then'](ami['actionDeviceStateList']())[_0xfa66('0x16')](ami[_0xfa66('0x17')]())[_0xfa66('0x18')](loggerCatch(_0xfa66('0x19')));}function loggerCatch(_0x5b7162){return function(_0x47bfe9){logger[_0xfa66('0x1a')](_0x5b7162,util[_0xfa66('0x1b')](_0x47bfe9,{'showHidden':![],'depth':null}));};}UserReport[_0xfa66('0x1c')][_0xfa66('0x14')]=function(){setInterval(function(){BPromise['resolve']()[_0xfa66('0x16')](ami[_0xfa66('0x15')]())['then'](ami[_0xfa66('0x1d')]())[_0xfa66('0x16')](ami[_0xfa66('0x17')]())[_0xfa66('0x18')](loggerCatch(_0xfa66('0x19')));},0x32c8);};UserReport[_0xfa66('0x1c')]['isNotNull']=function(_0x3d99c1){return _0x3d99c1!==null&&!_[_0xfa66('0x1e')](_0x3d99c1);};UserReport['prototype'][_0xfa66('0x1f')]=function(_0x2ae6a2,_0x22787b,_0x2c9cef){io['to'](_0x2ae6a2)[_0xfa66('0x1f')](_0x22787b,_0x2c9cef);};UserReport[_0xfa66('0x1c')]['syncRegistry']=function(_0x1f8091){try{if(this['isNotNull'](_0x1f8091)){var _0xfa6eef=_[_0xfa66('0x20')](this[_0xfa66('0xb')],{'registry':_0x1f8091['username']});if(_0xfa6eef){_0x1f8091['stateRegistry']=_0x1f8091[_0xfa66('0x21')];_[_0xfa66('0x22')](_0xfa6eef,_[_0xfa66('0x23')](_0x1f8091,[_0xfa66('0x24'),_0xfa66('0x25'),_0xfa66('0x26'),_0xfa66('0x21')]));this[_0xfa66('0x1f')](util[_0xfa66('0x27')]('trunk:%s',_0xfa6eef['name']),_0xfa66('0x28'),_0xfa6eef);}}}catch(_0x53f8c9){logger[_0xfa66('0x1a')](_0xfa66('0x29'),util[_0xfa66('0x1b')](_0x53f8c9,{'showHidden':![],'depth':null}));}};UserReport[_0xfa66('0x1c')][_0xfa66('0x11')]=function(_0x9faf5f){try{if(this[_0xfa66('0x2a')](_0x9faf5f)){if(this['agents'][_0x9faf5f[_0xfa66('0x2b')]]){if(!this[_0xfa66('0xc')][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x2c')]||_0x9faf5f[_0xfa66('0x21')]['toLowerCase']()==_0xfa66('0x2d')){this[_0xfa66('0xc')][_0x9faf5f['device']]['local']=![];if(this[_0xfa66('0xc')][_0x9faf5f['device']][_0xfa66('0x21')]!==_0x9faf5f[_0xfa66('0x21')][_0xfa66('0x2e')]()){this[_0xfa66('0xc')][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x2f')]=_['toNumber'](moment()[_0xfa66('0x27')]('x'));}this[_0xfa66('0xc')][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x21')]=_0x9faf5f[_0xfa66('0x21')]['toLowerCase']();this[_0xfa66('0xc')][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x30')](_0x9faf5f);}}else if(this[_0xfa66('0xd')][_0x9faf5f['device']]){if(this[_0xfa66('0xd')][_0x9faf5f['device']][_0xfa66('0x21')]!==_0x9faf5f[_0xfa66('0x21')][_0xfa66('0x2e')]()){this[_0xfa66('0xd')][_0x9faf5f[_0xfa66('0x2b')]]['stateTime']=_[_0xfa66('0x31')](moment()[_0xfa66('0x27')]('x'));}this['telephones'][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x21')]=_0x9faf5f[_0xfa66('0x21')][_0xfa66('0x2e')]();this[_0xfa66('0x1f')](util['format'](_0xfa66('0x32'),this[_0xfa66('0xd')][_0x9faf5f['device']][_0xfa66('0x33')]),_0xfa66('0x34'),this[_0xfa66('0xd')][_0x9faf5f[_0xfa66('0x2b')]]);}else if(this[_0xfa66('0xb')][_0x9faf5f[_0xfa66('0x2b')]]){if(this['trunks'][_0x9faf5f['device']][_0xfa66('0x21')]!==_0x9faf5f[_0xfa66('0x21')][_0xfa66('0x2e')]()){this[_0xfa66('0xb')][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x2f')]=_[_0xfa66('0x31')](moment()[_0xfa66('0x27')]('x'));}this['trunks'][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x21')]=_0x9faf5f[_0xfa66('0x21')][_0xfa66('0x2e')]();this[_0xfa66('0x1f')](util[_0xfa66('0x27')](_0xfa66('0x35'),this[_0xfa66('0xb')][_0x9faf5f[_0xfa66('0x2b')]][_0xfa66('0x33')]),_0xfa66('0x28'),this['trunks'][_0x9faf5f[_0xfa66('0x2b')]]);}else if(_[_0xfa66('0x36')](_0x9faf5f[_0xfa66('0x2b')],'Queue')){}else if(_[_0xfa66('0x36')](_0x9faf5f[_0xfa66('0x2b')],_0xfa66('0x37'))){var _0x328552=_0x9faf5f[_0xfa66('0x2b')];var _0xd25624=_0x328552[_0xfa66('0x38')](_0x328552[_0xfa66('0x39')]('/')+0x1,_0x328552[_0xfa66('0x39')]('@'));var _0x78dddc=_['find'](this[_0xfa66('0xc')],function(_0x3ab24f){return _0x3ab24f['mobile']==_0xd25624||_0x3ab24f[_0xfa66('0x3a')]==_0xd25624||_0x3ab24f['accountcode']==_0xd25624;});if(_0x78dddc){if(_0x78dddc[_0xfa66('0x21')]!==_0x9faf5f[_0xfa66('0x21')][_0xfa66('0x2e')]()){_0x78dddc[_0xfa66('0x2f')]=_[_0xfa66('0x31')](moment()[_0xfa66('0x27')]('x'));}_0x78dddc['state']=_0x9faf5f[_0xfa66('0x21')][_0xfa66('0x2e')]();_0x78dddc[_0xfa66('0x2c')]=!![];_0x78dddc[_0xfa66('0x30')](_0x9faf5f);}}else{}}}catch(_0x172a2f){logger['error']('[syncDeviceState][UserReport]',util[_0xfa66('0x1b')](_0x172a2f,{'showHidden':![],'depth':null}));}};UserReport[_0xfa66('0x1c')][_0xfa66('0x3b')]=function(_0x1bd87a){try{if(this[_0xfa66('0x2a')](_0x1bd87a)&&this['isNotNull'](_0x1bd87a[_0xfa66('0x13')])){if(this[_0xfa66('0xc')][_0x1bd87a[_0xfa66('0x3c')]]){if(!this[_0xfa66('0xc')][_0x1bd87a[_0xfa66('0x3c')]][_0xfa66('0x2c')]||_0x1bd87a[_0xfa66('0x13')][_0xfa66('0x2e')]()==_0xfa66('0x3d')){this[_0xfa66('0xc')][_0x1bd87a['peer']][_0xfa66('0x2c')]=![];this['agents'][_0x1bd87a['peer']][_0xfa66('0x3e')]=_0x1bd87a[_0xfa66('0x13')]['toLowerCase']();this['agents'][_0x1bd87a['peer']][_0xfa66('0x3f')]=_0x1bd87a[_0xfa66('0x3f')];this[_0xfa66('0xc')][_0x1bd87a['peer']]['updateStatusRealtime'](_0x1bd87a);}}else if(this[_0xfa66('0xd')][_0x1bd87a[_0xfa66('0x3c')]]){this[_0xfa66('0xd')][_0x1bd87a['peer']][_0xfa66('0x3e')]=_0x1bd87a[_0xfa66('0x13')][_0xfa66('0x2e')]();this['telephones'][_0x1bd87a[_0xfa66('0x3c')]][_0xfa66('0x3f')]=_0x1bd87a['address'];this[_0xfa66('0x1f')](util[_0xfa66('0x27')](_0xfa66('0x32'),this['telephones'][_0x1bd87a[_0xfa66('0x3c')]][_0xfa66('0x33')]),_0xfa66('0x34'),this[_0xfa66('0xd')][_0x1bd87a[_0xfa66('0x3c')]]);}else if(this['trunks'][_0x1bd87a[_0xfa66('0x3c')]]){this['trunks'][_0x1bd87a['peer']][_0xfa66('0x3e')]=_0x1bd87a[_0xfa66('0x13')][_0xfa66('0x2e')]();this[_0xfa66('0xb')][_0x1bd87a['peer']]['address']=_0x1bd87a['address'];this[_0xfa66('0x1f')](util[_0xfa66('0x27')](_0xfa66('0x35'),this[_0xfa66('0xb')][_0x1bd87a[_0xfa66('0x3c')]][_0xfa66('0x33')]),_0xfa66('0x28'),this[_0xfa66('0xb')][_0x1bd87a[_0xfa66('0x3c')]]);}else{}}}catch(_0x2d2bf1){logger[_0xfa66('0x1a')](_0xfa66('0x40'),util[_0xfa66('0x1b')](_0x2d2bf1,{'showHidden':![],'depth':null}));}};module[_0xfa66('0x41')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index d30380b..c07ee28 100644 --- a/server/services/ami/report/voiceAgentReport.js +++ b/server/services/ami/report/voiceAgentReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07e5=['syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','channels','format','called','queue','inbound','event','privilege','destuniqueid','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswer','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','agentringnoanswerAt','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','reason','transfer','agent','acw','acwtime','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','variable','[syncVarSet][VoiceAgentReport]','addVariable','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberpenalty','syncHangup','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','agentconnectAt','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','seconds','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','substring','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','musiconholdstart'];(function(_0x1a37e3,_0x5db8f6){var _0x4db78a=function(_0x15e6c1){while(--_0x15e6c1){_0x1a37e3['push'](_0x1a37e3['shift']());}};_0x4db78a(++_0x5db8f6);}(_0x07e5,0x14b));var _0x507e=function(_0x3ead04,_0x39bccf){_0x3ead04=_0x3ead04-0x0;var _0x142c29=_0x07e5[_0x3ead04];return _0x142c29;};'use strict';var _=require(_0x507e('0x0'));var moment=require(_0x507e('0x1'));var util=require(_0x507e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x507e('0x3'))(_0x507e('0x4'));var ami=require(_0x507e('0x5'));config[_0x507e('0x6')]=_['defaults'](config[_0x507e('0x6')],{'host':_0x507e('0x7'),'port':0x18eb});var io=require(_0x507e('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0xf5c423){this['channels']={};this[_0x507e('0x9')]=_0xf5c423[_0x507e('0x9')];this['agents']=_0xf5c423[_0x507e('0xa')];this[_0x507e('0xb')]={};ami['on'](_0x507e('0xc'),this['syncAgentCalled'][_0x507e('0xd')](this));ami['on'](_0x507e('0xe'),this['syncAgentConnect'][_0x507e('0xd')](this));ami['on']('agentringnoanswer',this[_0x507e('0xf')][_0x507e('0xd')](this));ami['on'](_0x507e('0x10'),this[_0x507e('0x11')]['bind'](this));ami['on'](_0x507e('0x12'),this[_0x507e('0x13')][_0x507e('0xd')](this));ami['on'](_0x507e('0x14'),this['syncVarSet'][_0x507e('0xd')](this));ami['on'](_0x507e('0x15'),this['syncHangup'][_0x507e('0xd')](this));ami['on'](_0x507e('0x16'),this[_0x507e('0x17')][_0x507e('0xd')](this));ami['on'](_0x507e('0x18'),this[_0x507e('0x19')][_0x507e('0xd')](this));ami['on'](_0x507e('0x1a'),this[_0x507e('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0x507e('0x1c')][_0x507e('0xd')](this));}VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x1e')]=function(_0x57b67e,_0x27d01d,_0x439336){io['to'](_0x57b67e)[_0x507e('0x1e')](_0x27d01d,_0x439336);};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x1f')]=function(_0x3ff655){return _0x3ff655!==null&&!_[_0x507e('0x20')](_0x3ff655);};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x21')]=function(_0x5e117c){try{if(this[_0x507e('0x1f')](_0x5e117c)){if(_['isUndefined'](this['channels'][_0x5e117c[_0x507e('0x22')]])){this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]]={};}if(_['isUndefined'](this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c['destuniqueid']])){this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c['destuniqueid']]={'agentcalledAt':moment()[_0x507e('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x507e('0x25'),'variables':this['variables'][_0x5e117c[_0x507e('0x22')]],'type':this[_0x507e('0x9')][_0x5e117c['queue']]?this[_0x507e('0x9')][_0x5e117c[_0x507e('0x26')]]['type']||_0x507e('0x27'):_0x507e('0x27')};}_['merge'](this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c['destuniqueid']],_['omit'](_0x5e117c,[_0x507e('0x28'),_0x507e('0x29')]));ami['emit']('custom:agentcalled',this['channels'][_0x5e117c[_0x507e('0x22')]][_0x5e117c[_0x507e('0x2a')]]);this['emit'](util[_0x507e('0x24')](_0x507e('0x2b'),_0x5e117c[_0x507e('0x2c')]),_0x507e('0x2d'),this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c[_0x507e('0x2a')]]);}}catch(_0x22a965){logger[_0x507e('0x2e')](_0x507e('0x2f'),util[_0x507e('0x30')](_0x22a965,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')]['syncAgentConnect']=function(_0x3a5a9e){try{if(this['isNotNull'](_0x3a5a9e)){if(this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]]){for(var _0x3bef40 in this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]]){if(this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x507e('0x31')](_0x3bef40)){if(_0x3a5a9e[_0x507e('0x2a')]===_0x3bef40){this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['agentconnectAt']=moment()[_0x507e('0x24')](_0x507e('0x32'));this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['lastevent']='connect';this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x33')]=_0x3a5a9e[_0x507e('0x33')];this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x34')]=_0x3a5a9e[_0x507e('0x34')];this[_0x507e('0x23')][_0x3a5a9e['uniqueid']][_0x3bef40][_0x507e('0x35')]=_0x3a5a9e[_0x507e('0x35')];this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x36')]=_0x3a5a9e[_0x507e('0x36')];this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x37')]=_0x3a5a9e[_0x507e('0x37')];_['merge'](this[_0x507e('0xa')][_0x3a5a9e[_0x507e('0x38')]],_[_0x507e('0x39')](_0x3a5a9e,[_0x507e('0x26'),_0x507e('0x3a')]));this[_0x507e('0x1e')](util[_0x507e('0x24')](_0x507e('0x2b'),_0x3a5a9e[_0x507e('0x2c')]),_0x507e('0x3b'),this[_0x507e('0x23')][_0x3a5a9e['uniqueid']][_0x3a5a9e['destuniqueid']]);ami[_0x507e('0x1e')](_0x507e('0x3c'),this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]);}else if(!this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x3d')]&&!this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['agentcomplete']){this[_0x507e('0x23')][_0x3a5a9e['uniqueid']][_0x3bef40]['agentringnoanswer']=!![];this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['agentringnoanswerAt']=moment()['format'](_0x507e('0x32'));this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['reason']=_0x507e('0x3e');this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x3f')]=_0x507e('0x3e');this['channels'][_0x3a5a9e['uniqueid']][_0x3bef40][_0x507e('0x40')]=_0x3a5a9e[_0x507e('0x2a')];this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['answeredelsewheremembername']=_0x3a5a9e[_0x507e('0x2c')];ami[_0x507e('0x1e')](_0x507e('0x41'),this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]);}}}}}}catch(_0x1bca21){logger['error'](_0x507e('0x42'),util[_0x507e('0x30')](_0x1bca21,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0xf')]=function(_0x11ff0f){try{if(this['isNotNull'](_0x11ff0f)){if(this['channels'][_0x11ff0f[_0x507e('0x22')]]&&this['channels'][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]]){this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f['destuniqueid']][_0x507e('0x3d')]=!![];this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]]['agentringnoanswerAt']=moment()[_0x507e('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f['destuniqueid']]['reason']=_0x507e('0x43');this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]][_0x507e('0x3f')]=_0x507e('0x43');ami[_0x507e('0x1e')]('custom:agentringnoanswer',this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]]);}}}catch(_0x24b613){logger[_0x507e('0x2e')](_0x507e('0x44'),util[_0x507e('0x30')](_0x24b613,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')]['syncQueueCallerAbandon']=function(_0x3bcbab){try{if(this[_0x507e('0x1f')](_0x3bcbab)){if(this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]]){for(var _0xa24a1b in this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]]){if(this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0x507e('0x31')](_0xa24a1b)&&!this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x3d')]&&!this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x12')]){this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x3d')]=!![];this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x45')]=moment()['format'](_0x507e('0x32'));this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b]['reason']=_0x507e('0x46');this['channels'][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x3f')]=_0x507e('0x46');ami[_0x507e('0x1e')](_0x507e('0x47'),this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b]);}}}}}catch(_0x1e0ebb){logger[_0x507e('0x2e')](_0x507e('0x48'),util['inspect'](_0x1e0ebb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x13')]=function(_0x49620e){try{if(this['isNotNull'](_0x49620e)){if(this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]]){for(var _0x36551f in this['channels'][_0x49620e['uniqueid']]){if(this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x507e('0x31')](_0x36551f)){if(this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['agentconnectAt']&&!this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x12')]){this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['agentcomplete']=!![];this[_0x507e('0x23')][_0x49620e['uniqueid']][_0x36551f][_0x507e('0x49')]=moment()[_0x507e('0x24')](_0x507e('0x32'));this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x3f')]=_0x507e('0x4a');this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x4b')]=_0x49620e['talktime'];this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['reason']=_0x49620e[_0x507e('0x4c')]==_0x507e('0x4d')?_0x507e('0x4e'):_0x49620e[_0x507e('0x4c')];if(this[_0x507e('0x9')][_0x49620e[_0x507e('0x26')]]&&this[_0x507e('0x9')][_0x49620e[_0x507e('0x26')]][_0x507e('0x4f')]){this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['agentacw']=!![];this['channels'][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x50')]=this[_0x507e('0x9')][_0x49620e[_0x507e('0x26')]][_0x507e('0x51')];}this[_0x507e('0xa')][_0x49620e[_0x507e('0x38')]]=_[_0x507e('0x52')](this[_0x507e('0xa')][_0x49620e[_0x507e('0x38')]],[_0x507e('0x26'),_0x507e('0x3a')]);this[_0x507e('0x1e')](util[_0x507e('0x24')](_0x507e('0x2b'),_0x49620e[_0x507e('0x2c')]),_0x507e('0x53'),this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]);ami[_0x507e('0x1e')](_0x507e('0x54'),this['channels'][_0x49620e[_0x507e('0x22')]][_0x36551f]);}}}}}}catch(_0x186569){logger[_0x507e('0x2e')](_0x507e('0x55'),util[_0x507e('0x30')](_0x186569,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x56')]=function(_0x121625){try{if(this[_0x507e('0x1f')](_0x121625)){this['addVariable'](_0x121625[_0x507e('0x22')],_['keys'](_0x121625[_0x507e('0x57')])[0x0],_0x121625['value']);if(this[_0x507e('0x23')][_0x121625[_0x507e('0x22')]]){for(var _0x1eb0c1 in this['channels'][_0x121625[_0x507e('0x22')]]){if(this[_0x507e('0x23')][_0x121625[_0x507e('0x22')]][_0x507e('0x31')](_0x1eb0c1)){if(_[_0x507e('0x20')](this[_0x507e('0x23')][_0x121625[_0x507e('0x22')]][_0x1eb0c1][_0x507e('0xb')])){this[_0x507e('0x23')][_0x121625['uniqueid']][_0x1eb0c1][_0x507e('0xb')]={};}this[_0x507e('0x23')][_0x121625['uniqueid']][_0x1eb0c1][_0x507e('0xb')]=this[_0x507e('0xb')][_0x121625[_0x507e('0x22')]];}}}}}catch(_0x28adda){logger[_0x507e('0x2e')](_0x507e('0x58'),util[_0x507e('0x30')](_0x28adda,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x59')]=function(_0x5b4d19,_0xd67676,_0x2d3615){var _0x878e3a=['rtpaudioqos','rtpaudioqosbridged',_0x507e('0x5a'),_0x507e('0x5b'),_0x507e('0x5c'),'rtpaudioqoslossbridged',_0x507e('0x5d'),_0x507e('0x5e'),_0x507e('0x5f'),_0x507e('0x60'),_0x507e('0x61'),_0x507e('0x62'),'membercalls','memberdynamic',_0x507e('0x63'),'memberlastcall',_0x507e('0x2c'),_0x507e('0x64'),'memberrealtime'];if(!_['isNil'](_0xd67676)&&!_['includes'](_0x878e3a,_0xd67676)){if(_[_0x507e('0x20')](this[_0x507e('0xb')][_0x5b4d19])){this[_0x507e('0xb')][_0x5b4d19]={};}this[_0x507e('0xb')][_0x5b4d19][_0xd67676]=_0x2d3615;}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x65')]=function(_0x58dfb8){try{if(this['isNotNull'](_0x58dfb8)){if(this[_0x507e('0x23')][_0x58dfb8['uniqueid']]){for(var _0x4b62b6 in this[_0x507e('0x23')][_0x58dfb8['uniqueid']]){if(this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x507e('0x31')](_0x4b62b6)){if(this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x4b62b6][_0x507e('0x4c')]==_0x507e('0x4d')&&this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x4b62b6]['agentcomplete']){this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x4b62b6][_0x507e('0x49')]=moment()[_0x507e('0x24')](_0x507e('0x32'));}}}ami[_0x507e('0x1e')]('custom:voiceAgentReport',_[_0x507e('0x66')](this[_0x507e('0x23')][_0x58dfb8[_0x507e('0x22')]]));delete this[_0x507e('0x23')][_0x58dfb8[_0x507e('0x22')]];}if(this[_0x507e('0xb')][_0x58dfb8[_0x507e('0x22')]]){delete this[_0x507e('0xb')][_0x58dfb8['uniqueid']];}}}catch(_0x5a48db){logger[_0x507e('0x2e')](_0x507e('0x67'),util[_0x507e('0x30')](_0x5a48db,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x1b')]=function(_0x580175){try{if(this[_0x507e('0x1f')](_0x580175)){if(this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]]){for(var _0x3bf29c in this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]]){if(this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x507e('0x31')](_0x3bf29c)){if(_0x580175[_0x507e('0x69')]===_0x3bf29c){var _0x3fd5c3=moment();this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c]['agentcomplete']=!![];this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x49')]=moment()[_0x507e('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c]['reason']=_0x507e('0x4d');this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x3f')]=_0x507e('0x4a');this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x4b')]=_0x3fd5c3[_0x507e('0x6a')](this['channels'][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x6b')],'seconds');}}}}if(this[_0x507e('0x23')][_0x580175[_0x507e('0x6c')]]){var _0x137433=this[_0x507e('0x23')][_0x580175[_0x507e('0x6c')]];this[_0x507e('0x23')][_0x580175[_0x507e('0x6c')]]=this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]];this['channels'][_0x580175[_0x507e('0x68')]]=_0x137433;}}}catch(_0x1ffe34){logger[_0x507e('0x2e')](_0x507e('0x6d'),util[_0x507e('0x30')](_0x1ffe34,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x507e('0x1c')]=function(_0x439709){try{if(this[_0x507e('0x1f')](_0x439709)){if(this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]]){for(var _0x3d796a in this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]]){if(this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]][_0x507e('0x31')](_0x3d796a)){if(_0x439709['transfereruniqueid']===_0x3d796a){var _0x529d8c=moment();this[_0x507e('0x23')][_0x439709['transfereeuniqueid']][_0x3d796a]['agentcomplete']=!![];this['channels'][_0x439709['transfereeuniqueid']][_0x3d796a]['agentcompleteAt']=_0x529d8c;this['channels'][_0x439709['transfereeuniqueid']][_0x3d796a]['reason']='transfer';this['channels'][_0x439709[_0x507e('0x68')]][_0x3d796a]['lastevent']=_0x507e('0x4a');this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]][_0x3d796a][_0x507e('0x4b')]=_0x529d8c[_0x507e('0x6a')](this['channels'][_0x439709[_0x507e('0x68')]][_0x3d796a][_0x507e('0x6b')],_0x507e('0x6e'));}}}}}}catch(_0x132aa2){logger[_0x507e('0x2e')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x507e('0x30')](_0x132aa2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')]['syncMusicOnHoldStart']=function(_0x499b97){var _0x389016='';try{if(this[_0x507e('0x1f')](_0x499b97)){if(_0x499b97['channel']){_0x389016=_0x499b97[_0x507e('0x6f')]['substring'](0x0,_0x499b97[_0x507e('0x6f')][_0x507e('0x70')]('-'));if(this[_0x507e('0xa')][_0x389016]){this['agents'][_0x389016][_0x507e('0x71')]=!![];}}}}catch(_0x2fa86d){logger[_0x507e('0x2e')](_0x507e('0x72'),util[_0x507e('0x30')](_0x2fa86d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x19')]=function(_0x194329){var _0x57fcc6='';try{if(this[_0x507e('0x1f')](_0x194329)){if(_0x194329[_0x507e('0x6f')]){_0x57fcc6=_0x194329[_0x507e('0x6f')][_0x507e('0x73')](0x0,_0x194329[_0x507e('0x6f')][_0x507e('0x70')]('-'));if(this[_0x507e('0xa')][_0x57fcc6]){this[_0x507e('0xa')][_0x57fcc6][_0x507e('0x71')]=![];}}}}catch(_0x473a77){logger['error'](_0x507e('0x74'),util['inspect'](_0x473a77,{'showHidden':![],'depth':null}));}};module[_0x507e('0x75')]=VoiceAgentReport; \ No newline at end of file +var _0x744b=['agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncAgentComplete','varset','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','omit','event','custom:agentcalled','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','lastevent','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','destconnectedlinenum','user:agentconnect','agentcomplete','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentconnectAt','agentcompleteAt','complete','transfer','agent','acw','agentacw','acwtime','acwTimeout','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable','keys','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','syncHangup','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','seconds','secondtransfereruniqueid','syncBlindTransfer','talktime','substring','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect'];(function(_0x48775d,_0x3599fc){var _0x4404c0=function(_0x4b5674){while(--_0x4b5674){_0x48775d['push'](_0x48775d['shift']());}};_0x4404c0(++_0x3599fc);}(_0x744b,0xe9));var _0xb744=function(_0x50f6e5,_0x151ccb){_0x50f6e5=_0x50f6e5-0x0;var _0x5988c5=_0x744b[_0x50f6e5];return _0x5988c5;};'use strict';var _=require(_0xb744('0x0'));var moment=require(_0xb744('0x1'));var util=require(_0xb744('0x2'));var Redis=require(_0xb744('0x3'));var config=require(_0xb744('0x4'));var logger=require(_0xb744('0x5'))('ami');var ami=require('../ami');config['redis']=_[_0xb744('0x6')](config[_0xb744('0x7')],{'host':_0xb744('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb744('0x7')]));function VoiceAgentReport(_0x3d701a){this[_0xb744('0x9')]={};this[_0xb744('0xa')]=_0x3d701a[_0xb744('0xa')];this[_0xb744('0xb')]=_0x3d701a[_0xb744('0xb')];this[_0xb744('0xc')]={};ami['on']('agentcalled',this[_0xb744('0xd')][_0xb744('0xe')](this));ami['on'](_0xb744('0xf'),this[_0xb744('0x10')][_0xb744('0xe')](this));ami['on'](_0xb744('0x11'),this[_0xb744('0x12')][_0xb744('0xe')](this));ami['on'](_0xb744('0x13'),this['syncQueueCallerAbandon'][_0xb744('0xe')](this));ami['on']('agentcomplete',this[_0xb744('0x14')]['bind'](this));ami['on'](_0xb744('0x15'),this['syncVarSet'][_0xb744('0xe')](this));ami['on']('hangup',this['syncHangup'][_0xb744('0xe')](this));ami['on'](_0xb744('0x16'),this[_0xb744('0x17')]['bind'](this));ami['on'](_0xb744('0x18'),this['syncMusicOnHoldStop'][_0xb744('0xe')](this));ami['on']('attendedtransfer',this[_0xb744('0x19')][_0xb744('0xe')](this));ami['on'](_0xb744('0x1a'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport['prototype'][_0xb744('0x1b')]=function(_0x3a3bee,_0x47f119,_0xe6b8fe){io['to'](_0x3a3bee)[_0xb744('0x1b')](_0x47f119,_0xe6b8fe);};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x1d')]=function(_0x1b9de5){return _0x1b9de5!==null&&!_[_0xb744('0x1e')](_0x1b9de5);};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0xd')]=function(_0x3ca17e){try{if(this[_0xb744('0x1d')](_0x3ca17e)){if(_[_0xb744('0x1e')](this[_0xb744('0x9')][_0x3ca17e[_0xb744('0x1f')]])){this[_0xb744('0x9')][_0x3ca17e[_0xb744('0x1f')]]={};}if(_[_0xb744('0x1e')](this['channels'][_0x3ca17e[_0xb744('0x1f')]][_0x3ca17e[_0xb744('0x20')]])){this[_0xb744('0x9')][_0x3ca17e['uniqueid']][_0x3ca17e[_0xb744('0x20')]]={'agentcalledAt':moment()[_0xb744('0x21')](_0xb744('0x22')),'lastevent':_0xb744('0x23'),'variables':this[_0xb744('0xc')][_0x3ca17e[_0xb744('0x1f')]],'type':this[_0xb744('0xa')][_0x3ca17e['queue']]?this[_0xb744('0xa')][_0x3ca17e[_0xb744('0x24')]][_0xb744('0x25')]||_0xb744('0x26'):_0xb744('0x26')};}_['merge'](this[_0xb744('0x9')][_0x3ca17e['uniqueid']][_0x3ca17e[_0xb744('0x20')]],_[_0xb744('0x27')](_0x3ca17e,[_0xb744('0x28'),'privilege']));ami[_0xb744('0x1b')](_0xb744('0x29'),this[_0xb744('0x9')][_0x3ca17e[_0xb744('0x1f')]][_0x3ca17e[_0xb744('0x20')]]);this[_0xb744('0x1b')](util['format'](_0xb744('0x2a'),_0x3ca17e[_0xb744('0x2b')]),_0xb744('0x2c'),this['channels'][_0x3ca17e[_0xb744('0x1f')]][_0x3ca17e['destuniqueid']]);}}catch(_0x22ca95){logger[_0xb744('0x2d')](_0xb744('0x2e'),util[_0xb744('0x2f')](_0x22ca95,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')]['syncAgentConnect']=function(_0x22da06){try{if(this[_0xb744('0x1d')](_0x22da06)){if(this['channels'][_0x22da06[_0xb744('0x1f')]]){for(var _0x2a7222 in this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]]){if(this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0xb744('0x30')](_0x2a7222)){if(_0x22da06['destuniqueid']===_0x2a7222){this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222]['agentconnectAt']=moment()['format'](_0xb744('0x22'));this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x31')]='connect';this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x32')]=_0x22da06['holdtime'];this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x33')]=_0x22da06[_0xb744('0x33')];this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222]['connectedlinename']=_0x22da06[_0xb744('0x34')];this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x35')]=_0x22da06[_0xb744('0x35')];this['channels'][_0x22da06[_0xb744('0x1f')]][_0x2a7222]['destchannelstatedesc']=_0x22da06[_0xb744('0x36')];_[_0xb744('0x37')](this['agents'][_0x22da06[_0xb744('0x38')]],_['pick'](_0x22da06,['queue',_0xb744('0x39')]));this[_0xb744('0x1b')](util[_0xb744('0x21')]('user:%s',_0x22da06[_0xb744('0x2b')]),_0xb744('0x3a'),this[_0xb744('0x9')][_0x22da06['uniqueid']][_0x22da06['destuniqueid']]);ami[_0xb744('0x1b')]('custom:agentconnect',this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222]);}else if(!this[_0xb744('0x9')][_0x22da06['uniqueid']][_0x2a7222][_0xb744('0x11')]&&!this[_0xb744('0x9')][_0x22da06['uniqueid']][_0x2a7222][_0xb744('0x3b')]){this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x11')]=!![];this[_0xb744('0x9')][_0x22da06['uniqueid']][_0x2a7222][_0xb744('0x3c')]=moment()[_0xb744('0x21')](_0xb744('0x22'));this['channels'][_0x22da06['uniqueid']][_0x2a7222][_0xb744('0x3d')]=_0xb744('0x3e');this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x31')]=_0xb744('0x3e');this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x3f')]=_0x22da06[_0xb744('0x20')];this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222][_0xb744('0x40')]=_0x22da06['membername'];ami['emit'](_0xb744('0x41'),this[_0xb744('0x9')][_0x22da06[_0xb744('0x1f')]][_0x2a7222]);}}}}}}catch(_0x165e21){logger['error'](_0xb744('0x42'),util[_0xb744('0x2f')](_0x165e21,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x12')]=function(_0x1fc3b8){try{if(this[_0xb744('0x1d')](_0x1fc3b8)){if(this[_0xb744('0x9')][_0x1fc3b8['uniqueid']]&&this['channels'][_0x1fc3b8[_0xb744('0x1f')]][_0x1fc3b8[_0xb744('0x20')]]){this[_0xb744('0x9')][_0x1fc3b8[_0xb744('0x1f')]][_0x1fc3b8['destuniqueid']][_0xb744('0x11')]=!![];this[_0xb744('0x9')][_0x1fc3b8['uniqueid']][_0x1fc3b8['destuniqueid']][_0xb744('0x3c')]=moment()[_0xb744('0x21')](_0xb744('0x22'));this[_0xb744('0x9')][_0x1fc3b8['uniqueid']][_0x1fc3b8['destuniqueid']]['reason']=_0xb744('0x43');this[_0xb744('0x9')][_0x1fc3b8['uniqueid']][_0x1fc3b8[_0xb744('0x20')]][_0xb744('0x31')]='rejected';ami[_0xb744('0x1b')](_0xb744('0x44'),this[_0xb744('0x9')][_0x1fc3b8['uniqueid']][_0x1fc3b8['destuniqueid']]);}}}catch(_0x205a3a){logger[_0xb744('0x2d')](_0xb744('0x45'),util[_0xb744('0x2f')](_0x205a3a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')]['syncQueueCallerAbandon']=function(_0x2b9ff8){try{if(this[_0xb744('0x1d')](_0x2b9ff8)){if(this['channels'][_0x2b9ff8[_0xb744('0x1f')]]){for(var _0x48b0cb in this[_0xb744('0x9')][_0x2b9ff8[_0xb744('0x1f')]]){if(this[_0xb744('0x9')][_0x2b9ff8[_0xb744('0x1f')]][_0xb744('0x30')](_0x48b0cb)&&!this['channels'][_0x2b9ff8[_0xb744('0x1f')]][_0x48b0cb][_0xb744('0x11')]&&!this['channels'][_0x2b9ff8[_0xb744('0x1f')]][_0x48b0cb][_0xb744('0x3b')]){this[_0xb744('0x9')][_0x2b9ff8[_0xb744('0x1f')]][_0x48b0cb][_0xb744('0x11')]=!![];this['channels'][_0x2b9ff8[_0xb744('0x1f')]][_0x48b0cb][_0xb744('0x3c')]=moment()[_0xb744('0x21')](_0xb744('0x22'));this[_0xb744('0x9')][_0x2b9ff8[_0xb744('0x1f')]][_0x48b0cb][_0xb744('0x3d')]=_0xb744('0x46');this['channels'][_0x2b9ff8['uniqueid']][_0x48b0cb][_0xb744('0x31')]=_0xb744('0x46');ami[_0xb744('0x1b')]('custom:agentqueuecallerabandon',this[_0xb744('0x9')][_0x2b9ff8['uniqueid']][_0x48b0cb]);}}}}}catch(_0x4345a8){logger['error'](_0xb744('0x47'),util[_0xb744('0x2f')](_0x4345a8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x14')]=function(_0x39a5c2){try{if(this['isNotNull'](_0x39a5c2)){if(this[_0xb744('0x9')][_0x39a5c2[_0xb744('0x1f')]]){for(var _0x5ddfb4 in this['channels'][_0x39a5c2['uniqueid']]){if(this[_0xb744('0x9')][_0x39a5c2[_0xb744('0x1f')]][_0xb744('0x30')](_0x5ddfb4)){if(this[_0xb744('0x9')][_0x39a5c2['uniqueid']][_0x5ddfb4][_0xb744('0x48')]&&!this['channels'][_0x39a5c2[_0xb744('0x1f')]][_0x5ddfb4]['agentcomplete']){this[_0xb744('0x9')][_0x39a5c2['uniqueid']][_0x5ddfb4][_0xb744('0x3b')]=!![];this[_0xb744('0x9')][_0x39a5c2[_0xb744('0x1f')]][_0x5ddfb4][_0xb744('0x49')]=moment()['format'](_0xb744('0x22'));this[_0xb744('0x9')][_0x39a5c2[_0xb744('0x1f')]][_0x5ddfb4]['lastevent']=_0xb744('0x4a');this['channels'][_0x39a5c2['uniqueid']][_0x5ddfb4]['talktime']=_0x39a5c2['talktime'];this[_0xb744('0x9')][_0x39a5c2[_0xb744('0x1f')]][_0x5ddfb4]['reason']=_0x39a5c2[_0xb744('0x3d')]==_0xb744('0x4b')?_0xb744('0x4c'):_0x39a5c2[_0xb744('0x3d')];if(this[_0xb744('0xa')][_0x39a5c2[_0xb744('0x24')]]&&this[_0xb744('0xa')][_0x39a5c2[_0xb744('0x24')]][_0xb744('0x4d')]){this[_0xb744('0x9')][_0x39a5c2[_0xb744('0x1f')]][_0x5ddfb4][_0xb744('0x4e')]=!![];this[_0xb744('0x9')][_0x39a5c2[_0xb744('0x1f')]][_0x5ddfb4][_0xb744('0x4f')]=this[_0xb744('0xa')][_0x39a5c2[_0xb744('0x24')]][_0xb744('0x50')];}this[_0xb744('0xb')][_0x39a5c2[_0xb744('0x38')]]=_[_0xb744('0x27')](this[_0xb744('0xb')][_0x39a5c2[_0xb744('0x38')]],[_0xb744('0x24'),'destconnectedlinenum']);this[_0xb744('0x1b')](util[_0xb744('0x21')]('user:%s',_0x39a5c2['membername']),'user:agentcomplete',this['channels'][_0x39a5c2['uniqueid']][_0x5ddfb4]);ami[_0xb744('0x1b')](_0xb744('0x51'),this[_0xb744('0x9')][_0x39a5c2['uniqueid']][_0x5ddfb4]);}}}}}}catch(_0x30ba71){logger[_0xb744('0x2d')](_0xb744('0x52'),util[_0xb744('0x2f')](_0x30ba71,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x53')]=function(_0x2553fa){try{if(this[_0xb744('0x1d')](_0x2553fa)){this[_0xb744('0x54')](_0x2553fa[_0xb744('0x1f')],_[_0xb744('0x55')](_0x2553fa[_0xb744('0x56')])[0x0],_0x2553fa['value']);if(this[_0xb744('0x9')][_0x2553fa['uniqueid']]){for(var _0x349f58 in this['channels'][_0x2553fa[_0xb744('0x1f')]]){if(this[_0xb744('0x9')][_0x2553fa[_0xb744('0x1f')]][_0xb744('0x30')](_0x349f58)){if(_[_0xb744('0x1e')](this[_0xb744('0x9')][_0x2553fa[_0xb744('0x1f')]][_0x349f58]['variables'])){this[_0xb744('0x9')][_0x2553fa[_0xb744('0x1f')]][_0x349f58][_0xb744('0xc')]={};}this['channels'][_0x2553fa[_0xb744('0x1f')]][_0x349f58][_0xb744('0xc')]=this[_0xb744('0xc')][_0x2553fa[_0xb744('0x1f')]];}}}}}catch(_0x16f02e){logger[_0xb744('0x2d')](_0xb744('0x57'),util['inspect'](_0x16f02e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x54')]=function(_0x1c3d9f,_0x42eec4,_0x5a3043){var _0x12ab8b=[_0xb744('0x58'),'rtpaudioqosbridged','rtpaudioqosjitter',_0xb744('0x59'),_0xb744('0x5a'),_0xb744('0x5b'),_0xb744('0x5c'),_0xb744('0x5d'),_0xb744('0x5e'),_0xb744('0x5f'),_0xb744('0x60'),_0xb744('0x61'),_0xb744('0x62'),_0xb744('0x63'),_0xb744('0x64'),_0xb744('0x65'),_0xb744('0x2b'),_0xb744('0x66'),_0xb744('0x67')];if(!_[_0xb744('0x68')](_0x42eec4)&&!_[_0xb744('0x69')](_0x12ab8b,_0x42eec4)){if(_['isUndefined'](this[_0xb744('0xc')][_0x1c3d9f])){this[_0xb744('0xc')][_0x1c3d9f]={};}this[_0xb744('0xc')][_0x1c3d9f][_0x42eec4]=_0x5a3043;}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x6a')]=function(_0x3ef3e6){try{if(this[_0xb744('0x1d')](_0x3ef3e6)){if(this[_0xb744('0x9')][_0x3ef3e6['uniqueid']]){for(var _0x1d22be in this['channels'][_0x3ef3e6[_0xb744('0x1f')]]){if(this[_0xb744('0x9')][_0x3ef3e6['uniqueid']][_0xb744('0x30')](_0x1d22be)){if(this[_0xb744('0x9')][_0x3ef3e6[_0xb744('0x1f')]][_0x1d22be][_0xb744('0x3d')]==_0xb744('0x4b')&&this[_0xb744('0x9')][_0x3ef3e6[_0xb744('0x1f')]][_0x1d22be][_0xb744('0x3b')]){this[_0xb744('0x9')][_0x3ef3e6['uniqueid']][_0x1d22be][_0xb744('0x49')]=moment()[_0xb744('0x21')](_0xb744('0x22'));}}}ami['emit'](_0xb744('0x6b'),_[_0xb744('0x6c')](this['channels'][_0x3ef3e6[_0xb744('0x1f')]]));delete this['channels'][_0x3ef3e6[_0xb744('0x1f')]];}if(this['variables'][_0x3ef3e6[_0xb744('0x1f')]]){delete this[_0xb744('0xc')][_0x3ef3e6['uniqueid']];}}}catch(_0x546439){logger['error'](_0xb744('0x6d'),util[_0xb744('0x2f')](_0x546439,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x19')]=function(_0x520341){try{if(this[_0xb744('0x1d')](_0x520341)){if(this[_0xb744('0x9')][_0x520341['transfereeuniqueid']]){for(var _0xd464c in this[_0xb744('0x9')][_0x520341[_0xb744('0x6e')]]){if(this['channels'][_0x520341[_0xb744('0x6e')]][_0xb744('0x30')](_0xd464c)){if(_0x520341[_0xb744('0x6f')]===_0xd464c){var _0x1d1bb2=moment();this[_0xb744('0x9')][_0x520341[_0xb744('0x6e')]][_0xd464c][_0xb744('0x3b')]=!![];this['channels'][_0x520341[_0xb744('0x6e')]][_0xd464c][_0xb744('0x49')]=moment()[_0xb744('0x21')](_0xb744('0x22'));this[_0xb744('0x9')][_0x520341['transfereeuniqueid']][_0xd464c][_0xb744('0x3d')]=_0xb744('0x4b');this[_0xb744('0x9')][_0x520341[_0xb744('0x6e')]][_0xd464c]['lastevent']='complete';this[_0xb744('0x9')][_0x520341[_0xb744('0x6e')]][_0xd464c]['talktime']=_0x1d1bb2[_0xb744('0x70')](this[_0xb744('0x9')][_0x520341[_0xb744('0x6e')]][_0xd464c][_0xb744('0x48')],_0xb744('0x71'));}}}}if(this[_0xb744('0x9')][_0x520341['secondtransfereruniqueid']]){var _0x5c7e92=this[_0xb744('0x9')][_0x520341['secondtransfereruniqueid']];this[_0xb744('0x9')][_0x520341[_0xb744('0x72')]]=this[_0xb744('0x9')][_0x520341[_0xb744('0x6e')]];this['channels'][_0x520341[_0xb744('0x6e')]]=_0x5c7e92;}}}catch(_0x3969af){logger[_0xb744('0x2d')]('[syncAttendedTransfer][VoiceAgentReport]',util[_0xb744('0x2f')](_0x3969af,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x73')]=function(_0x316e7a){try{if(this[_0xb744('0x1d')](_0x316e7a)){if(this[_0xb744('0x9')][_0x316e7a[_0xb744('0x6e')]]){for(var _0x3be3ab in this[_0xb744('0x9')][_0x316e7a[_0xb744('0x6e')]]){if(this[_0xb744('0x9')][_0x316e7a[_0xb744('0x6e')]]['hasOwnProperty'](_0x3be3ab)){if(_0x316e7a['transfereruniqueid']===_0x3be3ab){var _0x5861b0=moment();this['channels'][_0x316e7a[_0xb744('0x6e')]][_0x3be3ab][_0xb744('0x3b')]=!![];this[_0xb744('0x9')][_0x316e7a['transfereeuniqueid']][_0x3be3ab][_0xb744('0x49')]=_0x5861b0;this[_0xb744('0x9')][_0x316e7a[_0xb744('0x6e')]][_0x3be3ab][_0xb744('0x3d')]=_0xb744('0x4b');this[_0xb744('0x9')][_0x316e7a[_0xb744('0x6e')]][_0x3be3ab]['lastevent']=_0xb744('0x4a');this[_0xb744('0x9')][_0x316e7a[_0xb744('0x6e')]][_0x3be3ab][_0xb744('0x74')]=_0x5861b0[_0xb744('0x70')](this[_0xb744('0x9')][_0x316e7a[_0xb744('0x6e')]][_0x3be3ab][_0xb744('0x48')],'seconds');}}}}}}catch(_0x10687f){logger[_0xb744('0x2d')]('[syncBlindTransfer][VoiceAgentReport]',util['inspect'](_0x10687f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')]['syncMusicOnHoldStart']=function(_0x4bd993){var _0xdc60c6='';try{if(this[_0xb744('0x1d')](_0x4bd993)){if(_0x4bd993['channel']){_0xdc60c6=_0x4bd993['channel'][_0xb744('0x75')](0x0,_0x4bd993[_0xb744('0x76')][_0xb744('0x77')]('-'));if(this[_0xb744('0xb')][_0xdc60c6]){this[_0xb744('0xb')][_0xdc60c6][_0xb744('0x78')]=!![];}}}}catch(_0x4de3fb){logger[_0xb744('0x2d')](_0xb744('0x79'),util[_0xb744('0x2f')](_0x4de3fb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xb744('0x1c')][_0xb744('0x7a')]=function(_0x5955c7){var _0x1d0a6f='';try{if(this[_0xb744('0x1d')](_0x5955c7)){if(_0x5955c7['channel']){_0x1d0a6f=_0x5955c7[_0xb744('0x76')][_0xb744('0x75')](0x0,_0x5955c7[_0xb744('0x76')][_0xb744('0x77')]('-'));if(this['agents'][_0x1d0a6f]){this[_0xb744('0xb')][_0x1d0a6f][_0xb744('0x78')]=![];}}}}catch(_0x2d50a1){logger[_0xb744('0x2d')](_0xb744('0x7b'),util[_0xb744('0x2f')](_0x2d50a1,{'showHidden':![],'depth':null}));}};module[_0xb744('0x7c')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 842c1f3..2ffbe6b 100644 --- a/server/services/ami/report/voiceCallReport.js +++ b/server/services/ami/report/voiceCallReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c5b=['starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','pick','context','split','destconnectedlinenum','exten','format','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','syncNewExten','application','applicationdata','appdata','toLowerCase','subtract','duration','seconds','disposition','includes','lastapplication','lastdata','startsWith','cdr(','match','queue','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','calleridnum','connectedlinenum','connectedlinename','destinationchannel','channelstate','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','.wav49','.WAV','monitorFilename','find','monitors','push','rec','syncVarSet','variable','xmd-phone','value','xmd-callerid','callerid','xmd-cdrtype','xmd-queue','xmd-destination','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','endtime','billableseconds','diff','from-sip','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfercalleridnum','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','exports','moment','util','path','../../../config/logger','../ami','../model/channel','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','set','agi','playback','voicemail','NO\x20ANSWER','BUSY','FAILED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstop','syncMusicOnHoldStop','resolve','then','catch','log','isNotNull','isUndefined','prototype','emit','linkedid','uniqueid','merge','error','inspect','channel','OutgoingSpoolFailed'];(function(_0xc9586d,_0x1fab57){var _0x38443d=function(_0x1830b8){while(--_0x1830b8){_0xc9586d['push'](_0xc9586d['shift']());}};_0x38443d(++_0x1fab57);}(_0x1c5b,0x184));var _0xb1c5=function(_0x5e14a8,_0x1c15c1){_0x5e14a8=_0x5e14a8-0x0;var _0x1b4ec9=_0x1c5b[_0x5e14a8];return _0x1b4ec9;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0xb1c5('0x0'));var util=require(_0xb1c5('0x1'));var path=require(_0xb1c5('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xb1c5('0x3'))('ami');var ami=require(_0xb1c5('0x4'));var Channel=require(_0xb1c5('0x5'));var statusDesc=[_0xb1c5('0x6'),_0xb1c5('0x7'),'inuse',_0xb1c5('0x8'),_0xb1c5('0x9'),_0xb1c5('0xa'),_0xb1c5('0xb'),_0xb1c5('0xc'),'onhold'];var applications=[_0xb1c5('0xd'),'queue',_0xb1c5('0xe'),'dial',_0xb1c5('0xf'),_0xb1c5('0x10')];var dispositions=[_0xb1c5('0x11'),'FAILED','FAILED',_0xb1c5('0x11'),'NO\x20ANSWER',_0xb1c5('0x11'),'ANSWERED',_0xb1c5('0x12'),_0xb1c5('0x13'),_0xb1c5('0x13'),_0xb1c5('0x13')];var actions={};config[_0xb1c5('0x14')]=_[_0xb1c5('0x15')](config[_0xb1c5('0x14')],{'host':_0xb1c5('0x16'),'port':0x18eb});var io=require(_0xb1c5('0x17'))(new Redis(config[_0xb1c5('0x14')]));function VoiceCallReport(_0x5625a0){this[_0xb1c5('0x18')]=_0x5625a0[_0xb1c5('0x18')];this[_0xb1c5('0x19')]=_0x5625a0['agents'];ami['on'](_0xb1c5('0x1a'),this['syncNewExten'][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x1c'),this['syncNewExten'][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x1d'),this[_0xb1c5('0x1e')][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x1f'),this[_0xb1c5('0x20')][_0xb1c5('0x1b')](this));ami['on']('varset',this['syncVarSet'][_0xb1c5('0x1b')](this));ami['on']('hangup',this[_0xb1c5('0x21')][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x22'),this[_0xb1c5('0x23')][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x24'),this[_0xb1c5('0x25')][_0xb1c5('0x1b')](this));ami['on']('blindtransfer',this[_0xb1c5('0x26')][_0xb1c5('0x1b')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x27'),this[_0xb1c5('0x28')]['bind'](this));return BPromise[_0xb1c5('0x29')]()[_0xb1c5('0x2a')](ami['actionCoreShowChannels']())[_0xb1c5('0x2b')](function(_0x292b2b){console[_0xb1c5('0x2c')](_0x292b2b);});}VoiceCallReport['prototype'][_0xb1c5('0x2d')]=function(_0x50b2ac){return _0x50b2ac!==null&&!_[_0xb1c5('0x2e')](_0x50b2ac);};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x30')]=function(_0x5240c4,_0x192d3e,_0x2676c0){io['to'](_0x5240c4)[_0xb1c5('0x30')](_0x192d3e,_0x2676c0);};VoiceCallReport[_0xb1c5('0x2f')]['syncNewCallerId']=function(_0x30c54d){try{if(this[_0xb1c5('0x2d')](_0x30c54d)){if(_0x30c54d['uniqueid']===_0x30c54d[_0xb1c5('0x31')]){if(!_['isUndefined'](this[_0xb1c5('0x18')][_0x30c54d[_0xb1c5('0x32')]])){_[_0xb1c5('0x33')](this[_0xb1c5('0x18')][_0x30c54d[_0xb1c5('0x32')]],_['pick'](_0x30c54d,_['keys'](this[_0xb1c5('0x18')][_0x30c54d[_0xb1c5('0x32')]])));}}}}catch(_0x69a84b){logger[_0xb1c5('0x34')]('[syncNewCallerId][VoiceCallReport]',util[_0xb1c5('0x35')](_0x69a84b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x1e')]=function(_0x245ac9){try{if(this['isNotNull'](_0x245ac9)){if(_0x245ac9['uniqueid']===_0x245ac9[_0xb1c5('0x31')]&&_0x245ac9[_0xb1c5('0x36')]!=_0xb1c5('0x37')){if(_[_0xb1c5('0x2e')](this[_0xb1c5('0x18')][_0x245ac9[_0xb1c5('0x32')]])){this[_0xb1c5('0x18')][_0x245ac9['uniqueid']]=new Channel();this[_0xb1c5('0x18')][_0x245ac9[_0xb1c5('0x32')]][_0xb1c5('0x38')]=moment()['format'](_0xb1c5('0x39'));this['channels'][_0x245ac9['uniqueid']]['disposition']=dispositions[_[_0xb1c5('0x3a')](_0x245ac9['channelstate'])];_[_0xb1c5('0x33')](this[_0xb1c5('0x18')][_0x245ac9['uniqueid']],_[_0xb1c5('0x3b')](_0x245ac9,_['keys'](this[_0xb1c5('0x18')][_0x245ac9[_0xb1c5('0x32')]])));if(_0x245ac9[_0xb1c5('0x3c')]==='from-sip'){if(this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]){this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')]['split']('-')[0x0]][_0xb1c5('0x3e')]=_0x245ac9[_0xb1c5('0x3f')];this[_0xb1c5('0x30')](util[_0xb1c5('0x40')](_0xb1c5('0x41'),this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]][_0xb1c5('0x42')]),_0xb1c5('0x43'),{'destaccountcode':this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]][_0xb1c5('0x44')],'destconnectedlinenum':_0x245ac9[_0xb1c5('0x3f')]});}}}}}}catch(_0xd54fb1){logger[_0xb1c5('0x34')](_0xb1c5('0x45'),util['inspect'](_0xd54fb1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb1c5('0x46')]=function(_0x41203c){try{if(this[_0xb1c5('0x2d')](_0x41203c)){if(_0x41203c['uniqueid']===_0x41203c[_0xb1c5('0x31')]&&_0x41203c[_0xb1c5('0x3f')]!='h'&&_0x41203c[_0xb1c5('0x36')]!=_0xb1c5('0x37')){_0x41203c[_0xb1c5('0x47')]=_0x41203c[_0xb1c5('0x47')]['toLowerCase']();_0x41203c[_0xb1c5('0x48')]=(_0x41203c[_0xb1c5('0x49')]||_0x41203c['applicationdata'])[_0xb1c5('0x4a')]();if(_[_0xb1c5('0x2e')](this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]])){this[_0xb1c5('0x18')][_0x41203c['uniqueid']]=new Channel();this[_0xb1c5('0x18')][_0x41203c['uniqueid']]['starttime']=_0x41203c['duration']?moment()[_0xb1c5('0x4b')](moment[_0xb1c5('0x4c')](_0x41203c['duration'])[_0xb1c5('0x4d')](),_0xb1c5('0x4d'))[_0xb1c5('0x40')](_0xb1c5('0x39')):moment()[_0xb1c5('0x40')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x41203c['uniqueid']][_0xb1c5('0x4e')]='NO\x20ANSWER';}_['merge'](this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]],_[_0xb1c5('0x3b')](_0x41203c,_['keys'](this[_0xb1c5('0x18')][_0x41203c['uniqueid']])));if(_[_0xb1c5('0x4f')](applications,_0x41203c[_0xb1c5('0x47')])){this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]][_0xb1c5('0x50')]=_0x41203c['application'];this[_0xb1c5('0x18')][_0x41203c['uniqueid']][_0xb1c5('0x51')]=_0x41203c[_0xb1c5('0x48')];if(_0x41203c[_0xb1c5('0x47')]===_0xb1c5('0xd')&&_[_0xb1c5('0x52')](_0x41203c[_0xb1c5('0x48')],_0xb1c5('0x53'))){var _0x2c2c43=_0x41203c[_0xb1c5('0x48')][_0xb1c5('0x3d')]('=');var _0x962cd0=_0x2c2c43[0x0][_0xb1c5('0x54')](/cdr\((.*)\)/);if(_0x962cd0){this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]][_0x962cd0[0x1]]=_0x2c2c43[0x1];}}else if(_0x41203c[_0xb1c5('0x47')]===_0xb1c5('0x55')){this[_0xb1c5('0x18')][_0x41203c['uniqueid']][_0xb1c5('0x55')]=_0x41203c[_0xb1c5('0x48')][_0xb1c5('0x3d')](',')[0x0];}}}}}catch(_0x176ab1){logger['error'](_0xb1c5('0x56'),util[_0xb1c5('0x35')](_0x176ab1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x20')]=function(_0x10fc55){try{if(this['isNotNull'](_0x10fc55)){if(_0x10fc55[_0xb1c5('0x32')]!==_0x10fc55[_0xb1c5('0x31')]){if(this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]]){if(_0x10fc55['channelstate']==='6'){if(!this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x57')]){var _0x4ca421=moment();this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]]['answered']=!![];this['channels'][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x58')]=_0x4ca421[_0xb1c5('0x40')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x38')]){this['channels'][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x59')]=_0x4ca421['diff'](this['channels'][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x38')],'seconds');}}this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x31')]=_0x10fc55['uniqueid'];if(_0x10fc55[_0xb1c5('0x5a')]!=='xcally-motion-preview'){this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x5b')]=_0x10fc55['calleridnum'];}this[_0xb1c5('0x18')][_0x10fc55['linkedid']][_0xb1c5('0x5c')]=_0x10fc55['calleridname'];this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x5d')]=_0x10fc55[_0xb1c5('0x36')];this[_0xb1c5('0x18')][_0x10fc55['linkedid']][_0xb1c5('0x4e')]=dispositions[_[_0xb1c5('0x3a')](_0x10fc55[_0xb1c5('0x5e')])];if(this['agents'][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]){this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x5f')]=this[_0xb1c5('0x19')][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['id'];this['channels'][_0x10fc55['linkedid']][_0xb1c5('0x60')]=this['agents'][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['name'];}}}}else{if(this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x32')]]){if(_0x10fc55['channelstate']==='6'){if(this['agents'][_0x10fc55[_0xb1c5('0x36')]['split']('-')[0x0]]){this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x32')]]['UserId']=this[_0xb1c5('0x19')][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['id'];this['channels'][_0x10fc55[_0xb1c5('0x32')]]['membername']=this[_0xb1c5('0x19')][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['name'];}}}}}}catch(_0xfab471){logger[_0xb1c5('0x34')](_0xb1c5('0x61'),util['inspect'](_0xfab471,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x62')]=function(_0x5bdd4e,_0xa9ac6c){if(this['channels'][_0x5bdd4e]){this[_0xb1c5('0x18')][_0x5bdd4e][_0xb1c5('0x63')]=!![];if(_['endsWith'](_0xa9ac6c,'.wav49')){_0xa9ac6c=_0xa9ac6c[_0xb1c5('0x64')](_0xb1c5('0x65'),_0xb1c5('0x66'));}this[_0xb1c5('0x18')][_0x5bdd4e][_0xb1c5('0x67')]=_0xa9ac6c;var _0x5811ea=_[_0xb1c5('0x68')](this[_0xb1c5('0x18')][_0x5bdd4e]['monitors'],{'filename':_0xa9ac6c});if(_['isNil'](_0x5811ea)){this[_0xb1c5('0x18')][_0x5bdd4e][_0xb1c5('0x69')][_0xb1c5('0x6a')]({'filename':_0xa9ac6c,'createdAt':moment()[_0xb1c5('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xb1c5('0x6b')});}}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x6c')]=function(_0x4a13f7){try{if(this[_0xb1c5('0x2d')](_0x4a13f7)){if(this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]]&&_0x4a13f7[_0xb1c5('0x36')]!='OutgoingSpoolFailed'){if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')])){if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')]['mixmonitor_filename'])){this[_0xb1c5('0x62')](_0x4a13f7[_0xb1c5('0x32')],_0x4a13f7['value']);}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x6e')])){this['channels'][_0x4a13f7['uniqueid']]['calleridnum']=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x70')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x71')]=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x72')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]]['type']=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7['variable'][_0xb1c5('0x73')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x55')]=_0x4a13f7[_0xb1c5('0x6f')][_0xb1c5('0x3d')](',')[0x0];}else if(this['isNotNull'](_0x4a13f7[_0xb1c5('0x6d')]['xmd-originatecalleridnum'])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]]['originatecalleridnum']=_0x4a13f7['value'];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x74')])){this[_0xb1c5('0x18')][_0x4a13f7['uniqueid']]['destination']=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7['variable']['xmd-callerid-preview'])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x75')]=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x76')])){this['channels'][_0x4a13f7['uniqueid']][_0xb1c5('0x55')]=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x77')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x78')]=_0x4a13f7[_0xb1c5('0x6f')];}}}else if(this[_0xb1c5('0x2d')](_0x4a13f7['variable']['mixmonitor_filename'])){if(_0x4a13f7[_0xb1c5('0x6f')]){var _0x18cbbb=path['parse'](_0x4a13f7[_0xb1c5('0x6f')])[_0xb1c5('0x42')];this[_0xb1c5('0x62')](_0x18cbbb,_0x4a13f7[_0xb1c5('0x6f')]);}}else if(this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x31')]]){if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')])){if(this[_0xb1c5('0x2d')](_0x4a13f7['variable']['sipcallid'])){this['channels'][_0x4a13f7[_0xb1c5('0x31')]][_0xb1c5('0x79')]=_0x4a13f7['value'];}}}}}catch(_0x2bdb73){logger[_0xb1c5('0x34')]('[syncVarSet][VoiceCallReport]',util[_0xb1c5('0x35')](_0x2bdb73,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x21')]=function(_0x6fa320){try{if(this['isNotNull'](_0x6fa320)){if(this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]]){var _0x314b97=moment();this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x7a')]=_0x314b97['format'](_0xb1c5('0x39'));this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x4c')]=_0x314b97['diff'](this['channels'][_0x6fa320['uniqueid']][_0xb1c5('0x38')],_0xb1c5('0x4d'));if(this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x57')]){this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x7b')]=_0x314b97[_0xb1c5('0x7c')](this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]]['answertime'],'seconds');this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x59')]=this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x4c')]-this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x7b')];}if(_0x6fa320[_0xb1c5('0x3c')]===_0xb1c5('0x7d')){if(this[_0xb1c5('0x19')][_0x6fa320[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]){this[_0xb1c5('0x19')][_0x6fa320[_0xb1c5('0x36')]['split']('-')[0x0]]=_[_0xb1c5('0x7e')](this[_0xb1c5('0x19')][_0x6fa320[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]],[_0xb1c5('0x3e')]);this[_0xb1c5('0x30')](util[_0xb1c5('0x40')](_0xb1c5('0x41'),this[_0xb1c5('0x19')][_0x6fa320['channel'][_0xb1c5('0x3d')]('-')[0x0]][_0xb1c5('0x42')]),_0xb1c5('0x7f'),{'destaccountcode':this[_0xb1c5('0x19')][_0x6fa320['channel'][_0xb1c5('0x3d')]('-')[0x0]]['accountcode']});}}ami[_0xb1c5('0x30')](_0xb1c5('0x80'),this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]]);delete this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]];}}}catch(_0x167863){logger[_0xb1c5('0x34')](_0xb1c5('0x81'),util[_0xb1c5('0x35')](_0x167863,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x25')]=function(_0x56880f){try{if(this[_0xb1c5('0x2d')](_0x56880f)){if(this[_0xb1c5('0x18')][_0x56880f['transfereeuniqueid']]){this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x82')]]['transfercalleridnum']=_0x56880f[_0xb1c5('0x83')];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x82')]][_0xb1c5('0x84')]=_0x56880f[_0xb1c5('0x85')];if(this[_0xb1c5('0x18')][_0x56880f['secondtransfereruniqueid']]){var _0x12ea68=this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x86')]];this[_0xb1c5('0x18')][_0x56880f['secondtransfereruniqueid']]=this['channels'][_0x56880f[_0xb1c5('0x82')]];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x82')]]=_0x12ea68;}}else if(this[_0xb1c5('0x18')][_0x56880f['transfertargetuniqueid']]){this[_0xb1c5('0x18')][_0x56880f['transfertargetuniqueid']][_0xb1c5('0x87')]=_0x56880f['origtransferercalleridnum'];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x88')]][_0xb1c5('0x84')]=_0x56880f[_0xb1c5('0x85')];if(this['channels'][_0x56880f[_0xb1c5('0x89')]]){var _0x12ea68=this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x89')]];this[_0xb1c5('0x18')][_0x56880f['origtransfereruniqueid']]=this[_0xb1c5('0x18')][_0x56880f['transfertargetuniqueid']];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x88')]]=_0x12ea68;}}}}catch(_0x29fd1d){logger['error'](_0xb1c5('0x8a'),util[_0xb1c5('0x35')](_0x29fd1d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')]['syncBlindTransfer']=function(_0x1f9bef){try{if(this[_0xb1c5('0x2d')](_0x1f9bef)){if(this[_0xb1c5('0x18')][_0x1f9bef[_0xb1c5('0x82')]]){this['channels'][_0x1f9bef[_0xb1c5('0x82')]][_0xb1c5('0x87')]=_0x1f9bef['transfereecalleridnum'];this[_0xb1c5('0x18')][_0x1f9bef[_0xb1c5('0x82')]][_0xb1c5('0x84')]=_0x1f9bef[_0xb1c5('0x8b')];this['syncHangup']({'event':_0xb1c5('0x8c'),'uniqueid':_0x1f9bef[_0xb1c5('0x82')],'context':_0x1f9bef[_0xb1c5('0x3c')],'channel':_0x1f9bef[_0xb1c5('0x8d')]});}}}catch(_0x14ff3f){logger['error'](_0xb1c5('0x8e'),util[_0xb1c5('0x35')](_0x14ff3f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')]['syncMusicOnHoldStart']=function(_0x4d2e13){try{if(this[_0xb1c5('0x2d')](_0x4d2e13)){if(this[_0xb1c5('0x18')][_0x4d2e13[_0xb1c5('0x32')]]){if(!_[_0xb1c5('0x8f')](this[_0xb1c5('0x18')][_0x4d2e13[_0xb1c5('0x32')]][_0xb1c5('0x58')])){this[_0xb1c5('0x18')][_0x4d2e13['uniqueid']][_0xb1c5('0x90')]=moment()[_0xb1c5('0x40')](_0xb1c5('0x39'));}}}}catch(_0x4e40e7){logger[_0xb1c5('0x34')](_0xb1c5('0x91'),util['inspect'](_0x4e40e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x28')]=function(_0x374c3f){try{if(this[_0xb1c5('0x2d')](_0x374c3f)){if(this[_0xb1c5('0x18')][_0x374c3f[_0xb1c5('0x32')]]){if(!_[_0xb1c5('0x8f')](this['channels'][_0x374c3f[_0xb1c5('0x32')]][_0xb1c5('0x90')])){this[_0xb1c5('0x18')][_0x374c3f['uniqueid']][_0xb1c5('0x92')]+=moment()['milliseconds'](0x0)[_0xb1c5('0x7c')](this[_0xb1c5('0x18')][_0x374c3f[_0xb1c5('0x32')]][_0xb1c5('0x90')],_0xb1c5('0x4d'));delete this[_0xb1c5('0x18')][_0x374c3f[_0xb1c5('0x32')]][_0xb1c5('0x90')];}}}}catch(_0x274ec8){logger[_0xb1c5('0x34')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0xb1c5('0x35')](_0x274ec8,{'showHidden':![],'depth':null}));}};module[_0xb1c5('0x93')]=VoiceCallReport; \ No newline at end of file +var _0x702c=['.WAV','monitorFilename','monitors','push','variable','mixmonitor_filename','value','xmd-phone','xmd-queue','xmd-originatecalleridnum','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','parse','sipcallid','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','omit','destconnectedlinenum','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfercalleridnum','transfereecalleridnum','extension','syncHangup','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','moment','util','path','../../../config/environment','../../../config/logger','ami','../model/channel','unknown','busy','invalid','unavailable','ringing','ringinuse','onhold','queue','agi','playback','voicemail','FAILED','NO\x20ANSWER','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newchannel','syncNewState','varset','syncVarSet','hangup','newcallerid','syncAttendedTransfer','syncMusicOnHoldStop','actionCoreShowChannels','log','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','pick','error','syncNewChannel','starttime','format','disposition','toNumber','channelstate','keys','context','from-sip','channel','split','exten','user:%s','name','accountcode','inspect','OutgoingSpoolFailed','application','applicationdata','appdata','toLowerCase','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','merge','includes','lastapplication','lastdata','set','startsWith','cdr(','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49'];(function(_0x39bc70,_0x5925da){var _0x37ee2c=function(_0x3fe8c8){while(--_0x3fe8c8){_0x39bc70['push'](_0x39bc70['shift']());}};_0x37ee2c(++_0x5925da);}(_0x702c,0x1e4));var _0xc702=function(_0x1b95b8,_0x560146){_0x1b95b8=_0x1b95b8-0x0;var _0x1f3fee=_0x702c[_0x1b95b8];return _0x1f3fee;};'use strict';var BPromise=require(_0xc702('0x0'));var _=require(_0xc702('0x1'));var moment=require(_0xc702('0x2'));var util=require(_0xc702('0x3'));var path=require(_0xc702('0x4'));var Redis=require('ioredis');var config=require(_0xc702('0x5'));var logger=require(_0xc702('0x6'))(_0xc702('0x7'));var ami=require('../ami');var Channel=require(_0xc702('0x8'));var statusDesc=[_0xc702('0x9'),'not_inuse','inuse',_0xc702('0xa'),_0xc702('0xb'),_0xc702('0xc'),_0xc702('0xd'),_0xc702('0xe'),_0xc702('0xf')];var applications=['set',_0xc702('0x10'),_0xc702('0x11'),'dial',_0xc702('0x12'),_0xc702('0x13')];var dispositions=['NO\x20ANSWER',_0xc702('0x14'),_0xc702('0x14'),_0xc702('0x15'),_0xc702('0x15'),'NO\x20ANSWER','ANSWERED','BUSY',_0xc702('0x14'),_0xc702('0x14'),_0xc702('0x14')];var actions={};config[_0xc702('0x16')]=_[_0xc702('0x17')](config['redis'],{'host':_0xc702('0x18'),'port':0x18eb});var io=require(_0xc702('0x19'))(new Redis(config['redis']));function VoiceCallReport(_0x2f3293){this[_0xc702('0x1a')]=_0x2f3293[_0xc702('0x1a')];this[_0xc702('0x1b')]=_0x2f3293[_0xc702('0x1b')];ami['on'](_0xc702('0x1c'),this[_0xc702('0x1d')][_0xc702('0x1e')](this));ami['on']('newexten',this['syncNewExten'][_0xc702('0x1e')](this));ami['on'](_0xc702('0x1f'),this['syncNewChannel'][_0xc702('0x1e')](this));ami['on']('newstate',this[_0xc702('0x20')][_0xc702('0x1e')](this));ami['on'](_0xc702('0x21'),this[_0xc702('0x22')][_0xc702('0x1e')](this));ami['on'](_0xc702('0x23'),this['syncHangup'][_0xc702('0x1e')](this));ami['on'](_0xc702('0x24'),this['syncNewCallerId'][_0xc702('0x1e')](this));ami['on']('attendedtransfer',this[_0xc702('0x25')][_0xc702('0x1e')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xc702('0x1e')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart']['bind'](this));ami['on']('musiconholdstop',this[_0xc702('0x26')][_0xc702('0x1e')](this));return BPromise['resolve']()['then'](ami[_0xc702('0x27')]())['catch'](function(_0x579062){console[_0xc702('0x28')](_0x579062);});}VoiceCallReport[_0xc702('0x29')][_0xc702('0x2a')]=function(_0x3716ac){return _0x3716ac!==null&&!_[_0xc702('0x2b')](_0x3716ac);};VoiceCallReport[_0xc702('0x29')][_0xc702('0x2c')]=function(_0x565d9a,_0x6b8692,_0x42938a){io['to'](_0x565d9a)[_0xc702('0x2c')](_0x6b8692,_0x42938a);};VoiceCallReport[_0xc702('0x29')]['syncNewCallerId']=function(_0xfb9692){try{if(this[_0xc702('0x2a')](_0xfb9692)){if(_0xfb9692[_0xc702('0x2d')]===_0xfb9692[_0xc702('0x2e')]){if(!_[_0xc702('0x2b')](this[_0xc702('0x1a')][_0xfb9692[_0xc702('0x2d')]])){_['merge'](this['channels'][_0xfb9692['uniqueid']],_[_0xc702('0x2f')](_0xfb9692,_['keys'](this['channels'][_0xfb9692[_0xc702('0x2d')]])));}}}}catch(_0x417cf6){logger[_0xc702('0x30')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x417cf6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc702('0x29')][_0xc702('0x31')]=function(_0x12a14f){try{if(this[_0xc702('0x2a')](_0x12a14f)){if(_0x12a14f['uniqueid']===_0x12a14f[_0xc702('0x2e')]&&_0x12a14f['channel']!='OutgoingSpoolFailed'){if(_[_0xc702('0x2b')](this['channels'][_0x12a14f[_0xc702('0x2d')]])){this[_0xc702('0x1a')][_0x12a14f[_0xc702('0x2d')]]=new Channel();this['channels'][_0x12a14f[_0xc702('0x2d')]][_0xc702('0x32')]=moment()[_0xc702('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc702('0x1a')][_0x12a14f[_0xc702('0x2d')]][_0xc702('0x34')]=dispositions[_[_0xc702('0x35')](_0x12a14f[_0xc702('0x36')])];_['merge'](this[_0xc702('0x1a')][_0x12a14f[_0xc702('0x2d')]],_[_0xc702('0x2f')](_0x12a14f,_[_0xc702('0x37')](this[_0xc702('0x1a')][_0x12a14f['uniqueid']])));if(_0x12a14f[_0xc702('0x38')]===_0xc702('0x39')){if(this[_0xc702('0x1b')][_0x12a14f[_0xc702('0x3a')][_0xc702('0x3b')]('-')[0x0]]){this['agents'][_0x12a14f[_0xc702('0x3a')]['split']('-')[0x0]]['destconnectedlinenum']=_0x12a14f[_0xc702('0x3c')];this[_0xc702('0x2c')](util['format'](_0xc702('0x3d'),this[_0xc702('0x1b')][_0x12a14f[_0xc702('0x3a')][_0xc702('0x3b')]('-')[0x0]][_0xc702('0x3e')]),'user:agentconnect',{'destaccountcode':this[_0xc702('0x1b')][_0x12a14f['channel'][_0xc702('0x3b')]('-')[0x0]][_0xc702('0x3f')],'destconnectedlinenum':_0x12a14f['exten']});}}}}}}catch(_0x17f0e8){logger[_0xc702('0x30')]('[syncNewChannel][VoiceCallReport]',util[_0xc702('0x40')](_0x17f0e8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc702('0x29')]['syncNewExten']=function(_0x545c10){try{if(this[_0xc702('0x2a')](_0x545c10)){if(_0x545c10[_0xc702('0x2d')]===_0x545c10[_0xc702('0x2e')]&&_0x545c10[_0xc702('0x3c')]!='h'&&_0x545c10[_0xc702('0x3a')]!=_0xc702('0x41')){_0x545c10['application']=_0x545c10[_0xc702('0x42')]['toLowerCase']();_0x545c10[_0xc702('0x43')]=(_0x545c10[_0xc702('0x44')]||_0x545c10[_0xc702('0x43')])[_0xc702('0x45')]();if(_[_0xc702('0x2b')](this[_0xc702('0x1a')][_0x545c10[_0xc702('0x2d')]])){this['channels'][_0x545c10['uniqueid']]=new Channel();this[_0xc702('0x1a')][_0x545c10[_0xc702('0x2d')]][_0xc702('0x32')]=_0x545c10[_0xc702('0x46')]?moment()['subtract'](moment[_0xc702('0x46')](_0x545c10[_0xc702('0x46')])[_0xc702('0x47')](),_0xc702('0x47'))[_0xc702('0x33')]('YYYY-MM-DD\x20HH:mm:ss'):moment()['format'](_0xc702('0x48'));this[_0xc702('0x1a')][_0x545c10[_0xc702('0x2d')]][_0xc702('0x34')]='NO\x20ANSWER';}_[_0xc702('0x49')](this['channels'][_0x545c10[_0xc702('0x2d')]],_[_0xc702('0x2f')](_0x545c10,_[_0xc702('0x37')](this['channels'][_0x545c10[_0xc702('0x2d')]])));if(_[_0xc702('0x4a')](applications,_0x545c10[_0xc702('0x42')])){this[_0xc702('0x1a')][_0x545c10[_0xc702('0x2d')]][_0xc702('0x4b')]=_0x545c10[_0xc702('0x42')];this[_0xc702('0x1a')][_0x545c10[_0xc702('0x2d')]][_0xc702('0x4c')]=_0x545c10['applicationdata'];if(_0x545c10['application']===_0xc702('0x4d')&&_[_0xc702('0x4e')](_0x545c10[_0xc702('0x43')],_0xc702('0x4f'))){var _0x18409=_0x545c10[_0xc702('0x43')][_0xc702('0x3b')]('=');var _0x20b8fa=_0x18409[0x0]['match'](/cdr\((.*)\)/);if(_0x20b8fa){this[_0xc702('0x1a')][_0x545c10[_0xc702('0x2d')]][_0x20b8fa[0x1]]=_0x18409[0x1];}}else if(_0x545c10[_0xc702('0x42')]===_0xc702('0x10')){this[_0xc702('0x1a')][_0x545c10['uniqueid']][_0xc702('0x10')]=_0x545c10['applicationdata'][_0xc702('0x3b')](',')[0x0];}}}}}catch(_0x3299de){logger[_0xc702('0x30')](_0xc702('0x50'),util[_0xc702('0x40')](_0x3299de,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc702('0x29')]['syncNewState']=function(_0x56df69){try{if(this[_0xc702('0x2a')](_0x56df69)){if(_0x56df69['uniqueid']!==_0x56df69[_0xc702('0x2e')]){if(this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2e')]]){if(_0x56df69[_0xc702('0x36')]==='6'){if(!this[_0xc702('0x1a')][_0x56df69['linkedid']][_0xc702('0x51')]){var _0x62fd5c=moment();this['channels'][_0x56df69[_0xc702('0x2e')]][_0xc702('0x51')]=!![];this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2e')]][_0xc702('0x52')]=_0x62fd5c[_0xc702('0x33')](_0xc702('0x48'));if(this['channels'][_0x56df69[_0xc702('0x2e')]][_0xc702('0x32')]){this[_0xc702('0x1a')][_0x56df69['linkedid']][_0xc702('0x53')]=_0x62fd5c[_0xc702('0x54')](this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2e')]][_0xc702('0x32')],_0xc702('0x47'));}}this['channels'][_0x56df69['linkedid']][_0xc702('0x2e')]=_0x56df69[_0xc702('0x2d')];if(_0x56df69[_0xc702('0x55')]!==_0xc702('0x56')){this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2e')]][_0xc702('0x57')]=_0x56df69['calleridnum'];}this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2e')]][_0xc702('0x58')]=_0x56df69['calleridname'];this['channels'][_0x56df69[_0xc702('0x2e')]][_0xc702('0x59')]=_0x56df69[_0xc702('0x3a')];this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2e')]][_0xc702('0x34')]=dispositions[_[_0xc702('0x35')](_0x56df69[_0xc702('0x36')])];if(this[_0xc702('0x1b')][_0x56df69[_0xc702('0x3a')][_0xc702('0x3b')]('-')[0x0]]){this['channels'][_0x56df69['linkedid']][_0xc702('0x5a')]=this[_0xc702('0x1b')][_0x56df69[_0xc702('0x3a')]['split']('-')[0x0]]['id'];this['channels'][_0x56df69[_0xc702('0x2e')]]['membername']=this['agents'][_0x56df69[_0xc702('0x3a')][_0xc702('0x3b')]('-')[0x0]]['name'];}}}}else{if(this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2d')]]){if(_0x56df69[_0xc702('0x36')]==='6'){if(this[_0xc702('0x1b')][_0x56df69[_0xc702('0x3a')][_0xc702('0x3b')]('-')[0x0]]){this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2d')]][_0xc702('0x5a')]=this[_0xc702('0x1b')][_0x56df69[_0xc702('0x3a')][_0xc702('0x3b')]('-')[0x0]]['id'];this[_0xc702('0x1a')][_0x56df69[_0xc702('0x2d')]][_0xc702('0x5b')]=this[_0xc702('0x1b')][_0x56df69['channel']['split']('-')[0x0]]['name'];}}}}}}catch(_0xbbf113){logger[_0xc702('0x30')](_0xc702('0x5c'),util[_0xc702('0x40')](_0xbbf113,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc702('0x29')][_0xc702('0x5d')]=function(_0x402395,_0x1b5ca9){if(this['channels'][_0x402395]){this[_0xc702('0x1a')][_0x402395][_0xc702('0x5e')]=!![];if(_['endsWith'](_0x1b5ca9,_0xc702('0x5f'))){_0x1b5ca9=_0x1b5ca9['replace'](_0xc702('0x5f'),_0xc702('0x60'));}this[_0xc702('0x1a')][_0x402395][_0xc702('0x61')]=_0x1b5ca9;var _0x3302e0=_['find'](this[_0xc702('0x1a')][_0x402395][_0xc702('0x62')],{'filename':_0x1b5ca9});if(_['isNil'](_0x3302e0)){this[_0xc702('0x1a')][_0x402395][_0xc702('0x62')][_0xc702('0x63')]({'filename':_0x1b5ca9,'createdAt':moment()['format'](_0xc702('0x48')),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0xc702('0x29')]['syncVarSet']=function(_0x3272d8){try{if(this['isNotNull'](_0x3272d8)){if(this[_0xc702('0x1a')][_0x3272d8['uniqueid']]&&_0x3272d8['channel']!='OutgoingSpoolFailed'){if(this[_0xc702('0x2a')](_0x3272d8[_0xc702('0x64')])){if(this[_0xc702('0x2a')](_0x3272d8[_0xc702('0x64')][_0xc702('0x65')])){this['syncMixMonitorFilename'](_0x3272d8['uniqueid'],_0x3272d8[_0xc702('0x66')]);}else if(this[_0xc702('0x2a')](_0x3272d8[_0xc702('0x64')][_0xc702('0x67')])){this[_0xc702('0x1a')][_0x3272d8[_0xc702('0x2d')]][_0xc702('0x55')]=_0x3272d8['value'];}else if(this['isNotNull'](_0x3272d8['variable']['xmd-callerid'])){this['channels'][_0x3272d8[_0xc702('0x2d')]]['callerid']=_0x3272d8['value'];}else if(this['isNotNull'](_0x3272d8['variable']['xmd-cdrtype'])){this[_0xc702('0x1a')][_0x3272d8[_0xc702('0x2d')]]['type']=_0x3272d8[_0xc702('0x66')];}else if(this[_0xc702('0x2a')](_0x3272d8['variable'][_0xc702('0x68')])){this[_0xc702('0x1a')][_0x3272d8[_0xc702('0x2d')]][_0xc702('0x10')]=_0x3272d8[_0xc702('0x66')][_0xc702('0x3b')](',')[0x0];}else if(this[_0xc702('0x2a')](_0x3272d8[_0xc702('0x64')][_0xc702('0x69')])){this[_0xc702('0x1a')][_0x3272d8[_0xc702('0x2d')]][_0xc702('0x6a')]=_0x3272d8['value'];}else if(this['isNotNull'](_0x3272d8[_0xc702('0x64')][_0xc702('0x6b')])){this[_0xc702('0x1a')][_0x3272d8['uniqueid']][_0xc702('0x6c')]=_0x3272d8[_0xc702('0x66')];}else if(this[_0xc702('0x2a')](_0x3272d8['variable'][_0xc702('0x6d')])){this[_0xc702('0x1a')][_0x3272d8[_0xc702('0x2d')]][_0xc702('0x6e')]=_0x3272d8['value'];}else if(this[_0xc702('0x2a')](_0x3272d8['variable'][_0xc702('0x6f')])){this[_0xc702('0x1a')][_0x3272d8[_0xc702('0x2d')]][_0xc702('0x10')]=_0x3272d8[_0xc702('0x66')];}else if(this[_0xc702('0x2a')](_0x3272d8['variable']['sipcallid'])){this['channels'][_0x3272d8[_0xc702('0x2d')]]['sipcalluniqueid']=_0x3272d8[_0xc702('0x66')];}}}else if(this['isNotNull'](_0x3272d8[_0xc702('0x64')][_0xc702('0x65')])){if(_0x3272d8['value']){var _0xc4c6b1=path[_0xc702('0x70')](_0x3272d8[_0xc702('0x66')])[_0xc702('0x3e')];this[_0xc702('0x5d')](_0xc4c6b1,_0x3272d8['value']);}}else if(this['channels'][_0x3272d8[_0xc702('0x2e')]]){if(this[_0xc702('0x2a')](_0x3272d8[_0xc702('0x64')])){if(this[_0xc702('0x2a')](_0x3272d8[_0xc702('0x64')][_0xc702('0x71')])){this['channels'][_0x3272d8[_0xc702('0x2e')]][_0xc702('0x72')]=_0x3272d8[_0xc702('0x66')];}}}}}catch(_0x24066d){logger[_0xc702('0x30')](_0xc702('0x73'),util[_0xc702('0x40')](_0x24066d,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncHangup']=function(_0x7cc590){try{if(this[_0xc702('0x2a')](_0x7cc590)){if(this[_0xc702('0x1a')][_0x7cc590['uniqueid']]){var _0x2b383d=moment();this[_0xc702('0x1a')][_0x7cc590['uniqueid']][_0xc702('0x74')]=_0x2b383d[_0xc702('0x33')](_0xc702('0x48'));this[_0xc702('0x1a')][_0x7cc590[_0xc702('0x2d')]][_0xc702('0x46')]=_0x2b383d[_0xc702('0x54')](this[_0xc702('0x1a')][_0x7cc590['uniqueid']]['starttime'],_0xc702('0x47'));if(this[_0xc702('0x1a')][_0x7cc590['uniqueid']][_0xc702('0x51')]){this[_0xc702('0x1a')][_0x7cc590[_0xc702('0x2d')]]['billableseconds']=_0x2b383d[_0xc702('0x54')](this[_0xc702('0x1a')][_0x7cc590[_0xc702('0x2d')]][_0xc702('0x52')],_0xc702('0x47'));this['channels'][_0x7cc590[_0xc702('0x2d')]]['holdtime']=this['channels'][_0x7cc590[_0xc702('0x2d')]][_0xc702('0x46')]-this['channels'][_0x7cc590['uniqueid']]['billableseconds'];}if(_0x7cc590['context']===_0xc702('0x39')){if(this['agents'][_0x7cc590[_0xc702('0x3a')]['split']('-')[0x0]]){this[_0xc702('0x1b')][_0x7cc590['channel'][_0xc702('0x3b')]('-')[0x0]]=_[_0xc702('0x75')](this['agents'][_0x7cc590[_0xc702('0x3a')][_0xc702('0x3b')]('-')[0x0]],[_0xc702('0x76')]);this[_0xc702('0x2c')](util['format']('user:%s',this[_0xc702('0x1b')][_0x7cc590['channel'][_0xc702('0x3b')]('-')[0x0]]['name']),_0xc702('0x77'),{'destaccountcode':this[_0xc702('0x1b')][_0x7cc590[_0xc702('0x3a')]['split']('-')[0x0]]['accountcode']});}}ami[_0xc702('0x2c')](_0xc702('0x78'),this['channels'][_0x7cc590[_0xc702('0x2d')]]);delete this[_0xc702('0x1a')][_0x7cc590[_0xc702('0x2d')]];}}}catch(_0x36c1b6){logger[_0xc702('0x30')](_0xc702('0x79'),util['inspect'](_0x36c1b6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc702('0x29')][_0xc702('0x25')]=function(_0x3d6365){try{if(this[_0xc702('0x2a')](_0x3d6365)){if(this['channels'][_0x3d6365['transfereeuniqueid']]){this['channels'][_0x3d6365[_0xc702('0x7a')]]['transfercalleridnum']=_0x3d6365[_0xc702('0x7b')];this[_0xc702('0x1a')][_0x3d6365['transfereeuniqueid']]['transferconnectedlinenum']=_0x3d6365[_0xc702('0x7c')];if(this[_0xc702('0x1a')][_0x3d6365[_0xc702('0x7d')]]){var _0x18b7f1=this[_0xc702('0x1a')][_0x3d6365[_0xc702('0x7d')]];this[_0xc702('0x1a')][_0x3d6365['secondtransfereruniqueid']]=this['channels'][_0x3d6365[_0xc702('0x7a')]];this[_0xc702('0x1a')][_0x3d6365[_0xc702('0x7a')]]=_0x18b7f1;}}else if(this[_0xc702('0x1a')][_0x3d6365['transfertargetuniqueid']]){this['channels'][_0x3d6365[_0xc702('0x7e')]]['transfercalleridnum']=_0x3d6365[_0xc702('0x7b')];this[_0xc702('0x1a')][_0x3d6365[_0xc702('0x7e')]][_0xc702('0x7f')]=_0x3d6365['transfertargetcalleridnum'];if(this['channels'][_0x3d6365['origtransfereruniqueid']]){var _0x18b7f1=this['channels'][_0x3d6365['origtransfereruniqueid']];this[_0xc702('0x1a')][_0x3d6365[_0xc702('0x80')]]=this[_0xc702('0x1a')][_0x3d6365['transfertargetuniqueid']];this[_0xc702('0x1a')][_0x3d6365['transfertargetuniqueid']]=_0x18b7f1;}}}}catch(_0x3930c4){logger['error'](_0xc702('0x81'),util[_0xc702('0x40')](_0x3930c4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xc702('0x29')][_0xc702('0x82')]=function(_0x638e5f){try{if(this['isNotNull'](_0x638e5f)){if(this['channels'][_0x638e5f['transfereeuniqueid']]){this['channels'][_0x638e5f[_0xc702('0x7a')]][_0xc702('0x83')]=_0x638e5f[_0xc702('0x84')];this[_0xc702('0x1a')][_0x638e5f[_0xc702('0x7a')]][_0xc702('0x7f')]=_0x638e5f[_0xc702('0x85')];this[_0xc702('0x86')]({'event':_0xc702('0x87'),'uniqueid':_0x638e5f[_0xc702('0x7a')],'context':_0x638e5f[_0xc702('0x38')],'channel':_0x638e5f[_0xc702('0x88')]});}}}catch(_0xee7c43){logger['error'](_0xc702('0x89'),util[_0xc702('0x40')](_0xee7c43,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc702('0x8a')]=function(_0x23f841){try{if(this[_0xc702('0x2a')](_0x23f841)){if(this[_0xc702('0x1a')][_0x23f841[_0xc702('0x2d')]]){if(!_[_0xc702('0x8b')](this[_0xc702('0x1a')][_0x23f841['uniqueid']][_0xc702('0x52')])){this[_0xc702('0x1a')][_0x23f841[_0xc702('0x2d')]][_0xc702('0x8c')]=moment()[_0xc702('0x33')](_0xc702('0x48'));}}}}catch(_0x25dbc3){logger[_0xc702('0x30')](_0xc702('0x8d'),util[_0xc702('0x40')](_0x25dbc3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xc702('0x26')]=function(_0x4f97f4){try{if(this[_0xc702('0x2a')](_0x4f97f4)){if(this[_0xc702('0x1a')][_0x4f97f4[_0xc702('0x2d')]]){if(!_[_0xc702('0x8b')](this['channels'][_0x4f97f4['uniqueid']][_0xc702('0x8c')])){this['channels'][_0x4f97f4['uniqueid']]['mohtime']+=moment()[_0xc702('0x8e')](0x0)['diff'](this['channels'][_0x4f97f4[_0xc702('0x2d')]][_0xc702('0x8c')],_0xc702('0x47'));delete this[_0xc702('0x1a')][_0x4f97f4[_0xc702('0x2d')]]['mohstarttime'];}}}}catch(_0xb187d3){logger[_0xc702('0x30')](_0xc702('0x8f'),util['inspect'](_0xb187d3,{'showHidden':![],'depth':null}));}};module[_0xc702('0x90')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index bfbbcbb..4c8fd8d 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e2=['membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','starttime','seconds','complete','answered','holdtime','diff','billableseconds','sumHoldTime','sumBillable','custom:voiceDialReport','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','util','ioredis','../ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isUndefined','prototype','emit','syncDialBegin','isNotNull','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice:outbound','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','keys','variable','value','inspect','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid'];(function(_0x1c0473,_0xebd02e){var _0x25b2f0=function(_0x368b00){while(--_0x368b00){_0x1c0473['push'](_0x1c0473['shift']());}};_0x25b2f0(++_0xebd02e);}(_0x34e2,0x126));var _0x234e=function(_0x27a3d6,_0x497674){_0x27a3d6=_0x27a3d6-0x0;var _0x3277d2=_0x34e2[_0x27a3d6];return _0x3277d2;};'use strict';var _=require(_0x234e('0x0'));var moment=require('moment');var util=require(_0x234e('0x1'));var Redis=require(_0x234e('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x234e('0x3'));config[_0x234e('0x4')]=_[_0x234e('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x234e('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0x2a8909){this[_0x234e('0x7')]=_0x2a8909[_0x234e('0x8')];this[_0x234e('0x9')]=_0x2a8909[_0x234e('0x9')];this[_0x234e('0xa')]={};ami['on'](_0x234e('0xb'),this['syncDialBegin'][_0x234e('0xc')](this));ami['on']('dialend',this[_0x234e('0xd')][_0x234e('0xc')](this));ami['on'](_0x234e('0xe'),this[_0x234e('0xf')][_0x234e('0xc')](this));ami['on'](_0x234e('0x10'),this[_0x234e('0x11')][_0x234e('0xc')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x48fe7b){return _0x48fe7b!==null&&!_[_0x234e('0x12')](_0x48fe7b);};VoiceDialReport[_0x234e('0x13')][_0x234e('0x14')]=function(_0x556c3f,_0x544d26,_0x396fb2){io['to'](_0x556c3f)[_0x234e('0x14')](_0x544d26,_0x396fb2);};VoiceDialReport[_0x234e('0x13')][_0x234e('0x15')]=function(_0x4f59c7){try{if(this[_0x234e('0x16')](_0x4f59c7)){if(this[_0x234e('0x7')][_0x4f59c7[_0x234e('0x17')]]){_[_0x234e('0x18')](this[_0x234e('0x7')][_0x4f59c7[_0x234e('0x17')]],{'starttime':moment()[_0x234e('0x19')](_0x234e('0x1a')),'lastevent':_0x234e('0x1b'),'interface':_0x4f59c7[_0x234e('0x1c')][_0x234e('0x1d')](0x0,_0x4f59c7[_0x234e('0x1c')][_0x234e('0x1e')]('-')),'membername':_0x4f59c7['channel'][_0x234e('0x1d')](_0x4f59c7[_0x234e('0x1c')]['lastIndexOf']('/')+0x1,_0x4f59c7[_0x234e('0x1c')][_0x234e('0x1e')]('-'))},_[_0x234e('0x1f')](_0x4f59c7,[_0x234e('0x20'),'privilege']));this['emit'](_0x234e('0x21'),'voice_outbound_channel:save',this[_0x234e('0x7')][_0x4f59c7[_0x234e('0x17')]]);ami['emit'](_0x234e('0x22'),this['channels'][_0x4f59c7['uniqueid']]);}}}catch(_0x59ce32){logger[_0x234e('0x23')]('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x59ce32,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x234e('0x13')][_0x234e('0xd')]=function(_0x1a59fc){try{if(this['isNotNull'](_0x1a59fc)){if(this[_0x234e('0x7')][_0x1a59fc['uniqueid']]){this[_0x234e('0x7')][_0x1a59fc['uniqueid']][_0x234e('0x24')]=_0x1a59fc[_0x234e('0x24')];if(_0x1a59fc[_0x234e('0x24')]===_0x234e('0x25')){this[_0x234e('0x7')][_0x1a59fc[_0x234e('0x17')]][_0x234e('0x26')]=_0x1a59fc[_0x234e('0x26')];this[_0x234e('0x7')][_0x1a59fc[_0x234e('0x17')]][_0x234e('0x27')]=_0x1a59fc['connectedlinename'];this['channels'][_0x1a59fc['uniqueid']][_0x234e('0x28')]=moment()[_0x234e('0x19')](_0x234e('0x1a'));this['channels'][_0x1a59fc[_0x234e('0x17')]][_0x234e('0x29')]=_0x234e('0x2a');ami[_0x234e('0x14')](_0x234e('0x2b'),this[_0x234e('0x7')][_0x1a59fc[_0x234e('0x17')]]);}this['emit'](_0x234e('0x21'),_0x234e('0x2c'),this['channels'][_0x1a59fc[_0x234e('0x17')]]);}}}catch(_0x4ca818){logger[_0x234e('0x23')](_0x234e('0x2d'),util['inspect'](_0x4ca818,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x234e('0x13')][_0x234e('0xf')]=function(_0x550fb6){try{if(this['isNotNull'](_0x550fb6)){this['addVariable'](_0x550fb6[_0x234e('0x17')],_[_0x234e('0x2e')](_0x550fb6[_0x234e('0x2f')])[0x0],_0x550fb6[_0x234e('0x30')]);if(this[_0x234e('0x16')](_0x550fb6['variable'])&&this[_0x234e('0x16')](_0x550fb6['variable']['outboundrouteid'])){if(_[_0x234e('0x12')](this['channels'][_0x550fb6[_0x234e('0x17')]])){this[_0x234e('0x7')][_0x550fb6[_0x234e('0x17')]]={'routeId':_0x550fb6[_0x234e('0x30')],'variables':this[_0x234e('0xa')][_0x550fb6[_0x234e('0x17')]]};this[_0x234e('0x14')](_0x234e('0x21'),_0x234e('0x2c'),this[_0x234e('0x7')][_0x550fb6[_0x234e('0x17')]]);}}}}catch(_0x4fd95f){logger['error']('[syncVarSet][VoiceDialReport]',util[_0x234e('0x31')](_0x4fd95f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x234e('0x13')][_0x234e('0x32')]=function(_0x3663e7,_0x2f8120,_0x46de57){var _0x5a6799=[_0x234e('0x33'),_0x234e('0x34'),_0x234e('0x35'),'rtpaudioqosjitterbridged',_0x234e('0x36'),_0x234e('0x37'),_0x234e('0x38'),_0x234e('0x39'),_0x234e('0x3a'),_0x234e('0x3b'),_0x234e('0x3c'),_0x234e('0x3d'),_0x234e('0x3e'),'memberdynamic',_0x234e('0x3f'),_0x234e('0x40'),_0x234e('0x41'),_0x234e('0x42'),_0x234e('0x43')];if(!_[_0x234e('0x44')](_0x2f8120)&&!_[_0x234e('0x45')](_0x5a6799,_0x2f8120)){if(_[_0x234e('0x12')](this[_0x234e('0xa')][_0x3663e7])){this['variables'][_0x3663e7]={};}this[_0x234e('0xa')][_0x3663e7][_0x2f8120]=_0x46de57;}};VoiceDialReport['prototype'][_0x234e('0x11')]=function(_0x553347){try{if(this[_0x234e('0x16')](_0x553347)){if(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]){this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x46')]=moment()[_0x234e('0x19')](_0x234e('0x1a'));this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x47')]=moment(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]['endtime'])['diff'](this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x48')],_0x234e('0x49'));this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]['lastevent']=_0x234e('0x4a');this[_0x234e('0x9')]['total']+=0x1;if(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x28')]){this[_0x234e('0x9')][_0x234e('0x4b')]+=0x1;this[_0x234e('0x7')][_0x553347['uniqueid']][_0x234e('0x4c')]=moment(this['channels'][_0x553347[_0x234e('0x17')]][_0x234e('0x28')])[_0x234e('0x4d')](this[_0x234e('0x7')][_0x553347['uniqueid']][_0x234e('0x48')],'seconds');this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x4e')]=moment(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x46')])['diff'](this['channels'][_0x553347[_0x234e('0x17')]][_0x234e('0x28')],'seconds');this[_0x234e('0x9')][_0x234e('0x4f')]+=this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x4c')]||0x0;this['outbound'][_0x234e('0x50')]+=this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x4e')];}this['outbound']['sumDuration']+=this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x47')];ami['emit'](_0x234e('0x51'),this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]);ami[_0x234e('0x14')]('custom:dialend',this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]);this[_0x234e('0x14')](_0x234e('0x21'),_0x234e('0x52'),this[_0x234e('0x9')]);logger[_0x234e('0x53')](_0x234e('0x54'),JSON[_0x234e('0x55')](this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]));this[_0x234e('0x14')](_0x234e('0x21'),_0x234e('0x56'),this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]);delete this[_0x234e('0x7')][_0x553347['uniqueid']];}if(this[_0x234e('0xa')][_0x553347[_0x234e('0x17')]]){delete this[_0x234e('0xa')][_0x553347[_0x234e('0x17')]];}}}catch(_0x4fc053){logger[_0x234e('0x23')](_0x234e('0x57'),util[_0x234e('0x31')](_0x4fc053,{'showHidden':![],'depth':null}));}};module[_0x234e('0x58')]=VoiceDialReport; \ No newline at end of file +var _0x6836=['[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','channels','outboundChannels','variables','dialbegin','syncDialEnd','bind','hangup','syncHangup','isUndefined','emit','prototype','isNotNull','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','privilege','voice:outbound','voice_outbound_channel:save','error','[syncDialBegin][VoiceDialReport]','dialstatus','connectedlinenum','connectedlinename','answertime','connect','[syncDialEnd][VoiceDialReport]','inspect','syncVarSet','addVariable','value','variable','outboundrouteid','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','membercalls','memberpenalty','memberrealtime','isNil','endtime','diff','starttime','seconds','lastevent','complete','outbound','total','answered','holdtime','billableseconds','sumBillable','sumDuration','custom:voiceDialReport','voice_outbound:save'];(function(_0x48eb36,_0x353f71){var _0x361b24=function(_0x19ddea){while(--_0x19ddea){_0x48eb36['push'](_0x48eb36['shift']());}};_0x361b24(++_0x353f71);}(_0x6836,0x133));var _0x6683=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x6836[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x6683('0x0'));var moment=require(_0x6683('0x1'));var util=require('util');var Redis=require(_0x6683('0x2'));var config=require(_0x6683('0x3'));var logger=require(_0x6683('0x4'))('ami');var ami=require(_0x6683('0x5'));config[_0x6683('0x6')]=_[_0x6683('0x7')](config[_0x6683('0x6')],{'host':_0x6683('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x41fe5e){this[_0x6683('0x9')]=_0x41fe5e[_0x6683('0xa')];this['outbound']=_0x41fe5e['outbound'];this[_0x6683('0xb')]={};ami['on'](_0x6683('0xc'),this['syncDialBegin']['bind'](this));ami['on']('dialend',this[_0x6683('0xd')][_0x6683('0xe')](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on'](_0x6683('0xf'),this[_0x6683('0x10')][_0x6683('0xe')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x3b495e){return _0x3b495e!==null&&!_[_0x6683('0x11')](_0x3b495e);};VoiceDialReport['prototype'][_0x6683('0x12')]=function(_0xc60309,_0x1922df,_0x4a9deb){io['to'](_0xc60309)[_0x6683('0x12')](_0x1922df,_0x4a9deb);};VoiceDialReport[_0x6683('0x13')]['syncDialBegin']=function(_0x5d2212){try{if(this[_0x6683('0x14')](_0x5d2212)){if(this[_0x6683('0x9')][_0x5d2212['uniqueid']]){_[_0x6683('0x15')](this['channels'][_0x5d2212[_0x6683('0x16')]],{'starttime':moment()[_0x6683('0x17')](_0x6683('0x18')),'lastevent':_0x6683('0x19'),'interface':_0x5d2212[_0x6683('0x1a')][_0x6683('0x1b')](0x0,_0x5d2212[_0x6683('0x1a')][_0x6683('0x1c')]('-')),'membername':_0x5d2212[_0x6683('0x1a')][_0x6683('0x1b')](_0x5d2212['channel']['lastIndexOf']('/')+0x1,_0x5d2212[_0x6683('0x1a')][_0x6683('0x1c')]('-'))},_[_0x6683('0x1d')](_0x5d2212,['event',_0x6683('0x1e')]));this['emit'](_0x6683('0x1f'),_0x6683('0x20'),this['channels'][_0x5d2212[_0x6683('0x16')]]);ami[_0x6683('0x12')]('custom:dialbegin',this['channels'][_0x5d2212[_0x6683('0x16')]]);}}}catch(_0x520792){logger[_0x6683('0x21')](_0x6683('0x22'),util['inspect'](_0x520792,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6683('0x13')][_0x6683('0xd')]=function(_0x2897b9){try{if(this[_0x6683('0x14')](_0x2897b9)){if(this[_0x6683('0x9')][_0x2897b9['uniqueid']]){this['channels'][_0x2897b9['uniqueid']][_0x6683('0x23')]=_0x2897b9[_0x6683('0x23')];if(_0x2897b9[_0x6683('0x23')]==='ANSWER'){this[_0x6683('0x9')][_0x2897b9[_0x6683('0x16')]][_0x6683('0x24')]=_0x2897b9[_0x6683('0x24')];this[_0x6683('0x9')][_0x2897b9[_0x6683('0x16')]][_0x6683('0x25')]=_0x2897b9[_0x6683('0x25')];this[_0x6683('0x9')][_0x2897b9[_0x6683('0x16')]][_0x6683('0x26')]=moment()[_0x6683('0x17')](_0x6683('0x18'));this['channels'][_0x2897b9['uniqueid']]['lastevent']=_0x6683('0x27');ami[_0x6683('0x12')]('custom:dialconnect',this[_0x6683('0x9')][_0x2897b9[_0x6683('0x16')]]);}this[_0x6683('0x12')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x2897b9[_0x6683('0x16')]]);}}}catch(_0x1b65d0){logger[_0x6683('0x21')](_0x6683('0x28'),util[_0x6683('0x29')](_0x1b65d0,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x6683('0x2a')]=function(_0xb12988){try{if(this[_0x6683('0x14')](_0xb12988)){this[_0x6683('0x2b')](_0xb12988[_0x6683('0x16')],_['keys'](_0xb12988['variable'])[0x0],_0xb12988[_0x6683('0x2c')]);if(this[_0x6683('0x14')](_0xb12988[_0x6683('0x2d')])&&this[_0x6683('0x14')](_0xb12988[_0x6683('0x2d')][_0x6683('0x2e')])){if(_[_0x6683('0x11')](this['channels'][_0xb12988[_0x6683('0x16')]])){this[_0x6683('0x9')][_0xb12988['uniqueid']]={'routeId':_0xb12988[_0x6683('0x2c')],'variables':this[_0x6683('0xb')][_0xb12988['uniqueid']]};this[_0x6683('0x12')](_0x6683('0x1f'),_0x6683('0x20'),this[_0x6683('0x9')][_0xb12988[_0x6683('0x16')]]);}}}}catch(_0xb92aa7){logger[_0x6683('0x21')]('[syncVarSet][VoiceDialReport]',util[_0x6683('0x29')](_0xb92aa7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x6683('0x13')][_0x6683('0x2b')]=function(_0x52f7b,_0x476988,_0x246c32){var _0x751618=['rtpaudioqos',_0x6683('0x2f'),_0x6683('0x30'),_0x6683('0x31'),'rtpaudioqosloss',_0x6683('0x32'),_0x6683('0x33'),'rtpaudioqosrttbridged',_0x6683('0x34'),_0x6683('0x35'),'bridgepeer','bridgepvtcallid',_0x6683('0x36'),'memberdynamic','memberinterface','memberlastcall','membername',_0x6683('0x37'),_0x6683('0x38')];if(!_[_0x6683('0x39')](_0x476988)&&!_['includes'](_0x751618,_0x476988)){if(_[_0x6683('0x11')](this['variables'][_0x52f7b])){this[_0x6683('0xb')][_0x52f7b]={};}this[_0x6683('0xb')][_0x52f7b][_0x476988]=_0x246c32;}};VoiceDialReport[_0x6683('0x13')]['syncHangup']=function(_0x24523c){try{if(this[_0x6683('0x14')](_0x24523c)){if(this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]]){this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]]['endtime']=moment()[_0x6683('0x17')](_0x6683('0x18'));this[_0x6683('0x9')][_0x24523c['uniqueid']]['duration']=moment(this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]][_0x6683('0x3a')])[_0x6683('0x3b')](this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]][_0x6683('0x3c')],_0x6683('0x3d'));this[_0x6683('0x9')][_0x24523c['uniqueid']][_0x6683('0x3e')]=_0x6683('0x3f');this[_0x6683('0x40')][_0x6683('0x41')]+=0x1;if(this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]][_0x6683('0x26')]){this['outbound'][_0x6683('0x42')]+=0x1;this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]][_0x6683('0x43')]=moment(this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]][_0x6683('0x26')])[_0x6683('0x3b')](this[_0x6683('0x9')][_0x24523c['uniqueid']][_0x6683('0x3c')],_0x6683('0x3d'));this['channels'][_0x24523c[_0x6683('0x16')]][_0x6683('0x44')]=moment(this['channels'][_0x24523c['uniqueid']]['endtime'])['diff'](this['channels'][_0x24523c[_0x6683('0x16')]][_0x6683('0x26')],_0x6683('0x3d'));this[_0x6683('0x40')]['sumHoldTime']+=this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]][_0x6683('0x43')]||0x0;this[_0x6683('0x40')][_0x6683('0x45')]+=this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]][_0x6683('0x44')];}this[_0x6683('0x40')][_0x6683('0x46')]+=this[_0x6683('0x9')][_0x24523c['uniqueid']]['duration'];ami[_0x6683('0x12')](_0x6683('0x47'),this['channels'][_0x24523c['uniqueid']]);ami[_0x6683('0x12')]('custom:dialend',this[_0x6683('0x9')][_0x24523c['uniqueid']]);this[_0x6683('0x12')](_0x6683('0x1f'),_0x6683('0x48'),this[_0x6683('0x40')]);logger['info'](_0x6683('0x49'),JSON['stringify'](this[_0x6683('0x9')][_0x24523c[_0x6683('0x16')]]));this[_0x6683('0x12')](_0x6683('0x1f'),_0x6683('0x4a'),this[_0x6683('0x9')][_0x24523c['uniqueid']]);delete this['channels'][_0x24523c[_0x6683('0x16')]];}if(this[_0x6683('0xb')][_0x24523c[_0x6683('0x16')]]){delete this[_0x6683('0xb')][_0x24523c['uniqueid']];}}}catch(_0x305a11){logger[_0x6683('0x21')](_0x6683('0x4b'),util[_0x6683('0x29')](_0x305a11,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 36bcb4b..36eb05c 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7665=['loggedin','talking','custom:queuesummary','inspect','uniqueid','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','push','emitVoiceQueueChannelSave','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','[syncQueueCallerAbandon][VoiceQueueReport]','syncQueueCallerLeave','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallercomplete','COMPLETEDBYAGENT','assigned','membername','queuecallerexit','queuecallerexitAt','reason','transfer','COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','seconds','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','keys','variable','value','queuestatus','CONTINUE','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','includes','syncHangup','length','abandoned','queuecallerleaveAt','diff','total','answered','milliseconds','lastevent','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','syncMusicOnHoldStart','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','queueReports','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','syncBlindTransfer','loopQueueSummary','isUndefined','isEmpty','hasOwnProperty','originated','pTalking','waiting','unlockRR','clearZombieChannels','switch','sequence','isNil','Action','status','catch','message','No\x20such\x20channel','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','emitVoiceQueueChannelRemove','emit','format','voice:queue:%s','name','voice_queue_channel:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','emitVoiceQueueSummary','type','strategy','available','loggedIn','sumBillable','sumDuration','sumHoldTime','unmanaged','Trunk','Interval','stringify','voice_queue:save','isNotNull','loopQueueShow','queues','[queues]','[queuesummary]','syncQueueSummary','queue','countBy','callers','toNumber'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7665,0x1f0));var _0x5766=function(_0xc399f4,_0x2d74f5){_0xc399f4=_0xc399f4-0x0;var _0xc91d3a=_0x7665[_0xc399f4];return _0xc91d3a;};'use strict';var _=require(_0x5766('0x0'));var moment=require(_0x5766('0x1'));var BPromise=require(_0x5766('0x2'));var util=require(_0x5766('0x3'));var md5=require(_0x5766('0x4'));var Redis=require(_0x5766('0x5'));var config=require(_0x5766('0x6'));var logger=require(_0x5766('0x7'))('ami');var ami=require(_0x5766('0x8'));var QueueReport=require(_0x5766('0x9'));config[_0x5766('0xa')]=_['defaults'](config[_0x5766('0xa')],{'host':_0x5766('0xb'),'port':0x18eb});var io=require(_0x5766('0xc'))(new Redis(config[_0x5766('0xa')]));var Sequence=function(){};Sequence[_0x5766('0xd')][_0x5766('0xe')]=function(_0x83683){this[_0x5766('0xf')]=this[_0x5766('0xf')]?this[_0x5766('0xf')][_0x5766('0x10')](_0x83683):_0x83683();};function VoiceQueueReport(_0x5a522a){this['sequence']=new Sequence();this[_0x5766('0x11')]={};this['agents']=_0x5a522a['agents'];this[_0x5766('0x12')]=_0x5a522a[_0x5766('0x13')];this[_0x5766('0x14')]=_0x5a522a[_0x5766('0x14')];this[_0x5766('0x15')]=!![];this[_0x5766('0x16')]=_0x5a522a['campaigns'];this[_0x5766('0x17')]={};ami['on'](_0x5766('0x18'),this['syncQueueSummary'][_0x5766('0x19')](this));ami['on'](_0x5766('0x1a'),this[_0x5766('0x1b')][_0x5766('0x19')](this));ami['on'](_0x5766('0x1c'),this[_0x5766('0x1d')]['bind'](this));ami['on']('queuecallerabandon',this[_0x5766('0x1e')][_0x5766('0x19')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x5766('0x19')](this));ami['on'](_0x5766('0x1f'),this[_0x5766('0x20')][_0x5766('0x19')](this));ami['on']('agentconnect',this[_0x5766('0x21')][_0x5766('0x19')](this));ami['on'](_0x5766('0x22'),this[_0x5766('0x23')]['bind'](this));ami['on'](_0x5766('0x24'),this['syncHangup'][_0x5766('0x19')](this));ami['on'](_0x5766('0x25'),this[_0x5766('0x26')]['bind'](this));ami['on'](_0x5766('0x27'),this['syncMusicOnHoldStart'][_0x5766('0x19')](this));ami['on'](_0x5766('0x28'),this[_0x5766('0x29')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x5766('0x2a'),this[_0x5766('0x2b')][_0x5766('0x19')](this));this[_0x5766('0x2c')]();this['loopQueueShow']();}function isNotNull(_0x583134){return _0x583134!==null&&!_[_0x5766('0x2d')](_0x583134);}function clearChannels(_0x37a51f){if(!_[_0x5766('0x2e')](_0x37a51f)){for(var _0x8dae2f in _0x37a51f){if(_0x37a51f['hasOwnProperty'](_0x8dae2f)){delete _0x37a51f[_0x8dae2f];}}}}function clearCampaigns(_0x3eebdd){if(!_[_0x5766('0x2e')](_0x3eebdd)){for(var _0x4e4709 in _0x3eebdd){if(_0x3eebdd[_0x5766('0x2f')](_0x4e4709)){_0x3eebdd[_0x4e4709][_0x5766('0x30')]=0x0;}}}}function clearVoiceQueues(_0x39ab1a){if(!_[_0x5766('0x2e')](_0x39ab1a)){for(var _0x54279d in _0x39ab1a){if(_0x39ab1a[_0x5766('0x2f')](_0x54279d)){_0x39ab1a[_0x54279d][_0x5766('0x30')]=0x0;_0x39ab1a[_0x54279d]['talking']=0x0;_0x39ab1a[_0x54279d][_0x5766('0x31')]=0x0;_0x39ab1a[_0x54279d][_0x5766('0x32')]=0x0;_0x39ab1a[_0x54279d]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x20f45f){if(!_[_0x5766('0x2e')](_0x20f45f)){for(var _0x57e3f7 in _0x20f45f){if(_0x20f45f[_0x5766('0x2f')](_0x57e3f7)){_0x20f45f[_0x57e3f7][_0x5766('0x33')]=!![];}}}}VoiceQueueReport[_0x5766('0xd')][_0x5766('0x34')]=function(){var _0x477e76=this;for(var _0x27aee9 in this[_0x5766('0x12')]){if(this['channels'][_0x5766('0x2f')](_0x27aee9)&&!this[_0x5766('0x12')][_0x27aee9][_0x5766('0x35')]){this[_0x5766('0x36')][_0x5766('0xe')](function(){if(!_[_0x5766('0x37')](_0x477e76[_0x5766('0x12')][_0x27aee9])){return ami[_0x5766('0x38')]({'action':_0x5766('0x39'),'channel':_0x477e76[_0x5766('0x12')][_0x27aee9]['channel']})[_0x5766('0x3a')](function(_0x2ecda6){if(_0x2ecda6[_0x5766('0x3b')]===_0x5766('0x3c')){setTimeout(function(){if(_0x477e76['channels'][_0x27aee9]){delete _0x477e76[_0x5766('0x12')][_0x27aee9];logger[_0x5766('0x3d')](_0x5766('0x3e'),_0x27aee9);}if(_0x477e76[_0x5766('0x11')][_0x27aee9]){delete _0x477e76['queueReports'][_0x27aee9];logger['error']('[voiceQueueReport][checkQueueReport]',_0x27aee9);}if(_0x477e76[_0x5766('0x17')][_0x27aee9]){delete _0x477e76[_0x5766('0x17')][_0x27aee9];logger['error'](_0x5766('0x3f'),_0x27aee9);}},0x1f40);}});}});}}};VoiceQueueReport[_0x5766('0xd')]['syncFullyBooted']=function(){logger[_0x5766('0x3d')](_0x5766('0x40'));clearChannels(this[_0x5766('0x12')]);this[_0x5766('0x41')](this[_0x5766('0x11')]);clearAgentBooked(this[_0x5766('0x42')]);clearVoiceQueues(this[_0x5766('0x14')]);clearCampaigns(this[_0x5766('0x16')]);};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x41')]=function(_0x255740){var _0x19f5f7=this;if(!_['isEmpty'](_0x255740)){for(var _0x228ade in _0x255740){if(_0x255740['hasOwnProperty'](_0x228ade)){_0x19f5f7[_0x5766('0x43')](_0x255740[_0x228ade]);delete _0x255740[_0x228ade];}}}};function loggerCatch(_0x1fc756){return function(_0x38e41f){logger['error'](_0x1fc756,util['inspect'](_0x38e41f,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x5766('0xd')][_0x5766('0x44')]=function(_0x5f1b9d,_0x1ad3f2,_0x432e9b){io['to'](_0x5f1b9d)[_0x5766('0x44')](_0x1ad3f2,_0x432e9b);};VoiceQueueReport[_0x5766('0xd')]['emitVoiceQueueChannelSave']=function(_0x15612b){this['emit'](util[_0x5766('0x45')](_0x5766('0x46'),_0x15612b[_0x5766('0x47')]),_0x5766('0x48'),_0x15612b);};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x43')]=function(_0x565d88){logger['info'](_0x5766('0x49'),JSON['stringify'](_0x565d88));this[_0x5766('0x44')](util[_0x5766('0x45')](_0x5766('0x46'),_0x565d88[_0x5766('0x47')]),_0x5766('0x4a'),_0x565d88);};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x4b')]=function(_0x34a5f3){if(_0x34a5f3[_0x5766('0x4c')]==='inbound'){var _0x375665={'id':_0x34a5f3['id'],'name':_0x34a5f3['name'],'strategy':_0x34a5f3[_0x5766('0x4d')],'answered':_0x34a5f3['answered'],'available':_0x34a5f3[_0x5766('0x4e')],'loggedIn':_0x34a5f3[_0x5766('0x4f')],'pTalking':_0x34a5f3[_0x5766('0x31')],'sumBillable':_0x34a5f3[_0x5766('0x50')],'sumDuration':_0x34a5f3[_0x5766('0x51')],'sumHoldTime':_0x34a5f3[_0x5766('0x52')]||0x0,'talking':_0x34a5f3['talking'],'total':_0x34a5f3['total'],'type':_0x34a5f3[_0x5766('0x4c')],'unmanaged':_0x34a5f3[_0x5766('0x53')],'abandoned':_0x34a5f3['abandoned'],'waiting':_0x34a5f3[_0x5766('0x32')]};if(_0x34a5f3[_0x5766('0x54')]){_0x375665[_0x5766('0x54')]={'id':_0x34a5f3[_0x5766('0x54')]['id'],'name':_0x34a5f3[_0x5766('0x54')][_0x5766('0x47')],'active':_0x34a5f3[_0x5766('0x54')]['active'],'callerid':_0x34a5f3['Trunk']['callerid']};}if(_0x34a5f3['Interval']){_0x375665[_0x5766('0x55')]={'id':_0x34a5f3[_0x5766('0x55')]['id'],'name':_0x34a5f3[_0x5766('0x55')]['name']};}var _0x122eb2=md5(JSON[_0x5766('0x56')](_0x375665));if(_0x34a5f3['md5']!==_0x122eb2){_0x34a5f3[_0x5766('0x4')]=_0x122eb2;this[_0x5766('0x44')](util[_0x5766('0x45')](_0x5766('0x46'),_0x375665[_0x5766('0x47')]),_0x5766('0x57'),_0x375665);}}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x58')]=function(_0x2fae5f){return _0x2fae5f!==null&&!_[_0x5766('0x2d')](_0x2fae5f);};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x59')]=function(){var _0x4b2328=this;setInterval(function(){_0x4b2328[_0x5766('0x34')]();ami[_0x5766('0x38')]({'action':_0x5766('0x5a')})[_0x5766('0x3a')](loggerCatch(_0x5766('0x5b')));},0x2710);};VoiceQueueReport[_0x5766('0xd')]['loopQueueSummary']=function(){var _0x261509=this;setInterval(function(){if(_0x261509[_0x5766('0x15')]){return ami[_0x5766('0x38')]({'action':_0x5766('0x18')})['then'](function(_0x128ac5){_0x261509[_0x5766('0x15')]=![];})[_0x5766('0x3a')](loggerCatch(_0x5766('0x5c')));}},0x3e8);};VoiceQueueReport['prototype'][_0x5766('0x5d')]=function(_0x3514e7){try{if(this['isNotNull'](_0x3514e7)&&this[_0x5766('0x58')](_0x3514e7[_0x5766('0x5e')])){if(this[_0x5766('0x14')][_0x3514e7[_0x5766('0x5e')]]){var _0x4c8966=_[_0x5766('0x5f')](this['channels'],_0x5766('0x5e'))[_0x3514e7[_0x5766('0x5e')]]||0x0;var _0x1fc7da=_0x4c8966-_0x3514e7[_0x5766('0x60')];if(this[_0x5766('0x14')][_0x3514e7['queue']]['waiting']!==_[_0x5766('0x61')](_0x3514e7[_0x5766('0x60')])||this['voiceQueues'][_0x3514e7[_0x5766('0x5e')]][_0x5766('0x4f')]!==_['toNumber'](_0x3514e7[_0x5766('0x62')])||this[_0x5766('0x14')][_0x3514e7['queue']][_0x5766('0x4e')]!==_[_0x5766('0x61')](_0x3514e7['available'])||this['voiceQueues'][_0x3514e7['queue']][_0x5766('0x63')]!==_0x1fc7da){this['voiceQueues'][_0x3514e7['queue']][_0x5766('0x32')]=_[_0x5766('0x61')](_0x3514e7['callers']);this[_0x5766('0x14')][_0x3514e7['queue']][_0x5766('0x4f')]=_[_0x5766('0x61')](_0x3514e7[_0x5766('0x62')]);this[_0x5766('0x14')][_0x3514e7[_0x5766('0x5e')]][_0x5766('0x4e')]=_[_0x5766('0x61')](_0x3514e7[_0x5766('0x4e')]);this[_0x5766('0x14')][_0x3514e7['queue']][_0x5766('0x63')]=_0x1fc7da>0x0?_0x1fc7da:0x0;this['voiceQueues'][_0x3514e7['queue']][_0x5766('0x63')]=this[_0x5766('0x14')][_0x3514e7[_0x5766('0x5e')]][_0x5766('0x63')]>_['toNumber'](_0x3514e7[_0x5766('0x62')])?_[_0x5766('0x61')](_0x3514e7[_0x5766('0x62')]):this[_0x5766('0x14')][_0x3514e7['queue']][_0x5766('0x63')];this[_0x5766('0x4b')](this['voiceQueues'][_0x3514e7[_0x5766('0x5e')]]);}ami[_0x5766('0x44')](_0x5766('0x64'),this[_0x5766('0x14')][_0x3514e7['queue']]);}}}catch(_0x3aea8d){logger[_0x5766('0x3d')]('[syncQueueSummary][VoiceQueueReport]',util[_0x5766('0x65')](_0x3aea8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0xe89920){this[_0x5766('0x15')]=!![];};VoiceQueueReport['prototype']['syncNewExten']=function(_0x2e127a){};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x4059ae){try{if(this[_0x5766('0x58')](_0x4059ae)){if(_[_0x5766('0x2d')](this[_0x5766('0x11')][_0x4059ae[_0x5766('0x66')]])){this[_0x5766('0x11')][_0x4059ae[_0x5766('0x66')]]=[];this[_0x5766('0x12')][_0x4059ae[_0x5766('0x66')]]={};}var _0x2809a8=new QueueReport();_0x2809a8[_0x5766('0x47')]=_0x4059ae['queue'];_0x2809a8[_0x5766('0x4c')]=this['voiceQueues'][_0x2809a8[_0x5766('0x47')]]&&this[_0x5766('0x14')][_0x2809a8['name']][_0x5766('0x4c')]?this[_0x5766('0x14')][_0x2809a8[_0x5766('0x47')]]['type']||'inbound':_0x5766('0x67');_0x2809a8[_0x5766('0x5e')]=_0x4059ae[_0x5766('0x5e')];_0x2809a8[_0x5766('0x68')]=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x2809a8[_0x5766('0x6a')]=_0x4059ae[_0x5766('0x6a')];_0x2809a8[_0x5766('0x6b')]=_0x4059ae[_0x5766('0x6b')];_['merge'](_0x2809a8,_[_0x5766('0x6c')](_0x4059ae,_['keys'](_0x2809a8)));this[_0x5766('0x11')][_0x4059ae[_0x5766('0x66')]][_0x5766('0x6d')](_0x2809a8);this[_0x5766('0x12')][_0x4059ae[_0x5766('0x66')]]=_0x2809a8;this[_0x5766('0x6e')](_0x2809a8);}}catch(_0x4a1422){logger[_0x5766('0x3d')](_0x5766('0x6f'),util['inspect'](_0x4a1422,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')]['syncQueueCallerAbandon']=function(_0x27f9aa){try{if(this[_0x5766('0x58')](_0x27f9aa)){if(this[_0x5766('0x11')][_0x27f9aa[_0x5766('0x66')]]){var _0x509220=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x27f9aa[_0x5766('0x66')]]);_0x509220['queuecallercomplete']=![];_0x509220[_0x5766('0x71')]=null;_0x509220[_0x5766('0x72')]=_0x27f9aa[_0x5766('0x72')];_0x509220[_0x5766('0x73')]=_0x27f9aa['originalposition'];_0x509220[_0x5766('0x74')]=!![];_0x509220[_0x5766('0x75')]=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x509220[_0x5766('0x76')]='ABANDONED';_0x509220['lastAssignedTo']=null;this[_0x5766('0x12')][_0x27f9aa['uniqueid']]=_0x509220;this[_0x5766('0x43')](_0x509220);}}}catch(_0x314e2e){logger[_0x5766('0x3d')](_0x5766('0x77'),util['inspect'](_0x314e2e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x78')]=function(_0x322c7c){try{if(this[_0x5766('0x58')](_0x322c7c)){if(this[_0x5766('0x11')][_0x322c7c[_0x5766('0x66')]]){var _0x382c7c=_['last'](this[_0x5766('0x11')][_0x322c7c[_0x5766('0x66')]]);_0x382c7c['queuecallerleaveAt']=moment()['format'](_0x5766('0x69'));_0x382c7c[_0x5766('0x79')]=_0x322c7c[_0x5766('0x79')];_0x382c7c['connectedlinename']=_0x322c7c[_0x5766('0x7a')];this[_0x5766('0x12')][_0x322c7c[_0x5766('0x66')]]=_0x382c7c;this[_0x5766('0x6e')](_0x382c7c);}}}catch(_0x65b1f8){logger['error'](_0x5766('0x7b'),util[_0x5766('0x65')](_0x65b1f8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x3c307e){try{if(this[_0x5766('0x58')](_0x3c307e)){if(this[_0x5766('0x11')][_0x3c307e[_0x5766('0x66')]]){var _0x586e00=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x3c307e['uniqueid']]);_0x586e00[_0x5766('0x7c')]=!![];_0x586e00['queuecallerexitreason']=_0x5766('0x7d');}}}catch(_0x3727ab){logger['error']('[syncAgentConnect][VoiceQueueReport]',util[_0x5766('0x65')](_0x3727ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x20')]=function(_0x5288c5){try{if(this['isNotNull'](_0x5288c5)){if(this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]]){var _0x391e6c=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]]);_0x391e6c[_0x5766('0x74')]=![];_0x391e6c[_0x5766('0x75')]=null;_0x391e6c[_0x5766('0x7e')]=!![];_0x391e6c['lastAssignedTo']=_0x5288c5[_0x5766('0x7f')];_0x391e6c[_0x5766('0x72')]=_0x5288c5[_0x5766('0x72')];_0x391e6c[_0x5766('0x7c')]=!![];_0x391e6c[_0x5766('0x80')]=![];_0x391e6c[_0x5766('0x81')]=null;if(!_0x391e6c['transfer']){if(_0x5288c5[_0x5766('0x82')]==_0x5766('0x83')){_0x391e6c[_0x5766('0x76')]=_0x5766('0x84');}else{if(_[_0x5766('0x85')](_0x5288c5[_0x5766('0x86')][_0x5766('0x87')](),_0x5766('0x88'))){if(this[_0x5766('0x11')][_0x5288c5[_0x5766('0x89')]]){var _0x14d1b2=_[_0x5766('0x70')](this['queueReports'][_0x5288c5[_0x5766('0x89')]]);_0x14d1b2[_0x5766('0x7c')]=![];_0x14d1b2[_0x5766('0x80')]=!![];_0x14d1b2[_0x5766('0x81')]=moment(_0x391e6c['queuecallerjoinAt'])['add'](_0x5288c5['holdtime'],_0x5766('0x8a'))[_0x5766('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x14d1b2[_0x5766('0x76')]='FORWARDTRANSFER';_0x14d1b2['transfer']=!![];_0x14d1b2[_0x5766('0x8b')]='FORWARD';_0x14d1b2[_0x5766('0x8c')]=_0x5288c5[_0x5766('0x8d')];_0x14d1b2[_0x5766('0x8e')]=_0x5288c5['uniqueid'];var _0x34fe8a=this['queueReports'][_0x5288c5[_0x5766('0x89')]];this[_0x5766('0x11')][_0x5288c5[_0x5766('0x89')]]=this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]];this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]]=_0x34fe8a;}}else{_0x391e6c[_0x5766('0x76')]=_0x5766('0x8f')+_0x5288c5[_0x5766('0x82')][_0x5766('0x90')]();}}}this[_0x5766('0x12')][_0x5288c5['uniqueid']]=_0x391e6c;this['emitVoiceQueueChannelRemove'](_0x391e6c);}}}catch(_0x3a56db){logger[_0x5766('0x3d')](_0x5766('0x91'),util['inspect'](_0x3a56db,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x23')]=function(_0x4faf8b){try{if(this[_0x5766('0x58')](_0x4faf8b)){this[_0x5766('0x92')](_0x4faf8b[_0x5766('0x66')],_[_0x5766('0x93')](_0x4faf8b[_0x5766('0x94')])[0x0],_0x4faf8b[_0x5766('0x95')]);if(this[_0x5766('0x11')][_0x4faf8b[_0x5766('0x66')]]){var _0x8282ff=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x4faf8b['uniqueid']]);if(_0x8282ff){if(this[_0x5766('0x58')](_0x4faf8b[_0x5766('0x94')])&&this[_0x5766('0x58')](_0x4faf8b[_0x5766('0x94')][_0x5766('0x96')])){switch(_0x4faf8b[_0x5766('0x95')]){case _0x5766('0x97'):_0x8282ff[_0x5766('0x80')]=![];_0x8282ff[_0x5766('0x81')]=null;break;default:_0x8282ff[_0x5766('0x80')]=!![];_0x8282ff['queuecallerexitAt']=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x8282ff['queuecallerleaveAt']=moment()[_0x5766('0x45')](_0x5766('0x69'));}_0x8282ff[_0x5766('0x74')]=![];_0x8282ff[_0x5766('0x75')]=null;_0x8282ff[_0x5766('0x76')]=_0x4faf8b['value'];this['channels'][_0x4faf8b['uniqueid']]=_0x8282ff;this[_0x5766('0x43')](_0x8282ff);}else if(this[_0x5766('0x58')](_0x4faf8b[_0x5766('0x94')])&&this['isNotNull'](_0x4faf8b['variable'][_0x5766('0x98')])){if(!_0x8282ff[_0x5766('0x74')]){_0x8282ff[_0x5766('0x80')]=!![];_0x8282ff[_0x5766('0x81')]=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x8282ff['queuecallerexitreason']=_0x5766('0x99');_0x8282ff['queuecallerleaveAt']=moment()[_0x5766('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4faf8b[_0x5766('0x66')]]=_0x8282ff;}}_0x8282ff[_0x5766('0x17')]=this[_0x5766('0x17')][_0x4faf8b['uniqueid']];}}}}catch(_0x711689){logger[_0x5766('0x3d')](_0x5766('0x9a'),util[_0x5766('0x65')](_0x711689,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x92')]=function(_0x3d2e4e,_0x47f5cb,_0x160bc4){var _0x3eb23c=[_0x5766('0x9b'),_0x5766('0x9c'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x5766('0x9d'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x5766('0x9e'),_0x5766('0x9f'),'sipuri',_0x5766('0xa0'),_0x5766('0xa1'),_0x5766('0xa2'),_0x5766('0xa3'),'memberinterface','memberlastcall','membername',_0x5766('0xa4'),_0x5766('0xa5')];if(!_[_0x5766('0x37')](_0x47f5cb)&&!_[_0x5766('0xa6')](_0x3eb23c,_0x47f5cb)){if(_[_0x5766('0x2d')](this['variables'][_0x3d2e4e])){this['variables'][_0x3d2e4e]={};}this[_0x5766('0x17')][_0x3d2e4e][_0x47f5cb]=_0x160bc4;}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0xa7')]=function(_0x3d40a5){try{if(this[_0x5766('0x58')](_0x3d40a5)){if(this[_0x5766('0x11')][_0x3d40a5[_0x5766('0x66')]]){for(var _0x3a3256=0x0,_0x53193a={};_0x3a32560x0?_0x298f3f:0x0;this[_0x9285('0x14')][_0x34d210[_0x9285('0x68')]][_0x9285('0x35')]=this[_0x9285('0x14')][_0x34d210['queue']][_0x9285('0x35')]>_[_0x9285('0x6b')](_0x34d210[_0x9285('0x6d')])?_[_0x9285('0x6b')](_0x34d210['loggedin']):this[_0x9285('0x14')][_0x34d210['queue']][_0x9285('0x35')];this[_0x9285('0x54')](this[_0x9285('0x14')][_0x34d210['queue']]);}ami['emit'](_0x9285('0x6e'),this['voiceQueues'][_0x34d210[_0x9285('0x68')]]);}}}catch(_0x62cc65){logger[_0x9285('0x42')](_0x9285('0x6f'),util[_0x9285('0x4a')](_0x62cc65,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x333df9){this[_0x9285('0x64')]=!![];};VoiceQueueReport[_0x9285('0xb')][_0x9285('0x70')]=function(_0x270818){};VoiceQueueReport[_0x9285('0xb')][_0x9285('0x71')]=function(_0x11f1af){try{if(this[_0x9285('0x67')](_0x11f1af)){if(_[_0x9285('0x31')](this[_0x9285('0x10')][_0x11f1af[_0x9285('0x72')]])){this[_0x9285('0x10')][_0x11f1af['uniqueid']]=[];this[_0x9285('0x12')][_0x11f1af[_0x9285('0x72')]]={};}var _0x31a3fe=new QueueReport();_0x31a3fe[_0x9285('0x52')]=_0x11f1af[_0x9285('0x68')];_0x31a3fe['type']=this[_0x9285('0x14')][_0x31a3fe['name']]&&this[_0x9285('0x14')][_0x31a3fe[_0x9285('0x52')]][_0x9285('0x5a')]?this['voiceQueues'][_0x31a3fe[_0x9285('0x52')]]['type']||_0x9285('0x55'):'inbound';_0x31a3fe[_0x9285('0x68')]=_0x11f1af[_0x9285('0x68')];_0x31a3fe['queuecallerjoinAt']=moment()[_0x9285('0x4d')](_0x9285('0x73'));_0x31a3fe['position']=_0x11f1af['position'];_0x31a3fe[_0x9285('0x74')]=_0x11f1af[_0x9285('0x74')];_[_0x9285('0x75')](_0x31a3fe,_[_0x9285('0x76')](_0x11f1af,_[_0x9285('0x77')](_0x31a3fe)));this[_0x9285('0x10')][_0x11f1af[_0x9285('0x72')]]['push'](_0x31a3fe);this[_0x9285('0x12')][_0x11f1af['uniqueid']]=_0x31a3fe;this['emitVoiceQueueChannelSave'](_0x31a3fe);}}catch(_0x78fd3f){logger[_0x9285('0x42')](_0x9285('0x78'),util[_0x9285('0x4a')](_0x78fd3f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9285('0xb')][_0x9285('0x79')]=function(_0x491108){try{if(this[_0x9285('0x67')](_0x491108)){if(this['queueReports'][_0x491108[_0x9285('0x72')]]){var _0xba8056=_[_0x9285('0x7a')](this[_0x9285('0x10')][_0x491108[_0x9285('0x72')]]);_0xba8056[_0x9285('0x7b')]=![];_0xba8056[_0x9285('0x7c')]=null;_0xba8056[_0x9285('0x7d')]=_0x491108[_0x9285('0x7d')];_0xba8056[_0x9285('0x7e')]=_0x491108[_0x9285('0x7e')];_0xba8056[_0x9285('0x1b')]=!![];_0xba8056['queuecallerabandonAt']=moment()['format'](_0x9285('0x73'));_0xba8056[_0x9285('0x7f')]=_0x9285('0x80');_0xba8056['lastAssignedTo']=null;this[_0x9285('0x12')][_0x491108[_0x9285('0x72')]]=_0xba8056;this[_0x9285('0x49')](_0xba8056);}}}catch(_0x17d265){logger[_0x9285('0x42')](_0x9285('0x81'),util['inspect'](_0x17d265,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9285('0x1d')]=function(_0x34a202){try{if(this[_0x9285('0x67')](_0x34a202)){if(this[_0x9285('0x10')][_0x34a202['uniqueid']]){var _0x1dca6c=_[_0x9285('0x7a')](this[_0x9285('0x10')][_0x34a202[_0x9285('0x72')]]);_0x1dca6c['queuecallerleaveAt']=moment()[_0x9285('0x4d')](_0x9285('0x73'));_0x1dca6c['connectedlinenum']=_0x34a202[_0x9285('0x82')];_0x1dca6c['connectedlinename']=_0x34a202[_0x9285('0x83')];this['channels'][_0x34a202['uniqueid']]=_0x1dca6c;this['emitVoiceQueueChannelSave'](_0x1dca6c);}}}catch(_0x3a8f4e){logger[_0x9285('0x42')](_0x9285('0x84'),util[_0x9285('0x4a')](_0x3a8f4e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9285('0xb')][_0x9285('0x21')]=function(_0x11296a){try{if(this[_0x9285('0x67')](_0x11296a)){if(this[_0x9285('0x10')][_0x11296a[_0x9285('0x72')]]){var _0x415f53=_['last'](this[_0x9285('0x10')][_0x11296a['uniqueid']]);_0x415f53[_0x9285('0x7b')]=!![];_0x415f53['queuecallerexitreason']=_0x9285('0x85');}}}catch(_0x9e2653){logger[_0x9285('0x42')]('[syncAgentConnect][VoiceQueueReport]',util[_0x9285('0x4a')](_0x9e2653,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9285('0xb')][_0x9285('0x1f')]=function(_0x11f8e8){try{if(this['isNotNull'](_0x11f8e8)){if(this['queueReports'][_0x11f8e8[_0x9285('0x72')]]){var _0x3eca8d=_['last'](this[_0x9285('0x10')][_0x11f8e8[_0x9285('0x72')]]);_0x3eca8d[_0x9285('0x1b')]=![];_0x3eca8d[_0x9285('0x86')]=null;_0x3eca8d['assigned']=!![];_0x3eca8d['lastAssignedTo']=_0x11f8e8[_0x9285('0x87')];_0x3eca8d['holdtime']=_0x11f8e8['holdtime'];_0x3eca8d[_0x9285('0x7b')]=!![];_0x3eca8d[_0x9285('0x88')]=![];_0x3eca8d[_0x9285('0x89')]=null;if(!_0x3eca8d[_0x9285('0x8a')]){if(_0x11f8e8[_0x9285('0x8b')]==_0x9285('0x8a')){_0x3eca8d[_0x9285('0x7f')]=_0x9285('0x8c');}else{if(_[_0x9285('0x8d')](_0x11f8e8[_0x9285('0x3e')]['toLowerCase'](),'local/')){if(this[_0x9285('0x10')][_0x11f8e8[_0x9285('0x8e')]]){var _0x44c642=_[_0x9285('0x7a')](this[_0x9285('0x10')][_0x11f8e8['linkedid']]);_0x44c642[_0x9285('0x7b')]=![];_0x44c642[_0x9285('0x88')]=!![];_0x44c642[_0x9285('0x89')]=moment(_0x3eca8d['queuecallerjoinAt'])[_0x9285('0x8f')](_0x11f8e8[_0x9285('0x7d')],'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x44c642[_0x9285('0x7f')]=_0x9285('0x90');_0x44c642[_0x9285('0x8a')]=!![];_0x44c642[_0x9285('0x91')]=_0x9285('0x92');_0x44c642['transferexten']=_0x11f8e8[_0x9285('0x93')];_0x44c642[_0x9285('0x94')]=_0x11f8e8['uniqueid'];var _0x107124=this[_0x9285('0x10')][_0x11f8e8['linkedid']];this[_0x9285('0x10')][_0x11f8e8[_0x9285('0x8e')]]=this['queueReports'][_0x11f8e8[_0x9285('0x72')]];this[_0x9285('0x10')][_0x11f8e8[_0x9285('0x72')]]=_0x107124;}}else{_0x3eca8d[_0x9285('0x7f')]=_0x9285('0x95')+_0x11f8e8[_0x9285('0x8b')]['toUpperCase']();}}}this[_0x9285('0x12')][_0x11f8e8[_0x9285('0x72')]]=_0x3eca8d;this['emitVoiceQueueChannelRemove'](_0x3eca8d);}}}catch(_0x2edb81){logger[_0x9285('0x42')](_0x9285('0x96'),util[_0x9285('0x4a')](_0x2edb81,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9285('0xb')][_0x9285('0x23')]=function(_0x5b858b){try{if(this[_0x9285('0x67')](_0x5b858b)){this['addVariable'](_0x5b858b[_0x9285('0x72')],_[_0x9285('0x77')](_0x5b858b[_0x9285('0x97')])[0x0],_0x5b858b[_0x9285('0x98')]);if(this[_0x9285('0x10')][_0x5b858b[_0x9285('0x72')]]){var _0x3d28b7=_[_0x9285('0x7a')](this[_0x9285('0x10')][_0x5b858b['uniqueid']]);if(_0x3d28b7){if(this[_0x9285('0x67')](_0x5b858b[_0x9285('0x97')])&&this['isNotNull'](_0x5b858b[_0x9285('0x97')][_0x9285('0x99')])){switch(_0x5b858b[_0x9285('0x98')]){case _0x9285('0x9a'):_0x3d28b7['queuecallerexit']=![];_0x3d28b7[_0x9285('0x89')]=null;break;default:_0x3d28b7['queuecallerexit']=!![];_0x3d28b7['queuecallerexitAt']=moment()[_0x9285('0x4d')](_0x9285('0x73'));_0x3d28b7['queuecallerleaveAt']=moment()[_0x9285('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3d28b7[_0x9285('0x1b')]=![];_0x3d28b7[_0x9285('0x86')]=null;_0x3d28b7[_0x9285('0x7f')]=_0x5b858b['value'];this['channels'][_0x5b858b[_0x9285('0x72')]]=_0x3d28b7;this['emitVoiceQueueChannelRemove'](_0x3d28b7);}else if(this[_0x9285('0x67')](_0x5b858b['variable'])&&this[_0x9285('0x67')](_0x5b858b[_0x9285('0x97')][_0x9285('0x9b')])){if(!_0x3d28b7[_0x9285('0x1b')]){_0x3d28b7[_0x9285('0x88')]=!![];_0x3d28b7[_0x9285('0x89')]=moment()[_0x9285('0x4d')](_0x9285('0x73'));_0x3d28b7[_0x9285('0x7f')]=_0x9285('0x9c');_0x3d28b7[_0x9285('0x9d')]=moment()[_0x9285('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9285('0x12')][_0x5b858b[_0x9285('0x72')]]=_0x3d28b7;}}_0x3d28b7[_0x9285('0x45')]=this[_0x9285('0x45')][_0x5b858b['uniqueid']];}}}}catch(_0x2d9119){logger[_0x9285('0x42')]('[syncVarSet][VoiceQueueReport]',util[_0x9285('0x4a')](_0x2d9119,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9285('0x9e')]=function(_0x2f887c,_0x24e467,_0x235ddf){var _0x555ef9=['rtpaudioqos','rtpaudioqosbridged',_0x9285('0x9f'),_0x9285('0xa0'),'rtpaudioqosloss',_0x9285('0xa1'),'rtpaudioqosrtt',_0x9285('0xa2'),_0x9285('0xa3'),'sipuri','bridgepeer',_0x9285('0xa4'),_0x9285('0xa5'),_0x9285('0xa6'),_0x9285('0xa7'),'memberlastcall',_0x9285('0x87'),_0x9285('0xa8'),_0x9285('0xa9')];if(!_['isNil'](_0x24e467)&&!_[_0x9285('0xaa')](_0x555ef9,_0x24e467)){if(_[_0x9285('0x31')](this['variables'][_0x2f887c])){this[_0x9285('0x45')][_0x2f887c]={};}this[_0x9285('0x45')][_0x2f887c][_0x24e467]=_0x235ddf;}};VoiceQueueReport[_0x9285('0xb')][_0x9285('0x25')]=function(_0x2c0be6){try{if(this['isNotNull'](_0x2c0be6)){if(this[_0x9285('0x10')][_0x2c0be6[_0x9285('0x72')]]){for(var _0x55356a=0x0,_0x85f7d0={};_0x55356a=0x0?moment(_0x3da344['endtime'])[_0xe313('0xd')](_0x3da344[_0xe313('0x18')],_0xe313('0xf')):null,'data1':_0xe313('0x1a'),'data2':_0x3da344[_0xe313('0x14')],'data3':_0x3da344[_0xe313('0x11')],'data4':_0x3da344['dialstring']||null,'role':_0xe313('0x13'),'internal':_0x3da344['accountcode']?_[_0xe313('0x1b')](_0x3da344[_0xe313('0x14')]):undefined,'uniqueid':_0x3da344['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xa467=['lastAssignedTo','interface','format','queuecallerleaveAt','diff','seconds','exten','queue','agent','toNumber','accountcode','uniqueid','voiceDialReport','membername','TALKING','starttime','endtime','outbound','lodash','util','../client','voiceQueueReport','queuecallerexitAt','Request','CreateMemberReport','voice'];(function(_0x37fbd6,_0x310bb0){var _0x15bbf1=function(_0x3d9277){while(--_0x3d9277){_0x37fbd6['push'](_0x37fbd6['shift']());}};_0x15bbf1(++_0x310bb0);}(_0xa467,0xc8));var _0x7a46=function(_0x2c808a,_0xa8a97b){_0x2c808a=_0x2c808a-0x0;var _0x4c1ee8=_0xa467[_0x2c808a];return _0x4c1ee8;};'use strict';var moment=require('moment');var _=require(_0x7a46('0x0'));var util=require(_0x7a46('0x1'));var client=require(_0x7a46('0x2'));exports[_0x7a46('0x3')]=function(_0x580536){var _0x4a7990=_0x580536['queuecallercompleteAt']||_0x580536[_0x7a46('0x4')];return client[_0x7a46('0x5')](_0x7a46('0x6'),{'body':{'channel':_0x7a46('0x7'),'membername':_0x580536[_0x7a46('0x8')],'interface':_['isNil'](_0x580536[_0x7a46('0x9')])?util[_0x7a46('0xa')]('SIP/%s',_0x580536[_0x7a46('0x8')]):_0x580536[_0x7a46('0x9')],'type':'TALKING','enterAt':_0x580536[_0x7a46('0xb')],'exitAt':_0x4a7990,'duration':moment(_0x4a7990)[_0x7a46('0xc')](_0x580536[_0x7a46('0xb')],_0x7a46('0xd')),'data1':'inbound','data2':_0x580536['calleridnum'],'data3':_0x580536[_0x7a46('0xe')],'data4':null,'data5':_0x580536[_0x7a46('0xf')],'role':_0x7a46('0x10'),'internal':_0x580536['accountcode']?_[_0x7a46('0x11')](_0x580536[_0x7a46('0x12')]):undefined,'uniqueid':_0x580536[_0x7a46('0x13')]},'log':_0x7a46('0x6')});};exports[_0x7a46('0x14')]=function(_0x52e4c6){return client[_0x7a46('0x5')]('CreateMemberReport',{'body':{'channel':'voice','membername':_0x52e4c6[_0x7a46('0x15')],'interface':_0x52e4c6[_0x7a46('0x9')],'type':_0x7a46('0x16'),'enterAt':_0x52e4c6[_0x7a46('0x17')],'exitAt':_0x52e4c6[_0x7a46('0x18')],'duration':moment(_0x52e4c6[_0x7a46('0x18')])[_0x7a46('0xc')](_0x52e4c6[_0x7a46('0x17')],_0x7a46('0xd'))>=0x0?moment(_0x52e4c6[_0x7a46('0x18')])[_0x7a46('0xc')](_0x52e4c6[_0x7a46('0x17')],_0x7a46('0xd')):null,'data1':_0x7a46('0x19'),'data2':_0x52e4c6[_0x7a46('0x12')],'data3':_0x52e4c6['exten'],'data4':_0x52e4c6['dialstring']||null,'role':_0x7a46('0x10'),'internal':_0x52e4c6[_0x7a46('0x12')]?_['toNumber'](_0x52e4c6['accountcode']):undefined,'uniqueid':_0x52e4c6[_0x7a46('0x13')]},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index c521260..5de78ee 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 _0x5c00=['Request','name','html','GetTemplate','../client','getTemplates'];(function(_0x3eb620,_0x37511b){var _0x4b89ab=function(_0x51e3f4){while(--_0x51e3f4){_0x3eb620['push'](_0x3eb620['shift']());}};_0x4b89ab(++_0x37511b);}(_0x5c00,0x17e));var _0x05c0=function(_0x3115fa,_0x1bf37e){_0x3115fa=_0x3115fa-0x0;var _0x3a5567=_0x5c00[_0x3115fa];return _0x3a5567;};'use strict';var client=require(_0x05c0('0x0'));exports[_0x05c0('0x1')]=function(_0x1c3b79){return function(_0x4e54ec){return client[_0x05c0('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x05c0('0x3'),_0x05c0('0x4')]},'log':_0x05c0('0x5')});};}; \ No newline at end of file +var _0x85b5=['GetTemplate','../client','getTemplates'];(function(_0x52e98e,_0x150789){var _0x335f7d=function(_0xa35bff){while(--_0xa35bff){_0x52e98e['push'](_0x52e98e['shift']());}};_0x335f7d(++_0x150789);}(_0x85b5,0x7f));var _0x585b=function(_0x5c7a60,_0x308a8a){_0x5c7a60=_0x5c7a60-0x0;var _0x431615=_0x85b5[_0x5c7a60];return _0x431615;};'use strict';var client=require(_0x585b('0x0'));exports[_0x585b('0x1')]=function(_0x4df8b9){return function(_0x457331){return client['Request'](_0x585b('0x2'),{'options':{'raw':!![],'attributes':['id','name','html']},'log':_0x585b('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ccd629d..e55e07e 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 _0x7a73=['channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data2','data3','data5','data6','data7','../client','Request','GetTrigger'];(function(_0x2aaf68,_0x19a91e){var _0x4b942e=function(_0x35fcde){while(--_0x35fcde){_0x2aaf68['push'](_0x2aaf68['shift']());}};_0x4b942e(++_0x19a91e);}(_0x7a73,0x18c));var _0x37a7=function(_0x435e2c,_0x166f1a){_0x435e2c=_0x435e2c-0x0;var _0x80ad12=_0x7a73[_0x435e2c];return _0x80ad12;};'use strict';var client=require(_0x37a7('0x0'));exports['getTriggers']=function(_0x2b0c35){return function(_0xd86fec){return client[_0x37a7('0x1')](_0x37a7('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x37a7('0x3'),_0x37a7('0x4')],'include':[{'model':_0x37a7('0x5'),'as':_0x37a7('0x6'),'attributes':['id',_0x37a7('0x7'),_0x37a7('0x8'),_0x37a7('0x9')]},{'model':_0x37a7('0x5'),'as':_0x37a7('0xa'),'attributes':['id',_0x37a7('0x7'),_0x37a7('0x8'),'value']},{'model':_0x37a7('0xb'),'as':_0x37a7('0xc'),'attributes':['id',_0x37a7('0xd'),'data1',_0x37a7('0xe'),_0x37a7('0xf'),'data4',_0x37a7('0x10'),_0x37a7('0x11'),_0x37a7('0x12')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xbb92=['data4','data7','../client','getTriggers','Request','GetTrigger','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data1','data3'];(function(_0x341da9,_0x1b75a8){var _0x28f4e8=function(_0x47e8ac){while(--_0x47e8ac){_0x341da9['push'](_0x341da9['shift']());}};_0x28f4e8(++_0x1b75a8);}(_0xbb92,0x1b2));var _0x2bb9=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbb92[_0x3947c9];return _0x2e7871;};'use strict';var client=require(_0x2bb9('0x0'));exports[_0x2bb9('0x1')]=function(_0x5821b1){return function(_0x21e729){return client[_0x2bb9('0x2')](_0x2bb9('0x3'),{'options':{'raw':![],'attributes':['id','name','channel',_0x2bb9('0x4')],'include':[{'model':_0x2bb9('0x5'),'as':_0x2bb9('0x6'),'attributes':['id',_0x2bb9('0x7'),_0x2bb9('0x8'),_0x2bb9('0x9')]},{'model':_0x2bb9('0x5'),'as':_0x2bb9('0xa'),'attributes':['id','field',_0x2bb9('0x8'),_0x2bb9('0x9')]},{'model':_0x2bb9('0xb'),'as':_0x2bb9('0xc'),'attributes':['id',_0x2bb9('0xd'),_0x2bb9('0xe'),'data2',_0x2bb9('0xf'),_0x2bb9('0x10'),'data5','data6',_0x2bb9('0x11')]}]},'log':_0x2bb9('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 336adcf..d1aaa5f 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 _0x902a=['Request','registry','GetTrunk','../client','getTrunks'];(function(_0x267c2f,_0x831332){var _0xd5a623=function(_0x30ac4f){while(--_0x30ac4f){_0x267c2f['push'](_0x267c2f['shift']());}};_0xd5a623(++_0x831332);}(_0x902a,0x120));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa902('0x0'));exports[_0xa902('0x1')]=function(_0x3c9443){return function(_0x2e7575){return client[_0xa902('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xa902('0x3')]},'log':_0xa902('0x4')});};}; \ No newline at end of file +var _0x4ca5=['GetTrunk','registry','../client','Request'];(function(_0x43026b,_0x928d8c){var _0x4a96cd=function(_0x362cbd){while(--_0x362cbd){_0x43026b['push'](_0x43026b['shift']());}};_0x4a96cd(++_0x928d8c);}(_0x4ca5,0x136));var _0x54ca=function(_0x477a8a,_0x2cd033){_0x477a8a=_0x477a8a-0x0;var _0x3e0d66=_0x4ca5[_0x477a8a];return _0x3e0d66;};'use strict';var client=require(_0x54ca('0x0'));exports['getTrunks']=function(_0x135d06){return function(_0x1ffaa5){return client[_0x54ca('0x1')](_0x54ca('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x54ca('0x3')]},'log':_0x54ca('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 581a545..27bb117 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 _0xdebd=['accountcode','fullname','online','lastLoginAt','pauseType','mobile','interface','getTelephones','internal','savePause','saveUnpause','UnpauseUser','getAgent','ShowUser','lastPauseAt','voicePause','../client','getAgents','Request','GetUser','agent','name','email'];(function(_0x330ea2,_0xbbc9b1){var _0x634730=function(_0x152972){while(--_0x152972){_0x330ea2['push'](_0x330ea2['shift']());}};_0x634730(++_0xbbc9b1);}(_0xdebd,0x180));var _0xddeb=function(_0x1a9d8f,_0xfe14bd){_0x1a9d8f=_0x1a9d8f-0x0;var _0x35f811=_0xdebd[_0x1a9d8f];return _0x35f811;};'use strict';var client=require(_0xddeb('0x0'));exports[_0xddeb('0x1')]=function(){return function(){return client[_0xddeb('0x2')](_0xddeb('0x3'),{'options':{'raw':![],'where':{'role':_0xddeb('0x4')},'attributes':['id',_0xddeb('0x5'),_0xddeb('0x6'),_0xddeb('0x7'),_0xddeb('0x8'),_0xddeb('0x9'),_0xddeb('0xa'),_0xddeb('0xb'),'lastPauseAt','voicePause','phone',_0xddeb('0xc'),_0xddeb('0xd')]},'log':_0xddeb('0x1')});};};exports[_0xddeb('0xe')]=function(){return function(){return client['Request'](_0xddeb('0x3'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name',_0xddeb('0x7'),_0xddeb('0xf')]},'log':_0xddeb('0xe')});};};exports['savePause']=function(_0x51ae41,_0x29cae9,_0x3d55c8){return client[_0xddeb('0x2')]('PauseUser',{'body':{'type':_0x29cae9,'uniqueid':_0x3d55c8},'options':{'where':{'id':_0x51ae41['id']}},'log':_0xddeb('0x10')});};exports[_0xddeb('0x11')]=function(_0x46540d){return client['Request'](_0xddeb('0x12'),{'body':{},'options':{'where':{'id':_0x46540d['id']}},'log':'savePause'});};exports[_0xddeb('0x13')]=function(_0x2b8d8c){return client[_0xddeb('0x2')](_0xddeb('0x14'),{'options':{'raw':![],'where':{'role':'agent','id':_0x2b8d8c},'attributes':['id',_0xddeb('0x5'),_0xddeb('0x6'),_0xddeb('0x7'),'fullname',_0xddeb('0x9'),'lastLoginAt',_0xddeb('0xb'),_0xddeb('0x15'),_0xddeb('0x16'),_0xddeb('0xd')]},'log':'getAgent'});}; \ No newline at end of file +var _0xe950=['getAgents','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','getTelephones','Request','telephone','PauseUser','savePause','saveUnpause','UnpauseUser','getAgent','ShowUser','interface','../client'];(function(_0x3c23ac,_0x34d595){var _0x4bd7cb=function(_0x2bcc3){while(--_0x2bcc3){_0x3c23ac['push'](_0x3c23ac['shift']());}};_0x4bd7cb(++_0x34d595);}(_0xe950,0xc5));var _0x0e95=function(_0x5decaa,_0x4c2df2){_0x5decaa=_0x5decaa-0x0;var _0x409043=_0xe950[_0x5decaa];return _0x409043;};'use strict';var client=require(_0x0e95('0x0'));exports[_0x0e95('0x1')]=function(){return function(){return client['Request'](_0x0e95('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0e95('0x3'),_0x0e95('0x4'),_0x0e95('0x5'),_0x0e95('0x6'),_0x0e95('0x7'),_0x0e95('0x8'),_0x0e95('0x9'),_0x0e95('0xa'),_0x0e95('0xb'),'phone','mobile','interface']},'log':_0x0e95('0x1')});};};exports[_0x0e95('0xc')]=function(){return function(){return client[_0x0e95('0xd')](_0x0e95('0x2'),{'options':{'raw':!![],'where':{'role':_0x0e95('0xe')},'attributes':['id','name',_0x0e95('0x5'),'internal']},'log':_0x0e95('0xc')});};};exports['savePause']=function(_0x290861,_0x1f1992,_0x29ef7d){return client['Request'](_0x0e95('0xf'),{'body':{'type':_0x1f1992,'uniqueid':_0x29ef7d},'options':{'where':{'id':_0x290861['id']}},'log':_0x0e95('0x10')});};exports[_0x0e95('0x11')]=function(_0x38be4e){return client[_0x0e95('0xd')](_0x0e95('0x12'),{'body':{},'options':{'where':{'id':_0x38be4e['id']}},'log':'savePause'});};exports[_0x0e95('0x13')]=function(_0x1b167a){return client[_0x0e95('0xd')](_0x0e95('0x14'),{'options':{'raw':![],'where':{'role':'agent','id':_0x1b167a},'attributes':['id',_0x0e95('0x3'),_0x0e95('0x4'),_0x0e95('0x5'),'fullname',_0x0e95('0x7'),'lastLoginAt',_0x0e95('0x9'),_0x0e95('0xa'),_0x0e95('0xb'),_0x0e95('0x15')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9e4d394..1fd25eb 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 _0x838d=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x2f31b1,_0x17daa8){var _0x448988=function(_0x540f6b){while(--_0x540f6b){_0x2f31b1['push'](_0x2f31b1['shift']());}};_0x448988(++_0x17daa8);}(_0x838d,0x1e4));var _0xd838=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x838d[_0x494d1f];return _0x457b6e;};'use strict';var client=require(_0xd838('0x0'));exports[_0xd838('0x1')]=function(_0x1111e4){return client[_0xd838('0x2')]('CreateVoiceAgentReport',{'body':_0x1111e4,'log':_0xd838('0x3')});};exports['update']=function(_0x4516a8,_0x26ce3f,_0x7bbe2){return client[_0xd838('0x2')](_0xd838('0x4'),{'body':_0x4516a8,'options':{'where':{'uniqueid':_0x26ce3f,'interface':_0x7bbe2}},'log':_0xd838('0x4')});}; \ No newline at end of file +var _0xb527=['UpdateVoiceAgentReport','../client','create','update','Request'];(function(_0x454352,_0x3a5221){var _0x181010=function(_0x5dfffb){while(--_0x5dfffb){_0x454352['push'](_0x454352['shift']());}};_0x181010(++_0x3a5221);}(_0xb527,0x1c3));var _0x7b52=function(_0x865ea2,_0x16db19){_0x865ea2=_0x865ea2-0x0;var _0xeb7d92=_0xb527[_0x865ea2];return _0xeb7d92;};'use strict';var client=require(_0x7b52('0x0'));exports[_0x7b52('0x1')]=function(_0x2826c9){return client['Request']('CreateVoiceAgentReport',{'body':_0x2826c9,'log':'CreateVoiceAgentReport'});};exports[_0x7b52('0x2')]=function(_0x2e0e04,_0x5600f9,_0x5addcc){return client[_0x7b52('0x3')](_0x7b52('0x4'),{'body':_0x2e0e04,'options':{'where':{'uniqueid':_0x5600f9,'interface':_0x5addcc}},'log':_0x7b52('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index c5aaddc..81a6c1f 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 _0x07e8=['context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','duration','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x1dacd4,_0x4259f7){var _0x5c29c5=function(_0x388498){while(--_0x388498){_0x1dacd4['push'](_0x1dacd4['shift']());}};_0x5c29c5(++_0x4259f7);}(_0x07e8,0xc9));var _0x807e=function(_0x253117,_0x5877e9){_0x253117=_0x253117-0x0;var _0x3f3edf=_0x07e8[_0x253117];return _0x3f3edf;};'use strict';var moment=require('moment');var util=require(_0x807e('0x0'));var _=require(_0x807e('0x1'));var client=require(_0x807e('0x2'));exports[_0x807e('0x3')]=function(_0x298c05){return client[_0x807e('0x4')](_0x807e('0x5'),{'body':_[_0x807e('0x6')](_0x298c05,{'source':_0x298c05[_0x807e('0x7')],'destinationcontext':_0x298c05[_0x807e('0x8')],'callerid':_0x298c05[_0x807e('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x807e('0x5')});};exports[_0x807e('0xa')]=function(){return function(){return client[_0x807e('0x4')](_0x807e('0xb'),{'options':{'where':{'type':[_0x807e('0xc')],'createdAt':{'$between':[moment()[_0x807e('0xd')](_0x807e('0xe'))[_0x807e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x807e('0x10')](_0x807e('0xe'))[_0x807e('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x807e('0x11'),'billableseconds']},'log':_0x807e('0x12')});};}; \ No newline at end of file +var _0xec54=['GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds'];(function(_0x28624e,_0x10e84b){var _0xe9bd46=function(_0x4e1ec7){while(--_0x4e1ec7){_0x28624e['push'](_0x28624e['shift']());}};_0xe9bd46(++_0x10e84b);}(_0xec54,0xa9));var _0x4ec5=function(_0x3b0fc2,_0xb6d0dc){_0x3b0fc2=_0x3b0fc2-0x0;var _0x3bea0a=_0xec54[_0x3b0fc2];return _0x3bea0a;};'use strict';var moment=require('moment');var util=require(_0x4ec5('0x0'));var _=require(_0x4ec5('0x1'));var client=require(_0x4ec5('0x2'));exports[_0x4ec5('0x3')]=function(_0x1da2ab){return client[_0x4ec5('0x4')](_0x4ec5('0x5'),{'body':_[_0x4ec5('0x6')](_0x1da2ab,{'source':_0x1da2ab[_0x4ec5('0x7')],'destinationcontext':_0x1da2ab['context'],'callerid':_0x1da2ab['callerid'],'amaflags':_0x4ec5('0x8')}),'log':_0x4ec5('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x4ec5('0x4')](_0x4ec5('0x9'),{'options':{'where':{'type':[_0x4ec5('0xa')],'createdAt':{'$between':[moment()[_0x4ec5('0xb')](_0x4ec5('0xc'))[_0x4ec5('0xd')](_0x4ec5('0xe')),moment()[_0x4ec5('0xf')](_0x4ec5('0xc'))[_0x4ec5('0xd')](_0x4ec5('0xe'))]}},'attributes':[_0x4ec5('0x10'),_0x4ec5('0x11'),_0x4ec5('0x12'),_0x4ec5('0x13')]},'log':_0x4ec5('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 48ac0ec..e48d88e 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 _0x123e=['Request','CreateVoiceDialReport','../client','create'];(function(_0x43bdec,_0x111931){var _0x3a6604=function(_0x4b690a){while(--_0x4b690a){_0x43bdec['push'](_0x43bdec['shift']());}};_0x3a6604(++_0x111931);}(_0x123e,0x17a));var _0xe123=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x123e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe123('0x0'));exports[_0xe123('0x1')]=function(_0x4a8b43){return client[_0xe123('0x2')](_0xe123('0x3'),{'body':_0x4a8b43,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x5cd8=['Request','CreateVoiceDialReport','../client','create'];(function(_0x234e7e,_0xf82c84){var _0x23319a=function(_0x3e6e30){while(--_0x3e6e30){_0x234e7e['push'](_0x234e7e['shift']());}};_0x23319a(++_0xf82c84);}(_0x5cd8,0x13a));var _0x85cd=function(_0x37e030,_0x53b0fd){_0x37e030=_0x37e030-0x0;var _0x5814ef=_0x5cd8[_0x37e030];return _0x5814ef;};'use strict';var client=require(_0x85cd('0x0'));exports[_0x85cd('0x1')]=function(_0x181bc8){return client[_0x85cd('0x2')](_0x85cd('0x3'),{'body':_0x181bc8,'log':_0x85cd('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 56ab361..baabb17 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 _0xd3a8=['Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0xd3a8,0x135));var _0x8d3a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd3a8[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x8d3a('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x8d3a('0x1')](_0x8d3a('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8d3a('0x3'),_0x8d3a('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0x5454=['GetVoiceExtension'];(function(_0x1030ce,_0xbe3f74){var _0x3367fd=function(_0x387153){while(--_0x387153){_0x1030ce['push'](_0x1030ce['shift']());}};_0x3367fd(++_0xbe3f74);}(_0x5454,0x15b));var _0x4545=function(_0xd64b36,_0x3d641b){_0xd64b36=_0xd64b36-0x0;var _0x452c43=_0x5454[_0xd64b36];return _0x452c43;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client['Request'](_0x4545('0x0'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 591f8bc..e4af4df 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 _0xf80b=['dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel'];(function(_0x337e95,_0x5db8c1){var _0x561931=function(_0x4eae2d){while(--_0x4eae2d){_0x337e95['push'](_0x337e95['shift']());}};_0x561931(++_0x5db8c1);}(_0xf80b,0x8a));var _0xbf80=function(_0x4a68f5,_0x21584b){_0x4a68f5=_0x4a68f5-0x0;var _0xe7267c=_0xf80b[_0x4a68f5];return _0xe7267c;};'use strict';var client=require(_0xbf80('0x0'));exports[_0xbf80('0x1')]=function(){return function(){return client['Request'](_0xbf80('0x2'),{'options':{'raw':![],'attributes':['id','name','acw','acwTimeout',_0xbf80('0x3'),_0xbf80('0x4'),_0xbf80('0x5'),_0xbf80('0x6'),_0xbf80('0x7'),_0xbf80('0x8'),_0xbf80('0x9'),_0xbf80('0xa'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0xbf80('0xb'),_0xbf80('0xc'),_0xbf80('0xd'),'dialOriginateTimeout',_0xbf80('0xe'),_0xbf80('0xf'),_0xbf80('0x10'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xbf80('0x11'),_0xbf80('0x12'),_0xbf80('0x13'),_0xbf80('0x14'),_0xbf80('0x15'),'dialTimezone',_0xbf80('0x16'),_0xbf80('0x17'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0xbf80('0x18'),_0xbf80('0x19'),_0xbf80('0x1a'),_0xbf80('0x1b'),'dialAMDBetweenWordsSilence',_0xbf80('0x1c'),_0xbf80('0x1d'),_0xbf80('0x1e'),_0xbf80('0x1f'),_0xbf80('0x20'),_0xbf80('0x21'),_0xbf80('0x22'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xbf80('0x23'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber',_0xbf80('0x24'),_0xbf80('0x25'),_0xbf80('0x26'),_0xbf80('0x27')],'include':[{'model':'Trunk','as':_0xbf80('0x28'),'attributes':['id',_0xbf80('0x29'),_0xbf80('0x2a'),_0xbf80('0x2b')]},{'model':'Pause','as':_0xbf80('0x2c'),'attributes':['id',_0xbf80('0x29')]},{'model':_0xbf80('0x28'),'as':_0xbf80('0x2d'),'attributes':['id',_0xbf80('0x29'),'callerid','active']},{'model':'Interval','as':_0xbf80('0x2e'),'attributes':['id',_0xbf80('0x29')],'include':[{'model':_0xbf80('0x2e'),'as':_0xbf80('0x2f'),'attributes':['id',_0xbf80('0x29'),_0xbf80('0x30')]}]}]},'log':_0xbf80('0x1')});};}; \ No newline at end of file +var _0xa952=['dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format'];(function(_0x5b7a68,_0x151b29){var _0x393ea1=function(_0x10d46d){while(--_0x10d46d){_0x5b7a68['push'](_0x5b7a68['shift']());}};_0x393ea1(++_0x151b29);}(_0xa952,0xd4));var _0x2a95=function(_0x35bd6f,_0x562628){_0x35bd6f=_0x35bd6f-0x0;var _0x12065f=_0xa952[_0x35bd6f];return _0x12065f;};'use strict';var client=require(_0x2a95('0x0'));exports[_0x2a95('0x1')]=function(){return function(){return client[_0x2a95('0x2')](_0x2a95('0x3'),{'options':{'raw':![],'attributes':['id',_0x2a95('0x4'),_0x2a95('0x5'),'acwTimeout',_0x2a95('0x6'),_0x2a95('0x7'),'type',_0x2a95('0x8'),_0x2a95('0x9'),_0x2a95('0xa'),_0x2a95('0xb'),_0x2a95('0xc'),_0x2a95('0xd'),'dialPredictiveOptimizationPercentage',_0x2a95('0xe'),_0x2a95('0xf'),_0x2a95('0x10'),_0x2a95('0x11'),_0x2a95('0x12'),'dialQueueTimeout','dialQueueProject',_0x2a95('0x13'),_0x2a95('0x14'),_0x2a95('0x15'),_0x2a95('0x16'),_0x2a95('0x17'),_0x2a95('0x18'),_0x2a95('0x19'),_0x2a95('0x1a'),_0x2a95('0x1b'),'dialPrefix',_0x2a95('0x1c'),_0x2a95('0x1d'),'dialAMDInitialSilence',_0x2a95('0x1e'),_0x2a95('0x1f'),_0x2a95('0x20'),'dialAMDMinWordLength',_0x2a95('0x21'),_0x2a95('0x22'),_0x2a95('0x23'),_0x2a95('0x24'),'timeout','dialRecallMeTimeout',_0x2a95('0x25'),_0x2a95('0x26'),'dialAgiAfterHangupAgent',_0x2a95('0x27'),_0x2a95('0x28'),'monitor_format',_0x2a95('0x29'),_0x2a95('0x2a'),_0x2a95('0x2b'),_0x2a95('0x2c'),_0x2a95('0x2d'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x2a95('0x2e'),'as':'Trunk','attributes':['id',_0x2a95('0x4'),'callerid',_0x2a95('0x2f')]},{'model':_0x2a95('0x30'),'as':_0x2a95('0x31'),'attributes':['id',_0x2a95('0x4')]},{'model':_0x2a95('0x2e'),'as':_0x2a95('0x32'),'attributes':['id','name',_0x2a95('0x33'),'active']},{'model':'Interval','as':_0x2a95('0x34'),'attributes':['id',_0x2a95('0x4')],'include':[{'model':'Interval','as':_0x2a95('0x35'),'attributes':['id',_0x2a95('0x4'),_0x2a95('0x36')]}]}]},'log':_0x2a95('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index ae4227e..ffa5d5c 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 _0xd2c4=['GetVoiceQueueReports','moment','lodash','create','Request','CreateVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerexit','queuecallerexitAt','queuecallerabandon'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd2c4,0xeb));var _0x4d2c=function(_0x1fa38a,_0x4fbe90){_0x1fa38a=_0x1fa38a-0x0;var _0x262fd0=_0xd2c4[_0x1fa38a];return _0x262fd0;};'use strict';var moment=require(_0x4d2c('0x0'));var _=require(_0x4d2c('0x1'));var client=require('../client');exports[_0x4d2c('0x2')]=function(_0x4600ca){return client[_0x4d2c('0x3')](_0x4d2c('0x4'),{'body':_0x4600ca,'log':_0x4d2c('0x4')});};exports['getVoiceQueueReports']=function(){return function(){return client['Request']('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0x4d2c('0x5')](_0x4d2c('0x6'))[_0x4d2c('0x7')](_0x4d2c('0x8')),moment()[_0x4d2c('0x9')]('day')['format'](_0x4d2c('0x8'))]}},'attributes':[_0x4d2c('0xa'),_0x4d2c('0xb'),_0x4d2c('0xc'),_0x4d2c('0xd'),'queuecallercomplete','queuecallercompleteAt',_0x4d2c('0xe'),_0x4d2c('0xf'),_0x4d2c('0x10'),'queuecallerabandonAt']},'log':_0x4d2c('0x11')});};}; \ No newline at end of file +var _0x9583=['CreateVoiceQueueReport','GetVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercompleteAt','queuecallerexitAt','queuecallerabandonAt','GetVoiceQueueReports','moment','Request'];(function(_0x134fc2,_0x4ec343){var _0x5cb440=function(_0x2922a7){while(--_0x2922a7){_0x134fc2['push'](_0x134fc2['shift']());}};_0x5cb440(++_0x4ec343);}(_0x9583,0x11f));var _0x3958=function(_0x54a679,_0x2a1df6){_0x54a679=_0x54a679-0x0;var _0x4b2c03=_0x9583[_0x54a679];return _0x4b2c03;};'use strict';var moment=require(_0x3958('0x0'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x108438){return client[_0x3958('0x1')](_0x3958('0x2'),{'body':_0x108438,'log':_0x3958('0x2')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0x3958('0x1')](_0x3958('0x3'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x3958('0x4')](_0x3958('0x5'))[_0x3958('0x6')](_0x3958('0x7')),moment()[_0x3958('0x8')]('day')['format'](_0x3958('0x7'))]}},'attributes':[_0x3958('0x9'),_0x3958('0xa'),_0x3958('0xb'),_0x3958('0xc'),'queuecallercomplete',_0x3958('0xd'),'queuecallerexit',_0x3958('0xe'),'queuecallerabandon',_0x3958('0xf')]},'log':_0x3958('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index ed2cfcd..9d2b140 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 _0xe338=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x1bc48a,_0xf03955){var _0x12c24e=function(_0x173b3b){while(--_0x173b3b){_0x1bc48a['push'](_0x1bc48a['shift']());}};_0x12c24e(++_0xf03955);}(_0xe338,0x107));var _0x8e33=function(_0x17bd3d,_0x45508b){_0x17bd3d=_0x17bd3d-0x0;var _0x1b3f62=_0xe338[_0x17bd3d];return _0x1b3f62;};'use strict';var client=require(_0x8e33('0x0'));exports[_0x8e33('0x1')]=function(_0x316f6e){return function(){return client['Request'](_0x8e33('0x2'),{'options':{'where':{'VoiceQueueId':_0x316f6e,'paused':!![]},'raw':!![]},'log':_0x8e33('0x1')});};}; \ No newline at end of file +var _0xaa4d=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x119b4b,_0x322a87){var _0x2ca4d5=function(_0x45a93e){while(--_0x45a93e){_0x119b4b['push'](_0x119b4b['shift']());}};_0x2ca4d5(++_0x322a87);}(_0xaa4d,0xcb));var _0xdaa4=function(_0x58c56a,_0x40d9e4){_0x58c56a=_0x58c56a-0x0;var _0x4f83d0=_0xaa4d[_0x58c56a];return _0x4f83d0;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0xaa328c){return function(){return client['Request'](_0xdaa4('0x0'),{'options':{'where':{'VoiceQueueId':_0xaa328c,'paused':!![]},'raw':!![]},'log':_0xdaa4('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index bc2f94e..cbc47a0 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 _0x87dd=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x68b90b,_0xb8b06a){var _0x5220ec=function(_0x226484){while(--_0x226484){_0x68b90b['push'](_0x68b90b['shift']());}};_0x5220ec(++_0xb8b06a);}(_0x87dd,0xed));var _0xd87d=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0x87dd[_0x1ea6eb];return _0x127200;};'use strict';var _=require(_0xd87d('0x0'));var client=require(_0xd87d('0x1'));exports[_0xd87d('0x2')]=function(_0x4155f2){return client['Request'](_0xd87d('0x3'),{'body':_[_0xd87d('0x4')](_0x4155f2,{'value':_0x4155f2[_0xd87d('0x5')]}),'log':_0xd87d('0x3')});}; \ No newline at end of file +var _0xa9e6=['create','Request','monitorFilename','lodash'];(function(_0x138e41,_0x24d4d8){var _0x35f78d=function(_0x11e52c){while(--_0x11e52c){_0x138e41['push'](_0x138e41['shift']());}};_0x35f78d(++_0x24d4d8);}(_0xa9e6,0x12b));var _0x6a9e=function(_0xa3125d,_0x52bc27){_0xa3125d=_0xa3125d-0x0;var _0x462778=_0xa9e6[_0xa3125d];return _0x462778;};'use strict';var _=require(_0x6a9e('0x0'));var client=require('../client');exports[_0x6a9e('0x1')]=function(_0x3d7fab){return client[_0x6a9e('0x2')]('CreateVoiceRecording',{'body':_['merge'](_0x3d7fab,{'value':_0x3d7fab[_0x6a9e('0x3')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 4a29613..2cef017 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 _0x45bd=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','../client','blindTransfer','Request','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridname'];(function(_0x1b14e0,_0x44453a){var _0x42404b=function(_0x537bed){while(--_0x537bed){_0x1b14e0['push'](_0x1b14e0['shift']());}};_0x42404b(++_0x44453a);}(_0x45bd,0x1a9));var _0xd45b=function(_0x2233dc,_0x719106){_0x2233dc=_0x2233dc-0x0;var _0x24666c=_0x45bd[_0x2233dc];return _0x24666c;};'use strict';var client=require(_0xd45b('0x0'));exports[_0xd45b('0x1')]=function(_0x1a5f06){return client[_0xd45b('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x1a5f06[_0xd45b('0x3')],'transfererchannel':_0x1a5f06[_0xd45b('0x4')],'transferercalleridnum':_0x1a5f06['transferercalleridnum'],'transferercalleridname':_0x1a5f06['transferercalleridname'],'transfererconnectedlinenum':_0x1a5f06[_0xd45b('0x5')],'transfererconnectedlinename':_0x1a5f06[_0xd45b('0x6')],'transfereraccountcode':_0x1a5f06['transfereraccountcode'],'transferercontext':_0x1a5f06[_0xd45b('0x7')],'transfererexten':_0x1a5f06[_0xd45b('0x8')],'transfererlinkedid':_0x1a5f06[_0xd45b('0x9')],'transfereechannel':_0x1a5f06[_0xd45b('0xa')],'transfereecalleridnum':_0x1a5f06[_0xd45b('0xb')],'transfereecalleridname':_0x1a5f06['transfereecalleridname'],'transfereeconnectedlinenum':_0x1a5f06[_0xd45b('0xc')],'transfereeconnectedlinename':_0x1a5f06[_0xd45b('0xd')],'transfereeaccountcode':_0x1a5f06[_0xd45b('0xe')],'transfereecontext':_0x1a5f06[_0xd45b('0xf')],'transfereeexten':_0x1a5f06[_0xd45b('0x10')],'transfereelinkedid':_0x1a5f06['transfereelinkedid'],'isexternal':_0x1a5f06[_0xd45b('0x11')],'context':_0x1a5f06[_0xd45b('0x12')],'extension':_0x1a5f06[_0xd45b('0x13')],'type':_0xd45b('0x14')},'log':_0xd45b('0x15')});};exports[_0xd45b('0x16')]=function(_0x2f5006){return client[_0xd45b('0x2')](_0xd45b('0x15'),{'body':{'result':_0x2f5006[_0xd45b('0x3')],'transfererchannel':_0x2f5006[_0xd45b('0x17')],'transferercalleridnum':_0x2f5006['origtransferercalleridnum'],'transferercalleridname':_0x2f5006[_0xd45b('0x18')],'transfererconnectedlinenum':_0x2f5006[_0xd45b('0x19')],'transfererconnectedlinename':_0x2f5006['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2f5006[_0xd45b('0x1a')],'transferercontext':_0x2f5006[_0xd45b('0x1b')],'transfererexten':_0x2f5006['secondtransfererexten'],'transfererlinkedid':_0x2f5006[_0xd45b('0x1c')],'transfereechannel':_0x2f5006['transfertargetchannel'],'transfereecalleridnum':_0x2f5006['transfertargetcalleridnum'],'transfereecalleridname':_0x2f5006[_0xd45b('0x1d')],'transfereeconnectedlinenum':_0x2f5006['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2f5006[_0xd45b('0x1e')],'transfereeaccountcode':_0x2f5006[_0xd45b('0x1f')],'transfereecontext':_0x2f5006[_0xd45b('0x20')],'transfereeexten':_0x2f5006[_0xd45b('0x21')],'transfereelinkedid':_0x2f5006['transfertargetlinkedid'],'isexternal':_0x2f5006[_0xd45b('0x11')],'context':_0x2f5006[_0xd45b('0x22')],'extension':_0x2f5006['origtransfererexten'],'type':'attended'},'log':_0xd45b('0x15')});}; \ No newline at end of file +var _0x6d18=['CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','context','extension','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request'];(function(_0x502996,_0x457a26){var _0x4e5117=function(_0x546dc7){while(--_0x546dc7){_0x502996['push'](_0x502996['shift']());}};_0x4e5117(++_0x457a26);}(_0x6d18,0x1a1));var _0x86d1=function(_0x575282,_0x5997d6){_0x575282=_0x575282-0x0;var _0x5cd177=_0x6d18[_0x575282];return _0x5cd177;};'use strict';var client=require(_0x86d1('0x0'));exports[_0x86d1('0x1')]=function(_0x4b796b){return client[_0x86d1('0x2')](_0x86d1('0x3'),{'body':{'result':_0x4b796b[_0x86d1('0x4')],'transfererchannel':_0x4b796b[_0x86d1('0x5')],'transferercalleridnum':_0x4b796b[_0x86d1('0x6')],'transferercalleridname':_0x4b796b[_0x86d1('0x7')],'transfererconnectedlinenum':_0x4b796b[_0x86d1('0x8')],'transfererconnectedlinename':_0x4b796b[_0x86d1('0x9')],'transfereraccountcode':_0x4b796b[_0x86d1('0xa')],'transferercontext':_0x4b796b[_0x86d1('0xb')],'transfererexten':_0x4b796b['transfererexten'],'transfererlinkedid':_0x4b796b[_0x86d1('0xc')],'transfereechannel':_0x4b796b[_0x86d1('0xd')],'transfereecalleridnum':_0x4b796b[_0x86d1('0xe')],'transfereecalleridname':_0x4b796b[_0x86d1('0xf')],'transfereeconnectedlinenum':_0x4b796b['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x4b796b[_0x86d1('0x10')],'transfereeaccountcode':_0x4b796b[_0x86d1('0x11')],'transfereecontext':_0x4b796b['transfereecontext'],'transfereeexten':_0x4b796b[_0x86d1('0x12')],'transfereelinkedid':_0x4b796b['transfereelinkedid'],'isexternal':_0x4b796b[_0x86d1('0x13')],'context':_0x4b796b[_0x86d1('0x14')],'extension':_0x4b796b[_0x86d1('0x15')],'type':_0x86d1('0x16')},'log':_0x86d1('0x3')});};exports[_0x86d1('0x17')]=function(_0x18a01d){return client['Request'](_0x86d1('0x3'),{'body':{'result':_0x18a01d[_0x86d1('0x4')],'transfererchannel':_0x18a01d[_0x86d1('0x18')],'transferercalleridnum':_0x18a01d[_0x86d1('0x19')],'transferercalleridname':_0x18a01d[_0x86d1('0x1a')],'transfererconnectedlinenum':_0x18a01d[_0x86d1('0x1b')],'transfererconnectedlinename':_0x18a01d[_0x86d1('0x1c')],'transfereraccountcode':_0x18a01d['origtransfereraccountcode'],'transferercontext':_0x18a01d[_0x86d1('0x1d')],'transfererexten':_0x18a01d[_0x86d1('0x1e')],'transfererlinkedid':_0x18a01d[_0x86d1('0x1f')],'transfereechannel':_0x18a01d[_0x86d1('0x20')],'transfereecalleridnum':_0x18a01d[_0x86d1('0x21')],'transfereecalleridname':_0x18a01d['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x18a01d[_0x86d1('0x22')],'transfereeconnectedlinename':_0x18a01d[_0x86d1('0x23')],'transfereeaccountcode':_0x18a01d['transfertargetaccountcode'],'transfereecontext':_0x18a01d[_0x86d1('0x24')],'transfereeexten':_0x18a01d[_0x86d1('0x25')],'transfereelinkedid':_0x18a01d[_0x86d1('0x26')],'isexternal':_0x18a01d[_0x86d1('0x13')],'context':_0x18a01d[_0x86d1('0x27')],'extension':_0x18a01d[_0x86d1('0x28')],'type':_0x86d1('0x29')},'log':_0x86d1('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 8ac30b7..80fab74 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 _0xbe2e=['resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','trunks','outboundChannels','run','event','emit','custom:','faxAccounts','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','error','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','command','Command','voiceQueues','hasOwnProperty','available','loggedIn','sumDuration','talking','total','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','values','channels','length','map','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','rec','mixmonitorid','status','voicechannel'];(function(_0x282a1f,_0x49a6ef){var _0x296ea7=function(_0x4bac68){while(--_0x4bac68){_0x282a1f['push'](_0x282a1f['shift']());}};_0x296ea7(++_0x49a6ef);}(_0xbe2e,0x1a7));var _0xebe2=function(_0x599f55,_0x2d4f80){_0x599f55=_0x599f55-0x0;var _0xa7a8e8=_0xbe2e[_0x599f55];return _0xa7a8e8;};'use strict';var _=require(_0xebe2('0x0'));var util=require(_0xebe2('0x1'));var jayson=require(_0xebe2('0x2'));var schema=require(_0xebe2('0x3'));var BPromise=require(_0xebe2('0x4'));var moment=require(_0xebe2('0x5'));var config=require(_0xebe2('0x6'));var properties=require('../properties');var ami=require(_0xebe2('0x7'));exports[_0xebe2('0x8')]=function(_0x8de59f,_0x6c3fec,_0x5a88f7){return new BPromise(function(_0x2d9eaf,_0x335f49){var _0x154182={'QueuePause':function(_0x2f9fac){return new Promise(function(_0x562c4a,_0x2b6e4b){var _0x5a917f=util[_0xebe2('0x9')](_0xebe2('0xa'),_0xebe2('0xb'),_0x2f9fac[_0xebe2('0xc')]);if(_0x8de59f[_0xebe2('0xd')]&&_0x8de59f['timers'][_0x5a917f]&&_0x8de59f['timers'][_0x5a917f][_0xebe2('0xe')]){_0x8de59f['timers'][_0x5a917f][_0xebe2('0xf')]();}if(_0x8de59f[_0xebe2('0x10')][_0x5a917f]){_0x8de59f[_0xebe2('0x10')][_0x5a917f]['updateStatusRealtime']({'statePause':_0x2f9fac[_0xebe2('0x11')]?!![]:![]});}_0x562c4a({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x5c4485){var _0x54047f=this;return new Promise(function(_0x54607c,_0x194330){if(ami['isConnected']()==![]){return _0x194330(_0x54047f[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config['asterisk'][_0xebe2('0x14')],'ami\x20disconnected'][_0xebe2('0x15')]('\x20')));}_0x5c4485=_[_0xebe2('0x16')](_0x5c4485,_[_0xebe2('0x17')](properties[_0xebe2('0x18')]));_0x5c4485[_0xebe2('0x19')]=_0xebe2('0x1a');return ami[_0xebe2('0x1b')](_0x5c4485)[_0xebe2('0x1c')](function(_0x191f34){_0x54607c({'code':0xc8,'message':_0x191f34[_0xebe2('0x1d')]});})[_0xebe2('0x1e')](function(_0x5407be){_0x194330(_0x54047f[_0xebe2('0x12')](0x1f5,_0x5407be[_0xebe2('0x1d')]));});});},'Command':function(_0x2aa8bc){var _0x452672=this;return new Promise(function(_0x47579c,_0x342ee3){if(ami[_0xebe2('0x1f')]()==![]){return _0x342ee3(_0x452672['error'](0x1f4,[config[_0xebe2('0x13')]['ip'],config[_0xebe2('0x13')][_0xebe2('0x14')],_0xebe2('0x20')][_0xebe2('0x15')]('\x20')));}_0x2aa8bc=_[_0xebe2('0x16')](_0x2aa8bc,_0xebe2('0x21'));_0x2aa8bc[_0xebe2('0x19')]=_0xebe2('0x22');return ami['Action'](_0x2aa8bc)['then'](function(_0x980394){_0x47579c({'code':0xc8,'message':_0x980394['content']});})[_0xebe2('0x1e')](function(_0x1a63dd){_0x342ee3(_0x452672[_0xebe2('0x12')](0x1f5,_0x1a63dd['message']));});});},'VoiceQueues':function(_0x554b09){return new Promise(function(_0x4e8f37,_0x174a3f){var _0x1ffb9a=[];for(var _0x52ed83 in _0x8de59f[_0xebe2('0x23')]){if(_0x8de59f[_0xebe2('0x23')][_0xebe2('0x24')](_0x52ed83)){var _0x27eabd=_0x8de59f[_0xebe2('0x23')][_0x52ed83];var _0x3f3744={'id':_0x27eabd['id'],'name':_0x27eabd[_0xebe2('0xc')],'strategy':_0x27eabd['strategy'],'answered':_0x27eabd['answered'],'available':_0x27eabd[_0xebe2('0x25')],'loggedIn':_0x27eabd[_0xebe2('0x26')],'pTalking':_0x27eabd['pTalking'],'sumBillable':_0x27eabd['sumBillable'],'sumDuration':_0x27eabd[_0xebe2('0x27')],'sumHoldTime':_0x27eabd['sumHoldTime']||0x0,'talking':_0x27eabd[_0xebe2('0x28')],'total':_0x27eabd[_0xebe2('0x29')],'type':_0x27eabd['type'],'unmanaged':_0x27eabd['unmanaged'],'abandoned':_0x27eabd[_0xebe2('0x2a')],'waiting':_0x27eabd[_0xebe2('0x2b')],'loggedInDb':_0x27eabd[_0xebe2('0x2c')]};if(_0x27eabd[_0xebe2('0x2d')]===_0xebe2('0x2e')){_0x3f3744[_0xebe2('0x2f')]=_0x27eabd[_0xebe2('0x2f')];_0x3f3744['dialMethod']=_0x27eabd[_0xebe2('0x30')];_0x3f3744[_0xebe2('0x31')]=_0x27eabd[_0xebe2('0x31')];_0x3f3744[_0xebe2('0x32')]=_0x27eabd['dialOriginateCallerIdNumber'];_0x3f3744[_0xebe2('0x33')]=_0x27eabd[_0xebe2('0x33')];_0x3f3744['dialPrefix']=_0x27eabd[_0xebe2('0x34')];_0x3f3744[_0xebe2('0x35')]=_0x27eabd[_0xebe2('0x35')];_0x3f3744[_0xebe2('0x36')]=_0x27eabd[_0xebe2('0x36')];_0x3f3744[_0xebe2('0x37')]=_0x27eabd[_0xebe2('0x37')];_0x3f3744['outboundBusyCallsDay']=_0x27eabd[_0xebe2('0x38')];_0x3f3744[_0xebe2('0x39')]=_0x27eabd[_0xebe2('0x39')];_0x3f3744['outboundDropCallsDayACS']=_0x27eabd[_0xebe2('0x3a')];_0x3f3744['outboundDropCallsDayCallersExit']=_0x27eabd[_0xebe2('0x3b')];_0x3f3744[_0xebe2('0x3c')]=_0x27eabd[_0xebe2('0x3c')];_0x3f3744[_0xebe2('0x3d')]=_0x27eabd[_0xebe2('0x3d')];_0x3f3744[_0xebe2('0x3e')]=_0x27eabd['outboundNoSuchCallsDay'];_0x3f3744[_0xebe2('0x3f')]=_0x27eabd[_0xebe2('0x3f')];_0x3f3744[_0xebe2('0x40')]=_0x27eabd[_0xebe2('0x40')];_0x3f3744[_0xebe2('0x41')]=_0x27eabd[_0xebe2('0x41')];_0x3f3744['outboundUnknownCallsDay']=_0x27eabd[_0xebe2('0x42')];_0x3f3744[_0xebe2('0x43')]=_0x27eabd[_0xebe2('0x43')];_0x3f3744[_0xebe2('0x44')]=_0x27eabd[_0xebe2('0x44')];_0x3f3744[_0xebe2('0x45')]=_0x27eabd['predictiveIntervalAvgTalktime'];_0x3f3744[_0xebe2('0x46')]=_0x27eabd[_0xebe2('0x46')];_0x3f3744[_0xebe2('0x47')]=_0x27eabd[_0xebe2('0x47')];_0x3f3744[_0xebe2('0x48')]=_0x27eabd[_0xebe2('0x48')];_0x3f3744[_0xebe2('0x49')]=_0x27eabd[_0xebe2('0x49')];_0x3f3744[_0xebe2('0x4a')]=_0x27eabd[_0xebe2('0x4a')];_0x3f3744[_0xebe2('0x4b')]=_0x27eabd['predictiveIntervalMultiplicativeFactor'];_0x3f3744[_0xebe2('0x4c')]=_0x27eabd[_0xebe2('0x4c')];_0x3f3744[_0xebe2('0x4d')]=_0x27eabd['predictiveIntervalAvailable'];_0x3f3744[_0xebe2('0x4e')]=_0x27eabd[_0xebe2('0x4e')];_0x3f3744[_0xebe2('0x1d')]=_0x27eabd[_0xebe2('0x1d')];_0x3f3744['originated']=_0x27eabd[_0xebe2('0x4f')];_0x3f3744['erlangCalls']=_0x27eabd[_0xebe2('0x50')];_0x3f3744[_0xebe2('0x51')]=_0x27eabd['erlangCallToSecond'];_0x3f3744[_0xebe2('0x52')]=_0x27eabd[_0xebe2('0x52')];_0x3f3744[_0xebe2('0x53')]=_0x27eabd[_0xebe2('0x53')];_0x3f3744[_0xebe2('0x54')]=_0x27eabd[_0xebe2('0x54')];_0x3f3744[_0xebe2('0x55')]=_0x27eabd[_0xebe2('0x55')];}if(_0x27eabd[_0xebe2('0x56')]){_0x3f3744[_0xebe2('0x56')]={'id':_0x27eabd['Trunk']['id'],'name':_0x27eabd[_0xebe2('0x56')][_0xebe2('0xc')],'active':_0x27eabd[_0xebe2('0x56')][_0xebe2('0x57')],'callerid':_0x27eabd[_0xebe2('0x56')]['callerid']};}if(_0x27eabd[_0xebe2('0x58')]){_0x3f3744[_0xebe2('0x58')]={'id':_0x27eabd[_0xebe2('0x58')]['id'],'name':_0x27eabd[_0xebe2('0x58')][_0xebe2('0xc')]};}_0x1ffb9a['push'](_0x3f3744);}}_0x4e8f37({'count':_0x1ffb9a['length'],'rows':_0x1ffb9a});});},'VoiceChannels':function(_0x53dd00){return new Promise(function(_0x6f9441,_0x2be10c){var _0x441448=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x5a')]);_0x6f9441({'count':_0x441448['length'],'rows':_0x441448});});},'VoiceChannelMixMonitor':function(_0x2a84f5){var _0x1f960e=this;return new Promise(function(_0x82a736,_0x5afec8){if(ami[_0xebe2('0x1f')]()==![]){return _0x5afec8(_0x1f960e[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config['asterisk'][_0xebe2('0x14')],_0xebe2('0x20')][_0xebe2('0x15')]('\x20')));}var _0x48b90c=schema(properties['voicechannel'])[_0xebe2('0x3')](_0x2a84f5);if(_0x48b90c[_0xebe2('0x5b')]>0x0){return _0x5afec8(_0x1f960e['error'](0x1f4,_[_0xebe2('0x5c')](_0x48b90c,_0xebe2('0x1d'))[_0xebe2('0x15')](',\x20')));}var _0x39b5ba=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x5a')],{'uniqueid':_0x2a84f5[_0xebe2('0x5e')]});if(_0x39b5ba&&_0x39b5ba['channel']){var _0x2a8918=util[_0xebe2('0x9')](_0xebe2('0x5f'),_0x2a84f5[_0xebe2('0x60')]||_0x2a84f5[_0xebe2('0x5e')],_0x2a84f5[_0xebe2('0x9')]||_0xebe2('0x61'));return ami[_0xebe2('0x1b')]({'action':_0xebe2('0x62'),'channel':_0x39b5ba[_0xebe2('0x63')],'file':_0x2a8918,'options':_0xebe2('0x64')})['then'](function(_0x592fbc){var _0x56a8dc=_[_0xebe2('0x5d')](_0x39b5ba[_0xebe2('0x65')],{'filename':_0xebe2('0x66')+_0x2a8918[_0xebe2('0x67')]()});if(_[_0xebe2('0x68')](_0x56a8dc)){_0x39b5ba[_0xebe2('0x65')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x2a8918[_0xebe2('0x67')](),'createdAt':moment()[_0xebe2('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x592fbc['mixmonitorid'],'status':_0xebe2('0x69')});}else{_0x56a8dc['mixmonitorid']=_0x592fbc[_0xebe2('0x6a')];_0x56a8dc[_0xebe2('0x6b')]=_0xebe2('0x69');}_0x82a736({'code':0xc8,'message':[_0x2a84f5[_0xebe2('0x5e')],'MixMonitor\x20Success',_0x592fbc[_0xebe2('0x6a')]][_0xebe2('0x15')]('\x20'),'mixmonitorid':_0x592fbc[_0xebe2('0x6a')]});})[_0xebe2('0x1e')](function(_0x4296a9){_0x5afec8(_0x1f960e['error'](0x1f5,[_0x2a84f5[_0xebe2('0x5e')],_0x4296a9[_0xebe2('0x1d')][_0xebe2('0x67')]()]['join']('\x20')));});}else{return _0x5afec8(_0x1f960e[_0xebe2('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x174217){var _0x548f04=this;return new Promise(function(_0x37bdcd,_0x2f583e){if(ami[_0xebe2('0x1f')]()==![]){return _0x2f583e(_0x548f04[_0xebe2('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xebe2('0x13')]['username'],_0xebe2('0x20')][_0xebe2('0x15')]('\x20')));}var _0x3776d9=schema(properties[_0xebe2('0x6c')])[_0xebe2('0x3')](_0x174217);if(_0x3776d9[_0xebe2('0x5b')]>0x0){return _0x2f583e(_0x548f04[_0xebe2('0x12')](0x1f4,_[_0xebe2('0x5c')](_0x3776d9,_0xebe2('0x1d'))[_0xebe2('0x15')](',\x20')));}var _0x53b896=_['find'](_0x8de59f[_0xebe2('0x5a')],{'uniqueid':_0x174217[_0xebe2('0x5e')]});if(_0x53b896){return BPromise[_0xebe2('0x6d')]()[_0xebe2('0x1c')](function(){if(_0x53b896[_0xebe2('0x63')]){return ami[_0xebe2('0x1b')]({'action':_0xebe2('0x6e'),'channel':_0x53b896[_0xebe2('0x63')],'mixmonitorid':_0x174217[_0xebe2('0x6a')]})['catch'](function(_0x401b2b){});}})[_0xebe2('0x1c')](function(){if(_0x53b896[_0xebe2('0x6f')]){return ami[_0xebe2('0x1b')]({'action':_0xebe2('0x6e'),'channel':_0x53b896[_0xebe2('0x6f')],'mixmonitorid':_0x174217[_0xebe2('0x6a')]})[_0xebe2('0x1e')](function(_0x2b0b91){});}})[_0xebe2('0x1c')](function(_0x2b639b){var _0x45237f=_[_0xebe2('0x5d')](_0x53b896[_0xebe2('0x65')],{'mixmonitorid':_0x174217[_0xebe2('0x6a')]});if(_0x45237f){_0x45237f['status']=_0xebe2('0x70');}})['then'](function(){var _0x342b0e=util['format'](_0xebe2('0x5f'),_0x174217[_0xebe2('0x60')]||_0x174217[_0xebe2('0x5e')],_0x174217[_0xebe2('0x9')]||'wav');var _0x1bb95d=_['find'](_0x53b896[_0xebe2('0x65')],{'filename':_0xebe2('0x66')+_0x342b0e[_0xebe2('0x67')]()});if(_0x1bb95d){_0x1bb95d[_0xebe2('0x6b')]=_0xebe2('0x70');}})['then'](function(){_0x37bdcd({'code':0xc8,'message':[_0x174217[_0xebe2('0x5e')],_0xebe2('0x71')][_0xebe2('0x15')]('\x20')});})[_0xebe2('0x1e')](function(_0x3cd8cf){_0x2f583e(_0x548f04['error'](0x1f5,[_0x174217['uniqueid'],_0x3cd8cf['message'][_0xebe2('0x67')]()]['join']('\x20')));});}else{return _0x2f583e(_0x548f04[_0xebe2('0x12')](0x1f5,_0xebe2('0x72')));}});},'VoiceQueuesChannels':function(_0x46e7a1){return new Promise(function(_0x46b235,_0x2170e3){var _0x3f7034=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x73')]);_0x46b235({'count':_0x3f7034[_0xebe2('0x5b')],'rows':_0x3f7034});});},'VoiceQueuesChannel':function(_0x2be729){var _0x22f7d3=this;return new Promise(function(_0x2c7277,_0x5b88d1){var _0x1c7965=schema(properties[_0xebe2('0x74')])['validate'](_0x2be729);if(_0x1c7965[_0xebe2('0x5b')]>0x0){return _0x5b88d1(_0x22f7d3['error'](0x1f4,_[_0xebe2('0x5c')](_0x1c7965,'message')[_0xebe2('0x15')](',\x20')));}var _0x2a2a43=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x73')],{'uniqueid':_0x2be729[_0xebe2('0x5e')]});if(_0x2a2a43){_0x2c7277(_0x2a2a43);}else{return _0x5b88d1(_0x22f7d3[_0xebe2('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x29dd12){var _0x495336=this;return new Promise(function(_0x51694b,_0x54abe2){if(ami['isConnected']()==![]){return _0x54abe2(_0x495336[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config[_0xebe2('0x13')]['username'],_0xebe2('0x20')]['join']('\x20')));}var _0x47c22b=schema(properties[_0xebe2('0x75')])[_0xebe2('0x3')](_0x29dd12);if(_0x47c22b[_0xebe2('0x5b')]>0x0){return _0x54abe2(_0x495336[_0xebe2('0x12')](0x1f4,_['map'](_0x47c22b,_0xebe2('0x1d'))['join'](',\x20')));}var _0xd62086=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x73')],{'uniqueid':_0x29dd12[_0xebe2('0x5e')]});if(_0xd62086&&_0xd62086['channel']){return ami['Action']({'action':_0xebe2('0x76'),'channel':_0xd62086[_0xebe2('0x63')]})[_0xebe2('0x1c')](function(_0x156c43){_0x51694b({'code':0xc8,'message':[_0x29dd12[_0xebe2('0x5e')],_0x156c43['message'][_0xebe2('0x67')]()]['join']('\x20')});})[_0xebe2('0x1e')](function(_0x3efb30){_0x54abe2(_0x495336[_0xebe2('0x12')](0x1f5,[_0x29dd12['uniqueid'],_0x3efb30[_0xebe2('0x1d')][_0xebe2('0x67')]()][_0xebe2('0x15')]('\x20')));});}else{return _0x54abe2(_0x495336[_0xebe2('0x12')](0x1f5,_0xebe2('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x6f7ae8){var _0x4f0b13=this;return new Promise(function(_0x1b8272,_0x11460e){if(ami[_0xebe2('0x1f')]()==![]){return _0x11460e(_0x4f0b13[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config[_0xebe2('0x13')][_0xebe2('0x14')],_0xebe2('0x20')]['join']('\x20')));}var _0x44b4a6=schema(properties['voicequeuechannelredirect'])[_0xebe2('0x3')](_0x6f7ae8);if(_0x44b4a6[_0xebe2('0x5b')]>0x0){return _0x11460e(_0x4f0b13[_0xebe2('0x12')](0x1f4,_[_0xebe2('0x5c')](_0x44b4a6,_0xebe2('0x1d'))[_0xebe2('0x15')](',\x20')));}var _0x45f62c=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x73')],{'uniqueid':_0x6f7ae8[_0xebe2('0x5e')]});if(_0x45f62c&&_0x45f62c[_0xebe2('0x63')]){return ami['Action']({'action':_0xebe2('0x77'),'channel':_0x45f62c[_0xebe2('0x63')],'exten':_0x6f7ae8[_0xebe2('0x78')],'context':_0x6f7ae8[_0xebe2('0x79')]||_0x45f62c[_0xebe2('0x79')],'priority':0x1})[_0xebe2('0x1c')](function(_0x44db7c){_0x1b8272({'code':0xc8,'message':[_0x6f7ae8['uniqueid'],_0x44db7c[_0xebe2('0x1d')][_0xebe2('0x67')]()][_0xebe2('0x15')]('\x20')});})[_0xebe2('0x1e')](function(_0x37843b){_0x11460e(_0x4f0b13['error'](0x1f5,[_0x6f7ae8['uniqueid'],_0x37843b[_0xebe2('0x1d')][_0xebe2('0x67')]()][_0xebe2('0x15')]('\x20')));});}else{return _0x11460e(_0x4f0b13[_0xebe2('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x1e72cf){return new Promise(function(_0x4d7c1c,_0xea8f4f){var _0x3b229e=_['values'](_0x8de59f[_0xebe2('0x10')]);_0x4d7c1c({'count':_0x3b229e[_0xebe2('0x5b')],'rows':_0x3b229e});});},'Telephones':function(_0x2c0afa){return new Promise(function(_0x535b85,_0x533f05){var _0x452c93=_[_0xebe2('0x59')](_0x8de59f['telephones']);_0x535b85({'count':_0x452c93['length'],'rows':_0x452c93});});},'Trunks':function(_0xe600c2){return new Promise(function(_0x39026d,_0x40dd6e){var _0x1ee2cb=_['values'](_0x8de59f[_0xebe2('0x7a')]);_0x39026d({'count':_0x1ee2cb[_0xebe2('0x5b')],'rows':_0x1ee2cb});});},'OutboundChannels':function(_0x2f9fcd){return new Promise(function(_0x5a3d65,_0xffae69){var _0x5ece07=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x7b')]);_0x5a3d65({'count':_0x5ece07['length'],'rows':_0x5ece07});});},'Outbound':function(_0x36bd9e){return new Promise(function(_0x5b7826,_0x5c9f76){_0x5b7826(_0x8de59f[_0xebe2('0x2e')]);});},'Campaigns':function(_0xaf7e13){return new Promise(function(_0xf28d1e,_0x258ac7){var _0xa05132=_['values'](_0x8de59f['campaigns']);_0xf28d1e({'count':_0xa05132[_0xebe2('0x5b')],'rows':_0xa05132});});},'VoiceQueuesPreview':function(_0x138235){var _0x237985=this;return new Promise(function(_0x2e5235,_0x5a45b8){_0x6c3fec[_0xebe2('0x7c')](_0x138235['id'])[_0xebe2('0x1c')](function(_0x54bda9){_0x2e5235({'code':0xc8,'message':_0x54bda9['message']});})['catch'](function(_0x6466a8){_0x5a45b8(_0x237985['error'](0x1f4,_0x6466a8[_0xebe2('0x1d')]));});});},'EventManager':function(_0x1560ec){var _0x3667df=this;return new Promise(function(_0x34a14e,_0x224aef){if(!_0x1560ec[_0xebe2('0x7d')]){return _0x224aef(_0x3667df['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xebe2('0x7e')](_0xebe2('0x7f')+_0x1560ec[_0xebe2('0x7d')],_0x1560ec['message']);_0x34a14e({'code':0xc8,'message':_0x1560ec});});},'FaxAccounts':function(_0x4ddd0a){return new Promise(function(_0x38c8c3,_0x2dcd0b){var _0xa3a5d2=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x80')]);_0x38c8c3({'count':_0xa3a5d2[_0xebe2('0x5b')],'rows':_0xa3a5d2});});},'SendFax':function(_0x2bf8f2){var _0x8e83f2=this;return new Promise(function(_0x4e01d4,_0x41bbad){_0x5a88f7['send'](_0x2bf8f2)[_0xebe2('0x1c')](function(_0x565d0f){_0x4e01d4({'code':0xc8,'message':_0x565d0f[_0xebe2('0x1d')]});})['catch'](function(_0x48e2cd){_0x41bbad(_0x8e83f2[_0xebe2('0x12')](0x1f4,_0x48e2cd['message']));});});},'CheckAfterSend':function(_0x1521b5){var _0x3d1a1c=this;return new Promise(function(_0x33f2c5,_0x82aa65){_0x5a88f7[_0xebe2('0x81')](_0x1521b5)[_0xebe2('0x1c')](function(_0x308202){_0x33f2c5({'code':0xc8,'message':_0x308202[_0xebe2('0x1d')]});})[_0xebe2('0x1e')](function(_0x53b223){_0x82aa65(_0x3d1a1c[_0xebe2('0x12')](0x1f4,_0x53b223[_0xebe2('0x1d')]));});});}};var _0x3ed2b0=jayson[_0xebe2('0x82')](_0x154182)['http']();_0x3ed2b0['on'](_0xebe2('0x12'),function(_0x23a07a){return _0x335f49(_0x23a07a);});_0x3ed2b0[_0xebe2('0x8')](0x232a,_0xebe2('0x83'),function(){console['log'](_0xebe2('0x84'),0x232a);return _0x2d9eaf('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xaafe=['campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','send','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','bluebird','moment','../../../config/environment','../properties','listen','format','name','timers','timer','updateAcw','agents','updateStatusRealtime','isConnected','asterisk','username','ami\x20disconnected','join','pick','action','Reload','Action','then','message','error','command','Command','catch','voiceQueues','hasOwnProperty','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','type','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','values','channels','length','voicechannel','map','find','uniqueid','channel','filename','wav','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','%s.%s','queueChannels','voicequeuechannel','validate','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xaafe,0x10d));var _0xeaaf=function(_0x472e39,_0x446054){_0x472e39=_0x472e39-0x0;var _0x4baebf=_0xaafe[_0x472e39];return _0x4baebf;};'use strict';var _=require(_0xeaaf('0x0'));var util=require(_0xeaaf('0x1'));var jayson=require('jayson/promise');var schema=require('validate');var BPromise=require(_0xeaaf('0x2'));var moment=require(_0xeaaf('0x3'));var config=require(_0xeaaf('0x4'));var properties=require(_0xeaaf('0x5'));var ami=require('../ami');exports[_0xeaaf('0x6')]=function(_0x4d4045,_0x2c412e,_0x1513bd){return new BPromise(function(_0x5ec6b2,_0x3e11a9){var _0x48ea73={'QueuePause':function(_0x3d9d7c){return new Promise(function(_0x4129ac,_0x1398a8){var _0x897656=util[_0xeaaf('0x7')]('%s/%s','SIP',_0x3d9d7c[_0xeaaf('0x8')]);if(_0x4d4045[_0xeaaf('0x9')]&&_0x4d4045[_0xeaaf('0x9')][_0x897656]&&_0x4d4045['timers'][_0x897656][_0xeaaf('0xa')]){_0x4d4045[_0xeaaf('0x9')][_0x897656][_0xeaaf('0xb')]();}if(_0x4d4045[_0xeaaf('0xc')][_0x897656]){_0x4d4045[_0xeaaf('0xc')][_0x897656][_0xeaaf('0xd')]({'statePause':_0x3d9d7c['pause']?!![]:![]});}_0x4129ac({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x32ca32){var _0x5d5f0a=this;return new Promise(function(_0x297f0b,_0x56dfbb){if(ami[_0xeaaf('0xe')]()==![]){return _0x56dfbb(_0x5d5f0a['error'](0x1f4,[config[_0xeaaf('0xf')]['ip'],config[_0xeaaf('0xf')][_0xeaaf('0x10')],_0xeaaf('0x11')][_0xeaaf('0x12')]('\x20')));}_0x32ca32=_[_0xeaaf('0x13')](_0x32ca32,_['keys'](properties['module']));_0x32ca32[_0xeaaf('0x14')]=_0xeaaf('0x15');return ami[_0xeaaf('0x16')](_0x32ca32)[_0xeaaf('0x17')](function(_0x4a39cb){_0x297f0b({'code':0xc8,'message':_0x4a39cb[_0xeaaf('0x18')]});})['catch'](function(_0x31706c){_0x56dfbb(_0x5d5f0a['error'](0x1f5,_0x31706c['message']));});});},'Command':function(_0x29ecd8){var _0x3af420=this;return new Promise(function(_0x4b6f2e,_0x31102c){if(ami[_0xeaaf('0xe')]()==![]){return _0x31102c(_0x3af420[_0xeaaf('0x19')](0x1f4,[config[_0xeaaf('0xf')]['ip'],config[_0xeaaf('0xf')][_0xeaaf('0x10')],_0xeaaf('0x11')][_0xeaaf('0x12')]('\x20')));}_0x29ecd8=_['pick'](_0x29ecd8,_0xeaaf('0x1a'));_0x29ecd8[_0xeaaf('0x14')]=_0xeaaf('0x1b');return ami[_0xeaaf('0x16')](_0x29ecd8)['then'](function(_0x1710af){_0x4b6f2e({'code':0xc8,'message':_0x1710af['content']});})[_0xeaaf('0x1c')](function(_0x147047){_0x31102c(_0x3af420[_0xeaaf('0x19')](0x1f5,_0x147047[_0xeaaf('0x18')]));});});},'VoiceQueues':function(_0x55f094){return new Promise(function(_0x3b9801,_0x360f09){var _0x1f0871=[];for(var _0x2a2da9 in _0x4d4045[_0xeaaf('0x1d')]){if(_0x4d4045[_0xeaaf('0x1d')][_0xeaaf('0x1e')](_0x2a2da9)){var _0x57873a=_0x4d4045[_0xeaaf('0x1d')][_0x2a2da9];var _0x5084a0={'id':_0x57873a['id'],'name':_0x57873a[_0xeaaf('0x8')],'strategy':_0x57873a['strategy'],'answered':_0x57873a[_0xeaaf('0x1f')],'available':_0x57873a[_0xeaaf('0x20')],'loggedIn':_0x57873a[_0xeaaf('0x21')],'pTalking':_0x57873a[_0xeaaf('0x22')],'sumBillable':_0x57873a[_0xeaaf('0x23')],'sumDuration':_0x57873a[_0xeaaf('0x24')],'sumHoldTime':_0x57873a[_0xeaaf('0x25')]||0x0,'talking':_0x57873a['talking'],'total':_0x57873a['total'],'type':_0x57873a[_0xeaaf('0x26')],'unmanaged':_0x57873a['unmanaged'],'abandoned':_0x57873a[_0xeaaf('0x27')],'waiting':_0x57873a['waiting'],'loggedInDb':_0x57873a[_0xeaaf('0x28')]};if(_0x57873a[_0xeaaf('0x26')]===_0xeaaf('0x29')){_0x5084a0[_0xeaaf('0x2a')]=_0x57873a[_0xeaaf('0x2a')];_0x5084a0[_0xeaaf('0x2b')]=_0x57873a[_0xeaaf('0x2b')];_0x5084a0[_0xeaaf('0x2c')]=_0x57873a[_0xeaaf('0x2c')];_0x5084a0[_0xeaaf('0x2d')]=_0x57873a[_0xeaaf('0x2d')];_0x5084a0[_0xeaaf('0x2e')]=_0x57873a[_0xeaaf('0x2e')];_0x5084a0[_0xeaaf('0x2f')]=_0x57873a[_0xeaaf('0x2f')];_0x5084a0[_0xeaaf('0x30')]=_0x57873a[_0xeaaf('0x30')];_0x5084a0[_0xeaaf('0x31')]=_0x57873a['outboundAnswerCallsDay'];_0x5084a0[_0xeaaf('0x32')]=_0x57873a['outboundBlacklistCallsDay'];_0x5084a0['outboundBusyCallsDay']=_0x57873a['outboundBusyCallsDay'];_0x5084a0['outboundCongestionCallsDay']=_0x57873a[_0xeaaf('0x33')];_0x5084a0[_0xeaaf('0x34')]=_0x57873a[_0xeaaf('0x34')];_0x5084a0[_0xeaaf('0x35')]=_0x57873a[_0xeaaf('0x35')];_0x5084a0[_0xeaaf('0x36')]=_0x57873a[_0xeaaf('0x36')];_0x5084a0[_0xeaaf('0x37')]=_0x57873a[_0xeaaf('0x37')];_0x5084a0['outboundNoSuchCallsDay']=_0x57873a['outboundNoSuchCallsDay'];_0x5084a0['outboundOriginateFailureCallsDay']=_0x57873a['outboundOriginateFailureCallsDay'];_0x5084a0[_0xeaaf('0x38')]=_0x57873a[_0xeaaf('0x38')];_0x5084a0[_0xeaaf('0x39')]=_0x57873a[_0xeaaf('0x39')];_0x5084a0['outboundUnknownCallsDay']=_0x57873a[_0xeaaf('0x3a')];_0x5084a0[_0xeaaf('0x3b')]=_0x57873a[_0xeaaf('0x3b')];_0x5084a0[_0xeaaf('0x3c')]=_0x57873a[_0xeaaf('0x3c')];_0x5084a0['predictiveIntervalAvgTalktime']=_0x57873a[_0xeaaf('0x3d')];_0x5084a0[_0xeaaf('0x3e')]=_0x57873a['predictiveIntervalDroppedCallsCallersExit'];_0x5084a0[_0xeaaf('0x3f')]=_0x57873a[_0xeaaf('0x3f')];_0x5084a0[_0xeaaf('0x40')]=_0x57873a['predictiveIntervalErlangCalls'];_0x5084a0['predictiveIntervalErlangCallsDroppedCalls']=_0x57873a[_0xeaaf('0x41')];_0x5084a0[_0xeaaf('0x42')]=_0x57873a[_0xeaaf('0x42')];_0x5084a0[_0xeaaf('0x43')]=_0x57873a[_0xeaaf('0x43')];_0x5084a0[_0xeaaf('0x44')]=_0x57873a['predictiveIntervalPauses'];_0x5084a0[_0xeaaf('0x45')]=_0x57873a[_0xeaaf('0x45')];_0x5084a0[_0xeaaf('0x46')]=_0x57873a[_0xeaaf('0x46')];_0x5084a0[_0xeaaf('0x18')]=_0x57873a[_0xeaaf('0x18')];_0x5084a0['originated']=_0x57873a[_0xeaaf('0x47')];_0x5084a0['erlangCalls']=_0x57873a[_0xeaaf('0x48')];_0x5084a0[_0xeaaf('0x49')]=_0x57873a[_0xeaaf('0x49')];_0x5084a0[_0xeaaf('0x4a')]=_0x57873a[_0xeaaf('0x4a')];_0x5084a0[_0xeaaf('0x4b')]=_0x57873a[_0xeaaf('0x4b')];_0x5084a0[_0xeaaf('0x4c')]=_0x57873a[_0xeaaf('0x4c')];_0x5084a0[_0xeaaf('0x4d')]=_0x57873a[_0xeaaf('0x4d')];}if(_0x57873a[_0xeaaf('0x4e')]){_0x5084a0[_0xeaaf('0x4e')]={'id':_0x57873a['Trunk']['id'],'name':_0x57873a['Trunk']['name'],'active':_0x57873a[_0xeaaf('0x4e')][_0xeaaf('0x4f')],'callerid':_0x57873a[_0xeaaf('0x4e')]['callerid']};}if(_0x57873a[_0xeaaf('0x50')]){_0x5084a0[_0xeaaf('0x50')]={'id':_0x57873a['Interval']['id'],'name':_0x57873a[_0xeaaf('0x50')]['name']};}_0x1f0871['push'](_0x5084a0);}}_0x3b9801({'count':_0x1f0871['length'],'rows':_0x1f0871});});},'VoiceChannels':function(_0x58cc9e){return new Promise(function(_0x2bd766,_0x389ff1){var _0x58fd7f=_[_0xeaaf('0x51')](_0x4d4045[_0xeaaf('0x52')]);_0x2bd766({'count':_0x58fd7f[_0xeaaf('0x53')],'rows':_0x58fd7f});});},'VoiceChannelMixMonitor':function(_0x3b5b3a){var _0x214b5e=this;return new Promise(function(_0x57f0a9,_0x3863d3){if(ami[_0xeaaf('0xe')]()==![]){return _0x3863d3(_0x214b5e['error'](0x1f4,[config[_0xeaaf('0xf')]['ip'],config[_0xeaaf('0xf')][_0xeaaf('0x10')],_0xeaaf('0x11')]['join']('\x20')));}var _0x575487=schema(properties[_0xeaaf('0x54')])['validate'](_0x3b5b3a);if(_0x575487[_0xeaaf('0x53')]>0x0){return _0x3863d3(_0x214b5e[_0xeaaf('0x19')](0x1f4,_[_0xeaaf('0x55')](_0x575487,_0xeaaf('0x18'))[_0xeaaf('0x12')](',\x20')));}var _0x13e6b7=_[_0xeaaf('0x56')](_0x4d4045[_0xeaaf('0x52')],{'uniqueid':_0x3b5b3a[_0xeaaf('0x57')]});if(_0x13e6b7&&_0x13e6b7[_0xeaaf('0x58')]){var _0x5b038f=util[_0xeaaf('0x7')]('%s.%s',_0x3b5b3a[_0xeaaf('0x59')]||_0x3b5b3a[_0xeaaf('0x57')],_0x3b5b3a[_0xeaaf('0x7')]||_0xeaaf('0x5a'));return ami[_0xeaaf('0x16')]({'action':'MixMonitor','channel':_0x13e6b7[_0xeaaf('0x58')],'file':_0x5b038f,'options':_0xeaaf('0x5b')})[_0xeaaf('0x17')](function(_0x45fa27){var _0x671a85=_['find'](_0x13e6b7[_0xeaaf('0x5c')],{'filename':_0xeaaf('0x5d')+_0x5b038f[_0xeaaf('0x5e')]()});if(_[_0xeaaf('0x5f')](_0x671a85)){_0x13e6b7[_0xeaaf('0x5c')][_0xeaaf('0x60')]({'filename':_0xeaaf('0x5d')+_0x5b038f[_0xeaaf('0x5e')](),'createdAt':moment()[_0xeaaf('0x7')](_0xeaaf('0x61')),'mixmonitorid':_0x45fa27[_0xeaaf('0x62')],'status':_0xeaaf('0x63')});}else{_0x671a85[_0xeaaf('0x62')]=_0x45fa27[_0xeaaf('0x62')];_0x671a85[_0xeaaf('0x64')]=_0xeaaf('0x63');}_0x57f0a9({'code':0xc8,'message':[_0x3b5b3a[_0xeaaf('0x57')],_0xeaaf('0x65'),_0x45fa27[_0xeaaf('0x62')]][_0xeaaf('0x12')]('\x20'),'mixmonitorid':_0x45fa27['mixmonitorid']});})['catch'](function(_0x56f075){_0x3863d3(_0x214b5e[_0xeaaf('0x19')](0x1f5,[_0x3b5b3a[_0xeaaf('0x57')],_0x56f075[_0xeaaf('0x18')][_0xeaaf('0x5e')]()]['join']('\x20')));});}else{return _0x3863d3(_0x214b5e[_0xeaaf('0x19')](0x1f5,_0xeaaf('0x66')));}});},'VoiceChannelStopMixMonitor':function(_0x2727dc){var _0x5da0b9=this;return new Promise(function(_0x331111,_0x3a5abb){if(ami[_0xeaaf('0xe')]()==![]){return _0x3a5abb(_0x5da0b9[_0xeaaf('0x19')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xeaaf('0x10')],'ami\x20disconnected'][_0xeaaf('0x12')]('\x20')));}var _0x4de2ef=schema(properties[_0xeaaf('0x54')])['validate'](_0x2727dc);if(_0x4de2ef[_0xeaaf('0x53')]>0x0){return _0x3a5abb(_0x5da0b9[_0xeaaf('0x19')](0x1f4,_[_0xeaaf('0x55')](_0x4de2ef,'message')[_0xeaaf('0x12')](',\x20')));}var _0x287ae8=_[_0xeaaf('0x56')](_0x4d4045['channels'],{'uniqueid':_0x2727dc['uniqueid']});if(_0x287ae8){return BPromise[_0xeaaf('0x67')]()[_0xeaaf('0x17')](function(){if(_0x287ae8[_0xeaaf('0x58')]){return ami[_0xeaaf('0x16')]({'action':_0xeaaf('0x68'),'channel':_0x287ae8[_0xeaaf('0x58')],'mixmonitorid':_0x2727dc[_0xeaaf('0x62')]})['catch'](function(_0x1b3155){});}})['then'](function(){if(_0x287ae8[_0xeaaf('0x69')]){return ami[_0xeaaf('0x16')]({'action':_0xeaaf('0x68'),'channel':_0x287ae8[_0xeaaf('0x69')],'mixmonitorid':_0x2727dc[_0xeaaf('0x62')]})['catch'](function(_0x11c92f){});}})[_0xeaaf('0x17')](function(_0x11afc4){var _0x4f1ecc=_[_0xeaaf('0x56')](_0x287ae8['monitors'],{'mixmonitorid':_0x2727dc[_0xeaaf('0x62')]});if(_0x4f1ecc){_0x4f1ecc[_0xeaaf('0x64')]=_0xeaaf('0x6a');}})[_0xeaaf('0x17')](function(){var _0x2823bf=util['format'](_0xeaaf('0x6b'),_0x2727dc['filename']||_0x2727dc[_0xeaaf('0x57')],_0x2727dc['format']||_0xeaaf('0x5a'));var _0x54c072=_[_0xeaaf('0x56')](_0x287ae8[_0xeaaf('0x5c')],{'filename':_0xeaaf('0x5d')+_0x2823bf[_0xeaaf('0x5e')]()});if(_0x54c072){_0x54c072[_0xeaaf('0x64')]=_0xeaaf('0x6a');}})['then'](function(){_0x331111({'code':0xc8,'message':[_0x2727dc[_0xeaaf('0x57')],'StopMixMonitor\x20Success'][_0xeaaf('0x12')]('\x20')});})[_0xeaaf('0x1c')](function(_0xb16885){_0x3a5abb(_0x5da0b9['error'](0x1f5,[_0x2727dc['uniqueid'],_0xb16885['message'][_0xeaaf('0x5e')]()][_0xeaaf('0x12')]('\x20')));});}else{return _0x3a5abb(_0x5da0b9[_0xeaaf('0x19')](0x1f5,_0xeaaf('0x66')));}});},'VoiceQueuesChannels':function(_0x317559){return new Promise(function(_0x342e8f,_0x5df94e){var _0x1d6f17=_[_0xeaaf('0x51')](_0x4d4045[_0xeaaf('0x6c')]);_0x342e8f({'count':_0x1d6f17[_0xeaaf('0x53')],'rows':_0x1d6f17});});},'VoiceQueuesChannel':function(_0x47dc1b){var _0x172c19=this;return new Promise(function(_0xb595,_0x407b86){var _0x2de385=schema(properties[_0xeaaf('0x6d')])[_0xeaaf('0x6e')](_0x47dc1b);if(_0x2de385['length']>0x0){return _0x407b86(_0x172c19[_0xeaaf('0x19')](0x1f4,_[_0xeaaf('0x55')](_0x2de385,_0xeaaf('0x18'))[_0xeaaf('0x12')](',\x20')));}var _0x1e1acc=_[_0xeaaf('0x56')](_0x4d4045[_0xeaaf('0x6c')],{'uniqueid':_0x47dc1b[_0xeaaf('0x57')]});if(_0x1e1acc){_0xb595(_0x1e1acc);}else{return _0x407b86(_0x172c19[_0xeaaf('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x52dd7f){var _0x394e58=this;return new Promise(function(_0xe2a5f3,_0x15039e){if(ami[_0xeaaf('0xe')]()==![]){return _0x15039e(_0x394e58[_0xeaaf('0x19')](0x1f4,[config[_0xeaaf('0xf')]['ip'],config['asterisk'][_0xeaaf('0x10')],_0xeaaf('0x11')][_0xeaaf('0x12')]('\x20')));}var _0x1ffc1d=schema(properties[_0xeaaf('0x6f')])[_0xeaaf('0x6e')](_0x52dd7f);if(_0x1ffc1d[_0xeaaf('0x53')]>0x0){return _0x15039e(_0x394e58[_0xeaaf('0x19')](0x1f4,_[_0xeaaf('0x55')](_0x1ffc1d,_0xeaaf('0x18'))[_0xeaaf('0x12')](',\x20')));}var _0xf40b9=_[_0xeaaf('0x56')](_0x4d4045[_0xeaaf('0x6c')],{'uniqueid':_0x52dd7f[_0xeaaf('0x57')]});if(_0xf40b9&&_0xf40b9[_0xeaaf('0x58')]){return ami[_0xeaaf('0x16')]({'action':_0xeaaf('0x70'),'channel':_0xf40b9['channel']})[_0xeaaf('0x17')](function(_0x954340){_0xe2a5f3({'code':0xc8,'message':[_0x52dd7f[_0xeaaf('0x57')],_0x954340[_0xeaaf('0x18')][_0xeaaf('0x5e')]()][_0xeaaf('0x12')]('\x20')});})[_0xeaaf('0x1c')](function(_0x20db3d){_0x15039e(_0x394e58[_0xeaaf('0x19')](0x1f5,[_0x52dd7f['uniqueid'],_0x20db3d['message'][_0xeaaf('0x5e')]()]['join']('\x20')));});}else{return _0x15039e(_0x394e58[_0xeaaf('0x19')](0x1f5,_0xeaaf('0x66')));}});},'VoiceQueuesChannelRedirect':function(_0x2f024d){var _0x1d7624=this;return new Promise(function(_0x246f24,_0x40f6b8){if(ami[_0xeaaf('0xe')]()==![]){return _0x40f6b8(_0x1d7624[_0xeaaf('0x19')](0x1f4,[config[_0xeaaf('0xf')]['ip'],config[_0xeaaf('0xf')][_0xeaaf('0x10')],_0xeaaf('0x11')][_0xeaaf('0x12')]('\x20')));}var _0x2dd843=schema(properties[_0xeaaf('0x71')])[_0xeaaf('0x6e')](_0x2f024d);if(_0x2dd843[_0xeaaf('0x53')]>0x0){return _0x40f6b8(_0x1d7624[_0xeaaf('0x19')](0x1f4,_[_0xeaaf('0x55')](_0x2dd843,'message')[_0xeaaf('0x12')](',\x20')));}var _0x572079=_[_0xeaaf('0x56')](_0x4d4045[_0xeaaf('0x6c')],{'uniqueid':_0x2f024d[_0xeaaf('0x57')]});if(_0x572079&&_0x572079[_0xeaaf('0x58')]){return ami[_0xeaaf('0x16')]({'action':'Redirect','channel':_0x572079['channel'],'exten':_0x2f024d[_0xeaaf('0x72')],'context':_0x2f024d[_0xeaaf('0x73')]||_0x572079[_0xeaaf('0x73')],'priority':0x1})[_0xeaaf('0x17')](function(_0x5e0cbc){_0x246f24({'code':0xc8,'message':[_0x2f024d['uniqueid'],_0x5e0cbc[_0xeaaf('0x18')][_0xeaaf('0x5e')]()][_0xeaaf('0x12')]('\x20')});})[_0xeaaf('0x1c')](function(_0x13a94a){_0x40f6b8(_0x1d7624[_0xeaaf('0x19')](0x1f5,[_0x2f024d[_0xeaaf('0x57')],_0x13a94a['message']['toLowerCase']()][_0xeaaf('0x12')]('\x20')));});}else{return _0x40f6b8(_0x1d7624['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2a7a96){return new Promise(function(_0x2e4b8e,_0xd22526){var _0x571a9f=_[_0xeaaf('0x51')](_0x4d4045['agents']);_0x2e4b8e({'count':_0x571a9f[_0xeaaf('0x53')],'rows':_0x571a9f});});},'Telephones':function(_0x372694){return new Promise(function(_0x59d2f0,_0x314482){var _0x247ac3=_[_0xeaaf('0x51')](_0x4d4045[_0xeaaf('0x74')]);_0x59d2f0({'count':_0x247ac3[_0xeaaf('0x53')],'rows':_0x247ac3});});},'Trunks':function(_0x2e6b40){return new Promise(function(_0x3855f7,_0x433653){var _0x9f377f=_[_0xeaaf('0x51')](_0x4d4045[_0xeaaf('0x75')]);_0x3855f7({'count':_0x9f377f[_0xeaaf('0x53')],'rows':_0x9f377f});});},'OutboundChannels':function(_0x45aed7){return new Promise(function(_0x142774,_0x148f1d){var _0x371243=_[_0xeaaf('0x51')](_0x4d4045['outboundChannels']);_0x142774({'count':_0x371243[_0xeaaf('0x53')],'rows':_0x371243});});},'Outbound':function(_0x13fc57){return new Promise(function(_0x5be1a7,_0x4f7f0f){_0x5be1a7(_0x4d4045[_0xeaaf('0x29')]);});},'Campaigns':function(_0x4b720f){return new Promise(function(_0x254837,_0x10cb5){var _0x1290fe=_[_0xeaaf('0x51')](_0x4d4045[_0xeaaf('0x76')]);_0x254837({'count':_0x1290fe[_0xeaaf('0x53')],'rows':_0x1290fe});});},'VoiceQueuesPreview':function(_0x34c513){var _0x235544=this;return new Promise(function(_0x4830c4,_0x47d78a){_0x2c412e[_0xeaaf('0x77')](_0x34c513['id'])[_0xeaaf('0x17')](function(_0x3f662f){_0x4830c4({'code':0xc8,'message':_0x3f662f[_0xeaaf('0x18')]});})[_0xeaaf('0x1c')](function(_0x178883){_0x47d78a(_0x235544[_0xeaaf('0x19')](0x1f4,_0x178883[_0xeaaf('0x18')]));});});},'EventManager':function(_0x530219){var _0x3a2a73=this;return new Promise(function(_0x40628a,_0xfe6a6e){if(!_0x530219[_0xeaaf('0x78')]){return _0xfe6a6e(_0x3a2a73[_0xeaaf('0x19')](0x1f4,_0xeaaf('0x79')));}ami[_0xeaaf('0x7a')](_0xeaaf('0x7b')+_0x530219['event'],_0x530219[_0xeaaf('0x18')]);_0x40628a({'code':0xc8,'message':_0x530219});});},'FaxAccounts':function(_0x576875){return new Promise(function(_0x44b633,_0xc7a98b){var _0x37146c=_[_0xeaaf('0x51')](_0x4d4045['faxAccounts']);_0x44b633({'count':_0x37146c[_0xeaaf('0x53')],'rows':_0x37146c});});},'SendFax':function(_0x4eed57){var _0x5b0ea4=this;return new Promise(function(_0x5385b5,_0x417ab0){_0x1513bd[_0xeaaf('0x7c')](_0x4eed57)[_0xeaaf('0x17')](function(_0x930a6e){_0x5385b5({'code':0xc8,'message':_0x930a6e[_0xeaaf('0x18')]});})[_0xeaaf('0x1c')](function(_0x2e64db){_0x417ab0(_0x5b0ea4['error'](0x1f4,_0x2e64db[_0xeaaf('0x18')]));});});},'CheckAfterSend':function(_0x5493f9){var _0x15900e=this;return new Promise(function(_0xbf85fa,_0x579f55){_0x1513bd['checkAfterSend'](_0x5493f9)[_0xeaaf('0x17')](function(_0x4558b5){_0xbf85fa({'code':0xc8,'message':_0x4558b5[_0xeaaf('0x18')]});})['catch'](function(_0x3d422a){_0x579f55(_0x15900e[_0xeaaf('0x19')](0x1f4,_0x3d422a[_0xeaaf('0x18')]));});});}};var _0x34fdfe=jayson['server'](_0x48ea73)[_0xeaaf('0x7d')]();_0x34fdfe['on']('error',function(_0x2d0d68){return _0x3e11a9(_0x2d0d68);});_0x34fdfe[_0xeaaf('0x6')](0x232a,_0xeaaf('0x7e'),function(){console[_0xeaaf('0x7f')](_0xeaaf('0x80'),0x232a);return _0x5ec6b2('RPC\x20listening\x20on\x20port:'+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 0bb3df9..9d68986 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 _0x3af5=['routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','omit','user:%s','name','format','action','toLowerCase','merge','createContact','xmd-contactid2','trigger:%s','catch','error','Error\x20creating\x20contact','bluebird','util','ioredis','../../../../config/environment','../../rpc/cmContact','redis','localhost','info','stringify','emit','exec','data2','data1','calleridnum'];(function(_0x3b3e88,_0x118c7d){var _0x35600a=function(_0x3f1b10){while(--_0x3f1b10){_0x3b3e88['push'](_0x3b3e88['shift']());}};_0x35600a(++_0x118c7d);}(_0x3af5,0x1d3));var _0x53af=function(_0x2ccb91,_0xa2c1b4){_0x2ccb91=_0x2ccb91-0x0;var _0x4136ca=_0x3af5[_0x2ccb91];return _0x4136ca;};'use strict';var BPromise=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var _=require('lodash');var Redis=require(_0x53af('0x2'));var config=require(_0x53af('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x53af('0x4'));config['redis']=_['defaults'](config[_0x53af('0x5')],{'host':_0x53af('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x53af('0x5')]));function emit(_0x4eb461,_0x3aefaf,_0x27eed3){logger[_0x53af('0x7')](_0x4eb461,_0x3aefaf,JSON[_0x53af('0x8')](_0x27eed3));io['to'](_0x4eb461)[_0x53af('0x9')](_0x3aefaf,_0x27eed3);}exports[_0x53af('0xa')]=function(_0x56751b,_0x52b4d1,_0x10ee70){_0x10ee70['autoCreate']=0x0;if(_0x52b4d1[_0x53af('0xb')]&&parseInt(_0x52b4d1[_0x53af('0xb')],0xa)){var _0x56c2ed={'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa),'phone':_0x10ee70[_0x53af('0xd')]};if(_['isNil'](_0x10ee70[_0x53af('0xe')])){_0x56c2ed[_0x53af('0xf')]=_0x10ee70[_0x53af('0x10')]&&_0x10ee70['calleridname']!==_0x53af('0x11')?_0x10ee70['calleridname']:_0x10ee70[_0x53af('0xd')]||_0x10ee70[_0x53af('0x12')];}else{_0x56c2ed[_0x53af('0xf')]=_0x10ee70[_0x53af('0x13')]&&_0x10ee70[_0x53af('0x13')]!==_0x53af('0x11')?_0x10ee70[_0x53af('0x13')]:_0x10ee70[_0x53af('0x14')]||_0x10ee70[_0x53af('0x12')];_0x56c2ed[_0x53af('0x15')]=_0x10ee70['destcalleridname']&&_0x10ee70[_0x53af('0x13')]!==_0x53af('0x11')?_0x10ee70[_0x53af('0x13')]:_0x10ee70[_0x53af('0x14')]||_0x10ee70[_0x53af('0x12')];}BPromise[_0x53af('0x16')]()[_0x53af('0x17')](cmContactRpc['showContact']({'where':_[_0x53af('0x18')](_0x56c2ed,[_0x53af('0xf')])}))[_0x53af('0x17')](function(_0x8771d1){if(_0x8771d1){_0x10ee70['xmd-contactid2']=_0x8771d1['id'];emit(util['format'](_0x53af('0x19'),_0x56751b[_0x53af('0x1a')]),util[_0x53af('0x1b')]('trigger:%s',_0x52b4d1[_0x53af('0x1c')][_0x53af('0x1d')]()),_[_0x53af('0x1e')](_0x10ee70,{'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa)}));return;}else{return BPromise[_0x53af('0x16')]()[_0x53af('0x17')](cmContactRpc[_0x53af('0x1f')](_0x56c2ed));}})[_0x53af('0x17')](function(_0x5c2763){if(_0x5c2763){_0x10ee70[_0x53af('0x20')]=_0x5c2763['id'];emit(util[_0x53af('0x1b')](_0x53af('0x19'),_0x56751b[_0x53af('0x1a')]),util[_0x53af('0x1b')](_0x53af('0x21'),_0x52b4d1['action'][_0x53af('0x1d')]()),_[_0x53af('0x1e')](_0x10ee70,{'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa)}));}})[_0x53af('0x22')](function(_0x480665){logger[_0x53af('0x23')](_0x53af('0x24'),JSON[_0x53af('0x8')](_0x480665));});}else{if(_0x56751b){emit(util[_0x53af('0x1b')](_0x53af('0x19'),_0x56751b[_0x53af('0x1a')]),util[_0x53af('0x1b')](_0x53af('0x21'),_0x52b4d1['action'][_0x53af('0x1d')]()),_[_0x53af('0x1e')]({'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa)},_0x10ee70));}}}; \ No newline at end of file +var _0x27f3=['data1','calleridnum','isNil','routeId','calleridname','','uniqueid','firstName','destcalleridname','destcalleridnum','phone','resolve','showContact','omit','then','xmd-contactid2','format','user:%s','name','action','toLowerCase','createContact','trigger:%s','catch','error','Error\x20creating\x20contact','merge','bluebird','util','ioredis','../../../../config/environment','trigger','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x27f3,0x1e9));var _0x327f=function(_0x13b330,_0x297092){_0x13b330=_0x13b330-0x0;var _0x1f666c=_0x27f3[_0x13b330];return _0x1f666c;};'use strict';var BPromise=require(_0x327f('0x0'));var util=require(_0x327f('0x1'));var _=require('lodash');var Redis=require(_0x327f('0x2'));var config=require(_0x327f('0x3'));var logger=require('../../../../config/logger')(_0x327f('0x4'));var cmContactRpc=require('../../rpc/cmContact');config[_0x327f('0x5')]=_[_0x327f('0x6')](config[_0x327f('0x5')],{'host':_0x327f('0x7'),'port':0x18eb});var io=require(_0x327f('0x8'))(new Redis(config[_0x327f('0x5')]));function emit(_0x181949,_0x19b8cc,_0x551a98){logger[_0x327f('0x9')](_0x181949,_0x19b8cc,JSON[_0x327f('0xa')](_0x551a98));io['to'](_0x181949)[_0x327f('0xb')](_0x19b8cc,_0x551a98);}exports[_0x327f('0xc')]=function(_0x89473b,_0x18c142,_0x501f8b){_0x501f8b[_0x327f('0xd')]=0x0;if(_0x18c142[_0x327f('0xe')]&&parseInt(_0x18c142[_0x327f('0xe')],0xa)){var _0x3ea1c3={'ListId':parseInt(_0x18c142[_0x327f('0xf')],0xa),'phone':_0x501f8b[_0x327f('0x10')]};if(_[_0x327f('0x11')](_0x501f8b[_0x327f('0x12')])){_0x3ea1c3['firstName']=_0x501f8b[_0x327f('0x13')]&&_0x501f8b[_0x327f('0x13')]!==_0x327f('0x14')?_0x501f8b[_0x327f('0x13')]:_0x501f8b[_0x327f('0x10')]||_0x501f8b[_0x327f('0x15')];}else{_0x3ea1c3[_0x327f('0x16')]=_0x501f8b[_0x327f('0x17')]&&_0x501f8b['destcalleridname']!==''?_0x501f8b[_0x327f('0x17')]:_0x501f8b[_0x327f('0x18')]||_0x501f8b[_0x327f('0x15')];_0x3ea1c3[_0x327f('0x19')]=_0x501f8b[_0x327f('0x17')]&&_0x501f8b[_0x327f('0x17')]!==_0x327f('0x14')?_0x501f8b[_0x327f('0x17')]:_0x501f8b[_0x327f('0x18')]||_0x501f8b[_0x327f('0x15')];}BPromise[_0x327f('0x1a')]()['then'](cmContactRpc[_0x327f('0x1b')]({'where':_[_0x327f('0x1c')](_0x3ea1c3,[_0x327f('0x16')])}))[_0x327f('0x1d')](function(_0x467253){if(_0x467253){_0x501f8b[_0x327f('0x1e')]=_0x467253['id'];emit(util[_0x327f('0x1f')](_0x327f('0x20'),_0x89473b[_0x327f('0x21')]),util[_0x327f('0x1f')]('trigger:%s',_0x18c142[_0x327f('0x22')][_0x327f('0x23')]()),_['merge'](_0x501f8b,{'ListId':parseInt(_0x18c142[_0x327f('0xf')],0xa)}));return;}else{return BPromise[_0x327f('0x1a')]()[_0x327f('0x1d')](cmContactRpc[_0x327f('0x24')](_0x3ea1c3));}})[_0x327f('0x1d')](function(_0x4f347d){if(_0x4f347d){_0x501f8b[_0x327f('0x1e')]=_0x4f347d['id'];emit(util[_0x327f('0x1f')](_0x327f('0x20'),_0x89473b[_0x327f('0x21')]),util[_0x327f('0x1f')](_0x327f('0x25'),_0x18c142[_0x327f('0x22')][_0x327f('0x23')]()),_['merge'](_0x501f8b,{'ListId':parseInt(_0x18c142[_0x327f('0xf')],0xa)}));}})[_0x327f('0x26')](function(_0x222601){logger[_0x327f('0x27')](_0x327f('0x28'),JSON[_0x327f('0xa')](_0x222601));});}else{if(_0x89473b){emit(util[_0x327f('0x1f')]('user:%s',_0x89473b[_0x327f('0x21')]),util[_0x327f('0x1f')](_0x327f('0x25'),_0x18c142['action'][_0x327f('0x23')]()),_[_0x327f('0x29')]({'ListId':parseInt(_0x18c142[_0x327f('0xf')],0xa)},_0x501f8b));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index d8c007b..db5320a 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 _0xe72e=['interaction','event','queue','agent','membername','lastevent','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../rpc/cmContact','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','accounts','freshsalesAccounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:closedinteraction','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','status','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','template\x20not\x20found','uri','data3','data4','location','uriLocation','isNil','data5','800','data6','600','winApplication','winArguments','user:%s','name','format','trigger:%s:%s','jscripty','trigger:%s','exec','routeId','urlforward','script','buildUri','parse','query','replace','checkTrigger','AllConditions','every','checkConditions','AnyConditions','some','channel','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId'];(function(_0x1feb46,_0x49ef84){var _0x263052=function(_0x1a74bb){while(--_0x1a74bb){_0x1feb46['push'](_0x1feb46['shift']());}};_0x263052(++_0x49ef84);}(_0xe72e,0x7a));var _0xee72=function(_0x34deb0,_0x238a01){_0x34deb0=_0x34deb0-0x0;var _0xe65609=_0xe72e[_0x34deb0];return _0xe65609;};'use strict';var util=require('util');var _=require(_0xee72('0x0'));var url=require(_0xee72('0x1'));var Mustache=require(_0xee72('0x2'));var Redis=require(_0xee72('0x3'));var urlforward=require(_0xee72('0x4'));var integration=require(_0xee72('0x5'));var cmContact=require(_0xee72('0x6'));var script=require(_0xee72('0x7'));var cmContactRpc=require(_0xee72('0x8'));var config=require(_0xee72('0x9'));var logger=require(_0xee72('0xa'))('trigger');var ami=require(_0xee72('0xb'));config[_0xee72('0xc')]=_[_0xee72('0xd')](config[_0xee72('0xc')],{'host':_0xee72('0xe'),'port':0x18eb});var io=require(_0xee72('0xf'))(new Redis(config[_0xee72('0xc')]));var operators={'equals':function(_0x3b2337,_0x17b988){return _0x3b2337==_0x17b988;},'not_equals':function(_0xfd280,_0xa03df6){return _0xfd280!=_0xa03df6;}};var barAndWebActions=[_0xee72('0x10'),'url','winapp'];function Trigger(_0x318c75){this[_0xee72('0x11')]=_0x318c75[_0xee72('0x11')];this[_0xee72('0x12')]=_0x318c75['agents'];this['voiceQueues']=_0x318c75[_0xee72('0x13')];this[_0xee72('0x14')]=_0x318c75['templates'];this[_0xee72('0x15')]=_0x318c75[_0xee72('0x15')];this[_0xee72('0x16')]=_0x318c75[_0xee72('0x16')];this[_0xee72('0x17')]=_0x318c75[_0xee72('0x17')];this[_0xee72('0x18')]=_0x318c75[_0xee72('0x18')];this[_0xee72('0x19')]=_0x318c75[_0xee72('0x19')];this['zohoAccounts']=_0x318c75[_0xee72('0x1a')];this[_0xee72('0x1b')]=_0x318c75['deskAccounts'];this[_0xee72('0x1c')]=_0x318c75[_0xee72('0x1c')];this[_0xee72('0x1d')]=_0x318c75[_0xee72('0x1d')];this[_0xee72('0x1e')]=_0x318c75[_0xee72('0x1e')];this['freshsalesAccounts']=_0x318c75['freshsalesAccounts'];this[_0xee72('0x1f')]={'zendesk':this[_0xee72('0x16')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xee72('0x17')],'sugarcrm':this[_0xee72('0x19')],'zoho':this[_0xee72('0x1a')],'desk':this[_0xee72('0x1b')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xee72('0x1e')],'freshsales':this[_0xee72('0x20')],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0xee72('0x21')][_0xee72('0x22')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xee72('0x22')](this));ami['on'](_0xee72('0x23'),this[_0xee72('0x21')][_0xee72('0x22')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0xee72('0x22')](this));ami['on'](_0xee72('0x24'),this['syncCustomEvent']['bind'](this));ami['on'](_0xee72('0x25'),this[_0xee72('0x26')][_0xee72('0x22')](this));ami['on'](_0xee72('0x27'),this['syncAgentDial'][_0xee72('0x22')](this));ami['on'](_0xee72('0x28'),this[_0xee72('0x26')]['bind'](this));ami['on']('custom:newinteraction',this[_0xee72('0x21')][_0xee72('0x22')](this));ami['on'](_0xee72('0x29'),this['syncCustomEvent'][_0xee72('0x22')](this));ami['on']('custom:incomingmessage',this[_0xee72('0x21')][_0xee72('0x22')](this));ami['on'](_0xee72('0x2a'),this['syncCustomEvent'][_0xee72('0x22')](this));ami['on'](_0xee72('0x2b'),this['syncCustomEvent'][_0xee72('0x22')](this));ami['on']('custom:rejectmessage',this['syncCustomEvent']['bind'](this));}Trigger[_0xee72('0x2c')][_0xee72('0x2d')]=function(_0x4b35b1,_0x2b6351,_0x5600cf){logger[_0xee72('0x2e')](_0x4b35b1,_0x2b6351,JSON[_0xee72('0x2f')](_0x5600cf));io['to'](_0x4b35b1)[_0xee72('0x2d')](_0x2b6351,_0x5600cf);};Trigger[_0xee72('0x2c')][_0xee72('0x21')]=function(_0xc2777f){var _0x181372=_[_0xee72('0x30')](_0xc2777f);this[_0xee72('0x31')](_0x181372);};Trigger[_0xee72('0x2c')][_0xee72('0x26')]=function(_0x208363){if(this[_0xee72('0x12')][_0x208363[_0xee72('0x32')]]){this['syncCustomEvent'](_0x208363);}};Trigger[_0xee72('0x2c')]['checkTriggers']=function(_0x2167df){var _0x288631;for(var _0xe50c19 in this[_0xee72('0x11')]){if(this[_0xee72('0x11')]['hasOwnProperty'](_0xe50c19)){if(this[_0xee72('0x11')][_0xe50c19][_0xee72('0x33')]){_0x288631=this['checkTrigger'](this[_0xee72('0x11')][_0xe50c19],_0x2167df);if(_0x288631){_[_0xee72('0x34')](_0x2167df,_0x2167df[_0xee72('0x35')]);for(var _0x3a16fd=0x0,_0x37c8f7,_0x1f32e4,_0x5b6314;_0x3a16fd0x0){_0x4effb1=_['map'](_0x388593,_0x2e91b2);}return _0x4effb1;}function getCustomFields(_0x1688bb,_0x333a40){var _0x550040=[];var _0x2768f1={'custom_fields':{}};if(_0x1688bb[_0x4d4f('0x27')]>0x0){_[_0x4d4f('0x28')](_0x1688bb,function(_0x3d7f14){if(_0x3d7f14[_0x4d4f('0x29')]===_0x4d4f('0x2a')&&_0x3d7f14['nameField']&&!_0x3d7f14[_0x4d4f('0x2b')]){_0x2768f1[_0x3d7f14[_0x4d4f('0x2c')][_0x4d4f('0x2d')]()]=_0x3d7f14[_0x4d4f('0x2e')][_0x4d4f('0x1f')]();}else if(_0x3d7f14['type']===_0x4d4f('0x2a')&&_0x3d7f14['idField']&&_0x3d7f14[_0x4d4f('0x2b')]){_0x2768f1['custom_fields'][_0x3d7f14['idField']]=_0x3d7f14['content'][_0x4d4f('0x1f')]();}else if(_0x3d7f14['type']===_0x4d4f('0x2f')&&_0x3d7f14[_0x4d4f('0x30')]&&_0x3d7f14[_0x4d4f('0x31')]&&_0x3d7f14['customField']){_0x333a40[_0x3d7f14[_0x4d4f('0x30')]]&&(_0x2768f1[_0x4d4f('0x32')][_0x3d7f14[_0x4d4f('0x31')]]=_0x333a40[_0x3d7f14['variableName']][_0x4d4f('0x1f')]());}else if(_0x3d7f14['type']===_0x4d4f('0x33')&&_0x3d7f14[_0x4d4f('0x34')]&&_0x3d7f14[_0x4d4f('0x34')][_0x4d4f('0x35')]&&_0x3d7f14[_0x4d4f('0x31')]&&_0x3d7f14[_0x4d4f('0x2b')]){_0x333a40[_0x3d7f14[_0x4d4f('0x34')][_0x4d4f('0x35')]['toLowerCase']()]&&(_0x2768f1['custom_fields'][_0x3d7f14[_0x4d4f('0x31')]]=_0x333a40[_0x3d7f14['Variable']['name'][_0x4d4f('0x2d')]()][_0x4d4f('0x1f')]());}});}if(_0x2768f1[_0x4d4f('0x36')]){_0x2768f1[_0x4d4f('0x36')]=Number(_0x2768f1[_0x4d4f('0x36')]);}return _0x2768f1;}function getTicket(_0x56eed8,_0x12c512,_0x27466f,_0x5cc3e7,_0x32af9a){logger[_0x4d4f('0xe')](_0x4d4f('0x37'));var _0x42f9ed=_[_0x4d4f('0x38')]({'subject':intUtil[_0x4d4f('0x39')](_0x5cc3e7[_0x4d4f('0x3a')],_0x32af9a,'\x20'),'type':_0x4d4f('0x3b'),'status':_0x4d4f('0x3c'),'labels':['xCALLY','Motion',_0x4d4f('0x3d')][_0x4d4f('0x3e')](getTags(_0x5cc3e7[_0x4d4f('0x3f')],_0x4d4f('0x35'))),'description':intUtil['getString'](_0x5cc3e7['Descriptions'],_0x32af9a,'\x0a'),'_links':{'assigned_user':{'href':util[_0x4d4f('0x10')](_0x4d4f('0x40'),_0x12c512['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x5cc3e7[_0x4d4f('0x41')],_0x32af9a,'\x0a')}},getCustomFields(_0x5cc3e7[_0x4d4f('0x42')],_0x32af9a));return request({'uri':util['format'](_0x4d4f('0x43'),_0x56eed8[_0x4d4f('0x12')],_0x27466f['id']),'method':_0x4d4f('0x25'),'body':_0x42f9ed});}exports[_0x4d4f('0x44')]=function(_0x2cc703,_0x587e6e,_0x2b274e,_0x4c7c24,_0x45a0c1,_0x5e4839){var _0x5677c5,_0x14a8f5;_0x5e4839[_0x4d4f('0x12')]=intUtil[_0x4d4f('0x45')](_0x5e4839['remoteUri']);_0x5e4839[_0x4d4f('0x46')]=intUtil['stripTrailingSlash'](_0x5e4839[_0x4d4f('0x46')]);if(_0x45a0c1&&_0x45a0c1['monitor_format']){logger[_0x4d4f('0xe')](_0x4d4f('0x47'),_0x4d4f('0x48'));_0x587e6e[_0x4d4f('0x49')]=util[_0x4d4f('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e4839['serverUrl'],_0x587e6e[_0x4d4f('0x4a')],md5(_0x587e6e[_0x4d4f('0x4a')]));}else{_0x587e6e[_0x4d4f('0x49')]='';}headers[_0x4d4f('0x4b')]=getAuth(_0x5e4839);return getUser(_0x5e4839,_0x4c7c24['email'])['then'](function(_0x59b4a2){_0x5677c5=_0x59b4a2;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x5677c5['id']);return getEndUser(_0x5e4839,_0x587e6e[_0x4d4f('0x4d')],_0x587e6e[_0x4d4f('0x4e')]);})[_0x4d4f('0x13')](function(_0x29cb5d){_0x14a8f5=_0x29cb5d;logger[_0x4d4f('0xe')](_0x4d4f('0x4f'),_0x14a8f5['id']);return getTicket(_0x5e4839,_0x5677c5,_0x14a8f5,_0x2b274e,_0x587e6e);})[_0x4d4f('0x13')](function(_0x31d576){if(_0x31d576){logger[_0x4d4f('0xe')](_0x4d4f('0x50'));logger['info'](_0x4d4f('0x51'),_0x31d576['id']);switch(_0x5e4839[_0x4d4f('0x29')]){case'integrationTab':logger[_0x4d4f('0xe')]('[QUEUE]',_0x4d4f('0x52'));emit(util[_0x4d4f('0x10')]('user:%s',_0x4c7c24[_0x4d4f('0x35')]),_0x4d4f('0x53'),{'recordId':_0x31d576['id']});break;case _0x4d4f('0x54'):logger[_0x4d4f('0xe')](_0x4d4f('0x47'),_0x4d4f('0x55'));emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x4c7c24[_0x4d4f('0x35')]),_0x4d4f('0x57'),{'uri':util[_0x4d4f('0x10')](_0x4d4f('0x58'),_0x31d576['id'])});break;default:logger['error'](_0x4d4f('0x47'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x57af44){console[_0x4d4f('0x59')](_0x57af44);logger[_0x4d4f('0x59')]('[QUEUE]',JSON['stringify'](_0x57af44));});};exports[_0x4d4f('0x5a')]=function(_0x4c80c4,_0x5adc7b,_0x3191b1,_0x528573,_0x17b59e,_0x3626e6,_0x54c8b7){var _0x2c29e0,_0x58b743;_0x3626e6[_0x4d4f('0x12')]=intUtil[_0x4d4f('0x45')](_0x3626e6[_0x4d4f('0x12')]);_0x3626e6[_0x4d4f('0x46')]=intUtil[_0x4d4f('0x45')](_0x3626e6['serverUrl']);if(_0x54c8b7&&_0x54c8b7[_0x4d4f('0x5b')]&&_0x54c8b7['recordingFormat']!==_0x4d4f('0x5c')){logger['info'](_0x4d4f('0x5d'),_0x4d4f('0x48'));_0x5adc7b['recordingURL']=util[_0x4d4f('0x10')](_0x4d4f('0x5e'),_0x3626e6['serverUrl'],_0x5adc7b[_0x4d4f('0x4a')],md5(_0x5adc7b['uniqueid']));}headers[_0x4d4f('0x4b')]=getAuth(_0x3626e6);return getUser(_0x3626e6,_0x528573['email'])['then'](function(_0x151745){_0x2c29e0=_0x151745;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x2c29e0['id']);return getEndUser(_0x3626e6,_0x5adc7b[_0x4d4f('0x5f')],_0x5adc7b[_0x4d4f('0x60')]);})['then'](function(_0x4aff5e){_0x58b743=_0x4aff5e;logger[_0x4d4f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x58b743['id']);return getTicket(_0x3626e6,_0x2c29e0,_0x58b743,_0x3191b1,_0x5adc7b);})[_0x4d4f('0x13')](function(_0xadc9ac){if(_0xadc9ac){logger[_0x4d4f('0xe')](_0x4d4f('0x50'));logger[_0x4d4f('0xe')](_0x4d4f('0x51'),_0xadc9ac['id']);switch(_0x3626e6['type']){case _0x4d4f('0x61'):logger[_0x4d4f('0xe')](_0x4d4f('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x528573[_0x4d4f('0x35')]),'trigger:desk:display',{'recordId':_0xadc9ac['id']});break;case _0x4d4f('0x54'):logger['info'](_0x4d4f('0x47'),_0x4d4f('0x55'));emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x528573[_0x4d4f('0x35')]),_0x4d4f('0x57'),{'uri':util[_0x4d4f('0x10')](_0x4d4f('0x62'),_0x3626e6[_0x4d4f('0x12')],_0xadc9ac['id'])});break;default:logger['error'](_0x4d4f('0x5d'),_0x4d4f('0x63'));}}})['catch'](function(_0x1bd4b1){logger[_0x4d4f('0x59')](_0x4d4f('0x5d'),JSON[_0x4d4f('0x19')](_0x1bd4b1));});};exports['abandoned']=function(_0x4013a9,_0xb2a9e6,_0x5995f2,_0x4d979a,_0x55552d,_0x2defe0){var _0x53b2db,_0x4b9b15;_0x2defe0['remoteUri']=intUtil[_0x4d4f('0x45')](_0x2defe0[_0x4d4f('0x12')]);_0x2defe0['serverUrl']=intUtil[_0x4d4f('0x45')](_0x2defe0[_0x4d4f('0x46')]);if(_0x55552d&&_0x55552d[_0x4d4f('0x64')]){logger[_0x4d4f('0xe')](_0x4d4f('0x65'),_0x4d4f('0x48'));_0xb2a9e6[_0x4d4f('0x49')]=util[_0x4d4f('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2defe0[_0x4d4f('0x46')],_0xb2a9e6['uniqueid'],md5(_0xb2a9e6[_0x4d4f('0x4a')]));}else{_0xb2a9e6[_0x4d4f('0x49')]='';}headers[_0x4d4f('0x4b')]=getAuth(_0x2defe0);return getUser(_0x2defe0)['then'](function(_0x5a6a40){_0x53b2db=_0x5a6a40;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x53b2db['id']);return getEndUser(_0x2defe0,_0xb2a9e6[_0x4d4f('0x4d')],_0xb2a9e6['calleridnum']);})[_0x4d4f('0x13')](function(_0x4bf7bd){_0x4b9b15=_0x4bf7bd;logger[_0x4d4f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4b9b15['id']);return getTicket(_0x2defe0,_0x53b2db,_0x4b9b15,_0x5995f2,_0xb2a9e6);})['then'](function(_0x194874){if(_0x194874){logger[_0x4d4f('0xe')]('Ticket\x20created!');logger[_0x4d4f('0xe')]('The\x20Ticket\x20ID\x20is:',_0x194874['id']);}})[_0x4d4f('0x66')](function(_0x4420f0){logger[_0x4d4f('0x59')](_0x4d4f('0x65'),JSON['stringify'](_0x4420f0));});}; \ No newline at end of file +var _0x6a95=['toString','idField','customField','custom_fields','variable','variableName','Variable','name','priority','Creating\x20new\x20ticket...','getString','Subjects','xCALLY','Motion','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','catch','outbound','recordingFormat','none','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]','stringify','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/users/me','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','map','type','string','nameField','toLowerCase','content'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0x6a95,0x1db));var _0x56a9=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x6a95[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x56a9('0x0'));var rp=require(_0x56a9('0x1'));var md5=require(_0x56a9('0x2'));var util=require(_0x56a9('0x3'));var Redis=require(_0x56a9('0x4'));var intUtil=require(_0x56a9('0x5'));var config=require(_0x56a9('0x6'));var logger=require('../../../../config/logger')('desk');config[_0x56a9('0x7')]=_[_0x56a9('0x8')](config[_0x56a9('0x7')],{'host':_0x56a9('0x9'),'port':0x18eb});var io=require(_0x56a9('0xa'))(new Redis(config[_0x56a9('0x7')]));function emit(_0xd8aa7c,_0x5d3e80,_0x5f0dcb){io['to'](_0xd8aa7c)[_0x56a9('0xb')](_0x5d3e80,_0x5f0dcb);}var headers={'Content-Type':_0x56a9('0xc'),'Accept':'application/json'};function getUser(_0xe4b98c,_0x1eddfd){if(intUtil[_0x56a9('0xd')](_0x1eddfd)===!![]){logger[_0x56a9('0xe')](_0x56a9('0xf'),_0x1eddfd);return request({'uri':util[_0x56a9('0x10')](_0x56a9('0x11'),_0xe4b98c[_0x56a9('0x12')])})[_0x56a9('0x13')](function(_0x4c0a01){if(_0x4c0a01[_0x56a9('0x14')]){return _['find'](_0x4c0a01[_0x56a9('0x15')][_0x56a9('0x16')],{'email':_0x1eddfd});}})[_0x56a9('0x13')](function(_0x2707a2){if(_0x2707a2){logger[_0x56a9('0xe')](_0x56a9('0x17'));return _0x2707a2;}else{logger[_0x56a9('0xe')](_0x56a9('0x18'));return request({'uri':util[_0x56a9('0x10')]('%s/users/me',_0xe4b98c['remoteUri'])});}});}else{logger[_0x56a9('0xe')](_0x56a9('0x19'));return request({'uri':util[_0x56a9('0x10')](_0x56a9('0x1a'),_0xe4b98c['remoteUri'])});}}function request(_0x414cb5){logger['debug']('[HTTP]',JSON['stringify'](_0x414cb5));return rp(_[_0x56a9('0x8')](_0x414cb5,{'method':_0x56a9('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x59c0ec){var _0x105fe5;if(_0x59c0ec[_0x56a9('0x1c')]===_0x56a9('0x1d')){_0x105fe5=util[_0x56a9('0x10')](_0x56a9('0x1e'),_0x59c0ec[_0x56a9('0x1f')],_0x59c0ec[_0x56a9('0x20')]);}else if(_0x59c0ec[_0x56a9('0x1c')]===_0x56a9('0x21')){_0x105fe5=util['format']('%s/token:%s',_0x59c0ec[_0x56a9('0x1f')],_0x59c0ec[_0x56a9('0x21')]);}return util[_0x56a9('0x10')](_0x56a9('0x22'),new Buffer(_0x105fe5)['toString'](_0x56a9('0x23')));}function getEndUser(_0x3355c4,_0x4036e5,_0x3e00d2){logger['info'](_0x56a9('0x24'),_0x3e00d2);return request({'uri':util[_0x56a9('0x10')](_0x56a9('0x25'),_0x3355c4[_0x56a9('0x12')]),'qs':{'phone':_0x3e00d2}})[_0x56a9('0x13')](function(_0x52016c){if(_0x52016c[_0x56a9('0x14')]){logger[_0x56a9('0xe')](_0x56a9('0x26'));return _0x52016c['_embedded'][_0x56a9('0x16')][0x0];}else{logger['info'](_0x56a9('0x27'));return request({'uri':util[_0x56a9('0x10')](_0x56a9('0x28'),_0x3355c4[_0x56a9('0x12')]),'method':_0x56a9('0x29'),'body':{'first_name':_0x4036e5,'title':_0x4036e5,'phone_numbers':[{'type':_0x56a9('0x2a'),'value':_0x3e00d2}]}});}});}function getTags(_0x1133e6,_0xff5f55){var _0x51fd64=[];if(_0x1133e6&&_0x1133e6[_0x56a9('0x2b')]>0x0){_0x51fd64=_[_0x56a9('0x2c')](_0x1133e6,_0xff5f55);}return _0x51fd64;}function getCustomFields(_0x5f23e1,_0x4441ce){var _0x4f9be1=[];var _0x54a343={'custom_fields':{}};if(_0x5f23e1[_0x56a9('0x2b')]>0x0){_['forEach'](_0x5f23e1,function(_0x2f933a){if(_0x2f933a[_0x56a9('0x2d')]===_0x56a9('0x2e')&&_0x2f933a[_0x56a9('0x2f')]&&!_0x2f933a['customField']){_0x54a343[_0x2f933a[_0x56a9('0x2f')][_0x56a9('0x30')]()]=_0x2f933a[_0x56a9('0x31')][_0x56a9('0x32')]();}else if(_0x2f933a[_0x56a9('0x2d')]===_0x56a9('0x2e')&&_0x2f933a[_0x56a9('0x33')]&&_0x2f933a[_0x56a9('0x34')]){_0x54a343[_0x56a9('0x35')][_0x2f933a[_0x56a9('0x33')]]=_0x2f933a[_0x56a9('0x31')][_0x56a9('0x32')]();}else if(_0x2f933a['type']===_0x56a9('0x36')&&_0x2f933a[_0x56a9('0x37')]&&_0x2f933a[_0x56a9('0x33')]&&_0x2f933a['customField']){_0x4441ce[_0x2f933a[_0x56a9('0x37')]]&&(_0x54a343['custom_fields'][_0x2f933a['idField']]=_0x4441ce[_0x2f933a['variableName']][_0x56a9('0x32')]());}else if(_0x2f933a[_0x56a9('0x2d')]==='customVariable'&&_0x2f933a['Variable']&&_0x2f933a[_0x56a9('0x38')][_0x56a9('0x39')]&&_0x2f933a[_0x56a9('0x33')]&&_0x2f933a[_0x56a9('0x34')]){_0x4441ce[_0x2f933a[_0x56a9('0x38')][_0x56a9('0x39')][_0x56a9('0x30')]()]&&(_0x54a343[_0x56a9('0x35')][_0x2f933a[_0x56a9('0x33')]]=_0x4441ce[_0x2f933a[_0x56a9('0x38')]['name']['toLowerCase']()]['toString']());}});}if(_0x54a343['priority']){_0x54a343[_0x56a9('0x3a')]=Number(_0x54a343[_0x56a9('0x3a')]);}return _0x54a343;}function getTicket(_0x55b295,_0x2f623f,_0xfcacfe,_0x2a0627,_0x202ebc){logger[_0x56a9('0xe')](_0x56a9('0x3b'));var _0x255fb6=_['merge']({'subject':intUtil[_0x56a9('0x3c')](_0x2a0627[_0x56a9('0x3d')],_0x202ebc,'\x20'),'type':'phone','status':'new','labels':[_0x56a9('0x3e'),_0x56a9('0x3f'),_0x56a9('0x40')][_0x56a9('0x41')](getTags(_0x2a0627[_0x56a9('0x42')],_0x56a9('0x39'))),'description':intUtil[_0x56a9('0x3c')](_0x2a0627[_0x56a9('0x43')],_0x202ebc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x56a9('0x10')](_0x56a9('0x44'),_0x2f623f['id']),'class':_0x56a9('0x45')}},'message':{'direction':'in','body':intUtil[_0x56a9('0x3c')](_0x2a0627[_0x56a9('0x43')],_0x202ebc,'\x0a')}},getCustomFields(_0x2a0627[_0x56a9('0x46')],_0x202ebc));return request({'uri':util[_0x56a9('0x10')](_0x56a9('0x47'),_0x55b295[_0x56a9('0x12')],_0xfcacfe['id']),'method':_0x56a9('0x29'),'body':_0x255fb6});}exports['queue']=function(_0x2ee73f,_0x43acf6,_0xfc1800,_0x5ce001,_0x1f8b30,_0x4d52af){var _0x316c43,_0x54ddf4;_0x4d52af[_0x56a9('0x12')]=intUtil[_0x56a9('0x48')](_0x4d52af[_0x56a9('0x12')]);_0x4d52af[_0x56a9('0x49')]=intUtil['stripTrailingSlash'](_0x4d52af['serverUrl']);if(_0x1f8b30&&_0x1f8b30['monitor_format']){logger[_0x56a9('0xe')](_0x56a9('0x4a'),_0x56a9('0x4b'));_0x43acf6[_0x56a9('0x4c')]=util[_0x56a9('0x10')](_0x56a9('0x4d'),_0x4d52af[_0x56a9('0x49')],_0x43acf6[_0x56a9('0x4e')],md5(_0x43acf6[_0x56a9('0x4e')]));}else{_0x43acf6[_0x56a9('0x4c')]='';}headers[_0x56a9('0x4f')]=getAuth(_0x4d52af);return getUser(_0x4d52af,_0x5ce001[_0x56a9('0x50')])[_0x56a9('0x13')](function(_0x3eae47){_0x316c43=_0x3eae47;logger['info'](_0x56a9('0x51'),_0x316c43['id']);return getEndUser(_0x4d52af,_0x43acf6[_0x56a9('0x52')],_0x43acf6[_0x56a9('0x53')]);})['then'](function(_0x468ab5){_0x54ddf4=_0x468ab5;logger[_0x56a9('0xe')]('The\x20Enduser\x20ID\x20is:',_0x54ddf4['id']);return getTicket(_0x4d52af,_0x316c43,_0x54ddf4,_0xfc1800,_0x43acf6);})[_0x56a9('0x13')](function(_0x34ee3e){if(_0x34ee3e){logger[_0x56a9('0xe')](_0x56a9('0x54'));logger['info'](_0x56a9('0x55'),_0x34ee3e['id']);switch(_0x4d52af[_0x56a9('0x2d')]){case _0x56a9('0x56'):logger[_0x56a9('0xe')](_0x56a9('0x4a'),_0x56a9('0x57'));emit(util[_0x56a9('0x10')](_0x56a9('0x58'),_0x5ce001[_0x56a9('0x39')]),_0x56a9('0x59'),{'recordId':_0x34ee3e['id']});break;case _0x56a9('0x5a'):logger['info']('[QUEUE]',_0x56a9('0x5b'));emit(util[_0x56a9('0x10')](_0x56a9('0x58'),_0x5ce001[_0x56a9('0x39')]),'trigger:browser:url',{'uri':util[_0x56a9('0x10')](_0x56a9('0x5c'),_0x34ee3e['id'])});break;default:logger[_0x56a9('0x5d')](_0x56a9('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x56a9('0x5e')](function(_0x1f905b){console['error'](_0x1f905b);logger[_0x56a9('0x5d')](_0x56a9('0x4a'),JSON['stringify'](_0x1f905b));});};exports[_0x56a9('0x5f')]=function(_0x338140,_0x230b53,_0x1176cc,_0x505690,_0x4938d6,_0x249294,_0x1bbfa3){var _0x3a165b,_0x124cd9;_0x249294[_0x56a9('0x12')]=intUtil[_0x56a9('0x48')](_0x249294[_0x56a9('0x12')]);_0x249294[_0x56a9('0x49')]=intUtil[_0x56a9('0x48')](_0x249294[_0x56a9('0x49')]);if(_0x1bbfa3&&_0x1bbfa3['recordingFormat']&&_0x1bbfa3[_0x56a9('0x60')]!==_0x56a9('0x61')){logger[_0x56a9('0xe')](_0x56a9('0x62'),_0x56a9('0x4b'));_0x230b53[_0x56a9('0x4c')]=util[_0x56a9('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x249294[_0x56a9('0x49')],_0x230b53[_0x56a9('0x4e')],md5(_0x230b53[_0x56a9('0x4e')]));}headers[_0x56a9('0x4f')]=getAuth(_0x249294);return getUser(_0x249294,_0x505690[_0x56a9('0x50')])[_0x56a9('0x13')](function(_0x986480){_0x3a165b=_0x986480;logger['info'](_0x56a9('0x51'),_0x3a165b['id']);return getEndUser(_0x249294,_0x230b53['destcalleridname'],_0x230b53['destcalleridnum']);})[_0x56a9('0x13')](function(_0x5eba1f){_0x124cd9=_0x5eba1f;logger[_0x56a9('0xe')](_0x56a9('0x63'),_0x124cd9['id']);return getTicket(_0x249294,_0x3a165b,_0x124cd9,_0x1176cc,_0x230b53);})[_0x56a9('0x13')](function(_0xfcc413){if(_0xfcc413){logger[_0x56a9('0xe')](_0x56a9('0x54'));logger[_0x56a9('0xe')](_0x56a9('0x55'),_0xfcc413['id']);switch(_0x249294[_0x56a9('0x2d')]){case'integrationTab':logger[_0x56a9('0xe')](_0x56a9('0x4a'),_0x56a9('0x57'));emit(util[_0x56a9('0x10')](_0x56a9('0x58'),_0x505690[_0x56a9('0x39')]),_0x56a9('0x59'),{'recordId':_0xfcc413['id']});break;case _0x56a9('0x5a'):logger[_0x56a9('0xe')](_0x56a9('0x4a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x56a9('0x10')](_0x56a9('0x58'),_0x505690[_0x56a9('0x39')]),'trigger:browser:url',{'uri':util[_0x56a9('0x10')](_0x56a9('0x64'),_0x249294[_0x56a9('0x12')],_0xfcc413['id'])});break;default:logger['error']('[OUTBOUND]',_0x56a9('0x65'));}}})[_0x56a9('0x5e')](function(_0x302aa0){logger[_0x56a9('0x5d')](_0x56a9('0x62'),JSON['stringify'](_0x302aa0));});};exports[_0x56a9('0x66')]=function(_0x52bc63,_0x352f1c,_0x1cffdc,_0x2fb33b,_0x23ed84,_0x4b2afd){var _0x5edf65,_0x5320b9;_0x4b2afd['remoteUri']=intUtil[_0x56a9('0x48')](_0x4b2afd[_0x56a9('0x12')]);_0x4b2afd[_0x56a9('0x49')]=intUtil['stripTrailingSlash'](_0x4b2afd[_0x56a9('0x49')]);if(_0x23ed84&&_0x23ed84['monitor_format']){logger[_0x56a9('0xe')](_0x56a9('0x67'),_0x56a9('0x4b'));_0x352f1c['recordingURL']=util['format'](_0x56a9('0x4d'),_0x4b2afd[_0x56a9('0x49')],_0x352f1c[_0x56a9('0x4e')],md5(_0x352f1c[_0x56a9('0x4e')]));}else{_0x352f1c[_0x56a9('0x4c')]='';}headers[_0x56a9('0x4f')]=getAuth(_0x4b2afd);return getUser(_0x4b2afd)['then'](function(_0x1e6623){_0x5edf65=_0x1e6623;logger[_0x56a9('0xe')](_0x56a9('0x51'),_0x5edf65['id']);return getEndUser(_0x4b2afd,_0x352f1c['calleridname'],_0x352f1c['calleridnum']);})['then'](function(_0x57001c){_0x5320b9=_0x57001c;logger[_0x56a9('0xe')](_0x56a9('0x63'),_0x5320b9['id']);return getTicket(_0x4b2afd,_0x5edf65,_0x5320b9,_0x1cffdc,_0x352f1c);})['then'](function(_0xfef3a0){if(_0xfef3a0){logger[_0x56a9('0xe')](_0x56a9('0x54'));logger[_0x56a9('0xe')]('The\x20Ticket\x20ID\x20is:',_0xfef3a0['id']);}})[_0x56a9('0x5e')](function(_0x398a63){logger[_0x56a9('0x5d')](_0x56a9('0x67'),JSON[_0x56a9('0x68')](_0x398a63));});}; \ 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 2418e2b..30082d2 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 _0x9ed0=['trigger:browser:url','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','util','./util','md5','../../../../config/logger','../../../../config/environment','redis','POST','remoteUri','username','password','then','catch','toUpperCase',']\x20Wrong\x20credentials!','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','userId','message','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','GET','contacts?$select=telephone1','toLowerCase','calleridnum','telephone1','enduserId','contactid',']\x20Enduser\x20Created!','string','nameField','customField','idField','substring','indexOf','incidents','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','assign','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit'];(function(_0x34e7ed,_0x4f42e1){var _0x3e5f29=function(_0x495dde){while(--_0x495dde){_0x34e7ed['push'](_0x34e7ed['shift']());}};_0x3e5f29(++_0x4f42e1);}(_0x9ed0,0x74));var _0x09ed=function(_0x915426,_0x1a0a05){_0x915426=_0x915426-0x0;var _0x1ab376=_0x9ed0[_0x915426];return _0x1ab376;};'use strict';var _=require(_0x09ed('0x0'));var BPromise=require(_0x09ed('0x1'));var rp=require('request-promise');var util=require(_0x09ed('0x2'));var intUtil=require(_0x09ed('0x3'));var md5=require(_0x09ed('0x4'));var Redis=require('ioredis');var logger=require(_0x09ed('0x5'))('dynamics365');var config=require(_0x09ed('0x6'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x09ed('0x7')]));function getAuthToken(_0xde00d6,_0x13118b,_0x3b6a24){var _0x16ac2b={'method':_0x09ed('0x8'),'uri':_0x13118b,'form':{'client_id':_0xde00d6['clientId'],'resource':_0xde00d6[_0x09ed('0x9')],'username':_0xde00d6[_0x09ed('0xa')],'password':_0xde00d6['password'],'grant_type':_0x09ed('0xb'),'client_secret':_0xde00d6['clientSecret']},'json':!![]};return rp(_0x16ac2b)[_0x09ed('0xc')](function(_0x541516){return _0x541516['access_token'];})[_0x09ed('0xd')](function(_0x4a6436){logger['error']('['+[_0x3b6a24[_0x09ed('0xe')]()]+_0x09ed('0xf'));return _0x4a6436['message'];});}function getUser(_0x7d2749,_0x383476,_0x113f67,_0x1d4e7e,_0x4fe048,_0x357396){return new BPromise(function(_0x2a5449,_0x30f603){return getAuthToken(_0x383476,_0x1d4e7e,_0x357396)['then'](function(_0xc2c9a8){var _0x3a3e93={'method':'GET','uri':_0x4fe048+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x09ed('0x10')+_0xc2c9a8,'OData-Version':_0x09ed('0x11')},'json':!![]};return rp(_0x3a3e93);})[_0x09ed('0xc')](function(_0x435f92){var _0x1c0af6=_0x435f92[_0x09ed('0x12')];var _0x158e13=![];var _0x984820=null;if(!_[_0x09ed('0x13')](_0x113f67)){if(intUtil['validateEmail'](_0x113f67[_0x09ed('0x14')])){_0x7d2749['userEmail']=_0x113f67['email'];for(_0x984820=0x0;_0x984820<_0x1c0af6[_0x09ed('0x15')];_0x984820++){if(_0x1c0af6[_0x984820][_0x09ed('0x16')]===_0x113f67[_0x09ed('0x14')]&&!_0x1c0af6[_0x984820][_0x09ed('0x17')]){_0x158e13=!![];logger[_0x09ed('0x18')]('['+[_0x357396[_0x09ed('0xe')]()]+_0x09ed('0x19')+_0x1c0af6[_0x984820][_0x09ed('0x1a')]+'!');_0x7d2749['userId']=_0x1c0af6[_0x984820][_0x09ed('0x1a')];}}}}if(!_0x158e13){logger[_0x09ed('0x18')]('['+[_0x357396[_0x09ed('0xe')]()]+_0x09ed('0x1b'));_0x7d2749[_0x09ed('0x1c')]=_0x383476['username'];for(_0x984820=0x0;_0x984820<_0x1c0af6[_0x09ed('0x15')];_0x984820++){if(_0x1c0af6[_0x984820]['internalemailaddress']===_0x383476[_0x09ed('0xa')]){_0x7d2749[_0x09ed('0x1d')]=_0x1c0af6[_0x984820][_0x09ed('0x1a')];}}}_0x2a5449(_0x7d2749);})[_0x09ed('0xd')](function(_0x45aa2b){_0x30f603(_0x45aa2b[_0x09ed('0x1e')]);});});}function createEndUser(_0x1f7e52,_0x158778,_0x1f3938,_0x4b9bbe,_0x37cb0c,_0xc8d369){return new BPromise(function(_0x4446b9,_0x20ec79){return getAuthToken(_0x158778,_0x1f3938,_0xc8d369)[_0x09ed('0xc')](function(_0x1de117){var _0x58edab=_0xc8d369['toLowerCase']()===_0x09ed('0x1f')?_0x37cb0c[_0x09ed('0x20')]:_0x37cb0c['calleridnum'];var _0x344e01={'method':_0x09ed('0x8'),'uri':_0x4b9bbe+_0x09ed('0x21'),'body':{'telephone1':_0x58edab,'fullname':_0x58edab,'firstname':_0x58edab,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x09ed('0x22')+_0x1f7e52[_0x09ed('0x1d')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x1de117,'OData-Version':_0x09ed('0x11')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x344e01);})[_0x09ed('0xc')](function(_0x17b53d){var _0x46d55c=_0x17b53d[_0x09ed('0x23')][_0x09ed('0x24')];var _0x5210d3=_0x46d55c['substring'](_0x46d55c[_0x09ed('0x25')]('(')+0x1,_0x46d55c[_0x09ed('0x25')](')'));_0x1f7e52['enduserId']=_0x5210d3;_0x4446b9(_0x1f7e52);})[_0x09ed('0xd')](function(_0x37aa42){_0x20ec79(_0x37aa42[_0x09ed('0x1e')]);});});}function getEndUser(_0x307efc,_0x5eda1e,_0x4994f1,_0x1401f7,_0x205876,_0x420f93){return new BPromise(function(_0x587321,_0x33f6ca){return getAuthToken(_0x5eda1e,_0x4994f1,_0x420f93)[_0x09ed('0xc')](function(_0x307928){var _0x4ad5d1={'method':_0x09ed('0x26'),'uri':_0x1401f7+_0x09ed('0x27'),'headers':{'Authorization':'Bearer\x20'+_0x307928,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4ad5d1);})[_0x09ed('0xc')](function(_0x5b8db0){var _0x18d643=null;if(_0x5b8db0){var _0x251f93=_0x5b8db0[_0x09ed('0x12')];var _0x4ff86f=![];for(_0x18d643=0x0;_0x18d643<_0x251f93['length'];_0x18d643++){var _0x35047a=_0x420f93[_0x09ed('0x28')]()===_0x09ed('0x1f')?_0x205876['destcalleridnum']:_0x205876[_0x09ed('0x29')];if(_0x251f93[_0x18d643][_0x09ed('0x2a')]===_0x35047a){_0x4ff86f=!![];_0x307efc[_0x09ed('0x2b')]=_0x251f93[_0x18d643][_0x09ed('0x2c')];}}if(_0x4ff86f){_0x587321(_0x307efc);}else{return createEndUser(_0x307efc,_0x5eda1e,_0x4994f1,_0x1401f7,_0x205876,_0x420f93)['then'](function(_0x8690c0){logger[_0x09ed('0x18')]('['+[_0x420f93[_0x09ed('0xe')]()]+']\x20Enduser\x20created!',_0x8690c0[_0x09ed('0x2b')]);_0x587321(_0x8690c0);});}}else{return createEndUser(_0x307efc,_0x5eda1e,_0x4994f1,_0x1401f7,_0x205876,_0x420f93)[_0x09ed('0xc')](function(_0x2a3868){logger[_0x09ed('0x18')]('['+[_0x420f93[_0x09ed('0xe')]()]+_0x09ed('0x2d'),_0x2a3868[_0x09ed('0x2b')]);_0x587321(_0x2a3868);});}});});}function getCustomFields(_0x355cb4,_0x55e24f,_0x3da06a){var _0xe7562d={};if(_0x355cb4['length']>0x0){_['forEach'](_0x355cb4,function(_0x1ab683){if(_0x1ab683['type']===_0x09ed('0x2e')&&_0x1ab683[_0x09ed('0x2f')]&&!_0x1ab683[_0x09ed('0x30')]){var _0x3ef5fe=_0x1ab683[_0x09ed('0x31')]['toLowerCase']();var _0x51ac0f=_0x3ef5fe[_0x09ed('0x32')](0x0,_0x3ef5fe['indexOf']('_'));var _0x4dcaa4=_0x3ef5fe[_0x09ed('0x32')](_0x3ef5fe[_0x09ed('0x33')]('_')+0x1);if(_0x51ac0f===_0x3da06a){_0xe7562d[_0x4dcaa4]=_0x1ab683['content'];}}});}return _0xe7562d;}function getTicket(_0x253b2f,_0x3a71b1,_0x4ae9c0,_0x30e966,_0x4de1f1,_0x232fa0,_0x4ad8e7){return new BPromise(function(_0x50ccef,_0x3460eb){var _0x1479de;return getAuthToken(_0x3a71b1,_0x4ae9c0,_0x4ad8e7)[_0x09ed('0xc')](function(_0x4edd91){if(_0x232fa0['ticketType']==='incident'){_0x1479de={'method':'POST','uri':_0x30e966+_0x09ed('0x34'),'body':Object['assign']({},{'title':intUtil[_0x09ed('0x35')](_0x232fa0[_0x09ed('0x36')],_0x4de1f1,'\x20'),'description':intUtil['getString'](_0x232fa0[_0x09ed('0x37')],_0x4de1f1,'\x0a'),'customerid_contact@odata.bind':_0x09ed('0x38')+_0x253b2f[_0x09ed('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0x253b2f[_0x09ed('0x1d')]+')','caseorigincode':'1'},getCustomFields(_0x232fa0[_0x09ed('0x39')],_0x4de1f1,_0x232fa0[_0x09ed('0x3a')])),'headers':{'Authorization':_0x09ed('0x10')+_0x4edd91,'OData-Version':_0x09ed('0x11')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x232fa0[_0x09ed('0x3a')]===_0x09ed('0x3b')){_0x1479de={'method':_0x09ed('0x8'),'uri':_0x30e966+_0x09ed('0x3c'),'body':Object[_0x09ed('0x3d')]({},{'subject':intUtil[_0x09ed('0x35')](_0x232fa0[_0x09ed('0x36')],_0x4de1f1,'\x20'),'phonenumber':String(_0x4de1f1['calleridnum']),'description':intUtil[_0x09ed('0x35')](_0x232fa0[_0x09ed('0x37')],_0x4de1f1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x09ed('0x38')+_0x253b2f[_0x09ed('0x2b')]+')','ownerid@odata.bind':_0x09ed('0x22')+_0x253b2f[_0x09ed('0x1d')]+')','directioncode':_0x253b2f[_0x09ed('0x3e')]===_0x09ed('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x09ed('0x22')+_0x253b2f[_0x09ed('0x1d')]+')','participationtypemask':_0x253b2f[_0x09ed('0x3e')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x09ed('0x38')+_0x253b2f[_0x09ed('0x2b')]+')','participationtypemask':_0x253b2f[_0x09ed('0x3e')]==='queue'?0x1:0x2}]},getCustomFields(_0x232fa0[_0x09ed('0x39')],_0x4de1f1,_0x232fa0['ticketType'])),'headers':{'Authorization':_0x09ed('0x10')+_0x4edd91,'OData-Version':_0x09ed('0x11')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1479de);})[_0x09ed('0xc')](function(_0x21a1b1){var _0x1a2d24=_0x21a1b1[_0x09ed('0x23')][_0x09ed('0x24')];var _0x2fbd9d=_0x1a2d24[_0x09ed('0x32')](_0x1a2d24[_0x09ed('0x25')]('(')+0x1,_0x1a2d24[_0x09ed('0x25')](')'));_0x253b2f['ticketId']=_0x2fbd9d;_0x50ccef(_0x253b2f);})[_0x09ed('0xd')](function(_0x15b703){_0x3460eb(_0x15b703[_0x09ed('0x1e')]);});});}function emit(_0x57c5af,_0x42ec61,_0x7adcf9,_0x162d6c){var _0x49e404={'uri':util[_0x09ed('0x40')](_0x09ed('0x41'),_0x57c5af,_0x7adcf9,_0x162d6c)};io['to'](util[_0x09ed('0x40')](_0x09ed('0x42'),_0x42ec61))[_0x09ed('0x43')](_0x09ed('0x44'),_0x49e404);}exports['cs']=function(_0x49d242,_0x2fcaf6,_0x14b95d,_0x1b1cf1,_0x46856b,_0x2ac96c,_0x3296b9,_0x304adf){var _0x481837={};_0x2ac96c[_0x09ed('0x9')]=intUtil['stripTrailingSlash'](_0x2ac96c[_0x09ed('0x9')]);_0x2ac96c[_0x09ed('0x45')]=intUtil[_0x09ed('0x46')](_0x2ac96c[_0x09ed('0x45')]);_0x481837['callDirection']=_0x304adf==='queue'||_0x304adf===_0x09ed('0x47')?'queue':_0x09ed('0x1f');var _0x159b70=util[_0x09ed('0x40')](_0x09ed('0x48'),_0x2ac96c[_0x09ed('0x9')]);var _0x1c6f10=util[_0x09ed('0x40')](_0x09ed('0x49'),_0x2ac96c['tenantId']);var _0x55fa2a=util[_0x09ed('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ac96c[_0x09ed('0x45')],_0x2fcaf6[_0x09ed('0x4a')],md5(_0x2fcaf6['uniqueid']));if(_0x46856b&&_0x46856b[_0x09ed('0x4b')]){logger[_0x09ed('0x18')](_0x09ed('0x4c'),_0x09ed('0x4d'));_0x2fcaf6[_0x09ed('0x4e')]=_0x55fa2a;}else if(_0x3296b9&&_0x3296b9['recordingFormat']&&_0x3296b9[_0x09ed('0x4f')]!==_0x09ed('0x50')){logger[_0x09ed('0x18')](_0x09ed('0x51'),'Recording\x20is\x20enabled!');_0x2fcaf6['recordingURL']=_0x55fa2a;}else{_0x2fcaf6[_0x09ed('0x4e')]='';}return getUser(_0x481837,_0x2ac96c,_0x1b1cf1,_0x1c6f10,_0x159b70,_0x304adf)[_0x09ed('0xc')](function(_0x1c8ee3){logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+']\x20The\x20User\x20ID\x20is:',_0x1c8ee3[_0x09ed('0x1d')]);logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x52'),_0x1c8ee3['userEmail']);return getEndUser(_0x1c8ee3,_0x2ac96c,_0x1c6f10,_0x159b70,_0x2fcaf6,_0x304adf);})[_0x09ed('0xc')](function(_0x957904){logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x53'),_0x957904[_0x09ed('0x2b')]);logger[_0x09ed('0x18')]('['+_0x304adf['toUpperCase']()+_0x09ed('0x54'),_0x2fcaf6[_0x09ed('0x29')]);return getTicket(_0x957904,_0x2ac96c,_0x1c6f10,_0x159b70,_0x2fcaf6,_0x14b95d,_0x304adf);})[_0x09ed('0xc')](function(_0x37882a){logger['info'](util[_0x09ed('0x40')]('['+_0x304adf['toUpperCase']()+_0x09ed('0x55'),_0x14b95d[_0x09ed('0x3a')],_0x37882a[_0x09ed('0x56')]));logger[_0x09ed('0x18')](util[_0x09ed('0x40')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x57'),_0x304adf));if(_0x304adf!=='abandoned'){logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+']',_0x09ed('0x58'));emit(_0x2ac96c['remoteUri'],_0x1b1cf1[_0x09ed('0x59')],_0x14b95d[_0x09ed('0x3a')],_0x37882a['ticketId']);}})['catch'](function(_0x59511f){logger[_0x09ed('0x5a')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x5b'),util['inspect'](_0x59511f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0dd9=['systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','destcalleridnum','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','outbound','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','string','nameField','customField','idField','indexOf','ticketType','incident','assign','Subjects','/contacts(','Fields','phonecall','phonecalls','getString','Descriptions','callDirection','queue','ticketId','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','length','internalemailaddress','email','info','toUpperCase',']\x20Agent\x20found\x20','userId'];(function(_0x3b1628,_0x4704b9){var _0x32a9d5=function(_0xdec8ca){while(--_0xdec8ca){_0x3b1628['push'](_0x3b1628['shift']());}};_0x32a9d5(++_0x4704b9);}(_0x0dd9,0x14f));var _0x90dd=function(_0x5ef2de,_0xa06bd4){_0x5ef2de=_0x5ef2de-0x0;var _0x3a56be=_0x0dd9[_0x5ef2de];return _0x3a56be;};'use strict';var _=require(_0x90dd('0x0'));var BPromise=require('bluebird');var rp=require(_0x90dd('0x1'));var util=require(_0x90dd('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require('ioredis');var logger=require('../../../../config/logger')(_0x90dd('0x3'));var config=require('../../../../config/environment');config[_0x90dd('0x4')]=_[_0x90dd('0x5')](config[_0x90dd('0x4')],{'host':_0x90dd('0x6'),'port':0x18eb});var io=require(_0x90dd('0x7'))(new Redis(config['redis']));function getAuthToken(_0x17c9ac,_0x33971d,_0x30c9af){var _0xd64a0e={'method':_0x90dd('0x8'),'uri':_0x33971d,'form':{'client_id':_0x17c9ac[_0x90dd('0x9')],'resource':_0x17c9ac[_0x90dd('0xa')],'username':_0x17c9ac[_0x90dd('0xb')],'password':_0x17c9ac[_0x90dd('0xc')],'grant_type':_0x90dd('0xc'),'client_secret':_0x17c9ac[_0x90dd('0xd')]},'json':!![]};return rp(_0xd64a0e)[_0x90dd('0xe')](function(_0x35fce4){return _0x35fce4['access_token'];})[_0x90dd('0xf')](function(_0x55e686){logger[_0x90dd('0x10')]('['+[_0x30c9af['toUpperCase']()]+_0x90dd('0x11'));return _0x55e686[_0x90dd('0x12')];});}function getUser(_0x564266,_0x10a51e,_0x5324a0,_0x648207,_0xc06252,_0x5823ce){return new BPromise(function(_0x4c30e3,_0x4d9297){return getAuthToken(_0x10a51e,_0x648207,_0x5823ce)[_0x90dd('0xe')](function(_0x16295b){var _0x1184ff={'method':_0x90dd('0x13'),'uri':_0xc06252+_0x90dd('0x14'),'headers':{'Authorization':_0x90dd('0x15')+_0x16295b,'OData-Version':_0x90dd('0x16')},'json':!![]};return rp(_0x1184ff);})[_0x90dd('0xe')](function(_0x418950){var _0x1d5ff8=_0x418950[_0x90dd('0x17')];var _0x213502=![];var _0x416961=null;if(!_[_0x90dd('0x18')](_0x5324a0)){if(intUtil[_0x90dd('0x19')](_0x5324a0['email'])){_0x564266['userEmail']=_0x5324a0['email'];for(_0x416961=0x0;_0x416961<_0x1d5ff8[_0x90dd('0x1a')];_0x416961++){if(_0x1d5ff8[_0x416961][_0x90dd('0x1b')]===_0x5324a0[_0x90dd('0x1c')]&&!_0x1d5ff8[_0x416961]['isdisabled']){_0x213502=!![];logger[_0x90dd('0x1d')]('['+[_0x5823ce[_0x90dd('0x1e')]()]+_0x90dd('0x1f')+_0x1d5ff8[_0x416961]['systemuserid']+'!');_0x564266[_0x90dd('0x20')]=_0x1d5ff8[_0x416961][_0x90dd('0x21')];}}}}if(!_0x213502){logger[_0x90dd('0x1d')]('['+[_0x5823ce[_0x90dd('0x1e')]()]+_0x90dd('0x22'));_0x564266[_0x90dd('0x23')]=_0x10a51e[_0x90dd('0xb')];for(_0x416961=0x0;_0x416961<_0x1d5ff8[_0x90dd('0x1a')];_0x416961++){if(_0x1d5ff8[_0x416961][_0x90dd('0x1b')]===_0x10a51e[_0x90dd('0xb')]){_0x564266[_0x90dd('0x20')]=_0x1d5ff8[_0x416961][_0x90dd('0x21')];}}}_0x4c30e3(_0x564266);})[_0x90dd('0xf')](function(_0x46f80c){_0x4d9297(_0x46f80c[_0x90dd('0x12')]);});});}function createEndUser(_0x52a997,_0x4f8fea,_0x3170f6,_0x1d5df0,_0x575aee,_0x171712){return new BPromise(function(_0x5e00ac,_0x414664){return getAuthToken(_0x4f8fea,_0x3170f6,_0x171712)[_0x90dd('0xe')](function(_0x2ee7e2){var _0x1ed118=_0x171712[_0x90dd('0x24')]()==='outbound'?_0x575aee[_0x90dd('0x25')]:_0x575aee[_0x90dd('0x26')];var _0x3c0c80={'method':_0x90dd('0x8'),'uri':_0x1d5df0+_0x90dd('0x27'),'body':{'telephone1':_0x1ed118,'fullname':_0x1ed118,'firstname':_0x1ed118,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x90dd('0x28')+_0x52a997['userId']+')'},'headers':{'Authorization':_0x90dd('0x15')+_0x2ee7e2,'OData-Version':_0x90dd('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x3c0c80);})[_0x90dd('0xe')](function(_0x2b5dae){var _0x3429ba=_0x2b5dae[_0x90dd('0x29')][_0x90dd('0x2a')];var _0x379bd5=_0x3429ba[_0x90dd('0x2b')](_0x3429ba[_0x90dd('0x2c')]('(')+0x1,_0x3429ba[_0x90dd('0x2c')](')'));_0x52a997[_0x90dd('0x2d')]=_0x379bd5;_0x5e00ac(_0x52a997);})[_0x90dd('0xf')](function(_0x1d99ad){_0x414664(_0x1d99ad[_0x90dd('0x12')]);});});}function getEndUser(_0x1e29c4,_0x385272,_0x1209bf,_0x327263,_0x5234e4,_0x43557f){return new BPromise(function(_0x599f16,_0x12ee21){return getAuthToken(_0x385272,_0x1209bf,_0x43557f)['then'](function(_0x307034){var _0x1b12fe={'method':'GET','uri':_0x327263+_0x90dd('0x2e'),'headers':{'Authorization':'Bearer\x20'+_0x307034,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x1b12fe);})[_0x90dd('0xe')](function(_0x1bed0f){var _0x246a4d=null;if(_0x1bed0f){var _0x19b016=_0x1bed0f[_0x90dd('0x17')];var _0x2af8e2=![];for(_0x246a4d=0x0;_0x246a4d<_0x19b016['length'];_0x246a4d++){var _0x26ef15=_0x43557f[_0x90dd('0x24')]()===_0x90dd('0x2f')?_0x5234e4[_0x90dd('0x25')]:_0x5234e4[_0x90dd('0x26')];if(_0x19b016[_0x246a4d]['telephone1']===_0x26ef15){_0x2af8e2=!![];_0x1e29c4[_0x90dd('0x2d')]=_0x19b016[_0x246a4d][_0x90dd('0x30')];}}if(_0x2af8e2){_0x599f16(_0x1e29c4);}else{return createEndUser(_0x1e29c4,_0x385272,_0x1209bf,_0x327263,_0x5234e4,_0x43557f)[_0x90dd('0xe')](function(_0x3e5301){logger[_0x90dd('0x1d')]('['+[_0x43557f[_0x90dd('0x1e')]()]+_0x90dd('0x31'),_0x3e5301[_0x90dd('0x2d')]);_0x599f16(_0x3e5301);});}}else{return createEndUser(_0x1e29c4,_0x385272,_0x1209bf,_0x327263,_0x5234e4,_0x43557f)['then'](function(_0x17f756){logger[_0x90dd('0x1d')]('['+[_0x43557f[_0x90dd('0x1e')]()]+_0x90dd('0x32'),_0x17f756[_0x90dd('0x2d')]);_0x599f16(_0x17f756);});}});});}function getCustomFields(_0x57ca40,_0x349ced,_0x146d15){var _0x3a783f={};if(_0x57ca40['length']>0x0){_['forEach'](_0x57ca40,function(_0x5e0390){if(_0x5e0390[_0x90dd('0x33')]===_0x90dd('0x34')&&_0x5e0390[_0x90dd('0x35')]&&!_0x5e0390[_0x90dd('0x36')]){var _0xcc92d0=_0x5e0390[_0x90dd('0x37')][_0x90dd('0x24')]();var _0x55f86f=_0xcc92d0['substring'](0x0,_0xcc92d0[_0x90dd('0x38')]('_'));var _0x2078b5=_0xcc92d0[_0x90dd('0x2b')](_0xcc92d0[_0x90dd('0x38')]('_')+0x1);if(_0x55f86f===_0x146d15){_0x3a783f[_0x2078b5]=_0x5e0390['content'];}}});}return _0x3a783f;}function getTicket(_0x66508d,_0x5bc792,_0x4878e7,_0x26c5d8,_0x5ef582,_0x4319a7,_0x325a6d){return new BPromise(function(_0x101cbf,_0x27c97a){var _0x15a43c;return getAuthToken(_0x5bc792,_0x4878e7,_0x325a6d)[_0x90dd('0xe')](function(_0x1c2026){if(_0x4319a7[_0x90dd('0x39')]===_0x90dd('0x3a')){_0x15a43c={'method':_0x90dd('0x8'),'uri':_0x26c5d8+'incidents','body':Object[_0x90dd('0x3b')]({},{'title':intUtil['getString'](_0x4319a7[_0x90dd('0x3c')],_0x5ef582,'\x20'),'description':intUtil['getString'](_0x4319a7['Descriptions'],_0x5ef582,'\x0a'),'customerid_contact@odata.bind':_0x90dd('0x3d')+_0x66508d[_0x90dd('0x2d')]+')','ownerid@odata.bind':_0x90dd('0x28')+_0x66508d[_0x90dd('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x4319a7[_0x90dd('0x3e')],_0x5ef582,_0x4319a7[_0x90dd('0x39')])),'headers':{'Authorization':_0x90dd('0x15')+_0x1c2026,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4319a7[_0x90dd('0x39')]===_0x90dd('0x3f')){_0x15a43c={'method':_0x90dd('0x8'),'uri':_0x26c5d8+_0x90dd('0x40'),'body':Object[_0x90dd('0x3b')]({},{'subject':intUtil[_0x90dd('0x41')](_0x4319a7[_0x90dd('0x3c')],_0x5ef582,'\x20'),'phonenumber':String(_0x5ef582[_0x90dd('0x26')]),'description':intUtil['getString'](_0x4319a7[_0x90dd('0x42')],_0x5ef582,'\x0a'),'regardingobjectid_contact@odata.bind':_0x90dd('0x3d')+_0x66508d[_0x90dd('0x2d')]+')','ownerid@odata.bind':_0x90dd('0x28')+_0x66508d[_0x90dd('0x20')]+')','directioncode':_0x66508d[_0x90dd('0x43')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x90dd('0x28')+_0x66508d['userId']+')','participationtypemask':_0x66508d['callDirection']==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x90dd('0x3d')+_0x66508d[_0x90dd('0x2d')]+')','participationtypemask':_0x66508d[_0x90dd('0x43')]===_0x90dd('0x44')?0x1:0x2}]},getCustomFields(_0x4319a7['Fields'],_0x5ef582,_0x4319a7[_0x90dd('0x39')])),'headers':{'Authorization':_0x90dd('0x15')+_0x1c2026,'OData-Version':_0x90dd('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x15a43c);})[_0x90dd('0xe')](function(_0x2a7cb6){var _0x18878a=_0x2a7cb6[_0x90dd('0x29')][_0x90dd('0x2a')];var _0x46410c=_0x18878a[_0x90dd('0x2b')](_0x18878a['lastIndexOf']('(')+0x1,_0x18878a['lastIndexOf'](')'));_0x66508d[_0x90dd('0x45')]=_0x46410c;_0x101cbf(_0x66508d);})[_0x90dd('0xf')](function(_0x336128){_0x27c97a(_0x336128[_0x90dd('0x12')]);});});}function emit(_0x415443,_0x5b671a,_0x265c8c,_0x154c44){var _0x272b86={'uri':util[_0x90dd('0x46')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x415443,_0x265c8c,_0x154c44)};io['to'](util[_0x90dd('0x46')]('user:%s',_0x5b671a))[_0x90dd('0x47')](_0x90dd('0x48'),_0x272b86);}exports['cs']=function(_0xf9ce7e,_0x78669e,_0x2b06ae,_0x2d820d,_0x279874,_0x27b2aa,_0x4e54ab,_0x2cfeac){var _0x1dda67={};_0x27b2aa['remoteUri']=intUtil[_0x90dd('0x49')](_0x27b2aa['remoteUri']);_0x27b2aa[_0x90dd('0x4a')]=intUtil[_0x90dd('0x49')](_0x27b2aa[_0x90dd('0x4a')]);_0x1dda67[_0x90dd('0x43')]=_0x2cfeac===_0x90dd('0x44')||_0x2cfeac===_0x90dd('0x4b')?_0x90dd('0x44'):_0x90dd('0x2f');var _0x4b273a=util[_0x90dd('0x46')](_0x90dd('0x4c'),_0x27b2aa[_0x90dd('0xa')]);var _0x1880e6=util[_0x90dd('0x46')](_0x90dd('0x4d'),_0x27b2aa['tenantId']);var _0x551e01=util[_0x90dd('0x46')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x27b2aa[_0x90dd('0x4a')],_0x78669e[_0x90dd('0x4e')],md5(_0x78669e['uniqueid']));if(_0x279874&&_0x279874[_0x90dd('0x4f')]){logger[_0x90dd('0x1d')](_0x90dd('0x50'),'Recording\x20is\x20enabled!');_0x78669e[_0x90dd('0x51')]=_0x551e01;}else if(_0x4e54ab&&_0x4e54ab[_0x90dd('0x52')]&&_0x4e54ab[_0x90dd('0x52')]!==_0x90dd('0x53')){logger[_0x90dd('0x1d')]('[OUTBOUND]',_0x90dd('0x54'));_0x78669e[_0x90dd('0x51')]=_0x551e01;}else{_0x78669e[_0x90dd('0x51')]='';}return getUser(_0x1dda67,_0x27b2aa,_0x2d820d,_0x1880e6,_0x4b273a,_0x2cfeac)[_0x90dd('0xe')](function(_0x5c90e0){logger[_0x90dd('0x1d')]('['+_0x2cfeac[_0x90dd('0x1e')]()+']\x20The\x20User\x20ID\x20is:',_0x5c90e0[_0x90dd('0x20')]);logger[_0x90dd('0x1d')]('['+_0x2cfeac[_0x90dd('0x1e')]()+_0x90dd('0x55'),_0x5c90e0['userEmail']);return getEndUser(_0x5c90e0,_0x27b2aa,_0x1880e6,_0x4b273a,_0x78669e,_0x2cfeac);})[_0x90dd('0xe')](function(_0x2945f3){logger[_0x90dd('0x1d')]('['+_0x2cfeac['toUpperCase']()+_0x90dd('0x56'),_0x2945f3[_0x90dd('0x2d')]);logger[_0x90dd('0x1d')]('['+_0x2cfeac['toUpperCase']()+_0x90dd('0x57'),_0x78669e['calleridnum']);return getTicket(_0x2945f3,_0x27b2aa,_0x1880e6,_0x4b273a,_0x78669e,_0x2b06ae,_0x2cfeac);})[_0x90dd('0xe')](function(_0x5276d4){logger['info'](util[_0x90dd('0x46')]('['+_0x2cfeac['toUpperCase']()+_0x90dd('0x58'),_0x2b06ae[_0x90dd('0x39')],_0x5276d4[_0x90dd('0x45')]));logger[_0x90dd('0x1d')](util[_0x90dd('0x46')]('['+_0x2cfeac[_0x90dd('0x1e')]()+_0x90dd('0x59'),_0x2cfeac));if(_0x2cfeac!==_0x90dd('0x4b')){logger['info']('['+_0x2cfeac[_0x90dd('0x1e')]()+']',_0x90dd('0x5a'));emit(_0x27b2aa[_0x90dd('0xa')],_0x2d820d['name'],_0x2b06ae[_0x90dd('0x39')],_0x5276d4[_0x90dd('0x45')]);}})[_0x90dd('0xf')](function(_0x2852d2){logger[_0x90dd('0x10')]('['+_0x2cfeac[_0x90dd('0x1e')]()+_0x90dd('0x5b'),util['inspect'](_0x2852d2,{'showHidden':!![],'depth':null}));});}; \ 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 046a933..2fdba12 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 _0xa98c=['info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','Fields','custom_fields','keyBy','value','format','remoteUri','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','then','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','type','string','nameField','toLowerCase','idField','customField','content','variable','variableName','push','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','user:%s','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','defaults','redis','localhost','application/json'];(function(_0x4848cb,_0x457218){var _0x50f57b=function(_0x43c5a2){while(--_0x43c5a2){_0x4848cb['push'](_0x4848cb['shift']());}};_0x50f57b(++_0x457218);}(_0xa98c,0x1ac));var _0xca98=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xa98c[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0xca98('0x0'));var rp=require(_0xca98('0x1'));var md5=require(_0xca98('0x2'));var util=require(_0xca98('0x3'));var Redis=require(_0xca98('0x4'));var intUtil=require(_0xca98('0x5'));var config=require(_0xca98('0x6'));var logger=require('../../../../config/logger')(_0xca98('0x7'));config['redis']=_[_0xca98('0x8')](config[_0xca98('0x9')],{'host':_0xca98('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xca98('0x9')]));var headers={'Content-Type':'application/json','Accept':_0xca98('0xb')};function emit(_0x16b606,_0x214e21,_0x1acbae){io['to'](_0x16b606)['emit'](_0x214e21,_0x1acbae);}function getTicket(_0xd3781b,_0x1d5656,_0x2921cd,_0x510ae8,_0x45e800){logger[_0xca98('0xc')](_0xca98('0xd'));var _0x956419=_['merge']({'responder_id':_0x1d5656['id'],'requester_id':_0x2921cd['id'],'name':util['format'](_0xca98('0xe'),_0x45e800[_0xca98('0xf')]),'phone':_0x45e800[_0xca98('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xca98('0x11')](_0x510ae8[_0xca98('0x12')],_0x45e800,'\x20'),'description':intUtil['getString'](_0x510ae8['Descriptions'],_0x45e800,'
'),'tags':getTags(_0x510ae8[_0xca98('0x13')],_0xca98('0x14'))},getCustomFields(_0x510ae8[_0xca98('0x15')],_0x45e800));_0x956419[_0xca98('0x16')]=_['mapValues'](_[_0xca98('0x17')](_0x956419[_0xca98('0x16')],'id'),_0xca98('0x18'));return request({'uri':util[_0xca98('0x19')]('%s/api/v2/tickets',_0xd3781b[_0xca98('0x1a')]),'method':'POST','body':_0x956419})['then'](function(_0x12635c){logger[_0xca98('0xc')](_0xca98('0x1b'));return _0x12635c;});}function getUser(_0x178142,_0x854135){if(intUtil['validateEmail'](_0x854135)){return request({'uri':util['format'](_0xca98('0x1c'),_0x178142[_0xca98('0x1a')]),'qs':{'email':_0x854135}})['then'](function(_0x2b920f){if(_0x2b920f[_0xca98('0x1d')]){logger[_0xca98('0xc')](_0xca98('0x1e'));return _[_0xca98('0x1f')](_0x2b920f,function(_0x3277ac){return _0x3277ac[_0xca98('0x20')][_0xca98('0x21')]===_0x854135;});}else{logger[_0xca98('0xc')](_0xca98('0x22'));return request({'uri':util[_0xca98('0x19')](_0xca98('0x23'),_0x178142['remoteUri'])})['then'](function(_0x46fc99){logger[_0xca98('0xc')](_0xca98('0x24'));return _0x46fc99;});}});}else{logger['info'](_0xca98('0x25'));return request({'uri':util[_0xca98('0x19')]('%s/api/v2/agents/me',_0x178142[_0xca98('0x1a')])})[_0xca98('0x26')](function(_0x1bc711){logger[_0xca98('0xc')]('Admin\x20account\x20selected.');return _0x1bc711;});}}function getEndUser(_0x56368f,_0x17acfb,_0x26ec81){logger['info']('Searching\x20enduser\x20with\x20phone',_0x26ec81);return request({'uri':util[_0xca98('0x19')](_0xca98('0x27'),_0x56368f['remoteUri']),'qs':{'phone':_0x26ec81}})[_0xca98('0x26')](function(_0x5be691){if(_0x5be691[_0xca98('0x1d')]){logger['info'](_0xca98('0x28'));return _[_0xca98('0x1f')](_0x5be691,{'phone':_0x26ec81});}else{logger[_0xca98('0xc')](_0xca98('0x29'));return request({'uri':util['format'](_0xca98('0x27'),_0x56368f['remoteUri']),'method':_0xca98('0x2a'),'body':{'name':_0x17acfb,'phone':_0x26ec81}})[_0xca98('0x26')](function(_0x48776d){logger[_0xca98('0xc')]('Enduser\x20created.');return _0x48776d;});}});}function getAuth(_0x380a2d){return util['format'](_0xca98('0x2b'),new Buffer(_0x380a2d[_0xca98('0x2c')]+':X')[_0xca98('0x2d')](_0xca98('0x2e')));}function request(_0x4fe82e){logger[_0xca98('0x2f')](_0xca98('0x30'),JSON[_0xca98('0x31')](_0x4fe82e));return rp(_[_0xca98('0x8')](_0x4fe82e,{'method':_0xca98('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x164dc3,_0x3b21aa){var _0x10e610=[];if(_0x164dc3&&_0x164dc3[_0xca98('0x1d')]>0x0){_0x10e610=_[_0xca98('0x33')](_0x164dc3,_0x3b21aa);}return _0x10e610;}function getCustomFields(_0xf5abc0,_0x40b239){var _0x31723f=[];var _0x36c0a8={'custom_fields':[]};if(_0xf5abc0['length']>0x0){_['forEach'](_0xf5abc0,function(_0x5cda6d){if(_0x5cda6d[_0xca98('0x34')]===_0xca98('0x35')&&_0x5cda6d['nameField']&&!_0x5cda6d['customField']){_0x36c0a8[_0x5cda6d[_0xca98('0x36')][_0xca98('0x37')]()]=_0x5cda6d['content'][_0xca98('0x2d')]();}else if(_0x5cda6d[_0xca98('0x34')]===_0xca98('0x35')&&_0x5cda6d[_0xca98('0x38')]&&_0x5cda6d[_0xca98('0x39')]){_0x36c0a8['custom_fields']['push']({'id':_0x5cda6d[_0xca98('0x38')],'value':_0x5cda6d[_0xca98('0x3a')][_0xca98('0x2d')]()});}else if(_0x5cda6d['type']===_0xca98('0x3b')&&_0x5cda6d['variableName']&&_0x5cda6d[_0xca98('0x38')]&&_0x5cda6d['customField']){_0x40b239[_0x5cda6d[_0xca98('0x3c')]]&&_0x36c0a8[_0xca98('0x16')][_0xca98('0x3d')]({'id':_0x5cda6d[_0xca98('0x38')],'value':_0x40b239[_0x5cda6d[_0xca98('0x3c')]][_0xca98('0x2d')]()});}else if(_0x5cda6d[_0xca98('0x34')]===_0xca98('0x3e')&&_0x5cda6d[_0xca98('0x3f')]&&_0x5cda6d['Variable'][_0xca98('0x14')]&&_0x5cda6d[_0xca98('0x38')]&&_0x5cda6d[_0xca98('0x39')]){_0x40b239[_0x5cda6d[_0xca98('0x3f')][_0xca98('0x14')][_0xca98('0x37')]()]&&_0x36c0a8[_0xca98('0x16')][_0xca98('0x3d')]({'id':_0x5cda6d[_0xca98('0x38')],'value':_0x40b239[_0x5cda6d[_0xca98('0x3f')][_0xca98('0x14')][_0xca98('0x37')]()][_0xca98('0x2d')]()});}});}return _0x36c0a8;}exports['queue']=function(_0x4b03dd,_0x4b897b,_0x1b514a,_0x5ca7e9,_0x51f70f,_0x24c260){var _0x3a7546,_0x1ec5e3;_0x24c260[_0xca98('0x1a')]=intUtil[_0xca98('0x40')](_0x24c260[_0xca98('0x1a')]);_0x24c260[_0xca98('0x41')]=intUtil[_0xca98('0x40')](_0x24c260[_0xca98('0x41')]);if(_0x51f70f&&_0x51f70f[_0xca98('0x42')]){logger[_0xca98('0xc')](_0xca98('0x43'),_0xca98('0x44'));_0x4b897b[_0xca98('0x45')]=util[_0xca98('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24c260['serverUrl'],_0x4b897b[_0xca98('0x46')],md5(_0x4b897b['uniqueid']));}else{_0x4b897b[_0xca98('0x45')]='';}headers['Authorization']=getAuth(_0x24c260);return getUser(_0x24c260,_0x5ca7e9[_0xca98('0x21')])[_0xca98('0x26')](function(_0x514028){_0x3a7546=_0x514028;logger[_0xca98('0xc')](_0xca98('0x47'),_0x3a7546['id']);return getEndUser(_0x24c260,_0x4b897b['calleridname'],_0x4b897b[_0xca98('0x10')]);})[_0xca98('0x26')](function(_0x406c67){_0x1ec5e3=_0x406c67;logger['info'](_0xca98('0x48'),_0x1ec5e3['id']);return getTicket(_0x24c260,_0x3a7546,_0x1ec5e3,_0x1b514a,_0x4b897b);})['then'](function(_0x437596){if(_0x437596&&_0x437596['id']){logger['info'](_0xca98('0x1b'));logger['info'](_0xca98('0x49'),_0x437596['id']);logger[_0xca98('0xc')](_0xca98('0x43'),_0xca98('0x4a'));emit(util[_0xca98('0x19')]('user:%s',_0x5ca7e9[_0xca98('0x14')]),_0xca98('0x4b'),{'uri':util['format'](_0xca98('0x4c'),_0x24c260[_0xca98('0x1a')],_0x437596['id'])});}})[_0xca98('0x4d')](function(_0x1e0842){logger[_0xca98('0x4e')](_0xca98('0x43'),JSON['stringify'](_0x1e0842));});};exports[_0xca98('0x4f')]=function(_0x372bc6,_0x3ab291,_0x2f552e,_0x39a0c7,_0x1ff46f,_0x1b2afe,_0x45dce5){var _0xff1695,_0x3c6bc5;_0x1b2afe[_0xca98('0x1a')]=intUtil[_0xca98('0x40')](_0x1b2afe[_0xca98('0x1a')]);_0x1b2afe[_0xca98('0x41')]=intUtil[_0xca98('0x40')](_0x1b2afe[_0xca98('0x41')]);if(_0x45dce5&&_0x45dce5[_0xca98('0x50')]&&_0x45dce5[_0xca98('0x50')]!=='none'){logger[_0xca98('0xc')](_0xca98('0x51'),'Recording\x20is\x20enabled!');_0x3ab291[_0xca98('0x45')]=util[_0xca98('0x19')](_0xca98('0x52'),_0x1b2afe[_0xca98('0x41')],_0x3ab291[_0xca98('0x46')],md5(_0x3ab291['uniqueid']));}headers[_0xca98('0x53')]=getAuth(_0x1b2afe);return getUser(_0x1b2afe,_0x39a0c7[_0xca98('0x21')])[_0xca98('0x26')](function(_0x34fd65){_0xff1695=_0x34fd65;logger[_0xca98('0xc')]('The\x20User\x20ID\x20is:',_0xff1695['id']);return getEndUser(_0x1b2afe,_0x3ab291[_0xca98('0x54')],_0x3ab291['destcalleridnum']);})[_0xca98('0x26')](function(_0x34a2e2){_0x3c6bc5=_0x34a2e2;logger[_0xca98('0xc')](_0xca98('0x48'),_0x3c6bc5['id']);return getTicket(_0x1b2afe,_0xff1695,_0x3c6bc5,_0x2f552e,_0x3ab291);})['then'](function(_0x201f5f){if(_0x201f5f&&_0x201f5f['id']){logger[_0xca98('0xc')]('Ticket\x20created!');logger['info'](_0xca98('0x49'),_0x201f5f['id']);logger['info'](_0xca98('0x51'),_0xca98('0x4a'));emit(util[_0xca98('0x19')](_0xca98('0x55'),_0x39a0c7[_0xca98('0x14')]),_0xca98('0x4b'),{'uri':util[_0xca98('0x19')](_0xca98('0x4c'),_0x1b2afe['remoteUri'],_0x201f5f['id'])});}})[_0xca98('0x4d')](function(_0x33137b){logger[_0xca98('0x4e')]('[OUTBOUND]',JSON['stringify'](_0x33137b));});};exports[_0xca98('0x56')]=function(_0x415cc4,_0x41f7fb,_0x3fd26e,_0x5cabb5,_0x5d5487,_0x238a84){var _0x5f0205,_0x2dd9b7;_0x238a84['remoteUri']=intUtil['stripTrailingSlash'](_0x238a84[_0xca98('0x1a')]);_0x238a84[_0xca98('0x41')]=intUtil[_0xca98('0x40')](_0x238a84[_0xca98('0x41')]);if(_0x5d5487&&_0x5d5487[_0xca98('0x42')]){logger[_0xca98('0xc')](_0xca98('0x57'),_0xca98('0x44'));_0x41f7fb['recordingURL']=util['format'](_0xca98('0x52'),_0x238a84[_0xca98('0x41')],_0x41f7fb[_0xca98('0x46')],md5(_0x41f7fb[_0xca98('0x46')]));}else{_0x41f7fb['recordingURL']='';}headers[_0xca98('0x53')]=getAuth(_0x238a84);return getUser(_0x238a84,'')[_0xca98('0x26')](function(_0x3ee115){_0x5f0205=_0x3ee115;logger['info'](_0xca98('0x47'),_0x5f0205['id']);return getEndUser(_0x238a84,_0x41f7fb[_0xca98('0xf')],_0x41f7fb[_0xca98('0x10')]);})['then'](function(_0x293b47){_0x2dd9b7=_0x293b47;logger[_0xca98('0xc')](_0xca98('0x48'),_0x2dd9b7['id']);return getTicket(_0x238a84,_0x5f0205,_0x2dd9b7,_0x3fd26e,_0x41f7fb);})[_0xca98('0x26')](function(_0x565140){if(_0x565140){logger[_0xca98('0xc')](_0xca98('0x1b'));logger['info'](_0xca98('0x49'),_0x565140['id']);}})[_0xca98('0x4d')](function(_0x5df0bc){logger[_0xca98('0x4e')](_0xca98('0x57'),JSON['stringify'](_0x5df0bc));});}; \ No newline at end of file +var _0xa31a=['Fields','custom_fields','mapValues','keyBy','then','info','Ticket\x20created!','remoteUri','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','POST','Enduser\x20created.','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','type','nameField','customField','toLowerCase','content','idField','push','variableName','customVariable','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','user:%s','catch','error','abandoned','[ABANDONED]','request-promise','md5','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','merge','format','Caller\x20-\x20%s','getString','Subjects','Descriptions','
','Tags','name'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xa31a,0x9f));var _0xaa31=function(_0x11ac9e,_0x5d21c){_0x11ac9e=_0x11ac9e-0x0;var _0x13ac55=_0xa31a[_0x11ac9e];return _0x13ac55;};'use strict';var _=require('lodash');var rp=require(_0xaa31('0x0'));var md5=require(_0xaa31('0x1'));var util=require('util');var Redis=require(_0xaa31('0x2'));var intUtil=require(_0xaa31('0x3'));var config=require('../../../../config/environment');var logger=require(_0xaa31('0x4'))(_0xaa31('0x5'));config[_0xaa31('0x6')]=_[_0xaa31('0x7')](config['redis'],{'host':_0xaa31('0x8'),'port':0x18eb});var io=require(_0xaa31('0x9'))(new Redis(config[_0xaa31('0x6')]));var headers={'Content-Type':_0xaa31('0xa'),'Accept':_0xaa31('0xa')};function emit(_0x5e6268,_0x1a8606,_0x5dbbd5){io['to'](_0x5e6268)[_0xaa31('0xb')](_0x1a8606,_0x5dbbd5);}function getTicket(_0xa6dcb,_0x1ebb98,_0x3fb0e1,_0x1afc97,_0x5bca20){logger['info']('Creating\x20new\x20ticket...');var _0x5ab0c3=_[_0xaa31('0xc')]({'responder_id':_0x1ebb98['id'],'requester_id':_0x3fb0e1['id'],'name':util[_0xaa31('0xd')](_0xaa31('0xe'),_0x5bca20['calleridname']),'phone':_0x5bca20['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xaa31('0xf')](_0x1afc97[_0xaa31('0x10')],_0x5bca20,'\x20'),'description':intUtil[_0xaa31('0xf')](_0x1afc97[_0xaa31('0x11')],_0x5bca20,_0xaa31('0x12')),'tags':getTags(_0x1afc97[_0xaa31('0x13')],_0xaa31('0x14'))},getCustomFields(_0x1afc97[_0xaa31('0x15')],_0x5bca20));_0x5ab0c3[_0xaa31('0x16')]=_[_0xaa31('0x17')](_[_0xaa31('0x18')](_0x5ab0c3[_0xaa31('0x16')],'id'),'value');return request({'uri':util[_0xaa31('0xd')]('%s/api/v2/tickets',_0xa6dcb['remoteUri']),'method':'POST','body':_0x5ab0c3})[_0xaa31('0x19')](function(_0x3a5387){logger[_0xaa31('0x1a')](_0xaa31('0x1b'));return _0x3a5387;});}function getUser(_0x580dc4,_0x2815ec){if(intUtil['validateEmail'](_0x2815ec)){return request({'uri':util[_0xaa31('0xd')]('%s/api/v2/agents',_0x580dc4[_0xaa31('0x1c')]),'qs':{'email':_0x2815ec}})['then'](function(_0xdd294e){if(_0xdd294e[_0xaa31('0x1d')]){logger[_0xaa31('0x1a')](_0xaa31('0x1e'));return _[_0xaa31('0x1f')](_0xdd294e,function(_0x24948d){return _0x24948d[_0xaa31('0x20')]['email']===_0x2815ec;});}else{logger[_0xaa31('0x1a')](_0xaa31('0x21'));return request({'uri':util[_0xaa31('0xd')](_0xaa31('0x22'),_0x580dc4[_0xaa31('0x1c')])})['then'](function(_0x5359cd){logger[_0xaa31('0x1a')](_0xaa31('0x23'));return _0x5359cd;});}});}else{logger[_0xaa31('0x1a')](_0xaa31('0x24'));return request({'uri':util[_0xaa31('0xd')](_0xaa31('0x22'),_0x580dc4['remoteUri'])})[_0xaa31('0x19')](function(_0x9af3d6){logger[_0xaa31('0x1a')]('Admin\x20account\x20selected.');return _0x9af3d6;});}}function getEndUser(_0x30c9af,_0x2f58d7,_0x2806bb){logger[_0xaa31('0x1a')](_0xaa31('0x25'),_0x2806bb);return request({'uri':util[_0xaa31('0xd')](_0xaa31('0x26'),_0x30c9af['remoteUri']),'qs':{'phone':_0x2806bb}})[_0xaa31('0x19')](function(_0x3337d6){if(_0x3337d6[_0xaa31('0x1d')]){logger[_0xaa31('0x1a')](_0xaa31('0x27'));return _['find'](_0x3337d6,{'phone':_0x2806bb});}else{logger[_0xaa31('0x1a')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0xaa31('0x26'),_0x30c9af[_0xaa31('0x1c')]),'method':_0xaa31('0x28'),'body':{'name':_0x2f58d7,'phone':_0x2806bb}})[_0xaa31('0x19')](function(_0x49d6a5){logger[_0xaa31('0x1a')](_0xaa31('0x29'));return _0x49d6a5;});}});}function getAuth(_0x4d35e0){return util[_0xaa31('0xd')]('Basic\x20%s',new Buffer(_0x4d35e0[_0xaa31('0x2a')]+':X')[_0xaa31('0x2b')]('base64'));}function request(_0x2e4928){logger[_0xaa31('0x2c')](_0xaa31('0x2d'),JSON[_0xaa31('0x2e')](_0x2e4928));return rp(_[_0xaa31('0x7')](_0x2e4928,{'method':_0xaa31('0x2f'),'headers':headers,'json':!![]}));}function getTags(_0x399560,_0x5341c8){var _0x2e51f7=[];if(_0x399560&&_0x399560[_0xaa31('0x1d')]>0x0){_0x2e51f7=_[_0xaa31('0x30')](_0x399560,_0x5341c8);}return _0x2e51f7;}function getCustomFields(_0x220891,_0x2f4dd9){var _0xe9870=[];var _0x1954d8={'custom_fields':[]};if(_0x220891[_0xaa31('0x1d')]>0x0){_[_0xaa31('0x31')](_0x220891,function(_0x418285){if(_0x418285[_0xaa31('0x32')]==='string'&&_0x418285[_0xaa31('0x33')]&&!_0x418285[_0xaa31('0x34')]){_0x1954d8[_0x418285[_0xaa31('0x33')][_0xaa31('0x35')]()]=_0x418285[_0xaa31('0x36')][_0xaa31('0x2b')]();}else if(_0x418285['type']==='string'&&_0x418285[_0xaa31('0x37')]&&_0x418285['customField']){_0x1954d8[_0xaa31('0x16')][_0xaa31('0x38')]({'id':_0x418285[_0xaa31('0x37')],'value':_0x418285['content']['toString']()});}else if(_0x418285['type']==='variable'&&_0x418285[_0xaa31('0x39')]&&_0x418285[_0xaa31('0x37')]&&_0x418285[_0xaa31('0x34')]){_0x2f4dd9[_0x418285[_0xaa31('0x39')]]&&_0x1954d8[_0xaa31('0x16')]['push']({'id':_0x418285[_0xaa31('0x37')],'value':_0x2f4dd9[_0x418285[_0xaa31('0x39')]][_0xaa31('0x2b')]()});}else if(_0x418285[_0xaa31('0x32')]===_0xaa31('0x3a')&&_0x418285[_0xaa31('0x3b')]&&_0x418285[_0xaa31('0x3b')][_0xaa31('0x14')]&&_0x418285['idField']&&_0x418285['customField']){_0x2f4dd9[_0x418285[_0xaa31('0x3b')]['name'][_0xaa31('0x35')]()]&&_0x1954d8['custom_fields'][_0xaa31('0x38')]({'id':_0x418285[_0xaa31('0x37')],'value':_0x2f4dd9[_0x418285['Variable'][_0xaa31('0x14')][_0xaa31('0x35')]()][_0xaa31('0x2b')]()});}});}return _0x1954d8;}exports[_0xaa31('0x3c')]=function(_0x1b0b38,_0x13e6e5,_0x272aa1,_0x2cc14e,_0x28fc68,_0x5817f5){var _0xf3a67c,_0x4606d9;_0x5817f5[_0xaa31('0x1c')]=intUtil['stripTrailingSlash'](_0x5817f5['remoteUri']);_0x5817f5[_0xaa31('0x3d')]=intUtil[_0xaa31('0x3e')](_0x5817f5[_0xaa31('0x3d')]);if(_0x28fc68&&_0x28fc68[_0xaa31('0x3f')]){logger[_0xaa31('0x1a')]('[QUEUE]',_0xaa31('0x40'));_0x13e6e5[_0xaa31('0x41')]=util[_0xaa31('0xd')](_0xaa31('0x42'),_0x5817f5['serverUrl'],_0x13e6e5[_0xaa31('0x43')],md5(_0x13e6e5[_0xaa31('0x43')]));}else{_0x13e6e5[_0xaa31('0x41')]='';}headers[_0xaa31('0x44')]=getAuth(_0x5817f5);return getUser(_0x5817f5,_0x2cc14e[_0xaa31('0x45')])['then'](function(_0x36627c){_0xf3a67c=_0x36627c;logger[_0xaa31('0x1a')](_0xaa31('0x46'),_0xf3a67c['id']);return getEndUser(_0x5817f5,_0x13e6e5[_0xaa31('0x47')],_0x13e6e5[_0xaa31('0x48')]);})[_0xaa31('0x19')](function(_0x10d17c){_0x4606d9=_0x10d17c;logger[_0xaa31('0x1a')](_0xaa31('0x49'),_0x4606d9['id']);return getTicket(_0x5817f5,_0xf3a67c,_0x4606d9,_0x272aa1,_0x13e6e5);})[_0xaa31('0x19')](function(_0x5f0a4e){if(_0x5f0a4e&&_0x5f0a4e['id']){logger[_0xaa31('0x1a')](_0xaa31('0x1b'));logger['info'](_0xaa31('0x4a'),_0x5f0a4e['id']);logger[_0xaa31('0x1a')](_0xaa31('0x4b'),_0xaa31('0x4c'));emit(util[_0xaa31('0xd')]('user:%s',_0x2cc14e['name']),_0xaa31('0x4d'),{'uri':util[_0xaa31('0xd')](_0xaa31('0x4e'),_0x5817f5[_0xaa31('0x1c')],_0x5f0a4e['id'])});}})['catch'](function(_0x30e98b){logger['error'](_0xaa31('0x4b'),JSON[_0xaa31('0x2e')](_0x30e98b));});};exports[_0xaa31('0x4f')]=function(_0x5e4fd2,_0x4d3ab9,_0x4bfb84,_0x3a1fba,_0x56b27e,_0x228f74,_0xc77054){var _0x1a7853,_0x5716fe;_0x228f74[_0xaa31('0x1c')]=intUtil[_0xaa31('0x3e')](_0x228f74['remoteUri']);_0x228f74[_0xaa31('0x3d')]=intUtil[_0xaa31('0x3e')](_0x228f74[_0xaa31('0x3d')]);if(_0xc77054&&_0xc77054[_0xaa31('0x50')]&&_0xc77054[_0xaa31('0x50')]!==_0xaa31('0x51')){logger['info'](_0xaa31('0x52'),_0xaa31('0x40'));_0x4d3ab9[_0xaa31('0x41')]=util[_0xaa31('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x228f74['serverUrl'],_0x4d3ab9[_0xaa31('0x43')],md5(_0x4d3ab9[_0xaa31('0x43')]));}headers['Authorization']=getAuth(_0x228f74);return getUser(_0x228f74,_0x3a1fba[_0xaa31('0x45')])['then'](function(_0x32b3aa){_0x1a7853=_0x32b3aa;logger['info'](_0xaa31('0x46'),_0x1a7853['id']);return getEndUser(_0x228f74,_0x4d3ab9[_0xaa31('0x53')],_0x4d3ab9[_0xaa31('0x54')]);})[_0xaa31('0x19')](function(_0x3d5333){_0x5716fe=_0x3d5333;logger['info'](_0xaa31('0x49'),_0x5716fe['id']);return getTicket(_0x228f74,_0x1a7853,_0x5716fe,_0x4bfb84,_0x4d3ab9);})[_0xaa31('0x19')](function(_0x574ed6){if(_0x574ed6&&_0x574ed6['id']){logger[_0xaa31('0x1a')](_0xaa31('0x1b'));logger[_0xaa31('0x1a')](_0xaa31('0x4a'),_0x574ed6['id']);logger[_0xaa31('0x1a')](_0xaa31('0x52'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaa31('0xd')](_0xaa31('0x55'),_0x3a1fba[_0xaa31('0x14')]),_0xaa31('0x4d'),{'uri':util[_0xaa31('0xd')](_0xaa31('0x4e'),_0x228f74[_0xaa31('0x1c')],_0x574ed6['id'])});}})[_0xaa31('0x56')](function(_0x2a310c){logger[_0xaa31('0x57')](_0xaa31('0x52'),JSON['stringify'](_0x2a310c));});};exports[_0xaa31('0x58')]=function(_0x3545ec,_0x1a469f,_0x13cb78,_0x577cb8,_0x9c23f9,_0x1f21c0){var _0x18c1a7,_0x102927;_0x1f21c0[_0xaa31('0x1c')]=intUtil[_0xaa31('0x3e')](_0x1f21c0[_0xaa31('0x1c')]);_0x1f21c0[_0xaa31('0x3d')]=intUtil[_0xaa31('0x3e')](_0x1f21c0[_0xaa31('0x3d')]);if(_0x9c23f9&&_0x9c23f9['monitor_format']){logger['info'](_0xaa31('0x59'),_0xaa31('0x40'));_0x1a469f[_0xaa31('0x41')]=util[_0xaa31('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1f21c0[_0xaa31('0x3d')],_0x1a469f[_0xaa31('0x43')],md5(_0x1a469f[_0xaa31('0x43')]));}else{_0x1a469f[_0xaa31('0x41')]='';}headers['Authorization']=getAuth(_0x1f21c0);return getUser(_0x1f21c0,'')['then'](function(_0x2ba7e2){_0x18c1a7=_0x2ba7e2;logger[_0xaa31('0x1a')](_0xaa31('0x46'),_0x18c1a7['id']);return getEndUser(_0x1f21c0,_0x1a469f[_0xaa31('0x47')],_0x1a469f[_0xaa31('0x48')]);})[_0xaa31('0x19')](function(_0x4bc9a1){_0x102927=_0x4bc9a1;logger[_0xaa31('0x1a')](_0xaa31('0x49'),_0x102927['id']);return getTicket(_0x1f21c0,_0x18c1a7,_0x102927,_0x13cb78,_0x1a469f);})['then'](function(_0x689bdc){if(_0x689bdc){logger[_0xaa31('0x1a')]('Ticket\x20created!');logger[_0xaa31('0x1a')](_0xaa31('0x4a'),_0x689bdc['id']);}})['catch'](function(_0x2faa0f){logger['error'](_0xaa31('0x59'),JSON['stringify'](_0x2faa0f));});}; \ 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 b4561d6..41cd04e 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 _0xabb8=['ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','abandoned','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','GET','/api/selector/owners','headers','then','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','Admin\x20selected','userEmail','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','endUserId','Contact\x20created:','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xabb8,0x15d));var _0x8abb=function(_0x2de07c,_0x2e7d07){_0x2de07c=_0x2de07c-0x0;var _0x27b26d=_0xabb8[_0x2de07c];return _0x27b26d;};'use strict';var _=require('lodash');var rp=require(_0x8abb('0x0'));var md5=require(_0x8abb('0x1'));var util=require(_0x8abb('0x2'));var moment=require(_0x8abb('0x3'));var Promise=require(_0x8abb('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x8abb('0x5'));var logger=require(_0x8abb('0x6'))(_0x8abb('0x7'));config[_0x8abb('0x8')]=_[_0x8abb('0x9')](config[_0x8abb('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x34f026,_0x20696c,_0x376aa7,_0x16d3d6){return new Promise(function(_0x883ab3,_0x245920){var _0x225af7=![];var _0x3e9a36={'method':_0x8abb('0xa'),'uri':_0x16d3d6+_0x8abb('0xb'),'json':!![]};_0x3e9a36[_0x8abb('0xc')]=_0x376aa7;logger['info']('Getting\x20admin\x20information');return rp(_0x3e9a36)[_0x8abb('0xd')](function(_0x5c7c14){if(_0x5c7c14){var _0x3d8270=_0x5c7c14[_0x8abb('0xe')];var _0x549010=null;for(_0x549010=0x0;_0x549010<_0x3d8270[_0x8abb('0xf')];_0x549010++){if(_0x3d8270[_0x549010][_0x8abb('0x10')]===_0x34f026[_0x8abb('0x11')]){_0x34f026[_0x8abb('0x12')]=_0x3d8270[_0x549010]['id'];_0x225af7=!![];}}if(_0x225af7){logger[_0x8abb('0x13')](_0x8abb('0x14'),_0x34f026['adminId']);_0x883ab3(_0x34f026);}else{_0x245920({'statusCode':0x194,'message':_0x8abb('0x15')});}}else{_0x245920({'statusCode':0x194,'message':_0x8abb('0x15')});}})[_0x8abb('0x16')](function(_0x39a6be){logger[_0x8abb('0x17')]('['+[_0x20696c[_0x8abb('0x18')]()]+']',_0x39a6be[_0x8abb('0x19')]);_0x245920(_0x39a6be);});});}function getUser(_0x516961,_0x4f4174,_0x5e02e1){return function(_0x304997){return new Promise(function(_0x36a638,_0x332434){var _0x57e9cf={'method':_0x8abb('0xa'),'uri':_0x5e02e1+_0x8abb('0xb'),'json':!![]};_0x57e9cf[_0x8abb('0xc')]=_0x4f4174;logger[_0x8abb('0x13')](_0x8abb('0x1a'));return rp(_0x57e9cf)[_0x8abb('0xd')](function(_0x3625c9){if(_0x3625c9){var _0x2e0d0f=_0x3625c9[_0x8abb('0xe')];var _0x17a620=![];var _0x12b185=null;if(_0x304997[_0x8abb('0x1b')]!==null){logger['info'](_0x8abb('0x1c'),_0x304997[_0x8abb('0x1b')]);_0x304997['userEmail']=_0x304997['agentEmail'];for(_0x12b185=0x0;_0x12b185<_0x2e0d0f[_0x8abb('0xf')];_0x12b185++){if(_0x2e0d0f[_0x12b185][_0x8abb('0x10')]===_0x304997[_0x8abb('0x1b')]){_0x17a620=!![];_0x304997[_0x8abb('0x1d')]=_0x2e0d0f[_0x12b185]['id'];logger['info']('User\x20found:',_0x304997[_0x8abb('0x1d')]);}}}if(!_0x17a620){logger[_0x8abb('0x13')](_0x8abb('0x1e'));_0x304997[_0x8abb('0x1f')]=_0x304997[_0x8abb('0x11')];_0x304997[_0x8abb('0x1d')]=_0x304997['adminId'];_0x17a620=!![];}if(_0x17a620){_0x36a638(_0x304997);}else{_0x332434({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x332434({'statusCode':0x194,'message':_0x8abb('0x15')});}})['catch'](function(_0x165b73){logger[_0x8abb('0x17')]('['+[_0x516961[_0x8abb('0x18')]()]+']',_0x165b73[_0x8abb('0x19')]);_0x332434(_0x165b73);});});};}function getEndUser(_0xb88cae,_0x27b9f9,_0x1a8705){return function(_0x88b59){return new Promise(function(_0x238021,_0x2c4bac){var _0x42c2b8=0x0;var _0xb3161f={'method':'GET','uri':_0x1a8705+'/api/contacts/filters','json':!![]};_0xb3161f[_0x8abb('0xc')]=_0x27b9f9;logger[_0x8abb('0x13')](_0x8abb('0x20'));return rp(_0xb3161f)[_0x8abb('0xd')](function(_0x3d2c1a){_0x3d2c1a[_0x8abb('0x21')][_0x8abb('0x22')](function(_0x3a8546){if(_0x3a8546[_0x8abb('0x23')]===_0x8abb('0x24')){_0x42c2b8=_0x3a8546['id'];}});})[_0x8abb('0xd')](function(){logger[_0x8abb('0x13')](_0x8abb('0x25'));var _0x38ebc5={'method':'GET','uri':_0x1a8705+_0x8abb('0x26')+_0x42c2b8,'json':!![]};_0x38ebc5[_0x8abb('0xc')]=_0x27b9f9;return rp(_0x38ebc5);})[_0x8abb('0xd')](function(_0x23d0d4){logger[_0x8abb('0x13')](_0x8abb('0x27'),_0x88b59[_0x8abb('0x28')]);if(_0x23d0d4[_0x8abb('0x29')][_0x8abb('0xf')]>0x0){var _0x5e6be0=_[_0x8abb('0x2a')](_0x23d0d4[_0x8abb('0x29')],function(_0x34097e){if(_0x34097e['work_number']===_0x88b59['contactNumber']||_0x34097e['mobile_number']===_0x88b59[_0x8abb('0x28')]){return _0x34097e;}});if(_0x5e6be0){_0x88b59['endUserId']=_0x5e6be0['id'];logger[_0x8abb('0x13')]('Contact\x20found:',_0x88b59[_0x8abb('0x2b')]);_0x238021(_0x88b59);}else{return createEndUser(_0x88b59,_0xb88cae,_0x27b9f9,_0x1a8705)[_0x8abb('0xd')](function(_0x354f6e){logger[_0x8abb('0x13')](_0x8abb('0x2c'),_0x88b59[_0x8abb('0x2b')]);_0x238021(_0x354f6e);});}}else{return createEndUser(_0x88b59,_0xb88cae,_0x27b9f9,_0x1a8705)[_0x8abb('0xd')](function(_0x46740b){logger['info'](_0x8abb('0x2c'),_0x88b59[_0x8abb('0x2b')]);_0x238021(_0x46740b);});}})[_0x8abb('0x16')](function(_0x2fc834){throw new Error(_0x2fc834['message']);});});};}function createEndUser(_0x5da202,_0x35bf93,_0x5cc28,_0x48e2c5){return new Promise(function(_0x3f9df6,_0x2938da){var _0x13d906=moment();var _0x38fdd6={'method':'POST','uri':_0x48e2c5+'/api/contacts','body':{'contact':{'last_name':_0x5da202[_0x8abb('0x28')],'work_number':_0x5da202[_0x8abb('0x28')],'mobile_number':_0x5da202[_0x8abb('0x28')],'owner_id':_0x5da202['userId'],'created_at':_0x13d906[_0x8abb('0x2d')](_0x8abb('0x2e'))}},'json':!![]};_0x38fdd6['headers']=_0x5cc28;logger['info'](_0x8abb('0x2f'));return rp(_0x38fdd6)[_0x8abb('0xd')](function(_0xd5c494){_0x5da202[_0x8abb('0x2b')]=_0xd5c494[_0x8abb('0x30')]['id'];_0x3f9df6(_0x5da202);})[_0x8abb('0x16')](function(_0xb935c0){logger[_0x8abb('0x17')]('['+[_0x35bf93[_0x8abb('0x18')]()]+']',_0xb935c0[_0x8abb('0x19')]);_0x2938da(_0xb935c0[_0x8abb('0x19')]);});});}function getTicket(_0xdf2f06,_0x18be63,_0x5c75a6,_0x18fbc2,_0x50b3fb){return function(_0xb126dc){logger[_0x8abb('0x13')](_0x8abb('0x31'));return new Promise(function(_0x1f7d3a,_0xd808d3){var _0x550757=moment();var _0x547bbf={'method':'POST','uri':_0x5c75a6+_0x8abb('0x32'),'body':{'title':intUtil[_0x8abb('0x33')](_0x18fbc2[_0x8abb('0x34')],_0x50b3fb,'\x20'),'description':intUtil[_0x8abb('0x33')](_0x18fbc2[_0x8abb('0x35')],_0x50b3fb,'\x0a'),'owner_id':_0xb126dc['userId'],'creater_id':_0xb126dc[_0x8abb('0x12')],'targetable_id':_0xb126dc[_0x8abb('0x2b')],'targetable_type':_0x8abb('0x36'),'created_at':_0x550757[_0x8abb('0x2d')](_0x8abb('0x2e')),'due_date':_0x550757[_0x8abb('0x37')](0x1e,'m')[_0x8abb('0x2d')](_0x8abb('0x2e'))},'json':!![]};_0x547bbf[_0x8abb('0xc')]=_0x18be63;return rp(_0x547bbf)['then'](function(_0x1d5e17){_0xb126dc[_0x8abb('0x38')]=_0x1d5e17[_0x8abb('0x39')]['id'];logger[_0x8abb('0x13')](_0x8abb('0x3a'),_0xb126dc[_0x8abb('0x38')]);_0x1f7d3a(_0xb126dc);})[_0x8abb('0x16')](function(_0x445a87){logger[_0x8abb('0x17')]('['+[_0xdf2f06[_0x8abb('0x18')]()]+']',_0x445a87['message']);_0xd808d3(_0x445a87[_0x8abb('0x19')]);});});};}function emit(_0x36d985,_0x177ac4,_0x5d9033){var _0x185527={'uri':_0x36d985+_0x8abb('0x3b')+_0x5d9033};io['to'](util['format']('user:%s',_0x177ac4))[_0x8abb('0x3c')](_0x8abb('0x3d'),_0x185527);}exports['cs']=function(_0x56debe,_0x577903,_0x4ca14c,_0x171880,_0x16a661,_0x56a814,_0x398f36,_0x203f19){var _0x4563fe={};var _0x1979a8={'Authorization':_0x8abb('0x3e')+_0x56a814[_0x8abb('0x3f')]};_0x56a814[_0x8abb('0x40')]=intUtil[_0x8abb('0x41')](_0x56a814[_0x8abb('0x40')]);_0x56a814[_0x8abb('0x42')]=intUtil['stripTrailingSlash'](_0x56a814[_0x8abb('0x42')]);var _0x5c9616=_0x56a814[_0x8abb('0x40')];_0x4563fe[_0x8abb('0x11')]=_0x56a814['username'];_0x4563fe[_0x8abb('0x28')]=_0x203f19[_0x8abb('0x43')]()===_0x8abb('0x44')?_0x577903[_0x8abb('0x45')]:_0x577903[_0x8abb('0x46')];_0x4563fe['callDirection']=_0x203f19==='queue'||_0x203f19==='abandoned'?'queue':_0x8abb('0x44');if(_0x171880){_0x4563fe['agentEmail']=_0x171880[_0x8abb('0x10')];}var _0x21d58f=util[_0x8abb('0x2d')](_0x8abb('0x47'),_0x56a814[_0x8abb('0x42')],_0x577903[_0x8abb('0x48')],md5(_0x577903[_0x8abb('0x48')]));if(_0x16a661&&_0x16a661['monitor_format']){logger[_0x8abb('0x13')](_0x8abb('0x49'),'Recording\x20is\x20enabled!');_0x577903[_0x8abb('0x4a')]=_0x21d58f;}else if(_0x398f36&&_0x398f36[_0x8abb('0x4b')]&&_0x398f36['recordingFormat']!==_0x8abb('0x4c')){logger[_0x8abb('0x13')](_0x8abb('0x4d'),'Recording\x20is\x20enabled!');_0x577903[_0x8abb('0x4a')]=_0x21d58f;}else{_0x577903[_0x8abb('0x4a')]='';}return getAdminId(_0x4563fe,_0x203f19,_0x1979a8,_0x5c9616)[_0x8abb('0xd')](getUser(_0x203f19,_0x1979a8,_0x5c9616))['then'](getEndUser(_0x203f19,_0x1979a8,_0x5c9616))[_0x8abb('0xd')](getTicket(_0x203f19,_0x1979a8,_0x5c9616,_0x4ca14c,_0x577903))[_0x8abb('0xd')](function(_0x37d5b0){logger[_0x8abb('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x37d5b0[_0x8abb('0x38')]));if(_0x203f19!==_0x8abb('0x4e')){logger['info']('['+[_0x203f19[_0x8abb('0x18')]()]+']',_0x8abb('0x4f'));emit(_0x5c9616,_0x171880[_0x8abb('0x23')],_0x37d5b0[_0x8abb('0x2b')]);}})[_0x8abb('0x16')](function(_0x2e9955){logger[_0x8abb('0x17')]('['+[_0x203f19[_0x8abb('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x8abb('0x50')](_0x2e9955,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x60c2=['contacts','find','work_number','endUserId','Contact\x20found:','Contact\x20created:','catch','POST','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects','Descriptions','Contact','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','adminEmail','username','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','moment','bluebird','ioredis','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','GET','headers','info','Getting\x20admin\x20information','then','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','error','message','Getting\x20user\x20list','users','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','userId','User\x20found:','toUpperCase','/api/contacts/filters','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber'];(function(_0x3c83ee,_0x37e4d0){var _0x3c898b=function(_0x447eb3){while(--_0x447eb3){_0x3c83ee['push'](_0x3c83ee['shift']());}};_0x3c898b(++_0x37e4d0);}(_0x60c2,0xe3));var _0x260c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x60c2[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x260c('0x0'));var rp=require(_0x260c('0x1'));var md5=require(_0x260c('0x2'));var util=require('util');var moment=require(_0x260c('0x3'));var Promise=require(_0x260c('0x4'));var Redis=require(_0x260c('0x5'));var intUtil=require('./util');var config=require(_0x260c('0x6'));var logger=require(_0x260c('0x7'))(_0x260c('0x8'));config[_0x260c('0x9')]=_[_0x260c('0xa')](config[_0x260c('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x260c('0x9')]));function getAdminId(_0x5ca5ad,_0x303394,_0x4ec806,_0x5dc0f8){return new Promise(function(_0x509e94,_0x14546e){var _0x30eea3=![];var _0x5c07d6={'method':_0x260c('0xb'),'uri':_0x5dc0f8+'/api/selector/owners','json':!![]};_0x5c07d6[_0x260c('0xc')]=_0x4ec806;logger[_0x260c('0xd')](_0x260c('0xe'));return rp(_0x5c07d6)[_0x260c('0xf')](function(_0xbcdc52){if(_0xbcdc52){var _0x234cd4=_0xbcdc52['users'];var _0x1ae616=null;for(_0x1ae616=0x0;_0x1ae616<_0x234cd4['length'];_0x1ae616++){if(_0x234cd4[_0x1ae616][_0x260c('0x10')]===_0x5ca5ad['adminEmail']){_0x5ca5ad[_0x260c('0x11')]=_0x234cd4[_0x1ae616]['id'];_0x30eea3=!![];}}if(_0x30eea3){logger['info'](_0x260c('0x12'),_0x5ca5ad[_0x260c('0x11')]);_0x509e94(_0x5ca5ad);}else{_0x14546e({'statusCode':0x194,'message':_0x260c('0x13')});}}else{_0x14546e({'statusCode':0x194,'message':_0x260c('0x13')});}})['catch'](function(_0xe5f57c){logger[_0x260c('0x14')]('['+[_0x303394['toUpperCase']()]+']',_0xe5f57c[_0x260c('0x15')]);_0x14546e(_0xe5f57c);});});}function getUser(_0x5c5961,_0xcf3770,_0x450bff){return function(_0x5bcab8){return new Promise(function(_0x2fee59,_0x4eebd4){var _0x89b823={'method':_0x260c('0xb'),'uri':_0x450bff+'/api/selector/owners','json':!![]};_0x89b823[_0x260c('0xc')]=_0xcf3770;logger['info'](_0x260c('0x16'));return rp(_0x89b823)[_0x260c('0xf')](function(_0x4f405e){if(_0x4f405e){var _0x22a375=_0x4f405e[_0x260c('0x17')];var _0x5d847e=![];var _0x25036f=null;if(_0x5bcab8['agentEmail']!==null){logger[_0x260c('0xd')](_0x260c('0x18'),_0x5bcab8[_0x260c('0x19')]);_0x5bcab8[_0x260c('0x1a')]=_0x5bcab8[_0x260c('0x19')];for(_0x25036f=0x0;_0x25036f<_0x22a375[_0x260c('0x1b')];_0x25036f++){if(_0x22a375[_0x25036f]['email']===_0x5bcab8[_0x260c('0x19')]){_0x5d847e=!![];_0x5bcab8[_0x260c('0x1c')]=_0x22a375[_0x25036f]['id'];logger[_0x260c('0xd')](_0x260c('0x1d'),_0x5bcab8[_0x260c('0x1c')]);}}}if(!_0x5d847e){logger[_0x260c('0xd')]('Admin\x20selected');_0x5bcab8['userEmail']=_0x5bcab8['adminEmail'];_0x5bcab8['userId']=_0x5bcab8[_0x260c('0x11')];_0x5d847e=!![];}if(_0x5d847e){_0x2fee59(_0x5bcab8);}else{_0x4eebd4({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x4eebd4({'statusCode':0x194,'message':_0x260c('0x13')});}})['catch'](function(_0x56fd51){logger[_0x260c('0x14')]('['+[_0x5c5961[_0x260c('0x1e')]()]+']',_0x56fd51[_0x260c('0x15')]);_0x4eebd4(_0x56fd51);});});};}function getEndUser(_0x33e06c,_0x5aec15,_0x3713a8){return function(_0x17f09a){return new Promise(function(_0x55b63b,_0x381109){var _0x42a5a5=0x0;var _0x23e487={'method':'GET','uri':_0x3713a8+_0x260c('0x1f'),'json':!![]};_0x23e487[_0x260c('0xc')]=_0x5aec15;logger[_0x260c('0xd')]('Getting\x20contacts\x20filter');return rp(_0x23e487)[_0x260c('0xf')](function(_0x1fd0b2){_0x1fd0b2[_0x260c('0x20')][_0x260c('0x21')](function(_0x50d778){if(_0x50d778[_0x260c('0x22')]===_0x260c('0x23')){_0x42a5a5=_0x50d778['id'];}});})[_0x260c('0xf')](function(){logger[_0x260c('0xd')](_0x260c('0x24'));var _0xf20171={'method':_0x260c('0xb'),'uri':_0x3713a8+_0x260c('0x25')+_0x42a5a5,'json':!![]};_0xf20171['headers']=_0x5aec15;return rp(_0xf20171);})['then'](function(_0x4f649c){logger[_0x260c('0xd')](_0x260c('0x26'),_0x17f09a[_0x260c('0x27')]);if(_0x4f649c[_0x260c('0x28')][_0x260c('0x1b')]>0x0){var _0x2cd3e7=_[_0x260c('0x29')](_0x4f649c[_0x260c('0x28')],function(_0x2434f5){if(_0x2434f5[_0x260c('0x2a')]===_0x17f09a[_0x260c('0x27')]||_0x2434f5['mobile_number']===_0x17f09a[_0x260c('0x27')]){return _0x2434f5;}});if(_0x2cd3e7){_0x17f09a[_0x260c('0x2b')]=_0x2cd3e7['id'];logger[_0x260c('0xd')](_0x260c('0x2c'),_0x17f09a[_0x260c('0x2b')]);_0x55b63b(_0x17f09a);}else{return createEndUser(_0x17f09a,_0x33e06c,_0x5aec15,_0x3713a8)['then'](function(_0x41a902){logger[_0x260c('0xd')](_0x260c('0x2d'),_0x17f09a[_0x260c('0x2b')]);_0x55b63b(_0x41a902);});}}else{return createEndUser(_0x17f09a,_0x33e06c,_0x5aec15,_0x3713a8)['then'](function(_0x1e8243){logger[_0x260c('0xd')](_0x260c('0x2d'),_0x17f09a['endUserId']);_0x55b63b(_0x1e8243);});}})[_0x260c('0x2e')](function(_0x27cb6b){throw new Error(_0x27cb6b[_0x260c('0x15')]);});});};}function createEndUser(_0x5d2663,_0x94308b,_0x4dd3b5,_0x508d6d){return new Promise(function(_0x53b98b,_0x1f091e){var _0x13a50c=moment();var _0xb9c2fb={'method':_0x260c('0x2f'),'uri':_0x508d6d+_0x260c('0x30'),'body':{'contact':{'last_name':_0x5d2663['contactNumber'],'work_number':_0x5d2663['contactNumber'],'mobile_number':_0x5d2663[_0x260c('0x27')],'owner_id':_0x5d2663[_0x260c('0x1c')],'created_at':_0x13a50c[_0x260c('0x31')](_0x260c('0x32'))}},'json':!![]};_0xb9c2fb[_0x260c('0xc')]=_0x4dd3b5;logger[_0x260c('0xd')](_0x260c('0x33'));return rp(_0xb9c2fb)[_0x260c('0xf')](function(_0x23fc2c){_0x5d2663[_0x260c('0x2b')]=_0x23fc2c[_0x260c('0x34')]['id'];_0x53b98b(_0x5d2663);})[_0x260c('0x2e')](function(_0x34fc1c){logger[_0x260c('0x14')]('['+[_0x94308b[_0x260c('0x1e')]()]+']',_0x34fc1c[_0x260c('0x15')]);_0x1f091e(_0x34fc1c[_0x260c('0x15')]);});});}function getTicket(_0xc9fff4,_0x32dcb1,_0x1b53fb,_0x4e91bb,_0x428d31){return function(_0x3d5ee7){logger[_0x260c('0xd')]('Creating\x20new\x20task');return new Promise(function(_0x5e3eb7,_0x56255a){var _0xa6407e=moment();var _0x19104e={'method':_0x260c('0x2f'),'uri':_0x1b53fb+_0x260c('0x35'),'body':{'title':intUtil[_0x260c('0x36')](_0x4e91bb[_0x260c('0x37')],_0x428d31,'\x20'),'description':intUtil[_0x260c('0x36')](_0x4e91bb[_0x260c('0x38')],_0x428d31,'\x0a'),'owner_id':_0x3d5ee7['userId'],'creater_id':_0x3d5ee7[_0x260c('0x11')],'targetable_id':_0x3d5ee7[_0x260c('0x2b')],'targetable_type':_0x260c('0x39'),'created_at':_0xa6407e['format'](_0x260c('0x32')),'due_date':_0xa6407e['add'](0x1e,'m')[_0x260c('0x31')](_0x260c('0x32'))},'json':!![]};_0x19104e[_0x260c('0xc')]=_0x32dcb1;return rp(_0x19104e)[_0x260c('0xf')](function(_0x2c54bd){_0x3d5ee7[_0x260c('0x3a')]=_0x2c54bd['task']['id'];logger[_0x260c('0xd')](_0x260c('0x3b'),_0x3d5ee7[_0x260c('0x3a')]);_0x5e3eb7(_0x3d5ee7);})[_0x260c('0x2e')](function(_0x585326){logger[_0x260c('0x14')]('['+[_0xc9fff4[_0x260c('0x1e')]()]+']',_0x585326[_0x260c('0x15')]);_0x56255a(_0x585326[_0x260c('0x15')]);});});};}function emit(_0x5eae62,_0x328b24,_0x258574){var _0x21d7a0={'uri':_0x5eae62+_0x260c('0x3c')+_0x258574};io['to'](util[_0x260c('0x31')](_0x260c('0x3d'),_0x328b24))[_0x260c('0x3e')](_0x260c('0x3f'),_0x21d7a0);}exports['cs']=function(_0xd9d8e,_0x71a086,_0x4f3573,_0x1d5b75,_0x2e7222,_0x5340af,_0x40a834,_0x24e98b){var _0x49d1bb={};var _0x375fe1={'Authorization':_0x260c('0x40')+_0x5340af[_0x260c('0x41')]};_0x5340af[_0x260c('0x42')]=intUtil[_0x260c('0x43')](_0x5340af[_0x260c('0x42')]);_0x5340af[_0x260c('0x44')]=intUtil['stripTrailingSlash'](_0x5340af['serverUrl']);var _0x2378e8=_0x5340af[_0x260c('0x42')];_0x49d1bb[_0x260c('0x45')]=_0x5340af[_0x260c('0x46')];_0x49d1bb['contactNumber']=_0x24e98b[_0x260c('0x47')]()===_0x260c('0x48')?_0x71a086[_0x260c('0x49')]:_0x71a086[_0x260c('0x4a')];_0x49d1bb[_0x260c('0x4b')]=_0x24e98b===_0x260c('0x4c')||_0x24e98b===_0x260c('0x4d')?_0x260c('0x4c'):'outbound';if(_0x1d5b75){_0x49d1bb[_0x260c('0x19')]=_0x1d5b75[_0x260c('0x10')];}var _0x3d261e=util[_0x260c('0x31')](_0x260c('0x4e'),_0x5340af['serverUrl'],_0x71a086['uniqueid'],md5(_0x71a086[_0x260c('0x4f')]));if(_0x2e7222&&_0x2e7222[_0x260c('0x50')]){logger['info'](_0x260c('0x51'),_0x260c('0x52'));_0x71a086[_0x260c('0x53')]=_0x3d261e;}else if(_0x40a834&&_0x40a834['recordingFormat']&&_0x40a834[_0x260c('0x54')]!=='none'){logger['info'](_0x260c('0x55'),'Recording\x20is\x20enabled!');_0x71a086[_0x260c('0x53')]=_0x3d261e;}else{_0x71a086[_0x260c('0x53')]='';}return getAdminId(_0x49d1bb,_0x24e98b,_0x375fe1,_0x2378e8)[_0x260c('0xf')](getUser(_0x24e98b,_0x375fe1,_0x2378e8))['then'](getEndUser(_0x24e98b,_0x375fe1,_0x2378e8))[_0x260c('0xf')](getTicket(_0x24e98b,_0x375fe1,_0x2378e8,_0x4f3573,_0x71a086))[_0x260c('0xf')](function(_0x4efd54){logger[_0x260c('0xd')](util[_0x260c('0x31')]('The\x20ticket\x20ID\x20is:\x20%s',_0x4efd54[_0x260c('0x3a')]));if(_0x24e98b!==_0x260c('0x4d')){logger[_0x260c('0xd')]('['+[_0x24e98b['toUpperCase']()]+']',_0x260c('0x56'));emit(_0x2378e8,_0x1d5b75[_0x260c('0x22')],_0x4efd54['endUserId']);}})[_0x260c('0x2e')](function(_0x282e8f){logger['error']('['+[_0x24e98b['toUpperCase']()]+_0x260c('0x57'),util[_0x260c('0x58')](_0x282e8f,{'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 ff8dadf..d729b6a 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 _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x2186e9,_0x17270a){var _0x5c9f87=function(_0x83b7c3){while(--_0x83b7c3){_0x2186e9['push'](_0x2186e9['shift']());}};_0x5c9f87(++_0x17270a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x61f794,_0x3f61b0){var _0x4a2d1d=function(_0x484dfb){while(--_0x484dfb){_0x61f794['push'](_0x61f794['shift']());}};_0x4a2d1d(++_0x3f61b0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ 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 09770bc..d726397 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 _0x6555=['resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','Contact','Lead','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','upperFirst','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','Fields','queue','[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','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','recordingFormat','none','[OUTBOUND]','format','destcalleridname','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]','lodash','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','utc','Subjects','getString','Descriptions','Case','create','isNil','sobject','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.'];(function(_0x112591,_0xb9902a){var _0x423ec3=function(_0x3fc772){while(--_0x3fc772){_0x112591['push'](_0x112591['shift']());}};_0x423ec3(++_0xb9902a);}(_0x6555,0x18f));var _0x5655=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6555[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5655('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5655('0x1'));var md5=require(_0x5655('0x2'));var jsforce=require(_0x5655('0x3'));var util=require(_0x5655('0x4'));var Redis=require(_0x5655('0x5'));var intUtil=require(_0x5655('0x6'));var config=require(_0x5655('0x7'));var logger=require(_0x5655('0x8'))(_0x5655('0x9'));config[_0x5655('0xa')]=_[_0x5655('0xb')](config[_0x5655('0xa')],{'host':_0x5655('0xc'),'port':0x18eb});var io=require(_0x5655('0xd'))(new Redis(config['redis']));function emit(_0x38b3f0,_0x4463f5,_0x49dbc9){io['to'](_0x38b3f0)[_0x5655('0xe')](_0x4463f5,_0x49dbc9);}function getTicket(_0x1bc47a,_0x876790,_0x7cee4a,_0x5442c6,_0xa25e40,_0x213af1,_0x3a54fa,_0x3a4bd1){var _0x32d3d8={};if(_0x5442c6[_0x5655('0xf')]===_0x5655('0x10')){_0x32d3d8=Object['assign']({},{'OwnerId':_0x876790['id'],'ActivityDate':moment[_0x5655('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x5442c6[_0x5655('0x12')],_0xa25e40,'\x20'),'Description':intUtil[_0x5655('0x13')](_0x5442c6[_0x5655('0x14')],_0xa25e40,'\x0a')},getCustomFields(_0x213af1,_0xa25e40));if(_0x7cee4a){_0x32d3d8['WhoId']=_0x7cee4a['id'];}}else if(_0x5442c6[_0x5655('0xf')]===_0x5655('0x15')){_0x32d3d8=Object['assign']({},{'OwnerId':_0x876790['id'],'Subject':intUtil[_0x5655('0x13')](_0x5442c6[_0x5655('0x12')],_0xa25e40,'\x20'),'Description':intUtil['getString'](_0x5442c6[_0x5655('0x14')],_0xa25e40,'\x0a')},getCustomFields(_0x213af1,_0xa25e40));if(_0x7cee4a){_0x32d3d8['ContactId']=_0x7cee4a['id'];}}return _0x3a54fa['sobject'](_0x5442c6[_0x5655('0xf')])[_0x5655('0x16')](_0x32d3d8);}function getUser(_0x59ffb9,_0x49879b,_0x5d4358){if(!_[_0x5655('0x17')](_0x49879b)&&intUtil['validateEmail'](_0x49879b)){var _0x3f15ec={'Email':_0x49879b};var _0xc24ff2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5d4358[_0x5655('0x18')](_0x5655('0x19'))[_0x5655('0x1a')](_0x3f15ec,_0xc24ff2)[_0x5655('0x1b')]()[_0x5655('0x1c')](function(_0x1e3625){if(_0x1e3625[_0x5655('0x1d')]){var _0x18b5ee=_[_0x5655('0x1a')](_0x1e3625,function(_0x4efd3b){return _0x4efd3b[_0x5655('0x1e')]===_0x49879b;});if(_0x18b5ee){logger[_0x5655('0x1f')](_0x5655('0x20'),_0x49879b);return BPromise[_0x5655('0x21')]({'id':_0x18b5ee['Id'],'name':_0x18b5ee[_0x5655('0x22')]});}}else{logger['info'](_0x5655('0x23'),_0x49879b);return _0x5d4358[_0x5655('0x24')]()[_0x5655('0x1c')](function(_0x3816d3){return BPromise[_0x5655('0x21')]({'id':_0x3816d3[_0x5655('0x25')],'name':_0x3816d3[_0x5655('0x26')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x49879b);return _0x5d4358[_0x5655('0x24')]()[_0x5655('0x1c')](function(_0x225c47){return BPromise[_0x5655('0x21')]({'id':_0x225c47[_0x5655('0x25')],'name':_0x225c47[_0x5655('0x26')]});});}}function getEndUser(_0x5a24e0,_0x22847c,_0x45b081,_0x26b565,_0x46e3e4){var _0x2b8e95={'Phone':_0x26b565};var _0x8c7a2f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5655('0x21')]()[_0x5655('0x1c')](function(){if(_0x22847c[_0x5655('0xf')]===_0x5655('0x10')){logger[_0x5655('0x1f')](_0x5655('0x27'),_0x26b565,_0x22847c['moduleSearch']);switch(_0x22847c[_0x5655('0x28')]){case'contact_lead':return _0x46e3e4[_0x5655('0x18')](_0x5655('0x29'))[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f)[_0x5655('0x1b')]()['then'](function(_0x29ea12){if(_0x29ea12&&_0x29ea12[_0x5655('0x1d')]){return _0x29ea12;}else{return _0x46e3e4[_0x5655('0x18')](_0x5655('0x2a'))[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f);}});case _0x5655('0x2b'):return _0x46e3e4[_0x5655('0x18')](_0x5655('0x29'))['find'](_0x2b8e95,_0x8c7a2f)[_0x5655('0x1b')]();case'lead':return _0x46e3e4[_0x5655('0x18')]('Lead')[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f);default:return null;}}else if(_0x22847c[_0x5655('0xf')]===_0x5655('0x15')){logger[_0x5655('0x1f')](_0x5655('0x27'),_0x26b565,'contact');return _0x46e3e4['sobject'](_0x5655('0x29'))[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f)[_0x5655('0x1b')]();}})[_0x5655('0x1c')](function(_0x21b934){if(_0x21b934&&_0x21b934[_0x5655('0x1d')]){var _0xd333d1=_[_0x5655('0x1a')](_0x21b934,function(_0x4a9df8){return _0x4a9df8[_0x5655('0x2c')]===_0x26b565;});if(_0xd333d1){return BPromise[_0x5655('0x21')]({'id':_0xd333d1['Id'],'name':_0xd333d1[_0x5655('0x22')],'phone':_0xd333d1[_0x5655('0x2c')]});}}})[_0x5655('0x1c')](function(_0x5067cf){if(_0x5067cf){logger[_0x5655('0x1f')](_0x5655('0x2d'),_0x26b565);return BPromise['resolve'](_0x5067cf);}else{logger[_0x5655('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x26b565);var _0x1f5576={'LastName':_0x45b081!==_0x5655('0x2e')?_0x45b081:util['format'](_0x5655('0x2f'),_0x26b565),'Phone':_0x26b565};if(_0x22847c[_0x5655('0x30')]){if(_0x22847c[_0x5655('0x30')]===_0x5655('0x2b')){logger[_0x5655('0x1f')](_0x5655('0x31'),_0x26b565,_0x22847c['moduleCreate']);}else if(_0x22847c[_0x5655('0x30')]===_0x5655('0x32')&&_0x22847c[_0x5655('0xf')]==='Task'){logger[_0x5655('0x1f')](_0x5655('0x31'),_0x26b565,_0x22847c[_0x5655('0x30')]);_0x1f5576[_0x5655('0x33')]=_0x5655('0x34');}else{return null;}}return _0x46e3e4[_0x5655('0x18')](_[_0x5655('0x35')](_0x22847c[_0x5655('0x30')]))[_0x5655('0x16')](_0x1f5576);}});}function getCustomFields(_0x2f7170,_0x4bf0ca){var _0x5aba11={};if(_0x2f7170[_0x5655('0x1d')]>0x0){_['forEach'](_0x2f7170,function(_0x582e69){if(_0x582e69[_0x5655('0x36')]===_0x5655('0x37')&&_0x582e69['idField']){_0x5aba11[_0x582e69[_0x5655('0x38')]]=_0x582e69['content'][_0x5655('0x39')]();}else if(_0x582e69[_0x5655('0x36')]===_0x5655('0x3a')&&_0x582e69[_0x5655('0x3b')]&&_0x582e69['idField']){_0x4bf0ca[_0x582e69[_0x5655('0x3b')]]&&(_0x5aba11[_0x582e69[_0x5655('0x38')]]=_0x4bf0ca[_0x582e69[_0x5655('0x3b')]][_0x5655('0x39')]());}else if(_0x582e69[_0x5655('0x36')]===_0x5655('0x3c')&&_0x582e69['Variable']&&_0x582e69[_0x5655('0x3d')][_0x5655('0x3e')]&&_0x582e69[_0x5655('0x38')]){_0x4bf0ca[_0x582e69[_0x5655('0x3d')][_0x5655('0x3e')][_0x5655('0x3f')]()]&&(_0x5aba11[_0x582e69[_0x5655('0x38')]]=_0x4bf0ca[_0x582e69[_0x5655('0x3d')][_0x5655('0x3e')][_0x5655('0x3f')]()][_0x5655('0x39')]());}});}return _0x5aba11;}function getConnection(_0x2a027d){var _0xac8e43=_0x2a027d[_0x5655('0x40')][_0x5655('0x41')](_0x2a027d[_0x5655('0x42')]);var _0x124962=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2a027d[_0x5655('0x43')]||_0x5655('0x44'),'clientId':_0x2a027d['clientId'],'clientSecret':_0x2a027d[_0x5655('0x45')]}});return _0x124962[_0x5655('0x46')](_0x2a027d[_0x5655('0x47')],_0xac8e43)[_0x5655('0x1c')](function(){logger[_0x5655('0x1f')](_0x5655('0x48'));return _0x124962;});}exports['queue']=function(_0x37b643,_0x2e9ba8,_0x4f71e0,_0x581b27,_0x5a6d14,_0x4d35be){var _0x3f03e9,_0x3ce948,_0xeca7bd,_0x2747e8;_0x4d35be[_0x5655('0x49')]=intUtil[_0x5655('0x4a')](_0x4d35be['serverUrl']);_0x4d35be[_0x5655('0x43')]=intUtil['stripTrailingSlash'](_0x4d35be[_0x5655('0x43')]);if(_0x5a6d14&&_0x5a6d14[_0x5655('0x4b')]){logger[_0x5655('0x1f')]('[QUEUE]',_0x5655('0x4c'));_0x2e9ba8['recordingURL']=util['format'](_0x5655('0x4d'),_0x4d35be[_0x5655('0x49')],_0x2e9ba8[_0x5655('0x4e')],md5(_0x2e9ba8[_0x5655('0x4e')]));}else{_0x2e9ba8[_0x5655('0x4f')]='';}return getConnection(_0x4d35be)[_0x5655('0x1c')](function(_0x3ec4ad){_0x2747e8=_0x3ec4ad;return getUser(_0x4d35be,_0x581b27[_0x5655('0x50')],_0x2747e8);})[_0x5655('0x1c')](function(_0x4695ac){_0x3f03e9=_0x4695ac;return getEndUser(_0x4d35be,_0x4f71e0,_0x2e9ba8[_0x5655('0x51')],_0x2e9ba8['calleridnum'],_0x2747e8);})['then'](function(_0x35effb){_0x3ce948=_0x35effb;return getTicket(_0x4d35be,_0x3f03e9,_0x3ce948,_0x4f71e0,_0x2e9ba8,_0x4f71e0[_0x5655('0x52')],_0x2747e8,_0x5655('0x53'));})['then'](function(_0x4f92f7){_0xeca7bd=_0x4f92f7;logger[_0x5655('0x1f')](_0x5655('0x54'),_0xeca7bd['id']);logger[_0x5655('0x1f')](_0x5655('0x55'),_0xeca7bd['id'],_0x581b27['name'],_0x4d35be[_0x5655('0x36')]);switch(_0x4d35be[_0x5655('0x36')]){case _0x5655('0x56'):emit(util['format'](_0x5655('0x57'),_0x581b27[_0x5655('0x3e')]),_0x5655('0x58'),{'recordId':_0xeca7bd['id']});break;case _0x5655('0x59'):emit(util['format']('user:%s',_0x581b27[_0x5655('0x3e')]),_0x5655('0x5a'),{'uri':util['format'](_0x5655('0x5b'),_0x2747e8['instanceUrl'],_0xeca7bd['id'])});break;default:logger[_0x5655('0x5c')](_0x5655('0x5d'));}})[_0x5655('0x5e')](function(_0x4ce242){logger[_0x5655('0x5c')]('[QUEUE]',JSON[_0x5655('0x5f')](_0x4ce242));});};exports['outbound']=function(_0x3dffe5,_0x3c61ca,_0x285428,_0x1813a2,_0x2c3de6,_0x15e44b,_0x3786bf){var _0x5f47b5,_0x249373,_0x245bf5,_0xf22ebb;_0x15e44b['serverUrl']=intUtil[_0x5655('0x4a')](_0x15e44b[_0x5655('0x49')]);_0x15e44b[_0x5655('0x43')]=intUtil[_0x5655('0x4a')](_0x15e44b[_0x5655('0x43')]);if(_0x3786bf&&_0x3786bf[_0x5655('0x60')]&&_0x3786bf[_0x5655('0x60')]!==_0x5655('0x61')){logger[_0x5655('0x1f')](_0x5655('0x62'),_0x5655('0x4c'));_0x3c61ca[_0x5655('0x4f')]=util[_0x5655('0x63')](_0x5655('0x4d'),_0x15e44b['serverUrl'],_0x3c61ca['uniqueid'],md5(_0x3c61ca[_0x5655('0x4e')]));}return getConnection(_0x15e44b)['then'](function(_0x3b6fa7){_0xf22ebb=_0x3b6fa7;return getUser(_0x15e44b,_0x1813a2[_0x5655('0x50')],_0xf22ebb);})['then'](function(_0x3dcd17){_0x5f47b5=_0x3dcd17;return getEndUser(_0x15e44b,_0x285428,_0x3c61ca[_0x5655('0x64')],_0x3c61ca['destcalleridnum'],_0xf22ebb);})[_0x5655('0x1c')](function(_0x7bdc13){_0x249373=_0x7bdc13;return getTicket(_0x15e44b,_0x5f47b5,_0x249373,_0x285428,_0x3c61ca,_0x285428[_0x5655('0x52')],_0xf22ebb,_0x5655('0x65'));})[_0x5655('0x1c')](function(_0x2c4b20){_0x245bf5=_0x2c4b20;logger[_0x5655('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x245bf5['id']);logger[_0x5655('0x1f')](_0x5655('0x66'),_0x245bf5['id'],_0x1813a2['name'],_0x15e44b[_0x5655('0x36')]);switch(_0x15e44b[_0x5655('0x36')]){case _0x5655('0x56'):emit(util[_0x5655('0x63')](_0x5655('0x57'),_0x1813a2[_0x5655('0x3e')]),'trigger:salesforce:display',{'recordId':_0x245bf5['id']});break;case _0x5655('0x59'):emit(util[_0x5655('0x63')](_0x5655('0x57'),_0x1813a2['name']),_0x5655('0x5a'),{'uri':util[_0x5655('0x63')](_0x5655('0x5b'),_0xf22ebb['instanceUrl'],_0x245bf5['id'])});break;default:logger[_0x5655('0x5c')](_0x5655('0x62'),_0x5655('0x67'));}})['catch'](function(_0x31e09c){logger[_0x5655('0x5c')](_0x5655('0x62'),JSON[_0x5655('0x5f')](_0x31e09c));});};exports[_0x5655('0x68')]=function(_0x20b958,_0x4278bf,_0x5aa626,_0x1bf5cf,_0x2c1d2b,_0x526ac5){var _0x40ab9a,_0x2e99c3,_0x488d92,_0x345d93;_0x526ac5['serverUrl']=intUtil[_0x5655('0x4a')](_0x526ac5['serverUrl']);_0x526ac5[_0x5655('0x43')]=intUtil[_0x5655('0x4a')](_0x526ac5['remoteUri']);if(_0x2c1d2b&&_0x2c1d2b[_0x5655('0x4b')]){logger[_0x5655('0x1f')]('[ABANDONED]',_0x5655('0x4c'));_0x4278bf[_0x5655('0x4f')]=util[_0x5655('0x63')](_0x5655('0x4d'),_0x526ac5['serverUrl'],_0x4278bf[_0x5655('0x4e')],md5(_0x4278bf[_0x5655('0x4e')]));}else{_0x4278bf['recordingURL']='';}return getConnection(_0x526ac5)['then'](function(_0x12c316){_0x345d93=_0x12c316;if(!_[_0x5655('0x17')](_0x1bf5cf)){return getUser(_0x526ac5,_0x1bf5cf[_0x5655('0x3e')],_0x345d93);}else{return getUser(_0x526ac5,null,_0x345d93);}})[_0x5655('0x1c')](function(_0xa3c260){_0x40ab9a=_0xa3c260;return getEndUser(_0x526ac5,_0x5aa626,_0x4278bf[_0x5655('0x51')],_0x4278bf[_0x5655('0x69')],_0x345d93);})[_0x5655('0x1c')](function(_0x5cb728){_0x2e99c3=_0x5cb728;return getTicket(_0x526ac5,_0x40ab9a,_0x2e99c3,_0x5aa626,_0x4278bf,_0x5aa626['Fields'],_0x345d93);})['then'](function(_0x1b75bc){_0x488d92=_0x1b75bc;logger[_0x5655('0x1f')](_0x5655('0x6a'),_0x488d92['id']);logger[_0x5655('0x1f')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x526ac5[_0x5655('0x36')]);})[_0x5655('0x5e')](function(_0x226d00){logger[_0x5655('0x5c')](_0x5655('0x6b'),JSON[_0x5655('0x5f')](_0x226d00));});}; \ No newline at end of file +var _0x8f5f=['defaults','localhost','socket.io-emitter','emit','ticketType','Task','assign','utc','Subjects','getString','Descriptions','ContactId','sobject','create','isNil','validateEmail','User','find','execute','then','length','info','Agent\x20%s\x20found.','resolve','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','lead','Case','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','forEach','type','string','variable','variableName','idField','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','instanceUrl','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','catch','abandoned','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis'];(function(_0x134527,_0x45f6cc){var _0x2ee10d=function(_0xa340f9){while(--_0xa340f9){_0x134527['push'](_0x134527['shift']());}};_0x2ee10d(++_0x45f6cc);}(_0x8f5f,0x67));var _0xf8f5=function(_0x257495,_0x18269b){_0x257495=_0x257495-0x0;var _0x3849aa=_0x8f5f[_0x257495];return _0x3849aa;};'use strict';var _=require('lodash');var rp=require(_0xf8f5('0x0'));var moment=require(_0xf8f5('0x1'));var BPromise=require(_0xf8f5('0x2'));var md5=require(_0xf8f5('0x3'));var jsforce=require('jsforce');var util=require(_0xf8f5('0x4'));var Redis=require(_0xf8f5('0x5'));var intUtil=require(_0xf8f5('0x6'));var config=require(_0xf8f5('0x7'));var logger=require(_0xf8f5('0x8'))('salesforce');config[_0xf8f5('0x9')]=_[_0xf8f5('0xa')](config[_0xf8f5('0x9')],{'host':_0xf8f5('0xb'),'port':0x18eb});var io=require(_0xf8f5('0xc'))(new Redis(config[_0xf8f5('0x9')]));function emit(_0x4ac15d,_0x95f82c,_0x120c17){io['to'](_0x4ac15d)[_0xf8f5('0xd')](_0x95f82c,_0x120c17);}function getTicket(_0x50316f,_0x462729,_0x1c4b9b,_0x4e6809,_0x5ef9ab,_0x1929e1,_0x659112,_0x2ea389){var _0x4cdc15={};if(_0x4e6809[_0xf8f5('0xe')]===_0xf8f5('0xf')){_0x4cdc15=Object[_0xf8f5('0x10')]({},{'OwnerId':_0x462729['id'],'ActivityDate':moment[_0xf8f5('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x4e6809[_0xf8f5('0x12')],_0x5ef9ab,'\x20'),'Description':intUtil[_0xf8f5('0x13')](_0x4e6809[_0xf8f5('0x14')],_0x5ef9ab,'\x0a')},getCustomFields(_0x1929e1,_0x5ef9ab));if(_0x1c4b9b){_0x4cdc15['WhoId']=_0x1c4b9b['id'];}}else if(_0x4e6809[_0xf8f5('0xe')]==='Case'){_0x4cdc15=Object['assign']({},{'OwnerId':_0x462729['id'],'Subject':intUtil[_0xf8f5('0x13')](_0x4e6809[_0xf8f5('0x12')],_0x5ef9ab,'\x20'),'Description':intUtil[_0xf8f5('0x13')](_0x4e6809[_0xf8f5('0x14')],_0x5ef9ab,'\x0a')},getCustomFields(_0x1929e1,_0x5ef9ab));if(_0x1c4b9b){_0x4cdc15[_0xf8f5('0x15')]=_0x1c4b9b['id'];}}return _0x659112[_0xf8f5('0x16')](_0x4e6809[_0xf8f5('0xe')])[_0xf8f5('0x17')](_0x4cdc15);}function getUser(_0x1b9f3e,_0x4c15f3,_0x13ae07){if(!_[_0xf8f5('0x18')](_0x4c15f3)&&intUtil[_0xf8f5('0x19')](_0x4c15f3)){var _0x3cc250={'Email':_0x4c15f3};var _0x193a8e={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x13ae07[_0xf8f5('0x16')](_0xf8f5('0x1a'))[_0xf8f5('0x1b')](_0x3cc250,_0x193a8e)[_0xf8f5('0x1c')]()[_0xf8f5('0x1d')](function(_0x34e9e4){if(_0x34e9e4[_0xf8f5('0x1e')]){var _0x252747=_['find'](_0x34e9e4,function(_0x20b918){return _0x20b918['Email']===_0x4c15f3;});if(_0x252747){logger[_0xf8f5('0x1f')](_0xf8f5('0x20'),_0x4c15f3);return BPromise['resolve']({'id':_0x252747['Id'],'name':_0x252747['Name']});}}else{logger[_0xf8f5('0x1f')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4c15f3);return _0x13ae07['identity']()['then'](function(_0x10a62a){return BPromise[_0xf8f5('0x21')]({'id':_0x10a62a[_0xf8f5('0x22')],'name':_0x10a62a[_0xf8f5('0x23')]});});}});}else{logger[_0xf8f5('0x1f')](_0xf8f5('0x24'),_0x4c15f3);return _0x13ae07[_0xf8f5('0x25')]()['then'](function(_0x32f167){return BPromise[_0xf8f5('0x21')]({'id':_0x32f167[_0xf8f5('0x22')],'name':_0x32f167[_0xf8f5('0x23')]});});}}function getEndUser(_0x255ed8,_0x4c4d38,_0x44367a,_0xf22128,_0x489560){var _0x2ff31d={'Phone':_0xf22128};var _0x50f04e={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xf8f5('0x21')]()[_0xf8f5('0x1d')](function(){if(_0x4c4d38['ticketType']===_0xf8f5('0xf')){logger['info'](_0xf8f5('0x26'),_0xf22128,_0x4c4d38[_0xf8f5('0x27')]);switch(_0x4c4d38['moduleSearch']){case _0xf8f5('0x28'):return _0x489560['sobject'](_0xf8f5('0x29'))['find'](_0x2ff31d,_0x50f04e)['execute']()[_0xf8f5('0x1d')](function(_0x288f35){if(_0x288f35&&_0x288f35[_0xf8f5('0x1e')]){return _0x288f35;}else{return _0x489560[_0xf8f5('0x16')]('Lead')[_0xf8f5('0x1b')](_0x2ff31d,_0x50f04e);}});case'contact':return _0x489560[_0xf8f5('0x16')](_0xf8f5('0x29'))[_0xf8f5('0x1b')](_0x2ff31d,_0x50f04e)[_0xf8f5('0x1c')]();case _0xf8f5('0x2a'):return _0x489560['sobject']('Lead')[_0xf8f5('0x1b')](_0x2ff31d,_0x50f04e);default:return null;}}else if(_0x4c4d38[_0xf8f5('0xe')]===_0xf8f5('0x2b')){logger[_0xf8f5('0x1f')](_0xf8f5('0x26'),_0xf22128,_0xf8f5('0x2c'));return _0x489560['sobject'](_0xf8f5('0x29'))['find'](_0x2ff31d,_0x50f04e)[_0xf8f5('0x1c')]();}})[_0xf8f5('0x1d')](function(_0x47f14e){if(_0x47f14e&&_0x47f14e[_0xf8f5('0x1e')]){var _0x2dd502=_[_0xf8f5('0x1b')](_0x47f14e,function(_0x1a4336){return _0x1a4336['Phone']===_0xf22128;});if(_0x2dd502){return BPromise[_0xf8f5('0x21')]({'id':_0x2dd502['Id'],'name':_0x2dd502['Name'],'phone':_0x2dd502[_0xf8f5('0x2d')]});}}})[_0xf8f5('0x1d')](function(_0x2733e6){if(_0x2733e6){logger['info'](_0xf8f5('0x2e'),_0xf22128);return BPromise[_0xf8f5('0x21')](_0x2733e6);}else{logger[_0xf8f5('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0xf22128);var _0x11657a={'LastName':_0x44367a!==_0xf8f5('0x2f')?_0x44367a:util[_0xf8f5('0x30')](_0xf8f5('0x31'),_0xf22128),'Phone':_0xf22128};if(_0x4c4d38[_0xf8f5('0x32')]){if(_0x4c4d38[_0xf8f5('0x32')]===_0xf8f5('0x2c')){logger[_0xf8f5('0x1f')](_0xf8f5('0x33'),_0xf22128,_0x4c4d38[_0xf8f5('0x32')]);}else if(_0x4c4d38[_0xf8f5('0x32')]===_0xf8f5('0x2a')&&_0x4c4d38[_0xf8f5('0xe')]==='Task'){logger[_0xf8f5('0x1f')](_0xf8f5('0x33'),_0xf22128,_0x4c4d38[_0xf8f5('0x32')]);_0x11657a[_0xf8f5('0x34')]=_0xf8f5('0x35');}else{return null;}}return _0x489560[_0xf8f5('0x16')](_['upperFirst'](_0x4c4d38['moduleCreate']))[_0xf8f5('0x17')](_0x11657a);}});}function getCustomFields(_0x2f0ed8,_0x57282a){var _0x171bdd={};if(_0x2f0ed8[_0xf8f5('0x1e')]>0x0){_[_0xf8f5('0x36')](_0x2f0ed8,function(_0x3e4d88){if(_0x3e4d88[_0xf8f5('0x37')]===_0xf8f5('0x38')&&_0x3e4d88['idField']){_0x171bdd[_0x3e4d88['idField']]=_0x3e4d88['content']['toString']();}else if(_0x3e4d88[_0xf8f5('0x37')]===_0xf8f5('0x39')&&_0x3e4d88[_0xf8f5('0x3a')]&&_0x3e4d88[_0xf8f5('0x3b')]){_0x57282a[_0x3e4d88[_0xf8f5('0x3a')]]&&(_0x171bdd[_0x3e4d88[_0xf8f5('0x3b')]]=_0x57282a[_0x3e4d88[_0xf8f5('0x3a')]][_0xf8f5('0x3c')]());}else if(_0x3e4d88['type']===_0xf8f5('0x3d')&&_0x3e4d88['Variable']&&_0x3e4d88[_0xf8f5('0x3e')][_0xf8f5('0x3f')]&&_0x3e4d88[_0xf8f5('0x3b')]){_0x57282a[_0x3e4d88['Variable'][_0xf8f5('0x3f')]['toLowerCase']()]&&(_0x171bdd[_0x3e4d88[_0xf8f5('0x3b')]]=_0x57282a[_0x3e4d88[_0xf8f5('0x3e')][_0xf8f5('0x3f')][_0xf8f5('0x40')]()][_0xf8f5('0x3c')]());}});}return _0x171bdd;}function getConnection(_0x396a13){var _0xe6de9a=_0x396a13[_0xf8f5('0x41')][_0xf8f5('0x42')](_0x396a13[_0xf8f5('0x43')]);var _0x242071=new jsforce[(_0xf8f5('0x44'))]({'oauth2':{'loginUrl':_0x396a13[_0xf8f5('0x45')]||_0xf8f5('0x46'),'clientId':_0x396a13[_0xf8f5('0x47')],'clientSecret':_0x396a13[_0xf8f5('0x48')]}});return _0x242071[_0xf8f5('0x49')](_0x396a13[_0xf8f5('0x4a')],_0xe6de9a)['then'](function(){logger[_0xf8f5('0x1f')](_0xf8f5('0x4b'));return _0x242071;});}exports[_0xf8f5('0x4c')]=function(_0x2e8dd0,_0x13ed06,_0x20443b,_0x3cb778,_0x29859e,_0xfb2578){var _0xa5052c,_0x213a45,_0x43458e,_0x112f02;_0xfb2578['serverUrl']=intUtil[_0xf8f5('0x4d')](_0xfb2578[_0xf8f5('0x4e')]);_0xfb2578[_0xf8f5('0x45')]=intUtil['stripTrailingSlash'](_0xfb2578[_0xf8f5('0x45')]);if(_0x29859e&&_0x29859e[_0xf8f5('0x4f')]){logger[_0xf8f5('0x1f')](_0xf8f5('0x50'),_0xf8f5('0x51'));_0x13ed06[_0xf8f5('0x52')]=util[_0xf8f5('0x30')](_0xf8f5('0x53'),_0xfb2578[_0xf8f5('0x4e')],_0x13ed06[_0xf8f5('0x54')],md5(_0x13ed06['uniqueid']));}else{_0x13ed06[_0xf8f5('0x52')]='';}return getConnection(_0xfb2578)[_0xf8f5('0x1d')](function(_0x57f7a9){_0x112f02=_0x57f7a9;return getUser(_0xfb2578,_0x3cb778[_0xf8f5('0x55')],_0x112f02);})[_0xf8f5('0x1d')](function(_0x500311){_0xa5052c=_0x500311;return getEndUser(_0xfb2578,_0x20443b,_0x13ed06[_0xf8f5('0x56')],_0x13ed06[_0xf8f5('0x57')],_0x112f02);})[_0xf8f5('0x1d')](function(_0x5b21b2){_0x213a45=_0x5b21b2;return getTicket(_0xfb2578,_0xa5052c,_0x213a45,_0x20443b,_0x13ed06,_0x20443b[_0xf8f5('0x58')],_0x112f02,'queue');})[_0xf8f5('0x1d')](function(_0x13387e){_0x43458e=_0x13387e;logger[_0xf8f5('0x1f')](_0xf8f5('0x59'),_0x43458e['id']);logger[_0xf8f5('0x1f')](_0xf8f5('0x5a'),_0x43458e['id'],_0x3cb778[_0xf8f5('0x3f')],_0xfb2578['type']);switch(_0xfb2578['type']){case _0xf8f5('0x5b'):emit(util['format']('user:%s',_0x3cb778['name']),_0xf8f5('0x5c'),{'recordId':_0x43458e['id']});break;case _0xf8f5('0x5d'):emit(util[_0xf8f5('0x30')](_0xf8f5('0x5e'),_0x3cb778[_0xf8f5('0x3f')]),_0xf8f5('0x5f'),{'uri':util[_0xf8f5('0x30')]('%s/%s/e',_0x112f02[_0xf8f5('0x60')],_0x43458e['id'])});break;default:logger[_0xf8f5('0x61')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})['catch'](function(_0x24f0bb){logger[_0xf8f5('0x61')](_0xf8f5('0x50'),JSON[_0xf8f5('0x62')](_0x24f0bb));});};exports[_0xf8f5('0x63')]=function(_0x3c6c47,_0x8eb687,_0x550b4c,_0x3325e7,_0x116235,_0x131030,_0x41cd03){var _0x32f234,_0x2be6c9,_0x4c9224,_0x3aa791;_0x131030['serverUrl']=intUtil[_0xf8f5('0x4d')](_0x131030[_0xf8f5('0x4e')]);_0x131030[_0xf8f5('0x45')]=intUtil[_0xf8f5('0x4d')](_0x131030['remoteUri']);if(_0x41cd03&&_0x41cd03[_0xf8f5('0x64')]&&_0x41cd03[_0xf8f5('0x64')]!==_0xf8f5('0x65')){logger[_0xf8f5('0x1f')](_0xf8f5('0x66'),'Recording\x20is\x20enabled!');_0x8eb687[_0xf8f5('0x52')]=util[_0xf8f5('0x30')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x131030[_0xf8f5('0x4e')],_0x8eb687[_0xf8f5('0x54')],md5(_0x8eb687[_0xf8f5('0x54')]));}return getConnection(_0x131030)[_0xf8f5('0x1d')](function(_0x1db828){_0x3aa791=_0x1db828;return getUser(_0x131030,_0x3325e7[_0xf8f5('0x55')],_0x3aa791);})[_0xf8f5('0x1d')](function(_0x41ddde){_0x32f234=_0x41ddde;return getEndUser(_0x131030,_0x550b4c,_0x8eb687[_0xf8f5('0x67')],_0x8eb687[_0xf8f5('0x68')],_0x3aa791);})[_0xf8f5('0x1d')](function(_0x4b7bac){_0x2be6c9=_0x4b7bac;return getTicket(_0x131030,_0x32f234,_0x2be6c9,_0x550b4c,_0x8eb687,_0x550b4c[_0xf8f5('0x58')],_0x3aa791,_0xf8f5('0x63'));})[_0xf8f5('0x1d')](function(_0x27f798){_0x4c9224=_0x27f798;logger[_0xf8f5('0x1f')](_0xf8f5('0x69'),_0x4c9224['id']);logger[_0xf8f5('0x1f')](_0xf8f5('0x6a'),_0x4c9224['id'],_0x3325e7['name'],_0x131030[_0xf8f5('0x37')]);switch(_0x131030[_0xf8f5('0x37')]){case _0xf8f5('0x5b'):emit(util['format'](_0xf8f5('0x5e'),_0x3325e7[_0xf8f5('0x3f')]),'trigger:salesforce:display',{'recordId':_0x4c9224['id']});break;case _0xf8f5('0x5d'):emit(util[_0xf8f5('0x30')](_0xf8f5('0x5e'),_0x3325e7['name']),_0xf8f5('0x5f'),{'uri':util['format']('%s/%s/e',_0x3aa791[_0xf8f5('0x60')],_0x4c9224['id'])});break;default:logger[_0xf8f5('0x61')](_0xf8f5('0x66'),_0xf8f5('0x6b'));}})[_0xf8f5('0x6c')](function(_0x2a4fa9){logger['error'](_0xf8f5('0x66'),JSON['stringify'](_0x2a4fa9));});};exports[_0xf8f5('0x6d')]=function(_0x56bd0a,_0x5190c0,_0xc93766,_0x2d0e47,_0x397ad1,_0x58cc03){var _0x132bbf,_0x37137c,_0x1ee87f,_0x5c3595;_0x58cc03[_0xf8f5('0x4e')]=intUtil['stripTrailingSlash'](_0x58cc03[_0xf8f5('0x4e')]);_0x58cc03['remoteUri']=intUtil[_0xf8f5('0x4d')](_0x58cc03[_0xf8f5('0x45')]);if(_0x397ad1&&_0x397ad1[_0xf8f5('0x4f')]){logger[_0xf8f5('0x1f')](_0xf8f5('0x6e'),'Recording\x20is\x20enabled!');_0x5190c0[_0xf8f5('0x52')]=util[_0xf8f5('0x30')](_0xf8f5('0x53'),_0x58cc03['serverUrl'],_0x5190c0[_0xf8f5('0x54')],md5(_0x5190c0['uniqueid']));}else{_0x5190c0[_0xf8f5('0x52')]='';}return getConnection(_0x58cc03)[_0xf8f5('0x1d')](function(_0x3c68a8){_0x5c3595=_0x3c68a8;if(!_[_0xf8f5('0x18')](_0x2d0e47)){return getUser(_0x58cc03,_0x2d0e47['name'],_0x5c3595);}else{return getUser(_0x58cc03,null,_0x5c3595);}})[_0xf8f5('0x1d')](function(_0x21821e){_0x132bbf=_0x21821e;return getEndUser(_0x58cc03,_0xc93766,_0x5190c0[_0xf8f5('0x56')],_0x5190c0[_0xf8f5('0x57')],_0x5c3595);})['then'](function(_0x249607){_0x37137c=_0x249607;return getTicket(_0x58cc03,_0x132bbf,_0x37137c,_0xc93766,_0x5190c0,_0xc93766[_0xf8f5('0x58')],_0x5c3595);})[_0xf8f5('0x1d')](function(_0x27fe54){_0x1ee87f=_0x27fe54;logger[_0xf8f5('0x1f')](_0xf8f5('0x6f'),_0x1ee87f['id']);logger[_0xf8f5('0x1f')](_0xf8f5('0x70'),_0x58cc03[_0xf8f5('0x37')]);})[_0xf8f5('0x6c')](function(_0x203128){logger[_0xf8f5('0x61')]('[ABANDONED]',JSON['stringify'](_0x203128));});}; \ 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 1689ad5..c657c2f 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 _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','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','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','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','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'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 03dedb3..1191463 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 _0xa53e=['Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','forEach','type','string','customField','content','custom_fields','customVariable','Variable','toLowerCase','POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','abandoned','[ABANDONED]','isNil','calleridname','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','emit','info','Creating\x20new\x20ticket...','assigned_user_id','description','getString','slice','replace','duration_hours','parent_type','direction','length','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','then','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry'];(function(_0x308408,_0x37d440){var _0x9dc073=function(_0x29f0c9){while(--_0x29f0c9){_0x308408['push'](_0x308408['shift']());}};_0x9dc073(++_0x37d440);}(_0xa53e,0x124));var _0xea53=function(_0x7afe77,_0x4ace34){_0x7afe77=_0x7afe77-0x0;var _0x202266=_0xa53e[_0x7afe77];return _0x202266;};'use strict';var _=require('lodash');var rp=require(_0xea53('0x0'));var BPromise=require(_0xea53('0x1'));var md5=require(_0xea53('0x2'));var util=require(_0xea53('0x3'));var Redis=require('ioredis');var intUtil=require(_0xea53('0x4'));var config=require(_0xea53('0x5'));var logger=require(_0xea53('0x6'))(_0xea53('0x7'));config[_0xea53('0x8')]=_['defaults'](config[_0xea53('0x8')],{'host':_0xea53('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea53('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x68f963,_0x4d836a,_0x4d6790){io['to'](_0x68f963)[_0xea53('0xa')](_0x4d836a,_0x4d6790);}function getTicket(_0x4e1fe6,_0x24b348,_0x1c4f81,_0x509825,_0x11f987,_0x1ad14c,_0x586741,_0x23d2c1){logger[_0xea53('0xb')](_0xea53('0xc'));var _0x544405=new Date();var _0x108719=[{'name':'name','value':intUtil['getString'](_0x509825['Subjects'],_0x11f987,'\x20')},{'name':_0xea53('0xd'),'value':_0x24b348['id']},{'name':'created_by','value':_0x24b348['id']},{'name':_0xea53('0xe'),'value':intUtil[_0xea53('0xf')](_0x509825['Descriptions'],_0x11f987,'\x0a')},{'name':'date_start','value':_0x544405['toISOString']()[_0xea53('0x10')](0x0,0x13)[_0xea53('0x11')]('T','\x20')},{'name':_0xea53('0x12'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x1c4f81['id']},{'name':_0xea53('0x13'),'value':'Contacts'},{'name':'parent_name','value':_0x1c4f81['name']},{'name':_0xea53('0x14'),'value':_0x23d2c1}];if(_0x1ad14c[_0xea53('0x15')]){_['forEach'](_0x1ad14c,function(_0x42bc80){if(_0x11f987[_0x42bc80[_0xea53('0x16')]]){_0x108719[_0xea53('0x17')]({'name':_0x42bc80[_0xea53('0x18')],'value':_0x11f987[_0x42bc80[_0xea53('0x16')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x586741['id'],'module_name':_0xea53('0x1b'),'name_value_list':_0x108719})}});}function getAuth(_0xc8eceb){return util[_0xea53('0x1c')](_0xea53('0x1d'),new Buffer(_0xc8eceb[_0xea53('0x1e')]+':X')[_0xea53('0x1f')](_0xea53('0x20')));}function getServerInfo(_0x17e3a5){return request({'form':{'method':'get_server_info','input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x17e3a5['id']})}});}function getUser(_0x75fb95,_0x43543,_0x1703a0){if(!_['isNil'](_0x43543)){logger[_0xea53('0xb')](_0xea53('0x21'),_0x43543);return request({'form':{'method':_0xea53('0x22'),'input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x1703a0['id'],'module_name':'Employees','query':util[_0xea53('0x1c')](_0xea53('0x23'),_0x43543),'order_by':'','offset':'0','select_fields':['id',_0xea53('0x24'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea53('0x25')](function(_0x35d8d0){if(_0x35d8d0[_0xea53('0x26')][_0xea53('0x15')]){var _0x1c0429=_['find'](_0x35d8d0['entry_list'],function(_0x550b72){return _0x550b72[_0xea53('0x27')][_0xea53('0x28')][_0xea53('0x29')]===_0x43543;});if(_0x1c0429){logger[_0xea53('0xb')](_0xea53('0x2a'));return BPromise[_0xea53('0x2b')]({'id':_0x1c0429['name_value_list']['id'][_0xea53('0x29')],'name':_0x1c0429[_0xea53('0x27')][_0xea53('0x24')][_0xea53('0x29')]});}}logger[_0xea53('0xb')](_0xea53('0x2c'));return BPromise['resolve']({'id':_0x1703a0[_0xea53('0x27')][_0xea53('0x2d')][_0xea53('0x29')],'name':_0x1703a0[_0xea53('0x27')][_0xea53('0x28')]['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xea53('0x2b')]({'id':_0x1703a0['name_value_list'][_0xea53('0x2d')][_0xea53('0x29')],'name':_0x1703a0[_0xea53('0x27')]['user_name'][_0xea53('0x29')]});}}function getEndUser(_0x44efbb,_0x236190,_0x23dc32,_0x195a78){logger[_0xea53('0xb')](_0xea53('0x2e'),_0x23dc32);return request({'form':{'method':_0xea53('0x22'),'input_type':'JSON','response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x195a78['id'],'module_name':_0xea53('0x2f'),'query':util[_0xea53('0x1c')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x23dc32),'order_by':'','offset':'0','select_fields':['id',_0xea53('0x24'),_0xea53('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea53('0x25')](function(_0x2fdab3){if(_0x2fdab3[_0xea53('0x26')][_0xea53('0x15')]){var _0x38a77c=_[_0xea53('0x31')](_0x2fdab3['entry_list'],function(_0x56630a){return _0x56630a['name_value_list'][_0xea53('0x30')][_0xea53('0x29')]===_0x23dc32;});if(_0x38a77c){logger[_0xea53('0xb')](_0xea53('0x32'));return BPromise[_0xea53('0x2b')]({'id':_0x38a77c[_0xea53('0x27')]['id'][_0xea53('0x29')],'name':_0x38a77c['name_value_list'][_0xea53('0x24')]['value'],'phone':_0x38a77c['name_value_list'][_0xea53('0x30')][_0xea53('0x29')]});}}else{logger[_0xea53('0xb')](_0xea53('0x33'));return request({'form':{'method':_0xea53('0x34'),'input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x195a78['id'],'module_name':_0xea53('0x2f'),'name_value_list':[{'name':'first_name','value':_0x236190!==''?_0x236190:util[_0xea53('0x1c')](_0xea53('0x35'),_0x23dc32)},{'name':_0xea53('0x30'),'value':_0x23dc32}]})}})['then'](function(_0x41188c){logger['info'](_0xea53('0x36'));return BPromise[_0xea53('0x2b')]({'id':_0x41188c['id'],'name':_0x41188c[_0xea53('0x26')][_0xea53('0x37')][_0xea53('0x29')],'phone':_0x41188c[_0xea53('0x26')][_0xea53('0x30')]['value']});});}});}function request(_0x1ca6a2){logger[_0xea53('0x38')](_0xea53('0x39'),JSON[_0xea53('0x1a')](_0x1ca6a2));return rp(_['merge'](def,_0x1ca6a2));}function getTags(_0x1e8876,_0x51bf0a){var _0x4c213d=[];if(_0x1e8876&&_0x1e8876[_0xea53('0x15')]>0x0){_0x4c213d=_[_0xea53('0x3a')](_0x1e8876,_0x51bf0a);}return _0x4c213d;}function getCustomFields(_0x18878c,_0x4c9795){var _0x14e7fc=[];var _0x6b1295={'custom_fields':[]};if(_0x18878c['length']>0x0){_[_0xea53('0x3b')](_0x18878c,function(_0x9502ae){if(_0x9502ae[_0xea53('0x3c')]===_0xea53('0x3d')&&_0x9502ae['nameField']&&!_0x9502ae[_0xea53('0x3e')]){_0x6b1295[_0x9502ae['nameField']['toLowerCase']()]=_0x9502ae[_0xea53('0x3f')][_0xea53('0x1f')]();}else if(_0x9502ae[_0xea53('0x3c')]===_0xea53('0x3d')&&_0x9502ae[_0xea53('0x18')]&&_0x9502ae[_0xea53('0x3e')]){_0x6b1295[_0xea53('0x40')][_0xea53('0x17')]({'id':_0x9502ae['idField'],'value':_0x9502ae['content']['toString']()});}else if(_0x9502ae[_0xea53('0x3c')]==='variable'&&_0x9502ae[_0xea53('0x16')]&&_0x9502ae[_0xea53('0x18')]&&_0x9502ae[_0xea53('0x3e')]){_0x4c9795[_0x9502ae[_0xea53('0x16')]]&&_0x6b1295[_0xea53('0x40')][_0xea53('0x17')]({'id':_0x9502ae[_0xea53('0x18')],'value':_0x4c9795[_0x9502ae[_0xea53('0x16')]][_0xea53('0x1f')]()});}else if(_0x9502ae[_0xea53('0x3c')]===_0xea53('0x41')&&_0x9502ae['Variable']&&_0x9502ae[_0xea53('0x42')][_0xea53('0x24')]&&_0x9502ae[_0xea53('0x18')]&&_0x9502ae[_0xea53('0x3e')]){_0x4c9795[_0x9502ae[_0xea53('0x42')][_0xea53('0x24')]['toLowerCase']()]&&_0x6b1295['custom_fields'][_0xea53('0x17')]({'id':_0x9502ae[_0xea53('0x18')],'value':_0x4c9795[_0x9502ae[_0xea53('0x42')][_0xea53('0x24')][_0xea53('0x43')]()][_0xea53('0x1f')]()});}});}return _0x6b1295;}function getConnection(_0x1d51e8){return request({'method':_0xea53('0x44'),'form':{'method':_0xea53('0x45'),'input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'user_auth':{'user_name':_0x1d51e8[_0xea53('0x46')],'password':_0x1d51e8[_0xea53('0x47')],'encryption':_0xea53('0x48')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xea53('0x25')](function(_0xe2a04f){var _0xb1ff81=_0xe2a04f;if(_0xb1ff81['id']){def[_0xea53('0x49')]=_0xb1ff81['id'];return BPromise[_0xea53('0x2b')](_0xb1ff81);}else{throw new Error(util[_0xea53('0x1c')](_0xea53('0x4a'),_0x1d51e8['id']));}});}function setRelationship(_0x219b82,_0x249aac,_0x40879e,_0xc3957){return request({'form':{'method':_0xea53('0x4b'),'input_type':'JSON','response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x219b82['id'],'module_name':_0xea53('0x1b'),'module_id':_0x40879e['id'],'link_field_name':_0xc3957,'related_ids':[_0x249aac['id']]})}});}exports[_0xea53('0x4c')]=function(_0x58e103,_0x23365b,_0x14b38f,_0x2262a5,_0x19e013,_0x3053f9){var _0x39ab5f,_0x3f5068,_0x4e1303,_0x1022fa;_0x3053f9[_0xea53('0x4d')]=intUtil[_0xea53('0x4e')](_0x3053f9[_0xea53('0x4d')]);_0x3053f9['serverUrl']=intUtil[_0xea53('0x4e')](_0x3053f9[_0xea53('0x4f')]);def[_0xea53('0x50')]=util[_0xea53('0x1c')](_0xea53('0x51'),_0x3053f9[_0xea53('0x4d')]);if(_0x19e013&&_0x19e013['monitor_format']){logger[_0xea53('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x23365b[_0xea53('0x52')]=util[_0xea53('0x1c')](_0xea53('0x53'),_0x3053f9[_0xea53('0x4f')],_0x23365b[_0xea53('0x54')],md5(_0x23365b[_0xea53('0x54')]));}else{_0x23365b[_0xea53('0x52')]='';}return getConnection(_0x3053f9)[_0xea53('0x25')](function(_0x58dbc0){_0x1022fa=_0x58dbc0;return getUser(_0x3053f9,_0x2262a5[_0xea53('0x24')],_0x1022fa);})[_0xea53('0x25')](function(_0x20d767){_0x39ab5f=_0x20d767;logger['info'](_0xea53('0x55'),_0x39ab5f['id']);return getEndUser(_0x3053f9,_0x23365b['calleridname'],_0x23365b[_0xea53('0x56')],_0x1022fa);})[_0xea53('0x25')](function(_0x2ee24c){_0x3f5068=_0x2ee24c;logger[_0xea53('0xb')](_0xea53('0x57'),_0x3f5068['id']);return getTicket(_0x3053f9,_0x39ab5f,_0x3f5068,_0x14b38f,_0x23365b,_0x14b38f['Fields'],_0x1022fa,_0xea53('0x58'));})[_0xea53('0x25')](function(_0x3be7f0){_0x4e1303=_0x3be7f0;logger['info']('Ticket\x20created!');logger['info'](_0xea53('0x59'),_0x4e1303['id']);return setRelationship(_0x1022fa,_0x39ab5f,_0x4e1303,_0xea53('0x5a'));})['then'](function(){return setRelationship(_0x1022fa,_0x3f5068,_0x4e1303,_0xea53('0x5b'));})['then'](function(){return getServerInfo(_0x1022fa);})[_0xea53('0x25')](function(_0x1a0127){var _0x278fd2=parseInt(_0x1a0127[_0xea53('0x5c')][_0xea53('0x5d')](0x0));var _0x26cacf=util[_0xea53('0x1c')](_0xea53('0x5e'),_0x3053f9[_0xea53('0x4d')],_0x4e1303['id']);if(_0x278fd2>0x6){_0x26cacf=util[_0xea53('0x1c')](_0xea53('0x5f'),_0x3053f9[_0xea53('0x4d')],_0x4e1303['id']);}logger[_0xea53('0xb')](_0xea53('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea53('0x1c')](_0xea53('0x61'),_0x2262a5[_0xea53('0x24')]),_0xea53('0x62'),{'uri':_0x26cacf});})[_0xea53('0x63')](function(_0x428c2c){logger[_0xea53('0x64')](_0xea53('0x60'),JSON[_0xea53('0x1a')](_0x428c2c));});};exports[_0xea53('0x65')]=function(_0x504e92,_0x39415e,_0x18bdc5,_0x5cd67b,_0x880c91,_0x4542a0,_0x4b2e2f){var _0x153f6b,_0x7e55c7,_0x2bf877,_0x31561b;_0x4542a0[_0xea53('0x4d')]=intUtil[_0xea53('0x4e')](_0x4542a0[_0xea53('0x4d')]);_0x4542a0[_0xea53('0x4f')]=intUtil[_0xea53('0x4e')](_0x4542a0[_0xea53('0x4f')]);def['uri']=util[_0xea53('0x1c')](_0xea53('0x51'),_0x4542a0['remoteUri']);if(_0x4b2e2f&&_0x4b2e2f[_0xea53('0x66')]&&_0x4b2e2f[_0xea53('0x66')]!==_0xea53('0x67')){logger['info'](_0xea53('0x68'),_0xea53('0x69'));_0x39415e[_0xea53('0x52')]=util['format'](_0xea53('0x53'),_0x4542a0[_0xea53('0x4f')],_0x39415e[_0xea53('0x54')],md5(_0x39415e['uniqueid']));}return getConnection(_0x4542a0)[_0xea53('0x25')](function(_0x27b091){_0x31561b=_0x27b091;return getUser(_0x4542a0,_0x5cd67b[_0xea53('0x24')],_0x31561b);})['then'](function(_0x219741){_0x153f6b=_0x219741;logger[_0xea53('0xb')](_0xea53('0x55'),_0x153f6b['id']);return getEndUser(_0x4542a0,_0x39415e[_0xea53('0x6a')],_0x39415e[_0xea53('0x6b')],_0x31561b);})['then'](function(_0x21ad79){_0x7e55c7=_0x21ad79;logger[_0xea53('0xb')](_0xea53('0x57'),_0x7e55c7['id']);return getTicket(_0x4542a0,_0x153f6b,_0x7e55c7,_0x18bdc5,_0x39415e,_0x18bdc5[_0xea53('0x6c')],_0x31561b,_0xea53('0x6d'));})[_0xea53('0x25')](function(_0x1ae240){_0x2bf877=_0x1ae240;logger[_0xea53('0xb')](_0xea53('0x6e'));logger['info'](_0xea53('0x59'),_0x2bf877['id']);return setRelationship(_0x31561b,_0x153f6b,_0x2bf877,_0xea53('0x5a'));})[_0xea53('0x25')](function(){return setRelationship(_0x31561b,_0x7e55c7,_0x2bf877,_0xea53('0x5b'));})[_0xea53('0x25')](function(){return getServerInfo(_0x31561b);})['then'](function(_0x365fc5){var _0x325303=parseInt(_0x365fc5['version'][_0xea53('0x5d')](0x0));var _0x6e9359=util[_0xea53('0x1c')](_0xea53('0x5e'),_0x4542a0['remoteUri'],_0x2bf877['id']);if(_0x325303>0x6){_0x6e9359=util['format'](_0xea53('0x5f'),_0x4542a0['remoteUri'],_0x2bf877['id']);}logger['info'](_0xea53('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xea53('0x61'),_0x5cd67b[_0xea53('0x24')]),'trigger:browser:url',{'uri':_0x6e9359});})[_0xea53('0x63')](function(_0x1518ec){logger[_0xea53('0x64')]('[OUTBOUND]',JSON['stringify'](_0x1518ec));});};exports[_0xea53('0x6f')]=function(_0x59fde4,_0x53a3a0,_0x393692,_0x1d2cf6,_0x5974aa,_0x39a0e0){var _0x198848,_0x334416,_0x1a6869,_0x4360f4;_0x39a0e0['remoteUri']=intUtil[_0xea53('0x4e')](_0x39a0e0[_0xea53('0x4d')]);_0x39a0e0['serverUrl']=intUtil[_0xea53('0x4e')](_0x39a0e0[_0xea53('0x4f')]);def['uri']=util[_0xea53('0x1c')](_0xea53('0x51'),_0x39a0e0[_0xea53('0x4d')]);if(_0x5974aa&&_0x5974aa['monitor_format']){logger['info'](_0xea53('0x70'),_0xea53('0x69'));_0x53a3a0['recordingURL']=util[_0xea53('0x1c')](_0xea53('0x53'),_0x39a0e0[_0xea53('0x4f')],_0x53a3a0[_0xea53('0x54')],md5(_0x53a3a0[_0xea53('0x54')]));}else{_0x53a3a0[_0xea53('0x52')]='';}return getConnection(_0x39a0e0)[_0xea53('0x25')](function(_0x2dff09){_0x4360f4=_0x2dff09;if(!_[_0xea53('0x71')](_0x1d2cf6)){return getUser(_0x39a0e0,_0x1d2cf6['name'],_0x4360f4);}else{return getUser(_0x39a0e0,null,_0x4360f4);}})[_0xea53('0x25')](function(_0x227e2b){_0x198848=_0x227e2b;logger['info']('The\x20User\x20ID\x20is:',_0x198848['id']);return getEndUser(_0x39a0e0,_0x53a3a0[_0xea53('0x72')],_0x53a3a0[_0xea53('0x56')],_0x4360f4);})[_0xea53('0x25')](function(_0x165aa7){_0x334416=_0x165aa7;logger[_0xea53('0xb')](_0xea53('0x57'),_0x334416['id']);return getTicket(_0x39a0e0,_0x198848,_0x334416,_0x393692,_0x53a3a0,_0x393692[_0xea53('0x6c')],_0x4360f4,_0xea53('0x58'));})[_0xea53('0x25')](function(_0x549a0f){_0x1a6869=_0x549a0f;logger[_0xea53('0xb')]('Ticket\x20created!');logger[_0xea53('0xb')](_0xea53('0x59'),_0x1a6869['id']);return setRelationship(_0x4360f4,_0x198848,_0x1a6869,_0xea53('0x5a'));})[_0xea53('0x25')](function(){return setRelationship(_0x4360f4,_0x334416,_0x1a6869,_0xea53('0x5b'));})['then'](function(){return getServerInfo(_0x4360f4);})[_0xea53('0x63')](function(_0x5ea06b){logger['error'](_0xea53('0x70'),JSON['stringify'](_0x5ea06b));});}; \ No newline at end of file +var _0xa7ba=['user_id','Searching\x20enduser\x20with\x20phone','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','debug','merge','map','type','string','nameField','toLowerCase','content','custom_fields','push','idField','variable','customField','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','Calls','queue','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','Ticket\x20created!','users','version','error','abandoned','[ABANDONED]','The\x20Enduser\x20ID\x20is:','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','localhost','socket.io-emitter','redis','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','Descriptions','date_start','slice','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','variableName','set_entry','stringify','format','apiKey','toString','base64','get_server_info','JSON','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!'];(function(_0x257495,_0x18269b){var _0x3849aa=function(_0x1ca94e){while(--_0x1ca94e){_0x257495['push'](_0x257495['shift']());}};_0x3849aa(++_0x18269b);}(_0xa7ba,0xbd));var _0xaa7b=function(_0x4dd166,_0x204b25){_0x4dd166=_0x4dd166-0x0;var _0x1fd1d6=_0xa7ba[_0x4dd166];return _0x1fd1d6;};'use strict';var _=require('lodash');var rp=require(_0xaa7b('0x0'));var BPromise=require(_0xaa7b('0x1'));var md5=require(_0xaa7b('0x2'));var util=require(_0xaa7b('0x3'));var Redis=require(_0xaa7b('0x4'));var intUtil=require(_0xaa7b('0x5'));var config=require(_0xaa7b('0x6'));var logger=require(_0xaa7b('0x7'))(_0xaa7b('0x8'));config['redis']=_['defaults'](config['redis'],{'host':_0xaa7b('0x9'),'port':0x18eb});var io=require(_0xaa7b('0xa'))(new Redis(config[_0xaa7b('0xb')]));var def={'method':_0xaa7b('0xc'),'json':!![]};function emit(_0xaf149b,_0x2fd012,_0x2d3aa4){io['to'](_0xaf149b)[_0xaa7b('0xd')](_0x2fd012,_0x2d3aa4);}function getTicket(_0x491c6e,_0x430f13,_0x133f92,_0x15d3e0,_0x5485e1,_0x39d5a6,_0x3fc109,_0x3fb5fc){logger[_0xaa7b('0xe')](_0xaa7b('0xf'));var _0x2ff8c6=new Date();var _0x534159=[{'name':_0xaa7b('0x10'),'value':intUtil[_0xaa7b('0x11')](_0x15d3e0[_0xaa7b('0x12')],_0x5485e1,'\x20')},{'name':_0xaa7b('0x13'),'value':_0x430f13['id']},{'name':'created_by','value':_0x430f13['id']},{'name':'description','value':intUtil[_0xaa7b('0x11')](_0x15d3e0[_0xaa7b('0x14')],_0x5485e1,'\x0a')},{'name':_0xaa7b('0x15'),'value':_0x2ff8c6['toISOString']()[_0xaa7b('0x16')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xaa7b('0x17'),'value':'15'},{'name':_0xaa7b('0x18'),'value':_0x133f92['id']},{'name':_0xaa7b('0x19'),'value':_0xaa7b('0x1a')},{'name':_0xaa7b('0x1b'),'value':_0x133f92[_0xaa7b('0x10')]},{'name':_0xaa7b('0x1c'),'value':_0x3fb5fc}];if(_0x39d5a6['length']){_[_0xaa7b('0x1d')](_0x39d5a6,function(_0x534601){if(_0x5485e1[_0x534601[_0xaa7b('0x1e')]]){_0x534159['push']({'name':_0x534601['idField'],'value':_0x5485e1[_0x534601[_0xaa7b('0x1e')]]});}});}return request({'form':{'method':_0xaa7b('0x1f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xaa7b('0x20')]({'session':_0x3fc109['id'],'module_name':'Calls','name_value_list':_0x534159})}});}function getAuth(_0x57290c){return util[_0xaa7b('0x21')]('Basic\x20%s',new Buffer(_0x57290c[_0xaa7b('0x22')]+':X')[_0xaa7b('0x23')](_0xaa7b('0x24')));}function getServerInfo(_0x1381a0){return request({'form':{'method':_0xaa7b('0x25'),'input_type':_0xaa7b('0x26'),'response_type':'JSON','rest_data':JSON[_0xaa7b('0x20')]({'session':_0x1381a0['id']})}});}function getUser(_0x5f26a7,_0x4768c7,_0xe8a02f){if(!_[_0xaa7b('0x27')](_0x4768c7)){logger[_0xaa7b('0xe')](_0xaa7b('0x28'),_0x4768c7);return request({'form':{'method':_0xaa7b('0x29'),'input_type':_0xaa7b('0x26'),'response_type':_0xaa7b('0x26'),'rest_data':JSON[_0xaa7b('0x20')]({'session':_0xe8a02f['id'],'module_name':_0xaa7b('0x2a'),'query':util['format'](_0xaa7b('0x2b'),_0x4768c7),'order_by':'','offset':'0','select_fields':['id','name',_0xaa7b('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xaa7b('0x2d')](function(_0x4c3ee7){if(_0x4c3ee7[_0xaa7b('0x2e')]['length']){var _0xe4bbf8=_['find'](_0x4c3ee7['entry_list'],function(_0x36b26c){return _0x36b26c[_0xaa7b('0x2f')]['user_name'][_0xaa7b('0x30')]===_0x4768c7;});if(_0xe4bbf8){logger[_0xaa7b('0xe')](_0xaa7b('0x31'));return BPromise[_0xaa7b('0x32')]({'id':_0xe4bbf8['name_value_list']['id'][_0xaa7b('0x30')],'name':_0xe4bbf8['name_value_list']['name'][_0xaa7b('0x30')]});}}logger[_0xaa7b('0xe')](_0xaa7b('0x33'));return BPromise['resolve']({'id':_0xe8a02f[_0xaa7b('0x2f')]['user_id'][_0xaa7b('0x30')],'name':_0xe8a02f[_0xaa7b('0x2f')][_0xaa7b('0x2c')][_0xaa7b('0x30')]});});}else{logger[_0xaa7b('0xe')](_0xaa7b('0x34'));return BPromise[_0xaa7b('0x32')]({'id':_0xe8a02f['name_value_list'][_0xaa7b('0x35')][_0xaa7b('0x30')],'name':_0xe8a02f[_0xaa7b('0x2f')][_0xaa7b('0x2c')][_0xaa7b('0x30')]});}}function getEndUser(_0x4c6721,_0x55fb79,_0x3321bb,_0x202ddc){logger[_0xaa7b('0xe')](_0xaa7b('0x36'),_0x3321bb);return request({'form':{'method':'get_entry_list','input_type':_0xaa7b('0x26'),'response_type':_0xaa7b('0x26'),'rest_data':JSON['stringify']({'session':_0x202ddc['id'],'module_name':'Contacts','query':util[_0xaa7b('0x21')](_0xaa7b('0x37'),_0x3321bb),'order_by':'','offset':'0','select_fields':['id','name',_0xaa7b('0x38')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4e97bd){if(_0x4e97bd[_0xaa7b('0x2e')][_0xaa7b('0x39')]){var _0x4dcaa9=_['find'](_0x4e97bd['entry_list'],function(_0x2b9ef5){return _0x2b9ef5[_0xaa7b('0x2f')][_0xaa7b('0x38')][_0xaa7b('0x30')]===_0x3321bb;});if(_0x4dcaa9){logger[_0xaa7b('0xe')](_0xaa7b('0x3a'));return BPromise[_0xaa7b('0x32')]({'id':_0x4dcaa9[_0xaa7b('0x2f')]['id'][_0xaa7b('0x30')],'name':_0x4dcaa9[_0xaa7b('0x2f')][_0xaa7b('0x10')][_0xaa7b('0x30')],'phone':_0x4dcaa9[_0xaa7b('0x2f')][_0xaa7b('0x38')]['value']});}}else{logger[_0xaa7b('0xe')](_0xaa7b('0x3b'));return request({'form':{'method':_0xaa7b('0x1f'),'input_type':'JSON','response_type':_0xaa7b('0x26'),'rest_data':JSON[_0xaa7b('0x20')]({'session':_0x202ddc['id'],'module_name':'Contacts','name_value_list':[{'name':_0xaa7b('0x3c'),'value':_0x55fb79!==''?_0x55fb79:util[_0xaa7b('0x21')](_0xaa7b('0x3d'),_0x3321bb)},{'name':_0xaa7b('0x38'),'value':_0x3321bb}]})}})[_0xaa7b('0x2d')](function(_0x317190){logger[_0xaa7b('0xe')]('Enduser\x20created.');return BPromise['resolve']({'id':_0x317190['id'],'name':_0x317190[_0xaa7b('0x2e')][_0xaa7b('0x3c')][_0xaa7b('0x30')],'phone':_0x317190[_0xaa7b('0x2e')]['phone_home'][_0xaa7b('0x30')]});});}});}function request(_0x1202de){logger[_0xaa7b('0x3e')]('[HTTP]',JSON['stringify'](_0x1202de));return rp(_[_0xaa7b('0x3f')](def,_0x1202de));}function getTags(_0x380bc3,_0x18247a){var _0x4d5a9f=[];if(_0x380bc3&&_0x380bc3[_0xaa7b('0x39')]>0x0){_0x4d5a9f=_[_0xaa7b('0x40')](_0x380bc3,_0x18247a);}return _0x4d5a9f;}function getCustomFields(_0xa1f3e7,_0x2a0599){var _0x294561=[];var _0x397e9a={'custom_fields':[]};if(_0xa1f3e7[_0xaa7b('0x39')]>0x0){_[_0xaa7b('0x1d')](_0xa1f3e7,function(_0x4af484){if(_0x4af484[_0xaa7b('0x41')]===_0xaa7b('0x42')&&_0x4af484[_0xaa7b('0x43')]&&!_0x4af484['customField']){_0x397e9a[_0x4af484['nameField'][_0xaa7b('0x44')]()]=_0x4af484[_0xaa7b('0x45')][_0xaa7b('0x23')]();}else if(_0x4af484['type']===_0xaa7b('0x42')&&_0x4af484['idField']&&_0x4af484['customField']){_0x397e9a[_0xaa7b('0x46')][_0xaa7b('0x47')]({'id':_0x4af484[_0xaa7b('0x48')],'value':_0x4af484[_0xaa7b('0x45')][_0xaa7b('0x23')]()});}else if(_0x4af484[_0xaa7b('0x41')]===_0xaa7b('0x49')&&_0x4af484[_0xaa7b('0x1e')]&&_0x4af484[_0xaa7b('0x48')]&&_0x4af484[_0xaa7b('0x4a')]){_0x2a0599[_0x4af484[_0xaa7b('0x1e')]]&&_0x397e9a['custom_fields']['push']({'id':_0x4af484[_0xaa7b('0x48')],'value':_0x2a0599[_0x4af484['variableName']][_0xaa7b('0x23')]()});}else if(_0x4af484[_0xaa7b('0x41')]===_0xaa7b('0x4b')&&_0x4af484[_0xaa7b('0x4c')]&&_0x4af484['Variable'][_0xaa7b('0x10')]&&_0x4af484[_0xaa7b('0x48')]&&_0x4af484[_0xaa7b('0x4a')]){_0x2a0599[_0x4af484[_0xaa7b('0x4c')]['name']['toLowerCase']()]&&_0x397e9a['custom_fields'][_0xaa7b('0x47')]({'id':_0x4af484[_0xaa7b('0x48')],'value':_0x2a0599[_0x4af484[_0xaa7b('0x4c')][_0xaa7b('0x10')]['toLowerCase']()][_0xaa7b('0x23')]()});}});}return _0x397e9a;}function getConnection(_0x3a8ca4){return request({'method':_0xaa7b('0xc'),'form':{'method':_0xaa7b('0x4d'),'input_type':_0xaa7b('0x26'),'response_type':_0xaa7b('0x26'),'rest_data':JSON[_0xaa7b('0x20')]({'user_auth':{'user_name':_0x3a8ca4['username'],'password':_0x3a8ca4[_0xaa7b('0x4e')],'encryption':_0xaa7b('0x4f')},'application':_0xaa7b('0x50')})}})[_0xaa7b('0x2d')](function(_0x235e82){var _0x9ddb3f=_0x235e82;if(_0x9ddb3f['id']){def[_0xaa7b('0x51')]=_0x9ddb3f['id'];return BPromise[_0xaa7b('0x32')](_0x9ddb3f);}else{throw new Error(util[_0xaa7b('0x21')]('Account\x20%d\x20is\x20not\x20valid',_0x3a8ca4['id']));}});}function setRelationship(_0x317a7c,_0x5281c7,_0x2e2bb4,_0x4a1fed){return request({'form':{'method':_0xaa7b('0x52'),'input_type':_0xaa7b('0x26'),'response_type':'JSON','rest_data':JSON[_0xaa7b('0x20')]({'session':_0x317a7c['id'],'module_name':_0xaa7b('0x53'),'module_id':_0x2e2bb4['id'],'link_field_name':_0x4a1fed,'related_ids':[_0x5281c7['id']]})}});}exports[_0xaa7b('0x54')]=function(_0x76228c,_0x4585df,_0x5ce236,_0x2fc0cc,_0x2a5979,_0x1cb758){var _0x5b9261,_0x14ce58,_0x433213,_0x55a9f5;_0x1cb758['remoteUri']=intUtil['stripTrailingSlash'](_0x1cb758[_0xaa7b('0x55')]);_0x1cb758['serverUrl']=intUtil['stripTrailingSlash'](_0x1cb758[_0xaa7b('0x56')]);def[_0xaa7b('0x57')]=util[_0xaa7b('0x21')](_0xaa7b('0x58'),_0x1cb758['remoteUri']);if(_0x2a5979&&_0x2a5979[_0xaa7b('0x59')]){logger['info'](_0xaa7b('0x5a'),_0xaa7b('0x5b'));_0x4585df[_0xaa7b('0x5c')]=util[_0xaa7b('0x21')](_0xaa7b('0x5d'),_0x1cb758[_0xaa7b('0x56')],_0x4585df[_0xaa7b('0x5e')],md5(_0x4585df[_0xaa7b('0x5e')]));}else{_0x4585df[_0xaa7b('0x5c')]='';}return getConnection(_0x1cb758)['then'](function(_0xa5a3b3){_0x55a9f5=_0xa5a3b3;return getUser(_0x1cb758,_0x2fc0cc[_0xaa7b('0x10')],_0x55a9f5);})[_0xaa7b('0x2d')](function(_0x310aaa){_0x5b9261=_0x310aaa;logger[_0xaa7b('0xe')](_0xaa7b('0x5f'),_0x5b9261['id']);return getEndUser(_0x1cb758,_0x4585df[_0xaa7b('0x60')],_0x4585df[_0xaa7b('0x61')],_0x55a9f5);})[_0xaa7b('0x2d')](function(_0x3596e1){_0x14ce58=_0x3596e1;logger[_0xaa7b('0xe')]('The\x20Enduser\x20ID\x20is:',_0x14ce58['id']);return getTicket(_0x1cb758,_0x5b9261,_0x14ce58,_0x5ce236,_0x4585df,_0x5ce236[_0xaa7b('0x62')],_0x55a9f5,_0xaa7b('0x63'));})[_0xaa7b('0x2d')](function(_0x577ab6){_0x433213=_0x577ab6;logger[_0xaa7b('0xe')]('Ticket\x20created!');logger[_0xaa7b('0xe')](_0xaa7b('0x64'),_0x433213['id']);return setRelationship(_0x55a9f5,_0x5b9261,_0x433213,'users');})[_0xaa7b('0x2d')](function(){return setRelationship(_0x55a9f5,_0x14ce58,_0x433213,_0xaa7b('0x65'));})[_0xaa7b('0x2d')](function(){return getServerInfo(_0x55a9f5);})[_0xaa7b('0x2d')](function(_0x55b401){var _0x2ecb71=parseInt(_0x55b401['version'][_0xaa7b('0x66')](0x0));var _0x1e35fc=util[_0xaa7b('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x1cb758[_0xaa7b('0x55')],_0x433213['id']);if(_0x2ecb71>0x6){_0x1e35fc=util[_0xaa7b('0x21')](_0xaa7b('0x67'),_0x1cb758[_0xaa7b('0x55')],_0x433213['id']);}logger[_0xaa7b('0xe')](_0xaa7b('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xaa7b('0x21')](_0xaa7b('0x68'),_0x2fc0cc[_0xaa7b('0x10')]),_0xaa7b('0x69'),{'uri':_0x1e35fc});})[_0xaa7b('0x6a')](function(_0x4d1810){logger['error'](_0xaa7b('0x5a'),JSON[_0xaa7b('0x20')](_0x4d1810));});};exports['outbound']=function(_0x395813,_0x454a7b,_0x127f1e,_0x20ccdc,_0x5ae608,_0x14d5d3,_0x1f3197){var _0x52b67c,_0x347e65,_0x49648d,_0x13c569;_0x14d5d3[_0xaa7b('0x55')]=intUtil[_0xaa7b('0x6b')](_0x14d5d3[_0xaa7b('0x55')]);_0x14d5d3[_0xaa7b('0x56')]=intUtil[_0xaa7b('0x6b')](_0x14d5d3['serverUrl']);def[_0xaa7b('0x57')]=util[_0xaa7b('0x21')](_0xaa7b('0x58'),_0x14d5d3['remoteUri']);if(_0x1f3197&&_0x1f3197[_0xaa7b('0x6c')]&&_0x1f3197[_0xaa7b('0x6c')]!==_0xaa7b('0x6d')){logger[_0xaa7b('0xe')](_0xaa7b('0x6e'),'Recording\x20is\x20enabled!');_0x454a7b[_0xaa7b('0x5c')]=util['format'](_0xaa7b('0x5d'),_0x14d5d3['serverUrl'],_0x454a7b[_0xaa7b('0x5e')],md5(_0x454a7b['uniqueid']));}return getConnection(_0x14d5d3)[_0xaa7b('0x2d')](function(_0x2fe906){_0x13c569=_0x2fe906;return getUser(_0x14d5d3,_0x20ccdc['name'],_0x13c569);})[_0xaa7b('0x2d')](function(_0x532406){_0x52b67c=_0x532406;logger[_0xaa7b('0xe')](_0xaa7b('0x5f'),_0x52b67c['id']);return getEndUser(_0x14d5d3,_0x454a7b[_0xaa7b('0x6f')],_0x454a7b[_0xaa7b('0x70')],_0x13c569);})[_0xaa7b('0x2d')](function(_0xf28e75){_0x347e65=_0xf28e75;logger[_0xaa7b('0xe')]('The\x20Enduser\x20ID\x20is:',_0x347e65['id']);return getTicket(_0x14d5d3,_0x52b67c,_0x347e65,_0x127f1e,_0x454a7b,_0x127f1e['Fields'],_0x13c569,_0xaa7b('0x71'));})['then'](function(_0x1b4e21){_0x49648d=_0x1b4e21;logger[_0xaa7b('0xe')](_0xaa7b('0x72'));logger[_0xaa7b('0xe')]('The\x20Ticket\x20ID\x20is:',_0x49648d['id']);return setRelationship(_0x13c569,_0x52b67c,_0x49648d,_0xaa7b('0x73'));})[_0xaa7b('0x2d')](function(){return setRelationship(_0x13c569,_0x347e65,_0x49648d,'contacts');})[_0xaa7b('0x2d')](function(){return getServerInfo(_0x13c569);})[_0xaa7b('0x2d')](function(_0x38eac2){var _0xa86825=parseInt(_0x38eac2[_0xaa7b('0x74')][_0xaa7b('0x66')](0x0));var _0x58c873=util[_0xaa7b('0x21')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x14d5d3['remoteUri'],_0x49648d['id']);if(_0xa86825>0x6){_0x58c873=util[_0xaa7b('0x21')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x14d5d3[_0xaa7b('0x55')],_0x49648d['id']);}logger[_0xaa7b('0xe')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x20ccdc['name']),'trigger:browser:url',{'uri':_0x58c873});})['catch'](function(_0x2b53f1){logger[_0xaa7b('0x75')](_0xaa7b('0x6e'),JSON[_0xaa7b('0x20')](_0x2b53f1));});};exports[_0xaa7b('0x76')]=function(_0x416b6a,_0x180a25,_0x12babe,_0x3e5b06,_0x15772e,_0x3ff3d9){var _0x220386,_0x580248,_0x38993e,_0x3c7c20;_0x3ff3d9['remoteUri']=intUtil[_0xaa7b('0x6b')](_0x3ff3d9[_0xaa7b('0x55')]);_0x3ff3d9[_0xaa7b('0x56')]=intUtil['stripTrailingSlash'](_0x3ff3d9['serverUrl']);def[_0xaa7b('0x57')]=util[_0xaa7b('0x21')](_0xaa7b('0x58'),_0x3ff3d9[_0xaa7b('0x55')]);if(_0x15772e&&_0x15772e['monitor_format']){logger[_0xaa7b('0xe')](_0xaa7b('0x77'),'Recording\x20is\x20enabled!');_0x180a25[_0xaa7b('0x5c')]=util[_0xaa7b('0x21')](_0xaa7b('0x5d'),_0x3ff3d9['serverUrl'],_0x180a25[_0xaa7b('0x5e')],md5(_0x180a25[_0xaa7b('0x5e')]));}else{_0x180a25[_0xaa7b('0x5c')]='';}return getConnection(_0x3ff3d9)[_0xaa7b('0x2d')](function(_0x3968f8){_0x3c7c20=_0x3968f8;if(!_[_0xaa7b('0x27')](_0x3e5b06)){return getUser(_0x3ff3d9,_0x3e5b06['name'],_0x3c7c20);}else{return getUser(_0x3ff3d9,null,_0x3c7c20);}})[_0xaa7b('0x2d')](function(_0x3f5665){_0x220386=_0x3f5665;logger[_0xaa7b('0xe')](_0xaa7b('0x5f'),_0x220386['id']);return getEndUser(_0x3ff3d9,_0x180a25['calleridname'],_0x180a25['calleridnum'],_0x3c7c20);})[_0xaa7b('0x2d')](function(_0xca5548){_0x580248=_0xca5548;logger[_0xaa7b('0xe')](_0xaa7b('0x78'),_0x580248['id']);return getTicket(_0x3ff3d9,_0x220386,_0x580248,_0x12babe,_0x180a25,_0x12babe[_0xaa7b('0x62')],_0x3c7c20,'Inbound');})['then'](function(_0x10c442){_0x38993e=_0x10c442;logger[_0xaa7b('0xe')](_0xaa7b('0x72'));logger[_0xaa7b('0xe')](_0xaa7b('0x64'),_0x38993e['id']);return setRelationship(_0x3c7c20,_0x220386,_0x38993e,_0xaa7b('0x73'));})[_0xaa7b('0x2d')](function(){return setRelationship(_0x3c7c20,_0x580248,_0x38993e,_0xaa7b('0x65'));})[_0xaa7b('0x2d')](function(){return getServerInfo(_0x3c7c20);})[_0xaa7b('0x6a')](function(_0x320df6){logger[_0xaa7b('0x75')]('[ABANDONED]',JSON[_0xaa7b('0x20')](_0x320df6));});}; \ 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 0c39e6b..966718a 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 _0xf832=['variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','string','push'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf832,0xd9));var _0x2f83=function(_0x5dbb3e,_0x4b494d){_0x5dbb3e=_0x5dbb3e-0x0;var _0x138d23=_0xf832[_0x5dbb3e];return _0x138d23;};'use strict';var _=require(_0x2f83('0x0'));var util=require(_0x2f83('0x1'));exports['getString']=function(_0x45352b,_0x5d6773,_0x55bfab){var _0x5b57d3=[];if(_0x45352b[_0x2f83('0x2')]>0x0){var _0x267828=_[_0x2f83('0x3')](_0x45352b,['id']);for(var _0xecbdc6=0x0;_0xecbdc6<_0x267828['length'];_0xecbdc6++){var _0x5cd361=_0x267828[_0xecbdc6];if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0x5')){_0x5b57d3[_0x2f83('0x6')](_0x5cd361['content']);}else if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0x7')&&_0x5cd361[_0x2f83('0x8')]){_0x5d6773[_0x5cd361[_0x2f83('0x8')]]&&_0x5b57d3[_0x2f83('0x6')](_0x5d6773[_0x5cd361[_0x2f83('0x8')]][_0x2f83('0x9')]());}else if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0xa')&&_0x5cd361[_0x2f83('0xb')]&&_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')]){_0x5d6773[_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')][_0x2f83('0xd')]()]&&_0x5b57d3[_0x2f83('0x6')](_0x5d6773[_0x5cd361[_0x2f83('0xb')]['name'][_0x2f83('0xd')]()][_0x2f83('0x9')]());}else if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0xe')){if(_0x5cd361[_0x2f83('0xf')]==='string'&&_0x5cd361[_0x2f83('0x10')]){_0x5b57d3[_0x2f83('0x6')](util[_0x2f83('0x11')](_0x2f83('0x12'),_0x5cd361[_0x2f83('0x10')],_0x5cd361[_0x2f83('0x13')]));}else if(_0x5cd361[_0x2f83('0xf')]===_0x2f83('0x7')&&_0x5cd361['variableName']&&_0x5cd361[_0x2f83('0x10')]){_0x5d6773[_0x5cd361[_0x2f83('0x8')]]&&_0x5b57d3[_0x2f83('0x6')](util[_0x2f83('0x11')](_0x2f83('0x12'),_0x5cd361[_0x2f83('0x10')],_0x5d6773[_0x5cd361[_0x2f83('0x8')]]));}else if(_0x5cd361[_0x2f83('0xf')]===_0x2f83('0xa')&&_0x5cd361[_0x2f83('0xb')]&&_0x5cd361[_0x2f83('0xb')]['name']&&_0x5cd361['key']){_0x5d6773[_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')][_0x2f83('0xd')]()]&&_0x5b57d3[_0x2f83('0x6')](util['format']('%s:\x20%s',_0x5cd361[_0x2f83('0x10')],_0x5d6773[_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')]['toLowerCase']()]));}}}}return _0x5b57d3[_0x2f83('0x14')](_0x55bfab);};exports[_0x2f83('0x15')]=function(_0x53aecd){var _0x40e690=_0x53aecd[_0x2f83('0x16')](-0x1);if(_0x40e690==='/'){_0x53aecd=_0x53aecd[_0x2f83('0x17')](0x0,_0x53aecd[_0x2f83('0x18')](_0x40e690));}return _0x53aecd;};exports[_0x2f83('0x19')]=function(_0x35c6bb){if(!_[_0x2f83('0x1a')](_0x35c6bb)&&_0x35c6bb!==''){var _0x383bdc=/^(([^<>()\[\]\\.,;:\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 _0x383bdc[_0x2f83('0x1b')](String(_0x35c6bb)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xdd6f=['lodash','length','string','push','content','type','variable','variableName','toString','customVariable','Variable','toLowerCase','name','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test'];(function(_0x5a5b3f,_0x18a336){var _0x1a4b89=function(_0x5d7534){while(--_0x5d7534){_0x5a5b3f['push'](_0x5a5b3f['shift']());}};_0x1a4b89(++_0x18a336);}(_0xdd6f,0x11e));var _0xfdd6=function(_0x454a7b,_0x96bcb1){_0x454a7b=_0x454a7b-0x0;var _0x18b4ab=_0xdd6f[_0x454a7b];return _0x18b4ab;};'use strict';var _=require(_0xfdd6('0x0'));var util=require('util');exports['getString']=function(_0xae7078,_0x49f882,_0x335da9){var _0x3f1fe4=[];if(_0xae7078[_0xfdd6('0x1')]>0x0){var _0x51f7a0=_['sortBy'](_0xae7078,['id']);for(var _0x27b4f0=0x0;_0x27b4f0<_0x51f7a0[_0xfdd6('0x1')];_0x27b4f0++){var _0x18eaab=_0x51f7a0[_0x27b4f0];if(_0x18eaab['type']===_0xfdd6('0x2')){_0x3f1fe4[_0xfdd6('0x3')](_0x18eaab[_0xfdd6('0x4')]);}else if(_0x18eaab[_0xfdd6('0x5')]===_0xfdd6('0x6')&&_0x18eaab[_0xfdd6('0x7')]){_0x49f882[_0x18eaab[_0xfdd6('0x7')]]&&_0x3f1fe4[_0xfdd6('0x3')](_0x49f882[_0x18eaab[_0xfdd6('0x7')]][_0xfdd6('0x8')]());}else if(_0x18eaab[_0xfdd6('0x5')]===_0xfdd6('0x9')&&_0x18eaab[_0xfdd6('0xa')]&&_0x18eaab['Variable']['name']){_0x49f882[_0x18eaab[_0xfdd6('0xa')]['name'][_0xfdd6('0xb')]()]&&_0x3f1fe4[_0xfdd6('0x3')](_0x49f882[_0x18eaab[_0xfdd6('0xa')][_0xfdd6('0xc')]['toLowerCase']()][_0xfdd6('0x8')]());}else if(_0x18eaab['type']===_0xfdd6('0xd')){if(_0x18eaab[_0xfdd6('0xe')]===_0xfdd6('0x2')&&_0x18eaab[_0xfdd6('0xf')]){_0x3f1fe4[_0xfdd6('0x3')](util[_0xfdd6('0x10')](_0xfdd6('0x11'),_0x18eaab[_0xfdd6('0xf')],_0x18eaab[_0xfdd6('0x12')]));}else if(_0x18eaab[_0xfdd6('0xe')]==='variable'&&_0x18eaab[_0xfdd6('0x7')]&&_0x18eaab[_0xfdd6('0xf')]){_0x49f882[_0x18eaab['variableName']]&&_0x3f1fe4[_0xfdd6('0x3')](util[_0xfdd6('0x10')](_0xfdd6('0x11'),_0x18eaab[_0xfdd6('0xf')],_0x49f882[_0x18eaab[_0xfdd6('0x7')]]));}else if(_0x18eaab[_0xfdd6('0xe')]==='customVariable'&&_0x18eaab[_0xfdd6('0xa')]&&_0x18eaab[_0xfdd6('0xa')]['name']&&_0x18eaab[_0xfdd6('0xf')]){_0x49f882[_0x18eaab[_0xfdd6('0xa')][_0xfdd6('0xc')][_0xfdd6('0xb')]()]&&_0x3f1fe4[_0xfdd6('0x3')](util[_0xfdd6('0x10')](_0xfdd6('0x11'),_0x18eaab[_0xfdd6('0xf')],_0x49f882[_0x18eaab[_0xfdd6('0xa')][_0xfdd6('0xc')][_0xfdd6('0xb')]()]));}}}}return _0x3f1fe4[_0xfdd6('0x13')](_0x335da9);};exports[_0xfdd6('0x14')]=function(_0x164850){var _0x38cf5b=_0x164850[_0xfdd6('0x15')](-0x1);if(_0x38cf5b==='/'){_0x164850=_0x164850['substring'](0x0,_0x164850[_0xfdd6('0x16')](_0x38cf5b));}return _0x164850;};exports[_0xfdd6('0x17')]=function(_0x5f2c31){if(!_[_0xfdd6('0x18')](_0x5f2c31)&&_0x5f2c31!==''){var _0x1f9cbf=/^(([^<>()\[\]\\.,;:\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 _0x1f9cbf[_0xfdd6('0x19')](String(_0x5f2c31)[_0xfdd6('0xb')]());}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 6b63929..5d93c71 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 _0xedd9=['success','resolve','result','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','token','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','abandoned','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','getString','Subjects','POST','format','remoteUri','create','username','sessionName','HelpDesk','then'];(function(_0x537197,_0x59177c){var _0x402bfa=function(_0x128c05){while(--_0x128c05){_0x537197['push'](_0x537197['shift']());}};_0x402bfa(++_0x59177c);}(_0xedd9,0xfc));var _0x9edd=function(_0x525158,_0x125f09){_0x525158=_0x525158-0x0;var _0x1825d3=_0xedd9[_0x525158];return _0x1825d3;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var intUtil=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('vTiger');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));function emit(_0x571af9,_0x172522,_0x190185){io['to'](_0x571af9)[_0x9edd('0xb')](_0x172522,_0x190185);}function getCustomFields(_0x3280fd,_0x49d5e3){var _0x494a24={};if(_0x3280fd['length']>0x0){_[_0x9edd('0xc')](_0x3280fd,function(_0x138767){if(_0x138767['type']===_0x9edd('0xd')&&_0x138767[_0x9edd('0xe')]){_0x494a24[_0x138767['idField']]=_0x138767[_0x9edd('0xf')][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x12')&&_0x138767[_0x9edd('0x13')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x13')]]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767['variableName']][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x14')&&_0x138767[_0x9edd('0x15')]&&_0x138767[_0x9edd('0x15')][_0x9edd('0x16')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()][_0x9edd('0x10')]();}});}return _0x494a24;}function createTicket(_0x40ba32,_0x4d8f33,_0x43dc70,_0x5d879c,_0x2cdcef,_0x1083e4,_0x4bdb88){logger['info'](_0x9edd('0x18'));var _0x50338f=_[_0x9edd('0x19')]({'parent_id':'','assigned_user_id':_0x4d8f33['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x9edd('0x1a')](_0x5d879c[_0x9edd('0x1b')],_0x2cdcef,'\x20'),'description':intUtil['getString'](_0x5d879c['Descriptions'],_0x2cdcef,'\x0a'),'contact_id':_0x43dc70['id']},getCustomFields(_0x1083e4,_0x2cdcef));var _0x341d67={'method':_0x9edd('0x1c'),'uri':util[_0x9edd('0x1d')]('%s/webservice.php',_0x40ba32[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'username':_0x40ba32[_0x9edd('0x20')],'sessionName':_0x4bdb88[_0x9edd('0x21')],'elementType':_0x9edd('0x22'),'element':JSON['stringify'](_0x50338f)},'json':!![]};return request(_0x341d67)[_0x9edd('0x23')](function(_0xeaf55a){if(_0xeaf55a[_0x9edd('0x24')]){return BPromise[_0x9edd('0x25')]({'id':_0xeaf55a[_0x9edd('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x9edd('0x27')](_0xeaf55a[_0x9edd('0x28')])));}})[_0x9edd('0x29')](function(_0x25e135){var _0x3c2227=_0x25e135['statusCode']||0x1f4;logger['error'](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x3c2227,JSON[_0x9edd('0x27')](_0x25e135));});}function getUser(_0x52746a,_0x238b22,_0x28cfae){if(intUtil[_0x9edd('0x2c')](_0x238b22)){logger[_0x9edd('0x2d')]('Getting\x20agent\x20with\x20email',_0x238b22);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x52746a[_0x9edd('0x1e')]),'qs':{'operation':_0x9edd('0x30'),'username':_0x52746a[_0x9edd('0x20')],'sessionName':_0x28cfae[_0x9edd('0x21')],'query':util[_0x9edd('0x1d')](_0x9edd('0x31'),_0x238b22)},'json':!![]})[_0x9edd('0x23')](function(_0x4fd03f){if(_0x4fd03f[_0x9edd('0x24')]&&_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x32')]){logger[_0x9edd('0x2d')]('Agent\x20found!');return BPromise[_0x9edd('0x25')]({'id':_0x4fd03f[_0x9edd('0x26')][0x0]['id'],'email':_0x4fd03f[_0x9edd('0x26')][0x0]['email1'],'name':_0x4fd03f[_0x9edd('0x26')][0x0][_0x9edd('0x33')]+'\x20'+_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x34')]});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a[_0x9edd('0x20')],'name':_0x9edd('0x37')});}})[_0x9edd('0x29')](function(_0x42c1d9){var _0x27eb7e=_0x42c1d9[_0x9edd('0x38')]||0x1f4;logger['error'](_0x9edd('0x2a'),'getUser',_0x27eb7e,JSON[_0x9edd('0x27')](_0x42c1d9));});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a['username'],'name':_0x9edd('0x37')})[_0x9edd('0x29')](function(_0x2b3469){var _0x38e9be=_0x2b3469[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x39'),_0x38e9be,JSON[_0x9edd('0x27')](_0x2b3469));});}}function getEndUser(_0x35c16f,_0x51a54a,_0x231604,_0x56a228){logger[_0x9edd('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x231604);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x35c16f['remoteUri']),'qs':{'operation':_0x9edd('0x30'),'username':_0x35c16f[_0x9edd('0x20')],'sessionName':_0x56a228[_0x9edd('0x21')],'query':util['format'](_0x9edd('0x3a'),_0x231604,_0x231604,_0x231604,_0x231604,_0x231604)},'json':!![]})['then'](function(_0x1fc4fb){if(_0x1fc4fb[_0x9edd('0x24')]&&_0x1fc4fb['result'][_0x9edd('0x32')]){logger[_0x9edd('0x2d')](_0x9edd('0x3b'));return BPromise[_0x9edd('0x25')]({'id':_0x1fc4fb['result'][0x0]['id'],'name':_0x1fc4fb[_0x9edd('0x26')][0x0]['firstname']+'\x20'+_0x1fc4fb[_0x9edd('0x26')][0x0][_0x9edd('0x3c')],'phone':_0x231604});}else{logger['info'](_0x9edd('0x3d'));return request({'method':'POST','uri':util['format'](_0x9edd('0x2f'),_0x35c16f[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'sessionName':_0x56a228[_0x9edd('0x21')],'elementType':_0x9edd('0x3e'),'element':JSON[_0x9edd('0x27')]({'lastname':_0x51a54a,'phone':_0x231604,'assigned_user_id':'\x20'})},'json':!![]})[_0x9edd('0x23')](function(_0x75efbe){logger[_0x9edd('0x2d')](_0x9edd('0x3f'));return BPromise[_0x9edd('0x25')]({'id':_0x75efbe[_0x9edd('0x26')]['id'],'name':_0x75efbe[_0x9edd('0x26')][_0x9edd('0x3c')],'phone':_0x75efbe[_0x9edd('0x26')]['phone']});})[_0x9edd('0x29')](function(_0x2570e3){var _0x2231c1=_0x2570e3[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x40'),_0x2231c1,JSON['stringify'](_0x2570e3));});}});}function getConnection(_0x4a4656){var _0x4bc7a1=_0x4a4656[_0x9edd('0x20')];var _0x58a1dd=_0x4a4656[_0x9edd('0x41')];return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'qs':{'operation':'getchallenge','username':_0x4bc7a1},'json':!![]})[_0x9edd('0x23')](function(_0x35e63c){if(_0x35e63c[_0x9edd('0x24')]){return request({'method':'POST','uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x42'),'username':_0x4bc7a1,'accessKey':md5(_0x35e63c[_0x9edd('0x26')][_0x9edd('0x43')]+_0x58a1dd)},'json':!![]});}})['then'](function(_0x441e4a){if(_0x441e4a[_0x9edd('0x24')]){return BPromise['resolve'](_0x441e4a[_0x9edd('0x26')]);}else{throw new Error(util[_0x9edd('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4a4656['id']));}})[_0x9edd('0x29')](function(_0x8134cd){var _0x468239=_0x8134cd['statusCode']||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x44'),_0x468239,JSON[_0x9edd('0x27')](_0x8134cd));});}function request(_0x53f6e3){logger[_0x9edd('0x2d')](_0x9edd('0x45'),JSON[_0x9edd('0x27')](_0x53f6e3));return rp(_0x53f6e3);}exports['queue']=function(_0x16951a,_0x21f6ce,_0x57db43,_0x8e59bd,_0x4e2aaf,_0x336494){var _0xe6b20c,_0x24245f,_0x3fcdf5,_0x1e3c19;_0x336494[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x336494[_0x9edd('0x1e')]);if(_0x4e2aaf&&_0x4e2aaf[_0x9edd('0x47')]){logger[_0x9edd('0x2d')](_0x9edd('0x48'),'Recording\x20is\x20enabled!');_0x21f6ce[_0x9edd('0x49')]=util[_0x9edd('0x1d')](_0x9edd('0x4a'),_0x336494['serverUrl'],_0x21f6ce[_0x9edd('0x4b')],md5(_0x21f6ce['uniqueid']));}else{_0x21f6ce['recordingURL']='';}return getConnection(_0x336494)['then'](function(_0x1348a7){_0x1e3c19=_0x1348a7;return getUser(_0x336494,_0x8e59bd[_0x9edd('0x4c')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x35ddb3){_0xe6b20c=_0x35ddb3;logger['info']('The\x20User\x20ID\x20is:',_0xe6b20c['id']);return getEndUser(_0x336494,_0x21f6ce['calleridname'],_0x21f6ce[_0x9edd('0x4d')],_0x1e3c19);})[_0x9edd('0x23')](function(_0xd5090a){_0x24245f=_0xd5090a;logger[_0x9edd('0x2d')](_0x9edd('0x4e'),_0x24245f['id']);return createTicket(_0x336494,_0xe6b20c,_0x24245f,_0x57db43,_0x21f6ce,_0x57db43[_0x9edd('0x4f')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x1e3087){_0x3fcdf5=_0x1e3087;logger['info'](_0x9edd('0x50'));logger['info'](_0x9edd('0x51'),_0x3fcdf5['id']);var _0x6a1cfc=util['format'](_0x9edd('0x52'),_0x336494[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x3fcdf5['id'],'x')[0x1]);logger['info'](_0x9edd('0x48'),_0x9edd('0x54'));emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x8e59bd[_0x9edd('0x16')]),_0x9edd('0x56'),{'uri':_0x6a1cfc});})['catch'](function(_0x4aa337){logger[_0x9edd('0x28')]('[QUEUE]',JSON[_0x9edd('0x27')](_0x4aa337));});};exports[_0x9edd('0x57')]=function(_0x439083,_0x17d2f2,_0x5df1d7,_0x21ead2,_0x507cce,_0x3e5dca,_0x344692){var _0xc6bde6,_0x5ca123,_0x2651a2,_0x57da5b;_0x3e5dca[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x3e5dca['remoteUri']);_0x3e5dca[_0x9edd('0x58')]=intUtil['stripTrailingSlash'](_0x3e5dca[_0x9edd('0x58')]);if(_0x344692&&_0x344692[_0x9edd('0x59')]&&_0x344692[_0x9edd('0x59')]!=='none'){logger[_0x9edd('0x2d')](_0x9edd('0x5a'),_0x9edd('0x5b'));_0x17d2f2[_0x9edd('0x49')]=util[_0x9edd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5dca['serverUrl'],_0x17d2f2[_0x9edd('0x4b')],md5(_0x17d2f2[_0x9edd('0x4b')]));}return getConnection(_0x3e5dca)['then'](function(_0x5496e9){_0x57da5b=_0x5496e9;return getUser(_0x3e5dca,_0x21ead2['email'],_0x57da5b);})[_0x9edd('0x23')](function(_0x4e003a){_0xc6bde6=_0x4e003a;logger['info'](_0x9edd('0x5c'),_0xc6bde6['id']);return getEndUser(_0x3e5dca,_0x17d2f2[_0x9edd('0x5d')],_0x17d2f2['destcalleridnum'],_0x57da5b);})[_0x9edd('0x23')](function(_0x11e082){_0x5ca123=_0x11e082;logger[_0x9edd('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x5ca123['id']);return createTicket(_0x3e5dca,_0xc6bde6,_0x5ca123,_0x5df1d7,_0x17d2f2,_0x5df1d7[_0x9edd('0x4f')],_0x57da5b);})['then'](function(_0x37b018){_0x2651a2=_0x37b018;logger[_0x9edd('0x2d')]('Ticket\x20created!');logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x2651a2['id']);var _0x5c1746=util[_0x9edd('0x1d')](_0x9edd('0x52'),_0x3e5dca[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x2651a2['id'],'x')[0x1]);logger['info'](_0x9edd('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x21ead2[_0x9edd('0x16')]),'trigger:browser:url',{'uri':_0x5c1746});})[_0x9edd('0x29')](function(_0x286593){logger[_0x9edd('0x28')](_0x9edd('0x5a'),JSON[_0x9edd('0x27')](_0x286593));});};exports[_0x9edd('0x5e')]=function(_0x3fa4a9,_0x512d3a,_0x5e29d0,_0x322165,_0x3c7874,_0x13254e){var _0x171403,_0x1e2126,_0x52f6f3,_0x2e40c8;_0x13254e[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x13254e['remoteUri']);_0x13254e[_0x9edd('0x58')]=intUtil[_0x9edd('0x46')](_0x13254e['serverUrl']);if(_0x3c7874&&_0x3c7874[_0x9edd('0x47')]){logger[_0x9edd('0x2d')]('[ABANDONED]',_0x9edd('0x5b'));_0x512d3a[_0x9edd('0x49')]=util['format'](_0x9edd('0x4a'),_0x13254e['serverUrl'],_0x512d3a['uniqueid'],md5(_0x512d3a[_0x9edd('0x4b')]));}else{_0x512d3a[_0x9edd('0x49')]='';}return getConnection(_0x13254e)[_0x9edd('0x23')](function(_0x5b56c7){_0x2e40c8=_0x5b56c7;return getUser(_0x13254e,'',_0x2e40c8);})[_0x9edd('0x23')](function(_0x286e47){_0x171403=_0x286e47;logger['info'](_0x9edd('0x5c'),_0x171403['id']);return getEndUser(_0x13254e,_0x512d3a[_0x9edd('0x5f')],_0x512d3a[_0x9edd('0x4d')],_0x2e40c8);})[_0x9edd('0x23')](function(_0x54ac71){_0x1e2126=_0x54ac71;logger['info'](_0x9edd('0x4e'),_0x1e2126['id']);return createTicket(_0x13254e,_0x171403,_0x1e2126,_0x5e29d0,_0x512d3a,_0x5e29d0['Fields'],_0x2e40c8);})[_0x9edd('0x23')](function(_0x2c71ce){_0x52f6f3=_0x2c71ce;logger[_0x9edd('0x2d')](_0x9edd('0x50'));logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x52f6f3['id']);})[_0x9edd('0x29')](function(_0x5a4d4b){logger[_0x9edd('0x28')]('[ABANDONED]',JSON[_0x9edd('0x27')](_0x5a4d4b));});}; \ No newline at end of file +var _0x3e74=['Normal','getString','Subjects','Descriptions','POST','format','%s/webservice.php','remoteUri','username','stringify','then','success','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','statusCode','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','Agent\x20found!','email1','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','userId','admin','getUser','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','create','Enduser\x20created.','lastname','phone','getEndUser','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Ticket\x20created!','[OUTBOUND]','user:%s','abandoned','[ABANDONED]','lodash','bluebird','md5','util','../../../../config/environment','vTiger','redis','defaults','localhost','emit','forEach','string','idField','content','type','variable','variableName','toString','Variable','name','info','Creating\x20new\x20ticket...','merge'];(function(_0x5af22a,_0x203af1){var _0x3dba36=function(_0x1607de){while(--_0x1607de){_0x5af22a['push'](_0x5af22a['shift']());}};_0x3dba36(++_0x203af1);}(_0x3e74,0x175));var _0x43e7=function(_0x4b67fe,_0xbb3192){_0x4b67fe=_0x4b67fe-0x0;var _0x2e66fd=_0x3e74[_0x4b67fe];return _0x2e66fd;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var BPromise=require(_0x43e7('0x1'));var md5=require(_0x43e7('0x2'));var util=require(_0x43e7('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x43e7('0x4'));var logger=require('../../../../config/logger')(_0x43e7('0x5'));config[_0x43e7('0x6')]=_[_0x43e7('0x7')](config[_0x43e7('0x6')],{'host':_0x43e7('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0x6')]));function emit(_0x3491d6,_0x2ede2d,_0x8528fc){io['to'](_0x3491d6)[_0x43e7('0x9')](_0x2ede2d,_0x8528fc);}function getCustomFields(_0x516b4d,_0x212c6c){var _0x554d44={};if(_0x516b4d['length']>0x0){_[_0x43e7('0xa')](_0x516b4d,function(_0x4139c9){if(_0x4139c9['type']===_0x43e7('0xb')&&_0x4139c9['idField']){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x4139c9[_0x43e7('0xd')]['toString']();}else if(_0x4139c9[_0x43e7('0xe')]===_0x43e7('0xf')&&_0x4139c9[_0x43e7('0x10')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9['variableName']]){_0x554d44[_0x4139c9['idField']]=_0x212c6c[_0x4139c9[_0x43e7('0x10')]][_0x43e7('0x11')]();}else if(_0x4139c9[_0x43e7('0xe')]==='customVariable'&&_0x4139c9['Variable']&&_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]&&_0x4139c9[_0x43e7('0xc')]&&_0x212c6c[_0x4139c9[_0x43e7('0x12')]['name']['toLowerCase']()]){_0x554d44[_0x4139c9[_0x43e7('0xc')]]=_0x212c6c[_0x4139c9[_0x43e7('0x12')][_0x43e7('0x13')]['toLowerCase']()]['toString']();}});}return _0x554d44;}function createTicket(_0x446986,_0x1ca758,_0x9037d3,_0x140657,_0x3776f5,_0x1f24fb,_0x619236){logger[_0x43e7('0x14')](_0x43e7('0x15'));var _0xab63cf=_[_0x43e7('0x16')]({'parent_id':'','assigned_user_id':_0x1ca758['id'],'ticketpriorities':_0x43e7('0x17'),'ticketstatus':'Open','ticket_title':intUtil[_0x43e7('0x18')](_0x140657[_0x43e7('0x19')],_0x3776f5,'\x20'),'description':intUtil['getString'](_0x140657[_0x43e7('0x1a')],_0x3776f5,'\x0a'),'contact_id':_0x9037d3['id']},getCustomFields(_0x1f24fb,_0x3776f5));var _0x3e281e={'method':_0x43e7('0x1b'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986[_0x43e7('0x1e')]),'form':{'operation':'create','username':_0x446986[_0x43e7('0x1f')],'sessionName':_0x619236['sessionName'],'elementType':'HelpDesk','element':JSON[_0x43e7('0x20')](_0xab63cf)},'json':!![]};return request(_0x3e281e)[_0x43e7('0x21')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x22')]){return BPromise['resolve']({'id':_0x4b2b9f[_0x43e7('0x23')]['id']});}else{throw new Error(util['format'](_0x43e7('0x24'),JSON[_0x43e7('0x20')](_0x4b2b9f[_0x43e7('0x25')])));}})[_0x43e7('0x26')](function(_0x51f4d7){var _0x52b7b3=_0x51f4d7[_0x43e7('0x27')]||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x29'),_0x52b7b3,JSON[_0x43e7('0x20')](_0x51f4d7));});}function getUser(_0xb1fc63,_0x5087d7,_0x33a1a5){if(intUtil[_0x43e7('0x2a')](_0x5087d7)){logger[_0x43e7('0x14')](_0x43e7('0x2b'),_0x5087d7);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')](_0x43e7('0x1d'),_0xb1fc63[_0x43e7('0x1e')]),'qs':{'operation':_0x43e7('0x2d'),'username':_0xb1fc63[_0x43e7('0x1f')],'sessionName':_0x33a1a5[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x2f'),_0x5087d7)},'json':!![]})[_0x43e7('0x21')](function(_0x4bdb17){if(_0x4bdb17[_0x43e7('0x22')]&&_0x4bdb17[_0x43e7('0x23')][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x31'));return BPromise['resolve']({'id':_0x4bdb17[_0x43e7('0x23')][0x0]['id'],'email':_0x4bdb17[_0x43e7('0x23')][0x0][_0x43e7('0x32')],'name':_0x4bdb17[_0x43e7('0x23')][0x0]['first_name']+'\x20'+_0x4bdb17['result']['last_name']});}else{logger[_0x43e7('0x14')](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')});}})['catch'](function(_0x47baee){var _0x4ac23d=_0x47baee['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','getUser',_0x4ac23d,JSON[_0x43e7('0x20')](_0x47baee));});}else{logger['info'](_0x43e7('0x33'));return BPromise[_0x43e7('0x34')]({'id':_0x33a1a5[_0x43e7('0x35')],'email':_0xb1fc63[_0x43e7('0x1f')],'name':_0x43e7('0x36')})[_0x43e7('0x26')](function(_0x101d45){var _0x4f1a5f=_0x101d45['statusCode']||0x1f4;logger['error'](_0x43e7('0x28'),_0x43e7('0x37'),_0x4f1a5f,JSON[_0x43e7('0x20')](_0x101d45));});}}function getEndUser(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589){logger[_0x43e7('0x14')]('Searching\x20end\x20user\x20with\x20phone',_0x1ed538);return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x16cdba[_0x43e7('0x1e')]),'qs':{'operation':'query','username':_0x16cdba[_0x43e7('0x1f')],'sessionName':_0x1d4589[_0x43e7('0x2e')],'query':util[_0x43e7('0x1c')](_0x43e7('0x38'),_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538,_0x1ed538)},'json':!![]})[_0x43e7('0x21')](function(_0x234d8f){if(_0x234d8f['success']&&_0x234d8f['result'][_0x43e7('0x30')]){logger[_0x43e7('0x14')](_0x43e7('0x39'));return BPromise[_0x43e7('0x34')]({'id':_0x234d8f[_0x43e7('0x23')][0x0]['id'],'name':_0x234d8f['result'][0x0][_0x43e7('0x3a')]+'\x20'+_0x234d8f[_0x43e7('0x23')][0x0]['lastname'],'phone':_0x1ed538});}else{logger[_0x43e7('0x14')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'method':_0x43e7('0x1b'),'uri':util['format'](_0x43e7('0x1d'),_0x16cdba[_0x43e7('0x1e')]),'form':{'operation':_0x43e7('0x3b'),'sessionName':_0x1d4589[_0x43e7('0x2e')],'elementType':'Contacts','element':JSON['stringify']({'lastname':_0x1b1440,'phone':_0x1ed538,'assigned_user_id':'\x20'})},'json':!![]})[_0x43e7('0x21')](function(_0x40c509){logger[_0x43e7('0x14')](_0x43e7('0x3c'));return BPromise['resolve']({'id':_0x40c509['result']['id'],'name':_0x40c509['result'][_0x43e7('0x3d')],'phone':_0x40c509['result'][_0x43e7('0x3e')]});})['catch'](function(_0x5b28db){var _0x46b2e6=_0x5b28db['statusCode']||0x1f4;logger[_0x43e7('0x25')](_0x43e7('0x28'),_0x43e7('0x3f'),_0x46b2e6,JSON[_0x43e7('0x20')](_0x5b28db));});}});}function getConnection(_0x4fc5e8){var _0x91f1e4=_0x4fc5e8[_0x43e7('0x1f')];var _0x23a611=_0x4fc5e8[_0x43e7('0x40')];return request({'method':_0x43e7('0x2c'),'uri':util[_0x43e7('0x1c')]('%s/webservice.php',_0x4fc5e8['remoteUri']),'qs':{'operation':_0x43e7('0x41'),'username':_0x91f1e4},'json':!![]})[_0x43e7('0x21')](function(_0x212841){if(_0x212841['success']){return request({'method':'POST','uri':util['format'](_0x43e7('0x1d'),_0x4fc5e8[_0x43e7('0x1e')]),'form':{'operation':'login','username':_0x91f1e4,'accessKey':md5(_0x212841[_0x43e7('0x23')][_0x43e7('0x42')]+_0x23a611)},'json':!![]});}})[_0x43e7('0x21')](function(_0x560329){if(_0x560329['success']){return BPromise['resolve'](_0x560329['result']);}else{throw new Error(util[_0x43e7('0x1c')](_0x43e7('0x43'),_0x4fc5e8['id']));}})['catch'](function(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x27')]||0x1f4;logger[_0x43e7('0x25')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x43e7('0x44'),_0x82d32f,JSON['stringify'](_0x23e7cb));});}function request(_0x4bebd4){logger[_0x43e7('0x14')](_0x43e7('0x45'),JSON[_0x43e7('0x20')](_0x4bebd4));return rp(_0x4bebd4);}exports[_0x43e7('0x46')]=function(_0x13503c,_0x2351cf,_0x1cd87c,_0x256ddd,_0x473fca,_0x2b5515){var _0x58dfd0,_0x119d34,_0x46c910,_0x499c03;_0x2b5515[_0x43e7('0x1e')]=intUtil['stripTrailingSlash'](_0x2b5515[_0x43e7('0x1e')]);if(_0x473fca&&_0x473fca[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x48'),_0x43e7('0x49'));_0x2351cf['recordingURL']=util['format'](_0x43e7('0x4a'),_0x2b5515[_0x43e7('0x4b')],_0x2351cf[_0x43e7('0x4c')],md5(_0x2351cf[_0x43e7('0x4c')]));}else{_0x2351cf[_0x43e7('0x4d')]='';}return getConnection(_0x2b5515)[_0x43e7('0x21')](function(_0xa47464){_0x499c03=_0xa47464;return getUser(_0x2b5515,_0x256ddd[_0x43e7('0x4e')],_0x499c03);})[_0x43e7('0x21')](function(_0x24e758){_0x58dfd0=_0x24e758;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x58dfd0['id']);return getEndUser(_0x2b5515,_0x2351cf[_0x43e7('0x4f')],_0x2351cf[_0x43e7('0x50')],_0x499c03);})['then'](function(_0x4314d8){_0x119d34=_0x4314d8;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x119d34['id']);return createTicket(_0x2b5515,_0x58dfd0,_0x119d34,_0x1cd87c,_0x2351cf,_0x1cd87c['Fields'],_0x499c03);})['then'](function(_0x459c13){_0x46c910=_0x459c13;logger[_0x43e7('0x14')]('Ticket\x20created!');logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x46c910['id']);var _0x49a6ce=util[_0x43e7('0x1c')](_0x43e7('0x52'),_0x2b5515[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x46c910['id'],'x')[0x1]);logger[_0x43e7('0x14')]('[QUEUE]',_0x43e7('0x54'));emit(util[_0x43e7('0x1c')]('user:%s',_0x256ddd[_0x43e7('0x13')]),_0x43e7('0x55'),{'uri':_0x49a6ce});})[_0x43e7('0x26')](function(_0x5bb536){logger['error']('[QUEUE]',JSON[_0x43e7('0x20')](_0x5bb536));});};exports[_0x43e7('0x56')]=function(_0x323cf7,_0x3a6404,_0x52ea9c,_0x5a50fc,_0x1b27da,_0x8b50bb,_0x140438){var _0x5dd349,_0x5ea0db,_0x4438c0,_0x1a7cb5;_0x8b50bb[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x1e')]);_0x8b50bb[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0x8b50bb[_0x43e7('0x4b')]);if(_0x140438&&_0x140438[_0x43e7('0x58')]&&_0x140438[_0x43e7('0x58')]!==_0x43e7('0x59')){logger['info']('[OUTBOUND]',_0x43e7('0x49'));_0x3a6404['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x8b50bb[_0x43e7('0x4b')],_0x3a6404[_0x43e7('0x4c')],md5(_0x3a6404['uniqueid']));}return getConnection(_0x8b50bb)[_0x43e7('0x21')](function(_0x135791){_0x1a7cb5=_0x135791;return getUser(_0x8b50bb,_0x5a50fc[_0x43e7('0x4e')],_0x1a7cb5);})['then'](function(_0x2b7406){_0x5dd349=_0x2b7406;logger[_0x43e7('0x14')](_0x43e7('0x5a'),_0x5dd349['id']);return getEndUser(_0x8b50bb,_0x3a6404[_0x43e7('0x5b')],_0x3a6404[_0x43e7('0x5c')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x1e02fa){_0x5ea0db=_0x1e02fa;logger['info'](_0x43e7('0x51'),_0x5ea0db['id']);return createTicket(_0x8b50bb,_0x5dd349,_0x5ea0db,_0x52ea9c,_0x3a6404,_0x52ea9c[_0x43e7('0x5d')],_0x1a7cb5);})[_0x43e7('0x21')](function(_0x549f4e){_0x4438c0=_0x549f4e;logger['info'](_0x43e7('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x4438c0['id']);var _0x1b793d=util[_0x43e7('0x1c')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x8b50bb[_0x43e7('0x1e')],_[_0x43e7('0x53')](_0x4438c0['id'],'x')[0x1]);logger[_0x43e7('0x14')](_0x43e7('0x5f'),_0x43e7('0x54'));emit(util[_0x43e7('0x1c')](_0x43e7('0x60'),_0x5a50fc['name']),_0x43e7('0x55'),{'uri':_0x1b793d});})[_0x43e7('0x26')](function(_0x4e5956){logger[_0x43e7('0x25')]('[OUTBOUND]',JSON[_0x43e7('0x20')](_0x4e5956));});};exports[_0x43e7('0x61')]=function(_0x37301b,_0x1ca24b,_0x506361,_0x2d25b5,_0x2646c2,_0xf929a5){var _0x556001,_0x17889c,_0x38fa5b,_0x219dc6;_0xf929a5[_0x43e7('0x1e')]=intUtil[_0x43e7('0x57')](_0xf929a5['remoteUri']);_0xf929a5[_0x43e7('0x4b')]=intUtil[_0x43e7('0x57')](_0xf929a5[_0x43e7('0x4b')]);if(_0x2646c2&&_0x2646c2[_0x43e7('0x47')]){logger[_0x43e7('0x14')](_0x43e7('0x62'),_0x43e7('0x49'));_0x1ca24b['recordingURL']=util['format'](_0x43e7('0x4a'),_0xf929a5['serverUrl'],_0x1ca24b['uniqueid'],md5(_0x1ca24b['uniqueid']));}else{_0x1ca24b[_0x43e7('0x4d')]='';}return getConnection(_0xf929a5)[_0x43e7('0x21')](function(_0x230fda){_0x219dc6=_0x230fda;return getUser(_0xf929a5,'',_0x219dc6);})[_0x43e7('0x21')](function(_0x18713b){_0x556001=_0x18713b;logger[_0x43e7('0x14')]('The\x20User\x20ID\x20is:',_0x556001['id']);return getEndUser(_0xf929a5,_0x1ca24b[_0x43e7('0x4f')],_0x1ca24b[_0x43e7('0x50')],_0x219dc6);})[_0x43e7('0x21')](function(_0x5b4c76){_0x17889c=_0x5b4c76;logger[_0x43e7('0x14')](_0x43e7('0x51'),_0x17889c['id']);return createTicket(_0xf929a5,_0x556001,_0x17889c,_0x506361,_0x1ca24b,_0x506361[_0x43e7('0x5d')],_0x219dc6);})[_0x43e7('0x21')](function(_0x1afea6){_0x38fa5b=_0x1afea6;logger[_0x43e7('0x14')](_0x43e7('0x5e'));logger[_0x43e7('0x14')]('The\x20Ticket\x20ID\x20is:',_0x38fa5b['id']);})['catch'](function(_0x55990c){logger[_0x43e7('0x25')](_0x43e7('0x62'),JSON['stringify'](_0x55990c));});}; \ 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 5d5e19e..2cb7ef9 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 _0x208d=['%s/users.json','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','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...','trigger:browser:url','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','user:%s','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','monitor_format','Authorization','lodash','request-promise','md5','util','./util','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','length','filter','results','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x2b7cb7,_0x5e9f80){var _0xc42095=function(_0x3d574b){while(--_0x3d574b){_0x2b7cb7['push'](_0x2b7cb7['shift']());}};_0xc42095(++_0x5e9f80);}(_0x208d,0xa4));var _0xd208=function(_0x91384,_0x545eef){_0x91384=_0x91384-0x0;var _0x44daa0=_0x208d[_0x91384];return _0x44daa0;};'use strict';var _=require(_0xd208('0x0'));var rp=require(_0xd208('0x1'));var md5=require(_0xd208('0x2'));var util=require(_0xd208('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd208('0x4'));var config=require('../../../../config/environment');var logger=require(_0xd208('0x5'))(_0xd208('0x6'));config[_0xd208('0x7')]=_[_0xd208('0x8')](config[_0xd208('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd208('0x9'))(new Redis(config[_0xd208('0x7')]));function emit(_0x25008a,_0x521d9c,_0xc03f32){io['to'](_0x25008a)[_0xd208('0xa')](_0x521d9c,_0xc03f32);}var headers={'Content-Type':'application/json','Accept':_0xd208('0xb')};function getTicket(_0x406cbb,_0x59971b,_0x3ffd09,_0x1fd038,_0x3689f7){logger[_0xd208('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xd208('0xd')](_0xd208('0xe'),_0x406cbb['remoteUri']),'method':_0xd208('0xf'),'body':{'ticket':_[_0xd208('0x10')]({'requester_id':_0x3ffd09['id'],'submitter_id':_0x59971b?_0x59971b['id']:undefined,'assignee_id':_0x59971b?_0x59971b['id']:undefined,'tags':getTags(_0x1fd038[_0xd208('0x11')],_0xd208('0x12')),'subject':intUtil[_0xd208('0x13')](_0x1fd038[_0xd208('0x14')],_0x3689f7,'\x20'),'description':intUtil[_0xd208('0x13')](_0x1fd038['Descriptions'],_0x3689f7,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x1fd038[_0xd208('0x15')],_0x3689f7,'\x0a')}},getCustomFields(_0x1fd038[_0xd208('0x16')],_0x3689f7))}})[_0xd208('0x17')](function(_0x3a8da5){logger[_0xd208('0xc')](_0xd208('0x18'));return _0x3a8da5['ticket'];});}function getUser(_0x21a27b,_0x3d057a){if(intUtil['validateEmail'](_0x3d057a)){logger[_0xd208('0xc')]('Getting\x20agent\x20with\x20email',_0x3d057a);return request({'uri':util[_0xd208('0xd')](_0xd208('0x19'),_0x21a27b[_0xd208('0x1a')]),'qs':{'query':util[_0xd208('0xd')](_0xd208('0x1b'),_0x3d057a)}})[_0xd208('0x17')](function(_0x443212){if(_0x443212[_0xd208('0x1c')]){logger[_0xd208('0xc')]('Agent\x20found!');return _[_0xd208('0x1d')](_0x443212['results'],{'email':_0x3d057a,'role':_0xd208('0x1e')});}else{logger['info'](_0xd208('0x1f'));return request({'uri':util[_0xd208('0xd')](_0xd208('0x20'),_0x21a27b[_0xd208('0x1a')])})[_0xd208('0x17')](function(_0x487a3b){logger[_0xd208('0xc')](_0xd208('0x21'));return _0x487a3b['user'];});}});}else{logger[_0xd208('0xc')](_0xd208('0x1f'));return request({'uri':util[_0xd208('0xd')](_0xd208('0x20'),_0x21a27b[_0xd208('0x1a')])})[_0xd208('0x17')](function(_0x514bb5){logger[_0xd208('0xc')](_0xd208('0x21'));return _0x514bb5[_0xd208('0x22')];});}}function getEndUser(_0x366aa9,_0x443901,_0x836063){logger['info']('Searching\x20enduser\x20with\x20phone',_0x836063);return request({'uri':util['format']('%s/search.json',_0x366aa9[_0xd208('0x1a')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x836063)}})['then'](function(_0xedb562){var _0x29e1f5;if(_0xedb562['results'][_0xd208('0x23')]){_0xedb562['results']=_[_0xd208('0x24')](_0xedb562[_0xd208('0x25')],{'suspended':![],'role':_0xd208('0x26')});if(_0xedb562[_0xd208('0x25')][_0xd208('0x23')]){_0x29e1f5=_[_0xd208('0x27')](_0xedb562[_0xd208('0x25')]);}}if(_0x29e1f5){logger[_0xd208('0xc')](_0xd208('0x28'));return _0x29e1f5;}else{logger['info'](_0xd208('0x29'));return request({'uri':util[_0xd208('0xd')](_0xd208('0x2a'),_0x366aa9['remoteUri']),'method':_0xd208('0xf'),'body':{'user':{'role':_0xd208('0x26'),'name':util['format']('Caller\x20-\x20%s',_0x443901||_0x836063),'phone':_0x836063}}})[_0xd208('0x17')](function(_0x1b343a){logger[_0xd208('0xc')]('Enduser\x20created.');return _0x1b343a[_0xd208('0x22')];});}});}function getAuth(_0x3414be){var _0x3d1608;if(_0x3414be[_0xd208('0x2b')]===_0xd208('0x2c')){_0x3d1608=util['format']('%s:%s',_0x3414be[_0xd208('0x2d')],_0x3414be[_0xd208('0x2c')]);}else if(_0x3414be[_0xd208('0x2b')]===_0xd208('0x2e')){_0x3d1608=util[_0xd208('0xd')](_0xd208('0x2f'),_0x3414be[_0xd208('0x2d')],_0x3414be[_0xd208('0x2e')]);}return util[_0xd208('0xd')](_0xd208('0x30'),new Buffer(_0x3d1608)[_0xd208('0x31')](_0xd208('0x32')));}function request(_0x53f7f9){logger[_0xd208('0x33')](_0xd208('0x34'),JSON[_0xd208('0x35')](_0x53f7f9));return rp(_[_0xd208('0x8')](_0x53f7f9,{'method':_0xd208('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x3b61c5,_0x2b2751){var _0x1d866d=[];if(_0x3b61c5&&_0x3b61c5[_0xd208('0x23')]>0x0){_0x1d866d=_[_0xd208('0x37')](_0x3b61c5,_0x2b2751);}return _0x1d866d;}function getCustomFields(_0x1164ee,_0x5c0646){var _0x432307=[];var _0x187a9f={'custom_fields':[]};if(_0x1164ee[_0xd208('0x23')]>0x0){_['forEach'](_0x1164ee,function(_0x5f4f8c){if(_0x5f4f8c[_0xd208('0x38')]==='string'&&_0x5f4f8c[_0xd208('0x39')]&&!_0x5f4f8c[_0xd208('0x3a')]){_0x187a9f[_0x5f4f8c[_0xd208('0x39')][_0xd208('0x3b')]()]=_0x5f4f8c[_0xd208('0x3c')][_0xd208('0x31')]();}else if(_0x5f4f8c['type']===_0xd208('0x3d')&&_0x5f4f8c[_0xd208('0x3e')]&&_0x5f4f8c[_0xd208('0x3a')]){_0x187a9f[_0xd208('0x3f')][_0xd208('0x40')]({'id':_0x5f4f8c[_0xd208('0x3e')],'value':_0x5f4f8c['content']['toString']()});}else if(_0x5f4f8c[_0xd208('0x38')]===_0xd208('0x41')&&_0x5f4f8c[_0xd208('0x42')]&&_0x5f4f8c[_0xd208('0x3e')]&&_0x5f4f8c[_0xd208('0x3a')]){_0x5c0646[_0x5f4f8c[_0xd208('0x42')]]&&_0x187a9f['custom_fields'][_0xd208('0x40')]({'id':_0x5f4f8c[_0xd208('0x3e')],'value':_0x5c0646[_0x5f4f8c[_0xd208('0x42')]][_0xd208('0x31')]()});}else if(_0x5f4f8c['type']===_0xd208('0x43')&&_0x5f4f8c[_0xd208('0x44')]&&_0x5f4f8c[_0xd208('0x44')]['name']&&_0x5f4f8c['idField']&&_0x5f4f8c[_0xd208('0x3a')]){_0x5c0646[_0x5f4f8c[_0xd208('0x44')]['name']['toLowerCase']()]&&_0x187a9f[_0xd208('0x3f')][_0xd208('0x40')]({'id':_0x5f4f8c['idField'],'value':_0x5c0646[_0x5f4f8c[_0xd208('0x44')][_0xd208('0x12')]['toLowerCase']()][_0xd208('0x31')]()});}});}return _0x187a9f;}exports['queue']=function(_0x46b1a5,_0x548d52,_0x34febd,_0x17cfda,_0x426dbf,_0x228328){var _0x23f22b,_0x2887fc;_0x228328[_0xd208('0x1a')]=intUtil[_0xd208('0x45')](_0x228328[_0xd208('0x1a')]);_0x228328[_0xd208('0x46')]=intUtil[_0xd208('0x45')](_0x228328[_0xd208('0x46')]);if(_0x426dbf&&_0x426dbf['monitor_format']){logger['info'](_0xd208('0x47'),'Recording\x20is\x20enabled!');_0x548d52['recordingURL']=util['format'](_0xd208('0x48'),_0x228328[_0xd208('0x46')],_0x548d52[_0xd208('0x49')],md5(_0x548d52['uniqueid']));}else{_0x548d52[_0xd208('0x4a')]='';}headers['Authorization']=getAuth(_0x228328);return getUser(_0x228328,_0x17cfda[_0xd208('0x4b')])[_0xd208('0x17')](function(_0x5f476d){_0x23f22b=_0x5f476d;logger[_0xd208('0xc')](_0xd208('0x4c'),_0x23f22b['id']);return getEndUser(_0x228328,_0x548d52[_0xd208('0x4d')],_0x548d52[_0xd208('0x4e')]);})[_0xd208('0x17')](function(_0x4f1892){_0x2887fc=_0x4f1892;logger['info'](_0xd208('0x4f'),_0x2887fc['id']);return getTicket(_0x228328,_0x23f22b,_0x2887fc,_0x34febd,_0x548d52);})[_0xd208('0x17')](function(_0x10bf13){if(_0x10bf13){logger[_0xd208('0xc')](_0xd208('0x50'),_0x10bf13['id']);switch(_0x228328[_0xd208('0x38')]){case _0xd208('0x51'):logger['info'](_0xd208('0x47'),_0xd208('0x52'));return request({'uri':util['format'](_0xd208('0x53'),_0x228328[_0xd208('0x1a')],_0x23f22b['id'],_0x10bf13['id']),'method':'POST'});case _0xd208('0x54'):logger[_0xd208('0xc')](_0xd208('0x47'),_0xd208('0x55'));emit(util['format']('user:%s',_0x17cfda[_0xd208('0x12')]),_0xd208('0x56'),{'uri':util[_0xd208('0xd')]('%s/agent/tickets/%s',_0x228328[_0xd208('0x1a')],_0x10bf13['id'])});break;default:logger[_0xd208('0x57')](_0xd208('0x47'),_0xd208('0x58'));}}})[_0xd208('0x59')](function(_0x19c23c){logger[_0xd208('0x57')](_0xd208('0x5a'),util[_0xd208('0x5b')](_0x19c23c,{'showHidden':!![],'depth':null}));});};exports[_0xd208('0x5c')]=function(_0xfeb66b,_0x218ade,_0x79ed46,_0x438e5d,_0x3593fb,_0x40813e,_0x19327e){var _0x301e23,_0x220aed;_0x40813e[_0xd208('0x1a')]=intUtil[_0xd208('0x45')](_0x40813e[_0xd208('0x1a')]);_0x40813e[_0xd208('0x46')]=intUtil['stripTrailingSlash'](_0x40813e[_0xd208('0x46')]);if(_0x19327e&&_0x19327e['recordingFormat']&&_0x19327e[_0xd208('0x5d')]!==_0xd208('0x5e')){logger[_0xd208('0xc')]('[OUTBOUND]',_0xd208('0x5f'));_0x218ade['recordingURL']=util[_0xd208('0xd')](_0xd208('0x48'),_0x40813e['serverUrl'],_0x218ade['uniqueid'],md5(_0x218ade[_0xd208('0x49')]));}headers['Authorization']=getAuth(_0x40813e);return getUser(_0x40813e,_0x438e5d[_0xd208('0x4b')])[_0xd208('0x17')](function(_0x5c44af){_0x301e23=_0x5c44af;logger[_0xd208('0xc')](_0xd208('0x4c'),_0x301e23['id']);return getEndUser(_0x40813e,_0x218ade[_0xd208('0x60')],_0x218ade['destcalleridnum']);})[_0xd208('0x17')](function(_0x149d92){_0x220aed=_0x149d92;logger[_0xd208('0xc')](_0xd208('0x4f'),_0x220aed['id']);return getTicket(_0x40813e,_0x301e23,_0x220aed,_0x79ed46,_0x218ade);})['then'](function(_0x2c1676){if(_0x2c1676){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2c1676['id']);switch(_0x40813e[_0xd208('0x38')]){case _0xd208('0x51'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd208('0xd')](_0xd208('0x53'),_0x40813e[_0xd208('0x1a')],_0x301e23['id'],_0x2c1676['id']),'method':_0xd208('0xf')});case _0xd208('0x54'):logger['info']('[OUTBOUND]',_0xd208('0x55'));emit(util[_0xd208('0xd')](_0xd208('0x61'),_0x438e5d[_0xd208('0x12')]),_0xd208('0x56'),{'uri':util[_0xd208('0xd')]('%s/agent/tickets/%s',_0x40813e['remoteUri'],_0x2c1676['id'])});break;default:logger['error'](_0xd208('0x62'),_0xd208('0x58'));}}})[_0xd208('0x59')](function(_0x195b77){logger[_0xd208('0x57')](_0xd208('0x63'),util[_0xd208('0x5b')](_0x195b77,{'showHidden':!![],'depth':null}));});};exports[_0xd208('0x64')]=function(_0x30807c,_0x5475ff,_0xcce66f,_0x58fa38,_0x34383a,_0x255b2d){var _0x32c9df,_0x5744fe;_0x255b2d['remoteUri']=intUtil['stripTrailingSlash'](_0x255b2d[_0xd208('0x1a')]);_0x255b2d[_0xd208('0x46')]=intUtil[_0xd208('0x45')](_0x255b2d['serverUrl']);if(_0x34383a&&_0x34383a[_0xd208('0x65')]){logger[_0xd208('0xc')]('[ABANDONED]',_0xd208('0x5f'));_0x5475ff[_0xd208('0x4a')]=util[_0xd208('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x255b2d['serverUrl'],_0x5475ff[_0xd208('0x49')],md5(_0x5475ff[_0xd208('0x49')]));}else{_0x5475ff[_0xd208('0x4a')]='';}headers[_0xd208('0x66')]=getAuth(_0x255b2d);return getUser(_0x255b2d)[_0xd208('0x17')](function(_0x8c173b){_0x32c9df=_0x8c173b;logger[_0xd208('0xc')](_0xd208('0x4c'),_0x32c9df['id']);return getEndUser(_0x255b2d,_0x5475ff[_0xd208('0x4d')],_0x5475ff[_0xd208('0x4e')]);})['then'](function(_0x164c71){_0x5744fe=_0x164c71;logger[_0xd208('0xc')]('The\x20Enduser\x20ID\x20is:',_0x5744fe['id']);return getTicket(_0x255b2d,_0x32c9df,_0x5744fe,_0xcce66f,_0x5475ff);})[_0xd208('0x17')](function(_0x34f29a){if(_0x34f29a){logger['info'](_0xd208('0x50'),_0x34f29a['id']);}})['catch'](function(_0x5ddf2f){logger[_0xd208('0x57')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd208('0x5b')](_0x5ddf2f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x894f=['push','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','%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','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','integrationTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','../../../../config/environment','../../../../config/logger','defaults','redis','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','ticket','%s/search.json','then','count','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','end-user','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','string','customField','toLowerCase','content','type','idField','custom_fields'];(function(_0x3afe18,_0x26922c){var _0x19ed1f=function(_0x1c0660){while(--_0x1c0660){_0x3afe18['push'](_0x3afe18['shift']());}};_0x19ed1f(++_0x26922c);}(_0x894f,0x14d));var _0xf894=function(_0x19b481,_0x2c875a){_0x19b481=_0x19b481-0x0;var _0x3ac8a5=_0x894f[_0x19b481];return _0x3ac8a5;};'use strict';var _=require(_0xf894('0x0'));var rp=require(_0xf894('0x1'));var md5=require(_0xf894('0x2'));var util=require(_0xf894('0x3'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xf894('0x4'));var logger=require(_0xf894('0x5'))('zendesk');config['redis']=_[_0xf894('0x6')](config[_0xf894('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf894('0x7')]));function emit(_0x371f86,_0x56d9d6,_0x190cb1){io['to'](_0x371f86)[_0xf894('0x8')](_0x56d9d6,_0x190cb1);}var headers={'Content-Type':_0xf894('0x9'),'Accept':_0xf894('0x9')};function getTicket(_0x10bb84,_0x25b554,_0x2057b5,_0x420296,_0x397a7b){logger[_0xf894('0xa')](_0xf894('0xb'));return request({'uri':util[_0xf894('0xc')](_0xf894('0xd'),_0x10bb84[_0xf894('0xe')]),'method':_0xf894('0xf'),'body':{'ticket':_[_0xf894('0x10')]({'requester_id':_0x2057b5['id'],'submitter_id':_0x25b554?_0x25b554['id']:undefined,'assignee_id':_0x25b554?_0x25b554['id']:undefined,'tags':getTags(_0x420296[_0xf894('0x11')],_0xf894('0x12')),'subject':intUtil[_0xf894('0x13')](_0x420296[_0xf894('0x14')],_0x397a7b,'\x20'),'description':intUtil[_0xf894('0x13')](_0x420296[_0xf894('0x15')],_0x397a7b,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x420296[_0xf894('0x15')],_0x397a7b,'\x0a')}},getCustomFields(_0x420296['Fields'],_0x397a7b))}})['then'](function(_0x3fd31f){logger[_0xf894('0xa')](_0xf894('0x16'));return _0x3fd31f[_0xf894('0x17')];});}function getUser(_0x2142cb,_0x49098c){if(intUtil['validateEmail'](_0x49098c)){logger[_0xf894('0xa')]('Getting\x20agent\x20with\x20email',_0x49098c);return request({'uri':util['format'](_0xf894('0x18'),_0x2142cb[_0xf894('0xe')]),'qs':{'query':util[_0xf894('0xc')]('type:user\x20role:agent\x20email:%s',_0x49098c)}})[_0xf894('0x19')](function(_0xcea019){if(_0xcea019[_0xf894('0x1a')]){logger['info']('Agent\x20found!');return _[_0xf894('0x1b')](_0xcea019[_0xf894('0x1c')],{'email':_0x49098c,'role':_0xf894('0x1d')});}else{logger[_0xf894('0xa')](_0xf894('0x1e'));return request({'uri':util[_0xf894('0xc')](_0xf894('0x1f'),_0x2142cb[_0xf894('0xe')])})[_0xf894('0x19')](function(_0x25f67c){logger[_0xf894('0xa')](_0xf894('0x20'));return _0x25f67c['user'];});}});}else{logger[_0xf894('0xa')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0xf894('0x1f'),_0x2142cb[_0xf894('0xe')])})[_0xf894('0x19')](function(_0x18f177){logger[_0xf894('0xa')](_0xf894('0x20'));return _0x18f177[_0xf894('0x21')];});}}function getEndUser(_0x4d4ba3,_0x29c774,_0x38e6d7){logger[_0xf894('0xa')](_0xf894('0x22'),_0x38e6d7);return request({'uri':util[_0xf894('0xc')](_0xf894('0x18'),_0x4d4ba3[_0xf894('0xe')]),'qs':{'query':util[_0xf894('0xc')](_0xf894('0x23'),_0x38e6d7)}})[_0xf894('0x19')](function(_0x3002aa){var _0xffea29;if(_0x3002aa[_0xf894('0x1c')]['length']){_0x3002aa[_0xf894('0x1c')]=_['filter'](_0x3002aa[_0xf894('0x1c')],{'suspended':![],'role':_0xf894('0x24')});if(_0x3002aa[_0xf894('0x1c')][_0xf894('0x25')]){_0xffea29=_['first'](_0x3002aa[_0xf894('0x1c')]);}}if(_0xffea29){logger[_0xf894('0xa')](_0xf894('0x26'));return _0xffea29;}else{logger[_0xf894('0xa')](_0xf894('0x27'));return request({'uri':util[_0xf894('0xc')]('%s/users.json',_0x4d4ba3[_0xf894('0xe')]),'method':_0xf894('0xf'),'body':{'user':{'role':_0xf894('0x24'),'name':util[_0xf894('0xc')](_0xf894('0x28'),_0x29c774||_0x38e6d7),'phone':_0x38e6d7}}})['then'](function(_0x25b9ae){logger['info'](_0xf894('0x29'));return _0x25b9ae[_0xf894('0x21')];});}});}function getAuth(_0x2d55dc){var _0x1cc74d;if(_0x2d55dc[_0xf894('0x2a')]===_0xf894('0x2b')){_0x1cc74d=util[_0xf894('0xc')](_0xf894('0x2c'),_0x2d55dc[_0xf894('0x2d')],_0x2d55dc[_0xf894('0x2b')]);}else if(_0x2d55dc[_0xf894('0x2a')]===_0xf894('0x2e')){_0x1cc74d=util['format'](_0xf894('0x2f'),_0x2d55dc[_0xf894('0x2d')],_0x2d55dc[_0xf894('0x2e')]);}return util[_0xf894('0xc')](_0xf894('0x30'),new Buffer(_0x1cc74d)[_0xf894('0x31')](_0xf894('0x32')));}function request(_0x66733e){logger['debug'](_0xf894('0x33'),JSON[_0xf894('0x34')](_0x66733e));return rp(_['defaults'](_0x66733e,{'method':_0xf894('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x87546c,_0x2e26cd){var _0x6545ef=[];if(_0x87546c&&_0x87546c[_0xf894('0x25')]>0x0){_0x6545ef=_[_0xf894('0x36')](_0x87546c,_0x2e26cd);}return _0x6545ef;}function getCustomFields(_0x5b45d4,_0x21754e){var _0x3bfd85=[];var _0x36d79a={'custom_fields':[]};if(_0x5b45d4['length']>0x0){_[_0xf894('0x37')](_0x5b45d4,function(_0x595d2e){if(_0x595d2e['type']===_0xf894('0x38')&&_0x595d2e['nameField']&&!_0x595d2e[_0xf894('0x39')]){_0x36d79a[_0x595d2e['nameField'][_0xf894('0x3a')]()]=_0x595d2e[_0xf894('0x3b')][_0xf894('0x31')]();}else if(_0x595d2e[_0xf894('0x3c')]==='string'&&_0x595d2e[_0xf894('0x3d')]&&_0x595d2e['customField']){_0x36d79a[_0xf894('0x3e')][_0xf894('0x3f')]({'id':_0x595d2e[_0xf894('0x3d')],'value':_0x595d2e['content']['toString']()});}else if(_0x595d2e[_0xf894('0x3c')]==='variable'&&_0x595d2e[_0xf894('0x40')]&&_0x595d2e['idField']&&_0x595d2e['customField']){_0x21754e[_0x595d2e[_0xf894('0x40')]]&&_0x36d79a[_0xf894('0x3e')][_0xf894('0x3f')]({'id':_0x595d2e['idField'],'value':_0x21754e[_0x595d2e[_0xf894('0x40')]][_0xf894('0x31')]()});}else if(_0x595d2e[_0xf894('0x3c')]===_0xf894('0x41')&&_0x595d2e[_0xf894('0x42')]&&_0x595d2e['Variable'][_0xf894('0x12')]&&_0x595d2e[_0xf894('0x3d')]&&_0x595d2e[_0xf894('0x39')]){_0x21754e[_0x595d2e[_0xf894('0x42')]['name'][_0xf894('0x3a')]()]&&_0x36d79a[_0xf894('0x3e')][_0xf894('0x3f')]({'id':_0x595d2e[_0xf894('0x3d')],'value':_0x21754e[_0x595d2e['Variable'][_0xf894('0x12')][_0xf894('0x3a')]()]['toString']()});}});}return _0x36d79a;}exports['queue']=function(_0x4a6172,_0x33e0cf,_0x28beef,_0x5181b6,_0x3cde68,_0x279409){var _0x1482ac,_0x43150b;_0x279409[_0xf894('0xe')]=intUtil[_0xf894('0x43')](_0x279409[_0xf894('0xe')]);_0x279409['serverUrl']=intUtil[_0xf894('0x43')](_0x279409[_0xf894('0x44')]);if(_0x3cde68&&_0x3cde68['monitor_format']){logger[_0xf894('0xa')](_0xf894('0x45'),_0xf894('0x46'));_0x33e0cf[_0xf894('0x47')]=util[_0xf894('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x279409['serverUrl'],_0x33e0cf[_0xf894('0x48')],md5(_0x33e0cf[_0xf894('0x48')]));}else{_0x33e0cf[_0xf894('0x47')]='';}headers[_0xf894('0x49')]=getAuth(_0x279409);return getUser(_0x279409,_0x5181b6[_0xf894('0x4a')])[_0xf894('0x19')](function(_0x2cc69a){_0x1482ac=_0x2cc69a;logger[_0xf894('0xa')](_0xf894('0x4b'),_0x1482ac['id']);return getEndUser(_0x279409,_0x33e0cf['calleridname'],_0x33e0cf[_0xf894('0x4c')]);})['then'](function(_0x22b2d4){_0x43150b=_0x22b2d4;logger['info'](_0xf894('0x4d'),_0x43150b['id']);return getTicket(_0x279409,_0x1482ac,_0x43150b,_0x28beef,_0x33e0cf);})['then'](function(_0x483942){if(_0x483942){logger['info'](_0xf894('0x4e'),_0x483942['id']);switch(_0x279409[_0xf894('0x3c')]){case'integrationTab':logger[_0xf894('0xa')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xf894('0x4f'),_0x279409['remoteUri'],_0x1482ac['id'],_0x483942['id']),'method':'POST'});case _0xf894('0x50'):logger[_0xf894('0xa')](_0xf894('0x45'),_0xf894('0x51'));emit(util[_0xf894('0xc')](_0xf894('0x52'),_0x5181b6[_0xf894('0x12')]),_0xf894('0x53'),{'uri':util[_0xf894('0xc')](_0xf894('0x54'),_0x279409[_0xf894('0xe')],_0x483942['id'])});break;default:logger[_0xf894('0x55')](_0xf894('0x45'),_0xf894('0x56'));}}})[_0xf894('0x57')](function(_0x5d69ac){logger[_0xf894('0x55')](_0xf894('0x58'),util['inspect'](_0x5d69ac,{'showHidden':!![],'depth':null}));});};exports[_0xf894('0x59')]=function(_0x52fcc9,_0x2a0380,_0x5bc7b9,_0x5c71e5,_0x115d9b,_0x2b1013,_0x297114){var _0x23e82c,_0x5a3a47;_0x2b1013[_0xf894('0xe')]=intUtil[_0xf894('0x43')](_0x2b1013['remoteUri']);_0x2b1013[_0xf894('0x44')]=intUtil['stripTrailingSlash'](_0x2b1013[_0xf894('0x44')]);if(_0x297114&&_0x297114[_0xf894('0x5a')]&&_0x297114[_0xf894('0x5a')]!=='none'){logger[_0xf894('0xa')](_0xf894('0x5b'),_0xf894('0x46'));_0x2a0380['recordingURL']=util[_0xf894('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2b1013['serverUrl'],_0x2a0380['uniqueid'],md5(_0x2a0380[_0xf894('0x48')]));}headers['Authorization']=getAuth(_0x2b1013);return getUser(_0x2b1013,_0x5c71e5[_0xf894('0x4a')])[_0xf894('0x19')](function(_0x35763e){_0x23e82c=_0x35763e;logger[_0xf894('0xa')](_0xf894('0x4b'),_0x23e82c['id']);return getEndUser(_0x2b1013,_0x2a0380[_0xf894('0x5c')],_0x2a0380[_0xf894('0x5d')]);})[_0xf894('0x19')](function(_0x20dc04){_0x5a3a47=_0x20dc04;logger[_0xf894('0xa')](_0xf894('0x4d'),_0x5a3a47['id']);return getTicket(_0x2b1013,_0x23e82c,_0x5a3a47,_0x5bc7b9,_0x2a0380);})[_0xf894('0x19')](function(_0x2cff56){if(_0x2cff56){logger[_0xf894('0xa')]('The\x20Ticket\x20ID\x20is:',_0x2cff56['id']);switch(_0x2b1013[_0xf894('0x3c')]){case _0xf894('0x5e'):logger[_0xf894('0xa')](_0xf894('0x5b'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xf894('0xc')](_0xf894('0x4f'),_0x2b1013['remoteUri'],_0x23e82c['id'],_0x2cff56['id']),'method':'POST'});case _0xf894('0x50'):logger['info'](_0xf894('0x5b'),_0xf894('0x51'));emit(util[_0xf894('0xc')](_0xf894('0x52'),_0x5c71e5[_0xf894('0x12')]),_0xf894('0x53'),{'uri':util['format'](_0xf894('0x54'),_0x2b1013[_0xf894('0xe')],_0x2cff56['id'])});break;default:logger[_0xf894('0x55')]('[OUTBOUND]',_0xf894('0x56'));}}})[_0xf894('0x57')](function(_0x26b4d8){logger[_0xf894('0x55')](_0xf894('0x5f'),util['inspect'](_0x26b4d8,{'showHidden':!![],'depth':null}));});};exports[_0xf894('0x60')]=function(_0x3bb520,_0x5e138b,_0x532cf3,_0x579985,_0x2d3e7c,_0x567393){var _0x375d1c,_0x413b95;_0x567393['remoteUri']=intUtil[_0xf894('0x43')](_0x567393['remoteUri']);_0x567393['serverUrl']=intUtil[_0xf894('0x43')](_0x567393['serverUrl']);if(_0x2d3e7c&&_0x2d3e7c['monitor_format']){logger[_0xf894('0xa')]('[ABANDONED]',_0xf894('0x46'));_0x5e138b['recordingURL']=util[_0xf894('0xc')](_0xf894('0x61'),_0x567393[_0xf894('0x44')],_0x5e138b[_0xf894('0x48')],md5(_0x5e138b[_0xf894('0x48')]));}else{_0x5e138b[_0xf894('0x47')]='';}headers[_0xf894('0x49')]=getAuth(_0x567393);return getUser(_0x567393)[_0xf894('0x19')](function(_0x378199){_0x375d1c=_0x378199;logger[_0xf894('0xa')](_0xf894('0x4b'),_0x375d1c['id']);return getEndUser(_0x567393,_0x5e138b['calleridname'],_0x5e138b[_0xf894('0x4c')]);})[_0xf894('0x19')](function(_0x380978){_0x413b95=_0x380978;logger[_0xf894('0xa')]('The\x20Enduser\x20ID\x20is:',_0x413b95['id']);return getTicket(_0x567393,_0x375d1c,_0x413b95,_0x532cf3,_0x5e138b);})[_0xf894('0x19')](function(_0x4de8c9){if(_0x4de8c9){logger['info']('The\x20Ticket\x20ID\x20is:',_0x4de8c9['id']);}})[_0xf894('0x57')](function(_0x2a5249){logger[_0xf894('0x55')](_0xf894('0x62'),util['inspect'](_0x2a5249,{'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 e0f32bb..f5c295f 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 _0x3de3=['YYYY-MM-DDTHH:mm:ss','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','details','log','host','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','monitor_format','[ABANDONED]','lodash','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','debug','stringify','length','forEach','type','string','idField','toString','variableName','customVariable','name','Variable','toLowerCase','indexOf','split','isNil','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','Search\x20end\x20user','https://www.zohoapis.','data','enduserType','Leads','End\x20user\x20found\x20(Lead)','POST','/crm/v2/','moduleCreate','role','first_name','last_name','code','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Subject','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','talktime','mm:ss','answertime','endtime','Call_Duration','diff','starttime'];(function(_0x323506,_0x2f5809){var _0x474dde=function(_0x1e7cc8){while(--_0x1e7cc8){_0x323506['push'](_0x323506['shift']());}};_0x474dde(++_0x2f5809);}(_0x3de3,0x1ce));var _0x33de=function(_0x1d7e60,_0x55e744){_0x1d7e60=_0x1d7e60-0x0;var _0x1aeeb8=_0x3de3[_0x1d7e60];return _0x1aeeb8;};'use strict';var _=require(_0x33de('0x0'));var rp=require('request-promise');var md5=require(_0x33de('0x1'));var util=require(_0x33de('0x2'));var intUtil=require('./util');var moment=require(_0x33de('0x3'));var Redis=require(_0x33de('0x4'));var config=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('zoho');config[_0x33de('0x7')]=_[_0x33de('0x8')](config['redis'],{'host':_0x33de('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33de('0x7')]));function emit(_0x35ee93,_0x7ceca6,_0x486ab6){io['to'](_0x35ee93)[_0x33de('0xa')](_0x7ceca6,_0x486ab6);}function request(_0x2c46d1){logger[_0x33de('0xb')]('[HTTP]',JSON[_0x33de('0xc')](_0x2c46d1));return rp(_0x2c46d1);}function getCustomFields(_0x348720,_0x8b655d){var _0x241211={};if(_0x348720[_0x33de('0xd')]>0x0){_[_0x33de('0xe')](_0x348720,function(_0x8dfa3b){if(_0x8dfa3b[_0x33de('0xf')]===_0x33de('0x10')&&_0x8dfa3b[_0x33de('0x11')]){_0x241211[_0x8dfa3b[_0x33de('0x11')]]=_0x8dfa3b['content'][_0x33de('0x12')]();}else if(_0x8dfa3b[_0x33de('0xf')]==='variable'&&_0x8dfa3b['variableName']&&_0x8dfa3b[_0x33de('0x11')]&&_0x8b655d[_0x8dfa3b[_0x33de('0x13')]]){_0x241211[_0x8dfa3b[_0x33de('0x11')]]=_0x8b655d[_0x8dfa3b[_0x33de('0x13')]]['toString']();}else if(_0x8dfa3b[_0x33de('0xf')]===_0x33de('0x14')&&_0x8dfa3b['Variable']&&_0x8dfa3b['Variable'][_0x33de('0x15')]&&_0x8dfa3b[_0x33de('0x11')]&&_0x8b655d[_0x8dfa3b[_0x33de('0x16')]['name'][_0x33de('0x17')]()]){_0x241211[_0x8dfa3b[_0x33de('0x11')]]=_0x8b655d[_0x8dfa3b['Variable'][_0x33de('0x15')][_0x33de('0x17')]()]['toString']();}});}return _0x241211;}function getName(_0x5bb74e){if(_0x5bb74e[_0x33de('0x18')]('\x20')>0x0){var _0x52d718=_0x5bb74e[_0x33de('0x19')](/ (.+)/);if(_0x52d718[0x1]){return _0x52d718;}}return[_0x5bb74e,_0x5bb74e];}var accountsTokens={};function getAccessToken(_0x2f0529){return new Promise(function(_0x3810b5,_0x315c9b){if(!_[_0x33de('0x1a')](accountsTokens[_0x2f0529['id']])&&!_[_0x33de('0x1a')](accountsTokens[_0x2f0529['id']][_0x33de('0x1b')])){if(moment()['isBefore'](accountsTokens[_0x2f0529['id']]['expires_in'])){_0x3810b5(accountsTokens[_0x2f0529['id']][_0x33de('0x1b')]);}}var _0x5af3fa;switch(_0x2f0529[_0x33de('0x1c')]){case'US':_0x5af3fa='https://accounts.zoho.com';break;case'AU':_0x5af3fa=_0x33de('0x1d');break;case'EU':_0x5af3fa=_0x33de('0x1e');break;case'IN':_0x5af3fa='https://accounts.zoho.in';break;case'CN':_0x5af3fa=_0x33de('0x1f');break;default:_0x5af3fa='https://accounts.zoho.eu';break;}var _0x67d040={'method':'POST','uri':_0x5af3fa+_0x33de('0x20'),'qs':{'refresh_token':_0x2f0529[_0x33de('0x21')],'client_id':_0x2f0529[_0x33de('0x22')],'client_secret':_0x2f0529['clientSecret'],'grant_type':_0x33de('0x23')},'json':!![]};return rp(_0x67d040)[_0x33de('0x24')](function(_0x140979){accountsTokens[_0x2f0529['id']]={'access_token':_0x140979['access_token'],'expires_in':moment()[_0x33de('0x25')](_0x140979['expires_in'],'seconds')};_0x3810b5(_0x140979[_0x33de('0x1b')]);})[_0x33de('0x26')](function(_0x1a870a){logger[_0x33de('0x27')](_0x33de('0x28'),_0x1a870a[_0x33de('0x29')]);_0x315c9b(_0x1a870a);});});}function getUser(_0x3f22fb,_0x1b4703,_0x59bc3b,_0x5ae0e8){logger[_0x33de('0x2a')](_0x33de('0x2b'));return request({'method':_0x33de('0x2c'),'uri':util[_0x33de('0x2d')](_0x33de('0x2e'),_0x1b4703),'qs':{'type':_0x33de('0x2f')},'headers':{'Authorization':_0x33de('0x30')+_0x3f22fb},'json':!![]})['then'](function(_0x282158){if(_0x282158[_0x33de('0x31')]){var _0x27c753=-0x1;if(_[_0x33de('0x32')](_0x282158['users'])){if(!_[_0x33de('0x1a')](_0x5ae0e8)){_0x27c753=_[_0x33de('0x33')](_0x282158['users'],function(_0x5d2da4){return _0x5d2da4['email']===_0x5ae0e8;});}if(_0x27c753>=0x0){logger[_0x33de('0x2a')](_0x33de('0x34'));}else{logger['info'](_0x33de('0x35'));_0x27c753=_['findIndex'](_0x282158['users'],function(_0xe61fb9){return _0xe61fb9[_0x33de('0x36')][_0x33de('0x15')]===_0x33de('0x37');});}return _0x282158[_0x33de('0x31')][_0x27c753];}else{if(_0x282158[_0x33de('0x38')][_0x33de('0x36')][_0x33de('0x15')]==='Administrator'){logger[_0x33de('0x2a')]('Using\x20the\x20admin\x20account!');user=_0x282158[_0x33de('0x38')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x33de('0xc')](_0x282158));throw new Error(_0x33de('0x39')+JSON[_0x33de('0xc')](_0x282158));}}}else{logger[_0x33de('0x27')](_0x33de('0x3a'),JSON[_0x33de('0xc')](_0x282158));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x33de('0xc')](_0x282158));}})[_0x33de('0x26')](function(_0x1380ff){console[_0x33de('0x27')](_0x1380ff);});}function getEndUser(_0x3a1398,_0x9f5688,_0x59c618,_0x483c24,_0x4bd6f2,_0x1497f0,_0xf4048f){logger[_0x33de('0x2a')](_0x33de('0x3b'));return request({'method':_0x33de('0x2c'),'uri':_0x33de('0x3c')+_0x9f5688+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4bd6f2+'))','headers':{'Authorization':_0x33de('0x30')+_0x3a1398},'json':!![]})[_0x33de('0x24')](function(_0x1071fb){if(_0x1071fb){var _0x7eaa40=_0x1071fb[_0x33de('0x3d')][0x0];_0x7eaa40[_0x33de('0x3e')]='Contacts';logger[_0x33de('0x2a')]('End\x20user\x20found\x20(Contact)');return _0x7eaa40;}else{return request({'method':_0x33de('0x2c'),'uri':_0x33de('0x3c')+_0x9f5688+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4bd6f2+'))','headers':{'Authorization':_0x33de('0x30')+_0x3a1398},'json':!![]})[_0x33de('0x24')](function(_0x15918c){if(_0x15918c){var _0x1de158=_0x15918c[_0x33de('0x3d')][0x0];_0x1de158[_0x33de('0x3e')]=_0x33de('0x3f');logger[_0x33de('0x2a')](_0x33de('0x40'));return _0x1de158;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x483c24=getName(_0x483c24);return request({'method':_0x33de('0x41'),'uri':_0x33de('0x3c')+_0x9f5688+_0x33de('0x42')+_0xf4048f[_0x33de('0x43')],'body':{'data':[{'Last_Name':_0x483c24[0x1],'First_Name':_0x483c24[0x0],'Phone':_0x4bd6f2,'Owner':{'name':!_['isNil'](_0x1497f0[_0x33de('0x44')]['name'])?_0x1497f0['role'][_0x33de('0x15')]:!_[_0x33de('0x1a')](_0x1497f0[_0x33de('0x45')])?_0x1497f0[_0x33de('0x45')]+'\x20'+_0x1497f0[_0x33de('0x46')]:_0x1497f0[_0x33de('0x46')],'id':_0x1497f0['id']}}]},'headers':{'Authorization':_0x33de('0x30')+_0x3a1398},'json':!![]})['then'](function(_0x3b5530){if(_0x3b5530&&_0x3b5530['data'][0x0][_0x33de('0x47')]==='SUCCESS'){var _0x43f816=_0x3b5530[_0x33de('0x3d')][0x0]['details'];_0x43f816[_0x33de('0x3e')]=_0xf4048f[_0x33de('0x43')];return _0x43f816;}logger[_0x33de('0x27')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x3b5530));throw new Error(_0x33de('0x48')+JSON[_0x33de('0xc')](_0x3b5530));});}});}});}function getCall(_0x4bf097,_0x5efc88,_0x44be7b,_0x5a161f,_0x4dba9a,_0x591e5b,_0x17ed09,_0x2d6001){logger[_0x33de('0x2a')](_0x33de('0x49'));var _0x51730a={};_0x51730a['Owner']={'name':!_[_0x33de('0x1a')](_0x5a161f[_0x33de('0x44')]['name'])&&!_[_0x33de('0x1a')](_0x5a161f[_0x33de('0x36')][_0x33de('0x15')])&&_0x5a161f[_0x33de('0x36')][_0x33de('0x15')]==='administrator'?_0x5a161f[_0x33de('0x44')][_0x33de('0x15')]:!_['isNil'](_0x5a161f[_0x33de('0x45')])?_0x5a161f[_0x33de('0x45')]+'\x20'+_0x5a161f[_0x33de('0x46')]:_0x5a161f[_0x33de('0x46')],'id':_0x5a161f['id']};_0x51730a[_0x33de('0x4a')]=intUtil[_0x33de('0x4b')](_0x591e5b[_0x33de('0x4c')],_0x17ed09,'\x20');_0x51730a[_0x33de('0x4d')]=intUtil[_0x33de('0x4b')](_0x591e5b[_0x33de('0x4e')],_0x17ed09,'\x0a');if(_0x4dba9a['enduserType']===_0x33de('0x4f')){_0x51730a[_0x33de('0x50')]={'name':!_[_0x33de('0x1a')](_0x4dba9a[_0x33de('0x51')])?_0x4dba9a[_0x33de('0x51')]:!_[_0x33de('0x1a')](_0x4dba9a[_0x33de('0x52')])?_0x4dba9a['First_Name']+'\x20'+_0x4dba9a[_0x33de('0x53')]:_0x4dba9a[_0x33de('0x53')],'id':_0x4dba9a['id']};}if(_0x4dba9a[_0x33de('0x3e')]==='Leads'){_0x51730a[_0x33de('0x54')]={'name':!_[_0x33de('0x1a')](_0x4dba9a[_0x33de('0x51')])?_0x4dba9a[_0x33de('0x51')]:!_['isNil'](_0x4dba9a['First_Name'])?_0x4dba9a[_0x33de('0x52')]+'\x20'+_0x4dba9a[_0x33de('0x53')]:_0x4dba9a[_0x33de('0x53')],'id':_0x4dba9a['id']};_0x51730a[_0x33de('0x55')]=_0x4dba9a[_0x33de('0x3e')];}if(_0x17ed09['talktime']){_0x51730a['Call_Duration']=moment[_0x33de('0x56')](parseInt(_0x17ed09[_0x33de('0x57')])*0x3e8)[_0x33de('0x2d')](_0x33de('0x58'));}else if(_0x17ed09[_0x33de('0x59')]&&_0x17ed09[_0x33de('0x5a')]){_0x51730a[_0x33de('0x5b')]=moment[_0x33de('0x56')](moment(_0x17ed09[_0x33de('0x5a')],'YYYY-MM-DDTHH:mm:ss')[_0x33de('0x5c')](moment(_0x17ed09[_0x33de('0x5d')],_0x33de('0x5e'))))['format'](_0x33de('0x58'));}switch(_0x17ed09['lastevent']){case'called':_0x51730a['Call_Result']='Called';break;case _0x33de('0x5f'):case _0x33de('0x60'):_0x51730a['Call_Result']=_0x33de('0x61');break;case _0x33de('0x62'):_0x51730a['Call_Result']=_0x33de('0x63');break;case _0x33de('0x64'):_0x51730a['Call_Result']=_0x33de('0x65');break;default:}_0x51730a[_0x33de('0x66')]=(_0x2d6001===_0x33de('0x67')?moment(_0x17ed09[_0x33de('0x5d')])[_0x33de('0x2d')](_0x33de('0x5e')):moment(_0x17ed09[_0x33de('0x68')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x33de('0x2d')]('YYYY-MM-DDTHH:mm:ss');_0x51730a[_0x33de('0x69')]=_0x2d6001||_0x33de('0x6a');_0x51730a=_['merge'](_0x51730a,getCustomFields(_0x591e5b[_0x33de('0x6b')],_0x17ed09));return request({'method':'POST','uri':_0x33de('0x3c')+_0x5efc88+_0x33de('0x6c'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4bf097},'body':{'data':[_0x51730a]},'json':!![]})['then'](function(_0x26d79c){if(_0x26d79c&&_0x26d79c[_0x33de('0x3d')][0x0][_0x33de('0x47')]===_0x33de('0x6d')){logger[_0x33de('0x2a')]('Call\x20created!');return{'id':_0x26d79c[_0x33de('0x3d')][0x0][_0x33de('0x6e')]['id']};}})['catch'](function(_0xa10291){logger[_0x33de('0x2a')]('err',_0xa10291[_0x33de('0x29')]);console[_0x33de('0x6f')]('err',_0xa10291);});}exports['queue']=function(_0xc2504a,_0x55d7ef,_0x31a511,_0x4803b8,_0x39fa8e,_0x5366a6){var _0x4f42d8,_0x5e3383,_0x4dac9c;_0x5366a6['host']=intUtil['stripTrailingSlash'](_0x5366a6[_0x33de('0x70')]);_0x5366a6['serverUrl']=intUtil[_0x33de('0x71')](_0x5366a6['serverUrl']);if(_0x39fa8e&&_0x39fa8e['monitor_format']){logger[_0x33de('0x2a')](_0x33de('0x72'),_0x33de('0x73'));_0x55d7ef[_0x33de('0x74')]=_0x5366a6[_0x33de('0x75')]+_0x33de('0x76')+_0x55d7ef[_0x33de('0x77')]+_0x33de('0x78')+md5(_0x55d7ef['uniqueid']);}else{_0x55d7ef[_0x33de('0x74')]='';}var _0x5b779c=_0x5366a6[_0x33de('0x70')]===_0x33de('0x79')?'eu':_0x33de('0x7a');return getAccessToken(_0x5366a6)[_0x33de('0x24')](function(_0x8a9729){_0x4dac9c=_0x8a9729;return getUser(_0x4dac9c,_0x5b779c,_0x5366a6,_0x4803b8[_0x33de('0x7b')]);})[_0x33de('0x24')](function(_0x355b7d){_0x4f42d8=_0x355b7d;logger[_0x33de('0x2a')](_0x33de('0x7c'),_0x4f42d8['id']);return getEndUser(_0x4dac9c,_0x5b779c,_0x5366a6,_0x55d7ef[_0x33de('0x7d')],_0x55d7ef['calleridnum'],_0x4f42d8,_0x31a511);})['then'](function(_0x516a33){_0x5e3383=_0x516a33;logger[_0x33de('0x2a')](_0x33de('0x7e'),_0x5e3383['id']);return getCall(_0x4dac9c,_0x5b779c,_0x5366a6,_0x4f42d8,_0x5e3383,_0x31a511,_0x55d7ef,_0x33de('0x6a'));})[_0x33de('0x24')](function(_0x21a3ec){if(_0x21a3ec){logger[_0x33de('0x2a')](_0x33de('0x7f'),_0x21a3ec['id']);logger[_0x33de('0x2a')](_0x33de('0x72'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x33de('0x2d')](_0x33de('0x80'),_0x4803b8[_0x33de('0x15')]),_0x33de('0x81'),{'uri':_0x33de('0x82')+_0x5366a6[_0x33de('0x70')]+'/crm/EntityInfo.do?module=Calls&id='+_0x21a3ec['id']});}})['catch'](function(_0x558c26){logger[_0x33de('0x27')](_0x33de('0x72'),JSON[_0x33de('0xc')](_0x558c26));});};exports[_0x33de('0x67')]=function(_0x5bcc6d,_0xc28b66,_0x341cf0,_0x484827,_0x595629,_0x5d55c5,_0x23aa74){var _0x4630be,_0x38d3dd,_0x632511;_0x5d55c5[_0x33de('0x70')]=intUtil['stripTrailingSlash'](_0x5d55c5[_0x33de('0x70')]);_0x5d55c5['serverUrl']=intUtil[_0x33de('0x71')](_0x5d55c5[_0x33de('0x75')]);if(_0x23aa74&&_0x23aa74['recordingFormat']&&_0x23aa74[_0x33de('0x83')]!==_0x33de('0x84')){logger['info'](_0x33de('0x85'),'Recording\x20is\x20enabled!');_0xc28b66['recordingURL']=_0x5d55c5[_0x33de('0x75')]+_0x33de('0x76')+_0xc28b66[_0x33de('0x77')]+_0x33de('0x78')+md5(_0xc28b66[_0x33de('0x77')]);}var _0x586559=_0x5d55c5[_0x33de('0x70')]===_0x33de('0x79')?'eu':_0x33de('0x7a');return getAccessToken(_0x5d55c5)[_0x33de('0x24')](function(_0x4fe9fc){_0x632511=_0x4fe9fc;return getUser(_0x632511,_0x586559,_0x5d55c5,_0x484827[_0x33de('0x7b')]);})[_0x33de('0x24')](function(_0x132127){_0x4630be=_0x132127;logger['info']('The\x20User\x20ID\x20is:',_0x4630be['id']);return getEndUser(_0x632511,_0x586559,_0x5d55c5,_0xc28b66['destcalleridname'],_0xc28b66['destcalleridnum'],_0x4630be,_0x341cf0);})['then'](function(_0x1f0e87){_0x38d3dd=_0x1f0e87;logger[_0x33de('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x38d3dd['id']);return getCall(_0x632511,_0x586559,_0x5d55c5,_0x4630be,_0x38d3dd,_0x341cf0,_0xc28b66,_0x33de('0x86'));})['then'](function(_0x593ac9){if(_0x593ac9){logger[_0x33de('0x2a')](_0x33de('0x7f'),_0x593ac9['id']);logger['info'](_0x33de('0x85'),_0x33de('0x87'));emit(util['format'](_0x33de('0x80'),_0x484827['name']),_0x33de('0x81'),{'uri':_0x33de('0x82')+_0x5d55c5['host']+_0x33de('0x88')+_0x593ac9['id']});}})[_0x33de('0x26')](function(_0x53ec24){logger['error'](_0x33de('0x85'),JSON[_0x33de('0xc')](_0x53ec24));});};exports[_0x33de('0x64')]=function(_0x179e20,_0x40ccc3,_0x27fc12,_0x4ef18b,_0x25f0e3,_0x3b3ca2){var _0x33f640,_0x3d3645,_0x21c3b1;_0x3b3ca2[_0x33de('0x70')]=intUtil[_0x33de('0x71')](_0x3b3ca2[_0x33de('0x70')]);_0x3b3ca2[_0x33de('0x75')]=intUtil[_0x33de('0x71')](_0x3b3ca2[_0x33de('0x75')]);if(_0x25f0e3&&_0x25f0e3[_0x33de('0x89')]){logger[_0x33de('0x2a')](_0x33de('0x8a'),_0x33de('0x73'));_0x40ccc3[_0x33de('0x74')]=_0x3b3ca2['serverUrl']+_0x33de('0x76')+_0x40ccc3[_0x33de('0x77')]+_0x33de('0x78')+md5(_0x40ccc3[_0x33de('0x77')]);}else{_0x40ccc3[_0x33de('0x74')]='';}var _0x5090db=_0x3b3ca2[_0x33de('0x70')]===_0x33de('0x79')?'eu':_0x33de('0x7a');return getAccessToken(_0x3b3ca2)[_0x33de('0x24')](function(_0x3860db){_0x21c3b1=_0x3860db;return getUser(_0x21c3b1,_0x5090db,_0x3b3ca2);})[_0x33de('0x24')](function(_0x36b1a3){_0x33f640=_0x36b1a3;logger[_0x33de('0x2a')](_0x33de('0x7c'),_0x33f640['id']);return getEndUser(_0x21c3b1,_0x5090db,_0x3b3ca2,_0x40ccc3[_0x33de('0x7d')],_0x40ccc3['calleridnum'],_0x33f640,_0x27fc12);})['then'](function(_0x4472d1){_0x3d3645=_0x4472d1;logger[_0x33de('0x2a')](_0x33de('0x7e'),_0x3d3645['id']);return getCall(_0x21c3b1,_0x5090db,_0x3b3ca2,_0x33f640,_0x3d3645,_0x27fc12,_0x40ccc3,_0x33de('0x6a'));})['then'](function(_0x42626f){if(_0x42626f){logger[_0x33de('0x2a')](_0x33de('0x7f'),_0x42626f['id']);}})['catch'](function(_0x54e77f){logger[_0x33de('0x27')](_0x33de('0x8a'),JSON[_0x33de('0xc')](_0x54e77f));});}; \ No newline at end of file +var _0x8425=['calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','/downloads?type=uniqueid&token=','[OUTBOUND]','https://crm.','/crm/EntityInfo.do?module=Calls&id=','abandoned','monitor_format','com','The\x20Call\x20ID\x20is:','[ABANDONED]','lodash','request-promise','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','[HTTP]','stringify','length','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','expires_in','seconds','catch','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email','Using\x20the\x20admin\x20account!','profile','user','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','enduserType','Contacts','data','Leads','End\x20user\x20found\x20(Lead)','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','/crm/v2/','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','mm:ss','answertime','Call_Duration','utc','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Called','Call_Result','Rejected','Abandoned','Call_Start_Time','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','log','err','queue','host','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','zoho.eu','The\x20User\x20ID\x20is:'];(function(_0x4adfab,_0x26a923){var _0x423d61=function(_0x178153){while(--_0x178153){_0x4adfab['push'](_0x4adfab['shift']());}};_0x423d61(++_0x26a923);}(_0x8425,0x13b));var _0x5842=function(_0x596336,_0x38ddfb){_0x596336=_0x596336-0x0;var _0x88e1be=_0x8425[_0x596336];return _0x88e1be;};'use strict';var _=require(_0x5842('0x0'));var rp=require(_0x5842('0x1'));var md5=require(_0x5842('0x2'));var util=require(_0x5842('0x3'));var intUtil=require('./util');var moment=require(_0x5842('0x4'));var Redis=require(_0x5842('0x5'));var config=require(_0x5842('0x6'));var logger=require(_0x5842('0x7'))(_0x5842('0x8'));config[_0x5842('0x9')]=_[_0x5842('0xa')](config['redis'],{'host':_0x5842('0xb'),'port':0x18eb});var io=require(_0x5842('0xc'))(new Redis(config[_0x5842('0x9')]));function emit(_0x3ccf6e,_0x3ad2e0,_0x4f4fc4){io['to'](_0x3ccf6e)['emit'](_0x3ad2e0,_0x4f4fc4);}function request(_0x8e5d41){logger['debug'](_0x5842('0xd'),JSON[_0x5842('0xe')](_0x8e5d41));return rp(_0x8e5d41);}function getCustomFields(_0x33e5f7,_0x2b6c6d){var _0x11cb15={};if(_0x33e5f7[_0x5842('0xf')]>0x0){_[_0x5842('0x10')](_0x33e5f7,function(_0x1c7cf4){if(_0x1c7cf4[_0x5842('0x11')]===_0x5842('0x12')&&_0x1c7cf4[_0x5842('0x13')]){_0x11cb15[_0x1c7cf4[_0x5842('0x13')]]=_0x1c7cf4['content'][_0x5842('0x14')]();}else if(_0x1c7cf4[_0x5842('0x11')]===_0x5842('0x15')&&_0x1c7cf4[_0x5842('0x16')]&&_0x1c7cf4[_0x5842('0x13')]&&_0x2b6c6d[_0x1c7cf4[_0x5842('0x16')]]){_0x11cb15[_0x1c7cf4[_0x5842('0x13')]]=_0x2b6c6d[_0x1c7cf4[_0x5842('0x16')]][_0x5842('0x14')]();}else if(_0x1c7cf4[_0x5842('0x11')]===_0x5842('0x17')&&_0x1c7cf4[_0x5842('0x18')]&&_0x1c7cf4[_0x5842('0x18')][_0x5842('0x19')]&&_0x1c7cf4[_0x5842('0x13')]&&_0x2b6c6d[_0x1c7cf4['Variable'][_0x5842('0x19')][_0x5842('0x1a')]()]){_0x11cb15[_0x1c7cf4[_0x5842('0x13')]]=_0x2b6c6d[_0x1c7cf4['Variable'][_0x5842('0x19')][_0x5842('0x1a')]()][_0x5842('0x14')]();}});}return _0x11cb15;}function getName(_0x25feee){if(_0x25feee['indexOf']('\x20')>0x0){var _0x5a96f6=_0x25feee['split'](/ (.+)/);if(_0x5a96f6[0x1]){return _0x5a96f6;}}return[_0x25feee,_0x25feee];}var accountsTokens={};function getAccessToken(_0x3702d1){return new Promise(function(_0x4d0a72,_0x354e90){if(!_[_0x5842('0x1b')](accountsTokens[_0x3702d1['id']])&&!_[_0x5842('0x1b')](accountsTokens[_0x3702d1['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x3702d1['id']]['expires_in'])){_0x4d0a72(accountsTokens[_0x3702d1['id']][_0x5842('0x1c')]);}}var _0x2c4f58;switch(_0x3702d1[_0x5842('0x1d')]){case'US':_0x2c4f58=_0x5842('0x1e');break;case'AU':_0x2c4f58=_0x5842('0x1f');break;case'EU':_0x2c4f58='https://accounts.zoho.eu';break;case'IN':_0x2c4f58=_0x5842('0x20');break;case'CN':_0x2c4f58=_0x5842('0x21');break;default:_0x2c4f58=_0x5842('0x22');break;}var _0x54563b={'method':_0x5842('0x23'),'uri':_0x2c4f58+_0x5842('0x24'),'qs':{'refresh_token':_0x3702d1[_0x5842('0x25')],'client_id':_0x3702d1[_0x5842('0x26')],'client_secret':_0x3702d1[_0x5842('0x27')],'grant_type':_0x5842('0x28')},'json':!![]};return rp(_0x54563b)[_0x5842('0x29')](function(_0x4cdff7){accountsTokens[_0x3702d1['id']]={'access_token':_0x4cdff7['access_token'],'expires_in':moment()['add'](_0x4cdff7[_0x5842('0x2a')],_0x5842('0x2b'))};_0x4d0a72(_0x4cdff7[_0x5842('0x1c')]);})[_0x5842('0x2c')](function(_0x2ab1ac){logger['error']('Failing\x20creating\x20the\x20access_token',_0x2ab1ac[_0x5842('0x2d')]);_0x354e90(_0x2ab1ac);});});}function getUser(_0x37295d,_0x3ea460,_0x56094b,_0x38396a){logger[_0x5842('0x2e')](_0x5842('0x2f'));return request({'method':_0x5842('0x30'),'uri':util[_0x5842('0x31')](_0x5842('0x32'),_0x3ea460),'qs':{'type':_0x5842('0x33')},'headers':{'Authorization':_0x5842('0x34')+_0x37295d},'json':!![]})['then'](function(_0x449efc){if(_0x449efc['users']){var _0x2be497=-0x1;if(_[_0x5842('0x35')](_0x449efc[_0x5842('0x36')])){if(!_[_0x5842('0x1b')](_0x38396a)){_0x2be497=_[_0x5842('0x37')](_0x449efc[_0x5842('0x36')],function(_0x199be2){return _0x199be2[_0x5842('0x38')]===_0x38396a;});}if(_0x2be497>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x5842('0x2e')](_0x5842('0x39'));_0x2be497=_[_0x5842('0x37')](_0x449efc[_0x5842('0x36')],function(_0xaa5bec){return _0xaa5bec[_0x5842('0x3a')][_0x5842('0x19')]==='Administrator';});}return _0x449efc[_0x5842('0x36')][_0x2be497];}else{if(_0x449efc[_0x5842('0x3b')][_0x5842('0x3a')]['name']===_0x5842('0x3c')){logger[_0x5842('0x2e')](_0x5842('0x39'));user=_0x449efc['user'];return user;}else{logger[_0x5842('0x3d')](_0x5842('0x3e'),JSON[_0x5842('0xe')](_0x449efc));throw new Error(_0x5842('0x3f')+JSON[_0x5842('0xe')](_0x449efc));}}}else{logger[_0x5842('0x3d')](_0x5842('0x3e'),JSON['stringify'](_0x449efc));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x449efc));}})[_0x5842('0x2c')](function(_0x4407b4){console[_0x5842('0x3d')](_0x4407b4);});}function getEndUser(_0xe61460,_0x1fbc08,_0xf78bc,_0x20d7f7,_0x37ea69,_0x3f315a,_0x5315ed){logger[_0x5842('0x2e')](_0x5842('0x40'));return request({'method':'GET','uri':_0x5842('0x41')+_0x1fbc08+_0x5842('0x42')+_0x37ea69+'))','headers':{'Authorization':_0x5842('0x34')+_0xe61460},'json':!![]})['then'](function(_0x4ca28a){if(_0x4ca28a){var _0x2f306f=_0x4ca28a['data'][0x0];_0x2f306f[_0x5842('0x43')]=_0x5842('0x44');logger[_0x5842('0x2e')]('End\x20user\x20found\x20(Contact)');return _0x2f306f;}else{return request({'method':_0x5842('0x30'),'uri':'https://www.zohoapis.'+_0x1fbc08+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x37ea69+'))','headers':{'Authorization':_0x5842('0x34')+_0xe61460},'json':!![]})['then'](function(_0x106c1c){if(_0x106c1c){var _0x5318dd=_0x106c1c[_0x5842('0x45')][0x0];_0x5318dd[_0x5842('0x43')]=_0x5842('0x46');logger['info'](_0x5842('0x47'));return _0x5318dd;}else{logger[_0x5842('0x2e')](_0x5842('0x48'));_0x20d7f7=getName(_0x20d7f7);return request({'method':_0x5842('0x23'),'uri':'https://www.zohoapis.'+_0x1fbc08+_0x5842('0x49')+_0x5315ed[_0x5842('0x4a')],'body':{'data':[{'Last_Name':_0x20d7f7[0x1],'First_Name':_0x20d7f7[0x0],'Phone':_0x37ea69,'Owner':{'name':!_[_0x5842('0x1b')](_0x3f315a[_0x5842('0x4b')][_0x5842('0x19')])?_0x3f315a[_0x5842('0x4b')][_0x5842('0x19')]:!_[_0x5842('0x1b')](_0x3f315a[_0x5842('0x4c')])?_0x3f315a['first_name']+'\x20'+_0x3f315a['last_name']:_0x3f315a[_0x5842('0x4d')],'id':_0x3f315a['id']}}]},'headers':{'Authorization':_0x5842('0x34')+_0xe61460},'json':!![]})['then'](function(_0x4ec38d){if(_0x4ec38d&&_0x4ec38d[_0x5842('0x45')][0x0][_0x5842('0x4e')]===_0x5842('0x4f')){var _0x63e682=_0x4ec38d['data'][0x0][_0x5842('0x50')];_0x63e682['enduserType']=_0x5315ed[_0x5842('0x4a')];return _0x63e682;}logger[_0x5842('0x3d')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x4ec38d));throw new Error(_0x5842('0x51')+JSON[_0x5842('0xe')](_0x4ec38d));});}});}});}function getCall(_0x35e47d,_0x45823e,_0x4fd3c0,_0x33b7d5,_0xa7db7d,_0x48de25,_0x2c97bc,_0x367b04){logger[_0x5842('0x2e')](_0x5842('0x52'));var _0x2bbfa4={};_0x2bbfa4[_0x5842('0x53')]={'name':!_['isNil'](_0x33b7d5[_0x5842('0x4b')][_0x5842('0x19')])&&!_['isNil'](_0x33b7d5[_0x5842('0x3a')][_0x5842('0x19')])&&_0x33b7d5['profile']['name']===_0x5842('0x54')?_0x33b7d5[_0x5842('0x4b')][_0x5842('0x19')]:!_[_0x5842('0x1b')](_0x33b7d5[_0x5842('0x4c')])?_0x33b7d5[_0x5842('0x4c')]+'\x20'+_0x33b7d5['last_name']:_0x33b7d5['last_name'],'id':_0x33b7d5['id']};_0x2bbfa4[_0x5842('0x55')]=intUtil[_0x5842('0x56')](_0x48de25[_0x5842('0x57')],_0x2c97bc,'\x20');_0x2bbfa4[_0x5842('0x58')]=intUtil[_0x5842('0x56')](_0x48de25[_0x5842('0x59')],_0x2c97bc,'\x0a');if(_0xa7db7d[_0x5842('0x43')]==='Contacts'){_0x2bbfa4[_0x5842('0x5a')]={'name':!_[_0x5842('0x1b')](_0xa7db7d[_0x5842('0x5b')])?_0xa7db7d['Full_Name']:!_['isNil'](_0xa7db7d[_0x5842('0x5c')])?_0xa7db7d['First_Name']+'\x20'+_0xa7db7d['Last_Name']:_0xa7db7d[_0x5842('0x5d')],'id':_0xa7db7d['id']};}if(_0xa7db7d[_0x5842('0x43')]===_0x5842('0x46')){_0x2bbfa4[_0x5842('0x5e')]={'name':!_['isNil'](_0xa7db7d[_0x5842('0x5b')])?_0xa7db7d[_0x5842('0x5b')]:!_[_0x5842('0x1b')](_0xa7db7d['First_Name'])?_0xa7db7d[_0x5842('0x5c')]+'\x20'+_0xa7db7d['Last_Name']:_0xa7db7d[_0x5842('0x5d')],'id':_0xa7db7d['id']};_0x2bbfa4[_0x5842('0x5f')]=_0xa7db7d['enduserType'];}if(_0x2c97bc[_0x5842('0x60')]){_0x2bbfa4['Call_Duration']=moment['utc'](parseInt(_0x2c97bc[_0x5842('0x60')])*0x3e8)[_0x5842('0x31')](_0x5842('0x61'));}else if(_0x2c97bc[_0x5842('0x62')]&&_0x2c97bc['endtime']){_0x2bbfa4[_0x5842('0x63')]=moment[_0x5842('0x64')](moment(_0x2c97bc[_0x5842('0x65')],'YYYY-MM-DDTHH:mm:ss')[_0x5842('0x66')](moment(_0x2c97bc[_0x5842('0x67')],_0x5842('0x68'))))[_0x5842('0x31')](_0x5842('0x61'));}switch(_0x2c97bc[_0x5842('0x69')]){case _0x5842('0x6a'):_0x2bbfa4['Call_Result']=_0x5842('0x6b');break;case'complete':case'connect':_0x2bbfa4['Call_Result']='Answered';break;case'rejected':_0x2bbfa4[_0x5842('0x6c')]=_0x5842('0x6d');break;case'abandoned':_0x2bbfa4[_0x5842('0x6c')]=_0x5842('0x6e');break;default:}_0x2bbfa4[_0x5842('0x6f')]=(_0x367b04==='outbound'?moment(_0x2c97bc[_0x5842('0x67')])[_0x5842('0x31')](_0x5842('0x68')):moment(_0x2c97bc[_0x5842('0x70')])[_0x5842('0x31')](_0x5842('0x68')))||moment()['format'](_0x5842('0x68'));_0x2bbfa4[_0x5842('0x71')]=_0x367b04||_0x5842('0x72');_0x2bbfa4=_[_0x5842('0x73')](_0x2bbfa4,getCustomFields(_0x48de25[_0x5842('0x74')],_0x2c97bc));return request({'method':_0x5842('0x23'),'uri':_0x5842('0x41')+_0x45823e+_0x5842('0x75'),'headers':{'Authorization':_0x5842('0x34')+_0x35e47d},'body':{'data':[_0x2bbfa4]},'json':!![]})[_0x5842('0x29')](function(_0x45eb90){if(_0x45eb90&&_0x45eb90[_0x5842('0x45')][0x0]['code']==='SUCCESS'){logger[_0x5842('0x2e')](_0x5842('0x76'));return{'id':_0x45eb90['data'][0x0][_0x5842('0x50')]['id']};}})[_0x5842('0x2c')](function(_0x1a1d79){logger['info']('err',_0x1a1d79[_0x5842('0x2d')]);console[_0x5842('0x77')](_0x5842('0x78'),_0x1a1d79);});}exports[_0x5842('0x79')]=function(_0x321cb3,_0x357996,_0x40a55c,_0x2cf0ef,_0x173122,_0x22dad0){var _0x4ca35c,_0x3bc203,_0x384c2b;_0x22dad0[_0x5842('0x7a')]=intUtil[_0x5842('0x7b')](_0x22dad0[_0x5842('0x7a')]);_0x22dad0['serverUrl']=intUtil[_0x5842('0x7b')](_0x22dad0['serverUrl']);if(_0x173122&&_0x173122['monitor_format']){logger[_0x5842('0x2e')](_0x5842('0x7c'),_0x5842('0x7d'));_0x357996[_0x5842('0x7e')]=_0x22dad0[_0x5842('0x7f')]+_0x5842('0x80')+_0x357996['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x357996[_0x5842('0x81')]);}else{_0x357996[_0x5842('0x7e')]='';}var _0x3dbf9b=_0x22dad0[_0x5842('0x7a')]===_0x5842('0x82')?'eu':'com';return getAccessToken(_0x22dad0)[_0x5842('0x29')](function(_0x5ba7c1){_0x384c2b=_0x5ba7c1;return getUser(_0x384c2b,_0x3dbf9b,_0x22dad0,_0x2cf0ef['email']);})[_0x5842('0x29')](function(_0x4ad679){_0x4ca35c=_0x4ad679;logger[_0x5842('0x2e')](_0x5842('0x83'),_0x4ca35c['id']);return getEndUser(_0x384c2b,_0x3dbf9b,_0x22dad0,_0x357996[_0x5842('0x84')],_0x357996[_0x5842('0x85')],_0x4ca35c,_0x40a55c);})[_0x5842('0x29')](function(_0x589939){_0x3bc203=_0x589939;logger[_0x5842('0x2e')](_0x5842('0x86'),_0x3bc203['id']);return getCall(_0x384c2b,_0x3dbf9b,_0x22dad0,_0x4ca35c,_0x3bc203,_0x40a55c,_0x357996,_0x5842('0x72'));})[_0x5842('0x29')](function(_0x34658a){if(_0x34658a){logger[_0x5842('0x2e')]('The\x20Call\x20ID\x20is:',_0x34658a['id']);logger[_0x5842('0x2e')](_0x5842('0x7c'),_0x5842('0x87'));emit(util[_0x5842('0x31')](_0x5842('0x88'),_0x2cf0ef['name']),_0x5842('0x89'),{'uri':'https://crm.'+_0x22dad0[_0x5842('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x34658a['id']});}})[_0x5842('0x2c')](function(_0x59a972){logger[_0x5842('0x3d')](_0x5842('0x7c'),JSON[_0x5842('0xe')](_0x59a972));});};exports[_0x5842('0x8a')]=function(_0x4cbb0b,_0x3f1fa7,_0x588cbe,_0xfa6c98,_0x46d5b2,_0x3150b7,_0x433247){var _0xafab7d,_0x188b8f,_0x2fce88;_0x3150b7[_0x5842('0x7a')]=intUtil['stripTrailingSlash'](_0x3150b7[_0x5842('0x7a')]);_0x3150b7[_0x5842('0x7f')]=intUtil[_0x5842('0x7b')](_0x3150b7[_0x5842('0x7f')]);if(_0x433247&&_0x433247[_0x5842('0x8b')]&&_0x433247['recordingFormat']!=='none'){logger[_0x5842('0x2e')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x3f1fa7[_0x5842('0x7e')]=_0x3150b7[_0x5842('0x7f')]+_0x5842('0x80')+_0x3f1fa7[_0x5842('0x81')]+_0x5842('0x8c')+md5(_0x3f1fa7['uniqueid']);}var _0x5b9164=_0x3150b7[_0x5842('0x7a')]===_0x5842('0x82')?'eu':'com';return getAccessToken(_0x3150b7)[_0x5842('0x29')](function(_0x6275a){_0x2fce88=_0x6275a;return getUser(_0x2fce88,_0x5b9164,_0x3150b7,_0xfa6c98[_0x5842('0x38')]);})[_0x5842('0x29')](function(_0xc24ec3){_0xafab7d=_0xc24ec3;logger[_0x5842('0x2e')]('The\x20User\x20ID\x20is:',_0xafab7d['id']);return getEndUser(_0x2fce88,_0x5b9164,_0x3150b7,_0x3f1fa7['destcalleridname'],_0x3f1fa7['destcalleridnum'],_0xafab7d,_0x588cbe);})[_0x5842('0x29')](function(_0x931a47){_0x188b8f=_0x931a47;logger[_0x5842('0x2e')](_0x5842('0x86'),_0x188b8f['id']);return getCall(_0x2fce88,_0x5b9164,_0x3150b7,_0xafab7d,_0x188b8f,_0x588cbe,_0x3f1fa7,'Outbound');})[_0x5842('0x29')](function(_0x273751){if(_0x273751){logger['info']('The\x20Call\x20ID\x20is:',_0x273751['id']);logger[_0x5842('0x2e')](_0x5842('0x8d'),_0x5842('0x87'));emit(util['format'](_0x5842('0x88'),_0xfa6c98['name']),_0x5842('0x89'),{'uri':_0x5842('0x8e')+_0x3150b7[_0x5842('0x7a')]+_0x5842('0x8f')+_0x273751['id']});}})['catch'](function(_0x216f50){logger[_0x5842('0x3d')](_0x5842('0x8d'),JSON[_0x5842('0xe')](_0x216f50));});};exports[_0x5842('0x90')]=function(_0x51ce57,_0x763ed2,_0x2f63f6,_0x1a1127,_0x2a55b9,_0x162864){var _0x29f8ad,_0x577ec7,_0x26a701;_0x162864[_0x5842('0x7a')]=intUtil[_0x5842('0x7b')](_0x162864[_0x5842('0x7a')]);_0x162864[_0x5842('0x7f')]=intUtil[_0x5842('0x7b')](_0x162864[_0x5842('0x7f')]);if(_0x2a55b9&&_0x2a55b9[_0x5842('0x91')]){logger['info']('[ABANDONED]','Recording\x20is\x20enabled!');_0x763ed2['recordingURL']=_0x162864[_0x5842('0x7f')]+_0x5842('0x80')+_0x763ed2['uniqueid']+_0x5842('0x8c')+md5(_0x763ed2[_0x5842('0x81')]);}else{_0x763ed2['recordingURL']='';}var _0xbffb7b=_0x162864[_0x5842('0x7a')]===_0x5842('0x82')?'eu':_0x5842('0x92');return getAccessToken(_0x162864)[_0x5842('0x29')](function(_0x21c5ed){_0x26a701=_0x21c5ed;return getUser(_0x26a701,_0xbffb7b,_0x162864);})[_0x5842('0x29')](function(_0x5583cd){_0x29f8ad=_0x5583cd;logger[_0x5842('0x2e')](_0x5842('0x83'),_0x29f8ad['id']);return getEndUser(_0x26a701,_0xbffb7b,_0x162864,_0x763ed2[_0x5842('0x84')],_0x763ed2['calleridnum'],_0x29f8ad,_0x2f63f6);})['then'](function(_0x40a750){_0x577ec7=_0x40a750;logger['info'](_0x5842('0x86'),_0x577ec7['id']);return getCall(_0x26a701,_0xbffb7b,_0x162864,_0x29f8ad,_0x577ec7,_0x2f63f6,_0x763ed2,_0x5842('0x72'));})[_0x5842('0x29')](function(_0x3de2c1){if(_0x3de2c1){logger[_0x5842('0x2e')](_0x5842('0x93'),_0x3de2c1['id']);}})[_0x5842('0x2c')](function(_0x4125ae){logger['error'](_0x5842('0x94'),JSON[_0x5842('0xe')](_0x4125ae));});}; \ 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 b2b5a3a..5e80a57 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 _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x375718,_0xfddc9d){var _0x31145b=function(_0xda3337){while(--_0xda3337){_0x375718['push'](_0x375718['shift']());}};_0x31145b(++_0xfddc9d);}(_0x7a54,0x106));var _0x47a5=function(_0x23c3f2,_0xf815f1){_0x23c3f2=_0x23c3f2-0x0;var _0x241d59=_0x7a54[_0x23c3f2];return _0x241d59;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x7cfd00,_0xfc7aa){var _0x17955f=function(_0xef72df){while(--_0xef72df){_0x7cfd00['push'](_0x7cfd00['shift']());}};_0x17955f(++_0xfc7aa);}(_0x7a54,0x106));var _0x47a5=function(_0x30ed8a,_0x27ba6f){_0x30ed8a=_0x30ed8a-0x0;var _0x182348=_0x7a54[_0x30ed8a];return _0x182348;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index 091ce64..9e8ca99 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 _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x2c0d41,_0x4b1d04){var _0x108ecf=function(_0x4ea880){while(--_0x4ea880){_0x2c0d41['push'](_0x2c0d41['shift']());}};_0x108ecf(++_0x4b1d04);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53f6ad,_0x1dab8c){_0x53f6ad=_0x53f6ad-0x0;var _0x448859=_0x5f2f[_0x53f6ad];return _0x448859;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x301ea0,_0x1ddb08){var _0x6b2abb=function(_0x49a5f5){while(--_0x49a5f5){_0x301ea0['push'](_0x301ea0['shift']());}};_0x6b2abb(++_0x1ddb08);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2fa931,_0x63006f){_0x2fa931=_0x2fa931-0x0;var _0x28ceae=_0x5f2f[_0x2fa931];return _0x28ceae;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 65f6b5f..9d34290 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 _0x6183=['rpc','message','result','catch','exports','bluebird','../../config/logger','routing','http','Request','request','then','debug','error'];(function(_0x1cab7b,_0x2632f8){var _0x5335a8=function(_0xc53aa9){while(--_0xc53aa9){_0x1cab7b['push'](_0x1cab7b['shift']());}};_0x5335a8(++_0x2632f8);}(_0x6183,0x19b));var _0x3618=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x6183[_0x3792e6];return _0x441e44;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x3618('0x0'));var logger=require(_0x3618('0x1'))(_0x3618('0x2'));var client=jayson['client'][_0x3618('0x3')]({'port':0x2329});client[_0x3618('0x4')]=function(_0x176f61,_0x2d62a7){return new BPromise(function(_0x21af62,_0x10918c){return client[_0x3618('0x5')](_0x176f61,_0x2d62a7)[_0x3618('0x6')](function(_0x3d1f08){logger[_0x3618('0x7')]('rpc','routing',_0x176f61,_0x2d62a7,_0x3d1f08);if(_0x3d1f08[_0x3618('0x8')]){logger[_0x3618('0x8')](_0x3618('0x9'),_0x3618('0x2'),_0x176f61,_0x3d1f08[_0x3618('0x8')][_0x3618('0xa')],_0x2d62a7);return _0x10918c(_0x3d1f08[_0x3618('0x8')][_0x3618('0xa')]);}else{return _0x21af62(_0x3d1f08[_0x3618('0xb')]);}})[_0x3618('0xc')](function(_0x714f6f){logger[_0x3618('0x8')]('rpc','routing',_0x176f61,_0x714f6f,_0x2d62a7);return _0x10918c(_0x714f6f);});});};module[_0x3618('0xd')]=client; \ No newline at end of file +var _0x94b1=['error','message','result','catch','exports','bluebird','routing','client','http','then','rpc'];(function(_0x279232,_0x2ed3c8){var _0x160a49=function(_0x1afaad){while(--_0x1afaad){_0x279232['push'](_0x279232['shift']());}};_0x160a49(++_0x2ed3c8);}(_0x94b1,0x102));var _0x194b=function(_0x3669b5,_0x11a1fc){_0x3669b5=_0x3669b5-0x0;var _0x181e25=_0x94b1[_0x3669b5];return _0x181e25;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x194b('0x0'));var logger=require('../../config/logger')(_0x194b('0x1'));var client=jayson[_0x194b('0x2')][_0x194b('0x3')]({'port':0x2329});client['Request']=function(_0x13fda1,_0x3a21be){return new BPromise(function(_0x32586a,_0x23ab83){return client['request'](_0x13fda1,_0x3a21be)[_0x194b('0x4')](function(_0x31b63d){logger['debug'](_0x194b('0x5'),_0x194b('0x1'),_0x13fda1,_0x3a21be,_0x31b63d);if(_0x31b63d[_0x194b('0x6')]){logger[_0x194b('0x6')](_0x194b('0x5'),_0x194b('0x1'),_0x13fda1,_0x31b63d[_0x194b('0x6')][_0x194b('0x7')],_0x3a21be);return _0x23ab83(_0x31b63d[_0x194b('0x6')]['message']);}else{return _0x32586a(_0x31b63d[_0x194b('0x8')]);}})[_0x194b('0x9')](function(_0x2f97a9){logger['error'](_0x194b('0x5'),_0x194b('0x1'),_0x13fda1,_0x2f97a9,_0x3a21be);return _0x23ab83(_0x2f97a9);});});};module[_0x194b('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 7f29012..55a9022 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 _0x960c=['catch','log','bluebird','./realtime','./rpc/mailAccount','../../mysqldb','resolve','getMailAccounts','then','refresh','mailAccounts','listen','loginMailFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x960c,0x113));var _0xc960=function(_0x5c7d9e,_0x2774f7){_0x5c7d9e=_0x5c7d9e-0x0;var _0x5dc749=_0x960c[_0x5c7d9e];return _0x5dc749;};'use strict';var BPromise=require(_0xc960('0x0'));var server=require('./server');var Realtime=require(_0xc960('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xc960('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xc960('0x3'))['db'];function initRealtime(){return BPromise[_0xc960('0x4')]()['then'](mailAccount[_0xc960('0x5')]())[_0xc960('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0xc960('0x7')](realtime[_0xc960('0x8')]);return realtime;});}function main(){return server[_0xc960('0x9')](realtime,email)['then'](function(_0x513f9c){return initRealtime();})[_0xc960('0x6')](function(_0x284b2a){return db['Setting']['findOne']({'attributes':['id',_0xc960('0xa')],'raw':!![]});})[_0xc960('0x6')](function(_0x1e999f){return setInterval(initRealtime,_0x1e999f[_0xc960('0xa')]*0x3e8);})[_0xc960('0xb')](function(_0x5358d0){console[_0xc960('0xc')](_0x5358d0);});}main(); \ No newline at end of file +var _0x2e65=['./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then','initMailAccounts','refresh','mailAccounts','listen','findOne','loginMailFrequency','log','bluebird','./server'];(function(_0x5842c3,_0x56bd74){var _0x44bf8c=function(_0x79551f){while(--_0x79551f){_0x5842c3['push'](_0x5842c3['shift']());}};_0x44bf8c(++_0x56bd74);}(_0x2e65,0x193));var _0x52e6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x2e65[_0x278e3c];return _0x3e2d9b;};'use strict';var BPromise=require(_0x52e6('0x0'));var server=require(_0x52e6('0x1'));var Realtime=require(_0x52e6('0x2'));var EmailChannel=require(_0x52e6('0x3'));var mailAccount=require(_0x52e6('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x52e6('0x5'))['db'];function initRealtime(){return BPromise[_0x52e6('0x6')]()[_0x52e6('0x7')](mailAccount['getMailAccounts']())[_0x52e6('0x7')](realtime[_0x52e6('0x8')]())[_0x52e6('0x7')](function(){email[_0x52e6('0x9')](realtime[_0x52e6('0xa')]);return realtime;});}function main(){return server[_0x52e6('0xb')](realtime,email)[_0x52e6('0x7')](function(_0x1401a3){return initRealtime();})[_0x52e6('0x7')](function(_0x2ab17e){return db['Setting'][_0x52e6('0xc')]({'attributes':['id',_0x52e6('0xd')],'raw':!![]});})['then'](function(_0x330040){return setInterval(initRealtime,_0x330040['loginMailFrequency']*0x3e8);})['catch'](function(_0x471d57){console[_0x52e6('0xe')](_0x471d57);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 0f0a96a..df8145a 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 _0xff98=['moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','status','messageStatus','total','isNil','emit','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','stringify','handleImapError','error','send','Smtp','lastSync','verified','exports'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xff98,0x138));var _0x8ff9=function(_0x2bcba2,_0x1daf85){_0x2bcba2=_0x2bcba2-0x0;var _0x543694=_0xff98[_0x2bcba2];return _0x543694;};'use strict';var _=require('lodash');var moment=require(_0x8ff9('0x0'));var BPromise=require(_0x8ff9('0x1'));var md5=require(_0x8ff9('0x2'));var Redis=require(_0x8ff9('0x3'));var config=require(_0x8ff9('0x4'));var logger=require(_0x8ff9('0x5'))(_0x8ff9('0x6'));config[_0x8ff9('0x7')]=_['defaults'](config['redis'],{'host':_0x8ff9('0x8'),'port':0x18eb});var io=require(_0x8ff9('0x9'))(new Redis(config[_0x8ff9('0x7')]));var EmailImap=require(_0x8ff9('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x8ff9('0xb'));var md5Accounts={};function EmailChannel(_0x313f91){logger[_0x8ff9('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x313f91[_0x8ff9('0xd')];this[_0x8ff9('0xe')]={};this[_0x8ff9('0xf')]=new EmailSmtp();}EmailChannel[_0x8ff9('0x10')]['emit']=function(_0x1d507a){var _0x3a3552=this[_0x8ff9('0xd')][_0x1d507a];var _0x31cc36={'id':_0x3a3552['id'],'name':_0x3a3552[_0x8ff9('0x11')],'key':_0x3a3552[_0x8ff9('0x12')],'active':_0x3a3552[_0x8ff9('0x13')],'Imap':{'status':_0x3a3552[_0x8ff9('0x14')][_0x8ff9('0x15')],'messageStatus':_0x3a3552[_0x8ff9('0x14')][_0x8ff9('0x16')],'total':_0x3a3552[_0x8ff9('0x14')][_0x8ff9('0x17')]}};if(_[_0x8ff9('0x18')](md5Accounts[_0x1d507a])){md5Accounts[_0x1d507a]={};}var _0x45e7d1=md5(JSON['stringify'](_0x31cc36));if(md5Accounts[_0x1d507a][_0x8ff9('0x2')]!==_0x45e7d1){md5Accounts[_0x1d507a][_0x8ff9('0x2')]=_0x45e7d1;io[_0x8ff9('0x19')](_0x8ff9('0x1a'),_0x31cc36);}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x1b')]=function(_0x4e096e){for(var _0x14c7e4 in _0x4e096e){if(_0x4e096e[_0x8ff9('0x1c')](_0x14c7e4)){if(_0x4e096e[_0x14c7e4][_0x8ff9('0x14')]&&_0x4e096e[_0x14c7e4][_0x8ff9('0x13')]){var _0x3bc65f=_0x4e096e[_0x14c7e4][_0x8ff9('0x14')];if(!this[_0x8ff9('0xe')][_0x8ff9('0x1c')](_0x3bc65f['id'])){this[_0x8ff9('0xe')][_0x3bc65f['id']]=new EmailImap(_0x3bc65f,_0x4e096e[_0x14c7e4][_0x8ff9('0x6')]);this[_0x8ff9('0xe')][_0x3bc65f['id']]['on'](_0x8ff9('0x1d'),this[_0x8ff9('0x1e')][_0x8ff9('0x1f')](this,_0x14c7e4));this[_0x8ff9('0xe')][_0x3bc65f['id']]['on'](_0x8ff9('0x6'),this[_0x8ff9('0x20')][_0x8ff9('0x1f')](this,_0x14c7e4));this[_0x8ff9('0xe')][_0x3bc65f['id']]['on']('end',this[_0x8ff9('0x21')][_0x8ff9('0x1f')](this,_0x14c7e4));this['imapAccounts'][_0x3bc65f['id']]['on']('error',this['handleImapError'][_0x8ff9('0x1f')](this,_0x14c7e4));}}else{if(_['isNil'](this[_0x8ff9('0xd')][_0x14c7e4][_0x8ff9('0x14')])){this[_0x8ff9('0xd')][_0x14c7e4][_0x8ff9('0x14')]={};}this[_0x8ff9('0xd')][_0x14c7e4]['Imap'][_0x8ff9('0x15')]=_0x8ff9('0x22');this[_0x8ff9('0xd')][_0x14c7e4][_0x8ff9('0x14')]['messageStatus']='';this[_0x8ff9('0x19')](_0x14c7e4);}}}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x1e')]=function(_0x32f1be,_0x1323f8){if(this[_0x8ff9('0xd')][_0x32f1be]){this[_0x8ff9('0xd')][_0x32f1be][_0x8ff9('0x14')][_0x8ff9('0x15')]=_0x8ff9('0x23');this[_0x8ff9('0xd')][_0x32f1be][_0x8ff9('0x14')][_0x8ff9('0x16')]=_0x1323f8[_0x8ff9('0x11')];if(_0x1323f8[_0x8ff9('0x24')]){this[_0x8ff9('0xd')][_0x32f1be][_0x8ff9('0x14')][_0x8ff9('0x17')]=_0x1323f8['messages'][_0x8ff9('0x17')];}return this[_0x8ff9('0x19')](_0x32f1be);}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x20')]=function(_0x1d6a40,_0x11388b){logger[_0x8ff9('0xc')](_0x8ff9('0x25'),_0x11388b[_0x8ff9('0x26')],_0x11388b[_0x8ff9('0x27')],_0x11388b['from'],_0x1d6a40);if(this[_0x8ff9('0xd')][_0x1d6a40]){return mailAccount[_0x8ff9('0x28')](_0x1d6a40,_0x11388b)[_0x8ff9('0x29')](function(_0x301947){if(_0x301947){logger['info'](_0x8ff9('0x2a'));}})[_0x8ff9('0x2b')](function(_0x58ede3){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x8ff9('0x2c')](_0x58ede3));});}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x21')]=function(_0x150b17){if(this[_0x8ff9('0xd')][_0x150b17]&&this[_0x8ff9('0xd')][_0x150b17][_0x8ff9('0x14')]){if(this[_0x8ff9('0xe')][this[_0x8ff9('0xd')][_0x150b17][_0x8ff9('0x14')]['id']]){delete this['imapAccounts'][this[_0x8ff9('0xd')][_0x150b17][_0x8ff9('0x14')]['id']];}this[_0x8ff9('0xd')][_0x150b17]['Imap']['lastSync']=moment();this[_0x8ff9('0x19')](_0x150b17);}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x2d')]=function(_0x183a3d,_0x40942f){if(this[_0x8ff9('0xd')][_0x183a3d]){this['mailAccounts'][_0x183a3d]['Imap'][_0x8ff9('0x15')]=_0x8ff9('0x2e');this[_0x8ff9('0xd')][_0x183a3d]['Imap']['messageStatus']=_0x40942f;return this[_0x8ff9('0x19')](_0x183a3d);}};EmailChannel[_0x8ff9('0x10')]['sendMail']=function(_0x484c6f,_0x5b9467){return this[_0x8ff9('0xf')][_0x8ff9('0x2f')](_0x484c6f,_0x5b9467);};EmailChannel[_0x8ff9('0x10')]['verifySmtp']=function(_0x3cfcc7){var _0x3835ff=this;if(this[_0x8ff9('0xd')][_0x3cfcc7['id']]){if(_['isNil'](this['mailAccounts'][_0x3cfcc7['id']]['Smtp'])){this[_0x8ff9('0xd')][_0x3cfcc7['id']][_0x8ff9('0x30')]={};}this[_0x8ff9('0xd')][_0x3cfcc7['id']]['Smtp'][_0x8ff9('0x31')]=moment();return new BPromise(function(_0x12b332,_0x4bcd95){return _0x3835ff[_0x8ff9('0xf')]['verify'](_0x3cfcc7)['then'](function(_0x5e9137){_0x3835ff[_0x8ff9('0xd')][_0x3cfcc7['id']]['Smtp'][_0x8ff9('0x15')]=_0x8ff9('0x32');_0x3835ff[_0x8ff9('0xd')][_0x3cfcc7['id']][_0x8ff9('0x30')]['messageStatus']='';_0x3835ff[_0x8ff9('0x19')](_0x3cfcc7['id']);_0x12b332(_0x5e9137);})[_0x8ff9('0x2b')](function(_0x2a36e0){_0x3835ff['mailAccounts'][_0x3cfcc7['id']][_0x8ff9('0x30')][_0x8ff9('0x15')]='error';_0x3835ff[_0x8ff9('0xd')][_0x3cfcc7['id']][_0x8ff9('0x30')][_0x8ff9('0x16')]=_0x2a36e0;_0x3835ff[_0x8ff9('0x19')](_0x3cfcc7['id']);_0x4bcd95(_0x2a36e0);});});}return this[_0x8ff9('0xf')]['verify'](_0x3cfcc7);};module[_0x8ff9('0x33')]=EmailChannel; \ No newline at end of file +var _0xaba6=['connected','messages','info','firstName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','handleImapError','sendMail','send','Smtp','verify','verified','catch','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','messageStatus','Imap','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','handleImapBox','bind','handleImapEmail','end','error','disabled','status'];(function(_0x2235bd,_0x10f9f9){var _0x1a16a3=function(_0x220863){while(--_0x220863){_0x2235bd['push'](_0x2235bd['shift']());}};_0x1a16a3(++_0x10f9f9);}(_0xaba6,0x80));var _0x6aba=function(_0x4abcf4,_0x4d80bc){_0x4abcf4=_0x4abcf4-0x0;var _0x24c066=_0xaba6[_0x4abcf4];return _0x24c066;};'use strict';var _=require(_0x6aba('0x0'));var moment=require('moment');var BPromise=require(_0x6aba('0x1'));var md5=require(_0x6aba('0x2'));var Redis=require(_0x6aba('0x3'));var config=require(_0x6aba('0x4'));var logger=require(_0x6aba('0x5'))(_0x6aba('0x6'));config[_0x6aba('0x7')]=_[_0x6aba('0x8')](config[_0x6aba('0x7')],{'host':_0x6aba('0x9'),'port':0x18eb});var io=require(_0x6aba('0xa'))(new Redis(config[_0x6aba('0x7')]));var EmailImap=require(_0x6aba('0xb'));var EmailSmtp=require(_0x6aba('0xc'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x4a4760){logger['info'](_0x6aba('0xd'));this[_0x6aba('0xe')]=_0x4a4760[_0x6aba('0xe')];this[_0x6aba('0xf')]={};this[_0x6aba('0x10')]=new EmailSmtp();}EmailChannel[_0x6aba('0x11')]['emit']=function(_0x30ce7c){var _0x558529=this[_0x6aba('0xe')][_0x30ce7c];var _0x48390f={'id':_0x558529['id'],'name':_0x558529[_0x6aba('0x12')],'key':_0x558529[_0x6aba('0x13')],'active':_0x558529[_0x6aba('0x14')],'Imap':{'status':_0x558529['Imap']['status'],'messageStatus':_0x558529['Imap'][_0x6aba('0x15')],'total':_0x558529[_0x6aba('0x16')][_0x6aba('0x17')]}};if(_[_0x6aba('0x18')](md5Accounts[_0x30ce7c])){md5Accounts[_0x30ce7c]={};}var _0x4d7b2d=md5(JSON[_0x6aba('0x19')](_0x48390f));if(md5Accounts[_0x30ce7c][_0x6aba('0x2')]!==_0x4d7b2d){md5Accounts[_0x30ce7c]['md5']=_0x4d7b2d;io[_0x6aba('0x1a')](_0x6aba('0x1b'),_0x48390f);}};EmailChannel[_0x6aba('0x11')][_0x6aba('0x1c')]=function(_0x5bedef){for(var _0x5a932a in _0x5bedef){if(_0x5bedef[_0x6aba('0x1d')](_0x5a932a)){if(_0x5bedef[_0x5a932a][_0x6aba('0x16')]&&_0x5bedef[_0x5a932a][_0x6aba('0x14')]){var _0x20a4f5=_0x5bedef[_0x5a932a][_0x6aba('0x16')];if(!this['imapAccounts'][_0x6aba('0x1d')](_0x20a4f5['id'])){this[_0x6aba('0xf')][_0x20a4f5['id']]=new EmailImap(_0x20a4f5,_0x5bedef[_0x5a932a][_0x6aba('0x6')]);this[_0x6aba('0xf')][_0x20a4f5['id']]['on']('box',this[_0x6aba('0x1e')][_0x6aba('0x1f')](this,_0x5a932a));this[_0x6aba('0xf')][_0x20a4f5['id']]['on'](_0x6aba('0x6'),this[_0x6aba('0x20')][_0x6aba('0x1f')](this,_0x5a932a));this[_0x6aba('0xf')][_0x20a4f5['id']]['on'](_0x6aba('0x21'),this['handleImapEnd'][_0x6aba('0x1f')](this,_0x5a932a));this[_0x6aba('0xf')][_0x20a4f5['id']]['on'](_0x6aba('0x22'),this['handleImapError'][_0x6aba('0x1f')](this,_0x5a932a));}}else{if(_[_0x6aba('0x18')](this[_0x6aba('0xe')][_0x5a932a][_0x6aba('0x16')])){this[_0x6aba('0xe')][_0x5a932a][_0x6aba('0x16')]={};}this[_0x6aba('0xe')][_0x5a932a][_0x6aba('0x16')]['status']=_0x6aba('0x23');this[_0x6aba('0xe')][_0x5a932a][_0x6aba('0x16')][_0x6aba('0x15')]='';this[_0x6aba('0x1a')](_0x5a932a);}}}};EmailChannel[_0x6aba('0x11')]['handleImapBox']=function(_0x53d705,_0x577fbe){if(this['mailAccounts'][_0x53d705]){this[_0x6aba('0xe')][_0x53d705][_0x6aba('0x16')][_0x6aba('0x24')]=_0x6aba('0x25');this['mailAccounts'][_0x53d705][_0x6aba('0x16')][_0x6aba('0x15')]=_0x577fbe['name'];if(_0x577fbe[_0x6aba('0x26')]){this['mailAccounts'][_0x53d705][_0x6aba('0x16')][_0x6aba('0x17')]=_0x577fbe['messages'][_0x6aba('0x17')];}return this[_0x6aba('0x1a')](_0x53d705);}};EmailChannel['prototype']['handleImapEmail']=function(_0x76bbdc,_0x5a57ef){logger[_0x6aba('0x27')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5a57ef[_0x6aba('0x28')],_0x5a57ef['lastName'],_0x5a57ef[_0x6aba('0x29')],_0x76bbdc);if(this[_0x6aba('0xe')][_0x76bbdc]){return mailAccount[_0x6aba('0x2a')](_0x76bbdc,_0x5a57ef)[_0x6aba('0x2b')](function(_0xf0b282){if(_0xf0b282){logger[_0x6aba('0x27')](_0x6aba('0x2c'));}})['catch'](function(_0x31e3f7){logger['error'](_0x6aba('0x2d'),JSON[_0x6aba('0x19')](_0x31e3f7));});}};EmailChannel[_0x6aba('0x11')][_0x6aba('0x2e')]=function(_0xdfff14){if(this['mailAccounts'][_0xdfff14]&&this[_0x6aba('0xe')][_0xdfff14][_0x6aba('0x16')]){if(this[_0x6aba('0xf')][this[_0x6aba('0xe')][_0xdfff14]['Imap']['id']]){delete this['imapAccounts'][this[_0x6aba('0xe')][_0xdfff14][_0x6aba('0x16')]['id']];}this[_0x6aba('0xe')][_0xdfff14][_0x6aba('0x16')]['lastSync']=moment();this[_0x6aba('0x1a')](_0xdfff14);}};EmailChannel[_0x6aba('0x11')][_0x6aba('0x2f')]=function(_0x23e70a,_0xa5e36f){if(this[_0x6aba('0xe')][_0x23e70a]){this[_0x6aba('0xe')][_0x23e70a]['Imap'][_0x6aba('0x24')]=_0x6aba('0x22');this['mailAccounts'][_0x23e70a][_0x6aba('0x16')]['messageStatus']=_0xa5e36f;return this['emit'](_0x23e70a);}};EmailChannel[_0x6aba('0x11')][_0x6aba('0x30')]=function(_0x1e52d7,_0x5bc493){return this[_0x6aba('0x10')][_0x6aba('0x31')](_0x1e52d7,_0x5bc493);};EmailChannel[_0x6aba('0x11')]['verifySmtp']=function(_0x9d2e5){var _0x9497ef=this;if(this[_0x6aba('0xe')][_0x9d2e5['id']]){if(_[_0x6aba('0x18')](this[_0x6aba('0xe')][_0x9d2e5['id']][_0x6aba('0x32')])){this[_0x6aba('0xe')][_0x9d2e5['id']][_0x6aba('0x32')]={};}this[_0x6aba('0xe')][_0x9d2e5['id']][_0x6aba('0x32')]['lastSync']=moment();return new BPromise(function(_0x4dcd35,_0x1a322e){return _0x9497ef['smtp'][_0x6aba('0x33')](_0x9d2e5)[_0x6aba('0x2b')](function(_0x52bd45){_0x9497ef[_0x6aba('0xe')][_0x9d2e5['id']][_0x6aba('0x32')][_0x6aba('0x24')]=_0x6aba('0x34');_0x9497ef[_0x6aba('0xe')][_0x9d2e5['id']][_0x6aba('0x32')][_0x6aba('0x15')]='';_0x9497ef[_0x6aba('0x1a')](_0x9d2e5['id']);_0x4dcd35(_0x52bd45);})[_0x6aba('0x35')](function(_0x5d65bd){_0x9497ef['mailAccounts'][_0x9d2e5['id']][_0x6aba('0x32')][_0x6aba('0x24')]=_0x6aba('0x22');_0x9497ef[_0x6aba('0xe')][_0x9d2e5['id']]['Smtp'][_0x6aba('0x15')]=_0x5d65bd;_0x9497ef[_0x6aba('0x1a')](_0x9d2e5['id']);_0x1a322e(_0x5d65bd);});});}return this[_0x6aba('0x10')][_0x6aba('0x33')](_0x9d2e5);};module[_0x6aba('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 ff30285..b7a4479 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 _0x33ad=['util','imap','lodash','randomstring','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleFetchError','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x33ad,0x18c));var _0xd33a=function(_0x4c6711,_0x235a12){_0x4c6711=_0x4c6711-0x0;var _0x484e93=_0x33ad[_0x4c6711];return _0x484e93;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xd33a('0x0'));var Imap=require(_0xd33a('0x1'));var _=require(_0xd33a('0x2'));var rs=require(_0xd33a('0x3'));var simpleParser=require('mailparser')[_0xd33a('0x4')];var Iconv=require(_0xd33a('0x5'))[_0xd33a('0x6')];var EventEmitter=require('events')[_0xd33a('0x7')];var utils=require(_0xd33a('0x8'));var logger=require(_0xd33a('0x9'))(_0xd33a('0xa'));function EmailImap(_0x3e7eb2,_0x5d4dc1){this[_0xd33a('0xb')]=_0xd33a('0xc');this['account']=this['getAccount'](_0x3e7eb2,_0x5d4dc1);this[_0xd33a('0x1')]=new Imap(this[_0xd33a('0xd')]);this[_0xd33a('0x1')][_0xd33a('0xe')](_0xd33a('0xf'),this[_0xd33a('0x10')][_0xd33a('0x11')](this));this['imap'][_0xd33a('0xe')](_0xd33a('0x12'),this['handleEnd'][_0xd33a('0x11')](this));this[_0xd33a('0x1')]['on'](_0xd33a('0x13'),this[_0xd33a('0x14')][_0xd33a('0x11')](this));this[_0xd33a('0x1')][_0xd33a('0x15')]();}util[_0xd33a('0x16')](EmailImap,EventEmitter);EmailImap[_0xd33a('0x17')][_0xd33a('0x18')]=function(_0x3daac1,_0xdac870){var _0x3d494b={'connTimeout':_0x3daac1[_0xd33a('0x19')]?_0x3daac1[_0xd33a('0x19')]*0x3e8:0x2710,'authTimeout':_0x3daac1[_0xd33a('0x1a')]?_0x3daac1[_0xd33a('0x1a')]*0x3e8:0x1388};if(_[_0xd33a('0x1b')](_0x3daac1[_0xd33a('0x1c')])){if(_0x3daac1[_0xd33a('0x1d')]){_0x3d494b[_0xd33a('0x1e')]=_0x3daac1['user'];_0x3d494b[_0xd33a('0x1f')]=_0x3daac1[_0xd33a('0x1f')];}_0x3d494b['host']=_0x3daac1[_0xd33a('0x20')];_0x3d494b[_0xd33a('0x21')]=_0x3daac1[_0xd33a('0x21')]||0x3e1;if(_0x3daac1[_0xd33a('0x22')]){_0x3d494b[_0xd33a('0x22')]=!![];}else{_0x3d494b[_0xd33a('0x22')]=![];_0x3d494b[_0xd33a('0x23')]=_0xd33a('0x24');}}else{_0x3d494b[_0xd33a('0x1e')]=_0x3daac1[_0xd33a('0x1e')];_0x3d494b['password']=_0x3daac1[_0xd33a('0x1f')];_0x3d494b[_0xd33a('0x20')]=utils[_0xd33a('0x25')](_0x3daac1[_0xd33a('0x1c')]);_0x3d494b[_0xd33a('0x21')]=0x3e1;_0x3d494b[_0xd33a('0x22')]=!![];}_0x3d494b[_0xd33a('0xa')]=_0xdac870||_0x3daac1[_0xd33a('0x1e')]||_0xd33a('0x26');return _0x3d494b;};EmailImap['prototype'][_0xd33a('0x10')]=function(){this[_0xd33a('0x1')][_0xd33a('0x27')](this[_0xd33a('0xb')],![],this[_0xd33a('0x28')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x28')]=function(_0x45d4ca,_0x219cec){if(_0x45d4ca){this['handleError'](_0x45d4ca,!![]);}else{this[_0xd33a('0x29')](_0xd33a('0x2a'),_0x219cec);this[_0xd33a('0x2b')]();}};EmailImap['prototype'][_0xd33a('0x2c')]=function(_0x512b7b){if(_0x512b7b){this['handleError'](_0x512b7b,!![]);}else{this[_0xd33a('0x1')][_0xd33a('0x12')]();}};EmailImap[_0xd33a('0x17')][_0xd33a('0x2b')]=function(){this[_0xd33a('0x1')][_0xd33a('0x2d')](['UNSEEN'],this[_0xd33a('0x2e')][_0xd33a('0x11')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x1ffa74,_0x198582){if(_0x1ffa74){this[_0xd33a('0x14')](_0x1ffa74,!![]);}else{if(_0x198582[_0xd33a('0x2f')]){try{var _0x27a1a3=this['imap'][_0xd33a('0x30')](_0x198582,{'bodies':'','markSeen':!![]});_0x27a1a3['on']('message',this[_0xd33a('0x31')][_0xd33a('0x11')](this));_0x27a1a3['once'](_0xd33a('0x13'),this['handleFetchError'][_0xd33a('0x11')](this));_0x27a1a3['once'](_0xd33a('0x12'),this[_0xd33a('0x32')][_0xd33a('0x11')](this));}catch(_0x2be747){logger[_0xd33a('0x13')](_0x2be747);}}else{this['imap']['closeBox'](!![],this[_0xd33a('0x2c')][_0xd33a('0x11')](this));}}};EmailImap['prototype'][_0xd33a('0x31')]=function(_0xd37015,_0x50677d){_0xd37015['on'](_0xd33a('0x33'),this[_0xd33a('0x34')][_0xd33a('0x11')](this));_0xd37015['once'](_0xd33a('0x35'),this[_0xd33a('0x36')][_0xd33a('0x11')](this));_0xd37015[_0xd33a('0xe')](_0xd33a('0x12'),this[_0xd33a('0x37')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x34')]=function(_0x3de279,_0x34ff71){simpleParser(_0x3de279,{'Iconv':Iconv},this[_0xd33a('0x38')][_0xd33a('0x11')](this));};EmailImap['prototype'][_0xd33a('0x36')]=function(_0x320a29){};EmailImap[_0xd33a('0x17')]['handleMessageEnd']=function(){};EmailImap[_0xd33a('0x17')][_0xd33a('0x38')]=function(_0x362b94,_0x545289){if(_0x362b94){logger[_0xd33a('0x13')](_0x362b94);}else{var _0x261234=this;utils[_0xd33a('0x39')](this[_0xd33a('0xd')],_0x545289,function(_0x583e16){_0x261234[_0xd33a('0x29')]('email',_0x583e16);});}};EmailImap['prototype'][_0xd33a('0x32')]=function(){this[_0xd33a('0x1')][_0xd33a('0x3a')](!![],this[_0xd33a('0x2c')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x3b')]=function(_0x56a7a5){this[_0xd33a('0x14')](_0x56a7a5);this[_0xd33a('0x1')][_0xd33a('0x3a')](!![],this[_0xd33a('0x2c')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x3c')]=function(){this['emit'](_0xd33a('0x12'));};EmailImap[_0xd33a('0x17')]['handleError']=function(_0x18179f,_0x4a80f2){logger[_0xd33a('0x13')](_0xd33a('0x14'),this[_0xd33a('0xd')][_0xd33a('0xa')],JSON[_0xd33a('0x3d')](_0x18179f));var _0x3109e7='';if(_0x18179f){if(_0x18179f[_0xd33a('0x3e')]){_0x3109e7=_0x18179f[_0xd33a('0x3e')];}else{for(var _0x2b86cd in _0x18179f){if(_0x18179f[_0xd33a('0x3f')](_0x2b86cd)){_0x3109e7+=_[_0xd33a('0x40')](_0x2b86cd)+':\x20'+_0x18179f[_0x2b86cd]+'\x0a';}}}}if(_0x4a80f2){this[_0xd33a('0x1')][_0xd33a('0x12')]();}else{this['emit'](_0xd33a('0x13'),_0x3109e7);this[_0xd33a('0x29')](_0xd33a('0x12'));}};module[_0xd33a('0x41')]=EmailImap; \ No newline at end of file +var _0x8872=['upperFirst','exports','path','util','imap','mailparser','simpleParser','iconv','events','./utils','email','mailbox','INBOX','account','getAccount','once','bind','end','handleEnd','error','handleError','inherits','prototype','connTimeout','authTimeout','service','authentication','user','password','host','port','tls','handleReady','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','emit','stringify','textCode'];(function(_0x773a5e,_0x368340){var _0x264c77=function(_0x407093){while(--_0x407093){_0x773a5e['push'](_0x773a5e['shift']());}};_0x264c77(++_0x368340);}(_0x8872,0x152));var _0x2887=function(_0x57170e,_0x988d8f){_0x57170e=_0x57170e-0x0;var _0x64451b=_0x8872[_0x57170e];return _0x64451b;};'use strict';var fs=require('fs');var path=require(_0x2887('0x0'));var util=require(_0x2887('0x1'));var Imap=require(_0x2887('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0x2887('0x3'))[_0x2887('0x4')];var Iconv=require(_0x2887('0x5'))['Iconv'];var EventEmitter=require(_0x2887('0x6'))['EventEmitter'];var utils=require(_0x2887('0x7'));var logger=require('../../../config/logger')(_0x2887('0x8'));function EmailImap(_0x18ee03,_0x432d01){this[_0x2887('0x9')]=_0x2887('0xa');this[_0x2887('0xb')]=this[_0x2887('0xc')](_0x18ee03,_0x432d01);this[_0x2887('0x2')]=new Imap(this['account']);this[_0x2887('0x2')][_0x2887('0xd')]('ready',this['handleReady'][_0x2887('0xe')](this));this[_0x2887('0x2')]['once'](_0x2887('0xf'),this[_0x2887('0x10')][_0x2887('0xe')](this));this['imap']['on'](_0x2887('0x11'),this[_0x2887('0x12')][_0x2887('0xe')](this));this['imap']['connect']();}util[_0x2887('0x13')](EmailImap,EventEmitter);EmailImap[_0x2887('0x14')]['getAccount']=function(_0x2d2c1a,_0x35f50b){var _0x48fca2={'connTimeout':_0x2d2c1a[_0x2887('0x15')]?_0x2d2c1a[_0x2887('0x15')]*0x3e8:0x2710,'authTimeout':_0x2d2c1a[_0x2887('0x16')]?_0x2d2c1a[_0x2887('0x16')]*0x3e8:0x1388};if(_['isNil'](_0x2d2c1a[_0x2887('0x17')])){if(_0x2d2c1a[_0x2887('0x18')]){_0x48fca2['user']=_0x2d2c1a[_0x2887('0x19')];_0x48fca2[_0x2887('0x1a')]=_0x2d2c1a[_0x2887('0x1a')];}_0x48fca2[_0x2887('0x1b')]=_0x2d2c1a[_0x2887('0x1b')];_0x48fca2[_0x2887('0x1c')]=_0x2d2c1a['port']||0x3e1;if(_0x2d2c1a[_0x2887('0x1d')]){_0x48fca2['tls']=!![];}else{_0x48fca2[_0x2887('0x1d')]=![];_0x48fca2['autotls']='required';}}else{_0x48fca2['user']=_0x2d2c1a[_0x2887('0x19')];_0x48fca2[_0x2887('0x1a')]=_0x2d2c1a['password'];_0x48fca2['host']=utils['getHost'](_0x2d2c1a[_0x2887('0x17')]);_0x48fca2[_0x2887('0x1c')]=0x3e1;_0x48fca2[_0x2887('0x1d')]=!![];}_0x48fca2[_0x2887('0x8')]=_0x35f50b||_0x2d2c1a['user']||'anonymous@xcally.com';return _0x48fca2;};EmailImap[_0x2887('0x14')][_0x2887('0x1e')]=function(){this[_0x2887('0x2')][_0x2887('0x1f')](this[_0x2887('0x9')],![],this[_0x2887('0x20')]['bind'](this));};EmailImap['prototype']['handleOpenBox']=function(_0x5ad276,_0x1f0e12){if(_0x5ad276){this[_0x2887('0x12')](_0x5ad276,!![]);}else{this['emit'](_0x2887('0x21'),_0x1f0e12);this[_0x2887('0x22')]();}};EmailImap[_0x2887('0x14')][_0x2887('0x23')]=function(_0x20154b){if(_0x20154b){this[_0x2887('0x12')](_0x20154b,!![]);}else{this[_0x2887('0x2')]['end']();}};EmailImap[_0x2887('0x14')][_0x2887('0x22')]=function(){this['imap'][_0x2887('0x24')]([_0x2887('0x25')],this[_0x2887('0x26')][_0x2887('0xe')](this));};EmailImap[_0x2887('0x14')][_0x2887('0x26')]=function(_0x2580c6,_0x23a41c){if(_0x2580c6){this['handleError'](_0x2580c6,!![]);}else{if(_0x23a41c[_0x2887('0x27')]){try{var _0x5b44fb=this[_0x2887('0x2')][_0x2887('0x28')](_0x23a41c,{'bodies':'','markSeen':!![]});_0x5b44fb['on']('message',this[_0x2887('0x29')][_0x2887('0xe')](this));_0x5b44fb[_0x2887('0xd')](_0x2887('0x11'),this[_0x2887('0x2a')][_0x2887('0xe')](this));_0x5b44fb[_0x2887('0xd')](_0x2887('0xf'),this[_0x2887('0x2b')][_0x2887('0xe')](this));}catch(_0xe9a3b3){logger[_0x2887('0x11')](_0xe9a3b3);}}else{this['imap'][_0x2887('0x2c')](!![],this[_0x2887('0x23')][_0x2887('0xe')](this));}}};EmailImap['prototype'][_0x2887('0x29')]=function(_0x4f885f,_0x8bb3a3){_0x4f885f['on'](_0x2887('0x2d'),this['handleMessageBody'][_0x2887('0xe')](this));_0x4f885f[_0x2887('0xd')]('attributes',this[_0x2887('0x2e')][_0x2887('0xe')](this));_0x4f885f[_0x2887('0xd')](_0x2887('0xf'),this[_0x2887('0x2f')][_0x2887('0xe')](this));};EmailImap[_0x2887('0x14')][_0x2887('0x30')]=function(_0x480702,_0x1de465){simpleParser(_0x480702,{'Iconv':Iconv},this[_0x2887('0x31')][_0x2887('0xe')](this));};EmailImap[_0x2887('0x14')]['handleMessageAttributes']=function(_0x1c81cd){};EmailImap['prototype'][_0x2887('0x2f')]=function(){};EmailImap[_0x2887('0x14')][_0x2887('0x31')]=function(_0x5973fe,_0x46ee11){if(_0x5973fe){logger['error'](_0x5973fe);}else{var _0x685eb3=this;utils[_0x2887('0x32')](this['account'],_0x46ee11,function(_0x2d0a7d){_0x685eb3[_0x2887('0x33')](_0x2887('0x8'),_0x2d0a7d);});}};EmailImap[_0x2887('0x14')][_0x2887('0x2b')]=function(){this[_0x2887('0x2')]['closeBox'](!![],this[_0x2887('0x23')][_0x2887('0xe')](this));};EmailImap[_0x2887('0x14')][_0x2887('0x2a')]=function(_0x32f53d){this[_0x2887('0x12')](_0x32f53d);this['imap'][_0x2887('0x2c')](!![],this[_0x2887('0x23')]['bind'](this));};EmailImap[_0x2887('0x14')][_0x2887('0x10')]=function(){this[_0x2887('0x33')](_0x2887('0xf'));};EmailImap[_0x2887('0x14')][_0x2887('0x12')]=function(_0x4f5d72,_0x913c84){logger['error'](_0x2887('0x12'),this[_0x2887('0xb')]['email'],JSON[_0x2887('0x34')](_0x4f5d72));var _0x5e4004='';if(_0x4f5d72){if(_0x4f5d72['textCode']){_0x5e4004=_0x4f5d72[_0x2887('0x35')];}else{for(var _0x1ebf15 in _0x4f5d72){if(_0x4f5d72['hasOwnProperty'](_0x1ebf15)){_0x5e4004+=_[_0x2887('0x36')](_0x1ebf15)+':\x20'+_0x4f5d72[_0x1ebf15]+'\x0a';}}}}if(_0x913c84){this[_0x2887('0x2')][_0x2887('0xf')]();}else{this['emit'](_0x2887('0x11'),_0x5e4004);this[_0x2887('0x33')](_0x2887('0xf'));}};module[_0x2887('0x37')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 318acc2..c3e6c21 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 _0xe176=['sendMail','toString','verify','exports','nodemailer','prototype','createTransport','use','compile'];(function(_0x563414,_0x432607){var _0x5e1c07=function(_0x4d177b){while(--_0x4d177b){_0x563414['push'](_0x563414['shift']());}};_0x5e1c07(++_0x432607);}(_0xe176,0x1b4));var _0x6e17=function(_0x540041,_0x388ca0){_0x540041=_0x540041-0x0;var _0x5a4898=_0xe176[_0x540041];return _0x5a4898;};'use strict';var nodemailer=require(_0x6e17('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x6e17('0x1')]['send']=function(_0x48babe,_0x21d503){return new BPromise(function(_0x3fe475,_0x5b4f88){var _0x301365=nodemailer[_0x6e17('0x2')](_0x48babe);_0x301365[_0x6e17('0x3')](_0x6e17('0x4'),inlineBase64());_0x301365[_0x6e17('0x5')](_0x21d503,function(_0x51a9d5,_0x5407fb){if(_0x51a9d5){_0x5b4f88(_0x51a9d5[_0x6e17('0x6')]());}else{_0x3fe475(_0x5407fb);}});});};EmailSmtp[_0x6e17('0x1')][_0x6e17('0x7')]=function(_0x27633c){return new BPromise(function(_0x500833,_0x143d1d){var _0x4ba754=nodemailer[_0x6e17('0x2')](_0x27633c);_0x4ba754[_0x6e17('0x7')](function(_0x50c559,_0x114a57){if(_0x50c559){_0x143d1d(_0x50c559['toString']());}else{if(_0x114a57){_0x500833(_0x114a57);}else{_0x143d1d('Not\x20verifired');}}});});};module[_0x6e17('0x8')]=EmailSmtp; \ No newline at end of file +var _0x9845=['createTransport','use','compile','sendMail','toString','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x9845,0x93));var _0x5984=function(_0x3de79f,_0x32b799){_0x3de79f=_0x3de79f-0x0;var _0x14ae3d=_0x9845[_0x3de79f];return _0x14ae3d;};'use strict';var nodemailer=require(_0x5984('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x5984('0x1'));function EmailSmtp(){}EmailSmtp[_0x5984('0x2')]['send']=function(_0x57a3ae,_0x4aa164){return new BPromise(function(_0x35536a,_0x51e5d0){var _0xe7de47=nodemailer[_0x5984('0x3')](_0x57a3ae);_0xe7de47[_0x5984('0x4')](_0x5984('0x5'),inlineBase64());_0xe7de47[_0x5984('0x6')](_0x4aa164,function(_0x530f5f,_0x37a6d2){if(_0x530f5f){_0x51e5d0(_0x530f5f[_0x5984('0x7')]());}else{_0x35536a(_0x37a6d2);}});});};EmailSmtp['prototype']['verify']=function(_0x4fbb31){return new BPromise(function(_0x28bcb3,_0x6cadb){var _0x2c6ffc=nodemailer[_0x5984('0x3')](_0x4fbb31);_0x2c6ffc['verify'](function(_0x12f737,_0x447a93){if(_0x12f737){_0x6cadb(_0x12f737['toString']());}else{if(_0x447a93){_0x28bcb3(_0x447a93);}else{_0x6cadb(_0x5984('0x8'));}}});});};module[_0x5984('0x9')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index f8f55bf..f44cd1d 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 _0x0d87=['join','name','length','pop','generate','test','html','replace','body','textAsHtml','Empty\x20message

','getHost','gmail','imap.gmail.com','yahoo','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','split','slice'];(function(_0x3c9ea9,_0x54d1ff){var _0x72390e=function(_0x34e75b){while(--_0x34e75b){_0x3c9ea9['push'](_0x3c9ea9['shift']());}};_0x72390e(++_0x54d1ff);}(_0x0d87,0x1b8));var _0x70d8=function(_0x2877b3,_0x4ba4a3){_0x2877b3=_0x2877b3-0x0;var _0x384fd8=_0x0d87[_0x2877b3];return _0x384fd8;};'use strict';var _=require(_0x70d8('0x0'));var moment=require(_0x70d8('0x1'));var random=require(_0x70d8('0x2'));var fs=require('fs');var path=require(_0x70d8('0x3'));var util=require('util');var tnef=require(_0x70d8('0x4'));var logger=require(_0x70d8('0x5'))(_0x70d8('0x6'));var config=require(_0x70d8('0x7'));function getAddress(_0x148484){var _0x134e1e=_[_0x70d8('0x8')](_0x148484[_0x70d8('0x9')]);return _0x134e1e&&_0x134e1e[_0x70d8('0xa')]?_0x134e1e[_0x70d8('0xa')]:_0x70d8('0xb')+random['generate'](0x6)+_0x70d8('0xc');}function getFirstName(_0x14a3ef){var _0x5138e2=_[_0x70d8('0x8')](_0x14a3ef[_0x70d8('0x9')]);if(_0x5138e2&&_0x5138e2['name']){var _0x436a55=_0x5138e2['name'][_0x70d8('0xd')](/\s+/);return _0x436a55['length']?_0x436a55[_0x70d8('0xe')](0x0,-0x1)[_0x70d8('0xf')]('\x20'):_0x5138e2[_0x70d8('0x10')];}return'Anonymous';}function getLastName(_0x10eaa1){var _0x566e66=_[_0x70d8('0x8')](_0x10eaa1['value']);if(_0x566e66&&_0x566e66[_0x70d8('0x10')]){var _0x1e650d=_0x566e66[_0x70d8('0x10')][_0x70d8('0xd')](/\s+/);return _0x1e650d[_0x70d8('0x11')]>0x1?_0x1e650d[_0x70d8('0x12')]():'';}return'';}function getMails(_0x1516e3,_0x2ee510){var _0x2a95a2='';for(var _0x304bed=0x0;_0x304bed<_0x2ee510[_0x70d8('0x9')][_0x70d8('0x11')];_0x304bed+=0x1){if(_0x2ee510[_0x70d8('0x9')][_0x304bed][_0x70d8('0xa')]!==_0x1516e3){if(!_['isEmpty'](_0x2a95a2)){_0x2a95a2+=',';}_0x2a95a2+=_0x2ee510[_0x70d8('0x9')][_0x304bed][_0x70d8('0x10')]||_0x2ee510[_0x70d8('0x9')][_0x304bed][_0x70d8('0xa')]||'';_0x2a95a2+='\x20<';_0x2a95a2+=_0x2ee510['value'][_0x304bed]['address']?_0x2ee510[_0x70d8('0x9')][_0x304bed]['address']:_0x70d8('0xb')+random[_0x70d8('0x13')](0x6)+_0x70d8('0xc');_0x2a95a2+='>';}}return _0x2a95a2;}function parseEmail(_0x25e0c4,_0x13cd29,_0x338f8b){if(_0x13cd29['html']){var _0x5bf42d=/)<[^<]*)*<\/script>/gi;while(_0x5bf42d[_0x70d8('0x14')](_0x13cd29[_0x70d8('0x15')])){_0x13cd29[_0x70d8('0x15')]=_0x13cd29['html'][_0x70d8('0x16')](_0x5bf42d,'');}_0x338f8b[_0x70d8('0x17')]=_0x13cd29[_0x70d8('0x15')];}else{_0x338f8b[_0x70d8('0x17')]=_0x13cd29[_0x70d8('0x18')];}if(_0x338f8b[_0x70d8('0x17')]){_0x338f8b[_0x70d8('0x17')]=_0x338f8b[_0x70d8('0x17')][_0x70d8('0x16')](/Empty\x20message

';if(_0x3336d8['Attachments']){for(var _0x566a05=0x0;_0x566a05<_0x3336d8[_0x70d8('0x36')][_0x70d8('0x11')];_0x566a05++){var _0x21ea92=_0x3336d8[_0x70d8('0x36')][_0x566a05];_0x124d3c['message'][_0x70d8('0x20')][_0x70d8('0x29')]({'filename':_0x21ea92[_0x70d8('0x37')],'content':new Buffer(_0x21ea92['Data'])});}}}_0x2c2a05(parseEmail(_0x390be1,_0x301e4e,_0x124d3c));});}else{_0x301e4e[_0x70d8('0x15')]=_0x70d8('0x38');_0x2c2a05(parseEmail(_0x390be1,_0x301e4e,_0x124d3c));}}else{_0x2c2a05(parseEmail(_0x390be1,_0x301e4e,_0x124d3c));}};exports[_0x70d8('0x39')]=function(_0xab5b13){switch(_0xab5b13){case _0x70d8('0x3a'):return _0x70d8('0x3b');case _0x70d8('0x3c'):return'imap.mail.yahoo.com';case _0x70d8('0x3d'):return'imap-mail.outlook.com';case _0x70d8('0x3e'):return _0x70d8('0x3f');}return _0x70d8('0x40');}; \ No newline at end of file +var _0x07cd=['originCc','includes','originTo','bcc','attachments','type','attachment-','format','now','root','server/files/attachments/','writeFileSync','push','contentType','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','

Empty\x20message

','Attachments','Title','Data','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','generate','name','length','slice','join','Anonymous','value','split','pop','isEmpty','anonymous','@xcally.com','test','html','body','textAsHtml','replace','0x1?_0x5573eb[_0xd07c('0x13')]():'';}return'';}function getMails(_0x390b4e,_0x26ec07){var _0x476d88='';for(var _0x9498f9=0x0;_0x9498f9<_0x26ec07['value']['length'];_0x9498f9+=0x1){if(_0x26ec07[_0xd07c('0x11')][_0x9498f9][_0xd07c('0xa')]!==_0x390b4e){if(!_[_0xd07c('0x14')](_0x476d88)){_0x476d88+=',';}_0x476d88+=_0x26ec07[_0xd07c('0x11')][_0x9498f9][_0xd07c('0xc')]||_0x26ec07[_0xd07c('0x11')][_0x9498f9]['address']||'';_0x476d88+='\x20<';_0x476d88+=_0x26ec07[_0xd07c('0x11')][_0x9498f9]['address']?_0x26ec07[_0xd07c('0x11')][_0x9498f9]['address']:_0xd07c('0x15')+random[_0xd07c('0xb')](0x6)+_0xd07c('0x16');_0x476d88+='>';}}return _0x476d88;}function parseEmail(_0x1cc5c1,_0x4f6537,_0x19e698){if(_0x4f6537['html']){var _0x21fd57=/)<[^<]*)*<\/script>/gi;while(_0x21fd57[_0xd07c('0x17')](_0x4f6537['html'])){_0x4f6537['html']=_0x4f6537[_0xd07c('0x18')]['replace'](_0x21fd57,'');}_0x19e698['body']=_0x4f6537[_0xd07c('0x18')];}else{_0x19e698[_0xd07c('0x19')]=_0x4f6537[_0xd07c('0x1a')];}if(_0x19e698[_0xd07c('0x19')]){_0x19e698['body']=_0x19e698[_0xd07c('0x19')][_0xd07c('0x1b')](/0x0){if(this[_0x498185+_0x9b46('0x23')]>0x0&&this[_0x498185+_0x9b46('0x24')]>=this[_0x498185+_0x9b46('0x23')]){return'maxcapacity';}else{return'working';}}else{return _0x9b46('0x25');}};Agent['prototype'][_0x9b46('0x26')]=function(){var _0x3c76f2=['mail',_0x9b46('0x27'),'openchannel',_0x9b46('0x28'),_0x9b46('0x29')];for(var _0x4d3b1b=0x0;_0x4d3b1b<_0x3c76f2[_0x9b46('0x2a')];_0x4d3b1b+=0x1){var _0x31ca63=this[_0x9b46('0x22')](_0x3c76f2[_0x4d3b1b]);if(this[_0x3c76f2[_0x4d3b1b]+_0x9b46('0x2b')]!==_0x31ca63){this[_0x3c76f2[_0x4d3b1b]+_0x9b46('0x2c')]=_[_0x9b46('0x2d')](moment()[_0x9b46('0x2e')]('x'));}this[_0x3c76f2[_0x4d3b1b]+'Status']=_0x31ca63;}var _0xdd756c={'id':this['id'],'name':this[_0x9b46('0x9')],'online':this[_0x9b46('0xa')],'voicePause':this[_0x9b46('0xb')],'chatPause':this[_0x9b46('0xc')],'mailPause':this[_0x9b46('0xd')],'smsPause':this[_0x9b46('0xf')],'faxPause':this['faxPause'],'openchannelPause':this[_0x9b46('0x10')],'chatStatus':this[_0x9b46('0x2f')],'chatStatusTime':this[_0x9b46('0x12')],'chatCapacity':this[_0x9b46('0x13')],'chatCurrentCapacity':this[_0x9b46('0x14')],'mailStatus':this[_0x9b46('0x30')],'mailStatusTime':this[_0x9b46('0x15')],'mailCapacity':this[_0x9b46('0x16')],'mailCurrentCapacity':this[_0x9b46('0x17')],'faxStatus':this[_0x9b46('0x18')],'faxStatusTime':this[_0x9b46('0x19')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x9b46('0x1b')],'smsStatus':this[_0x9b46('0x1c')],'smsStatusTime':this[_0x9b46('0x31')],'smsCapacity':this[_0x9b46('0x32')],'smsCurrentCapacity':this[_0x9b46('0x1d')],'openchannelStatus':this[_0x9b46('0x1e')],'openchannelStatusTime':this[_0x9b46('0x33')],'openchannelCapacity':this[_0x9b46('0x1f')],'openchannelCurrentCapacity':this[_0x9b46('0x34')],'busy':this[_0x9b46('0x35')],'busyQueue':this[_0x9b46('0x20')]};var _0x5cc65a=md5(JSON[_0x9b46('0x36')](_0xdd756c));if(this['md5']!==_0x5cc65a){this[_0x9b46('0x2')]=_0x5cc65a;io[_0x9b46('0x37')](_0x9b46('0x38'),_0xdd756c);}};module['exports']=Agent; \ No newline at end of file +var _0xe205=['user:save','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','updateRealtime','prototype','getChannelStatus','CurrentCapacity','working','mail','chat','openchannel','sms','Status','StatusTime','toNumber','format','online','mailCurrentCapacity','busyQueue','stringify','emit'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0xe205,0xa7));var _0x5e20=function(_0x14b685,_0x1c5d77){_0x14b685=_0x14b685-0x0;var _0x4d9a32=_0xe205[_0x14b685];return _0x4d9a32;};'use strict';var _=require(_0x5e20('0x0'));var moment=require(_0x5e20('0x1'));var md5=require(_0x5e20('0x2'));var Redis=require(_0x5e20('0x3'));var config=require(_0x5e20('0x4'));config[_0x5e20('0x5')]=_[_0x5e20('0x6')](config[_0x5e20('0x5')],{'host':_0x5e20('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e20('0x5')]));function Agent(_0x1b26a2){this['id']=_0x1b26a2['id']||0x0;this[_0x5e20('0x8')]=_0x1b26a2[_0x5e20('0x8')]||'';this['online']=_0x1b26a2['online']||!![];this[_0x5e20('0x9')]=_0x1b26a2['voicePause']||![];this['chatPause']=_0x1b26a2[_0x5e20('0xa')]||![];this[_0x5e20('0xb')]=_0x1b26a2['mailPause']||![];this[_0x5e20('0xc')]=_0x1b26a2[_0x5e20('0xc')]||![];this[_0x5e20('0xd')]=_0x1b26a2[_0x5e20('0xd')]||![];this['openchannelPause']=_0x1b26a2[_0x5e20('0xe')]||![];this[_0x5e20('0xf')]=_0x5e20('0x10');this[_0x5e20('0x11')]=0x0;this[_0x5e20('0x12')]=_0x1b26a2[_0x5e20('0x12')]||0x0;this['chatCurrentCapacity']=0x0;this[_0x5e20('0x13')]=_0x5e20('0x10');this[_0x5e20('0x14')]=0x0;this['mailCapacity']=_0x1b26a2[_0x5e20('0x15')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x5e20('0x16')]='unknown';this[_0x5e20('0x17')]=0x0;this[_0x5e20('0x18')]=_0x1b26a2[_0x5e20('0x18')]||0x0;this[_0x5e20('0x19')]=0x0;this[_0x5e20('0x1a')]='unknown';this[_0x5e20('0x1b')]=0x0;this[_0x5e20('0x1c')]=_0x1b26a2[_0x5e20('0x1c')]||0x0;this[_0x5e20('0x1d')]=0x0;this[_0x5e20('0x1e')]=_0x5e20('0x10');this[_0x5e20('0x1f')]=0x0;this[_0x5e20('0x20')]=_0x1b26a2['openchannelCapacity']||0x0;this[_0x5e20('0x21')]=0x0;this[_0x5e20('0x22')]=![];this['busyQueue']=undefined;this[_0x5e20('0x2')]='';this[_0x5e20('0x23')]();}Agent[_0x5e20('0x24')][_0x5e20('0x25')]=function(_0x4a45bd){if(this[_0x4a45bd+_0x5e20('0x26')]>0x0){if(this[_0x4a45bd+'Capacity']>0x0&&this[_0x4a45bd+'CurrentCapacity']>=this[_0x4a45bd+'Capacity']){return'maxcapacity';}else{return _0x5e20('0x27');}}else{return'idle';}};Agent[_0x5e20('0x24')][_0x5e20('0x23')]=function(){var _0x30d849=[_0x5e20('0x28'),_0x5e20('0x29'),_0x5e20('0x2a'),'fax',_0x5e20('0x2b')];for(var _0x5a755f=0x0;_0x5a755f<_0x30d849['length'];_0x5a755f+=0x1){var _0x33993a=this[_0x5e20('0x25')](_0x30d849[_0x5a755f]);if(this[_0x30d849[_0x5a755f]+_0x5e20('0x2c')]!==_0x33993a){this[_0x30d849[_0x5a755f]+_0x5e20('0x2d')]=_[_0x5e20('0x2e')](moment()[_0x5e20('0x2f')]('x'));}this[_0x30d849[_0x5a755f]+_0x5e20('0x2c')]=_0x33993a;}var _0x5809fd={'id':this['id'],'name':this[_0x5e20('0x8')],'online':this[_0x5e20('0x30')],'voicePause':this[_0x5e20('0x9')],'chatPause':this[_0x5e20('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x5e20('0xd')],'faxPause':this[_0x5e20('0xc')],'openchannelPause':this[_0x5e20('0xe')],'chatStatus':this[_0x5e20('0xf')],'chatStatusTime':this[_0x5e20('0x11')],'chatCapacity':this[_0x5e20('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x5e20('0x13')],'mailStatusTime':this[_0x5e20('0x14')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x5e20('0x31')],'faxStatus':this[_0x5e20('0x16')],'faxStatusTime':this[_0x5e20('0x17')],'faxCapacity':this[_0x5e20('0x18')],'faxCurrentCapacity':this[_0x5e20('0x19')],'smsStatus':this[_0x5e20('0x1a')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0x5e20('0x1c')],'smsCurrentCapacity':this[_0x5e20('0x1d')],'openchannelStatus':this[_0x5e20('0x1e')],'openchannelStatusTime':this[_0x5e20('0x1f')],'openchannelCapacity':this[_0x5e20('0x20')],'openchannelCurrentCapacity':this[_0x5e20('0x21')],'busy':this[_0x5e20('0x22')],'busyQueue':this[_0x5e20('0x32')]};var _0x14e3e4=md5(JSON[_0x5e20('0x33')](_0x5809fd));if(this[_0x5e20('0x2')]!==_0x14e3e4){this['md5']=_0x14e3e4;io[_0x5e20('0x34')](_0x5e20('0x35'),_0x5809fd);}};module[_0x5e20('0x36')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index a2ca0a0..ee5f2ac 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 _0xeebe=['waiting','updateRealtime','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','stringify','md5','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','redis','localhost','name','strategy','beepall','Agents'];(function(_0x49bbc2,_0x52eae0){var _0x5a83ae=function(_0x42c53b){while(--_0x42c53b){_0x49bbc2['push'](_0x49bbc2['shift']());}};_0x5a83ae(++_0x52eae0);}(_0xeebe,0x73));var _0xeeeb=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xeebe[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xeeeb('0x0'));var md5=require('md5');var util=require(_0xeeeb('0x1'));var Redis=require(_0xeeeb('0x2'));var config=require(_0xeeeb('0x3'));config[_0xeeeb('0x4')]=_['defaults'](config['redis'],{'host':_0xeeeb('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0xc2d0e8){this['id']=_0xc2d0e8['id']||0x0;this[_0xeeeb('0x6')]=_0xc2d0e8[_0xeeeb('0x6')]||'';this['timeout']=_0xc2d0e8['timeout']||0xa;this[_0xeeeb('0x7')]=_0xc2d0e8[_0xeeeb('0x7')]||_0xeeeb('0x8');this[_0xeeeb('0x9')]=_0xc2d0e8['Agents'];this['mapAgentsId']={};this[_0xeeeb('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0xeeeb('0xb')]();}ChatQueue['prototype'][_0xeeeb('0xc')]=function(){var _0x76392=this[_0xeeeb('0xd')][_0xeeeb('0xe')];this[_0xeeeb('0xd')]=_[_0xeeeb('0xf')](this[_0xeeeb('0x9')],'id');this[_0xeeeb('0xd')][_0xeeeb('0xe')]=_0x76392;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xeeeb('0x10')]=0x0;this[_0xeeeb('0x11')]=0x0;for(var _0x4f6809=0x0;_0x4f6809=0x0?this[_0xeeeb('0x14')]:0x0;var _0x7cc6e1={'id':this['id'],'available':this[_0xeeeb('0x14')],'loggedIn':this[_0xeeeb('0x10')],'name':this[_0xeeeb('0x6')],'paused':this['paused'],'waiting':this[_0xeeeb('0xa')]};var _0x10774c=md5(JSON[_0xeeeb('0x15')](_0x7cc6e1));if(this[_0xeeeb('0x16')]!==_0x10774c){this[_0xeeeb('0x16')]=_0x10774c;io['to'](util['format']('chat:queue:%s',_0x7cc6e1['name']))[_0xeeeb('0x17')](_0xeeeb('0x18'),_0x7cc6e1);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x80af=['md5','util','ioredis','../../../config/environment','defaults','redis','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','length','online','loggedIn','chatPause','available','format','chat:queue:%s','emit','exports'];(function(_0x5b3950,_0x4e5556){var _0x41e436=function(_0x139e30){while(--_0x139e30){_0x5b3950['push'](_0x5b3950['shift']());}};_0x41e436(++_0x4e5556);}(_0x80af,0x16c));var _0xf80a=function(_0xb3262c,_0x2ee818){_0xb3262c=_0xb3262c-0x0;var _0x422338=_0x80af[_0xb3262c];return _0x422338;};'use strict';var _=require('lodash');var md5=require(_0xf80a('0x0'));var util=require(_0xf80a('0x1'));var Redis=require(_0xf80a('0x2'));var config=require(_0xf80a('0x3'));config['redis']=_[_0xf80a('0x4')](config[_0xf80a('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xf80a('0x6'))(new Redis(config['redis']));function ChatQueue(_0x1ffafb){this['id']=_0x1ffafb['id']||0x0;this[_0xf80a('0x7')]=_0x1ffafb[_0xf80a('0x7')]||'';this[_0xf80a('0x8')]=_0x1ffafb[_0xf80a('0x8')]||0xa;this[_0xf80a('0x9')]=_0x1ffafb[_0xf80a('0x9')]||'beepall';this[_0xf80a('0xa')]=_0x1ffafb['Agents'];this['mapAgentsId']={};this[_0xf80a('0xb')]=0x0;this[_0xf80a('0x0')]='';this[_0xf80a('0xc')]();this[_0xf80a('0xd')]();}ChatQueue[_0xf80a('0xe')][_0xf80a('0xc')]=function(){var _0x2b4d2a=this[_0xf80a('0xf')]['_rr'];this[_0xf80a('0xf')]=_[_0xf80a('0x10')](this[_0xf80a('0xa')],'id');this['mapAgentsId'][_0xf80a('0x11')]=_0x2b4d2a;};ChatQueue[_0xf80a('0xe')][_0xf80a('0xd')]=function(){this['loggedIn']=0x0;this[_0xf80a('0x12')]=0x0;for(var _0x41f2df=0x0;_0x41f2df=0x0?this[_0xf80a('0x17')]:0x0;var _0x21772d={'id':this['id'],'available':this[_0xf80a('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xf80a('0x7')],'paused':this[_0xf80a('0x12')],'waiting':this[_0xf80a('0xb')]};var _0x2f0cd8=md5(JSON['stringify'](_0x21772d));if(this[_0xf80a('0x0')]!==_0x2f0cd8){this[_0xf80a('0x0')]=_0x2f0cd8;io['to'](util[_0xf80a('0x18')](_0xf80a('0x19'),_0x21772d['name']))[_0xf80a('0x1a')]('chat_queue:save',_0x21772d);}};module[_0xf80a('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index dca5ca6..c44f199 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 _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x4fd9ab,_0x35635b){var _0x3abdcb=function(_0x519aa9){while(--_0x519aa9){_0x4fd9ab['push'](_0x4fd9ab['shift']());}};_0x3abdcb(++_0x35635b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x2ea87f,_0x34a43b){var _0x3294a1=function(_0x51bdd8){while(--_0x51bdd8){_0x2ea87f['push'](_0x2ea87f['shift']());}};_0x3294a1(++_0x34a43b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 51d7c2b..bf49759 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 _0x9fed=['name','Intervals'];(function(_0x5cb14f,_0x162a24){var _0x40bbd6=function(_0x4f225c){while(--_0x4f225c){_0x5cb14f['push'](_0x5cb14f['shift']());}};_0x40bbd6(++_0x162a24);}(_0x9fed,0x1c2));var _0xd9fe=function(_0x595854,_0x4f7149){_0x595854=_0x595854-0x0;var _0x2920cf=_0x9fed[_0x595854];return _0x2920cf;};'use strict';function Interval(_0x134c3d){this['id']=_0x134c3d['id']||0x0;this[_0xd9fe('0x0')]=_0x134c3d[_0xd9fe('0x0')]||'';this['Intervals']=_0x134c3d[_0xd9fe('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x1b8c=['name','Intervals','exports'];(function(_0x58b04f,_0xd5ea5a){var _0x134b29=function(_0x49bfb3){while(--_0x49bfb3){_0x58b04f['push'](_0x58b04f['shift']());}};_0x134b29(++_0xd5ea5a);}(_0x1b8c,0x18c));var _0xc1b8=function(_0x238044,_0x1d9650){_0x238044=_0x238044-0x0;var _0x3c4fc1=_0x1b8c[_0x238044];return _0x3c4fc1;};'use strict';function Interval(_0x9cf763){this['id']=_0x9cf763['id']||0x0;this[_0xc1b8('0x0')]=_0x9cf763[_0xc1b8('0x0')]||'';this['Intervals']=_0x9cf763[_0xc1b8('0x1')]||{};}module[_0xc1b8('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 327cfe5..35b604e 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 _0xd1f4=['stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','mailPause','available','waiting'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xd1f4,0xa8));var _0x4d1f=function(_0x3db3c3,_0x56f20c){_0x3db3c3=_0x3db3c3-0x0;var _0x2d5c78=_0xd1f4[_0x3db3c3];return _0x2d5c78;};'use strict';var _=require('lodash');var md5=require(_0x4d1f('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x4d1f('0x1'));config[_0x4d1f('0x2')]=_['defaults'](config[_0x4d1f('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4d1f('0x2')]));function MailQueue(_0x171bd2){this['id']=_0x171bd2['id']||0x0;this['name']=_0x171bd2[_0x4d1f('0x3')]||'';this[_0x4d1f('0x4')]=_0x171bd2['timeout']||0xa;this[_0x4d1f('0x5')]=_0x171bd2[_0x4d1f('0x5')]||_0x4d1f('0x6');this[_0x4d1f('0x7')]=_0x171bd2[_0x4d1f('0x7')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x4d1f('0x8')]();this[_0x4d1f('0x9')]();}MailQueue[_0x4d1f('0xa')][_0x4d1f('0x8')]=function(){var _0x1f6804=this[_0x4d1f('0xb')][_0x4d1f('0xc')];this[_0x4d1f('0xb')]=_[_0x4d1f('0xd')](this[_0x4d1f('0x7')],'id');this[_0x4d1f('0xb')][_0x4d1f('0xc')]=_0x1f6804;};MailQueue[_0x4d1f('0xa')]['updateRealtime']=function(){this[_0x4d1f('0xe')]=0x0;this[_0x4d1f('0xf')]=0x0;for(var _0x2a9fd1=0x0;_0x2a9fd1=0x0?this[_0x4d1f('0x13')]:0x0;var _0x235879={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x4d1f('0x3')],'paused':this[_0x4d1f('0xf')],'waiting':this[_0x4d1f('0x14')]};var _0x2bbe63=md5(JSON[_0x4d1f('0x15')](_0x235879));if(this[_0x4d1f('0x0')]!==_0x2bbe63){this['md5']=_0x2bbe63;io['to'](util[_0x4d1f('0x16')](_0x4d1f('0x17'),_0x235879[_0x4d1f('0x3')]))[_0x4d1f('0x18')](_0x4d1f('0x19'),_0x235879);}};module[_0x4d1f('0x1a')]=MailQueue; \ No newline at end of file +var _0x9feb=['beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','online','mailPause','paused','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0xda3994,_0x319dcf){var _0x5bafeb=function(_0x5778b1){while(--_0x5778b1){_0xda3994['push'](_0xda3994['shift']());}};_0x5bafeb(++_0x319dcf);}(_0x9feb,0x6e));var _0xb9fe=function(_0x762c59,_0x5e21c9){_0x762c59=_0x762c59-0x0;var _0x27c6f3=_0x9feb[_0x762c59];return _0x27c6f3;};'use strict';var _=require(_0xb9fe('0x0'));var md5=require(_0xb9fe('0x1'));var util=require('util');var Redis=require(_0xb9fe('0x2'));var config=require(_0xb9fe('0x3'));config[_0xb9fe('0x4')]=_['defaults'](config[_0xb9fe('0x4')],{'host':_0xb9fe('0x5'),'port':0x18eb});var io=require(_0xb9fe('0x6'))(new Redis(config['redis']));function MailQueue(_0x3badea){this['id']=_0x3badea['id']||0x0;this[_0xb9fe('0x7')]=_0x3badea[_0xb9fe('0x7')]||'';this[_0xb9fe('0x8')]=_0x3badea[_0xb9fe('0x8')]||0xa;this[_0xb9fe('0x9')]=_0x3badea['strategy']||_0xb9fe('0xa');this[_0xb9fe('0xb')]=_0x3badea['Agents'];this[_0xb9fe('0xc')]={};this[_0xb9fe('0xd')]=0x0;this[_0xb9fe('0x1')]='';this[_0xb9fe('0xe')]();this[_0xb9fe('0xf')]();}MailQueue[_0xb9fe('0x10')][_0xb9fe('0xe')]=function(){var _0x25ae01=this[_0xb9fe('0xc')][_0xb9fe('0x11')];this[_0xb9fe('0xc')]=_[_0xb9fe('0x12')](this[_0xb9fe('0xb')],'id');this[_0xb9fe('0xc')][_0xb9fe('0x11')]=_0x25ae01;};MailQueue[_0xb9fe('0x10')][_0xb9fe('0xf')]=function(){this[_0xb9fe('0x13')]=0x0;this['paused']=0x0;for(var _0xe7cb33=0x0;_0xe7cb33=0x0?this[_0xb9fe('0x18')]:0x0;var _0x60a588={'id':this['id'],'available':this[_0xb9fe('0x18')],'loggedIn':this[_0xb9fe('0x13')],'name':this['name'],'paused':this[_0xb9fe('0x17')],'waiting':this[_0xb9fe('0xd')]};var _0x37e135=md5(JSON[_0xb9fe('0x19')](_0x60a588));if(this['md5']!==_0x37e135){this['md5']=_0x37e135;io['to'](util[_0xb9fe('0x1a')](_0xb9fe('0x1b'),_0x60a588[_0xb9fe('0x7')]))[_0xb9fe('0x1c')](_0xb9fe('0x1d'),_0x60a588);}};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 06332a8..69d0e70 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 _0x60a7=['available','format','openchannel:queue:%s','openchannel_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','Agents','prototype','loggedIn','length','paused'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0x60a7,0xc2));var _0x760a=function(_0x2640b5,_0x2859d7){_0x2640b5=_0x2640b5-0x0;var _0x5d9b25=_0x60a7[_0x2640b5];return _0x5d9b25;};'use strict';var _=require('lodash');var md5=require(_0x760a('0x0'));var util=require('util');var Redis=require(_0x760a('0x1'));var config=require(_0x760a('0x2'));config[_0x760a('0x3')]=_[_0x760a('0x4')](config[_0x760a('0x3')],{'host':_0x760a('0x5'),'port':0x18eb});var io=require(_0x760a('0x6'))(new Redis(config['redis']));function OpenchannelQueue(_0xccea2f){this['id']=_0xccea2f['id']||0x0;this[_0x760a('0x7')]=_0xccea2f[_0x760a('0x7')]||'';this[_0x760a('0x8')]=_0xccea2f[_0x760a('0x8')]||0xa;this[_0x760a('0x9')]=_0xccea2f[_0x760a('0x9')]||_0x760a('0xa');this['Agents']=_0xccea2f['Agents'];this[_0x760a('0xb')]={};this[_0x760a('0xc')]=0x0;this[_0x760a('0x0')]='';this[_0x760a('0xd')]();this[_0x760a('0xe')]();}OpenchannelQueue['prototype'][_0x760a('0xd')]=function(){var _0x44b39d=this[_0x760a('0xb')][_0x760a('0xf')];this['mapAgentsId']=_[_0x760a('0x10')](this[_0x760a('0x11')],'id');this['mapAgentsId'][_0x760a('0xf')]=_0x44b39d;};OpenchannelQueue[_0x760a('0x12')][_0x760a('0xe')]=function(){this[_0x760a('0x13')]=0x0;this['paused']=0x0;for(var _0x36ba5f=0x0;_0x36ba5f=0x0?this[_0x760a('0x16')]:0x0;var _0x33045f={'id':this['id'],'available':this[_0x760a('0x16')],'loggedIn':this[_0x760a('0x13')],'name':this[_0x760a('0x7')],'paused':this[_0x760a('0x15')],'waiting':this[_0x760a('0xc')]};var _0x4be5a6=md5(JSON['stringify'](_0x33045f));if(this[_0x760a('0x0')]!==_0x4be5a6){this[_0x760a('0x0')]=_0x4be5a6;io['to'](util[_0x760a('0x17')](_0x760a('0x18'),_0x33045f[_0x760a('0x7')]))['emit'](_0x760a('0x19'),_0x33045f);}};module[_0x760a('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0xcfdf=['md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','length','openchannelPause','available','format','openchannel:queue:%s','emit','openchannel_queue:save','exports'];(function(_0x5a474c,_0x3d8725){var _0x5b8361=function(_0x2993f6){while(--_0x2993f6){_0x5a474c['push'](_0x5a474c['shift']());}};_0x5b8361(++_0x3d8725);}(_0xcfdf,0x195));var _0xfcfd=function(_0x1e3a9f,_0x2ee349){_0x1e3a9f=_0x1e3a9f-0x0;var _0x441dec=_0xcfdf[_0x1e3a9f];return _0x441dec;};'use strict';var _=require('lodash');var md5=require(_0xfcfd('0x0'));var util=require('util');var Redis=require(_0xfcfd('0x1'));var config=require(_0xfcfd('0x2'));config[_0xfcfd('0x3')]=_['defaults'](config[_0xfcfd('0x3')],{'host':_0xfcfd('0x4'),'port':0x18eb});var io=require(_0xfcfd('0x5'))(new Redis(config[_0xfcfd('0x3')]));function OpenchannelQueue(_0x3d47be){this['id']=_0x3d47be['id']||0x0;this[_0xfcfd('0x6')]=_0x3d47be['name']||'';this[_0xfcfd('0x7')]=_0x3d47be['timeout']||0xa;this[_0xfcfd('0x8')]=_0x3d47be['strategy']||'beepall';this['Agents']=_0x3d47be[_0xfcfd('0x9')];this[_0xfcfd('0xa')]={};this[_0xfcfd('0xb')]=0x0;this[_0xfcfd('0x0')]='';this['updateRouting']();this[_0xfcfd('0xc')]();}OpenchannelQueue[_0xfcfd('0xd')][_0xfcfd('0xe')]=function(){var _0x53f10b=this[_0xfcfd('0xa')][_0xfcfd('0xf')];this['mapAgentsId']=_[_0xfcfd('0x10')](this[_0xfcfd('0x9')],'id');this[_0xfcfd('0xa')][_0xfcfd('0xf')]=_0x53f10b;};OpenchannelQueue[_0xfcfd('0xd')][_0xfcfd('0xc')]=function(){this[_0xfcfd('0x11')]=0x0;this[_0xfcfd('0x12')]=0x0;for(var _0x4bd439=0x0;_0x4bd439=0x0?this[_0xfcfd('0x15')]:0x0;var _0x33b40f={'id':this['id'],'available':this[_0xfcfd('0x15')],'loggedIn':this['loggedIn'],'name':this[_0xfcfd('0x6')],'paused':this['paused'],'waiting':this[_0xfcfd('0xb')]};var _0x2129da=md5(JSON['stringify'](_0x33b40f));if(this['md5']!==_0x2129da){this[_0xfcfd('0x0')]=_0x2129da;io['to'](util[_0xfcfd('0x16')](_0xfcfd('0x17'),_0x33b40f['name']))[_0xfcfd('0x18')](_0xfcfd('0x19'),_0x33b40f);}};module[_0xfcfd('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index b891a04..bac2956 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 _0xb10b=['length','online','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','updateRealtime','paused'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0xb10b,0x12a));var _0xbb10=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0xb10b[_0x5adb18];return _0x420c98;};'use strict';var _=require(_0xbb10('0x0'));var md5=require('md5');var util=require(_0xbb10('0x1'));var Redis=require(_0xbb10('0x2'));var config=require(_0xbb10('0x3'));config['redis']=_[_0xbb10('0x4')](config[_0xbb10('0x5')],{'host':_0xbb10('0x6'),'port':0x18eb});var io=require(_0xbb10('0x7'))(new Redis(config[_0xbb10('0x5')]));function SmsQueue(_0x312b72){this['id']=_0x312b72['id']||0x0;this['name']=_0x312b72[_0xbb10('0x8')]||'';this[_0xbb10('0x9')]=_0x312b72['timeout']||0xa;this[_0xbb10('0xa')]=_0x312b72[_0xbb10('0xa')]||_0xbb10('0xb');this[_0xbb10('0xc')]=_0x312b72[_0xbb10('0xc')];this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]=0x0;this[_0xbb10('0xf')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xbb10('0x10')][_0xbb10('0x11')]=function(){var _0xce64f3=this['mapAgentsId'][_0xbb10('0x12')];this['mapAgentsId']=_[_0xbb10('0x13')](this[_0xbb10('0xc')],'id');this[_0xbb10('0xd')][_0xbb10('0x12')]=_0xce64f3;};SmsQueue[_0xbb10('0x10')][_0xbb10('0x14')]=function(){this['loggedIn']=0x0;this[_0xbb10('0x15')]=0x0;for(var _0x42d7e4=0x0;_0x42d7e4=0x0?this[_0xbb10('0x1a')]:0x0;var _0x1682a4={'id':this['id'],'available':this[_0xbb10('0x1a')],'loggedIn':this[_0xbb10('0x18')],'name':this[_0xbb10('0x8')],'paused':this[_0xbb10('0x15')],'waiting':this['waiting']};var _0x5ff0cf=md5(JSON[_0xbb10('0x1b')](_0x1682a4));if(this[_0xbb10('0xf')]!==_0x5ff0cf){this[_0xbb10('0xf')]=_0x5ff0cf;io['to'](util[_0xbb10('0x1c')](_0xbb10('0x1d'),_0x1682a4['name']))[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x1682a4);}};module['exports']=SmsQueue; \ No newline at end of file +var _0xbaf0=['online','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length'];(function(_0x57fa33,_0x2b8222){var _0x12e724=function(_0x481a33){while(--_0x481a33){_0x57fa33['push'](_0x57fa33['shift']());}};_0x12e724(++_0x2b8222);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var md5=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var Redis=require(_0x0baf('0x2'));var config=require(_0x0baf('0x3'));config[_0x0baf('0x4')]=_[_0x0baf('0x5')](config['redis'],{'host':_0x0baf('0x6'),'port':0x18eb});var io=require(_0x0baf('0x7'))(new Redis(config[_0x0baf('0x4')]));function SmsQueue(_0x39b8f3){this['id']=_0x39b8f3['id']||0x0;this[_0x0baf('0x8')]=_0x39b8f3[_0x0baf('0x8')]||'';this[_0x0baf('0x9')]=_0x39b8f3[_0x0baf('0x9')]||0xa;this[_0x0baf('0xa')]=_0x39b8f3['strategy']||_0x0baf('0xb');this['Agents']=_0x39b8f3[_0x0baf('0xc')];this[_0x0baf('0xd')]={};this[_0x0baf('0xe')]=0x0;this[_0x0baf('0x0')]='';this[_0x0baf('0xf')]();this[_0x0baf('0x10')]();}SmsQueue[_0x0baf('0x11')][_0x0baf('0xf')]=function(){var _0x1fc6b2=this[_0x0baf('0xd')][_0x0baf('0x12')];this['mapAgentsId']=_['map'](this[_0x0baf('0xc')],'id');this[_0x0baf('0xd')][_0x0baf('0x12')]=_0x1fc6b2;};SmsQueue[_0x0baf('0x11')]['updateRealtime']=function(){this[_0x0baf('0x13')]=0x0;this['paused']=0x0;for(var _0x1c76a8=0x0;_0x1c76a8=0x0?this['available']:0x0;var _0x63c820={'id':this['id'],'available':this[_0x0baf('0x17')],'loggedIn':this[_0x0baf('0x13')],'name':this[_0x0baf('0x8')],'paused':this[_0x0baf('0x16')],'waiting':this[_0x0baf('0xe')]};var _0x4ff793=md5(JSON['stringify'](_0x63c820));if(this[_0x0baf('0x0')]!==_0x4ff793){this[_0x0baf('0x0')]=_0x4ff793;io['to'](util[_0x0baf('0x18')](_0x0baf('0x19'),_0x63c820[_0x0baf('0x8')]))[_0x0baf('0x1a')](_0x0baf('0x1b'),_0x63c820);}};module[_0x0baf('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 562a9ac..83db9df 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 _0xca43=['smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','agents','length','isUndefined','initIntervals','intervals','initOpenchannelQueues','openchannelQueues','updateRealtime','initChatQueues','initMailQueues','mailQueues','updateRouting','initFaxQueues','exports','bluebird','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','chatQueues'];(function(_0x34048c,_0x140b06){var _0x5e42c5=function(_0x2bb643){while(--_0x2bb643){_0x34048c['push'](_0x34048c['shift']());}};_0x5e42c5(++_0x140b06);}(_0xca43,0x1e5));var _0x3ca4=function(_0x250985,_0x2448f8){_0x250985=_0x250985-0x0;var _0x5863d4=_0xca43[_0x250985];return _0x5863d4;};'use strict';var BPromise=require(_0x3ca4('0x0'));var util=require('util');var _=require(_0x3ca4('0x1'));var moment=require(_0x3ca4('0x2'));var Agent=require(_0x3ca4('0x3'));var Interval=require(_0x3ca4('0x4'));var OpenchannelQueue=require(_0x3ca4('0x5'));var ChatQueue=require(_0x3ca4('0x6'));var SmsQueue=require(_0x3ca4('0x7'));var MailQueue=require(_0x3ca4('0x8'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this['agents']={};this['intervals']={};this['openchannelQueues']={};this[_0x3ca4('0x9')]={};this[_0x3ca4('0xa')]={};this['mailQueues']={};this[_0x3ca4('0xb')]={};this[_0x3ca4('0xc')]={};this[_0x3ca4('0xd')]={};this[_0x3ca4('0xe')]={};this['smsQueuesWaitingInteractions']={};this[_0x3ca4('0xf')]={};};function freeIsNotKey(_0x73318d,_0x39e18d,_0x4ae9a7){var _0x4a0e73=_[_0x3ca4('0x10')](_0x73318d,function(_0x393d4d,_0x385901){return _0x393d4d[_0x4ae9a7];});for(var _0x460798 in _0x39e18d){if(_0x39e18d['hasOwnProperty'](_0x460798)){if(!_0x4a0e73[_0x460798]){delete _0x39e18d[_0x460798];}}}}Realtime[_0x3ca4('0x11')][_0x3ca4('0x12')]=function(_0x5de77e,_0x3cd835){for(var _0x3f09aa in _0x3cd835){if(_0x5de77e['hasOwnProperty'](_0x3f09aa)){_0x5de77e[_0x3f09aa]=_0x3cd835[_0x3f09aa];}}};Realtime['prototype']['initAgents']=function(){var _0x50db79=this;return function(_0x3b01da){if(_0x3b01da){freeIsNotKey(_0x3b01da,_0x50db79[_0x3ca4('0x13')],'id');for(var _0x4425e9=0x0,_0x110241={},_0x38fe32={};_0x4425e9<_0x3b01da[_0x3ca4('0x14')];_0x4425e9+=0x1){_0x110241=_0x3b01da[_0x4425e9];if(_[_0x3ca4('0x15')](_0x50db79['agents'][_0x110241['id']])){_0x50db79[_0x3ca4('0x13')][_0x110241['id']]=new Agent(_0x110241);}else{_0x50db79['mergeFromDatabase'](_0x50db79['agents'][_0x110241['id']],_0x110241);}}}return _0x50db79[_0x3ca4('0x13')];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x16')]=function(){var _0x1dc2b1=this;return function(_0x3cbe67){if(_0x3cbe67){freeIsNotKey(_0x3cbe67,_0x1dc2b1[_0x3ca4('0x17')],'id');for(var _0xa9b686=0x0,_0x3a20f3={},_0x4731a5={};_0xa9b686<_0x3cbe67[_0x3ca4('0x14')];_0xa9b686+=0x1){_0x3a20f3=_0x3cbe67[_0xa9b686];if(_[_0x3ca4('0x15')](_0x1dc2b1[_0x3ca4('0x17')][_0x3a20f3['id']])){_0x1dc2b1['intervals'][_0x3a20f3['id']]=new Interval(_0x3a20f3);}else{_0x1dc2b1['mergeFromDatabase'](_0x1dc2b1[_0x3ca4('0x17')][_0x3a20f3['id']],_0x3a20f3);}}}return _0x1dc2b1[_0x3ca4('0x17')];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x18')]=function(){var _0x5841ba=this;return function(_0x16e307){if(_0x16e307){freeIsNotKey(_0x16e307,_0x5841ba[_0x3ca4('0x19')],'id');for(var _0x3cc4e9=0x0,_0x4eefaf={},_0x17da57={};_0x3cc4e9<_0x16e307['length'];_0x3cc4e9+=0x1){_0x4eefaf=_0x16e307[_0x3cc4e9];if(_['isUndefined'](_0x5841ba[_0x3ca4('0x19')][_0x4eefaf['id']])){_0x5841ba['openchannelQueues'][_0x4eefaf['id']]=new OpenchannelQueue(_0x4eefaf);}else{_0x5841ba[_0x3ca4('0x12')](_0x5841ba[_0x3ca4('0x19')][_0x4eefaf['id']],_0x4eefaf);}_0x5841ba[_0x3ca4('0x19')][_0x4eefaf['id']]['updateRouting']();_0x5841ba['openchannelQueues'][_0x4eefaf['id']][_0x3ca4('0x1a')]();}}return _0x5841ba[_0x3ca4('0x19')];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x1b')]=function(){var _0x2ce3e5=this;return function(_0x351959){if(_0x351959){freeIsNotKey(_0x351959,_0x2ce3e5['chatQueues'],'id');for(var _0x126da8=0x0,_0x52584d={},_0x12b9e6={};_0x126da8<_0x351959[_0x3ca4('0x14')];_0x126da8+=0x1){_0x52584d=_0x351959[_0x126da8];if(_[_0x3ca4('0x15')](_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']])){_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']]=new ChatQueue(_0x52584d);}else{_0x2ce3e5[_0x3ca4('0x12')](_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']],_0x52584d);}_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']]['updateRouting']();_0x2ce3e5['chatQueues'][_0x52584d['id']]['updateRealtime']();}}return _0x2ce3e5[_0x3ca4('0x9')];};};Realtime[_0x3ca4('0x11')]['initSmsQueues']=function(){var _0x221dc1=this;return function(_0x49c610){if(_0x49c610){freeIsNotKey(_0x49c610,_0x221dc1[_0x3ca4('0xa')],'id');for(var _0x10671d=0x0,_0x32632a={},_0x1787d8={};_0x10671d<_0x49c610[_0x3ca4('0x14')];_0x10671d+=0x1){_0x32632a=_0x49c610[_0x10671d];if(_[_0x3ca4('0x15')](_0x221dc1['smsQueues'][_0x32632a['id']])){_0x221dc1[_0x3ca4('0xa')][_0x32632a['id']]=new SmsQueue(_0x32632a);}else{_0x221dc1[_0x3ca4('0x12')](_0x221dc1['smsQueues'][_0x32632a['id']],_0x32632a);}_0x221dc1['smsQueues'][_0x32632a['id']]['updateRouting']();_0x221dc1['smsQueues'][_0x32632a['id']][_0x3ca4('0x1a')]();}}return _0x221dc1['smsQueues'];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x1c')]=function(){var _0x18a24f=this;return function(_0x32ccfe){if(_0x32ccfe){freeIsNotKey(_0x32ccfe,_0x18a24f[_0x3ca4('0x1d')],'id');for(var _0x27544b=0x0,_0x3c9ba6={},_0x3bf352={};_0x27544b<_0x32ccfe['length'];_0x27544b+=0x1){_0x3c9ba6=_0x32ccfe[_0x27544b];if(_[_0x3ca4('0x15')](_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']])){_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']]=new MailQueue(_0x3c9ba6);}else{_0x18a24f[_0x3ca4('0x12')](_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']],_0x3c9ba6);}_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']][_0x3ca4('0x1e')]();_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']][_0x3ca4('0x1a')]();}}return _0x18a24f[_0x3ca4('0x1d')];};};Realtime['prototype'][_0x3ca4('0x1f')]=function(){var _0x3c9e32=this;return function(_0x14e538){if(_0x14e538){freeIsNotKey(_0x14e538,_0x3c9e32['faxQueues'],'id');for(var _0x1e16d4=0x0,_0x59ac40={},_0x1c878e={};_0x1e16d4<_0x14e538[_0x3ca4('0x14')];_0x1e16d4+=0x1){_0x59ac40=_0x14e538[_0x1e16d4];if(_[_0x3ca4('0x15')](_0x3c9e32['faxQueues'][_0x59ac40['id']])){_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']]=new FaxQueue(_0x59ac40);}else{_0x3c9e32[_0x3ca4('0x12')](_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']],_0x59ac40);}_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']][_0x3ca4('0x1e')]();_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']]['updateRealtime']();}}return _0x3c9e32[_0x3ca4('0xb')];};};module[_0x3ca4('0x20')]=Realtime; \ No newline at end of file +var _0xb304=['initMailQueues','mailQueues','initFaxQueues','faxQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','chatQueues','smsQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','hasOwnProperty','initAgents','length','isUndefined','openchannelQueues','initChatQueues','updateRouting','updateRealtime','initSmsQueues'];(function(_0x4f3244,_0x36b2f5){var _0x4708a8=function(_0x39ae21){while(--_0x39ae21){_0x4f3244['push'](_0x4f3244['shift']());}};_0x4708a8(++_0x36b2f5);}(_0xb304,0x140));var _0x4b30=function(_0x598c21,_0x319828){_0x598c21=_0x598c21-0x0;var _0x28d456=_0xb304[_0x598c21];return _0x28d456;};'use strict';var BPromise=require(_0x4b30('0x0'));var util=require(_0x4b30('0x1'));var _=require(_0x4b30('0x2'));var moment=require(_0x4b30('0x3'));var Agent=require(_0x4b30('0x4'));var Interval=require(_0x4b30('0x5'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x4b30('0x6'));var SmsQueue=require(_0x4b30('0x7'));var MailQueue=require(_0x4b30('0x8'));var FaxQueue=require(_0x4b30('0x9'));var Realtime=function(){this[_0x4b30('0xa')]={};this[_0x4b30('0xb')]={};this['openchannelQueues']={};this[_0x4b30('0xc')]={};this[_0x4b30('0xd')]={};this['mailQueues']={};this['faxQueues']={};this[_0x4b30('0xe')]={};this[_0x4b30('0xf')]={};this[_0x4b30('0x10')]={};this['smsQueuesWaitingInteractions']={};this[_0x4b30('0x11')]={};};function freeIsNotKey(_0x264034,_0x5a729,_0x3da8f3){var _0x50a95f=_[_0x4b30('0x12')](_0x264034,function(_0x3d07e9,_0x4ff66e){return _0x3d07e9[_0x3da8f3];});for(var _0xe99eb9 in _0x5a729){if(_0x5a729['hasOwnProperty'](_0xe99eb9)){if(!_0x50a95f[_0xe99eb9]){delete _0x5a729[_0xe99eb9];}}}}Realtime[_0x4b30('0x13')][_0x4b30('0x14')]=function(_0x35f4fb,_0x2da971){for(var _0x51cf3c in _0x2da971){if(_0x35f4fb[_0x4b30('0x15')](_0x51cf3c)){_0x35f4fb[_0x51cf3c]=_0x2da971[_0x51cf3c];}}};Realtime[_0x4b30('0x13')][_0x4b30('0x16')]=function(){var _0x199551=this;return function(_0xf9ae32){if(_0xf9ae32){freeIsNotKey(_0xf9ae32,_0x199551[_0x4b30('0xa')],'id');for(var _0x4b571=0x0,_0x530cf4={},_0x12a002={};_0x4b571<_0xf9ae32[_0x4b30('0x17')];_0x4b571+=0x1){_0x530cf4=_0xf9ae32[_0x4b571];if(_[_0x4b30('0x18')](_0x199551['agents'][_0x530cf4['id']])){_0x199551['agents'][_0x530cf4['id']]=new Agent(_0x530cf4);}else{_0x199551['mergeFromDatabase'](_0x199551[_0x4b30('0xa')][_0x530cf4['id']],_0x530cf4);}}}return _0x199551['agents'];};};Realtime[_0x4b30('0x13')]['initIntervals']=function(){var _0x4eb0e0=this;return function(_0x31129d){if(_0x31129d){freeIsNotKey(_0x31129d,_0x4eb0e0['intervals'],'id');for(var _0x48c40c=0x0,_0x55eb09={},_0x54acbc={};_0x48c40c<_0x31129d[_0x4b30('0x17')];_0x48c40c+=0x1){_0x55eb09=_0x31129d[_0x48c40c];if(_[_0x4b30('0x18')](_0x4eb0e0[_0x4b30('0xb')][_0x55eb09['id']])){_0x4eb0e0[_0x4b30('0xb')][_0x55eb09['id']]=new Interval(_0x55eb09);}else{_0x4eb0e0['mergeFromDatabase'](_0x4eb0e0['intervals'][_0x55eb09['id']],_0x55eb09);}}}return _0x4eb0e0[_0x4b30('0xb')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x19d673=this;return function(_0x4de283){if(_0x4de283){freeIsNotKey(_0x4de283,_0x19d673[_0x4b30('0x19')],'id');for(var _0x449e84=0x0,_0x1065af={},_0x18ae41={};_0x449e84<_0x4de283[_0x4b30('0x17')];_0x449e84+=0x1){_0x1065af=_0x4de283[_0x449e84];if(_[_0x4b30('0x18')](_0x19d673[_0x4b30('0x19')][_0x1065af['id']])){_0x19d673[_0x4b30('0x19')][_0x1065af['id']]=new OpenchannelQueue(_0x1065af);}else{_0x19d673[_0x4b30('0x14')](_0x19d673[_0x4b30('0x19')][_0x1065af['id']],_0x1065af);}_0x19d673['openchannelQueues'][_0x1065af['id']]['updateRouting']();_0x19d673[_0x4b30('0x19')][_0x1065af['id']]['updateRealtime']();}}return _0x19d673[_0x4b30('0x19')];};};Realtime[_0x4b30('0x13')][_0x4b30('0x1a')]=function(){var _0x376e59=this;return function(_0x12cdeb){if(_0x12cdeb){freeIsNotKey(_0x12cdeb,_0x376e59[_0x4b30('0xc')],'id');for(var _0x38a280=0x0,_0x16fcb0={},_0x5cafd4={};_0x38a280<_0x12cdeb[_0x4b30('0x17')];_0x38a280+=0x1){_0x16fcb0=_0x12cdeb[_0x38a280];if(_[_0x4b30('0x18')](_0x376e59[_0x4b30('0xc')][_0x16fcb0['id']])){_0x376e59[_0x4b30('0xc')][_0x16fcb0['id']]=new ChatQueue(_0x16fcb0);}else{_0x376e59[_0x4b30('0x14')](_0x376e59[_0x4b30('0xc')][_0x16fcb0['id']],_0x16fcb0);}_0x376e59['chatQueues'][_0x16fcb0['id']][_0x4b30('0x1b')]();_0x376e59[_0x4b30('0xc')][_0x16fcb0['id']][_0x4b30('0x1c')]();}}return _0x376e59[_0x4b30('0xc')];};};Realtime[_0x4b30('0x13')][_0x4b30('0x1d')]=function(){var _0x47eb56=this;return function(_0x2de32a){if(_0x2de32a){freeIsNotKey(_0x2de32a,_0x47eb56[_0x4b30('0xd')],'id');for(var _0xe0500d=0x0,_0x23b2c8={},_0x50c78d={};_0xe0500d<_0x2de32a[_0x4b30('0x17')];_0xe0500d+=0x1){_0x23b2c8=_0x2de32a[_0xe0500d];if(_['isUndefined'](_0x47eb56[_0x4b30('0xd')][_0x23b2c8['id']])){_0x47eb56[_0x4b30('0xd')][_0x23b2c8['id']]=new SmsQueue(_0x23b2c8);}else{_0x47eb56[_0x4b30('0x14')](_0x47eb56['smsQueues'][_0x23b2c8['id']],_0x23b2c8);}_0x47eb56['smsQueues'][_0x23b2c8['id']][_0x4b30('0x1b')]();_0x47eb56[_0x4b30('0xd')][_0x23b2c8['id']]['updateRealtime']();}}return _0x47eb56['smsQueues'];};};Realtime['prototype'][_0x4b30('0x1e')]=function(){var _0x2324f5=this;return function(_0x473b08){if(_0x473b08){freeIsNotKey(_0x473b08,_0x2324f5[_0x4b30('0x1f')],'id');for(var _0xcb0c7e=0x0,_0x557e6f={},_0x1e1112={};_0xcb0c7e<_0x473b08[_0x4b30('0x17')];_0xcb0c7e+=0x1){_0x557e6f=_0x473b08[_0xcb0c7e];if(_['isUndefined'](_0x2324f5[_0x4b30('0x1f')][_0x557e6f['id']])){_0x2324f5[_0x4b30('0x1f')][_0x557e6f['id']]=new MailQueue(_0x557e6f);}else{_0x2324f5['mergeFromDatabase'](_0x2324f5[_0x4b30('0x1f')][_0x557e6f['id']],_0x557e6f);}_0x2324f5[_0x4b30('0x1f')][_0x557e6f['id']][_0x4b30('0x1b')]();_0x2324f5['mailQueues'][_0x557e6f['id']][_0x4b30('0x1c')]();}}return _0x2324f5['mailQueues'];};};Realtime[_0x4b30('0x13')][_0x4b30('0x20')]=function(){var _0x2ba270=this;return function(_0x2b85f5){if(_0x2b85f5){freeIsNotKey(_0x2b85f5,_0x2ba270[_0x4b30('0x21')],'id');for(var _0x2534dd=0x0,_0x90ece1={},_0x50e3cc={};_0x2534dd<_0x2b85f5[_0x4b30('0x17')];_0x2534dd+=0x1){_0x90ece1=_0x2b85f5[_0x2534dd];if(_[_0x4b30('0x18')](_0x2ba270[_0x4b30('0x21')][_0x90ece1['id']])){_0x2ba270[_0x4b30('0x21')][_0x90ece1['id']]=new FaxQueue(_0x90ece1);}else{_0x2ba270[_0x4b30('0x14')](_0x2ba270[_0x4b30('0x21')][_0x90ece1['id']],_0x90ece1);}_0x2ba270[_0x4b30('0x21')][_0x90ece1['id']][_0x4b30('0x1b')]();_0x2ba270[_0x4b30('0x21')][_0x90ece1['id']]['updateRealtime']();}}return _0x2ba270[_0x4b30('0x21')];};};module[_0x4b30('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 9b249f7..1f417dc 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 _0x6737=['addTags','addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x43aff3,_0x4e2f94){var _0x44eb09=function(_0xe0689f){while(--_0xe0689f){_0x43aff3['push'](_0x43aff3['shift']());}};_0x44eb09(++_0x4e2f94);}(_0x6737,0x146));var _0x7673=function(_0x16093e,_0x599c3f){_0x16093e=_0x16093e-0x0;var _0x270264=_0x6737[_0x16093e];return _0x270264;};'use strict';var client=require('../client');exports[_0x7673('0x0')]=function(_0x4fa8f9,_0x3c57cc){return client[_0x7673('0x1')](_0x7673('0x2'),{'body':_0x3c57cc,'options':{'where':{'id':_0x4fa8f9}},'log':_0x7673('0x3')});};exports[_0x7673('0x4')]=function(_0x292680,_0x5b2180){return client[_0x7673('0x1')]('AddTagsToChatInteraction',{'body':_0x5b2180,'options':{'where':{'id':_0x292680}},'log':_0x7673('0x5')});}; \ No newline at end of file +var _0xea6f=['addTags','../client','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x114bda,_0x4f8677){var _0x5c7c9f=function(_0x4671e8){while(--_0x4671e8){_0x114bda['push'](_0x114bda['shift']());}};_0x5c7c9f(++_0x4f8677);}(_0xea6f,0x100));var _0xfea6=function(_0x14b99d,_0x339679){_0x14b99d=_0x14b99d-0x0;var _0x478b81=_0xea6f[_0x14b99d];return _0x478b81;};'use strict';var client=require(_0xfea6('0x0'));exports['update']=function(_0x5a40ca,_0x400214){return client[_0xfea6('0x1')](_0xfea6('0x2'),{'body':_0x400214,'options':{'where':{'id':_0x5a40ca}},'log':_0xfea6('0x3')});};exports[_0xfea6('0x4')]=function(_0x3fc360,_0x4382ec){return client['Request']('AddTagsToChatInteraction',{'body':_0x4382ec,'options':{'where':{'id':_0x3fc360}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c39d968..9003272 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 _0x1153=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x3c560c,_0x129401){var _0x41e8c8=function(_0x1c3009){while(--_0x1c3009){_0x3c560c['push'](_0x3c560c['shift']());}};_0x41e8c8(++_0x129401);}(_0x1153,0x91));var _0x3115=function(_0x470d87,_0x734c02){_0x470d87=_0x470d87-0x0;var _0x2eb1de=_0x1153[_0x470d87];return _0x2eb1de;};'use strict';var client=require(_0x3115('0x0'));exports[_0x3115('0x1')]=function(_0x429d57){return client[_0x3115('0x2')](_0x3115('0x3'),{'body':_0x429d57,'log':_0x3115('0x4')});}; \ No newline at end of file +var _0x4fdb=['createChatMessage','../client','Request','CreateChatMessage'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x4fdb,0x1c5));var _0xb4fd=function(_0x567647,_0x15415c){_0x567647=_0x567647-0x0;var _0x5a26f7=_0x4fdb[_0x567647];return _0x5a26f7;};'use strict';var client=require(_0xb4fd('0x0'));exports['create']=function(_0x5c5de6){return client[_0xb4fd('0x1')](_0xb4fd('0x2'),{'body':_0x5c5de6,'log':_0xb4fd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 9741b0d..396f2e0 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 _0x25b4=['Agents','online','getChatQueues','Request','GetChatQueue','name','strategy','User'];(function(_0x2755fb,_0x5970f1){var _0x293f12=function(_0x4c629d){while(--_0x4c629d){_0x2755fb['push'](_0x2755fb['shift']());}};_0x293f12(++_0x5970f1);}(_0x25b4,0xf2));var _0x425b=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x25b4[_0x4e0026];return _0x3f8ee7;};'use strict';var client=require('../client');exports[_0x425b('0x0')]=function(){return function(){return client[_0x425b('0x1')](_0x425b('0x2'),{'options':{'raw':![],'attributes':['id',_0x425b('0x3'),'timeout',_0x425b('0x4')],'include':[{'model':_0x425b('0x5'),'as':_0x425b('0x6'),'attributes':['id',_0x425b('0x3'),_0x425b('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x44af=['Agents','online','chatPause','../client','getChatQueues','GetChatQueue','name','timeout','strategy'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x44af,0x1d7));var _0xf44a=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0x44af[_0x34bc30];return _0x5706de;};'use strict';var client=require(_0xf44a('0x0'));exports[_0xf44a('0x1')]=function(){return function(){return client['Request'](_0xf44a('0x2'),{'options':{'raw':![],'attributes':['id',_0xf44a('0x3'),_0xf44a('0x4'),_0xf44a('0x5')],'include':[{'model':'User','as':_0xf44a('0x6'),'attributes':['id',_0xf44a('0x3'),_0xf44a('0x7'),_0xf44a('0x8')]}]},'log':_0xf44a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 4deb3df..21f5dff 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 _0xda65=['UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport','update','Request'];(function(_0x527605,_0xb10d69){var _0x209ba0=function(_0x586faf){while(--_0x586faf){_0x527605['push'](_0x527605['shift']());}};_0x209ba0(++_0xb10d69);}(_0xda65,0x1d0));var _0x5da6=function(_0x57fd4d,_0x461848){_0x57fd4d=_0x57fd4d-0x0;var _0x4a8230=_0xda65[_0x57fd4d];return _0x4a8230;};'use strict';var client=require(_0x5da6('0x0'));exports[_0x5da6('0x1')]=function(_0x3fdbd8){return client['Request'](_0x5da6('0x2'),{'body':_0x3fdbd8,'log':_0x5da6('0x2')});};exports[_0x5da6('0x3')]=function(_0x487700,_0x5c80b4){return client[_0x5da6('0x4')](_0x5da6('0x5'),{'body':_0x5c80b4,'options':{'where':{'uniqueid':_0x487700},'order':[['id',_0x5da6('0x6')]],'limit':0x1},'log':_0x5da6('0x5')});}; \ No newline at end of file +var _0xa631=['create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x59585e,_0x52a71b){var _0x471d81=function(_0x2f224e){while(--_0x2f224e){_0x59585e['push'](_0x59585e['shift']());}};_0x471d81(++_0x52a71b);}(_0xa631,0xe4));var _0x1a63=function(_0x19a694,_0x2d78b1){_0x19a694=_0x19a694-0x0;var _0x1f3a91=_0xa631[_0x19a694];return _0x1f3a91;};'use strict';var client=require('../client');exports[_0x1a63('0x0')]=function(_0x1e771b){return client[_0x1a63('0x1')]('CreateChatQueueReport',{'body':_0x1e771b,'log':_0x1a63('0x2')});};exports['update']=function(_0x536c8d,_0x2d36b7){return client[_0x1a63('0x1')](_0x1a63('0x3'),{'body':_0x2d36b7,'options':{'where':{'uniqueid':_0x536c8d},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index cdfe4ea..5b176b6 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 _0x41f8=['UpdateFaxInteraction','updateFaxInteraction','addTags','Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client'];(function(_0x378b26,_0x485f86){var _0x2c989a=function(_0x56feef){while(--_0x56feef){_0x378b26['push'](_0x378b26['shift']());}};_0x2c989a(++_0x485f86);}(_0x41f8,0x125));var _0x841f=function(_0x443a78,_0xac6241){_0x443a78=_0x443a78-0x0;var _0x20d67d=_0x41f8[_0x443a78];return _0x20d67d;};'use strict';var client=require(_0x841f('0x0'));exports['update']=function(_0x49f989,_0x4c2f88){return client['Request'](_0x841f('0x1'),{'body':_0x4c2f88,'options':{'where':{'id':_0x49f989}},'log':_0x841f('0x2')});};exports[_0x841f('0x3')]=function(_0xc10757,_0x27dddb){return client[_0x841f('0x4')](_0x841f('0x5'),{'body':_0x27dddb,'options':{'where':{'id':_0xc10757}},'log':_0x841f('0x6')});}; \ No newline at end of file +var _0x702f=['../client','update','Request','UpdateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction'];(function(_0x140853,_0x2910ba){var _0x3908da=function(_0x461495){while(--_0x461495){_0x140853['push'](_0x140853['shift']());}};_0x3908da(++_0x2910ba);}(_0x702f,0x114));var _0xf702=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x702f[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xf702('0x0'));exports[_0xf702('0x1')]=function(_0x1a5205,_0x565ead){return client[_0xf702('0x2')](_0xf702('0x3'),{'body':_0x565ead,'options':{'where':{'id':_0x1a5205}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x554566,_0x2e269f){return client['Request'](_0xf702('0x4'),{'body':_0x2e269f,'options':{'where':{'id':_0x554566}},'log':_0xf702('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 29d9550..09bd22f 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 _0x5e43=['../client','create','Request','createFaxMessage'];(function(_0x43d957,_0x435fc2){var _0x351a18=function(_0x1b9a93){while(--_0x1b9a93){_0x43d957['push'](_0x43d957['shift']());}};_0x351a18(++_0x435fc2);}(_0x5e43,0x19c));var _0x35e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e43[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x35e4('0x0'));exports[_0x35e4('0x1')]=function(_0x445841){return client[_0x35e4('0x2')]('CreateFaxMessage',{'body':_0x445841,'log':_0x35e4('0x3')});}; \ No newline at end of file +var _0xcbdf=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x36d3d2,_0x9a6e1){var _0x43d883=function(_0x2ec4cf){while(--_0x2ec4cf){_0x36d3d2['push'](_0x36d3d2['shift']());}};_0x43d883(++_0x9a6e1);}(_0xcbdf,0xbd));var _0xfcbd=function(_0x36a146,_0x5267c6){_0x36a146=_0x36a146-0x0;var _0x272d60=_0xcbdf[_0x36a146];return _0x272d60;};'use strict';var client=require(_0xfcbd('0x0'));exports['create']=function(_0x27c036){return client[_0xfcbd('0x1')](_0xfcbd('0x2'),{'body':_0x27c036,'log':_0xfcbd('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 2319c20..8cd27db 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 _0x4af7=['Request','name','timeout','strategy','online','faxPause','../client','getFaxQueues'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x4af7,0x126));var _0x74af=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4af7[_0x5d2803];return _0xdcad2c;};'use strict';var client=require(_0x74af('0x0'));exports[_0x74af('0x1')]=function(){return function(){return client[_0x74af('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x74af('0x3'),_0x74af('0x4'),_0x74af('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x74af('0x3'),_0x74af('0x6'),_0x74af('0x7')]}]},'log':_0x74af('0x1')});};}; \ No newline at end of file +var _0xc01f=['Request','GetFaxQueue','name','User','Agents','online','faxPause','getFaxQueues','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc01f,0x86));var _0xfc01=function(_0x1f64ac,_0x1fedb2){_0x1f64ac=_0x1f64ac-0x0;var _0x370e5c=_0xc01f[_0x1f64ac];return _0x370e5c;};'use strict';var client=require(_0xfc01('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xfc01('0x1')](_0xfc01('0x2'),{'options':{'raw':![],'attributes':['id',_0xfc01('0x3'),'timeout','strategy'],'include':[{'model':_0xfc01('0x4'),'as':_0xfc01('0x5'),'attributes':['id',_0xfc01('0x3'),_0xfc01('0x6'),_0xfc01('0x7')]}]},'log':_0xfc01('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index cab29e7..34a5520 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 _0x46ed=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC'];(function(_0x525308,_0x5898c9){var _0x5a6e40=function(_0x113c37){while(--_0x113c37){_0x525308['push'](_0x525308['shift']());}};_0x5a6e40(++_0x5898c9);}(_0x46ed,0x168));var _0xd46e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x46ed[_0x5d6456];return _0x4d66c1;};'use strict';var client=require(_0xd46e('0x0'));exports[_0xd46e('0x1')]=function(_0x493012){return client[_0xd46e('0x2')](_0xd46e('0x3'),{'body':_0x493012,'log':_0xd46e('0x3')});};exports['update']=function(_0x2e6b84,_0x4518b8){return client['Request'](_0xd46e('0x4'),{'body':_0x4518b8,'options':{'where':{'uniqueid':_0x2e6b84},'order':[['id',_0xd46e('0x5')]],'limit':0x1},'log':_0xd46e('0x4')});}; \ No newline at end of file +var _0x04b6=['../client','Request','CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC'];(function(_0x409ace,_0x5109f7){var _0x11f8b8=function(_0x238c29){while(--_0x238c29){_0x409ace['push'](_0x409ace['shift']());}};_0x11f8b8(++_0x5109f7);}(_0x04b6,0x1e0));var _0x604b=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x04b6[_0x14a862];return _0x245eb5;};'use strict';var client=require(_0x604b('0x0'));exports['create']=function(_0x2f5e91){return client[_0x604b('0x1')](_0x604b('0x2'),{'body':_0x2f5e91,'log':_0x604b('0x2')});};exports[_0x604b('0x3')]=function(_0x68930c,_0x2cc981){return client[_0x604b('0x1')](_0x604b('0x4'),{'body':_0x2cc981,'options':{'where':{'uniqueid':_0x68930c},'order':[['id',_0x604b('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 20e4390..f266980 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 _0x9158=['Intervals','../client','getIntervals','Request','name'];(function(_0x47ed2a,_0x13ed31){var _0x3547fc=function(_0x449285){while(--_0x449285){_0x47ed2a['push'](_0x47ed2a['shift']());}};_0x3547fc(++_0x13ed31);}(_0x9158,0x16e));var _0x8915=function(_0x9d4584,_0x3c3dc9){_0x9d4584=_0x9d4584-0x0;var _0x20c460=_0x9158[_0x9d4584];return _0x20c460;};'use strict';var client=require(_0x8915('0x0'));exports[_0x8915('0x1')]=function(){return function(){return client[_0x8915('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8915('0x3')],'include':[{'model':'Interval','as':_0x8915('0x4'),'attributes':['id','name','interval']}]},'log':_0x8915('0x1')});};}; \ No newline at end of file +var _0x63a5=['Intervals','interval','../client','getIntervals','Request','name'];(function(_0x9c0fd,_0x289d21){var _0x3c5efb=function(_0x4538ab){while(--_0x4538ab){_0x9c0fd['push'](_0x9c0fd['shift']());}};_0x3c5efb(++_0x289d21);}(_0x63a5,0x18e));var _0x563a=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x63a5[_0x2064e5];return _0x21a233;};'use strict';var client=require(_0x563a('0x0'));exports[_0x563a('0x1')]=function(){return function(){return client[_0x563a('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x563a('0x3')],'include':[{'model':'Interval','as':_0x563a('0x4'),'attributes':['id',_0x563a('0x3'),_0x563a('0x5')]}]},'log':_0x563a('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 4c482fd..fd64fb0 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 _0x0bb2=['Request','addTagsToChatInteraction','../client','update','updateMailInteraction','addTags'];(function(_0x22e9a9,_0x432415){var _0x879d06=function(_0x5125be){while(--_0x5125be){_0x22e9a9['push'](_0x22e9a9['shift']());}};_0x879d06(++_0x432415);}(_0x0bb2,0xb0));var _0x20bb=function(_0xad2182,_0x16d18f){_0xad2182=_0xad2182-0x0;var _0x2275d0=_0x0bb2[_0xad2182];return _0x2275d0;};'use strict';var client=require(_0x20bb('0x0'));exports[_0x20bb('0x1')]=function(_0x497432,_0x422919){return client['Request']('UpdateMailInteraction',{'body':_0x422919,'options':{'where':{'id':_0x497432}},'log':_0x20bb('0x2')});};exports[_0x20bb('0x3')]=function(_0x42257f,_0xe7f67e){return client[_0x20bb('0x4')]('AddTagsToMailInteraction',{'body':_0xe7f67e,'options':{'where':{'id':_0x42257f}},'log':_0x20bb('0x5')});}; \ No newline at end of file +var _0xa757=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x588768,_0x1cd6ad){var _0x115bf9=function(_0x4cd2e5){while(--_0x4cd2e5){_0x588768['push'](_0x588768['shift']());}};_0x115bf9(++_0x1cd6ad);}(_0xa757,0x77));var _0x7a75=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa757[_0x5447fd];return _0x15b28a;};'use strict';var client=require(_0x7a75('0x0'));exports[_0x7a75('0x1')]=function(_0x50f9f6,_0x23a30f){return client[_0x7a75('0x2')](_0x7a75('0x3'),{'body':_0x23a30f,'options':{'where':{'id':_0x50f9f6}},'log':_0x7a75('0x4')});};exports[_0x7a75('0x5')]=function(_0x2cc72d,_0x553edc){return client[_0x7a75('0x2')](_0x7a75('0x6'),{'body':_0x553edc,'options':{'where':{'id':_0x2cc72d}},'log':_0x7a75('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index ef81bb6..7fc0a4f 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 _0x8cde=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x16e40b,_0x3c1eb7){var _0x24f75c=function(_0x564e9d){while(--_0x564e9d){_0x16e40b['push'](_0x16e40b['shift']());}};_0x24f75c(++_0x3c1eb7);}(_0x8cde,0xd8));var _0xe8cd=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x8cde[_0x1db481];return _0x3db95b;};'use strict';var client=require(_0xe8cd('0x0'));exports[_0xe8cd('0x1')]=function(_0x206c60){return client[_0xe8cd('0x2')](_0xe8cd('0x3'),{'body':_0x206c60,'log':_0xe8cd('0x4')});}; \ No newline at end of file +var _0xf231=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf231,0x95));var _0x1f23=function(_0x2494f7,_0x527771){_0x2494f7=_0x2494f7-0x0;var _0x1defe6=_0xf231[_0x2494f7];return _0x1defe6;};'use strict';var client=require(_0x1f23('0x0'));exports[_0x1f23('0x1')]=function(_0x31c6df){return client[_0x1f23('0x2')](_0x1f23('0x3'),{'body':_0x31c6df,'log':_0x1f23('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index aa3b73c..f8f95b9 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 _0x0f30=['Agents','online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','User'];(function(_0x2e3075,_0x3c038d){var _0x42dc7d=function(_0x5083ff){while(--_0x5083ff){_0x2e3075['push'](_0x2e3075['shift']());}};_0x42dc7d(++_0x3c038d);}(_0x0f30,0x16b));var _0x00f3=function(_0x4e0090,_0x803be0){_0x4e0090=_0x4e0090-0x0;var _0x180148=_0x0f30[_0x4e0090];return _0x180148;};'use strict';var client=require(_0x00f3('0x0'));exports[_0x00f3('0x1')]=function(){return function(){return client['Request'](_0x00f3('0x2'),{'options':{'raw':![],'attributes':['id',_0x00f3('0x3'),_0x00f3('0x4'),_0x00f3('0x5')],'include':[{'model':_0x00f3('0x6'),'as':_0x00f3('0x7'),'attributes':['id',_0x00f3('0x3'),_0x00f3('0x8'),_0x00f3('0x9')]}]},'log':_0x00f3('0x1')});};}; \ No newline at end of file +var _0xc2ae=['Agents','name','online','mailPause','getMailQueues','timeout','strategy','User'];(function(_0x579bda,_0x5a4137){var _0x846892=function(_0x1c5690){while(--_0x1c5690){_0x579bda['push'](_0x579bda['shift']());}};_0x846892(++_0x5a4137);}(_0xc2ae,0x11c));var _0xec2a=function(_0x3b8249,_0x41ad99){_0x3b8249=_0x3b8249-0x0;var _0x45407c=_0xc2ae[_0x3b8249];return _0x45407c;};'use strict';var client=require('../client');exports[_0xec2a('0x0')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0xec2a('0x1'),_0xec2a('0x2')],'include':[{'model':_0xec2a('0x3'),'as':_0xec2a('0x4'),'attributes':['id',_0xec2a('0x5'),_0xec2a('0x6'),_0xec2a('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index bccd776..6975f62 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 _0x368a=['Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x368a,0x155));var _0xa368=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x368a[_0x29db36];return _0x234e87;};'use strict';var client=require(_0xa368('0x0'));exports[_0xa368('0x1')]=function(_0x2b3fd7){return client[_0xa368('0x2')](_0xa368('0x3'),{'body':_0x2b3fd7,'log':_0xa368('0x3')});};exports[_0xa368('0x4')]=function(_0x497bb4,_0xa90be9){return client['Request']('UpdateMailQueueReport',{'body':_0xa90be9,'options':{'where':{'uniqueid':_0x497bb4},'order':[['id',_0xa368('0x5')]],'limit':0x1},'log':_0xa368('0x6')});}; \ No newline at end of file +var _0x3251=['CreateMailQueueReport','update','UpdateMailQueueReport','Request'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0x3251,0xb7));var _0x1325=function(_0x25f206,_0x1121bb){_0x25f206=_0x25f206-0x0;var _0xf96267=_0x3251[_0x25f206];return _0xf96267;};'use strict';var client=require('../client');exports['create']=function(_0xb8de11){return client[_0x1325('0x0')](_0x1325('0x1'),{'body':_0xb8de11,'log':_0x1325('0x1')});};exports[_0x1325('0x2')]=function(_0x2953bc,_0x39aea4){return client[_0x1325('0x0')](_0x1325('0x3'),{'body':_0x39aea4,'options':{'where':{'uniqueid':_0x2953bc},'order':[['id','DESC']],'limit':0x1},'log':_0x1325('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 3a0bbb2..7cf46d4 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 _0x36de=['addTags','Request','addTagsToChatInteraction','../client','updateOpenchannelInteraction'];(function(_0x4eb0bb,_0x981892){var _0x4ff0d7=function(_0xada571){while(--_0xada571){_0x4eb0bb['push'](_0x4eb0bb['shift']());}};_0x4ff0d7(++_0x981892);}(_0x36de,0x12a));var _0xe36d=function(_0x6e54c0,_0x3c77ed){_0x6e54c0=_0x6e54c0-0x0;var _0x3b5299=_0x36de[_0x6e54c0];return _0x3b5299;};'use strict';var client=require(_0xe36d('0x0'));exports['update']=function(_0x195fc5,_0x151f9c){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x151f9c,'options':{'where':{'id':_0x195fc5}},'log':_0xe36d('0x1')});};exports[_0xe36d('0x2')]=function(_0x425dbd,_0x5c3a93){return client[_0xe36d('0x3')]('AddTagsToOpenchannelInteraction',{'body':_0x5c3a93,'options':{'where':{'id':_0x425dbd}},'log':_0xe36d('0x4')});}; \ No newline at end of file +var _0xb094=['../client','update','Request','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x1e175d,_0x41ff45){var _0x3a3ce5=function(_0x186001){while(--_0x186001){_0x1e175d['push'](_0x1e175d['shift']());}};_0x3a3ce5(++_0x41ff45);}(_0xb094,0x1b0));var _0x4b09=function(_0x28b67a,_0x2fac44){_0x28b67a=_0x28b67a-0x0;var _0x49bf24=_0xb094[_0x28b67a];return _0x49bf24;};'use strict';var client=require(_0x4b09('0x0'));exports[_0x4b09('0x1')]=function(_0x14baa9,_0x4e2316){return client[_0x4b09('0x2')]('UpdateOpenchannelInteraction',{'body':_0x4e2316,'options':{'where':{'id':_0x14baa9}},'log':_0x4b09('0x3')});};exports[_0x4b09('0x4')]=function(_0x423eed,_0x288141){return client[_0x4b09('0x2')](_0x4b09('0x5'),{'body':_0x288141,'options':{'where':{'id':_0x423eed}},'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 9c9a1e8..dbb63c4 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 _0xf4eb=['../client','createOpenchannelMessage'];(function(_0x2e77bc,_0x5bfa34){var _0x5bc32e=function(_0x1ef3bf){while(--_0x1ef3bf){_0x2e77bc['push'](_0x2e77bc['shift']());}};_0x5bc32e(++_0x5bfa34);}(_0xf4eb,0xec));var _0xbf4e=function(_0x38af18,_0x36c875){_0x38af18=_0x38af18-0x0;var _0x3cec7d=_0xf4eb[_0x38af18];return _0x3cec7d;};'use strict';var client=require(_0xbf4e('0x0'));exports['create']=function(_0x50f2fc){return client['Request']('CreateOpenchannelMessage',{'body':_0x50f2fc,'log':_0xbf4e('0x1')});}; \ No newline at end of file +var _0xbdb7=['CreateOpenchannelMessage','createOpenchannelMessage','../client','create','Request'];(function(_0x220e8e,_0x3029e6){var _0x51db13=function(_0x1ae6b3){while(--_0x1ae6b3){_0x220e8e['push'](_0x220e8e['shift']());}};_0x51db13(++_0x3029e6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x486f8e,_0x52fb5f){_0x486f8e=_0x486f8e-0x0;var _0x528b66=_0xbdb7[_0x486f8e];return _0x528b66;};'use strict';var client=require(_0x7bdb('0x0'));exports[_0x7bdb('0x1')]=function(_0x44467d){return client[_0x7bdb('0x2')](_0x7bdb('0x3'),{'body':_0x44467d,'log':_0x7bdb('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index b843497..8abe0c8 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 _0x90d9=['openchannelPause','../client','getOpenchannelQueues','Request','strategy','User','Agents','online'];(function(_0x548fd7,_0x2aa098){var _0x51ec36=function(_0x349368){while(--_0x349368){_0x548fd7['push'](_0x548fd7['shift']());}};_0x51ec36(++_0x2aa098);}(_0x90d9,0x81));var _0x990d=function(_0x5664eb,_0x5a561b){_0x5664eb=_0x5664eb-0x0;var _0x47fac3=_0x90d9[_0x5664eb];return _0x47fac3;};'use strict';var client=require(_0x990d('0x0'));exports[_0x990d('0x1')]=function(){return function(){return client[_0x990d('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x990d('0x3')],'include':[{'model':_0x990d('0x4'),'as':_0x990d('0x5'),'attributes':['id','name',_0x990d('0x6'),_0x990d('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x6722=['online','openchannelPause','../client','getOpenchannelQueues','Request','name','timeout','Agents'];(function(_0x266743,_0x341d46){var _0x3b13a2=function(_0x1f98cc){while(--_0x1f98cc){_0x266743['push'](_0x266743['shift']());}};_0x3b13a2(++_0x341d46);}(_0x6722,0x12a));var _0x2672=function(_0x4ed406,_0x56e45c){_0x4ed406=_0x4ed406-0x0;var _0x34645c=_0x6722[_0x4ed406];return _0x34645c;};'use strict';var client=require(_0x2672('0x0'));exports[_0x2672('0x1')]=function(){return function(){return client[_0x2672('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x2672('0x3'),_0x2672('0x4'),'strategy'],'include':[{'model':'User','as':_0x2672('0x5'),'attributes':['id','name',_0x2672('0x6'),_0x2672('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 5fad0be..1d31c94 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 _0x3ce9=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x29ce0f,_0x15d5ed){var _0xcd7fe7=function(_0x22f009){while(--_0x22f009){_0x29ce0f['push'](_0x29ce0f['shift']());}};_0xcd7fe7(++_0x15d5ed);}(_0x3ce9,0xac));var _0x93ce=function(_0x2cb27f,_0x51faa7){_0x2cb27f=_0x2cb27f-0x0;var _0x4afd77=_0x3ce9[_0x2cb27f];return _0x4afd77;};'use strict';var client=require(_0x93ce('0x0'));exports[_0x93ce('0x1')]=function(_0x5984c4){return client[_0x93ce('0x2')](_0x93ce('0x3'),{'body':_0x5984c4,'log':_0x93ce('0x3')});};exports[_0x93ce('0x4')]=function(_0x5e063b,_0x406a6b){return client[_0x93ce('0x2')](_0x93ce('0x5'),{'body':_0x406a6b,'options':{'where':{'uniqueid':_0x5e063b},'order':[['id',_0x93ce('0x6')]],'limit':0x1},'log':_0x93ce('0x5')});}; \ No newline at end of file +var _0x13b4=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x1af05b,_0x5134b5){var _0x5be7cc=function(_0x2d4ac0){while(--_0x2d4ac0){_0x1af05b['push'](_0x1af05b['shift']());}};_0x5be7cc(++_0x5134b5);}(_0x13b4,0x6c));var _0x413b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x13b4[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x413b('0x0'));exports[_0x413b('0x1')]=function(_0x106bf1){return client[_0x413b('0x2')](_0x413b('0x3'),{'body':_0x106bf1,'log':_0x413b('0x3')});};exports[_0x413b('0x4')]=function(_0x110818,_0x2b3056){return client[_0x413b('0x2')](_0x413b('0x5'),{'body':_0x2b3056,'options':{'where':{'uniqueid':_0x110818},'order':[['id',_0x413b('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 722e214..f384752 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 _0x96ef=['updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction'];(function(_0xc2d470,_0x34877d){var _0x479182=function(_0x50f522){while(--_0x50f522){_0xc2d470['push'](_0xc2d470['shift']());}};_0x479182(++_0x34877d);}(_0x96ef,0x189));var _0xf96e=function(_0x1f9d1d,_0x4bad60){_0x1f9d1d=_0x1f9d1d-0x0;var _0x8e0994=_0x96ef[_0x1f9d1d];return _0x8e0994;};'use strict';var client=require(_0xf96e('0x0'));exports[_0xf96e('0x1')]=function(_0x541519,_0x104db0){return client['Request'](_0xf96e('0x2'),{'body':_0x104db0,'options':{'where':{'id':_0x541519}},'log':_0xf96e('0x3')});};exports[_0xf96e('0x4')]=function(_0x300629,_0x3f3ec5){return client['Request']('AddTagsToSmsInteraction',{'body':_0x3f3ec5,'options':{'where':{'id':_0x300629}},'log':_0xf96e('0x5')});}; \ No newline at end of file +var _0x0e26=['update','Request','UpdateSmsInteraction','updateSmsInteraction','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x4877bc,_0x24b542){var _0x296c34=function(_0x45e2b0){while(--_0x45e2b0){_0x4877bc['push'](_0x4877bc['shift']());}};_0x296c34(++_0x24b542);}(_0x0e26,0x12c));var _0x60e2=function(_0x9ffa03,_0x590505){_0x9ffa03=_0x9ffa03-0x0;var _0x568b80=_0x0e26[_0x9ffa03];return _0x568b80;};'use strict';var client=require(_0x60e2('0x0'));exports[_0x60e2('0x1')]=function(_0x5b12d0,_0x4f1b6d){return client[_0x60e2('0x2')](_0x60e2('0x3'),{'body':_0x4f1b6d,'options':{'where':{'id':_0x5b12d0}},'log':_0x60e2('0x4')});};exports['addTags']=function(_0x22e734,_0x404283){return client[_0x60e2('0x2')](_0x60e2('0x5'),{'body':_0x404283,'options':{'where':{'id':_0x22e734}},'log':_0x60e2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 78becf2..66901c0 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 _0x8f13=['../client','Request'];(function(_0x27c248,_0x384dff){var _0x1b2fc2=function(_0x188255){while(--_0x188255){_0x27c248['push'](_0x27c248['shift']());}};_0x1b2fc2(++_0x384dff);}(_0x8f13,0xac));var _0x38f1=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0x8f13[_0x196e1b];return _0x5e1f18;};'use strict';var client=require(_0x38f1('0x0'));exports['create']=function(_0x4fd31a){return client[_0x38f1('0x1')]('CreateSmsMessage',{'body':_0x4fd31a,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x1a46=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x1e9b1d,_0x4bb1f3){var _0x27969e=function(_0x51a400){while(--_0x51a400){_0x1e9b1d['push'](_0x1e9b1d['shift']());}};_0x27969e(++_0x4bb1f3);}(_0x1a46,0x11d));var _0x61a4=function(_0x85ae8c,_0x408e9e){_0x85ae8c=_0x85ae8c-0x0;var _0x392291=_0x1a46[_0x85ae8c];return _0x392291;};'use strict';var client=require(_0x61a4('0x0'));exports[_0x61a4('0x1')]=function(_0x1095f1){return client[_0x61a4('0x2')](_0x61a4('0x3'),{'body':_0x1095f1,'log':_0x61a4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index ca74688..47e860e 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 _0xa816=['getSmsQueues','Request','name','timeout','strategy','User','online','../client'];(function(_0x79d2e5,_0x34ebca){var _0x316941=function(_0x102ac7){while(--_0x102ac7){_0x79d2e5['push'](_0x79d2e5['shift']());}};_0x316941(++_0x34ebca);}(_0xa816,0xd7));var _0x6a81=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xa816[_0x189305];return _0xea3406;};'use strict';var client=require(_0x6a81('0x0'));exports[_0x6a81('0x1')]=function(){return function(){return client[_0x6a81('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6a81('0x3'),_0x6a81('0x4'),_0x6a81('0x5')],'include':[{'model':_0x6a81('0x6'),'as':'Agents','attributes':['id',_0x6a81('0x3'),_0x6a81('0x7'),'smsPause']}]},'log':_0x6a81('0x1')});};}; \ No newline at end of file +var _0xa976=['getSmsQueues','GetSmsQueue','name','timeout','strategy','User','Agents','online','../client'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0xa976,0xd7));var _0x6a97=function(_0x5736aa,_0xbe5de1){_0x5736aa=_0x5736aa-0x0;var _0x156b7a=_0xa976[_0x5736aa];return _0x156b7a;};'use strict';var client=require(_0x6a97('0x0'));exports[_0x6a97('0x1')]=function(){return function(){return client['Request'](_0x6a97('0x2'),{'options':{'raw':![],'attributes':['id',_0x6a97('0x3'),_0x6a97('0x4'),_0x6a97('0x5')],'include':[{'model':_0x6a97('0x6'),'as':_0x6a97('0x7'),'attributes':['id','name',_0x6a97('0x8'),'smsPause']}]},'log':_0x6a97('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 0a54967..fdfc269 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 _0x489a=['update','UpdateSmsQueueReport','../client','create','CreateSmsQueueReport'];(function(_0x2d772b,_0x187f1b){var _0x3a424f=function(_0x2aef08){while(--_0x2aef08){_0x2d772b['push'](_0x2d772b['shift']());}};_0x3a424f(++_0x187f1b);}(_0x489a,0x1c4));var _0xa489=function(_0x91e5da,_0x25ce34){_0x91e5da=_0x91e5da-0x0;var _0x5533f3=_0x489a[_0x91e5da];return _0x5533f3;};'use strict';var client=require(_0xa489('0x0'));exports[_0xa489('0x1')]=function(_0x953d74){return client['Request'](_0xa489('0x2'),{'body':_0x953d74,'log':_0xa489('0x2')});};exports[_0xa489('0x3')]=function(_0x3b6533,_0x29ffd3){return client['Request'](_0xa489('0x4'),{'body':_0x29ffd3,'options':{'where':{'uniqueid':_0x3b6533},'order':[['id','DESC']],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0x2cfd=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','create'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x2cfd,0x179));var _0xd2cf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2cfd[_0x20a584];return _0x4b41a8;};'use strict';var client=require('../client');exports[_0xd2cf('0x0')]=function(_0x429bb9){return client[_0xd2cf('0x1')]('CreateSmsQueueReport',{'body':_0x429bb9,'log':_0xd2cf('0x2')});};exports[_0xd2cf('0x3')]=function(_0x554992,_0x5c688d){return client['Request'](_0xd2cf('0x4'),{'body':_0x5c688d,'options':{'where':{'uniqueid':_0x554992},'order':[['id',_0xd2cf('0x5')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 750172e..264edcb 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 _0x54d5=['faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','online','pauseType','lastPauseAt','chatPause'];(function(_0x18f2e7,_0x51dfad){var _0x25afb6=function(_0x1cacac){while(--_0x1cacac){_0x18f2e7['push'](_0x18f2e7['shift']());}};_0x25afb6(++_0x51dfad);}(_0x54d5,0xa1));var _0x554d=function(_0x153c52,_0x555adb){_0x153c52=_0x153c52-0x0;var _0x3e35af=_0x54d5[_0x153c52];return _0x3e35af;};'use strict';var client=require(_0x554d('0x0'));exports[_0x554d('0x1')]=function(){return function(){return client[_0x554d('0x2')](_0x554d('0x3'),{'options':{'raw':!![],'where':{'role':_0x554d('0x4')},'attributes':['id','name',_0x554d('0x5'),_0x554d('0x6'),_0x554d('0x7'),'voicePause',_0x554d('0x8'),'mailPause',_0x554d('0x9'),_0x554d('0xa'),_0x554d('0xb'),_0x554d('0xc'),_0x554d('0xd'),_0x554d('0xe'),_0x554d('0xf'),_0x554d('0x10')]},'log':_0x554d('0x1')});};}; \ No newline at end of file +var _0xfa8c=['voicePause','faxPause','smsPause','openchannelPause','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','../client','Request','GetUser','name','online','lastPauseAt'];(function(_0x2b9e33,_0x266ac7){var _0x3062a6=function(_0x452db6){while(--_0x452db6){_0x2b9e33['push'](_0x2b9e33['shift']());}};_0x3062a6(++_0x266ac7);}(_0xfa8c,0x72));var _0xcfa8=function(_0x171756,_0x19f1d2){_0x171756=_0x171756-0x0;var _0x3ded5c=_0xfa8c[_0x171756];return _0x3ded5c;};'use strict';var client=require(_0xcfa8('0x0'));exports['getAgents']=function(){return function(){return client[_0xcfa8('0x1')](_0xcfa8('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0xcfa8('0x3'),_0xcfa8('0x4'),'pauseType',_0xcfa8('0x5'),_0xcfa8('0x6'),'chatPause','mailPause',_0xcfa8('0x7'),_0xcfa8('0x8'),_0xcfa8('0x9'),'chatCapacity',_0xcfa8('0xa'),_0xcfa8('0xb'),_0xcfa8('0xc'),_0xcfa8('0xd')]},'log':_0xcfa8('0xe')});};}; \ 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 31cd441..d38f419 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 _0x9a0b=['lodash','seq-queue','../../../../config/logger','routing','./strategy','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','find','agents','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','next','agent','[%s][QUEUE]\x20%s','validate'];(function(_0x4abab9,_0xde21a4){var _0x374eba=function(_0x3659f7){while(--_0x3659f7){_0x4abab9['push'](_0x4abab9['shift']());}};_0x374eba(++_0xde21a4);}(_0x9a0b,0x1a3));var _0xb9a0=function(_0x274ea1,_0x40632b){_0x274ea1=_0x274ea1-0x0;var _0x396878=_0x9a0b[_0x274ea1];return _0x396878;};'use strict';var schema=require(_0xb9a0('0x0'));var _=require(_0xb9a0('0x1'));var util=require('util');var seqqueue=require(_0xb9a0('0x2'));var logger=require(_0xb9a0('0x3'))(_0xb9a0('0x4'));var strategy=require(_0xb9a0('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xb9a0('0x6')}});function writeLog(_0x583767,_0xdc24b8,_0x464216){return logger[_0xb9a0('0x7')](util[_0xb9a0('0x8')](_0xb9a0('0x9'),_0x583767,_0xdc24b8[_0xb9a0('0xa')],_0x464216));}function handleFindAgent(_0x4129c0){return function(_0x5adcda){return _0x5adcda[_0xb9a0('0xa')]['toLowerCase']()===_0x4129c0[_0xb9a0('0xb')]();};}exports[_0xb9a0('0xc')]=function(_0x1c05f4,_0x20d71f,_0x4db52d,_0x3b7663){return function(_0x41e455){try{var _0x3908a2={'name':_0x20d71f[0x0],'timeout':_0x20d71f[0x1]};var _0xd12e71=queue['validate'](_0x3908a2,{'typecast':!![]});if(_0xd12e71[_0xb9a0('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0x1c05f4,_[_0xb9a0('0xe')](_0xd12e71,_0xb9a0('0xf'))[_0xb9a0('0x10')](',\x20'));_0x41e455['stop']();}else{var _0x2ae5e7=_[_0xb9a0('0x11')](_0x4db52d[_0xb9a0('0x12')],handleFindAgent(_0x3908a2[_0xb9a0('0xa')]));if(_0x2ae5e7){var _0x21bc49=(_0x3908a2['timeout']||0xa)*0x3e8;var _0x297fca,_0x5c8a10;var _0x359ec8=seqqueue[_0xb9a0('0x13')](_0x21bc49);_0x359ec8['id']=_0x1c05f4;_0x359ec8[_0xb9a0('0x14')]=_0x21bc49;_0x359ec8['channel']=_0x3b7663[_0xb9a0('0x15')];writeLog(_0x1c05f4,_0x2ae5e7,util['format'](_0xb9a0('0x16'),_0x21bc49));_0x4db52d[_0xb9a0('0x17')][_0x1c05f4]['on'](_0xb9a0('0x18'),function(){_0x359ec8['close']();clearTimeout(_0x5c8a10);_0x5c8a10=undefined;if(_0x4db52d['rules'][_0x1c05f4]){delete _0x4db52d['rules'][_0x1c05f4];}logger[_0xb9a0('0x7')](_0xb9a0('0x19'),_0x1c05f4);_0x41e455[_0xb9a0('0x1a')]();});_0x5c8a10=setTimeout(function(){clearTimeout(_0x5c8a10);_0x359ec8['close']();logger[_0xb9a0('0x7')]('[%s][AGENT]\x20ROUTING\x20END',_0x1c05f4);_0x41e455[_0xb9a0('0x1b')]();},_0x21bc49);strategy[_0xb9a0('0x1c')](_0x359ec8,_0x2ae5e7,_0x4db52d,_0x3b7663);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1c05f4,_0x3908a2[_0xb9a0('0xa')]);_0x41e455[_0xb9a0('0x1a')]();}}}catch(_0x3e9ac6){console['log'](_0x3e9ac6);logger['error'](_0xb9a0('0x1d'),_0x1c05f4,_0x3e9ac6['stack']);_0x41e455['stop']();}};}; \ No newline at end of file +var _0xf19c=['[%s][QUEUE]\x20%s','validate','seq-queue','../../../../config/logger','routing','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','name','toLowerCase','error','[%s][AGENT]\x20%s','map','message','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','close','stop','[%s][AGENT]\x20ROUTING\x20END','next'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0xf19c,0x69));var _0xcf19=function(_0x4b48bb,_0x463b33){_0x4b48bb=_0x4b48bb-0x0;var _0x4b0aa3=_0xf19c[_0x4b48bb];return _0x4b0aa3;};'use strict';var schema=require(_0xcf19('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require(_0xcf19('0x1'));var logger=require(_0xcf19('0x2'))(_0xcf19('0x3'));var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0xcf19('0x4')},'timeout':{'type':_0xcf19('0x5'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x5cb051,_0xe8c15d,_0x30cfe3){return logger[_0xcf19('0x6')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5cb051,_0xe8c15d[_0xcf19('0x7')],_0x30cfe3));}function handleFindAgent(_0xb83374){return function(_0x1a623d){return _0x1a623d[_0xcf19('0x7')][_0xcf19('0x8')]()===_0xb83374[_0xcf19('0x8')]();};}exports['consequence']=function(_0xafcc5d,_0x9a5977,_0xe45db1,_0x5f1818){return function(_0x42b999){try{var _0xf868c2={'name':_0x9a5977[0x0],'timeout':_0x9a5977[0x1]};var _0x12719b=queue[_0xcf19('0x0')](_0xf868c2,{'typecast':!![]});if(_0x12719b['length']){logger[_0xcf19('0x9')](_0xcf19('0xa'),_0xafcc5d,_[_0xcf19('0xb')](_0x12719b,_0xcf19('0xc'))['join'](',\x20'));_0x42b999['stop']();}else{var _0x472938=_['find'](_0xe45db1[_0xcf19('0xd')],handleFindAgent(_0xf868c2['name']));if(_0x472938){var _0xd9ffeb=(_0xf868c2[_0xcf19('0xe')]||0xa)*0x3e8;var _0x303156,_0x2201c1;var _0x16faba=seqqueue[_0xcf19('0xf')](_0xd9ffeb);_0x16faba['id']=_0xafcc5d;_0x16faba[_0xcf19('0x10')]=_0xd9ffeb;_0x16faba[_0xcf19('0x11')]=_0x5f1818[_0xcf19('0x11')];writeLog(_0xafcc5d,_0x472938,util['format'](_0xcf19('0x12'),_0xd9ffeb));_0xe45db1[_0xcf19('0x13')][_0xafcc5d]['on'](_0xcf19('0x14'),function(){_0x16faba[_0xcf19('0x15')]();clearTimeout(_0x2201c1);_0x2201c1=undefined;if(_0xe45db1[_0xcf19('0x13')][_0xafcc5d]){delete _0xe45db1[_0xcf19('0x13')][_0xafcc5d];}logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0xafcc5d);_0x42b999[_0xcf19('0x16')]();});_0x2201c1=setTimeout(function(){clearTimeout(_0x2201c1);_0x16faba[_0xcf19('0x15')]();logger[_0xcf19('0x6')](_0xcf19('0x17'),_0xafcc5d);_0x42b999[_0xcf19('0x18')]();},_0xd9ffeb);strategy['agent'](_0x16faba,_0x472938,_0xe45db1,_0x5f1818);}else{logger[_0xcf19('0x9')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xafcc5d,_0xf868c2[_0xcf19('0x7')]);_0x42b999[_0xcf19('0x16')]();}}}catch(_0x593dac){console['log'](_0x593dac);logger[_0xcf19('0x9')](_0xcf19('0x19'),_0xafcc5d,_0x593dac['stack']);_0x42b999[_0xcf19('0x16')]();}};}; \ 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 8568796..c7a7c7a 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 _0xdcf3=['$LATEST','toString','postText','message','amazonlex','then','dialogState','Failed','error','stringify','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','[%s][AMAZONLEX]\x20%s','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime'];(function(_0x2d5f55,_0x1693b8){var _0x44881e=function(_0xb9601e){while(--_0xb9601e){_0x2d5f55['push'](_0x2d5f55['shift']());}};_0x44881e(++_0x1693b8);}(_0xdcf3,0x172));var _0x3dcf=function(_0x57fb6f,_0x4656eb){_0x57fb6f=_0x57fb6f-0x0;var _0x109e1f=_0xdcf3[_0x57fb6f];return _0x109e1f;};'use strict';var _=require('lodash');var moment=require(_0x3dcf('0x0'));var AWS=require(_0x3dcf('0x1'));var utils=require(_0x3dcf('0x2'));var logger=require(_0x3dcf('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3dcf('0x4')),'mailMessage':require(_0x3dcf('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3dcf('0x6'))};exports['consequence']=function(_0x48e317,_0x2066e5){return function(_0x2a65fe){try{if(!_[_0x3dcf('0x7')](this[_0x3dcf('0x8')][_0x3dcf('0x9')])){logger[_0x3dcf('0xa')]('[%s][AMAZONLEX]\x20%s',_0x48e317,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2a65fe[_0x3dcf('0xb')]();}var _0x4e7b2d={'ContactId':this[_0x3dcf('0xc')]['id'],'sentAt':moment()[_0x3dcf('0xd')](_0x3dcf('0xe')),'direction':_0x3dcf('0xf')};var _0x3f1c95=this[_0x3dcf('0x10')];if(_0x3f1c95===_0x3dcf('0x11')){_0x4e7b2d[_0x3dcf('0x12')]=this[_0x3dcf('0x13')]['id'];}else{_0x4e7b2d[_['upperFirst'](_0x3f1c95)+_0x3dcf('0x14')]=this[_0x3dcf('0x13')]['id'];}_0x4e7b2d[_[_0x3dcf('0x15')](_0x3f1c95)+_0x3dcf('0x16')]=this[_0x3dcf('0x8')]['id'];if(this[_0x3dcf('0x8')][_0x3dcf('0x17')]){var _0x1ed375=_0x2066e5[0x4];if(!_[_0x3dcf('0x18')](_0x1ed375)){_0x4e7b2d[_0x3dcf('0x19')]=utils[_0x3dcf('0x1a')](_0x1ed375,this);return rpc[_0x3f1c95+_0x3dcf('0x1b')]['create'](_0x4e7b2d)['then'](function(_0x59bf73){logger[_0x3dcf('0xa')](_0x3dcf('0x1c'),_0x48e317,_0x4e7b2d[_0x3dcf('0x19')]);})[_0x3dcf('0x1d')](function(_0x1659c7){logger['error'](_0x3dcf('0x1c'),_0x48e317,JSON['stringify'](_0x1659c7));})[_0x3dcf('0x1e')](function(){logger[_0x3dcf('0xa')](_0x3dcf('0x1f'),_0x48e317);_0x2a65fe[_0x3dcf('0x20')]();});}else{logger[_0x3dcf('0xa')](_0x3dcf('0x21'),_0x48e317);_0x2a65fe[_0x3dcf('0x20')]();}}else{var _0x3741f1=this;var _0x28c903=new AWS[(_0x3dcf('0x22'))]({'accessKeyId':_0x2066e5[0x0],'secretAccessKey':_0x2066e5[0x1],'region':_0x2066e5[0x2]});var _0x1f2783={'botAlias':_0x3dcf('0x23'),'botName':_0x2066e5[0x3],'inputText':this['message'][_0x3dcf('0x19')],'userId':this[_0x3dcf('0x8')]['id'][_0x3dcf('0x24')]()};_0x28c903[_0x3dcf('0x25')](_0x1f2783,function(_0x3f17aa,_0x5e1d3e){if(_0x3f17aa){logger['error']('[%s][AMAZONLEX]\x20%s',_0x48e317,_0x3f17aa[_0x3dcf('0x26')]);_0x2a65fe[_0x3dcf('0xb')]();}else if(_0x5e1d3e&&_0x5e1d3e[_0x3dcf('0x26')]){_0x3741f1[_0x3dcf('0x19')][_0x3dcf('0x27')]=_0x5e1d3e;_0x4e7b2d['body']=_0x5e1d3e['message'];return rpc[_0x3f1c95+'Message']['create'](_0x4e7b2d)[_0x3dcf('0x28')](function(_0xd0896){logger[_0x3dcf('0xa')](_0x3dcf('0x1c'),_0x48e317,_0x4e7b2d[_0x3dcf('0x19')]);if(_0x5e1d3e[_0x3dcf('0x29')]==_0x3dcf('0x2a')){_0x2a65fe[_0x3dcf('0xb')]();}else{_0x2a65fe[_0x3dcf('0x20')]();}})[_0x3dcf('0x1d')](function(_0xdd49d0){logger[_0x3dcf('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x48e317,JSON[_0x3dcf('0x2c')](_0xdd49d0));_0x2a65fe[_0x3dcf('0xb')]();});}else{_0x2a65fe['next']();}});}}catch(_0x5504d5){logger[_0x3dcf('0x2b')](_0x3dcf('0x1c'),_0x48e317,JSON[_0x3dcf('0x2c')](_0x5504d5));_0x2a65fe[_0x3dcf('0x20')]();}};}; \ No newline at end of file +var _0x9690=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','consequence','isNil','interaction','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','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','body','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','message','toString','postText','error','amazonlex','Message','dialogState','lodash','aws-sdk'];(function(_0x362039,_0x1a4d4d){var _0x2fd759=function(_0x1fadb0){while(--_0x1fadb0){_0x362039['push'](_0x362039['shift']());}};_0x2fd759(++_0x1a4d4d);}(_0x9690,0xcb));var _0x0969=function(_0x426a05,_0x20982e){_0x426a05=_0x426a05-0x0;var _0x39ccc6=_0x9690[_0x426a05];return _0x39ccc6;};'use strict';var _=require(_0x0969('0x0'));var moment=require('moment');var AWS=require(_0x0969('0x1'));var utils=require('./utils');var logger=require(_0x0969('0x2'))(_0x0969('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x0969('0x4')),'mailMessage':require(_0x0969('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0x0969('0x6')]=function(_0x431e4b,_0x2aca49){return function(_0x242fc6){try{if(!_[_0x0969('0x7')](this[_0x0969('0x8')]['UserId'])){logger[_0x0969('0x9')](_0x0969('0xa'),_0x431e4b,_0x0969('0xb'));return _0x242fc6[_0x0969('0xc')]();}var _0x40c280={'ContactId':this[_0x0969('0xd')]['id'],'sentAt':moment()[_0x0969('0xe')](_0x0969('0xf')),'direction':_0x0969('0x10')};var _0x1f9eed=this[_0x0969('0x11')];if(_0x1f9eed===_0x0969('0x12')){_0x40c280[_0x0969('0x13')]=this['account']['id'];}else{_0x40c280[_[_0x0969('0x14')](_0x1f9eed)+_0x0969('0x15')]=this[_0x0969('0x16')]['id'];}_0x40c280[_[_0x0969('0x14')](_0x1f9eed)+_0x0969('0x17')]=this[_0x0969('0x8')]['id'];if(this[_0x0969('0x8')][_0x0969('0x18')]){var _0x49cb4d=_0x2aca49[0x4];if(!_['isEmpty'](_0x49cb4d)){_0x40c280[_0x0969('0x19')]=utils['getMustacheRender'](_0x49cb4d,this);return rpc[_0x1f9eed+'Message'][_0x0969('0x1a')](_0x40c280)[_0x0969('0x1b')](function(_0x2c85f1){logger['info'](_0x0969('0xa'),_0x431e4b,_0x40c280[_0x0969('0x19')]);})[_0x0969('0x1c')](function(_0x51487e){logger['error'](_0x0969('0xa'),_0x431e4b,JSON[_0x0969('0x1d')](_0x51487e));})[_0x0969('0x1e')](function(){logger[_0x0969('0x9')](_0x0969('0x1f'),_0x431e4b);_0x242fc6[_0x0969('0x20')]();});}else{logger[_0x0969('0x9')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x431e4b);_0x242fc6[_0x0969('0x20')]();}}else{var _0x3f0149=this;var _0x52f6c2=new AWS[(_0x0969('0x21'))]({'accessKeyId':_0x2aca49[0x0],'secretAccessKey':_0x2aca49[0x1],'region':_0x2aca49[0x2]});var _0x345579={'botAlias':'$LATEST','botName':_0x2aca49[0x3],'inputText':this[_0x0969('0x22')]['body'],'userId':this[_0x0969('0x8')]['id'][_0x0969('0x23')]()};_0x52f6c2[_0x0969('0x24')](_0x345579,function(_0x2098e8,_0x148a57){if(_0x2098e8){logger[_0x0969('0x25')](_0x0969('0xa'),_0x431e4b,_0x2098e8['message']);_0x242fc6[_0x0969('0xc')]();}else if(_0x148a57&&_0x148a57[_0x0969('0x22')]){_0x3f0149[_0x0969('0x19')][_0x0969('0x26')]=_0x148a57;_0x40c280[_0x0969('0x19')]=_0x148a57['message'];return rpc[_0x1f9eed+_0x0969('0x27')][_0x0969('0x1a')](_0x40c280)[_0x0969('0x1b')](function(_0xb1a691){logger[_0x0969('0x9')]('[%s][AMAZONLEX]\x20%s',_0x431e4b,_0x40c280['body']);if(_0x148a57[_0x0969('0x28')]=='Failed'){_0x242fc6['next']();}else{_0x242fc6['stop']();}})[_0x0969('0x1c')](function(_0x5a6476){logger[_0x0969('0x25')](_0x0969('0xa'),_0x431e4b,JSON[_0x0969('0x1d')](_0x5a6476));_0x242fc6[_0x0969('0xc')]();});}else{_0x242fc6['next']();}});}}catch(_0xe6f6f6){logger['error'](_0x0969('0xa'),_0x431e4b,JSON['stringify'](_0xe6f6f6));_0x242fc6[_0x0969('0x20')]();}};}; \ 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 8fbdb73..db3bf58 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 _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file +var _0xa9e0=['messageId','html','replace','body',''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 3f6def5..274aed1 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd10f=['system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xd10f,0x198));var _0xfd10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd10f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xfd10('0x0'));var logger=require(_0xfd10('0x1'))(_0xfd10('0x2'));var rpc={'chatInteraction':require(_0xfd10('0x3')),'openchannelInteraction':require(_0xfd10('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfd10('0x5')),'faxInteraction':require(_0xfd10('0x6'))};exports['consequence']=function(_0x589437,_0x28f0ba,_0x1bf526,_0x3f9cdd){return function(_0x10a20f){try{logger[_0xfd10('0x7')](_0xfd10('0x8'),_0x589437,_0x28f0ba[0x0]);var _0xef584f={'closed':0x1,'closedAt':moment()[_0xfd10('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xfd10('0xa'),'disposition':_0x28f0ba[0x0]};if(rpc[_0x3f9cdd[_0xfd10('0xb')]+'Interaction']){rpc[_0x3f9cdd[_0xfd10('0xb')]+_0xfd10('0xc')][_0xfd10('0xd')](_0x3f9cdd[_0xfd10('0xe')]['id'],_0xef584f)['then'](function(_0x4b16ea){logger[_0xfd10('0x7')](_0xfd10('0xf'),_0x589437,_0x3f9cdd['interaction']['id']);})[_0xfd10('0x10')](function(_0x30d7a2){logger[_0xfd10('0x11')](_0xfd10('0x12'),_0x589437,JSON[_0xfd10('0x13')](_0x30d7a2));})[_0xfd10('0x14')](function(){_0x10a20f[_0xfd10('0x15')]();});}}catch(_0x1d07be){logger[_0xfd10('0x11')](_0xfd10('0x12'),_0x589437,JSON[_0xfd10('0x13')](_0x1d07be));_0x10a20f[_0xfd10('0x15')]();}};}; \ No newline at end of file +var _0x574d=['moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x574d,0xc0));var _0xd574=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x574d[_0x1928c9];return _0x51b5fb;};'use strict';var moment=require(_0xd574('0x0'));var logger=require(_0xd574('0x1'))(_0xd574('0x2'));var rpc={'chatInteraction':require(_0xd574('0x3')),'openchannelInteraction':require(_0xd574('0x4')),'smsInteraction':require(_0xd574('0x5')),'mailInteraction':require(_0xd574('0x6')),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0xd574('0x7')]=function(_0x1be154,_0x469ad7,_0x3e2e7d,_0x56ecee){return function(_0x16a152){try{logger[_0xd574('0x8')](_0xd574('0x9'),_0x1be154,_0x469ad7[0x0]);var _0x1558b3={'closed':0x1,'closedAt':moment()[_0xd574('0xa')](_0xd574('0xb')),'closeReason':'system','disposition':_0x469ad7[0x0]};if(rpc[_0x56ecee['channel']+_0xd574('0xc')]){rpc[_0x56ecee[_0xd574('0xd')]+_0xd574('0xc')][_0xd574('0xe')](_0x56ecee[_0xd574('0xf')]['id'],_0x1558b3)[_0xd574('0x10')](function(_0x37061b){logger['info'](_0xd574('0x11'),_0x1be154,_0x56ecee[_0xd574('0xf')]['id']);})[_0xd574('0x12')](function(_0x6bbebf){logger[_0xd574('0x13')](_0xd574('0x14'),_0x1be154,JSON[_0xd574('0x15')](_0x6bbebf));})[_0xd574('0x16')](function(){_0x16a152[_0xd574('0x17')]();});}}catch(_0x460c2f){logger[_0xd574('0x13')](_0xd574('0x14'),_0x1be154,JSON['stringify'](_0x460c2f));_0x16a152[_0xd574('0x17')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index c33d663..5c5dd47 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x868a=['metadata','endConversation','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','info','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','fulfillment','speech','Message','result'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x868a,0x89));var _0xa868=function(_0xd61ec0,_0xd735d0){_0xd61ec0=_0xd61ec0-0x0;var _0x357ea2=_0x868a[_0xd61ec0];return _0x357ea2;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xa868('0x0'));var md5=require(_0xa868('0x1'));var utils=require(_0xa868('0x2'));var logger=require(_0xa868('0x3'))(_0xa868('0x4'));var rpc={'chatMessage':require(_0xa868('0x5')),'openchannelMessage':require(_0xa868('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xa868('0x7')),'faxMessage':require(_0xa868('0x8'))};exports['consequence']=function(_0x40d716,_0x57fd6c){return function(_0x237c93){try{if(!_['isNil'](this[_0xa868('0x9')][_0xa868('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x40d716,_0xa868('0xb'));return _0x237c93[_0xa868('0xc')]();}var _0x508510={'ContactId':this[_0xa868('0xd')]['id'],'sentAt':moment()['format'](_0xa868('0xe')),'direction':_0xa868('0xf')};var _0x138f6c=this[_0xa868('0x10')];if(_0x138f6c===_0xa868('0x11')){_0x508510[_0xa868('0x12')]=this[_0xa868('0x13')]['id'];}else{_0x508510[_[_0xa868('0x14')](_0x138f6c)+_0xa868('0x15')]=this[_0xa868('0x13')]['id'];}_0x508510[_['upperFirst'](_0x138f6c)+_0xa868('0x16')]=this[_0xa868('0x9')]['id'];if(this[_0xa868('0x9')][_0xa868('0x17')]){var _0x4fe816=_0x57fd6c[0x2];if(!_[_0xa868('0x18')](_0x4fe816)){_0x508510[_0xa868('0x19')]=utils[_0xa868('0x1a')](_0x4fe816,this);return rpc[_0x138f6c+'Message'][_0xa868('0x1b')](_0x508510)[_0xa868('0x1c')](function(_0x4b1775){logger[_0xa868('0x1d')](_0xa868('0x1e'),_0x40d716,_0x508510[_0xa868('0x19')]);})[_0xa868('0x1f')](function(_0x51a0db){logger[_0xa868('0x20')](_0xa868('0x1e'),_0x40d716,JSON[_0xa868('0x21')](_0x51a0db));})[_0xa868('0x22')](function(){logger[_0xa868('0x1d')](_0xa868('0x23'),_0x40d716);_0x237c93[_0xa868('0x24')]();});}else{logger[_0xa868('0x1d')](_0xa868('0x25'),_0x40d716);_0x237c93[_0xa868('0x24')]();}}else{var _0x947c8b=this;var _0x12acc7=apiai(_0x57fd6c[0x0],{'language':_0x57fd6c[0x1]||'en'});return _0x12acc7['textRequest'](this[_0xa868('0x26')][_0xa868('0x19')],{'sessionId':md5(this[_0xa868('0x9')]['id'])})[_0xa868('0x1c')](function(_0x2ecca5){_0x947c8b[_0xa868('0x19')]['dialogflow']=_0x2ecca5;_0x508510[_0xa868('0x19')]=_0x2ecca5['result'][_0xa868('0x27')][_0xa868('0x28')];return rpc[_0x138f6c+_0xa868('0x29')]['create'](_0x508510)[_0xa868('0x1c')](function(_0x439602){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x40d716,_0x508510[_0xa868('0x19')]);if(_0x2ecca5[_0xa868('0x2a')][_0xa868('0x2b')][_0xa868('0x2c')]){_0x237c93['next']();}else{_0x237c93[_0xa868('0x24')]();}})[_0xa868('0x1f')](function(_0xd29d76){logger['error'](_0xa868('0x1e'),_0x40d716,JSON[_0xa868('0x21')](_0xd29d76));_0x237c93['next']();});})['catch'](function(_0x3d9dae){logger[_0xa868('0x20')](_0xa868('0x1e'),_0x40d716,_0x3d9dae[_0xa868('0x26')]);_0x237c93[_0xa868('0xc')]();});}}catch(_0xcfa5fc){logger[_0xa868('0x20')](_0xa868('0x1e'),_0x40d716,JSON[_0xa868('0x21')](_0xcfa5fc));_0x237c93['stop']();}};}; \ No newline at end of file +var _0xc915=['textRequest','message','fulfillment','speech','create','metadata','catch','error','lodash','apiai-promise','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','account','AccountId','upperFirst','isEmpty','body','getMustacheRender','Message','then','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x332862,_0x374c82){var _0xa37e14=function(_0x24aa4f){while(--_0x24aa4f){_0x332862['push'](_0x332862['shift']());}};_0xa37e14(++_0x374c82);}(_0xc915,0xdf));var _0x5c91=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc915[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5c91('0x0'));var moment=require('moment');var apiai=require(_0x5c91('0x1'));var md5=require('md5');var utils=require(_0x5c91('0x2'));var logger=require(_0x5c91('0x3'))(_0x5c91('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5c91('0x5')),'mailMessage':require(_0x5c91('0x6')),'smsMessage':require(_0x5c91('0x7')),'faxMessage':require(_0x5c91('0x8'))};exports[_0x5c91('0x9')]=function(_0x44456d,_0x362bdf){return function(_0xaa233f){try{if(!_[_0x5c91('0xa')](this[_0x5c91('0xb')][_0x5c91('0xc')])){logger[_0x5c91('0xd')](_0x5c91('0xe'),_0x44456d,_0x5c91('0xf'));return _0xaa233f[_0x5c91('0x10')]();}var _0x6feb48={'ContactId':this[_0x5c91('0x11')]['id'],'sentAt':moment()[_0x5c91('0x12')](_0x5c91('0x13')),'direction':_0x5c91('0x14')};var _0x3f85f8=this[_0x5c91('0x15')];if(_0x3f85f8===_0x5c91('0x16')){_0x6feb48['ChatWebsiteId']=this[_0x5c91('0x17')]['id'];}else{_0x6feb48[_['upperFirst'](_0x3f85f8)+_0x5c91('0x18')]=this[_0x5c91('0x17')]['id'];}_0x6feb48[_[_0x5c91('0x19')](_0x3f85f8)+'InteractionId']=this['interaction']['id'];if(this[_0x5c91('0xb')]['created']){var _0x335faf=_0x362bdf[0x2];if(!_[_0x5c91('0x1a')](_0x335faf)){_0x6feb48[_0x5c91('0x1b')]=utils[_0x5c91('0x1c')](_0x335faf,this);return rpc[_0x3f85f8+_0x5c91('0x1d')]['create'](_0x6feb48)[_0x5c91('0x1e')](function(_0x2b6752){logger[_0x5c91('0xd')](_0x5c91('0xe'),_0x44456d,_0x6feb48[_0x5c91('0x1b')]);})['catch'](function(_0x27c66c){logger['error'](_0x5c91('0xe'),_0x44456d,JSON[_0x5c91('0x1f')](_0x27c66c));})['finally'](function(){logger[_0x5c91('0xd')](_0x5c91('0x20'),_0x44456d);_0xaa233f[_0x5c91('0x21')]();});}else{logger[_0x5c91('0xd')](_0x5c91('0x22'),_0x44456d);_0xaa233f[_0x5c91('0x21')]();}}else{var _0x1937b2=this;var _0x3b4bdb=apiai(_0x362bdf[0x0],{'language':_0x362bdf[0x1]||'en'});return _0x3b4bdb[_0x5c91('0x23')](this[_0x5c91('0x24')][_0x5c91('0x1b')],{'sessionId':md5(this[_0x5c91('0xb')]['id'])})['then'](function(_0x466296){_0x1937b2[_0x5c91('0x1b')]['dialogflow']=_0x466296;_0x6feb48[_0x5c91('0x1b')]=_0x466296['result'][_0x5c91('0x25')][_0x5c91('0x26')];return rpc[_0x3f85f8+'Message'][_0x5c91('0x27')](_0x6feb48)[_0x5c91('0x1e')](function(_0x3fe8af){logger[_0x5c91('0xd')](_0x5c91('0xe'),_0x44456d,_0x6feb48['body']);if(_0x466296['result'][_0x5c91('0x28')]['endConversation']){_0xaa233f[_0x5c91('0x10')]();}else{_0xaa233f['stop']();}})[_0x5c91('0x29')](function(_0x4fc70e){logger[_0x5c91('0x2a')]('[%s][DIALOGFLOW]\x20%s',_0x44456d,JSON[_0x5c91('0x1f')](_0x4fc70e));_0xaa233f[_0x5c91('0x10')]();});})['catch'](function(_0x40db40){logger[_0x5c91('0x2a')]('[%s][DIALOGFLOW]\x20%s',_0x44456d,_0x40db40[_0x5c91('0x24')]);_0xaa233f[_0x5c91('0x10')]();});}}catch(_0x4abc1c){logger[_0x5c91('0x2a')](_0x5c91('0xe'),_0x44456d,JSON['stringify'](_0x4abc1c));_0xaa233f[_0x5c91('0x21')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 19c2832..6fee41e 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7146=['priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','[%s][GOTOIF]\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','map','message','join'];(function(_0x3a63db,_0xf1bb2d){var _0x17961c=function(_0x256099){while(--_0x256099){_0x3a63db['push'](_0x3a63db['shift']());}};_0x17961c(++_0xf1bb2d);}(_0x7146,0xe0));var _0x6714=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x7146[_0x2891d1];return _0x486948;};'use strict';var schema=require(_0x6714('0x0'));var _=require('lodash');var htmlToText=require(_0x6714('0x1'));var utils=require(_0x6714('0x2'));var logger=require(_0x6714('0x3'))(_0x6714('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x6714('0x5')},'priorityTrue':{'type':_0x6714('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x6714('0x6'),'message':_0x6714('0x7')}});exports[_0x6714('0x8')]=function(_0x56fa2b,_0x2327dd){return function(_0x43cdc1){try{var _0x1d94f6={'condition':htmlToText[_0x6714('0x9')](utils[_0x6714('0xa')](_0x2327dd[0x0],this),{'wordwrap':![]})[_0x6714('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2327dd[0x1],'priorityFalse':_0x2327dd[0x2]};var _0x5fa91b=gotoif[_0x6714('0x0')](_0x1d94f6,{'typecast':!![]});if(_0x5fa91b[_0x6714('0xc')]){logger['error']('[%s][GOTOIF]\x20%s',_0x56fa2b,_[_0x6714('0xd')](_0x5fa91b,_0x6714('0xe'))[_0x6714('0xf')](',\x20'));_0x43cdc1['stop']();}else{try{var _0x458211=eval('('+_0x1d94f6['condition']+')');var _0x1767bb=_0x458211?_0x1d94f6[_0x6714('0x10')]:_0x1d94f6[_0x6714('0x11')];logger[_0x6714('0x12')](_0x6714('0x13'),_0x56fa2b,_0x1d94f6[_0x6714('0x14')],_0x458211,_0x1767bb||_0x6714('0x15'));if(_0x1767bb){var _0x3e6966=_[_0x6714('0x16')](_0x43cdc1[_0x6714('0x17')](),{'p':_0x1767bb});if(_0x3e6966>=0x0){logger[_0x6714('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x56fa2b,_0x1767bb||_0x6714('0x15'),_0x3e6966);_0x43cdc1[_0x6714('0x15')](_0x3e6966);}else{logger[_0x6714('0x12')](_0x6714('0x18'),_0x56fa2b,_0x1767bb||'next');_0x43cdc1['stop']();}}else{_0x43cdc1[_0x6714('0x15')]();}}catch(_0x1b58d0){logger[_0x6714('0x19')](_0x6714('0x1a'),_0x56fa2b,_0x1b58d0[_0x6714('0xe')]);_0x43cdc1[_0x6714('0x1b')]();}}}catch(_0x28344d){logger[_0x6714('0x19')](_0x6714('0x1c'),_0x56fa2b,JSON[_0x6714('0x1d')](_0x28344d));_0x43cdc1[_0x6714('0x1b')]();}};}; \ No newline at end of file +var _0x0234=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next'];(function(_0x3f51b5,_0x3fe3f3){var _0x138ef2=function(_0x3864f4){while(--_0x3864f4){_0x3f51b5['push'](_0x3f51b5['shift']());}};_0x138ef2(++_0x3fe3f3);}(_0x0234,0x131));var _0x4023=function(_0x6c40ba,_0x5e39fa){_0x6c40ba=_0x6c40ba-0x0;var _0x7a54dd=_0x0234[_0x6c40ba];return _0x7a54dd;};'use strict';var schema=require('validate');var _=require(_0x4023('0x0'));var htmlToText=require(_0x4023('0x1'));var utils=require(_0x4023('0x2'));var logger=require(_0x4023('0x3'))(_0x4023('0x4'));var gotoif=schema({'condition':{'type':_0x4023('0x5'),'required':!![],'message':_0x4023('0x6')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4023('0x7'),'message':_0x4023('0x8')}});exports[_0x4023('0x9')]=function(_0x55f2fb,_0x1077c8){return function(_0x31f821){try{var _0x41d109={'condition':htmlToText[_0x4023('0xa')](utils[_0x4023('0xb')](_0x1077c8[0x0],this),{'wordwrap':![]})[_0x4023('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1077c8[0x1],'priorityFalse':_0x1077c8[0x2]};var _0x19ead2=gotoif['validate'](_0x41d109,{'typecast':!![]});if(_0x19ead2[_0x4023('0xd')]){logger[_0x4023('0xe')](_0x4023('0xf'),_0x55f2fb,_[_0x4023('0x10')](_0x19ead2,_0x4023('0x11'))[_0x4023('0x12')](',\x20'));_0x31f821[_0x4023('0x13')]();}else{try{var _0x58b822=eval('('+_0x41d109[_0x4023('0x14')]+')');var _0x3e84cb=_0x58b822?_0x41d109[_0x4023('0x15')]:_0x41d109['priorityFalse'];logger[_0x4023('0x16')](_0x4023('0x17'),_0x55f2fb,_0x41d109['condition'],_0x58b822,_0x3e84cb||_0x4023('0x18'));if(_0x3e84cb){var _0x3b29c0=_['findIndex'](_0x31f821[_0x4023('0x19')](),{'p':_0x3e84cb});if(_0x3b29c0>=0x0){logger[_0x4023('0x16')](_0x4023('0x1a'),_0x55f2fb,_0x3e84cb||_0x4023('0x18'),_0x3b29c0);_0x31f821[_0x4023('0x18')](_0x3b29c0);}else{logger['info'](_0x4023('0x1b'),_0x55f2fb,_0x3e84cb||_0x4023('0x18'));_0x31f821[_0x4023('0x13')]();}}else{_0x31f821['next']();}}catch(_0x1f0f8d){logger['error'](_0x4023('0x1c'),_0x55f2fb,_0x1f0f8d[_0x4023('0x11')]);_0x31f821['stop']();}}}catch(_0x2b4eb2){logger[_0x4023('0xe')](_0x4023('0xf'),_0x55f2fb,JSON[_0x4023('0x1d')](_0x2b4eb2));_0x31f821['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 0fe6d66..5b1dbc0 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 _0x9204=['map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x5b601b,_0x2831bd){var _0xafef19=function(_0x34a0d1){while(--_0x34a0d1){_0x5b601b['push'](_0x5b601b['shift']());}};_0xafef19(++_0x2831bd);}(_0x9204,0x184));var _0x4920=function(_0x4b1eda,_0x1ca265){_0x4b1eda=_0x4b1eda-0x0;var _0x520e6b=_0x9204[_0x4b1eda];return _0x520e6b;};'use strict';var schema=require(_0x4920('0x0'));var _=require('lodash');var logger=require(_0x4920('0x1'))(_0x4920('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x4920('0x3')}});exports[_0x4920('0x4')]=function(_0x3ba952,_0x232548){return function(_0x216e51){try{var _0x554b1a={'priority':_0x232548[0x0]};var _0x3cf429=gotop[_0x4920('0x0')](_0x554b1a,{'typecast':!![]});if(_0x3cf429[_0x4920('0x5')]){logger[_0x4920('0x6')](_0x4920('0x7'),_0x3ba952,_[_0x4920('0x8')](_0x3cf429,_0x4920('0x9'))[_0x4920('0xa')](',\x20'));_0x216e51[_0x4920('0xb')]();}else{logger[_0x4920('0xc')](_0x4920('0xd'),_0x3ba952,_0x554b1a[_0x4920('0xe')]);if(_0x554b1a[_0x4920('0xe')]){var _0x3df914=_['findIndex'](_0x216e51[_0x4920('0xf')](),{'p':_0x554b1a['priority']});if(_0x3df914>=0x0){logger[_0x4920('0xc')](_0x4920('0x10'),_0x3ba952,_0x554b1a[_0x4920('0xe')]||_0x4920('0x11'),_0x3df914);_0x216e51[_0x4920('0x11')](_0x3df914);}else{logger[_0x4920('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3ba952,_0x554b1a[_0x4920('0xe')]||_0x4920('0x11'));_0x216e51[_0x4920('0xb')]();}}else{_0x216e51['next']();}}}catch(_0x3135b6){logger[_0x4920('0x6')](_0x4920('0x7'),_0x3ba952,JSON['stringify'](_0x3135b6));_0x216e51[_0x4920('0xb')]();}};}; \ No newline at end of file +var _0x1242=['length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence'];(function(_0x1de607,_0x17a75a){var _0x35c6f2=function(_0x104ecb){while(--_0x104ecb){_0x1de607['push'](_0x1de607['shift']());}};_0x35c6f2(++_0x17a75a);}(_0x1242,0x1dc));var _0x2124=function(_0x371833,_0x256a2e){_0x371833=_0x371833-0x0;var _0x2fea55=_0x1242[_0x371833];return _0x2fea55;};'use strict';var schema=require(_0x2124('0x0'));var _=require(_0x2124('0x1'));var logger=require(_0x2124('0x2'))(_0x2124('0x3'));var gotop=schema({'priority':{'type':_0x2124('0x4'),'required':!![],'message':_0x2124('0x5')}});exports[_0x2124('0x6')]=function(_0x23ce69,_0x2b7d84){return function(_0x3c8a73){try{var _0x3733be={'priority':_0x2b7d84[0x0]};var _0x4922c2=gotop[_0x2124('0x0')](_0x3733be,{'typecast':!![]});if(_0x4922c2[_0x2124('0x7')]){logger[_0x2124('0x8')](_0x2124('0x9'),_0x23ce69,_[_0x2124('0xa')](_0x4922c2,_0x2124('0xb'))[_0x2124('0xc')](',\x20'));_0x3c8a73[_0x2124('0xd')]();}else{logger[_0x2124('0xe')](_0x2124('0xf'),_0x23ce69,_0x3733be[_0x2124('0x10')]);if(_0x3733be['priority']){var _0x56cdf2=_[_0x2124('0x11')](_0x3c8a73[_0x2124('0x12')](),{'p':_0x3733be[_0x2124('0x10')]});if(_0x56cdf2>=0x0){logger['info'](_0x2124('0x13'),_0x23ce69,_0x3733be[_0x2124('0x10')]||'next',_0x56cdf2);_0x3c8a73[_0x2124('0x14')](_0x56cdf2);}else{logger['info'](_0x2124('0x15'),_0x23ce69,_0x3733be[_0x2124('0x10')]||'next');_0x3c8a73[_0x2124('0xd')]();}}else{_0x3c8a73[_0x2124('0x14')]();}}}catch(_0x26d4da){logger[_0x2124('0x8')](_0x2124('0x9'),_0x23ce69,JSON[_0x2124('0x16')](_0x26d4da));_0x3c8a73[_0x2124('0xd')]();}};}; \ 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 f90b034..234bfe9 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 _0xb435=['channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','stringify','stop','error','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','contact','chat','account','upperFirst'];(function(_0x37a858,_0x370bc4){var _0x55ae33=function(_0x317066){while(--_0x317066){_0x37a858['push'](_0x37a858['shift']());}};_0x55ae33(++_0x370bc4);}(_0xb435,0x1d9));var _0x5b43=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb435[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5b43('0x0'));var utils=require(_0x5b43('0x1'));var logger=require(_0x5b43('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5b43('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5b43('0x4')),'faxMessage':require('../../rpc/faxMessage')};exports[_0x5b43('0x5')]=function(_0x38eefb,_0xdc05ea){return function(_0x412b49){try{var _0x469d85={'body':utils['getMustacheRender'](_0xdc05ea[0x0],this),'ContactId':this[_0x5b43('0x6')]['id']};if(this['channel']===_0x5b43('0x7')){_0x469d85['ChatWebsiteId']=this[_0x5b43('0x8')]['id'];}else{_0x469d85[_[_0x5b43('0x9')](this[_0x5b43('0xa')])+_0x5b43('0xb')]=this['account']['id'];}_0x469d85[_[_0x5b43('0x9')](this[_0x5b43('0xa')])+_0x5b43('0xc')]=this[_0x5b43('0xd')]['id'];if(rpc[this[_0x5b43('0xa')]+_0x5b43('0xe')]){return rpc[this['channel']+_0x5b43('0xe')][_0x5b43('0xf')](_0x469d85)[_0x5b43('0x10')](function(_0x316fee){logger[_0x5b43('0x11')](_0x5b43('0x12'),_0x38eefb,_0x469d85['body']);_0x412b49[_0x5b43('0x13')]();})['catch'](function(_0x1eb3bd){logger['error']('[%s][MESSAGE]\x20%s',_0x38eefb,JSON[_0x5b43('0x14')](_0x1eb3bd));_0x412b49[_0x5b43('0x15')]();});}}catch(_0x40a864){logger[_0x5b43('0x16')]('[%s][MESSAGE]\x20%s',_0x38eefb,JSON[_0x5b43('0x14')](_0x40a864));_0x412b49[_0x5b43('0x15')]();}};}; \ No newline at end of file +var _0xb83c=['stringify','stop','[%s][MESSAGE]\x20%s','./utils','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','getMustacheRender','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','then','body','catch','error'];(function(_0x3a2f35,_0x35ce0f){var _0x299d65=function(_0x1bf4cf){while(--_0x1bf4cf){_0x3a2f35['push'](_0x3a2f35['shift']());}};_0x299d65(++_0x35ce0f);}(_0xb83c,0x81));var _0xcb83=function(_0x23834d,_0x84e30b){_0x23834d=_0x23834d-0x0;var _0x127c9a=_0xb83c[_0x23834d];return _0x127c9a;};'use strict';var _=require('lodash');var utils=require(_0xcb83('0x0'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xcb83('0x1')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xcb83('0x2')),'faxMessage':require(_0xcb83('0x3'))};exports['consequence']=function(_0x4fa5d9,_0x135596){return function(_0x4b25ea){try{var _0x21b3bd={'body':utils[_0xcb83('0x4')](_0x135596[0x0],this),'ContactId':this['contact']['id']};if(this[_0xcb83('0x5')]==='chat'){_0x21b3bd[_0xcb83('0x6')]=this[_0xcb83('0x7')]['id'];}else{_0x21b3bd[_[_0xcb83('0x8')](this[_0xcb83('0x5')])+_0xcb83('0x9')]=this[_0xcb83('0x7')]['id'];}_0x21b3bd[_['upperFirst'](this[_0xcb83('0x5')])+_0xcb83('0xa')]=this[_0xcb83('0xb')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0xcb83('0x5')]+_0xcb83('0xc')][_0xcb83('0xd')](_0x21b3bd)[_0xcb83('0xe')](function(_0x77d925){logger['info']('[%s][MESSAGE]\x20%s',_0x4fa5d9,_0x21b3bd[_0xcb83('0xf')]);_0x4b25ea['next']();})[_0xcb83('0x10')](function(_0x2d7fdf){logger[_0xcb83('0x11')]('[%s][MESSAGE]\x20%s',_0x4fa5d9,JSON[_0xcb83('0x12')](_0x2d7fdf));_0x4b25ea[_0xcb83('0x13')]();});}}catch(_0x206fe4){logger[_0xcb83('0x11')](_0xcb83('0x14'),_0x4fa5d9,JSON[_0xcb83('0x12')](_0x206fe4));_0x4b25ea[_0xcb83('0x13')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index 80b67ee..d5cf791 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 _0x27c5=['getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s'];(function(_0x344dc4,_0x50eb33){var _0x3e722f=function(_0x398e46){while(--_0x398e46){_0x344dc4['push'](_0x344dc4['shift']());}};_0x3e722f(++_0x50eb33);}(_0x27c5,0x67));var _0x527c=function(_0x5958d2,_0x550300){_0x5958d2=_0x5958d2-0x0;var _0x2a4809=_0x27c5[_0x5958d2];return _0x2a4809;};'use strict';var utils=require(_0x527c('0x0'));var logger=require(_0x527c('0x1'))(_0x527c('0x2'));exports['consequence']=function(_0x348e1c,_0x87c555){return function(_0x145173){try{logger[_0x527c('0x3')](_0x527c('0x4'),_0x348e1c,utils[_0x527c('0x5')](_0x87c555[0x0],this));_0x145173[_0x527c('0x6')]();}catch(_0x41cc93){logger['error'](_0x527c('0x4'),_0x348e1c,JSON[_0x527c('0x7')](_0x41cc93));_0x145173[_0x527c('0x8')]();}};}; \ No newline at end of file +var _0x4c74=['stop','./utils','../../../../config/logger','info','[%s][NOOP]\x20%s','next','error','stringify'];(function(_0x4ec9a1,_0x310853){var _0x3da0f9=function(_0x3cbbb9){while(--_0x3cbbb9){_0x4ec9a1['push'](_0x4ec9a1['shift']());}};_0x3da0f9(++_0x310853);}(_0x4c74,0xc1));var _0x44c7=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0x4c74[_0x5cb1af];return _0x8d7940;};'use strict';var utils=require(_0x44c7('0x0'));var logger=require(_0x44c7('0x1'))('routing');exports['consequence']=function(_0x466344,_0x2d8984){return function(_0x188974){try{logger[_0x44c7('0x2')](_0x44c7('0x3'),_0x466344,utils['getMustacheRender'](_0x2d8984[0x0],this));_0x188974[_0x44c7('0x4')]();}catch(_0x58e631){logger[_0x44c7('0x5')]('[%s][NOOP]\x20%s',_0x466344,JSON[_0x44c7('0x6')](_0x58e631));_0x188974[_0x44c7('0x7')]();}};}; \ 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 3997ee4..628af87 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 _0xb12d=['../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','Queues','createQueue','atimeout','qtimeout','rules','close','stop','[%s][QUEUE]\x20ROUTING\x20END','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport'];(function(_0x387369,_0x3de42a){var _0x338142=function(_0x5dd65c){while(--_0x5dd65c){_0x387369['push'](_0x387369['shift']());}};_0x338142(++_0x3de42a);}(_0xb12d,0xc7));var _0xdb12=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xb12d[_0x2142c8];return _0x4286e9;};'use strict';var schema=require(_0xdb12('0x0'));var _=require('lodash');var util=require(_0xdb12('0x1'));var seqqueue=require(_0xdb12('0x2'));var moment=require(_0xdb12('0x3'));var Redis=require('ioredis');var config=require(_0xdb12('0x4'));var logger=require(_0xdb12('0x5'))(_0xdb12('0x6'));var strategy=require('./strategy');config[_0xdb12('0x7')]=_[_0xdb12('0x8')](config[_0xdb12('0x7')],{'host':_0xdb12('0x9'),'port':0x18eb});var io=require(_0xdb12('0xa'))(new Redis(config[_0xdb12('0x7')]));var attributes=['id',_0xdb12('0xb'),_0xdb12('0xc'),_0xdb12('0xd'),_0xdb12('0xe'),'joinAt'];function emit(_0xd881ec,_0x2c2884,_0x40f982){io['to'](_0xd881ec)[_0xdb12('0xf')](_0x2c2884,_0x40f982);}function emitChannelQueueInteraction(_0x370c58,_0x2b9f2b,_0x5eeb03,_0x3d95fc,_0xa5cd33,_0xae6164,_0x3ca088,_0x2f05e5){_0x5eeb03[_0xdb12('0xb')]=_0x2f05e5;_0x5eeb03['queue']=_0x2b9f2b;_0x5eeb03[_0xdb12('0xc')]=_0x3d95fc;_0x5eeb03['id']=_0xa5cd33;if(_0xae6164){_0x3ca088[util['format'](_0xdb12('0x10'),_0x370c58)][_0xa5cd33]=_[_0xdb12('0x11')](_0x5eeb03,attributes);}else{delete _0x3ca088[util[_0xdb12('0x12')](_0xdb12('0x10'),_0x370c58)][_0xa5cd33];}emit(util[_0xdb12('0x12')](_0xdb12('0x13'),_0x370c58,_0x2b9f2b),util[_0xdb12('0x12')](_0xdb12('0x14'),_0x370c58,_0xae6164?_0xdb12('0x15'):_0xdb12('0x16')),_[_0xdb12('0x11')](_0x5eeb03,attributes));}var rpc={'openchannelQueueReport':require(_0xdb12('0x17')),'mailQueueReport':require(_0xdb12('0x18')),'chatQueueReport':require(_0xdb12('0x19')),'smsQueueReport':require(_0xdb12('0x1a')),'faxQueueReport':require(_0xdb12('0x1b'))};var queue=schema({'name':{'type':_0xdb12('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xdb12('0x1d')}});function startRouting(_0xcca1ee,_0x51e2a1,_0x3b7e9b,_0x10f515){if(_0xcca1ee&&_0x51e2a1&&_0x3b7e9b){_0x51e2a1[_0xdb12('0x1e')]+=0x1;var _0x2a00df={'uniqueid':_0xcca1ee,'from':_0x3b7e9b[_0xdb12('0x1f')]?_0x3b7e9b[_0xdb12('0x1f')][_0xdb12('0xe')]:'','joinAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'ContactId':_0x3b7e9b[_0xdb12('0x21')]?_0x3b7e9b[_0xdb12('0x21')]['id']:null,'ListId':_0x3b7e9b[_0xdb12('0x22')]?_0x3b7e9b[_0xdb12('0x22')]['id']:null};_0x2a00df[_[_0xdb12('0x23')](_0x3b7e9b[_0xdb12('0x24')])+'QueueId']=_0x51e2a1['id']||null;_0x2a00df[_['upperFirst'](_0x3b7e9b[_0xdb12('0x24')])+_0xdb12('0x25')]=_0x3b7e9b[_0xdb12('0x26')]?_0x3b7e9b[_0xdb12('0x26')]['id']:null;_0x2a00df[_[_0xdb12('0x23')](_0x3b7e9b['channel'])+_0xdb12('0x27')]=_0x3b7e9b[_0xdb12('0x28')]?_0x3b7e9b[_0xdb12('0x28')]['id']:null;_0x2a00df[_[_0xdb12('0x23')](_0x3b7e9b['channel'])+(_0x3b7e9b['channel']!==_0xdb12('0x29')?_0xdb12('0x2a'):_0xdb12('0x2b'))]=_0x3b7e9b[_0xdb12('0xc')]?_0x3b7e9b[_0xdb12('0xc')]['id']:null;logger['info'](util[_0xdb12('0x12')](_0xdb12('0x2c'),_0xcca1ee,_0x51e2a1[_0xdb12('0x2d')]));emitChannelQueueInteraction(_0x3b7e9b[_0xdb12('0x24')],_0x51e2a1[_0xdb12('0x2d')],_0x2a00df,_0x3b7e9b['account'][_0xdb12('0x2d')],_0x3b7e9b[_0xdb12('0x28')]['id'],!![],_0x10f515,_0x51e2a1['id']);if(rpc[_0x3b7e9b[_0xdb12('0x24')]+_0xdb12('0x2e')]){return rpc[_0x3b7e9b['channel']+_0xdb12('0x2e')][_0xdb12('0x2f')](_0x2a00df)[_0xdb12('0x30')](function(_0x3b19e3){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x1715ed,_0xa8eb57,_0x155a08,_0x453441){if(_0x1715ed&&_0xa8eb57){_0xa8eb57[_0xdb12('0x1e')]-=0x1;var _0x592d12={'leaveAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'acceptAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'reason':_0xdb12('0x31')};logger[_0xdb12('0x32')](util[_0xdb12('0x12')](_0xdb12('0x33'),_0x1715ed,_0xa8eb57[_0xdb12('0x2d')]));emitChannelQueueInteraction(_0x155a08[_0xdb12('0x24')],_0xa8eb57[_0xdb12('0x2d')],_0x155a08[_0xdb12('0x1f')],_0x155a08['account'][_0xdb12('0x2d')],_0x155a08[_0xdb12('0x28')]['id'],![],_0x453441,_0xa8eb57['id']);if(rpc[_0x155a08[_0xdb12('0x24')]+_0xdb12('0x2e')]){return rpc[_0x155a08['channel']+'QueueReport'][_0xdb12('0x34')](_0x1715ed,_0x592d12)[_0xdb12('0x30')](function(_0x2378d6){logger[_0xdb12('0x35')](_0xdb12('0x36'));});}}}function endRouting(_0x3efccc,_0x467548,_0x1073e0,_0x2f2e44){if(_0x3efccc&&_0x467548){_0x467548[_0xdb12('0x1e')]-=0x1;var _0x23ef5a={'leaveAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'exitAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'reason':_0xdb12('0x37')};logger[_0xdb12('0x32')](util[_0xdb12('0x12')](_0xdb12('0x38'),_0x3efccc,_0x467548[_0xdb12('0x2d')]));emitChannelQueueInteraction(_0x1073e0[_0xdb12('0x24')],_0x467548[_0xdb12('0x2d')],_0x1073e0[_0xdb12('0x1f')],_0x1073e0['account']['name'],_0x1073e0[_0xdb12('0x28')]['id'],![],_0x2f2e44);if(rpc[_0x1073e0[_0xdb12('0x24')]+_0xdb12('0x2e')]){return rpc[_0x1073e0[_0xdb12('0x24')]+'QueueReport']['update'](_0x3efccc,_0x23ef5a)['catch'](function(_0x4c4eb9){logger[_0xdb12('0x35')](_0xdb12('0x36'));});}}}function handleFindQueue(_0x1ba465){return function(_0x10ae5e){return _0x10ae5e[_0xdb12('0x2d')][_0xdb12('0x39')]()===_0x1ba465[_0xdb12('0x39')]();};}exports[_0xdb12('0x3a')]=function(_0x133489,_0x3205fb,_0x484b76,_0x5e0999){return function(_0x5b4c33){try{var _0xbbe0b8={'name':_0x3205fb[0x0],'timeout':_0x3205fb[0x1]};var _0x38df54=queue[_0xdb12('0x0')](_0xbbe0b8,{'typecast':!![]});if(_0x38df54[_0xdb12('0x3b')]){logger[_0xdb12('0x35')]('[%s][QUEUE]\x20%s',_0x133489,_[_0xdb12('0x3c')](_0x38df54,_0xdb12('0x28'))['join'](',\x20'));_0x5b4c33['stop']();}else{var _0x5a44d0=_['find'](_0x484b76[_0x5e0999[_0xdb12('0x24')]+_0xdb12('0x3d')],handleFindQueue(_0xbbe0b8[_0xdb12('0x2d')]));if(_0x5a44d0){startRouting(_0x133489,_0x5a44d0,_0x5e0999,_0x484b76);var _0x3faa6d=(_0x5a44d0['timeout']||0xa)*0x3e8;var _0x2a38be=(_0xbbe0b8[_0xdb12('0x37')]||0x14)*0x3e8;var _0x3f70e5,_0x338a27;if(_0x3faa6d>_0x2a38be){_0x2a38be=_0x3faa6d;}var _0x435b8a=seqqueue[_0xdb12('0x3e')](_0x3faa6d);_0x435b8a['id']=_0x133489;_0x435b8a[_0xdb12('0x3f')]=_0x3faa6d;_0x435b8a[_0xdb12('0x40')]=_0x2a38be;_0x435b8a[_0xdb12('0x24')]=_0x5e0999[_0xdb12('0x24')];_0x484b76[_0xdb12('0x41')][_0x133489]['on']('end',function(){stopRouting(_0x133489,_0x5a44d0,_0x5e0999,_0x484b76);_0x435b8a[_0xdb12('0x42')](!![]);clearTimeout(_0x3f70e5);_0x3f70e5=undefined;if(_0x484b76['rules'][_0x133489]){delete _0x484b76[_0xdb12('0x41')][_0x133489];}logger[_0xdb12('0x32')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x133489);_0x5b4c33[_0xdb12('0x43')]();});_0x3f70e5=setTimeout(function(){endRouting(_0x133489,_0x5a44d0,_0x5e0999,_0x484b76);clearTimeout(_0x3f70e5);_0x435b8a['close'](!![]);logger['info'](_0xdb12('0x44'),_0x133489);_0x5b4c33['next']();},_0x2a38be);switch(_0x5a44d0[_0xdb12('0x45')]){case'rrmemory':strategy[_0xdb12('0x46')](_0x435b8a,_0x5a44d0,_0x484b76,_0x5e0999);break;default:strategy['beepall'](_0x435b8a,_0x5a44d0,_0x484b76,_0x5e0999);}}else{logger[_0xdb12('0x35')](_0xdb12('0x47'),_0x133489,_0xbbe0b8[_0xdb12('0x2d')]);_0x5b4c33['stop']();}}}catch(_0x165899){console[_0xdb12('0x48')](_0x165899);logger[_0xdb12('0x35')](_0xdb12('0x49'),_0x133489,_0x165899[_0xdb12('0x4a')]);_0x5b4c33['stop']();}};}; \ No newline at end of file +var _0x944d=['localhost','queue_id','account','queue','from','joinAt','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','find','createQueue','qtimeout','end','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults'];(function(_0x136a60,_0x5bb51b){var _0xc72bc2=function(_0xdc9201){while(--_0xdc9201){_0x136a60['push'](_0x136a60['shift']());}};_0xc72bc2(++_0x5bb51b);}(_0x944d,0x17f));var _0xd944=function(_0x74ac39,_0x16122a){_0x74ac39=_0x74ac39-0x0;var _0x20633a=_0x944d[_0x74ac39];return _0x20633a;};'use strict';var schema=require(_0xd944('0x0'));var _=require(_0xd944('0x1'));var util=require(_0xd944('0x2'));var seqqueue=require(_0xd944('0x3'));var moment=require(_0xd944('0x4'));var Redis=require(_0xd944('0x5'));var config=require(_0xd944('0x6'));var logger=require(_0xd944('0x7'))(_0xd944('0x8'));var strategy=require(_0xd944('0x9'));config[_0xd944('0xa')]=_[_0xd944('0xb')](config['redis'],{'host':_0xd944('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xd944('0xd'),_0xd944('0xe'),_0xd944('0xf'),_0xd944('0x10'),_0xd944('0x11')];function emit(_0x415ce6,_0x368f4f,_0x28ed93){io['to'](_0x415ce6)[_0xd944('0x12')](_0x368f4f,_0x28ed93);}function emitChannelQueueInteraction(_0x1a3192,_0x536fcf,_0x3ea2b9,_0x52e3d7,_0x3f0c56,_0x37b190,_0x4e3da9,_0x56254f){_0x3ea2b9[_0xd944('0xd')]=_0x56254f;_0x3ea2b9[_0xd944('0xf')]=_0x536fcf;_0x3ea2b9[_0xd944('0xe')]=_0x52e3d7;_0x3ea2b9['id']=_0x3f0c56;if(_0x37b190){_0x4e3da9[util['format'](_0xd944('0x13'),_0x1a3192)][_0x3f0c56]=_[_0xd944('0x14')](_0x3ea2b9,attributes);}else{delete _0x4e3da9[util['format'](_0xd944('0x13'),_0x1a3192)][_0x3f0c56];}emit(util[_0xd944('0x15')](_0xd944('0x16'),_0x1a3192,_0x536fcf),util[_0xd944('0x15')](_0xd944('0x17'),_0x1a3192,_0x37b190?_0xd944('0x18'):_0xd944('0x19')),_[_0xd944('0x14')](_0x3ea2b9,attributes));}var rpc={'openchannelQueueReport':require(_0xd944('0x1a')),'mailQueueReport':require(_0xd944('0x1b')),'chatQueueReport':require(_0xd944('0x1c')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0xd944('0x1d'),'required':!![],'message':_0xd944('0x1e')},'timeout':{'type':_0xd944('0x1f'),'message':_0xd944('0x20')}});function startRouting(_0x818dd8,_0xb0dfe0,_0x35c2c1,_0x5acf1f){if(_0x818dd8&&_0xb0dfe0&&_0x35c2c1){_0xb0dfe0[_0xd944('0x21')]+=0x1;var _0x30eed8={'uniqueid':_0x818dd8,'from':_0x35c2c1[_0xd944('0x22')]?_0x35c2c1[_0xd944('0x22')][_0xd944('0x10')]:'','joinAt':moment()[_0xd944('0x15')](_0xd944('0x23')),'ContactId':_0x35c2c1['contact']?_0x35c2c1[_0xd944('0x24')]['id']:null,'ListId':_0x35c2c1['list']?_0x35c2c1[_0xd944('0x25')]['id']:null};_0x30eed8[_[_0xd944('0x26')](_0x35c2c1['channel'])+_0xd944('0x27')]=_0xb0dfe0['id']||null;_0x30eed8[_['upperFirst'](_0x35c2c1[_0xd944('0x28')])+_0xd944('0x29')]=_0x35c2c1[_0xd944('0x2a')]?_0x35c2c1['interaction']['id']:null;_0x30eed8[_[_0xd944('0x26')](_0x35c2c1[_0xd944('0x28')])+_0xd944('0x2b')]=_0x35c2c1['message']?_0x35c2c1[_0xd944('0x2c')]['id']:null;_0x30eed8[_[_0xd944('0x26')](_0x35c2c1['channel'])+(_0x35c2c1[_0xd944('0x28')]!==_0xd944('0x2d')?_0xd944('0x2e'):'WebsiteId')]=_0x35c2c1[_0xd944('0xe')]?_0x35c2c1[_0xd944('0xe')]['id']:null;logger[_0xd944('0x2f')](util[_0xd944('0x15')](_0xd944('0x30'),_0x818dd8,_0xb0dfe0[_0xd944('0x31')]));emitChannelQueueInteraction(_0x35c2c1['channel'],_0xb0dfe0[_0xd944('0x31')],_0x30eed8,_0x35c2c1['account'][_0xd944('0x31')],_0x35c2c1[_0xd944('0x2c')]['id'],!![],_0x5acf1f,_0xb0dfe0['id']);if(rpc[_0x35c2c1[_0xd944('0x28')]+_0xd944('0x32')]){return rpc[_0x35c2c1[_0xd944('0x28')]+'QueueReport']['create'](_0x30eed8)[_0xd944('0x33')](function(_0xae8005){logger[_0xd944('0x34')](_0xd944('0x35'));});}}}function stopRouting(_0x32c0cc,_0x504276,_0x2c50de,_0x17d9e3){if(_0x32c0cc&&_0x504276){_0x504276['waiting']-=0x1;var _0x37fe0f={'leaveAt':moment()[_0xd944('0x15')](_0xd944('0x23')),'acceptAt':moment()[_0xd944('0x15')](_0xd944('0x23')),'reason':_0xd944('0x36')};logger[_0xd944('0x2f')](util[_0xd944('0x15')](_0xd944('0x37'),_0x32c0cc,_0x504276[_0xd944('0x31')]));emitChannelQueueInteraction(_0x2c50de[_0xd944('0x28')],_0x504276['name'],_0x2c50de['body'],_0x2c50de[_0xd944('0xe')][_0xd944('0x31')],_0x2c50de[_0xd944('0x2c')]['id'],![],_0x17d9e3,_0x504276['id']);if(rpc[_0x2c50de['channel']+'QueueReport']){return rpc[_0x2c50de[_0xd944('0x28')]+_0xd944('0x32')]['update'](_0x32c0cc,_0x37fe0f)[_0xd944('0x33')](function(_0xc197e0){logger[_0xd944('0x34')](_0xd944('0x38'));});}}}function endRouting(_0x37f306,_0x150869,_0x3532ab,_0x1edaf7){if(_0x37f306&&_0x150869){_0x150869[_0xd944('0x21')]-=0x1;var _0x339f03={'leaveAt':moment()[_0xd944('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0xd944('0x23')),'reason':_0xd944('0x39')};logger[_0xd944('0x2f')](util[_0xd944('0x15')](_0xd944('0x3a'),_0x37f306,_0x150869['name']));emitChannelQueueInteraction(_0x3532ab[_0xd944('0x28')],_0x150869[_0xd944('0x31')],_0x3532ab['body'],_0x3532ab[_0xd944('0xe')][_0xd944('0x31')],_0x3532ab[_0xd944('0x2c')]['id'],![],_0x1edaf7);if(rpc[_0x3532ab['channel']+_0xd944('0x32')]){return rpc[_0x3532ab[_0xd944('0x28')]+_0xd944('0x32')]['update'](_0x37f306,_0x339f03)['catch'](function(_0x39112c){logger[_0xd944('0x34')](_0xd944('0x38'));});}}}function handleFindQueue(_0x27386b){return function(_0x5d94d4){return _0x5d94d4[_0xd944('0x31')][_0xd944('0x3b')]()===_0x27386b['toLowerCase']();};}exports['consequence']=function(_0x31d386,_0x3f2f87,_0x49837c,_0x3f7e2b){return function(_0x548537){try{var _0x316e9a={'name':_0x3f2f87[0x0],'timeout':_0x3f2f87[0x1]};var _0x342945=queue[_0xd944('0x0')](_0x316e9a,{'typecast':!![]});if(_0x342945[_0xd944('0x3c')]){logger[_0xd944('0x34')](_0xd944('0x3d'),_0x31d386,_[_0xd944('0x3e')](_0x342945,_0xd944('0x2c'))[_0xd944('0x3f')](',\x20'));_0x548537[_0xd944('0x40')]();}else{var _0x3e9e66=_[_0xd944('0x41')](_0x49837c[_0x3f7e2b[_0xd944('0x28')]+'Queues'],handleFindQueue(_0x316e9a[_0xd944('0x31')]));if(_0x3e9e66){startRouting(_0x31d386,_0x3e9e66,_0x3f7e2b,_0x49837c);var _0x28833d=(_0x3e9e66[_0xd944('0x39')]||0xa)*0x3e8;var _0x46de9a=(_0x316e9a[_0xd944('0x39')]||0x14)*0x3e8;var _0x84de56,_0x32e4d3;if(_0x28833d>_0x46de9a){_0x46de9a=_0x28833d;}var _0x1fafc6=seqqueue[_0xd944('0x42')](_0x28833d);_0x1fafc6['id']=_0x31d386;_0x1fafc6['atimeout']=_0x28833d;_0x1fafc6[_0xd944('0x43')]=_0x46de9a;_0x1fafc6[_0xd944('0x28')]=_0x3f7e2b[_0xd944('0x28')];_0x49837c['rules'][_0x31d386]['on'](_0xd944('0x44'),function(){stopRouting(_0x31d386,_0x3e9e66,_0x3f7e2b,_0x49837c);_0x1fafc6['close'](!![]);clearTimeout(_0x84de56);_0x84de56=undefined;if(_0x49837c[_0xd944('0x45')][_0x31d386]){delete _0x49837c[_0xd944('0x45')][_0x31d386];}logger[_0xd944('0x2f')](_0xd944('0x46'),_0x31d386);_0x548537[_0xd944('0x40')]();});_0x84de56=setTimeout(function(){endRouting(_0x31d386,_0x3e9e66,_0x3f7e2b,_0x49837c);clearTimeout(_0x84de56);_0x1fafc6[_0xd944('0x47')](!![]);logger[_0xd944('0x2f')](_0xd944('0x48'),_0x31d386);_0x548537[_0xd944('0x49')]();},_0x46de9a);switch(_0x3e9e66[_0xd944('0x4a')]){case _0xd944('0x4b'):strategy[_0xd944('0x4b')](_0x1fafc6,_0x3e9e66,_0x49837c,_0x3f7e2b);break;default:strategy['beepall'](_0x1fafc6,_0x3e9e66,_0x49837c,_0x3f7e2b);}}else{logger[_0xd944('0x34')](_0xd944('0x4c'),_0x31d386,_0x316e9a[_0xd944('0x31')]);_0x548537[_0xd944('0x40')]();}}}catch(_0x5290b3){console[_0xd944('0x4d')](_0x5290b3);logger[_0xd944('0x34')](_0xd944('0x3d'),_0x31d386,_0x5290b3[_0xd944('0x4e')]);_0x548537[_0xd944('0x40')]();}};}; \ 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 d0f75ff..825575f 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 _0xd421=['RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','handleRun','bind','squeue','timeout','handleTimeout','drained','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','writeLog'];(function(_0x44a274,_0x17b558){var _0x582fdc=function(_0x2f006a){while(--_0x2f006a){_0x44a274['push'](_0x44a274['shift']());}};_0x582fdc(++_0x17b558);}(_0xd421,0x195));var _0x1d42=function(_0xc75d79,_0x54fcb0){_0xc75d79=_0xc75d79-0x0;var _0x1dcd9b=_0xd421[_0xc75d79];return _0x1dcd9b;};'use strict';var _=require(_0x1d42('0x0'));var uuid=require(_0x1d42('0x1'));var util=require(_0x1d42('0x2'));var logger=require('../../../../../config/logger')(_0x1d42('0x3'));var Agent=function(_0x398386,_0x5a9f13,_0x3f5c33,_0x111fbc){this[_0x1d42('0x4')]=uuid['v4']();this['squeue']=_0x398386;this[_0x1d42('0x5')]=_0x5a9f13;this[_0x1d42('0x6')]=_0x3f5c33;this['routing']=_0x111fbc;this['squeue']['push'](this[_0x1d42('0x7')][_0x1d42('0x8')](this),this['handleTimeout'][_0x1d42('0x8')](this));this[_0x1d42('0x9')]['on'](_0x1d42('0xa'),this[_0x1d42('0xb')][_0x1d42('0x8')](this));this[_0x1d42('0x9')]['on'](_0x1d42('0xc'),this['handleDrained'][_0x1d42('0x8')](this));};Agent[_0x1d42('0xd')]['push']=function(){this[_0x1d42('0x9')][_0x1d42('0xe')](this[_0x1d42('0x7')][_0x1d42('0x8')](this),this[_0x1d42('0xb')]['bind'](this));};Agent[_0x1d42('0xd')][_0x1d42('0xf')]=function(){this['handleTimeout'](!![]);};Agent[_0x1d42('0xd')][_0x1d42('0x7')]=function(_0x3ef0b6){logger[_0x1d42('0x10')](_0x1d42('0x11'),this[_0x1d42('0x9')]['id'],this[_0x1d42('0x5')]['id']);if(_[_0x1d42('0x12')](this['realtime'][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']])){logger[_0x1d42('0x10')](_0x1d42('0x14'),this[_0x1d42('0x9')]['id'],this['agent']['id']);setTimeout(this[_0x1d42('0xe')][_0x1d42('0x8')](this),0x3e8);}else{if(this[_0x1d42('0x3')]['forcedOwnership']||util['isAgentAvailable'](this['squeue']['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']],this['squeue'][_0x1d42('0x15')],![])){this['realtime'][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']][_0x1d42('0x16')]=!![];this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']]['busyQueue']=undefined;util['showNotification'](this[_0x1d42('0x4')],this[_0x1d42('0x9')]['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']],null,this['routing']);util[_0x1d42('0x17')](this['squeue']['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']],_0x1d42('0x18')+(this[_0x1d42('0x3')]['forcedOwnership']?_0x1d42('0x19'):''));}else{logger[_0x1d42('0x10')](_0x1d42('0x1a'),this[_0x1d42('0x9')]['id'],this[_0x1d42('0x5')]['id']);setTimeout(this[_0x1d42('0xe')]['bind'](this),0x3e8);}}};Agent[_0x1d42('0xd')][_0x1d42('0xb')]=function(_0x1aea27){if(_['isNil'](this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x1d42('0x5')]['id']);}else{logger[_0x1d42('0x10')](_0x1d42('0x1b'),this[_0x1d42('0x9')]['id'],this[_0x1d42('0x5')]['id']);util[_0x1d42('0x1c')](this['notificationId'],this[_0x1d42('0x9')]['id'],this['realtime'][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']],null,this[_0x1d42('0x3')]);this['realtime']['agents'][this[_0x1d42('0x5')]['id']]['busy']=![];this[_0x1d42('0x6')]['agents'][this['agent']['id']][_0x1d42('0x1d')]=undefined;util[_0x1d42('0x17')](this[_0x1d42('0x9')]['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']],_0x1aea27?_0x1d42('0x1e'):_0x1d42('0x1f'));}if(!_0x1aea27){setTimeout(this['push'][_0x1d42('0x8')](this),0x3e8);}};function agent(_0x341c5c,_0x1e3396,_0x1088b8,_0x320248){return new Agent(_0x341c5c,_0x1e3396,_0x1088b8,_0x320248);}module[_0x1d42('0x20')]=agent; \ No newline at end of file +var _0x295f=['handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','realtime','forcedOwnership','isAgentAvailable','agents','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','handleRun','bind','handleTimeout','timeout'];(function(_0x3b45f8,_0x5e496e){var _0x1ef386=function(_0x431f7a){while(--_0x431f7a){_0x3b45f8['push'](_0x3b45f8['shift']());}};_0x1ef386(++_0x5e496e);}(_0x295f,0x104));var _0xf295=function(_0x2d71a3,_0x51d299){_0x2d71a3=_0x2d71a3-0x0;var _0x4a84e6=_0x295f[_0x2d71a3];return _0x4a84e6;};'use strict';var _=require(_0xf295('0x0'));var uuid=require(_0xf295('0x1'));var util=require(_0xf295('0x2'));var logger=require(_0xf295('0x3'))(_0xf295('0x4'));var Agent=function(_0x2f3de3,_0x222662,_0x3bc459,_0x384a4e){this[_0xf295('0x5')]=uuid['v4']();this[_0xf295('0x6')]=_0x2f3de3;this[_0xf295('0x7')]=_0x222662;this['realtime']=_0x3bc459;this[_0xf295('0x4')]=_0x384a4e;this[_0xf295('0x6')]['push'](this[_0xf295('0x8')][_0xf295('0x9')](this),this[_0xf295('0xa')][_0xf295('0x9')](this));this[_0xf295('0x6')]['on'](_0xf295('0xb'),this['handleTimeout'][_0xf295('0x9')](this));this['squeue']['on']('drained',this[_0xf295('0xc')][_0xf295('0x9')](this));};Agent[_0xf295('0xd')]['push']=function(){this['squeue'][_0xf295('0xe')](this[_0xf295('0x8')][_0xf295('0x9')](this),this['handleTimeout'][_0xf295('0x9')](this));};Agent['prototype']['handleDrained']=function(){this[_0xf295('0xa')](!![]);};Agent[_0xf295('0xd')][_0xf295('0x8')]=function(_0x4d499a){logger[_0xf295('0xf')](_0xf295('0x10'),this['squeue']['id'],this[_0xf295('0x7')]['id']);if(_['isNil'](this[_0xf295('0x11')]['agents'][this[_0xf295('0x7')]['id']])){logger[_0xf295('0xf')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xf295('0x6')]['id'],this['agent']['id']);setTimeout(this[_0xf295('0xe')][_0xf295('0x9')](this),0x3e8);}else{if(this[_0xf295('0x4')][_0xf295('0x12')]||util[_0xf295('0x13')](this[_0xf295('0x6')]['id'],this['realtime'][_0xf295('0x14')][this[_0xf295('0x7')]['id']],this['squeue'][_0xf295('0x15')],![])){this[_0xf295('0x11')]['agents'][this[_0xf295('0x7')]['id']][_0xf295('0x16')]=!![];this[_0xf295('0x11')]['agents'][this[_0xf295('0x7')]['id']][_0xf295('0x17')]=undefined;util[_0xf295('0x18')](this[_0xf295('0x5')],this[_0xf295('0x6')]['id'],this['realtime'][_0xf295('0x14')][this[_0xf295('0x7')]['id']],null,this['routing']);util[_0xf295('0x19')](this['squeue']['id'],this[_0xf295('0x11')][_0xf295('0x14')][this[_0xf295('0x7')]['id']],_0xf295('0x1a')+(this['routing']['forcedOwnership']?_0xf295('0x1b'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xf295('0x6')]['id'],this[_0xf295('0x7')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}}};Agent[_0xf295('0xd')][_0xf295('0xa')]=function(_0x5dde91){if(_[_0xf295('0x1c')](this[_0xf295('0x11')][_0xf295('0x14')][this[_0xf295('0x7')]['id']])){return logger[_0xf295('0xf')](_0xf295('0x1d'),this[_0xf295('0x6')]['id'],this[_0xf295('0x7')]['id']);}else{logger['info'](_0xf295('0x1e'),this['squeue']['id'],this[_0xf295('0x7')]['id']);util[_0xf295('0x1f')](this[_0xf295('0x5')],this['squeue']['id'],this['realtime'][_0xf295('0x14')][this[_0xf295('0x7')]['id']],null,this[_0xf295('0x4')]);this[_0xf295('0x11')][_0xf295('0x14')][this['agent']['id']][_0xf295('0x16')]=![];this[_0xf295('0x11')][_0xf295('0x14')][this[_0xf295('0x7')]['id']][_0xf295('0x17')]=undefined;util[_0xf295('0x19')](this[_0xf295('0x6')]['id'],this[_0xf295('0x11')]['agents'][this[_0xf295('0x7')]['id']],_0x5dde91?_0xf295('0x20'):_0xf295('0x21'));}if(!_0x5dde91){setTimeout(this[_0xf295('0xe')][_0xf295('0x9')](this),0x3e8);}};function agent(_0x1ca12b,_0x15f0e1,_0x1385a3,_0x411aad){return new Agent(_0x1ca12b,_0x15f0e1,_0x1385a3,_0x411aad);}module['exports']=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 07f905b..be70e3f 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 _0xee7d=['notificationId','squeue','queue','realtime','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents','info','isAgentAvailable','channel','busy','busyQueue','name','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','writeLog','STOP','TIMEOUT','exports','lodash','../../../../../config/logger'];(function(_0x5eb6ca,_0x2356e4){var _0x194fa0=function(_0xebe896){while(--_0xebe896){_0x5eb6ca['push'](_0x5eb6ca['shift']());}};_0x194fa0(++_0x2356e4);}(_0xee7d,0xc4));var _0xdee7=function(_0x482a73,_0x294046){_0x482a73=_0x482a73-0x0;var _0x39b97f=_0xee7d[_0x482a73];return _0x39b97f;};'use strict';var _=require(_0xdee7('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0xdee7('0x1'))('routing');var Beepall=function(_0x490630,_0x326cdc,_0x1e349b,_0x2d45e5){this[_0xdee7('0x2')]=uuid['v4']();this[_0xdee7('0x3')]=_0x490630;this[_0xdee7('0x4')]=_0x326cdc;this[_0xdee7('0x5')]=_0x1e349b;this[_0xdee7('0x6')]=_0x2d45e5;this[_0xdee7('0x3')][_0xdee7('0x7')](this[_0xdee7('0x8')][_0xdee7('0x9')](this),this[_0xdee7('0xa')][_0xdee7('0x9')](this));this[_0xdee7('0x3')]['on'](_0xdee7('0xb'),this[_0xdee7('0xa')][_0xdee7('0x9')](this));this['squeue']['on'](_0xdee7('0xc'),this[_0xdee7('0xd')][_0xdee7('0x9')](this));};Beepall[_0xdee7('0xe')][_0xdee7('0x7')]=function(){this[_0xdee7('0x3')][_0xdee7('0x7')](this[_0xdee7('0x8')][_0xdee7('0x9')](this),this[_0xdee7('0xa')][_0xdee7('0x9')](this));};Beepall[_0xdee7('0xe')][_0xdee7('0xd')]=function(_0x1b6cb0){this[_0xdee7('0xa')](!![]);};Beepall[_0xdee7('0xe')][_0xdee7('0x8')]=function(_0x3559ef){var _0x28e392=!![];if(!_['isNil'](this[_0xdee7('0x4')])&&!_[_0xdee7('0xf')](this[_0xdee7('0x4')][_0xdee7('0x10')])&&this['queue']['Agents'][_0xdee7('0x11')]>0x0){for(var _0x318405=0x0,_0x3a1147;_0x3184050x0){for(var _0x49e5d6=0x0,_0x53179a;_0x49e5d60x0&&_0x5c7899[_0x5d978d+'CurrentCapacity']>=_0x5c7899[_0x5d978d+_0x60da('0x20')]){writeLog(_0x549ab0,_0x5c7899,_0x5d978d[_0x60da('0x22')]()+_0x60da('0x23'));return![];}}return!![];};exports[_0x60da('0x24')]=function(_0x469ce7,_0x4117d9,_0x2006d7,_0x146084,_0x88f1f2){return sendNotification(!![],_0x469ce7,_0x4117d9,_0x2006d7,_0x146084,_0x88f1f2);};exports[_0x60da('0x25')]=function(_0x23e53f,_0x42f49e,_0x525076,_0xa9e849,_0x5938e5){return sendNotification(![],_0x23e53f,_0x42f49e,_0x525076,_0xa9e849,_0x5938e5);};exports[_0x60da('0x26')]=writeLog; \ No newline at end of file +var _0xeb43=['error','[%s][QUEUE]\x20%s','message','user:%s','notification:%s','info','busy','BUSY','online','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','writeLog','lodash','util','../utils','ioredis','routing','redis','localhost','socket.io-emitter','format','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate'];(function(_0x51a4cf,_0x427ea9){var _0x273a92=function(_0xa15eaa){while(--_0xa15eaa){_0x51a4cf['push'](_0x51a4cf['shift']());}};_0x273a92(++_0x427ea9);}(_0xeb43,0x149));var _0x3eb4=function(_0x229a9d,_0x4d3229){_0x229a9d=_0x229a9d-0x0;var _0x5bd600=_0xeb43[_0x229a9d];return _0x5bd600;};'use strict';var _=require(_0x3eb4('0x0'));var util=require(_0x3eb4('0x1'));var utils=require(_0x3eb4('0x2'));var Mustache=require('mustache');var Redis=require(_0x3eb4('0x3'));var config=require('../../../../../config/environment');var logger=require('../../../../../config/logger')(_0x3eb4('0x4'));config[_0x3eb4('0x5')]=_['defaults'](config['redis'],{'host':_0x3eb4('0x6'),'port':0x18eb});var io=require(_0x3eb4('0x7'))(new Redis(config['redis']));function emit(_0x45b9b8,_0x5d8f80,_0x14f2c3){io['to'](_0x45b9b8)['emit'](_0x5d8f80,_0x14f2c3);}function sendNotification(_0x43570f,_0xed71b1,_0x15bc94,_0x10f337,_0xde2fac,_0x5cb468){io['to'](util[_0x3eb4('0x8')]('user:%s',_0x10f337[_0x3eb4('0x9')]))[_0x3eb4('0xa')](_0x3eb4('0xb'),_0x10f337);var _0x35cb9b=_0x5cb468||{};var _0x59ed5d=_0x15bc94[_0x3eb4('0xc')]('.');var _0x1f5fc9={'uniqueid':_0xed71b1,'channel':_0x59ed5d[0x0],'id':_0x59ed5d[0x1],'title':_0x59ed5d[0x0]+_0x3eb4('0xd'),'interactionId':_0x59ed5d[0x2],'queue':_0xde2fac?_0xde2fac[_0x3eb4('0x9')]:null,'sound':_0x35cb9b[_0x3eb4('0xe')][_0x3eb4('0xf')],'shake':_0x35cb9b['account'][_0x3eb4('0x10')]};try{if(!_0x35cb9b['body']){_0x35cb9b['body']={};}if(_0xde2fac){_0x35cb9b[_0x3eb4('0x11')]['queue']=_0xde2fac;}else if(_0x35cb9b[_0x3eb4('0x11')][_0x3eb4('0x12')]){delete _0x35cb9b[_0x3eb4('0x11')][_0x3eb4('0x12')];}_0x1f5fc9[_0x3eb4('0x13')]=utils[_0x3eb4('0x14')](_0x35cb9b[_0x3eb4('0xe')][_0x3eb4('0x15')],_0x35cb9b);}catch(_0x150325){_0x1f5fc9[_0x3eb4('0x13')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x3eb4('0x16')](util[_0x3eb4('0x8')](_0x3eb4('0x17'),_0xed71b1,_0x150325[_0x3eb4('0x18')]));}io['to'](util[_0x3eb4('0x8')](_0x3eb4('0x19'),_0x10f337[_0x3eb4('0x9')]))[_0x3eb4('0xa')](util[_0x3eb4('0x8')](_0x3eb4('0x1a'),_0x43570f?'save':'remove'),_0x1f5fc9);}function writeLog(_0x276934,_0x18675f,_0x25ee8d){return logger[_0x3eb4('0x1b')](util[_0x3eb4('0x8')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x276934,_0x18675f[_0x3eb4('0x9')],_0x25ee8d));}exports['isAgentAvailable']=function(_0x15d87d,_0x504467,_0x2edf82,_0x425457){if(_0x504467[_0x3eb4('0x1c')]){writeLog(_0x15d87d,_0x504467,_0x3eb4('0x1d'));return![];}if(!_0x504467[_0x3eb4('0x1e')]){writeLog(_0x15d87d,_0x504467,'OFFLINE');return![];}if(_0x504467[_0x2edf82+_0x3eb4('0x1f')]){writeLog(_0x15d87d,_0x504467,_0x3eb4('0x20'));return![];}if(_0x425457&&_0x504467['hasOwnProperty'](_0x2edf82+_0x3eb4('0x21'))&&_0x504467[_0x3eb4('0x22')](_0x2edf82+_0x3eb4('0x23'))){if(_0x504467[_0x2edf82+_0x3eb4('0x21')]>0x0&&_0x504467[_0x2edf82+'CurrentCapacity']>=_0x504467[_0x2edf82+_0x3eb4('0x21')]){writeLog(_0x15d87d,_0x504467,_0x2edf82[_0x3eb4('0x24')]()+_0x3eb4('0x25'));return![];}}return!![];};exports['showNotification']=function(_0x50684f,_0x283b99,_0x281a5a,_0x3fd1a7,_0x51ef72){return sendNotification(!![],_0x50684f,_0x283b99,_0x281a5a,_0x3fd1a7,_0x51ef72);};exports['hideNotification']=function(_0x3fd753,_0x5ce230,_0x225933,_0x586919,_0x5d3e21){return sendNotification(![],_0x3fd753,_0x5ce230,_0x225933,_0x586919,_0x5d3e21);};exports[_0x3eb4('0x26')]=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 4873f77..8d07b4a 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 _0x7cfb=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','validate','shelljs','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message'];(function(_0x1a58fc,_0x457974){var _0xc96f26=function(_0x1b866c){while(--_0x1b866c){_0x1a58fc['push'](_0x1a58fc['shift']());}};_0xc96f26(++_0x457974);}(_0x7cfb,0x1bd));var _0xb7cf=function(_0xb08329,_0x400bbd){_0xb08329=_0xb08329-0x0;var _0x1562a5=_0x7cfb[_0xb08329];return _0x1562a5;};'use strict';var schema=require(_0xb7cf('0x0'));var sh=require(_0xb7cf('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xb7cf('0x2'))(_0xb7cf('0x3'));var system=schema({'command':{'type':_0xb7cf('0x4'),'required':!![],'message':_0xb7cf('0x5')}});exports[_0xb7cf('0x6')]=function(_0x512c88,_0x4ca865){return function(_0x45caed){try{var _0x2b4378={'command':_0x4ca865[0x0]};var _0x1269f9=system[_0xb7cf('0x0')](_0x2b4378,{'typecast':!![]});if(_0x1269f9[_0xb7cf('0x7')]){logger['error'](_0xb7cf('0x8'),_0x512c88,_[_0xb7cf('0x9')](_0x1269f9,_0xb7cf('0xa'))['join'](',\x20'));logger[_0xb7cf('0xb')](_0xb7cf('0xc'),_0x512c88);_0x45caed['next']();}else{var _0x410d6e=this;var _0xa7806=utils[_0xb7cf('0xd')](_0x4ca865[0x0],this);logger['info'](_0xb7cf('0xe'),_0x512c88,_0xa7806);sh[_0xb7cf('0xf')](_[_0xb7cf('0x10')](_0xa7806),function(_0x496d7b,_0x3eefae){logger[_0xb7cf('0xb')](_0xb7cf('0x11'),_0x512c88,_0x496d7b);if(_0x496d7b==0x0){var _0x4d1c1a=_0x3eefae[_0xb7cf('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x4ca865[0x1])||_['isEmpty'](_0x4ca865[0x1])){logger['info'](_0xb7cf('0x13'),_0x512c88);_0x410d6e[_0xb7cf('0x14')][_0x4ca865[0x1]]=_0x4d1c1a;}else{logger['info'](_0xb7cf('0x15'),_0x512c88,_0x4ca865[0x1],_0x4d1c1a);_0x410d6e[_0xb7cf('0x14')][_0x4ca865[0x1]]=_0x4d1c1a;}}_0x45caed[_0xb7cf('0x16')]();});}}catch(_0x34dc4a){logger['error'](_0xb7cf('0x8'),_0x512c88,_[_0xb7cf('0x17')](_0x34dc4a)?JSON['stringify'](_0x34dc4a):_0x34dc4a);logger[_0xb7cf('0xb')](_0xb7cf('0xc'),_0x512c88);_0x45caed[_0xb7cf('0x16')]();}};}; \ No newline at end of file +var _0xde4c=['routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body','isObject','stringify','validate','../../../../config/logger'];(function(_0x450722,_0x5a68cf){var _0x2e4cdd=function(_0x4f0afc){while(--_0x4f0afc){_0x450722['push'](_0x450722['shift']());}};_0x2e4cdd(++_0x5a68cf);}(_0xde4c,0xfb));var _0xcde4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xde4c[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require(_0xcde4('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require('./utils');var logger=require(_0xcde4('0x1'))(_0xcde4('0x2'));var system=schema({'command':{'type':_0xcde4('0x3'),'required':!![],'message':_0xcde4('0x4')}});exports['consequence']=function(_0x281ce3,_0x2816d3){return function(_0x24b20e){try{var _0x3d2189={'command':_0x2816d3[0x0]};var _0x19acda=system[_0xcde4('0x0')](_0x3d2189,{'typecast':!![]});if(_0x19acda[_0xcde4('0x5')]){logger[_0xcde4('0x6')](_0xcde4('0x7'),_0x281ce3,_[_0xcde4('0x8')](_0x19acda,'message')[_0xcde4('0x9')](',\x20'));logger[_0xcde4('0xa')](_0xcde4('0xb'),_0x281ce3);_0x24b20e[_0xcde4('0xc')]();}else{var _0xbc609=this;var _0x53e013=utils[_0xcde4('0xd')](_0x2816d3[0x0],this);logger[_0xcde4('0xa')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x281ce3,_0x53e013);sh[_0xcde4('0xe')](_[_0xcde4('0xf')](_0x53e013),function(_0x1f455e,_0x92c557){logger['info'](_0xcde4('0x10'),_0x281ce3,_0x1f455e);if(_0x1f455e==0x0){var _0x57cf06=_0x92c557[_0xcde4('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0xcde4('0x12')](_0x2816d3[0x1])||_[_0xcde4('0x13')](_0x2816d3[0x1])){logger[_0xcde4('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x281ce3);_0xbc609[_0xcde4('0x14')][_0x2816d3[0x1]]=_0x57cf06;}else{logger['info']('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x281ce3,_0x2816d3[0x1],_0x57cf06);_0xbc609[_0xcde4('0x14')][_0x2816d3[0x1]]=_0x57cf06;}}_0x24b20e[_0xcde4('0xc')]();});}}catch(_0x28be2e){logger[_0xcde4('0x6')](_0xcde4('0x7'),_0x281ce3,_[_0xcde4('0x15')](_0x28be2e)?JSON[_0xcde4('0x16')](_0x28be2e):_0x28be2e);logger[_0xcde4('0xa')](_0xcde4('0xb'),_0x281ce3);_0x24b20e['next']();}};}; \ 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 2deb713..382f001 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 _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x458dcc,_0x2c3c3b){var _0x510bcf=function(_0x218912){while(--_0x218912){_0x458dcc['push'](_0x458dcc['shift']());}};_0x510bcf(++_0x2c3c3b);}(_0x7a54,0x106));var _0x47a5=function(_0x438d1d,_0x23a3fc){_0x438d1d=_0x438d1d-0x0;var _0x4fc90b=_0x7a54[_0x438d1d];return _0x4fc90b;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x9957=['join','info','next','Interaction','channel','addTags','interaction','then','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message'];(function(_0x2d4224,_0x394591){var _0x2246fe=function(_0x58793e){while(--_0x58793e){_0x2d4224['push'](_0x2d4224['shift']());}};_0x2246fe(++_0x394591);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ 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 86615a9..d6cd7df 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 _0x1f38=['lodash','exports','render','body','contact','message','account','interaction','mustache'];(function(_0x5598dc,_0x502485){var _0x1b0184=function(_0x435b2c){while(--_0x435b2c){_0x5598dc['push'](_0x5598dc['shift']());}};_0x1b0184(++_0x502485);}(_0x1f38,0xd7));var _0x81f3=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x1f38[_0x4e55a9];return _0x4a9b67;};'use strict';var Mustache=require(_0x81f3('0x0'));var _=require(_0x81f3('0x1'));module[_0x81f3('0x2')]={'getMustacheRender':function(_0x3f167c,_0x261dcf){return Mustache[_0x81f3('0x3')](_0x3f167c,_['merge'](_0x261dcf[_0x81f3('0x4')],{'contact':_0x261dcf[_0x81f3('0x5')],'message':_0x261dcf[_0x81f3('0x6')],'account':_0x261dcf[_0x81f3('0x7')],'interaction':_0x261dcf[_0x81f3('0x8')],'list':_0x261dcf['list']}))||'';}}; \ No newline at end of file +var _0x7070=['interaction','list','lodash','merge','body','contact','message'];(function(_0x32c521,_0x59267a){var _0x10e148=function(_0x4649e2){while(--_0x4649e2){_0x32c521['push'](_0x32c521['shift']());}};_0x10e148(++_0x59267a);}(_0x7070,0x1d7));var _0x0707=function(_0x3ed53,_0x35963a){_0x3ed53=_0x3ed53-0x0;var _0x443806=_0x7070[_0x3ed53];return _0x443806;};'use strict';var Mustache=require('mustache');var _=require(_0x0707('0x0'));module['exports']={'getMustacheRender':function(_0x3a3694,_0x580a95){return Mustache['render'](_0x3a3694,_[_0x0707('0x1')](_0x580a95[_0x0707('0x2')],{'contact':_0x580a95[_0x0707('0x3')],'message':_0x580a95[_0x0707('0x4')],'account':_0x580a95['account'],'interaction':_0x580a95[_0x0707('0x5')],'list':_0x580a95[_0x0707('0x6')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9eff013..33d7fbd 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 _0x4ed9=['available','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','autoreply','appdata','split','push','slice','dialogflow','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','execute','Applications\x20executed','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','paused','waiting','mailQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ed9,0x17a));var _0x94ed=function(_0xe85488,_0x1f9f53){_0xe85488=_0xe85488-0x0;var _0x4b8e49=_0x4ed9[_0xe85488];return _0x4b8e49;};'use strict';var _=require(_0x94ed('0x0'));var util=require(_0x94ed('0x1'));var path=require(_0x94ed('0x2'));var fs=require('fs');var jayson=require(_0x94ed('0x3'));var BPromise=require(_0x94ed('0x4'));var uuid=require(_0x94ed('0x5'));var config=require(_0x94ed('0x6'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x94ed('0x7'))};var rpc={'openchannelQueueReport':require(_0x94ed('0x7')),'mailQueueReport':require(_0x94ed('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x94ed('0x9')),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0x94ed('0xa'));function getId(_0x29f2c4,_0x53c80e,_0x3b6272){return util[_0x94ed('0xb')](_0x94ed('0xc'),_0x29f2c4,_0x53c80e||0x0,_0x3b6272||0x0);}function getIntervals(_0x51c0ec,_0x5d9635){var _0x150f9e=[];if(!_[_0x94ed('0xd')](_0x5d9635[_0x94ed('0xe')])&&!_[_0x94ed('0xd')](_0x51c0ec[_0x5d9635[_0x94ed('0xe')]])&&!_[_0x94ed('0xd')](_0x51c0ec[_0x5d9635[_0x94ed('0xe')]][_0x94ed('0xf')])){_0x150f9e=_[_0x94ed('0x10')](_0x51c0ec[_0x5d9635[_0x94ed('0xe')]][_0x94ed('0xf')],_0x94ed('0x11'));}else if(!_[_0x94ed('0xd')](_0x5d9635['interval'])){_0x150f9e=[_0x5d9635['interval']];}return _0x150f9e;}exports[_0x94ed('0x12')]=function(_0x1fd045){_0x1fd045['rules']={};return new BPromise(function(_0x1c937f,_0x2f481d){var _0x51f5f6={'Start':function(_0x3bd824){var _0x15e958=this;return new Promise(function(_0x58aeb4,_0x42fd95){if(_0x3bd824){try{var _0x1dd61d=[];var _0x4e679e=getId(_0x3bd824[_0x94ed('0x13')],_0x3bd824[_0x94ed('0x14')]?_0x3bd824['message']['id']:0x0,_0x3bd824[_0x94ed('0x15')]?_0x3bd824[_0x94ed('0x15')]['id']:0x0);if(_0x3bd824[_0x94ed('0x16')]&&_[_0x94ed('0x17')](_0x3bd824[_0x94ed('0x16')])&&_0x3bd824[_0x94ed('0x16')][_0x94ed('0x18')]){for(var _0x195714=0x0;_0x195714<_0x3bd824[_0x94ed('0x16')][_0x94ed('0x18')];_0x195714+=0x1){var _0x4436a2=_0x3bd824[_0x94ed('0x16')][_0x195714];if(fs[_0x94ed('0x19')](path[_0x94ed('0x1a')](__dirname,_0x94ed('0x16'),_0x4436a2['app']+'.js'))){var _0x3527d0=[];switch(_0x4436a2[_0x94ed('0x1b')]['toLowerCase']()){case _0x94ed('0x1c'):var _0x51b1ea=_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');_0x3527d0['push'](_0x51b1ea[0x0]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[_0x94ed('0x20')](0x1,_0x51b1ea['length'])[_0x94ed('0x1a')](','));break;case _0x94ed('0x21'):var _0x51b1ea=_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x0]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x1]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[_0x94ed('0x20')](0x2,_0x51b1ea['length'])[_0x94ed('0x1a')](','));break;case'amazonlex':var _0x51b1ea=_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');_0x3527d0['push'](_0x51b1ea[0x0]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x1]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x2]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x3]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[_0x94ed('0x20')](0x4,_0x51b1ea[_0x94ed('0x18')])['join'](','));break;case _0x94ed('0x14'):_0x3527d0[_0x94ed('0x1f')](_0x4436a2[_0x94ed('0x1d')]);break;case'tag':_0x3527d0['push'](_0x4436a2['TagId']);_0x3527d0[_0x94ed('0x1f')](_0x4436a2[_0x94ed('0x1d')]);break;default:_0x3527d0=_[_0x94ed('0xd')](_0x4436a2[_0x94ed('0x1d')])?[]:_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');}var _0x363b95={'id':util[_0x94ed('0xb')](_0x94ed('0x22'),_0x4e679e,_0x4436a2['id'],_0x4436a2[_0x94ed('0x1b')]),'condition':require(_0x94ed('0x23'))[_0x94ed('0x24')](_0x4e679e,getIntervals(_0x1fd045[_0x94ed('0x25')],_0x4436a2),_0x1fd045),'consequence':require(_0x94ed('0x26')+_0x4436a2['app'])[_0x94ed('0x27')](_0x4e679e,_0x3527d0,_0x1fd045,_0x3bd824),'p':_0x4436a2[_0x94ed('0x28')]||0x0};logger[_0x94ed('0x29')](_0x94ed('0x2a'),_0x363b95['id'],_0x94ed('0x2b'),getIntervals(_0x1fd045['intervals'],_0x4436a2)[_0x94ed('0x1a')](_0x94ed('0x2c')));_0x1dd61d['push'](_0x363b95);}else{logger[_0x94ed('0x2d')](_0x94ed('0x2e'),path['join'](__dirname,_0x94ed('0x16'),_0x4436a2['app']+_0x94ed('0x2f')));}}_0x1fd045[_0x94ed('0x30')][_0x4e679e]=new RuleEngine(_0x1dd61d);_0x1fd045['rules'][_0x4e679e][_0x94ed('0x31')](_0x3bd824,function(_0x415646){logger[_0x94ed('0x29')](_0x94ed('0x32'),JSON['stringify'](_0x415646[_0x94ed('0x33')]));if(_0x1fd045[_0x94ed('0x30')][_0x4e679e]){_0x1fd045['rules'][_0x4e679e][_0x94ed('0x34')]('end');}});return _0x58aeb4({'code':0xc8,'message':_0x3bd824});}else{logger[_0x94ed('0x29')](_0x94ed('0x35'));return _0x58aeb4({'code':0xc8,'message':_0x3bd824});}}catch(_0x25732e){logger[_0x94ed('0x2d')](_0x25732e['stack']);return _0x42fd95(_0x15e958[_0x94ed('0x2d')](0x1f4,_0x25732e));}}return _0x42fd95(_0x94ed('0x36'));});},'AcceptMessage':function(_0xb967e7){var _0x485ace=this;return new Promise(function(_0x5136d6,_0x61bdfa){if(_0xb967e7[_0x94ed('0x14')]&&_0xb967e7[_0x94ed('0x14')]['id']){try{var _0x1f0b68=getId(_0xb967e7['channel'],_0xb967e7[_0x94ed('0x14')]?_0xb967e7['message']['id']:0x0,_0xb967e7[_0x94ed('0x15')]?_0xb967e7[_0x94ed('0x15')]['id']:0x0);if(_0x1fd045[_0x94ed('0x30')][_0x1f0b68]){_0x1fd045[_0x94ed('0x30')][_0x1f0b68][_0x94ed('0x34')](_0x94ed('0x37'));if(rpc[_0xb967e7[_0x94ed('0x13')]+_0x94ed('0x38')]){rpc[_0xb967e7[_0x94ed('0x13')]+'QueueReport']['update'](_0x1f0b68,{'UserId':_0xb967e7['message'][_0x94ed('0x39')]})[_0x94ed('0x3a')](function(_0x56c816){logger[_0x94ed('0x2d')](_0x94ed('0x3b'));});}}return _0x5136d6({'code':0xc8,'message':_0xb967e7});}catch(_0x380b11){logger[_0x94ed('0x2d')](_0x380b11[_0x94ed('0x3c')]);return _0x61bdfa(_0x485ace[_0x94ed('0x2d')](0x1f4,_0x380b11));}}logger['error'](_0x94ed('0x3d'));return _0x61bdfa(_0x485ace[_0x94ed('0x2d')](0x1f4,_0x94ed('0x3d')));});},'RejectMessage':function(_0x279c4d){var _0x74ef76=this;return new Promise(function(_0x23c8a2,_0x3618fe){if(_0x279c4d[_0x94ed('0x3e')]&&_0x279c4d['agent']['id']){try{if(_0x1fd045['agents'][_0x279c4d[_0x94ed('0x3e')]['id']]){_0x1fd045[_0x94ed('0x3f')][_0x279c4d['agent']['id']][_0x94ed('0x40')]=![];_0x1fd045[_0x94ed('0x3f')][_0x279c4d[_0x94ed('0x3e')]['id']][_0x94ed('0x41')]=undefined;}return _0x23c8a2({'code':0xc8,'message':_0x279c4d});}catch(_0x112461){logger[_0x94ed('0x2d')](_0x112461['stack']);return _0x3618fe(_0x74ef76['error'](0x1f4,_0x112461));}}logger[_0x94ed('0x2d')](_0x94ed('0x3d'));return _0x3618fe(_0x74ef76['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x4d1f95){var _0x3f0e34=this;return new Promise(function(_0x3e01e1,_0x20baca){if(_0x4d1f95[_0x94ed('0x13')]&&_0x4d1f95[_0x94ed('0x15')]&&_0x4d1f95[_0x94ed('0x15')]['id']){try{var _0x46db21=getId(_0x4d1f95[_0x94ed('0x13')],_0x4d1f95['message']?_0x4d1f95[_0x94ed('0x14')]['id']:0x0,_0x4d1f95['interaction']?_0x4d1f95[_0x94ed('0x15')]['id']:0x0);if(_0x1fd045[_0x94ed('0x30')][_0x46db21]){_0x1fd045['rules'][_0x46db21][_0x94ed('0x34')](_0x94ed('0x37'));}return _0x3e01e1({'code':0xc8,'message':_0x4d1f95});}catch(_0x29284d){logger[_0x94ed('0x2d')](_0x29284d[_0x94ed('0x3c')]);return _0x20baca(_0x3f0e34[_0x94ed('0x2d')](0x1f4,_0x29284d));}}logger[_0x94ed('0x2d')](_0x94ed('0x3d'));return _0x20baca(_0x3f0e34[_0x94ed('0x2d')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1b1bce){var _0x56bf97=this;return new Promise(function(_0x4e88b3,_0x12d9e4){if(_0x1fd045[_0x94ed('0x3f')][_0x94ed('0x42')](_0x1b1bce['id'])){for(var _0x47047a in _0x1b1bce[_0x94ed('0x43')]){if(_0x1b1bce[_0x94ed('0x43')][_0x94ed('0x42')](_0x47047a)){if(_0x1fd045[_0x94ed('0x3f')][_0x1b1bce['id']][_0x94ed('0x42')](_0x47047a+_0x94ed('0x44'))){_0x1fd045[_0x94ed('0x3f')][_0x1b1bce['id']][_0x47047a+_0x94ed('0x44')]=parseInt(_0x1b1bce[_0x94ed('0x43')][_0x47047a],0xa);}}}_0x1fd045['agents'][_0x1b1bce['id']][_0x94ed('0x45')]();return _0x4e88b3({'code':0xc8,'message':_0x1fd045['agents'][_0x1b1bce['id']]});}else{return _0x12d9e4(_0x56bf97[_0x94ed('0x2d')](0x1f4,_0x94ed('0x46')));}});},'Agents':function(_0xa19180){return new Promise(function(_0x276041,_0x1ee597){var _0x1772ab=_['values'](_0x1fd045['agents']);_0x276041({'count':_0x1772ab[_0x94ed('0x18')],'rows':_0x1772ab});});},'ChatQueues':function(_0x2bbb28){return new Promise(function(_0x3df7a0,_0x442740){var _0x4856e6=[];for(var _0x81e808 in _0x1fd045['chatQueues']){if(_0x1fd045['chatQueues'][_0x94ed('0x42')](_0x81e808)){var _0x3e1bdf=_0x1fd045[_0x94ed('0x47')][_0x81e808];var _0x5beb93={'id':_0x3e1bdf['id'],'available':_0x3e1bdf['available'],'loggedIn':_0x3e1bdf[_0x94ed('0x48')],'name':_0x3e1bdf[_0x94ed('0x49')],'paused':_0x3e1bdf[_0x94ed('0x4a')],'waiting':_0x3e1bdf[_0x94ed('0x4b')]};_0x4856e6[_0x94ed('0x1f')](_0x5beb93);}}_0x3df7a0({'count':_0x4856e6[_0x94ed('0x18')],'rows':_0x4856e6});});},'MailQueues':function(_0x49fbee){return new Promise(function(_0xaab652,_0x205548){var _0x4a5f47=[];for(var _0x328ee0 in _0x1fd045['mailQueues']){if(_0x1fd045[_0x94ed('0x4c')][_0x94ed('0x42')](_0x328ee0)){var _0x59bf9c=_0x1fd045[_0x94ed('0x4c')][_0x328ee0];var _0x5a87fe={'id':_0x59bf9c['id'],'available':_0x59bf9c[_0x94ed('0x4d')],'loggedIn':_0x59bf9c[_0x94ed('0x48')],'name':_0x59bf9c[_0x94ed('0x49')],'paused':_0x59bf9c['paused'],'waiting':_0x59bf9c[_0x94ed('0x4b')]};_0x4a5f47[_0x94ed('0x1f')](_0x5a87fe);}}_0xaab652({'count':_0x4a5f47['length'],'rows':_0x4a5f47});});},'OpenchannelQueues':function(_0x5e6860){return new Promise(function(_0x4c95a9,_0x3ef1aa){var _0x45d806=[];for(var _0x22b338 in _0x1fd045['openchannelQueues']){if(_0x1fd045[_0x94ed('0x4e')]['hasOwnProperty'](_0x22b338)){var _0x5b0b67=_0x1fd045['openchannelQueues'][_0x22b338];var _0x3ca5da={'id':_0x5b0b67['id'],'available':_0x5b0b67[_0x94ed('0x4d')],'loggedIn':_0x5b0b67[_0x94ed('0x48')],'name':_0x5b0b67[_0x94ed('0x49')],'paused':_0x5b0b67[_0x94ed('0x4a')],'waiting':_0x5b0b67['waiting']};_0x45d806[_0x94ed('0x1f')](_0x3ca5da);}}_0x4c95a9({'count':_0x45d806['length'],'rows':_0x45d806});});},'SmsQueues':function(_0x4bc230){return new Promise(function(_0x5a33a1,_0x273a83){var _0x15e212=[];for(var _0x212f7e in _0x1fd045['smsQueues']){if(_0x1fd045[_0x94ed('0x4f')][_0x94ed('0x42')](_0x212f7e)){var _0x4b3911=_0x1fd045['smsQueues'][_0x212f7e];var _0x8183f1={'id':_0x4b3911['id'],'available':_0x4b3911[_0x94ed('0x4d')],'loggedIn':_0x4b3911['loggedIn'],'name':_0x4b3911[_0x94ed('0x49')],'paused':_0x4b3911[_0x94ed('0x4a')],'waiting':_0x4b3911[_0x94ed('0x4b')]};_0x15e212[_0x94ed('0x1f')](_0x8183f1);}}_0x5a33a1({'count':_0x15e212['length'],'rows':_0x15e212});});},'FaxQueues':function(_0x523e43){return new Promise(function(_0x1260ab,_0x4aa8dc){var _0x2408a9=[];for(var _0x27bdb6 in _0x1fd045[_0x94ed('0x50')]){if(_0x1fd045['faxQueues'][_0x94ed('0x42')](_0x27bdb6)){var _0xc67011=_0x1fd045['faxQueues'][_0x27bdb6];var _0x544182={'id':_0xc67011['id'],'available':_0xc67011[_0x94ed('0x4d')],'loggedIn':_0xc67011['loggedIn'],'name':_0xc67011[_0x94ed('0x49')],'paused':_0xc67011['paused'],'waiting':_0xc67011[_0x94ed('0x4b')]};_0x2408a9[_0x94ed('0x1f')](_0x544182);}}_0x1260ab({'count':_0x2408a9[_0x94ed('0x18')],'rows':_0x2408a9});});},'ChatQueuesWaitingInteractions':function(_0x31135d){return new Promise(function(_0x1a11e1,_0x2877dd){var _0x487d5c=_['values'](_0x1fd045[_0x94ed('0x51')]);_0x1a11e1({'count':_0x487d5c[_0x94ed('0x18')],'rows':_0x487d5c});});},'MailQueuesWaitingInteractions':function(_0x4ef1bf){return new Promise(function(_0x29e689,_0x46ff16){var _0x50bcb1=_[_0x94ed('0x52')](_0x1fd045['mailQueuesWaitingInteractions']);_0x29e689({'count':_0x50bcb1[_0x94ed('0x18')],'rows':_0x50bcb1});});},'OpenchannelQueuesWaitingInteractions':function(_0x1a554f){return new Promise(function(_0x224df3,_0x301be4){var _0x15776f=_['values'](_0x1fd045[_0x94ed('0x53')]);_0x224df3({'count':_0x15776f[_0x94ed('0x18')],'rows':_0x15776f});});},'SmsQueuesWaitingInteractions':function(_0x5cbe06){return new Promise(function(_0x5649d9,_0x45870d){var _0xeff89b=_['values'](_0x1fd045[_0x94ed('0x54')]);_0x5649d9({'count':_0xeff89b[_0x94ed('0x18')],'rows':_0xeff89b});});},'FaxQueuesWaitingInteractions':function(_0x1a4743){return new Promise(function(_0xe33f41,_0x272271){var _0x147432=_[_0x94ed('0x52')](_0x1fd045['faxQueuesWaitingInteractions']);_0xe33f41({'count':_0x147432[_0x94ed('0x18')],'rows':_0x147432});});}};var _0x329823=jayson[_0x94ed('0x55')](_0x51f5f6)[_0x94ed('0x56')]();_0x329823['on'](_0x94ed('0x2d'),function(_0x348c68){logger['error'](JSON['stringify'](_0x348c68));return _0x2f481d(_0x348c68);});_0x329823[_0x94ed('0x12')](0x232c,_0x94ed('0x57'),function(){console[_0x94ed('0x58')](_0x94ed('0x59'),0x232c);return _0x1c937f(_0x94ed('0x5a')+0x232c);});});}; \ No newline at end of file +var _0x5a4b=['stringify','emit','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','QueueReport','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','name','waiting','mailQueues','loggedIn','paused','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','server','log','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','app','toLowerCase','autoreply','push','slice','join','dialogflow','appdata','split','amazonlex','tag','TagId','%s:%s:%s','./interval','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x5a4b,0x135));var _0xb5a4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x5a4b[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xb5a4('0x0'));var util=require(_0xb5a4('0x1'));var path=require(_0xb5a4('0x2'));var fs=require('fs');var jayson=require(_0xb5a4('0x3'));var BPromise=require(_0xb5a4('0x4'));var uuid=require(_0xb5a4('0x5'));var config=require('../../../config/environment');var logger=require(_0xb5a4('0x6'))(_0xb5a4('0x7'));var rpc={'openchannelQueueReport':require(_0xb5a4('0x8'))};var rpc={'openchannelQueueReport':require(_0xb5a4('0x8')),'mailQueueReport':require(_0xb5a4('0x9')),'chatQueueReport':require(_0xb5a4('0xa')),'smsQueueReport':require(_0xb5a4('0xb')),'faxQueueReport':require(_0xb5a4('0xc'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x237e3f,_0x511439,_0x508036){return util[_0xb5a4('0xd')](_0xb5a4('0xe'),_0x237e3f,_0x511439||0x0,_0x508036||0x0);}function getIntervals(_0x3078ed,_0x5262ee){var _0x2114ed=[];if(!_[_0xb5a4('0xf')](_0x5262ee['IntervalId'])&&!_[_0xb5a4('0xf')](_0x3078ed[_0x5262ee[_0xb5a4('0x10')]])&&!_[_0xb5a4('0xf')](_0x3078ed[_0x5262ee[_0xb5a4('0x10')]][_0xb5a4('0x11')])){_0x2114ed=_[_0xb5a4('0x12')](_0x3078ed[_0x5262ee[_0xb5a4('0x10')]][_0xb5a4('0x11')],_0xb5a4('0x13'));}else if(!_['isNil'](_0x5262ee[_0xb5a4('0x13')])){_0x2114ed=[_0x5262ee[_0xb5a4('0x13')]];}return _0x2114ed;}exports[_0xb5a4('0x14')]=function(_0x222c39){_0x222c39[_0xb5a4('0x15')]={};return new BPromise(function(_0x38fa9b,_0x4f6e3b){var _0x2dae1f={'Start':function(_0x4da7e5){var _0x1aef1e=this;return new Promise(function(_0x431486,_0x62a557){if(_0x4da7e5){try{var _0x3bb8a0=[];var _0x606eaf=getId(_0x4da7e5[_0xb5a4('0x16')],_0x4da7e5[_0xb5a4('0x17')]?_0x4da7e5['message']['id']:0x0,_0x4da7e5['interaction']?_0x4da7e5[_0xb5a4('0x18')]['id']:0x0);if(_0x4da7e5[_0xb5a4('0x19')]&&_[_0xb5a4('0x1a')](_0x4da7e5[_0xb5a4('0x19')])&&_0x4da7e5['applications'][_0xb5a4('0x1b')]){for(var _0x527391=0x0;_0x527391<_0x4da7e5[_0xb5a4('0x19')][_0xb5a4('0x1b')];_0x527391+=0x1){var _0x8065bb=_0x4da7e5[_0xb5a4('0x19')][_0x527391];if(fs['existsSync'](path['join'](__dirname,_0xb5a4('0x19'),_0x8065bb['app']+'.js'))){var _0x4fdb7b=[];switch(_0x8065bb[_0xb5a4('0x1c')][_0xb5a4('0x1d')]()){case _0xb5a4('0x1e'):var _0x5bfe91=_0x8065bb['appdata']['split'](',');_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91[0x0]);_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91[_0xb5a4('0x20')](0x1,_0x5bfe91[_0xb5a4('0x1b')])[_0xb5a4('0x21')](','));break;case _0xb5a4('0x22'):var _0x5bfe91=_0x8065bb[_0xb5a4('0x23')][_0xb5a4('0x24')](',');_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91[0x0]);_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91[0x1]);_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91['slice'](0x2,_0x5bfe91[_0xb5a4('0x1b')])[_0xb5a4('0x21')](','));break;case _0xb5a4('0x25'):var _0x5bfe91=_0x8065bb[_0xb5a4('0x23')]['split'](',');_0x4fdb7b['push'](_0x5bfe91[0x0]);_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91[0x1]);_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91[0x2]);_0x4fdb7b[_0xb5a4('0x1f')](_0x5bfe91[0x3]);_0x4fdb7b['push'](_0x5bfe91['slice'](0x4,_0x5bfe91[_0xb5a4('0x1b')])[_0xb5a4('0x21')](','));break;case _0xb5a4('0x17'):_0x4fdb7b[_0xb5a4('0x1f')](_0x8065bb['appdata']);break;case _0xb5a4('0x26'):_0x4fdb7b[_0xb5a4('0x1f')](_0x8065bb[_0xb5a4('0x27')]);_0x4fdb7b[_0xb5a4('0x1f')](_0x8065bb[_0xb5a4('0x23')]);break;default:_0x4fdb7b=_[_0xb5a4('0xf')](_0x8065bb[_0xb5a4('0x23')])?[]:_0x8065bb[_0xb5a4('0x23')][_0xb5a4('0x24')](',');}var _0x430d46={'id':util[_0xb5a4('0xd')](_0xb5a4('0x28'),_0x606eaf,_0x8065bb['id'],_0x8065bb[_0xb5a4('0x1c')]),'condition':require(_0xb5a4('0x29'))['condition'](_0x606eaf,getIntervals(_0x222c39[_0xb5a4('0x2a')],_0x8065bb),_0x222c39),'consequence':require(_0xb5a4('0x2b')+_0x8065bb[_0xb5a4('0x1c')])[_0xb5a4('0x2c')](_0x606eaf,_0x4fdb7b,_0x222c39,_0x4da7e5),'p':_0x8065bb[_0xb5a4('0x2d')]||0x0};logger[_0xb5a4('0x2e')](_0xb5a4('0x2f'),_0x430d46['id'],_0xb5a4('0x30'),getIntervals(_0x222c39['intervals'],_0x8065bb)[_0xb5a4('0x21')](_0xb5a4('0x31')));_0x3bb8a0[_0xb5a4('0x1f')](_0x430d46);}else{logger[_0xb5a4('0x32')](_0xb5a4('0x33'),path[_0xb5a4('0x21')](__dirname,_0xb5a4('0x19'),_0x8065bb[_0xb5a4('0x1c')]+_0xb5a4('0x34')));}}_0x222c39['rules'][_0x606eaf]=new RuleEngine(_0x3bb8a0);_0x222c39['rules'][_0x606eaf][_0xb5a4('0x35')](_0x4da7e5,function(_0x59e981){logger['info'](_0xb5a4('0x36'),JSON[_0xb5a4('0x37')](_0x59e981['matchPath']));if(_0x222c39[_0xb5a4('0x15')][_0x606eaf]){_0x222c39[_0xb5a4('0x15')][_0x606eaf][_0xb5a4('0x38')](_0xb5a4('0x39'));}});return _0x431486({'code':0xc8,'message':_0x4da7e5});}else{logger[_0xb5a4('0x2e')](_0xb5a4('0x3a'));return _0x431486({'code':0xc8,'message':_0x4da7e5});}}catch(_0x2438ac){logger[_0xb5a4('0x32')](_0x2438ac[_0xb5a4('0x3b')]);return _0x62a557(_0x1aef1e['error'](0x1f4,_0x2438ac));}}return _0x62a557(_0xb5a4('0x3c'));});},'AcceptMessage':function(_0x58fc8c){var _0x2ee612=this;return new Promise(function(_0x16182c,_0x294c2d){if(_0x58fc8c[_0xb5a4('0x17')]&&_0x58fc8c[_0xb5a4('0x17')]['id']){try{var _0x2c2dc5=getId(_0x58fc8c[_0xb5a4('0x16')],_0x58fc8c[_0xb5a4('0x17')]?_0x58fc8c[_0xb5a4('0x17')]['id']:0x0,_0x58fc8c[_0xb5a4('0x18')]?_0x58fc8c[_0xb5a4('0x18')]['id']:0x0);if(_0x222c39[_0xb5a4('0x15')][_0x2c2dc5]){_0x222c39[_0xb5a4('0x15')][_0x2c2dc5][_0xb5a4('0x38')](_0xb5a4('0x39'));if(rpc[_0x58fc8c[_0xb5a4('0x16')]+'QueueReport']){rpc[_0x58fc8c['channel']+_0xb5a4('0x3d')]['update'](_0x2c2dc5,{'UserId':_0x58fc8c[_0xb5a4('0x17')][_0xb5a4('0x3e')]})[_0xb5a4('0x3f')](function(_0x394ca3){logger[_0xb5a4('0x32')](_0xb5a4('0x40'));});}}return _0x16182c({'code':0xc8,'message':_0x58fc8c});}catch(_0x9225ca){logger[_0xb5a4('0x32')](_0x9225ca[_0xb5a4('0x3b')]);return _0x294c2d(_0x2ee612['error'](0x1f4,_0x9225ca));}}logger[_0xb5a4('0x32')](_0xb5a4('0x41'));return _0x294c2d(_0x2ee612['error'](0x1f4,_0xb5a4('0x41')));});},'RejectMessage':function(_0x1dd3fa){var _0x17ade4=this;return new Promise(function(_0x86f652,_0x1f7d10){if(_0x1dd3fa[_0xb5a4('0x42')]&&_0x1dd3fa[_0xb5a4('0x42')]['id']){try{if(_0x222c39[_0xb5a4('0x43')][_0x1dd3fa[_0xb5a4('0x42')]['id']]){_0x222c39[_0xb5a4('0x43')][_0x1dd3fa[_0xb5a4('0x42')]['id']][_0xb5a4('0x44')]=![];_0x222c39[_0xb5a4('0x43')][_0x1dd3fa[_0xb5a4('0x42')]['id']][_0xb5a4('0x45')]=undefined;}return _0x86f652({'code':0xc8,'message':_0x1dd3fa});}catch(_0x4e7c28){logger[_0xb5a4('0x32')](_0x4e7c28[_0xb5a4('0x3b')]);return _0x1f7d10(_0x17ade4['error'](0x1f4,_0x4e7c28));}}logger[_0xb5a4('0x32')](_0xb5a4('0x41'));return _0x1f7d10(_0x17ade4[_0xb5a4('0x32')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x2d1615){var _0x419040=this;return new Promise(function(_0x3161f1,_0x2bc45e){if(_0x2d1615['channel']&&_0x2d1615[_0xb5a4('0x18')]&&_0x2d1615[_0xb5a4('0x18')]['id']){try{var _0x54caac=getId(_0x2d1615[_0xb5a4('0x16')],_0x2d1615[_0xb5a4('0x17')]?_0x2d1615[_0xb5a4('0x17')]['id']:0x0,_0x2d1615['interaction']?_0x2d1615[_0xb5a4('0x18')]['id']:0x0);if(_0x222c39['rules'][_0x54caac]){_0x222c39[_0xb5a4('0x15')][_0x54caac][_0xb5a4('0x38')]('end');}return _0x3161f1({'code':0xc8,'message':_0x2d1615});}catch(_0x1a8291){logger['error'](_0x1a8291[_0xb5a4('0x3b')]);return _0x2bc45e(_0x419040[_0xb5a4('0x32')](0x1f4,_0x1a8291));}}logger[_0xb5a4('0x32')](_0xb5a4('0x41'));return _0x2bc45e(_0x419040[_0xb5a4('0x32')](0x1f4,_0xb5a4('0x41')));});},'AgentCapacity':function(_0x52bded){var _0x4bf95c=this;return new Promise(function(_0x1f4253,_0x508337){if(_0x222c39[_0xb5a4('0x43')][_0xb5a4('0x46')](_0x52bded['id'])){for(var _0x177abd in _0x52bded[_0xb5a4('0x47')]){if(_0x52bded[_0xb5a4('0x47')][_0xb5a4('0x46')](_0x177abd)){if(_0x222c39['agents'][_0x52bded['id']][_0xb5a4('0x46')](_0x177abd+_0xb5a4('0x48'))){_0x222c39[_0xb5a4('0x43')][_0x52bded['id']][_0x177abd+_0xb5a4('0x48')]=parseInt(_0x52bded['capacity'][_0x177abd],0xa);}}}_0x222c39[_0xb5a4('0x43')][_0x52bded['id']]['updateRealtime']();return _0x1f4253({'code':0xc8,'message':_0x222c39['agents'][_0x52bded['id']]});}else{return _0x508337(_0x4bf95c[_0xb5a4('0x32')](0x1f4,_0xb5a4('0x49')));}});},'Agents':function(_0x398422){return new Promise(function(_0x3c9490,_0x2a57d7){var _0x3b8cf0=_[_0xb5a4('0x4a')](_0x222c39['agents']);_0x3c9490({'count':_0x3b8cf0[_0xb5a4('0x1b')],'rows':_0x3b8cf0});});},'ChatQueues':function(_0x2423b4){return new Promise(function(_0x3fa92d,_0x5eb6a3){var _0x2658c0=[];for(var _0x15429a in _0x222c39[_0xb5a4('0x4b')]){if(_0x222c39[_0xb5a4('0x4b')][_0xb5a4('0x46')](_0x15429a)){var _0x1ed700=_0x222c39[_0xb5a4('0x4b')][_0x15429a];var _0x2b960f={'id':_0x1ed700['id'],'available':_0x1ed700[_0xb5a4('0x4c')],'loggedIn':_0x1ed700['loggedIn'],'name':_0x1ed700[_0xb5a4('0x4d')],'paused':_0x1ed700['paused'],'waiting':_0x1ed700[_0xb5a4('0x4e')]};_0x2658c0[_0xb5a4('0x1f')](_0x2b960f);}}_0x3fa92d({'count':_0x2658c0[_0xb5a4('0x1b')],'rows':_0x2658c0});});},'MailQueues':function(_0x48fa7b){return new Promise(function(_0x501362,_0xfe51a9){var _0x58d5b4=[];for(var _0x4fe59e in _0x222c39[_0xb5a4('0x4f')]){if(_0x222c39[_0xb5a4('0x4f')][_0xb5a4('0x46')](_0x4fe59e)){var _0x4aecc1=_0x222c39[_0xb5a4('0x4f')][_0x4fe59e];var _0xa7c1c={'id':_0x4aecc1['id'],'available':_0x4aecc1['available'],'loggedIn':_0x4aecc1[_0xb5a4('0x50')],'name':_0x4aecc1[_0xb5a4('0x4d')],'paused':_0x4aecc1[_0xb5a4('0x51')],'waiting':_0x4aecc1[_0xb5a4('0x4e')]};_0x58d5b4[_0xb5a4('0x1f')](_0xa7c1c);}}_0x501362({'count':_0x58d5b4[_0xb5a4('0x1b')],'rows':_0x58d5b4});});},'OpenchannelQueues':function(_0x2ac31c){return new Promise(function(_0x37a72d,_0x58244a){var _0x45ab20=[];for(var _0x36a560 in _0x222c39[_0xb5a4('0x52')]){if(_0x222c39[_0xb5a4('0x52')][_0xb5a4('0x46')](_0x36a560)){var _0x1042fc=_0x222c39[_0xb5a4('0x52')][_0x36a560];var _0x556fa0={'id':_0x1042fc['id'],'available':_0x1042fc[_0xb5a4('0x4c')],'loggedIn':_0x1042fc[_0xb5a4('0x50')],'name':_0x1042fc[_0xb5a4('0x4d')],'paused':_0x1042fc[_0xb5a4('0x51')],'waiting':_0x1042fc[_0xb5a4('0x4e')]};_0x45ab20[_0xb5a4('0x1f')](_0x556fa0);}}_0x37a72d({'count':_0x45ab20[_0xb5a4('0x1b')],'rows':_0x45ab20});});},'SmsQueues':function(_0x265f06){return new Promise(function(_0x1bac64,_0x12b110){var _0x17c7b6=[];for(var _0x3a2f33 in _0x222c39[_0xb5a4('0x53')]){if(_0x222c39[_0xb5a4('0x53')][_0xb5a4('0x46')](_0x3a2f33)){var _0x2df675=_0x222c39['smsQueues'][_0x3a2f33];var _0x202cc1={'id':_0x2df675['id'],'available':_0x2df675[_0xb5a4('0x4c')],'loggedIn':_0x2df675[_0xb5a4('0x50')],'name':_0x2df675[_0xb5a4('0x4d')],'paused':_0x2df675[_0xb5a4('0x51')],'waiting':_0x2df675[_0xb5a4('0x4e')]};_0x17c7b6[_0xb5a4('0x1f')](_0x202cc1);}}_0x1bac64({'count':_0x17c7b6[_0xb5a4('0x1b')],'rows':_0x17c7b6});});},'FaxQueues':function(_0x64f0f4){return new Promise(function(_0x15bc14,_0x33f04c){var _0x3460c0=[];for(var _0x266343 in _0x222c39[_0xb5a4('0x54')]){if(_0x222c39[_0xb5a4('0x54')][_0xb5a4('0x46')](_0x266343)){var _0x31e5ae=_0x222c39['faxQueues'][_0x266343];var _0x1caca1={'id':_0x31e5ae['id'],'available':_0x31e5ae['available'],'loggedIn':_0x31e5ae[_0xb5a4('0x50')],'name':_0x31e5ae[_0xb5a4('0x4d')],'paused':_0x31e5ae['paused'],'waiting':_0x31e5ae['waiting']};_0x3460c0['push'](_0x1caca1);}}_0x15bc14({'count':_0x3460c0[_0xb5a4('0x1b')],'rows':_0x3460c0});});},'ChatQueuesWaitingInteractions':function(_0x21d1a5){return new Promise(function(_0x2a7b18,_0x566ca3){var _0x327c80=_['values'](_0x222c39[_0xb5a4('0x55')]);_0x2a7b18({'count':_0x327c80[_0xb5a4('0x1b')],'rows':_0x327c80});});},'MailQueuesWaitingInteractions':function(_0x2a5de6){return new Promise(function(_0x5b72d2,_0x457960){var _0x3ffa20=_[_0xb5a4('0x4a')](_0x222c39[_0xb5a4('0x56')]);_0x5b72d2({'count':_0x3ffa20['length'],'rows':_0x3ffa20});});},'OpenchannelQueuesWaitingInteractions':function(_0x41e4b6){return new Promise(function(_0x57f777,_0x5c93fb){var _0x55fc42=_[_0xb5a4('0x4a')](_0x222c39[_0xb5a4('0x57')]);_0x57f777({'count':_0x55fc42[_0xb5a4('0x1b')],'rows':_0x55fc42});});},'SmsQueuesWaitingInteractions':function(_0x3c4500){return new Promise(function(_0x36e6b2,_0x29e4f8){var _0x62016b=_[_0xb5a4('0x4a')](_0x222c39['smsQueuesWaitingInteractions']);_0x36e6b2({'count':_0x62016b[_0xb5a4('0x1b')],'rows':_0x62016b});});},'FaxQueuesWaitingInteractions':function(_0xf0d5a1){return new Promise(function(_0x2ce129,_0x9a53a3){var _0xb6ddc=_['values'](_0x222c39['faxQueuesWaitingInteractions']);_0x2ce129({'count':_0xb6ddc[_0xb5a4('0x1b')],'rows':_0xb6ddc});});}};var _0x49ac71=jayson[_0xb5a4('0x58')](_0x2dae1f)['http']();_0x49ac71['on'](_0xb5a4('0x32'),function(_0x5074b3){logger[_0xb5a4('0x32')](JSON[_0xb5a4('0x37')](_0x5074b3));return _0x4f6e3b(_0x5074b3);});_0x49ac71[_0xb5a4('0x14')](0x232c,'127.0.0.1',function(){console[_0xb5a4('0x59')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x38fa9b(_0xb5a4('0x5a')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 45d3ac6..a41c4dc 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 _0x609a=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','util','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','info'];(function(_0x2ac3c5,_0x4ae57f){var _0x510a5c=function(_0x5e8f2e){while(--_0x5e8f2e){_0x2ac3c5['push'](_0x2ac3c5['shift']());}};_0x510a5c(++_0x4ae57f);}(_0x609a,0x7f));var _0xa609=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x609a[_0x21a9d9];return _0x46adce;};'use strict';var util=require(_0xa609('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0xa609('0x1'))(_0xa609('0x2'));var client=jayson[_0xa609('0x3')][_0xa609('0x4')]({'port':0x232a});function request(_0x4e9e12,_0x401f9c){return new BPromise(function(_0x24e0b9,_0x28eb44){return client[_0xa609('0x5')](_0x4e9e12,_0x401f9c)[_0xa609('0x6')](function(_0x5979c2){if(_0x5979c2[_0xa609('0x7')]){return _0x28eb44(_0x5979c2[_0xa609('0x7')][_0xa609('0x8')]);}else{return _0x24e0b9(_0x5979c2[_0xa609('0x9')]);}})[_0xa609('0xa')](function(_0x1fdf19){return _0x28eb44(_0x1fdf19);});});}exports[_0xa609('0xb')]=function(_0x2555c5,_0x2e960c,_0x41110f){return function(_0x134d80){if(_0x41110f['rules']&&!_0x41110f['rules'][_0x2555c5]){logger[_0xa609('0xc')](_0xa609('0xd'),_0x2555c5);return _0x134d80[_0xa609('0xe')]();}var _0x356d04=[];for(var _0x3b09ed=0x0;_0x3b09ed<_0x2e960c[_0xa609('0xf')];_0x3b09ed+=0x1){_0x356d04[_0xa609('0x10')](request('Command',{'command':util[_0xa609('0x11')](_0xa609('0x12'),_0x2e960c[_0x3b09ed])})[_0xa609('0x6')](function(_0x36aafa){return _0x36aafa&&_0x36aafa['message']&&_0x36aafa[_0xa609('0x8')]['indexOf'](_0xa609('0x13'))>=0x0?!![]:![];})[_0xa609('0xa')](function(_0x21dc40){logger[_0xa609('0x7')](_0xa609('0x14'),_0x2555c5,_0x2e960c[_0x3b09ed]);}));}BPromise[_0xa609('0x15')](_0x356d04)[_0xa609('0x6')](function(_0x9b773){var _0x7f7cc4=_[_0xa609('0x16')](_0x9b773);logger[_0xa609('0xc')](_0xa609('0x17'),_0x2555c5,_0x2e960c[_0xa609('0x18')](_0xa609('0x19')),_0x7f7cc4);_0x134d80[_0xa609('0x1a')](_0x7f7cc4);})[_0xa609('0xa')](function(_0x40472b){console[_0xa609('0x1b')](_0x40472b);logger['error'](_0xa609('0x17'),_0x2555c5,_0x2e960c[_0xa609('0x18')](_0xa609('0x19')),_0x40472b['stack']);_0x134d80[_0xa609('0xe')]();});};}; \ No newline at end of file +var _0x9abf=['bluebird','jayson/promise','client','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','Command','format','iftime\x20%s','indexOf','true','all','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','util'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x9abf,0xd7));var _0xf9ab=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9abf[_0x42cae2];return _0x5f256f;};'use strict';var util=require(_0xf9ab('0x0'));var BPromise=require(_0xf9ab('0x1'));var jayson=require(_0xf9ab('0x2'));var _=require('lodash');var logger=require('../../../config/logger')('routing');var client=jayson[_0xf9ab('0x3')]['http']({'port':0x232a});function request(_0x443bc0,_0x11e54e){return new BPromise(function(_0x341790,_0x22997a){return client['request'](_0x443bc0,_0x11e54e)[_0xf9ab('0x4')](function(_0x5671cb){if(_0x5671cb[_0xf9ab('0x5')]){return _0x22997a(_0x5671cb['error'][_0xf9ab('0x6')]);}else{return _0x341790(_0x5671cb[_0xf9ab('0x7')]);}})[_0xf9ab('0x8')](function(_0x1322e6){return _0x22997a(_0x1322e6);});});}exports[_0xf9ab('0x9')]=function(_0xe4d91d,_0x526ab5,_0x3c2da1){return function(_0x3e31c4){if(_0x3c2da1['rules']&&!_0x3c2da1[_0xf9ab('0xa')][_0xe4d91d]){logger[_0xf9ab('0xb')](_0xf9ab('0xc'),_0xe4d91d);return _0x3e31c4[_0xf9ab('0xd')]();}var _0x106cb0=[];for(var _0x2c999b=0x0;_0x2c999b<_0x526ab5['length'];_0x2c999b+=0x1){_0x106cb0['push'](request(_0xf9ab('0xe'),{'command':util[_0xf9ab('0xf')](_0xf9ab('0x10'),_0x526ab5[_0x2c999b])})[_0xf9ab('0x4')](function(_0x2ad176){return _0x2ad176&&_0x2ad176[_0xf9ab('0x6')]&&_0x2ad176[_0xf9ab('0x6')][_0xf9ab('0x11')](_0xf9ab('0x12'))>=0x0?!![]:![];})['catch'](function(_0x1380ca){logger['error']('[%s][INTERVAL]\x20%s',_0xe4d91d,_0x526ab5[_0x2c999b]);}));}BPromise[_0xf9ab('0x13')](_0x106cb0)[_0xf9ab('0x4')](function(_0x2be943){var _0xa152c3=_['some'](_0x2be943);logger['info'](_0xf9ab('0x14'),_0xe4d91d,_0x526ab5[_0xf9ab('0x15')](_0xf9ab('0x16')),_0xa152c3);_0x3e31c4[_0xf9ab('0x17')](_0xa152c3);})[_0xf9ab('0x8')](function(_0x3e1ec9){console['log'](_0x3e1ec9);logger[_0xf9ab('0x5')]('[%s][INTERVAL]\x20%s\x20%s',_0xe4d91d,_0x526ab5[_0xf9ab('0x15')](_0xf9ab('0x16')),_0x3e1ec9['stack']);_0x3e31c4[_0xf9ab('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 94647fa..d09b39e 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 _0x99b7=['agentcalled','agentcalledAt','called','connectedlinename','error','stack','agentringnoanswer','isNil','reason','rejected','holdtime','ringtime','queuecallerabandon','agentringnoanswerAt','now','abandoned','talktime','agentconnect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid'];(function(_0x3c5c3c,_0x13b428){var _0x2a4714=function(_0x5d5ca3){while(--_0x5d5ca3){_0x3c5c3c['push'](_0x3c5c3c['shift']());}};_0x2a4714(++_0x13b428);}(_0x99b7,0x18f));var _0x799b=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x99b7[_0x3c22e0];return _0x215811;};'use strict';var _=require(_0x799b('0x0'));var util=require(_0x799b('0x1'));var utils=require(_0x799b('0x2'));var agents={};var transfers={};function writeDB(_0x1b1b9e,_0x451d78){utils[_0x799b('0x3')](util[_0x799b('0x4')](_0x799b('0x5'),_0x1b1b9e[_0x799b('0x6')],_0x1b1b9e[_0x799b('0x7')],_0x1b1b9e[_0x799b('0x8')],_0x1b1b9e[_0x799b('0x9')],_0x1b1b9e[_0x799b('0xa')],_0x1b1b9e['calleridnum'],_0x1b1b9e[_0x799b('0xb')],_0x1b1b9e[_0x799b('0xc')]));if(_0x1b1b9e['queue']){utils['getVoiceQueueByName'](_0x1b1b9e['queue'])['then'](function(_0x13b453){if(_0x13b453){_0x1b1b9e[_0x799b('0xd')]=_0x13b453[_0x799b('0xd')];_0x1b1b9e[_0x799b('0xe')]=_0x1b1b9e['agentcomplete']?_0x13b453[_0x799b('0xf')]:![];_0x1b1b9e[_0x799b('0x10')]=_0x1b1b9e['agentacw']?_0x13b453[_0x799b('0x11')]:0x0;}utils[_0x799b('0x12')](_0x799b('0x13'),_0x1b1b9e);});}else{utils[_0x799b('0x12')]('CreateVoiceAgentReport',_0x1b1b9e);}if(_0x451d78){delete transfers[_0x1b1b9e[_0x799b('0x6')]];}else{delete agents[_0x1b1b9e[_0x799b('0x14')]];}}exports[_0x799b('0x15')]=function(_0x2cffb4){try{agents[_0x2cffb4[_0x799b('0x14')]]=_0x2cffb4;agents[_0x2cffb4[_0x799b('0x14')]][_0x799b('0x16')]=utils['now']();agents[_0x2cffb4[_0x799b('0x14')]][_0x799b('0xc')]=_0x799b('0x17');agents[_0x2cffb4['destuniqueid']]['connectedlinenum']=null;agents[_0x2cffb4[_0x799b('0x14')]][_0x799b('0x18')]=null;}catch(_0x532eeb){utils[_0x799b('0x19')](_0x532eeb[_0x799b('0x1a')]);}};exports[_0x799b('0x1b')]=function(_0x30c97a){try{if(!_[_0x799b('0x1c')](agents[_0x30c97a[_0x799b('0x14')]])){agents[_0x30c97a['destuniqueid']][_0x799b('0x1b')]=!![];agents[_0x30c97a[_0x799b('0x14')]]['agentringnoanswerAt']=utils['now']();agents[_0x30c97a['destuniqueid']][_0x799b('0xc')]='rejected';agents[_0x30c97a[_0x799b('0x14')]][_0x799b('0x1d')]=_0x799b('0x1e');agents[_0x30c97a[_0x799b('0x14')]][_0x799b('0x1f')]=_0x30c97a[_0x799b('0x20')]?parseInt(_0x30c97a['ringtime'])/0x3e8:0x0;agents[_0x30c97a['destuniqueid']]['talktime']=0x0;writeDB(agents[_0x30c97a[_0x799b('0x14')]]);}}catch(_0x2cdeaf){utils['error'](_0x2cdeaf[_0x799b('0x1a')]);}};exports[_0x799b('0x21')]=function(_0x475a17){try{_['forIn'](agents,function(_0xf267bb,_0xb635c4){if(_0xf267bb['uniqueid']==_0x475a17[_0x799b('0x6')]){_0xf267bb['agentringnoanswer']=!![];_0xf267bb[_0x799b('0x22')]=utils[_0x799b('0x23')]();_0xf267bb[_0x799b('0xc')]=_0x799b('0x24');_0xf267bb[_0x799b('0x1d')]=_0x799b('0x24');_0xf267bb['holdtime']=_0x475a17[_0x799b('0x1f')];_0xf267bb[_0x799b('0x25')]=0x0;writeDB(_0xf267bb);}});}catch(_0x30b16){utils['error'](_0x30b16[_0x799b('0x1a')]);}};exports[_0x799b('0x26')]=function(_0x48cdfe){try{if(agents[_0x48cdfe['destuniqueid']]){agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0x27')]=utils[_0x799b('0x23')]();agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0xb')]=_0x48cdfe['connectedlinenum'];agents[_0x48cdfe[_0x799b('0x14')]]['connectedlinename']=_0x48cdfe['connectedlinename'];agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0x1f')]=_0x48cdfe[_0x799b('0x20')];agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0xc')]=_0x799b('0x28');_[_0x799b('0x29')](agents,function(_0x907215,_0x4c8bbb){if(_0x907215[_0x799b('0x14')]!=_0x48cdfe['destuniqueid']&&_0x907215[_0x799b('0x6')]==_0x48cdfe['uniqueid']){_0x907215[_0x799b('0x25')]=0x0;_0x907215[_0x799b('0x1f')]=_0x48cdfe[_0x799b('0x20')];_0x907215[_0x799b('0x1b')]=!![];_0x907215[_0x799b('0x22')]=utils[_0x799b('0x23')]();_0x907215['lastevent']='answered_elsewhere';_0x907215[_0x799b('0x1d')]=_0x799b('0x2a');_0x907215[_0x799b('0x2b')]=_0x48cdfe[_0x799b('0x14')];_0x907215[_0x799b('0x2c')]=_0x48cdfe[_0x799b('0x9')];writeDB(_0x907215);}});}}catch(_0x53a09a){utils[_0x799b('0x19')](_0x53a09a[_0x799b('0x1a')]);}};exports[_0x799b('0x2d')]=function(_0x40a894){try{if(!_['isNil'](agents[_0x40a894[_0x799b('0x14')]])){agents[_0x40a894[_0x799b('0x14')]]['agentcomplete']=!![];agents[_0x40a894['destuniqueid']][_0x799b('0x2e')]=utils[_0x799b('0x23')]();agents[_0x40a894[_0x799b('0x14')]]['talktime']=utils[_0x799b('0x2f')](agents[_0x40a894[_0x799b('0x14')]][_0x799b('0x2e')],agents[_0x40a894[_0x799b('0x14')]][_0x799b('0x27')]);agents[_0x40a894[_0x799b('0x14')]][_0x799b('0x1d')]=_0x40a894[_0x799b('0x1d')];agents[_0x40a894[_0x799b('0x14')]][_0x799b('0xc')]=_0x799b('0x30');writeDB(agents[_0x40a894['destuniqueid']]);}}catch(_0x488ea0){utils[_0x799b('0x19')](_0x488ea0[_0x799b('0x1a')]);}};exports[_0x799b('0x31')]=function(_0x5e7a96){try{if(!_[_0x799b('0x1c')](agents[_0x5e7a96[_0x799b('0x32')]])){agents[_0x5e7a96['transfereruniqueid']][_0x799b('0x33')]=!![];agents[_0x5e7a96['transfereruniqueid']][_0x799b('0x34')]=_0x799b('0x35');agents[_0x5e7a96[_0x799b('0x32')]][_0x799b('0x36')]=_0x5e7a96[_0x799b('0x37')];agents[_0x5e7a96[_0x799b('0x32')]][_0x799b('0x38')]=agents[_0x5e7a96[_0x799b('0x32')]][_0x799b('0x6')];}}catch(_0x3098bc){utils[_0x799b('0x19')](_0x3098bc[_0x799b('0x1a')]);}};exports['attendedtransfer']=function(_0x1d896f){try{if(_0x1d896f[_0x799b('0x39')]==_0x1d896f['origtransfererlinkedid']){if(!_[_0x799b('0x1c')](agents[_0x1d896f[_0x799b('0x3a')]])){agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x33')]=!![];agents[_0x1d896f['secondtransfereruniqueid']][_0x799b('0x34')]='ATTENDED';agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x36')]=_0x1d896f['origtransfererexten'];agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x38')]=_0x1d896f[_0x799b('0x39')];}if(_0x1d896f['transfereeuniqueid']&&agents[_0x1d896f[_0x799b('0x3b')]]){agents[_0x1d896f[_0x799b('0x3b')]][_0x799b('0x3c')]=0x1;transfers[_0x1d896f[_0x799b('0x3b')]]=_[_0x799b('0x3d')](agents[_0x1d896f['transfereeuniqueid']]);transfers[_0x1d896f[_0x799b('0x3b')]][_0x799b('0x3e')]=agents[_0x1d896f['secondtransfereruniqueid']][_0x799b('0x3e')];transfers[_0x1d896f[_0x799b('0x3b')]]['calleridname']=agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x3f')];transfers[_0x1d896f[_0x799b('0x3b')]]['agentcalledAt']=utils[_0x799b('0x23')]();transfers[_0x1d896f[_0x799b('0x3b')]][_0x799b('0x27')]=utils[_0x799b('0x23')]();transfers[_0x1d896f['transfereeuniqueid']][_0x799b('0x1f')]=0x0;transfers[_0x1d896f['transfereeuniqueid']][_0x799b('0x3c')]=0x2;}}else if(_0x1d896f[_0x799b('0x3a')]==_0x1d896f[_0x799b('0x40')]){if(!_[_0x799b('0x1c')](agents[_0x1d896f[_0x799b('0x39')]])){agents[_0x1d896f['origtransfereruniqueid']][_0x799b('0x33')]=!![];agents[_0x1d896f['origtransfereruniqueid']][_0x799b('0x34')]=_0x799b('0x41');agents[_0x1d896f[_0x799b('0x39')]][_0x799b('0x36')]=_0x1d896f[_0x799b('0x42')];agents[_0x1d896f[_0x799b('0x39')]][_0x799b('0x38')]=_0x1d896f[_0x799b('0x3a')];}if(_0x1d896f[_0x799b('0x43')]&&agents[_0x1d896f['transfertargetuniqueid']]){agents[_0x1d896f[_0x799b('0x43')]]['agententerreason']=0x1;transfers[_0x1d896f[_0x799b('0x43')]]=_[_0x799b('0x3d')](agents[_0x1d896f[_0x799b('0x43')]]);transfers[_0x1d896f['transfertargetuniqueid']][_0x799b('0x3e')]=agents[_0x1d896f['origtransfereruniqueid']][_0x799b('0x3e')];transfers[_0x1d896f[_0x799b('0x43')]]['calleridname']=agents[_0x1d896f[_0x799b('0x39')]][_0x799b('0x3f')];transfers[_0x1d896f[_0x799b('0x43')]][_0x799b('0x16')]=utils[_0x799b('0x23')]();transfers[_0x1d896f['transfertargetuniqueid']][_0x799b('0x27')]=utils[_0x799b('0x23')]();transfers[_0x1d896f[_0x799b('0x43')]][_0x799b('0x1f')]=0x0;transfers[_0x1d896f[_0x799b('0x43')]]['agententerreason']=0x2;}}}catch(_0x443fcf){utils['error'](_0x443fcf[_0x799b('0x1a')]);}};exports[_0x799b('0x44')]=function(_0x18c27f){try{if(transfers[_0x18c27f[_0x799b('0x6')]]){transfers[_0x18c27f['uniqueid']][_0x799b('0x2d')]=!![];transfers[_0x18c27f['uniqueid']][_0x799b('0x2e')]=utils['now']();transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x25')]=utils[_0x799b('0x2f')](transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x2e')],transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x27')]);transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x1d')]=_0x799b('0x45');transfers[_0x18c27f[_0x799b('0x6')]]['lastevent']='complete';writeDB(transfers[_0x18c27f[_0x799b('0x6')]],!![]);}if(agents[_0x18c27f[_0x799b('0x6')]]&&agents[_0x18c27f[_0x799b('0x6')]][_0x799b('0x27')]){agents[_0x18c27f[_0x799b('0x6')]][_0x799b('0x2d')]=!![];agents[_0x18c27f['uniqueid']]['agentcompleteAt']=utils[_0x799b('0x23')]();agents[_0x18c27f[_0x799b('0x6')]]['talktime']=utils[_0x799b('0x2f')](agents[_0x18c27f['uniqueid']][_0x799b('0x2e')],agents[_0x18c27f[_0x799b('0x6')]]['agentconnectAt']);agents[_0x18c27f['uniqueid']][_0x799b('0x1d')]=agents[_0x18c27f[_0x799b('0x6')]][_0x799b('0x33')]?'transfer':_0x799b('0x45');agents[_0x18c27f['uniqueid']][_0x799b('0xc')]='complete';writeDB(agents[_0x18c27f[_0x799b('0x6')]]);}}catch(_0x2453b5){utils[_0x799b('0x19')](_0x2453b5[_0x799b('0x1a')]);}}; \ No newline at end of file +var _0x707a=['destuniqueid','agentcalledAt','now','lastevent','called','connectedlinename','error','stack','agentringnoanswer','isNil','rejected','reason','holdtime','ringtime','talktime','queuecallerabandon','agentringnoanswerAt','agentconnect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','agentcompleteAt','diffTime','complete','transfereruniqueid','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','transfer','transfertype','ATTENDED','transferexten','origtransfererexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agent','lodash','util','./utils','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x707a,0x17b));var _0xa707=function(_0x39fe2c,_0x330c2d){_0x39fe2c=_0x39fe2c-0x0;var _0x8439c7=_0x707a[_0x39fe2c];return _0x8439c7;};'use strict';var _=require(_0xa707('0x0'));var util=require(_0xa707('0x1'));var utils=require(_0xa707('0x2'));var agents={};var transfers={};function writeDB(_0x3c2faf,_0x4d7231){utils['info'](util[_0xa707('0x3')](_0xa707('0x4'),_0x3c2faf[_0xa707('0x5')],_0x3c2faf[_0xa707('0x6')],_0x3c2faf[_0xa707('0x7')],_0x3c2faf[_0xa707('0x8')],_0x3c2faf[_0xa707('0x9')],_0x3c2faf[_0xa707('0xa')],_0x3c2faf[_0xa707('0xb')],_0x3c2faf['lastevent']));if(_0x3c2faf['queue']){utils[_0xa707('0xc')](_0x3c2faf[_0xa707('0x7')])[_0xa707('0xd')](function(_0x20e928){if(_0x20e928){_0x3c2faf[_0xa707('0xe')]=_0x20e928['type'];_0x3c2faf[_0xa707('0xf')]=_0x3c2faf[_0xa707('0x10')]?_0x20e928[_0xa707('0x11')]:![];_0x3c2faf[_0xa707('0x12')]=_0x3c2faf[_0xa707('0xf')]?_0x20e928[_0xa707('0x13')]:0x0;}utils[_0xa707('0x14')](_0xa707('0x15'),_0x3c2faf);});}else{utils[_0xa707('0x14')](_0xa707('0x15'),_0x3c2faf);}if(_0x4d7231){delete transfers[_0x3c2faf[_0xa707('0x5')]];}else{delete agents[_0x3c2faf['destuniqueid']];}}exports[_0xa707('0x16')]=function(_0x10cf63){try{agents[_0x10cf63['destuniqueid']]=_0x10cf63;agents[_0x10cf63[_0xa707('0x17')]][_0xa707('0x18')]=utils[_0xa707('0x19')]();agents[_0x10cf63[_0xa707('0x17')]][_0xa707('0x1a')]=_0xa707('0x1b');agents[_0x10cf63[_0xa707('0x17')]][_0xa707('0xb')]=null;agents[_0x10cf63[_0xa707('0x17')]][_0xa707('0x1c')]=null;}catch(_0xf612cc){utils[_0xa707('0x1d')](_0xf612cc[_0xa707('0x1e')]);}};exports[_0xa707('0x1f')]=function(_0x301eb4){try{if(!_[_0xa707('0x20')](agents[_0x301eb4['destuniqueid']])){agents[_0x301eb4[_0xa707('0x17')]][_0xa707('0x1f')]=!![];agents[_0x301eb4['destuniqueid']]['agentringnoanswerAt']=utils[_0xa707('0x19')]();agents[_0x301eb4[_0xa707('0x17')]][_0xa707('0x1a')]=_0xa707('0x21');agents[_0x301eb4[_0xa707('0x17')]][_0xa707('0x22')]=_0xa707('0x21');agents[_0x301eb4[_0xa707('0x17')]][_0xa707('0x23')]=_0x301eb4[_0xa707('0x24')]?parseInt(_0x301eb4['ringtime'])/0x3e8:0x0;agents[_0x301eb4[_0xa707('0x17')]][_0xa707('0x25')]=0x0;writeDB(agents[_0x301eb4[_0xa707('0x17')]]);}}catch(_0xc75519){utils[_0xa707('0x1d')](_0xc75519[_0xa707('0x1e')]);}};exports[_0xa707('0x26')]=function(_0x36061c){try{_['forIn'](agents,function(_0x2725c5,_0x36d1cf){if(_0x2725c5[_0xa707('0x5')]==_0x36061c['uniqueid']){_0x2725c5[_0xa707('0x1f')]=!![];_0x2725c5[_0xa707('0x27')]=utils['now']();_0x2725c5[_0xa707('0x1a')]='abandoned';_0x2725c5[_0xa707('0x22')]='abandoned';_0x2725c5[_0xa707('0x23')]=_0x36061c['holdtime'];_0x2725c5[_0xa707('0x25')]=0x0;writeDB(_0x2725c5);}});}catch(_0x44aca1){utils[_0xa707('0x1d')](_0x44aca1['stack']);}};exports[_0xa707('0x28')]=function(_0x1e9c4e){try{if(agents[_0x1e9c4e['destuniqueid']]){agents[_0x1e9c4e[_0xa707('0x17')]][_0xa707('0x29')]=utils[_0xa707('0x19')]();agents[_0x1e9c4e[_0xa707('0x17')]][_0xa707('0xb')]=_0x1e9c4e[_0xa707('0xb')];agents[_0x1e9c4e[_0xa707('0x17')]][_0xa707('0x1c')]=_0x1e9c4e[_0xa707('0x1c')];agents[_0x1e9c4e[_0xa707('0x17')]]['holdtime']=_0x1e9c4e[_0xa707('0x24')];agents[_0x1e9c4e[_0xa707('0x17')]][_0xa707('0x1a')]=_0xa707('0x2a');_[_0xa707('0x2b')](agents,function(_0x33693b,_0x48dcb9){if(_0x33693b['destuniqueid']!=_0x1e9c4e[_0xa707('0x17')]&&_0x33693b['uniqueid']==_0x1e9c4e[_0xa707('0x5')]){_0x33693b[_0xa707('0x25')]=0x0;_0x33693b[_0xa707('0x23')]=_0x1e9c4e[_0xa707('0x24')];_0x33693b[_0xa707('0x1f')]=!![];_0x33693b[_0xa707('0x27')]=utils[_0xa707('0x19')]();_0x33693b[_0xa707('0x1a')]=_0xa707('0x2c');_0x33693b[_0xa707('0x22')]=_0xa707('0x2c');_0x33693b[_0xa707('0x2d')]=_0x1e9c4e['destuniqueid'];_0x33693b['answeredelsewheremembername']=_0x1e9c4e[_0xa707('0x8')];writeDB(_0x33693b);}});}}catch(_0x266b02){utils[_0xa707('0x1d')](_0x266b02[_0xa707('0x1e')]);}};exports[_0xa707('0x10')]=function(_0x2cd8fc){try{if(!_[_0xa707('0x20')](agents[_0x2cd8fc[_0xa707('0x17')]])){agents[_0x2cd8fc['destuniqueid']][_0xa707('0x10')]=!![];agents[_0x2cd8fc[_0xa707('0x17')]][_0xa707('0x2e')]=utils[_0xa707('0x19')]();agents[_0x2cd8fc[_0xa707('0x17')]][_0xa707('0x25')]=utils[_0xa707('0x2f')](agents[_0x2cd8fc['destuniqueid']][_0xa707('0x2e')],agents[_0x2cd8fc[_0xa707('0x17')]][_0xa707('0x29')]);agents[_0x2cd8fc[_0xa707('0x17')]][_0xa707('0x22')]=_0x2cd8fc[_0xa707('0x22')];agents[_0x2cd8fc['destuniqueid']][_0xa707('0x1a')]=_0xa707('0x30');writeDB(agents[_0x2cd8fc[_0xa707('0x17')]]);}}catch(_0x53dcf5){utils['error'](_0x53dcf5[_0xa707('0x1e')]);}};exports['blindtransfer']=function(_0x242cbb){try{if(!_[_0xa707('0x20')](agents[_0x242cbb[_0xa707('0x31')]])){agents[_0x242cbb['transfereruniqueid']]['transfer']=!![];agents[_0x242cbb['transfereruniqueid']]['transfertype']='blind';agents[_0x242cbb['transfereruniqueid']]['transferexten']=_0x242cbb['extension'];agents[_0x242cbb['transfereruniqueid']][_0xa707('0x32')]=agents[_0x242cbb['transfereruniqueid']]['uniqueid'];}}catch(_0x367f53){utils[_0xa707('0x1d')](_0x367f53[_0xa707('0x1e')]);}};exports[_0xa707('0x33')]=function(_0x2d87a5){try{if(_0x2d87a5['origtransfereruniqueid']==_0x2d87a5[_0xa707('0x34')]){if(!_[_0xa707('0x20')](agents[_0x2d87a5['secondtransfereruniqueid']])){agents[_0x2d87a5[_0xa707('0x35')]][_0xa707('0x36')]=!![];agents[_0x2d87a5[_0xa707('0x35')]][_0xa707('0x37')]=_0xa707('0x38');agents[_0x2d87a5[_0xa707('0x35')]][_0xa707('0x39')]=_0x2d87a5[_0xa707('0x3a')];agents[_0x2d87a5['secondtransfereruniqueid']]['transferuniqueid']=_0x2d87a5[_0xa707('0x3b')];}if(_0x2d87a5[_0xa707('0x3c')]&&agents[_0x2d87a5[_0xa707('0x3c')]]){agents[_0x2d87a5['transfereeuniqueid']][_0xa707('0x3d')]=0x1;transfers[_0x2d87a5[_0xa707('0x3c')]]=_[_0xa707('0x3e')](agents[_0x2d87a5['transfereeuniqueid']]);transfers[_0x2d87a5[_0xa707('0x3c')]]['calleridnum']=agents[_0x2d87a5[_0xa707('0x35')]]['calleridnum'];transfers[_0x2d87a5[_0xa707('0x3c')]][_0xa707('0x3f')]=agents[_0x2d87a5[_0xa707('0x35')]][_0xa707('0x3f')];transfers[_0x2d87a5['transfereeuniqueid']][_0xa707('0x18')]=utils['now']();transfers[_0x2d87a5[_0xa707('0x3c')]][_0xa707('0x29')]=utils[_0xa707('0x19')]();transfers[_0x2d87a5['transfereeuniqueid']]['holdtime']=0x0;transfers[_0x2d87a5[_0xa707('0x3c')]][_0xa707('0x3d')]=0x2;}}else if(_0x2d87a5['secondtransfereruniqueid']==_0x2d87a5['secondtransfererlinkedid']){if(!_[_0xa707('0x20')](agents[_0x2d87a5[_0xa707('0x3b')]])){agents[_0x2d87a5[_0xa707('0x3b')]]['transfer']=!![];agents[_0x2d87a5['origtransfereruniqueid']][_0xa707('0x37')]='ATTENDED';agents[_0x2d87a5[_0xa707('0x3b')]]['transferexten']=_0x2d87a5[_0xa707('0x40')];agents[_0x2d87a5[_0xa707('0x3b')]][_0xa707('0x32')]=_0x2d87a5[_0xa707('0x35')];}if(_0x2d87a5['transfertargetuniqueid']&&agents[_0x2d87a5['transfertargetuniqueid']]){agents[_0x2d87a5['transfertargetuniqueid']][_0xa707('0x3d')]=0x1;transfers[_0x2d87a5['transfertargetuniqueid']]=_[_0xa707('0x3e')](agents[_0x2d87a5['transfertargetuniqueid']]);transfers[_0x2d87a5[_0xa707('0x41')]]['calleridnum']=agents[_0x2d87a5['origtransfereruniqueid']][_0xa707('0xa')];transfers[_0x2d87a5[_0xa707('0x41')]][_0xa707('0x3f')]=agents[_0x2d87a5['origtransfereruniqueid']][_0xa707('0x3f')];transfers[_0x2d87a5[_0xa707('0x41')]][_0xa707('0x18')]=utils[_0xa707('0x19')]();transfers[_0x2d87a5[_0xa707('0x41')]][_0xa707('0x29')]=utils[_0xa707('0x19')]();transfers[_0x2d87a5['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x2d87a5[_0xa707('0x41')]]['agententerreason']=0x2;}}}catch(_0x196cde){utils['error'](_0x196cde[_0xa707('0x1e')]);}};exports['hangup']=function(_0x30e3a5){try{if(transfers[_0x30e3a5['uniqueid']]){transfers[_0x30e3a5['uniqueid']][_0xa707('0x10')]=!![];transfers[_0x30e3a5['uniqueid']][_0xa707('0x2e')]=utils[_0xa707('0x19')]();transfers[_0x30e3a5['uniqueid']][_0xa707('0x25')]=utils[_0xa707('0x2f')](transfers[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x2e')],transfers[_0x30e3a5['uniqueid']][_0xa707('0x29')]);transfers[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x22')]='agent';transfers[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x1a')]=_0xa707('0x30');writeDB(transfers[_0x30e3a5[_0xa707('0x5')]],!![]);}if(agents[_0x30e3a5[_0xa707('0x5')]]&&agents[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x29')]){agents[_0x30e3a5['uniqueid']][_0xa707('0x10')]=!![];agents[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x2e')]=utils[_0xa707('0x19')]();agents[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x25')]=utils['diffTime'](agents[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x2e')],agents[_0x30e3a5['uniqueid']][_0xa707('0x29')]);agents[_0x30e3a5['uniqueid']][_0xa707('0x22')]=agents[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x36')]?'transfer':_0xa707('0x42');agents[_0x30e3a5[_0xa707('0x5')]][_0xa707('0x1a')]='complete';writeDB(agents[_0x30e3a5['uniqueid']]);}}catch(_0x1f7d92){utils[_0xa707('0x1d')](_0x1f7d92[_0xa707('0x1e')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index e28df4a..4a12f9b 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 _0x8234=['answertime','hangup','callerid','calleridname','endtime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','lastapplication','Queue','lastdata','queue','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','noop','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','accountcode','source','disposition','getUserByInternal','then','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','error','stack','newstate','channelstate','isNil','systemanswertime','now','context','transfer'];(function(_0x2f1f0f,_0xaf3d2a){var _0x1163bd=function(_0x211892){while(--_0x211892){_0x2f1f0f['push'](_0x2f1f0f['shift']());}};_0x1163bd(++_0xaf3d2a);}(_0x8234,0x159));var _0x4823=function(_0x3f47d8,_0xbdab12){_0x3f47d8=_0x3f47d8-0x0;var _0x50f604=_0x8234[_0x3f47d8];return _0x50f604;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dispositions=[_0x4823('0x0'),_0x4823('0x1'),_0x4823('0x1'),'NO\x20ANSWER',_0x4823('0x0'),_0x4823('0x0'),_0x4823('0x2'),_0x4823('0x3'),_0x4823('0x1'),_0x4823('0x1'),_0x4823('0x1')];var channels={};function writeDB(_0x29b91f){utils[_0x4823('0x4')](util['format'](_0x4823('0x5'),_0x29b91f['uniqueid'],_0x29b91f[_0x4823('0x6')],_0x29b91f[_0x4823('0x7')],_0x29b91f[_0x4823('0x8')],_0x29b91f[_0x4823('0x9')],_0x29b91f['destination'],_0x29b91f['callerid'],_0x29b91f[_0x4823('0xa')]));if(_0x29b91f[_0x4823('0x8')]){utils[_0x4823('0xb')](_0x29b91f[_0x4823('0x8')])[_0x4823('0xc')](function(_0x40e7e7){if(_0x40e7e7){_0x29b91f['UserId']=_0x40e7e7['id'];}utils[_0x4823('0xd')](_0x4823('0xe'),_0x29b91f);});}else{utils[_0x4823('0xd')]('CreateVoiceCallReport',_0x29b91f);}if(channels[_0x29b91f[_0x4823('0xf')]]){delete channels[_0x29b91f[_0x4823('0xf')]];}}exports[_0x4823('0x10')]=function(_0x54bf52){try{if(_0x54bf52[_0x4823('0xf')]==_0x54bf52[_0x4823('0x11')]&&_0x54bf52['channel']!=_0x4823('0x12')){channels[_0x54bf52[_0x4823('0xf')]]={'uniqueid':_0x54bf52[_0x4823('0xf')],'accountcode':_0x54bf52[_0x4823('0x8')],'source':_0x54bf52[_0x4823('0x13')],'destination':_0x54bf52[_0x4823('0x14')],'destinationcontext':_0x54bf52['context'],'channel':_0x54bf52[_0x4823('0x6')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4823('0x0'),'amaflags':'DOCUMENTATION'};}}catch(_0x2bfc02){utils[_0x4823('0x15')](_0x2bfc02[_0x4823('0x16')]);}};exports[_0x4823('0x17')]=function(_0x269cf4){try{if(!_['isNil'](channels[_0x269cf4['uniqueid']])&&_0x269cf4[_0x4823('0x18')]==0x6){if(_[_0x4823('0x19')](channels[_0x269cf4[_0x4823('0xf')]][_0x4823('0x1a')])){channels[_0x269cf4[_0x4823('0xf')]][_0x4823('0x1a')]=utils[_0x4823('0x1b')]();}}else if(!_[_0x4823('0x19')](channels[_0x269cf4['linkedid']])&&_0x269cf4[_0x4823('0x18')]==0x6&&_0x269cf4[_0x4823('0x1c')]!=_0x4823('0x1d')){channels[_0x269cf4[_0x4823('0x11')]][_0x4823('0x8')]=_0x269cf4['accountcode'];channels[_0x269cf4[_0x4823('0x11')]]['destinationchannel']=_0x269cf4[_0x4823('0x6')];if(_[_0x4823('0x19')](channels[_0x269cf4[_0x4823('0x11')]]['answertime'])){channels[_0x269cf4[_0x4823('0x11')]][_0x4823('0x1e')]=utils[_0x4823('0x1b')]();}channels[_0x269cf4[_0x4823('0x11')]][_0x4823('0xa')]=dispositions[_['toNumber'](_0x269cf4['channelstate'])]||'ANSWERED';}}catch(_0x2f07df){utils[_0x4823('0x15')](_0x2f07df['stack']);}};exports[_0x4823('0x1f')]=function(_0xf76834){try{if(!_[_0x4823('0x19')](channels[_0xf76834[_0x4823('0xf')]])){if(_['isNil'](channels[_0xf76834[_0x4823('0xf')]][_0x4823('0x20')])){channels[_0xf76834['uniqueid']][_0x4823('0x20')]=_0xf76834[_0x4823('0x21')]+'\x20<'+_0xf76834[_0x4823('0x13')]+'>';}channels[_0xf76834['uniqueid']][_0x4823('0x22')]=utils['now']();channels[_0xf76834['uniqueid']]['duration']=utils['diffTime'](channels[_0xf76834['uniqueid']][_0x4823('0x22')],channels[_0xf76834[_0x4823('0xf')]]['starttime']);channels[_0xf76834['uniqueid']][_0x4823('0x23')]=channels[_0xf76834['uniqueid']]['answertime']?utils[_0x4823('0x24')](channels[_0xf76834[_0x4823('0xf')]][_0x4823('0x22')],channels[_0xf76834[_0x4823('0xf')]][_0x4823('0x1e')]):0x0;writeDB(channels[_0xf76834['uniqueid']]);}}catch(_0x346c00){utils[_0x4823('0x15')](_0x346c00[_0x4823('0x16')]);}};exports[_0x4823('0x25')]=function(_0xf2ea23){try{if(!_[_0x4823('0x19')](channels[_0xf2ea23['localtwolinkedid']])){if(channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x6')]==_0xf2ea23[_0x4823('0x27')]){channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x28')]=_0xf2ea23[_0x4823('0x29')];channels[_0xf2ea23['localtwolinkedid']][_0x4823('0x2a')]='_attended';}else if(channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x6')]=_0xf2ea23[_0x4823('0x2b')]){channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x28')]=_0xf2ea23[_0x4823('0x2c')];channels[_0xf2ea23['localtwolinkedid']][_0x4823('0x2a')]=_0x4823('0x2d');}}}catch(_0x25a834){utils[_0x4823('0x15')](_0x25a834['stack']);}};exports['musiconholdstart']=function(_0x427cfe){try{if(!_[_0x4823('0x19')](channels[_0x427cfe[_0x4823('0xf')]])){channels[_0x427cfe[_0x4823('0xf')]][_0x4823('0x2e')]=utils[_0x4823('0x1b')]();}}catch(_0x216303){utils[_0x4823('0x15')](_0x216303[_0x4823('0x16')]);}};exports[_0x4823('0x2f')]=function(_0xda6a5c){try{if(!_[_0x4823('0x19')](channels[_0xda6a5c[_0x4823('0xf')]])){if(!_[_0x4823('0x19')](channels[_0xda6a5c['uniqueid']][_0x4823('0x2e')])){channels[_0xda6a5c[_0x4823('0xf')]][_0x4823('0x30')]+=utils[_0x4823('0x24')](utils[_0x4823('0x1b')](),channels[_0xda6a5c['uniqueid']]['musiconholdstartAt']);delete channels[_0xda6a5c[_0x4823('0xf')]]['musiconholdstartAt'];}}}catch(_0x21d2ac){utils['error'](_0x21d2ac['stack']);}};exports[_0x4823('0x31')]=function(_0x3568d5){try{if(!_[_0x4823('0x19')](channels[_0x3568d5[_0x4823('0xf')]])){if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')]['xmd-originatecalleridnum'])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x9')]=_0x3568d5[_0x4823('0x33')];}if(!_['isNil'](_0x3568d5['variable'][_0x4823('0x34')])){channels[_0x3568d5[_0x4823('0xf')]]['destination']=_0x3568d5['value'];channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x20')]='\x22'+_0x3568d5[_0x4823('0x33')]+_0x4823('0x35')+_0x3568d5[_0x4823('0x33')]+'>';}if(!_[_0x4823('0x19')](_0x3568d5['variable'][_0x4823('0x36')])||!_['isNil'](_0x3568d5['variable'][_0x4823('0x37')])){channels[_0x3568d5['uniqueid']][_0x4823('0x20')]=_0x3568d5[_0x4823('0x33')];}if(!_[_0x4823('0x19')](_0x3568d5['variable']['xmd-queue'])||!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')]['xmcs-queue'])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x38')]=_0x4823('0x39');channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3a')]=_0x3568d5[_0x4823('0x33')];channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3b')]=!![];}if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')]['xmd-contactid'])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3c')]=_0x3568d5[_0x4823('0x33')];}if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')][_0x4823('0x3d')])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x7')]=_0x3568d5[_0x4823('0x33')];}if(!_['isNil'](_0x3568d5[_0x4823('0x32')][_0x4823('0x3e')])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3f')]=_0x3568d5[_0x4823('0x33')];}if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')][_0x4823('0x40')])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x40')]=_0x3568d5[_0x4823('0x33')];}}}catch(_0x4a8441){utils['error'](_0x4a8441[_0x4823('0x16')]);}};exports[_0x4823('0x41')]=function(_0x519af2){try{if(!_[_0x4823('0x19')](channels[_0x519af2[_0x4823('0xf')]])){if(_0x519af2[_0x4823('0x42')][_0x4823('0x43')]()==_0x4823('0x44')&&_[_0x4823('0x45')](_0x519af2[_0x4823('0x46')][_0x4823('0x43')](),_0x4823('0x47'))){var _0x53d861=_0x519af2['appdata'][_0x4823('0x48')]('=');var _0x59f1f6=_0x53d861[0x0]['substring'](_0x53d861[0x0][_0x4823('0x49')]('(')+0x1,_0x53d861[0x0]['lastIndexOf'](')'));var _0x46ce4a=_0x53d861[0x1];channels[_0x519af2[_0x4823('0xf')]][_0x59f1f6]=_0x46ce4a;}if(!_['includes'](['hangup',_0x4823('0x4a'),'execif',_0x4823('0x44'),'gotoif'],_0x519af2[_0x4823('0x42')]['toLowerCase']())){channels[_0x519af2['uniqueid']]['lastapplication']=_0x519af2[_0x4823('0x42')];channels[_0x519af2[_0x4823('0xf')]][_0x4823('0x3a')]=_0x519af2['appdata'];}}}catch(_0x511b03){utils[_0x4823('0x15')](_0x511b03['stack']);}}; \ No newline at end of file +var _0x74a2=['channel','now','DOCUMENTATION','error','stack','newstate','isNil','channelstate','systemanswertime','transfer','answertime','toNumber','hangup','calleridname','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','destinationchannel','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','\x22\x20<','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','appdata','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','util','NO\x20ANSWER','BUSY','FAILED','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','linkedid','OutgoingSpoolFailed','calleridnum','exten','context'];(function(_0x1990bd,_0x1d1cd9){var _0x1e05fa=function(_0x23d227){while(--_0x23d227){_0x1990bd['push'](_0x1990bd['shift']());}};_0x1e05fa(++_0x1d1cd9);}(_0x74a2,0xdb));var _0x274a=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0x74a2[_0x104e21];return _0x605b37;};'use strict';var _=require('lodash');var util=require(_0x274a('0x0'));var utils=require('./utils');var dispositions=[_0x274a('0x1'),'FAILED','FAILED',_0x274a('0x1'),_0x274a('0x1'),_0x274a('0x1'),'ANSWERED',_0x274a('0x2'),'FAILED',_0x274a('0x3'),_0x274a('0x3')];var channels={};function writeDB(_0x51276e){utils[_0x274a('0x4')](util[_0x274a('0x5')](_0x274a('0x6'),_0x51276e[_0x274a('0x7')],_0x51276e['channel'],_0x51276e[_0x274a('0x8')],_0x51276e[_0x274a('0x9')],_0x51276e[_0x274a('0xa')],_0x51276e[_0x274a('0xb')],_0x51276e[_0x274a('0xc')],_0x51276e[_0x274a('0xd')]));if(_0x51276e[_0x274a('0x9')]){utils[_0x274a('0xe')](_0x51276e['accountcode'])[_0x274a('0xf')](function(_0x53c149){if(_0x53c149){_0x51276e[_0x274a('0x10')]=_0x53c149['id'];}utils[_0x274a('0x11')](_0x274a('0x12'),_0x51276e);});}else{utils[_0x274a('0x11')](_0x274a('0x12'),_0x51276e);}if(channels[_0x51276e[_0x274a('0x7')]]){delete channels[_0x51276e[_0x274a('0x7')]];}}exports['newchannel']=function(_0x57b173){try{if(_0x57b173[_0x274a('0x7')]==_0x57b173[_0x274a('0x13')]&&_0x57b173['channel']!=_0x274a('0x14')){channels[_0x57b173['uniqueid']]={'uniqueid':_0x57b173[_0x274a('0x7')],'accountcode':_0x57b173[_0x274a('0x9')],'source':_0x57b173[_0x274a('0x15')],'destination':_0x57b173[_0x274a('0x16')],'destinationcontext':_0x57b173[_0x274a('0x17')],'channel':_0x57b173[_0x274a('0x18')],'starttime':utils[_0x274a('0x19')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x274a('0x1'),'amaflags':_0x274a('0x1a')};}}catch(_0x5b1917){utils[_0x274a('0x1b')](_0x5b1917[_0x274a('0x1c')]);}};exports[_0x274a('0x1d')]=function(_0x724612){try{if(!_[_0x274a('0x1e')](channels[_0x724612[_0x274a('0x7')]])&&_0x724612[_0x274a('0x1f')]==0x6){if(_[_0x274a('0x1e')](channels[_0x724612[_0x274a('0x7')]]['systemanswertime'])){channels[_0x724612[_0x274a('0x7')]][_0x274a('0x20')]=utils[_0x274a('0x19')]();}}else if(!_['isNil'](channels[_0x724612[_0x274a('0x13')]])&&_0x724612[_0x274a('0x1f')]==0x6&&_0x724612['context']!=_0x274a('0x21')){channels[_0x724612['linkedid']][_0x274a('0x9')]=_0x724612[_0x274a('0x9')];channels[_0x724612[_0x274a('0x13')]]['destinationchannel']=_0x724612[_0x274a('0x18')];if(_[_0x274a('0x1e')](channels[_0x724612[_0x274a('0x13')]]['answertime'])){channels[_0x724612['linkedid']][_0x274a('0x22')]=utils[_0x274a('0x19')]();}channels[_0x724612[_0x274a('0x13')]][_0x274a('0xd')]=dispositions[_[_0x274a('0x23')](_0x724612[_0x274a('0x1f')])]||'ANSWERED';}}catch(_0x1e37a3){utils[_0x274a('0x1b')](_0x1e37a3['stack']);}};exports[_0x274a('0x24')]=function(_0x5ac05a){try{if(!_[_0x274a('0x1e')](channels[_0x5ac05a['uniqueid']])){if(_['isNil'](channels[_0x5ac05a[_0x274a('0x7')]]['callerid'])){channels[_0x5ac05a[_0x274a('0x7')]][_0x274a('0xc')]=_0x5ac05a[_0x274a('0x25')]+'\x20<'+_0x5ac05a[_0x274a('0x15')]+'>';}channels[_0x5ac05a[_0x274a('0x7')]][_0x274a('0x26')]=utils[_0x274a('0x19')]();channels[_0x5ac05a['uniqueid']][_0x274a('0x27')]=utils[_0x274a('0x28')](channels[_0x5ac05a[_0x274a('0x7')]]['endtime'],channels[_0x5ac05a['uniqueid']]['starttime']);channels[_0x5ac05a['uniqueid']]['billableseconds']=channels[_0x5ac05a['uniqueid']][_0x274a('0x22')]?utils[_0x274a('0x28')](channels[_0x5ac05a['uniqueid']][_0x274a('0x26')],channels[_0x5ac05a[_0x274a('0x7')]]['answertime']):0x0;writeDB(channels[_0x5ac05a[_0x274a('0x7')]]);}}catch(_0x44b035){utils['error'](_0x44b035[_0x274a('0x1c')]);}};exports[_0x274a('0x29')]=function(_0xab1360){try{if(!_['isNil'](channels[_0xab1360[_0x274a('0x2a')]])){if(channels[_0xab1360['localtwolinkedid']][_0x274a('0x18')]==_0xab1360['transfereechannel']){channels[_0xab1360[_0x274a('0x2a')]][_0x274a('0x2b')]=_0xab1360[_0x274a('0x2c')];channels[_0xab1360['localtwolinkedid']][_0x274a('0x2d')]='_attended';}else if(channels[_0xab1360[_0x274a('0x2a')]][_0x274a('0x18')]=_0xab1360[_0x274a('0x2e')]){channels[_0xab1360[_0x274a('0x2a')]][_0x274a('0x2b')]=_0xab1360[_0x274a('0x2f')];channels[_0xab1360['localtwolinkedid']]['userfield']=_0x274a('0x30');}}}catch(_0x282ff3){utils[_0x274a('0x1b')](_0x282ff3[_0x274a('0x1c')]);}};exports[_0x274a('0x31')]=function(_0x291d05){try{if(!_[_0x274a('0x1e')](channels[_0x291d05[_0x274a('0x7')]])){channels[_0x291d05[_0x274a('0x7')]][_0x274a('0x32')]=utils['now']();}}catch(_0x269b83){utils[_0x274a('0x1b')](_0x269b83[_0x274a('0x1c')]);}};exports[_0x274a('0x33')]=function(_0x50e906){try{if(!_['isNil'](channels[_0x50e906[_0x274a('0x7')]])){if(!_['isNil'](channels[_0x50e906[_0x274a('0x7')]][_0x274a('0x32')])){channels[_0x50e906[_0x274a('0x7')]][_0x274a('0x34')]+=utils[_0x274a('0x28')](utils[_0x274a('0x19')](),channels[_0x50e906['uniqueid']][_0x274a('0x32')]);delete channels[_0x50e906[_0x274a('0x7')]][_0x274a('0x32')];}}}catch(_0x155c4b){utils[_0x274a('0x1b')](_0x155c4b[_0x274a('0x1c')]);}};exports[_0x274a('0x35')]=function(_0x42eaaf){try{if(!_[_0x274a('0x1e')](channels[_0x42eaaf[_0x274a('0x7')]])){if(!_[_0x274a('0x1e')](_0x42eaaf[_0x274a('0x36')][_0x274a('0x37')])){channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0xa')]=_0x42eaaf[_0x274a('0x38')];}if(!_[_0x274a('0x1e')](_0x42eaaf[_0x274a('0x36')][_0x274a('0x39')])){channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0xb')]=_0x42eaaf['value'];channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0xc')]='\x22'+_0x42eaaf['value']+_0x274a('0x3a')+_0x42eaaf[_0x274a('0x38')]+'>';}if(!_[_0x274a('0x1e')](_0x42eaaf['variable']['xmd-callerid-preview'])||!_[_0x274a('0x1e')](_0x42eaaf['variable']['xmd-callerid'])){channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0xc')]=_0x42eaaf[_0x274a('0x38')];}if(!_[_0x274a('0x1e')](_0x42eaaf[_0x274a('0x36')]['xmd-queue'])||!_[_0x274a('0x1e')](_0x42eaaf['variable'][_0x274a('0x3b')])){channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0x3c')]=_0x274a('0x3d');channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0x3e')]=_0x42eaaf[_0x274a('0x38')];channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0x3f')]=!![];}if(!_[_0x274a('0x1e')](_0x42eaaf[_0x274a('0x36')][_0x274a('0x40')])){channels[_0x42eaaf['uniqueid']]['ContactId']=_0x42eaaf['value'];}if(!_[_0x274a('0x1e')](_0x42eaaf['variable'][_0x274a('0x41')])){channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0x8')]=_0x42eaaf[_0x274a('0x38')];}if(!_[_0x274a('0x1e')](_0x42eaaf['variable'][_0x274a('0x42')])){channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0x43')]=_0x42eaaf['value'];}if(!_[_0x274a('0x1e')](_0x42eaaf['variable'][_0x274a('0x44')])){channels[_0x42eaaf[_0x274a('0x7')]][_0x274a('0x44')]=_0x42eaaf[_0x274a('0x38')];}}}catch(_0x3e796c){utils[_0x274a('0x1b')](_0x3e796c[_0x274a('0x1c')]);}};exports[_0x274a('0x45')]=function(_0x7597d0){try{if(!_[_0x274a('0x1e')](channels[_0x7597d0[_0x274a('0x7')]])){if(_0x7597d0[_0x274a('0x46')][_0x274a('0x47')]()==_0x274a('0x48')&&_['startsWith'](_0x7597d0[_0x274a('0x49')][_0x274a('0x47')](),_0x274a('0x4a'))){var _0x246f0e=_0x7597d0[_0x274a('0x49')]['split']('=');var _0x8e5f46=_0x246f0e[0x0][_0x274a('0x4b')](_0x246f0e[0x0]['lastIndexOf']('(')+0x1,_0x246f0e[0x0][_0x274a('0x4c')](')'));var _0x1cac83=_0x246f0e[0x1];channels[_0x7597d0[_0x274a('0x7')]][_0x8e5f46]=_0x1cac83;}if(!_[_0x274a('0x4d')](['hangup',_0x274a('0x4e'),_0x274a('0x4f'),_0x274a('0x48'),_0x274a('0x50')],_0x7597d0['application'][_0x274a('0x47')]())){channels[_0x7597d0[_0x274a('0x7')]][_0x274a('0x3c')]=_0x7597d0['application'];channels[_0x7597d0['uniqueid']][_0x274a('0x3e')]=_0x7597d0[_0x274a('0x49')];}}}catch(_0x54d412){utils['error'](_0x54d412[_0x274a('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 6fb662f..14c19f0 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 _0xe0ae=['info','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','connect'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xe0ae,0xa1));var _0xee0a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe0ae[_0x1cc8fe];return _0x230054;};'use strict';var utils=require('./utils');var _=require('lodash');exports[_0xee0a('0x0')]=function(){utils[_0xee0a('0x1')]('CONNECTED');};exports[_0xee0a('0x2')]=function(){utils['info'](_0xee0a('0x3'));};exports[_0xee0a('0x4')]=function(){utils['info'](_0xee0a('0x5'));};exports['error']=function(_0x5bef07){utils[_0xee0a('0x6')](_0x5bef07);};exports[_0xee0a('0x7')]=function(){utils[_0xee0a('0x1')](_0xee0a('0x8'));};exports['managerevent']=function(_0x2296b9){}; \ No newline at end of file +var _0xbff5=['error','close','CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown','fullybooted'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbff5,0x1bc));var _0x5bff=function(_0x119b08,_0x4f2d14){_0x119b08=_0x119b08-0x0;var _0x492f0c=_0xbff5[_0x119b08];return _0x492f0c;};'use strict';var utils=require(_0x5bff('0x0'));var _=require(_0x5bff('0x1'));exports[_0x5bff('0x2')]=function(){utils[_0x5bff('0x3')](_0x5bff('0x4'));};exports[_0x5bff('0x5')]=function(){utils[_0x5bff('0x3')]('SHUTDOWN');};exports[_0x5bff('0x6')]=function(){utils['info']('FULLYBOOTED');};exports[_0x5bff('0x7')]=function(_0x1d8650){utils[_0x5bff('0x7')](_0x1d8650);};exports[_0x5bff('0x8')]=function(){utils[_0x5bff('0x3')](_0x5bff('0x9'));};exports[_0x5bff('0xa')]=function(_0x139c99){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index ff803f4..0b3d3b5 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 _0x61b5=['endtime','billableseconds','lodash','util','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','connectedlinenum','request','CreateVoiceDialReport','application','toLowerCase','set','appdata','cdr(routeid)','split','error','stack','isNil','variable','outboundrouteid','value','dialbegin','assign','now','called','dialend','dialstatus','ANSWER','answertime','lastevent','connect','complete','duration','diffTime','starttime'];(function(_0x40dcd1,_0x5cd1da){var _0x5c056b=function(_0x87a3a7){while(--_0x87a3a7){_0x40dcd1['push'](_0x40dcd1['shift']());}};_0x5c056b(++_0x5cd1da);}(_0x61b5,0x17e));var _0x561b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x61b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x561b('0x0'));var util=require(_0x561b('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x55a3d1){utils[_0x561b('0x2')](util['format'](_0x561b('0x3'),_0x55a3d1[_0x561b('0x4')],_0x55a3d1[_0x561b('0x5')],_0x55a3d1['dialstring'],_0x55a3d1[_0x561b('0x6')],_0x55a3d1[_0x561b('0x7')],_0x55a3d1['dialstatus']));utils[_0x561b('0x8')](_0x561b('0x9'),_0x55a3d1);delete dials[_0x55a3d1[_0x561b('0x4')]];}exports['newexten']=function(_0x48bd42){try{if(_0x48bd42[_0x561b('0xa')][_0x561b('0xb')]()==_0x561b('0xc')&&_['startsWith'](_0x48bd42[_0x561b('0xd')][_0x561b('0xb')](),_0x561b('0xe'))){var _0x2f0006=_0x48bd42['appdata'][_0x561b('0xf')]('=');dials[_0x48bd42[_0x561b('0x4')]]={'routeId':_0x2f0006[0x1]};}}catch(_0x1074a1){utils[_0x561b('0x10')](_0x1074a1[_0x561b('0x11')]);}};exports['varset']=function(_0xbbde36){try{if(!_[_0x561b('0x12')](_0xbbde36[_0x561b('0x13')][_0x561b('0x14')])){dials[_0xbbde36['uniqueid']]={'routeId':_0xbbde36[_0x561b('0x15')]};}}catch(_0x3754ae){utils[_0x561b('0x10')](_0x3754ae['stack']);}};exports[_0x561b('0x16')]=function(_0x2fe4c0){try{if(!_[_0x561b('0x12')](dials[_0x2fe4c0['uniqueid']])){dials[_0x2fe4c0[_0x561b('0x4')]]=_[_0x561b('0x17')](dials[_0x2fe4c0[_0x561b('0x4')]],_0x2fe4c0);dials[_0x2fe4c0[_0x561b('0x4')]]['starttime']=utils[_0x561b('0x18')]();dials[_0x2fe4c0[_0x561b('0x4')]]['lastevent']=_0x561b('0x19');}}catch(_0x3859fe){utils['error'](_0x3859fe['stack']);}};exports[_0x561b('0x1a')]=function(_0x204a0a){try{if(!_[_0x561b('0x12')](dials[_0x204a0a[_0x561b('0x4')]])){dials[_0x204a0a['uniqueid']][_0x561b('0x1b')]=_0x204a0a[_0x561b('0x1b')];if(_0x204a0a[_0x561b('0x1b')]==_0x561b('0x1c')){dials[_0x204a0a[_0x561b('0x4')]]=_['assign'](dials[_0x204a0a[_0x561b('0x4')]],_0x204a0a);dials[_0x204a0a[_0x561b('0x4')]][_0x561b('0x1d')]=utils[_0x561b('0x18')]();dials[_0x204a0a[_0x561b('0x4')]][_0x561b('0x1e')]=_0x561b('0x1f');}}}catch(_0x304ff8){utils[_0x561b('0x10')](_0x304ff8[_0x561b('0x11')]);}};exports['hangup']=function(_0x3283fc){try{if(!_[_0x561b('0x12')](dials[_0x3283fc[_0x561b('0x4')]])){dials[_0x3283fc['uniqueid']]=_['assign'](dials[_0x3283fc[_0x561b('0x4')]],{'endtime':utils[_0x561b('0x18')](),'lastevent':_0x561b('0x20')});dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x21')]=utils[_0x561b('0x22')](dials[_0x3283fc[_0x561b('0x4')]]['endtime'],dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x23')]);dials[_0x3283fc[_0x561b('0x4')]]['holdtime']=utils[_0x561b('0x22')](dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x1d')]||dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x24')],dials[_0x3283fc[_0x561b('0x4')]]['starttime']);dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x25')]=dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x1d')]?utils['diffTime'](dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x24')],dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x1d')]):0x0;writeDB(dials[_0x3283fc[_0x561b('0x4')]]);}}catch(_0x195faf){utils['error'](_0x195faf[_0x561b('0x11')]);}}; \ No newline at end of file +var _0xe615=['calleridnum','dialstatus','request','application','set','cdr(routeid)','appdata','error','varset','isNil','variable','outboundrouteid','value','stack','dialbegin','starttime','dialend','assign','now','connect','hangup','diffTime','billableseconds','endtime','answertime','lodash','util','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','dialstring'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe615,0xb9));var _0x5e61=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xe615[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0x5e61('0x0'));var util=require(_0x5e61('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x3171da){utils[_0x5e61('0x2')](util['format'](_0x5e61('0x3'),_0x3171da[_0x5e61('0x4')],_0x3171da[_0x5e61('0x5')],_0x3171da[_0x5e61('0x6')],_0x3171da[_0x5e61('0x7')],_0x3171da['connectedlinenum'],_0x3171da[_0x5e61('0x8')]));utils[_0x5e61('0x9')]('CreateVoiceDialReport',_0x3171da);delete dials[_0x3171da['uniqueid']];}exports['newexten']=function(_0x1898f2){try{if(_0x1898f2[_0x5e61('0xa')]['toLowerCase']()==_0x5e61('0xb')&&_['startsWith'](_0x1898f2['appdata']['toLowerCase'](),_0x5e61('0xc'))){var _0x4548da=_0x1898f2[_0x5e61('0xd')]['split']('=');dials[_0x1898f2[_0x5e61('0x4')]]={'routeId':_0x4548da[0x1]};}}catch(_0x5b526f){utils[_0x5e61('0xe')](_0x5b526f['stack']);}};exports[_0x5e61('0xf')]=function(_0x33d332){try{if(!_[_0x5e61('0x10')](_0x33d332[_0x5e61('0x11')][_0x5e61('0x12')])){dials[_0x33d332[_0x5e61('0x4')]]={'routeId':_0x33d332[_0x5e61('0x13')]};}}catch(_0x45a2b5){utils[_0x5e61('0xe')](_0x45a2b5[_0x5e61('0x14')]);}};exports[_0x5e61('0x15')]=function(_0x1c8993){try{if(!_[_0x5e61('0x10')](dials[_0x1c8993['uniqueid']])){dials[_0x1c8993['uniqueid']]=_['assign'](dials[_0x1c8993[_0x5e61('0x4')]],_0x1c8993);dials[_0x1c8993[_0x5e61('0x4')]][_0x5e61('0x16')]=utils['now']();dials[_0x1c8993['uniqueid']]['lastevent']='called';}}catch(_0x1c3f2b){utils[_0x5e61('0xe')](_0x1c3f2b['stack']);}};exports[_0x5e61('0x17')]=function(_0x3376ce){try{if(!_[_0x5e61('0x10')](dials[_0x3376ce['uniqueid']])){dials[_0x3376ce[_0x5e61('0x4')]][_0x5e61('0x8')]=_0x3376ce[_0x5e61('0x8')];if(_0x3376ce[_0x5e61('0x8')]=='ANSWER'){dials[_0x3376ce['uniqueid']]=_[_0x5e61('0x18')](dials[_0x3376ce[_0x5e61('0x4')]],_0x3376ce);dials[_0x3376ce[_0x5e61('0x4')]]['answertime']=utils[_0x5e61('0x19')]();dials[_0x3376ce[_0x5e61('0x4')]]['lastevent']=_0x5e61('0x1a');}}}catch(_0xd6f36e){utils[_0x5e61('0xe')](_0xd6f36e[_0x5e61('0x14')]);}};exports[_0x5e61('0x1b')]=function(_0x3430d4){try{if(!_[_0x5e61('0x10')](dials[_0x3430d4[_0x5e61('0x4')]])){dials[_0x3430d4[_0x5e61('0x4')]]=_[_0x5e61('0x18')](dials[_0x3430d4[_0x5e61('0x4')]],{'endtime':utils[_0x5e61('0x19')](),'lastevent':'complete'});dials[_0x3430d4[_0x5e61('0x4')]]['duration']=utils[_0x5e61('0x1c')](dials[_0x3430d4['uniqueid']]['endtime'],dials[_0x3430d4[_0x5e61('0x4')]][_0x5e61('0x16')]);dials[_0x3430d4[_0x5e61('0x4')]]['holdtime']=utils[_0x5e61('0x1c')](dials[_0x3430d4[_0x5e61('0x4')]]['answertime']||dials[_0x3430d4[_0x5e61('0x4')]]['endtime'],dials[_0x3430d4[_0x5e61('0x4')]]['starttime']);dials[_0x3430d4[_0x5e61('0x4')]][_0x5e61('0x1d')]=dials[_0x3430d4['uniqueid']]['answertime']?utils[_0x5e61('0x1c')](dials[_0x3430d4['uniqueid']][_0x5e61('0x1e')],dials[_0x3430d4[_0x5e61('0x4')]][_0x5e61('0x1f')]):0x0;writeDB(dials[_0x3430d4[_0x5e61('0x4')]]);}}catch(_0x3fdea6){utils[_0x5e61('0xe')](_0x3fdea6[_0x5e61('0x14')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index d8b334b..7749bd0 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 _0xdaf7=['varset','newexten','newchannel','dialbegin','asterisk-manager','../../config/environment','./utils','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer'];(function(_0x2240cf,_0x41fab5){var _0x4c0941=function(_0xbf85ce){while(--_0xbf85ce){_0x2240cf['push'](_0x2240cf['shift']());}};_0x4c0941(++_0x41fab5);}(_0xdaf7,0x14c));var _0x7daf=function(_0x584cdf,_0x345d92){_0x584cdf=_0x584cdf-0x0;var _0x26343f=_0xdaf7[_0x584cdf];return _0x26343f;};var AsteriskManager=require(_0x7daf('0x0'));var config=require(_0x7daf('0x1'));var utils=require(_0x7daf('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config[_0x7daf('0x3')]['ip'],config[_0x7daf('0x3')][_0x7daf('0x4')],config['asterisk'][_0x7daf('0x5')],!![]);ami[_0x7daf('0x6')]();if(config[_0x7daf('0x7')]&&config[_0x7daf('0x7')][_0x7daf('0x8')]){utils[_0x7daf('0x9')](_0x7daf('0xa'));}else{var agents=require(_0x7daf('0xb'));var calls=require(_0x7daf('0xc'));var queues=require(_0x7daf('0xd'));var recordings=require(_0x7daf('0xe'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x7daf('0xf'));var core=require(_0x7daf('0x10'));ami['on'](_0x7daf('0x11'),core[_0x7daf('0x11')]);ami['on'](_0x7daf('0x12'),core[_0x7daf('0x12')]);ami['on'](_0x7daf('0x13'),core[_0x7daf('0x13')]);ami['on'](_0x7daf('0x14'),core[_0x7daf('0x14')]);ami['on']('close',core[_0x7daf('0x15')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x7daf('0x16'),function(_0x1e0025){try{members[_0x7daf('0x16')](_0x1e0025);}catch(_0x31313e){utils['error'](_0x31313e);}});ami['on']('agentcalled',function(_0x12d541){try{agents[_0x7daf('0x17')](_0x12d541);}catch(_0x243fc0){utils['error'](_0x243fc0);}});ami['on'](_0x7daf('0x18'),function(_0xb5d0f2){try{agents[_0x7daf('0x18')](_0xb5d0f2);}catch(_0x4cde09){utils[_0x7daf('0x14')](_0x4cde09);}});ami['on']('agentconnect',function(_0x4a8c56){try{agents[_0x7daf('0x19')](_0x4a8c56);queues[_0x7daf('0x19')](_0x4a8c56);}catch(_0x11dcf4){utils[_0x7daf('0x14')](_0x11dcf4);}});ami['on'](_0x7daf('0x1a'),function(_0x28809f){try{agents['agentcomplete'](_0x28809f);queues[_0x7daf('0x1a')](_0x28809f);members[_0x7daf('0x1a')](_0x28809f);}catch(_0x309f42){utils['error'](_0x309f42);}});ami['on'](_0x7daf('0x1b'),function(_0x5e5583){try{agents[_0x7daf('0x1b')](_0x5e5583);queues[_0x7daf('0x1b')](_0x5e5583);}catch(_0x31dd25){utils[_0x7daf('0x14')](_0x31dd25);}});ami['on'](_0x7daf('0x1c'),function(_0x699b49){try{queues[_0x7daf('0x1c')](_0x699b49);recordings[_0x7daf('0x1c')](_0x699b49);}catch(_0x592cab){utils['error'](_0x592cab);}});ami['on'](_0x7daf('0x1d'),function(_0x218810){try{queues['queuecallerleave'](_0x218810);}catch(_0x94bc0d){utils[_0x7daf('0x14')](_0x94bc0d);}});ami['on'](_0x7daf('0x1e'),function(_0x1bc311){try{queues[_0x7daf('0x1e')](_0x1bc311);calls[_0x7daf('0x1e')](_0x1bc311);}catch(_0xa748c3){utils[_0x7daf('0x14')](_0xa748c3);}});ami['on'](_0x7daf('0x1f'),function(_0x3e0bca){try{queues[_0x7daf('0x1f')](_0x3e0bca);calls[_0x7daf('0x1f')](_0x3e0bca);}catch(_0x11369e){utils[_0x7daf('0x14')](_0x11369e);}});ami['on'](_0x7daf('0x20'),function(_0x4557ec){try{calls['newstate'](_0x4557ec);recordings['newstate'](_0x4557ec);}catch(_0x1b0d56){utils[_0x7daf('0x14')](_0x1b0d56);}});ami['on'](_0x7daf('0x21'),function(_0x35a416){try{calls[_0x7daf('0x21')](_0x35a416);recordings[_0x7daf('0x21')](_0x35a416);dials[_0x7daf('0x21')](_0x35a416);agents[_0x7daf('0x21')](_0x35a416);queues[_0x7daf('0x21')](_0x35a416);}catch(_0x42a455){utils[_0x7daf('0x14')](_0x42a455);}});ami['on'](_0x7daf('0x22'),function(_0x4e4c4b){try{members[_0x7daf('0x22')](_0x4e4c4b);}catch(_0x2f0930){utils['error'](_0x2f0930);}});ami['on'](_0x7daf('0x23'),function(_0x1ba9ba){try{queues[_0x7daf('0x23')](_0x1ba9ba);agents[_0x7daf('0x23')](_0x1ba9ba);transfers[_0x7daf('0x23')](_0x1ba9ba);}catch(_0x59ccdd){utils['error'](_0x59ccdd);}});ami['on'](_0x7daf('0x24'),function(_0xf5a56a){try{queues[_0x7daf('0x24')](_0xf5a56a);transfers[_0x7daf('0x24')](_0xf5a56a);agents[_0x7daf('0x24')](_0xf5a56a);calls[_0x7daf('0x24')](_0xf5a56a);}catch(_0x2b5af9){utils['error'](_0x2b5af9);}});ami['on'](_0x7daf('0x25'),function(_0x143b03){try{queues[_0x7daf('0x25')](_0x143b03);recordings['varset'](_0x143b03);calls[_0x7daf('0x25')](_0x143b03);dials['varset'](_0x143b03);}catch(_0x4318a0){utils['error'](_0x4318a0);}});ami['on']('newexten',function(_0x2222d8){try{calls['newexten'](_0x2222d8);recordings[_0x7daf('0x26')](_0x2222d8);dials[_0x7daf('0x26')](_0x2222d8);}catch(_0xf9b52f){utils[_0x7daf('0x14')](_0xf9b52f);}});ami['on'](_0x7daf('0x27'),function(_0x148e82){try{calls[_0x7daf('0x27')](_0x148e82);recordings[_0x7daf('0x27')](_0x148e82);}catch(_0x46ffe3){utils[_0x7daf('0x14')](_0x46ffe3);}});ami['on'](_0x7daf('0x28'),function(_0x43c8b1){try{dials[_0x7daf('0x28')](_0x43c8b1);}catch(_0x553771){utils[_0x7daf('0x14')](_0x553771);}});ami['on']('dialend',function(_0x534d75){try{dials['dialend'](_0x534d75);}catch(_0x1727ac){utils[_0x7daf('0x14')](_0x1727ac);}});} \ No newline at end of file +var _0x4ec2=['XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','port','username','password','xdr','info'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x4ec2,0x13f));var _0x24ec=function(_0x1fd735,_0x5455b0){_0x1fd735=_0x1fd735-0x0;var _0x159b99=_0x4ec2[_0x1fd735];return _0x159b99;};var AsteriskManager=require(_0x24ec('0x0'));var config=require(_0x24ec('0x1'));var utils=require(_0x24ec('0x2'));var ami=new AsteriskManager(config[_0x24ec('0x3')][_0x24ec('0x4')],config[_0x24ec('0x3')]['ip'],config['asterisk'][_0x24ec('0x5')],config[_0x24ec('0x3')][_0x24ec('0x6')],!![]);ami['keepConnected']();if(config[_0x24ec('0x7')]&&config['xdr']['disabled']){utils[_0x24ec('0x8')](_0x24ec('0x9'));}else{var agents=require(_0x24ec('0xa'));var calls=require(_0x24ec('0xb'));var queues=require(_0x24ec('0xc'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x24ec('0xd'));var core=require(_0x24ec('0xe'));ami['on'](_0x24ec('0xf'),core[_0x24ec('0xf')]);ami['on'](_0x24ec('0x10'),core['shutdown']);ami['on'](_0x24ec('0x11'),core[_0x24ec('0x11')]);ami['on'](_0x24ec('0x12'),core['error']);ami['on'](_0x24ec('0x13'),core[_0x24ec('0x13')]);ami['on']('managerevent',core[_0x24ec('0x14')]);ami['on'](_0x24ec('0x15'),function(_0x29e60e){try{members['devicestatechange'](_0x29e60e);}catch(_0x258f87){utils['error'](_0x258f87);}});ami['on']('agentcalled',function(_0xaad445){try{agents[_0x24ec('0x16')](_0xaad445);}catch(_0x34c5e0){utils[_0x24ec('0x12')](_0x34c5e0);}});ami['on'](_0x24ec('0x17'),function(_0x371b92){try{agents['agentringnoanswer'](_0x371b92);}catch(_0x53f867){utils['error'](_0x53f867);}});ami['on'](_0x24ec('0x18'),function(_0x4dce1d){try{agents[_0x24ec('0x18')](_0x4dce1d);queues[_0x24ec('0x18')](_0x4dce1d);}catch(_0x52d035){utils[_0x24ec('0x12')](_0x52d035);}});ami['on'](_0x24ec('0x19'),function(_0x4c3142){try{agents[_0x24ec('0x19')](_0x4c3142);queues[_0x24ec('0x19')](_0x4c3142);members['agentcomplete'](_0x4c3142);}catch(_0x302396){utils[_0x24ec('0x12')](_0x302396);}});ami['on'](_0x24ec('0x1a'),function(_0x4d13b3){try{agents[_0x24ec('0x1a')](_0x4d13b3);queues[_0x24ec('0x1a')](_0x4d13b3);}catch(_0x477ba5){utils[_0x24ec('0x12')](_0x477ba5);}});ami['on']('queuecallerjoin',function(_0x3da6a1){try{queues[_0x24ec('0x1b')](_0x3da6a1);recordings[_0x24ec('0x1b')](_0x3da6a1);}catch(_0x1f705b){utils[_0x24ec('0x12')](_0x1f705b);}});ami['on'](_0x24ec('0x1c'),function(_0xce183e){try{queues[_0x24ec('0x1c')](_0xce183e);}catch(_0x2eeb70){utils[_0x24ec('0x12')](_0x2eeb70);}});ami['on']('musiconholdstart',function(_0x34a6d7){try{queues[_0x24ec('0x1d')](_0x34a6d7);calls[_0x24ec('0x1d')](_0x34a6d7);}catch(_0x89310){utils['error'](_0x89310);}});ami['on']('musiconholdstop',function(_0x3039f2){try{queues[_0x24ec('0x1e')](_0x3039f2);calls[_0x24ec('0x1e')](_0x3039f2);}catch(_0x3ee2b6){utils['error'](_0x3ee2b6);}});ami['on'](_0x24ec('0x1f'),function(_0x320d8e){try{calls[_0x24ec('0x1f')](_0x320d8e);recordings[_0x24ec('0x1f')](_0x320d8e);}catch(_0x52d26d){utils[_0x24ec('0x12')](_0x52d26d);}});ami['on'](_0x24ec('0x20'),function(_0x150790){try{calls[_0x24ec('0x20')](_0x150790);recordings[_0x24ec('0x20')](_0x150790);dials[_0x24ec('0x20')](_0x150790);agents[_0x24ec('0x20')](_0x150790);queues[_0x24ec('0x20')](_0x150790);}catch(_0x111b17){utils[_0x24ec('0x12')](_0x111b17);}});ami['on'](_0x24ec('0x21'),function(_0x3f6df5){try{members[_0x24ec('0x21')](_0x3f6df5);}catch(_0x333ae6){utils[_0x24ec('0x12')](_0x333ae6);}});ami['on'](_0x24ec('0x22'),function(_0x247785){try{queues[_0x24ec('0x22')](_0x247785);agents[_0x24ec('0x22')](_0x247785);transfers[_0x24ec('0x22')](_0x247785);}catch(_0x3928f3){utils[_0x24ec('0x12')](_0x3928f3);}});ami['on'](_0x24ec('0x23'),function(_0x435fb5){try{queues[_0x24ec('0x23')](_0x435fb5);transfers[_0x24ec('0x23')](_0x435fb5);agents['attendedtransfer'](_0x435fb5);calls[_0x24ec('0x23')](_0x435fb5);}catch(_0x96e91e){utils[_0x24ec('0x12')](_0x96e91e);}});ami['on'](_0x24ec('0x24'),function(_0x28b9da){try{queues['varset'](_0x28b9da);recordings['varset'](_0x28b9da);calls[_0x24ec('0x24')](_0x28b9da);dials['varset'](_0x28b9da);}catch(_0x3f0191){utils[_0x24ec('0x12')](_0x3f0191);}});ami['on']('newexten',function(_0xd4863b){try{calls['newexten'](_0xd4863b);recordings[_0x24ec('0x25')](_0xd4863b);dials[_0x24ec('0x25')](_0xd4863b);}catch(_0x5a76ec){utils['error'](_0x5a76ec);}});ami['on'](_0x24ec('0x26'),function(_0x466386){try{calls[_0x24ec('0x26')](_0x466386);recordings[_0x24ec('0x26')](_0x466386);}catch(_0x56b4d9){utils['error'](_0x56b4d9);}});ami['on'](_0x24ec('0x27'),function(_0x3f66f6){try{dials[_0x24ec('0x27')](_0x3f66f6);}catch(_0x18221b){utils[_0x24ec('0x12')](_0x18221b);}});ami['on']('dialend',function(_0xb1052){try{dials[_0x24ec('0x28')](_0xb1052);}catch(_0x55fc14){utils[_0x24ec('0x12')](_0x55fc14);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 62c9ebc..e43945b 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 _0xe2cd=['info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','membername','getUserByInterface','then','internal','request','CreateMemberReport','split','catch','error','some','startsWith','devicestatechange','INUSE','BUSY','device','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','type','data2','data3','destination','destinationchannel','source','./utils','Local/_attended@transfer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2cd,0x16f));var _0xde2c=function(_0x191e06,_0x462742){_0x191e06=_0x191e06-0x0;var _0x54beb2=_0xe2cd[_0x191e06];return _0x54beb2;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xde2c('0x0'));var members={};var exclude=[_0xde2c('0x1'),'Queue:'];function writeDB(_0x2f666f){utils[_0xde2c('0x2')](util[_0xde2c('0x3')](_0xde2c('0x4'),_0x2f666f[_0xde2c('0x5')],_0x2f666f[_0xde2c('0x6')],_0x2f666f[_0xde2c('0x7')],_0x2f666f['data2'],_0x2f666f[_0xde2c('0x8')],_0x2f666f['type']));if(_0x2f666f[_0xde2c('0x6')]){utils[_0xde2c('0x9')](_0x2f666f['interface'])[_0xde2c('0xa')](function(_0x58322c){if(_0x58322c){_0x2f666f[_0xde2c('0x8')]=_0x58322c['name'];_0x2f666f[_0xde2c('0xb')]=_0x58322c[_0xde2c('0xb')];utils[_0xde2c('0xc')](_0xde2c('0xd'),_0x2f666f);}else{utils['getUserByName'](_0x2f666f[_0xde2c('0x6')][_0xde2c('0xe')]('/')[0x1])[_0xde2c('0xa')](function(_0x4a5123){if(_0x4a5123){_0x2f666f[_0xde2c('0x8')]=_0x4a5123['name'];_0x2f666f[_0xde2c('0xb')]=_0x4a5123[_0xde2c('0xb')];utils[_0xde2c('0xc')](_0xde2c('0xd'),_0x2f666f);}});}})[_0xde2c('0xf')](function(_0x3c3659){utils[_0xde2c('0x10')](_0x3c3659);});}delete members[_0x2f666f[_0xde2c('0x6')]];}function startsWith(_0x49fdc4,_0x23a5d1){return _[_0xde2c('0x11')](_0x49fdc4,function(_0x65ba1f){return _[_0xde2c('0x12')](_0x23a5d1,_0x65ba1f);});}exports[_0xde2c('0x13')]=function(_0x24005d){switch(_0x24005d['state']){case _0xde2c('0x14'):case _0xde2c('0x15'):if(!startsWith(exclude,_0x24005d[_0xde2c('0x16')])){members[_0x24005d['device']]={'channel':'voice','interface':_0x24005d[_0xde2c('0x16')],'type':'TALKING','enterAt':utils[_0xde2c('0x17')](),'role':_0xde2c('0x18')};}break;case _0xde2c('0x19'):if(!_[_0xde2c('0x1a')](members[_0x24005d[_0xde2c('0x16')]])){members[_0x24005d[_0xde2c('0x16')]][_0xde2c('0x1b')]=utils[_0xde2c('0x17')]();members[_0x24005d[_0xde2c('0x16')]]['duration']=utils[_0xde2c('0x1c')](members[_0x24005d['device']][_0xde2c('0x1b')],members[_0x24005d[_0xde2c('0x16')]][_0xde2c('0x1d')]);if(members[_0x24005d[_0xde2c('0x16')]]['uniqueid']){writeDB(members[_0x24005d[_0xde2c('0x16')]]);}}default:break;}};exports[_0xde2c('0x1e')]=function(_0x2f362a){if(!_[_0xde2c('0x1a')](members[_0x2f362a['interface']])){members[_0x2f362a[_0xde2c('0x6')]]=_[_0xde2c('0x1f')](members[_0x2f362a['interface']],{'data4':_0x2f362a[_0xde2c('0x20')],'uniqueid':_0x2f362a[_0xde2c('0x5')]});}};exports[_0xde2c('0x21')]=function(_0x1f3593){if(_0x1f3593[_0xde2c('0x7')]){var _0x1bd451=_0x1f3593[_0xde2c('0x7')]['split']('-')[0x0];if(!_[_0xde2c('0x1a')](members[_0x1bd451])){members[_0x1bd451]=_[_0xde2c('0x1f')](members[_0x1bd451],{'data1':members[_0x1bd451][_0xde2c('0x22')]||_0x1f3593[_0xde2c('0x23')],'data2':members[_0x1bd451][_0xde2c('0x24')]||_0x1f3593['source'],'data3':members[_0x1bd451][_0xde2c('0x25')]||_0x1f3593[_0xde2c('0x26')],'uniqueid':members[_0x1bd451]['uniqueid']||_0x1f3593[_0xde2c('0x5')]});if(members[_0x1bd451]['exitAt']){writeDB(members[_0x1bd451]);}}}if(_0x1f3593['destinationchannel']){var _0x1a0425=_0x1f3593[_0xde2c('0x27')][_0xde2c('0xe')]('-')[0x0];if(!_[_0xde2c('0x1a')](members[_0x1a0425])){members[_0x1a0425]=_['assign'](members[_0x1a0425],{'data1':members[_0x1a0425]['data1']||_0x1f3593['type'],'data2':members[_0x1a0425][_0xde2c('0x24')]||_0x1f3593[_0xde2c('0x28')],'data3':members[_0x1a0425]['data3']||_0x1f3593[_0xde2c('0x26')],'uniqueid':members[_0x1a0425][_0xde2c('0x5')]||_0x1f3593[_0xde2c('0x5')]});if(members[_0x1a0425][_0xde2c('0x1b')]){writeDB(members[_0x1a0425]);}}}}; \ No newline at end of file +var _0xae9c=['data3','destination','destinationchannel','util','./utils','Local/_attended@transfer','Queue:','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','membername','type','getUserByInterface','name','internal','CreateMemberReport','getUserByName','split','then','request','catch','some','startsWith','state','INUSE','BUSY','device','agent','NOT_INUSE','exitAt','duration','diffTime','agentcomplete','isNil','assign','queue','channel','data1','data2','source'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xae9c,0xd0));var _0xcae9=function(_0x5080f2,_0x128e2c){_0x5080f2=_0x5080f2-0x0;var _0x2f9adf=_0xae9c[_0x5080f2];return _0x2f9adf;};'use strict';var _=require('lodash');var util=require(_0xcae9('0x0'));var utils=require(_0xcae9('0x1'));var members={};var exclude=[_0xcae9('0x2'),_0xcae9('0x3')];function writeDB(_0x4a1fbd){utils['info'](util[_0xcae9('0x4')](_0xcae9('0x5'),_0x4a1fbd[_0xcae9('0x6')],_0x4a1fbd[_0xcae9('0x7')],_0x4a1fbd['channel'],_0x4a1fbd['data2'],_0x4a1fbd[_0xcae9('0x8')],_0x4a1fbd[_0xcae9('0x9')]));if(_0x4a1fbd[_0xcae9('0x7')]){utils[_0xcae9('0xa')](_0x4a1fbd[_0xcae9('0x7')])['then'](function(_0x125fcd){if(_0x125fcd){_0x4a1fbd[_0xcae9('0x8')]=_0x125fcd[_0xcae9('0xb')];_0x4a1fbd[_0xcae9('0xc')]=_0x125fcd[_0xcae9('0xc')];utils['request'](_0xcae9('0xd'),_0x4a1fbd);}else{utils[_0xcae9('0xe')](_0x4a1fbd[_0xcae9('0x7')][_0xcae9('0xf')]('/')[0x1])[_0xcae9('0x10')](function(_0x10d439){if(_0x10d439){_0x4a1fbd['membername']=_0x10d439[_0xcae9('0xb')];_0x4a1fbd['internal']=_0x10d439['internal'];utils[_0xcae9('0x11')](_0xcae9('0xd'),_0x4a1fbd);}});}})[_0xcae9('0x12')](function(_0x49cf63){utils['error'](_0x49cf63);});}delete members[_0x4a1fbd[_0xcae9('0x7')]];}function startsWith(_0x4aad73,_0x91f26){return _[_0xcae9('0x13')](_0x4aad73,function(_0x7815e7){return _[_0xcae9('0x14')](_0x91f26,_0x7815e7);});}exports['devicestatechange']=function(_0x30c277){switch(_0x30c277[_0xcae9('0x15')]){case _0xcae9('0x16'):case _0xcae9('0x17'):if(!startsWith(exclude,_0x30c277[_0xcae9('0x18')])){members[_0x30c277['device']]={'channel':'voice','interface':_0x30c277['device'],'type':'TALKING','enterAt':utils['now'](),'role':_0xcae9('0x19')};}break;case _0xcae9('0x1a'):if(!_['isNil'](members[_0x30c277[_0xcae9('0x18')]])){members[_0x30c277[_0xcae9('0x18')]][_0xcae9('0x1b')]=utils['now']();members[_0x30c277[_0xcae9('0x18')]][_0xcae9('0x1c')]=utils[_0xcae9('0x1d')](members[_0x30c277[_0xcae9('0x18')]][_0xcae9('0x1b')],members[_0x30c277[_0xcae9('0x18')]]['enterAt']);if(members[_0x30c277[_0xcae9('0x18')]]['uniqueid']){writeDB(members[_0x30c277[_0xcae9('0x18')]]);}}default:break;}};exports[_0xcae9('0x1e')]=function(_0x17480e){if(!_[_0xcae9('0x1f')](members[_0x17480e[_0xcae9('0x7')]])){members[_0x17480e[_0xcae9('0x7')]]=_[_0xcae9('0x20')](members[_0x17480e[_0xcae9('0x7')]],{'data4':_0x17480e[_0xcae9('0x21')],'uniqueid':_0x17480e['uniqueid']});}};exports['cdr']=function(_0xd69b35){if(_0xd69b35[_0xcae9('0x22')]){var _0x305075=_0xd69b35[_0xcae9('0x22')][_0xcae9('0xf')]('-')[0x0];if(!_[_0xcae9('0x1f')](members[_0x305075])){members[_0x305075]=_['assign'](members[_0x305075],{'data1':members[_0x305075][_0xcae9('0x23')]||_0xd69b35['type'],'data2':members[_0x305075][_0xcae9('0x24')]||_0xd69b35[_0xcae9('0x25')],'data3':members[_0x305075][_0xcae9('0x26')]||_0xd69b35[_0xcae9('0x27')],'uniqueid':members[_0x305075][_0xcae9('0x6')]||_0xd69b35[_0xcae9('0x6')]});if(members[_0x305075][_0xcae9('0x1b')]){writeDB(members[_0x305075]);}}}if(_0xd69b35[_0xcae9('0x28')]){var _0x51ff64=_0xd69b35[_0xcae9('0x28')]['split']('-')[0x0];if(!_[_0xcae9('0x1f')](members[_0x51ff64])){members[_0x51ff64]=_[_0xcae9('0x20')](members[_0x51ff64],{'data1':members[_0x51ff64][_0xcae9('0x23')]||_0xd69b35[_0xcae9('0x9')],'data2':members[_0x51ff64][_0xcae9('0x24')]||_0xd69b35[_0xcae9('0x25')],'data3':members[_0x51ff64][_0xcae9('0x26')]||_0xd69b35[_0xcae9('0x27')],'uniqueid':members[_0x51ff64][_0xcae9('0x6')]||_0xd69b35[_0xcae9('0x6')]});if(members[_0x51ff64][_0xcae9('0x1b')]){writeDB(members[_0x51ff64]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 2e698f7..62577c1 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 _0x37b4=['ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridnum','calleridname','mohtime','origtransfererlinkedid','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','./utils','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','accountcode','request','CreateVoiceQueueReport','queuecallerjoin','position','now','hangup','isNil','queuecallerexit','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','transfereduniqueid','queuestatus','queuecallerabandon','queuecallerexitAt','value','toUpperCase','variable','queuecallerabandonAt','EXITWITHKEY','queuecallerleave','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinenum','connectedlinename','destaccountcode','lastAssignedTo','membername','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','secondtransfererlinkedid','ATTENDED','origtransfererexten'];(function(_0x44307f,_0x1b33a6){var _0xe7689=function(_0x4ced6c){while(--_0x4ced6c){_0x44307f['push'](_0x44307f['shift']());}};_0xe7689(++_0x1b33a6);}(_0x37b4,0xef));var _0x437b=function(_0x121336,_0x3370ea){_0x121336=_0x121336-0x0;var _0x53ff9f=_0x37b4[_0x121336];return _0x53ff9f;};'use strict';var _=require(_0x437b('0x0'));var util=require('util');var utils=require(_0x437b('0x1'));var queues={};function writeDB(_0x1a738e){utils[_0x437b('0x2')](util['format'](_0x437b('0x3'),_0x1a738e[_0x437b('0x4')],_0x1a738e[_0x437b('0x5')],_0x1a738e[_0x437b('0x6')],_0x1a738e['lastAssignedTo'],_0x1a738e['calleridnum'],_0x1a738e[_0x437b('0x7')],_0x1a738e['queuecallerexitreason']));if(_0x1a738e[_0x437b('0x6')]){utils['getVoiceQueueByName'](_0x1a738e[_0x437b('0x6')])['then'](function(_0x432b63){if(_0x432b63){_0x1a738e['type']=_0x432b63['type'];}utils[_0x437b('0x8')](_0x437b('0x9'),_0x1a738e);});}else{utils['request'](_0x437b('0x9'),_0x1a738e);}if(_0x1a738e['transfereduniqueid']){delete queues[_0x1a738e['transfereduniqueid']];}else{delete queues[_0x1a738e[_0x437b('0x4')]];}}exports[_0x437b('0xa')]=function(_0x7e1ea){queues[_0x7e1ea[_0x437b('0x4')]]=_['assign'](_0x7e1ea,{'originalposition':_0x7e1ea[_0x437b('0xb')],'queuecallerjoinAt':utils[_0x437b('0xc')](),'mohtime':0x0});};exports[_0x437b('0xd')]=function(_0x5aa4d2){if(!_[_0x437b('0xe')](queues[_0x5aa4d2[_0x437b('0x4')]])){if(queues[_0x5aa4d2[_0x437b('0x4')]]['queuecallerleaveAt']){if(!queues[_0x5aa4d2[_0x437b('0x4')]]['queuecallerabandon']&&!queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0xf')]){queues[_0x5aa4d2[_0x437b('0x4')]]['queuecallercomplete']=!![];queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0x10')]=utils[_0x437b('0xc')]();queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0x11')]=_0x437b('0x12');}writeDB(queues[_0x5aa4d2['uniqueid']]);}else{if(queues[_0x5aa4d2[_0x437b('0x4')]]['transfereduniqueid']){queues[queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0x13')]]=queues[_0x5aa4d2[_0x437b('0x4')]];queues[queues[_0x5aa4d2[_0x437b('0x4')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x5aa4d2['uniqueid']];}}}};exports['varset']=function(_0x1ea596){if(!_[_0x437b('0xe')](_0x1ea596['variable'][_0x437b('0x14')])){if(!_['isNil'](queues[_0x1ea596[_0x437b('0x4')]])){queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x15')]=![];queues[_0x1ea596['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1ea596['uniqueid']][_0x437b('0xf')]=!![];queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x16')]=utils[_0x437b('0xc')]();queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x11')]=_0x1ea596[_0x437b('0x17')][_0x437b('0x18')]();writeDB(queues[_0x1ea596[_0x437b('0x4')]]);}}else if(!_[_0x437b('0xe')](_0x1ea596[_0x437b('0x19')]['queueposition'])){if(!_[_0x437b('0xe')](queues[_0x1ea596[_0x437b('0x4')]])&&!queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x15')]){queues[_0x1ea596[_0x437b('0x4')]]['queuecallerabandon']=![];queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x1a')]=null;queues[_0x1ea596['uniqueid']][_0x437b('0xf')]=!![];queues[_0x1ea596['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x1ea596[_0x437b('0x4')]]['queuecallerexitreason']=_0x437b('0x1b');}}};exports[_0x437b('0x15')]=function(_0x2b2e4f){if(!_['isNil'](queues[_0x2b2e4f['uniqueid']])){queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0xf')]=![];queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x16')]=null;queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x15')]=!![];queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x1a')]=utils[_0x437b('0xc')]();queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x11')]='ABANDONED';}};exports[_0x437b('0x1c')]=function(_0x2e3983){if(!_[_0x437b('0xe')](queues[_0x2e3983['uniqueid']])){queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x1c')]=!![];queues[_0x2e3983[_0x437b('0x4')]]['queuecallerleaveAt']=utils[_0x437b('0xc')]();queues[_0x2e3983['uniqueid']][_0x437b('0x1d')]=utils[_0x437b('0x1e')](queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x1f')],queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x20')]);queues[_0x2e3983['uniqueid']][_0x437b('0xb')]=_0x2e3983[_0x437b('0xb')];queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x21')]=_0x2e3983[_0x437b('0x21')];queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x22')]=_0x2e3983[_0x437b('0x22')];queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x23')]=_0x2e3983[_0x437b('0x23')];}};exports['agentconnect']=function(_0x273b64){if(!_['isNil'](queues[_0x273b64[_0x437b('0x4')]])){queues[_0x273b64['uniqueid']]['queuecallerabandon']=![];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x15')]=![];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x1a')]=null;queues[_0x273b64['uniqueid']][_0x437b('0xf')]=![];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x16')]=null;queues[_0x273b64[_0x437b('0x4')]]['assigned']=!![];queues[_0x273b64['uniqueid']]['accountcode']=_0x273b64[_0x437b('0x24')];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x25')]=_0x273b64[_0x437b('0x26')];}};exports[_0x437b('0x27')]=function(_0x177997){if(!_['isNil'](queues[_0x177997[_0x437b('0x4')]])){if(queues[_0x177997[_0x437b('0x4')]][_0x437b('0x1f')]){queues[_0x177997['uniqueid']][_0x437b('0x15')]=![];queues[_0x177997[_0x437b('0x4')]]['queuecallerabandon']=![];queues[_0x177997['uniqueid']]['queuecallerabandonAt']=null;queues[_0x177997[_0x437b('0x4')]][_0x437b('0xf')]=![];queues[_0x177997['uniqueid']]['queuecallerexitAt']=null;queues[_0x177997[_0x437b('0x4')]]['assigned']=!![];queues[_0x177997[_0x437b('0x4')]]['lastAssignedTo']=_0x177997['membername'];queues[_0x177997[_0x437b('0x4')]][_0x437b('0x28')]=!![];queues[_0x177997['uniqueid']][_0x437b('0x10')]=utils['now']();if(_0x177997[_0x437b('0x29')]==_0x437b('0x2a')){if(!queues[_0x177997['uniqueid']][_0x437b('0x2a')]){queues[_0x177997[_0x437b('0x4')]]['queuecallerexitreason']=_0x437b('0x2b');}}else{queues[_0x177997[_0x437b('0x4')]][_0x437b('0x11')]=_0x437b('0x2c')+_0x177997['reason'][_0x437b('0x18')]();}writeDB(queues[_0x177997[_0x437b('0x4')]]);}}};exports[_0x437b('0x2d')]=function(_0x5703e1){if(!_['isNil'](queues[_0x5703e1[_0x437b('0x2e')]])){queues[_0x5703e1['transfereeuniqueid']]['transfer']=!![];queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x2f')]=_0x437b('0x30');queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x31')]=_0x5703e1[_0x437b('0x32')];queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x33')]=_0x5703e1[_0x437b('0x2e')];queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x11')]=_0x437b('0x34');}};exports['attendedtransfer']=function(_0x481a57){try{if(_0x481a57[_0x437b('0x35')]==_0x481a57['origtransfererlinkedid']){if(!_[_0x437b('0xe')](queues[_0x481a57[_0x437b('0x36')]])){queues[_0x481a57['secondtransfererlinkedid']][_0x437b('0x2a')]=!![];queues[_0x481a57[_0x437b('0x36')]]['transfertype']=_0x437b('0x37');queues[_0x481a57[_0x437b('0x36')]][_0x437b('0x31')]=_0x481a57[_0x437b('0x38')];queues[_0x481a57[_0x437b('0x36')]]['transferuniqueid']=_0x481a57[_0x437b('0x35')];queues[_0x481a57[_0x437b('0x36')]]['queuecallerexitreason']=_0x437b('0x39');}if(!_[_0x437b('0xe')](queues[_0x481a57['origtransfererlinkedid']])){if(_0x481a57['transfereelinkedid']&&queues[_0x481a57[_0x437b('0x3a')]]){queues[_0x481a57[_0x437b('0x3a')]][_0x437b('0x3b')]=0x1;queues[_0x481a57[_0x437b('0x2e')]]=_['clone'](queues[_0x481a57[_0x437b('0x3a')]]);queues[_0x481a57[_0x437b('0x2e')]][_0x437b('0x13')]=_0x481a57[_0x437b('0x3c')];queues[_0x481a57[_0x437b('0x2e')]][_0x437b('0x3b')]=0x2;queues[_0x481a57[_0x437b('0x2e')]]['calleridnum']=queues[_0x481a57[_0x437b('0x36')]][_0x437b('0x3d')];queues[_0x481a57['transfereeuniqueid']][_0x437b('0x3e')]=queues[_0x481a57[_0x437b('0x36')]]['calleridname'];queues[_0x481a57['transfereeuniqueid']][_0x437b('0x20')]=utils['now']();queues[_0x481a57[_0x437b('0x2e')]]['queuecallerleaveAt']=utils['now']();queues[_0x481a57['transfereeuniqueid']][_0x437b('0x1d')]=0x0;queues[_0x481a57[_0x437b('0x2e')]][_0x437b('0x3f')]=0x0;}else{queues[_0x481a57[_0x437b('0x40')]]['transfereduniqueid']=_0x481a57['secondtransfererlinkedid'];}}}else if(_0x481a57[_0x437b('0x41')]==_0x481a57['secondtransfererlinkedid']){if(!_[_0x437b('0xe')](queues[_0x481a57[_0x437b('0x40')]])){queues[_0x481a57['origtransfererlinkedid']]['transfer']=!![];queues[_0x481a57[_0x437b('0x40')]]['transfertype']=_0x437b('0x37');queues[_0x481a57[_0x437b('0x40')]][_0x437b('0x31')]=_0x481a57[_0x437b('0x42')];queues[_0x481a57[_0x437b('0x40')]][_0x437b('0x33')]=_0x481a57[_0x437b('0x41')];queues[_0x481a57[_0x437b('0x40')]]['queuecallerexitreason']=_0x437b('0x39');}if(!_[_0x437b('0xe')](queues[_0x481a57[_0x437b('0x36')]])){if(_0x481a57[_0x437b('0x43')]&&queues[_0x481a57[_0x437b('0x43')]]){queues[_0x481a57[_0x437b('0x43')]][_0x437b('0x3b')]=0x1;queues[_0x481a57['transfertargetuniqueid']]=_[_0x437b('0x44')](queues[_0x481a57['transfertargetlinkedid']]);queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x13')]=_0x481a57['transfertargetuniqueid'];queues[_0x481a57[_0x437b('0x3c')]]['queuecallerenterreason']=0x2;queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x3d')]=queues[_0x481a57[_0x437b('0x40')]][_0x437b('0x3d')];queues[_0x481a57['transfertargetuniqueid']][_0x437b('0x3e')]=queues[_0x481a57['origtransfererlinkedid']]['calleridname'];queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x20')]=utils['now']();queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x1f')]=utils['now']();queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x1d')]=0x0;queues[_0x481a57[_0x437b('0x3c')]]['mohtime']=0x0;}else{queues[_0x481a57[_0x437b('0x36')]][_0x437b('0x13')]=_0x481a57['origtransfererlinkedid'];}}}}catch(_0x472dc7){utils[_0x437b('0x45')](_0x472dc7[_0x437b('0x46')]);}};exports[_0x437b('0x47')]=function(_0x580c99){if(!_[_0x437b('0xe')](queues[_0x580c99['uniqueid']])){queues[_0x580c99[_0x437b('0x4')]][_0x437b('0x48')]=utils['now']();}};exports[_0x437b('0x49')]=function(_0x3ea580){if(!_[_0x437b('0xe')](queues[_0x3ea580[_0x437b('0x4')]])){if(!_[_0x437b('0xe')](queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x48')])){queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x3f')]+=utils[_0x437b('0x1e')](utils[_0x437b('0xc')](),queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x48')]);delete queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x48')];}}}; \ No newline at end of file +var _0x66ad=['info','QUEUE|%s|%s|%s|%s|%s|%s|%s','channel','queue','lastAssignedTo','accountcode','getVoiceQueueByName','then','type','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','queuecallerenterreason','varset','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','toUpperCase','variable','EXITWITHKEY','queuecallerleave','holdtime','diffTime','position','count','connectedlinenum','connectedlinename','assigned','destaccountcode','membername','reason','transfer','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridnum','calleridname','queuecallerjoinAt','mohtime','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstop','musiconholdstartAt','lodash','util'];(function(_0x11a220,_0x4e470a){var _0x20d8fe=function(_0xbedfd){while(--_0xbedfd){_0x11a220['push'](_0x11a220['shift']());}};_0x20d8fe(++_0x4e470a);}(_0x66ad,0x12a));var _0xd66a=function(_0x447e20,_0x28ddd5){_0x447e20=_0x447e20-0x0;var _0x4c5082=_0x66ad[_0x447e20];return _0x4c5082;};'use strict';var _=require(_0xd66a('0x0'));var util=require(_0xd66a('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x209288){utils[_0xd66a('0x2')](util['format'](_0xd66a('0x3'),_0x209288['uniqueid'],_0x209288[_0xd66a('0x4')],_0x209288[_0xd66a('0x5')],_0x209288[_0xd66a('0x6')],_0x209288['calleridnum'],_0x209288[_0xd66a('0x7')],_0x209288['queuecallerexitreason']));if(_0x209288[_0xd66a('0x5')]){utils[_0xd66a('0x8')](_0x209288['queue'])[_0xd66a('0x9')](function(_0x2c1a7b){if(_0x2c1a7b){_0x209288['type']=_0x2c1a7b[_0xd66a('0xa')];}utils['request'](_0xd66a('0xb'),_0x209288);});}else{utils['request'](_0xd66a('0xb'),_0x209288);}if(_0x209288['transfereduniqueid']){delete queues[_0x209288[_0xd66a('0xc')]];}else{delete queues[_0x209288[_0xd66a('0xd')]];}}exports[_0xd66a('0xe')]=function(_0x27188c){queues[_0x27188c[_0xd66a('0xd')]]=_['assign'](_0x27188c,{'originalposition':_0x27188c['position'],'queuecallerjoinAt':utils[_0xd66a('0xf')](),'mohtime':0x0});};exports[_0xd66a('0x10')]=function(_0x482add){if(!_[_0xd66a('0x11')](queues[_0x482add[_0xd66a('0xd')]])){if(queues[_0x482add[_0xd66a('0xd')]][_0xd66a('0x12')]){if(!queues[_0x482add['uniqueid']][_0xd66a('0x13')]&&!queues[_0x482add[_0xd66a('0xd')]][_0xd66a('0x14')]){queues[_0x482add['uniqueid']][_0xd66a('0x15')]=!![];queues[_0x482add[_0xd66a('0xd')]][_0xd66a('0x16')]=utils[_0xd66a('0xf')]();queues[_0x482add['uniqueid']][_0xd66a('0x17')]='COMPLETEDBYAGENT';}writeDB(queues[_0x482add['uniqueid']]);}else{if(queues[_0x482add[_0xd66a('0xd')]][_0xd66a('0xc')]){queues[queues[_0x482add[_0xd66a('0xd')]][_0xd66a('0xc')]]=queues[_0x482add['uniqueid']];queues[queues[_0x482add[_0xd66a('0xd')]][_0xd66a('0xc')]][_0xd66a('0x18')]=0x2;delete queues[_0x482add['uniqueid']];}}}};exports[_0xd66a('0x19')]=function(_0xf794bb){if(!_[_0xd66a('0x11')](_0xf794bb['variable'][_0xd66a('0x1a')])){if(!_['isNil'](queues[_0xf794bb['uniqueid']])){queues[_0xf794bb[_0xd66a('0xd')]][_0xd66a('0x13')]=![];queues[_0xf794bb['uniqueid']][_0xd66a('0x1b')]=null;queues[_0xf794bb['uniqueid']]['queuecallerexit']=!![];queues[_0xf794bb[_0xd66a('0xd')]][_0xd66a('0x1c')]=utils[_0xd66a('0xf')]();queues[_0xf794bb['uniqueid']][_0xd66a('0x17')]=_0xf794bb[_0xd66a('0x1d')][_0xd66a('0x1e')]();writeDB(queues[_0xf794bb[_0xd66a('0xd')]]);}}else if(!_[_0xd66a('0x11')](_0xf794bb[_0xd66a('0x1f')]['queueposition'])){if(!_[_0xd66a('0x11')](queues[_0xf794bb[_0xd66a('0xd')]])&&!queues[_0xf794bb[_0xd66a('0xd')]][_0xd66a('0x13')]){queues[_0xf794bb['uniqueid']][_0xd66a('0x13')]=![];queues[_0xf794bb['uniqueid']]['queuecallerabandonAt']=null;queues[_0xf794bb[_0xd66a('0xd')]][_0xd66a('0x14')]=!![];queues[_0xf794bb[_0xd66a('0xd')]][_0xd66a('0x1c')]=utils[_0xd66a('0xf')]();queues[_0xf794bb['uniqueid']][_0xd66a('0x17')]=_0xd66a('0x20');}}};exports[_0xd66a('0x13')]=function(_0x1fae27){if(!_['isNil'](queues[_0x1fae27[_0xd66a('0xd')]])){queues[_0x1fae27[_0xd66a('0xd')]][_0xd66a('0x14')]=![];queues[_0x1fae27[_0xd66a('0xd')]][_0xd66a('0x1c')]=null;queues[_0x1fae27['uniqueid']][_0xd66a('0x13')]=!![];queues[_0x1fae27[_0xd66a('0xd')]][_0xd66a('0x1b')]=utils[_0xd66a('0xf')]();queues[_0x1fae27[_0xd66a('0xd')]]['queuecallerexitreason']='ABANDONED';}};exports[_0xd66a('0x21')]=function(_0x4a113e){if(!_[_0xd66a('0x11')](queues[_0x4a113e[_0xd66a('0xd')]])){queues[_0x4a113e[_0xd66a('0xd')]]['queuecallerleave']=!![];queues[_0x4a113e[_0xd66a('0xd')]][_0xd66a('0x12')]=utils[_0xd66a('0xf')]();queues[_0x4a113e[_0xd66a('0xd')]][_0xd66a('0x22')]=utils[_0xd66a('0x23')](queues[_0x4a113e['uniqueid']][_0xd66a('0x12')],queues[_0x4a113e[_0xd66a('0xd')]]['queuecallerjoinAt']);queues[_0x4a113e[_0xd66a('0xd')]]['position']=_0x4a113e[_0xd66a('0x24')];queues[_0x4a113e['uniqueid']][_0xd66a('0x25')]=_0x4a113e[_0xd66a('0x25')];queues[_0x4a113e[_0xd66a('0xd')]][_0xd66a('0x26')]=_0x4a113e['connectedlinenum'];queues[_0x4a113e[_0xd66a('0xd')]][_0xd66a('0x27')]=_0x4a113e[_0xd66a('0x27')];}};exports['agentconnect']=function(_0xef505f){if(!_[_0xd66a('0x11')](queues[_0xef505f['uniqueid']])){queues[_0xef505f[_0xd66a('0xd')]]['queuecallerabandon']=![];queues[_0xef505f['uniqueid']]['queuecallerabandon']=![];queues[_0xef505f[_0xd66a('0xd')]][_0xd66a('0x1b')]=null;queues[_0xef505f['uniqueid']]['queuecallerexit']=![];queues[_0xef505f['uniqueid']]['queuecallerexitAt']=null;queues[_0xef505f[_0xd66a('0xd')]][_0xd66a('0x28')]=!![];queues[_0xef505f[_0xd66a('0xd')]][_0xd66a('0x7')]=_0xef505f[_0xd66a('0x29')];queues[_0xef505f[_0xd66a('0xd')]][_0xd66a('0x6')]=_0xef505f['membername'];}};exports['agentcomplete']=function(_0x530321){if(!_['isNil'](queues[_0x530321[_0xd66a('0xd')]])){if(queues[_0x530321[_0xd66a('0xd')]]['queuecallerleaveAt']){queues[_0x530321[_0xd66a('0xd')]][_0xd66a('0x13')]=![];queues[_0x530321[_0xd66a('0xd')]][_0xd66a('0x13')]=![];queues[_0x530321[_0xd66a('0xd')]][_0xd66a('0x1b')]=null;queues[_0x530321[_0xd66a('0xd')]][_0xd66a('0x14')]=![];queues[_0x530321[_0xd66a('0xd')]][_0xd66a('0x1c')]=null;queues[_0x530321['uniqueid']][_0xd66a('0x28')]=!![];queues[_0x530321['uniqueid']][_0xd66a('0x6')]=_0x530321[_0xd66a('0x2a')];queues[_0x530321[_0xd66a('0xd')]]['queuecallercomplete']=!![];queues[_0x530321['uniqueid']][_0xd66a('0x16')]=utils[_0xd66a('0xf')]();if(_0x530321[_0xd66a('0x2b')]==_0xd66a('0x2c')){if(!queues[_0x530321['uniqueid']][_0xd66a('0x2c')]){queues[_0x530321[_0xd66a('0xd')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x530321[_0xd66a('0xd')]][_0xd66a('0x17')]=_0xd66a('0x2d')+_0x530321[_0xd66a('0x2b')]['toUpperCase']();}writeDB(queues[_0x530321['uniqueid']]);}}};exports[_0xd66a('0x2e')]=function(_0x2c0a69){if(!_[_0xd66a('0x11')](queues[_0x2c0a69[_0xd66a('0x2f')]])){queues[_0x2c0a69['transfereeuniqueid']][_0xd66a('0x2c')]=!![];queues[_0x2c0a69[_0xd66a('0x2f')]][_0xd66a('0x30')]=_0xd66a('0x31');queues[_0x2c0a69[_0xd66a('0x2f')]][_0xd66a('0x32')]=_0x2c0a69[_0xd66a('0x33')];queues[_0x2c0a69[_0xd66a('0x2f')]]['transferuniqueid']=_0x2c0a69['transfereeuniqueid'];queues[_0x2c0a69['transfereeuniqueid']][_0xd66a('0x17')]=_0xd66a('0x34');}};exports[_0xd66a('0x35')]=function(_0x11fe6c){try{if(_0x11fe6c['origtransfereruniqueid']==_0x11fe6c[_0xd66a('0x36')]){if(!_[_0xd66a('0x11')](queues[_0x11fe6c[_0xd66a('0x37')]])){queues[_0x11fe6c[_0xd66a('0x37')]]['transfer']=!![];queues[_0x11fe6c[_0xd66a('0x37')]][_0xd66a('0x30')]=_0xd66a('0x38');queues[_0x11fe6c[_0xd66a('0x37')]][_0xd66a('0x32')]=_0x11fe6c[_0xd66a('0x39')];queues[_0x11fe6c['secondtransfererlinkedid']][_0xd66a('0x3a')]=_0x11fe6c['origtransfereruniqueid'];queues[_0x11fe6c[_0xd66a('0x37')]][_0xd66a('0x17')]=_0xd66a('0x3b');}if(!_['isNil'](queues[_0x11fe6c[_0xd66a('0x36')]])){if(_0x11fe6c[_0xd66a('0x3c')]&&queues[_0x11fe6c['transfereelinkedid']]){queues[_0x11fe6c['transfereelinkedid']][_0xd66a('0x18')]=0x1;queues[_0x11fe6c[_0xd66a('0x2f')]]=_[_0xd66a('0x3d')](queues[_0x11fe6c[_0xd66a('0x3c')]]);queues[_0x11fe6c[_0xd66a('0x2f')]]['transfereduniqueid']=_0x11fe6c[_0xd66a('0x3e')];queues[_0x11fe6c[_0xd66a('0x2f')]][_0xd66a('0x18')]=0x2;queues[_0x11fe6c[_0xd66a('0x2f')]][_0xd66a('0x3f')]=queues[_0x11fe6c[_0xd66a('0x37')]][_0xd66a('0x3f')];queues[_0x11fe6c[_0xd66a('0x2f')]]['calleridname']=queues[_0x11fe6c[_0xd66a('0x37')]][_0xd66a('0x40')];queues[_0x11fe6c[_0xd66a('0x2f')]][_0xd66a('0x41')]=utils[_0xd66a('0xf')]();queues[_0x11fe6c[_0xd66a('0x2f')]]['queuecallerleaveAt']=utils[_0xd66a('0xf')]();queues[_0x11fe6c[_0xd66a('0x2f')]][_0xd66a('0x22')]=0x0;queues[_0x11fe6c[_0xd66a('0x2f')]][_0xd66a('0x42')]=0x0;}else{queues[_0x11fe6c[_0xd66a('0x36')]][_0xd66a('0xc')]=_0x11fe6c[_0xd66a('0x37')];}}}else if(_0x11fe6c[_0xd66a('0x43')]==_0x11fe6c[_0xd66a('0x37')]){if(!_['isNil'](queues[_0x11fe6c[_0xd66a('0x36')]])){queues[_0x11fe6c[_0xd66a('0x36')]][_0xd66a('0x2c')]=!![];queues[_0x11fe6c[_0xd66a('0x36')]]['transfertype']='ATTENDED';queues[_0x11fe6c[_0xd66a('0x36')]][_0xd66a('0x32')]=_0x11fe6c[_0xd66a('0x44')];queues[_0x11fe6c['origtransfererlinkedid']][_0xd66a('0x3a')]=_0x11fe6c[_0xd66a('0x43')];queues[_0x11fe6c[_0xd66a('0x36')]][_0xd66a('0x17')]='ATTENDEDTRANSFER';}if(!_[_0xd66a('0x11')](queues[_0x11fe6c[_0xd66a('0x37')]])){if(_0x11fe6c[_0xd66a('0x45')]&&queues[_0x11fe6c['transfertargetlinkedid']]){queues[_0x11fe6c[_0xd66a('0x45')]][_0xd66a('0x18')]=0x1;queues[_0x11fe6c[_0xd66a('0x3e')]]=_[_0xd66a('0x3d')](queues[_0x11fe6c['transfertargetlinkedid']]);queues[_0x11fe6c[_0xd66a('0x3e')]][_0xd66a('0xc')]=_0x11fe6c['transfertargetuniqueid'];queues[_0x11fe6c[_0xd66a('0x3e')]][_0xd66a('0x18')]=0x2;queues[_0x11fe6c[_0xd66a('0x3e')]][_0xd66a('0x3f')]=queues[_0x11fe6c[_0xd66a('0x36')]][_0xd66a('0x3f')];queues[_0x11fe6c['transfertargetuniqueid']][_0xd66a('0x40')]=queues[_0x11fe6c['origtransfererlinkedid']][_0xd66a('0x40')];queues[_0x11fe6c[_0xd66a('0x3e')]]['queuecallerjoinAt']=utils[_0xd66a('0xf')]();queues[_0x11fe6c[_0xd66a('0x3e')]][_0xd66a('0x12')]=utils[_0xd66a('0xf')]();queues[_0x11fe6c['transfertargetuniqueid']][_0xd66a('0x22')]=0x0;queues[_0x11fe6c[_0xd66a('0x3e')]][_0xd66a('0x42')]=0x0;}else{queues[_0x11fe6c[_0xd66a('0x37')]][_0xd66a('0xc')]=_0x11fe6c[_0xd66a('0x36')];}}}}catch(_0x42bab1){utils[_0xd66a('0x46')](_0x42bab1[_0xd66a('0x47')]);}};exports[_0xd66a('0x48')]=function(_0x445fc5){if(!_[_0xd66a('0x11')](queues[_0x445fc5[_0xd66a('0xd')]])){queues[_0x445fc5[_0xd66a('0xd')]]['musiconholdstartAt']=utils[_0xd66a('0xf')]();}};exports[_0xd66a('0x49')]=function(_0x4a928e){if(!_['isNil'](queues[_0x4a928e['uniqueid']])){if(!_[_0xd66a('0x11')](queues[_0x4a928e['uniqueid']]['musiconholdstartAt'])){queues[_0x4a928e[_0xd66a('0xd')]]['mohtime']+=utils['diffTime'](utils['now'](),queues[_0x4a928e['uniqueid']][_0xd66a('0x4a')]);delete queues[_0x4a928e['uniqueid']][_0xd66a('0x4a')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 5aa53ab..e77605f 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 _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x17f285,_0x2d5c87){var _0x402d9c=function(_0x54a4e8){while(--_0x54a4e8){_0x17f285['push'](_0x17f285['shift']());}};_0x402d9c(++_0x2d5c87);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b35f3,_0x2fe7d9){_0x3b35f3=_0x3b35f3-0x0;var _0x4be18f=_0xedd9[_0x3b35f3];return _0x4be18f;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file +var _0xe706=['CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','isNil','channelstate','stack','varset','variable','value','.WAV','find','monitors','hangup','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','accountcode','getUserByInternal','then','membername','name','UserId','request'];(function(_0x27806c,_0x4cb947){var _0x3e619a=function(_0x599205){while(--_0x599205){_0x27806c['push'](_0x27806c['shift']());}};_0x3e619a(++_0x4cb947);}(_0xe706,0xa3));var _0x6e70=function(_0x51fe86,_0x422b66){_0x51fe86=_0x51fe86-0x0;var _0x3557d4=_0xe706[_0x51fe86];return _0x3557d4;};'use strict';var _=require(_0x6e70('0x0'));var utils=require(_0x6e70('0x1'));var recordings={};function writeDB(_0x311951){utils['debug'](_0x311951);if(_0x311951[_0x6e70('0x2')]){utils[_0x6e70('0x3')](_0x311951[_0x6e70('0x2')])[_0x6e70('0x4')](function(_0x142c27){if(_0x142c27){_0x311951[_0x6e70('0x5')]=_0x142c27[_0x6e70('0x6')];_0x311951[_0x6e70('0x7')]=_0x142c27['id'];}utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);});}else{utils[_0x6e70('0x8')](_0x6e70('0x9'),_0x311951);}}exports[_0x6e70('0xa')]=function(_0x188ed3){try{if(_0x188ed3[_0x6e70('0xb')]==_0x188ed3[_0x6e70('0xc')]){recordings[_0x188ed3[_0x6e70('0xb')]]={'uniqueid':_0x188ed3[_0x6e70('0xb')],'accountcode':_0x188ed3[_0x6e70('0x2')],'exten':_0x188ed3[_0x6e70('0xd')],'context':_0x188ed3[_0x6e70('0xe')],'channel':_0x188ed3[_0x6e70('0xf')],'monitors':[]};}}catch(_0x37b3e0){utils[_0x6e70('0x10')](_0x37b3e0['stack']);}};exports['newstate']=function(_0x3594c1){try{if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xb')]])&&_0x3594c1[_0x6e70('0x12')]==0x6){}else if(!_[_0x6e70('0x11')](recordings[_0x3594c1[_0x6e70('0xc')]])&&_0x3594c1[_0x6e70('0x12')]==0x6&&_0x3594c1[_0x6e70('0xe')]!='transfer'){recordings[_0x3594c1['linkedid']]['accountcode']=_0x3594c1[_0x6e70('0x2')];}}catch(_0x5a37a6){utils['error'](_0x5a37a6[_0x6e70('0x13')]);}};exports[_0x6e70('0x14')]=function(_0x5d9263){try{if(!_[_0x6e70('0x11')](_0x5d9263['variable'])&&!_[_0x6e70('0x11')](_0x5d9263[_0x6e70('0x15')]['mixmonitor_filename'])){if(_['endsWith'](_0x5d9263[_0x6e70('0x16')],'.wav49')){_0x5d9263[_0x6e70('0x16')]=_0x5d9263[_0x6e70('0x16')]['replace']('.wav49',_0x6e70('0x17'));}if(recordings[_0x5d9263[_0x6e70('0xc')]]){var _0x2368eb=_[_0x6e70('0x18')](recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')],{'value':_0x5d9263[_0x6e70('0x16')]});if(_[_0x6e70('0x11')](_0x2368eb)){recordings[_0x5d9263[_0x6e70('0xc')]][_0x6e70('0x19')]['push']({'value':_0x5d9263[_0x6e70('0x16')]});}}}}catch(_0x344b65){utils[_0x6e70('0x10')](_0x344b65['stack']);}};exports[_0x6e70('0x1a')]=function(_0xa5d49){try{if(!_[_0x6e70('0x11')](recordings[_0xa5d49['uniqueid']])){recordings[_0xa5d49[_0x6e70('0xb')]]['calleridnum']=_0xa5d49['calleridnum'];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1b')]=_0xa5d49[_0x6e70('0x1b')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1c')]=_0xa5d49[_0x6e70('0x1c')];recordings[_0xa5d49['uniqueid']][_0x6e70('0x1d')]=_0xa5d49[_0x6e70('0x1d')];if(recordings[_0xa5d49[_0x6e70('0xb')]]['type']=='outbound'&&recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x2')]){recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1c')]=recordings[_0xa5d49[_0x6e70('0xb')]]['accountcode'];recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x1d')]='';}recordings[_0xa5d49[_0x6e70('0xb')]][_0x6e70('0x19')][_0x6e70('0x1e')](_0x20a225=>{var _0x3f78d2=_[_0x6e70('0x1f')](recordings[_0xa5d49[_0x6e70('0xb')]]);_0x3f78d2[_0x6e70('0x16')]=_0x20a225['value'];writeDB(_0x3f78d2);});delete recordings[_0xa5d49[_0x6e70('0xb')]];}}catch(_0x50d60b){utils[_0x6e70('0x10')](_0x50d60b['stack']);}};exports[_0x6e70('0x20')]=function(_0x2722e8){try{if(!_[_0x6e70('0x11')](recordings[_0x2722e8['uniqueid']])){if(_0x2722e8[_0x6e70('0x21')][_0x6e70('0x22')]()=='set'&&_[_0x6e70('0x23')](_0x2722e8[_0x6e70('0x24')]['toLowerCase'](),_0x6e70('0x25'))){var _0x3665a1=_0x2722e8[_0x6e70('0x24')][_0x6e70('0x26')]('=');var _0x3b4a13=_0x3665a1[0x0][_0x6e70('0x27')](_0x3665a1[0x0][_0x6e70('0x28')]('(')+0x1,_0x3665a1[0x0][_0x6e70('0x28')](')'));var _0xf146fd=_0x3665a1[0x1];recordings[_0x2722e8[_0x6e70('0xb')]][_0x3b4a13]=_0xf146fd;}}}catch(_0x4d32d8){utils[_0x6e70('0x10')](_0x4d32d8['stack']);}};exports[_0x6e70('0x29')]=function(_0x3222a2){try{if(!_[_0x6e70('0x11')](recordings[_0x3222a2[_0x6e70('0xb')]])){recordings[_0x3222a2[_0x6e70('0xb')]][_0x6e70('0x2a')]=_0x3222a2[_0x6e70('0x2a')];}}catch(_0xdd0bee){utils[_0x6e70('0x10')](_0xdd0bee[_0x6e70('0x13')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index bb4c1d7..64a4890 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 _0x4d33=['attendedtransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetlinkedid','util','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','error','stack'];(function(_0x4ac94f,_0x5197f0){var _0x2620d9=function(_0x5d0ad2){while(--_0x5d0ad2){_0x4ac94f['push'](_0x4ac94f['shift']());}};_0x2620d9(++_0x5197f0);}(_0x4d33,0x1cc));var _0x34d3=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x4d33[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var util=require(_0x34d3('0x0'));var utils=require('./utils');function writeDB(_0x344b63){utils['info'](util['format'](_0x34d3('0x1'),_0x344b63[_0x34d3('0x2')]));utils[_0x34d3('0x3')](_0x34d3('0x4'),_0x344b63);}exports[_0x34d3('0x5')]=function(_0x134a57){try{_0x134a57[_0x34d3('0x2')]='blind';writeDB(_0x134a57);}catch(_0x16ab27){utils[_0x34d3('0x6')](_0x16ab27[_0x34d3('0x7')]);}};exports[_0x34d3('0x8')]=function(_0x557bac){try{_0x557bac=_['assign'](_0x557bac,{'transfererchannel':_0x557bac[_0x34d3('0x9')],'transferercalleridnum':_0x557bac['origtransferercalleridnum'],'transferercalleridname':_0x557bac[_0x34d3('0xa')],'transfererconnectedlinenum':_0x557bac[_0x34d3('0xb')],'transfererconnectedlinename':_0x557bac['secondtransfererconnectedlinename'],'transfereraccountcode':_0x557bac[_0x34d3('0xc')],'transferercontext':_0x557bac[_0x34d3('0xd')],'transfererexten':_0x557bac[_0x34d3('0xe')],'transfererlinkedid':_0x557bac[_0x34d3('0xf')],'context':_0x557bac[_0x34d3('0x10')],'extension':_0x557bac[_0x34d3('0x11')],'type':'attended'});if(_[_0x34d3('0x12')](_0x557bac[_0x34d3('0x13')])){_0x557bac=_[_0x34d3('0x14')](_0x557bac,{'transfereechannel':_0x557bac[_0x34d3('0x15')],'transfereecalleridnum':_0x557bac[_0x34d3('0x16')],'transfereecalleridname':_0x557bac[_0x34d3('0x17')],'transfereeconnectedlinenum':_0x557bac['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x557bac['transfertargetconnectedlinename'],'transfereeaccountcode':_0x557bac[_0x34d3('0x18')],'transfereecontext':_0x557bac['transfertargetcontext'],'transfereeexten':_0x557bac['transfertargetexten'],'transfereelinkedid':_0x557bac[_0x34d3('0x19')]});}writeDB(_0x557bac);}catch(_0x1a8af8){utils['error'](_0x1a8af8[_0x34d3('0x7')]);}}; \ No newline at end of file +var _0xaf93=['origtransfererchannel','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','lodash','util','info','format','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','attendedtransfer'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaf93,0x151));var _0x3af9=function(_0x3bc8b8,_0x3e8590){_0x3bc8b8=_0x3bc8b8-0x0;var _0x2f9a17=_0xaf93[_0x3bc8b8];return _0x2f9a17;};'use strict';var _=require(_0x3af9('0x0'));var util=require(_0x3af9('0x1'));var utils=require('./utils');function writeDB(_0x538cc3){utils[_0x3af9('0x2')](util[_0x3af9('0x3')]('TRANSFER|%s',_0x538cc3[_0x3af9('0x4')]));utils[_0x3af9('0x5')](_0x3af9('0x6'),_0x538cc3);}exports[_0x3af9('0x7')]=function(_0x1cbec3){try{_0x1cbec3[_0x3af9('0x4')]=_0x3af9('0x8');writeDB(_0x1cbec3);}catch(_0x535583){utils[_0x3af9('0x9')](_0x535583['stack']);}};exports[_0x3af9('0xa')]=function(_0x53b5ba){try{_0x53b5ba=_['assign'](_0x53b5ba,{'transfererchannel':_0x53b5ba[_0x3af9('0xb')],'transferercalleridnum':_0x53b5ba['origtransferercalleridnum'],'transferercalleridname':_0x53b5ba['origtransferercalleridname'],'transfererconnectedlinenum':_0x53b5ba[_0x3af9('0xc')],'transfererconnectedlinename':_0x53b5ba[_0x3af9('0xd')],'transfereraccountcode':_0x53b5ba[_0x3af9('0xe')],'transferercontext':_0x53b5ba[_0x3af9('0xf')],'transfererexten':_0x53b5ba['secondtransfererexten'],'transfererlinkedid':_0x53b5ba[_0x3af9('0x10')],'context':_0x53b5ba[_0x3af9('0x11')],'extension':_0x53b5ba[_0x3af9('0x12')],'type':_0x3af9('0x13')});if(_[_0x3af9('0x14')](_0x53b5ba[_0x3af9('0x15')])){_0x53b5ba=_[_0x3af9('0x16')](_0x53b5ba,{'transfereechannel':_0x53b5ba[_0x3af9('0x17')],'transfereecalleridnum':_0x53b5ba['transfertargetcalleridnum'],'transfereecalleridname':_0x53b5ba[_0x3af9('0x18')],'transfereeconnectedlinenum':_0x53b5ba['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x53b5ba[_0x3af9('0x19')],'transfereeaccountcode':_0x53b5ba[_0x3af9('0x1a')],'transfereecontext':_0x53b5ba[_0x3af9('0x1b')],'transfereeexten':_0x53b5ba['transfertargetexten'],'transfereelinkedid':_0x53b5ba[_0x3af9('0x1c')]});}writeDB(_0x53b5ba);}catch(_0x1088fc){utils[_0x3af9('0x9')](_0x1088fc['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 9a188b0..ee2b4f5 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 _0x9a82=['length','FOUND','NOTFOUND','getUserByInternal','catch','getUserByInterface','getUserByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','add','seconds','format','subtractTime','subtract','diffTime','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','info','debug','stringify','error','request','then','stack','GetUser','internal','name','interface','GETUSER|','result'];(function(_0x2a0252,_0x5936ce){var _0x56428e=function(_0x5dbcf3){while(--_0x5dbcf3){_0x2a0252['push'](_0x2a0252['shift']());}};_0x56428e(++_0x5936ce);}(_0x9a82,0x1b6));var _0x29a8=function(_0x284c4a,_0x314b94){_0x284c4a=_0x284c4a-0x0;var _0x1e94ce=_0x9a82[_0x284c4a];return _0x1e94ce;};'use strict';var jayson=require(_0x29a8('0x0'));var moment=require(_0x29a8('0x1'));var BPromise=require(_0x29a8('0x2'));var client=jayson[_0x29a8('0x3')][_0x29a8('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x29a8('0x5')]=function(_0x21c4d6){logger['info'](_0x21c4d6);};exports[_0x29a8('0x6')]=function(_0x43a667){logger[_0x29a8('0x6')](JSON[_0x29a8('0x7')](_0x43a667));};exports['error']=function(_0x453e6c){logger[_0x29a8('0x8')](_0x453e6c['stack']);};exports[_0x29a8('0x9')]=function(_0x2e7c0e,_0x198a63){return client[_0x29a8('0x9')](_0x2e7c0e,{'body':_0x198a63})[_0x29a8('0xa')](function(_0x57d2e9){logger[_0x29a8('0x6')](JSON[_0x29a8('0x7')](_0x57d2e9));})['catch'](function(_0xe0ec75){logger[_0x29a8('0x8')](_0xe0ec75[_0x29a8('0xb')]);});};function getUser(_0x117201){return client[_0x29a8('0x9')](_0x29a8('0xc'),{'options':{'raw':!![],'attributes':['id',_0x29a8('0xd'),_0x29a8('0xe'),_0x29a8('0xf')],'where':_0x117201,'limit':0x1}})[_0x29a8('0xa')](function(_0xe06600){logger[_0x29a8('0x5')](_0x29a8('0x10')+JSON[_0x29a8('0x7')](_0x117201)+'|'+(_0xe06600[_0x29a8('0x11')][_0x29a8('0x12')]?_0x29a8('0x13'):_0x29a8('0x14')));return _0xe06600[_0x29a8('0x11')][_0x29a8('0x12')]?_0xe06600[_0x29a8('0x11')][0x0]:null;});}exports[_0x29a8('0x15')]=function(_0xc2ece0){return new BPromise(function(_0x54970e,_0x39b4ed){if(_0xc2ece0){return getUser({'internal':_0xc2ece0})['then'](function(_0x41fa39){return _0x54970e(_0x41fa39);})[_0x29a8('0x16')](function(_0x269b0f){logger['error'](_0x269b0f[_0x29a8('0xb')]);return _0x54970e(null);});}else{return _0x54970e(null);}});};exports[_0x29a8('0x17')]=function(_0x29a1c1){return new BPromise(function(_0x25cce9,_0x4ac2a5){if(_0x29a1c1){return getUser({'interface':_0x29a1c1})[_0x29a8('0xa')](function(_0x19318f){return _0x25cce9(_0x19318f);})[_0x29a8('0x16')](function(_0x9abf5c){logger[_0x29a8('0x8')](_0x9abf5c['stack']);return _0x25cce9(null);});}else{return _0x25cce9(null);}});};exports[_0x29a8('0x18')]=function(_0x2b84b0){return new BPromise(function(_0x4339de,_0x319505){if(_0x2b84b0){return getUser({'name':_0x2b84b0})[_0x29a8('0xa')](function(_0x213d4c){return _0x4339de(_0x213d4c);})[_0x29a8('0x16')](function(_0x1aa7fe){logger['error'](_0x1aa7fe[_0x29a8('0xb')]);return _0x4339de(null);});}else{return _0x4339de(null);}});};exports['getVoiceQueueByName']=function(_0x44e20f){return new BPromise(function(_0x59bd7d,_0xb53c71){if(_0x44e20f){return client['request'](_0x29a8('0x19'),{'options':{'raw':!![],'attributes':['id',_0x29a8('0xe'),_0x29a8('0x1a'),_0x29a8('0x1b'),_0x29a8('0x1c')],'where':{'name':_0x44e20f},'limit':0x1}})[_0x29a8('0xa')](function(_0x1d4468){logger[_0x29a8('0x5')](_0x29a8('0x1d')+_0x44e20f+'|'+(_0x1d4468[_0x29a8('0x11')][_0x29a8('0x12')]?'FOUND':_0x29a8('0x14')));return _0x59bd7d(_0x1d4468[_0x29a8('0x11')]['length']?_0x1d4468[_0x29a8('0x11')][0x0]:null);})[_0x29a8('0x16')](function(_0x1886c3){logger['error'](_0x1886c3[_0x29a8('0xb')]);return _0x59bd7d(null);});}else{return _0x59bd7d(null);}});};exports['addTime']=function(_0x35a16a,_0x52bedc){return moment(_0x35a16a)[_0x29a8('0x1e')](_0x52bedc,_0x29a8('0x1f'))[_0x29a8('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x29a8('0x21')]=function(_0x44f14a,_0x5ae4bc){return moment(_0x44f14a)[_0x29a8('0x22')](_0x5ae4bc,_0x29a8('0x1f'))[_0x29a8('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x29a8('0x23')]=function(_0x259a0d,_0x2ce358){return moment(_0x259a0d)['diff'](moment(_0x2ce358),_0x29a8('0x1f'));};exports['sumTime']=function(_0xea845e,_0x56217){return parseInt(_0xea845e,0xa)+parseInt(_0x56217,0xa);};exports['now']=function(){return moment()[_0x29a8('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x29a8('0x24')]=function(_0x102a92,_0x56757c){if(_0x56757c){return moment(_0x102a92)[_0x29a8('0x24')](_0x56757c);}else{return!![];}};exports[_0x29a8('0x25')]=function(_0x288279,_0xf86447){if(_0xf86447){return moment(_0x288279)[_0x29a8('0x25')](_0xf86447);}else if(_0x288279){return!![];}else{return![];}}; \ No newline at end of file +var _0xecac=['name','interface','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','addTime','add','seconds','format','subtractTime','subtract','diffTime','sumTime','YYYY-MM-DD\x20HH:mm:ss','isAfter','moment','bluebird','http','../../config/logger','xdr','info','debug','error','stack','then','stringify','catch','request','GetUser','internal'];(function(_0x172a1a,_0x36108a){var _0x41acee=function(_0x4dc3be){while(--_0x4dc3be){_0x172a1a['push'](_0x172a1a['shift']());}};_0x41acee(++_0x36108a);}(_0xecac,0x95));var _0xceca=function(_0x257f41,_0x3ac525){_0x257f41=_0x257f41-0x0;var _0x2e9dd8=_0xecac[_0x257f41];return _0x2e9dd8;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xceca('0x0'));var BPromise=require(_0xceca('0x1'));var client=jayson['client'][_0xceca('0x2')]({'port':0x2329});var logger=require(_0xceca('0x3'))(_0xceca('0x4'));exports[_0xceca('0x5')]=function(_0x262e8b){logger[_0xceca('0x5')](_0x262e8b);};exports['debug']=function(_0x1125d3){logger[_0xceca('0x6')](JSON['stringify'](_0x1125d3));};exports[_0xceca('0x7')]=function(_0x24e1ee){logger['error'](_0x24e1ee[_0xceca('0x8')]);};exports['request']=function(_0xda292b,_0xa48b7f){return client['request'](_0xda292b,{'body':_0xa48b7f})[_0xceca('0x9')](function(_0x1862e6){logger[_0xceca('0x6')](JSON[_0xceca('0xa')](_0x1862e6));})[_0xceca('0xb')](function(_0x1fdb18){logger[_0xceca('0x7')](_0x1fdb18[_0xceca('0x8')]);});};function getUser(_0x9a3f0b){return client[_0xceca('0xc')](_0xceca('0xd'),{'options':{'raw':!![],'attributes':['id',_0xceca('0xe'),_0xceca('0xf'),_0xceca('0x10')],'where':_0x9a3f0b,'limit':0x1}})[_0xceca('0x9')](function(_0x4d8b86){logger[_0xceca('0x5')](_0xceca('0x11')+JSON[_0xceca('0xa')](_0x9a3f0b)+'|'+(_0x4d8b86[_0xceca('0x12')][_0xceca('0x13')]?_0xceca('0x14'):_0xceca('0x15')));return _0x4d8b86[_0xceca('0x12')][_0xceca('0x13')]?_0x4d8b86[_0xceca('0x12')][0x0]:null;});}exports[_0xceca('0x16')]=function(_0x399405){return new BPromise(function(_0x5b84eb,_0x1fd45d){if(_0x399405){return getUser({'internal':_0x399405})[_0xceca('0x9')](function(_0x24be3b){return _0x5b84eb(_0x24be3b);})[_0xceca('0xb')](function(_0x5ba76b){logger[_0xceca('0x7')](_0x5ba76b[_0xceca('0x8')]);return _0x5b84eb(null);});}else{return _0x5b84eb(null);}});};exports[_0xceca('0x17')]=function(_0x105afb){return new BPromise(function(_0x1ae5a7,_0x469bc9){if(_0x105afb){return getUser({'interface':_0x105afb})[_0xceca('0x9')](function(_0x3629fd){return _0x1ae5a7(_0x3629fd);})[_0xceca('0xb')](function(_0x3edef1){logger[_0xceca('0x7')](_0x3edef1[_0xceca('0x8')]);return _0x1ae5a7(null);});}else{return _0x1ae5a7(null);}});};exports[_0xceca('0x18')]=function(_0x6c23fa){return new BPromise(function(_0xa7a813,_0x561e51){if(_0x6c23fa){return getUser({'name':_0x6c23fa})[_0xceca('0x9')](function(_0x63ef45){return _0xa7a813(_0x63ef45);})[_0xceca('0xb')](function(_0x5b5600){logger[_0xceca('0x7')](_0x5b5600[_0xceca('0x8')]);return _0xa7a813(null);});}else{return _0xa7a813(null);}});};exports[_0xceca('0x19')]=function(_0x194bca){return new BPromise(function(_0x3c5649,_0x2471c4){if(_0x194bca){return client[_0xceca('0xc')](_0xceca('0x1a'),{'options':{'raw':!![],'attributes':['id',_0xceca('0xf'),_0xceca('0x1b'),_0xceca('0x1c'),_0xceca('0x1d')],'where':{'name':_0x194bca},'limit':0x1}})['then'](function(_0x5d9146){logger[_0xceca('0x5')](_0xceca('0x1e')+_0x194bca+'|'+(_0x5d9146['result'][_0xceca('0x13')]?'FOUND':_0xceca('0x15')));return _0x3c5649(_0x5d9146[_0xceca('0x12')]['length']?_0x5d9146[_0xceca('0x12')][0x0]:null);})[_0xceca('0xb')](function(_0x47f164){logger[_0xceca('0x7')](_0x47f164[_0xceca('0x8')]);return _0x3c5649(null);});}else{return _0x3c5649(null);}});};exports[_0xceca('0x1f')]=function(_0x4ce041,_0xc581e1){return moment(_0x4ce041)[_0xceca('0x20')](_0xc581e1,_0xceca('0x21'))[_0xceca('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xceca('0x23')]=function(_0x3c10c8,_0x1d7110){return moment(_0x3c10c8)[_0xceca('0x24')](_0x1d7110,_0xceca('0x21'))[_0xceca('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xceca('0x25')]=function(_0x31a234,_0x35a665){return moment(_0x31a234)['diff'](moment(_0x35a665),_0xceca('0x21'));};exports[_0xceca('0x26')]=function(_0x1702c4,_0x1ecd36){return parseInt(_0x1702c4,0xa)+parseInt(_0x1ecd36,0xa);};exports['now']=function(){return moment()[_0xceca('0x22')](_0xceca('0x27'));};exports[_0xceca('0x28')]=function(_0x5e0848,_0x5c2597){if(_0x5c2597){return moment(_0x5e0848)[_0xceca('0x28')](_0x5c2597);}else{return!![];}};exports['isBefore']=function(_0x1d83fd,_0x243c3f){if(_0x243c3f){return moment(_0x1d83fd)['isBefore'](_0x243c3f);}else if(_0x1d83fd){return!![];}else{return![];}}; \ No newline at end of file diff --git a/snippet/1.0.15/assets/images/avatars/agent0.png b/snippet/1.0.15/assets/images/avatars/agent0.png deleted file mode 100644 index 1a4c242..0000000 Binary files a/snippet/1.0.15/assets/images/avatars/agent0.png and /dev/null differ diff --git a/snippet/1.0.15/assets/images/avatars/customer0.png b/snippet/1.0.15/assets/images/avatars/customer0.png deleted file mode 100644 index a83b87c..0000000 Binary files a/snippet/1.0.15/assets/images/avatars/customer0.png and /dev/null differ diff --git a/snippet/1.0.15/assets/images/avatars/robot0.png b/snippet/1.0.15/assets/images/avatars/robot0.png deleted file mode 100644 index 98f057e..0000000 Binary files a/snippet/1.0.15/assets/images/avatars/robot0.png and /dev/null differ diff --git a/snippet/1.0.15/assets/images/logos/whisker_32x32.png b/snippet/1.0.15/assets/images/logos/whisker_32x32.png deleted file mode 100644 index 463f34e..0000000 Binary files a/snippet/1.0.15/assets/images/logos/whisker_32x32.png and /dev/null differ diff --git a/snippet/1.0.15/fonts/materialdesignicons-webfont.eot b/snippet/1.0.15/fonts/materialdesignicons-webfont.eot deleted file mode 100644 index cc615bd..0000000 Binary files a/snippet/1.0.15/fonts/materialdesignicons-webfont.eot and /dev/null differ diff --git a/snippet/1.0.15/fonts/materialdesignicons-webfont.svg b/snippet/1.0.15/fonts/materialdesignicons-webfont.svg deleted file mode 100644 index d9e3e93..0000000 --- a/snippet/1.0.15/fonts/materialdesignicons-webfont.svg +++ /dev/null @@ -1,8694 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/snippet/1.0.15/fonts/materialdesignicons-webfont.ttf b/snippet/1.0.15/fonts/materialdesignicons-webfont.ttf deleted file mode 100644 index 42a11c8..0000000 Binary files a/snippet/1.0.15/fonts/materialdesignicons-webfont.ttf and /dev/null differ diff --git a/snippet/1.0.15/fonts/materialdesignicons-webfont.woff b/snippet/1.0.15/fonts/materialdesignicons-webfont.woff deleted file mode 100644 index 8f9f3c9..0000000 Binary files a/snippet/1.0.15/fonts/materialdesignicons-webfont.woff and /dev/null differ diff --git a/snippet/1.0.15/fonts/materialdesignicons-webfont.woff2 b/snippet/1.0.15/fonts/materialdesignicons-webfont.woff2 deleted file mode 100644 index bf6efee..0000000 Binary files a/snippet/1.0.15/fonts/materialdesignicons-webfont.woff2 and /dev/null differ diff --git a/snippet/1.0.15/index.html b/snippet/1.0.15/index.html deleted file mode 100644 index a16f821..0000000 --- a/snippet/1.0.15/index.html +++ /dev/null @@ -1,66 +0,0 @@ - - - - - xCally Motion Chat - - - - - - - - - - - -
-
- - - - - - - - -
-
- logo -
- - - {{settings.defaultTitle ? settings.defaultTitle : (status === 'online' ? settings.header_online : settings.header_offline)}} - - - - - - - -
- -
- - - -
- -
- -
-
- -
-
- - - - - - - - - diff --git a/snippet/1.0.15/scripts/app.js b/snippet/1.0.15/scripts/app.js deleted file mode 100644 index e3a817d..0000000 --- a/snippet/1.0.15/scripts/app.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";function e(t){return function(e){return t.trustAsHtml(e)}}e.$inject=["$sce"],angular.module("motion",["ngAnimate","ngAria","ngMessages","ngMaterial","ngResource","ngSanitize","ngCsv","ngEmbed","ui.router","LocalStorageModule","ngRateIt","flow"]).filter("toTrusted",e).constant("STORAGE_PREFIX","motion_chat").constant("STORAGE_VISITOR","visitor").constant("STORAGE_LAYOUT","layout").directive("ngEnter",function(){return function(t,e,n){e.bind("keydown keypress",function(e){13===e.which&&(t.$apply(function(){t.$eval(n.ngEnter)}),e.preventDefault())})}}).directive("ngPrint",function(){function i(e,t){for(var n,i=document.createElement("div"),o=t.visitor,r=t.settings,s=0;s"+document.title+""),m.document.write(""),m.document.write("

Website: "+r.referer+"

"),m.document.write("

Start Time: "+moment(n).format("YYYY-MM-DD HH:mm:ss")+"

"),m.document.write("

Print Time: "+moment().format("YYYY-MM-DD HH:mm:ss")+"

"),m.document.write(i.innerHTML),m.document.write(""),m.document.close(),m.focus(),m.print(),m.close()}return{link:function(t,e,n){e.on("click",function(){var e=document.getElementById("chatContent1");e&&i(e,t)})},restrict:"A"}})}(),function(){"use strict";function e(e,r,t,n,i,o,s,a,l,d){var c,m,g,u,p=this;p.errors={},r.messages=[],p.emojiOptions={watchEmbedData:!1,fontSmiley:!1,emoji:!0,link:!0,linkTarget:"_blank"},p.$onInit=function(){r.status="chat",r.loading=!1,r.settings.showMenu=!0,p.replyMessage="",r.visitor.interaction&&r.visitor.interaction.closed?(r.updateStorage(l,null,!0),r.updateStorage(d,null,!0),f()):(v(),m=n(b,2e3),g=n(v,3e3));c=$("#emojionearea").emojioneArea({placeholder:r.settings.placeholderMessage||"Type a message",events:{keyup:function(e,t){x(t)},ready:function(){this.setFocus()}}})},p.reply=x,p.reply_button=function(e){var t=c[0].emojioneArea.getText();if(""===t)return;y(_.merge({body:t},r.visitor)),c[0].emojioneArea.setFocus()},p.fileAdded=function(e){var t=new FormData;t.append("file",e.file),s.post(r.settings.remote+"/api/chat/interactions/"+r.visitor.interaction.id+"/attachment_upload?token="+r.settings.token,t,{transformRequest:angular.identity,headers:{"Content-Type":void 0}}).then(function(e){(e=e.data).id?(delete p.errors.sendAttachment,y(_.merge({body:''+e.name+"",AttachmentId:e.id},r.visitor))):h("sendAttachment")},h("sendAttachment"))},e.$on("$destroy",function(){n.cancel(m),n.cancel(g),g=m=null}),r.$on("$download",function(e,t){t&&t(_.values(r.messages))});function f(){r.settings.online?o.go("app.online",null,{location:"replace"}):o.go("app.offline",null,{location:"replace"})}function v(){r.visitor&&r.visitor.interaction&&r.visitor.interaction.id&&a.chatInteraction.get({id:r.visitor.interaction.id}).$promise.then(function(e){delete p.errors.getInteraction,e.closed&&(r.visitor.interaction.closed=!0,r.updateStorage(l,r.visitor),"unmanaged"===e.disposition?o.go("app.unmanaged",null,{location:"replace"}):o.go("app.closing",null,{location:"replace"}))}).catch(function(e){switch(e.status){case 403:o.go("app.closing",null,{location:"replace"});break;case 404:r.updateStorage(l,null,!0),r.updateStorage(d,null,!0),f();break;case 405:o.go("app.unmanaged",null,{location:"replace"});break;default:console.error(e)}})}function h(t){return function(e){p.errors[t]=e.data,w()}}function x(e){var t=c[0].emojioneArea.getText();e&&13===e.keyCode&&e.shiftKey||e&&13!==e.keyCode||""!==t&&y(_.merge({body:t},r.visitor))}function y(e){a.chatWebsite.notify(e).$promise.then(function(e){delete p.errors.chatMessageError,_.isNil(r.visitor.interaction)&&(r.visitor.interaction={id:e.interaction.id},r.updateStorage(l,r.visitor)),c[0].emojioneArea.setText(""),w()}).catch(h("chatMessageError"))}function b(){r.visitor&&r.visitor.interaction&&r.visitor.interaction.id&&a.chatInteraction.getMessages({intid:r.visitor.interaction.id,includeAgent:!0,id:u||void 0}).$promise.then(function(e){if(delete p.errors.interaction,e.count){for(var t=0,n=!1;t=Number(l.settings.maxInteractions),o||!r&&i?"app.online":"app.offline"),null,{location:"replace"});var i,o,r;var s="";s=l.settings.online||!l.settings.hideWhenOffline?"init":"offline";d.parent.postMessage({cmd:s,div_color:l.settings.color,text_color:l.settings.textColor,client_height:Math.max(document.documentElement.clientHeight,window.innerHeight||0),client_width:document.documentElement.clientWidth},"*");var a=document.createElement("style");document.head.appendChild(a),a.sheet.insertRule(".mdi-send:before {color:"+l.settings.color+"!important}"),window.visualViewport&&window.visualViewport.addEventListener("resize",function(e){if(document.getElementById("chatContent1")){var t=p();f(t)}})},e.close=function(){var e=l.visitor.interaction;if(e&&e.id){var t=n.confirm().parent(angular.element(document.querySelector("#chat-app"))).clickOutsideToClose(!0).title(l.settings.closingQuestion||"Do you want to close the interaction?").ok("Ok").cancel("Cancel");n.show(t).then(function(){return o.chatInteraction.customUpdate({id:e.id,closed:!0,closeReason:"contact",closedAt:moment().format("YYYY-MM-DD HH:mm:ss")}).$promise}).then(function(){c.go("app.closing",null,{location:"replace"})}).catch(function(e){console.error("keep open",e)})}},e.toggle=v,e.download=function(e){var t=i.defer(),n=l.visitor.interaction;n&&n.id&&o.chatInteraction.getMessages({intid:n.id,includeAll:!0}).$promise.then(function(e){t.resolve(_.map(e.rows.slice(1),function(e){var t;if("in"===e.direction&&(t=l.settings.customerAlias||l.visitor.from||"Visitor"+e.ContactId),"out"===e.direction)switch(l.settings.agentIdentifier){case"website_alias":t=e.UserId?l.settings.agentAlias+e.UserId:"System";break;case"agent_alias":t=e.UserId?e.User.alias||e.User.fullname:"System";break;case"agent_fullname":t=e.UserId?e.User.fullname:"System";break;default:t=e.UserId?l.settings.agentAlias+e.UserId:"System"}return{sender:t,message:e.body,createdAt:moment(e.createdAt).format("MM/DD/YYYY HH:mm:ss")}}))}).catch(function(e){console.error(e)});return t.promise},e.getHeaderShape=function(){return"rounded"===l.settings.header_shape?"15px":"0px"},l.updateStorage=s;var r=0;function p(){var e=Math.max(document.body.clientHeight,window.innerHeight||0),t=e/100*r+450;return e]+)>)/i);a.checkHTML[e]=n(t.props.helpText)}}}).catch(function(e){console.error(e)})},a.submit=function(){o.loading=!0;for(var e=0;e]+)>)/i);l.checkHTML[e]=n(t.props.helpText)}}}).catch(function(e){console.error(e)}))},l.submit=function(){for(var e="New chat request \n",t=0;t\n
\n system\n agent\n customer\n\n
\n
\n
\n \n {{message.direction === \'out\' ? (message.UserId ? (settings.agentAlias + message.UserId) : settings.systemAlias) : (settings.customerAlias || visitor.from || \'Visitor\' + message.ContactId)}}\n - {{message.createdAt | date : \'h:mm\'}}\n \n \n {{message.direction === \'out\' ? (message.UserId ? (message.User.alias || message.User.fullname) : settings.systemAlias) : (settings.customerAlias || visitor.from || \'Visitor\' + message.ContactId)}}\n - {{message.createdAt | date : \'h:mm\'}}\n \n \n {{message.direction === \'out\' ? (message.UserId ? message.User.fullname : settings.systemAlias) : (settings.customerAlias || visitor.from || \'Visitor\' + message.ContactId)}}\n - {{message.createdAt | date : \'h:mm\'}}\n \n \n {{message.direction === \'out\' ? (message.UserId ? ((settings.agentAlias || \'Agent\') + message.UserId) : settings.systemAlias) : (settings.customerAlias || visitor.from || \'Visitor\' + message.ContactId)}}\n - {{message.createdAt | date : \'h:mm\'}}\n \n
\n
\n \n \n
\n
\n \n
\n
\n
\n
\n \n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n\x3c!-- / CHAT CONTENT --\x3e\n\n\x3c!-- CHAT FOOTER --\x3e\n\n\x3c!-- / CHAT FOOTER --\x3e'),e.put("app/closing/index.html",'\x3c!-- CHAT CONTENT --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n \n \n\n
\n \n \n \x3c!-- START thumb rating --\x3e\n \n \n
\n \n
\n
\n \n
\n \n
\n
\n
\n \x3c!-- END thumb rating --\x3e\n\n \x3c!-- START star rating --\x3e\n
\n \n
\n \x3c!-- END star rating --\x3e\n
\n\n \n \x3c!-- START textarea --\x3e\n


{{settings.feedbackTitle}}
\n \n \x3c!-- END textarea --\x3e\n
\n\n \n {{settings.forwardTranscriptMessage}}\n Email\n \x3c!-- START email --\x3e\n \n
\n
\n Email must be a valid e-mail address\n
\n
\n \x3c!-- END email --\x3e\n
\n\n
\n \n {{settings.closingMessageButton}}\n \n \n {{settings.skipMessageButton}}\n \n
\n
\n\n \n \n \n\n
\n\x3c!-- / CHAT CONTENT --\x3e\n'),e.put("app/offline/index.html",'\x3c!-- CHAT CONTENT --\x3e\r\n\r\n\r\n
\r\n\r\n
\r\n
\r\n {{field.props.title + (field.config.required ? \'*\' : \'\')}}\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n \x3c!-- CHAT ERROR --\x3e\r\n
\r\n \r\n {{error.message || \'Service temporarily unavailable.\'}}\r\n {{error.message || \'Service temporarily unavailable.\'}}\r\n
\r\n \x3c!-- CHAT ERROR --\x3e\r\n\r\n \r\n \x3c!-- START label --\x3e\r\n
\r\n \r\n {{field.value}}\r\n \r\n
\r\n \x3c!-- END label --\x3e\r\n\r\n \x3c!-- START textinput --\x3e\r\n
\r\n \r\n
\r\n \x3c!-- END textinput --\x3e\r\n\r\n \x3c!-- START textarea --\x3e\r\n
\r\n \r\n
\r\n \x3c!-- END textarea --\x3e\r\n\r\n \x3c!-- START select --\x3e\r\n
\r\n \r\n {{option.value}}\r\n \r\n
\r\n \x3c!-- END select --\x3e\r\n\r\n \x3c!-- START radio --\x3e\r\n
\r\n \r\n {{option.value}}\r\n \r\n
\r\n \x3c!-- END radio --\x3e\r\n\r\n \x3c!-- START checkbox --\x3e\r\n
\r\n
\r\n \r\n {{option.value}}\r\n \r\n
\r\n
\r\n \x3c!-- END checkbox --\x3e\r\n\r\n \x3c!-- START agreement --\x3e\r\n
\r\n \r\n {{field.options[0].value}}\r\n \r\n
\r\n \x3c!-- END agreement --\x3e\r\n\r\n
\r\n
\r\n Required Field\r\n
\r\n
\r\n Wrong type field\r\n
\r\n
\r\n
\r\n
\r\n\r\n \r\n {{settings.offline_chat_button}}\r\n \r\n
\r\n\r\n \r\n \r\n \r\n
\r\n\x3c!-- / CHAT CONTENT --\x3e\r\n'),e.put("app/online/index.html",'\x3c!-- CHAT CONTENT --\x3e\r\n\r\n
\r\n
\r\n {{field.props.title + (field.config.required ? \'*\' : \'\')}}\r\n\r\n \r\n
\r\n
\r\n
\r\n\r\n \x3c!-- CHAT ERROR --\x3e\r\n
\r\n \r\n {{error.message || \'Service temporarily unavailable.\'}}\r\n {{error.message || \'Service temporarily unavailable.\'}}\r\n
\r\n \x3c!-- CHAT ERROR --\x3e\r\n\r\n \r\n \x3c!-- START label --\x3e\r\n
\r\n \r\n {{field.value}}\r\n \r\n
\r\n \x3c!-- END label --\x3e\r\n\r\n \x3c!-- START textinput --\x3e\r\n
\r\n \r\n
\r\n \x3c!-- END textinput --\x3e\r\n\r\n \x3c!-- START textarea --\x3e\r\n
\r\n \r\n
\r\n \x3c!-- END textarea --\x3e\r\n\r\n \x3c!-- START select --\x3e\r\n
\r\n \r\n {{option.value}}\r\n \r\n
\r\n \x3c!-- END select --\x3e\r\n\r\n \x3c!-- START radio --\x3e\r\n
\r\n \r\n {{option.value}}\r\n \r\n
\r\n \x3c!-- END radio --\x3e\r\n\r\n \x3c!-- START checkbox --\x3e\r\n
\r\n \r\n {{option.value}}\r\n \r\n
\r\n \x3c!-- END checkbox --\x3e\r\n\r\n \x3c!-- START agreement --\x3e\r\n
\r\n \r\n {{field.options[0].value}}\r\n \r\n
\r\n \x3c!-- END agreement --\x3e\r\n\r\n
\r\n
\r\n Required Field\r\n
\r\n
\r\n Wrong type field\r\n
\r\n
\r\n
\r\n
\r\n \r\n {{settings.start_chat_button}}\r\n \r\n
\r\n\r\n \r\n \r\n \r\n
\r\n\x3c!-- / CHAT CONTENT --\x3e\r\n'),e.put("app/unmanaged/index.html",'\x3c!-- CHAT CONTENT --\x3e\n\n \x3c!-- CHAT ERROR --\x3e\n
\n \n {{error.message || \'Service temporarily unavailable.\'}}\n {{error.message || \'Service temporarily unavailable.\'}}\n
\n \x3c!-- CHAT ERROR --\x3e\n\n \n {{ settings.unmanagedMessage }}\n \n\n
\n {{ settings.noteTitle || \'Note\' }}\n\n \n \x3c!-- START textarea --\x3e\n \n \x3c!-- END textarea --\x3e\n \n\n
\n \n {{settings.sendUnmanaged}}\n \n \n {{settings.skipUnmanaged}}\n \n
\n
\n\n \n \n \n
\n\x3c!-- / CHAT CONTENT --\x3e\n'),e.put("app/waiting/index.html",'\x3c!-- WAITING CONTENT --\x3e\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n {{settings.waitingTitle}}\n
\n
\n {{settings.waitingMessage}}\n
\n
\n\x3c!-- / WAITING CONTENT --\x3e\n')}]); \ No newline at end of file diff --git a/snippet/1.0.15/scripts/vendor.js b/snippet/1.0.15/scripts/vendor.js deleted file mode 100644 index 8fde046..0000000 --- a/snippet/1.0.15/scripts/vendor.js +++ /dev/null @@ -1 +0,0 @@ -!function(de){"use strict";var u={objectMaxDepth:5,urlErrorParamsEnabled:!0};function e(e){if(!Ee(e))return u;O(e.objectMaxDepth)&&(u.objectMaxDepth=c(e.objectMaxDepth)?e.objectMaxDepth:NaN),O(e.urlErrorParamsEnabled)&&Ae(e.urlErrorParamsEnabled)&&(u.urlErrorParamsEnabled=e.urlErrorParamsEnabled)}function c(e){return E(e)&&0").append(e).html();try{return e[0].nodeType===Ue?pe(t):t.match(/^(<[^>]+>)/)[1].replace(/^<([\w-]+)/,function(e,t){return"<"+pe(t)})}catch(e){return pe(t)}}function K(e){try{return decodeURIComponent(e)}catch(e){}}function Z(e){var i={};return ve((e||"").split("&"),function(e){var t,n,r;e&&(n=e=e.replace(/\+/g,"%20"),-1!==(t=e.indexOf("="))&&(n=e.substring(0,t),r=e.substring(t+1)),O(n=K(n))&&(r=!O(r)||K(r),me.call(i,n)?ke(i[n])?i[n].push(r):i[n]=[i[n],r]:i[n]=r))}),i}function X(e){return Q(e,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Q(e,t){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,t?"%20":"+")}var J=["ng-","data-ng-","ng:","x-ng-"];var ee=function(n){var e=n.currentScript;if(!e)return!0;if(!(e instanceof de.HTMLScriptElement||e instanceof de.SVGScriptElement))return!1;var t=e.attributes;return[t.getNamedItem("src"),t.getNamedItem("href"),t.getNamedItem("xlink:href")].every(function(e){if(!e)return!0;if(!e.value)return!1;var t=n.createElement("a");if(t.href=e.value,n.location.origin===t.origin)return!0;switch(t.protocol){case"http:":case"https:":case"ftp:":case"blob:":case"file:":case"data:":return!0;default:return!1}})}(de.document);function te(r,e){var i,o,t={};if(ve(J,function(e){var t=e+"app";!i&&r.hasAttribute&&r.hasAttribute(t)&&(o=(i=r).getAttribute(t))}),ve(J,function(e){var t,n=e+"app";!i&&(t=r.querySelector("["+n.replace(":","\\:")+"]"))&&(o=(i=t).getAttribute(n))}),i){if(!ee)return void de.console.error("AngularJS: disabling automatic bootstrap.